Added Symbian2 smoketests from FBF at changeset bde28f2b1d99 Symbian2
authorMaciej Seroka <maciejs@symbian.org>
Thu, 21 Jan 2010 12:53:44 +0000
branchSymbian2
changeset 1 8758140453c0
parent 0 e8c1ea2c6496
child 2 e904b452aa85
Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Group/8.0a/configuration.cfg
Group/8.0b/configuration.cfg
Group/8.1a/configuration.cfg
Group/8.1b/configuration.cfg
Group/9.0/configuration.cfg
Group/9.1/configuration.cfg
Group/ReadMe.doc
Group/bld.inf
Group/configuration.cfg
Group/smoketest.pl
Group/smoketest.xml
Group/testtools_smoketest.history.xml
Group/testtools_smoketest.mrp
IM/BWINS/DEMOMODULEU.DEF
IM/EABI/DemomoduleU.def
IM/group/Bld.inf
IM/group/IMApiTest.mmp
IM/inc/IMApiMTHandlers.h
IM/inc/IMApiTest.h
IM/inc/ParserUtils.h
IM/inc/TestRunner.h
IM/init/TestFramework.ini
IM/init/imapitest.ini
IM/src/IMApiMTHandlers.cpp
IM/src/IMApiTest.cpp
IM/src/IMApiTestcases.cpp
IM/src/ParserUtils.cpp
IM/src/TestRunner.cpp
ReadMe.doc
SmokeTest.pm
SmokeTestClient.pl
SmokeTestROM.pm
SmokeTestServer.pl
SmokeTestSuite.pm
System/Group/Smoketest_System.mmp
System/Group/bld.inf
System/Inc/TestSystemBase.h
System/ReadMe.doc
System/Src/TestSystemBase.cpp
Timew/ConsoleAlarmAlertServer/ConsoleAlarmAlertServer.mmp
Timew/ConsoleAlarmAlertServer/Include/ConsoleAlarmAlertConsole.h
Timew/ConsoleAlarmAlertServer/Include/ConsoleAlarmAlertLEDFlasher.h
Timew/ConsoleAlarmAlertServer/Include/ConsoleAlarmAlertServer.h
Timew/ConsoleAlarmAlertServer/Include/ConsoleAlarmAlertServerMain.h
Timew/ConsoleAlarmAlertServer/Include/ConsoleAlarmAlertSession.h
Timew/ConsoleAlarmAlertServer/Source/ConsoleAlarmAlertConsole.cpp
Timew/ConsoleAlarmAlertServer/Source/ConsoleAlarmAlertLEDFlasher.cpp
Timew/ConsoleAlarmAlertServer/Source/ConsoleAlarmAlertServer.cpp
Timew/ConsoleAlarmAlertServer/Source/ConsoleAlarmAlertServerMain.cpp
Timew/ConsoleAlarmAlertServer/Source/ConsoleAlarmAlertSession.cpp
Timew/ConsoleAlarmAlertServer/bld.inf
Timew/Group/Smoketest_Timew.mmp
Timew/Group/bld.inf
Timew/Inc/ALMMOD.H
Timew/Inc/ALMMOD.INL
Timew/Inc/SM_STD.H
Timew/Inc/TIMEWMOD.H
Timew/Inc/TestTimewBase.h
Timew/Inc/TestTimewServer.h
Timew/Inc/TestTimewSetAlarm.h
Timew/ReadMe.doc
Timew/Scripts/Smoketest_Timew.script
Timew/Scripts/setup_Smoketest_Timew.script
Timew/Src/SM_ALM.CPP
Timew/Src/SM_MOD.CPP
Timew/Src/SM_RSP.CPP
Timew/Src/SM_UTL.CPP
Timew/Src/TestTimewBase.cpp
Timew/Src/TestTimewServer.cpp
Timew/Src/TestTimewSetAlarm.cpp
Timew/TestData/Smoketest_Timew.ini
Timew/bmarm/CONSOLEALARMALERTSERVERU.DEF
Timew/bwins/CONSOLEALARMALERTSERVERU.DEF
Timew/bwins/SMOKETEST_TIMEW_SERVERU.DEF
Timew/eabi/ConsoleAlarmAlertServerU.DEF
Utils/Inc/SmokeTestActive.h
Utils/Inc/SmokeTestProperty.h
Utils/Inc/SmokeTestSecureFSclient.h
Utils/Inc/SmokeTestSecureFSclientserver.h
Utils/Inc/SmokeTestSecureFSserver.h
Utils/Inc/SmokeTestTimeOutTimer.h
Utils/Inc/TestStepSmokeTest.h
Utils/ReadMe.doc
Utils/Src/SmokeTestActive.cpp
Utils/Src/SmokeTestProperty.cpp
Utils/Src/SmokeTestSecureFSclient.cpp
Utils/Src/SmokeTestSecureFSserver.cpp
Utils/Src/SmokeTestTimeOutTimer.cpp
Utils/Src/TestStepSmokeTest.cpp
Utils/bwins/SmokeTestSecureFSClientU.DEF
Utils/bwins/SmokeTest_UtilsU.DEF
Utils/eabi/SmokeTestSecureFSclientU.DEF
Utils/eabi/SmokeTest_UtilsU.DEF
Utils/group/SmokeTestSecureFSclient.mmp
Utils/group/SmokeTestSecureFSserver.mmp
Utils/group/SmokeTest_Utils.mmp
Utils/group/bld.inf
agenda/Group/Smoketest_Agenda.mmp
agenda/Group/bld.inf
agenda/Inc/TestAgendaAddAppt.h
agenda/Inc/TestAgendaBase.h
agenda/Inc/TestAgendaCreateDB.h
agenda/Inc/TestAgendaServer.h
agenda/Inc/TestAgendaServerLaunchProgress.h
agenda/ReadMe.doc
agenda/Scripts/Smoketest_Agenda.script
agenda/Scripts/setup_Smoketest_Agenda.script
agenda/Src/TestAgendaAddAppt.cpp
agenda/Src/TestAgendaBase.cpp
agenda/Src/TestAgendaCreateDB.cpp
agenda/Src/TestAgendaServer.cpp
agenda/Src/TestAgendaServerLaunchProgress.cpp
agenda/Src/sm_agenda.ini
agenda/TestData/Smoketest_Agenda.ini
agenda/bwins/SMOKETEST_AGENDA_SERVERU.DEF
appinstall/Bmarm/AppInstallSmokeTestModuleU.DEF
appinstall/Bwins/AppInstallSmokeTestModuleU.DEF
appinstall/EABI/AppInstallSmokeTestModuleU.def
appinstall/conf/AppInstallSmokeTestModule.cfg
appinstall/data/sistest.sisx
appinstall/data/sistest_winscw.sisx
appinstall/group/AppInstallSmokeTestModule.mmp
appinstall/group/Bld.inf
appinstall/inc/AppInstallSmokeTestModule.h
appinstall/src/AppInstallSmokeTestModule.cpp
appinstall/src/AppInstallSmokeTestModuleBlocks.cpp
apploader/Group/bld.inf
apploader/Group/smoketest_apploader.mmp
apploader/Inc/TestAppLoaderAppStart.h
apploader/Inc/TestAppLoaderBase.h
apploader/Inc/TestAppLoaderEndTask.h
apploader/Inc/TestAppLoaderKeyEvents.h
apploader/Inc/TestAppLoaderKillProcess.h
apploader/Inc/TestAppLoaderServer.h
apploader/Inc/TestAppLoaderTaskRunning.h
apploader/ReadMe.doc
apploader/Src/TestAppLoaderAppStart.cpp
apploader/Src/TestAppLoaderBase.cpp
apploader/Src/TestAppLoaderEndTask.cpp
apploader/Src/TestAppLoaderKeyEvents.cpp
apploader/Src/TestAppLoaderKillProcess.cpp
apploader/Src/TestAppLoaderServer.cpp
apploader/Src/TestAppLoaderTaskRunning.cpp
apploader/scripts/setup_smoketest_apploader.script
apploader/scripts/smoketest_apploader.script
apploader/testdata/smoketest_apploader.ini
contacts/ReadMe.doc
contacts/TestData/Smoketest_Contacts.ini
contacts/bwins/SMOKETEST_CONTACTS_SERVERU.DEF
contacts/group/Smoketest_Contacts.mmp
contacts/group/bld.inf
contacts/inc/SmoketestContactsServer.h
contacts/inc/TestContact.h
contacts/inc/TestContactsAddEntries.h
contacts/inc/TestContactsBase.h
contacts/inc/TestContactsCreateDB.h
contacts/scripts/Smoketest_Contacts.script
contacts/scripts/setup_Smoketest_Contacts.script
contacts/src/SmoketestContactsServer.cpp
contacts/src/TestContact.cpp
contacts/src/TestContactsAddEntries.cpp
contacts/src/TestContactsBase.cpp
contacts/src/TestContactsCreateDB.cpp
contacts/src/sm_contacts.ini
email/email/group/MachineName.txt
email/email/group/bld.inf
email/email/group/machinename.pl
email/email/pop/group/T_PopServer.mmp
email/email/pop/group/bld.inf
email/email/pop/inc/CExpMailInfo.h
email/email/pop/inc/CExpMailInfo.inl
email/email/pop/inc/T_CheckChildrenCountPop.h
email/email/pop/inc/T_CheckPop3AccessPoint.h
email/email/pop/inc/T_CheckPopBMSetting.h
email/email/pop/inc/T_CheckPopSNAPSetting.h
email/email/pop/inc/T_ComparePopEmailMsgs.h
email/email/pop/inc/T_ComparePopSettings.h
email/email/pop/inc/T_ConnectPop3Server.h
email/email/pop/inc/T_CopyPopSelection.h
email/email/pop/inc/T_CreatePopAccount.h
email/email/pop/inc/T_CreatePopAccountWithoutSmtp.h
email/email/pop/inc/T_DeleteAllPopChildren.h
email/email/pop/inc/T_DeletePopAccount.h
email/email/pop/inc/T_DisConnectPop3Server.h
email/email/pop/inc/T_ModifyPopSettings.h
email/email/pop/inc/T_ModifyPopSettings2.h
email/email/pop/inc/T_MsgAsyncStepPOP.h
email/email/pop/inc/T_MsgSharedDataPop.h
email/email/pop/inc/T_MsgSyncStepPop.h
email/email/pop/inc/T_PopInvokeAsyncFunction.h
email/email/pop/inc/T_PopServer.h
email/email/pop/inc/T_RemovePopSNAPSetting.h
email/email/pop/inc/T_SharedDataPop.h
email/email/pop/inc/T_StartRamUsageTimer.h
email/email/pop/inc/T_StopRamUsageTimer.h
email/email/pop/inc/T_VerfiyPopSettings.h
email/email/pop/inc/T_VerifyPopAccountsCount.h
email/email/pop/scripts/plainbody/setup_smoketest_email.script
email/email/pop/scripts/plainbody/smoketest_email.script
email/email/pop/src/T_CheckChildrenCountPop.cpp
email/email/pop/src/T_CheckPop3AccessPoint.cpp
email/email/pop/src/T_CheckPopBMSetting.cpp
email/email/pop/src/T_CheckPopSNAPSetting.cpp
email/email/pop/src/T_ComparePopEmailMsgs.cpp
email/email/pop/src/T_ComparePopSettings.cpp
email/email/pop/src/T_ConnectPop3Server.cpp
email/email/pop/src/T_CopyPopSelection.cpp
email/email/pop/src/T_CreatePopAccount.cpp
email/email/pop/src/T_CreatePopAccountWithoutSmtp.cpp
email/email/pop/src/T_DeleteAllPopChildren.cpp
email/email/pop/src/T_DeletePopAccount.cpp
email/email/pop/src/T_DisconnectPop3Server.cpp
email/email/pop/src/T_ModifyPopSettings.cpp
email/email/pop/src/T_ModifyPopSettings2.cpp
email/email/pop/src/T_MsgAsyncStepPOP.cpp
email/email/pop/src/T_MsgSharedDataPop.cpp
email/email/pop/src/T_MsgSyncStepPOP.cpp
email/email/pop/src/T_PopInvokeAsyncFunction.cpp
email/email/pop/src/T_PopServer.cpp
email/email/pop/src/T_RemovePopSNAPSetting.cpp
email/email/pop/src/T_SharedDataPop.cpp
email/email/pop/src/T_StartRamUsageTimer.cpp
email/email/pop/src/T_StopRamUsageTimer.cpp
email/email/pop/src/T_VerifyPopAccountsCount.cpp
email/email/pop/src/T_VerifyPopSettings.cpp
email/email/pop/testdata/EmailMessage/20KBody.txt
email/email/pop/testdata/EmailSettings/POPSettings_test908.txt
email/email/pop/testdata/plainbody/smoketest_email.ini
email/email/smtp/group/T_SmtpServer.mmp
email/email/smtp/group/bld.inf
email/email/smtp/inc/ImCltCvRecv.h
email/email/smtp/inc/ImCltCvRecv.inl
email/email/smtp/inc/Local_imcvrecv.h
email/email/smtp/inc/T_CheckSmtpBMSetting.h
email/email/smtp/inc/T_CheckSmtpSNAPSetting.h
email/email/smtp/inc/T_CreateSmtpAccount.h
email/email/smtp/inc/T_CreateSmtpMessageFromEmailFile.h
email/email/smtp/inc/T_CreateSmtpMobilityAccount.h
email/email/smtp/inc/T_ModifySmtpSettings.h
email/email/smtp/inc/T_MsgAsyncStepSMTP.h
email/email/smtp/inc/T_MsgSharedDataSmtp.h
email/email/smtp/inc/T_MsgSyncStepSMTP.h
email/email/smtp/inc/T_RemoveSmtpSNAPSetting.h
email/email/smtp/inc/T_RetrievePlainBodyTextAndCompare.h
email/email/smtp/inc/T_SendSmtpMessage.h
email/email/smtp/inc/T_SmtpCreateForwardMessage.h
email/email/smtp/inc/T_SmtpCreateReplyMessage.h
email/email/smtp/inc/T_SmtpSendEmail.h
email/email/smtp/inc/T_SmtpServer.h
email/email/smtp/inc/T_StartRamUsageTimer.h
email/email/smtp/inc/T_StopRamUsageTimer.h
email/email/smtp/inc/T_UtilsSendEmail.h
email/email/smtp/inc/local_imcvrecv.inl
email/email/smtp/inc/local_imutdll.h
email/email/smtp/inc/t_smtpcreatenewmessagewithplainbodytext.h
email/email/smtp/src/ImCltCvRecv.cpp
email/email/smtp/src/Local_imcvrecv.cpp
email/email/smtp/src/Local_imutdll.cpp
email/email/smtp/src/T_CheckSmtpBMSetting.cpp
email/email/smtp/src/T_CheckSmtpSNAPSetting.cpp
email/email/smtp/src/T_CreateSmtpAccount.cpp
email/email/smtp/src/T_CreateSmtpMessageFromEmailFile.cpp
email/email/smtp/src/T_CreateSmtpMobilityAccount.cpp
email/email/smtp/src/T_ModifySmtpSettings.cpp
email/email/smtp/src/T_MsgAsyncStepSMTP.cpp
email/email/smtp/src/T_MsgSharedDataSmtp.cpp
email/email/smtp/src/T_MsgSyncStepSMTP.cpp
email/email/smtp/src/T_RemoveSmtpSNAPSetting.cpp
email/email/smtp/src/T_RetrievePlainBodyTextAndCompare.cpp
email/email/smtp/src/T_SendSmtpMessage.cpp
email/email/smtp/src/T_SmtpCreateForwardMessage.cpp
email/email/smtp/src/T_SmtpCreateNewMessageWithPlainBodyText.cpp
email/email/smtp/src/T_SmtpCreateReplyMessage.cpp
email/email/smtp/src/T_SmtpSendEmail.cpp
email/email/smtp/src/T_SmtpServer.cpp
email/email/smtp/src/T_StartRamUsageTimer.cpp
email/email/smtp/src/T_StopRamUsageTimer.cpp
email/email/smtp/src/T_UtilsSendEmail.cpp
email/framework/group/T_MsgFramework.mph
email/framework/inc/T_MsgActive.h
email/framework/inc/T_MsgAsyncStep.h
email/framework/inc/T_MsgServer.h
email/framework/inc/T_MsgSharedDataBase.h
email/framework/inc/T_MsgStep.h
email/framework/inc/T_MsgTimer.h
email/framework/inc/T_RecordCurrentTime.h
email/framework/inc/T_ShutDown.h
email/framework/inc/T_StartUp.h
email/framework/src/T_MsgActive.cpp
email/framework/src/T_MsgAsyncStep.cpp
email/framework/src/T_MsgServer.cpp
email/framework/src/T_MsgSharedDataBase.cpp
email/framework/src/T_MsgStep.cpp
email/framework/src/T_MsgTimer.cpp
email/framework/src/T_RecordCurrentTime.cpp
email/framework/src/T_ShutDown.cpp
email/framework/src/T_StartUp.cpp
email/group/bld.inf
email/mobilitytestframework/EABI/mobilitytestframeworku.def
email/mobilitytestframework/bwins/mobilitytestframeworku.def
email/mobilitytestframework/group/bld.inf
email/mobilitytestframework/group/mobilitytestframework.mmp
email/mobilitytestframework/inc/cimmobilitytestframework.h
email/mobilitytestframework/inc/cimmobilitytesttls.h
email/mobilitytestframework/inc/cmsgtestpropertymappair.h
email/mobilitytestframework/inc/cmsgtestpropertywatcher.h
email/mobilitytestframework/inc/mmsgtestpropertywatcher.h
email/mobilitytestframework/inc/mobilitytestmtmapi.h
email/mobilitytestframework/inc/mobilitytestpropertymap.h
email/mobilitytestframework/inc/mobilitytestpropertyvalue.h
email/mobilitytestframework/inc/msgnetteststub.h
email/mobilitytestframework/inc/timmobilitytestmtmstate.h
email/mobilitytestframework/inc/tmobilitytestpropertymapaccess.h
email/mobilitytestframework/inc/tmsgtestpropertymapentry.h
email/mobilitytestframework/src/cimmobilitytestframework.cpp
email/mobilitytestframework/src/cimmobilitytesttls.cpp
email/mobilitytestframework/src/cmsgtestpropertymappair.cpp
email/mobilitytestframework/src/cmsgtestpropertywatcher.cpp
email/mobilitytestframework/src/msgnetteststub.cpp
email/mobilitytestframework/src/tmobilitytestpropertymapaccess.cpp
email/testutils/bwins/T_MsgUtilityServerU.DEF
email/testutils/bwins/messagingtestutility2u.def
email/testutils/eabi/T_MsgUtilityServerU.DEF
email/testutils/eabi/messagingtestutility2u.def
email/testutils/group/T_Utils.mmp
email/testutils/group/bld.inf
email/testutils/inc/T_TimerUtils.h
email/testutils/inc/T_Utils.h
email/testutils/inc/T_UtilsCentralRepository.h
email/testutils/inc/T_UtilsConfigFileMachineName.h
email/testutils/inc/T_UtilsConfigFileParserUtility.h
email/testutils/inc/T_UtilsDeleteAllChildren.h
email/testutils/inc/T_UtilsEnumConverter.h
email/testutils/inc/T_UtilsReadEmailSettingsFromConfigFile.h
email/testutils/inc/t_testinstrumentation.h
email/testutils/src/T_TimerUtils.cpp
email/testutils/src/T_Utils.cpp
email/testutils/src/T_UtilsCentralRepository.cpp
email/testutils/src/T_UtilsConfigFileMachineName.cpp
email/testutils/src/T_UtilsConfigFileParserUtility.cpp
email/testutils/src/T_UtilsDeleteAllChildren.cpp
email/testutils/src/T_UtilsEnumConverter.cpp
email/testutils/src/T_UtilsReadEmailSettingsFromConfigFile.cpp
graphics/bitgdi/inc/T_DataFbsBitGc.h
graphics/bitgdi/inc/T_DataFbsBitGcBitmap.h
graphics/bitgdi/inc/T_DataFbsBitGcFont.h
graphics/bitgdi/inc/T_DataFbsBitmapDevice.h
graphics/bitgdi/inc/T_DataFbsDevice.h
graphics/bitgdi/inc/T_DataFbsScreenDevice.h
graphics/bitgdi/inc/T_DataPolygonFiller.h
graphics/bitgdi/inc/T_GraphicsBitgdiAPIServer.h
graphics/bitgdi/inc/T_GraphicsBitgdiAPIServer.inl
graphics/bitgdi/src/T_DataFbsBitGc.cpp
graphics/bitgdi/src/T_DataFbsBitGcBitmap.cpp
graphics/bitgdi/src/T_DataFbsBitGcFont.cpp
graphics/bitgdi/src/T_DataFbsBitmapDevice.cpp
graphics/bitgdi/src/T_DataFbsDevice.cpp
graphics/bitgdi/src/T_DataFbsScreenDevice.cpp
graphics/bitgdi/src/T_DataPolygonFiller.cpp
graphics/bitgdi/src/T_GraphicsBitgdiAPIServer.cpp
graphics/bitgdi/src/t_prompt.cpp
graphics/common/inc/DataWrapperActive.h
graphics/common/inc/DataWrapperBase.h
graphics/common/inc/DataWrapperBase.inl
graphics/common/inc/T_GraphicsUtil.h
graphics/common/inc/TestServerBase.h
graphics/common/inc/UtilityClearPanicDlg.h
graphics/common/src/DataWrapperActive.cpp
graphics/common/src/DataWrapperBase.cpp
graphics/common/src/T_GraphicsUtil.cpp
graphics/common/src/TestServerBase.cpp
graphics/common/src/UtilityClearPanicDlg.cpp
graphics/fbserv/inc/T_DataBitmapUtil.h
graphics/fbserv/inc/T_DataFbsBitmap.h
graphics/fbserv/inc/T_DataFbsBitmap.inl
graphics/fbserv/inc/T_DataFbsColor256BitmapUtil.h
graphics/fbserv/inc/T_DataFbsFont.h
graphics/fbserv/inc/T_DataFbsSession.h
graphics/fbserv/inc/T_DataFbsTypefaceStore.h
graphics/fbserv/inc/T_FBServAPIServer.h
graphics/fbserv/inc/T_FBServAPIServer.inl
graphics/fbserv/src/T_DataBitmapUtil.cpp
graphics/fbserv/src/T_DataFbsBitmap.cpp
graphics/fbserv/src/T_DataFbsColor256BitmapUtil.cpp
graphics/fbserv/src/T_DataFbsFont.cpp
graphics/fbserv/src/T_DataFbsSession.cpp
graphics/fbserv/src/T_DataFbsTypefaceStore.cpp
graphics/fbserv/src/T_FBServAPIServer.cpp
graphics/fntstore/inc/T_DataAlgStyle.h
graphics/fntstore/inc/T_DataBitmapFont.h
graphics/fntstore/inc/T_DataFontStore.h
graphics/fntstore/inc/T_DataLinkedTypefaceSpecification.h
graphics/fntstore/inc/T_DataOpenFontGlyphData.h
graphics/fntstore/inc/T_DataOpenFontRasterizerContext.h
graphics/fntstore/inc/T_GraphicsFntstoreAPIServer.h
graphics/fntstore/inc/T_GraphicsFntstoreAPIServer.inl
graphics/fntstore/inc/T_TestOpenFont.h
graphics/fntstore/src/T_DataAlgStyle.cpp
graphics/fntstore/src/T_DataBitmapFont.cpp
graphics/fntstore/src/T_DataFontStore.cpp
graphics/fntstore/src/T_DataLinkedTypefaceSpecification.cpp
graphics/fntstore/src/T_DataOpenFontGlyphData.cpp
graphics/fntstore/src/T_DataOpenFontRasterizerContext.cpp
graphics/fntstore/src/T_GraphicsFntstoreAPIServer.cpp
graphics/fntstore/src/T_TestOpenFont.cpp
graphics/gdi/inc/T_DataBitmapContext.h
graphics/gdi/inc/T_DataBitmapDevice.h
graphics/gdi/inc/T_DataDrawTextExtendedParam.h
graphics/gdi/inc/T_DataDrawTextParam.h
graphics/gdi/inc/T_DataFont.h
graphics/gdi/inc/T_DataGraphicsContext.h
graphics/gdi/inc/T_DataGraphicsDevice.h
graphics/gdi/inc/T_DataGraphicsDevice.inl
graphics/gdi/inc/T_DataGraphicsDeviceMap.h
graphics/gdi/inc/T_DataMeasureTextInput.h
graphics/gdi/inc/T_DataMeasureTextOutput.h
graphics/gdi/inc/T_DataPalette.h
graphics/gdi/inc/T_DataTypefaceStore.h
graphics/gdi/src/T_DataBitmapContext.cpp
graphics/gdi/src/T_DataBitmapDevice.cpp
graphics/gdi/src/T_DataDrawTextExtendedParam.cpp
graphics/gdi/src/T_DataDrawTextParam.cpp
graphics/gdi/src/T_DataFont.cpp
graphics/gdi/src/T_DataGraphicsContext.cpp
graphics/gdi/src/T_DataGraphicsDevice.cpp
graphics/gdi/src/T_DataGraphicsDeviceMap.cpp
graphics/gdi/src/T_DataMeasureTextInput.cpp
graphics/gdi/src/T_DataMeasureTextOutput.cpp
graphics/gdi/src/T_DataPalette.cpp
graphics/gdi/src/T_DataTypefaceStore.cpp
graphics/wserv/AnimPlugin/group/T_AnimPlugin.mmp
graphics/wserv/AnimPlugin/group/bld.inf
graphics/wserv/AnimPlugin/inc/T_AnimDef.h
graphics/wserv/AnimPlugin/inc/T_AnimProc.h
graphics/wserv/AnimPlugin/inc/T_TFreeTimerWinAnim.h
graphics/wserv/AnimPlugin/inc/T_TSpriteAnim.h
graphics/wserv/AnimPlugin/inc/T_TWinAnim.h
graphics/wserv/AnimPlugin/inc/T_TestAnimDll.h
graphics/wserv/AnimPlugin/inc/T_log.h
graphics/wserv/AnimPlugin/src/T_AnimProc.cpp
graphics/wserv/AnimPlugin/src/T_TFreeTimerWinAnim.cpp
graphics/wserv/AnimPlugin/src/T_TSpriteAnim.cpp
graphics/wserv/AnimPlugin/src/T_TWinAnim.cpp
graphics/wserv/AnimPlugin/src/T_TestAnimDll.cpp
graphics/wserv/AnimPlugin/src/T_log.cpp
graphics/wserv/TWsGraphicShare/TWsGraphicShare.cpp
graphics/wserv/TWsGraphicShare/TWsGraphicShare.h
graphics/wserv/TWsGraphicShare/TWsGraphicShare.mmp
graphics/wserv/TWsGraphicShare/TWsGraphicUnshare.mmp
graphics/wserv/TWsGraphicShare/bld.inf
graphics/wserv/group/T_GraphicsWservAPI.mmp
graphics/wserv/group/bld.inf
graphics/wserv/inc/T_DataAnim.h
graphics/wserv/inc/T_DataAnimDll.h
graphics/wserv/inc/T_DataAnimForMClass.h
graphics/wserv/inc/T_DataBackedUpWindow.h
graphics/wserv/inc/T_DataBlankWindow.h
graphics/wserv/inc/T_DataDirectScreenAccess.h
graphics/wserv/inc/T_DataDrawableWindow.h
graphics/wserv/inc/T_DataDsaSession.h
graphics/wserv/inc/T_DataFrame.h
graphics/wserv/inc/T_DataSoundPlugIn.h
graphics/wserv/inc/T_DataWindow.h
graphics/wserv/inc/T_DataWindowBase.h
graphics/wserv/inc/T_DataWindowGc.h
graphics/wserv/inc/T_DataWindowGroup.h
graphics/wserv/inc/T_DataWindowInfo.h
graphics/wserv/inc/T_DataWindowTreeNode.h
graphics/wserv/inc/T_DataWsBitmap.h
graphics/wserv/inc/T_DataWsClientClass.h
graphics/wserv/inc/T_DataWsEvent.h
graphics/wserv/inc/T_DataWsGraphic.h
graphics/wserv/inc/T_DataWsGraphicAnimation.h
graphics/wserv/inc/T_DataWsGraphicBitmap.h
graphics/wserv/inc/T_DataWsGraphicBitmapAnimation.h
graphics/wserv/inc/T_DataWsGraphicFrameRate.h
graphics/wserv/inc/T_DataWsGraphicMsgBuf.h
graphics/wserv/inc/T_DataWsGraphicMsgFixedBase.h
graphics/wserv/inc/T_DataWsPointerCursor.h
graphics/wserv/inc/T_DataWsPriorityKeyEvent.h
graphics/wserv/inc/T_DataWsRedrawEvent.h
graphics/wserv/inc/T_DataWsScreenDevice.h
graphics/wserv/inc/T_DataWsSession.h
graphics/wserv/inc/T_DataWsSprite.h
graphics/wserv/inc/T_DataWsSpriteBase.h
graphics/wserv/inc/T_GraphicsWservAPIServer.h
graphics/wserv/inc/T_GraphicsWservAPIServer.inl
graphics/wserv/inc/T_RAnimChild.h
graphics/wserv/scripts/setup_smoketest_bitmap.script
graphics/wserv/scripts/smoketest_bitmap.script
graphics/wserv/src/T_DataAnim.cpp
graphics/wserv/src/T_DataAnimDll.cpp
graphics/wserv/src/T_DataAnimForMClass.cpp
graphics/wserv/src/T_DataBackedUpWindow.cpp
graphics/wserv/src/T_DataBlankWindow.cpp
graphics/wserv/src/T_DataDirectScreenAccess.cpp
graphics/wserv/src/T_DataDrawableWindow.cpp
graphics/wserv/src/T_DataDsaSession.cpp
graphics/wserv/src/T_DataFrame.cpp
graphics/wserv/src/T_DataSoundPlugIn.cpp
graphics/wserv/src/T_DataWindow.cpp
graphics/wserv/src/T_DataWindowBase.cpp
graphics/wserv/src/T_DataWindowGc.cpp
graphics/wserv/src/T_DataWindowGroup.cpp
graphics/wserv/src/T_DataWindowInfo.cpp
graphics/wserv/src/T_DataWindowTreeNode.cpp
graphics/wserv/src/T_DataWsBitmap.cpp
graphics/wserv/src/T_DataWsClientClass.cpp
graphics/wserv/src/T_DataWsEvent.cpp
graphics/wserv/src/T_DataWsGraphic.cpp
graphics/wserv/src/T_DataWsGraphicAnimation.cpp
graphics/wserv/src/T_DataWsGraphicBitmap.cpp
graphics/wserv/src/T_DataWsGraphicBitmapAnimation.cpp
graphics/wserv/src/T_DataWsGraphicFrameRate.cpp
graphics/wserv/src/T_DataWsGraphicMsgBuf.cpp
graphics/wserv/src/T_DataWsGraphicMsgFixedBase.cpp
graphics/wserv/src/T_DataWsPointerCursor.cpp
graphics/wserv/src/T_DataWsPriorityKeyEvent.cpp
graphics/wserv/src/T_DataWsRedrawEvent.cpp
graphics/wserv/src/T_DataWsScreenDevice.cpp
graphics/wserv/src/T_DataWsSession.cpp
graphics/wserv/src/T_DataWsSprite.cpp
graphics/wserv/src/T_DataWsSpriteBase.cpp
graphics/wserv/src/T_GraphicsWservAPIServer.cpp
graphics/wserv/src/T_RAnimChild.cpp
graphics/wserv/testdata/datafile/uibench_16bit.mbm
graphics/wserv/testdata/smoketest_bitmap.ini
http/group/bld.inf
http/group/delproxy.pl
http/group/testhttpsuite.mmp
http/inc/testhttpbasestep.h
http/inc/testhttpbuffersizestep.h
http/inc/testhttpeboclientconditionalstep.h
http/inc/testhttpeboclientstep.h
http/inc/testhttpserver.h
http/ini/smoketest_http.ini
http/script/setup_smoketest_http.script
http/script/smoketest_http.script
http/src/testhttpbasestep.cpp
http/src/testhttpbuffersizestep.cpp
http/src/testhttpeboclientconditionalstep.cpp
http/src/testhttpeboclientstep.cpp
http/src/testhttpserver.cpp
inputmethods/Bmarm/InputMethodSmokeTestModuleU.DEF
inputmethods/Bwins/InputMethodSmokeTestModuleU.DEF
inputmethods/EABI/InputMethodSmokeTestModuleU.def
inputmethods/conf/InputMethodSmokeTestModule.cfg
inputmethods/group/Bld.inf
inputmethods/group/InputMethodSmokeTestModule.mmp
inputmethods/inc/InputMethodSmokeTestModule.h
inputmethods/inc/TestOcrObserver.h
inputmethods/src/InputMethodSmokeTestModule.cpp
inputmethods/src/InputMethodSmokeTestModuleBlocks.cpp
inputmethods/src/TestOcrObserver.cpp
lbs/common/group/ctlbscommon.mmp
lbs/common/inc/LbsAssistanceDataLogEvent.h
lbs/common/inc/LbsExternalLocateLogEvent.h
lbs/common/inc/LbsLogEvent.h
lbs/common/inc/LbsLogWriterEngine.h
lbs/common/inc/LbsLogger.h
lbs/common/inc/LbsLoggerDefs.h
lbs/common/inc/LbsNetworkLocateLogEvent.h
lbs/common/inc/LbsSelfLocateLogEvent.h
lbs/common/inc/LbsTransmitLocationLogEvent.h
lbs/common/inc/argutils.h
lbs/common/inc/ctlbsclientlog.h
lbs/common/inc/ctlbsclientrequestor.h
lbs/common/inc/ctlbsdoposupdate.h
lbs/common/inc/ctlbsdox3p.h
lbs/common/inc/ctlbsnetsimstep.h
lbs/common/inc/ctlbsportedstepbase.h
lbs/common/inc/ctlbsportedsuitedefs.h
lbs/common/inc/ctlbsposclient.h
lbs/common/inc/ctlbsposclientholder.h
lbs/common/inc/ctlbsrequester.h
lbs/common/inc/ctlbsserver.h
lbs/common/inc/ctlbsshareddata.h
lbs/common/inc/ctlbsstep.h
lbs/common/inc/ctlbsstepclearlog.h
lbs/common/inc/ctlbsstepconfighybridmodule.h
lbs/common/inc/ctlbsstepcreateupdateinfo.h
lbs/common/inc/ctlbsstepcreateverifymodinfo.h
lbs/common/inc/ctlbsstepcreateverifymoduledata.h
lbs/common/inc/ctlbsstepcreateverifyposinfos.h
lbs/common/inc/ctlbsstepinstallscheduler.h
lbs/common/inc/ctlbsstepresetdefaultadmin.h
lbs/common/inc/ctlbsstepsetatamode.h
lbs/common/inc/ctlbsstepsetautonomousmode.h
lbs/common/inc/ctlbsstepsetbehaviourmodeoriginal.h
lbs/common/inc/ctlbsstepsetprivhandler.h
lbs/common/inc/ctlbsstepsetptamode.h
lbs/common/inc/ctlbsstepsetptbmode.h
lbs/common/inc/ctlbsstepsetupprotocolstub.h
lbs/common/inc/ctlbsstepsetuproamselflocate.h
lbs/common/inc/ctlbsstepsetupstandaloneprivacyandsimplectlr.h
lbs/common/inc/ctlbsstepsetupstandaloneprivacymode.h
lbs/common/inc/ctlbsstepsetupstandaloneprivacywithnoctlr.h
lbs/common/inc/ctlbsstepstartlbs.h
lbs/common/inc/ctlbsstepstoplbs.h
lbs/common/inc/ctlbsstepverifyloginfo.h
lbs/common/inc/ctlbsstepverifymodinfo.h
lbs/common/inc/ctlbsstepverifymodstatus.h
lbs/common/inc/ctlbsstepverifyposinfos.h
lbs/common/inc/ctlbsstepverifyroughposinfos.h
lbs/common/inc/mctlbsrequestobserver.h
lbs/common/src/ctlbsactiveyield.cpp
lbs/common/src/ctlbsclientlog.cpp
lbs/common/src/ctlbsclientrequestor.cpp
lbs/common/src/ctlbsdoposupdate.cpp
lbs/common/src/ctlbsdox3p.cpp
lbs/common/src/ctlbsnetsimstep.cpp
lbs/common/src/ctlbsportedstepbase.cpp
lbs/common/src/ctlbsposclient.cpp
lbs/common/src/ctlbsposclientholder.cpp
lbs/common/src/ctlbsrequester.cpp
lbs/common/src/ctlbsserver.cpp
lbs/common/src/ctlbsshareddata.cpp
lbs/common/src/ctlbsstep.cpp
lbs/common/src/ctlbsstepclearlog.cpp
lbs/common/src/ctlbsstepconfighybridmodule.cpp
lbs/common/src/ctlbsstepcreateupdateinfo.cpp
lbs/common/src/ctlbsstepcreateverifymodinfo.cpp
lbs/common/src/ctlbsstepcreateverifymoduledata.cpp
lbs/common/src/ctlbsstepcreateverifyposinfos.cpp
lbs/common/src/ctlbsstepinstallscheduler.cpp
lbs/common/src/ctlbsstepresetdefaultadmin.cpp
lbs/common/src/ctlbsstepsetatamode.cpp
lbs/common/src/ctlbsstepsetautonomousmode.cpp
lbs/common/src/ctlbsstepsetbehaviourmodeoriginal.cpp
lbs/common/src/ctlbsstepsetprivhandler.cpp
lbs/common/src/ctlbsstepsetptamode.cpp
lbs/common/src/ctlbsstepsetptbmode.cpp
lbs/common/src/ctlbsstepsetupprotocolstub.cpp
lbs/common/src/ctlbsstepsetuproamselflocate.cpp
lbs/common/src/ctlbsstepsetupstandaloneprivacyandsimplectlr.cpp
lbs/common/src/ctlbsstepsetupstandaloneprivacymode.cpp
lbs/common/src/ctlbsstepsetupstandaloneprivacywithnoctlr.cpp
lbs/common/src/ctlbsstepstartlbs.cpp
lbs/common/src/ctlbsstepstoplbs.cpp
lbs/common/src/ctlbsstepverifyloginfo.cpp
lbs/common/src/ctlbsstepverifymodinfo.cpp
lbs/common/src/ctlbsstepverifymodstatus.cpp
lbs/common/src/ctlbsstepverifyposinfos.cpp
lbs/common/src/ctlbsstepverifyroughposinfos.cpp
lbs/group/bld.inf
lbs/internal/lbstestserver/BWINS/lbstestclientU.DEF
lbs/internal/lbstestserver/EABI/lbstestclientU.DEF
lbs/internal/lbstestserver/group/bld.inf
lbs/internal/lbstestserver/group/lbstestclient.mmp
lbs/internal/lbstestserver/group/lbstestserver.mmp
lbs/internal/lbstestserver/inc/claunchedprocess.h
lbs/internal/lbstestserver/inc/cprocesslaunch.h
lbs/internal/lbstestserver/inc/cquietus.h
lbs/internal/lbstestserver/inc/csecureasbase.h
lbs/internal/lbstestserver/inc/csecureprocessasbase.h
lbs/internal/lbstestserver/inc/csecureserverbase.h
lbs/internal/lbstestserver/inc/csecuresessionbase.h
lbs/internal/lbstestserver/inc/csecuresessionsubsessionbase.h
lbs/internal/lbstestserver/inc/cserverlaunch.h
lbs/internal/lbstestserver/inc/cshutdowntimer.h
lbs/internal/lbstestserver/inc/csubsessionbase.h
lbs/internal/lbstestserver/inc/lbsprocesssupervisor.h
lbs/internal/lbstestserver/inc/lbspropertykeydefs.h
lbs/internal/lbstestserver/inc/lbsrootapi.h
lbs/internal/lbstestserver/inc/lbssystemcontroller.h
lbs/internal/lbstestserver/inc/lbstestclient.h
lbs/internal/lbstestserver/inc/lbstestclientimpl.h
lbs/internal/lbstestserver/inc/lbstestmessageenums.h
lbs/internal/lbstestserver/inc/lbstestopensessionparams.h
lbs/internal/lbstestserver/inc/lbstestserver.h
lbs/internal/lbstestserver/inc/lbstestserverdata.h
lbs/internal/lbstestserver/inc/lbstestsession.h
lbs/internal/lbstestserver/inc/messageutils.h
lbs/internal/lbstestserver/inc/rsecuresessionbase.h
lbs/internal/lbstestserver/inc/tprocessstartparams.h
lbs/internal/lbstestserver/inc/tserverstartparams.h
lbs/internal/lbstestserver/inc/tstartparamsbase.h
lbs/internal/lbstestserver/src/claunchedprocess.cpp
lbs/internal/lbstestserver/src/cprocesslaunch.cpp
lbs/internal/lbstestserver/src/cquietus.cpp
lbs/internal/lbstestserver/src/csecureasbase.cpp
lbs/internal/lbstestserver/src/csecureprocessasbase.cpp
lbs/internal/lbstestserver/src/csecureserverbase.cpp
lbs/internal/lbstestserver/src/csecuresessionbase.cpp
lbs/internal/lbstestserver/src/csecuresessionsubsessionbase.cpp
lbs/internal/lbstestserver/src/cserverlaunch.cpp
lbs/internal/lbstestserver/src/cshutdowntimer.cpp
lbs/internal/lbstestserver/src/csubsessionbase.cpp
lbs/internal/lbstestserver/src/lbstestclient.cpp
lbs/internal/lbstestserver/src/lbstestclientimpl.cpp
lbs/internal/lbstestserver/src/lbstestserver.cpp
lbs/internal/lbstestserver/src/lbstestservermain.cpp
lbs/internal/lbstestserver/src/lbstestsession.cpp
lbs/internal/lbstestserver/src/messageutils.cpp
lbs/internal/lbstestserver/src/rsecuresessionbase.cpp
lbs/internal/lbstestserver/src/tprocessstartparams.cpp
lbs/internal/lbstestserver/src/tserverstartparams.cpp
lbs/internal/lbstestserver/src/tstartparamsbase.cpp
lbs/lbsclient/group/bld.inf
lbs/lbsclient/group/ctlbsclientserver.mmp
lbs/lbsclient/inc/ctlbsclienteventtimer.h
lbs/lbsclient/inc/ctlbsclientgetlkpao.h
lbs/lbsclient/inc/ctlbsclientnotifyposupdao.h
lbs/lbsclient/inc/ctlbsclientobserver.h
lbs/lbsclient/inc/ctlbsclientperiodictester.h
lbs/lbsclient/inc/ctlbsclientportedsuiteserver.h
lbs/lbsclient/inc/ctlbsclientpositionconstants.h
lbs/lbsclient/inc/ctlbsclientpostp1.h
lbs/lbsclient/inc/ctlbsclientpostp11.h
lbs/lbsclient/inc/ctlbsclientpostp169.h
lbs/lbsclient/inc/ctlbsclientpostp17.h
lbs/lbsclient/inc/ctlbsclientpostp173.h
lbs/lbsclient/inc/ctlbsclientpostp176.h
lbs/lbsclient/inc/ctlbsclientpostp178.h
lbs/lbsclient/inc/ctlbsclientpostp179.h
lbs/lbsclient/inc/ctlbsclientpostp188.h
lbs/lbsclient/inc/ctlbsclientpostp189.h
lbs/lbsclient/inc/ctlbsclientpostp193.h
lbs/lbsclient/inc/ctlbsclientpostp194.h
lbs/lbsclient/inc/ctlbsclientpostp195.h
lbs/lbsclient/inc/ctlbsclientpostp2.h
lbs/lbsclient/inc/ctlbsclientpostp201.h
lbs/lbsclient/inc/ctlbsclientpostp203.h
lbs/lbsclient/inc/ctlbsclientpostp204.h
lbs/lbsclient/inc/ctlbsclientpostp208.h
lbs/lbsclient/inc/ctlbsclientpostp21.h
lbs/lbsclient/inc/ctlbsclientpostp213.h
lbs/lbsclient/inc/ctlbsclientpostp217.h
lbs/lbsclient/inc/ctlbsclientpostp218.h
lbs/lbsclient/inc/ctlbsclientpostp22.h
lbs/lbsclient/inc/ctlbsclientpostp222.h
lbs/lbsclient/inc/ctlbsclientpostp223.h
lbs/lbsclient/inc/ctlbsclientpostp224.h
lbs/lbsclient/inc/ctlbsclientpostp227.h
lbs/lbsclient/inc/ctlbsclientpostp25.h
lbs/lbsclient/inc/ctlbsclientpostp254.h
lbs/lbsclient/inc/ctlbsclientpostp256.h
lbs/lbsclient/inc/ctlbsclientpostp257.h
lbs/lbsclient/inc/ctlbsclientpostp259.h
lbs/lbsclient/inc/ctlbsclientpostp261.h
lbs/lbsclient/inc/ctlbsclientpostp269.h
lbs/lbsclient/inc/ctlbsclientpostp27.h
lbs/lbsclient/inc/ctlbsclientpostp271.h
lbs/lbsclient/inc/ctlbsclientpostp272.h
lbs/lbsclient/inc/ctlbsclientpostp274.h
lbs/lbsclient/inc/ctlbsclientpostp275.h
lbs/lbsclient/inc/ctlbsclientpostp4701.h
lbs/lbsclient/inc/ctlbsclientpostp4702.h
lbs/lbsclient/inc/ctlbsclientpostp4703.h
lbs/lbsclient/inc/ctlbsclientpostp4704.h
lbs/lbsclient/inc/ctlbsclientpostp4705.h
lbs/lbsclient/inc/ctlbsclientpostp4706.h
lbs/lbsclient/inc/ctlbsclientpostp4707.h
lbs/lbsclient/inc/ctlbsclientpostp4708.h
lbs/lbsclient/inc/ctlbsclientpostp4709.h
lbs/lbsclient/inc/ctlbsclientpostp4722.h
lbs/lbsclient/inc/ctlbsclientpostp4723.h
lbs/lbsclient/inc/ctlbsclientpostp76.h
lbs/lbsclient/inc/ctlbsclientpostp93.h
lbs/lbsclient/inc/ctlbsclientserver.h
lbs/lbsclient/inc/ctlbsclientshareddata.h
lbs/lbsclient/inc/ctlbsclientstep.h
lbs/lbsclient/inc/ctlbsclientstep_reset_assistance.h
lbs/lbsclient/inc/ctlbsclientstepassistance.h
lbs/lbsclient/inc/ctlbsclientstepcellbasednpud.h
lbs/lbsclient/inc/ctlbsclientstepignoreaccurracysetting.h
lbs/lbsclient/inc/ctlbsclientstepignoreaccurracysettingtracking.h
lbs/lbsclient/inc/ctlbsclientsteplastknownpos.h
lbs/lbsclient/inc/ctlbsclientstepmodinfo.h
lbs/lbsclient/inc/ctlbsclientstepmodselect.h
lbs/lbsclient/inc/ctlbsclientstepmodstatus.h
lbs/lbsclient/inc/ctlbsclientstepmultireq.h
lbs/lbsclient/inc/ctlbsclientstepnotifyposupdate.h
lbs/lbsclient/inc/ctlbsclientstepopenclose.h
lbs/lbsclient/inc/ctlbsclientsteppartialupdate.h
lbs/lbsclient/inc/ctlbsclientstepsrvconnectclose.h
lbs/lbsclient/inc/ctlbsclientstepsrvversion.h
lbs/lbsclient/inc/ctlbsclientsteptracking.h
lbs/lbsclient/inc/ctlbsclientstepupdateoptions.h
lbs/lbsclient/inc/tctlbsclientmodulesobserver.h
lbs/lbsclient/lbsexeclient/group/bld.inf
lbs/lbsclient/lbsexeclient/group/ctlbsexeclient.mmp
lbs/lbsclient/lbsexeclient/src/ctlbsexeclient.cpp
lbs/lbsclient/scripts/setup_smoketest_lbs.script
lbs/lbsclient/scripts/smoketest_lbs.script
lbs/lbsclient/src/ctlbsclienteventtimer.cpp
lbs/lbsclient/src/ctlbsclientgetlkpao.cpp
lbs/lbsclient/src/ctlbsclientnotifyposupdao.cpp
lbs/lbsclient/src/ctlbsclientobserver.cpp
lbs/lbsclient/src/ctlbsclientperiodictester.cpp
lbs/lbsclient/src/ctlbsclientportedsuiteserver.cpp
lbs/lbsclient/src/ctlbsclientpostp1.cpp
lbs/lbsclient/src/ctlbsclientpostp11.cpp
lbs/lbsclient/src/ctlbsclientpostp169.cpp
lbs/lbsclient/src/ctlbsclientpostp17.cpp
lbs/lbsclient/src/ctlbsclientpostp173.cpp
lbs/lbsclient/src/ctlbsclientpostp176.cpp
lbs/lbsclient/src/ctlbsclientpostp178.cpp
lbs/lbsclient/src/ctlbsclientpostp179.cpp
lbs/lbsclient/src/ctlbsclientpostp188.cpp
lbs/lbsclient/src/ctlbsclientpostp189.cpp
lbs/lbsclient/src/ctlbsclientpostp193.cpp
lbs/lbsclient/src/ctlbsclientpostp194.cpp
lbs/lbsclient/src/ctlbsclientpostp195.cpp
lbs/lbsclient/src/ctlbsclientpostp2.cpp
lbs/lbsclient/src/ctlbsclientpostp201.cpp
lbs/lbsclient/src/ctlbsclientpostp203.cpp
lbs/lbsclient/src/ctlbsclientpostp204.cpp
lbs/lbsclient/src/ctlbsclientpostp208.cpp
lbs/lbsclient/src/ctlbsclientpostp21.cpp
lbs/lbsclient/src/ctlbsclientpostp213.cpp
lbs/lbsclient/src/ctlbsclientpostp217.cpp
lbs/lbsclient/src/ctlbsclientpostp218.cpp
lbs/lbsclient/src/ctlbsclientpostp22.cpp
lbs/lbsclient/src/ctlbsclientpostp222.cpp
lbs/lbsclient/src/ctlbsclientpostp223.cpp
lbs/lbsclient/src/ctlbsclientpostp224.cpp
lbs/lbsclient/src/ctlbsclientpostp227.cpp
lbs/lbsclient/src/ctlbsclientpostp25.cpp
lbs/lbsclient/src/ctlbsclientpostp254.cpp
lbs/lbsclient/src/ctlbsclientpostp256.cpp
lbs/lbsclient/src/ctlbsclientpostp257.cpp
lbs/lbsclient/src/ctlbsclientpostp259.cpp
lbs/lbsclient/src/ctlbsclientpostp261.cpp
lbs/lbsclient/src/ctlbsclientpostp269.cpp
lbs/lbsclient/src/ctlbsclientpostp27.cpp
lbs/lbsclient/src/ctlbsclientpostp271.cpp
lbs/lbsclient/src/ctlbsclientpostp272.cpp
lbs/lbsclient/src/ctlbsclientpostp274.cpp
lbs/lbsclient/src/ctlbsclientpostp275.cpp
lbs/lbsclient/src/ctlbsclientpostp4701.cpp
lbs/lbsclient/src/ctlbsclientpostp4702.cpp
lbs/lbsclient/src/ctlbsclientpostp4703.cpp
lbs/lbsclient/src/ctlbsclientpostp4704.cpp
lbs/lbsclient/src/ctlbsclientpostp4705.cpp
lbs/lbsclient/src/ctlbsclientpostp4706.cpp
lbs/lbsclient/src/ctlbsclientpostp4707.cpp
lbs/lbsclient/src/ctlbsclientpostp4708.cpp
lbs/lbsclient/src/ctlbsclientpostp4709.cpp
lbs/lbsclient/src/ctlbsclientpostp4722.cpp
lbs/lbsclient/src/ctlbsclientpostp4723.cpp
lbs/lbsclient/src/ctlbsclientpostp76.cpp
lbs/lbsclient/src/ctlbsclientpostp93.cpp
lbs/lbsclient/src/ctlbsclientserver.cpp
lbs/lbsclient/src/ctlbsclientshareddata.cpp
lbs/lbsclient/src/ctlbsclientstep.cpp
lbs/lbsclient/src/ctlbsclientstep_reset_assistance.cpp
lbs/lbsclient/src/ctlbsclientstepassistance.cpp
lbs/lbsclient/src/ctlbsclientstepcellbasednpud.cpp
lbs/lbsclient/src/ctlbsclientstepignoreaccurracysetting.cpp
lbs/lbsclient/src/ctlbsclientstepignoreaccurracysettingtracking.cpp
lbs/lbsclient/src/ctlbsclientsteplastknownpos.cpp
lbs/lbsclient/src/ctlbsclientstepmodinfo.cpp
lbs/lbsclient/src/ctlbsclientstepmodselect.cpp
lbs/lbsclient/src/ctlbsclientstepmodstatus.cpp
lbs/lbsclient/src/ctlbsclientstepmultireq.cpp
lbs/lbsclient/src/ctlbsclientstepnotifyposupdate.cpp
lbs/lbsclient/src/ctlbsclientstepopenclose.cpp
lbs/lbsclient/src/ctlbsclientsteppartialupdate.cpp
lbs/lbsclient/src/ctlbsclientstepsrvconnectclose.cpp
lbs/lbsclient/src/ctlbsclientstepsrvversion.cpp
lbs/lbsclient/src/ctlbsclientsteptracking.cpp
lbs/lbsclient/src/ctlbsclientstepupdateoptions.cpp
lbs/lbsclient/testdata/smoketest_lbs.ini
lbs/lbstestchannel/BWINS/LbsTestChannelU.DEF
lbs/lbstestchannel/EABI/LbsTestChannelu.def
lbs/lbstestchannel/group/bld.inf
lbs/lbstestchannel/group/lbstestchannel.mmp
lbs/lbstestchannel/inc/tlbschannel.h
lbs/lbstestchannel/inc/tlbschannelutils.h
lbs/lbstestchannel/src/tlbschannel.cpp
lbs/lbstestchannel/src/tlbschannelutils.cpp
lbs/lbstestutils/BWINS/LbsTestUtilsU.DEF
lbs/lbstestutils/EABI/LbsTestUtilsU.DEF
lbs/lbstestutils/group/bld.inf
lbs/lbstestutils/group/lbstestutils.mmp
lbs/lbstestutils/inc/ctdumper.h
lbs/lbstestutils/inc/ctlbsagpshandler.h
lbs/lbstestutils/inc/ctlbsagpsmoduleeventlistener.h
lbs/lbstestutils/inc/ctlbsasyncwaiter.h
lbs/lbstestutils/inc/ctlbsconfigreader.h
lbs/lbstestutils/inc/ctlbstestlogger.h
lbs/lbstestutils/inc/ctlbstestloggermacros.h
lbs/lbstestutils/inc/ctlbstimerutils.h
lbs/lbstestutils/inc/tlbsutils.h
lbs/lbstestutils/src/ctdumper.cpp
lbs/lbstestutils/src/ctlbsagpshandler.cpp
lbs/lbstestutils/src/ctlbsagpsmoduleeventlistener.cpp
lbs/lbstestutils/src/ctlbsasyncwaiter.cpp
lbs/lbstestutils/src/ctlbsconfigreader.cpp
lbs/lbstestutils/src/ctlbstestlogger.cpp
lbs/lbstestutils/src/ctlbstimerutils.cpp
lbs/lbstestutils/src/tlbsutils.cpp
localisation/apparchitecture/apfile/APFILE.MMP
localisation/apparchitecture/apfile/APFREC.CPP
localisation/apparchitecture/apfile/APFSTD.CPP
localisation/apparchitecture/apfile/APFSTD.H
localisation/apparchitecture/apfile/APRuleBased.CPP
localisation/apparchitecture/apfile/ApLaunchChecker.cpp
localisation/apparchitecture/apfile/ApSidChecker.cpp
localisation/apparchitecture/apfile/apfmimecontentpolicy.cpp
localisation/apparchitecture/apfile/apfmimecontentpolicy.rss
localisation/apparchitecture/apfile/aprfndr.cpp
localisation/apparchitecture/apfile/aprfndr.h
localisation/apparchitecture/apfile/apuninstallmonitor.cpp
localisation/apparchitecture/apfile/apuninstallmonitor.h
localisation/apparchitecture/apfile/eshell_reg.rss
localisation/apparchitecture/apgrfx/APGAIR.CPP
localisation/apparchitecture/apgrfx/APGAIR.H
localisation/apparchitecture/apgrfx/APGAIRV2.CPP
localisation/apparchitecture/apgrfx/APGAPLST.CPP
localisation/apparchitecture/apgrfx/APGAPLSTV2.CPP
localisation/apparchitecture/apgrfx/APGCLI.CPP
localisation/apparchitecture/apgrfx/APGCTL.CPP
localisation/apparchitecture/apgrfx/APGDOOR.CPP
localisation/apparchitecture/apgrfx/APGICNFL.CPP
localisation/apparchitecture/apgrfx/APGPRIV.CPP
localisation/apparchitecture/apgrfx/APGPRIV.H
localisation/apparchitecture/apgrfx/APGRFX.MMP
localisation/apparchitecture/apgrfx/APGSTD.CPP
localisation/apparchitecture/apgrfx/APGSTD.H
localisation/apparchitecture/apgrfx/APGTASK.CPP
localisation/apparchitecture/apgrfx/APGWGNAM.CPP
localisation/apparchitecture/apgrfx/APSCLI.CPP
localisation/apparchitecture/apgrfx/apgconstdata.cpp
localisation/apparchitecture/apgrfx/apgnotif.cpp
localisation/apparchitecture/apgrfx/apprivate.h
localisation/apparchitecture/apgrfx/apsecutils.cpp
localisation/apparchitecture/apgrfx/apsecutils.h
localisation/apparchitecture/apgrfx/apsecutils.inl
localisation/apparchitecture/apparc/APACMDLN.CPP
localisation/apparchitecture/apparc/APADLL.H
localisation/apparchitecture/apparc/APAFLREC.CPP
localisation/apparchitecture/apparc/APAID.CPP
localisation/apparchitecture/apparc/APAMDR.CPP
localisation/apparchitecture/apparc/APASTD.CPP
localisation/apparchitecture/apparc/APASTD.H
localisation/apparchitecture/apparc/APPARC.CPP
localisation/apparchitecture/apparc/APPARC.MMP
localisation/apparchitecture/apparc/ApaAppClient.cpp
localisation/apparchitecture/apparc/ApaAppServer.cpp
localisation/apparchitecture/apparc/ApaServerAppPriv.h
localisation/apparchitecture/apparc/TRACE.H
localisation/apparchitecture/apserv/APSCLSV.H
localisation/apparchitecture/apserv/APSCONSTDATA.CPP
localisation/apparchitecture/apserv/APSERV.MMP
localisation/apparchitecture/apserv/APSRECCACHE.cpp
localisation/apparchitecture/apserv/APSRECCACHE.h
localisation/apparchitecture/apserv/APSRECUTIL.CPP
localisation/apparchitecture/apserv/APSRECUTIL.H
localisation/apparchitecture/apserv/APSSCAN.CPP
localisation/apparchitecture/apserv/APSSERV.CPP
localisation/apparchitecture/apserv/APSSES.CPP
localisation/apparchitecture/apserv/APSSES.H
localisation/apparchitecture/apserv/APSSTART.CPP
localisation/apparchitecture/apserv/APSSTD.CPP
localisation/apparchitecture/apserv/APSSTD.H
localisation/apparchitecture/apserv/apsiconcaptionoverride.cpp
localisation/apparchitecture/apserv/apsiconcaptionoverride.h
localisation/apparchitecture/apserv/apsnnapps.cpp
localisation/apparchitecture/apserv/apsnnapps.h
localisation/apparchitecture/apserv/apsnnappupdates.cpp
localisation/apparchitecture/apserv/apsnnappupdates.h
localisation/apparchitecture/apsexe/APSEXE.MMP
localisation/apparchitecture/apsexe/APSMAIN.CPP
localisation/apparchitecture/apstart/apstart.cpp
localisation/apparchitecture/apstart/apstart.h
localisation/apparchitecture/apstart/apstart.mmp
localisation/apparchitecture/apstart/apststd.cpp
localisation/apparchitecture/apstart/apststd.h
localisation/apparchitecture/bwins/APFILE_9_REMOVE_UI_FRAMEWORKS_V1U.DEF
localisation/apparchitecture/bwins/APFILE_UI_FRAMEWORKSU.DEF
localisation/apparchitecture/bwins/APGRFX_9_REMOVE_UI_FRAMEWORKS_V1U.DEF
localisation/apparchitecture/bwins/APGRFX_9_REMOVE_UI_FRAMEWORKS_V1_EXCEPT_REMNANT_FOR_JAVA_MIDLET_INSTALLERU.DEF
localisation/apparchitecture/bwins/APGRFX_UI_FRAMEWORKSU.DEF
localisation/apparchitecture/bwins/APP.DEF
localisation/apparchitecture/bwins/APPARCTESTSERVERu.def
localisation/apparchitecture/bwins/APPARCU.DEF
localisation/apparchitecture/bwins/APPARC_9_REMOVE_UI_FRAMEWORKS_V1U.DEF
localisation/apparchitecture/bwins/APP_CTRL2U.def
localisation/apparchitecture/bwins/APP_CTRLU.def
localisation/apparchitecture/bwins/APSERVU.DEF
localisation/apparchitecture/bwins/EXEDLLAPPU.DEF
localisation/apparchitecture/bwins/ServiceRegistryU.def
localisation/apparchitecture/bwins/TDONOTHINGFILERECOGNIZERU.DEF
localisation/apparchitecture/bwins/TICONFORLEAKSV2u.DEF
localisation/apparchitecture/bwins/TICONFORLEAKSu.DEF
localisation/apparchitecture/bwins/apstartu.def
localisation/apparchitecture/eabi/APFILE_9_REMOVE_UI_FRAMEWORKS_V1U.DEF
localisation/apparchitecture/eabi/APFILE_UI_FRAMEWORKSU.DEF
localisation/apparchitecture/eabi/APGRFX_9_REMOVE_UI_FRAMEWORKS_V1U.DEF
localisation/apparchitecture/eabi/APGRFX_9_REMOVE_UI_FRAMEWORKS_V1_EXCEPT_REMNANT_FOR_JAVA_MIDLET_INSTALLERU.DEF
localisation/apparchitecture/eabi/APGRFX_UI_FRAMEWORKSU.DEF
localisation/apparchitecture/eabi/APPARCTESTSERVERU.DEF
localisation/apparchitecture/eabi/APPARCU.DEF
localisation/apparchitecture/eabi/APPARC_9_REMOVE_UI_FRAMEWORKS_V1U.DEF
localisation/apparchitecture/eabi/APSERVU.DEF
localisation/apparchitecture/eabi/APSEXEU.DEF
localisation/apparchitecture/eabi/ServiceRegistryU.def
localisation/apparchitecture/eabi/TDONOTHINGFILERECOGNIZERU.DEF
localisation/apparchitecture/eabi/TICONFORLEAKSu.DEF
localisation/apparchitecture/eabi/apstartu.def
localisation/apparchitecture/group/BLD.INF
localisation/apparchitecture/group/ExeMove.mk
localisation/apparchitecture/group/RELEASE.TXT
localisation/apparchitecture/group/app-framework_apparc.history.xml
localisation/apparchitecture/group/app-framework_apparc.mrp
localisation/apparchitecture/inc/AIFTOOL.RH
localisation/apparchitecture/inc/APACLN.H
localisation/apparchitecture/inc/APACMDLN.H
localisation/apparchitecture/inc/APADBASE.H
localisation/apparchitecture/inc/APADEF.H
localisation/apparchitecture/inc/APAFLREC.H
localisation/apparchitecture/inc/APAID.H
localisation/apparchitecture/inc/APAMDR.H
localisation/apparchitecture/inc/APASVST.H
localisation/apparchitecture/inc/APFCTLF.H
localisation/apparchitecture/inc/APFDEF.H
localisation/apparchitecture/inc/APFFNDR.H
localisation/apparchitecture/inc/APFREC.H
localisation/apparchitecture/inc/APGAPLST.H
localisation/apparchitecture/inc/APGCLI.H
localisation/apparchitecture/inc/APGCTL.H
localisation/apparchitecture/inc/APGDOOR.H
localisation/apparchitecture/inc/APGICNFL.H
localisation/apparchitecture/inc/APGTASK.H
localisation/apparchitecture/inc/APGWGNAM.H
localisation/apparchitecture/inc/APPARC.H
localisation/apparchitecture/inc/APRuleBased.h
localisation/apparchitecture/inc/APSSCAN.H
localisation/apparchitecture/inc/APSSERV.H
localisation/apparchitecture/inc/ApLaunchChecker.h
localisation/apparchitecture/inc/ApSidChecker.h
localisation/apparchitecture/inc/ApaServerApp.h
localisation/apparchitecture/inc/Apcaptionfile.rh
localisation/apparchitecture/inc/AppInfo.rh
localisation/apparchitecture/inc/ServiceRegistry.h
localisation/apparchitecture/inc/apfmimecontentpolicy.h
localisation/apparchitecture/inc/apgnotif.h
localisation/apparchitecture/tdata/102081ce_reg.rsc
localisation/apparchitecture/tdata/102081cf_reg.rsc
localisation/apparchitecture/tdata/1028583d.txt
localisation/apparchitecture/tdata/AAA_reg.Rsc
localisation/apparchitecture/tdata/CONTACT.NNA3
localisation/apparchitecture/tdata/Corrupted_reg.RSC
localisation/apparchitecture/tdata/FileWithUnknownMimeType.UnrecognisableExtention
localisation/apparchitecture/tdata/GIF.NNA1
localisation/apparchitecture/tdata/HTML.NNA2
localisation/apparchitecture/tdata/TApsRecogAppTest.mmr
localisation/apparchitecture/tdata/TRApaLsSessionStartAppTest.tst
localisation/apparchitecture/tdata/TSTAPPU.DOC
localisation/apparchitecture/tdata/TXT.NNA4
localisation/apparchitecture/tdata/UpdatedAppsList.bin
localisation/apparchitecture/tdata/file1.txt
localisation/apparchitecture/tdata/file2.txt
localisation/apparchitecture/tdata/mimecontentpolicy/fl_goo.dm
localisation/apparchitecture/tdata/mimecontentpolicy/gif_wallpaper.gif
localisation/apparchitecture/tdata/mimecontentpolicy/jpeg_wes.dm
localisation/apparchitecture/tdata/mimecontentpolicy/propelli.jpg
localisation/apparchitecture/tdata/mimecontentpolicy/sd_goo.dcf
localisation/apparchitecture/tdata/mimecontentpolicy/type-r.jpg
localisation/apparchitecture/tdata/one_byte.txt
localisation/apparchitecture/tdata/recmime_1.rsc
localisation/apparchitecture/tdata/recmime_armv5.dll
localisation/apparchitecture/tdata/recmime_winscw.dll
localisation/apparchitecture/tdata/recupgrade.rsc
localisation/apparchitecture/tdata/recupgrade_armv5_rel.dll
localisation/apparchitecture/tdata/sdk.txt
localisation/apparchitecture/tdata/tapsrecogupgradetest.upg
localisation/apparchitecture/tdata/testfile1.txt
localisation/apparchitecture/tdata/testfile2.txt
localisation/apparchitecture/tdata/testfile3.txt
localisation/apparchitecture/tdata/testfile4.txt
localisation/apparchitecture/tdata/testupdregappuninstallation_reg.rsc
localisation/apparchitecture/tdata/zero_len.txt
localisation/apparchitecture/tdatasrc/DEF25.BMP
localisation/apparchitecture/tdatasrc/DEF25M.BMP
localisation/apparchitecture/tdatasrc/DEF35.BMP
localisation/apparchitecture/tdatasrc/DEF35M.BMP
localisation/apparchitecture/tdatasrc/DEF50.BMP
localisation/apparchitecture/tdatasrc/DEF50M.BMP
localisation/apparchitecture/tdatasrc/Thumbs.db
localisation/apparchitecture/tdatasrc/tstappicon24x20.bmp
localisation/apparchitecture/tdatasrc/tstappicon24x20m.bmp
localisation/apparchitecture/tdatasrc/tstappicon40x55.bmp
localisation/apparchitecture/tdatasrc/tstappicon40x55m.bmp
localisation/apparchitecture/tef/10000180.rss
localisation/apparchitecture/tef/10000181.rss
localisation/apparchitecture/tef/10000182.rss
localisation/apparchitecture/tef/10004c4e.rss
localisation/apparchitecture/tef/10004c5B.rss
localisation/apparchitecture/tef/10004c5C.rss
localisation/apparchitecture/tef/10004c5D.rss
localisation/apparchitecture/tef/10004c5E.rss
localisation/apparchitecture/tef/10004c66.rss
localisation/apparchitecture/tef/102032A5.rss
localisation/apparchitecture/tef/1020d465.rss
localisation/apparchitecture/tef/102722ba.rss
localisation/apparchitecture/tef/A0000B70.rss
localisation/apparchitecture/tef/AppInfo_NoLocalisableGroupName.rh
localisation/apparchitecture/tef/App_CTRL.hrh
localisation/apparchitecture/tef/App_CTRL.rss
localisation/apparchitecture/tef/App_CTRL2.hrh
localisation/apparchitecture/tef/App_CTRL2.rss
localisation/apparchitecture/tef/App_CTRL2_reg.rss
localisation/apparchitecture/tef/App_CTRL_reg.rss
localisation/apparchitecture/tef/App_ctrl.MBM
localisation/apparchitecture/tef/App_ctrl_loc.RSS
localisation/apparchitecture/tef/ChildI.hrh
localisation/apparchitecture/tef/ChildI.mmp
localisation/apparchitecture/tef/ChildI.rss
localisation/apparchitecture/tef/ChildII.hrh
localisation/apparchitecture/tef/ChildII.mmp
localisation/apparchitecture/tef/ChildII.rss
localisation/apparchitecture/tef/ChildIII.hrh
localisation/apparchitecture/tef/ChildIII.mmp
localisation/apparchitecture/tef/ChildIII.rss
localisation/apparchitecture/tef/ChildIII_Main.cpp
localisation/apparchitecture/tef/ChildIII_reg.rss
localisation/apparchitecture/tef/ChildII_Main.cpp
localisation/apparchitecture/tef/ChildII_reg.rss
localisation/apparchitecture/tef/ChildI_Main.cpp
localisation/apparchitecture/tef/ChildI_reg.rss
localisation/apparchitecture/tef/CustomiseDefaultIconApp_loc.RSS
localisation/apparchitecture/tef/CustomiseDefaultIconApp_reg.RSS
localisation/apparchitecture/tef/M_CTRL.hrh
localisation/apparchitecture/tef/M_CTRL.rss
localisation/apparchitecture/tef/M_CTRL_V2.CPP
localisation/apparchitecture/tef/M_CTRL_loc.RSS
localisation/apparchitecture/tef/M_CTRL_reg.rss
localisation/apparchitecture/tef/ParentProcess.hrh
localisation/apparchitecture/tef/ParentProcess.mmp
localisation/apparchitecture/tef/ParentProcess.rss
localisation/apparchitecture/tef/ParentProcess_Main.cpp
localisation/apparchitecture/tef/ParentProcess_reg.rss
localisation/apparchitecture/tef/SimpleApparcTestApp.cpp
localisation/apparchitecture/tef/SimpleApparcTestApp.hrh
localisation/apparchitecture/tef/SimpleApparcTestApp.mmp
localisation/apparchitecture/tef/SimpleApparcTestApp.rss
localisation/apparchitecture/tef/SimpleApparcTestApp_Reg.RSS
localisation/apparchitecture/tef/TAppEmbedUids.h
localisation/apparchitecture/tef/TAppEmbeddable.cpp
localisation/apparchitecture/tef/TAppEmbeddableOnly.cpp
localisation/apparchitecture/tef/TAppEmbeddableOnly_reg.rss
localisation/apparchitecture/tef/TAppEmbeddableOnly_v2.mmp
localisation/apparchitecture/tef/TAppEmbeddableUiNotStandAlone.cpp
localisation/apparchitecture/tef/TAppEmbeddableUiNotStandAlone_reg.rss
localisation/apparchitecture/tef/TAppEmbeddableUiNotStandAlone_v2.mmp
localisation/apparchitecture/tef/TAppEmbeddableUiOrStandAlone.cpp
localisation/apparchitecture/tef/TAppEmbeddableUiOrStandAlone_embedded.mmp
localisation/apparchitecture/tef/TAppEmbeddableUiOrStandAlone_reg.rss
localisation/apparchitecture/tef/TAppEmbeddableUiOrStandalone_standalone.cpp
localisation/apparchitecture/tef/TAppEmbeddableUiOrStandalone_standalone.mmp
localisation/apparchitecture/tef/TAppEmbeddable_embedded.mmp
localisation/apparchitecture/tef/TAppEmbeddable_reg.rss
localisation/apparchitecture/tef/TAppEmbeddable_standalone.cpp
localisation/apparchitecture/tef/TAppEmbeddable_standalone.mmp
localisation/apparchitecture/tef/TAppInstall/TestAppInstall.cpp
localisation/apparchitecture/tef/TAppInstall/TestAppInstall.h
localisation/apparchitecture/tef/TAppInstall/TestAppInstall.hrh
localisation/apparchitecture/tef/TAppInstall/TestAppInstall.mmp
localisation/apparchitecture/tef/TAppInstall/TestAppInstall.rss
localisation/apparchitecture/tef/TAppInstall/TestAppInstall_reg.rss
localisation/apparchitecture/tef/TAppLaunchChecker.mmp
localisation/apparchitecture/tef/TAppLaunchChecker2.mmp
localisation/apparchitecture/tef/TAppNotEmbeddable.cpp
localisation/apparchitecture/tef/TAppNotEmbeddable_reg.rss
localisation/apparchitecture/tef/TAppNotEmbeddable_v2.mmp
localisation/apparchitecture/tef/TApparcTestApp.cpp
localisation/apparchitecture/tef/TApparcTestApp.mmp
localisation/apparchitecture/tef/TApparcTestApp.rss
localisation/apparchitecture/tef/TApparcTestApp_reg.rss
localisation/apparchitecture/tef/TBufferOnlyRec/10207f88.rss
localisation/apparchitecture/tef/TBufferOnlyRec/TBufferOnlyRec.cpp
localisation/apparchitecture/tef/TBufferOnlyRec/TBufferOnlyRec.h
localisation/apparchitecture/tef/TBufferOnlyRec/TBufferOnlyRec.mmp
localisation/apparchitecture/tef/TBufferOnlyRec/TBufferOnlyRecUid.hrh
localisation/apparchitecture/tef/TCmdLineExe.CPP
localisation/apparchitecture/tef/TCmdLineExe.mmp
localisation/apparchitecture/tef/TCtrlPnlApp_reg.rss
localisation/apparchitecture/tef/TDoNothingFileRecognizer.cpp
localisation/apparchitecture/tef/TDoNothingFileRecognizer_v2.mmp
localisation/apparchitecture/tef/TESTREC/102032A5.rss
localisation/apparchitecture/tef/TESTREC/TESTREC.CPP
localisation/apparchitecture/tef/TESTREC/TESTREC.H
localisation/apparchitecture/tef/TESTREC/TESTREC.MMP
localisation/apparchitecture/tef/TEXE.CPP
localisation/apparchitecture/tef/TEXE_V2.MMP
localisation/apparchitecture/tef/TEndTaskTestApp/EndTaskTestApp.cpp
localisation/apparchitecture/tef/TEndTaskTestApp/EndTaskTestApp.h
localisation/apparchitecture/tef/TEndTaskTestApp/EndTaskTestApp.mmp
localisation/apparchitecture/tef/TEndTaskTestApp/EndTaskTestApp.rss
localisation/apparchitecture/tef/TEndTaskTestApp/EndTaskTestAppExternalInterface.h
localisation/apparchitecture/tef/TEndTaskTestApp/EndTask_reg.rss
localisation/apparchitecture/tef/TIconLoaderAndIconArrayForLeaks.cpp
localisation/apparchitecture/tef/TIconLoaderAndIconArrayForLeaks.h
localisation/apparchitecture/tef/TIconLoaderAndIconArrayForLeaks.mmp
localisation/apparchitecture/tef/TLongUrlRecognizer.cpp
localisation/apparchitecture/tef/TLongUrlRecognizer_v2.mmp
localisation/apparchitecture/tef/TMimeRec/102822B7.rss
localisation/apparchitecture/tef/TMimeRec/constants.h
localisation/apparchitecture/tef/TMimeRec/constants.hrh
localisation/apparchitecture/tef/TMimeRec/recmime.CPP
localisation/apparchitecture/tef/TMimeRec/recmime.H
localisation/apparchitecture/tef/TMimeRec/recmime.MMP
localisation/apparchitecture/tef/TMimeRec1/A00025DD.rss
localisation/apparchitecture/tef/TMimeRec1/recmime_1.CPP
localisation/apparchitecture/tef/TMimeRec1/recmime_1.H
localisation/apparchitecture/tef/TMimeRec1/recmime_1.MMP
localisation/apparchitecture/tef/TNonNative/10207f95.rss
localisation/apparchitecture/tef/TNonNative/TNNApp1.cpp
localisation/apparchitecture/tef/TNonNative/TNNApp1.h
localisation/apparchitecture/tef/TNonNative/TNNApp1.mmp
localisation/apparchitecture/tef/TNonNative/TNNApp1_reg.rss
localisation/apparchitecture/tef/TNonNative/TNNApp2.cpp
localisation/apparchitecture/tef/TNonNative/TNNApp2.mmp
localisation/apparchitecture/tef/TNonNative/TNNApp2_reg.rss
localisation/apparchitecture/tef/TNonNative/TNonNativeRec.cpp
localisation/apparchitecture/tef/TNonNative/TNonNativeRec.mmp
localisation/apparchitecture/tef/TNonNativeAppLaunchChecker.cpp
localisation/apparchitecture/tef/TNonNativeAppLaunchChecker.h
localisation/apparchitecture/tef/TNonNativeAppLaunchChecker.mmp
localisation/apparchitecture/tef/TRApaLsSessionStartAppTest.h
localisation/apparchitecture/tef/TRApaLsSessionStartAppTestApp.cpp
localisation/apparchitecture/tef/TRApaLsSessionStartAppTestApp_reg.rss
localisation/apparchitecture/tef/TRApaLsSessionStartAppTestApp_v2.mmp
localisation/apparchitecture/tef/TRApaLsSessionStartAppTestRecognizer.cpp
localisation/apparchitecture/tef/TRApaLsSessionStartAppTestRecognizer_v2.mmp
localisation/apparchitecture/tef/TRApaLsSessionTestUids.h
localisation/apparchitecture/tef/TRecUpgrade_1/recupgrade_1.MMP
localisation/apparchitecture/tef/TRecUpgrade_1/recupgrade_1.cpp
localisation/apparchitecture/tef/TSTAPP.CPP
localisation/apparchitecture/tef/TSTAPP.H
localisation/apparchitecture/tef/TSTAPP.hrh
localisation/apparchitecture/tef/TSTAPP.rss
localisation/apparchitecture/tef/TSTAPP_embedded.MMP
localisation/apparchitecture/tef/TSTAPP_standalone.CPP
localisation/apparchitecture/tef/TSTAPP_standalone.MMP
localisation/apparchitecture/tef/TSidChecker/10281FDF.rss
localisation/apparchitecture/tef/TSidChecker/TestSidChecker.cpp
localisation/apparchitecture/tef/TSidChecker/TestSidChecker.h
localisation/apparchitecture/tef/TSidChecker/TestSidChecker.mmp
localisation/apparchitecture/tef/TStartDoc.h
localisation/apparchitecture/tef/TStartDocApp.cpp
localisation/apparchitecture/tef/TStartDocApp_reg.rss
localisation/apparchitecture/tef/TStartDocApp_v2.mmp
localisation/apparchitecture/tef/TTestEcomFileRec.cpp
localisation/apparchitecture/tef/TTestEcomFileRec.mmp
localisation/apparchitecture/tef/TWindowChaining.h
localisation/apparchitecture/tef/T_AppList.cpp
localisation/apparchitecture/tef/T_AppList.h
localisation/apparchitecture/tef/T_AppListFileBootStep.cpp
localisation/apparchitecture/tef/T_AppListFileBootStep.h
localisation/apparchitecture/tef/T_AppListFileUpdateStep.cpp
localisation/apparchitecture/tef/T_AppListFileUpdateStep.h
localisation/apparchitecture/tef/T_ApsScan.cpp
localisation/apparchitecture/tef/T_ApsScan.h
localisation/apparchitecture/tef/T_AutoMMCReaderOpen.cpp
localisation/apparchitecture/tef/T_AutoMMCReaderOpen.h
localisation/apparchitecture/tef/T_BackupStep.cpp
localisation/apparchitecture/tef/T_BackupStep.h
localisation/apparchitecture/tef/T_Capability1.cpp
localisation/apparchitecture/tef/T_Capability1.h
localisation/apparchitecture/tef/T_Capability2.cpp
localisation/apparchitecture/tef/T_Capability2.h
localisation/apparchitecture/tef/T_CaptionStep.cpp
localisation/apparchitecture/tef/T_CaptionStep.h
localisation/apparchitecture/tef/T_CmdlnStep.CPP
localisation/apparchitecture/tef/T_CmdlnStep.h
localisation/apparchitecture/tef/T_ControlPanelTest.cpp
localisation/apparchitecture/tef/T_ControlPanelTest.h
localisation/apparchitecture/tef/T_DataMappingPersistenceA.cpp
localisation/apparchitecture/tef/T_DataMappingPersistenceA.h
localisation/apparchitecture/tef/T_DataMappingPersistenceB.cpp
localisation/apparchitecture/tef/T_DataMappingPersistenceB.h
localisation/apparchitecture/tef/T_DataMappingPersistenceC.cpp
localisation/apparchitecture/tef/T_DataMappingPersistenceC.h
localisation/apparchitecture/tef/T_DataPrioritySystem1/T_DataPrioritySystem1.CPP
localisation/apparchitecture/tef/T_DataPrioritySystem1/T_DataPrioritySystem1.MMP
localisation/apparchitecture/tef/T_DataPrioritySystem1/T_DataPrioritySystem1_loc.rss
localisation/apparchitecture/tef/T_DataPrioritySystem1/T_DataPrioritySystem1_reg.rss
localisation/apparchitecture/tef/T_DataPrioritySystem2/T_DataPrioritySystem2.CPP
localisation/apparchitecture/tef/T_DataPrioritySystem2/T_DataPrioritySystem2.MMP
localisation/apparchitecture/tef/T_DataPrioritySystem2/T_DataPrioritySystem2_loc.rss
localisation/apparchitecture/tef/T_DataPrioritySystem2/T_DataPrioritySystem2_reg.rss
localisation/apparchitecture/tef/T_DataPrioritySystem3_reg.rss
localisation/apparchitecture/tef/T_DataTypeMappingWithSid1.cpp
localisation/apparchitecture/tef/T_DataTypeMappingWithSid1.h
localisation/apparchitecture/tef/T_EndTaskStep.cpp
localisation/apparchitecture/tef/T_EndTaskStep.h
localisation/apparchitecture/tef/T_EnvSlots/T_EnvSlots.CPP
localisation/apparchitecture/tef/T_EnvSlots/T_EnvSlots.H
localisation/apparchitecture/tef/T_EnvSlots/T_EnvSlots.MMP
localisation/apparchitecture/tef/T_EnvSlots/T_EnvSlots_loc.rss
localisation/apparchitecture/tef/T_EnvSlots/T_EnvSlots_reg.rss
localisation/apparchitecture/tef/T_ExeStep.CPP
localisation/apparchitecture/tef/T_ExeStep.h
localisation/apparchitecture/tef/T_File1Step.cpp
localisation/apparchitecture/tef/T_File1Step.h
localisation/apparchitecture/tef/T_File2Step.cpp
localisation/apparchitecture/tef/T_File2Step.h
localisation/apparchitecture/tef/T_File3Step.cpp
localisation/apparchitecture/tef/T_File3Step.h
localisation/apparchitecture/tef/T_Foreground.cpp
localisation/apparchitecture/tef/T_Foreground.h
localisation/apparchitecture/tef/T_IntegritySupportRebootStep.cpp
localisation/apparchitecture/tef/T_IntegritySupportRebootStep.h
localisation/apparchitecture/tef/T_IntegritySupportStep.cpp
localisation/apparchitecture/tef/T_IntegritySupportStep.h
localisation/apparchitecture/tef/T_LocaleStep.cpp
localisation/apparchitecture/tef/T_LocaleStep.h
localisation/apparchitecture/tef/T_MRUStep.CPP
localisation/apparchitecture/tef/T_MdrStep.cpp
localisation/apparchitecture/tef/T_MdrStep.h
localisation/apparchitecture/tef/T_MruStep.h
localisation/apparchitecture/tef/T_NonNativeAppsStep.cpp
localisation/apparchitecture/tef/T_NonNativeAppsStep.h
localisation/apparchitecture/tef/T_NotifStep.cpp
localisation/apparchitecture/tef/T_NotifStep.h
localisation/apparchitecture/tef/T_OOMStep.cpp
localisation/apparchitecture/tef/T_OOMStep.h
localisation/apparchitecture/tef/T_ProStep.cpp
localisation/apparchitecture/tef/T_ProStep.h
localisation/apparchitecture/tef/T_ProcStep.cpp
localisation/apparchitecture/tef/T_ProcStep.h
localisation/apparchitecture/tef/T_RApaLsSessionStep.cpp
localisation/apparchitecture/tef/T_RApaLsSessionStep.h
localisation/apparchitecture/tef/T_RecUpgrade.cpp
localisation/apparchitecture/tef/T_RecUpgrade.h
localisation/apparchitecture/tef/T_RuleBasedLaunchingStep.cpp
localisation/apparchitecture/tef/T_RuleBasedLaunchingStep.h
localisation/apparchitecture/tef/T_Serv2Step.CPP
localisation/apparchitecture/tef/T_Serv2Step.h
localisation/apparchitecture/tef/T_Serv3Step.cpp
localisation/apparchitecture/tef/T_Serv3Step.h
localisation/apparchitecture/tef/T_ServiceRegistryStep.cpp
localisation/apparchitecture/tef/T_ServiceRegistryStep.h
localisation/apparchitecture/tef/T_ServicesStep.cpp
localisation/apparchitecture/tef/T_ServicesStep.h
localisation/apparchitecture/tef/T_StartAppStep.cpp
localisation/apparchitecture/tef/T_StartAppStep.h
localisation/apparchitecture/tef/T_StartDocStep.CPP
localisation/apparchitecture/tef/T_StartDocStep.h
localisation/apparchitecture/tef/T_SysStartApparcStep.cpp
localisation/apparchitecture/tef/T_SysStartApparcStep.h
localisation/apparchitecture/tef/T_WgnamStep.CPP
localisation/apparchitecture/tef/T_WgnamStep.h
localisation/apparchitecture/tef/T_WindowChainingStep.CPP
localisation/apparchitecture/tef/T_WindowChainingStep.h
localisation/apparchitecture/tef/T_groupNametest.cpp
localisation/apparchitecture/tef/T_groupNametest.h
localisation/apparchitecture/tef/T_groupNametest_ver1.cpp
localisation/apparchitecture/tef/T_groupNametest_ver1.h
localisation/apparchitecture/tef/T_groupNametest_ver2.cpp
localisation/apparchitecture/tef/T_groupNametest_ver2.h
localisation/apparchitecture/tef/T_groupname_loc.rss
localisation/apparchitecture/tef/T_groupname_reg.rss
localisation/apparchitecture/tef/T_groupnamever1_loc.rss
localisation/apparchitecture/tef/T_groupnamever1_reg.rss
localisation/apparchitecture/tef/T_groupnamever2_loc.rss
localisation/apparchitecture/tef/T_groupnamever2_reg.rss
localisation/apparchitecture/tef/TestTrustedPriorityApp1_reg.rss
localisation/apparchitecture/tef/TestTrustedPriorityApp2_reg.rss
localisation/apparchitecture/tef/TestUnTrustedPriorityApp1_reg.rss
localisation/apparchitecture/tef/TestUnTrustedPriorityApp2_reg.rss
localisation/apparchitecture/tef/UnProctectedUidApp.cpp
localisation/apparchitecture/tef/UnProctectedUidApp.mmp
localisation/apparchitecture/tef/UnProctectedUidApp.rss
localisation/apparchitecture/tef/UnProctectedUidApp_reg.rss
localisation/apparchitecture/tef/app_CTRL.CPP
localisation/apparchitecture/tef/app_CTRL.MMP
localisation/apparchitecture/tef/app_CTRL2.CPP
localisation/apparchitecture/tef/app_CTRL2.MMP
localisation/apparchitecture/tef/apparctestserver.MMP
localisation/apparchitecture/tef/apparctestserver.cpp
localisation/apparchitecture/tef/apparctestserver.h
localisation/apparchitecture/tef/m_ctrl_v2.mmp
localisation/apparchitecture/tef/openservice1a.rss
localisation/apparchitecture/tef/openservice1b.rss
localisation/apparchitecture/tef/scripts/setup_smoketest_language.script
localisation/apparchitecture/tef/scripts/smoketest_language.script
localisation/apparchitecture/tef/serverapp2_reg.RSS
localisation/apparchitecture/tef/serverapp3_reg.RSS
localisation/apparchitecture/tef/serverapp4_reg.RSS
localisation/apparchitecture/tef/serverapp6_reg.RSS
localisation/apparchitecture/tef/serverapp7_reg.RSS
localisation/apparchitecture/tef/serverapp_loc.RSS
localisation/apparchitecture/tef/serverapp_reg.rss
localisation/apparchitecture/tef/svg_icon.svg
localisation/apparchitecture/tef/tAppLaunchChecker.cpp
localisation/apparchitecture/tef/tAppLaunchChecker.h
localisation/apparchitecture/tef/tAppLaunchChecker2.cpp
localisation/apparchitecture/tef/tAppLaunchChecker2.h
localisation/apparchitecture/tef/tRuleBasedApps/RuleBasedUID.H
localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp.hrh
localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp1.cpp
localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp1.mmp
localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp1.rss
localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp1_reg.rss
localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp2.cpp
localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp2.mmp
localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp2.rss
localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp2_reg.rss
localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp3.cpp
localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp3.mmp
localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp3.rss
localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp3_reg.rss
localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp4.cpp
localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp4.mmp
localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp4.rss
localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp4_reg.rss
localisation/apparchitecture/tef/t_abstractnonnativeappsstep.cpp
localisation/apparchitecture/tef/t_abstractnonnativeappsstep.h
localisation/apparchitecture/tef/t_drivenotification.cpp
localisation/apparchitecture/tef/t_drivenotification.h
localisation/apparchitecture/tef/t_largestackstep.cpp
localisation/apparchitecture/tef/t_largestackstep.h
localisation/apparchitecture/tef/t_mimecontentpolicystep.cpp
localisation/apparchitecture/tef/t_mimecontentpolicystep.h
localisation/apparchitecture/tef/t_rapalssessionstep.rss
localisation/apparchitecture/tef/t_servicebasestep.cpp
localisation/apparchitecture/tef/t_servicebasestep.h
localisation/apparchitecture/tef/t_winchainChild.h
localisation/apparchitecture/tef/t_winchainChild.mmp
localisation/apparchitecture/tef/t_winchainChild_Application.cpp
localisation/apparchitecture/tef/t_winchainChild_reg.rss
localisation/apparchitecture/tef/t_winchainLaunch.h
localisation/apparchitecture/tef/t_winchainLaunch.mmp
localisation/apparchitecture/tef/t_winchainLaunch_Application.cpp
localisation/apparchitecture/tef/t_winchainLaunch_reg.rss
localisation/apparchitecture/tef/tapparctestapp_loc.rss
localisation/apparchitecture/tef/testableapalssession.cpp
localisation/apparchitecture/tef/testableapalssession.h
localisation/apparchitecture/tef/testapp/testupdregappuninstallation/testupdregappuninstallation.cpp
localisation/apparchitecture/tef/testapp/testupdregappuninstallation/testupdregappuninstallation.mmp
localisation/apparchitecture/tef/testapp/testupdregappuninstallation/testupdregappuninstallation_reg.rss
localisation/apparchitecture/tef/ticoncaptionoverride.cpp
localisation/apparchitecture/tef/ticoncaptionoverride.h
localisation/apparchitecture/tef/ticoncaptionoverride.mmp
localisation/apparchitecture/tef/ticoncaptionoverride.rss
localisation/apparchitecture/tef/ticoncaptionoverride01.rls
localisation/apparchitecture/tef/ticoncaptionoverride02.rls
localisation/apparchitecture/tef/ticoncaptionoverride03.rls
localisation/apparchitecture/tef/ticoncaptionoverride_loc.rss
localisation/apparchitecture/tef/ticoncaptionoverride_reg.rss
localisation/apparchitecture/tef/ticoncaptionoverridesc.rls
localisation/apparchitecture/tef/tlargestack/tlargestackapp.h
localisation/apparchitecture/tef/tlargestack/tlargestackapp.hrh
localisation/apparchitecture/tef/tlargestack/tlargestackapp.mmp
localisation/apparchitecture/tef/tlargestack/tlargestackapp.rss
localisation/apparchitecture/tef/tlargestack/tlargestackapp_main.cpp
localisation/apparchitecture/tef/tlargestack/tlargestackapp_reg.rss
localisation/apparchitecture/tef/tnotifydrivesapp/tnotifydrivesapp.cpp
localisation/apparchitecture/tef/tnotifydrivesapp/tnotifydrivesapp.h
localisation/apparchitecture/tef/tnotifydrivesapp/tnotifydrivesapp.mmp
localisation/apparchitecture/tef/tnotifydrivesapp/tnotifydrivesapp.rss
localisation/apparchitecture/tef/tnotifydrivesapp/tnotifydrivesapp_reg.rss
localisation/apparchitecture/tef/trecupgrade/a000b461.rss
localisation/apparchitecture/tef/trecupgrade/recupgrade.MMP
localisation/apparchitecture/tef/trecupgrade/recupgrade.cpp
localisation/apparchitecture/tef/trecupgrade/recupgrade.h
localisation/apparchitecture/tef/trecupgrade/upgconstants.h
localisation/apparchitecture/tef/tssaac/SysStartApparcTestCases.cpp
localisation/apparchitecture/tef/tssaac/SysStartApparcTestCases.h
localisation/apparchitecture/tef/tssaac/scripts/emulator/sysstart_apparc_checkEpocWind.bat
localisation/apparchitecture/tef/tssaac/scripts/emulator/sysstart_apparc_run.bat
localisation/apparchitecture/tef/tssaac/scripts/emulator/sysstart_apparc_setup.bat
localisation/apparchitecture/tef/tssaac/scripts/hardware/sysstart_apparc_buildrom.bat
localisation/apparchitecture/tef/tssaac/scripts/hardware/sysstart_apparc_checkEpocWind.bat
localisation/apparchitecture/tef/tssaac/scripts/hardware/sysstart_apparc_insertlog.pl
localisation/apparchitecture/tef/tssaac/scripts/hardware/sysstart_apparc_run.bat
localisation/apparchitecture/tef/tssaac/tssaac.cpp
localisation/apparchitecture/tef/tssaac/tssaac.h
localisation/apparchitecture/tef/tssaac/tssaac.mmp
localisation/apparchitecture/tef/tssaac/tssaac_emulator.rss
localisation/apparchitecture/tef/tssaac/tssaac_hardware.rss
localisation/apparchitecture/tef/tssaac/tssaac_tapp.cpp
localisation/apparchitecture/tef/tssaac/tssaac_tapp.mmp
localisation/apparchitecture/tef/tssaac/tssaac_tapp.rss
localisation/apparchitecture/tef/tssaac/tssaac_tapp_emulator.rss
localisation/apparchitecture/tef/tssaac/tssaac_tapp_hardware.rss
localisation/apparchitecture/tef/tssaac/tssaac_tapp_loc.rss
localisation/apparchitecture/tef/tssaac/tssaac_tapp_reg.rss
localisation/apparchitecture/tef/tstapp01.rls
localisation/apparchitecture/tef/tstapp02.rls
localisation/apparchitecture/tef/tstapp03.rls
localisation/apparchitecture/tef/tstapp04.rls
localisation/apparchitecture/tef/tstapp05.rls
localisation/apparchitecture/tef/tstapp_Reg.RSS
localisation/apparchitecture/tef/tstapp_loc.rss
localisation/apparchitecture/tef/tstappsc.rls
localisation/apparchitecture/tef/tstappviewneg.mbm
localisation/apparchitecture/tef/tstappviewneg.xyz
localisation/apparchitecture/tef/tstnnapp.mbm
localisation/apparchitecture/tef/tupgradeiconapp/tupgradeiconapp.cpp
localisation/apparchitecture/tef/tupgradeiconapp/tupgradeiconapp.h
localisation/apparchitecture/tef/tupgradeiconapp/tupgradeiconapp.mbm
localisation/apparchitecture/tef/tupgradeiconapp/tupgradeiconapp.mmp
localisation/apparchitecture/tef/tupgradeiconapp/tupgradeiconapp.rss
localisation/apparchitecture/tef/tupgradeiconapp/tupgradeiconapp_reg.rss
localisation/uiftestfw/bwins/APPFWK_TEST_APPUIU.DEF
localisation/uiftestfw/bwins/APPFWK_TEST_UTILSU.DEF
localisation/uiftestfw/eabi/APPFWK_TEST_APPUIU.DEF
localisation/uiftestfw/eabi/APPFWK_TEST_UTILSU.DEF
localisation/uiftestfw/group/BLD.INF
localisation/uiftestfw/group/app-framework_testframework.history.xml
localisation/uiftestfw/group/app-framework_testframework.mrp
localisation/uiftestfw/group/appfwk_test_AppUi.mmp
localisation/uiftestfw/group/appfwk_test_utils.mmp
localisation/uiftestfw/inc/appfwk_test.h
localisation/uiftestfw/inc/appfwk_test_AppUi.h
localisation/uiftestfw/inc/appfwk_test_utils.h
localisation/uiftestfw/src/appfwk_test_AppUi.cpp
localisation/uiftestfw/src/appfwk_test_utils.cpp
mediamgmt/Bmarm/MediaMgmtSmokeTestModuleU.DEF
mediamgmt/Bwins/MediaMgmtSmokeTestModuleU.DEF
mediamgmt/EABI/MediaMgmtSmokeTestModuleU.def
mediamgmt/conf/MediaMgmtSmokeTestModule.cfg
mediamgmt/conf/UI_MediaMgmtSmokeTestModule.cfg
mediamgmt/group/Bld.inf
mediamgmt/group/MediaMgmtSmokeTestModule.mmp
mediamgmt/inc/MediaMgmtObserver.h
mediamgmt/inc/MediaMgmtSmokeTestModule.h
mediamgmt/src/MediaMgmtObserver.cpp
mediamgmt/src/MediaMgmtSmokeTestModule.cpp
mediamgmt/src/MediaMgmtSmokeTestModuleBlocks.cpp
messaging/Group/Smoketest_Mess.mmp
messaging/Group/bld.inf
messaging/Inc/TestMess.h
messaging/Inc/TestMessBase.h
messaging/Inc/TestMessCleanMessageFolder.h
messaging/Inc/TestMessCreateCdmaSmsUtil.h
messaging/Inc/TestMessCreateGsmSmsUtil.h
messaging/Inc/TestMessCreateSMS.h
messaging/Inc/TestMessCreateSMSaccount.h
messaging/Inc/TestMessCreateSmsUtilBase.h
messaging/Inc/TestMessEditEntry.h
messaging/Inc/TestMessEditEntryUtil.h
messaging/Inc/TestMessPrintEntryUtil.h
messaging/Inc/TestMessProcessExistingMsg.h
messaging/Inc/TestMessProcessor.h
messaging/Inc/TestMessServer.h
messaging/Inc/TestMessSession.h
messaging/Inc/TestMessSetDefaultSc.h
messaging/Inc/TestMessSharedData.h
messaging/Inc/TestMessStoreProcessUtil.h
messaging/Inc/TestMessTimer.h
messaging/Inc/TestMessWatcher.h
messaging/ReadMe.doc
messaging/Scripts/Smoketest_CreateSmsAccount.script
messaging/Scripts/Smoketest_Mess.script
messaging/Scripts/setup_Smoketest_Mess.script
messaging/Src/TestMessBase.cpp
messaging/Src/TestMessCleanMessageFolder.cpp
messaging/Src/TestMessCreateCdmaSmsUtil.cpp
messaging/Src/TestMessCreateGsmSmsUtil.cpp
messaging/Src/TestMessCreateSMS.cpp
messaging/Src/TestMessCreateSMSaccount.cpp
messaging/Src/TestMessCreateSmsUtilBase.cpp
messaging/Src/TestMessEditEntry.cpp
messaging/Src/TestMessEditEntryUtil.cpp
messaging/Src/TestMessPrintEntryUtil.cpp
messaging/Src/TestMessProcessExistingMsg.cpp
messaging/Src/TestMessProcessor.cpp
messaging/Src/TestMessServer.cpp
messaging/Src/TestMessSession.cpp
messaging/Src/TestMessSetDefaultSC.cpp
messaging/Src/TestMessSharedData.cpp
messaging/Src/TestMessStoreProcessUtil.cpp
messaging/Src/TestMessTimer.cpp
messaging/Src/TestMessWatcher.cpp
messaging/TestData/Smoketest_Mess.ini
messaging/TestData/Sms/Message1.txt
messaging/bwins/SMOKETEST_MESS_SERVERU.DEF
notepad/Bmarm/TestNpdApiU.DEF
notepad/Bwins/TestNpdApiU.DEF
notepad/EABI/TestNpdApiU.def
notepad/conf/smoketest_notepad.cfg
notepad/conf/ui_TestNpdApi.cfg
notepad/group/Bld.inf
notepad/group/TestNpdApi.mmp
notepad/inc/TestNpdApi.h
notepad/init/TestFramework.ini
notepad/src/TestNpdApi.cpp
notepad/src/TestNpdApiBlocks.cpp
profiles/bmarm/ProfileSmokeTestModuleU.DEF
profiles/bwins/ProfileSmokeTestModuleU.DEF
profiles/conf/ProfileSmokeTestModule.cfg
profiles/eabi/ProfileSmokeTestModuleU.def
profiles/group/Bld.inf
profiles/group/ProfileSmokeTestModule.mmp
profiles/inc/ProfileSmokeTestModule.h
profiles/src/ProfileSmokeTestModule.cpp
profiles/src/ProfileSmokeTestModuleBlocks.cpp
smoketest_commdb.xml
uiresources/bwins/testsdkskinsu.def
uiresources/conf/smoketest_uiresources.cfg
uiresources/conf/ui_testsdkskinsu.cfg
uiresources/conf/ui_testsdkskinswu.cfg
uiresources/eabi/testsdkskinsu.def
uiresources/group/bld.inf
uiresources/group/testsdkskins.mmp
uiresources/inc/testsdkskins.h
uiresources/inc/testsdkskinscontrol.h
uiresources/inc/testsdkskinsobjectprovider.h
uiresources/init/testsdkskins.ini
uiresources/src/testsdkskins.cpp
uiresources/src/testsdkskinsblocks.cpp
uiresources/src/testsdkskinsblocksbbcc.cpp
uiresources/src/testsdkskinsblockscc.cpp
uiresources/src/testsdkskinsblocksdc.cpp
uiresources/src/testsdkskinsblocksdu.cpp
uiresources/src/testsdkskinsblocksfbcc.cpp
uiresources/src/testsdkskinsblocksid.cpp
uiresources/src/testsdkskinsblocksii.cpp
uiresources/src/testsdkskinsblockslbbcc.cpp
uiresources/src/testsdkskinsblockslbcc.cpp
uiresources/src/testsdkskinsblocksu.cpp
uiresources/src/testsdkskinsblockswu.cpp
uiresources/src/testsdkskinscontrol.cpp
uiresources/src/testsdkskinsobjectprovider.cpp
uiresources/testdata/wallpaper/symbian_01_320x480.jpg
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Group/8.0a/configuration.cfg	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,21 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Version 8.0a
+// 
+//
+
+#if !defined (CONFIGURATION_CFG)
+#define CONFIGURATION_CFG
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Group/8.0b/configuration.cfg	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,21 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Version 8.0b
+// 
+//
+
+#if !defined (CONFIGURATION_CFG)
+#define CONFIGURATION_CFG
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Group/8.1a/configuration.cfg	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,21 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Version 8.1a
+// 
+//
+
+#if !defined (CONFIGURATION_CFG)
+#define CONFIGURATION_CFG
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Group/8.1b/configuration.cfg	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,21 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Version 8.1b
+// 
+//
+
+#if !defined (CONFIGURATION_CFG)
+#define CONFIGURATION_CFG
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Group/9.0/configuration.cfg	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,21 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Version 9.0
+// 
+//
+
+#if !defined (CONFIGURATION_CFG)
+#define CONFIGURATION_CFG
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Group/9.1/configuration.cfg	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,21 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Version 9.1
+// 
+//
+
+#if !defined (CONFIGURATION_CFG)
+#define CONFIGURATION_CFG
+
+#endif
Binary file Group/ReadMe.doc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Group/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,37 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// For automated smoketest
+// 
+//
+
+#include "../Utils/group/bld.inf"
+#include "../agenda/Group/bld.inf"
+#include "../apploader/Group/bld.inf"
+#include "../contacts/group/bld.inf"
+#include "../messaging/Group/bld.inf"
+#include "../System/Group/bld.inf"
+#include "../Timew/Group/bld.inf"
+#include "../email/group/bld.inf"
+#include "../profiles/group/Bld.inf"
+#include "../notepad/group/bld.inf"
+#include "../appinstall/group/Bld.inf"
+#include "../lbs/group/bld.inf"
+#include "../uiresources/group/bld.inf"
+#include "../inputmethods/group/Bld.inf"
+#include "../IM/group/bld.inf"
+#include "../localisation/uiftestfw/group/BLD.INF"
+#include "../localisation/apparchitecture/group/BLD.INF"
+#include "../graphics/wserv/group/bld.inf"
+#include "../http/group/bld.inf"
+#include "../mediamgmt/group/Bld.inf"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Group/configuration.cfg	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,21 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Version 8.1b
+// 
+//
+
+#if !defined (CONFIGURATION_CFG)
+#define CONFIGURATION_CFG
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Group/smoketest.pl	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,143 @@
+#!/usr/bin/perl
+
+use strict;
+use File::Copy;
+use File::Path;
+
+unlink "smoketest.zip";
+rmtree "temp";
+mkpath "temp/smoketest/general";
+mkpath "temp/smoketest/winscw_udeb";
+mkpath "temp/smoketest/sms/general";
+mkpath "temp/smoketest/emailmessage/general";
+mkpath "temp/smoketest/emailsettings/general";
+mkpath "temp/smoketest/wallpaper/general";
+mkpath "temp/smoketest/appinstall/general";
+mkpath "temp/smoketest/10003a3f/general";
+mkpath "temp/smoketest/resource/general";
+mkpath "temp/smoketest/localisation/general";
+mkpath "temp/smoketest/bitmap/general";
+mkpath "temp/smoketest/ethernet/general";
+
+my $epoc=$ENV{'EPOCROOT'} . "epoc32/";
+copy("smoketest.xml",												"temp/test.xml");
+copy($epoc . "data/z/smoketest/smoketest_agenda.ini",				"temp/smoketest/general/smoketest_agenda.ini");
+copy($epoc . "data/z/smoketest/smoketest_agenda.script",			"temp/smoketest/general/smoketest_agenda.script");
+copy($epoc . "data/z/smoketest/smoketest_apploader.ini",			"temp/smoketest/general/smoketest_apploader.ini");
+copy($epoc . "data/z/smoketest/smoketest_apploader.script",			"temp/smoketest/general/smoketest_apploader.script");
+copy($epoc . "data/z/smoketest/smoketest_contacts.ini",				"temp/smoketest/general/smoketest_contacts.ini");
+copy($epoc . "data/z/smoketest/smoketest_contacts.script",			"temp/smoketest/general/smoketest_contacts.script");
+copy($epoc . "data/z/smoketest/smoketest_createsmsaccount.script",	"temp/smoketest/general/smoketest_createsmsaccount.script");
+copy($epoc . "data/z/smoketest/smoketest_mess.ini",					"temp/smoketest/general/smoketest_mess.ini");
+copy($epoc . "data/z/smoketest/smoketest_mess.script",				"temp/smoketest/general/smoketest_mess.script");
+copy($epoc . "data/z/smoketest/smoketest_phone.script",				"temp/smoketest/general/smoketest_phone.script");
+copy($epoc . "data/z/smoketest/smoketest_syncmlapp.script",			"temp/smoketest/general/smoketest_syncmlapp.script");
+copy($epoc . "data/z/smoketest/smoketest_system.script",			"temp/smoketest/general/smoketest_system.script");
+copy($epoc . "data/z/smoketest/smoketest_timew.ini",				"temp/smoketest/general/smoketest_timew.ini");
+copy($epoc . "data/z/smoketest/smoketest_timew.script",				"temp/smoketest/general/smoketest_timew.script");
+copy($epoc . "data/z/smoketest/smoketest_email.ini",				"temp/smoketest/general/smoketest_email.ini");
+copy($epoc . "data/z/smoketest/smoketest_email.script",				"temp/smoketest/general/smoketest_email.script");
+copy($epoc . "data/z/smoketest/smoketest_lbs.ini",					"temp/smoketest/general/smoketest_lbs.ini");
+copy($epoc . "data/z/smoketest/smoketest_lbs.script",				"temp/smoketest/general/smoketest_lbs.script");
+copy($epoc . "data/z/smoketest/smoketest_language.script",			"temp/smoketest/general/smoketest_language.script");
+copy($epoc . "data/z/smoketest/smoketest_bitmap.ini",				"temp/smoketest/general/smoketest_bitmap.ini");
+copy($epoc . "data/z/smoketest/smoketest_bitmap.script",			"temp/smoketest/general/smoketest_bitmap.script");
+copy($epoc . "data/z/smoketest/smoketest_http.ini",					"temp/smoketest/general/smoketest_http.ini");
+copy($epoc . "data/z/smoketest/smoketest_http.script",				"temp/smoketest/general/smoketest_http.script");
+copy($epoc . "data/z/smoketest/sms/message1.txt",					"temp/smoketest/sms/general/message1.txt");
+copy($epoc . "data/z/smoketest/MachineName.txt",					"temp/smoketest/general/MachineName.txt");
+copy($epoc . "data/z/smoketest/emailmessage/20KBody.txt",			"temp/smoketest/emailmessage/general/20KBody.txt");
+copy($epoc . "data/z/smoketest/emailsettings/popsettings_test908.txt",	"temp/smoketest/emailsettings/general/popsettings_test908.txt");
+copy($epoc . "data/z/private/10003a3f/apps/openservice1a.rsc",		"temp/smoketest/10003a3f/general/openservice1a.rsc");
+copy($epoc . "data/z/private/10003a3f/apps/openservice1b.rsc",		"temp/smoketest/10003a3f/general/openservice1b.rsc");
+copy($epoc . "data/z/private/10003a3f/apps/serverapp2_reg.rsc",		"temp/smoketest/10003a3f/general/serverapp2_reg.rsc");
+copy($epoc . "data/z/private/10003a3f/apps/serverapp3_reg.rsc",		"temp/smoketest/10003a3f/general/serverapp3_reg.rsc");
+copy($epoc . "data/z/private/10003a3f/apps/serverapp4_reg.rsc",		"temp/smoketest/10003a3f/general/serverapp4_reg.rsc");
+copy($epoc . "data/z/private/10003a3f/apps/serverapp6_reg.rsc",		"temp/smoketest/10003a3f/general/serverapp6_reg.rsc");
+copy($epoc . "data/z/private/10003a3f/apps/serverapp7_reg.rsc",		"temp/smoketest/10003a3f/general/serverapp7_reg.rsc");
+copy($epoc . "data/z/private/10003a3f/apps/serverapp_reg.rsc",		"temp/smoketest/10003a3f/general/serverapp_reg.rsc");
+copy($epoc . "data/z/private/10003a3f/apps/t_dataprioritysystem3_reg.rsc",	"temp/smoketest/10003a3f/general/t_dataprioritysystem3_reg.rsc");
+copy($epoc . "data/z/private/10003a3f/apps/t_groupname_reg.rsc",	"temp/smoketest/10003a3f/general/t_groupname_reg.rsc");
+copy($epoc . "data/z/private/10003a3f/apps/t_groupnamever1_reg.rsc","temp/smoketest/10003a3f/general/t_groupnamever1_reg.rsc");
+copy($epoc . "data/z/private/10003a3f/apps/t_groupnamever2_reg.rsc","temp/smoketest/10003a3f/general/t_groupnamever2_reg.rsc");
+copy($epoc . "data/z/private/10003a3f/apps/tctrlpnlapp_reg.rsc",	"temp/smoketest/10003a3f/general/tctrlpnlapp_reg.rsc");
+copy($epoc . "data/z/private/10003a3f/apps/testtrustedpriorityapp1_reg.rsc","temp/smoketest/10003a3f/general/testtrustedpriorityapp1_reg.rsc");
+copy($epoc . "data/z/private/10003a3f/apps/testtrustedpriorityapp2_reg.rsc","temp/smoketest/10003a3f/general/testtrustedpriorityapp2_reg.rsc");
+copy($epoc . "data/z/resource/apps/customisedefaulticonapp_loc.rsc","temp/smoketest/resource/general/customisedefaulticonapp_loc.rsc");
+copy($epoc . "data/z/resource/apps/default_app_icon.m02",			"temp/smoketest/resource/general/default_app_icon.m02");
+copy($epoc . "data/z/resource/apps/serverapp_loc.rsc",				"temp/smoketest/resource/general/serverapp_loc.rsc");
+copy($epoc . "data/z/resource/apps/t_groupname_loc.rsc",			"temp/smoketest/resource/general/t_groupname_loc.rsc");
+copy($epoc . "data/z/resource/apps/t_groupnamever1_loc.rsc",		"temp/smoketest/resource/general/t_groupnamever1_loc.rsc");
+copy($epoc . "data/z/resource/apps/t_groupnamever2_loc.rsc",		"temp/smoketest/resource/general/t_groupnamever2_loc.rsc");
+copy($epoc . "data/z/resource/apps/tstapp02.m02",					"temp/smoketest/resource/general/tstapp02.m02");
+copy($epoc . "data/z/resource/apps/tstapp.mbm",						"temp/smoketest/resource/general/tstapp.mbm");
+copy($epoc . "data/z/resource/apps/tstapp.rsc",						"temp/smoketest/resource/general/tstapp.rsc");
+copy($epoc . "data/z/resource/apps/tstapp_loc.r01",					"temp/smoketest/resource/general/tstapp_loc.r01");
+copy($epoc . "data/z/resource/apps/tstapp_loc.r02",					"temp/smoketest/resource/general/tstapp_loc.r02");
+copy($epoc . "data/z/resource/apps/tstapp_loc.r03",					"temp/smoketest/resource/general/tstapp_loc.r03");
+copy($epoc . "data/z/resource/apps/tstapp_loc.r04",					"temp/smoketest/resource/general/tstapp_loc.r04");
+copy($epoc . "data/z/resource/apps/tstapp_loc.r05",					"temp/smoketest/resource/general/tstapp_loc.r05");
+copy($epoc . "data/z/resource/apps/tstapp_loc.rsc",					"temp/smoketest/resource/general/tstapp_loc.rsc");
+copy($epoc . "data/z/resource/apps/tstappview",						"temp/smoketest/resource/general/tstappview");
+copy($epoc . "data/z/resource/apps/tstappview01.m01",				"temp/smoketest/resource/general/tstappview01.m01");
+copy($epoc . "data/z/resource/apps/tstappview01.m02",				"temp/smoketest/resource/general/tstappview01.m02");
+copy($epoc . "data/z/resource/apps/tstappview02.k",					"temp/smoketest/resource/general/tstappview02.k");
+copy($epoc . "data/z/private/10003a3f/import/apps/customisedefaulticonapp_reg.rsc",	"temp/smoketest/localisation/general/customisedefaulticonapp_reg.rsc");
+copy($epoc . "data/z/private/10003a3f/import/apps/testuntrustedpriorityapp1_reg.rsc","temp/smoketest/localisation/general/testuntrustedpriorityapp1_reg.rsc");
+copy($epoc . "data/z/private/10003a3f/import/apps/testuntrustedpriorityapp2_reg.rsc","temp/smoketest/localisation/general/testuntrustedpriorityapp2_reg.rsc");
+copy($epoc . "data/z/private/10003a3f/import/apps/tstapp_reg.rsc",	"temp/smoketest/localisation/general/tstapp_reg.rsc");
+copy($epoc . "data/z/resource/plugins/tstapp_embedded.rsc",			"temp/smoketest/localisation/general/tstapp_embedded.rsc");
+copy($epoc . "data/z/smoketest/bitmap/uibench_16bit.mbm",			"temp/smoketest/bitmap/general/uibench_16bit.mbm");
+copy($epoc . "data/z/delproxy.pl",									"temp/smoketest/ethernet/general/delproxy.pl");
+copy($epoc . "release/winscw/udeb/SmokeTestSecureFSclient.dll",		"temp/smoketest/winscw_udeb/SmokeTestSecureFSclient.dll");
+copy($epoc . "release/winscw/udeb/SmokeTestSecureFSserver.exe",		"temp/smoketest/winscw_udeb/SmokeTestSecureFSserver.exe");
+copy($epoc . "release/winscw/udeb/Smoketest_Agenda_Server.exe",		"temp/smoketest/winscw_udeb/Smoketest_Agenda_Server.exe");
+copy($epoc . "release/winscw/udeb/smoketest_apploader.exe",			"temp/smoketest/winscw_udeb/smoketest_apploader.exe");
+copy($epoc . "release/winscw/udeb/Smoketest_Contacts_Server.exe",	"temp/smoketest/winscw_udeb/Smoketest_Contacts_Server.exe");
+copy($epoc . "release/winscw/udeb/Smoketest_Mess_Server.exe",		"temp/smoketest/winscw_udeb/Smoketest_Mess_Server.exe");
+copy($epoc . "release/winscw/udeb/Smoketest_System.exe",			"temp/smoketest/winscw_udeb/Smoketest_System.exe");
+copy($epoc . "release/winscw/udeb/Smoketest_Timew_Server.exe",		"temp/smoketest/winscw_udeb/Smoketest_Timew_Server.exe");
+copy($epoc . "release/winscw/udeb/SmokeTest_Utils.dll",				"temp/smoketest/winscw_udeb/SmokeTest_Utils.dll");
+copy($epoc . "release/winscw/udeb/t_msgutilityserver.dll",			"temp/smoketest/winscw_udeb/t_msgutilityserver.dll");
+copy($epoc . "release/winscw/udeb/t_msgpopserver.exe",				"temp/smoketest/winscw_udeb/t_msgpopserver.exe");
+copy($epoc . "release/winscw/udeb/t_msgsmtpserver.exe",				"temp/smoketest/winscw_udeb/t_msgsmtpserver.exe");
+copy($epoc . "release/winscw/udeb/lbstestutils.dll",				"temp/smoketest/winscw_udeb/lbstestutils.dll");
+copy($epoc . "release/winscw/udeb/lbstestclient.dll",				"temp/smoketest/winscw_udeb/lbstestclient.dll");
+copy($epoc . "release/winscw/udeb/lbstestchannel.dll",				"temp/smoketest/winscw_udeb/lbstestchannel.dll");
+copy($epoc . "release/winscw/udeb/lbstestserver.exe",				"temp/smoketest/winscw_udeb/lbstestserver.exe");
+copy($epoc . "release/winscw/udeb/ctlbsexeclient.exe",				"temp/smoketest/winscw_udeb/ctlbsexeclient.exe");
+copy($epoc . "release/winscw/udeb/lbsclienttestserver.exe",			"temp/smoketest/winscw_udeb/lbsclienttestserver.exe");
+copy($epoc . "release/winscw/udeb/appfwk_test_AppUi.dll",			"temp/smoketest/winscw_udeb/appfwk_test_AppUi.dll");
+copy($epoc . "release/winscw/udeb/appfwk_test_utils.dll",			"temp/smoketest/winscw_udeb/appfwk_test_utils.dll");
+copy($epoc . "release/winscw/udeb/TIconLoaderAndIconArrayForLeaks.dll",	"temp/smoketest/winscw_udeb/TIconLoaderAndIconArrayForLeaks.dll");
+copy($epoc . "release/winscw/udeb/TSTAPP_embedded.dll",				"temp/smoketest/winscw_udeb/TSTAPP_embedded.dll");
+copy($epoc . "release/winscw/udeb/apparctestserver.exe",			"temp/smoketest/winscw_udeb/apparctestserver.exe");
+copy($epoc . "release/winscw/udeb/tstapp.exe",						"temp/smoketest/winscw_udeb/tstapp.exe");
+copy($epoc . "release/winscw/udeb/t_animplugin.dll",				"temp/smoketest/winscw_udeb/t_animplugin.dll");
+copy($epoc . "release/winscw/udeb/t_graphicswservapi.exe",			"temp/smoketest/winscw_udeb/t_graphicswservapi.exe");
+copy($epoc . "release/winscw/udeb/twsgraphicshare.exe",				"temp/smoketest/winscw_udeb/twsgraphicshare.exe");
+copy($epoc . "release/winscw/udeb/twsgraphicunshare.exe",			"temp/smoketest/winscw_udeb/twsgraphicunshare.exe");
+copy($epoc . "release/winscw/udeb/testhttpsuite.exe",				"temp/smoketest/winscw_udeb/testhttpsuite.exe");
+
+copy($epoc . "release/winscw/udeb/ProfileSmokeTestModule.dll",      "temp/smoketest/winscw_udeb/ProfileSmokeTestModule.dll");
+copy($epoc . "winscw/c/smoketest/ProfileSmokeTestModule.cfg",       "temp/smoketest/general/ProfileSmokeTestModule.cfg");
+copy($epoc . "release/winscw/udeb/AppInstallSmokeTestModule.dll",   "temp/smoketest/winscw_udeb/AppInstallSmokeTestModule.dll");
+copy($epoc . "winscw/c/smoketest/AppInstallSmokeTestModule.cfg",    "temp/smoketest/general/AppInstallSmokeTestModule.cfg");
+copy($epoc . "winscw/c/smoketest/appinstall/sistest_winscw.sisx",   "temp/smoketest/appinstall/general/sistest_winscw.sisx");
+copy($epoc . "release/winscw/udeb/TestNpdApi.dll",					"temp/smoketest/winscw_udeb/TestNpdApi.dll");
+copy($epoc . "data/c/smoketest/smoketest_notepad.cfg",				"temp/smoketest/general/smoketest_notepad.cfg");
+copy($epoc . "data/c/smoketest/ui_TestNpdApi.cfg",					"temp/smoketest/general/ui_TestNpdApi.cfg");
+copy($epoc . "release/winscw/udeb/testsdkskins.dll",				"temp/smoketest/winscw_udeb/testsdkskins.dll");
+copy($epoc . "data/c/smoketest/smoketest_uiresources.cfg",			"temp/smoketest/general/smoketest_uiresources.cfg");
+copy($epoc . "data/c/smoketest/ui_testsdkskinsu.cfg",				"temp/smoketest/general/ui_testsdkskinsu.cfg");
+copy($epoc . "data/c/smoketest/ui_testsdkskinswu.cfg",				"temp/smoketest/general/ui_testsdkskinswu.cfg");
+copy($epoc . "data/c/smoketest/wallpaper/symbian_01_320x480.jpg",	"temp/smoketest/wallpaper/general/symbian_01_320x480.jpg");
+copy($epoc . "release/winscw/udeb/InputMethodSmokeTestModule.dll",  "temp/smoketest/winscw_udeb/InputMethodSmokeTestModule.dll");
+copy($epoc . "winscw/c/smoketest/InputMethodSmokeTestModule.cfg",   "temp/smoketest/general/InputMethodSmokeTestModule.cfg");
+copy($epoc . "release/winscw/udeb/IMApiTest.dll",					"temp/smoketest/winscw_udeb/IMApiTest.dll");
+copy($epoc . "data/c/smoketest/imapitest.ini",						"temp/smoketest/general/imapitest.ini");
+copy($epoc . "release/winscw/udeb/MediaMgmtSmokeTestModule.dll",	"temp/smoketest/winscw_udeb/MediaMgmtSmokeTestModule.dll");
+copy($epoc . "winscw/c/smoketest/UI_MediaMgmtSmokeTestModule.cfg",  "temp/smoketest/general/UI_MediaMgmtSmokeTestModule.cfg");
+copy($epoc . "winscw/c/smoketest/MediaMgmtSmokeTestModule.cfg",   	"temp/smoketest/general/MediaMgmtSmokeTestModule.cfg");
+
+system("7z a -tzip smoketest.zip ./temp/*");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Group/smoketest.xml	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1226 @@
+<?xml version="1.0"?>
+<test>
+	<id>1</id>
+	<owner>admin</owner>
+	<priority>10</priority>
+	<buildid></buildid>
+	<postAction>
+		<type>FileStoreAction</type>
+		<params>
+			<param name="report-type" value="ATS3_REPORT"/>
+		</params>
+    </postAction>
+	<postAction>
+		<type>DiamondsAction</type>
+	</postAction>
+	<name>smoketest</name>
+    <target>
+        <device rank="master" alias="emulator_udeb_tef">
+            <property name="HARNESS" value="GENERIC" />
+        </device>
+        <device rank="master" alias="emulator_udeb_stif">
+            <property name="HARNESS" value="ATSINTERFACE" />
+        </device>
+    </target>
+	<plan id="" name="WINSCW UDEB SmokeTest" harness="GENERIC" enabled="true" passrate="100">
+		<session id="" name="smoke tests" harness="GENERIC" enabled="true" passrate="100">
+			<set id="" name="GENERIC smoke tests" harness="GENERIC" enabled="true" passrate="100">
+            	<target>
+                    <device rank="master" alias="emulator_udeb_tef" />
+                </target>
+				<case id="" name="install and run GENERIC smoketests" harness="GENERIC" enabled="true" passrate="100">
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="*"/>
+							<param dst="c:\smoketest"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="message1.txt"/>
+							<param dst="c:/smoketest/sms/message1.txt"/>
+							<param component-path="smoketest\sms" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="20KBody.txt"/>
+							<param dst="c:/smoketest/emailmessage/20KBody.txt"/>
+							<param component-path="smoketest\emailmessage" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="popsettings_test908.txt"/>
+							<param dst="c:/smoketest/emailsettings/popsettings_test908.txt"/>
+							<param component-path="smoketest\emailsettings" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="openservice1a.rsc"/>
+							<param dst="z:/private/10003a3f/apps/openservice1a.rsc"/>
+							<param component-path="smoketest\10003a3f" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="openservice1b.rsc"/>
+							<param dst="z:/private/10003a3f/apps/openservice1b.rsc"/>
+							<param component-path="smoketest\10003a3f" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="serverapp2_reg.rsc"/>
+							<param dst="z:/private/10003a3f/apps/serverapp2_reg.rsc"/>
+							<param component-path="smoketest\10003a3f" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="serverapp3_reg.rsc"/>
+							<param dst="z:/private/10003a3f/apps/serverapp3_reg.rsc"/>
+							<param component-path="smoketest\10003a3f" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="serverapp4_reg.rsc"/>
+							<param dst="z:/private/10003a3f/apps/serverapp4_reg.rsc"/>
+							<param component-path="smoketest\10003a3f" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="serverapp6_reg.rsc"/>
+							<param dst="z:/private/10003a3f/apps/serverapp6_reg.rsc"/>
+							<param component-path="smoketest\10003a3f" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="serverapp7_reg.rsc"/>
+							<param dst="z:/private/10003a3f/apps/serverapp7_reg.rsc"/>
+							<param component-path="smoketest\10003a3f" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="serverapp_reg.rsc"/>
+							<param dst="z:/private/10003a3f/apps/serverapp_reg.rsc"/>
+							<param component-path="smoketest\10003a3f" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="t_dataprioritysystem3_reg.rsc"/>
+							<param dst="z:/private/10003a3f/apps/t_dataprioritysystem3_reg.rsc"/>
+							<param component-path="smoketest\10003a3f" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="t_groupname_reg.rsc"/>
+							<param dst="z:/private/10003a3f/apps/t_groupname_reg.rsc"/>
+							<param component-path="smoketest\10003a3f" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="t_groupnamever1_reg.rsc"/>
+							<param dst="z:/private/10003a3f/apps/t_groupnamever1_reg.rsc"/>
+							<param component-path="smoketest\10003a3f" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="t_groupnamever2_reg.rsc"/>
+							<param dst="z:/private/10003a3f/apps/t_groupnamever2_reg.rsc"/>
+							<param component-path="smoketest\10003a3f" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="tctrlpnlapp_reg.rsc"/>
+							<param dst="z:/private/10003a3f/apps/tctrlpnlapp_reg.rsc"/>
+							<param component-path="smoketest\10003a3f" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="testtrustedpriorityapp1_reg.rsc"/>
+							<param dst="z:/private/10003a3f/apps/testtrustedpriorityapp1_reg.rsc"/>
+							<param component-path="smoketest\10003a3f" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="testtrustedpriorityapp2_reg.rsc"/>
+							<param dst="z:/private/10003a3f/apps/testtrustedpriorityapp2_reg.rsc"/>
+							<param component-path="smoketest\10003a3f" />
+						</params>
+					</step>					
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="customisedefaulticonapp_loc.rsc"/>
+							<param dst="z:/resource/apps/customisedefaulticonapp_loc.rsc"/>
+							<param component-path="smoketest\resource" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="default_app_icon.m02"/>
+							<param dst="z:/resource/apps/default_app_icon.m02"/>
+							<param component-path="smoketest\resource" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="serverapp_loc.rsc"/>
+							<param dst="z:/resource/apps/serverapp_loc.rsc"/>
+							<param component-path="smoketest\resource" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="t_groupname_loc.rsc"/>
+							<param dst="z:/resource/apps/t_groupname_loc.rsc"/>
+							<param component-path="smoketest\resource" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="t_groupnamever1_loc.rsc"/>
+							<param dst="z:/resource/apps/t_groupnamever1_loc.rsc"/>
+							<param component-path="smoketest\resource" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="t_groupnamever2_loc.rsc"/>
+							<param dst="z:/resource/apps/t_groupnamever2_loc.rsc"/>
+							<param component-path="smoketest\resource" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="tstapp02.m02"/>
+							<param dst="z:/resource/apps/tstapp02.m02"/>
+							<param component-path="smoketest\resource" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="tstapp.mbm"/>
+							<param dst="z:/resource/apps/tstapp.mbm"/>
+							<param component-path="smoketest\resource" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="tstapp.rsc"/>
+							<param dst="z:/resource/apps/tstapp.rsc"/>
+							<param component-path="smoketest\resource" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="tstapp_loc.r01"/>
+							<param dst="z:/resource/apps/tstapp_loc.r01"/>
+							<param component-path="smoketest\resource" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="tstapp_loc.r02"/>
+							<param dst="z:/resource/apps/tstapp_loc.r02"/>
+							<param component-path="smoketest\resource" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="tstapp_loc.r03"/>
+							<param dst="z:/resource/apps/tstapp_loc.r03"/>
+							<param component-path="smoketest\resource" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="tstapp_loc.r04"/>
+							<param dst="z:/resource/apps/tstapp_loc.r04"/>
+							<param component-path="smoketest\resource" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="tstapp_loc.r05"/>
+							<param dst="z:/resource/apps/tstapp_loc.r05"/>
+							<param component-path="smoketest\resource" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="tstapp_loc.rsc"/>
+							<param dst="z:/resource/apps/tstapp_loc.rsc"/>
+							<param component-path="smoketest\resource" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="tstappview"/>
+							<param dst="z:/resource/apps/tstappview"/>
+							<param component-path="smoketest\resource" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="tstappview01.m01"/>
+							<param dst="z:/resource/apps/tstappview01.m01"/>
+							<param component-path="smoketest\resource" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="tstappview01.m02"/>
+							<param dst="z:/resource/apps/tstappview01.m02"/>
+							<param component-path="smoketest\resource" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="tstappview02.k"/>
+							<param dst="z:/resource/apps/tstappview02.k"/>
+							<param component-path="smoketest\resource" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="customisedefaulticonapp_reg.rsc"/>
+							<param dst="z:/private/10003a3f/import/apps/customisedefaulticonapp_reg.rsc"/>
+							<param component-path="smoketest\localisation" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="testuntrustedpriorityapp1_reg.rsc"/>
+							<param dst="z:/private/10003a3f/import/apps/testuntrustedpriorityapp1_reg.rsc"/>
+							<param component-path="smoketest\localisation" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="testuntrustedpriorityapp2_reg.rsc"/>
+							<param dst="z:/private/10003a3f/import/apps/testuntrustedpriorityapp2_reg.rsc"/>
+							<param component-path="smoketest\localisation" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="tstapp_reg.rsc"/>
+							<param dst="z:/private/10003a3f/import/apps/tstapp_reg.rsc"/>
+							<param component-path="smoketest\localisation" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="tstapp_embedded.rsc"/>
+							<param dst="z:/resource/plugins/tstapp_embedded.rsc"/>
+							<param component-path="smoketest\localisation" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="uibench_16bit.mbm"/>
+							<param dst="c:/smoketest/bitmap/uibench_16bit.mbm"/>
+							<param component-path="smoketest\bitmap" />
+						</params>
+					</step>			
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="delproxy.pl"/>
+							<param dst="c:\delproxy.pl"/>
+							<param component-path="smoketest\ethernet" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="Smoketest_Agenda_Server.exe"/>
+							<param dst="c:\sys\bin\Smoketest_Agenda_Server.exe"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="smoketest_apploader.exe"/>
+							<param dst="c:\sys\bin\smoketest_apploader.exe"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="Smoketest_Contacts_Server.exe"/>
+							<param dst="c:\sys\bin\Smoketest_Contacts_Server.exe"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="Smoketest_Mess_Server.exe"/>
+							<param dst="c:\sys\bin\Smoketest_Mess_Server.exe"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="Smoketest_System.exe"/>
+							<param dst="c:\sys\bin\Smoketest_System.exe"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="Smoketest_Timew_Server.exe"/>
+							<param dst="c:\sys\bin\Smoketest_Timew_Server.exe"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="SmokeTest_Utils.dll"/>
+							<param dst="c:\sys\bin\SmokeTest_Utils.dll"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="SmokeTestSecureFSclient.dll"/>
+							<param dst="c:\sys\bin\SmokeTestSecureFSclient.dll"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="SmokeTestSecureFSserver.exe"/>
+							<param dst="c:\sys\bin\SmokeTestSecureFSserver.exe"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="t_msgutilityserver.dll"/>
+							<param dst="c:\sys\bin\t_msgutilityserver.dll"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>					
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="t_msgpopserver.exe"/>
+							<param dst="c:\sys\bin\t_msgpopserver.exe"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>					
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="t_msgsmtpserver.exe"/>
+							<param dst="c:\sys\bin\t_msgsmtpserver.exe"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>						
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="lbstestutils.dll"/>
+							<param dst="c:\sys\bin\lbstestutils.dll"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>	
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="lbstestclient.dll"/>
+							<param dst="c:\sys\bin\lbstestclient.dll"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>	
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="lbstestchannel.dll"/>
+							<param dst="c:\sys\bin\lbstestchannel.dll"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="lbstestserver.exe"/>
+							<param dst="c:\sys\bin\lbstestserver.exe"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="ctlbsexeclient.exe"/>
+							<param dst="c:\sys\bin\ctlbsexeclient.exe"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="lbsclienttestserver.exe"/>
+							<param dst="c:\sys\bin\lbsclienttestserver.exe"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="appfwk_test_AppUi.dll"/>
+							<param dst="c:\sys\bin\appfwk_test_AppUi.dll"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="appfwk_test_utils.dll"/>
+							<param dst="c:\sys\bin\appfwk_test_utils.dll"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="TIconLoaderAndIconArrayForLeaks.dll"/>
+							<param dst="c:\sys\bin\TIconLoaderAndIconArrayForLeaks.dll"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="TSTAPP_embedded.dll"/>
+							<param dst="c:\sys\bin\TSTAPP_embedded.dll"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>					
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="apparctestserver.exe"/>
+							<param dst="c:\sys\bin\apparctestserver.exe"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="tstapp.exe"/>
+							<param dst="c:\sys\bin\tstapp.exe"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="t_animplugin.dll"/>
+							<param dst="c:\sys\bin\t_animplugin.dll"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="t_graphicswservapi.exe"/>
+							<param dst="c:\sys\bin\t_graphicswservapi.exe"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+						<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="twsgraphicshare.exe"/>
+							<param dst="c:\sys\bin\twsgraphicshare.exe"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="twsgraphicunshare.exe"/>
+							<param dst="c:\sys\bin\twsgraphicunshare.exe"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>		
+					<step id="" name="Test Step 1 (install)" harness="GENERIC" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="testhttpsuite.exe"/>
+							<param dst="c:\sys\bin\testhttpsuite.exe"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="Test Step 2 (execute)" harness="GENERIC" enabled="true" passrate="100" significant="true">
+						<command>execute</command>
+						<params>
+							<param file="testexecute.exe"/>
+							<param parameters="c:\smoketest\smoketest_apploader.script"/>
+							<param result-file="c:\logs\testexecute\smoketest_apploader.htm"/>
+							<param timeout="600"/>
+							<param parser="TEFTestResultParser"/>
+							<param leave-old-result="true"/>
+						</params>
+					</step>
+					<step id="" name="Test Step 2 (execute)" harness="GENERIC" enabled="true" passrate="100" significant="true">
+						<command>execute</command>
+						<params>
+							<param file="testexecute.exe"/>
+							<param parameters="c:\smoketest\smoketest_agenda.script"/>
+							<param result-file="c:\logs\testexecute\smoketest_agenda.htm"/>
+							<param timeout="600"/>
+							<param parser="TEFTestResultParser"/>
+							<param leave-old-result="true"/>
+						</params>
+					</step>
+					<step id="" name="Test Step 2 (execute)" harness="GENERIC" enabled="true" passrate="100" significant="true">
+						<command>execute</command>
+						<params>
+							<param file="testexecute.exe"/>
+							<param parameters="c:\smoketest\smoketest_contacts.script"/>
+							<param result-file="c:\logs\testexecute\smoketest_contacts.htm"/>
+							<param timeout="600"/>
+							<param parser="TEFTestResultParser"/>
+							<param leave-old-result="true"/>
+						</params>
+					</step>
+					<step id="" name="Test Step 2 (execute)" harness="GENERIC" enabled="true" passrate="100" significant="true">
+						<command>execute</command>
+						<params>
+							<param file="testexecute.exe"/>
+							<param parameters="c:\smoketest\smoketest_mess.script"/>
+							<param result-file="c:\logs\testexecute\smoketest_mess.htm"/>
+							<param timeout="600"/>
+							<param parser="TEFTestResultParser"/>
+							<param leave-old-result="true"/>
+						</params>
+					</step>
+					<step id="" name="Test Step 2 (execute)" harness="GENERIC" enabled="true" passrate="100" significant="true">
+						<command>execute</command>
+						<params>
+							<param file="testexecute.exe"/>
+							<param parameters="c:\smoketest\smoketest_timew.script"/>
+							<param result-file="c:\logs\testexecute\smoketest_timew.htm"/>
+							<param timeout="600"/>
+							<param parser="TEFTestResultParser"/>
+							<param leave-old-result="true"/>
+						</params>
+					</step>
+					<step id="" name="Test Step 2 (execute)" harness="GENERIC" enabled="true" passrate="100" significant="true">
+						<command>execute</command>
+						<params>
+							<param file="testexecute.exe"/>
+							<param parameters="c:\smoketest\smoketest_email.script"/>
+							<param result-file="c:\logs\testexecute\smoketest_email.htm"/>
+							<param timeout="600"/>
+							<param parser="TEFTestResultParser"/>
+							<param leave-old-result="true"/>
+						</params>
+					</step>
+					<step id="" name="Test Step 2 (execute)" harness="GENERIC" enabled="true" passrate="100" significant="true">
+						<command>execute</command>
+						<params>
+							<param file="testexecute.exe"/>
+							<param parameters="c:\smoketest\smoketest_lbs.script"/>
+							<param result-file="c:\logs\testexecute\smoketest_lbs.htm"/>
+							<param timeout="600"/>
+							<param parser="TEFTestResultParser"/>
+							<param leave-old-result="true"/>
+						</params>
+					</step>
+					<step id="" name="Test Step 2 (execute)" harness="GENERIC" enabled="true" passrate="100" significant="true">
+						<command>execute</command>
+						<params>
+							<param file="testexecute.exe"/>
+							<param parameters="c:\smoketest\smoketest_language.script"/>
+							<param result-file="c:\logs\testexecute\smoketest_language.htm"/>
+							<param timeout="1200"/>
+							<param parser="TEFTestResultParser"/>
+							<param leave-old-result="true"/>
+						</params>
+					</step>
+					<step id="" name="Test Step 2 (execute)" harness="GENERIC" enabled="true" passrate="100" significant="true">
+						<command>execute</command>
+						<params>
+							<param file="testexecute.exe"/>
+							<param parameters="c:\smoketest\smoketest_bitmap.script"/>
+							<param result-file="c:\logs\testexecute\smoketest_bitmap.htm"/>
+							<param timeout="1200"/>
+							<param parser="TEFTestResultParser"/>
+							<param leave-old-result="true"/>
+						</params>
+					</step>
+					<step id="" name="Test Step 2 (execute)" harness="GENERIC" enabled="true" passrate="100" significant="true">
+						<command>execute</command>
+						<params>
+							<param local="true"/>
+							<param file="perl"/>
+							<param dir="D:\ATS\winscw_smoketest\epoc32\winscw\c"/>
+							<param parameters="delproxy.pl ethernetced.xml"/>
+							<param timeout="600"/>
+							<param async="false"/>
+						</params>
+					</step>
+					<step id="" name="Test Step 2 (execute)" harness="GENERIC" enabled="true" passrate="100" significant="true">
+						<command>execute</command>
+						<params>
+							<param local="true"/>
+							<param file="perl"/>
+							<param dir="D:\ATS\winscw_smoketest\epoc32\tools"/>
+							<param parameters="configchange.pl --config ethernetWithCommDB --kernel EKA2 --target winscw --variant UDEB"/>
+							<param timeout="1200"/>
+							<param async="false"/>
+						</params>
+					</step>
+					<step id="" name="Test Step 2 (execute)" harness="GENERIC" enabled="true" passrate="100" significant="true">
+						<command>execute</command>
+						<params>
+							<param file="dbcreator.exe"/>
+							<param parameters="-dtextshell -- f:c:\S60_32_default_snaps.xml"/>
+							<param timeout="600"/>
+						</params>
+					</step>
+					<step id="" name="Test Step 2 (execute)" harness="GENERIC" enabled="true" passrate="100" significant="true">
+						<command>execute</command>
+						<params>
+							<param file="testexecute.exe"/>
+							<param parameters="c:\smoketest\smoketest_http.script"/>
+							<param result-file="c:\logs\testexecute\smoketest_http.htm"/>
+							<param timeout="600"/>
+							<param parser="TEFTestResultParser"/>
+							<param leave-old-result="true"/>
+						</params>
+					</step>
+					<step id="" name="Test Step 3 (fetch-log)" harness="GENERIC" enabled="true" passrate="100">
+						<command>fetch-log</command>
+						<params>
+							<param path="c:\logs\testexecute\screen.mbm" /> 
+						</params>
+					</step>
+					<step id="" name="Test Step 3 (fetch-log)" harness="GENERIC" enabled="true" passrate="100">
+						<command>fetch-log</command>
+						<params>
+							<param path="c:\logs\testexecute\HttpGoogle.htm" /> 
+						</params>
+					</step>					
+				</case>
+			</set>
+            <set id="" name="ATSINTERFACE smoke tests" harness="ATSINTERFACE" enabled="true" passrate="100">
+                <target>
+                    <device rank="master" alias="emulator_udeb_stif" />
+                </target>
+                <case id="" name="install and run ATSINTERFACE smoketests" harness="ATSINTERFACE" enabled="true" passrate="100">
+                    <step id="" name="MakeDir (SPD_Logs)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="false">
+                        <command>makedir</command>
+                        <params>
+                            <param dir="c:\spd_logs\xml"/> 
+                        </params>
+                    </step>
+                    <step id="" name="ProfileSmokeTestModule.dll (install)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="ProfileSmokeTestModule.dll"/>
+							<param dst="c:\sys\bin\ProfileSmokeTestModule.dll"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+                    <step id="" name="ProfileSmokeTestModule.cfg (install)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="ProfileSmokeTestModule.cfg"/>
+							<param dst="c:\smoketest\ProfileSmokeTestModule.cfg"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="TestNpdApi.dll (install)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="TestNpdApi.dll"/>
+							<param dst="c:\sys\bin\TestNpdApi.dll"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+                    <step id="" name="smoketest_notepad.cfg (install)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="smoketest_notepad.cfg"/>
+							<param dst="c:\smoketest\smoketest_notepad.cfg"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+                    <step id="" name="ui_TestNpdApi.cfg (install)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="ui_TestNpdApi.cfg"/>
+							<param dst="c:\smoketest\ui_TestNpdApi.cfg"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+                    <step id="" name="AppInstallSmokeTestModule.dll (install)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="AppInstallSmokeTestModule.dll"/>
+							<param dst="c:\sys\bin\AppInstallSmokeTestModule.dll"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+                    <step id="" name="AppInstallSmokeTestModule.cfg (install)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="AppInstallSmokeTestModule.cfg"/>
+							<param dst="c:\smoketest\AppInstallSmokeTestModule.cfg"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+                    <step id="" name="sistest_winscw.sisx (install)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="sistest_winscw.sisx"/>
+							<param dst="c:\smoketest\appinstall\sistest_winscw.sisx"/>
+							<param component-path="smoketest\appinstall" />
+						</params>
+					</step>
+					<step id="" name="testsdkskins.dll (install)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="testsdkskins.dll"/>
+							<param dst="c:\sys\bin\testsdkskins.dll"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+                    <step id="" name="smoketest_uiresources.cfg (install)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="smoketest_uiresources.cfg"/>
+							<param dst="c:\smoketest\smoketest_uiresources.cfg"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+                    <step id="" name="ui_testsdkskinsu.cfg (install)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="ui_testsdkskinsu.cfg"/>
+							<param dst="c:\smoketest\ui_testsdkskinsu.cfg"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+                    <step id="" name="ui_testsdkskinswu.cfg (install)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="ui_testsdkskinswu.cfg"/>
+							<param dst="c:\smoketest\ui_testsdkskinswu.cfg"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="symbian_01_320x480.jpg (install)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="symbian_01_320x480.jpg"/>
+							<param dst="c:/smoketest/wallpaper/symbian_01_320x480.jpg"/>
+							<param component-path="smoketest\wallpaper" />
+						</params>
+					</step>
+                    <step id="" name="InputMethodSmokeTestModule.dll (install)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="InputMethodSmokeTestModule.dll"/>
+							<param dst="c:\sys\bin\InputMethodSmokeTestModule.dll"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+                    <step id="" name="InputMethodSmokeTestModule.cfg (install)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="InputMethodSmokeTestModule.cfg"/>
+							<param dst="c:\smoketest\InputMethodSmokeTestModule.cfg"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="IMApiTest.dll (install)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="IMApiTest.dll"/>
+							<param dst="c:\sys\bin\IMApiTest.dll"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+                    <step id="" name="imapitest.ini (install)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="imapitest.ini"/>
+							<param dst="c:\smoketest\imapitest.ini"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="MediaMgmtSmokeTestModule.dll (install)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="binary"/>
+							<param src="MediaMgmtSmokeTestModule.dll"/>
+							<param dst="c:\sys\bin\MediaMgmtSmokeTestModule.dll"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+                    <step id="" name="UI_MediaMgmtSmokeTestModule.cfg (install)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="UI_MediaMgmtSmokeTestModule.cfg"/>
+							<param dst="c:\smoketest\UI_MediaMgmtSmokeTestModule.cfg"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+                    <step id="" name="MediaMgmtSmokeTestModule.cfg (install)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="false">
+						<command>install</command>
+						<params>
+							<param type="data"/>
+							<param src="MediaMgmtSmokeTestModule.cfg"/>
+							<param dst="c:\smoketest\MediaMgmtSmokeTestModule.cfg"/>
+							<param component-path="smoketest" />
+						</params>
+					</step>
+					<step id="" name="ProfileSmokeTestModule (execute)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="true">
+						<command>execute</command>
+						<params>
+							<param file="atsinterface.exe"/>
+							<param parameters="-testmodule testscripter -config c:\smoketest\ProfileSmokeTestModule.cfg"/>
+							<param result-file="c:\spd_logs\xml\testscripter.xml"/>
+							<param timeout="600"/>
+						</params>
+					</step>
+					<step id="" name="smoketest_notepad (execute)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="true">
+						<command>execute</command>
+						<params>
+							<param file="atsinterface.exe"/>
+							<param parameters="-testmodule testcombiner -config c:\smoketest\smoketest_notepad.cfg"/>
+							<param result-file="c:\spd_logs\xml\testcombiner.xml"/>
+							<param timeout="600"/>
+						</params>
+					</step>
+					<step id="" name="AppInstallSmokeTestModule (execute)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="true">
+						<command>execute</command>
+						<params>
+							<param file="atsinterface.exe"/>
+							<param parameters="-testmodule testscripter -config c:\smoketest\AppInstallSmokeTestModule.cfg"/>
+							<param result-file="c:\spd_logs\xml\testscripter.xml"/>
+							<param timeout="600"/>
+						</params>
+					</step>
+					<step id="" name="smoketest_uiresources (execute)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="true">
+						<command>execute</command>
+						<params>
+							<param file="atsinterface.exe"/>
+							<param parameters="-testmodule testcombiner -config c:\smoketest\smoketest_uiresources.cfg"/>
+							<param result-file="c:\spd_logs\xml\testcombiner.xml"/>
+							<param timeout="600"/>
+						</params>
+					</step>
+					<step id="" name="InputMethodSmokeTestModule (execute)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="true">
+						<command>execute</command>
+						<params>
+							<param file="atsinterface.exe"/>
+							<param parameters="-testmodule testscripter -config c:\smoketest\InputMethodSmokeTestModule.cfg"/>
+							<param result-file="c:\spd_logs\xml\testscripter.xml"/>
+							<param timeout="600"/>
+						</params>
+					</step>					
+					<step id="" name="IMApiTest (execute)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="true">
+						<command>execute</command>
+						<params>
+							<param file="atsinterface.exe"/>
+							<param parameters="-testmodule IMApiTest"/>
+							<param result-file="c:\spd_logs\xml\imapitest.xml"/>
+							<param timeout="600"/>
+						</params>
+					</step>
+					<step id="" name="MediaMgmtSmokeTestModule (execute)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="true">
+						<command>execute</command>
+						<params>
+							<param file="atsinterface.exe"/>
+							<param parameters="-testmodule testcombiner -config c:\smoketest\MediaMgmtSmokeTestModule.cfg"/>
+							<param result-file="c:\spd_logs\xml\testcombiner.xml"/>
+							<param timeout="600"/>
+						</params>
+					</step>
+				</case>
+            </set>
+		</session>
+	</plan>
+	<files>
+		<file>smoketest/general/smoketest_agenda.ini</file>
+		<file>smoketest/general/smoketest_agenda.script</file>
+		<file>smoketest/general/smoketest_apploader.ini</file>
+		<file>smoketest/general/smoketest_apploader.script</file>
+		<file>smoketest/general/smoketest_contacts.ini</file>
+		<file>smoketest/general/smoketest_contacts.script</file>
+		<file>smoketest/general/smoketest_createsmsaccount.script</file>
+		<file>smoketest/general/smoketest_mess.ini</file>
+		<file>smoketest/general/smoketest_mess.script</file>
+		<file>smoketest/general/smoketest_timew.ini</file>
+		<file>smoketest/general/smoketest_timew.script</file>
+		<file>smoketest/general/smoketest_email.ini</file>
+		<file>smoketest/general/smoketest_email.script</file>
+		<file>smoketest/general/smoketest_lbs.ini</file>
+		<file>smoketest/general/smoketest_lbs.script</file>
+		<file>smoketest/general/smoketest_language.script</file>
+		<file>smoketest/general/smoketest_bitmap.ini</file>
+		<file>smoketest/general/smoketest_bitmap.script</file>
+		<file>smoketest/general/smoketest_http.ini</file>
+		<file>smoketest/general/smoketest_http.script</file>
+		<file>smoketest/sms/general/message1.txt</file>
+		<file>smoketest/general/MachineName.txt</file>
+		<file>smoketest/emailmessage/general/20KBody.txt</file>
+		<file>smoketest/emailsettings/general/popsettings_test908.txt</file>
+		<file>smoketest/10003a3f/general/openservice1a.rsc</file>
+		<file>smoketest/10003a3f/general/openservice1b.rsc</file>
+		<file>smoketest/10003a3f/general/serverapp2_reg.rsc</file>
+		<file>smoketest/10003a3f/general/serverapp3_reg.rsc</file>
+		<file>smoketest/10003a3f/general/serverapp4_reg.rsc</file>
+		<file>smoketest/10003a3f/general/serverapp6_reg.rsc</file>
+		<file>smoketest/10003a3f/general/serverapp7_reg.rsc</file>
+		<file>smoketest/10003a3f/general/serverapp_reg.rsc</file>
+		<file>smoketest/10003a3f/general/t_dataprioritysystem3_reg.rsc</file>
+		<file>smoketest/10003a3f/general/t_groupname_reg.rsc</file>
+		<file>smoketest/10003a3f/general/t_groupnamever1_reg.rsc</file>
+		<file>smoketest/10003a3f/general/t_groupnamever2_reg.rsc</file>
+		<file>smoketest/10003a3f/general/tctrlpnlapp_reg.rsc</file>
+		<file>smoketest/10003a3f/general/testtrustedpriorityapp1_reg.rsc</file>
+		<file>smoketest/10003a3f/general/testtrustedpriorityapp2_reg.rsc</file>
+		<file>smoketest/resource/general/customisedefaulticonapp_loc.rsc</file>
+		<file>smoketest/resource/general/default_app_icon.m02</file>
+		<file>smoketest/resource/general/serverapp_loc.rsc</file>
+		<file>smoketest/resource/general/t_groupname_loc.rsc</file>
+		<file>smoketest/resource/general/t_groupnamever1_loc.rsc</file>
+		<file>smoketest/resource/general/t_groupnamever2_loc.rsc</file>
+		<file>smoketest/resource/general/tstapp02.m02</file>
+		<file>smoketest/resource/general/tstapp.mbm</file>
+		<file>smoketest/resource/general/tstapp.rsc</file>
+		<file>smoketest/resource/general/tstapp_loc.r01</file>
+		<file>smoketest/resource/general/tstapp_loc.r02</file>
+		<file>smoketest/resource/general/tstapp_loc.r03</file>
+		<file>smoketest/resource/general/tstapp_loc.r04</file>
+		<file>smoketest/resource/general/tstapp_loc.r05</file>
+		<file>smoketest/resource/general/tstapp_loc.rsc</file>
+		<file>smoketest/resource/general/tstappview</file>
+		<file>smoketest/resource/general/tstappview01.m01</file>
+		<file>smoketest/resource/general/tstappview01.m02</file>
+		<file>smoketest/resource/general/tstappview02.k</file>
+		<file>smoketest/localisation/general/customisedefaulticonapp_reg.rsc</file>
+		<file>smoketest/localisation/general/testuntrustedpriorityapp1_reg.rsc</file>
+		<file>smoketest/localisation/general/testuntrustedpriorityapp2_reg.rsc</file>
+		<file>smoketest/localisation/general/tstapp_reg.rsc</file>
+		<file>smoketest/localisation/general/tstapp_embedded.rsc</file>
+		<file>smoketest/bitmap/general/uibench_16bit.mbm</file>
+		<file>smoketest/ethernet/general/delproxy.pl</file>
+		<file>smoketest/winscw_udeb/SmokeTestSecureFSclient.dll</file>
+		<file>smoketest/winscw_udeb/SmokeTestSecureFSserver.exe</file>
+		<file>smoketest/winscw_udeb/Smoketest_Agenda_Server.exe</file>
+		<file>smoketest/winscw_udeb/smoketest_apploader.exe</file>
+		<file>smoketest/winscw_udeb/Smoketest_Contacts_Server.exe</file>
+		<file>smoketest/winscw_udeb/Smoketest_Mess_Server.exe</file>
+		<file>smoketest/winscw_udeb/Smoketest_System.exe</file>
+		<file>smoketest/winscw_udeb/Smoketest_Timew_Server.exe</file>
+		<file>smoketest/winscw_udeb/SmokeTest_Utils.dll</file>
+		<file>smoketest/winscw_udeb/t_msgutilityserver.dll</file>
+		<file>smoketest/winscw_udeb/t_msgpopserver.exe</file>
+		<file>smoketest/winscw_udeb/t_msgsmtpserver.exe</file>
+		<file>smoketest/winscw_udeb/lbstestutils.dll</file>
+		<file>smoketest/winscw_udeb/lbstestclient.dll</file>
+		<file>smoketest/winscw_udeb/lbstestchannel.dll</file>
+		<file>smoketest/winscw_udeb/lbstestserver.exe</file>
+		<file>smoketest/winscw_udeb/ctlbsexeclient.exe</file>
+		<file>smoketest/winscw_udeb/lbsclienttestserver.exe</file>
+		<file>smoketest/winscw_udeb/appfwk_test_AppUi.dll</file>
+		<file>smoketest/winscw_udeb/appfwk_test_utils.dll</file>
+		<file>smoketest/winscw_udeb/TIconLoaderAndIconArrayForLeaks.dll</file>
+		<file>smoketest/winscw_udeb/TSTAPP_embedded.dll</file>
+		<file>smoketest/winscw_udeb/apparctestserver.exe</file>
+		<file>smoketest/winscw_udeb/tstapp.exe</file>
+		<file>smoketest/winscw_udeb/t_animplugin.dll</file>
+		<file>smoketest/winscw_udeb/t_graphicswservapi.exe</file>
+		<file>smoketest/winscw_udeb/twsgraphicshare.exe</file>
+		<file>smoketest/winscw_udeb/twsgraphicunshare.exe</file>
+		<file>smoketest/winscw_udeb/testhttpsuite.exe</file>
+        <file>smoketest/winscw_udeb/ProfileSmokeTestModule.dll</file>
+        <file>smoketest/general/ProfileSmokeTestModule.cfg</file>
+        <file>smoketest/winscw_udeb/TestNpdApi.dll</file>		
+		<file>smoketest/general/smoketest_notepad.cfg</file>
+		<file>smoketest/general/ui_TestNpdApi.cfg</file>
+        <file>smoketest/winscw_udeb/AppInstallSmokeTestModule.dll</file>
+        <file>smoketest/general/AppInstallSmokeTestModule.cfg</file>
+        <file>smoketest/appinstall/general/sistest_winscw.sisx</file>
+		<file>smoketest/winscw_udeb/testsdkskins.dll</file>		
+		<file>smoketest/general/smoketest_uiresources.cfg</file>
+		<file>smoketest/general/ui_testsdkskinsu.cfg</file>
+		<file>smoketest/general/ui_testsdkskinswu.cfg</file>
+		<file>smoketest/wallpaper/general/symbian_01_320x480.jpg</file>
+        <file>smoketest/winscw_udeb/InputMethodSmokeTestModule.dll</file>
+        <file>smoketest/general/InputMethodSmokeTestModule.cfg</file>
+		<file>smoketest/winscw_udeb/IMApiTest.dll</file>	
+		<file>smoketest/general/imapitest.ini</file>
+		<file>smoketest/winscw_udeb/MediaMgmtSmokeTestModule.dll</file>
+		<file>smoketest/general/UI_MediaMgmtSmokeTestModule.cfg</file>
+		<file>smoketest/general/MediaMgmtSmokeTestModule.cfg</file>
+	</files>
+</test>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Group/testtools_smoketest.history.xml	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<relnotes name="SMOKETEST">
+  <purpose>
+  </purpose>
+</relnotes>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Group/testtools_smoketest.mrp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,11 @@
+component	testtools_smoketest
+source	\sf\app\techview\buildverification\smoketest
+exports \sf\app\techview\buildverification\smoketest\Group
+# binary	\sf\app\techview\buildverification\smoketest\group	all
+
+notes_source	\component_defs\release.src
+
+#  == IPR section auto-inserted from distribution.policy files  ==
+ipr T 
+
+# == end auto-inserted section ==
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/IM/BWINS/DEMOMODULEU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,6 @@
+EXPORTS
+	?LibEntryL@@YAPAVCTestModuleBase@@XZ @ 1 NONAME ; class CTestModuleBase * __cdecl LibEntryL(void)
+	?SetRequirements@@YAHAAPAVCTestModuleParam@@AAK@Z @ 2 NONAME ; int __cdecl SetRequirements(class CTestModuleParam * &,unsigned long &)
+	?Log@CTestLogger1@@SAXV?$TRefByValue@$$CBVTDesC16@@@@ZZ @ 3 NONAME ; void CTestLogger1::Log(class TRefByValue<class TDesC16 const >, ...)
+	?Log@CTestLogger@@SAXV?$TRefByValue@$$CBVTDesC16@@@@ZZ @ 4 NONAME ; void CTestLogger::Log(class TRefByValue<class TDesC16 const >, ...)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/IM/EABI/DemomoduleU.def	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,16 @@
+EXPORTS
+	_Z9LibEntryLv @ 1 NONAME
+	_Z15SetRequirementsRP16CTestModuleParamRm @ 2 NONAME
+	_ZN11CTestLogger3LogE11TRefByValueIK7TDesC16Ez @ 3 NONAME
+	_ZN12CTestLogger13LogE11TRefByValueIK7TDesC16Ez @ 4 NONAME
+	_ZTI11CTestRunner @ 5 NONAME ; #<TI>#
+	_ZTI14CTestScheduler @ 6 NONAME ; #<TI>#
+	_ZTI19CConnectionObserver @ 7 NONAME ; #<TI>#
+	_ZTI19CIMApiClientHandler @ 8 NONAME ; #<TI>#
+	_ZTV11CTestRunner @ 9 NONAME ; #<VT>#
+	_ZTV14CTestScheduler @ 10 NONAME ; #<VT>#
+	_ZTV19CConnectionObserver @ 11 NONAME ; #<VT>#
+	_ZTV19CIMApiClientHandler @ 12 NONAME ; #<VT>#
+	_ZTI16CImpsSettingFile @ 13 NONAME ; #<TI>#
+	_ZTV16CImpsSettingFile @ 14 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/IM/group/Bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  STIF TestFramework's IMApiTest
+*
+*
+*/
+
+
+
+/*
+-------------------------------------------------------------------------------
+
+    DESCRIPTION
+
+    Build information for STIF Test Framework's IMApiTest.
+
+-------------------------------------------------------------------------------
+*/
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+../init/imapitest.ini c:/smoketest/imapitest.ini
+//../init/TestFramework.ini /epoc32/winscw/c/TestFramework/TestFramework_im.ini
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+// Example: 
+/*
+/agnmodel/inc/AGMCOMON.H
+*/
+
+PRJ_TESTMMPFILES
+// NOTE: If using ARS requirements .mmp file operation should be done under this.
+// 'abld test build'
+IMApiTest.mmp
+
+
+PRJ_MMPFILES
+// Specify the .mmp files required for building the important component
+// releasables.
+//
+// Specify "tidy" if the component you need to build doesn't need to be
+// released. Specify "ignore" if the MMP file exists but should be
+// ignored.
+// Example:
+/*
+/agnmodel/group/agnmodel.mmp
+#ifndef __WINS__
+/agnmodel/group/agsvexe.mmp
+#endif
+*/
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/IM/group/IMApiTest.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  STIF TestFramework's IMApiTest
+*
+*
+*/
+
+
+
+/*
+-------------------------------------------------------------------------------
+
+    DESCRIPTION
+
+    MMP file for STIF Test Framework's IMApiTest.
+
+-------------------------------------------------------------------------------
+*/
+#if defined(__S60_)
+    //To get the OS_LAYER_SYSTEMINCLUDE-definition
+    #include <platform_paths.hrh>
+#endif
+
+TARGET      IMApiTest.dll
+TARGETTYPE  dll
+DEFFILE     Demomodule.def
+
+CAPABILITY	ALL -TCB
+VENDORID 	0x101FB657
+SECUREID        0x102073DB
+
+LIBRARY     commdb.lib 
+LIBRARY     euser.lib
+LIBRARY     stiftestinterface.lib
+LIBRARY       ECom.lib
+LIBRARY       bafl.lib
+LIBRARY       cntmodel.lib 
+LIBRARY       flogger.lib
+LIBRARY       efsrv.lib
+LIBRARY       estor.lib       // ReadStream
+
+
+SOURCEPATH      ../src
+SOURCE          IMApiTest.cpp
+SOURCE          IMApiTestCases.cpp
+SOURCE          IMApiMTHandlers.cpp
+SOURCE          TestRunner.cpp
+SOURCE          ParserUtils.cpp
+
+
+USERINCLUDE     ../inc 
+//USERINCLUDE     ../../inc
+
+#if defined(__S60_)
+    APP_LAYER_SYSTEMINCLUDE
+#else
+   	SYSTEMINCLUDE   /epoc32/include/ecom
+#endif
+
+
+// First UID is DLL UID, Second UID is STIF Test Framework UID
+UID             0x1000008D 0x101FB3E7
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/IM/inc/IMApiMTHandlers.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,112 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Handler class
+*
+*/
+
+
+#ifndef TESTHANDLERS_H
+#define TESTHANDLERS_H
+
+
+#include <e32base.h>
+#include "imconnection.h"
+#include "imclient.h"
+#include "imerrors.h"
+#include    <flogger.h>
+// FORWARD Declarations
+
+// CLASS DECLARATIONS
+
+//*************************************************************************************
+// CIMApiClientHandler
+//*************************************************************************************
+class CIMApiClientHandler : public MImObserver, public CBase
+    {
+    public:
+        static CIMApiClientHandler* NewL( TRequestStatus& aStatus );
+        virtual ~CIMApiClientHandler();
+
+        void HandleRegisterL(
+            const TInt aErrorCode );
+
+        void HandleMessageSentL(
+            const TInt aOpCode,
+            const TInt aErrorCode );
+
+        void HandleNewPToPMessageL(
+            const TInt aErrorCode,
+            const TContactItemId  aContactId,
+            const TDesC& aUserId,
+            const TDesC& aMessageType,
+            const TDesC8& aContent );
+
+        void HandleNewPToPMessageL(
+            const TInt aErrorCode,
+            const TContactItemId  aContactId,
+            const TDesC& aUserId,
+            const TDesC& aMessageType,
+            const TDesC16& aContent );
+
+        void HandleSendErrorL(
+            const TInt aOpCode,
+            const TInt aErrorCode,
+            MImClientDetailedError* aDetailedError );
+
+//    protected:
+        void TimedOut();
+
+    private:
+        CIMApiClientHandler( TRequestStatus& aStatus );
+        void ConstructL();
+
+    private:
+        TRequestStatus&      iStatus;
+
+    };
+
+
+class CConnectionObserver : public CBase,
+            public MImConnectionObserver
+    {
+    public:
+        static CConnectionObserver* NewL( TRequestStatus& aStatus );
+        virtual ~CConnectionObserver();
+
+        void HandleConnectL( const TInt aErrorCode );
+        void HandleDisconnectL();
+
+        void HandleLoginL( const TInt aErrorCode );
+        void HandleCancelLoginL( const TInt aErrorCode );
+        void HandleLogoutL( const TInt aErrorCode );
+
+    private:
+        CConnectionObserver( TRequestStatus& aStatus );
+        void ConstructL();
+
+    private:
+        TRequestStatus&     iStatus;
+    };
+
+class CTestLogger : public CBase
+    {
+    public:
+        //IMPORT_C static void CTestLogger::Log(TRefByValue<const TDesC> aFmt,...);
+        IMPORT_C static void Log( TRefByValue<const TDesC> aFmt, ... );
+    };
+
+
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/IM/inc/IMApiTest.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,330 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This class contains all test framework related parts of
+    this test module.
+*
+*
+*/
+
+
+
+/*
+-------------------------------------------------------------------------------
+
+    DESCRIPTION
+
+    This file contains the header file of IMApiTest of
+    STIF TestFramework.
+
+-------------------------------------------------------------------------------
+*/
+#ifndef IMApiTest_H
+#define IMApiTest_H
+
+// INCLUDES
+#include "StifTestModule.h"
+#include <StifLogger.h>
+#include "IMApiMTHandlers.h"
+#include "imerrors.h"
+#include "imconnection.h"
+#include "imclient.h"
+#include "TestRunner.h"
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+// Logging path
+_LIT( KIMApiTestLogPath, "\\logs\\testframework\\IMApiTest\\" );
+// Log file
+_LIT( KIMApiTestLogFile, "IMApiTest.txt" );
+
+// Function pointer related internal definitions
+
+#define GETPTR &
+#define ENTRY(str,func) {_S(str), GETPTR func,0,0,0}
+#define FUNCENTRY(func) {_S(#func), GETPTR func,0,0,0}
+#define OOM_ENTRY(str,func,a,b,c) {_S(str), GETPTR func,a,b,c}
+#define OOM_FUNCENTRY(func,a,b,c) {_S(#func), GETPTR func,a,b,c}
+
+// FUNCTION PROTOTYPES
+// None
+
+// FORWARD DECLARATIONS
+class CIMApiTest;
+
+// DATA TYPES
+// None
+
+// A typedef for function that does the actual testing,
+// function is a type
+// TInt CIMApiTest::<NameOfFunction> ( TTestResult& aResult )
+typedef TInt ( CIMApiTest::* TestFunction )( TTestResult& );
+
+// CLASS DECLARATION
+
+/**
+*  An internal structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfoInternal
+    {
+    public:
+        const TText* iCaseName;
+        TestFunction iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+    };
+
+// CLASS DECLARATION
+
+/**
+*  A structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfo
+    {
+    public:
+        TPtrC iCaseName;
+        TestFunction iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+
+        TCaseInfo( const TText* a ) : iCaseName( ( TText* ) a )
+            {
+            };
+
+    };
+
+
+// CLASS DECLARATION
+
+/**
+*  This a IMApiTest class.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS( CIMApiTest ) : public CTestModuleBase
+    {
+public:  // Constructors and destructor
+
+
+    /**
+    * Two-phased constructor.
+    */
+    static CIMApiTest* NewL();
+
+    /**
+    * Destructor.
+    */
+    virtual ~CIMApiTest();
+
+public: // New functions
+    // None
+
+public: // Functions from base classes
+
+    /**
+    * From CTestModuleBase InitL is used to initialize the
+    *       IMApiTest. It is called once for every instance of
+    *       TestModuleIMApiTest after its creation.
+    * @since ?Series60_version
+    * @param aIniFile Initialization file for the test module (optional)
+    * @param aFirstTime Flag is true when InitL is executed for first
+    *               created instance of IMApiTest.
+    * @return Symbian OS error code
+    */
+    TInt InitL( TFileName& aIniFile, TBool aFirstTime );
+
+    /**
+    * From CTestModuleBase GetTestCasesL is used to inquiry test cases
+    *   from IMApiTest.
+    * @since ?Series60_version
+    * @param aTestCaseFile Test case file (optional)
+    * @param aTestCases  Array of TestCases returned to test framework
+    * @return Symbian OS error code
+    */
+    TInt GetTestCasesL( const TFileName& aTestCaseFile,
+                        RPointerArray<TTestCaseInfo>& aTestCases );
+
+    /**
+    * From CTestModuleBase RunTestCaseL is used to run an individual
+    *   test case.
+    * @since ?Series60_version
+    * @param aCaseNumber Test case number
+    * @param aTestCaseFile Test case file (optional)
+    * @param aResult Test case result returned to test framework (PASS/FAIL)
+    * @return Symbian OS error code (test case execution error, which is
+    *           not reported in aResult parameter as test case failure).
+    */
+    TInt RunTestCaseL( const TInt aCaseNumber,
+                       const TFileName& aTestCaseFile,
+                       TTestResult& aResult );
+
+    /**
+    * From CTestModuleBase; OOMTestQueryL is used to specify is particular
+    * test case going to be executed using OOM conditions
+    * @param aTestCaseFile Test case file (optional)
+    * @param aCaseNumber Test case number (optional)
+    * @param aFailureType OOM failure type (optional)
+    * @param aFirstMemFailure The first heap memory allocation failure value (optional)
+    * @param aLastMemFailure The last heap memory allocation failure value (optional)
+    * @return TBool
+    */
+    virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */,
+                                 const TInt /* aCaseNumber */,
+                                 TOOMFailureType& aFailureType,
+                                 TInt& /* aFirstMemFailure */,
+                                 TInt& /* aLastMemFailure */ );
+
+    /**
+    * From CTestModuleBase; OOMTestInitializeL may be used to initialize OOM
+    * test environment
+    * @param aTestCaseFile Test case file (optional)
+    * @param aCaseNumber Test case number (optional)
+    * @return None
+    */
+    virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */,
+                                     const TInt /* aCaseNumber */ );
+    /**
+    * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM
+    * test environment
+    * @param aTestCaseFile Test case file (optional)
+    * @param aCaseNumber Test case number (optional)
+    * @return None
+    */
+    virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */,
+                                   const TInt /* aCaseNumber */ );
+
+    /**
+    * From CTestModuleBase; OOMHandleWarningL
+    * @param aTestCaseFile Test case file (optional)
+    * @param aCaseNumber Test case number (optional)
+    * @param aFailNextValue FailNextValue for OOM test execution (optional)
+    * @return None
+    */
+    virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */,
+                                    const TInt /* aCaseNumber */,
+                                    TInt& /* aFailNextValue */ );
+protected:  // New functions
+    // None
+
+protected:  // Functions from base classes
+    // None
+
+private:
+
+    /**
+    * C++ default constructor.
+    */
+    CIMApiTest();
+
+    /**
+    * By default Symbian 2nd phase constructor is private.
+    */
+    void ConstructL();
+
+    // Prohibit copy constructor if not deriving from CBase.
+    // ?classname( const ?classname& );
+    // Prohibit assigment operator if not deriving from CBase.
+    // ?classname& operator=( const ?classname& );
+
+    /**
+    * Function returning test case name and pointer to test case function.
+    * @since ?Series60_version
+    * @param aCaseNumber test case number
+    * @return TCaseInfo
+    */
+    const TCaseInfo Case ( const TInt aCaseNumber ) const;
+
+    /**
+    * Printing loop test case.
+    * @since ?Series60_version
+    * @param aResult Test case result (PASS/FAIL)
+    * @return Symbian OS error code (test case execution error
+    *   that is not returned as test case result in aResult)
+    */
+    TInt CreateImClientL( TTestResult& aResult );
+	TInt InvalidLoginL( TTestResult& aResult );
+    TInt LoginL( TTestResult& aResult );
+    TInt SendPToPValidUserIDL( TTestResult& aResult );
+    TInt SendPToPValidTwoUserIDL( TTestResult& aResult );
+    TInt SendPToPValidContactL( TTestResult& aResult );
+    TInt SendPToPValidTwoContactL( TTestResult& aResult );
+    TInt SendPToPContactContentTypeL( TTestResult& aResult );
+    TInt SendPToPUserIDContentTypeL( TTestResult& aResult );
+    TInt LogoutL( TTestResult& aResult );
+    TInt CancelLoginL( TTestResult& aResult );
+
+public:     // Data
+    // None
+
+protected:  // Data
+    // None
+
+private:    // Data
+    // Pointer to test (function) to be executed
+    TestFunction iMethod;
+
+    // Pointer to logger
+    CStifLogger * iLog;
+    CTestRunner*   iRunner;
+
+    CIMApiClientHandler*     iImObserver;
+    CConnectionObserver*    iConnObserver;
+    CImConnection*          iOpenApi;
+    MImClient*              iImClient;
+    CConsoleBase*           iConsole;
+    TBool                   iRepeat;
+
+    /*TInt      iAP;
+    TBuf<50>  iUser;
+    TBuf<50>  iPwd;
+    TBuf<50>  iRecipient;
+    TBuf<50>  iRecipient1;
+    TBuf<50>  iMySapAp;
+    TBuf<50>  iClientId;
+    */
+    // ?one_line_short_description_of_data
+    //?data_declaration;
+
+    // Reserved pointer for future extension
+    //TAny* iReserved;
+
+public:     // Friend classes
+    // None
+    friend class CTestRunner;
+protected:  // Friend classes
+    // None
+
+private:    // Friend classes
+    // None
+
+    };
+
+#endif      // IMApiTest_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/IM/inc/ParserUtils.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  The class handles IMPS Setting file reading.
+*
+*/
+
+
+#include <f32file.h>
+#include <s32file.h>
+
+// FORWARD DECLARATION
+
+//**********************************
+// CImpsSettingFile
+//**********************************
+// Read key-value pairs from ASCII file
+class CImpsSettingFile: public CBase
+    {
+    public:
+        /**
+        * Constructor.
+        */
+        static CImpsSettingFile* NewL(
+            RFs& aFs );
+
+        ~CImpsSettingFile();
+
+        /**
+        * Opens a file. It is closed in destructor!
+        */
+        void OpenL( TDesC& aResFile );
+
+        /**
+        * Get the key value. Leave with KErrNotFound if not found.
+        */
+        TPtrC8 KeyValueL( const TDesC8& aKey );
+
+    private:
+        CImpsSettingFile( RFs& aFs );
+
+        void ReadRowL( TPtrC8& aKey, TPtrC8& aValue );
+    private:
+        // Data
+        RFs& iFs;
+        RFileReadStream iReader;
+        TBuf8<128> iRowBuffer;
+        TFileName iFileName;
+        TBool     iOpen;
+
+    };
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/IM/inc/TestRunner.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,183 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: The class handles the test case running.
+*
+*/
+
+
+#ifndef TESTRUNNER_H
+#define TESTRUNNER_H
+
+// INCLUDES
+#include <f32file.h>
+#include <e32test.h>
+#include "IMApiMTHandlers.h"
+#include "StifTestModule.h"
+#include <StifLogger.h>
+#include <badesca.h>
+
+#include <cntdb.h>
+#include <cntfield.h>
+#include <cntfldst.h>
+#include <cntitem.h>
+#include <commdb.h>
+
+
+
+// FORWARD DECLARATIONS
+class CTestRunner;
+
+// FORWARD DECLARATIONS
+class CErrorHandler;
+class CAccessHandler;
+class CTestIdleTimer;
+class CTestTimer;
+class CPureHandler;
+
+// ENUMS
+
+enum TWhichCase
+    {
+    InvalidLogin = 1,
+    Login,
+    SendMessageValidUserId,
+    SendMessageValidTwoUserId,
+    SendMessageValidContact,
+    SendMessageValidTwoContact,
+    SendPToPContactContentType,
+    SendPToPUserIDContentType,
+    Logout,
+    CancelLogin,
+    Finish,
+	CreateImClient
+    };
+
+
+// CONSTANTS
+const TInt KImpsMaxLen       = 100;
+const TInt KImpsMaxSapLen       = 100;
+const TInt KImpsMaxUserIdLen    =  50;
+const TInt KImpsMaxClientIdLen 	= 64;  // maximum Client ID, this is not sure!
+
+
+// CLASS DECLARATIONS
+
+
+class CTestRunner : public CActive
+    {
+    public:
+        /**
+        * Static factory method,
+        *
+        * Entry point into Symbian's 2 phase construction pattern.
+        */
+        static CTestRunner* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CTestRunner();
+
+        /**
+        * Start the execution.
+        */
+        void StartRunL( TWhichCase aCase );
+
+        CContactIdArray* GetWVContactIdsLC();
+
+        /**
+        * Symbian's 2 phase construction pattern.
+        */
+        void ConstructL( );
+
+        TInt CreateInstanceL();
+        TInt RegisterConnObserverL();
+        TInt LoadIMInterfaceL();
+        TInt IMRegisterL();
+        TInt LoginL( const TDesC& aUserID );
+        TInt SendPToPValidUserIDL();
+        TInt SendPToPValidTwoUserIDL();
+        TInt SendPToPValidContactL();
+        TInt SendPToPValidTwoContactL();
+        TInt SendPToPContactContentTypeL();
+        TInt SendPToPUserIDContentTypeL();
+        TInt QueryIMConnectionStatusL();
+        TInt CancelLoginL();
+
+        void GetDefaultAccessPoint();
+
+        void ReadIniFileL();
+        TBuf<KImpsMaxSapLen> iSapValue;
+        TBuf<KImpsMaxUserIdLen> iUserIdValue;
+        TBuf<KImpsMaxLen> iPassword;
+        TBuf<KImpsMaxClientIdLen>  iClientId;  // 1.3 Client ID Implementation
+        TBuf<KImpsMaxLen> iUserId1;
+        TBuf<KImpsMaxLen> iUserId2;
+        TInt iIAP;
+
+    public: // Functions from base classes
+
+        /**
+        * Active object completion
+        */
+        void RunL();
+        /**
+        * Active object cancellation
+        */
+        void DoCancel();
+
+    private:
+
+        // By default, prohibit copy constructor
+        CTestRunner( const CTestRunner& );
+
+        // Prohibit assigment operator
+        CTestRunner& operator= ( const CTestRunner& );
+
+        /**
+        * C-style constructor.
+        */
+        CTestRunner();
+
+        // actual runner, that is leave trapped
+        void DoRunL();
+
+    private:    // Data
+
+        TWhichCase				iCase;
+        CIMApiClientHandler*     iImObserver; //earlier code
+        //MImObserver*     iImObserver;
+        CConnectionObserver*    iConnObserver;
+        CImConnection*          iOpenApi;
+        MImClient*              iImClient;
+        CStifLogger*			iLog;
+        CContactDatabase*       iDatabase;
+    };
+
+
+
+class CTestScheduler : public CActiveScheduler
+    {
+    public:
+        void Error ( TInt aError ) const;
+    };
+
+class CTestLogger1 : public CBase
+    {
+    public:
+        //IMPORT_C static void CTestLogger::Log(TRefByValue<const TDesC> aFmt,...);
+        IMPORT_C static void Log( TRefByValue<const TDesC> aFmt, ... );
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/IM/init/TestFramework.ini	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,192 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module.
+# 	- Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation
+#		DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02
+#
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+DisableMeasurement= stifmeasurementdisablenone	# Possible values are:
+						# 'stifmeasurementdisablenone', 'stifmeasurementdisableall'
+					  	# 'stifmeasurementplugin01', 'stifmeasurementplugin02',
+					  	# 'stifmeasurementplugin03', 'stifmeasurementplugin04',
+					  	# 'stifmeasurementplugin05' or 'stifbappeaprofiler'
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+[New_Module]
+ModuleName= IMApiTest
+[End_Module]
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+#	- Will write log file in unicode format.
+#		+ YES, Log file will be written in unicode format
+#		+ NO, Log will be written as normal, not unicode, file.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#'
+#NOTE: TestEngine and TestServer logging settings cannot change here
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+#FileUnicode= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/IM/init/imapitest.ini	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,33 @@
+# IMPS Engine IM SDK API test module static settings
+# Copy this file to %epocroot%\testframework
+
+# SAP
+# Service Access Point for Presence services
+SAP=http://195.134.231.100/wv
+
+# Userid
+# UserId of the SIM registered at SAP
+Userid=test
+
+# Password
+# password for accessing SAP
+password=test
+
+# Clientid
+# no need to modify this
+clientid=apiclient@imps.org
+
+# IAP
+# If run on emulator, IAP=11
+# If run on HW, IAP is ID of Access Point using the SIM Operator's GPRS network, This can be found from "Access point" settings on Phone
+IAP=13
+
+# userid1
+# Any other userid
+userid1=bc2
+
+#userid2
+# Any other userid
+userid2=bc3
+
+# end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/IM/src/IMApiMTHandlers.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,300 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Handler class
+*
+*
+*/
+
+
+// INCLUDE FILES
+#include    <apparc.h>
+#include    <e32std.h>
+#include    "IMApiMTHandlers.h"
+#include    "TestRunner.h"
+
+/******************************************************************************
+*
+* CIMApiClientHandler
+*
+******************************************************************************/
+
+//////////////////////////////////////////////////////////////////////////
+// Handler class
+CIMApiClientHandler* CIMApiClientHandler::NewL( TRequestStatus& aStatus )
+    {
+    CIMApiClientHandler* self = new( ELeave ) CIMApiClientHandler( aStatus );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+void CIMApiClientHandler::ConstructL()
+    {
+    }
+
+CIMApiClientHandler::CIMApiClientHandler( TRequestStatus& aStatus )
+        : iStatus( aStatus )
+    {
+    }
+
+CIMApiClientHandler::~CIMApiClientHandler()
+    {
+    }
+
+
+void CIMApiClientHandler::HandleMessageSentL( const TInt aOpCode,
+                                              const TInt aErrorCode )
+    {
+    TRequestStatus* s = &iStatus;
+    CTestLogger::Log( _L( "HandleMessageSentL Passed - aErrorCode=%d" ), aErrorCode );
+
+    if ( aErrorCode == 0 || aErrorCode == KImApiErrInvalidUserId || aErrorCode == KImApiErrNotLogged || aErrorCode == KImApiErrPartialSuccess  )
+        {
+        if ( aErrorCode == 0 )
+            {
+            User::RequestComplete( s, KErrNone ); // OK
+            }
+        else if ( aErrorCode == KImApiErrInvalidUserId )
+            {
+            User::RequestComplete( s, KErrNone ); // OK
+            }
+        else if ( aErrorCode == KImApiErrPartialSuccess )
+            {
+            User::RequestComplete( s, KErrNone ); // OK
+            }
+        else
+            {
+            User::RequestComplete( s, KErrNone );
+            }
+        }
+    else
+        {
+        User::RequestComplete( s, aErrorCode ); // FAILED
+        }
+    }
+
+void CIMApiClientHandler::HandleSendErrorL( const TInt aOpCode,
+                                            const TInt aErrorCode,
+                                            MImClientDetailedError* aDetailedError )
+
+    {
+    TRequestStatus* s = &iStatus;
+    TBuf<500> buffer;
+
+    CTestLogger::Log( _L( "HandleSendErrorL - aErrorCode=%d" ), aErrorCode );
+    if ( aErrorCode == 0 || aErrorCode == KImApiErrInvalidUserId || aErrorCode == KImApiErrNotLogged || aErrorCode == KImApiErrPartialSuccess  )
+        {
+        if ( aErrorCode == 0 )
+            {
+            User::RequestComplete( s, KErrNone ); // OK
+            }
+        else if ( aErrorCode == KImApiErrInvalidUserId )
+            {
+            User::RequestComplete( s, KErrNone ); // OK
+            }
+        else if ( aErrorCode == KImApiErrPartialSuccess )
+            {
+            for ( TInt i = 0; i < aDetailedError->Count(); i++ )
+                {
+                buffer.Copy( aDetailedError->UserId( i ) );
+                }
+            User::RequestComplete( s, KErrNone ); // OK
+            }
+        else
+            {
+            User::RequestComplete( s, KErrNone );
+            }
+        }
+    else
+        {
+        User::RequestComplete( s, KErrNone ); // PASSED sad but true
+        }
+    }
+
+
+void CIMApiClientHandler::HandleNewPToPMessageL( const TInt aErrorCode,
+                                                 const TContactItemId aContactId,
+                                                 const TDesC& aUserId,
+                                                 const TDesC& aMessageType,
+                                                 const TDesC16& aContent )
+    {
+    TRequestStatus* s = &iStatus;
+    CTestLogger::Log( _L( "HandleNewPToPMessageL Passed - aErrorCode=%d" ), aErrorCode );
+
+    if ( aErrorCode == 0 )
+        {
+        User::RequestComplete( s, KErrNone );
+        }
+    else
+        {
+        User::RequestComplete( s, aErrorCode );
+        }
+    }
+
+void CIMApiClientHandler::HandleNewPToPMessageL( const TInt aErrorCode,
+                                                 const TContactItemId aContactId,
+                                                 const TDesC& aUserId,
+                                                 const TDesC& aMessageType,
+                                                 const TDesC8& aContent )
+    {
+    TRequestStatus* s = &iStatus;
+    CTestLogger::Log( _L( "HandleNewPToPMessageL Passed - aErrorCode=%d" ), aErrorCode );
+    if ( aErrorCode == 0 )
+        {
+        User::RequestComplete( s, KErrNone );
+        }
+    else
+        {
+        User::RequestComplete( s, aErrorCode );
+        }
+    }
+
+
+void CIMApiClientHandler::TimedOut()
+    {
+    TRequestStatus* s = &iStatus;
+    User::RequestComplete( s, KErrTimedOut );
+    }
+
+
+
+//////////////////////////////////////////////////////////////////////////
+
+CConnectionObserver* CConnectionObserver::NewL( TRequestStatus& aStatus )
+    {
+    CConnectionObserver* self = new( ELeave ) CConnectionObserver( aStatus );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+void CConnectionObserver::ConstructL()
+    {
+    }
+
+CConnectionObserver::CConnectionObserver( TRequestStatus& aStatus )
+        : iStatus( aStatus )
+    {
+    }
+
+CConnectionObserver::~CConnectionObserver()
+    {
+    }
+
+
+void CConnectionObserver::HandleConnectL( const TInt aErrorCode )
+    {
+    TRequestStatus* s = &iStatus;
+    CTestLogger::Log( _L( "HandleConnectL Passed - aErrorCode=%d" ), aErrorCode );
+
+    if ( aErrorCode == 0 )
+        {
+        User::RequestComplete( s, KErrNone ); // OK
+        }
+    else if ( aErrorCode == KImApiErrInvalidUserId )
+        {
+        User::RequestComplete( s, KErrNone ); // OK
+        }
+    else if ( aErrorCode == -33 )
+        {
+        User::RequestComplete( s, aErrorCode ); // FAILED
+        }
+    else if ( aErrorCode == -4154 )
+        {
+        User::RequestComplete( s, aErrorCode );   // FAILED
+        }
+    else if ( aErrorCode == -16 )
+        {
+        User::RequestComplete( s, KErrNone );  // OK IN IMAPI POINT OF WIEV
+        }
+    else if ( aErrorCode == KImApiErrLoginInProgress )
+        {
+        User::RequestComplete( s, KErrNone );  // OK IN IMAPI POINT OF WIEV
+        }
+    else
+        {
+        User::RequestComplete( s, aErrorCode );// FAILED
+        }
+    }
+
+void CConnectionObserver::HandleDisconnectL()
+    {
+    TRequestStatus* s = &iStatus;
+    CTestLogger::Log( _L( " HandleDisconnectL " ) );
+    User::RequestComplete( s, KErrNone ); //OK
+    }
+
+void CConnectionObserver::HandleLoginL( const TInt aErrorCode )
+    {
+    CTestLogger::Log( _L( "HandleLoginL Passed - aErrorCode=%d" ), aErrorCode );
+
+    TRequestStatus* s = &iStatus;
+    if ( aErrorCode == 0 )
+        {
+        User::RequestComplete( s, KErrNone );
+        }
+    else
+        {
+        User::RequestComplete( s, aErrorCode );
+        }
+    }
+
+void CConnectionObserver::HandleCancelLoginL( const TInt aErrorCode )
+    {
+    CTestLogger::Log( _L( "HandleCancelLoginL Passed - aErrorCode=%d" ), aErrorCode );
+    TRequestStatus* s = &iStatus;
+    if ( aErrorCode == 0 )
+        {
+        User::RequestComplete( s, KErrNone );
+        }
+    else
+        {
+        User::RequestComplete( s, aErrorCode );
+        }
+    }
+
+void CConnectionObserver::HandleLogoutL( const TInt aErrorCode )
+    {
+    CTestLogger::Log( _L( "HandleLogoutL Passed-  aErrorCode=%d" ), aErrorCode );
+    CActiveScheduler::Stop();
+    }
+
+
+
+//**********************************
+// CImpsClientLogger
+//**********************************
+const TInt KLogBufferLength = 256;
+_LIT( KLogDir, "impsc" );
+_LIT( KLogFile, "IMAPIHandlersLog.txt" );
+
+EXPORT_C void CTestLogger::Log( TRefByValue<const TDesC> aFmt, ... )
+    {
+    VA_LIST list;
+    VA_START( list, aFmt );
+
+    // Print to log file
+    TBuf<KLogBufferLength> buf;
+    buf.FormatList( aFmt, list );
+
+    // Write to log file
+    RFileLogger::Write( KLogDir, KLogFile, EFileLoggingModeAppend, buf );
+    }
+
+void CTestScheduler::Error( TInt /*anError */ ) const
+    {
+    CTestLogger::Log( _L( "ClientTester RunL ERROR RECEIVED" ) );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/IM/src/IMApiTest.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,547 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This class contains all test framework related parts of
+    this test module.
+*
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <Stiftestinterface.h>
+#include "IMApiTest.h"
+#include <e32math.h>
+
+// EXTERNAL DATA STRUCTURES
+// None
+
+// EXTERNAL FUNCTION PROTOTYPES
+// None
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+// LOCAL CONSTANTS AND MACROS
+// None
+
+// MODULE DATA STRUCTURES
+// None
+
+// LOCAL FUNCTION PROTOTYPES
+// None
+
+// FORWARD DECLARATIONS
+// None
+
+// ==================== LOCAL FUNCTIONS =======================================
+
+
+/*
+-------------------------------------------------------------------------------
+
+    DESCRIPTION
+
+    This file (IMApiTest.cpp) contains all test framework related parts of
+    this test module. Actual test cases are implemented in file
+    IMApiTestCases.cpp.
+
+    CIMApiTest is an example of test module implementation. This example
+    uses hard coded test cases (i.e it does not have any test case
+    configuration file).
+
+    Example uses function pointers to call test cases. This provides an easy
+    method to add new test cases.
+
+    See function Cases in file IMApiTestCases.cpp for instructions how to
+    add new test cases. It is not necessary to modify this file when adding
+    new test cases.
+
+    To take this module into use, add following lines to test framework
+    initialisation file:
+
+# Demo module
+[New_Module]
+ModuleName= IMApiTest
+[End_Module]
+
+-------------------------------------------------------------------------------
+*/
+
+// ================= MEMBER FUNCTIONS =========================================
+
+/*
+-------------------------------------------------------------------------------
+
+    Class: CIMApiTest
+
+    Method: CIMApiTest
+
+    Description: C++ default constructor can NOT contain any code, that
+    might leave.
+
+    Parameters: None
+
+    Return Values: None
+
+    Errors/Exceptions: None
+
+    Status: Approved
+
+-------------------------------------------------------------------------------
+*/
+CIMApiTest::CIMApiTest()
+    {
+    }
+
+/*
+-------------------------------------------------------------------------------
+
+    Class: CIMApiTest
+
+    Method: ConstructL
+
+    Description: Symbian 2nd phase constructor that can leave.
+
+    Note: If OOM test case uses STIF Logger, then STIF Logger must be created
+    with static buffer size parameter (aStaticBufferSize). Otherwise Logger
+    allocates memory from heap and therefore causes error situations with OOM
+    testing. For more information about STIF Logger construction, see STIF
+    Users Guide.
+
+    Parameters: None
+
+    Return Values: None
+
+    Errors/Exceptions: None
+
+    Status: Approved
+
+-------------------------------------------------------------------------------
+*/
+void CIMApiTest::ConstructL()
+    {
+    // Constructing static buffer size logger, needed with OOM testing because
+    // normally logger allocates memory from heap!
+    iLog = CStifLogger::NewL( KIMApiTestLogPath,
+                              KIMApiTestLogFile,
+                              CStifLogger::ETxt,
+                              CStifLogger::EFile,
+                              ETrue,
+                              ETrue,
+                              ETrue,
+                              EFalse,
+                              ETrue,
+                              EFalse,
+                              100 );
+
+    // Sample how to use logging
+    _LIT( KLogInfo, "IMApiTest logging starts!" );
+    iLog->Log( KLogInfo );
+    iRunner = CTestRunner::NewL();
+    }
+
+/*
+-------------------------------------------------------------------------------
+
+    Class: CIMApiTest
+
+    Method: NewL
+
+    Description: Two-phased constructor. Constructs new CIMApiTest
+    instance and returns pointer to it.
+
+    Parameters:    None
+
+    Return Values: CIMApiTest*: new object.
+
+    Errors/Exceptions: Leaves if memory allocation fails or ConstructL leaves.
+
+    Status: Approved
+
+-------------------------------------------------------------------------------
+*/
+CIMApiTest* CIMApiTest::NewL()
+    {
+    CIMApiTest* self = new ( ELeave ) CIMApiTest;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+/*
+-------------------------------------------------------------------------------
+
+    Class: CIMApiTest
+
+    Method: ~CIMApiTest
+
+    Description: Destructor.
+
+    Parameters:    None
+
+    Return Values: None
+
+    Errors/Exceptions: None
+
+    Status: Approved
+
+-------------------------------------------------------------------------------
+*/
+CIMApiTest::~CIMApiTest()
+    {
+    delete iLog;
+    if ( iRunner )
+        delete iRunner;
+    }
+
+/*
+-------------------------------------------------------------------------------
+    Class: CIMApiTest
+
+    Method: InitL
+
+    Description: Method for test case initialization
+
+    Parameters: None
+
+    Return Values: None
+
+    Errors/Exceptions: None
+
+    Status: Approved
+-------------------------------------------------------------------------------
+*/
+TInt CIMApiTest::InitL( TFileName& /*aIniFile*/,
+                        TBool /*aFirstTime*/ )
+    {
+    return KErrNone;
+
+    }
+
+/*
+-------------------------------------------------------------------------------
+
+    Class: CIMApiTest
+
+    Method: GetTestCases
+
+    Description: GetTestCases is used to inquire test cases
+    from the test module. Because this test module has hard coded test cases
+    (i.e cases are not read from file), paramter aConfigFile is not used.
+
+    This function loops through all cases defined in Cases() function and
+    adds corresponding items to aTestCases array.
+
+    Parameters: const TFileName&  : in: Configuration file name. Not used
+                RPointerArray<TTestCaseInfo>& aTestCases: out:
+                      Array of TestCases.
+
+    Return Values: KErrNone: No error
+
+    Errors/Exceptions: Function leaves if any memory allocation operation fails
+
+    Status: Proposal
+
+-------------------------------------------------------------------------------
+*/
+TInt CIMApiTest::GetTestCasesL( const TFileName& /*aConfig*/,
+                                RPointerArray<TTestCaseInfo>& aTestCases )
+    {
+    // Loop through all test cases and create new
+    // TTestCaseInfo items and append items to aTestCase array
+    for ( TInt i = 0; Case( i ).iMethod != NULL; i++ )
+        {
+        // Allocate new TTestCaseInfo from heap for a testcase definition.
+        TTestCaseInfo* newCase = new( ELeave ) TTestCaseInfo();
+
+        // PushL TTestCaseInfo to CleanupStack.
+        CleanupStack::PushL( newCase );
+
+        // Set number for the testcase.
+        // When the testcase is run, this comes as a parameter to RunTestCaseL.
+        newCase->iCaseNumber = i;
+
+        // Set title for the test case. This is shown in UI to user.
+        newCase->iTitle.Copy( Case( i ).iCaseName );
+
+        // Append TTestCaseInfo to the testcase array. After appended
+        // successfully the TTestCaseInfo object is owned (and freed)
+        // by the TestServer.
+        User::LeaveIfError( aTestCases.Append ( newCase ) );
+
+        // Pop TTestCaseInfo from the CleanupStack.
+        CleanupStack::Pop( newCase );
+        }
+
+    return KErrNone;
+
+    }
+
+/*
+-------------------------------------------------------------------------------
+
+    Class: CIMApiTest
+
+    Method: RunTestCase
+
+    Description: Run a specified testcase.
+
+    Function runs a test case specified by test case number. Test case file
+    parameter is not used.
+
+    If case number is valid, this function runs a test case returned by
+    function Cases().
+
+    Parameters: const TInt aCaseNumber: in: Testcase number
+                const TFileName& : in: Configuration file name. Not used
+                TTestResult& aResult: out: Testcase result
+
+    Return Values: KErrNone: Testcase ran.
+                   KErrNotFound: Unknown testcase
+
+    Errors/Exceptions: None
+
+    Status: Proposal
+
+-------------------------------------------------------------------------------
+*/
+TInt CIMApiTest::RunTestCaseL( const TInt aCaseNumber,
+                               const TFileName& /* aConfig */,
+                               TTestResult& aResult )
+    {
+    // Return value
+    TInt execStatus = KErrNone;
+
+    // Get the pointer to test case function
+    TCaseInfo tmp = Case ( aCaseNumber );
+
+    TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksRequests );
+    TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles );
+
+    _LIT( KLogInfo, "Starting testcase [%S]" );
+    iLog->Log( KLogInfo, &tmp.iCaseName );
+
+    // Check that case number was valid
+    if ( tmp.iMethod != NULL )
+        {
+        // Valid case was found, call it via function pointer
+        iMethod = tmp.iMethod;
+        execStatus  = ( this->*iMethod )( aResult );
+        }
+    else
+        {
+        // Valid case was not found, return error.
+        execStatus = KErrNotFound;
+        }
+
+    // Return case execution status (not the result of the case execution)
+    return execStatus;
+
+    }
+
+/*
+-------------------------------------------------------------------------------
+
+    Class: CIMApiTest
+
+    Method: OOMTestQueryL
+
+    Description: Checks test case information for OOM execution.
+
+    Return Values: TBool
+
+    Errors/Exceptions: None
+
+    Status: Proposal
+
+-------------------------------------------------------------------------------
+*/
+TBool CIMApiTest::OOMTestQueryL( const TFileName& /* aTestCaseFile */,
+                                 const TInt aCaseNumber,
+                                 TOOMFailureType& /* aFailureType */,
+                                 TInt& aFirstMemFailure,
+                                 TInt& aLastMemFailure )
+    {
+    _LIT( KLogInfo, "CIMApiTest::OOMTestQueryL" );
+    iLog->Log( KLogInfo );
+
+    aFirstMemFailure = Case( aCaseNumber ).iFirstMemoryAllocation;
+    aLastMemFailure = Case( aCaseNumber ).iLastMemoryAllocation;
+
+    return Case( aCaseNumber ).iIsOOMTest;
+    }
+
+/*
+-------------------------------------------------------------------------------
+
+    Class: CIMApiTest
+
+    Method: OOMTestInitializeL
+
+    Description: Used to perform the test environment setup for a particular
+    OOM test case. Test Modules may use the initialization file to read
+    parameters for Test Module initialization but they can also have their own
+    configure file or some other routine to initialize themselves.
+
+    NOTE: User may add implementation for OOM test environment initialization.
+    Usually no implementation is required.
+
+    Return Values: None
+
+    Errors/Exceptions: None
+
+    Status: Proposal
+
+-------------------------------------------------------------------------------
+*/
+void CIMApiTest::OOMTestInitializeL( const TFileName& /* aTestCaseFile */,
+                                     const TInt /* aCaseNumber */ )
+    {
+    _LIT( KLogInfo, "CIMApiTest::OOMTestInitializeL" );
+    iLog->Log( KLogInfo );
+
+    }
+
+/*
+-------------------------------------------------------------------------------
+
+    Class: CIMApiTest
+
+    Method: OOMHandleWarningL
+
+    Description: Used in OOM testing to provide a way to the derived TestModule
+    to handle warnings related to non-leaving or TRAPped allocations.
+
+    In some cases the allocation should be skipped, either due to problems in
+    the OS code or components used by the code being tested, or even inside the
+    tested components which are implemented this way on purpose (by design), so
+    it is important to give the tester a way to bypass allocation failures.
+
+    NOTE: User may add implementation for OOM test warning handling. Usually no
+    implementation is required.
+
+    Return Values: None
+
+    Errors/Exceptions: None
+
+    Status: Proposal
+
+-------------------------------------------------------------------------------
+*/
+void CIMApiTest::OOMHandleWarningL( const TFileName& /* aTestCaseFile */,
+                                    const TInt /* aCaseNumber */,
+                                    TInt& /* aFailNextValue */ )
+    {
+    _LIT( KLogInfo, "CIMApiTest::OOMHandleWarningL" );
+    iLog->Log( KLogInfo );
+
+    }
+
+/*
+-------------------------------------------------------------------------------
+
+    Class: CIMApiTest
+
+    Method: OOMTestFinalizeL
+
+    Description: Used to perform the test environment cleanup for a particular OOM
+    test case.
+
+    NOTE: User may add implementation for OOM test environment finalization.
+    Usually no implementation is required.
+
+    Return Values: None
+
+    Errors/Exceptions: None
+
+    Status: Proposal
+
+-------------------------------------------------------------------------------
+*/
+void CIMApiTest::OOMTestFinalizeL( const TFileName& /* aTestCaseFile */,
+                                   const TInt /* aCaseNumber */ )
+    {
+    _LIT( KLogInfo, "CIMApiTest::OOMTestFinalizeL" );
+    iLog->Log( KLogInfo );
+
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point
+// Returns: CTestModuleBase*: Pointer to Test Module object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CTestModuleBase* LibEntryL()
+    {
+    return CIMApiTest::NewL();
+
+    }
+
+// -----------------------------------------------------------------------------
+// SetRequirements handles test module parameters(implements evolution
+// version 1 for test module's heap and stack sizes configuring).
+// Returns: TInt: Symbian error code.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt SetRequirements( CTestModuleParam*& /*aTestModuleParam*/,
+                               TUint32& /*aParameterValid*/ )
+    {
+
+    /* --------------------------------- NOTE ---------------------------------
+    USER PANICS occurs in test thread creation when:
+    1) "The panic occurs when the value of the stack size is negative."
+    2) "The panic occurs if the minimum heap size specified is less
+       than KMinHeapSize".
+       KMinHeapSize: "Functions that require a new heap to be allocated will
+       either panic, or will reset the required heap size to this value if
+       a smaller heap size is specified".
+    3) "The panic occurs if the minimum heap size specified is greater than
+       the maximum size to which the heap can grow".
+    Other:
+    1) Make sure that your hardware or Symbian OS is supporting given sizes.
+       e.g. Hardware might support only sizes that are divisible by four.
+    ------------------------------- NOTE end ------------------------------- */
+
+    // Normally STIF uses default heap and stack sizes for test thread, see:
+    // KTestThreadMinHeap, KTestThreadMinHeap and KStackSize.
+    // If needed heap and stack sizes can be configured here by user. Remove
+    // comments and define sizes.
+
+    /*
+        aParameterValid = KStifTestModuleParameterChanged;
+
+        CTestModuleParamVer01* param = CTestModuleParamVer01::NewL();
+        // Stack size
+        param->iTestThreadStackSize= 16384; // 16K stack
+        // Heap sizes
+        param->iTestThreadMinHeap = 4096;   // 4K heap min
+        param->iTestThreadMaxHeap = 1048576;// 1M heap max
+
+        aTestModuleParam = param;
+    */
+    return KErrNone;
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/IM/src/IMApiTestcases.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,297 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This module contains the implementation of CIMApiTest class
+    member functions that does the actual tests.
+*
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <e32math.h>
+#include "IMApiTest.h"
+
+// EXTERNAL DATA STRUCTURES
+// None
+
+// EXTERNAL FUNCTION PROTOTYPES
+// None
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+// LOCAL CONSTANTS AND MACROS
+// None
+
+// MODULE DATA STRUCTURES
+// None
+
+// LOCAL FUNCTION PROTOTYPES
+// None
+
+// FORWARD DECLARATIONS
+// None
+
+// ==================== LOCAL FUNCTIONS =======================================
+
+/*
+-------------------------------------------------------------------------------
+
+    DESCRIPTION
+
+    This module contains the implementation of CIMApiTest class
+    member functions that does the actual tests.
+
+-------------------------------------------------------------------------------
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+/*
+-------------------------------------------------------------------------------
+
+    Class: CIMApiTest
+
+    Method: Case
+
+    Description: Returns a test case by number.
+
+    This function contains an array of all available test cases
+    i.e pair of case name and test function. If case specified by parameter
+    aCaseNumber is found from array, then that item is returned.
+
+    The reason for this rather complicated function is to specify all the
+    test cases only in one place. It is not necessary to understand how
+    function pointers to class member functions works when adding new test
+    cases. See function body for instructions how to add new test case.
+
+    Parameters:    const TInt aCaseNumber :in:      Test case number
+
+    Return Values: const TCaseInfo Struct containing case name & function
+
+    Errors/Exceptions: None
+
+    Status: Proposal
+
+-------------------------------------------------------------------------------
+*/
+const TCaseInfo CIMApiTest::Case (
+    const TInt aCaseNumber ) const
+    {
+
+    /*
+    * To add new test cases, implement new test case function and add new
+    * line to KCases array specify the name of the case and the function
+    * doing the test case
+    * In practice, do following
+    *
+    * 1) Make copy of existing test case function and change its name
+    *    and functionality. Note that the function must be added to
+    *    OOMHard.cpp file and to OOMHard.h
+    *    header file.
+    *
+    * 2) Add entry to following KCases array either by using:
+    *
+    * 2.1: FUNCENTRY or ENTRY macro
+    * ENTRY macro takes two parameters: test case name and test case
+    * function name.
+    *
+    * FUNCENTRY macro takes only test case function name as a parameter and
+    * uses that as a test case name and test case function name.
+    *
+    * Or
+    *
+    * 2.2: OOM_FUNCENTRY or OOM_ENTRY macro. Note that these macros are used
+    * only with OOM (Out-Of-Memory) testing!
+    *
+    * OOM_ENTRY macro takes five parameters: test case name, test case
+    * function name, TBool which specifies is method supposed to be run using
+    * OOM conditions, TInt value for first heap memory allocation failure and
+    * TInt value for last heap memory allocation failure.
+    *
+    * OOM_FUNCENTRY macro takes test case function name as a parameter and uses
+    * that as a test case name, TBool which specifies is method supposed to be
+    * run using OOM conditions, TInt value for first heap memory allocation
+    * failure and TInt value for last heap memory allocation failure.
+    */
+
+    static TCaseInfoInternal const KCases[] =
+        {
+        // To add new test cases, add new items to this array
+
+        // NOTE: When compiled to GCCE, there must be Classname::
+        // declaration in front of the method name, e.g.
+        // CIMApiTest::PrintTest. Otherwise the compiler
+        // gives errors.
+
+		ENTRY( "Create IM Client", CIMApiTest::CreateImClientL ),
+//        ENTRY( "Invalid Login", CIMApiTest::InvalidLoginL ),
+//        ENTRY( "Login", CIMApiTest::LoginL ),
+//        ENTRY( "Send P To P ValidUserID", CIMApiTest::SendPToPValidUserIDL ),
+//        ENTRY( "Send P To P ValidTvoUserID", CIMApiTest::SendPToPValidTwoUserIDL ),
+//        ENTRY( "Send P To P ValidContact", CIMApiTest::SendPToPValidContactL ),
+//        ENTRY( "Send P To P ValidTwoContact", CIMApiTest::SendPToPValidTwoContactL ),
+//        ENTRY( "Send P To P ContactContentType", CIMApiTest::SendPToPContactContentTypeL ),
+//        ENTRY( "Send P To P UserIDContentType", CIMApiTest::SendPToPUserIDContentTypeL ),
+//        ENTRY( "Logout", CIMApiTest::LogoutL ),
+//        ENTRY( "Cancel Login", CIMApiTest::CancelLoginL ),
+        };
+
+    // Verify that case number is valid
+    if ( ( TUint ) aCaseNumber >= sizeof( KCases ) /
+         sizeof( TCaseInfoInternal ) )
+        {
+
+        // Invalid case, construct empty object
+        TCaseInfo null( ( const TText* ) L"" );
+        null.iMethod = NULL;
+        null.iIsOOMTest = EFalse;
+        null.iFirstMemoryAllocation = 0;
+        null.iLastMemoryAllocation = 0;
+        return null;
+
+        }
+
+    // Construct TCaseInfo object and return it
+    TCaseInfo tmp ( KCases[ aCaseNumber ].iCaseName );
+    tmp.iMethod = KCases[ aCaseNumber ].iMethod;
+    tmp.iIsOOMTest = KCases[ aCaseNumber ].iIsOOMTest;
+    tmp.iFirstMemoryAllocation = KCases[ aCaseNumber ].iFirstMemoryAllocation;
+    tmp.iLastMemoryAllocation = KCases[ aCaseNumber ].iLastMemoryAllocation;
+    return tmp;
+
+    }
+
+TInt CIMApiTest::CreateImClientL( TTestResult& aResult )
+    {
+    iRunner->StartRunL( CreateImClient );
+    // Sets test case result and description(Maximum size is KStifMaxResultDes)
+    _LIT( KDescription, "CreateImClientL Passed" );
+    aResult.SetResult( KErrNone, KDescription );
+    // Case was executed
+    return KErrNone;
+
+    }
+	
+TInt CIMApiTest::InvalidLoginL( TTestResult& aResult )
+    {
+    iRunner->StartRunL( InvalidLogin );
+    // Sets test case result and description(Maximum size is KStifMaxResultDes)
+    _LIT( KDescription, "LoginL Passed" );
+    aResult.SetResult( KErrNone, KDescription );
+    // Case was executed
+    return KErrNone;
+
+    }
+
+TInt CIMApiTest::LoginL( TTestResult& aResult )
+    {
+    iRunner->StartRunL( Login );
+    // Sets test case result and description(Maximum size is KStifMaxResultDes)
+    _LIT( KDescription, "LoginL Passed" );
+    aResult.SetResult( KErrNone, KDescription );
+    // Case was executed
+    return KErrNone;
+    }
+
+
+TInt CIMApiTest::SendPToPValidUserIDL( TTestResult& aResult )
+    {
+    iRunner->StartRunL( SendMessageValidUserId );
+    // Sets test case result and description(Maximum size is KStifMaxResultDes)
+    _LIT( KDescription, "SendPToPValidUserIDL Passed" );
+    aResult.SetResult( KErrNone, KDescription );
+    // Case was executed
+    return KErrNone;
+    }
+
+
+TInt CIMApiTest::SendPToPValidTwoUserIDL( TTestResult& aResult )
+    {
+    iRunner->StartRunL( SendMessageValidTwoUserId );
+    // Sets test case result and description(Maximum size is KStifMaxResultDes)
+    _LIT( KDescription, "SendPToPValidTwoUserIDL Passed" );
+    aResult.SetResult( KErrNone, KDescription );
+    // Case was executed
+    return KErrNone;
+    }
+
+
+TInt CIMApiTest::SendPToPValidContactL( TTestResult& aResult )
+    {
+    iRunner->StartRunL( SendMessageValidContact );
+    // Sets test case result and description(Maximum size is KStifMaxResultDes)
+    _LIT( KDescription, "SendPToPValidContactL Passed" );
+    aResult.SetResult( KErrNone, KDescription );
+    // Case was executed
+    return KErrNone;
+    }
+
+
+TInt CIMApiTest::SendPToPValidTwoContactL( TTestResult& aResult )
+    {
+    iRunner->StartRunL( SendMessageValidTwoContact );
+    // Sets test case result and description(Maximum size is KStifMaxResultDes)
+    _LIT( KDescription, "SendPToPValidTwoContactL Passed" );
+    aResult.SetResult( KErrNone, KDescription );
+    // Case was executed
+    return KErrNone;
+    }
+
+TInt CIMApiTest::SendPToPContactContentTypeL( TTestResult& aResult )
+    {
+    iRunner->StartRunL( SendPToPContactContentType );
+    // Sets test case result and description(Maximum size is KStifMaxResultDes)
+    _LIT( KDescription, "SendPToPContactContentTypeL Passed" );
+    aResult.SetResult( KErrNone, KDescription );
+    // Case was executed
+    return KErrNone;
+    }
+
+TInt CIMApiTest::SendPToPUserIDContentTypeL( TTestResult& aResult )
+    {
+    iRunner->StartRunL( SendPToPUserIDContentType );
+    // Sets test case result and description(Maximum size is KStifMaxResultDes)
+    _LIT( KDescription, "SendPToPUserIDContentTypeL Passed" );
+    aResult.SetResult( KErrNone, KDescription );
+    // Case was executed
+    return KErrNone;
+    }
+
+TInt CIMApiTest::LogoutL( TTestResult& aResult )
+    {
+    iRunner->StartRunL( Logout );
+    // Sets test case result and description(Maximum size is KStifMaxResultDes)
+    _LIT( KDescription, "LogoutL Passed" );
+    aResult.SetResult( KErrNone, KDescription );
+    // Case was executed
+    return KErrNone;
+    }
+
+
+TInt CIMApiTest::CancelLoginL( TTestResult& aResult )
+    {
+    iRunner->StartRunL( CancelLogin );
+    // Sets test case result and description(Maximum size is KStifMaxResultDes)
+    _LIT( KDescription, "CancelLoginL Passed" );
+    aResult.SetResult( KErrNone, KDescription );
+    // Case was executed
+    return KErrNone;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/IM/src/ParserUtils.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: The class handles IMPS Setting file reading.
+*
+*
+*/
+
+
+// INCLUDE FILES
+#include    <e32std.h>
+#ifdef _DEBUG
+#include    <flogger.h>
+#endif
+#include "ParserUtils.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+
+
+//**********************************
+// CImpsSettingFile
+//**********************************
+
+CImpsSettingFile* CImpsSettingFile::NewL(
+    RFs& aFs )
+    {
+    CImpsSettingFile* self = new ( ELeave ) CImpsSettingFile( aFs );
+    return self;
+    }
+
+CImpsSettingFile::~CImpsSettingFile()
+    {
+    if ( iOpen )
+        {
+        iReader.Close();
+        }
+    iOpen = EFalse;
+    }
+
+CImpsSettingFile::CImpsSettingFile( RFs& aFs )
+        : iFs( aFs ),
+        iOpen( EFalse )
+    {
+
+    }
+
+void CImpsSettingFile::OpenL( TDesC& aResFile )
+    {
+    // open a file
+    iFileName = aResFile;
+
+    TInt myError = iReader.Open( iFs,
+                                 iFileName,
+                                 EFileShareReadersOnly );
+
+    User::LeaveIfError( myError );
+    iOpen = ETrue;
+
+    }
+
+TPtrC8 CImpsSettingFile::KeyValueL( const TDesC8& aKey )
+    {
+
+    TPtrC8 myKey;
+    TPtrC8 myValue;
+    TBool getIt( EFalse );
+    TInt err = 0;
+
+    // Reset the reader
+    OpenL( iFileName );
+
+    // Start to search
+    while ( !getIt )
+        {
+        TRAP ( err, ReadRowL( myKey, myValue ) );
+        if ( err != KErrNone )
+            {
+            User::Leave( KErrNotFound );
+            }
+        if ( !myKey.CompareF( aKey ) )
+            {
+            return myValue;
+            }
+        }
+    return TPtrC8();
+    }
+
+void CImpsSettingFile::ReadRowL( TPtrC8& aKey, TPtrC8& aValue )
+    {
+    // READ ONE ROW
+    TChar delim( 10 );
+    iReader.ReadL( iRowBuffer, delim );
+    TInt length = iRowBuffer.Length();
+    if ( length > 2 )
+        {
+        // DROP CR+LF FROM THE END OF LINE
+        iRowBuffer.Delete( length - 2, 2 );
+
+        TInt pos = 0;
+        pos = iRowBuffer.Find( _L8( "=" ) );
+        if ( pos > 0 )
+            {
+            aKey.Set( iRowBuffer.Left( pos ) );
+            // Cut off separator
+            aValue.Set( iRowBuffer.Mid( pos + 1 ) );
+            }
+        }
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/IM/src/TestRunner.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,701 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: The class handles the test case running.
+*
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    <e32std.h>
+#include    <flogger.h>
+#include 	"imerrors.h"
+#include    <CNTDEF.H>
+#include    "IMApiMTHandlers.h"
+#include    "TestRunner.h"
+#include 	"IMApiTest.h"
+#include 	"ParserUtils.h"
+
+_LIT( KImpsIMApiMTIniFile, "c:\\smoketest\\imapitest.ini" );
+_LIT8( KImpsSAP, "SAP" );
+_LIT8( KImpsUserID, "Userid" );
+_LIT8( KImpsPassword, "password" );
+_LIT8( KImpsClientid, "clientid" );
+_LIT8( KImpsIAP, "IAP" );
+_LIT8( KImpsUserid1, "userid1" );
+_LIT8( KImpsUserid2, "userid2" );
+
+void SetupSchedulerL()
+    {
+    // Create a scheduler
+    CTestScheduler* scheduler = new( ELeave )CTestScheduler;
+    CleanupStack::PushL( scheduler );
+    CActiveScheduler::Install( scheduler );
+    CleanupStack::Pop(); // scheduler
+    }
+
+void CTestRunner::ReadIniFileL()
+    {
+    RFs myFs;
+    TInt err = 0;
+    TUint32 myTime = 0;
+    TLex lex;
+    err = myFs.Connect();
+    //CleanupClosePushL( myFs );
+    CImpsSettingFile* configFile = CImpsSettingFile::NewL( myFs );
+    CleanupStack::PushL( configFile );
+    TFileName fileN( KImpsIMApiMTIniFile );
+    // Open config file
+    TRAP( err, configFile->OpenL( fileN ) );
+    User::LeaveIfError( err );
+
+    TBuf<KImpsMaxSapLen> myPtr;
+    TRAP( err, myPtr.Copy( configFile->KeyValueL( KImpsSAP ) ) );
+    if ( !err )
+        {
+        iSapValue.Copy( myPtr );
+        }
+    TRAP( err, myPtr.Copy( configFile->KeyValueL( KImpsUserID ) ) );
+    if ( !err )
+        {
+        iUserIdValue.Copy( myPtr );
+        }
+    TRAP( err, myPtr.Copy( configFile->KeyValueL( KImpsPassword ) ) );
+    if ( !err )
+        {
+        iPassword.Copy( myPtr );
+        }
+    TRAP( err, myPtr.Copy( configFile->KeyValueL( KImpsClientid ) ) );
+    if ( !err )
+        {
+        iClientId.Copy( myPtr );
+        }
+    TRAP( err, myPtr.Copy( configFile->KeyValueL( KImpsIAP ) ) );
+    if ( !err )
+        {
+        lex.Assign( myPtr );
+        lex.Val( myTime, EDecimal );
+        iIAP = ( TInt ) myTime;
+        }
+    TRAP( err, myPtr.Copy( configFile->KeyValueL( KImpsUserid1 ) ) );
+    if ( !err )
+        {
+        iUserId1.Copy( myPtr );
+        }
+    TRAP( err, myPtr.Copy( configFile->KeyValueL( KImpsUserid2 ) ) );
+    if ( !err )
+        {
+        iUserId2.Copy( myPtr );
+        }
+    CleanupStack::PopAndDestroy( 1 );  // configFile
+    }
+
+
+
+CTestRunner* CTestRunner::NewL()
+    {
+    CTestRunner* self = new ( ELeave ) CTestRunner();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop(); //self
+    return self;
+    }
+
+void CTestRunner::ConstructL()
+    {
+    SetupSchedulerL();
+    iCase = Login;
+    iDatabase = CContactDatabase::OpenL();
+    iImObserver = CIMApiClientHandler::NewL( iStatus );
+    iConnObserver = CConnectionObserver::NewL( iStatus );
+    ReadIniFileL();
+
+    CActiveScheduler::Add( this );
+    }
+
+CTestRunner::~CTestRunner()
+    {
+
+    if ( iOpenApi != NULL )
+        {
+        iOpenApi->UnregisterObserver();
+        }
+    CTestLogger1::Log( _L( "Test Case Number #16" ) );
+    CTestLogger1::Log( _L( "CImConnection::UnregisterObserver" ) );
+    if ( iOpenApi != NULL )
+        {
+        delete iOpenApi;
+        iOpenApi = NULL;
+        }
+    if ( iImClient != NULL )
+        {
+        delete iImClient;
+        iImClient = NULL;
+        }
+    if ( iConnObserver != NULL )
+        {
+        delete iConnObserver;
+        iConnObserver = NULL;
+        }
+    if ( iImObserver != NULL )
+        {
+        delete iImObserver;
+        iImObserver = NULL;
+        }
+    if ( iDatabase != NULL )
+        {
+        delete iDatabase;
+        iDatabase = NULL;
+        }
+
+    }
+
+
+
+void CTestRunner::DoCancel()
+    {
+    // Complete the request with error
+    TRequestStatus* s = &iStatus;
+    User::RequestComplete( s, KErrCancel );
+    }
+
+
+CTestRunner::CTestRunner()
+        : CActive( 0 )
+    {
+    }
+
+
+void CTestRunner::StartRunL( TWhichCase aCase )
+    {
+    iCase = aCase;
+    SetActive();
+    TRequestStatus *s = &iStatus;
+    User::RequestComplete( s, KErrNone );
+    CActiveScheduler::Start();
+    }
+
+void CTestRunner::RunL()
+    {
+    TInt errxx = 0;
+    TRAP( errxx, DoRunL() );
+    if ( errxx < 0 )
+        {
+        CActiveScheduler::Stop();
+        }
+    }
+
+
+void CTestRunner::DoRunL()
+    {
+    if ( iCase >= Finish )
+        {
+        Cancel();
+        CActiveScheduler::Stop();
+        return;
+        }
+
+    if ( iStatus != KErrNone )
+        {
+        Cancel();
+        CActiveScheduler::Stop();
+        return;
+        }
+    switch ( iCase )
+        {
+        case CreateImClient:
+            {
+            CreateInstanceL();			//NewL - instantiate the object
+            RegisterConnObserverL();	//RegisterObserverL - register the observer methods
+            LoadIMInterfaceL();			//CreateImClientL - get the IM interface
+            }
+        break;
+        case InvalidLogin:
+            {
+            CreateInstanceL();
+            RegisterConnObserverL();
+            LoadIMInterfaceL();
+            IMRegisterL();
+            LoginL( _L( "InvalidUser" ) );
+            }
+        break;
+        case Login:
+            {
+            CreateInstanceL();
+            RegisterConnObserverL();
+            LoadIMInterfaceL();
+            IMRegisterL();
+            LoginL( iUserIdValue );
+            }
+        break;
+        case SendMessageValidUserId:
+            {
+            SendPToPValidUserIDL();
+            }
+        break;
+        case SendMessageValidTwoUserId:
+            {
+            SendPToPValidTwoUserIDL();
+            }
+        break;
+        case SendMessageValidContact:
+            {
+            SendPToPValidContactL();
+            }
+        break;
+        case SendMessageValidTwoContact:
+            {
+            SendPToPValidTwoContactL();
+            }
+        break;
+        case SendPToPContactContentType:
+            {
+            SendPToPContactContentTypeL();
+            }
+        break;
+        case SendPToPUserIDContentType:
+            {
+            SendPToPUserIDContentTypeL();
+            }
+        break;
+
+        case Logout:
+            {
+            QueryIMConnectionStatusL();
+            }
+        break;
+        case CancelLogin:
+            {
+            CancelLoginL();
+            }
+        break;
+        }
+
+    iCase = Finish;
+
+    return;
+    }
+
+
+CContactIdArray* CTestRunner::GetWVContactIdsLC( )
+    {
+    _LIT( KWVStart, "" );
+    // Specify in which fields search should be performed
+    CContactItemFieldDef* fieldToSearchIn = new ( ELeave ) CContactItemFieldDef();
+    CleanupStack::PushL( fieldToSearchIn );
+    fieldToSearchIn->AppendL( KUidContactFieldVCardMapWV );
+
+    // search in contact database
+    CContactIdArray *array = iDatabase->FindLC( KWVStart, fieldToSearchIn );
+    CleanupStack::Pop(); //>> array
+    CleanupStack::PopAndDestroy(); //>> fieldToSearchIn
+    CleanupStack::PushL( array );
+
+    return array;
+    }
+
+
+
+TInt CTestRunner::RegisterConnObserverL()
+    {
+    CTestLogger1::Log( _L( "Test Case Number #2" ) );
+    TRAPD( err, iOpenApi->RegisterObserverL( iConnObserver ) );
+    // Catch errors
+    if ( err == KImApiGeneralError ) // -30133
+        {
+        iStatus = err; // Failed
+        CTestLogger1::Log( _L( "CImConnection::RegisterObserverL - err=%d" ), err );
+        }
+    else
+        {
+        iStatus = KErrNone; //OK
+        CTestLogger1::Log( _L( "CImConnection::RegisterObserverL - err=%d" ), err );
+        }
+    }
+
+
+TInt CTestRunner::CreateInstanceL()
+    {
+    CTestLogger1::Log( _L( "Test Case Number #1" ) );
+    iOpenApi = CImConnection::NewL( iClientId );
+    CTestLogger1::Log( _L( "CImConnection::NewL" ) );
+    return KErrNone; //OK
+    }
+
+
+TInt CTestRunner::LoadIMInterfaceL()
+    {
+    CTestLogger1::Log( _L( "Test Case Number #3" ) );
+    TRAPD( err, iImClient = iOpenApi->CreateImClientL() );
+    // Catch errrors
+    if ( err == 0 )
+        {
+        iStatus = KErrNone; // OK
+        CTestLogger1::Log( _L( "CreateImClientL - err=%d" ), err );
+        }
+    else
+        {
+        iStatus = err; // Failed
+        CTestLogger1::Log( _L( "CreateImClientL - err=%d" ), err );
+        }
+    }
+
+
+TInt CTestRunner::IMRegisterL()
+    {
+    CTestLogger1::Log( _L( "Test Case Number #4" ) );
+    TRAPD( err, iImClient -> RegisterObserverL( iImObserver ) );
+    // Catch errors
+    if ( err == KImApiGeneralError ) //- 30133
+        {
+        iStatus = err; // Failes
+        CTestLogger1::Log( _L( "MImClient::RegisterObserverL - err=%d" ), err );
+        }
+    else
+        {
+        iStatus = KErrNone; //OK
+        CTestLogger1::Log( _L( "MImClient::RegisterObserverL - err=%d" ), err );
+        }
+    }
+
+TInt CTestRunner::LoginL( const TDesC& aUserID )
+    {
+    if ( aUserID.Compare( _L( "InvalidUser" ) ) )
+        CTestLogger1::Log( _L( "Test Case Number #6" ) );
+    else
+        {
+        CTestLogger1::Log( _L( "Invalid Login" ) );
+        CTestLogger1::Log( _L( "Test Case Number #5" ) );
+        }
+
+    if ( iSapValue.Size() == 0 || iPassword.Size() == 0 || aUserID.Size() == 0 )
+        {
+        iStatus = KErrNone;
+        CTestLogger1::Log( _L( "Invalid login parametres" ) );
+        Cancel();
+        CActiveScheduler::Stop();
+        return KErrNone;
+        }
+
+    TRAPD( err, iOpenApi->LoginL( iSapValue, aUserID, iPassword, iIAP ) );
+    // Catch errors
+    if ( err )
+        {
+        iStatus = err; // Failes
+        CTestLogger1::Log( _L( "LoginL - err=%d" ), err );
+        return err;
+        }
+    else
+        {
+        iStatus = KRequestPending;
+        CTestLogger1::Log( _L( "LoginL - err=%d" ), err );
+        SetActive();
+        return KErrNone;
+        }
+    }
+
+TInt CTestRunner::SendPToPValidUserIDL()
+    {
+    CTestLogger1::Log( _L( "Test Case Number #7" ) );
+    if ( iUserId1.Length() == 0 )
+        {
+        CTestLogger1::Log( _L( "SendPToPMessageL(ValidUserId) UserID1 is NULL " ) );
+        iStatus = KErrNone;
+        Cancel();
+        CActiveScheduler::Stop();
+        return KErrNone;
+        }
+    CDesCArray* userIds = new( ELeave ) CDesCArrayFlat( 1 ); // Create user list
+    CleanupStack::PushL( userIds );
+    userIds->AppendL( iUserId1 ); // Add one user
+
+    _LIT( KContentType, "text/plain" ); // Message type
+    _LIT( KMessage, "5. Hello In One Time Valid UserId" ); // Message
+    TInt OpId = 0;
+    // Send message
+    TRAPD ( err, OpId = iImClient->SendPToPMessageL( iUserId1, KMessage ) );
+    // Catch errors
+    if ( err == KImApiErrInvalidUserId && OpId == 0 ) // KImApiErrInvalidUserId
+        {
+        CTestLogger1::Log( _L( "SendPToPMessageL(ValidUserId) - err=%d" ), err );
+        CleanupStack::PopAndDestroy(); // userIds
+        iStatus = err;
+        return err;
+        }
+    else if ( err == KImApiGeneralError && OpId == 0 ) // General ImApi errror
+        {
+        CTestLogger1::Log( _L( "SendPToPMessageL(ValidUserId) - err=%d" ), err );
+        CleanupStack::PopAndDestroy(); // userIds
+        iStatus = err;
+        return err;
+        }
+    else
+        {
+        CTestLogger1::Log( _L( "SendPToPMessageL(ValidUserId) - err=%d" ), err );
+        CleanupStack::PopAndDestroy(); // userIds
+        iStatus = KRequestPending;
+        SetActive();
+        return KErrNone;
+        }
+    }
+
+
+TInt CTestRunner::SendPToPValidTwoUserIDL()
+    {
+    CTestLogger1::Log( _L( "Test Case Number #8" ) );
+    CDesCArray* userIds = new( ELeave ) CDesCArrayFlat( 2 ); // Create new user list
+    CleanupStack::PushL( userIds );
+    userIds->AppendL( iUserId1 ); // Add user 0 nok3
+    userIds->AppendL( iUserId2 ); // Add user 1 nok5
+
+    _LIT( KContentType, "text/plain" );
+    _LIT( KMessage, "6. Hello In Two Times Valid UserId" );
+    TInt OpId = 0;
+    // Send Message
+    TRAPD ( err, OpId = iImClient->SendPToPMessageL( *userIds, KMessage ) );
+    // Catch errors
+    if ( err == KImApiErrInvalidUserId && OpId == 0 ) // KImApiErrInvalidUserId
+        {
+        CTestLogger1::Log( _L( "SendPToPMessageL(ValidTwoUserIds) - err=%d" ), err );
+        CleanupStack::PopAndDestroy(); // userIds
+        iStatus = err;
+        return err;
+        }
+    else if ( err == KImApiGeneralError && OpId == 0 ) // General ImApi errror
+        {
+        CTestLogger1::Log( _L( "SendPToPMessageL(ValidTwoUserIds) - err=%d" ), err );
+        CleanupStack::PopAndDestroy(); // userIds
+        iStatus = err;
+        return err;
+        }
+    else
+        {
+        CTestLogger1::Log( _L( "SendPToPMessageL(ValidTwoUserIds) - err=%d" ), err );
+        CleanupStack::PopAndDestroy(); // userIds
+        iStatus = KRequestPending;
+        SetActive();
+        return KErrNone;
+        }
+    }
+
+
+TInt CTestRunner::SendPToPValidContactL()
+    {
+    CTestLogger1::Log( _L( "Test Case Number #9" ) );
+    CContactIdArray* contactIDArray = GetWVContactIdsLC();
+    if ( contactIDArray->Count() == 0 )
+        {
+        CTestLogger1::Log( _L( "Can not find WvContact ID" ) );
+        CleanupStack::PopAndDestroy();
+        iStatus = KErrNone;
+        Cancel();
+        CActiveScheduler::Stop();
+        return KErrNone;
+        }
+    TInt OpId = 0;
+    // Be sure that two contact is real WV contact
+    // Select first contact
+    TContactItemId& OmaContact = ( *contactIDArray )[0];
+
+    //Add first contact
+    CContactIdArray* myContactIds = CContactIdArray::NewL();
+    myContactIds->AddL( OmaContact );
+
+    // Check that we have only one contact
+    TInt nuberofcontacts = myContactIds->Count();
+    //CTestLogger1::Log( _L("nuberofcontacts =%d"), nuberofcontacts );
+    //Send message to myContacts
+    TRAPD( err, OpId = iImClient->SendPToPMessageL( OmaContact/*myContactIds*/, _L( "12. Hello One Valid Contact" ) ) );
+    // Just checking return value
+    if ( err == KImApiErrInvalidContactId && OpId == 0 ) // KImApiErrInvalidContactId and OperationId is 0
+        {
+        CTestLogger1::Log( _L( "SendPToPMessageL(ValidContact) - err=%d" ), err );
+        CleanupStack::PopAndDestroy();
+        iStatus = KErrNone;
+        Cancel();
+        CActiveScheduler::Stop();
+        return err;
+        }
+    else if ( err == KImApiGeneralError && OpId == 0 ) // General ImApi error
+        {
+        CTestLogger1::Log( _L( "SendPToPMessageL(ValidContact) - err=%d" ), err );
+        CleanupStack::PopAndDestroy(); // userIds
+        iStatus = err;
+        return err;
+        }
+    else
+        {
+        CTestLogger1::Log( _L( "SendPToPMessageL(ValidContact) - err=%d" ), err );
+        CleanupStack::PopAndDestroy();
+        iStatus = KRequestPending;
+        SetActive();
+        return KErrNone; //OpId;
+        }
+    }
+
+
+TInt CTestRunner::SendPToPValidTwoContactL()
+    {
+    CTestLogger1::Log( _L( "Test Case Number #10" ) );
+    CContactIdArray* contactIDArray = GetWVContactIdsLC();
+    TInt OpId = 0;
+    // Be sure that two contact is real WV contact
+    //Is there three contacts
+    TInt nuberofcontacts = contactIDArray->Count();
+    if ( contactIDArray->Count() == 0 )
+        {
+        CTestLogger1::Log( _L( "Can not find WvContact ID" ) );
+        CleanupStack::PopAndDestroy();
+        iStatus = KErrNone;
+        Cancel();
+        CActiveScheduler::Stop();
+        return KErrNone;
+        }
+    // Remove third contact
+    // Never commit the reset
+    if ( contactIDArray->Count() >= 3 )
+        {
+        contactIDArray->Remove( 2 );
+        }
+
+
+    // Check if Remove is OK
+    TRAPD( err1, OpId = iImClient->SendPToPMessageL( *contactIDArray, _L( "text/plain" ), _L8( "Hello All" ) ) );
+
+    //Send message
+    TRAPD( err, OpId = iImClient->SendPToPMessageL( *contactIDArray, _L( "13. Hello In Two Times Valid Contact" ) ) );
+
+    // Just checking return value
+    if ( err == KImApiErrInvalidContactId && OpId == 0 ) // KImApiErrInvalidContactId and OperationId is 0
+        {
+        CTestLogger1::Log( _L( "SendPToPMessageL(ValidTwoContact) - err=%d" ), err );
+        CleanupStack::PopAndDestroy();
+        iStatus = KErrNone;
+        Cancel();
+        CActiveScheduler::Stop();
+        return err;
+        }
+    else if ( err == KImApiGeneralError && OpId == 0 ) // General ImApi error
+        {
+        CTestLogger1::Log( _L( "SendPToPMessageL(ValidTwoContact) - err=%d" ), err );
+        CleanupStack::PopAndDestroy(); // userIds
+        iStatus = err;
+        return err;
+        }
+    else
+        {
+        CTestLogger1::Log( _L( "SendPToPMessageL(ValidTwoContact) - err=%d" ), err );
+        CleanupStack::PopAndDestroy();
+        iStatus = KRequestPending;
+        SetActive();
+        return KErrNone; // OpId;
+        }
+    }
+
+TInt CTestRunner::SendPToPContactContentTypeL()
+    {
+    //This SDK API is not supported. Test case is added to increase the code coverage
+    CTestLogger1::Log( _L( "Test Case Number #11" ) );
+    CTestLogger1::Log( _L( "SendPToPContactContentTypeL" ) );
+    TInt OpId = 0;
+    CContactIdArray* contactIDArray = GetWVContactIdsLC();
+    if ( contactIDArray->Count() == 0 )
+        {
+        CTestLogger1::Log( _L( "Can not find WvContact ID" ) );
+        CleanupStack::PopAndDestroy();
+        iStatus = KErrNone;
+        Cancel();
+        CActiveScheduler::Stop();
+        return KErrNone;
+        }
+    TRAPD( err, OpId = iImClient->SendPToPMessageL( *contactIDArray, _L( "text/plain" ), _L8( "Hello All" ) ) );
+    CleanupStack::PopAndDestroy(); // userIds
+    iStatus = err;
+    Cancel();
+    CActiveScheduler::Stop();
+    return err;
+    }
+
+TInt CTestRunner::SendPToPUserIDContentTypeL()
+    {
+    //This SDK API is not supported. Test case is added to increase the code coverage
+    CTestLogger1::Log( _L( "Test Case Number #12" ) );
+    CTestLogger1::Log( _L( "SendPToPUserIDContentTypeL" ) );
+    TInt OpId = 0;
+    CDesCArray* userIds = new( ELeave ) CDesCArrayFlat( 2 );
+    CleanupStack::PushL( userIds );
+
+    TRAPD( err, OpId = iImClient->SendPToPMessageL( *userIds, _L( "text/plain" ), _L8( "Hello All" ) ) );
+    CleanupStack::PopAndDestroy(); // userIds
+    iStatus = err;
+    Cancel();
+    CActiveScheduler::Stop();
+    return err;
+    }
+
+
+TInt CTestRunner::QueryIMConnectionStatusL()
+    {
+    CTestLogger1::Log( _L( "Test Case Number #13" ) );
+    TInt ret = iOpenApi->ImConnectionStatus();
+    // Check returnvalue
+    if ( ret == 0 ) // iLoggedIn
+        {
+        CTestLogger1::Log( _L( "LogoutL" ) );
+        iOpenApi->LogoutL();
+        iStatus = KErrNone;
+        return 0;
+        }
+    else // 1
+        {
+        iStatus = KErrNone;
+        Cancel();
+        CActiveScheduler::Stop();
+        return ret;
+        }
+    }
+
+
+TInt CTestRunner::CancelLoginL()
+    {
+    CTestLogger1::Log( _L( "Test Case Number #14" ) );
+    LoginL( iUserIdValue );
+    TRAPD ( err, iOpenApi->CancelLoginL() );
+    CTestLogger1::Log( _L( "CancelLoginL - err=%d" ), err );
+    iImClient->UnregisterObserver();
+    CTestLogger1::Log( _L( "Test Case Number #15" ) );
+    CTestLogger1::Log( _L( "CImClient::UnregisterObserver" ) );
+    }
+
+//**********************************
+// Logger
+//**********************************
+const TInt KLogBufferLength = 256;
+_LIT( KLogDir, "impsc" );
+_LIT( KLogFile, "IMAPITestCaseLog.txt" );
+
+EXPORT_C void CTestLogger1::Log( TRefByValue<const TDesC> aFmt, ... )
+    {
+    VA_LIST list;
+    VA_START( list, aFmt );
+
+    // Print to log file
+    TBuf<KLogBufferLength> buf;
+    buf.FormatList( aFmt, list );
+
+    // Write to log file
+    RFileLogger::Write( KLogDir, KLogFile, EFileLoggingModeAppend, buf );
+    }
+
Binary file ReadMe.doc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmokeTest.pm	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,433 @@
+# Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of the License "Symbian Foundation License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+# SmokeTestSuite.pm 
+# The SmokeTestSuite package contains subroutines that are needed to build a 
+# testdriver test suite.
+# This script was born on 18/04/2005
+# 
+#
+
+#!/usr/bin/perl -w
+package SmokeTest;
+use SmokeTestROM;
+use SmokeTestSuite;
+use FindBin;
+use lib "$FindBin::Bin\\..\\..\\..\\..\\os\\buildtools\\bldsystemtools\\commonbldutils\\GenResult\\";
+use FileRead; #Need to include a Findbin::path
+use strict;
+
+#
+# Global Variables
+#
+our $BuildDir = $ENV{'BuildDir'}; # usually M:
+our $serverpool = $ENV{'SmokeTestServerPool'};
+our $buildNo = $ENV{'BuildShortName'}; # Eg. 9.1
+# The Client is run from the dir where SmokeTestClient.pl is located
+# This is to ensure that any ROMs and test packages created are stored there.
+our $sourceDir = "$BuildDir\\src\\common\\testtools";
+our $TestSuite = "SmokeTest";
+our $SmokeTestDir;
+our $NandDir;
+our $TestDriverLocation   = "\\epoc32\\tools\\TDEP";   # location for TD zips
+our $TestDriverDrive = "M:";
+our $TestDriverCmd = "$TestDriverDrive\\testdriver\\testdriver.cmd";
+our $TestDriverXML;
+
+# Publish details
+our $PublishServer = $ENV{'PublishLocation'};
+our $ProductType   = $ENV{'Type'};
+our $BuildNum      = $ENV{'BuildNumber'};
+our $LogsDir       = $ENV{'LogsDir'};
+
+# Epocwind.out
+my $tempDirLocation = $ENV{'TEMP'};
+
+#
+# CheckVars: ensures that the essential environment vars and directories exist
+#
+sub CheckVars
+{
+	print "\n** Settings **\n";
+	print "Build Drive                = $BuildDir\n";
+	print "Smoke Test Server Pool     = $serverpool\n";
+	print "Build Product              = $buildNo\n";
+	print "TestDriver Zip Location    = $TestDriverLocation\n";
+	print "TestDriver XML Location    = $TestDriverXML\n";
+	print "TestDriver Source Location = $sourceDir\n";
+	print "TestDriver Drive           = $TestDriverDrive\n";
+	print "SmokeTest working directory= $SmokeTestDir\n";
+	print "NAND build directory       = $NandDir\n";
+	
+	print "\n** Publishing Information **\n";
+	
+	print "Publish server = $PublishServer\n";
+	print "Product Type   = $ProductType\n";
+	print "Build Number   = $BuildNum\n";
+	
+	DieLog("CheckVars: \"Build Directory\" not defined") if !defined $BuildDir;
+	DieLog("CheckVars: \"Smoke Test Server Pool\" not defined") if !defined $serverpool;
+	DieLog("CheckVars: \"Build Product\" not defined") if !defined $buildNo;
+	DieLog("CheckVars: \"Publish server\" not defined") if !defined $PublishServer;
+	DieLog("CheckVars: \"Product Type\" not defined") if !defined $ProductType;
+	DieLog("CheckVars: \"Build Number\" not defined") if !defined $BuildNum;
+	DieLog("CheckVars: Directory \"SmokeTest working directory\" does not exist") if ! -e $SmokeTestDir;
+	DieLog("CheckVars: Directory \"TestDriver Zip Location\" does not exist") if ! -e $TestDriverLocation;
+}
+
+sub main
+{
+	print "\n\n*** START OF SMOKE TEST ***\n\n";
+
+	PrintDateTime();
+	
+	my ($iSourceDir,       $iTestSuite,   $iProduct, $iServerPool, $iProductType,
+	    $iPublishLocation, $iBuildNumber, $iXML,     $iUnzip,      $iBuildDrive, $iTDDrive) = @_;
+	
+	$TestSuite       = $iTestSuite           if defined $iTestSuite;
+	$BuildDir        = $iBuildDrive          if defined $iBuildDrive;
+	$sourceDir       = $BuildDir.$iSourceDir if defined $iSourceDir;
+	$buildNo         = $iProduct             if defined $iProduct;
+	$serverpool      = $iServerPool          if defined $iServerPool;
+	$ProductType     = $iProductType         if defined $iProductType;
+	$PublishServer   = $iPublishLocation     if defined $iPublishLocation;
+	$BuildNum        = $iBuildNumber         if defined $iBuildNumber;
+	$TestDriverDrive = $iTDDrive             if defined $iTDDrive;
+	
+	$SmokeTestDir    = "$sourceDir\\$TestSuite";
+	if (defined $iXML)
+	{
+		$TestDriverXML = $iXML;
+	}
+	else
+	{
+		$TestDriverXML = $SmokeTestDir."\\xml";
+	}
+	$NandDir = "$BuildDir\\src\\cedar\\generic\\base\\e32\\rombuild";
+	
+	CheckVars();
+	
+	# change dir to Smoketest dir
+	chdir "$SmokeTestDir" or DieLog("Can't cd to $SmokeTestDir");
+	
+	# unzip latest version of TD
+	if (defined $iUnzip)
+	{
+		unpackTestDriver2();
+	}
+	
+	# configure TD
+	configureTestDriver2();
+	
+	#
+	# Copy the correct configuration.cfg file
+	# But such source only exists for these products: 8.0a, 8.0b, 8.1a, 8.1b, 9.0, 9.1
+	#
+	print "\n#\n# Copy the correct configuration.cfg file\n#\n";
+	ExecCommand("COPY /Y $SmokeTestDir\\Group\\$buildNo\\configuration.cfg $SmokeTestDir\\Group\\configuration.cfg");
+	
+	#Read in hash of smoketests to be run for each product.
+	my ($iCfgFileLocation) = "$FindBin::Bin\\..\\..\\..\\..\\os\\buildtools\\bldsystemtools\\commonbldutils\\GenResult";
+	
+	#Read in the smoketest list from a cfg file
+	my $text = &FileRead::file_read ("$iCfgFileLocation\\Product.cfg");
+	#Search for an entry matching (At the beginning of line there should be 1 or more alphanumberic chars
+	#Followed by a "."(optional to allow codenames) followed by more alphanumberic chars followed by 0 or more spaces then an = then 0
+	#or more spaces then any amount of chars till the end of the line.
+	#8.1b = EMULATOR_WINSCW ARM4_LUBBOCK ARMV5_LUBBOCK
+	my %iProducts = $text =~ /^\s*(\w+\.?\w+)\s*=\s*(.+)$/mg ;
+	
+	#Get the list of platforms to be smoketested for the product.
+	#Need to turn the hash value into an array using split
+	my @iPlatforms = split (/ /,$iProducts{$buildNo});
+	#Build and Execute Test package for each platform as read from configuration file and create and zip rom.
+	ProcessPlatforms (@iPlatforms);
+	
+	#
+	# Build Test Package for ROMs
+	#
+	if ($buildNo eq '8.1a' || $buildNo eq '8.1b')
+	{
+		&SmokeTestSuite::BuildAndPackage("ARM4");
+	}
+	
+	if ($buildNo ne '8.1a')
+	{
+		&SmokeTestSuite::BuildAndPackage("ARMv5");
+	}
+	
+	#
+	# Find out which server to use
+	#
+	print "\n#\n# Find out which server to use\n#\n";
+	ProcessPlatformsforSmoketest(@iPlatforms);
+	
+	#
+	# End of Smoke Test
+	#
+	print "\n\n*** END OF SMOKE TEST ***\n\n";
+}
+	
+#
+# DieLog: Exits script and inserts a Remark in the build log, which will be picked up by htmlscanlog
+#
+sub DieLog
+{
+	die "\nREMARK: $_[0]\n $!\n\n\n";
+}
+
+
+#
+# Build and publish based on entries in the Product.cfg file
+#
+sub ProcessPlatforms 
+{
+
+my $i = 0;
+my @temp;
+my @iPlatforms = @_;
+
+foreach my $platform (@iPlatforms)
+ {  
+  undef @temp;
+  @temp = split (/_/,$iPlatforms[$i]);
+  $i++;
+  
+  if( $temp[0] eq "EMULATOR")
+  {
+	&SmokeTestSuite::BuildAndPublish("$temp[1]");
+	CheckPlatsecErrors("$temp[1]");
+  }
+  else
+  {
+		
+	if(3 == scalar(@temp)) # there are 3 arguments, so this will be a NAND ROM
+	{
+		if((lc($temp[1]) eq "h4hrp") && (lc($temp[2]) eq "nand\(dp\)" )) # H4HRP Demand Paging ROM options is -D_NAND2
+		{
+			&SmokeTestROM::CreateAndZipROM("$temp[0]", "$temp[1]", "pagedrom", "PlatSec", "$buildNo", "-D_NAND2" );
+		}
+		elsif((lc($temp[1]) eq "h4hrp") && (lc($temp[2]) eq "nand" )) # H4 options is -D_NAND2
+		{
+			&SmokeTestROM::CreateAndZipROM("$temp[0]", "$temp[1]", "-DRVCT", "PlatSec", "$buildNo", "-D_NAND2");
+		}
+		elsif(lc($temp[1]) eq "h2") # H2 options is -D_NAND# H2 option is NAND2 due to CR 0844 (Both H2 and H4 use -D_NAND2)
+                {
+			&SmokeTestROM::CreateAndZipROM("$temp[0]", "$temp[1]", "-DRVCT", "PlatSec", "$buildNo", "-D_NAND2");		
+		}
+		else	# Bad option entered
+		{
+			die "SmokeTest::ProcessPlatforms error: invalid board type entered: $temp[1]. Check that Product.cfg is correct.\n";
+		}		
+	}
+	else # This is the NOR ROM.
+	{
+		&SmokeTestROM::CreateAndZipROM("$temp[0]", "$temp[1]", "-DRVCT", "PlatSec", "$buildNo");
+	}
+  }
+  
+ }
+
+}
+
+#
+# Build and publish based on entries in the Product.cfg file
+#
+sub ProcessPlatformsforSmoketest
+{
+
+my $i = 0;
+my @temp;
+my @iPlatforms = @_;
+
+foreach my $platform (@iPlatforms)
+ {  
+    undef @temp;
+    @temp = split (/_/,$iPlatforms[$i]);
+    $i++;
+    if( $temp[0] eq "EMULATOR")
+    {
+        next;
+    }
+	my $mServ = &SmokeTestSuite::PollServers("$temp[1]");
+	unless (defined $mServ)
+    {
+        next;
+    }
+	if(3 == scalar(@temp))
+	{
+		if(lc($temp[2]) eq "nand\(dp\)" ) 
+		{
+		    &SmokeTestSuite::RunRemote("$temp[0]", "$temp[1]", $mServ, "NAND\(DP\)\\");
+		}
+        elsif(lc($temp[2]) eq "nand") 
+	    {
+		    &SmokeTestSuite::RunRemote("$temp[0]", "$temp[1]", $mServ, "NAND\\");
+	    }
+	}
+	else
+	{
+		&SmokeTestSuite::RunRemote("$temp[0]", "$temp[1]", $mServ);
+	}
+ }
+}
+ 
+#
+# Check for platsec errors - checks the epocwind.out on build machine
+#
+sub CheckPlatsecErrors
+{
+	print "\n";
+	print "#\n# Check for platsec errors\n#\n";
+	print "\n";
+	PrintDateTime();
+	
+	# open epocwind.out and parse for both errors and warnings
+	open EPOCWIND, "$tempDirLocation\\epocwind.out" or print "\nERROR: Cannot open EPOCWIND.OUT\n";
+	my @epocWind = <EPOCWIND>;
+	close EPOCWIND;
+	
+	foreach my $tempEW (@epocWind)
+	{
+		if ($tempEW =~ m/(\*PlatSec\* ERROR)(.*)/i)
+		{
+			print "\nERROR: $_[0] - $1$2";
+		}
+		elsif ($tempEW =~ m/(\*PlatSec\* WARNING)(.*)/i)
+		{
+			print "\nWARNING: $_[0] - $1$2";
+		}
+	}
+}
+
+#
+# Take TestDriver and unpack into a given location.
+#
+sub unpackTestDriver2()
+{
+	#
+	# Unzip TestDriver
+	#
+	print "\n#\n# Unzip TestDriver\n#\n";
+	PrintDateTime();
+	
+	# first remove the "old" version of test driver
+	print "\n";
+	ExecCommand("RMDIR $TestDriverDrive\\testdriver\\ /Q /S");
+	
+	# now unzip the latest version of testdriver which has been synced down
+	ExecCommand("%EPOCROOT%epoc32\\tools\\unzip.exe $TestDriverLocation\\TestDriver2.zip -d $TestDriverDrive\\testdriver\\");
+	
+	# now copy the latest version of testdriver_new.cmd which has been obtained
+	ExecCommand("COPY \\\\builds01\\devbuilds\\buildteam\\testdriverv2\\testdriver_new.cmd  $TestDriverCmd");
+	
+	# now copy the latest version of logging.properties which has been obtained
+	ExecCommand("COPY \\\\builds01\\devbuilds\\buildteam\\testdriverv2\\logging.properties  $TestDriverDrive\\testdriver\\");
+	
+    # 11-08-08 - additional steps required for SITK1.2 version of TD2
+    ExecCommand("MKDIR $TestDriverDrive\\testdriver\\eclipse\\links\\");
+
+    ExecCommand("COPY \\\\builds01\\devbuilds\\buildteam\\testdriverv2\\testdriver.link $TestDriverDrive\\testdriver\\eclipse\\links\\");
+	
+	#
+	# Unzip JRE v1.5
+	#
+	print "\n";
+	print "#\n# Unzip JRE 1.5 required by TestDriver v2\n#\n";
+	print "\n";
+	
+	ExecCommand("%EPOCROOT%epoc32\\tools\\unzip.exe \\\\builds01\\devbuilds\\BuildPCs\\Software\\JDK1.5.0_13\\jre1.5.zip -d $TestDriverDrive\\testdriver\\");
+
+}
+
+sub configureTestDriver2()
+{
+	#
+	# Configure TestDriver
+	#
+	print "\n";
+	print "#\n# Configure TestDriver\n#\n";
+	print "\n";
+	my $localtimes = localtime;
+	PrintDateTime();
+	
+	ExecCommand("$TestDriverDrive\\testdriver\\testdriver.cmd config -e $BuildDir\\
+								-x $TestDriverXML
+								-l $TestDriverDrive\\TestDriver\\Results
+								--source $sourceDir
+								-s smoketest
+								-r $TestDriverDrive\\TestDriver\\Repos
+								-c $TestDriverDrive\\TestDriver\\Results");
+
+	ExecCommand("$TestDriverDrive\\testdriver\\testdriver.cmd config --commdb overwrite");
+	ExecCommand("$TestDriverDrive\\testdriver\\testdriver.cmd config --bldclean off");
+
+	# platsec for > 9.x only
+	if ($buildNo ne "8.1a" && $buildNo ne "8.1b")
+	{
+		ExecCommand("$TestDriverDrive\\testdriver\\testdriver.cmd config -p ON");
+	}
+	
+	# Setup commdb for WINSCW smoketest
+	print "\n*** Setup commdb for WINSCW to use WinTAP ***\n";
+	
+	# export smoketest_commdb.xml to a place that ced.exe can see it
+	ExecCommand("copy $SmokeTestDir\\smoketest_commdb.xml $BuildDir\\epoc32\\WINSCW\\c\\");
+	ExecCommand("$BuildDir\\epoc32\\release\\WINSCW\\udeb\\ced.exe c:\\smoketest_commdb.xml");
+	
+	print "\n*** Confirm TestDriver Config ***\n";
+	ExecCommand("$TestDriverDrive\\testdriver\\testdriver.cmd config");
+	print "\n";
+}
+
+# ExecCommand
+#
+# Execute a system command, having first echoed it. Display and return the output of the command.
+#
+# Input: Command string (without final newline)
+#
+# Output: Command output (including STDERR) to STDOUT
+#
+# Return: Command output (including STDERR)
+#
+sub ExecCommand
+{
+    my $iCmd = shift;
+    print "\n================================================================\n";
+    print "Command: $iCmd\n";
+    print   "----------------------------------------------------------------\n";
+    my $iRet = `$iCmd 2>&1`;
+    chomp $iRet;
+    print "Return:  $iRet\n";
+    print   "================================================================\n";
+    return $iRet;
+}
+
+# PrintDateTime
+#
+# Print to STDOUT, Current Date and Time
+#
+# Input: none
+#
+# Output: text to STDOUT
+#
+sub PrintDateTime
+{
+    my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
+    #### my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) = gmtime(time);
+    $year += 1900;
+    $mon += 1;
+	printf "\n*** Current Time: %04d/%02d/%02d %02d:%02d:%02d ***\n", $year,$mon,$mday,$hour,$min,$sec;
+}
+
+1;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmokeTestClient.pl	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,80 @@
+# Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of the License "Symbian Foundation License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+# This script was born on 07/10/2004
+# 
+#
+
+#!/usr/bin/perl -w
+use strict;
+use SmokeTest;
+use Getopt::Long;
+
+# Process the commandline
+my ($iSourceDir, $iTestSuite, $iProduct, $iServerPool, $iProductType, $iPublishLocation, $iBuildNumber, $iXML, $iUnzip, $iBuildDrive, $iTDDrive) = ProcessCommandLine();
+
+&SmokeTest::main($iSourceDir, $iTestSuite, $iProduct, $iServerPool, $iProductType, $iPublishLocation, $iBuildNumber, $iXML, $iUnzip, $iBuildDrive, $iTDDrive);
+
+# ProcessCommandLine
+#
+# Description
+# This function processes the commandline
+
+sub ProcessCommandLine
+{
+  my ($iHelp);
+  
+  GetOptions('h' => \$iHelp, 'src=s' => \$iSourceDir, 'pool=s' => \$iServerPool, 'product=s' => \$iProduct, 'suite=s' => \$iTestSuite, 'type=s' => \$iProductType, 'publish=s' => \$iPublishLocation, 'build=s' => \$iBuildNumber, , 'xml=s' => \$iXML, 'unziptd' => \$iUnzip, 'builddrive=s' => \$iBuildDrive, 'tddrive=s' => \$iTDDrive);
+
+  if (($iHelp) || (!defined $iSourceDir) || (!defined $iTestSuite) || (!defined $iProduct) || (!defined $iBuildDrive))
+  {
+    Usage();
+  }
+  
+  return ($iSourceDir, $iTestSuite, $iProduct, $iServerPool, $iProductType, $iPublishLocation, $iBuildNumber, $iXML, $iUnzip, $iBuildDrive, $iTDDrive);
+}
+
+# Usage
+#
+# Output Usage Information.
+#
+
+sub Usage 
+{
+  print <<USAGE_EOF;
+
+  Usage: SmokeTestClient.pl [switches]
+
+  [Switches]
+  --suite Test Driver test suite (e.g. SmokeTest)
+  --src source code directory (e.g .\\src\\common\\testtools)
+  		[NOTE: The test suite directory should be located in this directory]
+  --product product being tested (e.g. 9.1)
+  --builddrive The drive where the source and epoc32 is (e.g. M:)
+  
+  [Optional]
+  -h help
+  --pool hash separated smoketest server pool (e.g. lon-sysbuild05\#lon-sysbuild06)
+  --type type of build, either Master or Symbian_OS_v8.1
+  --publish Publish server for the smoke test results (e.g. \\\\builds01)
+  --build Build Number (e.g. 03555_Symbian_OS_v9.1)
+  --xml TestDriver XML tree. Default is \\src\\common\\testtools\\SmokeTest\\xml.
+  --unziptd Installs a stable version of TestDriver from \\\\builds01\\devbuilds\\BuildTeam\\TestDriver
+  --tddrive The drive where testdriver is installed (default is C: and TD directory is c:\\testdriver)
+  
+  All the optional arguments are either specified by the user or assumed to be set as environment variables.
+  These environment variables can be found in SmokeTest.pm
+
+USAGE_EOF
+	exit 1;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmokeTestROM.pm	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,259 @@
+# Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of the License "Symbian Foundation License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+# The SmokeTestROM package contains all the subroutines needed to build a ROM for
+# automated smoke testing.
+# This script was born on 18/04/2005
+# Revision number 1: 11/08/2005
+# 
+#
+
+#!/usr/bin/perl -w
+
+package SmokeTestROM;
+use strict;
+
+# Define Core IMAGE file name as created by rombuild
+my $coreImage = "*techview.nand.img";
+
+# Define the target filename for the Core ROM
+my $newCoreImage = "core.img";
+
+# Define ROFS IMAGE file name as created by rombuild
+my $ROFSImage = "*techview.nand.rofs.img";
+
+# Define the target file name for the ROFS ROM
+my $newROFSImage = "rofs1.img";
+
+# Define NAND image file name.
+my $nandImage = "*ARMV5.IMG";
+#
+# CR 0844 (Both H2 and H4 use -D_NAND2)
+# PrepareNANDROM  - subroutine to create the NAND ROM for smoke testing; zero arguments
+# USAGE: PrepareNANDROM("h2"); 
+# USAGE: PrepareNANDROM("h4hrp"); 
+#
+sub PrepareNANDROM
+{
+	my ($arg) = @_; # Grab the first and only argument
+	
+	# Change dir to NAND Loader directory
+	chdir "$SmokeTest::NandDir" or &SmokeTest::DieLog("Can't cd to $SmokeTest::NandDir");
+	
+	if(lc($arg) eq "h2") # Here we are in the H2 NAND case
+	{
+		# Run the rom command to create the image ... H2 also to use -D_NAND2
+		SmokeTest::ExecCommand ("rom -v=h2 -i=armv5 -t=nandtest_load_noext -d=_NAND2 -b=urel");
+	}
+	elsif(lc($arg) eq "h4hrp") # Here we are in the H4 NAND case
+	{
+		SmokeTest::ExecCommand ("rom -v=h4hrp -i=armv5 -t=nandtest_load_noext -d=_NAND2 -b=urel");
+	}
+	
+	# Change directory to Smoketest directory
+	chdir "$SmokeTest::SmokeTestDir" or &SmokeTest::DieLog("Can't cd to $SmokeTest::SmokeTestDir");
+	
+	# Get the filename of the NAND image file
+	my @NANDname = glob("$SmokeTest::NandDir\\$nandImage");
+	
+	# There should be exactly one file matching $nandImage. If not give warning.
+	if(@NANDname != 1)
+	{
+		print "PrepareNANDROM: warning: " . scalar(@NANDname) . " files matching $nandImage in $SmokeTest::NandDir\\: [@NANDname].\n";
+	}
+	
+	# Attempt to delete any files already in this directory left over from previous runs
+	print "PrepareNANDROM: attempting to delete any debris from the last run:\n";
+	SmokeTest::ExecCommand ("DEL /Q $nandImage");
+
+	for my $filename(@NANDname)
+	{
+		if((lc($arg) eq "h2") && ($filename =~ /h2/i)) # This is the H2 NAND case, so copy H2 image
+		{
+			# Copy $nandImage to the current working directory
+			print "PrepareNANDROM: copying $filename to .\n";
+			SmokeTest::ExecCommand ("COPY $filename");
+		}
+		elsif((lc($arg) eq "h4hrp") && ($filename =~ /h4hrp/i)) # This is the H4 NAND case, so copy H4 image
+		{
+			# Copy $nandImage to the current working directory
+			print "PrepareNANDROM: copying $filename to .\n";
+			SmokeTest::ExecCommand ("COPY $filename");
+		}
+	}
+}
+
+#
+# CR 0844 (Both H2 and H4 use -D_NAND2)
+# CreateAndZipROM creates the various ROMS; up to 5 arguments.
+# Usage:
+# CreateAndZipROM("ARMV5", "lubbock", "-DRVCT", "PlatSec");
+# CreateAndZipROM("ARMV5", "h2", "-DRVCT", "PlatSec");
+# CreateAndZipROM("ARMV5", "h2", "-DRVCT", "PlatSec", "-D_NAND2");
+# CreateAndZipROM("ARMV5", "h4hrp", "-DRVCT", "PlatSec", "-D_NAND2");
+#
+sub CreateAndZipROM
+{
+	my @args = @_; # Array to hold the arguments
+	
+	# This sixth argument $args[5] determines whether to build the NAND version
+	# of the ROM or not. Set it equal to the empty string if the argument
+	# isn't defined otherwise it should equal the argument
+	my $nandROM;
+	if(defined $args[5])
+	{
+		if($args[5] =~  /-D_NAND/)
+		{
+			$nandROM = $args[5];
+		}
+		else
+		{
+			die "Invalid final argument in CreateAndZipROM. Exiting.\n";
+		}
+	}
+	else
+	{
+		$nandROM = "";
+	}
+	
+	print "\n";
+	# 
+	# Build ROM with STAT run automatically
+	#
+	print "\n";
+	print "#\n# Build $args[0] $args[1] ROM with STAT run automatically\n#\n"; 
+	print "\n";
+	SmokeTest::PrintDateTime();
+	
+	my $eabi = "";
+	if ($args[0] eq "ARMV5")
+	{
+		$eabi = "-D_EABI=$args[0]";
+	}
+
+    my ($iProductNum,$buildrom);
+	$iProductNum = $args[4];
+	
+	if ($iProductNum eq 'Future' || $iProductNum  >= 9.5)
+	{
+####????DavidZjang#$buildrom = SmokeTest::ExecCommand ("buildrom -D_STARTUPMODE2 -D_EABI=ARMV5 -fm=\\epoc32\\rom\\include\\featuredatabase.xml h4hrp techview statauto.iby -osys$rom.bin");
+####????MCL########$buildrom = SmokeTest::ExecCommand ("buildrom -D_STARTUPMODE2 $eabi -fm=\\epoc32\\rom\\include\\featuredatabase.XML GTC_Standard statauto.iby testconfigfileparser.iby");
+	    $buildrom = SmokeTest::ExecCommand ("buildrom -D_STARTUPMODE2 $eabi -fm=\\epoc32\\rom\\include\\featuredatabase.XML GTC_Standard statauto.iby testconfigfileparser.iby");
+	}
+	else
+	{
+	    $buildrom = SmokeTest::ExecCommand ("buildrom -D_STARTUPMODE2 $eabi -fr=\\epoc32\\rom\\include\\featureUIDs.XML GTC_Standard statauto.iby testconfigfileparser.iby");
+	}
+	print $buildrom;
+	
+	if ( ($buildrom =~ m/rombuild.*failed/i) )
+	{
+		print "\n*** Error In Smoke Test ***\n Building the ROM failed\n$!\n";
+		#&SmokeTest::DieLog("Error In Smoke Test: Building the ROM failed");
+	} 
+	else 
+	{
+		print "\n*** ROM built successfully ***\n";	
+	}
+	
+	if ($nandROM =~ /-D_NAND/)
+	{
+		# Need to rename each on individually as there are several files ending in ".img"
+		print "\n";
+		print "#\n# Renaming NAND ROMs\n#\n"; 
+		print "\n";
+		SmokeTest::ExecCommand ("MOVE /Y $ROFSImage $newROFSImage");
+		SmokeTest::ExecCommand ("MOVE /Y $coreImage $newCoreImage");
+
+		# Copy each of the image files to the \epoc32\rom directory
+		print "\n";
+		print "#\n# Copying NAND ROMs\n#\n"; 
+		print "\n";
+		SmokeTest::ExecCommand ("COPY $newROFSImage \\epoc32\\rom\\");
+		SmokeTest::ExecCommand ("COPY $newCoreImage \\epoc32\\rom\\");
+		
+		# Delete the images
+		print "\n";
+		print "#\n# Deleting images\n#\n"; 
+		print "\n";
+		SmokeTest::ExecCommand ("DEL *.img");
+
+#  passing $args[1] i.e. h2 / h4hrp to PrepareNANDROM due to CR 0844 (Both H2 and H4 use -D_NAND2)
+    	&PrepareNANDROM("$args[1]");
+	}
+	
+	# Rename the IMG file to sys$rom.bin
+	my $ImgDir = SmokeTest::ExecCommand ("DIR *.img");
+		
+	$ImgDir =~ /(\S+\.img)/i;
+		
+	#&SmokeTest::DieLog("Building ROMs failed: Cannot find .IMG file") unless defined $1;
+	print "Name of ROM : $1 \n";
+	SmokeTest::ExecCommand ("MOVE /Y $1 sys\$rom.bin");
+	print "\n";
+		
+	# 
+	# ZIP ROM using \epoc32\tools\zip.exe
+	# 
+	print "\n";
+	print "#\n# ZIP ROM using \\epoc32\\tools\\zip.exe\n#\n";
+	print "\n";
+	SmokeTest::PrintDateTime();
+	
+	# Now zip the file
+	my $zipresult = SmokeTest::ExecCommand ("$SmokeTest::BuildDir$ENV{EPOCROOT}epoc32\\tools\\zip.exe -Tv sys\$rom sys\$rom.bin");
+	print "\n";
+	
+	# Test for zip errors
+	if ($zipresult =~ m/No errors detected/i) # Good case: no errors detected.
+	{
+		print "*** ROM zip successful: no errors detected ***\n";	
+	}
+	elsif ($zipresult =~ m/zip error/i) # Zip error
+	{
+		print "*** Error In Smoke Test ***\n Zipping the ROM failed $!\n";
+		#&SmokeTest::DieLog("Error In Smoke Test: Zipping the ROM failed");
+	}
+	else # Worst case
+	{
+		print "*** Error In Smoke Test ***\n Zipping unable to start $!\n";
+	}
+	
+	# Form the string for the temporary zip file locations
+	my $tempZipLocation = "$SmokeTest::SmokeTestDir\\$args[0]\\$args[1]";
+	if ($nandROM =~ /-D_NAND/) # Add \NAND folder if a NAND ROM is being built
+	{
+		
+		if ($args[2] eq "pagedrom") # Add \NAND_DP folder if a Demand Paging NAND ROM is being built
+		{
+			$tempZipLocation .= "\\NAND\(DP\)";
+		}
+		else
+		{
+			$tempZipLocation .= "\\NAND";
+		}
+	}
+
+	# Make the temp zip folder
+	SmokeTest::ExecCommand ("MKDIR $tempZipLocation");
+	print "\n";
+	
+	# Copy the ROM to the appropriate directory to be copied later
+	SmokeTest::ExecCommand ("MOVE /Y sys\$rom.zip $tempZipLocation\\sys\$rom.zip");
+	
+	print "\n";
+	
+	SmokeTest::PrintDateTime();
+}
+
+1;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmokeTestServer.pl	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,334 @@
+# Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of the License "Symbian Foundation License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+# TestServer.pl 
+# This script was born on 19/10/2004
+# 
+#
+
+use strict;
+
+my $jobsfolder = "d:\\Jobs\\";
+
+# Loop forever
+while (1)
+{
+	open LogFile, ">>d:\\SmokeTestServerLog.txt" or die "Cannot open log file: $!";
+	
+	print "\n***********************\n";
+	print "\n*** START PUBLISHER ***\n";
+	print "\n***********************\n";
+	print "\n";
+	print LogFile "\n***********************\n";
+	print LogFile "\n*** START PUBLISHER ***\n";
+	print LogFile "\n***********************\n";
+	print LogFile "\n";
+	
+	my $localtimes = localtime;
+	print "\n*** Current Time: $localtimes ***\n";
+	print LogFile "\n*** Current Time: $localtimes ***\n";
+	
+	# 
+	# Check if there are any results ready for publishing
+	#
+	print "\n";
+	print "#\n# Check if there are any results ready for publishing\n#\n"; 
+	print "\n";	
+	print LogFile "\n";
+	print LogFile "#\n# Check if there are any results ready for publishing\n#\n"; 
+	print LogFile "\n";	
+	
+	opendir JobDir, $jobsfolder or die "Cannot open jobs dir $jobsfolder: $!";
+		
+	my @jobs = readdir(JobDir);
+	
+	# to remove "." and ".." from this list
+	shift @jobs;
+	shift @jobs;
+	
+	if (!scalar(@jobs))
+	{
+		print "\nNo Jobs to publish\n";
+		print LogFile "\nNo Jobs to publish\n";
+	}
+	else
+	{
+		# 
+		# Loop though each directory and publish logs
+		#
+		print "\n";
+		print "#\n# Loop though each directory and publish logs\n#\n"; 
+		print "\n";
+		print LogFile "\n";
+		print LogFile "#\n# Loop though each directory and publish logs\n#\n"; 
+		print LogFile "\n";
+			
+		foreach my $name (sort { $a <=> $b } @jobs)
+		{
+			if ( -d $jobsfolder.$name)
+			{
+				print "\n*** Found Job: $name ***\n";
+				print LogFile "\n*** Found Job: $name ***\n";
+				
+				# Check to see if job has been completed.
+				if (isJobFinished($name))
+				{
+					# 
+					# Publish the results
+					#
+					print "\n";
+					print "#\n# Publish the results\n#\n"; 
+					print "\n";
+					print LogFile "\n";
+					print LogFile "#\n# Publish the results\n#\n"; 
+					print LogFile "\n";
+					
+					my $publishfile = $jobsfolder.$name."\\publish.txt";
+					
+					if (-r $publishfile)
+					{
+						open (PUBLISH, $publishfile) or GoNext("Cannot find publish details for $name");
+						my $count = 0;
+						my $index = 0;
+						while (my $publishlocation = <PUBLISH>)
+						{
+							chomp $publishlocation;
+							
+							$index++;
+							
+							print "\nPublish Location = $publishlocation\n";
+							print LogFile "\nPublish Location = $publishlocation\n";
+							
+							`mkdir $publishlocation`; # or GoNext("$publishlocation\\$name\\");
+							
+							my $lookIn = "$jobsfolder$name\\output";
+							my ($source,$runid,$buildname) = getSourceDir($lookIn);
+							
+							my $srcdir = $source."\\xml";
+							my $trgtdir= $publishlocation."xml\\";
+							
+							my $xcopycmd= "xcopy /C /Y /E $srcdir $trgtdir ";
+							print `$xcopycmd`;
+							
+							#
+							# Copy the contents of Output and reports -
+							#
+							# runXX_<snapshot>_SymbianOS_vYY.xml/html to <snapshot>_Symbian_OS_vYY.xml/html
+							#
+							
+							my $xmlfile   = "$source\\run".$runid."_".$buildname."\.xml";
+							my $htmlfile  = "$source\\run".$runid."_".$buildname."\.html";
+							
+							if (-e $xmlfile)  {
+								
+								print "copy $xmlfile to $buildname.xml";
+								system "copy $xmlfile $publishlocation\\$buildname.xml";
+							}
+							
+							if (-e $htmlfile)  {
+								
+								print "copy $htmlfile to $buildname.html";
+								system "copy $htmlfile $publishlocation\\$buildname.html";
+							}
+							
+							print "\nNumber of Files Copied = $1\n" if $xcopycmd =~ m/(\d+)\s\w+/;
+							print LogFile "\nNumber of Files Copied = $1\n" if $xcopycmd =~ m/(\d+)\s\w+/;
+							
+							$count += $1;
+							
+							# The input should be copied onto \\devbuilds\master\.. but not \\devbuilds\logs\master\..
+							if ($index < 2)
+							{
+								print "\n\nCopy the Input\n";
+								$source = "$jobsfolder$name\\input\\*";
+								
+								# Copy the contents of Input
+								print "\ncmd: xcopy /C /Y /E $source $publishlocation 2>&1\n";
+								print LogFile "\ncmd: xcopy /C /Y /E $source $publishlocation 2>&1\n";
+								my $xcopy = `xcopy /C /Y /E $source $publishlocation 2>&1`;
+								print $xcopy;
+								
+								print "\nNumber of Files Copied = $1\n" if $xcopy =~ m/(\d+)\s\w+/;
+								print LogFile "\nNumber of Files Copied = $1\n" if $xcopy =~ m/(\d+)\s\w+/;
+								$count += $1;
+							}
+						}						
+						close Publish;
+						
+						print "\nTotal Number of files copied = $count\n";
+						print LogFile "\nTotal Number of files copied = $count\n";
+						
+						# Minimum 3 files have to be copied - Trace.txt, sys$rom.bin and armX.tpkg
+						if ($count >= 3)
+						{
+							# it is fine to delete the jobs dir
+							print "\ncmd: rd $jobsfolder$name /Q /S  2>&1\n";
+							print LogFile "\ncmd: rd $jobsfolder$name /Q /S  2>&1\n";
+							print `rd $jobsfolder$name /Q /S  2>&1`;
+						}
+					}
+					else
+					{
+						print "\n*** Error publishing results ***\n Cannot open publish file: $jobsfolder"."$name"."\\publish.txt\n";
+						print LogFile "\n*** Error publishing results ***\n Cannot open publish file: $jobsfolder"."$name"."\\publish.txt\n";
+					}
+				}
+				else
+				{
+					print "\nThe Job $name is either still running or has encountered an error\n";				
+					print LogFile "\nThe Job $name is either still running or has encountered an error\n";				
+				}
+			}
+			else
+			{
+				print "*** Error ***\nDir does not exist! $jobsfolder.$name\n";
+				print LogFile "*** Error ***\nDir does not exist! $jobsfolder.$name\n";
+			}
+		}
+	}
+	close JobDir;
+	
+	my $localtimes = localtime;
+	print "\n*** Current Time: $localtimes ***\n";
+	print LogFile "\n*** Current Time: $localtimes ***\n";
+	
+	print "\n";
+	print "\n*********************\n";
+	print "\n*** END PUBLISHER ***\n";
+	print "\n*********************\n";
+	print "\n";
+	print "\n";
+	print LogFile "\n";
+	print LogFile "\n*********************\n";
+	print LogFile "\n*** END PUBLISHER ***\n";
+	print LogFile "\n*********************\n";
+	print LogFile "\n";
+	print LogFile "\n";
+	
+	close LogFile;
+	sleep 900;
+}
+
+sub GoNext
+{
+	print "\n*** Error in Publisher ***\n $_[0] $!\n";
+	print LogFile "\n*** Error in Publisher ***\n $_[0] $!\n";
+	next;
+}
+
+# identify if a job has finished
+sub isJobFinished($) {
+	
+	my $jobid = shift;
+	my @cmd_out = `testdriver.cmd jobstatus -j $jobid 2>&1`;
+	
+	foreach (@cmd_out) {
+		if (m/completed/) { return 1; }
+	}
+	
+	return 0;
+}
+
+sub getSourceDir($)
+{
+	my $source = shift;
+	my $runid  = 0;
+	my $buildname;
+	
+	#
+	# Find the correct directory to publish
+	#
+	
+	if (opendir RESULTS, $source)
+	{	
+		my @dirArray = readdir(RESULTS);
+		
+		#print "@results";	
+		# to remove "." and ".." from this list
+		shift @dirArray;
+		shift @dirArray;
+		
+		if (!scalar(@dirArray))
+		{
+			print "REMARK: The result for $_[0] has an empty $source directory";
+			return;
+		}
+		else
+		{
+			print "\nContents of $source = @dirArray\n";
+			$source .= "\\$dirArray[0]"; 
+			# dirArray should always have just the one subdir - 0XXXX_Symbian_OS_vX.X
+			
+			$buildname = $dirArray[0];
+	
+			if (opendir tempDir, "$source")
+			{
+				# to remove "." and ".." from this list
+				my @dirArray = readdir(tempDir);
+				shift @dirArray;
+				shift @dirArray;
+				
+				print "\nContents of $source = @dirArray\n";
+				
+				foreach my $directory (@dirArray)
+				{
+					if ($directory =~ /(?:$_[0])/i)
+					{
+						$source .= "\\$directory";
+						
+						# added this to remove udeb/xx
+						if (opendir tempDir, "$source")
+						{
+							# to remove "." and ".." from this list
+							@dirArray = readdir(tempDir);
+							shift @dirArray;
+							shift @dirArray;
+				
+							print "\nContents of $source = @dirArray\n";
+				
+							foreach my $directory (@dirArray)
+							{
+								if ($directory =~ /(udeb|urel)/i)
+								{
+									$source .= "\\$directory";
+									if (opendir tempDir, "$source")
+									{
+										# to remove "." and ".." from this list
+										@dirArray = readdir(tempDir);
+										shift @dirArray;
+										shift @dirArray;
+				
+										print "\nContents of $source = @dirArray\n";
+				
+										foreach my $directory (@dirArray)
+										{
+											if ($directory =~ /(^[0-9]+)/i)
+											{
+												$source .= "\\$directory";
+												$runid = $directory;
+												last;
+											}
+										}
+									}
+									last;
+								}
+							}
+						}
+						
+					}
+				}
+			}
+		}
+	}
+	return ($source, $runid, $buildname);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmokeTestSuite.pm	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,501 @@
+# Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of the License "Symbian Foundation License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+# The SmokeTestSuite package contains subroutines that are needed to build a 
+# testdriver test suite.
+# This script was born on 18/04/2005
+# 
+#
+
+#!/usr/bin/perl -w
+package SmokeTestSuite;
+use strict;
+
+my $servicename;
+
+#
+# BuildAndPackage: Used to create a test package for remote execution on the ROM
+#
+sub BuildAndPackage
+{
+	#
+	# Build Test Package for $_[0]
+	#
+	print "\n#\n# Build Test Package for $_[0]\n#\n";
+	SmokeTest::PrintDateTime();
+	my $testbuild = SmokeTest::ExecCommand ("$SmokeTest::TestDriverCmd build -p $_[0] -b udeb -s $SmokeTest::TestSuite");
+
+	# now check for results
+	$testbuild =~ m/fail\:\s(\d+)\s\%/i;
+	
+	if ( ($testbuild =~ m/\*\*error\:/i) || $1 == 100 )
+	{
+		print "\nREMARK: Smoke Test *** Building the Test failed $!\n";
+		#&SmokeTest::DieLog("Error In Smoke Test: Building the Test failed");
+	} 
+	else 
+	{
+		print "\n*** Test Building successful ***\n";	
+	}
+	
+	SmokeTest::PrintDateTime();
+	
+	my $testpackage = SmokeTest::ExecCommand ("$SmokeTest::TestDriverCmd package -p $_[0] -b udeb -s $SmokeTest::TestSuite --tp $SmokeTest::SmokeTestDir\\$_[0].tpkg");
+	print "\n";
+	
+	if (($testpackage =~ m/\*\*error/i))
+	{
+		print "\nREMARK: Smoke Test *** Building the Test Package failed\n\"$1\"\n";
+		#&SmokeTest::DieLog("Error In Smoke Test: Building the Test Package failed");
+	} 
+	else 
+	{
+		print "\n*** Building the Test Package successful ***\n";	
+	}
+	
+	SmokeTest::PrintDateTime();
+}
+
+#
+# BuildAndPublish: used to build and test the smoketest test suite on an Emulator
+#
+sub BuildAndPublish
+{
+	my $runid = 0;
+	my $buildname;
+	
+	#
+	# Build Test Suite for $_[0]
+	#
+	print "\n#\n# Build Test Suite for $_[0]\n#\n";
+	SmokeTest::PrintDateTime();
+	my $testbuildwinscw = SmokeTest::ExecCommand ("$SmokeTest::TestDriverCmd build -p $_[0] -b udeb -s $SmokeTest::TestSuite");
+
+	# now check for results
+	$testbuildwinscw =~ m/fail\:\s(\d+)\s\%/i;
+	
+	if ( ($testbuildwinscw =~ m/\*\*error\:/i) || $1 == 100 )
+	{
+		print "\nREMARK: Smoke Test *** Building the Test for $_[0] failed $!\n";
+		#&SmokeTest::DieLog("Error In Smoke Test: Building the Test failed");
+	} 
+	else 
+	{
+		print "\n*** Test Build successful ***\n";	
+	}
+	
+	#
+	# Run Test Suite for $_[0]
+	#
+	print "\n";
+	print "#\n# Run Test Package for $_[0]\n#\n";
+	print "\n";
+	SmokeTest::PrintDateTime();
+	
+	SmokeTest::ExecCommand ("$SmokeTest::TestDriverCmd run -p $_[0] -b udeb -s $SmokeTest::TestSuite");
+	
+	SmokeTest::PrintDateTime();
+	
+	#
+	# Publish results of emulator onto publish server
+	#
+	print "\n";
+	print "#\n# Publish results of emulator onto publish server\n#\n";
+	print "\n";
+	
+	#
+	# Find the correct directory to publish
+	#
+	my $source = "$SmokeTest::TestDriverDrive\\TestDriver\\Results";
+	if (opendir Results, $source)
+	{	
+		my @dirArray = readdir(Results);
+		
+		#print "@results";	
+		# to remove "." and ".." from this list
+		shift @dirArray;
+		shift @dirArray;
+		
+		if (!scalar(@dirArray))
+		{
+			print "REMARK: The emulator for $_[0] has an empty $source directory";
+			return;
+		}
+		else
+		{
+			print "\nContents of $source = @dirArray\n";
+			$source .= "\\$dirArray[0]"; 
+			# dirArray should always have just the one subdir - 0XXXX_Symbian_OS_vX.X
+			
+			$buildname = $dirArray[0];
+			
+			if (opendir tempDir, "$source")
+			{
+				# to remove "." and ".." from this list
+				@dirArray = readdir(tempDir);
+				shift @dirArray;
+				shift @dirArray;
+				
+				print "\nContents of $source = @dirArray\n";
+				
+				foreach my $directory (@dirArray)
+				{
+					if ($directory =~ /(?:$_[0])/i)
+					{
+						$source .= "\\$directory";
+						
+						# added this to remove udeb/xx
+						if (opendir tempDir, "$source")
+						{
+							# to remove "." and ".." from this list
+							@dirArray = readdir(tempDir);
+							shift @dirArray;
+							shift @dirArray;
+				
+							print "\nContents of $source = @dirArray\n";
+				
+							foreach my $directory (@dirArray)
+							{
+								if ($directory =~ /(udeb|urel)/i)
+								{
+									$source .= "\\$directory";
+									if (opendir tempDir, "$source")
+									{
+										# to remove "." and ".." from this list
+										@dirArray = readdir(tempDir);
+										shift @dirArray;
+										shift @dirArray;
+				
+										print "\nContents of $source = @dirArray\n";
+				
+										my @iNumericDirList = ();
+										foreach my $directory (@dirArray)
+										{
+											if ($directory =~ /(^[0-9]+)/i)
+											{
+    											push @iNumericDirList, $directory;
+											}
+										}
+									    @iNumericDirList = sort { $b <=> $a } @iNumericDirList;
+									    $runid = $iNumericDirList[0];
+                                        $source .= "\\$runid";
+									    last;
+									}
+									last;
+								}
+							}
+						}
+						
+					}
+				}
+				
+				print "\nThe final source directory = $source\n";
+			}
+			else
+			{
+				print "REMARK: The emulator for $_[0] has an empty $source directory";
+				return;
+			}
+		}
+		my $emulatorpublish = "$SmokeTest::PublishServer\\$SmokeTest::ProductType\\$SmokeTest::BuildNum\\logs\\SmokeTest\\Emulator\\$_[0]";
+		
+		SmokeTest::ExecCommand ("MKDIR $emulatorpublish"); # or GoNext("$publishlocation\\$name\\");
+		
+		SmokeTest::ExecCommand ("XCOPY /C /Y /E $source\\xml $emulatorpublish\\xml\\");
+		
+		#
+		# Copy runXX_<snapshot>_SymbianOS_vYY.xml/html to <snapshot>_Symbian_OS_vYY.xml/html
+		#
+		
+		my $xmlfile   = "$source\\run".$runid."_".$buildname."\.xml";
+		my $htmlfile  = "$source\\run".$runid."_".$buildname."\.html";
+		
+		if (-e $xmlfile)
+		{
+			SmokeTest::ExecCommand ("COPY $xmlfile $emulatorpublish\\$buildname.xml");
+		}
+		
+		if (-e $htmlfile)
+		{
+			SmokeTest::ExecCommand ("COPY $htmlfile $emulatorpublish\\$buildname.html");
+		}
+		
+		#
+		# Publish results of emulator onto logs dir
+		#
+		print "\n";
+		print "#\n# Publish results of emulator onto Logs Dir\n#\n";
+		print "\n";
+		
+		my $emulatorpublish = "$SmokeTest::LogsDir\\SmokeTest\\Emulator\\$_[0]\\";
+		
+		SmokeTest::ExecCommand ("MKDIR $emulatorpublish"); # or GoNext("$publishlocation\\$name\\");
+		
+		SmokeTest::ExecCommand ("XCOPY /C /Y /E $source $emulatorpublish");
+	}
+	else
+	{
+		print "REMARK: Cannot open dir $source: $!";
+		return;
+	}
+	SmokeTest::PrintDateTime();
+}
+
+#
+# PollServers: Polls all the servers from the Pool and picks out the one with the shortest queue.
+#
+sub PollServers
+{
+	#
+	# Parse ENV and create an array of smoketest servers for $_[0]
+	#
+	print "\n";
+	print "#\n# Parse ENV and create an array of smoketest servers for $_[0]\n#\n";
+	print "\n";
+	SmokeTest::PrintDateTime();
+	
+	if (($_[0] eq "Lubbock") || ($_[0] eq "LUBBOCK"))
+	{
+		$SmokeTest::servicename = "RemoteTestDriverLubbock";
+	}
+	elsif ($_[0] eq "H2")
+	{
+		$SmokeTest::servicename = "RemoteTestDriverH2";
+	}
+        elsif ($_[0] eq "H4HRP")
+	{
+		$SmokeTest::servicename = "RemoteTestDriverH4HRP";
+	} 
+	else
+	{
+		&SmokeTest::DieLog("Cannot poll serverpool for pool \"$_[0]\"");
+	}
+	
+	my @servers = split /\#/, $SmokeTest::serverpool;
+	if (@servers < 1)
+	{
+		&SmokeTest::DieLog("*** Error In Smoke Test ***\nNo SmokeTest Servers specified for $_[0]$!\n");
+	}
+	else
+	{
+		print "\n*** Retrieved Pool of Smoke Test Servers from ENV for $_[0]***\n";
+	}
+	
+	#
+	# Poll each of the smoke test servers and parse the results
+	#
+	print "\n";
+	print "#\n# Poll each of the smoke test servers and parse the results\n#\n";
+	print "\n";
+	
+	my %serverlist;
+	
+    print "Checking TestDriver Version\n";
+    SmokeTest::ExecCommand ("$SmokeTest::TestDriverCmd version");
+
+	foreach my $server (@servers)
+	{
+		print "Polling Server: $server\n";
+        my $masterstatus = SmokeTest::ExecCommand ("$SmokeTest::TestDriverCmd masterstatus --srv //$server/$SmokeTest::servicename");
+		
+		my $value = -2;
+		if ($masterstatus =~ m/Master: TestDriver is currently (....)/i)
+		{
+			if ($1 eq 'free')
+			{
+				#print "Free!\n";
+				$value = 0;
+			}
+			else
+			{
+				$masterstatus =~ m/are\s+(\w+)\s+jobs/i;
+				if ($1 =~ m/\D+/)
+				{
+					$value = 1;
+				}
+				else
+				{
+					$value = $1 + 1;
+				}
+			}
+		}
+		else
+		{
+			# The master is not running a service
+			$value = -1;
+		}
+		$serverlist{$server} = $value;
+		print "\n"; 
+	}
+	
+	#
+	# Decide which server to use
+	#
+	print "\n";
+	print "#\n# STEP8 Decide which server to use\n#\n";
+	print "\n";
+	
+	my $masterserver;
+	
+	# Loop through first time only to print out all the available servers
+	print "\nAvailable Servers\n";
+	foreach my $servername (sort { $serverlist{$a} <=> $serverlist{$b} } keys %serverlist)
+	{
+		print "\n$servername : number in queue are $serverlist{$servername}\n";
+	}
+	
+	# Loop through second time to actually select the correct server
+	foreach my $servername (sort { $serverlist{$a} <=> $serverlist{$b} } keys %serverlist)
+	{
+		if ($serverlist{$servername} > -1)
+		{
+			$masterserver = $servername;
+			last;
+		}
+	}
+	
+	if (defined $masterserver)
+	{
+		print "\n*** The Smoke Test Server to be used for $_[0] is $masterserver ***\n";
+	}
+	else
+	{
+		print "\nREMARK: Smoke Test *** No available Smoke Test Servers for $_[0] \n";
+		#&SmokeTest::DieLog("Error In Smoke Test: No available Smoke Test Servers for $_[0]");
+	}
+	SmokeTest::PrintDateTime();
+	return $masterserver;
+}
+
+#
+# Usage: RunRemote(Architecture, Testing Board, Server)
+#
+sub RunRemote
+{
+	my $masterserver = $_[2];
+	
+		
+	#
+	# Call TestDriver runremote for $_[0]
+	#
+	print "\n";
+	print "#\n# Call TestDriver runremote for $_[0]\n#\n";
+	print "\n";
+	SmokeTest::PrintDateTime();
+	
+	my $tempZipLocation = "$SmokeTest::SmokeTestDir\\$_[0]\\$_[1]";
+	if ($_[3] eq "NAND\\")
+	{
+		$tempZipLocation .= "\\NAND";
+	}
+	elsif ($_[3] eq "NAND\(DP\)\\")
+	{
+                $tempZipLocation .= "\\NAND\(DP\)";
+	}
+
+	SmokeTest::ExecCommand ("COPY /Y $tempZipLocation\\sys\$rom.zip $SmokeTest::SmokeTestDir\\sys\$rom.zip");
+	
+	# Decide whether this is a platsec ROM or not
+	my $platsec;
+	if ($SmokeTest::buildNo eq "9.1" || $SmokeTest::buildNo eq "9.2" || $SmokeTest::buildNo eq "9.3" || $SmokeTest::buildNo eq "Future" || $SmokeTest::buildNo eq "9.4" || $SmokeTest::buildNo eq "9.5" || $SmokeTest::buildNo eq "9.6" || $SmokeTest::buildNo eq "tb91")
+	{
+		$platsec = "ON";
+	}
+	else
+	{
+		$platsec = "OFF";
+	}
+	
+	# calling testdriver for $_[0]
+	my $runremote = SmokeTest::ExecCommand ("$SmokeTest::TestDriverCmd runremote -m async -i $SmokeTest::SmokeTestDir --tp $_[0].tpkg -r sys\$rom.zip --srv //$masterserver/$SmokeTest::servicename --platsec $platsec --testexec ON");
+	
+	#
+	# Parse output to get the job number or error
+	#
+	print "\n";
+	print "#\n# Parse output to get the job number or error\n#\n";
+	print "\n";
+	
+	my $jobid;
+	
+	if ($runremote =~ m/job id/i)
+	{
+		$runremote =~ m/job id: (\d+)/i;
+		$jobid = $1;
+		print "\n*** Job submitted successfully ***\n\nJob Id = $jobid\n";
+	}
+	else
+	{
+		print "\nREMARK: Smoke Test Job Submission failed\n";
+		#&SmokeTest::DieLog("Error In Smoke Test: Submitting the Job failed");
+		return;
+	}
+	
+	#
+	# Create a text file with publish details
+	#
+	print "\n";
+	print "#\n# Create a text file with publish details\n#\n";
+	print "\n";
+	
+	my $publishstring;
+	
+	$publishstring = "Publish: $SmokeTest::PublishServer\\$SmokeTest::ProductType\\$SmokeTest::BuildNum\\logs\\Smoketest\\$_[0]\\$_[1]\\";
+	print "$publishstring";
+	
+	if ( (defined $SmokeTest::PublishServer) && (defined $SmokeTest::ProductType) && (defined $SmokeTest::BuildNum) )
+	{
+		open PublishFile, ">$_[0]$_[1].txt" or &SmokeTest::DieLog("Cannot open File $_[0]$_[1].txt: $!\n");
+		$publishstring = "$SmokeTest::PublishServer\\$SmokeTest::ProductType\\$SmokeTest::BuildNum\\logs\\Smoketest\\$_[0]\\$_[1]\\";
+		if ($_[3] eq "NAND\\")
+		{
+			$publishstring .= "NAND\\";
+		}
+		elsif ($_[3] eq "NAND\(DP\)\\")
+		{
+            $publishstring .= "NAND\(DP\)\\";
+	    }
+		print PublishFile "$publishstring";
+		$publishstring = "\n$SmokeTest::PublishServer\\$SmokeTest::ProductType\\logs\\$SmokeTest::BuildNum\\Smoketest\\$_[0]\\$_[1]\\";
+		if ($_[3] eq "NAND\\")
+		{
+			$publishstring .= "NAND\\";
+		}
+		elsif ($_[3] eq "NAND\(DP\)\\")
+		{
+                $publishstring .= "NAND\(DP\)\\";
+        }
+		print PublishFile "$publishstring";
+		close PublishFile;
+		print "\n*** Publish file created successfully ***\n";
+	}
+	else
+	{
+		print "\nREMARK: Smoke Test *** Could not Create Publish File\n$!";
+		#&SmokeTest::DieLog("Error In Smoke Test: Could not Create Publish File");
+	}
+	
+	#
+	# Copy This publish file to the correct directory 
+	#
+	print "\n";
+	print "#\n# Copy This publish file to the correct directory \n#\n";
+	print "\n";
+	
+	###print "\nabout to move /Y $_[0]$_[1].txt \\\\$masterserver\\Jobs\\$jobid\\publish.txt\n";
+    SmokeTest::ExecCommand ("MOVE /Y $_[0]$_[1].txt \\\\$masterserver\\Jobs\\$jobid\\publish.txt");
+	
+	SmokeTest::PrintDateTime();
+}
+
+1;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/System/Group/Smoketest_System.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,40 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Smoketest_Agenda.mmp
+// using relative paths for sourcepath and user includes
+// 
+//
+
+TARGET			Smoketest_System.exe
+TARGETTYPE		exe
+UID				0x1000007A 0x101F7773
+
+#if (!defined __NO_VENDORID__)
+VENDORID		0x70000001
+#endif
+
+CAPABILITY		WriteUserData ReadUserData
+
+SOURCEPATH		..\Src
+
+SOURCE		TestSystemBase.cpp
+
+USERINCLUDE		..\Inc ..\..\Group
+
+SYSTEMINCLUDE	\Epoc32\include
+SYSTEMINCLUDE	\Epoc32\include\test
+
+LIBRARY	EUSER.LIB
+LIBRARY	EIKSRV.LIB
+LIBRARY	TESTEXECUTELOGCLIENT.LIB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/System/Group/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,19 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// For System smoketest
+// 
+//
+
+PRJ_TESTMMPFILES
+Smoketest_System.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/System/Inc/TestSystemBase.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,46 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+#ifndef TEST_SYSTEM_BASE_H
+#define TEST_SYSTEM_BASE_H
+
+#include <eikunder.h>
+#include <TestExecuteLog.h>
+
+class CEikUndertaker;
+
+class CSystemTestBase : public MEikUndertakerObserver
+	{
+public:
+	static CSystemTestBase* NewL();
+	~CSystemTestBase();
+
+protected:	
+	CSystemTestBase();
+	void ConstructL();
+
+protected: // From MEikUndertakerObserver
+	void HandleThreadExitL(RThread& aThread);
+	
+protected:
+	CEikUndertaker* iUndertaker;
+	RTestExecuteLogServ iLogger;
+	TInt iExitReason;	
+	TExitCategoryName iExitCategory;
+	};
+
+
+#endif // TEST_SYSTEM_BASE_H
Binary file System/ReadMe.doc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/System/Src/TestSystemBase.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,116 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "TestSystemBase.h"
+
+// Global Vars
+_LIT(KTestExecuteLog,"c:\\Logs\\TestExecute\\smoketest_system_temp.htm");
+_LIT(KPanicText,"The following Panic has occured: Thread Name = %S Exit Reason = %d Exit Category = %S");
+
+CSystemTestBase* CSystemTestBase::NewL()
+	{
+	CSystemTestBase* self=new(ELeave) CSystemTestBase;
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(); // self
+	return(self);
+	}
+
+void CSystemTestBase::ConstructL()
+	{
+	iUndertaker=CEikUndertaker::NewL(*this);
+	User::LeaveIfError(iLogger.Connect());
+	User::LeaveIfError(iLogger.CreateLog(KTestExecuteLog,RTestExecuteLogServ::ELogModeAppend));
+	}
+
+CSystemTestBase::CSystemTestBase()
+	{
+	// do nothing
+	}
+
+CSystemTestBase::~CSystemTestBase()
+	{
+	delete iUndertaker;
+	iLogger.Close();
+	}
+
+void CSystemTestBase::HandleThreadExitL(RThread& aThread)
+	{
+	TExitType exitType=aThread.ExitType();
+	if (exitType==EExitPanic)
+		{
+		CActiveScheduler::Stop();
+		iExitReason = aThread.ExitReason();
+		iExitCategory = aThread.ExitCategory();
+		TBuf<100> iName(aThread.FullName());
+		iLogger.WriteFormat(KPanicText, &iName, iExitReason, &iExitCategory);
+		User::Panic(iExitCategory,iExitReason);
+		}
+	}
+
+//LOCAL_C TInt PanicThread(TAny*)
+//	{
+//	_LIT(PanicReason, "Just, why not");
+//	TInt iPanicInt = 666;
+//	User::Panic(PanicReason, iPanicInt);
+//	return iPanicInt;
+//	}
+	
+LOCAL_C void MainL()
+	{
+	// Construct and install the active scheduler
+	CActiveScheduler*  myScheduler = new(ELeave) CActiveScheduler;
+	CleanupStack::PushL(myScheduler);
+	CActiveScheduler::Install(myScheduler); 
+	
+	CSystemTestBase* iTempBase = CSystemTestBase::NewL();
+	
+	// The following is just test code that spawns a thread and makes it panic
+	//RThread iPanicThread;
+	//_LIT(PanicThreadTest, "Undertaker Panic Thread Test");
+		
+	//User::LeaveIfError(iPanicThread.Create(PanicThreadTest(), &PanicThread, KDefaultStackSize, 0x100, 0x100, NULL));
+	//iPanicThread.SetPriority(EPriorityAbsoluteHigh);
+	//iPanicThread.Resume();
+	
+	CActiveScheduler::Start();	
+	
+	for (;;)
+		{
+		User::After(100000);
+		}
+	}
+	
+GLDEF_C TInt E32Main()
+/**
+ * Executable Entry Point
+ * Top level always creates TRAP harness.
+ * Calls MainL() inside the TRAP harness
+ */
+	{
+	__UHEAP_MARK;
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAPD(err,MainL());
+	// should never reach this point if some thread has panicked already
+	_LIT(KTestPanicReason,"Trap");
+	__ASSERT_ALWAYS(!err, User::Panic(KTestPanicReason,err));
+	delete cleanup;
+	__UHEAP_MARKEND;
+	return KErrNone;
+	}	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/ConsoleAlarmAlertServer/ConsoleAlarmAlertServer.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,44 @@
+// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+TARGET					ConsoleAlarmAlertServer.dll
+TARGETTYPE				dll
+CAPABILITY   All -TCB
+UID						0x1000008D	0x101F502A
+VENDORID 0x70000001
+
+SOURCEPATH				..\ConsoleAlarmAlertServer\Source
+
+SOURCE					ConsoleAlarmAlertServer.cpp
+SOURCE					ConsoleAlarmAlertSession.cpp
+SOURCE					ConsoleAlarmAlertConsole.cpp
+SOURCE					ConsoleAlarmAlertServerMain.cpp
+SOURCE					ConsoleAlarmAlertLEDFlasher.cpp
+
+USERINCLUDE				..\ConsoleAlarmAlertServer\Include
+//USERINCLUDE				..\AlarmAlert\Shared
+//USERINCLUDE				..\Shared\Include
+
+SYSTEMINCLUDE			\Epoc32\Include
+
+LIBRARY					euser.lib
+LIBRARY					hal.lib
+LIBRARY					AlarmShared.lib
+
+DEFFILE					ConsoleAlarmAlertServer.DEF
+
+START WINS
+	baseaddress			0x40700000
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/ConsoleAlarmAlertServer/Include/ConsoleAlarmAlertConsole.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,91 @@
+// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __CONSOLEALARMALERTCONSOLE_H__
+#define __CONSOLEALARMALERTCONSOLE_H__
+
+// System includes
+#include <e32base.h>
+
+// User includes
+#include "asaltdefs.h"
+
+// Type definitions
+
+// Constants
+
+// Classes referenced
+class CConsoleAlarmAlertSession;
+
+// Enumerations
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// ----> CConsoleAlarmAlertConsole (header)
+///////////////////////////////////////////////////////////////////////////////////////
+class CConsoleAlarmAlertConsole : public CActive
+	{
+///////////////////////////////////////////////////////////////////////////////////////
+public:										// CONSTRUCT / DESTRUCT
+///////////////////////////////////////////////////////////////////////////////////////
+	CConsoleAlarmAlertConsole(CConsoleAlarmAlertSession& aSession);
+	~CConsoleAlarmAlertConsole();
+
+///////////////////////////////////////////////////////////////////////////////////////
+public:										// ACCESS
+///////////////////////////////////////////////////////////////////////////////////////
+	void									GetKey();
+	void									CancelKey();
+	void									DecCounter();
+	void									UpdateDisplay();
+	TInt									GetTimeInterval() const;
+	void									SetVisibility(TInt aVis);
+	void									SetAlertState(TInt aFlags);
+
+///////////////////////////////////////////////////////////////////////////////////////
+protected:									// FROM CActive
+///////////////////////////////////////////////////////////////////////////////////////
+	void									RunL();
+	void									DoCancel();
+
+///////////////////////////////////////////////////////////////////////////////////////
+protected:									// INTERNAL METHODS
+///////////////////////////////////////////////////////////////////////////////////////
+	void									Hide();
+	void									CreateWin();
+	void									DoDeferTime(TASAltAlertServerResponse aResponse);
+
+	static TBool							CountDownCallBack(TAny* aSelf);
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// MEMBER DATA
+///////////////////////////////////////////////////////////////////////////////////////
+
+	TInt									iAlertState;
+
+	TInt									iTimeInterval;
+
+	CPeriodic*								iCountDown;
+
+	CConsoleBase*							iWin;
+
+	CConsoleAlarmAlertSession&				iSession;
+
+	friend class							CConsoleAlarmAlertSession;
+
+	TInt									iInstructionIndex;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/ConsoleAlarmAlertServer/Include/ConsoleAlarmAlertLEDFlasher.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,75 @@
+// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __CONSOLEALARMALERTLEDFLASHER_H__
+#define __CONSOLEALARMALERTLEDFLASHER_H__
+
+// System includes
+#include <e32base.h>
+
+// User includes
+
+// Type definitions
+
+// Constants
+
+// Enumerations
+
+// Classes referenced
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// ----> CConsoleAlarmAlertLEDFlasher (header)
+///////////////////////////////////////////////////////////////////////////////////////
+class CConsoleAlarmAlertLEDFlasher : public CTimer
+	{
+///////////////////////////////////////////////////////////////////////////////////////
+public:										// STATIC CONSTRUCT
+///////////////////////////////////////////////////////////////////////////////////////
+	static CConsoleAlarmAlertLEDFlasher*	NewL();
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// INTERNAL CONSTRUCT
+///////////////////////////////////////////////////////////////////////////////////////
+	CConsoleAlarmAlertLEDFlasher();
+
+///////////////////////////////////////////////////////////////////////////////////////
+public:										// ACCESS
+///////////////////////////////////////////////////////////////////////////////////////
+
+	TInt									Start();
+
+	void									Stop();
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// FROM CActive
+///////////////////////////////////////////////////////////////////////////////////////
+
+	void									RunL();
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// INTERNAL
+///////////////////////////////////////////////////////////////////////////////////////
+
+	TInt									SetRedLedOn(TBool aOn);
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// MEMBER DATA
+///////////////////////////////////////////////////////////////////////////////////////
+
+	TBool									iLedOn;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/ConsoleAlarmAlertServer/Include/ConsoleAlarmAlertServer.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,87 @@
+// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TALARMALERTSERVER.H
+// 
+//
+
+#ifndef __CONSOLEALARMALERTSERVER_H__
+#define __CONSOLEALARMALERTSERVER_H__
+
+// System includes
+#include <e32base.h>
+
+// User includes
+
+// Type definitions
+
+// Constants
+
+// Enumerations
+
+// Classes referenced
+class CTestAlarmAlertConsole;
+class CConsoleAlarmAlertSession;
+
+///////////////////////////////////////////////////////////////////////////////////////
+// ----> CConsoleAlarmAlertServer (header)
+///////////////////////////////////////////////////////////////////////////////////////
+class CConsoleAlarmAlertServer : public CPolicyServer
+	{
+///////////////////////////////////////////////////////////////////////////////////////
+public:										// STATIC CONSTRUCT / DESTRUCT
+///////////////////////////////////////////////////////////////////////////////////////
+	static CConsoleAlarmAlertServer*		NewLC();
+	~CConsoleAlarmAlertServer();
+
+public:
+	inline void								AddResponseArray(TAny* aResponseArray);
+	void									SetAttachment(HBufC8* aData);
+	inline HBufC8*							Attachment() const;
+	inline TAny*							ResponseArray() const;
+	inline CConsoleAlarmAlertSession*		WaitingSession() const;
+	inline void								SetNotifying(TBool aIsNotifying);
+	inline TBool							IsNotifying() const;
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// INTERNAL CONSTRUCT
+///////////////////////////////////////////////////////////////////////////////////////
+	CConsoleAlarmAlertServer();
+	void									ConstructL();
+
+///////////////////////////////////////////////////////////////////////////////////////
+public:										// FROM CServer2
+///////////////////////////////////////////////////////////////////////////////////////
+	CSession2*								NewSessionL(const TVersion& aVersion,const RMessage2& aMessage) const;
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// FROM CActive
+///////////////////////////////////////////////////////////////////////////////////////
+	TInt									RunError(TInt aError);
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// MEMBER DATA
+///////////////////////////////////////////////////////////////////////////////////////
+	TAny*									iInstructionSet;
+	HBufC8*									iAttachment;
+	CConsoleAlarmAlertSession*				iWaitingSession;
+	TBool									iIsNotifying;
+	};
+
+// inline functions
+void CConsoleAlarmAlertServer::AddResponseArray(TAny* aResponseArray)		{ iInstructionSet = aResponseArray; }
+HBufC8* CConsoleAlarmAlertServer::Attachment() const						{ return iAttachment; }
+TAny* CConsoleAlarmAlertServer::ResponseArray() const						{ return iInstructionSet; }
+CConsoleAlarmAlertSession* CConsoleAlarmAlertServer::WaitingSession() const	{ return iWaitingSession; }
+void CConsoleAlarmAlertServer::SetNotifying(TBool aIsNotifying)				{ iIsNotifying = aIsNotifying; }
+TBool CConsoleAlarmAlertServer::IsNotifying()	const						{ return iIsNotifying; }
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/ConsoleAlarmAlertServer/Include/ConsoleAlarmAlertServerMain.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,54 @@
+// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __CONSOLEALARMALERTSERVERMAIN_H__
+#define __CONSOLEALARMALERTSERVERMAIN_H__
+
+// System includes
+#include <e32base.h>
+
+// User includes
+
+// Type definitions
+
+// Constants
+
+// Enumerations
+
+// Classes referenced
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// ----> ConsoleAlarmAlertServer (header)
+///////////////////////////////////////////////////////////////////////////////////////
+class ConsoleAlarmAlertServer
+/**
+@internalAll
+@released
+*/
+	{
+///////////////////////////////////////////////////////////////////////////////////////
+public:										// ACCESS
+///////////////////////////////////////////////////////////////////////////////////////
+	IMPORT_C static void					StartConsoleAlarmAlertServerL(TAny* instructionSet = NULL);
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// INTERNAL
+///////////////////////////////////////////////////////////////////////////////////////
+	static TInt								StartServerThreadFunction(TAny* instructionSet = NULL);
+	static void								StartServerL(TAny* instructionSet = NULL);
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/ConsoleAlarmAlertServer/Include/ConsoleAlarmAlertSession.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,137 @@
+// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __CONSOLEALARMALERTSESSION_H__
+#define __CONSOLEALARMALERTSESSION_H__
+
+// System includes
+#include <e32base.h>
+
+// User includes
+#include "asaltdefs.h"
+#include "asshdalarm.h"
+
+// Type definitions
+
+// Constants
+
+// Classes referenced
+class CConsoleAlarmAlertConsole;
+class CConsoleAlarmAlertLEDFlasher;
+class CConsoleAlarmAlertServer;
+// Enumerations
+
+
+struct TAgnAlarmInfo
+	/**
+	Copy of System-Wide Unique Agenda Entry Reference defined in agmalarm.h
+	*/
+	{
+	TUid iAlarmCategory;
+	TUint32 iAgnUniqueId;
+	TFileName iFileName;
+	};
+
+///////////////////////////////////////////////////////////////////////////////////////
+// ----> CConsoleAlarmAlertSession (header)
+///////////////////////////////////////////////////////////////////////////////////////
+class CConsoleAlarmAlertSession : public CSession2
+	{
+///////////////////////////////////////////////////////////////////////////////////////
+public:										// STATIC CONSTRUCT / DESTRUCT
+///////////////////////////////////////////////////////////////////////////////////////
+	static CConsoleAlarmAlertSession*		NewL(CConsoleAlarmAlertServer* aServer);
+	~CConsoleAlarmAlertSession();
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// INTERNAL CONSTRUCT
+///////////////////////////////////////////////////////////////////////////////////////
+	CConsoleAlarmAlertSession(CConsoleAlarmAlertServer* aServer);
+	void									ConstructL();
+
+///////////////////////////////////////////////////////////////////////////////////////
+public:										// ACCESS
+///////////////////////////////////////////////////////////////////////////////////////
+
+	TTime									DeferTime() const;
+
+	inline const TASShdAlarm& 				Alarm() const { return iAlarm; }
+
+	inline TInt								AlarmDataSize() const { return iAlarmAssociatedDataSize; }
+
+	inline const TAgnAlarmInfo&				AlarmData() const { return iAlarmData; }
+
+	void									Notify(TASAltAlertServerResponse aFlag);
+
+	void									Notify(TASAltAlertServerResponse aFlag, const TTime& aDeferTime);
+
+	TAny *									InstructionSet();
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// FROM CSession2
+///////////////////////////////////////////////////////////////////////////////////////
+	void									ServiceL(const RMessage2& aMessage);
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// CMD - DEBUG ONLY
+///////////////////////////////////////////////////////////////////////////////////////
+	TBool									CmdL();
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// INTERNAL METHODS
+///////////////////////////////////////////////////////////////////////////////////////
+
+	void									SetAlarmL(const RMessage2& aMessage);
+
+	void									GetUserTimeL(const RMessage2& aMessage);
+
+	void									SetDeferTimeL(const RMessage2& aMessage);
+
+	static TBool							SoundPlaybackCallbackL(TAny* aSelf);
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// MEMBER DATA
+///////////////////////////////////////////////////////////////////////////////////////
+
+	TTime									iDeferTime;
+
+	TASShdAlarm								iAlarm;
+
+	TInt									iAlarmAssociatedDataSize;
+
+	TAgnAlarmInfo							iAlarmData;
+
+	TBool									iLoggedOn;
+
+	TBool									iHasMessage;
+
+	TBool									iMsgComplete;
+
+	RMessage2								iMsgPtr;
+
+	CPeriodic*								iSoundCallbackTimer;
+
+	CConsoleAlarmAlertLEDFlasher*			iSoundLEDFlasher;
+
+	CConsoleAlarmAlertConsole*				iConsole;
+
+	CConsoleAlarmAlertServer*				iServer;
+
+	TAny*									iInstructionSet;
+
+	TBool									iInstructionSetFound;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/ConsoleAlarmAlertServer/Source/ConsoleAlarmAlertConsole.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,402 @@
+// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "consolealarmalertconsole.h"
+
+// System includes
+#include <e32twin.h>
+#include <e32base.h>
+#include <e32svr.h>
+
+// User includes
+#include "asaltdefs.h"
+#include "consolealarmalertsession.h"
+
+// Type definitions
+
+// Constants
+
+// Enumerations
+
+// Classes referenced
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// ----> CConsoleAlarmAlertConsole (source)
+///////////////////////////////////////////////////////////////////////////////////////
+
+//*************************************************************************************
+CConsoleAlarmAlertConsole::CConsoleAlarmAlertConsole(CConsoleAlarmAlertSession& aSession)
+:	CActive(CActive::EPriorityLow), iSession(aSession), iInstructionIndex(0)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+
+//*************************************************************************************
+CConsoleAlarmAlertConsole::~CConsoleAlarmAlertConsole()
+	{
+	Cancel();
+	Hide();
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertConsole::GetKey()
+	{
+	if	(iWin && !IsActive())
+		{
+		SetActive();
+		iWin->Read(iStatus);
+		}		
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertConsole::CancelKey()
+	{
+	if	(IsActive())
+		Cancel();
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertConsole::DecCounter()
+	{
+	if	(iTimeInterval > 0)
+		{
+		--iTimeInterval;
+		UpdateDisplay();
+		}
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertConsole::UpdateDisplay()
+	{
+	TBuf<180> buf;
+	_LIT(KEalwlAlarmSoundOff, "Off");
+	_LIT(KEalwlAlarmSoundOn, "On");
+	_LIT(KEalwlStatusEnabled, "Are");
+	_LIT(KEalwlStatusNotEnabled, "Are Not");
+	_LIT(KEalwlStatusIs, "Is");
+	_LIT(KEalwlStatusIsNo, "Is No");
+	//
+	if	(!iWin)
+		return;
+	iWin->SetCursorPosAbs(TPoint(0,0));
+
+	// MESSAGE
+	buf.Format(_L("Message : %S"), &iSession.Alarm().Message());
+	iWin->Write(buf);
+	iWin->ClearToEndOfLine();
+
+	// DATA
+	if	(iSession.Alarm().HasAssociatedData())
+		{
+		const TAgnAlarmInfo data = iSession.AlarmData();
+		const TUid KUidAgendaModelAlarmCategory = { 0x101F4A70 };
+		if (data.iAlarmCategory == KUidAgendaModelAlarmCategory)
+			{
+			_LIT(KEalwlAgendaData,"\ndata: agenda filename \"%S\"");
+			if (data.iFileName.Length() < 40)
+				buf.Format(KEalwlAgendaData,&data.iFileName);
+			else
+				{
+				TBuf<40> temp = data.iFileName.Left(40);
+				buf.Format(KEalwlAgendaData,&temp);
+				}
+			}
+		else
+			buf.Format(_L("\nAlarm has %d data bytes"), iSession.AlarmDataSize());
+		}
+	else
+		{
+		buf = _L("\nAlarm has no associated data");
+		}
+	iWin->Write(buf);
+	iWin->ClearToEndOfLine();
+
+	// DEFER TIME
+	if	(iSession.DeferTime() != Time::NullTTime())
+		{
+		TDateTime dateTime(iSession.DeferTime().DateTime());
+		buf.Format(_L("\nDefer   : %02d:%02d"), dateTime.Hour(), dateTime.Minute());
+		}
+	else
+		buf=_L("\nNULL defer time");
+	iWin->Write(buf);
+	iWin->ClearToEndOfLine();
+
+	// TIME INTERVAL
+	buf.Format(_L("\nCurrent time interval is %d minutes"), GetTimeInterval());
+	iWin->Write(buf);
+	iWin->ClearToEndOfLine();
+
+	// STATE FLAGS
+	buf.Format(_L("\nAlarm sounds are %S"),(iAlertState&EASAltStateFlagsSilentRunning)?&KEalwlAlarmSoundOff:&KEalwlAlarmSoundOn);
+	iWin->Write(buf);
+	iWin->ClearToEndOfLine();
+	buf.Format(_L("\nAlarm sounds %S paused"),(iAlertState&EASAltStateFlagsSoundIsPaused)?&KEalwlStatusEnabled:&KEalwlStatusNotEnabled);
+	iWin->Write(buf);
+	iWin->ClearToEndOfLine();
+	buf.Format(_L("\nAlarm sounds %S deferred"),(iAlertState&EASAltStateFlagsInQuietPeriod)?&KEalwlStatusEnabled:&KEalwlStatusNotEnabled);
+	iWin->Write(buf);
+	iWin->ClearToEndOfLine();
+	buf.Format(_L("\nThere %S more than one unacknowledged alarms"),(iAlertState&EASAltStateFlagsMoreThanOneDueAlarm)?&KEalwlStatusEnabled:&KEalwlStatusNotEnabled);
+	iWin->Write(buf);
+	iWin->ClearToEndOfLine();
+	buf.Format(_L("\nThere %S memory to snooze alarms"),(iAlertState&EASAltStateFlagsNoMemoryForSnoozeAlarm)?&KEalwlStatusIsNo:&KEalwlStatusIs);
+	iWin->Write(buf);
+	iWin->ClearToEndOfLine();
+	buf.Format(_L("\nThere %S an alarm sound to play"),(iAlertState&EASAltStateFlagsAlarmHasNoSoundFileName)?&KEalwlStatusIsNo:&KEalwlStatusIs);
+	iWin->Write(buf);
+	iWin->ClearToEndOfLine();
+
+	// COMMAND PROMPTS
+	iWin->Write(_L("\nENTER = Silence alarm          SPACE = Quiet Period"));
+	iWin->ClearToEndOfLine();
+	iWin->Write(_L("\nESCAPE = Acknowledge alarm     A = Acknowledge all"));
+	iWin->ClearToEndOfLine();
+	iWin->Write(_L("\nP = Pause alarm sound          TAB = Snooze alarm"));
+	iWin->ClearToEndOfLine();
+	iWin->Write(_L("\n1 = 1 min sound interval		 0 = 0 mins sound interval"));
+	iWin->ClearToEndOfLine();
+	iWin->Write(_L("\n+ = Increase int. and pause    - = Decrease int. and pause"));
+	iWin->ClearToEndOfLine();
+	iWin->Write(_L("\n! = Kill alarm alert server"));
+	iWin->ClearToEndOfLine();
+	iWin->Write(_L("\n"));
+	iWin->ClearToEndOfLine();
+	iWin->Write(_L("\r"));
+	//
+	if(!iSession.InstructionSet()) //Get user input if instruction set unspecified.
+		GetKey();
+	else if (iInstructionIndex >= static_cast<RArray<TInt>*>(iSession.InstructionSet())->Count()) //Get user input if program has already iterated thru entire instruction set.
+		GetKey();
+	else //Use the command in the instruction set, instead of waiting for user input.
+		{
+			if(!IsActive())
+			{
+			iStatus = KRequestPending;
+			TRequestStatus* ptrStatus = &iStatus;
+			User::RequestComplete( ptrStatus, KErrNone );
+			SetActive();
+			}
+		}
+	}
+
+//*************************************************************************************
+TInt CConsoleAlarmAlertConsole::GetTimeInterval() const
+	{
+	return(iTimeInterval);
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertConsole::SetVisibility(TInt aVis)
+	{
+	if	(!aVis)
+		Hide();
+	else if (!iWin)
+		{
+		// Create a new window, since cannot set order of console windows
+		CreateWin();
+		UpdateDisplay();
+		}
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertConsole::SetAlertState(TInt aFlags)
+	{
+	iAlertState = aFlags;
+	UpdateDisplay();
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertConsole::RunL()
+	{
+	if (iStatus.Int() == KErrCancel)
+		return;
+
+	__ASSERT_DEBUG(iWin, User::Invariant());
+	TInt key = iWin->KeyCode();
+	if(iSession.InstructionSet() && iInstructionIndex < static_cast<RArray<TInt>*>(iSession.InstructionSet())->Count())
+		{
+		RArray<TInt>* temp = static_cast<RArray<TInt>*>(iSession.InstructionSet());
+		key = (*temp)[iInstructionIndex++];
+		GetKey();
+		}
+	else
+		{
+		GetKey();
+		if ((key>=EKeyF1 && key<=EKeyF12) || key==EKeyTab)
+			{
+			DoDeferTime(EASAltAlertServerResponseSnooze);
+			}
+		}
+
+	switch (key)
+		{
+	// ACKNOWLEDGE CURRENT
+	case EKeyEscape:
+		iSession.Notify(EASAltAlertServerResponseClear);
+		return;
+	// ACKNOWLEDGE ALL
+	case 'a':
+	case 'A':
+		iSession.Notify(EASAltAlertServerResponseClearAll);
+		return;
+	// QUIET PERIOD
+	case EKeySpace:
+		DoDeferTime(EASAltAlertServerResponseQuietPeriod);
+		break;
+	// PAUSE SOUND
+	case 'p':
+	case 'P':
+		DoDeferTime(EASAltAlertServerResponsePauseSound);
+		break;
+	// SILENCE ALL SOUND
+	case EKeyEnter:
+		iSession.Notify(EASAltAlertServerResponseSilence);
+		break;
+	// INTERVAL 1 MINUTE
+	case '1':
+		iTimeInterval=1;
+		iSession.Notify(EASAltAlertServerResponsePauseSound);
+		break;
+	// INTERVAL 0 MINUTES
+	case '0':
+		iTimeInterval=0;
+		iSession.Notify(EASAltAlertServerResponsePauseSound);
+		break;
+	// PAUSE +
+	case '=':
+	case '+':
+		iTimeInterval++;
+		iSession.Notify(EASAltAlertServerResponsePauseSound);
+		break;
+	// PAUSE -
+	case '-':
+		iTimeInterval--;
+		iSession.Notify(EASAltAlertServerResponsePauseSound);
+		break;
+
+	// QUIT
+	case '!':
+		CActiveScheduler::Stop();
+		break;
+		}
+
+	TBuf<10> buf;
+	buf.Format(_L("'%c',"), key);
+	iWin->Write(buf);
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertConsole::DoCancel()
+	{
+	__ASSERT_DEBUG(iWin, User::Invariant());
+	iWin->ReadCancel();
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertConsole::Hide()
+	{
+	if	(iWin)
+		CancelKey(); 
+	//
+	delete iWin;
+	iWin = NULL;
+	//
+	if	(iCountDown)
+		iCountDown->Cancel();
+	//
+	delete iCountDown;
+	iCountDown=NULL;
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertConsole::CreateWin()
+	{
+	_LIT(KAlarmAlertConsoleCaption, "Test Alarm Alert Server Console");
+	//
+	__ASSERT_DEBUG(!iWin, User::Invariant());
+	__ASSERT_DEBUG(!iCountDown, User::Invariant());
+	//
+	TRAPD(trapCheck, iWin = Console::NewL(KAlarmAlertConsoleCaption, TSize(KConsFullScreen, KConsFullScreen)));
+	if	(trapCheck)
+		{
+		iWin=NULL;
+		return;
+		}
+	
+	TRAP(trapCheck, iCountDown = CPeriodic::NewL(CActive::EPriorityIdle));
+	if	(trapCheck)
+		{
+		iCountDown=NULL;
+		return;
+		}
+	//
+	const TTimeIntervalMicroSeconds32 interval(60000000);
+	iCountDown->Start(interval, interval, TCallBack(&CountDownCallBack, this));
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertConsole::DoDeferTime(TASAltAlertServerResponse aResponse)
+	{
+	if	(++iTimeInterval > 60)
+		{
+		iTimeInterval = 5;
+		User::Beep(440, 12);
+		}
+	//
+	TTime now;
+	now.HomeTime();
+	now += TTimeIntervalMinutes(iTimeInterval);
+	//
+	iSession.Notify(aResponse, now);
+	}
+
+
+//*************************************************************************************
+TBool CConsoleAlarmAlertConsole::CountDownCallBack(TAny* aSelf)
+	{
+	CConsoleAlarmAlertConsole& self = *reinterpret_cast<CConsoleAlarmAlertConsole*>(aSelf);
+	self.DecCounter();
+	//
+	return EFalse;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/ConsoleAlarmAlertServer/Source/ConsoleAlarmAlertLEDFlasher.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,129 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "consolealarmalertledflasher.h"
+
+// System includes
+#include <hal.h>
+
+// User includes
+#include "asaltdefs.h"
+
+// Type definitions
+
+// Constants
+const TInt KFlasherPeriodicity = 500000;
+
+// Enumerations
+
+// Classes referenced
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// ----> CConsoleAlarmAlertLEDFlasher (source)
+///////////////////////////////////////////////////////////////////////////////////////
+
+//*************************************************************************************
+CConsoleAlarmAlertLEDFlasher::CConsoleAlarmAlertLEDFlasher()
+:	CTimer(CActive::EPriorityIdle)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+
+//*************************************************************************************
+CConsoleAlarmAlertLEDFlasher* CConsoleAlarmAlertLEDFlasher::NewL()
+	{
+	CConsoleAlarmAlertLEDFlasher* self = new(ELeave) CConsoleAlarmAlertLEDFlasher();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+/**
+ * Start the flasher, if not busy
+ */
+TInt CConsoleAlarmAlertLEDFlasher::Start()
+	{
+	Stop();
+	After(KFlasherPeriodicity);
+	return(SetRedLedOn(ETrue));
+	}
+
+
+//*************************************************************************************
+/**
+ * Stop the LED flashing
+ */
+void CConsoleAlarmAlertLEDFlasher::Stop()
+	{
+	Cancel();
+	SetRedLedOn(EFalse);
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+/**
+ * @see CActive
+ */
+void CConsoleAlarmAlertLEDFlasher::RunL()
+	{
+	if (iStatus!=KErrNone)
+		{
+		SetRedLedOn(EFalse);
+		return;
+		}
+	SetRedLedOn(!iLedOn);
+	After(KFlasherPeriodicity);
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+/**
+ * Turn the LED on or off
+ */
+TInt CConsoleAlarmAlertLEDFlasher::SetRedLedOn(TBool aOn)
+	{
+	const TInt KClearAllLeds = 0;
+	const TInt KLedMaskRed1 = 1;
+
+	iLedOn = aOn;
+	if (iLedOn)
+		{
+		return HAL::Set(HAL::ELEDmask, KLedMaskRed1);
+		}
+	else
+		{
+		return HAL::Set(HAL::ELEDmask, KClearAllLeds);
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/ConsoleAlarmAlertServer/Source/ConsoleAlarmAlertServer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,131 @@
+// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "consolealarmalertserver.h"
+
+// System includes
+
+// User includes
+#include "asaltdefs.h"
+//
+#include "consolealarmalertsession.h"
+
+// Type definitions
+
+// Constants
+
+// Enumerations
+
+// Classes referenced
+
+// The Console Alarm Alert Server is migrated to a secure server in EKA2
+#include <e32base.h>
+
+
+
+const TUint KRangeCount = 1; 
+
+const TInt KOpCodeRanges[KRangeCount] = 
+	{	
+	0 // All Op Codes  from 0 to KMaxInt should pass. No restrictions	
+	};
+
+
+const TUint8 KElementsIndex[KRangeCount] =
+	{
+	CPolicyServer::EAlwaysPass, 	//All OP Codes Allways passing no capability required 
+	};
+
+
+const CPolicyServer::TPolicy KConsoleAlarmAlertServerPolicy =
+	{
+	CPolicyServer::EAlwaysPass, //specifies all connect attempts should pass
+	KRangeCount,
+	KOpCodeRanges,
+	KElementsIndex, 	// what each range is compared to 
+	KNullHandle			//Since we have no specific policy checking
+	};
+ 	
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// ----> CConsoleAlarmAlertServer (source)
+///////////////////////////////////////////////////////////////////////////////////////
+
+//*************************************************************************************
+CConsoleAlarmAlertServer::CConsoleAlarmAlertServer()
+ 	:CPolicyServer(CActive::EPriorityStandard, KConsoleAlarmAlertServerPolicy), iInstructionSet(NULL)
+	{
+	}
+
+
+
+//*************************************************************************************
+CConsoleAlarmAlertServer::~CConsoleAlarmAlertServer()
+	{
+	if (iAttachment)
+		delete iAttachment;	
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertServer::ConstructL()
+	{
+	StartL(KAlarmAlertServerName);
+	}
+
+
+//*************************************************************************************
+CConsoleAlarmAlertServer* CConsoleAlarmAlertServer::NewLC()
+	{
+	CConsoleAlarmAlertServer* self = new(ELeave) CConsoleAlarmAlertServer();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+CSession2* CConsoleAlarmAlertServer::NewSessionL(const TVersion& aVersion,const RMessage2& /*aMessage*/) const
+	{
+	const TVersion KServerVersion(KASAltVersionMajor, KASAltVersionMinor, KASAltVersionBuild);
+	if	(!User::QueryVersionSupported(KServerVersion, aVersion))
+		User::Leave(KErrNotSupported);
+	//
+	return CConsoleAlarmAlertSession::NewL((CConsoleAlarmAlertServer*)this);
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+TInt CConsoleAlarmAlertServer::RunError(TInt /*Error*/)
+	{
+	return KErrNone;
+	}
+
+void CConsoleAlarmAlertServer::SetAttachment(HBufC8* data)
+	{
+	if (iAttachment)
+		delete iAttachment;
+	iAttachment = data;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/ConsoleAlarmAlertServer/Source/ConsoleAlarmAlertServerMain.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,117 @@
+// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "consolealarmalertservermain.h"
+
+// System includes
+
+// User includes
+#include "asaltdefs.h"
+//
+#include "consolealarmalertserver.h"
+
+// Type definitions
+
+// Constants
+
+// Enumerations
+
+// Classes referenced
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// ----> ConsoleAlarmAlertServer (source)
+///////////////////////////////////////////////////////////////////////////////////////
+
+//*************************************************************************************
+EXPORT_C void ConsoleAlarmAlertServer::StartConsoleAlarmAlertServerL(TAny* instructionSet)
+	{
+	_LIT(KAlarmAlertServerThreadName, "ConsoleAlarmAlertServerThread");
+	//
+	const TInt KStackSize		= 0x0002000;	//  8KB
+	const TInt KInitHeapSize	= 0x0001000;	//  4KB
+	const TInt KHeapSize		= 0x1000000;	// 16MB
+	//
+	// Is the alarm alert server already running? If so, don't
+	// start a new one...
+	TFullName name;
+	TFindServer finder(KAlarmAlertServerName);
+	if	(finder.Next(name) == KErrNone)
+		return;
+	
+	RThread serverThread;
+	const TInt error = serverThread.Create(KAlarmAlertServerThreadName,
+										   &StartServerThreadFunction,
+										   KStackSize,
+										   KInitHeapSize,
+										   KHeapSize,
+										   instructionSet
+										  );
+	User::LeaveIfError(error);
+	//
+	serverThread.SetPriority(EPriorityMore);
+	serverThread.Resume();
+	//
+	User::After(2000000); // 2 seconds
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+TInt ConsoleAlarmAlertServer::StartServerThreadFunction(TAny* instructionSet)
+	{
+	__UHEAP_MARK;
+	//
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if	(!cleanup)
+		User::Invariant();
+	//
+	TRAPD(err, StartServerL(instructionSet));
+	delete cleanup;
+	//
+	__UHEAP_MARKEND;
+	return err;
+	}
+
+
+//*************************************************************************************
+void ConsoleAlarmAlertServer::StartServerL(TAny* instructionSet)
+	{
+	CActiveScheduler* scheduler = new CActiveScheduler();
+	CleanupStack::PushL(scheduler);
+	CActiveScheduler::Install(scheduler);
+	//
+
+	CConsoleAlarmAlertServer * tmp = CConsoleAlarmAlertServer::NewLC();
+	tmp->AddResponseArray(instructionSet);
+	CActiveScheduler::Start();
+	//
+	CleanupStack::PopAndDestroy(2, scheduler);
+	}
+
+
+
+
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// ----> ConsoleAlarmAlertServer (source)
+///////////////////////////////////////////////////////////////////////////////////////
+
+//*************************************************************************************
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/ConsoleAlarmAlertServer/Source/ConsoleAlarmAlertSession.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,330 @@
+// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "consolealarmalertsession.h"
+
+// System includes
+
+#include "e32svr.h"
+// User includes
+#include "asaltdefs.h"
+//#include "..\..\Test\ConsoleANTestClient.h"
+//
+#include "consolealarmalertsession.h"
+#include "consolealarmalertconsole.h"
+#include "consolealarmalertledflasher.h"
+#include "consolealarmalertserver.h" //for inter-session communication
+
+// Type definitions
+
+// Constants
+const TInt KSlot0 = 0;
+const TInt KSlot1 = 1;
+const TInt KSlot2 = 2;
+
+// Enumerations
+
+// Classes referenced
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// ----> CConsoleAlarmAlertSession (source)
+///////////////////////////////////////////////////////////////////////////////////////
+
+//*************************************************************************************
+CConsoleAlarmAlertSession::CConsoleAlarmAlertSession(CConsoleAlarmAlertServer* aServer)
+:	iServer(aServer), iInstructionSet(NULL), iInstructionSetFound(EFalse)
+	{
+	}
+
+
+//*************************************************************************************
+CConsoleAlarmAlertSession::~CConsoleAlarmAlertSession()
+	{
+	CConsoleAlarmAlertSession* session = iServer->WaitingSession();
+	session = NULL;
+	delete iSoundLEDFlasher;
+	delete iSoundCallbackTimer;
+	delete iConsole;
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertSession::ConstructL()
+	{
+	iSoundLEDFlasher = CConsoleAlarmAlertLEDFlasher::NewL();
+	iSoundCallbackTimer = CPeriodic::NewL(CActive::EPriorityIdle);
+	iConsole = new(ELeave) CConsoleAlarmAlertConsole(*this);
+	}
+
+
+//*************************************************************************************
+CConsoleAlarmAlertSession* CConsoleAlarmAlertSession::NewL(CConsoleAlarmAlertServer* aServer)
+	{
+	CConsoleAlarmAlertSession* self = new(ELeave) CConsoleAlarmAlertSession(aServer);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+TTime CConsoleAlarmAlertSession::DeferTime() const
+	{
+	return iDeferTime;
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertSession::Notify(TASAltAlertServerResponse aFlag)
+	{
+	if	(iHasMessage)
+		{
+		iMsgPtr.Complete(aFlag);
+		iHasMessage = EFalse;
+		}
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertSession::Notify(TASAltAlertServerResponse aFlag, const TTime& aDeferTime)
+	{
+	if	(iHasMessage)
+		{
+		TPckgC<TTime> time(aDeferTime);
+		TRAPD(err, iMsgPtr.WriteL(KSlot0, time));
+		__ASSERT_DEBUG(err == KErrNone, User::Invariant());
+		Notify(aFlag);
+		}
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertSession::ServiceL(const RMessage2& aMessage)
+	{
+	iMsgComplete = ETrue;
+	const TInt function = aMessage.Function();
+
+	//see if the server holds a set of instructions to be followed,
+	//rather than waiting for user input.
+	if(!iInstructionSetFound) //go look for it now.
+		{
+		//we will enter into this code only once
+		const CServer2* tmpServ = Server();
+		const CConsoleAlarmAlertServer* specific = reinterpret_cast<const CConsoleAlarmAlertServer*>(tmpServ);
+		iInstructionSet = const_cast<CConsoleAlarmAlertServer*>(specific)->ResponseArray();
+		iInstructionSetFound = ETrue;
+		}
+
+	//
+	switch(function)
+		{
+    case EASAltOpCodeNotify:
+    	{
+		__ASSERT_ALWAYS(!iHasMessage, User::Invariant());
+		iMsgComplete = EFalse;
+		iMsgPtr = aMessage;
+		iHasMessage = ETrue;
+		CConsoleAlarmAlertSession* session = iServer->WaitingSession();
+		session = this;
+		break;
+		}
+
+    case EASAltOpCodeNotifyCancel:
+		if	(iHasMessage)
+			{
+			iHasMessage=EFalse;
+			iMsgPtr.Complete(KErrCancel);
+			}
+		break;
+
+	case EASAltOpCodeVisible:
+		{
+		TBool isVisible = aMessage.Int0();
+		iConsole->SetVisibility(isVisible);
+		iServer->SetNotifying(isVisible);
+		break;
+		}
+
+    case EASAltOpCodeSetState:
+		iConsole->SetAlertState(aMessage.Int0());
+		break;
+
+    case EASAltOpCodeSetAlarm:
+		SetAlarmL(aMessage);
+		iConsole->iTimeInterval=0;
+		iConsole->UpdateDisplay();
+		break;
+
+	case EASAltOpCodeGetUserTime:
+		GetUserTimeL(aMessage);
+		break;
+
+	case EASAltOpCodeSetDeferTime:
+		SetDeferTimeL(aMessage);
+		iConsole->UpdateDisplay();
+		break;
+
+    case EASAltOpCodeLogon:
+		__ASSERT_ALWAYS(!iLoggedOn, User::Invariant());
+		iMsgComplete=EFalse;
+		iLoggedOn=ETrue;
+		break;
+
+	case EASAltOpCodeStartPlayingSound:
+		{
+		iSoundLEDFlasher->Start();
+		TCallBack callback(SoundPlaybackCallbackL, this);
+		iSoundCallbackTimer->Start(TTimeIntervalMicroSeconds32(0), TTimeIntervalMicroSeconds32(3000000), callback);
+		break;
+		}
+
+	case EASAltOpCodeStopPlayingSound:
+		iSoundLEDFlasher->Stop();
+		iSoundCallbackTimer->Cancel();
+		break;
+
+#if 0
+//Test code
+	case EASAltTestOpCodeAcknowledgeAlarm:
+		if (iServer->WaitingSession())
+			iServer->WaitingSession()->Notify(EASAltAlertServerResponseClear);
+		break;
+
+	case EASAltTestOpCodeGetAttachment:
+		{
+		if (iServer->Attachment() != NULL)
+			{
+			const TDes8& data = iServer->Attachment()->Des();
+			const TInt maxLength = static_cast<TInt>(aMessage.Int0());
+			if	(data.Size() > maxLength)
+				User::Panic(_L("Client's buffer is too short"), KErrOverflow);
+			else
+				{
+				if (data.Length() == 0)
+					{
+					_LIT8(KEmpty,"Empty");
+					aMessage.WriteL(KSlot1, KEmpty);
+					}
+				else
+					{
+					aMessage.WriteL(KSlot1, data);
+					}
+				iServer->SetAttachment(NULL);
+				}
+			}
+		}
+		break;
+
+	case EASAltTestOpCodeGetIsNotifying:
+		{
+		TPckgC<TBool> ret = iServer->IsNotifying();
+		aMessage.WriteL(KSlot0, ret);
+		break;
+		}
+#endif
+	default:
+		User::Invariant();
+		break;
+		}
+
+	if	(iMsgComplete)
+		aMessage.Complete(KErrNone);
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+TBool CConsoleAlarmAlertSession::CmdL()
+	{
+	return KErrNone;
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertSession::SetAlarmL(const RMessage2& aMessage)
+	{
+	TPckg<TASShdAlarm> pA(iAlarm);
+	aMessage.ReadL(KSlot0, pA);
+	if	(iAlarm.HasAssociatedData())
+		{
+		iAlarmAssociatedDataSize = aMessage.GetDesLength(2);
+		TPckg<TAgnAlarmInfo> pB(iAlarmData);
+		aMessage.ReadL(KSlot2, pB);
+
+		//Storing the data in the server for the test session to read..
+		HBufC8* data = HBufC8::NewLC(iAlarmAssociatedDataSize);
+		TPtr8 pData(data->Des());
+		aMessage.ReadL(KSlot2, pData);
+		iServer->SetAttachment(data);  //Server takes an ownership
+		CleanupStack::Pop(data);
+		}
+	else
+		iAlarmAssociatedDataSize = 0;
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertSession::GetUserTimeL(const RMessage2& aMessage)
+	{
+	TTime time;
+	time.HomeTime();
+	time+=TTimeIntervalMinutes(iConsole->GetTimeInterval());
+	TPtrC8 pTime((TUint8 *)&time,sizeof(TTime));
+	aMessage.WriteL(KSlot0,pTime);
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertSession::SetDeferTimeL(const RMessage2& aMessage)
+	{
+	TPckg<TTime> pTime(iDeferTime);
+	aMessage.ReadL(KSlot0, pTime);
+	}
+
+
+//*************************************************************************************
+TBool CConsoleAlarmAlertSession::SoundPlaybackCallbackL(TAny* /*aSelf*/)
+	{
+//	_LIT(KPlayingSound, "Playing sound");
+//	User::InfoPrint(KPlayingSound);
+	return ETrue;
+	}
+
+//**************************************************************************************
+TAny * CConsoleAlarmAlertSession::InstructionSet()
+	{
+	return iInstructionSet;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/ConsoleAlarmAlertServer/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,19 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// For ConsoleAlarmAlertServer
+// 
+//
+
+PRJ_TESTMMPFILES
+ConsoleAlarmAlertServer.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/Group/Smoketest_Timew.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,63 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// using relative paths for sourcepath and user includes
+// 
+//
+
+
+TARGET			Smoketest_Timew_Server.exe
+TARGETTYPE		exe
+UID				0x1000007A 0x101F7775
+
+#if (!defined __NO_VENDORID__)
+VENDORID		0x70000001
+#endif
+
+CAPABILITY		WriteUserData ReadUserData
+
+SOURCEPATH		..\Src
+
+SOURCE			TestTimewServer.cpp
+SOURCE			TestTimewSetAlarm.cpp
+SOURCE			TestTimewBase.cpp
+SOURCE			SM_ALM.CPP
+SOURCE			SM_UTL.CPP
+SOURCE			SM_MOD.CPP
+SOURCE			SM_RSP.CPP
+
+USERINCLUDE		..\Inc ..\..\Group
+USERINCLUDE		..\ConsoleAlarmAlertServer\Include
+
+
+SYSTEMINCLUDE	\Epoc32\include
+SYSTEMINCLUDE	\Epoc32\include\Test
+SYSTEMINCLUDE	\Epoc32\include\ecom
+
+library  		BAFL.LIB
+library			FBSCLI.LIB
+library			WS32.LIB
+library			CONE.LIB
+library			DIAL.LIB
+library			FEPBASE.LIB
+LIBRARY			apparc.lib
+LIBRARY			etext.lib
+LIBRARY			estor.lib
+LIBRARY			efsrv.lib
+
+library			AlarmClient.lib
+library			AlarmShared.lib
+library			EUSER.LIB
+LIBRARY			ecom.lib
+LIBRARY			TestExecuteUtils.lib
+LIBRARY			TestExecuteLogClient.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/Group/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,25 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// For Timew smoketest
+// 
+//
+
+PRJ_TESTEXPORTS
+
+../Scripts/setup_Smoketest_Timew.script	z:/smoketest/setup_smoketest_timew.script
+../Scripts/Smoketest_Timew.script		z:/smoketest/smoketest_timew.script
+../TestData/Smoketest_Timew.ini			z:/smoketest/smoketest_timew.ini
+
+PRJ_TESTMMPFILES
+Smoketest_Timew.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/Inc/ALMMOD.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,121 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __ALMMOD_H__
+#define __ALMMOD_H__
+
+// System includes
+#include <asclisession.h>
+
+// User includes
+#include "timewmod.h"
+
+// Constants
+const TInt KArrayOfAlarmIdsGranularity = 64;
+const TInt KPriorityAlarmIdleObserver=-0x0010;
+const TInt KPriorityAlarmResponder=-0x0005; // Idle observer priority must be lower than this
+
+//	The alarm model gives a general notification only
+//
+class CAlmIdleObserver : public CIdleObserver
+	{
+public:
+	static CAlmIdleObserver* NewL(MTimewModelObserver* aObserver,TInt aIdlePriority);
+	};
+
+class CAlmModel : public CModelBase
+	{
+public:
+	~CAlmModel();
+	static CAlmModel* NewL(MTimewModelObserver* aObserver,TInt aResponderPriority);
+	virtual void ProcessResponder(TInt aStatus);
+public:
+	TInt AlarmQuietPeriodMinutes() const;
+	TInt AlarmQuietPeriodSet(TInt aMinutes);
+	inline void AlarmQuietPeriodCancel();
+	TTime AlarmQuietPeriodEnd() const;
+	//
+	void AlarmSoundToggle();
+	TInt AlarmSoundStateSet(TBool aSoundOn);
+	TTimeWAlarmSoundState AlarmSoundState() const;
+	//
+	TInt ClockAlarmDelete(TInt aAlarmIndex);
+	TInt ClockAlarmEnable(TInt aAlarmIndex,TTimeWClockAlarmState aClockAlarmState);
+	TTimeWClockAlarmState ClockAlarmState(TInt aAlarmIndex) const;
+	TInt ClockAlarmSet(TInt aAlarmIndex,const TASShdAlarm& aInfo);
+	TInt ClockAlarmInfo(TInt aAlarmIndex,TASShdAlarm& aInfo);
+	//
+	void NextAlarmResetListL();
+	void NextAlarmClearList();
+	TInt NextAlarmNumber() const;
+	TInt NextAlarmDelete(TInt aIndex);
+	TBool NextAlarmCanDelete(TInt aIndex) const;
+	TInt NextAlarm(TFullName& aOwner, TASShdAlarm& aInfo) const;
+	TInt NextAlarmInfo(TInt aIndex, TFullName& aOwner, TASShdAlarm& aInfo) const;
+	//
+	TInt OrphanAlarmNumber() const;
+	inline TInt UnacknowledgedAlarmNumber() const;
+	//
+	void ReviewAlarmResetListL();
+	void ReviewAlarmClearList();
+	TInt ReviewAlarmNumber() const;
+	TInt ReviewAlarmInfo(TInt aIndex, TASShdAlarm& aInfo) const;
+
+private:
+	CAlmModel();
+	void ConstructL(MTimewModelObserver* aObserver,TInt aResponderPriority);
+
+private:
+
+	/**
+	 * The list of clock alarms. Note that although there is always 8
+	 * alarms in this list, not all will be active.
+	 */
+	RPointerArray<TASShdAlarm> iClockAlarms;
+
+	/**
+	 *
+	 */
+	RASCliSession iAlmSvr;
+
+	/**
+	 *
+	 */
+	TRequestStatus iStatus;
+
+	/**
+	 *
+	 */
+	RArray<TAlarmId> iNextAlarmIds;
+
+	/**
+	 *
+	 */
+	RArray<TAlarmId> iReviewAlarmIds;
+	};
+
+
+TInt CAlmModel::UnacknowledgedAlarmNumber() const
+	{
+	TInt count = iAlmSvr.AlarmCountByState(EAlarmStateWaitingToNotify);
+	return (count + iAlmSvr.AlarmCountByState(EAlarmStateNotifying));
+	}
+
+void CAlmModel::AlarmQuietPeriodCancel()
+	{
+	iAlmSvr.CancelAlarmSilence();
+	}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/Inc/ALMMOD.INL	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,79 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+//	class CAlmModel
+inline TAlarmSoundState CAlmModel::AlarmSoundState() const
+	{
+	return(iAlmSvr.AlarmSoundState());
+	}
+inline void CAlmModel::AlarmSoundStateSet(TBool aSoundOn)
+	{
+	iAlmSvr.SetAlarmSoundOn(aSoundOn);
+	}
+inline void CAlmModel::AlarmSoundToggle()
+	{
+	iAlmSvr.SetAlarmSoundOn(iAlmSvr.AlarmSoundState()==EAlarmSoundOff);
+	}
+inline TTime CAlmModel::AlarmQuietPeriodEnd() const
+	{
+	return(iAlmSvr.QuietPeriodUntil());
+	}
+inline void CAlmModel::AlarmQuietPeriodCancel()
+	{
+	iAlmSvr.QuietPeriodCancel();
+	}
+inline TInt CAlmModel::ClockAlarmDelete(TInt aClockAlarmNum)
+	{
+	__ASSERT_DEBUG(aClockAlarmNum<KMaxClockAlarms,Panic(EModelOutOfRange));
+	return(iAlmSvr.AlarmDelete(aClockAlarmNum));
+	}
+inline TAlarmSetState CAlmModel::ClockAlarmState(TInt aClockAlarmNum) const
+	{
+	__ASSERT_DEBUG(aClockAlarmNum<KMaxClockAlarms,Panic(EModelOutOfRange));
+	return(iAlmSvr.AlarmState(aClockAlarmNum));
+	}
+inline void CAlmModel::NextAlarmResetListL()
+	{
+	iAlmSvr.AlarmArrayPopulateL(*iNextAlarms,RAlarmServer::EArrayNext);
+	}
+inline void CAlmModel::NextAlarmClearList()
+	{
+	iNextAlarms->Reset();
+	}
+inline TInt CAlmModel::NextAlarmNumber() const
+	{
+	return(iAlmSvr.AlarmCount(RAlarmServer::ECountNext));
+	}
+inline void CAlmModel::ReviewAlarmResetListL()
+	{
+	iAlmSvr.AlarmArrayPopulateL(*iReviewAlarms,RAlarmServer::EArrayReview);
+	}
+inline void CAlmModel::ReviewAlarmClearList()
+	{
+	iReviewAlarms->Reset();
+	}
+inline TInt CAlmModel::ReviewAlarmNumber() const
+	{
+	return(iAlmSvr.AlarmCount(RAlarmServer::ECountReview));
+	}
+inline TInt CAlmModel::OrphanAlarmNumber() const
+	{
+	return(iAlmSvr.AlarmCount(RAlarmServer::ECountOrphan));
+	}
+inline TInt CAlmModel::UnacknowledgedAlarmNumber() const
+	{
+	return(iAlmSvr.AlarmCount(RAlarmServer::ECountUnacknowledged));
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/Inc/SM_STD.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,68 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __SM_STD_H__
+#define __SM_STD_H__
+
+// System includes
+#include <e32base.h>
+#include <t32wld.h>
+#include <asclisession.h>
+#include <asshdalarm.h>
+
+// User includes
+#include "timewmod.h"
+
+class CModelResponder : public CActive
+	{
+public:
+	void Start();
+	virtual void RunL();
+	virtual void DoStart()=0;
+	virtual void DoCancel()=0;
+protected:
+	CModelResponder(CModelBase &aModel,TInt aPriority);
+private:
+	void NotifyModel(TInt aNotification);
+private:
+	CModelBase *iModel;
+	};
+
+class CAlmModel;
+class CAlmResponder : public CModelResponder
+	{
+public:
+	CAlmResponder(RASCliSession& aSvr,CAlmModel& aModel,TInt aResponderPriority);
+public:
+	virtual void DoStart();
+	virtual void DoCancel();
+private:
+	TAlarmId iAlarmId;
+	RASCliSession* iAlmSvr;
+	};
+
+class CWldModel;
+class CWldResponder : public CModelResponder
+	{
+public:
+	CWldResponder(RWorldServer& aSvr,CWldModel& aModel,TInt aResponderPriority);
+public:
+	virtual void DoStart();
+	virtual void DoCancel();
+protected:
+	RWorldServer* iWldSvr;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/Inc/TIMEWMOD.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,145 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __TIMEWMOD_H__
+#define __TIMEWMOD_H__
+
+// System includes
+#include <e32base.h>
+
+// Constants
+const TInt KMaxClockAlarms = 8;
+
+/**
+ * From the old T32Alm.h file. Encapsulates the idea of
+ * a "Not set" alarm, which the new AlarmServer doesn't
+ * support.
+ */
+enum TTimeWClockAlarmState
+	{
+	ETimeWClockAlarmStateNotSet = 0,
+	ETimeWClockAlarmStateSet,
+	ETimeWClockAlarmStateDisabled
+	};
+
+/**
+ *
+ */
+enum TTimeWAlarmSoundState
+	{
+	ETimeWAlarmSoundOn = 0,
+	ETimeWAlarmSoundOff,
+	ETimeWAlarmQuietPeriod
+	};
+
+/**
+ *
+ */
+enum TInternalClockAlarmFlags
+	{
+	EClockAlarmFlagsIsSet		= 1
+	};
+
+enum TModelPanic
+	{
+	EModelWorld = 0,
+	EModelObserver,
+	EModelOutOfRange,
+	EModel
+	};
+enum TModelFault
+	{
+	EModelfIdleObj = 0,
+	EModelfPriorityInvalid,
+	EModelfIdleArgument,
+	EModelfNoNotifier,
+	EModelfOutOfRange,
+	EModelfTime,
+	EModelfTryingToChangeStateOfNullClockAlarm,
+	EModelfTryingToGetInfoAboutNullClockAlarm,
+	EModelfTryingToOrphanClockAlarm
+	};
+
+GLREF_C void Panic(TModelPanic aPanic);
+GLREF_C void Fault(TModelFault aFault);
+
+class MTimewModelObserver
+	{
+public:
+	virtual void HandleUpdate(TInt aNotification)=0;
+	};
+
+class CIntermediateObserver : public CBase, public MTimewModelObserver
+	{
+public:
+	CIntermediateObserver();
+	virtual void HandleUpdate(TInt aNotification);
+	void SetTimewModelObserver(MTimewModelObserver* aObserver);
+protected:
+	void Notify(TInt aNotification);
+private:
+	MTimewModelObserver* iObserver;
+	};
+
+class CIdleObserver : public CIntermediateObserver
+	{
+public:
+	CIdleObserver();
+	~CIdleObserver();
+	void ConstructL(MTimewModelObserver* aObserver,TInt aPriority);
+public:
+	void CancelIdleRefresh();
+	virtual void HandleUpdate(TInt aNotification);
+protected:
+	virtual void DoIdleCancel();
+	virtual void DoIdleNotify();
+private:
+	void StartIdleRefresh();
+	static TInt IdleCallBack(TAny* aPtr);
+private:
+	TInt iNotification;
+	CIdle* iIdle;
+	};
+
+class CModelResponder;
+class CModelBase : public CBase
+	{
+protected:
+	CModelBase();
+
+public:
+	~CModelBase();
+
+public:
+	void Stop();
+	void Start();
+	void SetTimewModelObserver(MTimewModelObserver* aObserver);
+
+protected:
+	void Notify(TInt aNotification);
+	virtual void ProcessResponder(TInt aStatus)=0;
+	void SetResponderActive(CModelResponder* aResponder);
+
+private:
+	void DoObserverNotify(TInt aNotification);
+
+private:
+	TBool iDoingViewNotify;
+	MTimewModelObserver* iObserver;
+	CModelResponder* iResponder;
+	friend class CModelResponder;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/Inc/TestTimewBase.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,39 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestTimewBase which is the base class for all
+// the Psd Agx suite test steps
+// 
+//
+
+#ifndef TEST_TIMEW_BASE_H
+#define TEST_TIMEW_BASE_H
+
+#include "almmod.h"
+#include <TestExecuteStepBase.h>
+
+
+class CTestTimewBase : public CTestStep
+{
+public:
+	CTestTimewBase();
+	~CTestTimewBase();
+	virtual enum TVerdict	doTestStepPreambleL();
+	virtual enum TVerdict	doTestStepPostambleL();	CAlmModel*				Model();
+
+private:
+	CActiveScheduler*	iSchedular;
+
+protected:	CAlmModel*			iModel;};
+
+#endif /* TEST_TIMEW_BASE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/Inc/TestTimewServer.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,33 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestTimewServer
+// 
+//
+
+#ifndef TEST_TIMEW_SERVER_H
+#define TEST_TIMEW_SERVER_H
+
+#include <TestExecuteServerBase.h>
+
+class  CTestTimewServer : public CTestServer
+{
+public:
+	static CTestTimewServer*	NewL();
+	virtual CTestStep*			CreateTestStep(const TDesC& aStepName);
+
+private:
+	void	ConstructL();
+};
+
+#endif /* TEST_TIMEW_SERVER_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/Inc/TestTimewSetAlarm.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,38 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestTimewSetAlarm
+// 
+//
+
+#ifndef TEST_TIMEW_SET_ALARM_H
+#define TEST_TIMEW_SET_ALARM_H
+
+#include "TestTimewBase.h"
+#include <asshdalarm.h>
+
+class CTestTimewSetAlarm : public CTestTimewBase
+{
+public:
+	CTestTimewSetAlarm();
+	virtual ~CTestTimewSetAlarm();
+
+public:
+	virtual enum TVerdict doTestStepL( void );
+
+private:
+	void	SetAlarmL( void );
+	TASShdAlarm iAlarmData;
+};
+
+#endif /* TEST_TIMEW_SET_ALARM_H */
Binary file Timew/ReadMe.doc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/Scripts/Smoketest_Timew.script	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,23 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRINT Run Timew smoketest
+//
+LOAD_SUITE Smoketest_Timew_Server
+//
+START_TESTCASE 8979
+RUN_TEST_STEP 1000	Smoketest_Timew_Server	SetAlarm		c:\Smoketest\Smoketest_Timew.ini	24560_SetAlarm
+END_TESTCASE 8979
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/Scripts/setup_Smoketest_Timew.script	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,22 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+RUN_UTILS MkDir c:\Smoketest\
+
+RUN_UTILS CopyFile z:\smoketest\smoketest_timew.ini	c:\smoketest\smoketest_timew.ini
+RUN_UTILS MakeReadWrite c:\smoketest\smoketest_timew.ini
+
+// RUN_SCRIPT Smoketest_Timew.script
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/Src/SM_ALM.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,489 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "almmod.h"
+#include "sm_std.h"
+#include <ecom.h>
+
+//
+//	class CAlmModel
+//
+
+CAlmModel::CAlmModel()
+//
+//	Constructor
+//
+	{
+	}
+
+CAlmModel::~CAlmModel()
+//
+//	Destructor
+//
+	{
+	Stop();
+	iClockAlarms.ResetAndDestroy();
+	iClockAlarms.Close();
+	iReviewAlarmIds.Close();
+	iNextAlarmIds.Close();
+	iAlmSvr.Close();
+ 	REComSession::FinalClose();
+	}
+
+void CAlmModel::ConstructL(MTimewModelObserver* aObserver,TInt aResponderPriority)
+//
+//	Construct the alarm engine components
+//
+	{
+	SetTimewModelObserver(aObserver);
+	//
+	iReviewAlarmIds = RArray<TAlarmId>(KArrayOfAlarmIdsGranularity);
+	iNextAlarmIds = RArray<TAlarmId>(KArrayOfAlarmIdsGranularity);
+	//
+	const TInt r = iAlmSvr.Connect();
+	User::LeaveIfError(r);
+	//
+	TInt i;
+	iClockAlarms = RPointerArray<TASShdAlarm>(KMaxClockAlarms);
+	for(i=0; i<KMaxClockAlarms; i++)
+		{
+		TASShdAlarm* blankAlarm = new(ELeave) TASShdAlarm();
+		CleanupStack::PushL(blankAlarm);
+		User::LeaveIfError(iClockAlarms.Append(blankAlarm));
+		CleanupStack::Pop(blankAlarm);
+		}
+
+	// Identify any clock alarms in the alarm server and put them
+	// into the slots.
+
+	// Fetch
+	RArray<TAlarmId> clockIds(KMaxClockAlarms);
+	CleanupClosePushL(clockIds);
+	iAlmSvr.GetAlarmIdListForCategoryL(KASCliCategoryClock, clockIds);
+
+	// Put them in the slots - we can only display KMaxClockAlarms alarms
+	// so any beyond that are ignored.
+	TInt slotsUsedSoFar = 0;
+	const TInt count = Min(KMaxClockAlarms, clockIds.Count());
+	for(i=0; i<count; i++)
+		{
+		TASShdAlarm* alarm = iClockAlarms[slotsUsedSoFar];
+		User::LeaveIfError(iAlmSvr.GetAlarmDetails(clockIds[i], *alarm));
+
+		// Only show alarms which haven't yet notified
+		if	(alarm->State() != EAlarmStateNotified)
+			{
+			// If we don't do this, then the alarm slot is treated
+			// as available.
+			++slotsUsedSoFar;
+			alarm->ClientFlags().Set(EClockAlarmFlagsIsSet);
+			}
+		}
+	CleanupStack::PopAndDestroy(&clockIds);
+	//
+	CAlmResponder* pR=new(ELeave) CAlmResponder(iAlmSvr,*this,aResponderPriority);
+	SetResponderActive(pR);
+	}
+
+CAlmModel* CAlmModel::NewL(MTimewModelObserver* aObserver,TInt aResponderPriority)
+//
+//	Create a new alarm engine
+//
+	{
+	CAlmModel* model=new(ELeave) CAlmModel;
+	CleanupStack::PushL(model);
+	model->ConstructL(aObserver,aResponderPriority);
+	CleanupStack::Pop(model);
+	return(model);
+	}
+
+void CAlmModel::ProcessResponder(TInt aStatus)
+//
+//	Interpret responder status
+//
+	{
+	// FIX
+	if (aStatus!=KErrCancel && aStatus!=KErrNone)
+		Notify(aStatus);
+	else
+		Notify(0);
+	}
+
+TInt CAlmModel::AlarmQuietPeriodMinutes() const
+//
+//	Return the time that sound is delayed until
+//
+	{
+	TTime timeNow;
+	timeNow.HomeTime();
+	TTime timeQuiet=AlarmQuietPeriodEnd();
+	TInt quietMinutes;
+	if (timeQuiet<=timeNow || timeQuiet==Time::NullTTime())
+		quietMinutes=0;
+	else
+		{
+		TTimeIntervalMinutes minutes;
+		timeQuiet.MinutesFrom(timeNow,minutes);
+		quietMinutes=minutes.Int()+1;
+		}
+	return(quietMinutes);
+	}
+
+TInt CAlmModel::AlarmQuietPeriodSet(TInt aMinutes)
+//
+//	Delay alarm sounds for a given number of minutes
+//
+	{
+	TInt ret = KErrNone;
+	//
+	if	(!aMinutes)
+		ret = iAlmSvr.CancelAlarmSilence();
+	else
+		ret = iAlmSvr.SetAlarmSoundsSilentFor(TTimeIntervalMinutes(aMinutes));
+	//
+	return ret;
+	}
+
+TInt CAlmModel::ClockAlarmEnable(TInt aAlarmIndex, TTimeWClockAlarmState aClockAlarmState)
+//
+//	Enable or disable a clock alarm
+//
+	{
+	__ASSERT_DEBUG(aAlarmIndex < KMaxClockAlarms, Panic(EModelOutOfRange));
+	//
+	TAlarmStatus newStatus;
+	switch(aClockAlarmState)
+		{
+	case ETimeWClockAlarmStateNotSet:
+		return ClockAlarmDelete(aAlarmIndex);
+
+	case ETimeWClockAlarmStateSet:
+		newStatus = EAlarmStatusEnabled;
+		break;
+
+	default:
+	case ETimeWClockAlarmStateDisabled:
+		newStatus = EAlarmStatusDisabled;
+		break;
+		}
+
+	TASShdAlarm* alarm = iClockAlarms[aAlarmIndex];
+	__ASSERT_ALWAYS(alarm->Id() != KNullAlarmId, Fault(EModelfTryingToChangeStateOfNullClockAlarm));
+	TInt error = iAlmSvr.SetAlarmStatus(alarm->Id(), newStatus);
+	if	(error != KErrNone)
+		return error;
+
+	// Refetch alarm from server (will update status)
+	error = iAlmSvr.GetAlarmDetails(alarm->Id(), *alarm);
+	if	(error == KErrNone)
+		alarm->ClientFlags().Set(EClockAlarmFlagsIsSet);
+	return error;
+	}
+
+TInt CAlmModel::ClockAlarmSet(TInt aAlarmIndex, const TASShdAlarm& aInfo)
+//
+//	Set a clock alarm
+//
+	{
+	__ASSERT_DEBUG(aAlarmIndex < KMaxClockAlarms, Panic(EModelOutOfRange));
+	//
+	TInt error = KErrNone;
+	TASShdAlarm* alarm = iClockAlarms[aAlarmIndex];
+	if	(alarm->Id() != KNullAlarmId)
+		{
+		// There is already an alarm set in this slot. Delete
+		// the old, replace it with the new.
+		error = iAlmSvr.AlarmDelete(alarm->Id());
+		if	(error != KErrNone)
+			return error;
+		alarm->ClientFlags().Clear(EClockAlarmFlagsIsSet);
+		}
+
+	// Add alarm (will also update cached alarm details)
+	*alarm = aInfo;
+	alarm->Category() = KASCliCategoryClock;
+	error = iAlmSvr.AlarmAdd(*alarm);
+	if	(error == KErrNone)
+		alarm->ClientFlags().Set(EClockAlarmFlagsIsSet);
+	return error;
+	}
+
+TInt CAlmModel::ClockAlarmInfo(TInt aAlarmIndex,TASShdAlarm& aInfo)
+//
+//	Get information about a clock alarm
+//
+	{
+	__ASSERT_DEBUG(aAlarmIndex < KMaxClockAlarms, Panic(EModelOutOfRange));
+	//
+	TInt error = KErrNone;
+	aInfo = *(iClockAlarms[aAlarmIndex]);
+	if	(aInfo.Id() != KNullAlarmId && aInfo.ClientFlags().IsSet(EClockAlarmFlagsIsSet))
+		{
+		// Preserve flags
+		const TBitFlags16 flags = aInfo.ClientFlags();
+
+		// Fetch alarm details
+		error = iAlmSvr.GetAlarmDetails(aInfo.Id(), aInfo);
+
+		// Restore flags
+		if	(error == KErrNone)
+			{
+			// Has the alarm already notified?
+			if	(aInfo.State() != EAlarmStateQueued && aInfo.State() != EAlarmStateNotifying)
+				{
+				// Treat this slot as free
+				TASShdAlarm* alarm = iClockAlarms[aAlarmIndex];
+				alarm->Reset();
+				aInfo = *alarm;
+				}
+			else
+				aInfo.ClientFlags() = flags;
+			}
+		else if (error == KErrNotFound)
+			{
+			// Alarm has been deleted
+			TASShdAlarm* alarm = iClockAlarms[aAlarmIndex];
+			alarm->Reset();
+			aInfo = *alarm;
+			}
+		}
+	return error;
+	}
+
+TInt CAlmModel::ClockAlarmDelete(TInt aClockAlarmNum)
+	{
+	__ASSERT_DEBUG(aClockAlarmNum < KMaxClockAlarms, Panic(EModelOutOfRange));
+	TASShdAlarm* alarm = iClockAlarms[aClockAlarmNum];
+	__ASSERT_ALWAYS(alarm->Id() != KNullAlarmId, Fault(EModelfTryingToChangeStateOfNullClockAlarm));
+	const TInt error = iAlmSvr.AlarmDelete(alarm->Id());
+	if	(error == KErrNone || error == KErrNotFound)
+		{
+		// Update cached representation of deleted alarm
+		alarm->Reset();
+		}
+	return error;
+	}
+
+TTimeWClockAlarmState CAlmModel::ClockAlarmState(TInt aClockAlarmNum) const
+	{
+	__ASSERT_DEBUG(aClockAlarmNum < KMaxClockAlarms, Panic(EModelOutOfRange));
+	//
+	const TASShdAlarm* alarm = iClockAlarms[aClockAlarmNum];
+	if	(alarm->ClientFlags().IsSet(EClockAlarmFlagsIsSet))
+		{
+		switch(alarm->Status())
+			{
+		case EAlarmStatusEnabled:
+			return ETimeWClockAlarmStateSet;
+		case EAlarmStatusDisabled:
+			return ETimeWClockAlarmStateDisabled;
+			}
+		}
+	return ETimeWClockAlarmStateNotSet;
+	}
+
+void CAlmModel::NextAlarmResetListL()
+//
+//	Fetch a list of ids of all the alarms that are pending
+//	within the alarm server.
+//
+	{
+	iAlmSvr.GetAlarmIdListByStateL(EAlarmStateQueued, iNextAlarmIds);
+	}
+
+void CAlmModel::NextAlarmClearList()
+	{
+	iNextAlarmIds.Reset();
+	}
+
+TInt CAlmModel::NextAlarmNumber() const
+	{
+	return iAlmSvr.NumberOfAlarmsActiveInQueue();
+	}
+
+TInt CAlmModel::NextAlarmDelete(TInt aIndex)
+//
+//	Delete one of the next alarms
+//
+	{
+	TInt ret = KErrNotFound;
+	if	(aIndex < iNextAlarmIds.Count())
+		{
+		const TAlarmId id = iNextAlarmIds[aIndex];
+		ret = iAlmSvr.AlarmDelete(id);
+		}
+	return ret;
+	}
+
+TBool CAlmModel::NextAlarmCanDelete(TInt aIndex) const
+//
+//	Determine whether can delete the specified alarm.
+//
+	{
+	__ASSERT_DEBUG(aIndex < iNextAlarmIds.Count(), Panic(EModelOutOfRange));
+	//
+	const TAlarmId id = iNextAlarmIds[aIndex];
+	//
+	TASShdAlarm alarm;
+	if	(iAlmSvr.GetAlarmDetails(id, alarm) == KErrNone)
+		{
+		return (
+			alarm.Category() == KASCliCategoryClock ||
+			alarm.State() == EAlarmStateSnoozed ||
+			!alarm.HasOwningSession()
+			);
+		}
+	return EFalse;
+	}
+
+TInt CAlmModel::NextAlarm(TFullName& aOwner, TASShdAlarm& aInfo) const
+//
+//	Get information about the next alarm
+//
+	{
+	aOwner = KNullDesC;
+	//
+	TAlarmId id = KNullAlarmId;
+	TInt ret = iAlmSvr.GetNextDueAlarmId(id);
+	if	(ret == KErrNone)
+		{
+		if	(id == KNullAlarmId)
+			{
+			aInfo.Reset();
+			ret = KErrNotFound;
+			}
+		else
+			{
+			ret = iAlmSvr.GetAlarmDetails(id, aInfo);
+			if	(ret == KErrNone)
+				ret = iAlmSvr.GetAlarmOwner(id, aOwner);
+			}
+		}
+	return ret;
+	}
+
+TInt CAlmModel::NextAlarmInfo(TInt aIndex, TFullName& aOwner, TASShdAlarm& aInfo) const
+//
+//	Get info about the next alarm
+//
+	{
+	TInt ret = KErrNotFound;
+	if	(aIndex < iNextAlarmIds.Count())
+		{
+		const TAlarmId id = iNextAlarmIds[aIndex];
+		ret = iAlmSvr.GetAlarmDetails(id, aInfo);
+		if	(ret == KErrNone)
+			{
+			ret = iAlmSvr.GetAlarmOwner(id, aOwner);
+			}
+		}
+	return ret;
+	}
+
+void CAlmModel::ReviewAlarmResetListL()
+	{
+	iAlmSvr.GetAlarmIdListByStateL(EAlarmStateNotified, iReviewAlarmIds);
+	}
+
+void CAlmModel::ReviewAlarmClearList()
+	{
+	iReviewAlarmIds.Reset();
+	}
+
+TInt CAlmModel::ReviewAlarmNumber() const
+	{
+	return iAlmSvr.AlarmCountByState(EAlarmStateNotified);
+	}
+
+TInt CAlmModel::ReviewAlarmInfo(TInt aIndex, TASShdAlarm& aInfo) const
+//
+//	Get information about a past alarm
+//
+	{
+	TInt ret = KErrNotFound;
+	if	(aIndex < iReviewAlarmIds.Count())
+		{
+		const TAlarmId id = iReviewAlarmIds[aIndex];
+		ret = iAlmSvr.GetAlarmDetails(id, aInfo);
+		}
+	return ret;
+	}
+
+void CAlmModel::AlarmSoundToggle()
+	{
+	TTimeWAlarmSoundState soundState = AlarmSoundState();
+	if	(soundState == ETimeWAlarmSoundOn)
+		AlarmSoundStateSet(EFalse);
+	else
+		AlarmSoundStateSet(ETrue);
+	}
+
+TInt CAlmModel::AlarmSoundStateSet(TBool aSoundOn)
+	{
+	TAlarmGlobalSoundState state = EAlarmGlobalSoundStateOn;
+	if	(!aSoundOn)
+		state = EAlarmGlobalSoundStateOff;
+
+	return iAlmSvr.SetAlarmSoundState(state);
+	}
+
+TTimeWAlarmSoundState CAlmModel::AlarmSoundState() const
+	{
+	// First check whether we're in a silent period
+	if	(iAlmSvr.AlarmSoundsTemporarilySilenced())
+		return ETimeWAlarmQuietPeriod;
+
+	// We're not, so check global sound state and map
+	// to TimeW settings
+	TAlarmGlobalSoundState state = EAlarmGlobalSoundStateOff;
+	if	(iAlmSvr.GetAlarmSoundState(state) == KErrNone)
+		{
+		if	(state == EAlarmGlobalSoundStateOn)
+			return ETimeWAlarmSoundOn;
+		}
+	return ETimeWAlarmSoundOff;
+	}
+
+TTime CAlmModel::AlarmQuietPeriodEnd() const
+	{
+	TTime endTime;
+	if	(iAlmSvr.GetAlarmSoundsSilentUntil(endTime) == KErrNone)
+		return endTime;
+	//
+	endTime.HomeTime();
+	return endTime;
+	}
+
+TInt CAlmModel::OrphanAlarmNumber() const
+	{
+	// Get the alarms
+	RArray<TAlarmId> clockIds(KMaxClockAlarms);
+	CleanupClosePushL(clockIds);
+	iAlmSvr.GetAlarmIdListForCategoryL(KASCliCategoryClock, clockIds);
+
+	//which are orphaned?
+	TInt count = clockIds.Count();
+	TInt orphaned = 0;
+	for	(TInt ii=0; ii<count; ii++)
+		{
+		TASShdAlarm alarm;
+		iAlmSvr.GetAlarmDetails(clockIds[ii], alarm);
+		if	(alarm.HasBecomeOrphaned())
+			orphaned++;
+		}
+	CleanupStack::PopAndDestroy(&clockIds);
+
+	return orphaned;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/Src/SM_MOD.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,87 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "sm_std.h"
+
+CModelBase::CModelBase()
+//
+//	Protected constructor
+//
+	{
+	}
+
+CModelBase::~CModelBase()
+//
+//	destructor
+//
+	{
+	delete(iResponder);
+	}
+
+void CModelBase::Notify(TInt aNotification)
+//
+//	Funnel for all calls to the notifier
+//
+	{
+	if (!iDoingViewNotify && iObserver)
+		DoObserverNotify(aNotification);
+	}
+
+void CModelBase::DoObserverNotify(TInt aNotification)
+//
+//	Single function that actually calls the view notifier
+//
+	{
+	__ASSERT_DEBUG(iObserver,Fault(EModelfNoNotifier));
+	iDoingViewNotify=ETrue;
+	iObserver->HandleUpdate(aNotification);
+	iDoingViewNotify=EFalse;
+	}
+
+void CModelBase::SetResponderActive(CModelResponder* aResponder)
+//
+//	Set the engines responder
+//
+	{
+	iResponder=aResponder;
+	if (iResponder)
+		CActiveScheduler::Add(iResponder);
+	}
+
+void CModelBase::Start()
+//
+//	Start the responder
+//	The engine requires that an active scheduler be installed
+//
+	{
+	iResponder->Start();
+	}
+
+void CModelBase::Stop()
+//
+//	Stop the responder and the engine
+//
+	{
+	if (iResponder)
+		iResponder->Cancel();
+	}
+
+void CModelBase::SetTimewModelObserver(MTimewModelObserver *aObserver)
+//
+//	Register the observer of the engine
+//
+	{
+	iObserver=aObserver;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/Src/SM_RSP.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,90 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "sm_std.h"
+#include "almmod.h"
+
+//
+//	class CModelResponder
+//
+
+CModelResponder::CModelResponder(CModelBase& aModel,TInt aPriority)
+//
+//	Base class constructor
+//
+	: CActive(aPriority), iModel(&aModel)
+	{
+	}
+
+void CModelResponder::NotifyModel(TInt aStatus)
+//
+//	Funnel all response to the engine
+//
+	{
+	iModel->ProcessResponder(aStatus);
+	}
+
+void CModelResponder::RunL()
+//
+//	Handle changes in the servers
+//
+	{
+//	Reset the status request before notifiying the view
+//	so that it can catch anything untoward that the view does
+	TInt v=iStatus.Int();
+	Start();
+	NotifyModel(v);
+	}
+
+void CModelResponder::Start()
+//
+//	Start the response
+//
+	{
+	if (!IsActive())
+		{
+		SetActive();
+		DoStart();
+		}
+	}
+
+//
+//	class CAlmResponder
+//
+
+CAlmResponder::CAlmResponder(RASCliSession& aSvr,CAlmModel& aModel,TInt aResponderPriority)
+//
+//	Protected constructor
+//
+	: CModelResponder(aModel,aResponderPriority),iAlmSvr(&aSvr)
+	{
+	}
+
+void CAlmResponder::DoStart()
+//
+//	Start a repsonse
+//
+	{
+	iAlmSvr->NotifyChange(iStatus, iAlarmId);
+	}
+
+void CAlmResponder::DoCancel()
+//
+//	Stop the response
+//
+	{
+	if	(iStatus == KRequestPending)
+		iAlmSvr->NotifyChangeCancel();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/Src/SM_UTL.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,33 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "sm_std.h"
+
+
+GLDEF_C void Panic(TModelPanic aPanic)
+//
+//	Panic in the engine
+//
+	{
+	User::Panic(_L("TW-ENG-PANIC"),aPanic);
+	}
+
+GLDEF_C void Fault(TModelFault aFault)
+//
+//	Fault in the engine
+//
+	{
+	User::Panic(_L("TW-ENG-FAULT"),aFault);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/Src/TestTimewBase.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,62 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestTimewCase which is the base class for all the Timew TestCase DLL
+// 
+//
+
+// EPOC includes
+#include <e32base.h>
+#include <Uri16.h>
+#include <UriUtils.h>
+#include <TestExecuteLog.h>
+#include "TestTimewbase.h"
+
+CTestTimewBase::CTestTimewBase()
+: CTestStep()
+, iSchedular(NULL)
+, iModel(NULL)
+	{
+	}
+
+// destructor
+CTestTimewBase::~CTestTimewBase()
+	{
+	delete iSchedular;
+	iSchedular=NULL;
+	}
+
+enum TVerdict CTestTimewBase::doTestStepPreambleL()
+	{
+	iSchedular=new CActiveScheduler();
+	CActiveScheduler::Install(iSchedular);
+
+	return CTestStep::doTestStepPreambleL();
+	}
+
+enum TVerdict CTestTimewBase::doTestStepPostambleL()
+	{
+	delete iSchedular;
+	iSchedular=NULL;
+	CActiveScheduler::Install(NULL);
+
+	return CTestStep::doTestStepPostambleL();
+	}
+
+CAlmModel*	CTestTimewBase::Model(void)
+/**
+returns a pointer to an instance of CAgnModel
+*/
+	{
+  	return iModel;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/Src/TestTimewServer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,106 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This main DLL entry point for the Smoketest_Timew.dll
+// 
+//
+
+
+// EPOC includes
+#include <e32base.h>
+
+#include "TestTimewServer.h"
+#include "TestTimewSetAlarm.h"
+
+
+_LIT(KServerName,"Smoketest_Timew_Server");
+
+CTestTimewServer* CTestTimewServer::NewL()
+/**
+ * @return - Instance of the test server
+ * Same code for Secure and non-secure variants
+ * Called inside the MainL() function to create and start the
+ * CTestServer derived server.
+ */
+	{
+	CTestTimewServer*	server = new (ELeave) CTestTimewServer();
+	CleanupStack::PushL(server);
+	// CServer base class call
+	server->StartL(KServerName);
+	CleanupStack::Pop(server);
+	return server;
+	}
+
+
+LOCAL_C void MainL()
+/**
+ * Secure variant
+ * Much simpler, uses the new Rendezvous() call to sync with the client
+ */
+	{
+#if (defined __DATA_CAGING__)
+	RProcess().DataCaging(RProcess::EDataCagingOn);
+	RProcess().SecureApi(RProcess::ESecureApiOn);
+#endif
+	CActiveScheduler*	sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sched);
+	CTestTimewServer*	server = NULL;
+	// Create the CTestServer derived server
+	TRAPD(err,server = CTestTimewServer::NewL());
+	if(!err)
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	delete server;
+	delete sched;
+	}
+
+
+GLDEF_C TInt E32Main()
+/**
+ * @return - Standard Epoc error code on process exit
+ * Secure variant only
+ * Process entry point. Called by client using RProcess API
+ */
+	{
+	__UHEAP_MARK;
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAPD(err,MainL());
+        if (!err) { }
+        
+	delete cleanup;
+	__UHEAP_MARKEND;
+	return KErrNone;
+    }
+
+
+CTestStep* CTestTimewServer::CreateTestStep(const TDesC& aStepName)
+/**
+ * @return - A CTestStep derived instance
+ * Secure and non-secure variants
+ * Implementation of CTestServer pure virtual
+ */
+	{
+	CTestStep*	testStep = NULL;
+
+	if(aStepName == _L("SetAlarm"))
+		testStep = new CTestTimewSetAlarm();
+	return testStep;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/Src/TestTimewSetAlarm.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,84 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestTimewSetAlarm
+// 
+//
+
+#include <TestExecuteClient.h>
+
+#include "TestTimewSetAlarm.h"
+
+
+_LIT(KHour,	"hour");
+_LIT(KMinute,"minute");
+_LIT(KMessage,"message");
+_LIT(KBells,"bells");
+
+
+// constructor
+CTestTimewSetAlarm::CTestTimewSetAlarm()
+	{
+	SetTestStepName(_L("SetAlarm"));
+	}
+
+// destructor
+CTestTimewSetAlarm::~CTestTimewSetAlarm()
+	{
+	}
+
+// Each test step must supply a implementation for doTestStepL
+enum TVerdict CTestTimewSetAlarm::doTestStepL( void )
+	{
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("TEST-> SETTING AN ALARM"));
+		TRAPD(r, SetAlarmL());
+
+	if (r!=KErrNone)
+		SetTestStepResult(EFail);
+
+	// test steps return a result
+	return TestStepResult();
+	}
+
+void CTestTimewSetAlarm::SetAlarmL( void )
+	{
+	TInt	hour;
+	TInt	minute;
+	TPtrC	ptrMessage;
+
+	TTime alarmTime;
+	alarmTime.HomeTime();
+
+	if ( !GetIntFromConfig(ConfigSection(), KHour(), hour) )
+		hour=alarmTime.DateTime().Hour();
+
+	if ( !GetIntFromConfig(ConfigSection(), KMinute(), minute) )
+		minute=0;
+
+	GetStringFromConfig(ConfigSection(), KMessage(), ptrMessage);
+
+
+	TDateTime dateTime=alarmTime.DateTime();
+	dateTime.SetHour(hour);
+	dateTime.SetMinute(minute);
+	dateTime.SetSecond(0);
+	dateTime.SetMicroSecond(0);
+	iAlarmData.NextDueTime()=dateTime;
+	iAlarmData.RepeatDefinition()=(TAlarmRepeatDefinition)EAlarmRepeatDefintionRepeatNext24Hours;
+	iAlarmData.Message() = ptrMessage;
+	iAlarmData.SoundName()=KBells();
+	iModel = CAlmModel::NewL(NULL,KPriorityAlarmResponder);
+	Model()->ClockAlarmSet(0,iAlarmData);
+	delete iModel;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/TestData/Smoketest_Timew.ini	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,5 @@
+[24560_SetAlarm]
+hour			=9
+min			=0
+message			=make a cup of tea
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/bmarm/CONSOLEALARMALERTSERVERU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,2 @@
+EXPORTS
+	StartConsoleAlarmAlertServerL__23ConsoleAlarmAlertServerPv @1 NONAME ; public: static void __cdecl ConsoleAlarmAlertServer::StartConsoleAlarmAlertServerL(void *)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/bwins/CONSOLEALARMALERTSERVERU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?StartConsoleAlarmAlertServerL@ConsoleAlarmAlertServer@@SAXPAX@Z @ 1 NONAME ; public: static void __cdecl ConsoleAlarmAlertServer::StartConsoleAlarmAlertServerL(void *)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/bwins/SMOKETEST_TIMEW_SERVERU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?NewServer@@YAHXZ @ 1 NONAME ; int __cdecl NewServer(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Timew/eabi/ConsoleAlarmAlertServerU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,11 @@
+EXPORTS
+	_ZN23ConsoleAlarmAlertServer29StartConsoleAlarmAlertServerLEPv @ 1 NONAME
+	_ZTI24CConsoleAlarmAlertServer @ 2 NONAME ; #<TI>#
+	_ZTI25CConsoleAlarmAlertConsole @ 3 NONAME ; #<TI>#
+	_ZTI25CConsoleAlarmAlertSession @ 4 NONAME ; #<TI>#
+	_ZTI28CConsoleAlarmAlertLEDFlasher @ 5 NONAME ; #<TI>#
+	_ZTV24CConsoleAlarmAlertServer @ 6 NONAME ; #<VT>#
+	_ZTV25CConsoleAlarmAlertConsole @ 7 NONAME ; #<VT>#
+	_ZTV25CConsoleAlarmAlertSession @ 8 NONAME ; #<VT>#
+	_ZTV28CConsoleAlarmAlertLEDFlasher @ 9 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/Inc/SmokeTestActive.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,115 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestActive
+// 
+//
+
+#if (!defined __SMOKETEST_ACTIVE_H__)
+#define __SMOKETEST_ACTIVE_H__
+
+#include <e32base.h>
+
+/**
+ * Multimedia test timer completion callback
+ */
+class MTestActiveCallback
+	{
+public:
+	/**
+	* Method from which CTestActive informs the user RunL call
+	*/
+	virtual void	RunL() = 0;
+	/**
+	* Method from which CTestActive informs the user DoCancel call
+	*/
+	virtual void	DoCancel() = 0;
+	};
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CTestActive : public CActive
+{
+public:
+	/**
+	* Destructor
+	*/
+	IMPORT_C virtual ~CTestActive();
+
+	/**
+	* Two phase constructor that allocates and constructs
+	* a new Active object whos actions are performed by a callback
+	*
+	* \param aTestActiveCallback object to inform on RunL.
+	* \param aPriority priority of active object.
+	* \return New Callback active object.
+	*/
+	IMPORT_C static CTestActive*	NewL(MTestActiveCallback& aTestActiveCallback, TInt aPriority=EPriorityStandard);
+
+	/**
+	* Two phase constructor that allocates and constructs
+	* a new Active object whos actions are performed by a callback
+	*
+	* \param aTestActiveCallback object to inform on RunL.
+	* \param aPriority priority of active object.
+	* \return New Callback active object.
+	*/
+	IMPORT_C static CTestActive*	NewLC(MTestActiveCallback& aTestActiveCallback, TInt aPriority=EPriorityStandard);
+
+	/**
+	* Activate the object
+	*/
+	IMPORT_C void					Activate();
+
+	/**
+	* Active object RunL implementation.
+	*
+	* Calls the MTestActiveCallback::RunL to inform user that the RunL has been reached.
+	*/
+	void	RunL();
+	/**
+	* Active object DoCancel implementation.
+	*
+	* Calls the MTestActiveCallback::DoCancel to inform user that the DoCancel has been reached.
+	*/
+	void	DoCancel();
+
+protected:
+	/**
+	* Protected constructor with timer completion callback and priority.
+	*
+	* Called by two phase constructor.
+	*
+	* \param aTestTimerCallback object to inform on timer completion.
+	* \param aPriority priority of active object.
+	*/
+	CTestActive(MTestActiveCallback& aTestActiveCallback, TInt aPriority);
+
+private:
+	/**
+	* This is internal and not intended for use.
+	*
+	* Second phase of two phase constructor.
+	*/
+	void	ConstructL();
+
+private:
+	/**
+	* This is internal and not intended for use.
+	*/
+	MTestActiveCallback&	iTestActiveCallback;
+};
+
+#endif /* __SMOKETEST_ACTIVE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/Inc/SmokeTestProperty.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,93 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestProperty
+// 
+//
+
+#if (!defined __SMOKETEST_PROPERTY_H__)
+#define __SMOKETEST_PROPERTY_H__
+
+// EPOC includes
+#include <test/testexecutestepbase.h>
+#include <e32property.h>
+
+/**
+ This class contains generic utility method to set system wide variable usign publish and subscribe
+*/
+class CTestProperty : public CBase
+{
+public:
+	IMPORT_C CTestProperty(CTestStep& aTestStep);
+	IMPORT_C ~CTestProperty();
+
+	/**
+	* Set a property
+	*
+	* \param aCategory catagory of the RProperty
+	* \param aKey key of the catagory
+	* \param aValue value of the key
+	*/
+	IMPORT_C TInt SetPropertyL(const TUid aCategory, const TInt aKey, const TInt aValue);
+
+	/**
+	* Set a property
+	*
+	* \param aCategory catagory of the RProperty
+	* \param aKey key of the catagory
+	* \param aValue value of the key
+	*/
+	IMPORT_C TInt SetPropertyL(const TUid aCategory, const TInt aKey, const TDesC8& aValue);
+
+	/**
+	* Set a property
+	*
+	* \param aCategory catagory of the RProperty
+	* \param aKey key of the catagory
+	* \param aValue value of the key
+	*/
+	IMPORT_C TInt SetPropertyL(const TUid aCategory, const TInt aKey, const TDesC16& aValue);
+
+	/**
+	* Get a property
+	*
+	* \param aCategory catagory of the RProperty
+	* \param aKey key of the catagory
+	* \param aValue value of the key returned
+	*/
+	IMPORT_C TInt GetPropertyL(const TUid aCategory, const TInt aKey, TInt& aValue);
+
+	/**
+	* Get a property
+	*
+	* \param aCategory catagory of the RProperty
+	* \param aKey key of the catagory
+	* \param aValue value of the key returned
+	*/
+	IMPORT_C TInt GetPropertyL(const TUid aCategory, const TInt aKey, TDes8& aValue);
+
+	/**
+	* Get a property
+	*
+	* \param aCategory catagory of the RProperty
+	* \param aKey key of the catagory
+	* \param aValue value of the key returned
+	*/
+	IMPORT_C TInt GetPropertyL(const TUid aCategory, const TInt aKey, TDes16& aValue);
+
+private:
+	CTestStep&	iTestStep;
+	RProperty	iProperty;
+};
+
+#endif /* __SMOKETEST_PROPERTY_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/Inc/SmokeTestSecureFSclient.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __SMOKETEST_SECURE_FS_CLIENT_H__
+#define __SMOKETEST_SECURE_FS_CLIENT_H__
+
+#include <e32std.h>
+
+class RTestSecureFSclient : public RSessionBase
+	{
+public:
+	IMPORT_C TInt Connect();
+	IMPORT_C TInt SetHomeTime(const TTime& aTime);
+	IMPORT_C TInt DeleteFileL(const TDesC& aFileName);
+	IMPORT_C void KillProcessL(const TDesC& aProcessName);
+	IMPORT_C TInt ChangeLocaleName(const TDesC& aLocaleDllName);
+	IMPORT_C TInt CheckForFile(const TDesC& aFileName);
+    IMPORT_C TInt CopyFile(const TDesC& Source, const TDesC& Dest);
+    IMPORT_C void SetUpFbs();
+	};
+
+#endif // __SMOKETEST_SECURE_FS_CLIENT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/Inc/SmokeTestSecureFSclientserver.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,40 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// clientserver - shared client/server definitions
+// 
+//
+
+#ifndef __SMOKETEST_SECURE_FS_CLIENT_SERVER_H__
+#define __SMOKETEST_SECURE_FS_CLIENT_SERVER_H__
+
+#include <e32std.h>
+
+_LIT(KTestServerName,"SmokeTestSecureFSserver");
+_LIT(KTestServerImg,"SmokeTestSecureFSserver");		// EXE name
+const TUid KServerUid3={0x101FF346};
+
+const TInt KMaxTestMessage=8;
+
+enum TTestIpc
+	{
+	ETestIpcSetHomeTime,
+	ETestIpcDeleteFile,
+	ETestIpcKillProcess,
+	ETestIpcChangeLocale,
+	ETestIpcCheckForFile,
+    ETestIpcCopyFile,
+    ETestIpcSetUpFbs,
+	};
+
+#endif // __SMOKETEST_SECURE_FS_CLIENT_SERVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/Inc/SmokeTestSecureFSserver.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,91 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestServer - server classes
+// 
+//
+
+#ifndef __SMOKETEST_SECURE_FS_SERVER_H__
+#define __SMOKETEST_SECURE_FS_SERVER_H__
+
+#include <e32base.h>
+#include "SmokeTestSecureFSclientserver.h"
+
+enum TTestPanic
+	{
+	EPanicBadDescriptor,
+	EPanicIllegalFunction,
+	EPanicAlreadyReceiving
+	};
+
+void PanicClient(const RMessage2& aMessage,TTestPanic TMyPanic);
+
+class CTestSecureFSshutdown : public CTimer
+	{
+	enum {KMyShutdownDelay=0x500000};	// approx 5s
+public:
+	inline CTestSecureFSshutdown();
+	inline void ConstructL();
+	inline void Start();
+private:
+	void RunL();
+	};
+
+class CTestSecureFSserver : public CServer2
+	{
+public:
+	static CServer2* NewLC();
+	void AddSession();
+	void DropSession();
+	void Send(const TDesC& aMessage);
+private:
+	CTestSecureFSserver();
+	void ConstructL();
+	// CSharableSession* NewSessionL(const TVersion& aVersion, const RMessage& aMessage) const;
+        CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const;
+private:
+	TInt iSessionCount;
+	CTestSecureFSshutdown iShutdown;
+	};
+
+//class CTestSecureFSSession : public CSharableSession
+class CTestSecureFSSession : public CSession2
+	{
+public:
+	CTestSecureFSSession();
+	void CreateL();
+	void Send(const TDesC& aMessage);
+private:
+	~CTestSecureFSSession();
+	inline CTestSecureFSserver& Server();
+	void ServiceL(const RMessage2& aMessage);
+	void ServiceError(const RMessage2& aMessage,TInt aError);
+	inline TBool ReceivePending() const;
+private:
+	void DoSetHomeTime(const RMessage2& aMessage);
+	
+	// General File Manipulation
+	TInt DoDeleteFileL(const RMessage2& aMessage);
+
+	// Power User
+	void DoKillProcess(const RMessage2& aMessage);
+	TInt DoChangeLocale(const RMessage2& aMessage);
+	TInt DoCheckForFile(const RMessage2& aMessage);
+	TInt DoCopyFile(const RMessage2& aMessage);
+	void DoSetUpFbs();
+
+private:
+	RMessage2 iReceive;
+	};
+
+#endif // __SMOKETEST_SECURE_FS_SERVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/Inc/SmokeTestTimeOutTimer.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,102 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestTimeOutTimer
+// 
+//
+
+#if (!defined __SMOKETEST_TIMEOUT_TIMER_H_)
+#define __SMOKETEST_TIMEOUT_TIMER_H_
+
+#include <e32base.h>
+
+/**
+ * Multimedia test timer completion callback
+ */
+class MTestTimeOutTimerCallback
+	{
+public:
+	/**
+	* Method from which CTestTimeOutTimer informs the user of the timer completion.
+	*/
+	virtual void TimerCompleted() = 0;
+	};
+
+/**
+ * Multimedia test timer active object.
+ *
+ * On timer completion MTestTimeOutTimerCallback::TimerCompleted is called
+ * to inform the user off the completion
+ */
+class CTestTimeOutTimer : public CTimer  
+{
+public:
+	/**
+	* Destructor
+	*/
+	IMPORT_C virtual ~CTestTimeOutTimer();
+
+	/**
+	* Two phase constructor that allocates and constructs
+	* a new Multimedia timer a timer completion callback and priority.
+	*
+	* \param aTestTimerCallback object to inform on timer completion.
+	* \param aPriority priority of active object.
+	* \return New Multimedia test timer active object.
+	*/
+	IMPORT_C static CTestTimeOutTimer*	NewL(MTestTimeOutTimerCallback& aTestTimerCallback, TInt aPriority=EPriorityStandard);
+
+	/**
+	* Two phase constructor that allocates and constructs
+	* a new Multimedia timer a timer completion callback and priority.
+	*
+	* \param aTestTimerCallback object to inform on timer completion.
+	* \param aPriority priority of active object.
+	* \return New Multimedia test timer active object.
+	*/
+	IMPORT_C static CTestTimeOutTimer*	NewLC(MTestTimeOutTimerCallback& aTestTimerCallback, TInt aPriority=EPriorityStandard);
+
+	/**
+	* Active object RunL implementation.
+	*
+	* Calls the MTestTimeOutTimerCallback::TimerCompleted to inform user that the timer has completed.
+	*/
+	void	RunL();
+
+protected:
+	/**
+	* Protected constructor with timer completion callback and priority.
+	*
+	* Called by two phase constructor.
+	*
+	* \param aTestTimerCallback object to inform on timer completion.
+	* \param aPriority priority of active object.
+	*/
+	CTestTimeOutTimer(MTestTimeOutTimerCallback& aTestTimerCallback, TInt aPriority);
+
+private:
+	/**
+	* This is internal and not intended for use.
+	*
+	* Second phase of two phase constructor.
+	*/
+	void	ConstructL();
+
+private:
+	/**
+	* This is internal and not intended for use.
+	*/
+	MTestTimeOutTimerCallback&	iTestTimerCallback;
+};
+
+#endif /* __SMOKETEST_TIMEOUT_TIMER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/Inc/TestStepSmokeTest.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,80 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestStepSmokeTest
+// 
+//
+
+#if (!defined __TEST_STEP_SMOKETEST_H__)
+#define __TEST_STEP_SMOKETEST_H__
+
+//TEF include
+#include <test/testexecutestepbase.h>
+#include "Configuration.cfg"
+
+enum TTestLoggingDetail
+	{
+	ETestLoggingDetail_Min,
+	ETestLoggingDetail_Normal,
+	ETestLoggingDetail_Max,
+	};
+
+#if (defined __VERSION_70S__)
+enum TCapability
+	{
+	ECapabilityTCB				= 0,
+	};
+#endif
+
+/**
+ This class is the base class for all the test steps in smoketest.
+*/
+class CTestStepSmokeTest : public CTestStep
+	{
+public:
+	//Destructor
+	IMPORT_C virtual ~CTestStepSmokeTest();
+
+	/**
+	 Pure virtual, to be implemented by the derived test steps.
+	 It implements the required functionality of the test step.
+	 @return TVerdict - result of the test step
+	 @leave - System wide error codes
+	*/
+	IMPORT_C virtual enum TVerdict	doTestStepL() = 0;
+
+	//Implements the preoperational functionalities for a test step
+	IMPORT_C virtual enum TVerdict	doTestStepPreambleL();
+
+	//Implements the post operational fucntionalities for a test step
+	IMPORT_C virtual enum TVerdict	doTestStepPostambleL();
+
+	TTestLoggingDetail		LoggingDetail() const { return iLoggingDetail; }
+	TInt					Repetition() const { return iRepetition; }
+
+protected:
+	//Constructor
+	IMPORT_C CTestStepSmokeTest();
+
+	//Gets the TCapability value for the capabilty string literal
+	IMPORT_C TInt			GetCapability(TPtrC aCapability, TCapability& aCapabilityValue);
+
+	//Verifies the given time is nearly eaual to current UTC time
+	IMPORT_C TBool			VerifyUTCTime(TTime aTime);
+
+private:
+	TTestLoggingDetail			iLoggingDetail;
+	TInt						iRepetition;
+	};
+
+#endif /* __TEST_STEP_SMOKETEST_H__ */
Binary file Utils/ReadMe.doc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/Src/SmokeTestActive.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,69 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// SmokeTestTestActive.h
+// This contains CTestActive
+// 
+//
+
+#include "SmokeTestActive.h"
+
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+EXPORT_C CTestActive::~CTestActive()
+	{
+	}
+
+EXPORT_C CTestActive* CTestActive::NewL(MTestActiveCallback& aTestActiveCallback, TInt aPriority)
+	{
+	CTestActive*	self=NewLC(aTestActiveCallback, aPriority);
+	CleanupStack::Pop();
+	return self;
+	}
+
+EXPORT_C CTestActive* CTestActive::NewLC(MTestActiveCallback& aTestActiveCallback, TInt aPriority)
+	{
+	CTestActive*	self=new(ELeave) CTestActive(aTestActiveCallback, aPriority);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+
+EXPORT_C void CTestActive::Activate()
+	{
+	SetActive();
+	}
+
+CTestActive::CTestActive(MTestActiveCallback& aTestActiveCallback, TInt aPriority)
+:	CActive(aPriority)
+,	iTestActiveCallback(aTestActiveCallback)
+	{
+	}
+
+void CTestActive::ConstructL()
+	{
+	CActiveScheduler::Add(this);
+	}
+
+void CTestActive::RunL()
+	{
+	iTestActiveCallback.RunL();
+	}
+
+void CTestActive::DoCancel()
+	{
+	iTestActiveCallback.DoCancel();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/Src/SmokeTestProperty.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,140 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestProperty
+// 
+//
+
+#include "SmokeTestProperty.h"
+
+// EPOC32 include
+#include <e32base.h>
+
+EXPORT_C CTestProperty::CTestProperty(CTestStep& aTestStep)
+:	CBase()
+,	iTestStep(aTestStep)
+	{
+	}
+
+EXPORT_C CTestProperty::~CTestProperty()
+	{
+	}
+
+EXPORT_C TInt CTestProperty::SetPropertyL(const TUid aCategory, const TInt aKey, const TInt aValue)
+	{
+	//Define the property, in case it is being used for the first time.
+	TInt	ret=RProperty::Define(aCategory, aKey, RProperty::EInt);
+	if ( (ret==KErrNone) || (ret== KErrAlreadyExists) )
+		{
+		//Attach to the property so that you can track any chnages to it.
+		ret=iProperty.Attach(aCategory, aKey);
+		if ( ret==KErrNone )
+			{
+			//Set the new test number and wait until the change is in effect.
+			TRequestStatus	status;
+			iProperty.Subscribe(status);
+			ret=iProperty.Set(aCategory, aKey, aValue);
+			if ( ret==KErrNone )
+				{
+				User::WaitForRequest(status);
+				ret=status.Int();
+				if ( ret != KErrNone )
+					{
+					iTestStep.INFO_PRINTF2(_L("request complete error=%d"), ret);
+					}
+				}
+			else
+				{
+				iTestStep.INFO_PRINTF2(_L("RProperty::Set error=%d"), ret);
+				}
+			iProperty.Close();
+			}
+		else
+			{
+			iTestStep.INFO_PRINTF2(_L("RProperty::Attach error=%d"), ret);
+			}
+		}
+	else
+		{
+		iTestStep.INFO_PRINTF2(_L("RProperty::Define error=%d"), ret);
+		}
+
+	return ret;
+	}
+
+EXPORT_C TInt CTestProperty::SetPropertyL(const TUid aCategory, const TInt aKey, const TDesC8& aValue)
+	{
+	//Define the property, in case it is being used for the first time.
+	TInt	ret=RProperty::Define(aCategory, aKey, RProperty::EByteArray);
+	if ( (ret==KErrNone) || (ret== KErrAlreadyExists) )
+		{
+		//Attach to the property so that you can track any chnages to it.
+		ret=iProperty.Attach(aCategory, aKey);
+		if ( ret==KErrNone )
+			{
+			//Set the new test number and wait until the change is in effect.
+			TRequestStatus	status;
+			iProperty.Subscribe(status);
+			ret=iProperty.Set(aCategory, aKey, aValue);
+			if ( ret==KErrNone )
+				{
+				User::WaitForRequest(status);
+				ret=status.Int();
+				}
+			iProperty.Close();
+			}
+		}
+
+	return ret;
+	}
+
+EXPORT_C TInt CTestProperty::SetPropertyL(const TUid aCategory, const TInt aKey, const TDesC16& aValue)
+	{
+	//Define the property, in case it is being used for the first time.
+	TInt	ret=RProperty::Define(aCategory, aKey, RProperty::EText);
+	if ( (ret==KErrNone) || (ret== KErrAlreadyExists) )
+		{
+		//Attach to the property so that you can track any chnages to it.
+		ret=iProperty.Attach(aCategory, aKey);
+		if ( ret==KErrNone )
+			{
+			//Set the new test number and wait until the change is in effect.
+			TRequestStatus	status;
+			iProperty.Subscribe(status);
+			ret=iProperty.Set(aCategory, aKey, aValue);
+			if ( ret==KErrNone )
+				{
+				User::WaitForRequest(status);
+				ret=status.Int();
+				}
+			iProperty.Close();
+			}
+		}
+
+	return ret;
+	}
+
+EXPORT_C TInt CTestProperty::GetPropertyL(const TUid aCategory, const TInt aKey, TInt& aValue)
+	{
+	return RProperty::Get(aCategory, aKey, aValue);
+	}
+
+EXPORT_C TInt CTestProperty::GetPropertyL(const TUid aCategory, const TInt aKey, TDes8& aValue)
+	{
+	return RProperty::Get(aCategory, aKey, aValue);
+	}
+
+EXPORT_C TInt CTestProperty::GetPropertyL(const TUid aCategory, const TInt aKey, TDes16& aValue)
+	{
+	return RProperty::Get(aCategory, aKey, aValue);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/Src/SmokeTestSecureFSclient.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,112 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Test Server - client interface implementation
+// 
+//
+
+#include <e32std.h>
+#include <e32math.h>
+#include "SmokeTestSecureFSclientserver.h"
+#include "SmokeTestSecureFSclient.h"
+
+static TInt StartServer()
+//
+// Start the server process. Simultaneous launching
+// of two such processes should be detected when the second one attempts to
+// create the server object, failing with KErrAlreadyExists.
+//
+	{
+	const TUidType serverUid(KNullUid,KNullUid,KServerUid3);
+
+
+	RProcess server;
+	TInt r=server.Create(KTestServerImg, KNullDesC, serverUid);
+
+	if (r!=KErrNone)
+		return r;
+	TRequestStatus stat;
+
+	server.Rendezvous(stat);
+	
+	if (stat != KRequestPending)
+		server.Kill(0);		// abort startup
+	else
+		server.Resume();	// logon OK - start the server	
+	User::WaitForRequest(stat);	//wait for start or death
+	// we can't use the 'exit reason' if the server panicked as this
+	// is the panic 'reason' and may be '0' which cannot be distinguished
+	// from KErrNone
+	r=(server.ExitType()==EExitPanic) ? KErrGeneral : stat.Int();
+	server.Close();
+	return r;
+	}
+
+EXPORT_C TInt RTestSecureFSclient::Connect()
+	{// Connect to the server, attempting to start it if necessary
+	TInt retry=2;
+	for (;;)
+		{
+		TInt r=CreateSession(KTestServerName,TVersion(0,0,0),1);
+		if (r!=KErrNotFound && r!=KErrServerTerminated)
+			return r;
+		if (--retry==0)
+			return r;
+		r=StartServer();
+		if (r!=KErrNone && r!=KErrAlreadyExists)
+			return r;
+		User::After(1000000); //Let server load up (in EKA2)
+
+		}
+	}
+
+EXPORT_C TInt RTestSecureFSclient::SetHomeTime(const TTime& aTime) 
+	{
+	TPckg<TTime> pckg(aTime);
+	return SendReceive(ETestIpcSetHomeTime,TIpcArgs(&pckg));
+	}
+
+EXPORT_C TInt RTestSecureFSclient::DeleteFileL(const TDesC& aFileName)
+	{
+	TIpcArgs args(&aFileName);
+	return SendReceive(ETestIpcDeleteFile,args);
+	}
+
+EXPORT_C void RTestSecureFSclient::KillProcessL(const TDesC& aProcessName)
+	{
+	TIpcArgs args(&aProcessName);
+	User::LeaveIfError(SendReceive(ETestIpcKillProcess,args));
+	}
+
+EXPORT_C TInt RTestSecureFSclient::ChangeLocaleName(const TDesC& aLocaleDllName)
+	{
+	TIpcArgs args(&aLocaleDllName);
+	return SendReceive(ETestIpcChangeLocale,args);
+	}
+
+EXPORT_C TInt RTestSecureFSclient::CheckForFile(const TDesC& aFileName)
+    {
+	TIpcArgs args(&aFileName); 
+	return SendReceive(ETestIpcCheckForFile,args);  
+    }
+    
+EXPORT_C TInt RTestSecureFSclient::CopyFile(const TDesC& Source, const TDesC& Dest)
+    {
+	TIpcArgs args(&Source, &Dest); 
+	return SendReceive(ETestIpcCopyFile,args);  
+    }
+    
+EXPORT_C void RTestSecureFSclient::SetUpFbs()
+    {
+	SendReceive(ETestIpcSetUpFbs);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/Src/SmokeTestSecureFSserver.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,391 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestServer - server implementation
+// 
+//
+
+#include "e32std.h"
+#include "SmokeTestSecureFSserver.h"
+#include <f32file.h>
+
+TRequestStatus aStatus;
+TRequestStatus* aSt = &aStatus;
+
+
+inline CTestSecureFSshutdown::CTestSecureFSshutdown()
+	:CTimer(-1)
+	{CActiveScheduler::Add(this);}
+inline void CTestSecureFSshutdown::ConstructL()
+	{CTimer::ConstructL();}
+inline void CTestSecureFSshutdown::Start()
+	{After(KMyShutdownDelay);}
+
+inline CTestSecureFSserver::CTestSecureFSserver()
+	:CServer2(0,ESharableSessions)
+	{}
+
+inline CTestSecureFSSession::CTestSecureFSSession()
+	{}
+inline CTestSecureFSserver& CTestSecureFSSession::Server()
+	{return *static_cast<CTestSecureFSserver*>(const_cast<CServer2*>(CSession2::Server()));}
+inline TBool CTestSecureFSSession::ReceivePending() const
+	{return !iReceive.IsNull();}
+
+///////////////////////
+
+void CTestSecureFSSession::CreateL()
+//
+// 2nd phase construct for sessions - called by the CServer framework
+//
+	{
+	//RDebug::Print(_L("Server::CTestSecureFSSession::CreateL - start"));
+
+	Server().AddSession();
+	//RDebug::Print(_L("Server::CTestSecureFSSession::CreateL - end"));
+	}
+
+CTestSecureFSSession::~CTestSecureFSSession()
+	{
+	Server().DropSession();
+	}
+
+void CTestSecureFSSession::Send(const TDesC& aMessage)
+//
+// Deliver the message to the client, truncating if required
+// If the write fails, panic the client, not the sender
+//
+	{
+	if (ReceivePending())
+		{
+		TPtrC m(aMessage);
+		if (iReceive.Int1()<aMessage.Length())
+			m.Set(m.Left(iReceive.Int1()));
+		TInt r=iReceive.Write(0,m);
+		if (r==KErrNone)
+			iReceive.Complete(KErrNone);
+		else
+			PanicClient(iReceive,EPanicBadDescriptor);
+		}
+	}
+
+void CTestSecureFSSession::ServiceL(const RMessage2& aMessage)
+//
+// Handle a client request.
+// Leaving is handled by CMyServer::ServiceError() which reports
+// the error code to the client
+//
+	{
+	TInt result = KErrNone;
+
+	switch (aMessage.Function())
+		{
+	case ETestIpcSetHomeTime:
+		DoSetHomeTime(aMessage);
+		break;
+
+	case ETestIpcDeleteFile:
+		result = DoDeleteFileL(aMessage);
+		break;
+	
+	case ETestIpcKillProcess:
+		DoKillProcess(aMessage);
+		break;
+
+	case ETestIpcChangeLocale:
+		result = DoChangeLocale(aMessage);
+		break;
+		
+	case ETestIpcCheckForFile:
+	    result = DoCheckForFile(aMessage);
+	    break;
+	    
+	case ETestIpcCopyFile:
+	    result = DoCopyFile(aMessage);
+	    break; 
+	    
+	case ETestIpcSetUpFbs:
+	    DoSetUpFbs(); 
+	    break;
+	     
+	default:
+		PanicClient(aMessage,EPanicIllegalFunction);
+		break;
+		}
+	aMessage.Complete(result);
+	}
+
+////////////////////////////////////////
+
+void CTestSecureFSSession::DoSetHomeTime(const RMessage2& aMessage)
+	{
+	TPckgBuf<TTime> pckg;
+	aMessage.Read(0,pckg);
+	User::SetHomeTime(pckg());
+	}
+
+TInt CTestSecureFSSession::DoDeleteFileL(const RMessage2& aMessage)
+	{
+	RFs fs;
+	TFileName* const fileName=new(ELeave) TFileName;
+	CleanupStack::PushL(fileName);
+	User::LeaveIfError(fs.Connect());
+
+	CleanupClosePushL(fs);
+	aMessage.ReadL(0,*fileName);
+	TInt err=fs.Delete(*fileName);
+	if (!(err==KErrNone || err==KErrNotFound || err==KErrPathNotFound)) // ignore not found error
+		{
+		User::Leave(err);
+		}
+	CleanupStack::PopAndDestroy(&fs);
+	CleanupStack::PopAndDestroy(fileName);
+	return err;
+	}
+
+void CTestSecureFSSession::DoKillProcess(const RMessage2& aMessage)
+	{
+	TFullName* name = new(ELeave) TFullName;
+	CleanupStack::PushL(name);
+
+	aMessage.ReadL(0,*name);
+	TFindProcess* finder = new (ELeave) TFindProcess(*name);
+	CleanupStack::PushL(finder);
+	RProcess* process = new (ELeave) RProcess;
+	CleanupStack::PushL(process);
+
+	if (finder->Next(*name) == KErrNone)
+		{
+		if (process->Open(*name) == KErrNone)
+			{
+			process->Kill(KErrNone);
+			}
+		}
+
+	if (process != NULL)
+		{
+		process->Close();
+		}
+	CleanupStack::PopAndDestroy(process);
+	CleanupStack::PopAndDestroy(finder);
+	CleanupStack::PopAndDestroy(name);		
+	}
+
+
+TInt CTestSecureFSSession::DoChangeLocale(const RMessage2& aMessage)
+	{
+	TBuf<50> locname;
+	TInt result;
+	aMessage.ReadL(0,locname);
+
+	result = UserSvr::ChangeLocale(locname);
+
+	return result;
+	}
+
+TInt CTestSecureFSSession::DoCheckForFile(const RMessage2& aMessage)
+{
+    RFs fs;
+    TInt err;
+	TFileName* const fileName=new(ELeave) TFileName;
+	CleanupStack::PushL(fileName);
+	User::LeaveIfError(fs.Connect());
+
+	CleanupClosePushL(fs);
+	aMessage.ReadL(0,*fileName);
+	
+	TUint attribs;
+	err=fs.Att(*fileName, attribs);
+	fs.Close();
+		
+	CleanupStack::PopAndDestroy(&fs);
+	CleanupStack::PopAndDestroy(fileName);
+	return err;
+	
+}
+
+TInt CTestSecureFSSession::DoCopyFile(const RMessage2& aMessage)
+{
+
+    RFs fs;
+    TInt result;
+ 
+    User::LeaveIfError(fs.Connect());
+    CleanupClosePushL(fs);
+
+    TFileName fileSource;
+    TFileName fileDest;
+
+    aMessage.ReadL(0,fileSource);
+    aMessage.ReadL(1,fileDest);
+    	   
+	CFileMan* fileMan = NULL;
+	
+	fileMan = CFileMan::NewL(fs);
+	CleanupStack::PushL( fileMan );
+	
+	fs.MkDirAll(fileDest);
+	result = fileMan->Copy( fileSource, fileDest, CFileMan::EOverWrite );
+	
+	User::LeaveIfError(fs.Connect());
+	fs.SetAtt(fileDest,KEntryAttNormal,KEntryAttReadOnly);
+	fs.Close();
+
+    CleanupStack::PopAndDestroy(fileMan);
+    CleanupStack::PopAndDestroy(&fs);
+	return result;
+	
+}
+
+void CTestSecureFSSession::DoSetUpFbs()
+{
+//	FbsStartup();
+//    User::LeaveIfError( RFbsSession::Connect() );
+//   CleanupStack::PushL( TCleanupItem( TCleanupOperation(&RFbsSession::Disconnect ), NULL ) );
+}
+
+////////////////////////////////////////
+
+void CTestSecureFSSession::ServiceError(const RMessage2& aMessage,TInt aError)
+//
+// Handle an error from CMySession::ServiceL()
+// A bad descriptor error implies a badly programmed client, so panic it;
+// otherwise use the default handling (report the error to the client)
+//
+	{
+	if (aError==KErrBadDescriptor)
+		PanicClient(aMessage,EPanicBadDescriptor);
+	CSession2::ServiceError(aMessage,aError);
+	}
+
+void CTestSecureFSshutdown::RunL()
+//
+// Initiate server exit when the timer expires
+//
+	{
+	CActiveScheduler::Stop();
+	}
+
+CServer2* CTestSecureFSserver::NewLC()
+	{
+	CTestSecureFSserver* self=new(ELeave) CTestSecureFSserver;
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+
+void CTestSecureFSserver::ConstructL()
+//
+// 2nd phase construction - ensure the timer and server objects are running
+//
+	{
+	StartL(KTestServerName);
+	iShutdown.ConstructL();
+	// ensure that the server still exits even if the 1st client fails to connect
+	iShutdown.Start();
+	}
+
+
+CSession2* CTestSecureFSserver::NewSessionL(const TVersion&,const RMessage2&) const
+//
+// Cretae a new client session. This should really check the version number.
+//
+	{
+	return new(ELeave) CTestSecureFSSession();
+	}
+
+void CTestSecureFSserver::AddSession()
+//
+// A new session is being created
+// Cancel the shutdown timer if it was running
+//
+	{
+	++iSessionCount;
+	iShutdown.Cancel();
+	}
+
+void CTestSecureFSserver::DropSession()
+//
+// A session is being destroyed
+// Start the shutdown timer if it is the last session.
+//
+	{
+	if (--iSessionCount==0)
+		iShutdown.Start();
+	}
+
+void CTestSecureFSserver::Send(const TDesC& aMessage)
+//
+// Pass on the signal to all clients
+//
+	{
+	iSessionIter.SetToFirst();
+	CSession2* s;
+	while ((s=iSessionIter++)!=0)
+		static_cast<CTestSecureFSSession*>(s)->Send(aMessage);
+	}
+
+void PanicClient(const RMessage2& aMessage,TTestPanic aPanic)
+//
+// RMessage::Panic() also completes the message. This is:
+// (a) important for efficient cleanup within the kernel
+// (b) a problem if the message is completed a second time
+//
+	{
+	_LIT(KPanic,"TestServer");
+ 	aMessage.Panic(KPanic,aPanic);
+	}
+
+
+
+/**
+Perform all server initialisation, in particular creation of the
+scheduler and server and then run the scheduler
+*/
+
+static void RunServerL()
+	{
+	// naming the server thread after the server helps to debug panics
+  	User::LeaveIfError(RThread::RenameMe(KTestServerName));
+	// create and install the active scheduler we need
+	CActiveScheduler* s=new(ELeave) CActiveScheduler;
+	CleanupStack::PushL(s);
+	CActiveScheduler::Install(s);
+	CTestSecureFSserver::NewLC(); // create the server (leave it on the cleanup stack)
+	RProcess::Rendezvous(KErrNone);
+	CActiveScheduler::Start();
+	CleanupStack::PopAndDestroy(2); 	// Cleanup the server and scheduler
+	}
+
+
+
+
+TInt E32Main()
+//
+// Server process entry-point
+//
+	{
+	__UHEAP_MARK;
+	//
+	RDebug::Print(_L("Server::E32Main Version 0.0.0"));
+	CTrapCleanup* cleanup=CTrapCleanup::New();
+	TInt r=KErrNoMemory;
+	if (cleanup)
+		{
+		TRAP(r,RunServerL());
+		delete cleanup;
+		}
+	//
+	__UHEAP_MARKEND;
+	return r;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/Src/SmokeTestTimeOutTimer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,59 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// SmokeTestTimeOutTimer.h
+// This contains CTestTimeOutTimer
+// 
+//
+
+#include "SmokeTestTimeOutTimer.h"
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+EXPORT_C CTestTimeOutTimer::~CTestTimeOutTimer()
+	{
+	}
+
+EXPORT_C CTestTimeOutTimer* CTestTimeOutTimer::NewL(MTestTimeOutTimerCallback& aTestTimerCallback, TInt aPriority)
+	{
+	CTestTimeOutTimer*	self=NewLC(aTestTimerCallback, aPriority);
+	CleanupStack::Pop();
+	return self;
+	}
+
+EXPORT_C CTestTimeOutTimer* CTestTimeOutTimer::NewLC(MTestTimeOutTimerCallback& aTestTimerCallback, TInt aPriority)
+	{
+	CTestTimeOutTimer*	self=new(ELeave) CTestTimeOutTimer(aTestTimerCallback, aPriority);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+
+CTestTimeOutTimer::CTestTimeOutTimer(MTestTimeOutTimerCallback& aTestTimerCallback, TInt aPriority)
+:	CTimer(aPriority)
+,	iTestTimerCallback(aTestTimerCallback)
+	{
+	}
+
+void CTestTimeOutTimer::ConstructL()
+	{
+	CTimer::ConstructL();
+	CActiveScheduler::Add(this);
+	}
+
+void CTestTimeOutTimer::RunL()
+	{
+	iTestTimerCallback.TimerCompleted();
+	};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/Src/TestStepSmokeTest.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,345 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestStepSmokeTest
+// 
+//
+
+//user include
+#include "TestStepSmokeTest.h"
+
+//Epoc include
+#include <testconfigfileparser.h>
+#include <f32file.h>
+#include <e32std.h>
+
+/*@{*/
+_LIT(KExpectedCapCheckResult,	"ExpectedCapCheckResult");
+_LIT(KConfigFile,				"C:\\plattest\\platsec\\plattest_capabilities.config");
+_LIT(KDefault,					"default");
+_LIT(KCapTest,					"CapabilityTest");
+_LIT(KNo,						"No");
+
+_LIT(KLogging,					"logging");
+_LIT(KLoggingMin,				"min");
+_LIT(KLoggingNormal,			"normal");
+_LIT(KLoggingMax,				"max");
+
+_LIT(KRepetition,				"repetition");
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+/**
+ Constructor
+*/
+EXPORT_C CTestStepSmokeTest::CTestStepSmokeTest()
+:	CTestStep()
+,	iLoggingDetail(ETestLoggingDetail_Normal)
+,	iRepetition(1)
+	{
+	}
+
+/**
+ Destructor
+*/
+EXPORT_C CTestStepSmokeTest::~CTestStepSmokeTest()
+	{
+	}
+
+	
+/**
+ The overriden implementation of CTestStep::doTestStepPreambleL()
+ @return TVerdict- result of the test step
+ @leave - system wide error codes
+*/
+EXPORT_C TVerdict CTestStepSmokeTest::doTestStepPreambleL()
+	{
+	TVerdict ret = CTestStep::doTestStepPreambleL();
+
+	//	Get logging
+	TPtrC	logging;
+	if ( GetStringFromConfig(ConfigSection(), KLogging, logging) )
+		{
+		INFO_PRINTF2(_L("Logging value %S"), &logging);
+		if ( logging.Compare(KLoggingMin) == 0 )
+			{
+			iLoggingDetail=ETestLoggingDetail_Min;
+			}
+		else if ( logging.Compare(KLoggingNormal) == 0 )
+			{
+			iLoggingDetail=ETestLoggingDetail_Normal;
+			}
+		else if ( logging.Compare(KLoggingMax) == 0 )
+			{
+			iLoggingDetail=ETestLoggingDetail_Max;
+			}
+		else
+			{
+			ERR_PRINTF1(_L("Illegal logging value, use min, normal or max."));
+			ret=EFail;
+			}
+		}
+
+	//	Get repetition count of test
+	GetIntFromConfig(ConfigSection(), KRepetition, iRepetition);
+	INFO_PRINTF2(_L("Repetition %d"), iRepetition);
+
+	return ret;
+	}
+
+/**
+ The overriden implementation of CTestStep::doTestStepPostambleL()
+ It implements the functionality of capability checking if
+ _PLATTEST_CAPTEST_ is ON.
+ @return TVerdict- result of the test step
+ @leave - system wide error codes
+*/
+
+EXPORT_C TVerdict CTestStepSmokeTest::doTestStepPostambleL()
+	{
+
+	//Read whether to do capability testing..
+	TPtrC captest(KNo);
+	GetStringFromConfig(KDefault, KCapTest, captest);
+	if( captest.Compare(_L("YES")) == 0)
+		{
+		INFO_PRINTF1(_L("---Capability Testing---"));
+		//Gets the capabilities config file
+		TBuf<KMaxTestExecuteCommandLength> scriptFile;
+		scriptFile.Copy(KConfigFile);
+		INFO_PRINTF2(_L("The config file %S"), &scriptFile);
+	
+		TBuf8<KMaxTestExecuteCommandLength> scriptSection;
+		scriptSection.Copy(_L("Capabilities"));
+			
+		TPtrC serverName = GetServerName();
+		INFO_PRINTF2(_L("The server name is  %S"), &serverName);
+		HBufC8 *scriptItem = HBufC8::NewLC(serverName.Length());
+		scriptItem->Des().Copy(serverName);
+		 
+		//Get the file server session object
+		RFs		rFs;
+		TInt	err=rFs.Connect();
+		if(err != KErrNone)
+			{
+			ERR_PRINTF1(_L("Failed to connect with File server"));
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			CleanupClosePushL(rFs);
+			//Get the config file
+			CTestConfig* configFile = CTestConfig::NewLC(rFs, KNullDesC, scriptFile);
+			if( configFile == NULL)
+				{
+				WARN_PRINTF1(_L("NO Config file found -- Plattest_capabilites.config"));
+				}
+			else
+				{
+				//Get the item value from config file
+				TBuf8<KMaxTestExecuteCommandLength> itemValue;
+				itemValue = configFile->Section(scriptSection)->Item(scriptItem->Des())->Value();
+				TLex8 capabilityParser(itemValue);
+				TBool capCheckResult= ETrue;
+				
+				while(!capabilityParser.Eos())
+					{
+					//Parse the capabilities
+					TPtrC8 capability(capabilityParser.NextToken());
+								
+					HBufC* capabilityRead = HBufC::NewLC(capability.Length());
+					capabilityRead->Des().Copy(capability);
+					INFO_PRINTF2(_L("Capability Read is %S"), capabilityRead);
+					
+					//Get the capability value
+					TCapability capabilityValue;
+					TPtrC ptrCapabilty(capabilityRead->Des());
+					TInt err = GetCapability(ptrCapabilty, capabilityValue);
+					if( err != KErrNone)
+						{
+						WARN_PRINTF1(_L("The capability is not found"));
+						}
+					else
+						{
+						//Check if the current process posses the required capability
+						if( !RProcess().HasCapability(capabilityValue) )
+							{
+							INFO_PRINTF2(_L("The capability %S is not possesed."), capabilityRead);
+							capCheckResult=EFalse;
+							}
+						else
+							{
+							INFO_PRINTF2(_L("The capability %S is possesed."), capabilityRead);
+							}
+						}
+					CleanupStack::PopAndDestroy(capabilityRead);
+					}
+					
+				//read the expected capability check result
+				TBool expectedCapCheckResult = ETrue;
+				GetBoolFromConfig(ConfigSection(), KExpectedCapCheckResult, expectedCapCheckResult);
+				INFO_PRINTF2(_L("The expected cap check result is %D"), expectedCapCheckResult);
+				INFO_PRINTF2(_L("The cap check result is %D"), capCheckResult);
+
+				if(expectedCapCheckResult == capCheckResult)
+					{
+					SetTestStepResult(EPass);
+					}
+				else
+					{
+					SetTestStepResult(EFail);
+					}
+				}
+			CleanupStack::PopAndDestroy(2, &rFs);
+			}
+		CleanupStack::PopAndDestroy(scriptItem);
+		if(TestStepError() == KErrPermissionDenied)
+			{
+			INFO_PRINTF1(_L(" The failure is due to Platform Security"));
+			}
+		}
+
+	TVerdict ret = CTestStep::doTestStepPostambleL();
+	return ret;
+	}
+
+/**
+ Get the capability id (enum value) for the capability name 
+ given as string.
+ @param aCapability - Capability name 
+ @param aCapabilityValue - value for the capability name
+ @return TInt - error codes
+ @leave - None
+*/
+EXPORT_C TInt CTestStepSmokeTest::GetCapability(TPtrC aCapability, TCapability& aCapabilityValue)
+	{
+	INFO_PRINTF2(_L("The capability get is %S"), &aCapability);
+	TInt	ret=KErrNone;
+
+	TBuf<KMaxTestExecuteCommandLength>	capCaseValue(aCapability);
+	capCaseValue.LowerCase();
+
+	if(!capCaseValue.Compare(_L("tcb" )))
+		{
+		aCapabilityValue=ECapabilityTCB;
+		}
+	else if(!capCaseValue.Compare(_L("commdd" )))
+		{
+		aCapabilityValue=ECapabilityCommDD;
+		}
+	else if(!capCaseValue.Compare(_L("powermgmt" )))
+		{
+		aCapabilityValue=ECapabilityPowerMgmt;
+		}
+	else if(!capCaseValue.Compare(_L("multimediadd" )))
+		{
+		aCapabilityValue=ECapabilityMultimediaDD;
+		}
+	else if(!capCaseValue.Compare(_L("readdevicedata" )))
+		{
+		aCapabilityValue=ECapabilityReadDeviceData;
+		}
+	else if(!capCaseValue.Compare(_L("writedevicedata" )))
+		{
+		aCapabilityValue=ECapabilityWriteDeviceData;
+		}
+	else if(!capCaseValue.Compare(_L("drm" )))
+		{
+		aCapabilityValue=ECapabilityDRM;
+		}
+	else if(!capCaseValue.Compare(_L("trustedui" )))
+		{
+		aCapabilityValue=ECapabilityTrustedUI;
+		}
+	else if(!capCaseValue.Compare(_L("protserv" )))
+		{
+		aCapabilityValue=ECapabilityProtServ;
+		}
+	else if(!capCaseValue.Compare(_L("diskadmin" )))
+		{
+		aCapabilityValue=ECapabilityDiskAdmin;
+		}
+	else if(!capCaseValue.Compare(_L("networkcontrol" )))
+		{
+		aCapabilityValue=ECapabilityNetworkControl;
+		}
+	else if(!capCaseValue.Compare(_L("allfiles" )))
+		{
+		aCapabilityValue=ECapabilityAllFiles;
+		}
+	else if(!capCaseValue.Compare(_L("swevent" )))
+		{
+		aCapabilityValue=ECapabilitySwEvent;
+		}
+	else if(!capCaseValue.Compare(_L("networkservices" )))
+		{
+		aCapabilityValue=ECapabilityNetworkServices;
+		}
+	else if(!capCaseValue.Compare(_L("localservices" )))
+		{
+		aCapabilityValue=ECapabilityLocalServices;
+		}
+	else if(!capCaseValue.Compare(_L("readuserdata" )))
+		{
+		aCapabilityValue=ECapabilityReadUserData;
+		}
+	else if(!capCaseValue.Compare(_L("writeuserdata")))
+		{
+		aCapabilityValue=ECapabilityWriteUserData;
+		}
+	else if(!capCaseValue.Compare(_L("location")))
+		{
+		aCapabilityValue=ECapabilityLocation;
+		}
+	else if(!capCaseValue.Compare(_L("none")))
+		{
+		aCapabilityValue=ECapability_None;
+		}
+	else
+		{
+		INFO_PRINTF2(_L("Unrecognised capability %S, will be rejected"), &capCaseValue);
+		ret=KErrNotFound;
+		}
+
+	return ret;
+	}
+
+
+/**
+ Verifies the given time is nearly equal to current UTC time.
+ @param aTime - Time needs to be verified 
+ @return TBool - Returns ETrue if aTime is nearly equal to current UTC 
+ time, otherwise EFalse
+ @leave - None
+*/
+EXPORT_C TBool CTestStepSmokeTest::VerifyUTCTime(TTime aTime)
+	{
+	TTime homeTime;
+	TTimeIntervalSeconds utcOffset;
+
+	homeTime.HomeTime();
+	homeTime.SecondsFrom(aTime, utcOffset);
+	INFO_PRINTF2(_L("Calculated utcOffset: %D"), utcOffset.Int());
+	if(Abs<TInt>(utcOffset.Int()) <= (User::UTCOffset().Int()+120) 
+		&& Abs<TInt>(utcOffset.Int()) >= (User::UTCOffset().Int()-120))
+		{
+		return ETrue;
+		}
+	else
+		{
+		return EFalse;
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/bwins/SmokeTestSecureFSClientU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,10 @@
+EXPORTS
+	?ChangeLocaleName@RTestSecureFSclient@@QAEHABVTDesC16@@@Z @ 1 NONAME ; int RTestSecureFSclient::ChangeLocaleName(class TDesC16 const &)
+	?CheckForFile@RTestSecureFSclient@@QAEHABVTDesC16@@@Z @ 2 NONAME ; int RTestSecureFSclient::CheckForFile(class TDesC16 const &)
+	?Connect@RTestSecureFSclient@@QAEHXZ @ 3 NONAME ; int RTestSecureFSclient::Connect(void)
+	?CopyFile@RTestSecureFSclient@@QAEHABVTDesC16@@0@Z @ 4 NONAME ; int RTestSecureFSclient::CopyFile(class TDesC16 const &, class TDesC16 const &)
+	?DeleteFileL@RTestSecureFSclient@@QAEHABVTDesC16@@@Z @ 5 NONAME ; int RTestSecureFSclient::DeleteFileL(class TDesC16 const &)
+	?KillProcessL@RTestSecureFSclient@@QAEXABVTDesC16@@@Z @ 6 NONAME ; void RTestSecureFSclient::KillProcessL(class TDesC16 const &)
+	?SetHomeTime@RTestSecureFSclient@@QAEHABVTTime@@@Z @ 7 NONAME ; int RTestSecureFSclient::SetHomeTime(class TTime const &)
+	?SetUpFbs@RTestSecureFSclient@@QAEXXZ @ 8 NONAME ; void RTestSecureFSclient::SetUpFbs(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/bwins/SmokeTest_UtilsU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,23 @@
+EXPORTS
+	??0CTestProperty@@QAE@AAVCTestStep@@@Z @ 1 NONAME ; CTestProperty::CTestProperty(class CTestStep &)
+	??0CTestStepSmokeTest@@IAE@XZ @ 2 NONAME ; CTestStepSmokeTest::CTestStepSmokeTest(void)
+	??1CTestActive@@UAE@XZ @ 3 NONAME ; CTestActive::~CTestActive(void)
+	??1CTestProperty@@UAE@XZ @ 4 NONAME ; CTestProperty::~CTestProperty(void)
+	??1CTestStepSmokeTest@@UAE@XZ @ 5 NONAME ; CTestStepSmokeTest::~CTestStepSmokeTest(void)
+	??1CTestTimeOutTimer@@UAE@XZ @ 6 NONAME ; CTestTimeOutTimer::~CTestTimeOutTimer(void)
+	?Activate@CTestActive@@QAEXXZ @ 7 NONAME ; void CTestActive::Activate(void)
+	?GetCapability@CTestStepSmokeTest@@IAEHVTPtrC16@@AAW4TCapability@@@Z @ 8 NONAME ; int CTestStepSmokeTest::GetCapability(class TPtrC16, enum TCapability &)
+	?GetPropertyL@CTestProperty@@QAEHVTUid@@HAAH@Z @ 9 NONAME ; int CTestProperty::GetPropertyL(class TUid, int, int &)
+	?GetPropertyL@CTestProperty@@QAEHVTUid@@HAAVTDes16@@@Z @ 10 NONAME ; int CTestProperty::GetPropertyL(class TUid, int, class TDes16 &)
+	?GetPropertyL@CTestProperty@@QAEHVTUid@@HAAVTDes8@@@Z @ 11 NONAME ; int CTestProperty::GetPropertyL(class TUid, int, class TDes8 &)
+	?NewL@CTestActive@@SAPAV1@AAVMTestActiveCallback@@H@Z @ 12 NONAME ; class CTestActive * CTestActive::NewL(class MTestActiveCallback &, int)
+	?NewL@CTestTimeOutTimer@@SAPAV1@AAVMTestTimeOutTimerCallback@@H@Z @ 13 NONAME ; class CTestTimeOutTimer * CTestTimeOutTimer::NewL(class MTestTimeOutTimerCallback &, int)
+	?NewLC@CTestActive@@SAPAV1@AAVMTestActiveCallback@@H@Z @ 14 NONAME ; class CTestActive * CTestActive::NewLC(class MTestActiveCallback &, int)
+	?NewLC@CTestTimeOutTimer@@SAPAV1@AAVMTestTimeOutTimerCallback@@H@Z @ 15 NONAME ; class CTestTimeOutTimer * CTestTimeOutTimer::NewLC(class MTestTimeOutTimerCallback &, int)
+	?SetPropertyL@CTestProperty@@QAEHVTUid@@HABVTDesC16@@@Z @ 16 NONAME ; int CTestProperty::SetPropertyL(class TUid, int, class TDesC16 const &)
+	?SetPropertyL@CTestProperty@@QAEHVTUid@@HABVTDesC8@@@Z @ 17 NONAME ; int CTestProperty::SetPropertyL(class TUid, int, class TDesC8 const &)
+	?SetPropertyL@CTestProperty@@QAEHVTUid@@HH@Z @ 18 NONAME ; int CTestProperty::SetPropertyL(class TUid, int, int)
+	?VerifyUTCTime@CTestStepSmokeTest@@IAEHVTTime@@@Z @ 19 NONAME ; int CTestStepSmokeTest::VerifyUTCTime(class TTime)
+	?doTestStepPostambleL@CTestStepSmokeTest@@UAE?AW4TVerdict@@XZ @ 20 NONAME ; enum TVerdict CTestStepSmokeTest::doTestStepPostambleL(void)
+	?doTestStepPreambleL@CTestStepSmokeTest@@UAE?AW4TVerdict@@XZ @ 21 NONAME ; enum TVerdict CTestStepSmokeTest::doTestStepPreambleL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/eabi/SmokeTestSecureFSclientU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,10 @@
+EXPORTS
+	_ZN19RTestSecureFSclient11DeleteFileLERK7TDesC16 @ 1 NONAME
+	_ZN19RTestSecureFSclient11SetHomeTimeERK5TTime @ 2 NONAME
+	_ZN19RTestSecureFSclient12CheckForFileERK7TDesC16 @ 3 NONAME
+	_ZN19RTestSecureFSclient12KillProcessLERK7TDesC16 @ 4 NONAME
+	_ZN19RTestSecureFSclient16ChangeLocaleNameERK7TDesC16 @ 5 NONAME
+	_ZN19RTestSecureFSclient7ConnectEv @ 6 NONAME
+	_ZN19RTestSecureFSclient8CopyFileERK7TDesC16S2_ @ 7 NONAME
+	_ZN19RTestSecureFSclient8SetUpFbsEv @ 8 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/eabi/SmokeTest_UtilsU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,40 @@
+EXPORTS
+	_ZN11CTestActive4NewLER19MTestActiveCallbacki @ 1 NONAME
+	_ZN11CTestActive5NewLCER19MTestActiveCallbacki @ 2 NONAME
+	_ZN11CTestActive8ActivateEv @ 3 NONAME
+	_ZN11CTestActiveD0Ev @ 4 NONAME
+	_ZN11CTestActiveD1Ev @ 5 NONAME
+	_ZN11CTestActiveD2Ev @ 6 NONAME
+	_ZN13CTestProperty12GetPropertyLE4TUidiR5TDes8 @ 7 NONAME
+	_ZN13CTestProperty12GetPropertyLE4TUidiR6TDes16 @ 8 NONAME
+	_ZN13CTestProperty12GetPropertyLE4TUidiRi @ 9 NONAME
+	_ZN13CTestProperty12SetPropertyLE4TUidiRK6TDesC8 @ 10 NONAME
+	_ZN13CTestProperty12SetPropertyLE4TUidiRK7TDesC16 @ 11 NONAME
+	_ZN13CTestProperty12SetPropertyLE4TUidii @ 12 NONAME
+	_ZN13CTestPropertyC1ER9CTestStep @ 13 NONAME
+	_ZN13CTestPropertyC2ER9CTestStep @ 14 NONAME
+	_ZN13CTestPropertyD0Ev @ 15 NONAME
+	_ZN13CTestPropertyD1Ev @ 16 NONAME
+	_ZN13CTestPropertyD2Ev @ 17 NONAME
+	_ZN18CTestStepSmokeTest13GetCapabilityE7TPtrC16R11TCapability @ 18 NONAME
+	_ZN18CTestStepSmokeTest13VerifyUTCTimeE5TTime @ 19 NONAME
+	_ZN18CTestStepSmokeTest19doTestStepPreambleLEv @ 20 NONAME
+	_ZN18CTestStepSmokeTest20doTestStepPostambleLEv @ 21 NONAME
+	_ZN18CTestStepSmokeTestC2Ev @ 22 NONAME
+	_ZN18CTestStepSmokeTestD0Ev @ 23 NONAME
+	_ZN18CTestStepSmokeTestD1Ev @ 24 NONAME
+	_ZN18CTestStepSmokeTestD2Ev @ 25 NONAME
+	_ZN17CTestTimeOutTimer4NewLER25MTestTimeOutTimerCallbacki @ 26 NONAME
+	_ZN17CTestTimeOutTimer5NewLCER25MTestTimeOutTimerCallbacki @ 27 NONAME
+	_ZN17CTestTimeOutTimerD0Ev @ 28 NONAME
+	_ZN17CTestTimeOutTimerD1Ev @ 29 NONAME
+	_ZN17CTestTimeOutTimerD2Ev @ 30 NONAME
+	_ZTI11CTestActive @ 31 NONAME ; #<TI>#
+	_ZTI13CTestProperty @ 32 NONAME ; #<TI>#
+	_ZTI18CTestStepSmokeTest @ 33 NONAME ; #<TI>#
+	_ZTI17CTestTimeOutTimer @ 34 NONAME ; #<TI>#
+	_ZTV11CTestActive @ 35 NONAME ; #<VT>#
+	_ZTV13CTestProperty @ 36 NONAME ; #<VT>#
+	_ZTV18CTestStepSmokeTest @ 37 NONAME ; #<VT>#
+	_ZTV17CTestTimeOutTimer @ 38 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/group/SmokeTestSecureFSclient.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,32 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestSecureFSclient.mmp
+// 
+//
+
+TARGET			SmokeTestSecureFSclient.dll
+TARGETTYPE		dll
+CAPABILITY		All
+
+UID			0x1000008D  0x101FF347
+VENDORID 		0x70000001
+
+USERINCLUDE		..\Inc
+SYSTEMINCLUDE		\epoc32\include
+SYSTEMINCLUDE		\epoc32\include\test
+
+SOURCEPATH		..\src
+SOURCE			SmokeTestSecureFSclient.cpp
+
+LIBRARY			euser.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/group/SmokeTestSecureFSserver.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,36 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestSecureFSserver.mmp
+// 
+//
+
+
+UID			0x1000008D 0x101FF346
+VENDORID 0x70000001
+
+TARGET			SmokeTestSecureFSserver.exe
+TARGETTYPE		EXE
+CAPABILITY		ALL
+
+USERINCLUDE		..\Inc
+SYSTEMINCLUDE		\epoc32\include
+SYSTEMINCLUDE		\epoc32\include\test
+
+SOURCEPATH		..\SRC
+SOURCE			SmokeTestSecureFSserver.cpp
+
+SOURCEPATH .
+
+LIBRARY			euser.lib
+LIBRARY			efsrv.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/group/SmokeTest_Utils.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,50 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Using relative paths for sourcepath and user includes
+// 
+//
+
+#include "..\..\Group\Configuration.cfg"
+
+TARGET			SmokeTest_Utils.dll
+TARGETTYPE		dll
+UID           	0x1000008D 0x101FF341
+
+#if (!defined __NO_VENDORID__)
+VENDORID		0x70000001
+#endif
+
+CAPABILITY		All -TCB
+
+SOURCEPATH		..\Src
+
+SOURCE			SmokeTestTimeOutTimer.cpp
+SOURCE			SmokeTestActive.cpp
+SOURCE			TestStepSmokeTest.cpp
+SOURCE			SmokeTestProperty.cpp
+
+USERINCLUDE		..\Inc
+USERINCLUDE		..\..\Group
+
+SYSTEMINCLUDE	\epoc32\include
+SYSTEMINCLUDE	\epoc32\include\test
+
+LIBRARY			euser.lib
+LIBRARY			efsrv.lib
+LIBRARY			TestExecuteUtils.lib 
+LIBRARY			TestExecuteLogClient.lib
+LIBRARY			TestConfigFileParser.lib
+
+// We're quite heavy on the stack... 4k in WinS isn't enough...
+EPOCSTACKSIZE	0x6000
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/group/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,31 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Integration test system build description file for self test suite
+// 
+//
+
+PRJ_TESTEXPORTS
+// For Emulator
+../Inc/SmokeTestTimeOutTimer.h			/epoc32/include/test/smoketesttimeouttimer.h
+../Inc/SmokeTestActive.h					/epoc32/include/test/smoketestactive.h
+../Inc/TestStepSmokeTest.h			/epoc32/include/test/teststepsmoketest.h
+../Inc/SmokeTestProperty.h				/epoc32/include/test/smoketestproperty.h
+../Inc/SmokeTestSecureFSclientserver.h			/epoc32/include/test/smoketestsecurefsclientserver.h
+../Inc/SmokeTestSecureFSclient.h				/epoc32/include/test/smoketestsecurefsclient.h
+../Inc/SmokeTestSecureFSserver.h				/epoc32/include/test/smoketestsecurefsserver.h
+
+PRJ_TESTMMPFILES
+SmokeTestSecureFSclient.mmp
+SmokeTestSecureFSserver.mmp
+SmokeTest_Utils.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agenda/Group/Smoketest_Agenda.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,51 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// using relative paths for sourcepath and user includes
+// 
+//
+
+
+TARGET			Smoketest_Agenda_Server.exe
+TARGETTYPE		exe
+UID				0x1000007A 0x101F7771
+
+#if (!defined __NO_VENDORID__)
+VENDORID		0x70000001
+#endif
+
+//CAPABILITY		WriteUserData ReadUserData
+CAPABILITY All -TCB
+
+
+SOURCEPATH		..\Src
+
+SOURCE			TestAgendaServer.cpp
+SOURCE			TestAgendaAddAppt.cpp
+SOURCE			TestAgendaBase.cpp
+SOURCE			TestAgendaCreateDB.cpp
+SOURCE			TestAgendaServerLaunchProgress.cpp
+
+USERINCLUDE		..\Inc ..\..\Group
+
+SYSTEMINCLUDE	\Epoc32\include
+SYSTEMINCLUDE	\Epoc32\include\Test
+
+LIBRARY			apparc.lib
+LIBRARY			euser.lib
+LIBRARY			calinterimapi.lib
+LIBRARY			etext.lib
+LIBRARY			estor.lib
+LIBRARY			efsrv.lib
+LIBRARY			TestExecuteUtils.lib
+LIBRARY			TestExecuteLogClient.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agenda/Group/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,25 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// For Agenda smoketest
+// 
+//
+
+PRJ_TESTEXPORTS
+
+../Scripts/setup_Smoketest_Agenda.script	z:/smoketest/setup_smoketest_agenda.script
+../Scripts/Smoketest_Agenda.script			z:/smoketest/smoketest_agenda.script
+../TestData/Smoketest_Agenda.ini			z:/smoketest/smoketest_agenda.ini
+
+PRJ_TESTMMPFILES
+Smoketest_Agenda.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agenda/Inc/TestAgendaAddAppt.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,37 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestAgendaCreateDB.h
+// This contains CTestAgendaAddAppt
+// 
+//
+
+#ifndef TEST_AGENDA_ADD_APPT_H
+#define TEST_AGENDA_ADD_APPT_H
+
+#include "TestAgendaBase.h"
+
+class CTestAgendaAddAppt : public CTestAgendaBase
+{
+public:
+	CTestAgendaAddAppt();
+	virtual ~CTestAgendaAddAppt();
+
+public:
+	virtual enum TVerdict doTestStepL( void );
+
+private:
+	void	AddEntriesL( void );
+};
+
+#endif /* TEST_AGENDA_ADD_APPT_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agenda/Inc/TestAgendaBase.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,91 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAgendaBase which is the base class for all
+// the Psd Agx suite test steps
+// 
+//
+
+#ifndef TEST_AGENDA_BASE_H
+#define TEST_AGENDA_BASE_H
+
+#include <TestExecuteStepBase.h>
+#include <calentryview.h>
+#include <gdi.h>
+
+
+
+//forward declarations
+class CCalSession;
+
+#define KMaxDateStringLength	30
+#define KMaxTimeStringLength	30
+
+#define KMaxDateStringLength	30
+#define KMaxTimeStringLength	30
+
+class CTestAgendaPicture :public MPictureFactory
+/**
+*  Picture class for the agenda model
+*/
+{
+/**************************************************************
+* An object of this class is used for setting the picture factory
+* of an Agenda model, although our code does not use any of the
+* functionality provided by this class, it is created with empty
+* implementation and set to satisfy the compiler as it uses
+* an assert macro to check if this object is set before saving
+* the agenda model entries into a file
+*************************************************************/
+
+public:
+	CTestAgendaPicture();
+	virtual ~CTestAgendaPicture();
+	virtual void NewPictureL(TPictureHeader& aHeader,const CStreamStore& aDeferredPictureStore)const;
+};
+
+
+class CTestAgendaBase : public CTestStep
+{
+public:
+	CTestAgendaBase();
+	~CTestAgendaBase();
+
+	virtual enum TVerdict	doTestStepPreambleL();
+	virtual enum TVerdict	doTestStepPostambleL();
+
+	CCalSession& CTestAgendaBase::CalSession();
+	void SetCalEntryView(CCalEntryView* calEntryViewPtr);
+
+protected:
+	void	CreateDatabaseL();
+	void	OpenDatabaseL();
+	void	CleanupDatabase();
+
+private:
+	CActiveScheduler*	iSchedular;
+	TBool				iEnteredBlocked;
+	TBool				iExitedBlocked;
+
+protected:
+    RFs					iFs;
+	TBool				iSessionConnected;
+	CCalEntryView*      iCalEntryViewBase;
+	/**
+	To store the models entries
+	*/
+	CFileStore*			iStore;
+	CCalSession*        iCalSession;
+};
+
+#endif /* TEST_AGENDA_BASE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agenda/Inc/TestAgendaCreateDB.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAgendaCreateDB
+// 
+//
+
+#ifndef TEST_AGENDA_CREATE_DB_H
+#define TEST_AGENDA_CREATE_DB_H
+
+#include "TestAgendaBase.h"
+
+class CTestAgendaCreateDB : public CTestAgendaBase
+{
+public:
+	CTestAgendaCreateDB();
+	virtual ~CTestAgendaCreateDB();
+
+public:
+	virtual enum TVerdict doTestStepL( void );
+
+};
+
+#endif /* TEST_AGENDA_CREATE_DB_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agenda/Inc/TestAgendaServer.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,33 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAgendaServer
+// 
+//
+
+#ifndef TEST_AGENDA_SERVER_H
+#define TEST_AGENDA_SERVER_H
+
+#include <TestExecuteServerBase.h>
+
+class  CTestAgendaServer : public CTestServer
+{
+public:
+	static CTestAgendaServer*	NewL();
+	virtual CTestStep*			CreateTestStep(const TDesC& aStepName);
+
+private:
+	void	ConstructL();
+};
+
+#endif /* TEST_AGENDA_SERVER_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agenda/Inc/TestAgendaServerLaunchProgress.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,75 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAgendaServerLaunchProgress
+// 
+//
+
+#ifndef TEST_AGENDA_SERVER_LAUNCH_PROGRESS_H
+#define TEST_AGENDA_SERVER_LAUNCH_PROGRESS_H
+
+#include "TestAgendabase.h"
+#include <e32base.h>
+#include <calprogresscallback.h>
+
+
+//forward declaration
+//class CTestAgendaBase;
+class CCalEntryView;
+
+
+class CTestAgendaServerLaunchProgress : public CActive, private MCalProgressCallBack
+/**
+* This class provides an implementationfor the pure virtual functions
+* declared in MAgnProgressCallBack. The framework  makes calls to the
+* functions indidcating the status of the operation.
+*/
+{
+public:
+	static CTestAgendaServerLaunchProgress* NewL(CTestAgendaBase* aAgendaBase);
+	virtual ~CTestAgendaServerLaunchProgress();
+	void	Start();
+
+	//from CActive
+	virtual void	RunL();
+	virtual void	DoCancel();
+
+private:
+	CTestAgendaServerLaunchProgress(CTestAgendaBase* aAgendaBase);
+	void	ConstructL();
+
+	//from MAgnProgressCallBack
+	virtual void	Completed(TInt aError = KErrNone);
+	virtual void	Progress(TInt aPercentageCompleted);
+	virtual TBool NotifyProgress();
+
+private:
+	/**
+	pointer to the CTestAgendaBase object.
+	*/
+	CTestAgendaBase*			iAgendaBase;
+    CCalEntryView*              iCalEntryView;
+
+	/**
+	file in which the entries are present
+	*/
+	TPtrC						iFileName;
+
+	/**
+	file server session
+	*/
+	RFs							iFs;
+
+};
+
+#endif TEST_AGENDA_SERVER_LAUNCH_PROGRESS_H
Binary file agenda/ReadMe.doc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agenda/Scripts/Smoketest_Agenda.script	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,26 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRINT Run Agenda smoketest
+//
+LOAD_SUITE Smoketest_Agenda_Server
+//
+START_TESTCASE 8981
+RUN_TEST_STEP 100	Smoketest_Agenda_Server	CreateDB	c:\Smoketest\Smoketest_Agenda.ini	18920_CreateDB
+END_TESTCASE 8981
+START_TESTCASE 8979
+RUN_TEST_STEP 1000	Smoketest_Agenda_Server	AddAppt		c:\Smoketest\Smoketest_Agenda.ini	24560_AddAppts
+END_TESTCASE 8979
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agenda/Scripts/setup_Smoketest_Agenda.script	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,22 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+RUN_UTILS MkDir c:\Smoketest\
+
+RUN_UTILS CopyFile z:\smoketest\smoketest_agenda.ini	c:\smoketest\smoketest_agenda.ini
+RUN_UTILS MakeReadWrite c:\smoketest\smoketest_agenda.ini
+
+// RUN_SCRIPT Smoketest_Agenda.script
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agenda/Src/TestAgendaAddAppt.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,191 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAgendaAddAppt
+// 
+//
+
+#include <TestExecuteClient.h>
+#include <calentry.h>
+#include <calalarm.h> 
+
+
+#include "TestAgendaAddAppt.h"
+
+_LIT(KCount,		"count");
+_LIT(KYear,			"year%d");
+_LIT(KMonth,		"month%d");
+_LIT(KDay,			"day%d");
+_LIT(KHour,			"hour%d");
+_LIT(KMinute,		"min%d");
+_LIT(KDuration,		"duration%d");
+_LIT(KMessage,		"message%d");
+_LIT(KAlarm,		"alarm%d");
+_LIT(KAlarmSound,	"alarmsound%d");
+
+// constructor
+CTestAgendaAddAppt::CTestAgendaAddAppt()
+	{
+	SetTestStepName(_L("AddAppt"));
+	}
+
+// destructor
+CTestAgendaAddAppt::~CTestAgendaAddAppt()
+	{
+	}
+
+// Each test step must supply a implementation for doTestStepL
+enum TVerdict CTestAgendaAddAppt::doTestStepL( void )
+	{
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("TEST-> ADDING APPOINTMENT ENTRIES"));
+
+	OpenDatabaseL();
+	if ( TestStepResult() == EPass )
+		{
+		TRAPD(r, AddEntriesL());
+		if (r!=KErrNone)
+			SetTestStepResult(EFail);
+		}
+	CleanupDatabase();
+
+	// test steps return a result
+	return TestStepResult();
+	}
+	
+// Destroy the RPointerArray
+void DestroyRPointerArray(TAny* aPtr)
+        {
+        RPointerArray<CCalEntry>* self = static_cast<RPointerArray<CCalEntry>*> (aPtr);
+        self->ResetAndDestroy();
+        }
+
+
+void CTestAgendaAddAppt::AddEntriesL( void )
+	{
+	TInt	count=1;
+	if ( !GetIntFromConfig(ConfigSection(), KCount, count) )
+		count=1;
+
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+	TInt	year;
+	TInt	month;
+	TInt	day;
+	TInt	hour;
+	TInt	minute;
+	TInt	duration;
+	TInt	alarm;
+	TPtrC	ptrAlarmSound;
+	TPtrC	ptrMessage;
+	TBuf<KMaxDateStringLength> dateString;
+	_LIT(KDateString,"%*E%*D%X%*N%*Y %1 %2 '%3");
+
+	RPointerArray<CCalEntry> array;
+    CleanupStack::PushL(TCleanupItem(DestroyRPointerArray, &array));
+
+	for (TInt entry=0; entry<count && TestStepResult() == EPass; )
+		{
+		TTime	today;
+		today.HomeTime();
+
+		tempStore.Format(KYear(), ++entry);
+		if ( !GetIntFromConfig(ConfigSection(), tempStore, year) )
+			year=today.DateTime().Year();
+
+		tempStore.Format(KMonth(), entry);
+		if ( !GetIntFromConfig(ConfigSection(), tempStore, month) )
+			month=today.DateTime().Month();
+
+		tempStore.Format(KDay(), entry);
+		if ( !GetIntFromConfig(ConfigSection(), tempStore, day) )
+			day=today.DateTime().Day();
+		else
+			--day;
+
+		tempStore.Format(KHour(), entry);
+		if ( !GetIntFromConfig(ConfigSection(), tempStore, hour) )
+			hour=today.DateTime().Hour();
+
+		tempStore.Format(KMinute(), entry);
+		if ( !GetIntFromConfig(ConfigSection(), tempStore, minute) )
+			minute=0;
+
+		tempStore.Format(KDuration(), entry);
+		if ( !GetIntFromConfig(ConfigSection(), tempStore, duration) )
+			duration=30;
+
+		tempStore.Format(KMessage(), entry);
+		GetStringFromConfig(ConfigSection(), tempStore, ptrMessage);
+
+		TTime		startTime(TDateTime(year, TMonth(month-1+EJanuary), day, hour, minute,0,0));
+		startTime.FormatL(dateString,KDateString);
+	  	INFO_PRINTF2(_L("Start date is  %S"), &dateString);
+
+		TTime		endTime = startTime + TTimeIntervalMinutes(duration);
+		endTime.FormatL(dateString,KDateString);
+	  	INFO_PRINTF2(_L("End date is  %S"), &dateString);
+
+		
+		HBufC8* uid = HBufC8::NewLC(255);
+		TPtr8 uidP = uid->Des();
+		uidP.Append(count);
+		
+		CCalEntry* calEntry = CCalEntry::NewL(CCalEntry::EAppt, uid, CCalEntry::EMethodNone, 0);
+		
+		CleanupStack::Pop(); //uid
+		CleanupStack::PushL(calEntry);
+		
+		TCalTime calStartTime, calEndTime;
+		
+		calStartTime.SetTimeLocalL(startTime);
+		calEndTime.SetTimeLocalL(endTime);
+		
+		calEntry->SetStartAndEndTimeL(calStartTime, calEndTime);
+		
+		tempStore.Format(KAlarm(), entry);
+		if ( GetIntFromConfig(ConfigSection(), tempStore, alarm) )
+			{
+			TTimeIntervalMinutes	currentTime((hour*60) + minute);
+			TTimeIntervalMinutes	alarmTime(currentTime.Int());
+			
+			CCalAlarm* calAlarm = CCalAlarm::NewL();
+			CleanupStack::PushL(calAlarm);
+			
+			calAlarm->SetTimeOffset(alarmTime);
+			
+			tempStore.Format(KAlarmSound(), entry);
+			if ( GetStringFromConfig(ConfigSection(), tempStore, ptrAlarmSound) )
+				calAlarm->SetAlarmSoundNameL(ptrAlarmSound);
+			else
+				calAlarm->SetAlarmSoundNameL(_L("Bells"));
+			
+			calEntry->SetAlarmL(calAlarm);
+			CleanupStack::PopAndDestroy(); //calAlarm
+			}
+		//Store in the array
+		array.AppendL(calEntry);
+		
+		CleanupStack::Pop(); //calEntry
+		}
+		INFO_PRINTF1(_L("About to store appointments now"));
+		TInt success(0);
+		TRAPD(storeError, iCalEntryViewBase->StoreL(array, success));
+		INFO_PRINTF2(_L("Store result is %d"), storeError);
+		if (success != count && storeError == KErrNone)
+		    {
+			SetTestStepResult(EFail);
+		    } 
+		
+		CleanupStack::PopAndDestroy(&array);
+		
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agenda/Src/TestAgendaBase.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,223 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAgendaCase which is the base class for all the Agenda TestCase DLL
+// 
+//
+
+// EPOC includes
+#include <e32base.h>
+#include <Uri16.h>
+#include <UriUtils.h>
+#include <TestExecuteLog.h>
+#include "TestAgendabase.h"
+#include "TestAgendaServerLaunchProgress.h"
+
+#include <calsession.h>
+
+
+
+_LIT(KDef,		"default");
+_LIT(KFileName,		"filenameSecure");
+
+void CTestAgendaPicture::NewPictureL(TPictureHeader& /*aHeader*/,const CStreamStore& /*aDeferredPictureStore*/)const
+/**
+Creates a new Picture object for use by agenda model, currently the implementation is empty as our code
+does not use any the functionality.
+*/
+	{
+	//empty implementation
+	}
+
+CTestAgendaPicture::CTestAgendaPicture()
+/**
+constructor, currently the implementation is empty
+*/
+	{
+	//empty implementation
+	}
+
+CTestAgendaPicture::~CTestAgendaPicture()
+/**
+destructor, currently the implementation is empty
+*/
+	{
+	//empty implementation
+	}
+
+CTestAgendaBase::CTestAgendaBase()
+: CTestStep()
+, iSchedular(NULL)
+, iEnteredBlocked(EFalse)
+, iExitedBlocked(EFalse)
+, iSessionConnected(EFalse)
+, iCalEntryViewBase(NULL)
+, iStore(NULL)
+, iCalSession(NULL)
+	{
+	}
+
+// destructor
+CTestAgendaBase::~CTestAgendaBase()
+	{
+	delete iSchedular;
+	iSchedular=NULL;
+	
+	}
+
+enum TVerdict CTestAgendaBase::doTestStepPreambleL()
+	{
+	TVerdict	ret = CTestStep::doTestStepPreambleL();
+	
+	INFO_PRINTF1(_L("doTestStepPreambleL"));
+	iSchedular=new (ELeave) CActiveScheduler();
+	CActiveScheduler::Install(iSchedular);
+	
+	iCalSession = CCalSession::NewL();
+
+	return ret;
+	}
+
+enum TVerdict CTestAgendaBase::doTestStepPostambleL()
+	{
+	
+	delete iCalEntryViewBase;
+	iCalEntryViewBase=NULL;
+	
+	delete iSchedular;
+	iSchedular=NULL;
+	CActiveScheduler::Install(NULL);
+	
+
+	return CTestStep::doTestStepPostambleL();
+	}
+
+// Create a new database
+void CTestAgendaBase::CreateDatabaseL( void )
+	{
+	TPtrC	ptrFileName;
+	TBool	returnValue =GetStringFromConfig(ConfigSection(), KFileName, ptrFileName);
+	if ( !returnValue )
+		returnValue=GetStringFromConfig(KDef, KFileName, ptrFileName);
+	
+	if (returnValue)
+		{
+		INFO_PRINTF2(_L("filename = %S"), &ptrFileName);
+		}
+	else
+		{
+		User::Leave(KErrNotFound);
+		}
+
+	//	Connect file server
+	User::LeaveIfError(iFs.Connect());
+	iSessionConnected=ETrue;
+	
+	TInt r;
+	if (iCalSession)
+	    {
+		TRAP(r, iCalSession->CreateCalFileL(ptrFileName));
+	    }
+	    
+	if (r == KErrAlreadyExists)
+	    {
+		TRAP_IGNORE(iCalSession->DeleteCalFileL(ptrFileName));
+		TRAP(r, iCalSession->CreateCalFileL(ptrFileName));
+	    }
+
+        
+	if (r!=KErrNone && r!=KErrAlreadyExists)
+		{
+		ERR_PRINTF2(_L("Creating Agenda file failed with error %d"), r);
+		SetTestStepResult(EFail);
+		}
+	}
+
+void CTestAgendaBase::OpenDatabaseL( void )
+	{
+	TPtrC	ptrFileName;
+	TBool	returnValue =GetStringFromConfig(ConfigSection(), KFileName, ptrFileName);
+	if ( !returnValue )
+		returnValue=GetStringFromConfig(KDef, KFileName, ptrFileName);
+	
+
+	if (returnValue)
+		{
+		INFO_PRINTF2(_L("filename = %S"), &ptrFileName);
+		}
+	else
+		{
+		User::Leave(KErrNotFound);
+		}
+
+	//	Connect file server
+	User::LeaveIfError(iFs.Connect());
+	iSessionConnected=ETrue;
+
+    
+	if (iCalSession)
+	    {
+		iCalSession->OpenL(ptrFileName);
+	    }	
+    
+	//open the database by creating an object of CTestAgendaServerLaunchProgress
+	CTestAgendaServerLaunchProgress*	progress = CTestAgendaServerLaunchProgress::NewL(this);
+	CleanupStack::PushL(progress);
+
+	//kick start the launching process
+	progress->Start();
+	CActiveScheduler::Start();
+	CleanupStack::PopAndDestroy(progress);
+
+	}
+
+void CTestAgendaBase::CleanupDatabase( void )
+	{
+	if (iCalEntryViewBase)
+	    {
+		delete iCalEntryViewBase;
+		iCalEntryViewBase = NULL;
+	    }
+
+/*	if (iCalSession)
+		{
+		delete iCalSession;
+		iCalSession=NULL;
+		}*/
+
+
+	if (iSessionConnected)
+		{
+		iFs.Close();
+		iSessionConnected=EFalse;
+		}
+	}
+	
+void CTestAgendaBase::SetCalEntryView(CCalEntryView* calEntryViewPtr)
+    {
+	iCalEntryViewBase = calEntryViewPtr;
+    }
+
+CCalSession& CTestAgendaBase::CalSession()
+    {
+	if (iCalSession)
+	    {
+		return *iCalSession;
+	    }
+	else
+	    {
+	    iCalSession = CCalSession::NewL();
+	    
+	    return *iCalSession;	
+	    }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agenda/Src/TestAgendaCreateDB.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,43 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAgendaCreateDB
+// 
+//
+
+#include <TestExecuteLog.h>
+
+#include "TestAgendaCreateDB.h"
+
+// constructor
+CTestAgendaCreateDB::CTestAgendaCreateDB()
+	{
+	SetTestStepName(_L("CreateDB"));
+	}
+
+// destructor
+CTestAgendaCreateDB::~CTestAgendaCreateDB()
+	{
+	}
+
+// Each test step must supply a implementation for doTestStepL
+enum TVerdict CTestAgendaCreateDB::doTestStepL( void )
+	{
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("TEST-> CREATING OUR AGENDA DATABASE"));
+
+	CreateDatabaseL();
+
+	// test steps return a result
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agenda/Src/TestAgendaServer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,107 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This main DLL entry point for the Smoketest_Agenda.dll
+// 
+//
+
+
+// EPOC includes
+#include <e32base.h>
+
+#include "TestAgendaServer.h"
+#include "TestAgendaAddAppt.h"
+#include "TestAgendaCreateDB.h"
+
+
+_LIT(KServerName,"Smoketest_Agenda_Server");
+
+CTestAgendaServer* CTestAgendaServer::NewL()
+/**
+ * @return - Instance of the test server
+ * Same code for Secure and non-secure variants
+ * Called inside the MainL() function to create and start the
+ * CTestServer derived server.
+ */
+	{
+	CTestAgendaServer*	server = new (ELeave) CTestAgendaServer();
+	CleanupStack::PushL(server);
+	// CServer base class call
+	server->StartL(KServerName);
+	CleanupStack::Pop(server);
+	return server;
+	}
+
+
+LOCAL_C void MainL()
+/**
+ * Secure variant
+ * Much simpler, uses the new Rendezvous() call to sync with the client
+ */
+	{
+#if (defined __DATA_CAGING__)
+	RProcess().DataCaging(RProcess::EDataCagingOn);
+	RProcess().SecureApi(RProcess::ESecureApiOn);
+#endif
+	CActiveScheduler*	sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sched);
+	CTestAgendaServer*	server = NULL;
+	// Create the CTestServer derived server
+	TRAPD(err,server = CTestAgendaServer::NewL());
+	if(!err)
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	delete server;
+	delete sched;
+	}
+
+
+GLDEF_C TInt E32Main()
+/**
+ * @return - Standard Epoc error code on process exit
+ * Secure variant only
+ * Process entry point. Called by client using RProcess API
+ */
+	{
+	__UHEAP_MARK;
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAPD(err,MainL());
+	delete cleanup;
+	__UHEAP_MARKEND;
+	return err;
+    }
+
+
+CTestStep* CTestAgendaServer::CreateTestStep(const TDesC& aStepName)
+/**
+ * @return - A CTestStep derived instance
+ * Secure and non-secure variants
+ * Implementation of CTestServer pure virtual
+ */
+	{
+	CTestStep*	testStep = NULL;
+
+	if(aStepName == _L("AddAppt"))
+		testStep = new CTestAgendaAddAppt();
+	else if(aStepName == _L("CreateDB"))
+		testStep = new CTestAgendaCreateDB(); 
+	return testStep;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agenda/Src/TestAgendaServerLaunchProgress.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,119 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAgendaServerLaunchProgress
+// 
+//
+
+#include "TestAgendaServerLaunchProgress.h"
+#include <calentryview.h>
+
+CTestAgendaServerLaunchProgress* CTestAgendaServerLaunchProgress::NewL(CTestAgendaBase* aAgendaBase)
+/**
+ * @return - Instance of the agenda progress callback
+ */
+	{
+	CTestAgendaServerLaunchProgress*	progress = new (ELeave) CTestAgendaServerLaunchProgress(aAgendaBase);
+	CleanupStack::PushL(progress);
+	progress->ConstructL();
+	CleanupStack::Pop(progress);
+	return progress;
+	}
+
+CTestAgendaServerLaunchProgress::CTestAgendaServerLaunchProgress(CTestAgendaBase* aAgendaBase)
+:	CActive(EPriorityStandard)
+,	iAgendaBase(aAgendaBase)
+/**
+constructor
+*/
+	{
+	}
+
+void CTestAgendaServerLaunchProgress::ConstructL()
+/**
+constructor
+*/
+	{
+	//adding this active object into an active scheduler
+	CActiveScheduler::Add(this);
+	}
+
+CTestAgendaServerLaunchProgress::~CTestAgendaServerLaunchProgress()
+/**
+destructor
+*/
+	{
+ 	}
+
+void CTestAgendaServerLaunchProgress::Completed(TInt aError)
+/**
+callback function invoked after the file is completely loaded.
+@param	TInt aError
+*/
+	{
+	if(aError != KErrNone)
+		{
+		iAgendaBase ->INFO_PRINTF2(_L("Opening the agenda database file failed with error %D"),aError);
+		iAgendaBase ->SetTestStepResult(EFail);
+		}
+	else
+		{
+		iAgendaBase ->INFO_PRINTF1(_L("Opening the Agenda database succesful"));
+		}
+		CActiveScheduler::Stop();
+	}
+
+void CTestAgendaServerLaunchProgress::Progress(TInt aPercentageCompleted)
+/**
+callback function invoked to indicate the progress
+@param aPercentageCompleted percent file loaded
+*/
+	{
+	//log the progress percentage of saving the entries
+	iAgendaBase ->INFO_PRINTF2(_L("%D%% completed opening the agenda database"),aPercentageCompleted);
+	}
+
+TBool CTestAgendaServerLaunchProgress::NotifyProgress()
+    {
+	return ETrue;
+    }
+    
+void CTestAgendaServerLaunchProgress::RunL()
+/**
+RunL from CActive class, opens the agenda database file, and builds the indices
+@leave system wide error code
+*/
+	{
+	CCalEntryView* calEntryViewPtr = CCalEntryView::NewL(iAgendaBase->CalSession(), *this);
+	iAgendaBase->SetCalEntryView(calEntryViewPtr);
+	}
+
+void CTestAgendaServerLaunchProgress::DoCancel()
+/**
+DoCancel of the active object
+*/
+	{
+	iAgendaBase ->INFO_PRINTF1(_L("Inside do cancel of the active object"));
+	}
+
+
+void CTestAgendaServerLaunchProgress::Start(void)
+/**
+starts the saving process
+*/
+	{
+	TRequestStatus *threadStatus=&iStatus;
+	User::RequestComplete(threadStatus,KErrNone);
+	SetActive();
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agenda/Src/sm_agenda.ini	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1 @@
+[Files MRU]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agenda/TestData/Smoketest_Agenda.ini	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,35 @@
+[default]
+filename		=c:\smoketest\Smoketest_Agenda
+filenameSecure		=c:Smoketest_Agenda
+
+[18920_CreateDB]
+
+[24560_AddAppts]
+count			=3
+
+year1			=2002
+month1			=9
+day1			=15
+hour1			=9
+min1			=0
+duration1		=15
+message1		=make a cup of tea
+
+year2			=2002
+month2			=9
+day2			=16
+hour2			=14
+min2			=0
+duration2		=60
+message2		=football
+alarm2			=15
+
+year3			=2002
+month3			=9
+day3			=15
+hour3			=12
+min3			=0
+duration3		=30
+message3		=have lunch
+alarm3			=15
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agenda/bwins/SMOKETEST_AGENDA_SERVERU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?NewServer@@YAHXZ @ 1 NONAME ; int __cdecl NewServer(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/appinstall/Bmarm/AppInstallSmokeTestModuleU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/appinstall/Bwins/AppInstallSmokeTestModuleU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/appinstall/EABI/AppInstallSmokeTestModuleU.def	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/appinstall/conf/AppInstallSmokeTestModule.cfg	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,15 @@
+[Test]
+title Install Application
+create AppInstallSmokeTestModule installer
+installer InstallApp c:\smoketest\appinstall\sistest_winscw.sisx
+delete installer
+[Endtest]
+
+[Test]
+title Uninstall Application
+create AppInstallSmokeTestModule uninstaller
+uninstaller UninstallApp E4F8641B
+delete uninstaller
+[Endtest]
+
+
Binary file appinstall/data/sistest.sisx has changed
Binary file appinstall/data/sistest_winscw.sisx has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/appinstall/group/AppInstallSmokeTestModule.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,77 @@
+/*TYPE TESTCLASS*/
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: MMP file for STIF Test Framework's TestScripter 
+* testclass test module.
+*
+*/
+
+#include <platform_paths.hrh>
+
+TARGET          AppInstallSmokeTestModule.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         AppInstallSmokeTestModule.def
+
+USERINCLUDE     ../inc 
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE	/epoc32/include/ecom
+
+SOURCEPATH      ../src
+
+SOURCE          AppInstallSmokeTestModule.cpp
+SOURCE          AppInstallSmokeTestModuleBlocks.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY			swinstcli.lib
+
+LANG            SC
+
+/*
+START WINS      
+?wins_specific_information
+END
+
+START MARM
+?marm_specific_information
+END
+*/
+// Other possible keywords:
+ 
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+/*
+START BITMAP ?target
+TARGETPATH   ?emulated_path_on_target_machine
+HEADER
+SOURCE       ?color_depth ?source_bitmap
+END
+*/
+// DEFFILE ?filename
+// AIF ?filename
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/appinstall/group/Bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description:
+*
+*/
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+	
+	DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+../conf/AppInstallSmokeTestModule.cfg	c:/smoketest/AppInstallSmokeTestModule.cfg
+../data/sistest_winscw.sisx				c:/smoketest/appinstall/sistest_winscw.sisx
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in \epoc32\include
+// Example: 
+/*
+\agnmodel\inc\AGMCOMON.H
+*/
+
+PRJ_TESTMMPFILES
+
+	AppInstallSmokeTestModule.mmp
+
+PRJ_MMPFILES
+
+
+// Specify the .mmp files required for building the important component
+// releasables.
+//
+// Specify "tidy" if the component you need to build doesn't need to be
+// released. Specify "ignore" if the MMP file exists but should be
+// ignored.
+// Example:
+/*
+\agnmodel\group\agnmodel.mmp
+#if defined(MARM)
+\agnmodel\group\agsvexe.mmp
+#endif
+*/
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/appinstall/inc/AppInstallSmokeTestModule.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,186 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: STIF testclass declaration
+*
+*/
+
+#ifndef APPINSTALLSMOKETESTMODULE_H
+#define APPINSTALLSMOKETESTMODULE_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KAppInstallSmokeTestModuleLogPath, "\\logs\\testframework\\AppInstallSmokeTestModule\\" ); 
+// Log file
+_LIT( KAppInstallSmokeTestModuleLogFile, "AppInstallSmokeTestModule.txt" ); 
+_LIT( KAppInstallSmokeTestModuleLogFileWithTitle, "AppInstallSmokeTestModule_[%S].txt" );
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CAppMngr2Runtime;
+class CAppInstallSmokeTestModule;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+
+// CLASS DECLARATION
+
+/**
+*  CAppInstallSmokeTestModule test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CAppInstallSmokeTestModule) : public CScriptBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CAppInstallSmokeTestModule* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CAppInstallSmokeTestModule();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CScriptBase Runs a script line.
+        * @since ?Series60_version
+        * @param aItem Script line containing method name and parameters
+        * @return Symbian OS error code
+        */
+        virtual TInt RunMethodL( CStifItemParser& aItem );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CAppInstallSmokeTestModule( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+        * Test methods are listed below. 
+        */
+
+        /**
+        * Example test method.
+        * @since ?Series60_version
+        * @param aItem Script line containing parameters.
+        * @return Symbian OS error code.
+        */
+        virtual TInt InstallAppL( CStifItemParser& aItem );
+        virtual TInt UninstallAppL( CStifItemParser& aItem );
+        
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+        //ADD NEW METHOD DEC HERE
+        //[TestMethods] - Do not remove
+
+    public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+    	RPointerArray<CAppMngr2Runtime> iPlugins;
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // APPINSTALLSMOKETESTMODULE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/appinstall/src/AppInstallSmokeTestModule.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,199 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains testclass implementation.
+*
+*/
+
+// INCLUDE FILES
+#include <Stiftestinterface.h>
+#include "AppInstallSmokeTestModule.h"
+#include <SettingServerClient.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CAppInstallSmokeTestModule::CAppInstallSmokeTestModule
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CAppInstallSmokeTestModule::CAppInstallSmokeTestModule( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CAppInstallSmokeTestModule::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CAppInstallSmokeTestModule::ConstructL()
+    {
+    //Read logger settings to check whether test case name is to be
+    //appended to log file name.
+    RSettingServer settingServer;
+    TInt ret = settingServer.Connect();
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        }
+    // Struct to StifLogger settigs.
+    TLoggerSettings loggerSettings; 
+    // Parse StifLogger defaults from STIF initialization file.
+    ret = settingServer.GetLoggerSettings(loggerSettings);
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        } 
+    // Close Setting server session
+    settingServer.Close();
+
+    TFileName logFileName;
+    
+    if(loggerSettings.iAddTestCaseTitle)
+        {
+        TName title;
+        TestModuleIf().GetTestCaseTitleL(title);
+        logFileName.Format(KAppInstallSmokeTestModuleLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KAppInstallSmokeTestModuleLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KAppInstallSmokeTestModuleLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// CAppInstallSmokeTestModule::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CAppInstallSmokeTestModule* CAppInstallSmokeTestModule::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CAppInstallSmokeTestModule* self = new (ELeave) CAppInstallSmokeTestModule( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CAppInstallSmokeTestModule::~CAppInstallSmokeTestModule()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+
+    }
+
+//-----------------------------------------------------------------------------
+// CAppInstallSmokeTestModule::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CAppInstallSmokeTestModule::SendTestClassVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("AppInstallSmokeTestModule.dll");
+
+	TBool newVersionOfMethod = ETrue;
+	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+	}
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CAppInstallSmokeTestModule::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/appinstall/src/AppInstallSmokeTestModuleBlocks.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,211 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains testclass implementation.
+*
+*/
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+#include <ImplementationInformation.h>
+#include <SwInstApi.h>
+#include "AppInstallSmokeTestModule.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+using namespace SwiUI;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CAppInstallSmokeTestModule::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CAppInstallSmokeTestModule::Delete() 
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CAppInstallSmokeTestModule::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CAppInstallSmokeTestModule::RunMethodL( 
+    CStifItemParser& aItem ) 
+    {
+
+    static TStifFunctionInfo const KFunctions[] =
+        {  
+        // Copy this line for every implemented function.
+        // First string is the function name used in TestScripter script file.
+        // Second is the actual implementation member function.
+        ENTRY( "InstallApp", CAppInstallSmokeTestModule::InstallAppL ),
+        ENTRY( "UninstallApp", CAppInstallSmokeTestModule::UninstallAppL ),
+        //ADD NEW ENTRY HERE
+        // [test cases entries] - Do not remove
+
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CAppInstallSmokeTestModule::ExampleL
+// Example test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CAppInstallSmokeTestModule::InstallAppL( CStifItemParser& aItem )
+    {
+    // Print to UI
+    _LIT( KAppInstallSmokeTestModule, "AppInstallSmokeTestModule" );
+    _LIT( KInstallApp, "In InstallApp" );
+    TestModuleIf().Printf( 0, KAppInstallSmokeTestModule, KInstallApp );
+    // Print to log file
+    iLog->Log( KInstallApp );
+
+    TInt i = 0;
+    TPtrC sisPath;
+    if ( aItem.GetNextString ( sisPath ) == KErrNone )
+        {
+        RSWInstSilentLauncher installer;
+        CleanupClosePushL(installer);
+        User::LeaveIfError(installer.Connect());
+        
+        TInstallOptionsPckg options;
+        options().iUpgrade = SwiUI::EPolicyAllowed;
+        options().iPackageInfo = SwiUI::EPolicyAllowed;
+        options().iOverwrite = SwiUI::EPolicyAllowed;
+        options().iKillApp = SwiUI::EPolicyAllowed;
+
+        
+        User::LeaveIfError(installer.SilentInstall(sisPath, options));
+        
+        CleanupStack::PopAndDestroy(&installer);
+        }
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CAppInstallSmokeTestModule::ExampleL
+// Example test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CAppInstallSmokeTestModule::UninstallAppL( CStifItemParser& aItem )
+    {
+
+    // Print to UI
+    _LIT( KAppInstallSmokeTestModule, "AppInstallSmokeTestModule" );
+    _LIT( KUninstallApp, "In UninstallApp" );
+    TestModuleIf().Printf( 0, KAppInstallSmokeTestModule, KUninstallApp );
+    // Print to log file
+    iLog->Log( KUninstallApp );
+
+    TUint pkgUid;
+    if ( aItem.GetNextInt(pkgUid, EHex) == KErrNone )
+        {
+        RSWInstSilentLauncher uninstaller;
+        CleanupClosePushL(uninstaller);
+        User::LeaveIfError(uninstaller.Connect());
+        
+        TInstallOptionsPckg options;
+        options().iUpgrade = SwiUI::EPolicyAllowed;
+        options().iPackageInfo = SwiUI::EPolicyAllowed;
+        options().iOverwrite = SwiUI::EPolicyAllowed;
+        options().iKillApp = SwiUI::EPolicyAllowed;
+        
+        User::LeaveIfError(uninstaller.SilentUninstall( TUid::Uid(pkgUid), options, SwiUI::KSisxMimeType ));
+        
+        CleanupStack::PopAndDestroy(&uninstaller);
+        }
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CAppInstallSmokeTestModule::?member_function
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*
+TInt CAppInstallSmokeTestModule::?member_function(
+   CItemParser& aItem )
+   {
+
+   ?code
+
+   }
+*/
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+//  [End of File] - Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apploader/Group/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,24 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// For Agenda smoketest
+// 
+//
+
+PRJ_TESTEXPORTS
+..\scripts\setup_smoketest_apploader.script	z:\smoketest\setup_smoketest_apploader.script
+..\scripts\smoketest_apploader.script		z:\smoketest\smoketest_apploader.script
+..\testdata\smoketest_apploader.ini			z:\smoketest\smoketest_apploader.ini
+
+PRJ_TESTMMPFILES
+smoketest_apploader.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apploader/Group/smoketest_apploader.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,54 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// using relative paths for sourcepath and user includes
+// 
+//
+
+
+TARGET          smoketest_apploader.exe
+TARGETTYPE		exe
+UID				0x1000007A 0x101F7776
+
+#if (!defined __NO_VENDORID__)
+VENDORID		0x70000001
+#endif
+
+CAPABILITY		All -TCB
+
+
+SOURCEPATH		..\Src
+
+SOURCE			TestAppLoaderServer.cpp
+SOURCE			TestAppLoaderBase.cpp
+SOURCE			TestAppLoaderAppStart.cpp
+SOURCE			TestAppLoaderEndTask.cpp
+SOURCE			TestAppLoaderKeyEvents.cpp
+SOURCE			TestAppLoaderKillProcess.cpp
+SOURCE			TestAppLoaderTaskRunning.cpp
+
+USERINCLUDE		..\Inc ..\..\Group
+
+SYSTEMINCLUDE	\Epoc32\include
+SYSTEMINCLUDE	\Epoc32\include\Test
+
+LIBRARY			apparc.lib
+LIBRARY			euser.lib
+LIBRARY			etext.lib
+LIBRARY			estor.lib
+LIBRARY			efsrv.lib
+LIBRARY			apgrfx.lib
+LIBRARY			ws32.lib
+LIBRARY			cone.lib
+LIBRARY			TestExecuteUtils.lib
+LIBRARY			TestExecuteLogClient.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apploader/Inc/TestAppLoaderAppStart.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,33 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestAppLoaderAppStart.h
+// This contains CTestAppLoaderAppStart
+// 
+//
+
+#ifndef TEST_APP_LOADER_APP_START_H
+#define TEST_APP_LOADER_APP_START_H
+
+// User includes
+#include "TestAppLoaderBase.h"
+
+class CTestAppLoaderAppStart : public CTestAppLoaderBase
+	{
+public:
+	CTestAppLoaderAppStart();
+
+	virtual enum TVerdict doTestStepL( void );
+	};
+
+#endif /* TEST_APP_LOADER_APP_START_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apploader/Inc/TestAppLoaderBase.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAppLoaderBase which is the base class for all
+// the Psd Agx suite test steps
+// 
+//
+
+#ifndef TEST_APP_LOADER_BASE_H
+#define TEST_APP_LOADER_BASE_H
+
+#include <TestExecuteStepBase.h>
+
+class CTestAppLoaderBase : public CTestStep
+	{
+public:
+	CTestAppLoaderBase();
+	~CTestAppLoaderBase();
+
+	virtual enum TVerdict	doTestStepPreambleL();
+	virtual enum TVerdict	doTestStepPostambleL();
+	};
+
+#endif /* TEST_APP_LOADER_BASE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apploader/Inc/TestAppLoaderEndTask.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,33 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestAppLoaderEndTask.h
+// This contains CTestAppLoaderEndTask
+// 
+//
+
+#ifndef TEST_APP_LOADER_END_TASK_H
+#define TEST_APP_LOADER_END_TASK_H
+
+// User includes
+#include "TestAppLoaderBase.h"
+
+class CTestAppLoaderEndTask : public CTestAppLoaderBase
+	{
+public:
+	CTestAppLoaderEndTask();
+
+	virtual enum TVerdict doTestStepL( void );
+	};
+
+#endif /* TEST_APP_LOADER_END_TASK_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apploader/Inc/TestAppLoaderKeyEvents.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,35 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestAppLoaderKeyEvents.h
+// This contains CTestAppLoaderKeyEvents
+// 
+//
+
+#ifndef TEST_APP_LOADER_KEY_EVENTS_H
+#define TEST_APP_LOADER_KEY_EVENTS_H
+
+// User includes
+#include "TestAppLoaderBase.h"
+
+class CTestAppLoaderKeyEvents : public CTestAppLoaderBase
+	{
+public:
+	CTestAppLoaderKeyEvents();
+	
+	TBool GetKeyCodeFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TKeyCode& aResult, TStdScanCode& aScanCode);
+
+	virtual enum TVerdict doTestStepL( void );
+	};
+
+#endif /* TEST_APP_LOADER_KEY_EVENTS_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apploader/Inc/TestAppLoaderKillProcess.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,33 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestAppLoaderKillProcess.h
+// This contains CTestAppLoaderKillProcess
+// 
+//
+
+#ifndef TEST_APP_LOADER_KILL_PROCESS_H
+#define TEST_APP_LOADER_KILL_PROCESS_H
+
+// User includes
+#include "TestAppLoaderBase.h"
+
+class CTestAppLoaderKillProcess : public CTestAppLoaderBase
+	{
+public:
+	CTestAppLoaderKillProcess();
+
+	virtual enum TVerdict doTestStepL( void );
+	};
+
+#endif /* TEST_APP_LOADER_KILL_PROCESS_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apploader/Inc/TestAppLoaderServer.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,35 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAppLoaderServer
+// 
+//
+
+#ifndef TEST_APP_LOADER_SERVER_H
+#define TEST_APP_LOADER_SERVER_H
+
+#include <TestExecuteServerBase.h>
+
+class  CTestAppLoaderServer : public CTestServer
+{
+public:
+	static CTestAppLoaderServer*	NewL();
+	~CTestAppLoaderServer();
+	virtual CTestStep*				CreateTestStep(const TDesC& aStepName);
+
+private:
+	CTestAppLoaderServer();
+	void	ConstructL();
+};
+
+#endif /* TEST_APP_LOADER_SERVER_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apploader/Inc/TestAppLoaderTaskRunning.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,33 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestAppLoaderEndTask.h
+// This contains CTestAppLoaderTaskRunning
+// 
+//
+
+#ifndef TEST_APP_LOADER_TASK_RUNNING_H
+#define TEST_APP_LOADER_TASK_RUNNING_H
+
+// User includes
+#include "TestAppLoaderBase.h"
+
+class CTestAppLoaderTaskRunning : public CTestAppLoaderBase
+	{
+public:
+	CTestAppLoaderTaskRunning();
+
+	virtual enum TVerdict doTestStepL( void );
+	};
+
+#endif /* TEST_APP_LOADER_TASK_RUNNING_H */
Binary file apploader/ReadMe.doc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apploader/Src/TestAppLoaderAppStart.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,74 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAppLoaderAppStart
+// 
+//
+
+// USER includes
+#include "TestAppLoaderAppStart.h"
+
+// EPOC includes
+#include <apacmdln.h>
+#include <apgcli.h>
+
+/*@{*/
+/// Parameters
+_LIT(KProgram,					"program");
+
+/// Error messages
+_LIT(KErrCode,					"Error %d");
+_LIT(KErrMissingParameter ,		"Misssing Parameter %S");
+/*@}*/
+
+// constructor
+CTestAppLoaderAppStart::CTestAppLoaderAppStart()
+:	CTestAppLoaderBase()
+	{
+	SetTestStepName(_L("AppStart"));
+	}
+
+// Each test step must supply a implementation for doTestStepL
+enum TVerdict CTestAppLoaderAppStart::doTestStepL( void )
+	{
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("TEST-> APP START"));
+
+	TPtrC	program;
+	if ( !GetStringFromConfig(ConfigSection(), KProgram, program) )
+		{
+		ERR_PRINTF2(KErrMissingParameter, &KProgram());
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		RApaLsSession		apaLsSession;
+		User::LeaveIfError(apaLsSession.Connect());
+		CleanupClosePushL(apaLsSession);
+
+		CApaCommandLine*	cmdLine=CApaCommandLine::NewLC();
+		cmdLine->SetExecutableNameL(program);
+		cmdLine->SetCommandL(EApaCommandRun);
+
+		TInt	err=apaLsSession.StartApp(*cmdLine);
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(KErrCode, err);
+			SetTestStepError(err);
+			}
+		CleanupStack::PopAndDestroy(2, &apaLsSession);
+		}
+
+	// test steps return a result
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apploader/Src/TestAppLoaderBase.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,39 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAppLoaderBase which is the base class for all the AppLoader TestCase DLL
+// 
+//
+
+// USER includes
+#include "TestAppLoaderBase.h"
+
+CTestAppLoaderBase::CTestAppLoaderBase()
+	{
+	}
+
+// destructor
+CTestAppLoaderBase::~CTestAppLoaderBase()
+	{
+	}
+
+enum TVerdict CTestAppLoaderBase::doTestStepPreambleL()
+	{
+	TVerdict	ret = CTestStep::doTestStepPreambleL();
+	return ret;
+	}
+
+enum TVerdict CTestAppLoaderBase::doTestStepPostambleL()
+	{
+	return CTestStep::doTestStepPostambleL();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apploader/Src/TestAppLoaderEndTask.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,140 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAppLoaderEndTask
+// 
+//
+
+// USER includes
+#include "TestAppLoaderEndTask.h"
+
+// EPOC includes
+#include <w32std.h>
+#include <coemain.h>
+#include <apgtask.h>
+#include <apgcli.h>
+#include <apgwgnam.H>
+
+/*@{*/
+/// Parameters
+_LIT(KProgram,					"program");
+
+/// Log messages
+_LIT(KLogTask,					"Caption '%S'.");
+
+/// Error messages
+_LIT(KErrCode,					"Error %d");
+_LIT(KErrMissingParameter,		"Misssing Parameter %S");
+_LIT(KErrTaskNotFound,			"Task '%S' not found");
+/*@}*/
+
+// constructor
+CTestAppLoaderEndTask::CTestAppLoaderEndTask()
+:	CTestAppLoaderBase()
+	{
+	SetTestStepName(_L("EndTask"));
+	}
+
+// Each test step must supply a implementation for doTestStepL
+enum TVerdict CTestAppLoaderEndTask::doTestStepL( void )
+	{
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("TEST-> END TASK"));
+
+	TPtrC	program;
+	if ( !GetStringFromConfig(ConfigSection(), KProgram, program) )
+		{
+		ERR_PRINTF2(KErrMissingParameter, &KProgram());
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		RApaLsSession	apaLsSession;
+		User::LeaveIfError(apaLsSession.Connect());
+		CleanupClosePushL(apaLsSession);
+	    User::LeaveIfError(apaLsSession.GetAllApps());
+
+		RWsSession	ws;
+		User::LeaveIfError(ws.Connect());
+		CleanupClosePushL(ws);
+		
+	    TInt					numWindowGroups = ws.NumWindowGroups();
+	    CArrayFixFlat<TInt>*	windowGroupList = new(ELeave) CArrayFixFlat<TInt>(numWindowGroups);
+	    CleanupStack::PushL(windowGroupList);
+
+	    // Populate array with current group list ids
+	    User::LeaveIfError(ws.WindowGroupList(windowGroupList));
+
+	    CApaWindowGroupName*	windowGroupName = CApaWindowGroupName::NewLC(ws);
+
+	    /* Note: we use windowGroupList->Count() instead of numWindowGroups, as in the middle of the
+	     * update the list could change in length (or worse, be reduced) thus producing an out of bounds
+	     * error if numWindowGroups were used
+	     */
+	    TBool	searching=ETrue;
+	    for ( TInt i=0; (i<windowGroupList->Count()) && searching; ++i )
+	    	{
+	        TInt	wgId = windowGroupList->At(i);
+	        windowGroupName->ConstructFromWgIdL(wgId);
+
+	        TUid	appUid = windowGroupName->AppUid();
+
+	        TApaAppInfo	appInfo;
+	        HBufC* 		appCaption = NULL;
+	        // Some applications, like midlets, may not provide any info
+	        if (apaLsSession.GetAppInfo(appInfo, appUid) == KErrNone)
+	        	{
+	            appCaption = appInfo.iCaption.AllocL();
+	        	}
+	        else
+	        	{
+	            appCaption = windowGroupName->Caption().AllocL();
+	        	}
+            CleanupStack::PushL(appCaption);
+
+	        // Only list 'visible' applications
+	        if ( appCaption->Length() )
+	        	{
+	            TPtrC	caption=*appCaption;
+		        INFO_PRINTF2(KLogTask, &caption);
+
+		        if ( program.CompareC(caption)==0 )
+		        	{
+					searching=EFalse;
+					TApaTask	task(ws);
+					task.SetWgId(wgId);
+					if (task.Exists())
+						{
+						task.EndTask();
+						}
+					else
+						{
+						ERR_PRINTF2(KErrTaskNotFound, &program);
+						SetTestStepResult(EFail);
+						}
+		        	}
+				}
+            CleanupStack::Pop(1, appCaption); // taskEntry, appCaption
+	    	}
+
+	    if ( searching )
+	    	{
+			ERR_PRINTF2(KErrTaskNotFound, &program);
+			SetTestStepResult(EFail);
+	    	}
+	    CleanupStack::PopAndDestroy(4, &apaLsSession);    // windowGroupName, windowGroupList
+		}
+
+	// test steps return a result
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apploader/Src/TestAppLoaderKeyEvents.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,110 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAppLoaderKeyEvents
+// 
+//
+
+// USER includes
+#include "TestAppLoaderKeyEvents.h"
+
+// EPOC includes
+#include <w32std.h>
+
+/*@{*/
+const TInt KDelayMultiplier		= 1000;
+
+/// Parameters
+_LIT(KKey,						"key%d");
+_LIT(KDelay,					"delay%d");
+
+/// Key codes
+_LIT(KKeyNull,					"EKeyNull");
+_LIT(KKeyDevice0,				"EKeyDevice0");
+_LIT(KKeyDevice1,				"EKeyDevice1");
+/*@}*/
+
+// constructor
+CTestAppLoaderKeyEvents::CTestAppLoaderKeyEvents()
+:	CTestAppLoaderBase()
+	{
+	SetTestStepName(_L("KeyEvents"));
+	}
+
+TBool CTestAppLoaderKeyEvents::GetKeyCodeFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TKeyCode& aResult, TStdScanCode& aScanCode)
+	{
+	TPtrC	str;
+	TBool	ret=GetStringFromConfig(aSectName, aKeyName, str);
+
+	if ( ret )
+		{
+		if ( str==KKeyNull )
+			{
+			aResult=EKeyNull;
+			aScanCode=EStdKeyNull;
+			}
+		else if ( str==KKeyDevice0 )
+			{
+			aResult=EKeyDevice0;
+			aScanCode=EStdKeyDevice0;
+			}
+		else if ( str==KKeyDevice1 )
+			{
+			aResult=EKeyDevice1;
+			aScanCode=EStdKeyDevice1;
+			}
+		}
+
+	return ret;
+	}
+
+// Each test step must supply a implementation for doTestStepL
+enum TVerdict CTestAppLoaderKeyEvents::doTestStepL( void )
+	{
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("TEST-> KEY EVENTS"));
+
+	RWsSession							ws;
+	User::LeaveIfError(ws.Connect());
+	CleanupClosePushL(ws);
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+	TInt								index=0;
+	TBool								moreData=ETrue;
+	TKeyCode							keyCode;
+	TStdScanCode						scanCode;
+	TInt								delay;
+	while ( moreData )
+		{
+		tempStore.Format(KKey(), ++index);
+		if ( GetKeyCodeFromConfig(ConfigSection(), tempStore, keyCode, scanCode) )
+			{
+			TKeyEvent	event = {keyCode, scanCode, 0, 0};
+			ws.SimulateKeyEvent(event);
+			ws.Flush();
+
+			tempStore.Format(KDelay(), index);
+			if ( GetIntFromConfig(ConfigSection(), tempStore, delay) )
+				{
+				User::After(delay*KDelayMultiplier);
+				}
+			}
+		else
+			{
+			moreData=EFalse;
+			}
+		}
+	CleanupStack::PopAndDestroy(&ws);
+
+	// test steps return a result
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apploader/Src/TestAppLoaderKillProcess.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,90 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAppLoaderKillProcess
+// 
+//
+
+// USER includes
+#include "TestAppLoaderKillProcess.h"
+
+// EPOC includes
+#include <w32std.h>
+#include <coemain.h>
+#include <apgtask.h>
+#include <apgcli.h>
+#include <apgwgnam.H>
+
+/*@{*/
+/// Parameters
+_LIT(KProgram,					"program");
+
+/// Log messages
+_LIT(KLogProcess,				"Process '%S'.");
+
+/// Error messages
+_LIT(KErrMissingParameter,		"Misssing Parameter %S");
+_LIT(KErrProcessNotFound,		"Process '%S' not found");
+/*@}*/
+
+// constructor
+CTestAppLoaderKillProcess::CTestAppLoaderKillProcess()
+:	CTestAppLoaderBase()
+	{
+	SetTestStepName(_L("KillProcess"));
+	}
+
+// Each test step must supply a implementation for doTestStepL
+enum TVerdict CTestAppLoaderKillProcess::doTestStepL( void )
+	{
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("TEST-> KILL PROCESS"));
+
+	TPtrC	program;
+	if ( !GetStringFromConfig(ConfigSection(), KProgram, program) )
+		{
+		ERR_PRINTF2(KErrMissingParameter, &KProgram());
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+	    TFindProcess	findProcess;
+	    TFullName		currentProcessName;
+	    RProcess		process;
+	    TBool			searching=ETrue;
+	    while ( (findProcess.Next(currentProcessName)==KErrNone) && searching )
+	    	{
+	        User::LeaveIfError(process.Open(currentProcessName));
+	        CleanupClosePushL(process);
+
+	        HBufC*	fileName = process.FileName().AllocLC();
+
+	        TPtrC	name=*fileName;
+	        INFO_PRINTF2(KLogProcess, &name);
+	        if ( program.CompareC(name)==0 )
+	        	{
+	        	searching=EFalse;
+	        	process.Kill(0);
+	        	}
+	        CleanupStack::PopAndDestroy(2, &process);   // cmdLine, fileName, process
+			}
+	    if ( searching )
+	    	{
+	        ERR_PRINTF2(KErrProcessNotFound, &program);
+			SetTestStepResult(EFail);
+	    	}
+		}
+
+	// test steps return a result
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apploader/Src/TestAppLoaderServer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,137 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This main DLL entry point for the Smoketest_AppLoader.dll
+// 
+//
+
+// USER includes
+#include "TestAppLoaderServer.h"
+#include "TestAppLoaderAppStart.h"
+#include "TestAppLoaderKeyEvents.h"
+#include "TestAppLoaderKillProcess.h"
+#include "TestAppLoaderEndTask.h"
+#include "TestAppLoaderTaskRunning.h"
+
+/*@{*/
+_LIT(KServerName,	"smoketest_apploader");
+/*@}*/
+
+CTestAppLoaderServer* CTestAppLoaderServer::NewL()
+/**
+ * @return - Instance of the test server
+ * Same code for Secure and non-secure variants
+ * Called inside the MainL() function to create and start the
+ * CTestServer derived server.
+ */
+	{
+	CTestAppLoaderServer*	server = new (ELeave) CTestAppLoaderServer();
+	CleanupStack::PushL(server);
+	// CServer base class call
+	server->ConstructL();
+	server->StartL(KServerName);
+	CleanupStack::Pop(server);
+	return server;
+	}
+
+CTestAppLoaderServer::CTestAppLoaderServer()
+	:	CTestServer()
+	{
+	}
+
+void CTestAppLoaderServer::ConstructL()
+	{
+	}
+
+CTestAppLoaderServer::~CTestAppLoaderServer()
+	{
+	}
+
+LOCAL_C void MainL()
+/**
+ * Secure variant
+ * Much simpler, uses the new Rendezvous() call to sync with the client
+ */
+	{
+#if (defined __DATA_CAGING__)
+	RProcess().DataCaging(RProcess::EDataCagingOn);
+	RProcess().SecureApi(RProcess::ESecureApiOn);
+#endif
+	CActiveScheduler*		sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sched);
+	CTestAppLoaderServer*	server = NULL;
+	// Create the CTestServer derived server
+	TRAPD(err,server = CTestAppLoaderServer::NewL());
+	if(!err)
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	delete server;
+	delete sched;
+	}
+
+
+GLDEF_C TInt E32Main()
+/**
+ * @return - Standard Epoc error code on process exit
+ * Secure variant only
+ * Process entry point. Called by client using RProcess API
+ */
+	{
+	__UHEAP_MARK;
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAPD(err,MainL());
+	delete cleanup;
+	__UHEAP_MARKEND;
+	return err;
+    }
+
+
+CTestStep* CTestAppLoaderServer::CreateTestStep(const TDesC& aStepName)
+/**
+ * @return - A CTestStep derived instance
+ * Secure and non-secure variants
+ * Implementation of CTestServer pure virtual
+ */
+	{
+	CTestStep*	testStep = NULL;
+
+	if(aStepName == _L("AppStart"))
+		{
+		testStep = new CTestAppLoaderAppStart();
+		}
+	else if(aStepName == _L("KeyEvents"))
+		{
+		testStep = new CTestAppLoaderKeyEvents();
+		}
+	else if(aStepName == _L("KillProcess"))
+		{
+		testStep = new CTestAppLoaderKillProcess();
+		}
+	else if(aStepName == _L("EndTask"))
+		{
+		testStep = new CTestAppLoaderEndTask();
+		}
+	else if(aStepName == _L("TaskRunning"))
+		{
+		testStep = new CTestAppLoaderTaskRunning();
+		}
+	return testStep;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apploader/Src/TestAppLoaderTaskRunning.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,136 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAppLoaderTaskRunning
+// 
+//
+
+// USER includes
+#include "TestAppLoaderTaskRunning.h"
+
+// EPOC includes
+#include <w32std.h>
+#include <coemain.h>
+#include <apgtask.h>
+#include <apgcli.h>
+#include <apgwgnam.H>
+
+/*@{*/
+/// Parameters
+_LIT(KProgram,					"program");
+
+/// Log messages
+_LIT(KLogTask,					"Caption '%S'.");
+
+/// Error messages
+_LIT(KErrCode,					"Error %d");
+_LIT(KErrMissingParameter,		"Misssing Parameter %S");
+_LIT(KErrTaskNotFound,			"Task '%S' not found");
+/*@}*/
+
+// constructor
+CTestAppLoaderTaskRunning::CTestAppLoaderTaskRunning()
+:	CTestAppLoaderBase()
+	{
+	SetTestStepName(_L("TaskRunning"));
+	}
+
+// Each test step must supply a implementation for doTestStepL
+enum TVerdict CTestAppLoaderTaskRunning::doTestStepL( void )
+	{
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("TEST-> TASK RUNNING"));
+
+	TPtrC	program;
+	if ( !GetStringFromConfig(ConfigSection(), KProgram, program) )
+		{
+		ERR_PRINTF2(KErrMissingParameter, &KProgram());
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		RApaLsSession	apaLsSession;
+		User::LeaveIfError(apaLsSession.Connect());
+		CleanupClosePushL(apaLsSession);
+	    User::LeaveIfError(apaLsSession.GetAllApps());
+
+		RWsSession	ws;
+		User::LeaveIfError(ws.Connect());
+		CleanupClosePushL(ws);
+		
+	    TInt					numWindowGroups = ws.NumWindowGroups();
+	    CArrayFixFlat<TInt>*	windowGroupList = new(ELeave) CArrayFixFlat<TInt>(numWindowGroups);
+	    CleanupStack::PushL(windowGroupList);
+
+	    // Populate array with current group list ids
+	    User::LeaveIfError(ws.WindowGroupList(windowGroupList));
+
+	    CApaWindowGroupName*	windowGroupName = CApaWindowGroupName::NewLC(ws);
+
+	    /* Note: we use windowGroupList->Count() instead of numWindowGroups, as in the middle of the
+	     * update the list could change in length (or worse, be reduced) thus producing an out of bounds
+	     * error if numWindowGroups were used
+	     */
+	    TBool	searching=ETrue;
+	    for ( TInt i=0; (i<windowGroupList->Count()) && searching; ++i )
+	    	{
+	        TInt	wgId = windowGroupList->At(i);
+	        windowGroupName->ConstructFromWgIdL(wgId);
+
+	        TUid	appUid = windowGroupName->AppUid();
+
+	        TApaAppInfo	appInfo;
+	        HBufC* 		appCaption = NULL;
+	        // Some applications, like midlets, may not provide any info
+	        if (apaLsSession.GetAppInfo(appInfo, appUid) == KErrNone)
+	        	{
+	            appCaption = appInfo.iCaption.AllocL();
+	        	}
+	        else
+	        	{
+	            appCaption = windowGroupName->Caption().AllocL();
+	        	}
+            CleanupStack::PushL(appCaption);
+
+	        // Only list 'visible' applications
+	        if ( appCaption->Length() )
+	        	{
+	            TPtrC	caption=*appCaption;
+		        INFO_PRINTF2(KLogTask, &caption);
+
+		        if ( program.CompareC(caption)==0 )
+		        	{
+					searching=EFalse;
+					TApaTask	task(ws);
+					task.SetWgId(wgId);
+					if (!task.Exists())
+						{
+						ERR_PRINTF2(KErrTaskNotFound, &program);
+						SetTestStepResult(EFail);
+						}
+		        	}
+				}
+            CleanupStack::Pop(1, appCaption); // taskEntry, appCaption
+	    	}
+
+	    if ( searching )
+	    	{
+			ERR_PRINTF2(KErrTaskNotFound, &program);
+			SetTestStepResult(EFail);
+	    	}
+	    CleanupStack::PopAndDestroy(4, &apaLsSession);    // windowGroupName, windowGroupList
+		}
+
+	// test steps return a result
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apploader/scripts/setup_smoketest_apploader.script	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,22 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+RUN_UTILS MkDir			c:\smoketest\
+
+RUN_UTILS CopyFile 		z:\smoketest\smoketest_apploader.ini	c:\smoketest\smoketest_apploader.ini
+RUN_UTILS MakeReadWrite	c:\smoketest\smoketest_apploader.ini
+RUN_UTILS CopyFile 		z:\smoketest\smoketest_apploader.script	c:\smoketest\smoketest_apploader.script
+RUN_UTILS MakeReadWrite	c:\smoketest\smoketest_apploader.script
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apploader/scripts/smoketest_apploader.script	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,94 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+LOAD_SUITE smoketest_apploader -SharedData
+DELAY 30000
+
+START_TESTCASE			SMOKE_APP_LAUNCH_0001
+//! @SYMTestCaseID		SMOKE_APP_LAUNCH_0001
+//! @SYMTestCaseDesc	Start Smoketest_system.exe, and kill the process
+	RUN_TEST_STEP		1000	smoketest_apploader	AppStart	c:\smoketest\smoketest_apploader.ini	SMOKE_APP_LAUNCH_0001
+	DELAY				5000
+	RUN_TEST_STEP		1000	smoketest_apploader	KillProcess	c:\smoketest\smoketest_apploader.ini	SMOKE_APP_END_0001
+END_TESTCASE 			SMOKE_APP_LAUNCH_0001
+
+START_TESTCASE			SMOKE_APP_LAUNCH_0002
+//! @SYMTestCaseID		SMOKE_APP_LAUNCH_0002
+//! @SYMTestCaseDesc	Verify the "Telephone" task is running
+	RUN_TEST_STEP		1000	smoketest_apploader	TaskRunning	c:\smoketest\smoketest_apploader.ini	SMOKE_APP_RUNNING_0002
+END_TESTCASE 			SMOKE_APP_LAUNCH_0002
+
+START_TESTCASE			SMOKE_APP_LAUNCH_0003
+//! @SYMTestCaseID		SMOKE_APP_LAUNCH_0003
+//! @SYMTestCaseDesc	Verify the "Clock" task is running
+	RUN_TEST_STEP		1000	smoketest_apploader	TaskRunning	c:\smoketest\smoketest_apploader.ini	SMOKE_APP_RUNNING_0003
+END_TESTCASE 			SMOKE_APP_LAUNCH_0003
+
+START_TESTCASE			SMOKE_APP_LAUNCH_0004
+//! @SYMTestCaseID		SMOKE_APP_LAUNCH_0004
+//! @SYMTestCaseDesc	Verify the "Messaging" task is running
+	RUN_TEST_STEP		1000	smoketest_apploader	TaskRunning	c:\smoketest\smoketest_apploader.ini	SMOKE_APP_RUNNING_0004
+END_TESTCASE 			SMOKE_APP_LAUNCH_0004
+
+START_TESTCASE			SMOKE_APP_LAUNCH_0005
+//! @SYMTestCaseID		SMOKE_APP_LAUNCH_0005
+//! @SYMTestCaseDesc	Start the SymcML task and end it.
+	RUN_TEST_STEP		1000	smoketest_apploader	AppStart	c:\smoketest\smoketest_apploader.ini	SMOKE_APP_LAUNCH_0005
+	DELAY				5000
+	RUN_TEST_STEP		1000	smoketest_apploader	EndTask		c:\smoketest\smoketest_apploader.ini	SMOKE_APP_END_0005
+END_TESTCASE 	SMOKE_APP_LAUNCH_0005
+
+START_TESTCASE			SMOKE_APP_LAUNCH_0006
+//! @SYMTestCaseID		SMOKE_APP_LAUNCH_0006
+//! @SYMTestCaseDesc	Verify the "Calendar" task is running
+	RUN_TEST_STEP		1000	smoketest_apploader	TaskRunning	c:\smoketest\smoketest_apploader.ini	SMOKE_APP_RUNNING_0006
+END_TESTCASE 			SMOKE_APP_LAUNCH_0006
+
+START_TESTCASE	SMOKE_APP_LAUNCH_0007
+//! @SYMTestCaseID		SMOKE_APP_LAUNCH_0007
+//! @SYMTestCaseDesc	Verify the "Contacts" task is running
+	RUN_TEST_STEP		1000	smoketest_apploader	TaskRunning	c:\smoketest\smoketest_apploader.ini	SMOKE_APP_RUNNING_0007
+END_TESTCASE 	SMOKE_APP_LAUNCH_0007
+
+START_TESTCASE			SMOKE_APP_LAUNCH_0008
+//! @SYMTestCaseID		SMOKE_APP_LAUNCH_0008
+//! @SYMTestCaseDesc	Send key events to close UI setup dialogs
+	RUN_TEST_STEP		1000	smoketest_apploader	KeyEvents	c:\smoketest\smoketest_apploader.ini	SMOKE_APP_KEYEVENTS_0008
+END_TESTCASE 			SMOKE_APP_LAUNCH_0008
+
+START_TESTCASE			SMOKE_APP_LAUNCH_0009
+//! @SYMTestCaseID		SMOKE_APP_LAUNCH_0009
+//! @SYMTestCaseDesc	Start Eshell and end it
+	RUN_TEST_STEP		1000	smoketest_apploader	AppStart	c:\smoketest\smoketest_apploader.ini	SMOKE_APP_LAUNCH_0009
+	DELAY				5000
+	RUN_TEST_STEP		1000	smoketest_apploader	EndTask		c:\smoketest\smoketest_apploader.ini	SMOKE_APP_END_0009
+END_TESTCASE 			SMOKE_APP_LAUNCH_0009
+
+START_TESTCASE			SMOKE_APP_LAUNCH_0010
+//! @SYMTestCaseID		SMOKE_APP_LAUNCH_0010
+//! @SYMTestCaseDesc	Start Media player and end it
+	RUN_TEST_STEP		1000	smoketest_apploader	AppStart	c:\smoketest\smoketest_apploader.ini	SMOKE_APP_LAUNCH_0010
+	DELAY				5000
+	RUN_TEST_STEP		1000	smoketest_apploader	EndTask		c:\smoketest\smoketest_apploader.ini	SMOKE_APP_END_0010
+END_TESTCASE 			SMOKE_APP_LAUNCH_0010
+
+START_TESTCASE			SMOKE_APP_LAUNCH_0011
+//! @SYMTestCaseID		SMOKE_APP_LAUNCH_0011
+//! @SYMTestCaseDesc	Start Notepad and end it
+	RUN_TEST_STEP		1000	smoketest_apploader	AppStart	c:\smoketest\smoketest_apploader.ini	SMOKE_APP_LAUNCH_0011
+	DELAY				5000
+	RUN_TEST_STEP		1000	smoketest_apploader	EndTask		c:\smoketest\smoketest_apploader.ini	SMOKE_APP_END_0011
+END_TESTCASE 			SMOKE_APP_LAUNCH_0011
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apploader/testdata/smoketest_apploader.ini	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,54 @@
+[SMOKE_APP_LAUNCH_0001]
+program	=Smoketest_System.exe
+
+[SMOKE_APP_END_0001]
+program	=Z:\sys\bin\Smoketest_System.exe
+
+[SMOKE_APP_RUNNING_0002]
+program	=Telephone
+
+[SMOKE_APP_RUNNING_0003]
+program	=Clock
+
+[SMOKE_APP_RUNNING_0004]
+program	=Messaging
+
+[SMOKE_APP_LAUNCH_0005]
+program	=NSmlDSSync.exe
+
+[SMOKE_APP_END_0005]
+program	=Sync
+
+[SMOKE_APP_RUNNING_0006]
+program	=Calendar
+
+[SMOKE_APP_RUNNING_0007]
+program	=Contacts
+
+[SMOKE_APP_KEYEVENTS_0008]
+delay1	=2000
+key1	=EKeyDevice0
+delay2	=1000
+key2	=EKeyDevice0
+delay3	=1000
+key3	=EKeyDevice0
+delay4	=1000
+key4	=EKeyDevice0
+
+[SMOKE_APP_LAUNCH_0009]
+program	=eshell.exe
+
+[SMOKE_APP_END_0009]
+program	=ESHELL
+
+[SMOKE_APP_LAUNCH_0010]
+program	=mpx.exe
+
+[SMOKE_APP_END_0010]
+program	=Music player
+
+[SMOKE_APP_LAUNCH_0011]
+program	=Notepad.exe
+
+[SMOKE_APP_END_0011]
+program	=Notes
Binary file contacts/ReadMe.doc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/TestData/Smoketest_Contacts.ini	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,52 @@
+[default]
+filename		=c:\smoketest\smoketest_contacts.cdb
+filenameSecure		=c:smoketest_contacts.cdb
+
+[18807_CreateDB]
+
+[18927_AddEntries]
+count			=5
+
+firstname1		=Feroz
+lastname1		=Uddin
+company1		=Symbian
+job1			=Cricket fan
+workphone1		=0207
+workemail1		=feroz.uddin@symbian.com
+
+firstname2		=Louis
+lastname2		=Nayegon
+company2		=Symbian
+job2			=Lazy Git
+workphone2		=01452 812178
+workemail2		=louis.nayegon@symbian.com
+
+firstname3		=Alf
+lastname3		=Garnett
+company3		=BBC
+job3			=star
+workphone3		=0207 777
+homephone3		=0208 888
+fax3			=0208 999
+workemail3		=alf.garnett@bbc.co.uk
+internet3		=www.bbc.co.uk
+street3			=Marylebone Road
+town3			=London
+county3			=LondonCounty
+postcode3		=W1
+country3		=England
+notes3			=Small minded bigot
+
+firstname4		=Tom
+lastname4		=Jones
+company4		=Music
+job4			=Singer
+workemail4		=tom.jones@music.com
+
+firstname5		=Alan
+lastname5		=Shearer
+company5		=Newcastle United FC
+job5			=Footballer
+FirstNamePrn5	=Al-an
+LastNamePrn5	=Shea-rer
+CompanyNamePrn5	=New-cas-el You-Nigh-Ted
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/bwins/SMOKETEST_CONTACTS_SERVERU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?NewServer@@YAHXZ @ 1 NONAME ; int __cdecl NewServer(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/group/Smoketest_Contacts.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,51 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// using relative paths for sourcepath and user includes
+// 
+//
+
+TARGET			Smoketest_Contacts_Server.exe
+TARGETTYPE		exe
+UID				0x1000007A 0x101F7772
+
+#if (!defined __NO_VENDORID__)
+VENDORID		0x70000001
+#endif
+
+CAPABILITY		ReadUserData WriteUserData
+
+SOURCEPATH		..\Src
+
+SOURCE			SmoketestContactsServer.cpp
+SOURCE			TestContact.cpp
+SOURCE			TestContactsAddEntries.cpp
+SOURCE			TestContactsBase.cpp
+SOURCE			TestContactsCreateDB.cpp
+
+USERINCLUDE		..\Inc ..\..\Group
+
+SYSTEMINCLUDE	\Epoc32\include
+SYSTEMINCLUDE	\Epoc32\include\Test
+
+LIBRARY			efsrv.lib
+LIBRARY			estor.lib
+LIBRARY			charconv.lib
+LIBRARY			cntview.lib
+LIBRARY			euser.lib
+LIBRARY			cntmodel.lib
+LIBRARY			TestExecuteUtils.lib
+LIBRARY			TestExecuteLogClient.lib
+
+// We're quite heavy on the stack... 4k in WinS isn't enough...
+EPOCSTACKSIZE	0x6000
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/group/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,25 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// For automated contacts smoketest
+// 
+//
+
+PRJ_TESTEXPORTS
+
+../scripts/Smoketest_Contacts.script		z:/smoketest/smoketest_contacts.script
+../scripts/setup_Smoketest_Contacts.script	z:/smoketest/setup_smoketest_contacts.script
+../TestData/Smoketest_Contacts.ini			z:/smoketest/smoketest_contacts.ini
+
+PRJ_TESTMMPFILES
+Smoketest_Contacts.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/inc/SmoketestContactsServer.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,38 @@
+/**
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file SmoketestContactsServer.h
+*/
+#if (!defined __SMOKETESTCONTACTS_SERVER_H__)
+#define __SMOKTETESTCONTACTS_SERVER_H__
+#include <TestExecuteServerBase.h>
+
+class CSmoketestContactsServer : public CTestServer
+	{
+public:
+	static CSmoketestContactsServer* NewL();
+	virtual CTestStep* CreateTestStep(const TDesC& aStepName);
+
+private:
+	void ConstructL();
+	};
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/inc/TestContact.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,100 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestContact
+// 
+//
+
+#ifndef TEST_CONTACT_H
+#define TEST_CONTACT_H
+
+#include <cntitem.h>
+
+class MTestContactInstrumentation
+{
+public:
+	virtual void			RaiseInstrumentationEventNotificationL(TInt aEventTag) = 0;
+};
+
+class CTestContact : public CBase
+	{
+public:
+	static CTestContact*	NewL(CContactItem& aSeedContact);
+	static CTestContact*	NewLC(CContactItem& aSeedContact);
+	static CTestContact*	NewL(CContactItem* aSeedContact);
+	static CTestContact*	NewLC(CContactItem* aSeedContact);
+	~CTestContact();
+
+	CContactItem&	ContactItem();
+	const TPtrC		FirstNameL();
+	const TPtrC		LastNameL();
+	const TPtrC		CompanyNameL();
+	const TPtrC		JobTitleL();
+	const TPtrC		WorkPhoneL();
+	const TPtrC		WorkMobileL();
+	const TPtrC		HomePhoneL();
+	const TPtrC		HomeMobileL();
+	const TPtrC		FaxL();
+	const TPtrC		EmailAddressL();
+	const TPtrC		InternetAddressL();
+	const TPtrC		StreetL();
+	const TPtrC		TownL();
+	const TPtrC		CountyL();
+	const TPtrC		PostCodeL();
+	const TPtrC		CountryL();
+	const TPtrC		NotesL();
+	const TPtrC		NickNameL();
+	const TPtrC		PictureL();
+
+	void	SetFirstNameL(const TDesC& aFirstName);
+	void	SetLastNameL(const TDesC& aLastName);
+	void	SetCompanyNameL(const TDesC& aCompanyName);
+	void	SetJobTitleL(const TDesC& aJobTitle);
+	void	SetWorkPhoneL(const TDesC& aWorkPhone);
+	void	SetWorkMobileL(const TDesC& aWorkMobile);
+	void	SetHomePhoneL(const TDesC& aHomePhone);
+	void	SetHomeMobileL(const TDesC& aHomeMobile);
+	void	SetFaxL(const TDesC& aFax);
+	void	SetHomeEmailAddressL(const TDesC& aEmailAddress);
+	void	SetWorkEmailAddressL(const TDesC& aEmailAddress);
+	void	SetInternetAddressL(const TDesC& aInternetAddress);
+	void	SetStreetL(const TDesC& aStreet);
+	void	SetTownL(const TDesC& aTown);
+	void	SetCountyL(const TDesC& aCounty);
+	void	SetPostCodeL(const TDesC& aPostCode);
+	void	SetCountryL(const TDesC& aCountry);
+	void	SetNotesL(const TDesC& aNotes);
+	void	SetNickNameL(const TDesC& aNickName);
+	void 	SetPictureL(const TDesC8& aPicture);
+
+private:
+	CTestContact();
+	void				ConstructL(CContactItem& aSeedContact);
+	void				ConstructL(CContactItem* aSeedContact);
+	const TPtrC			TextFieldL(TFieldType aFieldType) const;
+	const TPtrC			TextFieldL(const CContentType& aTypesToMatch) const;
+  	void 				SetTextFieldL(const CContentType& aTypesToMatch,const TDesC& aText) const;
+  	void 				SetTextFieldL(TFieldType aFieldType, const TDesC& aText);
+  	void 				SetTextFieldL(TFieldType aFieldType, const TDesC& aText, TUid aAddOnContentType);
+	CContactItemField&	FindFieldL(TFieldType aFieldType) const;
+	CContactItemField&	FindFieldL(const CContentType& aTypesToMatch) const;
+	void SetPictureFieldL(const TDesC8& aPicture) const;
+	TInt FindField(TFieldType aFieldType) const;
+  	void InsertTextFieldL(TUid aID, const TDesC& aStringOfStuff);
+
+private:
+	CContactItem*	iContactItem;
+	TBool			iDestroyOnExit;
+	};
+
+#endif /* __TEST_CONTACT_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/inc/TestContactsAddEntries.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,35 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestSuiteContacts
+// 
+//
+
+#ifndef TEST_CONTACTS_ADD_ENTRIES_H
+#define TEST_CONTACTS_ADD_ENTRIES_H
+
+#include "TestContactsBase.h"
+
+class CTestContactsAddEntries : public CTestContactsBase
+{
+public:
+	CTestContactsAddEntries();
+	virtual ~CTestContactsAddEntries();
+
+	virtual enum TVerdict doTestStepL( void );
+
+private:
+	void	AddEntriesL( void );
+};
+
+#endif TEST_CONTACTS_ADD_ENTRIES_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/inc/TestContactsBase.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,53 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestContactsBase
+// 
+//
+
+#ifndef TEST_CONTACTS_BASE_H
+#define TEST_CONTACTS_BASE_H
+
+
+#include <cntdb.h>
+#include <TestExecuteStepBase.h>
+#include <cntitem.h>
+
+#include "TestContact.h"
+
+const TInt KMaxScriptLineLength = 200;
+
+class CTestContactsBase : public CTestStep, protected MTestContactInstrumentation
+{
+public:
+	CTestContactsBase();
+	~CTestContactsBase();
+	virtual enum TVerdict	doTestStepPreambleL();
+	virtual enum TVerdict	doTestStepPostambleL();
+
+protected:
+	void				CreateDatabase();
+	void				OpenDatabase();
+	void				CleanupDatabase();
+	void				RaiseInstrumentationEventNotificationL(TInt aEventTag);
+	CContactIdArray*	SearchEntriesL();
+
+protected:
+	CContactDatabase*			iDatabase;
+	CContactItemFieldDef*		iFieldDef;
+
+private:
+	CActiveScheduler*			iSchedular;
+};
+
+#endif /* TEST_CONTACTS_BASE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/inc/TestContactsCreateDB.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,33 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestContactsCreateDB
+// 
+//
+
+#ifndef TEST_CONTACTS_CREATE_DB_H
+#define TEST_CONTACTS_CREATE_DB_H
+
+#include "TestContactsBase.h"
+
+class CTestContactsCreateDB : public CTestContactsBase
+{
+public:
+	CTestContactsCreateDB();
+	virtual ~CTestContactsCreateDB();
+
+	virtual enum TVerdict doTestStepL( void );
+
+};
+
+#endif /* TEST_CONTACTS_CREATE_DB_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/scripts/Smoketest_Contacts.script	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,26 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRINT Run Contacts smoketest
+//
+LOAD_SUITE Smoketest_Contacts_Server
+//
+START_TESTCASE 9094
+RUN_TEST_STEP 100	Smoketest_Contacts_Server	CreateDB		c:\smoketest\Smoketest_Contacts.ini	18807_CreateDB
+END_TESTCASE 9094
+START_TESTCASE 9082
+RUN_TEST_STEP 1000	Smoketest_Contacts_Server	AddEntries		c:\smoketest\Smoketest_Contacts.ini	18927_AddEntries
+END_TESTCASE 9082
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/scripts/setup_Smoketest_Contacts.script	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,22 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+RUN_UTILS MkDir c:\smoketest\
+
+RUN_UTILS CopyFile z:\smoketest\smoketest_contacts.ini	c:\smoketest\smoketest_contacts.ini
+RUN_UTILS MakeReadWrite c:\smoketest\smoketest_contacts.ini
+
+// RUN_SCRIPT Smoketest_Contacts.script
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/src/SmoketestContactsServer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,110 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file SmoketestContactsServer.cpp
+*/
+
+#include "SmoketestContactsServer.h"
+#include "TestContactsCreateDB.h"
+#include "TestContactsAddEntries.h"
+
+// __EDIT_ME__ - Substitute the name of the test server
+_LIT(KServerName,"Smoketest_Contacts_Server");
+// __EDIT_ME__ - Use your own server class name
+CSmoketestContactsServer* CSmoketestContactsServer::NewL()
+/**
+ * @return - Instance of the test server
+ * Same code for Secure and non-secure variants
+ * Called inside the MainL() function to create and start the
+ * CTestServer derived server.
+ */
+	{
+	CSmoketestContactsServer * server = new (ELeave) CSmoketestContactsServer();
+	CleanupStack::PushL(server);
+	// CServer base class call
+	server->StartL(KServerName);
+	CleanupStack::Pop(server);
+	return server;
+	}
+
+
+LOCAL_C void MainL()
+/**
+ * Secure variant
+ * Much simpler, uses the new Rendezvous() call to sync with the client
+ */
+	{
+#if (defined __DATA_CAGING__)
+	RProcess().DataCaging(RProcess::EDataCagingOn);
+	RProcess().SecureApi(RProcess::ESecureApiOn);
+#endif
+	CActiveScheduler* sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sched);
+	CSmoketestContactsServer* server = NULL;
+	// Create the CTestServer derived server
+	TRAPD(err,server = CSmoketestContactsServer::NewL());
+	if(!err)
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	delete server;
+	delete sched;
+	}
+
+GLDEF_C TInt E32Main()
+/**
+ * @return - Standard Epoc error code on process exit
+ * Secure variant only
+ * Process entry point. Called by client using RProcess API
+ */
+	{
+	__UHEAP_MARK;
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAPD(err,MainL());
+        
+        if (!err) { }
+	delete cleanup;
+	__UHEAP_MARKEND;
+	return KErrNone;
+    }
+
+
+// __EDIT_ME__ - Use your own server class name
+CTestStep* CSmoketestContactsServer::CreateTestStep(const TDesC& aStepName)
+/**
+ * @return - A CTestStep derived instance
+ * Secure and non-secure variants
+ * Implementation of CTestServer pure virtual
+ */
+	{
+	CTestStep* testStep = NULL;
+// __EDIT_ME__ - Create your own test steps here
+	if(aStepName == _L("AddEntries"))
+		testStep = new CTestContactsAddEntries();
+	if(aStepName == _L("CreateDB"))
+		testStep = new CTestContactsCreateDB();
+
+	return testStep;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/src/TestContact.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,491 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestContact
+// 
+//
+
+#include <cntfldst.h>
+
+#include "TestContact.h"
+
+CTestContact* CTestContact::NewL(CContactItem& aSeedContact)
+	{
+	CTestContact* self=CTestContact::NewLC(aSeedContact);
+	CleanupStack::Pop();
+	return self;
+	}
+
+CTestContact* CTestContact::NewLC(CContactItem& aSeedContact)
+	{
+	CTestContact* self=new(ELeave) CTestContact();
+	CleanupStack::PushL(self);
+	self->ConstructL(aSeedContact);
+	return self;
+	}
+
+CTestContact* CTestContact::NewL(CContactItem* aSeedContact)
+	{
+	CTestContact* self=CTestContact::NewLC(aSeedContact);
+	CleanupStack::Pop();
+	return self;
+	}
+
+CTestContact* CTestContact::NewLC(CContactItem* aSeedContact)
+	{
+	CTestContact* self=new(ELeave) CTestContact();
+	CleanupStack::PushL(self);
+	self->ConstructL(aSeedContact);
+	return self;
+	}
+
+CTestContact::CTestContact() : iDestroyOnExit(EFalse)
+	{
+	}
+
+void CTestContact::ConstructL(CContactItem& aSeedContact)
+	{
+	iDestroyOnExit=ETrue;
+	iContactItem=CContactCard::NewL(&aSeedContact);
+	}
+
+void CTestContact::ConstructL(CContactItem* aSeedContact)
+	{
+	iDestroyOnExit=EFalse;
+	iContactItem=aSeedContact;
+	}
+
+CTestContact::~CTestContact()
+	{
+	if (iDestroyOnExit)
+		delete iContactItem;
+	iContactItem=NULL;
+	}
+
+CContactItem& CTestContact::ContactItem()
+	{
+	return *iContactItem;
+	}
+
+const TPtrC CTestContact::FirstNameL()
+	{
+	return TextFieldL(KUidContactFieldGivenName);
+	}
+
+const TPtrC CTestContact::LastNameL()
+	{
+	return TextFieldL(KUidContactFieldFamilyName);
+	}
+
+const TPtrC CTestContact::CompanyNameL()
+	{
+	return TextFieldL(KUidContactFieldCompanyName);
+	}
+
+const TPtrC CTestContact::JobTitleL()
+	{
+	return TextFieldL(KUidContactFieldJobTitle);
+	}
+
+const TPtrC CTestContact::WorkPhoneL()
+	{
+	CContentType* contentType=CContentType::NewL();
+	CleanupStack::PushL(contentType);
+	contentType->AddFieldTypeL(KUidContactFieldPhoneNumber);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapWORK);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapVOICE);
+	const TPtrC text=TextFieldL(*contentType);
+	CleanupStack::PopAndDestroy(); // contentType.
+	return text;
+	}
+
+const TPtrC CTestContact::WorkMobileL()
+	{
+	CContentType* contentType=CContentType::NewL();
+	CleanupStack::PushL(contentType);
+	contentType->AddFieldTypeL(KUidContactFieldPhoneNumber);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapWORK);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapVOICE);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapCELL);
+	const TPtrC text=TextFieldL(*contentType);
+	CleanupStack::PopAndDestroy(); // contentType.
+	return text;
+	}
+
+const TPtrC CTestContact::HomePhoneL()
+	{
+	CContentType* contentType=CContentType::NewL();
+	CleanupStack::PushL(contentType);
+	contentType->AddFieldTypeL(KUidContactFieldPhoneNumber);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapHOME);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapVOICE);
+	const TPtrC text=TextFieldL(*contentType);
+	CleanupStack::PopAndDestroy(); // contentType.
+	return text;
+	}
+
+const TPtrC CTestContact::HomeMobileL()
+	{
+	CContentType* contentType=CContentType::NewL();
+	CleanupStack::PushL(contentType);
+	contentType->AddFieldTypeL(KUidContactFieldPhoneNumber);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapHOME);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapVOICE);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapCELL);
+	const TPtrC text=TextFieldL(*contentType);
+	CleanupStack::PopAndDestroy(); // contentType.
+	return text;
+	}
+
+const TPtrC CTestContact::FaxL()
+	{
+	return TextFieldL(KUidContactFieldFax);
+	}
+
+const TPtrC CTestContact::EmailAddressL()
+	{
+	return TextFieldL(KUidContactFieldEMail);
+	}
+
+const TPtrC CTestContact::InternetAddressL()
+	{
+	return TextFieldL(KUidContactFieldUrl);
+	}
+
+const TPtrC CTestContact::StreetL()
+	{
+	return TextFieldL(KUidContactFieldAddress);
+	}
+
+const TPtrC CTestContact::TownL()
+	{
+	return TextFieldL(KUidContactFieldLocality);
+	}
+
+const TPtrC CTestContact::CountyL()
+	{
+	return TextFieldL(KUidContactFieldRegion);
+	}
+
+const TPtrC CTestContact::PostCodeL()
+	{
+	return TextFieldL(KUidContactFieldPostcode);
+	}
+
+const TPtrC CTestContact::CountryL()
+	{
+	return TextFieldL(KUidContactFieldCountry);
+	}
+
+const TPtrC CTestContact::NotesL()
+	{
+	return TextFieldL(KUidContactFieldNote);
+	}
+
+const TPtrC CTestContact::NickNameL()
+	{
+	return TextFieldL(KUidContactFieldSecondName);
+	}
+
+const TPtrC CTestContact::PictureL()
+	{
+	return TextFieldL(KUidContactFieldPicture);
+	}
+
+void CTestContact::SetFirstNameL(const TDesC& aFirstName)
+	{
+ 	SetTextFieldL(KUidContactFieldGivenName, aFirstName, KUidContactFieldVCardMapUnusedN);
+	}
+
+void CTestContact::SetLastNameL(const TDesC& aLastName)
+	{
+ 	SetTextFieldL(KUidContactFieldFamilyName, aLastName, KUidContactFieldVCardMapUnusedN);
+	}
+
+void CTestContact::SetCompanyNameL(const TDesC& aCompanyName)
+	{
+	SetTextFieldL(KUidContactFieldCompanyName, aCompanyName, KUidContactFieldVCardMapORG);
+	}
+
+void CTestContact::SetJobTitleL(const TDesC& aJobTitle)
+	{
+	SetTextFieldL(KUidContactFieldJobTitle,aJobTitle);
+	}
+
+void CTestContact::SetWorkPhoneL(const TDesC& aWorkPhone)
+	{
+	CContentType* contentType=CContentType::NewL();
+	CleanupStack::PushL(contentType);
+	contentType->AddFieldTypeL(KUidContactFieldPhoneNumber);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapWORK);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapVOICE);
+	SetTextFieldL(*contentType,aWorkPhone);
+	CleanupStack::PopAndDestroy(); // contentType.
+	}
+
+void CTestContact::SetWorkMobileL(const TDesC& aWorkMobile)
+	{
+	CContentType* contentType=CContentType::NewL();
+	CleanupStack::PushL(contentType);
+	contentType->AddFieldTypeL(KUidContactFieldPhoneNumber);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapWORK);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapVOICE);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapCELL);
+	SetTextFieldL(*contentType,aWorkMobile);
+	CleanupStack::PopAndDestroy(); // contentType.
+	}
+
+void CTestContact::SetHomePhoneL(const TDesC& aHomePhone)
+	{
+	CContentType* contentType=CContentType::NewL();
+	CleanupStack::PushL(contentType);
+	contentType->AddFieldTypeL(KUidContactFieldPhoneNumber);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapHOME);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapVOICE);
+	SetTextFieldL(*contentType,aHomePhone);
+	CleanupStack::PopAndDestroy(); // contentType.
+	}
+
+void CTestContact::SetHomeMobileL(const TDesC& aHomeMobile)
+	{
+	CContentType* contentType=CContentType::NewL();
+	CleanupStack::PushL(contentType);
+	contentType->AddFieldTypeL(KUidContactFieldPhoneNumber);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapHOME);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapVOICE);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapCELL);
+	SetTextFieldL(*contentType,aHomeMobile);
+	CleanupStack::PopAndDestroy(); // contentType.
+	}
+
+void CTestContact::SetFaxL(const TDesC& aFax)
+	{
+	SetTextFieldL(KUidContactFieldFax,aFax);
+	}
+
+void CTestContact::SetHomeEmailAddressL(const TDesC& aEmailAddress)
+	{
+	CContentType* contentType=CContentType::NewL();
+	CleanupStack::PushL(contentType);
+	contentType->AddFieldTypeL(KUidContactFieldEMail);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapHOME);
+	SetTextFieldL(*contentType,aEmailAddress);
+	CleanupStack::PopAndDestroy(contentType);
+	}
+
+void CTestContact::SetWorkEmailAddressL(const TDesC& aEmailAddress)
+	{
+	CContentType* contentType=CContentType::NewL();
+	CleanupStack::PushL(contentType);
+	contentType->AddFieldTypeL(KUidContactFieldEMail);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapWORK);
+	SetTextFieldL(*contentType,aEmailAddress);
+	CleanupStack::PopAndDestroy(contentType);
+	}
+
+
+void CTestContact::SetInternetAddressL(const TDesC& aInternetAddress)
+	{
+	SetTextFieldL(KUidContactFieldUrl,aInternetAddress);
+	}
+
+void CTestContact::SetStreetL(const TDesC& aStreet)
+	{
+	SetTextFieldL(KUidContactFieldAddress,aStreet);
+	}
+
+void CTestContact::SetTownL(const TDesC& aTown)
+	{
+	SetTextFieldL(KUidContactFieldLocality,aTown);
+	}
+
+void CTestContact::SetCountyL(const TDesC& aCounty)
+	{
+	SetTextFieldL(KUidContactFieldRegion,aCounty);
+	}
+
+void CTestContact::SetPostCodeL(const TDesC& aPostCode)
+	{
+	SetTextFieldL(KUidContactFieldPostcode,aPostCode);
+	}
+
+void CTestContact::SetCountryL(const TDesC& aCountry)
+	{
+	SetTextFieldL(KUidContactFieldCountry,aCountry);
+	}
+
+void CTestContact::SetNotesL(const TDesC& aNotes)
+	{
+	SetTextFieldL(KUidContactFieldNote,aNotes);
+	}
+
+void CTestContact::SetNickNameL(const TDesC& aNickName)
+	{
+	CContentType* contentType=CContentType::NewL();
+	CleanupStack::PushL(contentType);
+	contentType->AddFieldTypeL(KUidContactFieldSecondName);
+	TRAPD(err, SetTextFieldL(*contentType,aNickName));
+        if (!err) { }
+	CleanupStack::PopAndDestroy(); // contentType.
+	}
+
+void CTestContact::SetPictureL(const TDesC8& aPicture)
+	{
+	CContentType* contentType=CContentType::NewL();
+	CleanupStack::PushL(contentType);
+	contentType->AddFieldTypeL(KUidContactFieldPicture);
+	SetPictureFieldL(aPicture);
+	CleanupStack::PopAndDestroy(contentType);
+	}
+
+const TPtrC CTestContact::TextFieldL(TFieldType aFieldType) const
+	{
+	CContactItemField& field=FindFieldL(aFieldType);
+	ASSERT(field.StorageType()==KStorageTypeText);
+	return STATIC_CAST(CContactTextField*,(field.Storage()))->Text();
+	}
+
+const TPtrC CTestContact::TextFieldL(const CContentType& aTypesToMatch) const
+	{
+	CContactItemField& field=FindFieldL(aTypesToMatch);
+	ASSERT(field.StorageType()==KStorageTypeText);
+	return STATIC_CAST(CContactTextField*,field.Storage())->Text();
+	}
+
+void CTestContact::InsertTextFieldL(TFieldType aID, const TDesC& aStringOfStuff )
+	{
+ 	CContactItemField* itemFieldPtr = NULL;
+ 	CContactTextField* textStoragePtr = NULL;
+
+ 	itemFieldPtr = CContactItemField::NewLC( KStorageTypeText, aID );
+ 	textStoragePtr = itemFieldPtr->TextStorage(); // we don't have ownership here, hence no stack.
+
+ 	textStoragePtr->SetTextL( aStringOfStuff );
+ 	textStoragePtr = NULL; // we've finished with this ptr now.
+
+ 	iContactItem->AddFieldL( *itemFieldPtr ); // hand ownership over here
+ 	CleanupStack::Pop( itemFieldPtr ); // and pop,
+	}
+
+void CTestContact::SetTextFieldL(TFieldType aFieldType,const TDesC& aText)
+	{
+ 	TInt	fieldIndex=FindField(aFieldType);
+
+ 	if ( fieldIndex > KErrNotFound )
+		{
+ 		CContactItemField&	field=FindFieldL(aFieldType);
+ 		ASSERT(field.StorageType()==KStorageTypeText);
+ 		STATIC_CAST(CContactTextField*,field.Storage())->SetText(aText.AllocL());
+		}
+ 	else
+		{
+ 		InsertTextFieldL(aFieldType, aText);
+		}
+	}
+
+void CTestContact::SetTextFieldL(const CContentType& aTypesToMatch,const TDesC& aText) const
+	{
+	CContactItemField& field=FindFieldL(aTypesToMatch);
+	ASSERT(field.StorageType()==KStorageTypeText);
+	STATIC_CAST(CContactTextField*,field.Storage())->SetText(aText.AllocL());
+	}
+
+CContactItemField& CTestContact::FindFieldL(TFieldType aFieldType) const
+	{
+	CContactItemFieldSet& fields=iContactItem->CardFields();
+	TInt index=fields.Find(aFieldType);
+	User::LeaveIfError(index);
+	return fields[index];
+	}
+
+void CTestContact::SetTextFieldL(TFieldType aFieldType, const TDesC& aText, TUid aAddOnContentType)
+	{
+	CContactItemFieldSet& fields = iContactItem->CardFields();
+	CContactTextField* textField = NULL;
+	TInt fieldIndex = 0;
+
+	fieldIndex = FindField( aFieldType );
+
+	if (fieldIndex == KErrNotFound )
+		{
+		InsertTextFieldL( aFieldType, aText );
+		fieldIndex = FindField( aFieldType );
+		CContactItemField& field = fields[ fieldIndex ];
+		field.AddFieldTypeL( aAddOnContentType );
+		}
+		else if (fieldIndex >= KErrNone )
+		{
+		CContactItemField& field = fields[ fieldIndex ];
+		ASSERT(field.StorageType()==KStorageTypeText);
+		textField = static_cast<CContactTextField*>(field.Storage());
+		textField->SetText( aText.AllocL() );
+		field.AddFieldTypeL( aAddOnContentType );
+		}
+	}
+
+TInt CTestContact::FindField(TFieldType aFieldType) const
+	{
+	return iContactItem->CardFields().Find( aFieldType );
+	}
+
+CContactItemField& CTestContact::FindFieldL(const CContentType& aTypesToMatch) const
+	{
+	CContactItemFieldSet& fields=iContactItem->CardFields();
+	const TInt numTypesToMatch(aTypesToMatch.FieldTypeCount());
+	const TFieldType mainFieldType(aTypesToMatch.FieldType(0));
+	TInt index=-1;
+	FOREVER
+		{
+		index=fields.FindNext(mainFieldType,index+1);
+		User::LeaveIfError(index);
+
+		CContactItemField& thisPhoneField=fields[index];
+		const CContentType& thisPhoneFieldTypes=thisPhoneField.ContentType();
+		const TInt numFieldTypes(thisPhoneFieldTypes.FieldTypeCount());
+
+		if (numFieldTypes!=numTypesToMatch)
+			{
+			continue;
+			}
+
+		TInt numTypesLeftToMatch=numTypesToMatch;
+		for (TInt ii=0;ii<numFieldTypes;++ii)
+			{
+			TFieldType thisFieldType(thisPhoneFieldTypes.FieldType(ii));
+			for (TInt jj=0;jj<numTypesToMatch;++jj)
+				{
+				TFieldType thisFieldTypeToMatch(aTypesToMatch.FieldType(jj));
+				if (thisFieldType==thisFieldTypeToMatch)
+					{
+					if (--numTypesLeftToMatch<=0)
+						{
+						return thisPhoneField;
+						}
+
+					break;
+					}
+				}
+			}
+		}
+	}
+
+void CTestContact::SetPictureFieldL(const TDesC8& aPicture) const
+	{
+
+	CContactItemFieldSet& fieldSet=iContactItem->CardFields();
+	TInt pos;
+	pos=fieldSet.Find(KUidContactFieldPicture);
+	User::LeaveIfError(pos);
+	fieldSet[pos].StoreStorage()->SetThingL(aPicture);
+
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/src/TestContactsAddEntries.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,408 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestContactsAddEntries
+// 
+//
+
+// Epoc include
+#include <TestExecuteLog.h>
+
+// User include
+#include "TestContactsAddEntries.h"
+#include "TestContact.h"
+
+/*@{*/
+/// Literal constants
+_LIT(KCardTemplateName,	"TestTemplate");
+_LIT(KCount,			"count");
+_LIT(KFirstName,		"firstname%d");
+_LIT(KLastName,			"lastname%d");
+_LIT(KCompanyName,		"company%d");
+_LIT(KJobTitle,			"job%d");
+_LIT(KWorkPhone,		"workphone%d");
+_LIT(KWorkMobile,		"workmobile%d");
+_LIT(KHomePhone,		"homephone%d");
+_LIT(KHomeMobile,		"homemobile%d");
+_LIT(KFax,				"fax%d");
+_LIT(KWorkEmailAddress,	"workemail%d");
+_LIT(KInternetAddress,	"internet%d");
+_LIT(KStreet,			"street%d");
+_LIT(KTown,				"town%d");
+_LIT(KCounty,			"county%d");
+_LIT(KPostCode,			"postcode%d");
+_LIT(KCountry,			"country%d");
+_LIT(KNotes,			"notes%d");
+_LIT(KNickName,			"nickName%d");
+_LIT(KPictureName,		"picturename%d");
+_LIT(KGroupName,		"groupname%d");
+_LIT(KTemplateName,		"templatename%d");
+_LIT(KOneFieldTemplate,	"OneFieldTemplate");
+/*@}*/
+
+
+CTestContactsAddEntries::CTestContactsAddEntries()
+/**
+Default Constructor
+ */
+	{
+	SetTestStepName(_L("AddEntries"));
+	}
+
+CTestContactsAddEntries::~CTestContactsAddEntries()
+/**
+Destructor
+ */
+	{
+	}
+
+// Each test step must supply a implementation for doTestStepL
+enum TVerdict CTestContactsAddEntries::doTestStepL()
+/**
+invoked by the test execute framework for exercising the
+functionality under test
+@return	EPass: The test passed succesfully;
+		EFail: The test failed;
+		EInconclusive: The result of the test was inconclusive;
+		ETestSuiteError: Error in the test suite;
+		EAbort: The test was aborted;
+		EIgnore: The test was unexecuted
+@leave system wide error codes
+*/
+	{
+
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("Contacts Add Entries Test"));
+
+	OpenDatabase();
+	if ( TestStepResult() == EPass )
+		{
+		TRAPD(r, AddEntriesL());
+		if (r!=KErrNone)
+			{
+			ERR_PRINTF2(_L("Test step failed with error code = %d"), r);
+			SetTestStepResult(EFail);
+			}
+		}
+	CleanupDatabase();
+
+	// test steps return a result
+	return TestStepResult();
+	}
+
+void CTestContactsAddEntries::AddEntriesL()
+/**
+This function adds contact entries to the database depending on entry type.
+If the entry contains the group name then the contact will be added to the
+particular group specified in the entry. If the entry contains the template
+name then the contact item depending on the specified template name will be
+created and added to the database.
+
+@leave system wide error code
+ */
+	{
+	TBool	groupExists = EFalse;
+	TBool	templateFound = EFalse;
+	TInt	count=1;
+
+	if ( !GetIntFromConfig(ConfigSection(), KCount, count) )
+		{
+		count=1;
+		}
+
+	INFO_PRINTF2(_L("Number of Entries to Add = %d"), count);
+
+	TBuf<KMaxScriptLineLength>	tempStore;
+	TPtrC						ptrString;
+
+	/*******************************************************************
+	 To Create a contact card template depending upon the contact item
+	 on which the new template's field set is based. The template name
+	 on which the new template is based is read from the ini file.
+	 *******************************************************************/
+
+	for (TInt entry=0; entry<count; )
+		{
+		CContactItem* item = NULL;
+
+		// The entry contains the template name
+		tempStore.Format(KTemplateName(), ++entry);
+		if (!GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("Entry %d has no Template Name"), entry);
+			item = iDatabase->CreateContactCardTemplateLC(KCardTemplateName);
+			}
+		else
+			{
+			INFO_PRINTF2(_L("Template Name = %S"), &ptrString);
+			CContactIdArray* templateList = NULL;
+			CContactItem* tempTemplate = NULL;
+
+			// Returns a copy of the database's template ID list
+			templateList = iDatabase->GetCardTemplateIdListL();
+			CleanupStack::PushL(templateList);
+
+			// Returns the number of contact card templates that currently exist in the database.
+			TInt tCount = iDatabase->TemplateCount();
+			INFO_PRINTF2(_L("Number of existing templates = %d"), tCount);
+
+			// Search for template in the template ID list
+			for(TInt i = 0; i<tCount && templateFound == EFalse;i++)
+				{
+				// Reads a contact item
+				tempTemplate = STATIC_CAST(CContactItem*, iDatabase->ReadContactLC((*templateList)[i]));
+
+				// Gets the label for a contact card template.
+				TPtrC tempLabel = STATIC_CAST(CContactCardTemplate*,tempTemplate)->GetTemplateLabelL();
+
+							// Compare the template label
+				if(!(tempLabel.Compare(ptrString)))
+					{
+					INFO_PRINTF2(_L("Template %S found"), &tempLabel);
+
+					// Creates a contact card template and adds it to the database
+					item = iDatabase->CreateContactCardTemplateLC(tempTemplate,tempLabel);
+
+					// Compare the template label with OneFieldTemplate and add field to it.
+					if(!(tempLabel.Compare(KOneFieldTemplate)))
+						{
+						// Allocates and constructs a contact item field
+						CContactItemField* field=CContactItemField::NewLC(KStorageTypeText,KUidContactFieldGivenName);
+						item->AddFieldL(*field);
+						CleanupStack::Pop(field); // field
+						}
+					CleanupStack::Pop(item);
+					templateFound = ETrue;
+					}
+				  CleanupStack::PopAndDestroy(tempTemplate);
+				}
+
+			if (!templateFound)
+				{
+				ERR_PRINTF2(_L("Ini Template %S does not match existing templates"), &ptrString);
+				SetTestStepResult(EFail);
+				}
+
+			// Set templateFound to false for next entry
+			templateFound = EFalse;
+
+			CleanupStack::PopAndDestroy(templateList);
+			CleanupStack::PushL(item);
+			}
+
+		CTestContact*	contact=CTestContact::NewLC(*item);
+
+		tempStore.Format(KFirstName(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("firstname = %S"), &ptrString);
+			contact->SetFirstNameL(ptrString);
+			}
+
+		tempStore.Format(KNickName(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("NickName = %S"), &ptrString);
+			TRAPD(err, contact->SetNickNameL(ptrString));
+			if ( err != KErrNone )
+				{
+				ERR_PRINTF2(_L("SetNickNameL Leave = %d"), err);
+				SetTestStepResult(EFail);
+				}
+			}
+
+		tempStore.Format(KLastName(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("lastname = %S"), &ptrString);
+			contact->SetLastNameL(ptrString);
+			}
+
+		tempStore.Format(KCompanyName(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("company = %S"), &ptrString);
+			contact->SetCompanyNameL(ptrString);
+			}
+
+		tempStore.Format(KJobTitle(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("job = %S"), &ptrString);
+			contact->SetJobTitleL(ptrString);
+			}
+
+		tempStore.Format(KWorkPhone(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("work phone = %S"), &ptrString);
+			contact->SetWorkPhoneL(ptrString);
+			}
+
+		tempStore.Format(KWorkMobile(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("work mobile = %S"), &ptrString);
+			contact->SetWorkMobileL(ptrString);
+			}
+
+		tempStore.Format(KHomePhone(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("home phone = %S"), &ptrString);
+			contact->SetHomePhoneL(ptrString);
+			}
+
+		tempStore.Format(KHomeMobile(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("home mobile = %S"), &ptrString);
+			contact->SetHomeMobileL(ptrString);
+			}
+
+		tempStore.Format(KFax(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("fax = %S"), &ptrString);
+			contact->SetFaxL(ptrString);
+			}
+
+		tempStore.Format(KWorkEmailAddress(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("work email = %S"), &ptrString);
+			contact->SetWorkEmailAddressL(ptrString);
+			}
+
+		tempStore.Format(KInternetAddress(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("internet = %S"), &ptrString);
+			contact->SetInternetAddressL(ptrString);
+			}
+
+		tempStore.Format(KStreet(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("street = %S"), &ptrString);
+			contact->SetStreetL(ptrString);
+			}
+
+		tempStore.Format(KTown(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("town = %S"), &ptrString);
+			contact->SetTownL(ptrString);
+			}
+
+		tempStore.Format(KCounty(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("county = %S"), &ptrString);
+			contact->SetCountyL(ptrString);
+			}
+
+		tempStore.Format(KPostCode(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("post code = %S"), &ptrString);
+			contact->SetPostCodeL(ptrString);
+			}
+
+		tempStore.Format(KCountry(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("country = %S"), &ptrString);
+			contact->SetCountryL(ptrString);
+			}
+
+		tempStore.Format(KNotes(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("notes = %S"), &ptrString);
+			contact->SetNotesL(ptrString);
+			}
+
+		tempStore.Format(KPictureName(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("Picture Name = %S"), &ptrString);
+
+			HBufC8*	pictureName8 = HBufC8::NewLC(ptrString.Length());
+			pictureName8->Des().Copy(ptrString);
+
+			contact->SetPictureL(*pictureName8);
+
+			CleanupStack::PopAndDestroy(pictureName8);
+			}
+
+		tempStore.Format(KGroupName(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("Group Name = %S"), &ptrString);
+
+			// Flag for adding contacts to group.
+			groupExists = ETrue;
+			}
+
+		const TContactItemId id = iDatabase->AddNewContactL(contact->ContactItem());
+
+		/********************************************************************
+		This is for adding the contact entry to the specified group.
+		********************************************************************/
+		if(groupExists)
+			{
+			INFO_PRINTF1(_L("Adding Item "));
+			CContactIdArray* groupList = NULL;
+
+			// Returns a copy of the database's group ID list
+			groupList = iDatabase->GetGroupIdListL();
+			CleanupStack::PushL(groupList);
+
+			// Returns the number of groups that currently exist in the database
+			TInt groupCount = iDatabase->GroupCount();
+
+
+			// Search for the group
+			for(TInt i = 0; i<groupCount;i++)
+				{
+				// Reads a contact item
+				CContactGroup* group = STATIC_CAST(CContactGroup*, iDatabase->ReadContactLC((*groupList)[i]));
+
+				// Gets the contact item's ID.
+				const TContactItemId groupId1 = group->Id();
+
+				// Gets the group label.
+				TPtrC	label = group->GetGroupLabelL();
+				// Compare the group label with group name read from ini file.
+				if(!(label.Compare(ptrString)))
+					{
+					/**
+					Sets a contact item which already exists in the database
+					to be a member of a contact group
+					 */
+					iDatabase->AddContactToGroupL(id, groupId1);
+					INFO_PRINTF1(_L("Item added successfully"));
+					groupExists = EFalse;
+					}
+				CleanupStack::PopAndDestroy(group);
+
+				}
+			CleanupStack::PopAndDestroy(groupList);
+			}
+
+		CleanupStack::PopAndDestroy(contact);
+		CleanupStack::PopAndDestroy(item);
+
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/src/TestContactsBase.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,176 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This CTestContactsBase
+// 
+//
+
+// User include
+#include "TestContactsBase.h"
+
+// EPOC includes
+#include <e32base.h>
+#include <Uri16.h>
+#include <UriUtils.h>
+#include <TestExecuteLog.h>
+
+/*@{*/
+/// Literal constants
+_LIT(KDef,			"default");
+_LIT(KFileName,		"filenameSecure");
+_LIT(KKey,			"key");
+/*@}*/
+
+
+// constructor
+CTestContactsBase::CTestContactsBase()
+:	iDatabase(NULL)
+,	iFieldDef(NULL)
+,	iSchedular(NULL)
+	{
+	}
+
+// destructor
+CTestContactsBase::~CTestContactsBase()
+	{
+	delete iFieldDef;
+	iFieldDef=NULL;
+
+	delete iSchedular;
+	iSchedular=NULL;
+	CActiveScheduler::Install(NULL);
+	}
+
+enum TVerdict CTestContactsBase::doTestStepPreambleL()
+	{
+	iSchedular=new (ELeave)CActiveScheduler();
+	CActiveScheduler::Install(iSchedular);
+
+	iFieldDef=new(ELeave) CContactItemFieldDef;
+	iFieldDef->AppendL(KUidContactFieldFamilyName);
+	iFieldDef->AppendL(KUidContactFieldGivenName);
+	return CTestStep::doTestStepPreambleL();
+	}
+
+enum TVerdict CTestContactsBase::doTestStepPostambleL()
+	{
+	delete iFieldDef;
+	iFieldDef=NULL;
+
+	delete iSchedular;
+	iSchedular=NULL;
+	CActiveScheduler::Install(NULL);
+
+	return CTestStep::doTestStepPostambleL();
+	}
+
+// Create a new database
+void CTestContactsBase::CreateDatabase()
+	{
+	TPtrC	ptrFileName;
+	TBool	returnValue =GetStringFromConfig(ConfigSection(), KFileName(), ptrFileName);
+	if (!returnValue)
+		returnValue=GetStringFromConfig(KDef(), KFileName(), ptrFileName);
+
+	//	Create database
+	if (returnValue)
+		{
+		INFO_PRINTF2(_L("filename = %S"), &ptrFileName);
+		TRAPD(r, iDatabase=CContactDatabase::ReplaceL(ptrFileName))
+		if (r!=KErrNone)
+			{
+			ERR_PRINTF2(_L("Creating Contacts file failed. Error %d"), r);
+			SetTestStepResult(EFail);
+			}
+		}
+	else
+		{
+		INFO_PRINTF1(_L("No Contacts file specified. Open default file."));
+		TRAPD(r, iDatabase=CContactDatabase::ReplaceL())
+		if (r!=KErrNone)
+			{
+			ERR_PRINTF2(_L("Creating Contacts file failed. Error %d"), r);
+			SetTestStepResult(EFail);
+			}
+		}
+	}
+
+void CTestContactsBase::OpenDatabase()
+	{
+	TPtrC	ptrFileName;
+	TBool	returnValue =GetStringFromConfig(ConfigSection(), KFileName(), ptrFileName);
+	if (!returnValue)
+		returnValue=GetStringFromConfig(KDef(), KFileName(), ptrFileName);
+
+	//	Open database
+	if (returnValue)
+		{
+		INFO_PRINTF2(_L("filename = %S"), &ptrFileName);
+		RaiseInstrumentationEventNotificationL(17);
+		TRAPD(r, iDatabase=CContactDatabase::OpenL(ptrFileName));
+		RaiseInstrumentationEventNotificationL(18);
+		if (r!=KErrNone)
+			{
+			ERR_PRINTF2(_L("Opening Contacts file failed. Error %d"), r);
+			SetTestStepResult(EFail);
+			}
+		}
+	else
+		{
+		INFO_PRINTF1(_L("No Contacts file specified. Open default file."));
+		RaiseInstrumentationEventNotificationL(17);
+		TRAPD(r, iDatabase=CContactDatabase::OpenL(CContactDatabase::EMultiThread));
+		RaiseInstrumentationEventNotificationL(18);
+		if (r!=KErrNone)
+			{
+			ERR_PRINTF2(_L("Opening Contacts file failed. Error %d"), r);
+			SetTestStepResult(EFail);
+			}
+		}
+	}
+
+void CTestContactsBase::CleanupDatabase()
+	{
+	delete iDatabase;
+	iDatabase=NULL;
+	}
+
+void CTestContactsBase::RaiseInstrumentationEventNotificationL(TInt aEventTag)
+	{
+	INFO_PRINTF2(_L("RaiseEventNotification %d"), aEventTag);
+	}
+
+CContactIdArray* CTestContactsBase::SearchEntriesL()
+/**
+This function searches in the contacts database and populates an array
+with ids' of the contacts which satisfy the search criterion
+read from the ini file.
+@return - Pointer to the contact ID array
+@leave system wide error code
+ */
+	{
+	TPtrC	ptrKey;
+	if (!GetStringFromConfig(ConfigSection(), KKey, ptrKey))
+		{
+		ERR_PRINTF1(_L("No key value for entry"));
+		SetTestStepResult(EFail);
+		}
+	INFO_PRINTF2(_L("Key Value for Entry Search = %S"), &ptrKey);
+
+	// The function searches the fields contained in the field definition
+	INFO_PRINTF1(_L("Searching through the database for entry"));
+
+	CContactIdArray*	ret=iDatabase->FindLC(ptrKey, iFieldDef);
+	CleanupStack::Pop(ret);
+	return ret;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/src/TestContactsCreateDB.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,42 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestContactsCreateDB
+// 
+//
+
+#include <TestExecuteLog.h>
+
+#include "TestContactsCreateDB.h"
+
+CTestContactsCreateDB::CTestContactsCreateDB()
+	{
+	SetTestStepName(_L("CreateDB"));
+	}
+
+CTestContactsCreateDB::~CTestContactsCreateDB()
+	{
+	}
+
+// Each test step must supply a implementation for doTestStepL
+enum TVerdict CTestContactsCreateDB::doTestStepL()
+	{
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("Contacts CreateDB Test"));
+
+	CreateDatabase();
+	CleanupDatabase();
+
+	// test steps return a result
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/src/sm_contacts.ini	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,2 @@
+[Files MRU]
+0=m:\src\common\generic\smoketest\agenda\src\TestAgendaServerLaunchProgress.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/group/MachineName.txt	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1 @@
+machine-name
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/group/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,24 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file
+// bld.inf file for the Messaging Integration Test
+// 
+//
+
+PRJ_TESTMMPFILES
+#include "../../email/pop/group/bld.inf"
+#include "../../email/smtp/group/bld.inf"
+
+PRJ_TESTEXPORTS
+MachineName.txt    	z:/smoketest/MachineName.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/group/machinename.pl	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,27 @@
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of the License "Symbian Foundation License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+use Win32;
+
+my $computer;
+$computer=Win32::NodeName();
+$machineName = lc($computer);
+
+$fileName = "\\epoc32\\winscw\\c\\msgtest\\MachineName.txt";
+open(FILE, "> " . $fileName);
+
+# Write settings to output files
+print FILE "$machineName";
+close(FILE);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/group/T_PopServer.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,81 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Project definition file for Pop test Server
+// 
+//
+
+	CAPABILITY 		ALL -TCB
+	TARGET			t_msgpopserver.exe
+	TARGETTYPE		exe
+	UID			0x1000007A 0x1027406F
+	VENDORID 		0x70000001
+
+// Include the Framework 
+#include "../../../framework/group/T_MsgFramework.mph"
+
+
+
+
+SYSTEMINCLUDE		/epoc32/include
+SYSTEMINCLUDE		/epoc32/include/test
+SYSTEMINCLUDE		/epoc32/include/comms-infras
+
+USERINCLUDE 	../inc
+
+SOURCEPATH	../src
+SOURCE	T_PopServer.cpp
+SOURCE	T_MsgSharedDataPop.cpp
+SOURCE	T_MsgAsyncStepPOP.cpp
+SOURCE	T_MsgSyncStepPOP.cpp
+SOURCE	T_CheckChildrenCountPop.cpp
+SOURCE	T_ComparePopEmailMsgs.cpp
+SOURCE	T_ComparePopSettings.cpp
+SOURCE	T_ConnectPop3Server.cpp
+SOURCE	T_CopyPopSelection.cpp
+SOURCE	T_CreatePopAccount.cpp
+SOURCE	T_DeleteAllPopChildren.cpp
+SOURCE	T_DeletePopAccount.cpp
+SOURCE	T_DisconnectPop3Server.cpp
+SOURCE	T_ModifyPopSettings.cpp
+SOURCE	T_PopInvokeAsyncFunction.cpp
+SOURCE	T_VerifyPopAccountsCount.cpp
+SOURCE	T_VerifyPopSettings.cpp
+SOURCE	T_StartRamUsageTimer.cpp
+SOURCE	T_StopRamUsageTimer.cpp
+SOURCE	T_CheckPop3AccessPoint.cpp
+SOURCE	T_CreatePopAccountWithoutSmtp.cpp
+SOURCE	T_ModifyPopSettings2.cpp
+SOURCE	T_CheckPopSNAPSetting.cpp
+SOURCE	T_RemovePopSNAPSetting.cpp
+SOURCE	T_CheckPopBMSetting.cpp
+
+LIBRARY 	testexecuteutils.lib
+LIBRARY		testexecutelogclient.lib
+LIBRARY		imut.lib 
+LIBRARY		bafl.lib
+LIBRARY		etext.lib
+LIBRARY		estor.lib 
+LIBRARY		msgs.lib
+LIBRARY		euser.lib
+LIBRARY		imcm.lib
+LIBRARY		efsrv.lib
+LIBRARY		charconv.lib
+LIBRARY		t_msgutilityserver.lib
+LIBRARY		hal.lib
+//LIBRARY		instrumentationhandler.lib
+LIBRARY		netmeta.lib
+EPOCHEAPSIZE 0x1000 0x800000
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/group/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Component description file for Pop test Server
+// 
+//
+
+PRJ_TESTMMPFILES
+T_PopServer.mmp
+
+PRJ_TESTEXPORTS
+// **** Test Suite: Messaging.Email.pop.plainbody
+../scripts/plainbody/smoketest_email.script		z:/smoketest/smoketest_email.script
+../testdata/plainbody/smoketest_email.ini		z:/smoketest/smoketest_email.ini
+../scripts/plainbody/setup_smoketest_email.script	z:/smoketest/setup_smoketest_email.script
+
+// Email Account Settings files
+../testdata/EmailSettings/POPSettings_test908.txt    	z:/smoketest/emailsettings/popsettings_test908.txt
+// Email Message files
+
+#ifndef _COMMON_EMAIL_FILES_
+#define _COMMON_EMAIL_FILES_
+../testdata/EmailMessage/20KBody.txt	z:/smoketest/EmailMessage/20KBody.txt
+#endif //End of _COMMON_EMAIL_FILES_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/CExpMailInfo.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,75 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* This contains the class for CExpPop3MailInfo 
+* 
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+#ifndef __CEXPMAILINFO_H__
+#define __CEXPMAILINFO_H__
+
+
+// Epoc include
+#include <e32base.h>
+
+/**
+This class holds the information of number of lines, description etc... of a message.
+*/
+class CExpPop3MailInfo : public CBase
+	{
+public:
+	CExpPop3MailInfo() { }
+
+	virtual ~CExpPop3MailInfo() { }
+	
+	inline TInt GetNumLinesBodyText() const;
+	inline void SetNumLinesBodyText(TInt aLinesBodyText);
+
+	inline TInt GetNumAttachments() const;
+	inline void SetNumAttachments(TInt aNumAttachments);
+
+	inline TInt GetNumLinesHtml() const;
+	inline void SetNumLinesHtml(TInt aNumLinesHtml);
+
+	inline TBool GetFooterExpected() const;
+	inline void SetFooterExpected(TBool aFooterExpected);
+
+	inline TInt GetFooterSize() const;
+	inline void SetFooterSize(TBool aFooterSize);
+
+	inline TDesC& GetDescription();
+	inline void SetDescription(TDesC& aDesc);
+
+private:
+	TInt						iLinesBodyText;
+	TInt						iNumAttachments;
+	TInt						iNumLinesHtml;
+	TBool						iFooterExpected;
+	TBuf<64>					iDescription;
+	TInt						iFooterSize;
+	};
+
+
+#include "CExpMailInfo.inl"
+
+#endif // __CEXPMAILINFO_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/CExpMailInfo.inl	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,155 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+
+/**
+ @file
+ 
+ Gets Number Of Lines Of Body Text
+ 
+ @return
+ Returns Number Of Lines Of Body Text
+*/
+inline TInt CExpPop3MailInfo::GetNumLinesBodyText() const 
+	{
+	return iLinesBodyText;
+	}
+
+/** 
+Sets Number Of Lines Of Body Text
+
+@param aLinesBodyText
+Count of Lines of Body Text
+*/
+inline void CExpPop3MailInfo::SetNumLinesBodyText(TInt aLinesBodyText) 
+	{
+	iLinesBodyText = aLinesBodyText;
+	}
+
+/** 
+Gets Number Of Attachments
+
+@return
+Returns Number Of Attachments
+*/
+inline TInt CExpPop3MailInfo::GetNumAttachments() const 
+	{
+	return iNumAttachments;
+	}
+	
+/** 
+Sets Number Of Attachments
+
+@param aNumAttachments
+Count of Number of Attachments
+*/
+inline void CExpPop3MailInfo::SetNumAttachments(TInt aNumAttachments)
+	{
+	iNumAttachments = aNumAttachments;
+	}
+
+/** 
+Gets Number Of Html Lines
+
+@return
+Returns Number Of Html Lines
+*/
+inline TInt CExpPop3MailInfo::GetNumLinesHtml() const 
+	{
+	return iNumLinesHtml;
+	}
+
+/** 
+Sets Number Of Lines Of HTML
+
+@param aLinesHtml
+Count of Lines of HTML
+*/
+inline void CExpPop3MailInfo::SetNumLinesHtml(TInt aNumLinesHtml)
+	{
+	iNumLinesHtml = aNumLinesHtml;
+	}
+
+/** 
+Gets Flag status for FooterExpected
+
+@return
+Returns Value of FooterExpected
+*/
+inline TBool CExpPop3MailInfo::GetFooterExpected() const
+	{
+	return iFooterExpected;
+	}
+
+/** 
+Sets if Footer is Expected
+
+@param aFooterExpected
+Sets ETrue if Footer Expected
+*/
+inline void CExpPop3MailInfo::SetFooterExpected(TBool aFooterExpected)
+	{
+	iFooterExpected = aFooterExpected;
+	}
+
+/** 
+Gets Size of Footer
+
+@return
+Returns Size of Footer
+*/
+inline TInt CExpPop3MailInfo::GetFooterSize() const
+	{
+	return iFooterSize;
+	}
+
+/** 
+Sets Footer Size
+
+@param aFooterSize
+Sets Footer Size
+*/
+inline void CExpPop3MailInfo::SetFooterSize(TBool aFooterSize)
+	{
+	iFooterSize = aFooterSize;
+	}
+
+/** 
+Gets Description
+
+@return
+Returns Description
+*/
+inline TDesC& CExpPop3MailInfo::GetDescription()
+	{
+	return iDescription;
+	}
+
+/** 
+Sets Description
+
+@param aDesc
+Sets Description
+*/
+inline void CExpPop3MailInfo::SetDescription(TDesC& aDesc) 
+	{ 
+	iDescription.Copy(aDesc);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_CheckChildrenCountPop.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,54 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+
+#ifndef __T_CHECK_CHILDREN_COUNT_H__
+#define __T_CHECK_CHILDREN_COUNT_H__
+
+// user includes
+#include"T_MsgSyncStepPop.h"
+#include "T_MsgSharedDataPop.h"
+
+// Literals Used
+_LIT(KCheckChildrenCountPop,"CheckChildrenCountPop");
+
+
+/**
+Implements the test step which obtains the children count under the POP account
+and matches it against the expected count.
+*/
+class CT_MsgCheckChildrenCountPop : public CT_MsgSyncStepPOP
+	{
+public:
+	CT_MsgCheckChildrenCountPop(CT_MsgSharedDataPop& aSharedDataPOP);
+	~CT_MsgCheckChildrenCountPop();
+	
+	// CTestStep implementation
+	TVerdict doTestStepL();
+
+private:
+	CT_MsgCheckChildrenCountPop();
+	};
+#endif //__T_CHECK_CHILDREN_COUNT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_CheckPop3AccessPoint.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __T_CHECKPOP3ACCESSPOINT_H__
+#define __T_CHECKPOP3ACCESSPOINT_H__
+
+#include "T_MsgSyncStepPop.h"
+
+_LIT(KCheckPop3AccessPoint,"CheckPop3AccessPoint");
+
+class CT_MsgCheckPop3AccessPoint : public CT_MsgSyncStepPOP
+	{
+public :
+	CT_MsgCheckPop3AccessPoint(CT_MsgSharedDataPop& aSharedDataPOP);
+
+	~CT_MsgCheckPop3AccessPoint();
+
+	/* CTestStep implementation */
+	TVerdict doTestStepL();
+	};
+
+#endif //__T_CHECKPOP3ACCESSPOINT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_CheckPopBMSetting.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,45 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is the header file for CT_MsgCheckPopBMSetting class
+// 
+//
+
+#ifndef T_CHECK_POP_BM_SETTING_H
+#define T_CHECK_POP_BM_SETTING_H
+
+/* User include */
+#include "T_MsgSyncStepPop.h"
+
+/* Literal used */
+_LIT(KCheckPopBMSetting,"CheckPopBMSetting");
+
+/* Implements a test step to check if bearer mobility is supported by POP service */
+class CT_MsgCheckPopBMSetting : public CT_MsgSyncStepPOP
+	{
+public:
+	CT_MsgCheckPopBMSetting(CT_MsgSharedDataPop& aSharedDataPOP);
+	
+	/* CTestStep implementation */
+	virtual TVerdict doTestStepL();
+	
+private:
+	TBool ReadIni();
+	
+private:
+	TPtrC iPopAccountName;
+	TBool iExpectedBMSupport;
+	
+	};
+	
+#endif /* T_CHECK_POP_BM_SETTING_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_CheckPopSNAPSetting.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,45 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is the header file for CT_MsgCheckPopSNAPSetting class
+// 
+//
+
+#ifndef T_CHECK_POP_SNAP_SETTING_H
+#define T_CHECK_POP_SNAP_SETTING_H
+
+/* User include */
+#include "T_MsgSyncStepPop.h"
+
+/* Literal used */
+_LIT(KCheckPopSNAPSetting,"CheckPopSNAPSetting");
+
+/* Implements a test step to check the POP SNAP information for the account */
+class CT_MsgCheckPopSNAPSetting : public CT_MsgSyncStepPOP
+	{
+public:
+	CT_MsgCheckPopSNAPSetting(CT_MsgSharedDataPop& aSharedDataPOP);
+	
+	/* CTestStep implementation */
+	virtual TVerdict doTestStepL();
+	
+private:
+	TBool ReadIni();
+	
+private:
+	TPtrC iPopAccountName;
+	TBool iExpectedSNAPDefinition;
+	
+	};
+	
+#endif /* T_CHECK_POP_SNAP_SETTING_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_ComparePopEmailMsgs.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,111 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+
+#ifndef __T_COMPARE_POP_EMAIL_MSGS_H__
+#define __T_COMPARE_POP_EMAIL_MSGS_H__
+
+	
+// User include
+#include "T_MsgAsyncStepPOP.h"
+#include "T_MsgSharedDataPop.h"
+
+
+// Epoc include
+#include <msvstd.h>
+
+// Literal used
+_LIT(KComparePopEmailMsgs,"ComparePopEmailMsgs");
+
+
+// Forward declaration
+class CImEmailMessage;
+class CExpPop3MailInfo;
+class CMsvSession;
+class MMsvAttachmentManager;
+
+
+/**
+Retireves the attacments related to a message entry.
+*/
+class CAttachmentItem : CBase
+	{
+public:	
+	static CAttachmentItem* NewL(CMsvSession& aSession, TMsvEntry aEntry);
+	static CAttachmentItem* NewLC(CMsvSession& aSession, TMsvEntry aEntry);
+	~CAttachmentItem();
+	
+	void ConstructL(CMsvSession& aSession, TMsvEntry aEntry);
+	MMsvAttachmentManager& MMsvAttachmentManager() const;
+	
+private:	
+	CMsvEntry*	iMsvEntry;
+	CImEmailMessage* iEmailMsg;
+	};
+
+
+/**	
+Implements the test step to compare email body text with the 
+partial/full download limits set.
+*/
+class CT_MsgComparePopEmailMsgs : public CT_MsgAsyncStepPOP
+	{
+public:
+	static CT_MsgComparePopEmailMsgs* NewL(CT_MsgSharedDataPop& aSharedDataPOP);
+	~CT_MsgComparePopEmailMsgs();
+
+	// CTestStep implementation
+	virtual TVerdict doTestStepL();
+
+private:
+	CT_MsgComparePopEmailMsgs(CT_MsgSharedDataPop& aSharedDataPOP);
+
+	//	CT_MsgAsyncStep implementation
+	virtual void	ProgressL(TBool bFinal);
+
+	//	MT_MsgActiveCallback implementation
+	virtual void	CancelStep();
+
+	TMsvId GetMessagePartIndexL(TMsvEntry& aEntry, TUid aUid);
+	TBool CheckIfFooterMessageExistsL(TPtrC& aRecvBodyText, TInt& aFooterSize);
+	TBool DoCompareL(TMsvEntry& aRecvEntry, CExpPop3MailInfo& aMailInfo, TMsvEntry& aSentEntry);
+	TInt GetMessageLinesL(TMsvEntry& aEntry, TUid aUid, TBool& aFooterExists, TInt &aFooterSize);
+	TInt CountLinesOfBodyTextL(CMsvEntry& aEntry, TBool& aFooterExists, TInt& aFooterSize);
+	TInt CountLinesOfHtmlL(CMsvEntry& aEntry);	
+	TBool LoadParametersL();
+
+	CExpPop3MailInfo* GetExpPop3MailInfoLC(TInt aIndx);
+	TBool CheckAttachmentsL(TMsvEntry& aRecvEntry, CExpPop3MailInfo& aMailInfo, TMsvEntry& aSentEntry);
+	TBool CompareFilesL(TFileName& aFileName1, TFileName& aFileName2);
+ 	TInt CT_MsgComparePopEmailMsgs::CheckIfServerMessageExists(TPtrC aBodyText);
+
+private:
+	CMsvEntrySelection*					iSentSelectionList;
+	CMsvEntrySelection*					iInboxSelectionList;
+	RPointerArray<CExpPop3MailInfo>		iExpResults;
+	RFs									iFs;
+	};
+	
+#endif //__T_COMPARE_POP_EMAIL_MSGS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_ComparePopSettings.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,69 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+
+#ifndef __T_COMPARE_POP_SETTINGS_H__
+#define __T_COMPARE_POP_SETTINGS_H__
+
+
+
+// User include
+#include "T_MsgSyncStepPop.h"
+
+//Epoc includes
+#include <cemailaccounts.h>
+
+// Forward Declaration
+class CImPop3Settings;
+class CImSmtpSettings;
+class CImIAPPreferences;
+
+// Literals Used
+_LIT(KComparePopSettings,"ComparePopSettings");
+
+
+/**
+Implements a test step to compare the POP and SMTP settings objects
+fora POP account
+*/
+class CT_MsgComparePopSettings : public CT_MsgSyncStepPOP
+	{	
+public:
+	CT_MsgComparePopSettings(CT_MsgSharedDataPop& aSharedDataPOP);
+	~CT_MsgComparePopSettings();
+	
+	// CTestStep implementation
+	TVerdict doTestStepL();
+	
+public:	
+	TVerdict CompareSettings(CImPop3Settings& aPopSettings1, CImPop3Settings& aPopSettings2,
+				CImSmtpSettings& aSmtpSettings1, CImSmtpSettings& aSmtpSettings2,
+				CImIAPPreferences& aPopIapPrefs1, CImIAPPreferences& aPopIapPrefs2,
+				CImIAPPreferences& aSmtpIapPrefs1, CImIAPPreferences& aSmtpIapPrefs2);
+	// This function loads the SMTP and POP settings objects of the specified POP account
+	void LoadAccountSettingsL(CEmailAccounts& aEmailAccount, const TPopAccount& aAccount, CImPop3Settings& aPopSettings, 
+	CImIAPPreferences& aPopIapSettings,CImSmtpSettings& aSmtpSettings, CImIAPPreferences& aSmtpIapSettings);
+	};
+#endif // __T_COMPARE_POP_SETTINGS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_ConnectPop3Server.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,62 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+#ifndef __T_CONNECT_POP3_SERVER_H__
+#define __T_CONNECT_POP3_SERVER_H__
+
+
+// User include
+#include "T_MsgAsyncStepPOP.h"
+
+// Literals Used
+_LIT(KConnectPop3Server,"ConnectPop3Server");
+
+
+/**
+This implements a test step to connect to the POP server
+*/
+class CT_MsgConnectPop3Server : public CT_MsgAsyncStepPOP
+	{
+public:
+	static CT_MsgConnectPop3Server* NewL(CT_MsgSharedDataPop& aSharedDataPOP);
+	~CT_MsgConnectPop3Server();
+
+	//	CTestStep implementation
+	virtual TVerdict doTestStepL();
+
+private:
+	CT_MsgConnectPop3Server(CT_MsgSharedDataPop& aSharedDataPOP);
+
+	//	CT_MsgAsyncStep implementation
+	virtual void	ProgressL(TBool bFinal);
+
+	//	MT_MsgActiveCallback implementation
+	virtual void	CancelStep();
+
+private:
+	CMsvOperation*	iOperation;
+	};
+
+#endif //__T_CONNECT_POP3_SERVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_CopyPopSelection.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,62 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+#ifndef __T_COPY_POP_SELECTION_H__
+#define __T_COPY_POP_SELECTION_H__
+
+
+// User includes
+#include "T_MsgAsyncStepPOP.h"
+#include "T_MsgSharedDataPop.h"
+
+// Literals Used
+_LIT(KCopyPopSelection,"CopyPopSelection");
+
+/**
+Implements a test step to copy entries from the POP account created 
+to the specified target folder
+*/
+class CT_MsgCopyPopSelection  : public CT_MsgAsyncStepPOP
+	{
+public: 
+	static CT_MsgCopyPopSelection* NewL(CT_MsgSharedDataPop& aSharedDataPOP);
+	~CT_MsgCopyPopSelection();
+
+	//	CTestStep implementation
+	virtual TVerdict doTestStepL();
+
+private:
+	CT_MsgCopyPopSelection(CT_MsgSharedDataPop& aSharedDataPOP);
+
+	//	CT_MsgAsyncStep implementation
+	virtual void ProgressL(TBool bFinal);
+
+	//	MT_MsgActiveCallback implementation
+	virtual void CancelStep();
+
+private:
+	CMsvOperation* iOperation;
+	};
+#endif // __T_COPY_POP_SELECTION_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_CreatePopAccount.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,49 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+#ifndef __T_CREATE_POP_ACCOUNT_H__
+#define __T_CREATE_POP_ACCOUNT_H__
+
+
+// User include
+#include "T_MsgSyncStepPop.h"
+
+
+// Literals used
+_LIT(KCreatePopAccount,"CreatePopAccount");
+
+/**
+Implements a test step to create a POP account 
+*/
+class CT_MsgCreatePopAccount : public CT_MsgSyncStepPOP
+	{
+public :
+	CT_MsgCreatePopAccount(CT_MsgSharedDataPop& aSharedDataPOP);
+	~CT_MsgCreatePopAccount();
+	
+	// CTestStep implementation
+	TVerdict doTestStepL();
+	};
+#endif //__T_CREATE_POP_ACCOUNT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_CreatePopAccountWithoutSmtp.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,44 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is the header file for CT_MsgCreatePopAccountWithoutSmtp class
+// 
+//
+
+#ifndef T_CREATE_POP_ACCOUNT_WITHOUT_SMTP_H
+#define T_CREATE_POP_ACCOUNT_WITHOUT_SMTP_H
+
+/* User include */
+#include "T_MsgSyncStepPop.h"
+
+/* Literal used */
+_LIT(KCreatePopAccountWithoutSmtp,"CreatePopAccountWithoutSmtp");
+
+/* Implements a test step to create an POP account reading the settings from a config file */
+class CT_MsgCreatePopAccountWithoutSmtp : public CT_MsgSyncStepPOP
+	{
+public:
+	CT_MsgCreatePopAccountWithoutSmtp(CT_MsgSharedDataPop& aSharedDataPOP);
+
+	/* CTestStep implementation */
+	virtual TVerdict doTestStepL();
+	
+private:
+	TBool ReadIni();
+
+private:
+	TPtrC iPopAccountName;
+	TPtrC iConfigFileName;
+	
+	};
+#endif /* T_CREATE_POP_ACCOUNT_WITHOUT_SMTP_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_DeleteAllPopChildren.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,66 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+#ifndef __T_DELETE_ALL_POP_CHILDREN_H__
+#define __T_DELETE_ALL_POP_CHILDREN_H__
+
+
+// User include
+#include "T_MsgAsyncStepPOP.h"
+
+//	Forward decleration
+class CT_MsgUtilsDeleteAllChildren;
+
+//Literals Used
+_LIT(KDeleteAllPopChildren,"DeleteAllPopChildren");
+
+
+/**
+Implements a test step to delete all the children entries for the remote 
+POP account.
+*/
+class CT_MsgDeleteAllPopChildren : public CT_MsgAsyncStepPOP
+	{
+public:
+	static CT_MsgDeleteAllPopChildren* NewL(CT_MsgSharedDataPop& aSharedDataPOP);
+	~CT_MsgDeleteAllPopChildren();
+
+	//	CTestStep implementation
+	virtual TVerdict	doTestStepL();
+
+private:
+	CT_MsgDeleteAllPopChildren(CT_MsgSharedDataPop& aSharedDataPOP);
+
+	//	CT_MsgAsyncStep implementation
+	virtual void	ProgressL(TBool bFinal);
+
+	//	MT_MsgActiveCallback implementation
+	virtual void	CancelStep();
+
+private:
+	CT_MsgUtilsDeleteAllChildren*	iUtil;
+	};
+
+#endif //__T_DELETE_ALL_POP_CHILDREN_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_DeletePopAccount.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,47 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+#ifndef __T_DELETE_POP_ACCOUNT_H__
+#define __T_DELETE_POP_ACCOUNT_H__
+
+
+// User include
+#include "T_MsgSyncStepPop.h"
+
+// Literals Used
+_LIT(KDeletePopAccount,"DeletePopAccount");
+
+
+// This implements a test step to delete the pop account mentioned or to delete all the pop accounts
+class CT_MsgDeletePopAccount : public CT_MsgSyncStepPOP
+	{
+public :
+	CT_MsgDeletePopAccount(CT_MsgSharedDataPop& aSharedDataPOP);
+	~CT_MsgDeletePopAccount();
+	
+	// CTestStep implementation
+	TVerdict doTestStepL();	
+	};
+#endif //__T_DELETE_POP_ACCOUNT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_DisConnectPop3Server.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,62 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+#ifndef __T_DIS_CONNECT_POP3_SERVER_H__
+#define __T_DIS_CONNECT_POP3_SERVER_H__
+
+// User includes
+#include"T_MsgAsyncStepPOP.h"
+#include "T_MsgSharedDataPop.h"
+
+
+// Literals Used
+_LIT(KDisConnectPop3Server,"DisConnectPop3Server");
+
+/**
+Implements a test step to disconnect from the POP server
+*/
+class CT_MsgDisConnectPop3Server : public CT_MsgAsyncStepPOP
+	{
+public:
+	static CT_MsgDisConnectPop3Server* NewL(CT_MsgSharedDataPop& aSharedDataPOP);
+	~CT_MsgDisConnectPop3Server();
+
+	//	CTestStep implementation
+	virtual TVerdict	doTestStepL();
+
+private:
+	CT_MsgDisConnectPop3Server(CT_MsgSharedDataPop& aSharedDataPOP);
+
+	//	CT_MsgAsyncStep implementation
+	virtual void	ProgressL(TBool bFinal);
+
+	//	MT_MsgActiveCallback implementation
+	virtual void	CancelStep();
+
+private:
+	CMsvOperation*	iOperation;
+	};
+
+#endif //__T_DIS_CONNECT_POP3_SERVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_ModifyPopSettings.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,50 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+#ifndef __T_MODIFY_POP_SETTINGS_H__
+#define __T_MODIFY_POP_SETTINGS_H__
+
+
+// User include
+#include "T_MsgSyncStepPop.h"
+
+// Literals Used
+_LIT(KModifyPopSettings,"ModifyPopSettings");
+
+
+/**
+Implements a test step to modify the settings of a POP account
+by reading from the config file specified
+*/
+class CT_MsgModifyPopSettings : public CT_MsgSyncStepPOP
+	{
+public :
+	CT_MsgModifyPopSettings(CT_MsgSharedDataPop& aSharedDataPOP);
+	~CT_MsgModifyPopSettings();
+	
+	// CTestStep implementation
+	TVerdict doTestStepL();
+	};
+#endif //__T_MODIFY_POP_SETTINGS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_ModifyPopSettings2.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,39 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is the header file for CT_MsgModifyPopSettings2 class
+// 
+//
+
+#ifndef T_MODIFY_POP_SETTINGS_2_H
+#define T_MODIFY_POP_SETTINGS_2_H
+
+/* User include */
+#include "T_MsgSyncStepPop.h"
+
+/* Literal used */
+_LIT(KModifyPopSettings2,"ModifyPopSettings2");
+
+/* Implements a test step that modifies the settings of the specified Pop account
+   via the given config file */
+class CT_MsgModifyPopSettings2 : public CT_MsgSyncStepPOP
+	{
+public :
+	CT_MsgModifyPopSettings2(CT_MsgSharedDataPop& aSharedDataPOP);
+
+	~CT_MsgModifyPopSettings2();
+
+	/* CTestStep implementation */
+	TVerdict doTestStepL();
+	};
+#endif /* T_MODIFY_POP_SETTINGS_2_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_MsgAsyncStepPOP.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,52 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* References POP shared data for use by derived test steps.
+* 
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+#ifndef __T_MSG_ASYNCSTEPPOP_H__
+#define __T_MSG_ASYNCSTEPPOP_H__
+
+//user includes
+#include "T_MsgAsyncStep.h"
+#include "T_MsgSharedDataPop.h"
+
+
+/**
+Base class for the asynchronous POP test steps
+*/
+class CT_MsgAsyncStepPOP : public CT_MsgAsyncStep
+	{
+protected:
+	CT_MsgAsyncStepPOP(CT_MsgSharedDataPop& iSharedDataPop);
+
+	//	MT_MsgActiveCallback implementation
+//	virtual void RunL() =0;
+//	virtual void DoCancel() =0;
+
+protected:
+	CT_MsgSharedDataPop& iSharedDataPOP;
+	};
+
+#endif // __T_MSG_ASYNCSTEPPOP_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_MsgSharedDataPop.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,61 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+
+#ifndef __T_MSG_SHARED_DATA_POP_H__
+#define __T_MSG_SHARED_DATA_POP_H__
+
+// Epoc include
+#include <mtclbase.h>
+
+// User includes
+#include "T_MsgSharedDataBase.h"
+
+/**
+This implements a class which creates a pointer to the POP MTM object
+*/
+class CT_MsgSharedDataPop : public CT_MsgSharedDataBase
+	{
+public:
+	static CT_MsgSharedDataPop* NewL();
+	~CT_MsgSharedDataPop();
+
+protected:
+	virtual CBaseMtm*	NewMtmL();
+
+private:
+	void ConstructL();
+	CT_MsgSharedDataPop();
+
+public:
+	CPeriodic* 	iPeriodic;
+ 	TInt  		iMaxRamValue;
+ 	TInt  		iMinRamValue;
+ 	TInt  		iStartRamValue;
+ 	TInt  		iEndRamValue;
+ 	TBool 		iMark;
+	};
+
+#endif // __T_MSG_SHARED_DATA_Pop_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_MsgSyncStepPop.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,51 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Sync step class owning POP shared data for use by derived test steps.
+* 
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+#ifndef __T_MSG_SYNC_STEP_POP_H__
+#define __T_MSG_SYNC_STEP_POP_H__
+
+//user includes
+#include "T_MsgStep.h"
+#include "T_MsgSharedDataPop.h"
+
+/**
+Base class for synchronous POP teststeps.
+*/
+class CT_MsgSyncStepPOP : public CT_MsgStep
+	{
+protected:
+	CT_MsgSyncStepPOP(CT_MsgSharedDataPop& iSharedDataPop);
+	virtual ~CT_MsgSyncStepPOP();
+
+private:
+	CT_MsgSyncStepPOP(); //Force iSharedData to be set correctly.
+
+protected:
+	CT_MsgSharedDataPop& iSharedDataPOP;
+	};
+
+#endif // __T_MSG_SYNC_STEP_POP_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_PopInvokeAsyncFunction.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,72 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+#ifndef __T_POP_INVOKE_ASYNC_FUNCTION_H__
+#define __T_POP_INVOKE_ASYNC_FUNCTION_H__
+
+// User includes
+#include "T_MsgAsyncStepPOP.h"
+#include "T_MsgSharedDataPop.h"
+
+
+// Epoc includes
+#include <pop3set.h>
+
+// Forward Declaration
+class CMsvOperation;
+class CT_MsgPopServer;
+
+// Literals Used
+_LIT(KPopInvokeAsyncFunction,"PopInvokeAsyncFunction");
+
+
+/**
+Implements a test step to populate the messages from the POP server
+*/
+class CT_MsgPopInvokeAsyncFunction : public CT_MsgAsyncStepPOP
+	{
+public:
+	static CT_MsgPopInvokeAsyncFunction* NewL(CT_MsgSharedDataPop& aSharedDataPOP);
+	~CT_MsgPopInvokeAsyncFunction();
+
+	//	CTestStep implementation
+	virtual TVerdict doTestStepL();
+
+private:
+	CT_MsgPopInvokeAsyncFunction(CT_MsgSharedDataPop& aSharedDataPOP);
+
+	//	CT_MsgAsyncStep implementation
+	virtual void ProgressL(TBool bFinal);
+
+	//	MT_MsgActiveCallback implementation
+	virtual void	CancelStep();
+
+private:
+	// For the async operation
+	CMsvOperation* iOperation;
+	// For the mail populate options
+	TImPop3PopulateOptions iMailInfo;
+	};
+#endif //__T_POP_INVOKE_ASYNC_FUNCTION_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_PopServer.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,57 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+#ifndef __T_POP_SERVER_H__
+#define __T_POP_SERVER_H__
+
+// User defined classes
+#include "T_MsgServer.h"
+#include "T_MsgSharedDataPop.h"
+
+
+//Literals Used
+_LIT(KPopServer,"T_MsgPopServer");
+
+
+/**
+POP test server which creates and executes the teststeps.
+*/
+class CT_MsgPopServer : public CT_MsgServer
+	{
+public :
+	static CT_MsgPopServer* NewL();
+
+private:
+	CT_MsgPopServer();
+
+	virtual CTestStep*				CreateTestStepL(const TDesC& aStepName);
+
+	// Creates an object of Shared Data
+	virtual CT_MsgSharedDataBase* NewSharedDataL();
+
+public:
+	CT_MsgSharedDataPop* iSharedDataPOP;
+	};
+#endif //__T_POP_SERVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_RemovePopSNAPSetting.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,44 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is the header file for CT_MsgRemovePopSNAPSetting class
+// 
+//
+
+#ifndef T_REMOVE_POP_SNAP_SETTING_H
+#define T_REMOVE_POP_SNAP_SETTING_H
+
+/* User include */
+#include "T_MsgSyncStepPop.h"
+
+/* Literal used */
+_LIT(KRemovePopSNAPSetting,"RemovePopSNAPSetting");
+
+/* Implements a test step to remove the POP SNAP information for the account */
+class CT_MsgRemovePopSNAPSetting : public CT_MsgSyncStepPOP
+	{
+public:	
+	CT_MsgRemovePopSNAPSetting(CT_MsgSharedDataPop& aSharedDataPOP);
+	
+	/* CTestStep implementation */
+	virtual TVerdict doTestStepL();
+	
+private:
+	TBool ReadIni();
+	
+private:
+	TPtrC iPopAccountName;
+	
+	};
+	
+#endif /* T_REMOVE_POP_SNAP_SETTING_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_SharedDataPop.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,52 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+
+#ifndef __T_SHARED_DATA_POP_H__
+#define __T_SHARED_DATA_POP_H__
+
+// Epoc include
+#include <mtclbase.h>
+
+// User includes
+#include "t_msgshareddatabase.h"
+
+
+/**
+This implements a class which creates a pointer to the POP MTM object
+*/
+class CT_MsgSharedDataPop : public CT_MsgSharedDataBase
+	{
+public:
+	static CT_MsgSharedDataPop* NewL();
+
+protected:
+	virtual CBaseMtm*	NewMtmL();
+
+private:
+	CT_MsgSharedDataPop();
+	};
+
+#endif // __T_SHARED_DATA_POP_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_StartRamUsageTimer.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* @file 
+* This is the header file for CT_StartRamUsageTimer
+* 
+*
+*/
+
+
+
+
+
+
+
+#ifndef _T_START_RAM_USAGE_TIMER_
+#define _T_START_RAM_USAGE_TIMER_
+
+
+// User includes 
+#include "T_MsgAsyncStepPOP.h"
+
+// Literals used 
+_LIT(KStartRamUsageTimer,"StartRamUsageTimer");
+
+/**
+Implement a wrapper class over HAL APIs and 
+setting the periodic Timer to monitor the RAM usage
+ */
+class CT_StartRamUsageTimer : public CT_MsgAsyncStepPOP
+	{
+public:
+	CT_StartRamUsageTimer(CT_MsgSharedDataPop& aSharedDataPOP);	
+	~CT_StartRamUsageTimer();
+
+	static TInt RamUsage(TAny* aObject);
+	void DoRamUsage();
+
+private:
+     void ProgressL(TBool aFinal);
+     void CancelStep();
+     
+	// CTestStep implementation 
+	virtual TVerdict	doTestStepL();	
+	};
+
+
+#endif // _T_START_RAM_USAGE_TIMER_ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_StopRamUsageTimer.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* @file 
+* This is the header file for CT_StopRamUsageTimer
+* 
+*
+*/
+
+
+
+
+
+
+
+#ifndef _T_STOP_RAM_USAGE_TIMER_
+#define _T_STOP_RAM_USAGE_TIMER_
+
+
+// User includes 
+#include "T_MsgAsyncStepPOP.h"
+
+// Literals used 
+_LIT(KStopRamUsageTimer,"StopRamUsageTimer");
+
+// Implement a test step to stop the periodic Timer 
+class CT_StopRamUsageTimer :public CT_MsgAsyncStepPOP
+	{
+public:
+	CT_StopRamUsageTimer(CT_MsgSharedDataPop& aSharedDataPOP);
+	~CT_StopRamUsageTimer();
+private:
+     void ProgressL(TBool aFinal);
+     void CancelStep();
+     
+	// CTestStep implementation 
+	virtual TVerdict	doTestStepL();	
+	};
+
+
+#endif // _T_STOP_RAM_USAGE_TIMER_ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_VerfiyPopSettings.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,50 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+#ifndef __T_VERIFY_POP_SETTINGS_H__
+#define __T_VERIFY_POP_SETTINGS_H__
+
+
+// User include
+#include "T_MsgSyncStepPop.h"
+
+// Literals used
+_LIT(KVerifyPopSettings,"VerifyPopSettings");
+
+
+/**
+Implements a test step that verifies the settings of an POP account
+created with the default settings
+*/
+class CT_MsgVerifyPopSettings : public CT_MsgSyncStepPOP
+	{
+public :
+	CT_MsgVerifyPopSettings(CT_MsgSharedDataPop& aSharedDataPOP);
+	~CT_MsgVerifyPopSettings();
+	
+	// CTestStep implementation
+	TVerdict doTestStepL();
+	};
+#endif //__T_VERIFY_POP_SETTINGS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/inc/T_VerifyPopAccountsCount.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,49 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+#ifndef __T_VERIFY_POP_ACCOUNTS_COUNT_H__
+#define __T_VERIFY_POP_ACCOUNTS_COUNT_H__
+
+
+// User include
+#include "T_MsgSyncStepPop.h"
+
+// Literals Used
+_LIT(KVerifyPopAccountsCount,"VerifyPopAccountsCount");
+
+
+/**
+This class Implements a test step to verify the count of the Pop accounts created
+*/
+class CT_MsgVerifyPopAccountsCount: public CT_MsgSyncStepPOP
+	{
+public :
+	CT_MsgVerifyPopAccountsCount(CT_MsgSharedDataPop& aSharedDataPOP);
+	~CT_MsgVerifyPopAccountsCount();
+	
+	// CTestStep implementation
+	TVerdict doTestStepL();
+	};
+#endif //__T_VERIFY_POP_ACCOUNTS_COUNT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/scripts/plainbody/setup_smoketest_email.script	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,30 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+RUN_UTILS MkDir			c:\smoketest\
+RUN_UTILS MkDir 		c:\smoketest\EmailMessage\
+RUN_UTILS MkDir 		c:\smoketest\emailsettings\
+
+RUN_UTILS CopyFile 		z:\smoketest\smoketest_email.ini	c:\smoketest\smoketest_email.ini
+RUN_UTILS MakeReadWrite	c:\smoketest\smoketest_email.ini
+RUN_UTILS CopyFile 		z:\smoketest\EmailMessage\20KBody.txt	c:\smoketest\EmailMessage\20KBody.txt
+RUN_UTILS MakeReadWrite c:\smoketest\EmailMessage\20KBody.txt
+RUN_UTILS CopyFile 		z:\smoketest\emailsettings\popsettings_test908.txt	c:\smoketest\emailsettings\popsettings_test908.txt
+RUN_UTILS MakeReadWrite c:\smoketest\emailsettings\popsettings_test908.txt
+RUN_UTILS CopyFile 		z:\smoketest\MachineName.txt	c:\smoketest\MachineName.txt
+RUN_UTILS MakeReadWrite c:\smoketest\MachineName.txt
+RUN_UTILS CopyFile 		z:\smoketest\smoketest_email.script	c:\smoketest\smoketest_email.script
+RUN_UTILS MakeReadWrite	c:\smoketest\smoketest_email.script
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/scripts/plainbody/smoketest_email.script	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,39 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRINT Run Email smoketest
+
+LOAD_SUITE		T_MsgPopServer		-SharedData
+LOAD_SUITE		T_MsgSmtpServer 	-SharedData
+DELAY 1000
+
+START_TESTCASE			SMOKE_EMAIL_0001
+//!	@SYMTestCaseID		SMOKE_EMAIL_0001
+//!	@SYMTestCaseDesc	Create a new email message with 20KB plain body text
+
+PRINT Setup Begins #####################################################
+
+RUN_TEST_STEP 1000 T_MsgPopServer	StartUp
+RUN_TEST_STEP 1000 T_MsgSmtpServer	StartUp
+
+RUN_TEST_STEP 1000 T_MsgPopServer	CreatePopAccount		c:\smoketest\smoketest_email.ini 		0001-CreatePopAccount
+RUN_TEST_STEP 1000 T_MsgSmtpServer	SmtpCreateNewMessageWithPlainBodyText c:\smoketest\smoketest_email.ini 		0001-SmtpCreateNewMessageWithPlainBodyText
+
+RUN_TEST_STEP 1000 T_MsgSmtpServer	ShutDown
+RUN_TEST_STEP 1000 T_MsgPopServer	ShutDown
+
+PRINT Execute Completed ################################################
+END_TESTCASE			SMOKE_EMAIL_0001
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_CheckChildrenCountPop.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,138 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// CheckChildrenCountPop
+// [Paramaters]
+// PopAccountName			:		Name of the Pop account
+// ExpectedChildrenCount	:		Expected number of children to be present in the
+// folder
+// Obtains a selection of the children entries under the Pop account and obtains its count.
+// Checks if children count is as expected. If the count does not match, the test step
+// fails.
+// [APIs Used]
+// CMsvEntry::SetEntryL
+// CMsvEntry::ChildrenL
+// CMsvEntry::SetSortTypeL
+// TMsvSelectionOrdering::SetShowInvisibleEntries
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+
+// User includes
+#include "T_CheckChildrenCountPop.h"
+#include <t_utils.h>
+#include <t_utilscentralrepository.h>
+
+
+//epoc includes
+#include <msvids.h>
+
+
+// Literals used
+_LIT(KPopAccountName,"PopAccountName");
+_LIT(KExpCount,"Expectedcount");
+
+
+/**
+CT_MsgCheckChildrenCountPop()
+Sets the teststep name to KCheckChildrenCountPop
+
+@param aSharedDataPOP
+Data shared across the POP test steps. Ex. Session
+*/
+CT_MsgCheckChildrenCountPop::CT_MsgCheckChildrenCountPop(CT_MsgSharedDataPop& aSharedDataPOP)
+:	CT_MsgSyncStepPOP(aSharedDataPOP)
+	{
+	SetTestStepName(KCheckChildrenCountPop);
+	}
+
+
+/**
+~CT_MsgCheckChildrenCountPop()
+Destructor
+*/
+CT_MsgCheckChildrenCountPop::~CT_MsgCheckChildrenCountPop()
+	{
+	}
+
+	
+/**
+doTestStepL()
+Reads the remote foldername and the expected count from the ini file.
+Obtains the count of the children entries under the given folder.
+Verifies whether the expected count read from the ini file 
+matches with the actual count.Fails if the count does not match
+
+@return
+Returns the test step result
+*/
+TVerdict CT_MsgCheckChildrenCountPop::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test Step :CheckChildrenCountPop "));
+
+	// Read the POP account name from the ini file
+	TPtrC	popAccountName;
+	if(!GetStringFromConfig(ConfigSection(), KPopAccountName, popAccountName))
+		{
+		ERR_PRINTF1(_L("POP account name is not specified"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		// Retrieving the POP service Id based on the account name read from ini
+		TMsvId popServiceId = CT_MsgUtilsCentralRepository::GetPopServiceIdL((TDes&) popAccountName);
+		if(popServiceId == KMsvNullIndexEntryId)
+			{
+			ERR_PRINTF1(_L("Invalid Pop account name specified"));
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			TInt expectedChildrenCount;			
+			// Read the expected children count from ini file
+			if(!GetIntFromConfig(ConfigSection(), KExpCount, expectedChildrenCount))
+				{
+				ERR_PRINTF1(_L("Expected number of children in the POP account not specified"));
+				SetTestStepResult(EFail);
+				}
+			else
+				{
+				// Create a selection of the children entries under the given folder and verify the count
+				CMsvEntrySelection* childrenSelection = 
+				CT_MsgUtils::CreateChildrenSelectionL(iSharedDataPOP.iSession, popServiceId);
+				CleanupStack::PushL(childrenSelection);
+		
+				TInt actualCount = childrenSelection->Count();
+
+				if (expectedChildrenCount != actualCount)
+					{
+					ERR_PRINTF3(_L("Children count is not equal to expected count, expected : %d, actual: %d "),expectedChildrenCount, actualCount);
+					SetTestStepResult(EFail);
+					}
+				else
+					{
+					INFO_PRINTF3(_L("Children count is equal to expected count, expected : %d, actual: %d "),expectedChildrenCount, actualCount);
+					}
+				CleanupStack::PopAndDestroy(childrenSelection);
+				}
+			}
+		}
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_CheckPop3AccessPoint.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,135 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// CheckPop3AccessPoint
+// [Paramaters]
+// PopAccountName : Name of the Pop account
+// ConfigFileName: Configuration file name to read for account settings
+// [TestStep Description]
+// Checks what access point is being used by an POP account connection
+// 
+//
+
+#include "T_CheckPop3AccessPoint.h"
+
+#include <t_utilsreademailsettingsfromconfigfile.h>
+#include <t_utilscentralrepository.h>
+#include <pop3set.h>
+#include <iapprefs.h>
+
+/* Literals Used */
+_LIT(KAccountName,"PopAccountName");
+_LIT(KConfigFileName, "PopConfigFileName");
+
+/**
+	Function : CT_MsgCheckPop3AccessPoint
+	Description : Constructor
+	@param : aSharedDataPOP		Reference to CT_MsgSharedDataPop
+	@return : N/A
+*/
+CT_MsgCheckPop3AccessPoint::CT_MsgCheckPop3AccessPoint(CT_MsgSharedDataPop& aSharedDataPOP)
+:	CT_MsgSyncStepPOP(aSharedDataPOP)
+	{
+	SetTestStepName(KCheckPop3AccessPoint);
+	}
+
+/**
+	Function : ~CT_MsgCheckPop3AccessPoint
+	Description : Destructor
+	@return : N/A
+*/
+CT_MsgCheckPop3AccessPoint::~CT_MsgCheckPop3AccessPoint()
+	{
+	}
+
+/**
+	Function : doTestStepL
+	Description : 
+	@return : TVerdict - Test step result
+	@leave : KMsvNullIndexEntryId	Invalid POP account name specified
+*/
+TVerdict CT_MsgCheckPop3AccessPoint::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test Step : CheckPop3AccessPoint"));
+
+	TPtrC	accountName;
+	if(!GetStringFromConfig(ConfigSection(), KAccountName, accountName))
+		{
+		ERR_PRINTF1(_L("Pop Account name not specified"));
+		SetTestStepResult(EFail);
+		return TestStepResult();
+		}
+
+	TPtrC	configFileName;
+	if(!GetStringFromConfig(ConfigSection(), KConfigFileName, configFileName))
+		{
+		ERR_PRINTF1(_L("Configuration file path is not specified"));
+		SetTestStepResult(EFail);
+		return TestStepResult();
+		}
+
+	CImIAPPreferences* popPrefs = CImIAPPreferences::NewLC();
+	CImPop3Settings* popSettings = new (ELeave) CImPop3Settings;
+	CleanupStack::PushL(popSettings);
+
+	TInt expectedAccessPoint = 0;
+
+	if(configFileName.CompareF( _L("none") ) != 0 )
+		{
+		TRAPD(err, CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadPopSettingsFromConfigurationFileL(configFileName, *popSettings, *popPrefs));
+		if(err)
+			{
+			ERR_PRINTF2(_L("Failure while setting the POP setting parameters, failed with error %d"), err);
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			if (popPrefs->NumberOfIAPs() > 0)
+				{
+				TImIAPChoice iapChoice = popPrefs->IAPPreference(0);
+				expectedAccessPoint = iapChoice.iIAP;
+				}
+			}
+		}
+
+	CleanupStack::PopAndDestroy(2, popPrefs);
+
+	if (TestStepResult() == EPass)
+		{
+		TMsvId serviceId = CT_MsgUtilsCentralRepository::GetPopServiceIdL((TDes&)accountName);
+
+		TUint32 accessPoint;
+		TInt err = iSharedDataPOP.iSession->ServiceAccessPointId(serviceId, accessPoint);
+		
+		if (err == KErrNone)
+			{
+			if (accessPoint == expectedAccessPoint)
+				{
+				INFO_PRINTF1(_L("Access points match"));
+				}
+			else
+				{
+				ERR_PRINTF3(_L("Access point %d does not match expected %d"), accessPoint, expectedAccessPoint);
+				SetTestStepResult(EFail);
+				}
+			}
+		else
+			{
+			ERR_PRINTF2(_L("Failure getting access point - %d"), err);
+			SetTestStepResult(EFail);
+			}
+		}
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_CheckPopBMSetting.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,111 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// CheckPopBMSetting
+// [Paramaters]
+// PopAccountName			:Name of the Pop account.
+// ExpectedBMSupport		:ETrue => Bearer mobility is expected to be supported by the POP service.
+// EFalse => Bearer mobility is not expected to be supported by the POP service.
+// Checks if bearer mobility is supported by the POP service.
+// 
+//
+
+//User includes
+#include "T_CheckPopBMSetting.h"
+#include <t_utils.h>
+#include <t_utilsenumconverter.h>
+#include <t_utilscentralrepository.h>
+
+//Epoc include
+#include <iapprefs.h>
+
+//Literals used
+_LIT(KPopAccountName,"PopAccountName");
+_LIT(KExpectedBMSupport,"ExpectedBMSupport");
+
+/**
+  Function : CT_MsgCheckPopBMSetting
+  Description : Constructor 
+  @param : aSharedDataPOP Reference to CT_MsgSharedDataPop
+  @return : N/A
+*/
+CT_MsgCheckPopBMSetting::CT_MsgCheckPopBMSetting(CT_MsgSharedDataPop& aSharedDataPOP)
+:CT_MsgSyncStepPOP(aSharedDataPOP)
+	{
+	SetTestStepName(KCheckPopBMSetting);
+	}
+	
+/**
+  Function : ReadIni
+  Description :Reads the corresponding .ini file and returns EPass or EFail if any of the inputs are missing
+  @return : TBool
+*/
+TBool CT_MsgCheckPopBMSetting::ReadIni()
+	{
+	TBool result = ETrue;
+	
+	if(!GetStringFromConfig(ConfigSection(), KPopAccountName, iPopAccountName))
+		{
+		ERR_PRINTF1(_L("Pop account name is not specified"));
+		SetTestStepResult(EFail);
+		result = EFalse;
+		}
+		
+	if(!GetBoolFromConfig(ConfigSection(), KExpectedBMSupport, iExpectedBMSupport))
+		{
+		ERR_PRINTF1(_L("An expected \"ETrue\" or \"EFalse\" boolean value is not specified for BM support"));
+		SetTestStepResult(EFail);
+		result = EFalse;
+		}
+	
+	return result;
+	}
+
+/**
+  Function : doTestStepL
+  Description : Checks the provisioned BM support for the POP account settings of a test case.
+  @return : TVerdict - Test step result
+*/		
+TVerdict CT_MsgCheckPopBMSetting::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test Step : CheckPopBMSetting"));
+	if(ReadIni())
+		{
+		CEmailAccounts* accounts = CEmailAccounts::NewL();
+		CleanupStack::PushL(accounts);
+		
+		CImPop3Settings* popSettings = new(ELeave) CImPop3Settings();
+		CleanupStack::PushL(popSettings);
+					
+		TPopAccount popAccountId;
+		CT_MsgUtilsCentralRepository::GetPopAccountL((TDes&)iPopAccountName, popAccountId);
+				
+		accounts->LoadPopSettingsL(popAccountId, *popSettings);
+		
+		TBool actualBMSupport = popSettings->BearerMobility();
+		
+		if (actualBMSupport == iExpectedBMSupport)
+			{
+			INFO_PRINTF3(_L("Actual Bearer Mobility Support [%d] does equals Expected Bearer Mobility Support [%d]"),actualBMSupport,iExpectedBMSupport);
+			}
+		else
+			{
+			ERR_PRINTF3(_L("Actual Bearer Mobility Support [%d] does not equal Expected Bearer Mobility Support [%d]"),actualBMSupport,iExpectedBMSupport);
+			SetTestStepResult(EFail);
+			}
+	
+		CleanupStack::PopAndDestroy(2,accounts); // popSettings, accounts
+		}
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_CheckPopSNAPSetting.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,134 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// CheckPopSNAPSetting
+// [Paramaters]
+// PopAccountName			:Name of the Pop account.
+// ExpectedSNAPDefinition	:ETrue => A SNAP has expected to been provisioned for the POP account.
+// EFalse => A SNAP has not expected to been provisioned for the POP account.
+// ExpectedSNAPPreference	:Expected SNAP ID (Assuming the SNAP has been defined for the POP a/c)
+// This parameter can be ignored if the "ExpectedSNAPDefinition" is EFalse.
+// Checks the provisioned SNAP information for the POP account.
+// 
+//
+
+//User includes
+#include "T_CheckPopSNAPSetting.h"
+#include <t_utils.h>
+#include <t_utilsenumconverter.h>
+#include <t_utilscentralrepository.h>
+
+//Epoc include
+#include <iapprefs.h>
+
+//Literals used
+_LIT(KPopAccountName,"PopAccountName");
+_LIT(KSNAPDefined,"ExpectedSNAPDefinition");
+_LIT(KSNAPPreference,"ExpectedSNAPPreference");
+
+/**
+  Function : CT_MsgCheckPopSNAPSetting
+  Description : Constructor 
+  @param : aSharedDataPOP Reference to CT_MsgSharedDataPop
+  @return : N/A
+*/
+CT_MsgCheckPopSNAPSetting::CT_MsgCheckPopSNAPSetting(CT_MsgSharedDataPop& aSharedDataPOP)
+:CT_MsgSyncStepPOP(aSharedDataPOP)
+	{
+	SetTestStepName(KCheckPopSNAPSetting);
+	}
+	
+/**
+  Function : ReadIni
+  Description :Reads the corresponding .ini file and returns EPass or EFail if any of the inputs are missing
+  @return : TBool
+*/
+TBool CT_MsgCheckPopSNAPSetting::ReadIni()
+	{
+	TBool result = ETrue;
+	
+	if(!GetStringFromConfig(ConfigSection(), KPopAccountName, iPopAccountName))
+		{
+		ERR_PRINTF1(_L("Pop account name is not specified"));
+		SetTestStepResult(EFail);
+		result = EFalse;
+		}
+		
+	if(!GetBoolFromConfig(ConfigSection(), KSNAPDefined, iExpectedSNAPDefinition))
+		{
+		ERR_PRINTF1(_L("An expected \"ETrue\" or \"EFalse\" boolean value is not specified for the SNAP definition"));
+		SetTestStepResult(EFail);
+		result = EFalse;
+		}
+	
+	return result;
+	}
+
+/**
+  Function : doTestStepL
+  Description : Checks the provisioned SNAP information for the POP account settings of a test case.
+  @return : TVerdict - Test step result
+*/		
+TVerdict CT_MsgCheckPopSNAPSetting::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test Step : CheckPopSNAPSetting"));
+	if(ReadIni())
+		{
+		CEmailAccounts* accounts = CEmailAccounts::NewL();
+		CleanupStack::PushL(accounts);
+		
+		CImIAPPreferences* popIapPrefs = CImIAPPreferences::NewLC();
+					
+		TPopAccount popAccountId;
+		CT_MsgUtilsCentralRepository::GetPopAccountL((TDes&)iPopAccountName,popAccountId);
+				
+		accounts->LoadPopIapSettingsL(popAccountId, *popIapPrefs);	
+		
+		TBool actualSNAPDefintion = popIapPrefs->SNAPDefined();
+		
+		if (actualSNAPDefintion == iExpectedSNAPDefinition)
+			{
+			if (actualSNAPDefintion)
+				{
+				TInt expectedSNAPPreference = 0;
+				if(!GetIntFromConfig(ConfigSection(), KSNAPPreference, expectedSNAPPreference))
+					{
+					ERR_PRINTF1(_L("An expected SNAP ID value is not specified"));
+					SetTestStepResult(EFail);
+					CleanupStack::PopAndDestroy(2,accounts); // popIapPrefs, accounts
+					return TestStepResult();
+					}
+				TInt actualSNAPPreference = popIapPrefs->SNAPPreference();
+				
+				if (actualSNAPPreference != expectedSNAPPreference)
+					{
+					ERR_PRINTF3(_L("Actual SNAP ID [%d] does not equal Expected SNAP ID [%d]"),actualSNAPPreference,expectedSNAPPreference);
+					SetTestStepResult(EFail);
+					}
+				else
+					{
+					INFO_PRINTF3(_L("Actual SNAP ID [%d] equals Expected SNAP ID [%d]"),actualSNAPPreference,expectedSNAPPreference);
+					}
+				}
+			}
+		else
+			{
+			ERR_PRINTF3(_L("Actual SNAP Defintion [%d] does not equal Expected SNAP Defintion [%d]"),actualSNAPDefintion,iExpectedSNAPDefinition);
+			SetTestStepResult(EFail);
+			}
+	
+		CleanupStack::PopAndDestroy(2,accounts); // popIapPrefs, accounts
+		}
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_ComparePopEmailMsgs.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,999 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// ComparePopEmailMsgs
+// [Paramaters]
+// PopAccountName		: 		Name of the POP account
+// Compares the recieved mails with the expected numbers of lines to test POP3 TOP command
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+// User includes
+#include "CExpMailInfo.h"
+#include "T_ComparePopEmailMsgs.h"
+#include <t_utils.h>
+#include <t_utilscentralrepository.h>
+#include <t_utilsenumconverter.h>
+
+
+// Epoc includes
+#include <imcm.rsg>
+#include <miutmsg.h>
+#include <mmsvattachmentmanager.h>
+
+
+// Literals Used
+_LIT(KPopAccountName,"PopAccountName");
+
+
+/**
+ConstructL()
+Used to ensure that MMsvAttachmentManager is not destroyed until we want it to be.
+To do this we need to preserve certain objects of CImEmailMessage, which if disappeared
+would invalidate MMsvAttachmentManager. But this should be deleted in a controlled manner.
+
+@param aSession
+An object of type CMsvSession object.
+
+@param aEntry
+An object of type TMsvEntry used to get the entry ID. 
+*/
+void CAttachmentItem::ConstructL(CMsvSession& aSession, TMsvEntry aEntry)
+	{
+	iMsvEntry = aSession.GetEntryL(aEntry.Id());
+
+	iMsvEntry->SetEntryL(aEntry.Id());
+	iEmailMsg = CImEmailMessage::NewL(*iMsvEntry);
+		
+	CMsvOperationActiveSchedulerWait* waiter = CMsvOperationActiveSchedulerWait::NewLC();
+ 	iEmailMsg->GetAttachmentsListL(waiter->iStatus, aEntry.Id(),
+								   CImEmailMessage::EAllAttachments, 
+								   CImEmailMessage::EThisMessageOnly);
+	waiter->Start();
+
+	CleanupStack::PopAndDestroy(1, waiter); //waiter		
+	}
+
+
+/**
+NewL()
+Allocates and creates a new CAttachmentItem object
+
+@param aSession
+An object of type CMsvSession object.
+
+@param aEntry
+An object of type TMsvEntry
+
+@leave KErrNoMemory
+
+@return 
+A pointer to an object of type CAttachmentItem
+
+*/
+CAttachmentItem* CAttachmentItem::NewL(CMsvSession& aSession, TMsvEntry aEntry)
+	{
+	CAttachmentItem* self=CAttachmentItem::NewLC(aSession, aEntry);
+	CleanupStack::Pop(self);
+
+	return self;
+	}
+
+
+/**
+NewLC()
+Static factory constructor. Uses two phase construction and leaves nothing on the CleanupStack.
+
+
+@param aSession
+An object of type CMsvSession object.
+
+@param aEntry
+An object of type TMsvEntry
+
+@leave KErrNoMemory
+@return
+A pointer to the newly created CAttachmentItem object.
+
+*/
+CAttachmentItem* CAttachmentItem::NewLC(CMsvSession& aSession, TMsvEntry aEntry)
+	{
+	CAttachmentItem* self=new (ELeave) CAttachmentItem;
+	CleanupStack::PushL(self);
+	
+	self->ConstructL(aSession, aEntry);
+	
+	return self;
+	}
+
+
+/**
+~CAttachmentItem()
+Destroy the data members.
+*/
+CAttachmentItem::~CAttachmentItem()
+	{
+	delete iEmailMsg;
+	iEmailMsg=NULL;
+
+	delete iMsvEntry;
+	iMsvEntry=NULL;
+	}
+
+
+/**
+MMsvAttachmentManager()
+
+@return
+An object of MMsvAttachmentManager
+*/
+MMsvAttachmentManager& CAttachmentItem::MMsvAttachmentManager() const
+	{			
+	return (iEmailMsg->AttachmentManager());		
+	}
+
+
+/**
+GetExpPop3MailInfoLC()
+Sets the CExpPop3MailInfo attributes reading from the INI file
+
+@param  aIndx
+Index in the selection list.
+
+@leave KErrNotReady
+
+@return
+A pointer to an object of type CExpPop3MailInfo
+*/
+CExpPop3MailInfo* CT_MsgComparePopEmailMsgs::GetExpPop3MailInfoLC(TInt aIndx)
+	{
+	CExpPop3MailInfo* expMailInfo  = new (ELeave) CExpPop3MailInfo;
+	CleanupStack::PushL(expMailInfo);
+	
+	TInt comInt = -1;
+	_LIT(KNumOfLines,"NumOfLines%d");
+	TBuf<256> param;
+	param.Format(KNumOfLines,aIndx);
+	
+	if (!GetIntFromConfig(ConfigSection(), param, comInt))
+		{
+		ERR_PRINTF1(_L("No Input for NumOfLines"));
+		User::Leave(KErrNotReady);
+		}
+	
+	expMailInfo->SetNumLinesBodyText(comInt);
+	comInt = -1;
+	
+	_LIT(KFooterExpected, "FooterExpected%d");
+	param.Format(KFooterExpected,aIndx);
+	if (!GetIntFromConfig(ConfigSection(), param, comInt))
+		{
+		ERR_PRINTF1(_L("No Input for Footer Expected"));
+		User::Leave(KErrNotReady);
+		}
+	expMailInfo->SetFooterExpected(comInt);
+	
+	comInt = -1;
+	_LIT(KNumOfLinesHtml, "NumOfLinesHtml%d");
+	param.Format(KNumOfLinesHtml, aIndx);
+	if (!GetIntFromConfig(ConfigSection(), param, comInt))
+		{
+		ERR_PRINTF1(_L("No Input For NumOfLinesHtml"));
+		User::Leave(KErrNotReady);
+		}
+	expMailInfo->SetNumLinesHtml(comInt);
+	
+	TPtrC ptrDes;
+	_LIT(KDescription, "Description%d");
+	param.Format(KDescription, aIndx);
+	if(!GetStringFromConfig(ConfigSection(), param, ptrDes))
+		{
+		ERR_PRINTF1(_L("No Input for Description"));
+		User::Leave(KErrNotReady);
+		}
+	expMailInfo->SetDescription(ptrDes);
+		
+	_LIT(KNumOfAttachments, "NumOfAttachments%d");
+	param.Format(KNumOfAttachments, aIndx);
+	if (!GetIntFromConfig(ConfigSection(), param, comInt))
+		{
+		ERR_PRINTF1(_L("No Input for NumOfAttachments"));
+		User::Leave(KErrNotReady);
+		}
+	expMailInfo->SetNumAttachments(comInt);
+	
+	comInt = -1;
+	if(expMailInfo->GetFooterExpected())
+		{
+		_LIT(KFooterSize, "FooterSize%d");
+		param.Format(KFooterSize, aIndx);
+		if (!GetIntFromConfig(ConfigSection(), param, comInt))
+			{
+			ERR_PRINTF1(_L("No Input for FooterSize"));
+			User::Leave(KErrNotReady);
+			}
+		expMailInfo->SetFooterSize(comInt);
+		}
+	else
+		{
+		expMailInfo->SetFooterSize(0);
+		}
+	
+	return expMailInfo;
+	}
+
+
+
+/**
+LoadParametersL()
+Loads the test parameters 
+
+@leave KErrNotReady
+@return
+ETrue if parameters loaded, Efalse on failure.
+*/
+TBool CT_MsgComparePopEmailMsgs::LoadParametersL()
+	{
+	TPtrC sentFolder;
+	_LIT(KSentFolder, "SentFolder");
+	if(!GetStringFromConfig(ConfigSection(), KSentFolder, sentFolder))
+		{
+		ERR_PRINTF1(_L("No Input for Sent Folder"));
+		User::Leave(KErrNotReady);
+		}
+			
+	iSentSelectionList = CT_MsgUtils ::CreateChildrenSelectionL(iSharedDataPOP.iSession, CT_MsgUtilsEnumConverter::FindFolderIdByName(sentFolder));
+	if(! iSentSelectionList)
+		{
+		ERR_PRINTF1(_L("Invalid sentSelectionList"));
+		SetTestStepResult(EFail);
+		return EFalse;
+		}
+	
+	TPtrC inboxFolder;
+	_LIT(KInboxFolder, "InboxFolder");
+	if(!GetStringFromConfig(ConfigSection(), KInboxFolder, inboxFolder))
+		{
+		ERR_PRINTF1(_L("No Input for Inbox Folder"));
+		User::Leave(KErrNotReady);
+		}
+	
+	
+	TPtrC popAccountName;
+	if(!GetStringFromConfig(ConfigSection(), KPopAccountName, popAccountName))
+		{
+		ERR_PRINTF1(_L("Account name not specified"));
+		SetTestStepResult(EFail);
+		}
+	if (CT_MsgUtilsEnumConverter::FindFolderIdByName(inboxFolder) == KMsvLocalServiceIndexEntryId)
+		{
+		// We are expecting to get a selection of remote Folder(which is the serviceId)
+		TMsvId popServiceId = CT_MsgUtilsCentralRepository::GetPopServiceIdL((TDes&)popAccountName);
+		
+		CMsvEntry* entry = iSharedDataPOP.iSession->GetEntryL(popServiceId);
+		CleanupStack::PushL(entry);
+		
+		entry->SetEntryL(popServiceId); // Setting the context to remote folder.
+		
+		iInboxSelectionList = CT_MsgUtils ::CreateChildrenSelectionL(iSharedDataPOP.iSession, popServiceId);
+		
+		CleanupStack::PopAndDestroy(entry);
+		}
+	else
+		{
+		iInboxSelectionList = CT_MsgUtils ::CreateChildrenSelectionL(iSharedDataPOP.iSession, CT_MsgUtilsEnumConverter::FindFolderIdByName(inboxFolder));
+		}
+
+	if(! iInboxSelectionList)
+		{
+		ERR_PRINTF1(_L("Invalid inboxSelectionList"));
+		SetTestStepResult(EFail);
+		return EFalse;
+		}
+	//Starting the comparision
+	if(iInboxSelectionList->Count() != iSentSelectionList->Count())
+		{
+		ERR_PRINTF3(_L("iInboxSelectionList->Count(%d) != iSentSelectionList->Count(%d)"),
+								 iInboxSelectionList->Count(), iSentSelectionList->Count());
+		SetTestStepResult(EFail);
+		return EFalse;
+		}
+
+	TInt comInt = -1;
+	_LIT(KNumTest, "NumTest");
+	if (!GetIntFromConfig(ConfigSection(), KNumTest, comInt))
+		{
+		ERR_PRINTF1(_L("No Input for NumTests"));
+		User::Leave(KErrNotReady);
+		}
+	TInt numTests = comInt;
+	if(numTests != iInboxSelectionList->Count())
+		{
+		ERR_PRINTF1(_L("iNumTests != iInboxSelectionList"));
+		SetTestStepResult(EFail);
+		return EFalse;
+		}
+		
+	iExpResults.Reset();
+	for(TInt i = 0;i < numTests; i++) 
+		{
+		
+		CExpPop3MailInfo* pExp = GetExpPop3MailInfoLC(i);
+		if(! pExp)
+			{
+			ERR_PRINTF1(_L("Invalid expected mail Info"));
+			SetTestStepResult(EFail);
+			return EFalse;
+			}
+		else
+			{
+			CleanupStack::Pop(pExp); // pExp			
+			iExpResults.Append(pExp);
+			}
+		}
+	return ETrue;
+	}
+
+
+/**
+DoCompareL()
+Comparison of 2 email messages identified by TMsvEntry
+
+@param  aRecvEntry
+The recieved email identifier.
+
+@param  aMailInfo
+Expected state of the recieved email.
+
+@param  aSentEntry
+Identifier of the original sent email foir comparison purposes.
+
+@return
+ETrue if emails match EFalse otherwise
+*/
+TBool CT_MsgComparePopEmailMsgs::DoCompareL(TMsvEntry& aRecvEntry, CExpPop3MailInfo& aMailInfo, TMsvEntry& aSentEntry)
+	{
+	TBool ret = ETrue;
+	TBool footerExists = EFalse;
+	TInt footersize = 0;
+		
+			
+	TInt nLines = GetMessageLinesL(aRecvEntry, KUidMsvEmailTextEntry, footerExists, footersize);
+	if(nLines != aMailInfo.GetNumLinesBodyText())
+		{
+		ERR_PRINTF3(_L("Lines of body text wrong actual = %d expected = %d!"), nLines, aMailInfo.GetNumLinesBodyText());
+		ret = EFalse;
+		}
+	nLines = GetMessageLinesL(aRecvEntry, KUidMsvEmailHtmlEntry, footerExists, footersize);
+
+	if(nLines != aMailInfo.GetNumLinesHtml())
+		{		
+		ERR_PRINTF3(_L("HTML size wrong actual = %d expected = %d!"), nLines, aMailInfo.GetNumLinesHtml());
+		ret = EFalse;
+		}
+
+	else if(! CheckAttachmentsL(aRecvEntry, aMailInfo, aSentEntry))
+		{
+		ERR_PRINTF1(_L("Attachment comparison failed !"));
+		ret = EFalse;
+		}
+
+	else if(! footerExists && aMailInfo.GetFooterExpected())
+		{
+		ERR_PRINTF1(_L("An expected footer was missing !"));
+		ret = EFalse;
+		}
+	else if(footerExists && ! aMailInfo.GetFooterExpected())
+		{
+		ERR_PRINTF1(_L("An unexpected footer was found !"));
+		ret = EFalse;
+		}
+	else if(aMailInfo.GetFooterExpected() && aMailInfo.GetFooterSize()!=0 
+			&& aMailInfo.GetFooterSize() != footersize)
+		{
+		ERR_PRINTF3(_L("KB left on server size wrong = %d expected = %d!"), footersize, aMailInfo.GetFooterSize());
+		ret = EFalse;			
+		}
+	return ret;
+	}
+
+
+
+
+/**
+CheckAttachmentsL()
+Compares attachments for the email messages aRecvEntry and aSentEntry using
+expected results in aMailInfo
+
+@param aRecvEntry
+An identifier for the recieved email
+
+@param aMailInfo
+Expected state of recieved email attachments
+
+@param aSentEntry
+An identifier for the original email
+
+@return
+ETrue if attachments match otherwise EFalse
+*/
+TBool CT_MsgComparePopEmailMsgs::CheckAttachmentsL(TMsvEntry& aRecvEntry, CExpPop3MailInfo& aMailInfo, TMsvEntry& aSentEntry)
+	{
+	TBool ret = ETrue;
+	CAttachmentItem* recvManager = CAttachmentItem::NewLC(*iSharedDataPOP.iSession, aRecvEntry);
+	CAttachmentItem* sentManager = CAttachmentItem::NewLC(*iSharedDataPOP.iSession, aSentEntry);
+
+	TInt recvCount = recvManager->MMsvAttachmentManager().AttachmentCount();	
+	TInt sentCount = sentManager->MMsvAttachmentManager().AttachmentCount();
+
+	TFileName recvFileName;
+	TFileName sentFileName;
+
+	if(recvCount == aMailInfo.GetNumAttachments())
+		{
+		for(TInt i=0;i<recvCount;i++)
+			{
+			for(TInt j=0;j<sentCount;j++)
+				{
+				CMsvAttachment* recvAttInfo = recvManager->MMsvAttachmentManager().GetAttachmentInfoL(i);
+				CleanupStack::PushL(recvAttInfo);
+
+				CMsvAttachment* sentAttInfo = sentManager->MMsvAttachmentManager().GetAttachmentInfoL(j);
+				CleanupStack::PushL(sentAttInfo);
+
+				if(recvAttInfo->AttachmentName().Compare(sentAttInfo->AttachmentName()) == 0)
+					{
+					recvFileName = recvAttInfo->FilePath();
+					sentFileName = sentAttInfo->FilePath();
+					ret = CompareFilesL(recvFileName, sentFileName);
+					}
+				CleanupStack::PopAndDestroy(2, recvAttInfo);		
+				}
+			}
+		}
+	else
+		{
+		INFO_PRINTF3(_L("Warning - Expected attachments mismatch recieved (%d) expected (%d)"),
+								 recvCount, aMailInfo.GetNumAttachments());
+		ret = EFalse;
+		}
+	CleanupStack::PopAndDestroy(2, recvManager); // recvManager,sentManager
+	return ret;
+	}
+
+
+
+/**
+CompareFilesL()
+Performs byte for byte copmparison of the files indicated by aFileName1 and aFileName2
+
+@param aFileName1
+Filename of first file to be compared
+
+@param aFileName2
+Filename of second file to be compared
+
+@return
+ETrue if files match, EFalse otherwise
+*/
+TBool CT_MsgComparePopEmailMsgs::CompareFilesL(TFileName& aFileName1, TFileName& aFileName2)
+	{
+	TBool ret = ETrue;
+	RFile file1, file2;
+
+	User::LeaveIfError(file1.Open(iFs, aFileName1, EFileRead));
+	User::LeaveIfError(file2.Open(iFs, aFileName2, EFileRead));
+
+	TInt sz1, sz2;
+	User::LeaveIfError(file1.Size(sz1));
+	User::LeaveIfError(file2.Size(sz2));
+	
+	if(sz1 != sz2)
+		{
+		ERR_PRINTF3(_L("File size mismatch 1(%d)   2(%d)"), sz1, sz2);
+		ret = EFalse;
+		}
+	else
+		{
+		TBuf8<1> char1;
+		TBuf8<1> char2;
+		TInt len1, len2;
+		do
+			{
+			file1.Read(char1);
+			file2.Read(char2);
+			len1 = char1.Length();
+			len2 = char2.Length();
+			if(char1.Compare(char2) != 0)
+				{
+				ret = EFalse;
+				break;
+				}
+			}
+		while(len1 && len2);
+		}
+	file1.Close();
+	file2.Close();
+	return ret;
+	}
+
+
+/**
+GetMessageLinesL()
+Counts the number of lines in a message's HTML or body text
+
+@param aEntry
+Email message identifier
+
+@param aUid
+Request identifier KUidMsvEmailHtmlEntry or KUidMsvEmailTextEntry at present
+
+@param aFooterExists
+Reference to a boolean variable only used when aUid == KUidMsvEmailTextEntry
+
+@param aFooterSize
+Expected KB left on server inserted into footer string if present 
+
+@return
+Returns the number of lines in the requested message part
+*/
+TInt CT_MsgComparePopEmailMsgs::GetMessageLinesL(TMsvEntry& aEntry, TUid aUid, TBool& aFooterExists, TInt &aFooterSize)
+	{
+	TInt lines = 0; 
+	
+	TMsvId msgPartIndex = GetMessagePartIndexL(aEntry,aUid);
+	
+	if(msgPartIndex)
+		{
+		CMsvEntry* msvEntry = iSharedDataPOP.iSession->GetEntryL(msgPartIndex);
+		CleanupStack::PushL(msvEntry);
+	
+		msvEntry->SetEntryL(msgPartIndex);
+		if(aUid == KUidMsvEmailTextEntry)
+			{
+			lines = CountLinesOfBodyTextL(*msvEntry, aFooterExists, aFooterSize);
+			}
+		else if(aUid == KUidMsvEmailHtmlEntry)
+			{
+			lines = CountLinesOfHtmlL(*msvEntry);
+			}
+		CleanupStack::PopAndDestroy(msvEntry);
+		}
+	return lines;
+	}
+
+
+/**
+CountLinesOfBodyTextL()
+Counts the lines of body text in the email aEntry
+
+@param aEntry
+A reference to an object representing the email
+
+@param aFooterExists
+Reference to a boolean variable - set to ETrue if the footer string is found in the body text
+
+@param aFooterSize
+Expected KB left on server inserted into footer string if present 
+
+@return
+Number of lines in the body text 
+*/
+TInt CT_MsgComparePopEmailMsgs::CountLinesOfBodyTextL(CMsvEntry& aEntry, TBool& aFooterExists, TInt& aFooterSize)
+	{
+	TInt lines = 0;
+	aFooterExists=EFalse;
+	aFooterSize=0;
+	aEntry.SetEntryL(aEntry.EntryId());
+	if(aEntry.HasStoreL())
+		{
+		CMsvStore*	msvStore1= aEntry.ReadStoreL();
+		CleanupStack::PushL(msvStore1);
+		CParaFormatLayer*	paraFormatLayer1 = CParaFormatLayer::NewL();
+		CleanupStack::PushL(paraFormatLayer1);
+		CCharFormatLayer*	charFormatLayer1 = CCharFormatLayer::NewL(); 
+		CleanupStack::PushL(charFormatLayer1);
+		CRichText*	bodyText1=CRichText::NewL(paraFormatLayer1, charFormatLayer1, CEditableText::EFlatStorage, 256);
+		CleanupStack::PushL(bodyText1);
+
+		bodyText1->Reset();
+		if (msvStore1->HasBodyTextL())
+			{
+			msvStore1->RestoreBodyTextL(*bodyText1);
+			TUint16 val = CEditableText::ELineBreak;
+			TInt n = 0;
+			TInt pos = 0;
+			for(;;)
+				{
+				TPtrC bodyText = bodyText1->Read(pos);
+				n = bodyText.Find(&val, 1);
+				if(n < 0)
+					break;
+				lines++;
+				pos += n+1;
+				
+				//This Check is needed to delete the extra line introduced by communigate Pro Server
+				TInt fpos = CheckIfServerMessageExists(bodyText);
+				if (fpos != KErrNotFound)
+					{
+					lines--;
+					}
+				}
+			TPtrC	pBt = bodyText1->Read(0);
+			aFooterExists = CheckIfFooterMessageExistsL(pBt , aFooterSize);
+			}		
+		CleanupStack::PopAndDestroy(4, msvStore1);  //bodyText1,charFormatLayer1,paraFormatLayer1,msvStore1.
+		}
+	return lines;
+	}
+
+
+/**
+CheckIfServerMessageExists()
+Checks if any server message has been added to the Body text returns the 
+position of the server message in the buffer and the length of the server
+message.This function can be enhanced to check for any other server message encountered.
+If not found, returns KErrNotFound.
+
+@param aBodyText
+The body text of the message
+
+@return
+Position of the message, if not found returns KErrNotFound
+*/
+ TInt CT_MsgComparePopEmailMsgs::CheckIfServerMessageExists(TPtrC aBodyText)
+	{
+	_LIT(KServerMessage,"*This message was transferred with a trial version of CommuniGate(tm) Pro*");
+
+	TInt pos = aBodyText.FindC(KServerMessage);
+	
+	return pos;
+	}
+
+
+/**
+CountLinesOfHtmlL()
+Counts the number of lines of HTML
+
+@param aEntry
+A reference to an object representing the email
+
+@return
+Number of lines of HTML
+*/
+TInt CT_MsgComparePopEmailMsgs::CountLinesOfHtmlL(CMsvEntry& aEntry)
+	{ 
+	TInt lines = 0;
+	aEntry.SetEntryL(aEntry.EntryId());
+	
+	
+	CMsvStore* store = aEntry.ReadStoreL();
+	CleanupStack::PushL(store);
+	
+	MMsvAttachmentManager& attManager = store->AttachmentManagerL();
+	
+	RFile htmlFile = attManager.GetAttachmentFileL(0);
+	CleanupClosePushL(htmlFile);
+	
+	_LIT8(KFindData, "\r\n");
+	TInt htmlSize = 0;
+	User::LeaveIfError(htmlFile.Size(htmlSize));
+	HBufC8* fBuf = HBufC8::NewLC(htmlSize);
+	TPtr8 p = fBuf->Des();
+	htmlFile.Read(p);
+	TInt pos = 0;
+	for(;;)
+		{
+		pos = p.Find(KFindData);
+		if(pos < 0)
+			{
+			break;
+			}
+		p = p.Mid(pos+2);
+		lines++;
+		}
+		
+	CleanupStack::PopAndDestroy(fBuf);
+	CleanupStack::PopAndDestroy(); // htmlFile
+	CleanupStack::PopAndDestroy(store);
+	
+	return lines;
+	}
+
+
+
+/**
+GetMessagePartIndexL()
+Retrieves the part index id for the email identified by aEntry
+
+@param aEntry
+A valid email identifier
+
+@param aUid
+An identifier tfor the type of message part to be retrieved
+
+@return
+TMsvId - message part identifier
+*/
+TMsvId CT_MsgComparePopEmailMsgs::GetMessagePartIndexL(TMsvEntry& aEntry, TUid aUid)
+	{
+	static TBool msgPartFound = EFalse;	
+	TMsvId msgPartId = 0;
+	CMsvEntry*	baseEntry  = iSharedDataPOP.iSession->GetEntryL(aEntry.Id());
+	CleanupStack::PushL(baseEntry);
+	CMsvEntrySelection*	selection =  baseEntry->ChildrenL();
+	CleanupStack::PushL(selection);
+	TInt count = selection->Count();
+	TInt ind1;
+	CMsvEntry* entry = iSharedDataPOP.iSession->GetEntryL(KMsvRootIndexEntryId);
+	CleanupStack::PushL(entry);
+	for (ind1=0, msgPartFound=EFalse; ind1 < count; ind1++)
+		{
+		if(msgPartFound)
+			{
+			break;
+			}		
+		TMsvId	childId  = selection->At(ind1);
+		entry->SetEntryL(childId);
+
+		if (entry->Entry().iType  == aUid)
+			{
+			msgPartId = childId;
+			break;
+			}
+		else if (entry->Entry().iType  == KUidMsvFolderEntry)
+			{
+			TMsvEntry ent = entry->Entry();
+			msgPartId = GetMessagePartIndexL(ent, aUid);
+			}
+		}
+	CleanupStack::PopAndDestroy(3, baseEntry);  // entry,selection,baseEntry
+	return msgPartId;
+	}
+
+
+
+
+/**
+CheckIfFooterMessageExistsL()
+Checks the email for the presence of the footer string
+
+@param aRecvBodyText
+Reference to a descriptor holding the body text
+
+@param aFooterSize
+The expected number of KB remaining on the server which has been inserted into the footer string
+
+@return
+ETrue if footer string found otherwise EFalse 
+*/
+TBool CT_MsgComparePopEmailMsgs::CheckIfFooterMessageExistsL(TPtrC& aRecvBodyText , TInt& aFooterSize)
+	{
+	RResourceFile resFile;
+	CT_MsgUtils ::OpenResourceFileL(resFile, iFs, KImEngineResourceFile);	// NB leaves if file not found
+	TCleanupItem close(CT_MsgUtils ::CloseResourceFile, &resFile);
+	CleanupStack::PushL(close);
+	
+	HBufC8* buf = NULL;
+	buf = resFile.AllocReadLC(PARTIAL_DOWNLOAD_FOOTER_MESSAGE);
+	TResourceReader reader;
+	reader.SetBuffer(buf);
+
+	HBufC* resourceBuf = (reader.ReadTPtrC()).AllocL();
+	CleanupStack::PushL(resourceBuf);
+
+	TInt len = resourceBuf->Find(_L("%d"));
+	const TInt KBufLen = 256;
+	TBuf<KBufLen> findBuf;
+
+	if(len == KErrNotFound)
+		{
+		len = resourceBuf->Length();
+		}
+
+	if(len > KBufLen)
+		{
+		len = KBufLen;
+		}
+	
+	findBuf.Copy(resourceBuf->Ptr(), len);
+	len = aRecvBodyText.Find(findBuf);
+
+	if(len>=0)
+		{
+		TPtrC rest=aRecvBodyText.Right(aRecvBodyText.Length()-len-findBuf.Length());
+		TLex lex(rest.Left(rest.Locate(TChar(' '))));
+		lex.Val(aFooterSize);
+		}
+	else
+		{
+		aFooterSize=0;
+		}
+
+	CT_MsgUtils ::CloseResourceFile(&resFile);
+	CleanupStack::PopAndDestroy(3); // buf, resourceBuf, close
+	return (len != KErrNotFound);
+	}
+
+//const TInt KGranuality = 5;
+
+/**
+CT_MsgComparePopEmailMsgs()
+Constructor
+
+@param  aSharedDataPOP
+Data shared across the POP test steps. Ex. SessionF
+*/
+CT_MsgComparePopEmailMsgs::CT_MsgComparePopEmailMsgs(CT_MsgSharedDataPop& aSharedDataPOP)
+:	CT_MsgAsyncStepPOP(aSharedDataPOP)  
+	{
+	iSentSelectionList = NULL;
+	iInboxSelectionList = NULL;
+	SetTestStepName(KComparePopEmailMsgs);
+	}
+
+
+/**
+NewL()
+Allocates and creates a new CT_MsgComparePopEmailMsgs object
+
+@param aSharedDataPOP
+Data shared across the POP test steps. Ex. Session
+
+@leave KErrNoMemory
+@return
+Returns pointer to an object of CT_MsgComparePopEmailMsgs.
+*/
+CT_MsgComparePopEmailMsgs* CT_MsgComparePopEmailMsgs::NewL(CT_MsgSharedDataPop& aSharedDataPOP)
+	{
+	CT_MsgComparePopEmailMsgs* self = new(ELeave) CT_MsgComparePopEmailMsgs(aSharedDataPOP);
+	CleanupStack::PushL(self);
+	self->ConstructL(); 					 // Call CT_AsyncStep::ConstructL()
+	CleanupStack::Pop(self);
+	return self;
+	}		
+
+
+/**
+ProgressL()
+
+*/
+
+//////////////////////////
+////
+////	I have no idea what this code is doing.
+////	It looks very messy.
+////	Someone is going to have to reowrk this code so that we can cancel and do progress
+////
+//////////////////////////
+void CT_MsgComparePopEmailMsgs::ProgressL(TBool bFinal)
+	{
+	//	TODO
+	if (bFinal)
+		{
+		//	Display final progress
+		}
+	else
+		{
+		//	Display current progress
+		}
+	}
+
+
+/**
+CancelStep()
+
+*/
+void CT_MsgComparePopEmailMsgs::CancelStep()
+	{
+	//	TODO
+	}
+
+
+/**
+~CT_MsgComparePopEmailMsgs()
+Deletes all the data members.
+*/
+CT_MsgComparePopEmailMsgs::~CT_MsgComparePopEmailMsgs()
+	{
+	// To delete each element in the array
+	for(TInt i=0; i < iExpResults.Count(); i++)
+		{
+		CExpPop3MailInfo* pExp = iExpResults[i];
+		delete pExp;
+		pExp=NULL;
+		}
+	iExpResults.Reset();
+	iExpResults.Close();
+
+	delete iSentSelectionList;
+	iSentSelectionList=NULL;
+	delete iInboxSelectionList;
+	iInboxSelectionList=NULL;
+	}
+
+
+/**
+doTestStepL()
+Performs the comparison of POP messages
+
+@return
+Returns the teststep result.
+*/
+TVerdict CT_MsgComparePopEmailMsgs::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test Step: Compare Pop Email Msgs"));
+		
+	if(LoadParametersL())
+		{
+		User::LeaveIfError(iFs.Connect());
+		CleanupClosePushL(iFs);
+		
+			// Normally do not push an object that is a data member of another object.
+			// But in this case we want to close early if we get a leave.
+			// Otherwise the iFs would be open till the thread had begun to die.
+		if(TestStepResult() == EPass)
+			{
+			CMsvEntry* recvMsvEntry = iSharedDataPOP.iSession->GetEntryL(KMsvRootIndexEntryId);
+			CleanupStack::PushL(recvMsvEntry);
+			CMsvEntry* sentMsvEntry = iSharedDataPOP.iSession->GetEntryL(KMsvRootIndexEntryId);
+			CleanupStack::PushL(sentMsvEntry);
+
+			for(TInt i = 0;i < iInboxSelectionList->Count();i++)
+				{
+				recvMsvEntry->SetEntryL(iInboxSelectionList->At(i));
+				TMsvEntry recvEntry = recvMsvEntry->Entry();
+				for(TInt j = 0;j < iSentSelectionList->Count();j++)
+					{
+					sentMsvEntry->SetEntryL(iSentSelectionList->At(j));
+					TMsvEntry sentEntry = sentMsvEntry->Entry();
+					if(recvEntry.iDescription.Compare(sentEntry.iDescription) == 0) 
+						{
+						CExpPop3MailInfo* pExpMailInfo = NULL;
+						for(int k = 0;k < iExpResults.Count();k++)
+							{
+							if(iExpResults[k]->GetDescription().Compare(recvEntry.iDescription) == 0)
+								{
+								pExpMailInfo =  iExpResults[k];
+								break;
+								}
+							}
+						if(! pExpMailInfo)
+							{
+							ERR_PRINTF2(_L("Test %d failed could not retrieve expected mail info"), j+1);
+							SetTestStepResult(EFail);
+							break;
+							}
+
+						if(! DoCompareL(recvEntry, *pExpMailInfo, sentEntry))
+							{
+							INFO_PRINTF2(_L("Test %d failed"), j + 1);
+							SetTestStepResult(EFail);
+							}														
+						}
+					}
+				}
+			CleanupStack::PopAndDestroy(2, recvMsvEntry); // recvMsvEntry, sentMsvEntry
+			}		
+		CleanupStack::PopAndDestroy();
+		}		
+	INFO_PRINTF1(_L("T_ComparePopEmailMsgs Completed"));
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_ComparePopSettings.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,310 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// ComparePopSettings
+// [Paramaters]
+// PopAccountName		:		Name of the Pop account
+// ConfigFileName		:		Config file from which the Pop account settings are read 
+// ComparePopSettings is intended to compare the Pop account settings.
+// 
+//
+
+
+
+/**
+ @file cexppop3mailinfo.h
+*/
+
+
+// User includes
+#include "T_ComparePopSettings.h"
+#include <t_utilsconfigfileparserutility.h>
+#include <t_utilsreademailsettingsfromconfigfile.h>
+#include <t_utilscentralrepository.h>
+
+
+// Epoc includes
+#include <cemailaccounts.h>
+#include <iapprefs.h>
+#include <pop3set.h>
+#include <smtpset.h>
+
+
+// Literals Used
+_LIT(KPopAccountName,"PopAccountName");
+_LIT(KPopConfigFileName,"PopConfigFileName");
+_LIT(KMatchExpected,"MatchExpected");
+
+
+/**
+CT_MsgComparePopSettings()
+Constructor - Initializes the data members.
+
+@param aSharedDataPOP
+Data shared across the POP test steps. Ex. Session
+*/
+CT_MsgComparePopSettings::CT_MsgComparePopSettings(CT_MsgSharedDataPop& aSharedDataPOP)
+:	CT_MsgSyncStepPOP(aSharedDataPOP) 
+	{
+	SetTestStepName(KComparePopSettings);
+	}
+
+
+/**
+~CT_MsgComparePopSettings
+Destructor
+*/
+CT_MsgComparePopSettings::~CT_MsgComparePopSettings()
+	{
+	}
+
+
+/**
+doTestStepL()
+Reads the Pop account name and config file name from the ini file
+Compares the settings of the Imap account.
+  
+@return
+Returns the test step result
+*/
+TVerdict CT_MsgComparePopSettings::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test Step : ComparePopSettings"));
+	// Read the POP account name from the ini file
+	TPtrC popAccountName;
+	if(!GetStringFromConfig(ConfigSection(), KPopAccountName, popAccountName))
+		{
+		ERR_PRINTF1(_L("PopAccount Name is not specified"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		// Retrieving the Pop service Id for the given Pop account
+		TMsvId popServiceId = KMsvNullIndexEntryId;
+		TRAPD(err,popServiceId = CT_MsgUtilsCentralRepository::GetPopServiceIdL((TDes&)popAccountName));
+		INFO_PRINTF2(_L("Pop service id is %d"),popServiceId);
+		
+		TBool matchExpected = ETrue;
+		GetBoolFromConfig(ConfigSection(), KMatchExpected, matchExpected);
+		
+		TVerdict result = EPass;
+		TPtrC configFileName;
+		
+		if(popServiceId == KMsvNullIndexEntryId)
+			{
+			INFO_PRINTF1(_L("Invalid POP account name is specified"));
+			result = EFail;	
+			}
+		else
+			{
+			if(!GetStringFromConfig(ConfigSection(), KPopConfigFileName, configFileName))
+				{
+				ERR_PRINTF1(_L("Configuration file path is not specified"));
+				SetTestStepResult(EFail);
+				}
+			else
+				{
+				CEmailAccounts* emailAccounts = CEmailAccounts::NewLC();
+
+				// Creating the first set of settings objects
+				CImPop3Settings* popSettings1 = new(ELeave) CImPop3Settings();
+				CleanupStack::PushL(popSettings1);
+				
+				CImIAPPreferences* popIapPrefs1 = CImIAPPreferences::NewLC();
+				
+				CImSmtpSettings* smtpSettings1 = new(ELeave) CImSmtpSettings();
+				CleanupStack::PushL(smtpSettings1);
+
+				CImIAPPreferences* smtpIapPrefs1 = CImIAPPreferences::NewLC();
+				
+				// Creating the second set of settings objects	
+				CImPop3Settings* popSettings2= new(ELeave) CImPop3Settings();
+				CleanupStack::PushL(popSettings2);
+				
+				CImIAPPreferences* popIapPrefs2 = CImIAPPreferences::NewLC();
+				
+				CImSmtpSettings* smtpSettings2 = new(ELeave) CImSmtpSettings();
+				CleanupStack::PushL(smtpSettings2);
+
+				CImIAPPreferences* smtpIapPrefs2 = CImIAPPreferences::NewLC();
+					
+				emailAccounts->PopulateDefaultPopSettingsL(*popSettings2, *popIapPrefs2);
+				emailAccounts->PopulateDefaultSmtpSettingsL(*smtpSettings2, *smtpIapPrefs2);
+					
+				TPopAccount popAccount;
+				emailAccounts->	GetPopAccountL(popServiceId, popAccount);
+					
+				TRAPD(error1, LoadAccountSettingsL(*emailAccounts,popAccount,
+					*popSettings1,*popIapPrefs1,*smtpSettings1,*smtpIapPrefs1));
+				
+				if(error1 != KErrNone)
+					{
+					ERR_PRINTF2(_L("LoadPOPPSettingsL Failed with error code %d"), error1);
+					result = EFail;
+					SetTestStepResult(EFail);
+					}
+				else
+					{
+					if(configFileName.CompareF(_L("none")) != 0)
+						{
+						TRAPD(err, CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadPopSettingsFromConfigurationFileL(configFileName, *popSettings2, *popIapPrefs2));
+						if(err)
+							{	
+							ERR_PRINTF2(_L("Failure while setting the Pop setting parameters, failed with error %d"), err);
+							SetTestStepResult(EFail);															  
+							}
+						else
+							{
+							TRAPD(error, CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadSmtpSettingsFromConfigurationFileL(configFileName, *smtpSettings2, *smtpIapPrefs2));
+							if(error)
+								{
+								ERR_PRINTF2(_L("Failure while setting the SMTP setting parameters, failed with error %d"), error);
+								SetTestStepResult(EFail);															  
+								}							
+							}							
+						}
+					if(TestStepResult() == EPass)
+						{
+						result = CompareSettings(*popSettings1 , *popSettings2 ,
+											*smtpSettings1,*smtpSettings2,
+											*popIapPrefs1,*popIapPrefs2,
+											*smtpIapPrefs1,*smtpIapPrefs2);
+						}
+					}
+				CleanupStack::PopAndDestroy(9,emailAccounts);
+					
+				}				
+			}
+
+		// if the parameters did not match and we expected them to then fail the test
+		if(result == EPass && matchExpected)
+			{
+			INFO_PRINTF1(_L("*********Passed As Expected*******"));
+			SetTestStepResult(EPass);
+			}
+		else if(result == EFail && !matchExpected)
+			{
+			INFO_PRINTF1(_L("*******Failed as Expected********"));
+			SetTestStepResult(EPass); // This is required as some checks where it will fail, at that pt teststep might have been set to fail
+			}
+		else
+			{
+			ERR_PRINTF1(_L("Pop settings Comparison Failed"));
+			SetTestStepResult(EFail);					
+			}
+		INFO_PRINTF1(_L("ComparePopSettings completed"));
+		}
+	return TestStepResult();
+	}
+	
+/**
+CompareSettings()
+Compares the two sets of POP settings, IAPPrefernces, and SMTP settings.
+  
+@param aPopSettings1
+An object of type CImPop3Settings
+
+@param aPopSettings2
+An object of type CImPop3Settings
+
+@param aPopIapPrefs1
+An object of type CImIAPPreferences
+
+@param aPopIapPrefs2
+An object of type CImIAPPreferences
+
+@param aSmtpIapPrefs1
+An object of type CImIAPPreferences
+
+@param aSmtpIapPrefs2
+An object of type CImIAPPreferences
+
+@param aSmtpSettings
+An object of type CImSmtpSettings
+
+@param aSmtpIapSettings
+An object of type CImIAPPreferences
+
+@return
+Returns EPass if exactly the same for all values in the two sets of parameters.
+Returns EFail if any value is different between the two sets of parameters.
+*/
+TVerdict CT_MsgComparePopSettings::CompareSettings(CImPop3Settings& aPopSettings1, CImPop3Settings& aPopSettings2,
+						 CImSmtpSettings& aSmtpSettings1,CImSmtpSettings& aSmtpSettings2, CImIAPPreferences& aPopIapPrefs1,
+							CImIAPPreferences& aPopIapPrefs2, CImIAPPreferences& aSmtpIapPrefs1, CImIAPPreferences& aSmtpIapPrefs2)
+	{
+	TVerdict result = EPass;
+	if (!(aPopSettings1 == aPopSettings2))   
+		{
+		// failed
+		ERR_PRINTF1(_L("Pop3 Settings objects do not match !"));
+		result = EFail;
+		}
+	else if (!(aSmtpSettings1 == aSmtpSettings2))
+		{
+		// failed
+		ERR_PRINTF1(_L("SMTP Settings objects do not match !"));
+		result = EFail;
+		}
+	else if (!CT_MsgUtilsReadEmailSettingsFromConfigFile::CompareIapPrefs(aPopIapPrefs1, aPopIapPrefs2))
+		{
+		// failed
+		ERR_PRINTF1(_L("Pop3 IAP Preference objects do not match !"));
+		result = EFail;
+		}
+	else if (!CT_MsgUtilsReadEmailSettingsFromConfigFile::CompareIapPrefs(aSmtpIapPrefs1, aSmtpIapPrefs2))
+		{
+		// failed
+		ERR_PRINTF1(_L("SMTP IAP Preference objects do not match !"));
+		result = EFail;
+		}
+	
+	return result;
+	}
+	
+/**
+LoadAccountSettingsL()
+This function loads the IMAP and SMTP settings object from the IMAP account given
+
+@param aEmailAccount
+An object of type CEmailAccounts
+
+@param aAccount
+An object of type TPopAccount
+
+@param aPopSettings
+An object of type CImPop3Settings
+
+@param aPopIapSettings
+An object of type CImIAPPreferences
+
+@param aSmtpSettings
+An object of type CImSmtpSettings
+
+@param aSmtpIapSettings
+An object of type CImIAPPreferences
+
+@return : void
+*/	
+void CT_MsgComparePopSettings::LoadAccountSettingsL(CEmailAccounts& aEmailAccount, const TPopAccount& aAccount, CImPop3Settings& aPopSettings, 
+		CImIAPPreferences& aPopIapSettings,CImSmtpSettings& aSmtpSettings, CImIAPPreferences& aSmtpIapSettings)
+	{
+	aEmailAccount.LoadPopSettingsL(aAccount, aPopSettings);
+	aEmailAccount.LoadPopIapSettingsL(aAccount, aPopIapSettings);
+	
+	TSmtpAccount smtpAccount;
+	aEmailAccount.GetSmtpAccountL(aAccount.iSmtpService, smtpAccount);
+	aEmailAccount.LoadSmtpSettingsL(smtpAccount, aSmtpSettings);
+	aEmailAccount.LoadSmtpIapSettingsL(smtpAccount, aSmtpIapSettings);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_ConnectPop3Server.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,180 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// ConnectPop3Server
+// [Paramaters]
+// PopAccountName			<input>	: Name of the Pop account
+// Connects to the Pop3 Server
+// [APIs Used]
+// CMsvEntry::SetEntryL
+// CMsvEntrySelection::AppendL
+// CPop3ClientMtm::InvokeAsyncFunctionL
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+// User Includes
+#include "T_ConnectPop3Server.h"
+#include <t_utilscentralrepository.h>
+
+
+// Epoc includes
+#include <miutset.h>
+#include <pop3cmds.h>
+#include <mtclbase.h>
+#include <pop3set.h>
+
+// Literals Used
+_LIT(KPopAccountName,"PopAccountName");
+
+const TInt KMaxLenghtOfChar = 1;
+
+/**
+CT_MsgConnectPop3Server()
+Sets the teststep name to KConnectPop3Server
+
+@param aSharedDataPOP
+Data shared across the POP test steps. Ex. Session
+*/
+CT_MsgConnectPop3Server::CT_MsgConnectPop3Server(CT_MsgSharedDataPop& aSharedDataPOP)
+:	CT_MsgAsyncStepPOP(aSharedDataPOP) 
+,	iOperation(NULL)
+	{
+	SetTestStepName(KConnectPop3Server);
+	}
+
+/**
+NewL()
+Allocates and creates a new CT_MsgConnectPop3Server object
+
+@param aSharedDataPOP
+Data shared across the POP test steps. Ex. Session
+
+@leave KErrNoMemory
+@return
+Returns pointer to an object of CT_MsgComparePopEmailMsgs
+*/
+CT_MsgConnectPop3Server* CT_MsgConnectPop3Server::NewL(CT_MsgSharedDataPop& aSharedDataPOP)
+	{
+	CT_MsgConnectPop3Server* self = new(ELeave) CT_MsgConnectPop3Server(aSharedDataPOP);
+	CleanupStack::PushL(self);
+	self->ConstructL(); 					 // Call CT_AsyncStep::ConstructL()
+	CleanupStack::Pop(self);
+	return self;
+	}		
+
+
+/**
+~CT_MsgConnectPop3Server()
+Destructor
+*/
+CT_MsgConnectPop3Server::~CT_MsgConnectPop3Server()
+	{
+	delete iOperation;
+	iOperation=NULL;
+	}
+
+
+/**
+ProgressL()
+
+@param
+*/
+void CT_MsgConnectPop3Server::ProgressL(TBool bFinal)
+	{
+	//	TODO
+	if (bFinal)
+		{
+		//	Display final progress iOperation
+		}
+	else
+		{
+		//	Display current progress iOperation
+		}
+	}
+
+
+/**
+CancelStep()
+
+@param
+*/
+void CT_MsgConnectPop3Server::CancelStep()
+	{
+	iOperation->Cancel();
+	}
+
+
+/**
+doTestStepL()
+It establishes connection with the Pop server using a POP account.
+The account is identified by the account name that is read from the INI file.
+
+@return
+Returns the test step result
+*/
+TVerdict CT_MsgConnectPop3Server::doTestStepL()
+	{	
+	INFO_PRINTF1(_L(" Test Step : ConnectPop3Server"));
+	TPtrC popAccountName;
+	if(!GetStringFromConfig(ConfigSection(), KPopAccountName, popAccountName))
+		{
+		ERR_PRINTF1(_L("Pop Account Name is not specified"));
+		SetTestStepResult(EFail);
+		}
+
+	else
+		{
+		// Retrieving the Pop service Id for the given Pop account
+		TMsvId popServiceId = CT_MsgUtilsCentralRepository::GetPopServiceIdL((TDes&)popAccountName);
+		INFO_PRINTF2(_L("Pop service id is %d"),popServiceId);
+
+		// Change the current context
+		iSharedDataPOP.iMtm->SwitchCurrentEntryL(popServiceId);
+
+		CMsvEntrySelection* selection = new (ELeave) CMsvEntrySelection;
+		CleanupStack::PushL(selection);
+
+		// Appends the popServiceId onto the end of the array
+		selection->AppendL(popServiceId);
+		
+		TBuf8<KMaxLenghtOfChar> param;
+
+		CT_MsgActive&	active=Active();
+		// Attempts to connect to the Pop3 Service
+		iOperation = iSharedDataPOP.iMtm->InvokeAsyncFunctionL(KPOP3MTMConnect,*selection,param, active.iStatus);
+
+		active.Activate();
+		CActiveScheduler::Start();
+	
+		// Get the error code from TPop3Progress
+		TPop3Progress temp;
+		TPckgC<TPop3Progress> paramPack(temp);
+		paramPack.Set(iOperation->ProgressL());
+		TPop3Progress progress=paramPack();
+		SetTestStepError(progress.iErrorCode);
+
+		delete iOperation;
+		iOperation=NULL;
+		
+		CleanupStack::PopAndDestroy(selection); //operation,selection
+	//	User::LeaveIfError(active.Result());
+		}
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_CopyPopSelection.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,250 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// CopyPopSelection
+// [Paramaters]
+// PopAccountName				:	Name of the Pop account
+// TargetFolderName				:   Name of the target folder to which the entries need to be copied 				
+// Copies the entries to the target.
+// [APIs Used]
+// CMsvEntry::SetEntryL
+// CMsvEntry::CopyL
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+// User includes
+#include "T_CopyPopSelection.h"
+#include <t_utilscentralrepository.h>
+#include <t_utils.h>
+#include <t_utilsenumconverter.h>
+#include "T_MsgSharedDataPop.h"
+
+
+// Literals Used
+_LIT(KPopAccountName,"PopAccountName");
+_LIT(KTargetFolderName,"TargetFolderName");
+_LIT(KMove, "Move");
+_LIT(KCopyWithinService, "CopyWithinService");
+
+/**
+CT_MsgCopyPopSelection()
+Sets the teststep name to KCopyPopSelection
+
+@param aSharedDataPOP
+Data shared across the POP test steps. Ex. Session
+*/
+CT_MsgCopyPopSelection::CT_MsgCopyPopSelection(CT_MsgSharedDataPop& aSharedDataPOP)
+:	CT_MsgAsyncStepPOP(aSharedDataPOP) 
+,	iOperation(NULL)
+	{
+	SetTestStepName(KCopyPopSelection);
+	}
+
+/**
+NewL()
+Allocates and creates a new CT_MsgCopyPopSelection object
+  
+@param aSharedDataPOP
+Data shared across the POP test steps. Ex. Session
+
+@leave KErrNoMemory
+@return
+Returns pointer to an object of CT_MsgComparePopEmailMsgs
+*/
+CT_MsgCopyPopSelection* CT_MsgCopyPopSelection::NewL(CT_MsgSharedDataPop& aSharedDataPOP)
+	{
+	CT_MsgCopyPopSelection* self = new(ELeave) CT_MsgCopyPopSelection(aSharedDataPOP);
+	CleanupStack::PushL(self);
+	self->ConstructL(); 					 // Call CT_AsyncStep::ConstructL()
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+
+/**
+~CT_MsgCopyPopSelection()
+Destructor
+*/
+CT_MsgCopyPopSelection::~CT_MsgCopyPopSelection()
+	{
+	delete iOperation;
+	iOperation=NULL;
+	}
+
+
+/**
+ProgressL()
+
+@param
+*/
+void CT_MsgCopyPopSelection::ProgressL(TBool bFinal)
+	{
+	//	TODO
+	if (bFinal)
+		{
+		//	Display final progress iOperation
+		}
+	else
+		{
+		//	Display current progress iOperation
+		}
+	}
+
+
+/**
+CancelStep()
+
+*/
+void CT_MsgCopyPopSelection::CancelStep()
+	{
+	iOperation->Cancel();
+	}
+
+
+/**
+doTestStepL()
+A connection with the POP server is established in the doTestStepPreambleL of the 
+base class. Reads the Pop account name from the ini file. It obtains a selection of
+the entires under POP account given. It copies these entries into the specified target folder.
+ 
+@return
+Returns the test step result
+*/
+TVerdict CT_MsgCopyPopSelection::doTestStepL()
+	{
+	INFO_PRINTF1(_L("TestStep : CopyPopSelection"));
+	// Read the POP account name from the ini file
+	TPtrC popAccountName;
+	if(!GetStringFromConfig(ConfigSection(), KPopAccountName, popAccountName))
+		{
+		ERR_PRINTF1(_L("Pop Account Name is not specified"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		// Retrieving the Pop service Id for the given Pop account
+		TMsvId popServiceId = CT_MsgUtilsCentralRepository::GetPopServiceIdL((TDes&)popAccountName);
+		INFO_PRINTF2(_L("Pop service id is %d"),popServiceId);
+
+		if(popServiceId == KMsvNullIndexEntryId)
+			{
+			ERR_PRINTF1(_L("Invalid POP account name specified"));
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			TMsvId targetFolderId = KErrNotFound;
+			TBool copyWithinService = EFalse;
+			GetBoolFromConfig(ConfigSection(), KCopyWithinService, copyWithinService);
+
+			if (!copyWithinService)
+				{
+				TPtrC targetFolderName;
+				if(!GetStringFromConfig(ConfigSection(), KTargetFolderName, targetFolderName))
+					{
+					ERR_PRINTF1(_L("Target Folder is not specified"));
+					SetTestStepResult(EFail);
+					}
+				else
+					{
+					// Retrieves the folder Id based on the local folder name read from the ini file
+					targetFolderId = CT_MsgUtilsEnumConverter::FindFolderIdByName(targetFolderName);
+					if(targetFolderId == KErrNotFound)
+						{
+						ERR_PRINTF1(_L("Invalid local folder name specified"));
+						SetTestStepResult(EFail);
+						}
+					}
+				}
+
+			if (copyWithinService || targetFolderId != KErrNotFound)
+				{
+				// Get a selection of the children entries for the Pop account
+				CMsvEntrySelection* selection =  CT_MsgUtils::CreateChildrenSelectionL(iSharedDataPOP.iSession,
+																			popServiceId);
+				CleanupStack::PushL(selection);
+					
+				// Check if there are no entries under the remote folder 
+				TInt count = selection->Count();
+				if (count == 0)
+					{
+					User::Leave(KErrArgument);
+					}
+				// Fetch the Id of the first entry
+				TMsvId entryId = (*selection)[0];
+
+				// Creates a new CMsvEntry for the specified entry ID.
+				CMsvEntry* entry = CMsvEntry::NewL(*iSharedDataPOP.iSession,entryId,TMsvSelectionOrdering());
+				CleanupStack::PushL(entry);
+						
+				// Sets the context to the parent of the specified entry.
+				entry->SetEntryL(entryId);
+				entry->SetEntryL(entry->Entry().Parent());
+
+				TBool isMove = EFalse;
+				if(GetBoolFromConfig(ConfigSection(), KMove, isMove))
+					{
+					INFO_PRINTF1(_L("Is move"));
+					}
+
+				CT_MsgActive&	active=Active();
+
+				if (copyWithinService)
+					{
+					if (isMove)
+						{
+						iOperation = entry->MoveL(*selection,popServiceId, active.iStatus);
+						}
+					else
+						{
+						iOperation = entry->CopyL(*selection,popServiceId, active.iStatus);						
+						}
+					}
+				else
+					{
+					if (isMove)
+						{
+						iOperation = entry->MoveL(*selection,targetFolderId, active.iStatus);
+						}
+					else
+						{
+						iOperation = entry->CopyL(*selection,targetFolderId, active.iStatus);						
+						}
+					}
+
+				active.Activate();
+				CActiveScheduler::Start();
+
+				// Get the error code from TPop3Progress
+				TPop3Progress temp;
+				TPckgC<TPop3Progress> paramPack(temp);
+				paramPack.Set(iOperation->ProgressL());
+				TPop3Progress progress=paramPack();
+				SetTestStepError(progress.iErrorCode);
+
+				delete iOperation;
+				iOperation=NULL;
+				CleanupStack::PopAndDestroy(2,selection); //operation,entry,selection
+				User::LeaveIfError(active.Result());
+				}		
+			}
+		}
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_CreatePopAccount.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,157 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// CreatePopAccount
+// [Paramaters]
+// PopAccountName			: Name of the pop account which needs to be created
+// SettingsFileName		: Config file from which the pop account settings are read 
+// Creates a POP account in the Central Repository with the specified name and configuration settings file.
+// The settings file includes both POP settings,SMTP settings and IAP preference settings for both POP and SMTP.
+// [APIs Used]
+// CEmailAccounts::CreatePopAccountL
+// CEmailAccounts::CreateSmtpAccountL
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+
+// User include
+#include "T_CreatePopAccount.h"
+#include <t_utilsreademailsettingsfromconfigfile.h>
+
+
+// epoc includes
+#include <iapprefs.h>
+#include <smtpset.h>
+#include <pop3set.h>
+#include <cemailaccounts.h>
+
+
+// Literals used
+_LIT(KPopAccountName,"PopAccountName");
+_LIT(KPopConfigFileName,"PopConfigFileName");
+_LIT(KEmailAdd, "EmailAdd");
+
+/**
+CT_MsgCreatePopAccount()
+Sets the teststep name to KCreatePopAccount
+
+@param aSharedDataPOP
+Data shared across the POP test steps. Ex. Session
+*/
+CT_MsgCreatePopAccount::CT_MsgCreatePopAccount(CT_MsgSharedDataPop& aSharedDataPOP)
+:	CT_MsgSyncStepPOP(aSharedDataPOP) 
+	{
+	SetTestStepName(KCreatePopAccount);
+	}
+
+
+/**
+~CT_MsgCreatePopAccount()
+Destructor
+*/
+CT_MsgCreatePopAccount::~CT_MsgCreatePopAccount()
+	{
+	}
+
+
+/**
+doTestStepL()
+Reads the Pop account name and the settings file name from the ini file.
+Creates an Pop account by reading the settings from the given settings file
+  
+@return
+Returns the test step result
+*/
+TVerdict CT_MsgCreatePopAccount::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test Step: Create Pop Account"));
+	// Read Pop Account Name from ini file
+	TPtrC popAccountName;
+	TPtrC configFileName;
+	if(!GetStringFromConfig(ConfigSection(), KPopAccountName, popAccountName))
+		{
+		ERR_PRINTF1(_L("Pop Account name not specified"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		// Read the configuration file name
+		if(!GetStringFromConfig(ConfigSection(), KPopConfigFileName, configFileName))
+			{
+			ERR_PRINTF1(_L("Configuration file path is not specified"));
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			CEmailAccounts *emailAccounts = CEmailAccounts::NewLC();
+
+			// Create objects requried for POP account
+			CImIAPPreferences *popIapPreferences = CImIAPPreferences::NewLC();
+			
+			CImPop3Settings *popSettings = new (ELeave) CImPop3Settings;
+			CleanupStack::PushL(popSettings);
+
+			// Create objects requried for SMTP account
+			CImIAPPreferences *smtpIapPreferences = CImIAPPreferences::NewLC();
+			
+			CImSmtpSettings *smtpSettings = new (ELeave) CImSmtpSettings;
+			CleanupStack::PushL(smtpSettings);
+		
+			// Set the default POP and SMTP settings
+			emailAccounts->PopulateDefaultPopSettingsL(*popSettings, *popIapPreferences);
+			emailAccounts->PopulateDefaultSmtpSettingsL(*smtpSettings, *smtpIapPreferences);
+
+			// If the setting file name is provided as input, then read the Pop and Smtp settings from the config file
+			if(configFileName.CompareC(_L("none")) != 0)
+				{
+			
+				TPtrC ptrEmailAdd = KNone();
+				if(!GetStringFromConfig(ConfigSection(), KEmailAdd, ptrEmailAdd))
+					{
+					INFO_PRINTF1(_L("Email Address not specified"));
+					}
+				
+				TRAPD(err, CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadPopSettingsFromConfigurationFileL(configFileName, *popSettings, *popIapPreferences, ptrEmailAdd));
+				if(err)
+					{	
+					ERR_PRINTF2(_L("Failure while setting the POP/SMTP setting parameters, failed with error %d"), err);
+					SetTestStepResult(EFail);															  
+					}
+				else
+					{
+					TRAPD(error, CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadSmtpSettingsFromConfigurationFileL(configFileName, *smtpSettings, *smtpIapPreferences, ptrEmailAdd));
+					if(error)
+						{
+						ERR_PRINTF2(_L("Failure while setting the SMTP setting parameters, failed with error %d"), error);
+						SetTestStepResult(EFail);															  
+						}
+					}
+				}
+			if(TestStepResult() == EPass)
+				{
+				TPopAccount popAccount = emailAccounts->CreatePopAccountL(popAccountName, *popSettings,*popIapPreferences,EFalse);
+				TSmtpAccount smtpAccount = emailAccounts->CreateSmtpAccountL(popAccount, *smtpSettings, *smtpIapPreferences, EFalse);
+				emailAccounts->SetDefaultSmtpAccountL(smtpAccount);	
+				}
+			CleanupStack::PopAndDestroy(5,emailAccounts); // smtpSettings, smtpIapPreferences, popSettings, popIapPreferences, emailAccounts  
+			}
+		}
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_CreatePopAccountWithoutSmtp.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,116 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// CreatePopAccountWithoutSmtp
+// [Paramaters]
+// PopAccountName			:Name of the Pop account.
+// PopConfigFileName		:Config file from which the Pop account settings are read.
+// Creates a POP account in the Central Repository with the specified name using the 
+// settings read from the config file.
+// 
+//
+
+//User includes
+#include "T_CreatePopAccountWithoutSmtp.h"
+#include <t_utilsreademailsettingsfromconfigfile.h>
+
+//Epoc inlcudes
+#include <cemailaccounts.h>
+#include <iapprefs.h>
+#include <pop3set.h>
+
+//Literals used
+_LIT(KPopAccountName,"PopAccountName");
+_LIT(KPopConfigFileName,"PopConfigFileName");
+
+/**
+  Function : CT_MsgCreatePopAccountWithoutSmtp
+  Description : Constructor
+  @param : aSharedDataPOP Reference to CT_MsgSharedDataPop
+  @return : N/A
+*/
+CT_MsgCreatePopAccountWithoutSmtp::CT_MsgCreatePopAccountWithoutSmtp(CT_MsgSharedDataPop& aSharedDataPOP)
+:CT_MsgSyncStepPOP(aSharedDataPOP)
+	{
+	SetTestStepName(KCreatePopAccountWithoutSmtp);
+	}
+
+/**
+  Function : ReadIni
+  Description :Reads the corresponding .ini file and returns EPass or EFail if any of the inputs are missing
+  @return : TBool
+*/
+TBool CT_MsgCreatePopAccountWithoutSmtp::ReadIni()
+	{
+	TBool result = ETrue;
+	
+	if(!GetStringFromConfig(ConfigSection(), KPopAccountName, iPopAccountName))
+		{
+		ERR_PRINTF1(_L("Pop account name is not specified"));
+		SetTestStepResult(EFail);
+		result = EFalse;
+		}
+		
+	if(!GetStringFromConfig(ConfigSection(), KPopConfigFileName, iConfigFileName))
+		{
+		ERR_PRINTF1(_L("Configuration file path is not specified"));
+		SetTestStepResult(EFail);
+		}
+		
+	return result;
+	}
+
+/**
+  Function : doTestStepL
+  Description : Reads the Pop account name and the settings file name from the .ini file
+				and then creates a Pop account.
+  @return : TVerdict - Test step result
+*/
+TVerdict CT_MsgCreatePopAccountWithoutSmtp::doTestStepL()
+	{
+	
+	INFO_PRINTF1(_L("Test Step : CreatePopAccountWithoutSmtp"));
+	if(ReadIni())
+		{
+		CEmailAccounts*	emailAccounts = CEmailAccounts::NewLC();
+		
+		// Creates objects requried for POP account
+		CImIAPPreferences *popIapPreferences = CImIAPPreferences::NewLC();
+		CImPop3Settings *popSettings = new (ELeave) CImPop3Settings;
+		CleanupStack::PushL(popSettings);
+
+		// Populates the default POP settings
+		emailAccounts->PopulateDefaultPopSettingsL(*popSettings, *popIapPreferences);
+
+		//If the config file name is provided as input, then reads the POP settings from it
+		if(iConfigFileName.CompareF( _L("none") ) != 0)
+			{
+			TRAPD(err, CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadPopSettingsFromConfigurationFileL(iConfigFileName, *popSettings, *popIapPreferences));
+			if(err)
+				{
+				ERR_PRINTF2(_L("Failure while setting the POP settings, failed with error %d"), err);
+				SetTestStepError(err);
+				CleanupStack::PopAndDestroy(3,emailAccounts); // popSettings, popIapPreferences, emailAccounts
+				return TestStepResult();														  
+				}
+			if(TestStepResult() == EPass)
+				{
+				// Creates the POP account for the name specified and for the settings objects
+				TPopAccount popAccount = emailAccounts->CreatePopAccountL(iPopAccountName, *popSettings,*popIapPreferences,EFalse);
+				}
+			}
+		CleanupStack::PopAndDestroy(3,emailAccounts); // popSettings, popIapPreferences, emailAccounts
+		}
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_DeleteAllPopChildren.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,188 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// DeleteAllPopChildren
+// [Paramaters]
+// PopAccountName			:			Name of the Pop Account
+// [Action Description]
+// Deletes all children entries for the remote Pop account
+// [APIs Used]
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+
+//User Includes
+#include "T_DeleteAllPopChildren.h"
+#include <t_utilsdeleteallchildren.h>
+#include <t_utilscentralrepository.h>
+#include "T_MsgSharedDataPop.h"
+
+
+//epoc includes
+#include <barsc.h>
+#include <bautils.h>
+#include <msgs.rsg>
+
+
+// Literals Used
+_LIT(KPopAccountName,"PopAccountName");
+_LIT(KBlockDelete, "BlockDelete");
+
+
+/**
+CT_MsgDeleteAllPopChildren()
+Sets the teststep name to KDeleteAllPopChildren
+
+@param aSharedDataPOP
+Data shared across the POP test steps. Ex. Session
+*/
+CT_MsgDeleteAllPopChildren::CT_MsgDeleteAllPopChildren(CT_MsgSharedDataPop& aSharedDataPOP)
+:	CT_MsgAsyncStepPOP(aSharedDataPOP)
+,	iUtil(NULL)
+	{
+	SetTestStepName(KDeleteAllPopChildren);
+	}
+
+
+/**
+NewL()
+Allocates and creates a new CT_MsgDeleteAllPopChildren object
+
+@param aSharedDataPOP
+Data shared across the POP test steps. Ex. Session
+
+@return
+Returns pointer to an object of CT_MsgDeleteAllPopChildren
+*/
+CT_MsgDeleteAllPopChildren* CT_MsgDeleteAllPopChildren::NewL(CT_MsgSharedDataPop& aSharedDataPOP)
+	{
+	CT_MsgDeleteAllPopChildren* self = new(ELeave) CT_MsgDeleteAllPopChildren(aSharedDataPOP);
+	CleanupStack::PushL(self);
+	self->ConstructL(); 					 // Call CT_AsyncStep::ConstructL()
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+
+/**
+~CT_MsgDeleteAllPopChildren()
+Destructor
+*/
+CT_MsgDeleteAllPopChildren::~CT_MsgDeleteAllPopChildren()
+	{
+	if(iUtil!=NULL)
+		{
+		delete iUtil;
+		iUtil=NULL;
+		}
+	}
+
+
+/**
+ProgressL()
+
+@param
+*/
+void CT_MsgDeleteAllPopChildren::ProgressL(TBool bFinal)
+	{
+	//	TODO
+	if (bFinal)
+		{
+		//	Display final progress iUtil
+		}
+	else
+		{
+		//	Display current progress iUtil
+		}
+	}
+
+
+/**
+CancelStep()
+
+@param
+*/
+void CT_MsgDeleteAllPopChildren::CancelStep()
+	{
+	//	TODO cancel iUtil
+	}
+
+
+/**
+doTestStepL()
+Reads the Pop account name from the ini file. It obtains a selection of the 
+enries under the account and calls theT_UtilsDeleteAllChildren to delete them
+
+@return
+Returns the test step result
+*/
+TVerdict CT_MsgDeleteAllPopChildren::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test Step : DeleteAllChildren "));
+	// Read the POP account name from the ini file
+	TPtrC popAccountName;
+	if(!GetStringFromConfig(ConfigSection(), KPopAccountName, popAccountName))
+		{
+		ERR_PRINTF1(_L("Pop Account Name is not specified"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		// Retrieving the Pop service Id for the given Pop account
+		TMsvId popServiceId = CT_MsgUtilsCentralRepository::GetPopServiceIdL((TDes&)popAccountName);
+		INFO_PRINTF2(_L("Pop service id is %d"),popServiceId);
+		if(popServiceId == KMsvNullIndexEntryId)
+			{
+			ERR_PRINTF1(_L("Invalid POP account name specified"));
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			if(iUtil==NULL)
+				{
+				iUtil = new (ELeave) CT_MsgUtilsDeleteAllChildren(iSharedDataPOP.iSession,popServiceId);
+				}
+
+			CT_MsgActive&	active=Active();
+			// Deletes all the entries under the remote folder
+
+			TBool blockDelete = EFalse;
+			GetBoolFromConfig(ConfigSection(), KBlockDelete, blockDelete);
+			if (blockDelete)
+				{
+				INFO_PRINTF1(_L("Using block delete"));
+				}
+
+			iUtil->StartL(blockDelete, active.iStatus);
+			active.Activate();
+			CActiveScheduler::Start();
+			delete iUtil;
+			iUtil=NULL;
+			
+			TInt err = active.Result();
+			if (err != KErrNone)
+				{
+				SetTestStepResult(EFail);
+				SetTestStepError(err);
+				}
+			}
+		}
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_DeletePopAccount.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,136 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// DeletePopAccount
+// [Paramaters]
+// PopAccountName		<input>	: Name of the Pop account to be Deleted
+// For deleteing all the Pop accounts "all" can be used 
+// and it is case insensitive.
+// [Test Step Description]
+// Deletes the Pop account(s) in the Central Repository 
+// [APIs Used]
+// CEmailAccounts::DeletePopAccountL
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+
+// User include
+#include "T_DeletePopAccount.h"
+
+
+// epoc inlcudes
+#include<cemailaccounts.h>
+
+// Literals used
+_LIT(KPopAccountName,"PopAccountName");
+
+
+/**
+CT_MsgDeletePopAccount()
+Sets the teststep name to KDeletePopAccount
+  
+@param aSharedDataPOP
+Data shared across the POP test steps. Ex. Session
+*/
+CT_MsgDeletePopAccount::CT_MsgDeletePopAccount(CT_MsgSharedDataPop& aSharedDataPOP)
+:	CT_MsgSyncStepPOP(aSharedDataPOP) 
+	{
+	SetTestStepName(KDeletePopAccount);
+	}
+
+/**
+~CT_MsgDeletePopAccount()
+Destructor
+*/
+CT_MsgDeletePopAccount::~CT_MsgDeletePopAccount()
+	{
+	}
+
+
+
+/**
+doTestStepL()
+Reads the POP account name from the ini file. If ALL string is mentioned in the .ini file 
+it deletes all the IMAP accounts, Else deletes the IMAP account whose name is 
+mentioned in the ini file
+
+@return
+Returns the test step result
+*/
+TVerdict CT_MsgDeletePopAccount::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test Step: Delete Pop Account"));
+	TPtrC popAccountName;
+	// Read Pop Account Name from ini file
+	if(!GetStringFromConfig(ConfigSection(), KPopAccountName, popAccountName))
+		{
+		ERR_PRINTF1(_L("Account name not specified"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{	
+		CEmailAccounts* account = CEmailAccounts::NewLC();
+		
+		RArray<TPopAccount> arrayPop3Accounts;
+		CleanupClosePushL(arrayPop3Accounts);
+		account->GetPopAccountsL(arrayPop3Accounts);
+		TInt count=arrayPop3Accounts.Count();
+		
+		TBuf<12> temp(popAccountName);
+		temp.UpperCase();	// Making case insensitive
+		if(temp.CompareC(_L("ALL")) == 0)
+			{
+			INFO_PRINTF2(_L("Deleting all accounts. Total = %d"), count);
+			for(TInt i=0; i<count; i++)
+				{
+				TPopAccount id = arrayPop3Accounts[i];
+				account->DeletePopAccountL(id);
+				}
+			}			
+		else 
+			{
+			TBool deleteFlag = EFalse;
+			for(TInt i = 0; i < count; i++)
+				{
+				if(popAccountName.CompareC(arrayPop3Accounts[i].iPopAccountName) == 0)
+					{
+					account->DeletePopAccountL(arrayPop3Accounts[i]);
+					// Just ensure that if we try to delete it again we hopefuly get an error
+					// or can see that it has been deleted.
+					arrayPop3Accounts.Remove(i);
+					deleteFlag = ETrue;
+					break;					
+					}
+				}
+			if(deleteFlag)
+				{
+				INFO_PRINTF2(_L("Pop acount \" %S \" deleted"), &popAccountName);	
+				}
+			else
+				{
+				ERR_PRINTF2(_L("Pop acount \" %S \" not found"), &popAccountName);
+				SetTestStepResult(EFail);
+				User::Leave(KErrNotFound);
+				}
+			}
+		CleanupStack::PopAndDestroy(2, account);	//arrayPop3Accounts,account
+		}
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_DisconnectPop3Server.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,165 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// DisConnectPop3Server
+// [Paramaters]
+// PopAccountName			<input>	: Name of the Pop account
+// DisConnects to the Pop3 Server
+// [APIs Used]
+// CMsvEntry::SetEntryL
+// CMsvEntrySelection::AppendL
+// CPop3ClientMtm::InvokeAsyncFunctionL
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+// User Includes
+#include "T_DisConnectPop3Server.h"
+#include <t_utilscentralrepository.h>
+
+
+// Epoc includes
+#include <pop3cmds.h>
+
+
+// Literals Used
+_LIT(KPopAccountName,"PopAccountName");
+const TInt KMaxLenghtOfChar= 1;
+
+/**
+CT_MsgDisConnectPop3Server()
+Sets the teststep name to KDisConnectPop3Server
+  
+@param aSharedDataPOP
+Data shared across the POP test steps. Ex. Session
+*/
+CT_MsgDisConnectPop3Server::CT_MsgDisConnectPop3Server(CT_MsgSharedDataPop& aSharedDataPOP)
+:	CT_MsgAsyncStepPOP(aSharedDataPOP) 
+,	iOperation(NULL)
+	{
+	SetTestStepName(KDisConnectPop3Server);
+	}
+
+
+/**
+NewL()
+Allocates and creates a new CT_MsgDisConnectPop3Server object 
+  
+@param aSharedDataPOP
+Data shared across the POP test steps. Ex. Session
+
+@leave KErrNoMemory
+@return
+Returns pointer to an object of CT_MsgDisConnectPop3Server
+*/
+CT_MsgDisConnectPop3Server* CT_MsgDisConnectPop3Server::NewL(CT_MsgSharedDataPop& aSharedDataPOP)
+	{
+	CT_MsgDisConnectPop3Server* self = new(ELeave) CT_MsgDisConnectPop3Server(aSharedDataPOP);
+	CleanupStack::PushL(self);
+	self->ConstructL(); 					 // Call CT_AsyncStep::ConstructL()
+	CleanupStack::Pop(self);
+	return self;
+	}		
+
+
+/**
+~CT_MsgDisConnectPop3Server()
+Destructor
+*/
+CT_MsgDisConnectPop3Server::~CT_MsgDisConnectPop3Server()
+	{
+	delete iOperation;
+	iOperation=NULL;
+	}
+
+
+/**
+ProgressL()
+
+@param
+*/
+void CT_MsgDisConnectPop3Server::ProgressL(TBool bFinal)
+	{
+	//	TODO
+	if (bFinal)
+		{
+		//	Display final progress iOperation
+		}
+	else
+		{
+		//	Display current progress iOperation
+		}
+	}
+
+
+/**
+CancelStep()
+
+@param
+*/
+void CT_MsgDisConnectPop3Server::CancelStep()
+	{
+	iOperation->Cancel();
+	}
+
+/**
+doTestStepL()
+Reads the  Pop account name from the ini file. It establishes disconnection with the Pop server.
+
+@return
+Returns the test step result
+*/
+TVerdict CT_MsgDisConnectPop3Server::doTestStepL()
+	{	
+	INFO_PRINTF1(_L(" Test Step : DisConnectPop3Server"));
+	TPtrC popAccountName;
+	if(!GetStringFromConfig(ConfigSection(), KPopAccountName, popAccountName))
+		{
+		ERR_PRINTF1(_L("Pop Account Name is not specified"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		// Retrieving the Pop service Id for the given Pop account
+		TMsvId popServiceId = CT_MsgUtilsCentralRepository::GetPopServiceIdL((TDes&)popAccountName);
+		INFO_PRINTF2(_L("Pop service id is %d"),popServiceId);
+
+		// Change the current context
+		iSharedDataPOP.iMtm->SwitchCurrentEntryL(popServiceId);
+
+		CMsvEntrySelection* selection = new (ELeave) CMsvEntrySelection;
+		CleanupStack::PushL(selection);
+
+		// Appends the popServiceId onto the end of the array
+		selection->AppendL(popServiceId);
+		
+		TBuf8<KMaxLenghtOfChar> param;
+
+		// Attempts to DisConnect to the Pop3 Service
+		CT_MsgActive&	active=Active();
+		iOperation = iSharedDataPOP.iMtm->InvokeAsyncFunctionL(KPOP3MTMDisconnect, *selection, param, active.iStatus);
+		active.Activate();
+		CActiveScheduler::Start();
+		delete iOperation;
+		iOperation=NULL;
+		CleanupStack::PopAndDestroy(selection); //operation,selection
+		User::LeaveIfError(active.Result());
+		}
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_ModifyPopSettings.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,204 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// ModifyPopSettings
+// [Paramaters]
+// PopAccountName		:		Name of the Pop account
+// ConfigFileName		:		Config file from which the Pop account settings are read 
+// [Test Step Description]
+// ModifyPopSettings Test Action is intended to modify and save the existing settings to CenRep 
+// for the specified Pop account Id
+// [APIs Used]	
+// CEmailAccounts::ModifyPopSettingsL
+// CImPop3Settings::SetServerAddressL
+// CImPop3Settings::SetUserAddressL
+// CImPop3Settings::SetLoginNameL
+// CImPop3Settings::SetPasswordL
+// CImPop3Settings::SetPort
+// CImPop3Settings::SetSecureSockets
+// CImPop3Settings::SetVersion
+// CImPop3Settings::SetFolderPathL
+// CImPop3Settings::SetPathSeparator
+// CImPop3Settings::SetMaxEmailSize
+// CImPop3Settings::SetGetMailOptions
+// CImPop3Settings::SetInboxSynchronisationLimit
+// CImPop3Settings::SetMailboxSynchronisationLimit
+// CImSmtpSettings::SetServerAddressL
+// CImSmtpSettings::SetEmailAddressL
+// CImSmtpSettings::SetBodyEncoding
+// CImSmtpSettings::SetReceiptAddressL
+// CImSmtpSettings::SetRequestReceipts
+// CImSmtpSettings::SetSendMessageOption
+// CImSmtpSettings::SetPort
+// CImSmtpSettings::SetEmailAliasL
+// CImSmtpSettings::SetBodyEncoding
+// CImSmtpSettings::SetDefaultMsgCharSet
+// CImSmtpSettings::SetUserAddress
+// CImSmtpSettings::SetVersion
+// CImIAPPreferences::Version
+// CImIAPPreferences::AddIAPL 
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+
+
+// User include
+#include "T_ModifyPopSettings.h"
+#include <t_utilsreademailsettingsfromconfigfile.h>
+#include <t_utilscentralrepository.h>
+
+
+
+// epoc inlcudes
+#include <cemailaccounts.h>
+#include <pop3set.h>
+#include <iapprefs.h>
+#include <smtpset.h>
+
+
+
+// Literals used
+_LIT(KPopAccountName,"PopAccountName");
+_LIT(KPopConfigFileName,"PopConfigFileName");
+
+
+/**
+CT_MsgModifyPopSettings()
+Sets the teststep name to KModifyPopSettings
+
+@param aSharedDataPOP
+Data shared across the POP test steps. Ex. Session
+*/
+CT_MsgModifyPopSettings::CT_MsgModifyPopSettings(CT_MsgSharedDataPop& aSharedDataPOP)
+:	CT_MsgSyncStepPOP(aSharedDataPOP) 
+	{
+	SetTestStepName(KModifyPopSettings);
+	}
+
+
+/**
+~CT_MsgModifyPopSettings()
+Destructor
+*/
+CT_MsgModifyPopSettings::~CT_MsgModifyPopSettings()
+	{
+	}
+
+
+/**
+doTestStepL()
+Reads the Pop account name, config file name from the ini file.
+It then modifies the account settings with the settings read from the config file
+
+@return
+Returns the test step result
+*/
+TVerdict CT_MsgModifyPopSettings::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test Step: ModifyPopSettings"));
+	// Read the Pop account name from the ini file
+	TPtrC popAccountName;
+	if(!GetStringFromConfig(ConfigSection(), KPopAccountName, popAccountName))
+		{
+		ERR_PRINTF1(_L("PopAccount Name is not specified"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		TPtrC configFileName;
+		if(!GetStringFromConfig(ConfigSection(), KPopConfigFileName, configFileName))
+			{
+			ERR_PRINTF1(_L("Configuration file path is not specified"));
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			// Retrieving the Pop service Id for the given Pop account
+			TMsvId popServiceId = CT_MsgUtilsCentralRepository::GetPopServiceIdL((TDes&)popAccountName);
+			INFO_PRINTF2(_L("Pop service id is %d"),popServiceId);
+			
+			if(popServiceId == KMsvNullIndexEntryId)
+				{
+				ERR_PRINTF1(_L("Invalid POP account name specified"));
+				SetTestStepResult(EFail);
+				}
+			else
+				{
+				CEmailAccounts* emailAccounts = CEmailAccounts::NewLC();
+
+				CImPop3Settings* popSettings = new(ELeave) CImPop3Settings();
+				CleanupStack::PushL(popSettings);
+				
+				CImIAPPreferences* popIapPrefs = CImIAPPreferences::NewLC();
+				
+				CImSmtpSettings* smtpSettings = new(ELeave) CImSmtpSettings();
+				CleanupStack::PushL(smtpSettings);
+
+				CImIAPPreferences* smtpIapPrefs = CImIAPPreferences::NewLC();				
+				
+				TPopAccount popAccount;
+				emailAccounts->GetPopAccountL(popServiceId, popAccount);
+				
+				emailAccounts->PopulateDefaultPopSettingsL(*popSettings, *popIapPrefs);
+				emailAccounts->PopulateDefaultSmtpSettingsL(*smtpSettings, *smtpIapPrefs);
+
+				_LIT(KEmailAdd, "EmailAdd");
+				
+				TPtrC ptrEmailAdd;
+				if(!GetStringFromConfig(ConfigSection(), KEmailAdd, ptrEmailAdd))
+					{
+					ERR_PRINTF1(_L("Email Address not specified"));
+					}
+				
+				TRAPD(err, CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadPopSettingsFromConfigurationFileL(configFileName, *popSettings, *popIapPrefs, ptrEmailAdd));
+				if(err)
+					{	
+					ERR_PRINTF2(_L("Failure while setting the Pop setting parameters, failed with error %d"), err);
+					SetTestStepResult(EFail);															  
+					}
+				else
+					{
+					TRAPD(error, CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadSmtpSettingsFromConfigurationFileL(configFileName, *smtpSettings, *smtpIapPrefs, ptrEmailAdd));
+					if(error)
+						{
+						ERR_PRINTF2(_L("Failure while setting the SMTP setting parameters, failed with error %d"), error);
+						SetTestStepResult(EFail);															  
+						}
+					else
+						{												
+						// Save the new settings
+						emailAccounts->SavePopSettingsL(popAccount, *popSettings);
+						emailAccounts->SavePopIapSettingsL(popAccount, *popIapPrefs);
+					
+						TSmtpAccount smtpAccount;
+						emailAccounts->GetSmtpAccountL(popAccount.iSmtpService, smtpAccount);											
+				
+						emailAccounts->SaveSmtpSettingsL(smtpAccount, *smtpSettings);
+						emailAccounts->SaveSmtpIapSettingsL(smtpAccount, *smtpIapPrefs);
+						}
+					}
+				CleanupStack::PopAndDestroy(5, emailAccounts); //smtpIapPrefs,smtpSettings,popIapPrefs,popSettings,emailAccounts
+				}
+			}
+		}
+	return TestStepResult();
+	}
+	
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_ModifyPopSettings2.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,130 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// ModifyPopSettings2
+// [Paramaters]
+// PopAccountName			:Name of the Pop account
+// PopConfigFileName		:Config file from which the Pop account settings are read 
+// ModifyPopSettings2 Test Step is intended to modify existing settings and save to CenRep 
+// for the specified POP account Id
+// 
+//
+
+/* user includes */
+#include "T_ModifyPopSettings2.h"
+#include <t_utilsreademailsettingsfromconfigfile.h>
+#include <t_utilscentralrepository.h>
+
+/* epoc inlcudes */
+#include <cemailaccounts.h>
+#include <pop3set.h>
+#include <iapprefs.h>
+
+/* Literals used */
+_LIT(KPopAccountName,"PopAccountName");
+_LIT(KPopConfigFileName,"PopConfigFileName");
+
+/**
+  Function : CT_MsgModifyPopSettings2
+  Description : Constructor
+  @param : aSharedDataPOP Reference to CT_MsgSharedDataPop
+  @return : N/A
+*/
+CT_MsgModifyPopSettings2::CT_MsgModifyPopSettings2(CT_MsgSharedDataPop& aSharedDataPOP)
+:	CT_MsgSyncStepPOP(aSharedDataPOP)
+	{
+	SetTestStepName(KModifyPopSettings2);
+	}
+	
+/**
+  Function : ~CT_MsgModifyPopSettings2
+  Description : Destructor
+  @return : N/A
+*/
+CT_MsgModifyPopSettings2::~CT_MsgModifyPopSettings2()
+	{
+	}
+
+/**
+  Function : doTestStepL
+  Description : Reads the Pop account name and config file name from the .ini file
+				 and it then modifies the account with the settings read from the config file.
+  @return : TVerdict - Test step result
+  @leave  : KMsvNullIndexEntryId	Invalid POP account name specified	
+*/
+TVerdict CT_MsgModifyPopSettings2::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test Step: ModifyPopSettings2"));
+	// Read the POP account name from the ini file
+	TPtrC popAccountName;
+	if(!GetStringFromConfig(ConfigSection(), KPopAccountName, popAccountName))
+		{
+		ERR_PRINTF1(_L("POP account name is not specified"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		// Read the POP Config file name from the ini file
+		TPtrC configFileName;
+		if(!GetStringFromConfig(ConfigSection(), KPopConfigFileName, configFileName))
+			{
+			ERR_PRINTF1(_L("Configuration file path is not specified"));
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			// Retrieving the POP service Id for the given POP account
+			TMsvId popServiceId = CT_MsgUtilsCentralRepository::GetPopServiceIdL((TDes&)popAccountName);
+			INFO_PRINTF2(_L("POP service Id is %d"),popServiceId);
+			
+			if(popServiceId == KMsvNullIndexEntryId)
+				{
+				ERR_PRINTF1(_L("Invalid POP account name specified"));
+				SetTestStepResult(EFail);
+				}
+			// Creates the settings object
+			else
+				{
+				CEmailAccounts* emailAccounts = CEmailAccounts::NewLC();
+
+				CImPop3Settings* popSettings = new(ELeave) CImPop3Settings();
+				CleanupStack::PushL(popSettings);
+				
+				CImIAPPreferences* popIapPrefs = CImIAPPreferences::NewLC();
+
+				// Loads the settings for the account with the current settings
+				TPopAccount popAccount;
+				emailAccounts->GetPopAccountL(popServiceId, popAccount);
+				emailAccounts->LoadPopSettingsL(popAccount, *popSettings);
+				emailAccounts->LoadPopIapSettingsL(popAccount, *popIapPrefs);
+
+				// Reads the settings from the config file
+				TRAPD(err, CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadPopSettingsFromConfigurationFileL(configFileName, *popSettings, *popIapPrefs));
+				if(err)
+					{	
+					ERR_PRINTF2(_L("Failure while setting the POP setting parameters, failed with error %d"), err);
+					SetTestStepError(err);															  
+					}
+				else
+					{
+					// Saves the new settings
+					emailAccounts->SavePopSettingsL(popAccount, *popSettings);
+					emailAccounts->SavePopIapSettingsL(popAccount, *popIapPrefs);
+					}
+				CleanupStack::PopAndDestroy(3, emailAccounts);// popIapPrefs,popSettings,emailAccounts
+				}
+			}
+		}
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_MsgAsyncStepPOP.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,41 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [Test Step] :
+// AsyncStepPOP
+// References POP shared data for use by derived test steps.
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+// User includes
+#include "T_MsgAsyncStepPOP.h"
+
+
+/**
+CT_MsgAsyncStepPOP()
+Intialises the shared data
+
+@param aSharedDataPOP
+Data shared across the POP test steps. Ex. Session
+*/
+CT_MsgAsyncStepPOP::CT_MsgAsyncStepPOP(CT_MsgSharedDataPop& aSharedDataPOP)
+:	CT_MsgAsyncStep()
+,	iSharedDataPOP(aSharedDataPOP)
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_MsgSharedDataPop.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,88 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+*/
+
+// user include
+#include "T_MsgSharedDataPop.h"
+
+
+// epoc includes
+#include <miutset.h>
+
+
+/**
+NewL()
+Allocates and creates a new CT_MsgSharedDataPop object
+
+@leave KErrNoMemory
+@return
+Returns pointer to an object of CT_MsgComparePopEmailMsgs
+*/
+CT_MsgSharedDataPop* CT_MsgSharedDataPop::NewL()
+	{
+	CT_MsgSharedDataPop* self = new(ELeave) CT_MsgSharedDataPop();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+/**
+  ConstructL()
+  Second phage constructor
+*/
+void CT_MsgSharedDataPop::ConstructL()
+{
+	CT_MsgSharedDataBase::ConstructL();
+	iPeriodic 		= CPeriodic::New(EPriorityHigh);
+ 	iMaxRamValue 	= 0;
+ 	iMinRamValue 	= 0;
+ 	iStartRamValue 	= 0;
+ 	iEndRamValue 	= 0;
+ 	iMark			= ETrue;
+}
+
+/**
+NewMtmL()
+ 
+@return
+Returns a pointer to Client-side MTM object
+*/
+CBaseMtm* CT_MsgSharedDataPop::NewMtmL()	
+	{
+	return iRegistry->NewMtmL(KUidMsgTypePOP3);	
+	}
+
+/**
+CT_MsgSharedDataPop()
+Construstor
+*/
+CT_MsgSharedDataPop::CT_MsgSharedDataPop()
+	{
+	}
+
+/**
+  ~CT_MsgSharedDataPop()
+  Destructor
+*/
+CT_MsgSharedDataPop::~CT_MsgSharedDataPop()
+	{
+	delete iPeriodic;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_MsgSyncStepPOP.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,50 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [Test Step] :
+// MsgSyncStepPOP
+// References POP shared data for use by derived test steps.
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+// User includes
+#include "T_MsgSyncStepPop.h"
+
+
+/**
+CT_MsgSyncStepPOP()
+Constructor
+
+@param aSharedDataPOP
+Data shared across the POP test steps. Ex. Session
+*/
+CT_MsgSyncStepPOP::CT_MsgSyncStepPOP(CT_MsgSharedDataPop& aSharedDataPOP)
+:	CT_MsgStep()
+,	iSharedDataPOP(aSharedDataPOP)
+	{
+	}
+
+
+/**
+~CT_MsgSyncStepPOP()
+Destructor
+*/
+CT_MsgSyncStepPOP::~CT_MsgSyncStepPOP()
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_PopInvokeAsyncFunction.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,223 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// PopInvokeAsyncFunction
+// [Parameters]
+// PopAccountName		:		Name of the pop account
+// EmailSize			:		The maximum emailsize
+// PopLimit			:		The population limit
+// PopCommand			:		The POP command to be executed
+// Reads the Pop account name,maximun email size,population limit and the pop command 
+// name to be executed.Based on the command it calls a utility to establish connection 
+// the POP server, executes the POP command and then based on the command again
+// disconnects with the POP server.
+// [APIs Used]
+// CMsvEntry:: GetEntryL
+// CBaseMtm :: SwitchCurrentEntryL
+// CMsvEntry:: ChildrenL
+// CBaseMtm :: InvokeAsyncFunctionL
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+
+
+// User Includes
+#include "T_PopInvokeAsyncFunction.h"
+#include <t_utilsenumconverter.h>
+#include <t_utilscentralrepository.h>
+#include "T_PopServer.h"
+#include "T_MsgSharedDataPop.h"
+
+// Epoc includes
+#include <miutset.h>
+
+
+// Literals Used
+_LIT(KPopAccountName,"PopAccountName");
+_LIT(KEmailSize,"EmailSize");
+_LIT(KPopLimit,"PopLimit");
+_LIT(KPopCommand,"PopCommand");
+
+
+typedef TPckgBuf<TImPop3PopulateOptions> TPop3MailInfoBuf;
+
+
+/**
+CT_MsgModifyPopSettings()
+Sets the teststep name to KPopInvokeAsyncFunction
+
+@param aSharedDataPOP
+Data shared across the POP test steps. Ex. Session
+*/
+CT_MsgPopInvokeAsyncFunction::CT_MsgPopInvokeAsyncFunction(CT_MsgSharedDataPop& aSharedDataPOP)
+:	CT_MsgAsyncStepPOP(aSharedDataPOP)
+,	iOperation(NULL)
+	{
+	SetTestStepName(KPopInvokeAsyncFunction);
+	}
+
+
+/**
+NewL()
+Allocates and creates a new CT_MsgPopInvokeAsyncFunction object
+
+@param aSharedDataPOP
+Data shared across the POP test steps. Ex. Session
+
+@leave KErrNoMemory
+@return
+Returns pointer to an object of CT_MsgPopInvokeAsyncFunction
+*/
+CT_MsgPopInvokeAsyncFunction* CT_MsgPopInvokeAsyncFunction::NewL(CT_MsgSharedDataPop& aSharedDataPOP)
+	{
+	CT_MsgPopInvokeAsyncFunction* self = new(ELeave) CT_MsgPopInvokeAsyncFunction(aSharedDataPOP);
+	CleanupStack::PushL(self);
+	self->ConstructL(); 					 // Call CT_AsyncStep::ConstructL()
+	CleanupStack::Pop(self);
+	return self;
+	}	
+	
+
+/**
+~CT_MsgPopInvokeAsyncFunction()
+Destructor
+*/
+CT_MsgPopInvokeAsyncFunction::~CT_MsgPopInvokeAsyncFunction()
+	{
+	delete iOperation;
+	iOperation=NULL;
+	}
+
+
+/**
+ProgressL()
+
+@param
+*/
+void CT_MsgPopInvokeAsyncFunction::ProgressL(TBool bFinal)
+	{
+	//	TODO
+	if ( bFinal )
+		{
+		//	Display final progress iOperation
+		}
+	else
+		{
+		//	Display current progress iOperation
+		}
+	}
+
+
+/**
+CancelStep()
+
+@param
+*/
+void CT_MsgPopInvokeAsyncFunction::CancelStep()
+	{
+	iOperation->Cancel();
+	}
+
+
+/**
+doTestStepL()
+Reads the POP account name,population limit,maximum email size from the ini file
+Based on the command decides whether a connection is required.
+It then calls the InvokeAsyncFunctionL with the given command.
+Based on the command again calls the utility to disconnect fromt the POP server
+
+@return
+Returns the test step result
+*/
+TVerdict CT_MsgPopInvokeAsyncFunction::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test Step : Invoke Async Function"));
+
+	TPtrC popAccountName;
+	if(!GetStringFromConfig(ConfigSection(), KPopAccountName, popAccountName))
+		{
+		ERR_PRINTF1(_L("Account name not specified"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+
+		// Retrieving the Pop service Id for the given Pop account
+		TMsvId popServiceId = CT_MsgUtilsCentralRepository::GetPopServiceIdL((TDes&)popAccountName);
+
+		// Read the maximum email size from the ini file
+		TInt maxEmailSize;
+		GetIntFromConfig(ConfigSection(), KEmailSize, maxEmailSize); 
+
+		// Read the population limit from the ini file
+		TInt popLimit;
+		GetIntFromConfig(ConfigSection(), KPopLimit, popLimit);
+
+		// Read the pop command to be executed from the ini file
+		TPtrC popCmdName;
+		if(!GetStringFromConfig(ConfigSection(),KPopCommand,popCmdName))
+			{
+			ERR_PRINTF1(_L("Pop command not specified"));
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			
+			// Changes the entry on which later actions are performed to the entry of the Pop Service Id.
+			iSharedDataPOP.iMtm->SwitchCurrentEntryL(popServiceId); //base Class Member iMtm
+			TPop3Cmds  popCommand = CT_MsgUtilsEnumConverter::ConvertDesToTPop3Cmds(popCmdName);
+			// Accesses the entry for the specified Pop Service Id.
+			CMsvEntry* entry = iSharedDataPOP.iSession->GetEntryL(popServiceId); //base Class Member iSession
+			entry->SetEntryL(popServiceId);
+			CleanupStack::PushL(entry);
+
+			// Create a selection of the children entries  
+			CMsvEntrySelection* selection = entry->ChildrenL();
+			CleanupStack::PushL(selection); 
+			
+	
+			//setting the max email size and populationlimit to the values read from the ini file
+			iMailInfo.SetMaxEmailSize(static_cast<TInt32>(maxEmailSize));
+			iMailInfo.SetPopulationLimit(static_cast<TInt32>(popLimit));
+
+			TPop3MailInfoBuf pack(iMailInfo);
+			selection->InsertL(0, popServiceId);
+
+			CT_MsgActive&	active=Active();
+			iOperation = iSharedDataPOP.iMtm->InvokeAsyncFunctionL( popCommand,
+											*selection, pack, active.iStatus ); //base Class Member iMtm, waiter
+			active.Activate();
+			CActiveScheduler::Start();
+
+			// Get the error code from TPop3Progress
+			TPop3Progress temp;
+			TPckgC<TPop3Progress> paramPack(temp);
+			paramPack.Set(iOperation->ProgressL());
+			TPop3Progress progress=paramPack();
+			SetTestStepError(progress.iErrorCode);
+
+			delete iOperation;
+			iOperation=NULL;
+			CleanupStack::PopAndDestroy(2,entry);   // operation,selection,entry
+			User::LeaveIfError(active.Result());
+			}
+		}	
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_PopServer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,255 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+// User includes
+#include "T_MsgServer.h"
+#include "T_PopServer.h"
+#include "T_MsgSharedDataPop.h"
+
+// Header files of Test Steps POP
+#include "T_CreatePopAccount.h"
+#include "T_DeletePopAccount.h"
+#include "T_VerifyPopAccountsCount.h"
+#include "T_ModifyPopSettings.h"
+#include "T_ComparePopSettings.h"
+#include "T_VerfiyPopSettings.h"
+#include "T_ConnectPop3Server.h"
+#include "T_DisConnectPop3Server.h"
+#include "T_ComparePopEmailMsgs.h"
+#include "T_CopyPopSelection.h"
+#include "T_PopInvokeAsyncFunction.h"
+#include "T_DeleteAllPopChildren.h"
+#include "T_CheckChildrenCountPop.h"
+#include "T_StartRamUsageTimer.h"
+#include "T_StopRamUsageTimer.h"
+#include "T_CheckPop3AccessPoint.h"
+#include "T_CreatePopAccountWithoutSmtp.h"
+#include "T_ModifyPopSettings2.h"
+#include "T_CheckPopSNAPSetting.h"
+#include "T_RemovePopSNAPSetting.h"
+#include "T_CheckPopBMSetting.h"
+
+/**
+MainL()
+This is the main function which installs the active scheduler and 
+creates an object of the Email server
+*/
+LOCAL_C void MainL()
+/**
+Secure variant
+Much simpler, uses the new Rendezvous() call to sync with the client
+*/
+	{
+	RProcess().DataCaging(RProcess::EDataCagingOn);
+	RProcess().SecureApi(RProcess::ESecureApiOn);
+
+	CActiveScheduler*	sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sched);
+	CT_MsgPopServer* server = NULL;
+
+	// Create the CTestServer derived Email server
+	TRAPD(err, server = CT_MsgPopServer::NewL());
+	if ( err == KErrNone )
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	delete server;
+	server=NULL;
+	delete sched;
+	sched=NULL;
+	}
+
+
+/**
+E32Main()
+It is the entry point for POP testserver
+
+@return
+Returns KErrNone on suceed otherwise the error code
+*/
+GLDEF_C TInt E32Main()
+/**
+@return
+Standard Epoc error code on process exit
+Secure variant only
+Process entry point. Called by client using RProcess API
+*/
+	{
+	__UHEAP_MARK;
+	
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAP_IGNORE(MainL());	
+	delete cleanup;
+	cleanup=NULL;
+	__UHEAP_MARKEND;
+	
+	return KErrNone;
+    }
+    
+
+/**
+NewL()
+Constructs a CT_MsgPopServer object.
+Uses two phase construction and leaves nothing on the CleanupStack.
+
+@leave KErrNoMemory
+@return
+Created object of type CT_MsgPopServer
+*/
+CT_MsgPopServer* CT_MsgPopServer::NewL()
+	{
+	CT_MsgPopServer*	server=new(ELeave) CT_MsgPopServer();
+	CleanupStack::PushL(server);
+//	server->StartL(KPopServer);
+	server->ConstructL(KPopServer);
+	CleanupStack::Pop(server);
+	return server;
+	}
+	
+	
+/**
+CT_MsgPopServer()
+Intializes iSharedDataPOP with NULL
+*/
+CT_MsgPopServer::CT_MsgPopServer()
+:	iSharedDataPOP(NULL)
+	{
+	}
+
+/**
+NewSharedDataL()
+Constructs a CT_MsgSharedDataPop object dynamically and assigns it's address to iSharedDataPOP
+
+@return
+An object of CT_MsgSharedDataPop
+*/
+CT_MsgSharedDataBase* CT_MsgPopServer::NewSharedDataL()
+	{
+	return iSharedDataPOP = CT_MsgSharedDataPop::NewL();
+	}
+
+
+/**
+CreateTestStepL()
+Creates the test steps based on the name read from the script file
+
+@param aStepName
+The name of the test step to be created
+
+@return
+The CTestStep object created
+*/ 
+CTestStep* CT_MsgPopServer::CreateTestStepL(const TDesC& aStepName)
+	{
+	CTestStep* testStep = NULL;
+	
+	if(aStepName == KVerifyPopSettings)
+		{
+		testStep = new(ELeave) CT_MsgVerifyPopSettings(*iSharedDataPOP);
+		}
+	else if(aStepName == KDeleteAllPopChildren)
+		{
+		testStep = CT_MsgDeleteAllPopChildren::NewL(*iSharedDataPOP);
+		}
+	else if(aStepName == KCopyPopSelection)
+		{
+		testStep = CT_MsgCopyPopSelection::NewL(*iSharedDataPOP);
+		}
+	else if(aStepName == KCreatePopAccount)
+		{
+		testStep = new(ELeave) CT_MsgCreatePopAccount(*iSharedDataPOP);
+		}
+	else if(aStepName == KModifyPopSettings)
+		{
+		testStep = new(ELeave) CT_MsgModifyPopSettings(*iSharedDataPOP);
+		}
+	else if(aStepName == KComparePopSettings)
+		{
+		testStep = new(ELeave) CT_MsgComparePopSettings(*iSharedDataPOP);
+		}
+	else if(aStepName == KDeletePopAccount)
+		{
+		testStep = new(ELeave) CT_MsgDeletePopAccount(*iSharedDataPOP);
+		}
+	else if(aStepName == KVerifyPopAccountsCount)
+		{
+		testStep = new(ELeave) CT_MsgVerifyPopAccountsCount(*iSharedDataPOP);
+		}
+	else if(aStepName == KPopInvokeAsyncFunction)
+		{
+		testStep = CT_MsgPopInvokeAsyncFunction::NewL(*iSharedDataPOP);
+		}
+	else if(aStepName == KCheckChildrenCountPop)
+		{
+		testStep = new(ELeave) CT_MsgCheckChildrenCountPop(*iSharedDataPOP);
+		}
+	else if(aStepName == KComparePopEmailMsgs)
+		{
+		testStep = CT_MsgComparePopEmailMsgs::NewL(*iSharedDataPOP);
+		}
+	else if(aStepName == KConnectPop3Server)
+		{
+		testStep = CT_MsgConnectPop3Server::NewL(*iSharedDataPOP);
+		}
+	else if(aStepName == KDisConnectPop3Server)
+		{
+		testStep = CT_MsgDisConnectPop3Server::NewL(*iSharedDataPOP);
+		}
+	else if(aStepName == KStartRamUsageTimer)
+ 		{
+ 		testStep = new(ELeave) CT_StartRamUsageTimer(*iSharedDataPOP);
+ 		}
+ 	else if(aStepName == KStopRamUsageTimer)
+ 		{
+ 		testStep = new(ELeave) CT_StopRamUsageTimer(*iSharedDataPOP);
+ 		}
+ 	else if(aStepName == KCheckPop3AccessPoint)
+ 		{
+ 		testStep = new(ELeave) CT_MsgCheckPop3AccessPoint(*iSharedDataPOP);
+ 		}
+ 	else if(aStepName == KCreatePopAccountWithoutSmtp)
+ 		{
+ 		testStep = new(ELeave) CT_MsgCreatePopAccountWithoutSmtp(*iSharedDataPOP);
+ 		}
+ 	else if(aStepName == KModifyPopSettings2)
+ 		{
+ 		testStep = new(ELeave) CT_MsgModifyPopSettings2(*iSharedDataPOP);
+ 		}
+ 	else if(aStepName == KCheckPopSNAPSetting)
+ 		{
+ 		testStep = new(ELeave) CT_MsgCheckPopSNAPSetting(*iSharedDataPOP);
+ 		}
+ 	else if(aStepName == KRemovePopSNAPSetting)
+ 		{
+ 		testStep = new(ELeave) CT_MsgRemovePopSNAPSetting(*iSharedDataPOP);
+ 		}
+ 	else if(aStepName == KCheckPopBMSetting)
+ 		{
+ 		testStep = new(ELeave) CT_MsgCheckPopBMSetting(*iSharedDataPOP);
+ 		}
+	else
+		{
+		testStep = CT_MsgServer::CreateTestStepL(aStepName);
+		}
+
+	return testStep;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_RemovePopSNAPSetting.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,93 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// RemovePopSNAPSetting
+// [Paramaters]
+// PopAccountName			:Name of the Pop account.
+// Removes the provisioned SNAP information for the POP account.
+// 
+//
+
+//User includes
+#include "T_RemovePopSNAPSetting.h"
+#include <t_utils.h>
+#include <t_utilsenumconverter.h>
+#include <t_utilscentralrepository.h>
+
+//Epoc include
+#include <iapprefs.h>
+
+//Literal used
+_LIT(KPopAccountName,"PopAccountName");
+
+/**
+  Function : CT_MsgRemovePopSNAPSetting
+  Description : Constructor 
+  @param : aSharedDataPOP Reference to CT_MsgSharedDataPop
+  @return : N/A
+*/
+CT_MsgRemovePopSNAPSetting::CT_MsgRemovePopSNAPSetting(CT_MsgSharedDataPop& aSharedDataPOP)
+:CT_MsgSyncStepPOP(aSharedDataPOP)
+	{
+	SetTestStepName(KRemovePopSNAPSetting);
+	}
+	
+	
+/**
+  Function : ReadIni
+  Description :Reads the corresponding .ini file and returns EPass or EFail if any of the inputs are missing
+  @return : TBool
+*/
+TBool CT_MsgRemovePopSNAPSetting::ReadIni()
+	{
+	TBool result = ETrue;
+	
+	if(!GetStringFromConfig(ConfigSection(), KPopAccountName, iPopAccountName))
+		{
+		ERR_PRINTF1(_L("Pop account name is not specified"));
+		SetTestStepResult(EFail);
+		result = EFalse;
+		}
+		
+	return result;
+	}
+
+/**
+  Function : doTestStepL
+  Description : Removes the provisioned SNAP information from the POP account settings of a test case.
+  @return : TVerdict - Test step result
+*/		
+TVerdict CT_MsgRemovePopSNAPSetting::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test Step : RemovePopSNAPSetting"));
+	if(ReadIni())
+		{
+		CEmailAccounts* accounts = CEmailAccounts::NewL();
+		CleanupStack::PushL(accounts);
+		
+		CImIAPPreferences* popIapPrefs = CImIAPPreferences::NewLC();
+					
+		TPopAccount popAccountId;
+		CT_MsgUtilsCentralRepository::GetPopAccountL((TDes&)iPopAccountName, popAccountId);
+				
+		accounts->LoadPopIapSettingsL(popAccountId, *popIapPrefs);	
+		
+		popIapPrefs->RemoveSNAP();
+		
+		accounts->SavePopIapSettingsL(popAccountId, *popIapPrefs);
+	
+		CleanupStack::PopAndDestroy(2,accounts); // popIapPrefs, accounts
+		}
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_SharedDataPop.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,69 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This file contains the shared data class for the POP server
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+// user include
+#include "t_shareddatapop.h"
+
+
+// epoc includes
+#include <miutset.h>
+#include <mtclreg.h>
+
+
+/**
+NewL()
+Allocates and creates a new CT_MsgSharedDataPop object
+
+@leave KErrNoMemory
+@return
+Returns pointer to an object of CT_MsgSharedDataPop
+*/
+CT_MsgSharedDataPop* CT_MsgSharedDataPop::NewL()
+	{
+	CT_MsgSharedDataPop* sharedDataPop=new(ELeave) CT_MsgSharedDataPop();
+	CleanupStack::PushL(sharedDataPop);
+	sharedDataPop->ConstructL();
+	CleanupStack::Pop(sharedDataPop);
+	return sharedDataPop;
+	}
+
+	
+/**
+NewMtmL()
+ 
+@return
+Returns a pointer to Client-side MTM object
+*/
+CBaseMtm* CT_MsgSharedDataPop::NewMtmL()
+	{
+	return iRegistry->NewMtmL(KUidMsgTypePOP3);
+	}
+
+
+/**
+CT_MsgSharedDataPop()
+Construstor
+*/
+CT_MsgSharedDataImap::CT_MsgSharedDataImap()
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_StartRamUsageTimer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,148 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file 
+// [TestStep Name]
+// StartRamUsageTimer
+// [Paramaters]
+// IntervalTimeInMicroSecs			<input>	: The interval between events generated
+// after the initial delay, in microseconds
+// Starts periodical measurement of RAM memory used and updates the information kept
+// in POP testserver.
+// [APIs Used]
+// 
+//
+
+
+
+// User includes 
+#include "T_StartRamUsageTimer.h"
+#include "T_MsgSharedDataPop.h"
+
+// Epoc includes
+#include <hal.h>
+#include <hal_data.h>
+
+// Literals used
+_LIT(KIntervalTimeInMicroSecs, "IntervalTimeInMicroSecs");
+
+/**
+  Function 		: CT_StartRamUsageTimer
+  Description 	: Constructor
+  @return 		: none
+*/
+CT_StartRamUsageTimer::CT_StartRamUsageTimer(CT_MsgSharedDataPop& aSharedDataPOP)
+:CT_MsgAsyncStepPOP(aSharedDataPOP)
+	{
+	SetTestStepName(KStartRamUsageTimer);
+	}
+
+/**
+  Function 		: ~CT_StartRamUsageTimer
+  Description 	: Destructor
+  @return 		: N/A
+*/
+CT_StartRamUsageTimer::~CT_StartRamUsageTimer()
+	{}
+	
+
+/**
+  Function 		: doTestStepL
+  Description 	: Generate a periodic Timer event and handle the RAM usage callback function
+  @return 		: TVerdict Test result
+*/
+TVerdict CT_StartRamUsageTimer::doTestStepL()
+	{
+	INFO_PRINTF1(_L("TestStep :StartRamUsageTimer"));
+	TInt intervalTime = 0;	
+	if(!GetIntFromConfig(ConfigSection(),KIntervalTimeInMicroSecs,intervalTime))
+		{
+		ERR_PRINTF1(_L("Interval time is not specified"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		iSharedDataPOP.iPeriodic->Start(intervalTime, intervalTime, TCallBack(RamUsage,this));
+		}
+	return TestStepResult();	
+	}
+
+/**
+  Function 		: RamUsage
+  Description 	: Call non-static method DoRamUsage
+  @return 		: TInt
+*/
+TInt CT_StartRamUsageTimer::RamUsage(TAny* aObject)
+	{
+	// Cast, and call non-static function
+	((CT_StartRamUsageTimer *)aObject)->DoRamUsage();	
+	return 1;	
+	}
+
+/**
+  Function 		: DoRamUsage
+  Description 	: Calculate the RAM usage value and percentage at a particular instance 
+  @return 		: void
+*/	
+void CT_StartRamUsageTimer::DoRamUsage()
+	{
+	
+	TInt fullRamValue;
+	TInt ramFreeValue;
+	
+	HAL 	data;
+	HALData haldata;
+	
+	data.Get(haldata.EMemoryRAM, fullRamValue);
+	data.Get(haldata.EMemoryRAMFree, ramFreeValue);	
+	
+	TInt ramUsage = ((fullRamValue - ramFreeValue)/(1024));
+	
+	if ( iSharedDataPOP.iMark != EFalse )
+		{
+		iSharedDataPOP.iStartRamValue = ramUsage;
+		iSharedDataPOP.iMinRamValue = ramUsage;
+		iSharedDataPOP.iMaxRamValue = ramUsage;
+		iSharedDataPOP.iMark = EFalse;
+		}
+	
+	if ( iSharedDataPOP.iMinRamValue > ramUsage )
+		{
+		iSharedDataPOP.iMinRamValue = ramUsage;
+		}
+		
+	if ( iSharedDataPOP.iMaxRamValue < ramUsage )
+		{
+		iSharedDataPOP.iMaxRamValue = ramUsage;
+		}
+	
+	iSharedDataPOP.iEndRamValue = ramUsage;
+	}
+	
+
+	
+/**
+  Function 		: ProgressL
+  Description 	: Displays the progress information of the asynchronous operation
+  @return 		: void
+*/
+void CT_StartRamUsageTimer::ProgressL(TBool /*aFinal*/)
+	{}
+
+/**
+  Function 		: CancelStep
+  Description 	: Cancels the asynchronous operation
+  @return 		: void
+*/
+void CT_StartRamUsageTimer::CancelStep()
+	{}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_StopRamUsageTimer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,127 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file 
+// [TestStep Name]
+// StopRamUsageTimer
+// [Paramaters]
+// EventStartCode			<input>	: Start event code which maps to the RAM usage value
+// when tacking of RAM usage got started.
+// EventStopCode			<input> : Stop event code which maps to the RAM usage value
+// when tacking of RAM usage got stopped.
+// Stops periodical measurement of RAM memory used and logs the RAM usage information
+// [APIs Used]
+// 
+//
+
+
+
+// User includes
+#include "T_StopRamUsageTimer.h"
+#include <t_utilsenumconverter.h>
+#include <t_testinstrumentation.h>
+
+
+// Literals used
+_LIT(KEventStartCode, "EventStartCode");
+_LIT(KEventStopCode, "EventStopCode");
+/**
+  Function 		: CT_StopRamUsageTimer
+  Description 	: Constructor
+  @return 		: none
+*/
+CT_StopRamUsageTimer::CT_StopRamUsageTimer(CT_MsgSharedDataPop& aSharedDataPOP)
+:CT_MsgAsyncStepPOP(aSharedDataPOP)
+	{
+	SetTestStepName(KStopRamUsageTimer);
+	}
+	
+/**
+  Function 		: ~CT_StopRamUsageTimer
+  Description 	: Destructor
+  @return 		: N/A
+*/
+CT_StopRamUsageTimer::~CT_StopRamUsageTimer()
+	{}
+	
+
+/**
+  Function 		: doTestStepL
+  Description 	: Stop the periodic Timer
+  @return 		: TVerdict Test result
+*/
+TVerdict CT_StopRamUsageTimer::doTestStepL()
+	{
+	INFO_PRINTF1(_L("TestStep :StopRamUsageTimer"));
+	TPtrC startCodeFromIni;
+	if(!GetStringFromConfig(ConfigSection(), KEventStartCode, startCodeFromIni))
+		{
+		ERR_PRINTF1(_L("Event Start code is not specified"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		TInstrumentationPoint starteventcode = CT_MsgUtilsEnumConverter::ConvertDesToEventCode(startCodeFromIni);
+		
+		TPtrC stopCodeFromIni;
+		if(!GetStringFromConfig(ConfigSection(), KEventStopCode, stopCodeFromIni))
+			{
+			ERR_PRINTF1(_L("Event Stop code is not specified"));
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			TInstrumentationPoint stopeventcode = CT_MsgUtilsEnumConverter::ConvertDesToEventCode(stopCodeFromIni);
+			iSharedDataPOP.iPeriodic->Cancel();
+
+			INFO_PRINTF2(_L("Minimum Ram usage value is %d KB "), iSharedDataPOP.iMinRamValue);
+			INFO_PRINTF2(_L("Maximum Ram usage value is %d KB "), iSharedDataPOP.iMaxRamValue);
+			INFO_PRINTF2(_L("Start Ram usage value is %d KB "), iSharedDataPOP.iStartRamValue);
+			INFO_PRINTF2(_L("End Ram usage value is %d KB "), iSharedDataPOP.iEndRamValue);
+
+			TInt maxRamUsage = ( iSharedDataPOP.iMaxRamValue - iSharedDataPOP.iStartRamValue );
+			TInt extremeRamUsage = ( iSharedDataPOP.iMaxRamValue - iSharedDataPOP.iMinRamValue );
+			TInt actualRamUsage = ( iSharedDataPOP.iEndRamValue - iSharedDataPOP.iStartRamValue );
+			
+			INFO_PRINTF2(_L("Maximum(Mx-St) Ram usage diff value is %d KB "), maxRamUsage );
+			INFO_PRINTF2(_L("Extreme(Mx-Mn) Ram usage diff value is %d KB "), extremeRamUsage );
+			INFO_PRINTF2(_L("Actual(En-St) Ram usage diff value is %d KB "), actualRamUsage );
+			if( starteventcode || stopeventcode )
+				{
+				INFO_PRINTF5(_L("EVENT_LOG_INFORMATION,%d,%d,%d,%d"),0,0,starteventcode,iSharedDataPOP.iStartRamValue);
+				INFO_PRINTF5(_L("EVENT_LOG_INFORMATION,%d,%d,%d,%d"),0,0,stopeventcode,iSharedDataPOP.iMaxRamValue);
+				}
+			else
+				{
+				ERR_PRINTF1(_L("**ERROR**: Bad Event code. Check t_testinstrumentation.h for valid event code"));					
+				}	
+			}		
+		}
+	return TestStepResult();
+	}
+
+/**
+  Function 		: ProgressL
+  Description 	: Displays the progress information of the asynchronous operation
+  @return 		: void
+*/
+void CT_StopRamUsageTimer::ProgressL(TBool /*aFinal*/)
+	{}
+
+/**
+  Function 		: CancelStep
+  Description 	: Cancels the asynchronous operation
+  @return 		: void
+*/
+void CT_StopRamUsageTimer::CancelStep()
+	{}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_VerifyPopAccountsCount.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,106 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// VerifyPopAccountsCount
+// [Paramaters]
+// ExpectedCount		<input>	: Expected Number of the POP Accouts present
+// [Test Step Description]
+// If number of POP accounts present equals with the expected number of accounts then test step result is pass.
+// [APIs Used]
+// CEmailAccounts::GetPopAccountsL
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+
+// User include
+#include "T_VerifyPopAccountsCount.h"
+
+
+// epoc inlcudes
+#include<cemailaccounts.h>
+
+
+// Literals used
+_LIT(KExpectedCount,"ExpectedCount");
+
+
+/**
+CT_MsgVerifyPopAccountsCount()
+Sets the teststep name to KCheckChildrenCountPop
+
+@param aSharedDataPOP
+Data shared across the POP test steps. Ex. Sessoin
+*/
+CT_MsgVerifyPopAccountsCount::CT_MsgVerifyPopAccountsCount(CT_MsgSharedDataPop& aSharedDataPOP)
+:	CT_MsgSyncStepPOP(aSharedDataPOP) 
+	{
+	SetTestStepName(KVerifyPopAccountsCount);
+	}
+
+
+/**
+~CT_MsgVerifyPopAccountsCount()
+Destructor
+*/
+CT_MsgVerifyPopAccountsCount::~CT_MsgVerifyPopAccountsCount()
+	{
+	}
+
+
+/**
+doTestStepL()
+Reads the expected count from the ini file.
+Obtains the count of the POP accounts created and compares against the expected number.
+
+@return
+Returns the test step result.
+*/
+TVerdict CT_MsgVerifyPopAccountsCount::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test Step: Verify Pop Accounts Count"));
+	TInt expectedCount = -1;
+	if(!GetIntFromConfig(ConfigSection(), KExpectedCount, expectedCount) && expectedCount < 0)
+		{
+		ERR_PRINTF1(_L("ExpectedCount is not Specified or < 0"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		CEmailAccounts *account = CEmailAccounts::NewLC();	
+		RArray<TPopAccount> arrayPopAccounts;
+		account->GetPopAccountsL(arrayPopAccounts);
+		TInt count = arrayPopAccounts.Count();
+		
+		CleanupStack::PopAndDestroy(account);
+		arrayPopAccounts.Reset();
+		
+		if (count != expectedCount)
+			{
+			ERR_PRINTF3(_L("Number of POP accounts do not match ! expected = %d actual = %d"), 
+									  expectedCount, count);
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			INFO_PRINTF2(_L("Number of POP accounts matched value = %d !"), expectedCount);	
+			}			
+		}
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/src/T_VerifyPopSettings.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,175 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// VerifyPopSettings
+// [Paramaters]
+// PopAccountName		:		Name of the Pop account
+// VerifyPopSettings is intended to populate the default POP and SMTP settings,
+// Load the settings of the account created with the default settings, and compare 
+// the settings objects.The test passes if all the settings objects match else it fails.
+// [APIs Used]
+// GetPopAccountL
+// LoadPopSettingsL
+// LoadPopIapSettingsL
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+
+// User include
+#include "T_VerfiyPopSettings.h"
+#include <t_utilsreademailsettingsfromconfigfile.h>
+#include <t_utilscentralrepository.h>
+
+
+// epoc inlcudes
+#include <cemailaccounts.h>
+#include <pop3set.h>
+#include <iapprefs.h>
+#include <smtpset.h>
+
+
+// Literals used
+_LIT(KPopAccountName,"PopAccountName");
+
+
+/**
+CT_MsgVerifyPopSettings()
+Sets the teststep name to KCheckChildrenCountPop
+
+@param aSharedDataPOP
+Data shared across the POP test steps. Ex. Sessoin 
+*/
+CT_MsgVerifyPopSettings::CT_MsgVerifyPopSettings(CT_MsgSharedDataPop& aSharedDataPOP)
+:	CT_MsgSyncStepPOP(aSharedDataPOP) 
+	{
+	SetTestStepName(KVerifyPopSettings);
+	}
+
+
+/**
+~CT_MsgVerifyPopSettings()
+Destructor
+*/
+CT_MsgVerifyPopSettings::~CT_MsgVerifyPopSettings()
+	{
+	}
+
+
+/**
+doTestStepL()
+Populate the default POP and SMTP settings, Load the settings of the account 
+created with the default settings, and compares the settings objects.
+The test passes if all the settings objects match else it fails.
+
+@return
+Returns the test step result
+*/
+TVerdict CT_MsgVerifyPopSettings::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test Step: VerifyPopSettings"));
+	// Read the Pop account name from the ini file
+	TPtrC popAccountName;
+	if(!GetStringFromConfig(ConfigSection(), KPopAccountName, popAccountName))
+		{
+		ERR_PRINTF1(_L("PopAccount Name is not specified"));
+		SetTestStepResult(EFail);
+		}
+	
+	else
+		{
+		// Retrieving the Pop service Id for the given Pop account
+		TMsvId popServiceId = CT_MsgUtilsCentralRepository::GetPopServiceIdL((TDes&)popAccountName);
+		INFO_PRINTF2(_L("Pop service id is %d"),popServiceId);
+		
+		if(popServiceId == KMsvNullIndexEntryId)
+			{
+			ERR_PRINTF1(_L("Invalid POP account name specified"));
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			CEmailAccounts* emailAccounts = CEmailAccounts::NewLC();
+	
+			CImPop3Settings* popSettings1 = new(ELeave) CImPop3Settings();
+			CleanupStack::PushL(popSettings1);
+			
+			CImIAPPreferences* popIapPrefs1 = CImIAPPreferences::NewLC();
+			
+			CImSmtpSettings* smtpSettings1 = new(ELeave) CImSmtpSettings();
+			CleanupStack::PushL(smtpSettings1);
+
+			CImIAPPreferences* smtpIapPrefs1 = CImIAPPreferences::NewLC();
+
+			emailAccounts->PopulateDefaultPopSettingsL(*popSettings1, *popIapPrefs1);
+			emailAccounts->PopulateDefaultSmtpSettingsL(*smtpSettings1, *smtpIapPrefs1);
+
+			
+	
+			CImPop3Settings* popSettings2 = new(ELeave) CImPop3Settings();
+			CleanupStack::PushL(popSettings2);
+			
+			CImIAPPreferences* popIapPrefs2 = CImIAPPreferences::NewLC();
+			
+			CImSmtpSettings* smtpSettings2 = new(ELeave) CImSmtpSettings();
+			CleanupStack::PushL(smtpSettings2);
+
+			CImIAPPreferences* smtpIapPrefs2 = CImIAPPreferences::NewLC();
+
+			TPopAccount popAccount;
+			emailAccounts->GetPopAccountL(popServiceId, popAccount);
+			emailAccounts->LoadPopSettingsL(popAccount, *popSettings2);
+			emailAccounts->LoadPopIapSettingsL(popAccount, *popIapPrefs2);
+			
+			TSmtpAccount smtpAccount;
+			emailAccounts->GetSmtpAccountL(popAccount.iSmtpService, smtpAccount);
+			emailAccounts->LoadSmtpSettingsL(smtpAccount, *smtpSettings2);
+			emailAccounts->LoadSmtpIapSettingsL(smtpAccount, *smtpIapPrefs2);
+
+			TVerdict result = EPass;
+			if (!(*popSettings1 == *popSettings2))   
+				{
+				// failed
+				ERR_PRINTF1(_L("Pop3 Settings objects do not match !"));
+				result = EFail;
+				}
+			else if (!(*smtpSettings1 == *smtpSettings2))
+				{
+				// failed
+				ERR_PRINTF1(_L("SMTP Settings objects do not match !"));
+				result = EFail;
+				}
+			else if (!CT_MsgUtilsReadEmailSettingsFromConfigFile::CompareIapPrefs(*popIapPrefs1, *popIapPrefs2))
+				{
+				// failed
+				ERR_PRINTF1(_L("Pop3 IAP Preference objects do not match !"));
+				result = EFail;
+				}
+			else if (!CT_MsgUtilsReadEmailSettingsFromConfigFile::CompareIapPrefs(*smtpIapPrefs1, *smtpIapPrefs2))
+				{
+				// failed
+				ERR_PRINTF1(_L("SMTP IAP Preference objects do not match !"));
+				result = EFail;
+				}
+			SetTestStepResult(result);
+			CleanupStack::PopAndDestroy(9,emailAccounts);
+			}
+		}
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/testdata/EmailMessage/20KBody.txt	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,348 @@
+From: test908@msexchange2k.closedtest.intra
+To: test908@msexchange2k.closedtest.intra
+Subject: 20KBody
+Date: Wed, 10 Jan 2007 10:30:31 +0530
+MIME-Version: 1.0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 8bit
+X-Priority: 3
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook Express 6.00.2800.1807
+X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1896
+
+Symbian OS - the mobile operating systemSoftware licensing company that
+develops and licenses Symbian OS, an open industry standard operating system
+for data enabled mobile phones.
+www.symbian.com/ - Similar pages
+Phones - www.symbian.com/phones/index.html
+OS - www.symbian.com/symbianos/index.html
+Fast facts - www.symbian.com/about/fastfacts/fastfacts.html
+Developer tools & downloads - www.symbian.com/developer/downloads/index.html
+More results from www.symbian.com »
+Symbian OS - the mobile operating systemSoftware licensing company that
+develops and licenses Symbian OS, an open industry standard operating system
+for data enabled mobile phones.
+www.symbian.com/ - Similar pages
+Phones - www.symbian.com/phones/index.html
+OS - www.symbian.com/symbianos/index.html
+Fast facts - www.symbian.com/about/fastfacts/fastfacts.html
+Developer tools & downloads - www.symbian.com/developer/downloads/index.html
+More results from www.symbian.com »
+Symbian: Developer: homeThe people behind the EPOC operating system.
+Symbian's mission is to set the standard for mobile wireless operating
+systems and to enable a mass market for ...
+www.symbian.com/developer/ - Similar pages
+Symbian OS - Wikipedia, the free encyclopediaArticle discussing the
+operating system, its history and devices that use it.
+en.wikipedia.org/wiki/Symbian_OS - 64k - Cached - Similar pages
+My-Symbian.com - Symbian OS Communicators and Smartphones Info CenterPortal
+for users of Symbian based communicators and smartphones. Includes news,
+software downloads and both English and Polish language discussion forums.
+www.my-symbian.com/ - 82k - 8 Jan 2007 - Cached - Similar pages
+All About Symbian - News, Reviews, and Software for Symbian ...Community
+offering user support, news, reviews and software for Symbian based phones.
+www.allaboutsymbian.com/ - 42k - 8 Jan 2007 - Cached - Similar pages
+The premier place for symbian users, supported with the No. one ...The
+premier place for symbian users introduces various researches for smarth
+phone users like: Error Fixes, Modding, Guides, Tutorials tips & tricks, ...
+www.symbian-freak.com/ - 102k - Cached - Similar pages
+Symbian OS mobile smartphone operating system - News, articles ...Resource
+site for Symbian developers. Includes news, product review, technical
+information on Symbian based devices and discussion forums.
+www.symbianone.com/ - 93k - Cached - Similar pages
+Symbian Themes: WelcomeThe premier site for sharing and customzing themes,
+wallpapers, ringtones and more for a wide variety of mobile devices such as
+mobile phones, ...
+symbian.mobilethemes.com/ - 92k - Cached - Similar pages
+Symbian OS - the mobile operating systemSoftware licensing company that
+develops and licenses Symbian OS, an open industry standard operating system
+for data enabled mobile phones.
+www.symbian.com/ - Similar pages
+Phones - www.symbian.com/phones/index.html
+OS - www.symbian.com/symbianos/index.html
+Fast facts - www.symbian.com/about/fastfacts/fastfacts.html
+Developer tools & downloads - www.symbian.com/developer/downloads/index.html
+More results from www.symbian.com »
+Symbian: Developer: homeThe people behind the EPOC operating system.
+Symbian's mission is to set the standard for mobile wireless operating
+systems and to enable a mass market for ...
+www.symbian.com/developer/ - Similar pages
+Symbian OS - Wikipedia, the free encyclopediaArticle discussing the
+operating system, its history and devices that use it.
+en.wikipedia.org/wiki/Symbian_OS - 64k - Cached - Similar pages
+My-Symbian.com - Symbian OS Communicators and Smartphones Info CenterPortal
+for users of Symbian based communicators and smartphones. Includes news,
+software downloads and both English and Polish language discussion forums.
+www.my-symbian.com/ - 82k - 8 Jan 2007 - Cached - Similar pages
+All About Symbian - News, Reviews, and Software for Symbian ...Community
+offering user support, news, reviews and software for Symbian based phones.
+www.allaboutsymbian.com/ - 42k - 8 Jan 2007 - Cached - Similar pages
+The premier place for symbian users, supported with the No. one ...The
+premier place for symbian users introduces various researches for smarth
+phone users like: Error Fixes, Modding, Guides, Tutorials tips & tricks, ...
+www.symbian-freak.com/ - 102k - Cached - Similar pages
+Symbian OS mobile smartphone operating system - News, articles ...Resource
+site for Symbian developers. Includes news, product review, technical
+information on Symbian based devices and discussion forums.
+www.symbianone.com/ - 93k - Cached - Similar pages
+Symbian Themes: WelcomeThe premier site for sharing and customzing themes,
+wallpapers, ringtones and more for a wide variety of mobile devices such as
+mobile phones, ...
+symbian.mobilethemes.com/ - 92k - Cached - Similar pages
+Symbian OS - the mobile operating systemSoftware licensing company that
+develops and licenses Symbian OS, an open industry standard operating system
+for data enabled mobile phones.
+www.symbian.com/ - Similar pages
+Phones - www.symbian.com/phones/index.html
+OS - www.symbian.com/symbianos/index.html
+Fast facts - www.symbian.com/about/fastfacts/fastfacts.html
+Developer tools & downloads - www.symbian.com/developer/downloads/index.html
+More results from www.symbian.com »
+Symbian OS - the mobile operating systemSoftware licensing company that
+develops and licenses Symbian OS, an open industry standard operating system
+for data enabled mobile phones.
+www.symbian.com/ - Similar pages
+Phones - www.symbian.com/phones/index.html
+OS - www.symbian.com/symbianos/index.html
+Fast facts - www.symbian.com/about/fastfacts/fastfacts.html
+Developer tools & downloads - www.symbian.com/developer/downloads/index.html
+More results from www.symbian.com »
+Symbian: Developer: homeThe people behind the EPOC operating system.
+Symbian's mission is to set the standard for mobile wireless operating
+systems and to enable a mass market for ...
+www.symbian.com/developer/ - Similar pages
+Symbian OS - Wikipedia, the free encyclopediaArticle discussing the
+operating system, its history and devices that use it.
+en.wikipedia.org/wiki/Symbian_OS - 64k - Cached - Similar pages
+My-Symbian.com - Symbian OS Communicators and Smartphones Info CenterPortal
+for users of Symbian based communicators and smartphones. Includes news,
+software downloads and both English and Polish language discussion forums.
+www.my-symbian.com/ - 82k - 8 Jan 2007 - Cached - Similar pages
+All About Symbian - News, Reviews, and Software for Symbian ...Community
+offering user support, news, reviews and software for Symbian based phones.
+www.allaboutsymbian.com/ - 42k - 8 Jan 2007 - Cached - Similar pages
+The premier place for symbian users, supported with the No. one ...The
+premier place for symbian users introduces various researches for smarth
+phone users like: Error Fixes, Modding, Guides, Tutorials tips & tricks, ...
+www.symbian-freak.com/ - 102k - Cached - Similar pages
+Symbian OS mobile smartphone operating system - News, articles ...Resource
+site for Symbian developers. Includes news, product review, technical
+information on Symbian based devices and discussion forums.
+www.symbianone.com/ - 93k - Cached - Similar pages
+Symbian Themes: WelcomeThe premier site for sharing and customzing themes,
+wallpapers, ringtones and more for a wide variety of mobile devices such as
+mobile phones, ...
+symbian.mobilethemes.com/ - 92k - Cached - Similar pages
+Symbian OS - the mobile operating systemSoftware licensing company that
+develops and licenses Symbian OS, an open industry standard operating system
+for data enabled mobile phones.
+www.symbian.com/ - Similar pages
+Phones - www.symbian.com/phones/index.html
+OS - www.symbian.com/symbianos/index.html
+Fast facts - www.symbian.com/about/fastfacts/fastfacts.html
+Developer tools & downloads - www.symbian.com/developer/downloads/index.html
+More results from www.symbian.com »
+Symbian: Developer: homeThe people behind the EPOC operating system.
+Symbian's mission is to set the standard for mobile wireless operating
+systems and to enable a mass market for ...
+www.symbian.com/developer/ - Similar pages
+Symbian OS - Wikipedia, the free encyclopediaArticle discussing the
+operating system, its history and devices that use it.
+en.wikipedia.org/wiki/Symbian_OS - 64k - Cached - Similar pages
+My-Symbian.com - Symbian OS Communicators and Smartphones Info CenterPortal
+for users of Symbian based communicators and smartphones. Includes news,
+software downloads and both English and Polish language discussion forums.
+www.my-symbian.com/ - 82k - 8 Jan 2007 - Cached - Similar pages
+All About Symbian - News, Reviews, and Software for Symbian ...Community
+offering user support, news, reviews and software for Symbian based phones.
+www.allaboutsymbian.com/ - 42k - 8 Jan 2007 - Cached - Similar pages
+The premier place for symbian users, supported with the No. one ...The
+premier place for symbian users introduces various researches for smarth
+phone users like: Error Fixes, Modding, Guides, Tutorials tips & tricks, ...
+www.symbian-freak.com/ - 102k - Cached - Similar pages
+Symbian OS mobile smartphone operating system - News, articles ...Resource
+site for Symbian developers. Includes news, product review, technical
+information on Symbian based devices and discussion forums.
+www.symbianone.com/ - 93k - Cached - Similar pages
+Symbian Themes: WelcomeThe premier site for sharing and customzing themes,
+wallpapers, ringtones and more for a wide variety of mobile devices such as
+mobile phones, ...
+symbian.mobilethemes.com/ - 92k - Cached - Similar pages
+
+
+
+From: test908@msexchange2k.closedtest.intra
+To: test908@msexchange2k.closedtest.intra
+Subject: 10KBody
+Date: Wed, 10 Jan 2007 10:30:31 +0530
+MIME-Version: 1.0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 8bit
+X-Priority: 3
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook Express 6.00.2800.1807
+X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1896
+
+Symbian OS - the mobile operating systemSoftware licensing company that
+develops and licenses Symbian OS, an open industry standard operating system
+for data enabled mobile phones.
+www.symbian.com/ - Similar pages
+Phones - www.symbian.com/phones/index.html
+OS - www.symbian.com/symbianos/index.html
+Fast facts - www.symbian.com/about/fastfacts/fastfacts.html
+Developer tools & downloads - www.symbian.com/developer/downloads/index.html
+More results from www.symbian.com »
+Symbian OS - the mobile operating systemSoftware licensing company that
+develops and licenses Symbian OS, an open industry standard operating system
+for data enabled mobile phones.
+www.symbian.com/ - Similar pages
+Phones - www.symbian.com/phones/index.html
+OS - www.symbian.com/symbianos/index.html
+Fast facts - www.symbian.com/about/fastfacts/fastfacts.html
+Developer tools & downloads - www.symbian.com/developer/downloads/index.html
+More results from www.symbian.com »
+Symbian: Developer: homeThe people behind the EPOC operating system.
+Symbian's mission is to set the standard for mobile wireless operating
+systems and to enable a mass market for ...
+www.symbian.com/developer/ - Similar pages
+Symbian OS - Wikipedia, the free encyclopediaArticle discussing the
+operating system, its history and devices that use it.
+en.wikipedia.org/wiki/Symbian_OS - 64k - Cached - Similar pages
+My-Symbian.com - Symbian OS Communicators and Smartphones Info CenterPortal
+for users of Symbian based communicators and smartphones. Includes news,
+software downloads and both English and Polish language discussion forums.
+www.my-symbian.com/ - 82k - 8 Jan 2007 - Cached - Similar pages
+All About Symbian - News, Reviews, and Software for Symbian ...Community
+offering user support, news, reviews and software for Symbian based phones.
+www.allaboutsymbian.com/ - 42k - 8 Jan 2007 - Cached - Similar pages
+The premier place for symbian users, supported with the No. one ...The
+premier place for symbian users introduces various researches for smarth
+phone users like: Error Fixes, Modding, Guides, Tutorials tips & tricks, ...
+www.symbian-freak.com/ - 102k - Cached - Similar pages
+Symbian OS mobile smartphone operating system - News, articles ...Resource
+site for Symbian developers. Includes news, product review, technical
+information on Symbian based devices and discussion forums.
+www.symbianone.com/ - 93k - Cached - Similar pages
+Symbian Themes: WelcomeThe premier site for sharing and customzing themes,
+wallpapers, ringtones and more for a wide variety of mobile devices such as
+mobile phones, ...
+symbian.mobilethemes.com/ - 92k - Cached - Similar pages
+Symbian OS - the mobile operating systemSoftware licensing company that
+develops and licenses Symbian OS, an open industry standard operating system
+for data enabled mobile phones.
+www.symbian.com/ - Similar pages
+Phones - www.symbian.com/phones/index.html
+OS - www.symbian.com/symbianos/index.html
+Fast facts - www.symbian.com/about/fastfacts/fastfacts.html
+Developer tools & downloads - www.symbian.com/developer/downloads/index.html
+More results from www.symbian.com »
+Symbian: Developer: homeThe people behind the EPOC operating system.
+Symbian's mission is to set the standard for mobile wireless operating
+systems and to enable a mass market for ...
+www.symbian.com/developer/ - Similar pages
+Symbian OS - Wikipedia, the free encyclopediaArticle discussing the
+operating system, its history and devices that use it.
+en.wikipedia.org/wiki/Symbian_OS - 64k - Cached - Similar pages
+My-Symbian.com - Symbian OS Communicators and Smartphones Info CenterPortal
+for users of Symbian based communicators and smartphones. Includes news,
+software downloads and both English and Polish language discussion forums.
+www.my-symbian.com/ - 82k - 8 Jan 2007 - Cached - Similar pages
+All About Symbian - News, Reviews, and Software for Symbian ...Community
+offering user support, news, reviews and software for Symbian based phones.
+www.allaboutsymbian.com/ - 42k - 8 Jan 2007 - Cached - Similar pages
+The premier place for symbian users, supported with the No. one ...The
+premier place for symbian users introduces various researches for smarth
+phone users like: Error Fixes, Modding, Guides, Tutorials tips & tricks, ...
+www.symbian-freak.com/ - 102k - Cached - Similar pages
+Symbian OS mobile smartphone operating system - News, articles ...Resource
+site for Symbian developers. Includes news, product review, technical
+information on Symbian based devices and discussion forums.
+www.symbianone.com/ - 93k - Cached - Similar pages
+Symbian Themes: WelcomeThe premier site for sharing and customzing themes,
+wallpapers, ringtones and more for a wide variety of mobile devices such as
+mobile phones, ...
+symbian.mobilethemes.com/ - 92k - Cached - Similar pages
+Symbian OS - the mobile operating systemSoftware licensing company that
+develops and licenses Symbian OS, an open industry standard operating system
+for data enabled mobile phones.
+www.symbian.com/ - Similar pages
+Phones - www.symbian.com/phones/index.html
+OS - www.symbian.com/symbianos/index.html
+Fast facts - www.symbian.com/about/fastfacts/fastfacts.html
+Developer tools & downloads - www.symbian.com/developer/downloads/index.html
+More results from www.symbian.com »
+Symbian OS - the mobile operating systemSoftware licensing company that
+develops and licenses Symbian OS, an open industry standard operating system
+for data enabled mobile phones.
+www.symbian.com/ - Similar pages
+Phones - www.symbian.com/phones/index.html
+OS - www.symbian.com/symbianos/index.html
+Fast facts - www.symbian.com/about/fastfacts/fastfacts.html
+Developer tools & downloads - www.symbian.com/developer/downloads/index.html
+More results from www.symbian.com »
+Symbian: Developer: homeThe people behind the EPOC operating system.
+Symbian's mission is to set the standard for mobile wireless operating
+systems and to enable a mass market for ...
+www.symbian.com/developer/ - Similar pages
+Symbian OS - Wikipedia, the free encyclopediaArticle discussing the
+operating system, its history and devices that use it.
+en.wikipedia.org/wiki/Symbian_OS - 64k - Cached - Similar pages
+My-Symbian.com - Symbian OS Communicators and Smartphones Info CenterPortal
+for users of Symbian based communicators and smartphones. Includes news,
+software downloads and both English and Polish language discussion forums.
+www.my-symbian.com/ - 82k - 8 Jan 2007 - Cached - Similar pages
+All About Symbian - News, Reviews, and Software for Symbian ...Community
+offering user support, news, reviews and software for Symbian based phones.
+www.allaboutsymbian.com/ - 42k - 8 Jan 2007 - Cached - Similar pages
+The premier place for symbian users, supported with the No. one ...The
+premier place for symbian users introduces various researches for smarth
+phone users like: Error Fixes, Modding, Guides, Tutorials tips & tricks, ...
+www.symbian-freak.com/ - 102k - Cached - Similar pages
+Symbian OS mobile smartphone operating system - News, articles ...Resource
+site for Symbian developers. Includes news, product review, technical
+information on Symbian based devices and discussion forums.
+www.symbianone.com/ - 93k - Cached - Similar pages
+Symbian Themes: WelcomeThe premier site for sharing and customzing themes,
+wallpapers, ringtones and more for a wide variety of mobile devices such as
+mobile phones, ...
+symbian.mobilethemes.com/ - 92k - Cached - Similar pages
+Symbian OS - the mobile operating systemSoftware licensing company that
+develops and licenses Symbian OS, an open industry standard operating system
+for data enabled mobile phones.
+www.symbian.com/ - Similar pages
+Phones - www.symbian.com/phones/index.html
+OS - www.symbian.com/symbianos/index.html
+Fast facts - www.symbian.com/about/fastfacts/fastfacts.html
+Developer tools & downloads - www.symbian.com/developer/downloads/index.html
+More results from www.symbian.com »
+Symbian: Developer: homeThe people behind the EPOC operating system.
+Symbian's mission is to set the standard for mobile wireless operating
+systems and to enable a mass market for ...
+www.symbian.com/developer/ - Similar pages
+Symbian OS - Wikipedia, the free encyclopediaArticle discussing the
+operating system, its history and devices that use it.
+en.wikipedia.org/wiki/Symbian_OS - 64k - Cached - Similar pages
+My-Symbian.com - Symbian OS Communicators and Smartphones Info CenterPortal
+for users of Symbian based communicators and smartphones. Includes news,
+software downloads and both English and Polish language discussion forums.
+www.my-symbian.com/ - 82k - 8 Jan 2007 - Cached - Similar pages
+All About Symbian - News, Reviews, and Software for Symbian ...Community
+offering user support, news, reviews and software for Symbian based phones.
+www.allaboutsymbian.com/ - 42k - 8 Jan 2007 - Cached - Similar pages
+The premier place for symbian users, supported with the No. one ...The
+premier place for symbian users introduces various researches for smarth
+phone users like: Error Fixes, Modding, Guides, Tutorials tips & tricks, ...
+www.symbian-freak.com/ - 102k - Cached - Similar pages
+Symbian OS mobile smartphone operating system - News, articles ...Resource
+site for Symbian developers. Includes news, product review, technical
+information on Symbian based devices and discussion forums.
+www.symbianone.com/ - 93k - Cached - Similar pages
+Symbian Themes: WelcomeThe premier site for sharing and customzing themes,
+wallpapers, ringtones and more for a wide variety of mobile devices such as
+mobile phones, ...
+symbian.mobilethemes.com/ - 92k - Cached - Similar pages
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/testdata/EmailSettings/POPSettings_test908.txt	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,39 @@
+#  ban-pramodd02 server
+__type__   = Pop3Settings
+
+#ServerName = msexchange2k.closedtest.intra
+PopServerAddress = msexchange2k.closedtest.intra
+#PopLoginName  = test908
+#PopPassword   = test908
+
+PopIapList = POP001 POP002
+#PopIAP = 1
+#PopCommDbDialogPref 
+#PopIAPIndex = 0
+
+POP001_PopIAP = 1
+POP001_PopCommDbDialogPref = TCommDbDialogPref::ECommDbDialogPrefDoNotPrompt
+POP001_PopIAPIndex = 0
+
+POP002_PopIAP = 1
+POP002_PopCommDbDialogPref = TCommDbDialogPref::ECommDbDialogPrefDoNotPrompt
+POP002_PopIAPIndex = 0
+
+SmtpServerAddress = msexchange2k.closedtest.intra
+#SmtpEmailAddress = test908@msexchange2k.closedtest.intra
+#SmtpReceiptAddress = test908@msexchange2k.closedtest.intra
+#SmtpUserAddress = test908@msexchange2k.closedtest.intra
+#SmtpSetReplyToAddress = test908@msexchange2k.closedtest.intra
+#SmtpSetLoginName = test908
+#SmtpSetPassword = test908
+
+SmtpIapList = SMTP001 SMTP002 
+
+SMTP001_SmtpIAP = 1
+SMTP001_SmtpCommDbDialogPref = TCommDbDialogPref::ECommDbDialogPrefDoNotPrompt
+SMTP001_SmtpIAPIndex = 0
+
+
+SMTP001_SmtpIAP = 1
+SMTP001_SmtpCommDbDialogPref = TCommDbDialogPref::ECommDbDialogPrefDoNotPrompt
+SMTP001_SmtpIAPIndex = 0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/pop/testdata/plainbody/smoketest_email.ini	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,691 @@
+#####################Start:MSG-POP3-CREATENEWMESSAGE-0001####################################
+
+[0001-InitNtRas]
+
+[0001-ResetMessageStore]
+
+[0001-CheckChildrenCountOutbox1]
+Expectedcount 		= 0
+FolderName 		= KMsvGlobalOutBoxIndexEntryId
+
+[0001-CreatePopAccount]
+PopAccountName		= PopAccountZ
+PopConfigFileName	= c:\smoketest\EmailSettings\POPSettings_test908.txt
+
+[0001-ConnectPop3Server]
+PopAccountName		= PopAccountZ
+
+[0001-DeleteAllPopChildren]
+PopAccountName		= PopAccountZ
+
+[0001-CheckChildrenCountRemote0]
+PopAccountName		= PopAccountZ
+Expectedcount		= 0
+
+[0001-DisConnectPop3Server]
+PopAccountName		= PopAccountZ
+
+[0001-SmtpCreateNewMessageWithPlainBodyText]
+FolderName		= KMsvGlobalOutBoxIndexEntryId
+EmailFileName		= c:\smoketest\EmailMessage\20KBody.txt
+Subject			= 20KBody
+
+[0001-CheckChildrenCountOutbox2]
+Expectedcount 		= 1
+FolderName 		= KMsvGlobalOutBoxIndexEntryId
+
+[0001-SendSmtpMessage1]
+Subject			= 20KBody
+ParentFolderName	= KMsvGlobalOutBoxIndexEntryId
+
+[0001-CheckChildrenCountSentItems]
+Expectedcount 		= 1
+FolderName 		= KMsvSentEntryId
+
+
+[0001-PopInvokeAsyncFunction1]
+PopAccountName		= PopAccountZ
+EmailSize		= 500000
+PopLimit		= -1
+PopCommand 		= KPOP3MTMPopulate
+
+[0001-CheckChildrenCountRemote1]
+PopAccountName		= PopAccountZ
+FolderName		= Inbox
+Expectedcount		= 1
+
+[0001-ComparePopEmailMsgs]
+InboxFolder		= KMsvLocalServiceIndexEntryId
+SentFolder 		= KMsvSentEntryId
+PopAccountName 		= PopAccountZ
+NumTest 		= 1
+
+NumOfLines0 		= 349
+FooterExpected0 	= 0
+NumOfLinesHtml0 	= 0
+Description0 		= 20KBody
+NumOfAttachments0 	= 0
+FooterSize0 		= 0
+#####################End:MSG-POP3-CREATENEWMESSAGE-0001####################################
+#####################Start:MSG-POP3-CREATENEWMESSAGE-0002####################################
+
+[0002-InitNtRas]
+
+[0002-ResetMessageStore]
+
+[0002-CheckChildrenCountOutbox1]
+Expectedcount 		= 0
+FolderName 		= KMsvGlobalOutBoxIndexEntryId
+
+[0002-CreatePopAccount]
+PopAccountName		= PopAccountZ
+PopConfigFileName	= c:\smoketest\EmailSettings\POPSettings_test908.txt
+
+[0002-ConnectPop3Server]
+PopAccountName		= PopAccountZ
+
+[0002-DeleteAllPopChildren]
+PopAccountName		= PopAccountZ
+
+[0002-CheckChildrenCountRemote0]
+PopAccountName		= PopAccountZ
+Expectedcount		= 0
+
+[0002-DisConnectPop3Server]
+PopAccountName		= PopAccountZ
+
+[0002-SmtpCreateNewMessageWithPlainBodyText]
+FolderName		= KMsvGlobalOutBoxIndexEntryId
+EmailFileName		= c:\smoketest\EmailMessage\100KBody.txt
+Subject			= 100KBody
+
+[0002-CheckChildrenCountOutbox2]
+Expectedcount 		= 1
+FolderName 		= KMsvGlobalOutBoxIndexEntryId
+
+[0002-SendSmtpMessage1]
+Subject			= 100KBody
+ParentFolderName	= KMsvGlobalOutBoxIndexEntryId
+
+[0002-CheckChildrenCountSentItems]
+Expectedcount 		= 1
+FolderName 		= KMsvSentEntryId
+
+
+[0002-PopInvokeAsyncFunction1]
+PopAccountName		= PopAccountZ
+EmailSize		= 500000
+PopLimit		= -1
+PopCommand 		= KPOP3MTMPopulate
+
+[0002-CheckChildrenCountRemote1]
+PopAccountName		= PopAccountZ
+FolderName		= Inbox
+Expectedcount		= 1
+
+[0002-ComparePopEmailMsgs]
+InboxFolder		= KMsvLocalServiceIndexEntryId
+SentFolder 		= KMsvSentEntryId
+PopAccountName 		= PopAccountZ
+NumTest 		= 1
+
+NumOfLines0 		= 1669
+FooterExpected0 	= 0
+NumOfLinesHtml0 	= 0
+Description0 		= 100KBody
+NumOfAttachments0 	= 0
+FooterSize0 		= 0
+#####################End:MSG-POP3-CREATENEWMESSAGE-0002####################################
+#####################Start:MSG-POP3-CREATEFORWARDMESSAGE-0001####################################
+
+[0003-InitNtRas]
+
+[0003-ResetMessageStore]
+
+[0003-CreatePopAccount]
+PopAccountName		= PopAccountZ
+PopConfigFileName	= c:\smoketest\EmailSettings\POPSettings_test908.txt
+
+[0003-ConnectPop3Server]
+PopAccountName		= PopAccountZ
+
+[0003-DeleteAllPopChildren]
+PopAccountName		= PopAccountZ
+
+[0003-CheckChildrenCountRemote0]
+PopAccountName		= PopAccountZ
+Expectedcount		= 0
+
+[0003-DisConnectPop3Server]
+PopAccountName		= PopAccountZ
+
+[0003-SmtpCreateNewMessageWithPlainBodyText]
+FolderName		= KMsvGlobalOutBoxIndexEntryId
+EmailFileName		= c:\smoketest\EmailMessage\10KBody.txt
+Subject			= 10KBody
+
+[0003-CheckChildrenCountOutbox]
+Expectedcount 		= 1
+FolderName 		= KMsvGlobalOutBoxIndexEntryId
+
+[0003-SendSmtpMessage1]
+Subject			= 10KBody
+ParentFolderName	= KMsvGlobalOutBoxIndexEntryId
+
+[0003-CheckChildrenCountSentItems]
+Expectedcount 		= 1
+FolderName 		= KMsvSentEntryId
+
+
+[0003-PopInvokeAsyncFunction1]
+PopAccountName		= PopAccountZ
+EmailSize		= 500000
+PopLimit		= -1
+PopCommand 		= KPOP3MTMPopulate
+
+[0003-CheckChildrenCountRemote1]
+PopAccountName		= PopAccountZ
+Expectedcount		= 1
+
+[0003-CreateForwardMessage]
+ServiceType		= POP
+PopAccountName		= PopAccountZ
+CommandName		= KSMTPMTMCreateForwardEmailMessage
+FolderName		= KMsvGlobalOutBoxIndexEntryId
+SubjectOfExistingMsg	= 10KBody
+
+[0003-SendSmtpMessage2]
+Subject			= Fwd: 10KBody
+ParentFolderName	= KMsvGlobalOutBoxIndexEntryId
+
+[0003-PopInvokeAsyncFunction2]
+PopAccountName		= PopAccountZ
+EmailSize		= 500000
+PopLimit		= -1
+PopCommand 		= KPOP3MTMPopulate
+
+[0003-CheckChildrenCountRemote2]
+PopAccountName		= PopAccountZ
+Expectedcount		= 2
+
+[0003-ComparePopEmailMsgs]
+InboxFolder		= KMsvLocalServiceIndexEntryId
+SentFolder 		= KMsvSentEntryId
+PopAccountName 		= PopAccountZ
+NumTest 		= 2
+
+NumOfLines0 		= 175
+FooterExpected0 	= 0
+NumOfLinesHtml0 	= 0
+Description0 		= 10KBody
+NumOfAttachments0 	= 0
+FooterSize0 		= 0
+
+NumOfLines1 		= 182
+FooterExpected1 	= 0
+NumOfLinesHtml1 	= 0
+Description1 		= Fwd: 10KBody
+NumOfAttachments1 	= 0
+FooterSize1 		= 0
+#####################End:MSG-POP3-CREATEFORWARDMESSAGE-0001####################################
+#####################Start:MSG-POP3-CREATEFORWARDMESSAGE-0002####################################
+
+[0004-InitNtRas]
+
+[0004-ResetMessageStore]
+
+[0004-CreatePopAccount]
+PopAccountName		= PopAccountZ
+PopConfigFileName	= c:\smoketest\EmailSettings\POPSettings_test908.txt
+
+[0004-ConnectPop3Server]
+PopAccountName		= PopAccountZ
+
+[0004-DeleteAllPopChildren]
+PopAccountName		= PopAccountZ
+
+[0004-CheckChildrenCountRemote0]
+PopAccountName		= PopAccountZ
+Expectedcount		= 0
+
+[0004-DisConnectPop3Server]
+PopAccountName		= PopAccountZ
+
+[0004-SmtpCreateNewMessageWithPlainBodyText]
+FolderName		= KMsvGlobalOutBoxIndexEntryId
+EmailFileName		= c:\smoketest\EmailMessage\100KBody.txt
+Subject			= 100KBody
+
+[0004-CheckChildrenCountOutbox]
+Expectedcount 		= 1
+FolderName 		= KMsvGlobalOutBoxIndexEntryId
+
+[0004-SendSmtpMessage1]
+Subject			= 100KBody
+ParentFolderName	= KMsvGlobalOutBoxIndexEntryId
+
+[0004-CheckChildrenCountSentItems]
+Expectedcount 		= 1
+FolderName 		= KMsvSentEntryId
+
+
+[0004-PopInvokeAsyncFunction1]
+PopAccountName		= PopAccountZ
+EmailSize		= 500000
+PopLimit		= -1
+PopCommand 		= KPOP3MTMPopulate
+
+[0004-CheckChildrenCountRemote1]
+PopAccountName		= PopAccountZ
+Expectedcount		= 1
+
+[0004-CreateForwardMessage]
+ServiceType		= POP
+PopAccountName		= PopAccountZ
+CommandName		= KSMTPMTMCreateForwardEmailMessage
+FolderName		= KMsvGlobalOutBoxIndexEntryId
+SubjectOfExistingMsg	= 100KBody
+
+[0004-SendSmtpMessage2]
+Subject			= Fwd: 100KBody
+ParentFolderName	= KMsvGlobalOutBoxIndexEntryId
+
+[0004-PopInvokeAsyncFunction2]
+PopAccountName		= PopAccountZ
+EmailSize		= 500000
+PopLimit		= -1
+PopCommand 		= KPOP3MTMPopulate
+
+[0004-CheckChildrenCountRemote2]
+PopAccountName		= PopAccountZ
+Expectedcount		= 2
+
+[0004-ComparePopEmailMsgs]
+InboxFolder		= KMsvLocalServiceIndexEntryId
+SentFolder 		= KMsvSentEntryId
+PopAccountName 		= PopAccountZ
+NumTest 		= 2
+
+NumOfLines0 		= 1669
+FooterExpected0 	= 0
+NumOfLinesHtml0 	= 0
+Description0 		= 100KBody
+NumOfAttachments0 	= 0
+FooterSize0 		= 0
+
+NumOfLines1 		= 1676
+FooterExpected1 	= 0
+NumOfLinesHtml1 	= 0
+Description1 		= Fwd: 100KBody
+NumOfAttachments1 	= 0
+FooterSize1 		= 0
+#####################End:MSG-POP3-CREATEFORWARDMESSAGE-0002####################################
+#####################Start:MSG-POP3-CREATEFORWARDMESSAGE-0003####################################
+
+[0005-InitNtRas]
+
+[0005-ResetMessageStore]
+
+[0005-CreatePopAccount]
+PopAccountName		= PopAccountZ
+PopConfigFileName	= c:\smoketest\EmailSettings\POPSettings_test908.txt
+
+[0005-ConnectPop3Server]
+PopAccountName		= PopAccountZ
+
+[0005-DeleteAllPopChildren]
+PopAccountName		= PopAccountZ
+
+[0005-CheckChildrenCountRemote0]
+PopAccountName		= PopAccountZ
+Expectedcount		= 0
+
+[0005-DisConnectPop3Server]
+PopAccountName		= PopAccountZ
+
+[0005-SmtpCreateNewMessageWithPlainBodyText]
+FolderName		= KMsvGlobalOutBoxIndexEntryId
+EmailFileName		= c:\smoketest\EmailMessage\512KBody.txt
+Subject			= 512KBody
+
+[0005-CheckChildrenCountOutbox]
+Expectedcount 		= 1
+FolderName 		= KMsvGlobalOutBoxIndexEntryId
+
+[0005-SendSmtpMessage1]
+Subject			= 512KBody
+ParentFolderName	= KMsvGlobalOutBoxIndexEntryId
+
+[0005-CheckChildrenCountSentItems]
+Expectedcount 		= 1
+FolderName 		= KMsvSentEntryId
+
+
+[0005-PopInvokeAsyncFunction1]
+PopAccountName		= PopAccountZ
+EmailSize		= 600000
+PopLimit		= -1
+PopCommand 		= KPOP3MTMPopulate
+
+[0005-CheckChildrenCountRemote1]
+PopAccountName		= PopAccountZ
+Expectedcount		= 1
+
+[0005-CreateForwardMessage]
+ServiceType		= POP
+PopAccountName		= PopAccountZ
+CommandName		= KSMTPMTMCreateForwardEmailMessage
+FolderName		= KMsvGlobalOutBoxIndexEntryId
+SubjectOfExistingMsg	= 512KBody
+
+[0005-SendSmtpMessage2]
+Subject			= Fwd: 512KBody
+ParentFolderName	= KMsvGlobalOutBoxIndexEntryId
+
+[0005-PopInvokeAsyncFunction2]
+PopAccountName		= PopAccountZ
+EmailSize		= 600000
+PopLimit		= -1
+PopCommand 		= KPOP3MTMPopulate
+
+[0005-CheckChildrenCountRemote2]
+PopAccountName		= PopAccountZ
+Expectedcount		= 2
+
+[0005-ComparePopEmailMsgs]
+InboxFolder		= KMsvLocalServiceIndexEntryId
+SentFolder 		= KMsvSentEntryId
+PopAccountName 		= PopAccountZ
+NumTest 		= 2
+
+NumOfLines0 		= 8483
+FooterExpected0 	= 0
+NumOfLinesHtml0 	= 0
+Description0 		= 512KBody
+NumOfAttachments0 	= 0
+FooterSize0 		= 0
+
+NumOfLines1 		= 8490
+FooterExpected1 	= 0
+NumOfLinesHtml1 	= 0
+Description1 		= Fwd: 512KBody
+NumOfAttachments1 	= 0
+FooterSize1 		= 0
+#####################End:MSG-POP3-CREATEFORWARDMESSAGE-0003####################################
+#####################Start:MSG-POP3-CREATEREPLYMESSAGE-0001####################################
+
+[0006-InitNtRas]
+
+[0006-ResetMessageStore]
+
+[0006-CreatePopAccount]
+PopAccountName		= PopAccountZ
+PopConfigFileName	= c:\smoketest\EmailSettings\POPSettings_test908.txt
+
+[0006-ConnectPop3Server]
+PopAccountName		= PopAccountZ
+
+[0006-DeleteAllPopChildren]
+PopAccountName		= PopAccountZ
+
+[0006-CheckChildrenCountRemote0]
+PopAccountName		= PopAccountZ
+Expectedcount		= 0
+
+[0006-DisConnectPop3Server]
+PopAccountName		= PopAccountZ
+
+[0006-SmtpCreateNewMessageWithPlainBodyText]
+FolderName		= KMsvGlobalOutBoxIndexEntryId
+EmailFileName		= c:\smoketest\EmailMessage\10KBody.txt
+Subject			= 10KBody
+
+[0006-CheckChildrenCountOutbox]
+Expectedcount 		= 1
+FolderName 		= KMsvGlobalOutBoxIndexEntryId
+
+[0006-SendSmtpMessage1]
+Subject			= 10KBody
+ParentFolderName	= KMsvGlobalOutBoxIndexEntryId
+
+[0006-CheckChildrenCountSentItems]
+Expectedcount 		= 1
+FolderName 		= KMsvSentEntryId
+
+
+[0006-PopInvokeAsyncFunction1]
+PopAccountName		= PopAccountZ
+EmailSize		= 500000
+PopLimit		= -1
+PopCommand 		= KPOP3MTMPopulate
+
+[0006-CheckChildrenCountRemote1]
+PopAccountName		= PopAccountZ
+Expectedcount		= 1
+
+[0006-CreateReplyMessage]
+ServiceType		= POP
+PopAccountName		= PopAccountZ
+CommandName		= KSMTPMTMCreateReplyEmailMessage
+FolderName		= KMsvGlobalOutBoxIndexEntryId
+SubjectOfExistingMsg	= 10KBody
+
+[0006-SendSmtpMessage2]
+Subject			= Re: 10KBody
+ParentFolderName	= KMsvGlobalOutBoxIndexEntryId
+
+[0006-PopInvokeAsyncFunction2]
+PopAccountName		= PopAccountZ
+EmailSize		= 500000
+PopLimit		= -1
+PopCommand 		= KPOP3MTMPopulate
+
+[0006-CheckChildrenCountRemote2]
+PopAccountName		= PopAccountZ
+Expectedcount		= 2
+
+[0006-ComparePopEmailMsgs]
+InboxFolder		= KMsvLocalServiceIndexEntryId
+SentFolder 		= KMsvSentEntryId
+PopAccountName 		= PopAccountZ
+NumTest 		= 2
+
+NumOfLines0 		= 175
+FooterExpected0 	= 0
+NumOfLinesHtml0 	= 0
+Description0 		= 10KBody
+NumOfAttachments0 	= 0
+FooterSize0 		= 0
+
+NumOfLines1 		= 182
+FooterExpected1 	= 0
+NumOfLinesHtml1 	= 0
+Description1 		= Re: 10KBody
+NumOfAttachments1 	= 0
+FooterSize1 		= 0
+#####################End:MSG-POP3-CREATEREPLYMESSAGE-0001####################################
+#####################Start:MSG-POP3-CREATEREPLYMESSAGE-0002####################################
+
+[0007-InitNtRas]
+
+[0007-ResetMessageStore]
+
+[0007-CreatePopAccount]
+PopAccountName		= PopAccountZ
+PopConfigFileName	= c:\smoketest\EmailSettings\POPSettings_test908.txt
+
+[0007-ConnectPop3Server]
+PopAccountName		= PopAccountZ
+
+[0007-DeleteAllPopChildren]
+PopAccountName		= PopAccountZ
+
+[0007-CheckChildrenCountRemote0]
+PopAccountName		= PopAccountZ
+Expectedcount		= 0
+
+[0007-DisConnectPop3Server]
+PopAccountName		= PopAccountZ
+
+[0007-SmtpCreateNewMessageWithPlainBodyText]
+FolderName		= KMsvGlobalOutBoxIndexEntryId
+EmailFileName		= c:\smoketest\EmailMessage\100KBody.txt
+Subject			= 100KBody
+
+[0007-CheckChildrenCountOutbox]
+Expectedcount 		= 1
+FolderName 		= KMsvGlobalOutBoxIndexEntryId
+
+[0007-SendSmtpMessage1]
+Subject			= 100KBody
+ParentFolderName	= KMsvGlobalOutBoxIndexEntryId
+
+[0007-CheckChildrenCountSentItems]
+Expectedcount 		= 1
+FolderName 		= KMsvSentEntryId
+
+
+[0007-PopInvokeAsyncFunction1]
+PopAccountName		= PopAccountZ
+EmailSize		= 500000
+PopLimit		= -1
+PopCommand 		= KPOP3MTMPopulate
+
+[0007-CheckChildrenCountRemote1]
+PopAccountName		= PopAccountZ
+Expectedcount		= 1
+
+[0007-CreateReplyMessage]
+ServiceType		= POP
+PopAccountName		= PopAccountZ
+CommandName		= KSMTPMTMCreateReplyEmailMessage
+FolderName		= KMsvGlobalOutBoxIndexEntryId
+SubjectOfExistingMsg	= 100KBody
+
+[0007-SendSmtpMessage2]
+Subject			= Re: 100KBody
+ParentFolderName	= KMsvGlobalOutBoxIndexEntryId
+
+[0007-PopInvokeAsyncFunction2]
+PopAccountName		= PopAccountZ
+EmailSize		= 500000
+PopLimit		= -1
+PopCommand 		= KPOP3MTMPopulate
+
+[0007-CheckChildrenCountRemote2]
+PopAccountName		= PopAccountZ
+Expectedcount		= 2
+
+[0007-ComparePopEmailMsgs]
+InboxFolder		= KMsvLocalServiceIndexEntryId
+SentFolder 		= KMsvSentEntryId
+PopAccountName 		= PopAccountZ
+NumTest 		= 2
+
+NumOfLines0 		= 1669
+FooterExpected0 	= 0
+NumOfLinesHtml0 	= 0
+Description0 		= 100KBody
+NumOfAttachments0 	= 0
+FooterSize0 		= 0
+
+NumOfLines1 		= 1676
+FooterExpected1 	= 0
+NumOfLinesHtml1 	= 0
+Description1 		= Re: 100KBody
+NumOfAttachments1 	= 0
+FooterSize1 		= 0
+#####################End:MSG-POP3-CREATEREPLYMESSAGE-0002####################################
+#####################Start:MSG-POP3-CREATEREPLYMESSAGE-0003####################################
+
+[0008-InitNtRas]
+
+[0008-ResetMessageStore]
+
+[0008-CreatePopAccount]
+PopAccountName		= PopAccountZ
+PopConfigFileName	= c:\smoketest\EmailSettings\POPSettings_test908.txt
+
+[0008-ConnectPop3Server]
+PopAccountName		= PopAccountZ
+
+[0008-DeleteAllPopChildren]
+PopAccountName		= PopAccountZ
+
+[0008-CheckChildrenCountRemote0]
+PopAccountName		= PopAccountZ
+Expectedcount		= 0
+
+[0008-DisConnectPop3Server]
+PopAccountName		= PopAccountZ
+
+[0008-SmtpCreateNewMessageWithPlainBodyText]
+FolderName		= KMsvGlobalOutBoxIndexEntryId
+EmailFileName		= c:\smoketest\EmailMessage\512KBody.txt
+Subject			= 512KBody
+
+[0008-CheckChildrenCountOutbox]
+Expectedcount 		= 1
+FolderName 		= KMsvGlobalOutBoxIndexEntryId
+
+[0008-SendSmtpMessage1]
+Subject			= 512KBody
+ParentFolderName	= KMsvGlobalOutBoxIndexEntryId
+
+[0008-CheckChildrenCountSentItems]
+Expectedcount 		= 1
+FolderName 		= KMsvSentEntryId
+
+
+[0008-PopInvokeAsyncFunction1]
+PopAccountName		= PopAccountZ
+EmailSize		= 600000
+PopLimit		= -1
+PopCommand 		= KPOP3MTMPopulate
+
+[0008-CheckChildrenCountRemote1]
+PopAccountName		= PopAccountZ
+Expectedcount		= 1
+
+[0008-CreateReplyMessage]
+ServiceType		= POP
+PopAccountName		= PopAccountZ
+CommandName		= KSMTPMTMCreateReplyEmailMessage
+FolderName		= KMsvGlobalOutBoxIndexEntryId
+SubjectOfExistingMsg	= 512KBody
+
+[0008-SendSmtpMessage2]
+Subject			= Re: 512KBody
+ParentFolderName	= KMsvGlobalOutBoxIndexEntryId
+
+[0008-PopInvokeAsyncFunction2]
+PopAccountName		= PopAccountZ
+EmailSize		= 600000
+PopLimit		= -1
+PopCommand 		= KPOP3MTMPopulate
+
+[0008-CheckChildrenCountRemote2]
+PopAccountName		= PopAccountZ
+Expectedcount		= 2
+
+[0008-ComparePopEmailMsgs]
+InboxFolder		= KMsvLocalServiceIndexEntryId
+SentFolder 		= KMsvSentEntryId
+PopAccountName 		= PopAccountZ
+NumTest 		= 2
+
+NumOfLines0 		= 8483
+FooterExpected0 	= 0
+NumOfLinesHtml0 	= 0
+Description0 		= 512KBody
+NumOfAttachments0 	= 0
+FooterSize0 		= 0
+
+NumOfLines1 		= 8490
+FooterExpected1 	= 0
+NumOfLinesHtml1 	= 0
+Description1 		= Re: 512KBody
+NumOfAttachments1 	= 0
+FooterSize1 		= 0
+#####################End:MSG-POP3-CREATEREPLYMESSAGE-0003####################################
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/group/T_SmtpServer.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,77 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Project definition file for Smtp test Server
+// 
+//
+
+	CAPABILITY 		ALL -TCB
+	TARGET			t_msgsmtpserver.exe
+	TARGETTYPE		exe
+	UID			0x1000007A 0x10274070
+	VENDORID 		0x70000001
+
+
+// Include the Framework 
+#include "../../../framework/group/T_MsgFramework.mph"
+
+
+SYSTEMINCLUDE		/epoc32/include
+SYSTEMINCLUDE		/epoc32/include/test
+SYSTEMINCLUDE		/epoc32/include/comms-infras
+
+USERINCLUDE 	../inc
+
+
+SOURCEPATH	../src
+SOURCE		T_SmtpServer.cpp
+SOURCE		T_MsgAsyncStepSMTP.cpp
+SOURCE		T_MsgSyncStepSMTP.cpp
+SOURCE		T_MsgSharedDataSmtp.cpp
+SOURCE		T_SendSmtpMessage.cpp
+SOURCE		T_UtilsSendEmail.cpp
+SOURCE		T_CreateSmtpMessageFromEmailFile.cpp
+SOURCE		T_SmtpSendEmail.cpp
+SOURCE		ImCltCvRecv.cpp
+SOURCE		Local_imcvrecv.cpp
+SOURCE		Local_imutdll.cpp
+SOURCE		T_StartRamUsageTimer.cpp
+SOURCE		T_StopRamUsageTimer.cpp
+SOURCE		T_RetrievePlainBodyTextAndCompare.cpp
+SOURCE		T_SmtpCreateNewMessageWithPlainBodyText.cpp
+SOURCE		T_SmtpCreateForwardMessage.cpp
+SOURCE		T_SmtpCreateReplyMessage.cpp
+SOURCE		T_CreateSmtpMobilityAccount.cpp
+SOURCE		T_CreateSmtpAccount.cpp
+SOURCE		T_CheckSmtpSNAPSetting.cpp
+SOURCE		T_ModifySmtpSettings.cpp
+SOURCE		T_RemoveSmtpSNAPSetting.cpp
+SOURCE		T_CheckSmtpBMSetting.cpp
+
+LIBRARY 	testexecuteutils.lib
+LIBRARY		testexecutelogclient.lib
+LIBRARY		imut.lib 
+LIBRARY		bafl.lib
+LIBRARY		etext.lib
+LIBRARY		msgs.lib
+LIBRARY		euser.lib
+LIBRARY		imcm.lib
+LIBRARY		efsrv.lib
+LIBRARY		charconv.lib
+LIBRARY		estor.lib
+LIBRARY		t_msgutilityserver.lib
+LIBRARY		hal.lib
+//LIBRARY		instrumentationhandler.lib
+LIBRARY		netmeta.lib
+
+EPOCHEAPSIZE 0x1000 0x800000
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/group/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,19 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Component description file for Smtp test Server
+// 
+//
+
+PRJ_TESTMMPFILES
+T_SmtpServer.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/ImCltCvRecv.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,95 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+#ifndef __IM_CLT_CV_RECV_H__
+#define __IM_CLT_CV_RECV_H__
+
+
+// User includes
+#include "Local_imcvrecv.h"
+
+
+// Epoc includes
+#include <msvapi.h>
+
+
+/**
+Implements the Rfc822 specication for creating a message
+*/
+class CImCltRecvConvert : public CLocalImRecvConvert
+	{
+friend class CLocalMimeParser;
+public:
+	/*IMPORT_C*/ static CImCltRecvConvert* NewLC( RFs& anFs,CMsvEntry* aClientEntry,TUid aMsgType,TMsvId aEmailServiceId);
+	/*IMPORT_C*/ static CImCltRecvConvert* NewL( RFs& anFs,CMsvEntry* aClientEntry,TUid aMsgType,TMsvId aEmailServiceId);
+	/*IMPORT_C*/ ~CImCltRecvConvert();
+
+	/*IMPORT_C*/ void ResetL();
+	/*IMPORT_C*/ void ResetForHeadersL();
+
+	/*IMPORT_C*/ TInt ParseNextFieldL(const TDesC8& aSourceLine);
+	/*IMPORT_C*/ TMsvId MessageCompleteL();
+	/*IMPORT_C*/ void MessageCompleteL(TMsvEmailEntry aEmailEntry);
+	/*IMPORT_C*/ TMsvEmailEntry MessageEntryDetailsL();
+
+	inline void SetMsvId(TMsvId aId);
+	inline CMsvEntry& ClientEntry();
+	inline TMsvId EntryId();	
+
+private:
+	CImCltRecvConvert(RFs& anFs,CMsvEntry* aClientEntry,TUid aMsgType,TMsvId aEmailServiceId);
+	void ConstructL(RFs& anFs);
+
+	void ParseNextLineL(const TDesC8& aSourceLine);
+	void ParseBodyLineL(const TDesC8& aSourceLine);
+	void ParseMimeLineL(const TDesC8& aSourceLine);
+	void EndOfHeaderProcessingL();
+	TBool CreateNonMIMEFolderEntryL(TMsvId aCurrentId);
+
+	TInt Value(const TUint8*&);
+	void Whitespace(const TUint8*&);
+
+	TBool CreateAttachmentL();
+	void WriteToAttachmentL(const TDesC8& text);
+
+	void MoveUpFromFolderEntryL();
+	void MoveToParentEntryL();
+	void UpdateMultipartDataL();
+
+	TBool StoreEntryDataL();
+
+	void StoreEntryStreamsL();
+	void StoreEntryStreamsL(TInt aSettings);
+	void CreateEntryL();
+	void StoreMessageEntryDetailsL();
+	
+private:
+	CMsvEntry* iClientEntry;
+	CMsvServerEntry* iNullServerEntry;
+	};
+
+#include "ImCltCvRecv.inl"
+
+#endif 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/ImCltCvRecv.inl	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,37 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ImCltCvRecv.inl
+// 
+//
+
+
+inline void CImCltRecvConvert::SetMsvId(TMsvId aId)
+	{
+	iClientEntry->SetEntryL(aId);
+	iPopulateMessage = (iClientEntry->Entry().iType == KUidMsvMessageEntry);
+	iRootEntryId = aId;
+	}
+
+inline CMsvEntry& CImCltRecvConvert::ClientEntry()
+	{
+	return *iClientEntry;
+	}
+
+inline TMsvId CImCltRecvConvert::EntryId()
+	{
+	if (iClientEntry->Entry().Id() == KMsvRootIndexEntryId)
+		return iSavedEntryId;
+	else
+		return iClientEntry->Entry().Id();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/Local_imcvrecv.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,471 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+
+#ifndef __LOCAL_IMCVRECV_H__
+#define __LOCAL_IMCVRECV_H__
+
+// epoc include
+#include <s32mem.h>
+#include <badesca.h> // required for CBufSeg
+#include <msvstd.h>
+#include <msventry.h>
+#include <msvstore.h>
+#include <msvuids.h>
+#include <msvids.h>
+#include <miutatch.h>
+#include <miutlog.h>
+#include <imcvcodc.h>
+#include <imcvtext.h>
+
+// Forward Declaration
+class CImHeader;
+class CRichText;
+class CLocalMimeParser;
+class CLocalImRecvConvert;
+class RFs;
+class TImConvert;
+class TImAttachmentFile;
+class CImcvUtils;
+class CMsvBodyText;
+
+const TInt KHeaderBufferLength = 100;
+
+// Max filename length
+const TInt MaxMimeParameterValueLength = 256;
+// Likely maximum size of an encoded parameter value decoding to a length of 
+// MaxMimeParameterValueLength. In quoted printable usually 3 encoded characters
+// per decoded character. 60 characters is given to allow for delimiters and
+// charset information.
+const TInt KMimeEncodedParameterSize = MaxMimeParameterValueLength * 3 + 60;
+
+const TInt KConversionRemainderLength=20;
+
+//boundary stuff
+const TInt KBoundaryNotFound	=0;
+const TInt KBoundaryFound		=1;
+const TInt KBoundaryError		=2;
+
+
+/**
+Stores the details about a message nneded in the Message entry.
+*/
+struct TParentDetails
+	{
+	TInt				iSize;
+	TBool				iAttachment;
+	TBool				iMHTML;
+	TImEmailFolderType  iFolder;	// Only interested in the Related type
+	};
+
+
+/**
+@internalComponent
+@released
+*/
+class CLocalRfc822Token : public CBase
+	{
+public:
+	enum THeaderPart { EUnknown, ENotFinished, EFrom, EReplyTo, ETo, ECc, EBcc, ESubject, EDate, EMessageId, EPriority, EImportance, EReturnReceiptTo, EEndOfHeader };
+	THeaderPart iHeaderPart;
+	TBool iLastToken;
+	TBool iFirstLine;
+	TBool i822FieldsExist;
+
+	/*IMPORT_C*/ static CLocalRfc822Token* NewLC();
+	/*IMPORT_C*/ void Reset();
+	inline HBufC8* OutputLine();
+	/*IMPORT_C*/ virtual void ParseNextLineL( const TDesC8& aSourceLine );
+	/*IMPORT_C*/ ~CLocalRfc822Token();
+	inline TBool LastToken();
+
+	inline void SetImRecvConvert( CLocalImRecvConvert* );
+private:
+	TBool MatchAndRemoveL( const TDesC8& );
+	TBool PriorityAndReceiptsMatchAndRemoveL(THeaderPart aPriority);
+
+	CLocalRfc822Token();
+	void ConstructL();
+
+private:
+	TBuf8<KMaxIMailHeaderReadLineLength+1> iInputLine;
+	TBuf8<KMaxIMailHeaderReadLineLength+1> iBufferedInput;
+	HBufC8* iOutputLine;
+	CLocalImRecvConvert* iImRecvConvert;
+	};
+
+
+/**
+@internalTechnology
+@released
+*/
+class CLocalImRecvConvert : public CBase
+	{
+friend class CLocalMimeParser;
+public:
+	/*IMPORT_C*/ static CLocalImRecvConvert* NewLC( RFs& anFs, CMsvServerEntry* aServerEntry, 
+												TUid aMsgType, TMsvId aEmailServiceId);
+	/*IMPORT_C*/ static CLocalImRecvConvert* NewL( RFs& anFs, CMsvServerEntry* aServerEntry,
+												TUid aMsgType, TMsvId aEmailServiceId);
+	/*IMPORT_C*/ ~CLocalImRecvConvert();
+
+	/*IMPORT_C*/ void ResetL();
+	/*IMPORT_C*/ void ResetForHeadersL();
+
+	inline void SetAttachmentPathL(const TDesC& aFullPath);	// attachment path, if not set then IMCV will reject attachments
+	inline void SetMsvId(TMsvId aId);
+
+	/*IMPORT_C*/ virtual TInt ParseNextField(const TDesC8& aSourceLine);
+	/*IMPORT_C*/ void MessageCompleteL();
+	/*IMPORT_C*/ void MessageCompleteL(TMsvEmailEntry aEmailEntry);
+	/*IMPORT_C*/ void MessageCompleteL(TBool aPartialDownload);
+	/*IMPORT_C*/ TInt DeletedAttachmentSize();
+	/*IMPORT_C*/ void WritePartialFooterL(TInt aAmountLeft);
+	/*IMPORT_C*/ TMsvEmailEntry MessageEntryDetailsL();
+
+	enum TValidEntryType {EUnknownEntry, EMessageEntry, EFolderEntry, EAttachmentEntry, ETextEntry, EHtmlEntry};
+	enum TImEntryStreamSaveSettings
+		{
+		KStoreBodyText					= 0x00000001,
+		KStore822Header					= KStoreBodyText << 1,		//0x00000002
+		KStoreMIMEHeader				= KStore822Header << 1,	//0x00000004
+		};
+
+	inline const TTime Date() const;	// return RFC822 date
+	inline const TMsvPriority Priority() const;
+	inline void SaveAllAttachments(TBool aSave);
+	inline const TInt ReceiveError() const;
+	inline CMsvServerEntry& ServerEntry();
+	inline const CImHeader& Header() const;
+	inline const TBool ValidCompleteHeader() const;
+	//virtual inline const TMsvId EntryId() const;	
+	virtual TMsvId EntryId();	
+	inline TBool NotFinishedRfc822Header();
+	inline CImConvertCharconv& CharacterConverter();
+
+protected:
+	CLocalImRecvConvert(RFs& anFs, CMsvServerEntry* aServerEntry, 
+							TUid aMsgType, TMsvId aEmailServiceId);
+	void ConstructL(RFs& anFs);
+
+	void ParseNextLineL(const TDesC8& aSourceLine);
+	void ParseBodyLineL(const TDesC8& aSourceLine);
+	void ParseMimeLineL(const TDesC8& aSourceLine);
+	void EndOfHeaderProcessingL();
+	virtual void  EndOfHeaderMIMEProcessingL();
+	TBool CreateNonMIMEFolderEntryL(TMsvId aCurrentId);
+	void DecodeAndStoreLineL(const TDesC8& aSourceLine);
+
+	void ParseRecipientListL(CDesCArray& aRecipientList);
+	void PrepareDecoder();
+
+	void WriteToBodyL(const TDesC8& aText, TBool aBlankLine=EFalse);
+	void WriteToBodyL(const TDesC16& aText);
+
+	void AddFileExtension();
+	void ExtractFilename(TLex& aLex, TDes& rFileName);
+	void ReplaceInvalidCharacters(TDes& rFileName);
+	void SetAttachmentName(TDes& aFileName);
+	
+	TBool CheckUUEStartL(const TDesC8& aSourceLine);
+
+	// returns numeric value of text up to next delimiter
+	TInt Value(const TUint8*&);
+	void Whitespace(const TUint8*&);
+	TBool LineIsAllWhitespace();	
+
+	TBool CreateAttachmentL();
+	virtual void WriteToAttachmentL(const TDesC8& text);
+	void CloseAttachmentFileL();
+
+	// Message Entry specific functions
+	void ResetForNewEntryL(TValidEntryType entryType);
+	void ResetForNonMimeEntryL();
+	void MoveUpFromFolderEntryL();
+	virtual void MoveToParentEntryL();
+	void UpdateMultipartDataL();
+
+	TBool StoreEntryDataL();
+
+	virtual void StoreEntryStreamsL();
+	virtual void StoreEntryStreamsL(TInt aSettings);
+	void Store822HeaderL(CMsvStore& aStore, TBool& aCommit);
+	void StoreMIMEHeaderL(CMsvStore& aStore, TBool& aCommit);
+	void StoreBodyTextL(CMsvStore& aStore, TBool& aCommit);
+
+	virtual void CreateEntryL();
+	void Logging(const TDesC8& aString1, const TDesC8& aString2);
+	void StoreMessageEntryDetailsL();
+	
+protected:
+	enum { KNoPart = 0, KParentPart, KMultiPart };
+	TInt iEmailPart;
+	TMsvId iCurrentMultipartFolderEntryId;
+
+	TBool iMessageEntryCalled;
+	TBool iReceivingHeadersOnly;
+	TInt iReceiveError; // indicates if any anomalies were observed whilst the message was received
+	TInt iLeaveError; // keeps any errors that have caused a leave (ie Out of memory, Corrupt file, Server error)
+
+	TMsvId iRootEntryId;
+	TMsvId iTopMessagePart;
+
+	TInt8 iBCPadding[1348]; // Padding to maintain BC - TImAttachmentFile used to be here before it's size was expanded to buffer more data.
+	CMsvServerEntry* iServerEntry;
+	TUid iNewMsgType;
+
+	CLocalRfc822Token* iRfc822Token;
+
+	TValidEntryType iDefaultEntryType;
+	TValidEntryType iEntryType;
+
+	TMsvEmailEntry* iEmailEntry;
+	CImHeader* iOutputHeader;
+	
+	CParaFormatLayer* iParaLayer;
+	CCharFormatLayer* iCharLayer;
+	CRichText* iOutputBody;
+	
+	CImConvertCharconv* iCharConv;
+	CCnvCharacterSetConverter* iConverter;
+	TBool iPreparedToConvert;
+	
+	TBool iMIMEPart_822Header;	
+	TInt iEmptyHeaderSize;
+	TImBodyConvAlgorithm iAlgorithm;
+
+	TBool iCommitLine;	
+	TBool iFinalLine;	
+	TBool iPrepared;
+	TBool iFinishedHeader;
+	TBool iNotFinishedRfc822Header;
+	TBool iNewNonMIMEBodyPart;
+	TBool iFirstBoundaryReached;
+
+	CCnvCharacterSetConverter* iCharacterConverter;
+	CImConvertHeader* iHeaderConverter;
+
+	TImRfc822DateField iRfc822Date;
+
+	RFs* iFsSession;  
+
+	TBool iSkipData;
+	TBool iEncounteredLineEndingInCarriageReturn;
+
+	TBool iCurrentPartIsRichText;	//indicates if current body part is RichText, set on every Close Attachment()
+	TImCodecQP iQPCodec;
+	TImCodecB64 iB64Codec;
+	TImCodecUU iUUCodec;
+	TPtrC8 iThisLine;
+	
+	HBufC* iRemovedAttachmentTag;		// resource text which is put into the body in place of a removed MIME attachment
+	HBufC* iRetainedAttachmentTag;		// Not used at all - resource text which is put into the body next to a retained MIME attachment
+	HBufC* iDefaultAttachmentName;		// used when no name found	
+	HBufC* iAttachmentFullPath;			// full path to current message file
+
+	TBool iSavingAttachments;			// Turn on/off saving of attachments
+
+	TBuf8<KMaxBoundaryTextLength> iSeekBoundary;
+	
+	TInt iGlobalIndent;
+	TInt iPreviousLineLength;
+	TInt iPreviousTrailingWhitespace;
+	TChar iLastChar;
+	TInt iLongestLine;
+	TBool iNewEntry;
+
+	TImAttachmentFileState iAttachmentFileState;
+	TUint32 iEntryDataSize;
+
+	TBool	iLogFileExists;
+	RFile	iLogFile;
+	TLex8	iLineLex;
+	TTime   iTimeDate;
+
+	//priorities   //vk
+	TInt iPriority;		//{1..5}
+	TInt iXPriority;   // {1..5} 1,2-high, 3-normal, 4,5-low
+	TBuf8<KMaxPriorityTextLength> iPrecedence;  //   {bulk-low, list-normal,first class,special delivery-0}
+	TBuf8<KMaxPriorityTextLength> iImportance;  // {high, low, normal}
+	TMsvPriority iImPriority;
+
+	TMsvId	iEmailServiceId;
+	TBool	iPopulateMessage;
+	CImcvUtils* iImcvUtils;
+
+	TBuf8<KConversionRemainderLength> iLeftOver;
+
+	TMsvId	iSavedEntryId;
+	CArrayFixFlat<TParentDetails>* iParent;
+	// Logging
+	CImLog*					iImcvLog;
+	TMsvId					iBodyId;
+	
+public:
+	TFileName iAttachmentName;
+	CLocalMimeParser* iMimeParser;
+protected:
+	TBool	iRelatedAttachments;
+	CBufBase* iBodyBuf;
+	CMsvBodyText *iBodyText;
+	TInt iStore8BitData;
+	TImAttachmentFile iAttachmentFile;
+	TBool iParsedMimeBoundaryLast;
+	TInt iSizeOfAttachmentsRemoved;
+	HBufC* iPartialEmailFooter;
+	TInt iTopPartialDownloadCounter; // added to support correct attachment downloading after partial download
+	TBool iPartialEmail;
+	RFile*	iFile;
+	};
+
+
+/**
+@internalComponent
+@released
+*/
+class CLocalMimeParser : public CBase
+	{
+public:
+	/*IMPORT_C*/ static CLocalMimeParser* NewLC(CLocalImRecvConvert& aImRecvConvert);
+	/*IMPORT_C*/ static CLocalMimeParser* NewL(CLocalImRecvConvert& aImRecvConvert);
+	/*IMPORT_C*/ ~CLocalMimeParser();
+	void Reset();
+	void ResetForNewEntry();
+	void ParseLineL(const TDesC8& aSourceLine);
+
+	void SetBoundaryL(const TDesC8& aBoundaryText);
+	TBool IsBoundary(const TDesC8& aSourceLine);
+	void RemoveBoundary();
+	
+	inline void StoreMimeHeaderL(CMsvStore& entryStore);
+	inline void StoreMimeHeaderWithoutCommitL(CMsvStore& entryStore);
+	inline void RestoreMimeHeaderL(CMsvStore& entryStore);
+
+	inline TImEncodingType ContentEncoding();
+	inline TMimeContentType ContentType();
+	TPtrC8 ContentSubType() const;
+	TUint CurrentCharsetL() const;
+
+	inline const TBool MessageIsMime() const;
+	inline const TBool IsTerminatingBoundary() const;
+	inline const TBool BoundaryExists() const;
+	inline const TBool BoundaryFound() const;
+	inline const TInt MimeHeaderSize() const;
+	inline const TInt ReceiveError() const;
+	inline const TDesC& ContentDescription() const;
+	inline const TPtrC ContentLocation() const;
+	inline const TPtrC8 ContentId() const;
+	inline const TPtrC8 ContentDisposition() const;
+	inline TBool IsMessageDigest();
+
+	TBool VCard() const;
+	TBool VCalendar() const;
+	TImEmailFolderType MessageFolderType() const;
+	void SetMessageFolderType(TImEmailFolderType aFolderType);
+	TBool StartPart() const;
+	void RestoreMimeParserL(CMsvStore& entryStore);
+	void ExtractParameterInfoL(const TDesC8& aTag, TDes16& rBuffer, TDes8& rBuffer8);	
+	void ExtractParameterInfoL(const TDesC8& aTag, HBufC8*& rBuffer);	
+	TBool MimeFieldsExist() const;
+	void ResetMimeFieldsExist();
+	void DoMultipartTypeForNonMIMEL();
+
+#if defined (_DEBUG)
+	inline TLex8& Lex() {return iLex;};
+#endif
+
+private:
+	CLocalMimeParser(CLocalImRecvConvert& aImRecvConvert);
+	void ConstructL();
+
+	// String scanning functions
+	TBool IsSpecialChar(const TUint8 aChar);
+	TBool MatchAndRemoveToken(const TDesC8& aToken);
+
+	// MIME token recognition functions
+	void DoMimeVersion();
+	void DoContentTypeL();
+	void DoContentLocationL();
+	void DoContentBaseL();
+	void DoContentIdL();
+	void DoEncodingL();
+	void DoDescriptionL();
+	void DoDispositionL();
+
+	// MIME Content-Type type recognition functions
+	void DoTextTypeL();
+	void DoMultipartTypeL();
+	void DoMessageTypeL();
+	void DoAttachmentTypeL();
+
+	// Will be moved to MIUT, but for now ..
+	const TPtrC8 GetContentTypeValue(const TDesC8& aContentTypeParameter) const;
+	      
+	TBool ParseRfc2047ParameterInfoL( const TDesC8& aParam, TDes& rBuffer);
+	TBool ParseRfc2231ParameterInfoL( const TDesC8& aTag, TDes& rBuffer, TInt aOffset );
+	TBool DecodeRfc2231ParameterInfoL( TDes8& aInput, TDes& rBufOut, 
+											TPtrC8 aCharset/*, TPtrC8 aLanguage*/);
+	TPtrC8 ExtractParameterString(TLexMark8& rMark);
+
+private:
+	CLocalImRecvConvert& iImRecvConvert;
+	
+	CImMimeHeader* iMimeHeader;
+	TInt iEmptyMimeHeaderSize;
+	
+	TBool isMime;
+	TBool iCorrectMimeVersion;
+	TImEncodingType iContentEncoding;
+	TMimeContentType iContentType;
+	TFileName iContentDescription;
+	TBool iVCard;
+	TBool iVCalendar;
+	TBool iStartPart;
+	TImEmailFolderType iMessageFolderType;
+	TUint iCharset;
+	TUint iDefaultCharset;
+	HBufC8* iStartId;
+
+	// Boundary stuff
+	CDesC8ArrayFlat* iBoundaryText;
+	TInt iBoundaryIndex;
+	TInt iBoundaryLength;
+	TBool iTerminatingBoundary;
+	TBool iBoundaryFound;
+	TInt iReceiveError; // Indicates if any anomalies were observed whilst the message was received
+						// Can be accessed via the inline ReceiveError()
+	TPtrC8 iTestLine;
+
+	HBufC8* iMimeHeaderLine;
+	TLexMark8 iMark;
+	TLex8 iLex;
+	TLex8 iTestLex;	
+	TBool isMessageDigest;
+	TBool iMimeFieldsExist;
+	};
+
+#include "local_imcvrecv.inl"
+
+#endif 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/T_CheckSmtpBMSetting.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,45 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is the header file for CT_MsgCheckSmtpBMSetting class
+// 
+//
+
+#ifndef T_CHECK_SMTP_BM_SETTING_H
+#define T_CHECK_SMTP_BM_SETTING_H
+
+/* User include */
+#include "T_MsgSyncStepSMTP.h"
+
+/* Literal used */
+_LIT(KCheckSmtpBMSetting,"CheckSmtpBMSetting");
+
+/* Implements a test step to check if bearer mobility is supported by SMTP service */
+class CT_MsgCheckSmtpBMSetting : public CT_MsgSyncStepSMTP
+	{
+public:
+	CT_MsgCheckSmtpBMSetting(CT_MsgSharedDataSmtp& aSharedDataSMTP);
+	
+	/* CTestStep implementation */
+	virtual TVerdict doTestStepL();
+	
+private:
+	TBool ReadIni();
+	
+private:
+	TPtrC iSmtpAccountName;
+	TBool iExpectedBMSupport;
+	
+	};
+	
+#endif /* T_CHECK_SMTP_BM_SETTING_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/T_CheckSmtpSNAPSetting.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,45 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is the header file for CT_MsgCheckSmtpSNAPSetting class
+// 
+//
+
+#ifndef T_CHECK_SMTP_SNAP_SETTING_H
+#define T_CHECK_SMTP_SNAP_SETTING_H
+
+/* User include */
+#include "T_MsgSyncStepSMTP.h"
+
+/* Literal used */
+_LIT(KCheckSmtpSNAPSetting,"CheckSmtpSNAPSetting");
+
+/* Implements a test step to check the SMTP SNAP information for the account */
+class CT_MsgCheckSmtpSNAPSetting : public CT_MsgSyncStepSMTP
+	{
+public:
+	CT_MsgCheckSmtpSNAPSetting(CT_MsgSharedDataSmtp& aSharedDataSMTP);
+	
+	/* CTestStep implementation */
+	virtual TVerdict doTestStepL();
+	
+private:
+	TBool ReadIni();
+	
+private:
+	TPtrC iSmtpAccountName;
+	TBool iExpectedSNAPDefinition;
+	
+	};
+	
+#endif /* T_CHECK_SMTP_SNAP_SETTING_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/T_CreateSmtpAccount.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,44 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is the header file for CT_MsgCreateSmtpAccount class
+// 
+//
+
+#ifndef T_CREATE_SMTP_ACCOUNT_H
+#define T_CREATE_SMTP_ACCOUNT_H
+
+/* User include */
+#include "T_MsgSyncStepSMTP.h"
+
+/* Literal used */
+_LIT(KCreateSmtpAccount,"CreateSmtpAccount");
+
+/* Implements a test step to create an SMTP account reading the settings from a config file */
+class CT_MsgCreateSmtpAccount : public CT_MsgSyncStepSMTP
+	{
+public:
+	CT_MsgCreateSmtpAccount(CT_MsgSharedDataSmtp& aSharedDataSMTP);
+
+	/* CTestStep implementation */
+	virtual TVerdict doTestStepL();
+	
+private:
+	TBool ReadIni();
+
+private:
+	TPtrC iSmtpAccountName;
+	TPtrC iConfigFileName;
+	
+	};
+#endif /* T_CREATE_SMTP_ACCOUNT_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/T_CreateSmtpMessageFromEmailFile.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,54 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+
+#ifndef __T_CREATE_SMTP_MESSAGE_FROM_EMAIL_FILE_H__
+#define __T_CREATE_SMTP_MESSAGE_FROM_EMAIL_FILE_H__
+
+
+// User Includes 
+#include "T_MsgSyncStepSMTP.h"
+#include "T_MsgSharedDataSmtp.h"
+
+
+// Literals Used  
+_LIT(KCreateSmtpMessageFromEmailFile,"CreateSmtpMessageFromEmailFile");
+
+
+/**
+This class implements the test step that creates the SMTP message
+*/
+class CT_MsgCreateSmtpMessageFromEmailFile : public CT_MsgSyncStepSMTP
+	{
+public:	
+	static CT_MsgCreateSmtpMessageFromEmailFile* NewL(CT_MsgSharedDataSmtp& aSharedDataSMTP);
+	~CT_MsgCreateSmtpMessageFromEmailFile();
+
+	//	CTestStep implementation
+	TVerdict doTestStepL(); 	
+private:
+	CT_MsgCreateSmtpMessageFromEmailFile(CT_MsgSharedDataSmtp& aSharedDataSMTP);
+	};
+#endif //__T_CREATE_SMTP_MESSAGE_FROM_EMAIL_FILE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/T_CreateSmtpMobilityAccount.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __T_CREATESMTPMOBILITYACCOUNT_H__
+#define __T_CREATESMTPMOBILITYACCOUNT_H__
+
+#include "T_MsgSyncStepSMTP.h"
+
+_LIT(KCreateSmtpMobilityAccount, "CreateSmtpMobilityAccount");
+
+class CT_MsgCreateSmtpMobilityAccount : public CT_MsgSyncStepSMTP
+	{
+public:	
+	static CT_MsgCreateSmtpMobilityAccount* NewL(CT_MsgSharedDataSmtp& aSharedDataSMTP);
+
+	//	CTestStep implementation
+	TVerdict doTestStepL();
+private:
+	CT_MsgCreateSmtpMobilityAccount(CT_MsgSharedDataSmtp& aSharedDataSMTP);
+	};
+
+#endif //__T_CREATESMTPMOBILITYACCOUNT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/T_ModifySmtpSettings.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,39 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is the header file for CT_MsgModifySmtpSettings class
+// 
+//
+
+#ifndef T_MODIFY_SMTP_SETTINGS_H
+#define T_MODIFY_SMTP_SETTINGS_H
+
+/* User include */
+#include "T_MsgSyncStepSMTP.h"
+
+/* Literal used */
+_LIT(KModifySmtpSettings,"ModifySmtpSettings");
+
+/* Implements a test step that modifies the settings of the specified Smtp account
+   via the given config file */
+class CT_MsgModifySmtpSettings : public CT_MsgSyncStepSMTP
+	{
+public :
+	CT_MsgModifySmtpSettings(CT_MsgSharedDataSmtp& aSharedDataSMTP);
+
+	~CT_MsgModifySmtpSettings();
+
+	/* CTestStep implementation */
+	TVerdict doTestStepL();
+	};
+#endif /* T_MODIFY_SMTP_SETTINGS_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/T_MsgAsyncStepSMTP.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* References SMTP shared data for use by derived test steps.
+* 
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+#ifndef __T_MSG_ASYNCSTEPSMTP_H__
+#define __T_MSG_ASYNCSTEPSMTP_H__
+
+//user includes
+#include "T_MsgAsyncStep.h"
+#include "T_MsgSharedDataSmtp.h"
+
+
+/**
+Base class for asynchronous SMTP teststeps.
+*/
+class CT_MsgAsyncStepSMTP : public CT_MsgAsyncStep
+	{
+protected:
+	CT_MsgAsyncStepSMTP(CT_MsgSharedDataSmtp& aSharedDataSMTP);
+
+protected:
+	CT_MsgSharedDataSmtp&	iSharedDataSMTP;
+	};
+
+#endif // __T_MSG_ASYNCSTEPSMTP_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/T_MsgSharedDataSmtp.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,62 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* This contains CT_MsgSharedDataSmtp
+* 
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+
+#ifndef __T_MSG_SHARED_DATA_SMTP_H__
+#define __T_MSG_SHARED_DATA_SMTP_H__
+
+
+// User includes
+#include "T_MsgSharedDataBase.h"
+
+
+/**
+Implements the class for sharing data across the test steps created by SMTP test server.  
+*/
+class CT_MsgSharedDataSmtp : public CT_MsgSharedDataBase
+	{
+public:
+	static CT_MsgSharedDataSmtp* NewL();
+	~CT_MsgSharedDataSmtp();
+
+protected:
+	virtual CBaseMtm*	NewMtmL();
+	CT_MsgSharedDataSmtp();
+
+private:
+	void ConstructL();
+
+public:
+	CPeriodic* 	iPeriodic;
+	TInt  		iMaxRamValue;
+	TInt  		iMinRamValue;
+	TInt  		iStartRamValue;
+	TInt  		iEndRamValue;
+	TBool 		iMark;
+	};
+
+#endif // __T_MSG_SHARED_DATA_SMTP_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/T_MsgSyncStepSMTP.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,49 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Sync step class owning SMTP shared data for use by derived test steps.
+* 
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+
+#ifndef __T_MSG_SYNC_STEP_SMTP_H__
+#define __T_MSG_SYNC_STEP_SMTP_H__
+
+//user includes
+#include "T_MsgStep.h"
+#include "T_MsgSharedDataSmtp.h"
+
+
+/**
+Base class for synchronous SMTP teststeps.
+*/
+class CT_MsgSyncStepSMTP : public CT_MsgStep
+	{
+protected:
+	CT_MsgSyncStepSMTP(CT_MsgSharedDataSmtp& aSharedDataSMTP);
+
+protected:
+	CT_MsgSharedDataSmtp&	iSharedDataSMTP;
+	};
+
+#endif // __T_MSG_SYNC_STEP_SMTP_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/T_RemoveSmtpSNAPSetting.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,44 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is the header file for CT_MsgRemoveSmtpSNAPSetting class
+// 
+//
+
+#ifndef T_REMOVE_SMTP_SNAP_SETTING_H
+#define T_REMOVE_SMTP_SNAP_SETTING_H
+
+/* User include */
+#include "T_MsgSyncStepSMTP.h"
+
+/* Literal used */
+_LIT(KRemoveSmtpSNAPSetting,"RemoveSmtpSNAPSetting");
+
+/* Implements a test step to remove the SMTP SNAP information for the account */
+class CT_MsgRemoveSmtpSNAPSetting : public CT_MsgSyncStepSMTP
+	{
+public:	
+	CT_MsgRemoveSmtpSNAPSetting(CT_MsgSharedDataSmtp& aSharedDataSMTP);
+	
+	/* CTestStep implementation */
+	virtual TVerdict doTestStepL();
+	
+private:
+	TBool ReadIni();
+	
+private:
+	TPtrC iSmtpAccountName;
+	
+	};
+	
+#endif /* T_REMOVE_SMTP_SNAP_SETTING_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/T_RetrievePlainBodyTextAndCompare.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* @file 
+* This is the header file for CT_RetrievePlainBodyTextAndCompare
+* 
+*
+*/
+
+
+
+
+
+
+
+#ifndef __T_RETRIEVEPLAINBODYTEXTANDCOMPARE_H__
+#define __T_RETRIEVEPLAINBODYTEXTANDCOMPARE_H__
+
+
+// User includes
+#include "T_MsgAsyncStepSMTP.h"
+#include "T_MsgSharedDataSmtp.h"
+
+
+// Literals used 
+_LIT(KRetrievePlainBodyTextAndCompare,"RetrievePlainBodyTextAndCompare");
+
+
+/* 
+ * Implements a test step that edit a message body text 
+ */
+class CT_RetrievePlainBodyTextAndCompare : public CT_MsgAsyncStepSMTP
+	{
+public:
+	static CT_RetrievePlainBodyTextAndCompare* NewL(CT_MsgSharedDataSmtp& aSharedDataSMTP);
+	~CT_RetrievePlainBodyTextAndCompare();
+
+	// CTestStep implementation 
+	virtual TVerdict doTestStepL();
+
+
+private:
+	CT_RetrievePlainBodyTextAndCompare(CT_MsgSharedDataSmtp& aSharedDataSMTP);
+
+	virtual void ProgressL(TBool bFinal);
+	virtual void CancelStep();
+	};
+#endif // __T_RETRIEVEPLAINBODYTEXTANDCOMPARE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/T_SendSmtpMessage.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,67 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* This is the header file for CT_MsgSendSmtpMessage
+* 
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+
+#ifndef __T_SEND_SMTP_MESSAGE_H__
+#define __T_SEND_SMTP_MESSAGE_H__
+
+
+// User Includes
+#include "T_MsgAsyncStepSMTP.h"
+#include "T_MsgSharedDataSmtp.h"
+
+
+//Literals Used
+_LIT(KSendSmtpMessage,"SendSmtpMessage");
+
+
+/**
+Implements a test step to send a message
+*/
+class CT_MsgSendSmtpMessage :  public CT_MsgAsyncStepSMTP
+	{
+public:
+	static CT_MsgSendSmtpMessage* NewL(CT_MsgSharedDataSmtp& aSharedDataSMTP);
+   ~CT_MsgSendSmtpMessage();
+
+	//	CTestStep implementation
+	virtual TVerdict	doTestStepL();
+
+private:
+	CT_MsgSendSmtpMessage(CT_MsgSharedDataSmtp& aSharedDataSMTP);
+
+	//	CT_MsgAsyncStep implementation
+	virtual void	ProgressL(TBool bFinal);
+
+	//	MT_MsgActiveCallback implementation
+	virtual void	CancelStep();
+
+private:
+	CMsvOperation*	iOperation;
+	};
+
+#endif //__T_SEND_SMTP_MESSAGE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/T_SmtpCreateForwardMessage.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* @file 
+* This is the header file for CT_SmtpCreateForwadMessage
+* 
+*
+*/
+
+
+
+
+
+
+#ifndef __T_SMTPCREATE_FORWARDMESSAGE_H__
+#define __T_SMTPCREATE_FORWARDMESSAGE_H__
+
+
+// User includes
+#include "T_MsgAsyncStepSMTP.h"
+
+
+// Literals used 
+_LIT(KSmtpCreateForwadMessage,"SmtpCreateForwadMessage");
+
+
+/* 
+ * Implements a test step that create a forwrad message using the SMTP client MTM command
+ */
+class CT_SmtpCreateForwadMessage : public CT_MsgAsyncStepSMTP
+	{
+public:
+	static CT_SmtpCreateForwadMessage* NewL(CT_MsgSharedDataSmtp& aSharedDataSMTP);
+	~CT_SmtpCreateForwadMessage();
+
+	// CTestStep implementation 
+	virtual TVerdict doTestStepL();
+
+private:
+	CT_SmtpCreateForwadMessage(CT_MsgSharedDataSmtp& aSharedDataSMTP);
+	void SetHeaderPartL();
+	void GetDefaultAddressL();
+
+	virtual void ProgressL(TBool bFinal);
+	virtual void CancelStep();
+
+private:
+	HBufC* iRecipientAddress;
+	CMsvOperation*	iOperation;
+	};
+#endif // __T_SMTPCREATE_FORWARDMESSAGE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/T_SmtpCreateReplyMessage.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* @file 
+* This is the header file for CT_SmtpCreateReplyMessage
+* 
+*
+*/
+
+
+
+
+
+
+#ifndef __T_SMTPCREATE_REPLYMESSAGE_H__
+#define __T_SMTPCREATE_REPLYMESSAGE_H__
+
+
+// User includes
+#include "T_MsgAsyncStepSMTP.h"
+
+
+// Literals used 
+_LIT(KSmtpCreateReplyMessage,"SmtpCreateReplyMessage");
+
+
+/* 
+ * Implements a test step that create a reply message using the SMTP client MTM command
+ */
+class CT_SmtpCreateReplyMessage : public CT_MsgAsyncStepSMTP
+	{
+public:
+	static CT_SmtpCreateReplyMessage* NewL(CT_MsgSharedDataSmtp& aSharedDataSMTP);
+	~CT_SmtpCreateReplyMessage();
+
+	// CTestStep implementation 
+	virtual TVerdict doTestStepL();
+
+private:
+	CT_SmtpCreateReplyMessage(CT_MsgSharedDataSmtp& aSharedDataSMTP);
+	void SetHeaderPartL();
+	
+	virtual void ProgressL(TBool bFinal);
+	virtual void CancelStep();
+	
+private:
+	CMsvOperation*	iOperation;
+	};
+#endif // __T_SMTPCREATE_REPLYMESSAGE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/T_SmtpSendEmail.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,75 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* This is the header file for CT_MsgSmtpSendEmail
+* 
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+
+#ifndef __T_SMTP_SEND_EMAIL_H__
+#define __T_SMTP_SEND_EMAIL_H__
+
+
+// user includes
+#include <testexecutestepbase.h>
+#include "T_MsgAsyncStepSMTP.h"
+#include "T_MsgSharedDataSmtp.h"
+
+
+//Literals Used
+_LIT(KSmtpSendEmail,"SmtpSendEmail");
+_LIT(KNone, "NONE");
+
+
+// Forward declaration
+class CT_MsgUtilsSendEmail;
+class CT_MsgUtilsConfigFileMachineName;
+
+
+/**
+Implements a test step to send an email
+*/
+class CT_MsgSmtpSendEmail :  public CT_MsgAsyncStepSMTP
+	{
+public:
+	static CT_MsgSmtpSendEmail* NewL(CT_MsgSharedDataSmtp& aSharedDataSMTP);
+	~CT_MsgSmtpSendEmail();
+
+	//	CTestStep implementation
+	virtual TVerdict	doTestStepL();
+
+private:
+	CT_MsgSmtpSendEmail(CT_MsgSharedDataSmtp& aSharedDataSMTP);
+
+	//	CT_MsgAsyncStep implementation
+	virtual void	ProgressL(TBool bFinal);
+
+	//	MT_MsgActiveCallback implementation
+	virtual void	CancelStep();
+
+public:
+ 	CT_MsgUtilsSendEmail*				iSendEmail;  
+ 	CT_MsgUtilsConfigFileMachineName*	iMachineNameFile;   
+	};
+
+#endif //__T_SMTP_SEND_EMAIL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/T_SmtpServer.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,62 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* This contains the header file for SMTP server
+* 
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+
+#ifndef __T_SMTP_SERVER_H__
+#define __T_SMTP_SERVER_H__
+
+
+// User defined classes
+#include "T_MsgServer.h"
+#include "T_MsgSharedDataSmtp.h"
+
+
+//Literals Used
+_LIT(KSmtpServer,"T_MsgSmtpServer");
+
+
+/**
+Implements the SMTP test server
+*/
+class CT_MsgSmtpServer : public CT_MsgServer
+	{
+public:
+	static CT_MsgSmtpServer* NewL();
+
+private:
+	CT_MsgSmtpServer();
+	// Creates the test steps based on the test step name 
+	virtual CTestStep*	CreateTestStepL(const TDesC& aStepName);
+
+	// Creates an object of Shared Data
+	virtual CT_MsgSharedDataBase* NewSharedDataL();
+
+public:
+	// Creates session object and SMTP MTM					
+	CT_MsgSharedDataSmtp* iSharedDataSMTP;
+	};
+#endif //__T_SMTP_SERVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/T_StartRamUsageTimer.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* @file 
+* This is the header file for CT_StartRamUsageTimer
+* 
+*
+*/
+
+
+
+
+
+
+
+#ifndef _T_START_RAM_USAGE_TIMER_
+#define _T_START_RAM_USAGE_TIMER_
+
+
+// User includes 
+#include "T_MsgAsyncStepSMTP.h"
+
+// Literals used 
+_LIT(KStartRamUsageTimer,"StartRamUsageTimer");
+
+/**
+Implement a wrapper class over HAL APIs and 
+setting the periodic Timer to monitor the RAM usage
+ */
+class CT_StartRamUsageTimer : public CT_MsgAsyncStepSMTP
+	{
+public:
+	CT_StartRamUsageTimer(CT_MsgSharedDataSmtp& aSharedDataSMTP);	
+	~CT_StartRamUsageTimer();
+
+	static TInt RamUsage(TAny* aObject);
+	void DoRamUsage();
+
+private:
+     void ProgressL(TBool aFinal);
+     void CancelStep();
+     
+	// CTestStep implementation 
+	virtual TVerdict	doTestStepL();	
+	};
+
+
+#endif // _T_START_RAM_USAGE_TIMER_ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/T_StopRamUsageTimer.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* @file 
+* This is the header file for CT_StopRamUsageTimer
+* 
+*
+*/
+
+
+
+
+
+
+
+#ifndef _T_STOP_RAM_USAGE_TIMER_
+#define _T_STOP_RAM_USAGE_TIMER_
+
+
+// User includes 
+#include "T_MsgAsyncStepSMTP.h"
+
+// Literals used 
+_LIT(KStopRamUsageTimer,"StopRamUsageTimer");
+
+// Implement a test step to stop the periodic Timer 
+class CT_StopRamUsageTimer :public CT_MsgAsyncStepSMTP
+	{
+public:
+	CT_StopRamUsageTimer(CT_MsgSharedDataSmtp& aSharedDataSMTP);
+	~CT_StopRamUsageTimer();
+private:
+     void ProgressL(TBool aFinal);
+     void CancelStep();
+     
+	// CTestStep implementation 
+	virtual TVerdict	doTestStepL();	
+	};
+
+
+#endif // _T_STOP_RAM_USAGE_TIMER_ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/T_UtilsSendEmail.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,97 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* This is the header file for CT_MsgUtilsSendEmail
+* 
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+
+#ifndef __T_UTILS_SMTP_SEND_EMAIL_H__
+#define __T_UTILS_SMTP_SEND_EMAIL_H__
+
+
+// User  Includes
+#include <testexecutestepbase.h>
+
+
+// Epoc includes
+#include <imsk.h>
+
+// Forward Declaration
+class CImIAPPreferences;
+
+
+/**
+Implements a utility that performs the sending of the email
+*/
+class CT_MsgUtilsSendEmail : public CActive
+	{
+public:
+	static CT_MsgUtilsSendEmail* NewL(CTestStep& aTestStep);
+	~CT_MsgUtilsSendEmail();
+public:	
+	void StartL(TPtrC aSender,TPtrC aReceipient,TPtrC aMailFile,TPtrC aServerIP,
+											TRequestStatus& aStatus);
+protected:
+	void DoCancel();
+	void RunL();
+private:
+	CT_MsgUtilsSendEmail(CTestStep& aTestStep);
+private:
+	enum TSmtpSendState
+		{
+		ESmtpNotConnected,
+		ESmtpConnecting,
+		ESmtpSendHELO,
+		ESmtpSendMailFrom,
+		ESmtpSendRcptTo,
+		ESmtpSendData,
+		ESmtpSendContent,
+		ESmtpSendEndData,
+		ESmtpSendLogout,
+		ESmtpReceiveReply
+		};
+
+	enum TSmtpReceiveState
+		{
+		ESmtpHeloReply,
+		ESmtpFromReply,
+		ESmtpRcptReply,
+		ESmtpDataReply,
+		ESmtpContentReply,
+		ESmtpLogoutReply
+		};
+public:
+	TPtrC iSender;
+	TPtrC iReceipient;
+private:
+	TRequestStatus* iRequestStatus;
+	CImTextServerSession* iImSocket;
+	TInt iSendState;
+	TInt iRecvState;
+	RFs iFs;
+	RFile iFile;
+	CImIAPPreferences* iIapPrefs;
+	CTestStep& iTestStep;
+	};
+#endif //__T_UTILS_SMTP_SEND_EMAIL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/local_imcvrecv.inl	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,203 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Class CRfc822Token Inline functions
+* 
+*
+*/
+
+
+
+
+
+
+/**
+ @file
+*/
+
+inline HBufC8* CLocalRfc822Token::OutputLine()
+	{
+	return iOutputLine;
+	}
+
+inline TBool CLocalRfc822Token::LastToken()
+	{
+	return iLastToken;
+	}
+
+inline void CLocalRfc822Token::SetImRecvConvert( CLocalImRecvConvert* aImRecvConvert )
+	{
+	iImRecvConvert = aImRecvConvert;
+	}
+
+
+/****************************************************************************
+	Class CLocalImRecvConvert Inline functions
+*****************************************************************************/
+
+inline void CLocalImRecvConvert::SetAttachmentPathL(const TDesC& aFullPath)
+	{
+	// get full path to current message file = directory path
+	if (iAttachmentFullPath)
+		{
+		delete iAttachmentFullPath;
+		iAttachmentFullPath=NULL;
+		}
+	iAttachmentFullPath=aFullPath.AllocL();
+	}
+
+inline void CLocalImRecvConvert::SetMsvId(TMsvId aId)
+	{
+	iServerEntry->SetEntry(aId);
+	iPopulateMessage = (iServerEntry->Entry().iType == KUidMsvMessageEntry);
+	iRootEntryId = aId;
+	}
+
+inline const TTime CLocalImRecvConvert::Date() const
+	{
+	return iTimeDate;
+	}
+
+inline const TMsvPriority CLocalImRecvConvert::Priority() const
+	{
+	return iImPriority;
+	}
+
+inline void CLocalImRecvConvert::SaveAllAttachments(TBool aSave)
+	{
+	iSavingAttachments=aSave;
+	}
+
+inline const TInt CLocalImRecvConvert::ReceiveError() const
+	{
+	return iReceiveError;
+	}
+
+inline CMsvServerEntry& CLocalImRecvConvert::ServerEntry()
+	{
+	return *iServerEntry;
+	}
+
+inline const TBool CLocalImRecvConvert::ValidCompleteHeader() const
+	{
+	return (iEmptyHeaderSize<(iOutputHeader->DataSize()) && iFinishedHeader);
+	}
+
+inline const CImHeader& CLocalImRecvConvert::Header() const
+	{
+	return *iOutputHeader;
+	}
+
+inline TBool CLocalImRecvConvert::NotFinishedRfc822Header()
+	{
+	return iNotFinishedRfc822Header;
+	}
+
+inline CImConvertCharconv& CLocalImRecvConvert::CharacterConverter()
+	{
+	return *iCharConv;
+	}
+
+/****************************************************************************
+	Class CLocalMimeParser Inline functions
+*****************************************************************************/
+inline void CLocalMimeParser::StoreMimeHeaderL(CMsvStore& entryStore)
+	{
+	iMimeHeader->StoreL(entryStore);
+	}
+
+inline void CLocalMimeParser::StoreMimeHeaderWithoutCommitL(CMsvStore& entryStore)
+	{
+	iMimeHeader->StoreL(entryStore);
+	}
+
+inline void CLocalMimeParser::RestoreMimeHeaderL(CMsvStore& entryStore)
+	{
+	RestoreMimeParserL(entryStore);
+	}
+
+inline TMimeContentType CLocalMimeParser::ContentType()
+	{
+	return iContentType;
+	}
+
+inline TImEncodingType CLocalMimeParser::ContentEncoding()
+	{
+	return iContentEncoding;
+	}
+
+inline const TBool CLocalMimeParser::MessageIsMime() const
+	{
+	return isMime;
+	}
+
+inline const TDesC& CLocalMimeParser::ContentDescription() const
+	{
+	return iContentDescription;
+	}
+
+inline const TPtrC CLocalMimeParser::ContentLocation() const
+	{
+	return iMimeHeader->ContentLocation();
+	}
+
+inline const TPtrC8 CLocalMimeParser::ContentId() const
+	{
+	return iMimeHeader->ContentID();
+	}
+
+inline const TPtrC8 CLocalMimeParser::ContentDisposition() const
+	{
+	return iMimeHeader->ContentDisposition();
+	}
+
+inline const TBool CLocalMimeParser::IsTerminatingBoundary() const
+	{
+	return iTerminatingBoundary;
+	}
+
+inline const TBool CLocalMimeParser::BoundaryExists() const
+	{
+	return (iBoundaryLength!=0);
+	}
+
+inline const TBool CLocalMimeParser::BoundaryFound() const
+	{
+	return iBoundaryFound;
+	}
+
+inline const TInt CLocalMimeParser::MimeHeaderSize() const
+	{
+	return iEmptyMimeHeaderSize-iMimeHeader->Size();
+	}
+
+inline const TInt CLocalMimeParser::ReceiveError() const
+	{
+	return iReceiveError;
+	}
+
+inline TBool CLocalMimeParser::IsMessageDigest()
+	{
+	return (ContentType()==EMimeMultipart && ContentSubType().Compare(KImcvDigest)==0);
+	}
+
+inline TBool CLocalMimeParser::MimeFieldsExist() const
+	{
+	return iMimeFieldsExist;
+	}
+
+inline void CLocalMimeParser::ResetMimeFieldsExist()
+	{
+	iMimeFieldsExist=EFalse;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/local_imutdll.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,88 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+
+#ifndef __LOCAL_IMUTDLL_H__
+#define __LOCAL_IMUTDLL_H__
+
+#ifndef __E32STD_H__
+#include <e32std.h>
+#endif
+
+#ifndef __BARSC_H__
+#include <barsc.h>		// RResourceFile
+#endif
+
+
+/**
+Panics and errors codes for email message creation.
+*/
+enum TImutErrorReason {	KPanicNoRfc822Header = 1,
+						KPanicNoRichText,
+						EPanicNullTokenizer,
+						KPanicBoundaryTooLong,
+						KPanicUnknownSendingMethod,
+						KPanicInvalidSMTPLine,
+						KPanicAttachmentPathNotSet,
+						KPanicNoMimeClassAvailable,
+						KPanicUnknownAlgorithm,
+						KPanicSetAlgorithmLNotCalled,
+						KPanicNoResourceFile,
+						KPanicDescriptorToSmall,
+						KPanicReadLengthTooLarge,
+						KPanicFileNotFlushed,
+						KPanicEntryIsNotMessage,
+						KPanicMessageEntryNotCalled,
+						KPanicMessageEntryIdHasChanged,
+						KPanicServiceIdNotValid,
+						KPanicIncorrectResetState,
+						KPanicNoMimeHeader,
+						KPanicInvalidDefaultCharacterSet,
+						KPanicUnknownFolderType,
+						KPanicInvalidEncodingType,
+						EPanicInvalidHeaderState,
+						EImskSocketNotConnected,
+						EImskSocketStillActive,
+						EImskSocketOpen,
+						EImskUnknownState,
+						EImskInvalidPortNumber,
+						EImskInvalidSocketEncryptionMethod,
+						EImskSecurityFailed,
+						EImskDatabaseTypeUnspecified,
+						EImskNotSupported,
+	 					EImskUnknownBearer,
+						EImskNoTLSResponseString	
+						};
+
+// and some error codes
+const TInt KErrCorruptHeader = 1;
+
+GLDEF_C void gPanic( TImutErrorReason aReason );
+
+GLREF_C void OpenResourceFileL(RResourceFile& aFile, RFs& anFs);
+
+GLDEF_C void CloseResourceFile( TAny* aResourceFile );
+
+#endif // __LOCAL_IMUTDLL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/inc/t_smtpcreatenewmessagewithplainbodytext.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* @file 
+* This is the header file for CT_SmtpCreateNewMessageWithPlainBodyText
+* 
+*
+*/
+
+
+
+
+
+
+#ifndef __T_SMTP_CREATENEWMESSAGE_WITHPLAINBODYTEXT_H__
+#define __T_SMTP_CREATENEWMESSAGE_WITHPLAINBODYTEXT_H__
+
+
+// User includes
+#include "T_MsgAsyncStepSMTP.h"
+#include "T_MsgSharedDataSmtp.h"
+
+// Epoc includes 
+#include <imapcmds.h>
+#include <msvstd.h>
+#include <mtclbase.h>
+
+// Literals used 
+_LIT(KSmtpCreateNewMessageWithPlainBodyText,"SmtpCreateNewMessageWithPlainBodyText");
+
+
+/* 
+ * Implements a test step that create a message with plain body text
+ */
+class CT_SmtpCreateNewMessageWithPlainBodyText : public CT_MsgAsyncStepSMTP
+	{
+public:
+	static CT_SmtpCreateNewMessageWithPlainBodyText* NewL(CT_MsgSharedDataSmtp& aSharedDataSMTP);
+	~CT_SmtpCreateNewMessageWithPlainBodyText();
+
+	// CTestStep implementation 
+	virtual TVerdict doTestStepL();
+
+private:
+	CT_SmtpCreateNewMessageWithPlainBodyText(CT_MsgSharedDataSmtp& aSharedDataSMTP);
+	void SetHeaderPartL();
+	void GetDefaultAddressL();
+	void PopulateBodyPartL();
+
+	virtual void ProgressL(TBool bFinal);
+	virtual void CancelStep();
+	
+private:
+	HBufC* iRecipientAddress;	
+	CMsvOperation*	iOperation;
+	};
+#endif // __T_SMTP_CREATENEWMESSAGE_WITHPLAINBODYTEXT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/src/ImCltCvRecv.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1444 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+*/
+
+#include <imcm.rsg>
+#include <barsread.h>
+
+#include <imcvcodc.h>
+#include <imcvutil.h>
+#include <cmsvbodytext.h>
+#include "ImCltCvRecv.h"
+
+#ifdef __WINS__
+#include <e32wins.h> 
+#include <msvapi.h>
+#endif
+
+#ifndef __WINS__
+#include <msvapi.h>
+#endif
+#include <cmsvattachment.h> 
+#include <mmsvattachmentmanager.h>
+#include <mmsvattachmentmanagersync.h>
+
+#ifndef _MSG_NO_LOGGING
+#define __IMUT_LOGGING
+_LIT(KLogFilePath, "c:\\logs\\mailtext\\in.txt");
+_LIT8(KNewLogHeader, "\r\n------ New Receive Session ------\r\n");
+_LIT8(KFound, "found: ");
+_LIT8(KPartLine, "unknown or part line");
+_LIT8(KEndOFHeader, "End of header");
+_LIT8(KSkippingData, "Skipping data");
+
+_LIT8(KFoundMIMEBoundary, "MIME boundary");
+_LIT8(KRemoveBoundary, "Remove boundary");
+_LIT8(KRemovedBoundary, "Removed boundary");
+_LIT8(KSectionHeader, "Section header");
+_LIT8(KWritingToFile, "writing attachment");
+_LIT8(KWroteToFile, "wrote attachment");
+_LIT8(KFailedToWriteToFile, "Failed to write to attachment file");
+_LIT8(KFoundUUEStartBoundary, "UUE start boundary");
+_LIT8(KFoundUUEEndBoundary, "UUE end boundary");
+_LIT8(KReset, "Resetting CImRecvConvert");
+_LIT8(KReseted, "Resetting CImRecvConvert");
+_LIT8(KLastToken, "That was the last token");
+_LIT8(KResetForNewEntry, "Reset for a New Entry");
+_LIT8(KResetedForNewEntry, "Reseted for a New Entry");
+_LIT8(KCreatingEntry, "Creating Entry");
+_LIT8(KCreatedEntry, "Created Entry");
+_LIT8(KUpdatingEntry, "Updating Entry");
+_LIT8(KUpdatedEntry, "Updated Entry");
+_LIT8(KMoveToParentEntry, "Moved to parent entry");
+_LIT8(KMovedToParentEntry, "End of Moved to parent entry");
+
+_LIT8(KIgnoringStreams, "Discarding streams");
+_LIT8(KStartMessageComplete, "Start Message Complete");
+_LIT8(KMessageComplete, "Message Complete");
+_LIT8(KHeaderComplete, "Message Header complete");
+_LIT8(KReturnReceiptTo, "return-receipt-To is set");
+_LIT8(KStartStoringEntryStream, "Starting Storing Entry Stream");
+_LIT8(KStoringEntryStream, "Storing Entry Stream");
+_LIT8(KDoneStoringEntryStream, "Done Storing Entry Stream");
+
+#endif // _MSG_NO_LOGGING
+
+// uncomment the line below if logging is to be enabled
+
+#if defined(__IMUT_LOGGING)
+#define RECVLOG(text) (iImcvLog?iImcvLog->AppendComment(text):void(0));
+#define RECVLOG_OUT(text) (iImcvLog?iImcvLog->AppendOut(text):void(0));
+#define LOGGING(string1, string2) (Logging(string1, string2));
+#else
+#define RECVLOG(text) (void(0));
+#define RECVLOG_OUT(text) (void(0));
+#define LOGGING(string1, string2) (void(0));
+#endif
+
+
+const TInt KBodyTextChunkSizeBytes = 512;
+
+
+/**
+NewLC()
+Static factory constructor. Uses two phase construction 
+and pushes the newly created object into the Cleanup stack.
+
+@param anFs
+@param aClientEntry
+@param aMsgType
+@param aEmailServiceId
+@return
+*/
+ CImCltRecvConvert* CImCltRecvConvert::NewLC(RFs& anFs,CMsvEntry* aClientEntry,TUid aMsgType,TMsvId aEmailServiceId)
+	{
+	CImCltRecvConvert* self = new (ELeave) CImCltRecvConvert(anFs,aClientEntry,aMsgType,aEmailServiceId);
+	CleanupStack::PushL(self);
+	self->ConstructL(anFs);
+	return self;
+	}
+
+
+/**
+NewL()
+Static factory constructor. Uses two phase construction.
+
+@param anFs
+@param aClientEntry
+@param aMsgType
+@param aEmailServiceId
+@return
+*/
+ CImCltRecvConvert* CImCltRecvConvert::NewL(RFs& anFs,CMsvEntry* aClientEntry,TUid aMsgType,TMsvId aEmailServiceId)
+	{
+	CImCltRecvConvert* self = CImCltRecvConvert::NewLC(anFs,aClientEntry,aMsgType,aEmailServiceId);
+	CleanupStack::Pop();
+	return self;
+	}
+
+
+/**
+ConstructL()
+
+@param anFs
+*/
+void CImCltRecvConvert::ConstructL(RFs& anFs)
+	{
+	iFsSession = &anFs;  
+
+	RResourceFile resFile;
+	OpenResourceFileL(resFile, anFs);	// NB leaves if file not found
+
+	// make sure the resource file will be closed if anything goes wrong
+	// CloseResourceFile is declared in IMUTDLL.H and defined in IMUTDLL.CPP
+	TCleanupItem close( CloseResourceFile, &resFile );
+	CleanupStack::PushL( close );
+	
+	// Read iStore8BitData flag.
+	HBufC8* buf = resFile.AllocReadLC(STORE_8BIT_BODY_TEXT);
+	TResourceReader reader;
+	reader.SetBuffer(buf);
+	iStore8BitData = reader.ReadInt8();
+	CleanupStack::PopAndDestroy(buf);
+
+	buf = resFile.AllocReadLC(REMOVED_ATTACHMENT_TAG);
+	reader.SetBuffer(buf);
+	iRemovedAttachmentTag = reader.ReadTPtrC().AllocL();
+	CleanupStack::PopAndDestroy(buf);
+	
+	buf = resFile.AllocReadLC(DEFAULT_ATTACHMENT_NAME);
+	reader.SetBuffer(buf);
+	iDefaultAttachmentName = reader.ReadTPtrC().AllocL();
+	CleanupStack::PopAndDestroy(buf);
+	buf = resFile.AllocReadLC(PARTIAL_DOWNLOAD_FOOTER_MESSAGE);
+	reader.SetBuffer(buf);
+	iPartialEmailFooter = (reader.ReadTPtrC()).AllocL();
+	CleanupStack::PopAndDestroy(buf);
+	buf = NULL;
+	CleanupStack::PopAndDestroy(&resFile);
+
+	// create CImHeader object to store Rfc822 header info...
+	iOutputHeader = CImHeader::NewLC();
+	CleanupStack::Pop();			   
+
+	if (iStore8BitData)
+		{
+		//Create body text storage helper.
+		iBodyText = CMsvBodyText::NewL();
+		}
+	else
+		{
+		// create CRichText object to store body...
+		iParaLayer = CParaFormatLayer::NewL();
+		iCharLayer = CCharFormatLayer::NewL();
+		iOutputBody = CRichText::NewL(iParaLayer, iCharLayer);
+		}
+	
+	// Create Rfc822 filter object...
+	iRfc822Token = CLocalRfc822Token::NewLC();
+	CleanupStack::Pop();				 
+	iRfc822Token->SetImRecvConvert(this);
+
+	// Create converter objects...
+	iCharacterConverter = CCnvCharacterSetConverter::NewL();
+	iCharConv = CImConvertCharconv::NewL(*iCharacterConverter, anFs);
+	iHeaderConverter = CImConvertHeader::NewL(*iCharConv); 
+
+	
+	// Create MIME filter object...
+	iMimeParser = CLocalMimeParser::NewL(*this);
+	
+	
+	// logfile stuff
+	iImcvLog=NULL;
+
+#ifdef __IMUT_LOGGING	
+	TRAP_IGNORE(iImcvLog=CImLog::NewL(KLogFilePath, EAppend));
+#endif
+
+	iRootEntryId = EntryId();
+
+	iNotFinishedRfc822Header = ETrue;
+	
+	iEmailEntry = new (ELeave) TMsvEmailEntry;
+	iReceivingHeadersOnly=EFalse;	
+
+	iParent = new (ELeave) CArrayFixFlat<TParentDetails>(3);
+
+	iFirstBoundaryReached=EFalse;
+
+	ResetL();
+	
+	RECVLOG( KNewLogHeader )
+	}
+
+
+/**
+CImCltRecvConvert()
+
+@param anFs
+@param aClientEntry
+@param aMsgType
+@param aEmailServiceId
+*/
+
+CImCltRecvConvert::CImCltRecvConvert(RFs& anFs,CMsvEntry* aClientEntry,TUid aMsgType,TMsvId aEmailServiceId)
+	: CLocalImRecvConvert(anFs,iNullServerEntry,aMsgType,aEmailServiceId),
+	  iClientEntry(aClientEntry)
+	{
+	__DECLARE_NAME(_S("CImCltRecvConvert"));
+	}
+
+
+/**
+~CImCltRecvConvert()
+Destructor
+*/
+CImCltRecvConvert::~CImCltRecvConvert()
+	{
+	}
+
+
+/**
+ResetForHeadersL()
+*/
+ void CImCltRecvConvert::ResetForHeadersL()
+	{
+	// This function is used in preference to ResetL() when the owner
+	// only wishes to create  email entries in the remote mailbox - 
+	// they do not wish to create any stores associated with the message
+	// entry
+	ResetL();
+	iReceivingHeadersOnly = ETrue;
+	}
+
+
+/**
+ResetL()
+*/
+ void CImCltRecvConvert::ResetL()
+	{
+	RECVLOG(KReset) 
+
+	iBodyId=KMsvNullIndexEntryId;
+	iSizeOfAttachmentsRemoved=0;
+	iClientEntry->SetEntryL(iRootEntryId);
+	
+	iReceivingHeadersOnly=EFalse;
+	iMessageEntryCalled=EFalse;
+	iLeaveError=KErrNone; 		
+	iCurrentMultipartFolderEntryId=0;
+
+	TParentDetails parent;
+	parent.iAttachment=parent.iMHTML=EFalse;
+	parent.iSize=0;
+	iParent->InsertL(0,parent);
+
+	if(iEmailEntry)
+		{
+		delete iEmailEntry;
+		iEmailEntry=NULL;
+		}
+	iEmailEntry = new (ELeave) TMsvEmailEntry;
+
+	// "iSavingAttachments" commands this code to store attachments in files.
+	// Currently this is always set to ETrue as we intend to save all attachments
+	// However, if the user wishes to discard (ie do not save) any 
+	// attachments in incoming email messages - then this member variable
+	// may be set to EFalse by the inline accessor function "SaveAllAttachments(TBool)"
+	iSavingAttachments=ETrue;
+	iAttachmentFileState=EFileIsClosed;
+
+	// iLeaveError contains the error value of any functions that leaves (ie CRichText::InsertL)
+	// or any returned error value that generates a leave from within CImRecvConvert (ie RFile::Create)
+
+	iGlobalIndent=0;
+	iLongestLine=50;
+	
+	iImPriority=EMsvMediumPriority;
+	if(NULL!=iImcvUtils)
+		{
+		delete iImcvUtils;
+		iImcvUtils=NULL;
+		}
+	iImcvUtils=CImcvUtils::NewL();
+
+	// reset internal date
+	iTimeDate.HomeTime();
+	
+	iMimeParser->Reset();
+	
+	iNewEntry=EFalse; //EFalse if the entry was moved to. ETrue if the entry was just created
+	iTopMessagePart=KMsvRootIndexEntryId;
+	ResetForNewEntryL(iDefaultEntryType);
+	iMIMEPart_822Header = EFalse;
+	iPartialEmail=EFalse;
+
+	RECVLOG(KReseted) 
+	}
+
+
+/**
+ParseNextFieldL()
+
+@param aSourceLine
+@return
+*/
+ TInt CImCltRecvConvert::ParseNextFieldL(const TDesC8& aSourceLine) 
+	{
+	__ASSERT_DEBUG(iRootEntryId!=KMsvRootIndexEntryId, gPanic(KPanicServiceIdNotValid));
+	RECVLOG_OUT(aSourceLine);
+
+	if ((iLeaveError == KErrNone) && (iClientEntry->Entry().Id() == KMsvRootIndexEntryId))
+		{
+		iClientEntry->SetEntryL(iSavedEntryId);
+		}
+
+	if(iLeaveError==KErrNone)
+		{
+		TRAP(iLeaveError, ParseNextLineL(aSourceLine));		
+		}
+
+	if (iLeaveError==KErrNone)
+		iSavedEntryId = iClientEntry->Entry().Id();
+	TUid type = iClientEntry->Entry().iType;
+	if( type != KUidMsvMessageEntry    &&
+		type != KUidMsvEmailTextEntry  &&
+		type != KUidMsvEmailHtmlEntry  &&
+		type != KUidMsvAttachmentEntry)
+		{
+		iClientEntry->SetEntryL(KMsvRootIndexEntryId);
+		}
+
+
+	return iLeaveError;
+	}
+
+
+/**
+ParseNextLineL()
+
+@param aSourceLine
+*/
+void CImCltRecvConvert::ParseNextLineL(const TDesC8& aSourceLine)
+	{
+	iParsedMimeBoundaryLast=0;
+	if(!iFinishedHeader)
+		{
+		// start by getting the next token from the header
+		iRfc822Token->ParseNextLineL(aSourceLine);
+
+		switch(iRfc822Token->iHeaderPart)
+			{
+			case CLocalRfc822Token::EUnknown:
+			case CLocalRfc822Token::ENotFinished:
+				RECVLOG(KPartLine)
+				break;
+			case CLocalRfc822Token::EFrom:
+				iOutputHeader->SetFromL(*iRfc822Token->OutputLine());
+				LOGGING(KFound,KImcvFromPrompt);
+				break;
+			case CLocalRfc822Token::EReplyTo:
+				iOutputHeader->SetReplyToL(*iRfc822Token->OutputLine());
+				LOGGING(KFound,KImcvReplyToPrompt);
+				break;
+			case CLocalRfc822Token::ETo:
+				ParseRecipientListL(iOutputHeader->ToRecipients());
+				LOGGING(KFound,KImcvToPrompt);
+				break;
+			case CLocalRfc822Token::ECc: 
+				ParseRecipientListL(iOutputHeader->CcRecipients());
+				LOGGING(KFound,KImcvCcPrompt);
+				break;
+			case CLocalRfc822Token::EBcc: 
+				ParseRecipientListL(iOutputHeader->BccRecipients());
+				LOGGING(KFound,KImcvBccPrompt);
+				break;
+			case CLocalRfc822Token::ESubject:
+				iOutputHeader->SetSubjectL(*iRfc822Token->OutputLine());
+				LOGGING(KFound,KImcvSubjectPrompt);
+				break;
+			case CLocalRfc822Token::EDate:
+				iRfc822Date.ParseDateField(*iRfc822Token->OutputLine() , iTimeDate); 
+				if (iEmailEntry->Id() != iTopMessagePart)
+					{
+					iEmailEntry->iDate = iTimeDate;
+					}
+				LOGGING(KFound,KImcvDatePrompt);
+				break;
+			case CLocalRfc822Token::EMessageId:
+				iOutputHeader->SetImMsgIdL(*iRfc822Token->OutputLine());
+				LOGGING(KFound,KImcvMessageIdPrompt);
+				break;
+			case CLocalRfc822Token::EPriority:
+				iImPriority=iImcvUtils->EvaluatePriorityText(*iRfc822Token->OutputLine());
+				LOGGING(KFound,KImcvPriorityPrompt);
+				break;
+			case CLocalRfc822Token::EReturnReceiptTo:
+				iOutputHeader->SetReceiptAddressL(*iRfc822Token->OutputLine());
+				LOGGING(KFound,KReturnReceiptTo);
+				break;
+			case CLocalRfc822Token::EEndOfHeader:
+				// the next line goes in the body part
+				iFinishedHeader = ETrue;
+				RECVLOG(KEndOFHeader)
+				break;
+			default:
+				RECVLOG(KEndOFHeader)
+				break;
+			}
+
+
+		if(iRfc822Token->iHeaderPart != CLocalRfc822Token::ENotFinished)
+			{
+			// Now that we've used the data, we also need to clear the output line from the tokeniser....
+			iRfc822Token->OutputLine()->Des() = KNullDesC8;
+
+			// whatever part we just read, we may also have read the empty line that separates
+			// the header from the body
+			if((iFinishedHeader = iRfc822Token->LastToken()) != EFalse)	//iFinishedHeader set to 1 on CRLF-
+				{
+				RECVLOG(KLastToken);
+				iNotFinishedRfc822Header = EFalse;
+
+				iHeaderConverter->SetMessageType(iMimeParser->MessageIsMime());
+				iHeaderConverter->DecodeAllHeaderFieldsL(*iOutputHeader);
+
+				if (iMimeParser->MessageIsMime())
+					{
+					EndOfHeaderMIMEProcessingL();
+					}
+				else
+					{
+					EndOfHeaderProcessingL();
+					}
+
+				if (iStore8BitData)
+					{
+					iBodyText->SetDefaultCharacterSet(iCharConv->SystemDefaultCharset());
+					if ( iMimeParser->MessageIsMime() && iMimeParser->ContentType()==EMimeText )
+						{
+						iBodyText->SetCharacterSet(iMimeParser->CurrentCharsetL());
+						}
+					else
+						{
+						iBodyText->SetCharacterSet(0);
+						}
+					}
+				else
+					{
+					// Get charset for decoding.
+					if ( iMimeParser->MessageIsMime() && iMimeParser->ContentType()==EMimeText )
+						{
+						iCharConv->PrepareToConvertToFromOurCharsetL(iMimeParser->CurrentCharsetL());
+						}
+					else
+						{
+						iCharConv->PrepareToConvertToFromOurCharsetL(iCharConv->SystemDefaultCharset());
+						}
+					}
+				}
+			}
+		}
+	else if (iReceivingHeadersOnly==EFalse)
+		{	
+		//Set to EFalse when a single line is to be skipped (ie boundary line)
+		iCommitLine=ETrue; 
+
+		// read one line of the message body if I am processing a whole email message
+		if(iMimeParser->MessageIsMime())
+			{
+			ParseMimeLineL(aSourceLine);
+			}
+		else
+			{
+			ParseBodyLineL(aSourceLine);	
+			}
+
+		if((iCommitLine)&&(!iSkipData))
+			{
+			DecodeAndStoreLineL(aSourceLine);
+			}	
+		}
+	}
+
+
+/**
+MessageEntryDetailsL()
+
+@return
+*/
+ TMsvEmailEntry CImCltRecvConvert::MessageEntryDetailsL()
+	{
+
+	iMessageEntryCalled=ETrue;
+	CloseAttachmentFileL();
+
+	// A message requiring manual termination and not part way through a MIME part header
+	if( iTopMessagePart==EntryId() && iFinishedHeader) 
+		{
+		StoreEntryStreamsL(KStore822Header|KStoreMIMEHeader);
+		}
+	else
+		{
+		iClientEntry->SetEntryL(iTopMessagePart);         
+		if(iEmailEntry)
+			{
+			delete iEmailEntry;
+			iEmailEntry=NULL;
+			}
+	
+		iEmailEntry = new (ELeave) TMsvEmailEntry(iClientEntry->Entry());
+		}
+		
+	return *iEmailEntry;
+	}
+
+
+/**
+MessageCompleteL()
+
+@param aEmailEntry
+*/
+ void CImCltRecvConvert::MessageCompleteL(TMsvEmailEntry aEmailEntry)
+	{
+	if (iClientEntry->Entry().Id() == KMsvRootIndexEntryId)
+		{
+		iClientEntry->SetEntryL(iSavedEntryId);
+		}
+
+	__ASSERT_DEBUG(iMessageEntryCalled, gPanic(KPanicMessageEntryNotCalled));
+	__ASSERT_DEBUG(aEmailEntry.Id()==iTopMessagePart, gPanic(KPanicMessageEntryIdHasChanged));
+
+	// Called ResetL() to reset object instead of ResetForHeadersL()
+	__ASSERT_DEBUG(iReceivingHeadersOnly, gPanic(KPanicIncorrectResetState)); 
+
+	if(iEmailEntry)
+		{
+		if (iEmailEntry->Id())
+			{
+			if(iLeaveError==KErrNone)
+				{
+				// a remote email header cannot have any attachments or be marked as complete...
+				aEmailEntry.SetAttachment(EFalse);
+				aEmailEntry.SetMHTMLEmail(EFalse);
+				aEmailEntry.SetComplete(EFalse);
+				iClientEntry->SetEntryL(aEmailEntry.Id());
+				RECVLOG(KHeaderComplete)
+				}
+			else
+				{
+				if (!iPopulateMessage)
+					{
+					TMsvId currentId = EntryId();
+					iClientEntry->SetEntryL(iClientEntry->Entry().Parent());			
+					iClientEntry->DeleteL(currentId);
+					}
+				User::Leave(iLeaveError);
+				}
+			}
+		}
+
+	iSavedEntryId = iClientEntry->Entry().Id();
+	iClientEntry->SetEntryL(KMsvRootIndexEntryId);
+	}
+
+
+/**
+MessageCompleteL()
+
+@return
+*/
+ TMsvId CImCltRecvConvert::MessageCompleteL()
+	{
+	RECVLOG(KStartMessageComplete)
+	if (iClientEntry->Entry().Id() == KMsvRootIndexEntryId)
+		{
+		iClientEntry->SetEntryL(iSavedEntryId);
+		}
+	if (iParsedMimeBoundaryLast==EFalse && iAttachmentFileState==EFileIsOpen && iPartialEmail!=EFalse)
+		{
+		iAttachmentFileState=EFileTopIncomplete;
+		}
+
+	CloseAttachmentFileL();
+
+	if(!iEmailEntry->Id())
+		{
+		return 0;
+		}
+
+	if(iLeaveError!=KErrNone)
+		{
+		User::Leave(iLeaveError);
+		}
+
+	if (EntryId()!=iTopMessagePart)
+		{
+		iEmailEntry->SetComplete(ETrue);
+		StoreEntryStreamsL(KStoreBodyText);
+		MoveToParentEntryL();
+
+		if( iTopMessagePart==EntryId() && iFinishedHeader) 
+			{
+			iEmailEntry->SetVisible(ETrue);
+			iEmailEntry->SetInPreparation(EFalse);
+			iEmailEntry->SetBodyTextComplete(ETrue);
+			iEmailEntry->SetComplete(ETrue);
+			iEmailEntry->SetSendingState(KMsvSendStateWaiting);
+			// Main message.
+			StoreMessageEntryDetailsL();
+			return iEmailEntry->Id();
+			}
+		else if(iEmailEntry->iType == KUidMsvMessageEntry)
+			{
+			StoreMessageEntryDetailsL();
+			MoveToParentEntryL();
+			StoreMessageEntryDetailsL();
+			}
+		}
+
+	iClientEntry->SetEntryL(iTopMessagePart);         
+	if(NULL!=iEmailEntry)
+		{
+		delete iEmailEntry;
+		iEmailEntry=NULL;
+		}
+	iEmailEntry = new (ELeave) TMsvEmailEntry(iClientEntry->Entry());
+	iEmailEntry->SetVisible(ETrue);
+	iEmailEntry->SetInPreparation(EFalse);
+	iEmailEntry->SetComplete(ETrue);
+	iEmailEntry->SetBodyTextComplete(ETrue);
+
+	iEmailEntry->SetSendingState(KMsvSendStateWaiting);	
+
+
+	iEmailEntry->SetAttachment(iParent->At(0).iAttachment);
+	iEmailEntry->SetMHTMLEmail(iParent->At(0).iMHTML);
+
+	if(iEmailEntry->MHTMLEmail() == EFalse && iEmailEntry->Attachment() == EFalse && iRelatedAttachments !=EFalse)
+		{
+		iEmailEntry->SetAttachment(ETrue);
+		}
+	iRelatedAttachments=EFalse;
+	
+	iEmailEntry->iSize=iParent->At(0).iSize;
+	iEmailEntry->SetMessageFolderType(iParent->At(0).iFolder);
+
+	iClientEntry->ChangeL(*iEmailEntry);
+
+	iSavedEntryId = iClientEntry->Entry().Id();
+	iClientEntry->SetEntryL(KMsvRootIndexEntryId);
+	RECVLOG(KMessageComplete)
+	return iEmailEntry->Id();
+	}
+
+
+ /**
+ParseMimeLineL()
+
+@param aSourceLine
+*/ 
+void CImCltRecvConvert::ParseMimeLineL(const TDesC8& aSourceLine)  
+	{
+	iTopPartialDownloadCounter+=aSourceLine.Length(); // increment the number of bytes of the attachment downloaded so far
+	if(!iMimeParser->IsBoundary(aSourceLine))
+		{
+		if(!iPrepared) // first line of the body
+			{		
+			if (iMIMEPart_822Header)
+				{
+				// missing 822 part header. Revert to default.
+				EndOfHeaderMIMEProcessingL();
+				iMIMEPart_822Header=EFalse;
+				}
+
+			PrepareDecoder();
+			}
+
+		if (CheckUUEStartL(aSourceLine))
+			{
+			iAlgorithm=EUUDecode;
+			iCommitLine=EFalse;
+			}
+		}
+	else
+		{
+		iParsedMimeBoundaryLast=ETrue;
+		// found a MIME boundary so store the current parts data and update its entry.
+
+		RECVLOG(KFoundMIMEBoundary)
+		iCommitLine=EFalse; //Dont store this line as its a boundary.
+
+		if(!iFirstBoundaryReached && iEntryType==EFolderEntry)
+			{
+			iFirstBoundaryReached=ETrue;
+			if (!iCurrentMultipartFolderEntryId)
+				iCurrentMultipartFolderEntryId = EntryId();
+			MoveToParentEntryL();
+			ResetForNewEntryL(iDefaultEntryType);
+			return; // First boundary encountered.
+			}
+
+		CloseAttachmentFileL();
+		if(iNewEntry)
+			{
+			iEmailEntry->SetComplete(ETrue);
+			iEmailEntry->SetBodyTextComplete(ETrue);
+			StoreEntryStreamsL(KStoreMIMEHeader | KStoreBodyText);
+			if (iBodyId==KMsvNullIndexEntryId)
+				{
+				iBodyId=iEmailEntry->Id();
+				}
+			}
+
+		iSkipData = EFalse;
+
+		// check whether we just found the terminating boundary...
+		if(iMimeParser->IsTerminatingBoundary())
+			{
+			RECVLOG(KRemoveBoundary);
+			iMimeParser->RemoveBoundary();
+			RECVLOG(KRemovedBoundary);
+			iMIMEPart_822Header = EFalse;
+
+			if (EntryId()!=iTopMessagePart)
+				{
+				if(iEmailPart==KParentPart)
+					{
+					// rfc822 message which is not  not multipart.
+					iEmailPart=KNoPart;
+					MoveToParentEntryL();				
+
+					// Embedded message
+					iEmailEntry->SetComplete(ETrue);
+					iEmailEntry->SetBodyTextComplete(ETrue);
+					StoreMessageEntryDetailsL();
+					}
+				else if (iEmailEntry->iType==KUidMsvMessageEntry)
+					{
+					// Moving up from a multi embedded rfc822 message.
+					iEmailEntry->SetComplete(ETrue);
+					iEmailEntry->SetBodyTextComplete(ETrue);
+					StoreMessageEntryDetailsL();
+					}
+				}
+
+			MoveToParentEntryL();
+			iEntryDataSize = iEmailEntry->iSize;
+
+			if(iClientEntry->Entry().iType == KUidMsvFolderEntry)
+				{
+				iCurrentMultipartFolderEntryId = EntryId();
+				}
+			else if (EntryId()!=iTopMessagePart)
+				{
+				if(iEmailEntry->iType == KUidMsvMessageEntry)
+					{
+					iEmailEntry->SetComplete(ETrue);
+					iEmailEntry->SetBodyTextComplete(ETrue);
+					StoreMessageEntryDetailsL();
+					}
+				MoveToParentEntryL();
+				iEntryDataSize += iEmailEntry->iSize;
+				}
+
+			if(!iNewEntry)
+				ResetForNonMimeEntryL();
+
+			RECVLOG(KSkippingData)
+			iSkipData = ETrue;
+			iDefaultEntryType=ETextEntry;
+			}
+		else // if regular boundary
+			{ 
+			RECVLOG(KSectionHeader)
+			if(iEmailPart==KParentPart && EntryId()!=iTopMessagePart)
+				{
+				// rfc822 message which is not  not multipart.
+				iEmailPart=KNoPart;
+				MoveToParentEntryL();
+				// Embedded message
+				iEmailEntry->SetComplete(ETrue);
+				iEmailEntry->SetBodyTextComplete(ETrue);
+				StoreMessageEntryDetailsL();
+				}
+
+			if (!iCurrentMultipartFolderEntryId && iEmailPart==KNoPart)
+				MoveToParentEntryL();
+
+			ResetForNewEntryL(iDefaultEntryType);
+			}
+		}
+	}
+
+
+/**
+EndOfHeaderProcessingL()
+*/
+void CImCltRecvConvert::EndOfHeaderProcessingL()
+	{	
+	CreateEntryL();
+	StoreEntryStreamsL(KStore822Header);
+	iEntryDataSize = 0;
+	}
+
+
+/**
+ParseBodyLineL()
+
+@param aSourceLine
+*/
+void CImCltRecvConvert::ParseBodyLineL(const TDesC8& aSourceLine)
+	{
+	TInt len=aSourceLine.Length();
+	iTopPartialDownloadCounter+=len; // added for TOP. increment the number of bytes of the attachment downloaded so far
+
+	if (iBodyId==KMsvNullIndexEntryId)
+		{
+		iBodyId=iEmailEntry->Id();
+		}
+	
+	TMsvId id=0;
+	// first check whether this line is a UUEncode start boundary
+	if(CheckUUEStartL(aSourceLine)) 
+		{
+		RECVLOG(KFoundUUEStartBoundary)
+		TFileName tempStore = iAttachmentName;
+		id = EntryId();
+		if (!iNewNonMIMEBodyPart || id!=iTopMessagePart) // main message entry
+			{
+			iEmailEntry->SetComplete(ETrue);
+			iEmailEntry->SetBodyTextComplete(ETrue);
+			StoreEntryStreamsL(KStoreBodyText);
+			}
+		MoveToParentEntryL();
+		if ( !CreateNonMIMEFolderEntryL(id))
+			{
+			ResetForNonMimeEntryL();
+			}
+			
+		iEntryType = EAttachmentEntry;
+		CreateEntryL();
+		SetAttachmentName(tempStore);
+		
+		iCurrentPartIsRichText = EFalse;
+		iAlgorithm=EUUDecode;
+		iCommitLine=EFalse;
+		if(!iSavingAttachments)
+			{
+			RECVLOG(KSkippingData)
+			iSkipData=ETrue;
+			}
+		iNewNonMIMEBodyPart=EFalse;
+		}
+	else if(aSourceLine.CompareF(KImcvUueEnd)==0) // Checks for the UUEncode end boundary
+		{
+		RECVLOG(KFoundUUEEndBoundary)
+		CloseAttachmentFileL();
+		StoreEntryDataL();
+		MoveToParentEntryL();
+		iSkipData = EFalse;
+		iCommitLine=EFalse;
+		iNewNonMIMEBodyPart=ETrue; 
+		}
+	else if (iNewNonMIMEBodyPart && !( len==2 && aSourceLine[0]==KImcvCR && aSourceLine[1]==KImcvLF ))
+		{
+		id = EntryId();
+		if (!iNewNonMIMEBodyPart || id!=iTopMessagePart)
+			{
+			iEmailEntry->SetComplete(ETrue);
+			iEmailEntry->SetBodyTextComplete(ETrue);
+			StoreEntryStreamsL(KStoreBodyText);
+			}
+		MoveToParentEntryL();
+		if ( !CreateNonMIMEFolderEntryL(id))
+			ResetForNonMimeEntryL();
+		iAlgorithm=ENoAlgorithm;
+		iEntryType = ETextEntry;
+		CreateEntryL();
+		iNewNonMIMEBodyPart=EFalse;
+		}	
+	}
+
+
+/**
+CreateNonMIMEFolderEntryL()
+
+@param aCurrentId
+@return
+*/
+TBool CImCltRecvConvert::CreateNonMIMEFolderEntryL(TMsvId aCurrentId)
+	{
+	if ( aCurrentId==iTopMessagePart || iCurrentMultipartFolderEntryId )
+		return EFalse;
+
+	iClientEntry->SetEntryL(iTopMessagePart); 
+	iEmailPart = KMultiPart;
+	iEntryType = EFolderEntry;
+	CreateEntryL();
+
+	TMsvId destId = EntryId();
+	iClientEntry->SetEntryL(iTopMessagePart); 
+	iClientEntry->MoveL(aCurrentId, destId);
+	iClientEntry->SetEntryL(aCurrentId);
+	iClientEntry->SetEntryL(iClientEntry->Entry().Parent()); 
+
+	iEmailEntry->SetMessageFolderType(iMimeParser->MessageFolderType());
+
+	RECVLOG(KResetForNewEntry) 
+
+	iMimeParser->ResetForNewEntry();
+	
+	if (iStore8BitData)
+		{
+		//Create a buffer to hold the body text as it is down loaded.
+		delete iBodyBuf;
+		iBodyBuf = NULL;
+		iBodyBuf = CBufFlat::NewL(KBodyTextChunkSizeBytes);
+		}
+	else
+		{
+		iOutputBody->Reset();
+		}
+		
+	ResetForNonMimeEntryL(); 
+	RECVLOG(KResetedForNewEntry) 
+	return ETrue;
+	}
+
+
+/**
+CreateAttachmentL()
+
+@return
+*/
+TBool CImCltRecvConvert::CreateAttachmentL()
+	{
+	// added to support TOP command. Reset the download counter each time we have a new
+	// attachment
+	iTopPartialDownloadCounter = 0; 
+
+	// Need to check that the complete filename: iAttachmentFullPath & iAttachmentName	
+	// does not exceed 256 characters. Greater than this and it cannot be saved as a file.
+
+	TBool addExtension = ETrue;
+	if(iAttachmentName.Length() == 0)	//i.e. problem with Attachment name
+	    {
+		// No filename present. Generate one.
+		if(iMimeParser->ContentDescription().Length()!=0)
+			{
+			// Use ContentDescription() as default name 
+			// - as this is more informative than the default
+
+			TLex sourceLineLex = iMimeParser->ContentDescription();
+			ExtractFilename(sourceLineLex, iAttachmentName);
+			}
+		else
+			{
+			iAttachmentName = *iDefaultAttachmentName;	
+			}
+			
+		}
+	else
+		{
+		// Filename present. Check it is valid.
+		ReplaceInvalidCharacters(iAttachmentName);
+		if (iAttachmentName.Locate(KImcvFullStop)!=KErrNotFound)
+			{
+			addExtension=EFalse;
+			}
+			
+		}
+	if (addExtension)
+		{
+		AddFileExtension();
+		}
+	CMsvStore* store = iClientEntry->EditStoreL(); 
+	CleanupStack::PushL(store);
+	CMsvAttachment* attachment = CMsvAttachment::NewL(CMsvAttachment::EMsvFile);
+	CleanupStack::PushL(attachment);
+	attachment->SetAttachmentNameL(iAttachmentName);
+	
+	RFile file; 
+	store->AttachmentManagerExtensionsL().CreateAttachmentL(iAttachmentName,file,attachment);
+	CleanupStack::Pop(attachment);
+	
+	iAttachmentFile.SetFileHandle(file,TImAttachmentFile::EImFileWrite);
+	store->CommitL();
+	CleanupStack::PopAndDestroy(store); // store
+
+	if(KErrNone!=iLeaveError)
+		{
+		iAttachmentFileState=EFileFailedToOpen;
+		CloseAttachmentFileL();
+		return EFalse;
+		}
+
+	iAttachmentFileState=EFileIsOpen;
+	return ETrue;
+	}
+
+	
+/**
+WriteToAttachmentL()
+
+@param text
+*/
+void CImCltRecvConvert::WriteToAttachmentL(const TDesC8& text)  
+	{
+	if ( (iAttachmentFileState==EFileIsClosed || iAttachmentFileState==EFileNotOpen) 
+		&& CreateAttachmentL() && iEntryType!=EHtmlEntry)
+			iEmailEntry->SetAttachment(ETrue);
+	
+	if(iAttachmentFileState!=EFileIsOpen || !text.Length())
+		{
+		RECVLOG(KSkippingData)
+		iSkipData = ETrue;
+		}
+
+	// write decoded data into a file if there is any data there to write.
+
+	RECVLOG(KWritingToFile)
+
+	// Convert text before writing to attachment.
+	
+	// Store as Binary files..
+	iLeaveError=iAttachmentFile.WriteFile(text);
+
+	if(KErrNone==iLeaveError)
+		{
+		iEntryDataSize += text.Length();	
+		}
+		
+	else	
+		{
+		// the file write failed (eg.there is no space left), set new file state and skip 
+		RECVLOG(KFailedToWriteToFile)
+		iAttachmentFileState=EFileIsIncomplete;
+		CloseAttachmentFileL();
+		}
+	RECVLOG(KWroteToFile)
+	}
+
+
+/**
+StoreEntryStreamsL()
+*/
+void CImCltRecvConvert::StoreEntryStreamsL()
+	{
+	StoreEntryStreamsL(KStoreBodyText | KStore822Header | KStoreMIMEHeader);
+	}
+
+
+
+/**
+StoreEntryStreamsL()
+
+@param aSettings
+*/
+void CImCltRecvConvert::StoreEntryStreamsL(TInt aSettings)
+	{
+	RECVLOG(KStartStoringEntryStream);
+	if (iReceivingHeadersOnly==EFalse)
+		{
+		CMsvStore* entryStore = NULL;
+		TBool commitStore = EFalse;
+
+		TRAPD(error, entryStore = iClientEntry->EditStoreL());
+		if(error==KErrNone) // if store does not exist then the entry is the wrong type
+			{
+			CleanupStack::PushL(entryStore);
+
+			if (aSettings & KStore822Header)
+				{
+				Store822HeaderL(*entryStore, commitStore);
+				}
+			
+			if (aSettings & KStoreMIMEHeader)
+				{
+				StoreMIMEHeaderL(*entryStore, commitStore);
+				}
+
+			if (aSettings & KStoreBodyText)
+				{
+				StoreBodyTextL(*entryStore, commitStore);
+				}
+			// only commit to the store if I wrote something into it
+			if (commitStore)
+				{
+				RECVLOG(KStoringEntryStream);
+				entryStore->CommitL();
+				}
+
+			StoreEntryDataL();
+			CleanupStack::PopAndDestroy(); //entryStore		
+			}
+
+		}
+	RECVLOG(KDoneStoringEntryStream);
+	}
+
+
+/**
+StoreEntryDataL()
+
+@return
+*/
+TBool CImCltRecvConvert::StoreEntryDataL()
+	{
+	// NB function should only be called if a whole email is being processed
+	TBool commit=EFalse;
+	RECVLOG(KUpdatingEntry)
+
+	if (iEmailEntry->iType==KUidMsvMessageEntry)
+		{
+		iParent->At(0).iSize += iEntryDataSize;
+		}
+	else
+		{
+		iEmailEntry->iSize += iEntryDataSize;
+		if (iEntryType==EAttachmentEntry || iEntryType==EHtmlEntry)
+			{
+			iEmailEntry->iDetails.Set(iAttachmentName);
+			}
+		}
+	iClientEntry->ChangeL(*iEmailEntry);
+
+	RECVLOG(KUpdatedEntry)
+	return commit;	// if I wrote data into the store, tell owner	
+	}
+
+
+/**
+MoveToParentEntryL()
+*/
+void CImCltRecvConvert::MoveToParentEntryL()
+	{
+	// This function changes the context to the current entry's parent entry.
+	RECVLOG(KMoveToParentEntry)
+
+	// Change context to the parent entry	
+	if (EntryId()==iTopMessagePart)
+		{
+		return; // Already there.
+		}
+
+	iClientEntry->SetEntryL(iClientEntry->Entry().Parent()); 
+
+	iNewEntry = EFalse;
+	
+	// only read and write to store if this is a real email message; headers stored in
+	// the remote mailbox do not require any store information.
+	if (iReceivingHeadersOnly)
+		{
+		RECVLOG(KIgnoringStreams)
+		return;
+		}
+
+	TBool allowAttachmentFlag=ETrue;
+	if(iClientEntry->Entry().iType == KUidMsvFolderEntry)
+		{
+		// Current entry is a folder entry signifying a MIME multipart.
+		// Change context to the parent entry
+		TMsvEmailEntry entry = (TMsvEmailEntry) iClientEntry->Entry();
+		iCurrentMultipartFolderEntryId = EntryId();
+		allowAttachmentFlag = !(entry.MessageFolderType()==EFolderTypeRelated || 
+								entry.MessageFolderType()==EFolderTypeAlternative);
+	
+
+		if (EntryId()!=iTopMessagePart)
+			{	
+			iClientEntry->SetEntryL(iClientEntry->Entry().Parent()); 
+			}
+		}
+
+	TBool childIsAttachment = (iEmailEntry->Attachment() || iEmailEntry->iType == KUidMsvMessageEntry) ? ETrue:EFalse;
+	TBool childIsMHTML=EFalse;
+	// Dont want the flag propogated 'up' past a message entry.
+	if(iEmailEntry->iType != KUidMsvMessageEntry)
+		{
+		childIsMHTML = iEmailEntry->MHTMLEmail() ? ETrue:EFalse;
+		}
+	//Make the parent entry the current entry 
+	if(iEmailEntry)
+		{
+		delete iEmailEntry;
+		iEmailEntry=NULL;
+		}
+	iEmailEntry = new (ELeave) TMsvEmailEntry(iClientEntry->Entry());
+
+	if (!iParent->Count())
+		{
+		TParentDetails parentDetails;
+		iParent->InsertL(0,parentDetails);
+		}
+
+	if (! iParent->At(0).iAttachment)
+		{
+		iParent->At(0).iAttachment=(childIsAttachment && allowAttachmentFlag)? ETrue:EFalse;
+
+		// if we aren't allowing attachments because of the folder type
+		// remember there where attachments and check at the end whether
+		// it was an MHTML message or not.
+		if(childIsAttachment && !allowAttachmentFlag)
+			{
+			iRelatedAttachments=ETrue;
+			}
+		}
+	if (!iParent->At(0).iMHTML)
+		{
+		iParent->At(0).iMHTML = childIsMHTML ? ETrue:EFalse;
+		}
+	iParent->At(0).iSize += iEntryDataSize;
+
+	iOutputHeader->Reset();
+	iEmptyHeaderSize=iOutputHeader->DataSize();
+	iMimeParser->ResetForNewEntry();
+
+	iEntryDataSize=0;
+
+	RECVLOG(KMovedToParentEntry)
+	}
+
+
+/**
+CreateEntryL()
+Creates a new entry.
+*/
+void CImCltRecvConvert::CreateEntryL()
+	{
+	RECVLOG(KCreatingEntry);
+	if(NULL!=iEmailEntry)
+		{
+		delete iEmailEntry;
+		iEmailEntry=NULL;
+		}
+
+	if (iCurrentMultipartFolderEntryId)
+		{
+		iClientEntry->SetEntryL(iCurrentMultipartFolderEntryId);
+		iCurrentMultipartFolderEntryId=0;
+		}
+		
+	iEmailEntry = new (ELeave) TMsvEmailEntry;
+
+	TValidEntryType previousEntryType = iEntryType;
+	if ((iTopMessagePart==KMsvRootIndexEntryId) || iMIMEPart_822Header)
+		{
+		// At the main header, want to create a message entry.
+		// The stored iEntryType will indicate ( from header info) the next entry to be created.
+		// Save temporarily.
+		// Also applies to the special case where a message contains ony 1 embedded message.
+
+		previousEntryType=iEntryType;
+		iEntryType=EMessageEntry;
+		}
+
+	if ((iPopulateMessage) && (iTopMessagePart==KMsvRootIndexEntryId))
+	// If this is the root of a message that is being populated then do not create it.
+		{
+		iClientEntry->SetEntryL(iRootEntryId);
+		*iEmailEntry = iClientEntry->Entry();
+		iTopMessagePart=iRootEntryId;
+
+		// Delete all the children of the message entry.  This is needed because if the
+		// message has been purged, the entries will still exist.  When the message is populated,
+		// new entries are created.  If the original entries are not removed, then duplicate 
+		// entries will exist.
+		CMsvEntrySelection*	children = iClientEntry->ChildrenL();
+		CleanupStack::PushL(children);
+		if (children->Count())
+		{
+		TMsvLocalOperationProgress prog;
+		iClientEntry->DeleteL(*children,prog);
+		}
+		CleanupStack::PopAndDestroy(children);
+		}
+	else
+		{
+		iEmailEntry->iMtm=iNewMsgType;
+		iEmailEntry->iServiceId = iEmailServiceId;
+		iEmailEntry->SetComplete(EFalse);
+		iEmailEntry->iSize = 0;
+		iEmailEntry->SetVisible(ETrue);
+		iEmailEntry->SetInPreparation(EFalse);
+		iEmailEntry->SetReceipt(EFalse);
+
+		iEmailEntry->SetVCard(iMimeParser->VCard());
+		iEmailEntry->SetVCalendar(iMimeParser->VCalendar());
+		iEmailEntry->SetMessageFolderType(iMimeParser->MessageFolderType());
+		iEmailEntry->SetPriority(iImPriority);
+		iEmailEntry->SetNew(EFalse);
+
+		if(iOutputHeader->ReceiptAddress().Length()>0)
+			{
+			iEmailEntry->SetReceipt(ETrue);
+			}
+
+		iEmailEntry->iDate=iTimeDate;
+		switch(iEntryType)
+			{
+			case EMessageEntry:
+				if(iTopMessagePart==KMsvRootIndexEntryId)
+					{
+					iEmailEntry->SetUnread(ETrue);
+					iEmailEntry->SetNew(ETrue);
+					iEmailEntry->SetVisible(EFalse);
+					iEmailEntry->SetInPreparation(ETrue);
+					iEmailEntry->SetSendingState(KMsvSendStateNotApplicable);
+					}
+				else
+					{
+					TParentDetails parentDetails;
+					parentDetails.iMHTML=EFalse;
+			        parentDetails.iAttachment=EFalse;
+					parentDetails.iSize=0;
+					iParent->InsertL(0,parentDetails);
+					}
+				iEmailEntry->iType=KUidMsvMessageEntry;
+				iEmailEntry->iDetails.Set(iOutputHeader->From());
+				iEmailEntry->iDescription.Set(iOutputHeader->Subject());
+				break;
+			case EFolderEntry:
+				iEmailEntry->iType=KUidMsvFolderEntry;
+				if (iMimeParser->MessageFolderType()==EFolderTypeUnknown)
+					{
+					// Get folder type of parent (the message)
+					TMsvEmailEntry entry=iClientEntry->Entry();
+					iEmailEntry->SetMessageFolderType(entry.MessageFolderType());
+					}
+				break;
+			case EAttachmentEntry:
+				iEmailEntry->iType=KUidMsvAttachmentEntry;
+				iEmailEntry->iDetails.Set(iAttachmentName);
+				iEmailEntry->iDescription.Set(iMimeParser->ContentDescription());
+				break; 
+			case ETextEntry:
+				if ( iMimeParser->ContentDisposition()!=KImcvAttachment)
+					iEmailEntry->iType=KUidMsvEmailTextEntry;
+				else 
+					{
+					iEmailEntry->iType=KUidMsvAttachmentEntry;
+					iEmailEntry->iDetails.Set(iAttachmentName);
+					iEmailEntry->iDescription.Set(iMimeParser->ContentDescription());
+					}
+				break;
+			case EHtmlEntry:
+				iEmailEntry->iType=KUidMsvEmailHtmlEntry;
+				// If disposition not set or is inline..
+				if ( iMimeParser->ContentDisposition()==KImcvAttachment)
+					iEmailEntry->iType=KUidMsvAttachmentEntry;
+				else
+					iEmailEntry->SetMHTMLEmail(ETrue);
+				iEmailEntry->iDetails.Set(iAttachmentName);
+				iEmailEntry->iDescription.Set(iMimeParser->ContentDescription());
+				break;
+			default:
+				iEmailEntry->iType=KUidMsvAttachmentEntry;
+				iEmailEntry->iDetails.Set(iAttachmentName);
+				iEmailEntry->iDescription.Set(iMimeParser->ContentDescription());
+			}
+
+		iClientEntry->CreateL(*iEmailEntry);
+		iEmailEntry->iServiceId = iEmailServiceId;
+		iClientEntry->SetEntryL(iEmailEntry->Id());
+		if(iTopMessagePart==KMsvRootIndexEntryId)
+			{
+			iTopMessagePart=iEmailEntry->Id();
+			}
+		}
+
+	iEntryType=previousEntryType;
+	iNewEntry = ETrue;
+	RECVLOG(KCreatedEntry);
+	}
+
+
+/**
+StoreMessageEntryDetailsL()
+Stores the details of a message entry.
+*/
+void CImCltRecvConvert::StoreMessageEntryDetailsL()
+	{
+	iEmailEntry->SetAttachment(iParent->At(0).iAttachment);
+	iEmailEntry->SetMHTMLEmail(iParent->At(0).iMHTML);
+
+	if(iEmailEntry->MHTMLEmail() == EFalse && iEmailEntry->Attachment() == EFalse && iRelatedAttachments !=EFalse)
+		{
+		iEmailEntry->SetAttachment(ETrue);
+		}
+	iRelatedAttachments=EFalse;
+	
+	iEmailEntry->iSize=iParent->At(0).iSize;
+	iEmailEntry->SetMessageFolderType(iParent->At(0).iFolder);
+	StoreEntryDataL();
+
+	if (iParent->Count()>1)
+		{
+		iParent->At(1).iSize+=iEmailEntry->iSize;
+		iParent->Delete(0);
+		}
+	else
+		{
+		iParent->At(0).iAttachment=iParent->At(0).iMHTML=EFalse;
+		iParent->At(0).iSize=0;
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/src/Local_imcvrecv.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,4020 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+*/
+
+
+// epoc include
+#include <e32base.h>
+#include <imutdll.h>
+#include <imcvtext.h>
+#include "Local_imcvrecv.h"
+#include <imcvcodc.h>	// TImConvert
+#include <imcvutil.h>
+
+#include <miuthdr.h>	// CImHeader
+#include <miutatch.h>	// TImAttachmentFile
+#include <txtrich.h>
+#include <imcm.rsg>		// resource definition for IMCM
+
+#include <pop3set.h>	// For including KUidMsgTypePOP3
+#include <barsread.h>	// TResourceReader
+
+#include <cmsvbodytext.h>
+
+#ifdef __WINS__
+#include <e32wins.h>    // for maxfilename lengths
+#include <msvapi.h>
+#endif
+
+#ifndef __WINS__
+#include <msvapi.h>
+#endif
+#include <cmsvattachment.h> 
+#include <mmsvattachmentmanager.h>
+#include <mmsvattachmentmanagersync.h>
+#ifndef _MSG_NO_LOGGING
+#define __IMUT_LOGGING
+
+
+// literals used
+_LIT(KLogFilePath, "c:\\logs\\mailtext\\in.txt");
+_LIT8(KNewLogHeader, "\r\n------ New Receive Session ------\r\n");
+_LIT8(KFound, "found: ");
+_LIT8(KPartLine, "unknown or part line");
+_LIT8(KEndOFHeader, "End of header");
+_LIT8(KSkippingData, "Skipping data");
+_LIT8(KCollectingData7, "Collecting 7/8-bit data");
+_LIT8(KCollectingDataQP, "Collecting QP data");
+_LIT8(KCollectingBase64, "Collecting BASE64 data");
+_LIT8(KCollectingUU, "Collecting UU data");
+_LIT8(KDecodingBase64, "Decoding BASE64 data");
+_LIT8(KDecodedBase64, "Decoded BASE64 data");
+_LIT8(KDecodingUU, "Decoding UU data");
+_LIT8(KDecodedUU, "Decoded UU data");
+_LIT8(KDecodingQP, "Decoding QP data");
+_LIT8(KDecodedQP, "Decoded QP data");
+_LIT8(KUUEDataCorrupt, "UU Data is corrupt");
+_LIT8(KFoundUUEStartBoundary, "UUE start boundary");
+_LIT8(KFoundUUEEndBoundary, "UUE end boundary");
+_LIT8(KClosingAttachFile, "Closing attachment file");
+_LIT8(KDeletingAttachFile, "Deleting attachment file");
+_LIT8(KDeletedAttachFile, "Deleted attachment file");
+_LIT8(KFailedToWriteToFile, "Failed to write to attachment file");
+_LIT8(KSectionHeader, "Section header");
+_LIT8(KFoundMIMEBoundary, "MIME boundary");
+_LIT8(KWritingToBody, "writing body");
+_LIT8(KWroteToBody, "wrote body");
+_LIT8(KWritingToFile, "writing attachment");
+_LIT8(KWroteToFile, "wrote attachment");
+_LIT8(KReset, "Resetting CLocalImRecvConvert");
+_LIT8(KReseted, "Resetting CLocalImRecvConvert");
+_LIT8(KDeleted, "Deleting CLocalImRecvConvert");
+_LIT8(KLineHasLineBreak, "Linebreak");
+_LIT8(KLastToken, "That was the last token");
+_LIT8(KBlankLine, "Blank line");
+_LIT8(KRemoveBoundary, "Remove boundary");
+_LIT8(KRemovedBoundary, "Removed boundary");
+_LIT8(KResetForNewEntry, "Reset for a New Entry");
+_LIT8(KResetedForNewEntry, "Reseted for a New Entry");
+_LIT8(KResetForNonMimeEntry, "Reset for a New Non-Mime Entry");
+_LIT8(KResetedForNonMimeEntry, "Reseted for a New Non-Mime Entry");
+_LIT8(KCreatingEntry, "Creating Entry");
+_LIT8(KCreatedEntry, "Created Entry");
+_LIT8(KUpdatingEntry, "Updating Entry");
+_LIT8(KUpdatedEntry, "Updated Entry");
+_LIT8(KMoveToParentEntry, "Moved to parent entry");
+_LIT8(KMovedToParentEntry, "End of Moved to parent entry");
+_LIT8(KStoringHeader, "Storing CImHeader");
+_LIT8(KStoredHeader, "Stored CImHeader");
+_LIT8(KStoringBody, "Storing CRichText");
+_LIT8(KStoring8BitBody, "Storing CMsvBodyText");
+_LIT8(KStoredBody, "Stored CRichText");
+_LIT8(KStored8BitBody, "Stored CMsvBodyText");
+_LIT8(KStoringMIMEHeader, "Storing CImMimeHeader");
+_LIT8(KStoredMIMEHeader, "Stored CImMimeHeader");
+_LIT8(KIgnoringStreams, "Discarding streams");
+_LIT8(KStartMessageComplete, "Start Message Complete");
+_LIT8(KMessageComplete, "Message Complete");
+_LIT8(KHeaderComplete, "Message Header complete");
+_LIT8(KReturnReceiptTo, "return-receipt-To is set");
+_LIT8(KStartStoringEntryStream, "Starting Storing Entry Stream");
+_LIT8(KStoringEntryStream, "Storing Entry Stream");
+_LIT8(KDoneStoringEntryStream, "Done Storing Entry Stream");
+#endif // _MSG_NO_LOGGING
+
+// uncomment the line below if logging is to be enabled
+
+#if defined(__IMUT_LOGGING)
+#define RECVLOG(text) (iImcvLog?iImcvLog->AppendComment(text):void(0));
+#define RECVLOG_OUT(text) (iImcvLog?iImcvLog->AppendOut(text):void(0));
+#define LOGGING(string1, string2) (Logging(string1, string2));
+#else
+#define RECVLOG(text) (void(0));
+#define RECVLOG_OUT(text) (void(0));
+#define LOGGING(string1, string2) (void(0));
+#endif
+
+#define UNUSED_VAR( var ) var = var  // fix for armv5 build warnings
+const TInt KBodyTextChunkSizeBytes = 512;
+
+_LIT(KIntegerKey,"%d");
+const TInt KSpaceToAddNumber=20;
+
+// added this to handle DRM files
+_LIT8(KTImcvDrm, "testagent.drm");
+
+
+/**
+IsIllegalChar()
+Checks if the character is illegal in EPOC32 file system
+
+@param aChar
+@return
+*/
+LOCAL_C TBool IsIllegalChar(const TUint aChar)
+	{
+	// EPOC32 filenames must not contain any of the following chars
+    return (aChar == '*' || aChar == '\\' || aChar == '<' || aChar == '>' ||
+			aChar == ':'  || aChar == '"' ||  aChar    == '/' || aChar == '|' ||
+			aChar < ' ' || aChar == '?');
+	}
+
+/**
+RemoveSurroundingCharacters()
+
+@param aLeft
+@param aRight
+@param aString
+*/
+LOCAL_C void RemoveSurroundingCharacters( const TUint8& aLeft, const TUint8& aRight, HBufC8& aString)
+	{
+	TPtr8 des = aString.Des();
+	TInt len  = des.Length();
+	
+	if( len > 2 && des[0] == aLeft && des[len - 1] == aRight )
+		{
+		TPtrC8 mid = des.Mid(1, len - 1);
+		des.Copy(mid);
+		des.SetLength(len - 2);
+		}
+	}
+
+
+//****************************************************************************************
+//              Class CLocalRfc822Token Functions
+//****************************************************************************************
+
+
+/**
+NewLC()
+Static factory constructor. Uses two phase 
+construction.
+
+@leave KErrNoMemory
+@return
+A pointer to the newly created CLocalRfc822Token object.
+*/
+CLocalRfc822Token* CLocalRfc822Token::NewLC()
+	{
+	CLocalRfc822Token* self = new (ELeave) CLocalRfc822Token;
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+
+
+/**
+ConstructL()
+
+*/
+void CLocalRfc822Token::ConstructL()
+	{
+	iOutputLine = HBufC8::NewL(KMaxIMailHeaderReadLineLength + 1);
+	Reset();
+	}
+
+
+/**
+CLocalRfc822Token()
+Constructor
+*/
+CLocalRfc822Token::CLocalRfc822Token()
+	{
+	__DECLARE_NAME(_S("CLocalRfc822Token"));
+	}
+
+
+/**
+~CLocalRfc822Token()
+Destructor
+*/
+CLocalRfc822Token::~CLocalRfc822Token()
+	{
+	delete iOutputLine;
+	iOutputLine=NULL;
+	}
+
+
+/**
+Reset()
+
+*/
+void CLocalRfc822Token::Reset()
+	{
+	iOutputLine->Des().FillZ();
+	iBufferedInput.SetLength(0);
+	iBufferedInput.FillZ();
+
+	iLastToken = EFalse;
+	iFirstLine = ETrue;
+	i822FieldsExist=EFalse;
+	}
+
+
+/**
+ParseNextLineL()
+
+@param aSourceLine
+*/
+void CLocalRfc822Token::ParseNextLineL(const TDesC8& aSourceLine)
+	{
+	TBool hitEof = EFalse;
+	TBool endOfField = EFalse;
+	// Always read one more packet than we need so we know we've read the entire field.
+
+	// Consequently, we need to check whether there is any buffered input from the
+	// previous rfc822 field:*******
+
+	if(iBufferedInput.Length())
+		{
+		// the buffered input is never more than a line of text...
+		*iOutputLine = iBufferedInput;
+		
+ 		iBufferedInput.FillZ();
+		iBufferedInput.SetLength(0);
+		}
+	iInputLine = aSourceLine;
+
+	// discard any LF character from the begining of the line (this is abit strange?)
+	while(iInputLine.Length() > 0 && (iInputLine[0] == KImcvLF || iInputLine[0] == KImcvCR))
+		iInputLine.Delete(0, 1);
+
+	// remove the CR at the end but only if there's stuff before it
+	while(iInputLine.Length() > 0 && (iInputLine[iInputLine.Length() - 1] == KImcvLF || iInputLine[iInputLine.Length() - 1] == KImcvCR))
+		iInputLine.Delete(iInputLine.Length() - 1, 1);
+
+	// if the newly read line is now empty, then don't read any more through this tokeniser
+	iLastToken = !iInputLine.Length();
+
+	// only bother with the rest of the parsing if there's any data left
+	if(iInputLine.Length() > 0 || iOutputLine->Length() > 0)
+		{
+		// check whether we're on the next field or still on the current one
+		if(!iFirstLine && iInputLine.Length() > 0 && iInputLine[0] != KImcvSP && iInputLine[0] != KImcvTab)
+			{
+			// we've read the first line of the next field
+			iBufferedInput = iInputLine;
+			endOfField = ETrue; // flag the fact that the current field is ready for parsing
+			}
+		else // the line belongs in the current field, but without any leading whitespace
+			{
+			// find the first non-whitespace character
+			const TUint8* ptr = iInputLine.Ptr();
+			while((*ptr == KImcvSP || *ptr == KImcvTab) && (ptr - iInputLine.Ptr() < iInputLine.Length())) ptr++;
+		
+			// make sure we're not about to exceed the buffer
+			if((iOutputLine->Length() + iInputLine.Length()) > iOutputLine->Des().MaxLength())
+				iOutputLine = iOutputLine->ReAlloc(iOutputLine->Length() + iInputLine.Length());
+
+			// now copy the remaining data into the buffer
+			iOutputLine->Des().Append(iInputLine.Right(iInputLine.Length() - (ptr - iInputLine.Ptr())));
+			}
+		}
+	else
+		hitEof = ETrue;		//this means that EEndOfHeader is set if a line of zero length is parsed - ie. (clean CRLF - CRLF) = 0.
+	iFirstLine = EFalse;
+
+	if(endOfField || iLastToken)
+		{ 
+		// only parse the input when we have a whole field, 
+		// or we just found the blank line that
+		// separates the body from the header
+		if(MatchAndRemoveL(KImcvFromPrompt))
+			iHeaderPart = EFrom;
+		else if(MatchAndRemoveL(KImcvReplyToPrompt))
+			iHeaderPart = EReplyTo;
+		else if(MatchAndRemoveL(KImcvToPrompt))
+			iHeaderPart = ETo;
+		else if(MatchAndRemoveL(KImcvCcPrompt))
+			iHeaderPart = ECc;
+		else if(MatchAndRemoveL(KImcvBccPrompt))
+			iHeaderPart = EBcc;
+		else if(MatchAndRemoveL(KImcvSubjectPrompt))
+			iHeaderPart = ESubject;
+		else if(MatchAndRemoveL(KImcvDatePrompt))
+			iHeaderPart = EDate;
+		else if(MatchAndRemoveL(KImcvMessageIdPrompt))
+			{
+			iHeaderPart = EMessageId;
+			RemoveSurroundingCharacters(KImcvLeftChevron, KImcvRightChevron, *iOutputLine);
+			}
+		else if (PriorityAndReceiptsMatchAndRemoveL(EPriority))
+			iHeaderPart=EPriority;
+		else if (PriorityAndReceiptsMatchAndRemoveL(EReturnReceiptTo))
+			iHeaderPart=EReturnReceiptTo;
+		else if(hitEof)
+			iHeaderPart = EEndOfHeader;
+		else
+			{
+			iHeaderPart = EUnknown;
+			iImRecvConvert->iMimeParser->ParseLineL(*iOutputLine);
+			}
+		}
+	else 
+		iHeaderPart = ENotFinished;
+	}
+
+
+/**
+PriorityAndReceiptsMatchAndRemoveL()
+
+@param aPriority
+*/
+TBool CLocalRfc822Token::PriorityAndReceiptsMatchAndRemoveL(THeaderPart aPriority)
+	{
+	CDesC8Array* fields=new (ELeave)CDesC8ArrayFlat(6);
+	CleanupStack::PushL(fields);
+	if (aPriority==EPriority)
+		CImcvUtils::PriorityFieldsL(*fields);
+	else if (aPriority==EReturnReceiptTo)
+		CImcvUtils::ReceiptFieldsL(*fields);
+	else
+		{
+		CleanupStack::PopAndDestroy(); //fields
+		return EFalse;
+		}
+	TInt count=fields->Count();
+	TBool matched=EFalse;
+	for (TInt i=0;i<count;i++)
+		{
+		if (MatchAndRemoveL((*fields)[i]))
+			{
+			matched=ETrue;
+			break;
+			}
+		}
+	CleanupStack::PopAndDestroy(); //fields
+	return matched;
+	}
+
+
+/**
+MatchAndRemoveL()
+
+@param aString
+@return
+TBool
+*/
+TBool CLocalRfc822Token::MatchAndRemoveL(const TDesC8& aString)
+	{
+	TInt comparison;
+	TInt stringLength = aString.Length();
+	TInt desLength = (*iOutputLine).Length();
+	TInt compareLength = stringLength > desLength ? desLength : stringLength;
+	TPtrC8 left((*iOutputLine).Left(compareLength));
+	
+	// now see whether the current line contains the search string
+	comparison = left.CompareF(aString);
+	if(!comparison)
+		{
+		// found the match string at the start of the output line, so remove it
+		// get rid of any whitespace betweebn the tag and the data while we have a chance
+		if (!i822FieldsExist)
+			i822FieldsExist=ETrue;
+		TInt whitespaceLength=0;
+		TInt maxLength=desLength-stringLength;
+		const TUint8* ptr = (*iOutputLine).Ptr();
+		while(whitespaceLength <= maxLength && (ptr[stringLength+whitespaceLength] == KImcvSP || ptr[stringLength+whitespaceLength] == KImcvTab))
+			whitespaceLength++;
+		(iOutputLine->Des()).Delete(0, stringLength+whitespaceLength);
+		}
+	return (comparison==0);
+	}
+
+//****************************************************************************************
+//             Class CLocalImRecvConvert
+//****************************************************************************************
+
+
+/**
+NewLC()
+Static factory constructor. Uses two phase construction 
+and pushes the newly created object into the Cleanup stack.
+
+@param anFs
+@param aServerEntry
+@param aMsgType
+@param aEmailServiceId
+@leave KErrNoMemory
+@return
+A pointer to the newly created CLocalImRecvConvert object.
+*/
+CLocalImRecvConvert* CLocalImRecvConvert::NewLC(RFs& anFs, CMsvServerEntry* aServerEntry, 
+												TUid aMsgType, TMsvId aEmailServiceId)
+	{
+	CLocalImRecvConvert* self = new (ELeave) CLocalImRecvConvert(anFs, aServerEntry, aMsgType, 
+																		aEmailServiceId);
+	CleanupStack::PushL(self);
+	self->ConstructL(anFs);
+	return self;
+	}
+
+
+/**
+NewL()
+Static factory constructor. Uses two phase 
+construction.
+
+@param anFs
+@param aServerEntry
+@param aMsgType
+@param aEmailServiceId
+@leave KErrNoMemory
+@return
+A pointer to the newly created CLocalImRecvConvert object.
+*/
+CLocalImRecvConvert* CLocalImRecvConvert::NewL(RFs& anFs, CMsvServerEntry* aServerEntry, 
+												TUid aMsgType, TMsvId aEmailServiceId)
+	{
+	CLocalImRecvConvert* self = CLocalImRecvConvert::NewLC(anFs, aServerEntry, aMsgType, 
+																aEmailServiceId);
+	CleanupStack::Pop();
+	return self;
+	}
+
+  
+/**
+ConstructL()
+
+@param anFs
+*/
+void CLocalImRecvConvert::ConstructL(RFs& anFs)
+	{
+	iFsSession = &anFs;  
+
+	RResourceFile resFile;
+	OpenResourceFileL(resFile, anFs);	// NB leaves if file not found
+
+	// make sure the resource file will be closed if anything goes wrong
+	// CloseResourceFile is declared in IMUTDLL.H and defined in IMUTDLL.CPP
+	TCleanupItem close( CloseResourceFile, &resFile );
+	CleanupStack::PushL( close );
+	
+	// Read iStore8BitData flag.
+	HBufC8* buf = resFile.AllocReadLC( STORE_8BIT_BODY_TEXT );
+	TResourceReader reader;
+	reader.SetBuffer(buf);
+	iStore8BitData = reader.ReadInt8();
+	CleanupStack::PopAndDestroy(buf);
+
+	buf = resFile.AllocReadLC( REMOVED_ATTACHMENT_TAG );
+	reader.SetBuffer(buf);
+	iRemovedAttachmentTag = reader.ReadTPtrC().AllocL();
+	CleanupStack::PopAndDestroy(buf);
+	
+	buf = resFile.AllocReadLC( DEFAULT_ATTACHMENT_NAME );
+	reader.SetBuffer(buf);
+	iDefaultAttachmentName = reader.ReadTPtrC().AllocL();
+	CleanupStack::PopAndDestroy(buf);
+	buf = resFile.AllocReadLC(PARTIAL_DOWNLOAD_FOOTER_MESSAGE);
+	reader.SetBuffer(buf);
+	iPartialEmailFooter = (reader.ReadTPtrC()).AllocL();
+	CleanupStack::PopAndDestroy(buf);
+	buf = NULL;
+	CleanupStack::PopAndDestroy(&resFile); // resFile (Close resfile)
+
+	// create CImHeader object to store Rfc822 header info...
+	iOutputHeader = CImHeader::NewLC();	// PushL(iHeader)
+	CleanupStack::Pop();				// iHeader
+
+	if (iStore8BitData)
+		{
+		//Create body text storage helper.
+		iBodyText = CMsvBodyText::NewL();
+		}
+	else
+		{
+		// create CRichText object to store body...
+		iParaLayer = CParaFormatLayer::NewL();
+		iCharLayer = CCharFormatLayer::NewL();
+		iOutputBody = CRichText::NewL(iParaLayer, iCharLayer);
+		}
+	
+	// Create Rfc822 filter object...
+	iRfc822Token = CLocalRfc822Token::NewLC(); // PushL(iRfc822Token)
+	CleanupStack::Pop();				  // iRfc822Token
+	iRfc822Token->SetImRecvConvert(this);
+
+	// Create converter objects...
+	iCharacterConverter = CCnvCharacterSetConverter::NewL();
+	iCharConv = CImConvertCharconv::NewL(*iCharacterConverter, anFs);
+	iHeaderConverter = CImConvertHeader::NewL(*iCharConv); 
+
+	
+	// Create MIME filter object...
+	iMimeParser = CLocalMimeParser::NewL(*this);
+	
+	
+	// logfile stuff
+	iImcvLog=NULL;
+
+#ifdef __IMUT_LOGGING	
+	TRAPD(err,iImcvLog=CImLog::NewL(KLogFilePath, EAppend));
+	UNUSED_VAR( err );
+#endif
+
+	iRootEntryId = EntryId();
+
+	iNotFinishedRfc822Header = ETrue;
+	
+	iEmailEntry = new (ELeave) TMsvEmailEntry;
+	iReceivingHeadersOnly=EFalse;	
+
+	iParent = new (ELeave) CArrayFixFlat<TParentDetails>(3);
+
+	iFirstBoundaryReached=EFalse;
+
+	ResetL();
+	
+	RECVLOG( KNewLogHeader )
+	}
+
+
+/**
+CLocalImRecvConvert()
+
+@param anFs
+@param aServerEntry
+@param aMsgType
+@param aEmailServiceId
+*/
+CLocalImRecvConvert::CLocalImRecvConvert(RFs& anFs, CMsvServerEntry* aServerEntry, 
+							   TUid aMsgType, TMsvId aEmailServiceId)
+				: iServerEntry(aServerEntry), iNewMsgType(aMsgType), iDefaultEntryType(ETextEntry), 
+			  	  iEmailServiceId(aEmailServiceId), iAttachmentFile(anFs)
+	{
+	__DECLARE_NAME(_S("CLocalImRecvConvert"));
+	}
+
+  
+/**
+~CLocalImRecvConvert()
+Destructor
+*/
+CLocalImRecvConvert::~CLocalImRecvConvert()
+	{
+	delete iEmailEntry;
+	iEmailEntry=NULL;
+	delete iOutputHeader;
+	iOutputHeader=NULL;
+	delete iBodyText;
+	iBodyText=NULL;
+	delete iBodyBuf;
+	iBodyBuf=NULL;
+	delete iParaLayer;
+	iParaLayer=NULL;
+	delete iCharLayer;
+	iCharLayer=NULL;
+	delete iOutputBody;
+	iOutputBody=NULL;
+	delete iRemovedAttachmentTag;
+	iRemovedAttachmentTag=NULL;
+	delete iDefaultAttachmentName;
+	iDefaultAttachmentName=NULL;
+	delete iRfc822Token;
+	iRfc822Token=NULL;
+	delete iMimeParser;
+	iMimeParser=NULL;
+	delete iHeaderConverter;
+	iHeaderConverter=NULL;
+	delete iCharConv;
+	iCharConv=NULL;
+	delete iCharacterConverter;
+	iCharacterConverter=NULL;
+	delete iAttachmentFullPath;
+	iAttachmentFullPath=NULL;
+	delete iImcvUtils;
+	iImcvUtils=NULL;
+	delete iParent;
+	iParent=NULL;
+	RECVLOG(KDeleted)
+	delete iImcvLog;
+	iImcvLog=NULL;
+	delete iPartialEmailFooter;
+	iPartialEmailFooter=NULL;
+	}
+
+
+/**
+ResetForHeadersL()
+This function is used in preference to ResetL() when the owner
+only wishes to create  email entries in the remote mailbox - 
+they do not wish to create any stores associated with the message
+entry
+
+*/
+void CLocalImRecvConvert::ResetForHeadersL()
+	{
+	ResetL();
+	iReceivingHeadersOnly=ETrue;
+	}
+
+/**
+ResetL()
+
+*/
+void CLocalImRecvConvert::ResetL()
+	{
+	RECVLOG(KReset) 
+	iBodyId=KMsvNullIndexEntryId;
+	iSizeOfAttachmentsRemoved=0;
+
+	User::LeaveIfError(iServerEntry->SetEntry(iRootEntryId));
+	
+	iReceivingHeadersOnly=EFalse;
+	iMessageEntryCalled=EFalse;
+	iLeaveError=KErrNone; 		
+	iCurrentMultipartFolderEntryId=0;
+
+	TParentDetails parent;
+	parent.iAttachment=parent.iMHTML=EFalse;
+	parent.iSize=0;
+	iParent->InsertL(0,parent);
+
+	delete iEmailEntry;
+	iEmailEntry=NULL;
+	iEmailEntry = new (ELeave) TMsvEmailEntry;
+
+	// "iSavingAttachments" commands this code to store attachments in files.
+	// Currently this is always set to ETrue as we intend to save all attachments
+	// However, if the user wishes to discard (ie do not save) any 
+	// attachments in incoming email messages - then this member variable
+	// may be set to EFalse by the inline accessor function "SaveAllAttachments(TBool)"
+	iSavingAttachments=ETrue;
+	iAttachmentFileState=EFileIsClosed;
+
+	// iLeaveError contains the error value of any functions that leaves (ie CRichText::InsertL)
+	// or any returned error value that generates a leave from within CLocalImRecvConvert (ie RFile::Create)
+
+	iGlobalIndent=0;
+	iLongestLine=50;
+	
+	iImPriority=EMsvMediumPriority;
+	delete iImcvUtils;
+	iImcvUtils=NULL;
+	iImcvUtils=CImcvUtils::NewL();
+
+	// reset internal date
+	iTimeDate.HomeTime();
+	
+	iMimeParser->Reset();
+	
+	iNewEntry=EFalse; //EFalse if the entry was moved to. ETrue if the entry was just created
+	iTopMessagePart=KMsvNullIndexEntryId; //A value of NULL indicates the next entry created is a main message entry
+	ResetForNewEntryL(iDefaultEntryType);
+	iMIMEPart_822Header = EFalse;
+	iPartialEmail=EFalse;
+
+	RECVLOG(KReseted) 
+	}
+
+
+/**
+ResetForNewEntryL()
+
+@param entryType
+*/
+void CLocalImRecvConvert::ResetForNewEntryL(TValidEntryType entryType)
+	{
+	RECVLOG(KResetForNewEntry) 
+
+	iFinishedHeader = EFalse;
+
+	iPreviousLineLength = 0;
+	iPreviousTrailingWhitespace = 0;
+	iLastChar = 0;
+
+	// Reset the new entry state
+	ResetForNonMimeEntryL();
+
+	// Clear the storage classes
+	iMimeParser->ResetForNewEntry();
+	iRfc822Token->Reset();
+
+	iEmailPart = KNoPart;
+	iEntryType=entryType;
+
+	if (iEntryType==EMessageEntry)
+		{
+		iEmailPart = KParentPart;
+		iMimeParser->SetMessageFolderType(EFolderTypeRFC822);
+		}
+	}
+
+
+/**
+ResetForNonMimeEntryL()
+
+*/
+void CLocalImRecvConvert::ResetForNonMimeEntryL()
+	{
+	iEntryType = ETextEntry;
+	RECVLOG(KResetForNonMimeEntry) 
+
+	iSkipData = EFalse;
+	iPrepared = EFalse;
+	iNewNonMIMEBodyPart=ETrue;
+	iEncounteredLineEndingInCarriageReturn=EFalse;
+
+	iAlgorithm = ENoAlgorithm;
+	iCurrentPartIsRichText = ETrue;	
+	CloseAttachmentFileL();
+	iEntryDataSize = 0;
+	
+	if (iStore8BitData)
+		{
+		//Create a buffer to hold the body text as it is down loaded.
+		delete iBodyBuf;
+		iBodyBuf = NULL;
+		iBodyBuf = CBufSeg::NewL(KBodyTextChunkSizeBytes);
+		}
+	else
+		{
+		iOutputBody->Reset();
+		}
+	
+	iAttachmentName.Zero();
+	iFinalLine = EFalse;
+
+	iOutputHeader->Reset();
+	iEmptyHeaderSize=iOutputHeader->DataSize();
+	RECVLOG(KResetedForNonMimeEntry) 
+	}
+
+
+/**
+ParseNextField()
+
+@param aSourceLine
+*/
+TInt CLocalImRecvConvert::ParseNextField(const TDesC8& aSourceLine) 
+	{
+	__ASSERT_DEBUG(iRootEntryId!=KMsvNullIndexEntryId, gPanic(KPanicServiceIdNotValid));
+	RECVLOG_OUT(aSourceLine);
+
+	// If we are temporarily on the null entry then move back to the entry we are working on
+	if ((iLeaveError == KErrNone) && (iServerEntry->Entry().Id() == KMsvNullIndexEntryId))
+		iLeaveError = iServerEntry->SetEntry(iSavedEntryId);
+
+	if(iLeaveError==KErrNone)
+		TRAP(iLeaveError, ParseNextLineL(aSourceLine));		
+
+	// Save the current entry id for later.
+	if (iLeaveError==KErrNone)
+		iSavedEntryId = iServerEntry->Entry().Id();
+
+	TUid type = iServerEntry->Entry().iType;
+	if( type != KUidMsvMessageEntry    &&
+		type != KUidMsvEmailTextEntry  &&
+		type != KUidMsvEmailHtmlEntry  &&
+		type != KUidMsvAttachmentEntry)
+		{
+	// Set the current id to null so that we aren't locking any folders
+	iServerEntry->SetEntry(KMsvNullIndexEntryId);
+		}
+
+	return iLeaveError;
+	}
+
+
+/**
+ParseNextLineL()
+
+@param aSourceLine
+*/
+void CLocalImRecvConvert::ParseNextLineL(const TDesC8& aSourceLine)
+	{
+	iParsedMimeBoundaryLast=0;
+	if(!iFinishedHeader)
+		{
+		// start by getting the next token from the header
+		iRfc822Token->ParseNextLineL(aSourceLine);
+
+		switch(iRfc822Token->iHeaderPart)
+			{
+			case CLocalRfc822Token::EUnknown:
+			case CLocalRfc822Token::ENotFinished:
+				RECVLOG(KPartLine)
+				break;
+			case CLocalRfc822Token::EFrom:
+				iOutputHeader->SetFromL(*iRfc822Token->OutputLine());
+				LOGGING(KFound,KImcvFromPrompt);
+				break;
+			case CLocalRfc822Token::EReplyTo:
+				iOutputHeader->SetReplyToL(*iRfc822Token->OutputLine());
+				LOGGING(KFound,KImcvReplyToPrompt);
+				break;
+			case CLocalRfc822Token::ETo:
+				ParseRecipientListL(iOutputHeader->ToRecipients());
+				LOGGING(KFound,KImcvToPrompt);
+				break;
+			case CLocalRfc822Token::ECc: 
+				ParseRecipientListL(iOutputHeader->CcRecipients());
+				LOGGING(KFound,KImcvCcPrompt);
+				break;
+			case CLocalRfc822Token::EBcc: 
+				ParseRecipientListL(iOutputHeader->BccRecipients());
+				LOGGING(KFound,KImcvBccPrompt);
+				break;
+			case CLocalRfc822Token::ESubject:
+				iOutputHeader->SetSubjectL(*iRfc822Token->OutputLine());
+				LOGGING(KFound,KImcvSubjectPrompt);
+				break;
+			case CLocalRfc822Token::EDate:
+				iRfc822Date.ParseDateField(*iRfc822Token->OutputLine() , iTimeDate); 
+				if (iEmailEntry->Id() != iTopMessagePart)
+					{
+					iEmailEntry->iDate = iTimeDate;
+					}
+				LOGGING(KFound,KImcvDatePrompt);
+				break;
+			case CLocalRfc822Token::EMessageId:
+				iOutputHeader->SetImMsgIdL(*iRfc822Token->OutputLine());
+				LOGGING(KFound,KImcvMessageIdPrompt);
+				break;
+			case CLocalRfc822Token::EPriority:
+				iImPriority=iImcvUtils->EvaluatePriorityText(*iRfc822Token->OutputLine());
+				LOGGING(KFound,KImcvPriorityPrompt);
+				break;
+			case CLocalRfc822Token::EReturnReceiptTo:
+				iOutputHeader->SetReceiptAddressL(*iRfc822Token->OutputLine());
+				LOGGING(KFound,KReturnReceiptTo);
+				break;
+			case CLocalRfc822Token::EEndOfHeader:
+				// the next line goes in the body part
+				iFinishedHeader = ETrue;
+				RECVLOG(KEndOFHeader)
+				break;
+			default:
+				RECVLOG(KEndOFHeader)
+				break;
+			}
+
+
+		if(iRfc822Token->iHeaderPart != CLocalRfc822Token::ENotFinished)
+			{
+			// Now that we've used the data, we also need to clear the output line from the tokeniser....
+			iRfc822Token->OutputLine()->Des() = KNullDesC8;
+
+			// whatever part we just read, we may also have read the empty line that separates
+			// the header from the body
+			if((iFinishedHeader = iRfc822Token->LastToken()) != EFalse)	//iFinishedHeader set to 1 on CRLF-
+				{
+				RECVLOG(KLastToken);
+				iNotFinishedRfc822Header = EFalse;
+
+				iHeaderConverter->SetMessageType(iMimeParser->MessageIsMime());
+				iHeaderConverter->DecodeAllHeaderFieldsL(*iOutputHeader);
+
+				if (iMimeParser->MessageIsMime())
+					EndOfHeaderMIMEProcessingL();
+				else
+					EndOfHeaderProcessingL();
+
+				if (iStore8BitData)
+					{
+					iBodyText->SetDefaultCharacterSet(iCharConv->SystemDefaultCharset());
+					if ( iMimeParser->MessageIsMime() && iMimeParser->ContentType()==EMimeText )
+						iBodyText->SetCharacterSet(iMimeParser->CurrentCharsetL());
+					else
+						iBodyText->SetCharacterSet(0);
+					}
+				else
+					{
+					// Get charset for decoding.
+					if ( iMimeParser->MessageIsMime() && iMimeParser->ContentType()==EMimeText )
+						iCharConv->PrepareToConvertToFromOurCharsetL(iMimeParser->CurrentCharsetL());
+					else
+						iCharConv->PrepareToConvertToFromOurCharsetL(iCharConv->SystemDefaultCharset());
+					}
+				}
+			}
+		}
+	else if (iReceivingHeadersOnly == EFalse)
+		{	
+		//Set to EFalse when a single line is to be skipped (ie boundary line)
+		iCommitLine=ETrue; 
+
+		// read one line of the message body if I am processing a whole email message
+		if(iMimeParser->MessageIsMime())
+			ParseMimeLineL(aSourceLine);
+		else
+			ParseBodyLineL(aSourceLine);	
+
+		if((iCommitLine) && (!iSkipData))
+			DecodeAndStoreLineL(aSourceLine);
+		}
+	}
+
+
+/**
+MessageEntryDetailsL()
+
+@return
+*/
+TMsvEmailEntry CLocalImRecvConvert::MessageEntryDetailsL()
+	{
+	iMessageEntryCalled=ETrue;
+	CloseAttachmentFileL();
+
+	// A message requiring manual termination and not part way through a MIME part header
+	if( iTopMessagePart==EntryId() && iFinishedHeader) 
+		StoreEntryStreamsL(KStore822Header|KStoreMIMEHeader);
+	else
+		{
+		User::LeaveIfError(iServerEntry->SetEntry(iTopMessagePart));         
+		delete iEmailEntry;
+		iEmailEntry=NULL;
+		iEmailEntry = new (ELeave) TMsvEmailEntry(iServerEntry->Entry());
+		}
+		
+	return *iEmailEntry;
+	}
+
+
+/**
+MessageCompleteL()
+
+@param aEmailEntry
+*/
+void CLocalImRecvConvert::MessageCompleteL(TMsvEmailEntry aEmailEntry)
+	{
+	// Restore the entry context
+	if (iServerEntry->Entry().Id() == KMsvNullIndexEntryId)
+		User::LeaveIfError(iServerEntry->SetEntry(iSavedEntryId));
+
+	__ASSERT_DEBUG(iMessageEntryCalled, gPanic(KPanicMessageEntryNotCalled));
+	__ASSERT_DEBUG(aEmailEntry.Id()==iTopMessagePart, gPanic(KPanicMessageEntryIdHasChanged)); // Id should be set to iTopMessagePart
+
+	// Called ResetL() to reset object instead of ResetForHeadersL()
+	__ASSERT_DEBUG(iReceivingHeadersOnly, gPanic(KPanicIncorrectResetState)); 
+
+	if(iEmailEntry)
+		{
+		if (iEmailEntry->Id())
+			{
+			if(iLeaveError==KErrNone)
+				{
+				// a remote email header cannot have any attachments or be marked as complete...
+				aEmailEntry.SetAttachment(EFalse);
+				aEmailEntry.SetMHTMLEmail(EFalse);
+				aEmailEntry.SetComplete(EFalse);
+				User::LeaveIfError(iServerEntry->ChangeEntry(aEmailEntry));
+				RECVLOG(KHeaderComplete)
+				}
+			else
+				{
+				if (!iPopulateMessage)
+					{
+					TMsvId currentId = EntryId();
+					User::LeaveIfError(iServerEntry->SetEntry(iServerEntry->Entry().Parent()));			
+					User::LeaveIfError(iServerEntry->DeleteEntry(currentId));
+					}
+				User::Leave(iLeaveError);
+				}
+			}
+		}
+
+	// Save the entry context and move it to null so that we're not locking any folders
+	iSavedEntryId = iServerEntry->Entry().Id();
+	User::LeaveIfError(iServerEntry->SetEntry(KMsvNullIndexEntryId));
+	}
+
+
+/**
+MessageCompleteL()
+
+@param aPartialDownload
+*/
+void CLocalImRecvConvert::MessageCompleteL(TBool aPartialDownload)
+	{
+	iPartialEmail=aPartialDownload;
+	MessageCompleteL();
+	}
+  
+
+/**
+MessageCompleteL()
+*/
+void CLocalImRecvConvert::MessageCompleteL()
+	{
+	// Restore the entry context
+	RECVLOG(KStartMessageComplete)
+	if (iServerEntry->Entry().Id() == KMsvNullIndexEntryId)
+		User::LeaveIfError(iServerEntry->SetEntry(iSavedEntryId));
+
+	if (iParsedMimeBoundaryLast==EFalse && iAttachmentFileState==EFileIsOpen && iPartialEmail!=EFalse)
+		{
+		iAttachmentFileState=EFileTopIncomplete;
+		}
+
+	CloseAttachmentFileL();
+
+	if(!iEmailEntry->Id())
+		return;
+
+	if(iLeaveError!=KErrNone)
+		{
+		User::Leave(iLeaveError);
+		}
+
+	if (EntryId()!=iTopMessagePart)
+		{
+		iEmailEntry->SetComplete(ETrue);
+		StoreEntryStreamsL(KStoreBodyText);
+		MoveToParentEntryL();
+
+		if( iTopMessagePart==EntryId() && iFinishedHeader) 
+			{
+			iEmailEntry->SetVisible(ETrue);
+			iEmailEntry->SetInPreparation(EFalse);
+			iEmailEntry->SetBodyTextComplete(ETrue);
+			iEmailEntry->SetComplete(ETrue);
+
+			// Main message.
+			StoreMessageEntryDetailsL();
+			return;
+			}
+		else if(iEmailEntry->iType == KUidMsvMessageEntry)
+			{
+			StoreMessageEntryDetailsL();
+			MoveToParentEntryL();
+			StoreMessageEntryDetailsL();
+			}
+		}
+
+	// A message requiring manual termination and not part way through 
+	// a MIME part header.
+
+	User::LeaveIfError(iServerEntry->SetEntry(iTopMessagePart));         
+	if(NULL!=iEmailEntry)
+		{
+		delete iEmailEntry;
+		iEmailEntry=NULL;
+		}
+	iEmailEntry = new (ELeave) TMsvEmailEntry(iServerEntry->Entry());
+	iEmailEntry->SetVisible(ETrue);
+	iEmailEntry->SetInPreparation(EFalse);
+	iEmailEntry->SetComplete(ETrue);
+	iEmailEntry->SetBodyTextComplete(ETrue);
+
+	iEmailEntry->SetAttachment(iParent->At(0).iAttachment);
+	iEmailEntry->SetMHTMLEmail(iParent->At(0).iMHTML);
+
+	if(iEmailEntry->MHTMLEmail() == EFalse && iEmailEntry->Attachment() == EFalse && iRelatedAttachments !=EFalse)
+		{
+		iEmailEntry->SetAttachment(ETrue);
+		}
+	iRelatedAttachments=EFalse;
+	
+	iEmailEntry->iSize=iParent->At(0).iSize;
+	iEmailEntry->SetMessageFolderType(iParent->At(0).iFolder);
+
+	User::LeaveIfError(iServerEntry->ChangeEntry(*iEmailEntry));
+
+	// Save the entry context and move it to null so that we're not locking any folders
+	iSavedEntryId = iServerEntry->Entry().Id();
+	User::LeaveIfError(iServerEntry->SetEntry(KMsvNullIndexEntryId));
+	RECVLOG(KMessageComplete)
+	}
+
+
+/**
+PrepareDecoder()
+
+*/
+void CLocalImRecvConvert::PrepareDecoder()
+	{
+	switch(iMimeParser->ContentEncoding())
+		{
+		case EEncodingTypeNone:
+		case EEncodingType7Bit:
+		case EEncodingType8Bit:
+			iAlgorithm = ENoAlgorithm;
+			RECVLOG(KCollectingData7)
+			break;
+		case EEncodingTypeQP:
+			iAlgorithm = EQPDecode;
+			RECVLOG(KCollectingDataQP)
+			break;
+		case EEncodingTypeBASE64:
+			iAlgorithm = EBase64Decode;
+			RECVLOG(KCollectingBase64)
+			break;	
+		case EEncodingTypeUU:
+			iAlgorithm = EUUDecode;
+			RECVLOG(KCollectingUU)
+			break;	
+		default:	// EEncodingTypeUnknown, EEncodingTypeNone, EEncodingTypeBinary	
+			iAlgorithm = ENoAlgorithm;
+			break;
+		} // switch
+	iPrepared = ETrue;
+	}
+
+  
+/**
+DecodeAndStoreLineL()
+
+@param aSourceLine
+*/
+void CLocalImRecvConvert::DecodeAndStoreLineL(const TDesC8& aSourceLine)
+	{
+	TInt sourceLineLength=aSourceLine.Length();
+	TBool blankLine = EFalse;
+
+	// create a temporary buffer to write the decoded data into. 
+	// This will always be as long as or shorter than the original.
+	
+	HBufC8* convertedLine = HBufC8::NewLC(sourceLineLength+KConversionRemainderLength);
+	TPtr8 des(convertedLine->Des());
+
+	if(iFinalLine)						
+		{
+		// We've got to the end of encoded section, so set in order to skip all
+		// trailing empty lines & postamble until we reach the next MIME/UUE boundary
+
+		RECVLOG(KSkippingData)
+		iSkipData = ETrue;
+		}
+	else
+		{
+		switch(iAlgorithm)
+			{
+			case EBase64Decode:
+				RECVLOG(KDecodingBase64);
+
+				iB64Codec.Decode(aSourceLine, des); 
+				RECVLOG(KDecodedBase64);
+				break;
+			case EUUDecode:
+				RECVLOG(KDecodingUU);
+				//used to end a Mime encoded UU section else no purpose
+				iFinalLine=(aSourceLine.CompareF(KImcvUueLastLine)==0);	
+				if(iFinalLine)
+					iCommitLine=EFalse;
+				else
+					{
+					//returns True on invalid data
+					if((!iFinalLine)&&(iUUCodec.Decode(aSourceLine, des))) 
+						{
+						RECVLOG(KUUEDataCorrupt)
+						if(iAttachmentFileState==EFileIsOpen)
+							{
+							iAttachmentFileState=EFileIsCorrupt;
+							iLeaveError=KErrCorrupt;
+							CloseAttachmentFileL();
+							}
+						else
+							User::Leave(KErrCorrupt);
+						}
+					}
+				RECVLOG(KDecodedUU);
+				break;
+			case EQPDecode:
+				RECVLOG(KDecodingQP);
+				iQPCodec.Decode(aSourceLine, des);
+				RECVLOG(KDecodedQP);
+				break;
+			case ENoAlgorithm:
+				{				
+				// If the data is to be stored in CRichText clean it up before copying it to the buffer
+				TLex8 lex(aSourceLine);
+				blankLine=ETrue;
+				while(blankLine && !lex.Eos())
+					{
+					blankLine = (lex.Peek()==KImcvSP || lex.Peek()==KImcvTab 
+						|| lex.Peek()==KImcvCR || lex.Peek()==KImcvLF);
+					lex.Inc();
+					}
+				des.Copy(aSourceLine);
+				}				
+			default:
+				break;
+			} // end switch
+	
+			// Commits the decoded data to the appropriate store or trashes the line 
+			if(iCommitLine) 
+				{
+				if (iLeftOver.Length())
+					{
+					des.Insert(0, iLeftOver);
+					iLeftOver.SetLength(0);
+					}
+
+				if(iCurrentPartIsRichText)
+					{
+					if (iStore8BitData)
+						iBodyBuf->InsertL(iBodyBuf->Size(), des);
+					else
+						WriteToBodyL(des, blankLine);
+					}
+				else
+					WriteToAttachmentL(des);
+				}
+		} // end else
+
+	CleanupStack::PopAndDestroy(); // convertedLine
+	}
+
+
+/**
+ParseMimeLineL()
+
+@param aSourceLine
+*/
+void CLocalImRecvConvert::ParseMimeLineL(const TDesC8& aSourceLine)
+	{
+
+	if(!iMimeParser->IsBoundary(aSourceLine))
+		{
+		if(!iPrepared) // first line of the body
+			{		
+			if (iMIMEPart_822Header)
+				{
+				// missing 822 part header. Revert to default.
+				EndOfHeaderMIMEProcessingL();
+				iMIMEPart_822Header=EFalse;
+				}
+
+			PrepareDecoder();
+			}
+
+		if (CheckUUEStartL(aSourceLine))
+			{
+			iAlgorithm=EUUDecode;
+			iCommitLine=EFalse;
+			}
+		}
+	else
+		{
+		// found a MIME boundary so store the current parts data and update its entry.
+
+		RECVLOG(KFoundMIMEBoundary)
+		iCommitLine=EFalse; //Dont store this line as its a boundary.
+
+		if(!iFirstBoundaryReached && iEntryType==EFolderEntry)
+			{
+			iFirstBoundaryReached=ETrue;
+			if (!iCurrentMultipartFolderEntryId)
+				iCurrentMultipartFolderEntryId = EntryId();
+			MoveToParentEntryL();
+			ResetForNewEntryL(iDefaultEntryType);
+			return; // First boundary encountered.
+			}
+
+		CloseAttachmentFileL();
+		if(iNewEntry)
+			{
+			iEmailEntry->SetComplete(ETrue);
+			iEmailEntry->SetBodyTextComplete(ETrue);
+			StoreEntryStreamsL(KStoreMIMEHeader | KStoreBodyText);
+			if (iBodyId==KMsvNullIndexEntryId)
+				{
+				iBodyId=iEmailEntry->Id();
+				}
+			}
+
+		iSkipData = EFalse;
+
+		// check whether we just found the terminating boundary...
+		if(iMimeParser->IsTerminatingBoundary())
+			{
+			RECVLOG(KRemoveBoundary);
+			iMimeParser->RemoveBoundary();
+			RECVLOG(KRemovedBoundary);
+			iMIMEPart_822Header = EFalse;
+
+			if (EntryId()!=iTopMessagePart)
+				{
+				if(iEmailPart==KParentPart)
+					{
+					// rfc822 message which is not  not multipart.
+					iEmailPart=KNoPart;
+					MoveToParentEntryL();				
+
+					// Embedded message
+					iEmailEntry->SetComplete(ETrue);
+					iEmailEntry->SetBodyTextComplete(ETrue);
+					StoreMessageEntryDetailsL();
+					}
+				else if (iEmailEntry->iType==KUidMsvMessageEntry)
+					{
+					// Moving up from a multi embedded rfc822 message.
+					iEmailEntry->SetComplete(ETrue);
+					iEmailEntry->SetBodyTextComplete(ETrue);
+					StoreMessageEntryDetailsL();
+					}
+				}
+
+			MoveToParentEntryL();
+			iEntryDataSize = iEmailEntry->iSize;
+
+			if(iServerEntry->Entry().iType == KUidMsvFolderEntry)
+				{
+				iCurrentMultipartFolderEntryId = EntryId();
+				}
+			else if (EntryId()!=iTopMessagePart)
+				{
+				if(iEmailEntry->iType == KUidMsvMessageEntry)
+					{
+					iEmailEntry->SetComplete(ETrue);
+					iEmailEntry->SetBodyTextComplete(ETrue);
+					StoreMessageEntryDetailsL();
+					}
+				MoveToParentEntryL();
+				iEntryDataSize += iEmailEntry->iSize;
+				}
+
+			if(!iNewEntry)
+				ResetForNonMimeEntryL();
+
+			RECVLOG(KSkippingData)
+			iSkipData = ETrue;
+			iDefaultEntryType=ETextEntry;
+			}
+		else // if regular boundary
+			{ 
+			RECVLOG(KSectionHeader)
+			if(iEmailPart==KParentPart && EntryId()!=iTopMessagePart)
+				{
+				// rfc822 message which is not  not multipart.
+				iEmailPart=KNoPart;
+				MoveToParentEntryL();
+				// Embedded message
+				iEmailEntry->SetComplete(ETrue);
+				iEmailEntry->SetBodyTextComplete(ETrue);
+				StoreMessageEntryDetailsL();
+				}
+
+			if (!iCurrentMultipartFolderEntryId && iEmailPart==KNoPart)
+				MoveToParentEntryL();
+
+			ResetForNewEntryL(iDefaultEntryType);
+			}
+		}
+	}
+
+  
+/**
+EndOfHeaderProcessingL()
+
+*/
+void CLocalImRecvConvert::EndOfHeaderProcessingL()
+	{	
+	CreateEntryL();
+	StoreEntryStreamsL(KStore822Header);
+	iEntryDataSize = 0;
+	}
+
+
+/**
+EndOfHeaderMIMEProcessingL()
+Have just finished processing header, what next.. ?
+All MIME entry entry creation takes place here.
+
+*/
+void CLocalImRecvConvert::EndOfHeaderMIMEProcessingL()
+	{	
+	if (iMimeParser->IsMessageDigest())
+		iDefaultEntryType=EMessageEntry;
+
+	if (iMimeParser->VCard() || iMimeParser->VCalendar())
+		{
+		iCurrentPartIsRichText = EFalse;	
+		iEntryType = EAttachmentEntry;
+		}
+
+	// Don't create entry if an embedded message header. 
+	if (!iMIMEPart_822Header || iTopMessagePart==EntryId() )
+		CreateEntryL(); 
+
+	if (!iMIMEPart_822Header && !iMimeParser->MimeFieldsExist() && iDefaultEntryType==EMessageEntry)
+		{
+		// MIME header not present. So expecting embedded 822 header
+		iEmailPart = KParentPart;
+		iMIMEPart_822Header=ETrue;
+		iEntryType=ETextEntry;
+		}
+	else if (iMimeParser->ContentType()==EMimeMessage)
+		{
+		// Having received A MIME header of type message/..., store and continue.
+
+		StoreEntryStreamsL(KStore822Header|KStoreMIMEHeader);
+		iMimeParser->ResetForNewEntry();
+		iMIMEPart_822Header=ETrue;
+
+		// Non-multipart embedded message.
+		if (iTopMessagePart==EntryId())
+			{
+			iEntryType = EMessageEntry;
+			ResetForNonMimeEntryL();
+			}
+		else
+			iEntryType=ETextEntry;
+		}
+	else if ( (iTopMessagePart==EntryId() || iMIMEPart_822Header)&&(!iReceivingHeadersOnly) )
+		{
+		// Main rfc822 header or embedded header.
+
+		TImEmailFolderType folderType=iMimeParser->MessageFolderType();
+		if (iMIMEPart_822Header)
+			{
+			iEmailEntry->iDetails.Set(iOutputHeader->From());
+			iEmailEntry->iDescription.Set(iOutputHeader->Subject());
+			iMIMEPart_822Header=EFalse;
+			}
+
+		if (iRfc822Token->i822FieldsExist)
+			StoreEntryStreamsL(KStore822Header|KStoreMIMEHeader);
+		else
+			StoreEntryStreamsL(KStoreMIMEHeader);
+
+
+		if (iMimeParser->ContentType()==EMimeMultipart)
+			{	
+			RECVLOG(KSkippingData)
+			ResetForNewEntryL(EFolderEntry);
+			iMimeParser->SetMessageFolderType(folderType);
+			iSkipData = ETrue;
+			iEmailPart = KMultiPart;
+			iCurrentMultipartFolderEntryId=0;
+			}
+		else 
+			{
+			// Not multipart but some header data to store.
+			iEntryDataSize = 0;
+			}
+
+		CreateEntryL();
+		}
+
+	iRfc822Token->i822FieldsExist=EFalse;
+	iMimeParser->ResetMimeFieldsExist();
+	
+	iFinishedHeader = iMIMEPart_822Header ? EFalse:ETrue;
+	iSkipData = iMimeParser->ContentType()==EMimeMultipart ? ETrue:EFalse;
+	}
+
+
+/**
+ParseBodyLineL()
+Non Mime body parsing
+
+@param aSourceLine
+*/
+void CLocalImRecvConvert::ParseBodyLineL(const TDesC8& aSourceLine)
+	{
+	TInt len=aSourceLine.Length();
+	iTopPartialDownloadCounter+=len; // added for TOP. increment the number of bytes of the attachment downloaded so far
+	TMsvId id=0;
+	if (iBodyId==KMsvNullIndexEntryId)
+		{
+		iBodyId=iEmailEntry->Id();
+		}
+
+	// first check whether this line is a UUEncode start boundary
+	if(CheckUUEStartL(aSourceLine)) 
+		{
+		RECVLOG(KFoundUUEStartBoundary)
+		TFileName tempStore = iAttachmentName;
+		id = EntryId();
+		if (!iNewNonMIMEBodyPart || id!=iTopMessagePart) // main message entry
+			{
+			iEmailEntry->SetComplete(ETrue);
+			iEmailEntry->SetBodyTextComplete(ETrue);
+			StoreEntryStreamsL(KStoreBodyText);
+			}
+		MoveToParentEntryL();
+		if ( !CreateNonMIMEFolderEntryL(id))
+			ResetForNonMimeEntryL();
+			
+		iEntryType = EAttachmentEntry;
+		CreateEntryL();
+		SetAttachmentName(tempStore);
+		
+		iCurrentPartIsRichText = EFalse;
+		iAlgorithm=EUUDecode;
+		iCommitLine=EFalse;
+		if(!iSavingAttachments)
+			{
+			RECVLOG(KSkippingData)
+			iSkipData=ETrue;
+			}
+		iNewNonMIMEBodyPart=EFalse;
+		}
+	else if(aSourceLine.CompareF(KImcvUueEnd)==0) // Checks for the UUEncode end boundary
+		{
+		RECVLOG(KFoundUUEEndBoundary)
+		CloseAttachmentFileL();
+		StoreEntryDataL();
+		MoveToParentEntryL();
+		iSkipData = EFalse;
+		iCommitLine=EFalse;
+		iNewNonMIMEBodyPart=ETrue; 
+		}
+	else if (iNewNonMIMEBodyPart && !( len==2 && aSourceLine[0]==KImcvCR && aSourceLine[1]==KImcvLF ))
+		{
+		id = EntryId();
+		if (!iNewNonMIMEBodyPart || id!=iTopMessagePart)
+			{
+			iEmailEntry->SetComplete(ETrue);
+			iEmailEntry->SetBodyTextComplete(ETrue);
+			StoreEntryStreamsL(KStoreBodyText);
+			}
+		MoveToParentEntryL();
+		if ( !CreateNonMIMEFolderEntryL(id))
+			ResetForNonMimeEntryL();
+		iAlgorithm=ENoAlgorithm;
+		iEntryType = ETextEntry;
+		CreateEntryL();
+		iNewNonMIMEBodyPart=EFalse;
+		}	
+	}
+
+
+/**
+CreateNonMIMEFolderEntryL()
+
+@param aCurrentId
+@return
+*/
+TBool CLocalImRecvConvert::CreateNonMIMEFolderEntryL(TMsvId aCurrentId)
+	{
+	if ( aCurrentId==iTopMessagePart || iCurrentMultipartFolderEntryId )
+		return EFalse;
+
+	// Create Folder.
+	iServerEntry->SetEntry(iTopMessagePart); 
+	iEmailPart = KMultiPart;
+	iEntryType = EFolderEntry;
+	CreateEntryL();
+
+	// Move existing child entry under folder.
+	TMsvId destId = EntryId();
+	iServerEntry->SetEntry(iTopMessagePart); 
+	iServerEntry->MoveEntryWithinService(aCurrentId, destId);
+	User::LeaveIfError(iServerEntry->SetEntry(aCurrentId));
+	User::LeaveIfError(iServerEntry->SetEntry(iServerEntry->Entry().Parent())); 
+
+	// Create MimeHeader.
+	iEmailEntry->SetMessageFolderType(iMimeParser->MessageFolderType());
+
+	RECVLOG(KResetForNewEntry) 
+
+	iMimeParser->ResetForNewEntry();
+	
+	if (iStore8BitData)
+		{
+		//Create a buffer to hold the body text as it is down loaded.
+		delete iBodyBuf;
+		iBodyBuf = NULL;
+		iBodyBuf = CBufFlat::NewL(KBodyTextChunkSizeBytes);
+		}
+	else
+		{
+		iOutputBody->Reset();
+		}
+		
+	ResetForNonMimeEntryL(); 
+	RECVLOG(KResetedForNewEntry) 
+	return ETrue;
+	}
+
+
+/**
+CreateAttachmentL()
+
+@return
+*/
+TBool CLocalImRecvConvert::CreateAttachmentL()
+	{
+	// Get and set Attachment File path
+	TFileName filepath;
+	// added to support TOP command. Reset the download counter each time we have a new
+	// attachment
+	iTopPartialDownloadCounter = 0; 
+
+	// Need to check that the complete filename: iAttachmentFullPath & iAttachmentName	
+	// does not exceed 256 characters. Greater than this and it cannot be saved as a file.
+
+	TBool addExtension=ETrue;
+	if(iAttachmentName.Length() == 0)	//i.e. problem with Attachment name
+	    {
+		// No filename present. Generate one.
+		if(iMimeParser->ContentDescription().Length()!=0)
+			{
+			// Use ContentDescription() as default name 
+			// - as this is more informative than the default
+
+			TLex sourceLineLex = iMimeParser->ContentDescription();
+			ExtractFilename(sourceLineLex, iAttachmentName);
+			}
+		else
+			iAttachmentName = *iDefaultAttachmentName;
+		}
+	else
+		{
+		// Filename present. Check it is valid.
+		ReplaceInvalidCharacters(iAttachmentName);
+		if (iAttachmentName.Locate(KImcvFullStop)!=KErrNotFound)
+			addExtension=EFalse;
+		}
+	if (addExtension)
+		AddFileExtension();
+
+	CMsvStore* store = iServerEntry->EditStoreL(); 
+	CleanupStack::PushL(store);
+	CMsvAttachment* attachment = CMsvAttachment::NewL(CMsvAttachment::EMsvFile);
+	RFile file; 
+	store->AttachmentManagerExtensionsL().CreateAttachmentL(iAttachmentName,file,attachment);
+	
+	iAttachmentFile.SetFileHandle(file,TImAttachmentFile::EImFileWrite);
+	store->CommitL();
+	CleanupStack::PopAndDestroy(store); // store
+
+	if(KErrNone!=iLeaveError)
+		{
+		iAttachmentFileState=EFileFailedToOpen;
+		CloseAttachmentFileL();
+		return EFalse;
+		}
+
+	iAttachmentFileState=EFileIsOpen;
+	return ETrue;
+	}
+
+
+/**
+WriteToAttachmentL()
+
+@param text
+*/
+void CLocalImRecvConvert::WriteToAttachmentL(const TDesC8& text)
+	{
+	if ( (iAttachmentFileState==EFileIsClosed || iAttachmentFileState==EFileNotOpen) 
+		&& CreateAttachmentL() && iEntryType!=EHtmlEntry)
+			iEmailEntry->SetAttachment(ETrue);
+	
+	if(iAttachmentFileState!=EFileIsOpen || !text.Length())
+		{
+		RECVLOG(KSkippingData)
+		iSkipData = ETrue;
+		}
+
+	// write decoded data into a file if there is any data there to write.
+
+	RECVLOG(KWritingToFile)
+
+	// Convert text before writing to attachment.
+	
+	// Store as Binary files..
+	iLeaveError=iAttachmentFile.WriteFile(text);
+
+	if(KErrNone==iLeaveError)
+		iEntryDataSize += text.Length();
+	else	
+		{
+		// the file write failed (eg.there is no space left), set new file state and skip 
+		RECVLOG(KFailedToWriteToFile)
+		iAttachmentFileState=EFileIsIncomplete;
+		CloseAttachmentFileL();
+		}
+	RECVLOG(KWroteToFile)
+	}
+
+
+/**
+CloseAttachmentFileL()
+
+*/
+void CLocalImRecvConvert::CloseAttachmentFileL()
+	{
+	// If anything bad happened a message is sent to the parts CRichText
+	switch(iAttachmentFileState)
+		{
+		case EFileNotOpen:
+			iAttachmentFileState=EFileIsClosed;
+		case EFileIsClosed: //do nothing - this shouldn't happen	
+			break;
+		case EFileIsOpen:		//successful attachment decode
+			RECVLOG(KClosingAttachFile)
+			iAttachmentFile.CloseFile();
+			iAttachmentFileState=EFileIsClosed;
+			iEmailEntry->SetComplete(ETrue);
+			break;
+		case EFileIsIncomplete:		// file write failed
+		case EFileFailedToOpen:		// can't open attach file
+		case EFileIsCorrupt:		// UU data being decoded is corrupt
+			RECVLOG(KClosingAttachFile)
+			iAttachmentFile.CloseFile();	//file has to be closed before it can be deleted
+			RECVLOG(KDeletingAttachFile)
+			{ 
+			// NOTE - need the braces to stop error for re-definition of store
+			CMsvStore* store = iServerEntry->EditStoreL(); 
+			CleanupStack::PushL(store);
+		
+			// Remove the attachment and commit the store.	
+			store->AttachmentManagerExtensionsL().RemoveAttachmentL(0);
+			store->CommitL();
+			CleanupStack::PopAndDestroy(store);
+			}
+			iEmailEntry->SetAttachment(EFalse);
+			iAttachmentFileState=EFileIsClosed;
+			RECVLOG(KDeletedAttachFile)
+
+			if(iSavingAttachments && !iStore8BitData)
+				{
+				WriteToBodyL(KImcvParagraph);
+				WriteToBodyL(*iRemovedAttachmentTag);	//lost attachment - notify user
+				TBuf8<KMaxFileName> name;
+				name.Copy(iAttachmentName); //16 to 8
+				WriteToBodyL(name);
+				WriteToBodyL(KImcvParagraph);
+				}
+
+			User::Leave(iLeaveError);
+			// Skip any remaining encoded data in message
+			break;
+		case EFileTopIncomplete:
+			RECVLOG(KClosingAttachFile)
+			iAttachmentFile.CloseFile();	//file has to be closed before it can be deleted
+
+			// added for TOP command. Ensure we know correct amount of data for later redownload
+			iSizeOfAttachmentsRemoved+=iTopPartialDownloadCounter;
+
+
+			RECVLOG(KDeletingAttachFile)
+			{ 
+			// NOTE - need the braces to stop error for re-definition of store
+			CMsvStore* store = iServerEntry->EditStoreL(); 
+			CleanupStack::PushL(store);
+		
+			// Remove the attachment and commit the store.	
+			store->AttachmentManagerExtensionsL().RemoveAttachmentL(0);
+			store->CommitL();
+			CleanupStack::PopAndDestroy(store);
+			}
+			iEmailEntry->SetAttachment(EFalse);
+			iAttachmentFileState=EFileIsClosed;
+			RECVLOG(KDeletedAttachFile);
+			TMsvId id = EntryId();
+			TMsvId parent = iServerEntry->Entry().Parent();
+			MoveToParentEntryL();
+			TMsvId setTo=iServerEntry->Entry().Id();
+			if(setTo!=parent)
+				{
+				iServerEntry->SetEntry(parent);
+				}
+			User::LeaveIfError(iServerEntry->DeleteEntry(id));			
+			iServerEntry->SetEntry(setTo);
+			break;
+		}
+	}
+
+
+/**
+LineIsAllWhitespace()
+
+@return
+*/
+TBool CLocalImRecvConvert::LineIsAllWhitespace()
+	{// returns 1 if all elements of the current line are whitespace
+	TBool	spaceFound = 1;
+	TLex8	aLex = iLineLex;
+
+	while (spaceFound && aLex.Peek()!=KImcvCR)
+		{
+		if (aLex.Peek()==KImcvSP)
+			{
+			spaceFound = 1;
+			aLex.Inc();
+			}	
+		else spaceFound = 0;
+		}
+	return (spaceFound);
+	}
+
+  
+/**
+CheckUUEStartL()
+
+@param aSourceLine
+@return
+*/
+TBool CLocalImRecvConvert::CheckUUEStartL(const TDesC8& aSourceLine)
+	{
+	// Checks if the descriptor contains the UUE begin header
+	// Extracts the file name if it is
+	
+	TInt sourceLength = aSourceLine.Length();
+	if(sourceLength < KImcvUueStart().Length()+3) // can't be it, it's not long enough
+		return EFalse;
+
+	if(!aSourceLine.Left(KImcvUueStart().Length()).CompareF(KImcvUueStart)) // start of line might be UUE boundary
+		{
+		// we also need to check that the next three chars are numbers - Unix file access code
+		const TUint8* _ptr = aSourceLine.Ptr();
+		TInt length=KImcvUueStart().Length();// this defines length as 6 ie. "b e g i n  " 
+		if(TChar(_ptr[length]).IsDigit() && TChar(_ptr[length+1]).IsDigit() && TChar(_ptr[length+2]).IsDigit())
+			{
+			// we've found 'begin ###' at the start of a line -
+			// that's about as good as we can do 
+			// now grab the file name and paste it into the document
+			// Extract filename from string, removing any surrounding quote marks
+
+			HBufC16* pBuf16 = HBufC16::NewLC(aSourceLine.Length());
+			pBuf16->Des().Copy(aSourceLine);
+			TLex sourceLineLex = pBuf16->Ptr();
+			//parse until start of filename and mark
+			length+=3;					// length (init'd to 6 above) now equals 9 ie. "begin ###"
+			sourceLineLex.Inc(length);	// skips "begin ###"
+			sourceLineLex.SkipSpace();	// skips any leading whitespace
+
+			ExtractFilename(sourceLineLex, iAttachmentName);
+			CleanupStack::PopAndDestroy(); // pBuf8
+			return ETrue;
+			}
+		}
+		
+	return EFalse;
+	}
+
+  
+/**
+AddFileExtension()
+*/
+void CLocalImRecvConvert::AddFileExtension()
+	{
+	switch (iMimeParser->ContentType())
+		{
+		case EMimeText:
+			// Add on extension to make opening file from email editor possible.
+
+			if ( iMimeParser->ContentSubType()==KImcvHtml )
+				iAttachmentName.Append(KHtmlExtension);
+			else if (iMimeParser->VCard() || iMimeParser->VCalendar())
+				iAttachmentName.Append(KVCardExtension);
+			else //if ( iMimeParser->ContentSubType()==KImcvPlain)
+				iAttachmentName.Append(KTextExtension);
+			break;
+		case EMimeImage:
+		case EMimeAudio:
+		case EMimeVideo:
+			if ( (iMimeParser->ContentSubType()==KImcvBmp) 
+					|| (iMimeParser->ContentSubType()==KImcvGif)
+					|| (iMimeParser->ContentSubType()==KImcvJpeg)
+					|| (iMimeParser->ContentSubType()==KImcvTiff)
+					|| (iMimeParser->ContentSubType()==KImcvWav) )
+				{
+				TBuf<KMaxExtensionLength> buf;
+				buf.Copy(iMimeParser->ContentSubType());
+				iAttachmentName.Append(KImcvFullStop);
+				iAttachmentName.Append(buf);
+				}
+			break;
+		default:
+			break;
+		} // End switch
+	}
+
+  
+/**
+WriteToBodyL()
+
+@param aText
+@param aBlankLine
+*/
+void CLocalImRecvConvert::WriteToBodyL(const TDesC8& aText, TBool aBlankLine)
+	{
+	RECVLOG(KWritingToBody)
+
+	if(aText.Length() && aText[aText.Length()-1]==CEditableText::ELineBreak )
+		RECVLOG(KLineHasLineBreak)
+	TInt pos = iOutputBody->DocumentLength();
+
+	// Add bits of body text, converting along the way, till no characters left
+	// .. to convert.
+
+	if(aBlankLine)
+		{
+		RECVLOG(KBlankLine);
+		iOutputBody->InsertL(pos, CEditableText::EParagraphDelimiter);
+		pos++;
+		return;
+		}
+
+	// Convert text before writing to body.
+	TInt rem = 0;
+	HBufC16* text16=HBufC16::NewLC(aText.Length());
+	TPtr16 ptr16(text16->Des());
+	TInt unconvertedChars, firstPos; // not used 
+	rem = iCharConv->ConvertToOurCharsetL(aText, ptr16, unconvertedChars, firstPos);
+	if (rem < 0) // error
+		{
+		// Copy unconverted characters.
+		Append(ptr16, aText);
+		iOutputBody->InsertL(pos, ptr16);
+		CleanupStack::PopAndDestroy(); // text16
+		return;
+		}
+	else if (rem && rem < KConversionRemainderLength)
+		iLeftOver.Copy(aText.Right(rem));	
+	
+	// Make sure that the line is not CRLF terminated 
+	// - replace with a line break if necessary.
+
+	TInt length = ptr16.Length();
+	switch(iAlgorithm)
+		{
+		case EBase64Decode:
+		case EUUDecode:
+			{
+			// Check for CRLF throughout the string.
+
+			if (!length)
+				break; // String length zero.
+
+			if (iEncounteredLineEndingInCarriageReturn)
+				{
+				pos--; // overwrite the stored CR.
+				ptr16[0] = CEditableText::ELineBreak;
+				}
+			iEncounteredLineEndingInCarriageReturn = ptr16[length-1]==KImcvCR ? ETrue:EFalse;
+
+			TInt start = 0;
+			TInt offset = ptr16.Find(KImcvCRLF16);
+
+			while (offset != KErrNotFound)
+				{
+				ptr16[offset] = CEditableText::ELineBreak;
+				const TDesC& buf = ptr16.Mid(start, offset-start+1);
+				iOutputBody->InsertL(pos, buf);
+				pos += buf.Length();
+				start=offset+2; // Skip the LF char.
+				offset = ptr16.Find(KImcvCRLF16);
+				} 
+
+			if (start<length)
+				{
+				const TDesC& buf = ptr16.Right(length-start);
+				iOutputBody->InsertL(pos, buf);
+				pos += buf.Length();
+				}
+			}
+			break;
+
+		case EQPDecode:
+		case ENoAlgorithm:
+		default:
+			// Check for CRLF at end of line.
+			if(length>=2 && ptr16[length-2]==KImcvCR && ptr16[length-1]==KImcvLF)
+				{
+				ptr16[length-2] = CEditableText::ELineBreak;
+				ptr16.SetLength(length-1);
+				}	
+
+			const TDesC& buf = text16->Des();
+			iOutputBody->InsertL(pos, buf);
+			pos += buf.Length();
+		}	
+
+	CleanupStack::PopAndDestroy(text16);
+	
+	RECVLOG(KWroteToBody)
+	}
+
+
+/**
+WriteToBodyL()
+
+@param aText
+*/
+void CLocalImRecvConvert::WriteToBodyL(const TDesC16& aText)  
+	{
+	RECVLOG(KWritingToBody)
+	if (aText.Length() && aText[aText.Length()-1]==CEditableText::ELineBreak)
+		RECVLOG(KLineHasLineBreak)
+
+	TInt pos = iOutputBody->Read(0).Length();
+	// get the text in before the paragraph marker that's always there
+	pos = pos-1 < 0 ? 0 : pos-1;
+	iOutputBody->InsertL(pos,aText);
+	
+	RECVLOG(KWroteToBody)
+	}
+
+  
+/**
+ParseRecipientListL()
+
+@param aList
+*/
+void CLocalImRecvConvert::ParseRecipientListL(CDesCArray& aList)
+	{
+	HBufC8* pBuf = HBufC8::NewLC(KMaxIMailHeaderReadLineLength);
+	TPtrC8 source(iRfc822Token->OutputLine()->Ptr(), iRfc822Token->OutputLine()->Length());
+	const TUint8* ptr = source.Ptr();
+	TUint8 lookFor = 0;
+	TInt count = 0;
+	TBool finishedEntry = EFalse;
+
+	// get past white space
+	while(*ptr&&((*ptr==KImcvSP)||(*ptr==KImcvSemiColon))) ptr++;
+
+	while(*ptr&&((ptr-source.Ptr())<(source.Length())))
+		{
+		if(!pBuf->Length())
+			{
+			finishedEntry = EFalse;
+			}
+
+		switch(*ptr)
+			{
+			case KImcvLeftBracket:
+				if(lookFor==KImcvRightBracket)
+					count++;
+				else
+					{
+					lookFor = KImcvRightBracket;
+					count = 1;
+					}
+				break;
+			case KImcvLeftChevron:
+				if(lookFor==KImcvRightChevron)
+					count++;
+				else
+					{
+					lookFor = KImcvRightChevron;
+					count = 1;
+					}
+				break;
+			case KImcvDoubleQuote:
+ 				lookFor = (TUint8)(lookFor==KImcvDoubleQuote ? 0 : KImcvDoubleQuote);
+				count = (lookFor ? 1 : 0);
+				break;
+			case KImcvRightBracket:
+			case KImcvRightChevron:
+				count -= (*ptr == lookFor ? 1 : 0);
+				lookFor = (TUint8)((*ptr == lookFor)&&(count == 0) ? 0 : lookFor);
+				break;
+			case KImcvComma:
+			case KImcvSemiColon:
+				finishedEntry = !lookFor;
+				break;
+			}
+
+		if(!finishedEntry)
+			{
+			// check we're not about to blow the buffer
+			if(pBuf->Length() >= pBuf->Des().MaxLength())
+				{
+				pBuf = pBuf->ReAlloc(pBuf->Length() + 64); // arbitrary extension
+				}
+			pBuf->Des().Append((TChar)*ptr);
+			// move to the next character
+			ptr++;
+			}
+		else
+			{
+			// that's it! store the address away
+			HBufC16* pBuf16 = HBufC16::NewLC(pBuf->Des().Length());
+			pBuf16->Des().Copy(pBuf->Des());
+			aList.AppendL( (HBufC16&) *pBuf16 );
+			CleanupStack::PopAndDestroy(); // pBuf16
+			pBuf->Des().SetLength(0);
+
+			// get past the separator
+			ptr++;
+
+			// get past white space (& any other separators)
+			while(*ptr && (*ptr==KImcvSP || *ptr==KImcvTab || *ptr==KImcvComma || *ptr==KImcvSemiColon)) ptr++;
+			}
+		}
+		// catch the last name in the list
+		if (pBuf)
+			{
+			TInt recipientLength = pBuf->Length();
+			if (recipientLength)
+				{
+				HBufC16* pBuf16 = HBufC16::NewLC(recipientLength);
+				pBuf16->Des().Copy(*pBuf);
+				aList.AppendL(*pBuf16);
+				CleanupStack::PopAndDestroy(); // pBuf16
+				}
+			}
+
+		CleanupStack::PopAndDestroy(); // pBuf
+	}
+
+
+/**
+ExtractFilename()
+
+@param aLex
+@param rFileName
+*/
+void CLocalImRecvConvert::ExtractFilename(TLex& aLex, TDes& rFileName)
+	{
+	// This function steps through the filename extracting the bare name and checking 
+	//  the length is less than the max of 256 for EPOC ;checks that all chars are legal for EPOC32
+	
+	TChar endChar = KImcvSemiColon;
+
+	aLex.SkipSpace();
+	
+	if (aLex.Peek()==KImcvDoubleQuote)
+		{
+		aLex.Inc();	// step over the " character
+		endChar = KImcvDoubleQuote;
+		}
+
+	aLex.Mark();	// marks where we are as this is the first char of the filename
+	
+	TInt fileNameLength = 0;
+	TInt maxFileNameLength = rFileName.MaxLength();
+
+	while(!aLex.Eos() && aLex.Peek()!=endChar && aLex.Peek()!=KImcvCR && fileNameLength < maxFileNameLength)	
+		//spools through the string until the end and marks char before quote (such that 
+		//  it extracts only the filename), EOS or before the maximum buffer length is exceeded 
+		{
+		fileNameLength++;
+		aLex.Inc();
+		}
+
+	TPtrC marked = aLex.MarkedToken(); 
+	rFileName.Copy(marked);
+	
+	ReplaceInvalidCharacters(rFileName);
+	}
+
+
+/**
+SetAttachmentName()
+
+@param aFileName
+*/
+void CLocalImRecvConvert::SetAttachmentName(TDes& aFileName)
+	{
+	ReplaceInvalidCharacters(aFileName);
+	iAttachmentName.Zero();
+
+	TUint delimiter = '.';
+	TInt  maxLength = iAttachmentName.MaxLength();
+	
+	__ASSERT_DEBUG(
+		maxLength >= aFileName.Length(), gPanic(KPanicReadLengthTooLarge)
+		);
+
+	iAttachmentName.Copy(aFileName);
+	TInt attachmentLen = iAttachmentName.Length();
+	if (attachmentLen == 0)
+		iAttachmentName = *iDefaultAttachmentName;
+	else if (iAttachmentName[0] == delimiter && maxLength >= attachmentLen + iDefaultAttachmentName->Length())
+		iAttachmentName.Insert(0, *iDefaultAttachmentName);
+	}
+
+	
+/**
+ReplaceInvalidCharacters()
+
+@param rFileName
+*/
+void CLocalImRecvConvert::ReplaceInvalidCharacters(TDes& rFileName)
+	{
+	TInt length = rFileName.Length();
+	for(TInt index=0; index < length; index++)
+		{
+		//parse extracted filename and replace any illegal chars with a default.
+
+		if(IsIllegalChar((TUint)rFileName[index]))
+			rFileName[index] = KImcvDefaultChar;
+		}
+	}
+
+
+/**
+StoreEntryStreamsL()
+*/
+void CLocalImRecvConvert::StoreEntryStreamsL()	
+	{
+	StoreEntryStreamsL(KStoreBodyText|KStore822Header|KStoreMIMEHeader);
+	}
+
+
+/**
+StoreEntryStreamsL()
+
+@param aSettings
+*/
+void CLocalImRecvConvert::StoreEntryStreamsL(TInt aSettings)	
+	{
+	RECVLOG(KStartStoringEntryStream);
+	if (iReceivingHeadersOnly==EFalse)
+		{
+		CMsvStore* entryStore = NULL;
+		TBool commitStore = EFalse;
+
+		TRAPD(error, entryStore = iServerEntry->EditStoreL());
+		if(error==KErrNone) // if store does not exist then the entry is the wrong type
+			{
+			CleanupStack::PushL(entryStore);
+
+			if (aSettings & KStore822Header)
+				Store822HeaderL(*entryStore, commitStore);
+			
+			if (aSettings & KStoreMIMEHeader)
+				StoreMIMEHeaderL(*entryStore, commitStore);
+
+			if (aSettings & KStoreBodyText)
+				StoreBodyTextL(*entryStore, commitStore);
+
+			// only commit to the store if I wrote something into it
+			if (commitStore)
+				{
+				RECVLOG(KStoringEntryStream);
+				entryStore->CommitL();
+				}
+
+			StoreEntryDataL();
+			CleanupStack::PopAndDestroy(); //entryStore		
+			}
+
+		}
+	RECVLOG(KDoneStoringEntryStream);
+	}
+
+
+/**
+Store822HeaderL()
+
+@param aStore
+@param aCommit 
+*/
+void CLocalImRecvConvert::Store822HeaderL(CMsvStore& aStore, TBool& aCommit)	
+	{
+	if(iEmptyHeaderSize<(iOutputHeader->DataSize()))
+		{
+		iEntryDataSize += iOutputHeader->DataSize()-iEmptyHeaderSize;
+		RECVLOG(KStoringHeader);
+		iOutputHeader->StoreL(aStore);	
+		RECVLOG(KStoredHeader);
+		aCommit = ETrue;
+		}
+	}
+
+
+/**
+StoreMIMEHeaderL()
+
+@param aStore
+@param aCommit
+*/
+void CLocalImRecvConvert::StoreMIMEHeaderL(CMsvStore& aStore, TBool& aCommit)	
+	{
+	if(iMimeParser->MimeHeaderSize())
+		{
+		RECVLOG(KStoringMIMEHeader);
+ 		iMimeParser->StoreMimeHeaderWithoutCommitL(aStore);
+		aCommit = ETrue;
+		RECVLOG(KStoredMIMEHeader);
+		}
+	}
+
+
+/**
+StoreBodyTextL()
+
+@param aStore
+@param aCommit
+*/
+void CLocalImRecvConvert::StoreBodyTextL(CMsvStore& aStore, TBool& aCommit)	
+	{
+	if (iStore8BitData)
+		{
+		if(iBodyBuf->Size())
+			{
+			iEntryDataSize += iBodyBuf->Size();
+			RECVLOG(KStoring8BitBody);
+			iBodyText->StoreL(aStore, *iBodyBuf);
+			aCommit = ETrue;
+			RECVLOG(KStored8BitBody);
+			}
+		}
+	else
+		{
+		if(iOutputBody->DocumentLength())
+			{
+			iEntryDataSize += iOutputBody->DocumentLength();
+			RECVLOG(KStoringBody);
+			aStore.StoreBodyTextL(*iOutputBody);
+			aCommit = ETrue;
+			RECVLOG(KStoredBody);
+			}
+		}
+	}
+
+
+/**
+StoreEntryDataL()
+
+@return
+*/
+TBool CLocalImRecvConvert::StoreEntryDataL()
+	{
+	// NB function should only be called if a whole email is being processed
+	TBool commit=EFalse;
+	RECVLOG(KUpdatingEntry)
+
+	if (iEmailEntry->iType==KUidMsvMessageEntry)
+		iParent->At(0).iSize += iEntryDataSize;
+	else
+		{
+		iEmailEntry->iSize += iEntryDataSize;
+		if (iEntryType==EAttachmentEntry || iEntryType==EHtmlEntry)
+			iEmailEntry->iDetails.Set(iAttachmentName);
+		}
+	User::LeaveIfError(iServerEntry->ChangeEntry(*iEmailEntry));
+
+	RECVLOG(KUpdatedEntry)
+	return commit;	// if I wrote data into the store, tell owner	
+	}
+
+
+/**
+MoveToParentEntryL()
+*/
+void CLocalImRecvConvert::MoveToParentEntryL()
+	{
+	// This function changes the context to the current entry's parent entry.
+	RECVLOG(KMoveToParentEntry)
+
+	// Change context to the parent entry	
+	if (EntryId()==iTopMessagePart)
+		return; // Already there.
+
+	User::LeaveIfError(iServerEntry->SetEntry(iServerEntry->Entry().Parent())); 
+
+	iNewEntry = EFalse;
+	
+	// only read and write to store if this is a real email message; headers stored in
+	// the remote mailbox do not require any store information.
+	if (iReceivingHeadersOnly)
+		{
+		RECVLOG(KIgnoringStreams)
+		return;
+		}
+
+	TBool allowAttachmentFlag=ETrue;
+	if(iServerEntry->Entry().iType == KUidMsvFolderEntry)
+		{
+		// Current entry is a folder entry signifying a MIME multipart.
+		// Change context to the parent entry
+		
+		TMsvEmailEntry entry = (TMsvEmailEntry) iServerEntry->Entry();
+		iCurrentMultipartFolderEntryId = EntryId();
+		allowAttachmentFlag = !(entry.MessageFolderType()==EFolderTypeRelated || 
+								entry.MessageFolderType()==EFolderTypeAlternative);
+	
+
+		if (EntryId()!=iTopMessagePart)
+			User::LeaveIfError(iServerEntry->SetEntry(iServerEntry->Entry().Parent())); 
+		}
+
+	TBool childIsAttachment = (iEmailEntry->Attachment() || iEmailEntry->iType == KUidMsvMessageEntry) ? ETrue:EFalse;
+	TBool childIsMHTML=EFalse;
+	// Dont want the flag propogated 'up' past a message entry.
+	if(iEmailEntry->iType != KUidMsvMessageEntry)
+		childIsMHTML = iEmailEntry->MHTMLEmail() ? ETrue:EFalse;
+
+	//Make the parent entry the current entry 
+	if (NULL!=iEmailEntry)
+		{
+		delete iEmailEntry;
+		iEmailEntry=NULL;
+		}
+	iEmailEntry = new (ELeave) TMsvEmailEntry(iServerEntry->Entry());
+
+	if (!iParent->Count())
+		{
+		TParentDetails parentDetails;
+		iParent->InsertL(0,parentDetails);
+		}
+
+	if (! iParent->At(0).iAttachment)
+		{
+		iParent->At(0).iAttachment=(childIsAttachment && allowAttachmentFlag)? ETrue:EFalse;
+
+		// if we aren't allowing attachments because of the folder type
+		// remember there where attachments and check at the end whether
+		// it was an MHTML message or not.
+		if(childIsAttachment && !allowAttachmentFlag)
+			{
+			iRelatedAttachments=ETrue;
+			}
+		}
+	if (!iParent->At(0).iMHTML)
+		iParent->At(0).iMHTML = childIsMHTML ? ETrue:EFalse;
+	iParent->At(0).iSize += iEntryDataSize;
+
+	iOutputHeader->Reset();
+	iEmptyHeaderSize=iOutputHeader->DataSize();
+	iMimeParser->ResetForNewEntry();
+
+	iEntryDataSize=0;
+
+	RECVLOG(KMovedToParentEntry)
+	}
+
+/**
+WritePartialFooterL()
+Helper function to add the partial footer to the email if it exists
+
+@param aAmountLeft
+*/
+void CLocalImRecvConvert::WritePartialFooterL(TInt aAmountLeft)
+	{
+	TMsvId msgId=iBodyId;
+	if (msgId==KMsvNullIndexEntryId)
+		return;
+	TMsvId id = iServerEntry->Entry().Id();
+	if (iServerEntry->SetEntry(msgId)==KErrNone)
+		{
+		TBool storePresent = iServerEntry->HasStoreL();
+		if (storePresent && iPartialEmailFooter->Length()>0 && aAmountLeft>0)
+			{
+			CMsvStore* store = iServerEntry->ReadStoreL();
+			CleanupStack::PushL(store);
+			if (store->HasBodyTextL())
+				{
+				iOutputBody->Reset();
+				store->RestoreBodyTextL(*iOutputBody);
+				CleanupStack::PopAndDestroy(store);
+				HBufC* msg=NULL;
+				if (iPartialEmailFooter->Find(KIntegerKey)!=KErrNotFound)
+					{
+					// display k left on the server, rounded up if between 1 and 1023 bytes
+					TInt kBytesLeft = aAmountLeft / 1024;
+					if(kBytesLeft == 0)
+						kBytesLeft = 1;
+					msg = HBufC::NewLC(iPartialEmailFooter->Length()+KSpaceToAddNumber);
+					msg->Des().Format(*iPartialEmailFooter,kBytesLeft);
+					}
+				else
+					{
+					msg = iPartialEmailFooter->AllocLC();
+					}
+				iOutputBody->AppendParagraphL();
+				TInt length = iOutputBody->DocumentLength();
+				iOutputBody->InsertL(length,*msg);
+				CleanupStack::PopAndDestroy(msg);
+				store=NULL;
+				store = iServerEntry->EditStoreL();
+				CleanupStack::PushL(store);
+				store->StoreBodyTextL(*iOutputBody);
+				store->Commit();
+				CleanupStack::PopAndDestroy(store);
+				}
+			else
+				{
+				CleanupStack::PopAndDestroy(store);
+				}
+			}
+		}
+	iServerEntry->SetEntry(id);
+	}
+
+
+/**
+CreateEntryL()
+*/
+void CLocalImRecvConvert::CreateEntryL()
+	{
+	RECVLOG(KCreatingEntry);
+	if (NULL!=iEmailEntry)
+		{
+		delete iEmailEntry;
+		iEmailEntry=NULL;
+		}
+
+	if (iCurrentMultipartFolderEntryId)
+		{
+		User::LeaveIfError(iServerEntry->SetEntry(iCurrentMultipartFolderEntryId));
+		iCurrentMultipartFolderEntryId=0;
+		}
+		
+	iEmailEntry = new (ELeave) TMsvEmailEntry;
+
+	TValidEntryType previousEntryType = iEntryType;
+	if (!iTopMessagePart || iMIMEPart_822Header)
+		{
+		// At the main header, want to create a message entry.
+		// The stored iEntryType will indicate ( from header info) the next entry to be created.
+		// Save temporarily.
+		// Also applies to the special case where a message contains ony 1 embedded message.
+
+		previousEntryType=iEntryType;
+		iEntryType=EMessageEntry;
+		}
+
+	if ((iPopulateMessage) && (!iTopMessagePart))
+	// If this is the root of a message that is being populated then do not create it.
+		{
+		User::LeaveIfError(iServerEntry->SetEntry(iRootEntryId));
+		*iEmailEntry = iServerEntry->Entry();
+		iTopMessagePart=iRootEntryId;
+
+		// Delete all the children of the message entry.  This is needed because if the
+		// message has been purged, the entries will still exist.  When the message is populated,
+		// new entries are created.  If the original entries are not removed, then duplicate 
+		// entries will exist.
+		CMsvEntrySelection*	children = new(ELeave) CMsvEntrySelection;
+		CleanupStack::PushL(children);
+		User::LeaveIfError(iServerEntry->GetChildren(*children));
+		if (children->Count())
+			iServerEntry->DeleteEntries(*children);
+		CleanupStack::PopAndDestroy(children);
+		}
+	else
+		{
+		iEmailEntry->iMtm=iNewMsgType;
+		iEmailEntry->iServiceId = iEmailServiceId;
+		iEmailEntry->SetComplete(EFalse);
+		iEmailEntry->iSize = 0;
+		iEmailEntry->SetVisible(ETrue);
+		iEmailEntry->SetInPreparation(EFalse);
+		iEmailEntry->SetReceipt(EFalse);
+
+		iEmailEntry->SetVCard(iMimeParser->VCard());
+		iEmailEntry->SetVCalendar(iMimeParser->VCalendar());
+		iEmailEntry->SetMessageFolderType(iMimeParser->MessageFolderType());
+		iEmailEntry->SetPriority(iImPriority);
+		iEmailEntry->SetNew(EFalse);
+
+		if(iOutputHeader->ReceiptAddress().Length()>0)
+			iEmailEntry->SetReceipt(ETrue);
+
+		iEmailEntry->iDate=iTimeDate;
+		switch(iEntryType)
+			{
+			case EMessageEntry:
+				if(!iTopMessagePart)
+					{
+					iEmailEntry->SetUnread(ETrue);
+					iEmailEntry->SetNew(ETrue);
+					iEmailEntry->SetVisible(EFalse);
+					iEmailEntry->SetInPreparation(ETrue);
+					iEmailEntry->SetSendingState(KMsvSendStateNotApplicable);
+					}
+				else
+					{
+					TParentDetails parentDetails;
+					parentDetails.iMHTML=EFalse;
+			        parentDetails.iAttachment=EFalse;
+					parentDetails.iSize=0;
+					iParent->InsertL(0,parentDetails);
+					}
+				iEmailEntry->iType=KUidMsvMessageEntry;
+				iEmailEntry->iDetails.Set(iOutputHeader->From());
+				iEmailEntry->iDescription.Set(iOutputHeader->Subject());
+				break;
+			case EFolderEntry:
+				iEmailEntry->iType=KUidMsvFolderEntry;
+				if (iMimeParser->MessageFolderType()==EFolderTypeUnknown)
+					{
+					// Get folder type of parent (the message)
+					TMsvEmailEntry entry=iServerEntry->Entry();
+					iEmailEntry->SetMessageFolderType(entry.MessageFolderType());
+					}
+				break;
+			case EAttachmentEntry:
+				iEmailEntry->iType=KUidMsvAttachmentEntry;
+				iEmailEntry->iDetails.Set(iAttachmentName);
+				iEmailEntry->iDescription.Set(iMimeParser->ContentDescription());
+				break; 
+			case ETextEntry:
+				if ( iMimeParser->ContentDisposition()!=KImcvAttachment)
+					iEmailEntry->iType=KUidMsvEmailTextEntry;
+				else 
+					{
+					iEmailEntry->iType=KUidMsvAttachmentEntry;
+					iEmailEntry->iDetails.Set(iAttachmentName);
+					iEmailEntry->iDescription.Set(iMimeParser->ContentDescription());
+					}
+				break;
+			case EHtmlEntry:
+				iEmailEntry->iType=KUidMsvEmailHtmlEntry;
+				// If disposition not set or is inline..
+				if ( iMimeParser->ContentDisposition()==KImcvAttachment)
+					iEmailEntry->iType=KUidMsvAttachmentEntry;
+				else
+					iEmailEntry->SetMHTMLEmail(ETrue);
+				iEmailEntry->iDetails.Set(iAttachmentName);
+				iEmailEntry->iDescription.Set(iMimeParser->ContentDescription());
+				break;
+			default:
+				iEmailEntry->iType=KUidMsvAttachmentEntry;
+				iEmailEntry->iDetails.Set(iAttachmentName);
+				iEmailEntry->iDescription.Set(iMimeParser->ContentDescription());
+			}
+
+		User::LeaveIfError(iServerEntry->CreateEntry(*iEmailEntry));
+		User::LeaveIfError(iServerEntry->SetEntry(iEmailEntry->Id()));
+		if(!iTopMessagePart)
+			iTopMessagePart=iEmailEntry->Id();
+
+		//if (iEntryType==EHtmlEntry && iAttachmentFileState!=EFileIsOpen)
+		//	CreateAttachmentL();
+		}
+
+	iEntryType=previousEntryType;
+	iNewEntry = ETrue;
+	RECVLOG(KCreatedEntry);
+	}
+
+
+/**
+Logging()
+
+@param aString1
+@param aString2
+*/
+void CLocalImRecvConvert::Logging(const TDesC8& aString1, const TDesC8& aString2)  
+	{
+	TBuf8<1024> aBuf(aString1);
+
+	aBuf.Append(aString2);
+	RECVLOG(aBuf);
+	}
+
+
+/**
+StoreMessageEntryDetailsL()
+*/
+ void CLocalImRecvConvert::StoreMessageEntryDetailsL()  
+	{
+	iEmailEntry->SetAttachment(iParent->At(0).iAttachment);
+	iEmailEntry->SetMHTMLEmail(iParent->At(0).iMHTML);
+
+	if(iEmailEntry->MHTMLEmail() == EFalse && iEmailEntry->Attachment() == EFalse && iRelatedAttachments !=EFalse)
+		{
+		iEmailEntry->SetAttachment(ETrue);
+		}
+	iRelatedAttachments=EFalse;
+	
+	iEmailEntry->iSize=iParent->At(0).iSize;
+	iEmailEntry->SetMessageFolderType(iParent->At(0).iFolder);
+	StoreEntryDataL();
+
+	if (iParent->Count()>1)
+		{
+		iParent->At(1).iSize+=iEmailEntry->iSize;
+		iParent->Delete(0);
+		}
+	else
+		{
+		iParent->At(0).iAttachment=iParent->At(0).iMHTML=EFalse;
+		iParent->At(0).iSize=0;
+		}
+	}
+
+
+/**
+DeletedAttachmentSize()
+
+@return
+*/ 
+ TInt CLocalImRecvConvert::DeletedAttachmentSize()  
+	{
+	return iSizeOfAttachmentsRemoved;
+	}
+
+/****************************************************************************
+	Class CLocalMimeParser functions
+*****************************************************************************/
+
+/**
+NewLC()
+Static factory constructor. Uses two phase construction 
+and pushes the newly created object into the Cleanup stack.
+
+@param aImRecvConvert
+@return
+*/    
+CLocalMimeParser* CLocalMimeParser::NewLC(CLocalImRecvConvert& aImRecvConvert)  
+	{
+	CLocalMimeParser* self = new (ELeave) CLocalMimeParser(aImRecvConvert);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+
+
+/**
+NewL()
+Static factory constructor. Uses two phase construction.
+
+@param aImRecvConvert
+@return
+*/
+ CLocalMimeParser* CLocalMimeParser::NewL(CLocalImRecvConvert& aImRecvConvert)  
+	{
+	CLocalMimeParser* self = CLocalMimeParser::NewLC(aImRecvConvert);
+	CleanupStack::Pop();
+	return self;
+	}
+
+
+/**
+CLocalMimeParser()
+
+@param aImRecvConvert
+@return
+*/
+CLocalMimeParser::CLocalMimeParser(CLocalImRecvConvert& aImRecvConvert): iImRecvConvert(aImRecvConvert), 
+											iStartId(NULL)
+
+	{
+	__DECLARE_NAME(_S("CLocalMimeParser"));
+	}
+
+
+/**
+ConstructL()
+*/
+void CLocalMimeParser::ConstructL() 
+	{
+	iMimeHeader = CImMimeHeader::NewL();
+	// Create a Desc array to store the boundary strings of a Mime message
+	iBoundaryText = new (ELeave) CDesC8ArrayFlat(3);
+	
+	// Set charset default value
+	iDefaultCharset=iImRecvConvert.CharacterConverter().DefaultCharset();
+	iCharset = iDefaultCharset;
+	ResetMimeFieldsExist();
+
+	Reset();
+	}
+
+
+/**
+~CLocalMimeParser()
+*/
+CLocalMimeParser::~CLocalMimeParser() 
+	{
+	delete iMimeHeader;
+	iMimeHeader=NULL;
+	delete iBoundaryText;
+	iBoundaryText=NULL;
+	delete iMimeHeaderLine;
+	iMimeHeaderLine=NULL;
+	delete iStartId;
+	iStartId=NULL;
+	}
+
+
+/**
+Reset() 
+*/
+void CLocalMimeParser::Reset() 
+	{
+	iBoundaryText->Reset();
+	iBoundaryIndex = 0;
+	iBoundaryLength = 0;
+	isMime = EFalse;
+	
+	ResetForNewEntry();
+	}
+
+
+/**
+ResetForNewEntry()
+*/
+void CLocalMimeParser::ResetForNewEntry()
+	{
+	iMimeHeader->Reset();
+	iEmptyMimeHeaderSize=iMimeHeader->Size();
+		
+	iContentType = EMimeUnknownContent;
+	iContentEncoding = EEncodingTypeNone;
+	iContentDescription.Zero();
+	iVCard = EFalse;
+	iVCalendar = EFalse;
+	iStartPart=EFalse;
+	iMessageFolderType = EFolderTypeUnknown;
+	iTerminatingBoundary = EFalse;
+	iBoundaryFound = EFalse;
+	}
+
+
+/**
+RestoreMimeParserL()
+
+@param entryStore
+*/
+void CLocalMimeParser::RestoreMimeParserL(CMsvStore& entryStore)
+	{
+	iMimeHeader->RestoreL(entryStore);
+	if(iMimeHeader->ContentType().Compare(KImcvText)==0)
+		iContentType=EMimeText; 
+	else
+	if(iMimeHeader->ContentType().Compare(KImcvMessage)==0)
+		iContentType=EMimeMessage;
+	else
+	if(iMimeHeader->ContentType().Compare(KImcvMultipart)==0)
+		iContentType=EMimeMultipart; 
+	else
+	if(iMimeHeader->ContentType().Compare(KImcvImage)==0)
+		iContentType=EMimeImage; 
+	else
+	if(iMimeHeader->ContentType().Compare(KImcvApplication)==0)
+		iContentType=EMimeApplication; 
+	else
+	if(iMimeHeader->ContentType().Compare(KImcvAudio)==0)
+		iContentType=EMimeAudio; 
+	else
+	if(iMimeHeader->ContentType().Compare(KImcvVideo)==0)
+		iContentType=EMimeVideo; 
+	else
+		iContentType=EMimeUnknownContent; 
+
+	}
+
+
+/**
+ParseLineL()
+
+@param aSourceLine
+*/
+void CLocalMimeParser::ParseLineL(const TDesC8& aSourceLine)
+	{
+	if(iMimeHeaderLine==NULL)
+		{
+		iMimeHeaderLine = HBufC8::NewL(aSourceLine.Length());
+		*iMimeHeaderLine = aSourceLine;
+		}
+	
+	iLex = *iMimeHeaderLine;
+
+	// find out whether the current line has anything to do with currently understood MIME Content tokens
+	if(!iMimeHeaderLine->MatchF(KImcvMime) || !iMimeHeaderLine->MatchF(KImcvContent))
+		{ 
+		if(MatchAndRemoveToken(KImcvMimePrompt))
+			DoMimeVersion();
+		else if(MatchAndRemoveToken(KImcvContentType))
+			DoContentTypeL();
+		else if(MatchAndRemoveToken(KImcvContentLocation))
+			DoContentLocationL();
+		else if(MatchAndRemoveToken(KImcvContentTransferEncoding))
+			DoEncodingL();
+		else if(MatchAndRemoveToken(KImcvContentId))
+			{
+			RemoveSurroundingCharacters(KImcvLeftChevron, KImcvRightChevron, *iMimeHeaderLine);
+			DoContentIdL();
+			}
+		else if(MatchAndRemoveToken(KImcvContentDescription))
+			DoDescriptionL();
+		else if(MatchAndRemoveToken(KImcvContentDisposition))
+			DoDispositionL();
+		else if(MatchAndRemoveToken(KImcvContentBase))
+			DoContentBaseL();
+		}
+		
+	delete iMimeHeaderLine;	// clean up and null pointer iff CompleteMimeHeader and no foldover append req'd
+	iMimeHeaderLine=NULL;
+	}
+
+
+/**
+DoMimeVersion()
+*/
+void CLocalMimeParser::DoMimeVersion()
+	{
+	// extract the MIME version from a header line which we already know
+	// has 'MIME-Version' start of it.
+	if(MatchAndRemoveToken(KImcvMimeVersion))
+		iCorrectMimeVersion = ETrue;
+	}
+
+
+/**
+DoContentIdL()
+*/
+void CLocalMimeParser::DoContentIdL()
+	{
+	iMimeHeader->SetContentIDL(iMimeHeaderLine->Des());
+	if(iStartId && iStartId->CompareF(iMimeHeaderLine->Des())==KErrNone)
+		iStartPart=ETrue;
+	}
+
+
+/**
+DoContentLocationL()
+*/
+void CLocalMimeParser::DoContentLocationL()
+	{
+	TInt len = (*iMimeHeaderLine).Length();
+	if (len == 0)
+		return;
+			
+	RemoveSurroundingCharacters(KImcvQuote, KImcvQuote, *iMimeHeaderLine);
+
+	HBufC16* locationBuf = HBufC16::NewL( len );
+	CleanupStack::PushL(locationBuf);
+	TPtr locationPtr(locationBuf->Des());
+	iImRecvConvert.iHeaderConverter->DecodeHeaderFieldL( iMimeHeaderLine->Des(), locationPtr);
+	iMimeHeader->SetContentLocationL(locationPtr);
+	CleanupStack::PopAndDestroy(); // locationBuf
+	}
+
+
+/**
+DoContentBaseL()
+*/
+void CLocalMimeParser::DoContentBaseL()
+	{
+	RemoveSurroundingCharacters(KImcvQuote, KImcvQuote, *iMimeHeaderLine);
+	iMimeHeader->SetContentBaseL(iMimeHeaderLine->Des());
+	}
+
+
+/**
+DoAttachmentTypeL()
+*/
+void CLocalMimeParser::DoAttachmentTypeL()
+	{
+	iImRecvConvert.iEntryType = CLocalImRecvConvert::EAttachmentEntry;
+	iImRecvConvert.iCurrentPartIsRichText = EFalse;	
+
+	if(MatchAndRemoveToken(KImcvForwardSlash))
+		{
+		if(MatchAndRemoveToken(KImcvBmp))
+			{
+			iMimeHeader->SetContentSubTypeL(KImcvBmp);
+			}
+		else
+		if(MatchAndRemoveToken(KImcvGif))
+			{
+			iMimeHeader->SetContentSubTypeL(KImcvGif);
+			}
+		else
+		if(MatchAndRemoveToken(KImcvJpeg))
+			{
+			iMimeHeader->SetContentSubTypeL(KImcvJpeg);
+			}
+		else
+		if(MatchAndRemoveToken(KImcvTiff))
+			{
+			iMimeHeader->SetContentSubTypeL(KImcvTiff);
+			}
+		else
+		if(MatchAndRemoveToken(KImcvWav))
+			{
+			iMimeHeader->SetContentSubTypeL(KImcvWav);
+			}
+		else
+		if(MatchAndRemoveToken(KImcvZip))
+			{
+			iMimeHeader->SetContentSubTypeL(KImcvZip);
+			}
+		else
+		if(MatchAndRemoveToken(KImcvOctetStream))
+			{
+			iMimeHeader->SetContentSubTypeL(KImcvOctetStream);
+			}
+		else
+		if(MatchAndRemoveToken(KImcvExe))
+			{
+			iMimeHeader->SetContentSubTypeL(KImcvExe);
+			}
+		else
+		if(MatchAndRemoveToken(KImcvCmd))
+			{
+			iMimeHeader->SetContentSubTypeL(KImcvCmd);
+			}
+		else
+		if(MatchAndRemoveToken(KTImcvDrm))
+			{ // added this to handle DRM files
+			iMimeHeader->SetContentSubTypeL(KTImcvDrm);
+			}
+		}
+	}
+
+
+/**
+DoMessageTypeL()
+*/
+void CLocalMimeParser::DoMessageTypeL()
+	{
+	iImRecvConvert.iEntryType = CLocalImRecvConvert::EMessageEntry;
+	iImRecvConvert.iEmailPart = CLocalImRecvConvert::KParentPart;
+	
+	iContentType=EMimeMessage; 
+	iMimeHeader->SetContentTypeL(KImcvMessage);
+
+	if(MatchAndRemoveToken(KImcvForwardSlash))
+		{
+		if(MatchAndRemoveToken(KImcvRfc822))
+			{
+			//iMessageFolderType=EFolderTypeRFC822;
+			iMimeHeader->SetContentSubTypeL(KImcvRfc822);
+			}
+		else if(MatchAndRemoveToken(KImcvExternal))
+			{
+			iMessageFolderType=EFolderTypeExternal;
+			iMimeHeader->SetContentSubTypeL(KImcvExternal);
+			}
+		else if(MatchAndRemoveToken(KImcvPartial))
+			{
+			iMessageFolderType=EFolderTypePartial;
+			iMimeHeader->SetContentSubTypeL(KImcvPartial);
+			}
+		else if(MatchAndRemoveToken(KImcvDeliveryStatus))
+			{
+			// We do not process this part. So store as text.
+			iMimeHeader->SetContentSubTypeL(KImcvDeliveryStatus);
+			iImRecvConvert.iEntryType = CLocalImRecvConvert::EAttachmentEntry;
+			iImRecvConvert.iEmailPart = CLocalImRecvConvert::KNoPart;
+			iContentType=EMimeUnknownContent; 
+			iImRecvConvert.iCurrentPartIsRichText=EFalse;
+			iImRecvConvert.iAttachmentName.Copy(KImcvDeliveryStatus);
+			iImRecvConvert.iAttachmentName.Append(KTextExtension);
+			}
+		else
+			{
+			iMessageFolderType=EFolderTypeUnknown;
+			iMimeHeader->SetContentSubTypeL(KImcvUnknown);
+			}
+		}	
+	}
+
+
+/**
+DoMultipartTypeForNonMIMEL()
+*/
+void CLocalMimeParser::DoMultipartTypeForNonMIMEL()
+	{
+	ResetForNewEntry();
+	iMessageFolderType=EFolderTypeMixed;
+	iMimeHeader->SetContentTypeL(KImcvMultipart);
+	iMimeHeader->SetContentSubTypeL(KImcvMixed);
+	}
+
+
+/**
+DoMultipartTypeL()
+*/
+void CLocalMimeParser::DoMultipartTypeL()
+	{
+	iImRecvConvert.iEntryType = CLocalImRecvConvert::EFolderEntry;
+	iImRecvConvert.iEmailPart = CLocalImRecvConvert::KMultiPart;
+	
+	iContentType=EMimeMultipart;
+	iMimeHeader->SetContentTypeL(KImcvMultipart);
+
+	if(MatchAndRemoveToken(KImcvForwardSlash))
+		{
+		if(MatchAndRemoveToken(KImcvMixed))
+			{
+			iMessageFolderType=EFolderTypeMixed;
+			iMimeHeader->SetContentSubTypeL(KImcvMixed);
+			}
+		else if(MatchAndRemoveToken(KImcvRelated))
+			{
+			iMessageFolderType=EFolderTypeRelated;
+			iMimeHeader->SetContentSubTypeL(KImcvRelated);
+			}
+		else if(MatchAndRemoveToken(KImcvAlternative))
+			{
+			iMessageFolderType=EFolderTypeAlternative;
+			iMimeHeader->SetContentSubTypeL(KImcvAlternative);
+			}
+		else if(MatchAndRemoveToken(KImcvEncrypted))
+			{
+//	Add this when Encryption is handled iMessageFolderType=EFolderTypeEncrypted;
+			iMimeHeader->SetContentSubTypeL(KImcvEncrypted);
+			}
+		else if(MatchAndRemoveToken(KImcvParallel))
+			{
+			iMessageFolderType=EFolderTypeParallel;
+			iMimeHeader->SetContentSubTypeL(KImcvParallel);
+			}
+		else if(MatchAndRemoveToken(KImcvDigest))
+			{
+			iMessageFolderType=EFolderTypeDigest;
+			iMimeHeader->SetContentSubTypeL(KImcvDigest);
+			isMessageDigest=ETrue;
+			}
+		else if(MatchAndRemoveToken(KImcvSigned))
+			{
+//	Add this when Signed is handled	iMessageFolderType=EFolderTypeSigned;
+			iMimeHeader->SetContentSubTypeL(KImcvSigned);
+			}
+		else if(MatchAndRemoveToken(KImcvReport))
+			{
+			iMimeHeader->SetContentSubTypeL(KImcvReport);
+			}
+		else
+			{
+			iMessageFolderType=EFolderTypeUnknown;
+			iMimeHeader->SetContentSubTypeL(KImcvUnknown);
+			}
+		}
+
+	if (iMessageFolderType==EFolderTypeRelated)
+		iImRecvConvert.iParent->At(0).iFolder=iMessageFolderType; 
+
+	// Find any parameters specific to a Multipart content type	
+
+	HBufC8* paramValue = NULL;
+
+	// Extracts the boundary string
+
+	ExtractParameterInfoL(KImcvBoundary, paramValue);
+	if( paramValue!=NULL ) 
+		{
+		CleanupStack::PushL(paramValue);
+		iBoundaryFound = ETrue;
+		iImRecvConvert.iEmailPart = CLocalImRecvConvert::KMultiPart;
+		SetBoundaryL(*paramValue);
+		CleanupStack::PopAndDestroy(paramValue);
+		}
+
+	// Extracts start ID if it has been defined;
+
+	ExtractParameterInfoL(KImcvStartPart, paramValue);
+	if( paramValue!=NULL )
+		{
+		delete iStartId;
+		iStartId=NULL;
+		iStartId = paramValue;
+		}
+	}
+
+
+/**
+DoTextTypeL()
+*/
+void CLocalMimeParser::DoTextTypeL()
+	{
+	HBufC8* paramValue = NULL;
+	
+	iImRecvConvert.iEntryType = CLocalImRecvConvert::ETextEntry;
+	iContentType=EMimeText;		
+	iMimeHeader->SetContentTypeL(KImcvText);
+
+	if(MatchAndRemoveToken(KImcvForwardSlash))
+		{
+		if(MatchAndRemoveToken(KImcvPlain))
+			iMimeHeader->SetContentSubTypeL(KImcvPlain);
+		else
+		if(MatchAndRemoveToken(KImcvHtml))
+			{
+			iMimeHeader->SetContentSubTypeL(KImcvHtml);
+			iImRecvConvert.iEntryType = CLocalImRecvConvert::EHtmlEntry;
+			iImRecvConvert.iCurrentPartIsRichText = EFalse;	
+			}
+		else
+		if(MatchAndRemoveToken(KImcvDirectory))
+			{
+			iMimeHeader->SetContentSubTypeL(KImcvDirectory);
+			iMimeHeader->ContentTypeParams().AppendL(KImcvProfile);
+			ExtractParameterInfoL(KImcvProfile, paramValue);
+			// Assume at right context, the email message, not attachment.
+			
+			iMessageFolderType=EFolderTypeDirectory;
+			if( paramValue!=NULL )
+				{
+				CleanupStack::PushL(paramValue);
+				iMimeHeader->ContentTypeParams().AppendL(*paramValue);
+				if(paramValue->MatchF(KImcvVCard) == 0)
+					{
+					iVCard=ETrue;
+					}
+				CleanupStack::PopAndDestroy(paramValue);
+				}
+			}
+		if(MatchAndRemoveToken(KImcvVCalender))
+			iVCalendar=ETrue;
+
+		// Extract the charset value, 
+
+		ExtractParameterInfoL(KImcvCharset, paramValue);
+
+		if(paramValue!=NULL)
+			{
+			CleanupStack::PushL(paramValue);
+			// check if at top level header or Mime part header
+
+			TUint charsetUid = iImRecvConvert.CharacterConverter().GetMimeCharsetUidL(*paramValue); 
+			if(iImRecvConvert.NotFinishedRfc822Header() == EFalse)
+				iCharset=charsetUid;
+
+			// Store in CMimeHeader::iContentTypeParams
+			iMimeHeader->ContentTypeParams().AppendL(KImcvCharset);
+			iMimeHeader->ContentTypeParams().AppendL(*paramValue);
+			CleanupStack::PopAndDestroy(paramValue);
+
+			if (!iImRecvConvert.CharacterConverter().PrepareToConvertToFromOurCharsetL(charsetUid))
+				charsetUid=KUidMsvCharsetNone;
+			iMimeHeader->SetMimeCharset(charsetUid);
+			}
+		else
+			iMimeHeader->SetMimeCharset(iDefaultCharset);
+		}
+	}
+
+
+/**
+DoContentTypeL()
+*/
+void CLocalMimeParser::DoContentTypeL()
+	{
+	RemoveSurroundingCharacters(KImcvLeftChevron, KImcvRightChevron, *iMimeHeaderLine);
+
+	if(MatchAndRemoveToken(KImcvText))
+		DoTextTypeL();
+	else
+	if(MatchAndRemoveToken(KImcvMultipart))
+		DoMultipartTypeL();
+	else
+	if(MatchAndRemoveToken(KImcvMessage))
+		DoMessageTypeL();
+	else
+	if(MatchAndRemoveToken(KImcvImage))
+		{	
+		iContentType=EMimeImage; 
+		iMimeHeader->SetContentTypeL(KImcvImage);
+		DoAttachmentTypeL();
+		}
+	else
+	if(MatchAndRemoveToken(KImcvApplication))
+		{
+		iContentType=EMimeApplication; 
+		iMimeHeader->SetContentTypeL(KImcvApplication);
+		DoAttachmentTypeL();
+		}
+	else
+	if(MatchAndRemoveToken(KImcvAudio))
+		{
+		iContentType=EMimeAudio; 
+		iMimeHeader->SetContentTypeL(KImcvAudio);
+		DoAttachmentTypeL();
+		}
+	else
+	if(MatchAndRemoveToken(KImcvVideo))
+		{
+		iContentType=EMimeVideo; 
+		iMimeHeader->SetContentTypeL(KImcvVideo);
+		DoAttachmentTypeL();
+		}
+	else
+		{
+		iContentType=EMimeUnknownContent; 
+		iMimeHeader->SetContentTypeL(KImcvUnknown);
+		}
+
+	// Extract the filename if it exists
+	HBufC* paramStore = HBufC::NewLC(MaxMimeParameterValueLength);
+	HBufC8* paramStore8 = HBufC8::NewLC(KMimeEncodedParameterSize);
+	TPtr paramValue(paramStore->Des());
+	TPtr8 paramValue8(paramStore8->Des());
+
+	ExtractParameterInfoL(KImcvMimeTypeName, paramValue,paramValue8);
+	if(paramValue.Length())
+		{
+		iMimeHeader->ContentTypeParams().AppendL(KImcvMimeTypeName);
+		iMimeHeader->ContentTypeParams().AppendL(paramValue8);
+		iImRecvConvert.SetAttachmentName(paramValue);
+		}
+	
+	CleanupStack::PopAndDestroy(2,paramStore); 
+	}
+
+
+/**
+DoEncodingL()
+*/
+void CLocalMimeParser::DoEncodingL()
+	{
+	iMimeHeader->SetContentTransferEncodingL(*iMimeHeaderLine);
+
+	switch ((*iMimeHeaderLine)[0])
+		{
+		case '7': // 7bit
+			iContentEncoding = EEncodingType7Bit;
+			break;
+		case '8': // 8bit
+			iContentEncoding = EEncodingType8Bit;
+			break;
+		case 'q': // quoted-printable
+		case 'Q': 
+			iContentEncoding = EEncodingTypeQP;
+			break;
+		case 'b': // binary or base64
+		case 'B':
+			iContentEncoding = ((*iMimeHeaderLine)[1] == 'i' || (*iMimeHeaderLine)[1] == 'I' ? EEncodingTypeBinary : EEncodingTypeBASE64);
+			break;
+		case 'x': //in order to support UU encoded within a MIME message
+		case 'X':
+			iContentEncoding = ((*iMimeHeaderLine).FindF(KImcvXUUString)==KErrNotFound ? EEncodingTypeUnknown : EEncodingTypeUU);
+			break;
+		default:
+			iContentEncoding = EEncodingTypeUnknown;
+			break;
+		}
+	}
+
+
+/**
+DoDescriptionL()
+*/
+void CLocalMimeParser::DoDescriptionL()
+	{
+	TPtrC8 marked(iMimeHeaderLine->Des());
+	if (marked.Length()>KMaxFileName)
+		marked.Set(marked.Left(KMaxFileName));
+
+	iContentDescription.Copy(marked);
+
+	// remove the CRLF
+
+	TInt length = iContentDescription.Length();
+	if (length>2)
+		{
+		if (iContentDescription[length-2]==KImcvCR && iContentDescription[length-1]==KImcvLF)
+			iContentDescription.SetLength(length-2);
+		}
+	iMimeHeader->SetContentDescriptionL(marked);
+	}
+
+
+/**
+DoDispositionL()
+*/
+void CLocalMimeParser::DoDispositionL()
+	{
+	TBool inLine = EFalse;
+	if(MatchAndRemoveToken(KImcvAttachment))
+		{
+		iMimeHeader->SetContentDispositionL(KImcvAttachment);
+		if (iMimeHeader->ContentSubType()!=KImcvRfc822)
+			{
+			iImRecvConvert.iCurrentPartIsRichText = EFalse;	
+			}
+		if (iImRecvConvert.iEntryType!=CLocalImRecvConvert::EMessageEntry)
+			{
+			iImRecvConvert.iEntryType = CLocalImRecvConvert::EAttachmentEntry;
+			}
+		}
+	else if(MatchAndRemoveToken(KImcvInline))
+		inLine = ETrue;
+
+	// Extract the filename if it exists, unless we already have a name for it	
+	if(!iImRecvConvert.iAttachmentName.Length())
+		{
+		HBufC* paramStore = HBufC::NewLC(KHeaderBufferLength);
+		TPtr paramValue(paramStore->Des());
+		HBufC8* paramStore8 = HBufC8::NewLC(KMimeEncodedParameterSize);
+		TPtr8 paramValue8(paramStore8->Des());
+
+		ExtractParameterInfoL(KImcvMimeDispositionFilename, paramValue,paramValue8);
+		if(paramValue.Length())
+			{
+			iMimeHeader->ContentTypeParams().AppendL(KImcvMimeDispositionFilename);
+			iMimeHeader->ContentTypeParams().AppendL(paramValue8);
+			iImRecvConvert.SetAttachmentName(paramValue);
+			}
+
+		CleanupStack::PopAndDestroy(2,paramStore); // paramStore, paramStore8
+		}
+
+		if(inLine)
+ 		{
+ 		// Content Disposition set to inline
+ 		if (iImRecvConvert.iAttachmentName.Length())
+ 			// filename exists
+ 			{
+ 			iMimeHeader->SetContentDispositionL(KImcvAttachment);
+ 			iImRecvConvert.iCurrentPartIsRichText = EFalse;	
+			if (iImRecvConvert.iEntryType!=CLocalImRecvConvert::EMessageEntry)
+ 				{
+ 				iImRecvConvert.iEntryType = CLocalImRecvConvert::EAttachmentEntry;
+ 				}
+ 			}
+ 		else
+ 			iMimeHeader->SetContentDispositionL(KImcvInline);
+ 		}
+	}
+
+
+/**
+ContentSubType()
+
+@return
+*/  
+TPtrC8 CLocalMimeParser::ContentSubType() const  
+	{
+	return iMimeHeader->ContentSubType();;
+	}
+
+
+/**
+VCard()
+
+@return
+*/  
+TBool CLocalMimeParser::VCard() const  
+	{
+	return iVCard;
+	}
+
+
+/**
+VCalendar()
+
+@return
+*/  
+TBool CLocalMimeParser::VCalendar() const  	
+	{
+	return iVCalendar;
+	}
+
+
+/**
+StartPart()
+
+@return
+*/  
+TBool CLocalMimeParser::StartPart() const  
+	{
+	return iStartPart;
+	}
+
+
+/**
+MessageFolderType()
+
+@return
+*/  
+TImEmailFolderType CLocalMimeParser::MessageFolderType() const  
+	{
+	return iMessageFolderType;
+	}
+
+
+/**
+SetMessageFolderType()
+
+@param aFolderType
+*/  
+void CLocalMimeParser::SetMessageFolderType(TImEmailFolderType aFolderType)  
+	{
+	iMessageFolderType=aFolderType;
+	}
+
+
+/**
+SetBoundaryL()
+
+@param aBoundaryText
+*/  
+void CLocalMimeParser::SetBoundaryL(const TDesC8& aBoundaryText)  
+	{
+	TBuf8<KMaxBoundaryTextLength+2> tempBoundary(KImcvMimeBoundaryStartEnd);
+	// From RFC 1521, (Boundaries) must be no longer than 70 characters.
+	// Including beginning and end "--" 
+	if (aBoundaryText.Length()>70)
+		tempBoundary.Append(aBoundaryText.Left(70));
+	else
+		tempBoundary.Append(aBoundaryText);
+	iBoundaryText->AppendL(tempBoundary);
+
+	iBoundaryIndex = iBoundaryText->MdcaCount(); //iBoundaryIndex stores a count value not the index here
+	iBoundaryIndex = (iBoundaryIndex)? --iBoundaryIndex: 0;
+	iBoundaryLength = iBoundaryText->MdcaPoint(iBoundaryIndex).Length();
+	}
+
+
+/**
+IsBoundary()
+
+@param aSourceLine
+ @return
+*/
+TBool CLocalMimeParser::IsBoundary(const TDesC8& aSourceLine)
+	{
+	if(iBoundaryText->MdcaCount())
+		{
+		TInt found = 0;
+		TInt aLineLength = aSourceLine.Length();
+		TInt compareLength = aLineLength > iBoundaryLength ? iBoundaryLength : aLineLength;
+		TPtrC8 tempSourceLine(aSourceLine.Ptr(), compareLength);
+	
+		TInt error = iBoundaryText->Find(tempSourceLine, found, ECmpNormal);
+
+		if(error||(!iBoundaryLength))
+			return KBoundaryNotFound;
+	
+		// The following code is executed only if aSourceLine is a boundary
+		if(found != iBoundaryIndex)
+			{
+			iReceiveError = (iReceiveError)? iReceiveError: KBoundaryError;
+			iBoundaryIndex = found;
+			iBoundaryText->Delete(found++);
+			}
+	
+		if(aLineLength >= iBoundaryLength+4) // allow for CRLF & then check for the double hyphen
+			{
+			if((aSourceLine[iBoundaryLength] == KImcvHyphen) && (aSourceLine[iBoundaryLength+1] == KImcvHyphen))
+				iTerminatingBoundary = ETrue; // this is a terminating boundary
+			}
+		else
+			iTerminatingBoundary = EFalse;
+	
+		return KBoundaryFound;
+		}
+	
+	return KBoundaryNotFound;
+	}
+
+
+/**
+RemoveBoundary()
+*/
+void CLocalMimeParser::RemoveBoundary()
+	{
+	iBoundaryText->Delete(iBoundaryIndex);
+	if(iBoundaryText->MdcaCount())
+		{
+		iBoundaryIndex = iBoundaryText->MdcaCount(); //iBoundaryIndex stores a count value not the index here
+	
+		iBoundaryIndex = (iBoundaryIndex)? --iBoundaryIndex: 0;
+		iBoundaryLength = iBoundaryText->MdcaPoint(iBoundaryIndex).Length();
+		}
+	}
+
+
+/**
+MatchAndRemoveToken()
+
+@param aToken
+@return
+*/
+TBool CLocalMimeParser::MatchAndRemoveToken( const TDesC8& aToken )
+	{
+	TInt comparison;
+	TInt tokenLength = aToken.Length();
+	TInt desLength = (*iMimeHeaderLine).Length();
+	TInt compareLength = tokenLength > desLength ? desLength : tokenLength;
+	TPtrC8 left((*iMimeHeaderLine).Left(compareLength));
+	
+	// now see whether the current line contains the search string
+	comparison = left.CompareF(aToken);
+	if (!comparison)
+		{
+		// found the match string at the start of the output line, so remove it
+		iMimeFieldsExist=ETrue;
+		isMime=ETrue;
+		// get rid of any whitespace betweebn the tag and the data while we have a chance
+		TInt whitespaceLength=0;
+		TInt maxLength=desLength-tokenLength;
+		const TUint8* ptr = (*iMimeHeaderLine).Ptr();
+		while ( whitespaceLength <= maxLength && (ptr[tokenLength+whitespaceLength] == KImcvSP || ptr[tokenLength+whitespaceLength] == KImcvTab) )
+			whitespaceLength++;
+		iMimeHeaderLine->Des().Delete(0, tokenLength+whitespaceLength);
+
+		// Reset iLex, so its length is updated.
+		iLex = *iMimeHeaderLine;
+		}
+	return (comparison==0);
+	}
+
+
+/**
+IsSpecialChar()
+
+@param aChar
+@return
+*/
+TBool CLocalMimeParser::IsSpecialChar( const TUint8 aChar )
+	{
+	return (aChar == '(' || aChar == ')' || aChar == '<' || aChar == '>' || aChar == '@' 
+		 || aChar == ',' || aChar == ';' || aChar == ':' || aChar == '\\'|| aChar == '"' 
+		 || aChar == '/' || aChar == '[' || aChar == ']' || aChar == '?' || aChar == '=');
+	}
+
+
+/**
+ExtractParameterInfoL()
+Implicitly the parameter ASSUMED TO BE is not encoded as return parameter, rBuffer,
+is 8 bit. iLex should currently be pointing at the space after content-type description.
+
+@param aTag
+@param rBuffer
+*/
+void CLocalMimeParser::ExtractParameterInfoL(const TDesC8& aTag, HBufC8*& rBuffer)
+	{	
+	rBuffer = NULL;
+
+	TLexMark8 mark;
+	TInt offset;
+
+	if( (offset=iLex.Remainder().FindF(aTag)) != KErrNotFound )
+		{
+		// move past the tag	
+		iLex.Inc(offset+aTag.Length());
+
+		// Default : no charset info or folding
+		// move forward to the start of the boundary string itself.
+
+		while (iLex.Peek() != KImcvEquals  && !iLex.Eos())
+			iLex.Inc(); 
+
+		TPtrC8 paramBuffer(ExtractParameterString(mark));
+		if( paramBuffer.Length() > 0 )
+			{
+			rBuffer = paramBuffer.AllocL();
+			}
+		}
+	}
+
+
+/**
+ExtractParameterInfoL()
+iLex should currently be pointing at the space after content-type description.
+
+@param aTag
+@param rBuffer
+@param rBuffer8
+*/
+void CLocalMimeParser::ExtractParameterInfoL(const TDesC8& aTag, TDes16& rBuffer, TDes8& rBuffer8)
+	{
+	TInt offset;
+
+	rBuffer.Copy(KNullDesC);
+
+	// we need to extract the <aTag> text from the same line
+	// iLex should currently be pointing at the space after content-type description
+
+	if( (offset=iLex.Remainder().FindF(aTag))!=KErrNotFound )
+		{
+		// Check which type of encoding present.
+
+		TLexMark8 initMark;
+		iLex.Mark(initMark);
+		TLexMark8 mark;
+		iLex.Inc(offset+aTag.Length()); 	// move past the tag
+
+		const TPtrC8 param = ExtractParameterString(mark);
+
+		rBuffer8.Copy(param);
+
+		if ( ParseRfc2047ParameterInfoL(param, rBuffer) == EFalse )
+			{
+			iLex.UnGetToMark(initMark);
+			ParseRfc2231ParameterInfoL(aTag, rBuffer, offset );
+			}
+		}
+	}
+
+
+/**
+ParseRfc2047ParameterInfoL()
+Detect encoding of form =?charset?Q?" Text "?=
+
+@param aParam
+@param rBuffer
+@return
+*/
+TBool CLocalMimeParser::ParseRfc2047ParameterInfoL(const TDesC8& aParam, TDes& rBuffer)
+	{
+	TBool parameterPresent = EFalse;
+
+	// Check for =? somewhere in text.
+
+	if ( aParam.Find(KImcvEncodedWordStart) != KErrNotFound )
+		{
+		// Make assumption that '=?' appearing in parameter means 
+		//it is part of encoding
+	
+		parameterPresent = ETrue;
+		iImRecvConvert.iHeaderConverter->DecodeHeaderFieldL(aParam, rBuffer);
+		}
+	return parameterPresent;
+	}
+
+
+/**
+ParseRfc2231ParameterInfoL()
+For extracting parameter data following Mime header fields, in the format
+*(;tag=data). As specified in rfc2231
+Assumes parameter data seperated by ';'
+Takes tag(name) of parameter as input, returning a descriptor with the data
+
+@param aTag
+@param rBuffer
+@param aOffset
+@return
+*/
+TBool CLocalMimeParser::ParseRfc2231ParameterInfoL(const TDesC8& aTag, TDes& rBuffer, TInt aOffset)
+	{
+	TBool parameterPresent = ETrue;
+
+	// For storing extracted parameter information
+
+	HBufC8* info = HBufC8::NewLC(KHeaderBufferLength);
+
+	// For storing information relating to parameter extraction/conversion
+
+	TInt count = 0;
+
+	TPtrC8 charset8;
+	TPtrC8 language8;
+	
+	// Following rfc 2231, parameter may be encoded & folded in the following way
+	//
+	// <name>*0*=us-ascii'en'<encoded data>
+	// <name>*1*=< more encoded data>
+	// <name>*2=<unencoded info>
+
+	do 
+		{
+		// move past the tag	
+		iLex.Inc(aOffset+aTag.Length());
+
+		if (iLex.Peek() != KImcvAny) 
+			{
+			// Default : no charset info or folding
+			// move forward to the start of the boundary string itself
+
+			while (iLex.Peek() != KImcvEquals  && !iLex.Eos())
+				iLex.Inc();
+			}
+		else	// *, Parameter is encoded
+			{
+			iLex.Inc(); // Past '*'
+
+			// If parameter folded :- need to get several bits of data and join together.
+		
+			if ( iLex.Peek()!=KImcvEquals) // Get Number
+				{
+				iLex.Mark(); // Beginnig of number
+				iLex.Inc();
+				while (iLex.Peek() != KImcvEquals && iLex.Peek() != KImcvAny && !iLex.Eos())
+					iLex.Inc(); 
+				TPtrC8 numPtr = iLex.MarkedToken();
+				TLex8 lex(numPtr);
+				lex.Val(count);  // Store number in count.
+
+				if (iLex.Peek() == KImcvAny)
+					iLex.Inc(); // Past *
+				}
+
+
+			// Must get charset & language information etc..
+
+			if (!count)
+				{
+
+				iLex.Inc(); // Past '='
+
+				if (iLex.Peek()==KImcvQuote)
+					iLex.Inc(); 
+
+				// Extract CHARSET token
+				iLex.Mark();
+				while (iLex.Peek() != KImcvSingleQuote && !iLex.Eos())
+					iLex.Inc(); 
+				TPtrC8 marked = iLex.MarkedToken();
+
+				charset8.Set(marked );
+				iLex.Inc(); // Past ' 
+
+				// Extract LANGUAGE token
+				iLex.Mark();
+				while (iLex.Peek() != KImcvSingleQuote && !iLex.Eos())
+					iLex.Inc(); 
+				TPtrC8 marked1 = iLex.MarkedToken();
+				language8.Set(marked1);
+				}
+
+			} // else, param encoded
+				
+		TLexMark8 mark;
+		TPtrC8 param = ExtractParameterString(mark);
+
+		// Save parameter data
+		TInt maxlen=info->Des().MaxLength();
+		if ((*info).Length() + param.Length() > maxlen )
+			{
+			info = info->ReAllocL(maxlen + param.Length() + MaxMimeParameterValueLength);
+		 CleanupStack::Pop();
+			CleanupStack::PushL(info); 
+			}
+		info->Des().Append( param );
+
+
+		} while( ( aOffset=iLex.Remainder().FindF(aTag))!=KErrNotFound );
+
+	TPtr8 infoPtr(info->Des());	
+	
+	DecodeRfc2231ParameterInfoL( infoPtr, rBuffer, charset8/*, language8*/ );
+
+	CleanupStack::PopAndDestroy(info); 
+	return parameterPresent;
+	}
+
+
+/**
+DecodeRfc2231ParameterInfoL()
+
+@param aInput
+@param rBufOut
+@param aCharset
+@return
+*/
+TBool CLocalMimeParser::DecodeRfc2231ParameterInfoL(TDes8& aInput, TDes& rBufOut, TPtrC8 aCharset/*, TPtrC8 aLanguage*/)
+	{
+	HBufC8* QPdecodedbuf = HBufC8::NewLC( aInput.Length() );
+	TPtr8 ptr(QPdecodedbuf->Des());
+
+	iImRecvConvert.iQPCodec.SetQPChar(KImcvPercentSign);
+	iImRecvConvert.iQPCodec.Decode( aInput, ptr);
+	iImRecvConvert.iQPCodec.SetQPChar(KImcvEquals);
+
+	// Convert parameter, based on charset supplied.
+	CImConvertCharconv& charconv = iImRecvConvert.CharacterConverter();
+	TUint id = charconv.GetMimeCharsetUidL( aCharset);
+
+	if(id==KUidMsvCharsetNone)
+		{
+		id=charconv.SystemDefaultCharset();
+		}
+
+	if (!charconv.PrepareToConvertToFromOurCharsetL(id))
+		{
+		rBufOut.Copy(ptr);
+		}
+	else
+		{
+		// Charset found, so do conversion
+		TInt unconverted;
+		TInt indexOfFirst;
+		TInt rem = charconv.ConvertToOurCharsetL(ptr, rBufOut, unconverted, indexOfFirst);
+		if (rem < 0) // error
+			Append(rBufOut, ptr);
+		else if (rem && rem < KConversionRemainderLength)
+			rBufOut.Copy(ptr);	
+
+		}
+	
+	CleanupStack::PopAndDestroy(QPdecodedbuf);
+	return ETrue;
+	}
+
+
+/**
+ExtractParameterString()
+Check for delimiter & mark parameter text string
+
+@param rMark
+@return
+*/
+TPtrC8 CLocalMimeParser::ExtractParameterString(TLexMark8& rMark)
+	{
+	// move on to the first char of the boundary ; this MIGHT be a double-quote
+
+	TBool delimited = EFalse;
+	iLex.Inc();
+				
+	if ( iLex.Peek() == KImcvDoubleQuote )
+		{
+		delimited = ETrue;
+		iLex.Inc();
+		}
+
+	while ( iLex.Peek().IsSpace() )
+		iLex.Inc();
+
+	iLex.Mark( rMark );
+
+	TBool finished = EFalse;
+	while ( !finished  && !iLex.Eos() )
+		{
+		iLex.Inc();
+
+		if ( delimited )
+			finished = (iLex.Peek() == KImcvDoubleQuote);
+		else
+			finished = ( iLex.Peek().IsSpace() || IsSpecialChar((TUint8)iLex.Peek()) );
+		} 
+
+	return iLex.MarkedToken( rMark );
+	}
+
+
+/**
+CurrentCharsetL()
+Which charset to use .. ? If the body part charset set, use that.
+else if the main header charset set, use that... else default to us-ascii.
+
+@return
+*/
+TUint CLocalMimeParser::CurrentCharsetL() const
+	{
+	TPtrC8 paramCharset = GetContentTypeValue(KImcvCharset);
+
+	TUint charsetId;
+	if (paramCharset.Length())
+		// charset parameter present.
+		charsetId = iImRecvConvert.CharacterConverter().GetMimeCharsetUidL(paramCharset);
+	else if (iCharset) 
+		// Main Mime header has default charset value.
+		charsetId = iCharset;
+	else
+		charsetId = iDefaultCharset;
+
+	return charsetId;		
+	}
+
+
+/**
+GetContentTypeValue()
+
+@param aContentTypeParameter
+@return
+*/
+const TPtrC8 CLocalMimeParser::GetContentTypeValue(const TDesC8& aContentTypeParameter) const
+	{
+	CDesC8Array& contentTypeParams = iMimeHeader->ContentTypeParams();
+	__ASSERT_DEBUG(!(contentTypeParams.Count()&1), User::Invariant());
+
+	TInt result;
+	if (KErrNone == contentTypeParams.Find(aContentTypeParameter,result,ECmpFolded8))
+		{
+		result++;
+		if ((result&1) && result <= contentTypeParams.Count())    
+			{       
+			// check result+1 is odd & entry exists
+			return iMimeHeader->ContentTypeParams()[result];
+			}
+		}
+	return TPtrC8();        // couldn't find match so return an empty descriptor
+	}
+
+
+/**s
+EntryId()
+
+@return
+*/
+TMsvId CLocalImRecvConvert::EntryId()
+	{
+	// If we are temporarily on the null entry then return the saved entry
+	if (iServerEntry->Entry().Id() == KMsvNullIndexEntryId)
+		{
+		return iSavedEntryId;
+		}
+	else
+		{
+		return iServerEntry->Entry().Id();
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/src/Local_imutdll.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,79 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+*/
+
+#include <e32std.h>
+#include <f32file.h>	// RFs
+#include <barsc.h>		// RResourceFile
+#include <bautils.h>	// Bafl::
+#include <msvutils.h>
+#include <imcvtext.h>
+#include "local_imutdll.h"
+
+#include <miuthdr.h>	// resource file name
+
+_LIT(KMTFName,"Messaging Test Framework");
+
+
+/**
+OpenResourceFileL()
+Opens a file using the file server session
+
+@param rFile
+@param anFs
+*/
+GLDEF_C void OpenResourceFileL(RResourceFile& rFile, RFs& anFs)
+	{
+	// open resource file
+	TFileName fileName(KImEngineResourceFile);
+	MsvUtils::AddPathAndExtensionToResFileL(fileName);
+	BaflUtils::NearestLanguageFile( anFs, fileName );
+	if (BaflUtils::FileExists(anFs,fileName))
+ 		{
+		rFile.OpenL( anFs, fileName );
+ 		return;
+ 		}
+ 
+	User::Leave(KErrNotFound);
+	}
+
+
+/**
+gPanic()
+
+@param aReason
+@panic 
+*/
+GLDEF_C void gPanic( TImutErrorReason aReason)
+	{
+	User::Panic( KMTFName,aReason);
+	}
+
+
+/**
+CloseResourceFile()
+Closes a opened file
+
+@param file
+*/
+GLDEF_C void CloseResourceFile( TAny* file )
+	{
+	((RResourceFile*)file)->Close();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/src/T_CheckSmtpBMSetting.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,111 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// CheckSmtpBMSetting
+// [Paramaters]
+// SmtpAccountName			:Name of the Smtp account.
+// ExpectedBMSupport		:ETrue => Bearer mobility is expected to be supported by the SMTP service.
+// EFalse => Bearer mobility is not expected to be supported by the SMTP service.
+// Checks if bearer mobility is supported by the SMTP service.
+// 
+//
+
+//User includes
+#include "T_CheckSmtpBMSetting.h"
+#include <t_utils.h>
+#include <t_utilsenumconverter.h>
+#include <t_utilscentralrepository.h>
+
+//Epoc include
+#include <iapprefs.h>
+
+//Literals used
+_LIT(KSmtpAccountName,"SmtpAccountName");
+_LIT(KExpectedBMSupport,"ExpectedBMSupport");
+
+/**
+  Function : CT_MsgCheckSmtpBMSetting
+  Description : Constructor 
+  @param : aSharedDataSMTP Reference to CT_MsgSharedDataSmtp
+  @return : N/A
+*/
+CT_MsgCheckSmtpBMSetting::CT_MsgCheckSmtpBMSetting(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+:CT_MsgSyncStepSMTP(aSharedDataSMTP)
+	{
+	SetTestStepName(KCheckSmtpBMSetting);
+	}
+	
+/**
+  Function : ReadIni
+  Description :Reads the corresponding .ini file and returns EPass or EFail if any of the inputs are missing
+  @return : TBool
+*/
+TBool CT_MsgCheckSmtpBMSetting::ReadIni()
+	{
+	TBool result = ETrue;
+	
+	if(!GetStringFromConfig(ConfigSection(), KSmtpAccountName, iSmtpAccountName))
+		{
+		ERR_PRINTF1(_L("Smtp account name is not specified"));
+		SetTestStepResult(EFail);
+		result = EFalse;
+		}
+		
+	if(!GetBoolFromConfig(ConfigSection(), KExpectedBMSupport, iExpectedBMSupport))
+		{
+		ERR_PRINTF1(_L("An expected \"ETrue\" or \"EFalse\" boolean value is not specified for BM support"));
+		SetTestStepResult(EFail);
+		result = EFalse;
+		}
+	
+	return result;
+	}
+
+/**
+  Function : doTestStepL
+  Description : Checks the provisioned BM support for the SMTP account settings of a test case.
+  @return : TVerdict - Test step result
+*/		
+TVerdict CT_MsgCheckSmtpBMSetting::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test Step : CheckSmtpBMSetting"));
+	if(ReadIni())
+		{
+		CEmailAccounts* accounts = CEmailAccounts::NewL();
+		CleanupStack::PushL(accounts);
+		
+		CImSmtpSettings* smtpSettings = new(ELeave) CImSmtpSettings();
+		CleanupStack::PushL(smtpSettings);
+					
+		TSmtpAccount smtpAccountId;
+		CT_MsgUtilsCentralRepository::GetSmtpAccountL((TDes&)iSmtpAccountName, smtpAccountId);
+				
+		accounts->LoadSmtpSettingsL(smtpAccountId, *smtpSettings);
+		
+		TBool actualBMSupport = smtpSettings->BearerMobility();
+		
+		if (actualBMSupport == iExpectedBMSupport)
+			{
+			INFO_PRINTF3(_L("Actual Bearer Mobility Support [%d] does equals Expected Bearer Mobility Support [%d]"),actualBMSupport,iExpectedBMSupport);
+			}
+		else
+			{
+			ERR_PRINTF3(_L("Actual Bearer Mobility Support [%d] does not equal Expected Bearer Mobility Support [%d]"),actualBMSupport,iExpectedBMSupport);
+			SetTestStepResult(EFail);
+			}
+	
+		CleanupStack::PopAndDestroy(2,accounts); // smtpSettings, accounts
+		}
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/src/T_CheckSmtpSNAPSetting.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,134 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// CheckSmtpSNAPSetting
+// [Paramaters]
+// SmtpAccountName			:Name of the Smtp account.
+// ExpectedSNAPDefinition	:ETrue => A SNAP has expected to been provisioned for the SMTP account.
+// EFalse => A SNAP has not expected to been provisioned for the SMTP account.
+// ExpectedSNAPPreference	:Expected SNAP ID (Assuming the SNAP has been defined for the SMTP a/c)
+// This parameter can be ignored if the "ExpectedSNAPDefinition" is EFalse.
+// Checks the provisioned SNAP information for the SMTP account.
+// 
+//
+
+//User includes
+#include "T_CheckSmtpSNAPSetting.h"
+#include <t_utils.h>
+#include <t_utilsenumconverter.h>
+#include <t_utilscentralrepository.h>
+
+//Epoc include
+#include <iapprefs.h>
+
+//Literals used
+_LIT(KSmtpAccountName,"SmtpAccountName");
+_LIT(KSNAPDefined,"ExpectedSNAPDefinition");
+_LIT(KSNAPPreference,"ExpectedSNAPPreference");
+
+/**
+  Function : CT_MsgCheckSmtpSNAPSetting
+  Description : Constructor 
+  @param : aSharedDataSMTP Reference to CT_MsgSharedDataSmtp
+  @return : N/A
+*/
+CT_MsgCheckSmtpSNAPSetting::CT_MsgCheckSmtpSNAPSetting(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+:CT_MsgSyncStepSMTP(aSharedDataSMTP)
+	{
+	SetTestStepName(KCheckSmtpSNAPSetting);
+	}
+	
+/**
+  Function : ReadIni
+  Description :Reads the corresponding .ini file and returns EPass or EFail if any of the inputs are missing
+  @return : TBool
+*/
+TBool CT_MsgCheckSmtpSNAPSetting::ReadIni()
+	{
+	TBool result = ETrue;
+	
+	if(!GetStringFromConfig(ConfigSection(), KSmtpAccountName, iSmtpAccountName))
+		{
+		ERR_PRINTF1(_L("Smtp account name is not specified"));
+		SetTestStepResult(EFail);
+		result = EFalse;
+		}
+		
+	if(!GetBoolFromConfig(ConfigSection(), KSNAPDefined, iExpectedSNAPDefinition))
+		{
+		ERR_PRINTF1(_L("An expected \"ETrue\" or \"EFalse\" boolean value is not specified for the SNAP definition"));
+		SetTestStepResult(EFail);
+		result = EFalse;
+		}
+	
+	return result;
+	}
+
+/**
+  Function : doTestStepL
+  Description : Checks the provisioned SNAP information for the SMTP account settings of a test case.
+  @return : TVerdict - Test step result
+*/		
+TVerdict CT_MsgCheckSmtpSNAPSetting::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test Step : CheckSmtpSNAPSetting"));
+	if(ReadIni())
+		{
+		CEmailAccounts* accounts = CEmailAccounts::NewL();
+		CleanupStack::PushL(accounts);
+		
+		CImIAPPreferences* smtpIapPrefs = CImIAPPreferences::NewLC();
+					
+		TSmtpAccount smtpAccountId;
+		CT_MsgUtilsCentralRepository::GetSmtpAccountL((TDes&)iSmtpAccountName,smtpAccountId);
+				
+		accounts->LoadSmtpIapSettingsL(smtpAccountId, *smtpIapPrefs);	
+		
+		TBool actualSNAPDefintion = smtpIapPrefs->SNAPDefined();
+		
+		if (actualSNAPDefintion == iExpectedSNAPDefinition)
+			{
+			if (actualSNAPDefintion)
+				{
+				TInt expectedSNAPPreference = 0;
+				if(!GetIntFromConfig(ConfigSection(), KSNAPPreference, expectedSNAPPreference))
+					{
+					ERR_PRINTF1(_L("An expected SNAP ID value is not specified"));
+					SetTestStepResult(EFail);
+					CleanupStack::PopAndDestroy(2,accounts); // smtpIapPrefs, accounts
+					return TestStepResult();
+					}
+				TInt actualSNAPPreference = smtpIapPrefs->SNAPPreference();
+				
+				if (actualSNAPPreference != expectedSNAPPreference)
+					{
+					ERR_PRINTF3(_L("Actual SNAP ID [%d] does not equal Expected SNAP ID [%d]"),actualSNAPPreference,expectedSNAPPreference);
+					SetTestStepResult(EFail);
+					}
+				else
+					{
+					INFO_PRINTF3(_L("Actual SNAP ID [%d] equals Expected SNAP ID [%d]"),actualSNAPPreference,expectedSNAPPreference);
+					}
+				}
+			}
+		else
+			{
+			ERR_PRINTF3(_L("Actual SNAP Defintion [%d] does not equal Expected SNAP Defintion [%d]"),actualSNAPDefintion,iExpectedSNAPDefinition);
+			SetTestStepResult(EFail);
+			}
+	
+		CleanupStack::PopAndDestroy(2,accounts); // smtpIapPrefs, accounts
+		}
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/src/T_CreateSmtpAccount.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,119 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// CreateSmtpAccount
+// [Paramaters]
+// SmtpAccountName			:Name of the Smtp account.
+// SmtpConfigFileName		:Config file from which the Smtp account settings are read.
+// Creates a SMTP account in the Central Repository with the specified name using the 
+// settings read from the config file.
+// 
+//
+
+//User includes
+#include "T_CreateSmtpAccount.h"
+#include <t_utilsreademailsettingsfromconfigfile.h>
+
+//Epoc inlcudes
+#include <cemailaccounts.h>
+#include <iapprefs.h>
+#include <smtpset.h>
+
+//Literals used
+_LIT(KSmtpAccountName,"SmtpAccountName");
+_LIT(KSmtpConfigFileName,"SmtpConfigFileName");
+
+/**
+  Function : CT_MsgCreateSmtpAccount
+  Description : Constructor
+  @param : aSharedDataSMTP Reference to CT_MsgSharedDataSmtp
+  @return : N/A
+*/
+CT_MsgCreateSmtpAccount::CT_MsgCreateSmtpAccount(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+:CT_MsgSyncStepSMTP(aSharedDataSMTP)
+	{
+	SetTestStepName(KCreateSmtpAccount);
+	}
+
+/**
+  Function : ReadIni
+  Description :Reads the corresponding .ini file and returns EPass or EFail if any of the inputs are missing
+  @return : TBool
+*/
+TBool CT_MsgCreateSmtpAccount::ReadIni()
+	{
+	TBool result = ETrue;
+	
+	if(!GetStringFromConfig(ConfigSection(), KSmtpAccountName, iSmtpAccountName))
+		{
+		ERR_PRINTF1(_L("Smtp account name is not specified"));
+		SetTestStepResult(EFail);
+		result = EFalse;
+		}
+		
+	if(!GetStringFromConfig(ConfigSection(), KSmtpConfigFileName, iConfigFileName))
+		{
+		ERR_PRINTF1(_L("Configuration file path is not specified"));
+		SetTestStepResult(EFail);
+		}
+		
+	return result;
+	}
+
+/**
+  Function : doTestStepL
+  Description : Reads the Smtp account name and the settings file name from the .ini file
+				and then creates an Smtp account.
+  @return : TVerdict - Test step result
+*/
+TVerdict CT_MsgCreateSmtpAccount::doTestStepL()
+	{
+	
+	INFO_PRINTF1(_L("Test Step : CreateSmtpAccount"));
+	if(ReadIni())
+		{
+		CEmailAccounts*	emailAccounts = CEmailAccounts::NewLC();
+		
+		// Creates objects requried for SMTP account
+		CImIAPPreferences *smtpIapPreferences = CImIAPPreferences::NewLC();
+		CImSmtpSettings *smtpSettings = new (ELeave) CImSmtpSettings;
+		CleanupStack::PushL(smtpSettings);
+
+		// Populates the default SMTP settings
+		emailAccounts->PopulateDefaultSmtpSettingsL(*smtpSettings, *smtpIapPreferences);
+
+		//If the config file name is provided as input, then reads the SMTP settings from it
+		if(iConfigFileName.CompareF( _L("none") ) != 0)
+			{
+			TRAPD(err, CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadSmtpSettingsFromConfigurationFileL(iConfigFileName, *smtpSettings, *smtpIapPreferences));
+			if(err)
+				{
+				ERR_PRINTF2(_L("Failure while setting the SMTP settings, failed with error %d"), err);
+				SetTestStepError(err);
+				CleanupStack::PopAndDestroy(3,emailAccounts); // smtpSettings, smtpIapPreferences, emailAccounts
+				return TestStepResult();														  
+				}
+			if(TestStepResult() == EPass)
+				{
+				// Creates the SMTP account for the name specified and for the settings objects
+				TSmtpAccount smtpAccount = emailAccounts->CreateSmtpAccountL(iSmtpAccountName, *smtpSettings,*smtpIapPreferences,EFalse);
+				
+				// Sets the SMTP account created as the default SMTP account
+				emailAccounts->SetDefaultSmtpAccountL(smtpAccount);
+				}
+			}
+		CleanupStack::PopAndDestroy(3,emailAccounts); // smtpSettings, smtpIapPreferences, emailAccounts
+		}
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/src/T_CreateSmtpMessageFromEmailFile.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,284 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// CreateSmtpMessageFromEmailFile
+// [Paramaters]
+// ParentFolderName	: Name of the local folder under which the message 
+// needs to be created
+// EmailFileName		: Email file from which the message is to be created
+// KilobytesExtra		: Number of lines of 1024 characters to add to body text
+// Default value is 0.
+// [Test Step Description]
+// Creates an Email message reading the contents from the email file specified
+// from the config file.
+// [APIs Used]
+// CMsvEntry::SetEntryL
+// 
+//
+
+
+
+/**
+ @file
+*/
+	
+// User include
+#include "ImCltCvRecv.h"
+#include <t_utilscentralrepository.h>
+#include "T_CreateSmtpMessageFromEmailFile.h"
+#include <t_utilsenumconverter.h>
+
+
+// Literals Used
+_LIT(KEmailFileName, "EmailFileName");
+_LIT(KParentFolderName,"ParentFolderName");
+_LIT(KKilobytesExtra, "KilobytesExtra");
+_LIT(KOverRideAddress, "OverRideAddress");
+
+// Maximum length of a line read from Email file
+const TInt KMaxLenghtOfLine = 1024;
+const TInt KMaxLenghtOfChar = 1;
+
+/**
+CT_MsgCreateSmtpMessageFromEmailFile()
+Sets the test step name to KCreateSmtpMessageFromEmailFile
+
+@param aSharedDataSMTP
+
+*/
+CT_MsgCreateSmtpMessageFromEmailFile::CT_MsgCreateSmtpMessageFromEmailFile(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+:	CT_MsgSyncStepSMTP(aSharedDataSMTP)
+	{
+	SetTestStepName(KCreateSmtpMessageFromEmailFile);
+	}
+
+
+/**
+NewL()
+Static factory constructor. Uses two phase 
+construction.
+
+@param aSharedDataSMTP
+@leave KErrNoMemory
+@return
+A pointer to the newly created CT_MsgCreateSmtpMessageFromEmailFile object.
+*/
+CT_MsgCreateSmtpMessageFromEmailFile* CT_MsgCreateSmtpMessageFromEmailFile::NewL(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+	{
+	CT_MsgCreateSmtpMessageFromEmailFile* self = new(ELeave) CT_MsgCreateSmtpMessageFromEmailFile(aSharedDataSMTP);
+	CleanupStack::PushL(self);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+
+/**
+~CT_MsgCreateSmtpMessageFromEmailFile()
+Destructor
+*/
+CT_MsgCreateSmtpMessageFromEmailFile::~CT_MsgCreateSmtpMessageFromEmailFile()
+	{
+	}
+
+	
+/**
+doTestStepL()
+Reads the name of the email file,parent foldername from the ini file
+Parses the email file to generate a message under the parent folder 
+mentioned.If the number of lines is mentioned in the ini file then adds it to the 
+message.If not mentioned takes a default of 0.
+
+@return
+Returns the test step result
+*/
+TVerdict CT_MsgCreateSmtpMessageFromEmailFile::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test Step: CreateSmtpMessageFrom email file"));
+	TPtrC emailFileName;	
+	// Read the name of the email file from the ini
+	if(!GetStringFromConfig(ConfigSection(),KEmailFileName,emailFileName))
+		{
+		ERR_PRINTF1(_L("Email file name not specified"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		TInt numKilobytesExtra = 0;
+		GetIntFromConfig( ConfigSection(), KKilobytesExtra, numKilobytesExtra);
+
+		TPtrC parentFolderName;
+		if(!GetStringFromConfig( ConfigSection(), KParentFolderName, parentFolderName))
+			{
+			ERR_PRINTF1(_L("Parent Folder is not specified"));
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			// Retrieves the folder Id based on the local folder name read from the ini file
+			TMsvId parentFolderId = CT_MsgUtilsEnumConverter::FindFolderIdByName(parentFolderName);
+			if( parentFolderId == KErrNotFound)
+				{
+				ERR_PRINTF1(_L("Invalid local folder name specified"));
+				SetTestStepResult(EFail);
+				}
+			else
+				{
+				INFO_PRINTF2(_L("The parent folder Id is %d"),parentFolderId );
+
+				// Retrieve the default Smtp service Id
+				TMsvId	smtpServiceId(0);
+				TRAPD(err,smtpServiceId = CT_MsgUtilsCentralRepository::GetDefaultSmtpServiceIdL());
+				if(smtpServiceId == KMsvNullIndexEntryId)
+					{
+					ERR_PRINTF1(_L("Invalid account name specified"));
+					SetTestStepResult(EFail);
+					}
+				else
+					{
+					if(err != KErrNone)
+						{
+						ERR_PRINTF2(_L("Failure while getting the default SMTP Service Id.  error = %d"),err);
+						SetTestStepResult(EFail);
+						}
+					else
+						{	
+						INFO_PRINTF2(_L("The default Smtp serviceId is %d"),smtpServiceId );
+
+						// Set the context to the folder in which message has to be created
+						CMsvEntry*	entry = CMsvEntry::NewL(*iSharedDataSMTP.iSession,parentFolderId,TMsvSelectionOrdering());
+						CleanupStack::PushL(entry);
+						entry->SetEntryL(parentFolderId);
+
+						RFs	fs;
+						User::LeaveIfError(fs.Connect());
+						CleanupClosePushL(fs);
+
+						CImCltRecvConvert* recvConvert = CImCltRecvConvert::NewLC(fs,entry,KUidMsgTypeSMTP,
+																			   smtpServiceId);
+						recvConvert->SetMsvId(parentFolderId);
+					
+						// Read one line of text from the file, parse the line and set the fields of the email 
+						// message based on the contents of the parsed line.								   
+						
+						// Open the Email file in read mode
+						RFile	file;
+						User::LeaveIfError(file.Open(fs,emailFileName,EFileRead));
+						CleanupClosePushL(file);
+
+						TBuf8<KMaxLenghtOfLine> line;
+						TBuf8<KMaxLenghtOfChar> aChar;				// To read one character from the file
+						TBool finished = FALSE;
+
+						recvConvert->ResetL();
+
+						// Parse each line from the 
+
+						do
+							{
+						 	line.FillZ();
+						 	line.SetLength(0);
+						 	// Read one line from email file
+						 	do 
+						  		{
+						  		file.Read(aChar, 1);
+						  		if(aChar.Length())
+						  			{
+									line.Append(aChar);
+									}
+						  		else
+									{
+									finished = TRUE;
+									}
+						  		}while(aChar.Length() && aChar[0] != 0x0A);
+							if(!line.Length())
+								{
+								break;
+								}
+								// Parse the line for the fields of the email and store them
+							recvConvert->ParseNextFieldL(line);
+							}while(!finished);
+					
+							// For a large email, pad the email with extra characters
+							if(numKilobytesExtra > 0)
+								{
+								const TChar KPadChar = 'L';
+								line.Fill(KPadChar, 1024);
+								for(TInt i = 0; i < numKilobytesExtra; i++)
+									{
+									recvConvert->ParseNextFieldL(line);
+									}
+								}
+	
+						// Complete the message creation by setting all the required fields and 
+						// storing the email on to the message store.
+						// The created email's ID is returned by MessageCompelteL function
+						//
+
+						TMsvId messageId;
+						messageId = recvConvert->MessageCompleteL();
+						
+						if(messageId == 0)
+							{
+							User::Leave(KErrUnknown);
+							}
+						TBool overrideAddr = ETrue; // Default is to override.
+						GetBoolFromConfig(ConfigSection(), KOverRideAddress, overrideAddr);
+						// If the recipients email address in the message need to be changed to SMTP service's
+						// email address field, "overrideAddr" should be set to ETrue.
+						if(overrideAddr)
+							{
+							CImSmtpSettings* settings = new(ELeave) CImSmtpSettings();
+							CleanupStack::PushL(settings);
+					 		
+					 		CEmailAccounts* accounts = CEmailAccounts::NewLC();
+					 		TSmtpAccount smtpAccount;
+					 		accounts->GetSmtpAccountL(smtpServiceId, smtpAccount);
+							accounts->LoadSmtpSettingsL(smtpAccount, *settings);
+							CleanupStack::PopAndDestroy(accounts);
+							
+							HBufC* emailAddress=settings->EmailAddress().AllocL();
+							CleanupStack::PushL(emailAddress);
+							
+							entry->SetEntryL(messageId);
+							CMsvStore* store = entry->EditStoreL();
+							CleanupStack::PushL(store);
+							
+							CImHeader* header = CImHeader::NewLC(); 
+
+							header->RestoreL(*store); // Retrieves the email message header
+							
+							header->ToRecipients().Reset();
+							header->ToRecipients().AppendL(*emailAddress); // Modification of the e-mail ID
+							
+							header->StoreL(*store);
+							store->CommitL();
+							
+							CleanupStack::PopAndDestroy(3, emailAddress);
+							CleanupStack::PopAndDestroy(settings);
+							}
+						INFO_PRINTF2(_L("Created a email from file %S"),&emailFileName);
+						INFO_PRINTF2(_L("The id of the message created is %d"),messageId);
+							
+						CleanupStack::PopAndDestroy(4, entry); // file, recvConvert, fs, entry
+						}
+					}
+				}
+			}
+		}
+	return TestStepResult();
+	}
+		
+		
+		
+		
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/src/T_CreateSmtpMobilityAccount.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,207 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// CreateSmtpMobilityAccount
+// [Parameters]
+// EmailAddress: Email address for mobility account / linked SMTP account
+// ConfigFileName: Configuration file name to read for account settings
+// Linked: Create a linked mobility account
+// AP ID: Access point identifier (eg. IAP number)
+// [TestStep Description]
+// Creates a mobility account under the default SMTP account
+// If linked account option is chosen, also creates a new SMTP account
+// and links the mobility account to it.
+// 
+//
+
+#include "T_CreateSmtpMobilityAccount.h"
+#include <t_utilsreademailsettingsfromconfigfile.h>
+#include <cemailaccounts.h>
+#include <iapprefs.h>
+#include <smtpset.h>
+#include <imapset.h>
+#include <cimsmtpmobilitysettings.h>
+
+_LIT(KMobilityAccountName, "Mobility Account");
+_LIT(KLinkedAccountName, "Linked Account");
+
+_LIT(KEmailAddress, "EmailAddress");
+_LIT(KLinked, "Linked");
+_LIT(KConfigFileName, "ConfigFileName");
+_LIT(KAccessPoint, "AccessPoint");
+
+/**
+	Function : NewL()
+	Description : Static factory constructor.
+
+	@param aSharedDataSMTP
+
+	@return A pointer to the newly created CT_MsgCreateSmtpMobilityAccount object.
+*/
+CT_MsgCreateSmtpMobilityAccount* CT_MsgCreateSmtpMobilityAccount::NewL(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+	{
+	CT_MsgCreateSmtpMobilityAccount* self = new(ELeave) CT_MsgCreateSmtpMobilityAccount(aSharedDataSMTP);
+	return self;
+	}
+
+/**
+  Function : CT_MsgCreateSmtpMobilityAccount
+  Description : Constructor
+  @return : N/A
+*/
+CT_MsgCreateSmtpMobilityAccount::CT_MsgCreateSmtpMobilityAccount(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+:	CT_MsgSyncStepSMTP(aSharedDataSMTP)
+	{
+	SetTestStepName(KCreateSmtpMobilityAccount);
+	}
+
+/**
+  Function : doTestStepL
+  Description : Creates SMTP mobility account
+  @return : TVerdict - Test step result
+*/
+TVerdict CT_MsgCreateSmtpMobilityAccount::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test Step: Create Smtp Mobility Account"));
+
+	TPtrC emailAddress;
+	if(!GetStringFromConfig(ConfigSection(), KEmailAddress, emailAddress))
+		{
+		ERR_PRINTF1(_L("Email address is not specified"));
+		SetTestStepResult(EFail);
+		return TestStepResult();
+		}
+
+	TPtrC	configFileName;
+	if(!GetStringFromConfig(ConfigSection(), KConfigFileName, configFileName))
+		{
+		ERR_PRINTF1(_L("Configuration file path is not specified"));
+		SetTestStepResult(EFail);
+		return TestStepResult();
+		}
+
+	TBool linked = EFalse;
+	GetBoolFromConfig(ConfigSection(), KLinked, linked);
+
+	TInt accessPoint = 0;
+	GetIntFromConfig(ConfigSection(), KAccessPoint, accessPoint);
+
+	CEmailAccounts* emailAccounts = CEmailAccounts::NewLC();
+
+	CImIAPPreferences* smtpIapPrefs = CImIAPPreferences::NewLC();
+	CImSmtpSettings* smtpSettings = new (ELeave) CImSmtpSettings;
+	CleanupStack::PushL(smtpSettings);
+
+	if (linked || accessPoint == 0)
+		{
+		emailAccounts->PopulateDefaultSmtpSettingsL(*smtpSettings, *smtpIapPrefs);
+
+		if( configFileName.CompareF( _L("none") ) != 0 )
+			{
+			TRAPD(err, CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadSmtpSettingsFromConfigurationFileL(configFileName, *smtpSettings, *smtpIapPrefs));
+
+			if (err == KErrNone)
+				{
+				if (accessPoint == 0)
+					{
+					if (smtpIapPrefs->NumberOfIAPs() > 0)
+						{
+						TImIAPChoice iapChoice = smtpIapPrefs->IAPPreference(0);
+						accessPoint = iapChoice.iIAP;
+						}
+					}
+				}
+			else
+				{
+				ERR_PRINTF2(_L("Failure while setting the SMTP setting parameters, failed with error %d"), err);
+				SetTestStepResult(EFail);					  
+				}
+			}
+		}
+
+	RArrayIAP iapList;
+	CleanupClosePushL(iapList);
+	if (TestStepResult() == EPass)
+		{
+		if (accessPoint != 0)
+			{
+			iapList.AppendL(accessPoint);
+			}
+		else
+			{
+			ERR_PRINTF1(_L("Access point not specified"));
+			SetTestStepResult(EFail);					  
+			}
+		}
+
+	TSmtpAccount parentSmtpAccount;
+
+	if (TestStepResult() == EPass)
+		{
+		if (emailAccounts->DefaultSmtpAccountL(parentSmtpAccount) != KErrNone)
+			{
+			ERR_PRINTF1(_L("Default SMTP account not found"));
+			SetTestStepResult(EFail);															  
+			}
+		}
+
+	if (TestStepResult() == EPass)
+		{
+		if (linked)
+			{
+			/* Creates objects requried for IMAP account */
+			CImIAPPreferences* imapIapPrefs = CImIAPPreferences::NewLC();
+			CImImap4Settings* imapSettings = new (ELeave) CImImap4Settings;
+			CleanupStack::PushL(imapSettings);
+			emailAccounts->PopulateDefaultImapSettingsL(*imapSettings, *imapIapPrefs);
+
+			if( configFileName.CompareF( _L("none") ) != 0 )
+				{
+				TRAPD(err, CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadImapSettingsFromConfigurationFileL(configFileName, *imapSettings, *imapIapPrefs));
+
+				if (err != KErrNone)
+					{
+					ERR_PRINTF2(_L("Failure while setting the IMAP setting parameters, failed with error %d"), err);
+					SetTestStepResult(EFail);															  
+					}
+				}
+
+			if( TestStepResult() == EPass )
+				{
+				smtpSettings->SetEmailAddressL(emailAddress);
+
+				/* Creates the IMAP account for the name specified and for the settings objects */
+				TImapAccount linkedImapAccount = emailAccounts->CreateImapAccountL(KLinkedAccountName, *imapSettings, *imapIapPrefs, EFalse);
+
+				/* Creates the SMTP account for the name specified and for the settings objects */
+				TSmtpAccount linkedSmtpAccount = emailAccounts->CreateSmtpAccountL(linkedImapAccount, *smtpSettings, *smtpIapPrefs, EFalse);
+
+				emailAccounts->CreateSmtpMobilityAccountL(KMobilityAccountName, iapList, parentSmtpAccount, linkedSmtpAccount, EFalse);
+				}
+			CleanupStack::PopAndDestroy(2, imapIapPrefs);
+			}
+		else
+			{
+			CImSmtpMobilitySettings* mobilitySettings = CImSmtpMobilitySettings::NewLC();
+			emailAccounts->PopulateDefaultSmtpMobilitySettingsL(*mobilitySettings);
+			mobilitySettings->SetEmailAddressL(emailAddress);
+			emailAccounts->CreateSmtpMobilityAccountL(KMobilityAccountName, iapList, parentSmtpAccount, *mobilitySettings, EFalse);
+			CleanupStack::PopAndDestroy(mobilitySettings);
+			}
+		}
+
+	CleanupStack::PopAndDestroy(4, emailAccounts);
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/src/T_ModifySmtpSettings.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,130 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// ModifySmtpSettings
+// [Paramaters]
+// SmtpAccountName			:Name of the Smtp account
+// SmtpConfigFileName		:Config file from which the Smtp account settings are read 
+// ModifySmtpSettings Test Step is intended to modify existing settings and save to CenRep 
+// for the specified SMTP account Id
+// 
+//
+
+/* user includes */
+#include "T_ModifySmtpSettings.h"
+#include <t_utilsreademailsettingsfromconfigfile.h>
+#include <t_utilscentralrepository.h>
+
+/* epoc inlcudes */
+#include <cemailaccounts.h>
+#include <smtpset.h>
+#include <iapprefs.h>
+
+/* Literals used */
+_LIT(KSmtpAccountName,"SmtpAccountName");
+_LIT(KSmtpConfigFileName,"SmtpConfigFileName");
+
+/**
+  Function : CT_MsgModifySmtpSettings
+  Description : Constructor
+  @param : aSharedDataSMTP Reference to CT_MsgSharedDataSmtp
+  @return : N/A
+*/
+CT_MsgModifySmtpSettings::CT_MsgModifySmtpSettings(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+:	CT_MsgSyncStepSMTP(aSharedDataSMTP)
+	{
+	SetTestStepName(KModifySmtpSettings);
+	}
+	
+/**
+  Function : ~CT_MsgModifySmtpSettings
+  Description : Destructor
+  @return : N/A
+*/
+CT_MsgModifySmtpSettings::~CT_MsgModifySmtpSettings()
+	{
+	}
+
+/**
+  Function : doTestStepL
+  Description : Reads the Smtp account name and config file name from the .ini file
+				and it then modifies the account with the settings read from the config file.
+  @return : TVerdict - Test step result
+  @leave  : KMsvNullIndexEntryId	Invalid SMTP account name specified	
+*/
+TVerdict CT_MsgModifySmtpSettings::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test Step: ModifySmtpSettings"));
+	// Read the SMTP account name from the ini file
+	TPtrC smtpAccountName;
+	if(!GetStringFromConfig(ConfigSection(), KSmtpAccountName, smtpAccountName))
+		{
+		ERR_PRINTF1(_L("SMTP account name is not specified"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		// Read the SMTP Config file name from the ini file
+		TPtrC configFileName;
+		if(!GetStringFromConfig(ConfigSection(), KSmtpConfigFileName, configFileName))
+			{
+			ERR_PRINTF1(_L("Configuration file path is not specified"));
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			// Retrieving the SMTP service Id for the given SMTP account
+			TMsvId smtpServiceId = CT_MsgUtilsCentralRepository::GetSmtpServiceIdL((TDes&)smtpAccountName);
+			INFO_PRINTF2(_L("SMTP service Id is %d"),smtpServiceId);
+			
+			if(smtpServiceId == KMsvNullIndexEntryId)
+				{
+				ERR_PRINTF1(_L("Invalid SMTP account name specified"));
+				SetTestStepResult(EFail);
+				}
+			// Creates the settings object
+			else
+				{
+				CEmailAccounts* emailAccounts = CEmailAccounts::NewLC();
+
+				CImSmtpSettings* smtpSettings = new(ELeave) CImSmtpSettings();
+				CleanupStack::PushL(smtpSettings);
+				
+				CImIAPPreferences* smtpIapPrefs = CImIAPPreferences::NewLC();
+
+				// Loads the settings for the account with the current settings
+				TSmtpAccount smtpAccount;
+				emailAccounts->GetSmtpAccountL(smtpServiceId, smtpAccount);
+				emailAccounts->LoadSmtpSettingsL(smtpAccount, *smtpSettings);
+				emailAccounts->LoadSmtpIapSettingsL(smtpAccount, *smtpIapPrefs);
+
+				// Reads the settings from the config file
+				TRAPD(err, CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadSmtpSettingsFromConfigurationFileL(configFileName, *smtpSettings, *smtpIapPrefs));
+				if(err)
+					{	
+					ERR_PRINTF2(_L("Failure while setting the SMTP setting parameters, failed with error %d"), err);
+					SetTestStepError(err);															  
+					}
+				else
+					{
+					// Saves the new settings
+					emailAccounts->SaveSmtpSettingsL(smtpAccount, *smtpSettings);
+					emailAccounts->SaveSmtpIapSettingsL(smtpAccount, *smtpIapPrefs);
+					}
+				CleanupStack::PopAndDestroy(3, emailAccounts);// smtpIapPrefs,smtpSettings,emailAccounts
+				}
+			}
+		}
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/src/T_MsgAsyncStepSMTP.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,40 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [Test Step] :
+// AsyncStepSMTP
+// References SMTP shared data for use by derived test steps.
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+// User includes
+#include "T_MsgAsyncStepSMTP.h"
+
+
+/**
+CT_AsyncStepSMTP()
+Constructor
+
+@param aSharedDataSMTP
+*/
+CT_MsgAsyncStepSMTP::CT_MsgAsyncStepSMTP(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+:	CT_MsgAsyncStep()
+,	iSharedDataSMTP(aSharedDataSMTP)
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/src/T_MsgSharedDataSmtp.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,89 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+*/
+
+
+// user include
+#include "T_MsgSharedDataSmtp.h"
+
+
+// epoc includes
+#include <miutset.h>
+
+/**
+NewL()
+Static factory constructor. Uses two phase 
+construction.
+
+@leave KErrNoMemory
+@return
+A pointer to the newly created CT_MsgSharedDataSmtp object.
+*/
+CT_MsgSharedDataSmtp* CT_MsgSharedDataSmtp::NewL()
+	{
+	CT_MsgSharedDataSmtp* self = new(ELeave) CT_MsgSharedDataSmtp();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+
+/**
+  ConstructL()
+  Second phage constructor
+*/
+void CT_MsgSharedDataSmtp::ConstructL()
+{
+	CT_MsgSharedDataBase::ConstructL();
+	iPeriodic 		= CPeriodic::New(1);
+	iMaxRamValue 	= 0;
+	iMinRamValue 	= 0;
+	iStartRamValue 	= 0;
+	iEndRamValue 	= 0;
+	iMark			= ETrue;
+}
+
+/**
+  ~CT_MsgSharedDataSmtp
+  Destructor
+*/
+CT_MsgSharedDataSmtp::~CT_MsgSharedDataSmtp()
+	{
+	delete iPeriodic;
+	}
+
+/**
+NewMtmL()
+
+*/
+CBaseMtm* CT_MsgSharedDataSmtp::NewMtmL()
+	{
+	return iRegistry->NewMtmL(KUidMsgTypeSMTP);	
+	}
+
+
+/**
+CT_MsgSharedDataBase()
+Constructor
+*/
+CT_MsgSharedDataSmtp::CT_MsgSharedDataSmtp()
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/src/T_MsgSyncStepSMTP.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,39 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// References SMTP shared data for use by derived test steps.
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+
+// User includes
+#include "T_MsgSyncStepSMTP.h"
+
+
+/**
+CT_MsgAsyncStepSMTP()
+Constructor
+
+@param aSharedDataSMTP
+*/
+CT_MsgSyncStepSMTP::CT_MsgSyncStepSMTP(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+:	CT_MsgStep()
+,	iSharedDataSMTP(aSharedDataSMTP)
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/src/T_RemoveSmtpSNAPSetting.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,92 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// RemoveSmtpSNAPSetting
+// [Paramaters]
+// SmtpAccountName			:Name of the Smtp account.
+// Removes the provisioned SNAP information for the SMTP account.
+// 
+//
+
+//User includes
+#include "T_RemoveSmtpSNAPSetting.h"
+#include <t_utils.h>
+#include <t_utilsenumconverter.h>
+#include <t_utilscentralrepository.h>
+
+//Epoc include
+#include <iapprefs.h>
+
+//Literal used
+_LIT(KSmtpAccountName,"SmtpAccountName");
+
+/**
+  Function : CT_MsgRemoveSmtpSNAPSetting
+  Description : Constructor 
+  @param : aSharedDataSMTP Reference to CT_MsgSharedDataSmtp
+  @return : N/A
+*/
+CT_MsgRemoveSmtpSNAPSetting::CT_MsgRemoveSmtpSNAPSetting(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+:CT_MsgSyncStepSMTP(aSharedDataSMTP)
+	{
+	SetTestStepName(KRemoveSmtpSNAPSetting);
+	}
+	
+/**
+  Function : ReadIni
+  Description :Reads the corresponding .ini file and returns EPass or EFail if any of the inputs are missing
+  @return : TBool
+*/
+TBool CT_MsgRemoveSmtpSNAPSetting::ReadIni()
+	{
+	TBool result = ETrue;
+	
+	if(!GetStringFromConfig(ConfigSection(), KSmtpAccountName, iSmtpAccountName))
+		{
+		ERR_PRINTF1(_L("Smtp account name is not specified"));
+		SetTestStepResult(EFail);
+		result = EFalse;
+		}
+		
+	return result;
+	}
+
+/**
+  Function : doTestStepL
+  Description : Removes the provisioned SNAP information from the SMTP account settings of a test case.
+  @return : TVerdict - Test step result
+*/		
+TVerdict CT_MsgRemoveSmtpSNAPSetting::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test Step : RemoveSmtpSNAPSetting"));
+	if(ReadIni())
+		{
+		CEmailAccounts* accounts = CEmailAccounts::NewL();
+		CleanupStack::PushL(accounts);
+		
+		CImIAPPreferences* smtpIapPrefs = CImIAPPreferences::NewLC();
+					
+		TSmtpAccount smtpAccountId;
+		CT_MsgUtilsCentralRepository::GetSmtpAccountL((TDes&)iSmtpAccountName, smtpAccountId);
+				
+		accounts->LoadSmtpIapSettingsL(smtpAccountId, *smtpIapPrefs);	
+		
+		smtpIapPrefs->RemoveSNAP();
+		
+		accounts->SaveSmtpIapSettingsL(smtpAccountId, *smtpIapPrefs);
+	
+		CleanupStack::PopAndDestroy(2,accounts); // smtpIapPrefs, accounts
+		}
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/src/T_RetrievePlainBodyTextAndCompare.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,308 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// RetrievePlainBodyTextAndCompare
+// [Parameters]
+// ServiceType			:	Specifies the service type(IMAP or POP) under which message exists.
+// ImapAccountName		:	If service type is IMAP4, specify the IMAP account name that holds the
+// message.
+// ParentFolderName	:	IMAP4 folder name that holds the message.
+// PopAccountName		:	If the the sevice type is POP3, specify POP account name.
+// SubjectOfExistingMsg:	Sbject line of the existing message to which forward message
+// would be creted.
+// EmailFileName		:	File name from which existing message has been created.
+// ChunkSize			:	Chunk size to be used for retriving body text of a message.
+// Searches for the message with the specified subject and retrives the body part of
+// the message and write it to the RetrivedBody.txt file.
+// [APIs Used]
+// CImEmailMessage::OpenPlainBodyTextForReadL
+// CImPlainBodyText::NextChunkL
+// NOTE : Comparison part has been removed as it would success only when 
+// message creation and fetching both uses same set of character set(8 bit or 16 bit).
+// However comaprison can be done manually using the text comparison tools(e.g, Beyond Compare)
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+
+
+// User Includes
+#include "T_RetrievePlainBodyTextAndCompare.h"
+#include <t_utilscentralrepository.h>
+#include <t_utilsenumconverter.h>
+#include <t_utils.h>
+
+
+// Epoc Include
+#include <miutmsg.h>
+#include <cimplainbodytext.h>
+
+
+// Literals Used
+_LIT(KServiceType, "ServiceType");
+
+_LIT(KImapAccountName, "ImapAccountName");
+_LIT(KParentFolderName, "ParentFolderName");
+
+_LIT(KPopAccountName,"PopAccountName");
+
+_LIT(KSubjectOfExistingMsg,"SubjectOfExistingMsg");
+_LIT(KEmailFileName, "EmailFileName");
+_LIT(KChunkSize, "ChunkSize");
+
+_LIT(KRetrivedBody, "c:\\msgtest\\RetrivedBody.txt"); //File used to hold the retrive body part
+
+
+const TInt KArrayGranularity = 8;
+const TInt KZero={0};
+/**
+CT_RetrievePlainBodyTextAndCompare
+Constructor
+
+@param :
+@return : N/A
+
+
+*/
+CT_RetrievePlainBodyTextAndCompare::CT_RetrievePlainBodyTextAndCompare(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+: CT_MsgAsyncStepSMTP(aSharedDataSMTP)
+	{
+	SetTestStepName(KRetrievePlainBodyTextAndCompare);
+	}
+
+
+/**
+NewL()
+Static factory constructor. Uses two phase 
+construction.
+
+@param aSharedDataSMTP
+@leave KErrNoMemory
+@return
+A pointer to the newly created CT_RetrievePlainBodyTextAndCompare object.
+*/
+CT_RetrievePlainBodyTextAndCompare* CT_RetrievePlainBodyTextAndCompare::NewL(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+	{
+	CT_RetrievePlainBodyTextAndCompare* self = new(ELeave) CT_RetrievePlainBodyTextAndCompare(aSharedDataSMTP);
+	CleanupStack::PushL(self);
+	self->ConstructL(); 					 // Call CT_AsyncStep::ConstructL()
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+
+/**
+~CT_RetrievePlainBodyTextAndCompare()
+Destructor
+*/
+CT_RetrievePlainBodyTextAndCompare::~CT_RetrievePlainBodyTextAndCompare()
+	{}
+
+
+/**
+ProgressL()
+
+@param aFinal
+*/
+void CT_RetrievePlainBodyTextAndCompare::ProgressL(TBool aFinal)
+	{
+	if ( aFinal )
+		{
+		//	Display final progress iOperation
+		}
+	else
+		{
+		//	Display current progress iOperation
+		}
+	}
+
+
+/**
+CancelStep()
+*/
+void CT_RetrievePlainBodyTextAndCompare::CancelStep()
+	{}
+
+	
+/**
+doTestStepL()
+Opens the body text part with read only mode. Reads the contents of body part chunkwise and write it
+to the file  RetrivedBody.txt. Then it comapares the contents of RetrivedBody.txt with the input file.
+@return
+Returns the test step result
+*/
+TVerdict CT_RetrievePlainBodyTextAndCompare::doTestStepL()
+	{
+	INFO_PRINTF1( _L("Test Step : Edit Message Body Text") );	
+	TMsvId	entryToBesearched;
+	TPtrC serviceType;
+	if(!GetStringFromConfig( ConfigSection(), KServiceType, serviceType))
+		{
+		ERR_PRINTF1(_L("\"ServiceType\" for the message is not specified"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		TBuf<4> temp(serviceType);
+		temp.UpperCase();						// Makes case insensitive
+		// Perform the following if message has been downloaded using IMAP4 service
+		if(temp.CompareC(_L("IMAP")) == KZero)
+			{
+			// Read the IMAP account name from the ini file
+			TPtrC imapAccountName;
+			if(!GetStringFromConfig( ConfigSection(), KImapAccountName, imapAccountName))
+				{
+				ERR_PRINTF1(_L("ImapAccount Name is not specified"));
+				SetTestStepResult(EFail);
+				}
+			else
+				{
+				TPtrC	parentFolderName;
+				if(!GetStringFromConfig( ConfigSection(), KParentFolderName, parentFolderName))
+					{
+					ERR_PRINTF1(_L("Parent Folder is not specified"));
+					SetTestStepResult(EFail);
+					}
+				else
+					{
+					
+					// retrieves the folder Id based on the remote service folder name read from the ini file
+					entryToBesearched = CT_MsgUtils::GetRemoteFolderIdByNameL(iSharedDataSMTP.iSession, imapAccountName, parentFolderName);
+					if( entryToBesearched == KErrNotFound)
+						{
+						ERR_PRINTF1(_L("Invalid Remote folder name specified"));
+						SetTestStepResult(EFail);
+						}
+					else
+						{
+						INFO_PRINTF2(_L("The parent folder Id is %d"),entryToBesearched );
+						}
+					}
+				}
+			}
+		// Perform the following if message has been downloaded using POP3 service 	
+		else if(temp.CompareC(_L("POP")) == KZero)
+			{
+			TPtrC popAccountName;
+			if(!GetStringFromConfig( ConfigSection(), KPopAccountName, popAccountName))
+				{
+				ERR_PRINTF1(_L("PopAccount Name is not specified"));
+				SetTestStepResult(EFail);
+				}
+			else
+				{
+				// Retrieves the Pop service Id for the given Pop account
+				entryToBesearched = CT_MsgUtilsCentralRepository::GetPopServiceIdL((TDes&)popAccountName);
+				INFO_PRINTF2(_L("Pop service id is %d"), entryToBesearched);
+
+				// Fails the test step if an invalid POP account is specified 
+				if(entryToBesearched == KMsvNullIndexEntryId)
+					{
+					ERR_PRINTF1(_L("Invalid POP account name specified"));
+					SetTestStepResult(EFail);
+					}
+				}
+			}
+		else
+			{
+			ERR_PRINTF1(_L("\"ServiceType\" is not specified: It should be IMAP or POP"));
+			SetTestStepResult(EFail);
+			}
+		}
+
+	if(TestStepResult() == EPass)
+		{
+		TPtrC subjectOfExistingMsg;	
+		if( !GetStringFromConfig(ConfigSection(), KSubjectOfExistingMsg, subjectOfExistingMsg))
+			{
+			ERR_PRINTF1(_L("\"SubjectOfExistingMsg\" is not specified"));
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			// Retrieves the message Id based on the message subject from the given remote service folder
+			TMsvId messageId;
+			messageId = CT_MsgUtils::SearchMessageBySubjectL(iSharedDataSMTP.iSession, entryToBesearched, subjectOfExistingMsg, ETrue);
+			if( messageId == KMsvNullIndexEntryId)
+				{
+				ERR_PRINTF1(_L("The given message is not found"));
+				SetTestStepResult(EFail);
+				}
+			// Message found
+			else
+				{
+				TPtrC emailFileName;
+				if(!GetStringFromConfig( ConfigSection(), KEmailFileName, emailFileName))
+					{
+					ERR_PRINTF1(_L("Parent Folder is not specified"));
+					SetTestStepResult(EFail);
+					}
+				else
+					{
+					INFO_PRINTF2(_L("The Message Id is %d"),messageId );
+
+					// Setting the current context to the parent of the mesage
+					CMsvEntry*	messageEntry = CMsvEntry::NewL(*iSharedDataSMTP.iSession, messageId , TMsvSelectionOrdering());
+					CleanupStack::PushL(messageEntry);
+					messageEntry->SetEntryL(messageId);
+					CImEmailMessage *emailMessage = CImEmailMessage::NewLC(*messageEntry);
+					TInt chunkSize(1);
+					GetIntFromConfig(ConfigSection(), KChunkSize, chunkSize);
+					// Open the body text part for read only purpose
+					CImPlainBodyText* bodytext = emailMessage->OpenPlainBodyTextForReadL(CImEmailMessage::EThisMessageOnly, chunkSize);
+					CleanupStack::PushL(bodytext);
+			
+
+					HBufC*  fileData =  HBufC::NewLC(chunkSize);
+					TPtr readData = fileData->Des();
+					RFs	fs;
+					User::LeaveIfError(fs.Connect());
+					CleanupClosePushL(fs);
+
+					RFile	file;
+					User::LeaveIfError(file.Replace(fs,KRetrivedBody,EFileWrite));
+					CleanupClosePushL(file);
+					TInt count = 0;
+					// Retrieve and store the body text to a file
+					do
+						{
+						bodytext->NextChunkL(readData);
+						_LIT(KServerMessage, "*This message was transferred with a trial version of CommuniGate(tm) Pro*\r\n");
+						TInt position = readData.Find(KServerMessage);// readData.Find(KServerMessage);
+						if(position != KErrNotFound && count < 1)
+							{
+							count++;
+							readData.Delete(position, KServerMessage().Length());
+							TPtrC8 inFileBuf8((TUint8*)(readData.Ptr()), readData.Length()*2);
+							file.Write(inFileBuf8);
+							}
+						else
+							{
+							TPtrC8 inFileBuf8((TUint8*)(readData.Ptr()), readData.Length()*2);
+							file.Write(inFileBuf8);
+							}
+						}while(readData.Length()>0);
+					file.Close();
+					CleanupStack::PopAndDestroy(6, messageEntry); // file, fs, fileData, bodytext, emailMessage, messageEntry
+					}
+				}
+			}
+		}
+	return TestStepResult();	
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/src/T_SendSmtpMessage.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,218 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// SendSmtpMessage
+// [Parameters]
+// ParentFolderName  :   Local folder name in which the message to be sent is 
+// present
+// Subject			  :	  Subject of the message to be sent 	
+// Searches for the message with the specified subject and sends the message if the
+// message is found.  If the local folder name is invalid or if the message is 
+// not found in the given folder,the test step fails.
+// [APIs Used]
+// CMsvEntry::SetEntryL
+// CMsvEntry::CopyL
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+
+
+//User Includes
+#include "T_SendSmtpMessage.h"
+#include <t_utilsenumconverter.h>
+#include <t_utils.h>
+#include <t_utilscentralrepository.h>
+
+
+// Literals Used
+_LIT(KSubject,"Subject");
+_LIT(KParentFolderName,"ParentFolderName");
+
+
+/**
+CT_MsgSendSmtpMessage
+Constructor
+
+@param :
+@return : N/A
+
+
+*/
+CT_MsgSendSmtpMessage::CT_MsgSendSmtpMessage(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+:	CT_MsgAsyncStepSMTP(aSharedDataSMTP)
+,	iOperation(NULL)
+	{
+	SetTestStepName(KSendSmtpMessage);
+	}
+
+
+/**
+NewL()
+Static factory constructor. Uses two phase 
+construction.
+
+@param aSharedDataSMTP
+@leave KErrNoMemory
+@return
+A pointer to the newly created CT_MsgSendSmtpMessage object.
+*/
+CT_MsgSendSmtpMessage* CT_MsgSendSmtpMessage::NewL(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+	{
+	CT_MsgSendSmtpMessage* self = new(ELeave) CT_MsgSendSmtpMessage(aSharedDataSMTP);
+	CleanupStack::PushL(self);
+	self->ConstructL(); 					 // Call CT_AsyncStep::ConstructL()
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+
+/**
+~CT_MsgSendSmtpMessage()
+Destructor
+*/
+CT_MsgSendSmtpMessage::~CT_MsgSendSmtpMessage()
+	{
+	delete iOperation;
+	iOperation=NULL;
+	}
+
+
+/**
+ProgressL()
+
+@param bFinal
+*/
+void CT_MsgSendSmtpMessage::ProgressL(TBool bFinal)
+	{
+	//	TODO
+	if ( bFinal )
+		{
+		//	Display final progress iOperation
+		}
+	else
+		{
+		//	Display current progress iOperation
+		}
+	}
+
+
+/**
+CancelStep()
+*/
+void CT_MsgSendSmtpMessage::CancelStep()
+	{
+	iOperation->Cancel();
+	}
+
+	
+/**
+doTestStepL()
+Reads the parent folder name, the message subject from the ini file
+Searches for the message under the specified folder, and sends the message
+
+@return
+Returns the test step result
+*/
+TVerdict CT_MsgSendSmtpMessage::doTestStepL()
+	{
+	INFO_PRINTF1( _L("Test Step : Send Smtp Message") );	
+	TPtrC	parentFolderName;
+	if(!GetStringFromConfig( ConfigSection(), KParentFolderName, parentFolderName))
+		{
+		ERR_PRINTF1(_L("Parent Folder is not specified"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		TPtrC	subject;	
+		if( !GetStringFromConfig(ConfigSection(), KSubject, subject ))
+			{
+			ERR_PRINTF1(_L("The subject of the message is not specified"));
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			// retrieves the folder Id based on the local folder name read from the ini file
+			TMsvId	parentFolderId = CT_MsgUtilsEnumConverter::FindFolderIdByName(parentFolderName);
+			if( parentFolderId == KErrNotFound)
+				{
+				ERR_PRINTF1(_L("Invalid local folder name specified"));
+				SetTestStepResult(EFail);
+				}
+			else
+				{
+				INFO_PRINTF2(_L("The parent folder Id is %d"),parentFolderId );
+
+				// Retrieves the message Id based ont he message subject from the given local folder
+				TMsvId	messageId = CT_MsgUtils::SearchMessageBySubjectL(iSharedDataSMTP.iSession, parentFolderId , subject);
+				if( messageId == KMsvNullIndexEntryId)
+					{
+					ERR_PRINTF1(_L("The given message is not found"));
+					SetTestStepResult(EFail);
+					}
+				// Message found	
+				else
+					{
+					INFO_PRINTF2(_L("The Message Id is %d"),messageId );
+
+					// Retrieve the default Smtp service Id
+					TMsvId	smtpServiceId(0);
+					TRAPD(err, smtpServiceId = CT_MsgUtilsCentralRepository::GetDefaultSmtpServiceIdL());
+					if(err != KErrNone)
+						{
+						ERR_PRINTF2(_L("Failure while getting the default SMTP Service Id.  error = %d"),err);
+						SetTestStepResult(EFail);
+						}
+					else
+						{
+						INFO_PRINTF2(_L("The Default Smtp Service Id is %d"),smtpServiceId );
+
+						// Setting the current context to the parent of the mesage
+						CMsvEntry*	folderEntry = CMsvEntry::NewL(*iSharedDataSMTP.iSession, messageId , TMsvSelectionOrdering());
+						CleanupStack::PushL(folderEntry);
+						folderEntry->SetEntryL(messageId);
+						folderEntry->SetEntryL(folderEntry->Entry().Parent());
+
+						// Sends the message
+						CT_MsgActive&	active=Active();
+						iOperation = folderEntry->CopyL(messageId, smtpServiceId, active.iStatus);
+						active.Activate();
+						CActiveScheduler::Start();
+
+						TImSmtpProgress temp;
+						TPckgC<TImSmtpProgress> paramPack(temp);
+						paramPack.Set(iOperation->ProgressL());
+						TImSmtpProgress progress=paramPack();
+						SetTestStepError(progress.Error());
+
+						if (NULL!=iOperation)
+							{
+							delete iOperation;
+							iOperation=NULL;
+							}
+						CleanupStack::PopAndDestroy(folderEntry); //operation,folderEntry
+						}
+					}
+				}
+			}
+		}
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/src/T_SmtpCreateForwardMessage.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,361 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file 
+// [TestStep Name]
+// SmtpCreateForwadMessage
+// [Parameters]
+// ServiceType			:	Specifies the service type(IMAP or POP) under which message exists.
+// FolderName			:	Destination local folder where message is to be created.
+// ImapAccountName		:	If service type is IMAP4, specify the IMAP account name that holds the
+// message.
+// ParentFolderName	:	IMAP4 folder name that holds the message.
+// PopAccountName		:	If the the sevice type is POP3, specify POP account name.
+// CommandName			:	SMTP client MTM command used to create the forward message.
+// FolderName			:	Destination local folder in which message would be storted.
+// SubjectOfExistingMsg:	Sbject line of the existing message to which forward message
+// would be creted.
+// SubjectOfForwardMsg	:	Specifies the subject line to be set for the froward message.
+// This is an optional parameter and if not specified the subject line
+// would take the default format(Fwd: <SubjectOfExistingMsg>).
+// Creates a forward message to an existing message using the SMTP client MTM command
+// and modifies the message header information.
+// [APIs Used]
+// CImEmailMessage::OpenPlainBodyTextForReadL
+// CImPlainBodyText::NextChunkL
+// 
+//
+
+
+
+
+// User includes 
+#include "T_SmtpCreateForwardMessage.h"
+#include <t_utilscentralrepository.h>
+#include <t_utilsenumconverter.h>
+#include <t_utils.h>
+
+
+// Epoc includes 
+#include <miutmsg.h>
+
+
+// Literals Used 
+_LIT(KServiceType, "ServiceType");
+
+_LIT(KImapAccountName,"ImapAccountName");
+_LIT(KParentFolderName,"ParentFolderName");
+
+_LIT(KPopAccountName,"PopAccountName");
+
+_LIT(KCommandName,"CommandName");
+_LIT(KFolderName, "FolderName");
+_LIT(KSubjectOfExistingMsg,"SubjectOfExistingMsg");
+
+_LIT(KSubjectOfForwardMsg, "SubjectOfForwardMsg");
+_LIT(KRecipientsAddress, "RecipientsAddress");
+
+const TInt KZero={0};
+/**
+  Function 		: CT_SmtpCreateForwadMessage
+  Description 	: Constructor
+  @param 		: aSharedDataSMTP		Reference to CT_MsgSharedDataSmtp
+  @return 		: N/A
+*/
+CT_SmtpCreateForwadMessage::CT_SmtpCreateForwadMessage(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+:	CT_MsgAsyncStepSMTP(aSharedDataSMTP)
+,	iOperation(NULL)
+	{
+	SetTestStepName(KSmtpCreateForwadMessage);
+	}
+
+
+/**
+  Function 		: NewL
+  Description 	: Creates an object of CT_SmtpCreateForwadMessage 				 
+  @return 		: N/A
+*/
+CT_SmtpCreateForwadMessage* CT_SmtpCreateForwadMessage::NewL(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+	{
+	CT_SmtpCreateForwadMessage* self = new(ELeave) CT_SmtpCreateForwadMessage(aSharedDataSMTP);
+	CleanupStack::PushL(self);
+	self->ConstructL(); 					 
+	CleanupStack::Pop(self);
+	return self;
+	}	
+
+	
+/**
+  Function 		: ~CT_SmtpCreateForwadMessage
+  Description 	: Destructor
+  @return 		: N/A
+*/
+CT_SmtpCreateForwadMessage::~CT_SmtpCreateForwadMessage()
+	{
+	delete iRecipientAddress;
+	delete iOperation;
+	iOperation = NULL;
+	}
+
+/**
+  Function 		: ProgressL
+  Description 	: Displays the status of the asynchronous operation
+  @return 		: N/A
+*/
+void CT_SmtpCreateForwadMessage::ProgressL(TBool /*bFinal*/)
+	{}
+
+
+/**
+  Function 		: CancelStep
+  Description 	: Cancels the asynchronous operation
+  @return 		: N/A
+*/
+void CT_SmtpCreateForwadMessage::CancelStep()
+	{
+	iOperation->Cancel();
+	}
+
+
+/**
+  Function 		: doTestStepL
+  Description 	: Creates a forward message for an existing message. Existing message
+  				  may be under some remot folder under IMAP service or under POP service.
+  @return 		: TVerdict - Test step result
+*/
+TVerdict CT_SmtpCreateForwadMessage::doTestStepL()
+	{
+	INFO_PRINTF1(_L("TestStep: SmtpCreateFwdMsgForPlainBodyTextMsg"));
+	TMsvId	entryToBesearched = KMsvNullIndexEntryId;
+	TPtrC serviceType;
+	if(!GetStringFromConfig( ConfigSection(), KServiceType, serviceType))
+		{
+		ERR_PRINTF1(_L("\"ServiceType\" for the message is not specified"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		TBuf<4> temp(serviceType);
+		temp.UpperCase();						// Makes case insensitive
+		// Perform the following if message has been downloaded using IMAP4 service
+		if(temp.CompareC(_L("IMAP")) == KZero)
+			{
+			// Read the IMAP account name from the ini file
+			TPtrC imapAccountName;
+			if(!GetStringFromConfig( ConfigSection(), KImapAccountName, imapAccountName))
+				{
+				ERR_PRINTF1(_L("ImapAccount Name is not specified"));
+				SetTestStepResult(EFail);
+				}
+			else
+				{
+				TPtrC	parentFolderName;
+				if(!GetStringFromConfig( ConfigSection(), KParentFolderName, parentFolderName))
+					{
+					ERR_PRINTF1(_L("Parent Folder is not specified"));
+					SetTestStepResult(EFail);
+					}
+				else
+					{
+					
+					// retrieves the folder Id based on the remote service folder name read from the ini file
+					entryToBesearched = CT_MsgUtils::GetRemoteFolderIdByNameL(iSharedDataSMTP.iSession, imapAccountName, parentFolderName);
+					if( entryToBesearched == KErrNotFound)
+						{
+						ERR_PRINTF1(_L("Invalid Remote folder name specified"));
+						SetTestStepResult(EFail);
+						}
+					else
+						{
+						INFO_PRINTF2(_L("The parent folder Id is %d"),entryToBesearched );
+						}
+					}
+				}
+			}
+		// Perform the following if message has been downloaded using POP3 service 	
+		else if(temp.CompareC(_L("POP")) == KZero)
+			{
+			TPtrC popAccountName;
+			if(!GetStringFromConfig( ConfigSection(), KPopAccountName, popAccountName))
+				{
+				ERR_PRINTF1(_L("PopAccount Name is not specified"));
+				SetTestStepResult(EFail);
+				}
+			else
+				{
+				// Retrieves the Pop service Id for the given Pop account
+				entryToBesearched = CT_MsgUtilsCentralRepository::GetPopServiceIdL((TDes&)popAccountName);
+				INFO_PRINTF2(_L("Pop service id is %d"), entryToBesearched);
+
+				// Fails the test step if an invalid POP account is specified 
+				if(entryToBesearched == KMsvNullIndexEntryId)
+					{
+					ERR_PRINTF1(_L("Invalid POP account name specified"));
+					SetTestStepResult(EFail);
+					}
+				}
+			}
+		else
+			{
+			ERR_PRINTF1(_L("Sevice Type is not specified: It should be IMAP or POP"));
+			SetTestStepResult(EFail);
+			}
+		}
+		
+	if(TestStepResult() == EPass)
+		{
+		TPtrC commandName;
+		if(!GetStringFromConfig( ConfigSection(), KCommandName, commandName))
+			{
+			ERR_PRINTF1(_L("Command name is not specified"));
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			// Read the name of the target folder from the ini file
+			TPtrC folderName;
+			if(!GetStringFromConfig( ConfigSection(), KFolderName, folderName))
+				{
+				ERR_PRINTF1(_L("Folder name is not specified"));
+				SetTestStepResult(EFail);
+				}
+			else
+				{
+				TPtrC subjectOfExistingMsg;	
+				if( !GetStringFromConfig(ConfigSection(), KSubjectOfExistingMsg, subjectOfExistingMsg))
+					{
+					ERR_PRINTF1(_L("\"SubjectOfExistingMsg\" is not specified"));
+					SetTestStepResult(EFail);
+					}
+				else
+					{
+					// Retrieves the message Id based on the message subject from the given remote service folder
+					TMsvId messageId;
+					messageId = CT_MsgUtils::SearchMessageBySubjectL(iSharedDataSMTP.iSession, entryToBesearched, subjectOfExistingMsg, ETrue);
+					if( messageId == KMsvNullIndexEntryId)
+						{
+						ERR_PRINTF1(_L("The given message is not found"));
+						SetTestStepResult(EFail);
+						}
+					else
+						{
+						TMsvId folderId;
+						folderId = CT_MsgUtilsEnumConverter::FindFolderIdByName(folderName);
+						
+						// Interpret the SMTP client MTM command to be executed 
+						TSmtpCmds commandId = CT_MsgUtilsEnumConverter::ConvertDesToTSmtpCmdsL((TDesC&) commandName);									
+
+						CMsvEntrySelection* selection = new (ELeave) CMsvEntrySelection;
+						CleanupStack::PushL(selection);
+									
+						selection->AppendL(folderId);
+						selection->AppendL(messageId);
+
+						TImCreateMessageOptions createMessageOptions;
+						createMessageOptions.iMsvPartList = KMsvMessagePartBody;
+						createMessageOptions.iMessageType = KUidMsgTypeSMTP;
+						createMessageOptions.iMsvEmailTypeList = 0;
+						TPckgBuf<TImCreateMessageOptions> paramPack(createMessageOptions);
+						
+						CT_MsgActive&	active=Active();
+						delete iOperation;
+						iOperation = NULL;
+						TRAPD(err2,iOperation = iSharedDataSMTP.iMtm->InvokeAsyncFunctionL(commandId,*selection,paramPack,active.iStatus));
+						active.Activate();
+						CActiveScheduler::Start();
+						SetHeaderPartL();
+
+						User::LeaveIfError(active.Result());
+						INFO_PRINTF2(_L("err2 : %d"), err2);
+						CleanupStack::PopAndDestroy(selection); // selection
+						}
+					}
+				}
+			}
+		}
+	return TestStepResult();
+	}
+
+
+/**
+  Function 		: SetHeaderPartL
+  Description 	: Sets the message header fields. If the field values are not provided
+  				  as input, it takes the default values.
+  @return 		: N/A  				  
+*/
+void CT_SmtpCreateForwadMessage::SetHeaderPartL()
+	{
+	//Get the message ID from the CMsvOperation object
+	TMsvId temp;	
+	TPckgC<TMsvId> paramPack(temp);
+	const TDesC8& progBuf = iOperation->ProgressL();	
+	paramPack.Set(progBuf);
+	TMsvId newMessageId = paramPack();	
+	if (newMessageId!=NULL)
+		{
+		CMsvEntry *entry = CMsvEntry::NewL(*(iSharedDataSMTP.iSession), newMessageId, TMsvSelectionOrdering(KMsvNoGrouping,EMsvSortByNone,ETrue));
+		CleanupStack::PushL(entry);
+		entry->SetEntryL(newMessageId);			// 
+		CMsvStore* store = entry->EditStoreL();
+		CleanupStack::PushL(store);
+		
+		CImHeader* header = CImHeader::NewLC(); 
+		header->RestoreL(*store); // Retrieves the email message header part from the message store
+		TPtrC subjectOfForwardMsg;
+		if(GetStringFromConfig(ConfigSection(), KSubjectOfForwardMsg, subjectOfForwardMsg))
+			{
+			header->SetSubjectL(subjectOfForwardMsg);
+			}
+		TPtrC recipientsAddress;	
+		if(GetStringFromConfig(ConfigSection(), KRecipientsAddress, recipientsAddress))
+			{
+			header->ToRecipients().AppendL(recipientsAddress);
+			}
+		else
+			{
+			GetDefaultAddressL();
+			header->ToRecipients().AppendL(*iRecipientAddress);
+			}
+		header->StoreL(*store);
+		store->CommitL();				// Saves the modifications to message store
+		TMsvEntry indexEntry = entry->Entry();
+		indexEntry.iDescription.Set(header->Subject());
+		INFO_PRINTF2(_L("Subject field of Forward message : %S"), &(indexEntry.iDescription));
+		indexEntry.SetVisible(ETrue);
+		entry->ChangeL(indexEntry);			// Modify the corresponding index entry permanently
+
+		CleanupStack::PopAndDestroy(3,entry);	//	header, store, 	entry
+		}
+	}
+
+
+/**
+  Function 		: GetDefaultAddressL
+  Description 	: Retrieve the default email address from the default SMTP service.
+  @return 		: N/A
+*/
+void CT_SmtpCreateForwadMessage::GetDefaultAddressL()
+	{
+	CImSmtpSettings* settings = new(ELeave) CImSmtpSettings();
+	CleanupStack::PushL(settings);
+
+	CEmailAccounts* accounts = CEmailAccounts::NewLC();
+	TSmtpAccount smtpAccount;
+	smtpAccount.iSmtpService = KMsvNullIndexEntryId;
+	accounts->DefaultSmtpAccountL(smtpAccount);
+	accounts->LoadSmtpSettingsL(smtpAccount, *settings);
+	CleanupStack::PopAndDestroy(accounts);					// accounts
+	iRecipientAddress = settings->EmailAddress().AllocL();
+	INFO_PRINTF2(_L("Default Email Address is %s"),iRecipientAddress->Ptr());
+	CleanupStack::PopAndDestroy(settings);					// settings
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/src/T_SmtpCreateNewMessageWithPlainBodyText.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,313 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file 
+// [TestStep Name]
+// SmtpCreateNewMessageWithPlainBodyText
+// [Paramaters]
+// Subject			:	Subject line of the message.
+// FolderName		:	Destination local folder where message is to be created.
+// RecipientsAddress:	Recepient's address.
+// EmailFileName	:	Plain text file name from which body text part would be populated. 
+// Creates a new message entry with plain body text. For creating the message entry it uses
+// CImEmailOperation::CreateNewL() static metod. After creating the message  entry
+// it populates the body part with the contents of a plain text file.
+// [APIs Used]
+// CImPlainBodyText::CommitL
+// CImPlainBodyText::StoreChunkL
+// CImEmailOperation::CreateNewL
+// CImEmailMessage::OpenPlainBodyTextForWriteL
+// 
+//
+
+
+
+// User includes 
+#include "t_smtpcreatenewmessagewithplainbodytext.h"
+#include <t_utilscentralrepository.h>
+#include <t_utilsenumconverter.h>
+#include <t_utils.h>
+
+// Epoc includes 
+#include <miutmsg.h>
+#include <cimplainbodytext.h>
+
+// Literals Used 
+_LIT(KSubject, "Subject");
+_LIT(KFolderName, "FolderName");
+_LIT(KEmailFileName, "EmailFileName");
+_LIT(KRecipientsAddress, "RecipientsAddress");
+
+const TInt KChunkSize = 1024;
+
+/**
+  Function 		: CT_SmtpCreateNewMessageWithPlainBodyText
+  Description 	: Constructor
+  @param 		: aSharedDataSMTP		Reference to CT_MsgSharedDataSmtp
+  @return 		: N/A
+*/
+CT_SmtpCreateNewMessageWithPlainBodyText::CT_SmtpCreateNewMessageWithPlainBodyText(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+:	CT_MsgAsyncStepSMTP(aSharedDataSMTP)
+,	iOperation(NULL)
+	{
+	SetTestStepName(KSmtpCreateNewMessageWithPlainBodyText);
+	}
+
+
+/**
+  Function 		: NewL
+  Description 	: Creates an object of CT_SmtpCreateNewMessageWithPlainBodyText 				 
+  @return 		: N/A
+*/
+CT_SmtpCreateNewMessageWithPlainBodyText* CT_SmtpCreateNewMessageWithPlainBodyText::NewL(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+	{
+	CT_SmtpCreateNewMessageWithPlainBodyText* self = new(ELeave) CT_SmtpCreateNewMessageWithPlainBodyText(aSharedDataSMTP);
+	CleanupStack::PushL(self);
+	self->ConstructL(); 					 
+	CleanupStack::Pop(self);
+	return self;
+	}	
+
+	
+/**
+  Function 		: ~CT_SmtpCreateNewMessageWithPlainBodyText
+  Description 	: Destructor
+  @return 		: N/A
+*/
+CT_SmtpCreateNewMessageWithPlainBodyText::~CT_SmtpCreateNewMessageWithPlainBodyText()
+	{
+	delete iRecipientAddress;
+	delete iOperation;
+	}
+
+/**
+  Function 		: ProgressL
+  Description 	: Displays the status of the asynchronous operation
+  @return 		: N/A
+*/
+void CT_SmtpCreateNewMessageWithPlainBodyText::ProgressL(TBool /*bFinal*/)
+	{}
+
+
+/**
+  Function 		: CancelStep
+  Description 	: Cancels the asynchronous operation
+  @return 		: N/A
+*/
+void CT_SmtpCreateNewMessageWithPlainBodyText::CancelStep()
+	{
+	iOperation->Cancel();
+	}
+
+
+/**
+  Function 		: doTestStepL
+  Description 	: Reads the SMTP account name, folder names, download limts and the command name from 
+				  the ini file. A selection of the entries uner the remote folder is obtained and passed to 
+				  InvokeAsyncFunctionL based on the command.
+  @return 		: TVerdict - Test step result
+*/
+TVerdict CT_SmtpCreateNewMessageWithPlainBodyText::doTestStepL()
+	{
+	INFO_PRINTF1(_L("TestStep: SmtpCreateNewMessageWithPlainBodyText"));
+
+	// Read the name of the target folder from the ini file
+	TPtrC folderName;
+	if(!GetStringFromConfig( ConfigSection(), KFolderName, folderName))
+		{
+		ERR_PRINTF1(_L("Folder name is not specified"));
+		SetTestStepResult(EFail);
+		}
+
+	TMsvId folderId;
+	// Get the Id of the local folder
+	folderId= CT_MsgUtilsEnumConverter::FindFolderIdByName(folderName);
+	iSharedDataSMTP.iMtm->SwitchCurrentEntryL(folderId);
+	TImCreateMessageOptions createMessageOptions;
+	createMessageOptions.iMsvPartList = KMsvMessagePartBody;
+	createMessageOptions.iMessageType = KUidMsgTypeSMTP;
+	
+	TPckgBuf<TImCreateMessageOptions> paramPack(createMessageOptions);
+	
+	CT_MsgActive&	active=Active();
+	delete iOperation;
+	iOperation = NULL;
+	TRAPD(err2, iOperation = CImEmailOperation::CreateNewL(active.iStatus, *iSharedDataSMTP.iSession, folderId,KMsvNullIndexEntryId, paramPack().iMsvPartList, paramPack().iMsvEmailTypeList, paramPack().iMessageType, CActive::EPriorityStandard, ETrue));
+	active.Activate();
+	CActiveScheduler::Start();
+
+	SetHeaderPartL();
+	PopulateBodyPartL();
+	User::LeaveIfError(active.Result());
+	INFO_PRINTF2(_L("err2 : %d"), err2);
+	return TestStepResult();
+	}
+		
+
+/**
+  Function 		: PopulateBodyPartL
+  Description 	: Populates body part with the contents of a plain text file.
+  @return 		: N/A
+*/
+void CT_SmtpCreateNewMessageWithPlainBodyText::PopulateBodyPartL()
+	{
+	//Get the message ID from the CMsvOperation object
+	TMsvId temp;	
+	TPckgC<TMsvId> paramPack(temp);
+	const TDesC8& progBuf = iOperation->ProgressL();	
+	paramPack.Set(progBuf);
+	TMsvId newMessageId = paramPack();	
+	if (newMessageId!=NULL)
+		{
+		CMsvEntry *entry = CMsvEntry::NewL(*(iSharedDataSMTP.iSession), newMessageId, TMsvSelectionOrdering(KMsvNoGrouping,EMsvSortByNone,ETrue));
+		CleanupStack::PushL(entry);
+		entry->SetEntryL(newMessageId);
+		CImEmailMessage *emailMessage = CImEmailMessage::NewLC(*entry);
+		CImPlainBodyText* bodytext = emailMessage->OpenPlainBodyTextForWriteL();
+		CleanupStack::PushL(bodytext);
+		
+
+		TPtrC emailFileName;	
+		// Read the name of the email file from the ini
+		if(!GetStringFromConfig(ConfigSection(),KEmailFileName,emailFileName))
+			{
+			ERR_PRINTF1(_L("Email file name not specified"));
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			RFs	fs;
+			User::LeaveIfError(fs.Connect());
+			CleanupClosePushL(fs);
+
+			RFile	file;
+			User::LeaveIfError(file.Open(fs,emailFileName,EFileRead));
+			CleanupClosePushL(file);
+
+
+			TBuf8<KChunkSize> line;
+			TBuf8<1> aChar;				// To read one character from the file
+			TBool finished = FALSE;
+
+			// Read text from the file
+			do
+				{
+				line.FillZ();
+				line.SetLength(0);
+				// Read one line from email file
+				do 
+					{
+					file.Read(aChar, 1);
+					if(aChar.Length())
+						{
+						line.Append(aChar);
+						}
+					else
+						{
+						finished = TRUE;
+						}
+					}while(aChar.Length() && aChar[0] != 0x0A);
+				if(!line.Length())
+					{
+					break;
+					}
+				CT_MsgActive& active=Active();				
+				bodytext->StoreChunkL(line,active.iStatus);
+				active.Activate();
+				CActiveScheduler::Start();			
+				}while(!finished);
+				
+			CT_MsgActive& active=Active();	
+			bodytext->CommitL(active.iStatus);
+			active.Activate();
+			CActiveScheduler::Start();			
+			
+			CleanupStack::PopAndDestroy(2); // delete file,fs
+			}
+		CleanupStack::PopAndDestroy(3, entry); // delete bodytext,emailMessage,entry
+		}
+	}
+
+
+/**
+  Function 		: GetDefaultAddressL
+  Description 	: Retrieve the default email address from the default SMTP service.
+  @return 		: N/A
+*/
+void CT_SmtpCreateNewMessageWithPlainBodyText::GetDefaultAddressL()
+	{
+	CImSmtpSettings* settings = new(ELeave) CImSmtpSettings();
+	CleanupStack::PushL(settings);
+
+	CEmailAccounts* accounts = CEmailAccounts::NewLC();
+	TSmtpAccount smtpAccount;
+	smtpAccount.iSmtpService = KMsvNullIndexEntryId;
+	accounts->DefaultSmtpAccountL(smtpAccount);
+	accounts->LoadSmtpSettingsL(smtpAccount, *settings);
+	CleanupStack::PopAndDestroy(accounts);								// accounts
+	iRecipientAddress = settings->EmailAddress().AllocL();
+	INFO_PRINTF2(_L("Default Email Address is %s"),iRecipientAddress->Ptr());
+	CleanupStack::PopAndDestroy(settings);								// settings
+	}
+	
+	
+/**
+  Function 		: SetHeaderPartL
+  Description 	: Sets the message header fields. If the field values are not provided
+  				  as input, it takes the default values.
+  @return 		: N/A  				  
+*/
+void CT_SmtpCreateNewMessageWithPlainBodyText::SetHeaderPartL()
+	{
+	//check progress
+	TMsvId temp;	
+	TPckgC<TMsvId> paramPack(temp);
+	const TDesC8& progBuf = iOperation->ProgressL();	
+	paramPack.Set(progBuf);
+	TMsvId newMessageId = paramPack();	
+	if (newMessageId!=NULL)
+		{
+		CMsvEntry *entry = CMsvEntry::NewL(*(iSharedDataSMTP.iSession), newMessageId, TMsvSelectionOrdering(KMsvNoGrouping,EMsvSortByNone,ETrue));
+		CleanupStack::PushL(entry);
+		entry->SetEntryL(newMessageId);			// 
+		CMsvStore* store = entry->EditStoreL();
+		CleanupStack::PushL(store);
+		
+		CImHeader* header = CImHeader::NewLC(); 
+		header->RestoreL(*store); // Retrieves the email message header part from the message store
+		TPtrC subject;
+		if(GetStringFromConfig(ConfigSection(), KSubject, subject))
+			{
+			header->SetSubjectL(subject);
+			}
+		TPtrC recipientsAddress;	
+		if(GetStringFromConfig(ConfigSection(), KRecipientsAddress, recipientsAddress))
+			{
+			header->ToRecipients().AppendL(recipientsAddress);
+			}
+		else
+			{
+			GetDefaultAddressL();
+			header->ToRecipients().AppendL(*iRecipientAddress);
+			}
+		header->StoreL(*store);
+		store->CommitL();				// Saves the modifications to message store
+		TMsvEntry indexEntry = entry->Entry();
+		indexEntry.iDescription.Set(header->Subject());
+		INFO_PRINTF2(_L("Subject field created message : %S"), &(indexEntry.iDescription));
+		indexEntry.SetVisible(ETrue);
+		entry->ChangeL(indexEntry);			// Modify the corresponding index entry permanently
+
+		CleanupStack::PopAndDestroy(3,entry);				// 	header, store, 	entry
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/src/T_SmtpCreateReplyMessage.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,325 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file 
+// [TestStep Name]
+// SmtpCreateReplyMessage
+// [Paramaters]
+// ServiceType		:	Specifies the service type(IMAP or POP) under which message exists.
+// FolderName		:	Destination local folder where message is to be created.
+// ImapAccountName	:	If service type is IMAP4, specify the IMAP account name that holds the
+// message.
+// ParentFolderName:	IMAP4 folder name that holds the message.
+// PopAccountName	:	If the the sevice type is POP3, specify POP account name.
+// CommandName		:	SMTP client MTM command used to create the Reply message.
+// FolderName		:	Destination local folder in which message would be storted.
+// SubjectOfExistingMsg: Sbject line of the existing message to which reply message
+// would be creted.
+// SubjectOfReplyMsg:	Specifies the subject line to be set for the reply message.
+// This is an optional parameter and if not specified the subject line
+// would take the default format(Re: <SubjectOfExistingMsg>).
+// Creates a reply message using the message that exists under remote service. Remote service
+// can be of type IMAP4 or POP3.
+// [APIs Used]
+// 
+//
+
+
+
+// User includes 
+#include "T_SmtpCreateReplyMessage.h"
+#include <t_utilscentralrepository.h>
+#include <t_utilsenumconverter.h>
+#include <t_utils.h>
+
+
+// Epoc includes 
+#include <miutmsg.h>
+
+
+// Literals Used 
+_LIT(KServiceType, "ServiceType");
+
+_LIT(KImapAccountName,"ImapAccountName");
+_LIT(KParentFolderName,"ParentFolderName");
+
+_LIT(KPopAccountName,"PopAccountName");
+
+_LIT(KCommandName,"CommandName");
+_LIT(KFolderName, "FolderName");
+_LIT(KSubjectOfExistingMsg,"SubjectOfExistingMsg");
+
+_LIT(KSubjectOfReplyMsg, "SubjectOfReplyMsg");
+
+const TInt KZero={0};
+/**
+  Function 		: CT_SmtpCreateReplyMessage
+  Description 	: Constructor
+  @param 		: aSharedDataSMTP		Reference to CT_MsgSharedDataSmtp
+  @return 		: N/A
+*/
+CT_SmtpCreateReplyMessage::CT_SmtpCreateReplyMessage(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+:	CT_MsgAsyncStepSMTP(aSharedDataSMTP)
+,	iOperation(NULL)
+	{
+	SetTestStepName(KSmtpCreateReplyMessage);
+	}
+
+
+/**
+  Function 		: NewL
+  Description 	: Creates an object of CT_SmtpCreateReplyMessage 				 
+  @return 		: N/A
+*/
+CT_SmtpCreateReplyMessage* CT_SmtpCreateReplyMessage::NewL(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+	{
+	CT_SmtpCreateReplyMessage* self = new(ELeave) CT_SmtpCreateReplyMessage(aSharedDataSMTP);
+	CleanupStack::PushL(self);
+	self->ConstructL(); 					 
+	CleanupStack::Pop(self);
+	return self;
+	}	
+
+	
+/**
+  Function 		: ~CT_SmtpCreateReplyMessage
+  Description 	: Destructor
+  @return 		: N/A
+*/
+CT_SmtpCreateReplyMessage::~CT_SmtpCreateReplyMessage()
+	{
+	delete iOperation;
+	iOperation = NULL;
+	}
+
+/**
+  Function 		: ProgressL
+  Description 	: Displays the status of the asynchronous operation
+  @return 		: N/A
+*/
+void CT_SmtpCreateReplyMessage::ProgressL(TBool /*bFinal*/)
+	{}
+
+
+/**
+  Function 		: CancelStep
+  Description 	: Cancels the asynchronous operation
+  @return 		: N/A
+*/
+void CT_SmtpCreateReplyMessage::CancelStep()
+	{
+	iOperation->Cancel();
+	}
+
+
+/**
+  Function 		: doTestStepL
+  Description 	: Creates a Reply message for an existing message. Existing message
+  				  may be under some remot folder under IMAP service or under POP service.
+  @return 		: TVerdict - Test step result
+*/
+TVerdict CT_SmtpCreateReplyMessage::doTestStepL()
+	{
+	INFO_PRINTF1(_L("TestStep: SmtpCreateReplyMessage"));
+	TMsvId	entryToBesearched = KMsvNullIndexEntryId;
+	TPtrC serviceType;
+	if(!GetStringFromConfig( ConfigSection(), KServiceType, serviceType))
+		{
+		ERR_PRINTF1(_L("Service type for the message is not specified"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		TBuf<4> temp(serviceType);
+		temp.UpperCase();						// Makes case insensitive
+		// Perform the following if message has been downloaded using IMAP4 service
+		if(temp.CompareC(_L("IMAP")) == KZero)
+			{
+			// Read the IMAP account name from the ini file
+			TPtrC imapAccountName;
+			if(!GetStringFromConfig( ConfigSection(), KImapAccountName, imapAccountName))
+				{
+				ERR_PRINTF1(_L("ImapAccount Name is not specified"));
+				SetTestStepResult(EFail);
+				}
+			else
+				{
+				TPtrC	parentFolderName;
+				if(!GetStringFromConfig( ConfigSection(), KParentFolderName, parentFolderName))
+					{
+					ERR_PRINTF1(_L("Parent Folder is not specified"));
+					SetTestStepResult(EFail);
+					}
+				else
+					{
+					
+					// retrieves the folder Id based on the remote service folder name read from the ini file
+					entryToBesearched = CT_MsgUtils::GetRemoteFolderIdByNameL(iSharedDataSMTP.iSession, imapAccountName, parentFolderName);
+					if( entryToBesearched == KErrNotFound)
+						{
+						ERR_PRINTF1(_L("Invalid Remote folder name specified"));
+						SetTestStepResult(EFail);
+						}
+					else
+						{
+						INFO_PRINTF2(_L("The parent folder Id is %d"),entryToBesearched );
+						}
+					}
+				}
+			}
+		// Perform the following if message has been downloaded using POP3 service 	
+		else if(temp.CompareC(_L("POP")) == KZero)
+			{
+			TPtrC popAccountName;
+			if(!GetStringFromConfig( ConfigSection(), KPopAccountName, popAccountName))
+				{
+				ERR_PRINTF1(_L("PopAccount Name is not specified"));
+				SetTestStepResult(EFail);
+				}
+			else
+				{
+				// Retrieves the Pop service Id for the given Pop account
+				entryToBesearched = CT_MsgUtilsCentralRepository::GetPopServiceIdL((TDes&)popAccountName);
+				INFO_PRINTF2(_L("Pop service id is %d"), entryToBesearched);
+
+				// Fails the test step if an invalid POP account is specified 
+				if(entryToBesearched == KMsvNullIndexEntryId)
+					{
+					ERR_PRINTF1(_L("Invalid POP account name specified"));
+					SetTestStepResult(EFail);
+					}
+				}
+			}
+		else
+			{
+			ERR_PRINTF1(_L("Sevice Type is not specified: It should be IMAP or POP"));
+			SetTestStepResult(EFail);
+			}
+		}
+		
+	if(TestStepResult() == EPass)
+		{
+		TPtrC commandName;
+		if(!GetStringFromConfig( ConfigSection(), KCommandName, commandName))
+			{
+			ERR_PRINTF1(_L("Command name is not specified"));
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			// Read the name of the target folder from the ini file
+			TPtrC folderName;
+			if(!GetStringFromConfig( ConfigSection(), KFolderName, folderName))
+				{
+				ERR_PRINTF1(_L("Folder name is not specified"));
+				SetTestStepResult(EFail);
+				}
+			else
+				{
+				TPtrC subjectOfExistingMsg;	
+				if( !GetStringFromConfig(ConfigSection(), KSubjectOfExistingMsg, subjectOfExistingMsg))
+					{
+					ERR_PRINTF1(_L("The subject of the message is not specified"));
+					SetTestStepResult(EFail);
+					}
+				else
+					{
+					// Retrieves the message Id based on the message subject from the given remote service folder
+					TMsvId messageId;
+					messageId = CT_MsgUtils::SearchMessageBySubjectL(iSharedDataSMTP.iSession, entryToBesearched, subjectOfExistingMsg, ETrue);
+					if( messageId == KMsvNullIndexEntryId)
+						{
+						ERR_PRINTF1(_L("The given message is not found"));
+						SetTestStepResult(EFail);
+						}
+					else
+						{
+						TMsvId folderId;
+						folderId = CT_MsgUtilsEnumConverter::FindFolderIdByName(folderName);
+						
+						// Interpret the SMTP client MTM command to be executed 
+						TSmtpCmds commandId = CT_MsgUtilsEnumConverter::ConvertDesToTSmtpCmdsL((TDesC&) commandName);									
+
+						CMsvEntrySelection* selection = new (ELeave) CMsvEntrySelection;
+						CleanupStack::PushL(selection);
+									
+						selection->AppendL(folderId);
+						selection->AppendL(messageId);
+
+						TImCreateMessageOptions createMessageOptions;
+						createMessageOptions.iMsvPartList = KMsvMessagePartBody;
+						createMessageOptions.iMessageType = KUidMsgTypeSMTP;
+						createMessageOptions.iMsvEmailTypeList = 0;
+
+						TPckgBuf<TImCreateMessageOptions> paramPack(createMessageOptions);
+						
+						CT_MsgActive&	active=Active();
+						delete iOperation;
+						iOperation = NULL;
+						TRAPD(err2,iOperation = iSharedDataSMTP.iMtm->InvokeAsyncFunctionL(commandId,*selection,paramPack,active.iStatus));
+						active.Activate();
+						CActiveScheduler::Start();
+						SetHeaderPartL();
+
+						User::LeaveIfError(active.Result());
+						INFO_PRINTF2(_L("err2 : %d"), err2);
+						CleanupStack::PopAndDestroy(selection); // selection
+						}
+					}
+				}
+			}
+		}
+	return TestStepResult();
+	}
+
+
+/**
+  Function 		: SetHeaderPartL
+  Description 	: Sets the message header fields. If the field values are not provided
+  				  as input, it takes the default values.
+  @return 		: N/A  				  
+*/
+void CT_SmtpCreateReplyMessage::SetHeaderPartL()
+	{
+	//Get the message ID from the CMsvOperation object
+	TMsvId temp;	
+	TPckgC<TMsvId> paramPack(temp);
+	const TDesC8& progBuf = iOperation->ProgressL();	
+	paramPack.Set(progBuf);
+	TMsvId newMessageId = paramPack();	
+	if (newMessageId!=NULL)
+		{
+		CMsvEntry *entry = CMsvEntry::NewL(*(iSharedDataSMTP.iSession), newMessageId, TMsvSelectionOrdering(KMsvNoGrouping,EMsvSortByNone,ETrue));
+		CleanupStack::PushL(entry);
+		entry->SetEntryL(newMessageId);			// 
+		CMsvStore* store = entry->EditStoreL();
+		CleanupStack::PushL(store);
+		
+		CImHeader* header = CImHeader::NewLC(); 
+		header->RestoreL(*store); // Retrieves the email message header part from the message store
+		TPtrC subjectOfReplyMsg;
+		if(GetStringFromConfig(ConfigSection(), KSubjectOfReplyMsg, subjectOfReplyMsg))
+			{
+			header->SetSubjectL(subjectOfReplyMsg);
+			}
+		header->StoreL(*store);
+		store->CommitL();				// Saves the modifications to message store
+		TMsvEntry indexEntry = entry->Entry();
+		indexEntry.iDescription.Set(header->Subject());
+		INFO_PRINTF2(_L("Subject field of Reply message : %S"), &(indexEntry.iDescription));
+		indexEntry.SetVisible(ETrue);
+		entry->ChangeL(indexEntry);			// Modify the corresponding index entry permanently
+
+		CleanupStack::PopAndDestroy(3,entry); // header, store, entry			
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/src/T_SmtpSendEmail.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,207 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// [TestStep Name]
+// SmtpSendEmail
+// [Parameters]
+// sender			:	User name of email sender
+// recipient		:	User name of email recipient
+// mailFile		:	Path of the meta data file to check
+// serverIP 		:	IP address of SMTP server
+// This test step will send an email from <sender> to <recipient> with the contents
+// of <mailfile> as message body using the SMTP server specified by <serverIP>.
+// [APIs Used]
+// RFile::Open
+// RFile::Read
+// CImTextServerSession::QueueConnectL
+// CImTextServerSession::Send
+// CImTextServerSession::QueueReceiveNextTextLine
+// CImTextServerSession::GetCurrentTextLine
+// CImTextServerSession::Disconnect
+// CImIAPPreferences::NewLC
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+
+//User includes
+#include <t_utilsconfigfilemachinename.h>
+#include "T_UtilsSendEmail.h"
+#include "T_SmtpSendEmail.h"
+
+
+// Literals Used
+_LIT(KSender,"Sender");
+_LIT(KRecipient,"Recipient");
+_LIT(KMailFile,"MailFile");
+_LIT(KServerIP,"ServerIP");
+
+
+/**
+CT_MsgSmtpSendEmail()
+Constructor
+
+@param aSharedDataSMTP
+*/
+CT_MsgSmtpSendEmail::CT_MsgSmtpSendEmail(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+:	CT_MsgAsyncStepSMTP(aSharedDataSMTP)
+	{
+	SetTestStepName(KSmtpSendEmail);
+	}
+
+/**
+NewL()
+Static factory constructor. Uses two phase 
+construction.
+
+@param aSharedDataSMTP
+@leave KErrNoMemory
+@return
+A pointer to the newly created CT_MsgSendSmtpMessage object.
+*/
+CT_MsgSmtpSendEmail* CT_MsgSmtpSendEmail::NewL(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+	{
+	CT_MsgSmtpSendEmail* self = new(ELeave) CT_MsgSmtpSendEmail(aSharedDataSMTP);
+	CleanupStack::PushL(self);
+	self->ConstructL(); 					 // Call CT_AsyncStep::ConstructL()
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+
+/**
+~CT_MsgSmtpSendEmail()
+Destructor
+*/
+CT_MsgSmtpSendEmail::~CT_MsgSmtpSendEmail()
+	{
+	if(iSendEmail!=NULL)
+		{
+		delete iSendEmail;
+		iSendEmail = NULL;	
+		}
+
+	if(iMachineNameFile!=NULL)
+		{
+		delete iMachineNameFile;
+		iMachineNameFile = NULL;
+		}
+	}
+
+
+/**
+ProgressL()
+
+*/
+void CT_MsgSmtpSendEmail::ProgressL(TBool bFinal)
+	{
+	//	TODO
+	if ( bFinal )
+		{
+		//	Display final progress iSendEmail
+		}
+	else
+		{
+		//	Display current progress iSendEmail
+		}
+	}
+
+/**
+CancelStep()
+
+*/
+void CT_MsgSmtpSendEmail::CancelStep()
+	{
+	//	TODO cancel iSendEmail
+	}
+
+	
+/**
+doTestStepL()
+Reads the parent folder name, the message subject from the ini file
+Searches for the message under the specified folder, and sends the message
+
+@return
+Returns the test step result
+*/
+TVerdict CT_MsgSmtpSendEmail::doTestStepL()
+	{
+	INFO_PRINTF1( _L("Test Step :  Smtp Send Email") );
+	TPtrC8	string8Ptr; 
+	TPtrC	stringPtr = KNone();
+	// Gets the machine name of the system
+	if(iMachineNameFile==NULL)
+	{
+	iMachineNameFile = CT_MsgUtilsConfigFileMachineName::NewL(stringPtr);
+	}
+
+	TPtrC8	machineName(iMachineNameFile->MachineName());
+
+	// Read the username of the email sender from the ini file
+	TPtrC	sender;
+	if(!GetStringFromConfig( ConfigSection(), KSender, sender))
+		{
+		ERR_PRINTF1(_L("Sender is not specified"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		// Read the username of the email recipient from the ini file
+		TPtrC	recipient;
+		if( !GetStringFromConfig(ConfigSection(),KRecipient,recipient ))
+			{
+			ERR_PRINTF1(_L("Recipient is not specified"));
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			// Read the path of the mailfile from the ini file
+			TPtrC	mailFile;
+			if( !GetStringFromConfig(ConfigSection(),KMailFile,mailFile ))
+				{
+				ERR_PRINTF1(_L("MailFile is not specified"));
+				SetTestStepResult(EFail);
+				}
+			else
+				{
+				// Read the server IP address from the ini file
+				TPtrC	serverIP;
+				if( !GetStringFromConfig(ConfigSection(),KServerIP,serverIP ))
+					{
+					ERR_PRINTF1(_L("ServerIP is not specified"));
+					SetTestStepResult(EFail);
+					}
+				else
+					{
+					if(iSendEmail==NULL)
+						{
+						iSendEmail = CT_MsgUtilsSendEmail::NewL(*this);
+						}
+
+					CT_MsgActive&	active=Active();
+					iSendEmail->StartL(sender,recipient,mailFile,serverIP, active.iStatus);
+					active.Activate();
+					CActiveScheduler::Start();
+					User::LeaveIfError(active.Result());
+					}
+				}
+			}
+		}
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/src/T_SmtpServer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,222 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+// User includes
+#include "T_MsgServer.h"
+#include "T_SmtpServer.h"
+#include "T_MsgSharedDataSmtp.h"
+
+// Header files of Test Steps SMTP
+#include "T_CreateSmtpMessageFromEmailFile.h"
+#include "T_SendSmtpMessage.h"
+#include "T_SmtpSendEmail.h"
+#include "T_StartRamUsageTimer.h"
+#include "T_StopRamUsageTimer.h"
+#include "t_smtpcreatenewmessagewithplainbodytext.h"
+#include "T_SmtpCreateForwardMessage.h"
+#include "T_SmtpCreateReplyMessage.h"
+#include "T_RetrievePlainBodyTextAndCompare.h"
+#include "T_CreateSmtpMobilityAccount.h"
+#include "T_CreateSmtpAccount.h"
+#include "T_CheckSmtpSNAPSetting.h"
+#include "T_ModifySmtpSettings.h"
+#include "T_RemoveSmtpSNAPSetting.h"
+#include "T_CheckSmtpBMSetting.h"
+
+/**
+MainL()
+This is the main function which installs the 
+active scheduler and creates an object of the Email server
+*/
+LOCAL_C void MainL()
+/**
+ * Secure variant
+ * Much simpler, uses the new Rendezvous() call to sync with the client
+ */
+	{
+	RProcess().DataCaging(RProcess::EDataCagingOn);
+	RProcess().SecureApi(RProcess::ESecureApiOn);
+
+	CActiveScheduler*	sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sched);
+	CT_MsgSmtpServer* server = NULL;
+
+	// Create the CTestServer derived Email server
+	TRAPD(err, server = CT_MsgSmtpServer::NewL());
+	if ( err == KErrNone )
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	delete server;
+	server=NULL;
+	delete sched;
+	sched=NULL;
+	}
+
+
+/**
+E32Main()
+This function is the entry point for T_MsgSmtpServer test server
+
+@return - Standard Epoc error code on process exit
+Secure variant only
+Process entry point. Called by client using RProcess API
+*/
+GLDEF_C TInt E32Main()
+	{
+	__UHEAP_MARK;
+	
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAP_IGNORE(MainL());	
+	delete cleanup;
+	cleanup=NULL;
+	__UHEAP_MARKEND;
+	
+	return KErrNone;
+    }
+    
+
+
+/**
+NewL()
+Static factory constructor. Uses two phase 
+construction.
+
+@leave KErrNoMemory
+@return
+A pointer to the newly created CT_MsgSmtpServer object.
+*/
+CT_MsgSmtpServer* CT_MsgSmtpServer::NewL()
+	{
+	CT_MsgSmtpServer* server=new(ELeave) CT_MsgSmtpServer();
+	CleanupStack::PushL(server);
+//	server->StartL(KSmtpServer);
+	server->ConstructL(KSmtpServer);
+	CleanupStack::Pop(server);
+	return server;
+	}
+
+
+/**
+CT_MsgSmtpServer()
+Constructor
+*/
+CT_MsgSmtpServer::CT_MsgSmtpServer()
+:	iSharedDataSMTP(NULL)
+	{
+	}
+
+
+/**
+CreateSharedDataL()
+Creates an object of Shared Data
+
+@return
+Returns a CT_MsgSharedDataBase object that would be shared across
+the test steps creted by the T_MsgSmtpServer test server.
+*/
+CT_MsgSharedDataBase* CT_MsgSmtpServer::NewSharedDataL()
+	{
+	return iSharedDataSMTP = CT_MsgSharedDataSmtp::NewL();
+	}
+		
+			
+/**
+CreateTestStep()
+Creates the test steps based on the name read from the script file
+
+@param	aStepName
+The name of the test step to be created
+
+@return
+The CTestStep object created
+*/ 
+CTestStep* CT_MsgSmtpServer::CreateTestStepL(const TDesC& aStepName)
+	{
+	CTestStep* testStep = NULL;
+
+	 if(aStepName == KCreateSmtpMessageFromEmailFile)
+		{
+		 testStep = CT_MsgCreateSmtpMessageFromEmailFile::NewL(*iSharedDataSMTP);
+		}
+	else if(aStepName == KSendSmtpMessage)
+		{
+		testStep = CT_MsgSendSmtpMessage::NewL(*iSharedDataSMTP);
+		}
+	else if(aStepName == KSmtpSendEmail)
+		{
+		testStep = CT_MsgSmtpSendEmail::NewL(*iSharedDataSMTP);
+		}
+	else if(aStepName == KStartRamUsageTimer)
+		{
+		testStep = new(ELeave) CT_StartRamUsageTimer(*iSharedDataSMTP);
+		}
+	else if(aStepName == KStopRamUsageTimer)
+		{
+		testStep = new(ELeave) CT_StopRamUsageTimer(*iSharedDataSMTP);
+		}
+	else if(aStepName == KSmtpCreateNewMessageWithPlainBodyText)
+		{
+		testStep = CT_SmtpCreateNewMessageWithPlainBodyText::NewL(*iSharedDataSMTP);
+		}
+	else if(aStepName == KSmtpCreateForwadMessage)
+		{
+		testStep = CT_SmtpCreateForwadMessage::NewL(*iSharedDataSMTP);
+		}
+	else if(aStepName == KSmtpCreateReplyMessage)
+		{
+		testStep = CT_SmtpCreateReplyMessage::NewL(*iSharedDataSMTP);
+		}
+	else if(aStepName == KRetrievePlainBodyTextAndCompare)
+		{
+		testStep = CT_RetrievePlainBodyTextAndCompare::NewL(*iSharedDataSMTP);
+		}
+	else if(aStepName == KCreateSmtpMobilityAccount)
+		{
+		testStep = CT_MsgCreateSmtpMobilityAccount::NewL(*iSharedDataSMTP);
+		}
+	else if(aStepName == KCreateSmtpAccount)
+		{
+		testStep = new(ELeave) CT_MsgCreateSmtpAccount(*iSharedDataSMTP);
+		}
+	else if(aStepName == KCheckSmtpSNAPSetting)
+		{
+		testStep = new(ELeave) CT_MsgCheckSmtpSNAPSetting(*iSharedDataSMTP);
+		}
+	else if(aStepName == KModifySmtpSettings)
+		{
+		testStep = new(ELeave) CT_MsgModifySmtpSettings(*iSharedDataSMTP);
+		}
+	else if(aStepName == KRemoveSmtpSNAPSetting)
+		{
+		testStep = new(ELeave) CT_MsgRemoveSmtpSNAPSetting(*iSharedDataSMTP);
+		}
+	else if(aStepName == KCheckSmtpBMSetting)
+		{
+		testStep = new(ELeave) CT_MsgCheckSmtpBMSetting(*iSharedDataSMTP);
+		}
+	else
+		{
+		testStep = CT_MsgServer::CreateTestStepL(aStepName);
+		}
+	return testStep;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/src/T_StartRamUsageTimer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,148 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file 
+// [TestStep Name]
+// StartRamUsageTimer
+// [Paramaters]
+// IntervalTimeInMicroSecs			<input>	: The interval between events generated
+// after the initial delay, in microseconds
+// Starts periodical measurement of RAM memory used and updates the information kept
+// in SMTP testserver.
+// [APIs Used]
+// 
+//
+
+
+
+// User includes 
+#include "T_StartRamUsageTimer.h"
+#include "T_MsgSharedDataSmtp.h"
+
+// Epoc includes
+#include <hal.h>
+#include <hal_data.h>
+
+// Literals used
+_LIT(KIntervalTimeInMicroSecs, "IntervalTimeInMicroSecs");
+
+/**
+  Function 		: CT_StartRamUsageTimer
+  Description 	: Constructor
+  @return 		: none
+*/
+CT_StartRamUsageTimer::CT_StartRamUsageTimer(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+:CT_MsgAsyncStepSMTP(aSharedDataSMTP)
+	{
+	SetTestStepName(KStartRamUsageTimer);
+	}
+
+/**
+  Function 		: ~CT_StartRamUsageTimer
+  Description 	: Destructor
+  @return 		: N/A
+*/
+CT_StartRamUsageTimer::~CT_StartRamUsageTimer()
+	{}
+	
+
+/**
+  Function 		: doTestStepL
+  Description 	: Generate a periodic Timer event and handle the RAM usage callback function
+  @return 		: TVerdict Test result
+*/
+TVerdict CT_StartRamUsageTimer::doTestStepL()
+	{
+	INFO_PRINTF1(_L("TestStep :StartRamUsageTimer"));
+	TInt intervalTime = 0;	
+	if(!GetIntFromConfig(ConfigSection(),KIntervalTimeInMicroSecs,intervalTime))
+		{
+		ERR_PRINTF1(_L("Interval time is not specified"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		iSharedDataSMTP.iPeriodic->Start(intervalTime, intervalTime, TCallBack(RamUsage,this));
+		}
+	return TestStepResult();	
+	}
+
+/**
+  Function 		: RamUsage
+  Description 	: Call non-static method DoRamUsage
+  @return 		: TInt
+*/
+TInt CT_StartRamUsageTimer::RamUsage(TAny* aObject)
+	{
+	// Cast, and call non-static function
+	((CT_StartRamUsageTimer *)aObject)->DoRamUsage();	
+	return 1;	
+	}
+
+/**
+  Function 		: DoRamUsage
+  Description 	: Calculate the RAM usage value and percentage at a particular instance 
+  @return 		: void
+*/	
+void CT_StartRamUsageTimer::DoRamUsage()
+	{
+	
+	TInt fullRamValue;
+	TInt ramFreeValue;
+	
+	HAL 	data;
+	HALData haldata;
+	
+	data.Get(haldata.EMemoryRAM, fullRamValue);
+	data.Get(haldata.EMemoryRAMFree, ramFreeValue);	
+	
+	TInt ramUsage = ((fullRamValue - ramFreeValue)/(1024));
+	
+	if ( iSharedDataSMTP.iMark != EFalse )
+		{
+		iSharedDataSMTP.iStartRamValue = ramUsage;
+		iSharedDataSMTP.iMinRamValue = ramUsage;
+		iSharedDataSMTP.iMaxRamValue = ramUsage;
+		iSharedDataSMTP.iMark = EFalse;
+		}
+	
+	if ( iSharedDataSMTP.iMinRamValue > ramUsage )
+		{
+		iSharedDataSMTP.iMinRamValue = ramUsage;
+		}
+		
+	if ( iSharedDataSMTP.iMaxRamValue < ramUsage )
+		{
+		iSharedDataSMTP.iMaxRamValue = ramUsage;
+		}
+	
+	iSharedDataSMTP.iEndRamValue = ramUsage;
+	}
+	
+
+	
+/**
+  Function 		: ProgressL
+  Description 	: Displays the progress information of the asynchronous operation
+  @return 		: void
+*/
+void CT_StartRamUsageTimer::ProgressL(TBool /*aFinal*/)
+	{}
+
+/**
+  Function 		: CancelStep
+  Description 	: Cancels the asynchronous operation
+  @return 		: void
+*/
+void CT_StartRamUsageTimer::CancelStep()
+	{}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/src/T_StopRamUsageTimer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,129 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file 
+// [TestStep Name]
+// StopRamUsageTimer
+// [Paramaters]
+// EventStartCode			<input>	: Start event code which maps to the RAM usage value
+// when tacking of RAM usage got started.
+// EventStopCode			<input> : Stop event code which maps to the RAM usage value
+// when tacking of RAM usage got stopped.
+// Stops periodical measurement of RAM memory used and logs the RAM usage information
+// [APIs Used]
+// 
+//
+
+
+
+// User includes
+#include "T_StopRamUsageTimer.h"
+#include <t_utilsenumconverter.h>
+#include <t_testinstrumentation.h>
+
+
+// Literals used
+_LIT(KEventStartCode, "EventStartCode");
+_LIT(KEventStopCode, "EventStopCode");
+
+
+/**
+  Function 		: CT_StopRamUsageTimer
+  Description 	: Constructor
+  @return 		: none
+*/
+CT_StopRamUsageTimer::CT_StopRamUsageTimer(CT_MsgSharedDataSmtp& aSharedDataSMTP)
+:CT_MsgAsyncStepSMTP(aSharedDataSMTP)
+	{
+	SetTestStepName(KStopRamUsageTimer);
+	}
+	
+/**
+  Function 		: ~CT_StopRamUsageTimer
+  Description 	: Destructor
+  @return 		: N/A
+*/
+CT_StopRamUsageTimer::~CT_StopRamUsageTimer()
+	{}
+	
+
+/**
+  Function 		: doTestStepL
+  Description 	: Stop the periodic Timer
+  @return 		: TVerdict Test result
+*/
+TVerdict CT_StopRamUsageTimer::doTestStepL()
+	{
+	INFO_PRINTF1(_L("TestStep :StopRamUsageTimer"));
+	TPtrC startCodeFromIni;
+	if(!GetStringFromConfig(ConfigSection(), KEventStartCode, startCodeFromIni))
+		{
+		ERR_PRINTF1(_L("Event Start code is not specified"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		TInstrumentationPoint starteventcode = CT_MsgUtilsEnumConverter::ConvertDesToEventCode(startCodeFromIni);
+		
+		TPtrC stopCodeFromIni;
+		if(!GetStringFromConfig(ConfigSection(), KEventStopCode, stopCodeFromIni))
+			{
+			ERR_PRINTF1(_L("Event Stop code is not specified"));
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			TInstrumentationPoint stopeventcode = CT_MsgUtilsEnumConverter::ConvertDesToEventCode(stopCodeFromIni);
+			iSharedDataSMTP.iPeriodic->Cancel();
+			
+			INFO_PRINTF2(_L("Minimum Ram usage value is %d KB "), iSharedDataSMTP.iMinRamValue);
+			INFO_PRINTF2(_L("Maximum Ram usage value is %d KB "), iSharedDataSMTP.iMaxRamValue);
+			INFO_PRINTF2(_L("Start Ram usage value is %d KB "), iSharedDataSMTP.iStartRamValue);
+			INFO_PRINTF2(_L("End Ram usage value is %d KB "), iSharedDataSMTP.iEndRamValue);
+
+			TInt maxRamUsage = ( iSharedDataSMTP.iMaxRamValue - iSharedDataSMTP.iStartRamValue );
+			TInt extremeRamUsage = ( iSharedDataSMTP.iMaxRamValue - iSharedDataSMTP.iMinRamValue );
+			TInt actualRamUsage = ( iSharedDataSMTP.iEndRamValue - iSharedDataSMTP.iStartRamValue );
+			
+			INFO_PRINTF2(_L("Maximum(Mx-St) Ram usage diff value is %d KB "), maxRamUsage );
+			INFO_PRINTF2(_L("Extreme(Mx-Mn) Ram usage diff value is %d KB "), extremeRamUsage );
+			INFO_PRINTF2(_L("Actual(En-St) Ram usage diff value is %d KB "), actualRamUsage );
+			if( starteventcode || stopeventcode )
+				{
+				INFO_PRINTF5(_L("EVENT_LOG_INFORMATION,%d,%d,%d,%d"),0,0,starteventcode,iSharedDataSMTP.iStartRamValue);
+				INFO_PRINTF5(_L("EVENT_LOG_INFORMATION,%d,%d,%d,%d"),0,0,stopeventcode,iSharedDataSMTP.iMaxRamValue);
+				}
+			else
+				{
+				ERR_PRINTF1(_L("**ERROR**: Bad Event code. Check t_testinstrumentation.h for valid event code"));					
+				}	
+			}		
+		}
+	return TestStepResult();
+	}
+
+/**
+  Function 		: ProgressL
+  Description 	: Displays the progress information of the asynchronous operation
+  @return 		: void
+*/
+void CT_StopRamUsageTimer::ProgressL(TBool /*aFinal*/)
+	{}
+
+/**
+  Function 		: CancelStep
+  Description 	: Cancels the asynchronous operation
+  @return 		: void
+*/
+void CT_StopRamUsageTimer::CancelStep()
+	{}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/email/smtp/src/T_UtilsSendEmail.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,402 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is the header file for CT_MsgUtilsSendEmail
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+
+// User includes
+#include "T_UtilsSendEmail.h"
+
+
+// epoc includes
+#include <iapprefs.h>
+
+
+// Literals for the Smtp commands
+_LIT8(KHeloString, "HELO\r\n");
+_LIT8(KMailFrom, "MAIL FROM:");
+_LIT8(KRcptTo, "RCPT TO:");
+_LIT8(KDataString, "DATA\r\n");
+_LIT8(KEndData, "\r\n.\r\n");
+_LIT8(KQuitString, "QUIT\r\n");
+_LIT8(KCrlfString, "\r\n");
+
+
+/**
+NewL()
+Static factory constructor. Uses two phase 
+construction.
+
+@param aTestStep
+@leave KErrNoMemory
+@return
+A pointer to the newly created CT_MsgUtilsSendEmail object.
+*/
+CT_MsgUtilsSendEmail* CT_MsgUtilsSendEmail::NewL(CTestStep& aTestStep)
+   {
+	CT_MsgUtilsSendEmail* self = new (ELeave) CT_MsgUtilsSendEmail(aTestStep);
+	return self;
+	}
+
+
+/**
+CT_MsgUtilsSendEmail()
+Constructor
+
+@param aTestStep
+*/
+CT_MsgUtilsSendEmail::CT_MsgUtilsSendEmail(CTestStep& aTestStep)
+:	CActive(EPriorityStandard),iTestStep(aTestStep)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+
+/**
+~CT_MsgUtilsSendEmail()
+Destructor
+*/
+CT_MsgUtilsSendEmail::~CT_MsgUtilsSendEmail()
+	{
+	iFile.Close();
+	iFs.Close();
+	delete iImSocket;
+	iImSocket=NULL;
+	delete iIapPrefs;
+	iIapPrefs=NULL;
+	}
+
+
+/**
+StartL()
+Deletes the children entries of the specified parent
+
+@param aSender
+@param aReceipient
+@param aMailFile
+@param aServerIP
+@param aStatus
+*/
+void CT_MsgUtilsSendEmail::StartL(TPtrC aSender,TPtrC aReceipient,TPtrC aMailFile,
+											TPtrC aServerIP,TRequestStatus& aStatus)
+	{
+	iRequestStatus = &aStatus;
+	aStatus = KRequestPending;
+	
+	iSender.Set(aSender);
+	iReceipient.Set(aReceipient);
+	
+	// Connects the client to the file server.
+	iFs.Connect();
+
+	// Opens an existing file reading and a share mode 
+	// If the file does not already exist, an error is returned.
+	iFile.Open(iFs, (TDesC&)aMailFile, EFileShareAny|EFileRead);
+
+	// Uses two phase construction and leaves nothing on the CleanupStack
+	iImSocket = CImTextServerSession::NewL();
+
+	iIapPrefs = CImIAPPreferences::NewLC();
+	CleanupStack::Pop();
+
+	// Queue a connect assuming the socket is successfully opened.
+	iImSocket->QueueConnectL(iStatus, (TDesC&)aServerIP, 25, *iIapPrefs, ETrue);
+	
+	iSendState = ESmtpConnecting;
+	SetActive();
+	}
+
+	
+/**
+DoCancel()
+CActive derived function to handle Cancel requests
+*/
+void CT_MsgUtilsSendEmail::DoCancel()
+	{
+	iImSocket->Cancel();
+	}
+
+
+/**
+RunL()
+CActive derived function to handle the state machine
+
+@panic Unkown receive state!
+@panic Unkown send state!
+*/
+void CT_MsgUtilsSendEmail::RunL()
+	{
+	// handle send state
+	switch (iSendState)
+		{
+		case ESmtpNotConnected:
+			{
+			// Send completed.
+			User::RequestComplete(iRequestStatus,KErrNone);
+			break;
+			}
+		case ESmtpConnecting:
+			{	
+			// Connection attempt completed.
+			if (iStatus != KErrNone)
+				{
+				// error
+				iTestStep.ERR_PRINTF2(_L("CT_MsgUtilsSendEmail: failed to connect: [%d]."), iStatus.Int());
+				iTestStep.SetTestStepResult(EFail);
+				User::Leave(iStatus.Int());
+				}
+			
+				// ok successful connect, next send HELO
+				iSendState = ESmtpSendHELO;
+				iImSocket->Send(iStatus, KHeloString());
+				SetActive();
+				break;
+			}
+		case ESmtpSendHELO:
+			{	
+			// HELO was sent
+			if (iStatus != KErrNone)
+				{
+				// error
+				iTestStep.ERR_PRINTF2(_L("CT_MsgUtilsSendEmail: failed to send HELO: [%d]."), iStatus.Int());
+				iTestStep.SetTestStepResult(EFail);
+				User::Leave(iStatus.Int());
+				}
+			
+				// ok we sent HELO, now receive reply
+				iSendState = ESmtpReceiveReply;
+				iRecvState = ESmtpHeloReply;
+				iImSocket->QueueReceiveNextTextLine(iStatus);
+				SetActive();
+				break;
+			}
+		case ESmtpSendMailFrom:
+			{	
+			// MAIL FROM was sent.
+			if (iStatus != KErrNone)
+				{
+				// error
+				iTestStep.ERR_PRINTF2(_L("CT_MsgUtilsSendEmail: failed to send MAIL FROM: [%d]."), iStatus.Int());
+				iTestStep.SetTestStepResult(EFail);
+				User::Leave(iStatus.Int());
+				}
+			
+				// ok we sent MAIL FROM, now receive reply
+				iSendState = ESmtpReceiveReply;
+				iRecvState = ESmtpFromReply;
+				iImSocket->QueueReceiveNextTextLine(iStatus);
+				SetActive();
+				break;
+			}
+		case ESmtpSendRcptTo:
+			{	
+			// RCPT TO was sent.
+			if (iStatus != KErrNone)
+				{
+				// error
+				iTestStep.ERR_PRINTF2(_L("CT_MsgUtilsSendEmail: failed to send RCPT TO: [%d]."), iStatus.Int());
+				iTestStep.SetTestStepResult(EFail);
+				User::Leave(iStatus.Int());
+				}
+			
+				// ok we sent RCPT TO, now receive reply
+				iSendState = ESmtpReceiveReply;
+				iRecvState = ESmtpRcptReply;
+				iImSocket->QueueReceiveNextTextLine(iStatus);
+				SetActive();
+				break;
+			}
+		case ESmtpSendData:
+			{	
+			// DATA was sent.
+			if (iStatus != KErrNone)
+				{
+				// error
+				iTestStep.ERR_PRINTF2(_L("CT_MsgUtilsSendEmail: failed to send DATA: [%d]."), iStatus.Int());
+				iTestStep.SetTestStepResult(EFail);
+				User::Leave(iStatus.Int());
+				}
+			
+				// ok we sent DATA, now receive reply
+				iSendState = ESmtpReceiveReply;
+				iRecvState = ESmtpDataReply;
+				iImSocket->QueueReceiveNextTextLine(iStatus);
+				SetActive();
+				break;
+			}
+		case ESmtpSendContent:
+			{	
+			// Content was sent.
+			// Read and send file. Send file in chunks of 100 bytes.
+			TBuf8<100> buffer;
+			User::LeaveIfError(iFile.Read(buffer, 100));
+			if (buffer.Length() == 0)
+				{
+				// ok, end of file. send end of email.
+				iSendState = ESmtpSendEndData;
+				iImSocket->Send(iStatus, KEndData());
+				}
+			else
+				{
+				// we still have data in file. read and send.
+				iSendState = ESmtpSendContent;
+				iImSocket->Send(iStatus, buffer);
+				}
+				SetActive();
+				break;
+			}
+		case ESmtpSendEndData:
+			{	
+			// end of data was sent.
+			if (iStatus != KErrNone)
+				{
+				// error
+				iTestStep.ERR_PRINTF2(_L("CT_MsgUtilsSendEmail: failed to send end-of-data marker: [%d]."), iStatus.Int());
+				iTestStep.SetTestStepResult(EFail);
+				User::Leave(iStatus.Int());
+				}
+			
+			// ok we sent end-of-data, now receive reply
+			iSendState = ESmtpReceiveReply;
+			iRecvState = ESmtpContentReply;
+			iImSocket->QueueReceiveNextTextLine(iStatus);
+			SetActive();
+			break;
+			}
+		case ESmtpSendLogout:
+			{
+			iSendState = ESmtpReceiveReply;
+			iRecvState = ESmtpLogoutReply;
+			iImSocket->QueueReceiveNextTextLine(iStatus);
+			SetActive();
+			break;
+			}
+		case ESmtpReceiveReply:
+			{
+			if (iStatus != KErrNone)
+				{
+				// error
+				iTestStep.ERR_PRINTF3(_L("CT_MsgUtilsSendEmail: failed to receive reply: error [%d] recvstate [%d]."), iStatus.Int(), iRecvState);
+				iTestStep.SetTestStepResult(EFail);
+				User::Leave(iStatus.Int());
+				}
+			
+			// ok, read and print out the reply
+			TBuf8<50> buffer;
+			TBuf<50> buffer16;
+			TImLineType replyLine = iImSocket->GetCurrentTextLine(buffer);
+			buffer16.Copy(buffer);
+			iTestStep.INFO_PRINTF1(buffer16);
+			
+			if (replyLine == EBufferTooSmall)
+				{
+				while (replyLine != ECRLFTerminated)
+					{
+					replyLine = iImSocket->GetCurrentTextLine(buffer);
+					buffer16.Copy(buffer);
+					iTestStep.INFO_PRINTF1(buffer16);
+					}
+				}
+		
+			// handle reply state
+			switch (iRecvState)
+				{
+				case ESmtpHeloReply:
+					{
+					// send MAIL FROM
+					iSendState = ESmtpSendMailFrom;
+					TBuf8<100> from;
+					from.Append(KMailFrom);
+					from.Append(iSender);
+					from.Append(KCrlfString);
+					iImSocket->Send(iStatus, from);
+					break;
+					}
+				case ESmtpFromReply:
+					{
+					// send RCPT TO
+					iSendState = ESmtpSendRcptTo;
+					TBuf8<100> to;
+					to.Append(KRcptTo);
+					to.Append(iReceipient);
+					to.Append(KCrlfString);
+					iImSocket->Send(iStatus, to);
+					break;
+					}
+				case ESmtpRcptReply:
+					{
+						// send DATA
+					iSendState = ESmtpSendData;
+					iImSocket->Send(iStatus, KDataString());
+					break;
+					}
+				case ESmtpDataReply:
+					{
+					// send content
+					iSendState = ESmtpSendContent;
+					TBuf8<100> buffer;
+					User::LeaveIfError(iFile.Read(buffer, 100));
+					if (buffer.Length() == 0)
+						{
+						// ok, end of file. since this is first read it would mean the file
+						// is empty! we should maybe leave here or??
+						iSendState = ESmtpSendEndData;
+						iImSocket->Send(iStatus, KEndData());
+						}
+					else
+						{
+						// we still have data in file
+						iSendState = ESmtpSendContent;
+						iImSocket->Send(iStatus, buffer);
+						}
+						break;
+					}
+				case ESmtpContentReply:
+					{
+					// send QUIT
+					iSendState = ESmtpSendLogout;
+					iImSocket->Send(iStatus, KQuitString());
+					break;
+					}
+				case ESmtpLogoutReply:
+					{
+					//iTestStep.INFO_PRINTF1(_L("LOGOUT"));
+					iSendState = ESmtpNotConnected;
+					iImSocket->Disconnect(iStatus);
+					break;
+					}
+				default:
+					{
+					User::Panic(_L("Unkown receive state!"), iRecvState);
+					break;
+					}
+				}// End switch (iRecvState)
+			
+				SetActive();
+				break;
+			}
+		default:
+			{
+			User::Panic(_L("Unkown send state!"), iSendState);
+			break;
+			}
+		} // End switch (iSendState)
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/framework/group/T_MsgFramework.mph	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,44 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file
+// .mph file for the Framework
+// 
+//
+
+
+
+
+
+USERINCLUDE 		../inc
+
+
+SOURCEPATH		../src
+SOURCE 			T_MsgActive.cpp
+SOURCE 			T_MsgTimer.cpp
+SOURCE			T_MsgSharedDataBase.cpp
+SOURCE 			T_MsgAsyncStep.cpp
+SOURCE 			T_MsgStep.cpp
+SOURCE 			T_MsgServer.cpp
+SOURCE	       		T_StartUp.cpp
+SOURCE	       		T_ShutDown.cpp
+SOURCE	       		T_RecordCurrentTime.cpp
+
+
+// Mobility Test Framework library:
+//USERINCLUDE ../../../../../../app/messaging/email/pop3andsmtpmtm/servermtmutils/mobilitytestframework/inc
+USERINCLUDE ../../mobilitytestframework/inc
+
+#ifdef __MOBILITY_TEST_FRAMEWORK
+LIBRARY mobilitytestframework.lib
+#endif //__MOBILITY_TEST_FRAMEWORK
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/framework/inc/T_MsgActive.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,137 @@
+/*
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* @file 
+* This contains the class CT_MsgActive
+* 
+*
+*/
+
+
+
+
+
+
+#ifndef __T_MSG_ACTIVE_H__
+#define __T_MSG_ACTIVE_H__
+
+
+/* Epoc includes */
+#include <e32base.h>
+
+
+/**
+ * This implements an interface for the Test Timer Cmpletion Callback
+ */
+class MT_MsgActiveCallback
+	{
+public:
+	/*
+	* Method from which CT_MsgActive informs the user with RunL call
+    * To be implemented by the derived class
+	*/
+	virtual void Completed() = 0;
+
+	/*
+	* Method from which CT_MsgActive informs the user with DoCancel call
+    * To be implemented by the derived class
+	*/
+	virtual void CancelStep() = 0;
+	};
+
+
+
+/**
+ * This implements a Test Active Notification class
+ *
+ */
+class CT_MsgActive : public CActive
+	{
+public:
+	/**
+	* Destructor
+	*/
+	virtual ~CT_MsgActive();
+
+	/**
+	* Two phase constructor that allocates and constructs
+	* a new Active object whose actions are performed by a callback
+	*
+	* \param aCallback object to inform on RunL.
+	* \param aPriority priority of active object.
+	* \return New Callback active object.
+	*/
+	static CT_MsgActive* NewL(MT_MsgActiveCallback& aCallback, TInt aPriority=EPriorityStandard);
+
+	/**
+	* Two phase constructor that allocates and constructs
+	* a new Active object whose actions are performed by a callback
+	*
+	* \param aCallback object to inform on RunL.
+	* \param aPriority priority of active object.
+	* \return New Callback active object.
+	*/
+	static CT_MsgActive*	NewLC(MT_MsgActiveCallback& aCallback, TInt aPriority=EPriorityStandard);
+
+	/**
+	* Activate the object
+	*/
+	void Activate()	{ SetActive(); }
+
+	/**
+	* Active the object RunL implementation.
+	*
+	* Calls the MT_MsgActiveCallback::RunL to inform user that the RunL has been reached.
+	*/
+	void RunL()		{ iCallback.Completed(); }
+
+	/**
+	* Active object DoCancel implementation.
+	*
+	* Calls the MT_MsgActiveCallback::DoCancel to inform user that the DoCancel has been reached.
+	*/
+	void DoCancel()	{ iCallback.CancelStep(); }
+
+	/**
+	* Gets the status as TInt.
+	*/
+	TInt Result()	{ return iStatus.Int(); }
+
+protected:
+	/**
+	* Protected constructor with timer completion callback and priority.
+	*
+	* Called by two phase constructor.
+	*
+	* \param aCallback object to inform on timer completion.
+	* \param aPriority priority of active object.
+	*/
+	CT_MsgActive(MT_MsgActiveCallback& aCallback, TInt aPriority);
+
+private:
+	/**
+	* This is internal and not intended for use.
+	*
+	* Second phase of two phase constructor.
+	*/
+	void ConstructL();
+
+private:
+	/**
+	* This is internal and not intended for use.
+	*/
+	MT_MsgActiveCallback& iCallback;
+	};
+
+#endif /* __T_MSG_ACTIVE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/framework/inc/T_MsgAsyncStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* @file 
+* This contains the header file for CT_MsgAsyncStep.
+* 
+*
+*/
+
+
+
+
+
+
+#ifndef __T_MSG_ASYNCSTEP_H__
+#define __T_MSG_ASYNCSTEP_H__
+
+
+/* User includes */
+#include "T_MsgStep.h"
+#include "T_MsgActive.h"
+#include "T_MsgTimer.h"
+
+
+/* This implements a base class for the asynchronous test steps */
+class CT_MsgAsyncStep : public CT_MsgStep, private MT_MsgActiveCallback, private MT_MsgTimerCallback
+	{
+public:
+	/**
+	* Destructor
+	*/
+	virtual ~CT_MsgAsyncStep();
+
+	/* Derived from CTestStep
+	 * Calls the doTestStepPreambleL of the base class CTestStep
+	 * Reads in the ProgressTime and CancelTime for the asynchronous operation
+	 */
+	virtual enum TVerdict doTestStepPreambleL();
+
+protected:
+
+	CT_MsgAsyncStep();
+
+	/* 
+	 * Children must call this in their own NewL().
+ 	 */
+	void ConstructL(); 				 
+
+	/* Method to return the object of CT_MsgActive */
+	CT_MsgActive& Active() { return *iActive; }
+
+	/* Derived  from CT_MsgStep 
+	 * Displays the progress of the asynchronous operation
+	 */
+	virtual void ProgressL(TBool bFinal) = 0;
+
+private:
+	/*	Derived from MT_MsgActiveCallback */
+	virtual void Completed();
+
+	/*	MT_MsgTimerCallback implementation */
+	virtual void	TimerCompletedL(CTimer* aTimer);
+
+private:
+	/* To be used in asynchronous operations */
+	CT_MsgActive*		iActive;
+	/* Timer object */
+	CT_MsgTimer*		iTimerCancel;
+	/* Gets the timer progress */
+	CT_MsgTimer*		iTimerProgress;
+
+	TInt iTimeProgress;
+	};
+
+#endif /* __T_MSG_ASYNCSTEP_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/framework/inc/T_MsgServer.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* @file 
+* This contains the header file for the Msg server from which other servers 
+* would be derived
+* 
+*
+*/
+
+
+
+
+
+#ifndef __T_MSG_SERVER_H__
+#define __T_MSG_SERVER_H__
+
+
+/* User defined classes */
+#include "testexecuteserverbase.h"
+#include "T_MsgSharedDataBase.h"
+
+#include "mmsgtestpropertywatcher.h"
+#include "cmsgtestpropertywatcher.h"
+
+/* 
+ * Implements a base server from which other servers would be
+ * derived
+ */
+class CT_MsgServer : public CTestServer, public MMsgTestPropertyWatcher
+	{
+protected:
+	CT_MsgServer();
+	virtual ~CT_MsgServer();
+
+	/*
+	 * Derived from CTestStep
+	 * This wraps CTestServer::CreateTestStep() with a leave-trap 
+	 */
+	virtual CTestStep*	CreateTestStepL(const TDesC& aStepName);
+
+	/*
+	 * To be implemented by the derived classes
+	 * Creates the required shared data object
+     */
+	virtual CT_MsgSharedDataBase*	NewSharedDataL() = 0;
+	
+	//From MMsgTestPropertyWatcher
+	void HandleEventL(RProperty& aProperty, TUint /*aKey*/);
+	
+private:
+	/* Calls the function CreateTestStepL to create the required test step */
+	CTestStep*	CreateTestStep(const TDesC& aStepName);
+
+	/* Creates the active scheduler and the base shared data object */
+	void StartupServerL();
+
+	/* Destroys the shared data object and the active scheduler object */
+	void ShutdownServer();
+
+protected:
+	/* For use by generic Mtm test steps */
+	CT_MsgSharedDataBase*	iSharedDataBase; 
+
+private:
+	/* Active scheduler object */
+	CActiveScheduler*		iActiveScheduler;
+	
+	//TBD: Remove this...
+	CMsgTestPropertyWatcher* iPropertyWatcher;
+	};
+
+#endif /*__T_MSG_SERVER_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/framework/inc/T_MsgSharedDataBase.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* @file 
+* This contains ths class CT_MsgSharedDataBase which creates a session object
+* 
+*
+*/
+
+
+
+
+
+
+
+#ifndef __T_MSG_SHARED_DATA_BASE_H__
+#define __T_MSG_SHARED_DATA_BASE_H__
+
+
+/* Epoc includes */
+#include <mtclreg.h>
+#include <mtclbase.h>
+
+
+/* 
+ * This implements a class which creates and returns a session object which
+ * can be shared across test steps.It serves as a base class for other shared
+ * data objects which require the session object
+ */
+class CT_MsgSharedDataBase : public CBase, protected MMsvSessionObserver
+	{
+public:
+	/*
+	 * Destructor
+	 */
+	virtual ~CT_MsgSharedDataBase();
+
+protected:
+	CT_MsgSharedDataBase();
+
+	/* 
+	 * Constructs the required session, registry objects
+	 * Initialises the MTM object to NULL
+	 */
+	void ConstructL();
+
+	/* 
+	 * To be implemented by the derived classes to creates
+	 * the required MTM objects
+	 */
+	virtual CBaseMtm*	NewMtmL() = 0;
+
+public:
+	/* Derived from MMsvSessionObserver */
+	void HandleSessionEventL(TMsvSessionEvent,TAny*,TAny*,TAny*) {};
+
+public:
+	/* Session object */
+	CMsvSession*	iSession;
+	/* Registry object required to create MTMs */
+	CClientMtmRegistry*	iRegistry;
+	/* Set to NULL.To be Set for each specific Mtm by deriving class. */
+	CBaseMtm*	iMtm; 	
+	};
+
+#endif /* __T_MSG_SHARED_DATA_BASE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/framework/inc/T_MsgStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* @file 
+* This contains the header file for CT_MsgStep
+* 
+*
+*/
+
+
+
+
+
+
+#ifndef __T_MSGSTEP_H__
+#define __T_MSGSTEP_H__
+
+
+/* User includes */
+#include "testexecutestepbase.h"
+#include "T_MsgSharedDataBase.h"
+
+
+/* 
+ * Implements a test step which contains the pointer to the shared data object
+ * Other asynchronous and synchronous test steps can be derived from it.
+ */
+class CT_MsgStep : public CTestStep
+	{
+protected:
+	CT_MsgStep();
+	};
+
+#endif /* __T_MSGSTEP_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/framework/inc/T_MsgTimer.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* @file 
+* This contains CT_MsgTimer class
+* 
+*
+*/
+
+
+
+
+
+
+
+#ifndef __T_MSG_TIMER_H__
+#define __T_MSG_TIMER_H__
+
+/* User Includes */
+#include <testexecutestepbase.h>
+
+
+
+
+/* Interface to be implemented by the dervied classes for asynchronous operation */
+class MT_MsgTimerCallback
+	{
+public:
+	/* To be implemented by the derived class */
+	virtual void	TimerCompletedL(CTimer* aTimer) = 0;
+	};
+
+
+
+
+/* Implementes a class that dervies from the CTimer, for an active timer object */
+class CT_MsgTimer : public CTimer
+	{
+public:
+	/**
+	* Two phase constructor that allocates and constructs
+	* a new CT_MsgTimer object 
+	*
+	* \param aCallback object to inform on timer completion.
+	* \param aPriority priority of CT_MsgTimer object.
+	* \return New Callback CT_MsgTimer object.
+	*/
+	static CT_MsgTimer*	NewL(MT_MsgTimerCallback& aCallback, TInt aPriority = EPriorityStandard);
+
+protected:
+	CT_MsgTimer(MT_MsgTimerCallback& aCallback, TInt aPriority);
+
+	/* 
+	 * Constructs a new asynchronous timer 
+	 * And adds the object to the active scheduler
+	 */
+	void ConstructL();
+
+	/* Signals on the complettion of the Timer */
+	virtual void RunL();
+
+private:
+	/*
+	 * This is internal and not intended for use.
+	 */
+	MT_MsgTimerCallback&	iCallback;
+	};
+
+#endif /* __T_MSG_TIMER_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/framework/inc/T_RecordCurrentTime.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* @file 
+* This is the header file for CT_MsgRecordCurrentTime
+* 
+*
+*/
+
+
+
+
+
+
+
+#ifndef __T_RECORDCURRENTTIME_H__
+#define __T_RECORDCURRENTTIME_H__
+
+
+/* User includes */
+#include "testexecutestepbase.h"
+
+
+/* Literals Used */
+_LIT(KRecordCurrentTime,"RecordCurrentTime");
+
+
+/* Implements the test step to record the execution time of this test step */
+class CT_MsgRecordCurrentTime : public CTestStep
+	{
+public:
+	CT_MsgRecordCurrentTime();
+
+	/* CTestStep implementation */
+	virtual TVerdict	doTestStepL();	
+	};
+#endif /* __T_RECORDCURRENTTIME_H__ s*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/framework/inc/T_ShutDown.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* @file 
+* This is the header file for CT_MsgShutDown
+* 
+*
+*/
+
+
+
+
+
+
+#ifndef __T_SHUTDOWN_H__
+#define __T_SHUTDOWN_H__
+
+
+/* User includes */
+#include "testexecutestepbase.h"
+
+ /* Literals Used */
+_LIT(KShutDown,"ShutDown");
+
+
+/* Implements a dummy test step to be called at the end of the script */
+class CT_MsgShutDown : public CTestStep
+	{
+public:
+	CT_MsgShutDown();
+
+	/* CTestStep implementation */
+	virtual TVerdict doTestStepL();	
+	};
+#endif /*__T_SHUTDOWN_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/framework/inc/T_StartUp.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* @file 
+* This is the header file for CT_MsgStartUp
+* 
+*
+*/
+
+
+
+
+
+
+
+#ifndef __T_STARTUP_H__
+#define __T_STARTUP_H__
+
+
+/* User includes */
+#include "testexecutestepbase.h"
+
+
+/* Literals Used */
+_LIT(KStartUp,"StartUp");
+
+
+/* Implements a dummy test step to be called in the beginning of the script */
+class CT_MsgStartUp : public CTestStep
+	{
+public:
+	CT_MsgStartUp();
+
+	/* CTestStep implementation */
+	virtual TVerdict	doTestStepL();	
+	};
+#endif /* __T_STARTUP_H__ s*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/framework/src/T_MsgActive.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,90 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file 
+// This contains CT_MsgActive
+// 
+//
+
+
+
+
+
+/* User includes */
+#include "T_MsgActive.h"
+
+
+/**
+  Function :~CT_MsgActive
+  Description : Destructor
+  @return : N/A
+*/
+CT_MsgActive::~CT_MsgActive()
+	{
+	Cancel();
+	}
+
+
+/**
+  Function : NewL
+  Description : Creates the object of CT_MsgActive
+  @return : N/A
+  @leave :	KErrNoMemory	There is no sufficient memory
+*/
+CT_MsgActive* CT_MsgActive::NewL(MT_MsgActiveCallback& aCallback, TInt aPriority)
+	{
+	CT_MsgActive*	self=NewLC(aCallback, aPriority);
+	CleanupStack::Pop();
+	return self;
+	}
+
+
+
+/**
+  Function	:	NewLC
+  Description : Creates the object of CT_MsgActive and pushes the object on the stack
+  @return : N/A
+  @leave :	KErrNoMemory	There is no sufficient memory
+*/
+
+CT_MsgActive* CT_MsgActive::NewLC(MT_MsgActiveCallback& aCallback, TInt aPriority)
+	{
+	CT_MsgActive*	self=new(ELeave) CT_MsgActive(aCallback, aPriority);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+
+
+
+/**
+  Function : CT_MsgActive
+  Description : Constructor
+  @return : N/A
+*/
+CT_MsgActive::CT_MsgActive(MT_MsgActiveCallback& aCallback, TInt aPriority)
+:	CActive(aPriority)
+,	iCallback(aCallback)
+	{
+	}
+
+
+/**
+  Function :ConstructL
+  Description : Adds the active object to the active scheduler
+  @return : N/A
+*/
+void CT_MsgActive::ConstructL()
+	{
+	CActiveScheduler::Add(this);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/framework/src/T_MsgAsyncStep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,140 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file
+// [Test Step] :
+// AsyncStep
+// Ownes a Active Object for async operations.
+// 
+//
+
+
+
+/* User includes */
+#include "T_MsgAsyncStep.h"
+
+
+/* Literals Used */
+_LIT(KProgressTime,	"ProgressTime");
+_LIT(KCancelTime,	"CancelTime");
+
+
+/**
+  Function : CT_MsgAsyncStep
+  Description : Constructor
+  @return : N/A
+*/
+CT_MsgAsyncStep::CT_MsgAsyncStep()
+:	CT_MsgStep()
+,	iActive(NULL)
+,	iTimerCancel(NULL)
+,	iTimerProgress(NULL)
+,	iTimeProgress(0)
+	{
+	}
+
+
+
+/**
+  Function : ConstructL
+  Description : Creates an object of the active object and timer
+  @return : N/A
+*/
+void CT_MsgAsyncStep::ConstructL()
+	{
+	iActive = CT_MsgActive::NewL(*this);
+	iTimerCancel = CT_MsgTimer::NewL(*this);
+	iTimerProgress= CT_MsgTimer::NewL(*this);
+	}
+
+
+
+/**
+  Function : ~CT_MsgAsyncStep
+  Description : Destructor
+  @return : N/A
+*/
+CT_MsgAsyncStep::~CT_MsgAsyncStep()
+	{
+	delete iTimerProgress;
+	iTimerProgress=NULL;
+
+	delete iTimerCancel;
+	iTimerCancel=NULL;
+
+	delete iActive;
+	iActive=NULL;
+	}
+
+
+
+/**
+  Function : Completed
+  Description : Cancels the wait for completion of an outstanding request
+  @return : N/A
+*/
+void CT_MsgAsyncStep::Completed()
+	{
+	iTimerProgress->Cancel();
+	iTimerCancel->Cancel();
+	ProgressL(ETrue);
+	CActiveScheduler::Stop();
+	}
+
+
+/**
+  Function : TimerCompletedL
+  Description : Sets the progress information and cancel information accordingly
+  @return : none
+*/
+void CT_MsgAsyncStep::TimerCompletedL(CTimer* aTimer)
+	{
+	if ( aTimer==iTimerProgress )
+		{
+		INFO_PRINTF1(_L("Calling ProgressL(EFalse)"));
+		ProgressL(EFalse);
+		iTimerProgress->After(iTimeProgress);
+		}
+	else if ( aTimer==iTimerCancel )
+		{
+		INFO_PRINTF1(_L("Calling Cancel()"));
+		iTimerProgress->Cancel();
+		CancelStep();
+		CActiveScheduler::Stop();
+		}
+	}
+
+
+
+/**
+  Function : doTestStepPreambleL
+  Description : Call the doTestStepPreambleL of the CTestStep class
+				Reads the porgress time and cancel time from the ini
+  @return : TVerdict result
+*/
+enum TVerdict CT_MsgAsyncStep::doTestStepPreambleL()
+	{
+	TVerdict ret=CTestStep::doTestStepPreambleL();
+
+	if( GetIntFromConfig( ConfigSection(), KProgressTime, iTimeProgress) )
+		{
+		iTimerProgress->After(iTimeProgress);
+		}
+
+	TInt time = 0;
+	if( GetIntFromConfig( ConfigSection(), KCancelTime, time) )
+		{
+		iTimerCancel->After(time);
+		}
+	return ret;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/framework/src/T_MsgServer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,210 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file
+// This is the framework class implementation for the Test Msg Server.
+// 
+//
+
+
+
+/* User includes */
+#include "T_MsgServer.h"
+#include "T_MsgSharedDataBase.h"
+
+#include "mobilitytestpropertyvalue.h"
+#include "mobilitytestpropertymap.h"
+#include "tmobilitytestpropertymapaccess.h"
+
+/* Header files of Test Steps */
+#include "T_StartUp.h"
+#include "T_ShutDown.h"
+#include "T_RecordCurrentTime.h"
+
+/* epoc includes */
+#include <miutset.h>
+
+#include <e32const.h>
+
+/**
+  Function : CT_MsgServer
+  Description : Constructor
+  @return : N/A
+*/
+CT_MsgServer::CT_MsgServer()
+:	CTestServer()
+,	iSharedDataBase(NULL)
+,	iActiveScheduler(NULL)
+	{
+	
+	//Raise process priority to allow complete event logging.
+	RProcess me;
+    me.SetPriority(TProcessPriority(450));
+    User::SetPriorityControl(EFalse);
+    
+	}
+
+
+
+
+/**
+  Function : ~CT_MsgServer
+  Description : Destructor
+  @return : N/A
+*/
+CT_MsgServer::~CT_MsgServer()
+	{
+	}
+
+
+
+/**
+  Function : StartupServerL
+  Description : Creates and installs the active scheduler
+  				Creates an object of the Shared Data class
+  @return : N/A
+*/
+void CT_MsgServer::StartupServerL()
+	{
+	/* Creates the active scheduler, shared data */
+	if (iActiveScheduler==NULL)
+		{
+		/* Installs Active Scheduler */
+		iActiveScheduler=new(ELeave) CActiveScheduler;
+		CActiveScheduler::Install(iActiveScheduler);
+		}
+
+	if (iSharedDataBase==NULL)
+		{
+		/* Creates the shared data in the re-used thread.*/
+		iSharedDataBase = NewSharedDataL();
+		}
+
+#ifdef __MOBILITY_TEST_FRAMEWORK
+	if (iPropertyWatcher==NULL)
+		{
+		iPropertyWatcher = CMsgTestPropertyWatcher::NewL(KPropertyCatMsgTestUtilityServer2, EMyPropertyCounter, *this);
+		}
+#endif //__MOBILITY_TEST_FRAMEWORK
+	}
+
+
+
+/**
+  Function : ShutdownServer
+  Description : Deletes the active scheduler and the created shared data object
+  @return : N/A
+*/
+void CT_MsgServer::ShutdownServer()
+	{
+	if (NULL!=iSharedDataBase)
+		{
+		delete iSharedDataBase;
+		iSharedDataBase=NULL;
+		}
+	if (NULL!=iActiveScheduler)
+		{
+		delete iActiveScheduler;
+		iActiveScheduler = NULL;			
+		}
+
+	if (NULL!=iPropertyWatcher)
+		{
+		delete iPropertyWatcher;
+		iPropertyWatcher = NULL;			
+		}
+	}
+
+
+/**
+  Function : CreateTestStep
+  Description : This method is run in a seperate thread which is re-used 
+  				when the -SharedData flag is set.
+  @return : A pointer to the CTestStep class
+*/
+CTestStep* CT_MsgServer::CreateTestStep(const TDesC& aStepName)
+	{
+	CTestStep* testStep = NULL;
+
+	TRAPD(err,testStep = CreateTestStepL(aStepName));
+	if(err)
+		{
+		ERR_PRINTF1(_L("CT_MsgServer::CreateTestStep() left!"));
+		}
+	return testStep;
+	}
+
+
+
+/**
+  Function : CreateTestStepL
+  Description : This method creates the startup and shut down test steps
+  @return : A pointer to the CTestStep class
+*/
+CTestStep* CT_MsgServer::CreateTestStepL(const TDesC& aStepName)
+	{
+	CTestStep*	testStep = NULL;
+
+	/* This must be called as the first test step */
+	if(aStepName == KStartUp)					
+		{
+		StartupServerL();
+		testStep = new(ELeave) CT_MsgStartUp();
+		}
+	/* This must be called as the last test step */
+	else if(aStepName == KShutDown)				
+		{
+		ShutdownServer();
+		testStep = new(ELeave) CT_MsgShutDown();
+		}
+	else if(aStepName == KRecordCurrentTime)
+		{
+		testStep = new(ELeave) CT_MsgRecordCurrentTime();	
+		}
+
+	else
+		{
+		ERR_PRINTF1(_L("CT_MsgServer::CreateTestStep() - Step not found"));	
+		}
+	return testStep;
+	}
+
+
+#ifdef __MOBILITY_TEST_FRAMEWORK
+void CT_MsgServer::HandleEventL(RProperty& aProperty, TUint /*aKey*/)
+#else //__MOBILITY_TEST_FRAMEWORK
+void CT_MsgServer::HandleEventL(RProperty& /*aProperty*/, TUint /*aKey*/)
+#endif //__MOBILITY_TEST_FRAMEWORK
+	{
+#ifdef __MOBILITY_TEST_FRAMEWORK
+
+	TInt propertyVal = 0;
+	User::LeaveIfError(aProperty.Get(propertyVal));
+
+	const TDesC& name = Name(); //Server name.
+
+
+	const TMsgTestPropertyMapEntry* propertyMap = TMobilityTestPropertyMapAccess::Get(propertyVal);
+	if(propertyMap == NULL)
+		{
+		ERR_PRINTF1(_L("CT_MsgServer::HandleEventL() - Event not found"));
+		}
+	else
+		{
+		TBufC8<80> buf8((const unsigned char*)(propertyMap->name));
+		TBuf<80> buf;
+		buf.Copy(buf8);
+		INFO_PRINTF4(_L("%S EVENT [%d %S]"), &name, propertyVal, &buf);
+		}
+#endif //__MOBILITY_TEST_FRAMEWORK
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/framework/src/T_MsgSharedDataBase.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,73 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file 
+// This file contains the shared data class for the base server which creates
+// a session object.
+// 
+//
+
+
+
+/*  user includes */
+#include "T_MsgSharedDataBase.h"
+
+
+/* epoc includes */
+#include <miutset.h>
+
+
+/**
+  Function : CT_MsgSharedDataBase
+  Description : Constructor	
+  @return : N/A
+*/
+CT_MsgSharedDataBase::CT_MsgSharedDataBase()
+:	CBase()
+,	iSession(NULL)
+,	iRegistry(NULL)
+,	iMtm(NULL)
+	{
+	}
+
+
+/**
+  Function : ConstructL
+  Description : Creates the object of session, registry,initialises MTM
+  @return : N/A
+  @leave  :	KErrNoMemory	There is no sufficient memory
+*/
+void CT_MsgSharedDataBase::ConstructL()
+	{
+	iSession	= CMsvSession::OpenSyncL(*this);
+	iRegistry	= CClientMtmRegistry::NewL(*iSession);
+	iMtm		= NewMtmL();
+	}
+
+
+/**
+  Function : ~CT_MsgSharedDataBase
+  Description : Destructor
+  @return : N/A
+*/
+CT_MsgSharedDataBase::~CT_MsgSharedDataBase()
+	{
+	delete iMtm;
+	iMtm=NULL;
+
+	delete iRegistry;
+	iRegistry=NULL;
+
+	delete iSession;
+	iSession = NULL;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/framework/src/T_MsgStep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,35 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file
+// [Test Step] :
+// MsgStep
+// Interface with TEF.
+// 
+//
+
+
+
+/* User includes */
+#include "T_MsgStep.h"
+
+
+
+/**
+  Function : CT_MsgStep
+  Description : Constructor	
+  @return : N/A
+*/
+CT_MsgStep::CT_MsgStep()
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/framework/src/T_MsgTimer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,77 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file 
+// 
+//
+
+
+
+
+/* User Includes */
+#include "T_MsgTimer.h"
+
+
+/**
+  Function : NewL
+  Description : Creates an object of CT_MsgTimer
+  @return : N/A
+  @leave  :	KErrNoMemory	There is no sufficient memory	
+*/
+CT_MsgTimer* CT_MsgTimer::NewL(MT_MsgTimerCallback& aCallback, TInt aPriority)
+	{
+	CT_MsgTimer*	ret=new (ELeave) CT_MsgTimer(aCallback, aPriority);
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+
+
+
+/**
+  Function : CT_MsgTimer
+  Description : Constructor
+  @return : N/A
+*/
+CT_MsgTimer::CT_MsgTimer(MT_MsgTimerCallback& aCallback, TInt aPriority)
+:	CTimer(aPriority)
+,	iCallback(aCallback)
+	{
+	}
+
+
+
+/**
+  Function : ConstructL
+  Description : Calls the ConstrutL of CTimer class
+				and adds the object to Active Scheduler
+  @return : N/A
+*/
+void CT_MsgTimer::ConstructL()
+	{
+	CTimer::ConstructL();
+	CActiveScheduler::Add(this);
+	}
+
+
+/**
+  Function : RunL
+  Description : Signals the completion of the operation
+  @return : N/A
+*/
+void CT_MsgTimer::RunL()
+	{
+	iCallback.TimerCompletedL(this);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/framework/src/T_RecordCurrentTime.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,76 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file 
+// [TestStep Name]
+// RecordCurrentTime
+// [Paramaters]
+// EventCode		:	Event code defined in TInstrumentationPoint.
+// Creates a logging statement in EventLog server with the time, and
+// event code information.
+// [APIs Used]
+// 
+//
+
+
+
+
+/* User includes */
+#include "T_RecordCurrentTime.h"
+#include "t_utilsenumconverter.h"
+#include "t_testinstrumentation.h"
+
+/* Epoc Include */
+//#include <systemmonitor/instrumentationhandler.h>
+
+
+/* Literals Used*/
+_LIT(KEventCode, "EventCode");
+
+/**
+  Function : CT_MsgRecordCurrentTime
+  Description : Constructor
+  @return : none
+*/
+CT_MsgRecordCurrentTime::CT_MsgRecordCurrentTime()
+	{
+	SetTestStepName(KRecordCurrentTime);
+	}
+
+
+/**
+  Function : doTestStepL
+  Description : This function is responsible for generating a log statement in EventLog server
+  				by providing the event code to instrumentationhandler API.
+  @return : TVerdict Test result
+*/
+TVerdict CT_MsgRecordCurrentTime::doTestStepL()
+	{
+	INFO_PRINTF1(_L("TestStep : RecordCurrentTime"));
+	TPtrC eventCodeFromIni;
+	if(!GetStringFromConfig(ConfigSection(), KEventCode, eventCodeFromIni))
+		{
+		ERR_PRINTF1(_L("Event code is not specified"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+//		TInstrumentationPoint eventcode = CT_MsgUtilsEnumConverter::ConvertDesToEventCode(eventCodeFromIni);
+	
+//		CInstrumentationHandler *handler = CInstrumentationHandler::NewL();
+//		CleanupStack::PushL(handler);
+//		handler->RaiseEventNotification(eventcode);
+//		CleanupStack::PopAndDestroy(handler);
+		}
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/framework/src/T_ShutDown.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,47 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file
+// This is the header file for CT_MsgShutDown
+// 
+//
+
+
+
+/* User includes */
+#include "T_ShutDown.h"
+
+
+
+/**
+  Function : CT_MsgShutDown
+  Description : Constructor
+  @return : none
+*/
+CT_MsgShutDown::CT_MsgShutDown()
+	{
+	SetTestStepName(KShutDown);
+	}
+
+
+
+/**
+  Function : doTestStepL
+  Description : Dummy step
+  @return : TVerdict Test result
+*/
+TVerdict CT_MsgShutDown::doTestStepL()
+	{
+	INFO_PRINTF1(_L("TestStep :ShutDown"));
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/framework/src/T_StartUp.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,45 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file 
+// This is the header file for CT_MsgStartUp
+// 
+//
+
+
+
+/* User includes */
+#include "T_StartUp.h"
+
+
+/**
+  Function : CT_MsgStartUp
+  Description : Constructor
+  @return : none
+*/
+CT_MsgStartUp::CT_MsgStartUp()
+	{
+	SetTestStepName(KStartUp);
+	}
+
+
+/**
+  Function : doTestStepL
+  Description : Dummy step
+  @return : TVerdict Test result
+*/
+TVerdict CT_MsgStartUp::doTestStepL()
+	{
+	INFO_PRINTF1(_L("TestStep :StartUp"));
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/group/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,19 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Messaging Test Product
+// 
+//
+
+#include "../testutils/group/bld.inf"
+#include "../email/group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/mobilitytestframework/EABI/mobilitytestframeworku.def	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,37 @@
+EXPORTS
+	_ZN14MSGNETTESTSTUB26CActiveCommsMobilityApiExt18NewCarrierAcceptedEv @ 1 NONAME
+	_ZN14MSGNETTESTSTUB26CActiveCommsMobilityApiExt18NewCarrierRejectedEv @ 2 NONAME
+	_ZN14MSGNETTESTSTUB26CActiveCommsMobilityApiExt22IgnorePreferredCarrierEv @ 3 NONAME
+	_ZN14MSGNETTESTSTUB26CActiveCommsMobilityApiExt25MigrateToPreferredCarrierEv @ 4 NONAME
+	_ZN14MSGNETTESTSTUB26CActiveCommsMobilityApiExt4NewLER16RCommsSubSessionR21MMobilityProtocolResp @ 5 NONAME
+	_ZN14MSGNETTESTSTUB26CActiveCommsMobilityApiExtD0Ev @ 6 NONAME
+	_ZN14MSGNETTESTSTUB26CActiveCommsMobilityApiExtD1Ev @ 7 NONAME
+	_ZN14MSGNETTESTSTUB26CActiveCommsMobilityApiExtD2Ev @ 8 NONAME
+	_ZN23CMsgTestPropertyMapPairC1EP24TMsgTestPropertyMapEntryS1_ @ 9 NONAME
+	_ZN23CMsgTestPropertyMapPairC2EP24TMsgTestPropertyMapEntryS1_ @ 10 NONAME
+	_ZN23CMsgTestPropertyWatcher4NewLE4TUidjR23MMsgTestPropertyWatcher @ 11 NONAME
+	_ZN23CMsgTestPropertyWatcher8PropertyEv @ 12 NONAME
+	_ZN23CMsgTestPropertyWatcherD0Ev @ 13 NONAME
+	_ZN23CMsgTestPropertyWatcherD1Ev @ 14 NONAME
+	_ZN23CMsgTestPropertyWatcherD2Ev @ 15 NONAME
+	_ZN24CImMobilityTestFramework12GetServiceIdER21MMobilityProtocolResp @ 16 NONAME
+	_ZN24CImMobilityTestFramework6CreateElR18CImMobilityManager @ 17 NONAME
+	_ZN24CImMobilityTestFramework6DeleteER18CImMobilityManager @ 18 NONAME
+	_ZN24CImMobilityTestFramework8MtmStateEl23TImMobilityTestMtmState @ 19 NONAME
+	_ZN30TMobilityTestPropertyMapAccess3GetEP7TDesC16 @ 20 NONAME
+	_ZN30TMobilityTestPropertyMapAccess3GetEi @ 21 NONAME
+	_ZTI23CMsgTestPropertyWatcher @ 22 NONAME ; #<TI>#
+	_ZTI24CImMobilityTestFramework @ 23 NONAME ; #<TI>#
+	_ZTIN14MSGNETTESTSTUB26CActiveCommsMobilityApiExtE @ 24 NONAME ; #<TI>#
+	_ZTIN4Meta11TMetaVarLenI5RBuf8EE @ 25 NONAME ABSENT; #<TI>#
+	_ZTIN4Meta11TMetaVarLenI6RBuf16EE @ 26 NONAME ABSENT ; #<TI>#
+	_ZTIN4Meta12TMetaVarLen8I5RBuf8EE @ 27 NONAME ABSENT ; #<TI>#
+	_ZTIN4Meta13TMetaVarLen16I6RBuf16EE @ 28 NONAME ABSENT ; #<TI>#
+	_ZTV23CMsgTestPropertyWatcher @ 29 NONAME ; #<VT>#
+	_ZTV24CImMobilityTestFramework @ 30 NONAME ; #<VT>#
+	_ZTVN14MSGNETTESTSTUB26CActiveCommsMobilityApiExtE @ 31 NONAME ; #<VT>#
+	_ZTVN4Meta11TMetaVarLenI5RBuf8EE @ 32 NONAME ABSENT ; #<VT>#
+	_ZTVN4Meta11TMetaVarLenI6RBuf16EE @ 33 NONAME ABSENT ; #<VT>#
+	_ZTVN4Meta12TMetaVarLen8I5RBuf8EE @ 34 NONAME ABSENT ; #<VT>#
+	_ZTVN4Meta13TMetaVarLen16I6RBuf16EE @ 35 NONAME ABSENT ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/mobilitytestframework/bwins/mobilitytestframeworku.def	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,18 @@
+EXPORTS
+	??0CMsgTestPropertyMapPair@@QAE@PAUTMsgTestPropertyMapEntry@@0@Z @ 1 NONAME ; CMsgTestPropertyMapPair::CMsgTestPropertyMapPair(struct TMsgTestPropertyMapEntry *, struct TMsgTestPropertyMapEntry *)
+	??1CActiveCommsMobilityApiExt@MSGNETTESTSTUB@@UAE@XZ @ 2 NONAME ; MSGNETTESTSTUB::CActiveCommsMobilityApiExt::~CActiveCommsMobilityApiExt(void)
+	??1CMsgTestPropertyWatcher@@UAE@XZ @ 3 NONAME ; CMsgTestPropertyWatcher::~CMsgTestPropertyWatcher(void)
+	?Create@CImMobilityTestFramework@@SAXJAAVCImMobilityManager@@@Z @ 4 NONAME ; void CImMobilityTestFramework::Create(long, class CImMobilityManager &)
+	?Delete@CImMobilityTestFramework@@SAXAAVCImMobilityManager@@@Z @ 5 NONAME ; void CImMobilityTestFramework::Delete(class CImMobilityManager &)
+	?Get@TMobilityTestPropertyMapAccess@@SAPBUTMsgTestPropertyMapEntry@@H@Z @ 6 NONAME ; struct TMsgTestPropertyMapEntry const * TMobilityTestPropertyMapAccess::Get(int)
+	?Get@TMobilityTestPropertyMapAccess@@SAPBUTMsgTestPropertyMapEntry@@PAVTDesC16@@@Z @ 7 NONAME ; struct TMsgTestPropertyMapEntry const * TMobilityTestPropertyMapAccess::Get(class TDesC16 *)
+	?GetServiceId@CImMobilityTestFramework@@SAJAAVMMobilityProtocolResp@@@Z @ 8 NONAME ; long CImMobilityTestFramework::GetServiceId(class MMobilityProtocolResp &)
+	?IgnorePreferredCarrier@CActiveCommsMobilityApiExt@MSGNETTESTSTUB@@QAEXXZ @ 9 NONAME ; void MSGNETTESTSTUB::CActiveCommsMobilityApiExt::IgnorePreferredCarrier(void)
+	?MigrateToPreferredCarrier@CActiveCommsMobilityApiExt@MSGNETTESTSTUB@@QAEXXZ @ 10 NONAME ; void MSGNETTESTSTUB::CActiveCommsMobilityApiExt::MigrateToPreferredCarrier(void)
+	?MtmState@CImMobilityTestFramework@@SAXJW4TImMobilityTestMtmState@@@Z @ 11 NONAME ; void CImMobilityTestFramework::MtmState(long, enum TImMobilityTestMtmState)
+	?NewCarrierAccepted@CActiveCommsMobilityApiExt@MSGNETTESTSTUB@@QAEXXZ @ 12 NONAME ; void MSGNETTESTSTUB::CActiveCommsMobilityApiExt::NewCarrierAccepted(void)
+	?NewCarrierRejected@CActiveCommsMobilityApiExt@MSGNETTESTSTUB@@QAEXXZ @ 13 NONAME ; void MSGNETTESTSTUB::CActiveCommsMobilityApiExt::NewCarrierRejected(void)
+	?NewL@CActiveCommsMobilityApiExt@MSGNETTESTSTUB@@SAPAV12@AAVRCommsSubSession@@AAVMMobilityProtocolResp@@@Z @ 14 NONAME ; class MSGNETTESTSTUB::CActiveCommsMobilityApiExt * MSGNETTESTSTUB::CActiveCommsMobilityApiExt::NewL(class RCommsSubSession &, class MMobilityProtocolResp &)
+	?NewL@CMsgTestPropertyWatcher@@SAPAV1@VTUid@@IAAVMMsgTestPropertyWatcher@@@Z @ 15 NONAME ; class CMsgTestPropertyWatcher * CMsgTestPropertyWatcher::NewL(class TUid, unsigned int, class MMsgTestPropertyWatcher &)
+	?Property@CMsgTestPropertyWatcher@@QAEAAVRProperty@@XZ @ 16 NONAME ; class RProperty & CMsgTestPropertyWatcher::Property(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/mobilitytestframework/group/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,23 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRJ_PLATFORMS
+
+PRJ_MMPFILES
+#ifdef __MOBILITY_TEST_FRAMEWORK
+mobilitytestframework.mmp
+#endif //__MOBILITY_TEST_FRAMEWORK
+
+PRJ_EXPORTS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/mobilitytestframework/group/mobilitytestframework.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,32 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+TARGET         mobilitytestframework.dll
+TARGETTYPE     dll
+
+CAPABILITY     All -TCB
+TARGETPATH     /system/libs
+UID            0x1000008d 0x10283077
+VENDORID       0x70000001
+
+SOURCEPATH		../src
+SOURCE				cimmobilitytestframework.cpp cimmobilitytesttls.cpp
+SOURCE				cmsgtestpropertywatcher.cpp cmsgtestpropertymappair.cpp
+SOURCE				tmobilitytestpropertymapaccess.cpp msgnetteststub.cpp
+
+USERINCLUDE    ../inc ../../inc
+SYSTEMINCLUDE  /epoc32/include /epoc32/include/comms-infras
+
+LIBRARY        euser.lib efsrv.lib netmeta.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/mobilitytestframework/inc/cimmobilitytestframework.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,68 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __CIMMOBILITYTESTFRAMEWORK_H__
+#define __CIMMOBILITYTESTFRAMEWORK_H__
+
+#include <e32base.h>
+#include <msvstd.h>
+#include <cs_mobility_apiext.h>  // MMobilityProtocolResp
+#include "mmsgtestpropertywatcher.h"
+#include "timmobilitytestmtmstate.h"
+
+// Forward class references
+class CImMobilityManager;
+class CMsgTestPropertyWatcher;
+
+/**
+The test framework class.
+
+@internalComponent
+@released
+*/
+class CImMobilityTestFramework : public CBase,
+									public MMsgTestPropertyWatcher
+	{
+public:
+	IMPORT_C static void Create(TMsvId aServiceId, CImMobilityManager& aMobilityManager);
+	IMPORT_C static void Delete(CImMobilityManager& aMobilityManager);
+	IMPORT_C static void MtmState(TMsvId aServiceId, TImMobilityTestMtmState aMtmState);
+	IMPORT_C static TMsvId GetServiceId(MMobilityProtocolResp& aProtocol);
+
+	~CImMobilityTestFramework();
+	TMsvId ServiceId();
+	CImMobilityManager& MobilityManager();
+	void TimerExpired();
+	
+	// from MMsgTestPropertyWatcher
+	void HandleEventL(RProperty& aProperty, TUint /*aKey*/);
+
+private:
+	static void NewL(TMsvId aServiceId, CImMobilityManager& aMobilityManager);
+	CImMobilityTestFramework(TMsvId aServiceId, CImMobilityManager& aMobilityManager);
+	void ConstructL();
+
+private:
+	// Mobility manager
+	CImMobilityManager& iMobilityManager;
+
+	// Service Id of related MTM
+	TMsvId iServiceId;
+	
+	// Property watcher for Publish&Subscribe
+	CMsgTestPropertyWatcher* iPropertyWatcher;
+	};
+
+#endif //__CIMMOBILITYTESTFRAMEWORK_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/mobilitytestframework/inc/cimmobilitytesttls.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,54 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __CIMMOBILITYTESTTLS_H__
+#define __CIMMOBILITYTESTTLS_H__
+
+#include <e32base.h>
+#include <msvstd.h>
+
+#include "cimmobilitytestframework.h"
+#include <cs_mobility_apiext.h>  // MMobilityProtocolResp
+
+class CImMobilityManager;
+
+/**
+Holds a list of the test frameworks and the list of actions read from
+the test script.
+A pointer to this class is held in thread local storage.
+
+@internalComponent
+@released
+*/
+NONSHARABLE_CLASS(CImMobilityTestTls) : public CBase
+	{
+public:
+	static CImMobilityTestTls* NewL();
+	CImMobilityTestTls();
+	void ConstructL();
+	~CImMobilityTestTls();
+
+	void AddFrameworkL(CImMobilityTestFramework& aFramework);
+	CImMobilityTestFramework* RemoveFramework(CImMobilityManager& aMobilityManager, TBool& aLastOne);
+	CImMobilityTestFramework* GetFramework(TMsvId aServiceId);
+	CImMobilityTestFramework* GetFramework(CImMobilityManager& aMobilityManager);
+	CImMobilityTestFramework* GetFramework(MMobilityProtocolResp& aProtocol);
+
+private:
+	// Test framework list
+  RPointerArray<CImMobilityTestFramework> iFrameworkList;
+	};
+
+#endif //__CIMMOBILITYTESTTLS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/mobilitytestframework/inc/cmsgtestpropertymappair.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,39 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @released
+*/
+
+#ifndef __CMSGTESTPROPERTYMAPPAIR_H__
+#define __CMSGTESTPROPERTYMAPPAIR_H__
+
+#include "tmsgtestpropertymapentry.h"
+
+class CMsgTestPropertyMapPair
+	{
+public:
+	IMPORT_C CMsgTestPropertyMapPair(TMsgTestPropertyMapEntry* aFlag, TMsgTestPropertyMapEntry* aCall);
+
+public:	
+	TMsgTestPropertyMapEntry* flag;
+	TMsgTestPropertyMapEntry* call;
+	};
+
+#endif //__CMSGTESTPROPERTYMAPPAIR_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/mobilitytestframework/inc/cmsgtestpropertywatcher.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,62 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// cmsgtestpropertwatcher.h
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @released
+*/
+
+#ifndef __CMSGTESTPROPERTYWATCHER_H__
+#define __CMSGTESTPROPERTYWATCHER_H__
+
+#include <e32base.h>
+#include <e32property.h>
+
+class MMsgTestPropertyWatcher;
+
+class CMsgTestPropertyWatcher : public CActive
+	{
+public:
+	IMPORT_C static CMsgTestPropertyWatcher* NewL(TUid aCategory, TUint aKey, MMsgTestPropertyWatcher& aCallback);
+	IMPORT_C virtual ~CMsgTestPropertyWatcher();
+    
+	IMPORT_C RProperty& Property();
+	
+protected:
+	void ConstructL(TUid aCategory, TUint aKey,  MMsgTestPropertyWatcher& aCallback);
+	CMsgTestPropertyWatcher();
+     
+private:
+	void RunL();
+	void DoCancel();
+    
+public:
+	//TBD: these should be private.
+	TUid iCategory;
+	TUint iKey;
+
+private:
+	MMsgTestPropertyWatcher* iCallback;
+
+protected:
+	RProperty iProperty;
+	};
+
+#endif //__CMSGTESTPROPERTYWATCHER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/mobilitytestframework/inc/mmsgtestpropertywatcher.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,37 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @released
+*/
+
+#ifndef __MMSGTESTPROPERTYWATCHER_H__
+#define __MMSGTESTPROPERTYWATCHER_H__
+
+#include <e32base.h>
+
+class RProperty;
+
+class MMsgTestPropertyWatcher
+	{
+public:
+	virtual void HandleEventL(RProperty& aProperty, TUint aKey) =0;
+	};
+
+#endif //__MMSGTESTPROPERTYWATCHER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/mobilitytestframework/inc/mobilitytestmtmapi.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,44 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @released
+*/
+
+#ifndef __MOBILITYTESTMTMAPI_H__
+#define __MOBILITYTESTMTMAPI_H__
+
+#ifndef __MOBILITY_TEST_FRAMEWORK
+
+#define MOBILITY_TEST_CREATE(serviceId, mobilityManager)
+#define MOBILITY_TEST_DELETE(mobilityManager)
+#define MOBILITY_TEST_MTM_STATE(serviceId, state)
+
+#else //__MOBILITY_TEST_FRAMEWORK
+
+#include "timmobilitytestmtmstate.h"
+#include "cimmobilitytestframework.h"
+
+#define MOBILITY_TEST_CREATE(serviceId, mobilityManager) CImMobilityTestFramework::Create(serviceId, mobilityManager)
+#define MOBILITY_TEST_DELETE(mobilityManager) CImMobilityTestFramework::Delete(mobilityManager)
+#define MOBILITY_TEST_MTM_STATE(serviceId, state) CImMobilityTestFramework::MtmState(serviceId, state)
+
+#endif //__MOBILITY_TEST_FRAMEWORK
+
+#endif //__MOBILITYTESTMTMAPI_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/mobilitytestframework/inc/mobilitytestpropertymap.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,126 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @released
+*/
+
+#ifndef __MOBILITYTESTPROPERTYMAP_H__
+#define __MOBILITYTESTPROPERTYMAP_H__
+
+#include "timmobilitytestmtmstate.h"
+#include "mobilitytestpropertyvalue.h"
+#include "tmsgtestpropertymapentry.h"
+
+const TMsgTestPropertyMapEntry propertyMapList[] = 
+	{
+		{"KNTSInitialValueFlag", ENTSInitialValueFlag},
+		{"KNTSPreferredCarrierUpgradeCall", ENTSPreferredCarrierUpgradeCall},
+		{"KNTSPreferredCarrierDowngradeCall", ENTSPreferredCarrierDowngradeCall},
+		{"KNTSNewCarrierActiveCall", ENTSNewCarrierActiveCall},
+		{"KNTSErrorCall", ENTSErrorCall},
+		{"KNTSMigrateToPreferredCarrierFlag", ENTSMigrateToPreferredCarrierFlag},
+		{"KNTSIgnorePreferredCarrierFlag", ENTSIgnorePreferredCarrierFlag},
+		{"KNTSNewCarrierAcceptedFlag", ENTSNewCarrierAcceptedFlag},
+		{"KNTSNewCarrierRejectedFlag", ENTSNewCarrierRejectedFlag},
+		{"KNTSPreferredCarrierUpgradeFlag", ENTSPreferredCarrierUpgradeFlag},
+		{"KNTSPreferredCarrierDowngradeFlag", ENTSPreferredCarrierDowngradeFlag},
+		{"KNTSCancelFlag", ENTSCancelFlag},
+		{"KNTSMigrationCompleteMigrateOKFlag", ENTSMigrationCompleteMigrateOKFlag},
+		{"KNTSMigrationCompleteCouldNotReconnectFlag", ENTSMigrationCompleteCouldNotReconnectFlag},
+		{"KNTSMigrationCompleteMobilityErrorFlag", ENTSMigrationCompleteMobilityErrorFlag},				
+		{"KNTSAcceptImmediatelyCall", ENTSAcceptImmediatelyCall},
+		{"KNTSAcceptStopCurrentCall", ENTSAcceptStopCurrentCall},
+		{"KNTSAcceptCompleteCurrentCall", ENTSAcceptCompleteCurrentCall},
+		{"KNTSIgnoreCall", ENTSIgnoreCall},
+		{"KNTSInitialReject",					KMobilityTestMtmStateInitialReject},
+		{"KNTSImapConnect",					KMobilityTestMtmStateImapConnect},
+		{"KNTSImapIdle",						KMobilityTestMtmStateImapIdle},
+		{"KNTSImapCopyFromLocal1",			KMobilityTestMtmStateImapCopyFromLocal1},
+		{"KNTSImapCopyFromLocal2",			KMobilityTestMtmStateImapCopyFromLocal2},
+		{"KNTSImapCopyFromLocal3",			KMobilityTestMtmStateImapCopyFromLocal3},
+		{"KNTSImapCopyToLocal1",				KMobilityTestMtmStateImapCopyToLocal1},
+		{"KNTSImapCopyToLocal2",				KMobilityTestMtmStateImapCopyToLocal2},
+		{"KNTSImapCopyToLocal3",				KMobilityTestMtmStateImapCopyToLocal3},
+		{"KNTSImapCopyToLocal4",				KMobilityTestMtmStateImapCopyToLocal4},
+		{"KNTSImapCopyToLocal5",				KMobilityTestMtmStateImapCopyToLocal5},
+		{"KNTSImapCopyToLocal6",				KMobilityTestMtmStateImapCopyToLocal6},
+		{"KNTSImapCopyToLocal7",				KMobilityTestMtmStateImapCopyToLocal7},
+		{"KNTSImapCopyWithinService1",		KMobilityTestMtmStateImapCopyWithinService1},
+		{"KNTSImapCopyWithinService2",		KMobilityTestMtmStateImapCopyWithinService2},
+		{"KNTSImapCopyWithinService3",		KMobilityTestMtmStateImapCopyWithinService3},
+		{"KNTSImapCopyWithinService4",		KMobilityTestMtmStateImapCopyWithinService4},
+		{"KNTSImapCopyWithinService5",		KMobilityTestMtmStateImapCopyWithinService5},
+		{"KNTSImapCopyWithinService6",		KMobilityTestMtmStateImapCopyWithinService6},
+		{"KNTSImapCopyWithinService7",		KMobilityTestMtmStateImapCopyWithinService7},
+		{"KNTSImapCopyWithinService8",		KMobilityTestMtmStateImapCopyWithinService8},
+		{"KNTSImapCreateFolder",				KMobilityTestMtmStateImapCreateFolder},
+		{"KNTSImapDelete1",					KMobilityTestMtmStateImapDelete1},
+		{"KNTSImapDelete2",					KMobilityTestMtmStateImapDelete2},
+		{"KNTSImapDelete3",					KMobilityTestMtmStateImapDelete3},
+		{"KNTSImapDelete4",					KMobilityTestMtmStateImapDelete4},
+		{"KNTSImapDelete5",					KMobilityTestMtmStateImapDelete5},
+		{"KNTSImapDeleteFolder1",				KMobilityTestMtmStateImapDeleteFolder1},
+		{"KNTSImapDeleteFolder2",				KMobilityTestMtmStateImapDeleteFolder2},
+		{"KNTSImapDeleteFolder3",				KMobilityTestMtmStateImapDeleteFolder3},
+		{"KNTSImapDeleteFolder4",				KMobilityTestMtmStateImapDeleteFolder4},
+		{"KNTSImapDisconnect1",				KMobilityTestMtmStateImapDisconnect1},
+		{"KNTSImapDisconnect2",				KMobilityTestMtmStateImapDisconnect2},
+		{"KNTSImapRename1",					KMobilityTestMtmStateImapRename1},
+		{"KNTSImapRename2",					KMobilityTestMtmStateImapRename2},
+		{"KNTSImapSyncFolder1",				KMobilityTestMtmStateImapSyncFolder1},
+ 		{"KNTSImapSyncFolder2",				KMobilityTestMtmStateImapSyncFolder2},
+ 		{"KNTSImapSyncFolderTree",			KMobilityTestMtmStateImapSyncFolderTree},
+		{"KNTSImapSyncEInboxEarlyDeletes",	KMobilityTestMtmImapSyncEInboxEarlyDeletes},
+		{"KNTSImapSyncEInboxEarlyExpunge",	KMobilityTestMtmImapSyncEInboxEarlyExpunge},
+		{"KNTSImapSyncEInboxSync",			KMobilityTestMtmImapSyncEInboxSync},
+		{"KNTSImapSyncESyncTree",				KMobilityTestMtmImapSyncESyncTree},
+		{"KNTSImapSyncESyncSubscriptions",	KMobilityTestMtmImapSyncESyncSubscriptions},
+		{"KNTSImapSyncEFolderEarlyDeletes",	KMobilityTestMtmImapSyncEFolderEarlyDeletes},
+		{"KNTSImapSyncEFolderEarlyExpunge",	KMobilityTestMtmImapSyncEFolderEarlyExpunge},
+		{"KNTSImapSyncESyncFolder",			KMobilityTestMtmImapSyncESyncFolder},
+		{"KNTSImapEInboxLateDeletes",			KMobilityTestMtmImapEInboxLateDeletes},
+		{"KNTSImapSyncEFolderLateDeletes",	KMobilityTestMtmImapSyncEFolderLateDeletes},
+		{"KNTSImapSyncEFolderLateExpunge",	KMobilityTestMtmImapSyncEFolderLateExpunge},
+		{"KNTSPopConnecting",					KMobilityTestMtmStatePopConnecting},
+		{"KNTSPopRefreshing",					KMobilityTestMtmStatePopRefreshing},
+		{"KNTSPopTidying",					KMobilityTestMtmStatePopTidying},
+		{"KNTSPopFindingFirstOfflineOp",		KMobilityTestMtmStatePopFindingFirstOfflineOp},
+		{"KNTSPopCancellingOfflineOps",		KMobilityTestMtmStatePopCancellingOfflineOps},
+		{"KNTSPopCopying",					KMobilityTestMtmStatePopCopying},
+		{"KNTSPopMoving",						KMobilityTestMtmStatePopMoving},
+		{"KNTSPopPopulating",					KMobilityTestMtmStatePopPopulating},
+		{"KNTSPopTopPopulating",				KMobilityTestMtmStatePopTopPopulating},
+		{"KNTSPopDeleting",					KMobilityTestMtmStatePopDeleting},
+		{"KNTSPopConnectedAndIdle",			KMobilityTestMtmStatePopConnectedAndIdle},
+		{"KNTSPopQuitting", KMobilityTestMtmStatePopQuitting},
+		{"KNTSPopRetrieving", KMobilityTestMtmStatePopRetrieving},
+		{"KNTSSmtpConnectingToSmtp",			KMobilityTestMtmStateSmtpConnectingToSmtp},
+		{"KNTSSmtpWaitingForReply",			KMobilityTestMtmStateSmtpWaitingForReply},
+		{"KNTSSmtpAuthorisingSmtp",			KMobilityTestMtmStateSmtpAuthorisingSmtp},
+		{"KNTSSmtpAuthInProgress",			KMobilityTestMtmStateSmtpAuthInProgress},
+		{"KNTSSmtpSendingStartTls",			KMobilityTestMtmStateSmtpSendingStartTls},
+		{"KNTSSmtpSettingSecurity",			KMobilityTestMtmStateSmtpSettingSecurity},
+		{"KNTSSmtpResetSmtp",					KMobilityTestMtmStateSmtpResetSmtp},
+		{"KNTSSmtpClosingSmtp",				KMobilityTestMtmStateSmtpClosingSmtp},
+		{"KNTSSmtpSendFile",					KMobilityTestMtmStateSmtpSendFile},
+		{"", 0xffffffff} // This must always be the last entry in the list
+	};
+
+#endif //__MOBILITYTESTPROPERTYMAP_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/mobilitytestframework/inc/mobilitytestpropertyvalue.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,68 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @released
+*/
+
+#ifndef __MOBILITYTESTPROPERTYVALUE_H__
+#define __MOBILITYTESTPROPERTYVALUE_H__
+
+#include <e32cmn.h>
+
+const TUid KPropertyCatMsgTestUtilityServer2={0x102857AB};
+
+static _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy);
+
+enum TMyPropertyKeys {EMyPropertyCounter, EMyPropertyParamCall, EMyPropertyParamFlag};
+
+const TInt KMobilityTestPropertyValueEnumerationOffset = 1000;
+
+enum TMobilityTestPropertyValue
+{
+	ENTSInitialValueFlag=KMobilityTestPropertyValueEnumerationOffset,
+	
+	//MMobilityProtocolResp:
+	ENTSPreferredCarrierUpgradeCall,
+	ENTSPreferredCarrierDowngradeCall,
+	ENTSNewCarrierActiveCall,
+	ENTSErrorCall,
+	
+	//CActiveCommsMobilityApiExt:
+	ENTSMigrateToPreferredCarrierFlag,
+	ENTSIgnorePreferredCarrierFlag,
+	ENTSNewCarrierAcceptedFlag,
+	ENTSNewCarrierRejectedFlag,
+
+	//CMobilityPolicyPlugin:
+	ENTSPreferredCarrierUpgradeFlag,
+	ENTSPreferredCarrierDowngradeFlag,
+	ENTSCancelFlag,
+	ENTSMigrationCompleteMigrateOKFlag,
+	ENTSMigrationCompleteCouldNotReconnectFlag,
+	ENTSMigrationCompleteMobilityErrorFlag,
+	
+	//MImMobilityPolicyHandler:
+	ENTSAcceptImmediatelyCall,
+	ENTSAcceptStopCurrentCall,
+	ENTSAcceptCompleteCurrentCall,
+	ENTSIgnoreCall
+};
+
+#endif //__MOBILITYTESTPROPERTYVALUE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/mobilitytestframework/inc/msgnetteststub.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,92 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @released
+*/
+
+#ifndef __MSGNETTESTSTUB_H__
+#define __MSGNETTESTSTUB_H__
+
+#ifdef __MOBILITY_TEST_FRAMEWORK
+
+#include <e32std.h>
+#include <cs_mobility_apiext.h>
+#include "mmsgtestpropertywatcher.h"
+#include <msvstd.h>
+
+class CMsgTestPropertyWatcher;
+
+namespace MSGNETTESTSTUB
+{
+
+class CActiveCommsMobilityApiExt :	public CBase,
+									public MMobilityProtocolResp,
+									public MMsgTestPropertyWatcher
+	{
+public:
+
+	//Stubbed interface:
+	IMPORT_C static CActiveCommsMobilityApiExt* NewL(RCommsSubSession& aExtensionProvider,MMobilityProtocolResp& aProtocol);
+	IMPORT_C ~CActiveCommsMobilityApiExt();
+
+	IMPORT_C void MigrateToPreferredCarrier();
+	IMPORT_C void IgnorePreferredCarrier();
+	IMPORT_C void NewCarrierAccepted();
+	IMPORT_C void NewCarrierRejected();
+
+protected:
+
+	//Internal methods:
+    void ConstructL();
+    explicit CActiveCommsMobilityApiExt(RCommsSubSession& aExtensionProvider, MMobilityProtocolResp& aProtocol);
+
+public:
+
+	// from MMobilityProtocolResp
+	void PreferredCarrierAvailable(TAccessPointInfo aOldAp, TAccessPointInfo aNewAp, TBool aIsUpgrade, TBool aIsSeamless);
+	void NewCarrierActive(TAccessPointInfo aNewAp, TBool aIsSeamless);
+	void Error(TInt aError);
+
+	// from MPropertyWatcher
+	void HandleEventL(RProperty& aProperty, TUint aKey);
+
+private:
+	
+	RCommsSubSession& iCommsSubSession;
+	MMobilityProtocolResp& iProtocol;
+
+	//Pointer to the real thing
+	::CActiveCommsMobilityApiExt* iCommsMobilityApi;
+	
+	//CMsgTestPropertyWatcher for IPC
+	CMsgTestPropertyWatcher* iPropertyWatcher;
+	
+	TMsvId iServiceId;
+	};
+
+}
+
+#ifndef LOCAL_INCLUDE
+#define CActiveCommsMobilityApiExt MSGNETTESTSTUB::CActiveCommsMobilityApiExt
+#endif // LOCAL_INCLUDE
+
+#endif //__MOBILITY_TEST_FRAMEWORK
+
+#endif //__MSGNETTESTSTUB_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/mobilitytestframework/inc/timmobilitytestmtmstate.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,130 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @released
+*/
+
+#ifndef __TIMMOBILITYTESTMTMSTATE_H__
+#define __TIMMOBILITYTESTMTMSTATE_H__
+
+/**
+Defines the set of states where the MTM will make a call into the test
+framework to see whether some mobility action should be performed.
+
+Note that if you add to this, you also need to add to the lists which
+are found in ....
+*/
+enum TImMobilityTestMtmState
+	{
+	KMobilityTestMtmStateNone,
+	KMobilityTestMtmStateInitialReject,
+
+	// IMAP MTM states
+	KMobilityTestMtmStateImapConnect,
+	KMobilityTestMtmStateImapIdle,				// this is the first IDLE call after bg sync completes
+
+	KMobilityTestMtmStateImapCopyFromLocal1,	// APPEND message
+	KMobilityTestMtmStateImapCopyFromLocal2, 	// SELECT destination folder
+	KMobilityTestMtmStateImapCopyFromLocal3,	// sync'ing destination folder
+	
+	KMobilityTestMtmStateImapCopyToLocal1,		// SELECT source folder
+	KMobilityTestMtmStateImapCopyToLocal2,		// FETCHing the message
+	KMobilityTestMtmStateImapCopyToLocal3,		// local async copy
+	KMobilityTestMtmStateImapCopyToLocal4,		//(10) STORE /deleted flag (move only)
+	KMobilityTestMtmStateImapCopyToLocal5,		// EXPUNGE (move only)
+	KMobilityTestMtmStateImapCopyToLocal6,		// CLOSE FOLDER (move only)
+	KMobilityTestMtmStateImapCopyToLocal7,		// SELECT FOLDER (move only)
+	
+	KMobilityTestMtmStateImapCopyWithinService1,// SELECT source mailbox
+	KMobilityTestMtmStateImapCopyWithinService2,// COPY message(s)
+	KMobilityTestMtmStateImapCopyWithinService3,// STORE /deleted flag (move only)
+	KMobilityTestMtmStateImapCopyWithinService4,// EXPUNGE source folder (move only)
+	KMobilityTestMtmStateImapCopyWithinService5,// SELECT destination folder
+	KMobilityTestMtmStateImapCopyWithinService6,// sync'ing destination folder
+	KMobilityTestMtmStateImapCopyWithinService7,//(20) CLOSE folder to delete messages
+	KMobilityTestMtmStateImapCopyWithinService8,// SELECT folder after close to delete messages
+
+	KMobilityTestMtmStateImapCreateFolder,		// CREATE command issued
+
+	KMobilityTestMtmStateImapDelete1,			// SELECT source folder
+	KMobilityTestMtmStateImapDelete2,			// STORE /deleted command
+	KMobilityTestMtmStateImapDelete3,			// EXPUNGE following a delete
+	KMobilityTestMtmStateImapDelete4,			// CLOSE FOLDER following a delete
+	KMobilityTestMtmStateImapDelete5,			// SELECT FOLDER following close to delete
+
+	KMobilityTestMtmStateImapDeleteFolder1, 	// SELECT source folder
+	KMobilityTestMtmStateImapDeleteFolder2, 	// STORE /deleted (all messages)
+	KMobilityTestMtmStateImapDeleteFolder3, 	//(30) CLOSE folder
+	KMobilityTestMtmStateImapDeleteFolder4, 	// DELETE folder
+	
+	KMobilityTestMtmStateImapDisconnect1,		// sync'ing late deletes
+	KMobilityTestMtmStateImapDisconnect2,		// LOGOUT etc
+	
+	KMobilityTestMtmStateImapRename1, 			// RENAME issued
+	KMobilityTestMtmStateImapRename2, 			// SUBSCRIBE issued
+	
+	KMobilityTestMtmStateImapSyncFolder1,		// SELECT issued
+ 	KMobilityTestMtmStateImapSyncFolder2,		// sync'ing the folder
+ 	
+ 	KMobilityTestMtmStateImapSyncFolderTree,	// sync'ing the folder tree 	
+	
+	KMobilityTestMtmImapSyncEInboxEarlyDeletes,
+	KMobilityTestMtmImapSyncEInboxEarlyExpunge, //(40)
+	KMobilityTestMtmImapSyncEInboxSync,
+	KMobilityTestMtmImapSyncESyncTree,
+	KMobilityTestMtmImapSyncESyncSubscriptions,
+	KMobilityTestMtmImapSyncEFolderEarlyDeletes,
+	KMobilityTestMtmImapSyncEFolderEarlyExpunge,
+	KMobilityTestMtmImapSyncESyncFolder,
+	KMobilityTestMtmImapEInboxLateDeletes,
+	KMobilityTestMtmImapSyncEFolderLateDeletes,
+	KMobilityTestMtmImapSyncEFolderLateExpunge,
+
+	// POP MTM states
+	KMobilityTestMtmStatePopConnecting = 300,
+	KMobilityTestMtmStatePopRefreshing,
+	KMobilityTestMtmStatePopTidying,
+	KMobilityTestMtmStatePopFindingFirstOfflineOp,
+	KMobilityTestMtmStatePopCancellingOfflineOps,
+	KMobilityTestMtmStatePopCopying,
+	KMobilityTestMtmStatePopMoving,
+	KMobilityTestMtmStatePopPopulating,
+	KMobilityTestMtmStatePopTopPopulating,
+	KMobilityTestMtmStatePopDeleting,
+	KMobilityTestMtmStatePopConnectedAndIdle,
+	KMobilityTestMtmStatePopQuitting,
+	KMobilityTestMtmStatePopRetrieving,
+
+	//SMTP MTM states
+	KMobilityTestMtmStateSmtpConnectingToSmtp = 500,
+	KMobilityTestMtmStateSmtpWaitingForReply,
+	KMobilityTestMtmStateSmtpAuthorisingSmtp,
+	KMobilityTestMtmStateSmtpAuthInProgress,
+	KMobilityTestMtmStateSmtpSendingStartTls,
+	KMobilityTestMtmStateSmtpSettingSecurity,
+	KMobilityTestMtmStateSmtpResetSmtp,
+	KMobilityTestMtmStateSmtpClosingSmtp,
+	KMobilityTestMtmStateSmtpSendFile
+
+	// Do not put any values at 1000 or above as this range is used
+	// elsewhere in the test framework
+	};
+
+#endif //__TIMMOBILITYTESTMTMSTATE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/mobilitytestframework/inc/tmobilitytestpropertymapaccess.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,37 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @released
+*/
+
+#ifndef __TMOBILITYTESTPROPERTYMAPACCESS_H__
+#define __TMOBILITYTESTPROPERTYMAPACCESS_H__
+
+#include <e32base.h>
+#include "tmsgtestpropertymapentry.h"
+
+class TMobilityTestPropertyMapAccess
+	{
+public:
+	IMPORT_C static const TMsgTestPropertyMapEntry* Get(TDesC* aName);
+	IMPORT_C static const TMsgTestPropertyMapEntry* Get(TInt aValue);
+	};
+
+#endif //__TMOBILITYTESTPROPERTYMAP_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/mobilitytestframework/inc/tmsgtestpropertymapentry.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,35 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @released
+*/
+
+#ifndef __TMSGTESTPROPERTYMAPENTRY_H__
+#define __TMSGTESTPROPERTYMAPENTRY_H__
+
+#include <e32base.h>
+
+struct TMsgTestPropertyMapEntry
+	{
+	const char* name;
+	TInt value;
+	};
+
+#endif //__TMSGTESTPROPERTYMAPENTRY_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/mobilitytestframework/src/cimmobilitytestframework.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,176 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "cimmobilitytestframework.h"
+#include "cimmobilitytesttls.h"
+#include "cimmobilitymanager.h"
+#include "cmsgtestpropertywatcher.h"
+#include "mobilitytestpropertyvalue.h"
+
+/**
+Creates a test framework.
+Static method.
+
+@param aServiceId Service ID of associated MTM
+@param aMobilityManager Associated mobility manager
+*/
+EXPORT_C void CImMobilityTestFramework::Create(TMsvId aServiceId, CImMobilityManager& aMobilityManager)
+	{
+	TRAP_IGNORE(NewL(aServiceId, aMobilityManager));
+	}
+
+/**
+Deletes a test framework.
+Static method.
+
+@param aMobilityManager Associated mobility manager
+*/	
+EXPORT_C void CImMobilityTestFramework::Delete(CImMobilityManager& aMobilityManager)
+	{
+	CImMobilityTestTls* testTls = static_cast<CImMobilityTestTls*>(Dll::Tls());
+
+	if (testTls)
+		{
+		TBool lastOne = EFalse;
+		CImMobilityTestFramework* framework = testTls->RemoveFramework(aMobilityManager, lastOne);
+
+		if (framework)
+			{
+			delete framework;
+			}
+
+		if (lastOne)
+			{
+			delete testTls;
+			}
+		}
+	}
+
+/**
+Called by an MTM when it reaches a specific operation state.
+Static method.
+
+@param aServiceId Service ID of MTM
+@param aMtmState MTM state
+*/
+EXPORT_C void CImMobilityTestFramework::MtmState(TMsvId aServiceId, TImMobilityTestMtmState aMtmState)
+	{
+	CImMobilityTestTls* testTls = static_cast<CImMobilityTestTls*>(Dll::Tls());
+
+	if (testTls)
+		{
+		CImMobilityTestFramework* framework = testTls->GetFramework(aServiceId);
+		if (framework)
+			{
+			// Flag the call
+			RProperty& property = framework->iPropertyWatcher->Property();
+   		property.Set(aMtmState);
+			}
+		}
+	}
+	
+/**
+Called by the net test stub to determine the service id.
+Static method.
+
+@param aProtocol reference to MMobilityProtocolResp
+*/
+EXPORT_C TMsvId CImMobilityTestFramework::GetServiceId(MMobilityProtocolResp& aProtocol)
+	{
+	CImMobilityTestTls* testTls = static_cast<CImMobilityTestTls*>(Dll::Tls());
+
+	if (testTls)
+		{
+		CImMobilityTestFramework* framework = testTls->GetFramework(aProtocol);
+		if (framework)
+			{
+			return framework->ServiceId();
+			}
+		}
+
+	return KErrNotFound;
+	}
+
+/**
+Factory constructor.
+Static method.
+
+@param aServiceId Service ID of associated MTM
+@param aMobilityManager Associated mobility manager
+*/
+void CImMobilityTestFramework::NewL(TMsvId aServiceId, CImMobilityManager& aMobilityManager)
+	{
+	CImMobilityTestTls* testTls = CImMobilityTestTls::NewL();
+
+	CImMobilityTestFramework* self = new (ELeave) CImMobilityTestFramework(aServiceId, aMobilityManager);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	// Store framework. Ownership is passed.
+	testTls->AddFrameworkL(*self);
+	}
+
+/**
+Class constructor.
+
+@param aServiceId Service ID of associated MTM
+@param aMobilityManager Associated mobility manager
+*/
+CImMobilityTestFramework::CImMobilityTestFramework(TMsvId aServiceId, CImMobilityManager& aMobilityManager) :
+ iMobilityManager(aMobilityManager),
+ iServiceId(aServiceId)
+	{
+	}
+
+/**
+Second phase constructor
+*/
+void CImMobilityTestFramework::ConstructL()
+	{
+	iPropertyWatcher = CMsgTestPropertyWatcher::NewL(KPropertyCatMsgTestUtilityServer2, EMyPropertyCounter, *this);
+	}
+
+/**
+Class destructor
+*/
+CImMobilityTestFramework::~CImMobilityTestFramework()
+	{
+	delete iPropertyWatcher;
+	}
+
+/**
+Returns service ID of associated MTM
+
+@return Service ID of MTM
+*/
+TMsvId CImMobilityTestFramework::ServiceId()
+	{
+	return iServiceId;
+	}
+
+/**
+Returns associated mobility maanger
+
+@return Mobility manager
+*/
+CImMobilityManager& CImMobilityTestFramework::MobilityManager()
+	{
+	return iMobilityManager;
+	}
+
+void CImMobilityTestFramework::HandleEventL(RProperty& /*aProperty*/, TUint /*aKey*/)
+	{
+	//Don't need to respond to events here.
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/mobilitytestframework/src/cimmobilitytesttls.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,165 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "cimmobilitytesttls.h"
+#include "cimmobilitytestframework.h"
+#include "cimmobilitymanager.h"
+
+/**
+Factory constructor
+Static routine
+
+@return Constructed class
+*/
+CImMobilityTestTls* CImMobilityTestTls::NewL()
+	{
+	CImMobilityTestTls* self = static_cast<CImMobilityTestTls*>(Dll::Tls());
+
+	if (!self)
+		{
+		self = new (ELeave) CImMobilityTestTls();
+		CleanupStack::PushL(self);
+		self->ConstructL();
+		CleanupStack::Pop(self);
+		Dll::SetTls(self);
+		}
+
+	return self;
+	}
+
+/**
+Class constructor
+*/
+CImMobilityTestTls::CImMobilityTestTls()
+	{
+	}
+
+/**
+Second phase constructor
+*/
+void CImMobilityTestTls::ConstructL()
+	{
+	}
+
+/**
+Class destructor
+*/
+CImMobilityTestTls::~CImMobilityTestTls()
+	{
+	iFrameworkList.Reset();
+
+	Dll::SetTls(NULL);
+	}
+
+/**
+Stores a test framework. Takes ownership of the framework.
+
+@param aFramework Test framework
+*/
+void CImMobilityTestTls::AddFrameworkL(CImMobilityTestFramework& aFramework)
+	{
+	iFrameworkList.AppendL(&aFramework);
+	}
+
+/**
+Removes a test framework from the list of frameworks and passes it back
+to the caller. The caller takes ownership of the framework.
+
+@param aMobilityManager Mobility manager associated with framework
+@param aLastOne Last framework has now been removed
+@return Test framework
+*/
+CImMobilityTestFramework* CImMobilityTestTls::RemoveFramework(CImMobilityManager& aMobilityManager, TBool& aLastOne)
+	{
+	CImMobilityTestFramework* framework = NULL;
+	aLastOne = EFalse;
+
+	for (TInt count = 0; count < iFrameworkList.Count(); ++count)
+		{
+		if (&(iFrameworkList[count]->MobilityManager()) == &aMobilityManager)
+			{
+			framework = iFrameworkList[count];
+			iFrameworkList.Remove(count);
+			if (iFrameworkList.Count() == 0)
+				{
+				aLastOne = ETrue;
+				}
+			break;
+			}
+		}
+
+	return framework;
+	}
+
+/**
+Gets a test framework from the list of frameworks.
+
+@param aServiceId Service ID used as search key
+@return Test framework
+*/
+CImMobilityTestFramework* CImMobilityTestTls::GetFramework(TMsvId aServiceId)
+	{
+	for (TInt count = 0; count < iFrameworkList.Count(); ++count)
+		{
+		if (iFrameworkList[count]->ServiceId() == aServiceId)
+			{
+			return iFrameworkList[count];
+			}
+		}
+
+	return NULL;
+	}
+
+/**
+Gets a test framework from the list of frameworks.
+
+@param aMobilityManager Mobility manager used as search key
+@return Test framework
+*/
+CImMobilityTestFramework* CImMobilityTestTls::GetFramework(CImMobilityManager& aMobilityManager)
+	{
+	for (TInt count = 0; count < iFrameworkList.Count(); ++count)
+		{
+		if (&(iFrameworkList[count]->MobilityManager()) == &aMobilityManager)
+			{
+			return iFrameworkList[count];
+			}
+		}
+
+	return NULL;
+	}
+
+/**
+Gets a test framework from the list of frameworks.
+
+@param aProtocol MMobilityProtocolResp& used as search key
+@return Test framework
+*/
+CImMobilityTestFramework* CImMobilityTestTls::GetFramework(MMobilityProtocolResp& aProtocol)
+	{
+	for (TInt count = 0; count < iFrameworkList.Count(); ++count)
+		{
+		CImMobilityManager* man = &(iFrameworkList[count]->MobilityManager());
+
+		MMobilityProtocolResp* prot = static_cast<MMobilityProtocolResp*>(man);
+		
+		if (prot == &aProtocol)
+			{
+			return iFrameworkList[count];
+			}
+		}
+
+	return NULL;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/mobilitytestframework/src/cmsgtestpropertymappair.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,27 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "cmsgtestpropertymappair.h"
+
+/**
+Class constructor
+
+@param aFlag Flag value
+@param aCall Call value
+*/
+EXPORT_C CMsgTestPropertyMapPair::CMsgTestPropertyMapPair(TMsgTestPropertyMapEntry* aFlag, TMsgTestPropertyMapEntry* aCall)
+: flag(aFlag), call(aCall)
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/mobilitytestframework/src/cmsgtestpropertywatcher.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,72 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <e32std.h>
+#include "mmsgtestpropertywatcher.h"
+#include "cmsgtestpropertywatcher.h"
+
+static _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy);
+
+EXPORT_C CMsgTestPropertyWatcher* CMsgTestPropertyWatcher::NewL(TUid aCategory, TUint aKey, MMsgTestPropertyWatcher& aCallback)
+    {
+    CMsgTestPropertyWatcher* self=new(ELeave) CMsgTestPropertyWatcher();
+    CleanupStack::PushL(self);
+    self->ConstructL(aCategory, aKey, aCallback);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CMsgTestPropertyWatcher::CMsgTestPropertyWatcher()
+    :CActive(EPriorityHigh)
+    {}
+
+void CMsgTestPropertyWatcher::ConstructL(TUid aCategory, TUint aKey, MMsgTestPropertyWatcher& aCallback)
+    {
+    iCategory = aCategory;
+    iKey = aKey;
+    iCallback = &aCallback;
+   
+    User::LeaveIfError(iProperty.Attach(aCategory,aKey)); 
+    CActiveScheduler::Add(this);
+
+    // initial subscription
+    iProperty.Subscribe(iStatus);
+    SetActive();
+    }
+
+EXPORT_C CMsgTestPropertyWatcher::~CMsgTestPropertyWatcher()
+    {
+    Cancel();
+    iProperty.Close();
+    }
+
+void CMsgTestPropertyWatcher::DoCancel()
+    {
+    iProperty.Cancel();
+    }
+
+void CMsgTestPropertyWatcher::RunL()
+    {
+    // re-subscribe before processing new value to prevent missing updates
+    iProperty.Subscribe(iStatus);
+    SetActive();
+
+    iCallback->HandleEventL(iProperty, iKey);
+    }
+    
+EXPORT_C RProperty& CMsgTestPropertyWatcher::Property()
+	{
+	return iProperty;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/mobilitytestframework/src/msgnetteststub.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,136 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// MSGMSGNETTESTSTUB.CPP
+// 
+//
+
+#define LOCAL_INCLUDE
+#include "msgnetteststub.h"
+#undef LOCAL_INCLUDE
+#include "cmsgtestpropertywatcher.h"
+#include "cimmobilitytestframework.h"
+#include "mobilitytestpropertyvalue.h"
+
+EXPORT_C MSGNETTESTSTUB::CActiveCommsMobilityApiExt* MSGNETTESTSTUB::CActiveCommsMobilityApiExt::NewL(RCommsSubSession& aExtensionProvider,MMobilityProtocolResp& aProtocol)
+{
+	CActiveCommsMobilityApiExt* self = new (ELeave) CActiveCommsMobilityApiExt(aExtensionProvider, aProtocol);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+}
+
+void MSGNETTESTSTUB::CActiveCommsMobilityApiExt::ConstructL()
+{
+	iCommsMobilityApi = NULL;
+	//Try to construct the real thing, but trap the 'not supported' error:
+//	TRAPD(err, iCommsMobilityApi = ::CActiveCommsMobilityApiExt::NewL(aExtensionProvider, *this));
+
+	iPropertyWatcher = CMsgTestPropertyWatcher::NewL(KPropertyCatMsgTestUtilityServer2, EMyPropertyCounter, *this);
+    
+	iServiceId = CImMobilityTestFramework::GetServiceId(iProtocol);
+	User::LeaveIfError(iServiceId);
+}
+
+MSGNETTESTSTUB::CActiveCommsMobilityApiExt::CActiveCommsMobilityApiExt(RCommsSubSession& aExtensionProvider, MMobilityProtocolResp& aProtocol)
+: iCommsSubSession(aExtensionProvider), iProtocol(aProtocol)
+{
+}
+
+EXPORT_C MSGNETTESTSTUB::CActiveCommsMobilityApiExt::~CActiveCommsMobilityApiExt()
+{
+	delete iCommsMobilityApi;
+	delete iPropertyWatcher;
+}
+
+EXPORT_C void MSGNETTESTSTUB::CActiveCommsMobilityApiExt::MigrateToPreferredCarrier()
+{
+//	Flag the call iCommsMobilityApi->MigrateToPreferredCarrier();
+	iPropertyWatcher->Property().Set(ENTSMigrateToPreferredCarrierFlag);
+}
+
+EXPORT_C void MSGNETTESTSTUB::CActiveCommsMobilityApiExt::IgnorePreferredCarrier()
+{
+//	Flag the call iCommsMobilityApi->IgnorePreferredCarrier();
+	iPropertyWatcher->Property().Set(ENTSIgnorePreferredCarrierFlag);
+}
+
+EXPORT_C void MSGNETTESTSTUB::CActiveCommsMobilityApiExt::NewCarrierAccepted()
+{
+//	Flag the call iCommsMobilityApi->NewCarrierAccepted();
+	iPropertyWatcher->Property().Set(ENTSNewCarrierAcceptedFlag);
+}
+
+EXPORT_C void MSGNETTESTSTUB::CActiveCommsMobilityApiExt::NewCarrierRejected()
+{
+//	Flag the call iCommsMobilityApi->NewCarrierRejected();
+	iPropertyWatcher->Property().Set(ENTSNewCarrierRejectedFlag);
+}
+
+//Additional functionality:
+
+// from MMobilityProtocolResp
+void MSGNETTESTSTUB::CActiveCommsMobilityApiExt::PreferredCarrierAvailable(TAccessPointInfo aOldAp, TAccessPointInfo aNewAp, TBool aIsUpgrade, TBool aIsSeamless)
+{
+	iProtocol.PreferredCarrierAvailable(aOldAp, aNewAp, aIsUpgrade, aIsSeamless);
+}
+
+void MSGNETTESTSTUB::CActiveCommsMobilityApiExt::NewCarrierActive(TAccessPointInfo aNewAp, TBool aIsSeamless)
+{
+	iProtocol.NewCarrierActive(aNewAp, aIsSeamless);
+}
+
+void MSGNETTESTSTUB::CActiveCommsMobilityApiExt::Error(TInt aError)
+{
+	iProtocol.Error(aError);
+}
+
+// from CMsgTestPropertyWatcher
+void MSGNETTESTSTUB::CActiveCommsMobilityApiExt::HandleEventL(RProperty& aProperty, TUint /*aKey*/)
+	{
+	
+	TInt propertyVal = ENTSInitialValueFlag;
+	User::LeaveIfError(aProperty.Get(propertyVal));
+	
+	TAccessPointInfo oldAp;
+	TAccessPointInfo newAp;		
+	oldAp.SetAccessPoint(1);
+	newAp.SetAccessPoint(1);
+		
+	TBool isSeamless = EFalse;
+
+	TInt error = 0;
+
+	switch(propertyVal)
+		{
+		// Callbacks to production code:
+		case ENTSPreferredCarrierUpgradeCall :			
+			PreferredCarrierAvailable(oldAp, newAp, ETrue, isSeamless);
+			break;
+		case ENTSPreferredCarrierDowngradeCall :
+			PreferredCarrierAvailable(oldAp, newAp, EFalse, isSeamless);
+			break;
+		case ENTSNewCarrierActiveCall :
+			NewCarrierActive(newAp, isSeamless);
+			break;
+		case ENTSErrorCall :
+			MSGNETTESTSTUB::CActiveCommsMobilityApiExt::Error(error);
+			break;
+
+		// Ignore any other calls
+		default :
+			break;
+		}
+
+  }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/mobilitytestframework/src/tmobilitytestpropertymapaccess.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,56 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "tmobilitytestpropertymapaccess.h"
+#include "mobilitytestpropertymap.h"
+
+EXPORT_C const TMsgTestPropertyMapEntry* TMobilityTestPropertyMapAccess::Get(TDesC* aName)
+	{
+	TInt i=0;
+
+	while (propertyMapList[i].value != 0xffffffff)
+		{
+		TBufC8<80> buf8((const unsigned char*)(propertyMapList[i].name));
+
+		TBuf<80> buf;
+		buf.Copy(buf8);
+
+		if (aName->CompareF(buf) == 0)
+			{
+			return &propertyMapList[i];
+			}
+
+		++i;
+		}
+
+	return NULL;
+	}
+
+EXPORT_C const TMsgTestPropertyMapEntry* TMobilityTestPropertyMapAccess::Get(TInt aValue)
+	{
+	TInt i=0;
+
+	while (propertyMapList[i].value != 0xFFFFFFFF)
+		{
+		if (propertyMapList[i].value == aValue)
+			{
+			return &propertyMapList[i];
+			}
+		
+		++i;
+		}
+
+	return NULL;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/testutils/bwins/T_MsgUtilityServerU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,72 @@
+EXPORTS
+	??0CT_MsgUtils@@QAE@XZ @ 1 NONAME ; CT_MsgUtils::CT_MsgUtils(void)
+	??0CT_MsgUtilsCentralRepository@@QAE@XZ @ 2 NONAME ; CT_MsgUtilsCentralRepository::CT_MsgUtilsCentralRepository(void)
+	??0CT_MsgUtilsConfigFileMachineName@@AAE@XZ @ 3 NONAME ; CT_MsgUtilsConfigFileMachineName::CT_MsgUtilsConfigFileMachineName(void)
+	??0CT_MsgUtilsConfigFileParserUtility@@AAE@XZ @ 4 NONAME ; CT_MsgUtilsConfigFileParserUtility::CT_MsgUtilsConfigFileParserUtility(void)
+	??0CT_MsgUtilsDeleteAllChildren@@QAE@PAVCMsvSession@@J@Z @ 5 NONAME ; CT_MsgUtilsDeleteAllChildren::CT_MsgUtilsDeleteAllChildren(class CMsvSession *, long)
+	??0CT_MsgUtilsEnumConverter@@QAE@XZ @ 6 NONAME ; CT_MsgUtilsEnumConverter::CT_MsgUtilsEnumConverter(void)
+	?After@CT_MsgTimerUtils@@QAEXHAAVTRequestStatus@@@Z @ 7 NONAME ; void CT_MsgTimerUtils::After(int, class TRequestStatus &)
+	?CloseResourceFile@CT_MsgUtils@@SAXPAX@Z @ 8 NONAME ; void CT_MsgUtils::CloseResourceFile(void *)
+	?CompareFilesL@CT_MsgUtils@@SAHVTPtrC16@@0HPAV?$CArrayFixFlat@G@@AAH@Z @ 9 NONAME ; int CT_MsgUtils::CompareFilesL(class TPtrC16, class TPtrC16, int, class CArrayFixFlat<unsigned short> *, int &)
+	?CompareIapPrefs@CT_MsgUtilsReadEmailSettingsFromConfigFile@@SAHAAVCImIAPPreferences@@0@Z @ 10 NONAME ; int CT_MsgUtilsReadEmailSettingsFromConfigFile::CompareIapPrefs(class CImIAPPreferences &, class CImIAPPreferences &)
+	?ConstructL@CT_MsgUtilsConfigFileMachineName@@AAEXABVTDesC16@@@Z @ 11 NONAME ; void CT_MsgUtilsConfigFileMachineName::ConstructL(class TDesC16 const &)
+	?ConstructL@CT_MsgUtilsConfigFileParserUtility@@AAEXABVTDesC16@@@Z @ 12 NONAME ; void CT_MsgUtilsConfigFileParserUtility::ConstructL(class TDesC16 const &)
+	?ConvertDesToTCommDbDialogPref@CT_MsgUtilsEnumConverter@@SA?AW4TCommDbDialogPref@@AAVTDesC16@@@Z @ 13 NONAME ; enum TCommDbDialogPref CT_MsgUtilsEnumConverter::ConvertDesToTCommDbDialogPref(class TDesC16 &)
+	?ConvertDesToTFolderSubscribeType@CT_MsgUtilsEnumConverter@@SA?AW4TFolderSubscribeType@@AAVTDesC16@@@Z @ 14 NONAME ; enum TFolderSubscribeType CT_MsgUtilsEnumConverter::ConvertDesToTFolderSubscribeType(class TDesC16 &)
+	?ConvertDesToTFolderSyncType@CT_MsgUtilsEnumConverter@@SA?AW4TFolderSyncType@@AAVTDesC16@@@Z @ 15 NONAME ; enum TFolderSyncType CT_MsgUtilsEnumConverter::ConvertDesToTFolderSyncType(class TDesC16 &)
+	?ConvertDesToTImImap4PartialMailOptions@CT_MsgUtilsEnumConverter@@SA?AW4TImImap4PartialMailOptions@@AAVTDesC16@@@Z @ 16 NONAME ; enum TImImap4PartialMailOptions CT_MsgUtilsEnumConverter::ConvertDesToTImImap4PartialMailOptions(class TDesC16 &)
+	?ConvertDesToTImSMTPSendCopyToSelf@CT_MsgUtilsEnumConverter@@SA?AW4TImSMTPSendCopyToSelf@@AAVTDesC16@@@Z @ 17 NONAME ; enum TImSMTPSendCopyToSelf CT_MsgUtilsEnumConverter::ConvertDesToTImSMTPSendCopyToSelf(class TDesC16 &)
+	?ConvertDesToTImSMTPSendMessageOption@CT_MsgUtilsEnumConverter@@SA?AW4TImSMTPSendMessageOption@@AAVTDesC16@@@Z @ 18 NONAME ; enum TImSMTPSendMessageOption CT_MsgUtilsEnumConverter::ConvertDesToTImSMTPSendMessageOption(class TDesC16 &)
+	?ConvertDesToTImap4Cmds@CT_MsgUtilsEnumConverter@@SA?AW4TImap4Cmds@@AAVTDesC16@@@Z @ 19 NONAME ; enum TImap4Cmds CT_MsgUtilsEnumConverter::ConvertDesToTImap4Cmds(class TDesC16 &)
+	?ConvertDesToTImap4GetMailOptions@CT_MsgUtilsEnumConverter@@SA?AW4TImap4GetMailOptions@@AAVTDesC16@@@Z @ 20 NONAME ; enum TImap4GetMailOptions CT_MsgUtilsEnumConverter::ConvertDesToTImap4GetMailOptions(class TDesC16 &)
+	?ConvertDesToTMsgOutboxBodyEncoding@CT_MsgUtilsEnumConverter@@SA?AW4TMsgOutboxBodyEncoding@@AAVTDesC16@@@Z @ 21 NONAME ; enum TMsgOutboxBodyEncoding CT_MsgUtilsEnumConverter::ConvertDesToTMsgOutboxBodyEncoding(class TDesC16 &)
+	?ConvertDesToTPop3Cmds@CT_MsgUtilsEnumConverter@@SA?AW4TPop3Cmds@@ABVTDesC16@@@Z @ 22 NONAME ; enum TPop3Cmds CT_MsgUtilsEnumConverter::ConvertDesToTPop3Cmds(class TDesC16 const &)
+	?ConvertDesToTPop3GetMailOptions@CT_MsgUtilsEnumConverter@@SA?AW4TPop3GetMailOptions@@AAVTDesC16@@@Z @ 23 NONAME ; enum TPop3GetMailOptions CT_MsgUtilsEnumConverter::ConvertDesToTPop3GetMailOptions(class TDesC16 &)
+	?CreateChildrenSelectionL@CT_MsgUtils@@SAPAVCMsvEntrySelection@@PAVCMsvSession@@J@Z @ 24 NONAME ; class CMsvEntrySelection * CT_MsgUtils::CreateChildrenSelectionL(class CMsvSession *, long)
+	?CreateChildrenSelectionRemoteFolderL@CT_MsgUtils@@SAPAVCMsvEntrySelection@@PAVCMsvSession@@VTPtrC16@@1@Z @ 25 NONAME ; class CMsvEntrySelection * CT_MsgUtils::CreateChildrenSelectionRemoteFolderL(class CMsvSession *, class TPtrC16, class TPtrC16)
+	?CreateChildrenSelectionRemoteFolderWithTypeL@CT_MsgUtils@@SAPAVCMsvEntrySelection@@PAVCMsvSession@@VTPtrC16@@1VTUid@@@Z @ 26 NONAME ; class CMsvEntrySelection * CT_MsgUtils::CreateChildrenSelectionRemoteFolderWithTypeL(class CMsvSession *, class TPtrC16, class TPtrC16, class TUid)
+	?CreateChildrenSelectionWithTypeL@CT_MsgUtils@@SAPAVCMsvEntrySelection@@PAVCMsvSession@@JVTUid@@@Z @ 27 NONAME ; class CMsvEntrySelection * CT_MsgUtils::CreateChildrenSelectionWithTypeL(class CMsvSession *, long, class TUid)
+	?FinalProgressStatus@CT_MsgUtilsDeleteAllChildren@@QAEHAAVCMsvOperation@@ABVTRequestStatus@@@Z @ 28 NONAME ; int CT_MsgUtilsDeleteAllChildren::FinalProgressStatus(class CMsvOperation &, class TRequestStatus const &)
+	?FindEntryByNameL@CT_MsgUtils@@SAJPAVCMsvEntry@@AAVTDesC16@@1H@Z @ 29 NONAME ; long CT_MsgUtils::FindEntryByNameL(class CMsvEntry *, class TDesC16 &, class TDesC16 &, int)
+	?FindEntryByNameL@CT_MsgUtils@@SAJPAVCMsvEntry@@AAVTDesC16@@H@Z @ 30 NONAME ; long CT_MsgUtils::FindEntryByNameL(class CMsvEntry *, class TDesC16 &, int)
+	?FindEntryByNameL@CT_MsgUtils@@SAJPAVCMsvSession@@JAAVTDesC16@@1H@Z @ 31 NONAME ; long CT_MsgUtils::FindEntryByNameL(class CMsvSession *, long, class TDesC16 &, class TDesC16 &, int)
+	?FindEntryByNameL@CT_MsgUtils@@SAJPAVCMsvSession@@JAAVTDesC16@@H@Z @ 32 NONAME ; long CT_MsgUtils::FindEntryByNameL(class CMsvSession *, long, class TDesC16 &, int)
+	?FindFolderIdByName@CT_MsgUtilsEnumConverter@@SAJAAVTDesC16@@@Z @ 33 NONAME ; long CT_MsgUtilsEnumConverter::FindFolderIdByName(class TDesC16 &)
+	?GetDefaultSmtpServiceIdL@CT_MsgUtilsCentralRepository@@SAJXZ @ 34 NONAME ; long CT_MsgUtilsCentralRepository::GetDefaultSmtpServiceIdL(void)
+	?GetFieldAsInteger@CT_MsgUtilsConfigFileParserUtility@@QAEHABVTDesC16@@AAH@Z @ 35 NONAME ; int CT_MsgUtilsConfigFileParserUtility::GetFieldAsInteger(class TDesC16 const &, int &)
+	?GetFieldAsString8@CT_MsgUtilsConfigFileParserUtility@@QAEHABVTDesC16@@AAVTPtrC8@@@Z @ 36 NONAME ; int CT_MsgUtilsConfigFileParserUtility::GetFieldAsString8(class TDesC16 const &, class TPtrC8 &)
+	?GetFieldAsString@CT_MsgUtilsConfigFileParserUtility@@QAEHABVTDesC16@@AAVTPtrC16@@@Z @ 37 NONAME ; int CT_MsgUtilsConfigFileParserUtility::GetFieldAsString(class TDesC16 const &, class TPtrC16 &)
+	?GetImapAccountL@CT_MsgUtilsCentralRepository@@SAHAAVTDes16@@AAVTImapAccount@@@Z @ 38 NONAME ; int CT_MsgUtilsCentralRepository::GetImapAccountL(class TDes16 &, class TImapAccount &)
+	?GetImapServiceIdL@CT_MsgUtilsCentralRepository@@SAJAAVTDes16@@@Z @ 39 NONAME ; long CT_MsgUtilsCentralRepository::GetImapServiceIdL(class TDes16 &)
+	?GetPopAccountL@CT_MsgUtilsCentralRepository@@SAHAAVTDes16@@AAVTPopAccount@@@Z @ 40 NONAME ; int CT_MsgUtilsCentralRepository::GetPopAccountL(class TDes16 &, class TPopAccount &)
+	?GetPopServiceIdL@CT_MsgUtilsCentralRepository@@SAJAAVTDes16@@@Z @ 41 NONAME ; long CT_MsgUtilsCentralRepository::GetPopServiceIdL(class TDes16 &)
+	?GetRemoteFolderIdByNameL@CT_MsgUtils@@SAJPAVCMsvSession@@VTPtrC16@@11H@Z @ 42 NONAME ; long CT_MsgUtils::GetRemoteFolderIdByNameL(class CMsvSession *, class TPtrC16, class TPtrC16, class TPtrC16, int)
+	?GetRemoteFolderIdByNameL@CT_MsgUtils@@SAJPAVCMsvSession@@VTPtrC16@@1H@Z @ 43 NONAME ; long CT_MsgUtils::GetRemoteFolderIdByNameL(class CMsvSession *, class TPtrC16, class TPtrC16, int)
+	?GetString@CT_MsgUtilsReadEmailSettingsFromConfigFile@@CAHAAVTDesC16@@AAHHAAVTPtrC16@@@Z @ 44 NONAME ; int CT_MsgUtilsReadEmailSettingsFromConfigFile::GetString(class TDesC16 &, int &, int, class TPtrC16 &)
+	?MachineName@CT_MsgUtilsConfigFileMachineName@@QAEABVTDesC8@@XZ @ 45 NONAME ; class TDesC8 const & CT_MsgUtilsConfigFileMachineName::MachineName(void)
+	?MachineNameEmail@CT_MsgUtilsConfigFileMachineName@@QAEABVTDesC16@@XZ @ 46 NONAME ; class TDesC16 const & CT_MsgUtilsConfigFileMachineName::MachineNameEmail(void)
+	?NewL@CT_MsgTimerUtils@@SAPAV1@XZ @ 47 NONAME ; class CT_MsgTimerUtils * CT_MsgTimerUtils::NewL(void)
+	?NewL@CT_MsgUtilsConfigFileMachineName@@SAPAV1@ABVTDesC16@@@Z @ 48 NONAME ; class CT_MsgUtilsConfigFileMachineName * CT_MsgUtilsConfigFileMachineName::NewL(class TDesC16 const &)
+	?NewL@CT_MsgUtilsConfigFileParserUtility@@SAPAV1@ABVTDesC16@@@Z @ 49 NONAME ; class CT_MsgUtilsConfigFileParserUtility * CT_MsgUtilsConfigFileParserUtility::NewL(class TDesC16 const &)
+	?NewLC@CT_MsgUtilsConfigFileMachineName@@SAPAV1@ABVTDesC16@@@Z @ 50 NONAME ; class CT_MsgUtilsConfigFileMachineName * CT_MsgUtilsConfigFileMachineName::NewLC(class TDesC16 const &)
+	?OpenResourceFileL@CT_MsgUtils@@SAXAAVRResourceFile@@AAVRFs@@ABVTDesC16@@@Z @ 51 NONAME ; void CT_MsgUtils::OpenResourceFileL(class RResourceFile &, class RFs &, class TDesC16 const &)
+	?ReadDataL@CT_MsgUtils@@SAHAAVRFileReadStream@@AAVTPtr16@@HPAV?$CArrayFixFlat@G@@@Z @ 52 NONAME ; int CT_MsgUtils::ReadDataL(class RFileReadStream &, class TPtr16 &, int, class CArrayFixFlat<unsigned short> *)
+	?ReadImapIAPAndAddFieldL@CT_MsgUtilsReadEmailSettingsFromConfigFile@@CAXPAVCT_MsgUtilsConfigFileParserUtility@@ABVTDesC16@@AAVCImIAPPreferences@@@Z @ 53 NONAME ; void CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadImapIAPAndAddFieldL(class CT_MsgUtilsConfigFileParserUtility *, class TDesC16 const &, class CImIAPPreferences &)
+	?ReadImapIAPAndAddL@CT_MsgUtilsReadEmailSettingsFromConfigFile@@CAXPAVCT_MsgUtilsConfigFileParserUtility@@ABVTDesC16@@AAVCImIAPPreferences@@@Z @ 54 NONAME ; void CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadImapIAPAndAddL(class CT_MsgUtilsConfigFileParserUtility *, class TDesC16 const &, class CImIAPPreferences &)
+	?ReadImapSettingsFromConfigurationFileL@CT_MsgUtilsReadEmailSettingsFromConfigFile@@SAXAAVTDesC16@@AAVCImImap4Settings@@AAVCImIAPPreferences@@ABV2@@Z @ 55 NONAME ; void CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadImapSettingsFromConfigurationFileL(class TDesC16 &, class CImImap4Settings &, class CImIAPPreferences &, class TDesC16 const &)
+	?ReadPopIAPAndAddFieldL@CT_MsgUtilsReadEmailSettingsFromConfigFile@@CAXPAVCT_MsgUtilsConfigFileParserUtility@@ABVTDesC16@@AAVCImIAPPreferences@@@Z @ 56 NONAME ; void CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadPopIAPAndAddFieldL(class CT_MsgUtilsConfigFileParserUtility *, class TDesC16 const &, class CImIAPPreferences &)
+	?ReadPopIAPAndAddL@CT_MsgUtilsReadEmailSettingsFromConfigFile@@CAXPAVCT_MsgUtilsConfigFileParserUtility@@ABVTDesC16@@AAVCImIAPPreferences@@@Z @ 57 NONAME ; void CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadPopIAPAndAddL(class CT_MsgUtilsConfigFileParserUtility *, class TDesC16 const &, class CImIAPPreferences &)
+	?ReadPopSettingsFromConfigurationFileL@CT_MsgUtilsReadEmailSettingsFromConfigFile@@SAXAAVTDesC16@@AAVCImPop3Settings@@AAVCImIAPPreferences@@ABV2@@Z @ 58 NONAME ; void CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadPopSettingsFromConfigurationFileL(class TDesC16 &, class CImPop3Settings &, class CImIAPPreferences &, class TDesC16 const &)
+	?ReadSmtpIAPAndAddFieldL@CT_MsgUtilsReadEmailSettingsFromConfigFile@@CAXPAVCT_MsgUtilsConfigFileParserUtility@@ABVTDesC16@@AAVCImIAPPreferences@@@Z @ 59 NONAME ; void CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadSmtpIAPAndAddFieldL(class CT_MsgUtilsConfigFileParserUtility *, class TDesC16 const &, class CImIAPPreferences &)
+	?ReadSmtpIAPAndAddL@CT_MsgUtilsReadEmailSettingsFromConfigFile@@CAXPAVCT_MsgUtilsConfigFileParserUtility@@ABVTDesC16@@AAVCImIAPPreferences@@@Z @ 60 NONAME ; void CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadSmtpIAPAndAddL(class CT_MsgUtilsConfigFileParserUtility *, class TDesC16 const &, class CImIAPPreferences &)
+	?ReadSmtpSettingsFromConfigurationFileL@CT_MsgUtilsReadEmailSettingsFromConfigFile@@SAXAAVTDesC16@@AAVCImSmtpSettings@@AAVCImIAPPreferences@@ABV2@@Z @ 61 NONAME ; void CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadSmtpSettingsFromConfigurationFileL(class TDesC16 &, class CImSmtpSettings &, class CImIAPPreferences &, class TDesC16 const &)
+	?SearchMessageBySubjectL@CT_MsgUtils@@SAJPAVCMsvSession@@JVTPtrC16@@@Z @ 62 NONAME ; long CT_MsgUtils::SearchMessageBySubjectL(class CMsvSession *, long, class TPtrC16)
+	?StartL@CT_MsgUtilsDeleteAllChildren@@QAEXAAVTRequestStatus@@@Z @ 63 NONAME ; void CT_MsgUtilsDeleteAllChildren::StartL(class TRequestStatus &)
+	?ConvertDesToEventCode@CT_MsgUtilsEnumConverter@@SA?AW4TInstrumentationPoint@@AAVTDesC16@@@Z @ 64 NONAME ; enum TInstrumentationPoint CT_MsgUtilsEnumConverter::ConvertDesToEventCode(class TDesC16 &)
+	?ConvertDesToTSmtpCmdsL@CT_MsgUtilsEnumConverter@@SA?AW4TSmtpCmds@@AAVTDesC16@@@Z @ 65 NONAME ; enum TSmtpCmds CT_MsgUtilsEnumConverter::ConvertDesToTSmtpCmdsL(class TDesC16 &)
+	?SearchMessageBySubjectL@CT_MsgUtils@@SAJPAVCMsvSession@@JVTPtrC16@@H@Z @ 66 NONAME ; long CT_MsgUtils::SearchMessageBySubjectL(class CMsvSession *, long, class TPtrC16, int)
+	?ConvertDesToBearerTypes@CT_MsgUtilsEnumConverter@@SAKABVTDesC16@@@Z @ 67 NONAME ; unsigned long CT_MsgUtilsEnumConverter::ConvertDesToBearerTypes(class TDesC16 const &)
+	?GetSmtpAccountL@CT_MsgUtilsCentralRepository@@SAHAAVTDes16@@AAVTSmtpAccount@@@Z @ 68 NONAME ; int CT_MsgUtilsCentralRepository::GetSmtpAccountL(class TDes16 &, class TSmtpAccount &)
+	?GetSmtpServiceIdL@CT_MsgUtilsCentralRepository@@SAJAAVTDes16@@@Z @ 69 NONAME ; long CT_MsgUtilsCentralRepository::GetSmtpServiceIdL(class TDes16 &)
+	?StartL@CT_MsgUtilsDeleteAllChildren@@QAEXHAAVTRequestStatus@@@Z @ 70 NONAME ; void CT_MsgUtilsDeleteAllChildren::StartL(int, class TRequestStatus &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/testutils/bwins/messagingtestutility2u.def	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,14 @@
+EXPORTS
+	?Connect@RMessagingTestUtilityServer2@@QAEHXZ @ 1 NONAME ; int RMessagingTestUtilityServer2::Connect(void)
+	?CopyFile@RMessagingTestUtilityServer2@@QAEHABVTDesC16@@0@Z @ 2 NONAME ; int RMessagingTestUtilityServer2::CopyFile(class TDesC16 const &, class TDesC16 const &)
+	?DeleteFile@RMessagingTestUtilityServer2@@QAEHABVTDesC16@@@Z @ 3 NONAME ; int RMessagingTestUtilityServer2::DeleteFile(class TDesC16 const &)
+	?DeleteMessageStore@RMessagingTestUtilityServer2@@QAEHJ@Z @ 4 NONAME ; int RMessagingTestUtilityServer2::DeleteMessageStore(long)
+	?EventHandlerAdd@RMessagingTestUtilityServer2@@QAEHABVTDesC16@@0@Z @ 5 NONAME ; int RMessagingTestUtilityServer2::EventHandlerAdd(class TDesC16 const &, class TDesC16 const &)
+	?EventHandlerCheck@RMessagingTestUtilityServer2@@QAEHXZ @ 6 NONAME ; int RMessagingTestUtilityServer2::EventHandlerCheck(void)
+	?EventHandlerInit@RMessagingTestUtilityServer2@@QAEHXZ @ 7 NONAME ; int RMessagingTestUtilityServer2::EventHandlerInit(void)
+	?FileExists@RMessagingTestUtilityServer2@@QAEHABVTDesC16@@@Z @ 8 NONAME ; int RMessagingTestUtilityServer2::FileExists(class TDesC16 const &)
+	?GetDirL@RMessagingTestUtilityServer2@@QAEHABVTDesC16@@IIAAPAVCDir@@@Z @ 9 NONAME ; int RMessagingTestUtilityServer2::GetDirL(class TDesC16 const &, unsigned int, unsigned int, class CDir * &)
+	?KillProcess@RMessagingTestUtilityServer2@@QAEHVTProcessId@@@Z @ 10 NONAME ; int RMessagingTestUtilityServer2::KillProcess(class TProcessId)
+	?MkDir@RMessagingTestUtilityServer2@@QAEHABVTDesC16@@@Z @ 11 NONAME ; int RMessagingTestUtilityServer2::MkDir(class TDesC16 const &)
+	?RmDir@RMessagingTestUtilityServer2@@QAEHABVTDesC16@@@Z @ 12 NONAME ; int RMessagingTestUtilityServer2::RmDir(class TDesC16 const &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/testutils/eabi/T_MsgUtilityServerU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,86 @@
+EXPORTS
+	_ZN11CT_MsgUtils13CompareFilesLE7TPtrC16S0_iP13CArrayFixFlatItERi @ 1 NONAME
+	_ZN11CT_MsgUtils16FindEntryByNameLEP11CMsvSessionlR7TDesC16S3_i @ 2 NONAME
+	_ZN11CT_MsgUtils16FindEntryByNameLEP11CMsvSessionlR7TDesC16i @ 3 NONAME
+	_ZN11CT_MsgUtils16FindEntryByNameLEP9CMsvEntryR7TDesC16S3_i @ 4 NONAME
+	_ZN11CT_MsgUtils16FindEntryByNameLEP9CMsvEntryR7TDesC16i @ 5 NONAME
+	_ZN11CT_MsgUtils17CloseResourceFileEPv @ 6 NONAME
+	_ZN11CT_MsgUtils17OpenResourceFileLER13RResourceFileR3RFsRK7TDesC16 @ 7 NONAME
+	_ZN11CT_MsgUtils23SearchMessageBySubjectLEP11CMsvSessionl7TPtrC16 @ 8 NONAME
+	_ZN11CT_MsgUtils24CreateChildrenSelectionLEP11CMsvSessionl @ 9 NONAME
+	_ZN11CT_MsgUtils24GetRemoteFolderIdByNameLEP11CMsvSession7TPtrC16S2_S2_i @ 10 NONAME
+	_ZN11CT_MsgUtils24GetRemoteFolderIdByNameLEP11CMsvSession7TPtrC16S2_i @ 11 NONAME
+	_ZN11CT_MsgUtils32CreateChildrenSelectionWithTypeLEP11CMsvSessionl4TUid @ 12 NONAME
+	_ZN11CT_MsgUtils36CreateChildrenSelectionRemoteFolderLEP11CMsvSession7TPtrC16S2_ @ 13 NONAME
+	_ZN11CT_MsgUtils44CreateChildrenSelectionRemoteFolderWithTypeLEP11CMsvSession7TPtrC16S2_4TUid @ 14 NONAME
+	_ZN11CT_MsgUtils9ReadDataLER15RFileReadStreamR6TPtr16iP13CArrayFixFlatItE @ 15 NONAME
+	_ZN11CT_MsgUtilsC1Ev @ 16 NONAME
+	_ZN11CT_MsgUtilsC2Ev @ 17 NONAME
+	_ZN16CT_MsgTimerUtils4NewLEv @ 18 NONAME
+	_ZN16CT_MsgTimerUtils5AfterEiR14TRequestStatus @ 19 NONAME
+	_ZN24CT_MsgUtilsEnumConverter18FindFolderIdByNameER7TDesC16 @ 20 NONAME
+	_ZN24CT_MsgUtilsEnumConverter21ConvertDesToTPop3CmdsERK7TDesC16 @ 21 NONAME
+	_ZN24CT_MsgUtilsEnumConverter22ConvertDesToTImap4CmdsER7TDesC16 @ 22 NONAME
+	_ZN24CT_MsgUtilsEnumConverter27ConvertDesToTFolderSyncTypeER7TDesC16 @ 23 NONAME
+	_ZN24CT_MsgUtilsEnumConverter29ConvertDesToTCommDbDialogPrefER7TDesC16 @ 24 NONAME
+	_ZN24CT_MsgUtilsEnumConverter31ConvertDesToTPop3GetMailOptionsER7TDesC16 @ 25 NONAME
+	_ZN24CT_MsgUtilsEnumConverter32ConvertDesToTFolderSubscribeTypeER7TDesC16 @ 26 NONAME
+	_ZN24CT_MsgUtilsEnumConverter32ConvertDesToTImap4GetMailOptionsER7TDesC16 @ 27 NONAME
+	_ZN24CT_MsgUtilsEnumConverter33ConvertDesToTImSMTPSendCopyToSelfER7TDesC16 @ 28 NONAME
+	_ZN24CT_MsgUtilsEnumConverter34ConvertDesToTMsgOutboxBodyEncodingER7TDesC16 @ 29 NONAME
+	_ZN24CT_MsgUtilsEnumConverter36ConvertDesToTImSMTPSendMessageOptionER7TDesC16 @ 30 NONAME
+	_ZN24CT_MsgUtilsEnumConverter38ConvertDesToTImImap4PartialMailOptionsER7TDesC16 @ 31 NONAME
+	_ZN24CT_MsgUtilsEnumConverterC1Ev @ 32 NONAME
+	_ZN24CT_MsgUtilsEnumConverterC2Ev @ 33 NONAME
+	_ZN28CT_MsgUtilsCentralRepository14GetPopAccountLER6TDes16R11TPopAccount @ 34 NONAME
+	_ZN28CT_MsgUtilsCentralRepository15GetImapAccountLER6TDes16R12TImapAccount @ 35 NONAME
+	_ZN28CT_MsgUtilsCentralRepository16GetPopServiceIdLER6TDes16 @ 36 NONAME
+	_ZN28CT_MsgUtilsCentralRepository17GetImapServiceIdLER6TDes16 @ 37 NONAME
+	_ZN28CT_MsgUtilsCentralRepository24GetDefaultSmtpServiceIdLEv @ 38 NONAME
+	_ZN28CT_MsgUtilsCentralRepositoryC1Ev @ 39 NONAME
+	_ZN28CT_MsgUtilsCentralRepositoryC2Ev @ 40 NONAME
+	_ZN28CT_MsgUtilsDeleteAllChildren19FinalProgressStatusER13CMsvOperationRK14TRequestStatus @ 41 NONAME
+	_ZN28CT_MsgUtilsDeleteAllChildren6StartLER14TRequestStatus @ 42 NONAME
+	_ZN28CT_MsgUtilsDeleteAllChildrenC1EP11CMsvSessionl @ 43 NONAME
+	_ZN28CT_MsgUtilsDeleteAllChildrenC2EP11CMsvSessionl @ 44 NONAME
+	_ZN32CT_MsgUtilsConfigFileMachineName10ConstructLERK7TDesC16 @ 45 NONAME
+	_ZN32CT_MsgUtilsConfigFileMachineName11MachineNameEv @ 46 NONAME
+	_ZN32CT_MsgUtilsConfigFileMachineName16MachineNameEmailEv @ 47 NONAME
+	_ZN32CT_MsgUtilsConfigFileMachineName4NewLERK7TDesC16 @ 48 NONAME
+	_ZN32CT_MsgUtilsConfigFileMachineName5NewLCERK7TDesC16 @ 49 NONAME
+	_ZN32CT_MsgUtilsConfigFileMachineNameC1Ev @ 50 NONAME
+	_ZN32CT_MsgUtilsConfigFileMachineNameC2Ev @ 51 NONAME
+	_ZN34CT_MsgUtilsConfigFileParserUtility10ConstructLERK7TDesC16 @ 52 NONAME
+	_ZN34CT_MsgUtilsConfigFileParserUtility16GetFieldAsStringERK7TDesC16R7TPtrC16 @ 53 NONAME
+	_ZN34CT_MsgUtilsConfigFileParserUtility17GetFieldAsIntegerERK7TDesC16Ri @ 54 NONAME
+	_ZN34CT_MsgUtilsConfigFileParserUtility17GetFieldAsString8ERK7TDesC16R6TPtrC8 @ 55 NONAME
+	_ZN34CT_MsgUtilsConfigFileParserUtility4NewLERK7TDesC16 @ 56 NONAME
+	_ZN34CT_MsgUtilsConfigFileParserUtilityC1Ev @ 57 NONAME
+	_ZN34CT_MsgUtilsConfigFileParserUtilityC2Ev @ 58 NONAME
+	_ZN42CT_MsgUtilsReadEmailSettingsFromConfigFile15CompareIapPrefsER17CImIAPPreferencesS1_ @ 59 NONAME
+	_ZN42CT_MsgUtilsReadEmailSettingsFromConfigFile17ReadPopIAPAndAddLEP34CT_MsgUtilsConfigFileParserUtilityRK7TDesC16R17CImIAPPreferences @ 60 NONAME
+	_ZN42CT_MsgUtilsReadEmailSettingsFromConfigFile18ReadImapIAPAndAddLEP34CT_MsgUtilsConfigFileParserUtilityRK7TDesC16R17CImIAPPreferences @ 61 NONAME
+	_ZN42CT_MsgUtilsReadEmailSettingsFromConfigFile18ReadSmtpIAPAndAddLEP34CT_MsgUtilsConfigFileParserUtilityRK7TDesC16R17CImIAPPreferences @ 62 NONAME
+	_ZN42CT_MsgUtilsReadEmailSettingsFromConfigFile22ReadPopIAPAndAddFieldLEP34CT_MsgUtilsConfigFileParserUtilityRK7TDesC16R17CImIAPPreferences @ 63 NONAME
+	_ZN42CT_MsgUtilsReadEmailSettingsFromConfigFile23ReadImapIAPAndAddFieldLEP34CT_MsgUtilsConfigFileParserUtilityRK7TDesC16R17CImIAPPreferences @ 64 NONAME
+	_ZN42CT_MsgUtilsReadEmailSettingsFromConfigFile23ReadSmtpIAPAndAddFieldLEP34CT_MsgUtilsConfigFileParserUtilityRK7TDesC16R17CImIAPPreferences @ 65 NONAME
+	_ZN42CT_MsgUtilsReadEmailSettingsFromConfigFile37ReadPopSettingsFromConfigurationFileLER7TDesC16R15CImPop3SettingsR17CImIAPPreferencesRKS0_ @ 66 NONAME
+	_ZN42CT_MsgUtilsReadEmailSettingsFromConfigFile38ReadImapSettingsFromConfigurationFileLER7TDesC16R16CImImap4SettingsR17CImIAPPreferencesRKS0_ @ 67 NONAME
+	_ZN42CT_MsgUtilsReadEmailSettingsFromConfigFile38ReadSmtpSettingsFromConfigurationFileLER7TDesC16R15CImSmtpSettingsR17CImIAPPreferencesRKS0_ @ 68 NONAME
+	_ZN42CT_MsgUtilsReadEmailSettingsFromConfigFile9GetStringER7TDesC16RiiR7TPtrC16 @ 69 NONAME
+	_ZTI16CT_MsgTimerUtils @ 70 NONAME ; #<TI>#
+	_ZTI28CT_MsgUtilsDeleteAllChildren @ 71 NONAME ; #<TI>#
+	_ZTI32CT_MsgUtilsConfigFileMachineName @ 72 NONAME ; #<TI>#
+	_ZTI34CT_MsgUtilsConfigFileParserUtility @ 73 NONAME ; #<TI>#
+	_ZTV16CT_MsgTimerUtils @ 74 NONAME ; #<VT>#
+	_ZTV28CT_MsgUtilsDeleteAllChildren @ 75 NONAME ; #<VT>#
+	_ZTV32CT_MsgUtilsConfigFileMachineName @ 76 NONAME ; #<VT>#
+	_ZTV34CT_MsgUtilsConfigFileParserUtility @ 77 NONAME ; #<VT>#
+	_ZN24CT_MsgUtilsEnumConverter21ConvertDesToEventCodeER7TDesC16 @ 78 NONAME
+	_ZN24CT_MsgUtilsEnumConverter22ConvertDesToTSmtpCmdsLER7TDesC16 @ 79 NONAME
+	_ZN11CT_MsgUtils23SearchMessageBySubjectLEP11CMsvSessionl7TPtrC16i @ 80 NONAME
+	_ZN24CT_MsgUtilsEnumConverter23ConvertDesToBearerTypesERK7TDesC16 @ 81 NONAME
+	_ZN28CT_MsgUtilsCentralRepository15GetSmtpAccountLER6TDes16R12TSmtpAccount @ 82 NONAME
+	_ZN28CT_MsgUtilsCentralRepository17GetSmtpServiceIdLER6TDes16 @ 83 NONAME
+	_ZN28CT_MsgUtilsDeleteAllChildren6StartLEiR14TRequestStatus @ 84 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/testutils/eabi/messagingtestutility2u.def	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,14 @@
+EXPORTS
+	_ZN28RMessagingTestUtilityServer210DeleteFileERK7TDesC16 @ 1 NONAME
+	_ZN28RMessagingTestUtilityServer210FileExistsERK7TDesC16 @ 2 NONAME
+	_ZN28RMessagingTestUtilityServer211KillProcessE10TProcessId @ 3 NONAME
+	_ZN28RMessagingTestUtilityServer215EventHandlerAddERK7TDesC16S2_ @ 4 NONAME
+	_ZN28RMessagingTestUtilityServer216EventHandlerInitEv @ 5 NONAME
+	_ZN28RMessagingTestUtilityServer217EventHandlerCheckEv @ 6 NONAME
+	_ZN28RMessagingTestUtilityServer218DeleteMessageStoreEl @ 7 NONAME
+	_ZN28RMessagingTestUtilityServer25MkDirERK7TDesC16 @ 8 NONAME
+	_ZN28RMessagingTestUtilityServer25RmDirERK7TDesC16 @ 9 NONAME
+	_ZN28RMessagingTestUtilityServer27ConnectEv @ 10 NONAME
+	_ZN28RMessagingTestUtilityServer27GetDirLERK7TDesC16jjRP4CDir @ 11 NONAME
+	_ZN28RMessagingTestUtilityServer28CopyFileERK7TDesC16S2_ @ 12 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/testutils/group/T_Utils.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,54 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file T_Utils.mmp
+// 
+//
+
+
+TARGET			t_msgutilityserver.dll
+TARGETPATH		/system/libs
+TARGETTYPE		DLL
+
+CAPABILITY ALL -TCB
+
+UID			0 0x10274071
+VENDORID 		0x70000001
+
+
+SYSTEMINCLUDE 	/epoc32/include
+
+
+USERINCLUDE	../inc
+SOURCEPATH	../src
+SOURCE		T_TimerUtils.cpp
+SOURCE		T_Utils.cpp
+SOURCE		T_UtilsCentralRepository.cpp
+SOURCE		T_UtilsConfigFileMachineName.cpp
+SOURCE		T_UtilsConfigFileParserUtility.cpp
+SOURCE		T_UtilsDeleteAllChildren.cpp
+SOURCE		T_UtilsEnumConverter.cpp
+SOURCE		T_UtilsReadEmailSettingsFromConfigFile.cpp
+
+
+LIBRARY 		testexecuteutils.lib
+LIBRARY			testexecutelogclient.lib
+LIBRARY			imut.lib 
+LIBRARY			bafl.lib
+LIBRARY			etext.lib
+LIBRARY			estor.lib 
+LIBRARY			msgs.lib
+LIBRARY			euser.lib
+LIBRARY			imcm.lib
+LIBRARY			efsrv.lib
+LIBRARY			charconv.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/testutils/group/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,31 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// bld.inf file for the Integ Test Pop server
+// 
+//
+ 
+PRJ_TESTMMPFILES
+T_Utils.mmp
+
+
+PRJ_TESTEXPORTS
+../inc/T_Utils.h					/epoc32/include/t_utils.h	
+../inc/T_UtilsEnumConverter.h				/epoc32/include/t_utilsenumconverter.h
+../inc/T_UtilsConfigFileParserUtility.h			/epoc32/include/t_utilsconfigfileparserutility.h	
+../inc/T_UtilsCentralRepository.h			/epoc32/include/t_utilscentralrepository.h	
+../inc/T_UtilsReadEmailSettingsFromConfigFile.h		/epoc32/include/t_utilsreademailsettingsfromconfigfile.h
+../inc/T_UtilsConfigFileMachineName.h			/epoc32/include/t_utilsconfigfilemachinename.h
+../inc/T_TimerUtils.h					/epoc32/include/t_timerutils.h
+../inc/T_UtilsDeleteAllChildren.h			/epoc32/include/t_utilsdeleteallchildren.h
+../inc/t_testinstrumentation.h				/epoc32/include/t_testinstrumentation.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/testutils/inc/T_TimerUtils.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,55 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* This is the header file which contains the utility functions for the CTimer derived objects
+* 
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+
+#ifndef __T_TIMER_UTILS_H__
+#define __T_TIMER_UTILS_H__
+
+
+// epoc includes
+#include <e32base.h>
+
+/**
+This class provides the implementation of the Timer utilities
+*/
+class CT_MsgTimerUtils : public CTimer
+	{
+public:
+	IMPORT_C static CT_MsgTimerUtils* NewL();
+	~CT_MsgTimerUtils();
+	IMPORT_C void After(TInt aSec,TRequestStatus& aStatus);
+
+protected:
+	void RunL();
+
+private:
+	CT_MsgTimerUtils();
+
+private:
+	TRequestStatus* iRequestStatus;
+	};
+#endif //__T_TIMER_UTILS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/testutils/inc/T_Utils.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,109 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* This is the header file which contains the common utility functions
+* 
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+
+#ifndef __T_UTILS_H__
+#define __T_UTILS_H__
+
+
+// Epoc includes
+#include <msvapi.h>
+
+// Forward Declaration
+class RResourceFile;
+
+/**
+Implements a class to contain the utility functions required across servers
+*/
+class CT_MsgUtils
+	{	
+public:
+	IMPORT_C CT_MsgUtils();
+	~CT_MsgUtils();
+
+	// Returns the EntryID of the entry based on the entry name
+	IMPORT_C static TMsvId FindEntryByNameL(CMsvSession* aSession, TMsvId aParentId, TDesC& aEntryName, TBool aCaseSensitive = EFalse);
+	 
+	// Returns the EntryID of the entry based on the entry name and entry parent name
+	IMPORT_C static TMsvId FindEntryByNameL(CMsvSession* aSession, TMsvId aParentId, TDesC& aEntryName, TDesC& aParentEntryName, TBool aCaseSensitive = EFalse);
+	
+	// Returns the EntryId of the entry based on the entry name under the given parent entry
+	IMPORT_C static TMsvId FindEntryByNameL(CMsvEntry* aEntry,TDesC& aEntryName, TBool aCaseSensitive = EFalse);
+	
+	// Returns the EntryID of the entry based on the entry name and entry parent name under the given parent entry
+	IMPORT_C static TMsvId FindEntryByNameL(CMsvEntry* aEntry,TDesC& aEntryName, TDesC& aParentEntryName, TBool aCaseSensitive = EFalse);
+
+	// Creates a selection of the children
+	IMPORT_C static CMsvEntrySelection* CreateChildrenSelectionL(CMsvSession* aSession, TMsvId aEntryId);
+
+	// Creates a selection of the children with a specified type
+	IMPORT_C static CMsvEntrySelection* CreateChildrenSelectionWithTypeL(CMsvSession* aSession, TMsvId aEntryId, TUid aType);
+
+	// Returns a selection of the child entries under the specified remote folder
+	IMPORT_C static CMsvEntrySelection*  CreateChildrenSelectionRemoteFolderL(CMsvSession* aSession,TPtrC aAccountName,
+															TPtrC aFolderName);
+
+	// Returns a selection of the child entries under the specified remote folder with a specified type
+	IMPORT_C static CMsvEntrySelection*  CreateChildrenSelectionRemoteFolderWithTypeL(CMsvSession* aSession,TPtrC aAccountName,
+															TPtrC aFolderName, TUid aType);
+									
+	// Searches for a given entry under the specified remote folder Id for IMAP
+	IMPORT_C static TMsvId GetRemoteFolderIdByNameL(CMsvSession* aSession,TPtrC aAccountName,TPtrC aFolderName, TBool aCaseSensitive = EFalse);
+	
+	// Searches for a given entry under the specified remote folder Id for IMAP - overloaded version with parent folder name
+	IMPORT_C static TMsvId GetRemoteFolderIdByNameL(CMsvSession* aSession,TPtrC aAccountName,TPtrC aFolderName, TPtrC aParentFolderName, TBool aCaseSensitive = EFalse);
+
+	// Searches for a message in a given folder based ont he message subject
+	IMPORT_C static TMsvId SearchMessageBySubjectL(CMsvSession* aSession, TMsvId afolderId, TPtrC aSubject);
+	
+	// Searches for a message in a given folder based ont he message subject ..overloaded
+	IMPORT_C static TMsvId SearchMessageBySubjectL(CMsvSession* aSession,TMsvId afolderId,TPtrC aSubject, TBool aVisibleFlag);
+	
+	// Compares two input files
+	IMPORT_C static TInt CompareFilesL(TPtrC aFileOne, TPtrC aFileTwo, TBool aIsUnicode,CArrayFixFlat<TUint16>* aIgnoreCharList,
+																			TBool& aDiffFlag);
+
+	// Reads data chunk from the file stream.Returns ETrue if the EOF found.
+	IMPORT_C static TBool ReadDataL(RFileReadStream& aFileReadStream,TPtr& aPtrLineBuffer, TBool aIsUnicode, 
+																	CArrayFixFlat<TUint16>* aIgnoreCharList);
+
+	IMPORT_C static void OpenResourceFileL(RResourceFile& rFile, RFs& anFs, const TDesC& aFileName );
+ 		
+ 	//Closes the Open Resource File
+ 	IMPORT_C static void CloseResourceFile( TAny* aFile );
+ 	
+ private:
+ 	// Recursively searches the EntryID of the entry based on the entry name
+ 	TMsvId static RecFindEntryByNameL(CMsvEntry& aEntry, TDesC& aEntryName, TBool aCaseSensitive);
+ 	
+ 	// Recursively searches the EntryID of the entry based on the entry name and parent entry name
+ 	TMsvId static RecFindEntryByNameL(CMsvEntry& aEntry, TDesC& aEntryName, TDesC& aParentEntryName, TBool aCaseSensitive);
+ 	
+ 	// Checks if the given parent name matches the name of the given parent entry
+ 	TBool static CheckParent(CMsvEntry& aParentEntry, TDesC& aParentEntryName);
+	};
+#endif //__T_UTILS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/testutils/inc/T_UtilsCentralRepository.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,56 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is the header file for CT_MsgUtilsCentralRepository class and
+// contains the common utility functions that use the Central Repository
+// 
+//
+
+#ifndef __T_UTILS_CENTRAL_REPOSITORY_H__
+#define __T_UTILS_CENTRAL_REPOSITORY_H__
+
+
+// epoc includes
+#include <cemailaccounts.h>
+
+/**
+Implements the utility functions related to the Central Repository
+*/
+class CT_MsgUtilsCentralRepository
+	{	
+public:
+	IMPORT_C CT_MsgUtilsCentralRepository();
+	~CT_MsgUtilsCentralRepository();
+
+	// Gets the Imap service Id based on the account name
+	IMPORT_C static TMsvId GetImapServiceIdL(TDes& aAccountName);
+
+	// Gets the Pop service Id based on the account name
+	IMPORT_C static TMsvId GetPopServiceIdL(TDes& aAccountName);
+	
+	// Gets the Smtp service Id based on the account name
+	IMPORT_C static TMsvId GetSmtpServiceIdL(TDes& aAccountName);
+
+	// Gets the default Smtp service Id
+	IMPORT_C static TMsvId GetDefaultSmtpServiceIdL();
+	
+	// Checks if the specified Imap account is present in the Central Repository
+	IMPORT_C static TBool GetImapAccountL( TDes& aAccountName, TImapAccount& aImapAccount );
+
+	// Checks if the specified Pop account is present in the Central Repository
+	IMPORT_C static TBool GetPopAccountL( TDes& aAccountName, TPopAccount& aPopAccount );
+	
+	// Checks if the specified Smtp account is present in the Central Repository
+	IMPORT_C static TBool GetSmtpAccountL(TDes& aAccountName, TSmtpAccount& aSmtpAccount);
+	};
+#endif //__T_UTILS_CENTRAL_REPOSITORY_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/testutils/inc/T_UtilsConfigFileMachineName.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,59 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* This is the header file for CT_MsgUtilsConfigFileMachineName 
+* 
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+
+#ifndef __T_UTILS_CONFIG_FILE_MACHINE_NAME_H__
+#define __T_UTILS_CONFIG_FILE_MACHINE_NAME_H__
+
+
+// epoc includes
+#include <e32base.h>
+
+
+/**
+CT_MsgUtilsConfigFileMachineName is an utility class, can be used 
+to create automatic email acounts using the machine name.
+*/
+class CT_MsgUtilsConfigFileMachineName : public CBase
+	{
+public:
+	IMPORT_C static CT_MsgUtilsConfigFileMachineName* NewL(const TDesC& aPtrEmailAdd);
+	IMPORT_C static CT_MsgUtilsConfigFileMachineName* NewLC(const TDesC& aPtrEmailAdd);
+   ~CT_MsgUtilsConfigFileMachineName();
+
+	IMPORT_C const TDesC8& MachineName();
+	IMPORT_C const TDesC& MachineNameEmail();
+
+private:
+	IMPORT_C CT_MsgUtilsConfigFileMachineName();
+	IMPORT_C void ConstructL(const TDesC& aPtrEmailAdd); 
+
+private:
+	HBufC8* iMachineName;
+	HBufC* iMachineNameEmail;
+	};
+#endif //__T_UTILS_CONFIG_FILE_MACHINE_NAME_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/testutils/inc/T_UtilsConfigFileParserUtility.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,60 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* This is the header file for CT_MsgUtilsConfigFileParserUtility class
+* 
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+
+
+#ifndef __T_UTILS_CONFIG_FILE_PARSER_UTILITY_H__
+#define __T_UTILS_CONFIG_FILE_PARSER_UTILITY_H__
+
+
+// epoc includes
+#include <e32base.h>
+
+
+/**
+This utility class used to parse a .txt(Email settings) file.
+*/
+class CT_MsgUtilsConfigFileParserUtility : public CBase
+	{
+public:
+	 IMPORT_C static CT_MsgUtilsConfigFileParserUtility* NewL(const TDesC& aFileName);
+	~CT_MsgUtilsConfigFileParserUtility();
+	
+	IMPORT_C TInt GetFieldAsInteger(const TDesC& aFieldName, TInt& aValue);
+	IMPORT_C TInt GetFieldAsString(const TDesC& aFieldName, TPtrC& aString);
+	IMPORT_C TInt GetFieldAsString8(const TDesC& aFieldName, TPtrC8& aString);
+
+private:
+	IMPORT_C CT_MsgUtilsConfigFileParserUtility();
+	IMPORT_C void ConstructL(const TDesC& aFileName); 
+
+private:
+	RPointerArray<HBufC> iName;
+	RPointerArray<HBufC> iContent;
+	RPointerArray<HBufC8> iContent8;
+	};
+#endif //__T_UTILS_CONFIG_FILE_PARSER_UTILITY_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/testutils/inc/T_UtilsDeleteAllChildren.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,88 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* This is the header file for CT_MsgUtilsDeleteAllChildren
+* 
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+
+#ifndef __T_UTILS_DELETE_ALL_CHILDREN_H__
+#define __T_UTILS_DELETE_ALL_CHILDREN_H__
+
+
+// epoc includes
+#include <msvids.h>
+
+// Forward Declaration
+class CMsvSession;
+class CMsvOperation;
+
+
+/**
+Implements a utilty that performs deletion of all the children entries
+*/
+class CT_MsgUtilsDeleteAllChildren : public CActive
+	{
+public:
+	IMPORT_C CT_MsgUtilsDeleteAllChildren(CMsvSession* aSession,TMsvId aParentId = KMsvRootIndexEntryId);
+   ~CT_MsgUtilsDeleteAllChildren();
+
+	IMPORT_C void StartL(TRequestStatus& aStatus);
+	IMPORT_C void StartL(TBool aBlockDelete, TRequestStatus& aStatus);
+	
+	// Returns the number of the children entries that are not deleted
+	TInt Undeleted() {return (iUndeletedChildren);}
+	
+	// Gets information about a completed operation.
+	IMPORT_C TInt FinalProgressStatus(CMsvOperation& aOperation,const TRequestStatus& aStatus);
+
+protected:
+	void DoCancel();
+	void RunL();
+
+private:
+	CMsvSession* iSession;
+	TMsvId iParentId;
+	CMsvEntry* iEntry;
+	CMsvEntrySelection*	iSelection;
+	TRequestStatus* iRequestStatus;
+	TInt iTotalChildren;
+	TInt iCurrentChild;
+	TInt iUndeletedChildren;
+	CMsvOperation* iOperation;
+
+private:
+	enum State
+		{
+		EStateThisLevel,
+		EStateNextLevel,
+		EBlockDelete
+		};
+	TInt iState;
+
+private:
+	CT_MsgUtilsDeleteAllChildren* iNextLevel;
+	};
+
+
+#endif //__T_UTILS_DELETE_ALL_CHILDREN_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/testutils/inc/T_UtilsEnumConverter.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,115 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* This is the header file which contains the utility to map the string to the 
+* corresponding enumerator value
+* 
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+
+#ifndef __T_UTILS_ENUM_CONVERTER_H__
+#define __T_UTILS_ENUM_CONVERTER_H__
+
+
+// User Include
+#include <t_testinstrumentation.h>
+
+// epoc inlcudes
+#include <cdbcols.h>
+#include <imapset.h>
+#include <smtpset.h>
+#include <pop3set.h>
+#include <imapcmds.h>
+#include <smtpcmds.h>
+
+// STR_SWITCH... STR_CASE... STR_SWITCH_END macro can be used as 
+// switch case that would take string.
+#define STR_SWITCH(str)  {\
+        TBuf<100> __ps(str);\
+        while(1) {
+
+#define STR_SWITCH_END()  break; } }
+
+#define STR_CASE(str) if(__ps == str)
+
+#define DEFAULT_CASE()
+
+
+/**
+CT_MsgUtilsEnumConverter is utility class used to map the string to the 
+corresponding enumerator value.
+*/
+class CT_MsgUtilsEnumConverter
+	{
+public:
+	IMPORT_C CT_MsgUtilsEnumConverter();
+	~CT_MsgUtilsEnumConverter();
+	
+	//Utility functions
+
+	// Maps the local folder names to the corresponding folder Ids
+	IMPORT_C static TMsvId FindFolderIdByName( TDesC& aFolderName );
+
+	// Maps the  pop3 command names with the corresponding values
+	IMPORT_C static TPop3Cmds ConvertDesToTPop3Cmds( const TDesC& aPopCmdName );
+
+	// Maps the  Imap4 command names with the corresponding values
+	IMPORT_C static TImap4Cmds ConvertDesToTImap4Cmds(TDesC& aImapCmdName);
+	
+	// Maps the  SMTP command names with the corresponding values
+	IMPORT_C static TSmtpCmds ConvertDesToTSmtpCmdsL(TDesC& aSmtpCmdName);
+
+	// Maps the TCommDbDialogPref enumerations		
+	IMPORT_C static TCommDbDialogPref ConvertDesToTCommDbDialogPref( TDesC& aDialogPrefStr );
+	
+	// Maps the TImap4GetMailOptions enumerations	
+	IMPORT_C static TImap4GetMailOptions ConvertDesToTImap4GetMailOptions( TDesC& aMailOption );
+
+	// Maps the TFolderSyncType Enumerations	
+	IMPORT_C static TFolderSyncType ConvertDesToTFolderSyncType( TDesC& aFolderSyncType );
+	
+	// Maps the TFolderSubscribeType Enumerations	
+	IMPORT_C static TFolderSubscribeType ConvertDesToTFolderSubscribeType( TDesC& aFolderSubscriberType );
+
+	// Maps the TImImap4PartialMailOptions Enumerations
+	IMPORT_C static TImImap4PartialMailOptions ConvertDesToTImImap4PartialMailOptions( TDesC& aPartialMailOption );
+
+	// Maps the TMsgOutboxBodyEncoding enumerations							
+	IMPORT_C static TMsgOutboxBodyEncoding ConvertDesToTMsgOutboxBodyEncoding( TDesC& aOutboxBodyEncoding );  
+
+	// Maps the TImSMTPSendMessageOption Enumerations
+	IMPORT_C static TImSMTPSendMessageOption ConvertDesToTImSMTPSendMessageOption( TDesC& aSendMsgOption );
+
+	// Maps the TImSMTPSendCopyToSelf Enumerations
+	IMPORT_C static TImSMTPSendCopyToSelf ConvertDesToTImSMTPSendCopyToSelf( TDesC& aSmtpCopyToSelf );
+	
+	// Maps the TPop3GetMailOptions Enumerations
+	IMPORT_C static TPop3GetMailOptions ConvertDesToTPop3GetMailOptions( TDesC& aPop3MailOption );
+
+	// Maps the Eventcode strings to their numeric value
+	IMPORT_C static TInstrumentationPoint ConvertDesToEventCode(TDesC& aEventCodeString);
+
+	// Maps bearer types strings to their numeric values
+	IMPORT_C static TUint32 ConvertDesToBearerTypes(const TDesC& aBearerTypesString);
+	};
+#endif //__T_UTILS_ENUM_CONVERTER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/testutils/inc/T_UtilsReadEmailSettingsFromConfigFile.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,87 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* This is the header file for CT_MsgUtilsReadEmailSettingsFromConfigFile
+* 
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+ 
+#ifndef __T_READ_EMAIL_SETTINGS_FROM_CONFIG_FILE_H__
+#define __T_READ_EMAIL_SETTINGS_FROM_CONFIG_FILE_H__
+
+_LIT(KNone, "NONE");
+
+// Forward declarations
+class CImIAPPreferences;
+class CImImap4Settings;
+class CImPop3Settings;
+class CImSmtpSettings;
+class CT_MsgUtilsConfigFileParserUtility;
+class TImapAccount;
+
+
+/**
+CT_MsgUtilsReadEmailSettingsFromConfigFile is the utility class used to read the
+fields from the configuration/setting file and and update the set the data members of 
+CImImap4Settings, CImPop3Settings, CImSmtpSettings and CImIAPPreferences objects.
+*/
+class CT_MsgUtilsReadEmailSettingsFromConfigFile
+	{
+public:	
+	CT_MsgUtilsReadEmailSettingsFromConfigFile() {};
+	
+	~CT_MsgUtilsReadEmailSettingsFromConfigFile() {};
+	
+	IMPORT_C static TBool CompareIapPrefs(CImIAPPreferences& prefs1, CImIAPPreferences& prefs2);
+	
+	IMPORT_C static void ReadImapSettingsFromConfigurationFileL(TDesC& aSettingsFile,
+							CImImap4Settings& aImapSet, CImIAPPreferences& aImapIapPref, const TDesC& aPtrEmailAdd = KNone());
+										
+	IMPORT_C static void ReadPopSettingsFromConfigurationFileL(TDesC& aSettingsFile,
+							CImPop3Settings& aPopSet, CImIAPPreferences& aPopIapPref, const TDesC& aPtrEmailAdd = KNone());
+										
+	IMPORT_C static void ReadSmtpSettingsFromConfigurationFileL(TDesC& aSettingsFile,
+							CImSmtpSettings& aSmtpSet, CImIAPPreferences& aSmtpIapPref,const TDesC& aPtrEmailAdd = KNone());
+	
+private:
+	IMPORT_C static void ReadImapIAPAndAddL(CT_MsgUtilsConfigFileParserUtility* aScriptFileParser,
+			const TDesC& aParamListName, CImIAPPreferences& aIapPref);
+			
+	IMPORT_C static void ReadImapIAPAndAddFieldL(CT_MsgUtilsConfigFileParserUtility* aScriptFileParser, 
+			const TDesC& aFieldName, CImIAPPreferences& aIapPref);
+	
+	IMPORT_C static void ReadPopIAPAndAddL(CT_MsgUtilsConfigFileParserUtility* aScriptFileParser,
+			const TDesC& aParamListName, CImIAPPreferences& aIapPref);
+			
+	IMPORT_C static void ReadPopIAPAndAddFieldL(CT_MsgUtilsConfigFileParserUtility* aScriptFileParser, 
+			const TDesC& aFieldName, CImIAPPreferences& aIapPref);
+			
+	IMPORT_C static void ReadSmtpIAPAndAddL(CT_MsgUtilsConfigFileParserUtility* aScriptFileParser, 
+			const TDesC& aParamListName, CImIAPPreferences& aSmtpIapPref);
+			
+	IMPORT_C static void ReadSmtpIAPAndAddFieldL(CT_MsgUtilsConfigFileParserUtility* aScriptFileParser, 
+			const TDesC& aFieldName, CImIAPPreferences& aIapPref);
+			
+	IMPORT_C static TBool GetString(TDesC& aStringPtr, TInt& aStart, TInt aEnd, TPtrC& aBaseString);
+	};
+#endif //__T_READ_EMAIL_SETTINGS_FROM_CONFIG_FILE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/testutils/inc/t_testinstrumentation.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* @file t_testInstrumentation.h
+* This contains the list of event codes that are used to identify a particular event.
+* These event codes are used by the EvenlogServer to generate a specif type of log for a specific event.
+* 
+*
+*/
+
+
+
+
+
+
+#ifndef __TEST_INSTRUMENTATION_H__
+#define __TEST_INSTRUMENTATION_H__
+
+//	Epoc Include
+#include <e32base.h>
+
+/** 
+List of event codes.
+*/
+	enum TInstrumentationPoint
+		{
+		// Event codes 0 to 20 has been reserved for error/specific condition
+		EBadEventCode			= 0,
+		EImapRamUsageStart		= 21,
+		EImapRamUsageStop,
+		EPopRamUsageStart		= 23,
+		EPopRamUsageStop,
+		ESmtpRamUsageStart		= 25,
+		ESmtpRamUsageStop,
+		ESmtpRamUsageCreateMessageStart = 27,
+		ESmtpRamUsageCreateMessageStop,
+		ESmtpRamUsageSendMessageStart	= 29,
+		ESmtpRamUsageSendMessageStop,
+		ESmtpCreateMessageSpeedStart	= 31,
+		ESmtpCreateMessageSpeedStop,
+		ESmtpSendMessageSpeedStart		= 33,
+		ESmtpSendMessageSpeedStop,
+		EImapDownloadMessageSpeedStart	= 35,
+		EImapDownloadMessageSpeedStop
+		};
+
+
+#endif /* __TEST_INSTRUMENTATION_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/testutils/src/T_TimerUtils.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,99 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is the Cpp file which contains the utility functions for the CTimer derived objects
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+
+// user include
+#include <t_timerutils.h>
+
+
+const TInt KValue={1000000};
+/**
+NewL()
+It performs the two phase construction and returns an object
+of type CT_MsgTimerUtils
+
+@leave KErrNoMemory
+@return
+Returns pointer to an object of CT_MsgTimerUtils
+*/
+EXPORT_C CT_MsgTimerUtils* CT_MsgTimerUtils::NewL()
+	{
+	CT_MsgTimerUtils* self = new (ELeave) CT_MsgTimerUtils();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CActiveScheduler::Add(self);
+	CleanupStack::Pop();
+	return self;
+	}
+	
+
+
+/**
+CT_MsgTimerUtils()
+Constructor
+*/
+CT_MsgTimerUtils::CT_MsgTimerUtils() : CTimer(EPriorityHigh)
+	{
+	}
+
+
+
+/**
+~CT_MsgTimerUtils()
+Destructor
+*/
+CT_MsgTimerUtils::~CT_MsgTimerUtils()
+	{
+	iRequestStatus = 0; //To Remove Lint Warning
+	}
+
+
+/**
+After()
+Calls the After function CTimer for the given number of secs
+
+@param aSec
+No. of seconds
+
+@param aStatus
+Completion status of a request
+
+@see CTimer::After()
+*/
+EXPORT_C void CT_MsgTimerUtils::After(TInt aSec,TRequestStatus& aStatus)
+	{
+	iRequestStatus = &aStatus;
+	aStatus = KRequestPending;
+	TTimeIntervalMicroSeconds32 interval = aSec*KValue;
+	CTimer::After(interval);
+	}
+
+
+/**
+RunL()
+Gives the status of the operation 
+*/
+void CT_MsgTimerUtils::RunL()
+	{
+	User::RequestComplete(iRequestStatus,iStatus.Int());
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/testutils/src/T_Utils.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,904 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is the Cpp file which contains the utility functions common across the servers
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+
+// User includes
+#include <t_utils.h>
+#include <t_utilscentralrepository.h>
+
+// Epoc includes
+#include <msvids.h>
+#include <bautils.h>
+#include <msvutils.h>
+#include <barsc.h>
+
+
+// Literals Used
+const TInt KDefBufferSize = 1024;
+
+
+/**
+CT_MsgUtils()
+Constructor
+*/
+EXPORT_C CT_MsgUtils::CT_MsgUtils()
+	{
+	}
+
+
+/**
+~CT_MsgUtils()
+Constructor
+*/
+CT_MsgUtils::~CT_MsgUtils()
+	{
+	}
+
+/**
+OpenResourceFileL()
+Opens a resource File
+
+@param rFile
+Resource File Handle
+
+@param anFs
+File Session associated
+
+@param aFileName
+The Name of resource File to be opened
+*/
+EXPORT_C void CT_MsgUtils::OpenResourceFileL(RResourceFile& rFile, RFs& anFs, const TDesC& aFileName )
+ 	{
+ 	// open resource file
+ 	TFileName fileName(aFileName);
+ 	MsvUtils::AddPathAndExtensionToResFileL(fileName);
+ 	BaflUtils::NearestLanguageFile( anFs, fileName );
+ 	if (BaflUtils::FileExists(anFs,fileName))
+  		{
+ 		rFile.OpenL( anFs, fileName );
+  		return;
+  		}
+  	User::Leave(KErrNotFound);
+ 	}
+
+/**
+CloseResourceFile()
+Closes a recource File
+
+@param aFile
+The Name of resource File to be closed
+*/
+ EXPORT_C void CT_MsgUtils::CloseResourceFile( TAny* aFile )
+ 	{
+ 	((RResourceFile*)aFile)->Close();
+ 	}
+
+
+/**
+FindEntryByNameL()
+Search the entries under a given folder ID by name of the entry
+i.e, iDescription or iDetails value of an entry
+
+@param aSession
+Session object
+
+@param aParentId
+Parent Id under which the entry needs to be found
+
+@param aEntryName
+The entry name that needs to be found
+
+@leave KErrNotFound
+Leaves if no entry's iDescription or iDetails matches with aEntryName
+
+@return
+Id of the entry that match 
+*/
+EXPORT_C TMsvId CT_MsgUtils::FindEntryByNameL(CMsvSession* aSession, TMsvId aParentId, TDesC& aEntryName, TBool aCaseSensitive)
+	{
+	
+	TMsvId msgEntryId = KMsvNullIndexEntryId;
+
+	// Set the context to the Parent
+	CMsvEntry* entry = CMsvEntry::NewL(*aSession, aParentId,TMsvSelectionOrdering
+									(KMsvNoGrouping,EMsvSortByNone, ETrue));
+	CleanupStack::PushL(entry);
+	
+	entry->SetEntryL(aParentId);
+ 	
+ 	msgEntryId = FindEntryByNameL(entry, aEntryName, aCaseSensitive);
+ 	
+ 	CleanupStack::PopAndDestroy(entry);
+ 	
+ 	return msgEntryId;
+	}
+
+
+/**
+FindEntryByNameL()
+Search the entries under a given folder ID by name of the entry
+i.e, iDescription or iDetails value of an entry
+
+@param aSession
+Session object
+
+@param aParentId
+Parent Id under which the entry needs to be found
+
+@param aEntryName
+The entry name that needs to be found
+
+@param aParentEntryName
+The Parent entry name that needs to be matched with the entry found
+
+@leave KErrNotFound
+Leaves if no entry's iDescription or iDetails matches with aEntryName
+
+@return
+Id of the entry that match 
+*/
+EXPORT_C TMsvId CT_MsgUtils::FindEntryByNameL(CMsvSession* aSession, TMsvId aParentId, TDesC& aEntryName, TDesC& aParentEntryName, TBool aCaseSensitive)
+	{
+	
+	TMsvId msgEntryId = KMsvNullIndexEntryId;
+	
+	// Set the context to the Parent
+	CMsvEntry* entry = CMsvEntry::NewL(*aSession, aParentId,TMsvSelectionOrdering
+									(KMsvNoGrouping,EMsvSortByNone, ETrue));
+	CleanupStack::PushL(entry);
+	
+	entry->SetEntryL(aParentId);
+
+ 	msgEntryId = FindEntryByNameL(entry, aEntryName, aParentEntryName, aCaseSensitive);
+ 	
+ 	CleanupStack::PopAndDestroy(entry);
+ 	
+ 	return msgEntryId;
+	}
+
+
+/**
+FindEntryByNameL()
+Search the entries under a given entry(an object of CMsvEntry) by name of the entry
+i.e, iDescription or iDetails value of an entry
+
+@param aEntry	
+Parent entry under which the given entry needs to be searched
+
+@param aEntryName
+The entry name that needs to be found
+
+@leave KErrNotFound
+Leaves if no entry's iDescription or iDetails matches with aEntryName
+
+@return
+Id of the entry that match 
+*/
+EXPORT_C TMsvId  CT_MsgUtils::FindEntryByNameL(CMsvEntry* aEntry,TDesC& aEntryName, TBool aCaseSensitive)
+	{
+	TMsvId msgEntryId = KMsvNullIndexEntryId;
+	
+	msgEntryId = RecFindEntryByNameL(*aEntry, aEntryName, aCaseSensitive);
+	
+	if(msgEntryId == KMsvNullIndexEntryId)
+		{
+		User::Leave(KErrNotFound);
+		}
+
+	return msgEntryId;
+	}
+
+
+/**
+FindEntryByNameL()
+Search the entries under a given entry(an object of CMsvEntry) by name of the entry
+i.e, iDescription or iDetails value of an entry
+
+@param aEntry	
+Parent entry under which the given entry needs to be searched
+
+@param aEntryName
+The entry name that needs to be found
+
+@param aParentEntryName
+The Parent entry name that needs to be matched with the entry found
+
+@leave KErrNotFound
+Leaves if no entry's iDescription or iDetails matches with aEntryName
+
+@return
+Id of the entry that match 
+*/
+EXPORT_C TMsvId  CT_MsgUtils::FindEntryByNameL(CMsvEntry* aEntry,TDesC& aEntryName, TDesC& aParentEntryName, TBool aCaseSensitive)
+	{
+	TMsvId msgEntryId = KMsvNullIndexEntryId;
+	
+	msgEntryId = RecFindEntryByNameL(*aEntry, aEntryName, aParentEntryName, aCaseSensitive);
+	
+	if(msgEntryId == KMsvNullIndexEntryId)
+		{
+		User::Leave(KErrNotFound);
+		}
+
+	return msgEntryId;
+	}
+
+
+/**
+RecFindEntryByNameL()
+Recursively search the entries (including all sub entries) under a given entry (an object of CMsvEntry) 
+by name of the entry i.e, iDescription or iDetails value of an entry
+
+@param aEntry	
+Parent entry under which the given entry needs to be searched
+
+@param aEntryName
+The entry name that needs to be found
+
+@leave KErrNotFound
+Leaves if no entry's iDescription or iDetails matches with aEntryName
+
+@return
+Id of the entry that match 
+*/
+TMsvId  CT_MsgUtils::RecFindEntryByNameL(CMsvEntry& aEntry, TDesC& aEntryName, TBool aCaseSensitive)
+ 	{
+ 
+ 	TMsvId msgEntryId = KMsvNullIndexEntryId;
+ 	
+ 	CMsvEntrySelection* selection = aEntry.ChildrenL();
+ 	CleanupStack::PushL(selection);
+ 	// Search for the entry in the children selection, based on the entry name given
+ 	TBool	found = EFalse;
+ 	TInt count = selection->Count();
+ 	for (TInt index = 0; (index<count) && (!found); index++)
+ 		{
+  		// Set the context to the child entry
+  		aEntry.SetEntryL((*selection)[index]);
+
+		if (aCaseSensitive)
+			{
+			if (( aEntryName.Compare( aEntry.Entry().iDescription ) == 0 ) ||
+			    ( aEntryName.Compare( aEntry.Entry().iDetails ) == 0 ))
+				{
+				found = ETrue;
+				}
+			}
+		else if (( aEntryName.CompareF( aEntry.Entry().iDescription ) == 0 ) ||
+		         ( aEntryName.CompareF( aEntry.Entry().iDetails ) == 0 ))
+			{
+			found = ETrue;
+			}
+
+		if (found)
+			{
+			msgEntryId = (*selection)[index];
+			}
+		else
+			{
+			CMsvEntry* nextEntry = CMsvEntry::NewL(aEntry.Session(), (*selection)[index],TMsvSelectionOrdering(KMsvNoGrouping, EMsvSortByNone, ETrue));
+			CleanupStack::PushL(nextEntry);
+
+			msgEntryId = RecFindEntryByNameL(*nextEntry, aEntryName, aCaseSensitive);
+			if(msgEntryId != KMsvNullIndexEntryId)
+				{
+				found = ETrue;
+				}
+   		CleanupStack::PopAndDestroy(nextEntry);  
+   		}
+ 		}
+		
+ 	CleanupStack::PopAndDestroy(selection);
+ 	return msgEntryId;
+ 	}
+
+
+/**
+RecFindEntryByNameL()
+Recursively search the entries (including all sub entries) under a given entry (an object of CMsvEntry) 
+by name of the entry i.e, iDescription or iDetails value of an entry
+
+@param aEntry	
+Parent entry under which the given entry needs to be searched
+
+@param aEntryName
+The entry name that needs to be found
+
+@param aParentEntryName
+The Parent entry name that needs to be matched with the entry found
+
+@leave KErrNotFound
+Leaves if no entry's iDescription or iDetails matches with aEntryName
+
+@return
+Id of the entry that match 
+*/
+TMsvId  CT_MsgUtils::RecFindEntryByNameL(CMsvEntry& aEntry, TDesC& aEntryName, TDesC& aParentEntryName, TBool aCaseSensitive)
+ 	{
+ 	TMsvId msgEntryId = KMsvNullIndexEntryId;
+ 	
+ 	CMsvEntrySelection* selection = aEntry.ChildrenL();
+ 	CleanupStack::PushL(selection);
+ 	// Search for the entry in the children selection, based on the entry name given
+ 	TBool	found = EFalse;
+ 	TInt count = selection->Count();
+	TBool matched = EFalse;
+ 	
+ 	for (TInt index = 0; (index<count) && (!found); index++)
+ 		{
+  		// Set the context to the child entry
+  		aEntry.SetEntryL((*selection)[index]);
+
+		matched = EFalse;
+
+		if (aCaseSensitive)
+			{
+			if (( aEntryName.Compare( aEntry.Entry().iDescription ) == 0 ) ||
+			    ( aEntryName.Compare( aEntry.Entry().iDetails ) == 0 ))
+				{
+				matched = ETrue;
+				}
+			}
+		else if (( aEntryName.CompareF( aEntry.Entry().iDescription ) == 0 ) ||
+		         ( aEntryName.CompareF( aEntry.Entry().iDetails ) == 0 ))
+			{
+			matched = ETrue;
+			}
+
+		if (matched)
+			{
+			//Check Parent
+			CMsvEntry* parentEntry = CMsvEntry::NewL(aEntry.Session(), aEntry.Entry().Parent(),TMsvSelectionOrdering(KMsvNoGrouping, EMsvSortByNone, ETrue));
+			CleanupStack::PushL(parentEntry);
+
+			if(CheckParent(*parentEntry,aParentEntryName))
+				{
+				found = ETrue;
+				msgEntryId = (*selection)[index];
+				}
+			CleanupStack::PopAndDestroy(parentEntry);
+			}
+
+		if (!found)
+			{
+			CMsvEntry* nextEntry = CMsvEntry::NewL(aEntry.Session(), (*selection)[index],TMsvSelectionOrdering(KMsvNoGrouping, EMsvSortByNone, ETrue));
+			CleanupStack::PushL(nextEntry);
+
+			msgEntryId = RecFindEntryByNameL(*nextEntry, aEntryName, aParentEntryName, aCaseSensitive);
+			if(msgEntryId != KMsvNullIndexEntryId)
+				{
+				found = ETrue;
+				}
+			CleanupStack::PopAndDestroy(nextEntry);
+			}
+  		}
+
+ 	CleanupStack::PopAndDestroy(selection);
+ 	return msgEntryId;
+ 	}
+ 
+ 
+/**
+CheckParent()
+Checks if the given parent name matches the name of the given parent entry
+
+@param aParentEntry	
+Parent entry whose name is to be checked
+
+@param aParentEntryName
+The Parent entry name that we are checking against
+
+@return
+ETrue if they match and EFalse if they do not
+*/
+TBool CT_MsgUtils::CheckParent(CMsvEntry& aParentEntry, TDesC& aParentEntryName)
+	{
+
+ 	TBool ret = EFalse;
+ 	
+ 	if (( aParentEntryName.CompareF( aParentEntry.Entry().iDescription ) == 0 ) ||
+     	( aParentEntryName.CompareF( aParentEntry.Entry().iDetails ) == 0 ))
+ 		{
+ 		ret = ETrue;
+ 		}
+ 	
+ 	return ret;
+	}
+
+
+/**
+CreateChildrenSelectionL()
+This function creates a selection of the children entries under a given parent Id
+
+@param aSession	
+A CMsvSession object
+		
+@param aEntryId	
+Id of the entry
+
+@return
+Returns a selection of all child entries under the given entry
+*/
+EXPORT_C CMsvEntrySelection* CT_MsgUtils::CreateChildrenSelectionL(CMsvSession* aSession, 
+																   TMsvId       aEntryId)
+	{
+	CMsvEntry* entry = CMsvEntry::NewL(*aSession, aEntryId,TMsvSelectionOrdering
+									( KMsvNoGrouping,EMsvSortByNone, ETrue));
+	CleanupStack::PushL(entry);
+	entry->SetEntryL(aEntryId);
+
+	TMsvSelectionOrdering order;
+	order.SetShowInvisibleEntries(ETrue);
+	entry->SetSortTypeL(order);
+
+	CMsvEntrySelection* selection = entry->ChildrenL();
+	CleanupStack::PopAndDestroy(entry);
+	
+	return selection;
+	}
+
+/**
+CreateChildrenSelectionWithTypeL()
+This function creates a selection of the children entries under a given parent Id
+which are of a specified type.
+
+@param aSession	
+A CMsvSession object
+		
+@param aEntryId	
+Id of the entry
+
+@param aType
+Type of entry to look for
+
+@return
+Returns a selection of all child entries under the given entry of the specified type
+*/
+EXPORT_C CMsvEntrySelection* CT_MsgUtils::CreateChildrenSelectionWithTypeL(CMsvSession* aSession, TMsvId aEntryId, TUid aType)
+	{
+	CMsvEntry* entry = CMsvEntry::NewL(*aSession, aEntryId, TMsvSelectionOrdering(KMsvNoGrouping, EMsvSortByNone, ETrue));
+	CleanupStack::PushL(entry);
+	entry->SetEntryL(aEntryId);
+
+	TMsvSelectionOrdering order;
+	order.SetShowInvisibleEntries(ETrue);
+	entry->SetSortTypeL(order);
+
+	CMsvEntrySelection* selection = entry->ChildrenWithTypeL(aType);
+	CleanupStack::PopAndDestroy(entry);
+
+	return selection;
+	}
+
+
+/**
+CreateChildrenSelectionRemoteFolderL()
+This function creates a selection of the child entries under the 
+remote folder Id if the service name is specified
+
+@param aSession		
+A CMsvSession object
+
+@param aAccountName	
+The account name or service name
+
+@param aFolderName
+The name of the remote folder whose entries need to be fetched
+
+@return
+The selection of all entries under the given entry
+*/
+EXPORT_C CMsvEntrySelection*  CT_MsgUtils::CreateChildrenSelectionRemoteFolderL(CMsvSession*
+										aSession,TPtrC aAccountName,TPtrC aFolderName)
+	{
+	TMsvId remoteFolderId = GetRemoteFolderIdByNameL(aSession, aAccountName, aFolderName);
+	return 	CreateChildrenSelectionL(aSession,remoteFolderId);
+	}
+
+/**
+CreateChildrenSelectionRemoteFolderWithTypeL()
+This function creates a selection of the child entries under the 
+remote folder Id with a specified type if the service name is specified
+
+@param aSession		
+A CMsvSession object
+
+@param aAccountName	
+The account name or service name
+
+@param aFolderName
+The name of the remote folder whose entries need to be fetched
+
+@param aType
+Type of entry to look for
+
+@return
+The selection of all entries under the given entry with the specified type
+*/
+EXPORT_C CMsvEntrySelection*  CT_MsgUtils::CreateChildrenSelectionRemoteFolderWithTypeL(CMsvSession*
+										aSession,TPtrC aAccountName,TPtrC aFolderName, TUid aType)
+	{
+	TMsvId remoteFolderId = GetRemoteFolderIdByNameL(aSession, aAccountName, aFolderName);
+	return CreateChildrenSelectionWithTypeL(aSession, remoteFolderId, aType);
+	}
+
+
+/**
+GetRemoteFolderIdByNameL()
+Searches for a given entry under the remote folder Id specified and gets it Id
+
+@param aSession		
+A CMsvSession object
+
+@param aAccountName
+The account name
+
+@param aFolderName
+The name of the remote folder whose Id is to be found
+
+@return
+The Id of the specified folder
+*/
+EXPORT_C TMsvId CT_MsgUtils::GetRemoteFolderIdByNameL(CMsvSession* aSession,TPtrC aAccountName,TPtrC aFolderName, TBool aCaseSensitive)
+	{
+	TMsvId imapServiceId = CT_MsgUtilsCentralRepository::GetImapServiceIdL((TDes&)aAccountName);
+	return CT_MsgUtils::FindEntryByNameL(aSession, imapServiceId, (TDesC&)aFolderName, aCaseSensitive);
+	}
+
+
+/**
+GetRemoteFolderIdByNameL()
+Searches for a given entry under the remote folder Id specified and gets it Id
+
+@param aSession		
+A CMsvSession object
+
+@param aAccountName
+The account name
+
+@param aFolderName
+The name of the remote folder whose Id is to be found
+
+@param aFolderName
+The name of the remote parent folder of the entry to be found
+
+@return
+The Id of the specified folder
+*/
+EXPORT_C TMsvId CT_MsgUtils::GetRemoteFolderIdByNameL(CMsvSession* aSession,TPtrC aAccountName,TPtrC aFolderName, TPtrC aParentFolderName, TBool aCaseSensitive)
+	{
+	TMsvId imapServiceId = CT_MsgUtilsCentralRepository::GetImapServiceIdL((TDes&)aAccountName);
+	return CT_MsgUtils::FindEntryByNameL(aSession, imapServiceId, (TDesC&)aFolderName, (TDesC&)aParentFolderName, aCaseSensitive);
+	}
+
+
+/**
+SearchMessageBySubjectL()
+This function searches for a message based on the 
+subject under the specified local folder
+
+@param aSession
+A CMsvSession object
+
+@param afolderId
+The folder Id under which the search needs to be done
+
+@param aSubject
+The subject name of the message
+
+@leave KErrNotFound
+Leaves if the message is not found
+
+@return
+If the message is found it returns the message Id
+*/
+EXPORT_C TMsvId CT_MsgUtils::SearchMessageBySubjectL(CMsvSession* aSession,TMsvId afolderId,TPtrC aSubject)
+	{
+	TMsvId	messageId = KMsvNullIndexEntryId;
+
+	CMsvEntry*	entry = aSession->GetEntryL(afolderId);
+	CleanupStack::PushL(entry);
+
+	// Set the entry to the source folder id
+	entry->SetEntryL(afolderId);
+
+	//Get CMsvEntrySelection object
+	CMsvEntrySelection*	selection = entry->ChildrenL();
+	CleanupStack::PushL(selection);
+	
+	TInt count = selection->Count();
+
+	if ( count > 0)
+		{
+		CMsvEntry*	childEntry = aSession->GetEntryL(selection->At(0));
+		CleanupStack::PushL(childEntry);
+
+		for(TInt entryIndex = 0 ; entryIndex< count; entryIndex++)
+			{
+			childEntry->SetEntryL(selection->At(entryIndex));
+					
+			if (childEntry->Entry().iDescription.Compare(aSubject) == 0)
+				{	
+				messageId = selection->At(entryIndex);
+				break;
+				}
+			}
+		CleanupStack::PopAndDestroy(childEntry);
+		}
+	if(messageId == KMsvNullIndexEntryId)
+		{
+		User::Leave(KErrNotFound);
+		}
+	CleanupStack::PopAndDestroy(2,entry);	//selection,entry
+	return messageId; 
+	}
+	
+/**
+SearchMessageBySubjectL()
+This function searches for a message based on the subject 
+under the specified local folder. This fucntion provides the
+flexibility of making the invisible children entries visible.
+
+@param aSession
+A CMsvSession object
+
+@param afolderId
+The folder Id under which the search needs to be done
+
+@param aSubject
+The subject name of the message
+
+@leave KErrNotFound
+Leaves if the message is not found
+
+@return
+If the message is found it returns the message Id
+*/
+EXPORT_C TMsvId CT_MsgUtils::SearchMessageBySubjectL(CMsvSession* aSession,TMsvId afolderId,TPtrC aSubject, TBool aVisibleFlag)
+	{
+	TMsvId	messageId = KMsvNullIndexEntryId;
+
+	CMsvEntry*	entry = aSession->GetEntryL(afolderId);
+	CleanupStack::PushL(entry);
+
+	// Set the entry to the source folder id
+	entry->SetEntryL(afolderId);
+	if(aVisibleFlag)
+		{
+		// Make the message entries visible
+		TMsvSelectionOrdering order;
+		order.SetShowInvisibleEntries(ETrue);
+		entry->SetSortTypeL(order);	
+		}
+
+	//Get CMsvEntrySelection object
+	CMsvEntrySelection*	selection = entry->ChildrenL();
+	CleanupStack::PushL(selection);
+	
+	TInt count = selection->Count();
+
+	if ( count > 0)
+		{
+		CMsvEntry*	childEntry = aSession->GetEntryL(selection->At(0));
+		CleanupStack::PushL(childEntry);
+
+		for(TInt entryIndex = 0 ; entryIndex< count; entryIndex++)
+			{
+			childEntry->SetEntryL(selection->At(entryIndex));
+					
+			if (childEntry->Entry().iDescription.Compare(aSubject) == 0)
+				{	
+				messageId = selection->At(entryIndex);
+				break;
+				}
+			}
+		CleanupStack::PopAndDestroy(childEntry);
+		}
+	if(messageId == KMsvNullIndexEntryId)
+		{
+		User::Leave(KErrNotFound);
+		}
+	CleanupStack::PopAndDestroy(2,entry);	//selection,entry
+	return messageId; 
+	}
+	
+/**
+CompareFilesL()
+Compares two input files (ASCII & Unicode).
+
+@param aFileOne
+The first file to be compared
+
+@param aFileTwo
+The second file to be compared
+
+@param aIsUnicode
+To check if its unicode
+
+@param aIgnoreCharList
+An array of type CArrayFixFlat
+
+@param aDiffFlag
+Flag to indicate the difference
+
+@return
+Returns ETrue if the files are different.
+*/
+EXPORT_C TInt CT_MsgUtils::CompareFilesL(TPtrC aFileOne, TPtrC aFileTwo, TBool aIsUnicode,
+									  CArrayFixFlat<TUint16>* aIgnoreCharList, TBool& aDiffFlag)
+	{
+	// Return Code
+	TInt retCode = KErrNone;
+
+	// Streams for the file1 and file2 to compare
+	RFileReadStream fileReadStream1;
+	RFileReadStream fileReadStream2;
+
+	// Files difference flag
+	aDiffFlag = EFalse;
+
+	RFs iFs;
+	User::LeaveIfError(iFs.Connect());
+
+	// Open file one to compare in the read only mode
+	retCode = fileReadStream1.Open( iFs, aFileOne, EFileShareReadersOnly);
+
+	// If the file open of the first file is successful then open the second file, also in read only mode
+	if(retCode == KErrNone)
+		{
+		retCode = fileReadStream2.Open( iFs, aFileTwo, EFileShareReadersOnly);
+
+		// The file open of the second file is successful
+		if(retCode == KErrNone)
+			{
+			// To hold the line content of file one 
+			HBufC* lineOneBuffer = HBufC::NewLC(KDefBufferSize);
+			TPtr ptrLineOne = lineOneBuffer->Des();
+			
+			// To hold the line content of file two
+			HBufC* lineTwoBuffer = HBufC::NewLC(KDefBufferSize);
+			TPtr ptrLineTwo = lineTwoBuffer->Des();
+
+			// End of File indicators
+			TBool	eofOne = EFalse;
+			TBool	eofTwo = EFalse; 
+			
+			// Read the file one and file two data
+			do   
+				{
+				// Read file one data
+				eofOne = ReadDataL(fileReadStream1, ptrLineOne, aIsUnicode, aIgnoreCharList);
+
+				// Read file two data
+				eofTwo = ReadDataL(fileReadStream2, ptrLineTwo, aIsUnicode, aIgnoreCharList);
+
+				// Check EOF state of the files.
+				// Either both the files will be in EOF state or 
+				// none of the files will be in EOF state			  
+				if((!eofOne && !eofTwo)||(eofOne && eofTwo))
+	            	{			
+					// Compare the read lines from file one and the file two
+					if(ptrLineOne.Compare(ptrLineTwo) != 0)
+						{
+						// Different data content so set the differnce flag
+						aDiffFlag = ETrue;
+						}
+					}
+				else
+					{
+					// Different EOF 
+					aDiffFlag = ETrue;
+					}
+				} while(!eofOne && !eofTwo && !aDiffFlag);				
+			
+			// Delete line buffers
+			CleanupStack::PopAndDestroy(2, lineOneBuffer);				
+			}
+		}
+	
+	// Close the open streams
+	fileReadStream1.Close();
+	fileReadStream2.Close();	
+
+	iFs.Close();
+	// Return the difference flag
+	return retCode;
+	}
+
+
+/**
+ReadDataL()
+Reads data chunk from the file stream. Returns ETrue if the EOF found
+
+@param aFileReadStream
+File Stream
+
+@param aPtrLineBuffer		
+Buffer to hold a line
+
+@param aIsUnicode
+To check if its unicode
+
+@param aIgnoreCharList
+List of the characters to be ignored
+
+@leave KErrNotFound
+Leaves if aIgnoreCharList is empty
+
+@return 
+Return end of file flag	
+*/
+EXPORT_C TBool CT_MsgUtils::ReadDataL(RFileReadStream& aFileReadStream,
+	  TPtr& aPtrLineBuffer, TBool aIsUnicode, CArrayFixFlat<TUint16>* aIgnoreCharList)
+ 	{
+	TUint16			element = 0;
+	TKeyArrayFix	key(0, ECmpTUint16);
+	TInt			charPosition = 0;
+	TBool			eof = EFalse;
+	TInt			errorCode = KErrNone;
+	TUint8			aCharASCII = 0;
+	
+	aPtrLineBuffer.FillZ();
+	aPtrLineBuffer.SetLength(0);	
+	
+	// Validate the input ignore char list
+	if (!aIgnoreCharList)
+		{
+		// Invalid parameter passed to ReadDataL: No ignore char list passed
+		User::Leave(KErrNotFound);
+		}
+
+	// Read data from file and store it in lineBuffer 
+	do   
+		{
+		if(aIsUnicode)
+			{
+			TRAP(errorCode, (element = aFileReadStream.ReadUint16L()));
+			}
+		else
+			{
+			TRAP(errorCode, (aCharASCII = aFileReadStream.ReadUint8L()));
+			element = (TUint16) aCharASCII;
+			}
+			
+		if (errorCode != KErrEof)
+			{		
+			// Check the availability of ignore char in the array							
+			if ( aIgnoreCharList->Find(element, key, charPosition) != KErrNone )
+				{
+				// Append the char to the buffer if the read char is not ignore char
+				aPtrLineBuffer.Append(element);
+				}
+			}								
+			else
+				{
+				eof = ETrue;
+				break;
+				}
+				
+			// Stop at the end of line or no more data 
+			} while(aPtrLineBuffer.Length() < KDefBufferSize);
+	
+	// Return end of file flag		
+	return eof;	
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/testutils/src/T_UtilsCentralRepository.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,292 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+// User includes
+#include <t_utilscentralrepository.h>
+
+// epoc includes
+#include <msvids.h>
+
+/**
+CT_MsgUtilsCentralRepository()
+Constructor
+*/
+EXPORT_C CT_MsgUtilsCentralRepository::CT_MsgUtilsCentralRepository()
+	{
+	}
+
+
+/**
+~CT_MsgUtilsCentralRepository()
+Destructor
+*/
+CT_MsgUtilsCentralRepository::~CT_MsgUtilsCentralRepository()
+	{
+	}
+
+
+/**
+GetDefaultSmtpServiceIdL()
+This function return the default Smtp Service Id. This method requires that a
+related IMAP4 or POP3 account has been previously created in the central
+repository - this is because SMTP accounts do not exist independently but only
+as part of an IMAP4 or POP3 account
+
+@return
+Entry ID of the default SMTP service entry
+*/
+EXPORT_C TMsvId CT_MsgUtilsCentralRepository::GetDefaultSmtpServiceIdL()
+	{
+	CEmailAccounts* emailAccounts = CEmailAccounts::NewLC();
+	
+	TSmtpAccount smtpAccount;
+	smtpAccount.iSmtpService = KMsvNullIndexEntryId;
+	User::LeaveIfError(emailAccounts->DefaultSmtpAccountL(smtpAccount));
+
+	CleanupStack::PopAndDestroy(emailAccounts);
+	
+	return smtpAccount.iSmtpService;
+	}
+
+
+/**
+GetImapServiceIdL()
+This function returns the Service Id of the IMAP account with the specified name
+
+@param aName
+The Imap account name
+
+@return
+It returns entry Id of an IMAP service
+*/
+EXPORT_C TMsvId CT_MsgUtilsCentralRepository::GetImapServiceIdL(TDes& aName)
+	{
+	TImapAccount imapAccount;
+	TMsvId imapServiceId = KMsvNullIndexEntryId;
+
+	TBool returnValue = GetImapAccountL( aName, imapAccount );
+	
+	if ( returnValue )
+		{
+		imapServiceId = imapAccount.iImapService;
+		}
+	return imapServiceId;
+	}
+
+
+/**
+GetPopServiceIdL()
+This function returns the Service Id of the POP account with the specified name
+
+@param aName
+The Pop account name
+
+@return
+Returns entry Id of an POP service
+*/
+EXPORT_C TMsvId CT_MsgUtilsCentralRepository::GetPopServiceIdL(TDes& aName)
+	{
+	TPopAccount popAccount;
+	TMsvId popServiceId = KMsvNullIndexEntryId;
+
+	TBool returnValue = GetPopAccountL( aName, popAccount );
+	
+	if ( returnValue )
+		{
+		popServiceId = popAccount.iPopService;
+		}
+	return popServiceId;
+	}
+
+/**
+GetSmtpServiceIdL()
+This function returns the Service Id of the SMTP account with the specified name
+
+@param aName
+The Smtp account name
+
+@return
+Returns entry Id of an SMTP service
+*/
+EXPORT_C TMsvId CT_MsgUtilsCentralRepository::GetSmtpServiceIdL(TDes& aName)
+	{
+	TSmtpAccount smtpAccount;
+	TMsvId smtpServiceId = KMsvNullIndexEntryId;
+
+	TBool returnValue = GetSmtpAccountL(aName, smtpAccount);
+	
+	if (returnValue)
+		{
+		smtpServiceId = smtpAccount.iSmtpService;
+		}
+	return smtpServiceId;
+	}
+
+/**
+GetImapAccountL()
+Searches the IMAP account with the specified name and 
+returns the TImapAccount oject associted to it.
+
+@param aName
+The Imap account name
+
+@param aImapAccount
+An object of type TImapAccount
+
+@leave KErrNotFound
+Leaves if no account found with the supplied name.
+
+@return
+ETrue if the account is found, else EFalse
+*/
+EXPORT_C TBool CT_MsgUtilsCentralRepository::GetImapAccountL(TDes& aName, TImapAccount& aImapAccount )
+	{
+	TImapAccount imapAccount;
+	imapAccount.iImapService = KMsvNullIndexEntryId;
+
+	// Get the list of IMAP accounts
+	RArray<TImapAccount> accountIds;
+
+	CEmailAccounts *emailAccounts = CEmailAccounts::NewLC();	
+	emailAccounts->GetImapAccountsL(accountIds);
+	
+	// Search for the account with the given name in the list of IMAP accounts
+	TBool accountFound = EFalse;
+	for( TInt index = 0; index < accountIds.Count(); index++)
+		{
+		TImapAccount tempAccount = accountIds[index];
+		TPtrC accountPtr( tempAccount.iImapAccountName );
+
+		if( accountPtr.Compare(aName) == 0 )
+			{
+			aImapAccount = tempAccount;
+			accountFound = ETrue;
+			break;
+			}
+		}
+	if(!accountFound)
+		{
+		User::Leave(KErrNotFound);
+		}
+	CleanupStack::PopAndDestroy(emailAccounts);
+	accountIds.Reset();
+	
+	return accountFound;
+	}
+
+
+/**
+GetPopAccountL()
+Searches the POP account with the specified name and 
+returns the TPopAccount oject associted to it.
+
+@param aName
+The Imap account name
+
+@param aPopAccount
+An object of type TPopAccount
+
+@leave KErrNotFound
+Leaves if no account found with the supplied name.
+
+@return
+ETrue if the account is found, else EFalse
+*/
+EXPORT_C TBool CT_MsgUtilsCentralRepository::GetPopAccountL(TDes& aName, TPopAccount& aPopAccount )
+	{
+	TPopAccount popAccount;
+	popAccount.iPopService = KMsvNullIndexEntryId;
+
+	// Get the list of POP accounts
+	RArray<TPopAccount> accountIds;
+
+	CEmailAccounts *emailAccounts = CEmailAccounts::NewLC();	
+	emailAccounts->GetPopAccountsL(accountIds);
+	
+	// Search for the account with the given name in the list of POP accounts
+	TBool accountFound = EFalse;
+	for( TInt index = 0; index < accountIds.Count(); index++)
+		{
+		TPopAccount tempAccount = accountIds[index];
+		TPtrC accountPtr( tempAccount.iPopAccountName );
+
+		if( accountPtr.Compare(aName) == 0 )
+			{
+			aPopAccount = tempAccount;
+			accountFound = ETrue;
+			break;
+			}
+		}
+	if(!accountFound)
+		{
+		User::Leave(KErrNotFound);
+		}
+	CleanupStack::PopAndDestroy(emailAccounts);
+	accountIds.Reset();
+
+	return accountFound;
+	}
+
+/**
+GetSmtpAccountL()
+Searches the SMTP account with the specified name and 
+returns the TSmtpAccount oject associted to it.
+
+@param aName
+The Smtp account name
+
+@param aSmtpAccount
+An object of type TSmtpAccount
+
+@leave KErrNotFound
+Leaves if no account found with the supplied name.
+
+@return
+ETrue if the account is found, else EFalse
+*/
+EXPORT_C TBool CT_MsgUtilsCentralRepository::GetSmtpAccountL(TDes& aName, TSmtpAccount& aSmtpAccount)
+	{
+	TSmtpAccount smtpAccount;
+	smtpAccount.iSmtpService = KMsvNullIndexEntryId;
+
+	// Get the list of SMTP accounts
+	RArray<TSmtpAccount> accountIds;
+
+	CEmailAccounts *emailAccounts = CEmailAccounts::NewLC();	
+	emailAccounts->GetSmtpAccountsL(accountIds);
+	
+	// Search for the account with the given name in the list of SMTP accounts
+	TBool accountFound = EFalse;
+	for( TInt index = 0; index < accountIds.Count(); index++)
+		{
+		TSmtpAccount tempAccount = accountIds[index];
+		TPtrC accountPtr( tempAccount.iSmtpAccountName );
+
+		if( accountPtr.Compare(aName) == 0 )
+			{
+			aSmtpAccount = tempAccount;
+			accountFound = ETrue;
+			break;
+			}
+		}
+	if(!accountFound)
+		{
+		User::Leave(KErrNotFound);
+		}
+	CleanupStack::PopAndDestroy(emailAccounts);
+	accountIds.Reset();
+
+	return accountFound;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/testutils/src/T_UtilsConfigFileMachineName.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,157 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+*/
+
+// User include
+#include <t_utilsconfigfilemachinename.h>
+
+// Epoc include
+#include <f32file.h>
+
+
+//Literals used
+_LIT(KFileName,"c:\\smoketest\\MachineName.txt");
+_LIT(KAtEmailAddress,"@msexchange2k.closedtest.intra");
+
+
+/**
+NewL()
+Allocates and creates a new CT_MsgConnectPop3Server object
+
+@param aPtrEmailAdd
+@leave KErrNoMemory
+@return
+The newly created CT_MsgUtilsConfigFileMachineName object
+*/
+EXPORT_C CT_MsgUtilsConfigFileMachineName* CT_MsgUtilsConfigFileMachineName::NewL(const TDesC& aPtrEmailAdd)
+	{
+	CT_MsgUtilsConfigFileMachineName* self = new (ELeave) CT_MsgUtilsConfigFileMachineName();
+	CleanupStack::PushL(self);
+	self->ConstructL(aPtrEmailAdd);
+	CleanupStack::Pop(self);
+	return self;	
+	}
+
+
+/**
+NewLC()
+Allocates and creates a new CT_MsgUtilsConfigFileMachineName object, leaving the 
+object on the cleanup stack.
+
+@param aPtrEmailAdd
+@leave KErrNoMemory
+@return
+The newly created CT_MsgUtilsConfigFileMachineName object
+*/
+EXPORT_C CT_MsgUtilsConfigFileMachineName* CT_MsgUtilsConfigFileMachineName::NewLC(const TDesC& aPtrEmailAdd)
+	{
+	CT_MsgUtilsConfigFileMachineName* self = new (ELeave) CT_MsgUtilsConfigFileMachineName();
+	CleanupStack::PushL(self);
+	self->ConstructL(aPtrEmailAdd);
+	return self;	
+	}
+
+
+/**
+CT_MsgUtilsConfigFileMachineName()
+Constructor
+*/
+EXPORT_C CT_MsgUtilsConfigFileMachineName::CT_MsgUtilsConfigFileMachineName()
+	{	
+	}
+
+
+/**
+ConstructL()
+Reads the machine name from the Machine config file("c:\\smoketest\\MachineName.txt")
+and constructs the data members.
+
+@param aPtrEmailAdd
+*/	
+EXPORT_C void CT_MsgUtilsConfigFileMachineName::ConstructL(const TDesC& aPtrEmailAdd)
+	{
+	RFs fs;
+	User::LeaveIfError(fs.Connect());
+	CleanupClosePushL(fs);
+	RFile file;	
+	User::LeaveIfError(file.Open(fs, KFileName, EFileRead));
+	
+	CleanupClosePushL(file);
+	TInt  fileSize;
+	User::LeaveIfError(file.Size(fileSize));
+	iMachineName = HBufC8::NewL(fileSize);
+	TPtr8 bufferPtr = iMachineName->Des();
+	User::LeaveIfError(file.Read(bufferPtr));
+	
+	if (aPtrEmailAdd.Compare(_L("NONE"))==0)
+		iMachineNameEmail = HBufC::NewL(iMachineName->Length() + KAtEmailAddress.iTypeLength);
+	else
+		iMachineNameEmail = HBufC::NewL(iMachineName->Length() + aPtrEmailAdd.Length() + 1);
+	
+	iMachineNameEmail->Des().Copy(*iMachineName);
+	
+	if (aPtrEmailAdd.Compare(_L("NONE"))==0)
+		iMachineNameEmail->Des().Append(KAtEmailAddress);
+	else
+		{
+		iMachineNameEmail->Des().Append(_L("@"));
+		iMachineNameEmail->Des().Append(aPtrEmailAdd);
+		}
+
+	
+	CleanupStack::PopAndDestroy(2,&fs);
+	}
+
+
+/**
+MachineNameEmail()
+Returns an email address with the host machine name.
+
+@return
+Email address of the machine
+*/
+EXPORT_C const TDesC& CT_MsgUtilsConfigFileMachineName::MachineNameEmail()
+	{
+	return (*iMachineNameEmail);
+	}
+
+
+/**
+MachineName()
+Returns the host machine name
+
+@return
+Machine name
+*/
+EXPORT_C const TDesC8& CT_MsgUtilsConfigFileMachineName::MachineName()
+	{
+	return (*iMachineName);	
+	}
+	
+
+/**
+~CT_MsgUtilsConfigFileMachineName()
+Destructor
+*/
+CT_MsgUtilsConfigFileMachineName::~CT_MsgUtilsConfigFileMachineName()
+  {
+  delete iMachineName;	
+  delete iMachineNameEmail;
+  }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/testutils/src/T_UtilsConfigFileParserUtility.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,275 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is the CPP file which contains utility functions for parsing the config file
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+
+// User include
+#include <t_utilsconfigfileparserutility.h>
+
+// epoc inlcude
+#include <f32file.h>
+
+// contants and literals used
+const TInt KFileBufferSize = 1024;
+_LIT8(KComment,"*#*");
+
+
+/**
+NewL()
+Allocates and creates a new CT_MsgUtilsConfigFileParserUtility object
+
+@param aFileName
+Name of the file to be parsed
+
+@leave KErrNoMemory
+@return
+The newly created CT_MsgUtilsConfigFileParserUtility object
+*/
+EXPORT_C CT_MsgUtilsConfigFileParserUtility* CT_MsgUtilsConfigFileParserUtility::NewL(const TDesC& aFileName)
+	{
+	CT_MsgUtilsConfigFileParserUtility* self = new (ELeave) CT_MsgUtilsConfigFileParserUtility();
+	CleanupStack::PushL(self);
+	self->ConstructL(aFileName);
+	CleanupStack::Pop();
+	return self;
+	}
+	
+
+/**
+CT_MsgUtilsConfigFileParserUtility()
+Constructor
+*/
+EXPORT_C CT_MsgUtilsConfigFileParserUtility::CT_MsgUtilsConfigFileParserUtility()
+	{
+	}
+
+
+/**
+~CT_MsgUtilsConfigFileParserUtility()
+Destructor
+*/
+CT_MsgUtilsConfigFileParserUtility::~CT_MsgUtilsConfigFileParserUtility()
+	{
+	iName.ResetAndDestroy();
+	iContent.ResetAndDestroy();
+	iContent8.ResetAndDestroy();
+	}
+
+
+/**
+ConstructL()
+Parses a .txt file and creates Arrays of fields and there values
+
+@param aFileName
+Name of the file to be parsed.
+*/
+EXPORT_C void CT_MsgUtilsConfigFileParserUtility::ConstructL(const TDesC& aFileName)
+	{
+	RFs fileServerSession;
+
+	fileServerSession.Connect();
+
+	RFile file;
+	User::LeaveIfError(file.Open(fileServerSession, aFileName, EFileRead));
+
+	TInt eof = EFalse;
+	TInt fileOffset = 0;
+	TBuf8<KFileBufferSize> fileBuffer;
+
+	while (!eof)
+		{
+		fileBuffer.SetLength(0);
+		User::LeaveIfError(file.Read(fileOffset, fileBuffer, KFileBufferSize));
+		TInt read = fileBuffer.Length();
+
+		if (read < KFileBufferSize)
+			{
+			fileBuffer.Append('\n');
+			eof = ETrue;
+			}
+
+		TInt lineOverflow = fileBuffer.Locate('\n');
+		
+		if ((lineOverflow == KErrNotFound) && (read == KFileBufferSize))
+			{
+			User::Leave(KErrOverflow);
+			}
+
+		TInt eol = EFalse;
+		
+		while (!eol)
+			{
+			TInt lineFeedLocation = fileBuffer.Locate('\n');
+			
+			if (lineFeedLocation == KErrNotFound)
+				{
+				eol = ETrue;
+				}
+			
+			else
+				{
+				fileOffset += lineFeedLocation + 1;
+				TInt lineLength;
+				if ((lineFeedLocation != 0) && (fileBuffer[lineFeedLocation - 1] == '\r'))
+					{
+					lineLength = lineFeedLocation - 1;
+					}
+					
+				else
+					{
+					lineLength = lineFeedLocation;
+					}
+					
+				TPtrC8 line  = fileBuffer.Left(lineLength);
+				TInt commentLocation = line.Match(KComment);
+				
+				if (commentLocation != KErrNotFound)
+					{
+					TPtrC8 skipComment = line.Left(commentLocation);
+					line.Set(skipComment);
+					}
+					
+				TInt seperatorLocation = line.Locate('=');
+				
+				if (seperatorLocation != KErrNotFound)
+					{
+					if ((seperatorLocation == 0) || (seperatorLocation == line.Length() - 1))
+						{
+						seperatorLocation = KErrNotFound;
+						}
+					}
+					
+				if (seperatorLocation != KErrNotFound)
+					{
+					TPtrC8 namePtr = line.Left(seperatorLocation);
+					HBufC8* nameBuf8 = HBufC8::NewL(namePtr.Length());
+					CleanupStack::PushL(nameBuf8);
+					
+					TPtr8 name8 = nameBuf8->Des();
+					name8.Copy(namePtr);
+					name8.Trim();
+					HBufC* nameBuf16 = HBufC::NewL(namePtr.Length());
+					TPtr name16 = nameBuf16->Des();
+					name16.Copy(name8);
+					iName.Append(nameBuf16);
+					CleanupStack::PopAndDestroy(nameBuf8);
+
+					TPtrC8 contentPtr = line.Mid(seperatorLocation + 1);
+					HBufC8* contentBuf8 = HBufC8::NewL(contentPtr.Length());
+					CleanupStack::PushL(contentBuf8);
+					TPtr8 content8 = contentBuf8->Des();
+					content8.Copy(contentPtr);
+					content8.Trim();
+					
+					HBufC* contentBuf16 = HBufC::NewL(contentPtr.Length());
+					TPtr content16 = contentBuf16->Des();
+					content16.Copy(content8);
+					iContent.Append(contentBuf16);
+					iContent8.Append(contentBuf8);
+					CleanupStack::Pop(contentBuf8);
+					}
+				TPtrC8 theRest = fileBuffer.Mid(lineFeedLocation + 1);
+				fileBuffer.Copy(theRest);
+				}
+			}
+		}
+	
+	file.Close();
+	fileServerSession.Close();
+	}
+
+
+/**
+GetFieldAsInteger()
+Retrives the content of a field name and Interpret it as an integer.
+
+@param aFieldName
+@param aValue
+@return
+Returns an integer corresponding to the field
+*/
+EXPORT_C TInt CT_MsgUtilsConfigFileParserUtility::GetFieldAsInteger(const TDesC& aFieldName, TInt& aValue)
+	{
+	TInt count = iName.Count();
+
+	for (TInt i = 0; i<count; i++)
+		{
+		if (iName[i]->Compare(aFieldName) == 0)
+			{ 
+			TPtrC content = iContent[i]->Des();
+			TLex lex(content);
+			lex.Val(aValue);
+			return (KErrNone);
+			}
+		}
+	return (KErrNotFound);
+	}
+
+
+/**
+GetFieldAsString()
+Retrives the content of a field name and Interpret it as an string
+
+@param aFieldName
+@param aValue
+@return
+Returns an string corresponding to the field
+*/
+EXPORT_C TInt CT_MsgUtilsConfigFileParserUtility::GetFieldAsString(const TDesC& aFieldName, TPtrC& aString)
+	{
+	TInt count = iName.Count();
+
+	for (TInt i = 0; i<count; i++)
+		{
+		if (iName[i]->Compare(aFieldName) == 0)
+			{ 
+			aString.Set(*iContent[i]);
+			return (KErrNone);
+			}
+		}
+	return (KErrNotFound);
+	}
+
+
+/**
+GetFieldAsString8()
+Retrives the content of a field name and Interpret it as an 8-bit descriptor
+
+@param aFieldName
+@param aValue
+@return
+Returns an 8-bit descriptor corresponding to the field
+*/
+EXPORT_C TInt CT_MsgUtilsConfigFileParserUtility::GetFieldAsString8(const TDesC& aFieldName, TPtrC8& aString)
+	{
+	TInt count = iName.Count();
+	
+	for (TInt i = 0; i<count; i++)
+		{
+		if (iName[i]->Compare(aFieldName) == 0)
+			{ 
+			aString.Set(*iContent8[i]);
+			return (KErrNone);
+			}
+		}
+	return (KErrNotFound);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/testutils/src/T_UtilsDeleteAllChildren.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,267 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is the Cpp file which contains the utility functions to delete all children in the
+// message store
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+
+// User includes
+#include <t_utilsdeleteallchildren.h>
+	
+// Epoc includes
+#include <msvapi.h>
+#include <msvuids.h>
+
+/**
+CT_MsgUtilsDeleteAllChildren()
+Constructor
+
+@param aSession
+An object of CMsvSession
+
+@param aParentId
+Entry ID of whose children would be deleted
+*/
+EXPORT_C CT_MsgUtilsDeleteAllChildren::CT_MsgUtilsDeleteAllChildren(CMsvSession* aSession,TMsvId aParentId) 
+: CActive(EPriorityNormal), iSession(aSession), iParentId(aParentId) 
+	{
+	CActiveScheduler::Add(this);
+	}
+
+
+/**
+~CT_MsgUtilsDeleteAllChildren()
+Destructor
+*/
+CT_MsgUtilsDeleteAllChildren::~CT_MsgUtilsDeleteAllChildren()
+	{
+	delete iEntry;
+	delete iSelection;
+	}
+
+
+/**
+StartL()
+Deletes the children entries of the specified parent
+
+@param aStatus			
+*/
+EXPORT_C void CT_MsgUtilsDeleteAllChildren::StartL(TRequestStatus& aStatus)
+	{
+	StartL(EFalse, aStatus);
+	}
+
+/**
+StartL()
+Deletes the children entries of the specified parent
+
+@param aBlockDelete Delete all in one go
+@param aStatus			
+*/
+EXPORT_C void CT_MsgUtilsDeleteAllChildren::StartL(TBool aBlockDelete, TRequestStatus& aStatus)
+	{
+	iRequestStatus = &aStatus;
+	aStatus = KRequestPending;
+
+	// Creates a new CMsvEntry for the specified parent entry ID nad sets the context
+	// to that entry.
+	if(iEntry==NULL)
+	{
+	iEntry = CMsvEntry::NewL(*iSession,iParentId,TMsvSelectionOrdering(KMsvNoGrouping,EMsvSortByNone,ETrue));
+	}
+	iEntry->SetEntryL(iParentId);
+	
+	// Gets a selection containing the IDs of children
+	iSelection = iEntry->ChildrenL();
+	iTotalChildren = iSelection->Count();
+	
+	// If the entry has no children entries, then signals the thread that the asynchronous request 
+	// is complete.
+	if (iTotalChildren == 0)
+		{
+		User::RequestComplete(iRequestStatus,KErrNone);
+		}
+		
+	
+	// If the entry has children entries then,delete child entries of the context
+	// recursively through all the descendants
+	else
+		{
+		if (aBlockDelete)
+			{
+			iOperation = iEntry->DeleteL(*iSelection ,iStatus);
+			iState = EBlockDelete;
+			}
+		else
+			{
+			iOperation = iEntry->DeleteL((*iSelection)[iCurrentChild],iStatus);
+			iState = EStateThisLevel;
+			}
+		
+		SetActive();
+		}
+	}
+
+
+/**
+DoCancel()
+Implements cancellation of an outstanding request
+
+@see CActive::Cancel()
+*/
+void CT_MsgUtilsDeleteAllChildren::DoCancel()
+	{
+	switch (iState)
+		{
+		case EStateThisLevel:
+		case EBlockDelete:
+			iOperation->Cancel();
+			break;
+
+		case EStateNextLevel:
+			iNextLevel->Cancel();
+			break;
+		}
+	}
+
+
+/**
+RunL()
+Handles an active object's request completion event
+
+@see CActive::RunL()
+*/
+void CT_MsgUtilsDeleteAllChildren::RunL()
+	{
+	TInt err;
+
+	switch (iState)
+		{
+		case EStateThisLevel:
+			
+			err = CT_MsgUtilsDeleteAllChildren::FinalProgressStatus(*iOperation,iStatus);
+			delete iOperation;
+			iOperation = NULL;
+
+			switch (err)
+				{
+				case KErrAccessDenied:
+					iUndeletedChildren++;
+					if(iNextLevel==NULL)
+					{
+					iNextLevel = new (ELeave) CT_MsgUtilsDeleteAllChildren(iSession,(*iSelection)[iCurrentChild]);
+					}
+					iNextLevel->StartL(iStatus);
+					SetActive();
+					iState = EStateNextLevel;
+					break;
+				
+				case KErrNone:
+					if (++iCurrentChild == iTotalChildren)
+						{
+						User::RequestComplete(iRequestStatus,KErrNone);
+						}
+					else
+						{
+						iOperation = iEntry->DeleteL((*iSelection)[iCurrentChild],iStatus);
+						SetActive();
+						}
+					break;
+					
+				default:
+					User::RequestComplete(iRequestStatus,err);
+					break;			
+				}
+				break;
+
+		case EStateNextLevel:
+			err = iStatus.Int();
+			iUndeletedChildren += iNextLevel->Undeleted();
+			delete iNextLevel;
+			iNextLevel = NULL;
+
+			switch (err)
+				{
+				case KErrNone:
+					if (++iCurrentChild == iTotalChildren)
+						{
+						User::RequestComplete(iRequestStatus,KErrNone);
+						}
+					else
+						{
+						iOperation = iEntry->DeleteL((*iSelection)[iCurrentChild],iStatus);
+						SetActive();
+						iState = EStateThisLevel;
+						}
+					break;
+				default:
+					User::RequestComplete(iRequestStatus,err);
+					break;
+				}
+			break;
+
+		case EBlockDelete:
+			{
+			err = CT_MsgUtilsDeleteAllChildren::FinalProgressStatus(*iOperation,iStatus);
+			delete iOperation;
+			iOperation = NULL;
+
+			User::RequestComplete(iRequestStatus,err);
+			break;
+			}
+		}
+	}
+
+	
+/**
+FinalProgressStatus()
+This function gets the information about a completed operation for the local entries..
+
+@param aOperation	
+Used to get progress information about the operation
+
+@param aStatus	
+@return
+The error code
+*/
+EXPORT_C TInt CT_MsgUtilsDeleteAllChildren::FinalProgressStatus(CMsvOperation& aOperation,const TRequestStatus& aStatus)
+	{
+	TInt err = KErrNone;
+
+	if (aOperation.Mtm() == KUidMsvLocalServiceMtm)
+		{
+		TPckgBuf<TMsvLocalOperationProgress> progress;
+		progress.Copy(aOperation.FinalProgress());
+		err = progress().iError;
+		}
+	else
+		{
+		if (iState == EBlockDelete)
+			{
+			TRAP_IGNORE(err = McliUtils::GetProgressErrorL(aOperation));
+			}
+		else
+			{
+			err = aStatus.Int();
+			}
+		}
+	return (err);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/testutils/src/T_UtilsEnumConverter.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1462 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This file contains the utility functions to map a string to the corresponding enumerator values.
+// 
+//
+
+// User includes
+#include <t_utilsenumconverter.h>
+
+// epoc includes
+#include <msvids.h>
+#include <cdbcols.h>
+
+// Literals Used
+
+// Local Folder Ids
+_LIT(KStrGlobalInBoxIndexEntryId,"KMsvGlobalInBoxIndexEntryId");
+_LIT(KStrGlobalOutBoxIndexEntryId,"KMsvGlobalOutBoxIndexEntryId");
+_LIT(KStrSentEntryId,"KMsvSentEntryId");
+_LIT(KStrDraftEntryId,"KMsvDraftEntryId");
+_LIT(KStrDeletedEntryFolderEntryId,"KMsvDeletedEntryFolderEntryId");
+_LIT(KStrRootIndexEntryId,"KMsvRootIndexEntryId");
+_LIT(KStrTempIndexEntryId,"KMsvTempIndexEntryId");
+_LIT(KStrLocalServiceIndexEntryId,"KMsvLocalServiceIndexEntryId");
+_LIT(KStrUnknownServiceIndexEntryId,"KMsvUnknownServiceIndexEntryId");
+_LIT(KStrFirstFreeEntryId,"KFirstFreeEntryId");
+
+
+//Pop3 Specific Commands
+_LIT(KStrPOP3MTMIsConnected, "KPOP3MTMIsConnected");
+_LIT(KStrPOP3MTMConnect,"KPOP3MTMConnect");
+_LIT(KStrPOP3MTMDisconnect,"KPOP3MTMDisconnect");	
+_LIT(KStrPOP3MTMCopyNewMailWhenAlreadyConnected,"KPOP3MTMCopyNewMailWhenAlreadyConnected");
+_LIT(KStrPOP3MTMConnectAndCopyNewMailAndStayOnline,"KPOP3MTMConnectAndCopyNewMailAndStayOnline");
+_LIT(KStrPOP3MTMConnectAndCopyNewMailAndDisconnect,"KPOP3MTMConnectAndCopyNewMailAndDisconnect");
+_LIT(KStrPOP3MTMMoveNewMailWhenAlreadyConnected,"KPOP3MTMMoveNewMailWhenAlreadyConnected");
+_LIT(KStrPOP3MTMConnectAndMoveNewMailAndStayOnline,"KPOP3MTMConnectAndMoveNewMailAndStayOnline");
+_LIT(KStrPOP3MTMConnectAndMoveNewMailAndDisconnect,"KPOP3MTMConnectAndMoveNewMailAndDisconnect");
+_LIT(KStrPOP3MTMCopyMailSelectionWhenAlreadyConnected,"KPOP3MTMCopyMailSelectionWhenAlreadyConnected");
+_LIT(KStrPOP3MTMConnectAndCopyMailSelectionAndStayOnline,"KPOP3MTMConnectAndCopyMailSelectionAndStayOnline");
+_LIT(KStrPOP3MTMConnectAndCopyMailSelectionAndDisconnect,"KPOP3MTMConnectAndCopyMailSelectionAndDisconnect");
+_LIT(KStrPOP3MTMMoveMailSelectionWhenAlreadyConnected,"KPOP3MTMMoveMailSelectionWhenAlreadyConnected");
+_LIT(KStrPOP3MTMConnectAndMoveMailSelectionAndStayOnline,"KPOP3MTMConnectAndMoveMailSelectionAndStayOnline");
+_LIT(KStrPOP3MTMConnectAndMoveMailSelectionAndDisconnect,"KPOP3MTMConnectAndMoveMailSelectionAndDisconnect");
+_LIT(KStrPOP3MTMCopyAllMailWhenAlreadyConnected,"KPOP3MTMCopyAllMailWhenAlreadyConnected");
+_LIT(KStrPOP3MTMConnectAndCopyAllMailAndStayOnline,"KPOP3MTMConnectAndCopyAllMailAndStayOnline");
+_LIT(KStrPOP3MTMConnectAndCopyAllMailAndDisconnect,"KPOP3MTMConnectAndCopyAllMailAndDisconnect");
+_LIT(KStrPOP3MTMMoveAllMailWhenAlreadyConnected,"KPOP3MTMMoveAllMailWhenAlreadyConnected");
+_LIT(KStrPOP3MTMConnectAndMoveAllMailAndStayOnline,"KPOP3MTMConnectAndMoveAllMailAndStayOnline");
+_LIT(KStrPOP3MTMConnectAndMoveAllMailAndDisconnect,"KPOP3MTMConnectAndMoveAllMailAndDisconnect");
+_LIT(KStrPOP3MTMCancelOfflineOperations,"KPOP3MTMCancelOfflineOperations");
+_LIT(KStrPOP3MTMCancelSendOnNextConnection,"KPOP3MTMCancelSendOnNextConnection");
+_LIT(KStrPOP3MTMCreateNewEmailMessage,"KPOP3MTMCreateNewEmailMessage");
+_LIT(KStrPOP3MTMCreateReplyEmailMessage,"KPOP3MTMCreateReplyEmailMessage");
+_LIT(KStrPOP3MTMCreateForwardEmailMessage,"KPOP3MTMCreateForwardEmailMessage");
+_LIT(KStrPOP3MTMCreateForwardAsAttachmentEmailMessage,"KPOP3MTMCreateForwardAsAttachmentEmailMessage");
+_LIT(KStrPOP3MTMCreateReceiptEmailMessage,"KPOP3MTMCreateReceiptEmailMessage");
+_LIT(KStrPOP3MTMPopulate,"KPOP3MTMPopulate");
+_LIT(KStrPOP3MTMPopulateNew,"KPOP3MTMPopulateNew");
+_LIT(KStrPOP3MTMPopulateAll,"KPOP3MTMPopulateAll");
+
+
+// TImapCmds specific Enumerations
+_LIT(KStrIMAP4MTMIsConnected, "KIMAP4MTMIsConnected");
+_LIT(KStrIMAP4MTMConnect, "KIMAP4MTMConnect");
+_LIT(KStrIMAP4MTMConnectAndSynchronise, "KIMAP4MTMConnectAndSynchronise");
+_LIT(KStrIMAP4MTMCancelBackgroundSynchronise, "KIMAP4MTMCancelBackgroundSynchronise");
+_LIT(KStrIMAP4MTMStartBatch, "KIMAP4MTMStartBatch");
+_LIT(KStrIMAP4MTMEndBatch, "KIMAP4MTMEndBatch");
+_LIT(KStrIMAP4MTMBusy, "KIMAP4MTMBusy");
+_LIT(KStrIMAP4MTMSelect, "KIMAP4MTMSelect");
+_LIT(KStrIMAP4MTMSynchronise, "KIMAP4MTMSynchronise");
+_LIT(KStrIMAP4MTMSyncTree, "KIMAP4MTMSyncTree");
+_LIT(KStrIMAP4MTMReserved10, "KIMAP4MTMReserved10");
+_LIT(KStrIMAP4MTMFullSync, "KIMAP4MTMFullSync");
+_LIT(KStrIMAP4MTMDisconnect, "KIMAP4MTMDisconnect");
+_LIT(KStrIMAP4MTMLocalSubscribe, "KIMAP4MTMLocalSubscribe");
+_LIT(KStrIMAP4MTMLocalUnsubscribe, "KIMAP4MTMLocalUnsubscribe");
+_LIT(KStrIMAP4MTMReserved15, "KIMAP4MTMReserved15");
+_LIT(KStrIMAP4MTMReserved16, "KIMAP4MTMReserved16");
+_LIT(KStrIMAP4MTMInboxNewSync, "KIMAP4MTMInboxNewSync");
+_LIT(KStrIMAP4MTMFolderFullSync, "KIMAP4MTMFolderFullSync");
+_LIT(KStrIMAP4MTMWaitForBackground, "KIMAP4MTMWaitForBackground");
+_LIT(KStrIMAP4MTMRenameFolder, "KIMAP4MTMRenameFolder");
+_LIT(KStrIMAP4MTMUndeleteAll, "KIMAP4MTMUndeleteAll");
+_LIT(KStrIMAP4MTMCancelOffLineOperations, "KIMAP4MTMCancelOffLineOperations");
+_LIT(KStrIMAP4MTMPopulate, "KIMAP4MTMPopulate");
+_LIT(KStrIMAP4MTMSyncSubscription, "KIMAP4MTMSyncSubscription");
+_LIT(KStrIMAP4MTMConnectAndSyncCompleteAfterConnect, "KIMAP4MTMConnectAndSyncCompleteAfterConnect");
+_LIT(KStrIMAP4MTMConnectAndSyncCompleteAfterFullSync, "KIMAP4MTMConnectAndSyncCompleteAfterFullSync");
+_LIT(KStrIMAP4MTMConnectAndSyncCompleteAfterDisconnect, "KIMAP4MTMConnectAndSyncCompleteAfterDisconnect");
+_LIT(KStrIMAP4MTMCancelSendOnNextConnection, "KIMAP4MTMCancelSendOnNextConnection");
+_LIT(KStrIMAP4MTMCopyNewMailWhenAlreadyConnected, "KIMAP4MTMCopyNewMailWhenAlreadyConnected");
+_LIT(KStrIMAP4MTMConnectAndCopyNewMailAndStayOnline, "KIMAP4MTMConnectAndCopyNewMailAndStayOnline");
+_LIT(KStrIMAP4MTMConnectAndCopyNewMailAndDisconnect, "KIMAP4MTMConnectAndCopyNewMailAndDisconnect");
+_LIT(KStrIMAP4MTMMoveNewMailWhenAlreadyConnected, "KIMAP4MTMMoveNewMailWhenAlreadyConnected");
+_LIT(KStrIMAP4MTMConnectAndMoveNewMailAndStayOnline, "KIMAP4MTMConnectAndMoveNewMailAndStayOnline");
+_LIT(KStrIMAP4MTMConnectAndMoveNewMailAndDisconnect, "KIMAP4MTMConnectAndMoveNewMailAndDisconnect");
+_LIT(KStrIMAP4MTMCopyMailSelectionWhenAlreadyConnected, "KIMAP4MTMCopyMailSelectionWhenAlreadyConnected");
+_LIT(KStrIMAP4MTMConnectAndCopyMailSelectionAndStayOnline, "KIMAP4MTMConnectAndCopyMailSelectionAndStayOnline");
+_LIT(KStrIMAP4MTMConnectAndCopyMailSelectionAndDisconnect, "KIMAP4MTMConnectAndCopyMailSelectionAndDisconnect");
+_LIT(KStrIMAP4MTMMoveMailSelectionWhenAlreadyConnected, "KIMAP4MTMMoveMailSelectionWhenAlreadyConnected");
+_LIT(KStrIMAP4MTMConnectAndMoveMailSelectionAndStayOnline, "KIMAP4MTMConnectAndMoveMailSelectionAndStayOnline");
+_LIT(KStrIMAP4MTMConnectAndMoveMailSelectionAndDisconnect, "KIMAP4MTMConnectAndMoveMailSelectionAndDisconnect");
+_LIT(KStrIMAP4MTMCopyAllMailWhenAlreadyConnected, "KIMAP4MTMCopyAllMailWhenAlreadyConnected");
+_LIT(KStrIMAP4MTMConnectAndCopyAllMailAndStayOnline, "KIMAP4MTMConnectAndCopyAllMailAndStayOnline");
+_LIT(KStrIMAP4MTMConnectAndCopyAllMailAndDisconnect, "KIMAP4MTMConnectAndCopyAllMailAndDisconnect");
+_LIT(KStrIMAP4MTMMoveAllMailWhenAlreadyConnected, "KIMAP4MTMMoveAllMailWhenAlreadyConnected");
+_LIT(KStrIMAP4MTMConnectAndMoveAllMailAndStayOnline, "KIMAP4MTMConnectAndMoveAllMailAndStayOnline");
+_LIT(KStrIMAP4MTMConnectAndMoveAllMailAndDisconnect, "KIMAP4MTMConnectAndMoveAllMailAndDisconnect");
+_LIT(KStrIMAP4MTMPopulateMailSelectionWhenAlreadyConnected, "KIMAP4MTMPopulateMailSelectionWhenAlreadyConnected");
+_LIT(KStrIMAP4MTMConnectAndPopulateMailSelectionAndStayOnline, "KIMAP4MTMConnectAndPopulateMailSelectionAndStayOnline");
+_LIT(KStrIMAP4MTMConnectAndPopulateMailSelectionAndDisconnect, "KIMAP4MTMConnectAndPopulateMailSelectionAndDisconnect");
+_LIT(KStrIMAP4MTMPopulateNewMailWhenAlreadyConnected, "KIMAP4MTMPopulateNewMailWhenAlreadyConnected");
+_LIT(KStrIMAP4MTMPopulateAllMailWhenAlreadyConnected, "KIMAP4MTMPopulateAllMailWhenAlreadyConnected");
+_LIT(KStrIMAP4MTMConnectAndPopulateNewMailAndStayOnline, "KIMAP4MTMConnectAndPopulateNewMailAndStayOnline");
+_LIT(KStrIMAP4MTMConnectAndPopulateNewMailAndDisconnect, "KIMAP4MTMConnectAndPopulateNewMailAndDisconnect");
+_LIT(KStrIMAP4MTMConnectAndPopulateAllMailAndStayOnline, "KIMAP4MTMConnectAndPopulateAllMailAndStayOnline");
+_LIT(KStrIMAP4MTMConnectAndPopulateAllMailAndDisconnect, "KIMAP4MTMConnectAndPopulateAllMailAndDisconnect");
+_LIT(KStrIMAP4MTMCreateNewEmailMessage, "KIMAP4MTMCreateNewEmailMessage");
+_LIT(KStrIMAP4MTMCreateReplyEmailMessage, "KIMAP4MTMCreateReplyEmailMessage");
+_LIT(KStrIMAP4MTMCreateForwardEmailMessage, "KIMAP4MTMCreateForwardEmailMessage");
+_LIT(KStrIMAP4MTMCreateForwardAsAttachmentEmailMessage, "KIMAP4MTMCreateForwardAsAttachmentEmailMessage");
+_LIT(KStrIMAP4MTMCreateReceiptEmailMessage, "KIMAP4MTMCreateReceiptEmailMessage");
+
+
+// TSmtpCmds specific Enumerations
+_LIT(KStrSMTPMTMCreateNewEmailMessage, "KSMTPMTMCreateNewEmailMessage");
+_LIT(KStrSMTPMTMCreateReplyEmailMessage, "KSMTPMTMCreateReplyEmailMessage");
+_LIT(KStrSMTPMTMCreateForwardEmailMessage, "KSMTPMTMCreateForwardEmailMessage");
+_LIT(KStrSMTPMTMCreateForwardAsAttachmentEmailMessage, "KSMTPMTMCreateForwardAsAttachmentEmailMessage");
+_LIT(KStrSMTPMTMCreateReceiptEmailMessage, "KSMTPMTMCreateReceiptEmailMessage");
+_LIT(KStrSMTPMTMSendOnNextConnection, "KSMTPMTMSendOnNextConnection");
+
+// DownloadType specific Enumerations
+//_LIT(KStrPartialDownload,"PartialDownload");
+//_LIT(KStrFullDownload,"FullDownload");
+
+
+// TCommDbDialogPref specific Enumerations
+//_LIT(KStrECommDbDialogPrefUnknown, "TCommDbDialogPref::ECommDbDialogPrefUnknown");
+_LIT(KStrECommDbDialogPrefPrompt, "TCommDbDialogPref::ECommDbDialogPrefPrompt");
+_LIT(KStrECommDbDialogPrefWarn, "TCommDbDialogPref::ECommDbDialogPrefWarn");
+_LIT(KStrECommDbDialogPrefDoNotPrompt,"TCommDbDialogPref::ECommDbDialogPrefDoNotPrompt");
+_LIT(KStrECommDbDialogPrefPromptIfWrongMode, "TCommDbDialogPref::ECommDbDialogPrefPromptIfWrongMode");
+
+
+// TImap4GetMailOptions specific Enumerations
+//_LIT(KStrEGetImap4EmailHeaders, "TImap4GetMailOptions::EGetImap4EmailHeaders");
+_LIT(KStrEGetImap4EmailBodyText, "TImap4GetMailOptions::EGetImap4EmailBodyText");
+_LIT(KStrEGetImap4EmailBodyTextAndAttachments, "TImap4GetMailOptions::EGetImap4EmailBodyTextAndAttachments");
+_LIT(KStrEGetImap4EmailAttachments, "TImap4GetMailOptions::EGetImap4EmailAttachments");
+_LIT(KStrEGetImap4EmailBodyAlternativeText, "TImap4GetMailOptions::EGetImap4EmailBodyAlternativeText");
+
+
+// TFolderSyncType specific Enumerations
+_LIT(KStrEUseCombination, "TFolderSyncType::EUseCombination");
+_LIT(KStrEUseLocal, "TFolderSyncType::EUseLocal");
+//_LIT(KStrEUseRemote, "TFolderSyncType::EUseRemote");	
+
+
+// TFolderSubscribeType specific Enumerations
+//_LIT(KStrEUpdateNeither, "TFolderSubscribeType::EUpdateNeither");
+_LIT(KStrEUpdateLocal, "TFolderSubscribeType::EUpdateLocal");
+_LIT(KStrEUpdateRemote, "TFolderSubscribeType::EUpdateRemote");
+_LIT(KStrEUpdateBoth, "TFolderSubscribeType::EUpdateBoth");
+
+
+// TImImap4PartialMailOptions specific Enumerations
+//_LIT(KStrENoSizeLimits, "TImImap4PartialMailOptions::ENoSizeLimits");
+_LIT(KStrEBodyTextOnly, "TImImap4PartialMailOptions::EBodyTextOnly");
+_LIT(KStrEAttachmentsOnly, "TImImap4PartialMailOptions::EAttachmentsOnly");
+_LIT(KStrEBodyTextAndAttachments, "TImImap4PartialMailOptions::EBodyTextAndAttachments");
+_LIT(KStrECumulative, "TImImap4PartialMailOptions::ECumulative");
+_LIT(KStrEBodyAlternativeText, "TImImap4PartialMailOptions::EBodyAlternativeText");
+
+
+// TMsgOutboxBodyEncoding specific Enumerations
+//_LIT(KStrEMsgOutboxDefault, "TMsgOutboxBodyEncoding::EMsgOutboxDefault");
+_LIT(KStrEMsgOutboxNoAlgorithm, "TMsgOutboxBodyEncoding::EMsgOutboxNoAlgorithm");
+_LIT(KStrEMsgOutboxMIME, "TMsgOutboxBodyEncoding::EMsgOutboxMIME");
+_LIT(KStrEMsgOutboxMHTMLAsMIME, "TMsgOutboxBodyEncoding::EMsgOutboxMHTMLAsMIME");
+_LIT(KStrEMsgOutboxMHTMLAlternativeAsMIME, "TMsgOutboxBodyEncoding::EMsgOutboxMHTMLAlternativeAsMIME");
+
+
+// TImSMTPSendMessageOption specific Enumerations
+//_LIT(KStrESendMessageImmediately , "TImSMTPSendMessageOption::ESendMessageImmediately ");
+_LIT(KStrESendMessageOnNextConnection, "TImSMTPSendMessageOption::ESendMessageOnNextConnection");
+_LIT(KStrESendMessageOnRequest, "TImSMTPSendMessageOption::ESendMessageOnRequest");
+
+
+// TImSMTPSendCopyToSelf specific Enumerations
+//_LIT(KStrESendNoCopy, "TImSMTPSendCopyToSelf::ESendNoCopy");
+_LIT(KStrESendCopyAsToRecipient, "TImSMTPSendCopyToSelf::ESendCopyAsToRecipient");
+_LIT(KStrESendCopyAsCcRecipient, "TImSMTPSendCopyToSelf::ESendCopyAsCcRecipient");
+_LIT(KStrESendCopyAsBccRecipient, "TImSMTPSendCopyToSelf::ESendCopyAsBccRecipient");
+
+
+// TPop3GetMailOptions specific Enumerations
+//_LIT(KStrEGetPop3EmailHeaders , "TPop3GetMailOptions::EGetPop3EmailHeaders");
+_LIT(KStrEGetPop3EmailMessages, "TPop3GetMailOptions::EGetPop3EmailMessages");
+
+
+// RAM Usage Logging Eventcodes
+_LIT(KStrImapRamUsageStart, "TInstrumentationPoint::EImapRamUsageStart");
+_LIT(KStrImapRamUsageStop, "TInstrumentationPoint::EImapRamUsageStop");
+_LIT(KStrPopRamUsageStart, "TInstrumentationPoint::EPopRamUsageStart");
+_LIT(KStrPopRamUsageStop, "TInstrumentationPoint::EPopRamUsageStop");
+_LIT(KStrSmtpRamUsageStart, "TInstrumentationPoint::ESmtpRamUsageStart");
+_LIT(KStrSmtpRamUsageStop, "TInstrumentationPoint::ESmtpRamUsageStop");
+_LIT(KStrSmtpRamUsageCreateMessageStart, "TInstrumentationPoint::ESmtpRamUsageCreateMessageStart");
+_LIT(KStrSmtpRamUsageCreateMessageStop, "TInstrumentationPoint::ESmtpRamUsageCreateMessageStop");
+_LIT(KStrSmtpRamUsageSendMessageStart, "TInstrumentationPoint::ESmtpRamUsageSendMessageStart");
+_LIT(KStrSmtpRamUsageSendMessageStop, "TInstrumentationPoint::ESmtpRamUsageSendMessageStop");
+_LIT(KStrSmtpCreateMessageSpeedStart, "TInstrumentationPoint::ESmtpCreateMessageSpeedStart");
+_LIT(KStrSmtpCreateMessageSpeedStop, "TInstrumentationPoint::ESmtpCreateMessageSpeedStop");
+_LIT(KStrSmtpSendMessageSpeedStart, "TInstrumentationPoint::ESmtpSendMessageSpeedStart");
+_LIT(KStrSmtpSendMessageSpeedStop, "TInstrumentationPoint::ESmtpSendMessageSpeedStop");
+_LIT(KStrImapDownloadMessageSpeedStart, "TInstrumentationPoint::EImapDownloadMessageSpeedStart");
+_LIT(KStrImapDownloadMessageSpeedStop, "TInstrumentationPoint::EImapDownloadMessageSpeedStop");
+
+// Bearer types
+_LIT(KStrBearerTypeUnknown, "Unknown");
+_LIT(KStrBearerTypeCsd, "CSD");
+_LIT(KStrBearerTypeWcdma, "Wcdma");
+_LIT(KStrBearerTypeLan, "LAN");
+_LIT(KStrBearerTypeCdma2000, "Cdma2000");
+_LIT(KStrBearerTypeVirtual, "Virtual");
+_LIT(KStrBearerTypePan, "PAN");
+_LIT(KStrBearerTypeWlan, "WLAN");
+_LIT(KStrBearerTypePsd, "PSD");
+_LIT(KStrBearerTypeCsdLan, "CSDLAN");
+
+/**
+CT_MsgUtilsEnumConverter()
+Constructor
+*/
+EXPORT_C CT_MsgUtilsEnumConverter::CT_MsgUtilsEnumConverter()
+	{
+	}
+
+/**
+~CT_MsgUtilsEnumConverter()
+Destructor
+*/
+CT_MsgUtilsEnumConverter::~CT_MsgUtilsEnumConverter()
+	{
+	}
+
+
+/**
+FindFolderIdByName()
+Returns the ID of the local folder based on the folder name.
+If the folder name given does not match then it returns -1.
+
+@param aFolderName
+Folder name whose ID need to be returned. Folder name is assumed to be in string form
+of the standard folder ID. Eg., GlobalInBoxIndexEntryId
+
+@return
+ID of the folder
+*/
+EXPORT_C TMsvId CT_MsgUtilsEnumConverter::FindFolderIdByName(TDesC& aFolderName)
+	{
+	TMsvId folderId;
+
+	STR_SWITCH(aFolderName)
+	
+	STR_CASE(KStrGlobalInBoxIndexEntryId)
+		{
+		folderId = KMsvGlobalInBoxIndexEntryId;
+		break;
+		}
+	STR_CASE(KStrGlobalOutBoxIndexEntryId)
+		{
+		folderId = KMsvGlobalOutBoxIndexEntryId;
+		break;
+		}
+	STR_CASE(KStrSentEntryId)
+		{
+		folderId = KMsvSentEntryId;
+		break;
+		}
+	STR_CASE(KStrDraftEntryId)
+		{
+		folderId = KMsvDraftEntryId;
+		break;
+		}
+	STR_CASE(KStrDeletedEntryFolderEntryId)
+		{
+		folderId = KMsvDeletedEntryFolderEntryId;
+		break;
+		}
+	STR_CASE(KStrRootIndexEntryId)
+		{
+		folderId = KMsvRootIndexEntryId;
+		break;
+		}
+	STR_CASE(KStrTempIndexEntryId)
+		{
+		folderId = KMsvTempIndexEntryId;
+		break;
+		}
+	STR_CASE(KStrLocalServiceIndexEntryId)
+		{
+		folderId = KMsvLocalServiceIndexEntryId;
+		break;
+		}
+	STR_CASE(KStrUnknownServiceIndexEntryId)
+		{
+		folderId = KMsvUnknownServiceIndexEntryId;
+		break;
+		}
+	STR_CASE(KStrFirstFreeEntryId)
+		{
+		folderId = KFirstFreeEntryId;
+		break;
+		}
+	DEFAULT_CASE()	// match not found
+		{
+		folderId = KErrNotFound;
+		}
+		
+	STR_SWITCH_END()
+
+	return folderId;
+	}
+
+
+/**
+ConvertDesToTPop3Cmds()
+Returns the corresponding Pop3 Command
+
+@param aPopCmdName
+POP command name
+
+@return
+POP3-specific commands
+*/
+EXPORT_C TPop3Cmds CT_MsgUtilsEnumConverter::ConvertDesToTPop3Cmds(const TDesC& aPopCmdName)
+	{
+	TPop3Cmds ret = KPOP3MTMConnect;
+
+	STR_SWITCH(aPopCmdName)
+
+	STR_CASE(KStrPOP3MTMIsConnected)
+		{
+		ret = KPOP3MTMIsConnected;
+		break;
+		}	
+	STR_CASE(KStrPOP3MTMConnect)
+		{
+		ret = KPOP3MTMConnect;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMDisconnect )
+		{
+		ret = KPOP3MTMDisconnect;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMCopyNewMailWhenAlreadyConnected )
+		{
+		ret = KPOP3MTMCopyNewMailWhenAlreadyConnected;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMConnectAndCopyNewMailAndStayOnline)
+		{
+		ret = KPOP3MTMConnectAndCopyNewMailAndStayOnline;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMConnectAndCopyNewMailAndDisconnect)
+		{
+		ret = KPOP3MTMConnectAndCopyNewMailAndDisconnect;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMMoveNewMailWhenAlreadyConnected)
+		{
+		ret = KPOP3MTMMoveNewMailWhenAlreadyConnected;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMConnectAndMoveNewMailAndStayOnline)
+		{
+		ret = KPOP3MTMConnectAndMoveNewMailAndStayOnline;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMConnectAndMoveNewMailAndDisconnect)
+		{
+		ret = KPOP3MTMConnectAndMoveNewMailAndDisconnect;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMCopyMailSelectionWhenAlreadyConnected)
+		{
+		ret = KPOP3MTMCopyMailSelectionWhenAlreadyConnected;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMConnectAndCopyMailSelectionAndStayOnline)
+		{
+		ret = KPOP3MTMConnectAndCopyMailSelectionAndStayOnline;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMConnectAndCopyMailSelectionAndDisconnect)
+		{
+		ret = KPOP3MTMConnectAndCopyMailSelectionAndDisconnect;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMMoveMailSelectionWhenAlreadyConnected)
+		{
+		ret = KPOP3MTMMoveMailSelectionWhenAlreadyConnected;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMConnectAndMoveMailSelectionAndStayOnline)
+		{
+		ret = KPOP3MTMConnectAndMoveMailSelectionAndStayOnline;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMConnectAndMoveMailSelectionAndDisconnect)
+		{
+		ret = KPOP3MTMConnectAndMoveMailSelectionAndDisconnect;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMCopyAllMailWhenAlreadyConnected)
+		{
+		ret = KPOP3MTMCopyAllMailWhenAlreadyConnected;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMConnectAndCopyAllMailAndStayOnline)
+		{
+		ret = KPOP3MTMConnectAndCopyAllMailAndStayOnline;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMConnectAndCopyAllMailAndDisconnect)
+		{
+		ret = KPOP3MTMConnectAndCopyAllMailAndDisconnect;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMMoveAllMailWhenAlreadyConnected)
+		{
+		ret = KPOP3MTMMoveAllMailWhenAlreadyConnected;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMConnectAndMoveAllMailAndStayOnline)
+		{
+		ret = KPOP3MTMConnectAndMoveAllMailAndStayOnline;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMConnectAndMoveAllMailAndDisconnect)
+		{
+		ret = KPOP3MTMConnectAndMoveAllMailAndDisconnect;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMCancelOfflineOperations)
+		{
+		ret = KPOP3MTMCancelOfflineOperations;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMCancelSendOnNextConnection)
+		{
+		ret = KPOP3MTMCancelSendOnNextConnection;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMCreateNewEmailMessage)
+		{
+		ret = KPOP3MTMCreateNewEmailMessage;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMCreateReplyEmailMessage)
+		{
+		ret = KPOP3MTMCreateReplyEmailMessage;
+		break;
+		}		
+	STR_CASE(KStrPOP3MTMCreateForwardEmailMessage)
+		{
+		ret = KPOP3MTMCreateForwardEmailMessage;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMCreateForwardAsAttachmentEmailMessage)
+		{
+		ret = KPOP3MTMCreateForwardAsAttachmentEmailMessage;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMCreateReceiptEmailMessage)
+		{
+		ret = KPOP3MTMCreateReceiptEmailMessage;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMPopulate)
+		{
+		ret = KPOP3MTMPopulate;
+		break;
+		}
+	STR_CASE(KStrPOP3MTMPopulateNew)
+		{
+		ret = KPOP3MTMPopulateNew;
+		break;
+		}		
+	STR_CASE(KStrPOP3MTMPopulateAll)
+		{
+		ret = KPOP3MTMPopulateAll;
+		break;
+		}
+
+	DEFAULT_CASE()
+		{
+		ret = KPOP3MTMConnect;
+		}
+		
+	STR_SWITCH_END()
+	
+	return ret;
+	}
+
+
+/**
+ConvertDesToTImap4Cmds()
+Returns the corresponding IMAP4 Command
+
+@param aImapCmdName
+IMAP command name
+
+@return
+IMAP4-specific commands
+*/
+EXPORT_C TImap4Cmds CT_MsgUtilsEnumConverter::ConvertDesToTImap4Cmds(TDesC& aImapCmdName)
+	{
+	TImap4Cmds  ret;
+	STR_SWITCH(aImapCmdName)
+		
+	STR_CASE(KStrIMAP4MTMIsConnected)
+		{
+		ret = KIMAP4MTMIsConnected;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMConnect)
+		{
+		ret = KIMAP4MTMConnect;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMConnectAndSynchronise)
+		{
+		ret = KIMAP4MTMConnectAndSynchronise;
+		break;
+		}				
+	STR_CASE(KStrIMAP4MTMCancelBackgroundSynchronise)
+		{
+		ret = KIMAP4MTMCancelBackgroundSynchronise;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMStartBatch)
+		{
+		ret = KIMAP4MTMStartBatch;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMEndBatch)
+		{
+		ret = KIMAP4MTMEndBatch;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMBusy)
+		{
+		ret = KIMAP4MTMBusy;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMSelect)
+		{
+		ret = KIMAP4MTMSelect;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMSynchronise)
+		{
+		ret = KIMAP4MTMSynchronise;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMSyncTree)
+		{
+		ret = KIMAP4MTMSyncTree;
+		break;
+		}				
+	STR_CASE(KStrIMAP4MTMReserved10)
+		{
+		ret = KIMAP4MTMReserved10;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMFullSync)
+		{
+		ret = KIMAP4MTMFullSync;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMDisconnect)
+		{
+		ret = KIMAP4MTMDisconnect;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMLocalSubscribe)
+		{
+		ret = KIMAP4MTMLocalSubscribe;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMLocalUnsubscribe)
+		{
+		ret = KIMAP4MTMLocalUnsubscribe;
+		break;
+		}					
+	STR_CASE(KStrIMAP4MTMReserved15)
+		{
+		ret = KIMAP4MTMReserved15;
+		break;
+		}					
+	STR_CASE(KStrIMAP4MTMReserved16)
+		{
+		ret = KIMAP4MTMReserved16;
+		break;
+		}					
+	STR_CASE(KStrIMAP4MTMInboxNewSync)
+		{
+		ret = KIMAP4MTMInboxNewSync;
+		break;
+		}					
+	STR_CASE(KStrIMAP4MTMFolderFullSync)
+		{
+		ret = KIMAP4MTMFolderFullSync;
+		break;
+		}					
+	STR_CASE(KStrIMAP4MTMWaitForBackground)
+		{
+		ret = KIMAP4MTMWaitForBackground;
+		break;
+		}					
+	STR_CASE(KStrIMAP4MTMRenameFolder)
+		{
+		ret = KIMAP4MTMRenameFolder;
+		break;
+		}					
+	STR_CASE(KStrIMAP4MTMUndeleteAll)
+		{
+		ret = KIMAP4MTMUndeleteAll;
+		break;
+		}			
+							
+	STR_CASE(KStrIMAP4MTMCancelOffLineOperations)
+		{
+		ret = KIMAP4MTMCancelOffLineOperations;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMPopulate)
+		{
+		ret = KIMAP4MTMPopulate;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMSyncSubscription)
+		{
+		ret = KIMAP4MTMSyncSubscription;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMConnectAndSyncCompleteAfterConnect)
+		{
+		ret = KIMAP4MTMConnectAndSyncCompleteAfterConnect;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMConnectAndSyncCompleteAfterFullSync)
+		{
+		ret = KIMAP4MTMConnectAndSyncCompleteAfterFullSync;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMConnectAndSyncCompleteAfterDisconnect)
+		{
+		ret = KIMAP4MTMConnectAndSyncCompleteAfterDisconnect;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMCancelSendOnNextConnection)
+		{
+		ret = KIMAP4MTMCancelSendOnNextConnection;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMCopyNewMailWhenAlreadyConnected)
+		{
+		ret = KIMAP4MTMCopyNewMailWhenAlreadyConnected;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMConnectAndCopyNewMailAndStayOnline)
+		{
+		ret = KIMAP4MTMConnectAndCopyNewMailAndStayOnline;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMConnectAndCopyNewMailAndDisconnect)
+		{
+		ret = KIMAP4MTMConnectAndCopyNewMailAndDisconnect;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMMoveNewMailWhenAlreadyConnected)
+		{
+		ret = KIMAP4MTMMoveNewMailWhenAlreadyConnected;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMConnectAndMoveNewMailAndStayOnline)
+		{
+		ret = KIMAP4MTMConnectAndMoveNewMailAndStayOnline;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMConnectAndMoveNewMailAndDisconnect)
+		{
+		ret = KIMAP4MTMConnectAndMoveNewMailAndDisconnect;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMCopyMailSelectionWhenAlreadyConnected)
+		{
+		ret = KIMAP4MTMCopyMailSelectionWhenAlreadyConnected;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMConnectAndCopyMailSelectionAndStayOnline)
+		{
+		ret = KIMAP4MTMConnectAndCopyMailSelectionAndStayOnline;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMConnectAndCopyMailSelectionAndDisconnect)
+		{
+		ret = KIMAP4MTMConnectAndCopyMailSelectionAndDisconnect;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMMoveMailSelectionWhenAlreadyConnected)
+		{
+		ret = KIMAP4MTMMoveMailSelectionWhenAlreadyConnected;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMConnectAndMoveMailSelectionAndStayOnline)
+		{
+		ret = KIMAP4MTMConnectAndMoveMailSelectionAndStayOnline;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMConnectAndMoveMailSelectionAndDisconnect)
+		{
+		ret = KIMAP4MTMConnectAndMoveMailSelectionAndDisconnect;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMCopyAllMailWhenAlreadyConnected)
+		{
+		ret = KIMAP4MTMCopyAllMailWhenAlreadyConnected;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMConnectAndCopyAllMailAndStayOnline)
+		{
+		ret = KIMAP4MTMConnectAndCopyAllMailAndStayOnline;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMConnectAndCopyAllMailAndDisconnect)
+		{
+		ret = KIMAP4MTMConnectAndCopyAllMailAndDisconnect;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMMoveAllMailWhenAlreadyConnected)
+		{
+		ret = KIMAP4MTMMoveAllMailWhenAlreadyConnected;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMConnectAndMoveAllMailAndStayOnline)
+		{
+		ret = KIMAP4MTMConnectAndMoveAllMailAndStayOnline;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMConnectAndMoveAllMailAndDisconnect)
+		{
+		ret = KIMAP4MTMConnectAndMoveAllMailAndDisconnect;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMPopulateMailSelectionWhenAlreadyConnected)
+		{
+		ret = KIMAP4MTMPopulateMailSelectionWhenAlreadyConnected;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMConnectAndPopulateMailSelectionAndStayOnline)
+		{
+		ret = KIMAP4MTMConnectAndPopulateMailSelectionAndStayOnline;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMConnectAndPopulateMailSelectionAndDisconnect)
+		{
+		ret = KIMAP4MTMConnectAndPopulateMailSelectionAndDisconnect;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMPopulateNewMailWhenAlreadyConnected)
+		{
+		ret = KIMAP4MTMPopulateNewMailWhenAlreadyConnected;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMPopulateAllMailWhenAlreadyConnected)
+		{
+		ret = KIMAP4MTMPopulateAllMailWhenAlreadyConnected;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMConnectAndPopulateNewMailAndStayOnline)
+		{
+		ret = KIMAP4MTMConnectAndPopulateNewMailAndStayOnline;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMConnectAndPopulateNewMailAndDisconnect)
+		{
+		ret = KIMAP4MTMConnectAndPopulateNewMailAndDisconnect;
+		break;
+		}		
+	STR_CASE(KStrIMAP4MTMConnectAndPopulateAllMailAndStayOnline)
+		{
+		ret = KIMAP4MTMConnectAndPopulateAllMailAndStayOnline;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMConnectAndPopulateAllMailAndDisconnect)
+		{
+		ret = KIMAP4MTMConnectAndPopulateAllMailAndDisconnect;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMCreateNewEmailMessage)
+		{
+		ret = KIMAP4MTMCreateNewEmailMessage;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMCreateReplyEmailMessage)
+		{
+		ret = KIMAP4MTMCreateReplyEmailMessage;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMCreateForwardEmailMessage)
+		{
+		ret = KIMAP4MTMCreateForwardEmailMessage;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMCreateForwardAsAttachmentEmailMessage)
+		{
+		ret = KIMAP4MTMCreateForwardAsAttachmentEmailMessage;
+		break;
+		}
+	STR_CASE(KStrIMAP4MTMCreateReceiptEmailMessage)
+		{
+		ret = KIMAP4MTMCreateReceiptEmailMessage;
+		break;
+		}
+	DEFAULT_CASE()
+		{
+		ret = KIMAP4MTMConnectAndSynchronise;
+		}
+		
+	STR_SWITCH_END()	
+	return ret;
+	}
+
+
+/**
+ConvertDesToTSmtpCmdsL()
+Returns the corresponding SMTP Command
+
+@param aSmtpCmdName
+SMTP command name
+
+@return
+SMTP-specific commands
+*/
+EXPORT_C TSmtpCmds CT_MsgUtilsEnumConverter::ConvertDesToTSmtpCmdsL(TDesC& aSmtpCmdName)
+	{
+	TSmtpCmds  ret = KSMTPMTMCreateNewEmailMessage;
+	STR_SWITCH(aSmtpCmdName)
+		
+	STR_CASE(KStrSMTPMTMCreateNewEmailMessage)
+		{
+		ret = KSMTPMTMCreateNewEmailMessage;
+		break;
+		}
+	STR_CASE(KStrSMTPMTMCreateReplyEmailMessage)
+		{
+		ret = KSMTPMTMCreateReplyEmailMessage;
+		break;
+		}
+	STR_CASE(KStrSMTPMTMCreateForwardEmailMessage)
+		{
+		ret = KSMTPMTMCreateForwardEmailMessage;
+		break;
+		}
+	STR_CASE(KStrSMTPMTMCreateForwardAsAttachmentEmailMessage)
+		{
+		ret = KSMTPMTMCreateForwardAsAttachmentEmailMessage;
+		break;
+		}
+	STR_CASE(KStrSMTPMTMCreateReceiptEmailMessage)
+		{
+		ret = KSMTPMTMCreateReceiptEmailMessage;
+		break;
+		}
+	STR_CASE(KStrSMTPMTMSendOnNextConnection)
+		{
+		ret = KSMTPMTMSendOnNextConnection;
+		break;
+		}
+
+	DEFAULT_CASE()
+		{
+		User::Leave(KErrNotSupported);
+		}
+		
+	STR_SWITCH_END()	
+	return ret;
+	}
+
+	
+/**
+ConvertDesToTCommDbDialogPref()
+Returns the corresponding TCommDbDialogPref Enumeration
+
+@param aDialogPrefStr
+@return 
+TCommDbDialogPref enumeration
+*/	
+EXPORT_C TCommDbDialogPref CT_MsgUtilsEnumConverter::ConvertDesToTCommDbDialogPref(TDesC& aDialogPrefStr)
+	{
+	TCommDbDialogPref dialogPref;
+
+	STR_SWITCH(aDialogPrefStr)
+
+	STR_CASE(KStrECommDbDialogPrefPrompt)
+		{
+		dialogPref = ECommDbDialogPrefPrompt;
+		break;
+		}
+	STR_CASE(KStrECommDbDialogPrefWarn)
+		{
+		dialogPref = ECommDbDialogPrefWarn;
+		break;
+		}
+	STR_CASE(KStrECommDbDialogPrefDoNotPrompt)
+		{
+		dialogPref = ECommDbDialogPrefDoNotPrompt;
+		break;
+		}
+	STR_CASE(KStrECommDbDialogPrefPromptIfWrongMode)
+		{
+		dialogPref = ECommDbDialogPrefPromptIfWrongMode;
+		break;
+		}
+	DEFAULT_CASE()
+		{
+		dialogPref = ECommDbDialogPrefUnknown;
+		}
+	STR_SWITCH_END()
+
+	return dialogPref;
+	}	
+
+	
+/**
+ConvertDesToTImap4GetMailOptions()
+Returns the corresponding TImap4GetMailOptions Enumeration
+
+@param aMailOption
+@return
+TImap4GetMailOptions enumeration
+*/	
+EXPORT_C TImap4GetMailOptions CT_MsgUtilsEnumConverter::ConvertDesToTImap4GetMailOptions(TDesC& aMailOption)
+	{ 
+	TImap4GetMailOptions options = EGetImap4EmailAttachments;
+	
+	STR_SWITCH(aMailOption)
+	
+	STR_CASE(KStrEGetImap4EmailBodyText)
+		{
+		options = EGetImap4EmailBodyText;
+		break;
+		}
+	STR_CASE(KStrEGetImap4EmailBodyTextAndAttachments)
+		{
+		options = EGetImap4EmailBodyTextAndAttachments;
+		break;
+		}
+	STR_CASE(KStrEGetImap4EmailAttachments)
+		{
+		options = EGetImap4EmailAttachments;
+		break;
+		}
+	STR_CASE(KStrEGetImap4EmailBodyAlternativeText)
+		{
+		options = EGetImap4EmailBodyAlternativeText;
+		break;
+		}
+	DEFAULT_CASE()
+		{
+		options = EGetImap4EmailHeaders;
+		}
+	STR_SWITCH_END()
+
+	return options;
+	}	
+
+
+/**
+ConvertDesToTFolderSyncType()
+Returns the corresponding TFolderSyncType Enumeration
+
+@param aFolderSyncType
+@return
+TFolderSyncType enumeration
+*/	
+EXPORT_C TFolderSyncType CT_MsgUtilsEnumConverter::ConvertDesToTFolderSyncType(TDesC& aFolderSyncType)
+	{
+	TFolderSyncType syncType;
+	
+	STR_SWITCH(aFolderSyncType)
+		
+	STR_CASE(KStrEUseCombination)
+		{
+		syncType = EUseCombination;
+		break;
+		}
+	STR_CASE(KStrEUseLocal)
+		{
+		syncType = EUseLocal;
+		break;
+		}
+
+	DEFAULT_CASE()
+		{
+		syncType = EUseRemote;
+		}
+		
+	STR_SWITCH_END()
+
+	return syncType;
+	}
+
+
+/**
+ConvertDesToTFolderSubscribeType()
+Returns the corresponding TFolderSubscribeType Enumeration
+
+@param aFolderSubscriberType
+@return
+TFolderSubscribeType enumeration
+*/	
+EXPORT_C TFolderSubscribeType CT_MsgUtilsEnumConverter::ConvertDesToTFolderSubscribeType(TDesC& aFolderSubscriberType)
+	{
+	TFolderSubscribeType subscriberType;
+	
+	STR_SWITCH(aFolderSubscriberType)
+		
+	STR_CASE(KStrEUpdateLocal)
+		{
+		subscriberType = EUpdateLocal;
+		break;
+		}
+	STR_CASE(KStrEUpdateRemote)
+		{
+		subscriberType = EUpdateRemote;
+		break;
+		}
+	STR_CASE(KStrEUpdateBoth)
+		{
+		subscriberType = EUpdateBoth;
+		break;
+		}
+
+	DEFAULT_CASE()
+		{
+		subscriberType = EUpdateNeither;
+		}
+		
+	STR_SWITCH_END()
+
+	return subscriberType;
+	}
+
+
+/**
+ConvertDesToTImImap4PartialMailOptions()
+Returns the corresponding TImImap4PartialMailOptions Enumeration
+
+@param aPartialMailOption
+@return
+TImImap4PartialMailOptions
+*/
+EXPORT_C TImImap4PartialMailOptions CT_MsgUtilsEnumConverter::ConvertDesToTImImap4PartialMailOptions(TDesC& aPartialMailOption)
+	{
+	TImImap4PartialMailOptions partialOption;
+
+	STR_SWITCH(aPartialMailOption)
+		
+	STR_CASE(KStrEBodyTextOnly)
+		{
+		partialOption = EBodyTextOnly;
+		break;
+		}
+	STR_CASE(KStrEAttachmentsOnly)
+		{
+		partialOption = EAttachmentsOnly;
+		break;
+		}
+	STR_CASE(KStrEBodyTextAndAttachments)
+		{
+		partialOption = EBodyTextAndAttachments;
+		break;
+		}
+	STR_CASE(KStrECumulative)
+		{
+		partialOption = ECumulative;
+		break;
+		}
+	STR_CASE(KStrEBodyAlternativeText)
+		{
+		partialOption = EBodyAlternativeText;
+		break;
+		}
+	DEFAULT_CASE()
+		{
+		partialOption = ENoSizeLimits;
+		}
+		
+	STR_SWITCH_END()
+
+	return partialOption;
+	}
+
+
+/**
+ConvertDesToTMsgOutboxBodyEncoding()
+Returns the corresponding TMsgOutboxBodyEncoding Enumeration
+
+@param aOutboxBodyEncoding
+@return
+TMsgOutboxBodyEncoding 
+*/
+EXPORT_C TMsgOutboxBodyEncoding CT_MsgUtilsEnumConverter::ConvertDesToTMsgOutboxBodyEncoding(TDesC& aOutboxBodyEncoding)
+	{
+	TMsgOutboxBodyEncoding bodyEncoding;
+
+	STR_SWITCH(aOutboxBodyEncoding)
+		
+	STR_CASE(KStrEMsgOutboxNoAlgorithm)
+		{
+		bodyEncoding = EMsgOutboxNoAlgorithm;
+		break;
+		}
+	STR_CASE(KStrEMsgOutboxMIME)
+		{
+		bodyEncoding = EMsgOutboxMIME;
+		break;
+		}
+	STR_CASE(KStrEMsgOutboxMHTMLAsMIME)
+		{
+		bodyEncoding = EMsgOutboxMHTMLAsMIME;
+		break;
+		}
+	STR_CASE(KStrEMsgOutboxMHTMLAlternativeAsMIME)
+		{
+		bodyEncoding = EMsgOutboxMHTMLAlternativeAsMIME;
+		break;
+		}
+	DEFAULT_CASE()
+		{
+		bodyEncoding = EMsgOutboxDefault;
+		}
+		
+	STR_SWITCH_END()
+											
+	return bodyEncoding;
+	}
+
+
+/**
+ConvertDesToTImSMTPSendMessageOption()
+Returns the corresponding TImSMTPSendMessageOption Enumeration
+
+@param aSendMsgOption
+@return 
+TImSMTPSendMessageOption 
+*/
+EXPORT_C TImSMTPSendMessageOption CT_MsgUtilsEnumConverter::ConvertDesToTImSMTPSendMessageOption(TDesC& aSendMsgOption)
+	{
+	TImSMTPSendMessageOption messageOption;
+
+	STR_SWITCH(aSendMsgOption)
+		
+	STR_CASE(KStrESendMessageOnNextConnection)
+		{
+		messageOption = ESendMessageOnNextConnection;
+		break;
+		}
+	STR_CASE(KStrESendMessageOnRequest)
+		{
+		messageOption = ESendMessageOnRequest;
+		break;
+		}	
+	DEFAULT_CASE()
+		{
+		messageOption = ESendMessageImmediately;
+		}
+		
+	STR_SWITCH_END()
+						
+	return messageOption;
+	}
+
+
+/**
+ConvertDesToTImSMTPSendCopyToSelf()
+Returns the corresponding TImSMTPSendCopyToSelf Enumeration
+
+@param aSmtpCopyToSelf
+@return
+TImSMTPSendCopyToSelf 
+*/
+EXPORT_C TImSMTPSendCopyToSelf CT_MsgUtilsEnumConverter::ConvertDesToTImSMTPSendCopyToSelf(TDesC& aSmtpCopyToSelf)
+	{
+	TImSMTPSendCopyToSelf copyToSelf;
+
+	STR_SWITCH(aSmtpCopyToSelf)
+		
+	STR_CASE(KStrESendCopyAsToRecipient)
+		{
+		copyToSelf= ESendCopyAsToRecipient;
+		break;
+		}
+	STR_CASE(KStrESendCopyAsCcRecipient)
+		{
+		copyToSelf= ESendCopyAsCcRecipient;
+		break;
+		}
+	STR_CASE(KStrESendCopyAsBccRecipient)
+		{
+		copyToSelf= ESendCopyAsBccRecipient;
+		break;
+		}
+	DEFAULT_CASE()
+		{
+		copyToSelf= ESendNoCopy;
+		}
+		
+	STR_SWITCH_END()
+
+	return copyToSelf;
+	}	
+
+
+/**
+ConvertDesToTPop3GetMailOptions()
+Returns the corresponding TPop3GetMailOptions Enumeration
+
+@param aPop3MailOption
+@return
+TPop3GetMailOptions 
+*/
+EXPORT_C TPop3GetMailOptions CT_MsgUtilsEnumConverter::ConvertDesToTPop3GetMailOptions(TDesC& aPop3MailOption)
+	{
+	TPop3GetMailOptions popMailOption;
+
+	STR_SWITCH(aPop3MailOption)
+		
+	STR_CASE(KStrEGetPop3EmailMessages)
+		{
+		popMailOption = EGetPop3EmailMessages;
+		break;
+		}
+	DEFAULT_CASE()
+		{
+		popMailOption = EGetPop3EmailHeaders;
+		}
+		
+	STR_SWITCH_END()
+
+	return popMailOption;
+	}
+
+
+/**
+ConvertDesToEventCode()
+Returns the corresponding TInstrumentationPoint Enumeration
+
+@param aEventCodeString
+@return
+TInstrumentationPoint 
+*/
+EXPORT_C TInstrumentationPoint CT_MsgUtilsEnumConverter::ConvertDesToEventCode(TDesC& aEventCodeString)
+	{
+	TInstrumentationPoint eventCode;
+
+	STR_SWITCH(aEventCodeString)
+		
+	STR_CASE(KStrImapRamUsageStart)
+		{
+		eventCode = EImapRamUsageStart;
+		break;
+		}
+	STR_CASE(KStrImapRamUsageStop)
+		{
+		eventCode = EImapRamUsageStop;
+		break;
+		}
+	STR_CASE(KStrPopRamUsageStart)
+		{
+		eventCode = EPopRamUsageStart;
+		break;
+		}
+	STR_CASE(KStrPopRamUsageStop)
+		{
+		eventCode = EPopRamUsageStop;
+		break;
+		}
+	STR_CASE(KStrSmtpRamUsageStart)
+		{
+		eventCode = ESmtpRamUsageStart;
+		break;
+		}
+	STR_CASE(KStrSmtpRamUsageStop)
+		{
+		eventCode = ESmtpRamUsageStop;
+		break;
+		}
+	STR_CASE(KStrSmtpRamUsageCreateMessageStart)
+		{
+		eventCode = ESmtpRamUsageCreateMessageStart;
+		break;
+		}
+	STR_CASE(KStrSmtpRamUsageCreateMessageStop)
+		{
+		eventCode = ESmtpRamUsageCreateMessageStop;
+		break;
+		}
+	STR_CASE(KStrSmtpRamUsageSendMessageStart)
+		{
+		eventCode = ESmtpRamUsageSendMessageStart;
+		break;
+		}
+	STR_CASE(KStrSmtpRamUsageSendMessageStop)
+		{
+		eventCode = ESmtpRamUsageSendMessageStop;
+		break;
+		}
+	STR_CASE(KStrSmtpCreateMessageSpeedStart)
+		{
+		eventCode = ESmtpCreateMessageSpeedStart;
+		break;
+		}
+	STR_CASE(KStrSmtpCreateMessageSpeedStop)
+		{
+		eventCode = ESmtpCreateMessageSpeedStop;
+		break;
+		}
+	STR_CASE(KStrSmtpSendMessageSpeedStart)
+		{
+		eventCode = ESmtpSendMessageSpeedStart;
+		break;
+		}
+	STR_CASE(KStrSmtpSendMessageSpeedStop)
+		{
+		eventCode = ESmtpSendMessageSpeedStop;
+		break;
+		}
+	STR_CASE(KStrImapDownloadMessageSpeedStart)
+		{
+		eventCode = EImapDownloadMessageSpeedStart;
+		break;
+		}
+	STR_CASE(KStrImapDownloadMessageSpeedStop)
+		{
+		eventCode = EImapDownloadMessageSpeedStop;
+		break;
+		}
+		
+	DEFAULT_CASE()
+		{
+		eventCode = EBadEventCode;
+		}
+		
+	STR_SWITCH_END()
+
+	return eventCode;
+	}
+
+/**
+ConvertDesToBearerTypes()
+Returns the corresponding TUint32 representing bearer types
+
+@param aBearerTypesString Bearer types string
+@return Bearer types enum
+*/
+EXPORT_C TUint32 CT_MsgUtilsEnumConverter::ConvertDesToBearerTypes(const TDesC& aBearerTypesString)
+	{
+	TUint32 bearerTypes;
+
+	STR_SWITCH(aBearerTypesString)
+
+	STR_CASE(KStrBearerTypeUnknown)
+		{
+		bearerTypes = KCommDbBearerUnknown;
+		break;
+		}
+
+	STR_CASE(KStrBearerTypeCsd)
+		{
+		bearerTypes = KCommDbBearerCSD;
+		break;
+		}
+
+	STR_CASE(KStrBearerTypeWcdma)
+		{
+		bearerTypes = KCommDbBearerWcdma;
+		break;
+		}
+
+	STR_CASE(KStrBearerTypeLan)
+		{
+		bearerTypes = KCommDbBearerLAN;
+		break;
+		}
+
+	STR_CASE(KStrBearerTypeCdma2000)
+		{
+		bearerTypes = KCommDbBearerCdma2000;
+		break;
+		}
+
+	STR_CASE(KStrBearerTypeVirtual)
+		{
+		bearerTypes = KCommDbBearerVirtual;
+		break;
+		}
+
+	STR_CASE(KStrBearerTypePan)
+		{
+		bearerTypes = KCommDbBearerPAN;
+		break;
+		}
+
+	STR_CASE(KStrBearerTypeWlan)
+		{
+		bearerTypes = KCommDbBearerWLAN;
+		break;
+		}
+
+	STR_CASE(KStrBearerTypePsd)
+		{
+		bearerTypes = KCommDbBearerPSD;
+		break;
+		}
+
+	STR_CASE(KStrBearerTypeCsdLan)
+		{
+		bearerTypes = KCommDbBearerCSD | KCommDbBearerLAN;
+		break;
+		}
+
+	DEFAULT_CASE()
+		{
+		bearerTypes = KCommDbBearerUnknown;
+		}
+		
+	STR_SWITCH_END()
+
+	return bearerTypes;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/testutils/src/T_UtilsReadEmailSettingsFromConfigFile.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,999 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Utility functions for reading the config/setting file to update
+// the CImImap4Settings, CImPop3Settings, CImSmtpSettings and CImIAPPreferences objects.
+// 
+//
+
+
+// User include
+#include <t_utilsenumconverter.h>
+#include <t_utilsconfigfileparserutility.h>
+#include <t_utilsconfigfilemachinename.h>
+#include <t_utilsreademailsettingsfromconfigfile.h>
+
+// epoc inlcude
+#include <f32file.h>
+#include <cdbcols.h>
+#include <imapset.h>
+#include <smtpset.h>
+#include <iapprefs.h>
+
+// Literals used
+
+// Imap Settings related literals
+_LIT(KCfgImapServerAddress, "ImapServerAddress"); 
+_LIT(KCfgImapLoginName, "ImapLoginName"); 
+_LIT(KCfgImapPassword, "ImapPassword");
+_LIT(KCfgImapPort, "ImapPort"); 
+_LIT(KCfgImapSecureSockets, "ImapSecureSockets");
+_LIT(KCfgImapSSLWrapper, "ImapSSLWrapper");
+_LIT(KCfgImapFolderPath, "ImapFolderPath");
+_LIT(KCfgImapPathSeperator, "ImapPathSeperator");
+_LIT(KCfgImapMaxEmailSize, "ImapMaxEmailSize");
+_LIT(KCfgImapGetMailOptions, "ImapGetMailOptions");
+_LIT(KCfgImapInboxSynchronisationLimit, "ImapInboxSynchronisationLimit");
+_LIT(KCfgImapMailboxSynchronisationLimit, "ImapMailSynchronisationLimit");
+_LIT(KUseExpunge , "ImapUseExpunge" );
+_LIT(KCfgImapAutoSendOnConnect, "ImapAutoSendOnConnect" );
+_LIT(KCfgImapDeleteEmailsWhenDisconnecting, "ImapDeleteEmailsWhenDisconnecting" );
+_LIT(KCfgImapAcknowledgeReceipts, "ImapAcknowledgeReceipts" );
+_LIT(KCfgImapDisconnectedUserMode, "ImapDisconnectedUserMode" );
+_LIT(KCfgImapSynchronise, "ImapSynchronise" );
+_LIT(KCfgImapSubscribe, "ImapSubscribe" );
+_LIT(KCfgImapUpdatingSeenFlags, "ImapUpdatingSeenFlags" );
+_LIT(KCfgImapSyncRate, "ImapSyncRate" );
+_LIT(KCfgImapFetchSize, "ImapFetchSize" );
+_LIT(KCfgImapIdle, "ImapIdle" );
+_LIT(KCfgImapIdleTimeout, "ImapIdleTimeout" );
+_LIT(KCfgImapPartialMailOptions, "ImapPartialMailOptions" );
+_LIT(KCfgImapBodyTextSizeLimit, "ImapBodyTextSizeLimit" ); 
+_LIT(KCfgImapAttachmentSizeLimit, "ImapAttachmentSizeLimit" );
+
+_LIT(KCfgImapIapList, "ImapIapList");
+_LIT(KCfgImapSNAPId, "ImapSNAPId");
+_LIT(KCfgImapBearerMobility, "ImapBearerMobility");
+_LIT(KCfgImapDownloadRules, "ImapDownloadRules");
+
+//
+// POP Settings related literals
+//
+_LIT(KCfgPopServerAddress, "PopServerAddress");
+_LIT(KCfgPopLoginName, "PopLoginName");
+_LIT(KCfgPopPassword, "PopPassword");
+_LIT(KCfgPopMaxEmailSize, "PopMaxEmailSize");
+_LIT(KCfgPopPort, "PopPort");
+_LIT(KCfgPopInboxSynchronisationLimit, "PopInboxSynchronisationLimit");
+_LIT(KCfgPopSecureSockets, "PopSecureSockets");
+_LIT(KCfgPopSSLWrapper, "PopSSLWrapper");
+_LIT(KCfgPopGetMailOptions, "PopGetMailOptions");
+_LIT(KCfgPopPopulationLimit, "PopPopulationLimit");
+_LIT(KCfgPopAutoSendOnConnect, "PopAutoSendOnConnect" );
+_LIT(KCfgPopDeleteEmailsWhenDisconnecting, "PopDeleteEmailsWhenDisconnecting" );
+_LIT(KCfgPopAcknowledgeReceipts, "PopAcknowledgeReceipts" );
+_LIT(KCfgPopDisconnectedUserMode, "PopDisconnectedUserMode" );
+_LIT(KCfgPopAPOPEncryption, "PopAPOPEncryption" );
+
+_LIT(KCfgPopIapList, "PopIapList");
+_LIT(KCfgPopSNAPId, "PopSNAPId");
+_LIT(KCfgPopBearerMobility, "PopBearerMobility");
+
+//
+// SMTP settings related literals
+//
+_LIT(KCfgSmtpServerAddress, "SmtpServerAddress");
+_LIT(KCfgSmtpEmailAddress, "SmtpEmailAddress");
+_LIT(KCfgSmtpBodyEncoding, "SmtpBodyEncoding");
+_LIT(KCfgSmtpReceiptAddress, "SmtpReceiptAddress");
+_LIT(KCfgSmtpRequestReceipts, "SmtpRequestReceipts");
+_LIT(KCfgSmtpSendMessageOption, "SmtpSendMessageOption");
+_LIT(KCfgSmtpEmailAlias, "SmtpEmailAlias");
+_LIT(KCfgSmtpDefaultMsgCharSet, "SmtpMsgCharSet");
+_LIT(KCfgSmtpSetPort, "SmtpSetPort");
+_LIT(KCfgSmtpSetReplyToAddress, "SmtpSetReplyToAddress");
+_LIT(KCfgSmtpSetAddVCardToEmail, "SmtpSetAddVCardToEmail");
+_LIT(KCfgSmtpSetAddSignatureToEmail, "SmtpSetAddSignatureToEmail");
+_LIT(KCfgSmtpSetSendCopyToSelf, "SmtpSetSendCopyToSelf");
+_LIT(KCfgSmtpSetLoginName, "SmtpSetLoginName");
+_LIT(KCfgSmtpSetPassword, "SmtpSetPassword");
+_LIT(KCfgSmtpSetSMTPAuth, "SmtpSetSMTPAuth");
+_LIT(KCfgSmtpSetInboxLoginDetails, "SmtpSetInboxLoginDetails");
+_LIT(KCfgSmtpSecureSockets, "SmtpSetSecureSockets");
+_LIT(KCfgSmtpSSLWrapper, "SmtpSetSSLWrapper");
+
+_LIT(KCfgSmtpIapList, "SmtpIapList");
+_LIT(KCfgSmtpSNAPId, "SmtpSNAPId");
+_LIT(KCfgSmtpBearerMobility, "SmtpBearerMobility");
+
+// Other Literals
+_LIT(KImapIAPSuffix, "_ImapIAP");
+_LIT(KImapCommDbDialogPref, "_ImapCommDbDialogPref");
+_LIT(KImapIAPIndex, "_ImapIAPIndex");
+_LIT(KPopIAPSuffix, "_PopIAP");
+_LIT(KPopCommDbDialogPref, "_PopCommDbDialogPref");
+_LIT(KPopIAPIndex, "_PopIAPIndex");
+_LIT(KSmtpIAPSuffix, "_SmtpIAP");
+_LIT(KSmtpCommDbDialogPref, "_SmtpCommDbDialogPref");
+_LIT(KSmtpIAPIndex, "_SmtpIAPIndex");
+
+
+/**
+ReadImapSettingsFromConfigurationFileL()
+Modifies the IMAP related default setting and IAP objects.
+
+@param  aSettingsFile
+Configuration/setting file path. 
+
+@param  aImapSet
+CImImap4Settings object.
+
+@param  aImapIapPref
+CImIAPPreferences object.
+*/
+EXPORT_C void CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadImapSettingsFromConfigurationFileL(
+															TDesC& aSettingsFile, CImImap4Settings& aImapSet, CImIAPPreferences& aImapIapPref,const TDesC& /* aPtrEmailAdd */)
+
+	{
+	// Parses the setting file
+	CT_MsgUtilsConfigFileParserUtility* scriptFileParser = CT_MsgUtilsConfigFileParserUtility::NewL(aSettingsFile);
+	CleanupStack::PushL(scriptFileParser);	
+	
+	TPtrC8 string8Ptr; 
+	TPtrC stringPtr = KNone(); 
+	TInt intTmp;
+		
+	if(scriptFileParser->GetFieldAsString(KCfgImapServerAddress, stringPtr) == KErrNone)
+		{
+		aImapSet.SetServerAddressL(stringPtr);
+		}
+
+	CT_MsgUtilsConfigFileMachineName* machineNameFile = CT_MsgUtilsConfigFileMachineName::NewLC(stringPtr);
+	TPtrC8 machineName(machineNameFile->MachineName());
+	
+	if(scriptFileParser->GetFieldAsString8(KCfgImapLoginName, string8Ptr) == KErrNone)
+		{
+		aImapSet.SetLoginNameL(string8Ptr);
+		}
+	else
+		{
+		aImapSet.SetLoginNameL(machineName);
+		}
+
+	if(scriptFileParser->GetFieldAsString8(KCfgImapPassword, string8Ptr) == KErrNone)
+		{
+		aImapSet.SetPasswordL(string8Ptr);
+		}
+	else
+		{
+		aImapSet.SetPasswordL(machineName);
+		}
+	
+	if(scriptFileParser->GetFieldAsInteger(KCfgImapPort, intTmp) == KErrNone)
+		{
+		aImapSet.SetPort(intTmp);
+		}
+
+	if(scriptFileParser->GetFieldAsInteger(KCfgImapSecureSockets, intTmp) == KErrNone)
+		{		
+		aImapSet.SetSecureSockets( (TBool) intTmp );
+		}
+
+	if(scriptFileParser->GetFieldAsInteger(KCfgImapSSLWrapper, intTmp ) == KErrNone)
+		{		
+		aImapSet.SetSSLWrapper( (TBool) intTmp );
+		}
+
+	if(scriptFileParser->GetFieldAsString8(KCfgImapFolderPath, string8Ptr) == KErrNone)
+		{
+		aImapSet.SetFolderPathL(string8Ptr);
+		}
+
+	if(scriptFileParser->GetFieldAsString8(KCfgImapPathSeperator, string8Ptr) == KErrNone)
+		{
+		if ( string8Ptr.Length() == 1  )
+			{
+			aImapSet.SetPathSeparator( string8Ptr[0] );			
+			}
+		}
+
+	if(scriptFileParser->GetFieldAsInteger(KCfgImapMaxEmailSize, intTmp) == KErrNone)
+		{
+		aImapSet.SetMaxEmailSize(intTmp);
+		}
+	
+	if(scriptFileParser->GetFieldAsString(KCfgImapGetMailOptions, stringPtr) == KErrNone)
+		{
+		TImap4GetMailOptions setGetMailOptions = CT_MsgUtilsEnumConverter::ConvertDesToTImap4GetMailOptions(stringPtr);
+		aImapSet.SetGetMailOptions(setGetMailOptions);
+		}
+	
+	if(scriptFileParser->GetFieldAsInteger(KCfgImapInboxSynchronisationLimit, intTmp) == KErrNone)
+		{
+		aImapSet.SetInboxSynchronisationLimit(intTmp);
+		}
+		
+	if(scriptFileParser->GetFieldAsInteger(KCfgImapMailboxSynchronisationLimit, intTmp) == KErrNone)
+		{
+		aImapSet.SetMailboxSynchronisationLimit(intTmp);
+		}
+
+	if(scriptFileParser->GetFieldAsInteger(KCfgImapAutoSendOnConnect, intTmp) == KErrNone)
+		{		
+		aImapSet.SetAutoSendOnConnect((TBool) intTmp);
+		}
+
+	if(scriptFileParser->GetFieldAsInteger(KCfgImapDeleteEmailsWhenDisconnecting, intTmp) == KErrNone)
+		{		
+		aImapSet.SetDeleteEmailsWhenDisconnecting((TBool) intTmp);
+		}
+
+	if(scriptFileParser->GetFieldAsInteger(KCfgImapAcknowledgeReceipts, intTmp) == KErrNone)
+		{		
+		aImapSet.SetAcknowledgeReceipts((TBool) intTmp);
+		}
+
+	if(scriptFileParser->GetFieldAsInteger(KCfgImapDisconnectedUserMode, intTmp) == KErrNone)
+		{		
+		aImapSet.SetDisconnectedUserMode((TBool) intTmp);
+		}
+
+	if(scriptFileParser->GetFieldAsString(KCfgImapSynchronise, stringPtr) == KErrNone)
+		{
+		TFolderSyncType setFolderSyncType = CT_MsgUtilsEnumConverter::ConvertDesToTFolderSyncType(stringPtr);
+		aImapSet.SetSynchronise(setFolderSyncType);
+		}
+
+	if(scriptFileParser->GetFieldAsString(KCfgImapSubscribe, stringPtr) == KErrNone)
+		{
+		TFolderSubscribeType setFolderSubscribeType = CT_MsgUtilsEnumConverter::ConvertDesToTFolderSubscribeType(stringPtr);
+		aImapSet.SetSubscribe(setFolderSubscribeType);
+		}
+
+	if(scriptFileParser->GetFieldAsInteger(KCfgImapUpdatingSeenFlags, intTmp) == KErrNone)
+		{		
+		aImapSet.SetUpdatingSeenFlags((TBool) intTmp);
+		}
+
+	if(scriptFileParser->GetFieldAsInteger(KCfgImapSyncRate, intTmp) == KErrNone)
+		{
+		aImapSet.SetSyncRateL(intTmp);
+		}
+
+	if(scriptFileParser->GetFieldAsInteger(KCfgImapFetchSize, intTmp) == KErrNone)
+		{
+		aImapSet.SetFetchSizeL(intTmp);
+		}
+
+	if(scriptFileParser->GetFieldAsInteger(KCfgImapIdle, intTmp) == KErrNone)
+		{		
+		aImapSet.SetImapIdle( (TBool) intTmp );
+		}
+
+	if(scriptFileParser->GetFieldAsInteger(KCfgImapIdleTimeout, intTmp) == KErrNone)
+		{
+		aImapSet.SetImapIdleTimeoutL(intTmp);
+		}
+
+	if(scriptFileParser->GetFieldAsString(KCfgImapPartialMailOptions, stringPtr) == KErrNone)
+		{
+		TImImap4PartialMailOptions setImap4PartialMailOptions = CT_MsgUtilsEnumConverter::ConvertDesToTImImap4PartialMailOptions(stringPtr);
+		aImapSet.SetPartialMailOptionsL(setImap4PartialMailOptions);
+		}
+
+	if(scriptFileParser->GetFieldAsInteger(KCfgImapBodyTextSizeLimit, intTmp) == KErrNone)
+		{
+		aImapSet.SetBodyTextSizeLimitL(intTmp);
+		}
+
+	if(scriptFileParser->GetFieldAsInteger(KCfgImapAttachmentSizeLimit, intTmp) == KErrNone)
+		{
+		aImapSet.SetAttachmentSizeLimitL(intTmp);
+		}
+
+	if(scriptFileParser->GetFieldAsString(KCfgImapIapList, stringPtr) == KErrNone)
+		{
+		ReadImapIAPAndAddL(scriptFileParser, (TDesC&)KCfgImapIapList, aImapIapPref);
+		}
+	
+	if(scriptFileParser->GetFieldAsInteger(KUseExpunge, intTmp) == KErrNone)
+		{		
+		aImapSet.SetUseExpunge( (TBool) intTmp);
+		}
+	
+	if(scriptFileParser->GetFieldAsInteger(KCfgImapSNAPId, intTmp) == KErrNone)
+		{		
+		aImapIapPref.SetSNAPL(intTmp);
+		}
+		
+	if(scriptFileParser->GetFieldAsInteger(KCfgImapBearerMobility, intTmp) == KErrNone)
+		{		
+		aImapSet.SetBearerMobility((TBool) intTmp);
+		}
+	
+	if(scriptFileParser->GetFieldAsInteger(KCfgImapDownloadRules, intTmp) == KErrNone)
+		{		
+		aImapSet.SetUseSyncDownloadRules((TBool) intTmp);
+		}	
+	
+	CleanupStack::PopAndDestroy(2,scriptFileParser);
+	}
+
+/**
+ReadImapIAPAndAdd()_
+Gets the base string for the IAP list.
+
+@param  aScriptFileParser
+CT_MsgUtilsConfigFileParserUtility object.
+
+@param  aParamListName
+@param  aImapIapPref
+CImIAPPreferences object.
+*/	
+EXPORT_C void CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadImapIAPAndAddL(CT_MsgUtilsConfigFileParserUtility* aScriptFileParser, const TDesC& aParamListName, CImIAPPreferences& aImapIapPref)
+	{
+	TPtrC stringPtr; 	
+	TPtrC baseString; 
+	
+	if( aScriptFileParser->GetFieldAsString(aParamListName, stringPtr ) == KErrNone )
+		{
+		TInt start = 0;
+		TInt end = stringPtr.Length();
+		
+		while (GetString(stringPtr, start, end, baseString))
+			{
+			ReadImapIAPAndAddFieldL(aScriptFileParser, baseString, aImapIapPref);
+			//ReadImapIAPAndAddL(aScriptFileParser, baseString, aImapIapPref);
+			}
+		}		
+	}
+
+/**
+ReadImapIAPAndAddField()
+Modifies the CImIAPPreferences object.
+
+@param  aScriptFileParser
+CT_MsgUtilsConfigFileParserUtility object.
+
+@param  aFieldName 
+@param  aImapIapPref
+CImIAPPreferences object.
+*/
+EXPORT_C void CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadImapIAPAndAddFieldL( 
+										CT_MsgUtilsConfigFileParserUtility* aScriptFileParser, 
+										const TDesC& aFieldName, CImIAPPreferences& aImapIapPref)
+	{
+	
+	TPtrC stringPtr; 
+	TInt intTmp;
+	
+	TImIAPChoice iapChoice;
+	iapChoice.iIAP = 0;
+	iapChoice.iDialogPref = ECommDbDialogPrefUnknown;
+	
+	TInt index = 0;
+	TBool modified = EFalse;
+
+	HBufC* buf = HBufC::NewLC(100);
+			
+	buf->Des() = aFieldName;
+	buf->Des().Append(KImapIAPSuffix);
+			
+	if(aScriptFileParser->GetFieldAsInteger(buf->Des(), intTmp) == KErrNone)
+		{
+		iapChoice.iIAP = intTmp;
+		modified = ETrue;
+		}
+
+	buf->Des() = aFieldName;
+	buf->Des().Append(KImapCommDbDialogPref);
+	
+	if(aScriptFileParser->GetFieldAsString(buf->Des(), stringPtr) == KErrNone)
+		{
+		TCommDbDialogPref setCommDbDialogPref = CT_MsgUtilsEnumConverter::ConvertDesToTCommDbDialogPref(stringPtr);
+		iapChoice.iDialogPref = setCommDbDialogPref;
+		modified = ETrue;
+		}
+	
+	buf->Des() = aFieldName;
+	buf->Des().Append(KImapIAPIndex);
+	if(aScriptFileParser->GetFieldAsInteger(buf->Des(), intTmp) == KErrNone)
+		{
+		index = intTmp;
+		modified = ETrue;
+		}
+	
+	if (modified)
+		{ 
+		aImapIapPref.AddIAPL(iapChoice ,index );
+		}
+
+	CleanupStack::PopAndDestroy(buf);
+	}
+
+
+/**
+GetString()
+
+@param aStringPtr
+@param aStart
+@param aEnd
+@param aBaseString
+@return 
+*/
+EXPORT_C TBool CT_MsgUtilsReadEmailSettingsFromConfigFile::GetString(TDesC& aStringPtr, TInt& aStart, TInt aEnd, TPtrC& aBaseString)
+	{
+	TBool ret = EFalse;
+
+	if (aStart == aEnd)
+		{
+		return EFalse;				
+		}
+	
+	TInt currPos = aStart;
+	
+	// strip out any starting spaces.
+	while (currPos < aEnd )
+		{
+		if (aStringPtr[currPos] == ' ' || aStringPtr[currPos] == '\t')
+			{			
+			currPos++;	
+			}
+		else
+			{			
+			break;	
+			}
+		}
+	TInt startTmp = currPos;
+	//Looking for terminating space or Tab to determine the length of string
+	while (currPos < aEnd )
+		{
+		if (aStringPtr[currPos] == ' ' || aStringPtr[currPos] == '\t')
+			{			
+			break;
+			}
+		else
+			{
+			currPos++;
+			ret = ETrue;
+			}
+		}
+	
+	if (ret)
+		{	// We have a string.
+		aBaseString.Set(aStringPtr.Mid( startTmp, currPos - startTmp)); 
+		}
+		
+	aStart = currPos;
+	return ret;
+	}
+
+/**
+ReadPopSettingsFromConfigurationFileL()
+Modifies the POP related default setting and IAP objects.
+
+@param  aSettingsFile
+Configuration/setting file path. 
+
+@param  aPopSet
+CImPop3Settings object.
+
+@param  aPopIapPref
+*/
+EXPORT_C void CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadPopSettingsFromConfigurationFileL(TDesC& aSettingsFile, 
+											CImPop3Settings& aPopSet, CImIAPPreferences& aPopIapPref, const TDesC& /*aPtrEmailAdd*/)
+	{
+	// Parses the setting file
+	CT_MsgUtilsConfigFileParserUtility* scriptFileParser = CT_MsgUtilsConfigFileParserUtility::NewL(aSettingsFile);
+	CleanupStack::PushL(scriptFileParser);	
+	
+	TPtrC8 string8Ptr; 
+	TPtrC stringPtr = KNone(); 
+	TInt intValue;
+
+	if(scriptFileParser->GetFieldAsString(KCfgPopServerAddress, stringPtr) == KErrNone)
+		{	
+		aPopSet.SetServerAddressL(stringPtr);
+		}
+
+	CT_MsgUtilsConfigFileMachineName* machineNameFile = CT_MsgUtilsConfigFileMachineName::NewLC(stringPtr);
+	TPtrC8 machineName(machineNameFile->MachineName());
+
+	
+	if(scriptFileParser->GetFieldAsString8(KCfgPopLoginName, string8Ptr) == KErrNone)
+		{
+		aPopSet.SetLoginNameL(string8Ptr);
+		}
+
+	else
+		{
+		aPopSet.SetLoginNameL(machineName);
+		}
+	
+	if(scriptFileParser->GetFieldAsString8(KCfgPopPassword, string8Ptr) == KErrNone)
+		{
+		aPopSet.SetPasswordL(string8Ptr);
+		}
+
+	else
+		{
+		aPopSet.SetPasswordL(machineName);
+		}
+	
+	if(scriptFileParser->GetFieldAsInteger(KCfgPopMaxEmailSize, intValue) == KErrNone)
+		{
+		aPopSet.SetMaxEmailSize(intValue);
+		}
+	
+	if(scriptFileParser->GetFieldAsInteger(KCfgPopPort, intValue) == KErrNone)
+		{
+		aPopSet.SetPort(intValue);
+		}
+	
+	if(scriptFileParser->GetFieldAsInteger(KCfgPopInboxSynchronisationLimit, intValue) == KErrNone)
+		{
+		aPopSet.SetInboxSynchronisationLimit(intValue);
+		}
+	
+	if(scriptFileParser->GetFieldAsInteger(KCfgPopSecureSockets, intValue) == KErrNone)
+		{
+		aPopSet.SetSecureSockets((TBool)intValue);
+		}
+	
+	if(scriptFileParser->GetFieldAsInteger(KCfgPopSSLWrapper, intValue) == KErrNone)
+		{
+		aPopSet.SetSSLWrapper((TBool)intValue);
+		}
+	
+	if(scriptFileParser->GetFieldAsString(KCfgPopGetMailOptions, stringPtr) == KErrNone)
+		{
+		TPop3GetMailOptions options = CT_MsgUtilsEnumConverter::ConvertDesToTPop3GetMailOptions(stringPtr);
+		aPopSet.SetGetMailOptions(options);
+		}
+	
+	if(scriptFileParser->GetFieldAsInteger(KCfgPopPopulationLimit, intValue) == KErrNone)
+		{
+		aPopSet.SetPopulationLimitL(intValue);
+		}
+	
+	if(scriptFileParser->GetFieldAsInteger(KCfgPopAutoSendOnConnect, intValue) == KErrNone)
+		{	
+		aPopSet.SetAutoSendOnConnect((TBool) intValue);
+		}
+	
+	if(scriptFileParser->GetFieldAsInteger(KCfgPopDeleteEmailsWhenDisconnecting, intValue) == KErrNone)
+		{	
+		aPopSet.SetDeleteEmailsWhenDisconnecting((TBool) intValue);
+		}
+	
+	if(scriptFileParser->GetFieldAsInteger(KCfgPopAcknowledgeReceipts, intValue) == KErrNone)
+		{	
+		aPopSet.SetAcknowledgeReceipts((TBool) intValue);
+		}
+	
+	if(scriptFileParser->GetFieldAsInteger(KCfgPopDisconnectedUserMode, intValue) == KErrNone)
+		{	
+		aPopSet.SetDisconnectedUserMode((TBool) intValue);
+		}
+	
+	if(scriptFileParser->GetFieldAsInteger(KCfgPopAPOPEncryption, intValue) == KErrNone)
+		{	
+		aPopSet.SetApop((TBool) intValue);
+		}
+		
+	if(scriptFileParser->GetFieldAsString(KCfgPopIapList, stringPtr) == KErrNone)
+		{
+		ReadPopIAPAndAddL(scriptFileParser, (TDesC&) KCfgPopIapList, aPopIapPref);
+		}
+		
+	if(scriptFileParser->GetFieldAsInteger(KCfgPopSNAPId, intValue) == KErrNone)
+		{		
+		aPopIapPref.SetSNAPL(intValue);
+		}
+		
+	if(scriptFileParser->GetFieldAsInteger(KCfgPopBearerMobility, intValue) == KErrNone)
+		{	
+		aPopSet.SetBearerMobility((TBool) intValue);
+		}
+		
+	CleanupStack::PopAndDestroy(2,scriptFileParser);
+	}
+
+/**
+*
+ReadPopIAPAndAdd()
+Gets the base string for the IAP list.
+
+@param  aScriptFileParser
+CT_MsgUtilsConfigFileParserUtility object.
+
+@param  aParamListName
+@param  aPopIapPref
+*/	
+EXPORT_C void CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadPopIAPAndAddL( 
+									CT_MsgUtilsConfigFileParserUtility* aScriptFileParser,
+									const TDesC& aParamListName, CImIAPPreferences& aPopIapPref)
+	{
+	TPtrC stringPtr; 	
+	TPtrC baseString; 
+	
+	if( aScriptFileParser->GetFieldAsString(aParamListName, stringPtr) == KErrNone )
+		{
+		TInt start = 0;
+		TInt end = stringPtr.Length();
+		
+		while (GetString(stringPtr, start, end, baseString))
+			{
+			ReadPopIAPAndAddFieldL(aScriptFileParser, baseString, aPopIapPref);
+			}
+		}		
+		
+	}
+/**
+ReadPopIAPAndAddField()
+Modifies the CImIAPPreferences object.
+
+@param  aScriptFileParser
+CT_MsgUtilsConfigFileParserUtility object.
+
+@param  aFieldName
+@param  aPopIapPref
+*/	
+EXPORT_C void CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadPopIAPAndAddFieldL( 
+									CT_MsgUtilsConfigFileParserUtility* aScriptFileParser, 
+									const TDesC& aFieldName, CImIAPPreferences& aPopIapPref)
+	{
+	TPtrC stringPtr; 
+	TInt intTmp;
+	
+	TImIAPChoice iapChoice;
+
+	iapChoice.iIAP = 0;
+	iapChoice.iDialogPref = ECommDbDialogPrefUnknown;
+	
+	TInt index = 0;
+	TBool modified = EFalse;
+		
+	HBufC* buf = HBufC::NewLC(100);
+			
+	buf->Des() = aFieldName;
+	buf->Des().Append(KPopIAPSuffix);
+	
+	if(aScriptFileParser->GetFieldAsInteger(buf->Des(), intTmp) == KErrNone)
+		{
+		iapChoice.iIAP = intTmp;
+		modified = ETrue;
+		}
+
+	buf->Des() = aFieldName;
+	buf->Des().Append(KPopCommDbDialogPref);
+	if(aScriptFileParser->GetFieldAsString(buf->Des(), stringPtr) == KErrNone)
+		{
+		TCommDbDialogPref setCommDbDialogPref = CT_MsgUtilsEnumConverter::ConvertDesToTCommDbDialogPref(stringPtr);
+		iapChoice.iDialogPref = setCommDbDialogPref;
+		modified = ETrue;
+		}
+
+	buf->Des() = aFieldName;
+	buf->Des().Append(KPopIAPIndex);
+	if(aScriptFileParser->GetFieldAsInteger(buf->Des(), intTmp) == KErrNone)
+		{
+		index = intTmp;
+		modified = ETrue;
+		}
+	
+	if (modified)
+		{
+		aPopIapPref.AddIAPL(iapChoice ,index);
+		}
+
+	CleanupStack::PopAndDestroy(buf);		
+	}
+
+/**
+ReadSmtpSettingsFromConfigurationFileL()
+Modifies the POP related default setting and IAP objects.
+
+@param  aSettingsFile
+Configuration/setting file path. 
+
+@param  aSmtpSet
+@param  aSmtpIapPref
+*/	
+EXPORT_C void CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadSmtpSettingsFromConfigurationFileL(TDesC& aSettingsFile, 
+										CImSmtpSettings& aSmtpSet, CImIAPPreferences& aSmtpIapPref,const TDesC&/* aPtrEmailAdd*/)
+	{
+	// Parses the setting file
+	CT_MsgUtilsConfigFileParserUtility* scriptFileParser = CT_MsgUtilsConfigFileParserUtility::NewL(aSettingsFile);
+	CleanupStack::PushL(scriptFileParser);	
+	
+	TPtrC8 string8Ptr; 
+	TPtrC stringPtr = KNone(); 
+	TInt intValue;
+
+	if(scriptFileParser->GetFieldAsString(KCfgSmtpServerAddress, stringPtr) == KErrNone)
+		{
+		aSmtpSet.SetServerAddressL(stringPtr);
+		}
+	
+	CT_MsgUtilsConfigFileMachineName* machineNameFile = CT_MsgUtilsConfigFileMachineName::NewLC(stringPtr);
+	TPtrC emailAddr(machineNameFile->MachineNameEmail());
+	TPtrC8 machineName(machineNameFile->MachineName());
+	
+	if(scriptFileParser->GetFieldAsString(KCfgSmtpEmailAddress, stringPtr) == KErrNone)
+		{
+		aSmtpSet.SetEmailAddressL(stringPtr);
+		}
+		
+	else
+		{
+		aSmtpSet.SetEmailAddressL(emailAddr);
+		}
+
+	if(scriptFileParser->GetFieldAsString(KCfgSmtpBodyEncoding, stringPtr) == KErrNone)
+		{
+		TMsgOutboxBodyEncoding setBodyEncoding = CT_MsgUtilsEnumConverter::ConvertDesToTMsgOutboxBodyEncoding(stringPtr);
+		aSmtpSet.SetBodyEncoding(setBodyEncoding);
+		}
+	
+	if(scriptFileParser->GetFieldAsString(KCfgSmtpReceiptAddress, stringPtr) == KErrNone)
+		{
+		aSmtpSet.SetReceiptAddressL(stringPtr);
+		}
+		
+	else
+		{
+		aSmtpSet.SetReceiptAddressL(emailAddr);
+		}
+		
+	if(scriptFileParser->GetFieldAsInteger(KCfgSmtpRequestReceipts, intValue) == KErrNone)
+		{		
+		aSmtpSet.SetRequestReceipts((TBool) intValue);
+		}
+	
+	if(scriptFileParser->GetFieldAsString(KCfgSmtpSendMessageOption, stringPtr) == KErrNone)
+		{
+		TImSMTPSendMessageOption setSendMessageOption = CT_MsgUtilsEnumConverter::ConvertDesToTImSMTPSendMessageOption(stringPtr);
+		aSmtpSet.SetSendMessageOption(setSendMessageOption);
+		}
+	
+	if(scriptFileParser->GetFieldAsInteger(KCfgSmtpSetPort, intValue) == KErrNone)
+		{
+		aSmtpSet.SetPort(intValue);
+		}
+	
+	if(scriptFileParser->GetFieldAsString(KCfgSmtpEmailAlias, stringPtr) == KErrNone)
+		{
+		aSmtpSet.SetEmailAliasL(stringPtr);
+		}
+	
+	if(scriptFileParser->GetFieldAsInteger(KCfgSmtpDefaultMsgCharSet, intValue) == KErrNone)
+		{
+		TUid tmp = { intValue };
+		aSmtpSet.SetDefaultMsgCharSet(tmp);
+		}
+	
+	if(scriptFileParser->GetFieldAsString(KCfgSmtpSetReplyToAddress, stringPtr) == KErrNone)
+		{
+		aSmtpSet.SetReplyToAddressL(stringPtr);
+		}
+		
+	else
+		{
+		aSmtpSet.SetReplyToAddressL(emailAddr);
+		}
+			
+	if(scriptFileParser->GetFieldAsInteger(KCfgSmtpSetAddVCardToEmail, intValue) == KErrNone)
+		{		
+		aSmtpSet.SetAddVCardToEmail((TBool) intValue);
+		}
+	
+	if(scriptFileParser->GetFieldAsInteger(KCfgSmtpSetAddSignatureToEmail, intValue) == KErrNone)
+		{		
+		aSmtpSet.SetAddSignatureToEmail((TBool) intValue);
+		}
+	
+	if(scriptFileParser->GetFieldAsString(KCfgSmtpSetSendCopyToSelf, stringPtr) == KErrNone)
+		{
+		TImSMTPSendCopyToSelf setSMTPSendCopyToSelf = CT_MsgUtilsEnumConverter::ConvertDesToTImSMTPSendCopyToSelf(stringPtr);
+		aSmtpSet.SetSendCopyToSelf(setSMTPSendCopyToSelf);
+		}
+	
+	if(scriptFileParser->GetFieldAsString8(KCfgSmtpSetLoginName, string8Ptr) == KErrNone)
+		{
+		aSmtpSet.SetLoginNameL(string8Ptr);
+		}
+		
+	else
+		{
+		aSmtpSet.SetLoginNameL(machineName);	
+		}
+			
+	if(scriptFileParser->GetFieldAsString8(KCfgSmtpSetPassword, string8Ptr) == KErrNone)
+		{
+		aSmtpSet.SetPasswordL(string8Ptr);
+		}
+
+	else
+		{
+		aSmtpSet.SetPasswordL(machineName);	
+		}
+			
+	if(scriptFileParser->GetFieldAsInteger(KCfgSmtpSetSMTPAuth, intValue) == KErrNone)
+		{		
+		aSmtpSet.SetSMTPAuth((TBool) intValue);
+		}
+
+	if(scriptFileParser->GetFieldAsInteger(KCfgSmtpSetInboxLoginDetails, intValue) == KErrNone)
+		{		
+		aSmtpSet.SetInboxLoginDetails((TBool) intValue);
+		}
+
+	if(scriptFileParser->GetFieldAsInteger(KCfgSmtpSecureSockets, intValue) == KErrNone)
+		{		
+		aSmtpSet.SetSecureSockets((TBool) intValue);
+		}
+	
+	if(scriptFileParser->GetFieldAsInteger(KCfgSmtpSSLWrapper, intValue) == KErrNone)
+		{		
+		aSmtpSet.SetSSLWrapper((TBool) intValue);
+		}
+	
+	if(scriptFileParser->GetFieldAsString(KCfgSmtpIapList, stringPtr) == KErrNone)
+		{
+		ReadSmtpIAPAndAddL(scriptFileParser, KCfgSmtpIapList, aSmtpIapPref);
+		}
+		
+	if(scriptFileParser->GetFieldAsInteger(KCfgSmtpSNAPId, intValue) == KErrNone)
+		{		
+		aSmtpIapPref.SetSNAPL(intValue);
+		}
+	
+	if(scriptFileParser->GetFieldAsInteger(KCfgSmtpBearerMobility, intValue) == KErrNone)
+		{		
+		aSmtpSet.SetBearerMobility((TBool) intValue);
+		}	
+	
+	CleanupStack::PopAndDestroy(2,scriptFileParser);
+	
+	}
+	
+/**
+ReadSmtpIAPAndAdd()
+Gets the base string for the IAP list.
+
+@param  aScriptFileParser
+CT_MsgUtilsConfigFileParserUtility object.
+
+@param  aParamListName
+@param  aSmtpIapPref
+*/	
+EXPORT_C void CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadSmtpIAPAndAddL(
+						CT_MsgUtilsConfigFileParserUtility* aScriptFileParser, 
+						const TDesC& aParamListName, CImIAPPreferences& aSmtpIapPref)
+	{
+	
+	TPtrC stringPtr; 	
+	TPtrC baseString; 
+	
+	if( aScriptFileParser->GetFieldAsString(aParamListName, stringPtr) == KErrNone)
+		{
+		TInt start = 0;
+		TInt end = stringPtr.Length();
+		
+		while (GetString(stringPtr ,start, end, baseString))
+			{
+			ReadSmtpIAPAndAddFieldL(aScriptFileParser, baseString, aSmtpIapPref);
+			}
+		}
+	}
+
+/**
+ReadSmtpIAPAndAddField()
+Modifies the CImIAPPreferences object.
+
+@param  aScriptFileParser
+CT_MsgUtilsConfigFileParserUtility object.
+
+@param  aFieldName
+@param  aSmtpIapPref
+*/	
+EXPORT_C void CT_MsgUtilsReadEmailSettingsFromConfigFile::ReadSmtpIAPAndAddFieldL(
+							CT_MsgUtilsConfigFileParserUtility* aScriptFileParser , 
+							const TDesC& aFieldName, CImIAPPreferences& aSmtpIapPref)
+	{
+	TPtrC stringPtr; 
+	TInt intTmp;
+	
+	TImIAPChoice iapChoice;
+
+	iapChoice.iIAP = 0;
+	iapChoice.iDialogPref = ECommDbDialogPrefUnknown;
+	
+	TInt index = 0;
+	TBool modified = EFalse;
+		
+	HBufC* buf = HBufC::NewLC(100);
+			
+	buf->Des() = aFieldName;
+	buf->Des().Append(KSmtpIAPSuffix);
+	
+	if(aScriptFileParser->GetFieldAsInteger(buf->Des(), intTmp) == KErrNone)
+		{
+		iapChoice.iIAP = intTmp;
+		modified = ETrue;
+		}
+
+	buf->Des() = aFieldName;
+	buf->Des().Append(KSmtpCommDbDialogPref);
+	if(aScriptFileParser->GetFieldAsString(buf->Des(), stringPtr) == KErrNone)
+		{
+		TCommDbDialogPref setCommDbDialogPref = CT_MsgUtilsEnumConverter::ConvertDesToTCommDbDialogPref(stringPtr);
+		iapChoice.iDialogPref = setCommDbDialogPref;
+		modified = ETrue;
+		}
+
+	buf->Des() = aFieldName;
+	buf->Des().Append(KSmtpIAPIndex);
+	if(aScriptFileParser->GetFieldAsInteger(buf->Des(), intTmp) == KErrNone)
+		{
+		index = intTmp;
+		modified = ETrue;
+		}
+	
+	if (modified)
+		{
+		aSmtpIapPref.AddIAPL(iapChoice, index);
+		}
+	CleanupStack::PopAndDestroy(buf);		
+	}
+	
+
+/**
+CompareIapPrefs()
+Compares the IAP preference objects.
+
+@param  aPrefs1
+CImIAPPreferences object.
+
+@param  aPrefs2
+CImIAPPreferences object.
+
+@return
+If the objects are same returns ETrue
+*/
+EXPORT_C TBool CT_MsgUtilsReadEmailSettingsFromConfigFile::CompareIapPrefs(CImIAPPreferences& aPrefs1, CImIAPPreferences& aPrefs2)
+	{
+	// Compare version
+	if (aPrefs1.Version() != aPrefs2.Version())
+		{
+		return EFalse;
+		}	
+	// Compare number of IAPs stored
+	TInt numIAPs1 = aPrefs1.NumberOfIAPs();
+	
+	if (numIAPs1 != aPrefs2.NumberOfIAPs())
+		{
+		return EFalse;
+		}
+	// Compare individual IAPs
+	for (TInt i = 0; i < numIAPs1; i++)
+		{
+		if (aPrefs1.IAPPreference(i).iIAP != aPrefs2.IAPPreference(i).iIAP ||
+			aPrefs1.IAPPreference(i).iDialogPref != aPrefs2.IAPPreference(i).iDialogPref)
+			{
+			return EFalse;
+			}
+		}
+	return ETrue;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/bitgdi/inc/T_DataFbsBitGc.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,88 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#if (!defined __T_DATA_FBS_BIT_GC_H__)
+#define __T_DATA_FBS_BIT_GC_H__
+
+//	User includes
+#include "T_DataBitmapContext.h"
+
+class CT_DataFbsBitGc : public CT_DataBitmapContext
+	{
+public:
+	static CT_DataFbsBitGc*	NewL();
+	
+	~CT_DataFbsBitGc();
+
+	//	CTPData implementation
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+	virtual TAny*	GetObject();
+	virtual void	SetObjectL(TAny* aObject);
+	virtual void	DisownObjectL();
+	void			DestroyData();
+
+	//	CT_DataGraphicsContext implementation
+	virtual CGraphicsContext*	GetGraphicsContext() const;
+
+	//	CT_DataBitmapContext implementation
+	virtual CBitmapContext*		GetBitmapContext() const;
+
+protected:
+	CT_DataFbsBitGc();
+	void	ConstructL();
+
+private:
+	void	DoCmdNewL();
+	void	DoCmdDestructor();
+	void	DoCmdActivateL(const TDesC& aSection);
+	void	DoCmdActivateNoJustAutoUpdateL(const TDesC& aSection);
+	TBool	DoCmdAlphaBlendBitmapsL(const TDesC& aSection);
+	void    DoCmdDrawPolyLineNoEndPointL(const TDesC& aSection);
+	
+	void    DoCmdCancelClipping(const TDesC& aSection);
+	void    DoCmdCopySettingsL(const TDesC& aSection);
+	TBool   DoCmdBitBltL(const TDesC& aSection);
+	
+	void	DoCmdDrawTextL(const TDesC& aSection);
+	void	DoCmdDrawTextVerticalL(const TDesC& aSection);
+	void	DoCmdUpdateJustificationL(const TDesC& aSection);
+	void	DoCmdUpdateJustificationVerticalL(const TDesC& aSection);
+
+	void    DoCmdFadeArea(const TDesC& aSection);
+	void    DoCmdIsBrushPatternUsed(const TDesC& aSection);
+	void    DoCmdIsFontUsed(const TDesC& aSection);
+	void    DoCmdOrientationsAvailable(const TDesC& aSection);
+	void    DoCmdRectDrawnTo(const TDesC& aSection);
+	void    DoCmdResized(const TDesC& aSection);
+    void    DoCmdSetDitherOrigin(const TDesC& aSection);
+    void    DoCmdSetFadeMode(const TDesC& aSection);
+    TBool   DoCmdSetFadingParameters(const TDesC& aSection);
+    void    DoCmdSetOrientation(const TDesC& aSection);
+    void    DoCmdSetShadowMode(const TDesC& aSection);
+    void    DoCmdSetUserDisplayMode(const TDesC& aSection);
+    void    DoCmdShadowArea(const TDesC& aSection);
+    void    DoCmdUseBrushPatternL(const TDesC& aSection);
+    void    DoCmdUseFontL(const TDesC& aSection);
+    void    DoCmdUseFontNoDuplicateL(const TDesC& aSection);
+    void    DoCmdPromptMessageL(const TDesC& aSection);
+protected:
+	/** test step reference*/
+	CFbsBitGc*	iFbsBitGc;
+	  
+	};
+
+#endif /* __T_DATA_FBS_BIT_GC_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/bitgdi/inc/T_DataFbsBitGcBitmap.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,53 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef T_DATAFBSBITGCBITMAP_H_
+#define T_DATAFBSBITGCBITMAP_H_
+
+#include "T_DataFbsBitmap.h"
+
+
+class CT_DataFbsBitGcBitmap : public CT_DataFbsBitmap
+	{
+public:
+	static CT_DataFbsBitGcBitmap* NewL();
+
+	~CT_DataFbsBitGcBitmap();
+
+	virtual TAny*	GetObject();
+	virtual void	SetObjectL(TAny* aAny);
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+	
+protected:
+	CT_DataFbsBitGcBitmap();
+    void ConstructL();
+	virtual CFbsBitmap*	GetFbsBitmap() const;
+	
+private:
+	void DestroyData();
+	void DoCmdDestructor();
+	void DoCmdNewL();
+	void DoCmdAddress(const TDesC& aSection);
+	void DoCmdLockHeap();
+	void DoCmdUnlockHeap();
+private:	
+	CFbsBitGcBitmap* iFbsBitGcBitmap;
+	
+	};
+
+#endif /*T_DATAFBSBITGCBITMAP_H_*/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/bitgdi/inc/T_DataFbsBitGcFont.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,60 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#if (!defined __T_DATA_FBS_BITGC_FONT_H__)
+#define __T_DATA_FBS_BITGC_FONT_H__
+
+//	User includes
+#include "T_DataFbsFont.h"
+
+class CT_DataFbsBitGcFont : public CT_DataFbsFont
+	{
+public:
+	static CT_DataFbsBitGcFont*	NewL();
+	
+	~CT_DataFbsBitGcFont();
+
+	//	CTPData implementation
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+	virtual TAny*	GetObject();
+	virtual void	SetObjectL(TAny* aObject);
+	virtual void	DisownObjectL();
+
+protected:
+	CT_DataFbsBitGcFont();
+	void	ConstructL();
+
+	// CT_DataFont implementation
+	virtual CFont*	GetFont() const;
+	
+	// CT_DataFbsFont implementation
+	virtual CFbsFont* GetFbsFont() const;
+
+private:
+	void	DoCmdNewL();
+	void	DoCmdDestructor();
+	
+	void 	DoCmdAddress();
+	void	DoCmdDuplicate(const TDesC& aSection);
+	void	DoCmdReset();
+
+
+protected:
+	/** test step reference*/
+	CFbsBitGcFont*	iFbsBitGcFont;
+	};
+
+#endif /* __T_DATA_FBS_BITGC_FONT_H__ */
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/bitgdi/inc/T_DataFbsBitmapDevice.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,68 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#if (!defined __T_DATA_FBS_BITMAP_DEVICE_H__)
+#define __T_DATA_FBS_BITMAP_DEVICE_H__
+
+//	User includes
+#include "T_DataFbsDevice.h"
+
+class CT_DataFbsBitmapDevice : public CT_DataFbsDevice
+	{
+public:
+	static CT_DataFbsBitmapDevice*	NewL();
+	
+	~CT_DataFbsBitmapDevice();
+
+	//	CTPData implementation
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+	virtual TAny*	GetObject();
+	virtual void	SetObjectL(TAny* aObject);
+	virtual void	DisownObjectL();
+	void			DestroyData();
+
+protected:
+	CT_DataFbsBitmapDevice();
+	void	ConstructL();
+
+	//	CT_DataGraphicsDeviceMap implementation
+	virtual MGraphicsDeviceMap*	GetGraphicsDeviceMap() const;
+
+	//	CT_DataGraphicsDevice implementation
+	virtual CGraphicsDevice* GetGraphicsDevice() const;
+
+	//	CT_DataBitmapDevice implementation
+	virtual CBitmapDevice*	GetBitmapDevice() const;
+	
+	//	CT_DataFbsDevice implementation
+	virtual CFbsDevice*	GetFbsDevice() const;
+
+private:
+	void	DoCmdNewL(const TDesC& aSection);
+	void	DoCmdDestructor();
+	void	DoCmdDrawingBegin(const TDesC& aSection);
+	void    DoCmdDrawingEnd(const TDesC& aSection);
+	void    DoCmdResize(const TDesC& aSection);
+	void	DoCmdSwapWidthAndHeight();
+
+
+protected:
+	/** test step reference*/
+	CFbsBitmapDevice*	iFbsBitmapDevice;
+	};
+
+#endif /* __T_DATA_FBS_BITMAP_DEVICE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/bitgdi/inc/T_DataFbsDevice.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,56 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#if (!defined __T_DATA_FBS_DEVICE_H__)
+#define __T_DATA_FBS_DEVICE_H__
+
+//	User includes
+#include "DataWrapperBase.h"
+#include "T_DataBitmapDevice.h"
+
+class CT_DataFbsDevice : public CT_DataBitmapDevice
+	{
+public:
+	virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+	CT_DataFbsDevice();
+
+protected:
+	void DoCmdCheckPixels(const TDesC& aSection);
+	void DoCmdCheckLineColor(const TDesC& aSection);
+	void DoCmdCheckRectColor(const TDesC& aSection);
+	void DoCmdGetFontByIdL(const TDesC& aSection);
+	TBool DoCmdGetNearestFontInPixelsL(const TDesC& aSection);
+	TBool DoCmdGetNearestFontInTwipsL(const TDesC& aSection);	
+	TBool DoCmdGetNearestFontToDesignHeightInPixelsL(const TDesC& aSection);
+	TBool DoCmdGetNearestFontToDesignHeightInTwipsL(const TDesC& aSection);	
+	TBool DoCmdGetNearestFontToMaxHeightInPixelsL(const TDesC& aSection);
+	TBool DoCmdGetNearestFontToMaxHeightInTwipsL(const TDesC& aSection);
+	void DoCmdSizeInPixels(const TDesC& aSection);
+
+	TBool	DoCmdCreateContextL(const TDesC& aSection);
+	void	DoCmdRectCompareL(const TDesC& aSection);
+	void	DoCmdSetCustomPaletteL(const TDesC& aSection);
+	void	DoCmdGraphicsAccelerator();
+	void	DoCmdOrientation(const TDesC& aSection);
+	void	DoCmdDisplayMode16M(const TDesC& aSection);
+	void	DoCmdSetScalingFactor(const TDesC& aSection);
+	void	DoCmdGetDrawRect(const TDesC& aSection);
+	void	DoCmdRegisterLinkedTypefaceL(const TDesC& aSection);
+	
+	virtual CFbsDevice*	GetFbsDevice() const = 0;
+	};
+
+#endif /* __T_DATA_FBS_DEVICE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/bitgdi/inc/T_DataFbsScreenDevice.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,74 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#if (!defined __T_DATA_FBS_SCREEN_DEVICE_H__)
+#define __T_DATA_FBS_SCREEN_DEVICE_H__
+
+//	User includes
+#include "T_DataFbsDevice.h"
+
+class CT_DataFbsScreenDevice : public CT_DataFbsDevice
+	{
+public:
+	static CT_DataFbsScreenDevice*	NewL();
+
+	//	CTPData implementation
+	virtual TAny*	GetObject();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+	virtual void SetObjectL(TAny* aAny);
+	~CT_DataFbsScreenDevice();
+	void	DestroyData();
+	virtual void DisownObjectL();
+
+protected:
+	CT_DataFbsScreenDevice();
+	void ConstructL();
+
+	//	CT_DataGraphicsDeviceMap implementation
+	virtual MGraphicsDeviceMap*	GetGraphicsDeviceMap() const;
+
+	//	CT_DataGraphicsDevice implementation
+	virtual CGraphicsDevice*	GetGraphicsDevice() const;
+
+	//	CT_DataBitmapDevice implementation
+	virtual CBitmapDevice*		GetBitmapDevice() const;
+
+	//	CT_DataFbsDevice implementation
+	virtual CFbsDevice*			GetFbsDevice() const;
+
+private:
+	void	DoCmdNew(const TDesC& aSection);
+	void	DoCmdDestructor();
+//	void    DoCmdSizeInTwips();
+	
+	void    DoCmdChangeScreenDeviceL(const TDesC& aSection);
+	void	DoCmdDrawSpriteBegin();
+	void	DoCmdDrawSpriteEnd();
+	void	DoCmdHardwareBitmap();
+	void	DoCmdScreenNo(const TDesC& aSection);
+	void	DoCmdSetAutoUpdate(const TDesC& aSection);
+	void    DoCmdUpdateL(const TDesC& aSection);
+	void	DoCmdCancelSprite();
+	void 	DoCmdHideSpriteL(const TDesC& aSection);
+	void 	DoCmdShowSpriteL(const TDesC& aSection);
+
+	
+protected:
+	/** test step reference*/
+	CFbsScreenDevice*	iFbsScreenDevice;
+	};
+
+#endif /* __T_DATA_FBS_SCREEN_DEVICE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/bitgdi/inc/T_DataPolygonFiller.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,55 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef T_DATAPOLYGONFILLER_H_
+#define T_DATAPOLYGONFILLER_H_
+
+
+#include "DataWrapperBase.h"
+
+
+class CT_DataPolygonFiller : public CDataWrapperBase
+	{
+public:
+	static CT_DataPolygonFiller* NewL();
+
+	~CT_DataPolygonFiller();
+
+	virtual TAny*	GetObject();
+	virtual void	SetObjectL(TAny* aAny);
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt);
+	//void RunL(CActive* aActive, TInt aIndex); 
+	
+protected:
+	CT_DataPolygonFiller();
+    void ConstructL();
+	
+private:
+	void DestroyData();
+	void DoCmdnewL();
+	void DoCmdConstructL(const TDesC& aSection);
+	void DoCmdReset();
+	void DoCmdGetNextPixelRun(const TDesC& aSection);
+	void DoCmdGetNextPixelRunOnSpecifiedScanLine(const TDesC& aSection);
+	void DoCmdDestructor();
+private:
+	CPolygonFiller* iPolygonFiller;
+	CArrayFix<TPoint>*	iPointsArray;
+	TPoint* iPoints;
+	};
+
+#endif /*T_DATAPOLYGONFILLER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/bitgdi/inc/T_GraphicsBitgdiAPIServer.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,46 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#if (!defined __T_GRAPHICS_BITGDI_API_SERVER_H__)
+#define __T_GRAPHICS_BITGDI_API_SERVER_H__
+
+//	User Include
+#include "TestServerBase.h"
+
+class CT_GraphicsBitgdiAPIServer : public CTestServerBase
+	{
+private:
+	class CT_GraphicsBitgdiAPIBlock : public CTestBlockController
+		{
+	public:
+		inline CT_GraphicsBitgdiAPIBlock();
+		inline ~CT_GraphicsBitgdiAPIBlock();
+
+		CDataWrapper*	CreateDataL(const TDesC& aData);
+		};
+
+public:
+	inline CT_GraphicsBitgdiAPIServer();
+	inline ~CT_GraphicsBitgdiAPIServer();
+
+	static CT_GraphicsBitgdiAPIServer* NewL();
+
+	inline CTestBlockController*	CreateTestBlock();
+	};
+
+#include "T_GraphicsBitgdiAPIServer.inl"
+
+#endif /* __T_GRAPHICS_BITGDI_API_SERVER_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/bitgdi/inc/T_GraphicsBitgdiAPIServer.inl	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,39 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+/*@{*/
+/*@}*/
+
+inline CT_GraphicsBitgdiAPIServer::CT_GraphicsBitgdiAPIBlock::CT_GraphicsBitgdiAPIBlock()
+	{
+	}
+
+inline CT_GraphicsBitgdiAPIServer::CT_GraphicsBitgdiAPIBlock::~CT_GraphicsBitgdiAPIBlock()
+	{
+	}
+
+inline CT_GraphicsBitgdiAPIServer::CT_GraphicsBitgdiAPIServer()
+	{
+	}
+
+inline CT_GraphicsBitgdiAPIServer::~CT_GraphicsBitgdiAPIServer()
+	{
+	}
+
+inline CTestBlockController*	CT_GraphicsBitgdiAPIServer::CreateTestBlock()
+	{
+	return new CT_GraphicsBitgdiAPIBlock();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/bitgdi/src/T_DataFbsBitGc.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1113 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+#include <e32cmn.h>
+#include <e32property.h>
+#include "T_DataFbsBitGc.h"
+#include "T_GraphicsUtil.h"
+
+/*@{*/
+///	Commands
+_LIT(KCmdNewL,						"NewL");
+_LIT(KCmdDestructor,				"~");
+_LIT(KCmdActivate,					"Activate");
+_LIT(KCmdActivateNoJustAutoUpdate,	"ActivateNoJustAutoUpdate");
+_LIT(KCmdAlphaBlendBitmaps,			"AlphaBlendBitmaps");
+_LIT(KCmdDisown,                    "disown");
+_LIT(KCmdDrawPolyLineNoEndPoint,    "DrawPolyLineNoEndPoint");
+
+_LIT(KCmdCancelClipping,            "CancelClipping");
+_LIT(KCmdCopySettings,              "CopySettings");
+_LIT(KCmdBitBlt,                    "BitBlt");
+
+_LIT(KCmdDrawText,					"DrawText");
+_LIT(KCmdDrawTextVertical,			"DrawTextVertical");
+_LIT(KCmdUpdateJustification,		"UpdateJustification");
+_LIT(KCmdUpdateJustificationVertical,"UpdateJustificationVertical");
+
+_LIT(KCmdFadeArea,                   "FadeArea");
+_LIT(KCmdIsBrushPatternUsed,         "IsBrushPatternUsed");
+_LIT(KCmdIsFontUsed,                 "IsFontUsed");
+_LIT(KCmdOrientationsAvailable,      "OrientationsAvailable");
+_LIT(KCmdRectDrawnTo,                "RectDrawnTo");
+_LIT(KCmdResized,                    "Resized");
+_LIT(KCmdSetDitherOrigin,            "SetDitherOrigin");
+_LIT(KCmdSetFadeMode,                "SetFadeMode");
+_LIT(KCmdSetFadingParameters,        "SetFadingParameters");
+_LIT(KCmdSetOrientation,             "SetOrientation");
+_LIT(KCmdSetShadowMode,              "SetShadowMode");
+_LIT(KCmdSetUserDisplayMode,         "SetUserDisplayMode");
+_LIT(KCmdShadowArea,                 "ShadowArea");
+_LIT(KCmdUseBrushPattern,            "UseBrushPattern");
+_LIT(KCmdUseFont,                    "UseFont");
+_LIT(KCmdUseFontNoDuplicate,         "UseFontNoDuplicate");
+_LIT(KCmdGetAvailableOrientation,    "GetAvailableOrientation");
+_LIT(KCmdPromptMessage,				 "PromptMessage");
+///	Fields
+_LIT(KFldAlphaBmp,					"alphabmp");
+_LIT(KFldAlphaPt,					"alphapt");
+_LIT(KFldDestPt,					"destpt");
+_LIT(KFldDevice,					"device");
+_LIT(KFldSrcBmp1,					"srcbmp1");
+_LIT(KFldSrcBmp2,					"srcbmp2");
+_LIT(KFldSrcPt,						"srcpt");
+_LIT(KFldSrcRect,					"srcrect");
+_LIT(KFldNumPoints,					"numpoints");
+_LIT(KFldPointList,					"pointlist");
+
+_LIT(KFldFbsBitGc,                  "fbsBitGc");
+_LIT(KFldPoint,                     "point");
+
+_LIT(KFldRect,						"rect");
+_LIT(KFldTextAlign,					"textalign");
+_LIT(KFldText,						"text");
+_LIT(KFldLeftMargin,				"leftmargin");
+_LIT(KFldBaselineOffset,			"baselineoffset");
+_LIT(KFldTextWidth,					"textwidth");
+_LIT(KFldUp,						"up");
+_LIT(KFldParam,						"param");
+
+_LIT(KFldRegion,					"region");
+_LIT(KFldFadeMode,                  "fademode");
+_LIT(KFldBlackMap,					"blackmap");
+_LIT(KFldWhiteMap,					"whitemap");
+_LIT(KFldGraphicsOrientation,       "orientation");
+_LIT(KFldShadowMode,                "shadowmode");
+_LIT(KFldDisplayMode,               "displaymode");
+_LIT(KFldHandle,                    "handle");
+_LIT(KFldFont,                      "font");
+_LIT(KFldBitmap,					"bitmap");
+_LIT(KFldUseHandle,					"usehandle");
+_LIT(KFldPromptText,				"message");
+_LIT(KFldExpectedKey,				"keyCode");
+
+_LIT(KFldExpect,                    "expect");
+_LIT(KFormatFieldNumber,	        "Orientation_%d=%d");
+///	Logging
+_LIT(KLogError,						"Error=%d");
+_LIT(KLogMissingParameter,			"Missing parameter '%S'");
+_LIT(KLogNotExpectedValue,			"Not expected value,get %d, expectd %d");
+/*@}*/
+_LIT(KPromptProcess,				"t_prompt.exe");
+
+
+/**
+* Two phase constructor
+*/
+CT_DataFbsBitGc* CT_DataFbsBitGc::NewL()
+	{
+	CT_DataFbsBitGc*	ret=new (ELeave) CT_DataFbsBitGc();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+/**
+* Protected constructor. First phase construction
+*/
+CT_DataFbsBitGc::CT_DataFbsBitGc()
+:	CT_DataBitmapContext()
+,	iFbsBitGc(NULL)
+	{
+	}
+
+/**
+* Protected second phase construction
+*/
+void CT_DataFbsBitGc::ConstructL()
+	{
+	
+	}
+
+/**
+* Destructor.
+*/
+CT_DataFbsBitGc::~CT_DataFbsBitGc()
+	{
+
+	DestroyData();
+	}
+
+void CT_DataFbsBitGc::SetObjectL(TAny* aAny)
+	{
+	DestroyData();
+	iFbsBitGc	= static_cast<CFbsBitGc*> (aAny);
+	}
+
+void CT_DataFbsBitGc::DisownObjectL()
+	{
+	iFbsBitGc = NULL;
+	}
+
+void CT_DataFbsBitGc::DestroyData()
+	{
+	delete iFbsBitGc;
+	iFbsBitGc=NULL;
+	}
+
+/**
+* Return a pointer to the object that the data wraps
+*
+* @return pointer to the object that the data wraps
+*/
+TAny* CT_DataFbsBitGc::GetObject()
+	{
+	return iFbsBitGc;
+	}
+
+//	CT_DataBitmapContext implementation
+CBitmapContext* CT_DataFbsBitGc::GetBitmapContext() const
+	{
+	return iFbsBitGc;
+	}
+
+//	CT_DataGraphicsContext implementation
+CGraphicsContext* CT_DataFbsBitGc::GetGraphicsContext() const
+	{
+	return iFbsBitGc;
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataFbsBitGc::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	/* Another work package will complete the implement of this */
+	TBool	ret = ETrue;
+
+	if ( aCommand==KCmdNewL )
+		{
+		DoCmdNewL();
+		}
+	else if ( aCommand==KCmdDestructor )
+		{
+		DoCmdDestructor();
+		}
+	else if ( aCommand==KCmdActivate )
+		{
+		DoCmdActivateL(aSection);
+		}
+	else if ( aCommand == KCmdDisown )
+		{
+		DisownObjectL();
+		}
+	else if ( aCommand==KCmdActivateNoJustAutoUpdate )
+		{
+		DoCmdActivateNoJustAutoUpdateL(aSection);
+		}
+	else if ( aCommand==KCmdAlphaBlendBitmaps )
+		{
+		if ( !DoCmdAlphaBlendBitmapsL(aSection) )
+			{
+			ret=CT_DataBitmapContext::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+			}
+		}
+	else if ( aCommand==KCmdDrawPolyLineNoEndPoint )
+		{
+		DoCmdDrawPolyLineNoEndPointL(aSection);
+		}
+	else if ( aCommand==KCmdCancelClipping)
+		{
+		DoCmdCancelClipping(aSection);
+		}
+	else if ( aCommand==KCmdCopySettings)
+		{
+		DoCmdCopySettingsL(aSection);
+		}
+	else if ( aCommand==KCmdBitBlt)
+		{
+		if(!DoCmdBitBltL(aSection))
+			{
+			ret=CT_DataBitmapContext::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+			}
+		}
+	else if(aCommand==KCmdDrawText)
+		{
+		DoCmdDrawTextL(aSection);
+		}
+	else if(aCommand==KCmdDrawTextVertical)
+		{
+		DoCmdDrawTextVerticalL(aSection);
+		}
+	else if(aCommand==KCmdUpdateJustification)
+		{
+		DoCmdUpdateJustificationL(aSection);
+		}
+	else if(aCommand==KCmdUpdateJustificationVertical)
+		{
+		DoCmdUpdateJustificationVerticalL(aSection);
+		}
+	else if(aCommand==KCmdFadeArea)
+		{
+		DoCmdFadeArea(aSection);
+		}
+	else if(aCommand==KCmdIsBrushPatternUsed)
+		{
+		DoCmdIsBrushPatternUsed(aSection);
+		}
+	else if(aCommand==KCmdIsFontUsed)
+		{
+		DoCmdIsFontUsed(aSection);
+		}
+	else if(aCommand==KCmdOrientationsAvailable)
+		{
+		DoCmdOrientationsAvailable(aSection);
+		}
+	else if(aCommand==KCmdRectDrawnTo)
+		{
+		DoCmdRectDrawnTo(aSection);
+		}
+	else if(aCommand==KCmdResized)
+		{
+		DoCmdResized(aSection);
+		}
+	else if(aCommand==KCmdSetDitherOrigin)
+		{
+		DoCmdSetDitherOrigin(aSection);
+		}
+	else if(aCommand==KCmdSetFadeMode)
+		{
+		DoCmdSetFadeMode(aSection);
+		}
+	else if(aCommand==KCmdSetFadingParameters)
+		{
+		if(!DoCmdSetFadingParameters(aSection))
+			{
+			ret=CT_DataBitmapContext::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+			}
+		}
+	else if(aCommand==KCmdSetOrientation)
+		{
+		DoCmdSetOrientation(aSection);
+		}
+	else if(aCommand==KCmdSetShadowMode)
+		{
+		DoCmdSetShadowMode(aSection);
+		}
+	else if(aCommand==KCmdSetUserDisplayMode)
+		{
+		DoCmdSetUserDisplayMode(aSection);
+		}
+	else if(aCommand==KCmdShadowArea)
+		{
+		DoCmdShadowArea(aSection);
+		}
+	else if(aCommand==KCmdUseBrushPattern)
+		{
+		DoCmdUseBrushPatternL(aSection);
+		}
+	else if(aCommand==KCmdUseFont)
+		{
+		DoCmdUseFontL(aSection);
+		}
+	else if(aCommand==KCmdUseFontNoDuplicate)
+		{
+		DoCmdUseFontNoDuplicateL(aSection);
+		}
+	else if(aCommand==KCmdPromptMessage)
+		{
+		DoCmdPromptMessageL(aSection);
+		}
+	else
+		{
+		ret=CT_DataBitmapContext::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+
+	return ret;
+	}
+
+void CT_DataFbsBitGc::DoCmdNewL()
+	{
+	DestroyData();
+
+	INFO_PRINTF1(_L("execute CFbsBitGc::NewL"));
+	TRAPD( err, iFbsBitGc = CFbsBitGc::NewL() );
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+void CT_DataFbsBitGc::DoCmdDestructor()
+	{
+	DestroyData();
+	}
+
+void CT_DataFbsBitGc::DoCmdActivateL(const TDesC& aSection)
+	{
+	CFbsDevice*	device=NULL;
+	if ( !CT_GraphicsUtil::GetFbsDeviceL(*this, aSection, KFldDevice, device) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldDevice());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute Activate(CFbsDevice*)"));
+		iFbsBitGc->Activate(device);
+		}
+	}
+
+void CT_DataFbsBitGc::DoCmdActivateNoJustAutoUpdateL(const TDesC& aSection)
+	{
+	CFbsDevice*	device=NULL;
+	if ( !CT_GraphicsUtil::GetFbsDeviceL(*this, aSection, KFldDevice, device) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldDevice());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute ActivateNoJustAutoUpdate(CFbsDevice*)"));
+		iFbsBitGc->ActivateNoJustAutoUpdate(device);
+		}
+	}
+
+TBool CT_DataFbsBitGc::DoCmdAlphaBlendBitmapsL(const TDesC& aSection)
+	{
+	CFbsBitmap*	fbsBitmap1=NULL;
+	TBool		ret=CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFldSrcBmp1, fbsBitmap1);
+	if ( ret )
+		{
+		TBool		dataOk=ETrue;
+
+		CFbsBitmap*	fbsBitmap2=NULL;
+		if ( !CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFldSrcBmp2, fbsBitmap2) )
+			{
+			dataOk=EFalse;
+			ERR_PRINTF2(KLogMissingParameter, &KFldSrcBmp2());
+			SetBlockResult(EFail);
+			}
+
+		CFbsBitmap*	alphaBitmap=NULL;
+		if ( !CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFldAlphaBmp, alphaBitmap) )
+			{
+			dataOk=EFalse;
+			ERR_PRINTF2(KLogMissingParameter, &KFldAlphaBmp());
+			SetBlockResult(EFail);
+			}
+
+		TPoint	destinationPoint;
+		if ( !GetPointFromConfig(aSection, KFldDestPt, destinationPoint) )
+			{
+			dataOk=EFalse;
+			ERR_PRINTF2(KLogMissingParameter, &KFldDestPt());
+			SetBlockResult(EFail);
+			}
+
+		TRect	sourceRect;
+		if ( !GetRectFromConfig(aSection, KFldSrcRect, sourceRect) )
+			{
+			dataOk=EFalse;
+			ERR_PRINTF2(KLogMissingParameter, &KFldSrcRect());
+			SetBlockResult(EFail);
+			}
+
+		TPoint	sourcePoint;
+		if ( !GetPointFromConfig(aSection, KFldSrcPt, sourcePoint) )
+			{
+			dataOk=EFalse;
+			ERR_PRINTF2(KLogMissingParameter, &KFldSrcPt());
+			SetBlockResult(EFail);
+			}
+
+		TPoint	alphaPoint;
+		if ( !GetPointFromConfig(aSection, KFldAlphaPt, alphaPoint) )
+			{
+			dataOk=EFalse;
+			ERR_PRINTF2(KLogMissingParameter, &KFldAlphaPt());
+			SetBlockResult(EFail);
+			}
+
+		if ( dataOk )
+			{
+			INFO_PRINTF1(_L("execute AlphaBlendBitmaps(const TPoint&,const CFbsBitmap*,const CFbsBitmap*,const TRect&,const TPoint&,const CFbsBitmap*,const TPoint&"));
+			TInt	err=iFbsBitGc->AlphaBlendBitmaps(destinationPoint, fbsBitmap1, fbsBitmap2, sourceRect, sourcePoint, alphaBitmap, alphaPoint);
+			if ( err!=KErrNone )
+				{
+				ERR_PRINTF2(KLogError, err);
+				SetError(err);
+				}
+			}
+		}
+
+	return ret;
+	}
+
+void CT_DataFbsBitGc::DoCmdDrawPolyLineNoEndPointL(const TDesC& aSection)
+	{
+	TInt	datNumPoints;
+	if ( GetIntFromConfig(aSection, KFldNumPoints, datNumPoints) )
+		{
+		TPoint*	points=new (ELeave) TPoint[datNumPoints];
+		
+		if ( !GetPointListFromConfig(aSection, KFldPointList, datNumPoints, points) )
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KFldPointList());
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			// Execute command and log parameters
+			INFO_PRINTF1(_L("execute DrawPolyLineNoEndPoint(TPoint*, TInt)"));
+			iFbsBitGc->DrawPolyLineNoEndPoint(points, datNumPoints);
+			}
+		delete [] points;
+		}
+	else
+		{
+		CArrayFix<TPoint>*	points=new (ELeave) CArrayFixFlat<TPoint>(1);
+		CleanupStack::PushL(points);
+		TBool	hasPointList=GetPointListFromConfigL(aSection, KFldPointList, *points);
+
+		if ( !hasPointList )
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KFldPointList());
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			// Execute command and log parameters
+			INFO_PRINTF1(_L("execute DrawPolyLineNoEndPoint(CArrayFix<TPoint>*)"));
+			iFbsBitGc->DrawPolyLineNoEndPoint(points);
+			}
+		CleanupStack::PopAndDestroy(points);
+		}
+	}
+
+void CT_DataFbsBitGc::DoCmdCancelClipping(const TDesC& /*aSection*/)
+	{
+	INFO_PRINTF1(_L("execute CancelClipping()"));
+	iFbsBitGc->CancelClipping();
+	}
+
+void CT_DataFbsBitGc::DoCmdCopySettingsL(const TDesC& aSection)
+	{
+	CFbsBitGc* fbsBitGc=NULL;
+
+	if ( !CT_GraphicsUtil::GetFbsBitGcL(*this, aSection, KFldFbsBitGc, fbsBitGc) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldFbsBitGc());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute CopySettings(CFbsBitGc&)"));
+		iFbsBitGc->CopySettings(*fbsBitGc);
+		}
+	}
+
+TBool CT_DataFbsBitGc::DoCmdBitBltL(const TDesC& aSection)
+	{
+	TBool ret=ETrue;
+	CFbsBitGc* fbsBitGc=NULL;
+	
+	if ( !CT_GraphicsUtil::GetFbsBitGcL(*this, aSection, KFldFbsBitGc, fbsBitGc) )
+		{
+		ret=EFalse;
+		}
+	else
+		{
+		// Execute command and log parameters
+		TPoint	point;
+		if ( !GetPointFromConfig(aSection, KFldPoint, point) )
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KFldPoint());
+			SetBlockResult(EFail);
+			//Case failed, needn't execute other step.
+			return ret;
+			}
+		
+		TRect	sourceRect;
+		if(!GetRectFromConfig(aSection, KFldSrcRect, sourceRect))
+			{
+			INFO_PRINTF1(_L("execute BitBlt(const TPoint&, const CFbsBitGc&)"));
+			iFbsBitGc->BitBlt(point,*fbsBitGc);
+			}
+		else
+			{
+			INFO_PRINTF1(_L("execute BitBlt(const TPoint&, const CFbsBitGc&,const TRect &)"));
+			iFbsBitGc->BitBlt(point,*fbsBitGc,sourceRect);
+			}
+		}
+	
+	return ret;
+	}
+
+void CT_DataFbsBitGc::DoCmdDrawTextL(const TDesC& aSection)
+	{
+	TRect rect;
+	TInt baselineOffset=0;
+	TPtrC text;
+	TInt datTextWidth;
+
+	if ( !GetStringFromConfig(aSection, KFldText(), text) )
+		{
+		ERR_PRINTF2(_L("Missing parameter %S"), &KFldText());
+		SetBlockResult(EFail);
+		return;
+		}
+
+	if (GetRectFromConfig(aSection, KFldRect, rect) )
+		{
+		if (GetIntFromConfig(aSection, KFldBaselineOffset, baselineOffset))
+			{
+			TInt datMargin=0;
+			CGraphicsContext::TTextAlign textAlign=CGraphicsContext::ELeft;
+			CT_GraphicsUtil::ReadTextAlign(*this, aSection, KFldTextAlign,
+					textAlign);
+			if (!GetIntFromConfig(aSection, KFldLeftMargin, datMargin))
+				{
+				INFO_PRINTF1(_L("Using the default value aMargin=0"));
+				}
+
+			if (GetIntFromConfig(aSection, KFldTextWidth, datTextWidth))
+				{
+				INFO_PRINTF1(_L("execute DrawText(const TDesC &,const TRect &,TInt,TInt,TTextAlign,TInt)"));
+				iFbsBitGc->DrawText(text, rect, baselineOffset, datTextWidth,
+						textAlign, datMargin);
+				}
+			else
+				{
+				INFO_PRINTF1(_L("execute DrawText(const TDesC &,const TRect &,TInt,TTextAlign,TInt)"));
+				iFbsBitGc->DrawText(text, rect, baselineOffset, textAlign,
+						datMargin);
+				}
+			}
+		else
+			{
+			INFO_PRINTF1(_L("execute DrawText(const TDesC&,const TRect&)"));
+			iFbsBitGc->DrawText(text, rect);
+			}
+		}
+	else
+		{
+		TPoint point;
+		if (!GetPointFromConfig(aSection, KFldPoint, point))
+			{
+			INFO_PRINTF1(_L("execute DrawText(const TDesC&)"));
+			iFbsBitGc->DrawText(text);
+			}
+		else
+			{
+			INFO_PRINTF1(_L("execute DrawText(const TDesC&,const TPoint&)"));
+			iFbsBitGc->DrawText(text, point);
+			}
+		}
+	}
+
+void CT_DataFbsBitGc::DoCmdDrawTextVerticalL(const TDesC& aSection)
+	{
+	TPtrC text;
+	TInt datTextWidth;
+	TBool up=EFalse;
+
+	if ( !GetStringFromConfig(aSection, KFldText(), text) )
+		{
+		ERR_PRINTF2(_L("Missing parameter %S"), &KFldText());
+		SetBlockResult(EFail);
+		return;
+		}
+
+	if ( !GetBoolFromConfig(aSection, KFldUp, up))
+		{
+		ERR_PRINTF2(_L("Missing parameter %S"), &KFldUp());
+		SetBlockResult(EFail);
+		return;
+		}
+
+	TRect rect;
+	TInt baselineOffset=0;
+	if (GetRectFromConfig(aSection, KFldRect, rect) )
+		{
+		if (GetIntFromConfig(aSection, KFldBaselineOffset, baselineOffset))
+			{
+			TInt datMargin=0;
+			CGraphicsContext::TTextAlign textAlign=CGraphicsContext::ELeft;
+			CT_GraphicsUtil::ReadTextAlign(*this, aSection, KFldTextAlign,
+					textAlign);
+			if (!GetIntFromConfig(aSection, KFldLeftMargin, datMargin))
+				{
+				INFO_PRINTF1(_L("Using the default value aMargin=0"));
+				}
+
+			if (GetIntFromConfig(aSection, KFldTextWidth, datTextWidth))
+				{
+				INFO_PRINTF1(_L("execute DrawTextVertical(const TDesC &,const TRect &,TInt,TInt,TBool,TTextAlign,TInt)"));
+				iFbsBitGc->DrawTextVertical(text, rect, baselineOffset,
+						datTextWidth, up, textAlign, datMargin);
+				}
+			else
+				{
+				INFO_PRINTF1(_L("execute DrawTextVertical(const TDesC &,const TRect &,TInt,TBool,TTextAlign,TInt)"));
+				iFbsBitGc->DrawTextVertical(text, rect, baselineOffset, up,
+						textAlign, datMargin);
+				}
+			}
+		else
+			{
+			INFO_PRINTF1(_L("execute DrawTextVertical(const TDesC &,const TRect &,TBool)"));
+			iFbsBitGc->DrawTextVertical(text, rect, up);
+			}
+		}
+	else
+		{
+		TPoint point;
+		if (!GetPointFromConfig(aSection, KFldPoint, point))
+			{
+			INFO_PRINTF1(_L("execute DrawTextVertical(const TDesC &,TBool)"));
+			iFbsBitGc->DrawTextVertical(text, up);
+			}
+		else
+			{
+			INFO_PRINTF1(_L("execute DrawTextVertical(const TDesC &,const TPoint &,TBool)"));
+			iFbsBitGc->DrawTextVertical(text, point, up);
+			}
+		}
+	}
+
+void CT_DataFbsBitGc::DoCmdUpdateJustificationL(const TDesC& aSection)
+	{
+	TPtrC text;
+	if ( !GetStringFromConfig(aSection, KFldText(), text) )
+		{
+		ERR_PRINTF2(_L("Missing parameter %S"), &KFldText());
+		SetBlockResult(EFail);
+		return;
+		}
+	INFO_PRINTF1(_L("execute UpdateJustification(const TDesC &)"));
+	iFbsBitGc->UpdateJustification(text);
+	}
+
+void CT_DataFbsBitGc::DoCmdUpdateJustificationVerticalL(const TDesC& aSection)
+	{
+	TPtrC text;
+	TBool up=EFalse;
+
+	if ( !GetStringFromConfig(aSection, KFldText(), text) )
+		{
+		ERR_PRINTF2(_L("Missing parameter %S"), &KFldText());
+		SetBlockResult(EFail);
+		return;
+		}
+
+	if ( !GetBoolFromConfig(aSection, KFldUp, up))
+		{
+		ERR_PRINTF2(_L("Missing parameter %S"), &KFldUp());
+		SetBlockResult(EFail);
+		return;
+		}
+	INFO_PRINTF1(_L("execute UpdateJustificationVertical(const TDesC &,TBool)"));
+	iFbsBitGc->UpdateJustificationVertical(text, up);
+	}
+
+void CT_DataFbsBitGc::DoCmdFadeArea(const TDesC& aSection)
+	{
+	RRegion reg;
+	if(GetRegionFromConfig(aSection,KFldRegion,reg))
+		{
+		INFO_PRINTF1(_L("execute FadeArea(const TRegion *)"));
+		iFbsBitGc->FadeArea(&reg);
+		}
+	else
+		{
+		INFO_PRINTF2(_L("Missing parameter %S"), &KFldRegion());
+		INFO_PRINTF1(_L("execute FadeArea(NULL)"));
+		iFbsBitGc->FadeArea(NULL);
+		}
+	}
+
+void CT_DataFbsBitGc::DoCmdIsBrushPatternUsed(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("execute IsBrushPatternUsed()"));
+	TBool bUsed=iFbsBitGc->IsBrushPatternUsed();
+	
+	TBool expect;
+	if(GetBoolFromConfig(aSection,KFldExpect,expect))
+		{
+		if(expect!=bUsed)
+			{
+			ERR_PRINTF3(KLogNotExpectedValue, bUsed,expect);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataFbsBitGc::DoCmdIsFontUsed(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("execute IsFontUsed()"));
+	TBool bUsed=iFbsBitGc->IsFontUsed();
+		
+	TBool expect;
+	if(GetBoolFromConfig(aSection,KFldExpect,expect))
+		{
+		if(expect!=bUsed)
+			{
+			ERR_PRINTF3(KLogNotExpectedValue, bUsed,expect);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataFbsBitGc::DoCmdOrientationsAvailable(const TDesC& /*aSection*/)
+	{
+	INFO_PRINTF1(_L("execute OrientationsAvailable(TBool aOrientation[4])"));
+
+	//iGraphicsOrientation defined in CDataWrapperBase
+	iFbsBitGc->OrientationsAvailable(iGraphicsOrientation);
+	
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+	
+	for(TInt i=0;i<4;i++)
+		{
+		tempStore.Format(KFormatFieldNumber, i+1,iGraphicsOrientation[i]);
+		INFO_PRINTF1(KFormatFieldNumber);
+		}
+	}
+
+void CT_DataFbsBitGc::DoCmdRectDrawnTo(const TDesC& aSection)
+	{
+	TRect	rect;
+	if(GetRectFromConfig(aSection, KFldRect, rect))
+		{
+		INFO_PRINTF1(_L("execute RectDrawnTo(TRect&)"));
+		iFbsBitGc->RectDrawnTo(rect);
+		}
+	else
+		{
+		ERR_PRINTF2(_L("Missing parameter %S"), &KFldRect());
+		SetBlockResult(EFail);
+		}
+
+	}
+
+void CT_DataFbsBitGc::DoCmdResized(const TDesC& /*aSection*/)
+	{
+	INFO_PRINTF1(_L("execute Resized()"));
+	iFbsBitGc->Resized();
+	
+	}
+
+void CT_DataFbsBitGc::DoCmdSetDitherOrigin(const TDesC& aSection)
+	{
+	TPoint	point;
+	if (GetPointFromConfig(aSection, KFldPoint, point))
+		{
+		INFO_PRINTF1(_L("execute SetDitherOrigin(const TPoint &)"));
+		iFbsBitGc->SetDitherOrigin(point);
+		}
+	else
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldPoint());
+		SetBlockResult(EFail);
+		}
+	}
+
+void CT_DataFbsBitGc::DoCmdSetFadeMode(const TDesC& aSection)
+	{
+	TBool fade;
+	if(GetBoolFromConfig(aSection,KFldFadeMode,fade))
+		{
+		INFO_PRINTF1(_L("execute SetFadeMode(TBool)"));
+		iFbsBitGc->SetFadeMode(fade);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute SetFadeMode(TBool aFadeMode=EFalse)"));
+		iFbsBitGc->SetFadeMode();
+		}
+	}
+
+TBool CT_DataFbsBitGc::DoCmdSetFadingParameters(const TDesC& aSection)
+	{
+	TInt blackmap=0;
+	TInt whitemap=255;
+	if(GetIntFromConfig(aSection,KFldWhiteMap,whitemap))
+		{
+		//let base class handle this
+		return EFalse;
+		}
+	else
+		{
+		if(GetBoolFromConfig(aSection,KFldBlackMap,blackmap))
+			{
+			INFO_PRINTF1(_L("execute SetFadingParameters(TUint8)"));
+			iFbsBitGc->SetFadingParameters(blackmap);
+			}
+		else
+			{
+			INFO_PRINTF1(_L("execute SetFadingParameters(TUint8 aBlackMap=0)"));
+			iFbsBitGc->SetFadingParameters();
+			}
+		}
+	return ETrue;
+	}
+
+void CT_DataFbsBitGc::DoCmdSetOrientation(const TDesC& aSection)
+	{
+	CFbsBitGc::TGraphicsOrientation orientation;
+	TBool ret=EFalse;
+	if(CT_GraphicsUtil::GetGraphicsOrientation(*this,aSection,KFldGraphicsOrientation,orientation))
+		{
+		INFO_PRINTF1(_L("execute SetOrientation(TGraphicsOrientation)"));
+		ret=iFbsBitGc->SetOrientation(orientation);
+		if(ret!=iGraphicsOrientation[orientation])
+			{
+			INFO_PRINTF1(_L("SetOrientation and OrientationsAvailable return values are not match!"));
+			SetBlockResult(EFail);
+			}
+		}
+	else
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldGraphicsOrientation());
+		SetBlockResult(EFail);
+		}
+	}
+
+void CT_DataFbsBitGc::DoCmdSetShadowMode(const TDesC& aSection)
+	{
+	TBool mode;
+	if(GetBoolFromConfig(aSection,KFldShadowMode,mode))
+		{
+		INFO_PRINTF1(_L("execute SetShadowMode(TBool)"));
+		iFbsBitGc->SetShadowMode(mode);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute SetShadowMode(TBool aShadowMode=EFalse)"));
+		iFbsBitGc->SetShadowMode();
+		}
+	}
+
+void CT_DataFbsBitGc::DoCmdSetUserDisplayMode(const TDesC& aSection)
+	{
+	TDisplayMode mode;
+	if(CT_GraphicsUtil::ReadDisplayMode(*this,aSection,KFldDisplayMode,mode))
+		{
+		INFO_PRINTF1(_L("execute SetUserDisplayMode(TDisplayMode)"));
+		iFbsBitGc->SetUserDisplayMode(mode);
+		}
+	else
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldDisplayMode());
+		SetBlockResult(EFail);
+		}
+	}
+
+void CT_DataFbsBitGc::DoCmdShadowArea(const TDesC& aSection)
+	{
+	RRegion reg;
+	if(GetRegionFromConfig(aSection,KFldRegion,reg))
+		{
+		INFO_PRINTF1(_L("execute ShadowArea(const TRegion *)"));
+		iFbsBitGc->ShadowArea(&reg);
+		}
+	else
+		{
+		INFO_PRINTF2(_L("Missing parameter %S"), &KFldRegion());
+		INFO_PRINTF1(_L("execute ShadowArea(NULL)"));
+		iFbsBitGc->ShadowArea(NULL);
+		}
+	}
+
+void CT_DataFbsBitGc::DoCmdUseBrushPatternL(const TDesC& aSection)
+	{
+	TInt handle;
+	if(GetIntFromConfig(aSection,KFldHandle,handle))
+		{
+		INFO_PRINTF1(_L("execute UseBrushPattern(TInt) using the specified handle."));
+		TInt err=iFbsBitGc->UseBrushPattern(handle);
+		if(KErrNone!=err)
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		}
+	else
+		{
+		CFbsBitmap*	bitmap=NULL;
+		if (CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFldBitmap, bitmap))
+			{
+			TBool usehandle;
+			if(GetBoolFromConfig(aSection,KFldUseHandle,usehandle))
+				{
+				INFO_PRINTF1(_L("execute UseBrushPattern(TInt) using the bitmap object's handle."));
+				TInt err=iFbsBitGc->UseBrushPattern(bitmap->Handle());
+				if(KErrNone!=err)
+					{
+					ERR_PRINTF2(KLogError, err);
+					SetError(err);
+					}
+				}
+			else
+				{
+				INFO_PRINTF1(_L("execute UseBrushPattern(CFbsBitmap*)"));
+				iFbsBitGc->UseBrushPattern(bitmap);
+				}
+			}
+		else
+			{
+			ERR_PRINTF2(_L("Missing parameter %S"), &KFldBitmap());
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataFbsBitGc::DoCmdUseFontL(const TDesC& aSection)
+	{
+	TInt handle;
+	if(GetIntFromConfig(aSection,KFldHandle,handle))
+		{
+		INFO_PRINTF1(_L("execute UseFont(TInt) using the specified handle"));
+		TInt err=iFbsBitGc->UseFont(handle);
+		if(KErrNone!=err)
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		}
+	else
+		{
+		CFont* font=NULL;
+		if(CT_GraphicsUtil::GetFontL(*this,aSection,KFldFont,font))
+			{
+			TBool usehandle;
+			if(GetBoolFromConfig(aSection,KFldUseHandle,usehandle))
+				{
+				INFO_PRINTF1(_L("execute UseFont(TInt) using the font object's handle"));
+				TInt err=iFbsBitGc->UseFont(((CFbsFont*)font)->Handle());
+				if(KErrNone!=err)
+					{
+					ERR_PRINTF2(KLogError, err);
+					SetError(err);
+					}
+				}
+			else
+				{
+				INFO_PRINTF1(_L("execute UseFont(CFont*)"));
+				iFbsBitGc->UseFont(font);
+				}
+			}
+		else
+			{
+			ERR_PRINTF2(_L("Missing parameter %S"), &KFldFont());
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataFbsBitGc::DoCmdUseFontNoDuplicateL(const TDesC& aSection)
+	{
+	CFont* font=NULL;
+	if(CT_GraphicsUtil::GetFontL(*this,aSection,KFldFont,font))
+		{
+		INFO_PRINTF1(_L("execute UseFontNoDuplicate(const CFbsBitGcFont*)"));
+		iFbsBitGc->UseFontNoDuplicate((CFbsBitGcFont*)font);
+		}
+	else
+		{
+		ERR_PRINTF2(_L("Missing parameter %S"), &KFldFont());
+		SetBlockResult(EFail);
+		}
+	}
+
+void  CT_DataFbsBitGc::DoCmdPromptMessageL(const TDesC& aSection)
+	{
+	TPtrC text;
+	//get prompt text to display in console in order to help user verify. 
+	if(!GetStringFromConfig(aSection, KFldPromptText(), text))
+		{
+		ERR_PRINTF2(_L("Missing parameter %S"), &KFldPromptText());
+		SetBlockResult(EFail);
+		}
+	TInt expectedKey;
+	if(!GetIntFromConfig(aSection, KFldExpectedKey(), expectedKey))
+		{
+		ERR_PRINTF2(_L("Missing parameter %S"), &KFldExpectedKey());
+		SetBlockResult(EFail);
+		}
+	TInt actualKey;
+	RProperty property;
+	const TUid KMyPropertyCat={0x10012345};
+	TUint key=1;
+	TSecurityPolicy read(TSecurityPolicy::EAlwaysPass); 
+	TSecurityPolicy write(TSecurityPolicy::EAlwaysPass); 
+	TInt err=property.Define(KMyPropertyCat,key,RProperty::EInt,read,write);
+	if (err==KErrAlreadyExists)
+		{
+		ERR_PRINTF1(_L("RProperty has existed!"));
+		SetBlockResult(EFail);
+		User::LeaveIfError(err);
+		}
+	err=property.Attach(KMyPropertyCat,key);
+	TRequestStatus substatus;
+	//issue a request to get property change information.
+	property.Subscribe(substatus);
+	RProcess promptProcess;
+	err = promptProcess.Create(KPromptProcess, text);
+	if (err == KErrNone)
+		{
+		CleanupClosePushL(promptProcess);
+		TRequestStatus promptStatus;
+		promptProcess.Rendezvous(promptStatus);
+		if (promptStatus == KRequestPending)
+			{
+			promptProcess.Resume();
+			User::WaitForRequest(promptStatus);
+			}
+		else
+			{
+			promptProcess.RendezvousCancel(promptStatus);
+			promptProcess.Kill(0);
+			ERR_PRINTF2(_L("Executing of prompt process failed with error %d"), promptStatus.Int());
+			SetBlockResult(EFail);
+			}
+		CleanupStack::PopAndDestroy();
+		}
+	else
+		{
+		ERR_PRINTF2(_L("Failed to create prompt process with error %d"), err);
+		SetBlockResult(EFail);
+		}
+	//get property change information. 
+	User::WaitForRequest(substatus);
+	if (substatus!=KRequestPending)
+		{
+		property.Get(KMyPropertyCat,key,actualKey);
+		INFO_PRINTF2(_L("property.Get %d"), actualKey);
+		}
+		err=RProperty::Delete(KMyPropertyCat,key);
+		if (err!=KErrNotFound)
+		User::LeaveIfError(err);
+		property.Close();
+		if(actualKey != expectedKey)
+		{
+		ERR_PRINTF3(_L("expectedKey=%d pressed key=%d"), expectedKey, actualKey);
+		SetBlockResult(EFail);
+		}
+	}
+		
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/bitgdi/src/T_DataFbsBitGcBitmap.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,199 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "T_DataFbsBitGcBitmap.h"
+
+
+///	Commands
+_LIT(KCmdNewL,										"new");
+_LIT(KCmdAddress,									"Address");
+_LIT(KCmdLockHeap,									"LockHeap");
+_LIT(KCmdUnlockHeap,								"UnlockHeap");
+_LIT(KCmdDestructorGeneral,							"~");
+_LIT(KCmdDestructor,								"~CFbsBitGcBitmap");
+
+//Log
+_LIT(KLogErrNum,									"Error=%d");
+_LIT(KLogInfoCmdnewL, 						    	"execute new CFbsBitGcBitmap()");
+_LIT(KLogInfoCmdDestructor1, 						"execute ~CFbsBitGcBitmap()");
+
+//Fields
+_LIT(KFldExpectedWidth, 							"expectedWidth");
+_LIT(KFldExpectedHeight, 							"expectedHeight");
+
+
+CT_DataFbsBitGcBitmap* CT_DataFbsBitGcBitmap::NewL()
+	{
+	CT_DataFbsBitGcBitmap*	ret = new (ELeave) CT_DataFbsBitGcBitmap();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+CT_DataFbsBitGcBitmap::CT_DataFbsBitGcBitmap()
+:	iFbsBitGcBitmap(NULL)
+	{
+	
+	}
+
+void CT_DataFbsBitGcBitmap::ConstructL()
+	{
+
+	}
+
+CT_DataFbsBitGcBitmap::~CT_DataFbsBitGcBitmap()
+	{
+	DestroyData();
+	}
+
+TAny* CT_DataFbsBitGcBitmap::GetObject()
+	{
+	return iFbsBitGcBitmap;
+	}
+
+void CT_DataFbsBitGcBitmap::SetObjectL(TAny* aAny)
+	{
+	DestroyData();
+	iFbsBitGcBitmap = static_cast<CFbsBitGcBitmap*> (aAny);
+	}
+
+void CT_DataFbsBitGcBitmap::DisownObjectL()
+	{
+	iFbsBitGcBitmap = NULL;
+	}
+
+CFbsBitmap* CT_DataFbsBitGcBitmap::GetFbsBitmap() const
+	{
+	return iFbsBitGcBitmap;
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @return ETrue if the command is processed
+*/
+TBool CT_DataFbsBitGcBitmap::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	ret = ETrue;
+    if (aCommand==KCmdNewL)
+    	{
+    	DoCmdNewL();
+    	}
+	else if ( aCommand==KCmdDestructorGeneral || aCommand==KCmdDestructor )
+		{
+		DoCmdDestructor();
+		}
+	else if ( aCommand==KCmdAddress)
+		{
+		DoCmdAddress(aSection);
+		}
+	else if(aCommand==KCmdLockHeap)
+		{
+		DoCmdLockHeap();
+		}
+	else if(aCommand==KCmdUnlockHeap)
+		{
+		DoCmdUnlockHeap();
+		}
+	else
+		{
+		ret=CT_DataFbsBitmap::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+    
+	return ret;
+	}
+
+void CT_DataFbsBitGcBitmap::DestroyData()
+	{
+	delete iFbsBitGcBitmap;
+	iFbsBitGcBitmap = NULL;
+	}
+
+void CT_DataFbsBitGcBitmap::DoCmdDestructor()
+	{
+	INFO_PRINTF1(KLogInfoCmdDestructor1);
+	DestroyData();
+	}
+
+void CT_DataFbsBitGcBitmap::DoCmdNewL()
+	{ 
+	DestroyData();
+	TInt err = KErrNone;
+	INFO_PRINTF1(KLogInfoCmdnewL);
+	TRAP(err, iFbsBitGcBitmap = new (ELeave) CFbsBitGcBitmap());
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogErrNum, err);
+		SetError(err);
+		}
+	}
+
+void CT_DataFbsBitGcBitmap::DoCmdAddress(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("execute CFbsBitGcBitmap::Address()"));
+	CBitwiseBitmap* bmp=iFbsBitGcBitmap->Address();
+	if(bmp==NULL)
+		{
+		INFO_PRINTF1(_L("The bitmap address is NULL"));
+		return;
+		}
+	
+    TInt displaymode=bmp->DisplayMode();
+	TSize size=bmp->SizeInPixels();
+	TInt sizeH=size.iHeight;
+	TInt sizeW=size.iWidth;
+	TInt expectedWidth, expectedHeight;	
+	if(GetIntFromConfig(aSection,KFldExpectedWidth, expectedWidth))
+		{
+        if(expectedWidth!=sizeW)
+        	{
+    		ERR_PRINTF3(_L("The bitmap width in pixel is: %d not as expected: %d"), sizeW, expectedWidth);
+    		SetBlockResult(EFail);
+        	}
+        else
+        	{
+        	INFO_PRINTF2(_L("The bitmap width in pixel is: %d as expected"),sizeW);
+        	}
+		}
+
+	if(GetIntFromConfig(aSection, KFldExpectedHeight, expectedHeight))
+		{
+		if(expectedHeight!=sizeH)
+			{
+			ERR_PRINTF3(_L("The bitmap height in pixel is: %d not as expected: %d"), sizeH, expectedHeight);
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			INFO_PRINTF2(_L("The bitmap height in pixel is: %d as expected"),sizeH);
+			}
+		}
+	}
+
+void CT_DataFbsBitGcBitmap::DoCmdLockHeap()
+	{
+	INFO_PRINTF1(_L("execute CFbsBitGcBitmap::LockHeap()"));
+	iFbsBitGcBitmap->LockHeap();
+	}
+
+void CT_DataFbsBitGcBitmap::DoCmdUnlockHeap()
+	{
+	INFO_PRINTF1(_L("execute CFbsBitGcBitmap::UnlockHeap"));
+	iFbsBitGcBitmap->UnlockHeap();
+	}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/bitgdi/src/T_DataFbsBitGcFont.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,225 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "T_DataFbsBitGcFont.h"
+
+/*@{*/
+///	Parameters
+_LIT(KFldHandle,						"handle");
+_LIT(KFontDataObjectName,				"font_data_object_name");
+
+///	Commands
+_LIT(KCmdNewL,							"NewL");
+_LIT(KCmdDestructor,					"~");
+_LIT(KCmdAddress,						"Address");
+_LIT(KCmdDuplicate,						"Duplicate");
+_LIT(KCmdReset, 						"Reset");
+
+
+/// Logs
+_LIT(KLogMissingParameter,				"Missing parameter '%S'");
+_LIT(KLogErrNum,						"Execute failed with error = %d!");	
+/*@}*/
+
+
+/**
+* Constructor
+*/
+CT_DataFbsBitGcFont* CT_DataFbsBitGcFont::NewL()
+	{
+	CT_DataFbsBitGcFont* ret = new (ELeave) CT_DataFbsBitGcFont();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+/**
+* Protected constructor. First phase construction
+*/
+CT_DataFbsBitGcFont::CT_DataFbsBitGcFont()
+:	CT_DataFbsFont()
+,	iFbsBitGcFont(NULL)
+	{
+	}
+
+/**
+* Protected second phase construction
+*/
+void CT_DataFbsBitGcFont::ConstructL()
+	{
+	}
+
+/**
+* Destructor.
+*/
+CT_DataFbsBitGcFont::~CT_DataFbsBitGcFont()
+	{
+	DisownObjectL();
+	}
+
+
+CFont*	CT_DataFbsBitGcFont::GetFont() const
+	{
+	return iFbsBitGcFont;
+	}
+
+CFbsFont* CT_DataFbsBitGcFont::GetFbsFont() const
+	{
+	return iFbsBitGcFont;
+	}
+
+/**
+* Return a pointer to the object that the data wraps
+*
+* @return pointer to the object that the data wraps
+*/
+TAny* CT_DataFbsBitGcFont::GetObject()
+	{
+	return iFbsBitGcFont;
+	}
+
+void CT_DataFbsBitGcFont::SetObjectL(TAny* aObject)
+	{
+	iFbsBitGcFont = static_cast<CFbsBitGcFont*> (aObject);
+	}
+
+void CT_DataFbsBitGcFont::DisownObjectL() 
+	{
+	iFbsBitGcFont = NULL;
+	}
+
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand		the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataFbsBitGcFont::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	/* Another work package will complete the implement of this */
+	TBool	retVal = ETrue;
+
+	if ( aCommand == KCmdNewL )
+		{
+		DoCmdNewL();
+		}
+	else if (aCommand == KCmdDestructor)
+		{
+		DoCmdDestructor();
+		}
+	else if (aCommand == KCmdAddress)
+		{
+		DoCmdAddress();
+		}
+	else if (aCommand == KCmdDuplicate)
+		{
+		DoCmdDuplicate(aSection);
+		}
+	else if (aCommand == KCmdReset)
+		{
+		DoCmdReset();
+		}
+	else
+		{
+		retVal = CT_DataFbsFont::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+	return retVal;
+	}
+
+
+void CT_DataFbsBitGcFont::DoCmdNewL()
+	{
+	TInt err = KErrNone;
+	INFO_PRINTF1(_L("Create CFbsBitGcFont Object by CFbsBitGcFont() constructor function."));
+	TRAP(err, iFbsBitGcFont = new (ELeave) CFbsBitGcFont());
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogErrNum, err);
+		SetError(err);
+		}
+	}
+
+void CT_DataFbsBitGcFont::DoCmdDestructor()
+	{
+	DisownObjectL();
+	}
+
+void CT_DataFbsBitGcFont::DoCmdAddress()
+	{
+	CBitmapFont* BitmapFontPtr = NULL;
+	INFO_PRINTF1(_L("Execute CFbsBitGcFont::Address() function."));
+	
+	BitmapFontPtr = iFbsBitGcFont->Address();
+	if (NULL == BitmapFontPtr)
+		{
+		INFO_PRINTF1(_L("The CBitmapFont* returned is NULL."));
+		}
+	}
+
+void CT_DataFbsBitGcFont::DoCmdDuplicate(const TDesC& aSection)
+	{
+	TInt handle = 0;
+	INFO_PRINTF1(_L("Execute CFbsBitGcFont::Duplicate(TInt aHandle) function."));
+	
+	if(GetIntFromConfig(aSection,KFldHandle,handle))
+		{
+		INFO_PRINTF2(_L("Execute Duplicate(TInt aHandle) using the specified handle = %d"), handle);
+		}
+	else
+		{
+		TPtrC fontDataObjectName;
+		if (!GetStringFromConfig(aSection, KFontDataObjectName(), fontDataObjectName))
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KFontDataObjectName);
+			SetBlockResult(EFail);
+			return;
+			}
+		else
+			{
+			CT_DataFbsBitGcFont* fontDataObject = NULL;
+			fontDataObject = static_cast<CT_DataFbsBitGcFont*>(GetDataWrapperL(fontDataObjectName));
+			if (NULL == fontDataObject)
+				{
+				ERR_PRINTF1(_L("Bad Object!"));
+				SetBlockResult(EFail);
+				return;
+				}
+			else
+				{
+				handle = ((CFbsBitGcFont*)fontDataObject->GetObject())->Handle();
+				INFO_PRINTF2(_L("Execute Duplicate(TInt aHandle) using CFbsBitGcFont Object's handle = %d"), handle);
+				}
+			}
+		}
+	
+	TInt err = iFbsBitGcFont->Duplicate(handle);
+	if (KErrNone != err)
+		{
+		ERR_PRINTF2(KLogErrNum, err);
+		SetError(err);
+		}
+	}
+
+void CT_DataFbsBitGcFont::DoCmdReset()
+	{
+	INFO_PRINTF1(_L("Execute CFbsBitGcFont::Reset() function."));
+	iFbsBitGcFont->Reset();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/bitgdi/src/T_DataFbsBitmapDevice.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,253 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+//	User includes
+#include "T_DataFbsBitmapDevice.h"
+#include "T_GraphicsUtil.h"
+
+/*@{*/
+///	Commands
+_LIT(KCmdNewL,							"NewL");
+_LIT(KCmdDestructor,					"~");
+_LIT(KCmdDrawingBegin, 					"DrawingBegin");
+_LIT(KCmdDrawingEnd,					"DrawingEnd");
+_LIT(KCmdResize,						"Resize");
+_LIT(KCmdSwapWidthAndHeight,			"SwapWidthAndHeight");
+
+///	Parameters
+_LIT(KFldBitmap,						"bitmap");
+_LIT(KFldLibName,						"libname");
+_LIT(KFldSize,							"size");
+_LIT(KFldResize,						"resize");
+_LIT(KFldAlways,						"Always");
+
+// Logs
+_LIT(KLogMissingParameter,				"Missing parameter '%S'");
+_LIT(KLogErrNum,						"Execute failed with error = %d!");	
+/*@}*/
+
+
+/**
+* Two phase constructor
+*/
+CT_DataFbsBitmapDevice* CT_DataFbsBitmapDevice::NewL()
+	{
+	CT_DataFbsBitmapDevice*	ret = new (ELeave) CT_DataFbsBitmapDevice();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+/**
+* Protected constructor. First phase construction
+*/
+CT_DataFbsBitmapDevice::CT_DataFbsBitmapDevice()
+:	CT_DataFbsDevice()
+,	iFbsBitmapDevice(NULL)
+	{
+	}
+
+/**
+* Protected second phase construction
+*/
+void CT_DataFbsBitmapDevice::ConstructL()
+	{
+	}
+
+/**
+* Destructor.
+*/
+CT_DataFbsBitmapDevice::~CT_DataFbsBitmapDevice()
+	{
+	DestroyData();
+	}
+
+void CT_DataFbsBitmapDevice::DestroyData()
+	{
+	delete iFbsBitmapDevice;
+	iFbsBitmapDevice=NULL;
+	}
+
+MGraphicsDeviceMap* CT_DataFbsBitmapDevice::GetGraphicsDeviceMap() const
+	{
+	return iFbsBitmapDevice;
+	}
+
+CGraphicsDevice* CT_DataFbsBitmapDevice::GetGraphicsDevice() const
+	{
+	return iFbsBitmapDevice;
+	}
+
+CBitmapDevice* CT_DataFbsBitmapDevice::GetBitmapDevice() const
+	{
+	return iFbsBitmapDevice;
+	}
+
+CFbsDevice* CT_DataFbsBitmapDevice::GetFbsDevice() const
+	{
+	return iFbsBitmapDevice;
+	}
+/**
+* Return a pointer to the object that the data wraps
+*
+* @return pointer to the object that the data wraps
+*/
+TAny* CT_DataFbsBitmapDevice::GetObject()
+	{
+	return iFbsBitmapDevice;
+	}
+
+void CT_DataFbsBitmapDevice::SetObjectL(TAny* aObject)
+	{
+	DestroyData();
+	iFbsBitmapDevice = static_cast<CFbsBitmapDevice*> (aObject);
+	}
+
+void CT_DataFbsBitmapDevice::DisownObjectL() 
+	{
+	iFbsBitmapDevice = NULL;
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataFbsBitmapDevice::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	/* Another work package will complete the implement of this */
+	TBool	retVal = ETrue;
+
+	if ( aCommand == KCmdNewL )
+		{
+		DoCmdNewL(aSection);
+		}
+	else if (aCommand == KCmdDestructor)
+		{
+		DoCmdDestructor();
+		}
+	else if (aCommand == KCmdDrawingBegin)
+		{
+		DoCmdDrawingBegin(aSection);
+		}
+	else if (aCommand == KCmdDrawingEnd)
+		{
+		DoCmdDrawingEnd(aSection);
+		}
+	else if (aCommand == KCmdResize)
+		{
+		DoCmdResize(aSection);
+		}
+	else if (aCommand == KCmdSwapWidthAndHeight)
+		{
+		DoCmdSwapWidthAndHeight();
+		}
+	else
+		{
+		retVal=CT_DataFbsDevice::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+	return retVal;
+	}
+
+void CT_DataFbsBitmapDevice::DoCmdNewL(const TDesC& aSection)
+	{
+	DestroyData();
+	CFbsBitmap*	bitmap = NULL;
+	
+	if (!CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFldBitmap, bitmap))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldBitmap);
+		SetBlockResult(EFail);
+		return;
+		}
+	TInt	err = KErrNone;
+	TPtrC	libName;
+	if ( GetStringFromConfig(aSection, KFldLibName(), libName) )
+		{
+		INFO_PRINTF1(_L("execute NewL(CFbsBitmap*, const TDesC&)."));
+		TRAP(err, iFbsBitmapDevice=CFbsBitmapDevice::NewL(bitmap, libName));
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute NewL(CFbsBitmap*)."));
+		TRAP(err, iFbsBitmapDevice=CFbsBitmapDevice::NewL(bitmap));
+		}
+	
+	if ( err != KErrNone )
+		{
+		ERR_PRINTF2(KLogErrNum, err);
+		SetError(err);
+		}
+	}
+
+void CT_DataFbsBitmapDevice::DoCmdDestructor()
+	{
+	DestroyData();
+	}
+
+void CT_DataFbsBitmapDevice::DoCmdDrawingBegin(const TDesC& aSection)
+	{
+	TBool Always = EFalse;
+	GetBoolFromConfig(aSection, KFldAlways, Always);
+	INFO_PRINTF2(_L("execute DrawingBegin function with the Always parameter=%d."), Always);
+	iFbsBitmapDevice->DrawingBegin(Always);
+	}
+
+void CT_DataFbsBitmapDevice::DoCmdDrawingEnd(const TDesC& aSection)
+	{
+	TBool Always = EFalse;
+	GetBoolFromConfig(aSection, KFldAlways, Always);
+	INFO_PRINTF2(_L("execute DrawingEnd function with the Always parameter=%d."), Always);
+	iFbsBitmapDevice->DrawingEnd(Always);
+	}
+
+void CT_DataFbsBitmapDevice::DoCmdResize(const TDesC& aSection)
+	{
+	TSize	datSize;
+	TInt 	err = KErrNone;
+	INFO_PRINTF1(_L("execute Resize(const TSize&)"));
+	if (!GetSizeFromConfig(aSection, KFldResize, datSize))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldResize);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		err = iFbsBitmapDevice->Resize(datSize);
+		if (KErrNone != err)
+			{
+			ERR_PRINTF2(KLogErrNum, err);
+			SetError(err);
+			}
+		}
+	}
+
+void CT_DataFbsBitmapDevice::DoCmdSwapWidthAndHeight()
+	{
+	INFO_PRINTF1(_L("execute SwapWidthAndHeight()"));
+	TInt err = iFbsBitmapDevice->SwapWidthAndHeight();
+	if (KErrNone != err)
+		{
+		ERR_PRINTF2(KLogErrNum, err);
+		SetError(err);
+		}
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/bitgdi/src/T_DataFbsDevice.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1058 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "T_DataFbsDevice.h"
+#include "T_GraphicsUtil.h"
+
+/*@{*/
+//Commands
+_LIT(KCmdcheckPixels,				"checkPixels");
+_LIT(KCmdcheckLineColor,			"checkLineColor");
+_LIT(KCmdcheckRectColor,			"checkRectColor");
+_LIT(KCmdSizeInPixels,				"SizeInPixels");
+_LIT(KCmdGetFontById,							"GetFontById");
+_LIT(KCmdGetNearestFontInPixels,				"GetNearestFontInPixels");
+_LIT(KCmdGetNearestFontInTwips,					"GetNearestFontInTwips");
+_LIT(KCmdGetNearestFontToDesignHeightInPixels,	"GetNearestFontToDesignHeightInPixels");
+_LIT(KCmdGetNearestFontToDesignHeightInTwips,	"GetNearestFontToDesignHeightInTwips");
+_LIT(KCmdGetNearestFontToMaxHeightInPixels,		"GetNearestFontToMaxHeightInPixels");
+_LIT(KCmdGetNearestFontToMaxHeightInTwips,		"GetNearestFontToMaxHeightInTwips");
+_LIT(KCmdCreateContext,				"CreateContext");
+_LIT(KCmdRectCompare,				"RectCompare");
+_LIT(KCmdSetCustomPalette,			"SetCustomPalette");
+_LIT(KCmdGraphicsAccelerator,		"GraphicsAccelerator");
+_LIT(KCmdOrientation,				"Orientation");
+_LIT(KCmdDisplayMode16M,			"DisplayMode16M");
+_LIT(KCmdSetScalingFactor,			"SetScalingFactor");
+_LIT(KCmdGetDrawRect,				"GetDrawRect");
+_LIT(KCmdRegisterLinkedTypeface,	"RegisterLinkedTypeface");
+
+//Fields
+_LIT(KFldAlgStyle,					"alg_style");
+_LIT(KFldExpected,					"expected");
+_LIT(KFldFinish,					"finish");
+_LIT(KFldFormatFieldNumber,			"%S%d");
+_LIT(KFldFont,						"font");
+_LIT(KFldFbsFont,					"fbsfont");
+_LIT(KFldFontUid,					"font_uid");
+_LIT(KFldMaxHeight,					"maxheight");
+_LIT(KFldPixel,						"pixel");
+_LIT(KFldRect,						"rect");
+_LIT(KFldStart,						"start");
+_LIT(KFldBitGc,						"bitgc");
+_LIT(KFldRect1,						"rect1");
+_LIT(KFldRect2,						"rect2");
+_LIT(KFldFbsDevice,					"fbsdevice");
+_LIT(KFldExpectedOrientation,		"expectedorientation");
+_LIT(KFldPalette,					"palette");
+_LIT(KFldGraphicsAccelerator,		"graphicsaccelerator");
+_LIT(KFldExpectedDisplayMode,		"expecteddisplaymode");
+_LIT(KFldOrigin,					"origin");
+_LIT(KFldFactorX,					"factorx");
+_LIT(KFldFactorY,					"factory");
+_LIT(KFldDivisorX,					"divisorx");
+_LIT(KFldDivisorY,					"divisory");
+_LIT(KFldExpectedDrawRect,			"expecteddrawrect");
+_LIT(KFldOffset,					"offset");
+_LIT(KFldLinkedTypefaceSpec, 		"linkedtypefacespec");
+_LIT(KFldExpectedUid,		 		"expecteduid");
+
+//Logs
+_LIT(KLogColor,						"Color Red=%d Green=%d Blue=%d Alpha=%d");
+_LIT(KLogPoint,						"Point X=%d Y=%d");
+_LIT(KLogError,						"Error=%d");
+_LIT(KLogMissingParameter,			"Missing parameter '%S'");
+_LIT(KLogMissingWrapper,			"Missing wrapper for '%S'");
+_LIT(KLogNotExpectedValue,			"Not expected value");
+/*@}*/
+
+/**
+* Constructor. First phase construction
+*/
+CT_DataFbsDevice::CT_DataFbsDevice()
+:	CT_DataBitmapDevice()
+	{
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataFbsDevice::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	/* Another work package will implement this */
+	TBool	retVal = ETrue;
+	
+	if (aCommand == KCmdcheckPixels)
+		{
+		DoCmdCheckPixels(aSection);
+		}
+	else if (aCommand == KCmdcheckLineColor)
+		{
+		DoCmdCheckLineColor(aSection);
+		}
+	else if (aCommand == KCmdcheckRectColor)
+		{
+		DoCmdCheckRectColor(aSection);
+		}
+	else if (aCommand == KCmdSizeInPixels)
+		{
+		DoCmdSizeInPixels(aSection);
+		}
+	else if (aCommand == KCmdGetFontById)
+		{
+		DoCmdGetFontByIdL(aSection);
+		}
+	else if (aCommand == KCmdGetNearestFontInPixels)
+		{
+		if( !DoCmdGetNearestFontInPixelsL(aSection) )
+			{
+			retVal = CT_DataBitmapDevice::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+			}
+		}
+	else if (aCommand == KCmdGetNearestFontInTwips)
+		{
+		if( !DoCmdGetNearestFontInTwipsL(aSection) )
+			{
+			retVal = CT_DataBitmapDevice::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+			}
+		}
+	else if (aCommand == KCmdGetNearestFontToDesignHeightInPixels)
+		{
+		if( !DoCmdGetNearestFontToDesignHeightInPixelsL(aSection) )
+			{
+			retVal = CT_DataBitmapDevice::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+			}
+		}
+	else if (aCommand == KCmdGetNearestFontToDesignHeightInTwips)
+		{
+		if( !DoCmdGetNearestFontToDesignHeightInTwipsL(aSection) )
+			{
+			retVal = CT_DataBitmapDevice::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+			}
+		}
+	else if (aCommand == KCmdGetNearestFontToMaxHeightInPixels)
+		{
+		if( !DoCmdGetNearestFontToMaxHeightInPixelsL(aSection) )
+			{
+			retVal = CT_DataBitmapDevice::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+			}
+		}
+	else if (aCommand == KCmdGetNearestFontToMaxHeightInTwips)
+		{
+		if( !DoCmdGetNearestFontToMaxHeightInTwipsL(aSection) )
+			{
+			retVal = CT_DataBitmapDevice::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+			}
+		}
+	else if (aCommand == KCmdCreateContext)
+		{
+		if (!DoCmdCreateContextL(aSection))
+			{
+			retVal = CT_DataBitmapDevice::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+			}
+		}
+	else if (aCommand == KCmdRectCompare)
+		{
+		DoCmdRectCompareL(aSection);
+		}
+	else if (aCommand == KCmdOrientation)
+		{
+		DoCmdOrientation(aSection);
+		}
+	else if (aCommand == KCmdSetCustomPalette)
+		{
+		DoCmdSetCustomPaletteL(aSection);
+		}
+	else if (aCommand == KCmdGraphicsAccelerator)
+		{
+		DoCmdGraphicsAccelerator();
+		}
+	else if (aCommand == KCmdDisplayMode16M)
+		{
+		DoCmdDisplayMode16M(aSection);
+		}
+	else if (aCommand == KCmdSetScalingFactor)
+		{
+		DoCmdSetScalingFactor(aSection);
+		}
+	else if (aCommand == KCmdGetDrawRect)
+		{
+		DoCmdGetDrawRect(aSection);
+		}
+	else if (aCommand == KCmdRegisterLinkedTypeface)
+		{
+		DoCmdRegisterLinkedTypefaceL(aSection);
+		}
+	else
+		{
+		retVal = CT_DataBitmapDevice::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+	return retVal;
+	}
+
+
+void CT_DataFbsDevice::DoCmdSizeInPixels(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("execute SizeInPixels()"));
+	TSize actualsize;
+	TInt expectheight = 0;
+	TInt expectwidth = 0;
+	TSize expectsize;
+	
+	if (!GetSizeFromConfig(aSection, KFldExpected, expectsize))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldExpected);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		actualsize = GetFbsDevice()->SizeInPixels();
+		if (actualsize != expectsize)
+			{
+			ERR_PRINTF3(_L("The actual size is width=%d, height=%d"), actualsize.iWidth, actualsize.iHeight);
+			ERR_PRINTF3(_L("The expect size is width=%d, height=%d"), expectsize.iWidth, expectsize.iHeight);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/**
+* DoCmdcheckPixels: to check the color of specified pixels on the screen device, and compare
+* with the expected color specidied in the TEF testdata.
+*		pixel<n>: specify the position of the screen device to check
+*		expected<n>: specify the expected color to be compared with
+*
+*/
+void CT_DataFbsDevice::DoCmdCheckPixels(const TDesC& aSection)
+	{
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+
+	TBool moreData = ETrue;
+	for (TInt index=1; moreData; ++index)
+		{
+		// get the pixel position on the screen to check/verify
+		tempStore.Format(KFldFormatFieldNumber, &KFldPixel, index);
+		TPoint	point;
+		if ( !GetPointFromConfig(aSection, tempStore, point) )
+			{
+			moreData = EFalse;
+			}
+		else
+			{
+			TRgb actual;
+			GetFbsDevice()->GetPixel(actual, point);
+
+			tempStore.Format(KFldFormatFieldNumber, &KFldExpected, index);
+			TRgb expected;
+			if (GetRgbFromConfig(aSection, tempStore, expected))
+				{
+				if (actual != expected)
+					{
+					ERR_PRINTF5(KLogColor, actual.Red(), actual.Green(), actual.Blue(), actual.Alpha());
+					ERR_PRINTF5(KLogColor, expected.Red(), expected.Green(), expected.Blue(), expected.Alpha());
+					SetBlockResult(EFail);
+					}
+				}
+			}
+		}
+	}
+
+/**
+* DoCmdcheckLineColor: to check the color of specified lines on the screen device, and compare
+* with the expected color specidied in the TEF testdata.
+*		start<n>: specify the starting position of the line on the screen device to check
+*		finish<n>: specify the finish position of the line on the screen device to check
+*		expected<n>: specify the expected color to be compared with
+* Note: the straight line (from start to the finish points) is constructed by TLinearDDA
+*
+*/
+void CT_DataFbsDevice::DoCmdCheckLineColor(const TDesC& aSection)
+	{
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+	CPalette* palette = NULL;
+	GetFbsDevice()->GetPalette(palette);
+
+	TBool moreData = ETrue;
+	for (TInt index=1; moreData; ++index)
+		{
+		// get the the start and finish points of the line to check/verify
+		tempStore.Format(KFldFormatFieldNumber, &KFldStart, index);
+		TPoint	startPoint;
+		if (!GetPointFromConfig(aSection, tempStore, startPoint))
+			{
+			moreData = EFalse;
+			}
+
+		tempStore.Format(KFldFormatFieldNumber, &KFldFinish, index);
+		TPoint endPoint;
+		if (!GetPointFromConfig(aSection, tempStore, endPoint))
+			{
+			moreData = EFalse;
+			}
+
+		if (moreData)
+			{
+			// get the expected color from testdata
+			tempStore.Format(KFldFormatFieldNumber, &KFldExpected, index);
+			TRgb expected;
+			if (!GetRgbFromConfig(aSection, tempStore, expected))
+				{
+				ERR_PRINTF2(KLogMissingParameter, &tempStore);
+				SetBlockResult(EFail);
+				}
+			else
+				{
+				if (palette!=NULL)
+					{
+					expected = palette->NearestEntry(expected);
+					}
+
+				TLinearDDA lineDDA;
+				lineDDA.Construct(startPoint, endPoint, TLinearDDA::ECenter);
+
+				// for each pixels on the line (from start to finish points), check if its color matches expected
+				TPoint point;
+				while (!lineDDA.SingleStep(point))
+					{
+					TRgb actual;
+					GetFbsDevice()->GetPixel(actual, point);
+
+					if (actual != expected)
+						{
+						ERR_PRINTF5(KLogColor, actual.Red(), actual.Green(), actual.Blue(), actual.Alpha());
+						ERR_PRINTF5(KLogColor, expected.Red(), expected.Green(), expected.Blue(), expected.Alpha());
+						ERR_PRINTF3(KLogPoint, point.iX, point.iY);
+						SetBlockResult(EFail);
+						}
+					}
+				}
+			}
+		}
+	delete palette;
+	}
+
+/**
+* DoCmdcheckRectColor: to check the color of specified rectangle on the screen device, and
+* compare with the expected color specidied in the TEF testdata.
+*		rect<n>: specify the rectangle area on the screen device to check
+*		expected<n>: specify the expected color to be compared with
+*
+*/
+void CT_DataFbsDevice::DoCmdCheckRectColor(const TDesC& aSection)
+	{
+	TBuf<KMaxTestExecuteCommandLength> tempStore;
+
+	CPalette* palette=NULL;
+	GetFbsDevice()->GetPalette(palette);
+
+	TBool moreData = ETrue;
+	for (TInt index=1; moreData; ++index)
+		{
+		// get the the rectangle to check/verify
+		tempStore.Format(KFldFormatFieldNumber, &KFldRect, index);
+		TRect rect;
+		if (!GetRectFromConfig(aSection, tempStore, rect))
+			{
+			moreData = EFalse;
+			}
+		else
+			{
+			// get the expected color from testdata
+			tempStore.Format(KFldFormatFieldNumber, &KFldExpected, index);
+			TRgb expected;
+			if (!GetRgbFromConfig(aSection, tempStore, expected))
+				{
+				ERR_PRINTF2(KLogMissingParameter, &tempStore);
+				SetBlockResult(EFail);
+				}
+			else
+				{
+				if (palette!=NULL)
+					{
+					expected = palette->NearestEntry(expected);
+					}
+
+				TPoint point;
+				for (point.iX=rect.iTl.iX; point.iX<rect.iBr.iX; ++point.iX)
+					{
+					for (point.iY=rect.iTl.iY; point.iY<rect.iBr.iY; ++point.iY)
+						{
+						TRgb actual;
+						GetFbsDevice()->GetPixel(actual, point);
+
+						if (actual!=expected)
+							{
+							ERR_PRINTF5(KLogColor, actual.Red(), actual.Green(), actual.Blue(), actual.Alpha());
+							ERR_PRINTF5(KLogColor, expected.Red(), expected.Green(), expected.Blue(), expected.Alpha());
+							ERR_PRINTF3(KLogPoint, point.iX, point.iY);
+							SetBlockResult(EFail);
+							}
+						}
+					}
+				}
+			}
+		}
+	delete palette;
+	}
+
+void CT_DataFbsDevice::DoCmdGetFontByIdL(const TDesC& aSection)
+	{
+	TBool dataOk=ETrue;
+
+	// get font uid
+	TInt fontUid;
+	if( !GetIntFromConfig(aSection, KFldFontUid(), fontUid) )
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFontUid());
+		SetBlockResult(EFail);
+		}
+	
+	// get algorithmic style
+	TAlgStyle* algStyle = NULL;
+	CT_GraphicsUtil::GetAlgStyleL(*this, aSection, KFldAlgStyle(), algStyle);
+	if (NULL == algStyle)
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldAlgStyle());
+		SetBlockResult(EFail);
+		}
+	
+	TPtrC wrapperName;
+	if( GetStringFromConfig(aSection, KFldFbsFont, wrapperName) )
+		{
+		// "CFbsFont*&" type
+		if ( dataOk )
+			{
+			CFbsFont* fbsFont = NULL;
+			INFO_PRINTF1(_L("execute GetFontById(CFbsFont *&aFont, TUid aFileId, const TAlgStyle &aAlgStyle)"));
+			TInt err = GetFbsDevice()->GetFontById(fbsFont, TUid::Uid(fontUid), *algStyle);
+			
+			if (KErrNone != err)
+				{
+				ERR_PRINTF2(KLogError, err);
+				SetError(err);
+				}
+			else
+				{
+				SetDataObjectL(wrapperName, fbsFont);
+				}
+			}
+		}
+	else if( GetStringFromConfig(aSection, KFldFont, wrapperName) )
+		{
+		// "CFont*&" type
+		if( dataOk )
+			{
+			CFont* font = NULL;
+			INFO_PRINTF1(_L("execute GetFontById(CFont *&aFont, TUid aFileId, const TAlgStyle &aAlgStyle)"));
+			TInt err = GetFbsDevice()->GetFontById(font, TUid::Uid(fontUid), *algStyle);
+			
+			if (KErrNone != err)
+				{
+				ERR_PRINTF2(KLogError, err);
+				SetError(err);
+				}
+			else
+				{
+				SetDataObjectL(wrapperName, font);
+				}
+			}
+		}
+	else
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+	}
+
+TBool CT_DataFbsDevice::DoCmdGetNearestFontInPixelsL(const TDesC& aSection)
+	{
+	TBool dataOk = ETrue;
+
+	// get font specification
+	TFontSpec fontSpec;	
+	if ( !GetFontSpecFromConfig(aSection, KFldFont, fontSpec) )
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+
+	TPtrC wrapperName;
+	if ( GetStringFromConfig(aSection, KFldFbsFont, wrapperName) )
+		{
+		// "CFbsFont*&" type
+		if(dataOk)
+			{
+			CFbsFont* fbsFont = NULL;
+			INFO_PRINTF1(_L("execute GetNearestFontInPixels(CFbsFont*&, TFontSpec)"));
+			TInt err = GetFbsDevice()->GetNearestFontInPixels(fbsFont, fontSpec);
+			if (KErrNone !=  err)
+				{
+				ERR_PRINTF2(KLogError, err);
+				SetError(err);
+				}
+			else
+				{
+				SetDataObjectL(wrapperName, fbsFont);
+				}
+			}
+		}
+	else if( GetStringFromConfig(aSection, KFldFont, wrapperName) )
+		{
+		// "CFont*&" type
+		// hand over the ownership to parent class
+		return EFalse;
+		}
+	else
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+	
+	return ETrue;
+	}
+
+TBool CT_DataFbsDevice::DoCmdGetNearestFontInTwipsL(const TDesC& aSection)
+	{
+	TBool dataOk = ETrue;
+
+	// get font specification
+	TFontSpec fontSpec;	
+	if ( !GetFontSpecFromConfig(aSection, KFldFont, fontSpec) )
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+
+	TPtrC wrapperName;
+	if ( GetStringFromConfig(aSection, KFldFbsFont, wrapperName) )
+		{
+		// "CFbsFont*&" type
+		if(dataOk)
+			{
+			CFbsFont* fbsFont = NULL;
+			INFO_PRINTF1(_L("execute GetNearestFontInTwips(CFbsFont*&, TFontSpec)"));
+			TInt err = GetFbsDevice()->GetNearestFontInTwips(fbsFont, fontSpec);
+			if (KErrNone !=  err)
+				{
+				ERR_PRINTF2(KLogError, err);
+				SetError(err);
+				}
+			else
+				{
+				SetDataObjectL(wrapperName, fbsFont);
+				}
+			}
+		}
+	else if( GetStringFromConfig(aSection, KFldFont, wrapperName) )
+		{
+		// "CFont*&" type
+		// hand over the ownership to parent class
+		return EFalse;
+		}
+	else
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+	
+	return ETrue;
+	}
+
+TBool CT_DataFbsDevice::DoCmdGetNearestFontToDesignHeightInPixelsL(const TDesC& aSection)
+	{
+	TBool dataOk = ETrue;
+
+	// get font specification
+	TFontSpec fontSpec;	
+	if ( !GetFontSpecFromConfig(aSection, KFldFont, fontSpec) )
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+
+	TPtrC wrapperName;
+	if ( GetStringFromConfig(aSection, KFldFbsFont, wrapperName) )
+		{
+		// "CFbsFont*&" type
+		if(dataOk)
+			{
+			CFbsFont* fbsFont = NULL;
+			INFO_PRINTF1(_L("execute DoCmdGetNearestFontToDesignHeightInPixels(CFbsFont*&, TFontSpec)"));
+			TInt err = GetFbsDevice()->GetNearestFontToDesignHeightInPixels(fbsFont, fontSpec);
+			if (KErrNone !=  err)
+				{
+				ERR_PRINTF2(KLogError, err);
+				SetError(err);
+				}
+			else
+				{
+				SetDataObjectL(wrapperName, fbsFont);
+				}
+			}
+		}
+	else if( GetStringFromConfig(aSection, KFldFont, wrapperName) )
+		{
+		// "CFont*&" type
+		// hand over the ownership to parent class
+		return EFalse;
+		}
+	else
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+	
+	return ETrue;
+	}
+
+TBool CT_DataFbsDevice::DoCmdGetNearestFontToDesignHeightInTwipsL(const TDesC& aSection)
+	{
+	TBool dataOk = ETrue;
+
+	// get font specification
+	TFontSpec fontSpec;	
+	if ( !GetFontSpecFromConfig(aSection, KFldFont, fontSpec) )
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+
+	TPtrC wrapperName;
+	if ( GetStringFromConfig(aSection, KFldFbsFont, wrapperName) )
+		{
+		// "CFbsFont*&" type
+		if(dataOk)
+			{
+			CFbsFont* fbsFont = NULL;
+			INFO_PRINTF1(_L("execute DoCmdGetNearestFontToDesignHeightInTwips(CFbsFont*&, TFontSpec)"));
+			TInt err = GetFbsDevice()->GetNearestFontToDesignHeightInTwips(fbsFont, fontSpec);
+			if (KErrNone !=  err)
+				{
+				ERR_PRINTF2(KLogError, err);
+				SetError(err);
+				}
+			else
+				{
+				SetDataObjectL(wrapperName, fbsFont);
+				}
+			}
+		}
+	else if( GetStringFromConfig(aSection, KFldFont, wrapperName) )
+		{
+		// "CFont*&" type
+		// hand over the ownership to parent class
+		return EFalse;
+		}
+	else
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+	
+	return ETrue;
+	}
+
+TBool CT_DataFbsDevice::DoCmdGetNearestFontToMaxHeightInPixelsL(const TDesC& aSection)
+	{
+	TBool dataOk = ETrue;
+
+	// get font specification
+	TFontSpec fontSpec;	
+	if ( !GetFontSpecFromConfig(aSection, KFldFont, fontSpec) )
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+
+	// get maximum height in pixels
+	TInt maxHeight;
+	if ( !GetIntFromConfig(aSection, KFldMaxHeight, maxHeight) )
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldMaxHeight());
+		SetBlockResult(EFail);
+		}
+	
+	TPtrC wrapperName;
+	if ( GetStringFromConfig(aSection, KFldFbsFont, wrapperName) )	
+		{
+		// "CFbsFont*&" type
+		if(dataOk)
+			{
+			CFbsFont* fbsFont = NULL;
+			INFO_PRINTF1(_L("execute DoCmdGetNearestFontToMaxHeightInPixels(CFbsFont*&, TFontSpec)"));
+			TInt err = GetFbsDevice()->GetNearestFontToMaxHeightInPixels(fbsFont, fontSpec, maxHeight);
+			if (KErrNone !=  err)
+				{
+				ERR_PRINTF2(KLogError, err);
+				SetError(err);
+				}
+			else
+				{
+				SetDataObjectL(wrapperName, fbsFont);
+				}
+			}
+		}
+	else if( GetStringFromConfig(aSection, KFldFont, wrapperName) )
+		{
+		// "CFont*&" type
+		// hand over the ownership to parent class
+		return EFalse;
+		}
+	else
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+	
+	return ETrue;
+	}
+
+TBool CT_DataFbsDevice::DoCmdGetNearestFontToMaxHeightInTwipsL(const TDesC& aSection)
+	{
+	TBool dataOk = ETrue;
+
+	// get font specification
+	TFontSpec fontSpec;	
+	if ( !GetFontSpecFromConfig(aSection, KFldFont, fontSpec) )
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+
+	// get maximum height in twips
+	TInt maxHeight;
+	if ( !GetIntFromConfig(aSection, KFldMaxHeight, maxHeight) )
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldMaxHeight());
+		SetBlockResult(EFail);
+		}
+	
+	TPtrC wrapperName;
+	if ( GetStringFromConfig(aSection, KFldFbsFont, wrapperName) )
+		{
+		// "CFbsFont*&" type
+		if(dataOk)
+			{
+			CFbsFont* fbsFont = NULL;
+			INFO_PRINTF1(_L("execute DoCmdGetNearestFontToMaxHeightInTwips(CFbsFont*&, TFontSpec)"));
+			TInt err = GetFbsDevice()->GetNearestFontToMaxHeightInTwips(fbsFont, fontSpec, maxHeight);
+			if (KErrNone !=  err)
+				{
+				ERR_PRINTF2(KLogError, err);
+				SetError(err);
+				}
+			else
+				{
+				SetDataObjectL(wrapperName, fbsFont);
+				}
+			}
+		}
+	else if( GetStringFromConfig(aSection, KFldFont, wrapperName) )
+		{
+		// "CFont*&" type
+		// hand over the ownership to parent class
+		return EFalse;
+		}
+	else
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+	
+	return ETrue;
+	}
+
+TBool CT_DataFbsDevice::DoCmdCreateContextL(const TDesC& aSection)
+	{
+	TPtrC wrapperName;
+
+	if (!GetStringFromConfig(aSection, KFldBitGc, wrapperName))
+		{
+		return EFalse;
+		}
+	else
+		{
+		CDataWrapper* wrapper = GetDataWrapperL(wrapperName);
+		if (wrapper == NULL)
+			{
+			ERR_PRINTF2(KLogMissingWrapper, &wrapperName);
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			CFbsBitGc* context = NULL;
+			INFO_PRINTF1(_L("execute CreateContext(CFbsBitGc*&)"));
+			TInt err = GetFbsDevice()->CreateContext(context);
+			if (err != KErrNone)
+				{
+				ERR_PRINTF2(KLogError, err);
+				SetError(err);
+				}
+			else
+				{
+				wrapper->SetObjectL(context);
+				}
+			}
+		return ETrue;
+		}
+	}
+
+void CT_DataFbsDevice::DoCmdRectCompareL(const TDesC& aSection)
+	{
+	TBool dataOk = ETrue;
+
+	// Get test data for command input parameter(s)
+	TRect datRect1;
+	if ( !GetRectFromConfig(aSection, KFldRect1, datRect1) )
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldRect1);
+		SetBlockResult(EFail);
+		}
+
+	TRect datRect2;
+	if ( !GetRectFromConfig(aSection, KFldRect2, datRect2) )
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldRect2);
+		SetBlockResult(EFail);
+		}
+
+	TBool expected;
+	if ( !GetBoolFromConfig(aSection, KFldExpected, expected) )
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldExpected);
+		SetBlockResult(EFail);
+		}
+	
+	if (dataOk)
+		{
+		TBool actual;
+		CFbsDevice* device = NULL;
+		CFbsDevice* self = GetFbsDevice();
+		if (!CT_GraphicsUtil::GetFbsDeviceL(*this, aSection, KFldFbsDevice, device) )
+			{
+			device = self;
+			}
+		actual = self->RectCompare(datRect1, *device, datRect2);
+		INFO_PRINTF2(_L("execute RectCompare(const TRect&, const CFbsDevice&, const TRect&)=%d"), actual);
+
+		if (actual != expected)
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataFbsDevice::DoCmdSetCustomPaletteL(const TDesC& aSection)
+	{
+	CPalette* palette= NULL;
+	
+	if ( !CT_GraphicsUtil::GetPaletteL(*this, aSection, KFldPalette(), palette) )
+		{
+		INFO_PRINTF1(_L("execute SetCustomPalette(NULL)"));
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute SetCustomPalette(const CPalette*)"));
+		}
+	
+	TInt err = GetFbsDevice()->SetCustomPalette(palette);
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+void CT_DataFbsDevice::DoCmdGraphicsAccelerator()
+	{
+	CGraphicsAccelerator* ga= NULL;
+	INFO_PRINTF1(_L("execute GraphicsAccelerator()"));
+	ga = GetFbsDevice()->GraphicsAccelerator();
+	if (ga != NULL)
+		{
+		INFO_PRINTF1(_L("GraphicsAccelerator Supported"));
+		}
+	else
+		{
+		INFO_PRINTF1(_L("GraphicsAccelerator Not Supported"));
+		}
+	}
+
+void CT_DataFbsDevice::DoCmdOrientation(const TDesC& aSection)
+	{
+	CFbsBitGc::TGraphicsOrientation actual = GetFbsDevice()->Orientation();
+	INFO_PRINTF2(_L("execute Orientation()=%d"), actual);
+
+	CFbsBitGc::TGraphicsOrientation expected;
+	if (!CT_GraphicsUtil::GetGraphicsOrientation(*this, aSection, KFldExpectedOrientation, expected))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldExpectedOrientation);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if (actual != expected)
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataFbsDevice::DoCmdDisplayMode16M(const TDesC& aSection)
+	{
+	TDisplayMode actual = GetFbsDevice()->DisplayMode16M();
+	INFO_PRINTF2(_L("execute DisplayMode16M()=%d"), actual);
+
+	// get display mode from parameters
+	TDisplayMode expected;
+	if (CT_GraphicsUtil::ReadDisplayMode(*this, aSection, KFldExpectedDisplayMode(), expected) )
+		{
+		if (actual != expected)
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataFbsDevice::DoCmdSetScalingFactor(const TDesC& aSection)
+	{
+	TBool dataOk = ETrue;
+	TPoint point;
+	
+	if ( !GetPointFromConfig(aSection, KFldOrigin, point) )
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldOrigin);
+		SetBlockResult(EFail);
+		}
+	
+	TInt factorX;
+	if ( !GetIntFromConfig(aSection, KFldFactorX, factorX) )
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFactorX);
+		SetBlockResult(EFail);
+		}
+
+	TInt factorY;
+	if ( !GetIntFromConfig(aSection, KFldFactorY, factorY) )
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFactorY);
+		SetBlockResult(EFail);
+		}
+
+	TInt divisorX;
+	if ( !GetIntFromConfig(aSection, KFldDivisorX, divisorX) )
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldDivisorX);
+		SetBlockResult(EFail);
+		}
+
+	TInt divisorY;
+	if ( !GetIntFromConfig(aSection, KFldDivisorY, divisorY) )
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldDivisorY);
+		SetBlockResult(EFail);
+		}
+	
+	if (dataOk)
+		{
+		INFO_PRINTF1(_L("execute SetScalingFactor(const TPoint&, TInt, TInt, TInt, TInt)"));
+		TInt err = GetFbsDevice()->SetScalingFactor(point, factorX, factorY, divisorX, divisorY);
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		}
+	}
+
+void CT_DataFbsDevice::DoCmdGetDrawRect(const TDesC& aSection)
+	{
+	TRect actual;
+	
+	INFO_PRINTF1(_L("execute GetDrawRect(TRect&)"));
+	GetFbsDevice()->GetDrawRect(actual);
+	INFO_PRINTF5(_L("DrawRect = (top.x=%d, top.y=%d, bottom.x=%d, bottom.y=%d)"), actual.iTl.iX, actual.iTl.iY, actual.iBr.iX, actual.iBr.iY);
+	
+	TRect expected;
+	if ( GetRectFromConfig(aSection, KFldExpectedDrawRect, expected) )
+		{
+		if (actual != expected)
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataFbsDevice::DoCmdRegisterLinkedTypefaceL(const TDesC& aSection)
+	{
+	CLinkedTypefaceSpecification* spec = NULL;
+	if (!CT_GraphicsUtil::GetLinkedTypefaceSpecificationL(*this, aSection, KFldLinkedTypefaceSpec, spec))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldLinkedTypefaceSpec);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		TInt actual;
+		INFO_PRINTF1(_L("execute RegisterLinkedTypeface(const CLinkedTypefaceSpecification&, TInt&)"));
+		TInt err = GetFbsDevice()->RegisterLinkedTypeface(*spec, actual);
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			return;
+			}
+
+		TInt expected;
+		if (GetIntFromConfig(aSection, KFldExpectedUid, expected))
+			{
+			if (actual != expected)
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/bitgdi/src/T_DataFbsScreenDevice.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,495 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+//	User includes
+#include "T_DataFbsScreenDevice.h"
+#include "T_GraphicsUtil.h"
+
+/*@{*/
+//Commands
+_LIT(KCmdNewL,						"NewL");
+_LIT(KCmdDestructor,				"~");
+
+_LIT(KCmdChangeScreenDevice,		"ChangeScreenDevice");
+_LIT(KCmdDrawSpriteBegin,		 	"DrawSpriteBegin");
+_LIT(KCmdDrawSpriteEnd,		 		"DrawSpriteEnd");
+_LIT(KCmdHardwareBitmap,		 	"HardwareBitmap");
+_LIT(KCmdScreenNo,		 			"ScreenNo");
+_LIT(KCmdSetAutoUpdate,		 		"SetAutoUpdate");
+_LIT(KCmdUpdate,           			"Update");
+_LIT(KCmdCancelSprite,				"CancelSprite");
+_LIT(KCmdHideSprite,		 		"HideSprite");
+_LIT(KCmdShowSprite,		 		"ShowSprite");
+
+_LIT(KCmdDisown,           			"disown");
+
+//Fields
+_LIT(KFldExpected,					"expected");
+_LIT(KLibName,						"libname");
+_LIT(KScreenNumber,					"screen_number");
+_LIT(KRgbColorRed,					"rgb_red");
+_LIT(KRgbColorGreen,				"rgb_green");
+_LIT(KRgbColorBlue,					"rgb_blue");
+_LIT(KDisplayMode,					"displaymode");
+_LIT(KAutoUpdate,					"autoupdate");
+_LIT(KRegion,						"region");	
+_LIT(KFbsScreenDevice, 				"FbsScrDevName");
+_LIT(KFldRect,						"rect");
+_LIT(KFldRegion,					"region");
+_LIT(KSpriteBase,					"spritebase");
+
+//Logging
+_LIT(KLogMissingParameter,			"Missing parameter '%S'");
+
+/*@}*/
+/**
+* Two phase constructor
+*/
+CT_DataFbsScreenDevice* CT_DataFbsScreenDevice::NewL()
+	{
+	CT_DataFbsScreenDevice*	ret = new (ELeave) CT_DataFbsScreenDevice();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+/**
+* Protected constructor. First phase construction
+*/
+CT_DataFbsScreenDevice::CT_DataFbsScreenDevice()
+:	CT_DataFbsDevice()
+,	iFbsScreenDevice(NULL)
+	{
+	}
+
+/**
+* Protected second phase construction
+*/
+void CT_DataFbsScreenDevice::ConstructL()
+	{
+	}
+
+/**
+ * Set the object that the data wraps
+ *
+ * @param    aObject object that the wrapper is testing
+ *
+ */
+void CT_DataFbsScreenDevice::SetObjectL(TAny* aAny)
+	{
+	DestroyData();
+	iFbsScreenDevice = static_cast<CFbsScreenDevice*> (aAny);
+	}
+
+void CT_DataFbsScreenDevice::DisownObjectL()
+	{
+	iFbsScreenDevice = NULL;
+	}
+
+/**
+* Destructor. 
+*/
+CT_DataFbsScreenDevice::~CT_DataFbsScreenDevice()
+	{
+	DestroyData();
+	}
+
+void CT_DataFbsScreenDevice::DestroyData()
+	{
+	delete iFbsScreenDevice;
+	iFbsScreenDevice=NULL;
+	}
+
+MGraphicsDeviceMap* CT_DataFbsScreenDevice::GetGraphicsDeviceMap() const
+	{
+	return iFbsScreenDevice;
+	}
+
+CGraphicsDevice* CT_DataFbsScreenDevice::GetGraphicsDevice() const
+	{
+	return iFbsScreenDevice;
+	}
+
+CBitmapDevice* CT_DataFbsScreenDevice::GetBitmapDevice() const
+	{
+	return iFbsScreenDevice;
+	}
+
+CFbsDevice* CT_DataFbsScreenDevice::GetFbsDevice() const
+	{
+	return iFbsScreenDevice;
+	}
+
+/**
+* Return a pointer to the object that the data wraps
+*
+* @return pointer to the object that the data wraps
+*/
+TAny* CT_DataFbsScreenDevice::GetObject()
+	{
+	return iFbsScreenDevice;
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataFbsScreenDevice::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	/* Another work package will complete the implement of this */
+	TBool	retVal = ETrue;
+
+	if ( aCommand == KCmdNewL )
+		{
+		DoCmdNew(aSection);
+		}
+	else if (aCommand == KCmdDestructor)
+		{
+		DoCmdDestructor();
+		}
+	else if (aCommand == KCmdChangeScreenDevice)
+		{
+		DoCmdChangeScreenDeviceL(aSection);
+		}
+	else if (aCommand == KCmdDrawSpriteBegin)
+		{
+		DoCmdDrawSpriteBegin();
+		}
+	else if (aCommand == KCmdDrawSpriteEnd)
+		{
+		DoCmdDrawSpriteEnd();
+		}
+	else if (aCommand == KCmdHardwareBitmap)
+		{
+		DoCmdHardwareBitmap();
+		}
+	else if (aCommand == KCmdScreenNo)
+		{
+		DoCmdScreenNo(aSection);
+		}
+	else if (aCommand == KCmdSetAutoUpdate)
+		{
+		DoCmdSetAutoUpdate(aSection);
+		}
+	else if (aCommand == KCmdUpdate)
+		{
+		DoCmdUpdateL(aSection);
+		}
+	else if (aCommand == KCmdCancelSprite)
+		{
+		DoCmdCancelSprite();
+		}
+	else if (aCommand == KCmdHideSprite)
+		{
+		DoCmdHideSpriteL(aSection);
+		}
+	else if (aCommand == KCmdShowSprite)
+		{
+		DoCmdShowSpriteL(aSection);
+		}
+	else if (aCommand == KCmdDisown)
+		{
+		DisownObjectL();
+		}
+	else
+		{
+		retVal = CT_DataFbsDevice::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+
+	return retVal;
+	}
+
+void CT_DataFbsScreenDevice::DoCmdNew(const TDesC& aSection)
+	{
+	DestroyData();
+
+	// get display mode from parameters
+	TDisplayMode	displayMode=ENone;
+	TBool			hasDisplayMode=CT_GraphicsUtil::ReadDisplayMode(*this, aSection, KDisplayMode(), displayMode);
+
+	// get lib name from parameters
+
+	TPtrC	libName;
+	TBool	hasLibName=GetStringFromConfig(aSection, KLibName(), libName);
+
+	TBool	useRgb = EFalse;
+
+	TInt	red = 0;
+	if(GetIntFromConfig(aSection, KRgbColorRed(), red))
+		{
+		useRgb=ETrue;
+		}
+
+	TInt	green = 0;
+	if(GetIntFromConfig(aSection, KRgbColorGreen(), green))
+		{
+		useRgb=ETrue;
+		}
+
+	TInt	blue = 0;
+	if(GetIntFromConfig(aSection, KRgbColorBlue(), blue))
+		{
+		useRgb = ETrue;
+		}
+
+	// get screen number from parameters
+	TInt	screenNumber = 0;
+	GetIntFromConfig(aSection, KScreenNumber(), screenNumber);
+
+	TInt	err=KErrNone;
+	if ( !hasDisplayMode )
+		{
+		//	Find the best display mode
+		for ( TDisplayMode testMode=TDisplayMode(ENone+1); testMode<EColorLast; testMode=TDisplayMode(testMode+1) )
+			{
+			if ( hasLibName ) // if lib name is given
+				{		
+				if ( useRgb )
+					{
+					TRAP(err, iFbsScreenDevice=CFbsScreenDevice::NewL(libName, testMode, TRgb(red, green, blue)));
+					}
+				else
+					{
+					TRAP(err, iFbsScreenDevice=CFbsScreenDevice::NewL(libName, testMode));
+					}
+				}
+			else // if lib name is not given
+				{		
+				TRAP(err, iFbsScreenDevice=CFbsScreenDevice::NewL(screenNumber, testMode));
+				}
+
+			//	Test if Mode OK
+			if ( err==KErrNone )
+				{
+				displayMode=testMode;
+				hasDisplayMode=ETrue;
+				delete iFbsScreenDevice;
+				iFbsScreenDevice=NULL;
+				INFO_PRINTF2(_L("Mode %d supported"), testMode);
+				}
+			}
+		}
+
+	if ( hasDisplayMode )
+		{
+		if ( hasLibName ) // if lib name is given
+			{		
+			if ( useRgb )
+				{
+				TRAP(err, iFbsScreenDevice=CFbsScreenDevice::NewL(libName, displayMode, TRgb(red, green, blue)));
+				}
+			else
+				{
+				TRAP(err, iFbsScreenDevice=CFbsScreenDevice::NewL(libName, displayMode));
+				}
+			}
+		else // if lib name is not given
+			{		
+			TRAP(err, iFbsScreenDevice=CFbsScreenDevice::NewL(screenNumber, displayMode));
+			}
+
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(_L("NewL failed with error %d"), err);
+			SetError(err);
+			}
+		}
+	else
+		{
+		ERR_PRINTF1(_L("No Display Mode"));
+		SetBlockResult(EFail);
+		}
+	}
+
+void CT_DataFbsScreenDevice::DoCmdDestructor()
+	{
+	DestroyData();
+	}
+
+void CT_DataFbsScreenDevice::DoCmdChangeScreenDeviceL(const TDesC& aSection)
+	{
+	TPtrC	FbsScreenDevNameOld;
+	CFbsScreenDevice*	FbsScreenDevOld = NULL;
+	
+	if (GetStringFromConfig(aSection, KFbsScreenDevice, FbsScreenDevNameOld))
+		{
+		FbsScreenDevOld = static_cast<CFbsScreenDevice*>(GetDataObjectL(FbsScreenDevNameOld));
+		INFO_PRINTF1(_L("FbsScreenDevice::ChangeScreenDevice(CFbsScreenDevice *aOldDevice) is called!"));
+		iFbsScreenDevice->ChangeScreenDevice(FbsScreenDevOld);
+		}
+	else
+		{
+		INFO_PRINTF2(KLogMissingParameter, &KFbsScreenDevice);
+		SetBlockResult(EFail);
+		}
+	}
+
+void CT_DataFbsScreenDevice::DoCmdDrawSpriteBegin()
+	{
+	INFO_PRINTF1(_L("FbsScreenDevice::DrawSpriteBegin() is called!"));
+	iFbsScreenDevice->DrawSpriteBegin();
+	}
+
+void CT_DataFbsScreenDevice::DoCmdDrawSpriteEnd()
+	{
+	INFO_PRINTF1(_L("FbsScreenDevice::DrawSpriteEnd() is called!"));
+	iFbsScreenDevice->DrawSpriteEnd();
+	}
+
+void CT_DataFbsScreenDevice::DoCmdHardwareBitmap()
+	{	
+	INFO_PRINTF1(_L("FbsScreenDevice::HardwareBitmap() is called!"));
+	RHardwareBitmap handle = iFbsScreenDevice->HardwareBitmap();
+	INFO_PRINTF2(_L("The actual handle from HardwareBitmap() is %d"), handle.iHandle);
+	}
+
+void CT_DataFbsScreenDevice::DoCmdScreenNo(const TDesC& aSection)
+	{
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("FbsScreenDevice::ScreenNo() is called!"));
+	TInt actual = iFbsScreenDevice->ScreenNo();
+	INFO_PRINTF2(_L("The actual result of ScreenNo() is %d"), actual);
+
+	// Diaplay command return value, check if it matches the expected value
+	TInt expected;
+	if (!GetIntFromConfig(aSection, KFldExpected, expected))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldExpected);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if (actual!=expected)
+			{
+			ERR_PRINTF3(_L("The expected result %d is not equal to the actual result %d!"), expected, actual);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataFbsScreenDevice::DoCmdSetAutoUpdate(const TDesC& aSection)
+	{
+	TBool autoupdate;
+	if (!GetBoolFromConfig(aSection, KAutoUpdate, autoupdate))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KAutoUpdate);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		iFbsScreenDevice->SetAutoUpdate(autoupdate);
+		INFO_PRINTF2(_L("FbsScreenDevice::SetAutoUpdate(%d) has been called."), autoupdate);
+		}
+	}
+
+void CT_DataFbsScreenDevice::DoCmdUpdateL(const TDesC& aSection)
+	{
+	RRegion region(1);
+	CleanupClosePushL(region);
+	
+	if (GetRegionFromConfig(aSection, KRegion(), region))
+		{
+		INFO_PRINTF1(_L("FbsScreenDevice::Update(const TRegion &aRegion) has been called."));
+		iFbsScreenDevice->Update(region);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("FbsScreenDevice::Update() has been called."));
+		iFbsScreenDevice->Update();
+		}
+	CleanupStack::PopAndDestroy(&region);
+	}
+
+void CT_DataFbsScreenDevice::DoCmdCancelSprite()
+	{
+	INFO_PRINTF1(_L("execute CancelSprite()!"));
+	iFbsScreenDevice->CancelSprite();
+	}
+
+void CT_DataFbsScreenDevice::DoCmdHideSpriteL(const TDesC& aSection)
+	{
+	TSpriteBase* spritebase = NULL;
+	TRect datRect;
+	RRegion	datRegion(1);
+	CleanupClosePushL(datRegion);
+
+	if (GetRectFromConfig(aSection, KFldRect, datRect))
+		{
+		if (GetRegionFromConfig(aSection, KFldRegion, datRegion))
+			{
+			INFO_PRINTF1(_L("execute HideSprite(const TRect &aRect, const TRegion *aClippingRegion)!"));
+			spritebase = iFbsScreenDevice->HideSprite(datRect, &datRegion);
+			}
+		else
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KFldRegion);
+			SetBlockResult(EFail);
+			}
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute HideSprite(void)!"));
+		spritebase = iFbsScreenDevice->HideSprite();
+		}
+	
+	CleanupStack::PopAndDestroy(&datRegion);
+	}
+
+
+void CT_DataFbsScreenDevice::DoCmdShowSpriteL(const TDesC& aSection)
+	{
+	TSpriteBase* spritebase = NULL;
+	TPtrC SpriteBase;
+	TRect datRect;
+	RRegion	datRegion(1);
+	CleanupClosePushL(datRegion);
+			
+	if (GetStringFromConfig(aSection, KSpriteBase, SpriteBase))
+		{
+		spritebase = static_cast<TSpriteBase*>(GetDataObjectL(SpriteBase));
+		}
+	else
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KSpriteBase);
+		SetBlockResult(EFail);
+		}
+
+	if (GetRectFromConfig(aSection, KFldRect, datRect))
+		{
+		if (GetRegionFromConfig(aSection, KFldRegion, datRegion))
+			{
+			INFO_PRINTF1(_L("execute ShowSprite(TSpriteBase*, const TRect&, const TRegion*)!"));
+			iFbsScreenDevice->ShowSprite(spritebase, datRect, &datRegion);
+			}
+		else
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KFldRegion);
+			SetBlockResult(EFail);
+			}
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute ShowSprite(TSpriteBase*)!"));
+		iFbsScreenDevice->ShowSprite(spritebase);
+		}
+	CleanupStack::PopAndDestroy(&datRegion);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/bitgdi/src/T_DataPolygonFiller.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,316 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "T_DataPolygonFiller.h"
+#include "T_GraphicsUtil.h"
+
+_LIT(KDataClassname,								"CPolygonFiller");
+
+///	Fields
+_LIT(KFldScanLine,									"scanline");
+_LIT(KFldPointList,									"pointlist");
+_LIT(KFldFillRule,									"fillrule");
+_LIT(KFldUsage,										"usage");
+_LIT(KFldnumPoints,									"numpoints");
+_LIT(KFldExpectedScanLine,							"expectedscanline");
+_LIT(KFldExpectedStart,								"expectedstart");
+_LIT(KFldExpectedEnd,								"expectedend");
+_LIT(KFldExpectedExists,							"expectedexists");
+///	Commands
+_LIT(KCmdnewL,										"new");
+_LIT(KCmdConstructL,								"Construct");
+_LIT(KCmdDestructorGeneral,							"~");
+_LIT(KCmdDestructor,								"~CPolygonFiller");
+_LIT(KCmdReset,										"Reset");
+_LIT(KCmdGetNextPixelRun,							"GetNextPixelRun");
+_LIT(KCmdGetNextPixelRunOnSpecifiedScanLine,		"GetNextPixelRunOnSpecifiedScanLine");
+
+//Log
+_LIT(KLogErrNum,									"Error=%d");
+_LIT(KLogInfoCmdnewL, 						    	"execute new CPolygonFiller()");
+_LIT(KLogMissingParameter, 							"Missing parameter '%S'");
+_LIT(KLogInfoCmdDestructor1, 						"execute ~CPolygonFiller()");
+_LIT(KLogInfoCmdConstruct1,							"execute Construct(TPoint*, TInt, TFillRule,TUsage)");
+_LIT(KLogInfoCmdConstruct2,							"execute Construct(CArrayFix<TPoint>*, TFillRule,TUsage)");
+_LIT(KLogInfoCmdReset,								"execute Reset()");
+_LIT(KLogInfoCmdGetNextPixelRun,					"execute GetNextPixelRun()");
+_LIT(KLogInfoCmdGetNextPixelRunOnSpecifiedScanLine,	"execute GetNextPixelRunOnSpecifiedScanLine()");
+_LIT(KLogInfoNotCheckThePosition,   			    "Won't check the position on the scan line in the test case");
+CT_DataPolygonFiller* CT_DataPolygonFiller::NewL()
+	{
+	CT_DataPolygonFiller*	ret = new (ELeave) CT_DataPolygonFiller();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+CT_DataPolygonFiller::CT_DataPolygonFiller()
+:	iPolygonFiller(NULL)
+	{
+	}
+
+void CT_DataPolygonFiller::ConstructL()
+	{
+	iPointsArray=NULL;
+	iPoints=NULL;
+	}
+
+CT_DataPolygonFiller::~CT_DataPolygonFiller()
+	{
+	DestroyData();
+	
+	delete iPointsArray;
+	iPointsArray=NULL;
+	
+	delete[] iPoints;
+	iPoints=NULL;
+	}
+
+TAny* CT_DataPolygonFiller::GetObject()
+	{
+	return iPolygonFiller;
+	}
+
+void CT_DataPolygonFiller::SetObjectL(TAny* aAny)
+	{
+	DestroyData();
+	iPolygonFiller = static_cast<CPolygonFiller*> (aAny);
+	}
+
+void CT_DataPolygonFiller::DisownObjectL()
+	{
+	iPolygonFiller = NULL;
+	}
+
+void CT_DataPolygonFiller::DestroyData()
+	{
+	DoCmdDestructor();
+	}
+
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @return ETrue if the command is processed
+*/
+TBool CT_DataPolygonFiller::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt)
+	{
+	TBool	ret = ETrue;
+
+	if ( aCommand==KCmdDestructorGeneral || aCommand==KCmdDestructor )
+		{
+		DoCmdDestructor();
+		}
+	else if ( aCommand==KCmdnewL || aCommand==KDataClassname )
+		{
+		DoCmdnewL();
+		}
+	else if(aCommand==KCmdConstructL)
+		{
+		DoCmdConstructL(aSection);
+		}
+	else if ( aCommand==KCmdReset )
+		{
+		DoCmdReset();
+		}
+	else if ( aCommand==KCmdGetNextPixelRun )
+		{
+		DoCmdGetNextPixelRun(aSection);
+		}
+	else if ( aCommand==KCmdGetNextPixelRunOnSpecifiedScanLine )
+		{
+		DoCmdGetNextPixelRunOnSpecifiedScanLine(aSection);
+		}
+	else
+		{
+		ret=EFalse;
+		}
+	return ret;
+	}
+
+void CT_DataPolygonFiller::DoCmdnewL()
+	{ 
+	DestroyData();
+	TInt err = KErrNone;
+	INFO_PRINTF1(KLogInfoCmdnewL);
+	TRAP(err, iPolygonFiller = new (ELeave) CPolygonFiller());
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogErrNum, err);
+		SetError(err);
+		}
+	}
+
+void CT_DataPolygonFiller::DoCmdConstructL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+    TInt datNumPoints=0;
+    TInt err=0;
+    CGraphicsContext::TFillRule	datFillRule=CGraphicsContext::EAlternate;
+    CPolygonFiller::TUsage datUsage=CPolygonFiller::EGetAllPixelRunsSequentially;
+
+	CT_GraphicsUtil::ReadFillRule(*this, aSection, KFldFillRule, datFillRule);
+    CT_GraphicsUtil::ReadTUsage(*this,aSection,KFldUsage,datUsage);
+	
+//Use TPoint parameter to construct if the number of points in the list is assigned.
+	if (GetIntFromConfig(aSection, KFldnumPoints, datNumPoints))
+		{
+		iPoints=new (ELeave) TPoint[datNumPoints];
+		if ( !GetPointListFromConfig(aSection, KFldPointList, datNumPoints, iPoints))
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KFldPointList());
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			// Execute command and log parameters
+			INFO_PRINTF1(KLogInfoCmdConstruct1);
+			iPolygonFiller->Construct(iPoints, datNumPoints, datFillRule, datUsage);
+			}
+		}
+	else
+		{
+		iPointsArray=new (ELeave) CArrayFixFlat<TPoint>(1);
+		TBool	hasPointList=GetPointListFromConfigL(aSection, KFldPointList, *iPointsArray);
+				
+		if ( !hasPointList )
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KFldPointList());
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			// Execute command and log parameters
+			INFO_PRINTF1(KLogInfoCmdConstruct2);
+			iPolygonFiller->Construct(iPointsArray,datFillRule,datUsage);
+			}
+		}
+	}
+
+void CT_DataPolygonFiller::DoCmdDestructor()
+	{
+	INFO_PRINTF1(KLogInfoCmdDestructor1);
+	delete iPolygonFiller;
+	iPolygonFiller = NULL;
+	}
+
+void CT_DataPolygonFiller::DoCmdReset()
+	{
+	INFO_PRINTF1(KLogInfoCmdReset);
+	iPolygonFiller->Reset();
+	}
+
+void CT_DataPolygonFiller::DoCmdGetNextPixelRun(const TDesC& aSection)
+	{
+	TBool relExists,expectedExists;
+	TInt relScanLine,relStart,relEnd,expectedScanLine,expectedStart,expectedEnd;
+	INFO_PRINTF1(KLogInfoCmdGetNextPixelRun);
+	iPolygonFiller->GetNextPixelRun(relExists,relScanLine,relStart,relEnd);
+	//Verify the scanline is expected
+	if(!GetBoolFromConfig(aSection,KFldExpectedExists,expectedExists))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldExpectedExists);
+		SetBlockResult(EFail);
+		}
+	else if(relExists!=expectedExists)
+    	{
+    	ERR_PRINTF3(_L("The returned Exists value is not as expected, expected: %d, result: %d"), expectedExists , relExists);        
+    	SetBlockResult(EFail);
+    	}
+	if(!GetIntFromConfig(aSection,KFldExpectedScanLine,expectedScanLine))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldExpectedScanLine);
+		SetBlockResult(EFail);
+		}
+	else if(relScanLine!=expectedScanLine)
+    	{
+    	ERR_PRINTF3(_L("The returned Scanline value is not as expected, expected: %d, result: %d"), expectedScanLine , relScanLine);        
+    	SetBlockResult(EFail);
+    	}
+    //Verify the start position on the scan line  
+    if(!GetIntFromConfig(aSection,KFldExpectedStart,expectedStart))
+    	{
+    	INFO_PRINTF1(KLogInfoNotCheckThePosition);
+
+    	}
+    else if(relStart!=expectedStart)
+    	{
+    	ERR_PRINTF3(_L("The returned Start Position value is not as expected, expected: %d, result: %d"), expectedStart , relStart);        
+    	SetBlockResult(EFail);
+    	}
+    //Verify the end position on the scan line
+    if(!GetIntFromConfig(aSection,KFldExpectedEnd,expectedEnd))
+    	{
+    	INFO_PRINTF1(KLogInfoNotCheckThePosition);
+
+		}
+    else if(relEnd!=expectedEnd)
+    	{
+    	ERR_PRINTF3(_L("The returned End Position value is not as expected, expected: %d, result: %d"), expectedEnd , relEnd);        
+    	SetBlockResult(EFail);
+    	} 
+	}
+
+void CT_DataPolygonFiller::DoCmdGetNextPixelRunOnSpecifiedScanLine(const TDesC& aSection)
+	{
+	TInt datScanLine=0;
+	TBool relExists,expectedExists;
+	TInt relStart,relEnd,expectedStart,expectedEnd;
+	
+	if (!GetIntFromConfig(aSection, KFldScanLine, datScanLine))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldScanLine);
+		SetBlockResult(EFail);
+		}
+	INFO_PRINTF1(KLogInfoCmdGetNextPixelRunOnSpecifiedScanLine);
+    iPolygonFiller->GetNextPixelRunOnSpecifiedScanLine(relExists,datScanLine,relStart,relEnd);
+	if(!GetBoolFromConfig(aSection,KFldExpectedExists,expectedExists))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldExpectedExists);
+		SetBlockResult(EFail);
+		}
+	else if(relExists!=expectedExists)
+    	{
+    	ERR_PRINTF3(_L("The returned Exists value is not as expected, expected: %d, result: %d"), expectedExists , relExists);        
+    	SetBlockResult(EFail);
+    	}
+    //Verify the start position on the scan line  
+    if(!GetIntFromConfig(aSection,KFldExpectedStart,expectedStart))
+    	{
+    	INFO_PRINTF1(KLogInfoNotCheckThePosition);
+
+    	}
+    else if(relStart!=expectedStart)
+		{
+    	ERR_PRINTF3(_L("The returned Start Position value is not as expected, expected: %d, result: %d"), expectedStart , relStart);        
+    	SetBlockResult(EFail);
+		}
+    //Verify the end position on the scan line
+    if(!GetIntFromConfig(aSection,KFldExpectedEnd,expectedEnd))
+    	{
+    	INFO_PRINTF1(KLogInfoNotCheckThePosition);
+
+    	}
+    else if(relEnd!=expectedEnd)
+    	{
+    	ERR_PRINTF3(_L("The returned End Position value is not as expected, expected: %d, result: %d"), expectedEnd , relEnd);        
+    	SetBlockResult(EFail);
+    	} 
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/bitgdi/src/T_GraphicsBitgdiAPIServer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,245 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// The main entry point for the TEF Server T_GraphicsBitgdiAPIServer.exe
+
+//	User Includes
+#include "T_GraphicsBitgdiAPIServer.h"
+#include "T_DataBitmapUtil.h"
+#include "T_DataFbsBitmap.h"
+#include "T_DataWsBitmap.h"
+#include "T_DataFbsBitmapDevice.h"
+#include "T_DataFbsScreenDevice.h"
+#include "T_DataAlgStyle.h"
+#include "T_DataFbsBitGc.h"
+#include "T_DataFbsSession.h"
+#include "T_DataWsSession.h"
+#include "T_DataPalette.h"
+#include "T_DataPolygonFiller.h"
+#include "T_DataFbsFont.h"
+#include "T_DataFbsTypefaceStore.h"
+#include "T_DataWsScreenDevice.h"
+#include "T_DataFbsBitGcBitmap.h"
+#include "T_DataFbsBitGcFont.h"
+#include "T_DataLinkedTypefaceSpecification.h"
+
+//	EPOC Includes
+#include <rsshared.h>
+
+/**
+ * @enum Constant Literals used.
+ */
+/*@{*/
+// Graphics BITGDI API
+_LIT(KDataFbsBitGc,				"CFbsBitGc");
+_LIT(KDataPolygonFiller,       	"CPolygonFiller");
+
+//from T_FBServAPI
+_LIT(KRFbsSessionData, 			"RFbsSession");
+_LIT(KCFbsFontData, 			"CFbsFont");
+_LIT(KCFbsBitmapData, 			"CFbsBitmap");
+_LIT(KCWsBitmapData, 			"CWsBitmap");
+_LIT(KTBitmapUtilData, 			"TBitmapUtil");
+_LIT(KCFbsTypefaceStoreData,	"CFbsTypefaceStore");
+_LIT(KCFbsColor256BitmapUtil,	"CFbsColor256BitmapUtil");
+_LIT(KCPalette,					"CPalette");
+_LIT(KCFbsBitmapDevice,			"CFbsBitmapDevice");
+_LIT(KCFbsScreenDevice,			"CFbsScreenDevice");
+_LIT(KTAlgStyle,				"TAlgStyle");
+_LIT(KTMeasureTextInput,		"TMeasureTextInput");
+_LIT(KTMeasureTextOutput,		"TMeasureTextOutput");
+_LIT(KRWsSession,				"RWsSession");
+_LIT(KCWsScreenDevice,			"CWsScreenDevice");
+_LIT(KCFbsBitGcBitmap,			"CFbsBitGcBitmap");
+_LIT(KCFbsBitGcFont,			"CFbsBitGcFont");
+
+//from T_GraphicsFntstoreAPI
+_LIT(KCLinkedTypefaceSpecification,	"CLinkedTypefaceSpecification");
+
+/*@}*/
+
+
+inline CDataWrapper* CT_GraphicsBitgdiAPIServer::CT_GraphicsBitgdiAPIBlock::CreateDataL( const TDesC& aData )
+	{
+	CDataWrapper*	wrapper = NULL;
+
+	if ( aData==KRFbsSessionData )
+		{
+		wrapper=CT_DataFbsSession::NewL();
+		}
+	else if ( aData==KCFbsScreenDevice )
+		{
+		wrapper=CT_DataFbsScreenDevice::NewL();
+		}
+	else if ( aData==KDataFbsBitGc )
+		{
+		wrapper=CT_DataFbsBitGc::NewL();
+		}
+	else if ( aData==KCPalette )
+		{
+		wrapper=CT_DataPalette::NewL();
+		}
+	else if (aData==KDataPolygonFiller)
+		{
+		wrapper=CT_DataPolygonFiller::NewL();
+		}
+	else if (aData == KCFbsFontData)
+        {
+		wrapper=CT_DataFbsFont::NewL();
+        }
+	else if (aData==KCFbsBitmapData)
+		{
+		wrapper=CT_DataFbsBitmap::NewL();
+		}
+	else if (aData==KCWsBitmapData)
+		{
+		wrapper=CT_DataWsBitmap::NewL();
+		}
+	else if (aData==KRWsSession)
+		{
+		wrapper=CT_DataWsSession::NewL();
+		}
+	else if (aData==KCFbsTypefaceStoreData)
+		{
+		wrapper=CT_DataFbsTypefaceStore::NewL();
+		}
+	else if (aData==KCWsScreenDevice)
+		{
+		wrapper=CT_DataWsScreenDevice::NewL();
+		}
+	else if (aData==KCFbsBitmapDevice)
+		{
+		wrapper=CT_DataFbsBitmapDevice::NewL();
+		}
+	else if (aData==KCFbsBitGcBitmap)
+		{
+		wrapper=CT_DataFbsBitGcBitmap::NewL();
+		}
+	else if (aData==KCFbsBitGcFont)
+		{
+		wrapper=CT_DataFbsBitGcFont::NewL();
+		}
+	// from fontstore
+	else if (aData==KTAlgStyle)
+		{
+		wrapper=CT_DataAlgStyle::NewL();
+		}	
+	else if (aData==KCLinkedTypefaceSpecification)
+		{
+		wrapper=CT_DataLinkedTypefaceSpecification::NewL();
+		}
+	return wrapper;
+	}
+
+CT_GraphicsBitgdiAPIServer* CT_GraphicsBitgdiAPIServer::NewL()
+/**
+ * @return - Instance of the test server
+ * Same code for Secure and non-secure variants
+ * Called inside the MainL() function to create and start the
+ * CTestServer derived server.
+ */
+	{
+	CT_GraphicsBitgdiAPIServer*	server = new (ELeave) CT_GraphicsBitgdiAPIServer();
+	CleanupStack::PushL(server);
+	// CServer base class call
+	server->ConstructL();		/*Parsing the server name from the file name*/
+	CleanupStack::Pop(server);
+	return server;
+	}
+
+
+TInt LoadDrivers()
+	{
+#ifdef __WINS__
+	#define KPDDName _L("ECDRV")
+	#define KLDDName _L("ECOMM")
+#else
+	#define KPDDName _L("EUART1")
+	#define KLDDName _L("ECOMM")
+#endif
+	TInt rerr = KErrNone;
+
+	rerr = StartC32();
+	if( rerr!=KErrNone && rerr!=KErrAlreadyExists )
+		{
+		return rerr;
+		}
+
+	rerr = User::LoadPhysicalDevice(KPDDName);
+	if(rerr != KErrNone && rerr != KErrAlreadyExists)
+		{
+		return rerr;
+		}
+	rerr = User::LoadLogicalDevice(KLDDName);
+	if(rerr != KErrNone && rerr != KErrAlreadyExists)
+		{
+		return rerr;
+		}
+	return KErrNone;
+	}
+
+LOCAL_C void MainL()
+/**
+ * Secure variant
+ * Much simpler, uses the new Rendezvous() call to sync with the client
+ */
+	{
+#if (defined __DATA_CAGING__)
+	RProcess().DataCaging(RProcess::EDataCagingOn);
+	RProcess().SecureApi(RProcess::ESecureApiOn);
+#endif
+	CActiveScheduler*	sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sched);
+	CT_GraphicsBitgdiAPIServer*	server = NULL;
+	// Create the CTestServer derived server
+	TRAPD(err,server = CT_GraphicsBitgdiAPIServer::NewL());
+	if(!err)
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	delete server;
+	delete sched;
+	}
+
+GLDEF_C TInt E32Main()
+/**
+ * @return - Standard Epoc error code on process exit
+ * Secure variant only
+ * Process entry point. Called by client using RProcess API
+ */
+	{
+	TInt rerr = LoadDrivers();
+	if( rerr != KErrNone )
+		{
+		return rerr;
+		}
+
+	__UHEAP_MARK;
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+#if (defined TRAP_IGNORE)
+	TRAP_IGNORE(MainL());
+#else
+	TRAPD(err,MainL());
+#endif
+	delete cleanup;
+	__UHEAP_MARKEND;
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/bitgdi/src/t_prompt.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <e32base.h>
+#include <e32cons.h>
+#include <e32std.h>
+#include <e32property.h>
+
+/*@{*/
+const TInt KDefaultInterval	= 20000000;
+const TUid KMyPropertyCat = {0x10012345};
+
+_LIT(KPromptConsole, "Manual Check");
+/*@}*/
+
+LOCAL_C void MainL()
+	{
+	TInt argLen = User::CommandLineLength();
+	HBufC* hBuf = HBufC::NewLC(argLen);
+	TPtr tPtr = hBuf->Des();
+	User::CommandLine(tPtr);
+	CConsoleBase* console = Console::NewL(KPromptConsole, TSize(KConsFullScreen, KConsFullScreen));
+	CleanupStack::PushL(console);
+	console->Printf(KPromptConsole);
+	console->Printf(_L("\n\n\n\n\n"));
+	console->Printf(tPtr);
+	
+	RTimer timer;
+	CleanupClosePushL(timer);
+	timer.CreateLocal();
+	TRequestStatus timerStatus;
+	timer.After(timerStatus, TTimeIntervalMicroSeconds32(KDefaultInterval));
+	TRequestStatus readStatus;
+	console->Read(readStatus);
+	User::WaitForRequest(timerStatus, readStatus);
+	
+	TKeyCode keycode(EKeyNull);
+	if(timerStatus != KErrNone)
+		{
+		if(readStatus == KErrNone)
+			{
+			keycode = console->KeyCode();
+			}
+		timer.Cancel();
+		}
+
+	if(readStatus == KRequestPending)
+		{
+		console->ReadCancel();
+		}
+	
+	RProperty property;
+	CleanupClosePushL(property);
+	User::LeaveIfError( property.Attach(KMyPropertyCat, 1) );
+	User::LeaveIfError( property.Set((TInt)keycode) );
+	//property.Close();
+	CleanupStack::PopAndDestroy(4, hBuf); // &property, &timer, console, hBuf
+	}
+
+GLDEF_C TInt E32Main()
+/**
+ * @return - Standard Epoc error code on process exit
+ * Secure variant only
+ * Process entry point. Called by client using RProcess API
+ */
+	{
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		RProcess::Rendezvous(KErrNoMemory);
+		return KErrNoMemory;
+		}
+#if (defined TRAP_IGNORE)
+	TRAP_IGNORE(MainL());
+	RProcess::Rendezvous(KErrNone);
+#else
+	TRAPD(err,MainL());
+	RProcess::Rendezvous(err);
+#endif
+	delete cleanup;
+	return KErrNone;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/common/inc/DataWrapperActive.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __DATA_WRAPPER_ACTIVE__)
+#define __DATA_WRAPPER_ACTIVE__
+
+//	User includes
+#include "DataWrapperBase.h"
+
+class CDataWrapperActive : public CDataWrapperBase
+	{
+protected:
+	CDataWrapperActive();
+	virtual ~CDataWrapperActive();
+
+	virtual	CActive*	GetActive() = NULL;
+
+	virtual TBool		DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+private:
+	void				DoCmdCancel();
+	void				DoCmdiStatus(const TDesC& aSection);
+	};
+
+#endif /* __DATA_WRAPPER_ACTIVE__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/common/inc/DataWrapperBase.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __DATA_WRAPPER_BASE__)
+#define __DATA_WRAPPER_BASE__
+
+//	EPOC includes
+#include <datawrapper.h>
+#include <gdi.h>
+#include <w32std.h>
+
+class CDataWrapperBase : public CDataWrapper
+	{
+public:
+	TBool	GetBoolFromConfig(const TDesC& aSectName,const TDesC& aKeyName,TBool& aResult);
+	TBool	GetFontSpecFromConfig(const TDesC& aSectName,const TDesC& aKeyName,TFontSpec& aResult);
+	TBool	GetIntFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TInt& aResult);
+	TBool	GetStringFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TPtrC& aResult);
+	TBool	GetHexFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TInt& aResult);
+	TBool	GetPointFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TPoint& aResult);
+	TBool	GetRectFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TRect& aResult);
+	TBool	GetRegionFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TRegion& aResult);
+	TBool	GetRgbFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TRgb& aResult);
+	TBool	GetSizeFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TSize& aResult);
+	TBool	GetRgbListFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TInt aSize, TRgb*& aResult);
+	TBool	GetPointListFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TInt aSize, TPoint*& aResult);
+	TBool	GetPointListFromConfigL(const TDesC& aSectName, const TDesC& aKeyName, CArrayFix<TPoint>& aResult);
+	TBool	GetWsGraphicIdFromConfigL(const TDesC& aSectName, const TDesC& aKeyName, TWsGraphicId& aResult);
+
+	TBool   GetDateTimeFromConfig(const TDesC& aSectName,  TDateTime& aResult);
+	void	LogRegion(const TDesC& aMessage, const TRegion& aRegion);
+	void	LogRect(const TDesC& aMessage, const TRect& aRect);
+
+	virtual void	InitialiseL();
+
+	inline TInt					GetHandle() const;
+	inline TInt					GetIdentifier() const;
+	inline const TWsGraphicId&	GetId();
+
+protected:
+	CDataWrapperBase();
+	virtual ~CDataWrapperBase();
+
+	inline RFs&	FileServer();
+	inline void	SetHandle(TInt aHandle);
+	inline void SetIdentifier(TInt aIdentifier);
+	inline void	SetId(const TWsGraphicId&);
+protected:
+	TBool                   iGraphicsOrientation[4];
+private:
+	TBool	GetCommandStringParameterL(const TDesC& aSectName, const TDesC& aKeyName, TPtrC& aResult);
+
+private:
+	// Included ini files
+	RPointerArray<CIniData>	iInclude;
+	RPointerArray<HBufC>	iBuffer;
+	RFs                     iFs;
+	TInt					iHandle;
+	TInt					iIdentifier;
+	TWsGraphicId			iId;
+	};
+
+#include "DataWrapperBase.inl"
+
+#endif /* __DATA_WRAPPER_BASE__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/common/inc/DataWrapperBase.inl	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+inline RFs& CDataWrapperBase::FileServer()
+	{ 
+	return iFs;
+	}
+
+inline TInt CDataWrapperBase::GetHandle() const
+	{
+	return iHandle;
+	}
+
+inline void CDataWrapperBase::SetHandle(TInt aHandle)
+	{
+	iHandle=aHandle;
+	}
+	
+inline TInt CDataWrapperBase::GetIdentifier() const
+	{
+	return iIdentifier;
+	}
+
+inline void CDataWrapperBase::SetIdentifier(TInt aIdentifier)
+	{
+	iIdentifier=aIdentifier;
+	}
+
+const TWsGraphicId& CDataWrapperBase::GetId()
+	{
+	return iId;
+	}
+
+inline void CDataWrapperBase::SetId(const TWsGraphicId& aId)
+	{
+	iId.Set(aId.Uid());
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/common/inc/T_GraphicsUtil.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,148 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_UTIL_H__)
+#define __T_GRAPHICS_UTIL_H__
+
+//	User includes
+#include "DataWrapperBase.h"
+
+//	EPOC includes
+#include <gdi.h>
+#include <fntstore.h>
+#include <bitmap.h>
+#include <w32std.h>
+#include <icl/imagedata.h>
+#include <w32stdgraphic.h>	// for TWsGraphicAnimation
+
+class CT_GraphicsUtil
+	{
+public:
+	static TBool 	ReadBitmapfileCompressionScheme(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TBitmapfileCompressionScheme& aCompressionScheme);
+	static TBool 	ReadBrushStyle(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CGraphicsContext::TBrushStyle& aBrushStyle);
+	static TBool 	ReadCaptureFlags(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TUint& aCaptureFlags);
+	static TBool	ReadComputeMode(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, RWsSession::TComputeMode& aComputeMode);
+	static TBool	ReadCornerType(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TCornerType& aCornerType);
+	static TBool	ReadDisplayMode(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TDisplayMode& aDisplayMode);
+	static TBool 	ReadDrawMode(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CGraphicsContext::TDrawMode& aDrawMode);
+	static TBool 	ReadErrorCategory(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TWsErrorMessage::TErrorCategory& aErrorCategory);
+	static TBool 	ReadEventCode(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TEventCode& aEventCode);
+	static TBool 	ReadEventControl(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TEventControl& aEventControl);
+	static TBool 	ReadEventModifier(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TEventModifier& aEventModifier);
+	static TBool 	ReadEventModifier(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TUint& aEventModifier);
+	static TBool 	ReadFadeControl(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, RWindowTreeNode::TFadeControl& aFadeControl);
+	static TBool 	ReadFillRule(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CGraphicsContext::TFillRule& aFillRule);
+	static TBool 	ReadFontStrikethrough(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TFontStrikethrough& aFontStrikethrough);
+	static TBool 	ReadFontUnderline(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TFontUnderline& aFontUnderline);
+	static TBool 	ReadGlyphBitmapType(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TGlyphBitmapType& aGlyphBitmapType);
+	static TBool 	ReadGraphicsOrientation(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CFbsBitGc::TGraphicsOrientation& aGraphicsOrientation);
+	static TBool 	ReadHotKey(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, THotKey& aHotKey);
+	static TBool 	ReadKeyCode(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TKeyCode& aKeyCode);
+	static TBool	ReadLoggingCommand(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, RWsSession::TLoggingCommand& aLoggingCommand);
+	static TBool 	ReadModifierState(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TModifierState& aModifierState);
+	static TBool 	ReadPasswordMode(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TPasswordMode& aPasswordMode);
+	static TBool 	ReadPenStyle(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CGraphicsContext::TPenStyle& aPenStyle);
+	static TBool 	ReadPointerCursorMode(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TPointerCursorMode& aPointerCursorMode);
+	static TBool 	ReadPointerFilter(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TPointerFilter& aPointerFilter);
+	static TBool 	ReadPointerFilter(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TUint& aPointerFilter);
+	//For MAnim
+	static TBool 	ReadAnimCommand(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TInt& aCommand);
+	static TBool 	ReadAnimType(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TInt& aType);
+	static TBool 	ReadTUsage(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CPolygonFiller::TUsage& aUsage);
+#if defined(SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS)
+	static TBool 	ReadPriorities(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TInt& aPriorities);
+#endif
+	static TBool 	ReadPriority(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CActive::TPriority& aPriority);
+	static TBool 	ReadScreenModeEnforcement(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TScreenModeEnforcement& aScreenModeEnforcement);
+	static TBool 	ReadSpriteInCompare(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TUint& aSpriteInCompare);
+	static TBool 	ReadStdScanCode(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TStdScanCode& aStdScanCode);
+	static TBool 	ReadTextAlign(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CGraphicsContext::TTextAlign& aTextAlign);
+	static TBool 	ReadTextDirection(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CFont::TTextDirection& aTextDirection);
+	static TBool 	ReadType(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TPointerEvent::TType& aType);
+	static TBool 	ReadType(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TRawEvent::TType& aType);
+	static TBool 	ReadWindowBackupType(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TUint& aWindowBackupType);
+	static TBool 	ReadWsTransparencyPolicy(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TWsTransparencyPolicy& aWsTransparencyPolicy);
+	static TBool 	ReadWsVisibilityChangedEvent(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TWsVisibilityChangedEvent& aWsVisibilityChangedEvent);
+	static TBool	ReadLongCaptureFlags(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TLongCaptureFlags& aLongCaptureFlags);
+	static TBool	ReadSpriteFlags(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TSpriteFlags& aSpriteFlags);
+    static TBool	ReadSpriteFlags(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TUint& aSpriteFlags);
+	static TBool	ReadCustomTextCursorAlignment(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, RWsSession::TCustomTextCursorAlignment& aAlignment);
+	static TBool	ReadTypefaceSupport(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TTypefaceSupport& aTypefaceSupport);
+	static TBool	GetAlgStyleL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TAlgStyle*& aData);
+	static TBool	GetDrawableWindowL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, RDrawableWindow*& aData);
+	static TBool	GetDrawTextExtendedParamL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CGraphicsContext::TDrawTextExtendedParam*& aData);
+	static TBool	GetFbsBitmapL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CFbsBitmap*& aData);
+	static TBool	GetFbsDeviceL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CFbsDevice*& aData);
+	static TBool	GetFontL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CFont*& aData);
+	static TBool	GetPaletteL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CPalette*& aData);
+	static TBool	GetWsBitmapL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CWsBitmap*& aData);
+	static TBool	GetWsEventL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TWsEvent*& aData);
+	static TBool	GetWsGraphicMsgBufL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, RWsGraphicMsgBuf*& aData);
+	static TBool	GetWsScreenDeviceL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CWsScreenDevice*& aData);
+	static TBool	GetWsGraphicMsgFixedBaseL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TWsGraphicMsgFixedBase*& aData);
+	static TBool	GetWsPriorityKeyEventL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TWsPriorityKeyEvent*& aData);
+	static TBool	GetWsRedrawEventL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TWsRedrawEvent*& aData);
+	static TBool	GetTextCursor(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TTextCursor& aTextCursor);
+	static TBool	GetSpriteMemberL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TSpriteMember& aSpriteMember);
+	static TBool	GetSpriteMemberListL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CArrayFix<TSpriteMember>& aResult);
+	static TBool    BringAppForegroundL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aSessionKeyName , const TDesC& aAppKeyName);
+	static TBool    ReadTerminateReason(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, RDirectScreenAccess::TTerminationReasons& aReason);
+    static void     EatupMemory(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName);
+    static void     FreeEatenMemory(CDataWrapperBase& aDataWrapper);
+    static TBool    GetFrameInfo(CDataWrapperBase& aDataWrapper,const TDesC& aSectName, TFrameInfo& frameinfo);
+    static TBool    ReadFrameInfoFlags(CDataWrapperBase& aDataWrapper,const TDesC& aSectName, const TDesC& aKeyName,TUint32& aFlags);
+    static TBool    GetFrameInfoState(CDataWrapperBase& aDataWrapper,const TDesC& aSectName, const TDesC& aKeyName,TFrameInfo::TFrameInfoState& aState);
+    static TBool    GetWsGraphicAnimationL(CDataWrapperBase& aDataWrapper,const TDesC& aSectName, const TDesC& aKeyName, TWsGraphicAnimation*& aData);
+    static TBool    StartAnimTesterClientL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName);
+    static TBool    CloseAnimTesterClientL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName);
+    static TBool    GetFbsBitGcL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CFbsBitGc*& aData);
+    static TBool    GetGraphicsOrientation(CDataWrapperBase& aDataWrapper,const TDesC& aSectName, const TDesC& aKeyName,CFbsBitGc::TGraphicsOrientation& aParam);
+    static TBool	GetLinkedTypefaceSpecificationL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CLinkedTypefaceSpecification*& aData);
+    static TBool	GetRasterizerL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, COpenFontRasterizer*& aData);
+    static TBool	GetShaperFactoryL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CShaperFactory*& aData);
+    static TBool	GetOpenFontGlyphDataL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TOpenFontGlyphData*& aData);
+
+private:
+	static TBool	ConvertToCaptureFlags(const TDesC& aStr, RWindowBase::TCaptureFlags& aCaptureFlags);
+	static TBool	ConvertToCaptureFlags(const TDesC& aStr, TUint& aCaptureFlags);
+
+	static TBool	ConvertToEventModifier(const TDesC& aStr, TEventModifier& aEventModifier);
+	static TBool	ConvertToEventModifier(const TDesC& aStr, TUint& aEventModifier);
+
+	static TBool	ConvertToPointerFilter(const TDesC& aStr, TPointerFilter& aPointerFilter);
+	static TBool	ConvertToPointerFilter(const TDesC& aStr, TUint& aPointerFilter);
+
+	static TBool	ConvertToSpriteInCompare(const TDesC& aStr, TUint& aSpriteInCompare);
+
+	static TBool	ConvertToWindowBackupType(const TDesC& aStr, TWindowBackupType& aWindowBackupType);
+	static TBool	ConvertToWindowBackupType(const TDesC& aStr, TUint& aWindowBackupType);
+
+	static TBool	ConvertToWsVisibilityChangedEvent(const TDesC& aStr, TUint& aWsVisibilityChangedEvent);
+
+	static TBool	ConvertToSpriteFlags(const TDesC& aStr, TSpriteFlags& aSpriteFlags);
+	static TBool	ConvertToSpriteFlags(const TDesC& aStr, TUint& aSpriteFlags);
+	
+	static TBool    ConvertToFrameInfoFlags(const TDesC& aStr,TUint32& aFrameInfoFlags);
+private:
+ 
+	static TInt iAvaiableSpace;
+	static TInt iBiggestBlock;
+	static RPointerArray < TAny > iMemArray;
+	};
+
+#endif /* __T_GRAPHICS_UTIL_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/common/inc/TestServerBase.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __TEST_SERVER_BASE__)
+#define __TEST_SERVER_BASE__
+
+//	EPOC includes
+#include <testserver2.h>
+
+class CTestServerBase : public CTestServer2
+	{
+public:
+	// CTestServer implementation
+	virtual CTestStep*	CreateTestStep(const TDesC& aStepName);
+	};
+
+#endif /* __TEST_SERVER_BASE__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/common/inc/UtilityClearPanicDlg.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __UTILITY_CLEAR_PANIC_DLG_H__)
+#define __UTILITY_CLEAR_PANIC_DLG_H__
+
+//	EPOC includes
+#include <testexecutestepbase.h>
+
+class CUtilityClearPanicDlg : public CTestStep
+	{
+public:
+	CUtilityClearPanicDlg();
+
+	//	CTestStep implementation
+	virtual enum TVerdict	doTestStepL();
+	};
+
+#endif /* __UTILITY_CLEAR_PANIC_DLG_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/common/src/DataWrapperActive.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "DataWrapperActive.h"
+
+/*@{*/
+///	Constant Literals used.
+_LIT(KCmdCancel,					"Cancel");
+_LIT(KCmdiStatus,					"iStatus");
+
+_LIT(KFldExpected,					"expected");
+/*@}*/
+
+CDataWrapperActive::CDataWrapperActive()
+:	CDataWrapperBase()
+/**
+ * Protected constructor
+ */
+	{
+	}
+
+CDataWrapperActive::~CDataWrapperActive()
+/**
+ * Protected destructor
+ */
+	{
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CDataWrapperActive::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool ret=ETrue;
+
+	if ( aCommand==KCmdCancel )
+		{
+		DoCmdCancel();
+		}
+	else if ( aCommand==KCmdiStatus )
+		{
+		DoCmdiStatus(aSection);
+		}
+	else
+		{
+		ret=EFalse;
+		}
+
+	return ret;
+	}
+
+void CDataWrapperActive::DoCmdCancel()
+	{
+	INFO_PRINTF1(_L("++CActive::Cancel()"));
+	GetActive()->Cancel();
+	DecOutstanding();
+	INFO_PRINTF1(_L("--CActive::Cancel()"));
+	}
+
+void CDataWrapperActive::DoCmdiStatus(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("++CActive::iStatus"));
+	TRequestStatus	actual=GetActive()->iStatus;
+	INFO_PRINTF2(_L("iStatus=%d"), actual.Int());
+
+	TInt	expected;
+	if ( GetIntFromConfig(aSection, KFldExpected(), expected) )
+		{
+		if ( expected!=actual.Int() )
+			{
+			ERR_PRINTF1(_L("Expected value does not match actual"));
+			SetBlockResult(EFail);
+			}
+		}
+	INFO_PRINTF1(_L("--CActive::iStatus"));
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/common/src/DataWrapperBase.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,635 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "DataWrapperBase.h"
+
+/*@{*/
+///	Constant Literals used.
+_LIT(KIncludeSection,		"include");
+_LIT(KFile,					"file%d");
+_LIT(KMatch,				"*{*,*}*");
+_LIT(KStart,				"{");
+_LIT(KSeparator,			",");
+_LIT(KEnd,					"}");
+_LIT(KDataRead,				"INI READ : %S %S %S");
+
+_LIT(KFormatEntryField,		"%S_%S");
+
+_LIT(KTagFontSpecName,		"name");
+_LIT(KTagFontSpecHeight,	"height");
+
+_LIT(KTagPointX,			"x");
+_LIT(KTagPointY,			"y");
+
+_LIT(KTagRectTop,			"top");
+_LIT(KTagRectLeft,			"left");
+_LIT(KTagRectBottom,		"bottom");
+_LIT(KTagRectRight,			"right");
+
+_LIT(KTagRgbRed,			"red");
+_LIT(KTagRgbGreen,			"green");
+_LIT(KTagRgbBlue,			"blue");
+_LIT(KTagRgbAlpha,			"alpha");
+
+_LIT(KTagSizeWidth,			"width");
+_LIT(KTagSizeHeight,		"height");
+
+_LIT(KTagWsGraphicIdUid,	"uid");
+_LIT(KTagWsGraphicIdId,		"id");
+_LIT(KTagWsGraphicIdName,	"name");
+
+_LIT(KFormatFieldNumber,	"%S%d");
+
+///	Logging
+_LIT(KLogMissingParameter,	"Missing parameter '%S'");
+_LIT(KLogRegion,			"Region '%S'");
+_LIT(KLogEmpty,				"Empty");
+_LIT(KLogRegionsRect,		"Rect[%d] tl=(%d,%d) br=(%d,%d)");
+_LIT(KLogRect,				"%S  tl=(%d,%d) br=(%d,%d)");
+/*@}*/
+
+CDataWrapperBase::CDataWrapperBase()
+:	CDataWrapper()
+,	iHandle(0)
+,	iId(TWsGraphicId::EUninitialized)
+	{
+	}
+
+CDataWrapperBase::~CDataWrapperBase()
+/**
+ * Public destructor
+ */
+	{
+	iInclude.ResetAndDestroy();
+	iBuffer.ResetAndDestroy();
+	iFs.Close();
+	}
+
+void CDataWrapperBase::InitialiseL()
+	{
+	CDataWrapper::InitialiseL();
+
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+	TPtrC		fileName;
+	TBool		moreData=ETrue;
+	TBool		index=0;
+	while ( moreData )
+		{
+		tempStore.Format(KFile(), ++index);
+		moreData=GetStringFromConfig(KIncludeSection, tempStore, fileName);
+
+		if (moreData)
+			{
+			CIniData*	iniData=CIniData::NewL(fileName);
+			CleanupStack::PushL(iniData);
+			iInclude.Append(iniData);
+			CleanupStack::Pop(iniData);
+			}
+		}
+	User::LeaveIfError(iFs.Connect());
+	}
+
+TBool CDataWrapperBase::GetBoolFromConfig(const TDesC& aSectName,const TDesC& aKeyName,TBool& aResult)
+	{
+	TBool	ret=EFalse;
+	TPtrC	result;
+	TRAPD(err, ret=GetCommandStringParameterL(aSectName, aKeyName, result));
+	if ( err != KErrNone )
+		{
+		ret=EFalse;
+		}
+	if ( ret )
+		{
+		_LIT(KTrue,"true");
+		aResult=(result.FindF(KTrue) != KErrNotFound);
+		}
+
+	return ret;
+	}
+
+TBool CDataWrapperBase::GetFontSpecFromConfig(const TDesC& aSectName,const TDesC& aKeyName,TFontSpec& aResult)
+	{
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+
+
+	TPtrC	name;
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagFontSpecName);
+	TBool	ret=GetStringFromConfig(aSectName, tempStore, name);
+
+	TInt	height;
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagFontSpecHeight);
+	if ( !GetIntFromConfig(aSectName, tempStore, height) )
+		{
+		ret=EFalse;
+		}
+
+	if ( ret )
+		{
+		aResult=TFontSpec(name, height);
+		}
+
+	return ret;
+	}
+
+TBool CDataWrapperBase::GetIntFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TInt& aResult)
+	{
+	TPtrC	result;
+	TBool	ret=EFalse;
+	TRAPD(err, ret=GetCommandStringParameterL(aSectName, aKeyName, result));
+	if ( err != KErrNone )
+		{
+		ret=EFalse;
+		}
+	if ( ret )
+		{
+		TLex	lex(result);
+		ret=(lex.Val(aResult)==KErrNone);
+		}
+
+	return ret;
+	}
+
+TBool CDataWrapperBase::GetStringFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TPtrC& aResult)
+	{
+	TBool	ret=EFalse;
+	TRAPD(err, ret=GetCommandStringParameterL(aSectName, aKeyName, aResult));
+	if ( err != KErrNone )
+		{
+		ret=EFalse;
+		}
+	return ret;
+	}
+
+TBool CDataWrapperBase::GetHexFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TInt& aResult)
+	{
+	TPtrC	result;
+	TBool	ret=EFalse;
+	TRAPD(err, ret=GetCommandStringParameterL(aSectName, aKeyName, result));
+	if ( err != KErrNone )
+		{
+		ret=EFalse;
+		}
+	if ( ret )
+		{
+		TLex	lex(result);
+		ret=(lex.Val((TUint &)aResult, EHex)==KErrNone);
+		}
+
+	return ret;
+	}
+
+TBool CDataWrapperBase::GetPointFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TPoint& aResult)
+	{
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+
+	TInt	x;
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagPointX);
+	TBool	ret=GetIntFromConfig(aSectName, tempStore, x);
+
+	TInt	y;
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagPointY);
+	if ( !GetIntFromConfig(aSectName, tempStore, y) )
+		{
+		ret=EFalse;
+		}
+
+	if ( ret )
+		{
+		aResult.SetXY(x, y);
+		}
+
+	return ret;
+	}
+
+TBool CDataWrapperBase::GetRectFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TRect& aResult)
+	{
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+
+	TInt	top;
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagRectTop);
+	TBool	ret=GetIntFromConfig(aSectName, tempStore, top);
+
+	TInt	left;
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagRectLeft);
+	if ( !GetIntFromConfig(aSectName, tempStore, left) )
+		{
+		ret=EFalse;
+		}
+
+	TInt	bottom;
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagRectBottom);
+	if ( !GetIntFromConfig(aSectName, tempStore, bottom) )
+		{
+		ret=EFalse;
+		}
+
+	TInt	right;
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagRectRight);
+	if ( !GetIntFromConfig(aSectName, tempStore, right) )
+		{
+		ret=EFalse;
+		}
+
+	if ( ret )
+		{
+		aResult.SetRect(left, top, right, bottom);
+		}
+
+	return ret;
+	}
+
+TBool CDataWrapperBase::GetRegionFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TRegion& aResult)
+	{
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+	TRect								rect;
+
+	aResult.Clear();
+	TBool	moreData=ETrue;
+	for ( TInt index=0; moreData; )
+		{
+		tempStore.Format(KFormatFieldNumber, &aKeyName, ++index);
+		moreData=GetRectFromConfig(aSectName, tempStore, rect);
+		if ( moreData )
+			{
+			aResult.AddRect(rect);
+			}
+		}
+
+	return aResult.Count()>0;
+	}
+
+TBool CDataWrapperBase::GetRgbFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TRgb& aResult)
+	{
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+
+	TInt	red;
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagRgbRed);
+	TBool	ret=GetIntFromConfig(aSectName, tempStore, red);
+
+	TInt	green;
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagRgbGreen);
+	if ( !GetIntFromConfig(aSectName, tempStore, green) )
+		{
+		ret=EFalse;
+		}
+
+	TInt	blue;
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagRgbBlue);
+	if ( !GetIntFromConfig(aSectName, tempStore, blue) )
+		{
+		ret=EFalse;
+		}
+
+	if ( ret )
+		{
+		aResult.SetRed(red);
+		aResult.SetGreen(green);
+		aResult.SetBlue(blue);
+
+		TInt	alpha;
+		tempStore.Format(KFormatEntryField, &aKeyName, &KTagRgbAlpha);
+		if ( GetIntFromConfig(aSectName, tempStore, alpha) )
+			{
+			aResult.SetAlpha(alpha);
+			}
+		}
+
+	return ret;
+	}
+
+TBool CDataWrapperBase::GetSizeFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TSize& aResult)
+	{
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+
+	TInt	width;
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagSizeWidth);
+	TBool	ret=GetIntFromConfig(aSectName, tempStore, width);
+
+	TInt	height;
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagSizeHeight);
+	if ( !GetIntFromConfig(aSectName, tempStore, height) )
+		{
+		ret=EFalse;
+		}
+
+	if ( ret )
+		{
+		aResult.SetSize(width, height);
+		}
+
+	return ret;
+	}
+
+TBool CDataWrapperBase::GetRgbListFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TInt aSize, TRgb*& aResult)
+	{
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+
+	TBool	ok=ETrue;
+	for ( TInt index=0; (index<aSize) && (ok); )
+		{
+		tempStore.Format(KFormatFieldNumber, &aKeyName, ++index);
+		ok=GetRgbFromConfig(aSectName, tempStore, aResult[index-1]);
+		if ( !ok )
+			{
+			ERR_PRINTF2(KLogMissingParameter, &tempStore);
+			SetBlockResult(EFail);
+			}
+		}
+
+	return ok;
+	}
+
+TBool CDataWrapperBase::GetPointListFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TInt aSize, TPoint*& aResult)
+	{
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+
+	TBool	ok=ETrue;
+	for ( TInt index=0; (index<aSize) && (ok); )
+		{
+		tempStore.Format(KFormatFieldNumber, &aKeyName, ++index);
+		ok=GetPointFromConfig(aSectName, tempStore, aResult[index-1]);
+		if ( !ok )
+			{
+			ERR_PRINTF2(KLogMissingParameter, &tempStore);
+			SetBlockResult(EFail);
+			}
+		}
+
+	return ok;
+	}
+
+TBool CDataWrapperBase::GetPointListFromConfigL(const TDesC& aSectName, const TDesC& aKeyName, CArrayFix<TPoint>& aResult)
+	{
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+	TPoint								point;
+
+	aResult.Reset();
+	TBool	ok=ETrue;
+	for ( TInt index=0; ok; )
+		{
+		tempStore.Format(KFormatFieldNumber, &aKeyName, ++index);
+		ok=GetPointFromConfig(aSectName, tempStore, point);
+		if ( ok )
+			{
+			aResult.AppendL(point);
+			}
+		}
+
+	return aResult.Count()>0;
+	}
+
+TBool CDataWrapperBase::GetCommandStringParameterL(const TDesC& aSectName, const TDesC& aKeyName, TPtrC& aResult)
+	{
+	TBool	ret=EFalse;
+
+	if ( aSectName.Length()!=0 )
+		{
+		ret=CDataWrapper::GetStringFromConfig(aSectName, aKeyName, aResult);
+
+		for ( TInt index=iInclude.Count(); (index>0) && (!ret); )
+			{
+			ret=iInclude[--index]->FindVar(aSectName, aKeyName, aResult);
+			}
+		}
+
+	if ( ret )
+		{
+		if ( aResult.Match(KMatch)!=KErrNotFound )
+			{
+			//	We have an entry of the format
+			//	entry =*{section,entry}*
+			//	where * is one or more characters
+			//	We need to construct this from other data in the ini file replacing {*,*}
+			//	with the data from
+			//	[section]
+			//	entry =some_value
+			HBufC*	buffer=HBufC::NewLC(aResult.Length());
+			buffer->Des().Copy(aResult);
+
+			TInt	startLength=KStart().Length();
+			TInt	sparatorLength=KSeparator().Length();
+			TInt	endLength=KEnd().Length();
+			TInt	bufferLength;
+			TInt	start;
+			TInt	sparator;
+			TInt	end;
+			TPtrC	remaining;
+			TLex	lex;
+			do
+				{
+				bufferLength=buffer->Length();
+				start=buffer->Find(KStart);
+
+				remaining.Set(buffer->Des().Right(bufferLength-start-startLength));
+				sparator=remaining.Find(KSeparator);
+				remaining.Set(remaining.Right(remaining.Length()-sparator-sparatorLength));
+				sparator += (start + startLength);
+
+				end=remaining.Find(KEnd) + sparator + sparatorLength;
+
+				TPtrC	sectionName(buffer->Ptr()+start+startLength, sparator-start-startLength);
+				TPtrC	keyName(buffer->Ptr()+sparator+sparatorLength, end-sparator-sparatorLength);
+				sectionName.Set(TLex(sectionName).NextToken());
+				keyName.Set(TLex(keyName).NextToken());
+
+				TInt	entrySize=0;
+				TPtrC	entryData;
+				TBool	found=CDataWrapper::GetStringFromConfig(sectionName, keyName, entryData);
+				for ( TInt index=iInclude.Count(); (index>0) && (!found);  )
+					{
+					found=iInclude[--index]->FindVar(sectionName, keyName, entryData);
+					}
+				if ( found )
+					{
+					entrySize=entryData.Length();
+					}
+
+				TInt	newLength=start + bufferLength - end - endLength + entrySize;
+				HBufC*	bufferNew=HBufC::NewLC(newLength);
+				bufferNew->Des().Copy(buffer->Ptr(), start);
+				if ( entrySize>0 )
+					{
+					bufferNew->Des().Append(entryData);
+					}
+				bufferNew->Des().Append(buffer->Ptr() + end + endLength, bufferLength - end - endLength);
+				CleanupStack::Pop(bufferNew);
+				CleanupStack::PopAndDestroy(buffer);
+				buffer=bufferNew;
+				CleanupStack::PushL(buffer);
+				}
+			while ( buffer->Match(KMatch)!=KErrNotFound );
+			iBuffer.Append(buffer);
+			CleanupStack::Pop(buffer);
+			aResult.Set(*buffer);
+			INFO_PRINTF4(KDataRead, &aSectName, &aKeyName , &aResult);
+			}
+		}
+
+	return ret;
+	}
+
+TBool CDataWrapperBase::GetWsGraphicIdFromConfigL(const TDesC& aSectName, const TDesC& aKeyName, TWsGraphicId& aResult)
+	{
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+
+	TInt	id;
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagWsGraphicIdUid);
+	TBool	ret=GetIntFromConfig(aSectName, tempStore, id);
+
+	if ( ret )
+		{
+		TUid	uid=TUid::Uid(id);
+		aResult.Set(uid);
+		}
+	else
+		{
+		tempStore.Format(KFormatEntryField, &aKeyName, &KTagWsGraphicIdId);
+		ret=GetIntFromConfig(aSectName, tempStore, id);
+		if ( ret )
+			{
+			aResult.Set(id);
+			}
+		else
+			{
+			tempStore.Format(KFormatEntryField, &aKeyName, &KTagWsGraphicIdName);
+			TPtrC	name;
+			ret=GetStringFromConfig(aSectName, tempStore, name);
+			if ( ret )
+				{
+				CDataWrapperBase*	wrapper=static_cast<CDataWrapperBase*>(GetDataWrapperL(name));
+				aResult=wrapper->GetId();
+				}
+			}
+		}
+
+	return ret;
+	}
+
+    TBool CDataWrapperBase::GetDateTimeFromConfig(const TDesC& aSectName,  TDateTime& aResult)
+    	{
+    	TInt year , month , day , hour , minute, second, microsecond ;
+    	
+    	// Fields
+    	_LIT(KYear,			"year");
+    	_LIT(KMonth,		"month");
+    	_LIT(KDay,      	"day");
+    	_LIT(KHour,         "hour");
+    	_LIT(KMinute,		"minute");
+    	_LIT(KSecond,		"second");
+    	_LIT(KMicrosecond,  "microsecond");
+
+    	TBool ret = ETrue ; 
+    	if ( !GetIntFromConfig( aSectName, KYear , year))
+    		{
+			ret=EFalse;
+			}
+    	if ( !GetIntFromConfig( aSectName, KMonth , month))
+    		{
+			ret=EFalse;
+			}     	 
+    	if ( !GetIntFromConfig( aSectName, KDay, day))
+    		{
+			ret=EFalse;
+			} 
+    	if ( !GetIntFromConfig( aSectName, KHour, hour))
+    		{
+			ret=EFalse;
+			} 
+    	if ( !GetIntFromConfig( aSectName, KMinute , minute))
+    		{
+			ret=EFalse;
+			}  
+    	if ( !GetIntFromConfig( aSectName, KSecond , second))
+    		{
+			ret=EFalse;
+			}  
+    	if ( !GetIntFromConfig( aSectName, KMicrosecond , microsecond))
+    		{
+			ret=EFalse;
+			} 
+    	if ( ret )
+			{
+			TMonth amonth ;
+			switch (month) 
+			  {
+			  case 1:
+			       amonth = EJanuary ;
+			       break ;
+			  case 2:
+			       amonth = EFebruary  ;
+		           break ;
+			  case 3 :
+			       amonth = EMarch  ;
+			       break ;
+			  case 4: 
+			       amonth = EApril ;
+			       break ;
+			  case 5:
+			       amonth = EMay  ;
+		           break ;
+			  case 6 :
+			       amonth = EJune ;
+			       break ;
+			  case 7 :
+			       amonth = EJuly ;
+			       break ;
+			  case 8 :
+			       amonth = EAugust ;
+			       break ;
+			  case 9 :
+			       amonth = ESeptember ;
+			       break ;
+			  case 10 :
+			       amonth = EOctober ;
+			       break ;
+			  case 11 :
+			       amonth = ENovember ;
+			       break ;
+			  case 12:
+			       amonth = EDecember ;
+			       break ;
+			  default :
+			       return ret ;
+			  }
+			
+			aResult.Set(year,amonth ,day,hour,minute,second,microsecond);
+			}
+    	 
+    	return ret ;
+    	}
+void CDataWrapperBase::LogRegion(const TDesC& aMessage, const TRegion& aRegion)
+	{
+	INFO_PRINTF2(KLogRegion, &aMessage);
+	TInt	indCount = aRegion.Count();
+	if ( indCount==0 )
+		{
+		INFO_PRINTF1(KLogEmpty);
+		}
+	else
+		{
+		const TRect*	rect=aRegion.RectangleList();
+		for ( TInt index=0; index<indCount; ++index )
+			{
+			INFO_PRINTF6(KLogRegionsRect, index, rect[index].iTl.iX, rect[index].iTl.iY, rect[index].iBr.iX, rect[index].iBr.iY);
+			}
+		}
+	}
+
+void CDataWrapperBase::LogRect(const TDesC& aMessage, const TRect& aRect)
+	{
+	INFO_PRINTF6(KLogRect, &aMessage, aRect.iTl.iX, aRect.iTl.iY, aRect.iBr.iX, aRect.iBr.iY);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/common/src/T_GraphicsUtil.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,5569 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_GraphicsUtil.h"
+#include "../../wserv/AnimPlugin/inc/T_AnimDef.h"
+//	EPOC includes
+#include <apgtask.h>		// used for apatask
+
+#define INFO_PRINTF1_UTIL(p1)					aDataWrapper.Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrInfo, (p1))
+#define INFO_PRINTF2_UTIL(p1, p2)					aDataWrapper.Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrInfo, (p1), (p2))
+/*@{*/
+_LIT(KFormatEntryField,							"%S_%S");
+_LIT(KFormatFieldNumber,						"%S%d");
+
+_LIT(KTagTextCursorType,						"type");
+_LIT(KTagTextCursorHeight,						"height");
+_LIT(KTagTextCursorAscent,						"ascent");
+_LIT(KTagTextCursorWidth,						"width");
+_LIT(KTagTextCursorFlags,						"flags");
+_LIT(KTagTextCursorColor,						"color");
+
+_LIT(KTagSpriteMemberBitmap,					"bitmap");
+_LIT(KTagSpriteMemberMaskBitmap,				"maskbitmap");
+_LIT(KTagSpriteMemberInvertMask,				"invertmask");
+_LIT(KTagSpriteMemberDrawMode,					"drawmode");
+_LIT(KTagSpriteMemberOffset,					"offset");
+_LIT(KTagSpriteMemberInterval,					"interval");
+_LIT(KTagParamStart,							"start");
+_LIT(KTagParamEnd,							    "end");
+_LIT(KTagParamFlags,							"flags");
+_LIT(KTagParamEnabled,							"enabled");
+
+///	Enumerations type parameter names and their possible values
+_LIT(KRLECompression,							"ERLECompression");
+_LIT(KPaletteCompression,						"EPaletteCompression");
+_LIT(KPaletteCompressionWithRLEFallback,		"EPaletteCompressionWithRLEFallback");
+
+_LIT(KBrushStyleNull,							"ENullBrush");
+_LIT(KBrushStyleSolid,							"ESolidBrush");
+_LIT(KBrushStylePatterned,						"EPatternedBrush");
+_LIT(KBrushStyleVerticalHatch,					"EVerticalHatchBrush");
+_LIT(KBrushStyleForwardDiagonalHatch,			"EForwardDiagonalHatchBrush");
+_LIT(KBrushStyleHorizontalHatch,				"EHorizontalHatchBrush");
+_LIT(KBrushStyleRearwardDiagonalHatch,			"ERearwardDiagonalHatchBrush");
+_LIT(KBrushStyleSquareCrossHatch,				"ESquareCrossHatchBrush");
+_LIT(KBrushStyleDiamondCrossHatch,				"EDiamondCrossHatchBrush");
+
+_LIT(KCaptureFlagEnabled,						"TCaptureFlagEnabled");
+_LIT(KCaptureFlagDragDrop,						"TCaptureFlagDragDrop");
+_LIT(KCaptureFlagAllGroups,						"TCaptureFlagAllGroups");
+_LIT(KCaptureDisabled,							"TCaptureDisabled");
+_LIT(KCaptureEnabled,							"TCaptureEnabled");
+_LIT(KCaptureDragDrop,							"TCaptureDragDrop");
+
+_LIT(KComputeModePriorityControlDisabled,		"EPriorityControlDisabled");
+_LIT(KComputeModePriorityControlComputeOn,		"EPriorityControlComputeOn");
+_LIT(KComputeModePriorityControlComputeOff,		"EPriorityControlComputeOff");
+
+_LIT(KCornerTypeWindowSquare,					"EWindowCornerSquare");
+_LIT(KCornerTypeWindow1,						"EWindowCorner1");
+_LIT(KCornerTypeWindow2,						"EWindowCorner2");
+_LIT(KCornerTypeWindow3,						"EWindowCorner3");
+_LIT(KCornerTypeWindow5,						"EWindowCorner5");
+_LIT(KCornerTypeWindowRegion,					"EWindowCornerRegion");
+_LIT(KCornerTypeMask,							"ECornerTypeMask");
+
+_LIT(KDisplayModeNone,							"ENone");
+_LIT(KDisplayModeGray2,							"EGray2");
+_LIT(KDisplayModeGray4,							"EGray4");
+_LIT(KDisplayModeGray16,						"EGray16");
+_LIT(KDisplayModeGray256,						"EGray256");
+_LIT(KDisplayModeColor16,						"EColor16");
+_LIT(KDisplayModeColor256,						"EColor256");
+_LIT(KDisplayModeColor64K,						"EColor64K");
+_LIT(KDisplayModeColor16M,						"EColor16M");
+_LIT(KDisplayModeRgb,							"ERgb");
+_LIT(KDisplayModeColor4K,						"EColor4K");
+_LIT(KDisplayModeColor16MU,						"EColor16MU");
+_LIT(KDisplayModeColor16MA,						"EColor16MA");
+_LIT(KDisplayModeColor16MAP,					"EColor16MAP");
+_LIT(KDisplayModeColorLast,						"EColorLast");
+
+_LIT(KDrawModeAND,								"EDrawModeAND");
+_LIT(KDrawModeNOTAND,							"EDrawModeNOTAND");
+_LIT(KDrawModePEN,								"EDrawModePEN");
+_LIT(KDrawModeANDNOT,							"EDrawModeANDNOT");
+_LIT(KDrawModeXOR,								"EDrawModeXOR");
+_LIT(KDrawModeOR,								"EDrawModeOR");
+_LIT(KDrawModeNOTANDNOT,						"EDrawModeNOTANDNOT");
+_LIT(KDrawModeNOTXOR,							"EDrawModeNOTXOR");
+_LIT(KDrawModeNOTSCREEN,						"EDrawModeNOTSCREEN");
+_LIT(KDrawModeNOTOR,							"EDrawModeNOTOR");
+_LIT(KDrawModeNOTPEN,							"EDrawModeNOTPEN");
+_LIT(KDrawModeORNOT,							"EDrawModeORNOT");
+_LIT(KDrawModeNOTORNOT,							"EDrawModeNOTORNOT");
+_LIT(KDrawModeWriteAlpha,						"EDrawModeWriteAlpha");
+
+_LIT(KErrorCategoryDrawingRegion,				"EDrawingRegion");
+_LIT(KErrorCategoryBackLight,					"EBackLight");
+_LIT(KErrorCategoryLogging,						"ELogging");
+_LIT(KErrorCategoryContrast,					"EContrast");
+
+_LIT(KEventCodeNull,							"EEventNull");
+_LIT(KEventCodeKey,								"EEventKey");
+_LIT(KEventCodeKeyUp,							"EEventKeyUp");
+_LIT(KEventCodeKeyDown,							"EEventKeyDown");
+_LIT(KEventCodeModifiersChanged,				"EEventModifiersChanged");
+_LIT(KEventCodePointer,							"EEventPointer");
+_LIT(KEventCodePointerEnter,					"EEventPointerEnter");
+_LIT(KEventCodePointerExit,						"EEventPointerExit");
+_LIT(KEventCodePointerBufferReady,				"EEventPointerBufferReady");
+_LIT(KEventCodeDragDrop,						"EEventDragDrop");
+_LIT(KEventCodeFocusLost,						"EEventFocusLost");
+_LIT(KEventCodeFocusGained,						"EEventFocusGained");
+_LIT(KEventCodeSwitchOn,						"EEventSwitchOn");
+_LIT(KEventCodePassword,						"EEventPassword");
+_LIT(KEventCodeWindowGroupsChanged,				"EEventWindowGroupsChanged");
+_LIT(KEventCodeErrorMessage,					"EEventErrorMessage");
+_LIT(KEventCodeMessageReady,					"EEventMessageReady");
+_LIT(KEventCodeMarkInvalid,						"EEventMarkInvalid");
+_LIT(KEventCodeSwitchOff,						"EEventSwitchOff");
+_LIT(KEventCodeKeySwitchOff,					"EEventKeySwitchOff");
+_LIT(KEventCodeScreenDeviceChanged,				"EEventScreenDeviceChanged");
+_LIT(KEventCodeFocusGroupChanged,				"EEventFocusGroupChanged");
+_LIT(KEventCodeCaseOpened,						"EEventCaseOpened");
+_LIT(KEventCodeCaseClosed,						"EEventCaseClosed");
+_LIT(KEventCodeWindowGroupListChanged,			"EEventWindowGroupListChanged");
+_LIT(KEventCodeWindowVisibilityChanged,			"EEventWindowVisibilityChanged");
+#if (defined SYMBIAN_PROCESS_MONITORING_AND_STARTUP)
+_LIT(KEventCodeRestartSystem,					"EEventRestartSystem");
+#endif
+_LIT(KEventCodeKeyRepeat,						"EEventKeyRepeat");
+_LIT(KEventCodeDirectScreenAccessBegin,			"EEventDirectScreenAccessBegin");
+_LIT(KEventCodeDirectScreenAccessEnd,			"EEventDirectScreenAccessEnd");
+_LIT(KEventCodeHeartbeatTimerStateChange,		"EEventHeartbeatTimerStateChange");
+_LIT(KEventCodePowerMgmt,						"EEventPowerMgmt");
+_LIT(KEventCodeReserved,						"EEventReserved");
+_LIT(KEventCodeUser,							"EEventUser");
+
+_LIT(KEventControlAlways,						"EEventControlAlways");
+_LIT(KEventControlOnlyWithKeyboardFocus,		"EEventControlOnlyWithKeyboardFocus");
+_LIT(KEventControlOnlyWhenVisible,				"EEventControlOnlyWhenVisible");
+
+_LIT(KEventModifierAutorepeatable,				"EModifierAutorepeatable");
+_LIT(KEventModifierKeypad,						"EModifierKeypad");
+_LIT(KEventModifierLeftAlt,						"EModifierLeftAlt");
+_LIT(KEventModifierRightAlt,					"EModifierRightAlt");
+_LIT(KEventModifierAlt,							"EModifierAlt");
+_LIT(KEventModifierLeftCtrl,					"EModifierLeftCtrl");
+_LIT(KEventModifierRightCtrl,					"EModifierRightCtrl");
+_LIT(KEventModifierCtrl,						"EModifierCtrl");
+_LIT(KEventModifierLeftShift,					"EModifierLeftShift");
+_LIT(KEventModifierRightShift,					"EModifierRightShift");
+_LIT(KEventModifierShift,						"EModifierShift");
+_LIT(KEventModifierLeftFunc,					"EModifierLeftFunc");
+_LIT(KEventModifierRightFunc,					"EModifierRightFunc");
+_LIT(KEventModifierFunc,						"EModifierFunc");
+_LIT(KEventModifierCapsLock,					"EModifierCapsLock");
+_LIT(KEventModifierNumLock,						"EModifierNumLock");
+_LIT(KEventModifierScrollLock,					"EModifierScrollLock");
+_LIT(KEventModifierKeyUp,						"EModifierKeyUp");
+_LIT(KEventModifierSpecial,						"EModifierSpecial");
+_LIT(KEventModifierDoubleClick,					"EModifierDoubleClick");
+_LIT(KEventModifierPureKeycode,					"EModifierPureKeycode");
+_LIT(KEventModifierKeyboardExtend,				"EModifierKeyboardExtend");
+_LIT(KEventModifierCancelRotation,				"EModifierCancelRotation");
+_LIT(KEventModifierRotateBy90,					"EModifierRotateBy90");
+_LIT(KEventModifierRotateBy180,					"EModifierRotateBy180");
+_LIT(KEventModifierRotateBy270,					"EModifierRotateBy270");
+_LIT(KEventModifierPointer3DButton1,			"EModifierPointer3DButton1");
+_LIT(KEventModifierPointer3DButton2,			"EModifierPointer3DButton2");
+_LIT(KEventModifierPointer3DButton3,			"EModifierPointer3DButton3");
+_LIT(KEventModifierAll,							"EAllModifiers");
+
+_LIT(KFadeControlIncludeChildren,				"EFadeIncludeChildren");
+_LIT(KFadeControlWindowOnly,					"EFadeWindowOnly");
+
+_LIT(KFillRuleAlternate,						"EAlternate");
+_LIT(KFillRuleEWinding,							"EWinding");
+
+_LIT(KFontStrikethroughOff,						"EStrikethroughOff");
+_LIT(KFontStrikethroughOn,						"EStrikethroughOn");
+
+_LIT(KFontUnderlineOff,							"EUnderlineOff");
+_LIT(KFontUnderlineOn,							"EUnderlineOn");
+
+_LIT(KGlyphBitmapTypeDefault,					"EDefaultGlyphBitmap");
+_LIT(KGlyphBitmapTypeMonochrome,				"EMonochromeGlyphBitmap");
+_LIT(KGlyphBitmapTypeAntiAliased,				"EAntiAliasedGlyphBitmap");
+_LIT(KGlyphBitmapTypeSubPixel,					"ESubPixelGlyphBitmap");
+_LIT(KGlyphBitmapTypeFourColourBlend,			"EFourColourBlendGlyphBitmap");
+
+_LIT(KGraphicsOrientationNormal,				"EGraphicsOrientationNormal");
+_LIT(KGraphicsOrientationRotated90,				"EGraphicsOrientationRotated90");
+_LIT(KGraphicsOrientationRotated180,			"EGraphicsOrientationRotated180");
+_LIT(KGraphicsOrientationRotated270,			"EGraphicsOrientationRotated270");
+
+_LIT(KHotKeyEnableLogging,						"EHotKeyEnableLogging");
+_LIT(KHotKeyDisableLogging,						"EHotKeyDisableLogging");
+_LIT(KHotKeyStateDump,							"EHotKeyStateDump");
+_LIT(KHotKeyOfDeath,							"EHotKeyOfDeath");
+_LIT(KHotKeyShutDown,							"EHotKeyShutDown");
+_LIT(KHotKeyHeapDump,							"EHotKeyHeapDump");
+_LIT(KHotKeyIncContrast,						"EHotKeyIncContrast");
+_LIT(KHotKeyDecContrast,						"EHotKeyDecContrast");
+_LIT(KHotKeyOff,								"EHotKeyOff");
+_LIT(KHotKeyBacklightOn,						"EHotKeyBacklightOn");
+_LIT(KHotKeyBacklightOff,						"EHotKeyBacklightOff");
+_LIT(KHotKeyBacklightToggle,					"EHotKeyBacklightToggle");
+_LIT(KHotKeyScreenDimension0,					"EHotKeyScreenDimension0");
+_LIT(KHotKeyScreenDimension1,					"EHotKeyScreenDimension1");
+_LIT(KHotKeyScreenDimension2,					"EHotKeyScreenDimension2");
+_LIT(KHotKeyScreenDimension3,					"EHotKeyScreenDimension3");
+_LIT(KHotKeyCycleDisplaySize,					"EHotKeyCycleDisplaySize");
+_LIT(KHotKeyCycleOrientation,					"EHotKeyCycleOrientation");
+_LIT(KHotKeyIncBrightness,						"EHotKeyIncBrightness");
+_LIT(KHotKeyDecBrightness,						"EHotKeyDecBrightness");
+_LIT(KHotKeyCycleFocusScreen,					"EHotKeyCycleFocusScreen");
+_LIT(KHotKeyFirstKeyType,						"EHotKeyFirstKeyType");
+_LIT(KHotKeyLastKeyType,						"EHotKeyLastKeyType");
+
+_LIT(KKeyNull,									"EKeyNull");
+_LIT(KKeyBell,									"EKeyBell");
+_LIT(KKeyBackspace,								"EKeyBackspace");
+_LIT(KKeyTab,									"EKeyTab");
+_LIT(KKeyLineFeed,								"EKeyLineFeed");
+_LIT(KKeyVerticalTab,							"EKeyVerticalTab");
+_LIT(KKeyFormFeed,								"EKeyFormFeed");
+_LIT(KKeyEnter,									"EKeyEnter");
+_LIT(KKeyEscape,								"EKeyEscape");
+_LIT(KKeySpace,									"EKeySpace");
+_LIT(KKeyDelete,								"EKeyDelete");
+_LIT(KKeyPrintScreen,							"EKeyPrintScreen");
+_LIT(KKeyPause,									"EKeyPause");
+_LIT(KKeyHome,									"EKeyHome");
+_LIT(KKeyEnd,									"EKeyEnd");
+_LIT(KKeyPageUp,								"EKeyPageUp");
+_LIT(KKeyPageDown,								"EKeyPageDown");
+_LIT(KKeyInsert,								"EKeyInsert");
+_LIT(KKeyLeftArrow,								"EKeyLeftArrow");
+_LIT(KKeyRightArrow,							"EKeyRightArrow");
+_LIT(KKeyUpArrow,								"EKeyUpArrow");
+_LIT(KKeyDownArrow,								"EKeyDownArrow");
+_LIT(KKeyLeftShift,								"EKeyLeftShift");
+_LIT(KKeyRightShift,							"EKeyRightShift");
+_LIT(KKeyLeftAlt,								"EKeyLeftAlt");
+_LIT(KKeyRightAlt,								"EKeyRightAlt");
+_LIT(KKeyLeftCtrl,								"EKeyLeftCtrl");
+_LIT(KKeyRightCtrl,								"EKeyRightCtrl");
+_LIT(KKeyLeftFunc,								"EKeyLeftFunc");
+_LIT(KKeyRightFunc,								"EKeyRightFunc");
+_LIT(KKeyCapsLock,								"EKeyCapsLock");
+_LIT(KKeyNumLock,								"EKeyNumLock");
+_LIT(KKeyScrollLock,							"EKeyScrollLock");
+_LIT(KKeyF1,									"EKeyF1");
+_LIT(KKeyF2,									"EKeyF2");
+_LIT(KKeyF3,									"EKeyF3");
+_LIT(KKeyF4,									"EKeyF4");
+_LIT(KKeyF5,									"EKeyF5");
+_LIT(KKeyF6,									"EKeyF6");
+_LIT(KKeyF7,									"EKeyF7");
+_LIT(KKeyF8,									"EKeyF8");
+_LIT(KKeyF9,									"EKeyF9");
+_LIT(KKeyF10,									"EKeyF10");
+_LIT(KKeyF11,									"EKeyF11");
+_LIT(KKeyF12,									"EKeyF12");
+_LIT(KKeyF13,									"EKeyF13");
+_LIT(KKeyF14,									"EKeyF14");
+_LIT(KKeyF15,									"EKeyF15");
+_LIT(KKeyF16,									"EKeyF16");
+_LIT(KKeyF17,									"EKeyF17");
+_LIT(KKeyF18,									"EKeyF18");
+_LIT(KKeyF19,									"EKeyF19");
+_LIT(KKeyF20,									"EKeyF20");
+_LIT(KKeyF21,									"EKeyF21");
+_LIT(KKeyF22,									"EKeyF22");
+_LIT(KKeyF23,									"EKeyF23");
+_LIT(KKeyF24,									"EKeyF24");
+_LIT(KKeyOff,									"EKeyOff");
+_LIT(KKeyIncContrast,							"EKeyIncContrast");
+_LIT(KKeyDecContrast,							"EKeyDecContrast");
+_LIT(KKeyBacklightOn,							"EKeyBacklightOn");
+_LIT(KKeyBacklightOff,							"EKeyBacklightOff");
+_LIT(KKeyBacklightToggle,						"EKeyBacklightToggle");
+_LIT(KKeySliderDown,							"EKeySliderDown");
+_LIT(KKeySliderUp,								"EKeySliderUp");
+_LIT(KKeyMenu,									"EKeyMenu");
+_LIT(KKeyDictaphonePlay,						"EKeyDictaphonePlay");
+_LIT(KKeyDictaphoneStop,						"EKeyDictaphoneStop");
+_LIT(KKeyDictaphoneRecord,						"EKeyDictaphoneRecord");
+_LIT(KKeyHelp,									"EKeyHelp");
+_LIT(KKeyDial,									"EKeyDial");
+_LIT(KKeyScreenDimension0,						"EKeyScreenDimension0");
+_LIT(KKeyScreenDimension1,						"EKeyScreenDimension1");
+_LIT(KKeyScreenDimension2,						"EKeyScreenDimension2");
+_LIT(KKeyScreenDimension3,						"EKeyScreenDimension3");
+_LIT(KKeyIncVolume,								"EKeyIncVolume");
+_LIT(KKeyDecVolume,								"EKeyDecVolume");
+_LIT(KKeyDevice0,								"EKeyDevice0");
+_LIT(KKeyDevice1,								"EKeyDevice1");
+_LIT(KKeyDevice2,								"EKeyDevice2");
+_LIT(KKeyDevice3,								"EKeyDevice3");
+_LIT(KKeyDevice4,								"EKeyDevice4");
+_LIT(KKeyDevice5,								"EKeyDevice5");
+_LIT(KKeyDevice6,								"EKeyDevice6");
+_LIT(KKeyDevice7,								"EKeyDevice7");
+_LIT(KKeyDevice8,								"EKeyDevice8");
+_LIT(KKeyDevice9,								"EKeyDevice9");
+_LIT(KKeyDeviceA,								"EKeyDeviceA");
+_LIT(KKeyDeviceB,								"EKeyDeviceB");
+_LIT(KKeyDeviceC,								"EKeyDeviceC");
+_LIT(KKeyDeviceD,								"EKeyDeviceD");
+_LIT(KKeyDeviceE,								"EKeyDeviceE");
+_LIT(KKeyDeviceF,								"EKeyDeviceF");
+_LIT(KKeyApplication0,							"EKeyApplication0");
+_LIT(KKeyApplication1,							"EKeyApplication1");
+_LIT(KKeyApplication2,							"EKeyApplication2");
+_LIT(KKeyApplication3,							"EKeyApplication3");
+_LIT(KKeyApplication4,							"EKeyApplication4");
+_LIT(KKeyApplication5,							"EKeyApplication5");
+_LIT(KKeyApplication6,							"EKeyApplication6");
+_LIT(KKeyApplication7,							"EKeyApplication7");
+_LIT(KKeyApplication8,							"EKeyApplication8");
+_LIT(KKeyApplication9,							"EKeyApplication9");
+_LIT(KKeyApplicationA,							"EKeyApplicationA");
+_LIT(KKeyApplicationB,							"EKeyApplicationB");
+_LIT(KKeyApplicationC,							"EKeyApplicationC");
+_LIT(KKeyApplicationD,							"EKeyApplicationD");
+_LIT(KKeyApplicationE,							"EKeyApplicationE");
+_LIT(KKeyApplicationF,							"EKeyApplicationF");
+_LIT(KKeyYes,									"EKeyYes");
+_LIT(KKeyNo,									"EKeyNo");
+_LIT(KKeyIncBrightness,							"EKeyIncBrightness");
+_LIT(KKeyDecBrightness,							"EKeyDecBrightness");
+_LIT(KKeyKeyboardExtend,						"EKeyKeyboardExtend");
+_LIT(KKeyDevice10,								"EKeyDevice10");
+_LIT(KKeyDevice11,								"EKeyDevice11");
+_LIT(KKeyDevice12,								"EKeyDevice12");
+_LIT(KKeyDevice13,								"EKeyDevice13");
+_LIT(KKeyDevice14,								"EKeyDevice14");
+_LIT(KKeyDevice15,								"EKeyDevice15");
+_LIT(KKeyDevice16,								"EKeyDevice16");
+_LIT(KKeyDevice17,								"EKeyDevice17");
+_LIT(KKeyDevice18,								"EKeyDevice18");
+_LIT(KKeyDevice19,								"EKeyDevice19");
+_LIT(KKeyDevice1A,								"EKeyDevice1A");
+_LIT(KKeyDevice1B,								"EKeyDevice1B");
+_LIT(KKeyDevice1C,								"EKeyDevice1C");
+_LIT(KKeyDevice1D,								"EKeyDevice1D");
+_LIT(KKeyDevice1E,								"EKeyDevice1E");
+_LIT(KKeyDevice1F,								"EKeyDevice1F");
+_LIT(KKeyApplication10,							"EKeyApplication10");
+_LIT(KKeyApplication11,							"EKeyApplication11");
+_LIT(KKeyApplication12,							"EKeyApplication12");
+_LIT(KKeyApplication13,							"EKeyApplication13");
+_LIT(KKeyApplication14,							"EKeyApplication14");
+_LIT(KKeyApplication15,							"EKeyApplication15");
+_LIT(KKeyApplication16,							"EKeyApplication16");
+_LIT(KKeyApplication17,							"EKeyApplication17");
+_LIT(KKeyApplication18,							"EKeyApplication18");
+_LIT(KKeyApplication19,							"EKeyApplication19");
+_LIT(KKeyApplication1A,							"EKeyApplication1A");
+_LIT(KKeyApplication1B,							"EKeyApplication1B");
+_LIT(KKeyApplication1C,							"EKeyApplication1C");
+_LIT(KKeyApplication1D,							"EKeyApplication1D");
+_LIT(KKeyApplication1E,							"EKeyApplication1E");
+_LIT(KKeyApplication1F,							"EKeyApplication1F");
+
+_LIT(KLoggingEnable,							"ELoggingEnable");
+_LIT(KLoggingDisable,							"ELoggingDisable");
+_LIT(KLoggingStatusDump,						"ELoggingStatusDump");
+_LIT(KLoggingHeapDump,							"ELoggingHeapDump");
+
+_LIT(KModifierStateTurnOnModifier,				"ETurnOnModifier");
+_LIT(KModifierStateTurnOffModifier,				"ETurnOffModifier");
+_LIT(KModifierStateToggleModifier,				"EToggleModifier");
+
+_LIT(KPasswordModeCancel,						"EPasswordCancel");
+_LIT(KPasswordModeNone,							"EPasswordNone");
+_LIT(KPasswordModeOnceADay,						"EPasswordOnceADay");
+_LIT(KPasswordModeAlways,						"EPasswordAlways");
+_LIT(KPasswordModeAlwaysTriggerNow,				"EPasswordAlwaysTriggerNow");
+_LIT(KPasswordModeOnceADayTriggerNow,			"EPasswordOnceADayTriggerNow");
+
+_LIT(KPenStyleNull,								"ENullPen");
+_LIT(KPenStyleSolid,							"ESolidPen");
+_LIT(KPenStyleDotted,							"EDottedPen");
+_LIT(KPenStyleDashed,							"EDashedPen");
+_LIT(KPenStyleDotDash,							"EDotDashPen");
+_LIT(KPenStyleDotDotDash,						"EDotDotDashPen");
+
+_LIT(KPointerCursorNone,						"EPointerCursorNone");
+_LIT(KPointerCursorFixed,						"EPointerCursorFixed");
+_LIT(KPointerCursorNormal,						"EPointerCursorNormal");
+_LIT(KPointerCursorWindow,						"EPointerCursorWindow");
+_LIT(KPointerCursorFirstMode,					"EPointerCursorFirstMode");
+_LIT(KPointerCursorLastMode,					"EPointerCursorLastMode");
+
+_LIT(KPointerFilterEnterExit,					"EPointerFilterEnterExit");
+_LIT(KPointerFilterMove,						"EPointerFilterMove");
+_LIT(KPointerFilterDrag,						"EPointerFilterDrag");
+_LIT(KPointerFilterGenerateSimulatedMove,		"EPointerGenerateSimulatedMove");
+_LIT(KPointerFilterMoveEvents,					"EPointerMoveEvents");
+
+#if defined(SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS)
+_LIT(KPrioritiesAll,							"EAllPriorities");
+#endif
+
+_LIT(KPriorityIdle,								"EPriorityIdle");
+_LIT(KPriorityLow,								"EPriorityLow");
+_LIT(KPriorityStandard,							"EPriorityStandard");
+_LIT(KPriorityUserInput,						"EPriorityUserInput");
+_LIT(KPriorityHigh,								"EPriorityHigh");
+
+_LIT(KSizeEnforcementNone,						"ESizeEnforcementNone");
+_LIT(KSizeEnforcementPixelsAndRotation,			"ESizeEnforcementPixelsAndRotation");
+_LIT(KSizeEnforcementPixelsTwipsAndRotation,	"ESizeEnforcementPixelsTwipsAndRotation");
+
+_LIT(KSpriteInCompareRemoveSprite,				"ERemoveSprite");
+_LIT(KSpriteInCompareIncludeSprite,				"EIncludeSprite");
+_LIT(KSpriteInCompareIncludeTextCursor,			"EIncludeTextCursor");
+
+_LIT(KStdKeyNull,								"EStdKeyNull");
+_LIT(KStdKeyBackspace,							"EStdKeyBackspace");
+_LIT(KStdKeyTab,								"EStdKeyTab");
+_LIT(KStdKeyEnter,								"EStdKeyEnter");
+_LIT(KStdKeyEscape,								"EStdKeyEscape");
+_LIT(KStdKeySpace,								"EStdKeySpace");
+_LIT(KStdKeyPrintScreen,						"EStdKeyPrintScreen");
+_LIT(KStdKeyPause,								"EStdKeyPause");
+_LIT(KStdKeyHome,								"EStdKeyHome");
+_LIT(KStdKeyEnd,								"EStdKeyEnd");
+_LIT(KStdKeyPageUp,								"EStdKeyPageUp");
+_LIT(KStdKeyPageDown,							"EStdKeyPageDown");
+_LIT(KStdKeyInsert,								"EStdKeyInsert");
+_LIT(KStdKeyDelete,								"EStdKeyDelete");
+_LIT(KStdKeyLeftArrow,							"EStdKeyLeftArrow");
+_LIT(KStdKeyRightArrow,							"EStdKeyRightArrow");
+_LIT(KStdKeyUpArrow,							"EStdKeyUpArrow");
+_LIT(KStdKeyDownArrow,							"EStdKeyDownArrow");
+_LIT(KStdKeyLeftShift,							"EStdKeyLeftShift");
+_LIT(KStdKeyRightShift,							"EStdKeyRightShift");
+_LIT(KStdKeyLeftAlt,							"EStdKeyLeftAlt");
+_LIT(KStdKeyRightAlt,							"EStdKeyRightAlt");
+_LIT(KStdKeyLeftCtrl,							"EStdKeyLeftCtrl");
+_LIT(KStdKeyRightCtrl,							"EStdKeyRightCtrl");
+_LIT(KStdKeyLeftFunc,							"EStdKeyLeftFunc");
+_LIT(KStdKeyRightFunc,							"EStdKeyRightFunc");
+_LIT(KStdKeyCapsLock,							"EStdKeyCapsLock");
+_LIT(KStdKeyNumLock,							"EStdKeyNumLock");
+_LIT(KStdKeyScrollLock,							"EStdKeyScrollLock");
+_LIT(KStdKeyF1,									"EStdKeyF1");
+_LIT(KStdKeyF2,									"EStdKeyF2");
+_LIT(KStdKeyF3,									"EStdKeyF3");
+_LIT(KStdKeyF4,									"EStdKeyF4");
+_LIT(KStdKeyF5,									"EStdKeyF5");
+_LIT(KStdKeyF6,									"EStdKeyF6");
+_LIT(KStdKeyF7,									"EStdKeyF7");
+_LIT(KStdKeyF8,									"EStdKeyF8");
+_LIT(KStdKeyF9,									"EStdKeyF9");
+_LIT(KStdKeyF10,								"EStdKeyF10");
+_LIT(KStdKeyF11,								"EStdKeyF11");
+_LIT(KStdKeyF12,								"EStdKeyF12");
+_LIT(KStdKeyF13,								"EStdKeyF13");
+_LIT(KStdKeyF14,								"EStdKeyF14");
+_LIT(KStdKeyF15,								"EStdKeyF15");
+_LIT(KStdKeyF16,								"EStdKeyF16");
+_LIT(KStdKeyF17,								"EStdKeyF17");
+_LIT(KStdKeyF18,								"EStdKeyF18");
+_LIT(KStdKeyF19,								"EStdKeyF19");
+_LIT(KStdKeyF20,								"EStdKeyF20");
+_LIT(KStdKeyF21,								"EStdKeyF21");
+_LIT(KStdKeyF22,								"EStdKeyF22");
+_LIT(KStdKeyF23,								"EStdKeyF23");
+_LIT(KStdKeyF24,								"EStdKeyF24");
+_LIT(KStdKeyXXX,								"EStdKeyXXX");
+_LIT(KStdKeyComma,								"EStdKeyComma");
+_LIT(KStdKeyFullStop,							"EStdKeyFullStop");
+_LIT(KStdKeyForwardSlash,						"EStdKeyForwardSlash");
+_LIT(KStdKeyBackSlash,							"EStdKeyBackSlash");
+_LIT(KStdKeySemiColon,							"EStdKeySemiColon");
+_LIT(KStdKeySingleQuote,						"EStdKeySingleQuote");
+_LIT(KStdKeyHash,								"EStdKeyHash");
+_LIT(KStdKeySquareBracketLeft,					"EStdKeySquareBracketLeft");
+_LIT(KStdKeySquareBracketRight,					"EStdKeySquareBracketRight");
+_LIT(KStdKeyMinus,								"EStdKeyMinus");
+_LIT(KStdKeyEquals,								"EStdKeyEquals");
+_LIT(KStdKeyNkpForwardSlash,					"EStdKeyNkpForwardSlash");
+_LIT(KStdKeyNkpAsterisk,						"EStdKeyNkpAsterisk");
+_LIT(KStdKeyNkpMinus,							"EStdKeyNkpMinus");
+_LIT(KStdKeyNkpPlus,							"EStdKeyNkpPlus");
+_LIT(KStdKeyNkpEnter,							"EStdKeyNkpEnter");
+_LIT(KStdKeyNkp1,								"EStdKeyNkp1");
+_LIT(KStdKeyNkp2,								"EStdKeyNkp2");
+_LIT(KStdKeyNkp3,								"EStdKeyNkp3");
+_LIT(KStdKeyNkp4,								"EStdKeyNkp4");
+_LIT(KStdKeyNkp5,								"EStdKeyNkp5");
+_LIT(KStdKeyNkp6,								"EStdKeyNkp6");
+_LIT(KStdKeyNkp7,								"EStdKeyNkp7");
+_LIT(KStdKeyNkp8,								"EStdKeyNkp8");
+_LIT(KStdKeyNkp9,								"EStdKeyNkp9");
+_LIT(KStdKeyNkp0,								"EStdKeyNkp0");
+_LIT(KStdKeyNkpFullStop,						"EStdKeyNkpFullStop");
+_LIT(KStdKeyMenu,								"EStdKeyMenu");
+_LIT(KStdKeyBacklightOn,						"EStdKeyBacklightOn");
+_LIT(KStdKeyBacklightOff,						"EStdKeyBacklightOff");
+_LIT(KStdKeyBacklightToggle,					"EStdKeyBacklightToggle");
+_LIT(KStdKeyIncContrast,						"EStdKeyIncContrast");
+_LIT(KStdKeyDecContrast,						"EStdKeyDecContrast");
+_LIT(KStdKeySliderDown,							"EStdKeySliderDown");
+_LIT(KStdKeySliderUp,							"EStdKeySliderUp");
+_LIT(KStdKeyDictaphonePlay,						"EStdKeyDictaphonePlay");
+_LIT(KStdKeyDictaphoneStop,						"EStdKeyDictaphoneStop");
+_LIT(KStdKeyDictaphoneRecord,					"EStdKeyDictaphoneRecord");
+_LIT(KStdKeyHelp,								"EStdKeyHelp");
+_LIT(KStdKeyOff,								"EStdKeyOff");
+_LIT(KStdKeyDial,								"EStdKeyDial");
+_LIT(KStdKeyIncVolume,							"EStdKeyIncVolume");
+_LIT(KStdKeyDecVolume,							"EStdKeyDecVolume");
+_LIT(KStdKeyDevice0,							"EStdKeyDevice0");
+_LIT(KStdKeyDevice1,							"EStdKeyDevice1");
+_LIT(KStdKeyDevice2,							"EStdKeyDevice2");
+_LIT(KStdKeyDevice3,							"EStdKeyDevice3");
+_LIT(KStdKeyDevice4,							"EStdKeyDevice4");
+_LIT(KStdKeyDevice5,							"EStdKeyDevice5");
+_LIT(KStdKeyDevice6,							"EStdKeyDevice6");
+_LIT(KStdKeyDevice7,							"EStdKeyDevice7");
+_LIT(KStdKeyDevice8,							"EStdKeyDevice8");
+_LIT(KStdKeyDevice9,							"EStdKeyDevice9");
+_LIT(KStdKeyDeviceA,							"EStdKeyDeviceA");
+_LIT(KStdKeyDeviceB,							"EStdKeyDeviceB");
+_LIT(KStdKeyDeviceC,							"EStdKeyDeviceC");
+_LIT(KStdKeyDeviceD,							"EStdKeyDeviceD");
+_LIT(KStdKeyDeviceE,							"EStdKeyDeviceE");
+_LIT(KStdKeyDeviceF,							"EStdKeyDeviceF");
+_LIT(KStdKeyApplication0,						"EStdKeyApplication0");
+_LIT(KStdKeyApplication1,						"EStdKeyApplication1");
+_LIT(KStdKeyApplication2,						"EStdKeyApplication2");
+_LIT(KStdKeyApplication3,						"EStdKeyApplication3");
+_LIT(KStdKeyApplication4,						"EStdKeyApplication4");
+_LIT(KStdKeyApplication5,						"EStdKeyApplication5");
+_LIT(KStdKeyApplication6,						"EStdKeyApplication6");
+_LIT(KStdKeyApplication7,						"EStdKeyApplication7");
+_LIT(KStdKeyApplication8,						"EStdKeyApplication8");
+_LIT(KStdKeyApplication9,						"EStdKeyApplication9");
+_LIT(KStdKeyApplicationA,						"EStdKeyApplicationA");
+_LIT(KStdKeyApplicationB,						"EStdKeyApplicationB");
+_LIT(KStdKeyApplicationC,						"EStdKeyApplicationC");
+_LIT(KStdKeyApplicationD,						"EStdKeyApplicationD");
+_LIT(KStdKeyApplicationE,						"EStdKeyApplicationE");
+_LIT(KStdKeyApplicationF,						"EStdKeyApplicationF");
+_LIT(KStdKeyYes,								"EStdKeyYes");
+_LIT(KStdKeyNo,									"EStdKeyNo");
+_LIT(KStdKeyIncBrightness,						"EStdKeyIncBrightness");
+_LIT(KStdKeyDecBrightness,						"EStdKeyDecBrightness");
+_LIT(KStdKeyKeyboardExtend,						"EStdKeyKeyboardExtend");
+_LIT(KStdKeyDevice10,							"EStdKeyDevice10");
+_LIT(KStdKeyDevice11,							"EStdKeyDevice11");
+_LIT(KStdKeyDevice12,							"EStdKeyDevice12");
+_LIT(KStdKeyDevice13,							"EStdKeyDevice13");
+_LIT(KStdKeyDevice14,							"EStdKeyDevice14");
+_LIT(KStdKeyDevice15,							"EStdKeyDevice15");
+_LIT(KStdKeyDevice16,							"EStdKeyDevice16");
+_LIT(KStdKeyDevice17,							"EStdKeyDevice17");
+_LIT(KStdKeyDevice18,							"EStdKeyDevice18");
+_LIT(KStdKeyDevice19,							"EStdKeyDevice19");
+_LIT(KStdKeyDevice1A,							"EStdKeyDevice1A");
+_LIT(KStdKeyDevice1B,							"EStdKeyDevice1B");
+_LIT(KStdKeyDevice1C,							"EStdKeyDevice1C");
+_LIT(KStdKeyDevice1D,							"EStdKeyDevice1D");
+_LIT(KStdKeyDevice1E,							"EStdKeyDevice1E");
+_LIT(KStdKeyDevice1F,							"EStdKeyDevice1F");
+_LIT(KStdKeyApplication10,						"EStdKeyApplication10");
+_LIT(KStdKeyApplication11,						"EStdKeyApplication11");
+_LIT(KStdKeyApplication12,						"EStdKeyApplication12");
+_LIT(KStdKeyApplication13,						"EStdKeyApplication13");
+_LIT(KStdKeyApplication14,						"EStdKeyApplication14");
+_LIT(KStdKeyApplication15,						"EStdKeyApplication15");
+_LIT(KStdKeyApplication16,						"EStdKeyApplication16");
+_LIT(KStdKeyApplication17,						"EStdKeyApplication17");
+_LIT(KStdKeyApplication18,						"EStdKeyApplication18");
+_LIT(KStdKeyApplication19,						"EStdKeyApplication19");
+_LIT(KStdKeyApplication1A,						"EStdKeyApplication1A");
+_LIT(KStdKeyApplication1B,						"EStdKeyApplication1B");
+_LIT(KStdKeyApplication1C,						"EStdKeyApplication1C");
+_LIT(KStdKeyApplication1D,						"EStdKeyApplication1D");
+_LIT(KStdKeyApplication1E,						"EStdKeyApplication1E");
+_LIT(KStdKeyApplication1F,						"EStdKeyApplication1F");
+
+_LIT(KTextAlignLeft,							"ELeft");
+_LIT(KTextAlignCenter,							"ECenter");
+_LIT(KTextAlignRight,							"ERight");
+
+_LIT(KTextDirectionHorizontal,					"EHorizontal");
+_LIT(KTextDirectionVertical,					"EVertical");
+
+_LIT(KTypeNone,									"ENone");
+_LIT(KTypePointerMove,							"EPointerMove");
+_LIT(KTypePointerSwitchOn,						"EPointerSwitchOn");
+_LIT(KTypeKeyDown,								"EKeyDown");
+_LIT(KTypeKeyUp,								"EKeyUp");
+_LIT(KTypeRedraw,								"ERedraw");
+_LIT(KTypeSwitchOn,								"ESwitchOn");
+_LIT(KTypeActive,								"EActive");
+_LIT(KTypeInactive,								"EInactive");
+_LIT(KTypeUpdateModifiers,						"EUpdateModifiers");
+_LIT(KTypeButton1Down,							"EButton1Down");
+_LIT(KTypeButton1Up,							"EButton1Up");
+_LIT(KTypeButton2Down,							"EButton2Down");
+_LIT(KTypeButton2Up,							"EButton2Up");
+_LIT(KTypeButton3Down,							"EButton3Down");
+_LIT(KTypeButton3Up,							"EButton3Up");
+_LIT(KTypeSwitchOff,							"ESwitchOff");
+_LIT(KTypeKeyRepeat,							"EKeyRepeat");
+_LIT(KTypeCaseOpen,								"ECaseOpen");
+_LIT(KTypeCaseClose,							"ECaseClose");
+_LIT(KTypePointer3DInRange,						"EPointer3DInRange");
+_LIT(KTypePointer3DOutOfRange,					"EPointer3DOutOfRange");
+_LIT(KTypePointer3DTilt,						"EPointer3DTilt");
+_LIT(KTypePointer3DRotation,					"EPointer3DRotation");
+_LIT(KTypePointer3DTiltAndMove,					"EPointer3DTiltAndMove");
+_LIT(KTypeButton4Down,							"EButton4Down");
+_LIT(KTypeButton4Up,							"EButton4Up");
+_LIT(KTypeButton5Down,							"EButton5Down");
+_LIT(KTypeButton5Up,							"EButton5Up");
+_LIT(KTypeButton6Down,							"EButton6Down");
+_LIT(KTypeButton6Up,							"EButton6Up");
+_LIT(KTypeRestartSystem,						"ERestartSystem");
+
+_LIT(KTypeDrag,									"EDrag");
+_LIT(KTypeMove,									"EMove");
+_LIT(KTypeButtonRepeat,							"EButtonRepeat");
+
+_LIT(KWindowBackupTypeAreaBehind,				"EWindowBackupAreaBehind");
+_LIT(KWindowBackupTypeFullScreen,				"EWindowBackupFullScreen");
+
+_LIT(KWsTransparencyPolicyDefault,				"ETransparencyDefault");
+_LIT(KWsTransparencyPolicyFreezeUnder,			"ETransparencyFreezeUnder");
+
+_LIT(KWsVisibilityChangedCanBeSeen,				"ECanBeSeen");
+_LIT(KWsVisibilityChangedCantBeSeen,			"ECantBeSeen");
+_LIT(KWsVisibilityChangedPartiallyVisible,		"EPartiallyVisible");
+_LIT(KWsVisibilityChangedNotVisible,			"ENotVisible");
+_LIT(KWsVisibilityChangedFullyVisible,			"EFullyVisible");
+
+_LIT(KELongCaptureShortEventImmediately,		"ELongCaptureShortEventImmediately");
+_LIT(KELongCaptureRepeatEvents,					"ELongCaptureRepeatEvents");
+_LIT(KELongCaptureNormal,						"ELongCaptureNormal");
+_LIT(KELongCaptureWaitShort,					"ELongCaptureWaitShort");
+
+_LIT(KESpriteFlash,								"ESpriteFlash");
+_LIT(KESpriteNoChildClip,						"ESpriteNoChildClip");
+_LIT(KESpriteNoShadows,							"ESpriteNoShadows");
+
+_LIT(KECustomTextCursorAlignTop,				"ECustomTextCursorAlignTop");
+_LIT(KECustomTextCursorAlignBaseline,			"ECustomTextCursorAlignBaseline");
+_LIT(KECustomTextCursorAlignBottom,				"ECustomTextCursorAlignBottom");
+
+_LIT(KETypeRectangle,							"ETypeRectangle");
+_LIT(KETypeHollowRectangle,						"ETypeHollowRectangle");
+_LIT(KETypeFirst,								"ETypeFirst");
+_LIT(KETypeLast,								"ETypeLast");
+_LIT(KETypeLastBasic,							"ETypeHollowRectangle");
+
+_LIT(KEFlagNoFlash,								"EFlagNoFlash");
+_LIT(KEFlagClipHorizontal,						"EFlagClipHorizontal");
+_LIT(KEFlagClipVertical,						"EFlagClipVertical");
+
+_LIT(KTypefaceFontName,							"typeface_name");
+_LIT(KIsScalable,								"is_scalable");
+_LIT(KNumHeights,								"num_heights");
+_LIT(KMinHeightInTwips,							"min_height_in_twips");
+_LIT(KMaxHeightInTwips,							"max_height_in_twips");
+
+_LIT(KProportional,								"typeface_attribute_proportional");
+_LIT(KSerif,									"typeface_attribute_serif");
+_LIT(KSymbol,									"typeface_attribute_symbol");
+
+_LIT(KETerminateCancel,							"ETerminateCancel");
+_LIT(KETerminateRegion,							"ETerminateRegion");
+_LIT(KETerminateRotation,						"ETerminateRotation");
+_LIT(KETerminateScreenMode,						"EETerminateScreenMode");
+
+_LIT(KEColor,                                   "EColor");
+_LIT(KETransparencyPossible,                    "ETransparencyPossible");
+_LIT(KEFullyScaleable,                          "EFullyScaleable");
+_LIT(KEConstantAspectRatio,                     "EConstantAspectRatio");
+_LIT(KECanDither,                               "ECanDither");
+_LIT(KEAlphaChannel,                            "EAlphaChannel");
+_LIT(KELeaveInPlace,                            "ELeaveInPlace");
+_LIT(KERestoreToBackground,                     "ERestoreToBackground");
+_LIT(KERestoreToPrevious,                       "ERestoreToPrevious");
+_LIT(KEPartialDecodeInvalid,                    "EPartialDecodeInvalid");
+_LIT(KEMngMoreFramesToDecode,                   "EMngMoreFramesToDecode");
+_LIT(KEUsesFrameSizeInPixels,                   "EUsesFrameSizeInPixels");
+
+_LIT(KEFrameInfoUninitialised,                  "EFrameInfoUninitialised");
+_LIT(KEFrameInfoProcessingFrameHeader,          "EFrameInfoProcessingFrameHeader");
+_LIT(KEFrameInfoProcessingFrame,                "EFrameInfoProcessingFrame");
+_LIT(KEFrameInfoProcessingComplete,             "EFrameInfoProcessingComplete"); 
+
+_LIT(KFldFrameInfoState,                        "frameinfostate");
+_LIT(KFldCurrentDataOffset,                     "currentdataoffset");
+_LIT(KFldFrameDataOffset,                       "framedataoffset");
+_LIT(KFldFrameCoordsInPixels,                   "framecoordsinpixels");
+_LIT(KFldFrameSizeInTwips,                      "framesizeintwips");
+_LIT(KFldBitsPerPixel,                          "bitsPerPixel");
+_LIT(KFldDelay,                                 "delay");
+_LIT(KFldFlags,                                 "flags");
+_LIT(KFldOverallSizeInPixels,                   "overallsizeinpixels");
+_LIT(KFldFrameDisplayMode,                      "framedisplaymode");
+_LIT(KFldBackgroundColor,                       "backgroundcolor");
+_LIT(KFldFrameSizeInPixels,                     "framesizeinpixels");
+
+_LIT(KFldProcessName,							"processname");
+_LIT(KFldId,									"id");
+_LIT(KFldRect,									"rect");
+_LIT(KFldWsga,									"wsga");
+
+//For MAnim
+//Opcodes for Util
+_LIT(KEMAnimECmdRetrieveResult, 				"ECmdRetrieveResult"); 
+_LIT(KEMAnimECmdUtilEatupMemory, 				"ECmdUtilEatupMemory"); 
+_LIT(KEMAnimECmdUtilFreeEatenMemory,     		"ECmdUtilFreeEatenMemory"); 
+//Opcodes for MAnimGeneralFunctions
+_LIT(KEMAnimECmdGeneralAnimate, 				"ECmdGeneralAnimate"); 
+_LIT(KEMAnimECmdGeneralClient, 				 	"ECmdGeneralClient");  
+_LIT(KEMAnimECmdGeneralFlashStateOn, 			"ECmdGeneralFlashStateOn");   
+_LIT(KEMAnimECmdGeneralPanic, 					"ECmdGeneralPanic");      
+_LIT(KEMAnimECmdGeneralScreenDevice, 			"ECmdGeneralScreenDevice");       
+_LIT(KEMAnimECmdGeneralExtendedInterface, 		"ECmdGeneralExtendedInterface");
+_LIT(KEMAnimECmdGeneralWindowExtension, 		"ECmdGeneralWindowExtension");  
+_LIT(KEMAnimECmdGeneralNumOfExtInterfaces,		"ECmdGeneralNumOfExtInterfaces");  
+_LIT(KEMAnimECmdGeneralEventExtension , 		"ECmdGeneralEventExtension");
+_LIT(KEMAnimECmdGeneralGetRawEvents , 			"ECmdGeneralGetRawEvents"); 
+_LIT(KEMAnimECmdGeneralPostRawEvent , 			"ECmdGeneralPostRawEvent"); 
+_LIT(KEMAnimECmdGeneralPostKeyEvent , 			"ECmdGeneralPostKeyEvent"); 
+_LIT(KEMAnimECmdGeneralSetSync , 				"ECmdGeneralSetSync"); 
+_LIT(KEMAnimECmdGeneralSync , 					"ECmdGeneralSync"); 
+_LIT(KEMAnimECmdGeneralSetInterval , 			"ECmdGeneralSetInterval"); 
+_LIT(KEMAnimECmdGeneralSetNextInterval , 		"ECmdGeneralSetNextInterval"); 
+_LIT(KEMAnimECmdGeneralSystemTime, 				"ECmdGeneralSystemTime"); 
+_LIT(KEMAnimECmdGeneralRegisterForNotis, 		"ECmdGeneralRegisterForNotis"); 
+_LIT(KEMAnimECmdGeneralMessage, 				"ECmdGeneralMessage");  
+_LIT(KEMAnimECmdGeneralDuplicateBitmapL, 		"ECmdGeneralDuplicateBitmapL");   
+_LIT(KEMAnimECmdGeneralDuplicateFontL, 			"ECmdGeneralDuplicateFontL");      
+_LIT(KEMAnimECmdGeneralCloseFont, 				"ECmdGeneralCloseFont");
+_LIT(KEMAnimECmdGeneralReplyBuf8, 				"ECmdGeneralReplyBuf8");
+_LIT(KEMAnimECmdGeneralReplyBuf16, 				"ECmdGeneralReplyBuf16");
+
+//Opcodes for MAnimSpriteFunctions          
+_LIT(KEMAnimECmdSpriteGetSpriteMember, 			"ECmdSpriteGetSpriteMember");         
+_LIT(KEMAnimECmdSpriteUpdateMember, 			"ECmdSpriteUpdateMember");        
+_LIT(KEMAnimECmdSpriteActivate, 				"ECmdSpriteActivate");   
+_LIT(KEMAnimECmdSpriteSpriteCanBeSeen, 			"ECmdSpriteSpriteCanBeSeen"); 
+_LIT(KEMAnimECmdSpriteSizeChangedL, 			"ECmdSpriteSizeChangedL"); 
+_LIT(KEMAnimECmdSpriteSetPosition, 				"ECmdSpriteSetPosition");    
+   
+	  
+
+//Opcodes for MAnimWindowFunctions  
+_LIT(KEMAnimECmdWindowActivateGc, 				"ECmdWindowActivateGc");//Verify the return value is expected
+_LIT(KEMAnimECmdWindowSetRect, 					"ECmdWindowSetRect");
+_LIT(KEMAnimECmdWindowWindowSize, 				"ECmdWindowWindowSize");
+_LIT(KEMAnimECmdWindowIsHidden, 				"ECmdWindowIsHidden");
+_LIT(KEMAnimECmdWindowSetVisible, 				"ECmdWindowSetVisible");
+_LIT(KEMAnimECmdWindowInvalidate, 				"ECmdWindowInvalidate");
+_LIT(KEMAnimECmdWindowParameters, 				"ECmdWindowParameters");
+_LIT(KEMAnimECmdWindowVisibleRegion, 			"ECmdWindowVisibleRegion");
+_LIT(KEMAnimECmdWindowIsStarted,                "ECmdWindowIsStarted");
+
+//Opcodes for MAnimFreeTimerWindowFunctions
+_LIT(KEMAnimECmdFreeTimerWinDeactivateGc,       "ECmdFreeTimerWinDeactivateGc");
+_LIT(KEMAnimECmdFreeTimerWinUpdate,			    "ECmdFreeTimerWinUpdate");
+
+//Opcodes for MAnimGeneralFunctionsWindowExtension
+_LIT(KEMAnimECmdGfweScreens,				    "ECmdGfweScreens");
+_LIT(KEMAnimECmdGfweFocusScreens,				"ECmdGfweFocusScreens");
+_LIT(KEMAnimECmdGfweSetFocusScreen,				"ECmdGfweSetFocusScreen");
+_LIT(KEMAnimECmdGfweWindowGroups,				"ECmdGfweWindowGroups");
+_LIT(KEMAnimECmdGfweWindowGroupInfo,			"ECmdGfweWindowGroupInfo");
+_LIT(KEMAnimECmdGfweWindowGroupName,			"ECmdGfweWindowGroupName");//use handle to verify it in server side
+_LIT(KEMAnimECmdGfweSetOrdinalPosition,			"ECmdGfweSetOrdinalPosition");
+_LIT(KEMAnimECmdGfweIsFocusable,			    "ECmdGfweIsFocusable");
+
+
+_LIT(KEAnimWindows,								"EKWindowAnim");
+_LIT(KEAnimSprite,								"EKSpriteAnim");
+_LIT(KEAnimFreeTimer,							"EKFreeTimerWindowAnim");
+
+
+_LIT(KEAnimCmdSync,								"ECmdSync");
+_LIT(KEAnimCmdTestWithoutPara,					"ECmdTestWithoutPara");
+_LIT(KEAnimCmdTestWithPara,						"ECmdTestWithPara");
+_LIT(KEAnimCmdGetLast,							"ECmdGetLast");
+_LIT(KEAnimCmdGetAnimInterval,					"ECmdGetAnimInterval");
+
+_LIT(KEGraphicsOrientationNormal,               "EGraphicsOrientationNormal");
+_LIT(KEGraphicsOrientationRotated90,            "EGraphicsOrientationRotated90");
+_LIT(KEGraphicsOrientationRotated180,           "EGraphicsOrientationRotated180");
+_LIT(KEGraphicsOrientationRotated270,           "EGraphicsOrientationRotated270");
+//For CPolygonFiller
+_LIT(KUsageEGetAllPixelRunsSequentially,		"EGetAllPixelRunsSequentially");
+_LIT(KUsageEGetPixelRunsSequentiallyForSpecifiedScanLines,"EGetPixelRunsSequentiallyForSpecifiedScanLines");
+
+/*@}*/
+
+RPointerArray < TAny > CT_GraphicsUtil::iMemArray;
+TInt CT_GraphicsUtil::iAvaiableSpace=0;
+TInt CT_GraphicsUtil::iBiggestBlock=0;
+
+TBool CT_GraphicsUtil::ReadBitmapfileCompressionScheme(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TBitmapfileCompressionScheme& aCompressionScheme)
+	{
+	// Read dither from INI file
+	TPtrC	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KRLECompression )
+			{
+			aCompressionScheme=ERLECompression;
+			}
+		else if ( str==KPaletteCompression )
+			{
+			aCompressionScheme=EPaletteCompression;
+			}
+		else if ( str==KPaletteCompressionWithRLEFallback )
+			{
+			aCompressionScheme=EPaletteCompressionWithRLEFallback;
+			}
+		else
+			{
+        	TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aCompressionScheme=(TBitmapfileCompressionScheme)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadBrushStyle(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CGraphicsContext::TBrushStyle& aBrushStyle)
+	{
+	// Read displaymode from INI file
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KBrushStyleNull )
+			{
+			aBrushStyle=CGraphicsContext::ENullBrush;
+			}
+		else if ( str==KBrushStyleSolid )
+			{
+			aBrushStyle=CGraphicsContext::ESolidBrush;
+			}
+		else if ( str==KBrushStylePatterned )
+			{
+			aBrushStyle=CGraphicsContext::EPatternedBrush;
+			}
+		else if ( str==KBrushStyleVerticalHatch )
+			{
+			aBrushStyle=CGraphicsContext::EVerticalHatchBrush;
+			}
+		else if ( str==KBrushStyleForwardDiagonalHatch )
+			{
+			aBrushStyle=CGraphicsContext::EForwardDiagonalHatchBrush;
+			}
+		else if ( str==KBrushStyleHorizontalHatch )
+			{
+			aBrushStyle=CGraphicsContext::EHorizontalHatchBrush;
+			}
+		else if ( str==KBrushStyleRearwardDiagonalHatch )
+			{
+			aBrushStyle=CGraphicsContext::ERearwardDiagonalHatchBrush;
+			}
+		else if ( str==KBrushStyleSquareCrossHatch )
+			{
+			aBrushStyle=CGraphicsContext::ESquareCrossHatchBrush;
+			}
+		else if ( str==KBrushStyleDiamondCrossHatch )
+			{
+			aBrushStyle=CGraphicsContext::EDiamondCrossHatchBrush;
+			}
+		else
+			{
+    	    TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aBrushStyle=(CGraphicsContext::TBrushStyle)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadCaptureFlags(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TUint& aCaptureFlags)
+	{
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		TUint	temp=0;
+		ret=ConvertToCaptureFlags(str, temp);
+		if ( ret )
+			{
+			aCaptureFlags=temp;
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ConvertToCaptureFlags(const TDesC& aStr, RWindowBase::TCaptureFlags& aCaptureFlags)
+	{
+	TBool	ret=ETrue;
+	if ( aStr==KCaptureFlagEnabled )
+		{
+		aCaptureFlags=RWindowBase::TCaptureFlagEnabled;
+		}
+	else if ( aStr==KCaptureFlagDragDrop )
+		{
+		aCaptureFlags=RWindowBase::TCaptureFlagDragDrop;
+		}
+	else if ( aStr==KCaptureFlagAllGroups )
+		{
+		aCaptureFlags=RWindowBase::TCaptureFlagAllGroups;
+		}
+	else if ( aStr==KCaptureDisabled )
+		{
+		aCaptureFlags=RWindowBase::TCaptureDisabled;
+		}
+	else if ( aStr==KCaptureEnabled )
+		{
+		aCaptureFlags=RWindowBase::TCaptureEnabled;
+		}
+	else if ( aStr==KCaptureDragDrop )
+		{
+		aCaptureFlags=RWindowBase::TCaptureDragDrop;
+		}
+	else
+		{
+		TUint	captureFlags;
+		TLex	lex(aStr);
+		ret=(lex.Val(captureFlags, EHex)==KErrNone);
+		if ( ret )
+			{
+			aCaptureFlags=(RWindowBase::TCaptureFlags)captureFlags;
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ConvertToCaptureFlags(const TDesC& aStr, TUint& aCaptureFlags)
+	{
+	TBool	ret=ETrue;
+	TInt	location=aStr.Match(_L("*|*"));
+	if( location!=KErrNotFound )
+		{
+		// Converting Left part of the data
+		TPtrC	tempStr=aStr.Left(location);
+		ret=ConvertToCaptureFlags(tempStr, aCaptureFlags);
+
+		// Converting right data can be with another "|"
+		tempStr.Set(aStr.Mid(location+1));
+
+		TUint	temp;
+		if ( ConvertToCaptureFlags(tempStr, temp) )
+			{
+			aCaptureFlags|=temp;
+			}
+		else
+			{
+			ret=EFalse;
+			}
+		}
+	else
+		{
+		RWindowBase::TCaptureFlags	captureFlags;
+		ret=ConvertToCaptureFlags(aStr, captureFlags);
+		if ( ret )
+			{
+			aCaptureFlags=(TUint)captureFlags;
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadComputeMode(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, RWsSession::TComputeMode& aComputeMode)
+	{
+	// Read dither from INI file
+	TPtrC	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KComputeModePriorityControlDisabled )
+			{
+			aComputeMode=RWsSession::EPriorityControlDisabled;
+			}
+		else if ( str==KComputeModePriorityControlComputeOn )
+			{
+			aComputeMode=RWsSession::EPriorityControlComputeOn;
+			}
+		else if ( str==KComputeModePriorityControlComputeOff )
+			{
+			aComputeMode=RWsSession::EPriorityControlComputeOff;
+			}
+		else
+			{
+        	TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aComputeMode=(RWsSession::TComputeMode)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadCornerType(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TCornerType& aCornerType)
+	{
+	// Read dither from INI file
+	TPtrC	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KCornerTypeWindowSquare )
+			{
+			aCornerType=EWindowCornerSquare;
+			}
+		else if ( str==KCornerTypeWindow1 )
+			{
+			aCornerType=EWindowCorner1;
+			}
+		else if ( str==KCornerTypeWindow2 )
+			{
+			aCornerType=EWindowCorner2;
+			}
+		else if ( str==KCornerTypeWindow3 )
+			{
+			aCornerType=EWindowCorner3;
+			}
+		else if ( str==KCornerTypeWindow5 )
+			{
+			aCornerType=EWindowCorner5;
+			}
+		else if ( str==KCornerTypeWindowRegion )
+			{
+			aCornerType=EWindowCornerRegion;
+			}
+		else if ( str==KCornerTypeMask )
+			{
+			aCornerType=ECornerTypeMask;
+			}
+		else
+			{
+        	TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aCornerType=(TCornerType)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadDisplayMode(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TDisplayMode& aDisplayMode)
+	{
+	// Read displaymode from INI file
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KDisplayModeNone )
+			{
+			aDisplayMode=ENone;
+			}
+		else if ( str==KDisplayModeGray2 )
+			{
+			aDisplayMode=EGray2;
+			}
+		else if ( str==KDisplayModeGray4 )
+			{
+			aDisplayMode=EGray4;
+			}
+		else if ( str==KDisplayModeGray16 )
+			{
+			aDisplayMode=EGray16;
+			}
+		else if ( str==KDisplayModeGray256 )
+			{
+			aDisplayMode=EGray256;
+			}
+		else if ( str==KDisplayModeColor16 )
+			{
+			aDisplayMode=EColor16;
+			}
+		else if ( str==KDisplayModeColor256 )
+			{
+			aDisplayMode=EColor256;
+			}
+		else if ( str==KDisplayModeColor64K )
+			{
+			aDisplayMode=EColor64K;
+			}
+		else if ( str==KDisplayModeColor16M )
+			{
+			aDisplayMode=EColor16M;
+			}
+		else if ( str==KDisplayModeRgb )
+			{
+			aDisplayMode=ERgb;
+			}
+		else if ( str==KDisplayModeColor4K )
+			{
+			aDisplayMode=EColor4K;
+			}
+		else if ( str==KDisplayModeColor16MU )
+			{
+			aDisplayMode=EColor16MU;
+			}
+		else if ( str==KDisplayModeColor16MA )
+			{
+			aDisplayMode=EColor16MA;
+			}
+		else if ( str==KDisplayModeColor16MAP )
+			{
+			aDisplayMode=EColor16MAP;
+			}
+		else if ( str==KDisplayModeColorLast )
+			{
+			aDisplayMode=EColorLast;
+			}
+		else
+			{
+    	    TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aDisplayMode=(TDisplayMode)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadDrawMode(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CGraphicsContext::TDrawMode& aDrawMode)
+	{
+	// Read displaymode from INI file
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KDrawModeAND )
+			{
+			aDrawMode=CGraphicsContext::EDrawModeAND;
+			}
+		else if ( str==KDrawModeNOTAND )
+			{
+			aDrawMode=CGraphicsContext::EDrawModeNOTAND;
+			}
+		else if ( str==KDrawModePEN )
+			{
+			aDrawMode=CGraphicsContext::EDrawModePEN;
+			}
+		else if ( str==KDrawModeANDNOT )
+			{
+			aDrawMode=CGraphicsContext::EDrawModeANDNOT;
+			}
+		else if ( str==KDrawModeXOR )
+			{
+			aDrawMode=CGraphicsContext::EDrawModeXOR;
+			}
+		else if ( str==KDrawModeOR )
+			{
+			aDrawMode=CGraphicsContext::EDrawModeOR;
+			}
+		else if ( str==KDrawModeNOTANDNOT )
+			{
+			aDrawMode=CGraphicsContext::EDrawModeNOTANDNOT;
+			}
+		else if ( str==KDrawModeNOTXOR )
+			{
+			aDrawMode=CGraphicsContext::EDrawModeNOTXOR;
+			}
+		else if ( str==KDrawModeNOTSCREEN )
+			{
+			aDrawMode=CGraphicsContext::EDrawModeNOTSCREEN;
+			}
+		else if ( str==KDrawModeNOTOR )
+			{
+			aDrawMode=CGraphicsContext::EDrawModeNOTOR;
+			}
+		else if ( str==KDrawModeNOTPEN )
+			{
+			aDrawMode=CGraphicsContext::EDrawModeNOTPEN;
+			}
+		else if ( str==KDrawModeORNOT )
+			{
+			aDrawMode=CGraphicsContext::EDrawModeORNOT;
+			}
+		else if ( str==KDrawModeNOTORNOT )
+			{
+			aDrawMode=CGraphicsContext::EDrawModeNOTORNOT;
+			}
+		else if ( str==KDrawModeWriteAlpha )
+			{
+			aDrawMode=CGraphicsContext::EDrawModeWriteAlpha;
+			}
+		else
+			{
+    	    TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aDrawMode=(CGraphicsContext::TDrawMode)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadErrorCategory(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TWsErrorMessage::TErrorCategory& aErrorCategory)
+	{
+	// Read dither from INI file
+	TPtrC	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KErrorCategoryDrawingRegion )
+			{
+			aErrorCategory=TWsErrorMessage::EDrawingRegion;
+			}
+		else if ( str==KErrorCategoryBackLight )
+			{
+			aErrorCategory=TWsErrorMessage::EBackLight;
+			}
+		else if ( str==KErrorCategoryLogging )
+			{
+			aErrorCategory=TWsErrorMessage::ELogging;
+			}
+		else if ( str==KErrorCategoryContrast )
+			{
+			aErrorCategory=TWsErrorMessage::EContrast;
+			}
+		else
+			{
+        	TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aErrorCategory=(TWsErrorMessage::TErrorCategory)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadEventCode(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TEventCode& aEventCode)
+	{
+	// Read dither from INI file
+	TPtrC	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KEventCodeNull )
+			{
+			aEventCode=EEventNull;
+			}
+		else if ( str==KEventCodeKey )
+			{
+			aEventCode=EEventKey;
+			}
+		else if ( str==KEventCodeKeyUp )
+			{
+			aEventCode=EEventKeyUp;
+			}
+		else if ( str==KEventCodeKeyDown )
+			{
+			aEventCode=EEventKeyDown;
+			}
+		else if ( str==KEventCodeModifiersChanged )
+			{
+			aEventCode=EEventModifiersChanged;
+			}
+		else if ( str==KEventCodePointer )
+			{
+			aEventCode=EEventPointer;
+			}
+		else if ( str==KEventCodePointerEnter )
+			{
+			aEventCode=EEventPointerEnter;
+			}
+		else if ( str==KEventCodePointerExit )
+			{
+			aEventCode=EEventPointerExit;
+			}
+		else if ( str==KEventCodePointerBufferReady )
+			{
+			aEventCode=EEventPointerBufferReady;
+			}
+		else if ( str==KEventCodeDragDrop )
+			{
+			aEventCode=EEventDragDrop;
+			}
+		else if ( str==KEventCodeFocusLost )
+			{
+			aEventCode=EEventFocusLost;
+			}
+		else if ( str==KEventCodeFocusGained )
+			{
+			aEventCode=EEventFocusGained;
+			}
+		else if ( str==KEventCodeSwitchOn )
+			{
+			aEventCode=EEventSwitchOn;
+			}
+		else if ( str==KEventCodePassword )
+			{
+			aEventCode=EEventPassword;
+			}
+		else if ( str==KEventCodeWindowGroupsChanged )
+			{
+			aEventCode=EEventWindowGroupsChanged;
+			}
+		else if ( str==KEventCodeErrorMessage )
+			{
+			aEventCode=EEventErrorMessage;
+			}
+		else if ( str==KEventCodeMessageReady )
+			{
+			aEventCode=EEventMessageReady;
+			}
+		else if ( str==KEventCodeMarkInvalid )
+			{
+			aEventCode=EEventMarkInvalid;
+			}
+		else if ( str==KEventCodeSwitchOff )
+			{
+			aEventCode=EEventSwitchOff;
+			}
+		else if ( str==KEventCodeKeySwitchOff )
+			{
+			aEventCode=EEventKeySwitchOff;
+			}
+		else if ( str==KEventCodeScreenDeviceChanged )
+			{
+			aEventCode=EEventScreenDeviceChanged;
+			}
+		else if ( str==KEventCodeFocusGroupChanged )
+			{
+			aEventCode=EEventFocusGroupChanged;
+			}
+		else if ( str==KEventCodeCaseOpened )
+			{
+			aEventCode=EEventCaseOpened;
+			}
+		else if ( str==KEventCodeCaseClosed )
+			{
+			aEventCode=EEventCaseClosed;
+			}
+		else if ( str==KEventCodeWindowGroupListChanged )
+			{
+			aEventCode=EEventWindowGroupListChanged;
+			}
+		else if ( str==KEventCodeWindowVisibilityChanged )
+			{
+			aEventCode=EEventWindowVisibilityChanged;
+			}
+#if (defined SYMBIAN_PROCESS_MONITORING_AND_STARTUP)
+		else if ( str==KEventCodeRestartSystem )
+			{
+			aEventCode=EEventRestartSystem;
+			}
+#endif
+		else if ( str==KEventCodeKeyRepeat )
+			{
+			aEventCode=EEventKeyRepeat;
+			}
+		else if ( str==KEventCodeDirectScreenAccessBegin )
+			{
+			aEventCode=EEventDirectScreenAccessBegin;
+			}
+		else if ( str==KEventCodeDirectScreenAccessEnd )
+			{
+			aEventCode=EEventDirectScreenAccessEnd;
+			}
+		else if ( str==KEventCodeHeartbeatTimerStateChange )
+			{
+			aEventCode=EEventHeartbeatTimerStateChange;
+			}
+		else if ( str==KEventCodePowerMgmt )
+			{
+			aEventCode=EEventPowerMgmt;
+			}
+		else if ( str==KEventCodeReserved )
+			{
+			aEventCode=EEventReserved;
+			}
+		else if ( str==KEventCodeUser )
+			{
+			aEventCode=EEventUser;
+			}
+		else
+			{
+        	TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aEventCode=(TEventCode)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadEventControl(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TEventControl& aEventControl)
+	{
+	// Read displaymode from INI file
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KEventControlAlways )
+			{
+			aEventControl=EEventControlAlways;
+			}
+		else if ( str==KEventControlOnlyWithKeyboardFocus )
+			{
+			aEventControl=EEventControlOnlyWithKeyboardFocus;
+			}
+		else if ( str==KEventControlOnlyWhenVisible )
+			{
+			aEventControl=EEventControlOnlyWhenVisible;
+			}
+		else
+			{
+    	    TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aEventControl=(TEventControl)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadEventModifier(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TEventModifier& aEventModifier)
+	{
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		ret=ConvertToEventModifier(str, aEventModifier);
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadEventModifier(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TUint& aEventModifier)
+	{
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		TUint	temp=0;
+		ret=ConvertToEventModifier(str, temp);
+		if ( ret )
+			{
+			aEventModifier=temp;
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ConvertToEventModifier(const TDesC& aStr, TEventModifier& aEventModifier)
+	{
+	TBool	ret=ETrue;
+	if ( aStr==KEventModifierAutorepeatable )
+		{
+		aEventModifier=EModifierAutorepeatable;
+		}
+	else if ( aStr==KEventModifierKeypad )
+		{
+		aEventModifier=EModifierKeypad;
+		}
+	else if ( aStr==KEventModifierLeftAlt )
+		{
+		aEventModifier=EModifierLeftAlt;
+		}
+	else if ( aStr==KEventModifierRightAlt )
+		{
+		aEventModifier=EModifierRightAlt;
+		}
+	else if ( aStr==KEventModifierAlt )
+		{
+		aEventModifier=EModifierAlt;
+		}
+	else if ( aStr==KEventModifierLeftCtrl )
+		{
+		aEventModifier=EModifierLeftCtrl;
+		}
+	else if ( aStr==KEventModifierRightCtrl )
+		{
+		aEventModifier=EModifierRightCtrl;
+		}
+	else if ( aStr==KEventModifierCtrl )
+		{
+		aEventModifier=EModifierCtrl;
+		}
+	else if ( aStr==KEventModifierLeftShift )
+		{
+		aEventModifier=EModifierLeftShift;
+		}
+	else if ( aStr==KEventModifierRightShift )
+		{
+		aEventModifier=EModifierRightShift;
+		}
+	else if ( aStr==KEventModifierShift )
+		{
+		aEventModifier=EModifierShift;
+		}
+	else if ( aStr==KEventModifierLeftFunc )
+		{
+		aEventModifier=EModifierLeftFunc;
+		}
+	else if ( aStr==KEventModifierRightFunc )
+		{
+		aEventModifier=EModifierRightFunc;
+		}
+	else if ( aStr==KEventModifierFunc )
+		{
+		aEventModifier=EModifierFunc;
+		}
+	else if ( aStr==KEventModifierCapsLock )
+		{
+		aEventModifier=EModifierCapsLock;
+		}
+	else if ( aStr==KEventModifierNumLock )
+		{
+		aEventModifier=EModifierNumLock;
+		}
+	else if ( aStr==KEventModifierScrollLock )
+		{
+		aEventModifier=EModifierScrollLock;
+		}
+	else if ( aStr==KEventModifierKeyUp )
+		{
+		aEventModifier=EModifierKeyUp;
+		}
+	else if ( aStr==KEventModifierSpecial )
+		{
+		aEventModifier=EModifierSpecial;
+		}
+	else if ( aStr==KEventModifierDoubleClick )
+		{
+		aEventModifier=EModifierDoubleClick;
+		}
+	else if ( aStr==KEventModifierPureKeycode )
+		{
+		aEventModifier=EModifierPureKeycode;
+		}
+	else if ( aStr==KEventModifierKeyboardExtend )
+		{
+		aEventModifier=EModifierKeyboardExtend;
+		}
+	else if ( aStr==KEventModifierCancelRotation )
+		{
+		aEventModifier=EModifierCancelRotation;
+		}
+	else if ( aStr==KEventModifierRotateBy90 )
+		{
+		aEventModifier=EModifierRotateBy90;
+		}
+	else if ( aStr==KEventModifierRotateBy180 )
+		{
+		aEventModifier=EModifierRotateBy180;
+		}
+	else if ( aStr==KEventModifierRotateBy270 )
+		{
+		aEventModifier=EModifierRotateBy270;
+		}
+	else if ( aStr==KEventModifierPointer3DButton1 )
+		{
+		aEventModifier=EModifierPointer3DButton1;
+		}
+	else if ( aStr==KEventModifierPointer3DButton2 )
+		{
+		aEventModifier=EModifierPointer3DButton2;
+		}
+	else if ( aStr==KEventModifierPointer3DButton3 )
+		{
+		aEventModifier=EModifierPointer3DButton3;
+		}
+	else if ( aStr==KEventModifierAll )
+		{
+		aEventModifier=EAllModifiers;
+		}
+	else
+		{
+		TUint	eventModifier;
+		TLex	lex(aStr);
+		ret=(lex.Val(eventModifier, EHex)==KErrNone);
+		if ( ret )
+			{
+			aEventModifier=(TEventModifier)eventModifier;
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ConvertToEventModifier(const TDesC& aStr, TUint& aEventModifier)
+	{
+	TBool	ret=ETrue;
+	TInt	location=aStr.Match(_L("*|*"));
+	if( location!=KErrNotFound )
+		{
+		// Converting Left part of the data
+		TPtrC	tempStr=aStr.Left(location);
+		ret=ConvertToEventModifier(tempStr, aEventModifier);
+
+		// Converting right data can be with another "|"
+		tempStr.Set(aStr.Mid(location+1));
+
+		TUint	temp;
+		if ( ConvertToEventModifier(tempStr, temp) )
+			{
+			aEventModifier|=temp;
+			}
+		else
+			{
+			ret=EFalse;
+			}
+		}
+	else
+		{
+		TEventModifier	eventModifier;
+		ret=ConvertToEventModifier(aStr, eventModifier);
+		if ( ret )
+			{
+			aEventModifier=(TUint)eventModifier;
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadFadeControl(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, RWindowTreeNode::TFadeControl& aFadeControl)
+	{
+	// Read displaymode from INI file
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KFadeControlIncludeChildren )
+			{
+			aFadeControl=RWindowTreeNode::EFadeIncludeChildren;
+			}
+		else if ( str==KFadeControlWindowOnly )
+			{
+			aFadeControl=RWindowTreeNode::EFadeWindowOnly;
+			}
+		else
+			{
+    	    TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aFadeControl=(RWindowTreeNode::TFadeControl)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadFillRule(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CGraphicsContext::TFillRule& aFillRule)
+	{
+	// Read displaymode from INI file
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KFillRuleAlternate )
+			{
+			aFillRule=CGraphicsContext::EAlternate;
+			}
+		else if ( str==KFillRuleEWinding )
+			{
+			aFillRule=CGraphicsContext::EWinding;
+			}
+		else
+			{
+    	    TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aFillRule=(CGraphicsContext::TFillRule)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadTUsage(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CPolygonFiller::TUsage& aUsage)
+	{
+	TPtrC str;
+	TBool ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if (ret)
+		{
+		if (str==KUsageEGetAllPixelRunsSequentially)
+			{
+			aUsage=CPolygonFiller::EGetAllPixelRunsSequentially;
+			}
+		else if (str==KUsageEGetPixelRunsSequentiallyForSpecifiedScanLines)
+			{
+			aUsage=CPolygonFiller::EGetPixelRunsSequentiallyForSpecifiedScanLines;
+			}
+		}
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadFontStrikethrough(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TFontStrikethrough& aFontStrikethrough)
+	{
+	// Read displaymode from INI file
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KFontStrikethroughOff )
+			{
+			aFontStrikethrough=EStrikethroughOff;
+			}
+		else if ( str==KFontStrikethroughOn )
+			{
+			aFontStrikethrough=EStrikethroughOn;
+			}
+		else
+			{
+    	    TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aFontStrikethrough=(TFontStrikethrough)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadFontUnderline(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TFontUnderline& aFontUnderline)
+	{
+	// Read displaymode from INI file
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KFontUnderlineOff )
+			{
+			aFontUnderline=EUnderlineOff;
+			}
+		else if ( str==KFontUnderlineOn )
+			{
+			aFontUnderline=EUnderlineOn;
+			}
+		else
+			{
+    	    TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aFontUnderline=(TFontUnderline)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadHotKey(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, THotKey& aHotKey)
+	{
+	// Read dither from INI file
+	TPtrC	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KHotKeyEnableLogging )
+			{
+			aHotKey=EHotKeyEnableLogging;
+			}
+		else if ( str==KHotKeyDisableLogging )
+			{
+			aHotKey=EHotKeyDisableLogging;
+			}
+		else if ( str==KHotKeyStateDump )
+			{
+			aHotKey=EHotKeyStateDump;
+			}
+		else if ( str==KHotKeyOfDeath )
+			{
+			aHotKey=EHotKeyOfDeath;
+			}
+		else if ( str==KHotKeyShutDown )
+			{
+			aHotKey=EHotKeyShutDown;
+			}
+		else if ( str==KHotKeyHeapDump )
+			{
+			aHotKey=EHotKeyHeapDump;
+			}
+		else if ( str==KHotKeyIncContrast )
+			{
+			aHotKey=EHotKeyIncContrast;
+			}
+		else if ( str==KHotKeyDecContrast )
+			{
+			aHotKey=EHotKeyDecContrast;
+			}
+		else if ( str==KHotKeyOff )
+			{
+			aHotKey=EHotKeyOff;
+			}
+		else if ( str==KHotKeyBacklightOn )
+			{
+			aHotKey=EHotKeyBacklightOn;
+			}
+		else if ( str==KHotKeyBacklightOff )
+			{
+			aHotKey=EHotKeyBacklightOff;
+			}
+		else if ( str==KHotKeyBacklightToggle )
+			{
+			aHotKey=EHotKeyBacklightToggle;
+			}
+		else if ( str==KHotKeyScreenDimension0 )
+			{
+			aHotKey=EHotKeyScreenDimension0;
+			}
+		else if ( str==KHotKeyScreenDimension1 )
+			{
+			aHotKey=EHotKeyScreenDimension1;
+			}
+		else if ( str==KHotKeyScreenDimension2 )
+			{
+			aHotKey=EHotKeyScreenDimension2;
+			}
+		else if ( str==KHotKeyScreenDimension3 )
+			{
+			aHotKey=EHotKeyScreenDimension3;
+			}
+		else if ( str==KHotKeyCycleDisplaySize )
+			{
+			aHotKey=EHotKeyCycleDisplaySize;
+			}
+		else if ( str==KHotKeyCycleOrientation )
+			{
+			aHotKey=EHotKeyCycleOrientation;
+			}
+		else if ( str==KHotKeyIncBrightness )
+			{
+			aHotKey=EHotKeyIncBrightness;
+			}
+		else if ( str==KHotKeyDecBrightness )
+			{
+			aHotKey=EHotKeyDecBrightness;
+			}
+		else if ( str==KHotKeyCycleFocusScreen )
+			{
+			aHotKey=EHotKeyCycleFocusScreen;
+			}
+		else if ( str==KHotKeyFirstKeyType )
+			{
+			aHotKey=EHotKeyFirstKeyType;
+			}
+		else if ( str==KHotKeyLastKeyType )
+			{
+			aHotKey=EHotKeyLastKeyType;
+			}
+		else
+			{
+        	TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aHotKey=(THotKey)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadKeyCode(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TKeyCode& aKeyCode)
+	{
+	// Read dither from INI file
+	TPtrC	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KKeyNull )
+			{
+			aKeyCode=EKeyNull;
+			}
+		else if ( str==KKeyBell )
+			{
+			aKeyCode=EKeyBell;
+			}
+		else if ( str==KKeyBackspace )
+			{
+			aKeyCode=EKeyBackspace;
+			}
+		else if ( str==KKeyTab )
+			{
+			aKeyCode=EKeyTab;
+			}
+		else if ( str==KKeyLineFeed )
+			{
+			aKeyCode=EKeyLineFeed;
+			}
+		else if ( str==KKeyVerticalTab )
+			{
+			aKeyCode=EKeyVerticalTab;
+			}
+		else if ( str==KKeyFormFeed )
+			{
+			aKeyCode=EKeyFormFeed;
+			}
+		else if ( str==KKeyEnter )
+			{
+			aKeyCode=EKeyEnter;
+			}
+		else if ( str==KKeyEscape )
+			{
+			aKeyCode=EKeyEscape;
+			}
+		else if ( str==KKeySpace )
+			{
+			aKeyCode=EKeySpace;
+			}
+		else if ( str==KKeyDelete )
+			{
+			aKeyCode=EKeyDelete;
+			}
+		else if ( str==KKeyPrintScreen )
+			{
+			aKeyCode=EKeyPrintScreen;
+			}
+		else if ( str==KKeyPause )
+			{
+			aKeyCode=EKeyPause;
+			}
+		else if ( str==KKeyHome )
+			{
+			aKeyCode=EKeyHome;
+			}
+		else if ( str==KKeyEnd )
+			{
+			aKeyCode=EKeyEnd;
+			}
+		else if ( str==KKeyPageUp )
+			{
+			aKeyCode=EKeyPageUp;
+			}
+		else if ( str==KKeyPageDown )
+			{
+			aKeyCode=EKeyPageDown;
+			}
+		else if ( str==KKeyInsert )
+			{
+			aKeyCode=EKeyInsert;
+			}
+		else if ( str==KKeyLeftArrow )
+			{
+			aKeyCode=EKeyLeftArrow;
+			}
+		else if ( str==KKeyRightArrow )
+			{
+			aKeyCode=EKeyRightArrow;
+			}
+		else if ( str==KKeyUpArrow )
+			{
+			aKeyCode=EKeyUpArrow;
+			}
+		else if ( str==KKeyDownArrow )
+			{
+			aKeyCode=EKeyDownArrow;
+			}
+		else if ( str==KKeyLeftShift )
+			{
+			aKeyCode=EKeyLeftShift;
+			}
+		else if ( str==KKeyRightShift )
+			{
+			aKeyCode=EKeyRightShift;
+			}
+		else if ( str==KKeyLeftAlt )
+			{
+			aKeyCode=EKeyLeftAlt;
+			}
+		else if ( str==KKeyRightAlt )
+			{
+			aKeyCode=EKeyRightAlt;
+			}
+		else if ( str==KKeyLeftCtrl )
+			{
+			aKeyCode=EKeyLeftCtrl;
+			}
+		else if ( str==KKeyRightCtrl )
+			{
+			aKeyCode=EKeyRightCtrl;
+			}
+		else if ( str==KKeyLeftFunc )
+			{
+			aKeyCode=EKeyLeftFunc;
+			}
+		else if ( str==KKeyRightFunc )
+			{
+			aKeyCode=EKeyRightFunc;
+			}
+		else if ( str==KKeyCapsLock )
+			{
+			aKeyCode=EKeyCapsLock;
+			}
+		else if ( str==KKeyNumLock )
+			{
+			aKeyCode=EKeyNumLock;
+			}
+		else if ( str==KKeyScrollLock )
+			{
+			aKeyCode=EKeyScrollLock;
+			}
+		else if ( str==KKeyF1 )
+			{
+			aKeyCode=EKeyF1;
+			}
+		else if ( str==KKeyF2 )
+			{
+			aKeyCode=EKeyF2;
+			}
+		else if ( str==KKeyF3 )
+			{
+			aKeyCode=EKeyF3;
+			}
+		else if ( str==KKeyF4 )
+			{
+			aKeyCode=EKeyF4;
+			}
+		else if ( str==KKeyF5 )
+			{
+			aKeyCode=EKeyF5;
+			}
+		else if ( str==KKeyF6 )
+			{
+			aKeyCode=EKeyF6;
+			}
+		else if ( str==KKeyF7 )
+			{
+			aKeyCode=EKeyF7;
+			}
+		else if ( str==KKeyF8 )
+			{
+			aKeyCode=EKeyF8;
+			}
+		else if ( str==KKeyF9 )
+			{
+			aKeyCode=EKeyF9;
+			}
+		else if ( str==KKeyF10 )
+			{
+			aKeyCode=EKeyF10;
+			}
+		else if ( str==KKeyF11 )
+			{
+			aKeyCode=EKeyF11;
+			}
+		else if ( str==KKeyF12 )
+			{
+			aKeyCode=EKeyF12;
+			}
+		else if ( str==KKeyF13 )
+			{
+			aKeyCode=EKeyF13;
+			}
+		else if ( str==KKeyF14 )
+			{
+			aKeyCode=EKeyF14;
+			}
+		else if ( str==KKeyF15 )
+			{
+			aKeyCode=EKeyF15;
+			}
+		else if ( str==KKeyF16 )
+			{
+			aKeyCode=EKeyF16;
+			}
+		else if ( str==KKeyF17 )
+			{
+			aKeyCode=EKeyF17;
+			}
+		else if ( str==KKeyF18 )
+			{
+			aKeyCode=EKeyF18;
+			}
+		else if ( str==KKeyF19 )
+			{
+			aKeyCode=EKeyF19;
+			}
+		else if ( str==KKeyF20 )
+			{
+			aKeyCode=EKeyF20;
+			}
+		else if ( str==KKeyF21 )
+			{
+			aKeyCode=EKeyF21;
+			}
+		else if ( str==KKeyF22 )
+			{
+			aKeyCode=EKeyF22;
+			}
+		else if ( str==KKeyF23 )
+			{
+			aKeyCode=EKeyF23;
+			}
+		else if ( str==KKeyF24 )
+			{
+			aKeyCode=EKeyF24;
+			}
+		else if ( str==KKeyOff )
+			{
+			aKeyCode=EKeyOff;
+			}
+		else if ( str==KKeyIncContrast )
+			{
+			aKeyCode=EKeyIncContrast;
+			}
+		else if ( str==KKeyDecContrast )
+			{
+			aKeyCode=EKeyDecContrast;
+			}
+		else if ( str==KKeyBacklightOn )
+			{
+			aKeyCode=EKeyBacklightOn;
+			}
+		else if ( str==KKeyBacklightOff )
+			{
+			aKeyCode=EKeyBacklightOff;
+			}
+		else if ( str==KKeyBacklightToggle )
+			{
+			aKeyCode=EKeyBacklightToggle;
+			}
+		else if ( str==KKeySliderDown )
+			{
+			aKeyCode=EKeySliderDown;
+			}
+		else if ( str==KKeySliderUp )
+			{
+			aKeyCode=EKeySliderUp;
+			}
+		else if ( str==KKeyMenu )
+			{
+			aKeyCode=EKeyMenu;
+			}
+		else if ( str==KKeyDictaphonePlay )
+			{
+			aKeyCode=EKeyDictaphonePlay;
+			}
+		else if ( str==KKeyDictaphoneStop )
+			{
+			aKeyCode=EKeyDictaphoneStop;
+			}
+		else if ( str==KKeyDictaphoneRecord )
+			{
+			aKeyCode=EKeyDictaphoneRecord;
+			}
+		else if ( str==KKeyHelp )
+			{
+			aKeyCode=EKeyHelp;
+			}
+		else if ( str==KKeyDial )
+			{
+			aKeyCode=EKeyDial;
+			}
+		else if ( str==KKeyScreenDimension0 )
+			{
+			aKeyCode=EKeyScreenDimension0;
+			}
+		else if ( str==KKeyScreenDimension1 )
+			{
+			aKeyCode=EKeyScreenDimension1;
+			}
+		else if ( str==KKeyScreenDimension2 )
+			{
+			aKeyCode=EKeyScreenDimension2;
+			}
+		else if ( str==KKeyScreenDimension3 )
+			{
+			aKeyCode=EKeyScreenDimension3;
+			}
+		else if ( str==KKeyIncVolume )
+			{
+			aKeyCode=EKeyIncVolume;
+			}
+		else if ( str==KKeyDecVolume )
+			{
+			aKeyCode=EKeyDecVolume;
+			}
+		else if ( str==KKeyDevice0 )
+			{
+			aKeyCode=EKeyDevice0;
+			}
+		else if ( str==KKeyDevice1 )
+			{
+			aKeyCode=EKeyDevice1;
+			}
+		else if ( str==KKeyDevice2 )
+			{
+			aKeyCode=EKeyDevice2;
+			}
+		else if ( str==KKeyDevice3 )
+			{
+			aKeyCode=EKeyDevice3;
+			}
+		else if ( str==KKeyDevice4 )
+			{
+			aKeyCode=EKeyDevice4;
+			}
+		else if ( str==KKeyDevice5 )
+			{
+			aKeyCode=EKeyDevice5;
+			}
+		else if ( str==KKeyDevice6 )
+			{
+			aKeyCode=EKeyDevice6;
+			}
+		else if ( str==KKeyDevice7 )
+			{
+			aKeyCode=EKeyDevice7;
+			}
+		else if ( str==KKeyDevice8 )
+			{
+			aKeyCode=EKeyDevice8;
+			}
+		else if ( str==KKeyDevice9 )
+			{
+			aKeyCode=EKeyDevice9;
+			}
+		else if ( str==KKeyDeviceA )
+			{
+			aKeyCode=EKeyDeviceA;
+			}
+		else if ( str==KKeyDeviceB )
+			{
+			aKeyCode=EKeyDeviceB;
+			}
+		else if ( str==KKeyDeviceC )
+			{
+			aKeyCode=EKeyDeviceC;
+			}
+		else if ( str==KKeyDeviceD )
+			{
+			aKeyCode=EKeyDeviceD;
+			}
+		else if ( str==KKeyDeviceE )
+			{
+			aKeyCode=EKeyDeviceE;
+			}
+		else if ( str==KKeyDeviceF )
+			{
+			aKeyCode=EKeyDeviceF;
+			}
+		else if ( str==KKeyApplication0 )
+			{
+			aKeyCode=EKeyApplication0;
+			}
+		else if ( str==KKeyApplication1 )
+			{
+			aKeyCode=EKeyApplication1;
+			}
+		else if ( str==KKeyApplication2 )
+			{
+			aKeyCode=EKeyApplication2;
+			}
+		else if ( str==KKeyApplication3 )
+			{
+			aKeyCode=EKeyApplication3;
+			}
+		else if ( str==KKeyApplication4 )
+			{
+			aKeyCode=EKeyApplication4;
+			}
+		else if ( str==KKeyApplication5 )
+			{
+			aKeyCode=EKeyApplication5;
+			}
+		else if ( str==KKeyApplication6 )
+			{
+			aKeyCode=EKeyApplication6;
+			}
+		else if ( str==KKeyApplication7 )
+			{
+			aKeyCode=EKeyApplication7;
+			}
+		else if ( str==KKeyApplication8 )
+			{
+			aKeyCode=EKeyApplication8;
+			}
+		else if ( str==KKeyApplication9 )
+			{
+			aKeyCode=EKeyApplication9;
+			}
+		else if ( str==KKeyApplicationA )
+			{
+			aKeyCode=EKeyApplicationA;
+			}
+		else if ( str==KKeyApplicationB )
+			{
+			aKeyCode=EKeyApplicationB;
+			}
+		else if ( str==KKeyApplicationC )
+			{
+			aKeyCode=EKeyApplicationC;
+			}
+		else if ( str==KKeyApplicationD )
+			{
+			aKeyCode=EKeyApplicationD;
+			}
+		else if ( str==KKeyApplicationE )
+			{
+			aKeyCode=EKeyApplicationE;
+			}
+		else if ( str==KKeyApplicationF )
+			{
+			aKeyCode=EKeyApplicationF;
+			}
+		else if ( str==KKeyYes )
+			{
+			aKeyCode=EKeyYes;
+			}
+		else if ( str==KKeyNo )
+			{
+			aKeyCode=EKeyNo;
+			}
+		else if ( str==KKeyIncBrightness )
+			{
+			aKeyCode=EKeyIncBrightness;
+			}
+		else if ( str==KKeyDecBrightness )
+			{
+			aKeyCode=EKeyDecBrightness;
+			}
+		else if ( str==KKeyKeyboardExtend )
+			{
+			aKeyCode=EKeyKeyboardExtend;
+			}
+		else if ( str==KKeyDevice10 )
+			{
+			aKeyCode=EKeyDevice10;
+			}
+		else if ( str==KKeyDevice11 )
+			{
+			aKeyCode=EKeyDevice11;
+			}
+		else if ( str==KKeyDevice12 )
+			{
+			aKeyCode=EKeyDevice12;
+			}
+		else if ( str==KKeyDevice13 )
+			{
+			aKeyCode=EKeyDevice13;
+			}
+		else if ( str==KKeyDevice14 )
+			{
+			aKeyCode=EKeyDevice14;
+			}
+		else if ( str==KKeyDevice15 )
+			{
+			aKeyCode=EKeyDevice15;
+			}
+		else if ( str==KKeyDevice16 )
+			{
+			aKeyCode=EKeyDevice16;
+			}
+		else if ( str==KKeyDevice17 )
+			{
+			aKeyCode=EKeyDevice17;
+			}
+		else if ( str==KKeyDevice18 )
+			{
+			aKeyCode=EKeyDevice18;
+			}
+		else if ( str==KKeyDevice19 )
+			{
+			aKeyCode=EKeyDevice19;
+			}
+		else if ( str==KKeyDevice1A )
+			{
+			aKeyCode=EKeyDevice1A;
+			}
+		else if ( str==KKeyDevice1B )
+			{
+			aKeyCode=EKeyDevice1B;
+			}
+		else if ( str==KKeyDevice1C )
+			{
+			aKeyCode=EKeyDevice1C;
+			}
+		else if ( str==KKeyDevice1D )
+			{
+			aKeyCode=EKeyDevice1D;
+			}
+		else if ( str==KKeyDevice1E )
+			{
+			aKeyCode=EKeyDevice1E;
+			}
+		else if ( str==KKeyDevice1F )
+			{
+			aKeyCode=EKeyDevice1F;
+			}
+		else if ( str==KKeyApplication10 )
+			{
+			aKeyCode=EKeyApplication10;
+			}
+		else if ( str==KKeyApplication11 )
+			{
+			aKeyCode=EKeyApplication11;
+			}
+		else if ( str==KKeyApplication12 )
+			{
+			aKeyCode=EKeyApplication12;
+			}
+		else if ( str==KKeyApplication13 )
+			{
+			aKeyCode=EKeyApplication13;
+			}
+		else if ( str==KKeyApplication14 )
+			{
+			aKeyCode=EKeyApplication14;
+			}
+		else if ( str==KKeyApplication15 )
+			{
+			aKeyCode=EKeyApplication15;
+			}
+		else if ( str==KKeyApplication16 )
+			{
+			aKeyCode=EKeyApplication16;
+			}
+		else if ( str==KKeyApplication17 )
+			{
+			aKeyCode=EKeyApplication17;
+			}
+		else if ( str==KKeyApplication18 )
+			{
+			aKeyCode=EKeyApplication18;
+			}
+		else if ( str==KKeyApplication19 )
+			{
+			aKeyCode=EKeyApplication19;
+			}
+		else if ( str==KKeyApplication1A )
+			{
+			aKeyCode=EKeyApplication1A;
+			}
+		else if ( str==KKeyApplication1B )
+			{
+			aKeyCode=EKeyApplication1B;
+			}
+		else if ( str==KKeyApplication1C )
+			{
+			aKeyCode=EKeyApplication1C;
+			}
+		else if ( str==KKeyApplication1D )
+			{
+			aKeyCode=EKeyApplication1D;
+			}
+		else if ( str==KKeyApplication1E )
+			{
+			aKeyCode=EKeyApplication1E;
+			}
+		else if ( str==KKeyApplication1F )
+			{
+			aKeyCode=EKeyApplication1F;
+			}
+		else
+			{
+        	TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aKeyCode=(TKeyCode)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadGlyphBitmapType(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TGlyphBitmapType& aGlyphBitmapType)
+	{
+	// Read dither from INI file
+	TPtrC	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KGlyphBitmapTypeDefault )
+			{
+			aGlyphBitmapType=EDefaultGlyphBitmap;
+			}
+		else if ( str==KGlyphBitmapTypeMonochrome )
+			{
+			aGlyphBitmapType=EMonochromeGlyphBitmap;
+			}
+		else if ( str==KGlyphBitmapTypeAntiAliased )
+			{
+			aGlyphBitmapType=EAntiAliasedGlyphBitmap;
+			}
+		else if ( str==KGlyphBitmapTypeSubPixel )
+			{
+			aGlyphBitmapType=ESubPixelGlyphBitmap;
+			}
+		else if ( str==KGlyphBitmapTypeFourColourBlend )
+			{
+			aGlyphBitmapType=EFourColourBlendGlyphBitmap;
+			}
+		else
+			{
+        	TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aGlyphBitmapType=(TGlyphBitmapType)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadGraphicsOrientation(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CFbsBitGc::TGraphicsOrientation& aGraphicsOrientation)
+	{
+	// Read dither from INI file
+	TPtrC	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KGraphicsOrientationNormal )
+			{
+			aGraphicsOrientation=CFbsBitGc::EGraphicsOrientationNormal;
+			}
+		else if ( str==KGraphicsOrientationRotated90 )
+			{
+			aGraphicsOrientation=CFbsBitGc::EGraphicsOrientationRotated90;
+			}
+		else if ( str==KGraphicsOrientationRotated180 )
+			{
+			aGraphicsOrientation=CFbsBitGc::EGraphicsOrientationRotated180;
+			}
+		else if ( str==KGraphicsOrientationRotated270 )
+			{
+			aGraphicsOrientation=CFbsBitGc::EGraphicsOrientationRotated270;
+			}
+		else
+			{
+        	TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aGraphicsOrientation=(CFbsBitGc::TGraphicsOrientation)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadLoggingCommand(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, RWsSession::TLoggingCommand& aLoggingCommand)
+	{
+	// Read dither from INI file
+	TPtrC	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KLoggingEnable )
+			{
+			aLoggingCommand=RWsSession::ELoggingEnable;
+			}
+		else if ( str==KLoggingDisable )
+			{
+			aLoggingCommand=RWsSession::ELoggingDisable;
+			}
+		else if ( str==KLoggingStatusDump )
+			{
+			aLoggingCommand=RWsSession::ELoggingStatusDump;
+			}
+		else if ( str==KLoggingHeapDump )
+			{
+			aLoggingCommand=RWsSession::ELoggingHeapDump;
+			}
+		else
+			{
+        	TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aLoggingCommand=(RWsSession::TLoggingCommand)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadModifierState(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TModifierState& aModifierState)
+	{
+	// Read dither from INI file
+	TPtrC	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KModifierStateTurnOnModifier )
+			{
+			aModifierState=ETurnOnModifier;
+			}
+		else if ( str==KModifierStateTurnOffModifier )
+			{
+			aModifierState=ETurnOffModifier;
+			}
+		else if ( str==KModifierStateToggleModifier )
+			{
+			aModifierState=EToggleModifier;
+			}
+		else
+			{
+        	TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aModifierState=(TModifierState)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadPasswordMode(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TPasswordMode& aPasswordMode)
+	{
+	// Read dither from INI file
+	TPtrC	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KPasswordModeCancel )
+			{
+			aPasswordMode=EPasswordCancel;
+			}
+		else if ( str==KPasswordModeNone )
+			{
+			aPasswordMode=EPasswordNone;
+			}
+		else if ( str==KPasswordModeOnceADay )
+			{
+			aPasswordMode=EPasswordOnceADay;
+			}
+		else if ( str==KPasswordModeAlways )
+			{
+			aPasswordMode=EPasswordAlways;
+			}
+		else if ( str==KPasswordModeAlwaysTriggerNow )
+			{
+			aPasswordMode=EPasswordAlwaysTriggerNow;
+			}
+		else if ( str==KPasswordModeOnceADayTriggerNow )
+			{
+			aPasswordMode=EPasswordOnceADayTriggerNow;
+			}
+		else
+			{
+        	TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aPasswordMode=(TPasswordMode)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadPenStyle(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CGraphicsContext::TPenStyle& aPenStyle)
+	{
+	// Read displaymode from INI file
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KPenStyleNull )
+			{
+			aPenStyle=CGraphicsContext::ENullPen;
+			}
+		else if ( str==KPenStyleSolid )
+			{
+			aPenStyle=CGraphicsContext::ESolidPen;
+			}
+		else if ( str==KPenStyleDotted )
+			{
+			aPenStyle=CGraphicsContext::EDottedPen;
+			}
+		else if ( str==KPenStyleDashed )
+			{
+			aPenStyle=CGraphicsContext::EDashedPen;
+			}
+		else if ( str==KPenStyleDotDash )
+			{
+			aPenStyle=CGraphicsContext::EDotDashPen;
+			}
+		else if ( str==KPenStyleDotDotDash )
+			{
+			aPenStyle=CGraphicsContext::EDotDotDashPen;
+			}
+		else
+			{
+    	    TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aPenStyle=(CGraphicsContext::TPenStyle)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadPointerCursorMode(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TPointerCursorMode& aPointerCursorMode)
+	{
+	// Read displaymode from INI file
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KPointerCursorNone )
+			{
+			aPointerCursorMode=EPointerCursorNone;
+			}
+		else if ( str==KPointerCursorFixed )
+			{
+			aPointerCursorMode=EPointerCursorFixed;
+			}
+		else if ( str==KPointerCursorNormal )
+			{
+			aPointerCursorMode=EPointerCursorNormal;
+			}
+		else if ( str==KPointerCursorWindow )
+			{
+			aPointerCursorMode=EPointerCursorWindow;
+			}
+		else if ( str==KPointerCursorFirstMode )
+			{
+			aPointerCursorMode=EPointerCursorFirstMode;
+			}
+		else if ( str==KPointerCursorLastMode )
+			{
+			aPointerCursorMode=EPointerCursorLastMode;
+			}
+		else
+			{
+    	    TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aPointerCursorMode=(TPointerCursorMode)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadPointerFilter(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TPointerFilter& aPointerFilter)
+	{
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		ret=ConvertToPointerFilter(str, aPointerFilter);
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadPointerFilter(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TUint& aPointerFilter)
+	{
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		TUint	temp=0;
+		ret=ConvertToPointerFilter(str, temp);
+		if ( ret )
+			{
+			aPointerFilter=temp;
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ConvertToPointerFilter(const TDesC& aStr, TPointerFilter& aPointerFilter)
+	{
+	TBool	ret=ETrue;
+
+	if ( aStr==KPointerFilterEnterExit )
+		{
+		aPointerFilter=EPointerFilterEnterExit;
+		}
+	else if ( aStr==KPointerFilterMove )
+		{
+		aPointerFilter=EPointerFilterMove;
+		}
+	else if ( aStr==KPointerFilterDrag )
+		{
+		aPointerFilter=EPointerFilterDrag;
+		}
+	else if ( aStr==KPointerFilterGenerateSimulatedMove )
+		{
+		aPointerFilter=EPointerGenerateSimulatedMove;
+		}
+	else if ( aStr==KPointerFilterMoveEvents )
+		{
+		aPointerFilter=EPointerMoveEvents;
+		}
+	else
+		{
+		TUint	pointerFilter;
+		TLex	lex(aStr);
+		ret=(lex.Val(pointerFilter, EHex)==KErrNone);
+		if ( ret )
+			{
+			aPointerFilter=(TPointerFilter)pointerFilter;
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ConvertToPointerFilter(const TDesC& aStr, TUint& aPointerFilter)
+	{
+	TBool	ret=ETrue;
+	TInt	location=aStr.Match(_L("*|*"));
+	if( location!=KErrNotFound )
+		{
+		// Converting Left part of the data
+		TPtrC	tempStr=aStr.Left(location);
+		ret=ConvertToPointerFilter(tempStr, aPointerFilter);
+
+		// Converting right data can be with another "|"
+		tempStr.Set(aStr.Mid(location+1));
+
+		TUint	temp;
+		if ( ConvertToPointerFilter(tempStr, temp) )
+			{
+			aPointerFilter|=temp;
+			}
+		else
+			{
+			ret=EFalse;
+			}
+		}
+	else
+		{
+		TPointerFilter	pointerFilter;
+		ret=ConvertToPointerFilter(aStr, pointerFilter);
+		if ( ret )
+			{
+			aPointerFilter=(TUint)pointerFilter;
+			}
+		}
+
+	return ret;
+	}
+
+#if defined(SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS)
+TBool CT_GraphicsUtil::ReadPriorities(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TInt& aPriorities)
+	{
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KPrioritiesAll )
+			{
+			aPriorities=EAllPriorities;
+			}
+		else
+			{
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, aPriorities);
+			}
+		}
+
+	return ret;
+	}
+#endif
+
+TBool CT_GraphicsUtil::ReadPriority(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CActive::TPriority& aPriority)
+	{
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KPriorityIdle )
+			{
+			aPriority=CActive::EPriorityIdle;
+			}
+		else if ( str==KPriorityLow )
+			{
+			aPriority=CActive::EPriorityLow;
+			}
+		else if ( str==KPriorityStandard )
+			{
+			aPriority=CActive::EPriorityStandard;
+			}
+		else if ( str==KPriorityUserInput )
+			{
+			aPriority=CActive::EPriorityUserInput;
+			}
+		else if ( str==KPriorityHigh )
+			{
+			aPriority=CActive::EPriorityHigh;
+			}
+		else
+			{
+    	    TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aPriority=(CActive::TPriority)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadScreenModeEnforcement(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TScreenModeEnforcement& aScreenModeEnforcement)
+	{
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KSizeEnforcementNone )
+			{
+			aScreenModeEnforcement=ESizeEnforcementNone;
+			}
+		else if ( str==KSizeEnforcementPixelsAndRotation )
+			{
+			aScreenModeEnforcement=ESizeEnforcementPixelsAndRotation;
+			}
+		else if ( str==KSizeEnforcementPixelsTwipsAndRotation )
+			{
+			aScreenModeEnforcement=ESizeEnforcementPixelsTwipsAndRotation;
+			}
+		else
+			{
+    	    TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aScreenModeEnforcement=(TScreenModeEnforcement)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadSpriteInCompare(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TUint& aSpriteInCompare)
+	{
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		TUint	temp=0;
+		ret=ConvertToSpriteInCompare(str, temp);
+		if ( ret )
+			{
+			aSpriteInCompare=temp;
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ConvertToSpriteInCompare(const TDesC& aStr, TUint& aSpriteInCompare)
+	{
+	TBool	ret=ETrue;
+	TInt	location=aStr.Match(_L("*|*"));
+	if( location!=KErrNotFound )
+		{
+		// Converting Left part of the data
+		TPtrC	tempStr=aStr.Left(location);
+		ret=ConvertToSpriteInCompare(tempStr, aSpriteInCompare);
+
+		// Converting right data can be with another "|"
+		tempStr.Set(aStr.Mid(location+1));
+
+		TUint	temp;
+		if ( ConvertToPointerFilter(tempStr, temp) )
+			{
+			aSpriteInCompare|=temp;
+			}
+		else
+			{
+			ret=EFalse;
+			}
+		}
+	else
+		{
+		if ( aStr==KSpriteInCompareRemoveSprite )
+			{
+			aSpriteInCompare=CWsScreenDevice::ERemoveSprite;
+			}
+		else if ( aStr==KSpriteInCompareIncludeSprite )
+			{
+			aSpriteInCompare=CWsScreenDevice::EIncludeSprite;
+			}
+		else if ( aStr==KSpriteInCompareIncludeTextCursor )
+			{
+			aSpriteInCompare=CWsScreenDevice::EIncludeTextCursor;
+			}
+		else
+			{
+			TLex	lex(aStr);
+			ret=(lex.Val(aSpriteInCompare, EHex)==KErrNone);
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadStdScanCode(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TStdScanCode& aStdScanCode)
+	{
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KStdKeyNull )
+			{
+			aStdScanCode=EStdKeyNull;
+			}
+		else if ( str==KStdKeyBackspace )
+			{
+			aStdScanCode=EStdKeyBackspace;
+			}
+		else if ( str==KStdKeyTab )
+			{
+			aStdScanCode=EStdKeyTab;
+			}
+		else if ( str==KStdKeyEnter )
+			{
+			aStdScanCode=EStdKeyEnter;
+			}
+		else if ( str==KStdKeyEscape )
+			{
+			aStdScanCode=EStdKeyEscape;
+			}
+		else if ( str==KStdKeySpace )
+			{
+			aStdScanCode=EStdKeySpace;
+			}
+		else if ( str==KStdKeyPrintScreen )
+			{
+			aStdScanCode=EStdKeyPrintScreen;
+			}
+		else if ( str==KStdKeyPause )
+			{
+			aStdScanCode=EStdKeyPause;
+			}
+		else if ( str==KStdKeyHome )
+			{
+			aStdScanCode=EStdKeyHome;
+			}
+		else if ( str==KStdKeyEnd )
+			{
+			aStdScanCode=EStdKeyEnd;
+			}
+		else if ( str==KStdKeyPageUp )
+			{
+			aStdScanCode=EStdKeyPageUp;
+			}
+		else if ( str==KStdKeyPageDown )
+			{
+			aStdScanCode=EStdKeyPageDown;
+			}
+		else if ( str==KStdKeyInsert )
+			{
+			aStdScanCode=EStdKeyInsert;
+			}
+		else if ( str==KStdKeyDelete )
+			{
+			aStdScanCode=EStdKeyDelete;
+			}
+		else if ( str==KStdKeyLeftArrow )
+			{
+			aStdScanCode=EStdKeyLeftArrow;
+			}
+		else if ( str==KStdKeyRightArrow )
+			{
+			aStdScanCode=EStdKeyRightArrow;
+			}
+		else if ( str==KStdKeyUpArrow )
+			{
+			aStdScanCode=EStdKeyUpArrow;
+			}
+		else if ( str==KStdKeyDownArrow )
+			{
+			aStdScanCode=EStdKeyDownArrow;
+			}
+		else if ( str==KStdKeyLeftShift )
+			{
+			aStdScanCode=EStdKeyLeftShift;
+			}
+		else if ( str==KStdKeyRightShift )
+			{
+			aStdScanCode=EStdKeyRightShift;
+			}
+		else if ( str==KStdKeyLeftAlt )
+			{
+			aStdScanCode=EStdKeyLeftAlt;
+			}
+		else if ( str==KStdKeyRightAlt )
+			{
+			aStdScanCode=EStdKeyRightAlt;
+			}
+		else if ( str==KStdKeyLeftCtrl )
+			{
+			aStdScanCode=EStdKeyLeftCtrl;
+			}
+		else if ( str==KStdKeyRightCtrl )
+			{
+			aStdScanCode=EStdKeyRightCtrl;
+			}
+		else if ( str==KStdKeyLeftFunc )
+			{
+			aStdScanCode=EStdKeyLeftFunc;
+			}
+		else if ( str==KStdKeyRightFunc )
+			{
+			aStdScanCode=EStdKeyRightFunc;
+			}
+		else if ( str==KStdKeyCapsLock )
+			{
+			aStdScanCode=EStdKeyCapsLock;
+			}
+		else if ( str==KStdKeyNumLock )
+			{
+			aStdScanCode=EStdKeyNumLock;
+			}
+		else if ( str==KStdKeyScrollLock )
+			{
+			aStdScanCode=EStdKeyScrollLock;
+			}
+		else if ( str==KStdKeyF1 )
+			{
+			aStdScanCode=EStdKeyF1;
+			}
+		else if ( str==KStdKeyF2 )
+			{
+			aStdScanCode=EStdKeyF2;
+			}
+		else if ( str==KStdKeyF3 )
+			{
+			aStdScanCode=EStdKeyF3;
+			}
+		else if ( str==KStdKeyF4 )
+			{
+			aStdScanCode=EStdKeyF4;
+			}
+		else if ( str==KStdKeyF5 )
+			{
+			aStdScanCode=EStdKeyF5;
+			}
+		else if ( str==KStdKeyF6 )
+			{
+			aStdScanCode=EStdKeyF6;
+			}
+		else if ( str==KStdKeyF7 )
+			{
+			aStdScanCode=EStdKeyF7;
+			}
+		else if ( str==KStdKeyF8 )
+			{
+			aStdScanCode=EStdKeyF8;
+			}
+		else if ( str==KStdKeyF9 )
+			{
+			aStdScanCode=EStdKeyF9;
+			}
+		else if ( str==KStdKeyF10 )
+			{
+			aStdScanCode=EStdKeyF10;
+			}
+		else if ( str==KStdKeyF11 )
+			{
+			aStdScanCode=EStdKeyF11;
+			}
+		else if ( str==KStdKeyF12 )
+			{
+			aStdScanCode=EStdKeyF12;
+			}
+		else if ( str==KStdKeyF13 )
+			{
+			aStdScanCode=EStdKeyF13;
+			}
+		else if ( str==KStdKeyF14 )
+			{
+			aStdScanCode=EStdKeyF14;
+			}
+		else if ( str==KStdKeyF15 )
+			{
+			aStdScanCode=EStdKeyF15;
+			}
+		else if ( str==KStdKeyF16 )
+			{
+			aStdScanCode=EStdKeyF16;
+			}
+		else if ( str==KStdKeyF17 )
+			{
+			aStdScanCode=EStdKeyF17;
+			}
+		else if ( str==KStdKeyF18 )
+			{
+			aStdScanCode=EStdKeyF18;
+			}
+		else if ( str==KStdKeyF19 )
+			{
+			aStdScanCode=EStdKeyF19;
+			}
+		else if ( str==KStdKeyF20 )
+			{
+			aStdScanCode=EStdKeyF20;
+			}
+		else if ( str==KStdKeyF21 )
+			{
+			aStdScanCode=EStdKeyF21;
+			}
+		else if ( str==KStdKeyF22 )
+			{
+			aStdScanCode=EStdKeyF22;
+			}
+		else if ( str==KStdKeyF23 )
+			{
+			aStdScanCode=EStdKeyF23;
+			}
+		else if ( str==KStdKeyF24 )
+			{
+			aStdScanCode=EStdKeyF24;
+			}
+		else if ( str==KStdKeyXXX )
+			{
+			aStdScanCode=EStdKeyXXX;
+			}
+		else if ( str==KStdKeyComma )
+			{
+			aStdScanCode=EStdKeyComma;
+			}
+		else if ( str==KStdKeyFullStop )
+			{
+			aStdScanCode=EStdKeyFullStop;
+			}
+		else if ( str==KStdKeyForwardSlash )
+			{
+			aStdScanCode=EStdKeyForwardSlash;
+			}
+		else if ( str==KStdKeyBackSlash )
+			{
+			aStdScanCode=EStdKeyBackSlash;
+			}
+		else if ( str==KStdKeySemiColon )
+			{
+			aStdScanCode=EStdKeySemiColon;
+			}
+		else if ( str==KStdKeySingleQuote )
+			{
+			aStdScanCode=EStdKeySingleQuote;
+			}
+		else if ( str==KStdKeyHash )
+			{
+			aStdScanCode=EStdKeyHash;
+			}
+		else if ( str==KStdKeySquareBracketLeft )
+			{
+			aStdScanCode=EStdKeySquareBracketLeft;
+			}
+		else if ( str==KStdKeySquareBracketRight )
+			{
+			aStdScanCode=EStdKeySquareBracketRight;
+			}
+		else if ( str==KStdKeyMinus )
+			{
+			aStdScanCode=EStdKeyMinus;
+			}
+		else if ( str==KStdKeyEquals )
+			{
+			aStdScanCode=EStdKeyEquals;
+			}
+		else if ( str==KStdKeyNkpForwardSlash )
+			{
+			aStdScanCode=EStdKeyNkpForwardSlash;
+			}
+		else if ( str==KStdKeyNkpAsterisk )
+			{
+			aStdScanCode=EStdKeyNkpAsterisk;
+			}
+		else if ( str==KStdKeyNkpMinus )
+			{
+			aStdScanCode=EStdKeyNkpMinus;
+			}
+		else if ( str==KStdKeyNkpPlus )
+			{
+			aStdScanCode=EStdKeyNkpPlus;
+			}
+		else if ( str==KStdKeyNkpEnter )
+			{
+			aStdScanCode=EStdKeyNkpEnter;
+			}
+		else if ( str==KStdKeyNkp1 )
+			{
+			aStdScanCode=EStdKeyNkp1;
+			}
+		else if ( str==KStdKeyNkp2 )
+			{
+			aStdScanCode=EStdKeyNkp2;
+			}
+		else if ( str==KStdKeyNkp3 )
+			{
+			aStdScanCode=EStdKeyNkp3;
+			}
+		else if ( str==KStdKeyNkp4 )
+			{
+			aStdScanCode=EStdKeyNkp4;
+			}
+		else if ( str==KStdKeyNkp5 )
+			{
+			aStdScanCode=EStdKeyNkp5;
+			}
+		else if ( str==KStdKeyNkp6 )
+			{
+			aStdScanCode=EStdKeyNkp6;
+			}
+		else if ( str==KStdKeyNkp7 )
+			{
+			aStdScanCode=EStdKeyNkp7;
+			}
+		else if ( str==KStdKeyNkp8 )
+			{
+			aStdScanCode=EStdKeyNkp8;
+			}
+		else if ( str==KStdKeyNkp9 )
+			{
+			aStdScanCode=EStdKeyNkp9;
+			}
+		else if ( str==KStdKeyNkp0 )
+			{
+			aStdScanCode=EStdKeyNkp0;
+			}
+		else if ( str==KStdKeyNkpFullStop )
+			{
+			aStdScanCode=EStdKeyNkpFullStop;
+			}
+		else if ( str==KStdKeyMenu )
+			{
+			aStdScanCode=EStdKeyMenu;
+			}
+		else if ( str==KStdKeyBacklightOn )
+			{
+			aStdScanCode=EStdKeyBacklightOn;
+			}
+		else if ( str==KStdKeyBacklightOff )
+			{
+			aStdScanCode=EStdKeyBacklightOff;
+			}
+		else if ( str==KStdKeyBacklightToggle )
+			{
+			aStdScanCode=EStdKeyBacklightToggle;
+			}
+		else if ( str==KStdKeyIncContrast )
+			{
+			aStdScanCode=EStdKeyIncContrast;
+			}
+		else if ( str==KStdKeyDecContrast )
+			{
+			aStdScanCode=EStdKeyDecContrast;
+			}
+		else if ( str==KStdKeySliderDown )
+			{
+			aStdScanCode=EStdKeySliderDown;
+			}
+		else if ( str==KStdKeySliderUp )
+			{
+			aStdScanCode=EStdKeySliderUp;
+			}
+		else if ( str==KStdKeyDictaphonePlay )
+			{
+			aStdScanCode=EStdKeyDictaphonePlay;
+			}
+		else if ( str==KStdKeyDictaphoneStop )
+			{
+			aStdScanCode=EStdKeyDictaphoneStop;
+			}
+		else if ( str==KStdKeyDictaphoneRecord )
+			{
+			aStdScanCode=EStdKeyDictaphoneRecord;
+			}
+		else if ( str==KStdKeyHelp )
+			{
+			aStdScanCode=EStdKeyHelp;
+			}
+		else if ( str==KStdKeyOff )
+			{
+			aStdScanCode=EStdKeyOff;
+			}
+		else if ( str==KStdKeyDial )
+			{
+			aStdScanCode=EStdKeyDial;
+			}
+		else if ( str==KStdKeyIncVolume )
+			{
+			aStdScanCode=EStdKeyIncVolume;
+			}
+		else if ( str==KStdKeyDecVolume )
+			{
+			aStdScanCode=EStdKeyDecVolume;
+			}
+		else if ( str==KStdKeyDevice0 )
+			{
+			aStdScanCode=EStdKeyDevice0;
+			}
+		else if ( str==KStdKeyDevice1 )
+			{
+			aStdScanCode=EStdKeyDevice1;
+			}
+		else if ( str==KStdKeyDevice2 )
+			{
+			aStdScanCode=EStdKeyDevice2;
+			}
+		else if ( str==KStdKeyDevice3 )
+			{
+			aStdScanCode=EStdKeyDevice3;
+			}
+		else if ( str==KStdKeyDevice4 )
+			{
+			aStdScanCode=EStdKeyDevice4;
+			}
+		else if ( str==KStdKeyDevice5 )
+			{
+			aStdScanCode=EStdKeyDevice5;
+			}
+		else if ( str==KStdKeyDevice6 )
+			{
+			aStdScanCode=EStdKeyDevice6;
+			}
+		else if ( str==KStdKeyDevice7 )
+			{
+			aStdScanCode=EStdKeyDevice7;
+			}
+		else if ( str==KStdKeyDevice8 )
+			{
+			aStdScanCode=EStdKeyDevice8;
+			}
+		else if ( str==KStdKeyDevice9 )
+			{
+			aStdScanCode=EStdKeyDevice9;
+			}
+		else if ( str==KStdKeyDeviceA )
+			{
+			aStdScanCode=EStdKeyDeviceA;
+			}
+		else if ( str==KStdKeyDeviceB )
+			{
+			aStdScanCode=EStdKeyDeviceB;
+			}
+		else if ( str==KStdKeyDeviceC )
+			{
+			aStdScanCode=EStdKeyDeviceC;
+			}
+		else if ( str==KStdKeyDeviceD )
+			{
+			aStdScanCode=EStdKeyDeviceD;
+			}
+		else if ( str==KStdKeyDeviceE )
+			{
+			aStdScanCode=EStdKeyDeviceE;
+			}
+		else if ( str==KStdKeyDeviceF )
+			{
+			aStdScanCode=EStdKeyDeviceF;
+			}
+		else if ( str==KStdKeyApplication0 )
+			{
+			aStdScanCode=EStdKeyApplication0;
+			}
+		else if ( str==KStdKeyApplication1 )
+			{
+			aStdScanCode=EStdKeyApplication1;
+			}
+		else if ( str==KStdKeyApplication2 )
+			{
+			aStdScanCode=EStdKeyApplication2;
+			}
+		else if ( str==KStdKeyApplication3 )
+			{
+			aStdScanCode=EStdKeyApplication3;
+			}
+		else if ( str==KStdKeyApplication4 )
+			{
+			aStdScanCode=EStdKeyApplication4;
+			}
+		else if ( str==KStdKeyApplication5 )
+			{
+			aStdScanCode=EStdKeyApplication5;
+			}
+		else if ( str==KStdKeyApplication6 )
+			{
+			aStdScanCode=EStdKeyApplication6;
+			}
+		else if ( str==KStdKeyApplication7 )
+			{
+			aStdScanCode=EStdKeyApplication7;
+			}
+		else if ( str==KStdKeyApplication8 )
+			{
+			aStdScanCode=EStdKeyApplication8;
+			}
+		else if ( str==KStdKeyApplication9 )
+			{
+			aStdScanCode=EStdKeyApplication9;
+			}
+		else if ( str==KStdKeyApplicationA )
+			{
+			aStdScanCode=EStdKeyApplicationA;
+			}
+		else if ( str==KStdKeyApplicationB )
+			{
+			aStdScanCode=EStdKeyApplicationB;
+			}
+		else if ( str==KStdKeyApplicationC )
+			{
+			aStdScanCode=EStdKeyApplicationC;
+			}
+		else if ( str==KStdKeyApplicationD )
+			{
+			aStdScanCode=EStdKeyApplicationD;
+			}
+		else if ( str==KStdKeyApplicationE )
+			{
+			aStdScanCode=EStdKeyApplicationE;
+			}
+		else if ( str==KStdKeyApplicationF )
+			{
+			aStdScanCode=EStdKeyApplicationF;
+			}
+		else if ( str==KStdKeyYes )
+			{
+			aStdScanCode=EStdKeyYes;
+			}
+		else if ( str==KStdKeyNo )
+			{
+			aStdScanCode=EStdKeyNo;
+			}
+		else if ( str==KStdKeyIncBrightness )
+			{
+			aStdScanCode=EStdKeyIncBrightness;
+			}
+		else if ( str==KStdKeyDecBrightness )
+			{
+			aStdScanCode=EStdKeyDecBrightness;
+			}
+		else if ( str==KStdKeyKeyboardExtend )
+			{
+			aStdScanCode=EStdKeyKeyboardExtend;
+			}
+		else if ( str==KStdKeyDevice10 )
+			{
+			aStdScanCode=EStdKeyDevice10;
+			}
+		else if ( str==KStdKeyDevice11 )
+			{
+			aStdScanCode=EStdKeyDevice11;
+			}
+		else if ( str==KStdKeyDevice12 )
+			{
+			aStdScanCode=EStdKeyDevice12;
+			}
+		else if ( str==KStdKeyDevice13 )
+			{
+			aStdScanCode=EStdKeyDevice13;
+			}
+		else if ( str==KStdKeyDevice14 )
+			{
+			aStdScanCode=EStdKeyDevice14;
+			}
+		else if ( str==KStdKeyDevice15 )
+			{
+			aStdScanCode=EStdKeyDevice15;
+			}
+		else if ( str==KStdKeyDevice16 )
+			{
+			aStdScanCode=EStdKeyDevice16;
+			}
+		else if ( str==KStdKeyDevice17 )
+			{
+			aStdScanCode=EStdKeyDevice17;
+			}
+		else if ( str==KStdKeyDevice18 )
+			{
+			aStdScanCode=EStdKeyDevice18;
+			}
+		else if ( str==KStdKeyDevice19 )
+			{
+			aStdScanCode=EStdKeyDevice19;
+			}
+		else if ( str==KStdKeyDevice1A )
+			{
+			aStdScanCode=EStdKeyDevice1A;
+			}
+		else if ( str==KStdKeyDevice1B )
+			{
+			aStdScanCode=EStdKeyDevice1B;
+			}
+		else if ( str==KStdKeyDevice1C )
+			{
+			aStdScanCode=EStdKeyDevice1C;
+			}
+		else if ( str==KStdKeyDevice1D )
+			{
+			aStdScanCode=EStdKeyDevice1D;
+			}
+		else if ( str==KStdKeyDevice1E )
+			{
+			aStdScanCode=EStdKeyDevice1E;
+			}
+		else if ( str==KStdKeyDevice1F )
+			{
+			aStdScanCode=EStdKeyDevice1F;
+			}
+		else if ( str==KStdKeyApplication10 )
+			{
+			aStdScanCode=EStdKeyApplication10;
+			}
+		else if ( str==KStdKeyApplication11 )
+			{
+			aStdScanCode=EStdKeyApplication11;
+			}
+		else if ( str==KStdKeyApplication12 )
+			{
+			aStdScanCode=EStdKeyApplication12;
+			}
+		else if ( str==KStdKeyApplication13 )
+			{
+			aStdScanCode=EStdKeyApplication13;
+			}
+		else if ( str==KStdKeyApplication14 )
+			{
+			aStdScanCode=EStdKeyApplication14;
+			}
+		else if ( str==KStdKeyApplication15 )
+			{
+			aStdScanCode=EStdKeyApplication15;
+			}
+		else if ( str==KStdKeyApplication16 )
+			{
+			aStdScanCode=EStdKeyApplication16;
+			}
+		else if ( str==KStdKeyApplication17 )
+			{
+			aStdScanCode=EStdKeyApplication17;
+			}
+		else if ( str==KStdKeyApplication18 )
+			{
+			aStdScanCode=EStdKeyApplication18;
+			}
+		else if ( str==KStdKeyApplication19 )
+			{
+			aStdScanCode=EStdKeyApplication19;
+			}
+		else if ( str==KStdKeyApplication1A )
+			{
+			aStdScanCode=EStdKeyApplication1A;
+			}
+		else if ( str==KStdKeyApplication1B )
+			{
+			aStdScanCode=EStdKeyApplication1B;
+			}
+		else if ( str==KStdKeyApplication1C )
+			{
+			aStdScanCode=EStdKeyApplication1C;
+			}
+		else if ( str==KStdKeyApplication1D )
+			{
+			aStdScanCode=EStdKeyApplication1D;
+			}
+		else if ( str==KStdKeyApplication1E )
+			{
+			aStdScanCode=EStdKeyApplication1E;
+			}
+		else if ( str==KStdKeyApplication1F )
+			{
+			aStdScanCode=EStdKeyApplication1F;
+			}
+		else
+			{
+    	    TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aStdScanCode=(TStdScanCode)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadTextAlign(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CGraphicsContext::TTextAlign& aTextAlign)
+	{
+	// Read displaymode from INI file
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KTextAlignLeft )
+			{
+			aTextAlign=CGraphicsContext::ELeft;
+			}
+		else if ( str==KTextAlignCenter )
+			{
+			aTextAlign=CGraphicsContext::ECenter;
+			}
+		else if ( str==KTextAlignRight )
+			{
+			aTextAlign=CGraphicsContext::ERight;
+			}
+		else
+			{
+    	    TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aTextAlign=(CGraphicsContext::TTextAlign)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadTextDirection(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CFont::TTextDirection& aTextDirection)
+	{
+	// Read displaymode from INI file
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KTextDirectionHorizontal )
+			{
+			aTextDirection=CFont::EHorizontal;
+			}
+		else if ( str==KTextDirectionVertical )
+			{
+			aTextDirection=CFont::EVertical;
+			}
+		else
+			{
+    	    TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aTextDirection=(CFont::TTextDirection)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadType(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TPointerEvent::TType& aType)
+	{
+	// Read displaymode from INI file
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KTypeButton1Down )
+			{
+			aType=TPointerEvent::EButton1Down;
+			}
+		else if ( str==KTypeButton1Up )
+			{
+			aType=TPointerEvent::EButton1Up;
+			}
+		else if ( str==KTypeButton2Down )
+			{
+			aType=TPointerEvent::EButton2Down;
+			}
+		else if ( str==KTypeButton2Up )
+			{
+			aType=TPointerEvent::EButton2Up;
+			}
+		else if ( str==KTypeButton3Down )
+			{
+			aType=TPointerEvent::EButton3Down;
+			}
+		else if ( str==KTypeButton3Up )
+			{
+			aType=TPointerEvent::EButton3Up;
+			}
+		else if ( str==KTypeDrag )
+			{
+			aType=TPointerEvent::EDrag;
+			}
+		else if ( str==KTypeMove )
+			{
+			aType=TPointerEvent::EMove;
+			}
+		else if ( str==KTypeButtonRepeat )
+			{
+			aType=TPointerEvent::EButtonRepeat;
+			}
+		else if ( str==KTypeSwitchOn )
+			{
+			aType=TPointerEvent::ESwitchOn;
+			}
+		else
+			{
+    	    TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aType=(TPointerEvent::TType)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadType(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TRawEvent::TType& aType)
+	{
+	// Read displaymode from INI file
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KTypeNone )
+			{
+			aType=TRawEvent::ENone;
+			}
+		else if ( str==KTypePointerMove )
+			{
+			aType=TRawEvent::EPointerMove;
+			}
+		else if ( str==KTypePointerSwitchOn )
+			{
+			aType=TRawEvent::EPointerSwitchOn;
+			}
+		else if ( str==KTypeKeyDown )
+			{
+			aType=TRawEvent::EKeyDown;
+			}
+		else if ( str==KTypeKeyUp )
+			{
+			aType=TRawEvent::EKeyUp;
+			}
+		else if ( str==KTypeRedraw )
+			{
+			aType=TRawEvent::ERedraw;
+			}
+		else if ( str==KTypeSwitchOn )
+			{
+			aType=TRawEvent::ESwitchOn;
+			}
+		else if ( str==KTypeActive )
+			{
+			aType=TRawEvent::EActive;
+			}
+		else if ( str==KTypeInactive )
+			{
+			aType=TRawEvent::EInactive;
+			}
+		else if ( str==KTypeUpdateModifiers )
+			{
+			aType=TRawEvent::EUpdateModifiers;
+			}
+		else if ( str==KTypeButton1Down )
+			{
+			aType=TRawEvent::EButton1Down;
+			}
+		else if ( str==KTypeButton1Up )
+			{
+			aType=TRawEvent::EButton1Up;
+			}
+		else if ( str==KTypeButton2Down )
+			{
+			aType=TRawEvent::EButton2Down;
+			}
+		else if ( str==KTypeButton2Up )
+			{
+			aType=TRawEvent::EButton2Up;
+			}
+		else if ( str==KTypeButton3Down )
+			{
+			aType=TRawEvent::EButton3Down;
+			}
+		else if ( str==KTypeButton3Up )
+			{
+			aType=TRawEvent::EButton3Up;
+			}
+		else if ( str==KTypeSwitchOff )
+			{
+			aType=TRawEvent::ESwitchOff;
+			}
+		else if ( str==KTypeKeyRepeat )
+			{
+			aType=TRawEvent::EKeyRepeat;
+			}
+		else if ( str==KTypeCaseOpen )
+			{
+			aType=TRawEvent::ECaseOpen;
+			}
+		else if ( str==KTypeCaseClose )
+			{
+			aType=TRawEvent::ECaseClose;
+			}
+		else if ( str==KTypePointer3DInRange )
+			{
+			aType=TRawEvent::EPointer3DInRange;
+			}
+		else if ( str==KTypePointer3DOutOfRange )
+			{
+			aType=TRawEvent::EPointer3DOutOfRange;
+			}
+		else if ( str==KTypePointer3DTilt )
+			{
+			aType=TRawEvent::EPointer3DTilt;
+			}
+		else if ( str==KTypePointer3DRotation )
+			{
+			aType=TRawEvent::EPointer3DRotation;
+			}
+		else if ( str==KTypePointer3DTiltAndMove )
+			{
+			aType=TRawEvent::EPointer3DTiltAndMove;
+			}
+		else if ( str==KTypeButton4Down )
+			{
+			aType=TRawEvent::EButton4Down;
+			}
+		else if ( str==KTypeButton4Up )
+			{
+			aType=TRawEvent::EButton4Up;
+			}
+		else if ( str==KTypeButton5Down )
+			{
+			aType=TRawEvent::EButton5Down;
+			}
+		else if ( str==KTypeButton5Up )
+			{
+			aType=TRawEvent::EButton5Up;
+			}
+		else if ( str==KTypeButton6Down )
+			{
+			aType=TRawEvent::EButton6Down;
+			}
+		else if ( str==KTypeButton6Up )
+			{
+			aType=TRawEvent::EButton6Up;
+			}
+		else if ( str==KTypeRestartSystem )
+			{
+			aType=TRawEvent::ERestartSystem;
+			}
+		else
+			{
+    	    TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aType=(TRawEvent::TType)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadTerminateReason(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, RDirectScreenAccess::TTerminationReasons& aReason)
+	{
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if(str == KETerminateCancel)
+			{
+			aReason = RDirectScreenAccess::ETerminateCancel;
+			}
+		else if(str == KETerminateRegion)
+			{
+			aReason = RDirectScreenAccess::ETerminateRegion;
+			}
+		else if(str == KETerminateRotation)
+			{
+			aReason = RDirectScreenAccess::ETerminateRotation;
+			}
+		else if(str == KETerminateScreenMode)
+			{
+			aReason = RDirectScreenAccess::ETerminateScreenMode;
+			}
+		else
+			{
+			ret = EFalse;
+			}
+		}
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadWindowBackupType(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TUint& aWindowBackupType)
+	{
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		TUint	temp=0;
+		ret=ConvertToWindowBackupType(str, temp);
+		if ( ret )
+			{
+			aWindowBackupType=temp;
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ConvertToWindowBackupType(const TDesC& aStr, TWindowBackupType& aWindowBackupType)
+	{
+	TBool	ret=ETrue;
+	if ( aStr==KWindowBackupTypeAreaBehind )
+		{
+		aWindowBackupType=EWindowBackupAreaBehind;
+		}
+	else if ( aStr==KWindowBackupTypeFullScreen )
+		{
+		aWindowBackupType=EWindowBackupFullScreen;
+		}
+	else
+		{
+		TUint	windowBackupType;
+		TLex	lex(aStr);
+		ret=(lex.Val(windowBackupType, EHex)==KErrNone);
+		if ( ret )
+			{
+			aWindowBackupType=(TWindowBackupType)windowBackupType;
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ConvertToWindowBackupType(const TDesC& aStr, TUint& aWindowBackupType)
+	{
+	TBool	ret=ETrue;
+	TInt	location=aStr.Match(_L("*|*"));
+	if( location!=KErrNotFound )
+		{
+		// Converting Left part of the data
+		TPtrC	tempStr=aStr.Left(location);
+		ret=ConvertToWindowBackupType(tempStr, aWindowBackupType);
+
+		// Converting right data can be with another "|"
+		tempStr.Set(aStr.Mid(location+1));
+
+		TUint	temp;
+		if ( ConvertToWindowBackupType(tempStr, temp) )
+			{
+			aWindowBackupType|=temp;
+			}
+		else
+			{
+			ret=EFalse;
+			}
+		}
+	else
+		{
+		TWindowBackupType	windowBackupType;
+		ret=ConvertToWindowBackupType(aStr, windowBackupType);
+		if ( ret )
+			{
+			aWindowBackupType=(TUint)windowBackupType;
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadWsTransparencyPolicy(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TWsTransparencyPolicy& aWsTransparencyPolicy)
+	{
+	// Read displaymode from INI file
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KWsTransparencyPolicyDefault )
+			{
+			aWsTransparencyPolicy=ETransparencyDefault;
+			}
+		else if ( str==KWsTransparencyPolicyFreezeUnder )
+			{
+			aWsTransparencyPolicy=ETransparencyFreezeUnder;
+			}
+		else
+			{
+    	    TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aWsTransparencyPolicy=(TWsTransparencyPolicy)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadWsVisibilityChangedEvent(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TWsVisibilityChangedEvent& aWsVisibilityChangedEvent)
+	{
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		ret=ConvertToWsVisibilityChangedEvent(str, aWsVisibilityChangedEvent.iFlags);
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ConvertToWsVisibilityChangedEvent(const TDesC& aStr, TUint& aWsVisibilityChangedEvent)
+	{
+	TBool	ret=ETrue;
+	TInt	location=aStr.Match(_L("*|*"));
+	if( location!=KErrNotFound )
+		{
+		// Converting Left part of the data
+		TPtrC	tempStr=aStr.Left(location);
+		ret=ConvertToWsVisibilityChangedEvent(tempStr, aWsVisibilityChangedEvent);
+
+		// Converting right data can be with another "|"
+		tempStr.Set(aStr.Mid(location+1));
+
+		TUint	temp;
+		if ( ConvertToWsVisibilityChangedEvent(tempStr, temp) )
+			{
+			aWsVisibilityChangedEvent|=temp;
+			}
+		else
+			{
+			ret=EFalse;
+			}
+		}
+	else
+		{
+		if ( aStr==KWsVisibilityChangedCanBeSeen )
+			{
+			aWsVisibilityChangedEvent=TWsVisibilityChangedEvent::ECanBeSeen;
+			}
+		else if ( aStr==KWsVisibilityChangedCantBeSeen )
+			{
+			aWsVisibilityChangedEvent=TWsVisibilityChangedEvent::ECantBeSeen;
+			}
+		else if ( aStr==KWsVisibilityChangedPartiallyVisible )
+			{
+			aWsVisibilityChangedEvent=TWsVisibilityChangedEvent::EPartiallyVisible;
+			}
+		else if ( aStr==KWsVisibilityChangedNotVisible )
+			{
+			aWsVisibilityChangedEvent=TWsVisibilityChangedEvent::ENotVisible;
+			}
+		else if ( aStr==KWsVisibilityChangedFullyVisible )
+			{
+			aWsVisibilityChangedEvent=TWsVisibilityChangedEvent::EFullyVisible;
+			}
+		else
+			{
+			TLex	lex(aStr);
+			ret=(lex.Val(aWsVisibilityChangedEvent, EHex)==KErrNone);
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadLongCaptureFlags(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TLongCaptureFlags& aLongCaptureFlags)
+	{
+	TPtrC	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KELongCaptureShortEventImmediately )
+			{
+			aLongCaptureFlags = ELongCaptureShortEventImmediately;
+			}
+		else if ( str==KELongCaptureRepeatEvents )
+			{
+			aLongCaptureFlags = ELongCaptureRepeatEvents;
+			}
+		else if ( str==KELongCaptureNormal )
+			{
+			aLongCaptureFlags = ELongCaptureNormal;
+			}
+		else if ( str==KELongCaptureWaitShort )
+			{
+			aLongCaptureFlags = ELongCaptureWaitShort;
+			}
+		else
+			{
+    	    TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aLongCaptureFlags=(TLongCaptureFlags)intVal;
+				}
+			}
+		}
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadSpriteFlags(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TSpriteFlags& aSpriteFlags)
+	{
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		ret=ConvertToSpriteFlags(str, aSpriteFlags);
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadSpriteFlags(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TUint& aSpriteFlags)
+    {
+    TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		ret=ConvertToSpriteFlags(str, aSpriteFlags);
+		}
+
+	return ret;
+    }
+
+TBool CT_GraphicsUtil::ConvertToSpriteFlags(const TDesC& aStr, TSpriteFlags& aSpriteFlags)
+	{
+	TBool	ret=ETrue;
+	if ( aStr==KESpriteFlash )
+		{
+		aSpriteFlags=ESpriteFlash;
+		}
+	else if ( aStr==KESpriteNoChildClip )
+		{
+		aSpriteFlags=ESpriteNoChildClip;
+		}
+	else if ( aStr==KESpriteNoShadows )
+		{
+		aSpriteFlags=ESpriteNoShadows;
+		}
+	else
+		{
+		TUint	spriteFlag;
+		TLex	lex(aStr);
+		ret=(lex.Val(spriteFlag, EHex)==KErrNone);
+		if ( ret )
+			{
+			aSpriteFlags=(TSpriteFlags)spriteFlag;
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ConvertToSpriteFlags(const TDesC& aStr, TUint& aSpriteFlags)
+	{
+	TBool	ret=ETrue;
+	TInt	location=aStr.Match(_L("*|*"));
+	if( location!=KErrNotFound )
+		{
+		// Converting Left part of the data
+		TPtrC	tempStr=aStr.Left(location);
+		ret=ConvertToSpriteFlags(tempStr, aSpriteFlags);
+
+		// Converting right data can be with another "|"
+		tempStr.Set(aStr.Mid(location+1));
+
+		TUint	temp;
+		if ( ConvertToSpriteFlags(tempStr, temp) )
+			{
+			aSpriteFlags|=temp;
+			}
+		else
+			{
+			ret=EFalse;
+			}
+		}
+	else
+		{
+		TSpriteFlags	spriteFlag;
+		ret=ConvertToSpriteFlags(aStr, spriteFlag);
+		if ( ret )
+			{
+			aSpriteFlags=(TUint)spriteFlag;
+			}
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadCustomTextCursorAlignment(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, RWsSession::TCustomTextCursorAlignment& aAlignment)
+	{
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KECustomTextCursorAlignTop )
+			{
+			aAlignment=RWsSession::ECustomTextCursorAlignTop;
+			}
+		else if ( str==KECustomTextCursorAlignBaseline )
+			{
+			aAlignment=RWsSession::ECustomTextCursorAlignBaseline;
+			}
+		else if ( str==KECustomTextCursorAlignBottom )
+			{
+			aAlignment=RWsSession::ECustomTextCursorAlignBottom;
+			}
+		else
+			{
+    	    TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, intVal);
+			if ( ret )
+				{
+	        	aAlignment=(RWsSession::TCustomTextCursorAlignment)intVal;
+				}
+			}
+		}
+
+	return ret;
+	}
+
+/**
+ * Utility method that fetches TAlgStyle pointer by command parameter name from INI-file.
+ */
+TBool CT_GraphicsUtil::GetAlgStyleL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TAlgStyle*& aData)
+	{
+	// get AlgStyleData object from parameters
+	TPtrC	name;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, name);
+	if ( ret )
+		{
+		// Data object found
+		aData=static_cast<TAlgStyle*>(aDataWrapper.GetDataObjectL(name));
+		}
+
+	return ret;
+	}
+
+/**
+ * Utility method that fetches RDrawableWindow pointer by command parameter name from INI-file.
+ */
+TBool CT_GraphicsUtil::GetDrawableWindowL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, RDrawableWindow*& aData)
+	{
+	// get CFbsBitmap data object from parameters
+	TPtrC	name;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, name);
+	if ( ret )
+		{
+		// Data object found
+		aData=static_cast<RDrawableWindow*>(aDataWrapper.GetDataObjectL(name));
+		}
+
+	return ret;
+	}
+
+/**
+ * Utility method that fetches CGraphicsContext::TDrawTextExtendedParam pointer by command parameter name from INI-file.
+ */
+TBool CT_GraphicsUtil::GetDrawTextExtendedParamL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CGraphicsContext::TDrawTextExtendedParam*& aData)
+	{
+	// get CFbsBitmap data object from parameters
+	TPtrC	name;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, name);
+	if ( ret )
+		{
+		// Data object found
+		aData=static_cast<CGraphicsContext::TDrawTextExtendedParam*>(aDataWrapper.GetDataObjectL(name));
+		}
+
+	return ret;
+	}
+
+/**
+ * Utility method that fetches CFbsBitmap pointer by command parameter name from INI-file.
+ */
+TBool CT_GraphicsUtil::GetFbsBitmapL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CFbsBitmap*& aData)
+	{
+	// get CFbsBitmap data object from parameters
+	TPtrC	name;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, name);
+	if ( ret )
+		{
+		// Data object found
+		aData=static_cast<CFbsBitmap*>(aDataWrapper.GetDataObjectL(name));
+		}
+
+	return ret;
+	}
+
+/**
+ * Utility method that fetches CFbsDevice pointer by command parameter name from INI-file.
+ */
+TBool CT_GraphicsUtil::GetFbsDeviceL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CFbsDevice*& aData)
+	{
+	// get CFbsBitmap data object from parameters
+	TPtrC	name;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, name);
+	if ( ret )
+		{
+		// Data object found
+		aData=static_cast<CFbsDevice*>(aDataWrapper.GetDataObjectL(name));
+		}
+
+	return ret;
+	}
+
+/**
+ * Utility method that fetches CFont pointer by command parameter name from INI-file.
+ */
+TBool CT_GraphicsUtil::GetFontL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CFont*& aData)
+	{
+	// get CFbsBitmap data object from parameters
+	TPtrC	name;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, name);
+	if ( ret )
+		{
+		// Data object found
+		aData=static_cast<CFont*>(aDataWrapper.GetDataObjectL(name));
+		}
+
+	return ret;
+	}
+
+/**
+ * Utility method that fetches CPalette pointer by command parameter name from INI-file.
+ */
+TBool CT_GraphicsUtil::GetPaletteL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CPalette*& aData)
+	{
+	// get PaletteData object from parameters
+	TPtrC	name;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, name);
+	if ( ret )
+		{
+		// Data object found
+		aData=static_cast<CPalette*>(aDataWrapper.GetDataObjectL(name));
+		}
+
+	return ret;
+	}
+
+/**
+ * Utility method that fetches CWsBitmap pointer by command parameter name from INI-file.
+ */
+TBool CT_GraphicsUtil::GetWsBitmapL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CWsBitmap*& aData)
+	{
+	// get CWsBitmap data object from parameters
+	TPtrC	name;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, name);
+	if ( ret )
+		{
+		// Data object found
+		aData=static_cast<CWsBitmap*>(aDataWrapper.GetDataObjectL(name));
+		}
+
+	return ret;
+	}
+
+/**
+ * Utility method that fetches TWsEvent pointer by command parameter name from INI-file.
+ */
+TBool CT_GraphicsUtil::GetWsEventL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TWsEvent*& aData)
+	{
+	// get CWsBitmap data object from parameters
+	TPtrC	name;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, name);
+	if ( ret )
+		{
+		// Data object found
+		aData=static_cast<TWsEvent*>(aDataWrapper.GetDataObjectL(name));
+		}
+
+	return ret;
+	}
+
+/**
+ * Utility method that fetches RWsGraphicMsgBuf pointer by command parameter name from INI-file.
+ */
+TBool CT_GraphicsUtil::GetWsGraphicMsgBufL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, RWsGraphicMsgBuf*& aData)
+	{
+	// get CWsBitmap data object from parameters
+	TPtrC	name;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, name);
+	if ( ret )
+		{
+		// Data object found
+		aData=static_cast<RWsGraphicMsgBuf*>(aDataWrapper.GetDataObjectL(name));
+		}
+
+	return ret;
+	}
+
+/**
+ * Utility method that fetches CWsScreenDevice pointer by command parameter name from INI-file.
+ */
+TBool CT_GraphicsUtil::GetWsScreenDeviceL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CWsScreenDevice*& aData)
+	{
+	// get CWsBitmap data object from parameters
+	TPtrC	name;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, name);
+	if ( ret )
+		{
+		// Data object found
+		aData=static_cast<CWsScreenDevice*>(aDataWrapper.GetDataObjectL(name));
+		}
+
+	return ret;
+	}
+
+/**
+ * Utility method that fetches TWsGraphicMsgFixedBase pointer by command parameter name from INI-file.
+ */
+TBool CT_GraphicsUtil::GetWsGraphicMsgFixedBaseL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TWsGraphicMsgFixedBase*& aData)
+	{
+	// get CWsBitmap data object from parameters
+	TPtrC	name;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, name);
+	if ( ret )
+		{
+		// Data object found
+		aData=static_cast<TWsGraphicMsgFixedBase*>(aDataWrapper.GetDataObjectL(name));
+		}
+
+	return ret;
+	}
+
+/**
+ * Utility method that fetches TWsPriorityKeyEvent pointer by command parameter name from INI-file.
+ */
+TBool CT_GraphicsUtil::GetWsPriorityKeyEventL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TWsPriorityKeyEvent*& aData)
+	{
+	// get CWsBitmap data object from parameters
+	TPtrC	name;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, name);
+	if ( ret )
+		{
+		// Data object found
+		aData=static_cast<TWsPriorityKeyEvent*>(aDataWrapper.GetDataObjectL(name));
+		}
+
+	return ret;
+	}
+
+/**
+ * Utility method that fetches TWsRedrawEvent pointer by command parameter name from INI-file.
+ */
+TBool CT_GraphicsUtil::GetWsRedrawEventL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TWsRedrawEvent*& aData)
+	{
+	// get CWsBitmap data object from parameters
+	TPtrC	name;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, name);
+	if ( ret )
+		{
+		// Data object found
+		aData=static_cast<TWsRedrawEvent*>(aDataWrapper.GetDataObjectL(name));
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::GetTextCursor(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TTextCursor& aTextCursor)
+	{
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+	TPtrC	str;
+
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagTextCursorType);
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, tempStore, str);
+	if ( ret )
+		{
+		if ( str==KETypeRectangle )
+			{
+			aTextCursor.iType = TTextCursor::ETypeRectangle;
+			}
+		else if ( str==KETypeHollowRectangle )
+			{
+			aTextCursor.iType = TTextCursor::ETypeHollowRectangle;
+			}
+		else if ( str==KETypeFirst )
+			{
+			aTextCursor.iType = TTextCursor::ETypeFirst;
+			}
+		else if ( str==KETypeLast )
+			{
+			aTextCursor.iType = TTextCursor::ETypeLast;
+			}
+		else if ( str==KETypeLastBasic )
+			{
+			aTextCursor.iType = TTextCursor::ETypeLastBasic;
+			}
+		else
+			{
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, tempStore, aTextCursor.iType);
+			}
+		}
+
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagTextCursorFlags);
+	if ( aDataWrapper.GetStringFromConfig(aSectName, tempStore, str) )
+		{
+		if ( str==KEFlagNoFlash )
+			{
+			aTextCursor.iFlags = TTextCursor::EFlagNoFlash;
+			}
+		else if ( str==KEFlagClipHorizontal )
+			{
+			aTextCursor.iFlags = TTextCursor::EFlagClipHorizontal;
+			}
+		else if ( str==KEFlagClipVertical )
+			{
+			aTextCursor.iFlags = TTextCursor::EFlagClipVertical;
+			}
+		else
+			{
+    	    TInt	intVal=0;
+        	ret=aDataWrapper.GetIntFromConfig(aSectName, tempStore, intVal);
+			if ( ret )
+				{
+	        	aTextCursor.iFlags = (TUint)intVal;
+				}
+			}
+		}
+
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagTextCursorHeight);
+	aDataWrapper.GetIntFromConfig(aSectName, tempStore, aTextCursor.iHeight);
+
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagTextCursorAscent);
+	aDataWrapper.GetIntFromConfig(aSectName, tempStore, aTextCursor.iAscent);
+
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagTextCursorWidth);
+	aDataWrapper.GetIntFromConfig(aSectName, tempStore, aTextCursor.iWidth);
+
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagTextCursorColor);
+	aDataWrapper.GetRgbFromConfig(aSectName, tempStore, aTextCursor.iColor);
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::GetSpriteMemberL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TSpriteMember& aSpriteMember)
+	{
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+	TBool	ret=ETrue;
+
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagSpriteMemberBitmap);
+	if ( !CT_GraphicsUtil::GetFbsBitmapL(aDataWrapper, aSectName, tempStore, aSpriteMember.iBitmap) )
+		{
+		ret=EFalse;
+		}
+
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagSpriteMemberMaskBitmap);
+	if ( !CT_GraphicsUtil::GetFbsBitmapL(aDataWrapper, aSectName, tempStore, aSpriteMember.iMaskBitmap) )
+		{
+		aSpriteMember.iMaskBitmap=NULL;
+		}
+
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagSpriteMemberInvertMask);
+	if ( !aDataWrapper.GetBoolFromConfig(aSectName, tempStore, aSpriteMember.iInvertMask) )
+		{
+		aSpriteMember.iInvertMask=EFalse;
+		}
+
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagSpriteMemberDrawMode);
+	if ( !CT_GraphicsUtil::ReadDrawMode(aDataWrapper, aSectName, tempStore, aSpriteMember.iDrawMode) )
+		{
+		ret=EFalse;
+		}
+
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagSpriteMemberOffset);
+	if ( !aDataWrapper.GetPointFromConfig(aSectName, tempStore, aSpriteMember.iOffset) )
+		{
+		ret=EFalse;
+		}
+
+	TInt	interval;
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagSpriteMemberInterval);
+	if ( aDataWrapper.GetIntFromConfig(aSectName, tempStore, interval) )
+		{
+		aSpriteMember.iInterval=interval;
+		}
+	return ret;
+	}
+
+
+TBool CT_GraphicsUtil::GetSpriteMemberListL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CArrayFix<TSpriteMember>& aResult)
+	{
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+	TSpriteMember						spriteMember;
+
+	aResult.Reset();
+	TBool	ok=ETrue;
+	for ( TInt index=0; ok; )
+		{
+		tempStore.Format(KFormatFieldNumber, &aKeyName, ++index);
+		ok=CT_GraphicsUtil::GetSpriteMemberL(aDataWrapper, aSectName, tempStore, spriteMember);
+		if ( ok )
+			{
+			aResult.AppendL(spriteMember);
+			}
+		}
+
+	return aResult.Count()>0;
+	}
+
+TBool CT_GraphicsUtil::ReadTypefaceSupport(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TTypefaceSupport& aTypefaceSupport)
+	{
+	TTypefaceSupport typefaceSupport;
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+	TPtrC str;
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTypefaceFontName);
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, tempStore, str);
+	if(ret)
+		{
+		typefaceSupport.iTypeface.iName = str;
+
+
+		TBool attri = EFalse;
+		tempStore.Format(KFormatEntryField, &aKeyName, &KProportional);
+		if(aDataWrapper.GetBoolFromConfig(aSectName, tempStore, attri))
+			{
+			typefaceSupport.iTypeface.SetIsProportional(attri);
+			}
+		tempStore.Format(KFormatEntryField, &aKeyName, &KSerif);
+		if(aDataWrapper.GetBoolFromConfig(aSectName, tempStore, attri))
+			{
+			typefaceSupport.iTypeface.SetIsSerif(attri);
+			}
+		tempStore.Format(KFormatEntryField, &aKeyName, &KSymbol);
+		if(aDataWrapper.GetBoolFromConfig(aSectName, tempStore, attri))
+			{
+			typefaceSupport.iTypeface.SetIsSymbol(attri);
+			}
+		
+		tempStore.Format(KFormatEntryField, &aKeyName, &KNumHeights);
+		aDataWrapper.GetIntFromConfig(aSectName, tempStore, typefaceSupport.iNumHeights);
+
+		tempStore.Format(KFormatEntryField, &aKeyName, &KIsScalable);
+		aDataWrapper.GetBoolFromConfig(aSectName, tempStore, typefaceSupport.iIsScalable);
+	
+		tempStore.Format(KFormatEntryField, &aKeyName, &KMaxHeightInTwips);
+		aDataWrapper.GetIntFromConfig(aSectName, tempStore, typefaceSupport.iMaxHeightInTwips);
+		
+		tempStore.Format(KFormatEntryField, &aKeyName, &KMinHeightInTwips);
+		aDataWrapper.GetIntFromConfig(aSectName, tempStore, typefaceSupport.iMinHeightInTwips);
+
+		aTypefaceSupport = typefaceSupport;
+		}
+	return ret;
+	}
+	
+TBool CT_GraphicsUtil::BringAppForegroundL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aSessionKeyName , const TDesC& aAppKeyName)
+	{
+	TBool result = ETrue;
+	RWsSession* iClient( NULL ); //Window Session Client
+	TPtrC objectName;
+	
+	if ( aDataWrapper.GetStringFromConfig(aSectName, aSessionKeyName, objectName) )
+		{
+		iClient = static_cast<RWsSession*>(aDataWrapper.GetDataObjectL(objectName));
+		}
+	else
+		{
+		result = EFalse;
+		}
+	
+	if( !aDataWrapper.GetStringFromConfig(aSectName, aAppKeyName, objectName))
+		{
+		result = EFalse;
+		}
+	
+	if( result )
+		{
+		TApaTaskList tasklist(*iClient);
+		TApaTask task(tasklist.FindApp(objectName));
+		task.BringToForeground();	
+		}
+	return result;
+	}
+
+void CT_GraphicsUtil::EatupMemory(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName)
+    {
+    // read left size in memory from INI
+    TInt	leftsize=0;
+	TBool	ret=aDataWrapper.GetIntFromConfig(aSectName, aKeyName, leftsize);
+	if ( !ret || leftsize==0)
+		return;
+	
+	// eat memory until fail to avaiable memory is less than is left size  
+    TInt nTotalSize=User::Heap().Size();
+    TAny* mem=User::AllocZ(nTotalSize);
+    
+    if (mem)
+    	iMemArray.Append(mem);
+    
+    do {
+    	mem=User::AllocZ(leftsize);
+		if(mem)
+			{		
+			iMemArray.Append(mem);
+			}
+    } while(mem);
+    
+    // get avaiable memory, we can't log here, because no enough memory to write log
+    // so we have to write log after free memory
+    iAvaiableSpace=User::Available(iBiggestBlock);
+    }
+
+void CT_GraphicsUtil::FreeEatenMemory(CDataWrapperBase& aDataWrapper)
+    {    
+    for (TInt i=0;i<iMemArray.Count();i++)
+    	{
+    	TAny* mem=iMemArray[i];
+    	User::Free(mem);
+    	}	
+    
+	iMemArray.Reset();
+	
+	// write memory status after eat memory
+	aDataWrapper.INFO_PRINTF3(_L("CT_GraphicsUtil::FreeEatenMemory, before free memory, avaiable=%d byte biggestblock=%d byte"),iAvaiableSpace,iBiggestBlock);
+    }
+
+TBool CT_GraphicsUtil::GetFrameInfo(CDataWrapperBase& aDataWrapper,const TDesC& aSectName, TFrameInfo& frameinfo)
+	{
+	// get iFrameCoordsInPixels from parameters
+	aDataWrapper.GetRectFromConfig(aSectName, KFldFrameCoordsInPixels, frameinfo.iFrameCoordsInPixels);
+		
+	//get iFrameSizeInTwips from parameters
+	aDataWrapper.GetSizeFromConfig(aSectName,KFldFrameSizeInTwips,frameinfo.iFrameSizeInTwips);
+	
+	//get iBitsPerPixel from parameters
+	aDataWrapper.GetIntFromConfig(aSectName,KFldBitsPerPixel,frameinfo.iBitsPerPixel);
+	
+	//get iDelay from parameters
+	TInt delay=0;
+	TBool ret=aDataWrapper.GetIntFromConfig(aSectName,KFldDelay,delay);
+	
+	if(ret)
+		{
+		frameinfo.iDelay=TTimeIntervalMicroSeconds(delay);
+		}
+	
+	//get iFlags from parameters,when set frame info, must set flag.
+	ret=ReadFrameInfoFlags(aDataWrapper,aSectName,KFldFlags,frameinfo.iFlags);
+	
+	//get iOverallSizeInPixels from parameters
+	aDataWrapper.GetSizeFromConfig(aSectName,KFldOverallSizeInPixels,frameinfo.iOverallSizeInPixels);
+	
+	//get iFrameDisplayMode from parameters
+	ReadDisplayMode(aDataWrapper,aSectName,KFldFrameDisplayMode,frameinfo.iFrameDisplayMode);
+	
+	//get iBackgroundColor from parameters
+	aDataWrapper.GetRgbFromConfig(aSectName,KFldBackgroundColor,frameinfo.iBackgroundColor);
+	
+	//get iFrameSizeInPixels from parameters
+	aDataWrapper.GetSizeFromConfig(aSectName,KFldFrameSizeInPixels,frameinfo.iFrameSizeInPixels);
+	
+	//get FrameState from parameters
+	TFrameInfo::TFrameInfoState state;
+	
+	if(GetFrameInfoState(aDataWrapper,aSectName,KFldFrameInfoState,state))
+		{
+		frameinfo.SetCurrentFrameState(state);
+		}
+	
+	//get current data offset from parameters
+	TInt offset;
+	
+	if(aDataWrapper.GetIntFromConfig(aSectName,KFldCurrentDataOffset,offset))
+		{
+		frameinfo.SetCurrentDataOffset(offset);
+		}
+	
+	//get frame data offset from parameters
+	if(aDataWrapper.GetIntFromConfig(aSectName,KFldFrameDataOffset,offset))
+		{
+		frameinfo.SetFrameDataOffset(offset);
+		}
+	
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::ReadFrameInfoFlags(CDataWrapperBase& aDataWrapper,const TDesC& aSectName, const TDesC& aKeyName,TUint32& aFlags)
+	{
+	TPtrC 	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		ret=ConvertToFrameInfoFlags(str, aFlags);
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::GetShaperFactoryL(CDataWrapperBase & aDataWrapper, const TDesC & aSectName, const TDesC & aKeyName, CShaperFactory *& aData)
+	{
+	// get CShaperFactory data object from parameters
+	TPtrC name;
+	TBool ret = aDataWrapper.GetStringFromConfig(aSectName, aKeyName, name);
+	if (ret)
+		{
+		// Data object found
+		aData = static_cast<CShaperFactory*> (aDataWrapper.GetDataObjectL(name));
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::GetRasterizerL(CDataWrapperBase & aDataWrapper, const TDesC & aSectName, const TDesC & aKeyName, COpenFontRasterizer *& aData)
+	{
+	// get COpenFontRasterizer data object from parameters
+	TPtrC name;
+	TBool ret = aDataWrapper.GetStringFromConfig(aSectName, aKeyName, name);
+	if (ret)
+		{
+		// Data object found
+		aData = static_cast<COpenFontRasterizer*> (aDataWrapper.GetDataObjectL(name));
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::GetOpenFontGlyphDataL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TOpenFontGlyphData*& aData)
+	{
+	// get TOpenFontGlyphData data object from parameters
+	TPtrC name;
+	TBool ret = aDataWrapper.GetStringFromConfig(aSectName, aKeyName, name);
+	if (ret)
+		{
+		// Data object found
+		aData = static_cast<TOpenFontGlyphData*> (aDataWrapper.GetDataObjectL(name));
+		}
+	
+	return ret;
+	}
+
+TBool  CT_GraphicsUtil::ConvertToFrameInfoFlags(const TDesC& aStr,TUint32& aFrameInfoFlags)
+	{
+	TBool	ret=ETrue;
+	TInt	location=aStr.Match(_L("*|*"));
+	if( location!=KErrNotFound )
+		{
+		// Converting Left part of the data
+		TPtrC	tempStr=aStr.Left(location);
+		ret=ConvertToFrameInfoFlags(tempStr, aFrameInfoFlags);
+
+		// Converting right data can be with another "|"
+		tempStr.Set(aStr.Mid(location+1));
+
+		TUint32	temp;
+		if ( ConvertToFrameInfoFlags(tempStr, temp) )
+			{
+			aFrameInfoFlags|=temp;
+			}
+		else
+			{
+			ret=EFalse;
+			}
+		}
+	else
+		{
+		if ( aStr==KEColor )
+			{
+			aFrameInfoFlags=TFrameInfo::EColor;
+			}
+		else if ( aStr==KETransparencyPossible )
+			{
+			aFrameInfoFlags=TFrameInfo::ETransparencyPossible;
+			}
+		else if ( aStr==KEFullyScaleable )
+			{
+			aFrameInfoFlags=TFrameInfo::EFullyScaleable;
+			}
+		else if ( aStr==KEConstantAspectRatio )
+			{
+			aFrameInfoFlags=TFrameInfo::EConstantAspectRatio;
+			}
+		else if ( aStr==KECanDither )
+			{
+			aFrameInfoFlags=TFrameInfo::ECanDither;
+			}
+		else if ( aStr==KEAlphaChannel )
+			{
+			aFrameInfoFlags=TFrameInfo::EAlphaChannel;
+			}
+		else if ( aStr==KELeaveInPlace )
+			{
+			aFrameInfoFlags=TFrameInfo::ELeaveInPlace;
+			}
+		else if ( aStr==KERestoreToBackground )
+			{
+			aFrameInfoFlags=TFrameInfo::ERestoreToBackground;
+			}
+		else if ( aStr==KERestoreToPrevious )
+			{
+			aFrameInfoFlags=TFrameInfo::ERestoreToPrevious;
+			}
+		else if ( aStr==KEPartialDecodeInvalid )
+			{
+			aFrameInfoFlags=TFrameInfo::EPartialDecodeInvalid;
+			}
+		else if ( aStr==KEMngMoreFramesToDecode )
+			{
+			aFrameInfoFlags=TFrameInfo::EMngMoreFramesToDecode;
+			}
+		else if ( aStr==KEUsesFrameSizeInPixels )
+			{
+			aFrameInfoFlags=TFrameInfo::EUsesFrameSizeInPixels;
+			}
+		else
+			{
+			TUint32	frameinfoFlag;
+			TLex	lex(aStr);
+			ret=(lex.Val(frameinfoFlag, EHex)==KErrNone);
+			if ( ret )
+				{
+				aFrameInfoFlags=frameinfoFlag;
+				}
+			}
+		}
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::GetFrameInfoState(CDataWrapperBase& aDataWrapper,const TDesC& aSectName, const TDesC& aKeyName,TFrameInfo::TFrameInfoState& aState)
+	{
+	TPtrC	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KEFrameInfoUninitialised )
+			{
+			aState=TFrameInfo::EFrameInfoUninitialised;
+			}
+		else if ( str==KEFrameInfoProcessingFrameHeader )
+			{
+			aState=TFrameInfo::EFrameInfoProcessingFrameHeader;
+			}
+		else if ( str==KEFrameInfoProcessingFrame )
+			{
+			aState=TFrameInfo::EFrameInfoProcessingFrame;
+			}
+		else if ( str==KEFrameInfoProcessingComplete)
+			{
+			aState=TFrameInfo::EFrameInfoProcessingComplete;
+			}
+		else
+			{
+			TUint	state;
+			TLex	lex(str);
+			ret=(lex.Val(state, EHex)==KErrNone);
+			if ( ret )
+				{
+				aState=(TFrameInfo::TFrameInfoState)state;
+				}
+			}
+		}
+	
+	return ret;
+	}
+
+
+TBool CT_GraphicsUtil::GetWsGraphicAnimationL(CDataWrapperBase& aDataWrapper,const TDesC& aSectName, const TDesC& aKeyName, TWsGraphicAnimation*& aData)
+	{
+	// get TWsGraphicAnimation data object from parameters
+	TPtrC	name;
+	TBool	ret = aDataWrapper.GetStringFromConfig(aSectName, aKeyName, name);
+	if ( ret )
+		{
+		// Data object found
+		aData=static_cast<TWsGraphicAnimation*>(aDataWrapper.GetDataObjectL(name));
+		}
+
+	return ret;
+	}
+
+TBool CT_GraphicsUtil::StartAnimTesterClientL(CDataWrapperBase& aDataWrapper,const TDesC& aSectName)
+	{
+	TPtrC processName;
+	if( !aDataWrapper.GetStringFromConfig(aSectName, KFldProcessName, processName) )
+		{
+		return EFalse;
+		}
+	TInt id;
+	if( !aDataWrapper.GetIntFromConfig(aSectName, KFldId, id) )
+		{
+		return EFalse;
+		}
+	TRect rect;
+	if( !aDataWrapper.GetRectFromConfig(aSectName, KFldRect, rect) )
+		{
+		return EFalse;
+		}
+	TPtrC objectName;
+	if ( !aDataWrapper.GetStringFromConfig(aSectName, KFldWsga, objectName) )
+		{
+		return EFalse;
+		}	
+	TWsGraphicAnimation* wsGraphAnim;
+	wsGraphAnim = static_cast<TWsGraphicAnimation*>(aDataWrapper.GetDataObjectL(objectName));
+		
+	_LIT(KSpace, " ");
+	TBuf<128> args;
+	// Initialize arguments	
+	args.Zero();
+	args.Append(processName);
+	args.Append(KSpace);
+	args.AppendNum(0);			// screen number
+	args.Append(KSpace);
+	args.AppendNum(id);
+	args.Append(KSpace);
+	args.AppendNum(rect.iTl.iX);
+	args.Append(KSpace);
+	args.AppendNum(rect.iTl.iY);
+	args.Append(KSpace);
+	args.AppendNum(rect.iBr.iX);
+	args.Append(KSpace);
+	args.AppendNum(rect.iBr.iY);
+	args.Append(KSpace);
+	TBuf<32> data;
+	data.Copy(wsGraphAnim->Pckg());
+	args.Append(data);
+	
+	// Launch client process
+  	RProcess process;
+  	CleanupClosePushL(process);
+	User::LeaveIfError(process.Create(processName,args));
+  	process.Resume();
+
+  	// Synchronize the process
+  	RSemaphore semaphore;
+  	CleanupClosePushL(semaphore);
+  	TInt err = semaphore.OpenGlobal(processName);
+  	if( KErrNotFound == err )
+  		{
+  		User::LeaveIfError(semaphore.CreateGlobal(processName,0));
+  		// Wait until new process finish drawing
+  		}
+  	else if( KErrNone != err )
+  		{
+  		User::LeaveIfError(err);
+  		}
+	semaphore.Wait();
+  	CleanupStack::PopAndDestroy(2);  	
+  	return ETrue;
+	}
+  
+TBool CT_GraphicsUtil::CloseAnimTesterClientL(CDataWrapperBase& aDataWrapper,const TDesC& aSectName)
+	{
+	TPtrC processName;
+	if( !aDataWrapper.GetStringFromConfig(aSectName, KFldProcessName, processName) )
+		{
+		return EFalse;
+		}
+
+	RSemaphore semaphore;
+	CleanupClosePushL(semaphore);
+	User::LeaveIfError(semaphore.OpenGlobal(processName));
+	// Waken waiting process
+	semaphore.Signal();
+	CleanupStack::PopAndDestroy();
+ 	return ETrue;
+	}
+	
+TBool CT_GraphicsUtil::ReadAnimType(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TInt& aType)
+	{
+	TPtrC	str;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KEAnimWindows)
+			{
+			aType=EKWindowAnim;
+			}
+		else if ( str==KEAnimSprite )
+			{
+			aType=EKSpriteAnim;
+			}
+		else if ( str==KEAnimFreeTimer )
+			{
+			aType=EKFreeTimerWindowAnim;
+			}
+		else
+			ret=EFalse;
+		}
+
+	return ret;	
+	}
+
+TBool CT_GraphicsUtil::ReadAnimCommand(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TInt& aCommand)
+	{
+	TPtrC	str;
+		TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+		if ( ret )
+			{
+			if ( str==KEAnimCmdSync )
+				{
+				aCommand=ECmdSync;
+				}
+			else if ( str==KEAnimCmdTestWithoutPara )
+				{
+				aCommand=ECmdTestWithoutPara;
+				}
+			else if ( str==KEAnimCmdTestWithPara )
+				{
+				aCommand=ECmdTestWithPara;
+				}
+			else if ( str==KEAnimCmdGetLast )
+				{
+				aCommand=ECmdGetLast;
+				}
+			else if ( str==KEAnimCmdGetAnimInterval )
+				{
+				aCommand=ECmdGetAnimInterval;
+				}
+	//MAnimGeneralFunctions
+	    else if (str==KEMAnimECmdRetrieveResult)
+				{
+				aCommand=ECmdRetrieveResult;
+				}
+	    else if(str==KEMAnimECmdUtilEatupMemory)
+	    		{
+	    		aCommand=ECmdUtilEatupMemory;
+	    		}
+	    else if(str==KEMAnimECmdUtilFreeEatenMemory)
+	    		{
+	    		aCommand=ECmdUtilFreeEatenMemory;	    	
+	    		}
+	    else if (str==KEMAnimECmdGeneralAnimate)
+				{
+				aCommand=ECmdGeneralAnimate;
+				}
+			else if (str==KEMAnimECmdGeneralClient)
+				{
+				aCommand=ECmdGeneralClient;
+				}	
+	    else if (str==KEMAnimECmdGeneralFlashStateOn)
+				{
+				aCommand=ECmdGeneralFlashStateOn;
+				}
+	    else if (str==KEMAnimECmdGeneralPanic)
+				{
+				aCommand=ECmdGeneralPanic;
+				}
+	    else if (str==KEMAnimECmdGeneralScreenDevice)
+				{
+				aCommand=ECmdGeneralScreenDevice;
+				}
+	    else if (str==KEMAnimECmdGeneralExtendedInterface)
+				{
+				aCommand=ECmdGeneralExtendedInterface;
+				}
+	     else if (str==KEMAnimECmdGeneralWindowExtension)
+				{
+				aCommand=ECmdGeneralWindowExtension;
+				}
+			 else if (str==KEMAnimECmdGeneralNumOfExtInterfaces)
+				{
+				aCommand=ECmdGeneralNumOfExtInterfaces;
+				} 
+	     else if (str==KEMAnimECmdGeneralEventExtension)
+				{
+				aCommand=ECmdGeneralEventExtension;
+				}
+			 else if ( str==KEMAnimECmdGeneralGetRawEvents)
+			 	{
+			 	aCommand=ECmdGeneralGetRawEvents;	
+			 	} 
+	     else if ( str==KEMAnimECmdGeneralPostRawEvent)
+			 	{
+			 	aCommand=ECmdGeneralPostRawEvent;	
+			 	} 
+	     else if ( str==KEMAnimECmdGeneralPostKeyEvent)
+			 	{
+			 	aCommand=ECmdGeneralPostKeyEvent;	
+			 	} 
+	     else if ( str==KEMAnimECmdGeneralSetSync)
+			 	{
+			 	aCommand=ECmdGeneralSetSync;	
+			 	} 
+	      else if ( str==KEMAnimECmdGeneralSync)
+			 	{
+			 	aCommand=ECmdGeneralSync;	
+			 	}
+	      else if ( str==KEMAnimECmdGeneralSetInterval)
+			 	{
+			 	aCommand=ECmdGeneralSetInterval;	
+			 	}
+	      else if ( str==KEMAnimECmdGeneralSetNextInterval)
+			 	{
+			 	aCommand=ECmdGeneralSetNextInterval;	
+			 	}
+	      else if ( str==KEMAnimECmdGeneralSystemTime)
+			 	{
+			 	aCommand=ECmdGeneralSystemTime;	
+			 	}
+	      else if ( str==KEMAnimECmdGeneralRegisterForNotis)
+			 	{
+			 	aCommand=ECmdGeneralRegisterForNotis;	
+			 	}
+	      else if ( str==KEMAnimECmdGeneralMessage)
+			 	{
+			 	aCommand=ECmdGeneralMessage;	
+			 	} 
+	      else if ( str==KEMAnimECmdGeneralDuplicateBitmapL)
+			 	{
+			 	aCommand=ECmdGeneralDuplicateBitmapL;	
+			 	} 
+	      else if ( str==KEMAnimECmdGeneralDuplicateFontL)
+			 	{
+			 	aCommand=ECmdGeneralDuplicateFontL;	
+			 	}
+	      else if ( str==KEMAnimECmdGeneralCloseFont)
+			 	{
+			 	aCommand=ECmdGeneralCloseFont;	
+			 	}
+	      //Opcodes for MAnimSpriteFunctions          
+	      else if ( str==KEMAnimECmdSpriteGetSpriteMember)
+			 	{
+			 	aCommand=ECmdSpriteGetSpriteMember;	
+			 	}
+	      else if ( str==KEMAnimECmdSpriteUpdateMember)
+			 	{
+			 	aCommand=ECmdSpriteUpdateMember;	
+			 	}
+	      else if ( str==KEMAnimECmdSpriteActivate)
+			 	{
+			 	aCommand=ECmdSpriteActivate;	
+			 	}   
+	      else if ( str==KEMAnimECmdSpriteSpriteCanBeSeen)
+			 	{
+			 	aCommand=ECmdSpriteSpriteCanBeSeen;	
+			 	} 
+	      else if ( str==KEMAnimECmdSpriteSizeChangedL)
+			 	{
+			 	aCommand=ECmdSpriteSizeChangedL;	
+			 	} 
+	      else if ( str==KEMAnimECmdSpriteSetPosition)
+			 	{
+			 	aCommand=ECmdSpriteSetPosition;	
+			 	} 
+			 	else if (str==KEMAnimECmdGeneralReplyBuf8)
+			 	{
+			 	aCommand=ECmdGeneralReplyBuf8;
+			 	}
+			 	else if (str==KEMAnimECmdGeneralReplyBuf16)
+			 	{
+			 	aCommand=ECmdGeneralReplyBuf16;
+			 	}
+			 	
+	 //MAnimWindowFunctions
+
+			  else if (str==KEMAnimECmdWindowActivateGc)
+				{
+				aCommand=ECmdWindowActivateGc;
+				}
+			else if (str==KEMAnimECmdWindowSetRect)	
+				{
+				aCommand=ECmdWindowSetRect;
+				}
+			else if (str==KEMAnimECmdWindowWindowSize)
+				{
+				aCommand=ECmdWindowWindowSize;
+				}
+			else if (str==KEMAnimECmdWindowIsHidden)
+				{
+				aCommand=ECmdWindowIsHidden;
+				}
+			else if (str==KEMAnimECmdWindowSetVisible)
+				{
+				aCommand=ECmdWindowSetVisible;
+				}
+			else if (str==KEMAnimECmdWindowInvalidate)
+				{
+				aCommand=ECmdWindowInvalidate;
+				}
+			else if (str==KEMAnimECmdWindowParameters)
+				{
+				aCommand=ECmdWindowParameters;
+				}
+			else if (str==KEMAnimECmdWindowVisibleRegion)
+				{
+				aCommand=ECmdWindowVisibleRegion;
+				}
+			else if (str==KEMAnimECmdWindowIsStarted)
+				{
+				aCommand=ECmdWindowIsStarted;
+				}
+			else if(str==KEMAnimECmdRetrieveResult)
+				{
+				aCommand=ECmdRetrieveResult;
+				}
+			//Add Opcodes covertion here for MAnimGeneralFunctionsWindowExtension	
+				
+			else if (str==KEMAnimECmdGfweScreens)
+				{
+				aCommand=ECmdGfweScreens;
+				}
+			else if (str==KEMAnimECmdGfweFocusScreens)
+				{
+				aCommand=ECmdGfweFocusScreens;
+				}
+			else if (str==KEMAnimECmdGfweSetFocusScreen)
+				{
+				aCommand=ECmdGfweSetFocusScreen;
+				}
+			else if (str==KEMAnimECmdGfweWindowGroups)
+				{
+				aCommand=ECmdGfweWindowGroups;
+				}
+			else if (str==KEMAnimECmdGfweWindowGroupInfo)
+				{
+				aCommand=ECmdGfweWindowGroupInfo;
+				}
+			else if (str==KEMAnimECmdGfweWindowGroupName)
+				{
+				aCommand=ECmdGfweWindowGroupName;
+				}
+			else if (str==KEMAnimECmdGfweSetOrdinalPosition)
+				{
+				aCommand=ECmdGfweSetOrdinalPosition;
+				}
+			else if (str==KEMAnimECmdGfweIsFocusable)
+				{
+				aCommand=ECmdGfweIsFocusable;
+				}
+			//Add Opcodes covertion here for MAnimFreeTimerWindowFunctions	
+			//*
+			///*
+			else if (str==KEMAnimECmdFreeTimerWinDeactivateGc)
+				{
+				aCommand=ECmdFreeTimerWinDeactivateGc;
+				}
+			else if (str==KEMAnimECmdFreeTimerWinUpdate)
+				{
+				aCommand=ECmdFreeTimerWinUpdate;
+				}
+			else
+				ret=EFalse;
+			}
+
+		return ret;
+	}
+
+TBool CT_GraphicsUtil::GetFbsBitGcL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CFbsBitGc*& aData)
+	{
+	// get CFbsBitGc data object from parameters
+	TPtrC	name;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, name);
+	if ( ret )
+		{
+		// Data object found
+		aData=static_cast<CFbsBitGc*>(aDataWrapper.GetDataObjectL(name));
+		}
+
+	return ret;
+	}
+
+
+TBool CT_GraphicsUtil::GetGraphicsOrientation(CDataWrapperBase& aDataWrapper,const TDesC& aSectName, const TDesC& aKeyName,CFbsBitGc::TGraphicsOrientation& aParam)
+	{
+	TPtrC str;
+	TBool ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, str);
+	if (ret)
+		{
+		if ( str==KEGraphicsOrientationNormal )
+			{
+			aParam=CFbsBitGc::EGraphicsOrientationNormal;
+			}
+		else if(str==KEGraphicsOrientationRotated90)
+			{
+			aParam=CFbsBitGc::EGraphicsOrientationRotated90;
+			}
+		else if(str==KEGraphicsOrientationRotated180)
+			{
+			aParam=CFbsBitGc::EGraphicsOrientationRotated180;
+			}
+		else if(str==KEGraphicsOrientationRotated270)
+			{
+			aParam=CFbsBitGc::EGraphicsOrientationRotated270;
+			}
+		else
+			{
+			ret=EFalse;
+			}
+		}
+	return ret;
+	}
+
+/**
+ * Utility method that fetches CLinkedTypefaceSpecification pointer by command parameter name from INI-file.
+ */
+TBool CT_GraphicsUtil::GetLinkedTypefaceSpecificationL(CDataWrapperBase& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, CLinkedTypefaceSpecification*& aData)
+	{
+	// get CLinkedTypefaceSpecification data object from parameters
+	TPtrC	name;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSectName, aKeyName, name);
+	if ( ret )
+		{
+		// Data object found
+		aData=static_cast<CLinkedTypefaceSpecification*>(aDataWrapper.GetDataObjectL(name));
+		}
+
+	return ret;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/common/src/TestServerBase.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "TestServerBase.h"
+#include "UtilityClearPanicDlg.h"
+
+/*@{*/
+///	Constant Literals used.
+_LIT(KCmdUtilityClearPanicDlg,	"utilityClearPanicDlg");
+/*@}*/
+
+CTestStep* CTestServerBase::CreateTestStep(const TDesC& aStepName)
+	{
+	CTestStep*	ret=NULL;
+
+	if ( aStepName == KCmdUtilityClearPanicDlg )
+		{
+		ret=new CUtilityClearPanicDlg();
+		}
+	else
+		{
+		ret=CTestServer2::CreateTestStep(aStepName);
+		}
+
+	return ret;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/common/src/UtilityClearPanicDlg.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "UtilityClearPanicDlg.h"
+
+//	EPOC Includes
+#include <w32std.h>
+
+/*@{*/
+///	Constant Literals used.
+_LIT(KCmdUtilityClearPanicDlg,	"utilityClearPanicDlg");
+/*@}*/
+
+CUtilityClearPanicDlg::CUtilityClearPanicDlg()
+	{
+	SetTestStepName(KCmdUtilityClearPanicDlg);
+	}
+
+enum TVerdict CUtilityClearPanicDlg::doTestStepL()
+	{
+	RWsSession	ws;
+	User::LeaveIfError(ws.Connect());
+	CleanupClosePushL(ws);
+
+	TKeyEvent	event;
+	event.iCode=EKeyEnter;
+	event.iScanCode=EKeyEnter;
+	event.iModifiers=0;
+	event.iRepeats=0;
+	ws.SimulateKeyEvent(event);
+
+	ws.Flush();
+	CleanupStack::PopAndDestroy(&ws);
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fbserv/inc/T_DataBitmapUtil.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataBitmapUtil
+*/
+
+#if (!defined __T_DATA_BITMAP_UTIL_H__)
+#define __T_DATA_BITMAP_UTIL_H__
+
+//	User Includes
+#include "DataWrapperBase.h"
+
+//	EPOC includes
+#include <e32std.h>
+#include <fbs.h>
+
+class CT_DataBitmapUtil : public CDataWrapperBase
+	{
+public:
+	CT_DataBitmapUtil();
+	~CT_DataBitmapUtil();
+	
+	static	CT_DataBitmapUtil*	NewL();
+
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+	virtual TAny*	GetObject();
+	virtual void	SetObjectL(TAny* aObject);
+	virtual void	DisownObjectL();
+	void			DestroyData();
+
+private:
+	void	ConstructL();
+
+	static CT_DataBitmapUtil* GetBitmapUtilDataObjectFromParameterL(CDataWrapper& aDataWrapper, const TDesC& aParameterName, const TDesC& aSection);
+
+	void	DoCmdNewL(const TDesC& aSection);
+	void	DoCmdBeginL(const TDesC& aSection);
+	void	DoCmdEnd();
+	void	DoCmdSetPixelL(const TDesC& aSection);
+	void	DoCmdGetPixel(const TDesC& aSection);
+	void	DoCmdSetPos(const TDesC& aSection);
+	void	DoCmdDecXPos();
+	void	DoCmdDecYPos();
+	void	DoCmdIncXPos();
+	void	DoCmdIncYPos();
+
+private:
+	/** TBitmapUtil class instance that is tested */
+	TBitmapUtil*	iBitmapUtil;
+	};
+
+#endif /* __T_DATA_BITMAP_UTIL_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fbserv/inc/T_DataFbsBitmap.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,135 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataFbsBitmap
+*/
+
+#if (!defined __T_DATA_FBS_BITMAP_H__)
+#define __T_DATA_FBS_BITMAP_H__
+
+//	User Includes
+#include "DataWrapperBase.h"
+
+//	EPOC includes
+#include <e32std.h>
+#include <fbs.h>
+#include <s32file.h>
+#include <bitdev.h>
+
+class CT_DataFbsBitmap : public CDataWrapperBase
+	{
+public:
+	static CT_DataFbsBitmap*	NewL();
+	~CT_DataFbsBitmap();
+
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+	virtual TAny*	GetObject();
+    virtual void    SetObjectL(TAny* aAny);
+	virtual void	DisownObjectL();
+
+protected:
+	CT_DataFbsBitmap();
+	void	ConstructL();
+
+	virtual CFbsBitmap*		GetFbsBitmap() const;
+
+	void	RunL(CActive* aActive, TInt aIndex);
+	void	DoCancel(CActive* aActive, TInt aIndex);
+
+private:
+	void	DestroyData();
+	void	DoCmdNewL();
+	void	DoCmdDestructor();
+	void	DoCmdCompress(const TDesC& aSection);
+	void	DoCmdCompressInBackground(const TDesC& aSection, const TInt aAsyncErrorIndex);
+	void	DoCmdCreate(const TDesC& aSection);
+	void	DoCmdCreateHardwareBitmap(const TDesC& aSection);
+	void	DoCmdDataAddress(const TDesC& aSection);
+	void	DoCmdDataStride(const TDesC& aSection);
+	void	DoCmdDisplayMode(const TDesC& aSection);
+	void	DoCmdDuplicateL(const TDesC& aSection);
+	void	DoCmdExternalizeL(const TDesC& aSection);
+	void	DoCmdExternalizeRectangleL(const TDesC& aSection);
+	void	DoCmdGetPaletteL(const TDesC& aSection);
+	void	DoCmdGetPixel(const TDesC& aSection);
+	void	DoCmdGetScanLineL(const TDesC& aSection);
+	void	DoCmdGetVerticalScanLineL(const TDesC& aSection);
+	void	DoCmdHandle(const TDesC& aSection);
+	void	DoCmdHardwareBitmapHandle(const TDesC& aSection);
+	void	DoCmdHeader();
+	void	DoCmdHorizontalPixelsToTwips(const TDesC& aSection);
+	void	DoCmdHorizontalTwipsToPixels(const TDesC& aSection);
+	void	DoCmdInitialDisplayMode(const TDesC& aSection);
+	void	DoCmdInternalizeL(const TDesC& aSection);
+	void	DoCmdIsCompressedInRAM(const TDesC& aSection);
+	void	DoCmdIsFileInRom(const TDesC& aSection);
+	void	DoCmdIsLargeBitmap(const TDesC& aSection);
+	void	DoCmdIsMonochrome(const TDesC& aSection);
+	void	DoCmdIsRomBitmap(const TDesC& aSection);
+	void	DoCmdLoadL(const TDesC& aSection);
+	void	DoCmdLoadAndCompressL(const TDesC& aSection);
+	void	DoCmdLockHeap(const TDesC& aSection);
+	void	DoCmdLockHeapLC(const TDesC& aSection);
+	void	DoCmdPaletteAttributes(const TDesC& aSection);
+	void	DoCmdReset();
+	void	DoCmdResize(const TDesC& aSection);
+	void	DoCmdSave(const TDesC& aSection);
+	void	DoCmdScanLineLength(const TDesC& aSection);
+	void	DoCmdSetDisplayMode(const TDesC& aSection);
+	void	DoCmdSetPaletteL(const TDesC& aSection);
+	void	DoCmdSetRomBitmapL(const TDesC& aSection);
+	void	DoCmdSetScanLineL(const TDesC& aSection);
+	void	DoCmdSetSizeInTwipsL(const TDesC& aSection);
+	void	DoCmdSizeInPixels(const TDesC& aSection);
+	void	DoCmdSizeInTwips(const TDesC& aSection);
+	void	DoCmdStoreL(const TDesC& aSection);
+	void	DoCmdSwapWidthAndHeight();
+	void	DoCmdUnlockHeapL(const TDesC& aSection);
+	void	DoCmdVerticalPixelsToTwips(const TDesC& aSection);
+	void	DoCmdVerticalTwipsToPixels(const TDesC& aSection);
+
+	//	MTPActiveCallback implementation
+	void	RunCompressInBackground(const TInt aIndex);
+	void	DoCancelCompressInBackground(const TInt aIndex);
+
+	//	Helpers
+	void				ExternalizeImplL(const TDesC& aSection, const TRect& aRect, TBool aUseRect);
+	void				LoadOrLoadAndCompressL(const TDesC& aSection, TBool aCompress);
+	inline TDisplayMode	GetDisplayMode() const;
+
+private:
+	/** CFbsBitmap class instance that is tested */
+	CFbsBitmap*			iFbsBitmap;
+	TDisplayMode		iDisplayMode;
+
+	/** Pop when unlocking */
+	TBool				iPopWhenUnlocking;
+	
+	TBool				iCompressFailed;
+
+	/** Active object for CompressInBackground async operation */
+	CActiveCallback*	iActiveCompressInBackground;
+	};
+
+#include "T_DataFbsBitmap.inl"
+
+#endif /* __T_DATA_FBS_BITMAP_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fbserv/inc/T_DataFbsBitmap.inl	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataFbsBitmap inline functions
+*/
+
+TDisplayMode CT_DataFbsBitmap::GetDisplayMode() const
+	{
+	return iDisplayMode;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fbserv/inc/T_DataFbsColor256BitmapUtil.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataFbsColor256BitmapUtil
+*/
+
+#if (!defined __T_DATA_FBS_COLOR256_BITMAP_UTIL_H__)
+#define __T_DATA_FBS_COLOR256_BITMAP_UTIL_H__
+
+//	User Includes
+#include "DataWrapperBase.h"
+//	EPOC includes
+#include <e32std.h>
+#include <fbs.h>
+#include "DataWrapperBase.h"
+
+class CT_DataFbsColor256BitmapUtil : public CDataWrapperBase
+	{
+public:
+
+	static CT_DataFbsColor256BitmapUtil*	NewL();
+
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+	~CT_DataFbsColor256BitmapUtil();
+	virtual TAny*	GetObject();
+
+protected:
+	CT_DataFbsColor256BitmapUtil();
+	void ConstructL();
+
+private:
+	void	DestroyData();
+	void	DoCmdNewL(const TDesC& aSection);
+	void	DoCmdCopyBitmapL(const TDesC& aSection);
+
+	TBool	ReadDither(CDataWrapper& aDataWrapper, const TDesC& aSection, CFbsColor256BitmapUtil::TDither& aDither);
+
+private:
+	/** CFbsColor256BitmapUtil class instance to work with*/
+    CFbsColor256BitmapUtil*	iFbsColor256BitmapUtil;
+	};
+
+#endif /* __T_DATA_FBS_COLOR256_BITMAP_UTIL_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fbserv/inc/T_DataFbsFont.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataFbsFont
+*/
+
+#if (!defined __T_DATA_FBS_FONT_H__)
+#define __T_DATA_FBS_FONT_H__
+
+//	User Includes
+#include "T_DataFont.h"
+
+//	EPOC includes
+#include <e32std.h>
+#include <fbs.h>
+
+
+class CT_DataFbsFont : public CT_DataFont
+	{
+public:
+	static CT_DataFbsFont*	NewL();
+
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+	virtual void 	SetObjectL(TAny* aObject);
+	virtual TAny*	GetObject();
+	virtual void	DisownObjectL();
+
+protected:
+	CT_DataFbsFont();
+
+	virtual CFont*	GetFont() const;
+
+private:
+	void	DoCmdGetFontMetrics(const TDesC& aSection);
+	void	DoCmdTextWidthInPixelsWithCharWidth(const TDesC& aSection);
+	void	DoCmdHandle();
+	void	DoCmdCharacterMetrics(const TDesC& aSection);
+	void	DoCmdRawTextWidthInPixels(const TDesC& aSection);
+	void	DoCmdGetFaceAttrib(const TDesC& aSection);
+	void	DoCmdIsOpenFont(const TDesC& aSection);
+	void	DoCmdHasCharacter(const TDesC& aSection);
+
+private:
+	/** CFbsFont class instance that is tested, not owned by the data-object */
+	CFbsFont*	iFbsFont;
+	};
+
+#endif /* __T_DATA_FBS_FONT_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fbserv/inc/T_DataFbsSession.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataFbsSession
+*/
+
+#if (!defined __T_DATA_FBS_SESSION_H__)
+#define __T_DATA_FBS_SESSION_H__
+
+//	User Includes
+#include "DataWrapperBase.h"
+//	EPOC includes
+#include <e32std.h>
+#include <fbs.h>
+
+class CT_DataFbsSession : public CDataWrapperBase
+	{
+public:
+	static CT_DataFbsSession*	NewL();
+
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+	
+	~CT_DataFbsSession();
+
+	virtual TAny*	GetObject();
+
+protected:
+	CT_DataFbsSession();
+	void	ConstructL();
+
+private:
+	inline void	DoCmdConstructor();
+	inline void	DoCmdConnect(const TDesC& aSection);
+	inline void	DoCmdDisconnect();
+	inline void	DoCmdGetSession(const TDesC& aSection);
+	inline void	DoCmdCallBack(const TDesC& aSection);
+	inline void	DoCmdSetCallBack();
+	inline void	DoCmdResetCallBack();
+	inline void	DoCmdResourceCount(const TDesC& aSection);
+	inline void	DoCmdSendCommandL(const TDesC& aSection);
+	inline void	DoCmdVersion(const TDesC& aSection);
+	inline void	DoCmdHeapBase();
+	inline void	DoCmdSessionHandle();
+
+	static TInt CallBackFunction(TAny* aPtr);
+	TInt		CallBackFunction();
+
+	TBool		GetFbsMessage(const TDesC& aSection, TInt& aMessage);
+
+private:
+	RFs				iFsUnconnected;
+
+	RFbsSession*	iSession;
+
+	/** vaiable that temporarily stores value of server resource count that is set
+	* by iSession->ResourceCount()
+	*/
+	TInt			iResourceCount;
+
+	/* used to check if the callback function was called*/
+	TBool			iCallBackCalled;
+	};
+
+#endif /* __T_DATA_FBS_SESSION_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fbserv/inc/T_DataFbsTypefaceStore.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataFbsTypefaceStore
+*/
+
+#if (!defined __T_DATA_FBS_TYPEFACE_STORE_H__)
+#define __T_DATA_FBS_TYPEFACE_STORE_H__
+
+//	User Includes
+#include "T_DataTypefaceStore.h"
+
+//	EPOC includes
+#include <e32std.h>
+#include <fbs.h>
+
+class CT_DataFbsTypefaceStore : public CT_DataTypefaceStore
+	{
+public:
+	static CT_DataFbsTypefaceStore*	NewL();
+
+	virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+	~CT_DataFbsTypefaceStore();
+
+	virtual TAny*	GetObject();
+
+protected:
+	CT_DataFbsTypefaceStore();
+	void	ConstructL();
+
+	//	CT_DataTypefaceStore implementation
+	virtual CTypefaceStore*	GetTypefaceStore() const;
+
+private:
+	void	DestroyData();
+	void	DoCmdNewL(const TDesC& aSection);
+	void	DoCmdGetNearestFontInPixelsL(const TDesC& aSection);
+	void	DoCmdGetNearestFontToDesignHeightInPixelsL(const TDesC& aSection);
+	void	DoCmdGetNearestFontToMaxHeightInPixelsL(const TDesC& aSection);
+	void	DoCmdAddFile(const TDesC& aSection);
+	void	DoCmdInstallFile(const TDesC& aSection);
+	void	DoCmdRemoveFile(const TDesC& aSection);
+	void	DoCmdGetFontByIdL(const TDesC& aSection);
+	void	DoCmdFontHeightInPixels(const TDesC& aSection);
+	void	DoCmdDefaultBitmapType(const TDesC& aSection);
+	void	DoCmdSetDefaultBitmapType(const TDesC& aSection);
+	void	DoCmdSetFontNameAlias(const TDesC& aSection);
+	void	DoCmdSetDefaultLanguageForMetrics(const TDesC& aSection);
+	void	DoCmdRemoveFontFileLocks(const TDesC& aSection);
+	void	DoCmdSetSystemDefaultTypefaceName(const TDesC& aSection);
+
+private:
+	/** CFbsTypefaceStore class instance to work with*/
+    CFbsTypefaceStore*	iFbsTypefaceStore;
+
+    /** temporarily stored value of typeface file id. Set by AddFile() and InstallFile() for later use in RemoveFile() */
+    TInt				iLastTypefaceFileId;
+	};
+
+#endif /* __T_DATA_FBS_TYPEFACE_STORE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fbserv/inc/T_FBServAPIServer.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_FBServAPIServer
+*/
+
+#if (!defined __T_FBSERV_API_SERVER_H__)
+#define __T_FBSERV_API_SERVER_H__
+
+//	User Include
+#include "T_DataFbsSession.h"
+#include "T_DataFbsFont.h"
+#include "T_DataFbsBitmap.h"
+#include "T_DataBitmapUtil.h"
+#include "T_DataFbsTypefaceStore.h"
+#include "T_DataFbsColor256BitmapUtil.h"
+
+#include "T_DataPalette.h"
+#include "T_DataFbsBitmapDevice.h"
+#include "T_DataFbsScreenDevice.h"
+#include "T_DataAlgStyle.h"
+#include "T_DataMeasureTextInput.h"
+#include "T_DataMeasureTextOutput.h"
+
+#include "TestServerBase.h"
+
+class CT_FBServAPIServer : public CTestServerBase
+	{
+private:
+	class CT_FBServAPIBlock : public CTestBlockController
+		{
+	public:
+		inline CT_FBServAPIBlock();
+		inline ~CT_FBServAPIBlock();
+
+		inline CDataWrapper* CreateDataL( const TDesC& aData );
+		};
+public:
+	inline CT_FBServAPIServer();
+	inline ~CT_FBServAPIServer();
+
+	static CT_FBServAPIServer* NewL();
+
+	inline CTestBlockController*	CreateTestBlock();
+	};
+
+#include "T_FBServAPIServer.inl"
+
+#endif /* __T_FBSERV_API_SERVER_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fbserv/inc/T_FBServAPIServer.inl	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,112 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_FBServAPIServer inline functions
+*/
+
+
+_LIT(KRFbsSessionData, 			"RFbsSession");
+_LIT(KCFbsFontData, 			"CFbsFont");
+_LIT(KCFbsBitmapData, 			"CFbsBitmap");
+_LIT(KTBitmapUtilData, 			"TBitmapUtil");
+_LIT(KCFbsTypefaceStoreData,	"CFbsTypefaceStore");
+_LIT(KCFbsColor256BitmapUtil,	"CFbsColor256BitmapUtil");
+_LIT(KCPalette,					"CPalette");
+_LIT(KCFbsBitmapDevice,			"CFbsBitmapDevice");
+_LIT(KCFbsScreenDevice,			"CFbsScreenDevice");
+_LIT(KTAlgStyle,				"TAlgStyle");
+_LIT(KTMeasureTextInput,		"TMeasureTextInput");
+_LIT(KTMeasureTextOutput,		"TMeasureTextOutput");
+
+inline CT_FBServAPIServer::CT_FBServAPIBlock::CT_FBServAPIBlock()
+    {
+    }
+
+inline CT_FBServAPIServer::CT_FBServAPIBlock::~CT_FBServAPIBlock()
+    {
+    }
+
+inline CDataWrapper* CT_FBServAPIServer::CT_FBServAPIBlock::CreateDataL( const TDesC& aData )
+	{
+	CDataWrapper* wrapper = NULL;
+   	if (aData == KRFbsSessionData())
+   		{
+   		wrapper = CT_DataFbsSession::NewL();
+   		}
+   	else if (aData == KCFbsFontData())
+   		{
+   		wrapper = CT_DataFbsFont::NewL();
+   		}
+   	else if (aData == KCFbsBitmapData())
+   		{
+   		wrapper = CT_DataFbsBitmap::NewL();
+   		}
+   	else if (aData == KTBitmapUtilData())
+   		{
+   		wrapper = CT_DataBitmapUtil::NewL();
+   		}
+   	else if (aData == KCFbsTypefaceStoreData())
+   		{
+   		wrapper = CT_DataFbsTypefaceStore::NewL();
+   		}
+   	else if (aData == KCFbsColor256BitmapUtil())
+   		{
+   		wrapper = CT_DataFbsColor256BitmapUtil::NewL();
+   		}
+   	else if (aData == KCPalette())
+   		{
+   		wrapper = CT_DataPalette::NewL();
+   		}
+   	else if ( aData==KCFbsBitmapDevice() )
+   		{
+   		wrapper = CT_DataFbsBitmapDevice::NewL();
+   		}
+   	else if ( aData==KCFbsScreenDevice() )
+   		{
+   		wrapper = CT_DataFbsScreenDevice::NewL();
+   		}
+   	else if ( aData==KTAlgStyle() )
+   		{
+   		wrapper = CT_DataAlgStyle::NewL();
+   		}
+   	else if ( aData==KTMeasureTextInput() )
+   		{
+   		wrapper = CT_DataMeasureTextInput::NewL();
+   		}
+   	else if ( aData==KTMeasureTextOutput() )
+   		{
+   		wrapper = CT_DataMeasureTextOutput::NewL();
+   		}
+	return wrapper;
+	}
+
+inline CT_FBServAPIServer::CT_FBServAPIServer()
+    {
+    }
+
+inline CT_FBServAPIServer::~CT_FBServAPIServer()
+    {
+    }
+
+inline CTestBlockController*	CT_FBServAPIServer::CreateTestBlock()
+	{
+	return new CT_FBServAPIBlock();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fbserv/src/T_DataBitmapUtil.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,403 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataBitmapUtil
+*/
+
+//	User includes
+#include "T_DataBitmapUtil.h"
+#include "T_GraphicsUtil.h"
+
+/*@{*/
+///	Parameters
+_LIT(KBitmap,								"bitmap");
+_LIT(KPointX,								"point_x");
+_LIT(KPointY,								"point_y");
+_LIT(KOtherBitmapUtil,						"other_bitmap_util");
+_LIT(KColor,								"color");
+_LIT(KColorMask,							"colormask");
+
+///	Commands
+_LIT(KCmdNew,								"new");
+_LIT(KCmdBegin,								"Begin");
+_LIT(KCmdEnd,								"End");
+_LIT(KCmdSetPixel,							"SetPixel");
+_LIT(KCmdGetPixel,							"GetPixel");
+_LIT(KCmdSetPos,							"SetPos");
+_LIT(KCmdDecXPos,							"DecXPos");
+_LIT(KCmdDecYPos,							"DecYPos");
+_LIT(KCmdIncXPos,							"IncXPos");
+_LIT(KCmdIncYPos,							"IncYPos");
+_LIT(KCleanup,								"~");
+/*@}*/
+
+/**
+* Two phase constructor
+*/
+CT_DataBitmapUtil* CT_DataBitmapUtil::NewL()
+	{
+	CT_DataBitmapUtil*	ret = new (ELeave) CT_DataBitmapUtil();
+	return ret;
+	}
+
+/**
+* Protected constructor. First phase construction
+*/
+CT_DataBitmapUtil::CT_DataBitmapUtil()
+:	CDataWrapperBase()
+,	iBitmapUtil(NULL)
+	{
+	}
+
+/**
+* Protected desctructor
+*/
+CT_DataBitmapUtil::~CT_DataBitmapUtil()
+	{
+	DestroyData();
+	}
+
+/**
+* Contains cleanup implementation
+*/
+void CT_DataBitmapUtil::DestroyData()
+	{
+	delete iBitmapUtil;
+	iBitmapUtil = NULL;
+	}
+
+TAny* CT_DataBitmapUtil::GetObject()
+	{
+	return iBitmapUtil;
+	}
+
+void CT_DataBitmapUtil::SetObjectL(TAny* aObject)
+	{
+	DestroyData();
+	iBitmapUtil	= static_cast<TBitmapUtil*> (aObject);
+	}
+		
+void CT_DataBitmapUtil::DisownObjectL() 
+	{
+	iBitmapUtil = NULL;
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataBitmapUtil::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool	retVal = ETrue;
+
+	if (aCommand == KCmdNew)
+		{
+		DoCmdNewL(aSection);
+		}
+	else if (aCommand == KCmdBegin)
+		{
+		DoCmdBeginL(aSection);
+		}
+	else if (aCommand == KCmdEnd)
+		{
+		DoCmdEnd();
+		}
+	else if (aCommand == KCmdSetPixel)
+		{
+		DoCmdSetPixelL(aSection);
+		}
+	else if (aCommand == KCmdGetPixel)
+		{
+		DoCmdGetPixel(aSection);
+		}
+	else if (aCommand == KCmdSetPos)
+		{
+		DoCmdSetPos(aSection);
+		}
+	else if (aCommand == KCmdDecXPos)
+		{
+		DoCmdDecXPos();
+		}
+	else if (aCommand == KCmdDecYPos)
+		{
+		DoCmdDecYPos();
+		}
+	else if (aCommand == KCmdIncXPos)
+		{
+		DoCmdIncXPos();
+		}
+	else if (aCommand == KCmdIncYPos)
+		{
+		DoCmdIncYPos();
+		}
+	else if (aCommand == KCleanup)
+		{
+		DestroyData();
+		}
+	else
+		{
+		retVal=EFalse;
+		}
+
+	return retVal;
+	}
+
+
+
+/** Creates a TBitmapUtil instance */
+void CT_DataBitmapUtil::DoCmdNewL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Creates a TBitmapUtil instance"));
+
+	// get fbsBitmap passed as a parameter
+	CFbsBitmap*	fbsBitmap=NULL;
+	CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KBitmap(), fbsBitmap);
+
+	// cleanup if already created
+	delete iBitmapUtil;
+	iBitmapUtil = NULL;
+
+	// call new operator
+	TRAPD(err, iBitmapUtil = new (ELeave) TBitmapUtil(fbsBitmap));
+
+	// check error code
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(_L("Error creation instance: %d"), err);
+		SetError(err);
+		}
+	}
+
+
+/** Calls TBitmapUtil::Begin() */
+void CT_DataBitmapUtil::DoCmdBeginL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls TBitmapUtil::Begin()"));
+	TBool								dataOk=ETrue;
+
+	// get position x-coordinate from parameters
+	TInt	pointX;
+	if(!GetIntFromConfig(aSection, KPointX(), pointX))
+		{
+		ERR_PRINTF2(_L("No %S"), &KPointX());
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+
+	// get position y-coordinate from parameters
+	TInt	pointY;
+	if(!GetIntFromConfig(aSection, KPointY(), pointY))
+		{
+		ERR_PRINTF2(_L("No %S"), &KPointY());
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+
+	if ( dataOk )
+		{
+		// call Begin()
+		// get bitmapUtil passed as a parameter
+		CT_DataBitmapUtil*	bitmapUtilDataObject = CT_DataBitmapUtil::GetBitmapUtilDataObjectFromParameterL(*this, KOtherBitmapUtil(), aSection);
+
+		if (bitmapUtilDataObject == NULL)
+			{
+			iBitmapUtil->Begin(TPoint(pointX, pointY));
+			}
+		else
+			{
+			TBitmapUtil*	otherBitmapUtil = static_cast<TBitmapUtil*>(bitmapUtilDataObject->GetObject());
+
+			// call Begin()
+			iBitmapUtil->Begin(TPoint(pointX, pointY), *otherBitmapUtil);
+			}
+		}
+	}
+
+
+/** Calls TBitmapUtil::End() */
+void CT_DataBitmapUtil::DoCmdEnd()
+	{
+	INFO_PRINTF1(_L("Calls TBitmapUtil::End()"));
+
+	// call End()
+	iBitmapUtil->End();
+	}
+
+
+/** Calls TBitmapUtil::SetPixel() */
+void CT_DataBitmapUtil::DoCmdSetPixelL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls TBitmapUtil::SetPixel()"));
+
+	// get bitmapUtil passed as a parameter
+	CT_DataBitmapUtil*	bitmapUtilDataObject = CT_DataBitmapUtil::GetBitmapUtilDataObjectFromParameterL(*this, KOtherBitmapUtil(), aSection);
+
+	if (bitmapUtilDataObject == NULL)
+		{
+		// get color from parameters
+		TInt	color;
+		if(!GetIntFromConfig(aSection, KColor(), color))
+			{
+			ERR_PRINTF2(_L("No %S"), &KColor());
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			// call SetPixel()
+			iBitmapUtil->SetPixel(TUint32(color));
+			}
+		}
+	else
+		{
+		TBitmapUtil* otherBitmapUtil = static_cast<TBitmapUtil*>(bitmapUtilDataObject->GetObject());
+
+		// call SetPixel()
+		iBitmapUtil->SetPixel(*otherBitmapUtil);
+		}
+	}
+
+
+/** Calls TBitmapUtil::GetPixel() */
+void CT_DataBitmapUtil::DoCmdGetPixel(const TDesC& aSection)
+	{
+	// call GetPixel()
+	TUint32	color = iBitmapUtil->GetPixel();
+	INFO_PRINTF2(_L("Calls TBitmapUtil::GetPixel() %d"), color);
+
+	TInt	colorMask;
+	if ( GetHexFromConfig(aSection, KColorMask(), colorMask) )
+		{
+		color &= colorMask;
+		INFO_PRINTF2(_L("Color after masking %d"), color);
+		}
+
+	// get expected color from parameters
+	TInt	expectedColor;
+	if(GetIntFromConfig(aSection, KColor(), expectedColor))
+		{
+		// check that the value is as expected
+		if (color != (TUint32)expectedColor )
+			{
+			ERR_PRINTF3(_L("The value is not as expected! expected: %d, actual: %d"), expectedColor, color);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/** Calls TBitmapUtil::SetPos() */
+void CT_DataBitmapUtil::DoCmdSetPos(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls TBitmapUtil::SetPos()"));
+	TBool								dataOk=ETrue;
+
+	// get position x-coordinate from parameters
+	TInt	pointX;
+	if(!GetIntFromConfig(aSection, KPointX(), pointX))
+		{
+		ERR_PRINTF2(_L("No %S"), &KPointX());
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+
+	// get position y-coordinate from parameters
+	TInt	pointY;
+	if(!GetIntFromConfig(aSection, KPointY(), pointY))
+		{
+		ERR_PRINTF2(_L("No %S"), &KPointY());
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+
+	if ( dataOk )
+		{
+		// call SetPos()
+		iBitmapUtil->SetPos(TPoint(pointX, pointY));
+		}
+	}
+
+
+/** Calls TBitmapUtil::DecXPos() */
+void CT_DataBitmapUtil::DoCmdDecXPos()
+	{
+	INFO_PRINTF1(_L("Calls TBitmapUtil::DecXPos()"));
+
+	// call DecXPos()
+	iBitmapUtil->DecXPos();
+	}
+
+
+/** Calls TBitmapUtil::DecYPos() */
+void CT_DataBitmapUtil::DoCmdDecYPos()
+	{
+	INFO_PRINTF1(_L("Calls TBitmapUtil::DecYPos()"));
+
+	// call DecYPos()
+	iBitmapUtil->DecYPos();
+	}
+
+
+/** Calls TBitmapUtil::IncXPos() */
+void CT_DataBitmapUtil::DoCmdIncXPos()
+	{
+	INFO_PRINTF1(_L("Calls TBitmapUtil::IncXPos()"));
+
+	// call IncXPos()
+	iBitmapUtil->IncXPos();
+	}
+
+
+/** Calls TBitmapUtil::IncYPos() */
+void CT_DataBitmapUtil::DoCmdIncYPos()
+	{
+	INFO_PRINTF1(_L("Calls TBitmapUtil::IncYPos()"));
+
+	// call IncYPos()
+	iBitmapUtil->IncYPos();
+	}
+
+
+
+///////////////////////////////// UTIL METHODS //////////////////////////////////////
+
+
+/**
+* Utility method that fetches CT_DataBitmapUtil pointer by command parameter name from INI-file.
+*/
+CT_DataBitmapUtil* CT_DataBitmapUtil::GetBitmapUtilDataObjectFromParameterL(CDataWrapper& aDataWrapper, const TDesC& aParameterName, const TDesC& aSection)
+	{
+	// get AlgStyleData object from parameters
+	CT_DataBitmapUtil*	ret=NULL;
+
+	TPtrC bitmapUtilDataObjectName;
+	// get BitmapUtilData object from parameters
+	if ( aDataWrapper.GetStringFromConfig(aSection, aParameterName, bitmapUtilDataObjectName) )
+		{
+		// check that the data object was found
+		ret=static_cast<CT_DataBitmapUtil*>(aDataWrapper.GetDataWrapperL(bitmapUtilDataObjectName));
+		}
+
+	return ret;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fbserv/src/T_DataFbsBitmap.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,2294 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+v
+This contains CT_DataFbsBitmap
+*/
+
+//	User includes
+#include "T_DataFbsBitmap.h"
+#include "T_GraphicsUtil.h"
+
+
+/*@{*/
+///	Parameters
+_LIT(KAlways,								"always");
+_LIT(KBitmapId,								"bitmap_id");
+_LIT(KBuffLength,							"buff_length");
+_LIT(KDitherOffsetX,						"dither_offset_x");
+_LIT(KDitherOffsetY,						"dither_offset_y");
+_LIT(KExpectedBool,							"expected_bool");
+_LIT(KExpectedInt,							"expected_int");
+_LIT(KFbsBitmapName,						"fbs_bitmap_name");
+_LIT(KFileName,								"file_name");
+_LIT(KFileOffset,							"file_offset");
+_LIT(KHeight,								"height");
+_LIT(KHandle,								"handle");
+_LIT(KWidth,								"width");
+_LIT(KLength,								"length");
+_LIT(KNullExpected,							"null_expected");
+_LIT(KDevice,								"device");
+_LIT(KNumberOfSources,						"number_of_sources");
+_LIT(KPixels,								"pixels");
+_LIT(KPointX,								"point_x");
+_LIT(KPointY,								"point_y");
+_LIT(KRectTlX,								"rect_tl_x");
+_LIT(KRectTlY,								"rect_tl_y");
+_LIT(KRectBrX,								"rect_br_x");
+_LIT(KRectBrY,								"rect_br_y");
+_LIT(KScanLineCoord,						"scan_line_coord");
+_LIT(KSourceFileName0,						"source_file_name_0"); // we don't need more than 3 sources for our test anyway.
+_LIT(KSourceFileName1,						"source_file_name_1"); // So that this solution is ok
+_LIT(KSourceFileName2,						"source_file_name_2");
+_LIT(KSourceBitmapId0,						"source_bitmap_id_0");
+_LIT(KSourceBitmapId1,						"source_bitmap_id_1");
+_LIT(KSourceBitmapId2,						"source_bitmap_id_2");
+_LIT(KShareIfLoaded,						"share_if_loaded");
+_LIT(KTwips,								"twips");
+_LIT(KUseDitherOffset,						"use_dither_offset");
+_LIT(KUseRFile,								"use_rfile");
+_LIT(KUseClosedRFile,						"use_closed_rfile");
+_LIT(KUseClosedStream,						"use_closed_stream");
+_LIT(KUseRequestStatus,						"use_request_status");
+_LIT(KUid,									"uid");
+_LIT(KPalette,								"palette");
+_LIT(KModifiable,							"modifiable");
+_LIT(KEntries,								"entries");
+_LIT(KRed,									"red");
+_LIT(KGreen,								"green");
+_LIT(KBlue,									"blue");
+_LIT(KDisplayMode,							"displaymode");
+_LIT(KBitmapfileCompressionScheme,			"bitmap_compression_scheme");
+
+///	Commands
+_LIT(KCmdDisown,								"disown");
+_LIT(KCmdNew,								"new");
+_LIT(KCmdDestructor,						"~");
+_LIT(KCmdCompress,							"Compress");
+_LIT(KCmdCompressInBackground,				"CompressInBackground");
+_LIT(KCmdCreate,							"Create");
+_LIT(KCmdCreateHardwareBitmap,				"CreateHardwareBitmap");
+_LIT(KCmdDataAddress,						"DataAddress");
+_LIT(KCmdDataStride,						"DataStride");
+_LIT(KCmdDisplayMode,						"DisplayMode");
+_LIT(KCmdDuplicate,							"Duplicate");
+_LIT(KCmdExternalizeL,						"ExternalizeL");
+_LIT(KCmdExternalizeRectangleL,				"ExternalizeRectangleL");
+_LIT(KCmdGetPalette,						"GetPalette");
+_LIT(KCmdGetPixel,							"GetPixel");
+_LIT(KCmdGetScanLine,						"GetScanLine");
+_LIT(KCmdGetVerticalScanLine,				"GetVerticalScanLine");
+_LIT(KCmdHandle,							"Handle");
+_LIT(KCmdHardwareBitmapHandle,				"HardwareBitmapHandle");
+_LIT(KCmdHeader,							"Header");
+_LIT(KCmdHorizontalPixelsToTwips,			"HorizontalPixelsToTwips");
+_LIT(KCmdHorizontalTwipsToPixels,			"HorizontalTwipsToPixels");
+_LIT(KCmdInitialDisplayMode,				"InitialDisplayMode");
+_LIT(KCmdInternalizeL,						"InternalizeL");
+_LIT(KCmdIsCompressedInRAM,					"IsCompressedInRAM");
+_LIT(KCmdIsFileInRom,						"IsFileInRom");
+_LIT(KCmdIsLargeBitmap,						"IsLargeBitmap");
+_LIT(KCmdIsMonochrome,						"IsMonochrome");
+_LIT(KCmdIsRomBitmap,						"IsRomBitmap");
+_LIT(KCmdLoad,								"Load");
+_LIT(KCmdLoadAndCompress,					"LoadAndCompress");
+_LIT(KCmdLockHeap,							"LockHeap");
+_LIT(KCmdLockHeapLC,						"LockHeapLC");
+_LIT(KCmdPaletteAttributes,					"PaletteAttributes");
+_LIT(KCmdReset,								"Reset");
+_LIT(KCmdResize,							"Resize");
+_LIT(KCmdSave,								"Save");
+_LIT(KCmdScanLineLength,					"ScanLineLength");
+_LIT(KCmdSetDisplayMode,					"SetDisplayMode");
+_LIT(KCmdSetPalette,						"SetPalette");
+_LIT(KCmdSetRomBitmapL,						"SetRomBitmapL");
+_LIT(KCmdSetScanLine,						"SetScanLine");
+_LIT(KCmdSetSizeInTwips,					"SetSizeInTwips");
+_LIT(KCmdSizeInPixels,						"SizeInPixels");
+_LIT(KCmdSizeInTwips,						"SizeInTwips");
+_LIT(KCmdStoreL,							"StoreL");
+_LIT(KCmdSwapWidthAndHeight,				"SwapWidthAndHeight");
+_LIT(KCmdUnlockHeap,						"UnlockHeap");
+_LIT(KCmdVerticalPixelsToTwips,				"VerticalPixelsToTwips");
+_LIT(KCmdVerticalTwipsToPixels,				"VerticalTwipsToPixels");
+
+//??	SetRomBitmapL
+//	Begin
+//	End
+//	GetDecompressionBuffer
+//	GetAllBitmapHandles
+/*@}*/
+
+/**
+* Two phase constructor
+*/
+CT_DataFbsBitmap* CT_DataFbsBitmap::NewL()
+	{
+	CT_DataFbsBitmap* ret = new (ELeave) CT_DataFbsBitmap();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+/**
+* Protected constructor. First phase construction
+*/
+CT_DataFbsBitmap::CT_DataFbsBitmap()
+:	CDataWrapperBase()
+,	iFbsBitmap(NULL)
+,	iDisplayMode(ENone)
+,	iPopWhenUnlocking(EFalse)
+,	iCompressFailed(EFalse)
+,	iActiveCompressInBackground(NULL)
+	{
+	}
+
+/**
+* Protected constructor. Second phase construction
+*/
+void CT_DataFbsBitmap::ConstructL()
+	{
+	iActiveCompressInBackground=CActiveCallback::NewL(*this);
+	}
+
+/**
+* Destructor.
+*/
+CT_DataFbsBitmap::~CT_DataFbsBitmap()
+	{
+	DestroyData();
+	delete iActiveCompressInBackground;
+	iActiveCompressInBackground=NULL;
+	}
+
+/**
+* Contains cleanup implementation
+*/
+void CT_DataFbsBitmap::DestroyData()
+	{
+	delete iFbsBitmap;
+	iFbsBitmap=NULL;
+	}
+
+/**
+* Return a pointer to the object that the data wraps
+*
+* @return pointer to the object that the data wraps
+*/
+TAny* CT_DataFbsBitmap::GetObject()
+	{
+	return iFbsBitmap;
+	}
+
+void CT_DataFbsBitmap::SetObjectL(TAny* aAny)
+    {
+    DestroyData();
+    iFbsBitmap=static_cast<CFbsBitmap*> (aAny);
+    }
+
+void CT_DataFbsBitmap::DisownObjectL()
+	{
+	iFbsBitmap=NULL;
+	}
+
+CFbsBitmap* CT_DataFbsBitmap::GetFbsBitmap() const
+	{
+	return iFbsBitmap;
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataFbsBitmap::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	retVal = ETrue;
+
+	if (aCommand == KCmdNew)
+		{
+		DoCmdNewL();
+		}
+	else if (aCommand == KCmdDestructor)
+		{
+		DoCmdDestructor();
+		}
+	else if (aCommand == KCmdCompress)
+		{
+		DoCmdCompress(aSection);
+		}
+	else if (aCommand == KCmdCompressInBackground)
+		{
+		DoCmdCompressInBackground(aSection, aAsyncErrorIndex);
+		}
+	else if (aCommand == KCmdCreate)
+		{
+		DoCmdCreate(aSection);
+		}
+	else if (aCommand == KCmdCreateHardwareBitmap)
+		{
+		DoCmdCreateHardwareBitmap(aSection);
+		}
+	else if (aCommand == KCmdDataAddress)
+		{
+		DoCmdDataAddress(aSection);
+		}
+	else if (aCommand == KCmdDataStride)
+		{
+		DoCmdDataStride(aSection);
+		}
+	else if (aCommand == KCmdDisplayMode)
+		{
+		DoCmdDisplayMode(aSection);
+		}
+	else if (aCommand == KCmdDuplicate)
+		{
+		DoCmdDuplicateL(aSection);
+		}
+	else if (aCommand == KCmdExternalizeL)
+		{
+		DoCmdExternalizeL(aSection);
+		}
+	else if (aCommand == KCmdExternalizeRectangleL)
+		{
+		DoCmdExternalizeRectangleL(aSection);
+		}
+	else if (aCommand == KCmdGetPalette)
+		{
+		DoCmdGetPaletteL(aSection);
+		}
+	else if (aCommand == KCmdGetPixel)
+		{
+		DoCmdGetPixel(aSection);
+		}
+	else if (aCommand == KCmdGetScanLine)
+		{
+		DoCmdGetScanLineL(aSection);
+		}
+	else if (aCommand == KCmdGetVerticalScanLine)
+		{
+		DoCmdGetVerticalScanLineL(aSection);
+		}
+	else if (aCommand == KCmdHandle)
+		{
+		DoCmdHandle(aSection);
+		}
+	else if (aCommand == KCmdHardwareBitmapHandle)
+		{
+		DoCmdHardwareBitmapHandle(aSection);
+		}
+	else if (aCommand == KCmdHeader)
+		{
+		DoCmdHeader();
+		}
+	else if (aCommand == KCmdHorizontalPixelsToTwips)
+		{
+		DoCmdHorizontalPixelsToTwips(aSection);
+		}
+	else if (aCommand == KCmdHorizontalTwipsToPixels)
+		{
+		DoCmdHorizontalTwipsToPixels(aSection);
+		}
+	else if (aCommand == KCmdInitialDisplayMode)
+		{
+		DoCmdInitialDisplayMode(aSection);
+		}
+	else if (aCommand == KCmdInternalizeL)
+		{
+		DoCmdInternalizeL(aSection);
+		}
+	else if (aCommand == KCmdIsCompressedInRAM)
+		{
+		DoCmdIsCompressedInRAM(aSection);
+		}
+	else if (aCommand == KCmdIsFileInRom)
+		{
+		DoCmdIsFileInRom(aSection);
+		}
+	else if (aCommand == KCmdIsLargeBitmap)
+		{
+		DoCmdIsLargeBitmap(aSection);
+		}
+	else if (aCommand == KCmdIsMonochrome)
+		{
+		DoCmdIsMonochrome(aSection);
+		}
+	else if (aCommand == KCmdIsRomBitmap)
+		{
+		DoCmdIsRomBitmap(aSection);
+		}
+	else if (aCommand == KCmdLoad)
+		{
+		DoCmdLoadL(aSection);
+		}
+	else if (aCommand == KCmdLoadAndCompress)
+		{
+		DoCmdLoadAndCompressL(aSection);
+		}
+	else if (aCommand == KCmdLockHeap)
+		{
+		DoCmdLockHeap(aSection);
+		}
+	else if (aCommand == KCmdLockHeapLC)
+		{
+		DoCmdLockHeapLC(aSection);
+		}
+	else if (aCommand == KCmdPaletteAttributes)
+		{
+		DoCmdPaletteAttributes(aSection);
+		}
+	else if (aCommand == KCmdReset)
+		{
+		DoCmdReset();
+		}
+	else if (aCommand == KCmdResize)
+		{
+		DoCmdResize(aSection);
+		}
+	else if (aCommand == KCmdSave)
+		{
+		DoCmdSave(aSection);
+		}
+	else if (aCommand == KCmdScanLineLength)
+		{
+		DoCmdScanLineLength(aSection);
+		}
+	else if (aCommand == KCmdSetDisplayMode)
+		{
+		DoCmdSetDisplayMode(aSection);
+		}
+	else if (aCommand == KCmdSetPalette)
+		{
+		DoCmdSetPaletteL(aSection);
+		}
+	else if (aCommand == KCmdSetRomBitmapL)
+		{
+		DoCmdSetRomBitmapL(aSection);
+		}
+	else if (aCommand == KCmdSetScanLine)
+		{
+		DoCmdSetScanLineL(aSection);
+		}
+	else if (aCommand == KCmdSetSizeInTwips)
+		{
+		DoCmdSetSizeInTwipsL(aSection);
+		}
+	else if (aCommand == KCmdSizeInPixels)
+		{
+		DoCmdSizeInPixels(aSection);
+		}
+	else if (aCommand == KCmdSizeInTwips)
+		{
+		DoCmdSizeInTwips(aSection);
+		}
+	else if (aCommand == KCmdStoreL)
+		{
+		DoCmdStoreL(aSection);
+		}
+	else if (aCommand == KCmdSwapWidthAndHeight)
+		{
+		DoCmdSwapWidthAndHeight();
+		}
+	else if (aCommand == KCmdUnlockHeap)
+		{
+		DoCmdUnlockHeapL(aSection);
+		}
+	else if (aCommand == KCmdVerticalPixelsToTwips)
+		{
+		DoCmdVerticalPixelsToTwips(aSection);
+		}
+	else if (aCommand == KCmdVerticalTwipsToPixels)
+		{
+		DoCmdVerticalTwipsToPixels(aSection);
+		}
+	else if (aCommand == KCmdDisown)
+   {
+   DisownObjectL();
+   }
+	else
+		{
+		retVal=EFalse;
+		}
+
+	return retVal;
+	}
+
+
+/** Creates new CFbsBitmap class instance */
+void CT_DataFbsBitmap::DoCmdNewL()
+	{
+	INFO_PRINTF1(_L("Creates new CFbsBitmap class instance"));
+
+	// cleanup if already created
+    DestroyData();
+	iFbsBitmap=new (ELeave) CFbsBitmap();
+	}
+
+/** Calls static CFbsBitmap destructor */
+void CT_DataFbsBitmap::DoCmdDestructor()
+	{
+	DestroyData();
+	}
+
+/** Calls CFbsBitmap::Compress() */
+void CT_DataFbsBitmap::DoCmdCompress(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::Compress()"));
+
+	TInt							err=KErrNone;
+	TBitmapfileCompressionScheme	compressionScheme;
+	if ( CT_GraphicsUtil::ReadBitmapfileCompressionScheme(*this, aSection, KBitmapfileCompressionScheme(), compressionScheme) )
+		{
+		err=GetFbsBitmap()->Compress(compressionScheme);
+		}
+	else
+		{
+		// call Compress()
+		err=GetFbsBitmap()->Compress();
+		}
+	// check error code
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(_L("Compress error: %d"), err);
+		SetError(err);
+		iCompressFailed = ETrue;
+		}
+	else
+	    {
+	    iCompressFailed = EFalse;
+	    };
+	}
+
+/** Calls CFbsBitmap::CompressInBackground() */
+void CT_DataFbsBitmap::DoCmdCompressInBackground(const TDesC& aSection, const TInt aAsyncErrorIndex)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::CompressInBackground()"));
+
+	// get a flag if to use requset status from parameters
+	TBool	useRequestStatus = EFalse;
+	GetBoolFromConfig(aSection, KUseRequestStatus(), useRequestStatus);
+
+	TBitmapfileCompressionScheme	compressionScheme;
+	TBool							hasCompressionScheme=CT_GraphicsUtil::ReadBitmapfileCompressionScheme(*this, aSection, KBitmapfileCompressionScheme(), compressionScheme);
+
+	// call CompressInBackground()
+	if ( useRequestStatus )
+		{
+		if ( hasCompressionScheme )
+			{
+			GetFbsBitmap()->CompressInBackground(iActiveCompressInBackground->iStatus, compressionScheme);
+			}
+		else
+			{
+			GetFbsBitmap()->CompressInBackground(iActiveCompressInBackground->iStatus);
+			}
+		iActiveCompressInBackground->Activate(aAsyncErrorIndex);
+		IncOutstanding();
+		}
+	else
+		{
+		TInt	err = KErrNone;
+
+		if ( hasCompressionScheme )
+			{
+			err=GetFbsBitmap()->CompressInBackground(compressionScheme);
+			}
+		else
+			{
+			err=GetFbsBitmap()->CompressInBackground();
+			}
+
+		// check error code
+		if ( err != KErrNone )
+			{
+			ERR_PRINTF2(_L("Compress in background error: %d"), err);
+			SetError(err);
+			iCompressFailed = ETrue;
+			}
+		else
+		    {
+		    iCompressFailed = EFalse;
+		    }
+		}
+	}
+
+/** Calls CFbsBitmap::Create() */
+void CT_DataFbsBitmap::DoCmdCreate(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::Create()"));
+
+	// get size height from parameters
+	TInt	height;
+	if(!GetIntFromConfig(aSection, KHeight(), height))
+		{
+		ERR_PRINTF2(_L("No %S"), &KHeight());
+		SetBlockResult(EFail);
+		}
+
+	// get size width from parameters
+	TInt	width;
+	if(!GetIntFromConfig(aSection, KWidth(), width))
+		{
+		ERR_PRINTF2(_L("No %S"), &KWidth());
+		SetBlockResult(EFail);
+		}
+
+	// get display mode from parameters
+
+	TDisplayMode	displayMode;
+	if ( !CT_GraphicsUtil::ReadDisplayMode(*this, aSection, KDisplayMode(), displayMode) )
+		{
+		ERR_PRINTF1(_L("No display mode"));
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// call Create()
+		TInt	err = GetFbsBitmap()->Create(TSize(width, height), displayMode);
+
+		// check error code
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(_L("Creation error: %d"), err);
+			SetError(err);
+			}
+		}
+	}
+
+/** Calls CFbsBitmap::CreateHardwareBitmap() */
+void CT_DataFbsBitmap::DoCmdCreateHardwareBitmap(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::CreateHardwareBitmap()"));
+
+	// get size height from parameters
+	TInt	height;
+	if(!GetIntFromConfig(aSection, KHeight(), height))
+		{
+		ERR_PRINTF2(_L("No %S"), &KHeight());
+		SetBlockResult(EFail);
+		}
+
+	// get size width from parameters
+	TInt	width;
+	if(!GetIntFromConfig(aSection, KWidth(), width))
+		{
+		ERR_PRINTF2(_L("No %S"), &KWidth());
+		SetBlockResult(EFail);
+		}
+
+	// get display mode from parameters
+	TDisplayMode	displayMode;
+	if ( !CT_GraphicsUtil::ReadDisplayMode(*this, aSection, KDisplayMode(), displayMode) )
+		{
+		ERR_PRINTF1(_L("No display mode"));
+		SetBlockResult(EFail);
+		}
+
+	// get application uid from parameters
+	TInt	uidInt;
+	if(!GetIntFromConfig(aSection, KUid(), uidInt))
+		{
+		ERR_PRINTF2(_L("No %S"), &KUid());
+		SetBlockResult(EFail);
+		}
+
+	// call Create()
+	TInt	err = GetFbsBitmap()->CreateHardwareBitmap(TSize(width, height), displayMode, TUid::Uid(uidInt));
+
+	// check error code
+	if ( err != KErrNone )
+		{
+		ERR_PRINTF2(_L("Hardware bitmap creation error: %d"), err);
+		SetError(err);
+		}
+	}
+
+/** Calls CFbsBitmap::DataAddress() locking and unlocking heap by defined in parameters means */
+void CT_DataFbsBitmap::DoCmdDataAddress(const TDesC& aSection)
+	{
+	// call DataAddress()
+	TUint32*	address=GetFbsBitmap()->DataAddress();
+	INFO_PRINTF2(_L("DataAddress %d"), address);
+
+	// validate returned value if needed
+	TInt	expectedValue;
+	if(GetIntFromConfig(aSection, KExpectedInt(), expectedValue))
+		{
+		if (expectedValue != (TInt)address)
+			{
+			ERR_PRINTF1(_L("The returned value is not as expected"));
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/** Calls CFbsBitmap::DataStride() */
+void CT_DataFbsBitmap::DoCmdDataStride(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::DataStride()"));
+	
+	// call DataStride()
+	TInt value = GetFbsBitmap()->DataStride();
+	INFO_PRINTF2(_L("Data stride: %d"), value);
+
+	// validate returned value if needed
+	TInt expectedValue;
+	if(GetIntFromConfig(aSection, KExpectedInt(), expectedValue))
+		{
+		if (expectedValue != value)
+			{
+			ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedValue, value);
+			SetBlockResult(EFail);
+			}
+		}
+
+	// check the value is not NULL
+	if (value <= 0)
+		{
+		ERR_PRINTF2(_L("The data stride is not expected zero or less, value: %d"), value);
+		SetBlockResult(EFail);
+		}
+	}
+
+/** Checks CFbsBitmap::DisplayMode() value */
+void CT_DataFbsBitmap::DoCmdDisplayMode(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Checks CFbsBitmap::DisplayMode() value"));
+
+	// call DisplayMode()
+	iDisplayMode=GetFbsBitmap()->DisplayMode();
+	INFO_PRINTF2(_L("Display Mode %d"), iDisplayMode);
+
+	// get display mode from parameters
+	TDisplayMode	expectedValue;
+	if ( CT_GraphicsUtil::ReadDisplayMode(*this, aSection, KDisplayMode(), expectedValue) )
+		{
+		// check value against NULL
+		if ( iDisplayMode!=expectedValue )
+			{
+			ERR_PRINTF3(_L("The value is not as expected! expected: %d, actual: %d"), expectedValue, iDisplayMode);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/** Calls CFbsBitmap::Duplicate() */
+void CT_DataFbsBitmap::DoCmdDuplicateL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::Duplicate()"));
+	TInt	handle=GetHandle();
+	TPtrC	objectName;
+	if ( GetStringFromConfig(aSection, KFbsBitmapName(), objectName) )
+		{
+		CDataWrapperBase*	wrapper=static_cast<CDataWrapperBase*>(GetDataWrapperL(objectName));
+		handle=wrapper->GetHandle();
+		}
+	else
+		{
+		GetIntFromConfig(aSection, KHandle(), handle);
+		}
+
+	// call Duplicate()
+	TInt	err = GetFbsBitmap()->Duplicate(handle);
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(_L("Duplicate error: %d"), err);
+		SetError(err);
+		}
+	}
+
+/** Calls CFbsBitmap::ExternalizeL() */
+void CT_DataFbsBitmap::DoCmdExternalizeL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::ExternalizeL()"));
+	ExternalizeImplL(aSection, TRect(), EFalse);
+	}
+
+/** Calls CFbsBitmap::ExternalizeRectangleL() */
+void CT_DataFbsBitmap::DoCmdExternalizeRectangleL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::ExternalizeRectangleL()"));
+
+	// get rectangle top left x-coordinate from parameters
+	TInt	tlx;
+	if(!GetIntFromConfig(aSection, KRectTlX(), tlx))
+		{
+		ERR_PRINTF2(_L("No %S"), &KRectTlX());
+		SetBlockResult(EFail);
+		}
+
+	// get rectangle top left x-coordinate from parameters
+	TInt	tly;
+	if(!GetIntFromConfig(aSection, KRectTlY(), tly))
+		{
+		ERR_PRINTF2(_L("No %S"), &KRectTlY());
+		SetBlockResult(EFail);
+		}
+
+	// get rectangle top left x-coordinate from parameters
+	TInt	brx;
+	if(!GetIntFromConfig(aSection, KRectBrX(), brx))
+		{
+		ERR_PRINTF2(_L("No %S"), &KRectBrX());
+		SetBlockResult(EFail);
+		}
+
+	// get rectangle top left x-coordinate from parameters
+	TInt	bry;
+	if(!GetIntFromConfig(aSection, KRectBrY(), bry))
+		{
+		ERR_PRINTF2(_L("No %S"), &KRectBrY());
+		SetBlockResult(EFail);
+		}
+
+	ExternalizeImplL(aSection, TRect(tlx, tly, brx, bry), ETrue);
+	}
+
+/** Calls CFbsBitmap::GetPalette() */
+void CT_DataFbsBitmap::DoCmdGetPaletteL(const TDesC& aSection)
+	{
+	// call GetPalette()
+	CPalette*	palette = NULL;
+	TInt		err = GetFbsBitmap()->GetPalette(palette);
+	INFO_PRINTF2(_L("Calls CFbsBitmap::GetPalette() %d"), palette);
+
+	// check error code
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(_L("GetPalette error: %d"), err);
+		SetError(err);
+		}
+	else
+		{
+		//	Verify palette
+		CPalette*	expectedPalette = NULL;
+
+		if ( CT_GraphicsUtil::GetPaletteL(*this, aSection, KPalette(), expectedPalette) )
+			{
+			if ( palette != expectedPalette )
+				{
+				ERR_PRINTF3(_L("GetPalette palette %d not the expected palette %d"), palette, expectedPalette);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+/** Calls CFbsBitmap::GetPixel() */
+void CT_DataFbsBitmap::DoCmdGetPixel(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::GetPixel()"));
+
+	// get point x-coordinate from parameters
+	TInt	pointX;
+	if(!GetIntFromConfig(aSection, KPointX(), pointX))
+		{
+		ERR_PRINTF2(_L("No %S"), &KPointX());
+		SetBlockResult(EFail);
+		}
+
+	// get point y-coordinate from parameters
+	TInt	pointY;
+	if(!GetIntFromConfig(aSection, KPointY(), pointY))
+		{
+		ERR_PRINTF2(_L("No %S"), &KPointY());
+		SetBlockResult(EFail);
+		}
+
+	// call GetPixel()
+	TRgb	color;
+	GetFbsBitmap()->GetPixel(color, TPoint(pointX, pointY));
+
+	INFO_PRINTF2(_L("Red    %d"), color.Red());
+	INFO_PRINTF2(_L("Green  %d"), color.Green());
+	INFO_PRINTF2(_L("Blue   %d"), color.Blue());
+
+	TInt	actual;
+	TInt	expected;
+
+	if(GetIntFromConfig(aSection, KRed(), expected))
+		{
+		actual=color.Red();
+		if ( expected != actual )
+			{
+			ERR_PRINTF3(_L("Expected Red %d does not match actual %d"), expected, actual);
+			SetBlockResult(EFail);
+			}
+		}
+
+	if(GetIntFromConfig(aSection, KGreen(), expected))
+		{
+		actual=color.Green();
+		if ( expected != actual )
+			{
+			ERR_PRINTF3(_L("Expected Green %d does not match actual %d"), expected, actual);
+			SetBlockResult(EFail);
+			}
+		}
+	
+	if(GetIntFromConfig(aSection, KBlue(), expected))
+		{
+		actual=color.Blue();
+		if ( expected != actual )
+			{
+			ERR_PRINTF3(_L("Expected Blue %d does not match actual %d"), expected, actual);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/** Calls CFbsBitmap::GetScanLine() */
+void CT_DataFbsBitmap::DoCmdGetScanLineL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::GetScanLine()"));
+	TBool								dataOk=ETrue;
+
+	// get point x coordinate from parameters
+	TInt	pointX = 0;
+	if(!GetIntFromConfig(aSection, KPointX(), pointX))
+		{
+		ERR_PRINTF2(_L("No %S"), &KPointX());
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+
+	// get point y coordinate from parameters
+	TInt	pointY = 0;
+	if(!GetIntFromConfig(aSection, KPointY(), pointY))
+		{
+		ERR_PRINTF2(_L("No %S"), &KPointY());
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+
+	// get length from parameters
+	TInt	length = 0;
+	if(!GetIntFromConfig(aSection, KLength(), length))
+		{
+		ERR_PRINTF2(_L("No %S"), &KLength());
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+
+	// get buffer length from parameters
+	TInt	buffLength = 0;
+	if(!GetIntFromConfig(aSection, KBuffLength(), buffLength))
+		{
+		ERR_PRINTF2(_L("No %S"), &KBuffLength());
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+
+	// get display mode from parameters
+	TDisplayMode	displayMode;
+	if ( !CT_GraphicsUtil::ReadDisplayMode(*this, aSection, KDisplayMode(), displayMode) )
+		{
+		ERR_PRINTF1(_L("No display mode"));
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+
+	if ( dataOk )
+		{
+		// call GetScanLine()
+		TUint8*	buffer = new (ELeave) TUint8[buffLength];
+		TPtr8	scanline(buffer, buffLength, buffLength);
+
+		GetFbsBitmap()->GetScanLine(scanline, TPoint(pointX, pointY), length, displayMode);
+
+		delete [] buffer;
+		}
+	}
+
+/** Calls CFbsBitmap::GetVerticalScanLine() */
+void CT_DataFbsBitmap::DoCmdGetVerticalScanLineL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::GetVerticalScanLine()"));
+	TBool								dataOk=ETrue;
+
+	// get point x coordinate from parameters
+	TInt	pointX = 0;
+	if(!GetIntFromConfig(aSection, KPointX(), pointX))
+		{
+		ERR_PRINTF2(_L("No %S"), &KPointX());
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+
+	// get if to use dither offset flag from parameters
+	TBool	useDitherOffset = EFalse;
+	if(!GetBoolFromConfig(aSection, KUseDitherOffset(), useDitherOffset))
+		{
+		ERR_PRINTF2(_L("No %S"), &KUseDitherOffset());
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+
+	// get dither offset x coordinate from parameters
+	TInt	ditherOffsetX = 0;
+	if(useDitherOffset && !GetIntFromConfig(aSection, KDitherOffsetX(), ditherOffsetX))
+		{
+		ERR_PRINTF2(_L("No %S"), &KDitherOffsetX());
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+
+	// get dither offset y coordinate from parameters
+	TInt	ditherOffsetY = 0;
+	if(useDitherOffset && !GetIntFromConfig(aSection, KDitherOffsetY(), ditherOffsetY))
+		{
+		ERR_PRINTF2(_L("No %S"), &KDitherOffsetY());
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+
+	// get buffer length from parameters
+	TInt	buffLength = 0;
+	if(!GetIntFromConfig(aSection, KBuffLength(), buffLength))
+		{
+		ERR_PRINTF2(_L("No %S"), &KBuffLength());
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+
+	// get display mode from parameters
+	TDisplayMode	displayMode;
+	if ( !CT_GraphicsUtil::ReadDisplayMode(*this, aSection, KDisplayMode(), displayMode) )
+		{
+		ERR_PRINTF1(_L("No display mode"));
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+
+	if ( dataOk )
+		{
+		// call GetVerticalScanLine()
+		TUint8*	buffer = new (ELeave) TUint8[buffLength];
+		TPtr8 	scanline(buffer, buffLength, buffLength);
+
+		if (useDitherOffset)
+			{
+			GetFbsBitmap()->GetVerticalScanLine(scanline, pointX, displayMode);
+			}
+		else
+			{
+			GetFbsBitmap()->GetVerticalScanLine(scanline, pointX, TPoint(ditherOffsetX, ditherOffsetY), displayMode);
+			}
+
+		delete [] buffer;
+		}
+	}
+
+/** Calls CFbsBitmap::Handle() */
+void CT_DataFbsBitmap::DoCmdHandle(const TDesC& aSection)
+	{
+	
+	// call Handle()
+	TInt	handle=GetFbsBitmap()->Handle();
+	INFO_PRINTF2(_L("Calls CFbsBitmap::Handle() %d"), handle);
+	SetHandle(handle);
+
+	// validate returned value if needed
+	TInt	expectedValue;
+	if(GetIntFromConfig(aSection, KExpectedInt(), expectedValue))
+		{
+		if (expectedValue != handle)
+			{
+			ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedValue, handle);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/** Checks CFbsBitmap::HardwareBitmapHandle() */
+void CT_DataFbsBitmap::DoCmdHardwareBitmapHandle(const TDesC& aSection)
+	{
+	// call HardwareBitmapHandle()
+	TInt	handle=GetFbsBitmap()->HardwareBitmapHandle();
+	INFO_PRINTF2(_L("CFbsBitmap::HardwareBitmapHandle() %d"), handle);
+	SetHandle(handle);
+
+	// get if null expected flag from parameters
+	TBool	nullExpected = EFalse;
+	if ( GetBoolFromConfig(aSection, KNullExpected(), nullExpected) )
+		{
+		// check value againts NULL
+		if ( (handle == NULL) != nullExpected )
+			{
+			ERR_PRINTF2(_L("The value is not as expected! value: %d"), handle);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/** Calls CFbsBitmap::Header() */
+void CT_DataFbsBitmap::DoCmdHeader()
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::Header()"));
+
+	// call Header()
+	SEpocBitmapHeader	header=GetFbsBitmap()->Header();
+	INFO_PRINTF2(_L("Header iBitmapSize     &d"), header.iBitmapSize);
+	INFO_PRINTF2(_L("Header iBitsPerPixel   &d"), header.iBitsPerPixel);
+	INFO_PRINTF2(_L("Header iColor          &d"), header.iColor);
+	INFO_PRINTF2(_L("Header iCompression    &d"), header.iCompression);
+	INFO_PRINTF2(_L("Header iPaletteEntries &d"), header.iPaletteEntries);
+	INFO_PRINTF3(_L("Header iSizeInPixels   &d %d"), header.iSizeInPixels.iWidth, header.iSizeInPixels.iHeight);
+	INFO_PRINTF3(_L("Header iSizeInTwips    &d %d"), header.iSizeInTwips.iWidth, header.iSizeInTwips.iHeight);
+	INFO_PRINTF2(_L("Header iStructSize     &d"), header.iStructSize);
+	}
+
+/** Calls CFbsBitmap::HorizontalPixelsToTwips() */
+void CT_DataFbsBitmap::DoCmdHorizontalPixelsToTwips(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::HorizontalPixelsToTwips()"));
+
+	// get pixels from parameters
+	TInt	pixels;
+	if(!GetIntFromConfig(aSection, KPixels(), pixels))
+		{
+		ERR_PRINTF2(_L("No %S"), &KPixels());
+		SetBlockResult(EFail);
+		}
+
+	// call HorizontalPixelsToTwips()
+	TInt	value = GetFbsBitmap()->HorizontalPixelsToTwips(pixels);
+	INFO_PRINTF2(_L("Twips: %d"), value);
+
+	// validate returned value if needed
+	TInt	expectedValue;
+	if(GetIntFromConfig(aSection, KExpectedInt(), expectedValue))
+		{
+		if (expectedValue != value)
+			{
+			ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedValue, value);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/** Calls CFbsBitmap::HorizontalTwipsToPixels() */
+void CT_DataFbsBitmap::DoCmdHorizontalTwipsToPixels(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::HorizontalTwipsToPixels()"));
+
+	// get twips from parameters
+	TInt	twips;
+	if(!GetIntFromConfig(aSection, KTwips(), twips))
+		{
+		ERR_PRINTF2(_L("No %S"), &KTwips());
+		SetBlockResult(EFail);
+		}
+
+	// call HorizontalTwipsToPixels()
+	TInt	value = GetFbsBitmap()->HorizontalTwipsToPixels(twips);
+	INFO_PRINTF2(_L("Pixels: %d"), value);
+
+	// validate returned value if needed
+	TInt	expectedValue;
+	if(GetIntFromConfig(aSection, KExpectedInt(), expectedValue))
+		{
+		if (expectedValue != value)
+			{
+			ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedValue, value);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/** Checks CFbsBitmap::InitialDisplayMode() value */
+void CT_DataFbsBitmap::DoCmdInitialDisplayMode(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Checks CFbsBitmap::InitialDisplayMode() value"));
+
+	// call InitialDisplayMode()
+	TInt	actualValue = GetFbsBitmap()->InitialDisplayMode();
+	INFO_PRINTF2(_L("Initial Display Mode %d"), actualValue);
+
+	// get display mode from parameters
+	TDisplayMode	expectedValue;
+	if ( CT_GraphicsUtil::ReadDisplayMode(*this, aSection, KDisplayMode(), expectedValue) )
+		{
+		// check value againts NULL
+		if (actualValue != expectedValue)
+			{
+			ERR_PRINTF3(_L("The value is not as expected! expecyed: %d, actual: %d"), expectedValue, actualValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/** Calls CFbsBitmap::InternalizeL() */
+void CT_DataFbsBitmap::DoCmdInternalizeL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::InternalizeL()"));
+
+	// get file name from parameters
+	TPtrC	fileName;
+	if (!GetStringFromConfig(aSection, KFileName(), fileName))
+		{
+		ERR_PRINTF2(_L("No %S"), &KFileName());
+		SetBlockResult(EFail);
+		}
+
+	// get a flag if to use closed stream from parameters
+	TBool	useClosedStream = EFalse;
+	if(!GetBoolFromConfig(aSection, KUseClosedStream(), useClosedStream))
+		{
+		ERR_PRINTF2(_L("No %S"), &KUseClosedStream());
+		SetBlockResult(EFail);
+		}
+
+	// ReadStore creation
+	CDirectFileStore*	readstore = CDirectFileStore::OpenL(FileServer(), fileName, EFileStream | EFileRead);
+	CleanupStack::PushL(readstore);
+	TInt				popCount=1;
+	TStreamId			headerid = readstore->Root();
+	RStoreReadStream	readstrm;
+
+	// close stream if defined by parameters
+	if (!useClosedStream)
+		{
+		readstrm.OpenL(*readstore, headerid);
+		CleanupClosePushL(readstrm);
+		popCount=2;
+		}
+
+	// call InternalizeL()
+	TRAPD(err, GetFbsBitmap()->InternalizeL(readstrm));
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(_L("Internalize error: %d"), err);
+		SetError(err);
+		}
+
+	// cleanup
+	CleanupStack::PopAndDestroy(popCount, readstore);
+	}
+
+/** Calls CFbsBitmap::IsCompressedInRAM() to check againt expected value */
+void CT_DataFbsBitmap::DoCmdIsCompressedInRAM(const TDesC& aSection)
+	{
+	// call IsCompressedInRAM() to get actual value
+	TBool	actualValue = GetFbsBitmap()->IsCompressedInRAM();
+	INFO_PRINTF2(_L("CFbsBitmap::IsCompressedInRAM() %d"), actualValue);
+
+	// get expected value from parameters
+	TBool	expectedValue = EFalse;
+	if ( GetBoolFromConfig(aSection, KExpectedBool(), expectedValue) )
+		{
+		if (actualValue != expectedValue)
+			{
+			ERR_PRINTF3(_L("Expected value doesn't match to actual! expected: %d, actual: %d"), expectedValue, actualValue);
+			if (!iCompressFailed)
+			    {
+			    SetBlockResult(EFail);
+			    };
+			}
+		}
+	}
+
+/** Calls CFbsBitmap::IsFileInRom() and check against expectation */
+void CT_DataFbsBitmap::DoCmdIsFileInRom(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::IsFileInRom() and check against expectation"));
+
+	// get file name from parameters
+
+	TPtrC	fileName;
+	if ( !GetStringFromConfig(aSection, KFileName(), fileName) )
+		{
+		ERR_PRINTF2(_L("No %S"), &KFileName());
+		SetBlockResult(EFail);
+		}
+
+	// get flag if use RFile instance in Save() call from parameters
+	TBool	useRFile = EFalse;
+	GetBoolFromConfig(aSection, KUseRFile(), useRFile);
+
+	TInt		err = KErrNone;
+	TBool		isFileInRom = EFalse;
+	TUint32*	addressInRom = NULL;
+	if (useRFile)
+		{
+		// open rfile
+		RFile file;
+		err = file.Open(FileServer(), fileName, EFileShareReadersOnly);
+
+		// check if failed to open file
+		if ( err != KErrNone )
+			{
+			ERR_PRINTF2(_L("File open error: %d"), err);
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			// call IsFileInRom()
+			isFileInRom = CFbsBitmap::IsFileInRom(file, addressInRom);
+
+			// close rfile
+			file.Close();
+			}
+		}
+	else
+		{
+		isFileInRom = CFbsBitmap::IsFileInRom(fileName, addressInRom);
+		}
+
+	// get expected value if is in ROM from parameters
+	TBool	expectedIsFileInRom = EFalse;
+	if ( GetBoolFromConfig(aSection, KExpectedBool(), expectedIsFileInRom) )
+		{
+		// check the expectation
+		if (expectedIsFileInRom != isFileInRom)
+			{
+			ERR_PRINTF3(_L("The value is not as expected! expected: %d, actual: %d"), expectedIsFileInRom, isFileInRom);
+			SetBlockResult(EFail);
+			}
+		}
+
+	// check that address is not null if in rom
+	if ( isFileInRom && addressInRom == NULL )
+		{
+		ERR_PRINTF1(_L("The file is in ROM but returned address is NULL"));
+		SetBlockResult(EFail);
+		}
+	}
+
+/** Calls CFbsBitmap::IsLargeBitmap() */
+void CT_DataFbsBitmap::DoCmdIsLargeBitmap(const TDesC& aSection)
+	{
+	// call IsLargeBitmap()
+	TBool	value = GetFbsBitmap()->IsLargeBitmap();
+	INFO_PRINTF2(_L("Is large bitmap: %d"), value);
+	
+	// validate returned value if needed
+	TBool	expectedBool;
+	if(GetIntFromConfig(aSection, KExpectedBool(), expectedBool))
+		{
+		if (expectedBool != value)
+			{
+			ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedBool, value);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/** Calls CFbsBitmap::IsMonochrome() */
+void CT_DataFbsBitmap::DoCmdIsMonochrome(const TDesC& aSection)
+	{
+
+	// call IsMonochrome()
+	TBool	value = GetFbsBitmap()->IsMonochrome();
+	INFO_PRINTF2(_L("Is monochrome: %d"), value);
+
+	// validate returned value if needed
+	TBool	expectedBool;
+	if(GetIntFromConfig(aSection, KExpectedBool(), expectedBool))
+		{
+		if (expectedBool != value)
+			{
+			ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedBool, value);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/** Calls CFbsBitmap::IsRomBitmap() and check against expectation */
+void CT_DataFbsBitmap::DoCmdIsRomBitmap(const TDesC& aSection)
+	{
+	// call IsRomBitmap()
+	TBool	actualValue = GetFbsBitmap()->IsRomBitmap();
+	INFO_PRINTF2(_L("CFbsBitmap::IsRomBitmap() %d"), actualValue);
+
+	// get expected value if is in ROM from parameters
+	TBool	expectedIsRomBitmap = EFalse;
+	if ( GetBoolFromConfig(aSection, KExpectedBool(), expectedIsRomBitmap) )
+		{
+		// check the expectation
+		if (expectedIsRomBitmap != actualValue)
+			{
+			ERR_PRINTF3(_L("The value is not as expected! expected: %d, actual: %d"), expectedIsRomBitmap, actualValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/** CFbsBitmap::Load() Call */
+void CT_DataFbsBitmap::DoCmdLoadL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("CFbsBitmap::Load() Call"));
+	LoadOrLoadAndCompressL(aSection, EFalse);
+	}
+
+/** CFbsBitmap::LoadAndCompress() Call */
+void CT_DataFbsBitmap::DoCmdLoadAndCompressL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("CFbsBitmap::LoadAndCompress() Call"));
+	LoadOrLoadAndCompressL(aSection, ETrue);
+	}
+
+/** Calls static CFbsBitmap destructor */
+void CT_DataFbsBitmap::DoCmdLockHeap(const TDesC& aSection)
+	{
+	TBool	always=EFalse;
+	GetBoolFromConfig(aSection, KAlways(), always);
+	GetFbsBitmap()->LockHeap(always);
+	}
+
+/** Calls static CFbsBitmap destructor */
+void CT_DataFbsBitmap::DoCmdLockHeapLC(const TDesC& aSection)
+	{
+	TBool	always=EFalse;
+	GetBoolFromConfig(aSection, KAlways(), always);
+
+	GetFbsBitmap()->LockHeapLC(always);
+	iPopWhenUnlocking=ETrue;
+	}
+
+/** Calls CFbsBitmap::PaletteAttributes() */
+void CT_DataFbsBitmap::DoCmdPaletteAttributes(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::PaletteAttributes()"));
+
+	// call PaletteAttributes()
+	TBool	modifiable;
+	TInt	entries;
+	GetFbsBitmap()->PaletteAttributes(modifiable, entries);
+
+	INFO_PRINTF3(_L("Modifiable: %d, Number of entries: %d"), modifiable, entries);
+
+	// validate returned value if needed
+	TBool	expectedModifiable;
+	if(GetBoolFromConfig(aSection, KModifiable(), expectedModifiable))
+		{
+		if (expectedModifiable != modifiable)
+			{
+			ERR_PRINTF3(_L("The returned modifaiable value is not as expected, expected: %d, actual: %d"), expectedModifiable, modifiable);
+			SetBlockResult(EFail);
+			}
+		}
+
+	// validate returned value if needed
+	TBool	expectedEntries;
+	if(GetIntFromConfig(aSection, KEntries(), expectedEntries))
+		{
+		if (expectedEntries != entries)
+			{
+			ERR_PRINTF3(_L("The returned modifaiable value is not as expected, expected: %d, actual: %d"), expectedEntries, entries);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/** Calls CFbsBitmap::Reset() */
+void CT_DataFbsBitmap::DoCmdReset()
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::Reset()"));
+
+	// call Reset()
+	GetFbsBitmap()->Reset();
+	}
+
+/** Calls CFbsBitmap::Resize() */
+void CT_DataFbsBitmap::DoCmdResize(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::Resize()"));
+
+	// get size height from parameters
+	TInt	height;
+	if(!GetIntFromConfig(aSection, KHeight(), height))
+		{
+		ERR_PRINTF2(_L("No %S"), &KHeight());
+		SetBlockResult(EFail);
+		}
+
+	// get size width from parameters
+	TInt	width;
+	if(!GetIntFromConfig(aSection, KWidth(), width))
+		{
+		ERR_PRINTF2(_L("No %S"), &KWidth());
+		SetBlockResult(EFail);
+		}
+
+	// call Resize()
+	TInt	err = GetFbsBitmap()->Resize(TSize(width, height));
+
+	// check error code
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(_L("Resize error: %d"), err);
+		SetError(err);
+		}
+	}
+
+/** Calls CFbsBitmap::Save() */
+void CT_DataFbsBitmap::DoCmdSave(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::Save()"));
+
+	// get file name from parameters
+	TPtrC	fileName;
+	if (!GetStringFromConfig(aSection, KFileName(), fileName))
+		{
+		ERR_PRINTF2(_L("No %S"), &KFileName());
+		SetBlockResult(EFail);
+		}
+
+	// get flag if use RFile instance in Save() call from parameters
+	TBool	useRFile = EFalse;
+	if(!GetBoolFromConfig(aSection, KUseRFile(), useRFile))
+		{
+		ERR_PRINTF2(_L("No %S"), &KUseRFile());
+		SetBlockResult(EFail);
+		}
+
+	// get flag if use RFile instance in Load() call from parameters
+	TBool	useClosedRFile = EFalse;
+	if(GetBoolFromConfig(aSection, KUseClosedRFile(), useClosedRFile))
+		{
+		if (useClosedRFile && !useRFile)
+			{
+			ERR_PRINTF3(_L("Cannot use %S parameter if %S is not set to TRUE"), &KUseClosedRFile(), &KUseRFile());
+			SetBlockResult(EFail);
+			}
+		}
+
+	TInt	err = KErrNone;
+	if (useRFile)
+		{
+		// required to allow file handle to be adopted by another process
+		FileServer().ShareProtected();
+
+		// open or create rfile
+		RFile	file;
+
+		if (!useClosedRFile)
+			{
+			err = file.Open(FileServer(), fileName, EFileWrite);
+
+			if (err == KErrNotFound)
+				{
+				err = file.Create(FileServer(), fileName, EFileWrite);
+
+				// check if failed to create file
+				if (err != KErrNone)
+					{
+					ERR_PRINTF2(_L("File create error: %d"), err);
+					SetBlockResult(EFail);
+					}
+				}
+			else if (err != KErrNone)
+				{
+				// if failed to open file
+				ERR_PRINTF2(_L("File open error: %d"), err);
+				SetBlockResult(EFail);
+				}
+			}
+
+		// call Save()
+		err = GetFbsBitmap()->Save(file);
+
+		// close rfile
+		file.Close();
+		}
+	else
+		{
+		err = GetFbsBitmap()->Save(fileName);
+		}
+
+	// check error code
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(_L("Save error: %d"), err);
+		SetError(err);
+		}
+	}
+
+/** Calls CFbsBitmap::ScanLineLength() */
+void CT_DataFbsBitmap::DoCmdScanLineLength(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::ScanLineLength()"));
+
+	// get length from parameters
+	TInt length = 0;
+	if(!GetIntFromConfig(aSection, KLength(), length))
+		{
+		ERR_PRINTF2(_L("No %S"), &KLength());
+		SetBlockResult(EFail);
+		}
+
+	// get display mode from parameters
+	TDisplayMode	displayMode;
+	if ( !CT_GraphicsUtil::ReadDisplayMode(*this, aSection, KDisplayMode(), displayMode) )
+		{
+		ERR_PRINTF1(_L("No display mode"));
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		TInt actualValue = CFbsBitmap::ScanLineLength(length, displayMode);
+		INFO_PRINTF2(_L("CFbsBitmap::ScanLineLength() %d"), actualValue);
+	
+		TInt expectedValue = 0;
+		if ( GetIntFromConfig(aSection, KExpectedInt(), expectedValue) )
+			{
+			if (actualValue != expectedValue)
+				{
+				ERR_PRINTF3(_L("Expected value doesn't match to actual! expected: %d, actual: %d"), expectedValue, actualValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+/** Calls CFbsBitmap::SetDisplayMode() */
+void CT_DataFbsBitmap::DoCmdSetDisplayMode(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::SetDisplayMode()"));
+
+	// get display mode from parameters
+	TDisplayMode	displayMode;
+	if ( !CT_GraphicsUtil::ReadDisplayMode(*this, aSection, KDisplayMode(), displayMode) )
+		{
+		ERR_PRINTF1(_L("No display mode"));
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// call SetDisplayMode()
+		TInt	err = GetFbsBitmap()->SetDisplayMode(displayMode);
+
+		// check error code
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(_L("Set display mode error: %d"), err);
+			SetError(err);
+			}
+		}
+	}
+
+/** Calls CFbsBitmap::SetPalette() by previously created palette */
+void CT_DataFbsBitmap::DoCmdSetPaletteL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::SetPalette() by previously created palette"));
+
+	// get CPalette object passed as a parameter
+	CPalette*	palette = NULL;
+
+	CT_GraphicsUtil::GetPaletteL(*this, aSection, KPalette(), palette);
+
+	// call SetPalette()
+	GetFbsBitmap()->SetPalette(palette);
+	}
+
+/** Calls CFbsBitmap::SetRomBitmapL() by another bitmap */
+void CT_DataFbsBitmap::DoCmdSetRomBitmapL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::SetRomBitmapL() by another bitmap"));
+
+	// get fbsBitmap passed as a parameter
+	CFbsBitmap*		otherFbsBitmap=NULL;
+
+	CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFbsBitmapName(), otherFbsBitmap);
+
+	// get romPointer. If the bitmap is ROM bitmap then Handle() returns ROM pointer
+	CBitwiseBitmap*	bitmapRomAddress=NULL;
+	if ( otherFbsBitmap!=NULL )
+		{
+		bitmapRomAddress=REINTERPRET_CAST(CBitwiseBitmap*, otherFbsBitmap->Handle());
+		}
+
+	// call SetRomBitmapL()
+	TInt	bitmapSizeInBytes=0;
+	TRAPD(err, GetFbsBitmap()->SetRomBitmapL(bitmapRomAddress, bitmapSizeInBytes));
+
+	// check error code
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(_L("Set ROM bitmap error: %d"), err);
+		SetError(err);
+		}
+	}
+
+/** Calls CFbsBitmap::SetScanLine() */
+void CT_DataFbsBitmap::DoCmdSetScanLineL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::SetScanLine()"));
+
+	// get scanline coordinate from parameters
+	TInt	coordinate = 0;
+	if(!GetIntFromConfig(aSection, KScanLineCoord(), coordinate))
+		{
+		ERR_PRINTF2(_L("No %S"), &KScanLineCoord());
+		SetBlockResult(EFail);
+		}
+
+	// get file name from parameters
+	TPtrC	fileName;
+	if (!GetStringFromConfig(aSection, KFileName(), fileName))
+		{
+		ERR_PRINTF2(_L("No %S"), &KFileName());
+		SetBlockResult(EFail);
+		}
+
+	// open file
+	RFile	file;
+	User::LeaveIfError(file.Open(FileServer(), fileName, EFileRead | EFileShareAny));
+	CleanupClosePushL(file);
+
+	// get size
+	TInt	size = 0;
+	User::LeaveIfError(file.Size(size));
+
+	// read file
+    HBufC8*	fileDataBuff = HBufC8::NewLC(size);
+    TPtr8	fileData = fileDataBuff->Des();
+
+	User::LeaveIfError(file.Read(fileData));
+
+	GetFbsBitmap()->SetScanLine(fileData, coordinate);
+
+    CleanupStack::PopAndDestroy(2, &file);  // fileDataBuff, file
+	}
+
+/** Calls CFbsBitmap::SetSizeInTwips() by size parameter */
+void CT_DataFbsBitmap::DoCmdSetSizeInTwipsL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::SetSizeInTwips()"));
+
+	// get if to NULL device pointer flag from parameters
+	TPtrC	device;
+	if ( GetStringFromConfig(aSection, KDevice(), device) )
+		{
+		CFbsBitmapDevice*	bitmapDevice=static_cast<CFbsBitmapDevice*>(GetDataObjectL(device));
+		GetFbsBitmap()->SetSizeInTwips(bitmapDevice);
+		}
+	else
+		{
+		// get size height from parameters
+		TInt	height;
+		if(!GetIntFromConfig(aSection, KHeight(), height))
+			{
+			ERR_PRINTF2(_L("No %S"), &KHeight());
+			SetBlockResult(EFail);
+			}
+
+		// get size width from parameters
+		TInt	width;
+		if(!GetIntFromConfig(aSection, KWidth(), width))
+			{
+			ERR_PRINTF2(_L("No %S"), &KWidth());
+			SetBlockResult(EFail);
+			}
+
+		// call SetSizeInTwips()
+		GetFbsBitmap()->SetSizeInTwips(TSize(width, height));
+		}
+	}
+
+/** Calls CFbsBitmap::SizeInPixels() and checks the size */
+void CT_DataFbsBitmap::DoCmdSizeInPixels(const TDesC& aSection)
+	{
+	// call SizeInTwips()
+	TSize	actualSize = GetFbsBitmap()->SizeInPixels();
+	INFO_PRINTF3(_L("CFbsBitmap::SizeInPixels() height %d, width %d"), actualSize.iHeight, actualSize.iWidth);
+
+	// get size height from parameters
+	TInt	height;
+	if ( GetIntFromConfig(aSection, KHeight(), height) )
+		{
+		if ( actualSize.iHeight != height )
+			{
+			ERR_PRINTF3(_L("Height mismatch expected: %d, actual: %d"), height, actualSize.iHeight);
+			SetBlockResult(EFail);
+			}
+		}
+
+	// get size width from parameters
+	TInt	width;
+	if ( GetIntFromConfig(aSection, KWidth(), width) )
+		{
+		// check that value is as expected
+		if ( actualSize.iWidth != width )
+			{
+			ERR_PRINTF3(_L("Width mismatch expected: %d, actual: %d"), width, actualSize.iWidth);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/** Calls CFbsBitmap::SizeInTwips() and compares the result with expected */
+void CT_DataFbsBitmap::DoCmdSizeInTwips(const TDesC& aSection)
+	{
+	// call SizeInTwips()
+	TSize	actualSize = GetFbsBitmap()->SizeInTwips();
+	INFO_PRINTF3(_L("CFbsBitmap::SizeInTwips() height %d, width %d"), actualSize.iHeight, actualSize.iWidth);
+
+	// get size height from parameters
+	TInt	height;
+	if ( GetIntFromConfig(aSection, KHeight(), height) )
+		{
+		if ( actualSize.iHeight != height )
+			{
+			ERR_PRINTF3(_L("Height mismatch expected: %d, actual: %d"), height, actualSize.iHeight);
+			SetBlockResult(EFail);
+			}
+		}
+
+	// get size width from parameters
+	TInt	width;
+	if ( GetIntFromConfig(aSection, KWidth(), width) )
+		{
+		// check that value is as expected
+		if ( actualSize.iWidth != width )
+			{
+			ERR_PRINTF3(_L("Width mismatch expected: %d, actual: %d"), width, actualSize.iWidth);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/** Calls CFbsBitmap::StoreL() */
+void CT_DataFbsBitmap::DoCmdStoreL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::StoreL()"));
+
+	TInt	numberOfFiles = 0;
+	TInt	numberOfBitmapIds = 0;
+	TPtrC	sourceFileName1;
+	TPtrC	sourceFileName2;
+	TInt	sourceBitmapId0 = -1;
+	TInt	sourceBitmapId1 = -1;
+	TInt	sourceBitmapId2 = -1;
+
+	// get file name from parameters
+	TPtrC	fileName;
+	if (!GetStringFromConfig(aSection, KFileName(), fileName))
+		{
+		ERR_PRINTF2(_L("No %S"), &KFileName());
+		SetBlockResult(EFail);
+		}
+
+	// get flag if use RFile instance in Save() call from parameters
+	TBool	useRFile = EFalse;
+	if(!GetBoolFromConfig(aSection, KUseRFile(), useRFile))
+		{
+		ERR_PRINTF2(_L("No %S"), &KUseRFile());
+		SetBlockResult(EFail);
+		}
+
+	// get flag if use RFile instance in Load() call from parameters
+	TBool	useClosedRFile = EFalse;
+	if(GetBoolFromConfig(aSection, KUseClosedRFile(), useClosedRFile))
+		{
+		if (useClosedRFile && !useRFile)
+			{
+			ERR_PRINTF3(_L("Cannot use %S parameter if %S is not set to TRUE"), &KUseClosedRFile(), &KUseRFile());
+			SetBlockResult(EFail);
+			}
+		}
+
+	// get up to 3 source file names from parameters
+	TPtrC	sourceFileName0;
+	if (GetStringFromConfig(aSection, KSourceFileName0(), sourceFileName0))
+		{
+		numberOfFiles++;
+		if (GetStringFromConfig(aSection, KSourceFileName1(), sourceFileName1))
+			{
+			numberOfFiles++;
+			if (GetStringFromConfig(aSection, KSourceFileName2(), sourceFileName2))
+				{
+				numberOfFiles++;
+				}
+			}
+		}
+
+	// get up to 3 source bitmap ids from parameters
+	if (GetIntFromConfig(aSection, KSourceBitmapId0(), sourceBitmapId0))
+		{
+		numberOfBitmapIds++;
+		if (GetIntFromConfig(aSection, KSourceBitmapId1(), sourceBitmapId1))
+			{
+			numberOfBitmapIds++;
+			if (GetIntFromConfig(aSection, KSourceBitmapId2(), sourceBitmapId2))
+				{
+				numberOfBitmapIds++;
+				}
+			}
+		}
+
+	// get number of sources argument from parameters
+	TInt	numberOfSources;
+	if(!GetIntFromConfig(aSection, KNumberOfSources(), numberOfSources))
+		{
+		ERR_PRINTF2(_L("No %S"), &KNumberOfSources());
+		SetBlockResult(EFail);
+		}
+
+	// create array of file names
+ 	TFileName** sourceFiles = new (ELeave) TFileName*[numberOfFiles];
+ 	CleanupStack::PushL(sourceFiles);
+	if (numberOfFiles > 0) sourceFiles[0] = new (ELeave) TFileName(sourceFileName0);
+	if (numberOfFiles > 1) sourceFiles[1] = new (ELeave) TFileName(sourceFileName1);
+	if (numberOfFiles > 2) sourceFiles[2] = new (ELeave) TFileName(sourceFileName2);
+
+	// create array of bitmap ids
+	TInt32* bitmapIds = new (ELeave) TInt32[numberOfBitmapIds];
+	CleanupStack::PushL(bitmapIds);
+
+	if (numberOfBitmapIds > 0) bitmapIds[0] = sourceBitmapId0;
+	if (numberOfBitmapIds > 1) bitmapIds[1] = sourceBitmapId1;
+	if (numberOfBitmapIds > 2) bitmapIds[2] = sourceBitmapId2;
+
+	TInt err = KErrNone;
+	if (useRFile)
+		{
+		// required to allow file handle to be adopted by another process
+		FileServer().ShareProtected();
+
+		// open rfile
+		TBool	openSuccess = EFalse;
+
+		RFile file;
+		err = file.Open(FileServer(), fileName, EFileWrite);
+
+		// check if ok, if not fount => try to create new file
+		if (err == KErrNone)
+			{
+			openSuccess = ETrue;
+			}
+		else if (err == KErrNotFound)
+			{
+			INFO_PRINTF1(_L("File doesn't exist, trying to create it."));
+
+			err = file.Create(FileServer(), fileName, EFileWrite);
+
+			// check if failed to create file
+			if (err == KErrNone)
+				{
+				openSuccess = ETrue;
+				}
+			else
+				{
+				ERR_PRINTF2(_L("File create error: %d"), err);
+				SetBlockResult(EFail);
+				}
+			}
+		else
+			{
+			ERR_PRINTF2(_L("File open error: %d"), err);
+			SetBlockResult(EFail);
+			}
+
+		// if ok => do store
+		if (openSuccess)
+			{
+			// if we use invalid RFile handle in our test
+			if (useClosedRFile)
+				{
+				file.Close();
+				}
+
+			// call StoreL()
+			TRAP(err, CFbsBitmap::StoreL(file, numberOfSources, (const TDesC**) sourceFiles, bitmapIds));
+
+			// check error code
+			if (err != KErrNone)
+				{
+				ERR_PRINTF2(_L("Store error: %d"), err);
+				SetError(err);
+				}
+
+			// close rfile
+			file.Close();
+			}
+		}
+	else
+		{
+		// call StoreL()
+		TRAP(err, CFbsBitmap::StoreL(fileName, numberOfSources, (const TDesC**) sourceFiles, bitmapIds));
+
+		// check error code
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(_L("Store error: %d"), err);
+			SetError(err);
+			}
+		}
+
+ 	// Iterate over the file name pointer array and cleanup
+ 	for (TInt i = 0; i < numberOfFiles; ++i)
+ 		{
+		delete sourceFiles[i];
+   		}
+
+ 	// Cleanup the arrays allocated on the heap
+ 	CleanupStack::PopAndDestroy(2, sourceFiles);
+	}
+
+/** Calls CFbsBitmap::SwapWidthAndHeight() */
+void CT_DataFbsBitmap::DoCmdSwapWidthAndHeight()
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::SwapWidthAndHeight()"));
+
+	// call SwapWidthAndHeight()
+	TInt	err = GetFbsBitmap()->SwapWidthAndHeight();
+
+	// check error code
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(_L("Swap width and height error: %d"), err);
+		SetError(err);
+		}
+	}
+
+/** Calls static CFbsBitmap destructor */
+void CT_DataFbsBitmap::DoCmdUnlockHeapL(const TDesC& aSection)
+	{
+
+	CFbsBitmap*	bitmap=NULL;
+	if ( CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFbsBitmapName(), bitmap) )
+		{
+		CFbsBitmap::UnlockHeap(bitmap);
+		}
+	else
+		{
+		TBool	always=EFalse;
+		GetBoolFromConfig(aSection, KAlways(), always);
+
+		GetFbsBitmap()->UnlockHeap(always);
+		}
+
+	if ( iPopWhenUnlocking )
+		{
+		iPopWhenUnlocking=EFalse;
+		CleanupStack::Pop();
+		}
+	}
+
+/** Calls CFbsBitmap::VerticalPixelsToTwips() */
+void CT_DataFbsBitmap::DoCmdVerticalPixelsToTwips(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::VerticalPixelsToTwips()"));
+
+	// get pixels from parameters
+	TInt	pixels;
+	if(!GetIntFromConfig(aSection, KPixels(), pixels))
+		{
+		ERR_PRINTF2(_L("No %S"), &KPixels());
+		SetBlockResult(EFail);
+		}
+
+	// call VerticalPixelsToTwips()
+	TInt	value = GetFbsBitmap()->VerticalPixelsToTwips(pixels);
+	INFO_PRINTF2(_L("Twips: %d"), value);
+
+	// validate returned value if needed
+	TInt	expectedValue;
+	if(GetIntFromConfig(aSection, KExpectedInt(), expectedValue))
+		{
+		if (expectedValue != value)
+			{
+			ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedValue, value);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/** Calls CFbsBitmap::VerticalTwipsToPixels() */
+void CT_DataFbsBitmap::DoCmdVerticalTwipsToPixels(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::VerticalTwipsToPixels()"));
+
+	// get twips from parameters
+	TInt	twips;
+	if(!GetIntFromConfig(aSection, KTwips(), twips))
+		{
+		ERR_PRINTF2(_L("No %S"), &KTwips());
+		SetBlockResult(EFail);
+		}
+
+	// call VerticalTwipsToPixels()
+	TInt	value = GetFbsBitmap()->VerticalTwipsToPixels(twips);
+	INFO_PRINTF2(_L("Pixels: %d"), value);
+
+	// validate returned value if needed
+	TInt expectedValue;
+	if(GetIntFromConfig(aSection, KExpectedInt(), expectedValue))
+		{
+		if (expectedValue != value)
+			{
+			ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedValue, value);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/** Calls CFbsBitmap::ExternalizeL() or CFbsBitmap::ExternalizeRectangleL(). Used by DoCmdExternalize() and DoCmdExternalizeRectangle() methods */
+void CT_DataFbsBitmap::ExternalizeImplL(const TDesC& aSection, const TRect& aRect, TBool aUseRect)
+	{
+	// get file name from parameters
+	TPtrC	fileName;
+	if (!GetStringFromConfig(aSection, KFileName(), fileName))
+		{
+		ERR_PRINTF2(_L("No %S"), &KFileName());
+		SetBlockResult(EFail);
+		}
+
+	// get a flag if to use closed stream from parameters
+	TBool	useClosedStream = EFalse;
+	if(!GetBoolFromConfig(aSection, KUseClosedStream(), useClosedStream))
+		{
+		ERR_PRINTF2(_L("No %S"), &KUseClosedStream());
+		SetBlockResult(EFail);
+		}
+
+	// create write store
+	CDirectFileStore*	writestore = CDirectFileStore::ReplaceL(FileServer(), fileName, EFileStream | EFileWrite);
+	CleanupStack::PushL(writestore);
+	TInt				popCount=1;
+	TUidType 			uidtype(KDirectFileStoreLayoutUid, KMultiBitmapFileImageUid);
+
+	writestore->SetTypeL(uidtype);
+
+	// create write stream
+	RStoreWriteStream	writestrm;
+
+	// close stream set by parameters
+	if (!useClosedStream)
+		{
+		TStreamId	headerid=writestrm.CreateL(*writestore);
+		CleanupClosePushL(writestrm);
+
+		++popCount;
+		writestore->SetRootL(headerid);
+		}
+
+	if (aUseRect)
+		{
+		// call ExternalizeRectangleL()
+		TRAPD(err, GetFbsBitmap()->ExternalizeRectangleL(writestrm, aRect));
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(_L("Externalize rectangle error: %d"), err);
+			SetError(err);
+			}
+		}
+	else
+		{
+		// call ExternalizaL()
+		TRAPD(err, GetFbsBitmap()->ExternalizeL(writestrm));
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(_L("Externalize error: %d"), err);
+			SetError(err);
+			}
+		}
+
+	// cleanup
+	CleanupStack::PopAndDestroy(popCount, writestore);
+	}
+
+/** Calls CFbsBitmap::Load() or CFbsBitmap::LoadAndCompress(). Used by DoCmdLoad() and DoCmdLoadAndCompress() methods */
+void CT_DataFbsBitmap::LoadOrLoadAndCompressL(const TDesC& aSection, TBool aCompress)
+	{
+
+	// get bitmap id from parameters
+	TInt	bitmapId;
+	if(!GetIntFromConfig(aSection, KBitmapId(), bitmapId))
+		{
+		ERR_PRINTF2(_L("No %S"), &KBitmapId());
+		SetBlockResult(EFail);
+		}
+
+	// get file name from parameters
+	TPtrC	fileName;
+	if (!GetStringFromConfig(aSection, KFileName(), fileName))
+		{
+		ERR_PRINTF2(_L("No %S"), &KFileName());
+		SetBlockResult(EFail);
+		}
+
+	// get file offset from parameters
+	TInt	fileOffset;
+	TBool	useOffset = GetIntFromConfig(aSection, KFileOffset(), fileOffset);
+
+	// get share if loaded from parameters
+	TBool	shareIfLoaded = EFalse;
+	GetBoolFromConfig(aSection, KShareIfLoaded(), shareIfLoaded);
+
+	// get flag if use RFile instance in Load() call from parameters
+	TBool	useRFile = EFalse;
+	GetBoolFromConfig(aSection, KUseRFile(), useRFile);
+
+	// get flag if use RFile instance in Load() call from parameters
+	TBool	useClosedRFile = EFalse;
+	GetBoolFromConfig(aSection, KUseClosedRFile(), useClosedRFile);
+
+	if (useClosedRFile && !useRFile)
+		{
+		ERR_PRINTF3(_L("Cannot use %S parameter if %S is not set to TRUE"), &KUseClosedRFile(), &KUseRFile());
+		SetBlockResult(EFail);
+		}
+
+	// load bitmap
+	TInt	err = KErrNone;
+	if (useRFile)
+		{
+		// required to allow file handle to be adopted by another process
+		FileServer().ShareProtected();
+
+		// open rfile
+		RFile	file;
+
+		// if we use invalid RFile handle in our test
+		if (!useClosedRFile)
+			{
+			User::LeaveIfError(file.Open(FileServer(), fileName, EFileShareReadersOnly));
+			CleanupClosePushL(file);
+			}
+
+		// do load
+		if (aCompress)
+			{
+			if (useOffset)
+				{
+				err = GetFbsBitmap()->LoadAndCompress(file, bitmapId, shareIfLoaded, fileOffset);
+				}
+			else
+				{
+				err = GetFbsBitmap()->LoadAndCompress(file, bitmapId, shareIfLoaded);
+				}
+			}
+		else
+			{
+			if (useOffset)
+				{
+				err = GetFbsBitmap()->Load(file, bitmapId, shareIfLoaded, fileOffset);
+				}
+			else
+				{
+				err = GetFbsBitmap()->Load(file, bitmapId, shareIfLoaded);
+				}
+			}
+
+		if (!useClosedRFile)
+			{
+			CleanupStack::PopAndDestroy(&file);
+			}
+		}
+	else
+		{
+		if (aCompress)
+			{
+			if (useOffset)
+				{
+				err = GetFbsBitmap()->LoadAndCompress(fileName, bitmapId, shareIfLoaded, fileOffset);
+				}
+			else
+				{
+				err = GetFbsBitmap()->LoadAndCompress(fileName, bitmapId, shareIfLoaded);
+				}
+			}
+		else
+			{
+			if (useOffset)
+				{
+				err = GetFbsBitmap()->Load(fileName, bitmapId, shareIfLoaded, fileOffset);
+				}
+			else
+				{
+				err = GetFbsBitmap()->Load(fileName, bitmapId, shareIfLoaded);
+				}
+			}
+		}
+
+	// check error code
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(_L("Load error: %d"), err);
+		SetError(err);
+		}
+	}
+
+/**
+ Virtual RunL - Called on completion of an asynchronous command
+ @see MTPActiveCallback
+ @param aActive Active Object that RunL has been called on
+ @pre N/A
+ @post N/A
+ @leave system wide error code
+*/
+void CT_DataFbsBitmap::RunL(CActive* aActive, const TInt aIndex)
+	{
+	if ( aActive==iActiveCompressInBackground )
+		{
+		RunCompressInBackground(aIndex);
+		}
+	else
+		{
+		ERR_PRINTF1(_L("Stray signal"));
+		SetBlockResult(EFail);
+		}
+	DecOutstanding();
+	}
+
+/**
+ Virtual DoCancel - Request to cancel the asynchronous command
+ @see - MTPActiveCallback
+ @param aActive Active Object that DoCancel has been called on
+ @pre - N/A
+ @post - N/A
+ @leave system wide error code
+*/
+void CT_DataFbsBitmap::DoCancel(CActive* aActive, const TInt aIndex)
+	{
+	if ( aActive==iActiveCompressInBackground )
+		{
+		DoCancelCompressInBackground(aIndex);
+		}
+	else
+		{
+		ERR_PRINTF1(_L("Stray signal"));
+		SetBlockResult(EFail);
+		}
+	DecOutstanding();
+	}
+
+void CT_DataFbsBitmap::RunCompressInBackground(const TInt aIndex)
+	{
+	TInt	err=iActiveCompressInBackground->iStatus.Int();
+	INFO_PRINTF2(_L("RunCompressInBackground %d"), err);
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(_L("RunL Error %d"), err);
+		SetAsyncError(aIndex, err);
+		}
+	}
+
+void CT_DataFbsBitmap::DoCancelCompressInBackground(const TInt /*aIndex*/)
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fbserv/src/T_DataFbsColor256BitmapUtil.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,227 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataFbsColor256BitmapUtil
+*/
+
+//	User includes
+#include "T_DataFbsColor256BitmapUtil.h"
+#include "T_GraphicsUtil.h"
+
+/*@{*/
+///	Parameters
+_LIT(KDither,							"dither");
+_LIT(KBitmapFrom,						"bitmap_from");
+_LIT(KBitmapTo,							"bitmap_to");
+_LIT(KPalette,							"palette");
+
+///	Enumeration parameter values
+_LIT(KDitherNoDither,					"ENoDither");
+_LIT(KDitherFloydSteinberg,				"EFloydSteinberg");
+
+///	Commands
+_LIT(KCmdNewL,							"NewL");
+_LIT(KCmdCopyBitmap,					"CopyBitmap");
+_LIT(KCleanup,							"~");
+/*@}*/
+
+
+/**
+* Two phase constructor
+*/
+CT_DataFbsColor256BitmapUtil* CT_DataFbsColor256BitmapUtil::NewL()
+	{
+	CT_DataFbsColor256BitmapUtil* ret = new (ELeave) CT_DataFbsColor256BitmapUtil();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+
+/**
+* Protected constructor. First phase construction
+*/
+CT_DataFbsColor256BitmapUtil::CT_DataFbsColor256BitmapUtil()
+:	CDataWrapperBase()
+,	iFbsColor256BitmapUtil(NULL)
+	{
+	}
+
+
+void CT_DataFbsColor256BitmapUtil::ConstructL()
+	{
+	}
+
+
+CT_DataFbsColor256BitmapUtil::~CT_DataFbsColor256BitmapUtil()
+	{
+	DestroyData();
+	}
+
+
+/**
+* Contains cleanup implementation
+*/
+void CT_DataFbsColor256BitmapUtil::DestroyData()
+	{
+	delete iFbsColor256BitmapUtil;
+	iFbsColor256BitmapUtil = NULL;
+	}
+
+
+/**
+* Return a pointer to the object that the data wraps
+*
+* @return pointer to the object that the data wraps
+*/
+TAny* CT_DataFbsColor256BitmapUtil::GetObject()
+	{
+	return iFbsColor256BitmapUtil;
+	}
+
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataFbsColor256BitmapUtil::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool retVal = ETrue;
+
+	if (aCommand == KCmdNewL)
+		{
+		DoCmdNewL(aSection);
+		}
+	else if (aCommand == KCmdCopyBitmap)
+		{
+		DoCmdCopyBitmapL(aSection);
+		}
+	else if (aCommand == KCleanup)
+		{
+		DestroyData();
+		}
+	else
+		{
+		retVal=EFalse;
+		}
+
+	return retVal;
+	}
+
+
+////////////////// COMMANDS IMPLEMENTATION  ////////////////////////
+
+/** CFbsColor256BitmapUtil::NewL() call */
+void CT_DataFbsColor256BitmapUtil::DoCmdNewL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("CFbsColor256BitmapUtil::NewL() call"));
+
+	// cleanup if any
+	delete iFbsColor256BitmapUtil;
+	iFbsColor256BitmapUtil = NULL;
+
+	// get CPalette object passed as a parameter
+	CPalette*	palette = NULL;
+	CT_GraphicsUtil::GetPaletteL(*this, aSection, KPalette(), palette);
+
+	// call NewL()
+	TRAPD(err, iFbsColor256BitmapUtil = CFbsColor256BitmapUtil::NewL(palette));
+
+	// check error code
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(_L("CFbsColor256BitmapUtil::NewL error: %d"), err);
+		SetError(err);
+		}
+	}
+
+
+/** CFbsColor256BitmapUtil::CopyBitmap() call */
+void CT_DataFbsColor256BitmapUtil::DoCmdCopyBitmapL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("CFbsColor256BitmapUtil::CopyBitmap() call"));
+
+	// get source CFbsBitmap passed as a parameter
+	CFbsBitmap*	fbsBitmapFrom = NULL;
+	CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KBitmapFrom(), fbsBitmapFrom);
+
+	// get destination CFbsBitmap passed as a parameter
+	CFbsBitmap*	fbsBitmapTo = NULL;
+	CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KBitmapTo(), fbsBitmapTo);
+
+	// get dither mode from parameters
+	CFbsColor256BitmapUtil::TDither	dither;
+	if (!ReadDither(*this, aSection, dither))
+		{
+		ERR_PRINTF1(_L("No dither"));
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// call CopyBitmap()
+		TInt	err = iFbsColor256BitmapUtil->CopyBitmap(fbsBitmapTo, fbsBitmapFrom, dither);
+
+		// check error
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(_L("CopyBitmap failed with error %d"), err);
+			SetError(err);
+			}
+		}
+	}
+
+//////////////////// UTIL METHODS ////////////////////////////
+
+
+TBool CT_DataFbsColor256BitmapUtil::ReadDither(CDataWrapper& aDataWrapper, const TDesC& aSection, CFbsColor256BitmapUtil::TDither& aDither)
+	{
+	// Read dither from INI file
+	TPtrC	ditherStr;
+	TBool	found=aDataWrapper.GetStringFromConfig(aSection, KDither(), ditherStr);
+	if ( found )
+		{
+		if (ditherStr == KDitherNoDither)
+			{
+			aDither = CFbsColor256BitmapUtil::ENoDither;
+			}
+		else if (ditherStr == KDitherFloydSteinberg)
+			{
+			aDither = CFbsColor256BitmapUtil::EFloydSteinberg;
+			}
+		else
+			{
+        	TInt	dither = 0;
+        	found = aDataWrapper.GetIntFromConfig(aSection, KDither(), dither);
+			if ( found )
+				{
+	        	aDither = (CFbsColor256BitmapUtil::TDither) dither;
+				}
+			}
+		}
+
+	return found;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fbserv/src/T_DataFbsFont.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,367 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataFbsFont
+*/
+
+#include "T_DataFbsFont.h"
+
+/*@{*/
+///	Parameters
+_LIT(KText,									"text");
+_LIT(KExpectedBool,							"expected_bool");
+_LIT(KCharCode,								"char_code");
+_LIT(KNullBitmapPointerExpected,			"null_bitmap_pointer_expected");
+
+///	Commands
+_LIT(KCmdGetFontMetrics,					"GetFontMetrics");
+_LIT(KCmdTextWidthInPixelsWithCharWidth,	"TextWidthInPixelsWithCharWidth");
+_LIT(KCmdHandle,							"Handle");
+_LIT(KCmdCharacterMetrics,					"CharacterMetrics");
+_LIT(KCmdRawTextWidthInPixels,				"RawTextWidthInPixels");
+_LIT(KCmdGetFaceAttrib,						"GetFaceAttrib");
+_LIT(KCmdIsOpenFont,						"IsOpenFont");
+_LIT(KCmdHasCharacter,						"HasCharacter");
+/*@}*/
+
+/**
+* Constructor
+*/
+CT_DataFbsFont* CT_DataFbsFont::NewL()
+	{
+	CT_DataFbsFont*	ret = new (ELeave) CT_DataFbsFont();
+	return ret;
+	}
+
+/**
+* Protected constructor. First phase construction
+*/
+CT_DataFbsFont::CT_DataFbsFont()
+:	CT_DataFont()
+,	iFbsFont(NULL)
+	{
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataFbsFont::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool ret=ETrue;
+
+	if (aCommand == KCmdGetFontMetrics)
+		{
+		DoCmdGetFontMetrics(aSection);
+		}
+	else if (aCommand == KCmdTextWidthInPixelsWithCharWidth)
+		{
+		DoCmdTextWidthInPixelsWithCharWidth(aSection);
+		}
+	else if (aCommand == KCmdHandle)
+		{
+		DoCmdHandle();
+		}
+	else if (aCommand == KCmdCharacterMetrics)
+		{
+		DoCmdCharacterMetrics(aSection);
+		}
+	else if (aCommand == KCmdRawTextWidthInPixels)
+		{
+		DoCmdRawTextWidthInPixels(aSection);
+		}
+	else if (aCommand == KCmdGetFaceAttrib)
+		{
+		DoCmdGetFaceAttrib(aSection);
+		}
+	else if (aCommand == KCmdIsOpenFont)
+		{
+		DoCmdIsOpenFont(aSection);
+		}
+	else if (aCommand == KCmdHasCharacter)
+		{
+		DoCmdHasCharacter(aSection);
+		}
+	else
+		{
+		ret=CT_DataFont::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+
+	return ret;
+	}
+
+
+CFont* CT_DataFbsFont::GetFont() const
+	{
+	return iFbsFont;
+	}
+
+
+/**
+* Return a pointer to the object that the data wraps
+*
+* @return pointer to the object that the data wraps
+*/
+TAny* CT_DataFbsFont::GetObject()
+	{
+	return iFbsFont;
+	}
+
+
+/**
+* Sets a fbs font
+*
+* @param aNewFont	fbs font
+*/
+void CT_DataFbsFont::SetObjectL(TAny* aObject)
+	{
+	// no clean up needed, because fonts are managed by server side
+	iFbsFont = static_cast<CFbsFont*>(aObject);
+	}
+
+
+/**
+* Disown a fbs font
+*
+*/
+void CT_DataFbsFont::DisownObjectL()
+	{
+	// no clean up needed, because fonts are managed by server side
+	iFbsFont=NULL;
+	}
+
+
+/** Calls CFbsFont::GetFontMetrics() */
+void CT_DataFbsFont::DoCmdGetFontMetrics(const TDesC& aSection)
+	{
+	TOpenFontMetrics	metrics;
+	TBool				actual = iFbsFont->GetFontMetrics(metrics);
+	INFO_PRINTF2(_L("Calls CFbsFont::GetFontMetrics() %d"), actual);
+
+	// get if true expected flag from parameters
+	TBool	expected;
+	if ( GetBoolFromConfig(aSection, KExpectedBool(), expected) )
+		{
+		// check that the value is as expected
+		if (actual != expected)
+			{
+			ERR_PRINTF3(_L("The value is not as expected! expected: %d, actual: %d"), expected, actual);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Calls CFbsFont::TextWidthInPixels() using SCharWidth output paramter */
+void CT_DataFbsFont::DoCmdTextWidthInPixelsWithCharWidth(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsFont::TextWidthInPixels() using SCharWidth output paramter"));
+
+	// get text from parameters
+	TPtrC	text;
+	if (!GetStringFromConfig(aSection, KText(), text))
+		{
+		ERR_PRINTF2(_L("No %S"), &KText());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		//	call TextWidthInPixels()
+		SCharWidth	charWidth;
+		iFbsFont->TextWidthInPixels(text, charWidth);
+
+		// validate SCharWidth
+		if (charWidth.iMove != charWidth.iLeftAdjust + charWidth.iWidth + charWidth.iRightAdjust)
+			{
+			ERR_PRINTF5(_L("Move is not equal to left adjust + width + right adjust!, move: %d, leftAdjust: %d, width: %d, rightAdjust: %d"), charWidth.iMove, charWidth.iLeftAdjust, charWidth.iWidth, charWidth.iRightAdjust);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Calls CFbsFont::Handle() */
+void CT_DataFbsFont::DoCmdHandle()
+	{
+	// call Handle()
+	TInt	handle = iFbsFont->Handle();
+	INFO_PRINTF2(_L("Calls CFbsFont::Handle() %d"), handle);
+
+	// validate hanle
+	if (handle == 0)
+		{
+		ERR_PRINTF1(_L("Handle is zero!"));
+		SetBlockResult(EFail);
+		}
+	}
+
+
+/** Calls CFbsFont::CharacterMetrics() */
+void CT_DataFbsFont::DoCmdCharacterMetrics(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsFont::CharacterMetrics()"));
+
+	// get character code from parameters
+	TInt	charCode = 0;
+	if(!GetIntFromConfig(aSection, KCharCode(), charCode))
+		{
+		ERR_PRINTF2(_L("No %S"), &KCharCode());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// call CharacterMetrics()
+		const TUint8*	bitmapPointer;
+		iFbsFont->CharacterMetrics(charCode, bitmapPointer);
+
+	   	// get if NULL bitmap pointer expected flag from parameters
+	   	TBool	expectedNull = EFalse;
+	   	if(GetBoolFromConfig(aSection, KNullBitmapPointerExpected(), expectedNull))
+	   		{
+			// check that on retirn the bitmap pointer is not NULL
+			if ( expectedNull )
+				{
+				if ( bitmapPointer!=NULL )
+					{
+					ERR_PRINTF1(_L("Bitmap pointer is NOT null!"));
+					SetBlockResult(EFail);
+					}
+				}
+			else
+				{
+				if ( bitmapPointer==NULL )
+					{
+					ERR_PRINTF1(_L("Bitmap pointer is null!"));
+					SetBlockResult(EFail);
+					}
+				}
+			}
+		}
+	}
+
+
+/** Calls CFbsFont::RawTextWidthInPixels() */
+void CT_DataFbsFont::DoCmdRawTextWidthInPixels(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsFont::RawTextWidthInPixels()"));
+
+	// get text from parameters
+	TPtrC	text;
+	if (!GetStringFromConfig(aSection, KText(), text))
+		{
+		ERR_PRINTF2(_L("No %S"), &KText());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// call RawTextWidthInPixels()
+		TInt	width = iFbsFont->RawTextWidthInPixels(text);
+
+		// check result against MeasureText()
+		TInt	measureTextWidth = iFbsFont->MeasureText(text);
+		if ( width != measureTextWidth)
+			{
+			ERR_PRINTF3(_L("The result of RawTextWidthInPixels() is not the same as for MeasureText(): %d, and %d"), width, measureTextWidth);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Calls CFbsFont::GetFaceAttrib() */
+void CT_DataFbsFont::DoCmdGetFaceAttrib(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsFont::GetFaceAttrib()"));
+
+	// call GetFaceAttrib()
+	TOpenFontFaceAttrib	attrib;
+	TBool 				actual = iFbsFont->GetFaceAttrib(attrib);
+
+	// get if true expected flag from parameters
+	TBool 	expected;
+	if(GetBoolFromConfig(aSection, KExpectedBool(), expected))
+		{
+		// check that the value is as expected
+		if (actual != expected)
+			{
+			ERR_PRINTF3(_L("The value is not as expected! expected: %d, actual: %d"), expected, actual);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Calls CFbsFont::IsOpenFont() */
+void CT_DataFbsFont::DoCmdIsOpenFont(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsFont::IsOpenFont()"));
+
+	// call IsOpenFont()
+	TBool	actual = iFbsFont->IsOpenFont();
+
+	// check that the value is as expected if there is a expected bool parameter
+	TBool	expected;
+	if (GetBoolFromConfig(aSection, KExpectedBool(), expected) )
+		{
+		// check that the value is as expected
+		if (actual != expected)
+			{
+			ERR_PRINTF3(_L("The value is not as expected! expected: %d, actual: %d"), expected, actual);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Calls CFbsFont::HasCharacter() */
+void CT_DataFbsFont::DoCmdHasCharacter(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsFont::HasCharacter()"));
+
+	// get character code from parameters
+	TInt	charCode = 0;
+	if(!GetIntFromConfig(aSection, KCharCode(), charCode))
+		{
+		ERR_PRINTF2(_L("No %S"), &KCharCode());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// call HasCharacter()
+		TBool	actual = iFbsFont->HasCharacter(charCode);
+
+		TBool	expected;
+		if(GetBoolFromConfig(aSection, KExpectedBool(), expected))
+			{
+		// check that the value is as expected
+			if (actual != expected)
+				{
+				ERR_PRINTF3(_L("The value is not as expected! expected: %d, actual: %d"), expected, actual);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fbserv/src/T_DataFbsSession.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,749 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataFbsSession
+*/
+
+#include "T_DataFbsSession.h"
+#include "T_GraphicsUtil.h"
+
+
+/*@{*/
+///	Parameters
+_LIT(KSession,										"session");
+_LIT(KInvalidSession,								"invalid_session");
+_LIT(KNullSession,									"null_session");
+_LIT(KExpectedCallBack,								"expected");
+_LIT(KExpectedDiff,									"expected_diff");
+_LIT(KFbsMessage,									"fbs_message");
+_LIT(KBitmap,										"bitmap");
+_LIT(KFbsParameter0,								"parameter0");
+_LIT(KFbsParameter1,								"parameter1");
+_LIT(KFbsParameter2,								"parameter2");
+_LIT(KFbsParameter3,								"parameter3");
+_LIT(KVersionName,									"name");
+_LIT(KVersionBuild,									"build");
+_LIT(KVersionMajor,									"major");
+_LIT(KVersionMinor,									"minor");
+
+///	Commands
+_LIT(KCmdConstructor,								"Constructor");
+_LIT(KCmdConnect,									"Connect");
+_LIT(KCmdDisconnect,								"Disconnect");
+_LIT(KCmdGetSession,								"GetSession");
+_LIT(KCmdCallBack,									"CallBack");
+_LIT(KCmdSetCallBack,								"SetCallBack");
+_LIT(KCmdResetCallBack,								"ResetCallBack");
+_LIT(KCmdResourceCount,								"ResourceCount");
+_LIT(KCmdSendCommand,								"SendCommand");
+_LIT(KCmdVersion,									"Version");
+_LIT(KCmdHeapBase,									"HeapBase");
+_LIT(KCmdSessionHandle,								"SessionHandle");
+
+_LIT(KFbsMessInit,									"EFbsMessInit");
+_LIT(KFbsMessShutdown,								"EFbsMessShutdown");
+_LIT(KFbsMessClose,									"EFbsMessClose");
+_LIT(KFbsMessResourceCount,							"EFbsMessResourceCount");
+_LIT(KFbsMessNumTypefaces,							"EFbsMessNumTypefaces");
+_LIT(KFbsMessTypefaceSupport,						"EFbsMessTypefaceSupport");
+_LIT(KFbsMessFontHeightInTwips,						"EFbsMessFontHeightInTwips");
+_LIT(KFbsMessFontHeightInPixels,					"EFbsMessFontHeightInPixels");
+_LIT(KFbsMessAddFontStoreFile,						"EFbsMessAddFontStoreFile");
+_LIT(KFbsMessInstallFontStoreFile,					"EFbsMessInstallFontStoreFile");
+_LIT(KFbsMessRemoveFontStoreFile,					"EFbsMessRemoveFontStoreFile");
+_LIT(KFbsMessSetPixelHeight,						"EFbsMessSetPixelHeight");
+_LIT(KFbsMessGetFontById,							"EFbsMessGetFontById");
+_LIT(KFbsMessFontDuplicate,							"EFbsMessFontDuplicate");
+_LIT(KFbsMessBitmapCreate,							"EFbsMessBitmapCreate");
+_LIT(KFbsMessBitmapResize,							"EFbsMessBitmapResize");
+_LIT(KFbsMessBitmapDuplicate,						"EFbsMessBitmapDuplicate");
+_LIT(KFbsMessBitmapLoad,							"EFbsMessBitmapLoad");
+_LIT(KFbsMessDefaultAllocFail,						"EFbsMessDefaultAllocFail");
+_LIT(KFbsMessDefaultMark,							"EFbsMessDefaultMark");
+_LIT(KFbsMessDefaultMarkEnd,						"EFbsMessDefaultMarkEnd");
+_LIT(KFbsMessUserAllocFail,							"EFbsMessUserAllocFail");
+_LIT(KFbsMessUserMark,								"EFbsMessUserMark");
+_LIT(KFbsMessUserMarkEnd,							"EFbsMessUserMarkEnd");
+_LIT(KFbsMessHeapCheck,								"EFbsMessHeapCheck");
+_LIT(KFbsMessRasterize,								"EFbsMessRasterize");
+_LIT(KFbsMessFaceAttrib,							"EFbsMessFaceAttrib");
+_LIT(KFbsMessHasCharacter,							"EFbsMessHasCharacter");
+_LIT(KFbsMessSetDefaultGlyphBitmapType,				"EFbsMessSetDefaultGlyphBitmapType");
+_LIT(KFbsMessGetDefaultGlyphBitmapType,				"EFbsMessGetDefaultGlyphBitmapType");
+_LIT(KFbsMessFontNameAlias,							"EFbsMessFontNameAlias");
+_LIT(KFbsMessBitmapCompress,						"EFbsMessBitmapCompress");
+_LIT(KFbsMessGetHeapSizes,							"EFbsMessGetHeapSizes");
+_LIT(KFbsMessGetNearestFontToDesignHeightInTwips,	"EFbsMessGetNearestFontToDesignHeightInTwips");
+_LIT(KFbsMessGetNearestFontToMaxHeightInTwips,		"EFbsMessGetNearestFontToMaxHeightInTwips");
+_LIT(KFbsMessGetNearestFontToDesignHeightInPixels,	"EFbsMessGetNearestFontToDesignHeightInPixels");
+_LIT(KFbsMessGetNearestFontToMaxHeightInPixels,		"EFbsMessGetNearestFontToMaxHeightInPixels");
+_LIT(KFbsMessShapeText,								"EFbsMessShapeText");
+_LIT(KFbsMessShapeDelete,							"EFbsMessShapeDelete");
+_LIT(KFbsMessDefaultLanguageForMetrics,				"EFbsMessDefaultLanguageForMetrics");
+_LIT(KFbsMessSetTwipsHeight,						"EFbsMessSetTwipsHeight");
+_LIT(KFbsMessGetTwipsHeight,						"EFbsMessGetTwipsHeight");
+_LIT(KFbsCompress,									"EFbsCompress");
+_LIT(KFbsMessBitmapBgCompress,						"EFbsMessBitmapBgCompress");
+_LIT(KFbsSetSystemDefaultTypefaceName,				"EFbsSetSystemDefaultTypefaceName");
+_LIT(KFbsGetAllBitmapHandles,						"EFbsGetAllBitmapHandles");
+_LIT(KFbsMessCreateLinkedTypeface,					"EFbsMessCreateLinkedTypeface");
+_LIT(KFbsMessSetHeapFail,							"EFbsMessSetHeapFail");
+_LIT(KFbsMessHeapCount,								"EFbsMessHeapCount");
+_LIT(KFbsMessSetHeapReset,							"EFbsMessSetHeapReset");
+_LIT(KFbsMessSetHeapCheck,							"EFbsMessSetHeapCheck");
+_LIT(KFbsMessHeap,									"EFbsMessHeap");
+_LIT(KFbsMessLinkedCache,							"EFbsMessLinkedCache");
+_LIT(KFbsMessBitmapClean,							"EFbsMessBitmapClean");
+/*@}*/
+
+/**
+* Two phase constructor
+*/
+CT_DataFbsSession* CT_DataFbsSession::NewL()
+	{
+	CT_DataFbsSession*	ret = new (ELeave) CT_DataFbsSession();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+/**
+* Protected constructor. First phase construction
+*/
+CT_DataFbsSession::CT_DataFbsSession()
+:	CDataWrapperBase()
+,	iSession(NULL)
+,	iResourceCount(-1)
+,	iCallBackCalled(EFalse)
+	{
+	}
+
+/**
+* Second phase construction
+*/
+void CT_DataFbsSession::ConstructL()
+	{
+	}
+
+/**
+* Protected destructor.
+*/
+CT_DataFbsSession::~CT_DataFbsSession()
+	{
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataFbsSession::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool	ret=ETrue;
+
+	if (aCommand == KCmdConstructor)
+		{
+		DoCmdConstructor();
+		}
+	else if (aCommand == KCmdConnect)
+		{
+		DoCmdConnect(aSection);
+		}
+	else if (aCommand == KCmdDisconnect)
+		{
+		DoCmdDisconnect();
+		}
+	else if (aCommand == KCmdGetSession)
+		{
+		DoCmdGetSession(aSection);
+		}
+	else if (aCommand == KCmdCallBack)
+		{
+		DoCmdCallBack(aSection);
+		}
+	else if (aCommand == KCmdResetCallBack)
+		{
+		DoCmdResetCallBack();
+		}
+	else if (aCommand == KCmdSetCallBack)
+		{
+		DoCmdSetCallBack();
+		}
+	else if (aCommand == KCmdResourceCount)
+		{
+		DoCmdResourceCount(aSection);
+		}
+	else if (aCommand == KCmdSendCommand)
+		{
+		DoCmdSendCommandL(aSection);
+		}
+	else if (aCommand == KCmdVersion)
+		{
+		DoCmdVersion(aSection);
+		}
+	else if (aCommand == KCmdHeapBase)
+		{
+		DoCmdHeapBase();
+		}
+	else if (aCommand == KCmdSessionHandle)
+		{
+		DoCmdSessionHandle();
+		}
+	else
+		{
+		ret=EFalse;
+		}
+
+	return ret;
+	}
+
+
+void CT_DataFbsSession::DoCmdConstructor()
+	{
+	INFO_PRINTF1(_L("Call RFbsSession's constructor"));
+
+	RFbsSession	tempSession;
+	}
+
+
+/** RFbsSession::Connect() Call */
+void CT_DataFbsSession::DoCmdConnect(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("RFbsSession::Connect() call"));
+
+	TBool	session=EFalse;
+	GetBoolFromConfig(aSection, KSession(), session);
+
+	TBool	invalidSession=EFalse;
+	GetBoolFromConfig(aSection, KInvalidSession(), invalidSession);
+
+	TInt	err=KErrNone;
+	if ( session )
+		{
+		err=RFbsSession::Connect(FileServer());
+		}
+	else if ( invalidSession )
+		{
+		err=RFbsSession::Connect(iFsUnconnected);
+		}
+	else
+		{
+		err=RFbsSession::Connect();
+		}
+
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(_L("Connect failed with error %d"), err);
+		SetError(err);
+		}
+	}
+
+/** RFbsSession::Disconnect() call */
+void CT_DataFbsSession::DoCmdDisconnect()
+	{
+	INFO_PRINTF1(_L("RFbsSession::Disconnect() call"));
+	RFbsSession::Disconnect();
+	}
+
+/** RFbsSession::GetSession() check */
+void CT_DataFbsSession::DoCmdGetSession(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("RFbsSession::GetSession() check"));
+
+	// get not_null_session parameter value
+
+	TBool	nullSessionExpected = EFalse;
+	GetBoolFromConfig(aSection, KNullSession(), nullSessionExpected);
+
+	// check result of GetSession() method
+	iSession = RFbsSession::GetSession();
+
+	if ( nullSessionExpected )
+		{
+		if ( iSession != NULL )
+			{
+			// Session is expected to be null but it is not null
+			ERR_PRINTF1(_L("Session is expected to be null but it is not null!"));
+			SetBlockResult(EFail);
+			}
+		}
+	else
+		{
+		if ( iSession == NULL )
+			{
+			ERR_PRINTF1(_L("Session is expected to be not null but it is null!"));
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** RFbsSession::CallBack() call */
+void CT_DataFbsSession::DoCmdCallBack(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("RFbsSession::CallBack() call"));
+	iCallBackCalled=EFalse;
+	iSession->CallBack();
+
+	// get expected callback parameter value
+	TBool	expected;
+	if( GetBoolFromConfig(aSection, KExpectedCallBack(), expected) )
+		{
+		if ( expected != iCallBackCalled )
+			{
+			ERR_PRINTF3(_L("Expected callback %d does not equal actual callback %d"), expected, iCallBackCalled);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Set call back function uding RFbsSession::SetCallBack() */
+void CT_DataFbsSession::DoCmdSetCallBack()
+	{
+	INFO_PRINTF1(_L("Set call back function uding SetCallBack()"));
+	TCallBack	callBack(CallBackFunction, this);
+	iCallBackCalled=EFalse;
+	iSession->SetCallBack(callBack);
+	}
+
+
+/** RFbsSession::ResetCallBack() call */
+void CT_DataFbsSession::DoCmdResetCallBack()
+	{
+	INFO_PRINTF1(_L("RFbsSession::ResetCallBack() call"));
+	iCallBackCalled=EFalse;
+	iSession->ResetCallBack();
+	}
+
+
+/** RFbsSession::ResourceCount() call, memorize resource count */
+void CT_DataFbsSession::DoCmdResourceCount(const TDesC& aSection)
+	{
+	TInt	resourceCount=iSession->ResourceCount();
+	INFO_PRINTF2(_L("RFbsSession::ResourceCount() %d"), resourceCount);
+
+
+	// get expected difference from parameters
+	TInt	expectedDifference;
+	if ( GetIntFromConfig(aSection, KExpectedDiff(), expectedDifference) )
+		{
+		TInt	actualDifference=resourceCount-iResourceCount;
+		if ( actualDifference != expectedDifference )
+			{
+			ERR_PRINTF3(_L("Resource count difference is not as expected! expected: %d, actual: %d"), expectedDifference, actualDifference);
+			SetBlockResult(EFail);
+			}
+		}
+
+	iResourceCount = resourceCount;
+	}
+
+
+/** RFbsSession::SendCommand() call */
+void CT_DataFbsSession::DoCmdSendCommandL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("RFbsSession::SendCommand() call"));
+
+	TInt		fbsParameter0=0;
+	CFbsBitmap*	fbsBitmap=NULL;
+	if ( CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KBitmap(), fbsBitmap) )
+		{
+		fbsParameter0=fbsBitmap->Handle();
+		}
+	else
+		{
+		GetIntFromConfig(aSection, KFbsParameter0(), fbsParameter0);
+		}
+
+	TInt	fbsParameter1=0;
+	GetIntFromConfig(aSection, KFbsParameter1(), fbsParameter1);
+
+	TInt	fbsParameter2=0;
+	GetIntFromConfig(aSection, KFbsParameter2(), fbsParameter2);
+
+	TInt	fbsParameter3=0;
+	GetIntFromConfig(aSection, KFbsParameter3(), fbsParameter3);
+
+	TInt	fbsMessage;
+	if ( !GetFbsMessage(aSection, fbsMessage) )
+		{
+		ERR_PRINTF1(_L("No fbs message"));
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		iSession->SendCommand(fbsMessage, fbsParameter0, fbsParameter1, fbsParameter2, fbsParameter3);
+		}
+	}
+
+
+/** RFbsSession::Version() call */
+void CT_DataFbsSession::DoCmdVersion(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("RFbsSession::Version() call"));
+
+	TVersion		version		= iSession->Version();
+	TVersionName	versionName	= version.Name();
+	INFO_PRINTF2(_L("Version name  : %s"), &versionName);
+	INFO_PRINTF2(_L("Version build : %d"), (TInt)version.iBuild);
+	INFO_PRINTF2(_L("Version major : %d"), (TInt)version.iMajor);
+	INFO_PRINTF2(_L("Version minor : %d"), (TInt)version.iMinor);
+
+	TPtrC	name;
+	if ( GetStringFromConfig(aSection, KVersionName(), name) )
+		{
+		if ( name != version.Name() )
+			{
+			ERR_PRINTF1(_L("Name does not match expected name"));
+			SetBlockResult(EFail);
+			}
+		}
+
+	TInt	intTemp;
+	if ( GetIntFromConfig(aSection, KVersionBuild(), intTemp) )
+		{
+		if ( intTemp != version.iBuild )
+			{
+			ERR_PRINTF1(_L("Build does not match expected build"));
+			SetBlockResult(EFail);
+			}
+		}
+
+	if ( GetIntFromConfig(aSection, KVersionMajor(), intTemp) )
+		{
+		if ( intTemp != version.iMajor )
+			{
+			ERR_PRINTF1(_L("Major does not match expected major"));
+			SetBlockResult(EFail);
+			}
+		}
+
+	if ( GetIntFromConfig(aSection, KVersionMinor(), intTemp) )
+		{
+		if ( intTemp != version.iMinor )
+			{
+			ERR_PRINTF1(_L("Minor does not match expected minor"));
+			SetBlockResult(EFail);
+			}
+		}
+
+	if (version.Name() == _L("") && version.iBuild == 0 && version.iMajor == 0 && version.iMinor == 0)
+		{
+		ERR_PRINTF1(_L("Some version fields are not set!"));
+		SetBlockResult(EFail);
+		}
+	}
+
+
+/** RFbsSession::HeapBase() call */
+void CT_DataFbsSession::DoCmdHeapBase()
+	{
+	TUint8*	heapBase = iSession->HeapBase();
+	INFO_PRINTF2(_L("RFbsSession::HeapBase() %d"), heapBase);
+
+	if (heapBase == NULL)
+		{
+		ERR_PRINTF1(_L("Heap base is null!"));
+		SetBlockResult(EFail);
+		}
+	}
+
+
+/** RFbsSession::SessionHandle() call */
+void CT_DataFbsSession::DoCmdSessionHandle()
+	{
+	TInt	sessionHandle = iSession->SessionHandle();
+	INFO_PRINTF2(_L("RFbsSession::SessionHandle() %d"), sessionHandle);
+
+	if (sessionHandle == 0)
+		{
+		ERR_PRINTF1(_L("Session handle is 0!"));
+		SetBlockResult(EFail);
+		}
+	}
+
+
+/**
+* Return a pointer to the object that the data wraps. Not implemented, returns NULL.
+*
+* @return pointer to the object that the data wraps. Not implemented, returns NULL.
+*/
+TAny* CT_DataFbsSession::GetObject()
+	{
+	return iSession;
+	}
+
+
+/** Function used as a call back, that sets GlobalCallBackCalled to true*/
+TInt CT_DataFbsSession::CallBackFunction(TAny* aThis)
+	{
+	return static_cast<CT_DataFbsSession*>(aThis)->CallBackFunction();
+	}
+
+
+/** Function used as a call back, that sets GlobalCallBackCalled to true*/
+TInt CT_DataFbsSession::CallBackFunction()
+	{
+	return iCallBackCalled = ETrue;
+	}
+
+TBool CT_DataFbsSession::GetFbsMessage(const TDesC& aSection, TInt& aMessage)
+	{
+	TPtrC	fbsMessage;
+	TBool	ret=GetStringFromConfig(aSection, KFbsMessage(), fbsMessage);
+	if ( !ret )
+		{
+		ERR_PRINTF2(_L("No %S"), &KFbsMessage());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if ( fbsMessage==KFbsMessInit )
+			{
+			aMessage = EFbsMessInit;
+			}
+		else if ( fbsMessage==KFbsMessShutdown )
+			{
+			aMessage = EFbsMessShutdown;
+			}
+		else if ( fbsMessage==KFbsMessClose )
+			{
+			aMessage = EFbsMessClose;
+			}
+		else if ( fbsMessage==KFbsMessResourceCount )
+			{
+			aMessage = EFbsMessResourceCount;
+			}
+		else if ( fbsMessage==KFbsMessNumTypefaces )
+			{
+			aMessage = EFbsMessNumTypefaces;
+			}
+		else if ( fbsMessage==KFbsMessTypefaceSupport )
+			{
+			aMessage = EFbsMessTypefaceSupport;
+			}
+		else if ( fbsMessage==KFbsMessFontHeightInTwips )
+			{
+			aMessage = EFbsMessFontHeightInTwips;
+			}
+		else if ( fbsMessage==KFbsMessFontHeightInPixels )
+			{
+			aMessage = EFbsMessFontHeightInPixels;
+			}
+		else if ( fbsMessage==KFbsMessAddFontStoreFile )
+			{
+			aMessage = EFbsMessAddFontStoreFile;
+			}
+		else if ( fbsMessage==KFbsMessInstallFontStoreFile )
+			{
+			aMessage = EFbsMessInstallFontStoreFile;
+			}
+		else if ( fbsMessage==KFbsMessRemoveFontStoreFile )
+			{
+			aMessage = EFbsMessRemoveFontStoreFile;
+			}
+		else if ( fbsMessage==KFbsMessSetPixelHeight )
+			{
+			aMessage = EFbsMessSetPixelHeight;
+			}
+		else if ( fbsMessage==KFbsMessGetFontById )
+			{
+			aMessage = EFbsMessGetFontById;
+			}
+		else if ( fbsMessage==KFbsMessFontDuplicate )
+			{
+			aMessage = EFbsMessFontDuplicate;
+			}
+		else if ( fbsMessage==KFbsMessBitmapCreate )
+			{
+			aMessage = EFbsMessBitmapCreate;
+			}
+		else if ( fbsMessage==KFbsMessBitmapResize )
+			{
+			aMessage = EFbsMessBitmapResize;
+			}
+		else if ( fbsMessage==KFbsMessBitmapDuplicate )
+			{
+			aMessage = EFbsMessBitmapDuplicate;
+			}
+		else if ( fbsMessage==KFbsMessBitmapLoad )
+			{
+			aMessage = EFbsMessBitmapLoad;
+			}
+		else if ( fbsMessage==KFbsMessDefaultAllocFail )
+			{
+			aMessage = EFbsMessDefaultAllocFail;
+			}
+		else if ( fbsMessage==KFbsMessDefaultMark )
+			{
+			aMessage = EFbsMessDefaultMark;
+			}
+		else if ( fbsMessage==KFbsMessDefaultMarkEnd )
+			{
+			aMessage = EFbsMessDefaultMarkEnd;
+			}
+		else if ( fbsMessage==KFbsMessUserAllocFail )
+			{
+			aMessage = EFbsMessUserAllocFail;
+			}
+		else if ( fbsMessage==KFbsMessUserMark )
+			{
+			aMessage = EFbsMessUserMark;
+			}
+		else if ( fbsMessage==KFbsMessUserMarkEnd )
+			{
+			aMessage = EFbsMessUserMarkEnd;
+			}
+		else if ( fbsMessage==KFbsMessHeapCheck )
+			{
+			aMessage = EFbsMessHeapCheck;
+			}
+		else if ( fbsMessage==KFbsMessRasterize )
+			{
+			aMessage = EFbsMessRasterize;
+			}
+		else if ( fbsMessage==KFbsMessFaceAttrib )
+			{
+			aMessage = EFbsMessFaceAttrib;
+			}
+		else if ( fbsMessage==KFbsMessHasCharacter )
+			{
+			aMessage = EFbsMessHasCharacter;
+			}
+		else if ( fbsMessage==KFbsMessSetDefaultGlyphBitmapType )
+			{
+			aMessage = EFbsMessSetDefaultGlyphBitmapType;
+			}
+		else if ( fbsMessage==KFbsMessGetDefaultGlyphBitmapType )
+			{
+			aMessage = EFbsMessGetDefaultGlyphBitmapType;
+			}
+		else if ( fbsMessage==KFbsMessFontNameAlias )
+			{
+			aMessage = EFbsMessFontNameAlias;
+			}
+		else if ( fbsMessage==KFbsMessBitmapCompress )
+			{
+			aMessage = EFbsMessBitmapCompress;
+			}
+		else if ( fbsMessage==KFbsMessGetHeapSizes )
+			{
+			aMessage = EFbsMessGetHeapSizes;
+			}
+		else if ( fbsMessage==KFbsMessGetNearestFontToDesignHeightInTwips )
+			{
+			aMessage = EFbsMessGetNearestFontToDesignHeightInTwips;
+			}
+		else if ( fbsMessage==KFbsMessGetNearestFontToMaxHeightInTwips )
+			{
+			aMessage = EFbsMessGetNearestFontToMaxHeightInTwips;
+			}
+		else if ( fbsMessage==KFbsMessGetNearestFontToDesignHeightInPixels )
+			{
+			aMessage = EFbsMessGetNearestFontToDesignHeightInPixels;
+			}
+		else if ( fbsMessage==KFbsMessGetNearestFontToMaxHeightInPixels )
+			{
+			aMessage = EFbsMessGetNearestFontToMaxHeightInPixels;
+			}
+		else if ( fbsMessage==KFbsMessShapeText )
+			{
+			aMessage = EFbsMessShapeText;
+			}
+		else if ( fbsMessage==KFbsMessShapeDelete )
+			{
+			aMessage = EFbsMessShapeDelete;
+			}
+		else if ( fbsMessage==KFbsMessDefaultLanguageForMetrics )
+			{
+			aMessage = EFbsMessDefaultLanguageForMetrics;
+			}
+		else if ( fbsMessage==KFbsMessSetTwipsHeight )
+			{
+			aMessage = EFbsMessSetTwipsHeight;
+			}
+		else if ( fbsMessage==KFbsMessGetTwipsHeight )
+			{
+			aMessage = EFbsMessGetTwipsHeight;
+			}
+		else if ( fbsMessage==KFbsCompress )
+			{
+			aMessage = EFbsCompress;
+			}
+		else if ( fbsMessage==KFbsMessBitmapBgCompress )
+			{
+			aMessage = EFbsMessBitmapBgCompress;
+			}
+
+		else if ( fbsMessage==KFbsSetSystemDefaultTypefaceName )
+			{
+			aMessage = EFbsSetSystemDefaultTypefaceName;
+			}
+		else if ( fbsMessage==KFbsGetAllBitmapHandles )
+			{
+			aMessage = EFbsGetAllBitmapHandles;
+			}
+		else if ( fbsMessage==KFbsMessCreateLinkedTypeface )
+			{
+			aMessage = EFbsMessCreateLinkedTypeface;
+			}
+		else if ( fbsMessage==KFbsMessSetHeapFail )
+			{
+			aMessage = EFbsMessSetHeapFail;
+			}
+		else if ( fbsMessage==KFbsMessHeapCount )
+			{
+			aMessage = EFbsMessHeapCount;
+			}
+		else if ( fbsMessage==KFbsMessSetHeapReset )
+			{
+			aMessage = EFbsMessSetHeapReset;
+			}
+		else if ( fbsMessage==KFbsMessSetHeapCheck )
+			{
+			aMessage = EFbsMessSetHeapCheck;
+			}
+		else if ( fbsMessage==KFbsMessHeap )
+			{
+			aMessage = EFbsMessHeap;
+			}
+		else if ( fbsMessage==KFbsMessLinkedCache )
+			{
+			aMessage = EFbsMessLinkedCache;
+			}
+		else if ( fbsMessage==KFbsMessBitmapClean )
+			{
+			aMessage = EFbsMessBitmapClean;
+			}
+		else
+			{
+			ret=GetIntFromConfig(aSection, KFbsMessage(), aMessage);
+			}
+		}
+
+	return ret;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fbserv/src/T_DataFbsTypefaceStore.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,722 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataFbsTypefaceStore
+*/
+
+#include "T_DataFbsTypefaceStore.h"
+#include "T_GraphicsUtil.h"
+
+
+/*@{*/
+///	Parameters
+_LIT(KAllFonts,										"all_fonts");
+_LIT(KDriveName,									"drive_name");
+_LIT(KFileName,										"file_name");
+_LIT(KFont,											"font");
+_LIT(KFontUid,										"font_uid");
+_LIT(KFontNameAlias,								"font_name_alias");
+_LIT(KFontName,										"font_name");
+_LIT(KLanguage,										"language");
+_LIT(KTypefaceId,									"typeface_id");
+_LIT(KGraphicsDevice,								"graphics_device");
+_LIT(KFontMaxHeight,								"font_max_height");
+_LIT(KTypefaceIndex,								"typeface_index");
+_LIT(KHeightIndex,									"height_index");
+_LIT(KUseFileName,									"use_file_name");
+_LIT(KUseDriveName,									"use_drive_name");
+_LIT(KAlgStyle,										"alg_style");
+_LIT(KCheckAgainstMaximum,							"check_against_maximum");
+_LIT(KCheckHeightPositive,							"check_height_positive");
+_LIT(KGlyphBitmapType,								"glyph_bitmap_type");
+
+///	Commands
+_LIT(KCmdNewL,										"NewL");
+_LIT(KCmdAddFile,									"AddFile");
+_LIT(KCmdInstallFile,								"InstallFile");
+_LIT(KCmdRemoveFile,			 					"RemoveFile");
+_LIT(KCmdGetNearestFontInPixels,					"GetNearestFontInPixels");
+_LIT(KCmdGetNearestFontToDesignHeightInPixels,		"GetNearestFontToDesignHeightInPixels");
+_LIT(KCmdGetNearestFontToMaxHeightInPixels,			"GetNearestFontToMaxHeightInPixels");
+_LIT(KCmdGetFontById, 			 					"GetFontById");
+_LIT(KCmdFontHeightInPixels,						"FontHeightInPixels");
+_LIT(KCmdDefaultBitmapType, 						"DefaultBitmapType");
+_LIT(KCmdSetDefaultBitmapType, 						"SetDefaultBitmapType");
+_LIT(KCmdSetFontNameAliasL,							"SetFontNameAliasL");
+_LIT(KCmdSetDefaultLanguageForMetrics,				"SetDefaultLanguageForMetrics");
+_LIT(KCmdRemoveFontFileLocksL,						"RemoveFontFileLocksL");
+_LIT(KCmdSetSystemDefaultTypefaceName,				"SetSystemDefaultTypefaceNameL");
+_LIT(KCmdDestructor,								"~");
+
+///	Logging
+_LIT(KLogError,										"Error=%d");
+_LIT(KLogMissingParameter,							"Missing parameter '%S'");
+/*@}*/
+
+
+/**
+* Two phase constructor
+*/
+CT_DataFbsTypefaceStore* CT_DataFbsTypefaceStore::NewL()
+	{
+	CT_DataFbsTypefaceStore* ret = new (ELeave) CT_DataFbsTypefaceStore();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+
+/**
+* Protected constructor. First phase construction
+*/
+CT_DataFbsTypefaceStore::CT_DataFbsTypefaceStore()
+:	CT_DataTypefaceStore()
+,	iFbsTypefaceStore(NULL)
+,	iLastTypefaceFileId(0)
+	{
+	}
+
+
+/**
+* Protected second phase construction
+*/
+void CT_DataFbsTypefaceStore::ConstructL()
+	{
+	}
+
+
+/**
+* Destructor.
+*/
+CT_DataFbsTypefaceStore::~CT_DataFbsTypefaceStore()
+	{
+	DestroyData();
+	}
+
+
+/**
+* cleanup implementation.
+*/
+void CT_DataFbsTypefaceStore::DestroyData()
+	{
+	delete iFbsTypefaceStore;
+	iFbsTypefaceStore = NULL;
+	}
+
+
+/**
+* Return a pointer to the object that the data wraps
+*
+* @return pointer to the object that the data wraps
+*/
+TAny* CT_DataFbsTypefaceStore::GetObject()
+	{
+	return iFbsTypefaceStore;
+	}
+
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataFbsTypefaceStore::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	ret=ETrue;
+
+	if (aCommand == KCmdNewL)
+		{
+		DoCmdNewL(aSection);
+		}
+	else if (aCommand == KCmdAddFile)
+		{
+		DoCmdAddFile(aSection);
+		}
+	else if (aCommand == KCmdInstallFile)
+		{
+		DoCmdInstallFile(aSection);
+		}
+	else if (aCommand == KCmdRemoveFile)
+		{
+		DoCmdRemoveFile(aSection);
+		}
+	else if (aCommand == KCmdGetNearestFontInPixels)
+		{
+		DoCmdGetNearestFontInPixelsL(aSection);
+		}
+	else if (aCommand == KCmdGetNearestFontToDesignHeightInPixels)
+		{
+		DoCmdGetNearestFontToDesignHeightInPixelsL(aSection);
+		}
+	else if (aCommand == KCmdGetNearestFontToMaxHeightInPixels)
+		{
+		DoCmdGetNearestFontToMaxHeightInPixelsL(aSection);
+		}
+	else if (aCommand == KCmdGetFontById)
+		{
+		DoCmdGetFontByIdL(aSection);
+		}
+	else if (aCommand == KCmdFontHeightInPixels)
+		{
+		DoCmdFontHeightInPixels(aSection);
+		}
+	else if (aCommand == KCmdDefaultBitmapType)
+		{
+		DoCmdDefaultBitmapType(aSection);
+		}
+	else if (aCommand == KCmdSetDefaultBitmapType)
+		{
+		DoCmdSetDefaultBitmapType(aSection);
+		}
+	else if (aCommand == KCmdSetFontNameAliasL)
+		{
+		DoCmdSetFontNameAlias(aSection);
+		}
+	else if (aCommand == KCmdSetDefaultLanguageForMetrics)
+		{
+		DoCmdSetDefaultLanguageForMetrics(aSection);
+		}
+	else if (aCommand == KCmdRemoveFontFileLocksL)
+		{
+		DoCmdRemoveFontFileLocks(aSection);
+		}
+	else if (aCommand == KCmdSetSystemDefaultTypefaceName)
+		{
+		DoCmdSetSystemDefaultTypefaceName(aSection);
+		}
+	else if (aCommand == KCmdDestructor)
+		{
+		DestroyData();
+		}
+	else
+		{
+		ret=CT_DataTypefaceStore::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+
+	return ret;
+	}
+
+
+CTypefaceStore* CT_DataFbsTypefaceStore::GetTypefaceStore() const
+	{
+	return iFbsTypefaceStore;
+	}
+
+
+
+////////////////// COMMANDS IMPLEMENTATION  ////////////////////////
+
+/** CFbsTypefaceStore::NewL() call */
+void CT_DataFbsTypefaceStore::DoCmdNewL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("CFbsTypefaceStore::NewL() call"));
+
+	// cleanup if any
+	DestroyData();
+
+
+	// get FbsBitmapData object from parameters
+	CGraphicsDevice*	device=NULL;
+	TPtrC	deviceName;
+	if ( GetStringFromConfig(aSection, KGraphicsDevice(), deviceName) )
+		{
+		// check that the data object was found
+		device=static_cast<CGraphicsDevice*>(GetDataObjectL(deviceName));
+		}
+
+	// do create
+	TRAPD(err, iFbsTypefaceStore = CFbsTypefaceStore::NewL(device));
+
+	// check error code
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(_L("CFbsTypefaceStore creation error: %d"), err);
+		SetError(err);
+		}
+	}
+
+
+/** Call CFbsTypefaceStore::GetNearestFontInPixels() */
+void CT_DataFbsTypefaceStore::DoCmdGetNearestFontInPixelsL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Call CFbsTypefaceStore::GetNearestFontInPixels()"));
+
+	TFontSpec	fontSpec;
+	if ( !GetFontSpecFromConfig(aSection, KFont, fontSpec) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFont());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// call CFbsTypefaceStore::GetNearestFontInPixels()
+		CFont*		font = NULL;
+		TInt		err = iFbsTypefaceStore->GetNearestFontInPixels(font, fontSpec);
+
+		// check error code
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		else
+			{
+			// set fbs font data object of provided
+			SetFontDataObjectIfPassedAsParameterL(font, aSection);
+			}
+		}
+	}
+
+
+/** Call CFbsTypefaceStore::GetNearestFontToDesignHeightInPixels() */
+void CT_DataFbsTypefaceStore::DoCmdGetNearestFontToDesignHeightInPixelsL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Call CFbsTypefaceStore::GetNearestFontToDesignHeightInPixels()"));
+
+	TFontSpec	fontSpec;
+	if ( !GetFontSpecFromConfig(aSection, KFont, fontSpec) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFont());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// call CFbsTypefaceStore::GetNearestFontToDesignHeightInPixels()
+		CFont*		fbsFont = NULL;
+		TInt		err = iFbsTypefaceStore->GetNearestFontToDesignHeightInPixels(fbsFont, fontSpec);
+
+		// check error code
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		else
+			{
+			// set fbs font data object of provided
+			SetFontDataObjectIfPassedAsParameterL(fbsFont, aSection);
+			}
+		}
+	}
+
+
+/** Call CFbsTypefaceStore::GetNearestFontToMaxHeightInPixels() */
+void CT_DataFbsTypefaceStore::DoCmdGetNearestFontToMaxHeightInPixelsL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Call CFbsTypefaceStore::GetNearestFontToMaxHeightInPixels()"));
+
+	TBool		dataOk=ETrue;
+
+	TFontSpec	fontSpec;
+	if ( !GetFontSpecFromConfig(aSection, KFont, fontSpec) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFont());
+		SetBlockResult(EFail);
+		}
+
+	TInt	fontMaxHeight;
+	if ( !GetIntFromConfig(aSection, KFontMaxHeight(), fontMaxHeight) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFontMaxHeight());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		// call CFbsTypefaceStore::GetNearestFontToMaxHeightInPixels()
+		CFont*		fbsFont = NULL;
+		TInt		err = iFbsTypefaceStore->GetNearestFontToMaxHeightInPixels(fbsFont, fontSpec, fontMaxHeight);
+
+		// check error code
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(_L("Get nearest font to max height in twips error: %d"), err);
+			SetError(err);
+			}
+		else
+			{
+			// set fbs font data object of provided
+			SetFontDataObjectIfPassedAsParameterL(fbsFont, aSection);
+
+			// get check against maximum parameter from parameters
+			TBool	checkAgainstMaximum = EFalse;
+			GetBoolFromConfig(aSection, KCheckAgainstMaximum(), checkAgainstMaximum);
+
+			if ( checkAgainstMaximum )
+				{
+				// check that the height of the returned font is not greater that the maximum specified
+				if (fbsFont->HeightInPixels() > fontMaxHeight)
+					{
+					ERR_PRINTF3(_L("Font doesn't match in maximum specified, height: %d, maximum: %d"), fbsFont->HeightInPixels(), fontMaxHeight);
+					SetBlockResult(EFail);
+					}
+				}
+			}
+		}
+	}
+
+
+/** Call CFbsTypefaceStore::AddFile(), remeber typeface id */
+void CT_DataFbsTypefaceStore::DoCmdAddFile(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Call CFbsTypefaceStore::AddFile(), remeber typeface id"));
+
+	// get font file name from parameters
+	TPtrC	fileName;
+	if (!GetStringFromConfig(aSection, KFileName(), fileName))
+		{
+		ERR_PRINTF2(_L("No %S"), &KFileName());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// call AddFile()
+		TInt	err = iFbsTypefaceStore->AddFile(fileName, iLastTypefaceFileId);
+		INFO_PRINTF2(_L("Id %d"), iLastTypefaceFileId);
+
+		// check error code
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(_L("Add file error: %d"), err);
+			SetError(err);
+			}
+		}
+	}
+
+
+/** Call CFbsTypefaceStore::InstallFile(), remeber typeface id */
+void CT_DataFbsTypefaceStore::DoCmdInstallFile(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Call CFbsTypefaceStore::InstallFile(), remeber typeface id"));
+
+	// get font file name from parameters
+	TPtrC	fileName;
+	if (!GetStringFromConfig(aSection, KFileName(), fileName))
+		{
+		ERR_PRINTF2(_L("No %S"), &KFileName());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// call InstallFile()
+		TInt	err = iFbsTypefaceStore->InstallFile(fileName, iLastTypefaceFileId);
+		INFO_PRINTF2(_L("Id %d"), iLastTypefaceFileId);
+
+		// check error code
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(_L("Install file error: %d"), err);
+			SetError(err);
+			}
+		}
+	}
+
+
+/** Call CFbsTypefaceStore::RemoveFile() */
+void CT_DataFbsTypefaceStore::DoCmdRemoveFile(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Call CFbsTypefaceStore::RemoveFile()"));
+
+	// get typeface id from parameters if provided
+	TInt	typefaceId=iLastTypefaceFileId;
+	GetIntFromConfig(aSection, KTypefaceId(), typefaceId);
+	INFO_PRINTF2(_L("Typeface id provided : %d"), typefaceId);
+
+	// call RemoveFile()
+	iFbsTypefaceStore->RemoveFile(typefaceId);
+	}
+
+
+/** Call CFbsTypefaceStore::GetFontById() */
+void CT_DataFbsTypefaceStore::DoCmdGetFontByIdL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Call CFbsTypefaceStore::GetFontById()"));
+
+	// get font uid from parameters
+	TInt	fontUid;
+	if(!GetIntFromConfig(aSection, KFontUid(), fontUid))
+		{
+		ERR_PRINTF2(_L("No %S"), &KFontUid());
+		SetBlockResult(EFail);
+		}
+
+	// call GetFontById()
+	TAlgStyle*	algStylePointer = NULL;
+	CT_GraphicsUtil::GetAlgStyleL(*this, aSection, KAlgStyle(), algStylePointer);
+
+	CFont* 	fbsFont = NULL;
+	TInt	err = KErrNone;
+	if (algStylePointer == NULL)
+		{
+		TAlgStyle	algStyle;
+		err = iFbsTypefaceStore->GetFontById(fbsFont, TUid::Uid(fontUid), algStyle);
+		}
+	else
+		{
+		err = iFbsTypefaceStore->GetFontById(fbsFont, TUid::Uid(fontUid), *algStylePointer);
+		}
+
+	// check error code
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(_L("Get font by id error: %d"), err);
+		SetError(err);
+		}
+	}
+
+
+/** Call CFbsTypefaceStore::FontHeightInPixels() */
+void CT_DataFbsTypefaceStore::DoCmdFontHeightInPixels(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Call CFbsTypefaceStore::FontHeightInPixels()"));
+	TBool								dataOk=ETrue;
+
+	// get typeface index from parameters
+	TInt	typefaceIndex;
+	if(!GetIntFromConfig(aSection, KTypefaceIndex(), typefaceIndex))
+		{
+		ERR_PRINTF2(_L("No %S"), &KTypefaceIndex());
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+
+	// get height index from parameters
+	TInt	heightIndex;
+	if(!GetIntFromConfig(aSection, KHeightIndex(), heightIndex))
+		{
+		ERR_PRINTF2(_L("No %S"), &KHeightIndex());
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+
+	if ( dataOk )
+		{
+		TInt	typefaceHeight = iFbsTypefaceStore->FontHeightInPixels(typefaceIndex, heightIndex);
+
+		// get positive height check flag from parameters
+		TBool	checkHeightPositive = EFalse;
+		GetBoolFromConfig(aSection, KCheckHeightPositive(), checkHeightPositive);
+
+		// check that TTypefaceSupport fields are set
+		if ( checkHeightPositive && (typefaceHeight<=0) )
+			{
+			ERR_PRINTF2(_L("Typeface height is not greater than 0, height: %d"), typefaceHeight);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Call CFbsTypefaceStore::DefaultBitmapType() and compare value with expected */
+void CT_DataFbsTypefaceStore::DoCmdDefaultBitmapType(const TDesC& aSection)
+	{
+	// get actual value of default bitmap type
+	TGlyphBitmapType	actualValue = iFbsTypefaceStore->DefaultBitmapType();
+
+	INFO_PRINTF2(_L("CFbsTypefaceStore::DefaultBitmapType() %d"), actualValue);
+
+
+	// get expected value of default bitmap type from parameters
+	TGlyphBitmapType	expectedType;
+	if (!CT_GraphicsUtil::ReadGlyphBitmapType(*this, aSection, KGlyphBitmapType(), expectedType))
+		{
+		ERR_PRINTF1(_L("No glyph_bitmap_type"));
+		SetBlockResult(EFail);
+		}
+
+	// compare
+	if (actualValue != expectedType)
+		{
+		ERR_PRINTF3(_L("Value of default bitmap type is not as expected, expected: %d, actual: %d"), expectedType, actualValue);
+		SetBlockResult(EFail);
+		}
+	}
+
+
+/** Call CFbsTypefaceStore::SetDefaultBitmapType() */
+void CT_DataFbsTypefaceStore::DoCmdSetDefaultBitmapType(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Call CFbsTypefaceStore::SetDefaultBitmapType()"));
+
+	// get expected value of default bitmap type from parameters
+	TGlyphBitmapType	glyphBitmapType;
+	if (!CT_GraphicsUtil::ReadGlyphBitmapType(*this, aSection, KGlyphBitmapType(), glyphBitmapType))
+		{
+		ERR_PRINTF1(_L("No glyph_bitmap_type"));
+		SetBlockResult(EFail);
+		}
+
+	// get actual value of default bitmap type
+	iFbsTypefaceStore->SetDefaultBitmapType(glyphBitmapType);
+	}
+
+
+/** Calls SetFontNameAliasL() for the given font name and alias name */
+void CT_DataFbsTypefaceStore::DoCmdSetFontNameAlias(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls SetFontNameAliasL() for the given font name and alias name"));
+	TBool								dataOk=ETrue;
+
+	// get font name from parameters
+	TPtrC	fontName;
+	if (!GetStringFromConfig(aSection, KFontName(), fontName))
+		{
+		ERR_PRINTF2(_L("No %S"), &KFontName());
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+
+	// get font name alias from parameters
+	TPtrC	fontNameAlias;
+	if (!GetStringFromConfig(aSection, KFontNameAlias(), fontNameAlias))
+		{
+		ERR_PRINTF2(_L("No %S"), &KFontNameAlias());
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+
+	if ( dataOk )
+		{
+		// set font name alias
+		TRAPD(err, iFbsTypefaceStore->SetFontNameAliasL(fontNameAlias, fontName));
+
+		// check error code
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(_L("Set font name alias error: %d"), err);
+			SetError(err);
+			}
+		}
+	}
+
+
+/** Call CFbsTypefaceStore::SetDefaultLanguageForMetrics() */
+void CT_DataFbsTypefaceStore::DoCmdSetDefaultLanguageForMetrics(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Call CFbsTypefaceStore::SetDefaultLanguageForMetrics()"));
+
+	// get language from parameters
+	TInt	language;
+	if(!GetIntFromConfig(aSection, KLanguage(), language))
+		{
+		ERR_PRINTF2(_L("No %S"), &KLanguage());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// call SetDefaultLanguageForMetrics for the given language
+		iFbsTypefaceStore->SetDefaultLanguageForMetrics((TLanguage) language);
+		}
+	}
+
+
+/** Call CFbsTypefaceStore::RemoveFontFileLocksL() */
+void CT_DataFbsTypefaceStore::DoCmdRemoveFontFileLocks(const TDesC& aSection)
+	{
+	// get if to call by file name flag from parameters
+	TBool	useFileName = EFalse;
+	GetBoolFromConfig(aSection, KUseFileName(), useFileName);
+
+	// get if to call by drive name flag from parameters
+	TBool	useDriveName = EFalse;
+	GetBoolFromConfig(aSection, KUseDriveName(), useDriveName);
+
+	TInt	err = KErrNone;
+
+	if (useDriveName && useFileName)
+		{
+		ERR_PRINTF1(_L("Cannot all by both file and drive name"));
+		SetBlockResult(EFail);
+		}
+	else if (useDriveName)
+		{
+		// get drive name from parameters
+		TPtrC	driveName;
+		if (!GetStringFromConfig(aSection, KDriveName(), driveName))
+			{
+			ERR_PRINTF2(_L("No %S"), &KDriveName());
+			SetBlockResult(EFail);
+			}
+
+		// get all-fonts boolean value from parameters
+		TBool	allFonts = EFalse;
+		GetBoolFromConfig(aSection, KAllFonts(), allFonts);
+
+		// call RemoveFontFileLocksL()
+		TRAP(err, iFbsTypefaceStore->RemoveFontFileLocksL(driveName, allFonts));
+		}
+	else if (useFileName)
+		{
+		// get file name from parameters
+		TPtrC	fileName;
+		if (!GetStringFromConfig(aSection, KFileName(), fileName))
+			{
+			ERR_PRINTF2(_L("No %S"), &KFileName());
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			// call RemoveFontFileLocksL()
+			TRAP(err, iFbsTypefaceStore->RemoveFontFileLocksL(fileName));
+			}
+		}
+	else
+		{
+		TRAP(err, iFbsTypefaceStore->RemoveFontFileLocksL());
+		}
+
+	// check error code
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(_L("Remove font file lock error: %d"), err);
+		SetError(err);
+		}
+	}
+
+
+/** Call CFbsTypefaceStore::SetSystemDefaultTypefaceNameL() */
+void CT_DataFbsTypefaceStore::DoCmdSetSystemDefaultTypefaceName(const TDesC& aSection)
+	{
+
+	TPtrC	name;
+	if ( GetStringFromConfig(aSection, KFontName(), name) )
+		{
+		TRAPD(err, iFbsTypefaceStore->SetSystemDefaultTypefaceNameL(name));
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(_L("SetSystemDefaultTypefaceNameL error: %d"), err);
+			SetError(err);
+			}
+		}
+	else
+		{
+		ERR_PRINTF2(_L("No %S"), &KFontName());
+		SetBlockResult(EFail);
+		}
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fbserv/src/T_FBServAPIServer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+The main entry point for the TEF Server T_FBServAPIAddr.exe
+*/
+
+//	User Includes
+#include "T_FBServAPIServer.h"
+
+CT_FBServAPIServer* CT_FBServAPIServer::NewL()
+/**
+ * @return - Instance of the test server
+ * Same code for Secure and non-secure variants
+ * Called inside the MainL() function to create and start the
+ * CTestServer derived server.
+ */
+	{
+	CT_FBServAPIServer* server = new (ELeave) CT_FBServAPIServer();
+	CleanupStack::PushL(server);
+	server->ConstructL();
+	CleanupStack::Pop(server);
+	return server;
+	}
+
+LOCAL_C void MainL()
+/**
+ * Secure variant
+ * Much simpler, uses the new Rendezvous() call to sync with the client
+ */
+	{
+#if (defined __DATA_CAGING__)
+	RProcess().DataCaging(RProcess::EDataCagingOn);
+	RProcess().SecureApi(RProcess::ESecureApiOn);
+#endif
+	CActiveScheduler* sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sched);
+	CT_FBServAPIServer* server = NULL;
+	TRAPD(err, server = CT_FBServAPIServer::NewL());
+	if(!err)
+		{
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	delete server;
+	delete sched;
+	}
+
+GLDEF_C TInt E32Main()
+/**
+ * @return - Standard Epoc error code on process exit
+ * Secure variant only
+ * Process entry point. Called by client using RProcess API
+ */
+	{
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAP_IGNORE(MainL());
+	delete cleanup;
+	return KErrNone;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fntstore/inc/T_DataAlgStyle.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataAlgStyle
+*/
+
+#if (!defined __T_DATA_ALG_STYLE_H__)
+#define __T_DATA_ALG_STYLE_H__
+
+//	User Includes
+#include "DataWrapperBase.h"
+
+//	EPOC includes
+#include <e32std.h>
+#include <fntstore.h>
+
+class CT_DataAlgStyle : public CDataWrapperBase
+	{
+public:
+	CT_DataAlgStyle();
+	~CT_DataAlgStyle();
+	
+	static	CT_DataAlgStyle*	NewL();
+
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+	virtual TAny*	GetObject();
+	virtual void	SetObjectL(TAny* aObject);
+	virtual void	DisownObjectL();
+	void			DestroyData();
+
+private:
+	void	ConstructL();
+
+	void	DoCmdNew();
+	void	DoCmdSetWidthFactor(const TDesC& aSection);
+	void	DoCmdSetHeightFactor(const TDesC& aSection);
+
+private:
+	/** TAlgStyle class instance to work with*/
+    TAlgStyle*	iAlgStyle;
+	};
+
+#endif /* __T_DATA_ALG_STYLE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fntstore/inc/T_DataBitmapFont.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataBitmapFont
+*/
+
+#if (!defined __T_DATA_BITMAP_FONT_H__)
+#define __T_DATA_BITMAP_FONT_H__
+
+//	User Includes
+#include "T_DataFont.h"
+
+//	EPOC includes
+#include <e32std.h>
+#include <fntstore.h>
+
+class CT_DataBitmapFont : public CT_DataFont
+	{
+public:
+	static CT_DataBitmapFont* NewL();
+	
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+	virtual TAny*	GetObject();
+	virtual void	SetObjectL(TAny* aObject);
+	virtual void	DisownObjectL();
+	
+protected:
+	CT_DataBitmapFont();
+	
+	virtual CFont*	GetFont() const;
+	
+private:	
+	void	DoCmdBitmapEncoding(const TDesC& aSection);
+	void	DoCmdCharacterMetrics(const TDesC& aSection);
+	void	DoCmdCharacterNeedsToBeRasterized(const TDesC& aSection);
+	void	DoCmdGetCharacterData(const TDesC& aSection);
+	void	DoCmdGetFaceAttrib(const TDesC& aSection);
+	void	DoCmdGetFontMetrics(const TDesC& aSection);
+	void	DoCmdGlyphBitmapType(const TDesC& aSection);
+	void	DoCmdHasCharacterL(const TDesC& aSection);
+	void	DoCmdIsOpenFont(const TDesC& aSection);
+	void	DoCmdOpenFont(const TDesC& aSection);
+	void	DoCmdRasterize(const TDesC& aSection);
+	void	DoCmdUniqueFontId(const TDesC& aSection);
+	
+	static TBool GetCharacterMetricsFromConfig(CDataWrapper& aDataWrapper,const TDesC& aSectName,const TDesC& aKeyName,TCharacterMetrics& aResult);
+	static TBool GetOpenFontCharMetricsFromConfig(CDataWrapperBase& aDataWrapper,const TDesC& aSectName,const TDesC& aKeyName,TOpenFontCharMetrics& aResult);
+	static TBool GetOpenFontFaceAttribFromConfig(CDataWrapper& aDataWrapper,const TDesC& aSectName,const TDesC& aKeyName,TOpenFontFaceAttrib& aResult);
+	static TBool GetOpenFontMetricsFromConfig(CDataWrapper& aDataWrapper,const TDesC& aSectName,const TDesC& aKeyName,TOpenFontMetrics& aResult);
+	
+private:
+    CBitmapFont*	iBitmapFont;
+	};
+
+#endif /* __T_DATA_BITMAP_FONT_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fntstore/inc/T_DataFontStore.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,85 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataFontStore
+*/
+
+#if (!defined __T_DATA_FONTSTORE_H__)
+#define __T_DATA_FONTSTORE_H__
+
+//	User Includes
+#include "DataWrapperBase.h"
+
+//	EPOC includes
+#include <e32std.h>
+#include <fntstore.h>
+#include "T_DataTypefaceStore.h"
+
+class CT_DataFontStore : public CT_DataTypefaceStore
+	{
+public:
+	
+	~CT_DataFontStore();
+	static	CT_DataFontStore*	NewL();
+
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+	virtual TAny*	GetObject();
+	virtual void	SetObjectL(TAny* aObject);
+	virtual void	DisownObjectL();
+	void			DestroyData();
+	virtual CTypefaceStore*	GetTypefaceStore() const;
+
+protected:
+	CT_DataFontStore();
+	void ConstructL();
+	
+private:
+	void	DoCmdNewL(const TDesC& aSection);
+	void	DoCmdDestructor();
+	
+	void 	DoCmdAddFileL(const TDesC& aSection);
+	void	DoCmdRemoveFile(const TDesC& aSection);
+	void	DoCmdDefaultBitmapType(const TDesC& aSection);
+	void	DoCmdDeleteSessionCache(const TDesC& aSection);
+	void	DoCmdFontHeightInPixels(const TDesC& aSection);
+	void	DoCmdFontHeightInTwips(const TDesC& aSection);
+	void	DoCmdGetFontByIdL(const TDesC& aSection);
+	void	DoCmdGetNearestFontToDesignHeightInPixelsL(const TDesC& aSection);
+	TBool	DoCmdGetNearestFontToDesignHeightInTwipsL(const TDesC& aSection);
+	void	DoCmdGetNearestFontToMaxHeightInPixelsL(const TDesC& aSection);
+	TBool	DoCmdGetNearestFontToMaxHeightInTwipsL(const TDesC& aSection);
+	void	DoCmdInstallRasterizerL(const TDesC& aSection);
+	void	DoCmdInstallShaperFactoryL(const TDesC& aSection);
+	void	DoCmdNumTypefaces(const TDesC& aSection);
+	void	DoCmdSetDefaultBitmapType(const TDesC& aSection);
+	void	DoCmdTypefaceSupport(const TDesC& aSection);
+
+private:
+	TBool	FindIdByName(const TDesC&, TInt&);
+
+private:
+	/** CLinkedTypefaceSpecification class instance to work with*/
+	CFontStore*		iFntStore;
+	RArray<TPtrC>	iFile;
+	RArray<TInt>	iId;
+	};
+
+#endif /* __T_DATA_FONTSTORE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fntstore/inc/T_DataLinkedTypefaceSpecification.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataLinkedTypefaceSpecification
+*/
+
+#if (!defined __T_DATA_LINKED_TYPEFACE_SPECIFICATION_H__)
+#define __T_DATA_LINKED_TYPEFACE_SPECIFICATION_H__
+
+//	User Includes
+#include "DataWrapperBase.h"
+
+//	EPOC includes
+#include <e32std.h>
+#include <linkedfonts.h>
+
+class CT_DataLinkedTypefaceSpecification : public CDataWrapperBase
+	{
+public:
+	
+	~CT_DataLinkedTypefaceSpecification();
+	static	CT_DataLinkedTypefaceSpecification*	NewL();
+
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+	virtual TAny*	GetObject();
+	virtual void	SetObjectL(TAny* aObject);
+	virtual void	DisownObjectL();
+	void			DestroyData();
+
+protected:
+	CT_DataLinkedTypefaceSpecification();
+	void ConstructL();
+	
+private:
+	void	DoCmdNewL(const TDesC& aSection);
+	void	DoCmdDestructor();
+
+private:
+	/** CLinkedTypefaceSpecification class instance to work with*/
+    CLinkedTypefaceSpecification*	iSpec;
+	};
+
+#endif /* __T_DATA_LINKED_TYPEFACE_SPECIFICATION_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fntstore/inc/T_DataOpenFontGlyphData.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataOpenFontGlyphData
+*/
+
+#if (!defined __T_DATA_OPEN_FONT_GLYPH_DATA_H__)
+#define __T_DATA_OPEN_FONT_GLYPH_DATA_H__
+
+//	User Includes
+#include "DataWrapperBase.h"
+
+//	EPOC includes
+#include <e32std.h>
+#include <openfont.h>
+
+class CT_DataOpenFontGlyphData : public CDataWrapperBase
+	{
+public:
+	CT_DataOpenFontGlyphData();
+	~CT_DataOpenFontGlyphData();
+	
+	static	CT_DataOpenFontGlyphData*	NewL();
+
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+	virtual TAny*	GetObject();
+	virtual void	SetObjectL(TAny* aObject);
+	virtual void	DisownObjectL();
+	void			DestroyData();
+
+private:
+	void	ConstructL();
+
+	void	DoCmdNew(const TDesC& aSection);
+	void	DoCmdDestructor();
+	
+private:
+	/** TOpenFontGlyphData class instance to work with*/
+    TOpenFontGlyphData*	iGlyphData;
+	};
+
+#endif /* __T_DATA_OPEN_FONT_GLYPH_DATA_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fntstore/inc/T_DataOpenFontRasterizerContext.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataOpenFontRasterizerContext
+*/
+
+#if (!defined __T_DATA_OPEN_FONT_RASTERIZER_CONTEXT_H__)
+#define __T_DATA_OPEN_FONT_RASTERIZER_CONTEXT_H__
+
+//	User Includes
+#include "DataWrapperBase.h"
+
+//	EPOC includes
+#include <e32std.h>
+#include <openfont.h>
+
+class CT_DataOpenFontRasterizerContext : public CDataWrapperBase
+	{
+public:
+	CT_DataOpenFontRasterizerContext();
+	~CT_DataOpenFontRasterizerContext();
+	
+	static	CT_DataOpenFontRasterizerContext*	NewL();
+
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+	virtual TAny*	GetObject();
+	virtual void	SetObjectL(TAny* aObject);
+	virtual void	DisownObjectL();
+	void			DestroyData();
+
+private:
+	void	ConstructL();
+
+	void	DoCmdNew();
+	void	DoCmdEndGlyph();
+	void	DoCmdStartGlyphL(const TDesC& aSection);
+	void	DoCmdWriteGlyphBit(const TDesC& aSection);
+	void	DoCmdWriteGlyphByte(const TDesC& aSection);
+	void	DoCmdDestructor();
+
+private:
+	/** COpenFontRasterizerContext class instance to work with*/
+    COpenFontRasterizerContext*	iRasterizerContext;
+	};
+
+#endif /* __T_DATA_OPEN_FONT_RASTERIZER_CONTEXT_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fntstore/inc/T_GraphicsFntstoreAPIServer.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_FNTSTORE_API_SERVER_H__)
+#define __T_GRAPHICS_FNTSTORE_API_SERVER_H__
+
+//	User Include
+#include "TestServerBase.h"
+
+class CT_GraphicsFntstoreAPIServer : public CTestServerBase
+	{
+private:
+	class CT_GraphicsFntstoreAPIBlock : public CTestBlockController
+		{
+	public:
+		inline CT_GraphicsFntstoreAPIBlock();
+		inline ~CT_GraphicsFntstoreAPIBlock();
+
+		CDataWrapper*	CreateDataL(const TDesC& aData);
+		};
+
+public:
+	inline CT_GraphicsFntstoreAPIServer();
+	inline ~CT_GraphicsFntstoreAPIServer();
+
+	static CT_GraphicsFntstoreAPIServer* NewL();
+
+	inline CTestBlockController*	CreateTestBlock();
+	};
+
+#include "T_GraphicsFntstoreAPIServer.inl"
+
+#endif /* __T_GRAPHICS_FNTSTORE_API_SERVER_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fntstore/inc/T_GraphicsFntstoreAPIServer.inl	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_GraphicsFntstoreAPIServer inline functions
+*/
+
+
+/*@{*/
+/*@}*/
+
+inline CT_GraphicsFntstoreAPIServer::CT_GraphicsFntstoreAPIBlock::CT_GraphicsFntstoreAPIBlock()
+	{
+	}
+
+inline CT_GraphicsFntstoreAPIServer::CT_GraphicsFntstoreAPIBlock::~CT_GraphicsFntstoreAPIBlock()
+	{
+	}
+
+inline CT_GraphicsFntstoreAPIServer::CT_GraphicsFntstoreAPIServer()
+	{
+	}
+
+inline CT_GraphicsFntstoreAPIServer::~CT_GraphicsFntstoreAPIServer()
+	{
+	}
+
+inline CTestBlockController*	CT_GraphicsFntstoreAPIServer::CreateTestBlock()
+	{
+	return new CT_GraphicsFntstoreAPIBlock();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fntstore/inc/T_TestOpenFont.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,106 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Creates a dummy rasterizer and a dummy shaper for FontStore APIs testing.
+// 
+//
+
+#ifndef __T_TESTOPENFONT_H__
+#define __T_TESTOPENFONT_H__
+
+#include <fntstore.h>
+#include <openfont.h>
+#include <e32base.h>
+
+_LIT(KTestFont1, "dummy");
+_LIT(KTestFont2, "dummy_2");
+
+
+class CTestRasterizer : public COpenFontRasterizer
+	{
+public:
+	static CTestRasterizer* NewL();
+	COpenFontFile* NewFontFileL(TInt aUid, const TDesC& aFileName, RFs& aFileSession);
+	};
+	
+
+class CTestFontFile: public COpenFontFile
+	{
+public:
+	static CTestFontFile* NewL(TInt aUid,const TDesC& aFileName);
+
+	TBool GetNearestFontHelper(const TOpenFontSpec& aDesiredFontSpec, TInt aPixelWidth, TInt aPixelHeight,
+										TInt& aFaceIndex, TOpenFontSpec& aActualFontSpec) const;
+	void GetNearestFontInPixelsL(RHeap* aHeap, COpenFontSessionCacheList* aSessionCacheList,
+								 const TOpenFontSpec& aDesiredFontSpec, TInt aPixelWidth, TInt aPixelHeight,
+								 COpenFont*& aFont,TOpenFontSpec& aActualFontSpec);
+	void GetNearestFontToDesignHeightInPixelsL(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,
+								 const TOpenFontSpec& aDesiredFontSpec,TInt aPixelWidth,TInt aPixelHeight,
+								 COpenFont*& aFont,TOpenFontSpec& aActualFontSpec);
+	void GetNearestFontToMaxHeightInPixelsL(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,
+								 const TOpenFontSpec& aDesiredFontSpec,TInt aPixelWidth,TInt aPixelHeight,
+								 COpenFont*& aFont,TOpenFontSpec& aActualFontSpec, TInt aMaxHeight);
+	virtual TBool HasUnicodeCharacterL(TInt aFaceIndex,TInt aCode) const;
+
+private:
+	CTestFontFile(TInt aUid,const TDesC& aFileName);
+	void ConstructL();
+	};
+
+
+class CTestFont: public COpenFont
+	{
+public:
+	static CTestFont* NewL(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,CTestFontFile* aFontFile,TInt aSizeInPixels);
+private:
+	CTestFont(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,CTestFontFile* aFontFile,TInt aSizeInPixels);
+	virtual void RasterizeL(TInt aCode,TOpenFontGlyphData* aGlyphData);
+	};
+
+
+class CTestShaperFactory: public CShaperFactory
+	{
+public:
+	static CTestShaperFactory* NewL();
+	virtual ~CTestShaperFactory();
+	virtual CShaper* NewShaperL(CBitmapFont* aBitmapfont, TInt aScript, TInt aLanguage, RHeap* aHeap);
+
+private:
+	CTestShaperFactory();
+	};
+	
+
+class CTestShaper : public CShaper
+	{
+public:
+
+	static CShaper* NewL(CBitmapFont* aBitmapfont, TInt aScript, TInt aLanguage, RHeap* aHeap);
+	~CTestShaper();	
+	virtual TInt ShapeText(TShapeHeader*& aOutput, const TInput& aInput, RHeap* aHeapForOutput);
+		
+private:
+	CTestShaper();
+	TInt ConstructL(CBitmapFont* aBitmapfont, TInt aScript, TInt aLanguage, RHeap* iHeap);
+	TInt TestShapeTextL(TShapeHeader*& aOutput, const TInput& aInput, RHeap* aHeapForOutput);
+	
+private:	
+	RHeap* iClientHeap;
+	RHeap* iHeap;
+	TAny* iHeapMemory;
+ 	TInt32* iGlyphs;
+    TInt32* iIndices;
+    TInt32* iPositions;    
+    };
+
+#endif // __T_TESTOPENFONT_H__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fntstore/src/T_DataAlgStyle.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,200 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataAlgStyle
+*/
+
+#include "T_DataAlgStyle.h"
+
+
+/*@{*/
+///	Parameters
+_LIT(KFactor,									"factor");
+
+///	Commands
+_LIT(KCmdNew,									"new");
+_LIT(KCmdSetWidthFactor,						"SetWidthFactor");
+_LIT(KCmdSetHeightFactor,						"SetHeightFactor");
+_LIT(KCleanup,									"~");
+
+/*@}*/
+
+
+/**
+* Two phase constructor
+*/
+CT_DataAlgStyle* CT_DataAlgStyle::NewL()
+	{
+	CT_DataAlgStyle* ret = new (ELeave) CT_DataAlgStyle();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+
+/**
+* Protected constructor. First phase construction
+*/
+CT_DataAlgStyle::CT_DataAlgStyle()
+:	CDataWrapperBase()
+,	iAlgStyle(NULL)
+	{
+	}
+
+
+/**
+* Protected second phase construction
+*/
+void CT_DataAlgStyle::ConstructL()
+	{
+	}
+
+
+/**
+* Destructor.
+*/
+CT_DataAlgStyle::~CT_DataAlgStyle()
+	{
+	DestroyData();
+	}
+
+
+/**
+* cleanup implementation.
+*/
+void CT_DataAlgStyle::DestroyData()
+	{
+	delete iAlgStyle;
+	iAlgStyle = NULL;
+	}
+
+TAny* CT_DataAlgStyle::GetObject()
+	{
+	return iAlgStyle;
+	}
+
+void CT_DataAlgStyle::SetObjectL(TAny* aObject)
+	{
+	DestroyData();
+	iAlgStyle	= static_cast<TAlgStyle*> (aObject);
+	}
+		
+void CT_DataAlgStyle::DisownObjectL() 
+	{
+	iAlgStyle = NULL;
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataAlgStyle::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool retVal = ETrue;
+
+	if (aCommand == KCmdNew)
+		{
+		DoCmdNew();
+		}
+	else if (aCommand == KCmdSetWidthFactor)
+		{
+		DoCmdSetWidthFactor(aSection);
+		}
+	else if (aCommand == KCmdSetHeightFactor)
+		{
+		DoCmdSetHeightFactor(aSection);
+		}
+	else if (aCommand == KCleanup)
+		{
+		DestroyData();
+		}
+	else
+		{
+		retVal=EFalse;
+		}
+
+	return retVal;
+	}
+
+
+////////////////// COMMANDS IMPLEMENTATION  ////////////////////////
+
+/** Creates an instance of TAlgSAtyle structure */
+void CT_DataAlgStyle::DoCmdNew()
+	{
+	INFO_PRINTF1(_L("Creates an instance of TAlgSAtyle structure"));
+
+	// cleanup if any
+	DestroyData();
+
+	// call new operator
+	TRAPD(err, iAlgStyle = new (ELeave) TAlgStyle());
+
+	// check error code
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(_L("Error creating an instance: %d"), err);
+		SetError(err);
+		}
+	}
+
+
+/** Calls TAlgSAtyle::SetWidthFactor() */
+void CT_DataAlgStyle::DoCmdSetWidthFactor(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls TAlgSAtyle::SetWidthFactor()"));
+	// get factor from parameters
+	TInt	factor;
+	if (!GetIntFromConfig(aSection, KFactor(), factor) )
+		{
+		ERR_PRINTF2(_L("No %S"), &KFactor());
+		SetBlockResult(EFail);
+		}
+
+	// call SetWidthFactor()		
+	iAlgStyle->SetWidthFactor(factor);
+	}
+
+
+/** Calls TAlgSAtyle::SetWidthFactor() */
+void CT_DataAlgStyle::DoCmdSetHeightFactor(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls TAlgSAtyle::SetHeightFactor()"));
+
+	// get factor from parameters
+	TInt	factor;
+	if (!GetIntFromConfig(aSection, KFactor(), factor) )
+		{
+		ERR_PRINTF2(_L("No %S"), &KFactor());
+		SetBlockResult(EFail);
+		}
+
+	// call SetHeightFactor()		
+	iAlgStyle->SetHeightFactor(factor);
+	}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fntstore/src/T_DataBitmapFont.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,911 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataBitmapFont
+*/
+
+#include "T_DataBitmapFont.h"
+#include "T_GraphicsUtil.h"
+
+/*@{*/
+/// Parameters
+_LIT(KFldExpected,								"expected");
+_LIT(KFldCode,									"code");
+_LIT(KFldIsNull,								"isnull");
+_LIT(KFldSessHandle,							"handle");
+_LIT(KFldGlyphBitmapType,						"glyphtype");
+
+_LIT(KFldCharMetrics,							"charmetrics");
+_LIT(KFldOFCharMetrics,							"ofcharmetrics");
+_LIT(KFldOFFaceAttrib,							"offaceattrib");
+_LIT(KFldOFMetrics,								"ofmetrics");
+
+
+/// Commands
+_LIT(KCmdBitmapEncoding,						"BitmapEncoding");
+_LIT(KCmdCharacterMetrics,						"CharacterMetrics");
+_LIT(KCmdCharacterNeedsToBeRasterized,			"CharacterNeedsToBeRasterized");
+_LIT(KCmdGetCharacterData,						"GetCharacterData");
+_LIT(KCmdGetFaceAttrib,							"GetFaceAttrib");
+_LIT(KCmdGetFontMetrics,						"GetFontMetrics");
+_LIT(KCmdGlyphBitmapType,						"GlyphBitmapType");
+_LIT(KCmdHasCharacterL,							"HasCharacterL");
+_LIT(KCmdIsOpenFont,							"IsOpenFont");
+_LIT(KCmdOpenFont,								"OpenFont");
+_LIT(KCmdRasterize,								"Rasterize");
+//_LIT(KCmdUniqueFontId,							"UniqueFontId");
+
+///	Constant Literals
+_LIT(KTagCharMetricsAscent,						"ascent");
+_LIT(KTagCharMetricsHeight,						"height");
+_LIT(KTagCharMetricsMove,						"move");
+_LIT(KTagCharMetricsLeftAdjust,					"leftadjust");
+_LIT(KTagCharMetricsRightAdjust,				"rightadjust");
+
+_LIT(KTagOFCharMetricsHeight,					"height");
+_LIT(KTagOFCharMetricsWidth,				"width");
+
+_LIT(KTagOFFaceAttribFamilyName,				"familyname");
+_LIT(KTagOFFaceAttribMinSize,					"minsize");
+
+_LIT(KTagOFMetricsMaxHeight,					"maxheight");
+_LIT(KTagOFMetricsSize,							"size");
+
+_LIT(KFormatEntryField,		"%S_%S");
+
+/// Logging
+_LIT(KLogError,									"Error=%d");
+_LIT(KLogMissingParameter,						"Missing parameter '%S'");
+_LIT(KLogMissingExpectedValue,					"Missing expected value '%S'");
+_LIT(KLogNotExpectedValueInt,					"'%S' is not as expected=%d, actual=%d");
+_LIT(KLogNotExpectedValueString,				"'%S' is not as expected='%S', actual='%S'");
+
+/*@}*/
+
+
+/**
+* Two phase constructor
+*/
+CT_DataBitmapFont* CT_DataBitmapFont::NewL()
+	{
+	CT_DataBitmapFont* ret = new (ELeave) CT_DataBitmapFont();
+	return ret;
+	}
+
+
+/**
+* Protected constructor. First phase construction
+*/
+CT_DataBitmapFont::CT_DataBitmapFont()
+:	CT_DataFont(), iBitmapFont(NULL)
+	{
+	}
+
+TAny* CT_DataBitmapFont::GetObject()
+	{
+	return iBitmapFont;
+	}
+
+void CT_DataBitmapFont::SetObjectL(TAny* aObject)
+	{
+	iBitmapFont	= static_cast<CBitmapFont*> (aObject);
+	}
+		
+void CT_DataBitmapFont::DisownObjectL() 
+	{
+	iBitmapFont = NULL;
+	}
+
+CFont* CT_DataBitmapFont::GetFont() const
+	{
+	return iBitmapFont;
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataBitmapFont::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool ret = ETrue;
+
+	if (aCommand == KCmdBitmapEncoding)
+		{
+		DoCmdBitmapEncoding(aSection);
+		}
+	else if (aCommand == KCmdCharacterMetrics)
+		{
+		DoCmdCharacterMetrics(aSection);
+		}
+	else if (aCommand == KCmdCharacterNeedsToBeRasterized)
+		{
+		DoCmdCharacterNeedsToBeRasterized(aSection);
+		}
+	else if (aCommand == KCmdGetCharacterData)
+		{
+		DoCmdGetCharacterData(aSection);
+		}
+	else if (aCommand == KCmdGetFaceAttrib)
+		{
+		DoCmdGetFaceAttrib(aSection);
+		}
+	else if (aCommand == KCmdGetFontMetrics)
+		{
+		DoCmdGetFontMetrics(aSection);
+		}
+	else if (aCommand == KCmdGlyphBitmapType)
+		{
+		DoCmdGlyphBitmapType(aSection);
+		}
+	else if (aCommand == KCmdHasCharacterL)
+		{
+		DoCmdHasCharacterL(aSection);
+		}
+	else if (aCommand == KCmdIsOpenFont)
+		{
+		DoCmdIsOpenFont(aSection);
+		}
+	else if (aCommand == KCmdOpenFont)
+		{
+		DoCmdOpenFont(aSection);
+		}
+	else if (aCommand == KCmdRasterize)
+		{
+		DoCmdRasterize(aSection);
+		}
+//	else if (aCommand == KCmdUniqueFontId)
+//		{
+//		DoCmdUniqueFontId(aSection);
+//		}
+	else
+		{
+		ret = CT_DataFont::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+
+	return ret;
+	}
+
+////////////////// COMMANDS IMPLEMENTATION  ////////////////////////
+
+/** Calls CBitmapFont::DoCmdBitmapEncoding() */
+void CT_DataBitmapFont::DoCmdBitmapEncoding(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CBitmapFont::BitmapEncoding()"));
+	TInt ret = iBitmapFont->BitmapEncoding();
+	INFO_PRINTF2(_L("The actual bitmap encoding value is %d"), ret);
+	
+	TInt expected;
+	if( GetIntFromConfig(aSection, KFldExpected, expected) )
+		{
+		if (ret != expected)
+			{
+			ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected, ret, expected);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataBitmapFont::DoCmdCharacterMetrics(const TDesC& aSection)
+	{
+	TInt code;
+	if( !GetIntFromConfig(aSection, KFldCode, code) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldCode);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("Calls CBitmapFont::CharacterMetrics(TInt, const TUint8*&)"));
+		TCharacterMetrics metrics;
+		const TUint8* ptr;
+		metrics= iBitmapFont->CharacterMetrics(code, ptr);
+		TBool failed = EFalse;
+		
+		TBool isNull;
+		if( GetBoolFromConfig(aSection, KFldIsNull, isNull) )
+			{
+			if(isNull)
+				{
+				if(ptr != NULL)
+					{
+					ERR_PRINTF1(_L("Should return a NULL pointer") );
+					failed = ETrue;
+					}
+				else
+					{
+					INFO_PRINTF1(_L("A NULL pointer is returned"));
+
+					}
+				}
+			else
+				{
+				if(ptr == NULL)
+					{
+					ERR_PRINTF1(_L("Should return a pointer to the character bitmap") );
+					failed = ETrue;
+					}
+				else
+					{
+					INFO_PRINTF1(_L("A pointer to the character bitmap is returned") );
+					}
+				}
+			}
+
+		TCharacterMetrics expected;
+		if( GetCharacterMetricsFromConfig(*this, aSection, KFldCharMetrics, expected) )
+			{
+			if(metrics.iAscentInPixels != expected.iAscentInPixels)
+				{
+				
+				ERR_PRINTF4(KLogNotExpectedValueInt, &KTagCharMetricsAscent, expected.iAscentInPixels, metrics.iAscentInPixels);
+				failed = ETrue;
+				}
+			if(metrics.iHeightInPixels != expected.iHeightInPixels)
+				{
+				ERR_PRINTF4(KLogNotExpectedValueInt, &KTagCharMetricsHeight, expected.iHeightInPixels, metrics.iHeightInPixels);
+				failed = ETrue;
+				}
+			if(metrics.iMoveInPixels != expected.iMoveInPixels)
+				{				
+				ERR_PRINTF4(KLogNotExpectedValueInt, &KTagCharMetricsMove, expected.iMoveInPixels, metrics.iMoveInPixels);	
+				failed = ETrue;
+				}
+			if(metrics.iLeftAdjustInPixels != expected.iLeftAdjustInPixels)
+				{
+				ERR_PRINTF4(KLogNotExpectedValueInt, &KTagCharMetricsLeftAdjust, expected.iLeftAdjustInPixels, metrics.iLeftAdjustInPixels);	
+				failed = ETrue;
+				}
+			if(metrics.iRightAdjustInPixels != expected.iRightAdjustInPixels)
+				{
+				ERR_PRINTF4(KLogNotExpectedValueInt, &KTagCharMetricsRightAdjust, expected.iRightAdjustInPixels, metrics.iRightAdjustInPixels);
+				failed = ETrue;
+				}
+			}
+		
+		if(failed)
+			{
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			INFO_PRINTF1(_L("Character metrics is expected."));
+			}
+		}
+	}
+
+void CT_DataBitmapFont::CT_DataBitmapFont::DoCmdCharacterNeedsToBeRasterized(const TDesC& aSection)
+	{
+	TBool dataOK = ETrue;
+	
+	TInt handle;
+	if( !GetIntFromConfig(aSection, KFldSessHandle, handle) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldSessHandle);
+		dataOK = EFalse;
+		}
+	
+	TInt code;
+	if( !GetIntFromConfig(aSection, KFldCode, code) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldCode);
+		dataOK = EFalse;
+		}
+	
+	if(!dataOK)
+		{
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("Calls CBitmapFont::CharacterNeedsToBeRasterized(TInt, TInt)"));
+		TBool ret = iBitmapFont->CharacterNeedsToBeRasterized(handle, code);
+		
+		TBool expected;
+		if( GetBoolFromConfig(aSection, KFldExpected, expected) )
+			{
+			if(ret)
+				{
+				if(!expected)
+					{
+					ERR_PRINTF1(_L("Return value is not as expected: EFalse, actual: ETrue"));
+					SetBlockResult(EFail);
+					}
+				else
+					{
+					INFO_PRINTF1(_L("Return value is ETrue"));	
+					}
+				}
+			else
+				{
+				if(expected)
+					{
+					ERR_PRINTF1(_L("Return value is not as expected: ETrue, actual: EFalse"));
+					SetBlockResult(EFail);
+					}
+				else
+					{
+					INFO_PRINTF1(_L("Return value is EFalse"));
+					}
+				}
+			}
+		}
+	}
+
+
+void CT_DataBitmapFont::DoCmdGetCharacterData(const TDesC& aSection)
+	{
+	TBool dataOK = ETrue;
+	
+	TInt handle;
+	if( !GetIntFromConfig(aSection, KFldSessHandle, handle) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldSessHandle);		
+		dataOK = EFalse;
+		}
+	
+	TInt code;	
+	if( !GetIntFromConfig(aSection, KFldCode, code) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldCode);
+		dataOK = EFalse;
+		}
+	
+	if(!dataOK)
+		{
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("Calls CBitmapFont::GetCharacterData(TInt aSessionHandle, TInt aCode, TOpenFontCharMetrics &aMetrics, const TUint8 *&aBitmap)"));
+		TOpenFontCharMetrics metrics;
+		const TUint8* ptr;
+		TBool ret = iBitmapFont->GetCharacterData(handle, code, metrics, ptr);		
+		
+		TBool expected;
+		if( GetBoolFromConfig(aSection, KFldExpected, expected) )
+			{
+			if(ret)
+				{
+				if(!expected)
+					{
+					ERR_PRINTF1(_L("Return value is not as expected: EFalse, actual: ETrue"));
+					SetBlockResult(EFail);
+					}
+				else
+					{
+					INFO_PRINTF1(_L("Return value is ETrue"));
+										
+					TBool isNull;
+					if( GetBoolFromConfig(aSection, KFldIsNull, isNull) )
+						{
+						if(isNull)
+							{
+							if(ptr != NULL)
+								{
+								ERR_PRINTF1(_L("Should return a NULL pointer") );
+								SetBlockResult(EFail);
+								}
+							else
+								{
+								INFO_PRINTF1(_L("A NULL pointer is returned") );
+								}
+							}
+						else
+							{
+							if(ptr == NULL)
+								{
+								ERR_PRINTF1(_L("Should return a pointer to the character bitmap.") );
+								SetBlockResult(EFail);
+								}
+							else
+								{
+								INFO_PRINTF1(_L("a pointer to the character bitmap is returned") );
+								}
+							}
+						}					
+					
+					TBool failed = EFalse;
+					TOpenFontCharMetrics expectedMetrics;
+					if( GetOpenFontCharMetricsFromConfig(*this, aSection, KFldOFCharMetrics, expectedMetrics) )
+						{
+						if(metrics.Width() != expectedMetrics.Width())
+							{
+							ERR_PRINTF4(KLogNotExpectedValueInt, &KTagOFCharMetricsWidth, metrics.Width(), expectedMetrics.Width());
+							failed = ETrue;
+							}			
+						if(metrics.Height() != expectedMetrics.Height())
+							{
+							ERR_PRINTF4(KLogNotExpectedValueInt, &KTagOFCharMetricsHeight, metrics.Height(), expectedMetrics.Height());
+							failed = ETrue;
+							}
+						
+						if(failed)
+							{
+							SetBlockResult(EFail);
+							}
+						else
+							{
+							INFO_PRINTF1(_L("Open font character metrics is expected"));
+							}
+						}
+					}
+				}
+			else
+				{
+				if(expected)
+					{
+					ERR_PRINTF1(_L("Return value is not as expected: ETrue, actual: EFalse"));
+					SetBlockResult(EFail);
+					}
+				else
+					{
+					INFO_PRINTF1(_L("Return value is EFalse"));
+					}
+				}
+			}
+		}	
+	}
+
+void CT_DataBitmapFont::DoCmdGetFaceAttrib(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CBitmapFont::GetFaceAttrib(TOpenFontFaceAttrib&)"));
+	TOpenFontFaceAttrib attrib;
+	TBool ret = iBitmapFont->GetFaceAttrib(attrib);
+	
+	TBool expected;
+	if( GetBoolFromConfig(aSection, KFldExpected, expected) )
+		{
+		if(ret)
+			{
+			if(!expected)
+				{
+				ERR_PRINTF1(_L("Return value is not as expected: EFalse, actual: ETrue"));
+				SetBlockResult(EFail);
+				}
+			else
+				{
+				INFO_PRINTF1(_L("Return value is ETrue"));
+				TBool failed = EFalse;				
+				TOpenFontFaceAttrib expectedAttrib;
+				if( GetOpenFontFaceAttribFromConfig(*this, aSection, KFldOFFaceAttrib, expectedAttrib) )
+					{
+					TPtrC actualName = attrib.FamilyName();
+					TPtrC expectedName = expectedAttrib.FamilyName();
+					if(actualName != expectedName)
+						{	
+						ERR_PRINTF4(KLogNotExpectedValueString, &KTagOFFaceAttribFamilyName, &expectedName, &actualName);
+						failed = ETrue;
+						}
+					if(attrib.MinSizeInPixels() != expectedAttrib.MinSizeInPixels())
+						{
+						ERR_PRINTF4(KLogNotExpectedValueInt, &KTagOFFaceAttribMinSize, expectedAttrib.MinSizeInPixels(), attrib.MinSizeInPixels());
+						failed = ETrue;
+						}
+					
+					if(failed)
+						{
+						SetBlockResult(EFail);
+						}
+					else
+						{
+						INFO_PRINTF1(_L("Open font typeface attributes is expected"));
+						}
+					}
+				}
+			}
+		else
+			{
+			if(expected)
+				{
+				ERR_PRINTF1(_L("Return value is not as expected: ETrue, actual: EFalse"));
+				SetBlockResult(EFail);
+				}
+			else
+				{
+				INFO_PRINTF1(_L("Return value is EFalse"));
+				}
+			}
+		}
+	}
+
+void CT_DataBitmapFont::DoCmdGetFontMetrics(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CBitmapFont::GetFontMetrics(TOpenFontMetrics&)"));
+	TOpenFontMetrics metrics;
+	iBitmapFont->GetFontMetrics(metrics);
+	
+	TOpenFontMetrics expectedMetrics;
+	if( GetOpenFontMetricsFromConfig(*this, aSection, KFldOFMetrics, expectedMetrics) )
+		{
+		TBool failed = EFalse;
+		if(metrics.MaxHeight() != expectedMetrics.MaxHeight())
+			{
+			ERR_PRINTF4(KLogNotExpectedValueInt, &KTagOFMetricsMaxHeight, expectedMetrics.MaxHeight(), metrics.MaxHeight());
+			failed = ETrue;
+			}
+		if(metrics.Size() != expectedMetrics.Size())
+			{
+			ERR_PRINTF4(KLogNotExpectedValueInt, &KTagOFMetricsSize, expectedMetrics.Size(), metrics.Size());
+			failed = ETrue;
+			}
+		
+		if(failed)
+			{
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			INFO_PRINTF1(_L("Open font metrics is expected"));
+			}
+		}
+	}
+
+void CT_DataBitmapFont::DoCmdGlyphBitmapType(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CBitmapFont::GlyphBitmapType()"));
+	TGlyphBitmapType ret = iBitmapFont->GlyphBitmapType();
+	INFO_PRINTF2(_L("Glyph bitmap type is %d."), (TInt)ret);
+	
+	TGlyphBitmapType expected;
+	if( CT_GraphicsUtil::ReadGlyphBitmapType(*this, aSection, KFldGlyphBitmapType(), expected) )
+		{
+		if(ret != expected)
+			{
+			ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected, (TInt)ret, (TInt)expected);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataBitmapFont::DoCmdHasCharacterL(const TDesC& aSection)
+	{
+	TInt code;
+	if( !GetIntFromConfig(aSection, KFldCode, code) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldCode);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("Calls CBitmapFont::HasCharacterL(TInt)"));
+		TBool ret = iBitmapFont->HasCharacterL(code);
+		
+		TBool expected;
+		if( GetBoolFromConfig(aSection, KFldExpected, expected) )
+			{
+			if(ret)
+				{
+				if(!expected)
+					{
+					ERR_PRINTF1(_L("Return value is not as expected: EFalse, actual: ETrue"));
+					SetBlockResult(EFail);
+					}
+				else
+					{
+					INFO_PRINTF1(_L("Return value is ETrue"));
+					}
+				}
+			else
+				{
+				if(expected)
+					{
+					ERR_PRINTF1(_L("Return value is not as expected: ETrue, actual: EFalse"));
+					SetBlockResult(EFail);
+					}
+				else
+					{
+					INFO_PRINTF1(_L("Return value is EFalse"));
+					}
+				}
+			}
+		}
+	}
+
+void CT_DataBitmapFont::DoCmdIsOpenFont(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CBitmapFont::IsOpenFont()"));
+	TBool ret = iBitmapFont->IsOpenFont();
+	
+	TBool expected;
+	if( GetBoolFromConfig(aSection, KFldExpected, expected) )
+		{
+		if(ret)
+			{
+			if(!expected)
+				{
+				ERR_PRINTF1(_L("Return value is not as expected: EFalse, actual: ETrue"));
+				SetBlockResult(EFail);
+				}
+			else
+				{
+				INFO_PRINTF1(_L("Return value is ETrue"));
+				}
+			}
+		else
+			{
+			if(expected)
+				{
+				ERR_PRINTF1(_L("Return value is not as expected: ETrue, actual: EFalse"));
+				SetBlockResult(EFail);
+				}
+			else
+				{
+				INFO_PRINTF1(_L("Return value is EFalse"));
+				}
+			}
+		}
+	}
+
+void CT_DataBitmapFont::DoCmdOpenFont(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CBitmapFont::OpenFont()"));
+	COpenFont* ptr = iBitmapFont->OpenFont();
+	
+	TBool isNull;
+	if( GetBoolFromConfig(aSection, KFldIsNull, isNull) )
+		{
+		if(isNull)
+			{
+			if(ptr != NULL)
+				{
+				ERR_PRINTF1(_L("Should return a NULL pointer") );
+				SetBlockResult(EFail);
+				}
+			else
+				{
+				INFO_PRINTF1(_L("A NULL pointer is returned") );
+				}
+			}
+		else
+			{
+			if(ptr == NULL)
+				{
+				ERR_PRINTF1(_L("Should return a pointer to COpenFont") );
+				SetBlockResult(EFail);
+				}
+			else
+				{
+				INFO_PRINTF1(_L("A pointer to COpenFont is returned") );
+				}
+			}
+		}
+	}
+
+void CT_DataBitmapFont::DoCmdRasterize(const TDesC& aSection)
+	{
+	TBool dataOK = ETrue;
+	
+	TInt handle;
+	if( !GetIntFromConfig(aSection, KFldSessHandle, handle) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldSessHandle);	
+		dataOK = EFalse;
+		}
+	
+	TInt code;
+	if( !GetIntFromConfig(aSection, KFldCode, code) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldCode);
+		dataOK = EFalse;
+		}
+	
+	if(!dataOK)
+		{
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("Calls CBitmapFont::Rasterize(TInt, TInt, TOpenFontGlyphData*)"));
+		TOpenFontGlyphData* ptr = NULL;
+		TBool ret = iBitmapFont->Rasterize(handle, code, ptr);
+		
+		TBool expected;
+		if( GetBoolFromConfig(aSection, KFldExpected, expected) )
+			{
+			if(ret)
+				{
+				if(!expected)
+					{
+					ERR_PRINTF1(_L("Return value is not as expected: EFalse, actual: ETrue"));
+					SetBlockResult(EFail);
+					}
+				else
+					{
+					// The character was successfully rasterized.
+					INFO_PRINTF1(_L("Return value is ETrue"));	
+					TBool isNull;
+					if( GetBoolFromConfig(aSection, KFldIsNull, isNull) )
+						{
+						if(isNull)
+							{
+							if(ptr != NULL)
+								{
+								ERR_PRINTF1(_L("Should return a NULL pointer") );
+								SetBlockResult(EFail);
+								}
+							else
+								{
+								INFO_PRINTF1(_L("A NULL pointer is returned"));
+								}
+							}
+						else
+							{
+							if(ptr == NULL)
+								{
+								ERR_PRINTF1(_L("Should return a pointer to TOpenFontGlyphData") );
+								SetBlockResult(EFail);
+								}
+							else
+								{
+								INFO_PRINTF1(_L("A pointer to TOpenFontGlyphData is returned"));
+								}
+							}
+						}
+					}
+				}
+			// ret = EFalse
+			else
+				{
+				if(expected)
+					{
+					ERR_PRINTF1(_L("Return value is not as expected: ETrue, actual: EFalse"));
+					SetBlockResult(EFail);				
+					}
+				else
+					{
+					INFO_PRINTF1(_L("Return value is EFalse"));
+					}
+				}
+			}
+		}
+	}
+
+//void CT_DataBitmapFont::DoCmdUniqueFontId(const TDesC& aSection)
+//	{
+//	INFO_PRINTF1(_L("Calls CBitmapFont::UniqueFontId()"));
+//	TUint32 ret = iBitmapFont->UniqueFontId();
+//	INFO_PRINTF2(_L("Unique font id is %d"), (TInt)ret);
+//	
+//	TInt temp;
+//	if( GetIntFromConfig(aSection, KFldExpected, temp) )
+//		{
+//		TUint32 expected = (TUint32)temp;
+//		if(ret != expected)
+//			{
+//			ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected, ret, expected);
+//			SetBlockResult(EFail);
+//			}
+//		}
+//	}
+
+TBool CT_DataBitmapFont::GetCharacterMetricsFromConfig(CDataWrapper& aDataWrapper, const TDesC& aSectName, const TDesC& aKeyName, TCharacterMetrics& aResult)
+	{
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+	TInt temp;
+	TBool ret = EFalse;
+	
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagCharMetricsAscent);
+	if( aDataWrapper.GetIntFromConfig(aSectName, tempStore, temp) )
+		{
+		aResult.iAscentInPixels = temp;
+		ret = ETrue;
+		}
+
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagCharMetricsHeight);
+	if( aDataWrapper.GetIntFromConfig(aSectName, tempStore, temp) )
+		{
+		aResult.iHeightInPixels = temp;
+		ret = ETrue;
+		}
+
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagCharMetricsLeftAdjust);
+	if( aDataWrapper.GetIntFromConfig(aSectName, tempStore, temp) )
+		{
+		aResult.iLeftAdjustInPixels = temp;
+		ret = ETrue;
+		}
+	
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagCharMetricsMove);
+	if( aDataWrapper.GetIntFromConfig(aSectName, tempStore, temp) )
+		{
+		aResult.iMoveInPixels = temp;
+		ret = ETrue;
+		}
+	
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagCharMetricsRightAdjust);
+	if( aDataWrapper.GetIntFromConfig(aSectName, tempStore, temp) )
+		{
+		aResult.iRightAdjustInPixels = temp;
+		ret = ETrue;
+		}
+	
+	return ret;
+	}
+
+
+TBool CT_DataBitmapFont::GetOpenFontCharMetricsFromConfig(CDataWrapperBase& aDataWrapper,const TDesC& aSectName,const TDesC& aKeyName,TOpenFontCharMetrics& aResult)
+	{
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+	TInt width;
+	TInt height;
+	
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagOFCharMetricsWidth);
+	if( aDataWrapper.GetIntFromConfig(aSectName, tempStore, width) )
+		{		
+		tempStore.Format(KFormatEntryField, &aKeyName, &KTagOFCharMetricsHeight);
+		if( aDataWrapper.GetIntFromConfig(aSectName, tempStore, height) )
+			{
+			aResult.SetHeight(height);
+			aResult.SetWidth(width);
+			return ETrue;
+			}
+		}
+	
+	return EFalse;
+	}
+
+TBool CT_DataBitmapFont::GetOpenFontFaceAttribFromConfig(CDataWrapper& aDataWrapper,const TDesC& aSectName,const TDesC& aKeyName,TOpenFontFaceAttrib& aResult)
+	{
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagOFFaceAttribFamilyName);
+	
+	TPtrC familyname;
+	TInt minsize;
+	if( aDataWrapper.GetStringFromConfig(aSectName, tempStore, familyname) )
+		{
+		tempStore.Format(KFormatEntryField, &aKeyName, &KTagOFFaceAttribMinSize);
+		if( aDataWrapper.GetIntFromConfig(aSectName, tempStore, minsize) )
+			{
+			aResult.SetFamilyName(familyname);						
+			aResult.SetMinSizeInPixels(minsize);
+			return ETrue;
+			}
+		}
+	
+	return EFalse;
+	}
+
+TBool CT_DataBitmapFont::GetOpenFontMetricsFromConfig(CDataWrapper& aDataWrapper,const TDesC& aSectName, const TDesC& aKeyName, TOpenFontMetrics& aResult)
+	{ 
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+	tempStore.Format(KFormatEntryField, &aKeyName, &KTagOFMetricsMaxHeight);
+	
+	TInt maxheight;
+	TInt size;
+	if( aDataWrapper.GetIntFromConfig(aSectName, tempStore, maxheight) )
+		{
+		tempStore.Format(KFormatEntryField, &aKeyName, &KTagOFMetricsSize);
+		if( aDataWrapper.GetIntFromConfig(aSectName, tempStore, size) )
+			{
+			aResult.SetMaxHeight(maxheight);
+			aResult.SetSize(size);
+			return ETrue;
+			}
+		}
+	
+	return EFalse;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fntstore/src/T_DataFontStore.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,763 @@
+/*
+ * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Symbian Foundation License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+/**
+ @test
+ @internalComponent
+
+ This contains CT_DataFontStore
+ */
+#include "T_DataFontStore.h"
+#include "T_GraphicsUtil.h"
+#include "T_TestOpenFont.h"
+
+/*@{*/
+///	Parameters
+_LIT(KFldTypefaceName,				"typefacename");
+_LIT(KFldHeapSize,					"heapsize");
+_LIT(KFldFontFile,					"fontfile");
+_LIT(KFldId,						"id");
+_LIT(KFldExpectedGlyphBitmapType,	"expected_bmptype");
+_LIT(KFldGlyphBitmapType,			"bmptype");
+_LIT(KFldSessionHandle,				"sessionhandle");
+_LIT(KFldTypefaceIndex,				"typeface_index");
+_LIT(KFldHeightIndex,				"height_index");
+_LIT(KFldExpectedHeight,			"expected_height");
+_LIT(KFldFontUid,					"fontuid");
+_LIT(KFldAlgStyle,					"alg_style");
+_LIT(KFldFont,						"font");
+_LIT(KFldOpenFont,					"openfont");
+_LIT(KFldMaxHeight,					"maxheight");
+_LIT(KFldUseTestClass,				"usetestclass");
+_LIT(KFldRasterizer,				"rasterizer");
+_LIT(KFldShaperFactory,				"shaperfactory");
+
+///	Commands
+_LIT(KCmdNewL,						"NewL");
+_LIT(KCmdDestructor,				"~");
+_LIT(KCmdAddFileL,					"AddFileL");
+_LIT(KCmdRemoveFile,				"RemoveFile");
+_LIT(KCmdDefaultBitmapType,			"DefaultBitmapType");
+_LIT(KCmdDeleteSessionCache,		"DeleteSessionCache");
+_LIT(KCmdFontHeightInPixels,		"FontHeightInPixels");
+_LIT(KCmdGetFontById,				"GetFontById");
+_LIT(KCmdGetNearestFontToDesignHeightInPixels,	"GetNearestFontToDesignHeightInPixels");
+_LIT(KCmdGetNearestFontToDesignHeightInTwips,	"GetNearestFontToDesignHeightInTwips");
+_LIT(KCmdGetNearestFontToMaxHeightInPixels,		"GetNearestFontToMaxHeightInPixels");
+_LIT(KCmdGetNearestFontToMaxHeightInTwips,		"GetNearestFontToMaxHeightInTwips");
+_LIT(KCmdInstallRasterizerL,					"InstallRasterizerL");
+_LIT(KCmdInstallShaperFactoryL,		"InstallShaperFactoryL");
+_LIT(KCmdSetDefaultBitmapType,		"SetDefaultBitmapType");
+
+/// Logs
+_LIT(KLogMissingParameter,			"Missing parameter '%S'");
+_LIT(KLogError,						"Error=%d");
+_LIT(KLogMissingFilename,			"File '%S' not found in array");
+_LIT(KLogFontSpec,					"font_spec or openfont_spec");
+/*@}*/
+
+/**
+ * Two phase constructor
+ */
+CT_DataFontStore* CT_DataFontStore::NewL()
+	{
+	CT_DataFontStore* ret = new (ELeave) CT_DataFontStore();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+/**
+ * Protected second phase construction
+ */
+void CT_DataFontStore::ConstructL()
+	{
+	}
+
+/**
+ * Protected constructor. First phase construction
+ */
+CT_DataFontStore::CT_DataFontStore() :
+	CT_DataTypefaceStore(), iFntStore(NULL)
+	{
+	}
+
+/**
+ * Destructor.
+ */
+CT_DataFontStore::~CT_DataFontStore()
+	{
+	DestroyData();
+	iFile.Reset();
+	iFile.Close();
+	iId.Reset();
+	iId.Close();
+	}
+
+/**
+ * cleanup implementation.
+ */
+void CT_DataFontStore::DestroyData()
+	{
+	delete iFntStore;
+	iFntStore = NULL;
+	}
+
+TAny* CT_DataFontStore::GetObject()
+	{
+	return iFntStore;
+	}
+
+void CT_DataFontStore::SetObjectL(TAny* aObject)
+	{
+	DestroyData();
+	iFntStore = static_cast<CFontStore*> (aObject);
+	}
+
+void CT_DataFontStore::DisownObjectL()
+	{
+	iFntStore = NULL;
+	}
+
+CTypefaceStore* CT_DataFontStore::GetTypefaceStore() const
+	{
+	return iFntStore;
+	}
+
+/**
+ * Process a command read from the ini file
+ *
+ * @param aDataWrapper	test step requiring command to be processed
+ * @param aCommand	the command to process
+ * @param aSection		the entry in the ini file requiring the command to be processed
+ *
+ * @return ETrue if the command is processed
+ */
+TBool CT_DataFontStore::DoCommandL(const TTEFFunction& aCommand,
+		const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool retVal = ETrue;
+
+	if (aCommand == KCmdNewL)
+		{
+		DoCmdNewL(aSection);
+		}
+	else if (aCommand == KCmdDestructor)
+		{
+		DoCmdDestructor();
+		}
+	else if (aCommand == KCmdAddFileL)
+		{
+		DoCmdAddFileL(aSection);
+		}
+	else if (aCommand == KCmdRemoveFile)
+		{
+		DoCmdRemoveFile(aSection);
+		}
+	else if (aCommand == KCmdDefaultBitmapType)
+		{
+		DoCmdDefaultBitmapType(aSection);
+		}
+	else if (aCommand == KCmdDeleteSessionCache)
+		{
+		DoCmdDeleteSessionCache(aSection);
+		}
+	else if (aCommand == KCmdFontHeightInPixels)
+		{
+		DoCmdFontHeightInPixels(aSection);
+		}
+	else if (aCommand == KCmdGetFontById)
+		{
+		DoCmdGetFontByIdL(aSection);
+		}
+	else if (aCommand == KCmdGetNearestFontToDesignHeightInPixels)
+		{
+		DoCmdGetNearestFontToDesignHeightInPixelsL(aSection);
+		}
+	else if (aCommand == KCmdGetNearestFontToDesignHeightInTwips)
+		{
+		if (!DoCmdGetNearestFontToDesignHeightInTwipsL(aSection))
+			{
+			retVal = CT_DataTypefaceStore::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+			}
+		}
+	else if (aCommand == KCmdGetNearestFontToMaxHeightInPixels)
+		{
+		DoCmdGetNearestFontToMaxHeightInPixelsL(aSection);
+		}
+	else if (aCommand == KCmdGetNearestFontToMaxHeightInTwips)
+		{
+		if (!DoCmdGetNearestFontToMaxHeightInTwipsL(aSection))
+			{
+			retVal = CT_DataTypefaceStore::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+			}
+		}
+	else if (aCommand == KCmdInstallRasterizerL)
+		{
+		DoCmdInstallRasterizerL(aSection);
+		}
+	else if (aCommand == KCmdInstallShaperFactoryL)
+		{
+		DoCmdInstallShaperFactoryL(aSection);
+		}
+	else if (aCommand == KCmdSetDefaultBitmapType)
+		{
+		DoCmdSetDefaultBitmapType(aSection);
+		}
+	else
+		{
+		retVal = CT_DataTypefaceStore::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+
+	return retVal;
+	}
+
+////////////////// COMMANDS IMPLEMENTATION  ////////////////////////
+
+/** Creates an instance of CT_DataFontStore class */
+void CT_DataFontStore::DoCmdNewL(const TDesC& aSection)
+	{
+	// cleanup if any
+	DestroyData();
+
+	TInt heapsize;
+	TInt err;
+	
+	INFO_PRINTF1(_L("execute CFontStore::NewL(RHeap*)"));
+	if (GetIntFromConfig(aSection, KFldHeapSize, heapsize))
+		{
+		RHeap* heap = NULL;
+		if (heapsize != 0)
+			{
+			heap = UserHeap::ChunkHeap(NULL, heapsize, heapsize);
+			}
+		TRAP(err, iFntStore = CFontStore::NewL(heap));
+		}
+	else
+		{
+		// Use heap of the thread.
+		TRAP(err, iFntStore = CFontStore::NewL(&User::Heap()));
+		}
+	
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+void CT_DataFontStore::DoCmdDestructor()
+	{
+	// cleanup if any
+	DestroyData();
+	}
+
+void CT_DataFontStore::DoCmdAddFileL(const TDesC& aSection)
+	{
+	TPtrC name;
+	
+	if (!GetStringFromConfig(aSection, KFldFontFile, name))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldFontFile());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		TUid id;
+		
+		INFO_PRINTF1(_L("execute CFontStore::AddFileL(const TDesC&)"));
+		TRAPD(err, id = iFntStore->AddFileL(name));
+		
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		else
+			{
+			iFile.AppendL(name);
+			iId.AppendL(id.iUid);
+			}
+		}
+	}
+
+TBool CT_DataFontStore::FindIdByName(const TDesC& aName, TInt& aId)
+	{
+	TBool found = EFalse;
+	for (TInt index = 0; index < iFile.Count(); ++index)
+		{
+		if (iFile[index] == aName)
+			{
+			aId = iId[index];
+			iFile.Remove(index);
+			iId.Remove(index);
+			found = ETrue;
+			break;
+			}
+		}
+	return found;
+	}
+
+void CT_DataFontStore::DoCmdRemoveFile(const TDesC& aSection)
+	{
+	TBool dataOk = ETrue;
+	TInt id;
+	
+	// Get the uid
+	if (!GetIntFromConfig(aSection, KFldId(), id))
+		{
+		TPtrC file;
+		
+		// No uid provided. Get file name instead.
+		if (!GetStringFromConfig(aSection, KFldFontFile(), file))
+			{
+			dataOk = EFalse;
+			}
+		else
+			{
+			// Get uid by file name.
+			if (!FindIdByName(file, id))
+				{
+				dataOk = EFalse;
+				}
+			}
+		}
+
+	if (dataOk)
+		{
+		INFO_PRINTF1(_L("execute CFontStore::RemoveFile(TUid)"));
+		iFntStore->RemoveFile(TUid::Uid(id));
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute CFontStore::RemoveFile(TUid::Null())"));
+		iFntStore->RemoveFile(TUid::Null());
+		}
+	}
+
+void CT_DataFontStore::DoCmdDefaultBitmapType(const TDesC& aSection)
+	{
+	TGlyphBitmapType actual = iFntStore->DefaultBitmapType();
+	INFO_PRINTF2(_L("execute CFontStore::DefaultBitmapType() = %d"), actual);
+	
+	TGlyphBitmapType expected;
+	if(CT_GraphicsUtil::ReadGlyphBitmapType(*this, aSection, KFldExpectedGlyphBitmapType(), expected))
+		{
+		if (actual != expected)
+			{
+			ERR_PRINTF3(_L("The expected result %d is not equal to the actual result %d!"), expected, actual);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataFontStore::DoCmdDeleteSessionCache(const TDesC& aSection)
+	{
+	TInt handle;
+
+	if (!GetIntFromConfig(aSection, KFldSessionHandle, handle))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldSessionHandle());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute CFontStore::DeleteSessionCache(TInt)"));
+		iFntStore->DeleteSessionCache(handle);
+		}
+	}
+
+void CT_DataFontStore::DoCmdFontHeightInPixels(const TDesC& aSection)
+	{
+	TInt tfindex;
+	TInt heightindex;
+	TBool dataOk = ETrue;
+	
+	if (!GetIntFromConfig(aSection, KFldTypefaceIndex, tfindex))
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldTypefaceIndex());
+		SetBlockResult(EFail);
+		}
+	
+	if (!GetIntFromConfig(aSection, KFldHeightIndex, heightindex))
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldHeightIndex());
+		SetBlockResult(EFail);
+		}
+	
+	if (dataOk)
+		{
+		TInt actual = iFntStore->FontHeightInPixels(tfindex, heightindex);
+		INFO_PRINTF2(_L("execute CFontStore::FontHeightInPixels(TInt, TInt) = %d"), actual);
+		
+		TInt expected;
+		if (GetIntFromConfig(aSection, KFldExpectedHeight, expected))
+			{
+			if (expected != actual)
+				{
+				ERR_PRINTF3(_L("The expected result %d is not equal to the actual result %d!"), expected, actual);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+void CT_DataFontStore::DoCmdGetFontByIdL(const TDesC& aSection)
+	{
+	TBool dataOk = ETrue;
+	TAlgStyle* algStyle = NULL;
+	TPtrC wrapperName;
+	TInt fontUid;
+
+	// get font uid
+	if (!GetIntFromConfig(aSection, KFldFontUid(), fontUid))
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFontUid());
+		SetBlockResult(EFail);
+		}
+	// get algorithmic style
+	if	(!CT_GraphicsUtil::GetAlgStyleL(*this, aSection, KFldAlgStyle(), algStyle) && NULL == algStyle)
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldAlgStyle());
+		SetBlockResult(EFail);
+		}
+	if (!GetStringFromConfig(aSection, KFldFont, wrapperName))
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+
+	if (dataOk)
+		{
+		CFont* font = NULL;
+		INFO_PRINTF1(_L("execute CFontStore::GetFontById(CFont *&, TUid, const TAlgStyle&)"));
+		TInt err = iFntStore->GetFontById(font, TUid::Uid(fontUid), *algStyle);
+
+		if (KErrNone != err)
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		else
+			{
+			SetDataObjectL(wrapperName, font);
+			}
+		}
+	}
+
+void CT_DataFontStore::DoCmdGetNearestFontToDesignHeightInPixelsL(
+		const TDesC& aSection)
+	{
+	TPtrC wrapperName;
+	
+	if (!GetStringFromConfig(aSection, KFldFont, wrapperName))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		TFontSpec fontSpec;
+		TInt err;
+		CFont* font;
+		TBool fxnCalled = EFalse;
+		
+		if (GetFontSpecFromConfig(aSection, KFldFont, fontSpec))
+			{
+			fxnCalled = ETrue;
+			INFO_PRINTF1(_L("execute CFontStore::GetNearestFontToDesignHeightInPixels(CFont*&, const TFontSpec&)"));
+			err = iFntStore->GetNearestFontToDesignHeightInPixels(font, fontSpec);
+			}
+		else if (GetFontSpecFromConfig(aSection, KFldOpenFont, fontSpec))
+			{
+			fxnCalled = ETrue;
+			INFO_PRINTF1(_L("execute CFontStore::GetNearestFontToDesignHeightInPixels(CFont*&, const TOpenFontSpec&)"));
+			err = iFntStore->GetNearestFontToDesignHeightInPixels(font, TOpenFontSpec(fontSpec));
+			}
+		else
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KLogFontSpec());
+			SetBlockResult(EFail);
+			}
+		
+		if (fxnCalled)
+			{
+			if (err != KErrNone)
+				{
+				ERR_PRINTF2(KLogError, err);
+				SetError(err);
+				}
+			else
+				{
+				SetDataObjectL(wrapperName, font);
+				}
+			}
+		}
+	}
+
+TBool CT_DataFontStore::DoCmdGetNearestFontToDesignHeightInTwipsL(
+		const TDesC& aSection)
+	{
+	TPtrC wrapperName;
+
+	if (!GetStringFromConfig(aSection, KFldFont, wrapperName))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		TFontSpec fontSpec;
+		TInt err;
+		CFont* font;
+
+		if (!GetFontSpecFromConfig(aSection, KFldOpenFont, fontSpec))
+			{
+			return EFalse;
+			}
+		else
+			{
+			INFO_PRINTF1(_L("execute CFontStore::GetNearestFontToDesignHeightInTwips(CFont*&, const TOpenFontSpec&)"));
+			err = iFntStore->GetNearestFontToDesignHeightInTwips(font, TOpenFontSpec(fontSpec));
+			if (err != KErrNone)
+				{
+				ERR_PRINTF2(KLogError, err);
+				SetError(err);
+				}
+			else
+				{
+				SetDataObjectL(wrapperName, font);
+				}
+			}
+		}
+	return ETrue;
+	}
+
+void CT_DataFontStore::DoCmdGetNearestFontToMaxHeightInPixelsL(const TDesC& aSection)
+	{
+	TBool dataOk = ETrue;
+
+	TPtrC wrapperName;
+	if (!GetStringFromConfig(aSection, KFldFont, wrapperName))
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+	
+	TInt maxHeight;
+	if (!GetIntFromConfig(aSection, KFldMaxHeight, maxHeight))
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldMaxHeight());
+		SetBlockResult(EFail);
+		}
+	
+	if (dataOk)
+		{
+		TFontSpec fontSpec;
+		TInt err;
+		CFont* font;
+		TBool fxnCalled = EFalse;
+
+		if (GetFontSpecFromConfig(aSection, KFldFont, fontSpec))
+			{
+			fxnCalled = ETrue;
+			INFO_PRINTF1(_L("execute CFontStore::GetNearestFontToMaxHeightInPixels(CFont*&, const TFontSpec&, TInt)"));
+			err = iFntStore->GetNearestFontToMaxHeightInPixels(font, fontSpec, maxHeight);
+			}
+		else if (GetFontSpecFromConfig(aSection, KFldOpenFont, fontSpec))
+			{
+			fxnCalled = ETrue;
+			INFO_PRINTF1(_L("execute CFontStore::GetNearestFontToMaxHeightInPixels(CFont*&, const TOpenFontSpec&, TInt)"));
+			err = iFntStore->GetNearestFontToMaxHeightInPixels(font, TOpenFontSpec(fontSpec), maxHeight);
+			}
+		else
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KLogFontSpec());
+			SetBlockResult(EFail);
+			}
+
+		if (fxnCalled)
+			{
+			if (err != KErrNone)
+				{
+				ERR_PRINTF2(KLogError, err);
+				SetError(err);
+				}
+			else
+				{
+				SetDataObjectL(wrapperName, font);
+				}
+			}
+		}
+	}
+
+TBool CT_DataFontStore::DoCmdGetNearestFontToMaxHeightInTwipsL(const TDesC& aSection)
+	{
+	TBool dataOk = ETrue;
+	TPtrC wrapperName;
+	if (!GetStringFromConfig(aSection, KFldFont, wrapperName))
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+
+	TInt maxHeight;
+	if (!GetIntFromConfig(aSection, KFldMaxHeight, maxHeight))
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldMaxHeight());
+		SetBlockResult(EFail);
+		}
+	
+	TFontSpec fontSpec;
+	if (!GetFontSpecFromConfig(aSection, KFldOpenFont, fontSpec))
+		{
+		return EFalse;
+		}
+	
+	if (dataOk)
+		{
+		TInt err;
+		CFont* font;
+
+		INFO_PRINTF1(_L("execute CFontStore::GetNearestFontToMaxHeightInTwips(CFont*&, const TOpenFontSpec&, TInt)"));
+		err = iFntStore->GetNearestFontToMaxHeightInTwips(font, TOpenFontSpec(fontSpec), maxHeight);
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		else
+			{
+			SetDataObjectL(wrapperName, font);
+			}
+		}
+	return ETrue;
+	}
+
+void CT_DataFontStore::DoCmdInstallRasterizerL(const TDesC& aSection)
+	{
+	COpenFontRasterizer* rasterizer = NULL;
+	TInt err;
+	TBool useDummy;
+	
+	if (!GetBoolFromConfig(aSection, KFldUseTestClass, useDummy))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldUseTestClass());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if (useDummy)
+			{
+			TRAP(err, rasterizer = CTestRasterizer::NewL());
+			if (err != KErrNone)
+				{
+				ERR_PRINTF2(KLogError, err);
+				SetError(err);
+				return;
+				}
+			}
+		else
+			{
+			CT_GraphicsUtil::GetRasterizerL(*this, aSection, KFldRasterizer, rasterizer);
+			}
+		
+		if (rasterizer == NULL)
+			{
+			INFO_PRINTF1(_L("execute CFontStore::InstallRasterizerL(NULL)"));
+			}
+		else
+			{
+			INFO_PRINTF1(_L("execute CFontStore::InstallRasterizerL(COpenFontRasterizer*)"));
+			}
+		TRAP(err, iFntStore->InstallRasterizerL(rasterizer));
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		}
+	}
+
+void CT_DataFontStore::DoCmdInstallShaperFactoryL(const TDesC& aSection)
+	{
+	CShaperFactory* shaper = NULL;
+	TInt err;
+	TBool useDummy;
+	
+	if (!GetBoolFromConfig(aSection, KFldUseTestClass, useDummy))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldUseTestClass());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if (useDummy)
+			{
+			TRAP(err, shaper = CTestShaperFactory::NewL());
+			if (err != KErrNone)
+				{
+				ERR_PRINTF2(KLogError, err);
+				SetError(err);
+				return;
+				}
+			}
+		else
+			{
+			CT_GraphicsUtil::GetShaperFactoryL(*this, aSection, KFldShaperFactory, shaper);
+			}
+
+		if (shaper == NULL)
+			{
+			INFO_PRINTF1(_L("execute CFontStore::InstallShaperFactoryL(NULL)"));
+			}
+		else
+			{
+			INFO_PRINTF1(_L("execute CFontStore::InstallShaperFactoryL(CShaperFactory*)"));
+			}
+		TRAP(err, iFntStore->InstallShaperFactoryL(shaper));
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		}
+	}
+
+void CT_DataFontStore::DoCmdSetDefaultBitmapType(const TDesC& aSection)
+	{
+	TGlyphBitmapType bmptype;
+	
+	if (!CT_GraphicsUtil::ReadGlyphBitmapType(*this, aSection, KFldGlyphBitmapType(), bmptype))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldGlyphBitmapType());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute CFontStore::SetDefaultBitmapType(TGlyphBitmapType)"));
+		iFntStore->SetDefaultBitmapType(bmptype);
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fntstore/src/T_DataLinkedTypefaceSpecification.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataLinkedTypefaceSpecification
+*/
+
+#include "T_DataLinkedTypefaceSpecification.h"
+
+
+/*@{*/
+///	Parameters
+_LIT(KFldTypefaceName,							"typefacename");
+
+///	Commands
+_LIT(KCmdNewL,									"NewL");
+_LIT(KCmdDestructor,							"~");
+
+/// Logs
+_LIT(KLogMissingParameter,						"Missing parameter '%S'");
+_LIT(KLogError,									"Error=%d");
+/*@}*/
+
+
+/**
+* Two phase constructor
+*/
+CT_DataLinkedTypefaceSpecification* CT_DataLinkedTypefaceSpecification::NewL()
+	{
+	CT_DataLinkedTypefaceSpecification* ret = new (ELeave) CT_DataLinkedTypefaceSpecification();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+/**
+* Protected second phase construction
+*/
+void CT_DataLinkedTypefaceSpecification::ConstructL()
+	{
+	}
+
+/**
+* Protected constructor. First phase construction
+*/
+CT_DataLinkedTypefaceSpecification::CT_DataLinkedTypefaceSpecification()
+:	CDataWrapperBase()
+,	iSpec(NULL)
+	{
+	}
+
+/**
+* Destructor.
+*/
+CT_DataLinkedTypefaceSpecification::~CT_DataLinkedTypefaceSpecification()
+	{
+	DestroyData();
+	}
+
+
+/**
+* cleanup implementation.
+*/
+void CT_DataLinkedTypefaceSpecification::DestroyData()
+	{
+	delete iSpec;
+	iSpec = NULL;
+	}
+
+TAny* CT_DataLinkedTypefaceSpecification::GetObject()
+	{
+	return iSpec;
+	}
+
+void CT_DataLinkedTypefaceSpecification::SetObjectL(TAny* aObject)
+	{
+	DestroyData();
+	iSpec	= static_cast<CLinkedTypefaceSpecification*> (aObject);
+	}
+		
+void CT_DataLinkedTypefaceSpecification::DisownObjectL() 
+	{
+	iSpec = NULL;
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataLinkedTypefaceSpecification::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool retVal = ETrue;
+
+	if (aCommand == KCmdNewL)
+		{
+		DoCmdNewL(aSection);
+		}
+	else if (aCommand == KCmdDestructor)
+		{
+		DoCmdDestructor();
+		}
+	else
+		{
+		retVal=EFalse;
+		}
+
+	return retVal;
+	}
+
+
+////////////////// COMMANDS IMPLEMENTATION  ////////////////////////
+
+/** Creates an instance of CT_DataLinkedTypefaceSpecification class */
+void CT_DataLinkedTypefaceSpecification::DoCmdNewL(const TDesC& aSection)
+	{
+	// cleanup if any
+	DestroyData();
+
+	// call new operator
+	TPtrC name;
+	if (!GetStringFromConfig(aSection, KFldTypefaceName, name))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldTypefaceName);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute CLinkedTypefaceSpecification::NewLC"));
+		TRAPD(err, iSpec = CLinkedTypefaceSpecification::NewLC(name); CleanupStack::Pop(iSpec));
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		}
+	}
+
+void CT_DataLinkedTypefaceSpecification::DoCmdDestructor()
+	{
+	// cleanup if any
+	DestroyData();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fntstore/src/T_DataOpenFontGlyphData.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,168 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataOpenFontGlyphData
+*/
+
+#include "T_DataOpenFontGlyphData.h"
+
+
+/*@{*/
+///	Parameters
+_LIT(KFldBufferSize,							"buffer_size");
+
+///	Commands
+_LIT(KCmdNew,									"New");
+_LIT(KCmdDestructor,							"~");
+
+/// Logs
+_LIT(KLogMissingParameter,						"Missing parameter '%S'");
+
+/*@}*/
+
+/**
+* Two phase constructor
+*/
+CT_DataOpenFontGlyphData* CT_DataOpenFontGlyphData::NewL()
+	{
+	CT_DataOpenFontGlyphData* ret = new (ELeave) CT_DataOpenFontGlyphData();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+
+/**
+* Protected constructor. First phase construction
+*/
+CT_DataOpenFontGlyphData::CT_DataOpenFontGlyphData()
+:	CDataWrapperBase()
+,	iGlyphData(NULL)
+	{
+	}
+
+
+/**
+* Protected second phase construction
+*/
+void CT_DataOpenFontGlyphData::ConstructL()
+	{
+	}
+
+
+/**
+* Destructor.
+*/
+CT_DataOpenFontGlyphData::~CT_DataOpenFontGlyphData()
+	{
+	if (iGlyphData != NULL)
+		DestroyData();
+	}
+
+
+/**
+* cleanup implementation.
+*/
+void CT_DataOpenFontGlyphData::DestroyData()
+	{
+	User::Heap().Free(iGlyphData);
+	iGlyphData = NULL;
+	}
+
+TAny* CT_DataOpenFontGlyphData::GetObject()
+	{
+	return iGlyphData;
+	}
+
+void CT_DataOpenFontGlyphData::SetObjectL(TAny* aObject)
+	{
+	DestroyData();
+	iGlyphData	= static_cast<TOpenFontGlyphData*> (aObject);
+	}
+		
+void CT_DataOpenFontGlyphData::DisownObjectL() 
+	{
+	iGlyphData = NULL;
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataOpenFontGlyphData::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool retVal = ETrue;
+
+	if (aCommand == KCmdNew)
+		{
+		DoCmdNew(aSection);
+		}
+	else if (aCommand == KCmdDestructor)
+		{
+		DoCmdDestructor();
+		}
+	else
+		{
+		retVal=EFalse;
+		}
+
+	return retVal;
+	}
+
+
+////////////////// COMMANDS IMPLEMENTATION  ////////////////////////
+
+/** Creates an instance of TOpenFontGlyphData structure */
+void CT_DataOpenFontGlyphData::DoCmdNew(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Creates an object of TOpenFontGlyphData"));
+
+	// cleanup if any
+	DestroyData();
+
+	TInt	bufsize;
+	if (!GetIntFromConfig(aSection, KFldBufferSize, bufsize))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldBufferSize());
+		SetBlockResult(EFail);
+		}
+	
+	// call TOpenFontGlyphData::New()
+	INFO_PRINTF1(_L("execute TOpenFontGlyphData::New(RHeap*, TInt)"));
+	iGlyphData = TOpenFontGlyphData::New(&(User::Heap()), bufsize);
+
+	if (iGlyphData == NULL)
+		{
+		ERR_PRINTF1(_L("No enough memory"));
+		SetError(KErrNoMemory);
+		}
+	}
+
+void CT_DataOpenFontGlyphData::DoCmdDestructor()
+	{
+	DestroyData();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fntstore/src/T_DataOpenFontRasterizerContext.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,238 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataOpenFontRasterizerContext
+*/
+
+#include "T_DataOpenFontRasterizerContext.h"
+#include "T_GraphicsUtil.h"
+
+
+/*@{*/
+///	Parameters
+_LIT(KFldGlyphData,							"glyphdata");
+_LIT(KFldBit,								"bit");
+_LIT(KFldByte,								"byte");
+
+///	Commands
+_LIT(KCmdNew,								"new");
+_LIT(KCmdEndGlyph,							"EndGlyph");
+_LIT(KCmdStartGlyph,						"StartGlyph");
+_LIT(KCmdWriteGlyphBit,						"WriteGlyphBit");
+_LIT(KCmdWriteGlyphByte,					"WriteGlyphByte");
+_LIT(KCmdDestructor,						"~");
+
+/// Logs
+_LIT(KLogMissingParameter,			"Missing parameter '%S'");
+
+/*@}*/
+
+
+/**
+* Two phase constructor
+*/
+CT_DataOpenFontRasterizerContext* CT_DataOpenFontRasterizerContext::NewL()
+	{
+	CT_DataOpenFontRasterizerContext* ret = new (ELeave) CT_DataOpenFontRasterizerContext();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+
+/**
+* Protected constructor. First phase construction
+*/
+CT_DataOpenFontRasterizerContext::CT_DataOpenFontRasterizerContext()
+:	CDataWrapperBase()
+,	iRasterizerContext(NULL)
+	{
+	}
+
+
+/**
+* Protected second phase construction
+*/
+void CT_DataOpenFontRasterizerContext::ConstructL()
+	{
+	}
+
+
+/**
+* Destructor.
+*/
+CT_DataOpenFontRasterizerContext::~CT_DataOpenFontRasterizerContext()
+	{
+	DestroyData();
+	}
+
+
+/**
+* cleanup implementation.
+*/
+void CT_DataOpenFontRasterizerContext::DestroyData()
+	{
+	delete iRasterizerContext;
+	iRasterizerContext = NULL;
+	}
+
+TAny* CT_DataOpenFontRasterizerContext::GetObject()
+	{
+	return iRasterizerContext;
+	}
+
+void CT_DataOpenFontRasterizerContext::SetObjectL(TAny* aObject)
+	{
+	DestroyData();
+	iRasterizerContext	= static_cast<COpenFontRasterizerContext*> (aObject);
+	}
+		
+void CT_DataOpenFontRasterizerContext::DisownObjectL() 
+	{
+	iRasterizerContext = NULL;
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataOpenFontRasterizerContext::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool retVal = ETrue;
+
+	if (aCommand == KCmdNew)
+		{
+		DoCmdNew();
+		}
+	else if (aCommand == KCmdEndGlyph)
+		{
+		DoCmdEndGlyph();
+		}
+	else if (aCommand == KCmdStartGlyph)
+		{
+		DoCmdStartGlyphL(aSection);
+		}
+	else if (aCommand == KCmdWriteGlyphBit)
+		{
+		DoCmdWriteGlyphBit(aSection);
+		}
+	else if (aCommand == KCmdWriteGlyphByte)
+		{
+		DoCmdWriteGlyphByte(aSection);
+		}
+	else if (aCommand == KCmdDestructor)
+		{
+		DoCmdDestructor();
+		}
+	else
+		{
+		retVal=EFalse;
+		}
+
+	return retVal;
+	}
+
+
+////////////////// COMMANDS IMPLEMENTATION  ////////////////////////
+
+/** Creates an instance of COpenFontRasterizerContext structure */
+void CT_DataOpenFontRasterizerContext::DoCmdNew()
+	{
+	INFO_PRINTF1(_L("Creates an instance of COpenFontRasterizerContext"));
+
+	// cleanup if any
+	DestroyData();
+
+	// call new operator
+	TRAPD(err, iRasterizerContext = new (ELeave) COpenFontRasterizerContext());
+
+	// check error code
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(_L("Error creating an instance: %d"), err);
+		SetError(err);
+		}
+	}
+
+void CT_DataOpenFontRasterizerContext::DoCmdEndGlyph()
+	{
+	INFO_PRINTF1(_L("execute COpenFontRasterizerContext::EndGlyph()"));
+	iRasterizerContext->EndGlyph();
+	}
+
+void CT_DataOpenFontRasterizerContext::DoCmdStartGlyphL(const TDesC& aSection)
+	{
+	TOpenFontGlyphData* glyphData= NULL;
+	
+	if (!CT_GraphicsUtil::GetOpenFontGlyphDataL(*this, aSection, KFldGlyphData, glyphData))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldGlyphData());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+        INFO_PRINTF1(_L("execute COpenFontRasterizerContext::StartGlyph(TOpenFontGlyphData*)"));
+		iRasterizerContext->StartGlyph(glyphData);
+		}
+	}
+
+void CT_DataOpenFontRasterizerContext::DoCmdWriteGlyphBit(const TDesC& aSection)
+	{
+	TInt bit;
+	
+	if (!GetIntFromConfig(aSection, KFldBit, bit))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldBit());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+        INFO_PRINTF1(_L("execute COpenFontRasterizerContext::WriteGlyphBit(TInt)"));
+		iRasterizerContext->WriteGlyphBit(bit);
+		}
+	}
+
+void CT_DataOpenFontRasterizerContext::DoCmdWriteGlyphByte(const TDesC& aSection)
+	{
+	TInt byte;
+		
+	if (!GetIntFromConfig(aSection, KFldByte, byte))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldByte());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+        INFO_PRINTF1(_L("execute COpenFontRasterizerContext::WriteGlyphByte(TInt)"));
+		iRasterizerContext->WriteGlyphByte(byte);
+		}
+	}
+
+void CT_DataOpenFontRasterizerContext::DoCmdDestructor()
+	{
+	DestroyData();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fntstore/src/T_GraphicsFntstoreAPIServer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,170 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_GraphicsFntstoreAPIServer.h"
+#include "T_DataAlgStyle.h"
+#include "T_DataFontStore.h"
+#include "T_DataBitmapFont.h"
+#include "T_DataOpenFontGlyphData.h"
+#include "T_DataOpenFontRasterizerContext.h"
+
+//	EPOC Includes
+#include <rsshared.h>
+
+/**
+ * @enum Constant Literals used.
+ */
+/*@{*/
+// Graphics Fntstore API
+
+_LIT(KTAlgStyle,						"TAlgStyle");
+_LIT(KCFontStore,						"CFontStore");
+_LIT(KCBitmapFont,						"CBitmapFont");
+_LIT(KTOpenFontGlyphData,				"TOpenFontGlyphData");
+_LIT(KCOpenFontRasterizerContext,		"COpenFontRasterizerContext");
+/*@}*/
+
+
+inline CDataWrapper* CT_GraphicsFntstoreAPIServer::CT_GraphicsFntstoreAPIBlock::CreateDataL( const TDesC& aData )
+	{
+	CDataWrapper*	wrapper = NULL;
+
+	if (aData == KCFontStore)
+		{
+		wrapper = CT_DataFontStore::NewL();
+		}
+	else if (aData == KCBitmapFont)
+		{
+		wrapper = CT_DataBitmapFont::NewL();
+		}
+	else if (aData == KTAlgStyle)
+		{
+		wrapper = CT_DataAlgStyle::NewL();
+		}
+	else if (aData == KTOpenFontGlyphData)
+		{
+		wrapper = CT_DataOpenFontGlyphData::NewL();
+		}
+	else if (aData == KCOpenFontRasterizerContext)
+		{
+		wrapper = CT_DataOpenFontRasterizerContext::NewL();
+		}
+	
+	return wrapper;
+	}
+
+CT_GraphicsFntstoreAPIServer* CT_GraphicsFntstoreAPIServer::NewL()
+/**
+ * @return - Instance of the test server
+ * Same code for Secure and non-secure variants
+ * Called inside the MainL() function to create and start the
+ * CTestServer derived server.
+ */
+	{
+	CT_GraphicsFntstoreAPIServer*	server = new (ELeave) CT_GraphicsFntstoreAPIServer();
+	CleanupStack::PushL(server);
+	// CServer base class call
+	server->ConstructL();		/*Parsing the server name from the file name*/
+	CleanupStack::Pop(server);
+	return server;
+	}
+
+
+TInt LoadDrivers()
+	{
+#ifdef __WINS__
+	#define KPDDName _L("ECDRV")
+	#define KLDDName _L("ECOMM")
+#else
+	#define KPDDName _L("EUART1")
+	#define KLDDName _L("ECOMM")
+#endif
+	TInt rerr = KErrNone;
+
+	rerr = StartC32();
+	if( rerr!=KErrNone && rerr!=KErrAlreadyExists )
+		{
+		return rerr;
+		}
+
+	rerr = User::LoadPhysicalDevice(KPDDName);
+	if(rerr != KErrNone && rerr != KErrAlreadyExists)
+		{
+		return rerr;
+		}
+	rerr = User::LoadLogicalDevice(KLDDName);
+	if(rerr != KErrNone && rerr != KErrAlreadyExists)
+		{
+		return rerr;
+		}
+	return KErrNone;
+	}
+
+LOCAL_C void MainL()
+/**
+ * Secure variant
+ * Much simpler, uses the new Rendezvous() call to sync with the client
+ */
+	{
+#if (defined __DATA_CAGING__)
+	RProcess().DataCaging(RProcess::EDataCagingOn);
+	RProcess().SecureApi(RProcess::ESecureApiOn);
+#endif
+	CActiveScheduler*	sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sched);
+	CT_GraphicsFntstoreAPIServer*	server = NULL;
+	// Create the CTestServer derived server
+	TRAPD(err,server = CT_GraphicsFntstoreAPIServer::NewL());
+	if(!err)
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	delete server;
+	delete sched;
+	}
+
+GLDEF_C TInt E32Main()
+/**
+ * @return - Standard Epoc error code on process exit
+ * Secure variant only
+ * Process entry point. Called by client using RProcess API
+ */
+	{
+	TInt rerr = LoadDrivers();
+	if( rerr != KErrNone )
+		{
+		return rerr;
+		}
+
+	__UHEAP_MARK;
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+#if (defined TRAP_IGNORE)
+	TRAP_IGNORE(MainL());
+#else
+	TRAPD(err,MainL());
+#endif
+	delete cleanup;
+	__UHEAP_MARKEND;
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fntstore/src/T_TestOpenFont.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,211 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Creates a dummy rasterizer and a dummy shaper for FontStore APIs testing.
+// 
+//
+
+#include <e32std.h>
+#include <f32file.h>
+#include "T_TestOpenFont.h"
+
+CTestRasterizer* CTestRasterizer::NewL()
+	{
+	return new(ELeave) CTestRasterizer;
+	}
+
+COpenFontFile* CTestRasterizer::NewFontFileL(TInt aUid,const TDesC& aFileName,RFs& /*aFileSession*/)
+	{
+	TParse parse;
+	parse.Set(aFileName, NULL, NULL);
+
+	if (parse.Name().CompareF(KTestFont1) == 0 || parse.Name().CompareF(KTestFont2) == 0)
+		{
+		// create a dummy font.
+		return CTestFontFile::NewL(aUid,aFileName);
+		}
+	else
+		{
+		return NULL;	
+		}	
+	}
+
+CTestFontFile::CTestFontFile(TInt aUid, const TDesC& aFileName)
+: COpenFontFile(aUid, aFileName)
+	{
+	}
+
+CTestFontFile* CTestFontFile::NewL(TInt aUid, const TDesC& aFileName)
+	{
+	CTestFontFile* self = new(ELeave)CTestFontFile(aUid,aFileName);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop();
+	return self;
+	}
+
+TBool CTestFontFile::GetNearestFontHelper(const TOpenFontSpec& aDesiredFontSpec, TInt aPixelWidth, TInt aPixelHeight,
+											  TInt& aFaceIndex, TOpenFontSpec& aActualFontSpec) const
+	{
+	return COpenFontFile::GetNearestFontHelper(aDesiredFontSpec, aPixelWidth, aPixelHeight, aFaceIndex, aActualFontSpec);
+	}
+
+void CTestFontFile::ConstructL()
+	{
+	const TDesC& filename = FileName();
+	TOpenFontFaceAttrib attrib;
+
+	if (filename.CompareF(KTestFont1) == 0)
+		attrib.SetFullName(_L("Test Font1"));
+	else if (filename.CompareF(KTestFont2) == 0)
+		{
+		attrib.SetFullName(_L("Test Font2"));
+		attrib.SetBold(TRUE);
+		attrib.SetItalic(TRUE);
+		}
+	attrib.SetFamilyName(_L("Test"));
+	attrib.SetLocalFullName(attrib.FullName());
+	attrib.SetCoverage(TOpenFontFaceAttrib::ELatinSet);
+	attrib.SetMinSizeInPixels(8);
+	AddFaceL(attrib);
+	}
+
+void CTestFontFile::GetNearestFontInPixelsL(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,
+											 const TOpenFontSpec& aDesiredFontSpec,TInt aPixelWidth,TInt aPixelHeight,
+											 COpenFont*& aFont,TOpenFontSpec& aActualFontSpec)
+	{
+	aFont = NULL;
+	TInt face_index = 0;
+	if (GetNearestFontHelper(aDesiredFontSpec,aPixelWidth,aPixelHeight,face_index,aActualFontSpec))
+		{
+		aFont = CTestFont::NewL(aHeap,aSessionCacheList,this,aActualFontSpec.Height());
+		}
+	}
+
+void CTestFontFile::GetNearestFontToDesignHeightInPixelsL(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,
+											 const TOpenFontSpec& aDesiredFontSpec,TInt aPixelWidth,TInt aPixelHeight,
+											 COpenFont*& aFont,TOpenFontSpec& aActualFontSpec)
+	{
+	aFont = NULL;
+	TInt face_index = 0;
+	if (GetNearestFontHelper(aDesiredFontSpec,aPixelWidth,aPixelHeight,face_index,aActualFontSpec))
+		{
+		aFont = CTestFont::NewL(aHeap,aSessionCacheList,this,aActualFontSpec.Height());
+		}
+	}
+
+void CTestFontFile::GetNearestFontToMaxHeightInPixelsL(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,
+											 const TOpenFontSpec& aDesiredFontSpec,TInt aPixelWidth,TInt aPixelHeight,
+											 COpenFont*& aFont,TOpenFontSpec& aActualFontSpec,TInt /*aMaxHeight*/)
+	{
+	aFont = NULL;
+	TInt face_index = 0;
+	if (GetNearestFontHelper(aDesiredFontSpec,aPixelWidth,aPixelHeight,face_index,aActualFontSpec))
+		{
+		aFont = CTestFont::NewL(aHeap,aSessionCacheList,this,aActualFontSpec.Height());
+		}
+	}
+
+TBool CTestFontFile::HasUnicodeCharacterL(TInt /*aFaceIndex*/,TInt /*aCode*/) const
+	{
+	// has no characters
+	return EFalse;
+	}
+
+CTestFont* CTestFont::NewL(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,
+							 CTestFontFile* aFontFile,TInt aSizeInPixels)
+	{
+	CTestFont* f = (CTestFont*)aHeap->AllocL(sizeof(CTestFont));
+	new(f) CTestFont(aHeap,aSessionCacheList,aFontFile,aSizeInPixels);
+	return f;
+	}
+
+CTestFont::CTestFont(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,CTestFontFile* aFontFile,
+					   TInt aSizeInPixels):
+	COpenFont(aHeap,aSessionCacheList,aFontFile)
+	{
+	iMetrics.SetSize(aSizeInPixels);
+	iMetrics.SetAscent(aSizeInPixels * 3 / 4);
+	iMetrics.SetDescent(aSizeInPixels - iMetrics.Ascent());
+	iMetrics.SetMaxHeight(iMetrics.Ascent());
+	iMetrics.SetMaxDepth(iMetrics.Descent());
+	iMetrics.SetMaxWidth(aSizeInPixels * 2);
+	}
+
+void CTestFont::RasterizeL(TInt /*aCode*/,TOpenFontGlyphData* /*aGlyphData*/)
+	{
+	// has no glyphs
+	User::Leave(KErrNotSupported); 
+	}
+
+
+CTestShaperFactory* CTestShaperFactory::NewL()
+	{
+	return new(ELeave) CTestShaperFactory;	
+	}
+
+CTestShaperFactory::CTestShaperFactory()
+	{
+	}
+
+CTestShaperFactory::~CTestShaperFactory()
+	{	
+	}
+
+
+CShaper* CTestShaperFactory::NewShaperL(CBitmapFont* aBitmapfont, TInt aScript, TInt aLanguage, RHeap* aHeap)
+	{
+	return CTestShaper::NewL(aBitmapfont, aScript, aLanguage, aHeap);
+	} 
+
+void* CShaperFactory::ExtendedInterface(TUid /*aInterfaceId*/)
+	{
+	return 0;
+	}
+
+
+CShaper * CTestShaper::NewL(CBitmapFont* aBitmapfont, TInt aScript, TInt aLanguage, RHeap* aHeap)
+	{
+	CTestShaper* self = new(ELeave) CTestShaper();
+	CleanupStack::PushL(self);
+	TInt error = self->ConstructL(aBitmapfont, aScript, aLanguage, aHeap);
+	if (KErrNone == error)
+		{
+		CleanupStack::Pop();
+		return self;
+		}
+	else
+		{
+		CleanupStack::PopAndDestroy(); 
+		return NULL;		
+		}		
+	} 
+
+ TInt CTestShaper::ConstructL(CBitmapFont* /*aBitmapfont*/, TInt /*aScript*/, TInt /*aLanguage*/, RHeap* /*aHeap*/ )
+	{
+	return KErrNone;
+	}
+
+CTestShaper::CTestShaper()
+	{
+	}	
+		
+ CTestShaper::~CTestShaper()
+	{
+	}	
+
+TInt CTestShaper::ShapeText(TShapeHeader*& /*aOutput*/, const TInput& /*aInput*/, RHeap* /*aHeapForOutput*/)
+	{
+ 	return KErrNotSupported;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/inc/T_DataBitmapContext.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataBitmapContext
+*/
+
+#if (!defined __T_DATA_BITMAP_CONTEXT_H__)
+#define __T_DATA_BITMAP_CONTEXT_H__
+
+//	User includes
+#include "T_DataGraphicsContext.h"
+
+class CT_DataBitmapContext : public CT_DataGraphicsContext
+	{
+public:
+	virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	CT_DataBitmapContext();
+	virtual CBitmapContext*	GetBitmapContext() const = 0;
+
+	void	DoCmdAlphaBlendBitmapsL(const TDesC& aSection);
+	void	DoCmdBitBltL(const TDesC& aSection);
+	void	DoCmdBitBltMaskedL(const TDesC& aSection);
+	void	DoCmdClear(const TDesC& aSection);
+	void	DoCmdCopyRect(const TDesC& aSection);
+	void	DoCmdSetFaded(const TDesC& aSection);
+	void	DoCmdSetFadingParameters(const TDesC& aSection);
+	};
+
+#endif /* __T_DATA_BITMAP_CONTEXT_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/inc/T_DataBitmapDevice.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataBitmapDevice
+*/
+
+#if (!defined __T_DATA_BITMAP_DEVICE_H__)
+#define __T_DATA_BITMAP_DEVICE_H__
+
+//	User includes
+#include "T_DataGraphicsDevice.h"
+
+class CT_DataBitmapDevice : public CT_DataGraphicsDevice
+	{
+public:
+	virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	CT_DataBitmapDevice();
+	~CT_DataBitmapDevice();
+
+	virtual CBitmapDevice*	GetBitmapDevice() const = 0;
+
+	void	DoCmdAddFileL(const TDesC& aSection);
+	void	DoCmdCreateBitmapContextL(const TDesC& aSection);
+	void	DoCmdFontHeightInPixels(const TDesC& aSection);
+	void	DoCmdGetNearestFontInPixelsL(const TDesC& aSection);
+	void	DoCmdGetNearestFontToDesignHeightInPixelsL(const TDesC& aSection);
+	void	DoCmdGetNearestFontToMaxHeightInPixelsL(const TDesC& aSection);
+	void	DoCmdGetPixel(const TDesC& aSection);
+	void	DoCmdGetScanLineL(const TDesC& aSection);
+	void	DoCmdRemoveFile(const TDesC& aSection);
+	
+	void	CheckScanLine(const TDesC& aSection,TDes8 &aBuf);
+	
+private:
+	RArray<TPtrC>	iFile;
+	RArray<TInt>	iId;
+	};
+
+#endif /* __T_DATA_BITMAP_DEVICE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/inc/T_DataDrawTextExtendedParam.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataDrawTextExtendedParam
+*/
+
+#if (!defined __T_DATA_DRAW_TEXT_EXTENDED_PARAM_H__)
+#define __T_DATA_DRAW_TEXT_EXTENDED_PARAM_H__
+
+//	User Includes
+#include "T_DataDrawTextParam.h"
+
+class CT_DataDrawTextExtendedParam : public CT_DataDrawTextParam
+	{
+public:
+	CT_DataDrawTextExtendedParam();
+	~CT_DataDrawTextExtendedParam();
+
+	virtual TAny*	GetObject();
+	virtual void	SetObjectL(TAny* aAny);
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	virtual CGraphicsContext::TDrawTextParam*	GetDrawTextParam() const;
+
+	void	DoCmd_new();
+	void	DoCmd_destructor();
+	void	DoCmd_iParRightToLeft(const TDesC& aSection);
+
+private:
+	void	DestroyData();
+
+private:
+	CGraphicsContext::TDrawTextExtendedParam*	iDrawTextExtendedParam;
+	};
+
+#endif /* __T_DATA_DRAW_TEXT_EXTENDED_PARAM_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/inc/T_DataDrawTextParam.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataDrawTextParam
+*/
+
+#if (!defined __T_DATA_DRAW_TEXT_PARAM_H__)
+#define __T_DATA_DRAW_TEXT_PARAM_H__
+
+//	epoc32 includes
+#include <gdi.h>
+
+//	User Includes
+#include "DataWrapperBase.h"
+
+class CT_DataDrawTextParam : public CDataWrapperBase
+	{
+public:
+	CT_DataDrawTextParam();
+	~CT_DataDrawTextParam();
+
+	virtual TAny*	GetObject();
+	virtual void	SetObjectL(TAny* aAny);
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	virtual CGraphicsContext::TDrawTextParam*	GetDrawTextParam() const;
+
+	void	DoCmd_new();
+	void	DoCmd_destructor();
+	void	DoCmd_iDirection(const TDesC& aSection);
+	void	DoCmd_iCharJustNum(const TDesC& aSection);
+	void	DoCmd_iCharJustExcess(const TDesC& aSection);
+	void	DoCmd_iWordJustNum(const TDesC& aSection);
+	void	DoCmd_iWordJustExcess(const TDesC& aSection);
+
+private:
+	void	DestroyData();
+
+private:
+	CGraphicsContext::TDrawTextParam*	iDrawTextParam;
+	};
+
+#endif /* __T_DATA_DRAW_TEXT_PARAM_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/inc/T_DataFont.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataFont
+*/
+
+#if (!defined __T_DATA_FONT_H__)
+#define __T_DATA_FONT_H__
+
+//	User Includes
+#include "DataWrapperBase.h"
+
+//	epoc32 includes
+#include <gdi.h>
+#include <openfont.h>
+
+class CT_DataFont : public CDataWrapperBase
+	{
+public:
+	CT_DataFont();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+	virtual CFont*	GetFont() const = 0;
+
+private:
+	void			DoCmdTextCount(const TDesC& aSection);
+	void			DoCmdTextWidthInPixels(const TDesC& aSection);
+	void			DoCmdCharWidthInPixels(const TDesC& aSection);
+	void			DoCmdFontCapitalAscent(const TDesC& aSection);
+	void			DoCmdFontMaxAscent(const TDesC& aSection);
+	void			DoCmdFontStandardDescent(const TDesC& aSection);
+	void			DoCmdFontMaxDescent(const TDesC& aSection);
+	void			DoCmdFontLineGap(const TDesC& aSection);
+	void			DoCmdFontMaxHeight(const TDesC& aSection);
+	void			DoCmdTypeUid(const TDesC& aSection);
+	void			DoCmdHeightInPixels(const TDesC& aSection);
+	void			DoCmdAscentInPixels(const TDesC& aSection);
+	void			DoCmdDescentInPixels(const TDesC& aSection);
+	void			DoCmdMaxCharWidthInPixels(const TDesC& aSection);
+	void			DoCmdMaxNormalCharWidthInPixels(const TDesC& aSection);
+	void			DoCmdFontSpecInTwips(const TDesC& aSection);
+	void			DoCmdWidthZeroInPixels(const TDesC& aSection);
+	void			DoCmdBaselineOffsetInPixels(const TDesC& aSection);
+	void			DoCmdGetCharacterData(const TDesC& aSection);
+	void			DoCmdExtendedFunction(const TDesC& aSection);
+	void			DoCmdMeasureTextL(const TDesC& aSection);
+
+	//	Helpers
+	static TBool	GetMeasureTextInputL(CDataWrapper& aDataWrapper, const TDesC& aParameterName, const TDesC& aSection, CFont::TMeasureTextInput*& aMeasureTextInput);
+	static TBool	GetMeasureTextOutputL(CDataWrapper& aDataWrapper, const TDesC& aParameterName, const TDesC& aSection, CFont::TMeasureTextOutput*& aMeasureTextOutput);
+	};
+
+#endif /* __T_DATA_FONT_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/inc/T_DataGraphicsContext.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataGraphicsContext
+*/
+
+#if (!defined __T_DATA_GRAPHICS_CONTEXT_H__)
+#define __T_DATA_GRAPHICS_CONTEXT_H__
+
+//	epoc32 includes
+#include <gdi.h>
+
+//	User Includes
+#include "DataWrapperBase.h"
+
+class CT_DataGraphicsContext : public CDataWrapperBase
+	{
+public:
+	virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	CT_DataGraphicsContext();
+	virtual CGraphicsContext*	GetGraphicsContext() const = 0;
+
+	void	DoCmdCancelClippingRect();
+	void	DoCmdCancelClippingRegion();
+	void	DoCmdDeviceL(const TDesC& aSection);
+	void	DoCmdDiscardBrushPattern();
+	void	DoCmdDiscardFont();
+	void	DoCmdDrawArc(const TDesC& aSection);
+	void	DoCmdDrawBitmapL(const TDesC& aSection);
+	void	DoCmdDrawBitmapMaskedL(const TDesC& aSection);
+	void	DoCmdDrawEllipse(const TDesC& aSection);
+	void	DoCmdDrawLine(const TDesC& aSection);
+	void	DoCmdDrawLineBy(const TDesC& aSection);
+	void	DoCmdDrawLineTo(const TDesC& aSection);
+	void	DoCmdDrawPie(const TDesC& aSection);
+	void	DoCmdDrawPolygonL(const TDesC& aSection);
+	void	DoCmdDrawPolyLineL(const TDesC& aSection);
+	void	DoCmdDrawRect(const TDesC& aSection);
+	void	DoCmdDrawRoundRect(const TDesC& aSection);
+	void	DoCmdDrawText(const TDesC& aSection);
+	void	DoCmdDrawTextExtendedL(const TDesC& aSection);
+	void	DoCmdDrawTextVertical(const TDesC& aSection);
+	void	DoCmdGetShadowColor(const TDesC& aSection);
+	void	DoCmdGetUnderlineMetrics(const TDesC& aSection);
+	void	DoCmdJustificationInPixels(const TDesC& aSection);
+	void	DoCmdMapColorsL(const TDesC& aSection);
+	void	DoCmdMoveBy(const TDesC& aSection);
+	void	DoCmdMoveTo(const TDesC& aSection);
+	void	DoCmdPlot(const TDesC& aSection);
+	void	DoCmdReserved();
+	void	DoCmdReset();
+	void	DoCmdSetBrushColor(const TDesC& aSection);
+	void	DoCmdSetBrushOrigin(const TDesC& aSection);
+	void	DoCmdSetBrushStyle(const TDesC& aSection);
+	void	DoCmdSetClippingRegion(const TDesC& aSection);
+	void	DoCmdSetCharJustification(const TDesC& aSection);
+	void	DoCmdSetClippingRect(const TDesC& aSection);
+	void	DoCmdSetDrawMode(const TDesC& aSection);
+	void	DoCmdSetOrigin(const TDesC& aSection);
+	void	DoCmdSetPenColor(const TDesC& aSection);
+	void	DoCmdSetPenSize(const TDesC& aSection);
+	void	DoCmdSetPenStyle(const TDesC& aSection);
+	void	DoCmdSetShadowColor(const TDesC& aSection);
+	void	DoCmdSetStrikethroughStyle(const TDesC& aSection);
+	void	DoCmdSetUnderlineStyle(const TDesC& aSection);
+	void	DoCmdSetWordJustification(const TDesC& aSection);
+	void	DoCmdUseBrushPatternL(const TDesC& aSection);
+	void	DoCmdUseFontL(const TDesC& aSection);
+	};
+
+#endif /* __T_DATA_GRAPHICS_CONTEXT_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/inc/T_DataGraphicsDevice.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataGraphicsDevice
+*/
+
+#if (!defined __T_DATA_GRAPHICS_DEVICE_H__)
+#define __T_DATA_GRAPHICS_DEVICE_H__
+
+//	User Includes
+#include "T_DataGraphicsDeviceMap.h"
+
+class CT_DataGraphicsDevice : public CT_DataGraphicsDeviceMap
+	{
+public:
+	virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	CT_DataGraphicsDevice();
+
+	virtual CGraphicsDevice*	GetGraphicsDevice() const = 0;
+
+	void	DoCmdCreateContextL(const TDesC& aSection);
+	void	DoCmdDisplayMode(const TDesC& aSection);
+	void	DoCmdFontHeightInTwips(const TDesC& aSection);
+	void	DoCmdGetPaletteL(const TDesC& aSection);
+	void	DoCmdNumTypefaces(const TDesC& aSection);
+	void	DoCmdPaletteAttributes(const TDesC& aSection);
+	void	DoCmdSetPaletteL(const TDesC& aSection);
+	void	DoCmdSizeInPixels(const TDesC& aSection);
+	void	DoCmdSizeInTwips(const TDesC& aSection);
+	void	DoCmdTypefaceSupport(const TDesC& aSection);
+
+	//	helpers
+	inline TDisplayMode	GetDisplayMode() const;
+
+private:
+	TDisplayMode		iDisplayMode;
+	TSize				iSizeInPixels;
+	TSize				iSizeInTwips;
+	TTypefaceSupport	iTypefaceSupport;
+	};
+
+#include "T_DataGraphicsDevice.inl"
+
+#endif /* __T_DATA_GRAPHICS_DEVICE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/inc/T_DataGraphicsDevice.inl	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataGraphicsDevice inline functions
+*/
+
+TDisplayMode CT_DataGraphicsDevice::GetDisplayMode() const
+	{
+	return iDisplayMode;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/inc/T_DataGraphicsDeviceMap.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataGraphicsDeviceMap
+*/
+
+#if (!defined __T_DATA_GRAPHICS_DEVICE_MAP_H__)
+#define __T_DATA_GRAPHICS_DEVICE_MAP_H__
+
+//	epoc32 includes
+#include <bitdev.h>
+
+//	User Includes
+#include "DataWrapperBase.h"
+
+class CT_DataGraphicsDeviceMap : public CDataWrapperBase
+	{
+public:
+	virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	CT_DataGraphicsDeviceMap();
+
+	virtual MGraphicsDeviceMap*	GetGraphicsDeviceMap() const = 0;
+
+	void	DoCmdGetNearestFontInTwipsL(const TDesC& aSection);
+	void	DoCmdGetNearestFontToDesignHeightInTwipsL(const TDesC& aSection);
+	void	DoCmdGetNearestFontToMaxHeightInTwipsL(const TDesC& aSection);
+	void	DoCmdHorizontalPixelsToTwips(const TDesC& aSection);
+	void	DoCmdHorizontalTwipsToPixels(const TDesC& aSection);
+	void	DoCmdPixelsToTwips(const TDesC& aSection);
+	void	DoCmdReleaseFontL(const TDesC& aSection);
+	void	DoCmdTwipsToPixels(const TDesC& aSection);
+	void	DoCmdVerticalPixelsToTwips(const TDesC& aSection);
+	void	DoCmdVerticalTwipsToPixels(const TDesC& aSection);
+
+private:
+	TPoint	iTwipsToPixelsPoint;
+	TRect	iTwipsToPixelsRect;
+	TPoint	iPixelsToTwipsPoint;
+	TRect	iPixelsToTwipsRect;
+	};
+
+#endif /* __T_DATA_GRAPHICS_DEVICE_MAP_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/inc/T_DataMeasureTextInput.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataMeasureTextInput
+*/
+
+#if (!defined __T_DATA_MEASURE_TEXT_INPUT_H__)
+#define __T_DATA_MEASURE_TEXT_INPUT_H__
+
+//	User Includes
+#include "DataWrapperBase.h"
+//	EPOC includes
+#include <e32std.h>
+#include <gdi.h>
+
+class CT_DataMeasureTextInput : public CDataWrapperBase
+	{
+public:
+	static CT_DataMeasureTextInput*	NewL();
+
+	virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+	
+
+	~CT_DataMeasureTextInput();
+
+	virtual TAny* GetObject();
+
+protected:
+	CT_DataMeasureTextInput();
+	void ConstructL();
+
+private:
+	void		DoCmdNew();
+	void		DoCmdDestructor();
+	void		DoCmdSetCharJustExcess(const TDesC& aSection);
+	void		DoCmdSetCharJustNum(const TDesC& aSection);
+	void		DoCmdSetDirection(const TDesC& aSection);
+	void		DoCmdSetEndInputChar(const TDesC& aSection);
+	void		DoCmdSetFlags(const TDesC& aSection);
+	void		DoCmdSetMaxAdvance(const TDesC& aSection);
+	void		DoCmdSetMaxBounds(const TDesC& aSection);
+	void		DoCmdSetStartInputChar(const TDesC& aSection);
+	void		DoCmdSetWordJustExcess(const TDesC& aSection);
+	void		DoCmdSetWordJustNum(const TDesC& aSection);
+
+	///	Helpers
+	TBool		GetValueFromConfig(const TDesC& aSection, TInt& aValue);
+	TBool		ReadFlags(const TDesC& aSection, TUint16& aFlags);
+	void		DestroyData();
+
+private:
+
+	/** TMeasureTextInput class instance to work with*/
+    CFont::TMeasureTextInput*	iMeasureTextInput;
+	};
+
+#endif /* __T_DATA_MEASURE_TEXT_INPUT_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/inc/T_DataMeasureTextOutput.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataMeasureTextOutput
+*/
+
+#if (!defined __T_DATA_MEASURE_TEXT_OUTPUT_H__)
+#define __T_DATA_MEASURE_TEXT_OUTPUT_H__
+
+//	User Includes
+#include "DataWrapperBase.h"
+//	EPOC includes
+#include <e32std.h>
+#include <gdi.h>
+
+class CT_DataMeasureTextOutput : public CDataWrapperBase
+	{
+public:
+
+	static CT_DataMeasureTextOutput*	NewL();
+
+	virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+	
+	~CT_DataMeasureTextOutput();
+
+	virtual TAny*	GetObject();
+
+protected:
+	CT_DataMeasureTextOutput();
+	void ConstructL();
+
+private:
+	void		DestroyData();
+	void		DoCmdNew();
+	void		DoCmdSetBounds(const TDesC& aSection);
+	void		DoCmdSetChars(const TDesC& aSection);
+	void		DoCmdSetGlyphs(const TDesC& aSection);
+	void		DoCmdSetGroups(const TDesC& aSection);
+	void		DoCmdSetMaxGlyphSize(const TDesC& aSection);
+	void		DoCmdSetSpaces(const TDesC& aSection);
+
+	static TBool	CT_DataMeasureTextOutput::GetValueFromConfig(CDataWrapper& iInputStep, const TDesC& aSection, TInt& aValue);
+
+private:
+	/** TMeasureTextOutput class instance to work with*/
+    CFont::TMeasureTextOutput*	iMeasureTextOutput;
+	};
+
+#endif /* __T_DATA_MEASURE_TEXT_OUTPUT_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/inc/T_DataPalette.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataPalette
+*/
+
+#if (!defined __T_DATA_PALETTE_H__)
+#define __T_DATA_PALETTE_H__
+
+//	User Includes
+#include "DataWrapperBase.h"
+
+//	EPOC includes
+#include <e32std.h>
+#include <gdi.h>
+
+class CT_DataPalette : public CDataWrapperBase
+	{
+public:
+
+	static CT_DataPalette*	NewL();
+
+	~CT_DataPalette();
+
+	virtual TAny* GetObject();
+
+	void DestroyData();
+
+	virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	CT_DataPalette();
+	void ConstructL();
+
+private:
+	void	DoCmdNew(const TDesC& aSection);
+	void	DoCmdNewDefault(const TDesC& aSection);
+
+private:
+	/** CPalette class instance to work with*/
+    CPalette* iPalette;
+	};
+
+#endif /* __T_DATA_PALETTE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/inc/T_DataTypefaceStore.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataTypefaceStore
+*/
+
+#if (!defined __T_DATA_TYPEFACE_STORE_H__)
+#define __T_DATA_TYPEFACE_STORE_H__
+
+//	User Includes
+#include "DataWrapperBase.h"
+#include "T_DataFont.h"
+
+//	epoc32 includes
+#include <gdi.h>
+
+class CT_DataTypefaceStore : public CDataWrapperBase
+	{
+public:
+	virtual TBool			DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+	CT_DataTypefaceStore();
+
+protected:
+
+	virtual CTypefaceStore*	GetTypefaceStore() const = 0;
+	CT_DataFont*			GetFontDataObjectFromParameterL(const TDesC& aParameterName, const TDesC& aSection);
+	void					SetFontDataObjectIfPassedAsParameterL(CFont* font, const TDesC& aSection);
+
+private:
+	void	DoCmdGetNearestFontInTwipsL(const TDesC& aSection);
+	void	DoCmdGetNearestFontToDesignHeightInTwipsL(const TDesC& aSection);
+	void	DoCmdGetNearestFontToMaxHeightInTwipsL(const TDesC& aSection);
+	void	DoCmdNumTypefaces(const TDesC& aSection);
+	void	DoCmdTypefaceSupport(const TDesC& aSection);
+	void	DoCmdFontHeightInTwips(const TDesC& aSection);
+	void	DoCmdReleaseFontL(const TDesC& aSection);
+	};
+
+#endif /* __T_DATA_TYPEFACE_STORE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/src/T_DataBitmapContext.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,384 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataGraphicsContext
+*/
+
+#include "T_DataBitmapContext.h"
+#include "T_GraphicsUtil.h"
+
+/*@{*/
+///	Commands
+_LIT(KCmdAlphaBlendBitmaps,							"AlphaBlendBitmaps");
+_LIT(KCmdBitBlt,									"BitBlt");
+_LIT(KCmdBitBltMasked,								"BitBltMasked");
+_LIT(KCmdClear,										"Clear");
+_LIT(KCmdCopyRect,									"CopyRect");
+_LIT(KCmdSetFaded,									"SetFaded");
+_LIT(KCmdSetFadingParameters,						"SetFadingParameters");
+
+///	Fields
+_LIT(KFldAlphaBmp,									"alphabmp");
+_LIT(KFldAlphaPt,									"alphapt");
+_LIT(KFldBitmap,									"bitmap");
+_LIT(KFldBlackMap,									"blackmap");
+_LIT(KFldDestination,								"destination");
+_LIT(KFldDestPt,									"destpt");
+_LIT(KFldFaded,										"faded");
+_LIT(KFldInvertMask,								"invertmask");
+_LIT(KFldMaskBitmap,								"maskbitmap");
+_LIT(KFldOffset,									"offset");
+_LIT(KFldPoint,										"point");
+_LIT(KFldRect,										"rect");
+_LIT(KFldSource,									"source");
+_LIT(KFldSourceRect,								"sourcerect");
+_LIT(KFldSrcBmp,									"srcbmp");
+_LIT(KFldSrcRect,									"srcrect");
+_LIT(KFldSrcWsBmp,									"srcwsbmp");
+_LIT(KFldWhiteMap,									"whitemap");
+
+///	Logging
+_LIT(KLogError,										"Error=%d");
+_LIT(KLogMissingParameter,							"Missing parameter '%S'");
+/*@}*/
+
+/**
+* Constructor. First phase construction
+*/
+CT_DataBitmapContext::CT_DataBitmapContext()
+:	CT_DataGraphicsContext()
+	{
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataBitmapContext::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	ret=ETrue;
+	if ( aCommand==KCmdAlphaBlendBitmaps )
+		{
+		DoCmdAlphaBlendBitmapsL(aSection);
+		}
+	else if ( aCommand==KCmdBitBlt )
+		{
+		DoCmdBitBltL(aSection);
+		}
+	else if ( aCommand==KCmdBitBltMasked )
+		{
+		DoCmdBitBltMaskedL(aSection);
+		}
+	else if ( aCommand==KCmdClear )
+		{
+		DoCmdClear(aSection);
+		}
+	else if ( aCommand==KCmdCopyRect )
+		{
+		DoCmdCopyRect(aSection);
+		}
+	else if ( aCommand==KCmdSetFaded )
+		{
+		DoCmdSetFaded(aSection);
+		}
+	else if ( aCommand==KCmdSetFadingParameters )
+		{
+		DoCmdSetFadingParameters(aSection);
+		}
+	else
+		{
+		ret=CT_DataGraphicsContext::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+
+	return ret;
+	}
+
+void CT_DataBitmapContext::DoCmdAlphaBlendBitmapsL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	TPoint	destinationPoint;
+	if ( !GetPointFromConfig(aSection, KFldDestPt, destinationPoint) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldDestPt());
+		SetBlockResult(EFail);
+		}
+
+	TRect	sourceRect;
+	if ( !GetRectFromConfig(aSection, KFldSrcRect, sourceRect) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldSrcRect());
+		SetBlockResult(EFail);
+		}
+
+	TPoint	alphaPoint;
+	if ( !GetPointFromConfig(aSection, KFldAlphaPt, alphaPoint) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldAlphaPt());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		TInt		err=KErrNone;
+
+		CWsBitmap*	wsBitmap=NULL;
+		if ( CT_GraphicsUtil::GetWsBitmapL(*this, aSection, KFldSrcWsBmp, wsBitmap) )
+			{
+			CWsBitmap*	alphaBitmap=NULL;
+			if ( !CT_GraphicsUtil::GetWsBitmapL(*this, aSection, KFldAlphaBmp, alphaBitmap) )
+				{
+				ERR_PRINTF2(KLogMissingParameter, &KFldAlphaBmp());
+				SetBlockResult(EFail);
+				}
+			else
+				{
+				INFO_PRINTF1(_L("execute AlphaBlendBitmaps(TPoint, CWsBitmap*, TRect, CWsBitmap*, TPoint)"));
+				err=GetBitmapContext()->AlphaBlendBitmaps(destinationPoint, wsBitmap, sourceRect, alphaBitmap, alphaPoint);
+				}
+			}
+		else
+			{
+			CFbsBitmap*	fbsBitmap=NULL;
+			if ( CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFldSrcBmp, fbsBitmap) )
+				{
+				CFbsBitmap*	alphaBitmap=NULL;
+				if ( !CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFldAlphaBmp, alphaBitmap) )
+					{
+					ERR_PRINTF2(KLogMissingParameter, &KFldAlphaBmp());
+					SetBlockResult(EFail);
+					}
+				else
+					{
+					INFO_PRINTF1(_L("execute AlphaBlendBitmaps(TPoint, CFbsBitmap*, TRect, CFbsBitmap*, TPoint)"));
+					err=GetBitmapContext()->AlphaBlendBitmaps(destinationPoint, fbsBitmap, sourceRect, alphaBitmap, alphaPoint);
+					}
+				}
+			else
+				{
+				ERR_PRINTF2(KLogMissingParameter, &KFldSrcWsBmp());
+				ERR_PRINTF2(KLogMissingParameter, &KFldSrcBmp());
+				SetBlockResult(EFail);
+				}
+			}
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		}
+	}
+
+void CT_DataBitmapContext::DoCmdBitBltL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	CFbsBitmap*	bitmap=NULL;
+	if ( !CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFldBitmap, bitmap) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldBitmap());
+		SetBlockResult(EFail);
+		}
+
+	TPoint		point;
+	if ( GetPointFromConfig(aSection, KFldPoint, point) )
+		{
+		if ( dataOk )
+			{
+			// Execute command and log parameters
+			INFO_PRINTF1(_L("execute BitBlt(TPoint, CFbsBitmap*)"));
+			GetBitmapContext()->BitBlt(point, bitmap);
+			}
+		}
+	else
+		{
+		TPoint	destination;
+		if ( !GetPointFromConfig(aSection, KFldDestination, destination) )
+			{
+			dataOk=EFalse;
+			ERR_PRINTF2(KLogMissingParameter, &KFldDestination());
+			SetBlockResult(EFail);
+			}
+
+		TRect	source;
+		if ( !GetRectFromConfig(aSection, KFldSource, source) )
+			{
+			dataOk=EFalse;
+			ERR_PRINTF2(KLogMissingParameter, &KFldSource());
+			SetBlockResult(EFail);
+			}
+
+		if ( dataOk )
+			{
+			// Execute command and log parameters
+			INFO_PRINTF1(_L("execute BitBlt(TRect, CFbsBitmap*, TRect)"));
+			GetBitmapContext()->BitBlt(destination, bitmap, source);
+			}
+		}
+	}
+
+void CT_DataBitmapContext::DoCmdBitBltMaskedL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TPoint	point;
+	if ( !GetPointFromConfig(aSection, KFldPoint, point) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldPoint());
+		SetBlockResult(EFail);
+		}
+
+	TRect	sourceRect;
+	if ( !GetRectFromConfig(aSection, KFldSourceRect, sourceRect) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldSourceRect());
+		SetBlockResult(EFail);
+		}
+
+	TBool	invertMask;
+	if ( !GetBoolFromConfig(aSection, KFldInvertMask, invertMask) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldInvertMask());
+		SetBlockResult(EFail);
+		}
+
+	CFbsBitmap*	bitmap=NULL;
+	if ( !CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFldBitmap, bitmap) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldBitmap());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		CFbsBitmap*	maskBitmap=NULL;
+		CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFldMaskBitmap, maskBitmap);
+
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute BitBltMasked(TPoint, CFbsBitmap*, TRect, CFbsBitmap*, TBool)"));
+		GetBitmapContext()->BitBltMasked(point, bitmap, sourceRect, maskBitmap, invertMask);
+		}
+	}
+
+void CT_DataBitmapContext::DoCmdClear(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TRect	rect;
+	if ( GetRectFromConfig(aSection, KFldRect, rect) )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute Clear(TRect)"));
+		GetBitmapContext()->Clear(rect);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute Clear()"));
+		GetBitmapContext()->Clear();
+		}
+	}
+
+void CT_DataBitmapContext::DoCmdCopyRect(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TPoint	offset;
+	if ( !GetPointFromConfig(aSection, KFldOffset, offset) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldOffset());
+		SetBlockResult(EFail);
+		}
+
+	TRect	rect;
+	if ( !GetRectFromConfig(aSection, KFldRect, rect) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldRect());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute CopyRect(TPoint, TRect)"));
+		GetBitmapContext()->CopyRect(offset, rect);
+		}
+	}
+
+void CT_DataBitmapContext::DoCmdSetFaded(const TDesC& aSection)
+	{
+	TBool	faded=ETrue;
+	if(	!GetBoolFromConfig(aSection, KFldFaded(), faded))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldFaded());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetFaded(TBool)"));
+		GetBitmapContext()->SetFaded(faded);
+		}
+	}
+
+void CT_DataBitmapContext::DoCmdSetFadingParameters(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	TInt	blackMap=0;
+	if(	!GetIntFromConfig(aSection, KFldBlackMap(), blackMap) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldBlackMap());
+		SetBlockResult(EFail);
+		}
+
+	TInt	whiteMap=255;
+	if(	!GetIntFromConfig(aSection, KFldWhiteMap(), whiteMap) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldWhiteMap());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetFadingParameters(TUint8, TUint8)"));
+		GetBitmapContext()->SetFadingParameters((TUint8)blackMap, (TUint8)whiteMap);
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/src/T_DataBitmapDevice.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,641 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataGraphicsDevice
+*/
+
+#include "T_DataBitmapDevice.h"
+#include "T_GraphicsUtil.h"
+
+/*@{*/
+///	Commands
+_LIT(KCmdAddFile,									"AddFile");
+_LIT(KCmdCreateBitmapContext,						"CreateBitmapContext");
+_LIT(KCmdFontHeightInPixels,						"FontHeightInPixels");
+_LIT(KCmdGetNearestFontInPixels,					"GetNearestFontInPixels");
+_LIT(KCmdGetNearestFontToDesignHeightInPixels,		"GetNearestFontToDesignHeightInPixels");
+_LIT(KCmdGetNearestFontToMaxHeightInPixels,			"GetNearestFontToMaxHeightInPixels");
+_LIT(KCmdGetPixel,									"GetPixel");
+_LIT(KCmdGetScanLine,								"GetScanLine");
+_LIT(KCmdRemoveFile,								"RemoveFile");
+
+///	Fields
+_LIT(KFldBitmapContext,								"bitmap_context");
+_LIT(KFldBuffLength,								"buff_length");
+_LIT(KFldCheckScanLine,								"checkScanLine");
+_LIT(KFldScanLineBufferLength,						"scanLineBufferLength");
+_LIT(KFldDisplayMode,								"displaymode");
+_LIT(KFldExpected,									"expected");
+_LIT(KFldFile,										"file");
+_LIT(KFldFont,										"font");
+_LIT(KFldHeightIndex,								"height_index");
+_LIT(KFldId,										"id");
+_LIT(KFldLength,									"length");
+_LIT(KFldMaxHeight,									"maxheight");
+_LIT(KFldPoint,										"point");
+_LIT(KFldSize,										"size");
+_LIT(KFldTypefaceIndex,								"typeface_index");
+_LIT(KFldPointNum,									"checkPointNum");
+_LIT(KFldPointXN,									"point%d_x");
+_LIT(KFldPointRGBN,									"expected_point%d");
+_LIT(KFldScanlineY,									"scanline_y");
+
+///	Logging
+_LIT(KLogColor,										"Color Red=%d Green=%d Blue=%d Alpha=%d");
+_LIT(KLogError,										"Error=%d");
+_LIT(KLogHeight,									"Height=%d");
+_LIT(KLogMissingFilename,							"File '%S' not found in array");
+_LIT(KLogMissingParameter,							"Missing parameter '%S'");
+_LIT(KLogMissingWrapper,							"Missing wrapper for '%S'");
+_LIT(KLogNotExpectedValue,							"Not expected value");
+_LIT(KLogDoNotCheckScanLine,						"Will not check scanline.");
+_LIT(KLogDoCheckScanLine,							"Will check scanline is correct.");
+_LIT(KLogCheckScanLineResult,						"ScanLine checked, expected length is %d, actual length is %d.");
+_LIT(KLogColorExpected,								"Expected Color Red=%d Green=%d Blue=%d Alpha=%d");
+_LIT(KLogColorActual,								"Actual Color Red=%d Green=%d Blue=%d Alpha=%d");
+_LIT(KLogPoint,										"Point X=%d Y=%d");
+/*@}*/
+
+
+/**
+* Constructor. First phase construction
+*/
+CT_DataBitmapDevice::CT_DataBitmapDevice()
+:	CT_DataGraphicsDevice()
+	{
+	}
+
+CT_DataBitmapDevice::~CT_DataBitmapDevice()
+	{
+	iFile.Reset();
+	iFile.Close();
+	iId.Reset();
+	iId.Close();
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataBitmapDevice::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	ret=ETrue;
+	if ( aCommand==KCmdAddFile )
+		{
+		DoCmdAddFileL(aSection);
+		}
+	else if ( aCommand==KCmdCreateBitmapContext )
+		{
+		DoCmdCreateBitmapContextL(aSection);
+		}
+	else if ( aCommand==KCmdFontHeightInPixels )
+		{
+		DoCmdFontHeightInPixels(aSection);
+		}
+	else if ( aCommand==KCmdGetNearestFontInPixels )
+		{
+		DoCmdGetNearestFontInPixelsL(aSection);
+		}
+	else if ( aCommand==KCmdGetNearestFontToDesignHeightInPixels )
+		{
+		DoCmdGetNearestFontToDesignHeightInPixelsL(aSection);
+		}
+	else if ( aCommand==KCmdGetNearestFontToMaxHeightInPixels )
+		{
+		DoCmdGetNearestFontToMaxHeightInPixelsL(aSection);
+		}
+	else if ( aCommand==KCmdGetPixel )
+		{
+		DoCmdGetPixel(aSection);
+		}
+	else if ( aCommand==KCmdGetScanLine )
+		{
+		DoCmdGetScanLineL(aSection);
+		}
+	else if ( aCommand==KCmdRemoveFile )
+		{
+		DoCmdRemoveFile(aSection);
+		}
+	else
+		{
+		ret=CT_DataGraphicsDevice::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+
+	/* Another work package will implement this */
+	return ret;
+	}
+
+void CT_DataBitmapDevice::DoCmdAddFileL(const TDesC& aSection)
+	{
+	// get typeface index from parameters
+	TPtrC	file;
+	if ( !GetStringFromConfig(aSection, KFldFile(), file) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldFile());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		TInt	id;
+		INFO_PRINTF1(_L("execute AddFile(const TDesC&, TInt&)"));
+		TInt	err=GetBitmapDevice()->AddFile(file, id);
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		else
+			{
+			// Append filename and id
+			iFile.AppendL(file);
+			iId.AppendL(id);
+			}
+		}
+	}
+
+void CT_DataBitmapDevice::DoCmdCreateBitmapContextL(const TDesC& aSection)
+	{
+	TPtrC	wrapperName;
+	if ( !GetStringFromConfig(aSection, KFldBitmapContext, wrapperName) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldBitmapContext());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		CDataWrapper*	wrapper=GetDataWrapperL(wrapperName);
+		if ( wrapper==NULL )
+			{
+			ERR_PRINTF2(KLogMissingWrapper, &wrapperName);
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			CBitmapContext*	bitmapContext=NULL;
+			INFO_PRINTF1(_L("execute CreateBitmapContext(CBitmapContext*&)"));
+			TInt	err=GetBitmapDevice()->CreateBitmapContext(bitmapContext);
+			if ( err!=KErrNone )
+				{
+				ERR_PRINTF2(KLogError, err);
+				SetError(err);
+				}
+			else
+				{
+				wrapper->SetObjectL(bitmapContext);
+				}
+			}
+		}
+	}
+
+void CT_DataBitmapDevice::DoCmdFontHeightInPixels(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// get typeface index from parameters
+	TInt	typefaceIndex;
+	if ( !GetIntFromConfig(aSection, KFldTypefaceIndex(), typefaceIndex) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldTypefaceIndex());
+		SetBlockResult(EFail);
+		}
+
+	// get height index from parameters
+	TInt	heightIndex;
+	if ( !GetIntFromConfig(aSection, KFldHeightIndex(), heightIndex) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldHeightIndex());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		INFO_PRINTF1(_L("execute FontHeightInPixels(TInt, TInt)"));
+		TInt	height=GetBitmapDevice()->FontHeightInPixels(typefaceIndex, heightIndex);
+		INFO_PRINTF2(KLogHeight, height);
+	
+		TInt	expected;
+		if ( GetIntFromConfig(aSection, KFldExpected, expected) )
+			{
+			if ( expected!=height )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+void CT_DataBitmapDevice::DoCmdGetNearestFontInPixelsL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	TFontSpec	fontSpec;
+	if ( !GetFontSpecFromConfig(aSection, KFldFont, fontSpec) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+
+	TPtrC	wrapperName;
+	if ( !GetStringFromConfig(aSection, KFldFont, wrapperName) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		CDataWrapper*	wrapper=GetDataWrapperL(wrapperName);
+		if ( wrapper==NULL )
+			{
+			ERR_PRINTF2(KLogMissingWrapper, &wrapperName);
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			CFont*	font=NULL;
+			INFO_PRINTF1(_L("execute GetNearestFontInPixels(CFont*&, TFontSpec)"));
+			TInt	err=GetBitmapDevice()->GetNearestFontInPixels(font, fontSpec);
+			if ( err!=KErrNone )
+				{
+				ERR_PRINTF2(KLogError, err);
+				SetError(err);
+				}
+			else
+				{
+				wrapper->SetObjectL(font);
+				}
+			}
+		}
+	}
+
+void CT_DataBitmapDevice::DoCmdGetNearestFontToDesignHeightInPixelsL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	TFontSpec	fontSpec;
+	if ( !GetFontSpecFromConfig(aSection, KFldFont, fontSpec) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+
+	TPtrC		wrapperName;
+	// get BitmapUtilData object from parameters
+	if ( !GetStringFromConfig(aSection, KFldFont, wrapperName) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		CDataWrapper*	wrapper=GetDataWrapperL(wrapperName);
+		if ( wrapper==NULL )
+			{
+			ERR_PRINTF2(KLogMissingWrapper, &wrapperName);
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			CFont*	font=NULL;
+			INFO_PRINTF1(_L("execute GetNearestFontToDesignHeightInPixels(CFont*&, TFontSpec)"));
+			TInt	err=GetBitmapDevice()->GetNearestFontToDesignHeightInPixels(font, fontSpec);
+			if ( err!=KErrNone )
+				{
+				ERR_PRINTF2(KLogError, err);
+				SetError(err);
+				}
+			else
+				{
+				wrapper->SetObjectL(font);
+				}
+			}
+		}
+	}
+
+void CT_DataBitmapDevice::DoCmdGetNearestFontToMaxHeightInPixelsL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	TFontSpec	fontSpec;
+	if ( !GetFontSpecFromConfig(aSection, KFldFont, fontSpec) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+
+	TInt	maxHeight;
+	if ( !GetIntFromConfig(aSection, KFldMaxHeight, maxHeight) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldMaxHeight());
+		SetBlockResult(EFail);
+		}
+
+	TPtrC		wrapperName;
+	// get BitmapUtilData object from parameters
+	if ( !GetStringFromConfig(aSection, KFldFont, wrapperName) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		CDataWrapper*	wrapper=GetDataWrapperL(wrapperName);
+		if ( wrapper==NULL )
+			{
+			ERR_PRINTF2(KLogMissingWrapper, &wrapperName);
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			CFont*	font=NULL;
+			INFO_PRINTF1(_L("execute GetNearestFontToMaxHeightInPixels(CFont*&, TFontSpec, TInt)"));
+			TInt	err=GetBitmapDevice()->GetNearestFontToMaxHeightInPixels(font, fontSpec, maxHeight);
+			if ( err!=KErrNone )
+				{
+				ERR_PRINTF2(KLogError, err);
+				SetError(err);
+				}
+			else
+				{
+				wrapper->SetObjectL(font);
+				}
+			}
+		}
+	}
+
+void CT_DataBitmapDevice::DoCmdGetPixel(const TDesC& aSection)
+	{
+	// get typeface index from parameters
+	TPoint	point;
+	if ( !GetPointFromConfig(aSection, KFldPoint(), point) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldPoint());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		TRgb	color;
+		INFO_PRINTF1(_L("execute GetPixel(TRgb&, const TPoint&)"));
+		GetBitmapDevice()->GetPixel(color, point);
+		INFO_PRINTF5(KLogColor, color.Red(), color.Green(), color.Blue(), color.Alpha());
+
+		TRgb	expected;
+		if ( GetRgbFromConfig(aSection, KFldExpected, expected) )
+			{
+			if ( expected!=color )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+void CT_DataBitmapDevice::DoCmdGetScanLineL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// get point x coordinate from parameters
+	TPoint	point;
+	if ( !GetPointFromConfig(aSection, KFldPoint(), point) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldPoint());
+		SetBlockResult(EFail);
+		}
+
+	// get length from parameters
+	TInt	length = 0;
+	if ( !GetIntFromConfig(aSection, KFldLength(), length) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldLength());
+		SetBlockResult(EFail);
+		}
+
+	// get buffer length from parameters
+	TInt	buffLength = 0;
+	if ( !GetIntFromConfig(aSection, KFldBuffLength(), buffLength) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldBuffLength());
+		SetBlockResult(EFail);
+		}
+
+	// get display mode from parameters
+	TDisplayMode	displayMode;
+	if ( !CT_GraphicsUtil::ReadDisplayMode(*this, aSection, KFldDisplayMode(), displayMode) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldDisplayMode());
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+
+	if ( dataOk )
+		{
+		// call GetScanLine()
+		TUint8*	buffer = new (ELeave) TUint8[buffLength];
+		TPtr8	scanline(buffer, buffLength, buffLength);
+
+		INFO_PRINTF1(_L("execute GetScanLine(TDes8&, const TPoint&, TInt, TDisplayMode)"));
+		GetBitmapDevice()->GetScanLine(scanline, point, length, displayMode);
+		
+		// Check ScanLine.
+		TBool checkScanLine = EFalse;
+		if ( !GetBoolFromConfig(aSection, KFldCheckScanLine(), checkScanLine)  )
+			{
+			INFO_PRINTF1(KLogDoNotCheckScanLine);	
+			}
+		else 
+			{
+			if(!checkScanLine)
+				{
+				INFO_PRINTF1(KLogDoNotCheckScanLine);
+				}
+			else
+				{
+				INFO_PRINTF1(KLogDoCheckScanLine);				
+				
+				// get length of returned scanline
+				TInt	expectedscanLineBufferLength = 0;
+				if ( GetIntFromConfig(aSection, KFldScanLineBufferLength, expectedscanLineBufferLength) )
+					{		
+					TInt scanlineLen = scanline.Length();
+					INFO_PRINTF3(KLogCheckScanLineResult,expectedscanLineBufferLength,scanlineLen);
+					if(expectedscanLineBufferLength != scanlineLen)				
+						{
+							ERR_PRINTF3(KLogCheckScanLineResult,expectedscanLineBufferLength,scanlineLen);
+							SetBlockResult(EFail);
+						}						
+					}
+				else
+					{
+					//check the scanline got correctlly.
+					CheckScanLine(aSection,scanline);
+					}
+				
+				}
+			}
+		delete [] buffer;
+		}
+	}
+
+void CT_DataBitmapDevice::DoCmdRemoveFile(const TDesC& aSection)
+	{
+	TBool	dataOk = ETrue;
+	TInt	id;
+	if ( !GetIntFromConfig(aSection, KFldId(), id) )
+		{
+		TPtrC	file;
+		if ( !GetStringFromConfig(aSection, KFldFile(), file) )
+			{
+			dataOk=EFalse;
+			ERR_PRINTF2(KLogMissingParameter, &KFldId());
+			ERR_PRINTF2(KLogMissingParameter, &KFldFile());
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			TBool	found=EFalse;	//	Filename found in array
+			for ( TInt index=iFile.Count(); (index>0) && (!found);  )
+				{
+				if ( iFile[--index]==file )
+					{
+					id=iId[index];
+					iFile.Remove(index);
+					iId.Remove(index);
+					found=ETrue;
+					}
+				}
+			if ( !found )
+				{
+				dataOk=EFalse;
+				ERR_PRINTF2(KLogMissingFilename, &file);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+
+	if ( dataOk )
+		{
+		INFO_PRINTF1(_L("execute RemoveFile(TInt)"));
+		GetBitmapDevice()->RemoveFile(id);
+		}
+	}
+
+void CT_DataBitmapDevice::CheckScanLine(const TDesC& aSection,TDes8 &aBuf)
+	{
+	INFO_PRINTF1(KLogDoCheckScanLine);	
+	
+	TBool appendCheckDataOK = ETrue;
+	TSize	bitmapSize;
+	if ( !GetSizeFromConfig(aSection, KFldSize, bitmapSize) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldSize);
+		SetBlockResult(EFail);
+		appendCheckDataOK = EFalse;
+		}
+	
+	TDisplayMode displayMode;
+	if ( !CT_GraphicsUtil::ReadDisplayMode(*this, aSection, KFldDisplayMode(), displayMode) )
+		{
+		ERR_PRINTF1(_L("No display mode"));
+		SetBlockResult(EFail);
+		appendCheckDataOK = EFalse;
+		}
+	
+	TInt pointNum;
+	if ( !GetIntFromConfig(aSection, KFldPointNum(), pointNum) )
+		{
+		ERR_PRINTF1(_L("No check point num"));
+		SetBlockResult(EFail);
+		appendCheckDataOK = EFalse;
+		}
+	
+	TInt scanlineY;
+	if ( !GetIntFromConfig(aSection, KFldScanlineY, scanlineY) )
+		{
+		ERR_PRINTF1(_L("No check scan line Y"));
+		SetBlockResult(EFail);
+		appendCheckDataOK = EFalse;
+		}
+	
+	if (appendCheckDataOK)
+		{
+		CFbsBitmap* fbsbitmap = new(ELeave) CFbsBitmap();
+		fbsbitmap->Create(bitmapSize,displayMode); 
+		fbsbitmap->SetScanLine(aBuf,scanlineY);
+		
+		TBuf<KMaxTestExecuteCommandLength>	tempStore;		
+		
+		for (TInt i=1;i<=pointNum;i++)
+			{
+			TInt x;			
+			tempStore.Format(KFldPointXN, i);
+			if ( !GetIntFromConfig(aSection, tempStore, x) )
+				{
+				ERR_PRINTF2(KLogMissingParameter, &tempStore);
+				SetBlockResult(EFail);
+				appendCheckDataOK=EFalse;
+				}	
+			TRgb expected;
+			tempStore.Format(KFldPointRGBN, i);
+			if ( !GetRgbFromConfig(aSection, tempStore, expected) )
+				{
+				ERR_PRINTF2(KLogMissingParameter, &KFldExpected());
+				SetBlockResult(EFail);
+				appendCheckDataOK=EFalse;
+				}
+			if(appendCheckDataOK)
+				{
+				TRgb actual;
+				TPoint pixelPoint(x,scanlineY);
+				fbsbitmap->GetPixel(actual,pixelPoint);
+				if(actual != expected)
+					{
+					ERR_PRINTF3(KLogPoint, x,scanlineY);
+					ERR_PRINTF5(KLogColorActual, actual.Red(), actual.Green(), actual.Blue(), actual.Alpha());
+					ERR_PRINTF5(KLogColorExpected, expected.Red(), expected.Green(), expected.Blue(), expected.Alpha());
+					SetBlockResult(EFail);
+					}
+				}
+			}
+
+		delete fbsbitmap;
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/src/T_DataDrawTextExtendedParam.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,140 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataDrawTextExtendedParam
+*/
+
+//	User includes
+#include "T_DataDrawTextExtendedParam.h"
+
+/*@{*/
+///	Commands
+_LIT(KCmd_new,										"new");
+_LIT(KCmd_destructor,								"~");
+_LIT(KCmd_iParRightToLeft,							"iParRightToLeft");
+
+///	Parameters
+_LIT(KFldValue,										"value");
+
+///	Logging
+_LIT(KLogError,										"Error=%d");
+/*@}*/
+
+/**
+* Constructor. First phase construction
+*/
+CT_DataDrawTextExtendedParam::CT_DataDrawTextExtendedParam()
+:	CT_DataDrawTextParam()
+,	iDrawTextExtendedParam(NULL)
+	{
+	}
+
+/**
+* Constructor. First phase construction
+*/
+CT_DataDrawTextExtendedParam::~CT_DataDrawTextExtendedParam()
+	{
+	DestroyData();
+	}
+
+void CT_DataDrawTextExtendedParam::DestroyData()
+	{
+	delete iDrawTextExtendedParam;
+	iDrawTextExtendedParam=NULL;
+	}
+
+TAny* CT_DataDrawTextExtendedParam::GetObject()
+	{
+	return iDrawTextExtendedParam;
+	}
+
+void CT_DataDrawTextExtendedParam::SetObjectL(TAny* aAny)
+	{
+	DestroyData();
+	iDrawTextExtendedParam=static_cast<CGraphicsContext::TDrawTextExtendedParam*>(aAny);
+	}
+
+void CT_DataDrawTextExtendedParam::DisownObjectL()
+	{
+	iDrawTextExtendedParam=NULL;
+	}
+
+CGraphicsContext::TDrawTextParam* CT_DataDrawTextExtendedParam::GetDrawTextParam() const
+	{
+	return iDrawTextExtendedParam;
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataDrawTextExtendedParam::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	ret=ETrue;
+	if ( aCommand==KCmd_new )
+		{
+		DoCmd_new();
+		}
+	else if ( aCommand==KCmd_destructor )
+		{
+		DoCmd_destructor();
+		}
+	else if ( aCommand==KCmd_iParRightToLeft )
+		{
+		DoCmd_iParRightToLeft(aSection);
+		}
+	else
+		{
+		ret=CT_DataDrawTextParam::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+
+	return ret;
+	}
+
+void CT_DataDrawTextExtendedParam::DoCmd_new()
+	{
+	DestroyData();
+	TRAPD(err, iDrawTextExtendedParam = new (ELeave) CGraphicsContext::TDrawTextExtendedParam());
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+void CT_DataDrawTextExtendedParam::DoCmd_destructor()
+	{
+	DestroyData();
+	CT_DataDrawTextParam::DoCmd_destructor();
+	}
+
+void CT_DataDrawTextExtendedParam::DoCmd_iParRightToLeft(const TDesC& aSection)
+	{
+	if ( !GetBoolFromConfig(aSection, KFldValue(), iDrawTextExtendedParam->iParRightToLeft) )
+		{
+		INFO_PRINTF2(_L("iParRightToLeft=%d"), iDrawTextExtendedParam->iParRightToLeft);
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/src/T_DataDrawTextParam.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,202 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataDrawTextParam
+*/
+
+//	User includes
+#include "T_DataDrawTextParam.h"
+#include "T_GraphicsUtil.h"
+
+/*@{*/
+///	Commands
+_LIT(KCmd_new,										"new");
+_LIT(KCmd_destructor,								"~");
+_LIT(KCmd_iDirection,								"iDirection");
+_LIT(KCmd_iCharJustNum,								"iCharJustNum");
+_LIT(KCmd_iCharJustExcess,							"iCharJustExcess");
+_LIT(KCmd_iWordJustNum,								"iWordJustNum");
+_LIT(KCmd_iWordJustExcess,							"iWordJustExcess");
+
+///	Parameters
+_LIT(KFldValue,										"value");
+
+///	Logging
+_LIT(KLogError,										"Error=%d");
+/*@}*/
+
+/**
+* Constructor. First phase construction
+*/
+CT_DataDrawTextParam::CT_DataDrawTextParam()
+:	CDataWrapperBase()
+,	iDrawTextParam(NULL)
+	{
+	}
+
+/**
+* Constructor. First phase construction
+*/
+CT_DataDrawTextParam::~CT_DataDrawTextParam()
+	{
+	DestroyData();
+	}
+
+void CT_DataDrawTextParam::DestroyData()
+	{
+	delete iDrawTextParam;
+	iDrawTextParam=NULL;
+	}
+
+TAny* CT_DataDrawTextParam::GetObject()
+	{
+	return iDrawTextParam;
+	}
+
+void CT_DataDrawTextParam::SetObjectL(TAny* aAny)
+	{
+	DestroyData();
+	iDrawTextParam=static_cast<CGraphicsContext::TDrawTextParam*>(aAny);
+	}
+
+void CT_DataDrawTextParam::DisownObjectL()
+	{
+	iDrawTextParam=NULL;
+	}
+
+CGraphicsContext::TDrawTextParam* CT_DataDrawTextParam::GetDrawTextParam() const
+	{
+	return iDrawTextParam;
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataDrawTextParam::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool	ret=ETrue;
+	if ( aCommand==KCmd_new )
+		{
+		DoCmd_new();
+		}
+	else if ( aCommand==KCmd_destructor )
+		{
+		DoCmd_destructor();
+		}
+	else if ( aCommand==KCmd_iDirection )
+		{
+		DoCmd_iDirection(aSection);
+		}
+	else if ( aCommand==KCmd_iCharJustNum )
+		{
+		DoCmd_iCharJustNum(aSection);
+		}
+	else if ( aCommand==KCmd_iCharJustExcess )
+		{
+		DoCmd_iCharJustExcess(aSection);
+		}
+	else if ( aCommand==KCmd_iWordJustNum )
+		{
+		DoCmd_iWordJustNum(aSection);
+		}
+	else if ( aCommand==KCmd_iWordJustExcess )
+		{
+		DoCmd_iWordJustExcess(aSection);
+		}
+	else
+		{
+		ret=EFalse;
+		}
+
+	return ret;
+	}
+
+void CT_DataDrawTextParam::DoCmd_new()
+	{
+	DestroyData();
+	TRAPD(err, iDrawTextParam = new (ELeave) CGraphicsContext::TDrawTextParam());
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+void CT_DataDrawTextParam::DoCmd_destructor()
+	{
+	DestroyData();
+	}
+
+void CT_DataDrawTextParam::DoCmd_iDirection(const TDesC& aSection)
+	{
+	CGraphicsContext::TDrawTextParam*	textParam=GetDrawTextParam();
+	TPtrC	deviceName;
+	if ( !CT_GraphicsUtil::ReadTextDirection(*this, aSection, KFldValue(), textParam->iDirection) )
+		{
+		INFO_PRINTF2(_L("iDirection=%d"), textParam->iDirection);
+		}
+	}
+
+void CT_DataDrawTextParam::DoCmd_iCharJustNum(const TDesC& aSection)
+	{
+	CGraphicsContext::TDrawTextParam*	textParam=GetDrawTextParam();
+	TPtrC	deviceName;
+	if ( !GetIntFromConfig(aSection, KFldValue(), textParam->iCharJustNum) )
+		{
+		INFO_PRINTF2(_L("iCharJustNum=%d"), textParam->iCharJustNum);
+		}
+	}
+
+void CT_DataDrawTextParam::DoCmd_iCharJustExcess(const TDesC& aSection)
+	{
+	CGraphicsContext::TDrawTextParam*	textParam=GetDrawTextParam();
+	TPtrC	deviceName;
+	if ( !GetIntFromConfig(aSection, KFldValue(), textParam->iCharJustExcess) )
+		{
+		INFO_PRINTF2(_L("iCharJustExcess=%d"), textParam->iCharJustExcess);
+		}
+	}
+
+void CT_DataDrawTextParam::DoCmd_iWordJustNum(const TDesC& aSection)
+	{
+	CGraphicsContext::TDrawTextParam*	textParam=GetDrawTextParam();
+	TPtrC	deviceName;
+	if ( !GetIntFromConfig(aSection, KFldValue(), textParam->iWordJustNum) )
+		{
+		INFO_PRINTF2(_L("iWordJustNum=%d"), textParam->iWordJustNum);
+		}
+	}
+
+void CT_DataDrawTextParam::DoCmd_iWordJustExcess(const TDesC& aSection)
+	{
+	CGraphicsContext::TDrawTextParam*	textParam=GetDrawTextParam();
+	TPtrC	deviceName;
+	if ( !GetIntFromConfig(aSection, KFldValue(), textParam->iWordJustExcess) )
+		{
+		INFO_PRINTF2(_L("iWordJustExcess=%d"), textParam->iWordJustExcess);
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/src/T_DataFont.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,721 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataFont
+*/
+
+//	User includes
+#include "T_DataFont.h"
+
+//	Epoc includes
+#include <gdi.h>
+
+/*@{*/
+///	Parameters
+_LIT(KText,									"text");
+_LIT(KWidthAvailable,						"width_available");
+_LIT(KCalculateExcess,						"calculate_excess");
+_LIT(KExpectedExcess,						"expected_excess");
+_LIT(KExpectedResult,						"expected_result");
+_LIT(KExpectedFont,							"expected_font");	
+_LIT(KCharCode,								"char_code");
+_LIT(KUid,									"uid");
+_LIT(KMeasureTextOutput,					"measure_text_output");
+_LIT(KMeasureTextInput,						"measure_text_input");
+
+///	Commands
+_LIT(KCmdFontCapitalAscent,					"FontCapitalAscent");
+_LIT(KCmdFontMaxAscent,						"FontMaxAscent");
+_LIT(KCmdFontStandardDescent,				"FontStandardDescent");
+_LIT(KCmdFontMaxDescent,					"FontMaxDescent");
+_LIT(KCmdFontLineGap,						"FontLineGap");
+_LIT(KCmdFontMaxHeight,						"FontMaxHeight");
+_LIT(KCmdTypeUid,							"TypeUid");
+_LIT(KCmdHeightInPixels,					"HeightInPixels");
+_LIT(KCmdAscentInPixels,					"AscentInPixels");
+_LIT(KCmdDescentInPixels,					"DescentInPixels");
+_LIT(KCmdCharWidthInPixels,					"CharWidthInPixels");
+_LIT(KCmdTextCount,							"TextCount");
+_LIT(KCmdMaxCharWidthInPixels,				"MaxCharWidthInPixels");
+_LIT(KCmdMaxNormalCharWidthInPixels,		"MaxNormalCharWidthInPixels");
+_LIT(KCmdFontSpecInTwips,					"FontSpecInTwips");
+_LIT(KCmdWidthZeroInPixels,					"WidthZeroInPixels");
+_LIT(KCmdBaselineOffsetInPixels,			"BaselineOffsetInPixels");
+_LIT(KCmdGetCharacterData,					"GetCharacterData");
+_LIT(KCmdMeasureText,						"MeasureText");
+_LIT(KCmdExtendedFunction,					"ExtendedFunction");
+_LIT(KCmdTextWidthInPixels,					"TextWidthInPixels");
+/*@}*/
+
+/**
+* Constructor. First phase construction
+*/
+CT_DataFont::CT_DataFont()
+:	CDataWrapperBase()
+	{
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataFont::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool ret=ETrue;
+
+	if (aCommand == KCmdFontCapitalAscent)
+		{
+		DoCmdFontCapitalAscent(aSection);
+		}
+	else if (aCommand == KCmdFontMaxAscent)
+		{
+		DoCmdFontMaxAscent(aSection);
+		}
+	else if (aCommand == KCmdFontStandardDescent)
+		{
+		DoCmdFontStandardDescent(aSection);
+		}
+	else if (aCommand == KCmdFontMaxDescent)
+		{
+		DoCmdFontMaxDescent(aSection);
+		}
+	else if (aCommand == KCmdFontLineGap)
+		{
+		DoCmdFontLineGap(aSection);
+		}
+	else if (aCommand == KCmdFontMaxHeight)
+		{
+		DoCmdFontMaxHeight(aSection);
+		}
+	else if (aCommand == KCmdTypeUid)
+		{
+		DoCmdTypeUid(aSection);
+		}
+	else if (aCommand == KCmdHeightInPixels)
+		{
+		DoCmdHeightInPixels(aSection);
+		}
+	else if (aCommand == KCmdAscentInPixels)
+		{
+		DoCmdAscentInPixels(aSection);
+		}
+	else if (aCommand == KCmdDescentInPixels)
+		{
+		DoCmdDescentInPixels(aSection);
+		}
+	else if (aCommand == KCmdCharWidthInPixels)
+		{
+		DoCmdCharWidthInPixels(aSection);
+		}
+	else if (aCommand == KCmdTextCount)
+		{
+		DoCmdTextCount(aSection);
+		}
+	else if (aCommand == KCmdMaxCharWidthInPixels)
+		{
+		DoCmdMaxCharWidthInPixels(aSection);
+		}
+	else if (aCommand == KCmdMaxNormalCharWidthInPixels)
+		{
+		DoCmdMaxNormalCharWidthInPixels(aSection);
+		}
+	else if (aCommand == KCmdFontSpecInTwips)
+		{
+		DoCmdFontSpecInTwips(aSection);
+		}
+	else if (aCommand == KCmdWidthZeroInPixels)
+		{
+		DoCmdWidthZeroInPixels(aSection);
+		}
+	else if (aCommand == KCmdBaselineOffsetInPixels)
+		{
+		DoCmdBaselineOffsetInPixels(aSection);
+		}
+	else if (aCommand == KCmdGetCharacterData)
+		{
+		DoCmdGetCharacterData(aSection);
+		}
+	else if (aCommand == KCmdMeasureText)
+		{
+		DoCmdMeasureTextL(aSection);
+		}
+	else if (aCommand == KCmdExtendedFunction)
+		{
+		DoCmdExtendedFunction(aSection);
+		}
+	else if (aCommand == KCmdTextWidthInPixels)
+		{
+		DoCmdTextWidthInPixels(aSection);
+		}
+	else
+		{
+		ret=EFalse;
+		}
+
+	return ret;
+	}
+
+
+////////////////// COMMANDS IMPLEMENTATION  ////////////////////////
+
+
+/** Calls CFont::TextCount() */
+void CT_DataFont::DoCmdTextCount(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFont::TextCount()"));
+	// get text from parameters
+	TPtrC	text;
+	if ( !GetStringFromConfig(aSection, KText(), text) )
+		{
+		ERR_PRINTF2(_L("No %S"), &KText());
+		SetBlockResult(EFail);
+		}
+
+	// get available width from parameters
+	TInt	widthAvailable = 0;
+	if(!GetIntFromConfig(aSection, KWidthAvailable(), widthAvailable))
+		{
+		ERR_PRINTF2(_L("No %S"), &KWidthAvailable());
+		SetBlockResult(EFail);
+		}
+
+	// get if to use version of TextCount() that calculates excess from parameters
+	TBool	calculateExcess = EFalse;
+	GetBoolFromConfig(aSection, KCalculateExcess(), calculateExcess);
+
+	// call TextCount()
+	TInt	result = KErrNone;
+	if ( calculateExcess )
+		{
+		TInt	excess = 0;
+		result = GetFont()->TextCount(text, widthAvailable, excess);
+
+		// get expected excess from parameters
+		TInt	expectedExcess = 0;
+		if ( GetIntFromConfig(aSection, KExpectedExcess(), expectedExcess) )
+			{
+			ERR_PRINTF1(_L("An expected excess should not be provided if calculate excess is set to false."));
+			SetBlockResult(EFail);
+			}
+		}
+	else
+		{
+		result = GetFont()->TextCount(text, widthAvailable);
+		}
+
+	// get expected result from parameters
+	TInt	expectedResult = 0;
+	if ( GetIntFromConfig(aSection, KExpectedResult(), expectedResult) )
+		{
+		if (result != expectedResult)
+			{
+			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Calls CFont::TextWidthInPixels() */
+void CT_DataFont::DoCmdTextWidthInPixels(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFont::TextWidthInPixels()"));
+	// get text from parameters
+	TPtrC	text;
+	if (!GetStringFromConfig(aSection, KText(), text))
+		{
+		ERR_PRINTF2(_L("No %S"), &KText());
+		SetBlockResult(EFail);
+		}
+
+	// call TextWidthInPixels()
+	TInt	result = GetFont()->TextWidthInPixels(text);
+
+	// get expected result from parameters
+	TInt	expectedResult = 0;
+	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
+		{
+		if (result != expectedResult)
+			{
+			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Calls CFont::CharWidthInPixels() */
+void CT_DataFont::DoCmdCharWidthInPixels(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFont::CharWidthInPixels()"));
+	// get character code from parameters
+	TInt	charCode = 0;
+	if(!GetIntFromConfig(aSection, KCharCode(), charCode))
+		{
+		ERR_PRINTF2(_L("No %S"), &KCharCode());
+		SetBlockResult(EFail);
+		}
+
+	// call CharWidthInPixels()
+	TInt	result = GetFont()->CharWidthInPixels(charCode);
+
+	// get expected result from parameters
+	TInt 	expectedResult = 0;
+	if ( GetIntFromConfig(aSection, KExpectedResult(), expectedResult) )
+		{
+		if (result != expectedResult)
+			{
+			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Calls CFont::FontCapitalAscent() */
+void CT_DataFont::DoCmdFontCapitalAscent(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFont::FontCapitalAscent()"));
+	// call FontCapitalAscent()
+	TInt	result = GetFont()->FontCapitalAscent();
+
+	// get expected result from parameters
+	TInt	expectedResult = 0;
+	if ( GetIntFromConfig(aSection, KExpectedResult(), expectedResult) )
+		{
+		if (result != expectedResult)
+			{
+			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Calls CFont::FontMaxAscent() */
+void CT_DataFont::DoCmdFontMaxAscent(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFont::FontMaxAscent()"));
+	// call FontMaxAscent()
+	TInt	result = GetFont()->FontMaxAscent();
+
+	// get expected result from parameters
+	TInt	expectedResult = 0;
+	if ( GetIntFromConfig(aSection, KExpectedResult(), expectedResult) )
+		{
+		if (result != expectedResult)
+			{
+			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Calls CFont::FontStandardDescent() */
+void CT_DataFont::DoCmdFontStandardDescent(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFont::FontStandardDescent()"));
+	// call FontStandardDescent()
+	TInt	result = GetFont()->FontStandardDescent();
+
+	// get expected result from parameters
+	TInt	expectedResult = 0;
+	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
+		{
+		if (result != expectedResult)
+			{
+			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Calls CFont::FontMaxDescent() */
+void CT_DataFont::DoCmdFontMaxDescent(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFont::FontMaxDescent()"));
+	// call FontMaxDescent()
+	TInt	result = GetFont()->FontMaxDescent();
+
+	// get expected result from parameters
+	TInt	expectedResult = 0;
+	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
+		{
+		if (result != expectedResult)
+			{
+			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Calls CFont::FontLineGap() */
+void CT_DataFont::DoCmdFontLineGap(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFont::FontLineGap()"));
+	// call FontLineGap()
+	TInt	result = GetFont()->FontLineGap();
+
+	// get expected result from parameters
+	TInt	expectedResult = 0;
+	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
+		{
+		if (result != expectedResult)
+			{
+			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Calls CFont::FontMaxHeight() */
+void CT_DataFont::DoCmdFontMaxHeight(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFont::FontMaxHeight()"));
+	// call FontMaxHeight()
+	TInt	result = GetFont()->FontMaxHeight();
+
+	// get expected result from parameters
+	TInt	expectedResult = 0;
+	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
+		{
+		if (result != expectedResult)
+			{
+			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Calls CFont::TypeUid() */
+void CT_DataFont::DoCmdTypeUid(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFont::TypeUid()"));
+	// call TypeUid()
+	TUid	result = GetFont()->TypeUid();
+
+	// get expected result from parameters
+	TInt	expectedResult = 0;
+	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
+		{
+		if (result != TUid::Uid(expectedResult))
+			{
+			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result.iUid);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Calls CFont::HeightInPixels() */
+void CT_DataFont::DoCmdHeightInPixels(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFont::HeightInPixels()"));
+	// call HeightInPixels()
+	TInt	result = GetFont()->HeightInPixels();
+
+	// get expected result from parameters
+	TInt	expectedResult = 0;
+	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
+		{
+		if (result != expectedResult)
+			{
+			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Calls CFont::AscentInPixels() */
+void CT_DataFont::DoCmdAscentInPixels(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFont::AscentInPixels()"));
+	// call AscentInPixels()
+	TInt	result = GetFont()->AscentInPixels();
+
+	// get expected result from parameters
+	TInt	expectedResult = 0;
+	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
+		{
+		if (result != expectedResult)
+			{
+			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Calls CFont::DescentInPixels() */
+void CT_DataFont::DoCmdDescentInPixels(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFont::DescentInPixels()"));
+	// call DescentInPixels()
+	TInt	result = GetFont()->DescentInPixels();
+
+	// get expected result from parameters
+	TInt	expectedResult = 0;
+	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
+		{
+		if (result != expectedResult)
+			{
+			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Calls CFont::MaxCharWidthInPixels() */
+void CT_DataFont::DoCmdMaxCharWidthInPixels(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFont::MaxCharWidthInPixels()"));
+	// call MaxCharWidthInPixels()
+	TInt	result = GetFont()->MaxCharWidthInPixels();
+
+	// get expected result from parameters
+	TInt	expectedResult = 0;
+	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
+		{
+		if (result != expectedResult)
+			{
+			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Calls CFont::MaxNormalCharWidthInPixels() */
+void CT_DataFont::DoCmdMaxNormalCharWidthInPixels(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFont::MaxNormalCharWidthInPixels()"));
+	// call MaxNormalCharWidthInPixels()
+	TInt	result = GetFont()->MaxNormalCharWidthInPixels();
+
+	// get expected result from parameters
+	TInt	expectedResult = 0;
+	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
+		{
+		if (result != expectedResult)
+			{
+			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Calls CFont::FontSpecInTwips() */
+void CT_DataFont::DoCmdFontSpecInTwips(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFont::FontSpecInTwips()"));
+
+	// call FontSpecInTwips()
+	TFontSpec	fontSpec=GetFont()->FontSpecInTwips();
+	INFO_PRINTF3(_L("iName	%S, iHeight    %d"), &fontSpec.iTypeface.iName,fontSpec.iHeight);
+	
+	TFontSpec expectedFontSpec;
+	if(GetFontSpecFromConfig(aSection, KExpectedFont(), expectedFontSpec))
+		{
+		// just check font name
+		if( fontSpec.iTypeface.iName!=expectedFontSpec.iTypeface.iName)
+			{
+			ERR_PRINTF3(_L("The result is not as expected! expected font: %S, actual font: %S"),
+					&expectedFontSpec.iTypeface.iName, &fontSpec.iTypeface.iName);
+			SetError(-1);			
+			}
+		}
+	}
+
+
+/** Calls CFont::WidthZeroInPixels() */
+void CT_DataFont::DoCmdWidthZeroInPixels(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFont::WidthZeroInPixels()"));
+	// call WidthZeroInPixels()
+	TInt	result = GetFont()->WidthZeroInPixels();
+
+	// get expected result from parameters
+	TInt	expectedResult = 0;
+	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
+		{
+		if (result != expectedResult)
+			{
+			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Calls CFont::BaselineOffsetInPixels() */
+void CT_DataFont::DoCmdBaselineOffsetInPixels(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFont::BaselineOffsetInPixels()"));
+	// call BaselineOffsetInPixels()
+	TInt	result = GetFont()->BaselineOffsetInPixels();
+
+	// get expected result from parameters
+	TInt	expectedResult = 0;
+	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
+		{
+		if (result != expectedResult)
+			{
+			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Calls CFont::GetCharacterData() */
+void CT_DataFont::DoCmdGetCharacterData(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFont::GetCharacterData()"));
+	// get character code from parameters
+	TInt	charCode = 0;
+	if(!GetIntFromConfig(aSection, KCharCode(), charCode))
+		{
+		ERR_PRINTF2(_L("No %S"), &KCharCode());
+		SetBlockResult(EFail);
+		}
+
+	// call GetCharacterData()
+	TUint								code = charCode;
+	TOpenFontCharMetrics				metrics;
+	const TUint8*						bitmapPointer;
+	TSize								bitmapSize;
+	CFont::TCharacterDataAvailability	ret=GetFont()->GetCharacterData(code, metrics, bitmapPointer, bitmapSize);
+	INFO_PRINTF2(_L("CharacterDataAvailability %d"), ret);
+	INFO_PRINTF2(_L("Height                    %d"), bitmapSize.iHeight);
+	INFO_PRINTF2(_L("Width                     %d"), bitmapSize.iWidth);
+	}
+
+
+/** Calls CFont::ExtendedFunction() */
+void CT_DataFont::DoCmdExtendedFunction(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFont::ExtendedFunction()"));
+	// get function UID from parameters
+	TInt	uidInt = 0;
+	if(!GetHexFromConfig(aSection, KUid(), uidInt))
+		{
+		ERR_PRINTF2(_L("No %S"), &KUid());
+		SetBlockResult(EFail);
+		}
+
+	// call ExtendedFunction()
+	TInt	result=GetFont()->ExtendedFunction(TUid::Uid(uidInt), NULL);
+
+	// get expected result from parameters
+	TInt	expectedResult = 0;
+	if ( GetIntFromConfig(aSection, KExpectedResult(), expectedResult) )
+		{
+		if (result != expectedResult)
+			{
+			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Calls CFbsFont::MeasureText() */
+void CT_DataFont::DoCmdMeasureTextL(const TDesC& aSection)
+	{
+	CFont::TMeasureTextInput*	measureTextInputPointer = NULL;
+	GetMeasureTextInputL(*this, KMeasureTextInput(), aSection, measureTextInputPointer);
+	if ( measureTextInputPointer==NULL )
+		{
+		INFO_PRINTF1(_L("measureTextInputPointer NULL"));
+		}
+
+	CFont::TMeasureTextOutput*	measureTextOutputPointer = NULL;
+	GetMeasureTextOutputL(*this, KMeasureTextOutput(), aSection, measureTextOutputPointer);
+	if ( measureTextOutputPointer==NULL )
+		{
+		INFO_PRINTF1(_L("measureTextOutputPointer NULL"));
+		}
+
+	// get text from parameters
+	TPtrC	text;
+	if (!GetStringFromConfig(aSection, KText(), text))
+		{
+		ERR_PRINTF2(_L("No %S"), &KText());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		TInt	width=GetFont()->MeasureText(text, measureTextInputPointer, measureTextOutputPointer);
+		INFO_PRINTF2(_L("MeasureText %d"), width);
+		}
+	}
+
+
+////////////////// UTIL METHODS ////////////////////////
+
+
+/**
+* Utility method that fetches TMeasureTextInput pointer by command parameter name from INI-file.
+*/
+TBool CT_DataFont::GetMeasureTextInputL(CDataWrapper& aDataWrapper, const TDesC& aParameterName, const TDesC& aSection, CFont::TMeasureTextInput*& aMeasureTextInput)
+	{
+	// get MeasureTextInputData object from parameters
+	TPtrC	measureTextInputDataObjectName;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSection, aParameterName, measureTextInputDataObjectName);
+	if ( ret )
+		{
+		// check that the data object was found
+		aMeasureTextInput=static_cast<CFont::TMeasureTextInput*>(aDataWrapper.GetDataObjectL(measureTextInputDataObjectName));
+		}
+
+	return ret;
+	}
+
+
+/**
+* Utility method that fetches TMeasureTextOutput pointer by command parameter name from INI-file.
+*/
+TBool CT_DataFont::GetMeasureTextOutputL(CDataWrapper& aDataWrapper, const TDesC& aParameterName, const TDesC& aSection, CFont::TMeasureTextOutput*& aMeasureTextOutput)
+	{
+	// get MeasureTextOutputData object from parameters
+	TPtrC	measureTextOutputDataObjectName;
+	TBool	ret=aDataWrapper.GetStringFromConfig(aSection, aParameterName, measureTextOutputDataObjectName);
+	if ( ret )
+		{
+		// check that the data object was found
+		aMeasureTextOutput=static_cast<CFont::TMeasureTextOutput*>(aDataWrapper.GetDataObjectL(measureTextOutputDataObjectName));
+		}
+
+	return ret;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/src/T_DataGraphicsContext.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1463 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataGraphicsContext
+*/
+
+//	User includes
+#include "T_DataGraphicsContext.h"
+#include "T_GraphicsUtil.h"
+
+/*@{*/
+///	Commands
+_LIT(KCmdCancelClippingRect,						"CancelClippingRect");
+_LIT(KCmdCancelClippingRegion,						"CancelClippingRegion");
+_LIT(KCmdDevice,									"Device");
+_LIT(KCmdDiscardBrushPattern,						"DiscardBrushPattern");
+_LIT(KCmdDiscardFont,								"DiscardFont");
+_LIT(KCmdDrawArc,									"DrawArc");
+_LIT(KCmdDrawBitmap,								"DrawBitmap");
+_LIT(KCmdDrawBitmapMasked,							"DrawBitmapMasked");
+_LIT(KCmdDrawEllipse,								"DrawEllipse");
+_LIT(KCmdDrawLine,									"DrawLine");
+_LIT(KCmdDrawLineBy,								"DrawLineBy");
+_LIT(KCmdDrawLineTo,								"DrawLineTo");
+_LIT(KCmdDrawPie,									"DrawPie");
+_LIT(KCmdDrawPolygon,								"DrawPolygon");
+_LIT(KCmdDrawPolyLine,								"DrawPolyLine");
+_LIT(KCmdDrawRect,									"DrawRect");
+_LIT(KCmdDrawRoundRect,								"DrawRoundRect");
+_LIT(KCmdDrawText,									"DrawText");
+_LIT(KCmdDrawTextExtended,							"DrawTextExtended");
+_LIT(KCmdDrawTextVertical,							"DrawTextVertical");
+_LIT(KCmdGetShadowColor,							"GetShadowColor");
+_LIT(KCmdGetUnderlineMetrics,						"GetUnderlineMetrics");
+_LIT(KCmdJustificationInPixels,						"JustificationInPixels");
+_LIT(KCmdMapColors,									"MapColors");
+_LIT(KCmdMoveBy,									"MoveBy");
+_LIT(KCmdMoveTo,									"MoveTo");
+_LIT(KCmdPlot,										"Plot");
+_LIT(KCmdReserved,									"Reserved");
+_LIT(KCmdReset,										"Reset");
+_LIT(KCmdSetBrushColor,								"SetBrushColor");
+_LIT(KCmdSetBrushOrigin,							"SetBrushOrigin");
+_LIT(KCmdSetBrushStyle,								"SetBrushStyle");
+_LIT(KCmdSetClippingRegion,							"SetClippingRegion");
+_LIT(KCmdSetCharJustification,						"SetCharJustification");
+_LIT(KCmdSetClippingRect,							"SetClippingRect");
+_LIT(KCmdSetDrawMode,								"SetDrawMode");
+_LIT(KCmdSetOrigin,									"SetOrigin");
+_LIT(KCmdSetPenColor,								"SetPenColor");
+_LIT(KCmdSetPenSize,								"SetPenSize");
+_LIT(KCmdSetPenStyle,								"SetPenStyle");
+_LIT(KCmdSetShadowColor,							"SetShadowColor");
+_LIT(KCmdSetStrikethroughStyle,						"SetStrikethroughStyle");
+_LIT(KCmdSetUnderlineStyle,							"SetUnderlineStyle");
+_LIT(KCmdSetWordJustification,						"SetWordJustification");
+_LIT(KCmdUseBrushPattern,							"UseBrushPattern");
+_LIT(KCmdUseFont,									"UseFont");
+
+///	Parameters
+_LIT(KFldBaselineOffset,							"baselineoffset");
+_LIT(KFldBitmap,									"bitmap");
+_LIT(KFldBottom,									"bottom");
+_LIT(KFldBrushStyle,								"brushstyle");
+_LIT(KFldColor,										"color");
+_LIT(KFldDestRect,									"destrect");
+_LIT(KFldDevice,									"device");
+_LIT(KFldDrawMode,									"drawmode");
+_LIT(KFldExcessPixels,								"excessPixels");
+_LIT(KFldExcessWidth,								"excesswidth");
+_LIT(KFldExpected,									"expected");
+_LIT(KFldFillRule,									"fillrule");
+_LIT(KFldFirstUnit,									"firstUnit");
+_LIT(KFldFont,										"font");
+_LIT(KFldFontStrikethrough,							"fontstrikethrough");
+_LIT(KFldFontUnderline,								"fontunderline");
+_LIT(KFldEnd,										"end");
+_LIT(KFldInvertMask,								"invertmask");
+_LIT(KFldLeftMargin,								"leftmargin");
+_LIT(KFldMapForwards,								"mapforwards");
+_LIT(KFldMaskBitmap,								"maskbitmap");
+_LIT(KFldNumChars,									"numchars");
+_LIT(KFldNumColors,									"numcolors");
+_LIT(KFldNumGaps,									"numgaps");
+_LIT(KFldNumPoints,									"numpoints");
+_LIT(KFldNumUnits,									"numunits");
+_LIT(KFldPenStyle,									"penstyle");
+_LIT(KFldPoint,										"point");
+_LIT(KFldPoint1,									"point1");
+_LIT(KFldPoint2,									"point2");
+_LIT(KFldPointList,									"pointlist");
+_LIT(KFldRect,										"rect");
+_LIT(KFldRegion,									"region");
+_LIT(KFldRgb,										"rgb");
+_LIT(KFldRgbList,									"rgblist");
+_LIT(KFldSourceRect,								"sourcerect");
+_LIT(KFldSize,										"size");
+_LIT(KFldStart,										"start");
+_LIT(KFldText,										"text");
+_LIT(KFldTextAlign,									"textalign");
+_LIT(KFldTextExtendedParam,							"textextendedparam");
+_LIT(KFldTop,										"top");
+_LIT(KFldTopLeft,									"topleft");
+_LIT(KFldTotalUnits,								"totalUnits");
+_LIT(KFldUp,										"up");
+_LIT(KFldWsBitmap,									"wsbitmap");
+
+///	Logging
+_LIT(KLogColor,										"Color Red=%d Green=%d Blue=%d Alpha=%d");
+_LIT(KLogError,										"Error=%d");
+_LIT(KLogMetrics,									"Top=%d Bottom=%d");
+_LIT(KLogMissingParameter,							"Missing parameter '%S'");
+_LIT(KLogNotExpectedValue,							"Not expected value");
+/*@}*/
+
+/**
+* Constructor. First phase construction
+*/
+CT_DataGraphicsContext::CT_DataGraphicsContext()
+:	CDataWrapperBase()
+	{
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataGraphicsContext::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool	ret=ETrue;
+	if ( aCommand==KCmdCancelClippingRect )
+		{
+		DoCmdCancelClippingRect();
+		}
+	else if ( aCommand==KCmdCancelClippingRegion )
+		{
+		DoCmdCancelClippingRegion();
+		}
+	else if ( aCommand==KCmdDevice )
+		{
+		DoCmdDeviceL(aSection);
+		}
+	else if ( aCommand==KCmdDiscardBrushPattern )
+		{
+		DoCmdDiscardBrushPattern();
+		}
+	else if ( aCommand==KCmdDiscardFont )
+		{
+		DoCmdDiscardFont();
+		}
+	else if ( aCommand==KCmdDrawArc )
+		{
+		DoCmdDrawArc(aSection);
+		}
+	else if ( aCommand==KCmdDrawBitmap )
+		{
+		DoCmdDrawBitmapL(aSection);
+		}
+	else if ( aCommand==KCmdDrawBitmapMasked )
+		{
+		DoCmdDrawBitmapMaskedL(aSection);
+		}
+	else if ( aCommand==KCmdDrawEllipse )
+		{
+		DoCmdDrawEllipse(aSection);
+		}
+	else if ( aCommand==KCmdDrawLine )
+		{
+		DoCmdDrawLine(aSection);
+		}
+	else if ( aCommand==KCmdDrawLineBy )
+		{
+		DoCmdDrawLineBy(aSection);
+		}
+	else if ( aCommand==KCmdDrawLineTo )
+		{
+		DoCmdDrawLineTo(aSection);
+		}
+	else if ( aCommand==KCmdDrawPie )
+		{
+		DoCmdDrawPie(aSection);
+		}
+	else if ( aCommand==KCmdDrawPolygon )
+		{
+		DoCmdDrawPolygonL(aSection);
+		}
+	else if ( aCommand==KCmdDrawPolyLine )
+		{
+		DoCmdDrawPolyLineL(aSection);
+		}
+	else if ( aCommand==KCmdDrawRect )
+		{
+		DoCmdDrawRect(aSection);
+		}
+	else if ( aCommand==KCmdDrawRoundRect )
+		{
+		DoCmdDrawRoundRect(aSection);
+		}
+	else if ( aCommand==KCmdDrawText )
+		{
+		DoCmdDrawText(aSection);
+		}
+	else if ( aCommand==KCmdDrawTextExtended )
+		{
+		DoCmdDrawTextExtendedL(aSection);
+		}
+	else if ( aCommand==KCmdDrawTextVertical )
+		{
+		DoCmdDrawTextVertical(aSection);
+		}
+	else if ( aCommand==KCmdGetShadowColor )
+		{
+		DoCmdGetShadowColor(aSection);
+		}
+	else if ( aCommand==KCmdGetUnderlineMetrics )
+		{
+		DoCmdGetUnderlineMetrics(aSection);
+		}
+	else if ( aCommand==KCmdJustificationInPixels )
+		{
+		DoCmdJustificationInPixels(aSection);
+		}
+	else if ( aCommand==KCmdMapColors )
+		{
+		DoCmdMapColorsL(aSection);
+		}
+	else if ( aCommand==KCmdMoveBy )
+		{
+		DoCmdMoveBy(aSection);
+		}
+	else if ( aCommand==KCmdMoveTo )
+		{
+		DoCmdMoveTo(aSection);
+		}
+	else if ( aCommand==KCmdPlot )
+		{
+		DoCmdPlot(aSection);
+		}
+	else if ( aCommand==KCmdReserved )
+		{
+		DoCmdReserved();
+		}
+	else if ( aCommand==KCmdReset )
+		{
+		DoCmdReset();
+		}
+	else if ( aCommand==KCmdSetBrushColor )
+		{
+		DoCmdSetBrushColor(aSection);
+		}
+	else if ( aCommand==KCmdSetBrushOrigin )
+		{
+		DoCmdSetBrushOrigin(aSection);
+		}
+	else if ( aCommand==KCmdSetBrushStyle )
+		{
+		DoCmdSetBrushStyle(aSection);
+		}
+	else if ( aCommand==KCmdSetClippingRegion )
+		{
+		DoCmdSetClippingRegion(aSection);
+		}
+	else if ( aCommand==KCmdSetCharJustification )
+		{
+		DoCmdSetCharJustification(aSection);
+		}
+	else if ( aCommand==KCmdSetClippingRect )
+		{
+		DoCmdSetClippingRect(aSection);
+		}
+	else if ( aCommand==KCmdSetDrawMode )
+		{
+		DoCmdSetDrawMode(aSection);
+		}
+	else if ( aCommand==KCmdSetOrigin )
+		{
+		DoCmdSetOrigin(aSection);
+		}
+	else if ( aCommand==KCmdSetPenColor )
+		{
+		DoCmdSetPenColor(aSection);
+		}
+	else if ( aCommand==KCmdSetPenSize )
+		{
+		DoCmdSetPenSize(aSection);
+		}
+	else if ( aCommand==KCmdSetPenStyle )
+		{
+		DoCmdSetPenStyle(aSection);
+		}
+	else if ( aCommand==KCmdSetShadowColor )
+		{
+		DoCmdSetShadowColor(aSection);
+		}
+	else if ( aCommand==KCmdSetStrikethroughStyle )
+		{
+		DoCmdSetStrikethroughStyle(aSection);
+		}
+	else if ( aCommand==KCmdSetUnderlineStyle )
+		{
+		DoCmdSetUnderlineStyle(aSection);
+		}
+	else if ( aCommand==KCmdSetWordJustification )
+		{
+		DoCmdSetWordJustification(aSection);
+		}
+	else if ( aCommand==KCmdUseBrushPattern )
+		{
+		DoCmdUseBrushPatternL(aSection);
+		}
+	else if ( aCommand==KCmdUseFont )
+		{
+		DoCmdUseFontL(aSection);
+		}
+	else
+		{
+		ret=EFalse;
+		}
+
+	return ret;
+	}
+
+void CT_DataGraphicsContext::DoCmdCancelClippingRect()
+	{
+	INFO_PRINTF1(_L("execute CancelClippingRect()"));
+	GetGraphicsContext()->CancelClippingRect();
+	}
+
+void CT_DataGraphicsContext::DoCmdCancelClippingRegion()
+	{
+	INFO_PRINTF1(_L("execute CancelClippingRegion()"));
+	GetGraphicsContext()->CancelClippingRegion();
+	}
+
+void CT_DataGraphicsContext::DoCmdDeviceL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("execute Device()"));
+	CGraphicsDevice*	device = GetGraphicsContext()->Device();
+	TPtrC				deviceName;
+	if ( GetStringFromConfig(aSection, KFldDevice(), deviceName) )
+		{
+		// check that the data object was found
+		CDataWrapper*	dataWrapper=GetDataWrapperL(deviceName);
+		dataWrapper->SetObjectL(device);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdDiscardBrushPattern()
+	{
+	INFO_PRINTF1(_L("execute DiscardBrushPattern()"));
+	GetGraphicsContext()->DiscardBrushPattern();
+	}
+
+void CT_DataGraphicsContext::DoCmdDiscardFont()
+	{
+	INFO_PRINTF1(_L("execute DiscardFont()"));
+	GetGraphicsContext()->DiscardFont();
+	}
+
+void CT_DataGraphicsContext::DoCmdDrawArc(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TRect	datRect;
+	if ( !GetRectFromConfig(aSection, KFldRect, datRect) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldRect());
+		SetBlockResult(EFail);
+		}
+
+	TPoint	datStart;
+	if ( !GetPointFromConfig(aSection, KFldStart, datStart) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldStart());
+		SetBlockResult(EFail);
+		}
+
+	TPoint	datEnd;
+	if ( !GetPointFromConfig(aSection, KFldEnd, datEnd) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldEnd());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		INFO_PRINTF1(_L("execute DrawArc(TRect, TPoint, TPoint)"));
+		GetGraphicsContext()->DrawArc(datRect, datStart, datEnd);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdDrawBitmapL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	CFbsBitmap*	bitmap=NULL;
+	if ( !CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFldBitmap, bitmap) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldBitmap());
+		SetBlockResult(EFail);
+		}
+
+	TPoint	datTopLeft;
+	if ( GetPointFromConfig(aSection, KFldTopLeft, datTopLeft) )
+		{
+		if ( dataOk )
+			{
+			// Execute command and log parameters
+			INFO_PRINTF1(_L("execute DrawBitmap(TPoint, CFbsBitmap*)"));
+			GetGraphicsContext()->DrawBitmap(datTopLeft, bitmap);
+			}
+		}
+	else
+		{
+		TRect	datDestRect;
+		if ( !GetRectFromConfig(aSection, KFldDestRect, datDestRect) )
+			{
+			dataOk=EFalse;
+			ERR_PRINTF2(KLogMissingParameter, &KFldDestRect());
+			SetBlockResult(EFail);
+			}
+
+		TRect	datSourceRect;
+		if ( GetRectFromConfig(aSection, KFldSourceRect, datSourceRect) )
+			{
+			if ( dataOk )
+				{
+				// Execute command and log parameters
+				INFO_PRINTF1(_L("execute DrawBitmap(TRect, CFbsBitmap*, TRect)"));
+				GetGraphicsContext()->DrawBitmap(datDestRect, bitmap, datSourceRect);
+				}
+			}
+		else
+			{
+			if ( dataOk )
+				{
+				// Execute command and log parameters
+				INFO_PRINTF1(_L("execute DrawBitmap(TRect, CFbsBitmap*)"));
+				GetGraphicsContext()->DrawBitmap(datDestRect, bitmap);
+				}
+			}
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdDrawBitmapMaskedL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TRect	datDestRect;
+	if ( !GetRectFromConfig(aSection, KFldDestRect, datDestRect) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldDestRect());
+		SetBlockResult(EFail);
+		}
+
+	TRect	datSourceRect;
+	if ( !GetRectFromConfig(aSection, KFldSourceRect, datSourceRect) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldSourceRect());
+		SetBlockResult(EFail);
+		}
+
+	TBool	datInvertMask;
+	if ( !GetBoolFromConfig(aSection, KFldInvertMask, datInvertMask) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldInvertMask());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		CWsBitmap*	wsBitmap = NULL;
+		if ( CT_GraphicsUtil::GetWsBitmapL(*this, aSection, KFldWsBitmap, wsBitmap) )
+			{
+			CWsBitmap*	mask=NULL;
+			CT_GraphicsUtil::GetWsBitmapL(*this, aSection, KFldMaskBitmap, mask);
+
+			// Execute command and log parameters
+			INFO_PRINTF1(_L("execute DrawBitmapMasked(TRect, CWsBitmap*, TRect, CWsBitmap*, TBool)"));
+			GetGraphicsContext()->DrawBitmapMasked(datDestRect, wsBitmap, datSourceRect, mask, datInvertMask);
+			}
+		else
+			{
+			CFbsBitmap*	fbsBitmap = NULL;
+			if ( CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFldBitmap, fbsBitmap) )
+				{
+				CFbsBitmap*	mask=NULL;
+				CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFldMaskBitmap, mask);
+
+				// Execute command and log parameters
+				INFO_PRINTF1(_L("execute DrawBitmapMasked(TRect, CFbsBitmap*, TRect, CFbsBitmap*, TBool)"));
+				GetGraphicsContext()->DrawBitmapMasked(datDestRect, fbsBitmap, datSourceRect, mask, datInvertMask);
+				}
+			else
+				{
+				ERR_PRINTF2(KLogMissingParameter, &KFldWsBitmap());
+				ERR_PRINTF2(KLogMissingParameter, &KFldBitmap());
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdDrawEllipse(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TRect	datRect;
+	if ( !GetRectFromConfig(aSection, KFldRect, datRect) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldRect());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute DrawEllipse(TRect)"));
+		GetGraphicsContext()->DrawEllipse(datRect);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdDrawLine(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TPoint	datPoint1;
+	if ( !GetPointFromConfig(aSection, KFldPoint1, datPoint1) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldPoint1());
+		SetBlockResult(EFail);
+		}
+
+	TPoint	datPoint2;
+	if ( !GetPointFromConfig(aSection, KFldPoint2, datPoint2) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldPoint2());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute DrawLine(TPoint, TPoint)"));
+		GetGraphicsContext()->DrawLine(datPoint1, datPoint2);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdDrawLineBy(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TPoint	datPoint;
+	if ( !GetPointFromConfig(aSection, KFldPoint, datPoint) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldPoint());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute DrawLineBy(TPoint)"));
+		GetGraphicsContext()->DrawLineBy(datPoint);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdDrawLineTo(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TPoint	datPoint;
+	if ( !GetPointFromConfig(aSection, KFldPoint, datPoint) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldPoint());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute DrawLineTo(TPoint)"));
+		GetGraphicsContext()->DrawLineTo(datPoint);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdDrawPie(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TRect	datRect;
+	if ( !GetRectFromConfig(aSection, KFldRect, datRect) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldRect());
+		SetBlockResult(EFail);
+		}
+
+	TPoint	datStart;
+	if ( !GetPointFromConfig(aSection, KFldStart, datStart) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldStart());
+		SetBlockResult(EFail);
+		}
+
+	TPoint	datEnd;
+	if ( !GetPointFromConfig(aSection, KFldEnd, datEnd) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldEnd());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute DrawPie(TRect, TPoint, TPoint)"));
+		GetGraphicsContext()->DrawPie(datRect, datStart, datEnd);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdDrawPolygonL(const TDesC& aSection)
+	{
+	TInt	err=KErrNone;
+
+	// Get test data for command input parameter(s)
+	CGraphicsContext::TFillRule	datFillRule=CGraphicsContext::EAlternate;
+	CT_GraphicsUtil::ReadFillRule(*this, aSection, KFldFillRule, datFillRule);
+
+	TInt	datNumPoints;
+	if ( GetIntFromConfig(aSection, KFldNumPoints, datNumPoints) )
+		{
+		TPoint*	points=new (ELeave) TPoint[datNumPoints];
+		CleanupArrayDeletePushL(points);
+
+		if ( !GetPointListFromConfig(aSection, KFldPointList, datNumPoints, points) )
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KFldPointList());
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			// Execute command and log parameters
+			INFO_PRINTF1(_L("execute DrawPolygon(TPoint*, TInt, TFillRule)"));
+			err=GetGraphicsContext()->DrawPolygon(points, datNumPoints, datFillRule);
+			}
+		CleanupStack::PopAndDestroy(points);
+		}
+	else
+		{
+		CArrayFix<TPoint>*	points=new (ELeave) CArrayFixFlat<TPoint>(1);
+		CleanupStack::PushL(points);
+		TBool	hasPointList=GetPointListFromConfigL(aSection, KFldPointList, *points);
+
+		if ( !hasPointList )
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KFldPointList());
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			// Execute command and log parameters
+			INFO_PRINTF1(_L("execute DrawPolygon(CArrayFix<TPoint>*, TFillRule)"));
+			err=GetGraphicsContext()->DrawPolygon(points, datFillRule);
+			}
+		CleanupStack::PopAndDestroy(points);
+		}
+
+	// Check the command return code, if !=KErrNone then stop this command
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdDrawPolyLineL(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TInt	numPoints;
+	if ( GetIntFromConfig(aSection, KFldNumPoints, numPoints) )
+		{
+		TPoint*	points=new (ELeave) TPoint[numPoints];
+		CleanupArrayDeletePushL(points);
+
+		if ( !GetPointListFromConfig(aSection, KFldPointList, numPoints, points) )
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KFldPointList());
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			// Execute command and log parameters
+			INFO_PRINTF1(_L("execute DrawPolyLine(TPoint*, TInt)"));
+			GetGraphicsContext()->DrawPolyLine(points, numPoints);
+			}
+		CleanupStack::PopAndDestroy(points);
+		}
+	else
+		{
+		CArrayFix<TPoint>*	points=new (ELeave) CArrayFixFlat<TPoint>(1);
+		CleanupStack::PushL(points);
+		TBool	hasPointList=GetPointListFromConfigL(aSection, KFldPointList, *points);
+
+		if ( !hasPointList )
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KFldPointList());
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			// Execute command and log parameters
+			INFO_PRINTF1(_L("execute DrawPolyLine(CArrayFix<TPoint>*)"));
+			GetGraphicsContext()->DrawPolyLine(points);
+			}
+		CleanupStack::PopAndDestroy(points);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdDrawRect(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TRect	rect;
+	if ( !GetRectFromConfig(aSection, KFldRect, rect) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldRect());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute DrawRect(TRect)"));
+		GetGraphicsContext()->DrawRect(rect);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdDrawRoundRect(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TRect	rect;
+	if ( !GetRectFromConfig(aSection, KFldRect, rect) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldRect());
+		SetBlockResult(EFail);
+		}
+
+	TSize	size;
+	if ( !GetSizeFromConfig(aSection, KFldSize, size) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldSize());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute DrawRoundRect(TRect, TSize)"));
+		GetGraphicsContext()->DrawRoundRect(rect, size);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdDrawText(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+	TPtrC	text;
+	if( !GetStringFromConfig(aSection, KFldText(), text) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(_L("Missing parameter %S"), &KFldText());
+		SetBlockResult(EFail);
+		}
+
+	TPoint	point;
+	if(	GetPointFromConfig(aSection, KFldPoint(), point))
+		{
+		if ( dataOk )
+			{
+			// Execute command and log parameters
+			INFO_PRINTF1(_L("execute DrawText(const TDesC&, const TPoint &)"));
+			GetGraphicsContext()->DrawText(text, point);
+			}
+		}
+	else
+		{
+		TRect	rect;
+		if ( GetRectFromConfig(aSection, KFldRect(), rect) )
+			{
+			TInt	baselineOffset=0;
+			if ( !GetIntFromConfig(aSection, KFldBaselineOffset(), baselineOffset))
+				{
+				dataOk=EFalse;
+				ERR_PRINTF2(_L("Missing parameter %S"), &KFldBaselineOffset());
+				SetBlockResult(EFail);
+				}
+
+			CGraphicsContext::TTextAlign	textAlign=CGraphicsContext::ELeft;
+			CT_GraphicsUtil::ReadTextAlign(*this, aSection, KFldTextAlign, textAlign);
+
+			TInt	leftMargin=0;
+			GetIntFromConfig(aSection, KFldLeftMargin(), leftMargin);
+			if( dataOk )
+				{
+				// Execute command and log parameters
+				INFO_PRINTF1(_L("execute DrawText(const TDesC&, const TRect&, TInt, TTextAlign, TInt)"));
+				GetGraphicsContext()->DrawText(text, rect, baselineOffset, textAlign, leftMargin);
+				}
+			}
+		else
+			{
+			dataOk=EFalse;
+			ERR_PRINTF2(_L("Missing parameter %S"), &KFldRect());
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdDrawTextExtendedL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+	TPtrC	text;
+	if( !GetStringFromConfig(aSection, KFldText(), text) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(_L("Missing parameter %S"), &KFldText());
+		SetBlockResult(EFail);
+		}
+
+	TPoint	point;
+	if(	!GetPointFromConfig(aSection, KFldPoint(), point))
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(_L("Missing parameter %S"), &KFldPoint());
+		SetBlockResult(EFail);
+		}
+
+	CGraphicsContext::TDrawTextExtendedParam*	drawTextExtendedParam=NULL;
+	if ( !CT_GraphicsUtil::GetDrawTextExtendedParamL(*this, aSection, KFldTextExtendedParam(), drawTextExtendedParam) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(_L("Missing parameter %S"), &KFldTextExtendedParam());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		INFO_PRINTF1(_L("execute DrawTextExtended(const TDesC&, TPoint, CGraphicsContext::TDrawTextExtendedParam)"));
+		TInt	err=GetGraphicsContext()->DrawTextExtended(text, point, *drawTextExtendedParam);
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdDrawTextVertical(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+	TPtrC	text;
+	if( !GetStringFromConfig(aSection, KFldText(), text) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(_L("Missing parameter %S"), &KFldText());
+		SetBlockResult(EFail);
+		}
+
+	TBool	up=EFalse;
+	if(	!GetBoolFromConfig(aSection, KFldUp(), up))
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(_L("Missing parameter %S"), &KFldUp());
+		SetBlockResult(EFail);
+		}
+
+	TPoint	point;
+	if(	GetPointFromConfig(aSection, KFldPoint(), point))
+		{
+		if ( dataOk )
+			{
+			// Execute command and log parameters
+			INFO_PRINTF1(_L("execute DrawTextVertical(const TDesC&, const TPoint &, TBool)"));
+			GetGraphicsContext()->DrawTextVertical(text, point, up);
+			}
+		}
+	else
+		{
+		// Another overload DrawTextVertical function
+		TRect	rect;
+		if(	!GetRectFromConfig(aSection, KFldRect(), rect) )
+			{
+			dataOk=EFalse;
+			ERR_PRINTF2(_L("Missing parameter %S"), &KFldRect());
+			SetBlockResult(EFail);
+			}
+
+		TInt	baselineOffset=0;
+		if ( !GetIntFromConfig(aSection, KFldBaselineOffset(), baselineOffset))
+			{
+			dataOk=EFalse;
+			ERR_PRINTF2(_L("Missing parameter %S"), &KFldBaselineOffset());
+			SetBlockResult(EFail);
+			}
+
+		CGraphicsContext::TTextAlign	textAlign=CGraphicsContext::ELeft;
+		CT_GraphicsUtil::ReadTextAlign(*this, aSection, KFldTextAlign, textAlign);
+
+		TInt	leftMargin=0;
+		GetIntFromConfig(aSection, KFldLeftMargin(), leftMargin);
+
+		if ( dataOk )
+			{
+			INFO_PRINTF1(_L("execute DrawTextVertical(const TDesC&, const TRect&, TInt, TBool, TTextAlign, TInt)"));
+			GetGraphicsContext()->DrawTextVertical(text, rect, baselineOffset, up, textAlign, leftMargin);
+			}
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdGetShadowColor(const TDesC& aSection)
+	{
+	TRgb	color;
+	INFO_PRINTF1(_L("execute GetShadowColor(TRgb)"));
+	TInt	err=GetGraphicsContext()->GetShadowColor(color);
+	INFO_PRINTF5(KLogColor, color.Red(), color.Green(), color.Blue(), color.Alpha());
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	else
+		{
+		TRgb	expected;
+		if ( GetRgbFromConfig(aSection, KFldRgb(), expected) )
+			{
+			if ( color!=expected )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdGetUnderlineMetrics(const TDesC& aSection)
+	{
+	TInt	top;
+	TInt	bottom;
+	INFO_PRINTF1(_L("execute GetUnderlineMetrics(TInt, TInt)"));
+	TInt	err=GetGraphicsContext()->GetUnderlineMetrics(top, bottom);
+	INFO_PRINTF3(KLogMetrics, top, bottom);
+
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	else
+		{
+		TInt	expected;
+		if ( GetIntFromConfig(aSection, KFldTop(), expected) )
+			{
+			if ( top!=expected )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		if ( GetIntFromConfig(aSection, KFldBottom(), expected) )
+			{
+			if ( bottom!=expected )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdJustificationInPixels(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	TInt	excessPixels;
+	if(	!GetIntFromConfig(aSection, KFldExcessPixels(), excessPixels) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldExcessPixels());
+		SetBlockResult(EFail);
+		}
+
+	TInt	totalUnits;
+	if(	!GetIntFromConfig(aSection, KFldTotalUnits(), totalUnits) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldTotalUnits());
+		SetBlockResult(EFail);
+		}
+
+	TInt	firstUnit;
+	if(	!GetIntFromConfig(aSection, KFldFirstUnit(), firstUnit) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFirstUnit());
+		SetBlockResult(EFail);
+		}
+
+	TInt	numUnits;
+	if(	!GetIntFromConfig(aSection, KFldNumUnits(), numUnits) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldNumUnits());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		INFO_PRINTF1(_L("execute JustificationInPixels(TInt, TInt, TInt, TInt)"));
+		TInt	actual=GetGraphicsContext()->JustificationInPixels(excessPixels, totalUnits, firstUnit, numUnits);
+		INFO_PRINTF2(_L("JustificationInPixels=%d"), actual);
+
+		TInt	expected;
+		if ( GetIntFromConfig(aSection, KFldExpected(), expected) )
+			{
+			if ( actual!=expected )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdMapColorsL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	TRect	rect;
+	if(	!GetRectFromConfig(aSection, KFldRect(), rect) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldRect());
+		SetBlockResult(EFail);
+		}
+
+	TInt	numColors;
+	if ( !GetIntFromConfig(aSection, KFldNumColors, numColors) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldNumColors());
+		SetBlockResult(EFail);
+		}
+
+	TBool	mapForwards=EFalse;
+	if(	!GetBoolFromConfig(aSection, KFldMapForwards(), mapForwards))
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(_L("Missing parameter %S"), &KFldMapForwards());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		TRgb*	colors=new (ELeave) TRgb[numColors];
+		CleanupArrayDeletePushL(colors);
+
+		if ( !GetRgbListFromConfig(aSection, KFldRgbList, numColors, colors) )
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KFldRgbList());
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			// Execute command and log parameters
+			INFO_PRINTF1(_L("execute MapColors(const TRect&, const TRgb*, TInt, TBool)"));
+			GetGraphicsContext()->MapColors(rect, colors, numColors, mapForwards);
+			}
+		CleanupStack::PopAndDestroy(colors);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdMoveBy(const TDesC& aSection)
+	{
+	TPoint	point;
+	if ( !GetPointFromConfig(aSection, KFldPoint, point) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldPoint());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute MoveBy(TPoint)"));
+		GetGraphicsContext()->MoveBy(point);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdMoveTo(const TDesC& aSection)
+	{
+	TPoint	point;
+	if ( !GetPointFromConfig(aSection, KFldPoint, point) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldPoint());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute MoveTo(TPoint)"));
+		GetGraphicsContext()->MoveTo(point);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdPlot(const TDesC& aSection)
+	{
+	TPoint	point;
+	if ( !GetPointFromConfig(aSection, KFldPoint, point) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldPoint());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute Plot(TPoint)"));
+		GetGraphicsContext()->Plot(point);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdReserved()
+	{
+	INFO_PRINTF1(_L("execute Reserved()"));
+	GetGraphicsContext()->Reserved();
+	}
+
+void CT_DataGraphicsContext::DoCmdReset()
+	{
+	INFO_PRINTF1(_L("execute Reset()"));
+	GetGraphicsContext()->Reset();
+	}
+
+void CT_DataGraphicsContext::DoCmdSetBrushColor(const TDesC& aSection)
+	{
+	TRgb	rgb;
+	if(	!GetRgbFromConfig(aSection, KFldColor(), rgb))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldColor());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute SetBrushColor(TRgb)"));
+		GetGraphicsContext()->SetBrushColor(rgb);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdSetBrushOrigin(const TDesC& aSection)
+	{
+	TPoint	point;
+	if ( !GetPointFromConfig(aSection, KFldPoint, point) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldPoint());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetBrushOrigin(TPoint)"));
+		GetGraphicsContext()->SetBrushOrigin(point);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdSetBrushStyle(const TDesC& aSection)
+	{
+	CGraphicsContext::TBrushStyle	brushStyle;
+	if(	!CT_GraphicsUtil::ReadBrushStyle(*this, aSection, KFldBrushStyle(), brushStyle))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldBrushStyle());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetBrushStyle(CGraphicsContext::TBrushStyle)"));
+		GetGraphicsContext()->SetBrushStyle(brushStyle);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdSetClippingRegion(const TDesC& aSection)
+	{
+	RRegion	region;
+	CleanupClosePushL(region);
+	if ( !GetRegionFromConfig(aSection, KFldRegion, region) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldRegion());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetClippingRegion(TRegion)"));
+		TInt	err=GetGraphicsContext()->SetClippingRegion(region);
+
+		// Check the command return code, if !=KErrNone then stop this command
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		}
+	CleanupStack::PopAndDestroy(&region);
+	}
+
+void CT_DataGraphicsContext::DoCmdSetCharJustification(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	TInt	excessWidth=0;
+	if(	!GetIntFromConfig(aSection, KFldExcessWidth(), excessWidth) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldExcessWidth());
+		SetBlockResult(EFail);
+		}
+
+	TInt	numChars=0;
+	if(	!GetIntFromConfig(aSection, KFldNumChars(), numChars) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldNumChars());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		INFO_PRINTF1(_L("execute SetCharJustification(TInt, TInt)"));
+		GetGraphicsContext()->SetCharJustification(excessWidth, numChars);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdSetClippingRect(const TDesC& aSection)
+	{
+	TRect	rect;
+	if ( !GetRectFromConfig(aSection, KFldRect, rect) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldRect());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute SetClippingRect(TRect)"));
+		GetGraphicsContext()->SetClippingRect(rect);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdSetDrawMode(const TDesC& aSection)
+	{
+	CGraphicsContext::TDrawMode	drawMode;
+	if(	!CT_GraphicsUtil::ReadDrawMode(*this, aSection, KFldDrawMode(), drawMode) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldDrawMode());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute SetDrawMode(CGraphicsContext::TDrawMode)"));
+		GetGraphicsContext()->SetDrawMode(drawMode);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdSetOrigin(const TDesC& aSection)
+	{
+	TPoint	point;
+	if ( !GetPointFromConfig(aSection, KFldPoint, point) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldPoint());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetOrigin(TPoint)"));
+		GetGraphicsContext()->SetOrigin(point);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdSetPenColor(const TDesC& aSection)
+	{
+	TRgb	rgb;
+	if(	!GetRgbFromConfig(aSection, KFldColor(), rgb))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldColor());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute SetPenColor(TRgb)"));
+		GetGraphicsContext()->SetPenColor(rgb);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdSetPenSize(const TDesC& aSection)
+	{
+	TSize	size;
+	if(	!GetSizeFromConfig(aSection, KFldSize(), size))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldSize());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute SetPenSize(TSize)"));
+		GetGraphicsContext()->SetPenSize(size);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdSetPenStyle(const TDesC& aSection)
+	{
+	CGraphicsContext::TPenStyle	penStyle;
+	if(	!CT_GraphicsUtil::ReadPenStyle(*this, aSection, KFldPenStyle(), penStyle))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldPenStyle());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute SetPenStyle(CGraphicsContext::TPenStyle)"));
+		GetGraphicsContext()->SetPenStyle(penStyle);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdSetShadowColor(const TDesC& aSection)
+	{
+	TRgb	color;
+	if ( !GetRgbFromConfig(aSection, KFldRgb(), color) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldRgb());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute SetShadowColor(TRgb)"));
+		TInt	err=GetGraphicsContext()->SetShadowColor(color);
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdSetStrikethroughStyle(const TDesC& aSection)
+	{
+	TFontStrikethrough	fontStrikethrough;
+	if(	!CT_GraphicsUtil::ReadFontStrikethrough(*this, aSection, KFldFontStrikethrough(), fontStrikethrough) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldFontStrikethrough());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute SetStrikethroughStyle(TFontStrikethrough)"));
+		GetGraphicsContext()->SetStrikethroughStyle(fontStrikethrough);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdSetUnderlineStyle(const TDesC& aSection)
+	{
+	TFontUnderline	fontUnderline;
+	if(	!CT_GraphicsUtil::ReadFontUnderline(*this, aSection, KFldFontUnderline(), fontUnderline) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldFontUnderline());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute SetUnderlineStyle(TFontUnderline)"));
+		GetGraphicsContext()->SetUnderlineStyle(fontUnderline);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdSetWordJustification(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	TInt	excessWidth=0;
+	if(	!GetIntFromConfig(aSection, KFldExcessWidth(), excessWidth))
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldExcessWidth());
+		SetBlockResult(EFail);
+		}
+
+	TInt	numGaps=0;
+	if(	!GetIntFromConfig(aSection, KFldNumGaps(), numGaps))
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldNumGaps());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		INFO_PRINTF1(_L("execute SetWordJustification(TInt, TInt)"));
+		GetGraphicsContext()->SetWordJustification(excessWidth, numGaps);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdUseBrushPatternL(const TDesC& aSection)
+	{
+	CFbsBitmap*	bitmap=NULL;
+	if ( !CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFldBitmap, bitmap) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldBitmap());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute UseBrushPattern(CFbsBitmap*)"));
+		GetGraphicsContext()->UseBrushPattern(bitmap);
+		}
+	}
+
+void CT_DataGraphicsContext::DoCmdUseFontL(const TDesC& aSection)
+	{
+	CFont*	font=NULL;
+
+	CT_GraphicsUtil::GetFontL(*this, aSection, KFldFont, font);
+	INFO_PRINTF1(_L("execute UseFont(CFont*)"));
+	GetGraphicsContext()->UseFont(font);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/src/T_DataGraphicsDevice.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,380 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataGraphicsDevice
+*/
+
+#include "T_DataGraphicsDevice.h"
+#include "T_GraphicsUtil.h"
+
+/*@{*/
+///	Commands
+_LIT(KCmdCreateContext,								"CreateContext");
+_LIT(KCmdDisplayMode,								"DisplayMode");
+_LIT(KCmdFontHeightInTwips,							"FontHeightInTwips");
+_LIT(KCmdGetPalette,								"GetPalette");
+_LIT(KCmdNumTypefaces,								"NumTypefaces");
+_LIT(KCmdPaletteAttributes,							"PaletteAttributes");
+_LIT(KCmdSetPalette,								"SetPalette");
+_LIT(KCmdSizeInPixels,								"SizeInPixels");
+_LIT(KCmdSizeInTwips,								"SizeInTwips");
+_LIT(KCmdTypefaceSupport,							"TypefaceSupport");
+
+///	Fields
+_LIT(KFldContext,									"context");
+_LIT(KFldDisplayMode,								"displaymode");
+_LIT(KFldExpected,									"expected");
+_LIT(KFldExpectedEntries,							"expected_entries");
+_LIT(KFldExpectedModifiable,						"expected_modifiable");
+_LIT(KFldHeightIndex,								"height_index");
+_LIT(KFldIndex,										"index");
+_LIT(KFldPalette,									"palette");
+_LIT(KFldTypefaceIndex,								"typeface_index");
+
+///	Logging
+_LIT(KLogError,										"Error=%d");
+_LIT(KLogMissingParameter,							"Missing parameter '%S'");
+_LIT(KLogMissingWrapper,							"Missing wrapper for '%S'");
+_LIT(KLogNotExpectedValue,							"Not expected value");
+/*@}*/
+
+
+/**
+* Constructor. First phase construction
+*/
+CT_DataGraphicsDevice::CT_DataGraphicsDevice()
+:	CT_DataGraphicsDeviceMap()
+,	iDisplayMode(ENone)
+	{
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataGraphicsDevice::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	ret=ETrue;
+	if ( aCommand==KCmdCreateContext )
+		{
+		DoCmdCreateContextL(aSection);
+		}
+	else if ( aCommand==KCmdDisplayMode )
+		{
+		DoCmdDisplayMode(aSection);
+		}
+	else if ( aCommand==KCmdFontHeightInTwips )
+		{
+		DoCmdFontHeightInTwips(aSection);
+		}
+	else if ( aCommand==KCmdGetPalette )
+		{
+		DoCmdGetPaletteL(aSection);
+		}
+	else if ( aCommand==KCmdNumTypefaces )
+		{
+		DoCmdNumTypefaces(aSection);
+		}
+	else if ( aCommand==KCmdPaletteAttributes )
+		{
+		DoCmdPaletteAttributes(aSection);
+		}
+	else if ( aCommand==KCmdSetPalette )
+		{
+		DoCmdSetPaletteL(aSection);
+		}
+	else if ( aCommand==KCmdSizeInPixels )
+		{
+		DoCmdSizeInPixels(aSection);
+		}
+	else if ( aCommand==KCmdSizeInTwips )
+		{
+		DoCmdSizeInTwips(aSection);
+		}
+	else if ( aCommand==KCmdTypefaceSupport )
+		{
+		DoCmdTypefaceSupport(aSection);
+		}
+	else
+		{
+		ret=CT_DataGraphicsDeviceMap::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+
+	return ret;
+	}
+
+void CT_DataGraphicsDevice::DoCmdCreateContextL(const TDesC& aSection)
+	{
+	TPtrC	wrapperName;
+	// get BitmapUtilData object from parameters
+	if ( !GetStringFromConfig(aSection, KFldContext, wrapperName) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldContext());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		CDataWrapper*	wrapper=GetDataWrapperL(wrapperName);
+		if ( wrapper==NULL )
+			{
+			ERR_PRINTF2(KLogMissingWrapper, &wrapperName);
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			CGraphicsContext*	context=NULL;
+			INFO_PRINTF1(_L("execute CreateContext(CGraphicsContext*&)"));
+			TInt	err=GetGraphicsDevice()->CreateContext(context);
+			if ( err!=KErrNone )
+				{
+				ERR_PRINTF2(KLogError, err);
+				SetError(err);
+				}
+			else
+				{
+				wrapper->SetObjectL(context);
+				}
+			}
+		}
+	}
+
+void CT_DataGraphicsDevice::DoCmdDisplayMode(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("execute DisplayMode()"));
+	iDisplayMode=GetGraphicsDevice()->DisplayMode();
+	INFO_PRINTF2(_L("Display Mode %d"), iDisplayMode);
+
+	// get display mode from parameters
+	TDisplayMode	expectedValue;
+	if ( CT_GraphicsUtil::ReadDisplayMode(*this, aSection, KFldDisplayMode(), expectedValue) )
+		{
+		// check value against NULL
+		if ( iDisplayMode!=expectedValue )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataGraphicsDevice::DoCmdFontHeightInTwips(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// get typeface index from parameters
+	TInt	typefaceIndex;
+	if ( !GetIntFromConfig(aSection, KFldTypefaceIndex(), typefaceIndex) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldTypefaceIndex());
+		SetBlockResult(EFail);
+		}
+
+	// get height index from parameters
+	TInt	heightIndex;
+	if ( !GetIntFromConfig(aSection, KFldHeightIndex(), heightIndex) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldHeightIndex());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		INFO_PRINTF1(_L("execute FontHeightInTwips(TInt, TInt)"));
+		TInt	height=GetGraphicsDevice()->FontHeightInTwips(typefaceIndex, heightIndex);
+		INFO_PRINTF2(_L("Height %d"), height);
+
+		// get positive height check flag from parameters
+		TInt	expected;
+		if ( GetIntFromConfig(aSection, KFldExpected(), expected) )
+			{
+			if ( height!=expected )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+void CT_DataGraphicsDevice::DoCmdGetPaletteL(const TDesC& aSection)
+	{
+	CPalette*	pallet=NULL;
+	INFO_PRINTF1(_L("execute GetPalette(CPalette*&)"));
+	TInt	err=GetGraphicsDevice()->GetPalette(pallet);
+
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	else
+		{
+		CPalette*	expected=NULL;
+		if ( CT_GraphicsUtil::GetPaletteL(*this, aSection, KFldPalette(), expected) )
+			{
+			if ( pallet!=expected )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+void CT_DataGraphicsDevice::DoCmdNumTypefaces(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("execute NumTypefaces()"));
+	TInt	actual=GetGraphicsDevice()->NumTypefaces();
+	INFO_PRINTF2(_L("NumTypefaces=%d"), actual);
+
+	TInt	expected;
+	if ( GetIntFromConfig(aSection, KFldExpected(), expected) )
+		{
+		if ( actual!=expected )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataGraphicsDevice::DoCmdPaletteAttributes(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("execute PaletteAttributes(TBool&, TInt&)"));
+	TBool	modifiable;
+	TInt	entries;
+	GetGraphicsDevice()->PaletteAttributes(modifiable, entries);
+	INFO_PRINTF2(_L("modifiable %d"), modifiable);
+	INFO_PRINTF2(_L("entries    %d"), entries);
+
+	TBool	expectedModifiable;
+	if ( GetBoolFromConfig(aSection, KFldExpectedModifiable(), expectedModifiable) )
+		{
+		if ( modifiable!=expectedModifiable )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+
+	TInt	expectedEntries;
+	if ( GetIntFromConfig(aSection, KFldExpectedEntries(), expectedEntries) )
+		{
+		if ( entries!=expectedEntries )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataGraphicsDevice::DoCmdSetPaletteL(const TDesC& aSection)
+	{
+	CPalette*	pallet=NULL;
+	if ( !CT_GraphicsUtil::GetPaletteL(*this, aSection, KFldPalette(), pallet) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldPalette());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute SetPalette(CPalette*)"));
+		GetGraphicsDevice()->SetPalette(pallet);
+		}
+	}
+
+void CT_DataGraphicsDevice::DoCmdSizeInPixels(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("execute SizeInPixels()"));
+	iSizeInPixels=GetGraphicsDevice()->SizeInPixels();
+	INFO_PRINTF3(_L("CGraphicsDevice::SizeInPixels() height %d, width %d"), iSizeInPixels.iHeight, iSizeInPixels.iWidth);
+	
+	TSize	expected;
+	if ( GetSizeFromConfig(aSection, KFldExpected(), expected) )
+		{
+		if ( iSizeInPixels!=expected )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataGraphicsDevice::DoCmdSizeInTwips(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("execute SizeInTwips()"));
+	iSizeInTwips=GetGraphicsDevice()->SizeInTwips();
+	INFO_PRINTF3(_L("CGraphicsDevice::SizeInTwips() height %d, width %d"), iSizeInTwips.iHeight, iSizeInTwips.iWidth);
+	
+	TSize	expected;
+	if ( GetSizeFromConfig(aSection, KFldExpected(), expected) )
+		{
+		if ( iSizeInTwips!=expected )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataGraphicsDevice::DoCmdTypefaceSupport(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// get typeface index from parameters
+	TInt	index;
+	if ( !GetIntFromConfig(aSection, KFldIndex(), index) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldIndex());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		INFO_PRINTF1(_L("execute TypefaceSupport(TTypefaceSupport&, TInt)"));
+		GetGraphicsDevice()->TypefaceSupport(iTypefaceSupport, index);
+		INFO_PRINTF2(_L("iIsScalable       %d"), iTypefaceSupport.iIsScalable);
+		INFO_PRINTF2(_L("iMaxHeightInTwips %d"), iTypefaceSupport.iMaxHeightInTwips);
+		INFO_PRINTF2(_L("iMinHeightInTwips %d"), iTypefaceSupport.iMinHeightInTwips);
+		INFO_PRINTF2(_L("iNumHeights       %d"), iTypefaceSupport.iNumHeights);
+		
+		TTypefaceSupport expectedTypeface;
+		if (CT_GraphicsUtil::ReadTypefaceSupport(*this, aSection, KFldExpected(),expectedTypeface ))
+			{
+			// just check font name
+			if (expectedTypeface.iTypeface.iName!=iTypefaceSupport.iTypeface.iName )
+				{
+				ERR_PRINTF3(_L("DoCmdTypefaceSupport expected=%S actual=%S"), 
+						&expectedTypeface.iTypeface.iName,&iTypefaceSupport.iTypeface.iName);
+				SetBlockResult(EFail);
+				}
+			
+			}
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/src/T_DataGraphicsDeviceMap.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,493 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataGraphicsDeviceMap
+*/
+
+#include "T_DataGraphicsDeviceMap.h"
+#include "T_DataFont.h"
+
+/*@{*/
+///	Commands
+_LIT(KCmdGetNearestFontInTwips,						"GetNearestFontInTwips");
+_LIT(KCmdGetNearestFontToDesignHeightInTwips,		"GetNearestFontToDesignHeightInTwips");
+_LIT(KCmdGetNearestFontToMaxHeightInTwips,			"GetNearestFontToMaxHeightInTwips");
+_LIT(KCmdHorizontalPixelsToTwips,					"HorizontalPixelsToTwips");
+_LIT(KCmdHorizontalTwipsToPixels,					"HorizontalTwipsToPixels");
+_LIT(KCmdPixelsToTwips,								"PixelsToTwips");
+_LIT(KCmdReleaseFont,								"ReleaseFont");
+_LIT(KCmdTwipsToPixels,								"TwipsToPixels");
+_LIT(KCmdVerticalPixelsToTwips,						"VerticalPixelsToTwips");
+_LIT(KCmdVerticalTwipsToPixels,						"VerticalTwipsToPixels");
+
+///	Fields
+_LIT(KFldExpected,									"expected");
+_LIT(KFldFont,										"font");
+_LIT(KFldMaxHeight,									"maxheight");
+_LIT(KFldPixels,									"pixels");
+_LIT(KFldPoint,										"point");
+_LIT(KFldRect,										"rect");
+_LIT(KFldTwips,										"twips");
+_LIT(KFldDisown,									"disown");
+
+///	Logging
+_LIT(KLogError,										"Error=%d");
+_LIT(KLogMissingParameter,							"Missing parameter '%S'");
+_LIT(KLogMissingWrapper,							"Missing wrapper for '%S'");
+_LIT(KLogNotExpectedValue,							"Not expected value");
+/*@}*/
+
+/**
+* Constructor. First phase construction
+*/
+CT_DataGraphicsDeviceMap::CT_DataGraphicsDeviceMap()
+:	CDataWrapperBase()
+	{
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataGraphicsDeviceMap::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool	ret=ETrue;
+	if ( aCommand==KCmdGetNearestFontInTwips )
+		{
+		DoCmdGetNearestFontInTwipsL(aSection);
+		}
+	else if ( aCommand==KCmdGetNearestFontToDesignHeightInTwips )
+		{
+		DoCmdGetNearestFontToDesignHeightInTwipsL(aSection);
+		}
+	else if ( aCommand==KCmdGetNearestFontToMaxHeightInTwips )
+		{
+		DoCmdGetNearestFontToMaxHeightInTwipsL(aSection);
+		}
+	else if ( aCommand==KCmdHorizontalPixelsToTwips )
+		{
+		DoCmdHorizontalPixelsToTwips(aSection);
+		}
+	else if ( aCommand==KCmdHorizontalTwipsToPixels )
+		{
+		DoCmdHorizontalTwipsToPixels(aSection);
+		}
+	else if ( aCommand==KCmdPixelsToTwips )
+		{
+		DoCmdPixelsToTwips(aSection);
+		}
+	else if ( aCommand==KCmdReleaseFont )
+		{
+		DoCmdReleaseFontL(aSection);
+		}
+	else if ( aCommand==KCmdTwipsToPixels )
+		{
+		DoCmdTwipsToPixels(aSection);
+		}
+	else if ( aCommand==KCmdVerticalPixelsToTwips )
+		{
+		DoCmdVerticalPixelsToTwips(aSection);
+		}
+	else if ( aCommand==KCmdVerticalTwipsToPixels )
+		{
+		DoCmdVerticalTwipsToPixels(aSection);
+		}
+	else
+		{
+		ret=EFalse;
+		}
+	return ret;
+	}
+
+void CT_DataGraphicsDeviceMap::DoCmdGetNearestFontInTwipsL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	TFontSpec	fontSpec;
+	if ( !GetFontSpecFromConfig(aSection, KFldFont, fontSpec) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+
+	TPtrC		wrapperName;
+	// get BitmapUtilData object from parameters
+	if ( !GetStringFromConfig(aSection, KFldFont, wrapperName) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		CDataWrapper*	wrapper=GetDataWrapperL(wrapperName);
+		if ( wrapper==NULL )
+			{
+			ERR_PRINTF2(KLogMissingWrapper, &wrapperName);
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			CFont*	font=NULL;
+			INFO_PRINTF1(_L("execute GetNearestFontInTwips(CFont*&, TFontSpec)"));
+			TInt	err=GetGraphicsDeviceMap()->GetNearestFontInTwips(font, fontSpec);
+			if ( err!=KErrNone )
+				{
+				ERR_PRINTF2(KLogError, err);
+				SetError(err);
+				}
+			else
+				{
+				wrapper->SetObjectL(font);
+				}
+			}
+		}
+	}
+
+void CT_DataGraphicsDeviceMap::DoCmdGetNearestFontToDesignHeightInTwipsL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	TFontSpec	fontSpec;
+	if ( !GetFontSpecFromConfig(aSection, KFldFont, fontSpec) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+
+	TPtrC		wrapperName;
+	// get BitmapUtilData object from parameters
+	if ( !GetStringFromConfig(aSection, KFldFont, wrapperName) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		CDataWrapper*	wrapper=GetDataWrapperL(wrapperName);
+		if ( wrapper==NULL )
+			{
+			ERR_PRINTF2(KLogMissingWrapper, &wrapperName);
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			CFont*	font=NULL;
+			INFO_PRINTF1(_L("execute GetNearestFontToDesignHeightInTwips(CFont*&, TFontSpec)"));
+			TInt	err=GetGraphicsDeviceMap()->GetNearestFontToDesignHeightInTwips(font, fontSpec);
+			if ( err!=KErrNone )
+				{
+				ERR_PRINTF2(KLogError, err);
+				SetError(err);
+				}
+			else
+				{
+				wrapper->SetObjectL(font);
+				}
+			}
+		}
+	}
+
+void CT_DataGraphicsDeviceMap::DoCmdGetNearestFontToMaxHeightInTwipsL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	TFontSpec	fontSpec;
+	if ( !GetFontSpecFromConfig(aSection, KFldFont, fontSpec) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+
+	TInt	maxHeight;
+	if ( !GetIntFromConfig(aSection, KFldMaxHeight, maxHeight) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldMaxHeight());
+		SetBlockResult(EFail);
+		}
+
+	TPtrC		wrapperName;
+	// get BitmapUtilData object from parameters
+	if ( !GetStringFromConfig(aSection, KFldFont, wrapperName) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		CDataWrapper*	wrapper=GetDataWrapperL(wrapperName);
+		if ( wrapper==NULL )
+			{
+			ERR_PRINTF2(KLogMissingWrapper, &wrapperName);
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			CFont*	font=NULL;
+			INFO_PRINTF1(_L("execute GetNearestFontToMaxHeightInTwips(CFont*&, TFontSpec, TInt)"));
+			TInt	err=GetGraphicsDeviceMap()->GetNearestFontToMaxHeightInTwips(font, fontSpec, maxHeight);
+			if ( err!=KErrNone )
+				{
+				ERR_PRINTF2(KLogError, err);
+				SetError(err);
+				}
+			else
+				{
+				wrapper->SetObjectL(font);
+				}
+			}
+		}
+	}
+
+void CT_DataGraphicsDeviceMap::DoCmdHorizontalPixelsToTwips(const TDesC& aSection)
+	{
+	TInt	value;
+	if ( !GetIntFromConfig(aSection, KFldPixels, value) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldPixels());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute HorizontalPixelsToTwips(TInt)"));
+		TInt	pixels=GetGraphicsDeviceMap()->HorizontalPixelsToTwips(value);
+		INFO_PRINTF2(_L("HorizontalPixelsToTwips=%d"), pixels);
+
+		if ( GetIntFromConfig(aSection, KFldExpected, value) )
+			{
+			if ( value!=pixels )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+void CT_DataGraphicsDeviceMap::DoCmdHorizontalTwipsToPixels(const TDesC& aSection)
+	{
+	TInt	value;
+	if ( !GetIntFromConfig(aSection, KFldTwips, value) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldTwips());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute HorizontalTwipsToPixels(TInt)"));
+		TInt	pixels=GetGraphicsDeviceMap()->HorizontalTwipsToPixels(value);
+		INFO_PRINTF2(_L("HorizontalTwipsToPixels=%d"), pixels);
+
+		if ( GetIntFromConfig(aSection, KFldExpected, value) )
+			{
+			if ( value!=pixels )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+void CT_DataGraphicsDeviceMap::DoCmdPixelsToTwips(const TDesC& aSection)
+	{
+	TPoint	point;
+	if ( GetPointFromConfig(aSection, KFldPoint, point) )
+		{
+		INFO_PRINTF1(_L("execute PixelsToTwips(const TPoint&)"));
+		iPixelsToTwipsPoint=GetGraphicsDeviceMap()->PixelsToTwips(point);
+		INFO_PRINTF3(_L("PixelsToTwips x=%d y=%d"), iPixelsToTwipsPoint.iX, iPixelsToTwipsPoint.iY);
+
+		if ( GetPointFromConfig(aSection, KFldExpected, point) )
+			{
+			if ( point!=iPixelsToTwipsPoint )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	else
+		{
+		TRect	rect;
+		if ( GetRectFromConfig(aSection, KFldRect, rect) )
+			{
+			INFO_PRINTF1(_L("execute PixelsToTwips(const TRect&)"));
+			iPixelsToTwipsRect=GetGraphicsDeviceMap()->PixelsToTwips(rect);
+			LogRect(_L("PixelsToTwips(TRect)"), iPixelsToTwipsRect);
+			if ( GetRectFromConfig(aSection, KFldExpected, rect) )
+				{
+				if ( rect!=iPixelsToTwipsRect )
+					{
+					ERR_PRINTF1(KLogNotExpectedValue);
+					SetBlockResult(EFail);
+					}
+				}
+			}
+		else
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KFldPoint());
+			ERR_PRINTF2(KLogMissingParameter, &KFldRect());
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataGraphicsDeviceMap::DoCmdReleaseFontL(const TDesC& aSection)
+	{
+	TPtrC		wrapperName;
+	// get BitmapUtilData object from parameters
+	if ( !GetStringFromConfig(aSection, KFldFont, wrapperName) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		CT_DataFont*	wrapper=static_cast<CT_DataFont*>(GetDataWrapperL(wrapperName));
+		if ( wrapper==NULL )
+			{
+			ERR_PRINTF2(KLogMissingWrapper, &wrapperName);
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			CFont*	font=wrapper->GetFont();
+			INFO_PRINTF1(_L("execute ReleaseFont(CFont*)"));
+			GetGraphicsDeviceMap()->ReleaseFont(font);
+			
+			// check if we need to disown object
+			TBool	disOwn=ETrue, Own;
+			if ( GetBoolFromConfig(aSection, KFldDisown, Own))
+				disOwn=Own;
+			if (disOwn)
+				wrapper->DisownObjectL();
+			}
+		}
+	}
+
+void CT_DataGraphicsDeviceMap::DoCmdTwipsToPixels(const TDesC& aSection)
+	{
+	TPoint	point;
+	if ( GetPointFromConfig(aSection, KFldPoint, point) )
+		{
+		INFO_PRINTF1(_L("execute TwipsToPixels(const TPoint&)"));
+		iTwipsToPixelsPoint=GetGraphicsDeviceMap()->TwipsToPixels(point);
+		INFO_PRINTF3(_L("TwipsToPixels x=%d y=%d"), iTwipsToPixelsPoint.iX, iTwipsToPixelsPoint.iY);
+
+		if ( GetPointFromConfig(aSection, KFldExpected, point) )
+			{
+			if ( point!=iTwipsToPixelsPoint )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	else
+		{
+		TRect	rect;
+		if ( GetRectFromConfig(aSection, KFldRect, rect) )
+			{
+			INFO_PRINTF1(_L("execute TwipsToPixels(const TRect&)"));
+			iTwipsToPixelsRect=GetGraphicsDeviceMap()->TwipsToPixels(rect);
+			LogRect(_L("TwipsToPixels(const TRect&)"), iTwipsToPixelsRect);
+			if ( GetRectFromConfig(aSection, KFldExpected, rect) )
+				{
+				if ( rect!=iTwipsToPixelsRect )
+					{
+					ERR_PRINTF1(KLogNotExpectedValue);
+					SetBlockResult(EFail);
+					}
+				}
+			}
+		else
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KFldPoint());
+			ERR_PRINTF2(KLogMissingParameter, &KFldRect());
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataGraphicsDeviceMap::DoCmdVerticalPixelsToTwips(const TDesC& aSection)
+	{
+	TInt	value;
+	if ( !GetIntFromConfig(aSection, KFldPixels, value) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldPixels());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute VerticalPixelsToTwips(TInt)"));
+		TInt	pixels=GetGraphicsDeviceMap()->VerticalPixelsToTwips(value);
+		INFO_PRINTF2(_L("VerticalPixelsToTwips=%d"), pixels);
+
+		if ( GetIntFromConfig(aSection, KFldExpected, value) )
+			{
+			if ( value!=pixels )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+void CT_DataGraphicsDeviceMap::DoCmdVerticalTwipsToPixels(const TDesC& aSection)
+	{
+	TInt	value;
+	if ( !GetIntFromConfig(aSection, KFldTwips, value) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldTwips());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute VerticalTwipsToPixels(TInt)"));
+		TInt	pixels=GetGraphicsDeviceMap()->VerticalTwipsToPixels(value);
+		INFO_PRINTF2(_L("VerticalTwipsToPixels=%d"), pixels);
+
+		if ( GetIntFromConfig(aSection, KFldExpected, value) )
+			{
+			if ( value!=pixels )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/src/T_DataMeasureTextInput.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,426 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataMeasureTextInput
+*/
+
+#include "T_DataMeasureTextInput.h"
+
+
+/*@{*/
+///	Parameters
+_LIT(KValue,									"value");
+_LIT(KFlag,										"flag%d");
+
+///	CFont::TMeasureTextInput::TFlags
+_LIT(KEFVisualOrder,							"EFVisualOrder");
+_LIT(KEFVisualOrderRightToLeft,					"EFVisualOrderRightToLeft");
+_LIT(KEFIncludePenPositionInBoundsCheck,		"EFIncludePenPositionInBoundsCheck");
+
+///	Commands
+_LIT(KCmdNew,									"new");
+_LIT(KCmdDestructor,							"~");
+_LIT(KCmdSetCharJustExcess,						"iCharJustExcess");
+_LIT(KCmdSetCharJustNum,						"iCharJustNum");
+_LIT(KCmdSetDirection,							"iDirection");
+_LIT(KCmdSetEndInputChar,						"iEndInputChar");
+_LIT(KCmdSetFlags,								"iFlags");
+_LIT(KCmdSetMaxAdvance,							"iMaxAdvance");
+_LIT(KCmdSetMaxBounds,							"iMaxBounds");
+_LIT(KCmdSetStartInputChar,						"iStartInputChar");
+_LIT(KCmdSetWordJustExcess,						"iWordJustExcess");
+_LIT(KCmdSetWordJustNum,						"iWordJustNum");
+/*@}*/
+
+
+/**
+* Two phase constructor
+*/
+CT_DataMeasureTextInput* CT_DataMeasureTextInput::NewL()
+	{
+	CT_DataMeasureTextInput* ret = new (ELeave) CT_DataMeasureTextInput();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+
+/**
+* Protected constructor. First phase construction
+*/
+CT_DataMeasureTextInput::CT_DataMeasureTextInput()
+:	CDataWrapperBase()
+,	iMeasureTextInput(NULL)
+	{
+	}
+
+
+/**
+* Protected second phase construction
+*/
+void CT_DataMeasureTextInput::ConstructL()
+	{
+	}
+
+
+/**
+* Destructor.
+*/
+CT_DataMeasureTextInput::~CT_DataMeasureTextInput()
+	{
+	DestroyData();
+	}
+
+
+/**
+* cleanup implementation.
+*/
+void CT_DataMeasureTextInput::DestroyData()
+	{
+	delete iMeasureTextInput;
+	iMeasureTextInput = NULL;
+	}
+
+
+/**
+* Return a pointer to the object that the data wraps
+*
+* @return pointer to the object that the data wraps
+*/
+TAny* CT_DataMeasureTextInput::GetObject()
+	{
+	return iMeasureTextInput;
+	}
+
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataMeasureTextInput::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool retVal = ETrue;
+
+	if (aCommand == KCmdNew)
+		{
+		DoCmdNew();
+		}
+	else if (aCommand == KCmdDestructor)
+		{
+		DoCmdDestructor();
+		}
+	else if (aCommand == KCmdSetCharJustExcess)
+		{
+		DoCmdSetCharJustExcess(aSection);
+		}
+	else if (aCommand == KCmdSetCharJustNum)
+		{
+		DoCmdSetCharJustNum(aSection);
+		}
+	else if (aCommand == KCmdSetDirection)
+		{
+		DoCmdSetDirection(aSection);
+		}
+	else if (aCommand == KCmdSetEndInputChar)
+		{
+		DoCmdSetEndInputChar(aSection);
+		}
+	else if (aCommand == KCmdSetFlags)
+		{
+		DoCmdSetFlags(aSection);
+		}
+	else if (aCommand == KCmdSetMaxAdvance)
+		{
+		DoCmdSetMaxAdvance(aSection);
+		}
+	else if (aCommand == KCmdSetMaxBounds)
+		{
+		DoCmdSetMaxBounds(aSection);
+		}
+	else if (aCommand == KCmdSetStartInputChar)
+		{
+		DoCmdSetStartInputChar(aSection);
+		}
+	else if (aCommand == KCmdSetWordJustExcess)
+		{
+		DoCmdSetWordJustExcess(aSection);
+		}
+	else if (aCommand == KCmdSetWordJustNum)
+		{
+		DoCmdSetWordJustNum(aSection);
+		}
+	else
+		{
+		retVal=EFalse;
+		}
+
+	return retVal;
+	}
+
+
+////////////////// COMMANDS IMPLEMENTATION  ////////////////////////
+
+/** Creates an instance of TMeasureTextInput structure */
+void CT_DataMeasureTextInput::DoCmdNew()
+	{
+	INFO_PRINTF1(_L("Creates an instance of TMeasureTextInput structure"));
+
+	// cleanup if any
+	delete iMeasureTextInput;
+	iMeasureTextInput = NULL;
+
+	// call new operator
+	TRAPD(err, iMeasureTextInput = new (ELeave) CFont::TMeasureTextInput());
+
+	// check error code
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(_L("Error creating an instance: %d"), err);
+		SetError(err);
+		}
+	}
+
+
+/** Destructor */
+void CT_DataMeasureTextInput::DoCmdDestructor()
+	{
+	DestroyData();
+	}
+
+/** Sets TMeasureTextInputData::iStartInputChar */
+void CT_DataMeasureTextInput::DoCmdSetStartInputChar(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Sets TMeasureTextInputData::iStartInputChar"));
+
+	// get value from parameters
+	TInt	value;
+	if (GetValueFromConfig(aSection, value))
+		{
+		iMeasureTextInput->iStartInputChar = value;
+		}
+	}
+
+
+/** Sets TMeasureTextInputData::iEndInputChar */
+void CT_DataMeasureTextInput::DoCmdSetEndInputChar(const TDesC& aSection)
+	{
+	INFO_PRINTF2(_L("Sets TMeasureTextInputData::iEndInputChar %S"), &aSection);
+
+	// get value from parameters
+	TInt	value;
+	if (GetValueFromConfig(aSection, value))
+		{
+		iMeasureTextInput->iEndInputChar = value;
+		}
+	}
+
+
+/** Sets TMeasureTextInputData::iDirection */
+void CT_DataMeasureTextInput::DoCmdSetDirection(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Sets TMeasureTextInputData::iDirection"));
+
+	// get value from parameters
+	TInt	value;
+	if (GetValueFromConfig(aSection, value))
+		{
+		iMeasureTextInput->iDirection = value;
+		}
+	}
+
+
+/** Sets TMeasureTextInputData::iFlags */
+void CT_DataMeasureTextInput::DoCmdSetFlags(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Sets TMeasureTextInputData::iFlags"));
+
+	// get value from parameters
+	if ( !ReadFlags(aSection, iMeasureTextInput->iFlags) )
+		{
+		ERR_PRINTF2(_L("No %S"), &aSection);
+		SetBlockResult(EFail);
+		}
+	}
+
+
+/** Sets TMeasureTextInputData::iMaxAdvance */
+void CT_DataMeasureTextInput::DoCmdSetMaxAdvance(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Sets TMeasureTextInputData::iMaxAdvance"));
+
+	// get value from parameters
+	TInt	value;
+	if (GetValueFromConfig(aSection, value))
+		{
+		iMeasureTextInput->iMaxAdvance = value;
+		}
+	}
+
+
+/** Sets TMeasureTextInputData::iMaxBounds */
+void CT_DataMeasureTextInput::DoCmdSetMaxBounds(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Sets TMeasureTextInputData::iMaxBounds"));
+
+	// get value from parameters
+	TInt	value;
+	if (GetValueFromConfig(aSection, value))
+		{
+		iMeasureTextInput->iMaxBounds = value;
+		}
+	}
+
+
+/** Sets TMeasureTextInputData::iCharJustNum */
+void CT_DataMeasureTextInput::DoCmdSetCharJustNum(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Sets TMeasureTextInputData::iCharJustNum"));
+
+	// get value from parameters
+	TInt	value;
+	if (GetValueFromConfig(aSection, value))
+		{
+		iMeasureTextInput->iCharJustNum = value;
+		}
+	}
+
+
+/** Sets TMeasureTextInputData::iCharJustExcess */
+void CT_DataMeasureTextInput::DoCmdSetCharJustExcess(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Sets TMeasureTextInputData::iCharJustExcess"));
+
+	// get value from parameters
+	TInt	value;
+	if (GetValueFromConfig(aSection, value))
+		{
+		iMeasureTextInput->iCharJustExcess = value;
+		}
+	}
+
+
+/** Sets TMeasureTextInputData::iWordJustNum */
+void CT_DataMeasureTextInput::DoCmdSetWordJustNum(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Sets TMeasureTextInputData::iWordJustNum"));
+
+	// get value from parameters
+	TInt	value;
+	if (GetValueFromConfig(aSection, value))
+		{
+		iMeasureTextInput->iWordJustNum = value;
+		}
+	}
+
+
+/** Sets TMeasureTextInputData::iWordJustExcess */
+void CT_DataMeasureTextInput::DoCmdSetWordJustExcess(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Sets TMeasureTextInputData::iWordJustExcess"));
+
+	// get value from parameters
+	TInt	value;
+	if (GetValueFromConfig(aSection, value))
+		{
+		iMeasureTextInput->iWordJustExcess = value;
+		}
+	}
+
+
+///////////////////////////////// UTIL METHODS //////////////////////////////////////
+
+
+/**
+* Utility method that fetches a int value from parameters
+*/
+TBool CT_DataMeasureTextInput::GetValueFromConfig(const TDesC& aSection, TInt& aValue)
+	{
+	TBool	ret=GetIntFromConfig(aSection, KValue(), aValue);
+	if ( !ret )
+		{
+		ERR_PRINTF2(_L("No %S"), &KValue());
+		SetBlockResult(EFail);
+		}
+
+	return ret;
+	}
+
+/**
+ ReadFlags - read in bitwise measeure text input flags
+ @internalComponent
+ @param aSection - main entry in .ini file
+ @param aFlags - bitwise flags output
+ @return ETrue if data is valid in the ini file
+ @pre None
+ @post 2nd stage construction complete
+*/
+TBool CT_DataMeasureTextInput::ReadFlags(const TDesC& aSection, TUint16& aFlags)
+	{
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+	TInt								index=0;
+	TBool								moreData=ETrue;
+	TPtrC								flagString;
+	TBool								ret=ETrue;
+
+	aFlags=0;
+	while ( moreData && ret )
+		{
+		tempStore.Format(KFlag(), &aSection, ++index);
+		if ( GetStringFromConfig(aSection, tempStore, flagString) )
+			{
+			TInt	flag=0;
+
+			if ( flagString==KEFVisualOrder )
+				{
+				flag=CFont::TMeasureTextInput::EFVisualOrder;
+				}
+			else if ( flagString==KEFVisualOrderRightToLeft )
+				{
+				flag=CFont::TMeasureTextInput::EFVisualOrderRightToLeft;
+				}
+			else if ( flagString==KEFIncludePenPositionInBoundsCheck )
+				{
+				flag=CFont::TMeasureTextInput::EFIncludePenPositionInBoundsCheck;
+				}
+			else
+				{
+				ret=GetIntFromConfig(aSection, tempStore, flag);
+				}
+
+			if ( ret )
+				{
+				aFlags |= flag;
+				}
+			}
+		else
+			{
+			moreData=EFalse;
+			}
+		}
+
+	return ret;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/src/T_DataMeasureTextOutput.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,348 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataMeasureTextOutput
+*/
+
+#include "T_DataMeasureTextOutput.h"
+
+
+/*@{*/
+///	Parameters
+_LIT(KValue,									"value");
+_LIT(KRectAx,									"rect_ax");
+_LIT(KRectAy,									"rect_ay");
+_LIT(KRectBx,									"rect_bx");
+_LIT(KRectBy,									"rect_by");
+_LIT(KWidth,									"width");
+_LIT(KHeight,									"height");
+
+///	Commands
+_LIT(KCmdNew,									"new");
+_LIT(KCmdSetBounds,								"iBounds");
+_LIT(KCmdSetChars,								"iChars");
+_LIT(KCmdSetGlyphs,								"iGlyphs");
+_LIT(KCmdSetGroups,								"iGroups");
+_LIT(KCmdSetMaxGlyphSize,						"iMaxGlyphSize");
+_LIT(KCmdSetSpaces,								"iSpaces");
+_LIT(KCmdDestructor,							"~");
+
+
+
+/*@}*/
+
+
+/**
+* Two phase constructor
+*/
+CT_DataMeasureTextOutput* CT_DataMeasureTextOutput::NewL()
+	{
+	CT_DataMeasureTextOutput* ret = new (ELeave) CT_DataMeasureTextOutput();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+
+/**
+* Protected constructor. First phase construction
+*/
+CT_DataMeasureTextOutput::CT_DataMeasureTextOutput()
+:	CDataWrapperBase()
+,	iMeasureTextOutput(NULL)
+	{
+	}
+
+
+/**
+* Protected second phase construction
+*/
+void CT_DataMeasureTextOutput::ConstructL()
+	{
+	}
+
+
+/**
+* Destructor.
+*/
+CT_DataMeasureTextOutput::~CT_DataMeasureTextOutput()
+	{
+	DestroyData();
+	}
+
+
+/**
+* cleanup implementation.
+*/
+void CT_DataMeasureTextOutput::DestroyData()
+	{
+	delete iMeasureTextOutput;
+	iMeasureTextOutput = NULL;
+	}
+
+
+/**
+* Return a pointer to the object that the data wraps
+*
+* @return pointer to the object that the data wraps
+*/
+TAny* CT_DataMeasureTextOutput::GetObject()
+	{
+	return iMeasureTextOutput;
+	}
+
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataMeasureTextOutput::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool retVal = ETrue;
+
+	if (aCommand == KCmdNew)
+		{
+		DoCmdNew();
+		}
+	else if (aCommand == KCmdSetBounds)
+		{
+		DoCmdSetBounds(aSection);
+		}
+	else if (aCommand == KCmdSetChars)
+		{
+		DoCmdSetChars(aSection);
+		}
+	else if (aCommand == KCmdSetGlyphs)
+		{
+		DoCmdSetGlyphs(aSection);
+		}
+	else if (aCommand == KCmdSetGroups)
+		{
+		DoCmdSetGroups(aSection);
+		}
+	else if (aCommand == KCmdSetMaxGlyphSize)
+		{
+		DoCmdSetMaxGlyphSize(aSection);
+		}
+	else if (aCommand == KCmdSetSpaces)
+		{
+		DoCmdSetSpaces(aSection);
+		}
+	else if (aCommand == KCmdDestructor)
+		{
+		DestroyData();
+		}
+	else
+		{
+		retVal=EFalse;
+		}
+
+	return retVal;
+	}
+
+
+////////////////// COMMANDS IMPLEMENTATION  ////////////////////////
+
+/** Creates an instance of TMeasureTextOutput structure */
+void CT_DataMeasureTextOutput::DoCmdNew()
+	{
+	INFO_PRINTF1(_L("Creates an instance of TMeasureTextOutput structure"));
+
+	// cleanup if any
+	DestroyData();
+
+	// call new operator
+	TRAPD(err, iMeasureTextOutput = new (ELeave) CFont::TMeasureTextOutput());
+
+	// check error code
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(_L("Error creating an instance: %d"), err);
+		SetError(err);
+		}
+	}
+
+
+/** Sets TMeasureTextOutputData::iChars */
+void CT_DataMeasureTextOutput::DoCmdSetChars(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Sets TMeasureTextOutputData::iChars"));
+
+	// get value from parameters
+	TInt	value;
+	if (GetValueFromConfig(*this,aSection, value))
+		{
+		iMeasureTextOutput->iChars = value;
+		}
+	}
+
+
+/** Sets TMeasureTextOutputData::iGlyphs */
+void CT_DataMeasureTextOutput::DoCmdSetGlyphs(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Sets TMeasureTextOutputData::iGlyphs"));
+
+	// get value from parameters
+	TInt	value;
+	if (GetValueFromConfig(*this, aSection, value))
+		{
+		iMeasureTextOutput->iGlyphs = value;
+		}
+	}
+
+
+/** Sets TMeasureTextOutputData::iGroups */
+void CT_DataMeasureTextOutput::DoCmdSetGroups(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Sets TMeasureTextOutputData::iGroups"));
+
+	// get value from parameters
+	TInt	value;
+	if (GetValueFromConfig(*this, aSection, value))
+		{
+		iMeasureTextOutput->iGroups = value;
+		}
+	}
+
+
+/** Sets TMeasureTextOutputData::iSpaces */
+void CT_DataMeasureTextOutput::DoCmdSetSpaces(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Sets TMeasureTextOutputData::iSpaces"));
+
+	// get value from parameters
+	TInt	value;
+	if (GetValueFromConfig(*this,  aSection, value))
+		{
+		iMeasureTextOutput->iSpaces = value;
+		}
+	}
+
+
+/** Sets TMeasureTextOutputData::iBounds */
+void CT_DataMeasureTextOutput::DoCmdSetBounds(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Sets TMeasureTextOutputData::iBounds"));
+
+	TBool	dataOk = ETrue;
+
+	// get rect Ax from parameters
+	TInt	rectAx;
+	if(!GetIntFromConfig(aSection, KRectAx(), rectAx))
+		{
+		ERR_PRINTF2(_L("No %S"), &KRectAx());
+		SetBlockResult(EFail);
+		dataOk = EFalse;
+		}
+
+	// get rect Ay from parameters
+	TInt	rectAy;
+	if(!GetIntFromConfig(aSection, KRectAy(), rectAy))
+		{
+		ERR_PRINTF2(_L("No %S"), &KRectAy());
+		SetBlockResult(EFail);
+		dataOk = EFalse;
+		}
+
+	// get rect Bx from parameters
+	TInt	rectBx;
+	if(!GetIntFromConfig(aSection, KRectBx(), rectBx))
+		{
+		ERR_PRINTF2(_L("No %S"), &KRectBx());
+		SetBlockResult(EFail);
+		dataOk = EFalse;
+		}
+	
+	// get rect By from parameters
+	TInt	rectBy;
+	if(!GetIntFromConfig(aSection, KRectBy(), rectBy))
+		{
+		ERR_PRINTF2(_L("No %S"), &KRectBy());
+		SetBlockResult(EFail);
+		dataOk = EFalse;
+		}
+
+	// set the field
+	if (dataOk)
+		{
+		iMeasureTextOutput->iBounds.SetRect(rectAx, rectAy, rectBx, rectBy);
+		}
+	}
+
+
+/** Sets TMeasureTextOutputData::iMaxGlyphSize */
+void CT_DataMeasureTextOutput::DoCmdSetMaxGlyphSize(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Sets TMeasureTextOutputData::iMaxGlyphSize"));
+
+	TBool	dataOk = ETrue;
+
+	// get width from parameters
+	TInt	width;
+	if(!GetIntFromConfig(aSection, KWidth(), width))
+		{
+		ERR_PRINTF2(_L("No %S"), &KWidth());
+		SetBlockResult(EFail);
+		dataOk = EFalse;
+		}
+	
+	// get height from parameters
+	TInt	height; 
+	if(!GetIntFromConfig(aSection, KHeight(), height))
+		{
+		ERR_PRINTF2(_L("No %S"), &KHeight());
+		SetBlockResult(EFail);
+		dataOk = EFalse;
+		}
+
+	// set the field
+	if (dataOk)
+		{
+		iMeasureTextOutput->iMaxGlyphSize.iWidth = width;
+		iMeasureTextOutput->iMaxGlyphSize.iHeight = height;
+		}
+	}
+
+
+
+///////////////////////////////// UTIL METHODS //////////////////////////////////////
+
+
+/**
+* Utility method that fetches a int value from parameters
+*/
+TBool CT_DataMeasureTextOutput::GetValueFromConfig(CDataWrapper& iInputStep, const TDesC& aSection, TInt& aValue)
+	{
+	TBool	ret=iInputStep.GetIntFromConfig(aSection, KValue(), aValue);
+	if (!ret)
+		{
+		iInputStep.ERR_PRINTF2(_L("No %S"), &KValue());
+		iInputStep.SetBlockResult(EFail);
+		}
+
+	return ret;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/src/T_DataPalette.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,196 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataPalette
+*/
+
+#include "T_DataPalette.h"
+#include "T_GraphicsUtil.h"
+
+
+/*@{*/
+///	Parameters
+_LIT(KNumberOfColors,						"number_of_colors");
+_LIT(KDisplayMode,							"displaymode");
+
+///	Commands
+_LIT(KCmdNewL,								"NewL");
+_LIT(KCmdNewDefaultL,						"NewDefaultL");
+_LIT(KCleanup,								"~");
+/*@}*/
+
+
+/**
+* Two phase constructor
+*/
+CT_DataPalette* CT_DataPalette::NewL()
+	{
+	CT_DataPalette* ret = new (ELeave) CT_DataPalette();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+
+/**
+* Protected constructor. First phase construction
+*/
+CT_DataPalette::CT_DataPalette()
+:	CDataWrapperBase()
+,	iPalette(NULL)
+	{
+	}
+
+
+/**
+* Protected second phase construction
+*/
+void CT_DataPalette::ConstructL()
+	{
+	}
+
+
+/**
+* Destructor.
+*/
+CT_DataPalette::~CT_DataPalette()
+	{
+	DestroyData();
+	}
+
+
+/**
+* cleanup implementation.
+*/
+void CT_DataPalette::DestroyData()
+	{
+	delete iPalette;
+	iPalette = NULL;
+	}
+
+
+/**
+* Return a pointer to the object that the data wraps
+*
+* @return pointer to the object that the data wraps
+*/
+TAny* CT_DataPalette::GetObject()
+	{
+	return iPalette;
+	}
+
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataPalette::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool retVal = ETrue;
+
+	if (aCommand == KCmdNewL)
+		{
+		DoCmdNew(aSection);
+		}
+	else if (aCommand == KCmdNewDefaultL)
+		{
+		DoCmdNewDefault(aSection);
+		}
+	else if (aCommand == KCleanup)
+		{
+		DestroyData();
+		}
+	else
+		{
+		retVal=EFalse;
+		}
+
+	return retVal;
+	}
+
+
+////////////////// COMMANDS IMPLEMENTATION  ////////////////////////
+
+/** Creates a default palette for the display mode specified */
+void CT_DataPalette::DoCmdNew(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CPalette::NewL() creates a new palette with a given number of colors"));
+	// cleanup if any
+	delete iPalette;
+	iPalette = NULL;
+
+	// get number of colors from parameters
+	TInt	numberOfColors;
+	if(!GetIntFromConfig(aSection, KNumberOfColors(), numberOfColors))
+		{
+		ERR_PRINTF2(_L("No %S"), &KNumberOfColors());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// create new palette
+		TRAPD(err, iPalette = CPalette::NewL(numberOfColors));
+
+		// check error code
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(_L("CPalette::NewL error: %d"), err);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Creates a default palette for the display mode specified */
+void CT_DataPalette::DoCmdNewDefault(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CPalette::NewDefaultL() creating a default palette for the display mode specified"));
+
+	// cleanup if any
+	delete iPalette;
+	iPalette = NULL;
+
+	// get display mode from parameters
+	TDisplayMode	displayMode;
+	if ( !CT_GraphicsUtil::ReadDisplayMode(*this, aSection, KDisplayMode(), displayMode) )
+		{
+		ERR_PRINTF1(_L("No display mode"));
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// create new palette
+		TRAPD(err, iPalette = CPalette::NewDefaultL(displayMode));
+
+		// check error code
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(_L("CPalette::NewDefaultL error: %d"), err);
+			SetBlockResult(EFail);
+			}
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gdi/src/T_DataTypefaceStore.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,368 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataTypefaceStore
+*/
+
+#include "T_DataTypefaceStore.h"
+
+/*@{*/
+///	Parameters
+_LIT(KFont,											"font");
+_LIT(KFontDataObjectName,							"font_data_object_name");
+_LIT(KFontMaxHeight,								"font_max_height");
+_LIT(KTypefaceIndex,								"typeface_index");
+_LIT(KHeightIndex,									"height_index");
+_LIT(KTypefaces,									"typefaces");
+_LIT(KCheckHeightPositive,							"check_height_positive");
+
+///	Commands
+_LIT(KCmdFontHeightInTwips,					 		"FontHeightInTwips");
+_LIT(KCmdGetNearestFontInTwips,						"GetNearestFontInTwips");
+_LIT(KCmdGetNearestFontToDesignHeightInTwips,		"GetNearestFontToDesignHeightInTwips");
+_LIT(KCmdGetNearestFontToMaxHeightInTwips,			"GetNearestFontToMaxHeightInTwips");
+_LIT(KCmdNumTypefaces, 			 					"NumTypefaces");
+_LIT(KCmdReleaseFont,								"ReleaseFont");
+_LIT(KCmdTypefaceSupport,				 			"TypefaceSupport");
+
+///	Logging
+_LIT(KLogError,										"Error=%d");
+_LIT(KLogMissingParameter,							"Missing parameter '%S'");
+/*@}*/
+
+/**
+* Constructor. First phase construction
+*/
+CT_DataTypefaceStore::CT_DataTypefaceStore()
+:	CDataWrapperBase()
+	{
+	}
+
+
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataTypefaceStore::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool retVal = ETrue;
+
+	if (aCommand == KCmdGetNearestFontInTwips)
+		{
+		DoCmdGetNearestFontInTwipsL(aSection);
+		}
+	else if (aCommand == KCmdGetNearestFontToMaxHeightInTwips)
+		{
+		DoCmdGetNearestFontToMaxHeightInTwipsL(aSection);
+		}
+	else if (aCommand == KCmdNumTypefaces)
+		{
+		DoCmdNumTypefaces(aSection);
+		}
+	else if (aCommand == KCmdTypefaceSupport)
+		{
+		DoCmdTypefaceSupport(aSection);
+		}
+	else if (aCommand == KCmdFontHeightInTwips)
+		{
+		DoCmdFontHeightInTwips(aSection);
+		}
+	else if (aCommand == KCmdGetNearestFontToDesignHeightInTwips)
+		{
+		DoCmdGetNearestFontToDesignHeightInTwipsL(aSection);
+		}
+	else if (aCommand == KCmdReleaseFont)
+		{
+		DoCmdReleaseFontL(aSection);
+		}
+	else
+		{
+		retVal = EFalse;
+		}
+
+	return retVal;
+	}
+
+
+////////////////// COMMANDS IMPLEMENTATION  ////////////////////////
+
+
+/** Call CTypefaceStore::GetNearestFontInTwips() */
+void CT_DataTypefaceStore::DoCmdGetNearestFontInTwipsL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Call CTypefaceStore::GetNearestFontInTwips()"));
+
+	TFontSpec	fontSpec;
+	if ( !GetFontSpecFromConfig(aSection, KFont, fontSpec) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFont());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// call CTypefaceStore::GetNearestFontInTwips()
+		CFont*		font = NULL;
+		TInt		err = GetTypefaceStore()->GetNearestFontInTwips(font, fontSpec);
+
+		// check error code
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		else
+			{
+			// set font data object of provided
+			SetFontDataObjectIfPassedAsParameterL(font, aSection);
+			}
+		}
+	}
+
+
+/** Call CTypefaceStore::GetNearestFontToDesignHeightInTwips() */
+void CT_DataTypefaceStore::DoCmdGetNearestFontToDesignHeightInTwipsL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Call CTypefaceStore::GetNearestFontToDesignHeightInTwips()"));
+
+	TFontSpec	fontSpec;
+	if ( !GetFontSpecFromConfig(aSection, KFont, fontSpec) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFont());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// call CTypefaceStore::GetNearestFontToDesignHeightInTwips()
+		CFont*		font = NULL;
+		TInt		err = GetTypefaceStore()->GetNearestFontToDesignHeightInTwips(font, fontSpec);
+
+		// check error code
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		else
+			{
+			// set font data object of provided
+			SetFontDataObjectIfPassedAsParameterL(font, aSection);
+			}
+		}
+	}
+
+
+/** Call CTypefaceStore::GetNearestFontToMaxHeightInTwips() */
+void CT_DataTypefaceStore::DoCmdGetNearestFontToMaxHeightInTwipsL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Call CTypefaceStore::GetNearestFontToMaxHeightInTwips()"));
+
+	TBool		dataOk=ETrue;
+
+	TFontSpec	fontSpec;
+	if ( !GetFontSpecFromConfig(aSection, KFont, fontSpec) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFont());
+		SetBlockResult(EFail);
+		}
+
+	// get font maximum height from parameters
+	TInt	fontMaxHeight;
+	if(!GetIntFromConfig(aSection, KFontMaxHeight(), fontMaxHeight))
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFontMaxHeight());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		// call CTypefaceStore::GetNearestFontToMaxHeightInTwips()
+		CFont*		font = NULL;
+		TInt		err = GetTypefaceStore()->GetNearestFontToMaxHeightInTwips(font, fontSpec, fontMaxHeight);
+
+		// check error code
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(_L("Get nearest font to max height in twips error: %d"), err);
+			SetError(err);
+			}
+		else
+			{
+			// set font data object of provided
+			SetFontDataObjectIfPassedAsParameterL(font, aSection);
+
+			// check that the height of the returned font is not greater that the maximum specified
+			TFontSpec	fontSpecInTwips = font->FontSpecInTwips();
+			TInt		actualHeight = fontSpecInTwips.iHeight;
+			if (actualHeight > fontMaxHeight)
+				{
+				ERR_PRINTF3(_L("Font doesn't match in maximum specified, height: %d, maximum: %d"), actualHeight, fontMaxHeight);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+
+/** Call CTypefaceStore::NumTypefaces() */
+void CT_DataTypefaceStore::DoCmdNumTypefaces(const TDesC& aSection)
+	{
+	TInt	actual=GetTypefaceStore()->NumTypefaces();
+	INFO_PRINTF2(_L("Call CTypefaceStore::NumTypefaces() %d"), actual);
+	TInt	expected;
+	if ( GetIntFromConfig(aSection, KTypefaces(), expected) )
+		{
+		if (  actual != expected )
+			{
+			ERR_PRINTF3(_L("Actual typfaces %d does not match expected %d"), actual, expected);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** Call CTypefaceStore::TypefaceSupport() for the given index */
+void CT_DataTypefaceStore::DoCmdTypefaceSupport(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Call CTypefaceStore::TypefaceSupport() for the given index"));
+	// get typeface index from parameters
+	TInt	typefaceIndex;
+	if(!GetIntFromConfig(aSection, KTypefaceIndex(), typefaceIndex))
+		{
+		ERR_PRINTF2(_L("No %S"), &KTypefaceIndex());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// call TypefaceSupport()
+		TTypefaceSupport	typefaceSupport;
+		GetTypefaceStore()->TypefaceSupport(typefaceSupport, typefaceIndex);
+		INFO_PRINTF2(_L("iIsScalable       %d"), typefaceSupport.iIsScalable);
+		INFO_PRINTF2(_L("iMaxHeightInTwips %d"), typefaceSupport.iMaxHeightInTwips);
+		INFO_PRINTF2(_L("iMinHeightInTwips %d"), typefaceSupport.iMinHeightInTwips);
+		INFO_PRINTF2(_L("iNumHeights       %d"), typefaceSupport.iNumHeights);
+		}
+	}
+
+
+/** Call CTypefaceStore::FontHeightInTwips() */
+void CT_DataTypefaceStore::DoCmdFontHeightInTwips(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Call CTypefaceStore::FontHeightInTwips()"));
+	TBool								dataOk=ETrue;
+
+	// get typeface index from parameters
+	TInt	typefaceIndex;
+	if(!GetIntFromConfig(aSection, KTypefaceIndex(), typefaceIndex))
+		{
+		ERR_PRINTF2(_L("No %S"), &KTypefaceIndex());
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+
+	// get height index from parameters
+	TInt	heightIndex;
+	if(!GetIntFromConfig(aSection, KHeightIndex(), heightIndex))
+		{
+		ERR_PRINTF2(_L("No %S"), &KHeightIndex());
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+
+	if ( dataOk )
+		{
+		TInt	typefaceHeight = GetTypefaceStore()->FontHeightInTwips(typefaceIndex, heightIndex);
+		INFO_PRINTF2(_L("Typeface height %d"), typefaceHeight);
+
+		// get positive height check flag from parameters
+		TBool	checkHeightPositive = EFalse;
+		GetBoolFromConfig(aSection, KCheckHeightPositive(), checkHeightPositive);
+
+		// check that typeface height is positive
+		if ( checkHeightPositive && (typefaceHeight<=0) )
+			{
+			ERR_PRINTF2(_L("Typeface height is not greater than 0, height: %d"), typefaceHeight);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+/** CTypefaceStore::ReleaseFont() call */
+void CT_DataTypefaceStore::DoCmdReleaseFontL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("CTypefaceStore::ReleaseFont() call"));
+
+	CT_DataFont*	fontDataObject=GetFontDataObjectFromParameterL(KFontDataObjectName(), aSection);
+
+	if (fontDataObject == NULL)
+		{
+		ERR_PRINTF1(_L("Font data wrapper was not found"));
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		GetTypefaceStore()->ReleaseFont(static_cast<CFont*>(fontDataObject->GetObject()));
+		}
+	}
+
+
+///////////////////////////////// UTIL METHODS //////////////////////////////////////
+
+
+/**
+* Utility method that sets CT_DataFont with a new font if the name of the data object was passed as a parameter from INI-file.
+*/
+void CT_DataTypefaceStore::SetFontDataObjectIfPassedAsParameterL(CFont* aFont, const TDesC& aSection)
+	{
+	// fetch data object
+	CT_DataFont*	fontDataObject = GetFontDataObjectFromParameterL(KFontDataObjectName(), aSection);
+	if ( fontDataObject != NULL )
+		{
+		// set obtained font for the data object
+		fontDataObject->SetObjectL(aFont);
+		}
+	}
+
+
+/**
+* Utility method that fetches CT_DataFont pointer by command parameter name from INI-file.
+*/
+CT_DataFont* CT_DataTypefaceStore::GetFontDataObjectFromParameterL(const TDesC& aParameterName, const TDesC& aSection)
+	{
+	CT_DataFont*	ret = NULL;
+
+	// get FontData object from parameters
+	TPtrC	fontDataObjectName;
+	if ( GetStringFromConfig(aSection, aParameterName, fontDataObjectName) )
+		{
+		// check that the data object was found
+		ret = static_cast<CT_DataFont*>(GetDataWrapperL(fontDataObjectName));
+		}
+
+	return ret;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/AnimPlugin/group/T_AnimPlugin.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,44 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+TARGET		  t_animplugin.dll
+TARGETTYPE	  ANI
+UID 268450594 0x100048F2
+
+USERINCLUDE	 ../inc
+SYSTEMINCLUDE   /epoc32/include
+
+
+
+//By default, the build tools look for the WINSCW def file in a BWINS directory
+//(at the same level as the directory containing the mmp file), 
+//the GCC ARM def file in a BMARM directory, and the ARMV5 def file in a EABI directory. 
+//If def files are stored in these locations, the project files does not need to specify
+//the location of the def files explicitly. If you want to store the def files in some other 
+//location, you will need to specify in the project file where the .def files are using 
+//the deffile keyword.
+
+
+LIBRARY euser.lib efsrv.lib bitgdi.lib bafl.lib gdi.lib
+
+
+SOURCEPATH ../src
+SOURCE T_TestAnimDll.cpp T_TWinAnim.cpp T_log.cpp T_AnimProc.cpp T_TSpriteAnim.cpp T_TFreeTimerWinAnim.cpp
+
+NOEXPORTLIBRARY
+NOSTRICTDEF
+
+CAPABILITY PowerMgmt ProtServ ReadDeviceData WriteDeviceData
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/AnimPlugin/group/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,23 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+T_AnimPlugin.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/AnimPlugin/inc/T_AnimDef.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef ANIMDEF_H_
+#define ANIMDEF_H_
+
+
+//Anim type
+#define EKWindowAnim 			1
+#define EKSpriteAnim          	2
+#define EKFreeTimerWindowAnim 	3
+
+
+//command for RAnim::Command
+#define ECmdSync   	    		1
+
+#define ECmdTestWithoutPara    	100
+#define ECmdTestWithPara    	101
+#define ECmdGetLast    	    	102
+#define ECmdGetAnimInterval     103
+
+enum TCommandsForAnimMClass
+	{
+	ECmdNone = 150,
+	ECmdRetrieveResult,
+	ECmdGeneralAnimate,
+	ECmdGeneralSetSync,
+	ECmdGeneralSync,
+	ECmdGeneralSystemTime,
+	ECmdGeneralSetInterval,
+	ECmdGeneralSetNextInterval,
+	ECmdGeneralClient,
+	ECmdGeneralScreenDevice,
+	ECmdGeneralEventExtension,
+	ECmdGeneralWindowExtension,
+	ECmdGeneralExtendedInterface,
+	ECmdGeneralNumOfExtInterfaces,
+	ECmdGeneralPanic,
+	ECmdGeneralReplyBuf,
+	ECmdGeneralFlashStateOn,
+	ECmdGeneralDuplicateBitmapL,
+	ECmdGeneralDuplicateFontL,
+	ECmdGeneralCloseFont,
+	ECmdGeneralGetRawEvents,
+	ECmdGeneralPostKeyEvent,
+	ECmdGeneralPostRawEvent,
+	ECmdGeneralMessage,
+	ECmdGeneralRegisterForNotis,
+	ECmdSpriteGetSpriteMember,
+	ECmdSpriteUpdateMember,
+	ECmdSpriteActivate, 
+	ECmdSpriteSpriteCanBeSeen,
+	ECmdSpriteSizeChangedL,
+	ECmdSpriteSetPosition,
+	ECmdGfweFocusScreens,
+	ECmdGfweScreens,
+	ECmdGfweSetFocusScreen,
+	ECmdGfweSetOrdinalPosition,
+	ECmdGfweWindowGroupInfo,
+	ECmdGfweWindowGroupName,
+	ECmdGfweWindowGroups,
+	ECmdGfweIsFocusable,
+	ECmdWindowActivateGc,
+	ECmdWindowInvalidate,
+	ECmdWindowParameters,
+	ECmdWindowIsHidden,
+	ECmdWindowSetRect,
+	ECmdWindowSetVisible,
+	ECmdWindowVisibleRegion,
+	ECmdWindowWindowSize,
+	ECmdFreeTimerWinDeactivateGc,
+	ECmdFreeTimerWinUpdate,
+	ECmdWindowIsStarted,
+	ECmdReceiveResult,
+	ECmdGeneralReplyBuf8,
+	ECmdGeneralReplyBuf16,
+	
+	ECmdUtilEatupMemory,
+	ECmdUtilFreeEatenMemory
+};
+
+#endif /*ANIMDEF_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/AnimPlugin/inc/T_AnimProc.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,92 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+// 
+// Description:
+//
+
+#ifndef ANIMPROC_H
+#define ANIMPROC_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include "T_TestAnimDll.h"
+#include "badesca.h" 
+#include "e32cmn.h" 
+
+// CLASS DECLARATION
+#define KAnimTimeSize 3
+
+
+
+typedef RArray<TInt> RIntArray;
+
+/**
+*  CAnimProc
+* 
+*/
+class CAnimProc 
+{
+public: // Constructors and destructor
+
+	CAnimProc(CTestAnimDll* aDll,TInt aType);
+	virtual ~CAnimProc();	
+
+	TInt CmdReply(MAnimGeneralFunctions* pFunc, TInt aOpcode, TAny *aArgs);
+
+	
+	TInt ConstructWinL(TAny *aArgs,MAnimGeneralFunctions* pFunc);
+	
+	TInt WriteLog(const TDesC& aInfo);
+	TInt WriteLog(const TDesC8& aInfo);
+protected:
+
+	CDesCArray* ProcParamLC(const TDesC8& param);
+	void ConvertParam(TDes8& buf,TAny *aArgs);
+	TInt GetIntFromStr(const TDesC& str,RIntArray& ary);
+	
+	void RecordAnimTime();
+	
+	void RecordLastCmd(TInt cmd);
+	void RecordLastCmd(TInt cmd,const TDesC8& str);
+	void RecordLastCmd(const TDesC8& str);
+	
+	TInt64 iAnimTime[KAnimTimeSize];  	// last time of Animate 
+
+	
+	TPoint iNewPoint;		// The square's current position
+	TPoint iLastPoint;		// The square's last position	
+	
+	TInt iStepX;			// move step of x-coordinate
+	TInt iStepY;			// move step of y-coordinate    
+     
+    TSize iSize;			// The square's size   
+    
+    TRect iScreenSize;		// The screen size
+    
+    TInt iDrawType;			// draw type
+    
+    TSize iPenSize;			// pen size
+    
+    TBool iDrawn;			// Has the animation been drawn
+    
+    TRgb iColor;			// draw color
+    
+	CTestAnimDll* iDll;		// anim dll
+	
+	RBuf iLastCommand; 		// store last command & parameter
+	
+	TInt iAnimType;			// animation type
+};
+
+#endif // ANIMPROC_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/AnimPlugin/inc/T_TFreeTimerWinAnim.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef CFREETIMERWINANIM_H
+#define CFREETIMERWINANIM_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include <w32adll.h>
+// CLASS DECLARATION
+
+/**
+ * CTFreeTimerWinAnim
+ *
+ */
+class CTFreeTimerWinAnim : public CFreeTimerWindowAnim
+	{
+public:
+	CTFreeTimerWinAnim();
+	~CTFreeTimerWinAnim();
+
+	//from CAnim
+	virtual TInt CommandReplyL(TInt aOpcode, TAny *aArgs);
+	virtual void Command(TInt aOpcode, TAny *aArgs);
+	virtual void Animate(TDateTime *aDateTime);
+	//from MEventHandler
+	virtual TBool OfferRawEvent(const TRawEvent &aRawEvent);
+	//from CWindowAnim
+	virtual void ConstructL(TAny *aArgs, TBool aHasFocus);
+	virtual void Redraw();
+	virtual void FocusChanged(TBool aState);
+	
+private:
+	TBool iResult;
+	TInt iCurrentCommand;
+	TRect iScreenSize;		// The screen size
+	}; // class CTFreeTimerWinAnim
+
+#endif // CFREETIMERWINANIM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/AnimPlugin/inc/T_TSpriteAnim.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,77 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+// 
+// Description:
+//
+
+#ifndef SPRITEANIM_H
+#define SPRITEANIM_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include "w32adll.h" 
+#include "w32std.h" 
+
+
+
+
+// CLASS DECLARATION
+
+/**
+*  CWinAnim
+* 
+*/
+
+class CTestAnimDll;
+class CAnimProc;
+
+class CTSpriteAnim: public CSpriteAnim, CAnimProc
+{
+public: // Constructors and destructor
+
+	/**
+		* Destructor.
+		*/
+	~CTSpriteAnim();
+
+	/**
+		* Constructor for performing 1st stage construction
+		*/
+	CTSpriteAnim(CTestAnimDll* aDll, TInt aType);
+	
+	virtual void ConstructL(TAny *aArgs);
+	virtual void Redraw();
+	virtual void FocusChanged(TBool aState);
+	virtual TInt CommandReplyL(TInt aOpcode, TAny *aArgs);
+	virtual void Command(TInt aOpcode, TAny *aArgs);
+	virtual void Animate(TDateTime *aDateTime);
+	virtual TBool OfferRawEvent(const TRawEvent &aRawEvent);
+
+private:
+	void Draw();
+	void Compare();
+	
+	TInt DoCmdGetSpriteMemberL();
+	TInt DoCmdActiveL();
+	TInt DoCmdSetPositionL();
+	TInt DoCmdSpriteCanBeSeen();
+	TInt DoCmdUpdateMemberL();
+	TInt DoCmdSizeChangeL();
+	
+protected:	
+   
+
+};
+
+#endif // WINANIM_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/AnimPlugin/inc/T_TWinAnim.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,172 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+// 
+// Description:
+//
+
+#ifndef WINANIM_H
+#define WINANIM_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include "w32adll.h" 
+#include "w32std.h" 
+#include "T_AnimProc.h"
+
+
+// CLASS DECLARATION
+
+/**
+*  MTimeoutNotify 
+* 
+*/
+class MTimeoutNotify 
+    {
+    public:
+
+		/**
+		* TimedOut
+		* Handle the event when a time out occurs.
+		*/
+        virtual void TimedOut() = 0;
+    };
+
+/**
+* CTimeOutTimer
+*/
+class CTimeOutTimer : public CTimer
+    {
+    public: // Constructors and destructor
+       
+        static CTimeOutTimer* NewL( const TInt aPriority, 
+                                    MTimeoutNotify& aTimeOutNotify );
+        virtual ~CTimeOutTimer();
+
+    public: // From CTimer
+        void RunL();
+
+    protected: // Constructor
+        CTimeOutTimer( const TInt aPriority, MTimeoutNotify& aTimeOutNotify );
+
+    protected: // Constructor
+        void ConstructL();
+
+    private:
+        MTimeoutNotify& iNotify;
+    };
+
+/**
+*  CWinAnim
+* 
+*/
+
+const TInt KBufMessage = 200;
+
+class CTestAnimDll;
+
+class CTWinAnim : public CWindowAnim, CAnimProc , public MTimeoutNotify
+{
+public: // Constructors and destructor
+
+	/**
+		* Destructor.
+		*/
+	~CTWinAnim();
+
+	/**
+		* Constructor for performing 1st stage construction
+		*/
+	CTWinAnim(CTestAnimDll* aDll, TInt aType);
+	
+	virtual void ConstructL(TAny *aArgs, TBool aHasFocus);
+	virtual void Redraw();
+	virtual void FocusChanged(TBool aState);
+	virtual TInt CommandReplyL(TInt aOpcode, TAny *aArgs);
+	virtual void Command(TInt aOpcode, TAny *aArgs);
+	virtual void Animate(TDateTime *aDateTime);
+	virtual TBool OfferRawEvent(const TRawEvent &aRawEvent);
+	virtual void HandleNotification(const TWsEvent &aEvent);
+public:
+	virtual void TimedOut();
+	
+private:
+	void Draw();
+	void Compare();
+
+//for M class testing	
+private:
+	//for MAnimWindowFunctions
+	TInt DoCmdSetRect();
+	TInt DoCmdWindowSize();
+	TInt DoCmdSetVisible();
+	TInt DoCmdInvalidate();
+	TInt DoCmdParameters();
+	TInt DoCmdVisibleRegion();
+	//for MAnimGeneralFunctionsWindowExtension
+	TInt DoCmdSetFocusScreen();
+	TInt DoCmdWindowGroups();
+	TBool DoCmdWindowGroupInfo();
+	TBool DoCmdWindowGroupName();
+	TInt DoCmdSetOrdinalPosition();
+	TBool DoCmdIsFocusable();
+	//for MAnimGeneralFunctions
+	TInt DoCmdDuplicateBitmapL();
+	TInt DoCmdDuplicateFontL();
+	TInt DoCmdCloseFontL();
+	TInt DoCmdSetIntervalL();
+	TInt DoCmdSetNextIntervalL();
+	TInt DoCmdSystemTimeL();
+	TInt DoCmdRegisterForNotisL();
+	TInt DoCmdMessageL();
+	TInt DoCmdAnimateL();
+	TInt DoCmdFlashStateOn();
+	TInt DoCmdPanic();
+	TInt DoCmdScreenDevice();
+	TInt DoCmdWindowExtension();
+	TInt DoCmdEventExtension();
+	TInt DoCmdExtendedInterfaceL();
+	TInt DoCmdNumOfExtInterfaces();
+	TInt DoCmdSetSyncL();
+	TInt DoCmdSync();
+	TInt DoCmdGetRawEventsL();
+	TInt DoCmdPostRawEventL();
+	TInt DoCmdPostKeyEventL();
+	TInt DoCmdClient();
+	TInt DoCmdGeneralReplyBuf8L();
+	TInt DoCmdGeneralReplyBuf16L();
+	
+	//Util
+	TInt DoCmdEatupMemory();
+	TInt DoCmdFreeEatenMemory();
+	void FreeMemory();
+	
+private:
+	CTimeOutTimer* iServerTimer;
+	MAnimGeneralFunctions::TAnimSync iSyncMode;
+	TInt iCurrentCommand;
+	CFbsBitmap* iDuplicateBitmap;
+	CFbsFont* iDuplicateFont;
+	TDateTime iDateTime;
+	TInt iResult;
+	TDateTime iAnimateTime;
+	TInt64* iIntervalTimeStamp;
+	TInt iInterval;
+	TInt iNextInterval;	
+	TEventCode iExpectEventCode;
+	TInt iAvaiableSpace;
+	TInt iBiggestBlock;
+	RPointerArray < TAny > iMemArray;
+};
+
+#endif // WINANIM_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/AnimPlugin/inc/T_TestAnimDll.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,74 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+// 
+// Description:
+//
+
+#ifndef TESTANIMDLL_H
+#define TESTANIMDLL_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include "w32adll.h" 
+#include "T_log.h"
+
+// CLASS DECLARATION
+
+/**
+*  CTestAnimDll
+* 
+*/
+class CTestAnimDll : public CAnimDll
+{
+public: // Constructors and destructor
+
+	/**
+		* Destructor.
+		*/
+	~CTestAnimDll();
+
+		/**
+		* Two-phased constructor.
+		*/
+	static CTestAnimDll* NewL();
+
+		/**
+		* Two-phased constructor.
+		*/
+	static CTestAnimDll* NewLC();
+	
+	virtual CAnim *CreateInstanceL(TInt aType);
+	
+	TInt WriteLog(const TDesC& aInfo);
+	TInt WriteLog(const TDesC8& aInfo);
+	
+protected:
+	CLog* iLog;
+	RFs iFs;
+
+private:
+
+	/**
+		* Constructor for performing 1st stage construction
+		*/
+	CTestAnimDll();
+
+	/**
+		* EPOC default constructor for performing 2nd stage construction
+		*/
+	void ConstructL();
+
+};
+
+#endif // TESTANIMDLL_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/AnimPlugin/inc/T_log.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,47 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+// 
+// Description:
+//
+
+#ifndef LOG_H_
+#define LOG_H_
+
+#include <e32std.h>
+#include <e32base.h>
+#include <f32file.h>
+
+
+class CLog : public CBase
+{
+public: // Constructors and destructor
+	~CLog();
+	static CLog* NewL(RFs &aFs, const TDesC &aFileName);
+	static CLog* NewLC(RFs &aFs, const TDesC &aFileName);
+
+	//write log 
+	TInt WriteLog(const TDesC& aInfo);
+	TInt WriteLog(const TDesC8& aInfo);
+private:
+	//Constructor for performing 1st stage construction
+	CLog();	
+	
+	//EPOC default constructor for performing 2nd stage construction
+	void ConstructL(RFs &aFs, const TDesC &aFileName);
+
+	RFile iFile;	//log file object
+	TFileText iText;
+	RBuf8 iBuf;	
+};
+
+
+#endif /*LOG_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/AnimPlugin/src/T_AnimProc.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,429 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+// 
+// Description:
+//
+
+#include "T_AnimProc.h"
+#include "T_AnimDef.h"
+
+#define KMaxBufSize 250
+
+_LIT(KLim1,";");
+_LIT(KLim2,",");
+
+_LIT8(KSyncSecond,"ESyncSecond");
+_LIT8(KSyncMinute,"ESyncMinute");
+_LIT8(KSyncFlash,"ESyncFlash");
+_LIT8(KSyncNone,"ESyncNone");
+
+
+CAnimProc::CAnimProc(CTestAnimDll* aDll,TInt aType)
+	{
+	for (TInt i=0;i<KAnimTimeSize;i++)
+		iAnimTime[i]=0;
+
+	iNewPoint.SetXY (0, 0);
+	iLastPoint.SetXY (0, 0);
+
+	iStepX=0;
+	iStepY=0;
+	iDll=aDll;
+	
+	iAnimType=aType;
+
+	}
+
+
+CAnimProc::~CAnimProc()
+	{
+	iLastCommand.Close();
+	}
+TInt CAnimProc::WriteLog(const TDesC& aInfo)
+	{
+	return iDll->WriteLog(aInfo);
+	}
+TInt CAnimProc::WriteLog(const TDesC8& aInfo)
+	{
+	return iDll->WriteLog(aInfo);
+	}
+
+
+
+void CAnimProc::ConvertParam(TDes8& buf, TAny *aArgs)
+	{
+	if ( aArgs)
+		{
+		buf.Zero();
+
+		TUint8* p=STATIC_CAST(TUint8*,aArgs);
+		TInt len=p[0];
+
+		if ( len>0)
+			buf.Copy (p+1, len);
+		}
+	}
+
+void CAnimProc::RecordLastCmd(TInt cmd)
+	{
+	iLastCommand.Format(_L("%d"),cmd);
+	}
+void CAnimProc::RecordLastCmd(TInt cmd,const TDesC8& str)
+	{
+	TBuf<KMaxBufSize> buf;
+	buf.Copy(str);
+	iLastCommand.Format(_L("%d %S"),cmd,&buf);
+	}
+void CAnimProc::RecordLastCmd(const TDesC8& str)
+	{
+	iLastCommand.Copy(str);
+	}
+TInt CAnimProc::CmdReply(MAnimGeneralFunctions* pFunc , TInt aOpcode,
+		TAny *aArgs)
+	{
+	TBuf<KMaxBufSize> logbuf;
+	TBuf<KMaxBufSize> msgbuf;
+	logbuf.Format (_L("CAnimProc::CmdReplyL %d"),aOpcode);
+	WriteLog(logbuf);
+	
+	TBuf8<KMaxBufSize> arg;		
+			
+	TInt ret,slot;
+	TBool msgexist=EFalse,argexist=ETrue,userpanic=EFalse;
+	
+	// check is msg exist
+	const RMessagePtr2 *msg=pFunc->Message();
+	if ( msg && !msg->IsNull())
+		{
+		for (TInt i=1;i<4;i++)
+			{
+			ret=msg->Read (i, msgbuf);
+			if ( ret==KErrNone)
+				{
+				slot=i;
+				msgexist=ETrue;
+				break;
+				}
+			}
+		}	
+
+	switch (aOpcode)
+		{		
+		case ECmdTestWithoutPara:
+			{	
+			argexist=EFalse;			
+			if (msgexist)	
+				{
+				RecordLastCmd (aOpcode);				
+				ret=msg->Write(slot,iLastCommand);	
+				// this function should only used for AsyncCommandReply, otherwise emulator will crash.
+				msg->Complete(KErrNone); 
+				}
+			break;
+			}
+		case ECmdTestWithPara:
+			{		
+			ConvertParam(arg, aArgs);
+			WriteLog(arg);		
+			if (msgexist)	
+				{
+				RecordLastCmd (aOpcode, arg);				
+				msg->Write(slot,iLastCommand);	
+				}
+			break;
+			}
+		case ECmdGetLast:
+			{
+			argexist=EFalse;
+			if (msgexist)	
+				{				
+				logbuf.Format (_L("send last command %S"),&iLastCommand);
+				WriteLog(logbuf);
+				msg->Write(slot,iLastCommand);	
+				}
+			else
+				userpanic=ETrue;				
+			break;
+			}
+		case ECmdSync:
+			{
+			ConvertParam(arg, aArgs);
+			WriteLog(arg);			
+			MAnimGeneralFunctions::TAnimSync sync;
+			if (arg.Compare(KSyncSecond)==0)
+				sync=MAnimGeneralFunctions::ESyncSecond;
+			else if (arg.Compare(KSyncNone)==0)
+				sync=MAnimGeneralFunctions::ESyncNone;
+			else if (arg.Compare(KSyncFlash)==0)
+				sync=MAnimGeneralFunctions::ESyncFlash;
+			else if (arg.Compare(KSyncMinute)==0)
+				sync=MAnimGeneralFunctions::ESyncMinute;
+			else
+				{
+				userpanic=ETrue;
+				break;
+				}
+
+			pFunc->SetSync(sync);
+			break;
+			}
+		case ECmdGetAnimInterval:
+			{
+			argexist=EFalse;	
+			if (msgexist)
+				{
+					TInt i1,i2;
+					i1=(iAnimTime[1]-iAnimTime[0])/1000;
+					i2=(iAnimTime[2]-iAnimTime[1])/1000;
+					if (i1>i2)
+						{
+						TInt tmp;
+						tmp=i1;
+						i1=i2;
+						i2=tmp;
+						}
+					msgbuf.Format(_L("%d %d"),i1,i2);
+					msg->Write(slot,msgbuf);	
+				}
+			else
+				userpanic=ETrue;
+			break;
+			}		
+		default:		
+			{
+			userpanic=ETrue;
+			break;
+			}	
+		}
+	
+	if ( userpanic)
+		pFunc->Panic ();
+	else
+		{
+		if ( argexist)
+			RecordLastCmd (aOpcode, arg);
+		else
+			RecordLastCmd (aOpcode);
+		
+
+		}
+	return KErrNone ;
+	}
+
+CDesCArray* CAnimProc::ProcParamLC(const TDesC8& param)
+	{		
+	CDesCArrayFlat * ary= new (ELeave)  CDesCArrayFlat(2);   
+	CleanupStack::PushL(ary);
+	if ( param.Length ()>0)
+		{
+		TBuf<KMaxBufSize> buf;
+		TBuf<KMaxBufSize> tmp;
+		buf.Copy(param);
+
+		TInt idx;
+
+		do
+			{
+			idx=buf.Find(KLim1);
+			if (idx!=KErrNotFound )
+				{
+				
+				tmp.Copy(buf.Ptr(),idx);
+				ary->AppendL(tmp);					
+				buf.Delete(0,idx+1);
+				}
+			}
+
+		while (idx!=KErrNotFound);
+		
+		if (buf.Length()>0)
+			ary->AppendL(buf);	
+		}
+	return ary;
+	}
+TInt CAnimProc::GetIntFromStr(const TDesC& str,RIntArray& ary)
+	{	
+	ary.Reset();
+	TInt val;
+	
+	if ( str.Length ()>0)
+		{
+		TBuf<KMaxBufSize> buf;
+		TBuf<KMaxBufSize> tmp;
+		buf.Copy(str);
+
+		TInt idx;
+		do
+			{
+			idx=buf.Find(KLim2);
+			if (idx!=KErrNotFound )
+				{
+				
+				tmp.Copy(buf.Ptr(),idx);
+				TLex lex(tmp);
+				lex.Val(val);
+				ary.Append(val);
+				buf.Delete(0,idx+1);
+				}
+			}
+
+		while (idx!=KErrNotFound);
+		
+		if (buf.Length()>0)
+			{
+			TLex lex(buf);
+			lex.Val(val);
+			ary.Append(val);	
+			}
+		}	
+
+	return KErrNone;
+	}
+void CAnimProc::RecordAnimTime()
+	{	
+	TTime currentTime;
+	currentTime.HomeTime();	
+	
+	for (TInt i=0;i<KAnimTimeSize-1;i++)
+		iAnimTime[i]=iAnimTime[i+1];
+	
+	iAnimTime[KAnimTimeSize-1]=currentTime.Int64();	
+	}
+TInt CAnimProc::ConstructWinL(TAny *aArgs,MAnimGeneralFunctions* pFunc)
+	{		
+	iLastCommand.CreateL(KMaxBufSize);
+	
+	TInt ret,val;	
+	
+	TBuf8<KMaxBufSize> param;
+	ConvertParam(param, aArgs);
+	WriteLog(param);
+	
+	RecordLastCmd(iAnimType,param);
+	
+	TBuf<KMaxBufSize> buf;
+	
+	CDesCArray* ary=ProcParamLC(param);
+	TInt len=ary->Count();
+	
+	RIntArray intary;
+	CleanupClosePushL(intary);
+	
+	
+	for (TInt i=0;i<len;i++)
+		{
+		const TDesC& str=(*ary)[i];
+//		WriteLog (str);
+		switch (i)
+		{
+		case 0: //start point
+			{
+			GetIntFromStr(str,intary);
+			if (intary.Count()!=2)
+				ret=KErrArgument;
+			else
+				{
+				iLastPoint.SetXY( intary[0], intary[1] );
+			    iNewPoint.SetXY( intary[0], intary[1] );
+			    buf.Format(_L("start poinx x=%d y=%d"),iNewPoint.iX,iNewPoint.iY);
+			    WriteLog (buf);
+				}
+			break;
+			}
+		case 1: //step
+			{
+			GetIntFromStr(str,intary);
+			if (intary.Count()!=2)
+				ret=KErrArgument;
+			else
+				{
+				iStepX = intary[0];
+			    iStepY =intary[1];			  
+			    buf.Format(_L("step x=%d y=%d"),iStepX,iStepY);
+			    WriteLog (buf);
+				}
+			break;
+			}
+		case 2: //draw type
+			{
+			TLex lex(str);
+			lex.Val(val);
+			iDrawType=val;
+			buf.Format(_L("draw type=%d"),iDrawType);
+			WriteLog (buf);
+			break;
+			}			
+		case 3: //draw rect
+			{
+			GetIntFromStr(str,intary);
+			if (intary.Count()!=2)
+				ret=KErrArgument;
+			else
+				{
+				iSize.SetSize( intary[0], intary[1]);
+			    buf.Format(_L("draw rect width=%d height=%d"),iSize.iWidth,iSize.iHeight);
+			    WriteLog (buf);
+				}
+			break;
+			}
+		case 4: //pen color
+			{
+			GetIntFromStr(str,intary);
+			if (intary.Count()!=3)
+				ret=KErrArgument;
+			else
+				{
+				iColor.SetRed( intary[0]);
+				iColor.SetGreen( intary[1]);
+				iColor.SetBlue( intary[2]);
+			    buf.Format(_L("pen color r=%d g=%d b=%d"),iColor.Red(),iColor.Green(),iColor.Blue());
+			    WriteLog (buf);
+				}
+			break;
+			}
+		case 5: //pen size
+			{
+			GetIntFromStr(str,intary);
+			if (intary.Count()!=2)
+				ret=KErrArgument;
+			else
+				{
+				iPenSize.SetSize( intary[0], intary[1]);
+			    buf.Format(_L("pen size width=%d height=%d"),iPenSize.iWidth,iPenSize.iHeight);
+			    WriteLog (buf);
+				}
+			break;
+			}						
+		}
+		}
+	
+
+    // initiates an initial position update
+    iDrawn = ETrue;
+ 
+    CleanupStack::PopAndDestroy(&intary);	
+	CleanupStack::PopAndDestroy(ary);	
+	
+	const RMessagePtr2 *msg=pFunc->Message();
+	if ( msg && !msg->IsNull())
+		{
+		TBuf<KMaxBufSize> msgbuf;
+		ret=msg->Read (1, msgbuf);
+		if ( ret==KErrNone)
+			{
+			msg->Write(1,iLastCommand);	
+			}
+		}	
+	
+	return ret;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/AnimPlugin/src/T_TFreeTimerWinAnim.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,112 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_AnimDef.h"
+
+#include "T_TFreeTimerWinAnim.h"
+
+CTFreeTimerWinAnim::CTFreeTimerWinAnim()
+	{
+	iResult=EFalse;
+	iCurrentCommand=ECmdNone;
+	}
+
+CTFreeTimerWinAnim::~CTFreeTimerWinAnim()
+	{
+	}
+
+//from CWindowAnim
+void CTFreeTimerWinAnim::ConstructL(TAny */*aArgs*/, TBool /*aHasFocus*/)
+	{
+	 // Store the screen size
+	 iScreenSize = iWindowFunctions->WindowSize();
+	    
+	 // Set the screen visible
+	 iWindowFunctions->SetVisible( ETrue );	
+	 //just for start heartbeat
+	 iWindowFunctions->SetRect(TRect(0,0,1,1));
+	}
+
+void CTFreeTimerWinAnim::Redraw()
+	{	
+	if(iCurrentCommand==ECmdFreeTimerWinUpdate)
+		{
+		iResult=ETrue;
+		}
+	}
+
+void CTFreeTimerWinAnim::FocusChanged(TBool /*aState*/)
+	{
+	
+	}
+
+//from CAnim
+TInt CTFreeTimerWinAnim::CommandReplyL(TInt aOpcode, TAny */*aArgs*/)
+	{
+	iCurrentCommand=aOpcode;
+	TInt nReturn=KErrNone;
+	switch(aOpcode)
+		{
+		case ECmdFreeTimerWinDeactivateGc:
+			{
+			TRect rect(10,10,20,20);
+			TInt err;
+			iWindowFunctions->ActivateGc();
+			TRAP(err,iGc->DrawRect(rect));
+			if(KErrNone == err)
+				{
+				WindowFunctions()->DeactivateGc();
+				TRAP(err,iGc->DrawRect(rect));	
+				if(KErrGeneral != err)
+					{
+					nReturn = err;
+					}
+				}
+			else
+				{
+				nReturn = err;
+				}
+			}
+			break;
+		case ECmdFreeTimerWinUpdate:
+			{
+			iResult=EFalse;
+			WindowFunctions()->Update();
+			}
+			break;
+		case ECmdRetrieveResult:
+			nReturn=iResult;
+			break;
+		}
+	return nReturn;
+	}
+
+void CTFreeTimerWinAnim::Command(TInt /*aOpcode*/, TAny */*aArgs*/)
+	{
+	
+	}
+void CTFreeTimerWinAnim::Animate(TDateTime */*aDateTime*/)
+	{
+	
+	}
+
+//from MEventHandler
+TBool CTFreeTimerWinAnim::OfferRawEvent(const TRawEvent &/*aRawEvent*/)
+	{
+	return EFalse;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/AnimPlugin/src/T_TSpriteAnim.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,241 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "txtfrmat.h" 
+#include "bitdev.h" 
+#include "T_AnimProc.h"
+#include "T_TSpriteAnim.h"
+#include "T_TestAnimDll.h"
+#include "w32std.h"
+#include "T_AnimDef.h"
+
+CTSpriteAnim::CTSpriteAnim(CTestAnimDll* aDll, TInt aType) :
+	CAnimProc(aDll, aType)
+	{
+	// No implementation required
+
+	}
+
+CTSpriteAnim::~CTSpriteAnim()
+	{
+	WriteLog(_L("~CTSpriteAnim"));
+	}
+
+void CTSpriteAnim::ConstructL(TAny *aArgs)
+	{
+	WriteLog(_L("CTSpriteAnim::ConstructL"));
+	ConstructWinL(aArgs, iFunctions);
+
+	// screen size
+	iFunctions->ScreenDevice()->GetDrawRect(iScreenSize);
+	}
+void CTSpriteAnim::Redraw()
+	{
+	WriteLog(_L("CTSpriteAnim::Redraw"));
+	Draw();
+	}
+
+void CTSpriteAnim::Draw()
+	{
+	// signal that the current position has been drawn
+	iDrawn = ETrue;
+	}
+void CTSpriteAnim::FocusChanged(TBool /*aState*/)
+	{
+
+	}
+TInt CTSpriteAnim::CommandReplyL(TInt aOpcode, TAny *aArgs)
+	{
+	switch (aOpcode)
+		{
+		case ECmdSpriteGetSpriteMember:
+			return DoCmdGetSpriteMemberL();
+		case ECmdSpriteUpdateMember:
+			return DoCmdUpdateMemberL();
+		case ECmdSpriteActivate:
+			return DoCmdActiveL();
+		case ECmdSpriteSpriteCanBeSeen:
+			return DoCmdSpriteCanBeSeen();
+		case ECmdSpriteSizeChangedL:
+			return DoCmdSizeChangeL();
+		case ECmdSpriteSetPosition:
+			return DoCmdSetPositionL();
+		default:
+			break;
+		}
+	return CmdReply(iFunctions, aOpcode, aArgs);
+	}
+void CTSpriteAnim::Command(TInt aOpcode, TAny *aArgs)
+	{
+	CmdReply(iFunctions, aOpcode, aArgs);
+	}
+void CTSpriteAnim::Animate(TDateTime* /*aDateTime*/)
+	{
+	iLastPoint = iNewPoint;
+
+	TInt nextpoint=iNewPoint.iX + iStepX;
+	TInt right=iNewPoint.iX + iSize.iWidth;
+
+	if (right> iScreenSize.iBr.iX ||nextpoint >= iScreenSize.iBr.iX
+			||iNewPoint.iX<iScreenSize.iTl.iX)
+		iStepX = -iStepX;
+
+	TInt nexty=iNewPoint.iY + iStepY;
+	TInt bottom=nexty + iSize.iHeight;
+
+	if (bottom> iScreenSize.iBr.iY ||nexty >= iScreenSize.iBr.iY ||iNewPoint.iY
+			<iScreenSize.iTl.iY || nexty <= iScreenSize.iTl.iY)
+		iStepY = -iStepY;
+
+	iNewPoint.iX += iStepX;
+	iNewPoint.iY += iStepY;
+
+	iSpriteFunctions->SetPosition(iNewPoint);
+
+	RecordAnimTime();
+
+	TInt interval=(iAnimTime[KAnimTimeSize-1]-iAnimTime[KAnimTimeSize-2])/1000;
+
+	TBuf<100> buf;
+	buf.Format(_L("CTSpriteAnim::Animate interval=%d x=%d y=%d"),
+	interval,iNewPoint.iX,iNewPoint.iY);
+
+	WriteLog(buf);
+	}
+
+void CTSpriteAnim::Compare()
+	{
+	// compare     	
+	const CFbsScreenDevice* scdev=iFunctions->ScreenDevice();
+
+	TBool compare=scdev->RectCompare(TRect(iNewPoint, iSize), *scdev, TRect(
+			TPoint(0, 0), iSize));
+	TBuf<50> buf;
+	buf.Format(_L("CTSpriteAnim::Compare res %d"),
+	compare);
+	WriteLog(buf);
+	}
+TBool CTSpriteAnim::OfferRawEvent(const TRawEvent& /*aRawEvent*/)
+	{
+	return ETrue;
+	}
+
+TInt CTSpriteAnim::DoCmdGetSpriteMemberL()
+	{
+	TInt result = 0;
+	TInt aMember;
+	TPtr8 ptr1((TUint8*)&aMember, sizeof(TInt));
+	const RMessagePtr2 *msg=iFunctions->Message();
+	
+	if(msg && !msg->IsNull())
+		{
+		msg->ReadL(1,ptr1);
+		TSpriteMember* member = iSpriteFunctions->GetSpriteMember(aMember);
+		TPoint point = member->iOffset;
+		TPtr8 ptr2((TUint8*)&point, sizeof(TPoint), sizeof(TPoint));
+		msg->Write(2, ptr2);
+		
+		}
+	else
+		{
+		result = -1;
+		}
+	return result;
+	
+	}
+
+TInt CTSpriteAnim::DoCmdActiveL()
+	{
+	TInt result = 0;
+	TBool aState;
+	TPtr8 ptr3((TUint8*)&aState, sizeof(TBool));
+	const RMessagePtr2 *msg=iFunctions->Message();
+		
+	if(msg && !msg->IsNull())
+		{
+		msg->ReadL(1,ptr3);
+		iSpriteFunctions->Activate(aState);
+		}
+	else
+		{
+		result = -1;
+		}
+	return result;
+	}
+
+TInt CTSpriteAnim::DoCmdSetPositionL()
+	{
+	TInt result = 0;
+	TPoint aPoint;
+	TPtr8 ptr6((TUint8*)&aPoint, sizeof(TPoint));
+	const RMessagePtr2 *msg=iFunctions->Message();
+		
+	if(msg && !msg->IsNull())
+		{
+		msg->ReadL(1,ptr6);
+		iSpriteFunctions->SetPosition(aPoint);
+		}	
+	else
+		{
+		result = -1;		
+		}
+	return result;
+	}
+
+TInt CTSpriteAnim::DoCmdSpriteCanBeSeen()
+	{
+	TBool visible = iSpriteFunctions->SpriteCanBeSeen();
+	TPtr8 ptr((TUint8*)&visible, sizeof(TBool), sizeof(TBool));
+	iFunctions->Message()->Write(1, ptr);
+	return 0;
+	}
+
+TInt CTSpriteAnim::DoCmdUpdateMemberL()
+	{
+	//TInt aMember, const TRect &aRect, TBool aFullUpdate
+	TInt result = 0;
+	TInt aMember;
+	TPtr8 ptr1((TUint8*)&aMember, sizeof(TInt));
+
+	TRect aRect;
+	TPtr8 ptr2((TUint8*)&aRect, sizeof(TRect));
+	
+	TBool aFullUpdate;
+	TPtr8 ptr3((TUint8*)&aFullUpdate, sizeof(TInt));
+
+	const RMessagePtr2 *msg=iFunctions->Message();
+		
+	if(msg && !msg->IsNull())
+		{
+		msg->ReadL(1,ptr1);
+		msg->ReadL(2,ptr2);
+		msg->ReadL(3,ptr3);
+		iSpriteFunctions->UpdateMember(aMember, aRect, aFullUpdate);
+		}	
+	else
+		{
+		result = -1;
+		}
+	return result;
+	}
+
+TInt CTSpriteAnim::DoCmdSizeChangeL()
+	{
+	iSpriteFunctions->SizeChangedL();
+	return 0;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/AnimPlugin/src/T_TWinAnim.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1234 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+// 
+// Description:
+//
+
+#include "T_TWinAnim.h"
+#include "T_TestAnimDll.h"
+#include "txtfrmat.h" 
+#include "bitdev.h" 
+#include "T_AnimDef.h"
+#include "w32adll.h" 
+
+// Implementation of CTimeoutTimer.
+CTimeOutTimer::CTimeOutTimer(const TInt aPriority,
+		MTimeoutNotify& aTimeOutNotify) :
+	CTimer(aPriority), iNotify(aTimeOutNotify)
+	{
+	// No implementation required
+	}
+
+CTimeOutTimer* CTimeOutTimer::NewL(const TInt aPriority, 
+		MTimeoutNotify& aTimeOutNotify)
+	{
+	CTimeOutTimer *self = new ( ELeave ) CTimeOutTimer( aPriority, aTimeOutNotify );
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop();
+	return self;
+	}
+
+CTimeOutTimer::~CTimeOutTimer()
+	{
+	Cancel();
+	}
+
+void CTimeOutTimer::ConstructL()
+	{
+	CTimer::ConstructL();
+	CActiveScheduler::Add( this);
+	}
+
+void CTimeOutTimer::RunL()
+	{
+	iNotify.TimedOut();
+	}
+
+//Implementation of CTWinAnim
+CTWinAnim::CTWinAnim(CTestAnimDll* aDll, TInt aType) :
+	CAnimProc(aDll, aType)
+	{
+	// No implementation required
+	}
+
+CTWinAnim::~CTWinAnim()
+	{
+	WriteLog(_L("~CTWinAnim"));
+	if (iServerTimer)
+		{
+		iServerTimer->Cancel();
+		}
+
+	// Then delete the timer object
+	delete iServerTimer;
+	iServerTimer = NULL;
+
+	if (iIntervalTimeStamp)
+		delete [] iIntervalTimeStamp;
+
+	if (iDuplicateBitmap)
+		delete iDuplicateBitmap;
+
+	if (iMemArray.Count() > 0)
+		FreeMemory();
+	}
+
+void CTWinAnim::ConstructL(TAny *aArgs, TBool /*aHasFocus*/)
+	{
+	WriteLog(_L("CTWinAnim::ConstructL"));
+	ConstructWinL(aArgs, iFunctions);
+
+	// Store the screen size
+	iScreenSize = iWindowFunctions->WindowSize();
+
+	TBuf<50> buf;
+	buf.Format(_L("Screen width=%d height=%d"),iScreenSize.Width(),iScreenSize.Height());
+	WriteLog(buf);
+
+	// Set the screen visible
+	iWindowFunctions->SetVisible(ETrue);
+	//just for start heartbeat
+	iWindowFunctions->SetRect(TRect(0, 0, 1, 1));
+	iServerTimer = CTimeOutTimer::NewL(EPriorityHigh, *this);
+	}
+
+void CTWinAnim::Redraw()
+	{
+	WriteLog(_L("CTWinAnim::Redraw"));
+	iResult=ETrue;
+
+	Draw();
+	}
+
+void CTWinAnim::Draw()
+	{
+	// get the background colour
+	TLogicalRgb backgroundColour(TLogicalRgb::ESystemBackgroundColor);
+
+	// Clear the old image.
+	iGc->SetPenSize(iPenSize);
+	iGc->SetPenColor(backgroundColour);
+	iGc->DrawRect(TRect(iLastPoint, iSize) );
+
+	// Draw a shape at the new position
+	iGc->SetPenSize(iPenSize);
+	iGc->SetPenColor(iColor);
+	iGc->DrawRect(TRect(iNewPoint, iSize) );
+
+	if (iDuplicateBitmap)
+		{
+		TRect rect;
+		rect.SetRect(0, 0, 200, 200);
+		iGc->DrawBitmap(rect, iDuplicateBitmap);
+		}
+
+	// signal that the current position has been drawn
+	iDrawn = ETrue;
+	}
+
+void CTWinAnim::HandleNotification(const TWsEvent &aEvent)
+	{
+	if (aEvent.Type() == iExpectEventCode)
+		{
+		iResult = ETrue;
+		}
+	}
+
+void CTWinAnim::FocusChanged(TBool /*aState*/)
+	{
+
+	}
+
+void CTWinAnim::TimedOut()
+	{
+	switch (iCurrentCommand)
+		{
+		case ECmdGeneralSetInterval:
+			{
+			TInt64 interval=iIntervalTimeStamp[1]-iIntervalTimeStamp[0];
+			TInt expectInterval=0;
+			if(iInterval>0)
+				expectInterval = iInterval * 1000000 / 2;
+
+			if (interval == expectInterval)
+				iResult=ETrue;
+			else
+				iResult=EFalse;
+
+			break;
+			}
+
+		case ECmdGeneralSetNextInterval:
+			{
+			TInt64 interval1=iIntervalTimeStamp[1]-iIntervalTimeStamp[0];
+			TInt64 interval2=iIntervalTimeStamp[2]-iIntervalTimeStamp[1];
+			TInt expectInterval = iInterval * 1000000 / 2;
+			TInt expectNextInterval = 0;
+			
+			//If the value is less than 1, it automatically gets set to 1. 
+			if(iNextInterval > 0)
+				{
+				expectNextInterval = iNextInterval * 1000000 / 2;
+				}
+			else
+				{
+				expectNextInterval = 1000000 / 2;
+				}
+			
+			if ((expectNextInterval*5/12)<=interval1 && interval1<=1000000
+					&& interval2==expectInterval)
+				iResult=ETrue;
+			else
+				iResult=EFalse;
+			break;
+			}
+		}
+	}
+
+TInt CTWinAnim::CommandReplyL(TInt aOpcode, TAny *aArgs)
+	{
+	if (aOpcode != ECmdRetrieveResult)
+		{
+		iCurrentCommand=aOpcode;
+		}
+	TInt nReturn=KErrNone;
+	switch (aOpcode)
+		{
+		case ECmdWindowActivateGc:
+			iWindowFunctions->ActivateGc();
+			break;
+		case ECmdWindowSetRect:
+			nReturn=DoCmdSetRect();
+			break;
+		case ECmdWindowIsStarted:
+			iResult=EFalse;
+			iSyncMode=iFunctions->Sync();
+			iFunctions->SetSync(MAnimGeneralFunctions::ESyncFlash);
+			break;
+		case ECmdRetrieveResult:
+			nReturn=iResult;
+			break;
+		case ECmdWindowWindowSize:
+			nReturn=DoCmdWindowSize();
+			break;
+		case ECmdWindowIsHidden:
+			nReturn=iWindowFunctions->IsHidden();
+			break;
+		case ECmdWindowSetVisible:
+			nReturn=DoCmdSetVisible();
+			break;
+		case ECmdWindowInvalidate:
+			nReturn=DoCmdInvalidate();
+			break;
+		case ECmdWindowParameters:
+			nReturn=DoCmdParameters();
+			break;
+		case ECmdWindowVisibleRegion:
+			nReturn=DoCmdVisibleRegion();
+			break;
+
+		case ECmdGfweScreens:
+			nReturn=iFunctions->WindowExtension()->Screens();
+			break;
+		case ECmdGfweFocusScreens:
+			nReturn=iFunctions->WindowExtension()->FocusScreens();
+			break;
+		case ECmdGfweSetFocusScreen:
+			nReturn=DoCmdSetFocusScreen();
+			break;
+		case ECmdGfweWindowGroups:
+			nReturn=DoCmdWindowGroups();
+			break;
+		case ECmdGfweWindowGroupInfo:
+			nReturn=DoCmdWindowGroupInfo();
+			break;
+		case ECmdGfweWindowGroupName:
+			nReturn=DoCmdWindowGroupName();
+			break;
+		case ECmdGfweSetOrdinalPosition:
+			nReturn=DoCmdSetOrdinalPosition();
+			break;
+		case ECmdGfweIsFocusable:
+			nReturn=DoCmdIsFocusable();
+			break;
+
+		case ECmdGeneralDuplicateBitmapL:
+			nReturn = DoCmdDuplicateBitmapL();
+			break;
+		case ECmdGeneralDuplicateFontL:
+			nReturn = DoCmdDuplicateFontL();
+			break;
+		case ECmdGeneralCloseFont:
+			nReturn = DoCmdCloseFontL();
+			break;
+		case ECmdGeneralSetInterval:
+			nReturn = DoCmdSetIntervalL();
+			break;
+		case ECmdGeneralSetNextInterval:
+			nReturn = DoCmdSetNextIntervalL();
+			break;
+		case ECmdGeneralSystemTime:
+			nReturn = DoCmdSystemTimeL();
+			break;
+		case ECmdGeneralRegisterForNotis:
+			nReturn = DoCmdRegisterForNotisL();
+			break;
+		case ECmdGeneralMessage:
+			nReturn = DoCmdMessageL();
+			break;
+		case ECmdGeneralAnimate:
+			nReturn = DoCmdAnimateL();
+			break;
+		case ECmdGeneralFlashStateOn:
+			nReturn = DoCmdFlashStateOn();
+			break;
+		case ECmdGeneralPanic:
+			nReturn = DoCmdPanic();
+			break;
+		case ECmdGeneralScreenDevice:
+			nReturn = DoCmdScreenDevice();
+			break;
+		case ECmdGeneralWindowExtension:
+			nReturn = DoCmdWindowExtension();
+			break;
+		case ECmdGeneralEventExtension:
+			nReturn = DoCmdEventExtension();
+			break;
+		case ECmdGeneralExtendedInterface:
+			nReturn = DoCmdExtendedInterfaceL();
+			break;
+		case ECmdGeneralNumOfExtInterfaces:
+			nReturn = DoCmdNumOfExtInterfaces();
+			break;
+		case ECmdGeneralSetSync:
+			nReturn = DoCmdSetSyncL();
+			break;
+		case ECmdGeneralSync:
+			nReturn = DoCmdSync();
+			break;
+		case ECmdGeneralGetRawEvents:
+			nReturn = DoCmdGetRawEventsL();
+			break;
+		case ECmdGeneralPostRawEvent:
+			nReturn = DoCmdPostRawEventL();
+			break;
+		case ECmdGeneralPostKeyEvent:
+			nReturn = DoCmdPostKeyEventL();
+			break;
+		case ECmdGeneralClient:
+			nReturn = DoCmdClient();
+			break;
+		case ECmdGeneralReplyBuf8:
+			nReturn = DoCmdGeneralReplyBuf8L();
+			break;
+		case ECmdGeneralReplyBuf16:
+			nReturn = DoCmdGeneralReplyBuf16L();
+			break;
+		case ECmdUtilEatupMemory:
+			nReturn = DoCmdEatupMemory();
+			break;
+		case ECmdUtilFreeEatenMemory:
+			nReturn = DoCmdFreeEatenMemory();
+			break;
+		default:
+			nReturn=CmdReply(iFunctions, aOpcode, aArgs);
+		}
+
+	return nReturn;
+	}
+
+void CTWinAnim::Command(TInt aOpcode, TAny *aArgs)
+	{
+	CmdReply(iFunctions, aOpcode, aArgs);
+	}
+
+void CTWinAnim::Animate(TDateTime *aDateTime)
+	{
+	//Set iAnimateTime.
+	TTime now;
+	now.HomeTime();
+	iAnimateTime = now.DateTime();
+
+	switch (iCurrentCommand)
+		{
+		case ECmdGeneralAnimate:
+			iDateTime = *aDateTime;
+			break;
+		case ECmdGeneralSetInterval:
+			{
+			if (iIntervalTimeStamp[0]==0)
+				{
+				iIntervalTimeStamp[0]=now.Int64();
+				}
+			else
+				if (iIntervalTimeStamp[1]==0)
+					{
+					iIntervalTimeStamp[1]=now.Int64();
+					}
+			break;
+			}
+
+		case ECmdGeneralSetNextInterval:
+			{
+			if (iIntervalTimeStamp[1]==0)
+				{
+				iIntervalTimeStamp[1]=now.Int64();
+				}
+			else
+				if (iIntervalTimeStamp[2]==0)
+					{
+					iIntervalTimeStamp[2]=now.Int64();
+					}
+			break;
+			}
+		}
+
+	iResult=ETrue;
+	//if MAnimGeneralFunctions::Sync() not equal to CWindowAnim::iSyncMode then call CWindowAnim::SetSync(CWindowAnim::iSyncMode)
+	if (iFunctions->Sync()!=iSyncMode && iCurrentCommand==ECmdWindowIsStarted)
+		{
+		iFunctions->SetSync(iSyncMode);
+		}
+	// if the last position has been drawn, update the position
+	if (iDrawn)
+		{
+		// this position has not been drawn, so clear the flag
+		iDrawn = EFalse;
+
+		if (iLastPoint != iNewPoint)
+			Compare();
+
+		// Save the current position, so we can rub it out later
+		iLastPoint = iNewPoint;
+
+		TInt nextpoint=iNewPoint.iX + iStepX;
+		TInt right=iNewPoint.iX + iSize.iWidth;
+
+		if (right> iScreenSize.iBr.iX ||nextpoint >= iScreenSize.iBr.iX
+				||iNewPoint.iX<iScreenSize.iTl.iX)
+			iStepX = -iStepX;
+
+		TInt nexty=iNewPoint.iY + iStepY;
+		TInt bottom=nexty + iSize.iHeight;
+
+		if (bottom> iScreenSize.iBr.iY ||nexty >= iScreenSize.iBr.iY
+				||iNewPoint.iY<iScreenSize.iTl.iY || nexty
+				<= iScreenSize.iTl.iY)
+			iStepY = -iStepY;
+
+		iNewPoint.iX += iStepX;
+		iNewPoint.iY += iStepY;
+
+		// Force a draw to be performed by declaring the screen invalid
+		iWindowFunctions->Invalidate(iScreenSize);
+		}
+
+	RecordAnimTime();
+
+	TInt interval=(iAnimTime[KAnimTimeSize-1]-iAnimTime[KAnimTimeSize-2])/1000;
+
+	TBuf<100> buf;
+	buf.Format(_L("CTWinAnim::Animate interval=%d x=%d y=%d"),
+	interval,iNewPoint.iX,iNewPoint.iY);
+
+	WriteLog(buf);
+	}
+
+void CTWinAnim::Compare()
+	{
+	// compare     	
+	const CFbsScreenDevice* scdev=iFunctions->ScreenDevice();
+
+	TBool compare=scdev->RectCompare(TRect(iNewPoint, iSize), *scdev, TRect(
+			TPoint(0, 0), iSize));
+	TBuf<50> buf;
+	buf.Format(_L("CTWinAnim::Compare res %d"),
+	compare);
+	iDll->WriteLog(buf);
+	}
+TBool CTWinAnim::OfferRawEvent(const TRawEvent& aRawEvent)
+	{
+	WriteLog(_L("CTWinAnim::OfferRawEvent has been called"));
+	TBuf<10> event;
+	event.AppendNum(aRawEvent.Type());
+	WriteLog(event);
+	iResult = ETrue;
+	return ETrue;
+	}
+
+//for MAnimWindowFunctions
+TInt CTWinAnim::DoCmdSetRect()
+	{
+	const RMessagePtr2 *msg=iFunctions->Message();
+	TPckgBuf<TRect> arg;
+	TRect rect(0, 0, 0, 0);
+	TInt nReturn=KErrNotFound;
+
+	if (msg && !msg->IsNull())
+		{
+        nReturn=msg->Read(1, arg);
+		if (KErrNone==nReturn)
+			{
+			rect=arg();
+			iWindowFunctions->SetRect(rect);
+			}
+		}
+	return nReturn;
+	}
+
+TInt CTWinAnim::DoCmdWindowSize()
+	{
+	TSize size=iWindowFunctions->WindowSize();
+	TPckgBuf<TSize> pckg(size);
+	TInt nReturn=KErrNone;
+	const RMessagePtr2 *msg=iFunctions->Message();
+
+	if (msg)
+		{
+		nReturn=msg->Write(1, pckg);
+		}
+
+	return nReturn;
+	}
+
+TInt CTWinAnim::DoCmdSetVisible()
+	{
+	TInt nReturn=KErrNotFound;
+	TPckgBuf<TBool> arg;
+	const RMessagePtr2 *msg=iFunctions->Message();
+
+	if (msg)
+		{
+        nReturn=msg->Read(1, arg);
+		if (KErrNone==nReturn)
+			{
+			iWindowFunctions->SetVisible(arg());
+			}
+		}
+
+	return nReturn;
+	}
+
+TInt CTWinAnim::DoCmdInvalidate()
+	{
+	const RMessagePtr2 *msg=iFunctions->Message();
+	TPckgBuf<TRect> arg;
+	TRect rect(0, 0, 0, 0);
+	TInt nReturn=KErrNotFound;
+
+	if (msg && !msg->IsNull())
+		{
+        nReturn=msg->Read(1, arg);
+		if (KErrNone==nReturn)
+			{
+			rect=arg();
+			iResult=EFalse;
+			iWindowFunctions->Invalidate(rect);
+			iWindowFunctions->ActivateGc();
+			iGc->DrawRect(rect);
+			}
+		}
+	return nReturn;
+	}
+
+TInt CTWinAnim::DoCmdParameters()
+	{
+	TWindowInfo data;
+	iWindowFunctions->Parameters(data);
+
+	TPckgBuf<TRect> pckgScreenPos(data.iScreenPos);
+	TPckgBuf<TInt> pckgMode((TInt)data.iMode);
+
+	TInt nReturn=KErrNone;
+	const RMessagePtr2 *msg=iFunctions->Message();
+
+	if (msg)
+		{
+		nReturn=msg->Write(1, pckgScreenPos);
+		nReturn=msg->Write(2, pckgMode);
+		}
+
+	return nReturn;
+	}
+
+TInt CTWinAnim::DoCmdVisibleRegion()
+	{
+	RRegion region;
+	iWindowFunctions->VisibleRegion(region);
+	return region.Count();
+	}
+
+//for MAnimGeneralFunctionsWindowExtension
+TInt CTWinAnim::DoCmdSetFocusScreen()
+	{
+	const RMessagePtr2 *msg=iFunctions->Message();
+	TPckgBuf<TInt> arg;
+    TInt nReturn=KErrNotFound;
+    
+	if (msg && !msg->IsNull())
+		{
+        nReturn=msg->Read(1, arg);
+		if (KErrNone==nReturn)
+			{
+			iFunctions->WindowExtension()->SetFocusScreen(arg());
+			}
+		}
+    return nReturn;
+	}
+
+TInt CTWinAnim::DoCmdWindowGroups()
+	{
+	const RMessagePtr2 *msg=iFunctions->Message();
+	TPckgBuf<TInt> arg;
+	TInt nReturn=KErrNotFound;
+
+	if (msg && !msg->IsNull())
+		{
+        nReturn=msg->Read(1, arg);
+		if (KErrNone==nReturn)
+			{
+			nReturn=iFunctions->WindowExtension()->WindowGroups(arg());
+			}
+		}
+	return nReturn;
+	}
+
+TBool CTWinAnim::DoCmdWindowGroupInfo()
+	{
+	const RMessagePtr2 *msg=iFunctions->Message();
+	TPckgBuf<TInt> argScrNumber;
+	TPckgBuf<TInt> argPosition;
+
+	TBool nReturn=EFalse;
+	MAnimGeneralFunctionsWindowExtension::TWindowGroupInfo aInfo;
+
+	if (msg && !msg->IsNull())
+		{
+		if (KErrNone==msg->Read(1, argScrNumber) && KErrNone==msg->Read(2, argPosition))
+			{
+			nReturn=iFunctions->WindowExtension()->WindowGroupInfo(aInfo, argScrNumber(), argPosition());
+
+			if (nReturn)
+				{
+				TPckgBuf<TInt> pckgInfo(aInfo.iId);
+				msg->Write(3, pckgInfo);
+				}
+			}
+		}
+	return nReturn;
+	}
+
+TBool CTWinAnim::DoCmdWindowGroupName()
+	{
+	const RMessagePtr2 *msg=iFunctions->Message();
+	TPckgBuf<TInt> argScrNumber;
+	TPckgBuf<TInt> argPosition;
+
+	TBool nReturn=EFalse;
+
+	if (msg && !msg->IsNull())
+		{
+		if (KErrNone==msg->Read(1, argScrNumber) && KErrNone==msg->Read(2, argPosition))
+			{
+			TPtrC name;
+			nReturn=iFunctions->WindowExtension()->WindowGroupName(name, argScrNumber(), argPosition());
+			if (nReturn)
+				{
+				msg->Write(3, name);
+				}
+			}
+		}
+
+	return nReturn;
+	}
+
+TInt CTWinAnim::DoCmdSetOrdinalPosition()
+	{
+	const RMessagePtr2 *msg=iFunctions->Message();
+	TPckgBuf<TInt> argGroupId;
+	TPckgBuf<TInt> argPosition;
+	TPckgBuf<TInt> argPriority;
+
+	TInt nReturn=KErrNotFound;
+
+	if (msg && !msg->IsNull())
+		{
+		if (KErrNone==msg->Read(1, argGroupId) && KErrNone==msg->Read(2, argPosition)
+				&& KErrNone==msg->Read(3, argPriority))
+			{
+			nReturn=iFunctions->WindowExtension()->SetOrdinalPosition(argGroupId(), argPosition(),
+					argPriority());
+			}
+		}
+
+	return nReturn;
+	}
+
+TBool CTWinAnim::DoCmdIsFocusable()
+	{
+	const RMessagePtr2 *msg=iFunctions->Message();
+	TPckgBuf<TInt> argScrNumber;
+	TPckgBuf<TInt> argPosition;
+
+	TBool nReturn=EFalse;
+	MAnimGeneralFunctionsWindowExtension::TWindowGroupInfo aInfo;
+
+	if (msg && !msg->IsNull())
+		{
+		if (KErrNone==msg->Read(1, argScrNumber) && KErrNone==msg->Read(2, argPosition))
+			{
+			if (iFunctions->WindowExtension()->WindowGroupInfo(aInfo, argScrNumber(), argPosition()))
+				{
+				nReturn=aInfo.IsFocusable();
+				}
+			}
+		}
+	return nReturn;
+	}
+
+TInt CTWinAnim::DoCmdDuplicateBitmapL()
+	{
+	TInt result = 0;
+	TInt handle;
+	TPtr8 ptr1((TUint8*)&handle, sizeof(TInt));
+	const RMessagePtr2 *msg=iFunctions->Message();
+		
+	if(msg && !msg->IsNull())
+		{
+		msg->ReadL(1,ptr1);
+		iDuplicateBitmap = iFunctions->DuplicateBitmapL(handle);
+		if (iDuplicateBitmap)
+			{
+			TRect rect;
+			iWindowFunctions->ActivateGc();
+			rect.SetRect(0, 0, 200, 200);
+			iGc->DrawBitmap(rect, iDuplicateBitmap);
+			}
+		}
+	else
+		{
+		result = -1;
+		}
+	return result;
+	}
+
+TInt CTWinAnim::DoCmdDuplicateFontL()
+	{
+	TInt result = 0;
+	TInt handle;
+	TPtr8 ptr1((TUint8*)&handle, sizeof(TInt));
+	const RMessagePtr2 *msg=iFunctions->Message();
+			
+	if(msg && !msg->IsNull())
+		{
+		msg->ReadL(1,ptr1);
+		iDuplicateFont = iFunctions->DuplicateFontL(handle);
+		TInt id =0;
+		if (iDuplicateFont)
+			{
+			id = iDuplicateFont->TypeUid().iUid;
+			TPtr8 ptr2((TUint8*)&id, sizeof(TInt), sizeof(TInt));
+			msg->Write(2, ptr2);
+			}
+		}
+	else
+		{
+		return -1;
+		}
+		
+	return result;
+	}
+
+TInt CTWinAnim::DoCmdCloseFontL()
+	{
+	DoCmdDuplicateFontL();
+	iFunctions->CloseFont(iDuplicateFont);
+	return 0;
+	}
+
+TInt CTWinAnim::DoCmdSetIntervalL()
+	{
+	TInt result = 0;
+	TPtr8 ptr1((TUint8*)&iInterval, sizeof(TInt));
+	const RMessagePtr2 *msg=iFunctions->Message();
+			
+	if(msg && !msg->IsNull())
+		{
+		msg->ReadL(1,ptr1);
+		if (iIntervalTimeStamp)
+		delete [] iIntervalTimeStamp;
+		iIntervalTimeStamp=new (ELeave) TInt64[3];
+		iIntervalTimeStamp[0]=0;
+		iIntervalTimeStamp[1]=0;
+		iIntervalTimeStamp[2]=0;
+		iFunctions->SetInterval(iInterval);
+		iServerTimer->After( 5000000); // delay 5 second
+		}
+	else
+		{
+		result = -1;
+		}	
+
+	return result;
+	}
+
+TInt CTWinAnim::DoCmdSetNextIntervalL()
+	{
+	TInt result = 0;
+	TPtr8 ptr1((TUint8*)&iInterval, sizeof(TInt));
+	TPtr8 ptr2((TUint8*)&iNextInterval, sizeof(TInt));
+	const RMessagePtr2 *msg=iFunctions->Message();
+			
+	if(msg && !msg->IsNull())
+		{
+		msg->ReadL(1,ptr1);
+		msg->ReadL(2,ptr2);
+		if (iIntervalTimeStamp)
+			delete [] iIntervalTimeStamp;
+		
+		iIntervalTimeStamp=new (ELeave) TInt64[3];
+		iIntervalTimeStamp[0]=0;
+		iIntervalTimeStamp[1]=0;
+		iIntervalTimeStamp[2]=0;
+		iFunctions->SetInterval(iInterval);
+		iFunctions->SetNextInterval(iNextInterval);//2 flash = 1 second
+		if (iIntervalTimeStamp[0]==0)
+			{
+			TTime now;
+			now.HomeTime();
+			iIntervalTimeStamp[0]=now.Int64();
+			}
+
+		iServerTimer->After( 5000000); //delay 5 second
+		}
+	else
+		{
+		result = -1;
+		}
+		
+	return result;
+	}
+
+TInt CTWinAnim::DoCmdSystemTimeL()
+	{
+	TBool result = DoCmdSetSyncL();
+	if (result)
+		{
+		return result;
+		}
+	iFunctions->Animate(NULL);
+
+	TDateTime time = iFunctions->SystemTime();
+	MAnimGeneralFunctions::TAnimSync syncType = iFunctions->Sync();
+	switch (syncType)
+		{
+		case MAnimGeneralFunctions::ESyncDay:
+			if (time.Day() == iAnimateTime.Day())
+				{
+				result = ETrue;
+				}
+			else
+				{
+				result = EFalse;
+				}
+			break;
+		case MAnimGeneralFunctions::ESyncMinute:
+			if (time.Minute() == iAnimateTime.Minute() && time.Day()
+					== iAnimateTime.Day())
+				{
+				result = ETrue;
+				}
+			else
+				{
+				result = EFalse;
+				}
+			break;
+		case MAnimGeneralFunctions::ESyncFlash:
+		case MAnimGeneralFunctions::ESyncNone:
+		case MAnimGeneralFunctions::ESyncSecond:
+			if (time.Day() == iAnimateTime.Day() && time.Minute()
+					== iAnimateTime.Minute() && time.Second()
+					== iAnimateTime.Second())
+				{
+				result = ETrue;
+				}
+			else
+				{
+				result = EFalse;
+				}
+			break;
+		}
+	return result;
+	}
+
+TInt CTWinAnim::DoCmdRegisterForNotisL()
+	{
+	iResult = EFalse;
+	TUint32 notice;
+	TInt result = 0;
+	TPtr8 ptr1((TUint8*)&notice, sizeof(TUint32));
+	TPtr8 ptr2((TUint8*)&iExpectEventCode, sizeof(TEventCode));
+	const RMessagePtr2 *msg=iFunctions->Message();
+			
+	if(msg && !msg->IsNull())
+		{
+		msg->ReadL(1, ptr1);
+		msg->ReadL(2, ptr2);
+		iFunctions->RegisterForNotifications(notice);		
+		}
+	else
+		{
+		return -1;
+		}
+	
+	return result;
+	}
+
+TInt CTWinAnim::DoCmdMessageL()
+	{
+	TInt result;
+	TBuf<KBufMessage> message;
+	const RMessagePtr2 *msg=iFunctions->Message();
+			
+	if(msg && !msg->IsNull())
+		{
+		msg->ReadL(1,message);
+		msg->Write(2, message);
+		}
+	else
+		{
+		result = -1;
+		}
+	
+	return result;
+	}
+
+TInt CTWinAnim::DoCmdAnimateL()
+	{
+	TInt result = 0;
+	TDateTime time;
+	TPtr8 ptr1((TUint8*)&time, sizeof(TDateTime));
+	const RMessagePtr2 *msg=iFunctions->Message();
+			
+	if(msg && !msg->IsNull())
+		{
+		msg->ReadL(1,ptr1);
+		iResult = EFalse;
+		iFunctions->Animate(&time);
+		if (iDateTime.MicroSecond() == time.MicroSecond() && iDateTime.Minute()
+				== time.Minute() && iDateTime.Second() == time.Second())
+			{
+			iResult = ETrue;
+			}
+		else
+			{
+			iResult = EFalse;
+			}
+	
+		}
+	
+	return iResult;
+	}
+
+TInt CTWinAnim::DoCmdFlashStateOn()
+	{
+	TBool status = EFalse;
+	TTime time;
+	time.HomeTime();
+	TBool result = iFunctions->FlashStateOn();
+	TInt ms = time.DateTime().MicroSecond();
+	TInt H1Limit = 16000; //0.016 * 100000 = 1/64 * 1000000;
+	TInt H2Limit = 567000; // (7/12 - 1/64) * 1000000;
+	TInt H3Limit = 599000; // (7/12 + 1/64) * 1000000;
+	TInt H4Limit = 984000; // (1 - 0.016) * 1000000;
+	
+	if(ms < H1Limit || 
+			(ms > H2Limit && ms < H3Limit) ||
+			ms > H4Limit)
+		{
+		return -1;
+		}
+	
+	if (time.DateTime().MicroSecond() < 1000000 * 7/12)
+		{
+		status = ETrue;
+		}
+	else
+		{
+		status = EFalse;
+		}
+	if (result == status)
+		{
+		status = ETrue;
+		}
+	else
+		{
+		status = EFalse;
+		}
+
+	return status;
+	}
+
+TInt CTWinAnim::DoCmdPanic()
+	{
+	iFunctions->Panic();
+	return 0;
+	}
+
+TInt CTWinAnim::DoCmdScreenDevice()
+	{
+	TDisplayMode mode = iFunctions->ScreenDevice()->DisplayMode();
+	return 0;
+	}
+
+TInt CTWinAnim::DoCmdWindowExtension()
+	{
+	MAnimGeneralFunctionsWindowExtension* ext = iFunctions->WindowExtension();
+	TInt screen = ext->FocusScreens();
+	return 0;
+	}
+
+TInt CTWinAnim::DoCmdEventExtension()
+	{
+	MAnimGeneralFunctionsEventExtension* ext = iFunctions->EventExtension();
+	TKeyEvent event;
+	event.iCode = EEventKeyDown;
+	ext->PostKeyEvent(event, 1);
+	return 0;
+	}
+
+TInt CTWinAnim::DoCmdExtendedInterfaceL()
+	{
+	TInt result = 0;
+	TInt interface;
+	TPtr8 ptr1((TUint8*)&interface, sizeof(TInt));
+	const RMessagePtr2 *msg=iFunctions->Message();
+				
+	if(msg && !msg->IsNull())
+		{
+		msg->ReadL(1,ptr1);
+		TAny* any = iFunctions->ExtendedInterface(interface);
+		if (interface == 0)
+			{
+			//Zhang Yue modified.for the return result is a Int value, not a pointer address.
+			result = (TInt)any;
+			}
+		else
+			{
+			if (interface == 1)
+				{
+				((MAnimGeneralFunctionsWindowExtension*) any)->FocusScreens();
+				}
+			else
+				{
+				if (interface == 2)
+					{
+					TKeyEvent event;
+					event.iCode = EEventKeyDown;
+					((MAnimGeneralFunctionsEventExtension*) any)->PostKeyEvent(
+							event, 1);
+					}
+				else
+					{
+					if (any)
+						{
+						result = -1;
+						}
+					else
+						{
+						result = 0;
+						}//end if (any)
+					}//end if(interface 2)
+				}//end if(interface)
+			}//end if(interface)
+	
+		} //end if(msg)		
+	else
+		{
+		result = -1;
+		}
+	
+	return result;
+	}
+
+TInt CTWinAnim::DoCmdNumOfExtInterfaces()
+	{
+	return iFunctions->NumberOfExtendedInterfaces();
+	}
+
+TInt CTWinAnim::DoCmdSetSyncL()
+	{
+	TInt result = 0;
+	MAnimGeneralFunctions::TAnimSync mode;
+	TPtr8 ptr1((TUint8*)&mode, sizeof(MAnimGeneralFunctions::TAnimSync));
+	const RMessagePtr2 *msg=iFunctions->Message();
+	if(msg && !msg->IsNull())
+		{
+		msg->ReadL(1,ptr1);
+		iFunctions->SetSync(mode);		
+		}
+	else
+		{
+		return -1;
+		}
+	return result;
+	}
+
+TInt CTWinAnim::DoCmdSync()
+	{
+	MAnimGeneralFunctions::TAnimSync mode = iFunctions->Sync();
+	return mode;
+	}
+
+TInt CTWinAnim::DoCmdGetRawEventsL()
+	{
+	TInt result = 0;
+	TBool getevent;
+	TPtr8 ptr1((TUint8*)&getevent, sizeof(TBool));
+	const RMessagePtr2 *msg=iFunctions->Message();
+	if(msg && !msg->IsNull())
+		{
+		msg->ReadL(1,ptr1);
+		iFunctions->GetRawEvents(getevent);
+			
+		}
+	else
+		{
+		return -1;
+		}
+
+	return result;
+	}
+
+TInt CTWinAnim::DoCmdPostRawEventL()
+	{
+	iResult = EFalse;
+	TInt result = 0;
+	TRawEvent event;
+	TPtr8 ptr1((TUint8*)&event, sizeof(TRawEvent));
+	const RMessagePtr2 *msg=iFunctions->Message();
+	
+	if(msg && !msg->IsNull())
+		{
+		msg->ReadL(1,ptr1);
+		iFunctions->PostRawEvent(event);		
+		}
+	else
+		{
+		return -1;
+		}
+
+	return result;
+	}
+
+TInt CTWinAnim::DoCmdPostKeyEventL()
+	{
+	iResult = EFalse;
+	TInt result = 0;
+	TKeyEvent event;
+	TPtr8 ptr1((TUint8*)&event, sizeof(TKeyEvent));
+	const RMessagePtr2 *msg=iFunctions->Message();
+	
+	if(msg && !msg->IsNull())
+		{
+		msg->ReadL(1,ptr1);
+		iFunctions->PostKeyEvent(event);
+		}
+	else
+		{
+		result = -1;
+		}
+	return result;
+	}
+
+TInt CTWinAnim::DoCmdClient()
+	{
+	return iFunctions->Client().Id();
+	}
+
+TInt CTWinAnim::DoCmdGeneralReplyBuf8L()
+	{
+	TInt result;
+	TBuf8<KBufMessage> message;
+	const RMessagePtr2 *msg=iFunctions->Message();
+	if(msg && !msg->IsNull())
+		{
+		msg->ReadL(3,message);
+		iFunctions->ReplyBuf(message);		
+		}
+	else
+		{
+		result = -1;
+		}
+	
+	return result;
+	}
+
+TInt CTWinAnim::DoCmdGeneralReplyBuf16L()
+	{
+	TInt result;
+	TBuf<KBufMessage> message;
+	const RMessagePtr2 *msg=iFunctions->Message();
+	if(msg && !msg->IsNull())
+		{
+		msg->ReadL(3,message);
+		iFunctions->ReplyBuf(message);
+		}
+	else
+		{
+		result = -1;
+		}
+	return result;
+	}
+
+TInt CTWinAnim::DoCmdEatupMemory()
+	{
+	TInt leftsize=20;
+
+	// eat memory until fail to avaiable memory is less than is left size  
+	TInt nTotalSize=User::Heap().Size();
+	TAny* mem=User::AllocZ(nTotalSize);
+
+	if (mem)
+		iMemArray.Append(mem);
+
+	do
+		{
+		mem=User::AllocZ(leftsize);
+		if (mem)
+			{
+			iMemArray.Append(mem);
+			}
+		}
+	while (mem);
+
+	iAvaiableSpace=User::Available(iBiggestBlock);
+	return 0;
+	}
+
+TInt CTWinAnim::DoCmdFreeEatenMemory()
+	{
+	FreeMemory();
+	return 0;
+	}
+
+void CTWinAnim::FreeMemory()
+	{
+	for (TInt i=0; i<iMemArray.Count(); i++)
+		{
+		TAny* mem=iMemArray[i];
+		User::Free(mem);
+		}
+
+	iMemArray.Reset();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/AnimPlugin/src/T_TestAnimDll.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,106 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+// 
+// Description:
+//
+
+#include "T_TestAnimDll.h"
+#include "T_AnimDef.h"
+#include "T_TWinAnim.h"
+#include "T_TSpriteAnim.h"
+#include "T_TFreeTimerWinAnim.h"
+
+
+CTestAnimDll::CTestAnimDll()
+{
+	// No implementation required
+}
+
+
+CTestAnimDll::~CTestAnimDll()
+{
+	WriteLog(_L("~CTestAnimDll"));
+	delete iLog;
+	iFs.Close();
+}
+
+CTestAnimDll* CTestAnimDll::NewLC()
+{
+	CTestAnimDll* self = new (ELeave)CTestAnimDll();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+}
+
+CTestAnimDll* CTestAnimDll::NewL()
+{
+	CTestAnimDll* self=CTestAnimDll::NewLC();
+	CleanupStack::Pop(); // self;
+	return self;
+}
+
+void CTestAnimDll::ConstructL()
+{
+	User::LeaveIfError(iFs.Connect());
+	_LIT(KFileName,"c:\\anim.txt");
+	iLog=CLog::NewL(iFs,KFileName);
+
+}
+
+EXPORT_C CAnimDll* CreateCAnimDllL()
+{	
+	return CTestAnimDll::NewL();
+}
+
+TInt CTestAnimDll::WriteLog(const TDesC& aInfo)
+	{
+	return iLog->WriteLog((aInfo));	
+	}
+TInt CTestAnimDll::WriteLog(const TDesC8& aInfo)
+	{
+	return iLog->WriteLog((aInfo));	
+	}
+
+CAnim* CTestAnimDll::CreateInstanceL(TInt aType)
+{
+	TBuf<50> buf;
+	buf.Format(_L("CTestAnimDll::CreateInstanceL %d"),aType);
+	WriteLog(buf);
+	
+	CAnim* anim=NULL;
+	switch (aType)
+	{
+	case EKWindowAnim:
+		{
+		anim=new (ELeave)CTWinAnim(this,aType);		
+		break;
+		}
+	case EKSpriteAnim:
+		{
+		anim=new (ELeave)CTSpriteAnim(this,aType);
+		break;
+		}	
+	case EKFreeTimerWindowAnim:
+		{
+		anim=new (ELeave) CTFreeTimerWinAnim();
+		break;
+		}
+	default:
+		{
+//		iFunctions->Panic();
+		break; 
+		}	  
+
+	}
+
+	return anim;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/AnimPlugin/src/T_log.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "T_log.h"
+
+#define DES_AS_8_BIT(str) (TPtrC8((TText8*)((str).Ptr()), (str).Size()))
+_LIT8(KLimit,"\r\n");
+_LIT8(KTimeFormat, "%2d:%2d:%3d  ");
+
+CLog::CLog()
+	{
+	
+	}
+
+CLog::~CLog()
+	{
+	iFile.Close();
+	
+	iBuf.Close();
+	}
+
+CLog* CLog::NewLC(RFs &aFs, const TDesC &aFileName)
+	{
+	CLog* self = new (ELeave)CLog();
+	CleanupStack::PushL(self);
+	self->ConstructL(aFs,aFileName);
+	return self;
+	}
+
+CLog* CLog::NewL(RFs &aFs, const TDesC &aFileName)
+	{
+	CLog* self=CLog::NewLC(aFs, aFileName);
+	CleanupStack::Pop(); // self;
+	return self;
+	}
+
+void CLog::ConstructL(RFs &aFs, const TDesC &aFileName)
+	{
+	User::LeaveIfError(iFile.Replace(aFs,aFileName,EFileWrite|EFileShareAny));
+	
+	iText.Set(iFile);
+	iBuf.Create(1024);
+	
+	}
+//write log
+//input: aInfo, text msg;
+//return: KErrNone, ok; other, fail;
+TInt CLog::WriteLog(const TDesC& aInfo)
+	{
+	TTime currentTime;
+	currentTime.HomeTime();	
+	TDateTime time=currentTime.DateTime();	
+	
+	iBuf.Format(KTimeFormat,time.Minute(),time.Second(),time.MicroSecond());
+	iBuf.Append(aInfo);
+	
+	iFile.Write(iBuf);
+	iFile.Write(KLimit);
+		
+	return 0;
+	}
+
+//write log
+//input: aInfo, text msg;
+//return: KErrNone, ok; other, fail;
+TInt CLog::WriteLog(const TDesC8& aInfo)
+	{
+	TTime currentTime;
+	currentTime.HomeTime();	
+	TDateTime time=currentTime.DateTime();	
+	
+	iBuf.Format(KTimeFormat,time.Minute(),time.Second(),time.MicroSecond());
+	iBuf.Append(aInfo);
+	
+	iFile.Write(iBuf);
+	iFile.Write(KLimit);
+		
+	return 0;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/TWsGraphicShare/TWsGraphicShare.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,162 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+//  Include Files  
+
+#include "TWsGraphicShare.h"
+#include <e32base.h>
+#include <e32std.h>
+#include <w32stdgraphic.h>
+
+//  Local Functions
+
+LOCAL_C void DrawSharedGraphicL(const TDesC& aSemName, TInt aScrNum, const TWsGraphicId& aId, const TRect& aDestRect, const TDesC8& aData)
+	{
+	// Construct & Initiate
+	RWsSession ws;
+	User::LeaveIfError(ws.Connect());
+	CleanupClosePushL(ws);
+	
+	CWsScreenDevice* screenDevice = new(ELeave) CWsScreenDevice(ws);
+	CleanupStack::PushL(screenDevice);
+	User::LeaveIfError(screenDevice->Construct(aScrNum));
+
+	TSize screenSize = screenDevice->SizeInPixels();
+
+	CWindowGc* gc = new(ELeave) CWindowGc(screenDevice);
+	CleanupStack::PushL(gc);
+	User::LeaveIfError(gc->Construct());
+	
+	RWindowGroup winGroup(ws);
+	CleanupClosePushL(winGroup);
+	User::LeaveIfError(winGroup.Construct(1));
+		
+	RWindow win(ws);
+	CleanupClosePushL(win);
+	TUint32 handle = 0x0F00;
+	User::LeaveIfError(win.Construct(winGroup, handle));
+	win.SetBackgroundColor(TRgb(255, 255, 255));
+	win.SetPosition(TPoint(aDestRect.iTl.iX, aDestRect.iTl.iY));
+	win.SetSize(aDestRect.Size());
+	win.Activate();
+
+	// Draw
+	gc->Activate(win);
+	win.Invalidate();
+	win.BeginRedraw();
+	ws.Flush();	
+	gc->DrawWsGraphic(aId, TRect(0,0,aDestRect.Width(),aDestRect.Height()), aData );
+	gc->Deactivate();
+	win.EndRedraw();
+	ws.Flush();
+	
+	// Synchronize with master process
+	RSemaphore semaphore;
+	CleanupClosePushL(semaphore);
+	User::LeaveIfError(semaphore.OpenGlobal(aSemName));
+	semaphore.Signal();
+	semaphore.Wait();
+	semaphore.Close();
+    
+	// Deconstruct
+	CleanupStack::PopAndDestroy(6);
+	}
+
+LOCAL_C void MainL ( )
+	{
+	TBuf<128> commandLine;
+	TLex lex;
+	TBuf<32> semName;
+	TInt screenNumber = 0; 
+	TInt graphId;	
+	TInt left, top, right, bottom;
+
+	// Read arguments from the command line
+	// There is a space between two adjacent parameters
+	// Commandline's format looks like that:
+	// 'screenNumber' 'graphId' 'left' 'top' 'right' 'bottom' 
+	User::CommandLine(commandLine);
+	commandLine.TrimLeft();
+	
+	_LIT(KSpace, " ");
+	TInt pos;
+	// Get process name
+	pos = commandLine.Find(KSpace);
+	semName = commandLine.Left(pos);
+	commandLine = commandLine.Mid(pos+1);
+	
+	// Get screen number	
+	pos = commandLine.Find(KSpace);
+	lex = commandLine.Left(pos);
+	lex.Val(screenNumber);
+	commandLine = commandLine.Mid(pos+1);
+	
+	// Get gragaphic id	
+	pos = commandLine.Find(KSpace);
+	lex = commandLine.Left(pos);
+	lex.Val(graphId);
+	commandLine = commandLine.Mid(pos+1);	
+	
+	// Get coordinates
+	pos = commandLine.Find(KSpace);
+	lex = commandLine.Left(pos);
+	lex.Val(left);	
+	commandLine = commandLine.Mid(pos+1);
+	
+	pos = commandLine.Find(KSpace);
+	lex = commandLine.Left(pos);
+	lex.Val(top);
+	commandLine = commandLine.Mid(pos+1);
+	
+	pos = commandLine.Find(KSpace);
+	lex = commandLine.Left(pos);
+	lex.Val(right);
+	commandLine = commandLine.Mid(pos+1);
+	
+	pos = commandLine.Find(KSpace);
+	lex = commandLine.Left(pos);
+	lex.Val(bottom);
+	commandLine = commandLine.Mid(pos+1);
+	
+	// Get data
+	TBuf8<32> data;
+	data.Copy(commandLine);
+	
+	TWsGraphicId id(TUid::Uid(graphId));
+	TRect destRect(left, top, right, bottom);	
+	
+	// Draw the graphic
+	DrawSharedGraphicL(semName, screenNumber, id, destRect, data);
+	}
+
+//  Global Functions
+
+GLDEF_C TInt E32Main()
+	{
+	// Create cleanup stack
+	__UHEAP_MARK;
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+
+	// Run application code inside TRAP harness, wait keypress when terminated
+	TRAPD(error, MainL());
+	User::LeaveIfError(error);
+	
+	delete cleanup;
+	__UHEAP_MARKEND;
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/TWsGraphicShare/TWsGraphicShare.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef __TWSGRAPHICSHARE_H__
+#define __TWSGRAPHICSHARE_H__
+
+//  Include Files
+
+#include <e32base.h>
+
+//  Function Prototypes
+
+GLDEF_C TInt E32Main();
+
+#endif  // __TWSGRAPHICSHARE_H__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/TWsGraphicShare/TWsGraphicShare.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+TARGET		  twsgraphicshare.exe
+TARGETTYPE	  exe
+UID			 0 0xE0A688F9
+
+USERINCLUDE	 .
+SYSTEMINCLUDE   /epoc32/include
+
+SOURCEPATH	  .
+SOURCE		  TWsGraphicShare.cpp
+
+LIBRARY			euser.lib
+LIBRARY			ws32.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/TWsGraphicShare/TWsGraphicUnshare.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+TARGET		  twsgraphicunshare.exe
+TARGETTYPE	  exe
+UID			 0 0xE0A688F8
+
+USERINCLUDE	 .
+SYSTEMINCLUDE   /epoc32/include
+
+SOURCEPATH	  .
+SOURCE		  TWsGraphicShare.cpp
+
+LIBRARY			euser.lib
+LIBRARY			ws32.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/TWsGraphicShare/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,21 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_MMPFILES
+TWsGraphicShare.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/group/T_GraphicsWservAPI.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,136 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+TARGET			t_graphicswservapi.exe
+TARGETTYPE		exe
+UID				0x1000007B 0x20003721
+VENDORID		0x70000001
+
+CAPABILITY		SwEvent WriteDeviceData Powermgmt ProtServ
+
+SOURCEPATH		../src
+
+SOURCE			../../common/src/TestServerBase.cpp
+SOURCE			../../common/src/UtilityClearPanicDlg.cpp
+SOURCE			../../common/src/DataWrapperBase.cpp
+SOURCE			../../common/src/T_GraphicsUtil.cpp
+SOURCE          ../../common/src/DataWrapperActive.cpp
+
+SOURCE			T_GraphicsWservAPIServer.cpp
+SOURCE			T_DataWsClientClass.cpp
+SOURCE			T_DataWsSession.cpp
+SOURCE			T_DataWindowTreeNode.cpp
+SOURCE			T_DataWindowGroup.cpp
+SOURCE			T_DataWindowBase.cpp
+SOURCE			T_DataBlankWindow.cpp
+SOURCE			T_DataDrawableWindow.cpp
+SOURCE			T_DataWindow.cpp
+SOURCE			T_DataBackedUpWindow.cpp
+SOURCE			T_DataWindowGc.cpp
+SOURCE			T_DataWsBitmap.cpp
+SOURCE			T_DataWsGraphic.cpp
+SOURCE			T_DataWsGraphicBitmap.cpp
+SOURCE			T_DataWsGraphicMsgBuf.cpp
+SOURCE			T_DataWsEvent.cpp
+SOURCE			T_DataWsPriorityKeyEvent.cpp
+SOURCE			T_DataWsRedrawEvent.cpp
+SOURCE			T_DataWindowInfo.cpp
+SOURCE			T_DataWsScreenDevice.cpp
+SOURCE			T_DataWsGraphicAnimation.cpp
+SOURCE			T_DataWsGraphicFrameRate.cpp
+SOURCE			T_DataWsGraphicMsgFixedBase.cpp
+SOURCE			T_DataDsaSession.cpp
+SOURCE			T_DataDirectScreenAccess.cpp
+SOURCE			T_DataSoundPlugIn.cpp
+SOURCE          T_DataWsGraphicBitmapAnimation.cpp
+SOURCE          T_DataFrame.cpp
+SOURCE			T_DataAnimDll.cpp
+SOURCE			T_DataAnimForMClass.cpp
+
+
+SOURCE			T_DataWsSpriteBase.cpp
+SOURCE			T_DataWsSprite.cpp
+SOURCE			T_DataWsPointerCursor.cpp
+
+//from gdi
+SOURCE			../../gdi/src/T_DataBitmapContext.cpp
+SOURCE			../../gdi/src/T_DataBitmapDevice.cpp
+SOURCE			../../gdi/src/T_DataDrawTextExtendedParam.cpp
+SOURCE			../../gdi/src/T_DataDrawTextParam.cpp
+SOURCE			../../gdi/src/T_DataFont.cpp
+SOURCE			../../gdi/src/T_DataGraphicsContext.cpp
+SOURCE			../../gdi/src/T_DataGraphicsDevice.cpp
+SOURCE			../../gdi/src/T_DataGraphicsDeviceMap.cpp
+SOURCE			../../gdi/src/T_DataMeasureTextInput.cpp
+SOURCE			../../gdi/src/T_DataMeasureTextOutput.cpp
+SOURCE			../../gdi/src/T_DataPalette.cpp
+SOURCE			../../gdi/src/T_DataTypefaceStore.cpp
+
+//from bitgdi
+SOURCE			../../bitgdi/src/T_DataFbsBitGc.cpp
+SOURCE			../../bitgdi/src/T_DataFbsBitmapDevice.cpp
+SOURCE			../../bitgdi/src/T_DataFbsDevice.cpp
+SOURCE			../../bitgdi/src/T_DataFbsScreenDevice.cpp
+
+//from fntstore
+SOURCE			../../fntstore/src/T_DataAlgStyle.cpp
+
+//from fbserv
+SOURCE			../../fbserv/src/T_DataBitmapUtil.cpp
+SOURCE			../../fbserv/src/T_DataFbsBitmap.cpp
+SOURCE			../../fbserv/src/T_DataFbsColor256BitmapUtil.cpp
+SOURCE			../../fbserv/src/T_DataFbsFont.cpp
+SOURCE			../../fbserv/src/T_DataFbsSession.cpp
+SOURCE			../../fbserv/src/T_DataFbsTypefaceStore.cpp T_DataAnim.cpp T_RAnimChild.cpp
+
+USERINCLUDE		../inc
+USERINCLUDE		../../common/inc
+USERINCLUDE		../../gdi/inc
+USERINCLUDE		../../bitgdi/inc
+USERINCLUDE		../../fntstore/inc
+USERINCLUDE		../../fbserv/inc
+
+SYSTEMINCLUDE	/epoc32/include
+SYSTEMINCLUDE	/epoc32/include/test
+SYSTEMINCLUDE	/epoc32/include/graphics
+
+LIBRARY			euser.lib
+LIBRARY			efsrv.lib
+LIBRARY			esock.lib
+LIBRARY			testexecuteutils.lib
+LIBRARY			testexecutelogclient.lib
+LIBRARY			charconv.lib
+LIBRARY			fbscli.lib
+LIBRARY			ws32.lib
+LIBRARY			gdi.lib
+LIBRARY			bafl.lib
+LIBRARY			c32.lib
+LIBRARY			c32root.lib
+LIBRARY 		hal.lib
+LIBRARY			w32stdgraphic.lib
+
+LIBRARY			fntstr.lib
+LIBRARY			estor.lib
+LIBRARY			bitgdi.lib
+LIBRARY			eikcore.lib
+LIBRARY			cone.lib
+LIBRARY			apgrfx.lib
+LIBRARY			iniparser.lib 
+LIBRARY         imageconversion.lib
+
+USERINCLUDE ../AnimPlugin/inc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/group/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRJ_TESTEXPORTS
+
+//	T_DataWindowGc
+../scripts/smoketest_bitmap.script			z:/smoketest/smoketest_bitmap.script
+../scripts/setup_smoketest_bitmap.script	z:/smoketest/setup_smoketest_bitmap.script
+
+../testdata/smoketest_bitmap.ini			z:/smoketest/smoketest_bitmap.ini
+
+//	Generic test data
+../testdata/datafile/uibench_16bit.mbm		z:/smoketest/bitmap/uibench_16bit.mbm
+
+PRJ_TESTMMPFILES
+
+T_GraphicsWservAPI.mmp
+
+../AnimPlugin/group/T_AnimPlugin.mmp
+../TWsGraphicShare/TWsGraphicShare.mmp
+../TWsGraphicShare/TWsGraphicUnshare.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataAnim.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_TESTANIM_H__)
+#define __T_GRAPHICS_WSERV_TESTANIM_H__
+
+#include "T_RAnimChild.h"
+#include "DataWrapperBase.h"
+
+#define KIpcArgNum	3
+
+class CT_DataAnim : public CDataWrapperBase
+	{
+public:
+	static CT_DataAnim*	NewL();
+
+	~CT_DataAnim();
+
+	virtual TAny*	GetObject();
+	virtual void	SetObjectL(TAny* aAny);
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+	void RunL(CActive* aActive, TInt aIndex); 
+
+protected:
+	CT_DataAnim();
+	void  ConstructL();
+
+private:
+	void	DestroyData();
+	
+	void	DoCmdnewL(const TDesC& aSection);
+	void	DoCmdConstructL(const TDesC& aSection);
+	void	DoCmdCommandReply(const TDesC& aSection);
+	void	DoCmdCommand(const TDesC& aSection);
+	void	DoCmdAsyncCommandReply(const TDesC& aSection, const TInt aAsyncErrorIndex);
+	void	DoCmdClose();
+	void	DoCmdDestroy();
+	void	DoCmdDestructor();
+	
+	TDesC8& CopyToSendBuf(const TDesC& buf);
+	
+	TBool GetIpcArg(const TDesC& aSection);
+	
+	TBool CheckIpcArg(const TDesC& aSection);
+	TBool CheckAnimateInterval(const TDesC& aSection);
+	
+    TBool 	ReadAnimCommand(const TDesC& aSectName, const TDesC& aKeyName, TInt& aCommand);
+    TBool 	ReadAnimType(const TDesC& aSectName, const TDesC& aKeyName, TInt& aType);
+private:
+	CActiveCallback* iActiveCallback;
+	T_RAnimChild*	iAnim;
+	
+	TIpcArgs iIpcArgs;
+	
+	RBuf8 iSendBuf;
+	RBuf iIpcBuf[KIpcArgNum];		
+	
+	TBuf<200> iAsyncCmdSection;
+	};
+
+
+#endif /* __T_GRAPHICS_WSERV_TESTANIM_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataAnimDll.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_ANIMDLL_H__)
+#define __T_GRAPHICS_WSERV_ANIMDLL_H__
+
+//	User Includes
+#include "T_DataWsClientClass.h"
+
+class CT_DataAnimDll : public CDataWrapperBase, public CT_DataWsClientClass
+	{
+public:
+	static CT_DataAnimDll*	NewL();
+
+	~CT_DataAnimDll();
+
+	virtual TAny*	GetObject();
+	virtual void	SetObjectL(TAny* aAny);
+
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	CT_DataAnimDll();
+	void  ConstructL();
+	
+	virtual MWsClientClass*		GetClientClass() const;
+
+private:
+	void	DestroyData();
+	
+	void	DoCmdnewL(const TDesC& aSection);
+	void	DoCmdLoad(const TDesC& aSection);
+	void	DoCmdClose();
+	void	DoCmdDestroy();
+	void	DoCmdDestructor();
+
+private:
+	RAnimDll*	iAnimDll;
+	};
+
+#endif /* __T_GRAPHICS_WSERV_ANIMDLL_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataAnimForMClass.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,139 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_ANIM_FOR_MCLASS_H__)
+#define __T_GRAPHICS_WSERV_ANIM_FOR_MCLASS_H__
+
+#include "T_RAnimChild.h"
+#include "DataWrapperBase.h"
+
+#define KIpcArgNum	3
+
+class CT_DataAnimForMClass : public CDataWrapperBase
+	{
+public:
+	static CT_DataAnimForMClass*	NewL();
+
+	~CT_DataAnimForMClass();
+
+	virtual TAny*	GetObject();
+	virtual void	SetObjectL(TAny* aAny);
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection,const TInt);
+	//void RunL(CActive* aActive, TInt aIndex); 
+
+protected:
+	CT_DataAnimForMClass();
+	void  ConstructL();
+
+private:
+	void	DestroyData();
+	
+	void	DoCmdnewL(const TDesC& aSection);
+	void	DoCmdConstructL(const TDesC& aSection);
+	void	DoCmdCommandReplyL(const TDesC& aSection);
+	void	DoCmdCommand(const TDesC& aSection);
+	void	DoCmdAsyncCommandReply(const TDesC& aSection, const TInt aAsyncErrorIndex);
+	void	DoCmdClose();
+	void	DoCmdDestroy();
+	void	DoCmdDestructor();
+	
+	TDesC8& CopyToSendBuf(const TDesC& buf);
+	
+	TBool GetIpcArg(const TDesC& aSection);
+
+	TBool CheckIpcArg(const TDesC& aSection);
+	TBool CheckAnimateInterval(const TDesC& aSection);
+	void ResetIpcArg();
+	//MAnimGeneralFunctions
+	void DoCmdRetrieveResult(const TDesC& aSectName , const TInt& datOpcode);
+	
+	void DoCmdGeneralAnimate(const TDesC& aSectName , const TInt& datOpcode);
+	void DoCmdGeneralClient(const TDesC& aSectName , const TInt& datOpcode );
+	void DoCmdGeneralFlashStateOn(const TDesC& aSectName , const TInt& datOpcode);
+	void DoCmdGeneralPanic(const TDesC& aSectName, const TInt& datOpcode);
+	void DoCmdGeneralScreenDevice(const TDesC& aSectName , const TInt& datOpcode);
+	void DoCmdGeneralWindowExtension(const TDesC& aSectName , const TInt& datOpcode);
+	void DoCmdGeneralEventExtension(const TDesC& aSectName , const TInt& datOpcode);
+	void DoCmdGeneralExtendedInterface(const TDesC& aSectName , const TInt& datOpcode);
+	void DoCmdGeneralNumOfExtInterfaces(const TDesC& aSectName , const TInt& datOpcode);
+    void DoCmdGeneralGetRawEvents(const TDesC& aSectName , const TInt& datOpcode);
+    void DoCmdGeneralPostRawEvent(const TDesC& aSectName ,  const TInt& datOpcode);
+    void DoCmdGeneralPostKeyEventL(const TDesC& aSectName ,  const TInt& datOpcode);
+	void DoCmdGeneralSetSync(const TDesC& aSectName , const TInt& datOpcode);
+	void DoCmdGeneralSync(const TDesC& aSectName , const TInt& datOpcode);
+	void DoCmdGeneralSetInterval(const TDesC& aSectName, const TInt& datOpcode);
+    void DoCmdGeneralSetNextInterval(const TDesC& aSectName, const TInt& datOpcode);
+	void DoCmdGeneralSystemTime(const TDesC& aSectName, const TInt& datOpcode);
+	void DoCmdGeneralRegisterForNotis(const TDesC& aSectName , const TInt& datOpcode);
+	void DoCmdGeneralMessage(const TDesC& aSectName , const TInt& datOpcode);
+	void DoCmdGeneralDuplicateBitmapL(const TDesC& aSectName , const TInt& datOpcode);
+	void DoCmdGeneralDuplicateFontL(const TDesC& aSectName, const TInt& datOpcode);
+	void DoCmdGeneralCloseFontL(const TDesC& aSectName , const TInt& datOpcode);
+	void DoCmdGeneralReplyBuf8(const TDesC& aSectName, const TInt& datOpcode);
+	void DoCmdGeneralReplyBuf16(const TDesC& aSectName, const TInt& datOpcode);
+	
+	void DoCmdSpriteGetSpriteMember(const TDesC& aSectName , const TInt& datOpcode);
+	void DoCmdSpriteUpdateMember(const TDesC& aSectName, const TInt& datOpcode);
+	void DoCmdSpriteActivate(const TDesC& aSectName , const TInt& datOpcode);
+	void DoCmdSpriteSpriteCanBeSeen(const TDesC& aSectName , const TInt& datOpcode);
+	void DoCmdSpriteSizeChangedL(const TDesC& aSectName , const TInt& datOpcode);
+	void DoCmdSpriteSetPosition(const TDesC& aSectName , const TInt& datOpcode);
+
+    //MAnimWindowFunctions
+    void DoWindowActivateGc(TInt aOpcode);
+    void DoWindowSetRect(TInt aOpcode,const TDesC& aSection);
+    void DoWindowWindowSizeL(TInt aOpcode,const TDesC& aSection);
+    void DoWindowIsHidden(TInt aOpcode,const TDesC& aSection);
+    void DoWindowSetVisible(TInt aOpcode,const TDesC& aSection);
+    void DoWindowInvalidate(TInt aOpcode,const TDesC& aSection);
+    void DoWindowParametersL(TInt aOpcode,const TDesC& aSection);
+    void DoWindowVisibleRegion(TInt aOpcode,const TDesC& aSection);
+    void GetWindowRetrieveResult(TInt aOpcode,const TDesC& aSection);
+    
+    //MAnimGeneralFunctionsWindowExtension
+    void DoGeneralExtScreensL(TInt aOpcode,const TDesC& aSection);
+    void DoGeneralExtFocusScreensL(TInt aOpcode,const TDesC& aSection);
+    void DoGeneralExtSetFocusScreen(TInt aOpcode,const TDesC& aSection);
+    void DoGeneralExtWindowGroupsL(TInt aOpcode,const TDesC& aSection);
+    void DoGeneralExtWindowGroupInfoL(TInt aOpcode,const TDesC& aSection);
+    void DoGeneralExtWindowGroupNameL(TInt aOpcode,const TDesC& aSection);
+    void DoGeneralExtSetOrdinalPositionL(TInt aOpcode,const TDesC& aSection);
+    void DoGeneralExtIsFocusableL(TInt aOpcode,const TDesC& aSection);
+    
+    //MAnimFreeTimerWindowFunctions
+    void DoFreeTimerWinDeactivateGc(TInt aOpcode);
+    void DoFreeTimerWinUpdate(TInt aOpcode);
+    
+    //Common Util
+    void DoCmdEatupMemory(const TInt& datOpcode);
+    void DoCmdFreeEatenMemory(const TInt& datOpcode);
+private:
+	CActiveCallback* iActiveCallback;
+	T_RAnimChild*	iAnim;
+	
+	TIpcArgs iIpcArgs;
+	
+	RBuf8 iSendBuf;
+	RBuf iIpcBuf[KIpcArgNum];		
+	
+	TBuf<200> iAsyncCmdSection;
+	};
+
+
+#endif /* __T_GRAPHICS_WSERV_TESTANIM_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataBackedUpWindow.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_BACKEDUPWINDOW_H__)
+#define __T_GRAPHICS_WSERV_BACKEDUPWINDOW_H__
+
+// User Includes
+#include "T_DataDrawableWindow.h"
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataBackedUpWindow : public CT_DataDrawableWindow
+	{
+public:
+	/**
+	* Two phase constructor
+	*/
+	static CT_DataBackedUpWindow*	NewL();
+
+	/**
+	* Public destructor
+	*/
+	~CT_DataBackedUpWindow();
+
+	/**
+	* Return a pointer to the object that the data wraps
+	*
+	* @return	pointer to the object that the data wraps
+	*/
+	virtual TAny*	GetObject()	{ return iBackedUpWindow; }
+
+	/**
+	* Set the object that the data wraps
+	*
+	* @param	aObject object that the wrapper is testing
+	*
+	*/
+	virtual void	SetObjectL(TAny* aAny);
+
+	/**
+	* The object will no longer be owned by this
+	*
+	* @leave	KErrNotSupported if the the function is not supported
+	*/
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	/**
+	* Protected constructor. First phase construction
+	*/
+	CT_DataBackedUpWindow();
+
+	/**
+	* Second phase construction
+	*/
+	void	ConstructL();
+
+	virtual RDrawableWindow*	GetDrawableWindow() const;
+
+private:
+	/**
+	* Helper methods
+	*/
+	void	DestroyData();
+	void	DoCmdnewL(const TDesC& aSection);
+	void	DoCmdConstructL(const TDesC& aSection);
+	void	DoCmdBitmapHandle();
+	void	DoCmdUpdateScreenL(const TDesC& aSection);
+	void	DoCmdUpdateBackupBitmap();
+	void	DoCmdMaintainBackup();
+
+private:
+	RBackedUpWindow*	iBackedUpWindow;
+	};
+
+#endif /* __T_GRAPHICS_WSERV_BACKEDUPWINDOW_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataBlankWindow.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_BLANKWINDOW_H__)
+#define __T_GRAPHICS_WSERV_BLANKWINDOW_H__
+
+// User Includes
+#include "T_DataWindowBase.h"
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataBlankWindow : public CT_DataWindowBase
+	{
+public:
+	/**
+	* Two phase constructor
+	*/
+	static CT_DataBlankWindow*	NewL();
+
+	/**
+	* Public destructor
+	*/
+	~CT_DataBlankWindow();
+
+	/**
+	* Return a pointer to the object that the data wraps
+	*
+	* @return	pointer to the object that the data wraps
+	*/
+	virtual TAny*	GetObject()	{ return iBlankWindow; }
+
+	/**
+	* Set the object that the data wraps
+	*
+	* @param	aObject object that the wrapper is testing
+	*
+	*/
+	virtual void	SetObjectL(TAny* aAny);
+
+	/**
+	* The object will no longer be owned by this
+	*
+	* @leave	KErrNotSupported if the the function is not supported
+	*/
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	/**
+	* Protected constructor. First phase construction
+	*/
+	CT_DataBlankWindow();
+
+	/**
+	* Second phase construction
+	*/
+	void	ConstructL();
+
+	virtual RWindowBase*	GetWindowBase() const;
+
+private:
+	/**
+	* Helper methods
+	*/
+	void	DestroyData();
+	void	DoCmdnewL(const TDesC& aSection);
+	void	DoCmdConstructL(const TDesC& aSection);
+	void	DoCmdSetColor(const TDesC& aSection);
+	void	DoCmdSetSize(const TDesC& aSection);
+	void	DoCmdSetExtent(const TDesC& aSection);
+
+private:
+	RBlankWindow*	iBlankWindow;
+	};
+
+#endif /* __T_GRAPHICS_WSERV_BLANKWINDOW_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataDirectScreenAccess.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef T_DATADIRECTSCREENACCESS_H_
+#define T_DATADIRECTSCREENACCESS_H_
+
+#include <w32std.h>
+#include "DataWrapperActive.h"
+
+
+class CT_DataDirectScreenAccess : public CDataWrapperActive 
+	, public MDirectScreenAccess
+{
+public:
+	static CT_DataDirectScreenAccess* NewL();
+	~CT_DataDirectScreenAccess();
+	virtual TAny* GetObject() {return iDirectScreenAccess; }
+	virtual void SetObjectL(TAny* aAny);
+	virtual void DisownObjectL();
+	virtual TBool DoCommandL(const TTEFFunction& aCommand, const
+			TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+	//implement the CDataWrapperActive
+	virtual	CActive*	GetActive() {return iDirectScreenAccess; }
+
+protected:
+	CT_DataDirectScreenAccess();
+	void ConstructL();
+
+private: //functions to be tested
+	void DoCmdnewL(const TDesC& aSection);
+	void DoCmdStartL(const TDesC& aSection);
+	void DoCmdGcL(const TDesC& aSection);
+	void DoCmdScreenDeviceL(const TDesC& aSection);
+	void DoCmdDrawRegion(const TDesC& aSection);
+	void DoCmdSetPriority(const TDesC& aSection);
+	void DoCmdBringAppFgL(const TDesC& aSection);
+	void DoCmdDestructor();
+	
+private:	
+	//implement the MDirectScreenAccess
+	void Restart(RDirectScreenAccess::TTerminationReasons aReason);
+	void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);
+	
+	//Helper function
+	void DestroyData();
+	RWsSession* GetRWSessionL(const TDesC& aSection);
+	CWsScreenDevice* GetDevicesL(const TDesC& aSection);
+	RWindow* GetWindowL(const TDesC& aSection);
+	
+private:
+	//Wrapped Object
+	CDirectScreenAccess* iDirectScreenAccess;
+	RDirectScreenAccess::TTerminationReasons iWantedReason;
+	
+
+	
+};
+
+
+
+#endif /*T_DATADIRECTSCREENACCESS_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataDrawableWindow.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_DRAWABLEWINDOW_H__)
+#define __T_GRAPHICS_WSERV_DRAWABLEWINDOW_H__
+
+// User Includes
+#include "T_DataWindowBase.h"
+
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataDrawableWindow : public CT_DataWindowBase
+	{
+public:
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	/**
+	* Protected constructor. First phase construction
+	*/
+	CT_DataDrawableWindow();
+
+	virtual RDrawableWindow*	GetDrawableWindow() const=0;
+	virtual RWindowBase*		GetWindowBase() const;
+
+private:
+	/**
+	* Helper methods
+	*/
+	void	DoCmdScroll(const TDesC& aEntry);
+	void	DoCmdGetDrawRect(const TDesC& aEntry);
+	};
+
+	#endif /* __T_GRAPHICS_WSERV_DRAWABLEWINDOW_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataDsaSession.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef T_DATADSASESSION_H_
+#define T_DATADSASESSION_H_
+
+#include <w32std.h>
+#include "DataWrapperBase.h"
+#include "T_DataWsClientClass.h"
+
+class CT_DataDsaSession : public CDataWrapperBase, public CT_DataWsClientClass
+{
+public:
+	static CT_DataDsaSession* NewL();
+	~CT_DataDsaSession();
+	virtual TAny* GetObject() {return iDsaSession;}
+	virtual void SetObjectL(TAny* aAny);
+	virtual void DisownObjectL();
+	virtual TBool DoCommandL(const TTEFFunction& aCommand, const
+			TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	CT_DataDsaSession();
+	void ConstructL();
+	void RunL(CActive* aActive, TInt aIndex);
+	void DoCancel(CActive* aActive, TInt aIndex);
+	virtual MWsClientClass* GetClientClass() const;
+	
+private://functions used to test.
+	void DoCmdnewL(const TDesC& aSection);
+	void DoCmdConstruct();
+	void DoCmdClose();
+	void DoCmdRequestL(const TDesC& aSection, const TInt aAsyncErrorIndex);
+	void DoCmdCompleted();
+	void DoCmdCancel();
+	
+	void DoCmdEatupMemory(const TDesC& aSection);
+	void DoCmdFreeEatenMemory();
+private:
+	//helper functions
+	void DestroyData();
+	//Helper class
+	RWsSession* GetRWSessionL(const TDesC& aSection);
+	
+	//used in ActiveCallback
+	void RunRequestReady( const TInt aIndex);
+
+private:
+	RDirectScreenAccess* iDsaSession;
+	//ActiveCallback objects
+	CActiveCallback* iActiveRequestReady;
+};
+
+
+#endif /*T_DATADSASESSION_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataFrame.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_FRAME_H__)
+#define __T_GRAPHICS_WSERV_FRAME_H__
+
+#include <w32stdgraphic.h>
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataFrame : public CDataWrapperBase
+	{
+public:
+	/**
+	* Two phase constructor
+	*/
+	static CT_DataFrame*	NewL();
+
+	/**
+	* Public destructor
+	*/
+	~CT_DataFrame();
+
+	/**
+	* Return a pointer to the object that the data wraps
+	*
+	* \return pointer to the object that the data wraps
+	*/
+	virtual TAny*	GetObject()	{ return iFrame; }
+
+	/**
+	* Set the object that the data wraps
+	*
+	* @param	aObject object that the wrapper is testing
+	*
+	*/
+	virtual void	SetObjectL(TAny* aAny);
+
+	/**
+	* The object will no longer be owned by this
+	*
+	* @leave	KErrNotSupported if the the function is not supported
+	*/
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	/**
+	* Protected constructor. First phase construction
+	*/
+	CT_DataFrame();
+
+	/**
+	* Second phase construction
+	*/
+	void  ConstructL();
+
+private:
+	void	DoCmdDestroy();
+    void	DoCmdNewL();
+	void    DoCmdFrameInfo(const TDesC& aSection);
+	void	DoCmdSetFrameInfo(const TDesC& aSection);
+    void    DoCmdBitmapL(const TDesC& aSection);
+    void    DoCmdSetBitmapL(const TDesC& aSection);
+	void    DoCmdMaskL(const TDesC& aSection);
+    void    DoCmdSetMaskL(const TDesC& aSection);
+private:
+    CWsGraphicBitmapAnimation::CFrame* iFrame;
+	};
+
+#endif /* __T_GRAPHICS_WSERV_FRAME_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataSoundPlugIn.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataSoundPlugIn
+*/
+
+#if (!defined __T_WSSOUNDPLUGIN_DATA_H__)
+#define __T_WSSOUNDPLUGIN_DATA_H__
+
+//	EPOC includes
+#include <w32std.h>
+#include <datawrapper.h>
+//	User Includes
+#include "DataWrapperBase.h"
+#include "T_DataWsClientClass.h"
+
+class CT_DataSoundPlugIn : public CDataWrapperBase , public CT_DataWsClientClass
+	{
+public:
+	static CT_DataSoundPlugIn*	NewL();
+
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+	
+	~CT_DataSoundPlugIn();
+
+	virtual TAny*	GetObject();
+
+protected:
+	CT_DataSoundPlugIn();
+	void	ConstructL();
+
+	virtual MWsClientClass*		GetClientClass() const;
+	
+private:
+	void Cleanup();
+	
+	// Commands
+	void DoCmdNewL(const TDesC& aSection);
+	void DoCmdConstruct(const TDesC& aSection);
+	void DoCmdClose();
+	void DoCmdDestroy();
+	void DoCmdIsLoaded(const TDesC& aSection);
+	void DoCmdUnload();
+	void DoCmdLoad(const TDesC& aSection);
+	void DoCmdSetKeyClick(const TDesC& aSection);
+	void DoCmdSetPenClick(const TDesC& aSection);
+	void DoCmdKeyClickEnabled(const TDesC& aSection);
+	void DoCmdPenClickEnabled(const TDesC& aSection);
+	void DoCmdCommandReply(const TDesC& aSection);
+private:
+	RSoundPlugIn*	iSoundPlugIn;
+	};
+
+#endif /* __T_WSSOUNDPLUGIN_DATA_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataWindow.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,110 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_WINDOW_H__)
+#define __T_GRAPHICS_WSERV_WINDOW_H__
+
+// User Includes
+#include "T_DataDrawableWindow.h"
+
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataWindow : public CT_DataDrawableWindow
+	{
+public:
+	/**
+	* Two phase constructor
+	*/
+	static CT_DataWindow*	NewL();
+
+	/**
+	* Public destructor
+	*/
+	~CT_DataWindow();
+
+	/**
+	* Return a pointer to the object that the data wraps
+	*
+	* \return pointer to the object that the data wraps
+	*/
+	virtual TAny*	GetObject()	{ return iWindow; }
+
+	/**
+	* Set the object that the data wraps
+	*
+	* @param	aObject object that the wrapper is testing
+	*
+	*/
+	virtual void	SetObjectL(TAny* aAny);
+
+	/**
+	* The object will no longer be owned by this
+	*
+	* @leave	KErrNotSupported if the the function is not supported
+	*/
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	/**
+	* Protected constructor. First phase construction
+	*/
+	CT_DataWindow();
+
+
+	/**
+	* Second phase construction
+	*/
+	void  ConstructL();
+
+	virtual RDrawableWindow*	GetDrawableWindow() const;
+
+private:
+	/**
+	* Helper methods
+	*/
+	void	DestroyData();
+	void	DoCmdnewL(const TDesC& aSection);
+	void	DoCmdConstructL(const TDesC& aSection);
+	void	DoCmdBeginRedraw(const TDesC& aSection);
+	void	DoCmdEndRedraw();
+	void	DoCmdInvalidate(const TDesC& aSection);
+	void	DoCmdGetInvalidRegionL(const TDesC& aSection);
+	void	DoCmdSetBackgroundColor(const TDesC& aSection);
+	void	DoCmdSetSize(const TDesC& aSection);
+	void	DoCmdSetExtent(const TDesC& aSection);
+	void	DoCmdHandleTransparencyUpdate();
+	void	DoCmdSetTransparencyFactor(const TDesC& aSection);
+	void	DoCmdSetTransparencyBitmapL(const TDesC& aSection);
+	void	DoCmdSetTransparencyWsBitmapL(const TDesC& aSection);
+	void	DoCmdSetNonTransparent();
+	void	DoCmdEnableRedrawStore(const TDesC& aSection);
+	void	DoCmdSetTransparencyAlphaChannel();
+	void	DoCmdSetTransparentRegionL(const TDesC& aSection);
+	void	DoCmdSetTransparencyPolicy(const TDesC& aSection);
+	void	DoCmdIsRedrawStoreEnabled(const TDesC& aSection);
+	void	DoCmdEnableOSB(const TDesC& aSection);
+	void	DoCmdSave();
+
+private:
+	RWindow*	iWindow;
+	};
+#endif /* __T_GRAPHICS_WSERV_WINDOW_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataWindowBase.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_WINDOWBASE_H__)
+#define __T_GRAPHICS_WSERV_WINDOWBASE_H__
+
+// User Includes
+#include "T_DataWindowTreeNode.h"
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataWindowBase : public CT_DataWindowTreeNode
+	{
+public:
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	/**
+	* Protected constructor. First phase construction
+	*/
+	CT_DataWindowBase();
+
+	virtual RWindowBase*		GetWindowBase() const=0;
+	virtual RWindowTreeNode*	GetWindowTreeNode() const;
+
+private:
+	/**
+	* Helper methods
+	*/
+	void	DoCmdActivate();
+	void	DoCmdSetPosition(const TDesC& aSection);
+	void	DoCmdSetSizeErr(const TDesC& aSection);
+	void	DoCmdSetExtentErr(const TDesC& aSection);
+	void	DoCmdSize(const TDesC& aSection);
+	void	DoCmdInquireOffsetL(const TDesC& aSection);
+	void	DoCmdPointerFilter(const TDesC& aSection);
+	void	DoCmdSetPointerGrab(const TDesC& aSection);
+	void	DoCmdClaimPointerGrab(const TDesC& aSection);
+	void	DoCmdSetPointerCapture(const TDesC& aSection);
+	void	DoCmdSetPointerCapturePriority(const TDesC& aSection);
+	void	DoCmdGetPointerCapturePriority(const TDesC& aSection);
+	void	DoCmdSetVisible(const TDesC& aSection);
+	void	DoCmdSetShadowHeight(const TDesC& aSection);
+	void	DoCmdSetShadowDisabled(const TDesC& aSection);
+	void	DoCmdPosition(const TDesC& aSection);
+	void	DoCmdAbsPosition(const TDesC& aSection);
+	void	DoCmdSetCornerType(const TDesC& aSection);
+	void	DoCmdSetShapeL(const TDesC& aSection);
+	void	DoCmdSetRequiredDisplayMode(const TDesC& aSection);
+	void	DoCmdDisplayMode(const TDesC& aSection);
+	void	DoCmdEnableBackup(const TDesC& aSection);
+	void	DoCmdRequestPointerRepeatEvent(const TDesC& aSection);
+	void	DoCmdCancelPointerRepeatEventRequest();
+	void	DoCmdAllocPointerMoveBuffer(const TDesC& aSection);
+	void	DoCmdFreePointerMoveBuffer();
+	void	DoCmdEnablePointerMoveBuffer();
+	void	DoCmdDisablePointerMoveBuffer();
+	void	DoCmdRetrievePointerMoveBufferL(const TDesC& aSection);
+	void	DoCmdDiscardPointerMoveBuffer();
+	void	DoCmdAddKeyRect(const TDesC& aSection);
+	void	DoCmdRemoveAllKeyRects();
+	void	DoCmdPasswordWindow(const TDesC& aSection);
+	void	DoCmdFadeBehind(const TDesC& aSection);
+	void	DoCmdIsFaded(const TDesC& aSection);
+	void	DoCmdIsNonFading(const TDesC& aSection);
+	void	DoCmdMoveToGroupL(const TDesC& aSection);
+	};
+
+#endif /* __T_GRAPHICS_WSERV_WINDOWBASE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataWindowGc.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,108 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_WINDOWGC_H__)
+#define __T_GRAPHICS_WSERV_WINDOWGC_H__
+
+//	User Includes
+#include "DataWrapperBase.h"
+#include "T_DataBitmapContext.h"
+#include "T_DataWsClientClass.h"
+
+//	EPOC Includes
+#include <gdi.h>
+
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataWindowGc : public CT_DataBitmapContext, public CT_DataWsClientClass
+	{
+
+public:
+	/**
+	* Two phase constructor
+	*/
+	static CT_DataWindowGc*	NewL();
+
+	/**
+	* Public destructor
+	*/
+	~CT_DataWindowGc();
+
+	/**
+	* Return a pointer to the object that the data wraps
+	*
+	* \return pointer to the object that the data wraps
+	*/
+	virtual TAny*	GetObject()	{ return iWindowGc; }
+
+	/**
+	* Set the object that the data wraps
+	*
+	* @param	aObject object that the wrapper is testing
+	*
+	*/
+	virtual void	SetObjectL(TAny* aAny);
+
+	/**
+	* The object will no longer be owned by this
+	*
+	* @leave	KErrNotSupported if the the function is not supported
+	*/
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	/**
+	* Protected constructor. First phase construction
+	*/
+	CT_DataWindowGc();
+
+	/**
+	* Second phase construction
+	*/
+	void  ConstructL();
+
+	virtual MWsClientClass*		GetClientClass() const;
+	virtual CGraphicsContext*	GetGraphicsContext() const;
+	virtual CBitmapContext*		GetBitmapContext() const;
+
+
+private:
+	/**
+	* Helper methods
+	*/
+	void	DestroyData();
+	void	DoCmdnewL(const TDesC& aSection);
+	void	DoCmdDestructor();
+	void	DoCmdConstruct();
+	void	DoCmdActivateL(const TDesC& aSection);
+	void	DoCmdDeactivate();
+	void	DoCmdBitBltL(const TDesC& aCommand, const TDesC& aSection, const TInt aAsyncErrorIndex);
+	void	DoCmdBitBltMaskedL(const TDesC& aCommand, const TDesC& aSection, const TInt aAsyncErrorIndex);
+	void	DoCmdSetDitherOrigin(const TDesC& aSection);
+	void	DoCmdSetOpaque(const TDesC& aSection);
+	void	DoCmdDrawWsGraphicL(const TDesC& aSection);
+
+private:
+	CWindowGc*	iWindowGc;
+	};
+
+#endif /* __T_GRAPHICS_WSERV_WINDOWGC_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataWindowGroup.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_WINDOWGROUP_H__)
+#define __T_GRAPHICS_WSERV_WINDOWGROUP_H__
+
+// User Includes
+#include "T_DataWindowTreeNode.h"
+
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataWindowGroup : public CT_DataWindowTreeNode
+	{
+public:
+	/**
+	* Two phase constructor
+	*/
+	static CT_DataWindowGroup*    NewL();
+
+	/**
+	* Public destructor
+	*/
+	~CT_DataWindowGroup();
+
+	/**
+	* Return a pointer to the object that the data wraps
+	*
+	* \return pointer to the object that the data wraps
+	*/
+	virtual TAny*    GetObject()    { return iWindowGroup; }
+
+	/**
+	* Set the object that the data wraps
+	*
+	* @param    aObject object that the wrapper is testing
+	*
+	*/
+	virtual void    SetObjectL(TAny* aAny);
+
+	/**
+	* The object will no longer be owned by this
+	*
+	* @leave	KErrNotSupported if the the function is not supported
+	*/
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	/**
+	* Protected constructor. First phase construction
+	*/
+	CT_DataWindowGroup();
+
+
+	/**
+	* Second phase construction
+	*/
+	void  ConstructL();
+
+	virtual RWindowTreeNode*	GetWindowTreeNode() const;
+
+
+private:
+	/**
+	* Helper methods
+	*/
+	void	DestroyData();
+	void	DoCmdnewL(const TDesC& aSection);
+	void	DoCmdDestructor();
+	void	DoCmdConstructL(const TDesC& aSection);
+	void	DoCmdConstructChildAppL(const TDesC& aSection);
+	void	DoCmdAllowProcessToCreateChildWindowGroups(const TDesC& aSection);
+	void	DoCmdEnableReceiptOfFocus(const TDesC& aSection);
+	void	DoCmdAutoForeground(const TDesC& aSection);
+	void	DoCmdSetOrdinalPriorityAdjust(const TDesC& aSection);
+	void	DoCmdSetOrdinalPositionErr(const TDesC& aSection);
+	void	DoCmdCaptureKey(const TDesC& aSection);
+	void	DoCmdCancelCaptureKey(const TDesC& aSection);
+	void	DoCmdCaptureKeyUpAndDowns(const TDesC& aSection);
+	void	DoCmdCancelCaptureKeyUpAndDowns(const TDesC& aSection);
+	void	DoCmdCaptureLongKey(const TDesC& aSection);
+	void	DoCmdCancelCaptureLongKey(const TDesC& aSection);
+	void	DoCmdAddPriorityKey(const TDesC& aSection);
+	void	DoCmdRemovePriorityKey(const TDesC& aSection);
+	void	DoCmdSetTextCursorL(const TDesC& aSection);
+	void	DoCmdCancelTextCursor();
+	void	DoCmdSetOwningWindowGroupL(const TDesC& aSection);
+	void	DoCmdDefaultOwningWindow();
+	void	DoCmdSetName(const TDesC& aSection);
+	void	DoCmdName(const TDesC& aSection);
+	void	DoCmdIdentifier();
+	void	DoCmdDisableKeyClick(const TDesC& aSection);
+	void	DoCmdEnableScreenChangeEvents();
+	void	DoCmdDisableScreenChangeEvents();
+	void	DoCmdSimulatePointerEvent(const TDesC& aSection);
+	void	DoCmdSetChildGroupL(const TDesC& aSection);
+	void	DoCmdClearChildGroup();
+
+private:
+	RWindowGroup*	iWindowGroup;
+	TInt32			iCaptureKeyHandle;
+	};
+
+#endif /* __T_GRAPHICS_WSERV_WINDOWGROUP_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataWindowInfo.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_WINDOWINFO_H__)
+#define __T_GRAPHICS_WSERV_WINDOWINFO_H__
+
+//	User Includes
+#include "DataWrapperBase.h"
+
+//	EPOC Includes
+#include <w32std.h>
+#include <w32adll.h>
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataWindowInfo : public CDataWrapperBase
+	{
+
+public:
+	static CT_DataWindowInfo*	NewL();
+
+	~CT_DataWindowInfo();
+
+	virtual TAny*	GetObject();
+	virtual void	SetObjectL(TAny* aAny);
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	CT_DataWindowInfo();
+	void  ConstructL();
+
+private:
+	/**
+	 * Helper methods
+	 */
+	void	DestroyData();
+	void	DoCmdnew();
+	void	DoCmdDestructor();
+	void	DoCmdGetRedrawRegionAndRedrawShadowRegion(const TDesC& aEntry);
+
+private:
+	TWindowInfo*	iWindowInfo;
+	const TRegion*	iRedrawRegion;
+	const TRegion*	iRedrawShadowRegion;
+	};
+
+#endif /* __T_GRAPHICS_WSERV_WINDOWINFO_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataWindowTreeNode.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,85 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_WINDOWTREENODE_H__)
+#define __T_GRAPHICS_WSERV_WINDOWTREENODE_H__
+
+// User Includes
+#include "T_DataWsClientClass.h"
+#include "DataWrapperBase.h"
+#include "T_GraphicsUtil.h"
+
+// EPOC includes
+#include <w32std.h>
+#include <e32keys.h>
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataWindowTreeNode : public CDataWrapperBase, public CT_DataWsClientClass
+	{
+public:
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	/**
+	* Protected constructor. First phase construction
+	*/
+	CT_DataWindowTreeNode();
+
+	virtual MWsClientClass*		GetClientClass() const;
+	virtual RWindowTreeNode*	GetWindowTreeNode() const=0;
+
+private:
+	/**
+	* Helper methods
+	*/
+	void	DoCmdClose();
+	void	DoCmdDestroyL();
+	void	DoCmdParent(const TDesC& aSection);
+	void	DoCmdPrevSibling(const TDesC& aSection);
+	void	DoCmdNextSibling(const TDesC& aSection);
+	void	DoCmdChild(const TDesC& aSection);
+	void	DoCmdOrdinalPriority(const TDesC& aSection);
+	void	DoCmdOrdinalPosition(const TDesC& aSection);
+	void	DoCmdFullOrdinalPosition(const TDesC& aSection);
+	void	DoCmdSetOrdinalPosition(const TDesC& aSection);
+	void	DoCmdWindowGroupId();
+	void	DoCmdSetPointerCursor(const TDesC& aSection);
+	void	DoCmdSetCustomPointerCursorL(const TDesC& aSection);
+	void	DoCmdEnableOnEvents(const TDesC& aSection);
+	void	DoCmdDisableOnEvents();
+	void	DoCmdEnableGroupChangeEvents();
+	void	DoCmdDisableGroupChangeEvents();
+	void	DoCmdEnableFocusChangeEvents();
+	void	DoCmdDisableFocusChangeEvents();
+	void	DoCmdEnableGroupListChangeEvents();
+	void	DoCmdDisableGroupListChangeEvents();
+	void	DoCmdEnableVisibilityChangeEvents();
+	void	DoCmdDisableVisibilityChangeEvents();
+	void	DoCmdEnableErrorMessages(const TDesC& aSection);
+	void	DoCmdDisableErrorMessages();
+	void	DoCmdEnableModifierChangedEvents(const TDesC& aSection);
+	void	DoCmdDisableModifierChangedEvents();
+	void	DoCmdSetNonFading(const TDesC& aSection);
+	void	DoCmdSetFaded(const TDesC& aSection);
+	void	DoCmdClearPointerCursor();
+	};
+
+#endif /* __T_GRAPHICS_WSERV_WINDOWTREENODE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataWsBitmap.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_WSBITMAP_H__)
+#define __T_GRAPHICS_WSERV_WSBITMAP_H__
+
+// User Includes
+#include "T_DataWsClientClass.h"
+#include "T_DataFbsBitmap.h"
+
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataWsBitmap : public CT_DataFbsBitmap, public CT_DataWsClientClass
+	{
+
+public:
+	/**
+	* Two phase constructor
+	*/
+	static CT_DataWsBitmap*	NewL();
+
+	/**
+	* Public destructor
+	*/
+	~CT_DataWsBitmap();
+
+	/**
+	* Return a pointer to the object that the data wraps
+	*
+	* \return pointer to the object that the data wraps
+	*/
+	virtual TAny*	GetObject()	{ return iWsBitmap; }
+
+	/**
+	* Set the object that the data wraps
+	*
+	* @param	aObject object that the wrapper is testing
+	*
+	*/
+	virtual void	SetObjectL(TAny* aAny);
+
+	/**
+	* The object will no longer be owned by this
+	*
+	* @leave	KErrNotSupported if the the function is not supported
+	*/
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	/**
+	* Protected constructor. First phase construction
+	*/
+	CT_DataWsBitmap();
+
+
+	/**
+	* Second phase construction
+	*/
+	void  ConstructL();
+
+	virtual MWsClientClass* GetClientClass() const;
+
+private:
+	/**
+	* Helper methods
+	*/
+	void	DestroyData();
+	void	DoCmdnewL(const TDesC& aEntry);
+	void	DoCmdDestructor();
+	void	DoCmdCreate(const TDesC& aEntry);
+	void	DoCmdDuplicateL(const TDesC& aEntry);
+	void	DoCmdLoad(const TDesC& aEntry);
+	void	DoCmdInternalizeL(const TDesC& aEntry);
+	void	DoCmdReset();
+
+private:
+	CWsBitmap*	iWsBitmap;
+	};
+
+#endif /* __T_GRAPHICS_WSERV_WSBITMAP_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataWsClientClass.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_CLIENTCLASS_H__)
+#define __T_GRAPHICS_WSERV_CLIENTCLASS_H__
+
+//	User Includes
+#include "DataWrapperBase.h"
+
+//	EPOC Includes
+#include <w32std.h>
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataWsClientClass
+	{
+public:
+	virtual TBool	DoCommandL(CDataWrapperBase& aDataWrapper, const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	virtual MWsClientClass*	GetClientClass() const=0;
+
+private:
+	/**
+	* Helper methods
+	*/
+	void	DoCmdWsHandle(CDataWrapperBase& aDataWrapper, const TDesC& aSection);
+	};
+
+#endif /* __T_GRAPHICS_WSERV_CLIENTCLASS_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataWsEvent.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_EVENT_H__)
+#define __T_GRAPHICS_WSERV_EVENT_H__
+
+//	User Includes
+#include "DataWrapperBase.h"
+
+//	EPOC Includes
+#include <w32std.h>
+
+class CT_DataWsEvent : public CDataWrapperBase
+	{
+public:
+	static CT_DataWsEvent*	NewL();
+
+	~CT_DataWsEvent();
+
+	virtual TAny*	GetObject();
+	virtual void	SetObjectL(TAny* aAny);
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	CT_DataWsEvent();
+	void	ConstructL();
+
+private:
+	/**
+	* Helper methods
+	*/
+	void	DestroyData();
+	void	DoCmdnew();
+	void	DoCmdErrorMessage(const TDesC& aSection);
+	void	DoCmdEventData(const TDesC& aSection);
+	void	DoCmdHandle(const TDesC& aSection);
+	void	DoCmdInt(const TDesC& aSection);
+	void	DoCmdKey(const TDesC& aSection);
+	void	DoCmdModifiersChanged(const TDesC& aSection);
+	void	DoCmdPointer(const TDesC& aSection);
+	void	DoCmdSetHandle(const TDesC& aSection);
+	void	DoCmdSetTimeNow();
+	void	DoCmdSetType(const TDesC& aSection);
+	void	DoCmdTime();
+	void	DoCmdType(const TDesC& aSection);
+	void	DoCmdVisibilityChanged(const TDesC& aSection);
+
+private:
+	TWsEvent*			iWsEvent;
+    };
+
+#endif /* __T_GRAPHICS_WSERV_EVENT_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataWsGraphic.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_WSGRAPHIC_H__)
+#define __T_GRAPHICS_WSERV_WSGRAPHIC_H__
+
+//	User Includes
+#include "DataWrapperBase.h"
+
+//	EPOC Includes
+#include <w32std.h>
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataWsGraphic : public CDataWrapperBase
+	{
+public:
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	/**
+	* Protected constructor. First phase construction
+	*/
+	CT_DataWsGraphic();
+
+	virtual CWsGraphic*	GetWsGraphic() const = 0;
+	virtual TInt		Share(TSecureId aClientId) = 0;
+	virtual TInt		ShareGlobally() = 0;
+	virtual TInt		UnShare(TSecureId aClientId) = 0;
+	virtual TInt		UnShareGlobally() = 0;
+
+private:
+	//	Helper methods
+	void	DoCmdDestructorL();
+	void	DoCmdDestroy();
+	void	DoCmdIdL(const TDesC& aEntry);
+	void	DoCmdIsActive(const TDesC& aEntry);
+	void	DoCmdShareGlobally();
+	void	DoCmdShare(const TDesC& aEntry);
+	void	DoCmdUnShare(const TDesC& aEntry);
+	void	DoCmdUnShareGlobally();
+	};
+
+#endif /* __T_GRAPHICS_WSERV_WSGRAPHIC_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataWsGraphicAnimation.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_DATA_WS_GRAPHIC_ANNIMATION_H__)
+#define __T_DATA_WS_GRAPHIC_ANNIMATION_H__
+
+//	User Includes
+#include "T_DataWsGraphicMsgFixedBase.h"
+
+//	EPOC Includes
+#include <w32stdgraphic.h>
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataWsGraphicAnimation : public CT_DataWsGraphicMsgFixedBase
+	{
+public:
+	CT_DataWsGraphicAnimation();
+	~CT_DataWsGraphicAnimation();
+
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+	virtual TAny*	GetObject();
+
+protected:
+	//	CT_DataWsGraphicMsgFixedBase implementation
+	virtual TWsGraphicMsgFixedBase*	GetWsGraphicMsgFixedBase() const;
+
+private:
+	/**
+	* Helper methods
+	*/
+	void	DestroyData();
+	void	DoCmdnew();
+	void	DoCmdIsPaused(const TDesC& aSection);
+	void	DoCmdIsPlaying(const TDesC& aSection);
+	void	DoCmdIsStopped(const TDesC& aSection);
+	void	DoCmdIsStopping(const TDesC& aSection);
+	void	DoCmdLoops(const TDesC& aSection);
+	void	DoCmdPause();
+	void	DoCmdPlay(const TDesC& aSection);
+	void	DoCmdStop(const TDesC& aSection);
+
+private:
+	TWsGraphicAnimation*	iWsGraphicAnimation;
+	};
+
+#endif /* __T_DATA_WS_GRAPHIC_ANNIMATION_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataWsGraphicBitmap.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,101 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_WSGRAPHICBITMAP_H__)
+#define __T_GRAPHICS_WSERV_WSGRAPHICBITMAP_H__
+
+// User Includes
+#include "T_DataWsGraphic.h"
+
+
+// EPOC includes
+#include <w32stdgraphic.h>
+
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataWsGraphicBitmap : public CT_DataWsGraphic
+	{
+
+public:
+	/**
+	* Two phase constructor
+	*/
+	static CT_DataWsGraphicBitmap*	NewL();
+
+	/**
+	* Public destructor
+	*/
+	~CT_DataWsGraphicBitmap();
+
+	/**
+	* Return a pointer to the object that the data wraps
+	*
+	* \return pointer to the object that the data wraps
+	*/
+	virtual TAny*	GetObject()	{ return iWsGraphicBitmap; }
+
+	/**
+	* Set the object that the data wraps
+	*
+	* @param	aObject object that the wrapper is testing
+	*
+	*/
+	virtual void	SetObjectL(TAny* aAny);
+
+	/**
+	* The object will no longer be owned by this
+	*
+	* @leave	KErrNotSupported if the the function is not supported
+	*/
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	/**
+	* Protected constructor. First phase construction
+	*/
+	CT_DataWsGraphicBitmap();
+
+	/**
+	* Second phase construction
+	*/
+	void  ConstructL();
+
+	//	CT_DataWsGraphic Implementation
+	virtual CWsGraphic*	GetWsGraphic() const;
+	virtual TInt		Share(TSecureId aClientId);
+	virtual TInt		ShareGlobally();
+	virtual TInt		UnShare(TSecureId aClientId);
+	virtual TInt		UnShareGlobally();
+
+private:
+	/**
+	* Helper methods
+	*/
+	void	DestroyData();
+	void	DoCmdNewL(const TDesC& aEntry);
+	void	DoCmdDestructor();
+
+private:
+	CWsGraphicBitmap*	iWsGraphicBitmap;
+
+	};
+#endif /* __T_GRAPHICS_WSERV_WSGRAPHICBITMAP_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataWsGraphicBitmapAnimation.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_WSGRAPHICBITMAPANIMATION_H__)
+#define __T_GRAPHICS_WSERV_WSGRAPHICBITMAPANIMATION_H__
+
+#include <w32stdgraphic.h>
+#include "T_DataWsGraphic.h"
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataWsGraphicBitmapAnimation : public CT_DataWsGraphic
+	{
+public:
+	/**
+	* Two phase constructor
+	*/
+	static CT_DataWsGraphicBitmapAnimation*	NewL();
+
+	/**
+	* Public destructor
+	*/
+	~CT_DataWsGraphicBitmapAnimation();
+
+	/**
+	* Return a pointer to the object that the data wraps
+	*
+	* \return pointer to the object that the data wraps
+	*/
+	virtual TAny*	GetObject()	{ return iWsGraphicBitmapAnimation; }
+
+	/**
+	* Set the object that the data wraps
+	*
+	* @param	aObject object that the wrapper is testing
+	*
+	*/
+	virtual void	SetObjectL(TAny* aAny);
+
+	/**
+	* The object will no longer be owned by this
+	*
+	* @leave	KErrNotSupported if the the function is not supported
+	*/
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	/**
+	* Protected constructor. First phase construction
+	*/
+	CT_DataWsGraphicBitmapAnimation();
+
+	/**
+	* Second phase construction
+	*/
+	void  ConstructL();
+
+	//from CT_DataWsGraphic
+	CWsGraphic*	GetWsGraphic() const {return iWsGraphicBitmapAnimation;};
+	TInt		Share(TSecureId aClientId);
+	TInt		ShareGlobally();
+	TInt		UnShare(TSecureId aClientId);
+	TInt		UnShareGlobally();
+	
+private:
+	void	DoCmdDestroy();
+    void	DoCmdNewL(const TDesC& aSection);
+    void	Util_StartAnimTesterClientL(const TDesC& aSection);
+    void	Util_CloseAnimTesterClientL(const TDesC& aSection);
+    
+private:
+    CWsGraphicBitmapAnimation* iWsGraphicBitmapAnimation;
+	};
+
+#endif /* __T_GRAPHICS_WSERV_WSGRAPHICBITMAPANIMATION_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataWsGraphicFrameRate.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_DATA_WS_GRAPHIC_FRAME_RATE_H__)
+#define __T_DATA_WS_GRAPHIC_FRAME_RATE_H__
+
+//	User Includes
+#include "T_DataWsGraphicMsgFixedBase.h"
+
+//	EPOC Includes
+#include <w32stdgraphictest.h>
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataWsGraphicFrameRate : public CT_DataWsGraphicMsgFixedBase
+	{
+public:
+	CT_DataWsGraphicFrameRate();
+	~CT_DataWsGraphicFrameRate();
+
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+	virtual TAny*	GetObject();
+
+protected:
+	//	CT_DataWsGraphicMsgFixedBase implementation
+	virtual TWsGraphicMsgFixedBase*	GetWsGraphicMsgFixedBase() const;
+
+private:
+	/**
+	* Helper methods
+	*/
+	void	DestroyData();
+	void	DoCmdnew();
+
+private:
+	TWsGraphicFrameRate*	iWsGraphicFrameRate;
+	};
+
+#endif /* __T_DATA_WS_GRAPHIC_FRAME_RATE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataWsGraphicMsgBuf.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,101 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_WSGRAPHICMSGBUF_H__)
+#define __T_GRAPHICS_WSERV_WSGRAPHICMSGBUF_H__
+
+//	User Includes
+#include "DataWrapperBase.h"
+
+//	EPOC Includes
+#include <w32std.h>
+#include <w32stdgraphictest.h>
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataWsGraphicMsgBuf : public CDataWrapperBase
+	{
+
+public:
+	/**
+	* Two phase constructor
+	*/
+	static CT_DataWsGraphicMsgBuf*    NewL();
+
+	/**
+	* Public destructor
+	*/
+	~CT_DataWsGraphicMsgBuf();
+
+	/**
+	* Return a pointer to the object that the data wraps
+	*
+	* \return pointer to the object that the data wraps
+	*/
+	virtual TAny*    GetObject()    { return iWsGraphicMsgBuf; }
+
+	/**
+	* Set the object that the data wraps
+	*
+	* @param    aObject object that the wrapper is testing
+	*
+	*/
+	virtual void    SetObjectL(TAny* aAny);
+
+	/**
+	* The object will no longer be owned by this
+	*
+	* @leave	KErrNotSupported if the the function is not supported
+	*/
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	/**
+	* Protected constructor. First phase construction
+	*/
+	CT_DataWsGraphicMsgBuf();
+
+	/**
+	* Second phase construction
+	*/
+	void  ConstructL();
+
+private:
+	/**
+	* Helper methods
+	*/
+	void	DestroyData();
+	void	DoCmdnew();
+	void	DoCmdClose();
+	void	DoCmdCleanupClosePushL();
+	void	DoCmdAppendL(const TDesC& aSection);
+	void	DoCmdRemove(const TDesC& aSection);
+	void	DoCmdCount(const TDesC& aSection);
+	void	DoCmdTypeId(const TDesC& aSection);
+	void	DoCmdDataL(const TDesC& aSection);
+	void	DoCmdGetFixedMsg(const TDesC& aSection);
+	void	DoCmdPckg();
+
+private:
+	RWsGraphicMsgBuf*    iWsGraphicMsgBuf;
+	};
+
+#endif /* __T_GRAPHICS_WSERV_WSGRAPHICMSGBUF_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataWsGraphicMsgFixedBase.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_DATA_WS_GRAPHIC_MSG_FIXED_BASE_H__)
+#define __T_DATA_WS_GRAPHIC_MSG_FIXED_BASE_H__
+
+// User Includes
+#include "DataWrapperBase.h"
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataWsGraphicMsgFixedBase : public CDataWrapperBase
+	{
+public:
+	~CT_DataWsGraphicMsgFixedBase();
+
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+	TPtrC8			GetPckg();
+
+protected:
+	CT_DataWsGraphicMsgFixedBase();
+
+	virtual TWsGraphicMsgFixedBase*	GetWsGraphicMsgFixedBase() const = 0;
+
+private:
+	/**
+	* Helper methods
+	*/
+	void	DoCmdPckg();
+	void	DoCmdSize(const TDesC& aSection);
+	void	DoCmdTypeId(const TDesC& aSection);
+
+private:
+	TPtrC8	iPckg;
+	};
+
+#endif /* __T_DATA_WS_GRAPHIC_MSG_FIXED_BASE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataWsPointerCursor.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_WSPOINTERCURSOR_H__)
+#define __T_GRAPHICS_WSERV_WSPOINTERCURSOR_H__
+
+// User Includes
+#include "T_DataWsSpriteBase.h"
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataWsPointerCursor : public CT_DataWsSpriteBase
+	{
+public:
+	/**
+	* Two phase constructor
+	*/
+	static CT_DataWsPointerCursor*	NewL();
+
+	/**
+	* Public destructor
+	*/
+	~CT_DataWsPointerCursor();
+
+	/**
+	* Return a pointer to the object that the data wraps
+	*
+	* \return pointer to the object that the data wraps
+	*/
+	virtual TAny*	GetObject()	{ return iWsPointerCursor; }
+
+	/**
+	* Set the object that the data wraps
+	*
+	* @param	aObject object that the wrapper is testing
+	*
+	*/
+	virtual void	SetObjectL(TAny* aAny);
+
+	/**
+	* The object will no longer be owned by this
+	*
+	* @leave	KErrNotSupported if the the function is not supported
+	*/
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	/**
+	* Protected constructor. First phase construction
+	*/
+	CT_DataWsPointerCursor();
+
+	/**
+	* Second phase construction
+	*/
+	void  ConstructL();
+
+	virtual RWsSpriteBase*		GetWsSpriteBase() const{return iWsPointerCursor;}
+private:
+	void	DestroyData();
+    void	DoCmdNewL(const TDesC& aSection);
+	void    DoCmdConstructL(const TDesC& aSection);
+	
+private:
+    RWsPointerCursor* iWsPointerCursor;
+	};
+
+#endif /* __T_GRAPHICS_WSERV_WSPOINTERCURSOR_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataWsPriorityKeyEvent.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_PRIORITYKEYEVENT_H__)
+#define __T_GRAPHICS_WSERV_PRIORITYKEYEVENT_H__
+
+//	User Includes
+#include "DataWrapperBase.h"
+
+//	EPOC Includes
+#include <w32std.h>
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataWsPriorityKeyEvent : public CDataWrapperBase
+	{
+public:
+	/**
+	* Two phase constructor
+	*/
+	static CT_DataWsPriorityKeyEvent*	NewL();
+
+	/**
+	* Public destructor
+	*/
+	~CT_DataWsPriorityKeyEvent();
+
+	/**
+	* Return a pointer to the object that the data wraps
+	*
+	* \return pointer to the object that the data wraps
+	*/
+	virtual TAny*	GetObject()	{ return iWsPriorityKeyEvent; }
+
+	/**
+	* Set the object that the data wraps
+	*
+	* @param    aObject object that the wrapper is testing
+	*
+	*/
+	virtual void	SetObjectL(TAny* aAny);
+
+	/**
+	* The object will no longer be owned by this
+	*
+	* @leave	KErrNotSupported if the the function is not supported
+	*/
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	/**
+	* Protected constructor. First phase construction
+	*/
+	CT_DataWsPriorityKeyEvent();
+
+	/**
+	* Second phase construction
+	*/
+	void	ConstructL();
+
+private:
+	/**
+	* Helper methods
+	*/
+	void	DestroyData();
+
+	void	DoCmdnew();
+	void	DoCmdHandle(const TDesC& aEntry);
+	void	DoCmdKey(const TDesC& aEntry);
+	void	DoCmdSetHandle(const TDesC& aEntry);
+
+private:
+    TWsPriorityKeyEvent*	iWsPriorityKeyEvent;
+    };
+
+#endif /* __T_GRAPHICS_WSERV_PRIORITYKEYEVENT_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataWsRedrawEvent.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_REDRAWEVENT_H__)
+#define __T_GRAPHICS_WSERV_REDRAWEVENT_H__
+
+//	User Includes
+#include "DataWrapperBase.h"
+
+//	EPOC Includes
+#include <w32std.h>
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataWsRedrawEvent : public CDataWrapperBase
+	{
+public:
+	/**
+	* Two phase constructor
+	*/
+	static CT_DataWsRedrawEvent*	NewL();
+
+	/**
+	* Public destructor
+	*/
+	~CT_DataWsRedrawEvent();
+
+	/**
+	* Return a pointer to the object that the data wraps
+	*
+	* @return	pointer to the object that the data wraps
+	*/
+	virtual TAny*	GetObject()	{ return iWsRedrawEvent; }
+
+	/**
+	* Set the object that the data wraps
+	*
+	* @param	aObject object that the wrapper is testing
+	*
+	*/
+	virtual void    SetObjectL(TAny* aAny);
+
+	/**
+	* The object will no longer be owned by this
+	*
+	* @leave	KErrNotSupported if the the function is not supported
+	*/
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	/**
+	* Protected constructor. First phase construction
+	*/
+	CT_DataWsRedrawEvent();
+
+	/**
+	* Second phase construction
+	*/
+	void  ConstructL();
+
+private:
+	/**
+	* Helper methods
+	*/
+	void	DestroyData();
+
+	void	DoCmdnew();
+	void	DoCmdHandle(const TDesC& aEntry);
+	void	DoCmdRect(const TDesC& aEntry);
+
+private:
+	TWsRedrawEvent*	iWsRedrawEvent;
+	};
+
+#endif /* __T_GRAPHICS_WSERV_REDRAWEVENT_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataWsScreenDevice.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_SCREENDEVICE_H__)
+#define __T_GRAPHICS_WSERV_SCREENDEVICE_H__
+
+//	User Includes
+#include "T_DataBitmapDevice.h"
+#include "T_DataWsClientClass.h"
+
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataWsScreenDevice : public CT_DataBitmapDevice, public CT_DataWsClientClass
+	{
+public:
+	static CT_DataWsScreenDevice*	NewL();
+
+	~CT_DataWsScreenDevice();
+
+	virtual TAny*	GetObject();
+	virtual void	SetObjectL(TAny* aAny);
+
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	CT_DataWsScreenDevice();
+	void  ConstructL();
+
+	virtual MWsClientClass*		GetClientClass() const;
+	virtual MGraphicsDeviceMap*	GetGraphicsDeviceMap() const;
+	virtual CGraphicsDevice*	GetGraphicsDevice() const;
+	virtual CBitmapDevice*		GetBitmapDevice() const;
+
+private:
+	/**
+	* Helper methods
+	*/
+	void	DestroyData();
+	void	DoCmdnewL(const TDesC& aSection);
+	void	DoCmdDestructor();
+	void	DoCmdConstruct(const TDesC& aSection);
+	void	DoCmdCopyScreenToBitmapL(const TDesC& aSection);
+	void	DoCmdCreateContextL(const TDesC& aSection);
+	void	DoCmdCurrentScreenMode(const TDesC& aSection);
+	void	DoCmdGetCurrentScreenModeScale(const TDesC& aSection);
+	void	DoCmdGetCurrentScreenModeScaledOrigin(const TDesC& aSection);
+	void	DoCmdGetDefaultScreenModeOrigin(const TDesC& aSection);
+	void	DoCmdGetDefaultScreenSizeAndRotation(const TDesC& aSection);
+	void	DoCmdGetFontByIdL(const TDesC& aSection);
+	void	DoCmdGetRotationsListL(const TDesC& aSection);
+	void	DoCmdGetScreenModeDisplayMode(const TDesC& aSection);
+	void	DoCmdGetScreenModeOrigin(const TDesC& aSection);
+	void	DoCmdGetScreenModeScale(const TDesC& aSection);
+	void	DoCmdGetScreenModeScaledOrigin(const TDesC& aSection);
+	void	DoCmdGetScreenModeSizeAndRotation(const TDesC& aSection);
+	void	DoCmdGetScreenNumber(const TDesC& aSection);
+	void	DoCmdGetScreenSizeModeListL(const TDesC& aSection);
+	void	DoCmdNumScreenModes(const TDesC& aSection);
+	void	DoCmdPointerRect(const TDesC& aSection);
+	void	DoCmdRectCompare(const TDesC& aSection);
+	void	DoCmdScreenModeEnforcement(const TDesC& aSection);
+	void	DoCmdSetAppScreenMode(const TDesC& aSection);
+	void	DoCmdSetBackLight(const TDesC& aSection);
+	void	DoCmdSetCustomPaletteL(const TDesC& aSection);
+	void	DoCmdSetScreenSizeAndRotation(const TDesC& aSection);
+
+	void	DoCmdcheckPixels(const TDesC& aSection);
+	void	DoCmdcheckLineColor(const TDesC& aSection);
+	void	DoCmdcheckRectColor(const TDesC& aSection);
+
+private:
+	CWsScreenDevice*	iWsScreenDevice;
+	};
+
+#endif /* __T_GRAPHICS_WSERV_SCREENDEVICE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataWsSession.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,168 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_SESSION_H__)
+#define __T_GRAPHICS_WSERV_SESSION_H__
+
+//	User Includes
+#include "DataWrapperBase.h"
+#include "T_DataWsClientClass.h"
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataWsSession : public CDataWrapperBase, public CT_DataWsClientClass
+	{
+public:
+	static CT_DataWsSession*    NewL();
+
+	~CT_DataWsSession();
+
+	virtual TAny*	GetObject()	{ return iWsSession; }
+
+    virtual void    SetObjectL(TAny* aAny);
+
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	CT_DataWsSession();
+
+	void	ConstructL();
+
+	void	RunL(CActive* aActive, TInt aIndex);
+	void	DoCancel(CActive* aActive, TInt aIndex);
+
+	virtual MWsClientClass* GetClientClass() const;
+
+private:
+	/**
+	* Helper methods
+	*/
+	void	DestroyData();
+	void	DoCmdnew();
+	void	DoCmdConnectL(const TDesC& aSection);
+	void	DoCmdClose();
+	void	DoCmdVersion(const TDesC& aSection);
+	void	DoCmdSetHotKey(const TDesC& aSection);
+	void	DoCmdClearHotKeys(const TDesC& aSection);
+	void	DoCmdRestoreDefaultHotKey(const TDesC& aSection);
+	void	DoCmdEventReady(const TDesC& aSection, TInt aAsyncErrorIndex);
+	void	DoCmdEventReadyCancel();
+	void	DoCmdGetEventL(const TDesC& aSection);
+	void	DoCmdPurgePointerEvents();
+	void	DoCmdRedrawReady(const TDesC& aSection, TInt aAsyncErrorIndex);
+	void	DoCmdRedrawReadyCancel();
+	void	DoCmdGetRedrawL(const TDesC& aSection);
+	void	DoCmdPriorityKeyReady(const TDesC& aSection, TInt aAsyncErrorIndex);
+	void	DoCmdPriorityKeyReadyCancel();
+	void	DoCmdGetPriorityKeyL(const TDesC& aSection);
+	void	DoCmdFlush();
+	void	DoCmdSetAutoFlush(const TDesC& aSection);
+	void	DoCmdSetKeyboardRepeatRate(const TDesC& aSection);
+	void	DoCmdGetKeyboardRepeatRate(const TDesC& aSection);
+	void	DoCmdGetDoubleClickSettings(const TDesC& aSection);
+	void	DoCmdSetDoubleClick(const TDesC& aSection);
+	void	DoCmdNumWindowGroups(const TDesC& aSection);
+	void	DoCmdWindowGroupListL(const TDesC& aSection);
+	void	DoCmdGetFocusWindowGroup(const TDesC& aSection);
+	void	DoCmdGetDefaultOwningWindow(const TDesC& aSection);
+	void	DoCmdSetWindowGroupOrdinalPosition(const TDesC& aSection);
+	void	DoCmdGetWindowGroupClientThreadId(const TDesC& aSection);
+	void	DoCmdGetWindowGroupHandle(const TDesC& aSection);
+	void	DoCmdGetWindowGroupOrdinalPriority(const TDesC& aSection);
+	void	DoCmdGetWindowGroupNameFromIdentifier(const TDesC& aSection);
+	void	DoCmdFindWindowGroupIdentifier(const TDesC& aSection);
+	void	DoCmdFetchMessage(const TDesC& aSection);
+	void	DoCmdSetShadowVector(const TDesC& aSection);
+	void	DoCmdShadowVector(const TDesC& aSection);
+	void	DoCmdSetBackgroundColor(const TDesC& aSection);
+	void	DoCmdGetBackgroundColor(const TDesC& aSection);
+	void	DoCmdSetSystemPointerCursor(const TDesC& aSection);
+	void	DoCmdClearSystemPointerCursor(const TDesC& aSection);
+	void	DoCmdClaimSystemPointerCursorList();
+	void	DoCmdFreeSystemPointerCursorList();
+	void	DoCmdSetCustomTextCursorL(const TDesC& aSection);
+	void	DoCmdResourceCount(const TDesC& aSection);
+	void	DoCmdPasswordEntered();
+	void	DoCmdComputeMode(const TDesC& aSection);
+	void	DoCmdHeapCount(const TDesC& aSection);
+	void	DoCmdSetModifierState(const TDesC& aSection);
+	void	DoCmdGetModifierState(const TDesC& aSection);
+	void	DoCmdRequestOffEventsL(const TDesC& aSection);
+	void	DoCmdGetDefModeMaxNumColors(const TDesC& aSection);
+	void	DoCmdGetColorModeListL(const TDesC& aSection);
+	void	DoCmdSetPointerCursorArea(const TDesC& aSection);
+	void	DoCmdPointerCursorArea(const TDesC& aSection);
+	void	DoCmdSetPointerCursorMode(const TDesC& aSection);
+	void	DoCmdSetClientCursorMode(const TDesC& aSection);
+	void	DoCmdPointerCursorMode(const TDesC& aSection);
+	void	DoCmdSetDefaultSystemPointerCursor(const TDesC& aSection);
+	void	DoCmdClearDefaultSystemPointerCursor();
+	void	DoCmdSetPointerCursorPosition(const TDesC& aSection);
+	void	DoCmdPointerCursorPosition(const TDesC& aSection);
+	void	DoCmdSetDefaultFadingParameters(const TDesC& aSection);
+	void	DoCmdPrepareForSwitchOff();
+	void	DoCmdSetBufferSizeL(const TDesC& aSection);
+	void	DoCmdSetMaxBufferSizeL(const TDesC& aSection);
+	void	DoCmdSetSystemFaded(const TDesC& aSection);
+	void	DoCmdSetFocusScreen(const TDesC& aSection);
+	void	DoCmdGetFocusScreen(const TDesC& aSection);
+	void	DoCmdClearAllRedrawStores();
+	void	DoCmdLogCommand(const TDesC& aSection);
+	void	DoCmdLogMessage(const TDesC& aSection);
+	void	DoCmdNumberOfScreens(const TDesC& aSection);
+	void	DoCmdSimulateRawEvent(const TDesC& aSection);
+	void	DoCmdSimulateKeyEvent(const TDesC& aSection);
+
+	//	CActiveCallback support
+	void	RunEventReady(const TInt aIndex);
+	void	DoCancelEventReady(const TInt aIndex);
+
+	void	RunPriorityKeyReady(const TInt aIndex);
+	void	DoCancelPriorityKeyReady(const TInt aIndex);
+
+	void	RunRedrawReady(const TInt aIndex);
+	void	DoCancelRedrawReady(const TInt aIndex);
+
+private:
+	RWsSession*					iWsSession;
+	/** vaiable that temporarily stores value of server resource count that is set
+	* by iSession->ResourceCount()
+	*/
+	TInt						iResourceCount;
+	TInt						iNumWinGroup;
+	TInt						iColorModeCount;
+	TInt						iWindowGroupIdentifier;
+
+	/** Active object for EventReady async operation */
+	CActiveCallback*			iActiveEventReady;
+
+	/** Active object for PriorityKeyReady async operation */
+	CActiveCallback*			iActivePriorityKeyReady;
+
+	/** Active object for RedrawReady async operation */
+	CActiveCallback*			iActiveRedrawReady;
+
+	/** Keyboard repeat rate data */
+	TTimeIntervalMicroSeconds32	iKeyboardRepeateRateInitialTime;
+	TTimeIntervalMicroSeconds32	iKeyboardRepeateRateTime;
+	};
+
+#endif /* __T_GRAPHICS_WSERV_SESSION_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataWsSprite.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_WSSPRITE_H__)
+#define __T_GRAPHICS_WSERV_WSSPRITE_H__
+
+// User Includes
+#include "T_DataWsSpriteBase.h"
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataWsSprite : public CT_DataWsSpriteBase
+	{
+public:
+	/**
+	* Two phase constructor
+	*/
+	static CT_DataWsSprite*	NewL();
+
+	/**
+	* Public destructor
+	*/
+	~CT_DataWsSprite();
+
+	/**
+	* Return a pointer to the object that the data wraps
+	*
+	* \return pointer to the object that the data wraps
+	*/
+	virtual TAny*	GetObject()	{ return iWsSprite; }
+
+	/**
+	* Set the object that the data wraps
+	*
+	* @param	aObject object that the wrapper is testing
+	*
+	*/
+	virtual void	SetObjectL(TAny* aAny);
+
+	/**
+	* The object will no longer be owned by this
+	*
+	* @leave	KErrNotSupported if the the function is not supported
+	*/
+	virtual void	DisownObjectL();
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	/**
+	* Protected constructor. First phase construction
+	*/
+	CT_DataWsSprite();
+
+	/**
+	* Second phase construction
+	*/
+	void  ConstructL();
+
+	virtual RWsSpriteBase*		GetWsSpriteBase() const{return iWsSprite;}
+private:
+	void	DestroyData();
+    void	DoCmdNewL(const TDesC& aSection);
+	void    DoCmdConstructL(const TDesC& aSection);
+	void	DoCmdSetPosition(const TDesC& aSection);
+	
+private:
+    RWsSprite* iWsSprite;
+	};
+
+#endif /* __T_GRAPHICS_WSERV_WSSPRITE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_DataWsSpriteBase.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_WSSPRITEBASE_H__)
+#define __T_GRAPHICS_WSERV_WSSPRITEBASE_H__
+
+// User Includes
+#include "DataWrapperBase.h"
+#include "T_DataWsClientClass.h"
+/**
+ * Test Active Notification class
+ *
+ */
+class CT_DataWsSpriteBase : public CDataWrapperBase, public CT_DataWsClientClass
+	{
+public:
+	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
+
+protected:
+	/**
+	* Protected constructor. First phase construction
+	*/
+	CT_DataWsSpriteBase();
+
+	virtual MWsClientClass*		GetClientClass() const;
+	virtual RWsSpriteBase*		GetWsSpriteBase() const=0;
+private:
+	/**
+	* Helper methods
+	*/
+	void	DoCmdActivate();
+	void	DoCmdAppendMemberL(const TDesC& aSection);
+	void    DoCmdUpdateMemberL(const TDesC& aSection);
+	void    DoCmdClose();
+
+    
+	};
+
+#endif /* __T_GRAPHICS_WSERV_WSSPRITEBASE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_GraphicsWservAPIServer.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#if (!defined __T_GRAPHICS_WSERV_API_SERVER_H__)
+#define __T_GRAPHICS_WSERV_API_SERVER_H__
+
+//	User Include
+#include "TestServerBase.h"
+
+class CT_GraphicsWservAPIServer : public CTestServerBase
+	{
+private:
+	class CT_GraphicsWservAPIBlock : public CTestBlockController
+		{
+	public:
+		inline CT_GraphicsWservAPIBlock();
+		inline ~CT_GraphicsWservAPIBlock();
+
+		CDataWrapper*	CreateDataL(const TDesC& aData);
+		};
+
+public:
+	inline CT_GraphicsWservAPIServer();
+	inline ~CT_GraphicsWservAPIServer();
+
+	static CT_GraphicsWservAPIServer* NewL();
+
+	inline CTestBlockController*	CreateTestBlock();
+	};
+
+#include "T_GraphicsWservAPIServer.inl"
+
+#endif /* __T_GRAPHICS_WSERV_API_SERVER_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_GraphicsWservAPIServer.inl	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_GraphicsWservAPIServer inline functions
+*/
+
+
+/*@{*/
+/*@}*/
+
+inline CT_GraphicsWservAPIServer::CT_GraphicsWservAPIBlock::CT_GraphicsWservAPIBlock()
+	{
+	}
+
+inline CT_GraphicsWservAPIServer::CT_GraphicsWservAPIBlock::~CT_GraphicsWservAPIBlock()
+	{
+	}
+
+inline CT_GraphicsWservAPIServer::CT_GraphicsWservAPIServer()
+	{
+	}
+
+inline CT_GraphicsWservAPIServer::~CT_GraphicsWservAPIServer()
+	{
+	}
+
+inline CTestBlockController*	CT_GraphicsWservAPIServer::CreateTestBlock()
+	{
+	return new CT_GraphicsWservAPIBlock();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/inc/T_RAnimChild.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef TESTANIM_H
+#define TESTANIM_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include "w32std.h" 
+
+// CLASS DECLARATION
+
+/**
+*  CTestAnim
+* 
+*/
+class T_RAnimChild : public RAnim
+{
+public: // Constructors and destructor
+	T_RAnimChild();
+	T_RAnimChild(RAnimDll &aDll);	
+	virtual ~T_RAnimChild();
+
+	TInt Construct(const RWindowBase &aDevice, TInt aType, const TDesC8 &aParams);
+	TInt Construct(const RWindowBase &aDevice, TInt aType, const TDesC8 &aParams, const TIpcArgs& aIpcArgs);
+	TInt Construct(const RWsSprite &aDevice, TInt aType, const TDesC8 &aParams);
+	TInt Construct(const RWsSprite &aDevice, TInt aType, const TDesC8 &aParams, const TIpcArgs& aIpcArgs);
+	TInt CommandReply(TInt aOpcode);
+	TInt CommandReply(TInt aOpcode, const TPtrC8 &aArgs);
+	TInt CommandReply(TInt aOpcode, const TDesC8& aArgs, const TIpcArgs& aIpcArgs);
+	void Command(TInt aOpcode, const TPtrC8 &aArgs);
+	void Command(TInt aOpcode);
+	void AsyncCommandReply(TRequestStatus& aRequestStatus,TInt aOpcode, const TIpcArgs& aIpcArgs);
+};
+
+#endif // TESTANIM_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/scripts/setup_smoketest_bitmap.script	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,28 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+RUN_UTILS MkDir			c:\smoketest\
+
+RUN_UTILS CopyFile 		z:\smoketest\smoketest_bitmap.ini		c:\smoketest\smoketest_bitmap.ini
+RUN_UTILS MakeReadWrite	c:\smoketest\smoketest_bitmap.ini
+RUN_UTILS CopyFile 		z:\smoketest\smoketest_bitmap.script	c:\smoketest\smoketest_bitmap.script
+RUN_UTILS MakeReadWrite	c:\smoketest\smoketest_bitmap.script
+
+RUN_UTILS MkDir 		c:\smoketest\bitmap\
+
+//datafile uibench_16bit.mbm
+RUN_UTILS CopyFile	z:\smoketest\bitmap\uibench_16bit.mbm		c:\smoketest\bitmap\uibench_16bit.mbm
+RUN_UTILS MakeReadWrite	c:\smoketest\bitmap\uibench_16bit.mbm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/scripts/smoketest_bitmap.script	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,83 @@
+//
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRINT Run Bitmap smoketest
+
+LOAD_SUITE	T_GraphicsWservAPI
+
+START_TESTCASE	SMOKE_BITMAP_0001
+//! @SYMTestCaseID		SMOKE_BITMAP_0001
+//! @SYMTestCaseDesc	BitBlt(const TPoint &aPos, const CFbsBitmap *aBitmap): perform a bitmap block transfer
+//!				Uses API elements: RWsSession::Connect & SetAutoFlush, CWsScreenDevice::Construct & GetPixel, RWindowGroup::Construct, RWindow::Construct & BeginRedraw & EndRedraw,
+//!				CWindowGc::Construct & Activate & Deactivate & SetBrushColor & SetBrushStyle, CFbsBitmap::Load & SetSizeInTwips
+//! @SYMTestActions		1.	Setup a CWindowGc to test and a RWindow to display its drawing result
+//!				1.1	New and connect a RWsSession
+//!				1.2	New and construct a CWsScreenDevice within the RWsSession
+//!				1.3	Create a CWindowGc within the CWsScreenDevice (use CreateContext)
+//!				1.4	New and construct a RWindowGroup within the RWsSession
+//!				1.5	New and construct a RWindow as the child of the RWindowGroup
+//!					and SetRequiredDisplayMode (to EColor4K) for the RWindow, SetBackgroundColor to TRgb(255,255,255)
+//!				1.6	SetAutoFlush to TRUE for the RWsSession
+//!				1.7	Activate the CWindowGc to the RWindow
+//!					and SetBrushColor to TRgb(255,0,0) and SetBrushStyle to ESolidBrush
+//!				.	New and Load a CFbsBitmap
+//!				3.	Use RWindow::BeginRedraw() to start a redraw cycle
+//!				4.	Execute BitBlt to perform a bitmap block transfer to the specified point (10,11)
+//!				5.	RWindow::EndRedraw() to end the redraw cycle and display the drawing result
+//!				6.	Deactive RWindow, destruct and close all objects used
+	START_TEST_BLOCK	10		T_GraphicsWservAPI	c:\smoketest\smoketest_bitmap.ini
+		CREATE_OBJECT	RWsSession	ws
+		CREATE_OBJECT	CWsScreenDevice	scrdev
+		CREATE_OBJECT	CWindowGc	wingc
+		CREATE_OBJECT	RWindowGroup	wingrp
+		CREATE_OBJECT	RWindow		win
+		COMMAND		ws		new
+		COMMAND		ws		Connect
+		COMMAND		scrdev		new			GRAPHICS-WSERV-WindowGc-Setup-0002-0001-new_command004
+		COMMAND		scrdev		Construct		GRAPHICS-WSERV-WindowGc-Setup-0002-0001-Construct_command005
+		COMMAND		scrdev		CreateContext		GRAPHICS-WSERV-WindowGc-Setup-0002-0001-CreateContext_command006
+		COMMAND		wingrp		new			GRAPHICS-WSERV-WindowGc-Setup-0002-0001-new_command008
+		COMMAND		wingrp		Construct		GRAPHICS-WSERV-WindowGc-Setup-0002-0001-Construct_command009
+		COMMAND		win		new			GRAPHICS-WSERV-WindowGc-Setup-0002-0001-new_command011
+		COMMAND		win		Construct		GRAPHICS-WSERV-WindowGc-Setup-0002-0001-Construct_command012
+		COMMAND		win		SetRequiredDisplayMode	GRAPHICS-WSERV-WindowGc-Setup-0002-0001-SetRequiredDisplayMode_command013
+		COMMAND		win		SetBackgroundColor	GRAPHICS-WSERV-WindowGc-Setup-0002-0001-SetBackgroundColor_command014
+		COMMAND		win		Activate
+		COMMAND		ws		SetAutoFlush		GRAPHICS-WSERV-WindowGc-Setup-0002-0001-SetAutoFlush_command017
+		COMMAND		wingc		Activate		GRAPHICS-WSERV-WindowGc-Setup-0002-0001-Activate_command019
+		COMMAND		wingc		SetBrushColor		GRAPHICS-WSERV-WindowGc-Setup-0002-0001-SetBrushColor_command020
+		COMMAND		wingc		SetBrushStyle		GRAPHICS-WSERV-WindowGc-Setup-0002-0001-SetBrushStyle_command021
+
+		CREATE_OBJECT	CFbsBitmap	fbsbmp
+		COMMAND		fbsbmp		new
+		COMMAND		fbsbmp		Load			GRAPHICS-WSERV-WindowGc-PublicApi-0051-0001-Load_command002
+		COMMAND		fbsbmp		SizeInTwips
+		COMMAND		fbsbmp		SizeInPixels
+		COMMAND		fbsbmp		DisplayMode
+		COMMAND		win		BeginRedraw
+		COMMAND		wingc		BitBlt			GRAPHICS-WSERV-WindowGc-PublicApi-0051-0001-BitBlt_command009
+		COMMAND		win		EndRedraw
+		COMMAND		win		Save
+		COMMAND		fbsbmp	~
+
+		COMMAND		wingc		Deactivate
+		COMMAND		win		Close
+		COMMAND		wingrp		Close
+		COMMAND		wingc		~
+		COMMAND		scrdev		~
+		COMMAND		ws		Close
+	END_TEST_BLOCK
+END_TESTCASE	SMOKE_BITMAP_0001
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataAnim.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,699 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataAnim.h"
+#include "T_GraphicsUtil.h"
+#include "T_AnimDef.h"
+
+#define KMaxBufSize 250
+
+/*@{*/
+_LIT(KDataClassname,							"RAnim");
+
+///	Fields
+_LIT(KFldAnimDll,								"animdll");
+_LIT(KFldWin,									"win");
+_LIT(KFldSprite,								"sprite");
+_LIT(KFldType,									"type");
+_LIT(KFldParam,									"param");
+_LIT(KFldIpcArgs,								"ipcargs");
+_LIT(KFldOpcode,								"opcode");
+_LIT(KFldArgs,									"args");
+_LIT(KFldIpcArg,								"ipcargs%d");
+_LIT(KFldExpectedIpcArg,						"expected_ipcargs%d");
+
+// enum
+_LIT(KEAnimWindows,								"EKWindowAnim");
+_LIT(KEAnimSprite,								"EKSpriteAnim");
+_LIT(KEAnimFreeTimer,							"EKFreeTimerWindowAnim");
+
+
+_LIT(KEAnimCmdSync,								"ECmdSync");
+_LIT(KEAnimCmdTestWithoutPara,					"ECmdTestWithoutPara");
+_LIT(KEAnimCmdTestWithPara,						"ECmdTestWithPara");
+_LIT(KEAnimCmdGetLast,							"ECmdGetLast");
+_LIT(KEAnimCmdGetAnimInterval,					"ECmdGetAnimInterval");
+
+
+// animate interval
+_LIT(KFldCheckAnimateInterval,					"CheckAnimateInterval");
+_LIT(KFldAnimIpcArgSlot,						"AnimIpcArgSlot");
+_LIT(KFldAnimIntervalMin,						"AnimIntervalMin");
+_LIT(KFldAnimIntervalMax,						"AnimIntervalMax");
+
+_LIT(KIpcArgNothing,							"ENothing");
+
+///	Commands
+_LIT(KCmdnew,									"new");
+_LIT(KCmdDestructorGeneral,						"~");
+_LIT(KCmdDestructor,							"~RAnim");
+_LIT(KCmdConstruct,								"Construct");
+_LIT(KCmdCommandReply,							"CommandReply");
+_LIT(KCmdCommand,								"Command");
+_LIT(KCmdAsyncCommandReply,						"AsyncCommandReply");
+_LIT(KCmdDestroy,								"Destroy");
+_LIT(KCmdClose,									"Close");
+
+///	Logging
+_LIT(KLogErrNum,				"Error=%d");
+_LIT(KLogErrMissingPara,		"Missing parameter '%S'");
+_LIT(KLogInfoCmdnewL1,			"execute new RAnim(RAnimDll &)");
+_LIT(KLogInfoCmdnewL2,			"execute new RAnim()");
+_LIT(KLogErrConstruct,			"Construct return err = %d");
+_LIT(KLogInfoCmdConstruct1,		"execute RAnim::Construct(const RWindowBase &, TInt, const TDesC8 &)");
+_LIT(KLogInfoCmdConstruct2,		"execute RAnim::Construct(const RWindowBase &, TInt, const TDesC8 &, const TIpcArgs &)");
+_LIT(KLogInfoCmdConstruct3,		"execute RAnim::Construct(const RWsSprite &, TInt, const TDesC8 &)");
+_LIT(KLogInfoCmdConstruct4,		"execute RAnim::Construct(const RWsSprite &, TInt, const TDesC8 &, const TIpcArgs &)");
+_LIT(KLogErrCommandReply,		"CommandReply return err = %d");
+_LIT(KLogInfoCmdCommandReply1,	"execute RAnim::CommandReply(TInt)");
+_LIT(KLogInfoCmdCommandReply2,	"execute RAnim::CommandReply(TInt, const TPtrC8 &)");
+_LIT(KLogInfoCmdCommandReply3,	"execute RAnim::CommandReply(TInt, const TDesC8 &, const TIpcArgs &)");
+_LIT(KLogErrCommand,			"Command return err = %d");
+_LIT(KLogErrCheckIpcValue,		"Ipc arg compare fail expected=%S actual=%S");
+_LIT(KLogErrIpcValue,			"Ipc arg return value err");
+
+_LIT(KLogErrAnimInterval,		"Animate interval error expected min=%d max=%d");
+
+_LIT(KLogInfoAnimInterval,		"Animate interval actual min=%d max=%d");
+
+_LIT(KLogInfoCmdCommand1,		"execute RAnim::Command(TInt, const TPtrC8 &)");
+_LIT(KLogInfoCmdCommand2,		"execute RAnim::Command(TInt)");
+_LIT(KLogInfoCmdAsyncCommandReply1,	"execute RAnim::AsyncCommandReply(TRequestStatus &, TInt, const TIpcArgs &)");
+
+_LIT(KLogInfoCmdClose1,			"execute RAnim::Close()");
+_LIT(KLogInfoCmdDestroy1,		"execute RAnim::Destroy()");
+_LIT(KLogInfoCmdDestructor1,	"execute ~RAnim()");
+/*@}*/
+
+CT_DataAnim* CT_DataAnim::NewL()
+	{
+	CT_DataAnim*	ret = new (ELeave) CT_DataAnim();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+CT_DataAnim::CT_DataAnim()
+:	iActiveCallback(NULL)
+	,iAnim(NULL)
+	{
+	}
+
+void CT_DataAnim::ConstructL()
+	{
+	iActiveCallback = CActiveCallback::NewL(*this);
+	iSendBuf.CreateL(KMaxBufSize);
+	
+	for (TInt i=0;i<KIpcArgNum;i++)	
+		iIpcBuf[i].CreateL(KMaxBufSize);
+	}
+
+CT_DataAnim::~CT_DataAnim()
+	{
+	DestroyData();
+	delete iActiveCallback;
+	iActiveCallback = NULL;
+	
+	iSendBuf.Close();
+	
+	for (TInt i=0;i<KIpcArgNum;i++)	
+		iIpcBuf[i].Close();	
+	}
+
+TAny* CT_DataAnim::GetObject()
+	{
+	return iAnim;
+	}
+
+void CT_DataAnim::SetObjectL(TAny* aAny)
+	{
+	DestroyData();
+	iAnim = static_cast<T_RAnimChild*> (aAny);
+	}
+
+void CT_DataAnim::DisownObjectL()
+	{
+	iAnim = NULL;
+	}
+
+void CT_DataAnim::DestroyData()
+	{
+	DoCmdDestructor();
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataAnim::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	ret = ETrue;
+
+	if ( aCommand==KCmdDestructorGeneral || aCommand==KCmdDestructor )
+		{
+		DoCmdDestructor();
+		}
+	else if ( aCommand==KCmdnew || aCommand==KDataClassname )
+		{
+		DoCmdnewL(aSection);
+		}
+	else if ( aCommand==KCmdConstruct )
+		{
+		DoCmdConstructL(aSection);
+		}
+	else if ( aCommand==KCmdCommandReply )
+		{
+		DoCmdCommandReply(aSection);
+		}
+	else if ( aCommand==KCmdCommand )
+		{
+		DoCmdCommand(aSection);
+		}
+	else if ( aCommand==KCmdAsyncCommandReply )
+		{
+		DoCmdAsyncCommandReply(aSection, aAsyncErrorIndex);
+		}
+	else if ( aCommand==KCmdDestroy )
+		{
+		DoCmdDestroy();
+		}
+	else if ( aCommand==KCmdClose )
+		{
+		DoCmdClose();
+		}
+	else
+		{
+		ret=EFalse;
+		}
+
+	return ret;
+	}
+
+void CT_DataAnim::DoCmdnewL(const TDesC& aSection)
+	{
+	DestroyData();
+
+	// Get test data for command input parameter(s)
+	TPtrC		datDllName;
+	RAnimDll*	animDll = NULL;
+	if ( GetStringFromConfig(aSection, KFldAnimDll, datDllName) )
+		{
+		animDll = static_cast<RAnimDll*>(GetDataObjectL(datDllName));
+		}
+
+	TInt err = KErrNone;
+	if ( animDll )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(KLogInfoCmdnewL1);
+		iAnim = new (ELeave) T_RAnimChild(*animDll) ;
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(KLogInfoCmdnewL2);
+		iAnim = new (ELeave) T_RAnimChild();
+		}
+	}
+
+TBool CT_DataAnim::GetIpcArg(const TDesC& aSection)
+	{
+	TBool argexist=EFalse;
+	
+	TBuf <100> field;
+	TPtrC    val;
+	for (TInt i=0;i<KIpcArgNum;i++)	
+		{
+		field.Format(KFldIpcArg,i);
+		if ( GetStringFromConfig(aSection, field, val))
+			{
+			if (val.Compare(KIpcArgNothing)==0)
+				iIpcArgs.Set(i,TIpcArgs::ENothing);
+			else
+				{
+				iIpcBuf[i].Copy(val);
+				iIpcArgs.Set(i,&iIpcBuf[i]);
+				}
+			argexist=ETrue;
+			}
+		else
+			break;
+		
+		}	
+	return argexist;	
+	}
+
+// check is the time interval of CAnim::Animate() is in specified scope
+TBool CT_DataAnim::CheckAnimateInterval(const TDesC& aSection)
+	{
+	TBool result=EFalse;	
+			
+	TInt slot,min,max,find;
+	TInt amin,amax;
+
+	_LIT(KSpace," ");
+	
+	// get IPC args slot index
+	if ( GetIntFromConfig(aSection, KFldAnimIpcArgSlot,slot))
+		{
+		// get expected min/max interval of Animate()
+		if ( GetIntFromConfig(aSection, KFldAnimIntervalMin,min) && 
+				GetIntFromConfig(aSection, KFldAnimIntervalMax,max) )
+			{
+			find=iIpcBuf[slot].Find(KSpace); // get actual min/max interval of Animate()
+			if (find>0 )
+				{
+				// get actual min interval 
+				TPtrC val1=iIpcBuf[slot].Left(find);
+				TLex lex1(val1);
+				lex1.Val(amin);
+				
+				// get actual max interval 
+				TPtrC val2=iIpcBuf[slot].Mid(find+1);
+				TLex lex2(val2);
+				lex2.Val(amax);
+				
+				INFO_PRINTF3(KLogInfoAnimInterval,amin,amax);
+				
+				// check is the interval in expected scope 
+				if (amin<min || amax>max)
+					{
+					ERR_PRINTF3(KLogErrAnimInterval, min,max);
+					}
+				else
+					result=ETrue;
+				}			
+			}
+		}	
+
+	return result;	
+	}
+TBool CT_DataAnim::CheckIpcArg(const TDesC& aSection)
+	{
+	TBool result=ETrue;	
+
+	// check animate interval
+	TInt checkanim=0;
+	if ( GetIntFromConfig(aSection, KFldCheckAnimateInterval, checkanim) 
+			&& checkanim)
+		{
+		return CheckAnimateInterval(aSection);
+		}
+			
+	TBuf <100> field;
+	TPtrC    val;
+	
+	// check ipc expected value
+	for (TInt i=0;i<KIpcArgNum;i++)	
+		{
+		field.Format(KFldExpectedIpcArg,i);
+		if ( GetStringFromConfig(aSection, field, val) && 
+				val.Compare(iIpcBuf[i])!=0)
+			{
+			ERR_PRINTF3(KLogErrCheckIpcValue, &val, &iIpcBuf[i]);
+			result=EFalse;
+			break;
+			}		
+		}	
+	return result;	
+	}
+
+void CT_DataAnim::DoCmdConstructL(const TDesC& aSection)
+	{
+	TInt err = KErrNone;
+	
+	// Get test data for command input parameter(s)
+	TBool dataOk = ETrue;
+
+	// get "const RWindowBase &aDevice" or "const RWsSprite &aDevice"
+	TPtrC        datWinName;
+	RWindowBase* win = NULL;
+	TPtrC        datSpriteName;
+	RWsSprite*   sprite = NULL;
+	if ( GetStringFromConfig(aSection, KFldWin, datWinName))
+		{
+		win = static_cast<RWindowBase*>(GetDataObjectL(datWinName));
+		}
+	else if ( GetStringFromConfig(aSection, KFldSprite, datSpriteName))
+		{
+		sprite = static_cast<RWsSprite*>(GetDataObjectL(datSpriteName));
+		}
+	if (!win && !sprite )
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogErrMissingPara, &KFldWin);
+		ERR_PRINTF2(KLogErrMissingPara, &KFldSprite);
+		}
+	
+	//get "TInt aType"
+	TInt datType;
+	if ( !ReadAnimType(aSection, KFldType, datType))
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogErrMissingPara, &KFldType);
+		}
+	
+	// get "const TDesC8 &aArgs"
+	TPtrC 	inputStr;
+	TBool argexist=EFalse;
+	if( GetStringFromConfig(aSection, KFldParam, inputStr))
+		{
+		CopyToSendBuf(inputStr);
+		argexist=ETrue;
+		}
+
+	if (!argexist)
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogErrMissingPara, &KFldParam);
+		}
+	
+	// get "const TIpcArgs &aIpcArgs"
+	TBool ipcexist= EFalse;
+	if ( GetIpcArg(aSection))
+		ipcexist = ETrue;
+	
+	if ( !dataOk )
+		{
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		if (win )
+			{
+			if (!ipcexist)
+				{
+				INFO_PRINTF1(KLogInfoCmdConstruct1);
+				err = iAnim->Construct(*win, datType, iSendBuf);				
+				}
+			else
+				{
+				INFO_PRINTF1(KLogInfoCmdConstruct2);
+				err = iAnim->Construct(*win, datType, iSendBuf, iIpcArgs);								
+				}
+			}
+		else
+			{
+			if (!ipcexist )
+				{
+				INFO_PRINTF1(KLogInfoCmdConstruct3);
+				err = iAnim->Construct(*sprite, datType, iSendBuf);				
+				}
+			else
+				{
+				INFO_PRINTF1(KLogInfoCmdConstruct4);
+				err = iAnim->Construct(*sprite, datType, iSendBuf, iIpcArgs);
+				}
+			}
+		
+		// Check the command return code
+		if(err != KErrNone)
+			{
+			ERR_PRINTF2(KLogErrConstruct, err);
+			SetError(err);
+			}
+		else if (ipcexist && ! CheckIpcArg(aSection))
+			{
+			ERR_PRINTF1(KLogErrIpcValue);
+			SetBlockResult(EFail);
+			}			
+		}
+	}
+
+TDesC8& CT_DataAnim::CopyToSendBuf(const TDesC& buf) 
+	{
+	TUint8 len=buf.Length();
+
+	iSendBuf.Zero();
+	iSendBuf.Copy(&len,sizeof(len));
+	if (len>0)
+		iSendBuf.Append(buf);
+	return iSendBuf;
+	}
+
+void CT_DataAnim::DoCmdCommandReply(const TDesC& aSection)
+	{
+	TInt err = KErrNone;
+	
+	// Get test data for command input parameter(s)
+	TBool dataOk = ETrue;
+
+	// get "TInt aOpcode"
+	TInt datOpcode;
+	if ( !ReadAnimCommand(aSection, KFldOpcode, datOpcode))
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogErrMissingPara, &KFldOpcode);
+		}
+
+	// get "const TPtrC8 &aArgs" or "const TDesC8 &aArgs"
+	TPtrC 	inputStr;
+	TBool argexist=EFalse;
+	if( GetStringFromConfig(aSection, KFldArgs, inputStr))
+		{
+		CopyToSendBuf(inputStr);
+		argexist=ETrue;
+		}
+	
+	// get "const TIpcArgs &aIpcArgs"
+	TBool ipcexist= EFalse;
+	if ( GetIpcArg(aSection))
+		ipcexist = ETrue;
+	
+
+	if ( dataOk )
+		{
+		if (!argexist)
+			{
+			INFO_PRINTF1(KLogInfoCmdCommandReply1);
+			err = iAnim->CommandReply(datOpcode);
+			}
+		else if (ipcexist)
+			{
+			INFO_PRINTF1(KLogInfoCmdCommandReply3);
+			err = iAnim->CommandReply(datOpcode, iSendBuf, iIpcArgs);
+			}			
+		else
+			{			
+			INFO_PRINTF1(KLogInfoCmdCommandReply2);
+			err = iAnim->CommandReply(datOpcode, iSendBuf);
+			}	
+		
+		// Check the command return code
+		if(err != KErrNone)
+			{
+			ERR_PRINTF2(KLogErrCommandReply, err);
+			SetError(err);
+			}
+		else if (ipcexist && ! CheckIpcArg(aSection))
+			{
+			ERR_PRINTF1(KLogErrIpcValue);
+			SetBlockResult(EFail);
+			}			
+		}
+	else
+		SetBlockResult(EFail);
+
+	}
+
+void CT_DataAnim::DoCmdCommand(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TBool dataOk = ETrue;
+
+	// get "TInt aOpcode"
+	TInt datOpcode;
+	if ( !ReadAnimCommand(aSection, KFldOpcode, datOpcode))
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogErrMissingPara, &KFldOpcode);
+		}
+
+	// get "const TPtrC8 &aArgs" or "const TDesC8 &aArgs"
+	TPtrC 	inputStr;
+	TBool argexist=EFalse;
+	if( GetStringFromConfig(aSection, KFldArgs, inputStr))
+		{
+		CopyToSendBuf(inputStr);
+		argexist=ETrue;
+		}
+	
+	if ( dataOk )
+		{
+		if (!argexist)
+			{
+			INFO_PRINTF1(KLogInfoCmdCommand2);
+			iAnim->Command(datOpcode);
+			}
+		else
+			{			
+			INFO_PRINTF1(KLogInfoCmdCommand1);
+			iAnim->Command(datOpcode, iSendBuf);
+			}	
+		}
+	else
+		SetBlockResult(EFail);
+
+	}
+
+void CT_DataAnim::DoCmdAsyncCommandReply(const TDesC& aSection, const TInt aAsyncErrorIndex)
+	{
+	// Get test data for command input parameter(s)
+	TBool dataOk = ETrue;
+
+	// get "TInt aOpcode"
+	TInt datOpcode;
+	if ( !ReadAnimCommand(aSection, KFldOpcode, datOpcode))
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogErrMissingPara, &KFldOpcode);
+		}
+
+	// get "const TIpcArgs &aIpcArgs"
+	TBool ipcexist= EFalse;
+	if ( GetIpcArg(aSection))
+		ipcexist = ETrue;
+	
+	if (!ipcexist)
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogErrMissingPara, &KFldIpcArgs);		
+		}
+	
+	if ( !dataOk )
+		{
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		iAsyncCmdSection.Copy(aSection);
+		// Execute command and log parameters
+		INFO_PRINTF1(KLogInfoCmdAsyncCommandReply1);
+		iAnim->AsyncCommandReply(iActiveCallback->iStatus, datOpcode, iIpcArgs);
+	    iActiveCallback->Activate(aAsyncErrorIndex);
+	    IncOutstanding();
+		}
+
+	}
+
+void CT_DataAnim::RunL(CActive* aActive, TInt aIndex)
+    {
+    TInt err = aActive->iStatus.Int();  
+    
+    if (! CheckIpcArg(iAsyncCmdSection))
+		{
+		ERR_PRINTF1(KLogErrIpcValue);
+		SetBlockResult(EFail);
+		}   
+    
+    SetAsyncError(aIndex, err);
+    DecOutstanding();
+	}
+
+void CT_DataAnim::DoCmdClose()
+	{
+	// Execute command and log parameters
+	if (iAnim != NULL)
+		{
+		INFO_PRINTF1(KLogInfoCmdClose1);
+		iAnim->Close();
+		}
+	}
+
+void CT_DataAnim::DoCmdDestroy()
+	{
+	// Execute command and log parameters
+	if (iAnim != NULL)
+		{
+		INFO_PRINTF1(KLogInfoCmdDestroy1);
+		iAnim->Destroy();
+		iAnim = NULL;
+		}
+	}
+
+void CT_DataAnim::DoCmdDestructor()
+	{
+	// Execute command and log parameters
+	INFO_PRINTF1(KLogInfoCmdDestructor1);
+	delete iAnim;
+	iAnim = NULL;
+	}
+
+
+TBool CT_DataAnim::ReadAnimCommand(const TDesC& aSectName, const TDesC& aKeyName, TInt& aCommand)
+	{
+	TPtrC	str;
+	TBool	ret=GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KEAnimCmdSync )
+			{
+			aCommand=ECmdSync;
+			}
+		else if ( str==KEAnimCmdTestWithoutPara )
+			{
+			aCommand=ECmdTestWithoutPara;
+			}
+		else if ( str==KEAnimCmdTestWithPara )
+			{
+			aCommand=ECmdTestWithPara;
+			}
+		else if ( str==KEAnimCmdGetLast )
+			{
+			aCommand=ECmdGetLast;
+			}
+		else if ( str==KEAnimCmdGetAnimInterval )
+			{
+			aCommand=ECmdGetAnimInterval;
+			}
+		else
+			ret=EFalse;
+		}
+
+	return ret;
+	}
+TBool CT_DataAnim::ReadAnimType(const TDesC& aSectName, const TDesC& aKeyName, TInt& aType)
+	{
+	TPtrC	str;
+	TBool	ret=GetStringFromConfig(aSectName, aKeyName, str);
+	if ( ret )
+		{
+		if ( str==KEAnimWindows)
+			{
+			aType=EKWindowAnim;
+			}
+		else if ( str==KEAnimSprite )
+			{
+			aType=EKSpriteAnim;
+			}
+		else if ( str==KEAnimFreeTimer )
+			{
+			aType=EKFreeTimerWindowAnim;
+			}
+		else
+			ret=EFalse;
+		}
+
+	return ret;	
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataAnimDll.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,229 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataAnimDll.h"
+#include "T_GraphicsUtil.h"
+
+/*@{*/
+_LIT(KDataClassname,							"RAnimDll");
+
+///	Fields
+_LIT(KFldWs,									"ws");
+_LIT(KPlugInFileName,							"filename");
+
+///	Commands
+_LIT(KCmdnew,									"new");
+_LIT(KCmdDestructorGeneral,						"~");
+_LIT(KCmdDestructor,							"~RAnimDll");
+_LIT(KCmdLoad,									"Load");
+_LIT(KCmdDestroy,								"Destroy");
+_LIT(KCmdClose,									"Close");
+
+///	Logging
+_LIT(KLogErrNum,			"Error=%d");
+_LIT(KLogErrMissingPara,	"Missing parameter '%S'");
+_LIT(KLogErrLoad,			"Load file error %d. File name: %S");
+_LIT(KLogInfoCmdnewL1,		"execute new RAnimDll(RWsSession &)");
+_LIT(KLogInfoCmdnewL2,		"execute new RAnimDll()");
+_LIT(KLogInfoCmdLoad1,		"execute RAnimDll::Load(const TDesC &)");
+_LIT(KLogInfoCmdClose1,		"execute RAnimDll::Close()");
+_LIT(KLogInfoCmdDestroy1,	"execute RAnimDll::Destroy()");
+_LIT(KLogInfoCmdDestructor1,"execute ~RAnimDll()");
+/*@}*/
+
+CT_DataAnimDll* CT_DataAnimDll::NewL()
+	{
+	CT_DataAnimDll*	ret = new (ELeave) CT_DataAnimDll();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+CT_DataAnimDll::CT_DataAnimDll()
+:	iAnimDll(NULL)
+	{
+	}
+
+void CT_DataAnimDll::ConstructL()
+	{
+	}
+
+CT_DataAnimDll::~CT_DataAnimDll()
+	{
+	DestroyData();
+	}
+
+TAny* CT_DataAnimDll::GetObject()
+	{
+	return iAnimDll;
+	}
+
+void CT_DataAnimDll::SetObjectL(TAny* aAny)
+	{
+	DestroyData();
+	iAnimDll = static_cast<RAnimDll*> (aAny);
+	}
+
+void CT_DataAnimDll::DisownObjectL()
+	{
+	iAnimDll = NULL;
+	}
+
+void CT_DataAnimDll::DestroyData()
+	{
+	DoCmdDestructor();
+	}
+
+MWsClientClass* CT_DataAnimDll::GetClientClass() const
+	{
+	return iAnimDll;
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataAnimDll::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	ret = ETrue;
+
+	if ( aCommand==KCmdDestructorGeneral || aCommand==KCmdDestructor )
+		{
+		DoCmdDestructor();
+		}
+	else if ( aCommand==KCmdnew || aCommand==KDataClassname )
+		{
+		DoCmdnewL(aSection);
+		}
+	else if ( aCommand==KCmdLoad )
+		{
+		DoCmdLoad(aSection);
+		}
+	else if ( aCommand==KCmdDestroy )
+		{
+		DoCmdDestroy();
+		}
+	else if ( aCommand==KCmdClose )
+		{
+		DoCmdClose();
+		}
+	else
+		{
+		ret=CT_DataWsClientClass::DoCommandL(*this, aCommand, aSection, aAsyncErrorIndex);
+		}
+
+	return ret;
+	}
+
+void CT_DataAnimDll::DoCmdnewL(const TDesC& aSection)
+	{
+	DestroyData();
+
+	// Get test data for command input parameter(s)
+	TPtrC		wsName;
+	RWsSession*	ws = NULL;
+	if ( GetStringFromConfig(aSection, KFldWs, wsName) )
+		{
+		ws = static_cast<RWsSession*>(GetDataObjectL(wsName));
+		}
+
+	TInt err = KErrNone;
+	if ( ws!= NULL )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(KLogInfoCmdnewL1);
+		TRAP( err, iAnimDll = new (ELeave) RAnimDll(*ws) );
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(KLogInfoCmdnewL2);
+		TRAP(err, iAnimDll = new (ELeave) RAnimDll());
+		}
+	
+	// Check the command return code
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogErrNum, err);
+		SetError(err);
+		}
+	}
+
+void CT_DataAnimDll::DoCmdLoad(const TDesC& aSection)
+	{
+	TInt err = KErrNone;
+	
+	// Get test data for command input parameter(s)
+	TPtrC fileName;
+	if(!GetStringFromConfig(aSection, KPlugInFileName(), fileName))
+		{
+		ERR_PRINTF2(KLogErrMissingPara, &KPlugInFileName());
+		SetBlockResult(EFail);
+		}
+	else
+		{	
+		// Execute command and log parameters
+		if (iAnimDll != NULL)
+			{
+			INFO_PRINTF1(KLogInfoCmdLoad1);
+			err = iAnimDll->Load(fileName);
+			}
+		
+		// Check the command return code
+		if(err != KErrNone)
+			{
+			ERR_PRINTF3(KLogErrLoad, err, &fileName);
+			SetError(err);
+			}
+		}
+	}
+
+void CT_DataAnimDll::DoCmdClose()
+	{
+	// Execute command and log parameters
+	if (iAnimDll != NULL)
+		{
+		INFO_PRINTF1(KLogInfoCmdClose1);
+		iAnimDll->Close();
+		}
+	}
+
+void CT_DataAnimDll::DoCmdDestroy()
+	{
+	// Execute command and log parameters
+	if (iAnimDll != NULL)
+		{
+		INFO_PRINTF1(KLogInfoCmdDestroy1);
+		iAnimDll->Destroy();
+		iAnimDll = NULL;
+		}
+	}
+
+void CT_DataAnimDll::DoCmdDestructor()
+	{
+	// Execute command and log parameters
+	INFO_PRINTF1(KLogInfoCmdDestructor1);
+	delete iAnimDll;
+	iAnimDll = NULL;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataAnimForMClass.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,2331 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataAnimForMClass.h"
+#include "T_GraphicsUtil.h"
+#include "T_AnimDef.h"
+#include "../AnimPlugin/inc/T_AnimDef.h"
+#include <w32adll.h>
+#include <e32keys.h>
+#include "w32std.h" 
+#define KMaxBufSize 250
+
+/*@{*/
+_LIT(KDataClassname,							"RAnimForMClass");
+
+///	Fields
+
+_LIT(KFldWin, 									"win");
+_LIT(KFldWingrp, 								"wingrp");
+_LIT(KFldSprite, 								"sprite");
+_LIT(KFldType, 									"type");
+
+
+_LIT(KFldOpcode, 								"opcode");
+
+
+_LIT(KFldExpected, 								"expected");
+_LIT(KFldRect, 									"rect");
+_LIT(KFldState, 								"state");
+_LIT(KFldWs, 									"ws");
+_LIT(KFldWingrpId, 								"windowgroupid");
+_LIT(KFldOrdinalPosition, 						"pos");
+_LIT(KFldOrdinalPriority, 						"ordinalpriority");
+_LIT(KFldScreenNumb, 							"screennumber");
+_LIT(KFldFullOrdinPostn, 						"fullpos");
+_LIT(KFldExpectedPoint, 						"expectedpoint");
+_LIT(KFldGetEvent, 								"getevent");
+_LIT(KFldInterface, 							"interface");
+_LIT(KFldPostRawEvent, 							"rawevent");
+
+
+
+
+_LIT(KFldSyncMode, 								"animsync");
+_LIT(KFldInterval, 								"interval");
+_LIT(KFldNotifications, 						"notification");
+_LIT(KFldMessage, 								"message");
+_LIT(KFldHandleBitmap, 							"bitmap");
+_LIT(KFldHandleFont, 							"font");
+_LIT(KFldMemberIndex, 							"member_index");
+_LIT(KFldIsFullUpdate, 							"isfullupdate");
+_LIT(KFldIsActivate, 							"isactivate");
+_LIT(KFldSetReplyBufHandle1, 					"slot2");
+_LIT(KFldSetReplyBufHandle2, 					"slot3");
+_LIT(KFldPointPosition,							"pos");
+_LIT(KFldRAnim,						        	"anim");
+
+_LIT(KESyncNone , 								"ESyncNone");
+_LIT(KESyncFlash, 								"ESyncFlash");
+_LIT(KESyncSecond, 								"ESyncSecond");
+_LIT(KESyncMinute, 								"ESyncMinute");
+_LIT(KESyncDay, 								"ESyncDay");
+
+_LIT(KENone, 									"ENone");
+_LIT(KEPointerMove, 							"EPointerMove");
+_LIT(KEPointerSwitchOn, 						"EPointerSwitchOn");
+_LIT(KEKeyDown, 								"EKeyDown");
+_LIT(KEKeyUp, 									"EKeyUp");
+_LIT(KERedraw, 									"ERedraw");
+_LIT(KESwitchOn, 								"ESwitchOn");
+_LIT(KEActive, 								    "EActive");
+_LIT(KEInactive,                                "EInactive");
+_LIT(KEUpdateModifiers,                         "EUpdateModifiers");
+_LIT(KEButton1Down,                             "EButton1Down");
+_LIT(KEButton1Up,                               "EButton1Up");
+_LIT(KEButton2Down,                             "EButton2Down");
+_LIT(KEButton2Up,                               "EButton2Up");
+_LIT(KEButton3Down,                             "EButton3Down");
+_LIT(KEButton3Up,                               "EButton3Up");
+_LIT(KESwitchOff,                               "ESwitchOff");
+_LIT(KEKeyRepeat,                               "EKeyRepeat");
+_LIT(KECaseOpen,                                "ECaseOpen");
+_LIT(KECaseClose,                               "ECaseClose");
+_LIT(KERestartSystem,                           "ERestartSystem");
+
+
+
+///	Commands
+_LIT(KCmdnew, 									"new");
+_LIT(KCmdDestructorGeneral, 					"~");
+_LIT(KCmdDestructor, 							"~RAnimForMClass");
+_LIT(KCmdConstruct, 							"Construct");
+_LIT(KCmdCommandReply, 							"CommandReply");
+_LIT(KCmdDestroy, 								"Destroy");
+_LIT(KCmdClose, 								"Close");
+
+///	Logging
+_LIT(KLogErrMissingPara, "Missing parameter '%S'");
+
+
+_LIT(KLogErrConstruct, "Construct return err = %d");
+_LIT(KLogInfoCmdConstruct1, "execute RAnimForMClass::Construct(const RWindowBase &, TInt, const TDesC8 &)");
+
+_LIT(KLogInfoCmdConstruct3, "execute RAnimForMClass::Construct(const RWsSprite &, TInt, const TDesC8 &)");
+
+_LIT(KLogErrCommandReply, "CommandReply return err = %d");
+_LIT(KLogInfoCmdCommandReply1, "execute RAnimForMClass::CommandReply(TInt),opcode=%d");
+
+_LIT(KLogInfoCmdCommandReply3, "execute RAnimForMClass::CommandReply(TInt, const TDesC8 &, const TIpcArgs &),opcode=%d");
+
+_LIT(KLogInfoCmdDestroy, "execute RAnimForMClass::Destroy()");
+_LIT(KLogInfoCmdDestructor1, "execute ~RAnimForMClass()");
+_LIT(KLogMissingParameter, "Missing parameter '%S'");
+_LIT(KlogDateTime, "DateTime");
+/*@}*/
+
+CT_DataAnimForMClass* CT_DataAnimForMClass::NewL()
+	{
+	CT_DataAnimForMClass*	ret = new (ELeave) CT_DataAnimForMClass();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+CT_DataAnimForMClass::CT_DataAnimForMClass()
+:	iActiveCallback(NULL)
+	,iAnim(NULL)
+	{
+	}
+
+void CT_DataAnimForMClass::ConstructL()
+	{
+	iSendBuf.CreateL(KMaxBufSize);
+	iSendBuf.FillZ(1);
+	
+	for (TInt i=0;i<KIpcArgNum;i++)	
+		iIpcBuf[i].CreateL(KMaxBufSize);
+	}
+
+CT_DataAnimForMClass::~CT_DataAnimForMClass()
+	{
+	INFO_PRINTF1(KLogInfoCmdDestructor1);
+	DestroyData();
+	iSendBuf.Close();
+	
+	for (TInt i=0;i<KIpcArgNum;i++)	
+		iIpcBuf[i].Close();	
+	}
+
+TAny* CT_DataAnimForMClass::GetObject()
+	{
+    return iAnim;
+	}
+
+void CT_DataAnimForMClass::SetObjectL(TAny* aAny)
+	{
+	DestroyData();
+    iAnim = static_cast<T_RAnimChild*> (aAny);
+	}
+
+void CT_DataAnimForMClass::DisownObjectL()
+	{
+    iAnim = NULL;
+	}
+
+void CT_DataAnimForMClass::DestroyData()
+	{
+	DoCmdDestroy();
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @return ETrue if the command is processed
+*/
+TBool CT_DataAnimForMClass::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection,const TInt)
+	{
+	TBool	ret = ETrue;
+
+	if ( aCommand==KCmdDestructorGeneral || aCommand==KCmdDestructor )
+		{
+		DoCmdDestructor();
+		}
+	else if ( aCommand==KCmdnew || aCommand==KDataClassname )
+		{
+		DoCmdnewL(aSection);
+		}
+	else if ( aCommand==KCmdConstruct )
+		{
+		DoCmdConstructL(aSection);
+		}
+	else if ( aCommand==KCmdCommandReply )
+		{
+		DoCmdCommandReplyL(aSection);
+		}
+	else if ( aCommand==KCmdDestroy )
+		{
+		DoCmdDestroy();
+		}
+	else if ( aCommand==KCmdClose )
+		{
+		DoCmdClose();
+		}
+	else
+		{
+		ret=EFalse;
+		}
+
+	return ret;
+	}
+
+void CT_DataAnimForMClass::DoCmdnewL(const TDesC& aSection)
+	{
+	DestroyData();
+	TPtrC  datRAnimName ; 
+	if ( GetStringFromConfig(aSection, KFldRAnim, datRAnimName))
+		{
+		iAnim = static_cast<T_RAnimChild*>(GetDataObjectL(datRAnimName));
+		}
+	else 
+		ERR_PRINTF2(KLogErrMissingPara, &KFldWin);
+	}
+
+void CT_DataAnimForMClass::ResetIpcArg()
+	{
+	for (TInt i=0; i<KIpcArgNum; i++)
+		{
+		iIpcArgs.Set(i, TIpcArgs::ENothing);
+		}
+	}
+
+void CT_DataAnimForMClass::DoCmdConstructL(const TDesC& aSection)
+	{
+	TInt err = KErrNone;
+	
+	// Get test data for command input parameter(s)
+	TBool dataOk = ETrue;
+
+	// Get "const RWindowBase &aDevice" or "const RWsSprite &aDevice"
+	TPtrC        datWinName;
+	RWindowBase* win = NULL;
+	TPtrC        datSpriteName;
+	RWsSprite*   sprite = NULL;
+	if ( GetStringFromConfig(aSection, KFldWin, datWinName))
+		{
+		win = static_cast<RWindowBase*>(GetDataObjectL(datWinName));
+		}
+	else if ( GetStringFromConfig(aSection, KFldSprite, datSpriteName))
+		{
+		sprite = static_cast<RWsSprite*>(GetDataObjectL(datSpriteName));
+		}
+	if (!win && !sprite )
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogErrMissingPara, &KFldWin);
+		ERR_PRINTF2(KLogErrMissingPara, &KFldSprite);
+		}
+	
+	//Get "TInt aType"
+	TInt datType;
+	if ( !CT_GraphicsUtil::ReadAnimType(*this,aSection, KFldType, datType))
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogErrMissingPara, &KFldType);
+		}
+	
+	// Get "const TDesC8 &aArgs"
+	TPtrC 	inputStr;
+	
+	// get "const TIpcArgs &aIpcArgs"
+	
+	if ( !dataOk )
+		{
+		SetBlockResult(EFail);
+		}
+	else
+		{	
+		// Execute command and log parameters
+		if (win)
+			{
+				INFO_PRINTF1(KLogInfoCmdConstruct1);
+				if (iAnim != NULL)
+				     err = iAnim->Construct(*win, datType, iSendBuf);	
+			}
+
+		else
+			{
+				INFO_PRINTF1(KLogInfoCmdConstruct3);
+				if (iAnim != NULL)
+				    err = iAnim->Construct(*sprite, datType, iSendBuf);				
+			}
+		
+		// Check the command return code
+		if(err != KErrNone)
+			{
+			ERR_PRINTF2(KLogErrConstruct, err);
+			SetError(err);
+			}
+		}
+	}
+
+void CT_DataAnimForMClass::DoCmdCommandReplyL(const TDesC& aSection)
+	{
+	
+	// Get test data for command input parameter(s)
+	TBool dataOk = ETrue;
+
+	// Get "TInt aOpcode"
+	TInt datOpcode;
+	if ( !CT_GraphicsUtil::ReadAnimCommand(*this, aSection, KFldOpcode,
+			datOpcode))//ReadAnimCommand():Convert datOpcode from string type to Int type
+		{
+		dataOk = EFalse;
+		ERR_PRINTF2(KLogErrMissingPara, &KFldOpcode);
+		}
+
+	if (!dataOk)
+		{
+		_LIT(KFailed, "Can not read the Operation code from the config file. Failed. ");
+		INFO_PRINTF1(KFailed);
+		SetBlockResult(EFail);
+		}
+	switch (datOpcode)
+		{
+			//Util
+		case ECmdRetrieveResult:
+			DoCmdRetrieveResult(aSection, datOpcode);
+			break;
+		case ECmdUtilEatupMemory:
+			DoCmdEatupMemory(datOpcode);
+			break;
+		case ECmdUtilFreeEatenMemory:
+			DoCmdFreeEatenMemory(datOpcode);
+			break;
+			// The MAnimGeneralFunctioins
+		case ECmdGeneralAnimate:
+			DoCmdGeneralAnimate(aSection, datOpcode);
+			break;
+		case ECmdGeneralClient:
+			DoCmdGeneralClient(aSection, datOpcode);
+			break;
+		case ECmdGeneralFlashStateOn:
+			DoCmdGeneralFlashStateOn(aSection, datOpcode);
+			break;
+		case ECmdGeneralPanic:
+			DoCmdGeneralPanic(aSection, datOpcode) ;
+			break;
+		case ECmdGeneralScreenDevice:
+			DoCmdGeneralScreenDevice(aSection, datOpcode) ;
+			break;
+		case ECmdGeneralExtendedInterface:
+			DoCmdGeneralExtendedInterface(aSection, datOpcode) ;
+			break;
+		case ECmdGeneralWindowExtension:
+			DoCmdGeneralWindowExtension(aSection, datOpcode) ;
+			break;
+		case ECmdGeneralNumOfExtInterfaces:
+			DoCmdGeneralNumOfExtInterfaces(aSection, datOpcode) ;
+			break;
+		case ECmdGeneralEventExtension:
+			DoCmdGeneralEventExtension(aSection, datOpcode) ;
+			break;
+		case ECmdGeneralGetRawEvents:
+			DoCmdGeneralGetRawEvents(aSection, datOpcode);
+			break;
+		case ECmdGeneralPostRawEvent:
+			DoCmdGeneralPostRawEvent(aSection, datOpcode);
+			break;
+		case ECmdGeneralPostKeyEvent:
+			DoCmdGeneralPostKeyEventL(aSection, datOpcode);
+			break;
+		case ECmdGeneralSetSync:
+			DoCmdGeneralSetSync(aSection, datOpcode);
+			break;
+		case ECmdGeneralSync:
+			DoCmdGeneralSync(aSection, datOpcode);
+			break;
+		case ECmdGeneralSetInterval:
+			DoCmdGeneralSetInterval(aSection, datOpcode);
+			break;
+		case ECmdGeneralSetNextInterval:
+			DoCmdGeneralSetNextInterval(aSection, datOpcode);
+			break;
+		case ECmdGeneralSystemTime:
+			DoCmdGeneralSystemTime(aSection, datOpcode);
+			break;
+		case ECmdGeneralRegisterForNotis:
+			DoCmdGeneralRegisterForNotis(aSection, datOpcode);
+			break;
+		case ECmdGeneralMessage:
+			DoCmdGeneralMessage(aSection, datOpcode);
+			break;
+		case ECmdGeneralDuplicateBitmapL:
+			DoCmdGeneralDuplicateBitmapL(aSection, datOpcode);
+			break;
+		case ECmdGeneralDuplicateFontL:
+			DoCmdGeneralDuplicateFontL(aSection, datOpcode);
+			break;
+		case ECmdGeneralCloseFont:
+			DoCmdGeneralCloseFontL(aSection, datOpcode);
+			break;
+		case ECmdGeneralReplyBuf8:
+			DoCmdGeneralReplyBuf8(aSection, datOpcode);
+			break;
+		case ECmdGeneralReplyBuf16:
+			DoCmdGeneralReplyBuf16(aSection, datOpcode);
+			break;
+			// the MAnimSpriteFunctioins 
+		case ECmdSpriteGetSpriteMember:
+			DoCmdSpriteGetSpriteMember(aSection, datOpcode);
+			break;
+		case ECmdSpriteUpdateMember:
+			DoCmdSpriteUpdateMember(aSection, datOpcode) ;
+			break;
+		case ECmdSpriteActivate:
+			DoCmdSpriteActivate(aSection, datOpcode) ;
+			break;
+		case ECmdSpriteSpriteCanBeSeen:
+			DoCmdSpriteSpriteCanBeSeen(aSection, datOpcode) ;
+			break;
+		case ECmdSpriteSizeChangedL:
+			DoCmdSpriteSizeChangedL(aSection, datOpcode) ;
+			break;
+		case ECmdSpriteSetPosition:
+			DoCmdSpriteSetPosition(aSection, datOpcode) ;
+			break;
+			//MAnimWindowFunctions
+		case ECmdWindowActivateGc:
+			{
+			DoWindowActivateGc(datOpcode);
+			break;
+			}
+		case ECmdWindowSetRect:
+		case ECmdWindowIsStarted:
+			{
+			DoWindowSetRect(datOpcode, aSection);
+			break;
+			}
+		case ECmdWindowWindowSize:
+			{
+			DoWindowWindowSizeL(datOpcode, aSection);
+			break;
+			}
+		case ECmdWindowIsHidden:
+			{
+			DoWindowIsHidden(datOpcode, aSection);
+			break;
+			}
+		case ECmdWindowSetVisible:
+			{
+			DoWindowSetVisible(datOpcode, aSection);
+			break;
+			}
+		case ECmdWindowInvalidate:
+			{
+			DoWindowInvalidate(datOpcode, aSection);
+			break;
+			}
+		case ECmdWindowParameters:
+			{
+			DoWindowParametersL(datOpcode, aSection);
+			break;
+			}
+		case ECmdWindowVisibleRegion:
+			{
+			DoWindowVisibleRegion(datOpcode, aSection);
+			break;
+
+			}
+			//MAnimGeneralFunctionsWindowExtension
+		case ECmdGfweScreens:
+			{
+			DoGeneralExtScreensL(datOpcode, aSection);
+			break;
+			}
+		case ECmdGfweFocusScreens:
+			{
+			DoGeneralExtFocusScreensL(datOpcode, aSection);
+			break;
+			}
+		case ECmdGfweSetFocusScreen:
+			{
+			DoGeneralExtSetFocusScreen(datOpcode, aSection);
+			break;
+			}
+		case ECmdGfweWindowGroups:
+			{
+			DoGeneralExtWindowGroupsL(datOpcode, aSection);
+			break;
+			}
+		case ECmdGfweWindowGroupInfo:
+			{
+			DoGeneralExtWindowGroupInfoL(datOpcode, aSection);
+			break;
+			}
+		case ECmdGfweWindowGroupName:
+			{
+			DoGeneralExtWindowGroupNameL(datOpcode, aSection);
+			break;
+			}
+		case ECmdGfweSetOrdinalPosition:
+			{
+			DoGeneralExtSetOrdinalPositionL(datOpcode, aSection);
+			break;
+			}
+			//MAnimFreeTimerWindowFunctions
+		case ECmdFreeTimerWinDeactivateGc:
+			{
+			DoFreeTimerWinDeactivateGc(datOpcode);
+			break;
+			}
+		case ECmdFreeTimerWinUpdate:
+			{
+			DoFreeTimerWinUpdate(datOpcode);
+			break;
+			}
+		default:
+			{
+			_LIT(KFailed2, "Unsupported operation code. ");
+			INFO_PRINTF1(KFailed2);
+			break;
+			}
+		}
+	}
+
+void CT_DataAnimForMClass::DoCmdClose()
+	{
+	iAnim  = NULL ;
+	}
+
+void CT_DataAnimForMClass::DoCmdDestroy()
+	{
+	INFO_PRINTF1(KLogInfoCmdDestroy);
+	iAnim  = NULL ;
+	}
+
+void CT_DataAnimForMClass::DoCmdDestructor()
+	{
+	// Execute command and log parameters
+	INFO_PRINTF1(KLogInfoCmdDestructor1);
+	iAnim = NULL;
+	}
+
+//*************************MAnimWindowFunctions verifying********************************
+void CT_DataAnimForMClass::DoWindowActivateGc(TInt aOpcode)
+	{
+	INFO_PRINTF2(KLogInfoCmdCommandReply1, aOpcode);
+	TInt err=iAnim->CommandReply(aOpcode);
+	INFO_PRINTF2(KLogErrCommandReply, err);
+
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(KLogErrCommandReply, err);
+		SetError(err);
+		}
+	}
+
+void CT_DataAnimForMClass::DoWindowSetRect(TInt aOpcode, const TDesC& aSection)
+	{
+	switch (aOpcode)
+		{
+		case ECmdWindowSetRect:
+			{
+			TPtrC8 ptr;
+			TRect sendRect;
+			if (!GetRectFromConfig(aSection, KFldRect, sendRect))
+				{
+				ERR_PRINTF2(KLogErrMissingPara, &KFldRect());
+				SetBlockResult(EFail);
+				}
+			TPckgBuf<TRect> sendVal(sendRect);
+			iIpcArgs.Set(0, TIpcArgs::ENothing);
+			iIpcArgs.Set(1, &sendVal);
+
+			INFO_PRINTF2(KLogInfoCmdCommandReply3, aOpcode);
+			TInt err=iAnim->CommandReply(aOpcode, ptr, iIpcArgs);
+			INFO_PRINTF2(KLogErrCommandReply, err);
+
+			if (err != KErrNone)
+				{
+				ERR_PRINTF2(KLogErrCommandReply, err);
+				SetError(err);
+				}
+			ResetIpcArg();
+			break;
+			}
+		case ECmdWindowIsStarted:
+			{
+			INFO_PRINTF2(KLogInfoCmdCommandReply1, aOpcode);
+			TInt err=iAnim->CommandReply(aOpcode);
+			INFO_PRINTF2(KLogErrCommandReply, err);
+			if (err != KErrNone)
+				{
+				ERR_PRINTF2(KLogErrCommandReply, err);
+				SetError(err);
+				}
+			break;
+			}
+		}
+	}
+
+void CT_DataAnimForMClass::DoWindowWindowSizeL(TInt aOpcode,const TDesC& aSection)
+	{
+	TPtrC8 ptr;
+	TPtrC datWinName;
+	RWindowBase* win= NULL;
+	if (GetStringFromConfig(aSection, KFldWin, datWinName))
+		{
+		win = static_cast<RWindowBase*>(GetDataObjectL(datWinName));
+		}
+	TSize expected=win->Size();
+	TSize resultBuf;
+	TPckgBuf<TSize> retrndPck(expected);
+	iIpcArgs.Set(0, TIpcArgs::ENothing);
+	iIpcArgs.Set(1, &retrndPck);
+	INFO_PRINTF2(KLogInfoCmdCommandReply3, aOpcode);
+	TInt err=iAnim->CommandReply(aOpcode, ptr, iIpcArgs);
+	INFO_PRINTF2(KLogErrCommandReply, err);
+
+	resultBuf=retrndPck();
+	if (expected!=resultBuf)
+		{
+		ERR_PRINTF5(_L("The returned value is not as expected, expected: (%d,%d), actual: (%d,%d)"), expected.iWidth,expected.iHeight, resultBuf.iWidth,resultBuf.iHeight);
+		SetBlockResult(EFail);
+		}
+	ResetIpcArg();
+	} 
+
+void CT_DataAnimForMClass::DoWindowIsHidden(TInt aOpcode,const TDesC& aSection)
+	{
+	TBool expectedVal;
+
+	if (!GetBoolFromConfig(aSection, KFldExpected, expectedVal))
+		{
+		ERR_PRINTF2(KLogErrMissingPara, &KFldExpected());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF2(KLogInfoCmdCommandReply1, aOpcode);
+		TInt actual=iAnim->CommandReply(aOpcode);
+		INFO_PRINTF2(KLogErrCommandReply, actual);
+		if (actual!=expectedVal)
+			{
+			ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedVal, actual);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataAnimForMClass::DoWindowSetVisible(TInt aOpcode,const TDesC& aSection)
+	{
+	TBool setVisible;
+	TPtrC8 ptr;
+
+	if (!GetBoolFromConfig(aSection, KFldState, setVisible))
+		{
+		ERR_PRINTF2(KLogErrMissingPara, &KFldState());
+		SetBlockResult(EFail);
+		}
+
+	iIpcArgs.Set(0, TIpcArgs::ENothing);
+	TPckgBuf<TBool> setVisiblePck(setVisible);
+	iIpcArgs.Set(1, &setVisiblePck);
+	INFO_PRINTF2(KLogInfoCmdCommandReply3, aOpcode);
+	TInt err=iAnim->CommandReply(aOpcode, ptr, iIpcArgs);
+	INFO_PRINTF2(KLogErrCommandReply, err);
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(KLogErrCommandReply, err);
+		SetError(err);
+		}
+	ResetIpcArg();
+	}
+
+void CT_DataAnimForMClass::DoWindowInvalidate(TInt aOpcode,const TDesC& aSection)
+	{
+	TPtrC datWinName;
+	TPtrC8 ptr;
+	TRect rectVal;
+	if (!GetRectFromConfig(aSection, KFldRect, rectVal))
+		{
+		ERR_PRINTF2(KLogErrMissingPara, &KFldRect());
+		SetBlockResult(EFail);
+		}
+	iIpcArgs.Set(0, TIpcArgs::ENothing);
+	TPckgBuf<TRect> rectValPck(rectVal);
+	iIpcArgs.Set(1, &rectValPck);
+	INFO_PRINTF2(KLogInfoCmdCommandReply3, aOpcode);
+	TInt err=iAnim->CommandReply(aOpcode, ptr, iIpcArgs);
+	INFO_PRINTF2(KLogErrCommandReply, err);
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(KLogErrCommandReply, err);
+		SetError(err);
+		}
+	ResetIpcArg();
+	}
+
+void CT_DataAnimForMClass::DoWindowParametersL(TInt aOpcode,const TDesC& aSection)
+	{
+	RWindowBase* win= NULL;
+	TSize expectedSize;
+	TInt expectedDisplyMd;
+	TPtrC val;
+	TPtrC8 ptr;
+	TPtrC datWinName;
+	TPckgBuf<TRect> retrndWindowPostn;
+	TPckgBuf<TInt> retrndDisplyMd;
+	iIpcArgs.Set(0, TIpcArgs::ENothing);
+	iIpcArgs.Set(1, &retrndWindowPostn);
+	iIpcArgs.Set(2, &retrndDisplyMd);
+
+	//Send command to server
+	TInt err=iAnim->CommandReply(aOpcode, ptr, iIpcArgs);
+	INFO_PRINTF2(KLogErrCommandReply, err);
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(KLogErrCommandReply, err);
+		SetError(err);
+		}
+	else
+		{
+		//Get the window's Size and Displaymode
+		if (GetStringFromConfig(aSection, KFldWin, datWinName))
+			{
+			win = static_cast<RWindowBase*>(GetDataObjectL(datWinName));
+			}
+		expectedSize=win->Size();
+		expectedDisplyMd=win->DisplayMode();
+
+		TRect retrndWinInf=retrndWindowPostn();
+		TSize retrndSize=retrndWinInf.Size();
+		TInt retrndDisplyM=retrndDisplyMd();
+
+		if (retrndSize!=expectedSize)
+			{
+			ERR_PRINTF5(_L("The value is not as expected! expected: (%d,%d), actual: (%d,%d)"), expectedSize.iWidth,expectedSize.iHeight, retrndSize.iWidth,retrndSize.iHeight);
+			SetBlockResult(EFail);
+			}
+		if (retrndDisplyM!=expectedDisplyMd)
+			{
+			ERR_PRINTF3(_L("The value is not as expected! expected: %d, actual: %d"), expectedDisplyMd, retrndDisplyM);
+			SetBlockResult(EFail);
+			}
+		}
+	ResetIpcArg();
+	}
+
+void CT_DataAnimForMClass::DoWindowVisibleRegion(TInt aOpcode,const TDesC& aSection)
+	{
+	TInt expecteValue;
+	TInt actual;
+
+	if (!GetIntFromConfig(aSection, KFldExpected, expecteValue))
+		{
+		ERR_PRINTF2(KLogErrMissingPara, &KFldExpected());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		actual=iAnim->CommandReply(aOpcode);
+		INFO_PRINTF2(KLogErrCommandReply, actual);
+		if (actual!=expecteValue)
+			{
+			ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expecteValue, actual);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+//****************MAnimGeneralFunctionsWindowExtension verifying*******************************
+
+void CT_DataAnimForMClass::DoGeneralExtScreensL(TInt aOpcode,const TDesC& aSection)
+	{
+	RWsSession* ws;
+	TPtrC datWsName;
+	if (GetStringFromConfig(aSection, KFldWs, datWsName))
+		{
+		ws = static_cast<RWsSession*>(GetDataObjectL(datWsName));
+		}
+	TInt actualScreenNumb=iAnim->CommandReply(aOpcode);
+	INFO_PRINTF2(KLogErrCommandReply, actualScreenNumb);
+	}
+
+void CT_DataAnimForMClass::DoGeneralExtFocusScreensL(TInt aOpcode,const TDesC& aSection)
+	{
+	RWsSession* ws;
+	TPtrC datWsName;
+	TInt expectedVal;
+
+	TInt actual=iAnim->CommandReply(aOpcode);
+	INFO_PRINTF2(_L("FocuseScreens is %d"),actual);
+
+	//If there is no expected value set in ini file, get the focus screen; 
+	if (!GetIntFromConfig(aSection, KFldExpected, expectedVal))
+		{
+		if (GetStringFromConfig(aSection, KFldWs, datWsName))
+			{
+			ws = static_cast<RWsSession*>(GetDataObjectL(datWsName));
+			}
+
+		expectedVal=ws->GetFocusScreen();
+		}
+
+	if (actual!=expectedVal)
+		{
+		ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedVal, actual);
+		SetBlockResult(EFail);
+		}
+	}
+
+void CT_DataAnimForMClass::DoGeneralExtSetFocusScreen(TInt aOpcode,const TDesC& aSection)
+	{
+	TInt screenNo;
+	TPtrC8 ptr;
+	TPtrC datWsName;
+
+	if (!GetIntFromConfig(aSection, KFldScreenNumb, screenNo))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldScreenNumb());
+		SetBlockResult(EFail);
+		}
+	iIpcArgs.Set(0, TIpcArgs::ENothing);
+	TPckgBuf<TInt> screenNoPck(screenNo);
+	iIpcArgs.Set(1, &screenNoPck);
+	TInt actual=iAnim->CommandReply(aOpcode, ptr, iIpcArgs);
+	INFO_PRINTF2(KLogErrCommandReply, actual);
+
+	ResetIpcArg();
+	}
+
+void CT_DataAnimForMClass::DoGeneralExtWindowGroupsL(TInt aOpcode,const TDesC& aSection)
+	{
+	TPtrC8 ptr;
+	TInt screenNo;
+	TPtrC datWsName;
+	RWsSession* ws;
+	if (!GetIntFromConfig(aSection, KFldScreenNumb, screenNo))
+		{
+		ERR_PRINTF2(KLogErrMissingPara, &KFldScreenNumb());
+		SetBlockResult(EFail);
+		}
+	iIpcArgs.Set(0, TIpcArgs::ENothing);
+	TPckgBuf<TInt> screenNoPck(screenNo);
+	iIpcArgs.Set(1, &screenNoPck);
+	TInt actual=iAnim->CommandReply(aOpcode, ptr, iIpcArgs);
+	INFO_PRINTF2(KLogErrCommandReply, actual);
+
+	if (!GetStringFromConfig(aSection, KFldWs, datWsName))
+		{
+		ERR_PRINTF2(KLogErrMissingPara, &KFldWs());
+		SetBlockResult(EFail);
+		}
+	ws = static_cast<RWsSession*>(GetDataObjectL(datWsName));
+	TInt expectedVal=ws->NumWindowGroups();
+
+	if (actual!=expectedVal)
+		{
+		ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedVal, actual);
+		SetBlockResult(EFail);
+		}
+	ResetIpcArg();
+	}
+
+void CT_DataAnimForMClass::DoGeneralExtWindowGroupInfoL(TInt aOpcode,const TDesC& aSection)
+	{
+	TInt screenNo;
+	TPtrC8 ptr;
+	TPtrC datWingrpName;
+	TInt retrnPck;
+	TInt expectedGrpInfo;
+	RWindowGroup* wingrp;
+	//Get window group object in order to verify the window group's name's existance.
+	if (!GetStringFromConfig(aSection, KFldWingrp, datWingrpName))
+		{
+		ERR_PRINTF2(KLogErrMissingPara, &KFldWingrp());
+		SetBlockResult(EFail);
+		}
+	wingrp = static_cast<RWindowGroup*>(GetDataObjectL(datWingrpName));
+
+	//Get screen number from ini file and set to IPC slot 1.
+	if (!GetIntFromConfig(aSection, KFldScreenNumb, screenNo))
+		{
+		ERR_PRINTF2(KLogErrMissingPara, &KFldScreenNumb());
+		SetBlockResult(EFail);
+		}
+	iIpcArgs.Set(0, TIpcArgs::ENothing);
+	TPckgBuf<TInt> screenNoPck(screenNo);
+	iIpcArgs.Set(1, &screenNoPck);
+
+	//Get fullOrdipostion from ini or by using FullOrdinalPosition method and set to IPC slot 2.
+	TInt fullOrdiPostion;
+	if (!GetIntFromConfig(aSection, KFldFullOrdinPostn, fullOrdiPostion))
+		{
+		fullOrdiPostion=wingrp->FullOrdinalPosition();
+		}
+	TPckgBuf<TInt> fullOrdiPostionPck(fullOrdiPostion);
+	iIpcArgs.Set(2, &fullOrdiPostionPck);
+
+	//Set IPC slot 3 to receive ID of the TWindowGroupInfo.
+	TPckgBuf<TInt> retrnWinGrpInfo;
+	iIpcArgs.Set(3, &retrnWinGrpInfo);
+
+	TInt actual=iAnim->CommandReply(aOpcode, ptr, iIpcArgs);
+	INFO_PRINTF2(KLogErrCommandReply, actual);
+	TBool expectedVal;
+	if (!GetBoolFromConfig(aSection, KFldExpected, expectedVal))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldExpected);
+		SetBlockResult(EFail);
+		}
+	if (actual!=expectedVal)
+		{
+		ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedVal, actual);
+		SetBlockResult(EFail);
+		}
+	if (actual!=EFalse)
+		{
+		retrnPck=retrnWinGrpInfo();//Get returned window group ID
+
+		expectedGrpInfo=wingrp->WindowGroupId();
+		if (retrnPck!=expectedGrpInfo)
+			{
+			ERR_PRINTF3(
+			_L("The returned value is not as expected, expected: %d, actual: %d"),
+			expectedGrpInfo, retrnPck);
+			SetBlockResult(EFail);
+			}
+		}
+	ResetIpcArg();
+	}
+
+void CT_DataAnimForMClass::DoGeneralExtWindowGroupNameL(TInt aOpcode,const TDesC& aSection)
+	{
+	TBuf<32> getWindowName;
+	TBool expectedVal;
+	TInt screenNo;
+	TInt fullOrdiPostion;
+	//Get Screen number from ini and set to IPC slot 1.
+	if (!GetIntFromConfig(aSection, KFldScreenNumb, screenNo))
+		{
+		ERR_PRINTF2(KLogErrMissingPara, &KFldScreenNumb);
+		SetBlockResult(EFail);
+		}
+	TPtrC8 ptr;
+	TPckgBuf<TInt> screenNoPck(screenNo);
+	iIpcArgs.Set(0, TIpcArgs::ENothing);
+	iIpcArgs.Set(1, &screenNoPck);
+
+	TPtrC datWingrpName;
+	RWindowGroup* wingrp;
+	//Get window group object
+	if (!GetStringFromConfig(aSection, KFldWingrp, datWingrpName))
+		{
+		ERR_PRINTF2(KLogErrMissingPara, &KFldWingrp());
+		SetBlockResult(EFail);
+		}
+	wingrp = static_cast<RWindowGroup*>(GetDataObjectL(datWingrpName));
+	//Get fullOrdinary position and set to IPC slot 2.
+	if (!GetIntFromConfig(aSection, KFldFullOrdinPostn, fullOrdiPostion))
+		{
+		fullOrdiPostion=wingrp->FullOrdinalPosition();
+		}
+
+	TPckgBuf<TInt> fullOrdiPostionPck(fullOrdiPostion);
+	iIpcArgs.Set(2, &fullOrdiPostionPck);
+	//Set IPC slot 3 to receive the window name returned from server side.
+	TBuf<32> retrnWindowName;
+	iIpcArgs.Set(3, &retrnWindowName);
+
+	TInt actual=iAnim->CommandReply(aOpcode, ptr, iIpcArgs);
+	INFO_PRINTF2(KLogErrCommandReply, actual);
+	if (!GetBoolFromConfig(aSection, KFldExpected, expectedVal))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldExpected);
+		SetBlockResult(EFail);
+		}
+	if (actual!=expectedVal)
+		{
+		ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedVal, actual);
+		SetBlockResult(EFail);
+		}
+	//If commandreply returns ETrue then check the window group's name.
+	if (actual)
+		{
+		TInt result=wingrp->Name(getWindowName);
+		if (result!=KErrNone)
+			{
+			ERR_PRINTF1(_L("Failed to get the window group's name!"));
+			SetError(result);
+			}
+		INFO_PRINTF3(_L("Check the group name is expected. expected: %d,actual: %d"),&getWindowName,&retrnWindowName);
+		if (getWindowName!=retrnWindowName)
+			{
+			ERR_PRINTF1(_L("The returned window group name is not expected"));
+			SetBlockResult(EFail);
+			}
+		}
+	ResetIpcArg();
+	}
+
+void CT_DataAnimForMClass::DoGeneralExtSetOrdinalPositionL(TInt aOpcode,const TDesC& aSection)
+	{
+	TInt expectedVal;
+	TPtrC8 ptr;
+	TInt wingrpid;
+	TInt newOrdinPrio;
+	TInt newOrdinaPostn;
+	TPtrC datWingrpName;
+	RWindowGroup* wingrp;
+	if (GetStringFromConfig(aSection, KFldWingrp, datWingrpName))
+		{
+		wingrp = static_cast<RWindowGroup*>(GetDataObjectL(datWingrpName));
+		}
+	//Before sending command, get window group ID from wrapper or ini as arg(IPC slot 1)
+	if (!GetIntFromConfig(aSection, KFldWingrpId, wingrpid))
+		{
+		wingrpid=wingrp->WindowGroupId();
+		INFO_PRINTF2(_L("RWindowTreeNode::WindowGroupId	= %d"), wingrpid);
+		}
+	iIpcArgs.Set(0, TIpcArgs::ENothing);
+	TPckgBuf<TInt> wingrpidPck(wingrpid);
+	iIpcArgs.Set(1, &wingrpidPck);
+
+	//Get Group Id from wrapper or ini and send to server as IPC slot2
+	if (!GetIntFromConfig(aSection, KFldOrdinalPosition, newOrdinaPostn))
+		{
+		newOrdinaPostn = wingrp->OrdinalPosition();
+		INFO_PRINTF2(_L("RWindowTreeNode::FullOrdinalPosition	= %d"), newOrdinaPostn);
+		}
+	TPckgBuf<TInt> newOrdinaPostnPck(newOrdinaPostn);
+	iIpcArgs.Set(2, &newOrdinaPostnPck);
+
+	//Get new ordinal priority of the window as arg(IPC slot 3) from ini file;
+	if (!GetIntFromConfig(aSection, KFldOrdinalPriority, newOrdinPrio))
+		{
+		newOrdinPrio = wingrp->OrdinalPriority();
+		INFO_PRINTF2(_L("RWindowTreeNode::FullOrdinalPriority	= %d"), newOrdinPrio);
+		}
+	TPckgBuf<TInt> newOrdinPrioPck(newOrdinPrio);
+	iIpcArgs.Set(3, &newOrdinPrioPck);
+
+	TInt err=iAnim->CommandReply(aOpcode, ptr, iIpcArgs);
+	if (!GetIntFromConfig(aSection, KFldExpected, expectedVal))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldExpected);
+		SetBlockResult(EFail);
+		}
+
+	if (err!=expectedVal)
+		{
+		ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedVal, err);
+		SetBlockResult(EFail);
+		}
+	//Get the new OrdinalPostion and Priority using window group methods;
+	if (err!=KErrNotFound)
+		{
+		TInt retrnOrdinPostn=wingrp->OrdinalPosition();
+		TInt retrnOrdinPrio=wingrp->OrdinalPriority();
+
+		if (retrnOrdinPostn!=newOrdinaPostn)
+			{
+			ERR_PRINTF3(
+			_L("The returned ordinalposition is not as expected, expected: %d, actual: %d"),
+			newOrdinaPostn, retrnOrdinPostn);
+			SetBlockResult(EFail);
+			}
+
+		if (retrnOrdinPrio!=newOrdinPrio)
+			{
+			ERR_PRINTF3(
+			_L("The returned ordinalpriority is not as expected, expected: %d, actual: %d"),
+			newOrdinPrio, retrnOrdinPrio);
+			SetBlockResult(EFail);
+			}
+		}
+	ResetIpcArg();
+	}
+
+void CT_DataAnimForMClass::DoGeneralExtIsFocusableL(TInt aOpcode, const TDesC& aSection)
+	{
+	TInt screenNub;
+	TBool expectedVal;
+	TInt sendFullOrdinPstn;
+	if (!GetIntFromConfig(aSection, KFldScreenNumb, screenNub))
+		{
+		ERR_PRINTF2(KLogErrMissingPara, &KFldScreenNumb);
+		}
+	TPtrC8 ptr;
+	iIpcArgs.Set(0, TIpcArgs::ENothing);
+	TPckgBuf<TInt> screenNubPck(screenNub);
+	iIpcArgs.Set(1, &screenNubPck);
+
+	TPtrC datWingrpName;
+	RWindowGroup* wingrp;
+	if (GetStringFromConfig(aSection, KFldWingrp, datWingrpName))
+		{
+		wingrp = static_cast<RWindowGroup*>(GetDataObjectL(datWingrpName));
+		}
+
+	//Get animation window's FullOrdinalPosition as arg(IPC slot 2)
+
+	sendFullOrdinPstn = wingrp->FullOrdinalPosition();
+	INFO_PRINTF2(_L("RWindowTreeNode::FullOrdinalPosition	= %d"), sendFullOrdinPstn);
+	TPckgBuf<TInt> sendFullOrdinPstnPck(sendFullOrdinPstn);
+	iIpcArgs.Set(2, &sendFullOrdinPstnPck);
+
+	//Check the CommandReply return value
+	TInt err=iAnim->CommandReply(aOpcode, ptr, iIpcArgs);
+	if (!GetBoolFromConfig(aSection, KFldExpected, expectedVal))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldExpected);
+		SetBlockResult(EFail);
+		}
+
+	if (err!=expectedVal)
+		{
+		ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedVal, err);
+		SetBlockResult(EFail);
+		}
+	ResetIpcArg();
+	}
+
+//*******************MAnimFreeTimerWindowFunction verifying*******************************
+void CT_DataAnimForMClass::DoFreeTimerWinDeactivateGc(TInt aOpcode)
+	{
+	INFO_PRINTF2(_L("Excute %d"), aOpcode);
+	TPtrC8 ptr;
+	TInt err=iAnim->CommandReply(aOpcode, ptr);
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(KLogErrCommandReply, err);
+		SetError(err);
+		}
+	}
+
+void CT_DataAnimForMClass::DoFreeTimerWinUpdate(TInt aOpcode)
+	{
+	INFO_PRINTF1(KLogInfoCmdCommandReply1);
+	
+	TInt err=iAnim->CommandReply(aOpcode);
+	
+	if(err!=KErrNone)
+		{
+		ERR_PRINTF2(_L("CommandReply failed with error %d"), err);
+		SetError(err);
+		}
+	}
+
+//------------------------------------------------------------------------------------
+void CT_DataAnimForMClass::DoCmdRetrieveResult(const TDesC& aSectName , const TInt& datOpcode)
+	{
+	TInt result = iAnim->CommandReply(datOpcode);
+	TBool expectdVal;
+    //Get  expected value from ini file.
+	if(!GetBoolFromConfig(aSectName,KFldExpected,expectdVal))
+		{
+		if ( result != KErrNone)
+		   ERR_PRINTF2( KLogErrCommandReply, result);	 	
+		else // success
+		   { 
+		   INFO_PRINTF1(_L("Retrieve Result event return ETrue"));
+		   }
+		}
+	if(result!=expectdVal)
+		{
+		ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectdVal, result);
+		SetBlockResult (EFail);
+		}
+	else   
+		{
+		INFO_PRINTF1(_L("Retrieve Result equals to the expected value"));
+		}
+	} 
+
+void CT_DataAnimForMClass::DoCmdGeneralAnimate(const TDesC& aSectName,  const TInt& datOpcode )
+    {
+    //Get the datetime from the ini file
+    TDateTime dateTime ;
+	if(!GetDateTimeFromConfig(aSectName,  dateTime))
+	  	{
+	 	ERR_PRINTF2(KLogMissingParameter , &KlogDateTime);
+	 	SetBlockResult(EFail);  
+	  	}	
+	TPckgBuf<TDateTime> sendPckg(dateTime);
+	iIpcArgs.Set(0,TIpcArgs::ENothing);
+	iIpcArgs.Set(1, &sendPckg);
+	 
+	INFO_PRINTF1(KLogInfoCmdCommandReply3);
+	// Send the command to notify the server
+	TInt ret = iAnim->CommandReply(datOpcode, iSendBuf, iIpcArgs); 
+	 
+	// Check the command return code 
+	if(ret == KErrNone)   
+    	{
+	    ERR_PRINTF2( KLogErrCommandReply, ret);	 
+        SetBlockResult (EFail);          
+		}
+	else
+		{
+		INFO_PRINTF1(_L("General Animate invoked succesffully and return successfully "));
+		}
+	ResetIpcArg();
+    }
+
+
+void CT_DataAnimForMClass::DoCmdGeneralClient(const TDesC& /*aSectName*/,  const TInt& datOpcode )
+    {
+    // Send the command to notify the server
+    INFO_PRINTF1(KLogInfoCmdCommandReply3);
+    TInt ret =	iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs);
+	
+	// Check the return thread id equals to the client thread or not.
+	TInt clientThreadId = RThread().Id().Id();
+	
+	if ( ret == clientThreadId )
+		{
+		INFO_PRINTF1(_L("General client invoked succesffully"));
+		}
+	else 
+		{
+		ERR_PRINTF2( KLogErrCommandReply, ret);	 
+	    SetBlockResult (EFail);     
+		}
+    }
+   
+
+void CT_DataAnimForMClass::DoCmdGeneralFlashStateOn(const TDesC& aSectName,  const TInt& datOpcode )
+    {
+    // Send the command to notify the server. 
+    INFO_PRINTF1(KLogInfoCmdCommandReply3);
+    TBool expected(EFalse);
+    TInt ret = -1 ;
+    
+    if ( !GetBoolFromConfig(aSectName,KFldExpected, expected) )
+		{
+	    ERR_PRINTF2(KLogMissingParameter , &KFldExpected);
+		SetBlockResult(EFail); 
+		} 
+   
+    ret = iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs);	
+    //If ret return -1, the result value can not be trusted(Please refer to the code in AnimPlugin::WinAnim).
+    //So it need another calling untill the ret return a ETrue or EFalse.
+    while(ret == -1)
+    	{
+    	User::After(100000);
+    	ret = iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs);	
+    	}
+    
+   
+    // Check if the return is ETrue (1) or EFalse(0)
+    if ( ret == static_cast<TInt>(expected) )
+	   { 
+       INFO_PRINTF1(_L("GeneralFlashStateOn invoked succesffully. Return code equals to expected vaule "));						 			
+	   }
+   else 
+	   {
+	   ERR_PRINTF2( KLogErrCommandReply, ret);	 	
+       SetBlockResult (EFail); 
+	   }
+    }
+
+void CT_DataAnimForMClass::DoCmdGeneralPanic(const TDesC& /*aSectName*/ , const TInt& datOpcode)
+    {
+	//Send the command to notify the server.
+	INFO_PRINTF1(KLogInfoCmdCommandReply3);
+	TInt err = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs );
+								
+	//The client will be paniced by the server
+	INFO_PRINTF1(_L("GeneralPanic invoked successfully"));	 	 				 		 			
+	}
+
+void CT_DataAnimForMClass::DoCmdGeneralScreenDevice(const TDesC& /*aSectName*/ , const TInt& datOpcode )
+    {
+	//Send the command to notify the server .
+	INFO_PRINTF1(KLogInfoCmdCommandReply3);
+	TInt ret = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs );
+									 
+	//Check if the return code is 0(Success) or not.
+	if ( ret == KErrNone ) 
+	    { 
+	    INFO_PRINTF1(_L("GeneralScreenDevice invoked succesffully."));						 			
+	    }
+	else 
+	    {
+	    ERR_PRINTF2( KLogErrCommandReply, ret);	 	
+	    SetBlockResult (EFail); 
+	    }
+	}
+
+void CT_DataAnimForMClass::DoCmdGeneralWindowExtension(const TDesC& /*aSectName*/, const TInt& datOpcode)
+	{
+	// Send the command to notify the server .
+	INFO_PRINTF1(KLogInfoCmdCommandReply3);
+	TInt ret = iAnim->CommandReply(datOpcode, iSendBuf, iIpcArgs);
+
+	// Check if the return code is 0(Success) or not.
+	if (ret == KErrNone)
+		{
+		INFO_PRINTF1(_L("GeneralWindowExtension invoked succesffully."));
+		}
+	else
+		{
+		ERR_PRINTF2( KLogErrCommandReply, ret);
+		SetBlockResult(EFail);
+		}
+	}
+
+void CT_DataAnimForMClass::DoCmdGeneralEventExtension( const TDesC& /*aSectName*/,const TInt& datOpcode)
+	{
+	// Send the command to notify the server .
+    INFO_PRINTF1(KLogInfoCmdCommandReply3);
+	TInt ret = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs );
+
+	// Check if the return code is 0(Success) or not.
+	if ( ret == KErrNone )
+		{
+		INFO_PRINTF1(_L("GeneralEventExtension invoked succesffully."));
+		}
+	else
+		{
+		ERR_PRINTF2( KLogErrCommandReply, ret);
+		SetBlockResult (EFail);
+		}
+	}
+
+ void CT_DataAnimForMClass::DoCmdGeneralExtendedInterface(const TDesC& aSectName , const TInt& datOpcode )  
+    {
+    TInt interface ;
+    //Get interface from ini file and set it as IpcArgs 1. 
+	if ( !GetIntFromConfig(aSectName,KFldInterface, interface) )
+	 	 {
+	 	 ERR_PRINTF2(KLogMissingParameter , &KFldInterface);
+	 	 SetBlockResult (EFail); 
+	 	 }
+    TPckgBuf<TInt> sendPckg(interface);
+	iIpcArgs.Set(0,TIpcArgs::ENothing);
+	iIpcArgs.Set(1, &sendPckg);
+	INFO_PRINTF1(KLogInfoCmdCommandReply3);
+    //Send the command to notify the server .
+	TInt result = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs );
+										 
+	//  Check the command return code 
+	if ( interface == 0 )
+	   {
+	   TInt expected ;
+
+	   if ( !GetIntFromConfig(aSectName,KFldExpected, expected) )
+		   {
+		   ERR_PRINTF2(KLogMissingParameter , &KFldInterface);
+		   SetBlockResult (EFail); 
+		   }
+	   if ( result != expected ) /*so far, the expected value is 2.*/
+           { 
+	       ERR_PRINTF2( KLogErrCommandReply, result);	 	
+	       SetBlockResult (EFail); 
+           }
+	   else 
+	       {
+           INFO_PRINTF1(_L("extended interface return is okay when the input paramter is 0"));
+	       }
+	   }
+	else if( interface == 1 )
+	   {
+	   if ( result == 0) // server return 0 stands for okay.
+		   { 
+		   INFO_PRINTF1(_L("extended interface return is okay when the input paramter is 1")); 
+		   }
+	   else 
+		   { 
+		   ERR_PRINTF2( KLogErrCommandReply, result);	 	
+		   SetBlockResult (EFail); 
+	       } 
+	   }
+    else if( interface == 2 )
+	   {
+	   if ( result == 0) // server return 0 stands for okay.
+		   { 
+		   INFO_PRINTF1(_L("extended interface return is okay when the input paramter is 2")); 
+		   }
+	   else 
+		   { 
+		   ERR_PRINTF2( KLogErrCommandReply, result);	 	
+		   SetBlockResult (EFail); 
+		   } 
+	   }  
+	else 
+	   {
+	   if ( result == 0) // server return 0 stands for okay.
+		   { 
+		   INFO_PRINTF1(_L("extended interface return is a NULL pointer when the input paramter is OUT of 0~2")); 
+		   }
+	   else 
+		   { 
+		   ERR_PRINTF2( KLogErrCommandReply, result);	 	
+		   SetBlockResult (EFail); 
+	       } 
+	   }
+	ResetIpcArg();
+	}
+
+void CT_DataAnimForMClass::DoCmdGeneralNumOfExtInterfaces(const TDesC& aSectName,const TInt& datOpcode)
+    {
+    // Send the command to notify the server.
+    INFO_PRINTF1(KLogInfoCmdCommandReply3);
+	TInt result = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs);
+
+	INFO_PRINTF2(KLogErrCommandReply, result);
+
+	// Check the return code 
+	TInt expected;
+	if ( !GetIntFromConfig(aSectName,KFldExpected, expected) )
+		{
+		ERR_PRINTF2(KLogMissingParameter , &KFldInterface);
+		SetBlockResult (EFail);
+		}
+	if (result != expected) // so far ,the expected value is 2. 
+		{
+		ERR_PRINTF2( KLogErrCommandReply, result);
+		SetBlockResult (EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("NumberofExtendedInterfaces return is okay when the input paramter is 0"));
+		}
+	}
+ 
+
+ void CT_DataAnimForMClass::DoCmdGeneralGetRawEvents(const TDesC& aSectName , const TInt& datOpcode)
+    {
+    TBool bGetEvent;
+    //Get the rawevent parameter from ini file and set it as the IpcArgs 1 . 
+    if ( !GetBoolFromConfig(aSectName,KFldGetEvent ,bGetEvent))
+		{
+		ERR_PRINTF2(KLogMissingParameter , &KFldGetEvent);
+		SetBlockResult(EFail);
+		}
+	iIpcArgs.Set(0,TIpcArgs::ENothing);
+	TPckgBuf<TBool> sendPckg(bGetEvent);
+	iIpcArgs.Set(1, &sendPckg);
+
+	INFO_PRINTF1(KLogInfoCmdCommandReply3);
+    // Send the command to notify the server .
+    TInt result = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs );
+
+	//Check the result is 0(Success) or not.
+	if (result != KErrNone )
+		{
+		ERR_PRINTF2( KLogErrCommandReply, result);
+		SetBlockResult (EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("GetRawEvents return is okay "));
+		}
+	}
+ 
+ void CT_DataAnimForMClass::DoCmdGeneralPostRawEvent(const TDesC& aSectName , const TInt& datOpcode)
+	{
+	TRawEvent rawEvent;
+	TPtrC str;
+    //Get the post rawevent parameter from ini file and set it as the IpcArgs 1 . 
+	if (!GetStringFromConfig(aSectName,KFldPostRawEvent,str))
+	    {
+	    ERR_PRINTF2(KLogMissingParameter , &KFldPostRawEvent);
+	    SetBlockResult(EFail);
+	    }
+    TRawEvent::TType type;
+    if ( str == KENone )
+        type = TRawEvent::ENone;
+    else if ( str == KEPointerMove )
+        type = TRawEvent::EPointerMove;
+    else if ( str == KEPointerSwitchOn)
+        type = TRawEvent::EPointerSwitchOn;
+    else if ( str == KEKeyDown )
+        type = TRawEvent::EKeyDown;
+    else if ( str == KEKeyUp )
+        type = TRawEvent::EKeyUp;
+    else if ( str == KERedraw)
+        type = TRawEvent::ERedraw;
+    else if ( str == KESwitchOn )
+        type = TRawEvent::ESwitchOn;
+    else if ( str == KEActive)
+        type = TRawEvent::EActive;
+    else if ( str == KEInactive)
+        type = TRawEvent::EInactive;
+    else if ( str == KEUpdateModifiers)
+        type = TRawEvent::EUpdateModifiers;
+    else if ( str == KEButton1Down)
+        type = TRawEvent::EButton1Down;
+    else if ( str == KEButton1Up)
+        type = TRawEvent::EButton1Up;
+    else if ( str == KEButton2Down)
+        type = TRawEvent::EButton2Down;
+    else if ( str == KEButton2Up)
+        type = TRawEvent::EButton2Up;
+    else if ( str == KEButton3Down)
+        type = TRawEvent::EButton3Down;
+    else if ( str == KEButton3Up)
+        type = TRawEvent::EButton3Up;
+    else if ( str == KESwitchOff)
+        type = TRawEvent::ESwitchOff;
+    else if ( str == KEKeyRepeat)
+        type = TRawEvent::EKeyRepeat;
+    else if ( str == KECaseOpen)
+        type = TRawEvent::ECaseOpen;
+    else if ( str == KECaseClose)
+        type = TRawEvent::ECaseClose;
+    else if ( str == KERestartSystem)
+        type = TRawEvent::ERestartSystem;
+
+    rawEvent.Set(type);
+    TPckgBuf<TRawEvent> sendPckg(rawEvent);
+    
+    iIpcArgs.Set(0,TIpcArgs::ENothing);
+    iIpcArgs.Set(1, &sendPckg);
+
+    INFO_PRINTF1(KLogInfoCmdCommandReply3);
+    //Send the command to notify the server .
+	TInt result = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs );
+
+    //Check the result is 0(Success) or not.
+    if (result != KErrNone )
+	   {
+	   ERR_PRINTF2(KLogErrCommandReply, result);
+       SetBlockResult (EFail);
+	   }
+    else
+	   {
+	   INFO_PRINTF1(_L("PostRawEvent return is okay "));
+	   }
+    }  
+ 
+
+ void CT_DataAnimForMClass::DoCmdGeneralPostKeyEventL(const TDesC& aSectName ,  const TInt& datOpcode)
+	{
+	/*
+	* 1.Use WinAnim plugin dll to post a key event. 
+	* 2.Use an RWindowGroup object to capture the key event.
+	* */
+
+	TKeyEvent keyEvent;
+	TKeyCode aKeyCode;
+	_LIT( KCode , "Code"); 
+    //Get the keycode from the ini file. 
+	if (!CT_GraphicsUtil::ReadKeyCode(*this, aSectName, KCode , aKeyCode))
+		{
+		ERR_PRINTF2(KLogMissingParameter , &KCode);
+		SetBlockResult(EFail);
+		}
+    // The keyEvent will be set as the IpcArg 1 .    
+	TInt captureKey = aKeyCode;
+	keyEvent.iCode = aKeyCode;
+	keyEvent.iScanCode =aKeyCode;
+	keyEvent.iModifiers = 0;
+	keyEvent.iRepeats = 0;
+		   
+	_LIT(KWindowGroup, "windowgroup");
+	_LIT(KWsSession, "session");
+	RWindowGroup* group = NULL;
+	RWsSession* session = NULL;
+	TPtrC datName;
+	if ( GetStringFromConfig(aSectName, KWindowGroup , datName) )
+		{
+		group = static_cast<RWindowGroup*>(GetDataObjectL(datName));
+		}
+	
+   	if ( GetStringFromConfig(aSectName, KWsSession , datName) )
+   		{
+	    session = static_cast<RWsSession*>(GetDataObjectL(datName));
+   		}
+   	group->CaptureKey(captureKey, 0, 0);	
+	TPckgBuf<TKeyEvent> sendPckg(keyEvent);
+	iIpcArgs.Set(0,TIpcArgs::ENothing);
+	iIpcArgs.Set(1, &sendPckg);   
+	TInt err = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs );
+	 
+	//Check the result is 0(Success) or not.
+	if (err != KErrNone )  
+		{
+		ERR_PRINTF2(KLogErrCommandReply, err);
+		SetBlockResult (EFail); 
+		}			
+	else 
+		{
+		INFO_PRINTF1(_L("PostKeyEvent return is okay "));
+		}  	
+	TRequestStatus myStatus;
+	session->EventReady(&myStatus);
+	TBool bStop = ETrue;
+	TWsEvent we;
+	while(bStop)
+		{
+    	User::WaitForRequest(myStatus);
+    	session->GetEvent(we);
+    	if(we.Type() == EEventKey)
+    		{
+    		bStop = EFalse;
+    	    TInt rst = we.Key()->iCode;    		
+    	    if(rst != captureKey)
+    	    	{
+    	        ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), captureKey, rst);
+    	        SetBlockResult(EFail);
+    	        }
+    	     else
+    	    	{
+    	    	_LIT(KSuccess, "PostKeyEvent successfully");   
+    	        INFO_PRINTF1(KSuccess);
+    	        }
+    		}
+    	else
+    		{
+    		session->EventReady(&myStatus);
+    		}
+		}//end while	
+	}  
+ 
+ void CT_DataAnimForMClass::DoCmdGeneralSetSync(const TDesC& aSectName ,  const TInt& datOpcode )
+   {
+   MAnimGeneralFunctions::TAnimSync  syncmode ;
+   TPtrC	str;
+   // Get the syncmode to be set from ini file and set it as IpcArg 1. 
+   if ( !GetStringFromConfig(aSectName,KFldSyncMode ,str))
+	  {
+	  ERR_PRINTF2(KLogMissingParameter , &KFldSyncMode);
+	  SetBlockResult (EFail); 		
+	  }
+   if (str  ==  KESyncNone )
+	  syncmode = MAnimGeneralFunctions::ESyncNone ;
+   else if ( str ==  KESyncFlash)
+	  syncmode = MAnimGeneralFunctions::ESyncFlash ;
+   else if ( str == KESyncSecond)
+	  syncmode = MAnimGeneralFunctions::ESyncSecond ;
+   else if ( str == KESyncMinute)
+	  syncmode = MAnimGeneralFunctions::ESyncMinute ;
+   else if ( str == KESyncDay)
+	  syncmode = MAnimGeneralFunctions::ESyncDay ;
+   iIpcArgs.Set(0,TIpcArgs::ENothing);
+   TPckgBuf<MAnimGeneralFunctions::TAnimSync> sendPckg(syncmode);
+   iIpcArgs.Set(1, &sendPckg);
+	   
+   INFO_PRINTF1(KLogInfoCmdCommandReply3) ;
+   //Send the command to notify the server .
+   TInt result = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs );
+										 
+   //Check the result is 0(Success) or not.
+   if (result != KErrNone )  
+	  {
+	  ERR_PRINTF2(KLogErrCommandReply, result);
+	  SetBlockResult (EFail); 
+	  }			
+   else 
+	  {
+	  INFO_PRINTF1(_L("SetSync return is okay "));
+	  }						 			
+   }
+ 
+ void CT_DataAnimForMClass::DoCmdGeneralSync(const TDesC& aSectName , const TInt& datOpcode )
+   {
+   TInt  expectedsyncmode ;
+   TPtrC	str;
+   // Get the expected syncmode  from ini file. 
+   if ( !GetStringFromConfig(aSectName,KFldExpected ,str))
+	  {
+	  ERR_PRINTF2(KLogMissingParameter , &KFldExpected);
+	  SetBlockResult(EFail);		
+	  } 
+   if (str  ==  KESyncNone )
+	  expectedsyncmode = MAnimGeneralFunctions::ESyncNone ;
+   else if ( str ==  KESyncFlash)
+	  expectedsyncmode = MAnimGeneralFunctions::ESyncFlash ;
+   else if ( str == KESyncSecond)
+	  expectedsyncmode = MAnimGeneralFunctions::ESyncSecond ;
+   else if ( str == KESyncMinute)
+	  expectedsyncmode = MAnimGeneralFunctions::ESyncMinute ;
+   else if ( str == KESyncDay)
+	  expectedsyncmode = MAnimGeneralFunctions::ESyncDay ;
+	  
+   iIpcArgs.Set( 0, TIpcArgs::ENothing);
+   INFO_PRINTF1(KLogInfoCmdCommandReply3) ;
+   //Send the command to notify the server .
+   TInt result = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs );
+										 
+   //Check the command return code  . 
+   if ( result != expectedsyncmode )
+	   {
+	   ERR_PRINTF2( KLogErrCommandReply, result);	
+	   SetBlockResult(EFail); 
+	   }
+   else
+	   {
+	   INFO_PRINTF1(_L("GeneralSync invoked successfully"));	 
+	   }
+   }
+ 
+ void CT_DataAnimForMClass::DoCmdGeneralSetInterval(const TDesC& aSectName ,  const TInt& datOpcode)
+   {
+   // Get the interval from ini file and set it as IpcArg 1. 
+   TInt  interval  ;
+   if ( !GetIntFromConfig(aSectName,KFldInterval ,interval))
+	  {
+	  ERR_PRINTF2(KLogMissingParameter , &KFldInterval);
+	  SetBlockResult(EFail);		
+	  }
+   iIpcArgs.Set(0,TIpcArgs::ENothing);
+   TPckgBuf<TInt> sendPckg(interval) ;
+   iIpcArgs.Set(1, &sendPckg );		  
+   INFO_PRINTF1(KLogInfoCmdCommandReply3) ;
+   //Send the command to notify the server .
+   TInt result = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs );
+		  
+   //Check the result is 0(Success) or not.
+   if ( result != KErrNone )
+	  {
+	  ERR_PRINTF2( KLogErrCommandReply, result);	
+	  SetBlockResult(EFail); 
+	  }
+   else
+	  {
+	  INFO_PRINTF1(_L("GeneralSetInterval invoked successfully"));
+	  }
+   }	
+  
+ void CT_DataAnimForMClass::DoCmdGeneralSetNextInterval(const TDesC& aSectName , const TInt& datOpcode)
+   {
+   //Read the interval from ini file
+   TInt  interval;
+   if ( !GetIntFromConfig(aSectName,KFldInterval ,interval))
+   {
+   ERR_PRINTF2(KLogMissingParameter , &KFldInterval);
+   return;
+   } 
+   TPckgBuf<TInt> sendPckg1(interval);
+   
+   TInt  nextinterval  ;
+   _LIT( KNextInterval , "nextinterval"); 
+   //Read the next interval from ini file		
+   if ( !GetIntFromConfig(aSectName,KNextInterval ,nextinterval))
+	  {
+	  ERR_PRINTF2(KLogMissingParameter , &KNextInterval);
+	  SetBlockResult(EFail);
+	  } 
+   TPckgBuf<TInt> sendPckg2(nextinterval) ;
+   iIpcArgs.Set(0,TIpcArgs::ENothing);   
+   iIpcArgs.Set(1, &sendPckg1);
+   iIpcArgs.Set(2, &sendPckg2);
+   INFO_PRINTF1(KLogInfoCmdCommandReply3) ;
+   //Send the command to notify the server.
+   TInt result = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs );
+   
+   //Check the result is 0(Success) or not.
+   if ( result != KErrNone )
+	  {
+	  ERR_PRINTF2( KLogErrCommandReply, result);	
+	  SetBlockResult(EFail); 
+	  }
+   else
+	  {
+	  INFO_PRINTF1(_L("GeneralSetNextInterval invoked successfully"));
+	  }
+   }	
+   
+   
+ void CT_DataAnimForMClass::DoCmdGeneralSystemTime(const TDesC& aSectName , const TInt& datOpcode)
+   {
+   MAnimGeneralFunctions::TAnimSync syncmode;
+   TPtrC str;
+   _LIT(KExpected , "expected");
+   _LIT( KSyncMode , "animsync");
+   // Get the syncmode from ini file and set it as IpcArg 1.
+   if ( !GetStringFromConfig(aSectName,KSyncMode ,str))
+	   {
+	   ERR_PRINTF2(KLogMissingParameter , &KSyncMode);
+	   SetBlockResult(EFail);
+	   }
+   if (str == KESyncNone )
+	   syncmode = MAnimGeneralFunctions::ESyncNone;
+   else if ( str == KESyncFlash)
+	   syncmode = MAnimGeneralFunctions::ESyncFlash;
+   else if ( str == KESyncSecond)
+	   syncmode = MAnimGeneralFunctions::ESyncSecond;
+   else if ( str == KESyncMinute)
+	   syncmode = MAnimGeneralFunctions::ESyncMinute;
+   else if ( str == KESyncDay)
+	   syncmode = MAnimGeneralFunctions::ESyncDay;
+   iIpcArgs.Set(0,TIpcArgs::ENothing);
+   TPckgBuf<MAnimGeneralFunctions::TAnimSync> sendPckg(syncmode);
+   iIpcArgs.Set(1, &sendPckg);
+   INFO_PRINTF1(KLogInfoCmdCommandReply3);
+   TInt result = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs );
+   TBool expected;
+   if ( !GetBoolFromConfig(aSectName,KExpected ,expected))
+	   {
+	   ERR_PRINTF2(KLogMissingParameter , &KExpected);
+	   return;
+	   }
+   if(result != static_cast<TInt>(expected))
+	   {
+	   ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expected, result);
+	   SetBlockResult (EFail);
+	   }
+   else
+	   {
+	   INFO_PRINTF1(_L("GeneralSystemTime invoked is okay."));
+	   }
+   }	 
+   
+void CT_DataAnimForMClass::DoCmdGeneralRegisterForNotis(const TDesC& aSectName , const TInt& datOpcode)
+   {
+   TInt notifications;
+   TEventCode expectedCode;
+   // Get the notifications value from ini file and set it as IpcArg 1. 
+   if ( !GetIntFromConfig(aSectName,KFldNotifications ,notifications))
+	  {
+	  ERR_PRINTF2(KLogMissingParameter, &KFldNotifications);
+	  SetBlockResult(EFail);
+	  }
+	
+   if(!CT_GraphicsUtil::ReadEventCode(*this, aSectName, KFldExpected, expectedCode))
+	  {
+	  ERR_PRINTF2(KLogMissingParameter , &KFldExpected);
+	  return;
+	  }
+	
+   TPckgBuf<TInt> sendPckg(notifications);
+   TPckgBuf<TEventCode> sendPckg2(expectedCode);
+   iIpcArgs.Set(0, TIpcArgs::ENothing );
+   iIpcArgs.Set(1, &sendPckg );
+   iIpcArgs.Set(2, &sendPckg2);
+	
+   INFO_PRINTF1(KLogInfoCmdCommandReply3);
+   //Send the command to notify the server .
+   TInt result = iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs);
+	
+   //Check the result is 0(Success) or not.
+   if ( result != KErrNone )
+	  {
+	  ERR_PRINTF2( KLogErrCommandReply, result);
+	  SetBlockResult(EFail);
+	  }
+   else
+	  {
+	  INFO_PRINTF1(_L("RegisterForNotis invoked successfully"));
+	  }
+   }	 
+   
+   
+void CT_DataAnimForMClass::DoCmdGeneralMessage(const TDesC& aSectName ,const TInt& datOpcode)
+   {
+   TPtrC	str , expectedStr;
+   TBuf<100>  returnStr;
+   // Get the  sending message  value from ini file and set it as IpcArg 1. 
+   if ( !GetStringFromConfig(aSectName,KFldMessage ,str))
+ 	   {
+ 	   ERR_PRINTF2(KLogMissingParameter , &KFldMessage);
+ 	   SetBlockResult(EFail);	
+ 	   } 
+   // Get the  expected message  value from ini file .     
+   if ( !GetStringFromConfig(aSectName,KFldExpected ,expectedStr))
+ 	   {
+ 	   ERR_PRINTF2(KLogMissingParameter , &KFldExpected);
+ 	   SetBlockResult(EFail);		
+ 	   } 
+   iIpcArgs.Set(0, TIpcArgs::ENothing );
+   iIpcArgs.Set(1, &str);
+   iIpcArgs.Set(2, &returnStr);
+	    
+   INFO_PRINTF1(KLogInfoCmdCommandReply3);
+   //Send the command to notify the server .
+   TInt result = iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs);
+	  
+   if(expectedStr.Compare(returnStr)) 
+	   {
+	   ERR_PRINTF3(_L("The returned value is not as expected, expected: %S, actual: %S"), &expectedStr, &returnStr);
+	   SetBlockResult (EFail);
+	   }
+   else 
+	   {
+	   INFO_PRINTF1(_L("GeneralMessage invoked successfully"));
+	   }
+   ResetIpcArg();
+   }	
+ 	 
+  
+void CT_DataAnimForMClass::DoCmdGeneralDuplicateBitmapL(const TDesC& aSectName , const TInt& datOpcode)
+   {
+   TPtrC str ;
+   TInt bmHandle;
+   CFbsBitmap* bmp;
+   // Get the object name of CFbsBitmap from ini file.
+   if ( !GetStringFromConfig(aSectName,KFldHandleBitmap,str))
+		{
+	 	//giving a non-existed value to take the nagative case.
+	 	bmHandle = 9999; 
+	 	} 
+   else
+		{
+		bmp =  static_cast<CFbsBitmap*>(GetDataObjectL(str));
+		bmHandle = bmp->Handle();	
+		}
+	 		    
+   iIpcArgs.Set(0, TIpcArgs::ENothing );
+   TPckgBuf<TInt> sendPckg(bmHandle);
+   iIpcArgs.Set(1, &sendPckg ); 
+   //Send the command to notify the server 	    
+   INFO_PRINTF1(KLogInfoCmdCommandReply3);
+   iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs);
+	 
+   //Print info
+   _LIT(KSuccess,"GeneralDuplicateBitmapL invoked successfully");   
+   INFO_PRINTF1(KSuccess);	
+   ResetIpcArg();
+   }	
+ 	 
+ 	 
+void CT_DataAnimForMClass::DoCmdGeneralDuplicateFontL(const TDesC& aSectName ,  const TInt& datOpcode)
+   {
+   TPtrC str;
+   TInt fntHandle;
+   CFbsFont* fnt;
+   TInt typeId;
+   // Get the object name of CFbsFont from ini file.
+   if ( !GetStringFromConfig(aSectName,KFldHandleFont,str))
+	   {
+	   //giving a non-existed value to take the nagative case.
+	   fntHandle = 9999;
+	   }
+   else
+	   {
+	   fnt = static_cast<CFbsFont*>(GetDataObjectL(str));
+	   typeId = fnt->TypeUid().iUid; //this is the expected value.
+	   fntHandle = fnt->Handle();
+	   }
+   TInt result = 0;
+   TPckgBuf<TInt> sendPckg(fntHandle);
+   TPckgBuf<TInt> getPckg(result);
+
+   iIpcArgs.Set(0, TIpcArgs::ENothing );
+   iIpcArgs.Set(1, &sendPckg);
+   iIpcArgs.Set(2, &getPckg);
+   INFO_PRINTF1(KLogInfoCmdCommandReply3);
+   //Send the command to notify the server .
+   iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs);
+   result = getPckg();
+	
+   //Check the result 
+   if(result == typeId)
+	   {
+	   INFO_PRINTF1(_L("GeneralDuplicateFontL invoked successfully"));
+	   }
+   else
+	   {
+	   ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), typeId, result);
+	   SetError(KErrNoMemory);
+	   }
+   ResetIpcArg();
+   }		 
+  
+  
+void CT_DataAnimForMClass::DoCmdGeneralCloseFontL(const TDesC& aSectName , const TInt& datOpcode)
+   {
+   TPtrC str ;
+   // Get the object name of CFbsFont from ini file.
+   if ( !GetStringFromConfig(aSectName,KFldHandleFont,str))
+	   {
+	   ERR_PRINTF2(KLogMissingParameter , &KFldHandleFont);
+	   SetBlockResult(EFail);		
+	   } 
+   CFbsFont* fnt =  static_cast<CFbsFont*>(GetDataObjectL(str));
+   TInt typeId = fnt->TypeUid().iUid; //this is the expected value .
+   TInt fntHandle = fnt->Handle();
+   TInt result = 0;
+   TPckgBuf<TInt> sendPckg(fntHandle); 
+   TPckgBuf<TInt> getPckg(result);
+		  
+   iIpcArgs.Set(0, TIpcArgs::ENothing );
+   iIpcArgs.Set(1, &sendPckg ); 
+   iIpcArgs.Set(2, &getPckg);
+   INFO_PRINTF1(KLogInfoCmdCommandReply3);
+   iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs);
+   result = getPckg();
+   if(result == typeId)
+	   {
+	   _LIT(KSuccess,"GeneralDuplicateFontL invoked successfully");   
+	   INFO_PRINTF1(KSuccess);
+	   }
+   else
+	   {
+	   ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), typeId, result);
+	   SetBlockResult (EFail);
+	   }
+   ResetIpcArg();
+   } 
+
+void CT_DataAnimForMClass::DoCmdGeneralReplyBuf8(const TDesC& aSectName, const TInt& datOpcode)
+   {
+   TPtrC str2;
+
+	 if ( !GetStringFromConfig(aSectName,KFldSetReplyBufHandle1,str2))
+	 	 {
+	 	 ERR_PRINTF2(KLogMissingParameter , &KFldSetReplyBufHandle1);
+	 	 SetBlockResult(EFail);		
+	 	 } 
+	 TBuf8<100> slot2;
+	 slot2.Append(str2);
+	 
+	 TPtrC str3;
+
+	 if ( !GetStringFromConfig(aSectName,KFldSetReplyBufHandle2,str3))
+	 	 {
+	 	 ERR_PRINTF2(KLogMissingParameter , &KFldSetReplyBufHandle2);
+	     return ;				
+	 	 } 
+	 TBuf8<100> slot3;
+	 slot3.Append(str3);
+	 
+	 TBuf8<100> result;
+	 	  
+	 iIpcArgs.Set(0, TIpcArgs::ENothing );
+	 iIpcArgs.Set(1, &result); 
+	 iIpcArgs.Set(2, &slot2);
+	 iIpcArgs.Set(3, &slot3);
+	 INFO_PRINTF1(KLogInfoCmdCommandReply3);
+	 iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs);
+	 
+	 if(!result.Compare(slot3) && result.Compare(slot2))
+		 {
+		 _LIT(KSuccess,"GeneralDuplicateFontL invoked successfully");   
+		 INFO_PRINTF1(KSuccess);
+		 }
+	 else
+		 {
+		 ERR_PRINTF2(_L("The returned value is not as expected, result: %S"), &result);
+		 SetBlockResult (EFail);
+		 }
+	 ResetIpcArg();
+	}
+
+void CT_DataAnimForMClass::DoCmdGeneralReplyBuf16(const TDesC& aSectName, const TInt& datOpcode)
+	{
+	TPtrC str2;
+
+	if ( !GetStringFromConfig(aSectName,KFldSetReplyBufHandle1,str2))
+		 {
+	 	 ERR_PRINTF2(KLogMissingParameter , &KFldSetReplyBufHandle1);
+	 	 SetBlockResult(EFail);			
+	 	 } 
+	TBuf16<100> slot2(str2);
+	 
+	TPtrC str3;
+
+	if ( !GetStringFromConfig(aSectName,KFldSetReplyBufHandle2,str3))
+		 {
+	 	 ERR_PRINTF2(KLogMissingParameter , &KFldSetReplyBufHandle2);
+	     return ;				
+	 	 } 
+	TBuf16<100> slot3(str3);
+	 
+	TBuf16<100> result;
+	 	  
+	iIpcArgs.Set(0, TIpcArgs::ENothing );
+	iIpcArgs.Set(1, &result); 
+	iIpcArgs.Set(2, &slot2);
+	iIpcArgs.Set(3, &slot3);
+	INFO_PRINTF1(KLogInfoCmdCommandReply3);
+	iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs);
+	 
+	if(!result.Compare(slot3) && result.Compare(slot2))
+		{
+		_LIT(KSuccess,"GeneralDuplicateFontL invoked successfully");   
+		INFO_PRINTF1(KSuccess);
+		}
+	else
+		{
+		ERR_PRINTF2(_L("The returned value is not as expected, result: %S"), &result);
+		SetBlockResult (EFail);
+		}
+	ResetIpcArg();
+	}
+//-------------------------------------------------The MAnimSpriteFunctions ----------------------------------------
+void CT_DataAnimForMClass::DoCmdSpriteGetSpriteMember(const TDesC& aSectName , const TInt& datOpcode)
+	{
+	TInt memberindex ;
+    // Get the sprite member index from ini file and set it as IpcArg 1 .
+	if ( !GetIntFromConfig(aSectName,KFldMemberIndex ,memberindex))
+		{
+		ERR_PRINTF2(KLogMissingParameter , &KFldMemberIndex);
+		SetBlockResult(EFail);	
+		} 
+	iIpcArgs.Set(0, TIpcArgs::ENothing);
+	TPckgBuf<TInt> pckg(memberindex);
+	TPckgBuf<TPoint> returnPckg;
+	iIpcArgs.Set(1,&pckg);
+	iIpcArgs.Set(2,&returnPckg);
+	
+	// Send the command to notify the server .
+	INFO_PRINTF1(KLogInfoCmdCommandReply3);
+	iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs);
+		  
+    TPoint result=returnPckg();
+	// Verify the result and the expected .
+    TPtrC		spritename;
+    TPoint  expectedPoint;
+    // Get the expected point value from ini file.
+    if ( !GetPointFromConfig(aSectName, KFldExpectedPoint, expectedPoint))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldExpectedPoint);
+		return;
+		}
+    
+	if ( result !=  expectedPoint)
+	    { 	   
+        ERR_PRINTF3(_L("The returned value is not as expected, expected.x: %d, expect.y: %d"), expectedPoint.iX , expectedPoint.iY);        
+	    ERR_PRINTF3(_L("The returned value is not as expected, result.x: %d, result.y: %d"), result.iX , result.iY); 
+        SetBlockResult (EFail);
+	    }  
+	else 
+	    { 
+	    INFO_PRINTF1(_L("Get Sprite Member successfully"));
+	    } 
+	ResetIpcArg();
+    } 
+
+void CT_DataAnimForMClass::DoCmdSpriteUpdateMember(const TDesC& aSectName , const TInt& datOpcode)
+	{ 
+    TInt memberindex ;
+	TRect rect ;
+	TBool isfullupdate ;
+    //Get the sprite member index from ini file and set it as IpcArg 1.  
+	if ( ! GetIntFromConfig(aSectName,KFldMemberIndex ,memberindex))
+		 {
+		 ERR_PRINTF2(KLogMissingParameter , &KFldMemberIndex);
+		 SetBlockResult(EFail);		
+		 }
+    //Get the  rect value from ini file and set it as IpcArg 2.  
+	if ( ! GetRectFromConfig(aSectName,KFldRect ,rect))
+		 {
+		 ERR_PRINTF2(KLogMissingParameter , &KFldRect);
+		 SetBlockResult(EFail);			
+		 }
+    //Get the  isfullupdate flag from ini file and set it as IpcArg 3.  
+	if ( ! GetBoolFromConfig(aSectName,KFldIsFullUpdate ,isfullupdate))
+		 {
+		 ERR_PRINTF2(KLogMissingParameter , &KFldIsFullUpdate);
+		 SetBlockResult(EFail);		
+		 }
+	
+	TPckgBuf<TInt> memberPckg(memberindex);
+	TPckgBuf<TRect> rectPckg(rect);
+	TPckgBuf<TBool> updatePckg(isfullupdate);
+	
+	
+	iIpcArgs.Set(0, TIpcArgs::ENothing);
+	iIpcArgs.Set(1, &memberPckg);
+	iIpcArgs.Set(2, &rectPckg);
+	iIpcArgs.Set(3, &updatePckg);
+		    
+	INFO_PRINTF1(KLogInfoCmdCommandReply3);
+    //Send the command to notify the server .
+	TInt result = iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs);
+		  
+	//Check the result is 0(Success) or not.
+	if (result != KErrNone )  
+		{
+		ERR_PRINTF2(KLogErrCommandReply, result);
+		SetBlockResult (EFail); 
+		}			
+	else 
+		{
+		INFO_PRINTF1(_L("UpdateSpriteMember return is okay "));
+		}
+	}
+   
+
+void CT_DataAnimForMClass::DoCmdSpriteActivate(const TDesC& aSectName , const TInt& datOpcode)
+	{
+	TBool isactive;
+	// Get the isactive flag from ini file and set as IpcArg 1. 
+	if ( !GetBoolFromConfig(aSectName,KFldIsActivate ,isactive))
+		{
+		ERR_PRINTF2(KLogMissingParameter , &KFldIsActivate);
+		SetBlockResult(EFail);		
+		}
+	TPckgBuf<TBool> sendPkg(isactive) ;	  
+	iIpcArgs.Set(0, TIpcArgs::ENothing);
+	iIpcArgs.Set(1,&sendPkg);
+		    
+	INFO_PRINTF1(KLogInfoCmdCommandReply3);
+    //Send the command to notify the server .
+	TInt result = iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs);
+		  
+	//Check the result is 0(Success) or not.
+	if (result != KErrNone )  
+	    {
+		ERR_PRINTF2(KLogErrCommandReply, result);
+		SetBlockResult (EFail); 
+		}			
+	else 
+		{
+		INFO_PRINTF1(_L("SpriteActive return is okay "));
+		}
+	}
+   
+void CT_DataAnimForMClass::DoCmdSpriteSpriteCanBeSeen(const TDesC& aSectName , const TInt& datOpcode)
+	{
+	TBool expected;
+	// Get the expected boolean value from the ini file.
+	if ( !GetBoolFromConfig(aSectName, KFldExpected, expected))
+		 {
+		 ERR_PRINTF2(KLogMissingParameter , &KFldExpected);
+		 SetBlockResult(EFail);			
+		 } 
+	TPckgBuf<TBool> resultPkg(EFalse) ;
+		  
+		  
+	iIpcArgs.Set(0, TIpcArgs::ENothing);
+	iIpcArgs.Set(1,&resultPkg);
+		    
+	INFO_PRINTF1(KLogInfoCmdCommandReply3);
+	//Send the command to notify the server .
+	iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs);
+		  
+	//Verify the result and the expected 
+	TBool result = resultPkg() ; 
+		  
+	if ( result != expected )
+	  {
+	  ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expected, (TInt)result);
+      SetBlockResult (EFail);
+	  }
+	else 
+	  {
+	  INFO_PRINTF1(_L("SpriteCanBeSeen return is okay "));
+	  }
+	ResetIpcArg();
+	}
+
+void CT_DataAnimForMClass::DoCmdSpriteSizeChangedL(const TDesC& /*aSectName*/ ,  const TInt& datOpcode)
+	{
+	//Send the command to notify the server .
+	iIpcArgs.Set(0, TIpcArgs::ENothing);
+		  
+	INFO_PRINTF1(KLogInfoCmdCommandReply3);
+	TInt result = iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs);
+	
+	//Check the result is 0(Success) or not.
+	if (result != KErrNone )  
+	    {
+		ERR_PRINTF2(KLogErrCommandReply, result);
+		SetBlockResult (EFail); 
+		}			
+	else 
+		{
+		INFO_PRINTF1(_L("SpriteSizeChangedL return is okay"));
+		}	
+	}
+   
+void CT_DataAnimForMClass::DoCmdSpriteSetPosition(const TDesC& aSectName ,  const TInt& datOpcode)
+	{
+    // Get the point value from ini file and set as IpcArg 1. 
+	TPoint point ;
+	if ( !GetPointFromConfig(aSectName, KFldPointPosition, point))
+		 {
+		 ERR_PRINTF2(KLogMissingParameter , &KFldPointPosition);
+		 SetBlockResult(EFail);
+		 }
+	TPckgBuf<TPoint> pkg(point) ;
+	iIpcArgs.Set(0, TIpcArgs::ENothing);
+	iIpcArgs.Set(1, &pkg) ;  
+	INFO_PRINTF1(KLogInfoCmdCommandReply3);
+    //Send the command to notify the server .
+	TInt result = iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs);
+		  
+	//Check the result is 0(Success) or not.
+	if (result != KErrNone )  
+	    {
+		ERR_PRINTF2(KLogErrCommandReply, result);
+		SetBlockResult (EFail); 
+		}			
+	else 
+		{
+		INFO_PRINTF1(_L("SpriteSetPosition return is okay"));
+		}
+	}      
+
+void CT_DataAnimForMClass::DoCmdEatupMemory(const TInt& datOpcode)
+	{
+	TInt result = iAnim->CommandReply(datOpcode);
+	if (result != KErrNone )  
+		{
+		ERR_PRINTF2(KLogErrCommandReply, result);
+		SetBlockResult (EFail); 
+		}			
+	else 
+		{
+		INFO_PRINTF1(_L("EatupMemory return is okay"));
+		}
+	}
+
+void CT_DataAnimForMClass::DoCmdFreeEatenMemory(const TInt& datOpcode)
+	{
+	TInt result = iAnim->CommandReply(datOpcode);
+	if (result != KErrNone )  
+		{
+		ERR_PRINTF2(KLogErrCommandReply, result);
+		SetBlockResult (EFail); 
+		}			
+	else 
+		{
+		INFO_PRINTF1(_L("FreeEatenMemory return is okay"));
+		}
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataBackedUpWindow.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,288 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataBackedUpWindow.h"
+#include "T_GraphicsUtil.h"
+
+/*@{*/
+_LIT(KDataClassname,	"RBackedUpWindow");
+
+//Commands
+_LIT(KCmdnew,						"new");
+_LIT(KCmdDestructor,				"~");
+_LIT(KCmdConstruct,					"Construct");
+_LIT(KCmdBitmapHandle,				"BitmapHandle");
+_LIT(KCmdUpdateScreen,				"UpdateScreen");
+_LIT(KCmdUpdateBackupBitmap,		"UpdateBackupBitmap");
+_LIT(KCmdMaintainBackup,			"MaintainBackup");
+
+// Fields
+_LIT(KFldDisplayMode,				"displaymode");
+_LIT(KFldHandle,					"handle");
+_LIT(KFldParent,					"parent");
+_LIT(KFldRegion,					"region");
+_LIT(KFldWs,						"ws");
+
+///	Logging
+_LIT(KLogError,						"Error=%d");
+_LIT(KLogMissingParameter,			"Missing parameter '%S'");
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataBackedUpWindow* CT_DataBackedUpWindow::NewL()
+	{
+	CT_DataBackedUpWindow*	ret=new (ELeave) CT_DataBackedUpWindow();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+CT_DataBackedUpWindow::CT_DataBackedUpWindow()
+:	CT_DataDrawableWindow()
+,	iBackedUpWindow(NULL)
+	{
+	}
+
+void CT_DataBackedUpWindow::ConstructL()
+	{
+	}
+
+CT_DataBackedUpWindow::~CT_DataBackedUpWindow()
+	{
+	DestroyData();
+	}
+
+void CT_DataBackedUpWindow::SetObjectL(TAny* aAny)
+	{
+	DestroyData();
+	iBackedUpWindow = static_cast<RBackedUpWindow*> (aAny);
+	}
+
+void CT_DataBackedUpWindow::DestroyData()
+	{
+	delete iBackedUpWindow;
+	iBackedUpWindow=NULL;
+	}
+
+void CT_DataBackedUpWindow::DisownObjectL()
+	{
+	iBackedUpWindow = NULL;
+	}
+
+RDrawableWindow* CT_DataBackedUpWindow::GetDrawableWindow() const
+	{
+	return iBackedUpWindow;
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataBackedUpWindow::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	ret = ETrue;
+
+	if ( aCommand==KCmdDestructor )
+		{
+		DestroyData();
+		}
+	else if ( aCommand==KCmdnew || aCommand==KDataClassname )
+		{
+		DoCmdnewL(aSection);
+		}
+	else if ( aCommand==KCmdConstruct )
+		{
+		DoCmdConstructL(aSection);
+		}
+	else if ( aCommand==KCmdBitmapHandle )
+		{
+		DoCmdBitmapHandle();
+		}
+	else if ( aCommand==KCmdUpdateScreen )
+		{
+		DoCmdUpdateScreenL(aSection);
+		}
+	else if ( aCommand==KCmdUpdateBackupBitmap )
+		{
+		DoCmdUpdateBackupBitmap();
+		}
+	else if ( aCommand==KCmdMaintainBackup )
+		{
+		DoCmdMaintainBackup();
+		}
+	else
+		{
+		ret=CT_DataDrawableWindow::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+
+	return ret;
+	}
+
+
+void CT_DataBackedUpWindow::DoCmdnewL(const TDesC& aSection)
+	{
+	DestroyData();
+
+	// Get test data for command input parameter(s)
+	TPtrC	wsName;
+	RWsSession* ws=NULL;
+	if ( GetStringFromConfig(aSection, KFldWs, wsName) )
+		{
+		ws = static_cast<RWsSession*>(GetDataObjectL(wsName));
+		}
+
+	TInt	err=KErrNone;
+	if ( ws!=NULL )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute new RBackedUpWindow(RWsSession)"));
+		TRAP( err, iBackedUpWindow = new (ELeave) RBackedUpWindow(*ws));
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute new RBackedUpWindow()"));
+		TRAP( err, iBackedUpWindow = new (ELeave) RBackedUpWindow());
+		}
+
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+
+void CT_DataBackedUpWindow::DoCmdConstructL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TPtrC	parentName;
+	RWindowTreeNode*	parent=NULL;
+	if ( GetStringFromConfig(aSection, KFldParent, parentName) )
+		{
+		parent = static_cast<RWindowTreeNode*>(GetDataObjectL(parentName));
+		}
+	if ( parent==NULL )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldParent);
+		SetBlockResult(EFail);
+		}
+
+	TDisplayMode	datDisplayMode;
+	if ( !CT_GraphicsUtil::ReadDisplayMode(*this, aSection, KFldDisplayMode, datDisplayMode) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldDisplayMode);
+		SetBlockResult(EFail);
+		}
+
+	TInt	datHandle;
+	if ( !GetIntFromConfig(aSection, KFldHandle, datHandle) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldHandle);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+	{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute Construct(RWindowTreeNode, TDisplayMode, TUint32)"));
+		TInt	returnCode = iBackedUpWindow->Construct(*parent, datDisplayMode, datHandle);
+
+		// Check the command return code, if !=KErrNone then stop this command
+		if ( returnCode!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, returnCode);
+			SetError(returnCode);
+			}
+
+		// No command output parameter to display and check
+		}
+	}
+
+
+void CT_DataBackedUpWindow::DoCmdBitmapHandle()
+	{
+	// Execute command and log parameters
+	TInt	handle=iBackedUpWindow->BitmapHandle();
+	INFO_PRINTF2(_L("BitmapHandle() %d"), handle);
+	SetHandle(handle);
+	}
+
+
+void CT_DataBackedUpWindow::DoCmdUpdateScreenL(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	RRegion	region(1);
+	CleanupClosePushL(region);
+
+	if ( GetRegionFromConfig(aSection, KFldRegion, region) )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute UpdateScreen(TRegion)"));
+		iBackedUpWindow->UpdateScreen(region);
+
+		// No command return value and output parameter to display and check
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute UpdateScreen()"));
+		iBackedUpWindow->UpdateScreen();
+
+		// No command return value and output parameter to display and check
+		}
+
+	CleanupStack::PopAndDestroy(&region);
+	}
+
+
+void CT_DataBackedUpWindow::DoCmdUpdateBackupBitmap()
+	{
+	// No command input parameter to process
+
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute UpdateBackupBitmap()"));
+	iBackedUpWindow->UpdateBackupBitmap();
+
+	// No command return value and output parameter to display and check
+	}
+
+
+void CT_DataBackedUpWindow::DoCmdMaintainBackup()
+	{
+	// No command input parameter to process
+
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute MaintainBackup()"));
+	iBackedUpWindow->MaintainBackup();
+
+	// No command return value and output parameter to display and check
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataBlankWindow.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,284 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataBlankWindow.h"
+
+/*@{*/
+_LIT(KDataClassname,	"RBlankWindow");
+
+//Commands
+_LIT(KCmdnew,						"new");
+_LIT(KCmdDestructor,				"~");
+_LIT(KCmdConstruct,					"Construct");
+_LIT(KCmdSetColor,					"SetColor");
+_LIT(KCmdSetSize,					"SetSize");
+_LIT(KCmdSetExtent,					"SetExtent");
+
+// Fields
+_LIT(KFldColor,						"color");
+_LIT(KFldHandle,					"handle");
+_LIT(KFldParent,					"parent");
+_LIT(KFldPoint,						"point");
+_LIT(KFldSize,						"size");
+_LIT(KFldWs,						"ws");
+
+///	Logging
+_LIT(KLogError,						"Error=%d");
+_LIT(KLogMissingParameter,			"Missing parameter '%S'");
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataBlankWindow* CT_DataBlankWindow::NewL()
+	{
+	CT_DataBlankWindow*	ret=new (ELeave) CT_DataBlankWindow();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+CT_DataBlankWindow::CT_DataBlankWindow()
+:	CT_DataWindowBase()
+,	iBlankWindow(NULL)
+	{
+	}
+
+void CT_DataBlankWindow::ConstructL()
+	{
+	}
+
+CT_DataBlankWindow::~CT_DataBlankWindow()
+	{
+	DestroyData();
+	}
+
+void CT_DataBlankWindow::SetObjectL(TAny* aAny)
+	{
+	DestroyData();
+	iBlankWindow = static_cast<RBlankWindow*> (aAny);
+	}
+
+void CT_DataBlankWindow::DisownObjectL()
+	{
+	iBlankWindow = NULL;
+	}
+
+void CT_DataBlankWindow::DestroyData()
+	{
+	delete iBlankWindow;
+	iBlankWindow=NULL;
+	}
+
+RWindowBase* CT_DataBlankWindow::GetWindowBase() const
+	{
+	return iBlankWindow;
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataBlankWindow::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	ret = ETrue;
+
+	if ( aCommand==KCmdDestructor )
+		{
+		DestroyData();
+		}
+	else if ( aCommand==KCmdnew || aCommand==KDataClassname )
+		{
+		DoCmdnewL(aSection);
+		}
+	else if ( aCommand==KCmdConstruct )
+		{
+		DoCmdConstructL(aSection);
+		}
+	else if ( aCommand==KCmdSetColor )
+		{
+		DoCmdSetColor(aSection);
+		}
+	else if ( aCommand==KCmdSetSize )
+		{
+		DoCmdSetSize(aSection);
+		}
+	else if ( aCommand==KCmdSetExtent )
+		{
+		DoCmdSetExtent(aSection);
+		}
+	else
+		{
+		ret=CT_DataWindowBase::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+
+	return ret;
+	}
+
+
+void CT_DataBlankWindow::DoCmdnewL(const TDesC& aSection)
+	{
+	DestroyData();
+
+	// Get test data for command input parameter(s)
+	TPtrC	wsName;
+	RWsSession* ws=NULL;
+	if ( GetStringFromConfig(aSection, KFldWs, wsName) )
+		{
+		ws = static_cast<RWsSession*>(GetDataObjectL(wsName));
+		}
+
+	TInt	err;
+	if ( ws != NULL )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute new RBlankWindow(RWsSession)"));
+		TRAP( err,	iBlankWindow = new (ELeave) RBlankWindow(*ws) );
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute new RBlankWindow()"));
+		TRAP( err,	iBlankWindow = new (ELeave) RBlankWindow() );
+		}
+
+	if ( err != KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+
+	// No command output parameter to display and check
+	}
+
+
+void CT_DataBlankWindow::DoCmdConstructL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TPtrC	parentName;
+	RWindowTreeNode*	parent=NULL;
+	if ( GetStringFromConfig(aSection, KFldParent, parentName) )
+		{
+		parent = static_cast<RWindowTreeNode*>(GetDataObjectL(parentName));
+		}
+	if ( parent==NULL )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldParent);
+		SetBlockResult(EFail);
+		}
+
+	TInt	datHandle;
+	if ( !GetIntFromConfig(aSection, KFldHandle, datHandle) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldHandle);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute Construct(RWindowTreeNode, TUint32)"));
+		TInt	returnCode = iBlankWindow->Construct(*parent, datHandle);
+
+		// Check the command return code, if !=KErrNone then stop this command
+		if ( returnCode != KErrNone )
+			{
+			ERR_PRINTF2(KLogError, returnCode);
+			SetError(returnCode);
+			}
+
+		// No command output parameter to display and check
+		}
+	}
+
+
+void CT_DataBlankWindow::DoCmdSetColor(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TRgb	datColor;
+	if ( GetRgbFromConfig(aSection, KFldColor, datColor) )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetColor(TRgb)"));
+		iBlankWindow->SetColor(datColor);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetColor()"));
+		iBlankWindow->SetColor();
+		}
+	}
+
+
+void CT_DataBlankWindow::DoCmdSetSize(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TSize	datSize;
+	if ( !GetSizeFromConfig(aSection, KFldSize, datSize) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldSize);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetSize(TSize)"));
+		iBlankWindow->SetSize(datSize);
+		}
+	}
+
+
+void CT_DataBlankWindow::DoCmdSetExtent(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TPoint	datPoint;
+	if ( !GetPointFromConfig(aSection, KFldPoint, datPoint) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldPoint);
+		SetBlockResult(EFail);
+		}
+
+	TSize	datSize;
+	if ( !GetSizeFromConfig(aSection, KFldSize, datSize) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldSize);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetExtent(TPoint, TSize)"));
+		iBlankWindow->SetExtent(datPoint, datSize);
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataDirectScreenAccess.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,439 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include <apgtask.h>
+#include "T_GraphicsUtil.h"
+#include "T_DataDirectScreenAccess.h"
+#include "T_DataFbsScreenDevice.h"
+#include "T_DataFbsBitGc.h"
+
+_LIT(KDataClassname,				"CDirectScreenAccess");
+_LIT(KCmdDestructor,				"~CDirectScreenAccess");
+_LIT(KCmdDestructorGeneral,			"~");
+
+//command
+_LIT( KCmdNewL, "NewL" );
+_LIT( KCmdStart, "StartL" );
+_LIT( KCmdGc, "Gc" );
+_LIT( KCmdScreenDevice, "ScreenDevice" );
+_LIT( KCmdDrawRegion, "DrawingRegion" );
+_LIT( KCmdSetPriority, "SetPriority" );
+_LIT( KCmdBringAppFg, "Util_BringAppFg" );
+
+// Fields
+_LIT( KRWsSessionObj, "ws");
+_LIT( KCWsScreenDeviceObj, "scrdev");
+_LIT( KRWindowObj, "win");
+_LIT( KAppName, "app");
+_LIT( KPriorityObj, "Priority");
+_LIT( KFldGc, "gc");
+_LIT( KFldScreenDevice, "ScreenDevice");
+_LIT( KFldDrawRegion, "region1");
+_LIT( KWantedReasonObj, "reason");
+
+//Error
+_LIT( KErrNewL, "Create CDirectScreenAccess object failed.");
+_LIT( KErrGc, "Execute CDirectScreenAccess::Gc failed. return value is NULL");
+_LIT( KErrScreenDevice, "Execute CDirectScreenAccess::ScreenDevices failed. return value is NULL");
+_LIT( KErrDrawRegion, "Execute CDirectScreenAccess::DrawRegion failed. return value is NULL");
+_LIT( KErrDrawRegionSetting, "Set DrawRegion failed.");
+_LIT( KErrAbortNowReason, "the AbortNow's reason do not match the expected value.");
+_LIT( KErrRestartReason, "the Restart's reason do not match the expected value.");
+_LIT( KLogMissingParameter, "Missing parameter '%S'");
+_LIT( KLogMissingWrapper,"Missing Wrapper class '%S'");
+
+//info
+_LIT( KInfoNewL, "NewL() has been called.");
+_LIT( KInfoStartL, "StartL() has been called");
+_LIT( KInfoGc, "Gc() has been called" );
+_LIT( KInfoScreenDevice, "ScreenDevice() has been called" );
+_LIT( KInfoDrawRegion, "DrawingRegion() has been called" );
+_LIT( KInfoSetPriority, "SetPriority() has been called" );
+_LIT( KInfoAbortNow, "AbortNow has been called, with the reason=%d");
+_LIT( KInfoRestart, "Restart has been called, with the reason=%d");
+_LIT( KInfoDestructor, "execute ~CDirectScreenAccess()");
+
+const RDirectScreenAccess::TTerminationReasons KDefaultReason = RDirectScreenAccess::ETerminateRegion; 
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+/**
+ * Protected constructor. First phase construction
+ */
+CT_DataDirectScreenAccess::CT_DataDirectScreenAccess() :
+	iDirectScreenAccess(NULL),
+	iWantedReason(KDefaultReason)
+	{
+	}
+/**
+ * Public destructor
+ */
+CT_DataDirectScreenAccess::~CT_DataDirectScreenAccess()
+	{
+	DestroyData();
+	}
+
+/**
+ * Two phase constructor
+ */
+CT_DataDirectScreenAccess* CT_DataDirectScreenAccess::NewL()
+	{
+	CT_DataDirectScreenAccess* self = new (ELeave) CT_DataDirectScreenAccess();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+/**
+ * Second phase construction
+ */
+void CT_DataDirectScreenAccess::ConstructL()
+	{
+	//nothing to do here.
+	}
+
+/**
+ * Set the object that the data wraps
+ *
+ * @param    aObject object that the wrapper is testing
+ *
+ */
+void CT_DataDirectScreenAccess::SetObjectL(TAny* aAny)
+	{
+	DestroyData();
+	iDirectScreenAccess = static_cast<CDirectScreenAccess*> (aAny);
+	}
+
+/**
+ * The object will no longer be owned by this
+ *
+ * @leave	KErrNotSupported if the the function is not supported
+ */
+void CT_DataDirectScreenAccess::DisownObjectL()
+	{
+	iDirectScreenAccess = NULL;
+	}
+
+void CT_DataDirectScreenAccess::DestroyData()
+	{
+	delete iDirectScreenAccess;
+	iDirectScreenAccess = NULL;
+	}
+
+/**
+ * Process a command read from the ini file
+ *
+ * @param aCommand			the command to process
+ * @param aSection			the entry in the ini file requiring the command to be processed
+ * @param aAsyncErrorIndex	index of command. used for async calls
+ *
+ * @return ETrue if the command is processed
+ */
+TBool CT_DataDirectScreenAccess::DoCommandL(const TTEFFunction& aCommand,
+		const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool result = ETrue;
+	
+	if ( !aCommand.Compare( KCmdNewL ) || !aCommand.Compare( KDataClassname ) )
+		{
+        DoCmdnewL(aSection);
+        }
+    else if ( !aCommand.Compare(KCmdDestructor) || !aCommand.Compare(KCmdDestructorGeneral ) )
+		{
+		DoCmdDestructor();
+		}
+    else if ( !aCommand.Compare( KCmdStart ) )
+        {
+        DoCmdStartL(aSection);
+        }
+    else if ( !aCommand.Compare( KCmdGc ) )
+        {
+        DoCmdGcL(aSection);
+        }
+    else if ( !aCommand.Compare( KCmdScreenDevice ) )
+        {
+        DoCmdScreenDeviceL(aSection);
+        }
+    else if ( !aCommand.Compare( KCmdDrawRegion ) )
+        {
+        DoCmdDrawRegion(aSection);
+        }
+    else if ( !aCommand.Compare( KCmdSetPriority ) )
+        {
+        DoCmdSetPriority(aSection);
+        }
+    else if ( !aCommand.Compare( KCmdBringAppFg ) )
+        {
+        DoCmdBringAppFgL(aSection);
+        }
+    else
+        {
+        CDataWrapperActive::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+        }
+    
+    return result;
+	}
+
+/**
+ * test AbortNow()
+ */
+void CT_DataDirectScreenAccess::AbortNow(RDirectScreenAccess::TTerminationReasons aReason)
+	{
+	INFO_PRINTF2(KInfoAbortNow , aReason);
+	DecOutstanding();
+	if( iWantedReason != aReason )
+		{
+		ERR_PRINTF1(KErrAbortNowReason);
+		SetBlockResult(EFail);	
+		}
+	
+	}
+
+/**
+ * Test Restart()
+ */
+void CT_DataDirectScreenAccess::Restart(RDirectScreenAccess::TTerminationReasons aReason)
+	{
+	INFO_PRINTF2(KInfoRestart , aReason);
+	DecOutstanding();
+	if( iWantedReason != aReason )
+		{
+		ERR_PRINTF1(KErrRestartReason);
+		SetBlockResult(EFail);	
+		}
+	
+	}
+
+/**
+ * Helper method to get RWsSession
+ */
+RWsSession* CT_DataDirectScreenAccess::GetRWSessionL(const TDesC& aSection)
+	{
+	RWsSession* iClient( NULL ); //Window Session Client
+	TPtrC objectName;
+	
+	if ( GetStringFromConfig(aSection, KRWsSessionObj(), objectName) )
+		{
+		iClient = static_cast<RWsSession*>(GetDataObjectL(objectName));
+		}
+	
+	return iClient;
+	}
+
+/**
+ * Helper method to get CWsScreenDevice
+ */
+CWsScreenDevice* CT_DataDirectScreenAccess::GetDevicesL(const TDesC& aSection)
+	{	
+	CWsScreenDevice*	device = NULL;
+	
+	if ( !CT_GraphicsUtil::GetWsScreenDeviceL(*this, aSection, KCWsScreenDeviceObj, device) )
+		{
+		ERR_PRINTF2(KLogMissingParameter , &KCWsScreenDeviceObj);
+		SetBlockResult(EFail);
+		}
+	
+	return device;
+	}
+
+
+/**
+ * Helper method to get RWindow
+ */
+RWindow* CT_DataDirectScreenAccess::GetWindowL(const TDesC& aSection)
+	{
+	RWindow* window( NULL );
+	TPtrC objectName;
+	
+	if( GetStringFromConfig(aSection, KRWindowObj, objectName))
+		{
+		window = static_cast<RWindow*>(GetDataObjectL(objectName));		
+		}
+
+	return window;
+
+	}
+
+
+/**
+* Test NewL()
+*/
+void CT_DataDirectScreenAccess::DoCmdnewL(const TDesC& aSection)
+	{
+	// Execute command and log parameters
+	DestroyData();
+	INFO_PRINTF1(KInfoNewL);
+	iDirectScreenAccess = CDirectScreenAccess::NewL(*GetRWSessionL(aSection),
+			*GetDevicesL(aSection), *GetWindowL(aSection), *this );
+	
+	if(!iDirectScreenAccess)
+		{
+		ERR_PRINTF1(KErrNewL);
+		SetBlockResult(EFail);
+		}
+	
+	}
+
+/**
+* Test Destructor()
+*/
+void CT_DataDirectScreenAccess::DoCmdDestructor()
+	{
+	INFO_PRINTF1(KInfoDestructor);
+	delete iDirectScreenAccess;
+	iDirectScreenAccess = NULL;
+	}
+
+/**
+* Test StartL()
+*/
+void CT_DataDirectScreenAccess::DoCmdStartL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(KInfoStartL);
+	if ( !CT_GraphicsUtil::ReadTerminateReason(*this , aSection , KWantedReasonObj, iWantedReason) )
+		{
+		ERR_PRINTF2(KLogMissingParameter , &KWantedReasonObj);
+		SetBlockResult(EFail);
+		}
+	
+	iDirectScreenAccess->StartL();
+	IncOutstanding();
+	}
+
+/**
+* Test Gc()
+*/
+void CT_DataDirectScreenAccess::DoCmdGcL(const TDesC& aSection)
+	{
+	// Execute command and log parameters
+	INFO_PRINTF1(KInfoGc);
+	
+	TPtrC aGcName;
+	if(GetStringFromConfig(aSection, KFldGc, aGcName) )
+		{
+		CFbsBitGc* iGc = iDirectScreenAccess->Gc();
+		if(!iGc)
+			{
+			INFO_PRINTF1(KErrGc);
+			SetError(KErrNotFound);
+			}
+		else
+			{
+			SetDataObjectL(aGcName , iGc);
+			}
+		}
+	else
+		{
+		ERR_PRINTF2(KLogMissingParameter , &KFldGc);
+		}
+	
+	}
+
+/**
+* Test ScreenDevice()
+*/
+void CT_DataDirectScreenAccess::DoCmdScreenDeviceL(const TDesC& aSection)
+	{
+	// Execute command and log parameters
+	INFO_PRINTF1(KInfoScreenDevice);
+	TPtrC aScreenDeviceName;
+	if(GetStringFromConfig(aSection, KFldScreenDevice, aScreenDeviceName))
+		{
+		CFbsScreenDevice* aScreenDevice = iDirectScreenAccess->ScreenDevice();
+		if(!aScreenDevice)
+			{
+			ERR_PRINTF1(KErrScreenDevice);
+			SetError(KErrNotFound);
+			}
+		else
+			{
+			SetDataObjectL(aScreenDeviceName , aScreenDevice);
+			}
+		
+		}
+	else
+		{
+		ERR_PRINTF2(KLogMissingParameter , &KFldScreenDevice);
+		}
+	
+	}
+
+/**
+* Test DrawRegion()
+*/
+void CT_DataDirectScreenAccess::DoCmdDrawRegion(const TDesC& aSection)
+	{
+	// Execute command and log parameters
+	INFO_PRINTF1(KInfoDrawRegion);
+	TRegion* region;
+	region = iDirectScreenAccess->DrawingRegion();
+	
+	if(!region)
+		{
+		ERR_PRINTF1(KErrDrawRegion);
+		SetError(KErrNotFound);
+		}
+	// Compare the region.
+	// read the exepected region size 
+	TRect temp;
+	if( GetRectFromConfig(aSection ,KFldDrawRegion, temp ))
+		{
+		//compare the region
+		TRect temp2 = (*region)[0];
+		
+		if(temp != temp2)
+			{
+			ERR_PRINTF1(KErrDrawRegionSetting);
+			SetBlockResult(EFail);
+			}
+		}
+	
+	}
+
+/**
+* Test AbortNow() and Restart() by SetPriority()
+*/
+void CT_DataDirectScreenAccess::DoCmdSetPriority(const TDesC& aSection)
+	{
+	INFO_PRINTF1(KInfoSetPriority);
+	CActive::TPriority priority;
+	IncOutstanding();
+	if ( !CT_GraphicsUtil::ReadPriority(*this , aSection , KPriorityObj, priority) )
+		{
+		ERR_PRINTF2(KLogMissingParameter , &KPriorityObj);
+		SetBlockResult(EFail);
+		}
+	iDirectScreenAccess->SetPriority(priority);
+	}
+
+/**
+* Test AbortNow() and Restart() by bring a app to foreground
+*/
+void CT_DataDirectScreenAccess::DoCmdBringAppFgL(const TDesC& aSection)
+	{
+	// Execute command and log parameters
+	TPtrC sessionKeyName(KRWsSessionObj);
+	TPtrC appKeyName(KAppName);
+	IncOutstanding();
+	if ( !CT_GraphicsUtil::BringAppForegroundL(*this , aSection , sessionKeyName, appKeyName) )
+		{
+		ERR_PRINTF2(KLogMissingParameter , &sessionKeyName);
+		SetBlockResult(EFail);
+		}
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataDrawableWindow.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,155 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataDrawableWindow.h"
+
+/*@{*/
+//Commands
+_LIT(KCmdScroll,					"Scroll");
+_LIT(KCmdGetDrawRect,				"GetDrawRect");
+
+// Fields
+_LIT(KFldClipRect,					"cliprect");
+_LIT(KFldOffset,					"offset");
+_LIT(KFldRect,						"rect");
+_LIT(KFldExpected,					"expected");
+
+///	Logging
+_LIT(KLogMissingParameter,			"Missing parameter '%S'");
+_LIT(KLogMissingExpectedValue,		"Missing expected value '%S'");
+_LIT(KLogNotAsExpectedValue,		"'%S' is not as expected value");
+
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataDrawableWindow::CT_DataDrawableWindow()
+:	CT_DataWindowBase()
+	{
+	}
+
+RWindowBase* CT_DataDrawableWindow::GetWindowBase() const
+	{
+	return GetDrawableWindow();
+	}
+
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataDrawableWindow::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	ret = ETrue;
+
+	if ( aCommand==KCmdScroll )
+		{
+		DoCmdScroll(aSection);
+		}
+	else if ( aCommand==KCmdGetDrawRect )
+		{
+		DoCmdGetDrawRect(aSection);
+		}
+	else
+		{
+		ret=CT_DataWindowBase::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+
+	return ret;
+	}
+
+
+void CT_DataDrawableWindow::DoCmdScroll(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TPoint	datOffset;
+
+	if ( !GetPointFromConfig(aSection, KFldOffset, datOffset) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldOffset);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		TRect	datRect;
+		TBool	hasRect = GetRectFromConfig(aSection, KFldRect, datRect);
+
+		TRect	datClipRect;
+
+		// Execute command and log parameters
+		if ( GetRectFromConfig(aSection, KFldClipRect,	datClipRect) )
+			{
+			if ( hasRect )
+				{
+				INFO_PRINTF1(_L("execute Scroll(TRect, TPoint, TRect)"));
+				GetDrawableWindow()->Scroll(datClipRect, datOffset, datRect);
+				}
+			else
+				{
+				INFO_PRINTF1(_L("execute Scroll(TRect, TPoint)"));
+				GetDrawableWindow()->Scroll(datClipRect, datOffset);
+				}
+			}
+		else
+			{
+			if ( hasRect )
+				{
+				INFO_PRINTF1(_L("execute Scroll(TPoint, TRect)"));
+				GetDrawableWindow()->Scroll(datOffset, datRect);
+				}
+			else
+				{
+				INFO_PRINTF1(_L("execute Scroll(TPoint)"));
+				GetDrawableWindow()->Scroll(datOffset);
+				}
+			}
+
+		// No command return value and output parameter to display and check
+		}
+	}
+
+
+void CT_DataDrawableWindow::DoCmdGetDrawRect(const TDesC& aSection)
+	{
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute GetDrawRect()"));
+	TRect	actual=GetDrawableWindow()->GetDrawRect();
+	LogRect(_L("GetDrawableWindow()"), actual);
+
+	// Diaplay command return value, check if it matches the expected value
+	TRect	expected;
+	if ( !GetRectFromConfig(aSection, KFldExpected, expected) )
+		{
+		ERR_PRINTF2(KLogMissingExpectedValue, &KFldExpected);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if ( actual!=expected )
+			{
+			ERR_PRINTF2(KLogNotAsExpectedValue, &KFldExpected);
+			SetBlockResult(EFail);
+			}
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataDsaSession.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,342 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_GraphicsUtil.h"
+#include "T_DataDsaSession.h"
+
+_LIT(KDataClassname,	"RDirectScreenAccess");
+//command
+_LIT( KCmdnewL, "new" );
+_LIT( KCmdConstruct, "Construct" );
+_LIT( KCmdClose, "Close" );
+_LIT( KCmdRequest, "Request" );
+_LIT( KCmdCompleted, "Completed" );
+_LIT( KCmdCancel, "Cancel" );
+_LIT( KCmdEatupMemory, "Util_EatupMemory" );
+_LIT( KCmdFreeEatenMemory, "Util_FreeEatenMemory" );
+// Fields
+_LIT( KRWsSessionObj, "ws");
+_LIT( KRWindowObj, "win");
+_LIT( KFldRegion, "region1");
+_LIT( KFldMemLeft, "memleft");
+
+//Error
+_LIT( KErrNewL, "Create RDirectScreenAccess() failed.");
+_LIT( KErrRequestRegionMatch, "Execute RDirectScreenAccess::Request() failed, Error: region size not match.");
+_LIT( KLogMissingParameter, "Missing parameter '%S'");
+_LIT( KLogError, "Error=%d");
+_LIT( KStraySignal, "Stray signal");
+
+//Info
+_LIT( KRdsaNew1, "RDSA::new() has been called");
+_LIT( KRdsaNew2, "RDSA::new(session) has been called");
+_LIT( KInfoConstruct, "Construct() has been called" );
+_LIT( KInfoClose, "Close() has been called" );
+_LIT( KInfoRequest, "Request() has been called" );
+_LIT( KInfoCompleted, "Completed() has been called" );
+_LIT( KInfoCancel, "Cancel() has been called" );
+_LIT( KRunRequestReady, "RunRequestReady %d");
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+CT_DataDsaSession::CT_DataDsaSession() : 
+	iDsaSession(NULL),
+	iActiveRequestReady(NULL)
+	{
+	}
+
+void CT_DataDsaSession::ConstructL()
+	{
+	iActiveRequestReady = CActiveCallback::NewL(*this);
+	}
+
+CT_DataDsaSession::~CT_DataDsaSession()
+	{
+	this->DestroyData();
+	}
+
+CT_DataDsaSession* CT_DataDsaSession::NewL()
+	{
+	CT_DataDsaSession* self = new (ELeave) CT_DataDsaSession();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+void CT_DataDsaSession::SetObjectL(TAny* aAny)
+	{
+	this->DestroyData();
+	iDsaSession = static_cast<RDirectScreenAccess*>(aAny);
+	}
+
+void CT_DataDsaSession::DisownObjectL()
+	{
+	iDsaSession = NULL;
+	}
+
+void CT_DataDsaSession::DestroyData()
+	{
+	delete iDsaSession;
+	iDsaSession = NULL;
+	delete iActiveRequestReady;
+	iActiveRequestReady = NULL;
+	}
+
+MWsClientClass* CT_DataDsaSession::GetClientClass() const
+	{
+	return iDsaSession;
+	}
+
+/**
+ * Process a command read from the ini file
+ *
+ * @param aCommand			the command to process
+ * @param aSection			the entry in the ini file requiring the command to be processed
+ * @param aAsyncErrorIndex	index of command. used for async calls
+ *
+ * @return ETrue if the command is processed
+ */
+TBool CT_DataDsaSession::DoCommandL(const TTEFFunction& aCommand, const
+			TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool result( ETrue );
+	INFO_PRINTF1(aCommand);
+	
+	if ( !aCommand.Compare( KCmdnewL ) || !aCommand.Compare( KDataClassname ) )
+        {
+    	DoCmdnewL(aSection);
+        }
+	else if ( !aCommand.Compare( KCmdConstruct ) )
+        {
+        DoCmdConstruct();
+        }
+	else if ( !aCommand.Compare( KCmdClose ) )
+        {
+        DoCmdClose();
+        }
+	else if ( !aCommand.Compare( KCmdRequest) )
+        {
+        DoCmdRequestL(aSection , aAsyncErrorIndex);
+        }
+	else if ( !aCommand.Compare( KCmdCompleted ) )
+        {
+        DoCmdCompleted();
+        }
+	else if ( !aCommand.Compare( KCmdCancel ) )
+        {
+        DoCmdCancel();
+        }    
+    else if ( !aCommand.Compare(KCmdEatupMemory))
+    	{
+    	DoCmdEatupMemory(aSection);
+    	}
+    else if (!aCommand.Compare(KCmdFreeEatenMemory))
+    	{
+    	DoCmdFreeEatenMemory();
+    	}
+    else
+        {
+        result = EFalse;
+        }
+	
+    return result;
+	}
+
+/**
+ * Helper method to get RWsSession
+ */
+RWsSession* CT_DataDsaSession::GetRWSessionL(const TDesC& aSection)
+	{
+	RWsSession* iClient = NULL; //Window Session Client
+	TPtrC objectName;
+	
+	if ( GetStringFromConfig(aSection, KRWsSessionObj(), objectName) )
+		{
+		iClient = static_cast<RWsSession*>(GetDataObjectL(objectName));
+		}
+	
+	return iClient;
+	}
+
+/**
+ * Test NewL();
+ */
+void CT_DataDsaSession::DoCmdnewL(const TDesC& aSection)
+	{
+	RWsSession* session = GetRWSessionL(aSection);
+	
+	if(!session)
+		{
+		//no parameter.
+		iDsaSession = new (ELeave) RDirectScreenAccess();
+		INFO_PRINTF1(KRdsaNew1);
+		}
+	else
+		{
+		//with parameter
+		iDsaSession = new (ELeave) RDirectScreenAccess(*session);
+		INFO_PRINTF1(KRdsaNew2);
+		}
+
+	if(!iDsaSession)
+		{
+		ERR_PRINTF1(KErrNewL);
+		SetBlockResult(EFail);
+		}
+	
+	}
+
+
+/**
+ * Test ConstructL();
+ */
+void CT_DataDsaSession::DoCmdConstruct()
+	{
+	INFO_PRINTF1(KInfoConstruct);
+	TInt result = iDsaSession->Construct();
+	
+	if(result)
+		{
+		ERR_PRINTF2(KLogError, result);
+		SetBlockResult(EFail);
+		}
+	
+	}
+
+
+/**
+ * Test Close();
+ */
+void CT_DataDsaSession::DoCmdClose()
+	{
+	INFO_PRINTF1(KInfoClose);
+	iDsaSession->Close();
+	}
+
+
+/**
+ * Test RequestL();
+ */
+void CT_DataDsaSession::DoCmdRequestL(const TDesC& aSection, const TInt aAsyncErrorIndex)
+	{
+	INFO_PRINTF1(KInfoRequest);
+	RWindowBase* iWindow = NULL;
+	TPtrC objectName;
+	
+	if ( GetStringFromConfig(aSection, KRWindowObj(), objectName))
+		{
+		iWindow = static_cast<RWindowBase*> (GetDataObjectL(objectName));
+		}
+	
+	if(!iWindow)
+		{
+		ERR_PRINTF2(KLogMissingParameter , &KRWindowObj);
+		SetBlockResult(EFail);
+		}
+	
+	RRegion* aRegion = NULL;
+	
+	TInt result = iDsaSession->Request(aRegion, iActiveRequestReady->iStatus, *iWindow);
+	if(result)
+		{
+ 		ERR_PRINTF2(KLogError, result);
+		SetError(result);
+		}
+    else
+        {    	
+    	TRect temp;
+    	if( GetRectFromConfig(aSection ,KFldRegion, temp ) && aRegion->Count())
+    		{
+    		//compare the region
+    		TRect temp2 = (*aRegion)[0];
+    		if(temp != temp2)
+    			{
+    			ERR_PRINTF1(KErrRequestRegionMatch);
+    			SetBlockResult(EFail);
+    			}
+    		
+    		}
+    	
+        iActiveRequestReady->Activate(aAsyncErrorIndex);
+        IncOutstanding();		
+    	}
+
+	}
+
+/**
+ * Test Completed();
+ */
+void CT_DataDsaSession::DoCmdCompleted()
+	{
+	INFO_PRINTF1(KInfoCompleted);
+	iDsaSession->Completed();
+	}
+
+/**
+ * Test Cancel();
+ */
+void CT_DataDsaSession::DoCmdCancel()
+	{
+	INFO_PRINTF1(KInfoCancel);
+	iDsaSession->Cancel();
+	}
+
+void CT_DataDsaSession::DoCmdEatupMemory(const TDesC& aSection)
+	{
+	CT_GraphicsUtil::EatupMemory(*this,aSection,KFldMemLeft);
+	}
+void CT_DataDsaSession::DoCmdFreeEatenMemory()
+	{
+	CT_GraphicsUtil::FreeEatenMemory(*this);
+	}
+
+void CT_DataDsaSession::RunL(CActive* aActive, TInt aIndex)
+	{
+	if ( iActiveRequestReady == aActive )
+		{
+		RunRequestReady(aIndex);
+		}
+	else
+		{
+		ERR_PRINTF1(KStraySignal);
+		SetBlockResult(EFail);
+		}
+	
+	}
+
+void CT_DataDsaSession::RunRequestReady( const TInt aIndex)
+	{
+	DecOutstanding();
+	TInt err = iActiveRequestReady->iStatus.Int();
+	INFO_PRINTF2(KRunRequestReady, err);
+	
+	if ( KErrNone != err )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetAsyncError(aIndex, err);
+		}
+	
+	}
+
+void CT_DataDsaSession::DoCancel(CActive* /*aActive*/, TInt /*aIndex*/)
+	{
+	//nothing.
+	}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataFrame.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,349 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_GraphicsUtil.h"
+#include "T_DataFrame.h"
+#include <fbs.h>
+
+/*@{*/
+//Commands
+_LIT(KCmdNew,							    "NewL");
+_LIT(KCmdDestroy,						    "~");
+_LIT(KCmdFrameInfo,						    "FrameInfo");
+_LIT(KCmdSetFrameInfo,					    "SetFrameInfo");
+_LIT(KCmdBitmap,						    "Bitmap");
+_LIT(KCmdSetBitmap,						    "SetBitmap");
+_LIT(KCmdMask,						        "Mask");
+_LIT(KCmdSetMask,						    "SetMask");
+// Fields
+_LIT(KFldFrameInfo,						    "frameinfostate");
+_LIT(KFldTFrame,						    "frame%d");
+_LIT(KFldUid,                               "uid");
+_LIT(KFldTWsGraphicId,					    "graphicid");
+_LIT(KFldSecureId,                          "secureid");
+_LIT(KFldSetMask,                           "setmask");
+_LIT(KFldSetFrameInfo,                      "setframeinfo");
+_LIT(KFldSetBitmap,                         "setbitmap");
+_LIT(KFldMask,                              "expected_mask");
+_LIT(KFldBitmap,                            "expected_bitmap");
+_LIT(KFldGotMask,                           "got_mask");
+_LIT(KFldGotBitmap,                         "got_bitmap");
+///	Logging
+_LIT(KLogError,								"Error=%d");
+_LIT(KLogMissingParameter,					"Missing parameter '%S'");
+_LIT(KLogNotExpectedValue,					"Not expected value");
+
+_LIT(KLogNew,                               "execute CT_DataFrame::NewL()");
+_LIT(KLogFrameInfo,                         "execute CT_DataFrame::FrameInfo()");
+_LIT(KLogSetFrameInfo,                      "execute CT_DataFrame::SetFrameInfo(const TFrameInfo &aFrameInfo)");
+_LIT(KLogBitmap,                            "execute CT_DataFrame::Bitmap()");
+_LIT(KLogSetBitmap,                         "execute CT_DataFrame::SetBitmap(CFbsBitmap *aBitmap)");
+_LIT(KLogMask,                              "execute CT_DataFrame::Mask()");
+_LIT(KLogSetMask,                           "execute CT_DataFrame::SetMask(CFbsBitmap *aMask)");
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataFrame::CT_DataFrame()
+:	CDataWrapperBase(),iFrame(NULL)
+	{
+	}
+
+CT_DataFrame* CT_DataFrame::NewL()
+	{
+	CT_DataFrame* ret=new (ELeave) CT_DataFrame();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+void CT_DataFrame::ConstructL()
+	{
+	}
+
+CT_DataFrame::~CT_DataFrame()
+	{
+	DoCmdDestroy();
+	}
+
+/**
+ * Called by TEF framework to set object.
+ *
+ * @param: None
+ *
+ * @return: None
+ */
+void CT_DataFrame::SetObjectL(TAny* aAny)
+	{
+	DoCmdDestroy();
+	iFrame = static_cast<CWsGraphicBitmapAnimation::CFrame*> (aAny);
+	}
+
+/**
+ * Called by TEF framework to disown the object.
+ *
+ * @param: None
+ *
+ * @return: None
+ */
+void CT_DataFrame::DisownObjectL()
+	{
+	iFrame = NULL;
+	}
+
+/**
+ * Destroy the object which has been constructed.
+ *
+ * @param: None
+ *
+ * @return: None
+ */
+void CT_DataFrame::DoCmdDestroy()
+	{
+	delete iFrame;
+	iFrame = NULL;
+	}
+	
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataFrame::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool ret = ETrue;
+
+	if ( aCommand==KCmdNew )
+		{
+		DoCmdNewL();
+		}
+	else if ( aCommand==KCmdDestroy )
+		{
+		DoCmdDestroy();
+		}
+	else if ( aCommand==KCmdFrameInfo )
+		{
+		DoCmdFrameInfo(aSection);
+		}
+    else if ( aCommand==KCmdSetFrameInfo )
+		{
+		DoCmdSetFrameInfo(aSection);
+		}
+    else if ( aCommand==KCmdBitmap )
+		{
+		DoCmdBitmapL(aSection);
+		}
+    else if ( aCommand==KCmdSetBitmap )
+		{
+		DoCmdSetBitmapL(aSection);
+		}
+    else if ( aCommand==KCmdMask )
+		{
+		DoCmdMaskL(aSection);
+		}
+    else if ( aCommand==KCmdSetMask )
+		{
+		DoCmdSetMaskL(aSection);
+		}
+	else
+		{
+		ret=EFalse;
+		}
+
+	return ret;
+	}
+
+/**
+ * Process new command
+ *
+ * @return: None
+ */
+void CT_DataFrame::DoCmdNewL()
+	{
+    // Execute command and log parameters
+    INFO_PRINTF1(KLogNew);
+    TInt err=KErrNone;
+    TRAP( err, iFrame=CWsGraphicBitmapAnimation::CFrame::NewL());
+
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	// No command return value and output parameter to display and check
+	}
+
+/**
+ * Process FrameInfo command
+ * 
+ * @param aSection			the entry in the ini file requiring the command to be processed
+ * 
+ * @return: None
+ */
+void CT_DataFrame::DoCmdFrameInfo(const TDesC& aSection)
+	{
+	INFO_PRINTF1(KLogFrameInfo);
+    TFrameInfo frameinfo = iFrame->FrameInfo();
+    
+    // Get test data for command input parameter(s)
+	TFrameInfo expected;
+	if ( CT_GraphicsUtil::GetFrameInfo(*this, aSection, expected) )
+		{
+		if( frameinfo.iFlags!= expected.iFlags)		
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+   			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/**
+ * Process SetFrameInfo command
+ * 
+ * @param aSection			the entry in the ini file requiring the command to be processed 
+ * 
+ * @return: None
+ */
+void CT_DataFrame::DoCmdSetFrameInfo(const TDesC& aSection)
+	{
+    TFrameInfo frameinfo;
+    
+    if ( CT_GraphicsUtil::GetFrameInfo(*this,aSection, frameinfo) )
+        {
+        INFO_PRINTF1(KLogSetFrameInfo);
+        iFrame->SetFrameInfo(frameinfo);
+        }
+    else
+        {
+        ERR_PRINTF2(KLogMissingParameter,KFldSetFrameInfo);
+        SetBlockResult(EFail);
+        }        
+	}
+
+/**
+ * Process Bitmap command
+ *
+ * @param aSection			the entry in the ini file requiring the command to be processed
+ *
+ * @return: None
+*/
+ void CT_DataFrame::DoCmdBitmapL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(KLogBitmap);
+    CFbsBitmap* bitmap=const_cast<CFbsBitmap*>(iFrame->Bitmap());
+        
+    TPtrC gotBitmap;
+    if(GetStringFromConfig(aSection,KFldGotBitmap,gotBitmap))
+    	{
+    	SetDataObjectL(gotBitmap,bitmap);
+    	}
+    
+    // Get test data for command input parameter(s)
+	CFbsBitmap*	expected=NULL;
+	if ( CT_GraphicsUtil::GetFbsBitmapL(*this,aSection, KFldBitmap, expected) )
+        {
+        if ( bitmap!=expected )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}  
+        }
+	}
+    
+/**
+ * Process SetBitmap command
+ *
+ * @param aSection			the entry in the ini file requiring the command to be processed
+ *
+ * @return: None
+*/
+ void CT_DataFrame::DoCmdSetBitmapL(const TDesC& aSection)
+	{
+    CFbsBitmap*  bitmap=NULL;
+    
+    if ( CT_GraphicsUtil::GetFbsBitmapL(*this,aSection, KFldSetBitmap, bitmap) )
+        {
+        INFO_PRINTF1(KLogSetBitmap);
+        iFrame->SetBitmap(bitmap);
+        }
+    else
+        {
+        ERR_PRINTF2(KLogMissingParameter,KFldSetBitmap);
+        SetBlockResult(EFail);
+        }
+	}
+
+/**
+ * Process Mask command
+ *
+ * @param aSection			the entry in the ini file requiring the command to be processed
+ *
+ * @return: None
+*/
+ void CT_DataFrame::DoCmdMaskL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(KLogMask);
+    CFbsBitmap* mask=const_cast<CFbsBitmap*>(iFrame->Mask());
+    
+    TPtrC gotMask;
+    if(GetStringFromConfig(aSection,KFldGotMask,gotMask))
+    	{
+    	SetDataObjectL(gotMask,mask);
+    	}
+    
+    // Get test data for command input parameter(s)
+	CFbsBitmap*	expected=NULL;
+	if ( CT_GraphicsUtil::GetFbsBitmapL(*this,aSection, KFldMask, expected) )
+        {
+        if ( mask!=expected )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}  
+        }
+	}
+    
+/**
+ * Process SetMask command
+ *
+ * @param aSection			the entry in the ini file requiring the command to be processed
+ *
+ * @return: None
+*/
+ void CT_DataFrame::DoCmdSetMaskL(const TDesC& aSection)
+	{
+    CFbsBitmap*  bitmap=NULL;
+    
+    if ( CT_GraphicsUtil::GetFbsBitmapL(*this,aSection, KFldSetMask, bitmap) )
+        {
+        INFO_PRINTF1(KLogSetMask);
+        iFrame->SetMask(bitmap);
+        }
+    else
+        {
+        ERR_PRINTF2(KLogMissingParameter,KFldSetMask);
+        SetBlockResult(EFail);
+        }
+	}
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataSoundPlugIn.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,474 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+@test
+@internalComponent
+
+This contains CT_DataSoundPlugIn
+*/
+
+#include "T_DataSoundPlugIn.h"
+
+/*@{*/
+///	Parameters
+_LIT(KExpectedBool,							"expected_bool");
+_LIT(KEnabled,								"enabled");
+_LIT(KPlugInFileName,						"filename");
+_LIT(KOpcode,                               "opcode");
+_LIT(KPackagedArgs,                         "args");
+_LIT(KUid,                                  "uid");
+_LIT(KChangableBool, 						"isChangeable");
+
+/// Commands
+_LIT(KCmdNew,								"new");
+_LIT(KCmdConstruct,							"Construct");
+_LIT(KCmdClose,								"Close");
+_LIT(KCmdDestroy,							"Destroy");
+_LIT(KCmdIsLoaded,							"IsLoaded");
+_LIT(KCmdUnload,							"Unload");
+_LIT(KCmdLoad,								"Load");
+_LIT(KCmdSetKeyClick,						"SetKeyClick");
+_LIT(KCmdKeyClickEnabled,					"KeyClickEnabled");
+_LIT(KCmdSetPenClick,						"SetPenClick");
+_LIT(KCmdPenClickEnabled,					"PenClickEnabled");
+_LIT(KCmdCommandReply,						"CommandReply");
+
+// Fields
+_LIT(KFldWs,								"ws");
+
+// Log
+_LIT(KLogMissingParameter, 					"Missing parameter '%S'");
+
+/*@}*/
+
+/**
+* Two phase constructor
+*/
+CT_DataSoundPlugIn* CT_DataSoundPlugIn::NewL()
+	{
+	CT_DataSoundPlugIn*	ret = new (ELeave) CT_DataSoundPlugIn();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+/**
+* Protected constructor. First phase construction
+*/
+CT_DataSoundPlugIn::CT_DataSoundPlugIn()
+:	iSoundPlugIn(NULL)
+	{
+	}
+
+/**
+* Second phase construction
+*/
+void CT_DataSoundPlugIn::ConstructL()
+	{
+	}
+
+/**
+* Protected destructor.
+*/
+CT_DataSoundPlugIn::~CT_DataSoundPlugIn()
+	{
+	Cleanup();
+	}
+
+void CT_DataSoundPlugIn::Cleanup()
+	{
+	delete iSoundPlugIn;
+	iSoundPlugIn = NULL;
+	}
+/**
+ * Return a pointer to the object that the data wraps. Not implemented, returns NULL.
+ *
+ * @return pointer to the object that the data wraps. Not implemented, returns NULL.
+ */
+ TAny* CT_DataSoundPlugIn::GetObject()
+ 	{
+ 	return NULL;
+ 	}
+ 
+ MWsClientClass* CT_DataSoundPlugIn::GetClientClass() const
+ 	{
+ 	return iSoundPlugIn;
+ 	}
+ 
+/**
+* Process a command read from the ini file
+*
+* @param aDataWrapper	test step requiring command to be processed
+* @param aCommand	the command to process
+* @param aSection		the entry in the ini file requiring the command to be processed
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataSoundPlugIn::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool	retVal=ETrue;
+
+	if(aCommand == KCmdNew)
+		{
+		DoCmdNewL(aSection);
+		}
+	else if(aCommand == KCmdConstruct)
+		{
+		DoCmdConstruct(aSection);
+		}
+	else if(aCommand == KCmdClose)
+		{
+		DoCmdClose();
+		}
+	else if(aCommand == KCmdDestroy)
+		{
+		DoCmdDestroy();
+		}
+	else if(aCommand == KCmdIsLoaded)
+		{
+		DoCmdIsLoaded(aSection);
+		}
+	else if(aCommand == KCmdUnload)
+		{
+		DoCmdUnload();
+		}
+	else if(aCommand == KCmdLoad)
+		{
+		DoCmdLoad(aSection);
+		}
+	else if(aCommand == KCmdSetKeyClick)
+		{
+		DoCmdSetKeyClick(aSection);
+		}
+	else if(aCommand == KCmdKeyClickEnabled)
+		{
+		DoCmdKeyClickEnabled(aSection);
+		}
+	else if(aCommand == KCmdSetPenClick)
+		{
+		DoCmdSetPenClick(aSection);
+		}
+	else if(aCommand == KCmdPenClickEnabled)
+		{
+		DoCmdPenClickEnabled(aSection);
+		}
+	else if(aCommand == KCmdCommandReply)
+		{
+		DoCmdCommandReply(aSection);
+		}
+	else
+		{
+		retVal = EFalse;
+		}
+
+	return retVal;
+	}
+
+/** RSoundPlugIn::RSoundPlugIn() Call */
+void CT_DataSoundPlugIn::DoCmdNewL(const TDesC& aSection)
+	{
+	// Cleanup if already created
+	Cleanup();
+	
+	TPtrC wsName;
+	RWsSession* ws = NULL;
+	if(GetStringFromConfig(aSection, KFldWs, wsName))
+		{
+		ws = static_cast<RWsSession*>(GetDataObjectL(wsName));
+		}
+	
+
+	TInt err = KErrNone;
+	
+	if(ws == NULL)
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute new RSoundPlugIn()"));
+		TRAP(err, iSoundPlugIn = new (ELeave) RSoundPlugIn);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute new RSoundPlugIn(RWsSession)"));
+		TRAP(err, iSoundPlugIn = new (ELeave) RSoundPlugIn(*ws));
+		}
+	
+	// Check error code
+	if(err != KErrNone)
+		{
+		ERR_PRINTF2(_L("Error creation instance: %d"), err);
+		SetError(err);
+		}
+	}
+
+/** RSoundPlugIn::Construct() Call */
+void CT_DataSoundPlugIn::DoCmdConstruct(const TDesC& aSection)
+	{
+	TInt err = KErrNone;
+	
+	if(0 == aSection.Length())
+		{
+		INFO_PRINTF1(_L("Calls RSoundPlugIn::Construct() with TUid::Null()"));
+		
+		// Call Construct()
+		err = iSoundPlugIn->Construct();
+		}
+	else
+		{
+		INFO_PRINTF1(_L("Calls RSoundPlugIn::Construct() with a plug-in DLL's third UID"));
+		
+		// Get UID from parameters
+		TInt uid;
+		if(!GetIntFromConfig(aSection, KUid(), uid))
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KUid());
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			//Call Construct()
+			err = iSoundPlugIn->Construct(TUid::Uid(uid));
+			}
+		}
+	
+	// Check error code
+	if(err != KErrNone)
+		{
+		ERR_PRINTF2(_L("Calls Construct() error %d"), err);
+		SetError(err);
+		}
+	}
+
+
+/** RSoundPlugIn::Close() Call */
+void CT_DataSoundPlugIn::DoCmdClose()
+	{
+	INFO_PRINTF1(_L("Calls RSoundPlugIn::Close()"));
+	
+	// Call Close()
+	iSoundPlugIn->Close();
+	}
+
+/** RSoundPlugIn::Destroy() Call */
+void CT_DataSoundPlugIn::DoCmdDestroy()
+	{
+	INFO_PRINTF1(_L("Calls RSoundPlugIn::Destroy()"));
+	
+	// Call Destroy()
+	iSoundPlugIn->Destroy();
+	iSoundPlugIn = NULL;
+	}
+
+/** RSoundPlugIn::IsLoaded() Call */
+void CT_DataSoundPlugIn::DoCmdIsLoaded(const TDesC& aSection)
+	{
+	TBool actualValue,actualChangeable;
+	TBool setChangable = EFalse;
+	TBool expectedValue = EFalse;
+
+	if ( !GetBoolFromConfig(aSection, KExpectedBool(), expectedValue))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KExpectedBool());
+		SetBlockResult (EFail);
+		}		
+	else
+		{
+		actualValue = iSoundPlugIn->IsLoaded (actualChangeable);
+		INFO_PRINTF2(_L("Calls RSoundPlugIn::IsLoaded() %d"), actualValue);
+
+		if ( expectedValue != actualValue)
+			{
+			ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedValue, actualValue);
+			SetBlockResult (EFail);
+			}
+		else if (actualValue)
+			{
+			if ( !GetBoolFromConfig(aSection, KChangableBool(), setChangable))
+				{
+				ERR_PRINTF2(KLogMissingParameter, &KChangableBool());
+				SetBlockResult (EFail);
+				}
+			else
+			{
+			if (actualChangeable)
+				actualChangeable=ETrue;
+			if (actualChangeable != setChangable)
+				{
+				ERR_PRINTF3(_L("The IsChangeable is not as expected, expected: %d, actual: %d"), setChangable, actualChangeable);
+				SetBlockResult (EFail);
+				}
+			}
+			}		 
+		}
+	}
+
+/** RSoundPlugIn::Unload() Call */
+void CT_DataSoundPlugIn::DoCmdUnload()
+	{
+	INFO_PRINTF1(_L("Calls RSoundPlugIn::Unload()"));
+
+	// Call Unload to get actual return value
+	TInt err = iSoundPlugIn->Unload();
+	if(err != KErrNone)
+		{
+		ERR_PRINTF2(_L("Call Unload() error %d"), err);
+		SetError(err);
+		}
+	}
+
+/** RSoundPlugIn::Load() Call */
+void CT_DataSoundPlugIn::DoCmdLoad(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls RSoundPlugIn::Load()"));
+	
+	// Get file name from parameters
+	TPtrC fileName;
+	if(!GetStringFromConfig(aSection, KPlugInFileName(), fileName))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KPlugInFileName());
+		SetBlockResult(EFail);
+		}
+	else
+		{	
+		// Call Load()
+		TInt err = iSoundPlugIn->Load(fileName);
+		
+		// Check error code
+		if(err != KErrNone)
+			{
+			ERR_PRINTF3(_L("Load file error %d. File name: %S"), err, &fileName);
+			SetError(err);
+			}
+		}
+	}
+
+/** RSoundPlugIn::SetKeyClick() Call */
+void CT_DataSoundPlugIn::DoCmdSetKeyClick(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls RSoundPlugIn::SetKeyClick()"));
+	
+	// Get bool value from parameters
+	TBool keyClickEnabled = ETrue;
+	if(!GetBoolFromConfig(aSection, KEnabled(), keyClickEnabled))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KEnabled());
+		SetBlockResult(EFail);
+		}
+	else
+		{	
+		// Call SetKeyClick()
+		iSoundPlugIn->SetKeyClick(keyClickEnabled);
+		}
+	}
+
+/** RSoundPlugIn::KeyClickEnabled() Call */
+void CT_DataSoundPlugIn::DoCmdKeyClickEnabled(const TDesC& aSection)
+	{
+	// Call KeyClickEnabled() to get actual value
+	TBool actualValue = iSoundPlugIn->KeyClickEnabled();
+	INFO_PRINTF2(_L("Calls RSoundPlugIn::KeyClickEnabled() %d"), actualValue);
+	
+	// Get expected value from parameters
+	TBool expectedValue = EFalse;
+	if(GetBoolFromConfig(aSection, KExpectedBool(), expectedValue))
+		{
+		if(expectedValue != actualValue)
+			{
+			ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedValue, actualValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/** RSoundPlugIn::SetPenClick() Call */
+void CT_DataSoundPlugIn::DoCmdSetPenClick(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls RSoundPlugIn::SetPenClick()"));
+	
+	// Get bool value from parameters
+	TBool penClickEnabled = ETrue;
+	if(!GetBoolFromConfig(aSection, KEnabled(), penClickEnabled))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KEnabled());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Call SetPenClick()
+		iSoundPlugIn->SetPenClick(penClickEnabled);
+		}
+	}
+
+/** RSoundPlugIn::PenClickEnabled() Call */
+void CT_DataSoundPlugIn::DoCmdPenClickEnabled(const TDesC& aSection)
+	{
+	// Call PenClickEnabled() to get actual value
+	TBool actualValue = iSoundPlugIn->PenClickEnabled();
+	INFO_PRINTF2(_L("Calls RSoundPlugIn::PenClickEnabled() %d"), actualValue);
+	
+	// Get expected value from parameters
+	TBool expectedValue = EFalse;
+	if(GetBoolFromConfig(aSection, KExpectedBool(), expectedValue))
+		{
+		if(expectedValue != actualValue)
+			{
+			ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedValue, actualValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/** RSoundPlugIn::DoCmdCommandReply() Call */
+void CT_DataSoundPlugIn::DoCmdCommandReply(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls RSoundPlugIn::DoCmdCommandReply()"));
+	
+	TBool dataOK = ETrue;
+	
+	// Get Opcode from parameters
+	TInt opcode = 0;
+	if(!GetIntFromConfig(aSection, KOpcode(), opcode))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KOpcode());
+		SetBlockResult(EFail);
+		dataOK = EFalse;
+		}
+	
+	// Get packeaged args from parameters
+	TPtrC theString;
+	if(!GetStringFromConfig(aSection, KPackagedArgs(), theString))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KPackagedArgs());
+		SetBlockResult(EFail);
+		dataOK = EFalse;
+		}
+	
+	if(dataOK)
+		{
+		// Call CommandReply()
+		TInt err = iSoundPlugIn->CommandReply(opcode, TPckgC<TDesC>(theString));
+		
+		// Check error code
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(_L("CommandReply failed with error %d"), err);
+			SetError(err);
+			}
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataWindow.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,747 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataWindow.h"
+#include "T_GraphicsUtil.h"
+#include <coemain.h>
+
+/*@{*/
+_LIT(KDataClassname,	"RWindow");
+
+//Commands
+_LIT(KCmdnew,							"new");
+_LIT(KCmdDestructor,					"~");
+_LIT(KCmdConstruct,						"Construct");
+_LIT(KCmdBeginRedraw,					"BeginRedraw");
+_LIT(KCmdEndRedraw,						"EndRedraw");
+_LIT(KCmdInvalidate,					"Invalidate");
+_LIT(KCmdGetInvalidRegion,				"GetInvalidRegion");
+_LIT(KCmdSetBackgroundColor,			"SetBackgroundColor");
+_LIT(KCmdSetSize,						"SetSize");
+_LIT(KCmdSetExtent,						"SetExtent");
+_LIT(KCmdHandleTransparencyUpdate,		"HandleTransparencyUpdate");
+_LIT(KCmdSetTransparencyFactor,			"SetTransparencyFactor");
+_LIT(KCmdSetTransparencyBitmap,			"SetTransparencyBitmap");
+_LIT(KCmdSetTransparencyWsBitmap,		"SetTransparencyWsBitmap");
+_LIT(KCmdSetNonTransparent,				"SetNonTransparent");
+_LIT(KCmdEnableRedrawStore,				"EnableRedrawStore");
+_LIT(KCmdSetTransparencyAlphaChannel,	"SetTransparencyAlphaChannel");
+_LIT(KCmdSetTransparentRegion,			"SetTransparentRegion");
+_LIT(KCmdSetTransparencyPolicy,			"SetTransparencyPolicy");
+_LIT(KCmdIsRedrawStoreEnabled,			"IsRedrawStoreEnabled");
+_LIT(KCmdEnableOSB,						"EnableOSB");
+_LIT(KCmdSave,							"Save");
+
+// Fields
+_LIT(KFldColor,							"color");
+_LIT(KFldEnabled,						"enabled");
+_LIT(KFldExpected,						"expected");
+_LIT(KFldFlag,							"flag");
+_LIT(KFldHandle,						"handle");
+_LIT(KFldParent,						"parent");
+_LIT(KFldPoint,							"point");
+_LIT(KFldPolicy,						"policy");
+_LIT(KFldRect,							"rect");
+_LIT(KFldRegion,						"region");
+_LIT(KFldSize,							"size");
+_LIT(KFldTransparencyBitmap,			"transparencybitmap");
+_LIT(KFldTransparencyFactor,			"transparencyfactor");
+_LIT(KFldWs,							"ws");
+
+///	Logging
+_LIT(KLogError,							"Error=%d");
+_LIT(KLogMissingParameter,				"Missing parameter '%S'");
+_LIT(KLogMissingExpectedValue,			"Missing expected value '%S'");
+_LIT(KLogNotExpectedValueInt,			"'%S' is not as expected=%d, actual=%d");
+
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataWindow* CT_DataWindow::NewL()
+	{
+	CT_DataWindow*	ret=new (ELeave) CT_DataWindow();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+CT_DataWindow::CT_DataWindow()
+:	CT_DataDrawableWindow()
+,	iWindow(NULL)
+	{
+	}
+
+void CT_DataWindow::ConstructL()
+	{
+	}
+
+CT_DataWindow::~CT_DataWindow()
+	{
+	DestroyData();
+	}
+
+void CT_DataWindow::SetObjectL(TAny* aAny)
+	{
+	DestroyData();
+	iWindow = static_cast<RWindow*> (aAny);
+	}
+
+void CT_DataWindow::DisownObjectL()
+	{
+	iWindow = NULL;
+	}
+
+void CT_DataWindow::DestroyData()
+	{
+	delete iWindow;
+	iWindow=NULL;
+	}
+
+RDrawableWindow* CT_DataWindow::GetDrawableWindow() const
+	{
+	return iWindow;
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataWindow::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	ret = ETrue;
+
+	if ( aCommand==KCmdDestructor )
+		{
+		DestroyData();
+		}
+	else if ( aCommand==KCmdnew || aCommand==KDataClassname )
+		{
+		DoCmdnewL(aSection);
+		}
+	else if ( aCommand==KCmdConstruct )
+		{
+		DoCmdConstructL(aSection);
+		}
+	else if ( aCommand==KCmdBeginRedraw )
+		{
+		DoCmdBeginRedraw(aSection);
+		}
+	else if ( aCommand==KCmdEndRedraw )
+		{
+		DoCmdEndRedraw();
+		}
+	else if ( aCommand==KCmdInvalidate )
+		{
+		DoCmdInvalidate(aSection);
+		}
+	else if ( aCommand==KCmdGetInvalidRegion )
+		{
+		DoCmdGetInvalidRegionL(aSection);
+		}
+	else if ( aCommand==KCmdSetBackgroundColor )
+		{
+		DoCmdSetBackgroundColor(aSection);
+		}
+	else if ( aCommand==KCmdSetSize )
+		{
+		DoCmdSetSize(aSection);
+		}
+	else if ( aCommand==KCmdSetExtent )
+		{
+		DoCmdSetExtent(aSection);
+		}
+	else if ( aCommand==KCmdHandleTransparencyUpdate )
+		{
+		DoCmdHandleTransparencyUpdate();
+		}
+	else if ( aCommand==KCmdSetTransparencyFactor )
+		{
+		DoCmdSetTransparencyFactor(aSection);
+		}
+	else if ( aCommand==KCmdSetTransparencyBitmap )
+		{
+		DoCmdSetTransparencyBitmapL(aSection);
+		}
+	else if ( aCommand==KCmdSetTransparencyWsBitmap )
+		{
+		DoCmdSetTransparencyWsBitmapL(aSection);
+		}
+	else if ( aCommand==KCmdSetNonTransparent )
+		{
+		DoCmdSetNonTransparent();
+		}
+	else if ( aCommand==KCmdEnableRedrawStore )
+		{
+		DoCmdEnableRedrawStore(aSection);
+		}
+	else if ( aCommand==KCmdSetTransparencyAlphaChannel )
+		{
+		DoCmdSetTransparencyAlphaChannel();
+		}
+	else if ( aCommand==KCmdSetTransparentRegion )
+		{
+		DoCmdSetTransparentRegionL(aSection);
+		}
+	else if ( aCommand==KCmdSetTransparencyPolicy )
+		{
+		DoCmdSetTransparencyPolicy(aSection);
+		}
+	else if ( aCommand==KCmdIsRedrawStoreEnabled )
+		{
+		DoCmdIsRedrawStoreEnabled(aSection);
+		}
+	else if ( aCommand==KCmdEnableOSB )
+		{
+		DoCmdEnableOSB(aSection);
+		}
+	else if ( aCommand==KCmdSave )
+		{
+		DoCmdSave();
+		}
+	else
+		{
+		ret=CT_DataDrawableWindow::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+
+	return ret;
+	}
+
+
+void CT_DataWindow::DoCmdnewL(const TDesC& aSection)
+	{
+	DestroyData();
+
+	// Get test data for command input parameter(s)
+	TPtrC	wsName;
+	RWsSession* ws=NULL;
+	if ( GetStringFromConfig(aSection, KFldWs, wsName) )
+		{
+		ws = static_cast<RWsSession*>(GetDataObjectL(wsName));
+		}
+
+	TInt	err=KErrNone;
+	if ( ws!=NULL )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute new RWindow(RWsSession)"));
+		TRAP( err, iWindow = new (ELeave) RWindow(*ws));
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute new RWindow()"));
+		TRAP( err, iWindow = new (ELeave) RWindow());
+		}
+
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+
+void CT_DataWindow::DoCmdConstructL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TPtrC	parentName;
+	RWindowTreeNode*	parent=NULL;
+	if ( GetStringFromConfig(aSection, KFldParent, parentName) )
+		{
+		parent = static_cast<RWindowTreeNode*>(GetDataObjectL(parentName));
+		}
+	if ( parent==NULL )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldParent);
+		SetBlockResult(EFail);
+		}
+
+	TInt	datHandle;
+	if ( !GetIntFromConfig(aSection, KFldHandle, datHandle) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldHandle);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute Construct(RWindowTreeNode, TUint32)"));
+		TInt	returnCode = iWindow->Construct(*parent, datHandle);
+
+		// Check the command return code, if !=KErrNone then stop this command
+		if ( returnCode!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, returnCode);
+			SetError(returnCode);
+			}
+
+		// No command output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindow::DoCmdBeginRedraw(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TRect	datRect;
+
+	if ( GetRectFromConfig(aSection, KFldRect, datRect) )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute BeginRedraw(TRect)"));
+		iWindow->BeginRedraw(datRect);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute BeginRedraw()"));
+		iWindow->BeginRedraw();
+		}
+
+	// No command return value and output parameter to display and check
+	}
+
+
+void CT_DataWindow::DoCmdEndRedraw()
+	{
+	// No command input parameter to process
+
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute EndRedraw()"));
+	iWindow->EndRedraw();
+
+	// No command return value and output parameter to display and check
+	}
+
+
+void CT_DataWindow::DoCmdInvalidate(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TRect	datRect;
+
+	if ( GetRectFromConfig(aSection, KFldRect, datRect) )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute Invalidate(TRect)"));
+		iWindow->Invalidate(datRect);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute Invalidate()"));
+		iWindow->Invalidate();
+		}
+
+	// No command return value and output parameter to display and check
+	}
+
+
+void CT_DataWindow::DoCmdGetInvalidRegionL(const TDesC& aSection)
+	{
+	RRegion	region(1);
+	CleanupClosePushL(region);
+
+	// No command input parameter to process
+
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute GetInvalidRegion(RRegion)"));
+	iWindow->GetInvalidRegion(region);
+
+	// Diaplay command return value, check if it matches the expected value
+	LogRegion(_L("GetInvalidRegion()"), region);
+
+	RRegion	expectedRegion(1);
+	CleanupClosePushL(expectedRegion);
+	if ( GetRegionFromConfig(aSection, KFldExpected, expectedRegion) )
+		{
+		region.SubRegion(expectedRegion);
+		if ( !region.IsEmpty() )
+			{
+			ERR_PRINTF1(_L("Region not as expected"));
+			LogRegion(_L("Region mismatch"), region);
+			SetBlockResult(EFail);
+			}
+		}
+
+	CleanupStack::PopAndDestroy(2, &region);
+	}
+
+
+void CT_DataWindow::DoCmdSetBackgroundColor(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TRgb	datColor;
+
+	if ( GetRgbFromConfig(aSection, KFldColor, datColor) )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetBackgroundColor(TRgb)"));
+		iWindow->SetBackgroundColor(datColor);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetBackgroundColor()"));
+		iWindow->SetBackgroundColor();
+		}
+
+	// No command return value and output parameter to display and check
+	}
+
+
+void CT_DataWindow::DoCmdSetSize(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TSize	datSize;
+	if ( !GetSizeFromConfig(aSection, KFldSize, datSize) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldSize);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetSize(TSize)"));
+		iWindow->SetSize(datSize);
+
+		// No command return value and output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindow::DoCmdSetExtent(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TPoint	datPoint;
+	if ( !GetPointFromConfig(aSection, KFldPoint, datPoint) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldPoint);
+		SetBlockResult(EFail);
+		}
+
+	TSize	datSize;
+	if ( !GetSizeFromConfig(aSection, KFldSize, datSize) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldSize);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetExtent(TPoint, TSize)"));
+		iWindow->SetExtent(datPoint, datSize);
+
+		// No command return value and output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindow::DoCmdHandleTransparencyUpdate()
+	{
+	// No command input parameter to process
+
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute HandleTransparencyUpdate()"));
+	iWindow->HandleTransparencyUpdate();
+
+	// No command return value and output parameter to display and check
+	}
+
+
+void CT_DataWindow::DoCmdSetTransparencyFactor(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TRgb	datTransparencyFactor;
+
+	if ( !GetRgbFromConfig(aSection, KFldTransparencyFactor, datTransparencyFactor) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldTransparencyFactor);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetTransparencyFactor(TRgb)"));
+		TInt	returnCode = iWindow->SetTransparencyFactor(datTransparencyFactor);
+
+		// Check the command return code, if !=KErrNone then stop this command
+		if ( returnCode!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, returnCode);
+			SetError(returnCode);
+			}
+
+		// No command output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindow::DoCmdSetTransparencyBitmapL(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	CFbsBitmap*	transparencyBitmap = NULL;
+
+	if ( !CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFldTransparencyBitmap, transparencyBitmap) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldTransparencyBitmap);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetTransparencyBitmap(CFbsBitmap)"));
+		TInt	returnCode = iWindow->SetTransparencyBitmap(*transparencyBitmap);
+
+		// Check the command return code, if !=KErrNone then stop this command
+		if ( returnCode!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, returnCode);
+			SetError(returnCode);
+			}
+
+		// No command output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindow::DoCmdSetTransparencyWsBitmapL(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	CWsBitmap*	transparencyBitmap = NULL;
+
+	if ( !CT_GraphicsUtil::GetWsBitmapL(*this, aSection, KFldTransparencyBitmap, transparencyBitmap) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldTransparencyBitmap);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetTransparencyWsBitmap(CWsBitmap)"));
+		TInt	returnCode = iWindow->SetTransparencyWsBitmap(*transparencyBitmap);
+
+		// Check the command return code, if !=KErrNone then stop this command
+		if ( returnCode!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, returnCode);
+			SetError(returnCode);
+			}
+
+		// No command output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindow::DoCmdSetNonTransparent()
+	{
+	// No command input parameter to process
+
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute SetNonTransparent()"));
+	iWindow->SetNonTransparent();
+
+	// No command return value and output parameter to display and check
+	}
+
+
+void CT_DataWindow::DoCmdEnableRedrawStore(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TBool	datEnabled;
+
+	if ( !GetBoolFromConfig(aSection, KFldEnabled, datEnabled) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldEnabled);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute EnableRedrawStore(TBool)"));
+		iWindow->EnableRedrawStore(datEnabled);
+
+		// No command return value and output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindow::DoCmdSetTransparencyAlphaChannel()
+	{
+	// No command input parameter to process
+
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute SetTransparencyAlphaChannel()"));
+	TInt	returnCode = iWindow->SetTransparencyAlphaChannel();
+
+	// Check the command return code, if !=KErrNone then stop this command
+	if ( returnCode!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, returnCode);
+		SetError(returnCode);
+		}
+
+	// No command output parameter to display and check
+	}
+
+
+void CT_DataWindow::DoCmdSetTransparentRegionL(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	RRegion	region(1);
+	CleanupClosePushL(region);
+
+	if ( !GetRegionFromConfig(aSection, KFldRegion, region) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldRegion);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetTransparentRegion(TRegion)"));
+		TInt	returnCode = iWindow->SetTransparentRegion(region);
+
+		// Check the command return code, if !=KErrNone then stop this command
+		if ( returnCode!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, returnCode);
+			SetError(returnCode);
+			}
+
+		// No command output parameter to display and check
+		}
+
+	CleanupStack::PopAndDestroy(&region);
+	}
+
+
+void CT_DataWindow::DoCmdSetTransparencyPolicy(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TWsTransparencyPolicy	datPolicy;
+
+	if ( !CT_GraphicsUtil::ReadWsTransparencyPolicy(*this, aSection, KFldPolicy, datPolicy) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldPolicy);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetTransparencyPolicy(TWsTransparencyPolicy)"));
+		TInt	returnCode = iWindow->SetTransparencyPolicy(datPolicy);
+
+		// Check the command return code, if !=KErrNone then stop this command
+		if ( returnCode!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, returnCode);
+			SetError(returnCode);
+			}
+
+		// No command output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindow::DoCmdIsRedrawStoreEnabled(const TDesC& aSection)
+	{
+	// No command input parameter to process
+
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute IsRedrawStoreEnabled()"));
+	TBool	actualResult = iWindow->IsRedrawStoreEnabled();
+
+	// Diaplay command return value, check if it matches the expected value
+	TBool	expectResult;
+	if ( !GetBoolFromConfig(aSection, KFldExpected, expectResult) )
+		{
+		ERR_PRINTF2(KLogMissingExpectedValue, &KFldExpected());
+		SetBlockResult(EFail);
+		}
+	else if ( actualResult != expectResult )
+		{
+		ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected, expectResult, actualResult);
+		SetBlockResult(EFail);
+		}
+
+	// No command output parameter to display and check
+	}
+
+
+void CT_DataWindow::DoCmdEnableOSB(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TBool		datFlag;
+
+	if ( !GetBoolFromConfig(aSection, KFldFlag, datFlag) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldFlag);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute EnableOSB(TBool)"));
+		iWindow->EnableOSB(datFlag);
+
+		// No command return value and output parameter to display and check
+		}
+	}
+	
+	
+void CT_DataWindow::DoCmdSave()
+{
+	RWsSession iWs; 
+	CWsScreenDevice* iDeviceScreen;
+    CFbsBitmap* iBitmap=new(ELeave)CFbsBitmap();
+	
+	User::LeaveIfError(iWs.Connect()); 
+	iDeviceScreen = new (ELeave) CWsScreenDevice(iWs); // make device for this session
+	User::LeaveIfError(iDeviceScreen->Construct()); // and complete its construction
+	
+	//Create a bitmap from specified rect
+    iBitmap->Create(iDeviceScreen->SizeInPixels(),EColor16M); 
+	iDeviceScreen->CopyScreenToBitmap(iBitmap); 
+    iBitmap->Save(_L("c:\\logs\\testexecute\\screen.mbm"));  //Save as an mbm
+
+	//Get rid of everything allocated
+	if (iDeviceScreen)
+		delete iDeviceScreen;
+	if (iBitmap)
+		delete iBitmap;
+    // finish with window server
+    iWs.Close();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataWindowBase.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1211 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataWindowBase.h"
+#include "T_GraphicsUtil.h"
+
+
+/*@{*/
+//Commands
+_LIT(KCmdActivate,							"Activate");
+_LIT(KCmdSetPosition,						"SetPosition");
+_LIT(KCmdSetSizeErr,						"SetSizeErr");
+_LIT(KCmdSetExtentErr,						"SetExtentErr");
+_LIT(KCmdSize,								"Size");
+_LIT(KCmdInquireOffset,						"InquireOffset");
+_LIT(KCmdPointerFilter,						"PointerFilter");
+_LIT(KCmdSetPointerGrab,					"SetPointerGrab");
+_LIT(KCmdClaimPointerGrab,					"ClaimPointerGrab");
+_LIT(KCmdSetPointerCapture,					"SetPointerCapture");
+_LIT(KCmdSetPointerCapturePriority,			"SetPointerCapturePriority");
+_LIT(KCmdGetPointerCapturePriority,			"GetPointerCapturePriority");
+_LIT(KCmdSetVisible,						"SetVisible");
+_LIT(KCmdSetShadowHeight,					"SetShadowHeight");
+_LIT(KCmdSetShadowDisabled,					"SetShadowDisabled");
+_LIT(KCmdPosition,							"Position");
+_LIT(KCmdAbsPosition,						"AbsPosition");
+_LIT(KCmdSetCornerType,						"SetCornerType");
+_LIT(KCmdSetShape,							"SetShape");
+_LIT(KCmdSetRequiredDisplayMode,			"SetRequiredDisplayMode");
+_LIT(KCmdDisplayMode,						"DisplayMode");
+_LIT(KCmdEnableBackup,						"EnableBackup");
+_LIT(KCmdRequestPointerRepeatEvent,			"RequestPointerRepeatEvent");
+_LIT(KCmdCancelPointerRepeatEventRequest,	"CancelPointerRepeatEventRequest");
+_LIT(KCmdAllocPointerMoveBuffer,			"AllocPointerMoveBuffer");
+_LIT(KCmdFreePointerMoveBuffer,				"FreePointerMoveBuffer");
+_LIT(KCmdEnablePointerMoveBuffer,			"EnablePointerMoveBuffer");
+_LIT(KCmdDisablePointerMoveBuffer,			"DisablePointerMoveBuffer");
+_LIT(KCmdRetrievePointerMoveBuffer,			"RetrievePointerMoveBuffer");
+_LIT(KCmdDiscardPointerMoveBuffer,			"DiscardPointerMoveBuffer");
+_LIT(KCmdAddKeyRect,						"AddKeyRect");
+_LIT(KCmdRemoveAllKeyRects,					"RemoveAllKeyRects");
+_LIT(KCmdPasswordWindow,					"PasswordWindow");
+_LIT(KCmdFadeBehind,						"FadeBehind");
+_LIT(KCmdIsFaded,							"IsFaded");
+_LIT(KCmdIsNonFading,						"IsNonFading");
+_LIT(KCmdMoveToGroup,						"MoveToGroup");
+
+// Fields
+_LIT(KFldActivatedByPointerSwitchOn,		"activatedbypointerswitchon");
+_LIT(KFldBackupType,						"backuptype");
+_LIT(KFldCornerFlags,						"cornerflags");
+_LIT(KFldCornerType,						"cornertype");
+_LIT(KFldExpected,							"expected");
+_LIT(KFldExpectedNumOfPoints,				"expected_numofpoints");
+_LIT(KFldFade,								"fade");
+_LIT(KFldFlags,								"flags");
+_LIT(KFldHeight,							"height");
+_LIT(KFldIdentifier,						"identifier");
+_LIT(KFldIdentifier_Name,					"identifier_name");
+_LIT(KFldMaxPoints,							"maxpoints");
+_LIT(KFldMode,								"mode");
+_LIT(KFldPasswordMode,						"passwordmode");
+_LIT(KFldPoint,								"point");
+_LIT(KFldPriority,							"priority");
+_LIT(KFldRect,								"rect");
+_LIT(KFldRegion,							"region");
+_LIT(KFldScanCode,							"scancode");
+_LIT(KFldSendUpEvent,						"sendupevent");
+_LIT(KFldSize,								"size");
+_LIT(KFldState,								"state");
+_LIT(KFldTime,								"time");
+_LIT(KFldWindow,							"window");
+_LIT(KFldFilterMask,	 					"filterMask");
+_LIT(KFldFilter,			 				"filter");
+
+///	Logging
+_LIT(KLogError,								"Error=%d");
+_LIT(KLogMissingParameter,					"Missing parameter '%S'");
+_LIT(KLogMissingExpectedValue,				"Missing expected value '%S'");
+_LIT(KLogNotAsExpectedValue,				"'%S' is not as expected value");
+_LIT(KLogNotExpectedValueInt,				"'%S' is not as expected=%d, actual=%d");
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataWindowBase::CT_DataWindowBase()
+:	CT_DataWindowTreeNode()
+	{
+	}
+
+RWindowTreeNode* CT_DataWindowBase::GetWindowTreeNode() const
+	{
+	return GetWindowBase();
+	}
+
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataWindowBase::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	ret = ETrue;
+
+	if ( aCommand==KCmdActivate )
+		{
+		DoCmdActivate();
+		}
+	else if ( aCommand==KCmdSetPosition )
+		{
+		DoCmdSetPosition(aSection);
+		}
+	else if ( aCommand==KCmdSetSizeErr )
+		{
+		DoCmdSetSizeErr(aSection);
+		}
+	else if ( aCommand==KCmdSetExtentErr )
+		{
+		DoCmdSetExtentErr(aSection);
+		}
+	else if ( aCommand==KCmdSize )
+		{
+		DoCmdSize(aSection);
+		}
+	else if ( aCommand==KCmdInquireOffset )
+		{
+		DoCmdInquireOffsetL(aSection);
+		}
+	else if ( aCommand==KCmdPointerFilter )
+		{
+		DoCmdPointerFilter(aSection);
+		}
+	else if ( aCommand==KCmdSetPointerGrab )
+		{
+		DoCmdSetPointerGrab(aSection);
+		}
+	else if ( aCommand==KCmdClaimPointerGrab )
+		{
+		DoCmdClaimPointerGrab(aSection);
+		}
+	else if ( aCommand==KCmdSetPointerCapture )
+		{
+		DoCmdSetPointerCapture(aSection);
+		}
+	else if ( aCommand==KCmdSetPointerCapturePriority )
+		{
+		DoCmdSetPointerCapturePriority(aSection);
+		}
+	else if ( aCommand==KCmdGetPointerCapturePriority )
+		{
+		DoCmdGetPointerCapturePriority(aSection);
+		}
+	else if ( aCommand==KCmdSetVisible )
+		{
+		DoCmdSetVisible(aSection);
+		}
+	else if ( aCommand==KCmdSetShadowHeight )
+		{
+		DoCmdSetShadowHeight(aSection);
+		}
+	else if ( aCommand==KCmdSetShadowDisabled )
+		{
+		DoCmdSetShadowDisabled(aSection);
+		}
+	else if ( aCommand==KCmdPosition )
+		{
+		DoCmdPosition(aSection);
+		}
+	else if ( aCommand==KCmdAbsPosition )
+		{
+		DoCmdAbsPosition(aSection);
+		}
+	else if ( aCommand==KCmdSetCornerType )
+		{
+		DoCmdSetCornerType(aSection);
+		}
+	else if ( aCommand==KCmdSetShape )
+		{
+		DoCmdSetShapeL(aSection);
+		}
+	else if ( aCommand==KCmdSetRequiredDisplayMode )
+		{
+		DoCmdSetRequiredDisplayMode(aSection);
+		}
+	else if ( aCommand==KCmdDisplayMode )
+		{
+		DoCmdDisplayMode(aSection);
+		}
+	else if ( aCommand==KCmdEnableBackup )
+		{
+		DoCmdEnableBackup(aSection);
+		}
+	else if ( aCommand==KCmdRequestPointerRepeatEvent )
+		{
+		DoCmdRequestPointerRepeatEvent(aSection);
+		}
+	else if ( aCommand==KCmdCancelPointerRepeatEventRequest )
+		{
+		DoCmdCancelPointerRepeatEventRequest();
+		}
+	else if ( aCommand==KCmdAllocPointerMoveBuffer )
+		{
+		DoCmdAllocPointerMoveBuffer(aSection);
+		}
+	else if ( aCommand==KCmdFreePointerMoveBuffer )
+		{
+		DoCmdFreePointerMoveBuffer();
+		}
+	else if ( aCommand==KCmdEnablePointerMoveBuffer )
+		{
+		DoCmdEnablePointerMoveBuffer();
+		}
+	else if ( aCommand==KCmdDisablePointerMoveBuffer )
+		{
+		DoCmdDisablePointerMoveBuffer();
+		}
+	else if ( aCommand==KCmdRetrievePointerMoveBuffer )
+		{
+		DoCmdRetrievePointerMoveBufferL(aSection);
+		}
+	else if ( aCommand==KCmdDiscardPointerMoveBuffer )
+		{
+		DoCmdDiscardPointerMoveBuffer();
+		}
+	else if ( aCommand==KCmdAddKeyRect )
+		{
+		DoCmdAddKeyRect(aSection);
+		}
+	else if ( aCommand==KCmdRemoveAllKeyRects )
+		{
+		DoCmdRemoveAllKeyRects();
+		}
+	else if ( aCommand==KCmdPasswordWindow )
+		{
+		DoCmdPasswordWindow(aSection);
+		}
+	else if ( aCommand==KCmdFadeBehind )
+		{
+		DoCmdFadeBehind(aSection);
+		}
+	else if ( aCommand==KCmdIsFaded )
+		{
+		DoCmdIsFaded(aSection);
+		}
+	else if ( aCommand==KCmdIsNonFading )
+		{
+		DoCmdIsNonFading(aSection);
+		}
+	else if ( aCommand==KCmdMoveToGroup )
+		{
+		DoCmdMoveToGroupL(aSection);
+		}
+	else
+		{
+		ret=CT_DataWindowTreeNode::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+
+	return ret;
+	}
+
+
+void CT_DataWindowBase::DoCmdActivate()
+	{
+	// No command input parameter to process
+
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute Activate()"));
+	GetWindowBase()->Activate();
+
+	// No command return value and output parameter to display and check
+	}
+
+
+void CT_DataWindowBase::DoCmdSetPosition(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TPoint	datPoint;
+
+	if ( !GetPointFromConfig(aSection, KFldPoint, datPoint) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldPoint);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetPosition(TPoint)"));
+		GetWindowBase()->SetPosition(datPoint);
+
+		// No command return value and output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindowBase::DoCmdSetSizeErr(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TSize	datSize;
+
+	if ( !GetSizeFromConfig(aSection, KFldSize, datSize) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldSize);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetSizeErr(TSize)"));
+		TInt	returnCode = GetWindowBase()->SetSizeErr(datSize);
+
+		// Check the command return code, if !=KErrNone then stop this command
+		if ( returnCode!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, returnCode);
+			SetError(returnCode);
+			}
+
+		// No command output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindowBase::DoCmdSetExtentErr(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TPoint	datPoint;
+	if ( !GetPointFromConfig(aSection, KFldPoint, datPoint) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldPoint);
+		SetBlockResult(EFail);
+		}
+
+	TSize	datSize;
+	if ( !GetSizeFromConfig(aSection, KFldSize, datSize) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldSize);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetExtentErr(TPoint, TSize)"));
+		TInt	returnCode = GetWindowBase()->SetExtentErr(datPoint, datSize);
+
+		// Check the command return code, if !=KErrNone then stop this command
+		if ( returnCode!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, returnCode);
+			SetError(returnCode);
+			}
+
+		// No command output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindowBase::DoCmdSize(const TDesC& aSection)
+	{
+	// No command input parameter to process
+
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute Size()"));
+	TSize	actualResult = GetWindowBase()->Size();
+
+	// Diaplay command return value, check if it matches the expected value
+	TSize	expectResult;
+
+	if ( !GetSizeFromConfig(aSection, KFldExpected, expectResult) )
+		{
+		ERR_PRINTF2(KLogMissingExpectedValue, &KFldExpected);
+		SetBlockResult(EFail);
+		}
+	else if ( actualResult!=expectResult )
+		{
+		ERR_PRINTF2(KLogNotAsExpectedValue, &KFldExpected);
+		SetBlockResult(EFail);
+		}
+	}
+
+
+void CT_DataWindowBase::DoCmdInquireOffsetL(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TPtrC	windowName;
+	RWindowTreeNode*	window=NULL;
+	if ( GetStringFromConfig(aSection, KFldWindow, windowName) )
+		{
+		window = static_cast<RWindowTreeNode*>(GetDataObjectL(windowName));
+		}
+
+	if ( window==NULL )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldWindow);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute InquireOffset(RWindowTreeNode)"));
+		TPoint	actualResult = GetWindowBase()->InquireOffset(*window);
+
+		// Diaplay command return value, check if it matches the expected value
+		TPoint	expectResult;
+
+		if ( !GetPointFromConfig(aSection, KFldExpected, expectResult)	)
+			{
+			ERR_PRINTF2(KLogMissingExpectedValue, &KFldExpected);
+			SetBlockResult(EFail);
+			}
+		else if ( actualResult!=expectResult )
+			{
+			ERR_PRINTF2(KLogNotAsExpectedValue, &KFldExpected);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+void CT_DataWindowBase::DoCmdPointerFilter(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	TUint32	eventFilterMask=0;
+	if ( !CT_GraphicsUtil::ReadPointerFilter(*this, aSection, KFldFilterMask, (TUint&)eventFilterMask) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFilterMask);
+		SetBlockResult(EFail);
+		}
+
+	TUint32	eventFilter=0;
+	if ( !CT_GraphicsUtil::ReadPointerFilter(*this, aSection, KFldFilter, (TUint&)eventFilter) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFilter);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		INFO_PRINTF3(_L("execute PointerFilter(0x%x, 0x%x)"), eventFilterMask, eventFilter);
+		GetWindowBase()->PointerFilter(eventFilterMask, eventFilter);
+		}
+	}
+
+
+void CT_DataWindowBase::DoCmdSetPointerGrab(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TBool	datState = EFalse;
+
+	if ( !GetBoolFromConfig(aSection, KFldState, datState) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldState);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetPointerGrab(TBool)"));
+		GetWindowBase()->SetPointerGrab(datState);
+
+		// No command return value and output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindowBase::DoCmdClaimPointerGrab(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TBool	datSendUpEvent = EFalse;
+
+	if ( !GetBoolFromConfig(aSection, KFldSendUpEvent, datSendUpEvent) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldSendUpEvent);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute ClaimPointerGrab(TBool)"));
+		GetWindowBase()->ClaimPointerGrab(datSendUpEvent);
+
+		// No command return value and output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindowBase::DoCmdSetPointerCapture(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	RWindowBase::TCaptureFlags	datFlags;
+
+	if ( !CT_GraphicsUtil::ReadCaptureFlags(*this, aSection, KFldFlags, (TUint&)datFlags) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldFlags);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetPointerCapture(TInt)"));
+		GetWindowBase()->SetPointerCapture(datFlags);
+
+		// No command return value and output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindowBase::DoCmdSetPointerCapturePriority(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TInt	datPriority;
+
+	if ( !GetIntFromConfig(aSection, KFldPriority, datPriority) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldPriority);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetPointerCapturePriority(TInt)"));
+		GetWindowBase()->SetPointerCapturePriority(datPriority);
+
+		// No command return value and output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindowBase::DoCmdGetPointerCapturePriority(const TDesC& aSection)
+	{
+	// No command input parameter to process
+
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute GetPointerCapturePriority()"));
+	TInt	actualResult = GetWindowBase()->GetPointerCapturePriority();
+
+	// Diaplay command return value, check if it matches the expected value
+	TInt	expectResult;
+	if ( !GetIntFromConfig(aSection, KFldExpected, expectResult) )
+		{
+		ERR_PRINTF2(KLogMissingExpectedValue, &KFldExpected);
+		SetBlockResult(EFail);
+		}
+	else if ( actualResult!=expectResult )
+		{
+		ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected, expectResult, actualResult);
+		SetBlockResult(EFail);
+		}
+
+	// No command output parameter to display and check
+	}
+
+
+void CT_DataWindowBase::DoCmdSetVisible(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TBool	datState = EFalse;
+
+	if ( !GetBoolFromConfig(aSection, KFldState, datState) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldState);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetVisible(TBool)"));
+		GetWindowBase()->SetVisible(datState);
+
+		// No command return value and output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindowBase::DoCmdSetShadowHeight(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TInt	datHeight;
+
+	if ( !GetIntFromConfig(aSection, KFldHeight, datHeight) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldHeight);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetShadowHeight(TInt)"));
+		GetWindowBase()->SetShadowHeight(datHeight);
+
+		// No command return value and output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindowBase::DoCmdSetShadowDisabled(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TBool	datState = EFalse;
+
+	if ( !GetBoolFromConfig(aSection, KFldState, datState) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldState);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetShadowDisabled(TBool)"));
+		GetWindowBase()->SetShadowDisabled(datState);
+
+		// No command return value and output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindowBase::DoCmdPosition(const TDesC& aSection)
+	{
+	TPoint	actual=GetWindowBase()->Position();
+	INFO_PRINTF3(_L("execute Position()=(%d,%d)"), actual.iX, actual.iY);
+
+	// Diaplay command return value, check if it matches the expected value
+	TPoint	expected;
+	if ( !GetPointFromConfig(aSection, KFldExpected, expected)	)
+		{
+		ERR_PRINTF2(KLogMissingExpectedValue, &KFldExpected);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if ( actual!=expected )
+			{
+			ERR_PRINTF2(KLogNotAsExpectedValue, &KFldExpected);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+void CT_DataWindowBase::DoCmdAbsPosition(const TDesC& aSection)
+	{
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute AbsPosition()"));
+	TPoint	actual=GetWindowBase()->AbsPosition();
+
+	// Diaplay command return value, check if it matches the expected value
+	TPoint	expected;
+	if ( !GetPointFromConfig(aSection, KFldExpected, expected)	)
+		{
+		ERR_PRINTF2(KLogMissingExpectedValue, &KFldExpected);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if ( actual!=expected )
+			{
+			ERR_PRINTF2(KLogNotAsExpectedValue, &KFldExpected);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+void CT_DataWindowBase::DoCmdSetCornerType(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TCornerType datCornerType;
+	if ( !CT_GraphicsUtil::ReadCornerType(*this, aSection, KFldCornerType, datCornerType) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldCornerType);
+		SetBlockResult(EFail);
+		}
+
+	TInt	datCornerFlags;
+	if ( !GetHexFromConfig(aSection, KFldCornerFlags, datCornerFlags) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldCornerFlags);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetCornerType(TCornerType, TInt)"));
+		GetWindowBase()->SetCornerType(datCornerType, datCornerFlags);
+		}
+	}
+
+
+void CT_DataWindowBase::DoCmdSetShapeL(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	RRegion	region(1);
+	CleanupClosePushL(region);
+
+	if ( !GetRegionFromConfig(aSection, KFldRegion, region) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldRegion);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetShape(TRegion)"));
+		TInt	err=GetWindowBase()->SetShape(region);
+
+		// Check the command return code, if !=KErrNone then stop this command
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+
+		// No command output parameter to display and check
+		}
+	CleanupStack::PopAndDestroy(&region);
+	}
+
+
+void CT_DataWindowBase::DoCmdSetRequiredDisplayMode(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TDisplayMode	datMode;
+
+	if ( !CT_GraphicsUtil::ReadDisplayMode(*this, aSection, KFldMode, datMode) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldMode);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		TInt			actual=GetWindowBase()->SetRequiredDisplayMode(datMode);
+		INFO_PRINTF2(_L("execute SetRequiredDisplayMode(TDisplayMode)=%d"), actual);
+
+		// Diaplay command return value, check if it matches the expected value
+		TDisplayMode	expected;
+		if ( CT_GraphicsUtil::ReadDisplayMode(*this, aSection, KFldExpected, expected) )
+			{
+			if ( actual!=expected )
+				{
+				ERR_PRINTF2(KLogNotAsExpectedValue, &KFldExpected);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+void CT_DataWindowBase::DoCmdDisplayMode(const TDesC& aSection)
+	{
+	// No command input parameter to process
+
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute DisplayMode()"));
+	TDisplayMode	actualResult = GetWindowBase()->DisplayMode();
+
+	// Diaplay command return value, check if it matches the expected value
+	TDisplayMode	expectResult;
+	if ( !CT_GraphicsUtil::ReadDisplayMode(*this, aSection, KFldExpected, expectResult) )
+		{
+		ERR_PRINTF2(KLogMissingExpectedValue, &KFldExpected);
+		SetBlockResult(EFail);
+		}
+	else if ( actualResult!=expectResult )
+		{
+		ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected, expectResult, actualResult);
+		SetBlockResult(EFail);
+		}
+	}
+
+
+void CT_DataWindowBase::DoCmdEnableBackup(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TWindowBackupType	datBackupType;
+
+	if ( !CT_GraphicsUtil::ReadWindowBackupType(*this, aSection, KFldBackupType, (TUint&)datBackupType) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldBackupType);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute EnableBackup(TUint)"));
+		GetWindowBase()->EnableBackup(datBackupType);
+
+		// No command return value and output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindowBase::DoCmdRequestPointerRepeatEvent(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TInt	datTime=0;
+	if ( !GetIntFromConfig(aSection, KFldTime, datTime) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldTime);
+		SetBlockResult(EFail);
+		}
+
+	TRect	datRect;
+	if ( !GetRectFromConfig(aSection, KFldRect, datRect) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldRect);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32, TRect)"));
+		GetWindowBase()->RequestPointerRepeatEvent((TTimeIntervalMicroSeconds32)datTime, datRect);
+
+		// No command return value and output parameter to display and check
+		}
+	}
+
+void CT_DataWindowBase::DoCmdCancelPointerRepeatEventRequest()
+	{
+	// No command input parameter to process
+
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute CancelPointerRepeatEventRequest()"));
+	GetWindowBase()->CancelPointerRepeatEventRequest();
+
+	// No command return value and output parameter to display and check
+	}
+
+
+void CT_DataWindowBase::DoCmdAllocPointerMoveBuffer(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TInt	datMaxPoints;
+	if ( !GetIntFromConfig(aSection, KFldMaxPoints, datMaxPoints) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldMaxPoints);
+		SetBlockResult(EFail);
+		}
+
+	TInt	datFlags;
+	if ( !GetIntFromConfig(aSection, KFldFlags, datFlags) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFlags);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute AllocPointerMoveBuffer(TInt, TUint)"));
+		TInt	returnCode = GetWindowBase()->AllocPointerMoveBuffer(datMaxPoints, datFlags);
+
+		// Check the command return code, if !=KErrNone then stop this command
+		if ( returnCode!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, returnCode);
+			SetError(returnCode);
+			}
+
+		// No command output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindowBase::DoCmdFreePointerMoveBuffer()
+	{
+	// No command input parameter to process
+
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute FreePointerMoveBuffer()"));
+	GetWindowBase()->FreePointerMoveBuffer();
+
+	// No command return value and output parameter to display and check
+	}
+
+
+void CT_DataWindowBase::DoCmdEnablePointerMoveBuffer()
+	{
+	// No command input parameter to process
+
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute EnablePointerMoveBuffer()"));
+	GetWindowBase()->EnablePointerMoveBuffer();
+
+	// No command return value and output parameter to display and check
+	}
+
+
+void CT_DataWindowBase::DoCmdDisablePointerMoveBuffer()
+	{
+	// No command input parameter to process
+
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute DisablePointerMoveBuffer()"));
+	GetWindowBase()->DisablePointerMoveBuffer();
+
+	// No command return value and output parameter to display and check
+	}
+
+void CT_DataWindowBase::DoCmdRetrievePointerMoveBufferL(const TDesC& aSection)
+	{
+	const TInt KPointerMoveBufferSize = 50;
+	TInt	maxPoints=KPointerMoveBufferSize;
+	GetIntFromConfig(aSection, KFldMaxPoints, maxPoints);
+
+	TPoint*	pnts = new (ELeave) TPoint[maxPoints];
+	CleanupArrayDeletePushL(pnts);
+	TPtr8	ptr((TUint8 *)pnts,sizeof(TPoint)*maxPoints);
+
+	INFO_PRINTF1(_L("execute RetrievePointerMoveBuffer(TDes8&)"));
+	TInt err=GetWindowBase()->RetrievePointerMoveBuffer(ptr);
+
+	if ( err<KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	else
+		{
+		TInt	numberOfPointsInBuffer = ptr.Length() / sizeof(TPoint);
+		TInt	expectedNumOfPoints=0;
+
+		for (TInt i=0; ; i++)
+			{
+			TBuf<KMaxTestExecuteCommandLength>	tempStore;
+			tempStore.Format(_L("%S%d"), &KFldExpected, i+1);
+
+			TPoint	expectedPoint;
+			if ( GetPointFromConfig(aSection, tempStore, expectedPoint) )
+				{
+				expectedNumOfPoints++;
+				if ( i<numberOfPointsInBuffer )
+					{
+					if ( pnts[i]!=expectedPoint )
+						{
+						ERR_PRINTF2(KLogNotAsExpectedValue, &tempStore);
+						ERR_PRINTF3(_L("%d%d"), pnts[i].iX, pnts[i].iY);
+						SetBlockResult(EFail);
+						}
+					}
+				}
+			else
+				{
+				break;
+				}
+			}
+
+		if ( numberOfPointsInBuffer!=expectedNumOfPoints )
+			{
+			ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpectedNumOfPoints, expectedNumOfPoints, numberOfPointsInBuffer);
+			SetBlockResult(EFail);
+			}
+		}
+
+	CleanupStack::PopAndDestroy(pnts);
+	}
+
+void CT_DataWindowBase::DoCmdDiscardPointerMoveBuffer()
+	{
+	// No command input parameter to process
+
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute DiscardPointerMoveBuffer()"));
+	GetWindowBase()->DiscardPointerMoveBuffer();
+
+	// No command return value and output parameter to display and check
+	}
+
+
+void CT_DataWindowBase::DoCmdAddKeyRect(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TRect	datRect;
+	if ( !GetRectFromConfig(aSection, KFldRect, datRect) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldRect);
+		SetBlockResult(EFail);
+		}
+
+	TInt	datScanCode;
+	if ( !CT_GraphicsUtil::ReadStdScanCode(*this, aSection, KFldScanCode, (TStdScanCode&)datScanCode) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldScanCode);
+		SetBlockResult(EFail);
+		}
+
+	TBool	datActivatedByPointerSwitchOn;
+	if ( !GetBoolFromConfig(aSection, KFldActivatedByPointerSwitchOn, datActivatedByPointerSwitchOn) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldActivatedByPointerSwitchOn);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute AddKeyRect(TRect, TInt, TBool)"));
+		TInt	returnCode = GetWindowBase()->AddKeyRect(datRect, datScanCode, datActivatedByPointerSwitchOn);
+
+		// Check the command return code, if !=KErrNone then stop this command
+		if ( returnCode!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, returnCode);
+			SetError(returnCode);
+			}
+
+		// No command output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindowBase::DoCmdRemoveAllKeyRects()
+	{
+	// No command input parameter to process
+
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute RemoveAllKeyRects()"));
+	GetWindowBase()->RemoveAllKeyRects();
+
+	// No command return value and output parameter to display and check
+	}
+
+
+void CT_DataWindowBase::DoCmdPasswordWindow(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TPasswordMode	datPasswordMode;
+
+	if ( !CT_GraphicsUtil::ReadPasswordMode(*this, aSection, KFldPasswordMode, datPasswordMode) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldPasswordMode);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute PasswordWindow(TPasswordMode)"));
+		TInt	returnCode = GetWindowBase()->PasswordWindow(datPasswordMode);
+
+		// Check the command return code, if !=KErrNone then stop this command
+		if ( returnCode!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, returnCode);
+			SetError(returnCode);
+			}
+
+		// No command output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindowBase::DoCmdFadeBehind(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TBool	datFade;
+
+	if ( !GetBoolFromConfig(aSection, KFldFade, datFade) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldFade);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute FadeBehind(TBool)"));
+		GetWindowBase()->FadeBehind(datFade);
+
+		// No command return value and output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindowBase::DoCmdIsFaded(const TDesC& aSection)
+	{
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute IsFaded()"));
+	TBool	actualResult = GetWindowBase()->IsFaded();
+
+	// Diaplay command return value, check if it matches the expected value
+	TBool	expectResult;
+	if ( !GetBoolFromConfig(aSection, KFldExpected, expectResult) )
+		{
+		ERR_PRINTF2(KLogMissingExpectedValue, &KFldExpected());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if ( (actualResult!=0) != expectResult )
+			{
+			ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected, expectResult, actualResult);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+void CT_DataWindowBase::DoCmdIsNonFading(const TDesC& aSection)
+	{
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute IsNonFading()"));
+	TBool	actualResult = GetWindowBase()->IsNonFading();
+
+	// Diaplay command return value, check if it matches the expected value
+	TBool	expectResult;
+	if ( !GetBoolFromConfig(aSection, KFldExpected, expectResult) )
+		{
+		ERR_PRINTF2(KLogMissingExpectedValue, &KFldExpected());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if ( (actualResult!=0) != expectResult )
+			{
+			ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected, expectResult, actualResult);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+void CT_DataWindowBase::DoCmdMoveToGroupL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TInt	datIdentifier;
+	if ( !GetIntFromConfig(aSection, KFldIdentifier, datIdentifier) )
+		{
+		TPtrC	identifierName;
+		RWindowGroup*	identifier = NULL;
+		if ( GetStringFromConfig(aSection, KFldIdentifier_Name, identifierName) )
+			{
+			identifier = static_cast<RWindowGroup*>(GetDataObjectL(identifierName));
+			}
+
+		if ( identifier==NULL )
+			{
+			dataOk=EFalse;
+			ERR_PRINTF2(KLogMissingParameter, &KFldIdentifier);
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			datIdentifier = identifier->Identifier();
+			INFO_PRINTF3(_L("get '%S_name' identifier = %d to MoveToGroup"), &KFldIdentifier, datIdentifier);
+			}
+		}
+
+	if ( dataOk )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute MoveToGroup(TInt)"));
+		TInt	returnCode = GetWindowBase()->MoveToGroup(datIdentifier);
+
+		// Check the command return code, if !=KErrNone then stop this command
+		if ( returnCode!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, returnCode);
+			SetError(returnCode);
+			}
+
+		// No command output parameter to display and check
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataWindowGc.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,437 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataWindowGc.h"
+#include "T_GraphicsUtil.h"
+
+/*@{*/
+_LIT(KDataClassname,	"CWindowGc");
+
+//Commands
+_LIT(KCmdnew,						"new");
+_LIT(KCmdDestructor,				"~CWindowGc");
+_LIT(KCmdDestructorGeneral,			"~");
+_LIT(KCmdConstruct,					"Construct");
+_LIT(KCmdActivate,					"Activate");
+_LIT(KCmdDeactivate,				"Deactivate");
+_LIT(KCmdBitBlt,					"BitBlt");
+_LIT(KCmdBitBltMasked,				"BitBltMasked");
+_LIT(KCmdSetDitherOrigin,			"SetDitherOrigin");
+_LIT(KCmdSetOpaque,					"SetOpaque");
+_LIT(KCmdDrawWsGraphic,				"DrawWsGraphic");
+
+// Fields
+_LIT(KFldData,						"data");
+_LIT(KFldWsga,						"wsga");
+_LIT(KFldDestRect,					"destrect");
+_LIT(KFldDestination,				"destination");
+_LIT(KFldDevice,					"device");
+_LIT(KFldId,						"id");
+_LIT(KFldInvertMask,				"invertmask");
+_LIT(KFldMaskBitmap,				"maskbitmap");
+_LIT(KFldPoint,						"point");
+_LIT(KFldSource,					"source");
+_LIT(KFldSourceRect,				"sourcerect");
+_LIT(KFldWsBitmap,					"wsbitmap");
+_LIT(KFldDrawOpaque,				"drawOpaque");
+
+///	Logging
+_LIT(KLogError,						"Error=%d");
+_LIT(KLogMissingParameter,			"Missing parameter '%S'");
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataWindowGc* CT_DataWindowGc::NewL()
+	{
+	CT_DataWindowGc*	ret=new (ELeave) CT_DataWindowGc();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+CT_DataWindowGc::CT_DataWindowGc()
+:	CT_DataBitmapContext()
+,	iWindowGc(NULL)
+	{
+	}
+
+void CT_DataWindowGc::ConstructL()
+	{
+	}
+
+CT_DataWindowGc::~CT_DataWindowGc()
+	{
+	DestroyData();
+	}
+
+void CT_DataWindowGc::SetObjectL(TAny* aAny)
+	{
+	DestroyData();
+	iWindowGc = static_cast<CWindowGc*> (aAny);
+	}
+
+void CT_DataWindowGc::DisownObjectL()
+	{
+	iWindowGc = NULL;
+	}
+
+void CT_DataWindowGc::DestroyData()
+	{
+	delete iWindowGc;
+	iWindowGc=NULL;
+	}
+
+MWsClientClass* CT_DataWindowGc::GetClientClass() const
+	{
+	return iWindowGc;
+	}
+
+CBitmapContext* CT_DataWindowGc::GetBitmapContext() const
+	{
+	return iWindowGc;
+	}
+
+CGraphicsContext* CT_DataWindowGc::GetGraphicsContext() const
+	{
+	return iWindowGc;
+	}
+
+
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataWindowGc::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	ret = ETrue;
+
+	if ( aCommand==KCmdDestructor || aCommand==KCmdDestructorGeneral )
+		{
+		DoCmdDestructor();
+		}
+	else if ( aCommand==KCmdnew || aCommand==KDataClassname )
+		{
+		DoCmdnewL(aSection);
+		}
+	else if ( aCommand==KCmdConstruct )
+		{
+		DoCmdConstruct();
+		}
+	else if ( aCommand==KCmdActivate )
+		{
+		DoCmdActivateL(aSection);
+		}
+	else if ( aCommand==KCmdDeactivate )
+		{
+		DoCmdDeactivate();
+		}
+	else if ( aCommand==KCmdBitBlt )
+		{
+		DoCmdBitBltL(aCommand, aSection, aAsyncErrorIndex);
+		}
+	else if ( aCommand==KCmdBitBltMasked )
+		{
+		DoCmdBitBltMaskedL(aCommand, aSection, aAsyncErrorIndex);
+		}
+	else if ( aCommand==KCmdSetDitherOrigin )
+		{
+		DoCmdSetDitherOrigin(aSection);
+		}
+	else if ( aCommand==KCmdSetOpaque )
+		{
+		DoCmdSetOpaque(aSection);
+		}
+	else if ( aCommand==KCmdDrawWsGraphic )
+		{
+		DoCmdDrawWsGraphicL(aSection);
+		}
+	else if ( CT_DataBitmapContext::DoCommandL(aCommand, aSection, aAsyncErrorIndex) )
+		{
+		}
+	else
+		{
+		ret=CT_DataWsClientClass::DoCommandL(*this, aCommand, aSection, aAsyncErrorIndex);
+		}
+
+	return ret;
+	}
+
+
+void CT_DataWindowGc::DoCmdnewL(const TDesC& aSection)
+	{
+	DestroyData();
+
+	// Get test data for command input parameter(s)
+	CWsScreenDevice*	device = NULL;
+	if ( !CT_GraphicsUtil::GetWsScreenDeviceL(*this, aSection, KFldDevice, device) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldDevice);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute new CWindowGc(CWsScreenDevice)"));
+		TRAPD( err, iWindowGc = new (ELeave) CWindowGc(device) );
+		if ( err != KErrNone )
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		}
+	}
+
+void CT_DataWindowGc::DoCmdDestructor()
+	{
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute ~CWindowGc()"));
+	delete iWindowGc;
+	iWindowGc=NULL;
+	}
+
+
+void CT_DataWindowGc::DoCmdConstruct()
+	{
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute Construct()"));
+	TInt	returnCode = iWindowGc->Construct();
+
+	// Check the command return code, if !=KErrNone then stop this command
+	if ( returnCode!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, returnCode);
+		SetError(returnCode);
+		}
+	}
+
+
+void CT_DataWindowGc::DoCmdActivateL(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	RDrawableWindow	*device = NULL;
+
+	if ( !CT_GraphicsUtil::GetDrawableWindowL(*this, aSection, KFldDevice, device) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldDevice);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute Activate(RDrawableWindow)"));
+		iWindowGc->Activate(*device);
+
+		// No command return value and output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindowGc::DoCmdDeactivate()
+	{
+	// No command input parameter to process
+
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute Deactivate()"));
+	iWindowGc->Deactivate();
+
+	// No command return value and output parameter to display and check
+	}
+
+void CT_DataWindowGc::DoCmdBitBltL(const TDesC& aCommand, const TDesC& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	dataOk=ETrue;
+
+	CWsBitmap*	wsBitmap=NULL;
+	if ( !CT_GraphicsUtil::GetWsBitmapL(*this, aSection, KFldWsBitmap, wsBitmap) )
+		{
+		CT_DataBitmapContext::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+	else
+		{
+		TPoint		point;
+		if ( GetPointFromConfig(aSection, KFldPoint, point) )
+			{
+			if ( dataOk )
+				{
+				// Execute command and log parameters
+				INFO_PRINTF1(_L("execute BitBlt(TPoint, CWsBitmap*)"));
+				iWindowGc->BitBlt(point, wsBitmap);
+				}
+			}
+		else
+			{
+			TPoint	destination;
+			if ( !GetPointFromConfig(aSection, KFldDestination, destination) )
+				{
+				dataOk=EFalse;
+				ERR_PRINTF2(KLogMissingParameter, &KFldDestination());
+				SetBlockResult(EFail);
+				}
+    	
+			TRect	source;
+			if ( !GetRectFromConfig(aSection, KFldSource, source) )
+				{
+				dataOk=EFalse;
+				ERR_PRINTF2(KLogMissingParameter, &KFldSource());
+				SetBlockResult(EFail);
+				}
+    	
+			if ( dataOk )
+				{
+				// Execute command and log parameters
+				INFO_PRINTF1(_L("execute BitBlt(TRect, CWsBitmap*, TRect)"));
+				iWindowGc->BitBlt(destination, wsBitmap, source);
+				}
+			}
+		}
+	}
+
+
+void CT_DataWindowGc::DoCmdBitBltMaskedL(const TDesC& aCommand, const TDesC& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	dataOk=ETrue;
+
+	CWsBitmap*	wsBitmap=NULL;
+	if ( !CT_GraphicsUtil::GetWsBitmapL(*this, aSection, KFldWsBitmap, wsBitmap) )
+		{
+		CT_DataBitmapContext::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+	else
+		{
+		// Get test data for command input parameter(s)
+		TPoint	point;
+		if ( !GetPointFromConfig(aSection, KFldPoint, point) )
+			{
+			dataOk=EFalse;
+			ERR_PRINTF2(KLogMissingParameter, &KFldPoint());
+			SetBlockResult(EFail);
+			}
+    	
+		TRect	sourceRect;
+		if ( !GetRectFromConfig(aSection, KFldSourceRect, sourceRect) )
+			{
+			dataOk=EFalse;
+			ERR_PRINTF2(KLogMissingParameter, &KFldSourceRect());
+			SetBlockResult(EFail);
+			}
+    	
+		TBool	invertMask;
+		if ( !GetBoolFromConfig(aSection, KFldInvertMask, invertMask) )
+			{
+			dataOk=EFalse;
+			ERR_PRINTF2(KLogMissingParameter, &KFldInvertMask());
+			SetBlockResult(EFail);
+			}
+    	
+		if ( dataOk )
+			{
+			CWsBitmap*	maskBitmap=NULL;
+			CT_GraphicsUtil::GetWsBitmapL(*this, aSection, KFldMaskBitmap, maskBitmap);
+    	
+			// Execute command and log parameters
+			INFO_PRINTF1(_L("execute BitBltMasked(TPoint, CWsBitmap*, TRect, CWsBitmap*, TBool)"));
+			iWindowGc->BitBltMasked(point, wsBitmap, sourceRect, maskBitmap, invertMask);
+			}
+		}
+	}
+
+void CT_DataWindowGc::DoCmdSetDitherOrigin(const TDesC& aSection)
+	{
+	TPoint	point;
+	if ( GetPointFromConfig(aSection, KFldPoint, point) )
+		{
+		INFO_PRINTF1(_L("CWindowGc::SetDitherOrigin"));
+		iWindowGc->SetDitherOrigin(point);
+		}
+	else
+		{
+		ERR_PRINTF2(_L("Missing parameter %S"), &KFldPoint());
+		SetBlockResult(EFail);
+		}
+	}
+
+void CT_DataWindowGc::DoCmdSetOpaque(const TDesC& aSection)
+	{
+	TBool	drawOpaque=ETrue;
+	if(	GetBoolFromConfig(aSection, KFldDrawOpaque(), drawOpaque))
+		{
+		INFO_PRINTF1(_L("CWindowGc::SetOpaque"));
+		iWindowGc->SetOpaque(drawOpaque);
+		}
+	else
+		{
+		ERR_PRINTF2(_L("Missing parameter %S"), &KFldDrawOpaque());
+		SetBlockResult(EFail);
+		}
+	}
+
+void CT_DataWindowGc::DoCmdDrawWsGraphicL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TWsGraphicId	datId(0);
+	if ( !GetWsGraphicIdFromConfigL(aSection, KFldId, datId) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldId);
+		SetBlockResult(EFail);
+		}
+
+	TRect	datDestRect;
+	if ( !GetRectFromConfig(aSection, KFldDestRect, datDestRect) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldDestRect);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		RWsGraphicMsgBuf*	pData = NULL;
+		TWsGraphicAnimation* pWsga = NULL;
+		if ( CT_GraphicsUtil::GetWsGraphicMsgBufL(*this, aSection, KFldData, pData) )
+			{
+			// Execute command and log parameters
+			INFO_PRINTF1(_L("execute DrawWsGraphic(TWsGraphicId, TRect, TDesC8)"));
+			iWindowGc->DrawWsGraphic(datId, datDestRect, pData->Pckg());
+			}
+		else if( CT_GraphicsUtil::GetWsGraphicAnimationL(*this, aSection, KFldWsga, pWsga) )
+			{
+			INFO_PRINTF1(_L("execute DrawWsGraphic(TWsGraphicId, TRect, TDesC8)"));
+			iWindowGc->DrawWsGraphic(datId, datDestRect, pWsga->Pckg());
+			}
+		else
+			{
+			// Execute command and log parameters
+			INFO_PRINTF1(_L("execute DrawWsGraphic(TWsGraphicId, TRect)"));
+			iWindowGc->DrawWsGraphic(datId, datDestRect);
+			}
+		// No command return value and output parameter to display and check
+		}
+	}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataWindowGroup.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1236 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataWindowGroup.h"
+#include "T_GraphicsUtil.h"
+
+/*@{*/
+_LIT(KDataClassname,	"RWindowGroup");
+
+// Fields
+_LIT(KFldAdjust					,"adjust");
+_LIT(KFldCaptureKey				,"capturekey");
+_LIT(KFldClientHandle			,"clienthandle");
+_LIT(KFldClipRect				,"cliprect");
+_LIT(KFldCursor					,"cursor");
+_LIT(KFldDeviceNumber			,"devicenumber");
+_LIT(KFldFlags					,"flags");
+_LIT(KFldIdOfParentWindowGroup	,"idofparentwindowgroup");
+_LIT(KFldInputKeyCode			,"inputkeycode");
+_LIT(KFldIsFocusable			,"isfocusable");
+_LIT(KFldKeycode				,"keycode");
+_LIT(KFldModifier				,"modifier");
+_LIT(KFldModifierMask			,"modifiermask");
+_LIT(KFldOrdinalPriority		,"ordinalpriority");
+_LIT(KFldOutputKeyCode			,"outputkeycode");
+_LIT(KFldPos					,"pos");
+_LIT(KFldProcessSID				,"processsid");
+_LIT(KFldPriority				,"priority");
+_LIT(KFldRepeatTime				,"repeattime");
+_LIT(KFldScanCode				,"scancode");
+_LIT(KFldScreenDevice			,"screendevice");
+_LIT(KFldState					,"state");
+_LIT(KFldStdScanCode			,"stdscancode");
+_LIT(KFldTip					,"tip");
+_LIT(KFldType					,"type");
+_LIT(KFldWin					,"win");
+_LIT(KFldWs						,"ws");
+_LIT(KFldID						,"id");
+_LIT(KFldIDName					,"id_name");
+
+//Parameters
+_LIT(KinputWGN,					"inputWGN");
+_LIT(KexpectedReturnWGN,		"expectRtnWGN");
+_LIT(KOwningWGIdentifier,		"OwningWGId");
+_LIT(KOwningWGIdName,			"OwningWGId_name");
+
+//Commands
+_LIT(KCmdnew,									"new");
+_LIT(KCmdDestructor,							"~");
+_LIT(KCmdConstruct,								"Construct");
+_LIT(KCmdConstructChildApp,						"ConstructChildApp");
+_LIT(KCmdAllowProcessToCreateChildWindowGroups,	"AllowProcessToCreateChildWindowGroups");
+_LIT(KCmdEnableReceiptOfFocus,					"EnableReceiptOfFocus");
+_LIT(KCmdAutoForeground,						"AutoForeground");
+_LIT(KCmdSetOrdinalPriorityAdjust,				"SetOrdinalPriorityAdjust");
+_LIT(KCmdSetOrdinalPositionErr,					"SetOrdinalPositionErr");
+_LIT(KCmdCaptureKey,							"CaptureKey");
+_LIT(KCmdCancelCaptureKey,						"CancelCaptureKey");
+_LIT(KCmdCaptureKeyUpAndDowns,					"CaptureKeyUpAndDowns");
+_LIT(KCmdCancelCaptureKeyUpAndDowns,			"CancelCaptureKeyUpAndDowns");
+_LIT(KCmdCaptureLongKey,						"CaptureLongKey");
+_LIT(KCmdCancelCaptureLongKey,					"CancelCaptureLongKey");
+_LIT(KCmdAddPriorityKey,						"AddPriorityKey");
+_LIT(KCmdRemovePriorityKey,						"RemovePriorityKey");
+_LIT(KCmdSetTextCursor,							"SetTextCursor");
+_LIT(KCmdCancelTextCursor,						"CancelTextCursor");
+_LIT(KCmdSetOwningWindowGroup,					"SetOwningWindowGroup");
+_LIT(KCmdDefaultOwningWindow,					"DefaultOwningWindow");
+_LIT(KCmdSetName,								"SetName");
+_LIT(KCmdName,									"Name");
+_LIT(KCmdIdentifier,							"Identifier");
+_LIT(KCmdDisableKeyClick,						"DisableKeyClick");
+_LIT(KCmdEnableScreenChangeEvents,				"EnableScreenChangeEvents");
+_LIT(KCmdDisableScreenChangeEvents,				"DisableScreenChangeEvents");
+_LIT(KCmdSimulatePointerEvent,					"SimulatePointerEvent");
+_LIT(KCmdSetChildGroup,							"SetChildGroup");
+_LIT(KCmdClearChildGroup,						"ClearChildGroup");
+
+///	Logging
+_LIT(KLogError,									"Error=%d");
+_LIT(KLogMissingParameter,						"Missing parameter '%S'");
+_LIT(KLogMissingExpectedValue,					"Missing expected value '%S'");
+_LIT(KLogNotExpectedValueString,				"'%S' is not as expected='%S', actual='%S'");
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataWindowGroup* CT_DataWindowGroup::NewL()
+	{
+	CT_DataWindowGroup*	ret=new (ELeave) CT_DataWindowGroup();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+CT_DataWindowGroup::CT_DataWindowGroup()
+:	CT_DataWindowTreeNode()
+,	iWindowGroup(NULL)
+,	iCaptureKeyHandle(0)
+	{
+	}
+
+void CT_DataWindowGroup::ConstructL()
+	{
+	}
+
+CT_DataWindowGroup::~CT_DataWindowGroup()
+	{
+	DestroyData();
+	}
+
+void CT_DataWindowGroup::SetObjectL(TAny* aAny)
+	{
+	DestroyData();
+	iWindowGroup = static_cast<RWindowGroup*> (aAny);
+	}
+
+void CT_DataWindowGroup::DisownObjectL()
+	{
+	iWindowGroup = NULL;
+	}
+
+void CT_DataWindowGroup::DestroyData()
+	{
+	delete iWindowGroup;
+	iWindowGroup=NULL;
+	}
+
+RWindowTreeNode* CT_DataWindowGroup::GetWindowTreeNode() const
+	{
+	return iWindowGroup;
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataWindowGroup::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	ret = ETrue;
+
+	if ( aCommand==KCmdDestructor )
+		{
+		DoCmdDestructor();
+		}
+	else if ( aCommand==KCmdnew || aCommand==KDataClassname )
+		{
+		DoCmdnewL(aSection);
+		}
+	else if ( aCommand==KCmdConstruct )
+		{
+		DoCmdConstructL(aSection);
+		}
+	else if ( aCommand==KCmdConstructChildApp )
+		{
+		DoCmdConstructChildAppL(aSection);
+		}
+	else if ( aCommand==KCmdAllowProcessToCreateChildWindowGroups )
+		{
+		DoCmdAllowProcessToCreateChildWindowGroups(aSection);
+		}
+	else if ( aCommand==KCmdEnableReceiptOfFocus )
+		{
+		DoCmdEnableReceiptOfFocus(aSection);
+		}
+	else if ( aCommand==KCmdAutoForeground )
+		{
+		DoCmdAutoForeground(aSection);
+		}
+	else if ( aCommand==KCmdSetOrdinalPriorityAdjust )
+		{
+		DoCmdSetOrdinalPriorityAdjust(aSection);
+		}
+	else if ( aCommand==KCmdSetOrdinalPositionErr )
+		{
+		DoCmdSetOrdinalPositionErr(aSection);
+		}
+	else if ( aCommand==KCmdCaptureKey )
+		{
+		DoCmdCaptureKey(aSection);
+		}
+	else if ( aCommand==KCmdCancelCaptureKey )
+		{
+		DoCmdCancelCaptureKey(aSection);
+		}
+	else if ( aCommand==KCmdCaptureKeyUpAndDowns )
+		{
+		DoCmdCaptureKeyUpAndDowns(aSection);
+		}
+	else if ( aCommand==KCmdCancelCaptureKeyUpAndDowns )
+		{
+		DoCmdCancelCaptureKeyUpAndDowns(aSection);
+		}
+	else if ( aCommand==KCmdCaptureLongKey )
+		{
+		DoCmdCaptureLongKey(aSection);
+		}
+	else if ( aCommand==KCmdCancelCaptureLongKey )
+		{
+		DoCmdCancelCaptureLongKey(aSection);
+		}
+	else if ( aCommand==KCmdAddPriorityKey )
+		{
+		DoCmdAddPriorityKey(aSection);
+		}
+	else if ( aCommand==KCmdRemovePriorityKey )
+		{
+		DoCmdRemovePriorityKey(aSection);
+		}
+	else if ( aCommand==KCmdSetTextCursor )
+		{
+		DoCmdSetTextCursorL(aSection);
+		}
+	else if ( aCommand==KCmdCancelTextCursor )
+		{
+		DoCmdCancelTextCursor();
+		}
+	else if ( aCommand==KCmdSetOwningWindowGroup )
+		{
+		DoCmdSetOwningWindowGroupL(aSection);
+		}
+	else if ( aCommand==KCmdDefaultOwningWindow )
+		{
+		DoCmdDefaultOwningWindow();
+		}
+	else if ( aCommand==KCmdSetName )
+		{
+		DoCmdSetName(aSection);
+		}
+	else if ( aCommand==KCmdName )
+		{
+		DoCmdName(aSection);
+		}
+	else if ( aCommand==KCmdIdentifier )
+		{
+		DoCmdIdentifier();
+		}
+	else if ( aCommand==KCmdDisableKeyClick )
+		{
+		DoCmdDisableKeyClick(aSection);
+		}
+	else if ( aCommand==KCmdEnableScreenChangeEvents )
+		{
+		DoCmdEnableScreenChangeEvents();
+		}
+	else if ( aCommand==KCmdDisableScreenChangeEvents )
+		{
+		DoCmdDisableScreenChangeEvents();
+		}
+	else if ( aCommand==KCmdSimulatePointerEvent )
+		{
+		DoCmdSimulatePointerEvent(aSection);
+		}
+	else if ( aCommand==KCmdSetChildGroup )
+		{
+		DoCmdSetChildGroupL(aSection);
+		}
+	else if ( aCommand==KCmdClearChildGroup )
+		{
+		DoCmdClearChildGroup();
+		}
+	else
+		{
+		ret=CT_DataWindowTreeNode::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+
+	return ret;
+	}
+
+
+void CT_DataWindowGroup::DoCmdnewL(const TDesC& aSection)
+	{
+	DestroyData();
+
+	// Get test data for command input parameter(s)
+	TPtrC	wsName;
+	RWsSession* ws=NULL;
+	if ( GetStringFromConfig(aSection, KFldWs, wsName) )
+		{
+		ws = static_cast<RWsSession*>(GetDataObjectL(wsName));
+		}
+
+	TInt	err=KErrNone;
+	if ( ws!=NULL )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute new RWindowGroup(RWsSession)"));
+		TRAP( err, iWindowGroup = new (ELeave) RWindowGroup(*ws));
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute new RWindowGroup()"));
+		TRAP( err, iWindowGroup = new (ELeave) RWindowGroup());
+		}
+
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+
+void CT_DataWindowGroup::DoCmdDestructor()
+	{
+	DestroyData();
+	}
+
+
+void CT_DataWindowGroup::DoCmdConstructL(const TDesC& aSection)
+	{
+	TInt	returnCode=KErrNone;
+
+	// Get test data for command input parameter(s)
+	TInt	datClientHandle;
+	TBool	hasClientHandle = GetIntFromConfig(aSection, KFldClientHandle, datClientHandle);
+	if ( !hasClientHandle )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldClientHandle);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		TBool	datIsFocusable;
+		TBool	hasIsFocusable = GetBoolFromConfig(aSection, KFldIsFocusable, datIsFocusable);
+
+#if defined(SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS)
+		CWsScreenDevice*	screenDevice=NULL;
+		// Execute command and log parameters
+		if ( CT_GraphicsUtil::GetWsScreenDeviceL(*this, aSection, KFldScreenDevice, screenDevice) )
+			{
+			if ( hasIsFocusable )
+				{
+				INFO_PRINTF1(_L("execute Construct(TUint32, TBool, CWsScreenDevice)"));
+				returnCode = iWindowGroup->Construct(datClientHandle, datIsFocusable, screenDevice);
+				}
+			else
+				{
+				INFO_PRINTF1(_L("execute Construct(TUint32, CWsScreenDevice)"));
+				returnCode = iWindowGroup->Construct(datClientHandle, screenDevice);
+				}
+			}
+		else
+#endif
+			{
+			if ( hasIsFocusable )
+				{
+				INFO_PRINTF1(_L("execute Construct(TUint32, TBool)"));
+				returnCode = iWindowGroup->Construct(datClientHandle, datIsFocusable);
+				}
+			else
+				{
+				INFO_PRINTF1(_L("execute Construct(TUint32)"));
+				returnCode = iWindowGroup->Construct(datClientHandle);
+				}
+			}
+		}
+
+	// Check the command return code, if !=KErrNone then stop this command
+	if ( returnCode!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, returnCode);
+		SetError(returnCode);
+		}
+
+	// No command output parameter to display and check
+	}
+
+
+void CT_DataWindowGroup::DoCmdConstructChildAppL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+	TInt	returnCode=KErrNone;
+
+	// Get test data for command input parameter(s)
+	TInt	datIdOfParentWindowGroup;
+	if ( !GetIntFromConfig(aSection, KFldIdOfParentWindowGroup, datIdOfParentWindowGroup) )
+		{
+		CDataWrapperBase*	wrapper=NULL;
+		TPtrC	objectName;
+		if ( GetStringFromConfig(aSection, KFldIdOfParentWindowGroup(), objectName) )
+			{
+			wrapper=static_cast<CDataWrapperBase*>(GetDataWrapperL(objectName));
+
+			}
+		
+		if ( wrapper==NULL )
+			{
+			dataOk=EFalse;
+			ERR_PRINTF2(KLogMissingParameter, &KFldIdOfParentWindowGroup);
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			datIdOfParentWindowGroup = wrapper->GetIdentifier();
+			}
+		}
+
+	TInt	datClientHandle;
+	if ( !GetIntFromConfig(aSection, KFldClientHandle, datClientHandle) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldClientHandle);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		TBool	datIsFocusable;
+		if ( GetBoolFromConfig(aSection, KFldIsFocusable, datIsFocusable) )
+			{
+			// Execute command and log parameters
+			INFO_PRINTF1(_L("execute ConstructChildApp(TInt, TUint32, TBool)"));
+			returnCode = iWindowGroup->ConstructChildApp(datIdOfParentWindowGroup, datClientHandle, datIsFocusable);
+			}
+		else
+			{
+			// Execute command and log parameters
+			INFO_PRINTF1(_L("execute ConstructChildApp(TInt, TUint32)"));
+			returnCode = iWindowGroup->ConstructChildApp(datIdOfParentWindowGroup, datClientHandle);
+			}
+
+		// Check the command return code, if !=KErrNone then stop this command
+		if ( returnCode!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, returnCode);
+			SetError(returnCode);
+			}
+
+		// No command output parameter to display and check
+		}
+	}
+
+
+void CT_DataWindowGroup::DoCmdAllowProcessToCreateChildWindowGroups(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TInt	datProcess;
+	if ( !GetIntFromConfig(aSection, KFldProcessSID, datProcess) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldProcessSID);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute AllowProcessToCreateChildWindowGroups(TUid)"));
+		iWindowGroup->AllowProcessToCreateChildWindowGroups(TUid::Uid(datProcess));
+		}
+
+	// No command return value and output parameter to display and check
+	}
+
+
+void CT_DataWindowGroup::DoCmdEnableReceiptOfFocus(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TBool	datState;
+	if ( !GetBoolFromConfig(aSection, KFldState, datState) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldState);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute EnableReceiptOfFocus(TBool)"));
+		iWindowGroup->EnableReceiptOfFocus(datState);
+		}
+
+	// No command return value and output parameter to display and check
+	}
+
+
+void CT_DataWindowGroup::DoCmdAutoForeground(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TBool	datState;
+	if ( !GetBoolFromConfig(aSection, KFldState, datState) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldState);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute AutoForeground(TBool)"));
+		iWindowGroup->AutoForeground(datState);
+		}
+
+	// No command return value and output parameter to display and check
+	}
+
+
+void CT_DataWindowGroup::DoCmdSetOrdinalPriorityAdjust(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TInt	datAdjust;
+	if ( !GetIntFromConfig(aSection, KFldAdjust, datAdjust) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldAdjust);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetOrdinalPriorityAdjust(TInt)"));
+		iWindowGroup->SetOrdinalPriorityAdjust(datAdjust);
+		}
+
+	// No command return value and output parameter to display and check
+	}
+
+
+void CT_DataWindowGroup::DoCmdSetOrdinalPositionErr(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TInt	datPos;
+	if ( !GetIntFromConfig(aSection, KFldPos, datPos) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldPos);
+		SetBlockResult(EFail);
+		}
+
+	TInt	datOrdinalPriority;
+	if ( !GetIntFromConfig(aSection, KFldOrdinalPriority, datOrdinalPriority) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldOrdinalPriority);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetOrdinalPositionErr(TInt, TInt)"));
+		TInt	returnCode = iWindowGroup->SetOrdinalPositionErr(datPos, datOrdinalPriority);
+
+		// Check the command return code, if !=KErrNone then stop this command
+		if ( returnCode!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, returnCode);
+			SetError(returnCode);
+			}
+
+		// No command output parameter to display and check
+		}
+	}
+
+void CT_DataWindowGroup::DoCmdCaptureKey(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	TKeyCode	keyCode;
+	if ( !CT_GraphicsUtil::ReadKeyCode(*this, aSection, KFldKeycode, keyCode) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldKeycode);
+		SetBlockResult(EFail);
+		}
+
+	TUint	modifierMask;
+	if ( !CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldModifierMask, modifierMask) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldModifierMask);
+		SetBlockResult(EFail);
+		}
+
+	TUint	modifier;
+	if ( !CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldModifier, modifier) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldModifier);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		TInt	ret=KErrNone;
+		TInt	priority;
+		if ( GetIntFromConfig(aSection, KFldPriority, priority) )
+			{
+			INFO_PRINTF1(_L("execute CaptureKey(keyCode, modifierMask, modifier, priority)"));
+			ret=iWindowGroup->CaptureKey(keyCode, modifierMask, modifier, priority);
+			}
+		else
+			{
+			INFO_PRINTF1(_L("execute CaptureKey(keyCode, modifierMask, modifier)"));
+			ret=iWindowGroup->CaptureKey(keyCode, modifierMask, modifier);
+			}
+		if ( ret<KErrNone )
+			{
+			ERR_PRINTF2(KLogError, ret);
+			SetError(ret);
+			}
+		iCaptureKeyHandle=ret;
+		}
+	}
+
+
+void CT_DataWindowGroup::DoCmdCancelCaptureKey(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TInt	captureKey;
+	if ( !GetIntFromConfig(aSection, KFldCaptureKey, captureKey) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldCaptureKey);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute CancelCaptureKey(captureKey)"));
+		if ( captureKey == -1 )
+			{
+			iWindowGroup->CancelCaptureKey(iCaptureKeyHandle);
+			}
+		else
+			{
+			iWindowGroup->CancelCaptureKey(captureKey);
+			}
+		}
+	}
+
+
+void CT_DataWindowGroup::DoCmdCaptureKeyUpAndDowns(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	TUint	scanCode;
+	if ( !CT_GraphicsUtil::ReadStdScanCode(*this, aSection, KFldScanCode, (TStdScanCode&)scanCode) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldScanCode);
+		SetBlockResult(EFail);
+		}
+
+	TUint	modifierMask;
+	if ( !CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldModifierMask, modifierMask) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldModifierMask);
+		SetBlockResult(EFail);
+		}
+
+	TUint	modifier;
+	if ( !CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldModifier, modifier) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldModifier);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		TInt	ret=KErrNone;
+		TInt	priority;
+		if ( !GetIntFromConfig(aSection, KFldPriority, priority) )
+			{
+			INFO_PRINTF1(_L("execute CaptureKeyUpAndDowns(TUint, TUint, TUint)"));
+			ret=iWindowGroup->CaptureKeyUpAndDowns(scanCode, modifierMask, modifier);
+			}
+		else
+			{
+			INFO_PRINTF1(_L("execute CaptureKeyUpAndDowns(TUint, TUint, TUint, TInt)"));
+			ret=iWindowGroup->CaptureKeyUpAndDowns(scanCode, modifierMask, modifier, priority);
+			}
+
+		if ( ret < KErrNone )
+			{
+			ERR_PRINTF2(KLogError, ret);
+			SetError(ret);
+			} 
+		else
+			{
+			iCaptureKeyHandle=ret;
+			}
+		}
+	}
+
+
+void CT_DataWindowGroup::DoCmdCancelCaptureKeyUpAndDowns(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TInt	captureKey;
+	if ( !GetIntFromConfig(aSection, KFldCaptureKey, captureKey) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldCaptureKey);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute CancelCaptureKeyUpAndDowns(captureKey)"));
+		if ( captureKey == -1 )
+			{
+			iWindowGroup->CancelCaptureKeyUpAndDowns(iCaptureKeyHandle);
+			}
+		else
+			{
+			iWindowGroup->CancelCaptureKeyUpAndDowns(captureKey);
+			}
+		}
+	}
+
+
+void CT_DataWindowGroup::DoCmdCaptureLongKey(const TDesC& aSection)
+	{
+	TBool			dataOk=ETrue;
+
+	TKeyCode	inputKeyCode;
+	if ( !CT_GraphicsUtil::ReadKeyCode(*this, aSection, KFldInputKeyCode, inputKeyCode) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldInputKeyCode);
+		SetBlockResult(EFail);
+		}
+
+	TKeyCode	outputKeyCode;
+	if ( !CT_GraphicsUtil::ReadKeyCode(*this, aSection, KFldOutputKeyCode, outputKeyCode) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldOutputKeyCode);
+		SetBlockResult(EFail);
+		}
+
+	TUint	modifierMask;
+	if ( !CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldModifierMask, modifierMask) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldModifierMask);
+		SetBlockResult(EFail);
+		}
+
+	TUint	modifier;
+	if ( !CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldModifier, modifier) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldModifier);
+		SetBlockResult(EFail);
+		}
+
+	TInt	priority;
+	if ( !GetIntFromConfig(aSection, KFldPriority, priority) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldPriority);
+		SetBlockResult(EFail);
+		}
+
+	TLongCaptureFlags	flags;
+	if ( !CT_GraphicsUtil::ReadLongCaptureFlags(*this, aSection, KFldFlags, flags) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFlags);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		TInt	ret=KErrNone;
+		TInt	repeatTime;
+		if ( GetIntFromConfig(aSection, KFldRepeatTime, repeatTime) )
+			{
+			TTimeIntervalMicroSeconds32	theRepeatTime(repeatTime);
+
+			// Execute command and log parameters
+			INFO_PRINTF1(_L("execute CaptureLongKey(repeatTime, inputKeyCode, iutputKeyCode, modifierMask, modifier, priority, flags)"));
+			ret=iWindowGroup->CaptureLongKey(theRepeatTime, inputKeyCode, outputKeyCode, modifierMask, modifier, priority, flags);
+			}
+		else
+			{
+			// Execute command and log parameters
+			INFO_PRINTF1(_L("execute CaptureLongKey(inputKeyCode, outputKeyCode, modifierMask, modifier, priority, flags)"));
+			ret=iWindowGroup->CaptureLongKey(inputKeyCode, outputKeyCode, modifierMask, modifier, priority, flags);
+			}
+
+		// Check the command return code, if !=KErrNone then stop this command
+		if ( ret<KErrNone )
+			{
+			ERR_PRINTF2(KLogError, ret);
+			SetError(ret);
+			}
+		iCaptureKeyHandle=ret;
+		}
+	}
+
+
+void CT_DataWindowGroup::DoCmdCancelCaptureLongKey(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TInt	captureKey;
+	if ( !GetIntFromConfig(aSection, KFldCaptureKey, captureKey) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldCaptureKey);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute CancelCaptureLongKey(captureKey)"));
+		if ( captureKey == -1 )
+			{
+			iWindowGroup->CancelCaptureLongKey(iCaptureKeyHandle);
+			}
+		else
+			{
+			iWindowGroup->CancelCaptureLongKey(captureKey);
+			}
+		}
+	}
+
+
+void CT_DataWindowGroup::DoCmdAddPriorityKey(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TKeyCode	keyCode;
+	if ( !CT_GraphicsUtil::ReadKeyCode(*this, aSection, KFldKeycode, keyCode) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldKeycode);
+		SetBlockResult(EFail);
+		}
+
+	TUint	modifierMask;
+	if ( !CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldModifierMask, modifierMask) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldModifierMask);
+		SetBlockResult(EFail);
+		}
+
+	TUint	modifier;
+	if ( !CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldModifier, modifier) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldModifier);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute AddPriorityKey(TUint, TUint, TUint)"));
+		TInt	ret=iWindowGroup->AddPriorityKey(keyCode, modifierMask, modifier);
+
+		// Check the command return code, if <KErrNone then stop this command
+		if ( ret!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, ret);
+			SetError(ret);
+			}
+		}
+	}
+
+
+void CT_DataWindowGroup::DoCmdRemovePriorityKey(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TKeyCode	keyCode;
+	if ( !CT_GraphicsUtil::ReadKeyCode(*this, aSection, KFldKeycode, keyCode) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldKeycode);
+		SetBlockResult(EFail);
+		}
+
+	TUint	modifierMask;
+	if ( !CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldModifierMask, modifierMask) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldModifierMask);
+		SetBlockResult(EFail);
+		}
+
+	TUint	modifier;
+	if ( !CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldModifier, modifier) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldModifier);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute RemovePriorityKey(TUint, TUint, TUint)"));
+		iWindowGroup->RemovePriorityKey(keyCode, modifierMask, modifier);
+		}
+	}
+
+
+void CT_DataWindowGroup::DoCmdSetTextCursorL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	TPtrC	datWinName;
+	RWindowBase*	win = NULL;
+	if ( !GetStringFromConfig(aSection, KFldWin, datWinName) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldWin);
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+	else
+		{
+		win = static_cast<RWindowBase*>(GetDataObjectL(datWinName));
+		}
+
+	TPoint	datPos;
+	if ( !GetPointFromConfig(aSection, KFldPos, datPos) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldPos);
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+
+	TTextCursor	datCursor;
+	if ( !CT_GraphicsUtil::GetTextCursor(*this, aSection, KFldCursor, datCursor) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldCursor);
+		SetBlockResult(EFail);
+		dataOk=EFalse;
+		}
+
+	if ( dataOk )
+		{
+		// get rectangle top left x-coordinate from parameters
+		TRect	datClipRect;
+		if ( GetRectFromConfig(aSection, KFldClipRect, datClipRect) )
+			{
+			INFO_PRINTF1(_L("execute SetTextCursor(RWindowBase, const TPoint, const TTextCursor, const TRect)"));
+			iWindowGroup->SetTextCursor(*win, datPos, datCursor, datClipRect);
+			}
+		else
+			{
+			INFO_PRINTF1(_L("execute SetTextCursor(RWindowBase, const TPoint, const TTextCursor)"));
+			iWindowGroup->SetTextCursor(*win, datPos, datCursor);
+			}
+		}
+	}
+
+
+void CT_DataWindowGroup::DoCmdCancelTextCursor()
+	{
+	INFO_PRINTF1(_L("RWindowGroup::CancelTextCursor() call"));
+	iWindowGroup->CancelTextCursor();
+	}
+
+
+void CT_DataWindowGroup::DoCmdSetOwningWindowGroupL(const TDesC& aSection)
+	{
+	TInt	winGroupId=0;
+	TBool	hasWGIdentifier=ETrue;
+
+	if ( !GetIntFromConfig(aSection, KOwningWGIdentifier(), winGroupId) )
+		{
+
+		CDataWrapperBase*	wrapper=NULL;
+		TPtrC	objectName;
+		if ( GetStringFromConfig(aSection, KOwningWGIdName(), objectName) )
+			{
+			wrapper=static_cast<CDataWrapperBase*>(GetDataWrapperL(objectName));
+			}
+			
+		if ( wrapper!=NULL )
+			{
+			winGroupId = wrapper->GetIdentifier();
+			
+			INFO_PRINTF2(_L("get id:%d"), winGroupId);
+			}
+		else
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KOwningWGIdentifier);
+			SetBlockResult(EFail);
+			hasWGIdentifier = EFalse;
+			}
+		}
+
+	if ( !hasWGIdentifier )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KOwningWGIdentifier);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute SetOwningWindowGroup(TInt)"));
+		iWindowGroup->SetOwningWindowGroup(winGroupId);
+		}
+	}
+
+
+void CT_DataWindowGroup::DoCmdDefaultOwningWindow()
+	{
+	INFO_PRINTF1(_L("execute DefaultOwningWindow()"));
+	iWindowGroup->DefaultOwningWindow();
+	}
+
+
+void CT_DataWindowGroup::DoCmdSetName(const TDesC& aSection)
+	{
+	TPtrC	theNameString;
+
+	if ( !GetStringFromConfig(aSection, KinputWGN(), theNameString) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KinputWGN);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute SetName(const TDesC)"));
+		TInt	err = iWindowGroup->SetName(theNameString);
+
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		}
+	}
+
+void CT_DataWindowGroup::DoCmdName(const TDesC& aSection)
+	{
+	TBuf<KMaxTestExecuteCommandLength>	storeBuffer;
+
+	INFO_PRINTF1(_L("execute Name(TDes&)"));
+	TInt	err = iWindowGroup->Name(storeBuffer);
+
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	else
+		{
+		INFO_PRINTF2(_L("the length of  name:%d"), storeBuffer.Length());
+		INFO_PRINTF1(_L("the name of window group:"));
+		INFO_PRINTF1(storeBuffer);
+
+		TPtrC	returnWGName;
+		if ( !GetStringFromConfig(aSection, KexpectedReturnWGN(), returnWGName) )
+			{
+			ERR_PRINTF2(KLogMissingExpectedValue, &KexpectedReturnWGN());
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			if (storeBuffer!=returnWGName)
+				{
+				ERR_PRINTF4(KLogNotExpectedValueString, &KexpectedReturnWGN, &returnWGName, &storeBuffer);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+
+void CT_DataWindowGroup::DoCmdIdentifier()
+	{
+	INFO_PRINTF1(_L("execute Identifier()"));
+	TInt	actualWGId=iWindowGroup->Identifier();
+	INFO_PRINTF2(_L("Identifier:%d"),actualWGId);
+	SetIdentifier(actualWGId);
+	}
+
+
+void CT_DataWindowGroup::DoCmdDisableKeyClick(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TBool	datState;
+	if ( !GetBoolFromConfig(aSection, KFldState, datState) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldState);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute DisableKeyClick(TBool)"));
+		iWindowGroup->DisableKeyClick(datState);
+		}
+
+	// No command return value and output parameter to display and check
+	}
+
+
+void CT_DataWindowGroup::DoCmdEnableScreenChangeEvents()
+	{
+	INFO_PRINTF1(_L("execute EnableScreenChangeEvents()"));
+	TInt err = iWindowGroup->EnableScreenChangeEvents();
+
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+
+void CT_DataWindowGroup::DoCmdDisableScreenChangeEvents()
+	{
+	INFO_PRINTF1(_L("execute DisableScreenChangeEvents()"));
+	iWindowGroup->DisableScreenChangeEvents();
+	}
+
+
+void CT_DataWindowGroup::DoCmdSimulatePointerEvent(const TDesC& aSection)
+	{
+	TBool		dataOk=ETrue;
+	TRawEvent	event;
+
+	TRawEvent::TType	type=TRawEvent::ENone;
+	if ( !CT_GraphicsUtil::ReadType(*this, aSection, KFldType(), type) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldType());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		event.Set(type);
+		}
+
+	TStdScanCode	stdScanCode;
+	if ( CT_GraphicsUtil::ReadStdScanCode(*this, aSection, KFldStdScanCode(), stdScanCode) )
+		{
+		event.Set(type, stdScanCode);
+		}
+
+	TInt	deviceNumber;
+	if ( GetIntFromConfig(aSection, KFldDeviceNumber, deviceNumber) )
+		{
+		event.SetDeviceNumber(deviceNumber);
+		}
+
+	TPoint	pointerPos(0,0);
+	if ( GetPointFromConfig(aSection, KFldPos, pointerPos) )
+		{
+		event.Set(type, pointerPos.iX, pointerPos.iY);
+		}
+
+	TBool	tip;
+	if ( GetBoolFromConfig(aSection, KFldTip, tip) )
+		{
+		event.SetTip(tip);
+		}
+
+	if ( dataOk )
+		{
+		INFO_PRINTF1(_L("execute SimulatePointerEvent(TRawEvent)"));
+		iWindowGroup->SimulatePointerEvent(event);
+		}
+	}
+
+
+void CT_DataWindowGroup::DoCmdSetChildGroupL(const TDesC& aSection)
+	{
+	TBool	dataOk = ETrue;
+
+	TInt	id;
+	if ( !GetIntFromConfig(aSection, KFldID, id) )
+		{
+		CDataWrapperBase*	wrapper=NULL;
+		TPtrC	objectName;
+		if ( GetStringFromConfig(aSection, KFldIDName(), objectName) )
+			{
+			wrapper=static_cast<CDataWrapperBase*>(GetDataWrapperL(objectName));
+			//handle=wrapper->GetHandle();
+			}
+			
+		if ( wrapper!=NULL )
+			{
+			id = wrapper->GetIdentifier();
+			
+			INFO_PRINTF3(_L("get '%S_name' identifier = %d' to set child group"), &KFldID, id);
+			}
+		else
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KFldID);
+			SetBlockResult(EFail);
+			dataOk = EFalse;
+			}
+		}
+
+	if ( dataOk )
+		{
+		INFO_PRINTF1(_L("execute SetChildGroup(TInt)"));
+		TInt	returnCode = iWindowGroup->SetChildGroup(id);
+
+		if ( returnCode!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, returnCode);
+			SetError(returnCode);
+			}
+		}
+	}
+
+void CT_DataWindowGroup::DoCmdClearChildGroup()
+	{
+	INFO_PRINTF1(_L("execute ClearChildGroup()"));
+	TInt	returnCode = iWindowGroup->ClearChildGroup();
+
+	if ( returnCode!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, returnCode);
+		SetError(returnCode);
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataWindowInfo.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,193 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataWindowInfo.h"
+
+/*@{*/
+///	Commands
+_LIT(KCmdnew,									"new");
+_LIT(KCmdDestructor,							"~");
+_LIT(KCmdGetRedrawRegionAndRedrawShadowRegion,	"GetRedrawRegionAndRedrawShadowRegion");
+
+///	Fields
+_LIT(KFldNullExpected,							"nullexpected");
+
+///	Logging
+_LIT(KLogError,									"Error=%d");
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataWindowInfo* CT_DataWindowInfo::NewL()
+/**
+ * Two phase constructor
+ */
+	{
+	CT_DataWindowInfo*	ret=new (ELeave) CT_DataWindowInfo();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+CT_DataWindowInfo::CT_DataWindowInfo()
+/**
+ * Protected constructor. First phase construction
+ */
+:	CDataWrapperBase()
+,	iWindowInfo(NULL)
+,	iRedrawRegion(NULL)
+,	iRedrawShadowRegion(NULL)
+	{
+	}
+
+void CT_DataWindowInfo::ConstructL()
+/**
+ * Second phase construction
+ */
+	{
+	}
+
+CT_DataWindowInfo::~CT_DataWindowInfo()
+/**
+ * Public destructor
+ */
+	{
+	DestroyData();
+	}
+
+TAny* CT_DataWindowInfo::GetObject()
+/**
+ * Return a pointer to the object that the data wraps
+ *
+ * @return pointer to the object that the data wraps
+ */
+	{
+	return iWindowInfo;
+	}
+
+void CT_DataWindowInfo::SetObjectL(TAny* aAny)
+/**
+ * Set the object that the data wraps
+ *
+ * @param	aObject object that the wrapper is testing
+ *
+ */
+	{
+	DestroyData();
+	iWindowInfo = static_cast<TWindowInfo*> (aAny);
+	}
+
+void CT_DataWindowInfo::DisownObjectL()
+/**
+ * The object will no longer be owned by this
+ *
+ * @leave	KErrNotSupported if the the function is not supported
+ */
+	{
+	iWindowInfo = NULL;
+	}
+
+void CT_DataWindowInfo::DestroyData()
+	{
+	delete iWindowInfo;
+	iWindowInfo=NULL;
+	}
+
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataWindowInfo::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool	ret = ETrue;
+
+	if ( aCommand==KCmdDestructor )
+		{
+		DoCmdDestructor();
+		}
+	else if ( aCommand==KCmdnew )
+		{
+		DoCmdnew();
+		}
+	else if ( aCommand==KCmdGetRedrawRegionAndRedrawShadowRegion )
+		{
+		DoCmdGetRedrawRegionAndRedrawShadowRegion(aSection);
+		}
+	else
+		{
+		ret=EFalse;
+		}
+
+	return ret;
+	}
+
+
+void CT_DataWindowInfo::DoCmdnew()
+	{
+	DestroyData();
+
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute new()"));
+	TRAPD(err, iWindowInfo=new (ELeave) TWindowInfo());
+	if ( err != KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+void CT_DataWindowInfo::DoCmdDestructor()
+	{
+	INFO_PRINTF1(_L("execute ~"));
+	DestroyData();
+	}
+
+void CT_DataWindowInfo::DoCmdGetRedrawRegionAndRedrawShadowRegion(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("GetRedrawRegionAndRedrawShadowRegion"));
+	iWindowInfo->GetRedrawRegionAndRedrawShadowRegion(iRedrawRegion, iRedrawShadowRegion);
+
+	TBool	nullExpected;
+	if ( GetBoolFromConfig(aSection, KFldNullExpected(), nullExpected) )
+		{
+		if ( nullExpected )
+			{
+			if ( (iRedrawRegion!=NULL) || (iRedrawShadowRegion!=NULL) )
+				{
+				ERR_PRINTF3(_L("NULL pointers expected. RedrawRegion=0x%x, RedrawShadowRegion=0x%x"), iRedrawRegion, iRedrawShadowRegion);
+				SetBlockResult(EFail);
+				}
+			}
+		else
+			{
+			if ( (iRedrawRegion==NULL) || (iRedrawShadowRegion==NULL) )
+				{
+				ERR_PRINTF3(_L("Non NULL pointers expected. RedrawRegion=0x%x, RedrawShadowRegion=0x%x"), iRedrawRegion, iRedrawShadowRegion);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataWindowTreeNode.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,682 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataWindowTreeNode.h"
+
+
+//Parameters
+_LIT(KObjectName,							"objectName");
+_LIT(KExpected,								"expected");
+_LIT(KInputWindowPosition,					"inputWindowPosition");
+_LIT(KInputWindowPriority,					"inputWindowPriority");
+_LIT(KInputCursorNumber,					"inputCursorNumber");
+_LIT(KInputEventControl,					"inputEventControl");
+_LIT(KInputEventModifier,					"inputEventModifier");
+_LIT(KInputNonFading,						"inputNonFading");
+_LIT(KInputFaded,							"inputFaded");
+_LIT(KInputFadeControl,						"inputFadeControl");
+_LIT(KInputBlackMap,						"inputBlackMap");
+_LIT(KInputWhiteMap,						"inputWhiteMap");
+
+_LIT(KFldPointerCursor,                     "pointerCursor");
+//Commands
+_LIT(KCmdClose,                         	"Close");
+_LIT(KCmdDestroy,                       	"Destroy");
+_LIT(KCmdParent,                        	"Parent");
+_LIT(KCmdPrevSibling,                   	"PrevSibling");
+_LIT(KCmdNextSibling,                   	"NextSibling");
+_LIT(KCmdChild,                         	"Child");
+_LIT(KCmdOrdinalPriority,               	"OrdinalPriority");
+_LIT(KCmdOrdinalPosition,               	"OrdinalPosition");
+_LIT(KCmdFullOrdinalPosition,           	"FullOrdinalPosition");
+_LIT(KCmdSetOrdinalPosition,            	"SetOrdinalPosition");
+_LIT(KCmdWindowGroupId,                 	"WindowGroupId");
+_LIT(KCmdSetPointerCursor,              	"SetPointerCursor");
+_LIT(KCmdSetCustomPointerCursor,        	"SetCustomPointerCursor");
+_LIT(KCmdEnableOnEvents,                	"EnableOnEvents");
+_LIT(KCmdDisableOnEvents,               	"DisableOnEvents");
+_LIT(KCmdEnableGroupChangeEvents,       	"EnableGroupChangeEvents");
+_LIT(KCmdDisableGroupChangeEvents,      	"DisableGroupChangeEvents");
+_LIT(KCmdEnableFocusChangeEvents,       	"EnableFocusChangeEvents");
+_LIT(KCmdDisableFocusChangeEvents,      	"DisableFocusChangeEvents");
+_LIT(KCmdEnableGroupListChangeEvents,   	"EnableGroupListChangeEvents");
+_LIT(KCmdDisableGroupListChangeEvents,  	"DisableGroupListChangeEvents");
+_LIT(KCmdEnableVisibilityChangeEvents,  	"EnableVisibilityChangeEvents");
+_LIT(KCmdDisableVisibilityChangeEvents, 	"DisableVisibilityChangeEvents");
+_LIT(KCmdEnableErrorMessages,           	"EnableErrorMessages");
+_LIT(KCmdDisableErrorMessages,          	"DisableErrorMessages");
+_LIT(KCmdEnableModifierChangedEvents,   	"EnableModifierChangedEvents");
+_LIT(KCmdDisableModifierChangedEvents,  	"DisableModifierChangedEvents");
+_LIT(KCmdSetNonFading,                  	"SetNonFading");
+_LIT(KCmdSetFaded,                      	"SetFaded");
+_LIT(KCmdClearPointerCursor,            	"ClearPointerCursor");
+
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataWindowTreeNode::CT_DataWindowTreeNode()
+:    CDataWrapperBase()
+	{
+	}
+
+MWsClientClass* CT_DataWindowTreeNode::GetClientClass() const
+	{
+	return GetWindowTreeNode();
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataWindowTreeNode::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool    ret = ETrue;
+
+	if ( aCommand==KCmdClose )
+		{
+		DoCmdClose();
+		}
+	else if ( aCommand==KCmdDestroy )
+		{
+		DoCmdDestroyL();
+		}
+	else if ( aCommand==KCmdParent )
+		{
+		DoCmdParent(aSection);
+		}
+	else if ( aCommand==KCmdPrevSibling )
+		{
+		DoCmdPrevSibling(aSection);
+		}
+	else if ( aCommand==KCmdNextSibling )
+		{
+		DoCmdNextSibling(aSection);
+		}
+	else if ( aCommand==KCmdChild )
+		{
+		DoCmdChild(aSection);
+		}
+	else if ( aCommand==KCmdOrdinalPriority )
+		{
+		DoCmdOrdinalPriority(aSection);
+		}
+	else if ( aCommand==KCmdOrdinalPosition )
+		{
+		DoCmdOrdinalPosition(aSection);
+		}
+	else if ( aCommand==KCmdFullOrdinalPosition )
+		{
+		DoCmdFullOrdinalPosition(aSection);
+		}
+	else if ( aCommand==KCmdSetOrdinalPosition )
+		{
+		DoCmdSetOrdinalPosition(aSection);
+		}
+	else if ( aCommand==KCmdWindowGroupId )
+		{
+		DoCmdWindowGroupId();
+		}
+	else if ( aCommand==KCmdSetPointerCursor )
+		{
+		DoCmdSetPointerCursor(aSection);
+		}
+	else if (	aCommand==KCmdSetCustomPointerCursor )
+		{
+		DoCmdSetCustomPointerCursorL(aSection);
+		}
+	else if ( aCommand==KCmdEnableOnEvents )
+		{
+		DoCmdEnableOnEvents(aSection);
+		}
+	else if ( aCommand==KCmdDisableOnEvents )
+		{
+		DoCmdDisableOnEvents();
+		}
+	else if ( aCommand==KCmdEnableGroupChangeEvents )
+		{
+		DoCmdEnableGroupChangeEvents();
+		}
+	else if ( aCommand==KCmdDisableGroupChangeEvents )
+		{
+		DoCmdDisableGroupChangeEvents();
+		}
+	else if ( aCommand==KCmdEnableFocusChangeEvents )
+		{
+		DoCmdEnableFocusChangeEvents();
+		}
+	else if ( aCommand==KCmdDisableFocusChangeEvents )
+		{
+		DoCmdDisableFocusChangeEvents();
+		}
+	else if ( aCommand==KCmdEnableGroupListChangeEvents )
+		{
+		DoCmdEnableGroupListChangeEvents();
+		}
+	else if ( aCommand==KCmdDisableGroupListChangeEvents )
+		{
+		DoCmdDisableGroupListChangeEvents();
+		}
+	else if ( aCommand==KCmdEnableVisibilityChangeEvents )
+		{
+		DoCmdEnableVisibilityChangeEvents();
+		}
+	else if ( aCommand==KCmdDisableVisibilityChangeEvents )
+		{
+		DoCmdDisableVisibilityChangeEvents();
+		}
+	else if	( aCommand==KCmdEnableErrorMessages	)
+		{
+		DoCmdEnableErrorMessages(aSection);
+		}
+	else if ( aCommand==KCmdDisableErrorMessages )
+		{
+		DoCmdDisableErrorMessages();
+		}
+	else if ( aCommand==KCmdEnableModifierChangedEvents )
+		{
+		DoCmdEnableModifierChangedEvents(aSection);
+		}
+	else if ( aCommand==KCmdDisableModifierChangedEvents )
+		{
+		DoCmdDisableModifierChangedEvents();
+		}
+	else if ( aCommand==KCmdSetNonFading )
+		{
+		DoCmdSetNonFading(aSection);
+		}
+	else if ( aCommand==KCmdSetFaded )
+		{
+		DoCmdSetFaded(aSection);
+		}
+	else if ( aCommand==KCmdClearPointerCursor )
+		{
+		DoCmdClearPointerCursor();
+		}
+	else
+		{
+		ret=CT_DataWsClientClass::DoCommandL(*this, aCommand, aSection, aAsyncErrorIndex);
+		}
+
+	return ret;
+	}
+
+void CT_DataWindowTreeNode::DoCmdClose()
+	{
+	GetWindowTreeNode()->Close();
+	INFO_PRINTF1(_L("RWindowTreeNode::Close"));
+	}
+
+void CT_DataWindowTreeNode::DoCmdDestroyL()
+	{
+	RWindowTreeNode*	node=GetWindowTreeNode();
+
+	//	We disown the object as Destroy() also deletes it
+	DisownObjectL();
+	INFO_PRINTF1(_L("RWindowTreeNode::Destroy"));
+	node->Destroy();
+	}
+
+void CT_DataWindowTreeNode::DoCmdParent(const TDesC& aSection)
+	{
+	TUint32	actual = GetWindowTreeNode()->Parent();
+	INFO_PRINTF2(_L("RWindowTreeNode::Parent = %d"), actual);
+
+	TInt	expected = 0;
+	if(	GetIntFromConfig(aSection, KExpected(), expected))
+		{
+		if ( actual!=(TUint32)expected )
+			{
+			ERR_PRINTF1(_L("Parent is	not	as expected!"));
+			SetBlockResult(EFail);
+			}
+		}
+	else
+		{
+		ERR_PRINTF2(_L("Missing parameter	%S"), &KExpected());
+		SetBlockResult(EFail);
+		}
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdPrevSibling(const TDesC& aSection)
+	{
+	TUint32	actual = GetWindowTreeNode()->PrevSibling();
+	INFO_PRINTF2(_L("RWindowTreeNode::PrevSibling	= %d"),	actual);
+
+	TInt	expected = 0;
+	if(	GetIntFromConfig(aSection, KExpected(), expected))
+		{
+		if ( actual!=(TUint32)expected )
+			{
+			ERR_PRINTF1(_L("PrevSibling is not as	expected!"));
+			SetBlockResult(EFail);
+			}
+		}
+	else
+		{
+		ERR_PRINTF2(_L("Missing parameter	%S"), &KExpected());
+		SetBlockResult(EFail);
+		}
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdNextSibling(const TDesC& aSection)
+	{
+	TUint32	actual = GetWindowTreeNode()->NextSibling();
+	INFO_PRINTF2(_L("RWindowTreeNode::NextSibling	= %d"),	actual);
+
+	TInt	expected = 0;
+	if(	GetIntFromConfig(aSection, KExpected(), expected))
+		{
+		if ( actual!=(TUint32)expected )
+			{
+			ERR_PRINTF1(_L("NextSibling is not as	expected!"));
+			SetBlockResult(EFail);
+			}
+		}
+	else
+		{
+		ERR_PRINTF2(_L("Missing parameter	%S"), &KExpected());
+		SetBlockResult(EFail);
+		}
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdChild(const TDesC& aSection)
+	{
+	TUint32	actual = GetWindowTreeNode()->Child();
+	INFO_PRINTF2(_L("RWindowTreeNode::Child =	%d"), actual);
+
+	TInt	expected = 0;
+	if(	GetIntFromConfig(aSection, KExpected(), expected))
+		{
+		if ( actual!=(TUint32)expected )
+			{
+			ERR_PRINTF1(_L("Child	is not as expected!"));
+			SetBlockResult(EFail);
+			}
+		}
+	else
+		{
+		ERR_PRINTF2(_L("Missing parameter	%S"), &KExpected());
+		SetBlockResult(EFail);
+		}
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdOrdinalPriority(const TDesC& aSection)
+	{
+	TInt		actual = GetWindowTreeNode()->OrdinalPriority();
+	INFO_PRINTF2(_L("RWindowTreeNode::OrdinalPriority	= %d"),	actual);
+
+	TInt	expected = 0;
+	if(	GetIntFromConfig(aSection, KExpected(), expected))
+		{
+		if(	actual != expected )
+			{
+			ERR_PRINTF1(_L("OrdinalPriority is not as	expected!"));
+			SetBlockResult(EFail);
+			}
+		}
+	else
+		{
+		ERR_PRINTF2(_L("Missing parameter	%S"), &KExpected());
+		SetBlockResult(EFail);
+		}
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdOrdinalPosition(const TDesC& aSection)
+	{
+	TInt		actual = GetWindowTreeNode()->OrdinalPosition();
+	INFO_PRINTF2(_L("RWindowTreeNode::OrdinalPosition	= %d"),	actual);
+
+	TInt	expected = 0;
+	if(	GetIntFromConfig(aSection, KExpected(), expected))
+		{
+		if(	actual != expected )
+			{
+			ERR_PRINTF1(_L("OrdinalPosition is not as	expected!"));
+			SetBlockResult(EFail);
+			}
+		}
+	else
+		{
+		ERR_PRINTF2(_L("Missing parameter	%S"), &KExpected());
+		SetBlockResult(EFail);
+		}
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdFullOrdinalPosition(const TDesC& aSection)
+	{
+	TInt		actual = GetWindowTreeNode()->FullOrdinalPosition();
+	INFO_PRINTF2(_L("RWindowTreeNode::FullOrdinalPosition	= %d"),	actual);
+
+	TInt	expected = 0;
+	if(	GetIntFromConfig(aSection, KExpected(), expected))
+		{
+		if(	actual != expected )
+			{
+			ERR_PRINTF1(_L("FullOrdinalPosition is not as	expected!"));
+			SetBlockResult(EFail);
+			}
+		}
+	else
+		{
+		ERR_PRINTF2(_L("Missing parameter	%S"), &KExpected());
+		SetBlockResult(EFail);
+		}
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdSetOrdinalPosition(const TDesC& aSection)
+	{
+	TInt	inputWindowPosition=0;
+	if(	GetIntFromConfig(aSection, KInputWindowPosition(), inputWindowPosition))
+		{
+		TInt	inputWindowPriority=0;
+		if(	GetIntFromConfig(aSection, KInputWindowPriority(), inputWindowPriority))
+			{
+			GetWindowTreeNode()->SetOrdinalPosition(inputWindowPosition, inputWindowPriority);
+			INFO_PRINTF1(_L("RWindowTreeNode::SetOrdinalPosition (Priority)"));
+			}
+		else
+			{
+			GetWindowTreeNode()->SetOrdinalPosition(inputWindowPosition);
+			INFO_PRINTF1(_L("RWindowTreeNode::SetOrdinalPosition"));
+			}
+		}
+	else
+		{
+		ERR_PRINTF2(_L("Missing parameter	%S"), &KInputWindowPosition());
+		SetBlockResult(EFail);
+		}
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdWindowGroupId()
+	{
+	TInt	actual = GetWindowTreeNode()->WindowGroupId();
+	INFO_PRINTF2(_L("RWindowTreeNode::WindowGroupId =	%d"), actual);
+	SetIdentifier(actual);
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdSetPointerCursor(const TDesC& aSection)
+	{
+	TPointerCursorMode	inputCursorNumber=EPointerCursorNormal;
+ 	if ( CT_GraphicsUtil::ReadPointerCursorMode(*this, aSection, KInputCursorNumber(), inputCursorNumber) )
+		{
+		TInt	err=GetWindowTreeNode()->SetPointerCursor(inputCursorNumber);
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(_L("**** SetPointerCursor failed with error	%d"),	err);
+			SetError(err);
+			}
+
+		INFO_PRINTF1(_L("RWindowTreeNode::SetPointerCursor"));
+		}
+	else
+		{
+		ERR_PRINTF2(_L("Missing parameter	%S"), &KInputCursorNumber());
+		SetBlockResult(EFail);
+		}
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdSetCustomPointerCursorL(const TDesC& aSection)
+	{
+	TPtrC	objectName;
+	if( GetStringFromConfig(aSection, KObjectName(), objectName) )
+		{
+		RWsSession*			wsSession = static_cast<RWsSession*>(GetDataObjectL(objectName));
+		RWsPointerCursor 	pointerCursor(*wsSession);
+		User::LeaveIfError(pointerCursor.Construct(0));
+		CleanupClosePushL(pointerCursor);
+
+		INFO_PRINTF1(_L("RWindowTreeNode::SetCustomPointerCursor"));
+		GetWindowTreeNode()->SetCustomPointerCursor(pointerCursor);
+
+		CleanupStack::PopAndDestroy(&pointerCursor);
+		}
+	else
+		{
+		TPtrC pointerCursorName;
+	
+		if( GetStringFromConfig(aSection, KFldPointerCursor(), pointerCursorName) )
+			{
+			RWsPointerCursor*			pointerCursor = static_cast<RWsPointerCursor*>(GetDataObjectL(pointerCursorName));
+
+			INFO_PRINTF1(_L("RWindowTreeNode::SetCustomPointerCursor"));
+			GetWindowTreeNode()->SetCustomPointerCursor(*pointerCursor);
+			}
+		
+		else
+			{
+			ERR_PRINTF3(_L("Missing parameter %S or %S"), &KFldPointerCursor(),&KObjectName());
+			SetBlockResult(EFail);
+			}
+		}
+	
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdEnableOnEvents(const TDesC& aSection)
+	{
+	TEventControl	eventControl=EEventControlOnlyWithKeyboardFocus;
+	CT_GraphicsUtil::ReadEventControl(*this, aSection, KInputEventControl(), eventControl);
+
+	INFO_PRINTF1(_L("RWindowTreeNode::EnableOnEvents"));
+	TInt	err=GetWindowTreeNode()->EnableOnEvents(eventControl);
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(_L("**** EnableOnEvents failed with error %d"), err);
+		SetError(err);
+		}
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdDisableOnEvents()
+	{
+	INFO_PRINTF1(_L("RWindowTreeNode::DisableOnEvents"));
+	GetWindowTreeNode()->DisableOnEvents();
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdEnableGroupChangeEvents()
+	{
+	INFO_PRINTF1(_L("RWindowTreeNode::EnableGroupChangeEvents"));
+	TInt	err = GetWindowTreeNode()->EnableGroupChangeEvents();
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(_L("**** EnableGroupChangeEvents failed with error %d"),	err);
+		SetError(err);
+		}
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdDisableGroupChangeEvents()
+	{
+	INFO_PRINTF1(_L("RWindowTreeNode::DisableGroupChangeEvents"));
+	GetWindowTreeNode()->DisableGroupChangeEvents();
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdEnableFocusChangeEvents()
+	{
+	INFO_PRINTF1(_L("RWindowTreeNode::EnableFocusChangeEvents"));
+	TInt	err = GetWindowTreeNode()->EnableFocusChangeEvents();
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(_L("**** EnableFocusChangeEvents failed with error %d"),	err);
+		SetError(err);
+		}
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdDisableFocusChangeEvents()
+	{
+	INFO_PRINTF1(_L("RWindowTreeNode::DisableFocusChangeEvents"));
+	GetWindowTreeNode()->DisableFocusChangeEvents();
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdEnableGroupListChangeEvents()
+	{
+	INFO_PRINTF1(_L("RWindowTreeNode::EnableGroupListChangeEvents"));
+	TInt	err = GetWindowTreeNode()->EnableGroupListChangeEvents();
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(_L("**** EnableGroupListChangeEvents failed with error %d"),	err);
+		SetError(err);
+		}
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdDisableGroupListChangeEvents()
+	{
+	INFO_PRINTF1(_L("RWindowTreeNode::DisableGroupListChangeEvents"));
+	GetWindowTreeNode()->DisableGroupListChangeEvents();
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdEnableVisibilityChangeEvents()
+	{
+	INFO_PRINTF1(_L("RWindowTreeNode::EnableVisibilityChangeEvents"));
+	TInt	err = GetWindowTreeNode()->EnableVisibilityChangeEvents();
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(_L("**** EnableVisibilityChangeEvents failed with error %d"),	err);
+		SetError(err);
+		}
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdDisableVisibilityChangeEvents()
+	{
+	INFO_PRINTF1(_L("RWindowTreeNode::DisableVisibilityChangeEvents"));
+	GetWindowTreeNode()->DisableVisibilityChangeEvents();
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdEnableErrorMessages(const TDesC& aSection)
+	{
+	TEventControl	eventControl=EEventControlOnlyWithKeyboardFocus;
+	CT_GraphicsUtil::ReadEventControl(*this, aSection, KInputEventControl(), eventControl);
+
+	INFO_PRINTF1(_L("RWindowTreeNode::EnableErrorMessages"));
+	TInt	err=GetWindowTreeNode()->EnableErrorMessages(eventControl);
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(_L("**** EnableErrorMessages failed with error	%d"),	err);
+		SetError(err);
+		}
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdDisableErrorMessages()
+	{
+	INFO_PRINTF1(_L("RWindowTreeNode::DisableErrorMessages"));
+	GetWindowTreeNode()->DisableErrorMessages();
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdEnableModifierChangedEvents(const TDesC& aSection)
+	{
+	TEventModifier	eventModifier = EModifierAutorepeatable;
+	CT_GraphicsUtil::ReadEventModifier(*this, aSection, KInputEventModifier(), eventModifier);
+
+	TEventControl	eventControl = EEventControlOnlyWithKeyboardFocus;
+	CT_GraphicsUtil::ReadEventControl(*this, aSection, KInputEventControl(), eventControl);
+
+	INFO_PRINTF1(_L("RWindowTreeNode::EnableModifierChangedEvents"));
+	TInt	err=GetWindowTreeNode()->EnableModifierChangedEvents(eventModifier, eventControl);
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(_L("**** EnableModifierChangedEvents failed with error	%d"),	err);
+		SetError(err);
+		}
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdDisableModifierChangedEvents()
+	{
+	INFO_PRINTF1(_L("RWindowTreeNode::DisableModifierChangedEvents"));
+	GetWindowTreeNode()->DisableModifierChangedEvents();
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdSetNonFading(const TDesC& aSection)
+	{
+	TBool	inputNonFading=ETrue;
+	if(	GetBoolFromConfig(aSection, KInputNonFading(), inputNonFading))
+		{
+		INFO_PRINTF1(_L("RWindowTreeNode::SetNonFading"));
+		GetWindowTreeNode()->SetNonFading(inputNonFading);
+		}
+	else
+		{
+		ERR_PRINTF2(_L("Missing parameter %S"), &KInputNonFading());
+		SetBlockResult(EFail);
+		}
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdSetFaded(const TDesC& aSection)
+	{
+	TBool	inputFaded=ETrue;
+	if( !GetBoolFromConfig(aSection, KInputFaded(), inputFaded))
+		{
+		ERR_PRINTF2(_L("Missing parameter %S"), &KInputFaded());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		RWindowTreeNode::TFadeControl	fadeControl=RWindowTreeNode::EFadeIncludeChildren;
+		CT_GraphicsUtil::ReadFadeControl(*this, aSection, KInputFadeControl(), fadeControl);
+
+		TInt	inputBlackMap=0;
+		TInt	inputWhiteMap=255;
+		if( GetIntFromConfig(aSection, KInputBlackMap(), inputBlackMap) &&
+			GetIntFromConfig(aSection, KInputWhiteMap(), inputWhiteMap) )
+			{
+			INFO_PRINTF1(_L("RWindowTreeNode::SetFaded (Map Fading)"));
+			GetWindowTreeNode()->SetFaded(inputFaded, fadeControl, (TUint8) inputBlackMap, (TUint8) inputWhiteMap);
+			}
+		else
+			{
+			INFO_PRINTF1(_L("RWindowTreeNode::SetFaded"));
+			GetWindowTreeNode()->SetFaded(inputFaded, fadeControl);
+			}
+		}
+	}
+
+
+void CT_DataWindowTreeNode::DoCmdClearPointerCursor()
+	{
+	INFO_PRINTF1(_L("RWindowTreeNode::ClearPointerCursor"));
+	GetWindowTreeNode()->ClearPointerCursor();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataWsBitmap.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,351 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataWsBitmap.h"
+#include "T_GraphicsUtil.h"
+
+/*@{*/
+_LIT(KDataClassname, "CWsBitmap");
+
+//Commands
+_LIT(KCmdnew,						"new");
+_LIT(KCmdDestructor,				"~CWsBitmap");
+_LIT(KCmdDestructorGeneral,			"~");
+_LIT(KCmdCreate,					"Create");
+_LIT(KCmdDuplicate,					"Duplicate");
+_LIT(KCmdLoad,						"Load");
+_LIT(KCmdInternalizeL,				"InternalizeL");
+_LIT(KCmdReset,						"Reset");
+
+// Fields
+_LIT(KFldDispMode,					"dispmode");
+_LIT(KFldFileName,					"filename");
+_LIT(KFldHandle,					"handle");
+_LIT(KFldHandle_Name,				"handle_name");
+_LIT(KFldId,						"id");
+_LIT(KFldShareIfLoaded,				"shareifloaded");
+_LIT(KFldSizeInPixels,				"sizeinpixels");
+_LIT(KFldUseClosedStream,			"use_closed_stream");
+_LIT(KFldWs,						"ws");
+
+///	Logging
+_LIT(KLogError,						"Error=%d");
+_LIT(KLogMissingParameter,			"Missing parameter '%S'");
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataWsBitmap* CT_DataWsBitmap::NewL()
+	{
+	CT_DataWsBitmap*	ret=new (ELeave) CT_DataWsBitmap();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+CT_DataWsBitmap::CT_DataWsBitmap()
+:	CT_DataFbsBitmap()
+,	iWsBitmap(NULL)
+	{
+	}
+
+void CT_DataWsBitmap::ConstructL()
+	{
+	CT_DataFbsBitmap::ConstructL();
+	}
+
+CT_DataWsBitmap::~CT_DataWsBitmap()
+	{
+	DestroyData();
+	}
+
+void CT_DataWsBitmap::SetObjectL(TAny* aAny)
+	{
+	DestroyData();
+	iWsBitmap = static_cast<CWsBitmap*> (aAny);
+	}
+
+void CT_DataWsBitmap::DestroyData()
+	{
+	delete iWsBitmap;
+	iWsBitmap=NULL;
+	}
+
+void CT_DataWsBitmap::DisownObjectL()
+	{
+	iWsBitmap = NULL;
+	}
+
+MWsClientClass* CT_DataWsBitmap::GetClientClass() const
+	{
+	return iWsBitmap;
+	}
+
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataWsBitmap::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	ret = ETrue;
+
+	if ( aCommand==KCmdDestructor || aCommand==KCmdDestructorGeneral )
+		{
+		DoCmdDestructor();
+		}
+	else if ( aCommand==KCmdnew || aCommand==KDataClassname )
+		{
+		DoCmdnewL(aSection);
+		}
+	else if ( aCommand==KCmdCreate )
+		{
+		DoCmdCreate(aSection);
+		}
+	else if ( aCommand==KCmdDuplicate )
+		{
+		DoCmdDuplicateL(aSection);
+		}
+	else if ( aCommand==KCmdLoad )
+		{
+		DoCmdLoad(aSection);
+		}
+	else if ( aCommand==KCmdInternalizeL )
+		{
+		DoCmdInternalizeL(aSection);
+		}
+	else if ( aCommand==KCmdReset )
+		{
+		DoCmdReset();
+		}
+	else if ( !CT_DataWsClientClass::DoCommandL(*this, aCommand, aSection, aAsyncErrorIndex) )
+		{
+		CT_DataFbsBitmap::SetObjectL(iWsBitmap);
+		ret = CT_DataFbsBitmap::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		CT_DataFbsBitmap::DisownObjectL();
+		}
+
+	return ret;
+	}
+
+
+void CT_DataWsBitmap::DoCmdnewL(const TDesC& aSection)
+	{
+	DestroyData();
+
+	// Get test data for command input parameter(s)
+	TPtrC	wsName;
+	RWsSession* ws=NULL;
+	if ( GetStringFromConfig(aSection, KFldWs, wsName) )
+		{
+		ws = static_cast<RWsSession*>(GetDataObjectL(wsName));
+		}
+
+	TInt	err=KErrNone;
+	if ( ws!=NULL )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute new CWsBitmap(RWsSession)"));
+		TRAP( err, iWsBitmap = new (ELeave) CWsBitmap(*ws));
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute new CWsBitmap()"));
+		TRAP( err, iWsBitmap = new (ELeave) CWsBitmap());
+		}
+
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+
+void CT_DataWsBitmap::DoCmdDestructor()
+	{
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute ~CWsBitmap()"));
+	delete iWsBitmap;
+	iWsBitmap=NULL;
+	}
+
+
+void CT_DataWsBitmap::DoCmdCreate(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TSize	datSizeInPixels;
+	if ( !GetSizeFromConfig(aSection, KFldSizeInPixels, datSizeInPixels) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldSizeInPixels);
+		SetBlockResult(EFail);
+		}
+
+	TDisplayMode	datDispMode;
+	if ( !CT_GraphicsUtil::ReadDisplayMode(*this, aSection, KFldDispMode, datDispMode) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldDispMode);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute Create(TSize, TDisplayMode)"));
+		TInt	returnCode = iWsBitmap->Create	(datSizeInPixels, datDispMode);
+
+		// Check the command return code, if !=KErrNone then stop this command
+		if ( returnCode!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, returnCode);
+			SetError(returnCode);
+			}
+		}
+	}
+
+
+void CT_DataWsBitmap::DoCmdDuplicateL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CFbsBitmap::Duplicate()"));
+	TInt	handle=GetHandle();
+	TPtrC	objectName;
+	if ( GetStringFromConfig(aSection, KFldHandle_Name(), objectName) )
+		{
+		CDataWrapperBase*	wrapper=static_cast<CDataWrapperBase*>(GetDataWrapperL(objectName));
+		handle=wrapper->GetHandle();
+		}
+	else
+		{
+		GetIntFromConfig(aSection, KFldHandle(), handle);
+		}
+
+	// call Duplicate()
+	TInt	err = iWsBitmap->Duplicate(handle);
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(_L("Duplicate error: %d"), err);
+		SetError(err);
+		}
+	}
+
+
+void CT_DataWsBitmap::DoCmdLoad(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TPtrC	datFileName;
+	if ( !GetStringFromConfig(aSection, KFldFileName, datFileName) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFileName);
+		SetBlockResult(EFail);
+		}
+
+	TInt	datId;
+	if ( !GetIntFromConfig(aSection, KFldId, datId) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldId);
+		SetBlockResult(EFail);
+		}
+
+	TBool	datShareIfLoaded;
+	if ( !GetBoolFromConfig(aSection, KFldShareIfLoaded, datShareIfLoaded) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldShareIfLoaded);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute Load(TDesC, TInt32, TBool)"));
+		TInt	returnCode = iWsBitmap->Load(datFileName, datId, datShareIfLoaded);
+
+		// Check the command return code, if !=KErrNone then stop this command
+		if ( returnCode!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, returnCode);
+			SetError(returnCode);
+			}
+		}
+	}
+
+
+void CT_DataWsBitmap::DoCmdInternalizeL(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TBool	datUseClosedStream=EFalse;
+	GetBoolFromConfig(aSection, KFldUseClosedStream, datUseClosedStream);
+
+	TPtrC	datFileName;
+	if ( !GetStringFromConfig(aSection, KFldFileName, datFileName) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldUseClosedStream);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		CDirectFileStore*	readstore = CDirectFileStore::OpenL(FileServer(), datFileName, EFileStream | EFileRead);
+		CleanupStack::PushL(readstore);
+		TInt				popCount=1;
+
+		TStreamId			headerid = readstore->Root();
+		RStoreReadStream	readstrm;
+		if ( !datUseClosedStream )
+			{
+			readstrm.OpenL(*readstore, headerid);
+			CleanupClosePushL(readstrm);
+			popCount=2;
+			}
+
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute InternalizeL(RReadStream)"));
+		TRAPD(err, iWsBitmap->InternalizeL(readstrm));
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+
+		// Cleanup
+		CleanupStack::PopAndDestroy(popCount, readstore);
+		}
+	}
+
+
+void CT_DataWsBitmap::DoCmdReset()
+	{
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute Reset()"));
+	iWsBitmap->Reset();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataWsClientClass.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataWsClientClass.h"
+
+/*@{*/
+//Commands
+_LIT(KCmdWsHandle,					"WsHandle");
+
+// Fields
+_LIT(KFldExpected,					"expected");
+_LIT(KFldExpectNot,					"expectnot");
+
+///	Logging
+_LIT(KLogNotExpectedValueInt,		"'%S' is not as expected=%d, actual=%d");
+_LIT(KLogAsExpectedValueInt,		"actual value as '%S'=%d");
+/*@}*/
+
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataWsClientClass::DoCommandL(CDataWrapperBase& aDataWrapper, const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool	ret = ETrue;
+
+	if ( aCommand==KCmdWsHandle )
+		{
+		DoCmdWsHandle(aDataWrapper, aSection);
+		}
+	else
+		{
+		ret=EFalse;
+		}
+
+	return ret;
+	}
+
+
+void CT_DataWsClientClass::DoCmdWsHandle(CDataWrapperBase& aDataWrapper, const TDesC& aSection)
+	{
+	// Execute command and log parameters
+	aDataWrapper.INFO_PRINTF1(_L("execute WsHandle()"));
+	TInt	actualResult = GetClientClass()->WsHandle();
+
+	// Diaplay command return value, check if it matches the expected value
+	TInt	expnotResult;
+	if ( aDataWrapper.GetIntFromConfig(aSection, KFldExpectNot, expnotResult) )
+		{
+		if ( actualResult==expnotResult )
+			{
+			aDataWrapper.ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpectNot, expnotResult, actualResult);
+			aDataWrapper.SetBlockResult(EFail);
+			}
+		else
+			{
+			aDataWrapper.INFO_PRINTF3(KLogAsExpectedValueInt, &KFldExpectNot, actualResult);
+			}
+		}
+
+	TInt	expectResult;
+	if ( aDataWrapper.GetIntFromConfig(aSection, KFldExpected, expectResult) )
+		{
+		if ( actualResult!=expectResult )
+			{
+			aDataWrapper.ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected, expectResult, actualResult);
+			aDataWrapper.SetBlockResult(EFail);
+			}
+		else
+			{
+			aDataWrapper.INFO_PRINTF3(KLogAsExpectedValueInt, &KFldExpected, actualResult);
+			}
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataWsEvent.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,557 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataWsEvent.h"
+#include "T_GraphicsUtil.h"
+
+/*@{*/
+///	Commands
+_LIT(KCmdnew,							"new");
+_LIT(KCmdDestructor,					"~");
+_LIT(KCmdErrorMessage,					"ErrorMessage");
+_LIT(KCmdEventData,						"EventData");
+_LIT(KCmdHandle,						"Handle");
+_LIT(KCmdInt,							"Int");
+_LIT(KCmdKey,							"Key");
+_LIT(KCmdModifiersChanged,				"ModifiersChanged");
+_LIT(KCmdPointer,						"Pointer");
+_LIT(KCmdSetHandle,						"SetHandle");
+_LIT(KCmdSetTimeNow,					"SetTimeNow");
+_LIT(KCmdSetType,						"SetType");
+_LIT(KCmdTime,							"Time");
+_LIT(KCmdType,							"Type");
+_LIT(KCmdVisibilityChanged,				"VisibilityChanged");
+
+///	Fields
+_LIT(KFldExpected,						"expected");
+_LIT(KFldType,							"type");
+_LIT(KFldError,							"error");
+_LIT(KFldErrorCategory,					"errorcategory");
+_LIT(KFldExpectedCategory,				"expectedcategory");
+_LIT(KFldExpectedError,					"expectederror");
+_LIT(KFldExpected_Code,					"expected_code");
+_LIT(KFldExpected_ChangedModifier,		"expected_changedmodifier");
+_LIT(KFldExpected_Modifier,				"expected_modifier");
+_LIT(KFldExpected_Repeats,				"expected_repeats");
+_LIT(KFldExpected_ScanCode,				"expected_scancode");
+_LIT(KFldExpected_Type,					"expected_type");
+_LIT(KFldExpected_Pos,					"expected_pos");
+_LIT(KFldHandle,						"handle");
+_LIT(KFldNew_Value,						"new_value");
+_LIT(KFldUseConst,						"useconst");
+
+///	Logging
+_LIT(KLogMissingParameter,				"Missing parameter %S");
+_LIT(KLogMissingExpectedValue,			"Missing expected value '%S'");
+_LIT(KLogNotExpectedValue,				"Not expected value");
+_LIT(KLogNotExpectedValueInt,			"'%S' is not as expected=%d, actual=%d");
+_LIT(KLogNotExpectedValueHex,			"'%S' is not as expected=0x%x, actual=0x%x");
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataWsEvent* CT_DataWsEvent::NewL()
+/**
+ * Two phase constructor
+ */
+	{
+	CT_DataWsEvent*    ret=new (ELeave) CT_DataWsEvent();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+CT_DataWsEvent::CT_DataWsEvent()
+/**
+ * Protected constructor. First phase construction
+ */
+:	CDataWrapperBase()
+,	iWsEvent(NULL)
+	{
+	}
+
+void CT_DataWsEvent::ConstructL()
+/**
+ * Second phase construction
+ */
+	{
+	}
+
+CT_DataWsEvent::~CT_DataWsEvent()
+/**
+ * Public destructor
+ */
+	{
+	DestroyData();
+	}
+
+TAny* CT_DataWsEvent::GetObject()
+/**
+ * Return a pointer to the object that the data wraps
+ *
+ * @return pointer to the object that the data wraps
+ */
+	{
+	return iWsEvent;
+	}
+
+void CT_DataWsEvent::SetObjectL(TAny* aAny)
+/**
+ * Set the object that the data wraps
+ *
+ * @param    aObject object that the wrapper is testing
+ *
+ */
+	{
+	DestroyData();
+	iWsEvent = static_cast<TWsEvent*> (aAny);
+	}
+
+void CT_DataWsEvent::DisownObjectL()
+/**
+ * The object will no longer be owned by this
+ *
+ * @leave	KErrNotSupported if the the function is not supported
+ */
+	{
+	iWsEvent = NULL;
+	}
+
+void CT_DataWsEvent::DestroyData()
+	{
+	delete iWsEvent;
+	iWsEvent=NULL;
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataWsEvent::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool    ret = ETrue;
+	if ( aCommand==KCmdnew )
+		{
+		DoCmdnew();
+		}
+	else if ( aCommand==KCmdDestructor )
+		{
+		DestroyData();
+		}
+	else if ( aCommand==KCmdErrorMessage )
+		{
+		DoCmdErrorMessage(aSection);
+		}
+	else if ( aCommand==KCmdEventData )
+		{
+		DoCmdEventData(aSection);
+		}
+	else if ( aCommand==KCmdHandle )
+		{
+		DoCmdHandle(aSection);
+		}
+	else if ( aCommand==KCmdInt )
+		{
+		DoCmdInt(aSection);
+		}
+	else if ( aCommand==KCmdKey )
+		{
+		DoCmdKey(aSection);
+		}
+	else if ( aCommand==KCmdModifiersChanged )
+		{
+		DoCmdModifiersChanged(aSection);
+		}
+	else if ( aCommand==KCmdPointer )
+		{
+		DoCmdPointer(aSection);
+		}
+	else if ( aCommand==KCmdSetHandle )
+		{
+		DoCmdSetHandle(aSection);
+		}
+	else if ( aCommand==KCmdSetTimeNow )
+		{
+		DoCmdSetTimeNow();
+		}
+	else if ( aCommand==KCmdSetType )
+		{
+		DoCmdSetType(aSection);
+		}
+	else if ( aCommand==KCmdTime )
+		{
+		DoCmdTime();
+		}
+	else if ( aCommand==KCmdType )
+		{
+		DoCmdType(aSection);
+		}
+	else if ( aCommand==KCmdVisibilityChanged )
+		{
+		DoCmdVisibilityChanged(aSection);
+		}
+	else
+		{
+		ret=EFalse;
+		}
+
+	return ret;
+	}
+
+void CT_DataWsEvent::DoCmdnew()
+	{
+	INFO_PRINTF1(_L("new TWsEvent()"));
+	DestroyData();
+	TRAPD(err,	iWsEvent = new (ELeave) TWsEvent());
+	if(err	!= KErrNone)
+		{
+		ERR_PRINTF2(_L("**** TWsEvent Constructor failed with error %d"), err);
+		SetError(err);
+		}
+	}
+
+void CT_DataWsEvent::DoCmdErrorMessage(const TDesC& aSection)
+	{
+	const	TWsEvent*	wsEvent=iWsEvent;
+	TWsErrorMessage*	actual=wsEvent->ErrorMessage();
+	INFO_PRINTF3(_L("ErrorMessage: Category %d. Error %d"), actual->iErrorCategory, actual->iError);
+
+	TWsErrorMessage		expected;
+	if ( CT_GraphicsUtil::ReadErrorCategory(*this, aSection, KFldExpectedCategory(), expected.iErrorCategory) )
+		{
+		if ( actual->iErrorCategory!=expected.iErrorCategory )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+
+	TWsErrorMessage::TErrorCategory	expectedError;
+	if ( CT_GraphicsUtil::ReadErrorCategory(*this, aSection, KFldExpectedError(), expectedError) )
+		{
+		if ( actual->iErrorCategory!=expectedError )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+
+	CT_GraphicsUtil::ReadErrorCategory(*this, aSection, KFldErrorCategory(), actual->iErrorCategory);
+
+	TInt	error;
+	if ( GetIntFromConfig(aSection, KFldError(), error) )
+		{
+		actual->iError=(TUint)error;
+		}
+	}
+
+void CT_DataWsEvent::DoCmdEventData(const TDesC& aSection)
+	{
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+
+	TUint8*	actual=iWsEvent->EventData();
+	INFO_PRINTF2(_L("EventData: FirstByte %d"), *actual);
+
+	TInt	index=0;
+	for ( index=0; index<TWsEvent::EWsEventDataSize; ++index )
+		{
+		TInt	expected;
+		tempStore.Format(_L("%S%d"), &KFldExpected, index+1);
+		if ( GetIntFromConfig(aSection, tempStore, expected) )
+			{
+			if ( *(actual+index)!=expected )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+
+	for ( index=0; index<TWsEvent::EWsEventDataSize; ++index )
+		{
+		TInt	actualInt;
+		tempStore.Format(_L("%S%d"), &KFldNew_Value, index+1);
+		if ( GetIntFromConfig(aSection, tempStore, actualInt) )
+			{
+			*(actual+index)=(TUint8)actualInt;
+			}
+		}
+	}
+
+void CT_DataWsEvent::DoCmdSetHandle(const TDesC& aSection)
+	{
+	TInt	handle=0;
+	if ( !GetIntFromConfig(aSection, KFldHandle(), handle) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldHandle());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("TWsEvent::SetHandle"));
+		iWsEvent->SetHandle((TUint)handle);
+		}
+	}
+
+void CT_DataWsEvent::DoCmdHandle(const TDesC& aSection)
+	{
+	TUint	actual=iWsEvent->Handle();
+	INFO_PRINTF2(_L("Handle() actual=%d"), actual);
+	SetHandle(actual);
+
+	TInt	expected;
+	if ( !GetIntFromConfig(aSection, KFldExpected(), expected) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldExpected());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if ( expected!=(TInt)actual )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataWsEvent::DoCmdSetType(const TDesC& aSection)
+	{
+	TEventCode	eventCode;
+	if ( !CT_GraphicsUtil::ReadEventCode(*this, aSection, KFldType(), eventCode) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldType());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("SetType()"));
+		iWsEvent->SetType(eventCode);
+		}
+	}
+
+void CT_DataWsEvent::DoCmdType(const TDesC& aSection)
+	{
+	TInt	actual=iWsEvent->Type();
+	INFO_PRINTF2(_L("Type() actual Type:%d"), actual);
+
+	TEventCode	expected;
+	if ( !CT_GraphicsUtil::ReadEventCode(*this, aSection, KFldExpected(), expected) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldExpected());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if ( actual!=expected )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataWsEvent::DoCmdVisibilityChanged(const TDesC& aSection)
+	{
+	const TWsVisibilityChangedEvent*	actual=NULL;
+
+	TBool	useConst=EFalse;
+	GetBoolFromConfig(aSection, KFldUseConst(), useConst);
+	if ( useConst )
+		{
+		INFO_PRINTF1(_L("const VisibilityChanged"));
+		const	TWsEvent*	wsEvent=iWsEvent;
+		actual=wsEvent->VisibilityChanged();
+		}
+	else
+		{
+		INFO_PRINTF1(_L("VisibilityChanged"));
+		TWsVisibilityChangedEvent*	actualNonConst=iWsEvent->VisibilityChanged();
+		actual=actualNonConst;
+		}
+	INFO_PRINTF2(_L("VisibilityChanged:%d"), actual->iFlags);
+
+	TWsVisibilityChangedEvent	expected;
+	if ( CT_GraphicsUtil::ReadWsVisibilityChangedEvent(*this, aSection, KFldExpected(), expected) )
+		{
+		if ( actual->iFlags!=expected.iFlags )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataWsEvent::DoCmdSetTimeNow()
+	{
+	INFO_PRINTF1(_L("SetTimeNow()"));
+	iWsEvent->SetTimeNow();
+	}
+
+void CT_DataWsEvent::DoCmdTime()
+	{
+	INFO_PRINTF1(_L("Time()"));
+	TTime	eventTime=iWsEvent->Time();
+
+	TDateTime	dateTime = eventTime.DateTime();
+	INFO_PRINTF4(_L("Time() returned %d/%d/%d"), dateTime.Year(), dateTime.Month(), dateTime.Day());
+	INFO_PRINTF5(_L("Time() returned %d:%d:%d.%d"), dateTime.Hour(), dateTime.Minute(), dateTime.Second(), dateTime.MicroSecond());
+	}
+
+void CT_DataWsEvent::DoCmdInt(const TDesC& aSection)
+	{
+	TInt*	actual=iWsEvent->Int();
+	INFO_PRINTF2(_L("Int:0x%x"), *actual);
+
+	TInt	expected;
+	if ( GetIntFromConfig(aSection, KFldExpected(), expected) )
+		{
+		if ( *actual!=expected )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+
+	GetIntFromConfig(aSection, KFldNew_Value(), *actual);
+	}
+
+void CT_DataWsEvent::DoCmdKey(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Key()"));
+	TKeyEvent*	eventKey=iWsEvent->Key();
+
+	TKeyCode	keyCode;
+	if ( CT_GraphicsUtil::ReadKeyCode(*this, aSection, KFldExpected_Code, keyCode) )
+		{
+		if ( (TUint)keyCode != eventKey->iCode )
+			{
+			ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected_Code, keyCode, eventKey->iCode);
+			SetBlockResult(EFail);
+			}
+		}
+	else
+		{
+		ERR_PRINTF2(KLogMissingExpectedValue, &KFldExpected_Code);
+		SetBlockResult(EFail);
+		}
+
+	TStdScanCode	scanCode;
+	if ( CT_GraphicsUtil::ReadStdScanCode(*this, aSection, KFldExpected_ScanCode, scanCode) )
+		{
+		if ( scanCode != eventKey->iScanCode )
+			{
+			ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected_ScanCode, scanCode, eventKey->iScanCode);
+			SetBlockResult(EFail);
+			}
+		}
+
+	TUint	modifiers;
+	if ( CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldExpected_Modifier, modifiers) )
+		{
+		if ( modifiers != eventKey->iModifiers )
+			{
+			ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected_Modifier, modifiers, eventKey->iModifiers);
+			SetBlockResult(EFail);
+			}
+		}
+
+	TInt	repeats;
+	if ( GetIntFromConfig(aSection, KFldExpected_Repeats, repeats) )
+		{
+		if ( repeats != eventKey->iRepeats )
+			{
+			ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected_Repeats, repeats, eventKey->iRepeats);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataWsEvent::DoCmdModifiersChanged(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("ModifiersChanged()"));
+	TModifiersChangedEvent*	event=iWsEvent->ModifiersChanged();
+	INFO_PRINTF3(_L("TModifiersChangedEvent: iChangedModifiers=0x%x iModifiers=0x%x"), event->iChangedModifiers, event->iModifiers);
+
+	TUint	changedModifiers;
+	if ( CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldExpected_ChangedModifier, changedModifiers) )
+		{
+		if ( changedModifiers!=event->iChangedModifiers )
+			{
+			ERR_PRINTF4(KLogNotExpectedValueHex, &KFldExpected_Modifier, changedModifiers, event->iChangedModifiers);
+			SetBlockResult(EFail);
+			}
+		}
+
+	TUint	modifiers;
+	if ( CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldExpected_Modifier, modifiers) )
+		{
+		if ( modifiers!=(event->iModifiers&event->iChangedModifiers) )
+			{
+			ERR_PRINTF4(KLogNotExpectedValueHex, &KFldExpected_Modifier, modifiers, event->iModifiers);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataWsEvent::DoCmdPointer(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Pointer()"));
+	TPointerEvent*	actual=iWsEvent->Pointer();
+	INFO_PRINTF2(_L("iType            =%d"), actual->iType);
+	INFO_PRINTF2(_L("iModifiers       =0x%x"), actual->iModifiers);
+	INFO_PRINTF3(_L("iPosition        =(%d,%d)"), actual->iPosition.iX, actual->iPosition.iY);
+	INFO_PRINTF3(_L("iParentPosition  =(%d,%d)"), actual->iParentPosition.iX, actual->iParentPosition.iY);
+
+	TPointerEvent::TType	expectedType;
+	if ( CT_GraphicsUtil::ReadType(*this, aSection, KFldExpected_Type, expectedType) )
+		{
+		if ( actual->iType!=expectedType )
+			{
+			ERR_PRINTF4(KLogNotExpectedValueHex, &KFldExpected_Type, expectedType, actual->iType);
+			SetBlockResult(EFail);
+			}
+		}
+
+	TUint	modifiers;
+	if ( CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldExpected_Modifier, modifiers) )
+		{
+		if ( modifiers!=(actual->iModifiers&actual->iType) )
+			{
+			ERR_PRINTF4(KLogNotExpectedValueHex, &KFldExpected_Modifier, modifiers, actual->iModifiers);
+			SetBlockResult(EFail);
+			}
+		}
+
+	TPoint	position;
+	if ( GetPointFromConfig(aSection, KFldExpected_Pos, position) )
+		{
+		if ( position!=actual->iPosition )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataWsGraphic.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,251 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataWsGraphic.h"
+
+/*@{*/
+//Commands
+_LIT(KCmdDestructor,				"~CWsGraphic");
+_LIT(KCmdDestroy,					"Destroy");
+_LIT(KCmdId,						"Id");
+_LIT(KCmdIsActive,					"IsActive");
+_LIT(KCmdShare,						"Share");
+_LIT(KCmdShareGlobally,				"ShareGlobally");
+_LIT(KCmdUnShare,					"UnShare");
+_LIT(KCmdUnShareGlobally,			"UnShareGlobally");
+
+///	Fields
+_LIT(KFldClientId,					"clientid");
+_LIT(KFldExpected,					"expected");
+_LIT(KFldExpectNot,					"expectnot");
+
+///	Logging
+_LIT(KLogError,						"Error=%d");
+_LIT(KLogMissingParameter,			"Missing parameter '%S'");
+_LIT(KLogNotExpectedValue,			"Not expected value");
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataWsGraphic::CT_DataWsGraphic()
+:	CDataWrapperBase()
+	{
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataWsGraphic::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool	ret = ETrue;
+
+	if ( aCommand==KCmdDestructor )
+		{
+		DoCmdDestructorL();
+		}
+	else if ( aCommand==KCmdDestroy )
+		{
+		DoCmdDestroy();
+		}
+	else if ( aCommand==KCmdId )
+		{
+		DoCmdIdL(aSection);
+		}
+	else if ( aCommand==KCmdIsActive )
+		{
+		DoCmdIsActive(aSection);
+		}
+	else if ( aCommand==KCmdShare )
+		{
+		DoCmdShare(aSection);
+		}
+	else if ( aCommand==KCmdShareGlobally )
+		{
+		DoCmdShareGlobally();
+		}
+	else if ( aCommand==KCmdUnShare )
+		{
+		DoCmdUnShare(aSection);
+		}
+	else if ( aCommand==KCmdUnShareGlobally )
+		{
+		DoCmdUnShareGlobally();
+		}
+	else
+		{
+		ret=EFalse;
+		}
+
+	return ret;
+	}
+
+void CT_DataWsGraphic::DoCmdDestructorL()
+	{
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute ~CWsGraphic()"));
+	CWsGraphic*	graphic=GetWsGraphic();
+	CleanupStack::PushL(graphic);
+	DisownObjectL();
+	CleanupStack::PopAndDestroy(graphic);
+	}
+
+void CT_DataWsGraphic::DoCmdDestroy()
+	{
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute Destroy()"));
+	GetWsGraphic()->Destroy();
+	}
+
+void CT_DataWsGraphic::DoCmdIdL(const TDesC& aSection)
+	{
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute Id()"));
+	const TWsGraphicId&	actual=GetWsGraphic()->Id();
+	SetId(actual);
+	INFO_PRINTF3(_L("GetWsGraphic() Uid=0x%x Id=0x%x"), actual.Uid().iUid, actual.Id());
+
+	// Diaplay command return value, check if it matches the expected value
+	TWsGraphicId	expected(0);
+	if ( GetWsGraphicIdFromConfigL(aSection, KFldExpectNot, expected) )
+		{
+		if ( actual.Id()==expected.Uid().iUid )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	else
+		{
+		if ( !GetWsGraphicIdFromConfigL(aSection, KFldExpected, expected) )
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KFldExpectNot);
+			ERR_PRINTF2(KLogMissingParameter, &KFldExpected);
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			if ( actual.Uid()!=expected.Uid() )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+void CT_DataWsGraphic::DoCmdIsActive(const TDesC& aSection)
+	{
+	// Execute command and log parameters
+	TBool	actual=GetWsGraphic()->IsActive();
+	INFO_PRINTF2(_L("execute IsActive()=%d"), actual);
+
+	// Diaplay command return value, check if it matches the expected value
+	TBool	expected;
+	if ( !GetBoolFromConfig(aSection, KFldExpected, expected) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldExpected());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if ( actual!=expected )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataWsGraphic::DoCmdShare(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TInt	datId;
+
+	if ( !GetIntFromConfig(aSection, KFldClientId, datId) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldClientId());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		_LIT_SECURE_ID(datClientId, datId);
+
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute Share(TSecureId)"));
+		TInt	err=Share(datClientId);
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		}
+	}
+
+void CT_DataWsGraphic::DoCmdShareGlobally()
+	{
+	INFO_PRINTF1(_L("execute ShareGlobally()"));
+	TInt	err=ShareGlobally();
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+void CT_DataWsGraphic::DoCmdUnShare(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TInt	datId;
+
+	if ( !GetIntFromConfig(aSection, KFldClientId, datId) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldClientId());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		_LIT_SECURE_ID(datClientId, datId);
+
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute UnShare(TSecureId)"));
+		TInt	err=UnShare(datClientId);
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		}
+	}
+
+void CT_DataWsGraphic::DoCmdUnShareGlobally()
+	{
+	INFO_PRINTF1(_L("execute UnShareGlobally()"));
+	TInt	err=UnShareGlobally();
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataWsGraphicAnimation.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,262 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataWsGraphicAnimation.h"
+
+/*@{*/
+///	Commands
+_LIT(KCmdnew,					"new");
+_LIT(KCmdIsPaused,				"IsPaused");
+_LIT(KCmdIsPlaying,				"IsPlaying");
+_LIT(KCmdIsStopped,				"IsStopped");
+_LIT(KCmdIsStopping,			"IsStopping");
+_LIT(KCmdLoops,					"Loops");
+_LIT(KCmdPause,					"Pause");
+_LIT(KCmdPlay,					"Play");
+_LIT(KCmdStop,					"Stop");
+
+///	Fields
+_LIT(KFldExpected,				"expected");
+_LIT(KFldLoop,					"loop");
+_LIT(KFldImmediately,			"immediately");
+
+///	Logging
+_LIT(KLogError,						"Error=%d");
+_LIT(KLogMissingParameter,			"Missing parameter '%S'");
+_LIT(KLogNotExpectedValue,			"Not expected value");
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataWsGraphicAnimation::CT_DataWsGraphicAnimation()
+:	CT_DataWsGraphicMsgFixedBase()
+,	iWsGraphicAnimation(NULL)
+	{
+	}
+
+CT_DataWsGraphicAnimation::~CT_DataWsGraphicAnimation()
+	{
+	DestroyData();
+	}
+
+void CT_DataWsGraphicAnimation::DestroyData()
+	{
+	delete iWsGraphicAnimation;
+	iWsGraphicAnimation=NULL;
+	}
+
+/**
+ * Return a pointer to the object that the data wraps
+ *
+ * @return pointer to the object that the data wraps
+ */
+TAny* CT_DataWsGraphicAnimation::GetObject()
+	{
+	return iWsGraphicAnimation;
+	}
+
+TWsGraphicMsgFixedBase* CT_DataWsGraphicAnimation::GetWsGraphicMsgFixedBase() const
+	{
+	return iWsGraphicAnimation;
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataWsGraphicAnimation::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	ret=ETrue;
+
+	if ( aCommand==KCmdnew )
+		{
+		DoCmdnew();
+		}
+	else if ( aCommand==KCmdIsPaused )
+		{
+		DoCmdIsPaused(aSection);
+		}
+	else if ( aCommand==KCmdIsPlaying )
+		{
+		DoCmdIsPlaying(aSection);
+		}
+	else if ( aCommand==KCmdIsStopped )
+		{
+		DoCmdIsStopped(aSection);
+		}
+	else if ( aCommand==KCmdIsStopping )
+		{
+		DoCmdIsStopping(aSection);
+		}
+	else if ( aCommand==KCmdLoops )
+		{
+		DoCmdLoops(aSection);
+		}
+	else if ( aCommand==KCmdPause )
+		{
+		DoCmdPause();
+		}
+	else if ( aCommand==KCmdPlay )
+		{
+		DoCmdPlay(aSection);
+		}
+	else if ( aCommand==KCmdStop )
+		{
+		DoCmdStop(aSection);
+		}
+	else
+		{
+		ret=CT_DataWsGraphicMsgFixedBase::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+
+	return ret;
+	}
+
+void CT_DataWsGraphicAnimation::DoCmdnew()
+	{
+	INFO_PRINTF1(_L("execute new"));
+	DestroyData();
+	TRAPD(err, iWsGraphicAnimation=new (ELeave) TWsGraphicAnimation());
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+void CT_DataWsGraphicAnimation::DoCmdIsPaused(const TDesC& aSection)
+	{
+	TBool	actual=iWsGraphicAnimation->IsPaused();
+	INFO_PRINTF2(_L("execute IsPaused() = %d"), actual);
+
+	TBool	expected;
+	if ( GetBoolFromConfig(aSection, KFldExpected, expected) )
+		{
+		if ( expected!=actual )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataWsGraphicAnimation::DoCmdIsPlaying(const TDesC& aSection)
+	{
+	TBool	actual=iWsGraphicAnimation->IsPlaying();
+	INFO_PRINTF2(_L("execute IsPlaying() = %d"), actual);
+
+	TBool	expected;
+	if ( GetBoolFromConfig(aSection, KFldExpected, expected) )
+		{
+		if ( expected!=actual )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataWsGraphicAnimation::DoCmdIsStopped(const TDesC& aSection)
+	{
+	TBool	actual=iWsGraphicAnimation->IsStopped();
+	INFO_PRINTF2(_L("execute IsStopped() = %d"), actual);
+
+	TBool	expected;
+	if ( GetBoolFromConfig(aSection, KFldExpected, expected) )
+		{
+		if ( expected!=actual )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataWsGraphicAnimation::DoCmdIsStopping(const TDesC& aSection)
+	{
+	TBool	actual=iWsGraphicAnimation->IsStopping();
+	INFO_PRINTF2(_L("execute IsStopping() = %d"), actual);
+
+	TBool	expected;
+	if ( GetBoolFromConfig(aSection, KFldExpected, expected) )
+		{
+		if ( expected!=actual )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataWsGraphicAnimation::DoCmdLoops(const TDesC& aSection)
+	{
+	TBool	actual=iWsGraphicAnimation->Loops();
+	INFO_PRINTF2(_L("execute Loops() = %d"), actual);
+
+	TBool	expected;
+	if ( GetBoolFromConfig(aSection, KFldExpected, expected) )
+		{
+		if ( expected!=actual )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataWsGraphicAnimation::DoCmdPause()
+	{
+	iWsGraphicAnimation->Pause();
+	INFO_PRINTF1(_L("execute Pause()"));
+	}
+
+void CT_DataWsGraphicAnimation::DoCmdPlay(const TDesC& aSection)
+	{
+	TBool	loop;
+	if ( !GetBoolFromConfig(aSection, KFldLoop, loop) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldLoop());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		iWsGraphicAnimation->Play(loop);
+		INFO_PRINTF1(_L("execute Play(TBool)"));
+		}
+	}
+
+void CT_DataWsGraphicAnimation::DoCmdStop(const TDesC& aSection)
+	{
+	TBool	immediately;
+	if ( !GetBoolFromConfig(aSection, KFldImmediately, immediately) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldImmediately());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		iWsGraphicAnimation->Stop(immediately);
+		INFO_PRINTF1(_L("execute Stop(TBool)"));
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataWsGraphicBitmap.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,186 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataWsGraphicBitmap.h"
+#include "T_GraphicsUtil.h"
+
+/*@{*/
+///	Commands
+_LIT(KCmdNewL,						"NewL");
+_LIT(KCmdDestructor,				"~CWsGraphicBitmap");
+_LIT(KCmdDestructorGeneral,			"~");
+
+///	Fields
+_LIT(KFldBitmap,					"bitmap");
+_LIT(KFldMask,						"mask");
+_LIT(KFldReplace,					"replace");
+_LIT(KFldUid,						"uid");
+
+///	Logging
+_LIT(KLogError,						"Error=%d");
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataWsGraphicBitmap* CT_DataWsGraphicBitmap::NewL()
+	{
+	CT_DataWsGraphicBitmap*	ret=new (ELeave) CT_DataWsGraphicBitmap();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+CT_DataWsGraphicBitmap::CT_DataWsGraphicBitmap()
+:	CT_DataWsGraphic()
+,	iWsGraphicBitmap(NULL)
+	{
+	}
+
+void CT_DataWsGraphicBitmap::ConstructL()
+	{
+	}
+
+CT_DataWsGraphicBitmap::~CT_DataWsGraphicBitmap()
+	{
+	DestroyData();
+	}
+
+void CT_DataWsGraphicBitmap::SetObjectL(TAny* aAny)
+	{
+	DestroyData();
+	iWsGraphicBitmap = static_cast<CWsGraphicBitmap*> (aAny);
+	}
+
+void CT_DataWsGraphicBitmap::DisownObjectL()
+	{
+	iWsGraphicBitmap = NULL;
+	}
+
+void CT_DataWsGraphicBitmap::DestroyData()
+	{
+	delete iWsGraphicBitmap;
+	iWsGraphicBitmap=NULL;
+	}
+
+//	CT_DataWsGraphic Implementation
+CWsGraphic* CT_DataWsGraphicBitmap::GetWsGraphic() const
+	{
+	return iWsGraphicBitmap;
+	}
+
+TInt CT_DataWsGraphicBitmap::Share(TSecureId aClientId)
+	{
+	return iWsGraphicBitmap->Share(aClientId);
+	}
+
+TInt CT_DataWsGraphicBitmap::ShareGlobally()
+	{
+	return iWsGraphicBitmap->ShareGlobally();
+	}
+
+TInt CT_DataWsGraphicBitmap::UnShare(TSecureId aClientId)
+	{
+	return iWsGraphicBitmap->UnShare(aClientId);
+	}
+
+TInt CT_DataWsGraphicBitmap::UnShareGlobally()
+	{
+	return iWsGraphicBitmap->UnShareGlobally();
+	}
+
+/**
+ * Process a command read from the ini file
+ *
+ * @param aCommand			the command to process
+ * @param aSection			the entry in the ini file requiring the command to be processed
+ * @param aAsyncErrorIndex	index of command. used for async calls
+ *
+ * @return ETrue if the command is processed
+ */
+TBool CT_DataWsGraphicBitmap::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	ret = ETrue;
+
+	if ( aCommand==KCmdDestructor || aCommand==KCmdDestructorGeneral )
+		{
+		DoCmdDestructor();
+		}
+	else if ( aCommand==KCmdNewL )
+		{
+		DoCmdNewL(aSection);
+		}
+	else
+		{
+		ret=CT_DataWsGraphic::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+
+	return ret;
+	}
+
+void CT_DataWsGraphicBitmap::DoCmdNewL(const TDesC& aSection)
+	{
+	DestroyData();
+
+	// Get test data for command input parameter(s)
+	CFbsBitmap*	bitmap = NULL;
+	CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFldBitmap, bitmap);
+
+	CFbsBitmap*	mask = NULL;
+	CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFldMask, mask);
+
+	TInt	err=KErrNone;
+
+	TInt	datUid;
+	if ( GetIntFromConfig(aSection, KFldUid, datUid) )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute NewL(TUid , CFbsBitmap*, CFbsBitmap*)"));
+		TRAP(err, iWsGraphicBitmap = CWsGraphicBitmap::NewL(TUid::Uid(datUid), bitmap, mask));
+		}
+	else
+		{
+		TWsGraphicId	datReplace(TWsGraphicId::EUninitialized);
+		if ( GetWsGraphicIdFromConfigL(aSection, KFldReplace, datReplace) )
+			{
+			// Execute command and log parameters
+			INFO_PRINTF1(_L("execute NewL(TWsGraphicId , CFbsBitmap*, CFbsBitmap*)"));
+			TRAP(err, iWsGraphicBitmap = CWsGraphicBitmap::NewL(datReplace, bitmap, mask));
+			}
+		else
+			{
+			// Execute command and log parameters
+			INFO_PRINTF1(_L("execute NewL(CFbsBitmap*, CFbsBitmap*)"));
+			TRAP(err, iWsGraphicBitmap = CWsGraphicBitmap::NewL(bitmap, mask));
+			}
+		}
+
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+void CT_DataWsGraphicBitmap::DoCmdDestructor()
+	{
+	// Execute command and log parameters
+	INFO_PRINTF1(_L("execute ~CWsGraphicBitmap()"));
+	DestroyData();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataWsGraphicBitmapAnimation.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,303 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_GraphicsUtil.h"
+#include "T_DataWsGraphicBitmapAnimation.h"
+
+/*@{*/
+//Commands
+_LIT(KCmdNew,							    "NewL");
+_LIT(KCmdDestroy,						    "~");
+_LIT(KCmdUtil_StartAnimTesterClientL,		"Util_StartAnimTesterClientL");
+_LIT(KCmdUtil_CloseAnimTesterClientL,		"Util_CloseAnimTesterClientL");
+
+// Fields
+_LIT(KFldFrameCount,						"framescount");
+_LIT(KFldTFrame,						    "frame%d");
+_LIT(KFldUid,                               "uid");
+_LIT(KFldReplace,					        "replace");
+///	Logging
+_LIT(KLogError,								"Error=%d");
+_LIT(KLogMissingParameter,					"Missing parameter '%S'");
+
+_LIT(KLogNew,                               "execute CWsGraphicBitmapAnimation::NewL(const TFrames &aFrames)");
+_LIT(KLogNew2,                              "execute CWsGraphicBitmapAnimation::NewL(TUid aUid, const TFrames &aFrames)");
+_LIT(KLogNew3,                              "execute CWsGraphicBitmapAnimation::NewL(const TWsGraphicId &aReplace, const TFrames &aFrames)");
+_LIT(KLogUtil_StartAnimTesterClientL,		"execute CWsGraphicBitmapAnimation::Util_StartAnimTesterClientL(const TDesC& aSection)");
+_LIT(KLogUtil_CloseAnimTesterClientL,		"execute CWsGraphicBitmapAnimation::Util_CloseAnimTesterClientL()");
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataWsGraphicBitmapAnimation::CT_DataWsGraphicBitmapAnimation()
+:	CT_DataWsGraphic(),iWsGraphicBitmapAnimation(NULL)
+	{
+	}
+
+CT_DataWsGraphicBitmapAnimation*	CT_DataWsGraphicBitmapAnimation::NewL()
+	{
+	CT_DataWsGraphicBitmapAnimation*    ret=new (ELeave) CT_DataWsGraphicBitmapAnimation();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+void CT_DataWsGraphicBitmapAnimation::ConstructL()
+	{
+	}
+
+CT_DataWsGraphicBitmapAnimation::~CT_DataWsGraphicBitmapAnimation()
+	{
+	DoCmdDestroy();
+	}
+
+/**
+ * Called by TEF framework to set object.
+ *
+ * @param: None
+ *
+ * @return: None
+ */
+void CT_DataWsGraphicBitmapAnimation::SetObjectL(TAny* aAny)
+	{
+	DoCmdDestroy();
+	iWsGraphicBitmapAnimation = static_cast<CWsGraphicBitmapAnimation*> (aAny);
+	}
+
+/**
+ * Called by TEF framework to disown the object.
+ *
+ * @param: None
+ *
+ * @return: None
+ */
+void CT_DataWsGraphicBitmapAnimation::DisownObjectL()
+	{
+	iWsGraphicBitmapAnimation = NULL;
+	}
+
+/**
+ * Destroy the object which has been constructed.
+ *
+ * @param: None
+ *
+ * @return: None
+ */
+void CT_DataWsGraphicBitmapAnimation::DoCmdDestroy()
+	{
+		delete iWsGraphicBitmapAnimation;
+		iWsGraphicBitmapAnimation = NULL;
+	}
+	
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataWsGraphicBitmapAnimation::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool ret = ETrue;
+
+	if ( aCommand==KCmdNew )
+		{
+		DoCmdNewL(aSection);
+		}
+	else if ( aCommand==KCmdDestroy )
+		{
+		DoCmdDestroy();
+		}
+	else if ( aCommand==KCmdUtil_StartAnimTesterClientL )
+		{
+		Util_StartAnimTesterClientL(aSection);
+		}
+	else if ( aCommand==KCmdUtil_CloseAnimTesterClientL )
+		{
+		Util_CloseAnimTesterClientL(aSection);
+		}
+	else
+		{
+		ret=CT_DataWsGraphic::DoCommandL(aCommand,aSection,aAsyncErrorIndex);
+		}
+
+	return ret;
+	}
+
+/**
+ * Process new command
+ *
+ * @param aSection			the entry in the ini file requiring the command to be processed
+ *
+ * @return: None
+ */
+void CT_DataWsGraphicBitmapAnimation::DoCmdNewL(const TDesC& aSection)
+	{
+	TBool dataOk=ETrue;
+	RPointerArray<CWsGraphicBitmapAnimation::CFrame> frames;
+
+	//CWsGraphicBitmapAnimation::TFrames frames;
+    TInt nFrameCount=0;
+    
+    if(!GetIntFromConfig(aSection,KFldFrameCount,nFrameCount))
+        {
+        ERR_PRINTF2(KLogMissingParameter,KFldFrameCount);
+        SetBlockResult(EFail);
+        dataOk=EFalse;
+        }
+    else
+        {
+        RBuf info;
+    	info.Create(256);
+        TPtrC	framename;
+        for(TInt i=0;i<nFrameCount;i++)
+            {
+            info.Format(KFldTFrame,i+1);
+            
+            if(!GetStringFromConfig(aSection,info, framename))
+                {
+                ERR_PRINTF2(KLogMissingParameter,info.Ptr());
+                SetBlockResult(EFail);
+                dataOk=EFalse;
+                }
+            else
+                {
+            	frames.Append(static_cast<CWsGraphicBitmapAnimation::CFrame*>(GetDataObjectL(framename)));
+                }
+            }
+        info.Close();
+        }
+		
+	TInt err=KErrNone;
+	
+	if ( dataOk )
+		{
+        TInt ndata;
+        TWsGraphicId	datReplace(TWsGraphicId::EUninitialized);
+        if(GetIntFromConfig(aSection,KFldUid,ndata))
+            {
+            // Execute command and log parameters
+    		INFO_PRINTF1(KLogNew2);
+     		TRAP( err, iWsGraphicBitmapAnimation=CWsGraphicBitmapAnimation::NewL(TUid::Uid(ndata),frames.Array()));
+            }
+        else if(GetWsGraphicIdFromConfigL(aSection, KFldReplace, datReplace))
+            {
+            // Execute command and log parameters
+    		INFO_PRINTF1(KLogNew3);
+    		TRAP( err, iWsGraphicBitmapAnimation=CWsGraphicBitmapAnimation::NewL(datReplace,frames.Array()));
+            }
+        else
+            {
+            // Execute command and log parameters
+    		INFO_PRINTF1(KLogNew);
+    		TRAP( err, iWsGraphicBitmapAnimation=CWsGraphicBitmapAnimation::NewL(frames.Array()));
+            }
+		}
+
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	// No command return value and output parameter to display and check
+	}
+
+/**
+ * Process Util_StartAnimTesterClientL command
+ *
+ * @param aSection			the entry in the ini file requiring the command to be processed
+ *
+ * @return: None
+ */
+void CT_DataWsGraphicBitmapAnimation::Util_StartAnimTesterClientL(const TDesC& aSection)
+	{
+	TInt dataOK;
+	TRAPD( err, dataOK = CT_GraphicsUtil::StartAnimTesterClientL(*this, aSection) );
+	if( dataOK )
+		{
+	    if ( KErrNone == err )
+	        {
+	        INFO_PRINTF1(KLogUtil_StartAnimTesterClientL);
+	        }
+	    else
+	        {
+	        ERR_PRINTF2(KLogError, err);
+	        SetBlockResult(EFail);
+	        }
+		}
+	else
+		{
+		ERR_PRINTF2(KLogMissingParameter, KLogUtil_StartAnimTesterClientL);
+		}
+	}
+
+/**
+ * Process Util_CloseAnimTesterClientL command
+ *
+ * @param: None
+ *
+ * @return: None
+ */
+void CT_DataWsGraphicBitmapAnimation::Util_CloseAnimTesterClientL(const TDesC& aSection)
+	{
+	TInt dataOK;
+	TRAPD( err, dataOK = CT_GraphicsUtil::CloseAnimTesterClientL(*this, aSection) );
+	if( dataOK )
+		{
+	    if ( KErrNone == err )
+	        {
+	        INFO_PRINTF1(KLogUtil_CloseAnimTesterClientL);
+	        }
+	    else
+	        {
+	        ERR_PRINTF2(KLogError, err);
+	        SetBlockResult(EFail);
+	        }	
+		}
+	else
+		{
+		ERR_PRINTF2(KLogMissingParameter, KLogUtil_CloseAnimTesterClientL);
+		}
+	}
+
+
+TInt CT_DataWsGraphicBitmapAnimation::ShareGlobally()
+	{
+	return iWsGraphicBitmapAnimation->ShareGlobally();
+	}
+
+TInt CT_DataWsGraphicBitmapAnimation::UnShareGlobally()
+	{
+    return iWsGraphicBitmapAnimation->UnShareGlobally();
+  	}
+
+
+ TInt CT_DataWsGraphicBitmapAnimation::Share(TSecureId aClientId)
+	{
+    return iWsGraphicBitmapAnimation->Share(aClientId);
+	}
+    
+
+ TInt CT_DataWsGraphicBitmapAnimation::UnShare(TSecureId aClientId)
+	{
+    return iWsGraphicBitmapAnimation->UnShare(aClientId);    
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataWsGraphicFrameRate.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataWsGraphicFrameRate.h"
+
+/*@{*/
+///	Commands
+_LIT(KCmdnew,					"new");
+
+///	Logging
+_LIT(KLogError,					"Error=%d");
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataWsGraphicFrameRate::CT_DataWsGraphicFrameRate()
+:	CT_DataWsGraphicMsgFixedBase()
+,	iWsGraphicFrameRate(NULL)
+	{
+	}
+
+CT_DataWsGraphicFrameRate::~CT_DataWsGraphicFrameRate()
+	{
+	DestroyData();
+	}
+
+void CT_DataWsGraphicFrameRate::DestroyData()
+	{
+	delete iWsGraphicFrameRate;
+	iWsGraphicFrameRate=NULL;
+	}
+
+/**
+ * Return a pointer to the object that the data wraps
+ *
+ * @return pointer to the object that the data wraps
+ */
+TAny* CT_DataWsGraphicFrameRate::GetObject()
+	{
+	return iWsGraphicFrameRate;
+	}
+
+TWsGraphicMsgFixedBase* CT_DataWsGraphicFrameRate::GetWsGraphicMsgFixedBase() const
+	{
+	return iWsGraphicFrameRate;
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataWsGraphicFrameRate::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	ret=ETrue;
+
+	if ( aCommand==KCmdnew )
+		{
+		DoCmdnew();
+		}
+	else
+		{
+		ret=CT_DataWsGraphicMsgFixedBase::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		}
+
+	return ret;
+	}
+
+void CT_DataWsGraphicFrameRate::DoCmdnew()
+	{
+	INFO_PRINTF1(_L("execute new"));
+	DestroyData();
+	TRAPD(err, iWsGraphicFrameRate=new (ELeave) TWsGraphicFrameRate());
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataWsGraphicMsgBuf.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,381 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataWsGraphicMsgBuf.h"
+
+/*@{*/
+//Parameters
+_LIT(KExpected,					"expected");
+_LIT(KInputTypeId,				"inputTypeId");
+_LIT(KInputText,				"inputText");
+_LIT(KInputUseText8,			"inputUseText8");
+_LIT(KInputMsgLen,				"inputMsgLen");
+_LIT(KInputMsgPosition,			"inputMsgPosition");
+_LIT(KInputFormat,				"inputFormat");
+
+//Commands
+_LIT(KCmdnew,					"new");
+_LIT(KCmdClose,					"Close");
+_LIT(KCmdCleanupClosePushL,		"CleanupClosePushL");
+_LIT(KCmdAppend,				"Append");
+_LIT(KCmdRemove,				"Remove");
+_LIT(KCmdCount,					"Count");
+_LIT(KCmdTypeId,				"TypeId");
+_LIT(KCmdData,					"Data");
+_LIT(KCmdGetFixedMsg,			"GetFixedMsg");
+_LIT(KCmdPckg,					"Pckg");
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataWsGraphicMsgBuf* CT_DataWsGraphicMsgBuf::NewL()
+    {
+    CT_DataWsGraphicMsgBuf*    ret=new (ELeave) CT_DataWsGraphicMsgBuf();
+    CleanupStack::PushL(ret);
+    ret->ConstructL();
+    CleanupStack::Pop(ret);
+    return ret;
+    }
+
+CT_DataWsGraphicMsgBuf::CT_DataWsGraphicMsgBuf()
+:    CDataWrapperBase()
+,    iWsGraphicMsgBuf(NULL)
+    {
+    }
+
+void CT_DataWsGraphicMsgBuf::ConstructL()
+    {
+    }
+
+CT_DataWsGraphicMsgBuf::~CT_DataWsGraphicMsgBuf()
+    {
+    DestroyData();
+    }
+
+void CT_DataWsGraphicMsgBuf::SetObjectL(TAny* aAny)
+    {
+    DestroyData();
+    iWsGraphicMsgBuf = static_cast<RWsGraphicMsgBuf*> (aAny);
+    }
+
+void CT_DataWsGraphicMsgBuf::DisownObjectL()
+	{
+	iWsGraphicMsgBuf = NULL;
+	}
+
+void CT_DataWsGraphicMsgBuf::DestroyData()
+    {
+    delete iWsGraphicMsgBuf;
+    iWsGraphicMsgBuf=NULL;
+    }
+
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataWsGraphicMsgBuf::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+    {
+    TBool    ret = ETrue;
+
+    if ( aCommand==KCmdnew )
+        {
+        DoCmdnew();
+        }
+    else if ( aCommand==KCmdClose )
+        {
+        DoCmdClose();
+        }
+    else if ( aCommand==KCmdCleanupClosePushL )
+        {
+        DoCmdCleanupClosePushL();
+        }
+    else if ( aCommand==KCmdAppend )
+        {
+        DoCmdAppendL(aSection);
+        }
+    else if ( aCommand==KCmdRemove )
+        {
+        DoCmdRemove(aSection);
+        }
+    else if ( aCommand==KCmdCount )
+        {
+        DoCmdCount(aSection);
+        }
+    else if ( aCommand==KCmdTypeId )
+        {
+        DoCmdTypeId(aSection);
+        }
+    else if ( aCommand==KCmdData )
+        {
+        DoCmdDataL(aSection);
+        }
+    else if( aCommand==KCmdGetFixedMsg)
+		{
+		DoCmdGetFixedMsg(aSection);
+		}
+    else if ( aCommand==KCmdPckg )
+        {
+        DoCmdPckg();
+        }
+    else
+        {
+        ret=EFalse;
+        }
+
+    return ret;
+    }
+
+
+void CT_DataWsGraphicMsgBuf::DoCmdnew()
+    {
+	DestroyData();
+	
+	TRAPD(err,	iWsGraphicMsgBuf =	new	(ELeave) RWsGraphicMsgBuf());
+	if(err	!= KErrNone)
+		{
+		ERR_PRINTF2(_L("**** RWsGraphicMsgBuf	Constructor	failed	with error %d"), err);
+		SetError(err);
+		}
+
+	INFO_PRINTF1(_L("RWsGraphicMsgBuf::RWsGraphicMsgBuf"));
+	}
+
+void CT_DataWsGraphicMsgBuf::DoCmdClose()
+	{
+	iWsGraphicMsgBuf->Close();
+	INFO_PRINTF1(_L("RWsGraphicMsgBuf::Close"));
+    }
+
+void CT_DataWsGraphicMsgBuf::DoCmdCleanupClosePushL()
+	{
+	iWsGraphicMsgBuf->CleanupClosePushL();
+	CleanupStack::PopAndDestroy(iWsGraphicMsgBuf);
+	INFO_PRINTF1(_L("RWsGraphicMsgBuf::CleanupClosePushL"));
+	}
+
+void CT_DataWsGraphicMsgBuf::DoCmdAppendL(const TDesC& aSection)
+    {		
+	TInt	err=KErrNone;
+	TInt	inputTypeId=0;
+	if(	GetIntFromConfig(aSection, KInputTypeId(), inputTypeId))
+		{
+		TUid	uid = TUid::Uid(inputTypeId);
+		TPtrC 	inputStr;
+		if( !GetStringFromConfig(aSection, KInputText(), inputStr) )
+			{
+			ERR_PRINTF2(_L("Missing parameter %S"), &KInputText());
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			TBool useBuf8=EFalse;
+			GetBoolFromConfig(aSection, KInputUseText8(), useBuf8);
+			if ( useBuf8 )
+				{
+				TInt		inputMsgLen=0;
+				HBufC8*		tempStr = HBufC8::NewLC(inputStr.Length());
+				tempStr->Des().Copy(inputStr);
+				if(	GetIntFromConfig(aSection, KInputMsgLen(), inputMsgLen))
+					{
+					// Test iWsGraphicMsgBuf->Append(TUid aTypeId, TInt aLen, TPtr8 &aPtr);
+					TPtr8		tempInputStr(tempStr->Des());
+					err = iWsGraphicMsgBuf->Append(uid, inputMsgLen, tempInputStr);
+					INFO_PRINTF1(_L("RWsGraphicMsgBuf::Append  (TPtr8)"));
+					}
+				else
+					{
+					// Test iWsGraphicMsgBuf->Append(TUid aTypeId, const TDesC8 &aData);
+					err	= iWsGraphicMsgBuf->Append(uid,	*tempStr);
+					INFO_PRINTF1(_L("RWsGraphicMsgBuf::Append  (TDesC8)"));
+					}
+				CleanupStack::PopAndDestroy(tempStr);
+				}
+			else
+				{
+				//  Test iWsGraphicMsgBuf->Append(TUid aTypeId, const TDesC16 &aData);
+				err	= iWsGraphicMsgBuf->Append(uid,	inputStr);
+				INFO_PRINTF1(_L("RWsGraphicMsgBuf::Append (TDesC16)"));
+				}
+			}
+		}
+	else
+		{
+		TWsGraphicFrameRate		frameRate;
+		err	= iWsGraphicMsgBuf->Append(frameRate);
+		INFO_PRINTF1(_L("RWsGraphicMsgBuf::Append	(TWsGraphicMsgFixedBase)"));
+		}
+		
+	if(err != KErrNone)
+		{
+		ERR_PRINTF2(_L("**** Append failed with error %d"),	err);
+		SetError(err);
+		}
+	}
+
+void CT_DataWsGraphicMsgBuf::DoCmdRemove(const TDesC& aSection)
+	{
+	TInt	inputMsgPosition=0;
+	if(	GetIntFromConfig(aSection, KInputMsgPosition(), inputMsgPosition))
+		{
+		iWsGraphicMsgBuf->Remove(inputMsgPosition);
+		INFO_PRINTF1(_L("RWsGraphicMsgBuf::Remove"));
+		}
+	else
+		{
+		ERR_PRINTF2(_L("Missing parameter %S"), &KInputMsgPosition());
+		SetBlockResult(EFail);
+    	}
+	}
+
+void CT_DataWsGraphicMsgBuf::DoCmdCount(const TDesC& aSection)
+	{
+	TInt	actual = iWsGraphicMsgBuf->Count();
+	INFO_PRINTF2(_L("RWsGraphicMsgBuf::Count = %d"), actual);
+
+	TInt	expected = 0;
+	if(	GetIntFromConfig(aSection, KExpected(), expected))
+		{
+		if( actual != expected )
+			{
+			ERR_PRINTF1(_L("Count is not as expected!"));
+			SetBlockResult(EFail);
+			}
+		}
+	else
+		{
+		ERR_PRINTF2(_L("Missing parameter %S"), &KExpected());
+		SetBlockResult(EFail);
+		}
+	}
+
+void CT_DataWsGraphicMsgBuf::DoCmdTypeId(const TDesC& aSection)
+	{
+	TInt	inputMsgPosition=0;
+	if(	GetIntFromConfig(aSection, KInputMsgPosition(), inputMsgPosition))
+		{
+		TUid	actual = iWsGraphicMsgBuf->TypeId(inputMsgPosition);
+		INFO_PRINTF2(_L("RWsGraphicMsgBuf::TypeId = %d"), actual.iUid);
+
+		TInt	expected = 0;
+		if(	GetIntFromConfig(aSection, KExpected(), expected))
+			{
+			TUid	expectedUid = TUid::Uid(expected);
+
+			if( actual != expectedUid )
+				{
+				ERR_PRINTF1(_L("TypeId is not as expected!"));
+				SetBlockResult(EFail);
+				}
+			}
+		else
+			{
+			ERR_PRINTF2(_L("Missing parameter %S"), &KExpected());
+			SetBlockResult(EFail);
+			}
+		}
+	else
+		{
+		ERR_PRINTF2(_L("Missing parameter %S"), &KInputMsgPosition());
+		SetBlockResult(EFail);
+		}
+	}
+
+void CT_DataWsGraphicMsgBuf::DoCmdDataL(const TDesC& aSection)
+	{
+	TInt     inputMsgPosition=0;
+	if( !GetIntFromConfig(aSection, KInputMsgPosition(), inputMsgPosition) )
+		{
+		ERR_PRINTF2(_L("Missing parameter %S"), &KInputMsgPosition());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		TPtrC     format;
+		if( GetStringFromConfig(aSection, KInputFormat(), format) )
+			{
+			//     Test modifiable Data
+			TPtr8     actual=iWsGraphicMsgBuf->Data(inputMsgPosition);
+			HBufC*    buffer=HBufC::NewLC(actual.Length());
+			TPtr      bufferPtr=buffer->Des();
+
+			bufferPtr.Copy(actual);
+			INFO_PRINTF1(_L("RWsGraphicMsgBuf::Data ="));
+			INFO_PRINTF1(bufferPtr);
+			bufferPtr.Format(format, &bufferPtr);
+			actual.Copy(bufferPtr);
+			CleanupStack::PopAndDestroy(buffer);
+			}
+		else
+			{
+			//     Test non-modifiable Data
+			const RWsGraphicMsgBuf*	wsGraphicMsgBuf=iWsGraphicMsgBuf;
+			TPtrC8					actual=wsGraphicMsgBuf->Data(inputMsgPosition);
+			HBufC*					buffer=HBufC::NewLC(actual.Length());
+			TPtr					bufferPtr=buffer->Des();
+
+			bufferPtr.Copy(actual);
+			INFO_PRINTF1(_L("RWsGraphicMsgBuf::Data ="));
+			INFO_PRINTF1(bufferPtr);
+			TPtrC     expected;
+			if( !GetStringFromConfig(aSection, KExpected(), expected) )
+				{
+				ERR_PRINTF2(_L("Missing parameter %S"), &KInputMsgPosition());
+				SetBlockResult(EFail);
+				}
+			 else
+				{
+				if( bufferPtr!=expected )
+					{
+					ERR_PRINTF1(_L("Data is not as expected!"));
+					SetBlockResult(EFail);
+					}
+				}
+				CleanupStack::PopAndDestroy(buffer);
+			}
+		}
+	}
+
+void CT_DataWsGraphicMsgBuf::DoCmdGetFixedMsg(const	TDesC& aSection)
+	{
+	TInt	inputMsgPosition=0;
+	if(	GetIntFromConfig(aSection, KInputMsgPosition(), inputMsgPosition))
+		{
+		TWsGraphicFrameRate		frameRate;
+		iWsGraphicMsgBuf->GetFixedMsg(frameRate, inputMsgPosition);
+		INFO_PRINTF1(_L("RWsGraphicMsgBuf::GetFixedMsg"));
+		}
+	else
+		{
+		ERR_PRINTF2(_L("Missing parameter	%S"), &KInputMsgPosition());
+		SetBlockResult(EFail);
+		}
+	}
+
+void CT_DataWsGraphicMsgBuf::DoCmdPckg()
+	{
+	TBuf8<KMaxTestExecuteCommandLength>		msg;
+	msg = iWsGraphicMsgBuf->Pckg();
+	INFO_PRINTF1(_L("RWsGraphicMsgBuf::Pckg"));
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataWsGraphicMsgFixedBase.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,115 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataWsGraphicMsgFixedBase.h"
+
+/*@{*/
+///	Commands
+_LIT(KCmdPckg,					"Pckg");
+_LIT(KCmdSize,					"Size");
+_LIT(KCmdTypeId,				"TypeId");
+
+// Fields
+_LIT(KFldExpected,				"expected");
+
+///	Logging
+_LIT(KLogNotExpectedValue,		"Not expected value");
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataWsGraphicMsgFixedBase::CT_DataWsGraphicMsgFixedBase()
+:	CDataWrapperBase()
+	{
+	}
+
+CT_DataWsGraphicMsgFixedBase::~CT_DataWsGraphicMsgFixedBase()
+	{
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataWsGraphicMsgFixedBase::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool	ret=ETrue;
+
+	if ( aCommand==KCmdPckg )
+		{
+		DoCmdPckg();
+		}
+	else if ( aCommand==KCmdSize )
+		{
+		DoCmdSize(aSection);
+		}
+	else if ( aCommand==KCmdTypeId )
+		{
+		DoCmdTypeId(aSection);
+		}
+	else
+		{
+		ret=EFalse;
+		}
+
+	return ret;
+	}
+
+void CT_DataWsGraphicMsgFixedBase::DoCmdPckg()
+	{
+	INFO_PRINTF1(_L("execute Pckg()"));
+	iPckg.Set(GetWsGraphicMsgFixedBase()->Pckg());
+	}
+
+void CT_DataWsGraphicMsgFixedBase::DoCmdSize(const TDesC& aSection)
+	{
+	TInt	size=GetWsGraphicMsgFixedBase()->Size();
+	INFO_PRINTF2(_L("execute Size() = %d"), size);
+
+	TInt	expected;
+	if ( GetIntFromConfig(aSection, KFldExpected, expected) )
+		{
+		if ( expected!=size )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataWsGraphicMsgFixedBase::DoCmdTypeId(const TDesC& aSection)
+	{
+	TUid	uid=GetWsGraphicMsgFixedBase()->TypeId();
+	INFO_PRINTF2(_L("execute TypeId() = 0x%x"), uid.iUid);
+
+	TInt	expected;
+	if ( GetHexFromConfig(aSection, KFldExpected, expected) )
+		{
+		if ( expected!=uid.iUid )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataWsPointerCursor.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,213 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_GraphicsUtil.h"
+#include "T_DataWsPointerCursor.h"
+
+/*@{*/
+//Commands
+_LIT(KCmdNew,							    "new");
+_LIT(KCmdConstruct,						    "Construct");
+
+// Fields
+_LIT(KFldWs,							"ws");
+_LIT(KFldFlag,                          "flag");
+
+///	Logging
+_LIT(KLogError,								"Error=%d");
+_LIT(KLogMissingParameter,					"Missing parameter '%S'");
+
+_LIT(KLogConstruct,                         "execute Construct(TInt aFlags)");
+_LIT(KLogNew,                               "execute new RWsPointerCursor()");
+_LIT(KLogNew2,                              "execute new RWsPointerCursor(RWsSession)");
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataWsPointerCursor::CT_DataWsPointerCursor()
+:	CT_DataWsSpriteBase(),iWsPointerCursor(NULL)
+	{
+	}
+
+CT_DataWsPointerCursor*	CT_DataWsPointerCursor::NewL()
+	{
+	CT_DataWsPointerCursor* ret=new (ELeave) CT_DataWsPointerCursor();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+void CT_DataWsPointerCursor::ConstructL()
+	{
+	}
+
+CT_DataWsPointerCursor::~CT_DataWsPointerCursor()
+	{
+	DestroyData();
+	}
+
+/**
+ * Called by TEF framework to set object.
+ *
+ * @param: None
+ *
+ * @return: None
+ */
+void CT_DataWsPointerCursor::SetObjectL(TAny* aAny)
+	{
+	DestroyData();
+	iWsPointerCursor=static_cast<RWsPointerCursor*> (aAny);
+	}
+
+/**
+ * Called by TEF framework to disown the object.
+ *
+ * @param: None
+ *
+ * @return: None
+ */
+void CT_DataWsPointerCursor::DisownObjectL()
+	{
+	iWsPointerCursor=NULL;
+	}
+
+/**
+ * Destroy the object which has been constructed.
+ *
+ * @param: None
+ *
+ * @return: None
+ */
+void CT_DataWsPointerCursor::DestroyData()
+	{
+	delete iWsPointerCursor;
+	iWsPointerCursor=NULL;
+	}
+
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataWsPointerCursor::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool ret=ETrue;
+
+	if ( aCommand==KCmdNew )
+		{
+		DoCmdNewL(aSection);
+		}
+	else if ( aCommand==KCmdConstruct )
+		{
+		DoCmdConstructL(aSection);
+		}
+	else
+		{
+		ret=CT_DataWsSpriteBase::DoCommandL(aCommand,aSection,aAsyncErrorIndex);
+		}
+
+	return ret;
+	}
+
+/**
+ * Process new command
+ *
+ * @param aSection			the entry in the ini file requiring the command to be processed
+ *
+ * @return: None
+ */
+void CT_DataWsPointerCursor::DoCmdNewL(const TDesC& aSection)
+	{
+	TPtrC	wsName;
+	RWsSession* ws=NULL;
+	
+	if ( GetStringFromConfig(aSection, KFldWs, wsName) )
+		{
+		ws=static_cast<RWsSession*>(GetDataObjectL(wsName));
+		}
+		
+	TInt err=KErrNone;
+	
+	if ( ws!=NULL )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(KLogNew2);
+		TRAP( err, iWsPointerCursor = new (ELeave) RWsPointerCursor(*ws));
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(KLogNew);
+		TRAP( err, iWsPointerCursor = new (ELeave) RWsPointerCursor());
+		}
+
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	// No command return value and output parameter to display and check
+	}
+
+
+/**
+ * Process Construct command
+ *
+ * @param aSection			the entry in the ini file requiring the command to be processed
+ *
+ * @return: None
+ */
+void CT_DataWsPointerCursor::DoCmdConstructL(const TDesC& aSection)
+	{
+	// Execute command and log parameters
+	INFO_PRINTF1(KLogConstruct);
+	TBool dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TUint aSpriteFlags=0;
+	
+	if(!CT_GraphicsUtil::ReadSpriteFlags(*this,aSection,KFldFlag,aSpriteFlags))
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFlag);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(KLogConstruct);
+		TInt returnCode=iWsPointerCursor->Construct(aSpriteFlags);
+
+		// Check the command return code, if !=KErrNone then stop this command
+		if ( returnCode!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, returnCode);
+			SetError(returnCode);
+			}
+
+		// No command output parameter to display and check
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataWsPriorityKeyEvent.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,234 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataWsPriorityKeyEvent.h"
+#include "T_GraphicsUtil.h"
+
+/*@{*/
+//Commands
+_LIT(KCmdnew,						"new");
+_LIT(KCmdDestructor,				"~");
+_LIT(KCmdHandle,					"Handle");
+_LIT(KCmdKey,						"Key");
+_LIT(KCmdSetHandle,					"SetHandle");
+
+// Fields
+_LIT(KFldExpected,					"expected");
+_LIT(KFldExpected_Code,				"expected_code");
+_LIT(KFldExpected_Modifier,			"expected_modifier");
+_LIT(KFldExpected_Repeats,			"expected_repeats");
+_LIT(KFldExpected_ScanCode,			"expected_scancode");
+_LIT(KFldHandle,					"handle");
+
+///	Logging
+_LIT(KLogError,						"Error=%d");
+_LIT(KLogMissingParameter,			"Missing parameter '%S'");
+_LIT(KLogMissingExpectedValue,		"Missing expected value '%S'");
+_LIT(KLogNotExpectedValueInt,		"'%S' is not as expected=%d, actual=%d");
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataWsPriorityKeyEvent* CT_DataWsPriorityKeyEvent::NewL()
+	{
+	CT_DataWsPriorityKeyEvent*	ret=new (ELeave) CT_DataWsPriorityKeyEvent();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+CT_DataWsPriorityKeyEvent::CT_DataWsPriorityKeyEvent()
+:	CDataWrapperBase()
+,	iWsPriorityKeyEvent(NULL)
+	{
+	}
+
+void CT_DataWsPriorityKeyEvent::ConstructL()
+	{
+	}
+
+CT_DataWsPriorityKeyEvent::~CT_DataWsPriorityKeyEvent()
+	{
+	DestroyData();
+	}
+
+void CT_DataWsPriorityKeyEvent::SetObjectL(TAny* aAny)
+	{
+	DestroyData();
+	iWsPriorityKeyEvent = static_cast<TWsPriorityKeyEvent*> (aAny);
+	}
+
+void CT_DataWsPriorityKeyEvent::DisownObjectL()
+	{
+	iWsPriorityKeyEvent = NULL;
+	}
+
+void CT_DataWsPriorityKeyEvent::DestroyData()
+	{
+	delete iWsPriorityKeyEvent;
+	iWsPriorityKeyEvent=NULL;
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataWsPriorityKeyEvent::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool	ret = ETrue;
+	if ( aCommand==KCmdnew )
+		{
+		DoCmdnew();
+		}
+	else if ( aCommand==KCmdDestructor )
+		{
+		DestroyData();
+		}
+	else if ( aCommand==KCmdHandle )
+		{
+		DoCmdHandle(aSection);
+		}
+	else if ( aCommand==KCmdKey )
+		{
+		DoCmdKey(aSection);
+		}
+	else if ( aCommand==KCmdSetHandle )
+		{
+		DoCmdSetHandle(aSection);
+		}
+	else
+		{
+		ret=EFalse;
+		}
+
+	return ret;
+	}
+
+
+
+void CT_DataWsPriorityKeyEvent::DoCmdnew()
+	{
+	DestroyData();
+	INFO_PRINTF1(_L("execute new TWsPriorityKeyEvent()"));
+	TRAPD(err, iWsPriorityKeyEvent = new (ELeave) TWsPriorityKeyEvent());
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+
+void CT_DataWsPriorityKeyEvent::DoCmdSetHandle(const TDesC& aSection)
+	{
+	TInt	handle;
+
+	if ( !GetIntFromConfig(aSection, KFldHandle(), handle) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldHandle);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("execute SetHandle(TUint)"));
+		iWsPriorityKeyEvent->SetHandle((TUint)handle);
+		}
+	}
+
+
+void CT_DataWsPriorityKeyEvent::DoCmdHandle(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("execute Handle()"));
+	TUint	actual=iWsPriorityKeyEvent->Handle();
+	SetHandle(actual);
+
+	TInt	expected;
+	if ( GetIntFromConfig(aSection, KFldExpected, expected) )
+		{
+		if ( actual!= (TUint)expected )
+			{
+			ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected, expected, actual);
+			SetBlockResult(EFail);
+			}
+		}
+	else
+		{
+		ERR_PRINTF2(KLogMissingExpectedValue, &KFldExpected);
+		SetBlockResult(EFail);
+		}
+	}
+
+
+void CT_DataWsPriorityKeyEvent::DoCmdKey(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("execute Key()"));
+	TKeyEvent*	eventKey=iWsPriorityKeyEvent->Key();
+
+	TKeyCode	keyCode;
+	if ( CT_GraphicsUtil::ReadKeyCode(*this, aSection, KFldExpected_Code, keyCode) )
+		{
+		if ( (TUint)keyCode != eventKey->iCode )
+			{
+			ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected_Code, keyCode, eventKey->iCode);
+			SetBlockResult(EFail);
+			}
+		}
+	else
+		{
+		ERR_PRINTF2(KLogMissingExpectedValue, &KFldExpected_Code);
+		SetBlockResult(EFail);
+		}
+
+	TStdScanCode	scanCode;
+	if ( CT_GraphicsUtil::ReadStdScanCode(*this, aSection, KFldExpected_ScanCode, scanCode) )
+		{
+		if ( scanCode != eventKey->iScanCode )
+			{
+			ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected_ScanCode, scanCode, eventKey->iScanCode);
+			SetBlockResult(EFail);
+			}
+		}
+
+	TUint	modifiers;
+	if ( CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldExpected_Modifier, modifiers) )
+		{
+		if ( modifiers != eventKey->iModifiers )
+			{
+			ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected_Modifier, modifiers, eventKey->iModifiers);
+			SetBlockResult(EFail);
+			}
+		}
+
+	TInt	repeats;
+	if ( GetIntFromConfig(aSection, KFldExpected_Repeats, repeats) )
+		{
+		if ( repeats != eventKey->iRepeats )
+			{
+			ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected_Repeats, repeats, eventKey->iRepeats);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataWsRedrawEvent.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,176 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataWsRedrawEvent.h"
+
+/*@{*/
+//Commands
+_LIT(KCmdnew,						"new");
+_LIT(KCmdDestructor,				"~");
+_LIT(KCmdHandle,					"Handle");
+_LIT(KCmdRect,						"Rect");
+
+///	Fields
+_LIT(KFldExpected,					"expected");
+
+///	Logging
+_LIT(KLogError,						"Error=%d");
+_LIT(KLogMissingExpectedValue,		"Missing expected value '%S'");
+_LIT(KLogNotAsExpectedValue,		"'%S' is not as expected value");
+_LIT(KLogNotExpectedValueInt,		"'%S' is not as expected=%d, actual=%d");
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataWsRedrawEvent* CT_DataWsRedrawEvent::NewL()
+	{
+	CT_DataWsRedrawEvent*    ret=new (ELeave) CT_DataWsRedrawEvent();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+CT_DataWsRedrawEvent::CT_DataWsRedrawEvent()
+:	CDataWrapperBase()
+,	iWsRedrawEvent(NULL)
+	{
+	}
+
+void CT_DataWsRedrawEvent::ConstructL()
+	{
+	}
+
+CT_DataWsRedrawEvent::~CT_DataWsRedrawEvent()
+	{
+	DestroyData();
+	}
+
+void CT_DataWsRedrawEvent::SetObjectL(TAny* aAny)
+	{
+	DestroyData();
+	iWsRedrawEvent = static_cast<TWsRedrawEvent*> (aAny);
+	}
+
+void CT_DataWsRedrawEvent::DisownObjectL()
+	{
+	iWsRedrawEvent = NULL;
+	}
+
+void CT_DataWsRedrawEvent::DestroyData()
+	{
+	delete iWsRedrawEvent;
+	iWsRedrawEvent=NULL;
+	}
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataWsRedrawEvent::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool	ret = ETrue;
+	if ( aCommand==KCmdnew )
+		{
+		DoCmdnew();
+		}
+	else if ( aCommand==KCmdDestructor )
+		{
+		DestroyData();
+		}
+	else if ( aCommand==KCmdHandle )
+		{
+		DoCmdHandle(aSection);
+		}
+	else if ( aCommand==KCmdRect )
+		{
+		DoCmdRect(aSection);
+		}
+	else
+		{
+		ret=EFalse;
+		}
+
+	return ret;
+	}
+
+
+void CT_DataWsRedrawEvent::DoCmdnew()
+	{
+	DestroyData();
+	INFO_PRINTF1(_L("execute new TWsRedrawEvent()"));
+	TRAPD(err, iWsRedrawEvent = new (ELeave) TWsRedrawEvent());
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+
+void CT_DataWsRedrawEvent::DoCmdHandle(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("execute Handle()"));
+	TUint	actual=iWsRedrawEvent->Handle();
+	SetHandle(actual);
+
+	TInt	expected;
+	if ( !GetIntFromConfig(aSection, KFldExpected, expected) )
+		{
+		ERR_PRINTF2(KLogMissingExpectedValue, &KFldExpected);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if ( actual!=(TUint)expected )
+			{
+			ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected, expected, actual);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+void CT_DataWsRedrawEvent::DoCmdRect(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("execute Rect()"));
+	TRect	actual=iWsRedrawEvent->Rect();
+	LogRect(_L("Rect()"), actual);
+
+	TRect	expected;
+	if ( !GetRectFromConfig(aSection, KFldExpected, expected) )
+		{
+		ERR_PRINTF2(KLogMissingExpectedValue, &KFldExpected);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if ( actual!=expected )
+			{
+			ERR_PRINTF2(KLogNotAsExpectedValue, &KFldExpected);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataWsScreenDevice.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1523 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataWsScreenDevice.h"
+#include "T_GraphicsUtil.h"
+
+/*@{*/
+_LIT(KDataClassname,							"CWsScreenDevice");
+
+///	Fields
+_LIT(KFldAlgStyle,								"alg_style");
+_LIT(KFldBackLight,								"backlight");
+_LIT(KFldBitmap,								"bitmap");
+_LIT(KFldDefaultScreenNumber,					"defaultscreennumber");
+_LIT(KFldExpected,								"expected");
+_LIT(KFldExpectedCount,							"expectedcount");
+_LIT(KFldFinish,								"finish");
+_LIT(KFldFlags,									"flags");
+_LIT(KFldFormatFieldNumber,						"%S%d");
+_LIT(KFldFontUid,								"font_uid");
+_LIT(KFldMode,									"mode");
+_LIT(KFldPalette,								"palette");
+_LIT(KFldPixel,									"pixel");
+_LIT(KFldPixelSize,								"pixelsize");
+_LIT(KFldRect,									"rect");
+_LIT(KFldRect1,									"rect1");
+_LIT(KFldRect2,									"rect2");
+_LIT(KFldRotation,								"rotation");
+_LIT(KFldStart,									"start");
+_LIT(KFldTwips,									"twips");
+_LIT(KFldTwipsSize,								"twipssize");
+_LIT(KFldWindowGc,								"windowgc");
+_LIT(KFldWs,									"ws");
+_LIT(KFldFont,									"font");
+_LIT(KFldContext,								"context");
+
+///	Commands
+_LIT(KCmdnew,									"new");
+_LIT(KCmddisown,								"disown");
+_LIT(KCmdDestructor,							"~CWsScreenDevice");
+_LIT(KCmdDestructorGeneral,						"~");
+_LIT(KCmdConstruct,								"Construct");
+_LIT(KCmdCopyScreenToBitmap,					"CopyScreenToBitmap");
+_LIT(KCmdCreateContext,							"CreateContext");
+_LIT(KCmdCurrentScreenMode,						"CurrentScreenMode");
+_LIT(KCmdGetCurrentScreenModeScale,				"GetCurrentScreenModeScale");
+_LIT(KCmdGetCurrentScreenModeScaledOrigin,		"GetCurrentScreenModeScaledOrigin");
+_LIT(KCmdGetDefaultScreenModeOrigin,			"GetDefaultScreenModeOrigin");
+_LIT(KCmdGetDefaultScreenSizeAndRotation,		"GetDefaultScreenSizeAndRotation");
+_LIT(KCmdGetFontById,							"GetFontById");
+_LIT(KCmdGetRotationsList,						"GetRotationsList");
+_LIT(KCmdGetScreenModeDisplayMode,				"GetScreenModeDisplayMode");
+_LIT(KCmdGetScreenModeOrigin,					"GetScreenModeOrigin");
+_LIT(KCmdGetScreenModeScale,					"GetScreenModeScale");
+_LIT(KCmdGetScreenModeScaledOrigin,				"GetScreenModeScaledOrigin");
+_LIT(KCmdGetScreenModeSizeAndRotation,			"GetScreenModeSizeAndRotation");
+_LIT(KCmdGetScreenNumber,						"GetScreenNumber");
+_LIT(KCmdGetScreenSizeModeList,					"GetScreenSizeModeList");
+_LIT(KCmdNumScreenModes,						"NumScreenModes");
+_LIT(KCmdRectCompare,							"RectCompare");
+_LIT(KCmdPointerRect,							"PointerRect");
+_LIT(KCmdScreenModeEnforcement,					"ScreenModeEnforcement");
+_LIT(KCmdSetAppScreenMode,						"SetAppScreenMode");
+_LIT(KCmdSetBackLight,							"SetBackLight");
+_LIT(KCmdSetCustomPalette,						"SetCustomPalette");
+_LIT(KCmdSetScreenSizeAndRotation,				"SetScreenSizeAndRotation");
+
+_LIT(KCmdcheckPixels,							"checkPixels");
+_LIT(KCmdcheckLineColor,						"checkLineColor");
+_LIT(KCmdcheckRectColor,						"checkRectColor");
+
+_LIT(KFormatFieldNumber,	"%S%d");
+
+///	Logging
+_LIT(KLogColor,									"Color Red=%d Green=%d Blue=%d Alpha=%d");
+_LIT(KLogPoint,									"Point X=%d Y=%d");
+_LIT(KLogError,									"Error=%d");
+_LIT(KLogMissingParameter,						"Missing parameter '%S'");
+_LIT(KLogNotExpectedValue,						"Not expected value");
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataWsScreenDevice* CT_DataWsScreenDevice::NewL()
+/**
+ * Two phase constructor
+ */
+	{
+	CT_DataWsScreenDevice*	ret=new (ELeave) CT_DataWsScreenDevice();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+CT_DataWsScreenDevice::CT_DataWsScreenDevice()
+/**
+ * Protected constructor. First phase construction
+ */
+:	CT_DataBitmapDevice()
+,	iWsScreenDevice(NULL)
+	{
+	}
+
+void CT_DataWsScreenDevice::ConstructL()
+/**
+ * Second phase construction
+ */
+	{
+	}
+
+CT_DataWsScreenDevice::~CT_DataWsScreenDevice()
+/**
+ * Public destructor
+ */
+	{
+	DestroyData();
+	}
+
+TAny* CT_DataWsScreenDevice::GetObject()
+/**
+ * Return a pointer to the object that the data wraps
+ *
+ * @return	pointer to the object that the data wraps
+ */
+	{
+	return iWsScreenDevice;
+	}
+
+void CT_DataWsScreenDevice::SetObjectL(TAny* aAny)
+/**
+ * Set the object that the data wraps
+ *
+ * @param	aObject object that the wrapper is testing
+ *
+ */
+	{
+	DestroyData();
+	iWsScreenDevice = static_cast<CWsScreenDevice*> (aAny);
+	}
+
+void CT_DataWsScreenDevice::DisownObjectL()
+/**
+ * The object will no longer be owned by this
+ *
+ * @leave	KErrNotSupported if the the function is not supported
+ */
+	{
+	iWsScreenDevice = NULL;
+	}
+
+void CT_DataWsScreenDevice::DestroyData()
+	{
+	delete iWsScreenDevice;
+	iWsScreenDevice=NULL;
+	}
+
+MWsClientClass* CT_DataWsScreenDevice::GetClientClass() const
+	{
+	return iWsScreenDevice;
+	}
+
+MGraphicsDeviceMap*	CT_DataWsScreenDevice::GetGraphicsDeviceMap() const
+	{
+	return iWsScreenDevice;
+	}
+
+CGraphicsDevice*	CT_DataWsScreenDevice::GetGraphicsDevice() const
+	{
+	return iWsScreenDevice;
+	}
+
+CBitmapDevice*	CT_DataWsScreenDevice::GetBitmapDevice() const
+	{
+	return iWsScreenDevice;
+	}
+
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataWsScreenDevice::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	ret = ETrue;
+
+	if ( aCommand==KCmdDestructor || aCommand==KCmdDestructorGeneral )
+		{
+		DoCmdDestructor();
+		}
+	else if ( aCommand==KCmdnew || aCommand==KDataClassname )
+		{
+		DoCmdnewL(aSection);
+		}
+	else if ( aCommand==KCmddisown )
+		{
+		DisownObjectL();
+		}	
+	else if ( aCommand==KCmdConstruct )
+		{
+		DoCmdConstruct(aSection);
+		}
+	else if ( aCommand==KCmdCopyScreenToBitmap )
+		{
+		DoCmdCopyScreenToBitmapL(aSection);
+		}
+	else if ( aCommand==KCmdCreateContext )
+		{
+		DoCmdCreateContextL(aSection);
+		}
+	else if ( aCommand==KCmdCurrentScreenMode )
+		{
+		DoCmdCurrentScreenMode(aSection);
+		}
+	else if ( aCommand==KCmdGetCurrentScreenModeScale )
+		{
+		DoCmdGetCurrentScreenModeScale(aSection);
+		}
+	else if ( aCommand==KCmdGetCurrentScreenModeScaledOrigin )
+		{
+		DoCmdGetCurrentScreenModeScaledOrigin(aSection);
+		}
+	else if ( aCommand==KCmdGetDefaultScreenModeOrigin )
+		{
+		DoCmdGetDefaultScreenModeOrigin(aSection);
+		}
+	else if ( aCommand==KCmdGetDefaultScreenSizeAndRotation )
+		{
+		DoCmdGetDefaultScreenSizeAndRotation(aSection);
+		}
+	else if ( aCommand==KCmdGetFontById )
+		{
+		DoCmdGetFontByIdL(aSection);
+		}
+	else if ( aCommand==KCmdGetRotationsList )
+		{
+			DoCmdGetRotationsListL(aSection);
+		}
+	else if ( aCommand==KCmdGetScreenModeDisplayMode )
+		{
+		DoCmdGetScreenModeDisplayMode(aSection);
+		}
+	else if ( aCommand==KCmdGetScreenModeOrigin )
+		{
+		DoCmdGetScreenModeOrigin(aSection);
+		}
+	else if ( aCommand==KCmdGetScreenModeScale )
+		{
+		DoCmdGetScreenModeScale(aSection);
+		}
+	else if ( aCommand==KCmdGetScreenModeScaledOrigin )
+		{
+		DoCmdGetScreenModeScaledOrigin(aSection);
+		}
+	else if ( aCommand==KCmdGetScreenModeSizeAndRotation )
+		{
+		DoCmdGetScreenModeSizeAndRotation(aSection);
+		}
+	else if ( aCommand==KCmdGetScreenNumber )
+		{
+		DoCmdGetScreenNumber(aSection);
+		}
+	else if ( aCommand==KCmdGetScreenSizeModeList )
+		{
+		DoCmdGetScreenSizeModeListL(aSection);
+		}
+	else if ( aCommand==KCmdNumScreenModes )
+		{
+		DoCmdNumScreenModes(aSection);
+		}
+	else if ( aCommand==KCmdPointerRect )
+		{
+		DoCmdPointerRect(aSection);
+		}
+	else if ( aCommand==KCmdRectCompare )
+		{
+		DoCmdRectCompare(aSection);
+		}
+	else if ( aCommand==KCmdScreenModeEnforcement )
+		{
+		DoCmdScreenModeEnforcement(aSection);
+		}
+	else if ( aCommand==KCmdSetAppScreenMode )
+		{
+		DoCmdSetAppScreenMode(aSection);
+		}
+	else if ( aCommand==KCmdSetBackLight )
+		{
+		DoCmdSetBackLight(aSection);
+		}
+	else if ( aCommand==KCmdSetCustomPalette )
+		{
+		DoCmdSetCustomPaletteL(aSection);
+		}
+	else if ( aCommand==KCmdSetScreenSizeAndRotation )
+		{
+		DoCmdSetScreenSizeAndRotation(aSection);
+		}
+	else if ( aCommand==KCmdcheckPixels )
+		{
+		DoCmdcheckPixels(aSection);
+		}
+	else if ( aCommand==KCmdcheckLineColor )
+		{
+		DoCmdcheckLineColor(aSection);
+		}
+	else if ( aCommand==KCmdcheckRectColor )
+		{
+		DoCmdcheckRectColor(aSection);
+		}
+	else if ( CT_DataBitmapDevice::DoCommandL(aCommand, aSection, aAsyncErrorIndex) )
+		{
+		}
+	else
+		{
+		ret=CT_DataWsClientClass::DoCommandL(*this, aCommand, aSection, aAsyncErrorIndex);
+		}
+
+	return ret;
+	}
+
+/**
+Test Constructor
+*/
+void CT_DataWsScreenDevice::DoCmdnewL(const TDesC& aSection)
+	{
+	DestroyData();
+
+	// Get test data for command input parameter(s)
+	RWsSession*	ws=NULL;
+	TPtrC		wsName;
+	if ( GetStringFromConfig(aSection, KFldWs, wsName) )
+		{
+		ws = static_cast<RWsSession*>(GetDataObjectL(wsName));
+		}
+
+	TInt	err;
+	if ( ws!= NULL )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute new CWsScreenDevice(RWsSession)"));
+		TRAP( err, iWsScreenDevice = new (ELeave) CWsScreenDevice(*ws) );
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute new CWsScreenDevice()"));
+		TRAP(err, iWsScreenDevice = new (ELeave) CWsScreenDevice());
+		}
+
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+/**
+Test Destructor
+*/
+void CT_DataWsScreenDevice::DoCmdDestructor()
+	{
+	INFO_PRINTF1(_L("execute ~CWsScreenDevice()"));
+	DestroyData();
+	}
+
+/**
+Test Construct()
+*/
+void CT_DataWsScreenDevice::DoCmdConstruct(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TInt	err=KErrNone;
+
+	TInt	datDefaultScreenNumber;
+	if ( GetIntFromConfig(aSection, KFldDefaultScreenNumber, datDefaultScreenNumber) )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute Construct(TInt)"));
+		err=iWsScreenDevice->Construct(datDefaultScreenNumber);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute Construct()"));
+		err=iWsScreenDevice->Construct();
+		}
+
+	// Check the command return code.
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+/**
+Test CopyScreenToBitmap()
+*/
+void CT_DataWsScreenDevice::DoCmdCopyScreenToBitmapL(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	CFbsBitmap*	bitmap=NULL;
+	TBool	hasBitmap=CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFldBitmap, bitmap);
+	if ( !hasBitmap )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldBitmap);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		TInt	err=KErrNone;
+
+		TRect	datRect;
+		if ( GetRectFromConfig(aSection, KFldRect, datRect) )
+			{
+			INFO_PRINTF1(_L("execute CopyScreenToBitmap(CFbsBitmap, TRect)"));
+			err=iWsScreenDevice->CopyScreenToBitmap(bitmap, datRect);
+			}
+		else
+			{
+			INFO_PRINTF1(_L("execute CopyScreenToBitmap(CFbsBitmap)"));
+			err=iWsScreenDevice->CopyScreenToBitmap(bitmap);
+			}
+
+		// Check the command return code.
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		}
+	}
+
+/**
+Test CreateContext()
+*/
+void CT_DataWsScreenDevice::DoCmdCreateContextL(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TPtrC	datWindowGc;
+	if ( !GetStringFromConfig(aSection, KFldWindowGc, datWindowGc) )
+		{
+		//CT_DataBitmapDevice::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
+		
+		// get BitmapUtilData object from parameters
+		if ( !GetStringFromConfig(aSection, KFldContext, datWindowGc) )
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KFldContext());
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			CGraphicsContext*	context=NULL;
+			INFO_PRINTF1(_L("execute CreateContext(CGraphicsContext*&)"));
+			TInt	returnCode=GetGraphicsDevice()->CreateContext(context);
+			// Check the command return code.
+			if ( returnCode!=KErrNone )
+				{
+				ERR_PRINTF2(KLogError, returnCode);
+				SetError(returnCode);
+				}
+			else
+				{
+				SetDataObjectL(datWindowGc, context);
+				}
+			}
+		}
+	else
+		{
+		// Execute command and log parameters
+		CWindowGc*	windowGc;
+
+		INFO_PRINTF1(_L("execute CreateContext(CWindowGc)"));
+		TInt	returnCode = iWsScreenDevice->CreateContext(windowGc);
+
+		// Check the command return code.
+		if ( returnCode!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, returnCode);
+			SetError(returnCode);
+			}
+		else
+			{
+			SetDataObjectL(datWindowGc, windowGc);
+			}
+		}
+	}
+
+/**
+Test CurrentScreenMode()
+*/
+void CT_DataWsScreenDevice::DoCmdCurrentScreenMode(const TDesC& aSection)
+	{
+	TInt	actual=iWsScreenDevice->CurrentScreenMode();
+	INFO_PRINTF2(_L("CurrentScreenMode()=%d"), actual);
+
+	TInt	expected;
+	if ( !GetIntFromConfig(aSection, KFldExpected, expected) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldExpected);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if ( actual!=expected )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/**
+Test GetCurrentScreenModeScale()
+*/
+void CT_DataWsScreenDevice::DoCmdGetCurrentScreenModeScale(const TDesC& aSection)
+	{
+	TSize	actual=iWsScreenDevice->GetCurrentScreenModeScale();
+	INFO_PRINTF3(_L("GetCurrentScreenModeScale(TInt) height=%d width=%d"), actual.iHeight, actual.iWidth);
+
+	TSize	expected;
+	if ( !GetSizeFromConfig(aSection, KFldExpected, expected) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldExpected);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if ( actual!=expected )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/**
+Test GetCurrentScreenModeScaledOrigin()
+*/
+void CT_DataWsScreenDevice::DoCmdGetCurrentScreenModeScaledOrigin(const TDesC& aSection)
+	{
+	TPoint	actual=iWsScreenDevice->GetCurrentScreenModeScaledOrigin();
+	INFO_PRINTF3(_L("GetCurrentScreenModeScaledOrigin() x=%d y=%d"), actual.iX, actual.iY);
+
+	TPoint	expected;
+	if ( !GetPointFromConfig(aSection, KFldExpected, expected) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldExpected);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if ( actual!=expected )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/**
+Test GetDefaultScreenModeOrigin()
+*/
+void CT_DataWsScreenDevice::DoCmdGetDefaultScreenModeOrigin(const TDesC& aSection)
+	{
+	TPoint	actual=iWsScreenDevice->GetDefaultScreenModeOrigin();
+	INFO_PRINTF3(_L("GetDefaultScreenModeOrigin() x=%d y=%d"), actual.iX, actual.iY);
+
+	TPoint	expected;
+	if ( !GetPointFromConfig(aSection, KFldExpected, expected) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldExpected);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if ( actual!=expected )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/**
+Test GetDefaultScreenSizeAndRotation()
+*/
+void CT_DataWsScreenDevice::DoCmdGetDefaultScreenSizeAndRotation(const TDesC& aSection)
+	{
+	CFbsBitGc::TGraphicsOrientation	rotation;
+	TBool							checkRotation=CT_GraphicsUtil::ReadGraphicsOrientation(*this, aSection, KFldRotation, rotation);
+
+	TSize	pixelSize;
+	TBool	checkPixelSize=GetSizeFromConfig(aSection, KFldPixelSize, pixelSize);
+
+	TBool	twips=EFalse;
+	GetBoolFromConfig(aSection, KFldTwips, twips);
+	if ( twips )
+		{
+		TPixelsTwipsAndRotation	param;
+		iWsScreenDevice->GetDefaultScreenSizeAndRotation(param);
+		INFO_PRINTF2(_L("GetDefaultScreenSizeAndRotation(TPixelsTwipsAndRotation) Rotation=%d"), param.iRotation);
+		INFO_PRINTF3(_L("Pixel height=%d width=%d"), param.iPixelSize.iHeight, param.iPixelSize.iWidth);
+		INFO_PRINTF3(_L("Twips height=%d width=%d"), param.iTwipsSize.iHeight, param.iTwipsSize.iWidth);
+
+		if ( checkRotation )
+			{
+			if ( rotation!=param.iRotation )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+
+		if ( checkPixelSize )
+			{
+			if ( pixelSize!=param.iPixelSize )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+
+		TSize	twipsSize;
+		if ( GetSizeFromConfig(aSection, KFldTwipsSize, twipsSize) )
+			{
+			if ( twipsSize!=param.iTwipsSize )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	else
+		{
+		TPixelsAndRotation	param;
+		iWsScreenDevice->GetDefaultScreenSizeAndRotation(param);
+		INFO_PRINTF2(_L("GetDefaultScreenSizeAndRotation(TPixelsAndRotation) Rotation=%d"), param.iRotation);
+		INFO_PRINTF3(_L("Pixel height=%d width=%d"), param.iPixelSize.iHeight, param.iPixelSize.iWidth);
+
+		if ( checkRotation )
+			{
+			if ( rotation!=param.iRotation )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+
+		if ( checkPixelSize )
+			{
+			if ( pixelSize!=param.iPixelSize )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+/**
+Test GetFontById()
+*/
+void CT_DataWsScreenDevice::DoCmdGetFontByIdL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Call GetFontById()"));
+	TBool	dataOk=ETrue;
+
+	// get font uid from parameters
+	TInt	fontUid;
+	if(!GetIntFromConfig(aSection, KFldFontUid(), fontUid))
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(_L("No %S"), &KFldFontUid());
+		SetBlockResult(EFail);
+		}
+	// get TAlgStyle from parameters
+	TAlgStyle*	algStyle=NULL;
+	CT_GraphicsUtil::GetAlgStyleL(*this, aSection, KFldAlgStyle(), algStyle);
+	if ( algStyle==NULL )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(_L("No %S"), &KFldAlgStyle());
+		SetBlockResult(EFail);
+		}
+	// get font wrapper name
+	TPtrC datFbsFont;
+	if( !GetStringFromConfig(aSection, KFldFont, datFbsFont) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldFont());
+		SetBlockResult(EFail);
+		}
+	// call GetFontById()
+	else
+		{
+		if ( dataOk )
+			{
+			CFont* fbsFont=NULL;
+			INFO_PRINTF1(_L("execute GetFontById(CFont *&aFont, TUid aUid, const TAlgStyle &aAlgStyle)"));
+			TInt err = iWsScreenDevice->GetFontById(fbsFont, TUid::Uid(fontUid), *algStyle);
+			
+			if ( err!=KErrNone )
+				{
+				ERR_PRINTF2(KLogError, err);
+				SetError(err);
+				}
+			else
+				{
+				SetDataObjectL(datFbsFont, fbsFont);
+				}
+			}
+		}
+	}
+
+/**
+Test GetRotationsList()
+*/
+void CT_DataWsScreenDevice::DoCmdGetRotationsListL(const TDesC& aSection)
+	{
+	CArrayFixFlat<TInt>*	rotations=new(ELeave) CArrayFixFlat<TInt>(1);
+	CleanupStack::PushL(rotations);
+
+	TInt	mode=0;
+	if ( !GetIntFromConfig(aSection, KFldMode, mode) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldMode);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		TInt	err=iWsScreenDevice->GetRotationsList(mode, rotations);
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		else
+			{
+			INFO_PRINTF2(_L("GetRotationsList count=%d"), rotations->Count());
+			TInt	expectedCount;
+			if ( GetIntFromConfig(aSection, KFldExpectedCount, expectedCount) )
+				{
+				if ( expectedCount!=rotations->Count() )
+					{
+					ERR_PRINTF1(KLogNotExpectedValue);
+					SetBlockResult(EFail);
+					}
+				else
+					{
+					INFO_PRINTF1(_L("Check elements in the rotations list"));
+					TBuf<KMaxTestExecuteCommandLength>	tempStore;
+
+					TBool	ok=ETrue;
+					for ( TInt index = 0; (index < expectedCount) && (ok); )
+						{
+						tempStore.Format(KFormatFieldNumber, &KFldRotation, ++index);
+						
+						CFbsBitGc::TGraphicsOrientation	rotation;
+						ok = CT_GraphicsUtil::ReadGraphicsOrientation(*this, aSection, tempStore, rotation);
+						if ( !ok )
+							{
+							ERR_PRINTF2(KLogMissingParameter, &tempStore);
+							SetBlockResult(EFail);
+							}
+						else
+							{
+							if( rotation != (*rotations)[index-1])
+								{
+								ERR_PRINTF1(KLogNotExpectedValue);
+								SetBlockResult(EFail);
+								ok = EFalse;
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+
+	CleanupStack::PopAndDestroy();
+	}
+
+/**
+Test GetScreenModeDisplayMode()
+*/
+void CT_DataWsScreenDevice::DoCmdGetScreenModeDisplayMode(const TDesC& aSection)
+	{
+	TInt	mode=0;
+	if ( !GetIntFromConfig(aSection, KFldMode, mode) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldMode);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		TDisplayMode	actual=iWsScreenDevice->GetScreenModeDisplayMode(mode);
+		INFO_PRINTF2(_L("GetScreenModeDisplayMode(TInt)=%d"), actual);
+
+		TDisplayMode	expected;
+		if ( !CT_GraphicsUtil::ReadDisplayMode(*this, aSection, KFldExpected, expected) )
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KFldExpected);
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			if ( actual!=expected )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+/**
+Test GetScreenModeOrigin()
+*/
+void CT_DataWsScreenDevice::DoCmdGetScreenModeOrigin(const TDesC& aSection)
+	{
+	TInt	mode=0;
+	if ( !GetIntFromConfig(aSection, KFldMode, mode) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldMode);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		TPoint	actual=iWsScreenDevice->GetScreenModeOrigin(mode);
+		INFO_PRINTF3(_L("GetScreenModeOrigin(TInt) x=%d y=%d"), actual.iX, actual.iY);
+
+		TPoint	expected;
+		if ( !GetPointFromConfig(aSection, KFldExpected, expected) )
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KFldExpected);
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			if ( actual!=expected )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+/**
+Test GetScreenModeScale()
+*/
+void CT_DataWsScreenDevice::DoCmdGetScreenModeScale(const TDesC& aSection)
+	{
+	TInt	mode=0;
+	if ( !GetIntFromConfig(aSection, KFldMode, mode) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldMode);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		TSize	actual=iWsScreenDevice->GetScreenModeScale(mode);
+		INFO_PRINTF3(_L("GetScreenModeScale(TInt) height=%d width=%d"), actual.iHeight, actual.iWidth);
+
+		TSize	expected;
+		if ( !GetSizeFromConfig(aSection, KFldExpected, expected) )
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KFldExpected);
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			if ( actual!=expected )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+/**
+Test GetScreenModeScaledOrigin()
+*/
+void CT_DataWsScreenDevice::DoCmdGetScreenModeScaledOrigin(const TDesC& aSection)
+	{
+	TInt	mode=0;
+	if ( !GetIntFromConfig(aSection, KFldMode, mode) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldMode);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		TPoint	actual=iWsScreenDevice->GetScreenModeScaledOrigin(mode);
+		INFO_PRINTF3(_L("GetScreenModeScaledOrigin(TInt) x=%d y=%d"), actual.iX, actual.iY);
+
+		TPoint	expected;
+		if ( !GetPointFromConfig(aSection, KFldExpected, expected) )
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KFldExpected);
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			if ( actual!=expected )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+/**
+Test GetScreenModeSizeAndRotation()
+*/
+void CT_DataWsScreenDevice::DoCmdGetScreenModeSizeAndRotation(const TDesC& aSection)
+	{
+	TInt	mode=0;
+	if ( !GetIntFromConfig(aSection, KFldMode, mode) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldMode);
+		SetBlockResult(EFail);
+		}
+
+	CFbsBitGc::TGraphicsOrientation	rotation;
+	TBool							checkRotation=CT_GraphicsUtil::ReadGraphicsOrientation(*this, aSection, KFldRotation, rotation);
+
+	TSize	pixelSize;
+	TBool	checkPixelSize=GetSizeFromConfig(aSection, KFldPixelSize, pixelSize);
+
+	TBool	twips=EFalse;
+	GetBoolFromConfig(aSection, KFldTwips, twips);
+	if ( twips )
+		{
+		TPixelsTwipsAndRotation	param;
+		iWsScreenDevice->GetScreenModeSizeAndRotation(mode, param);
+		INFO_PRINTF2(_L("GetScreenModeSizeAndRotation(TInt, TPixelsTwipsAndRotation) Rotation=%d"), param.iRotation);
+		INFO_PRINTF3(_L("Pixel height=%d width=%d"), param.iPixelSize.iHeight, param.iPixelSize.iWidth);
+		INFO_PRINTF3(_L("Twips height=%d width=%d"), param.iTwipsSize.iHeight, param.iTwipsSize.iWidth);
+
+		if ( checkRotation )
+			{
+			if ( rotation!=param.iRotation )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+
+		if ( checkPixelSize )
+			{
+			if ( pixelSize!=param.iPixelSize )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+
+		TSize	twipsSize;
+		if ( GetSizeFromConfig(aSection, KFldTwipsSize, twipsSize) )
+			{
+			if ( twipsSize!=param.iTwipsSize )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	else
+		{
+		TPixelsAndRotation	param;
+		iWsScreenDevice->GetScreenModeSizeAndRotation(mode, param);
+		INFO_PRINTF2(_L("GetScreenModeSizeAndRotation(TInt, TPixelsAndRotation) Rotation=%d"), param.iRotation);
+		INFO_PRINTF3(_L("Pixel height=%d width=%d"), param.iPixelSize.iHeight, param.iPixelSize.iWidth);
+
+		if ( checkRotation )
+			{
+			if ( rotation!=param.iRotation )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+
+		if ( checkPixelSize )
+			{
+			if ( pixelSize!=param.iPixelSize )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+/**
+Test GetScreenNumber()
+*/
+void CT_DataWsScreenDevice::DoCmdGetScreenNumber(const TDesC& aSection)
+	{
+	// Execute command and log parameters
+	TInt	actual=iWsScreenDevice->GetScreenNumber();
+	INFO_PRINTF2(_L("execute GetScreenNumber()=%d"), actual);
+
+	// Diaplay command return value, check if it matches the expected value
+	TInt	expected;
+	if ( !GetIntFromConfig(aSection, KFldExpected, expected) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldExpected);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if ( actual!=expected )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/**
+Test GetScreenSizeModeList()
+*/
+void CT_DataWsScreenDevice::DoCmdGetScreenSizeModeListL(const TDesC& aSection)
+	{
+	RArray<TInt>	screenModes;
+	CleanupClosePushL(screenModes);
+
+	TInt	number = iWsScreenDevice->GetScreenSizeModeList(&screenModes);
+
+	if (number < 0)
+		{
+		ERR_PRINTF2(KLogError, number);
+		SetError(number);
+		}
+	else
+		{
+		INFO_PRINTF2(_L("GetScreenSizeModeList count=%d"), screenModes.Count());
+		TInt	expectedCount;
+		if ( GetIntFromConfig(aSection, KFldExpectedCount, expectedCount) )
+			{
+			if ( expectedCount!=screenModes.Count() || expectedCount != number)
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			else
+				{
+				INFO_PRINTF1(_L("Check elements in the modes list"));
+				TBuf<KMaxTestExecuteCommandLength>	tempStore;
+
+				TBool	ok=ETrue;
+				for ( TInt index = 0; (index < number) && (ok); )
+					{
+					tempStore.Format(KFormatFieldNumber, &KFldMode, ++index);
+					
+					TInt expectedMode = 0;
+					ok=GetIntFromConfig(aSection, tempStore, expectedMode);
+					if ( !ok )
+						{
+						ERR_PRINTF2(KLogMissingParameter, &tempStore);
+						SetBlockResult(EFail);
+						}
+					else
+						{
+						if( expectedMode != screenModes[index-1])
+							{
+							ERR_PRINTF1(KLogNotExpectedValue);
+							SetBlockResult(EFail);
+							ok = EFalse;
+							}
+						}
+					}
+				}
+			}
+		}
+
+	CleanupStack::PopAndDestroy(&screenModes);
+	}
+
+/**
+Test NumScreenModes()
+*/
+void CT_DataWsScreenDevice::DoCmdNumScreenModes(const TDesC& aSection)
+	{
+	TInt	actual=iWsScreenDevice->NumScreenModes();
+	INFO_PRINTF2(_L("NumScreenModes()=%d"), actual);
+
+	TInt	expected;
+	if ( GetIntFromConfig(aSection, KFldExpected, expected) )
+		{
+		if ( actual!=expected )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/**
+Test PointerRect()
+*/
+void CT_DataWsScreenDevice::DoCmdPointerRect(const TDesC& aSection)
+	{
+	TRect	actual=iWsScreenDevice->PointerRect();
+	LogRect(_L("PointerRect()"), actual);
+
+	TRect	expected;
+	if ( GetRectFromConfig(aSection, KFldExpected, expected) )
+		{
+		if ( actual!=expected )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/**
+Test RectCompare()
+*/
+void CT_DataWsScreenDevice::DoCmdRectCompare(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TRect	datRect1;
+	if ( !GetRectFromConfig(aSection, KFldRect1, datRect1) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldRect1);
+		SetBlockResult(EFail);
+		}
+
+	TRect	datRect2;
+	if ( !GetRectFromConfig(aSection, KFldRect2, datRect2) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldRect2);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		TBool	actual=EFalse;
+
+		// Execute command and log parameters
+		TUint	datFlags;
+		if ( CT_GraphicsUtil::ReadSpriteInCompare(*this, aSection, KFldFlags, datFlags) )
+			{
+			actual=iWsScreenDevice->RectCompare(datRect1, datRect2, datFlags);
+			INFO_PRINTF2(_L("execute RectCompare(TRect, TRect, TUint)=%d"), actual);
+			}
+		else
+			{
+			actual=iWsScreenDevice->RectCompare(datRect1, datRect2);
+			INFO_PRINTF2(_L("execute RectCompare(TRect, TRect)=%d"), actual);
+			}
+
+		// Diaplay command return value, check if it matches the expected value
+		TBool	expected;
+		if ( !GetBoolFromConfig(aSection, KFldExpected, expected) )
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KFldExpected);
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			if ( actual!=expected )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+/**
+Test ScreenModeEnforcement()
+*/
+void CT_DataWsScreenDevice::DoCmdScreenModeEnforcement(const TDesC& aSection)
+	{
+	TScreenModeEnforcement	actual=iWsScreenDevice->ScreenModeEnforcement();
+	INFO_PRINTF2(_L("execute ScreenModeEnforcement()=%d"), actual);
+
+	TScreenModeEnforcement	expected;
+	if ( CT_GraphicsUtil::ReadScreenModeEnforcement(*this, aSection, KFldExpected, expected) )
+		{
+		if ( actual!=expected )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+/**
+Test SetAppScreenMode()
+*/
+void CT_DataWsScreenDevice::DoCmdSetAppScreenMode(const TDesC& aSection)
+	{
+	TInt	mode;
+	if ( !GetIntFromConfig(aSection, KFldMode, mode) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldRect2);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("SetAppScreenMode()"));
+		iWsScreenDevice->SetAppScreenMode(mode);
+		}
+	}
+
+/**
+Test SetBackLight()
+*/
+void CT_DataWsScreenDevice::DoCmdSetBackLight(const TDesC& aSection)
+	{
+	TBool	backLight;
+	if ( !GetBoolFromConfig(aSection, KFldBackLight, backLight) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldBackLight);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		TInt	err=iWsScreenDevice->SetBackLight(backLight);
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		}
+	}
+
+/**
+Test SetCustomPalette()
+*/
+void CT_DataWsScreenDevice::DoCmdSetCustomPaletteL(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("Calls CWsScreenDevice::SetCustomPalette() by previously created palette"));
+
+	// get CPalette object passed as a parameter
+	CPalette*	palette = NULL;
+	
+	if(!CT_GraphicsUtil::GetPaletteL(*this, aSection, KFldPalette(), palette))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldPalette);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// call SetPalette()
+		TInt err = iWsScreenDevice->SetCustomPalette(palette);
+		if(err != KErrNone)
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		}	
+	}
+
+/**
+Test SetScreenSizeAndRotation()
+*/
+void CT_DataWsScreenDevice::DoCmdSetScreenSizeAndRotation(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	CFbsBitGc::TGraphicsOrientation	rotation;
+	if ( !CT_GraphicsUtil::ReadGraphicsOrientation(*this, aSection, KFldRotation, rotation) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldRotation);
+		SetBlockResult(EFail);
+		}
+
+	TSize	pixelSize;
+	if ( !GetSizeFromConfig(aSection, KFldPixelSize, pixelSize) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldPixelSize);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		TSize	twipsSize;
+		if ( GetSizeFromConfig(aSection, KFldTwipsSize, twipsSize) )
+			{
+			TPixelsTwipsAndRotation	param;
+			param.iPixelSize=pixelSize;
+			param.iRotation=rotation;
+			param.iTwipsSize=twipsSize;
+			INFO_PRINTF1(_L("execute SetScreenSizeAndRotation(const TPixelsTwipsAndRotation&)"));
+			iWsScreenDevice->SetScreenSizeAndRotation(param);
+			}
+		else
+			{
+			TPixelsAndRotation	param;
+			param.iPixelSize=pixelSize;
+			param.iRotation=rotation;
+			INFO_PRINTF1(_L("execute SetScreenSizeAndRotation(const TPixelsAndRotation&)"));
+			iWsScreenDevice->SetScreenSizeAndRotation(param);
+			}
+		}
+	}
+
+/**
+* The source codes hereafter are NOT simple wrapper functions of CWsScreenDevice class,
+* but use combinations of CWsScreenDevice (and other) class functions to check if what
+* take from the CWsScreenDevice matches with the expected value specified in TEF testdata.
+*
+*/
+
+/**
+* DoCmdcheckPixels: to check the color of specified pixels on the screen device, and compare
+* with the expected color specidied in the TEF testdata.
+*		pixel<n>: specify the position of the screen device to check
+*		expected<n>: specify the expected color to be compared with
+*
+*/
+void CT_DataWsScreenDevice::DoCmdcheckPixels(const TDesC& aSection)
+	{
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+
+	TBool	moreData=ETrue;
+	for ( TInt index=1; moreData; ++index )
+		{
+		// get the pixel position on the screen to check/verify
+		tempStore.Format(KFldFormatFieldNumber, &KFldPixel, index);
+		TPoint	point;
+		if ( !GetPointFromConfig(aSection, tempStore, point) )
+			{
+			moreData=EFalse;
+			}
+		else
+			{
+			TRgb	actual;
+			iWsScreenDevice->GetPixel(actual, point);
+
+			tempStore.Format(KFldFormatFieldNumber, &KFldExpected, index);
+			TRgb	expected;
+			if ( GetRgbFromConfig(aSection, tempStore, expected) )
+				{
+				if ( actual!=expected )
+					{
+					ERR_PRINTF5(KLogColor, actual.Red(), actual.Green(), actual.Blue(), actual.Alpha());
+					ERR_PRINTF5(KLogColor, expected.Red(), expected.Green(), expected.Blue(), expected.Alpha());
+					SetBlockResult(EFail);
+					}
+				}
+			}
+		}
+	}
+
+/**
+* DoCmdcheckLineColor: to check the color of specified lines on the screen device, and compare
+* with the expected color specidied in the TEF testdata.
+*		start<n>: specify the starting position of the line on the screen device to check
+*		finish<n>: specify the finish position of the line on the screen device to check
+*		expected<n>: specify the expected color to be compared with
+* Note: the straight line (from start to the finish points) is constructed by TLinearDDA
+*
+*/
+void CT_DataWsScreenDevice::DoCmdcheckLineColor(const TDesC& aSection)
+	{
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+
+	CPalette*	palette=NULL;
+	iWsScreenDevice->GetPalette(palette);
+
+	TBool	moreData=ETrue;
+	for ( TInt index=1; moreData; ++index )
+		{
+		// get the the start and finish points of the line to check/verify
+		tempStore.Format(KFldFormatFieldNumber, &KFldStart, index);
+		TPoint	startPoint;
+		if ( !GetPointFromConfig(aSection, tempStore, startPoint) )
+			{
+			moreData=EFalse;
+			}
+
+		tempStore.Format(KFldFormatFieldNumber, &KFldFinish, index);
+		TPoint	endPoint;
+		if ( !GetPointFromConfig(aSection, tempStore, endPoint) )
+			{
+			moreData=EFalse;
+			}
+
+		if ( moreData )
+			{
+			// get the expected color from testdata
+			tempStore.Format(KFldFormatFieldNumber, &KFldExpected, index);
+			TRgb	expected;
+			if ( !GetRgbFromConfig(aSection, tempStore, expected) )
+				{
+				ERR_PRINTF2(KLogMissingParameter, &tempStore);
+				SetBlockResult(EFail);
+				}
+			else
+				{
+				if ( palette!=NULL )
+					{
+					expected=palette->NearestEntry(expected);
+					}
+
+				TLinearDDA	lineDDA;
+				lineDDA.Construct(startPoint, endPoint, TLinearDDA::ECenter);
+
+				// for each pixels on the line (from start to finish points), check if its color matches expected
+				TPoint	point;
+				while ( !lineDDA.SingleStep(point) )
+					{
+					TRgb	actual;
+					iWsScreenDevice->GetPixel(actual, point);
+
+					if ( actual!=expected )
+						{
+						ERR_PRINTF5(KLogColor, actual.Red(), actual.Green(), actual.Blue(), actual.Alpha());
+						ERR_PRINTF5(KLogColor, expected.Red(), expected.Green(), expected.Blue(), expected.Alpha());
+						ERR_PRINTF3(KLogPoint, point.iX, point.iY);
+						SetBlockResult(EFail);
+						}
+					}
+				}
+			}
+		}
+
+	delete palette;
+	}
+
+/**
+* DoCmdcheckRectColor: to check the color of specified rectangle on the screen device, and
+* compare with the expected color specidied in the TEF testdata.
+*		rect<n>: specify the rectangle area on the screen device to check
+*		expected<n>: specify the expected color to be compared with
+*
+*/
+void CT_DataWsScreenDevice::DoCmdcheckRectColor(const TDesC& aSection)
+	{
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+
+	CPalette*	palette=NULL;
+	iWsScreenDevice->GetPalette(palette);
+
+	TBool	moreData=ETrue;
+	for ( TInt index=1; moreData; ++index )
+		{
+		// get the the rectangle to check/verify
+		tempStore.Format(KFldFormatFieldNumber, &KFldRect, index);
+		TRect	rect;
+		if ( !GetRectFromConfig(aSection, tempStore, rect) )
+			{
+			moreData=EFalse;
+			}
+		else
+			{
+			// get the expected color from testdata
+			tempStore.Format(KFldFormatFieldNumber, &KFldExpected, index);
+			TRgb	expected;
+			if ( !GetRgbFromConfig(aSection, tempStore, expected) )
+				{
+				ERR_PRINTF2(KLogMissingParameter, &tempStore);
+				SetBlockResult(EFail);
+				}
+			else
+				{
+				if ( palette!=NULL )
+					{
+					expected=palette->NearestEntry(expected);
+					}
+
+				TPoint	point;
+				for ( point.iX=rect.iTl.iX; point.iX<rect.iBr.iX; ++point.iX)
+					{
+					for ( point.iY=rect.iTl.iY; point.iY<rect.iBr.iY; ++point.iY )
+						{
+						TRgb	actual;
+						iWsScreenDevice->GetPixel(actual, point);
+
+						if ( actual!=expected )
+							{
+							ERR_PRINTF5(KLogColor, actual.Red(), actual.Green(), actual.Blue(), actual.Alpha());
+							ERR_PRINTF5(KLogColor, expected.Red(), expected.Green(), expected.Blue(), expected.Alpha());
+							ERR_PRINTF3(KLogPoint, point.iX, point.iY);
+							SetBlockResult(EFail);
+							}
+						}
+					}
+				}
+			}
+		}
+
+	delete palette;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataWsSession.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,2440 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_DataWsSession.h"
+#include "T_GraphicsUtil.h"
+#include "T_DataWindowGroup.h"
+
+//	EPOC Includes
+#include <apgtask.h>
+#include <w32std.h>
+#include <gdi.h>
+
+/*@{*/
+_LIT(KDataClassname,							"RWsSession");
+
+///	Fields
+_LIT(KFldCheckWithStore,						"checkwithstore");
+_LIT(KFldExpected,								"expected");
+_LIT(KFldKeyCode,								"keycode");
+_LIT(KFldModifier,								"modifier");
+_LIT(KFldModifierMask,							"modifiermask");
+_LIT(KFldModifiers,								"modifiers");
+_LIT(KFldNullPointer,							"nullpointer");
+_LIT(KFldOffset,								"offset");
+_LIT(KFldRepeats,								"repeats");
+_LIT(KFldStdScanCode,							"stdscancode");
+_LIT(KFldType,									"type");
+_LIT(KFldStore,									"store");
+_LIT(KFldPos,									"pos");
+_LIT(KFldDeviceNumber,							"devicenumber");
+_LIT(KFldTip,									"tip");
+_LIT(KFldIdentifier,							"identifier");
+_LIT(KFldSpriteMember,							"spritemember");
+_LIT(KFldSpriteFlags,							"spriteflags");
+_LIT(KFldAlignment,								"alignment");
+_LIT(KFldWindowGroup,							"windowgroup");
+
+///	Parameters
+
+_LIT(KLogMessage,	 							"logMessage");
+_LIT(KLogCommand,	 							"logCommand");
+_LIT(KTPoint,	 								"point");
+_LIT(KInputWGId,			  					"inputWGId");
+_LIT(KBGColour,									"bgcolour");
+_LIT(KInputCursorNumber,						"inputcursornumber");
+_LIT(KComputeMode,								"computemode");
+_LIT(KInputScrnNo,	  							"inputscreenno");
+_LIT(KDefDisplayMode,	  						"defDisplayMode");
+_LIT(KDefModeMaxNumColor,	  					"defModeMaxNumColor");
+_LIT(KDefModeMaxNumGray,	  					"defModeMaxNumGray");
+_LIT(KWindowGroupIdentifier,					"wgIdentifier");
+_LIT(KInputDefaultCursorNumber,					"defaultsyscurnum");
+_LIT(KUseRfs,									"userfs");
+_LIT(KExpectedHeapCount,    					"heapCount");
+_LIT(KExpectPtrCursorMode,    					"expectptrcurmode");
+_LIT(KExpectBgColour,							"expectbgcolour");
+_LIT(KExpectedDiff,								"expected_diff");
+_LIT(KSetBuffer,			  					"setbuffer");
+_LIT(KSetMaxBuffer,			  					"setmaxbuffer");
+_LIT(KSetFocusScreen,		  					"setfocusscreen");
+_LIT(KSetEventOffOn,							"seteventoffon");
+_LIT(KWTreeNodeObj,								"treenodeobj");
+_LIT(KExpectShadowVector,						"expectshdwvet");
+_LIT(KAutoFlushState,		  					"newFlushstate");
+_LIT(KExpectFlushState,		  					"expectedFlushstate");
+_LIT(KVersionBuild,			  					"build");
+_LIT(KVersionMajor,			  					"major");
+_LIT(KVersionMinor,			  					"minor");
+_LIT(KWGUseArray,			  					"usearray");
+_LIT(KWGListPriority,							"priority");
+_LIT(KWGGivenPriority,							"givenwgpriority");
+_LIT(KWGSpecifieScrnNo,							"specifiescrnno");
+_LIT(KWGScreenNumber,							"screennum");
+_LIT(KWGOrdinalId,								"identifier");
+_LIT(KWGOrdinalPosition,						"position");
+_LIT(KWGOrdinalPriority,						"wgid");
+_LIT(KWGinquiredId,								"inquiredwgid");
+_LIT(KFindWGPreId,								"prewgid");
+_LIT(KMatchWGString,							"matchwgname");
+_LIT(KThreadId,									"threadid");
+_LIT(KRequestEvent,								"requestevent");
+_LIT(KRequestRedraw,							"requestRedraw");
+_LIT(KPKPriorityKey,							"prioritykey");
+_LIT(KSetHotKey,								"hotkey");
+_LIT(KClsHotKey,								"clshotkey");
+_LIT(KRestoreDefHotKey,							"restoredefhk");
+_LIT(KSetKeyCode,								"keycode");
+_LIT(KDblClickInterval,							"maxinterval");
+_LIT(KDblClickDistance,							"maxdistance");
+_LIT(KExpectedDblMaxInitialTime,				"expecteddblmaxinittime");
+_LIT(KExpectedDblDistance,						"expecteddblmaxdistance");
+_LIT(KSetKBRepRateInterval,						"kbreprateinterval");
+_LIT(KSetKBRepRateTime,							"kbrepratetime");
+_LIT(KWGGetExpectedKBInitialTime,				"expectedkbinittime");
+_LIT(KWGGetExpectedKBRepeatTime,				"expectedkbRepeattime");
+_LIT(KSetSysFading,								"sysfadonoff");
+_LIT(KSetblackMapFading,						"blackmapfading");
+_LIT(KSetwhiteMapFading,						"whitemapfading");
+_LIT(KSetDefblackMapFading,						"defblackmapfading");
+_LIT(KSetDefwhiteMapFading,						"defwhitemapfading");
+_LIT(KSetShadowVec,								"shadowvector");
+_LIT(KSetScrnSizeMode,							"screensizemode");
+_LIT(KSetPtrCurPosValue,						"ptrcurpos");
+_LIT(KPtrCurPosArea,							"ptrcurarea");
+_LIT(KSetPtrCurMode,							"pointercurmode");
+_LIT(KSetCltCurMode,							"cltcurmode");
+_LIT(KInputPermanentModifier,					"inputpermanmodif");
+_LIT(KInputPermanentModifierState,				"inputpermanmodifstate");
+
+//Commands
+_LIT(KCmdnew,									"new");
+_LIT(KCmdConnect,								"Connect");
+_LIT(KCmdClose,									"Close");
+_LIT(KCmdVersion,								"Version");
+_LIT(KCmdSetHotKey,								"SetHotKey");
+_LIT(KCmdClearHotKeys,							"ClearHotKeys");
+_LIT(KCmdRestoreDefaultHotKey,					"RestoreDefaultHotKey");
+_LIT(KCmdEventReady,							"EventReady");
+_LIT(KCmdEventReadyCancel,						"EventReadyCancel");
+_LIT(KCmdGetEvent,								"GetEvent");
+_LIT(KCmdPurgePointerEvents,					"PurgePointerEvents");
+_LIT(KCmdRedrawReady,							"RedrawReady");
+_LIT(KCmdRedrawReadyCancel,						"RedrawReadyCancel");
+_LIT(KCmdGetRedraw,								"GetRedraw");
+_LIT(KCmdPriorityKeyReady,						"PriorityKeyReady");
+_LIT(KCmdPriorityKeyReadyCancel,				"PriorityKeyReadyCancel");
+_LIT(KCmdGetPriorityKey,						"GetPriorityKey");
+_LIT(KCmdFlush,									"Flush");
+_LIT(KCmdSetAutoFlush,							"SetAutoFlush");
+_LIT(KCmdSetKeyboardRepeatRate,					"SetKeyboardRepeatRate");
+_LIT(KCmdGetKeyboardRepeatRate,					"GetKeyboardRepeatRate");
+_LIT(KCmdGetDoubleClickSettings,				"GetDoubleClickSettings");
+_LIT(KCmdSetDoubleClick,						"SetDoubleClick");
+_LIT(KCmdNumWindowGroups,						"NumWindowGroups");
+_LIT(KCmdWindowGroupList,						"WindowGroupList");
+_LIT(KCmdGetFocusWindowGroup,					"GetFocusWindowGroup");
+_LIT(KCmdGetDefaultOwningWindow,				"GetDefaultOwningWindow");
+_LIT(KCmdSetWindowGroupOrdinalPosition,			"SetWindowGroupOrdinalPosition");
+_LIT(KCmdGetWindowGroupClientThreadId,			"GetWindowGroupClientThreadId");
+_LIT(KCmdGetWindowGroupHandle,					"GetWindowGroupHandle");
+_LIT(KCmdGetWindowGroupOrdinalPriority,			"GetWindowGroupOrdinalPriority");
+_LIT(KCmdGetWindowGroupNameFromIdentifier,		"GetWindowGroupNameFromIdentifier");
+_LIT(KCmdFindWindowGroupIdentifier,				"FindWindowGroupIdentifier");
+_LIT(KCmdFetchMessage,							"FetchMessage");
+_LIT(KCmdSetShadowVector,						"SetShadowVector");
+_LIT(KCmdShadowVector,							"ShadowVector");
+_LIT(KCmdSetBackgroundColor,					"SetBackgroundColor");
+_LIT(KCmdGetBackgroundColor,					"GetBackgroundColor");
+_LIT(KCmdSetSystemPointerCursor,				"SetSystemPointerCursor");
+_LIT(KCmdClearSystemPointerCursor,				"ClearSystemPointerCursor");
+_LIT(KCmdClaimSystemPointerCursorList,			"ClaimSystemPointerCursorList");
+_LIT(KCmdFreeSystemPointerCursorList,			"FreeSystemPointerCursorList");
+_LIT(KCmdSetCustomTextCursor,					"SetCustomTextCursor");
+_LIT(KCmdResourceCount,							"ResourceCount");
+_LIT(KCmdPasswordEntered,						"PasswordEntered");
+_LIT(KCmdComputeMode,							"ComputeMode");
+_LIT(KCmdHeapCount,								"HeapCount");
+_LIT(KCmdSetModifierState,						"SetModifierState");
+_LIT(KCmdGetModifierState,						"GetModifierState");
+_LIT(KCmdRequestOffEvents,						"RequestOffEvents");
+_LIT(KCmdGetDefModeMaxNumColors,				"GetDefModeMaxNumColors");
+_LIT(KCmdGetColorModeList,						"GetColorModeList");
+_LIT(KCmdSetPointerCursorArea,					"SetPointerCursorArea");
+_LIT(KCmdPointerCursorArea,						"PointerCursorArea");
+_LIT(KCmdSetPointerCursorMode,					"SetPointerCursorMode");
+_LIT(KCmdSetClientCursorMode,					"SetClientCursorMode");
+_LIT(KCmdPointerCursorMode,						"PointerCursorMode");
+_LIT(KCmdSetDefaultSystemPointerCursor,			"SetDefaultSystemPointerCursor");
+_LIT(KCmdClearDefaultSystemPointerCursor,		"ClearDefaultSystemPointerCursor");
+_LIT(KCmdSetPointerCursorPosition,				"SetPointerCursorPosition");
+_LIT(KCmdPointerCursorPosition,					"PointerCursorPosition");
+_LIT(KCmdSetDefaultFadingParameters,			"SetDefaultFadingParameters");
+_LIT(KCmdPrepareForSwitchOff,					"PrepareForSwitchOff");
+_LIT(KCmdSetBufferSizeL,						"SetBufferSizeL");
+_LIT(KCmdSetMaxBufferSizeL,						"SetMaxBufferSizeL");
+_LIT(KCmdSetSystemFaded,						"SetSystemFaded");
+_LIT(KCmdSetFocusScreen,						"SetFocusScreen");
+_LIT(KCmdGetFocusScreen,						"GetFocusScreen");
+_LIT(KCmdClearAllRedrawStores,					"ClearAllRedrawStores");
+_LIT(KCmdLogCommand,							"LogCommand");
+_LIT(KCmdLogMessage,							"LogMessage");
+_LIT(KCmdNumberOfScreens,						"NumberOfScreens");
+_LIT(KCmdSimulateRawEvent,						"SimulateRawEvent");
+_LIT(KCmdSimulateKeyEvent,						"SimulateKeyEvent");
+
+///	Logging
+_LIT(KLogError,									"Error=%d");
+_LIT(KLogMissingParameter,						"Missing parameter '%S'");
+_LIT(KLogNotExpectedValue,						"Not expected value");
+
+//constants 
+const TInt  KGroupNameMaxSize =100;
+
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataWsSession* CT_DataWsSession::NewL()
+	{
+	CT_DataWsSession*    ret=new (ELeave) CT_DataWsSession();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+CT_DataWsSession::CT_DataWsSession()
+:	CDataWrapperBase()
+,	iWsSession(NULL)
+,	iResourceCount(0)
+,	iNumWinGroup(0)
+,	iColorModeCount(0)
+,	iWindowGroupIdentifier(0)
+,	iActiveEventReady(NULL)
+,	iActivePriorityKeyReady(NULL)
+,	iActiveRedrawReady(NULL)
+	{
+	}
+
+void CT_DataWsSession::ConstructL()
+	{
+	iActiveEventReady=CActiveCallback::NewL(*this);
+	iActivePriorityKeyReady=CActiveCallback::NewL(*this);
+	iActiveRedrawReady=CActiveCallback::NewL(*this);
+	}
+
+CT_DataWsSession::~CT_DataWsSession()
+	{
+	DestroyData();
+	delete iActiveRedrawReady;
+	iActiveRedrawReady=NULL;
+	delete iActivePriorityKeyReady;
+	iActivePriorityKeyReady=NULL;
+	delete iActiveEventReady;
+	iActiveEventReady=NULL;
+	}
+
+void CT_DataWsSession::SetObjectL(TAny* aAny)
+	{
+	DestroyData();
+	iWsSession = static_cast<RWsSession*> (aAny);
+	}
+
+void CT_DataWsSession::DisownObjectL()
+	{
+	iWsSession = NULL;
+	}
+
+void CT_DataWsSession::DestroyData()
+	{
+	delete iWsSession;
+	iWsSession=NULL;
+	}
+
+MWsClientClass* CT_DataWsSession::GetClientClass() const
+	{
+	return iWsSession;
+	}
+
+
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataWsSession::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	ret = ETrue;
+
+	if ( aCommand==KCmdnew || aCommand==KDataClassname )
+		{
+		DoCmdnew();
+		}
+	else if ( aCommand==KCmdConnect )
+		{
+		DoCmdConnectL(aSection);
+		}
+	else if ( aCommand==KCmdClose )
+		{
+		DoCmdClose();
+		}
+	else if ( aCommand==KCmdVersion )
+		{
+		DoCmdVersion(aSection);
+		}
+	else if ( aCommand==KCmdSetHotKey )
+		{
+		DoCmdSetHotKey(aSection);
+		}
+	else if ( aCommand==KCmdClearHotKeys )
+		{
+		DoCmdClearHotKeys(aSection);
+		}
+	else if ( aCommand==KCmdRestoreDefaultHotKey )
+		{
+		DoCmdRestoreDefaultHotKey(aSection);
+		}
+	else if ( aCommand==KCmdEventReady )
+		{
+		DoCmdEventReady(aSection, aAsyncErrorIndex);
+		}
+	else if ( aCommand==KCmdEventReadyCancel )
+		{
+		DoCmdEventReadyCancel();
+		}
+	else if ( aCommand==KCmdGetEvent )
+		{
+		DoCmdGetEventL(aSection);
+		}
+	else if ( aCommand==KCmdPurgePointerEvents )
+		{
+		DoCmdPurgePointerEvents();
+		}
+	else if ( aCommand==KCmdRedrawReady )
+		{
+		DoCmdRedrawReady(aSection, aAsyncErrorIndex);
+		}
+	else if ( aCommand==KCmdRedrawReadyCancel )
+		{
+		DoCmdRedrawReadyCancel();
+		}
+	else if ( aCommand==KCmdGetRedraw )
+		{
+		DoCmdGetRedrawL(aSection);
+		}
+	else if ( aCommand==KCmdPriorityKeyReady )
+		{
+		DoCmdPriorityKeyReady(aSection, aAsyncErrorIndex);
+		}
+	else if ( aCommand==KCmdPriorityKeyReadyCancel )
+		{
+		DoCmdPriorityKeyReadyCancel();
+		}
+	else if ( aCommand==KCmdGetPriorityKey )
+		{
+		DoCmdGetPriorityKeyL(aSection);
+		}
+	else if ( aCommand==KCmdFlush )
+		{
+		DoCmdFlush();
+		}
+	else if ( aCommand==KCmdSetAutoFlush )
+		{
+		DoCmdSetAutoFlush(aSection);
+		}
+	else if ( aCommand==KCmdSetKeyboardRepeatRate )
+		{
+		DoCmdSetKeyboardRepeatRate(aSection);
+		}
+	else if ( aCommand==KCmdGetKeyboardRepeatRate )
+		{
+		DoCmdGetKeyboardRepeatRate(aSection);
+		}
+	else if ( aCommand==KCmdGetDoubleClickSettings )
+		{
+		DoCmdGetDoubleClickSettings(aSection);
+		}
+	else if ( aCommand==KCmdSetDoubleClick )
+		{
+		DoCmdSetDoubleClick(aSection);
+		}
+	else if ( aCommand==KCmdNumWindowGroups )
+		{
+		DoCmdNumWindowGroups(aSection);
+		}
+	else if ( aCommand==KCmdWindowGroupList )
+		{
+		DoCmdWindowGroupListL(aSection);
+		}
+	else if ( aCommand==KCmdGetFocusWindowGroup )
+		{
+		DoCmdGetFocusWindowGroup(aSection);
+		}
+	else if ( aCommand==KCmdGetDefaultOwningWindow )
+		{
+		DoCmdGetDefaultOwningWindow(aSection);
+		}
+	else if ( aCommand==KCmdSetWindowGroupOrdinalPosition )
+		{
+		DoCmdSetWindowGroupOrdinalPosition(aSection);
+		}
+	else if ( aCommand==KCmdGetWindowGroupClientThreadId )
+		{
+		DoCmdGetWindowGroupClientThreadId(aSection);
+		}
+	else if ( aCommand==KCmdGetWindowGroupHandle )
+		{
+		DoCmdGetWindowGroupHandle(aSection);
+		}
+	else if ( aCommand==KCmdGetWindowGroupOrdinalPriority )
+		{
+		DoCmdGetWindowGroupOrdinalPriority(aSection);
+		}
+	else if ( aCommand==KCmdGetWindowGroupNameFromIdentifier )
+		{
+		DoCmdGetWindowGroupNameFromIdentifier(aSection);
+		}
+	else if ( aCommand==KCmdFindWindowGroupIdentifier )
+		{
+		DoCmdFindWindowGroupIdentifier(aSection);
+		}
+	else if ( aCommand==KCmdFetchMessage )
+		{
+		DoCmdFetchMessage(aSection);
+		}
+	else if ( aCommand==KCmdSetShadowVector )
+		{
+		DoCmdSetShadowVector(aSection);
+		}
+	else if ( aCommand==KCmdShadowVector )
+		{
+		DoCmdShadowVector(aSection);
+		}
+	else if ( aCommand==KCmdSetBackgroundColor )
+		{
+		DoCmdSetBackgroundColor(aSection);
+		}
+	else if ( aCommand==KCmdGetBackgroundColor )
+		{
+		DoCmdGetBackgroundColor(aSection);
+		}
+	else if ( aCommand==KCmdSetSystemPointerCursor )
+		{
+		DoCmdSetSystemPointerCursor(aSection);
+		}
+	else if ( aCommand==KCmdClearSystemPointerCursor )
+		{
+		DoCmdClearSystemPointerCursor(aSection);
+		}
+	else if ( aCommand==KCmdClaimSystemPointerCursorList )
+		{
+		DoCmdClaimSystemPointerCursorList();
+		}
+	else if ( aCommand==KCmdFreeSystemPointerCursorList )
+		{
+		DoCmdFreeSystemPointerCursorList();
+		}
+	else if ( aCommand==KCmdSetCustomTextCursor )
+		{
+		DoCmdSetCustomTextCursorL(aSection);
+		}
+	else if ( aCommand==KCmdResourceCount )
+		{
+		DoCmdResourceCount(aSection);
+		}
+	else if ( aCommand==KCmdPasswordEntered )
+		{
+		DoCmdPasswordEntered();
+		}
+	else if ( aCommand==KCmdComputeMode )
+		{
+		DoCmdComputeMode(aSection);
+		}
+	else if ( aCommand==KCmdHeapCount )
+		{
+		DoCmdHeapCount(aSection);
+		}
+	else if ( aCommand==KCmdSetModifierState )
+		{
+		DoCmdSetModifierState(aSection);
+		}
+	else if ( aCommand==KCmdGetModifierState )
+		{
+		DoCmdGetModifierState(aSection);
+		}
+	else if ( aCommand==KCmdRequestOffEvents )
+		{
+		DoCmdRequestOffEventsL(aSection);
+		}
+	else if ( aCommand==KCmdGetDefModeMaxNumColors )
+		{
+		DoCmdGetDefModeMaxNumColors(aSection);
+		}
+	else if ( aCommand==KCmdGetColorModeList )
+		{
+		DoCmdGetColorModeListL(aSection);
+		}
+	else if ( aCommand==KCmdSetPointerCursorArea )
+		{
+		DoCmdSetPointerCursorArea(aSection);
+		}
+	else if ( aCommand==KCmdPointerCursorArea )
+		{
+		DoCmdPointerCursorArea(aSection);
+		}
+	else if ( aCommand==KCmdSetPointerCursorMode )
+		{
+		DoCmdSetPointerCursorMode(aSection);
+		}
+	else if ( aCommand==KCmdSetClientCursorMode )
+		{
+		DoCmdSetClientCursorMode(aSection);
+		}
+	else if ( aCommand==KCmdPointerCursorMode )
+		{
+		DoCmdPointerCursorMode(aSection);
+		}
+	else if ( aCommand==KCmdSetDefaultSystemPointerCursor )
+		{
+		DoCmdSetDefaultSystemPointerCursor(aSection);
+		}
+	else if ( aCommand==KCmdClearDefaultSystemPointerCursor )
+		{
+		DoCmdClearDefaultSystemPointerCursor();
+		}
+	else if ( aCommand==KCmdSetPointerCursorPosition )
+		{
+		DoCmdSetPointerCursorPosition(aSection);
+		}
+	else if ( aCommand==KCmdPointerCursorPosition )
+		{
+		DoCmdPointerCursorPosition(aSection);
+		}
+	else if ( aCommand==KCmdSetDefaultFadingParameters )
+		{
+		DoCmdSetDefaultFadingParameters(aSection);
+		}
+	else if ( aCommand==KCmdPrepareForSwitchOff )
+		{
+		DoCmdPrepareForSwitchOff();
+		}
+	else if ( aCommand==KCmdSetBufferSizeL )
+		{
+		DoCmdSetBufferSizeL(aSection);
+		}
+	else if ( aCommand==KCmdSetMaxBufferSizeL )
+		{
+		DoCmdSetMaxBufferSizeL(aSection);
+		}
+	else if ( aCommand==KCmdSetSystemFaded )
+		{
+		DoCmdSetSystemFaded(aSection);
+		}
+	else if ( aCommand==KCmdSetFocusScreen )
+		{
+		DoCmdSetFocusScreen(aSection);
+		}
+	else if ( aCommand==KCmdGetFocusScreen )
+		{
+		DoCmdGetFocusScreen(aSection);
+		}
+	else if ( aCommand==KCmdClearAllRedrawStores )
+		{
+		DoCmdClearAllRedrawStores();
+		}
+	else if ( aCommand==KCmdLogCommand )
+		{
+		DoCmdLogCommand(aSection);
+		}
+	else if ( aCommand==KCmdLogMessage )
+		{
+		DoCmdLogMessage(aSection);
+		}
+	else if ( aCommand==KCmdNumberOfScreens )
+		{
+		DoCmdNumberOfScreens(aSection);
+		}
+	else if ( aCommand==KCmdSimulateRawEvent )
+		{
+		DoCmdSimulateRawEvent(aSection);
+		}
+	else if ( aCommand==KCmdSimulateKeyEvent )
+		{
+		DoCmdSimulateKeyEvent(aSection);
+		}
+	else
+		{
+		ret=CT_DataWsClientClass::DoCommandL(*this, aCommand, aSection, aAsyncErrorIndex);
+		}
+
+	return ret;
+	}
+
+
+void CT_DataWsSession::DoCmdnew()
+	{
+	INFO_PRINTF1(_L("Session is going to create"));
+	TRAPD(err,	iWsSession = new (ELeave) RWsSession());
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+void CT_DataWsSession::DoCmdConnectL(const TDesC& aSection)
+	{
+	TBool	useRfs=EFalse;
+	GetBoolFromConfig(aSection, KUseRfs(), useRfs);
+
+	TInt	err=KErrNone;
+	if ( useRfs )
+		{
+		INFO_PRINTF1(_L("RWsSession::Connect(RFs&) call"));
+		err=iWsSession->Connect(FileServer());
+		}
+	else
+		{
+		INFO_PRINTF1(_L("RWsSession::Connect() call"));
+		err=iWsSession->Connect();
+		}
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+void CT_DataWsSession::DoCmdClose()
+	{
+	INFO_PRINTF1(_L("RWsSession::Close() call"));
+	iWsSession->Close();
+	}
+
+void CT_DataWsSession::DoCmdVersion(const TDesC& aSection)
+	{
+	INFO_PRINTF1(_L("WsSession::Version() call"));
+
+	TVersion		version		= iWsSession->Version();
+
+	INFO_PRINTF2(_L("Version build : %d"), (TInt)version.iBuild);
+	INFO_PRINTF2(_L("Version major : %d"), (TInt)version.iMajor);
+	INFO_PRINTF2(_L("Version minor : %d"), (TInt)version.iMinor);
+	TInt	intTemp;
+	if ( GetIntFromConfig(aSection, KVersionBuild(), intTemp) )
+		{
+		if ( intTemp != version.iBuild )
+			{
+			ERR_PRINTF1(_L("Build does not match expected build"));
+			SetBlockResult(EFail);
+			}
+		}
+
+	if ( GetIntFromConfig(aSection, KVersionMajor(), intTemp) )
+		{
+		if ( intTemp != version.iMajor )
+			{
+			ERR_PRINTF1(_L("Major does not match expected major"));
+			SetBlockResult(EFail);
+			}
+		}
+
+	if ( GetIntFromConfig(aSection, KVersionMinor(), intTemp) )
+		{
+		if ( intTemp != version.iMinor )
+			{
+			ERR_PRINTF1(_L("Minor does not match expected minor"));
+			SetBlockResult(EFail);
+			}
+		}
+
+	if (version.Name() == _L("") && version.iBuild == 0 && version.iMajor == 0 && version.iMinor == 0)
+		{
+		ERR_PRINTF1(_L("Some version fields are not set!"));
+		SetBlockResult(EFail);
+		}
+	}
+
+void CT_DataWsSession::DoCmdSetHotKey(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	THotKey	hotKey;
+	
+	TInt	err=KErrNone;
+	
+	if ( !CT_GraphicsUtil::ReadHotKey(*this, aSection, KSetHotKey(), hotKey) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KSetHotKey());
+		SetBlockResult(EFail);
+		}
+
+	TKeyCode	keyCode;
+	if ( !CT_GraphicsUtil::ReadKeyCode(*this, aSection, KSetKeyCode(), keyCode) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KSetKeyCode());
+		SetBlockResult(EFail);
+		}
+
+	TUint	modifierMask=EModifierAlt | EModifierCtrl | EModifierShift | EModifierFunc | EModifierCapsLock;
+	CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldModifierMask, modifierMask);
+	TUint	modifier=EModifierAlt | EModifierCtrl | EModifierShift | EModifierFunc | EModifierCapsLock;
+	CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldModifier, modifier);
+	if ( dataOk )
+		{
+		err = iWsSession->SetHotKey(hotKey, keyCode, modifierMask, modifier);
+		}
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+void CT_DataWsSession::DoCmdClearHotKeys(const TDesC& aSection)
+	{
+	THotKey	hotKey;
+	
+	TInt	err=KErrNone;
+	
+	if ( !CT_GraphicsUtil::ReadHotKey(*this, aSection, KClsHotKey(), hotKey) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KClsHotKey());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		err = iWsSession->ClearHotKeys(hotKey);
+		}
+	
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+void CT_DataWsSession::DoCmdRestoreDefaultHotKey(const TDesC& aSection)
+	{
+	THotKey	hotKey;
+	
+	TInt	err=KErrNone;
+	
+	if ( !CT_GraphicsUtil::ReadHotKey(*this, aSection, KRestoreDefHotKey(), hotKey) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KRestoreDefHotKey());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		err = iWsSession->RestoreDefaultHotKey(hotKey);
+		}
+	
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+void CT_DataWsSession::DoCmdEventReady(const TDesC& aSection, TInt aAsyncErrorIndex)
+	{
+	CActive::TPriority	priority=CActive::EPriorityHigh;
+	CT_GraphicsUtil::ReadPriority(*this, aSection, KRequestEvent(), priority);
+
+	iActiveEventReady->SetPriority(priority);
+	INFO_PRINTF1(_L("RWsSession::EventReady() call"));
+	iWsSession->EventReady(&iActiveEventReady->iStatus);
+	iActiveEventReady->Activate(aAsyncErrorIndex);
+	IncOutstanding();
+	}
+
+void CT_DataWsSession::DoCmdEventReadyCancel()
+	{
+	iWsSession->EventReadyCancel();
+	}
+
+void CT_DataWsSession::DoCmdGetEventL(const TDesC& aSection)
+	{
+	TWsEvent	event;
+
+	iWsSession->GetEvent(event);
+	INFO_PRINTF1(_L("RWsSession::GetEvent() call"));
+
+	TWsEvent*	store=NULL;
+	if ( CT_GraphicsUtil::GetWsEventL(*this, aSection, KFldStore(), store) )
+		{
+		*store=event;
+		}
+	}
+
+void CT_DataWsSession::DoCmdPurgePointerEvents()
+	{
+	// Execute command and log parameters
+	INFO_PRINTF3(_L("execute %S::%S()"), &KDataClassname, &KCmdPurgePointerEvents);
+	iWsSession->PurgePointerEvents();
+	}
+
+void CT_DataWsSession::DoCmdRedrawReady(const TDesC& aSection, TInt aAsyncErrorIndex)
+	{
+	CActive::TPriority	priority=CActive::EPriorityHigh;
+	CT_GraphicsUtil::ReadPriority(*this, aSection, KRequestRedraw(), priority);
+
+	iActiveRedrawReady->SetPriority(priority);
+	INFO_PRINTF1(_L("RWsSession::RedrawReady() call"));
+	iWsSession->RedrawReady(&iActiveRedrawReady->iStatus);
+	iActiveRedrawReady->Activate(aAsyncErrorIndex);
+	IncOutstanding();
+	}
+
+void CT_DataWsSession::DoCmdRedrawReadyCancel()
+	{
+	INFO_PRINTF1(_L("RWsSession::RedrawReadyCancel() call"));
+	iWsSession->RedrawReadyCancel();
+	}
+
+void CT_DataWsSession::DoCmdGetRedrawL(const TDesC& aSection)
+	{
+	TWsRedrawEvent 	redrawEvent;
+
+	iWsSession->GetRedraw(redrawEvent);
+	INFO_PRINTF1(_L("RWsSession::GetRedraw() call"));
+
+	TWsRedrawEvent*	store=NULL;
+	if ( CT_GraphicsUtil::GetWsRedrawEventL(*this, aSection, KFldStore(), store) )
+		{
+		*store=redrawEvent;
+		}
+	}
+
+void CT_DataWsSession::DoCmdPriorityKeyReady(const TDesC& aSection, TInt aAsyncErrorIndex)
+	{
+	CActive::TPriority	priority=CActive::EPriorityHigh;
+	CT_GraphicsUtil::ReadPriority(*this, aSection, KPKPriorityKey(), priority);
+
+	iActivePriorityKeyReady->SetPriority(priority);
+	INFO_PRINTF1(_L("RWsSession::PriorityKeyReady() call"));
+	iWsSession->PriorityKeyReady(&iActivePriorityKeyReady->iStatus);
+	iActivePriorityKeyReady->Activate(aAsyncErrorIndex);
+	IncOutstanding();
+	}
+
+
+void CT_DataWsSession::DoCmdPriorityKeyReadyCancel()
+	{
+	INFO_PRINTF1(_L("RWsSession::PriorityKeyReadyCancel() call"));
+	iWsSession->PriorityKeyReadyCancel();
+	}
+
+void CT_DataWsSession::DoCmdGetPriorityKeyL(const TDesC& aSection)
+	{
+	TWsPriorityKeyEvent  	event;
+
+	iWsSession->GetPriorityKey(event);
+	INFO_PRINTF1(_L("RWsSession::GetPriorityKey() call"));
+
+	TWsPriorityKeyEvent *	store=NULL;
+	if ( CT_GraphicsUtil::GetWsPriorityKeyEventL(*this, aSection, KFldStore(), store) )
+		{
+		*store=event;
+		}
+	}
+
+void CT_DataWsSession::DoCmdFlush()
+	{
+	INFO_PRINTF1(_L("RWsSession::Flush() call"));
+	iWsSession->Flush();
+	}
+
+void CT_DataWsSession::DoCmdSetAutoFlush(const TDesC& aSection)
+	{
+	TBool	actualFlushstate;
+	TBool	setFlushState=EFalse;
+	TBool	expectedFlush=EFalse;
+
+	if ( !GetBoolFromConfig(aSection, KAutoFlushState(), setFlushState) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KAutoFlushState());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		actualFlushstate = iWsSession->SetAutoFlush(setFlushState);
+		INFO_PRINTF2(_L("Flush State: %d"),actualFlushstate);
+		
+		if ( !GetBoolFromConfig(aSection, KExpectFlushState(), expectedFlush) )
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KExpectFlushState());
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			if ( actualFlushstate!=expectedFlush)
+				{
+				ERR_PRINTF1(_L("SetAutoFlush is not as expected!"));
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+void CT_DataWsSession::DoCmdSetKeyboardRepeatRate(const TDesC& aSection)
+	{
+    TInt	setInputInterval=iKeyboardRepeateRateInitialTime.Int();
+    GetIntFromConfig(aSection, KSetKBRepRateInterval(), setInputInterval);
+
+	TInt	setInputTime=iKeyboardRepeateRateTime.Int();
+	GetIntFromConfig(aSection, KSetKBRepRateTime(), setInputTime);
+
+	TTimeIntervalMicroSeconds32 changeInitialTime(setInputInterval);
+	TTimeIntervalMicroSeconds32 changeTime(setInputTime);
+	iWsSession->SetKeyboardRepeatRate(changeInitialTime, changeTime);
+	}
+
+void CT_DataWsSession::DoCmdGetKeyboardRepeatRate(const TDesC& aSection)
+	{
+	TTimeIntervalMicroSeconds32	actualInitialTime;
+	TTimeIntervalMicroSeconds32	actualTime;
+	iWsSession->GetKeyboardRepeatRate(actualInitialTime, actualTime);
+	INFO_PRINTF2(_L("actual Interval Time: %d"), actualInitialTime.Int());
+	INFO_PRINTF2(_L("actual Time: %d"), actualTime.Int());
+
+	TInt	expectInitialTime;
+	if(	GetIntFromConfig(aSection, KWGGetExpectedKBInitialTime(), expectInitialTime))
+		{
+		if ( actualInitialTime.Int()!=expectInitialTime )
+			{
+			ERR_PRINTF1(_L("GetKeyboardRepeatRate is not as expected!"));
+			SetBlockResult(EFail);
+			}
+		}
+
+	TInt	expectTime;
+	if ( GetIntFromConfig(aSection, KWGGetExpectedKBRepeatTime(), expectTime) )
+		{
+		if ( actualTime.Int()!=expectTime)
+			{
+			ERR_PRINTF1(_L("GetKeyboardRepeatRate is not as expected!"));
+			SetBlockResult(EFail);
+			}
+		}
+
+	TBool	checkWithStore=FALSE;
+	GetBoolFromConfig(aSection, KFldCheckWithStore(), checkWithStore);
+	if ( checkWithStore )
+		{
+		if ( iKeyboardRepeateRateInitialTime!=actualInitialTime )
+			{
+			ERR_PRINTF1(_L("GetKeyboardRepeatRate is not as expected!"));
+			SetBlockResult(EFail);
+			}
+		if ( iKeyboardRepeateRateTime!=actualTime )
+			{
+			ERR_PRINTF1(_L("GetKeyboardRepeatRate is not as expected!"));
+			SetBlockResult(EFail);
+			}
+		}
+
+	TBool	store=FALSE;
+	GetBoolFromConfig(aSection, KFldStore(), store);
+	if ( store )
+		{
+		iKeyboardRepeateRateInitialTime=actualInitialTime;
+		iKeyboardRepeateRateTime=actualTime;
+		}
+	}
+
+void CT_DataWsSession::DoCmdSetDoubleClick(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+    TInt	setMaxInputInterval;
+    if ( !GetIntFromConfig(aSection, KDblClickInterval(), setMaxInputInterval) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KDblClickInterval());
+		SetBlockResult(EFail);
+		}
+
+	TInt	setMaxDistance;
+	if ( !GetIntFromConfig(aSection, KDblClickDistance(), setMaxDistance) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KDblClickDistance());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		TTimeIntervalMicroSeconds32	changeMaxIntervalTime(setMaxInputInterval);
+		iWsSession->SetDoubleClick(changeMaxIntervalTime, setMaxDistance);
+		}
+	}
+
+void CT_DataWsSession::DoCmdGetDoubleClickSettings(const TDesC& aSection)
+	{
+	TTimeIntervalMicroSeconds32	actualMaxIntervalValue;
+	TInt						actualMaxDistanceValue;
+	iWsSession->GetDoubleClickSettings(actualMaxIntervalValue, actualMaxDistanceValue);
+	INFO_PRINTF2(_L("Maximum interval: %d"), actualMaxIntervalValue.Int());
+	INFO_PRINTF2(_L("Maximum distance : %d"), actualMaxDistanceValue);
+
+	TInt	expectMaxIntervalValue;
+	if ( !GetIntFromConfig(aSection, KExpectedDblMaxInitialTime(), expectMaxIntervalValue))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KExpectedDblMaxInitialTime());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if ( actualMaxIntervalValue.Int()!=expectMaxIntervalValue )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+
+	TInt	expectMaxDistanceValue;
+	if ( !GetIntFromConfig(aSection, KExpectedDblDistance(), expectMaxDistanceValue))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KExpectedDblDistance());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if ( actualMaxDistanceValue!=expectMaxDistanceValue)
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataWsSession::DoCmdNumWindowGroups(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+	TInt	previousCount=iNumWinGroup;
+
+#if defined(SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS)
+	TInt	priority;
+	if ( GetIntFromConfig(aSection, KWGGivenPriority(), priority) )
+		{
+		TInt	screenNumber=0;
+		if ( !GetIntFromConfig(aSection, KWGSpecifieScrnNo(), screenNumber) )
+			{
+			iNumWinGroup=iWsSession->NumWindowGroups(priority);
+			INFO_PRINTF2(_L("NumWindowGroups(TInt aPriority):%d"), iNumWinGroup);
+			}
+		else
+			{
+			iNumWinGroup=iWsSession->NumWindowGroups(screenNumber, priority);
+			INFO_PRINTF2(_L("NumWindowGroups(TInt aScreenNumber, TInt aPriority):%d"), iNumWinGroup);
+			}
+		}
+	else
+#endif
+		{
+		iNumWinGroup=iWsSession->NumWindowGroups();
+		INFO_PRINTF2(_L("NumWindowGroups():%d"), iNumWinGroup);
+		}
+
+	if ( dataOk )
+		{
+		TInt	difference=0;
+		if ( GetIntFromConfig(aSection, KExpectedDiff(), difference) )
+			{
+			if ( (iNumWinGroup-previousCount)!=difference )
+				{
+				ERR_PRINTF2(_L("Previous count:%d"), previousCount);
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+void CT_DataWsSession::DoCmdWindowGroupListL(const TDesC& aSection)
+	{
+	INFO_PRINTF2(_L("iNumWinGroup:%d"), iNumWinGroup);
+	RArray<RWsSession::TWindowGroupChainInfo>	numWGListRArray(1);
+	CArrayFixFlat<TInt>*						numWGListCArray=new (ELeave) CArrayFixFlat<TInt>(iNumWinGroup);
+	CleanupStack::PushL(numWGListCArray);
+	CleanupClosePushL(numWGListRArray);
+
+	//True:CArrayFixFlat  Flase:RArray
+	TInt	priority;
+#if defined(SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS)
+	TBool	hasPriority=CT_GraphicsUtil::ReadPriorities(*this, aSection, KWGListPriority(), priority);
+#else
+	TBool	hasPriority=GetIntFromConfig(aSection, KWGListPriority(), priority);
+#endif
+
+	TBool	useClassArray;
+	if ( !GetBoolFromConfig(aSection, KWGUseArray(), useClassArray) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KWGUseArray());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		TInt	err=KErrNone;
+		INFO_PRINTF2(_L("Use Class array:%d"), useClassArray);
+		
+		if ( useClassArray )
+			{
+			if(	hasPriority )
+				{
+#if defined(SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS)
+				TInt	theScrnNum;
+				if(	GetIntFromConfig(aSection, KWGScreenNumber(), theScrnNum))
+					{
+					INFO_PRINTF1(_L("WindowGroupList(CArrayFixFlat< TInt >*, TInt, TInt)"));
+					err=iWsSession->WindowGroupList(numWGListCArray, theScrnNum, priority);
+					}
+				else
+#endif
+					{
+					INFO_PRINTF1(_L("WindowGroupList(TInt, CArrayFixFlat<TInt>*)"));
+					err=iWsSession->WindowGroupList(priority, numWGListCArray);
+					}
+				}
+			else
+				{
+				INFO_PRINTF1(_L("WindowGroupList(CArrayFixFlat<TInt>*)"));
+				err=iWsSession->WindowGroupList(numWGListCArray);
+				}
+			}
+		else
+			{
+			if ( hasPriority )
+				{
+				INFO_PRINTF1(_L("WindowGroupList(TInt, RArray<RWsSession::TWindowGroupChainInfo>*)"));
+				err=iWsSession->WindowGroupList(priority, &numWGListRArray);
+				}
+			else
+				{
+				INFO_PRINTF1(_L("WindowGroupList(RArray<RWsSession::TWindowGroupChainInfo>)"));
+				err=iWsSession->WindowGroupList(&numWGListRArray);
+				}
+			}
+
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		else
+			{
+			if ( useClassArray )
+				{
+				TInt	actual=0;
+				INFO_PRINTF2(_L("numWGListCArray:%d"), numWGListCArray->Count());
+				for ( TInt index=0; index<numWGListCArray->Count(); ++index )
+					{
+					// Gets a list of identifiers of all window groups in all window server sessions
+					actual=(*numWGListCArray)[index];
+					INFO_PRINTF3(_L("CArrayFixFlat[%d]= :%d"), index, actual);
+					}
+				}
+			else
+				{
+				RWsSession::TWindowGroupChainInfo	actual;
+				INFO_PRINTF2(_L("numWGListRArray:%d"), numWGListRArray.Count());
+				for ( TInt index=0; index<numWGListRArray.Count(); ++index )
+					{
+					// Gets a list of identifiers of all window groups in all window server sessions
+					actual=numWGListRArray[index];
+					INFO_PRINTF4(_L("RArray{%d] iId:%d iParentId:%d"), index, actual.iId, actual.iParentId);
+					}
+				}
+			}
+		}
+
+	CleanupStack::PopAndDestroy(2, numWGListCArray);
+	}
+
+void CT_DataWsSession::DoCmdGetFocusWindowGroup(const TDesC& aSection)
+	{
+	TInt	actual=0;
+
+#if defined(SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS)
+	TInt	theScrnNum=0;
+	if ( GetIntFromConfig(aSection, KWGScreenNumber(), theScrnNum) )
+		{
+		INFO_PRINTF1(_L("RWsSession::GetFocusWindowGroup(TInt aScreenNumber)  call"));
+		actual=iWsSession->GetFocusWindowGroup(theScrnNum);
+		}
+	else
+#endif
+		{
+		INFO_PRINTF1(_L("RWsSession::GetFocusWindowGroup() call"));
+		actual=iWsSession->GetFocusWindowGroup();
+		}
+	INFO_PRINTF2(_L("Window Group Identifier:%d"), actual);
+
+	TInt 	expected=0;
+	if ( GetIntFromConfig(aSection, KFldExpected(), expected) )
+		{
+		if ( actual!=expected )
+			{
+			ERR_PRINTF1(_L("Window group identifier is not as expected!"));
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataWsSession::DoCmdGetDefaultOwningWindow(const TDesC& aSection)
+	{
+	TInt	actual=0;
+	TBool	dataOk=ETrue;
+
+	TInt	theScrnNum=0;
+	if(	GetIntFromConfig(aSection, KWGScreenNumber(), theScrnNum))
+		{
+#if defined(SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS)
+		INFO_PRINTF1(_L("RWsSession::GetDefaultOwningWindow(TInt aScreenNumber)  call"));
+		actual=iWsSession->GetDefaultOwningWindow(theScrnNum);
+#else
+		dataOk=EFalse;
+		ERR_PRINTF1(_L("SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS Not Supported"));
+		SetBlockResult(EFail);
+#endif
+		}
+	else
+		{
+		INFO_PRINTF1(_L("RWsSession::GetDefaultOwningWindow()  call"));
+		actual=iWsSession->GetDefaultOwningWindow();
+		}
+
+	if ( dataOk )
+		{
+		INFO_PRINTF2(_L("default owning window:%d"), actual);
+
+		TInt	expected=0;
+		if ( !GetIntFromConfig(aSection, KFldExpected(), expected) )
+			{
+			ERR_PRINTF2(KLogMissingParameter, &KFldExpected());
+			SetBlockResult(EFail);
+			}
+		else
+			{
+			if ( actual!=expected)
+				{
+				ERR_PRINTF1(_L("Default Owning Window is not as expected!"));
+				SetBlockResult(EFail);
+				}
+			}
+		}
+	}
+
+void CT_DataWsSession::DoCmdSetWindowGroupOrdinalPosition(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	TInt		 inputWGId;
+	if ( !GetIntFromConfig(aSection, KWGOrdinalId(), inputWGId) )
+		{
+		TPtrC		 objectName;
+		if ( GetStringFromConfig(aSection, KFldWindowGroup(), objectName) )
+			 {
+			 INFO_PRINTF1(_L("Get CT_DataWindowGroup's wrapper. "));
+			 CDataWrapperBase* wrapper = NULL;
+			 wrapper = static_cast<CDataWrapperBase*>(GetDataWrapperL(objectName));
+			 if(wrapper)
+				 {
+				 inputWGId=wrapper->GetIdentifier();
+				 INFO_PRINTF2(_L("Window group's identifier is: %d"), inputWGId);
+				 }
+			 else
+				 {
+				 dataOk=EFalse;
+				 ERR_PRINTF1(_L("Window group's wrapper pointer is NULL"));
+				 SetBlockResult(EFail);
+				 }
+			 }
+		else
+			 {
+			 dataOk=EFalse;
+			 ERR_PRINTF2(KLogMissingParameter, &KWGOrdinalId());
+			 SetBlockResult(EFail);
+			 }
+		}
+   	
+	TInt	inputWGOrdinalPos;
+	if ( !GetIntFromConfig(aSection, KWGOrdinalPosition(), inputWGOrdinalPos) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KWGOrdinalPosition());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		TInt	err=iWsSession->SetWindowGroupOrdinalPosition(inputWGId, inputWGOrdinalPos);
+
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		}
+	}
+
+void CT_DataWsSession::DoCmdGetWindowGroupClientThreadId(const TDesC& aSection)
+	{
+	TInt	inputWindowGroupIdentifier=0;
+	if ( !GetIntFromConfig(aSection, KWindowGroupIdentifier(), inputWindowGroupIdentifier) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KWindowGroupIdentifier());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		TThreadId	threadId;
+		TInt		err=iWsSession->GetWindowGroupClientThreadId(inputWindowGroupIdentifier, threadId);
+		TUint64		actual=threadId.Id();
+		INFO_PRINTF1(_L("RWsSession::GetWindowGroupClientThreadId"));
+		INFO_PRINTF2(_L("actual ThreadId:%d"), actual);
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		}
+	}
+
+void CT_DataWsSession::DoCmdGetWindowGroupHandle(const TDesC& aSection)
+    {
+	TInt	inputWGId=0;
+	if ( !GetIntFromConfig(aSection, KInputWGId(), inputWGId) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KInputWGId());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		TInt	actual=iWsSession->GetWindowGroupHandle(inputWGId);
+		INFO_PRINTF2(_L("Window group handle :%d"), actual);
+		}
+    }
+
+void CT_DataWsSession::DoCmdGetWindowGroupOrdinalPriority(const TDesC& aSection)
+    {
+	TInt	inputWGId=0;
+	if ( !GetIntFromConfig(aSection, KWGOrdinalPriority(), inputWGId))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KWGOrdinalPriority());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		TInt	actual=iWsSession->GetWindowGroupOrdinalPriority(inputWGId);
+		INFO_PRINTF2(_L("Window Group Ordinal Priority:%d"), actual);
+		
+		TInt	expected;
+		if ( GetIntFromConfig(aSection, KFldExpected(), expected) )
+			{
+			if ( actual!=expected )
+				{
+				ERR_PRINTF1(KLogNotExpectedValue);
+				SetBlockResult(EFail);
+				}
+			}
+		}
+    }
+
+void CT_DataWsSession::DoCmdGetWindowGroupNameFromIdentifier(const TDesC& aSection)
+	{
+	TInt 	inquiredWGId=0;
+	TInt	rtnStatus;
+
+	if ( !GetIntFromConfig(aSection, KWGinquiredId(), inquiredWGId) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KWGinquiredId());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		TBuf<KGroupNameMaxSize> storeAWindowName;
+		INFO_PRINTF2(_L("Window Group inquired Id:%d"),inquiredWGId);
+		rtnStatus= iWsSession->GetWindowGroupNameFromIdentifier(inquiredWGId, storeAWindowName);
+		INFO_PRINTF2(_L("return status:%d"),rtnStatus);
+
+		if (rtnStatus==KErrNone)
+			{
+			INFO_PRINTF2(_L("the length of  buffer:%d"),storeAWindowName.Length());
+			INFO_PRINTF1(_L("the name of window group:"));
+			INFO_PRINTF1(storeAWindowName);
+			}
+		else
+			{
+			ERR_PRINTF1(_L("GetWindowGroupNameFromIdentifier function is fail!"));
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataWsSession::DoCmdFindWindowGroupIdentifier(const TDesC& aSection)
+	{
+	TInt	previousId=iWindowGroupIdentifier;
+	GetIntFromConfig(aSection, KFindWGPreId(), previousId);
+	INFO_PRINTF2(_L("previous window group id:%d"), previousId);
+
+	TInt	nextId;
+	TPtrC	matchString;
+	if ( GetStringFromConfig(aSection, KMatchWGString(), matchString) )
+		{
+		TInt	offset=0;
+		GetIntFromConfig(aSection, KFldOffset(), offset);
+		nextId=iWsSession->FindWindowGroupIdentifier(previousId, matchString, offset);
+		}
+	else
+		{
+		RThread		proc;
+		TThreadId	threadId=proc.Id();
+
+		TInt	id;
+		if ( GetIntFromConfig(aSection, KThreadId(), id) )
+			{
+			threadId=id;
+			}
+		nextId=iWsSession->FindWindowGroupIdentifier(previousId, threadId);
+		}
+
+	if ( nextId<0 )
+		{
+		ERR_PRINTF1(_L("failed to find Window group name function !"));
+		SetError(nextId);
+		}
+	else
+		{
+		iWindowGroupIdentifier=nextId;
+		}
+	}
+
+void CT_DataWsSession::DoCmdFetchMessage(const TDesC& aSection)
+	{
+	TUid		uid;
+	TPtr8		params(NULL,0);
+	TWsEvent	event;
+	TInt		err=iWsSession->FetchMessage(uid, params, event);
+    TInt expected;
+	if ( GetIntFromConfig(aSection, KFldExpected(), expected) )
+		{
+		if ( err!=expected )
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataWsSession::DoCmdSetShadowVector(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TPoint	setPtShdwVet;
+	if ( !GetPointFromConfig(aSection, KSetShadowVec(), setPtShdwVet) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KSetShadowVec());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetShadowVector(const TPoint &aVector)"));
+		iWsSession->SetShadowVector(setPtShdwVet);
+		}
+    }
+
+void CT_DataWsSession::DoCmdShadowVector(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TPoint	actual=iWsSession->ShadowVector();
+	INFO_PRINTF3(_L("execute ShadowVector() x=%d y=%d"), actual.iX, actual.iY);
+
+	TPoint	expected;
+	if ( !GetPointFromConfig(aSection, KExpectShadowVector(), expected) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KExpectShadowVector());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if ( actual!=expected )
+			{
+			ERR_PRINTF1(_L("The current value of the shadow vector is not as expected!"));
+			SetBlockResult(EFail);
+			}
+		}
+    }
+
+void CT_DataWsSession::DoCmdSetBackgroundColor(const TDesC& aSection)
+	{
+	TRgb	datColour;
+	if ( !GetRgbFromConfig(aSection, KBGColour, datColour) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KBGColour());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetColor(TRgb)"));
+		iWsSession->SetBackgroundColor(datColour);
+		}
+	}
+
+void CT_DataWsSession::DoCmdGetBackgroundColor(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TRgb	actualBgColour=iWsSession->GetBackgroundColor();
+
+	TRgb	expectBgColour;
+	if ( !GetRgbFromConfig(aSection, KExpectBgColour(), expectBgColour) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KExpectBgColour());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if ( actualBgColour!=expectBgColour )
+			{
+			ERR_PRINTF1(_L("The current value of the shadow vector is not as expected!"));
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataWsSession::DoCmdSetSystemPointerCursor(const TDesC& aSection)
+    {
+    RWsPointerCursor	sysPointerCursor=RWsPointerCursor(*iWsSession);
+
+	INFO_PRINTF1(_L("RWsSession::SetSystemPointerCursor() call"));
+	TInt	inputCursorNumber=0;
+	if ( !GetIntFromConfig(aSection, KInputCursorNumber(), inputCursorNumber) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KExpectBgColour());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF2(_L("CursorNumber:%d"),inputCursorNumber);
+		TInt	err=iWsSession->SetSystemPointerCursor(sysPointerCursor,inputCursorNumber);
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		}
+	}
+
+void CT_DataWsSession::DoCmdClearSystemPointerCursor(const TDesC& aSection)
+	{
+	TInt	inputCursorNumber=0;
+
+	if ( !GetIntFromConfig(aSection, KInputCursorNumber(), inputCursorNumber) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KInputCursorNumber());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF2(_L("CursorNumber:%d"),inputCursorNumber);
+		INFO_PRINTF1(_L("RWsSession::ClearSystemPointerCursor"));
+		iWsSession->ClearSystemPointerCursor(inputCursorNumber);
+		}
+	}
+
+void CT_DataWsSession::DoCmdClaimSystemPointerCursorList()
+	{
+	INFO_PRINTF1(_L("RWsSession::ClaimSystemPointerCursorList() call"));
+	TInt	err=iWsSession->ClaimSystemPointerCursorList();
+
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	}
+
+void CT_DataWsSession::DoCmdFreeSystemPointerCursorList()
+	{
+	INFO_PRINTF1(_L("RWsSession::FreeSystemPointerCursorList() call"));
+	iWsSession->FreeSystemPointerCursorList();
+	}
+
+void CT_DataWsSession::DoCmdSetCustomTextCursorL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	TInt	identifier;
+	if ( !GetIntFromConfig(aSection, KFldIdentifier(), identifier) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldIdentifier);
+		SetBlockResult(EFail);
+		}
+
+	CArrayFixFlat<TSpriteMember>*	spriteMember = new (ELeave) CArrayFixFlat<TSpriteMember>(1);
+	if ( !CT_GraphicsUtil::GetSpriteMemberListL(*this, aSection, KFldSpriteMember, *spriteMember) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldSpriteMember);
+		SetBlockResult(EFail);
+		}
+	TArray<TSpriteMember>	spriteArray = spriteMember->Array();
+
+	TSpriteFlags	spriteFlags;
+	if ( !CT_GraphicsUtil::ReadSpriteFlags(*this, aSection, KFldSpriteFlags, spriteFlags) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldSpriteFlags);
+		SetBlockResult(EFail);
+		}
+
+	RWsSession::TCustomTextCursorAlignment	alignment;
+	if ( !CT_GraphicsUtil::ReadCustomTextCursorAlignment(*this, aSection, KFldAlignment, alignment) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldAlignment);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		INFO_PRINTF1(_L("SetCustomTextCursor(TInt, TArray< TSpriteMember >, TUint, TCustomTextCursorAlignment)"));
+		TInt	err=iWsSession->SetCustomTextCursor(identifier, spriteArray, (TUint)spriteFlags, alignment);
+
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		}
+	}
+
+void CT_DataWsSession::DoCmdResourceCount(const TDesC& aSection)
+	{
+	TInt	resourceCount=iWsSession->ResourceCount();
+	INFO_PRINTF2(_L("RWsSession::ResourceCount() %d"), resourceCount);
+
+	// get expected difference from parameters
+	TInt	expectedDifference;
+	if ( GetIntFromConfig(aSection, KExpectedDiff(), expectedDifference) )
+		{
+		TInt	actualDifference=resourceCount-iResourceCount;
+		if ( actualDifference != expectedDifference )
+			{
+			ERR_PRINTF3(_L("Resource count difference is not as expected! expected: %d, actual: %d"), expectedDifference, actualDifference);
+			SetBlockResult(EFail);
+			}
+		}
+	iResourceCount = resourceCount;
+	}
+
+void CT_DataWsSession::DoCmdPasswordEntered()
+	{
+	INFO_PRINTF1(_L("RWsSession::PasswordEntered() call"));
+	iWsSession->PasswordEntered();
+	}
+
+void CT_DataWsSession::DoCmdComputeMode(const TDesC& aSection)
+	{
+	RWsSession::TComputeMode	mode;
+
+	INFO_PRINTF1(_L("RWsSession::ComputeMode() call"));
+	if ( !CT_GraphicsUtil::ReadComputeMode(*this, aSection, KComputeMode(), mode) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KComputeMode());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		iWsSession->ComputeMode(mode);
+		}
+	}
+
+
+void CT_DataWsSession::DoCmdHeapCount(const TDesC& aSection)
+	{
+	TInt	expectedCount;
+	TInt	heapCount;
+
+	if ( !GetIntFromConfig(aSection, KExpectedHeapCount(), expectedCount) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KExpectedHeapCount());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF2(_L("expected count: %d"), expectedCount);
+		INFO_PRINTF1(_L("RWsSession::HeapCount() call"));
+		heapCount=iWsSession->HeapCount();
+		INFO_PRINTF2(_L("RWsSession::HeapCount(): %d"), heapCount);
+		if ( expectedCount > heapCount )
+			{
+			ERR_PRINTF3(_L("Heap count is lower than expected! expected: %d, actual: %d"), expectedCount, heapCount);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataWsSession::DoCmdSetModifierState(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	TEventModifier	eventModifier;
+	if ( !CT_GraphicsUtil::ReadEventModifier(*this, aSection, KInputPermanentModifier(), eventModifier) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KInputPermanentModifier());
+		SetBlockResult(EFail);
+		}
+
+	TModifierState	modifierState;
+	if(	!CT_GraphicsUtil::ReadModifierState(*this, aSection, KInputPermanentModifierState(), modifierState) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KInputPermanentModifierState());
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		INFO_PRINTF1(_L("RWsSession::SetModifierState"));
+		TInt	err = iWsSession->SetModifierState(eventModifier, modifierState);
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		}
+	}
+
+void CT_DataWsSession::DoCmdGetModifierState(const TDesC& aSection)
+    {
+	TInt	actual=iWsSession->GetModifierState();
+	INFO_PRINTF2(_L("GetModifierState:%d"), actual);
+
+	TUint 	expected=0;
+	if ( CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldExpected(), expected) )
+		{
+		if ( actual!=(TInt)expected )
+			{
+			ERR_PRINTF1(_L("ModifierState is not as expected!"));
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataWsSession::DoCmdRequestOffEventsL(const TDesC& aSection)
+	{
+	TBool 	eventOffOn;
+	if ( !GetBoolFromConfig(aSection, KSetEventOffOn(), eventOffOn) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KSetEventOffOn());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		RWindowTreeNode*	treeNodeObj=NULL;
+		TPtrC 	treeNodeObjectName;
+		if ( GetStringFromConfig(aSection, KWTreeNodeObj(), treeNodeObjectName) )
+			{
+			treeNodeObj = static_cast<RWindowTreeNode*>(GetDataObjectL(treeNodeObjectName));
+			}
+
+		INFO_PRINTF1(_L("RWsSession::RequestOffEvents(TBool, RWindowTreeNode*) call"));
+		TInt	err=iWsSession->RequestOffEvents(eventOffOn, treeNodeObj);
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, err);
+			SetError(err);
+			}
+		}
+	}
+
+void CT_DataWsSession::DoCmdGetDefModeMaxNumColors(const TDesC& aSection)
+	{
+	TInt	colors;
+	TInt	grays;
+
+	INFO_PRINTF1(_L("RWsSession::GetDefModeMaxNumColors(TInt &aColor, TInt &aGray) call"));
+		
+	TDisplayMode	displayMode;
+#if defined(SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS)
+	TInt			theScrnNum=0;
+	if ( GetIntFromConfig(aSection, KWGScreenNumber(), theScrnNum) )
+		{
+		displayMode=iWsSession->GetDefModeMaxNumColors(theScrnNum, colors, grays);
+		}
+	else
+#endif
+		{
+		displayMode=iWsSession->GetDefModeMaxNumColors(colors, grays);
+		}
+	INFO_PRINTF4(_L("RWsSession::GetDefModeMaxNumColors() DisplayMode:%d Colors:%d Grays:%d"), displayMode, colors, grays);
+
+	TDisplayMode	expectedDisplayMode;
+	if ( CT_GraphicsUtil::ReadDisplayMode(*this, aSection, KDefDisplayMode(), expectedDisplayMode) )
+		{
+		if ( expectedDisplayMode!=displayMode )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	TInt	expected=0;
+	if ( GetIntFromConfig(aSection, KDefModeMaxNumColor(), expected) )
+		{
+		if ( expected!=colors )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	if ( GetIntFromConfig(aSection, KDefModeMaxNumGray(), expected) )
+		{
+		if ( expected!=grays )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataWsSession::DoCmdGetColorModeListL(const TDesC& aSection)
+	{
+	TBool	nullPointer=EFalse;
+	GetBoolFromConfig(aSection, KFldNullPointer(), nullPointer);
+
+	CArrayFixFlat<TInt>*	modeList=NULL;
+	if ( !nullPointer )
+		{
+		modeList=new (ELeave) CArrayFixFlat<TInt>(iColorModeCount);
+		}
+	CleanupStack::PushL(modeList);
+
+	TBool	dataOk=ETrue;
+	TInt	err=KErrNone;
+#if defined(SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS)
+	TInt	inputScreenNo=0;
+	if ( GetIntFromConfig(aSection, KInputScrnNo(), inputScreenNo))
+		{
+		INFO_PRINTF1(_L("RWsSession::GetColorModeList(TInt aScreenNumber, CArrayFixFlat< TInt > *aModeList) call"));
+		err=iWsSession->GetColorModeList(inputScreenNo, modeList);
+		}
+	else
+#endif
+		{
+		INFO_PRINTF1(_L("RWsSession::GetColorModeList(CArrayFixFlat< TInt > *aModeList) call"));
+		err=iWsSession->GetColorModeList(modeList);
+		}
+
+	if ( err<KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	else
+		{
+		if ( dataOk )
+			{
+			if ( nullPointer )
+				{
+				iColorModeCount=err;
+				}
+			else
+				{
+				INFO_PRINTF2(_L("Color Mode List array count:%d"), modeList->Count());
+				for ( TInt index=0; index<modeList->Count(); ++index )
+					{
+					INFO_PRINTF2(_L("Content of Color Mode List:%d"), (*modeList)[index]);
+					}
+				}
+			}
+		}
+
+	CleanupStack::PopAndDestroy(modeList);
+	}
+
+void CT_DataWsSession::DoCmdSetPointerCursorArea(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TRect	setRectArea;
+	if ( !GetRectFromConfig(aSection, KPtrCurPosArea, setRectArea) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KPtrCurPosArea());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetPointerCursorPosition(TPoint)"));
+		
+		TInt	setScrnSizeMode;
+		if ( !GetIntFromConfig(aSection, KSetScrnSizeMode, setScrnSizeMode) )
+			{
+			iWsSession->SetPointerCursorArea(setRectArea);
+			}
+		else
+			{
+			iWsSession->SetPointerCursorArea(setScrnSizeMode,setRectArea);
+			}
+		}
+	}
+
+void CT_DataWsSession::DoCmdPointerCursorArea(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TRect	actual;
+	TInt	theScreenSizeMode=0;
+	if ( !GetIntFromConfig(aSection, KSetScrnSizeMode, theScreenSizeMode) )
+		{
+		actual=iWsSession->PointerCursorArea();
+		LogRect(_L("PointerCursorArea()"), actual);
+		}
+	else
+		{
+		actual=iWsSession->PointerCursorArea(theScreenSizeMode);
+		LogRect(_L("PointerCursorArea(TInt)"), actual);
+		}
+
+	TRect	expected;
+	if ( !GetRectFromConfig(aSection, KPtrCurPosArea, expected) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KPtrCurPosArea);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if ( actual!=expected )
+			{
+			ERR_PRINTF1(KLogNotExpectedValue);
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+
+void CT_DataWsSession::DoCmdSetPointerCursorMode(const TDesC& aSection)
+	{
+	TPointerCursorMode  mode;
+	if ( !CT_GraphicsUtil::ReadPointerCursorMode(*this, aSection, KSetPtrCurMode(), mode) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KSetPtrCurMode());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		iWsSession->SetPointerCursorMode(mode);
+		}
+	}
+
+void CT_DataWsSession::DoCmdSetClientCursorMode(const TDesC& aSection)
+	{
+	TPointerCursorMode  mode;
+	if ( !CT_GraphicsUtil::ReadPointerCursorMode(*this, aSection, KSetCltCurMode(), mode) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KSetCltCurMode());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		iWsSession->SetClientCursorMode(mode);
+		}
+	}
+
+void CT_DataWsSession::DoCmdPointerCursorMode(const TDesC& aSection)
+    {
+	INFO_PRINTF1(_L("RWsSession::PointerCursorMode() call"));
+	TPointerCursorMode	actual=iWsSession->PointerCursorMode();
+	INFO_PRINTF2(_L("actual Pointer Cursor Mode:%d"), actual);
+
+	TPointerCursorMode  expected;
+	if ( !CT_GraphicsUtil::ReadPointerCursorMode(*this, aSection, KFldExpected(), expected) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KExpectPtrCursorMode());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if ( actual!=expected )
+			{
+			ERR_PRINTF1(_L("Pointer cursor mode is not as expected!"));
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataWsSession::DoCmdSetDefaultSystemPointerCursor(const TDesC& aSection)
+	{
+	TInt	inputDefCursorNumber=0;
+	INFO_PRINTF1(_L("RWsSession::SetDefaultSystemPointerCursor() call"));
+
+	if ( !GetIntFromConfig(aSection, KInputDefaultCursorNumber(), inputDefCursorNumber))
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KInputDefaultCursorNumber());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		iWsSession->SetDefaultSystemPointerCursor(inputDefCursorNumber);
+		}
+	}
+
+void CT_DataWsSession::DoCmdClearDefaultSystemPointerCursor()
+	{
+	INFO_PRINTF1(_L("RWsSession::ClearDefaultSystemPointerCursor() call"));
+	iWsSession->ClearDefaultSystemPointerCursor();
+	}
+
+void CT_DataWsSession::DoCmdSetPointerCursorPosition(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TPoint	ptrCurPost;
+	if ( !GetPointFromConfig(aSection, KSetPtrCurPosValue, ptrCurPost) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KSetPtrCurPosValue);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetPointerCursorPosition(TPoint)"));
+		iWsSession->SetPointerCursorPosition(ptrCurPost);
+		}
+	}
+
+void CT_DataWsSession::DoCmdPointerCursorPosition(const TDesC& aSection)
+	{
+	// Get test data for command input parameter(s)
+	TPoint	actualPtrCurPost=iWsSession->PointerCursorPosition();
+
+	TPoint	expectPtrCurPost;
+	if ( !GetPointFromConfig(aSection, KTPoint, expectPtrCurPost) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KTPoint);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(_L("execute SetPointerCursorPosition(TPoint)"));
+		if ((expectPtrCurPost.iX!=expectPtrCurPost.iX)||(expectPtrCurPost.iY!=expectPtrCurPost.iY))
+				{
+				ERR_PRINTF1(_L("The cursor position is not as expected!"));
+				SetBlockResult(EFail);
+				}
+		}
+	}
+
+void CT_DataWsSession::DoCmdSetDefaultFadingParameters(const TDesC& aSection)
+	{
+	TBool dataOk=ETrue;
+	TInt	setBlackMap;
+	TInt	setWhiteMap;
+	
+	if ( !GetIntFromConfig(aSection, KSetDefblackMapFading(), setBlackMap) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KSetDefblackMapFading);
+		SetBlockResult(EFail);
+		}
+
+	if ( !GetIntFromConfig(aSection, KSetDefwhiteMapFading(), setWhiteMap) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KSetDefwhiteMapFading);
+		SetBlockResult(EFail);
+		}
+
+	if ( dataOk )
+		{
+		iWsSession->SetDefaultFadingParameters(setBlackMap, setWhiteMap);
+		}
+	}
+
+void CT_DataWsSession::DoCmdPrepareForSwitchOff()
+	{
+	INFO_PRINTF1(_L("RWsSession::PrepareForSwitchOff() call"));
+	iWsSession->PrepareForSwitchOff();
+	}
+
+
+void CT_DataWsSession::DoCmdSetBufferSizeL(const TDesC& aSection)
+	{
+	TInt	theBuffersize;
+
+	if ( !GetIntFromConfig(aSection, KSetBuffer(), theBuffersize) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KSetBuffer);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		iWsSession->SetBufferSizeL(theBuffersize);
+		INFO_PRINTF1(_L("RWsSession::SetBufferSizeL"));
+		}
+	}
+
+void CT_DataWsSession::DoCmdSetMaxBufferSizeL(const TDesC& aSection)
+	{
+	TInt	theMaxBuffersize;
+
+	if ( !GetIntFromConfig(aSection, KSetMaxBuffer(), theMaxBuffersize) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KSetBuffer);
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		iWsSession->SetMaxBufferSizeL(theMaxBuffersize);
+		INFO_PRINTF1(_L("RWsSession::SetMaxBufferSizeL"));
+		}
+	}
+
+void CT_DataWsSession::DoCmdSetSystemFaded(const TDesC& aSection)
+	{
+	TBool 	systemFadOffOn;
+	TInt	blackMap;
+	TInt	whiteMap;
+
+	if ( !GetBoolFromConfig(aSection, KSetSysFading(), systemFadOffOn) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KSetSysFading());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF2(_L("the status of fad window :%d"),systemFadOffOn);
+		if(	GetIntFromConfig(aSection, KSetblackMapFading(), blackMap))
+			{
+			if ( !GetIntFromConfig(aSection, KSetwhiteMapFading(), whiteMap) )
+				{
+				ERR_PRINTF2(KLogMissingParameter, &KSetwhiteMapFading);
+				SetBlockResult(EFail);
+				}
+			else
+				{
+				iWsSession->SetSystemFaded(systemFadOffOn,blackMap,whiteMap);
+				INFO_PRINTF1(_L("RWsSession::SetSystemFaded"));
+				}
+			}
+		else
+			{
+			iWsSession->SetSystemFaded(systemFadOffOn);
+			INFO_PRINTF1(_L("RWsSession::SetSystemFaded"));
+			}
+		}
+	}
+
+void CT_DataWsSession::DoCmdSetFocusScreen(const TDesC& aSection)
+    {
+	TInt	theScreenNo;
+	if ( !GetIntFromConfig(aSection, KSetFocusScreen(), theScreenNo) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KSetFocusScreen());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		iWsSession->SetFocusScreen(theScreenNo);
+		INFO_PRINTF1(_L("RWsSession::SetFocusScreen"));
+		}
+	}
+
+void CT_DataWsSession::DoCmdGetFocusScreen(const TDesC& aSection)
+	{
+	TInt 	actual=iWsSession->GetFocusScreen();
+	INFO_PRINTF2(_L("RWsSession::GetFocusScreen()=%d"), actual);
+
+	TInt	expected;
+	if ( !GetIntFromConfig(aSection, KFldExpected(), expected) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldExpected());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if ( actual!=expected )
+			{
+			ERR_PRINTF1(_L("GetFocusScreen is not as expected!"));
+			SetBlockResult(EFail);
+			}
+		}
+	}
+
+void CT_DataWsSession::DoCmdClearAllRedrawStores()
+	{
+	INFO_PRINTF1(_L("RWsSession::ClearAllRedrawStores() call"));
+	iWsSession->ClearAllRedrawStores();
+	}
+
+
+void CT_DataWsSession::DoCmdLogCommand(const TDesC& aSection)
+	{
+	RWsSession::TLoggingCommand	inputCommand;
+	if ( !CT_GraphicsUtil::ReadLoggingCommand(*this, aSection, KLogCommand(), inputCommand) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KLogCommand());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("RWsSession::LogCommand() call"));
+		iWsSession->LogCommand(inputCommand);
+		}
+	}
+
+
+void CT_DataWsSession::DoCmdLogMessage(const TDesC& aSection)
+    {
+	TPtrC	theMessage;
+
+	if ( !GetStringFromConfig(aSection, KLogMessage(), theMessage) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KLogMessage());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("RWsSession::LogMessage() call"));
+		iWsSession->LogMessage(theMessage);
+		}
+	}
+
+#if defined(SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS)
+void CT_DataWsSession::DoCmdNumberOfScreens(const TDesC& aSection)
+	{
+	TInt    actual=iWsSession->NumberOfScreens();
+	INFO_PRINTF2(_L("NumberOfScreens:%d"), actual);
+
+	TInt	expected=0;
+	if ( !GetIntFromConfig(aSection, KFldExpected(), expected) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldExpected());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		if ( actual!=expected )
+			{
+			ERR_PRINTF1(_L("NumberOfScreens is not as expected!"));
+			SetBlockResult(EFail);
+			}
+		}
+	}
+#else
+void CT_DataWsSession::DoCmdNumberOfScreens(const TDesC& /*aSection*/)
+	{
+	ERR_PRINTF1(_L("SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS Not Supported"));
+	SetBlockResult(EFail);
+	}
+#endif
+
+void CT_DataWsSession::DoCmdSimulateRawEvent(const TDesC& aSection)
+	{
+	TBool		dataOk=ETrue;
+	TRawEvent	event;
+
+	TRawEvent::TType	type=TRawEvent::ENone;
+	if ( !CT_GraphicsUtil::ReadType(*this, aSection, KFldType(), type) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(_L("Missing parameter %S"), &KFldType());
+		SetBlockResult(EFail);
+		}
+	else
+		{
+		event.Set(type);
+		}
+
+	TStdScanCode	stdScanCode;
+	if ( CT_GraphicsUtil::ReadStdScanCode(*this, aSection, KFldStdScanCode(), stdScanCode) )
+		{
+		event.Set(type, stdScanCode);
+		}
+
+	TInt	deviceNumber;
+	if ( GetIntFromConfig(aSection, KFldDeviceNumber, deviceNumber) )
+		{
+		event.SetDeviceNumber(deviceNumber);
+		}
+
+	TPoint	pointerPos(0,0);
+	if ( GetPointFromConfig(aSection, KFldPos, pointerPos) )
+		{
+		event.Set(type, pointerPos.iX, pointerPos.iY);
+		}
+
+	TBool	tip;
+	if ( GetBoolFromConfig(aSection, KFldTip, tip) )
+		{
+		event.SetTip(tip);
+		}
+
+	if ( dataOk )
+		{
+		INFO_PRINTF1(_L("RWsSession::SimulateRawEvent(TRawEvent) call"));
+		iWsSession->SimulateRawEvent(event);
+		}
+	}
+
+void CT_DataWsSession::DoCmdSimulateKeyEvent(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	TKeyCode	keyCode;
+	if ( !CT_GraphicsUtil::ReadKeyCode(*this, aSection, KFldKeyCode(), keyCode) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldKeyCode());
+		SetBlockResult(EFail);
+		}
+
+	TUint	modifiers=0;
+	CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldModifiers(), modifiers);
+
+	TInt	repeats=0;
+	GetIntFromConfig(aSection, KFldRepeats(), repeats);
+
+	if ( dataOk )
+		{
+		TKeyEvent	event;
+
+		event.iCode=keyCode;
+		event.iScanCode=keyCode;
+		event.iModifiers=modifiers;
+		event.iRepeats=repeats;
+		INFO_PRINTF1(_L("RWsSession::SimulateKeyEvent(TKeyEvent) call"));
+		iWsSession->SimulateKeyEvent(event);
+		}
+	}
+
+/**
+ Virtual RunL - Called on completion of an asynchronous command
+ @see MTPActiveCallback
+ @param aActive Active Object that RunL has been called on
+ @pre N/A
+ @post N/A
+ @leave system wide error code
+*/
+void CT_DataWsSession::RunL(CActive* aActive, const TInt aIndex)
+	{
+	if ( aActive==iActiveEventReady )
+		{
+		RunEventReady(aIndex);
+		}
+	else if ( aActive==iActivePriorityKeyReady )
+		{
+		RunPriorityKeyReady(aIndex);
+		}
+	else if ( aActive==iActiveRedrawReady )
+		{
+		RunRedrawReady(aIndex);
+		}
+	else
+		{
+		ERR_PRINTF1(_L("Stray signal"));
+		SetBlockResult(EFail);
+		}
+	DecOutstanding();
+	}
+
+/**
+ Virtual DoCancel - Request to cancel the asynchronous command
+ @see - MTPActiveCallback
+ @param aActive Active Object that DoCancel has been called on
+ @pre - N/A
+ @post - N/A
+ @leave system wide error code
+*/
+void CT_DataWsSession::DoCancel(CActive* aActive, const TInt aIndex)
+	{
+	if ( aActive==iActiveEventReady )
+		{
+		DoCancelEventReady(aIndex);
+		}
+	else if ( aActive==iActivePriorityKeyReady )
+		{
+		DoCancelPriorityKeyReady(aIndex);
+		}
+	else if ( aActive==iActiveRedrawReady )
+		{
+		DoCancelRedrawReady(aIndex);
+		}
+	else
+		{
+		ERR_PRINTF1(_L("Stray signal"));
+		SetBlockResult(EFail);
+		}
+	DecOutstanding();
+	}
+
+void CT_DataWsSession::RunEventReady(const TInt aIndex)
+	{
+	TInt	err=iActiveEventReady->iStatus.Int();
+	INFO_PRINTF2(_L("RunEventReady %d"), err);
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(_L("RunL Error %d"), err);
+		SetAsyncError(aIndex, err);
+		}
+	}
+
+void CT_DataWsSession::DoCancelEventReady(const TInt /*aIndex*/)
+	{
+	}
+
+void CT_DataWsSession::RunPriorityKeyReady(const TInt aIndex)
+	{
+	TInt	err=iActivePriorityKeyReady->iStatus.Int();
+	INFO_PRINTF2(_L("RunPriorityKeyReady %d"), err);
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(_L("RunL Error %d"), err);
+		SetAsyncError(aIndex, err);
+		}
+	}
+
+void CT_DataWsSession::DoCancelPriorityKeyReady(const TInt /*aIndex*/)
+	{
+	}
+
+void CT_DataWsSession::RunRedrawReady(const TInt aIndex)
+	{
+	TInt	err=iActiveRedrawReady->iStatus.Int();
+	INFO_PRINTF2(_L("RunRedrawReady %d"), err);
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(_L("RunL Error %d"), err);
+		SetAsyncError(aIndex, err);
+		}
+	}
+
+void CT_DataWsSession::DoCancelRedrawReady(const TInt /*aIndex*/)
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataWsSprite.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,265 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_GraphicsUtil.h"
+#include "T_DataWsSprite.h"
+
+/*@{*/
+//Commands
+_LIT(KCmdNew,							    "new");
+_LIT(KCmdConstruct,						    "Construct");
+_LIT(KCmdSetPosition,						"SetPosition");
+
+// Fields
+_LIT(KFldWs,							"ws");
+_LIT(KFldFlag,                          "flag");
+_LIT(KFldPoint,							"pos");
+_LIT(KFldWindow,                        "win");
+///	Logging
+_LIT(KLogError,								"Error=%d");
+_LIT(KLogMissingParameter,					"Missing parameter '%S'");
+
+_LIT(KLogNew,                               "execute new RWsSprite()");
+_LIT(KLogNew2,                              "execute new RWsSprite(RWsSession)");
+_LIT(KLogConstruct,                         "execute Construct(RWindowTreeNode, const TPoint, TInt)");
+_LIT(KLogSetPosition,                       "execute SetPosition(TPoint)");
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataWsSprite::CT_DataWsSprite()
+:	CT_DataWsSpriteBase(),iWsSprite(NULL)
+	{
+	}
+
+CT_DataWsSprite*	CT_DataWsSprite::NewL()
+	{
+	CT_DataWsSprite*    ret=new (ELeave) CT_DataWsSprite();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+void CT_DataWsSprite::ConstructL()
+	{
+	}
+
+CT_DataWsSprite::~CT_DataWsSprite()
+	{
+	DestroyData();
+	}
+
+/**
+ * Called by TEF framework to set object.
+ *
+ * @param: None
+ *
+ * @return: None
+ */
+void CT_DataWsSprite::SetObjectL(TAny* aAny)
+	{
+	DestroyData();
+	iWsSprite = static_cast<RWsSprite*> (aAny);
+	}
+
+/**
+ * Called by TEF framework to disown the object.
+ *
+ * @param: None
+ *
+ * @return: None
+ */
+void CT_DataWsSprite::DisownObjectL()
+	{
+	iWsSprite = NULL;
+	}
+
+/**
+ * Destroy the object which has been constructed.
+ *
+ * @param: None
+ *
+ * @return: None
+ */
+void CT_DataWsSprite::DestroyData()
+	{
+	delete iWsSprite;
+	iWsSprite = NULL;
+	}
+	
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataWsSprite::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
+	{
+	TBool	ret = ETrue;
+
+	if ( aCommand==KCmdNew )
+		{
+		DoCmdNewL(aSection);
+		}
+	else if ( aCommand==KCmdConstruct )
+		{
+		DoCmdConstructL(aSection);
+		}
+	else if ( aCommand==KCmdSetPosition )
+		{
+		DoCmdSetPosition(aSection);
+		}
+	else
+		{
+		ret=CT_DataWsSpriteBase::DoCommandL(aCommand,aSection,aAsyncErrorIndex);
+		}
+
+	return ret;
+	}
+
+/**
+ * Process new command
+ *
+ * @param aSection			the entry in the ini file requiring the command to be processed
+ *
+ * @return: None
+ */
+void CT_DataWsSprite::DoCmdNewL(const TDesC& aSection)
+	{
+	TPtrC	wsName;
+	RWsSession* ws=NULL;
+	
+	if ( GetStringFromConfig(aSection, KFldWs, wsName) )
+		{
+		ws = static_cast<RWsSession*>(GetDataObjectL(wsName));
+		}
+		
+	TInt err=KErrNone;
+	
+	if ( ws!=NULL )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(KLogNew2);
+		TRAP( err, iWsSprite=new (ELeave) RWsSprite(*ws));
+		}
+	else
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(KLogNew);
+		TRAP( err, iWsSprite=new (ELeave) RWsSprite());
+		}
+
+	if ( err!=KErrNone )
+		{
+		ERR_PRINTF2(KLogError, err);
+		SetError(err);
+		}
+	// No command return value and output parameter to display and check
+	}
+
+/**
+ * Process Construct command
+ *
+ * @param aSection			the entry in the ini file requiring the command to be processed
+ *
+ * @return: None
+ */
+void CT_DataWsSprite::DoCmdConstructL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+
+	// Get test data for command input parameter(s)
+	TPtrC	winName;
+	RWindow* win=NULL;
+	
+	if ( GetStringFromConfig(aSection, KFldWindow, winName) )
+		{
+		win=static_cast<RWindow*>(GetDataObjectL(winName));
+		}
+	
+	if ( win==NULL )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldWindow);
+		SetBlockResult(EFail);
+		}
+
+	TUint aSpriteFlags=0;
+	
+	if(!CT_GraphicsUtil::ReadSpriteFlags(*this,aSection,KFldFlag,aSpriteFlags))
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldFlag);
+		SetBlockResult(EFail);
+		}
+
+	TPoint	dataPoint;
+	
+	if ( !GetPointFromConfig(aSection, KFldPoint, dataPoint) )
+		{
+		dataPoint=TPoint(0,0);
+		}
+	
+	if ( dataOk )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(KLogConstruct);
+		TInt returnCode=iWsSprite->Construct(*win, dataPoint,aSpriteFlags);
+
+		// Check the command return code, if !=KErrNone then stop this command
+		if ( returnCode!=KErrNone )
+			{
+			ERR_PRINTF2(KLogError, returnCode);
+			SetError(returnCode);
+			}
+		}
+	}
+
+/**
+ * Process SetPosition command
+ *
+ * @param aSection			the entry in the ini file requiring the command to be processed
+ *
+ * @return: None
+ */
+void CT_DataWsSprite::DoCmdSetPosition(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+	TPoint	dataPoint;
+	
+	if ( !GetPointFromConfig(aSection, KFldPoint, dataPoint) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldPoint);
+		SetBlockResult(EFail);
+		}
+	
+	if ( dataOk )
+		{
+		// Execute command and log parameters
+		INFO_PRINTF1(KLogSetPosition);
+		iWsSprite->SetPosition(dataPoint);
+		// No command return value and output parameter to display and check
+		}
+	// No command return value and output parameter to display and check
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_DataWsSpriteBase.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,223 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_GraphicsUtil.h"
+#include "T_DataWsSpriteBase.h"
+
+/*@{*/
+//Commands
+_LIT(KCmdActivate,							"Activate");
+_LIT(KCmdAppendMember,						"AppendMember");
+_LIT(KCmdUpdateMember,						"UpdateMember");
+_LIT(KCmdClose,  					        "Close");
+
+// Fields
+_LIT(KFldIndex, 			 				"index");
+_LIT(KFldOneParameter,			 			"oneparameter");
+_LIT(KFldSpriteMember,						"spritemember");
+///	Logging
+_LIT(KLogError,								"Error=%d");
+_LIT(KLogMissingParameter,					"Missing parameter '%S'");
+
+
+_LIT(KLogActivate,                          "execute Activate()");
+_LIT(KLogAppendMember,                      "execute AppendMember(const TSpriteMember &aMemberData)");
+_LIT(KLogUpdateMember,                      "execute UpdateMember(TInt aIndex)");
+_LIT(KLogUpdateMember2,                     "execute UpdateMember(TInt aIndex, const TSpriteMember &aMemberData)");
+_LIT(KLogClose,                             "execute Close()");
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CT_DataWsSpriteBase::CT_DataWsSpriteBase():CDataWrapperBase()
+	{
+	}
+
+MWsClientClass* CT_DataWsSpriteBase::GetClientClass() const
+	{
+	return GetWsSpriteBase();
+	}
+/**
+* Process a command read from the ini file
+*
+* @param aCommand			the command to process
+* @param aSection			the entry in the ini file requiring the command to be processed
+* @param aAsyncErrorIndex	index of command. used for async calls
+*
+* @return ETrue if the command is processed
+*/
+TBool CT_DataWsSpriteBase::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
+	{
+	TBool	ret = ETrue;
+
+	if ( aCommand==KCmdActivate )
+		{
+		DoCmdActivate();
+		}
+	else if ( aCommand==KCmdAppendMember )
+		{
+		DoCmdAppendMemberL(aSection);
+		}
+	else if ( aCommand==KCmdUpdateMember )
+		{
+		DoCmdUpdateMemberL(aSection);
+		}
+	else if ( aCommand==KCmdClose )
+		{
+		DoCmdClose();
+		}
+	else
+		{
+		ret=EFalse;
+		}
+
+	return ret;
+	}
+
+/**
+ * Process Activate command
+ *
+ * @param: None
+ *
+ * @return: None
+ */
+void CT_DataWsSpriteBase::DoCmdActivate()
+	{
+	// Execute command and log parameters
+	INFO_PRINTF1(KLogActivate);
+	TInt nErr=GetWsSpriteBase()->Activate();
+
+	if(nErr!=KErrNone)
+	{
+	ERR_PRINTF2(KLogError, nErr);
+	SetError(nErr);	
+	}
+
+	// No command return value and output parameter to display and check
+	}
+
+/**
+ * Process AppendMember command
+ *
+ * @param: aSection			the entry in the ini file requiring the command to be processed
+ *
+ * @return: None
+ */
+void CT_DataWsSpriteBase::DoCmdAppendMemberL(const TDesC& aSection)
+	{
+	// Execute command and log parameters
+	INFO_PRINTF1(KLogAppendMember);
+	
+	//Init TSpriteMember 
+	TSpriteMember spriteMember;	
+	
+	if ( !CT_GraphicsUtil::GetSpriteMemberL(*this, aSection, KFldSpriteMember, spriteMember) )
+		{
+		ERR_PRINTF2(KLogMissingParameter, &KFldSpriteMember);
+		SetBlockResult(EFail);
+		}
+	
+	TInt returnCode=GetWsSpriteBase()->AppendMember(spriteMember);
+	
+	if(KErrNone!=returnCode)
+		{
+		ERR_PRINTF2(KLogError, returnCode);
+		SetError(returnCode);
+		}
+
+	// No command return value and output parameter to display and check
+	}
+
+/**
+ * Process UpdateMember command
+ *
+ * @param: aSection			the entry in the ini file requiring the command to be processed
+ *
+ * @return: None
+ */
+void CT_DataWsSpriteBase::DoCmdUpdateMemberL(const TDesC& aSection)
+	{
+	TBool	dataOk=ETrue;
+	//get update index
+	TInt datIndex;
+	
+	if ( !GetIntFromConfig(aSection, KFldIndex, datIndex) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldIndex);
+		}
+	//get if one parameter
+	TBool bOneParameter=TRUE;
+	
+	if ( !GetBoolFromConfig(aSection, KFldOneParameter, bOneParameter) )
+		{
+		dataOk=EFalse;
+		ERR_PRINTF2(KLogMissingParameter, &KFldOneParameter);
+		}
+		
+	//Init  new TSpriteMember 
+	TSpriteMember spriteMember;	
+	
+	if ( !CT_GraphicsUtil::GetSpriteMemberL(*this, aSection, KFldSpriteMember, spriteMember) )
+		{
+		if(!bOneParameter)
+			{
+			dataOk=EFalse;
+			ERR_PRINTF2(KLogMissingParameter, &KFldSpriteMember);
+			SetBlockResult(EFail);
+			}
+		}
+	
+	if(dataOk)
+		{
+		TInt returnCode=KErrNone;
+		
+		if(bOneParameter)
+			{
+			INFO_PRINTF1(KLogUpdateMember);
+			GetWsSpriteBase()->UpdateMember(datIndex);
+			}
+		else
+		    {
+			INFO_PRINTF1(KLogUpdateMember2);
+			returnCode=GetWsSpriteBase()->UpdateMember(datIndex,spriteMember);
+			}
+		
+		if(returnCode!=KErrNone)
+			{
+			ERR_PRINTF2(KLogError, returnCode);
+			SetError(returnCode);
+			}
+		}
+	// No command return value and output parameter to display and check
+	}
+
+/**
+ * Process Close command
+ *
+ * @param: None
+ *
+ * @return: None
+ */
+void CT_DataWsSpriteBase::DoCmdClose()
+	{
+	// Execute command and log parameters
+	INFO_PRINTF1(KLogClose);
+	GetWsSpriteBase()->Close();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_GraphicsWservAPIServer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,383 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "T_GraphicsWservAPIServer.h"
+#include "T_DataWsSession.h"
+#include "T_DataWindowGroup.h"
+#include "T_DataBlankWindow.h"
+#include "T_DataWindow.h"
+#include "T_DataBackedUpWindow.h"
+#include "T_DataWindowGc.h"
+#include "T_DataWsBitmap.h"
+#include "T_DataWsGraphicBitmap.h"
+#include "T_DataWsGraphicMsgBuf.h"
+#include "T_DataWindowInfo.h"
+#include "T_DataWsScreenDevice.h"
+#include "T_DataFbsSession.h"
+#include "T_DataFbsFont.h"
+#include "T_DataFbsBitmap.h"
+#include "T_DataBitmapUtil.h"
+#include "T_DataFbsTypefaceStore.h"
+#include "T_DataFbsColor256BitmapUtil.h"
+#include "T_DataPalette.h"
+#include "T_DataFbsBitmapDevice.h"
+#include "T_DataFbsScreenDevice.h"
+#include "T_DataAlgStyle.h"
+#include "T_DataMeasureTextInput.h"
+#include "T_DataMeasureTextOutput.h"
+#include "T_DataWsGraphicAnimation.h"
+#include "T_DataWsGraphicFrameRate.h"
+#include "T_DataWsEvent.h"
+#include "T_DataWsRedrawEvent.h"
+#include "T_DataWsPriorityKeyEvent.h"
+#include "T_DataSoundPlugIn.h"
+#include "T_DataFbsFont.h"
+#include "T_DataWsSprite.h"
+#include "T_DataWsPointerCursor.h"
+#include "T_DataDirectScreenAccess.h"
+#include "T_DataDsaSession.h"
+#include "T_DataFbsBitGc.h"
+#include "T_DataAnimDll.h"
+#include "T_DataAnim.h"
+#include "T_DataAnimForMClass.h"
+#include "T_DataWsGraphicBitmapAnimation.h"
+#include "T_DataFrame.h"
+//	EPOC Includes
+#include <rsshared.h>
+
+/**
+ * @enum Constant Literals used.
+ */
+/*@{*/
+// Graphics WSERV API
+_LIT(KDataWsSession,			"RWsSession");
+_LIT(KDataWindowGroup,			"RWindowGroup");
+_LIT(KDataBlankWindow,			"RBlankWindow");
+_LIT(KDataWindow,				"RWindow");
+_LIT(KDataBackedUpWindow,		"RBackedUpWindow");
+_LIT(KDataWindowGc,				"CWindowGc");
+_LIT(KDataWsBitmap,				"CWsBitmap");
+_LIT(KDataWsGraphicBitmap,		"CWsGraphicBitmap");
+_LIT(KDataWsGraphicMsgBuf,		"RWsGraphicMsgBuf");
+_LIT(KDataWsEvent,				"TWsEvent");
+_LIT(KDataWsPriorityKeyEvent, 	"TWsPriorityKeyEvent");
+_LIT(KDataWsRedrawEvent,		"TWsRedrawEvent");
+_LIT(KDataWindowInfo,			"TWindowInfo");
+_LIT(KDataWsScreenDevice,		"CWsScreenDevice");
+_LIT(KDataWsGraphicAnimation,	"TWsGraphicAnimation");
+_LIT(KDataWsGraphicFrameRate,	"TWsGraphicFrameRate");
+_LIT(KDataSoundPlugIn,			"RSoundPlugIn");
+_LIT(KDataFbsFont,				"CFbsFont");
+_LIT(KDataWsSprite,             "RWsSprite");
+_LIT(KDataWsPointerCursor,      "RWsPointerCursor");
+_LIT(KDataCDirectScreenAccess,	"CDirectScreenAccess");
+_LIT(KDataRDirectScreenAccess,	"RDirectScreenAccess");
+_LIT(KDataFbsBitGc,				"CFbsBitGc");
+_LIT(KDataAnimDll,				"RAnimDll");
+_LIT(KDataAnim,					"RAnim");
+_LIT(KDataAnimForMClass,		"RAnimForMClass");
+_LIT(KDataWsGraphicBitmapAnimation, "CWsGraphicBitmapAnimation");
+_LIT(KDataFrame,                "CFrame");
+//from T_FBServAPI
+_LIT(KRFbsSessionData, 			"RFbsSession");
+_LIT(KCFbsFontData, 			"CFbsFont");
+_LIT(KCFbsBitmapData, 			"CFbsBitmap");
+_LIT(KTBitmapUtilData, 			"TBitmapUtil");
+_LIT(KCFbsTypefaceStoreData,	"CFbsTypefaceStore");
+_LIT(KCFbsColor256BitmapUtil,	"CFbsColor256BitmapUtil");
+_LIT(KCPalette,					"CPalette");
+_LIT(KCFbsBitmapDevice,			"CFbsBitmapDevice");
+_LIT(KCFbsScreenDevice,			"CFbsScreenDevice");
+_LIT(KTAlgStyle,				"TAlgStyle");
+_LIT(KTMeasureTextInput,		"TMeasureTextInput");
+_LIT(KTMeasureTextOutput,		"TMeasureTextOutput");
+/*@}*/
+
+
+inline CDataWrapper* CT_GraphicsWservAPIServer::CT_GraphicsWservAPIBlock::CreateDataL( const TDesC& aData )
+	{
+	CDataWrapper*	wrapper = NULL;
+
+	if ( aData==KDataWsSession )
+		{
+		wrapper=CT_DataWsSession::NewL();
+		}
+	else if ( aData==KDataWindowGroup )
+		{
+		wrapper=CT_DataWindowGroup::NewL();
+		}
+	else if ( aData==KDataBlankWindow )
+		{
+		wrapper=CT_DataBlankWindow::NewL();
+		}
+	if ( aData==KDataWindow )
+		{
+		wrapper=CT_DataWindow::NewL();
+		}
+	else if ( aData==KDataBackedUpWindow )
+		{
+		wrapper=CT_DataBackedUpWindow::NewL();
+		}
+	else if ( aData==KDataWindowGc )
+		{
+		wrapper=CT_DataWindowGc::NewL();
+		}
+	else if ( aData==KDataWsBitmap )
+		{
+		wrapper=CT_DataWsBitmap::NewL();
+		}
+	else if ( aData==KDataWsGraphicBitmap )
+		{
+		wrapper=CT_DataWsGraphicBitmap::NewL();
+		}
+	else if ( aData==KDataWsGraphicMsgBuf )
+		{
+		wrapper=CT_DataWsGraphicMsgBuf::NewL();
+		}
+	else if ( aData==KDataWsEvent )
+		{
+		wrapper=CT_DataWsEvent::NewL();
+		}
+	else if ( aData==KDataWsPriorityKeyEvent )
+		{
+		wrapper=CT_DataWsPriorityKeyEvent::NewL();
+		}
+	else if ( aData==KDataWsRedrawEvent )
+		{
+		wrapper=CT_DataWsRedrawEvent::NewL();
+		}
+	else if ( aData==KDataWindowInfo )
+		{
+		wrapper=CT_DataWindowInfo::NewL();
+		}
+	else if ( aData==KDataWsScreenDevice )
+		{
+		wrapper=CT_DataWsScreenDevice::NewL();
+		}
+	else if( aData == KDataSoundPlugIn)
+		{
+		wrapper = CT_DataSoundPlugIn::NewL();
+		}
+	else if (aData==KDataCDirectScreenAccess)
+		{
+		wrapper=CT_DataDirectScreenAccess::NewL();
+		}
+	else if (aData==KDataRDirectScreenAccess)
+		{
+		wrapper=CT_DataDsaSession::NewL();
+		}
+// from T_FBServAPI
+	else if (aData == KRFbsSessionData)
+		{
+		wrapper=CT_DataFbsSession::NewL();
+		}
+	else if (aData == KCFbsFontData)
+		{
+		wrapper=CT_DataFbsFont::NewL();
+		}
+	else if (aData == KCFbsBitmapData)
+		{
+		wrapper=CT_DataFbsBitmap::NewL();
+		}
+	else if (aData == KTBitmapUtilData)
+		{
+		wrapper=CT_DataBitmapUtil::NewL();
+		}
+	else if (aData == KCFbsTypefaceStoreData)
+		{
+		wrapper=CT_DataFbsTypefaceStore::NewL();
+		}
+	else if (aData == KCFbsColor256BitmapUtil)
+		{
+		wrapper=CT_DataFbsColor256BitmapUtil::NewL();
+		}
+	else if (aData == KCPalette)
+		{
+		wrapper=CT_DataPalette::NewL();
+		}
+	else if ( aData==KCFbsBitmapDevice )
+		{
+		wrapper=CT_DataFbsBitmapDevice::NewL();
+		}
+	else if ( aData==KCFbsScreenDevice )
+		{
+		wrapper=CT_DataFbsScreenDevice::NewL();
+		}
+	else if ( aData==KTAlgStyle )
+		{
+		wrapper=CT_DataAlgStyle::NewL();
+		}
+	else if ( aData==KTMeasureTextInput )
+		{
+		wrapper=CT_DataMeasureTextInput::NewL();
+		}
+	else if ( aData==KTMeasureTextOutput )
+		{
+		wrapper=CT_DataMeasureTextOutput::NewL();
+		}
+	else if ( aData==KDataWsGraphicAnimation )
+		{
+		wrapper=new (ELeave) CT_DataWsGraphicAnimation();
+		}
+	else if ( aData==KDataWsGraphicFrameRate )
+		{
+		wrapper=new (ELeave) CT_DataWsGraphicFrameRate();
+		}
+	else if (aData==KDataFbsFont)
+		{
+		wrapper=CT_DataFbsFont::NewL();
+		}
+	//for RWsSprite
+	else if (aData==KDataWsSprite)
+		{
+		wrapper= CT_DataWsSprite::NewL();
+		}
+	//for RWsPointerCursor
+	else if (aData==KDataWsPointerCursor)
+		{
+		wrapper=CT_DataWsPointerCursor::NewL();
+		}
+	else if (aData == KDataFbsBitGc)
+		{
+		wrapper=CT_DataFbsBitGc::NewL();
+		}	
+	else if( aData == KDataAnimDll)
+		{
+		wrapper = CT_DataAnimDll::NewL();
+		}
+	else if( aData == KDataAnim)
+		{
+		wrapper = CT_DataAnim::NewL();
+		}
+	else if(aData==KDataAnimForMClass)
+		{
+		wrapper=CT_DataAnimForMClass::NewL();
+		}
+	else if( aData == KDataWsGraphicBitmapAnimation)
+		{
+		wrapper = CT_DataWsGraphicBitmapAnimation::NewL();
+		}
+	else if( aData == KDataFrame)
+		{
+		wrapper = CT_DataFrame::NewL();
+		}
+	return wrapper;
+	}
+
+CT_GraphicsWservAPIServer* CT_GraphicsWservAPIServer::NewL()
+/**
+ * @return - Instance of the test server
+ * Same code for Secure and non-secure variants
+ * Called inside the MainL() function to create and start the
+ * CTestServer derived server.
+ */
+	{
+	CT_GraphicsWservAPIServer*	server = new (ELeave) CT_GraphicsWservAPIServer();
+	CleanupStack::PushL(server);
+	// CServer base class call
+	//RProcess	handle = RProcess();
+	//TParsePtrC	serverName(handle.FileName());
+	server->ConstructL();		/*Parsing the server name from the file name*/
+	CleanupStack::Pop(server);
+	return server;
+	}
+
+
+TInt LoadDrivers()
+	{
+#ifdef __WINS__
+	#define KPDDName _L("ECDRV")
+	#define KLDDName _L("ECOMM")
+#else
+	#define KPDDName _L("EUART1")
+	#define KLDDName _L("ECOMM")
+#endif
+	TInt rerr = KErrNone;
+
+	rerr = StartC32();
+	if( rerr!=KErrNone && rerr!=KErrAlreadyExists )
+		{
+		return rerr;
+		}
+
+	rerr = User::LoadPhysicalDevice(KPDDName);
+	if(rerr != KErrNone && rerr != KErrAlreadyExists)
+		{
+		return rerr;
+		}
+	rerr = User::LoadLogicalDevice(KLDDName);
+	if(rerr != KErrNone && rerr != KErrAlreadyExists)
+		{
+		return rerr;
+		}
+	return KErrNone;
+	}
+
+LOCAL_C void MainL()
+/**
+ * Secure variant
+ * Much simpler, uses the new Rendezvous() call to sync with the client
+ */
+	{
+#if (defined __DATA_CAGING__)
+	RProcess().DataCaging(RProcess::EDataCagingOn);
+	RProcess().SecureApi(RProcess::ESecureApiOn);
+#endif
+	CActiveScheduler*	sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sched);
+	CT_GraphicsWservAPIServer*	server = NULL;
+	// Create the CTestServer derived server
+	TRAPD(err,server = CT_GraphicsWservAPIServer::NewL());
+	if(!err)
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	delete server;
+	delete sched;
+	}
+
+GLDEF_C TInt E32Main()
+/**
+ * @return - Standard Epoc error code on process exit
+ * Secure variant only
+ * Process entry point. Called by client using RProcess API
+ */
+	{
+	TInt rerr = LoadDrivers();
+	if( rerr != KErrNone )
+		{
+		return rerr;
+		}
+
+	__UHEAP_MARK;
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+#if (defined TRAP_IGNORE)
+	TRAP_IGNORE(MainL());
+#else
+	TRAPD(err,MainL());
+#endif
+	delete cleanup;
+	__UHEAP_MARKEND;
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/src/T_RAnimChild.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "T_RAnimChild.h"
+
+T_RAnimChild::T_RAnimChild()
+{
+}
+T_RAnimChild::T_RAnimChild(RAnimDll &aDll):RAnim(aDll)
+{
+	// No implementation required
+}
+
+T_RAnimChild::~T_RAnimChild()
+{
+}
+
+TInt T_RAnimChild::Construct(const RWindowBase &aDevice, TInt aType, const TDesC8 &aParams)
+	{
+	return RAnim::Construct(aDevice,  aType,  aParams);
+	}
+TInt T_RAnimChild::Construct(const RWindowBase &aDevice, TInt aType, const TDesC8 &aParams, const TIpcArgs& aIpcArgs)
+	{
+	return RAnim::Construct(aDevice, aType, aParams, aIpcArgs);
+	}
+TInt T_RAnimChild::Construct(const RWsSprite &aDevice, TInt aType, const TDesC8 &aParams)
+	{
+	return RAnim::Construct(aDevice, aType, aParams);
+	}
+TInt T_RAnimChild::Construct(const RWsSprite &aDevice, TInt aType, const TDesC8 &aParams, const TIpcArgs& aIpcArgs)
+	{
+	return RAnim::Construct(aDevice, aType, aParams, aIpcArgs);
+	}
+TInt T_RAnimChild::CommandReply(TInt aOpcode)
+	{
+	return RAnim::CommandReply(aOpcode);
+	}
+TInt T_RAnimChild::CommandReply(TInt aOpcode, const TPtrC8 &aArgs)
+	{
+	return RAnim::CommandReply(aOpcode,  aArgs);
+	}
+TInt T_RAnimChild::CommandReply(TInt aOpcode, const TDesC8 &aArgs, const TIpcArgs &aIpcArgs)
+	{
+	return RAnim::CommandReply( aOpcode,  aArgs,aIpcArgs);
+	}
+void T_RAnimChild::Command(TInt aOpcode, const TPtrC8 &aArgs)
+	{
+	RAnim::Command( aOpcode,  aArgs);
+	}
+void T_RAnimChild::Command(TInt aOpcode)
+	{
+	RAnim::Command(aOpcode);
+	}
+void T_RAnimChild::AsyncCommandReply(TRequestStatus& aRequestStatus,TInt aOpcode, const TIpcArgs& aIpcArgs)
+	{
+	RAnim::AsyncCommandReply( aRequestStatus, aOpcode,   aIpcArgs);
+	}
Binary file graphics/wserv/testdata/datafile/uibench_16bit.mbm has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/wserv/testdata/smoketest_bitmap.ini	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,167 @@
+[default_wserv]
+#Set to the number of screens supported on the device
+screens			=1
+
+#Set to index of screen (0 start) to run tests off of
+screen			=0
+
+#Set to default pointer cursor
+pointercursor		=0
+
+pointercursormode	=EPointerCursorNone
+
+#Set to modifier state at start of session
+modifierstate		=EModifierLeftCtrl
+
+#Set to the default width of the device in twips.
+scr_twips_width		=7620
+
+#Set to the default height of the device in twips.
+scr_twips_height	=2858
+
+#Set to the default width of the device.
+scr_width		=640
+
+#Set to the default height of the device.
+scr_height		=240
+
+#Set to the default rotation of the device.
+scr_rotation = EGraphicsOrientationNormal
+
+#Set to default display mode of screen
+display_mode		=EColor64K
+
+#Set to the number of colours in the richest supported colour mode
+max_colors		=65536
+
+#Set to the number of grays in the richest supported colour mode
+max_grays		=0
+
+#Set to display mode nearest to EColor16MA
+nearest_to_color16ma	=EColor16MA
+
+#Set to display mode nearest to EColor256
+nearest_to_color256	=EColor64K
+
+#Set to display mode nearest to EColor4K
+nearest_to_color4K	=EColor64K
+
+#Largest display mode value (nearest to 10000)
+large_displaymode	=EColor64K
+
+#Set to index of screen (0 start) to run tests off of
+screen_negative		=-9999
+
+#Pointer rect area
+pointer_rect_left	=-90
+pointer_rect_top	=-51
+pointer_rect_right	=696
+pointer_rect_bottom	=312
+
+#Num of typefaces
+typefaces		=12
+
+#font heights
+font_height		=131
+
+#font height for case 0194
+font_height_case0194=191
+
+#font height in pixels for the font typeface_index=10 height_index=10
+font_height_10_10=25
+
+#default soundplugin dll
+defSoundPlugin=keyclickref.dll
+defSoundPluginUid=270483700
+
+#default animplugin dll
+def_anim_plugin=t_animplugin.dll
+#max height font name
+font_maxheight=NewCourier
+
+#min height font name
+font_minheight=NewCourier
+
+[default_wserv]
+#height with typeface index 0 and height index 0.
+height_with_index_0_0 = 8
+
+#height with typeface index 0 and height index 9999.
+height_with_index_0_9999 = 242
+
+[scrdev]
+name			=scrdev
+
+[fbsbmp]
+name			=fbsbmp
+
+[fbsBitmap]
+name			=fbsBitmap
+
+[ws]
+name			=ws
+
+[win]
+name			=win
+
+[wingrp]
+name			=wingrp
+
+[wingc]
+name			=wingc
+
+[GRAPHICS-WSERV-WindowGc-Setup-0002-0001-new_command004]
+ws			=ws
+
+[GRAPHICS-WSERV-WindowGc-Setup-0002-0001-Construct_command005]
+//defaultscreennumber	=1
+
+[GRAPHICS-WSERV-WindowGc-Setup-0002-0001-CreateContext_command006]
+windowgc		=wingc
+
+[GRAPHICS-WSERV-WindowGc-Setup-0002-0001-new_command008]
+ws			=ws
+
+[GRAPHICS-WSERV-WindowGc-Setup-0002-0001-Construct_command009]
+clienthandle		=1
+
+[GRAPHICS-WSERV-WindowGc-Setup-0002-0001-new_command011]
+ws			=ws
+
+[GRAPHICS-WSERV-WindowGc-Setup-0002-0001-Construct_command012]
+parent			=wingrp
+handle			=2
+
+[GRAPHICS-WSERV-WindowGc-Setup-0002-0001-SetRequiredDisplayMode_command013]
+mode			={default_wserv,display_mode}
+
+[GRAPHICS-WSERV-WindowGc-Setup-0002-0001-SetBackgroundColor_command014]
+color_red		=255
+color_green		=255
+color_blue		=255
+
+[GRAPHICS-WSERV-WindowGc-Setup-0002-0001-SetAutoFlush_command017]
+newFlushstate		=TRUE
+expectedFlushstate	=FALSE
+
+[GRAPHICS-WSERV-WindowGc-Setup-0002-0001-Activate_command019]
+device			=win
+
+[GRAPHICS-WSERV-WindowGc-Setup-0002-0001-SetBrushColor_command020]
+color_red		=255
+color_green		=0
+color_blue		=0
+
+[GRAPHICS-WSERV-WindowGc-Setup-0002-0001-SetBrushStyle_command021]
+brushstyle		=ESolidBrush
+
+[GRAPHICS-WSERV-WindowGc-PublicApi-0051-0001-Load_command002]
+bitmap_id		=0
+file_name		=\smoketest\bitmap\uibench_16bit.mbm
+share_if_loaded		=TRUE
+use_rfile		=FALSE
+
+[GRAPHICS-WSERV-WindowGc-PublicApi-0051-0001-BitBlt_command009]
+point_x			=10
+point_y			=11
+bitmap			=fbsbmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/http/group/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Component description file
+// 
+//
+
+
+PRJ_TESTMMPFILES
+
+testhttpsuite.mmp
+
+PRJ_TESTEXPORTS
+
+..\script\setup_smoketest_http.script	z:\smoketest\setup_smoketest_http.script
+
+// Script file for testing the functionality.
+..\script\smoketest_http.script			z:\smoketest\smoketest_http.script
+
+// Ini file
+..\ini\smoketest_http.ini	            z:\smoketest\smoketest_http.ini
+
+// Perl script
+..\group\delproxy.pl					z:\delproxy.pl
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/http/group/delproxy.pl	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,46 @@
+#!/usr/bin/perl
+
+# Copyright (c) 2009 Symbian Foundation Ltd
+# This component and the accompanying materials are made available
+# under the terms of the License "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Symbian Foundation Ltd - initial contribution.
+#   Maciej Seroka, maciej@symbian.org
+#
+# Description:
+#   This is a tool for removing proxy settings from ethernetced.xml.
+
+use Tie::File;
+
+my $filename;
+if ($ARGV[0]) {
+  $filename = $ARGV[0];
+ }
+else { die 'Missing parameter "filename"'; }
+
+my $LINE;
+print $filename;
+tie @LINE, 'Tie::File', $filename or die 'file not found';
+my $n = 0;
+my $proxy_begin = 0;
+my $proxy_end = 0;
+
+for (@LINE) {
+  if ($LINE[$n] =~ /<ProxyTable>/) {
+     $proxy_begin = $n;
+   }
+  if ($LINE[$n] =~ /<\/ProxyTable>/) {
+     $proxy_end = $n;
+     last;
+   }
+  $n += 1;
+ }
+ 
+if ($proxy_end > 0) {
+  splice @LINE, $proxy_begin, ($proxy_end - $proxy_begin + 1);
+ }
+
+untie @LINE;
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/http/group/testhttpsuite.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+//OPTION CW   -w off
+TARGET          testhttpsuite.exe 
+TARGETTYPE      EXE
+CAPABILITY ALL -TCB
+
+UID		0x1000007A 0x102729DF
+    
+
+SYSTEMINCLUDE 	/epoc32/include /epoc32/include/test  /epoc32/include/ecom
+USERINCLUDE		../inc
+
+SOURCEPATH		../src
+SOURCE			testhttpserver.cpp testhttpbasestep.cpp testhttpeboclientstep.cpp testhttpbuffersizestep.cpp testhttpeboclientconditionalstep.cpp
+
+LIBRARY     	c32.lib euser.lib estor.lib efsrv.lib http.lib inetprotutil.lib bafl.lib ecom.lib crypto.lib
+LIBRARY  		commdb.lib esock.lib
+
+//For TEF
+LIBRARY		testexecuteutils.lib testexecutelogclient.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/http/inc/testhttpbasestep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,67 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Contains declaration of CTestHttpBaseStep class
+// @internalAll
+// 
+//
+
+#ifndef __TEST_HTTP_BASE_STEP_H__
+#define __TEST_HTTP_BASE_STEP_H__
+
+// System Include
+#include <http.h>
+
+// User Include
+#include "testhttpserver.h"
+
+/**
+This is the base test step from which all other test steps are derived
+to test the EBO support provided by the http client framework.
+@internalTechnology
+@test
+*/
+class CTestHttpBaseStep : public CTestStep, public MHTTPTransactionCallback
+	{
+public:
+    static void InitCommsL();
+	CTestHttpBaseStep();
+	virtual ~CTestHttpBaseStep();
+	// TEF virtuals
+	virtual TVerdict doTestStepPreambleL();
+	// TEF pure virtual
+	virtual TVerdict doTestStepL();
+
+protected:
+	virtual void StartClientL() = 0;
+	virtual void InvokeHttpMethodL(const TDesC8& aUri, RStringF aMethod) = 0;
+
+	// methods from MHTTPTransactionCallback
+	virtual void MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent) = 0;
+	virtual TInt MHFRunError(TInt aError, RHTTPTransaction aTransaction, const THTTPEvent& aEvent) = 0;
+	
+	virtual void SetHeaderL(RHTTPHeaders aHeaders, TInt aHdrField, const TDesC8& aHdrValue);
+	
+protected:
+    RHTTPSession iSess;
+	RHTTPTransaction iTrans;
+    RFs iFileServ;
+	CActiveScheduler* iSched;
+	};
+
+/*@{*/
+/// Literal constant defined for identifying step name
+_LIT(KTestHttpBaseStep, "TestHttpBaseStep");
+/*@}*/
+
+#endif		// __TEST_HTTPEBO_BASE_STEP_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/http/inc/testhttpbuffersizestep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,54 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Contains declaration of CTestHttpBufferSizeStep class
+// @internalAll
+// 
+//
+
+#ifndef __TEST_HTTP_BUFFER_SIZE_STEP_H__
+#define __TEST_HTTP_BUFFER_SIZE_STEP_H__
+
+// User Include
+#include "testhttpbasestep.h"
+
+/// Literal constant defined for identifying step name
+_LIT(KTestHttpBufferSizeStep, "TestHttpBufferSizeStep");
+
+/**
+This is the base test step from which all other test steps are derived
+to test the HTTP Library.
+@internalTechnology
+@test
+*/
+class CTestHttpBufferSizeStep : public CTestHttpBaseStep
+	{
+public:
+    CTestHttpBufferSizeStep();
+	virtual ~CTestHttpBufferSizeStep();
+	
+private:
+    void StartClientL();
+    void InvokeHttpMethodL(const TDesC8& aUri, RStringF aMethod);
+	void ValidateTest();
+	
+	// methods from MHTTPTransactionCallback
+	void MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent) ;
+	TInt MHFRunError(TInt aError, RHTTPTransaction aTransaction, const THTTPEvent& aEvent) ;
+	
+public:
+	MHTTPDataSupplier* iRespBody;
+	TInt iChunkSize;
+	};
+
+#endif		// __TEST_HTTP_BUFFER_SIZE_STEP_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/http/inc/testhttpeboclientconditionalstep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,62 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Contains declaration of CHttpEboClientStep class
+// @internalAll
+// 
+//
+
+#ifndef TESTHTTPEBOCLIENTCONDITIONALSTEP_H_
+#define TESTHTTPEBOCLIENTCONDITIONALSTEP_H_
+//System Include
+#include "testhttpbasestep.h"
+#include <http/mhttpdataoptimiser.h>
+
+/**
+This is the eboclient to test the ebo functionality.
+This tests some conditions like the pipelining and non pipelining with the ebo feature.
+@internalTechnology
+@test
+*/
+
+class CHttpEboClientConditionalStep : public CTestHttpBaseStep, public MHttpDataOptimiser
+	{
+public:
+	virtual ~CHttpEboClientConditionalStep();
+	CHttpEboClientConditionalStep();
+
+	//These methods from MHttpDataOptimiser
+	void EncodeL (const TDesC8& aHttpData, HBufC8*& aEncodedData);
+	void DecodeL (const TDesC8& aData, HBufC8*& aHttpData, TBool& aTransFail);
+
+private:
+	void StartClientL();
+	void InvokeHttpMethodL(const TDesC8& aUri, RStringF aMethod);
+	
+	// methods from MHTTPTransactionCallback
+	void MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent);
+	TInt MHFRunError(TInt aError, RHTTPTransaction aTransaction, const THTTPEvent& aEvent);
+
+private:
+	MHTTPDataSupplier* iRespBody;
+	TInt iChunkSize;
+	TBool iPipeliningEnabled;
+	TBool iDisableTransOpt;
+	};
+	
+/*@{*/
+/// Literal constant defined for identifying step name
+_LIT(KTestHttpEboClientConditionalStep, "TestHttpEboClientConditionalStep");
+/*@}*/
+
+#endif /*TESTHTTPEBOCLIENTCONDITIONALSTEP_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/http/inc/testhttpeboclientstep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,62 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Contains declaration of CHttpEboClientStep class
+// @internalAll
+// 
+//
+
+#ifndef __TEST_HTTP_EBOCLIENT_STEP_H__
+#define __TEST_HTTP_EBOCLIENT_STEP_H__
+
+//System Include
+#include "testhttpbasestep.h"
+#include <http/mhttpdataoptimiser.h>
+
+/**
+This is the eboclient to test the ebo functionality.
+@internalTechnology
+@test
+*/
+
+class CHttpEboClientStep : public CTestHttpBaseStep, public MHttpDataOptimiser
+	{
+public:
+	virtual ~CHttpEboClientStep();
+	CHttpEboClientStep();
+
+	//These methods from MHttpDataOptimiser
+	void EncodeL (const TDesC8& aHttpData, HBufC8*& aEncodedData);
+	void DecodeL (const TDesC8& aData, HBufC8*& aHttpData, TBool& aTransFail);
+
+private:
+	void StartClientL();
+	void InvokeHttpMethodL(const TDesC8& aUri, RStringF aMethod);
+	
+	// methods from MHTTPTransactionCallback
+	void MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent);
+	TInt MHFRunError(TInt aError, RHTTPTransaction aTransaction, const THTTPEvent& aEvent);
+
+private:
+	TBool iSavingResponseBody;
+	RFile iRespBodyFile;
+	MHTTPDataSupplier* iRespBody;
+	TPtrC iOutputFilename;
+	};
+	
+/*@{*/
+/// Literal constant defined for identifying step name
+_LIT(KTestHttpEboClientStep, "TestHttpEboClientStep");
+/*@}*/
+
+#endif		// __TEST_HTTP_EBOCLIENT_STEP_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/http/inc/testhttpserver.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,61 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Contains declaration of CTestHttpServer class
+// @internalAll
+// 
+//
+
+#ifndef __TEST__HTTP_SERVER_H__
+#define __TEST__HTTP_SERVER_H__
+
+// System Include
+// For accessing TEF classes 
+#include <testexecuteserverbase.h>
+
+/*@{*/
+/// Literal constants for INI file field-names
+_LIT(KIniSessProxy, 		   "SessProxy");
+_LIT(KIniSessProxyUsage, 	   "SessProxyUsage");
+_LIT(KIniTranProxy,        "TranProxy");
+_LIT(KIniTranProxyUsage,   "TranProxyUsage");
+_LIT(KIniUri, 		       "Uri");
+_LIT(KIniRespBodyFileName, "RespBodyFileName");
+_LIT(KIniFileName,  	   "OutputFileName");
+_LIT(KIniSessHttpOptUsage, "SessHttpOptUsage");
+_LIT(KIniTranHttpOptUsage, "TranHttpOptUsage");
+_LIT(KIniIsEncoded,  "IsEncoded");
+_LIT(KIniIsDecoded,  "IsDecoded");
+_LIT(KIniFailTransaction,  "FailTransaction");
+_LIT(KDisableTransOpt, "DisableTransOpt");
+/*@}*/
+_LIT(KTxt, "ERROR");
+
+/**
+This is the test server to test the white/black-list uri service API. 
+@internalTechnology
+*/
+class CTestHttpServer : public CTestServer
+	{
+public:
+	// Construction
+	static	CTestHttpServer* 	NewL();
+	// Base class pure virtual
+	virtual CTestStep* 	CreateTestStep(const TDesC& aStepName);
+	
+protected:
+	CTestStep* 	 CreateTestStepL(const TDesC& aStepName);
+	const TPtrC  ServerName();
+	};
+
+#endif		// __TEST__HTTPEBO_SERVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/http/ini/smoketest_http.ini	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,10 @@
+[HttpEbo_1]
+Uri		= http://www.google.co.uk/
+SessProxyUsage	= EFalse
+TranProxyUsage	= EFalse
+OutputFileName	= C:\logs\testexecute\HttpGoogle.htm
+SessHttpOptUsage = EFalse
+TranHttpOptUsage = EFalse
+IsEncoded        =
+IsDecoded	 =
+FailTransaction  =
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/http/script/setup_smoketest_http.script	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,24 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+RUN_UTILS MkDir			c:\smoketest\
+
+RUN_UTILS CopyFile 		z:\smoketest\smoketest_http.ini		c:\smoketest\smoketest_http.ini
+RUN_UTILS MakeReadWrite	c:\smoketest\smoketest_http.ini
+RUN_UTILS CopyFile 		z:\smoketest\smoketest_http.script	c:\smoketest\smoketest_http.script
+RUN_UTILS MakeReadWrite	c:\smoketest\smoketest_http.script
+RUN_UTILS CopyFile 		z:\delproxy.pl						c:\delproxy.pl
+RUN_UTILS MakeReadWrite	c:\delproxy.pl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/http/script/smoketest_http.script	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,30 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Script file for HTTP Smoke Test.
+// @internalAll
+// 
+
+PRINT Run Http smoketest
+
+// Load the test
+LOAD_SUITE testhttpsuite
+DELAY 1000
+
+START_TESTCASE	SMOKE_HTTP_0001
+//!	@SYMTestCaseID		SMOKE_EMAIL_0001
+//! @SYMTestCaseDesc 	Create the transaction with GET method and some requesting URL
+
+RUN_TEST_STEP 	100 	testhttpsuite TestHttpEboClientStep	c:\smoketest\smoketest_http.ini  HttpEbo_1
+
+END_TESTCASE 	SMOKE_HTTP_0001
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/http/src/testhttpbasestep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,166 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Contains implementation of CTestHttpBaseStep class
+// @internalAll
+// 
+//
+
+// System Include
+// for StartC32()
+#include <c32comm.h>
+#include <e32base.h>
+#include <http.h>
+// User Include
+#include "testhttpbasestep.h"
+
+// File system root
+_LIT(KFileSystemRoot,"C:\\");
+
+// PDD names for the physical device drivers that are loaded in wins or arm
+#if defined (__WINS__)
+#define PDD_NAME		_L("ECDRV")
+#else
+#define PDD_NAME		_L("EUART1")
+#define PDD2_NAME		_L("EUART2")
+#define PDD3_NAME		_L("EUART3")
+#define PDD4_NAME		_L("EUART4")
+#endif
+
+#define LDD_NAME		_L("ECOMM")
+
+
+// Loads the physical device drivers
+void CTestHttpBaseStep::InitCommsL()
+	{
+	TInt ret = User::LoadPhysicalDevice(PDD_NAME);
+	User::LeaveIfError(ret == KErrAlreadyExists?KErrNone:ret);
+
+#ifndef __WINS__
+	ret = User::LoadPhysicalDevice(PDD2_NAME);
+	ret = User::LoadPhysicalDevice(PDD3_NAME);
+	ret = User::LoadPhysicalDevice(PDD4_NAME);
+#endif
+
+	ret = User::LoadLogicalDevice(LDD_NAME);
+	User::LeaveIfError(ret == KErrAlreadyExists?KErrNone:ret);
+	ret = StartC32();
+	User::LeaveIfError(ret == KErrAlreadyExists?KErrNone:ret);
+	}
+	
+
+/**
+Constructor: Sets the test step name.
+@internalTechnology
+@test
+*/
+CTestHttpBaseStep::CTestHttpBaseStep()
+	{
+	//Call base class method to set human readable name for test step
+	SetTestStepName(KTestHttpBaseStep);
+	}
+
+
+/**
+Destructor: Closes the iFileServ.
+@internalTechnology
+@test
+*/
+CTestHttpBaseStep::~CTestHttpBaseStep()
+	{
+	iFileServ.Close();
+	delete iSched;
+	//CleanupStack::PopAndDestroy(); // iSched
+	iSched = NULL;
+	}
+	
+
+/**
+Base class virtual doTestStepPreambleL(): 
+Create and install the active scheduler and connect to iFileServ (RFs).
+@internalTechnology
+@test
+@param		None
+@return		EPass or EFail.
+*/
+TVerdict CTestHttpBaseStep::doTestStepPreambleL()
+	{
+	iSched = new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(iSched);
+	User::LeaveIfError(iFileServ.Connect());
+    return TestStepResult();
+	}	// doTestPreambleL
+
+
+/**
+Base class pure virtual doTestStepL(): 
+Tests the ebo support in http.
+@internalTechnology
+@test
+@param		None
+@return		EPass or EFail indicating the result of the test step.
+*/
+TVerdict CTestHttpBaseStep::doTestStepL()
+	{
+//	__UHEAP_MARK;
+	INFO_PRINTF1(_L("\n"));
+	// Start C32 and initalize some device drivers. This is necessary when running a test console as these won't 
+	// have been started
+	TRAPD(err,InitCommsL());
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(_L("Teststep Failed: Leave occured in CTestHttpBaseStep::InitCommsL: %D\n"
+					  ),err
+				   );
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		// Opening session
+		iSess.OpenL();
+		// start the client
+		TRAP(err,StartClientL());
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(_L("Teststep Failed: Leave occured in CTestHttpBaseStep::StartClientL: %D\n"
+						  ),err
+					   );
+			SetTestStepResult(EFail);
+			}
+		// Closing session
+		iSess.Close();
+		}
+//	__UHEAP_MARKEND; 
+	
+	INFO_PRINTF1(_L("\n"));
+	return TestStepResult();
+	}	// doTestStepL
+	
+
+/**
+Sets the headers.
+@internalTechnology
+@test
+@param		aHeaders 	Headers collection
+@param		aHdrField 	Header field to be added
+@return		aHdrValue	Header value to be added	
+*/
+void CTestHttpBaseStep::SetHeaderL(RHTTPHeaders aHeaders, TInt aHdrField, const TDesC8& aHdrValue)
+	{
+	RStringF valStr = iSess.StringPool().OpenFStringL(aHdrValue);
+	THTTPHdrVal val(valStr);
+	aHeaders.SetFieldL(iSess.StringPool().StringF(aHdrField,RHTTPSession::GetTable()), val);
+	valStr.Close();
+	}
+	
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/http/src/testhttpbuffersizestep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,261 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Contains implementation of CTestHttpBufferSizeStep class
+// @internalAll
+// 
+//
+
+// System Include
+// for StartC32()
+#include <c32comm.h>
+#include <e32base.h>
+#include <http.h>
+
+// User Include
+#include "testhttpbuffersizestep.h"
+
+// File system root
+_LIT(KFileSystemRoot,"C:\\");
+
+// Standard headers used by default
+_LIT8(KUserAgent, "TestHttpBufferSize");
+_LIT8(KAccept, "*/*");
+
+
+/**
+Constructor: Sets the test step name.
+@internalTechnology
+@test
+*/
+CTestHttpBufferSizeStep::CTestHttpBufferSizeStep()
+	{
+	//Call base class method to set human readable name for test step
+	SetTestStepName(KTestHttpBufferSizeStep); 
+	//Set the iChunkSize to the default buffer size of 6144 Bytes
+	iChunkSize = 1024;
+	}
+
+
+/**
+Destructor: Closes the iFileServ.
+@internalTechnology
+@test
+*/
+CTestHttpBufferSizeStep::~CTestHttpBufferSizeStep()
+	{
+	}
+	
+
+/**
+Sets the proxy and HttpDataOptimiser implemetation to session
+based on the patameter values in ini file and calls InvokeHttpMethodL()
+@internalTechnology
+@test
+@param		None
+@return		None
+*/
+void CTestHttpBufferSizeStep::StartClientL()
+	{
+	TPtrC uri;
+	
+    if (!GetStringFromConfig(ConfigSection(), KIniUri, uri))
+		{
+		ERR_PRINTF2(_L("Problem in reading values from ini.			\
+						\nExpected fields are: \n%S\n"
+					  ),&KIniUri);
+		SetTestStepResult(EFail);
+		return;
+		}
+
+	THTTPHdrVal hdrVal ( 1024 );
+	RHTTPConnectionInfo httpConnInfo = iSess.ConnectionInfo();
+	httpConnInfo.SetPropertyL ( iSess.StringPool().StringF(HTTP::ERecvBufferSize,RHTTPSession::GetTable()), hdrVal );
+	INFO_PRINTF1(_L("Receive buffer size has been set to 1024 bytes\n"));
+	
+	RStringPool strP = iSess.StringPool();
+	RStringF method;
+	
+	// method
+	method = strP.StringF(HTTP::EGET,RHTTPSession::GetTable());		
+	TBuf8<256> url8;
+	url8.Copy(uri);
+	TRAPD(err,InvokeHttpMethodL(url8, method));
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(_L("Teststep Failed: Leave occured in CTestHttpBufferSizeStep::InvokeHttpMethodL: %D\n"
+					  ),err
+				   );
+		SetTestStepResult(EFail);
+		}
+	method.Close(); 
+	ValidateTest();
+	}
+
+
+/**
+Invoke the http method
+This actually creates the transaction, sets the headers and HttpDataOptimiser implemetation to transaction
+and then starts the transaction 
+@internalTechnology
+@test
+@param		aUri 		Requested uri
+@param		aMethod 	Requested method
+@return		None		
+*/
+void CTestHttpBufferSizeStep::InvokeHttpMethodL(const TDesC8& aUri, RStringF aMethod)
+	{
+
+	TUriParser8 uri; 
+	uri.Parse( aUri );
+	
+	// Opening a transaction	
+	iTrans = iSess.OpenTransactionL(uri, *this, aMethod);
+	RHTTPHeaders hdr = iTrans.Request().GetHeaderCollection();
+	// Add headers appropriate to all methods
+	SetHeaderL(hdr, HTTP::EUserAgent, KUserAgent);
+	SetHeaderL(hdr, HTTP::EAccept, KAccept);
+
+	// submit the transaction
+	iTrans.SubmitL();
+	// Start the scheduler, once the transaction completes or is cancelled on an error the scheduler will be
+	// stopped in the event handler
+	CActiveScheduler::Start();
+	}
+
+
+/**
+This is the implementation of interface method CTestHttpBufferSizeStep::MHFRunL
+If there is a reponse body it will be copied to a file.
+Just printing the fired events to the log file.
+@internalTechnology 
+@test
+@param		aTransaction Transaction which is being processed currently
+@param      THTTPEvent Event for which it is called
+@return		None
+*/	
+void CTestHttpBufferSizeStep::MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent)
+	{
+	switch (aEvent.iStatus)
+		{
+		case THTTPEvent::EGotResponseHeaders:
+			{
+			// HTTP response headers have been received. We can determine now if there is
+			// going to be a response body to save.
+			RHTTPResponse resp = aTransaction.Response();
+			TInt status = resp.StatusCode();
+			RStringF statusStr = resp.StatusText();
+			TBuf<32> statusStr16;
+			statusStr16.Copy(statusStr.DesC());
+			INFO_PRINTF3(_L("Status: %D (%S)\n"),status, &statusStr16);
+
+			if (resp.HasBody() && (status >= 200) && (status < 300) && (status != 204))
+				{
+				TInt dataSize = resp.Body()->OverallDataSize();
+				if (dataSize >= 0)
+					INFO_PRINTF2(_L("Response body size is %d\n"), dataSize);
+				else
+					INFO_PRINTF1(_L("Response body size is unknown\n"));
+				}
+			} break;
+		case THTTPEvent::EGotResponseBodyData:
+			{
+			// Get the body data supplier
+			iRespBody = aTransaction.Response().Body();
+			INFO_PRINTF1(_L("Receiving response body...\n"));
+			
+			TPtrC8 bodyData;
+			TBool lastChunk = iRespBody->GetNextDataPart(bodyData);
+			if(bodyData.Size() > iChunkSize)
+				{
+				iChunkSize = bodyData.Size();
+				}
+			iRespBody->ReleaseData();
+			} break;
+		case THTTPEvent::EResponseComplete:
+			{
+			// The transaction's response is complete
+			INFO_PRINTF1(_L("\nTransaction Complete\n"));
+			} break;
+		case THTTPEvent::ESucceeded:
+			{
+			INFO_PRINTF1(_L("Transaction Successful\n"));
+			aTransaction.Close();
+			CActiveScheduler::Stop();
+			} break;
+		case THTTPEvent::EFailed:
+			{
+			INFO_PRINTF1(_L("Transaction Failed\n"));
+			aTransaction.Close();
+			CActiveScheduler::Stop();
+			} break;
+		case THTTPEvent::ERedirectedPermanently:
+			{
+			INFO_PRINTF1(_L("Permanent Redirection\n"));
+			} break;
+		case THTTPEvent::ERedirectedTemporarily:
+			{
+			INFO_PRINTF1(_L("Temporary Redirection\n"));
+			} break;
+		case THTTPEvent::ERedirectRequiresConfirmation:
+ 			{
+			// 301(Moved Permanently), 302(Found) or 307(Temporary Redirect) status is received 
+			// from a transaction and hence ERedirectRequiresConfirmation is sent by filter
+			// client has opted to close the transaction
+			INFO_PRINTF1(_L("Redirect requires confirmation\n"));
+ 			aTransaction.Close();
+ 			CActiveScheduler::Stop();
+ 			} break;
+		default:
+			{
+			INFO_PRINTF2(_L("<unrecognised event: %D>\n"), aEvent.iStatus);
+			// close off the transaction if it's an error
+			if (aEvent.iStatus < 0)
+				{
+				aTransaction.Close();
+				CActiveScheduler::Stop();
+				}
+			} break;
+		}
+	}
+
+
+/**
+This is the implementation of interface method CTestHttpBufferSizeStep::MHFRunError
+@internalTechnology 
+@test
+@param		aError  Error which has been raised.	
+@param		aTransaction Transaction which is being processed currently
+@param      THTTPEvent Event which it is being handled currently.
+@return		None
+*/
+TInt CTestHttpBufferSizeStep::MHFRunError(TInt aError, RHTTPTransaction /*aTransaction*/, const THTTPEvent& /*aEvent*/)
+	{
+	INFO_PRINTF2(_L("MHFRunError fired with error code %D\n"), aError);
+	return KErrNone;
+	}
+
+void CTestHttpBufferSizeStep::ValidateTest()
+	{
+	if(iChunkSize <= 1024)
+		{
+		ERR_PRINTF1(_L("Teststep Passed: Buffer Size Feature is working\n"));
+		}
+	else
+		{
+		ERR_PRINTF2(_L("Received a chunk of size: %D\n"), iChunkSize);
+		ERR_PRINTF1(_L("Received a chunk of size greater than the specified size of 1024 Bytes.\n"));
+		ERR_PRINTF1(_L("Teststep Failed: Buffer Size Feature is not working\n"));
+		SetTestStepResult(EFail);
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/http/src/testhttpeboclientconditionalstep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,314 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Contains implementation of CHttpEboClientStep class
+// @internalAll
+// 
+//
+
+// User Include
+#include "testhttpeboclientconditionalstep.h"
+
+// Standard headers used by default
+_LIT8(KUserAgent, "TestHttpEboClientConditional");
+_LIT8(KAccept, "*/*");
+_LIT8(KHttpUrl1, "http://www.google.co.in/");
+_LIT8(KHttpUrl2, "http://www.live.com/");
+_LIT8(KHttpUrl3, "http://www.search.com/");
+_LIT8(KHttpUrl4, "http://www.find.com/");
+
+/**
+Constructor: Sets the test step name.
+@internalTechnology
+@test
+*/
+CHttpEboClientConditionalStep::CHttpEboClientConditionalStep()
+	{
+	
+	//Call base class method to set human readable name for test step
+	SetTestStepName(KTestHttpEboClientConditionalStep);
+	}
+
+
+/**
+Destructor
+@internalTechnology
+@test
+*/
+CHttpEboClientConditionalStep::~CHttpEboClientConditionalStep()
+	{
+	}
+
+
+/**
+Sets the proxy and HttpDataOptimiser implemetation to session
+based on the patameter values in ini file and calls InvokeHttpMethodL()
+@internalTechnology
+@test
+@param		None
+@return		None
+*/
+void CHttpEboClientConditionalStep::StartClientL()
+	{
+	if (!GetBoolFromConfig(ConfigSection(), KDisableTransOpt, iDisableTransOpt))
+		{
+		ERR_PRINTF2(_L("Problem in reading values from ini.			\
+						\nExpected fields are: \n%S\n"
+					  ),&KDisableTransOpt);
+		SetTestStepResult(EFail);
+		return;
+		}
+
+	RStringPool strP = iSess.StringPool();
+	RStringF method;
+	
+	// method
+	method = strP.StringF(HTTP::EGET,RHTTPSession::GetTable());		
+	TBuf8<256> url8;
+	TRAPD(err,InvokeHttpMethodL(url8, method));
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(_L("Teststep Failed: Leave occured in CTestHttpBufferSizeStep::InvokeHttpMethodL: %D\n"
+					  ),err
+				   );
+		SetTestStepResult(EFail);
+		}
+	method.Close(); 
+	}
+
+/**
+Invoke the http method
+This actually creates the transaction, sets the headers and HttpDataOptimiser implemetation to transaction
+and then starts the transaction 
+@internalTechnology
+@test
+@param		aUri 		Requested uri
+@param		aMethod 	Requested method
+@return		None		
+*/
+void CHttpEboClientConditionalStep::InvokeHttpMethodL(const TDesC8& /*aUri*/, RStringF aMethod)
+	{
+	TUriParser8 uri1; 
+	uri1.Parse( KHttpUrl1 );
+	
+	// Opening transactions	
+	RHTTPTransaction trans1 = iSess.OpenTransactionL(uri1, *this, aMethod);
+	CleanupClosePushL(trans1);
+	RHTTPHeaders hdr1 = trans1.Request().GetHeaderCollection();
+	SetHeaderL(hdr1, HTTP::EUserAgent, KUserAgent);
+	SetHeaderL(hdr1, HTTP::EAccept, KAccept);
+		
+	TUriParser8 uri2; 
+	uri2.Parse( KHttpUrl2 );
+	RHTTPTransaction trans2 = iSess.OpenTransactionL(uri2, *this, aMethod);
+	CleanupClosePushL(trans2);
+	RHTTPHeaders hdr2 = trans2.Request().GetHeaderCollection();
+	SetHeaderL(hdr2, HTTP::EUserAgent, KUserAgent);
+	SetHeaderL(hdr2, HTTP::EAccept, KAccept);
+	
+	TUriParser8 uri3; 
+	uri3.Parse( KHttpUrl3 );
+	RHTTPTransaction trans3 = iSess.OpenTransactionL(uri3, *this, aMethod);
+	CleanupClosePushL(trans3);
+	RHTTPHeaders hdr3 = trans3.Request().GetHeaderCollection();
+	SetHeaderL(hdr3, HTTP::EUserAgent, KUserAgent);
+	SetHeaderL(hdr3, HTTP::EAccept, KAccept);
+	
+	TUriParser8 uri4; 
+	uri4.Parse( KHttpUrl4 );
+	RHTTPTransaction trans4 = iSess.OpenTransactionL(uri4, *this, aMethod);
+	CleanupClosePushL(trans4);
+	RHTTPHeaders hdr4 = trans4.Request().GetHeaderCollection();
+	SetHeaderL(hdr4, HTTP::EUserAgent, KUserAgent);
+	SetHeaderL(hdr4, HTTP::EAccept, KAccept);
+		
+	if (iDisableTransOpt)
+		{
+		iSess.SetupHttpDataOptimiser(*this);
+		THTTPHdrVal disableOptimiser(iSess.StringPool().StringF(HTTP::EDisableHTTPTransOptimiser,RHTTPSession::GetTable()));
+		trans3.PropertySet().SetPropertyL(iSess.StringPool().StringF(HTTP::EHTTPTransOptimiser,RHTTPSession::GetTable()), disableOptimiser);
+		}
+	else
+		{
+		trans1.SetupHttpDataOptimiser(*this);
+		trans2.SetupHttpDataOptimiser(*this);
+		trans4.SetupHttpDataOptimiser(*this);
+		}
+	
+	trans1.SubmitL();
+	CActiveScheduler::Start();
+		
+	trans2.SubmitL();
+	CActiveScheduler::Start();
+		
+	trans3.SubmitL();
+	CActiveScheduler::Start();
+		
+	trans4.SubmitL();
+	CActiveScheduler::Start();
+	
+	CleanupStack::Pop(&trans4);
+	CleanupStack::Pop(&trans3);
+	CleanupStack::Pop(&trans2);
+	CleanupStack::Pop(&trans1);
+	}
+
+/**
+This is the implementation of interface method MHttpDataOptimiser::MHFRunL
+If there is a reponse body it will be copied to a file.
+Just printing the fired events to the log file.
+@internalTechnology 
+@test
+@param		aTransaction Transaction which is being processed currently
+@param      THTTPEvent Event for which it is called
+@return		None
+*/	
+void CHttpEboClientConditionalStep::MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent)
+	{
+	switch (aEvent.iStatus)
+		{
+		case THTTPEvent::EGotResponseHeaders:
+			{
+			INFO_PRINTF2(_L("Processing Transaction %d\n"), aTransaction.Id());
+			RHTTPResponse resp = aTransaction.Response();
+			TInt status = resp.StatusCode();
+			RStringF statusStr = resp.StatusText();
+			TBuf<32> statusStr16;
+			statusStr16.Copy(statusStr.DesC());
+			INFO_PRINTF3(_L("Status: %D (%S)\n"),status, &statusStr16);
+
+			if (resp.HasBody() && (status >= 200) && (status < 300) && (status != 204))
+				{
+				TInt dataSize = resp.Body()->OverallDataSize();
+				if (dataSize >= 0)
+					INFO_PRINTF2(_L("Response body size is %d\n"), dataSize);
+				else
+					INFO_PRINTF1(_L("Response body size is unknown\n"));
+				} 
+			} break;
+		case THTTPEvent::EGotResponseBodyData:
+			{
+			// Get the body data supplier
+			iRespBody = aTransaction.Response().Body();
+			INFO_PRINTF1(_L("Receiving response body...\n"));
+			
+			TPtrC8 bodyData;
+			TBool lastChunk = iRespBody->GetNextDataPart(bodyData);
+			if(bodyData.Size() > iChunkSize)
+				{
+				iChunkSize = bodyData.Size();
+				}
+			iRespBody->ReleaseData();
+			} break;
+		case THTTPEvent::EResponseComplete:
+			{
+			// The transaction's response is complete
+			INFO_PRINTF1(_L("\nTransaction Complete\n"));
+			} break;
+		case KErrHttpOptimiserFailsTrans:
+			{
+			INFO_PRINTF1(_L("Cancelling/Failing Transaction\n"));
+			aTransaction.Fail(THTTPFilterHandle::EProtocolHandler);
+			//CActiveScheduler::Stop();
+			} break;
+		case THTTPEvent::ESucceeded:
+			{
+			INFO_PRINTF1(_L("Transaction Successful\n"));
+			aTransaction.Close();
+			CActiveScheduler::Stop();
+			} break;
+		case THTTPEvent::EFailed:
+			{
+			INFO_PRINTF1(_L("Transaction Failed\n"));
+			aTransaction.Close();
+			CActiveScheduler::Stop();
+			} break;
+		case THTTPEvent::ERedirectedPermanently:
+			{
+			INFO_PRINTF1(_L("Permanent Redirection\n"));
+			} break;
+		case THTTPEvent::ERedirectedTemporarily:
+			{
+			INFO_PRINTF1(_L("Temporary Redirection\n"));
+			} break;
+		case THTTPEvent::ERedirectRequiresConfirmation:
+ 			{
+			// 301(Moved Permanently), 302(Found) or 307(Temporary Redirect) status is received 
+			// from a transaction and hence ERedirectRequiresConfirmation is sent by filter
+			// client has opted to close the transaction
+			INFO_PRINTF1(_L("Redirect requires confirmation\n"));
+ 			aTransaction.Close();
+ 			CActiveScheduler::Stop();
+ 			} break;
+		default:
+			{
+			INFO_PRINTF2(_L("<unrecognised event: %D>\n"), aEvent.iStatus);
+			// close off the transaction if it's an error
+			if (aEvent.iStatus < 0)
+				{
+				aTransaction.Close();
+				CActiveScheduler::Stop();
+				}
+			} break;
+		}
+	}
+
+
+/**
+This is the implementation of interface method MHttpDataOptimiser::MHFRunError
+@internalTechnology 
+@test
+@param		aError  Error which has been raised.	
+@param		aTransaction Transaction which is being processed currently
+@param      THTTPEvent Event which it is being handled currently.
+@return		None
+*/
+TInt CHttpEboClientConditionalStep::MHFRunError(TInt aError, RHTTPTransaction /*aTransaction*/, const THTTPEvent& /*aEvent*/)
+	{
+	INFO_PRINTF2(_L("MHFRunError fired with error code %D\n"), aError);
+	return KErrNone;
+	}
+
+
+/**
+It enocodes the request data.
+@internalTechnology 
+@test
+@param		aHttpData  Actual request.
+@param		aEncodedData Encoded request.
+@return		None
+*/
+void CHttpEboClientConditionalStep::EncodeL (const TDesC8& aHttpData, HBufC8* &aEncodedData)
+	{
+	INFO_PRINTF1(_L("######## CHttpEboClientStep::EncodeL ########\n"));
+	aEncodedData =  aHttpData.AllocLC();
+	CleanupStack::Pop();
+	INFO_PRINTF1(_L("Encoded/Changed the request\n"));
+	}
+
+	
+/**
+It decodes the responsing data before parsing.
+@internalTechnology 
+@test
+@param		aHttpData  Actual response.
+@param		aEncodedData Decoded response.
+@return		None
+*/
+void CHttpEboClientConditionalStep::DecodeL (const TDesC8& aData, HBufC8*& aHttpData, TBool& /*aTransFail*/)
+	{
+	INFO_PRINTF1(_L("######## CHttpEboClientStep::DecodeL ########\n"));
+	aHttpData = aData.AllocLC();
+	CleanupStack::Pop();	
+	INFO_PRINTF1(_L("Sent the actual response as a decoded response\n"));
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/http/src/testhttpeboclientstep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,542 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Contains implementation of CHttpEboClientStep class
+// @internalAll
+// 
+//
+
+// User Include
+#include "testhttpeboclientstep.h"
+// Additional headers
+#include "CommDbConnPref.h"
+#include "CommDb.h"
+#include "es_sock.h"
+
+// Standard headers used by default
+_LIT8(KUserAgent, "TestHttpEboClient");
+_LIT8(KAccept, "*/*");
+
+/**
+Constructor: Sets the test step name.
+@internalTechnology
+@test
+*/
+CHttpEboClientStep::CHttpEboClientStep()
+	{
+	
+	//Call base class method to set human readable name for test step
+	SetTestStepName(KTestHttpEboClientStep);
+	}
+
+
+/**
+Destructor
+@internalTechnology
+@test
+*/
+CHttpEboClientStep::~CHttpEboClientStep()
+	{
+	}
+
+
+/**
+Sets the proxy and HttpDataOptimiser implemetation to session
+based on the patameter values in ini file and calls InvokeHttpMethodL()
+@internalTechnology
+@test
+@param		None
+@return		None
+*/
+void CHttpEboClientStep::StartClientL()
+	{
+	TPtrC uri;
+	TPtrC proxyPtr;
+	TBool proxyUsage;
+	TPtrC resbodyFilename;
+	TBool sessHttpOptUsage;
+    if (!GetStringFromConfig(ConfigSection(), KIniUri, uri) ||
+        !GetStringFromConfig(ConfigSection(), KIniFileName, resbodyFilename) ||
+	    !GetBoolFromConfig(ConfigSection(), KIniSessProxyUsage, proxyUsage) 
+	   )
+		{
+		ERR_PRINTF4(_L("Problem in reading values from ini.			\
+						\nExpected fields are: \n%S\n%S\n%S\n"
+					  ),&KIniUri, &KIniFileName, &KIniSessProxyUsage
+				   );
+		SetTestStepResult(EFail);
+		return;
+		}
+	iOutputFilename.Set(resbodyFilename);
+	if (proxyUsage)
+		if(!GetStringFromConfig(ConfigSection(), KIniSessProxy, proxyPtr)
+	      )
+			{
+			ERR_PRINTF2(_L("Problem in reading values from ini.			\
+							\nExpected field is: \n%S\n"
+						  ),&KIniSessProxy
+					   );
+			SetTestStepResult(EFail);
+			return;
+			}
+	RStringPool strP = iSess.StringPool();
+	RStringF method;
+	//setting proxy to session
+	if(proxyUsage)
+		{
+		iSess.ConnectionInfo().SetPropertyL(iSess.StringPool().StringF(HTTP::EProxyUsage,RHTTPSession::GetTable()), iSess.StringPool().StringF(HTTP::EUseProxy,RHTTPSession::GetTable()));
+		TBuf8<256> prox8;
+		prox8.Copy(proxyPtr);
+		RStringF proxy = iSess.StringPool().OpenFStringL(prox8);
+		CleanupClosePushL(proxy);
+		iSess.ConnectionInfo().SetPropertyL(iSess.StringPool().StringF(HTTP::EProxyAddress,RHTTPSession::GetTable()), proxy);
+		CleanupStack::PopAndDestroy(&proxy);
+		}
+	// Setting HttpDataOptimiser to session
+	if (!GetBoolFromConfig(ConfigSection(), KIniSessHttpOptUsage, sessHttpOptUsage))
+	   	{
+		ERR_PRINTF2(_L("Problem in reading values from ini.			\
+						\nExpected fields are: \n%S\n"
+					  ),&KIniSessHttpOptUsage
+				   );
+		SetTestStepResult(EFail);
+		return;
+		}
+	if (sessHttpOptUsage)
+		iSess.SetupHttpDataOptimiser(*this);
+	
+	// method
+	method = strP.StringF(HTTP::EGET,RHTTPSession::GetTable());		
+	TBuf8<256> url8;
+	url8.Copy(uri);
+	TRAPD(err,InvokeHttpMethodL(url8, method));
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(_L("Teststep Failed: Leave occured in CTestHttpBaseStep::InvokeHttpMethodL: %D\n"
+					  ),err
+				   );
+		SetTestStepResult(EFail);
+		}
+	method.Close(); 
+	}
+
+
+/**
+Invoke the http method
+This actually creates the transaction, sets the headers and HttpDataOptimiser implemetation to transaction
+and then starts the transaction 
+@internalTechnology
+@test
+@param		aUri 		Requested uri
+@param		aMethod 	Requested method
+@return		None		
+*/
+void CHttpEboClientStep::InvokeHttpMethodL(const TDesC8& aUri, RStringF aMethod)
+	{
+
+	TBool tranProxyUsage;
+	TBool tranHttpOptUsage;
+	TPtrC tranProxy;
+	TUriParser8 uri; 
+	uri.Parse( aUri );
+
+	//This code has been added by Maciej Seroka to get rid of the access point selection dialog
+
+	// Initialise the socket server session.
+	RSocketServ socketServ;
+	User::LeaveIfError(socketServ.Connect());
+
+	// Initialise the RConnection.
+	RConnection connection;
+	User::LeaveIfError(connection.Open(socketServ));
+		
+	// open the IAP communications database 
+	CCommsDatabase* commDB = CCommsDatabase::NewL(EDatabaseTypeIAP);
+	CleanupStack::PushL(commDB);
+	
+	// initialize a view 
+	CCommsDbConnectionPrefTableView* commDBView = 
+	commDB->OpenConnectionPrefTableInRankOrderLC(ECommDbConnectionDirectionOutgoing);
+	
+	// go to the first record 
+	User::LeaveIfError(commDBView->GotoFirstRecord());
+
+	// Declare a prefTableView Object.
+	CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref pref;
+	
+	// read the connection preferences 
+	commDBView->ReadConnectionPreferenceL(pref);
+	TUint32 iapID = pref.iBearer.iIapId;
+
+	// pop and destroy the IAP View 
+	CleanupStack::PopAndDestroy(commDBView);
+
+	// pop and destroy the database object
+	CleanupStack::PopAndDestroy(commDB);
+	
+	// Now we have the iap Id. Use it to connect for the connection.
+	// Create a connection preference variable.
+	TCommDbConnPref connectPref;
+
+	// setup preferences 
+	connectPref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
+	connectPref.SetDirection(ECommDbConnectionDirectionOutgoing);
+	connectPref.SetBearerSet(ECommDbBearerGPRS);
+	connectPref.SetIapId(iapID);
+
+	// start a synchronous connection
+	TInt errConnect = connection.Start(connectPref);
+	
+	// Then, associate the current socket server session and rconnection object
+	//used above with the HttpSession which u will be using.
+
+	RStringPool strP = iSess.StringPool();
+	RHTTPConnectionInfo connInfo = iSess.ConnectionInfo();
+	connInfo.SetPropertyL ( strP.StringF(HTTP::EHttpSocketServ,	RHTTPSession::GetTable() ),
+			                   THTTPHdrVal (socketServ.Handle()));
+	TInt connPtr = REINTERPRET_CAST(TInt, &(connection));
+	connInfo.SetPropertyL ( strP.StringF(HTTP::EHttpSocketConnection,
+								RHTTPSession::GetTable() ), 
+								THTTPHdrVal (connPtr) );
+		
+	//and it ends here.
+	
+	
+	// Opening a transaction	
+	iTrans = iSess.OpenTransactionL(uri, *this, aMethod);
+	RHTTPHeaders hdr = iTrans.Request().GetHeaderCollection();
+	// Add headers appropriate to all methods
+	SetHeaderL(hdr, HTTP::EUserAgent, KUserAgent);
+	SetHeaderL(hdr, HTTP::EAccept, KAccept);
+	
+	if (!GetBoolFromConfig(ConfigSection(), KIniTranProxyUsage, tranProxyUsage))
+	  	{
+		ERR_PRINTF2(_L("Problem in reading values from ini.			\
+						\nExpected fields are: \n%S\n"
+					  ),&KIniTranProxyUsage
+				   );
+		SetTestStepResult(EFail);
+		return;
+		}
+	if (tranProxyUsage)
+		if (!GetStringFromConfig(ConfigSection(), KIniTranProxy, tranProxy))
+		    {
+			ERR_PRINTF2(_L("Problem in reading values from ini.			\
+							\nExpected field is: \n%S\n"
+						  ),&KIniTranProxy
+					   );
+			SetTestStepResult(EFail);
+			return;
+			}
+	//setting transaction proxy
+	RHTTPTransactionPropertySet transactionProperties = iTrans.PropertySet();
+//	RStringPool strP = iSess.StringPool();
+	if (tranProxyUsage)
+		{
+		TBuf8<256> tranProx8;
+		tranProx8.Copy(tranProxy);
+		RStringF proxyAddr = strP.OpenFStringL(tranProx8);
+		CleanupClosePushL(proxyAddr);
+		THTTPHdrVal proxyUsage(strP.StringF(HTTP::EUseProxy, RHTTPSession::GetTable()));
+		transactionProperties.SetPropertyL(strP.StringF(HTTP::EProxyUsage,RHTTPSession::GetTable()), proxyUsage);
+		transactionProperties.SetPropertyL(strP.StringF(HTTP::EProxyAddress,RHTTPSession::GetTable()), proxyAddr);
+		CleanupStack::PopAndDestroy(1,&proxyAddr);
+		}
+	
+	// Setting HttpDataOptimiser for transaction.
+	if (!GetBoolFromConfig(ConfigSection(), KIniTranHttpOptUsage, tranHttpOptUsage))
+	  	{
+		ERR_PRINTF2(_L("Problem in reading values from ini.			\
+						\nExpected fields are: \n%S\n"
+					  ),&KIniTranHttpOptUsage
+				   );
+		SetTestStepResult(EFail);
+		return;
+		}
+	if (tranHttpOptUsage)
+		iTrans.SetupHttpDataOptimiser(*this);
+	// submit the transaction
+	iTrans.SubmitL();
+	// Start the scheduler, once the transaction completes or is cancelled on an error the scheduler will be
+	// stopped in the event handler
+	CActiveScheduler::Start();
+	}
+
+
+/**
+This is the implementation of interface method MHttpDataOptimiser::MHFRunL
+If there is a reponse body it will be copied to a file.
+Just printing the fired events to the log file.
+@internalTechnology 
+@test
+@param		aTransaction Transaction which is being processed currently
+@param      THTTPEvent Event for which it is called
+@return		None
+*/	
+void CHttpEboClientStep::MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent)
+	{
+	switch (aEvent.iStatus)
+		{
+		case THTTPEvent::EGotResponseHeaders:
+			{
+			// HTTP response headers have been received. We can determine now if there is
+			// going to be a response body to save.
+			RHTTPResponse resp = aTransaction.Response();
+			TInt status = resp.StatusCode();
+			RStringF statusStr = resp.StatusText();
+			TBuf<32> statusStr16;
+			statusStr16.Copy(statusStr.DesC());
+			INFO_PRINTF3(_L("Status: %D (%S)\n"),status, &statusStr16);
+            // Determine if the body will be saved to disk
+			iSavingResponseBody = EFalse;
+			if (resp.HasBody() && (status >= 200) && (status < 300) && (status != 204))
+				{
+				TInt dataSize = resp.Body()->OverallDataSize();
+				if (dataSize >= 0)
+					INFO_PRINTF2(_L("Response body size is %d\n"), dataSize);
+				else
+					INFO_PRINTF1(_L("Response body size is unknown\n"));
+				
+				// Save response to file in disk.
+				iSavingResponseBody = ETrue;
+				}
+
+			    if (iSavingResponseBody) // If we're saving, then open a file handle for the new file
+				{
+				// Check it exists and open a file handle
+				TInt valid = iFileServ.IsValidName(iOutputFilename);
+				if (!valid)
+					{
+					ERR_PRINTF1(_L("The specified filename is not valid!.\n"));
+					iSavingResponseBody = EFalse;
+					}
+				else
+					{
+					TInt err = iRespBodyFile.Replace(iFileServ,
+													 iOutputFilename,
+													 EFileWrite|EFileShareExclusive);
+					if (err)
+						{
+						iSavingResponseBody = EFalse;
+						User::Leave(err);
+						}
+					}
+				}
+            
+			} break;
+		case THTTPEvent::EGotResponseBodyData:
+			{
+			// Get the body data supplier
+			iRespBody = aTransaction.Response().Body();
+
+			// Append to the output file if we're saving responses
+			if (iSavingResponseBody)
+				{
+				INFO_PRINTF1(_L("Saving response body...\n"));
+				TPtrC8 bodyData;
+				TBool lastChunk = iRespBody->GetNextDataPart(bodyData);
+				iRespBodyFile.Write(bodyData);
+				if (lastChunk)
+					iRespBodyFile.Close();
+				}
+
+			// Done with that bit of body data
+			iRespBody->ReleaseData();
+			} break;
+		case THTTPEvent::EResponseComplete:
+			{
+			// The transaction's response is complete
+			INFO_PRINTF1(_L("\nTransaction Complete\n"));
+			} break;
+		case KErrHttpOptimiserFailsTrans:
+			{
+			INFO_PRINTF1(_L("Cancelling/Failing Transaction\n"));
+			aTransaction.Fail(THTTPFilterHandle::EProtocolHandler);
+			//CActiveScheduler::Stop();
+			} break;
+		case THTTPEvent::ESucceeded:
+			{
+			INFO_PRINTF1(_L("Transaction Successful\n"));
+			aTransaction.Close();
+			CActiveScheduler::Stop();
+			} break;
+		case THTTPEvent::EFailed:
+			{
+			INFO_PRINTF1(_L("Transaction Failed\n"));
+			aTransaction.Close();
+			CActiveScheduler::Stop();
+			//Line added to fail the test if no connection to a web server
+			SetTestStepResult(EFail);
+			} break;
+		case THTTPEvent::ERedirectedPermanently:
+			{
+			INFO_PRINTF1(_L("Permanent Redirection\n"));
+			} break;
+		case THTTPEvent::ERedirectedTemporarily:
+			{
+			INFO_PRINTF1(_L("Temporary Redirection\n"));
+			} break;
+		case THTTPEvent::ERedirectRequiresConfirmation:
+ 			{
+			// 301(Moved Permanently), 302(Found) or 307(Temporary Redirect) status is received 
+			// from a transaction and hence ERedirectRequiresConfirmation is sent by filter
+			// client has opted to close the transaction
+			INFO_PRINTF1(_L("Redirect requires confirmation\n"));
+ 			aTransaction.Close();
+ 			CActiveScheduler::Stop();
+ 			} break;
+		default:
+			{
+			INFO_PRINTF2(_L("<unrecognised event: %D>\n"), aEvent.iStatus);
+			// close off the transaction if it's an error
+			if (aEvent.iStatus < 0)
+				{
+				aTransaction.Close();
+				CActiveScheduler::Stop();
+				}
+			//Line added to fail the test if no connection to a web server
+			SetTestStepResult(EFail);
+			} break;
+		}
+	}
+
+
+/**
+This is the implementation of interface method MHttpDataOptimiser::MHFRunError
+@internalTechnology 
+@test
+@param		aError  Error which has been raised.	
+@param		aTransaction Transaction which is being processed currently
+@param      THTTPEvent Event which it is being handled currently.
+@return		None
+*/
+TInt CHttpEboClientStep::MHFRunError(TInt aError, RHTTPTransaction /*aTransaction*/, const THTTPEvent& /*aEvent*/)
+	{
+	INFO_PRINTF2(_L("MHFRunError fired with error code %D\n"), aError);
+	return KErrNone;
+	}
+
+
+/**
+It enocodes the request data.
+@internalTechnology 
+@test
+@param		aHttpData  Actual request.
+@param		aEncodedData Encoded request.
+@return		None
+*/
+void CHttpEboClientStep::EncodeL (const TDesC8& /*aHttpData*/, HBufC8* &aEncodedData)
+	{
+	
+	INFO_PRINTF1(_L("######## CHttpEboClientStep::EncodeL ########\n"));
+	TBool isEncoded;
+	if (!GetBoolFromConfig(ConfigSection(), KIniIsEncoded, isEncoded))
+	  	{
+		ERR_PRINTF2(_L("Problem in reading values from ini.			\
+						\nExpected fields are: \n%S\n"
+					  ),&KIniIsEncoded
+				   );
+		SetTestStepResult(EFail);
+		return;
+		}
+	// Checking whether enocoding is needed.
+	if (isEncoded)
+		{
+		// Encoding: Changing the request data to http://www.google.co.uk/
+		_LIT8(KTestRequest, "GET http://www.google.co.uk/ HTTP/1.1\r\nHost: www.google.co.uk\r\nAccept: */*\r\nUser-Agent: TestHttpEboClient\r\n\r\n");
+		const TDesC8& encodedReq(KTestRequest);
+		TRAPD(err,
+			{
+			aEncodedData =  encodedReq.AllocLC();
+			CleanupStack::Pop();
+			});	
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(_L("Test step failed: Leave occured while encoding the request: %D\n"), err);
+       	    SetTestStepResult(EFail);
+			}
+		else
+			{
+			INFO_PRINTF1(_L("Encoded/Changed the request\n"));
+			}
+		}
+	else
+		INFO_PRINTF1(_L("Not encoding the request [passing NULL]\n"));	
+	}
+
+	
+/**
+It decodes the responsing data before parsing.
+@internalTechnology 
+@test
+@param		aHttpData  Actual response.
+@param		aEncodedData Decoded response.
+@return		None
+*/
+void CHttpEboClientStep::DecodeL (const TDesC8& aData, HBufC8*& aHttpData, TBool& aTransFail)
+	{
+	INFO_PRINTF1(_L("######## CHttpEboClientStep::DecodeL ########\n"));
+	TBool isDecoded;
+	TBool failTransaction;
+	if (!GetBoolFromConfig(ConfigSection(), KIniIsDecoded, isDecoded))
+	  	{
+		ERR_PRINTF2(_L("Problem in reading values from ini.			\
+						\nExpected fields are: \n%S\n"
+					  ),&KIniIsDecoded
+				   );
+		SetTestStepResult(EFail);
+		return;
+		}
+	// Checking whether decoding is needed.
+	if (isDecoded)
+		{
+		TRAPD(err, 
+			{
+			// Copying same actual response to decoded response
+			aHttpData = aData.AllocLC();
+			CleanupStack::Pop();	
+			});
+		if (err != KErrNone)
+			{
+			ERR_PRINTF2(_L("Test step failed: Leave occured while decoding the response: %D\n"), err);
+       	    SetTestStepResult(EFail);
+			}
+		else
+			{
+			INFO_PRINTF1(_L("Sent the actual response as a decoded response\n"));
+			}
+		}
+	else
+		INFO_PRINTF1(_L("Not decoding the response [passing NULL]\n"));
+	
+	if(!GetBoolFromConfig(ConfigSection(), KIniFailTransaction, failTransaction))
+	  	{
+		ERR_PRINTF2(_L("Problem in reading values from ini.			\
+						\nExpected fields are: \n%S\n"
+					  ),&KIniFailTransaction
+				   );
+		SetTestStepResult(EFail);
+		return;
+		}
+	// Checking to fail the transaction.
+	if (failTransaction)
+		{
+		aTransFail = ETrue;
+		INFO_PRINTF1(_L("CHttpEboClientStep::DecodeL returing ETrue(intend to fail the transaction)\n"));	
+		}
+	else
+		{
+		aTransFail = EFalse;	
+		INFO_PRINTF1(_L("CHttpEboClientStep::DecodeL returing EFalse(not failing the transaction)\n"));	
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/http/src/testhttpserver.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,271 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Contains implementation of CTestHttpServer class
+// @internalAll
+// 
+//
+
+// User Includes
+// Test Server
+#include "testhttpserver.h"
+
+// Test steps
+#include "testhttpbasestep.h"
+#include "testhttpeboclientstep.h"
+#include "testhttpeboclientconditionalstep.h"
+#include "testhttpbuffersizestep.h"
+
+#if (!defined EKA2)
+// The system-wide unique name for the test-server
+_LIT(KServerName, "TestHttpServer");
+#endif
+
+/**
+Static factory constructor. Creates and returns instance of the test server
+@internalTechnology
+@test
+@return		A pointer to the newly created CTestHttpServer object
+*/
+CTestHttpServer*  CTestHttpServer::NewL()
+	{
+	// Construct the server
+	CTestHttpServer* server = new(ELeave) CTestHttpServer();
+	CleanupStack::PushL(server);
+
+	// CServer base class call
+	// Name the server using the system-wide unique string
+	// Clients use this to create server sessions.
+	server->StartL(server->ServerName());
+
+	CleanupStack::Pop(server);
+	return server;
+	}
+
+
+#if (!defined EKA2)
+/**
+Creates the Active Scheduler, then creates the test-server, synchronises the
+thread with the client and then enters the active scheduler.
+
+This is EKA1 version of MainL(). Uses sempahore to sync with client
+as Rendezvous calls are not available
+*/
+LOCAL_C void MainL()
+	{
+	// Create and install the active scheduler.
+	CActiveScheduler* sched = new(ELeave) CActiveScheduler;
+	CleanupStack::PushL(sched);
+	CActiveScheduler::Install(sched);
+
+	// Create the server inside trap harness
+	CTestHttpServer *server = NULL;
+	TRAPD(err, server = CTestHttpServer::NewL());
+	if (!err)
+		{
+		CleanupStack::PushL(server);
+		RSemaphore sem;
+
+		// The client API of TestExecute will already have created the
+		// semaphore and will be waiting on it.
+		User::LeaveIfError(sem.OpenGlobal(KServerName));
+
+		CleanupStack::Pop(server);
+
+		// Signal the client
+		sem.Signal();
+		sem.Close();
+
+		// Enter the active scheduler
+		sched->Start();
+		}
+	CleanupStack::PopAndDestroy(); // sched
+	delete server;
+	
+	}
+#else
+/**
+EKA2 version of MainL()
+Uses the new Rendezvous call isntead of the older semaphore.
+*/
+LOCAL_C void MainL()
+	{
+	// For platform security
+#if (defined __DATA_CAGING__)
+	RProcess().DataCaging(RProcess::EDataCagingOn);
+	RProcess().SecureApi(RProcess::ESecureApiOn);
+#endif
+	CActiveScheduler* sched = new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sched);
+	CTestHttpServer* server = NULL;
+
+	// Create the test-server
+	TRAPD(err, server = CTestHttpServer::NewL());
+
+	if(!err)
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	delete server;
+	delete sched;
+	}
+#endif		// #if (!defined EKA2)
+
+
+#if (defined __WINS__ && !defined EKA2)
+/**
+DLL entry-point for EKA1 emulator builds.
+*/
+GLDEF_C TInt E32Dll(enum TDllReason /*aDllReason*/)
+	{
+	return KErrNone;
+	}
+#else
+/**
+Exe entry point code, for EKA1 hardware and EKA2 builds.
+*/
+GLDEF_C TInt E32Main()
+	{
+	__UHEAP_MARK;
+	CTrapCleanup *cleanup = CTrapCleanup::New();
+	if (cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	
+	TRAPD(err, MainL());
+	__ASSERT_ALWAYS(!err,User::Panic(KTxt,err));
+	delete cleanup;
+	__UHEAP_MARKEND;
+	return KErrNone;
+	}
+#endif		// #if (defined __WINS__ && !defined EKA2)
+
+#if (defined __WINS__ && !defined EKA2)
+/**
+For EKA1 emulator builds. This function is called when the thread is first
+resumed. Has the standard thread entry siganture.
+@internalTechnology
+@test
+@return		KErrNone if everything is fine or system-wide error if any
+*/
+TInt ThreadFunc (TAny* /*aParam*/)
+	{
+	__UHEAP_MARK;
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if (cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAPD(err, MainL());
+	__ASSERT_ALWAYS(!err,User::Panic(KTxt,err));
+	delete cleanup;
+	__UHEAP_MARKEND;
+	return KErrNone;
+	}
+
+/**
+For EKA1 emulator builds. Creates and starts a thread for the server to run.
+@internalTechnology
+@test
+@param		None
+@return		Integer value indicating the error code.
+*/
+EXPORT_C TInt NewServer()
+	{
+	_LIT(KThread, "Thread");
+	RThread thread;
+
+	// Name the thread as "<Server-Name>Thread" making it hopefully unique
+	TBuf<KMaxTestExecuteNameLength> threadName(KServerName);
+	threadName.Append(KThread);
+
+	const TInt KMaxHeapSize = 0x1000000;
+
+	// Create the thread
+	TInt err = thread.Create(threadName, ThreadFunc, KDefaultStackSize,
+							 KMinHeapSize, KMaxHeapSize, NULL, EOwnerProcess
+							);
+	if (err != KErrNone)
+		{
+		return err;
+		}
+
+	// Start the thread -> effectively calls ThreadFunc
+	thread.Resume();
+
+	thread.Close();
+	return KErrNone;
+	}
+#endif 		// #if (defined __WINS__ && !defined EKA2)
+
+
+/**
+Base class pure virtual
+@internalTechnology
+@test
+@return 	Instance of the test step
+@param		Descriptor containing the test-step name
+*/
+CTestStep* CTestHttpServer::CreateTestStep(const TDesC& aStepName)
+	{
+	CTestStep *testStep = NULL;
+	TRAPD(err,testStep=CreateTestStepL(aStepName));
+	if(err == KErrNone)
+		return testStep;
+	else
+		return NULL;
+	}
+
+
+CTestStep* CTestHttpServer::CreateTestStepL(const TDesC& aStepName)
+	{
+	CTestStep *testStep = NULL;
+	
+	if (aStepName == KTestHttpEboClientStep)
+		{
+		testStep = new (ELeave) CHttpEboClientStep();
+		}
+	else if (aStepName == KTestHttpEboClientConditionalStep)
+		{
+		testStep = new (ELeave) CHttpEboClientConditionalStep();
+		}
+	else if ( aStepName == KTestHttpBufferSizeStep )
+		{
+		testStep = new (ELeave) CTestHttpBufferSizeStep();
+		}
+		
+	return testStep;
+	}
+
+/**
+Returns server name based on the EKA version
+@internalTechnology
+@test
+@return		Descriptor containing the servername
+*/
+const TPtrC CTestHttpServer::ServerName()
+	{
+#if (!defined EKA2)
+	return KServerName();
+#else
+	// The exe name can be either TestWListBListUriServer or
+	// TestWListBListUriServer_Cap based on whether the normal
+	// or the security tests are being run. So decide the server
+	// name during runtime
+	TParsePtrC serverName(RProcess().FileName());
+	return serverName.Name();
+#endif
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inputmethods/Bmarm/InputMethodSmokeTestModuleU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inputmethods/Bwins/InputMethodSmokeTestModuleU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inputmethods/EABI/InputMethodSmokeTestModuleU.def	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inputmethods/conf/InputMethodSmokeTestModule.cfg	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,20 @@
+[Test]
+title Create Predictive Text Engine
+create InputMethodSmokeTestModule ptiengine
+ptiengine CreatePtiEngine
+delete ptiengine
+[Endtest] 
+
+[Test]
+title Create Predictive Text Dictionary
+create InputMethodSmokeTestModule ptidict
+ptidict CreatePtiDictionary
+delete ptidict
+[Endtest]
+
+[Test]
+title Predict Word
+create InputMethodSmokeTestModule ptiengine
+ptiengine MultitapWord 26637776664443 android
+delete ptiengine
+[Endtest]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inputmethods/group/Bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description:
+*
+*/
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+	
+	DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+../conf/InputMethodSmokeTestModule.cfg	c:/smoketest/InputMethodSmokeTestModule.cfg
+
+PRJ_TESTMMPFILES
+
+	InputMethodSmokeTestModule.mmp
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inputmethods/group/InputMethodSmokeTestModule.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: MMP file for STIF Test Framework's TestScripter 
+* testclass test module.
+*
+*/
+
+#include <platform_paths.hrh>
+
+TARGET          InputMethodSmokeTestModule.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         InputMethodSmokeTestModule.def
+
+USERINCLUDE     ../inc 
+
+MW_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      ../src
+
+SOURCE          InputMethodSmokeTestModule.cpp
+SOURCE          InputMethodSmokeTestModuleBlocks.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+LIBRARY			bafl.lib
+LIBRARY         euser.lib
+LIBRARY			ecom.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY			ocrsrv.lib
+LIBRARY			ptiengine.lib
+
+LANG            SC
+
+/*
+START WINS      
+?wins_specific_information
+END
+
+START MARM
+?marm_specific_information
+END
+*/
+// Other possible keywords:
+ 
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+/*
+START BITMAP ?target
+TARGETPATH   ?emulated_path_on_target_machine
+HEADER
+SOURCE       ?color_depth ?source_bitmap
+END
+*/
+// DEFFILE ?filename
+// AIF ?filename
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inputmethods/inc/InputMethodSmokeTestModule.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,211 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: STIF testclass declaration
+*
+*/
+
+#ifndef INPUTMETHODSMOKETESTMODULE_H
+#define INPUTMETHODSMOKETESTMODULE_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KInputMethodSmokeTestModuleLogPath, "\\logs\\testframework\\InputMethodSmokeTestModule\\" ); 
+// Log file
+_LIT( KInputMethodSmokeTestModuleLogFile, "InputMethodSmokeTestModule.txt" ); 
+_LIT( KInputMethodSmokeTestModuleLogFileWithTitle, "InputMethodSmokeTestModule_[%S].txt" );
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CInputMethodSmokeTestModule;
+class CPtiEngine;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+
+// CLASS DECLARATION
+
+/**
+*  CInputMethodSmokeTestModule test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CInputMethodSmokeTestModule) : public CScriptBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CInputMethodSmokeTestModule* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CInputMethodSmokeTestModule();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CScriptBase Runs a script line.
+        * @since ?Series60_version
+        * @param aItem Script line containing method name and parameters
+        * @return Symbian OS error code
+        */
+        virtual TInt RunMethodL( CStifItemParser& aItem );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CInputMethodSmokeTestModule( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+        * Test methods are listed below. 
+        */
+
+        /**
+        * CreateOcrEngine test method.
+        * @since ?Series60_version
+        * @param aItem Script line containing parameters.
+        * @return Symbian OS error code.
+        */
+        virtual TInt CreateOcrEngineL( CStifItemParser& aItem );
+        
+        /**
+        * CreatePtiEngine test method.
+        * @since ?Series60_version
+        * @param aItem Script line containing parameters.
+        * @return Symbian OS error code.
+        */
+        virtual TInt CreatePtiEngineL( CStifItemParser& aItem );
+
+        /**
+        * CreatePtiEngine test method.
+        * @since ?Series60_version
+        * @param aItem Script line containing parameters.
+        * @return Symbian OS error code.
+        */
+        virtual TInt CreatePtiDictionaryL( CStifItemParser& aItem );
+
+        /**
+        * CreatePtiEngine test method.
+        * @since ?Series60_version
+        * @param aItem Script line containing parameters.
+        * @return Symbian OS error code.
+        */
+        virtual TInt MultitapWordL( CStifItemParser& aItem );
+        
+        void PtiEngSimulateInput(CPtiEngine* aEngine, const TDesC& aKeys);
+        
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+        //ADD NEW METHOD DEC HERE
+        //[TestMethods] - Do not remove
+
+    public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // INPUTMETHODSMOKETESTMODULE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inputmethods/inc/TestOcrObserver.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  test ocrsrv.h
+ *
+*/
+
+#ifndef TESTOCROBSERVER_H
+#define TESTOCROBSERVER_H
+
+#include <ocrsrv.h>
+
+/**
+ *  CTestNotesControl is used to add setting page control in its window
+ */
+class TTestOcrObserver : public MOCREngineObserver
+    {
+public:
+    // from MOCREngineObserver
+    void RecognizeBlockComplete( TInt /*aError*/, const TOCRTextRgnInfo* /*aBlocks*/, const TInt /*aBlockCount*/ ) {}
+    void RecognizeSpecialRegionComplete( TInt /*aError*/, const TOCRTextRgnInfo* /*aBlocks*/, const TInt /*aBlockCount*/ ) {}
+    void RecognizeComplete( TInt /*aError*/, const TOCRTextRgnInfo* /*aBlocks*/, const TInt /*aBlockCount*/ ) {}
+    void LayoutComplete( TInt /*aError*/, const TOCRBlockInfo* /*aBlocks*/, const TInt /*aBlockCount*/ ) {}
+    void RecognizeProcess( const TUint /*aPercent*/ ) {}
+    };
+
+#endif /*TESTOCROBSERVER_H*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inputmethods/src/InputMethodSmokeTestModule.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,199 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains testclass implementation.
+*
+*/
+
+// INCLUDE FILES
+#include <Stiftestinterface.h>
+#include "InputMethodSmokeTestModule.h"
+#include <SettingServerClient.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CInputMethodSmokeTestModule::CInputMethodSmokeTestModule
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CInputMethodSmokeTestModule::CInputMethodSmokeTestModule( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CInputMethodSmokeTestModule::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CInputMethodSmokeTestModule::ConstructL()
+    {
+    //Read logger settings to check whether test case name is to be
+    //appended to log file name.
+    RSettingServer settingServer;
+    TInt ret = settingServer.Connect();
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        }
+    // Struct to StifLogger settigs.
+    TLoggerSettings loggerSettings; 
+    // Parse StifLogger defaults from STIF initialization file.
+    ret = settingServer.GetLoggerSettings(loggerSettings);
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        } 
+    // Close Setting server session
+    settingServer.Close();
+
+    TFileName logFileName;
+    
+    if(loggerSettings.iAddTestCaseTitle)
+        {
+        TName title;
+        TestModuleIf().GetTestCaseTitleL(title);
+        logFileName.Format(KInputMethodSmokeTestModuleLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KInputMethodSmokeTestModuleLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KInputMethodSmokeTestModuleLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// CInputMethodSmokeTestModule::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CInputMethodSmokeTestModule* CInputMethodSmokeTestModule::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CInputMethodSmokeTestModule* self = new (ELeave) CInputMethodSmokeTestModule( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CInputMethodSmokeTestModule::~CInputMethodSmokeTestModule()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+
+    }
+
+//-----------------------------------------------------------------------------
+// CInputMethodSmokeTestModule::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CInputMethodSmokeTestModule::SendTestClassVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("InputMethodSmokeTestModule.dll");
+
+	TBool newVersionOfMethod = ETrue;
+	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+	}
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CInputMethodSmokeTestModule::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inputmethods/src/InputMethodSmokeTestModuleBlocks.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,285 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains testclass implementation.
+*
+*/
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+#include <ocrsrv.h>
+#include <ptiengine.h>
+#include <ptiuserdictionary.h>
+#include <Ecom/Ecom.h>
+#include "InputMethodSmokeTestModule.h"
+#include "TestOcrObserver.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+const TInt KMaxSize = 32;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CInputMethodSmokeTestModule::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CInputMethodSmokeTestModule::Delete() 
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CInputMethodSmokeTestModule::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CInputMethodSmokeTestModule::RunMethodL( 
+    CStifItemParser& aItem ) 
+    {
+    static TStifFunctionInfo const KFunctions[] =
+        {  
+        // Copy this line for every implemented function.
+        // First string is the function name used in TestScripter script file.
+        // Second is the actual implementation member function. 
+        ENTRY( "CreateOcrEngine", CInputMethodSmokeTestModule::CreateOcrEngineL ),
+        ENTRY( "CreatePtiEngine", CInputMethodSmokeTestModule::CreatePtiEngineL ),
+        ENTRY( "CreatePtiDictionary", CInputMethodSmokeTestModule::CreatePtiDictionaryL ),
+        ENTRY( "MultitapWord", CInputMethodSmokeTestModule::MultitapWordL ),
+        //ADD NEW ENTRY HERE
+        // [test cases entries] - Do not remove
+
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+    }
+
+// -----------------------------------------------------------------------------
+// CInputMethodSmokeTestModule::ExampleL
+// Example test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CInputMethodSmokeTestModule::CreateOcrEngineL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KInputMethodSmokeTestModule, "InputMethodSmokeTestModule" );
+    _LIT( KCreateOcrEngine, "In Create OCR Engine" );
+    
+    iLog->Log( KCreateOcrEngine );
+    
+    TOcrEngineEnv engineEnv;
+    engineEnv.iPriority = EPriorityNormal;
+    engineEnv.iMaxHeapSize = 1200+KMinHeapGrowBy+1;
+    
+    TTestOcrObserver observer;
+    
+    MOCREngineInterface* ocrEngine = NULL;
+    ocrEngine = OCREngineFactory::CreateOCREngineL(observer, engineEnv, OCREngineFactory::EEngineLayoutRecognize);
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CInputMethodSmokeTestModule::ExampleL
+// Example test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CInputMethodSmokeTestModule::CreatePtiEngineL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KInputMethodSmokeTestModule, "InputMethodSmokeTestModule" );
+    _LIT( KCreatePtiEngine, "In Create PTI Engine" );
+    
+    iLog->Log( KCreatePtiEngine );
+    
+    CPtiEngine* ptiEngine = CPtiEngine::NewL();
+    CleanupStack::PushL(ptiEngine);
+    
+    ptiEngine->ActivateLanguageL(ELangEnglish, EPtiEngineMultitapping);
+    
+    CleanupStack::PopAndDestroy(ptiEngine);
+    REComSession::FinalClose();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CInputMethodSmokeTestModule::ExampleL
+// Example test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CInputMethodSmokeTestModule::CreatePtiDictionaryL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KInputMethodSmokeTestModule, "InputMethodSmokeTestModule" );
+    _LIT( KCreatePtiDictionary, "In Create PTI Dictionary" );
+    
+    iLog->Log( KCreatePtiDictionary );
+    
+    CPtiUserDictionary* ptiDictionary = CPtiUserDictionary::NewL(KMaxSize);
+
+    delete ptiDictionary;
+    ptiDictionary = NULL;
+    
+    REComSession::FinalClose();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CInputMethodSmokeTestModule::ExampleL
+// Example test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CInputMethodSmokeTestModule::MultitapWordL(CStifItemParser& aItem)
+	{
+    // Print to UI
+    _LIT( KInputMethodSmokeTestModule, "InputMethodSmokeTestModule" );
+    _LIT( KMultitapWord, "In Multitap Word" );
+    
+    iLog->Log( KMultitapWord );
+	
+	TPtrC inputSequence;
+	if ( aItem.GetNextString(inputSequence) == KErrNone )
+		{
+		CPtiEngine *ptiEngine = CPtiEngine::NewL();
+		CleanupStack::PushL(ptiEngine);
+
+		// setup multitap
+		ptiEngine->ActivateLanguageL(ELangEnglish, EPtiEngineMultitapping);
+		PtiEngSimulateInput(ptiEngine, inputSequence);
+		
+		TPtrC expectedWord;
+		if ( aItem.GetNextString(expectedWord) == KErrNone )
+			{
+			if ( ptiEngine->CurrentWord() == expectedWord )
+				{
+				iLog->Log(_L("Words matched"));
+				}
+			else
+				{
+				User::Leave(KErrArgument);
+				}
+			}
+
+		ptiEngine->CommitCurrentWord();
+
+		ptiEngine->CloseCurrentLanguageL();
+		CleanupStack::PopAndDestroy(ptiEngine);
+		REComSession::FinalClose();
+		}
+
+	return KErrNone;
+	}
+
+void CInputMethodSmokeTestModule::PtiEngSimulateInput(CPtiEngine* aEngine, const TDesC& aKeys)
+    {
+    for(int i=0; i<aKeys.Length(); ++i)
+        {
+        if (aKeys[i] == ' ')
+            {
+            continue;
+            }
+        else if (aKeys[i] == 'p')
+            {
+            continue;
+            }
+        else if (aKeys[i] == 'd')
+            {
+            aEngine->DeleteKeyPress();
+            }
+        else
+            {
+            aEngine->AppendKeyPress(aEngine->CharacterToKey(aKeys[i]));
+            }
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CInputMethodSmokeTestModule::?member_function
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*
+TInt CInputMethodSmokeTestModule::?member_function(
+   CItemParser& aItem )
+   {
+
+   ?code
+
+   }
+*/
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+//  [End of File] - Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inputmethods/src/TestOcrObserver.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1 @@
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/group/ctlbscommon.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,81 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbscommon.mmp
+// 
+//
+
+SYSTEMINCLUDE	/epoc32/include
+SYSTEMINCLUDE	/epoc32/include/test
+SYSTEMINCLUDE	/epoc32/include/lbs
+SYSTEMINCLUDE	/epoc32/include/lbs/test
+
+USERINCLUDE	../inc
+//USERINCLUDE	../../../../locationmgmt/locationcore/LbsLogging/inc
+// Common framework code.
+SOURCEPATH	../src
+SOURCE		ctlbsserver.cpp
+SOURCE		ctlbsshareddata.cpp
+SOURCE		ctlbsstep.cpp
+SOURCE		ctlbsnetsimstep.cpp
+
+// Common test step code.
+SOURCE		ctlbsstepinstallscheduler.cpp
+SOURCE		ctlbsstepcreateverifymoduledata.cpp
+SOURCE		ctlbsstepcreateverifyposinfos.cpp
+SOURCE		ctlbsstepverifymodinfo.cpp
+SOURCE		ctlbsstepverifyposinfos.cpp
+SOURCE		ctlbsstepverifyroughposinfos.cpp
+SOURCE		ctlbsstepverifyloginfo.cpp
+SOURCE		ctlbsstepverifymodstatus.cpp
+SOURCE		ctlbsstepstartlbs.cpp
+SOURCE		ctlbsstepstoplbs.cpp
+SOURCE		ctlbsstepsetautonomousmode.cpp
+SOURCE		ctlbsstepresetdefaultadmin.cpp
+SOURCE		ctlbsdoposupdate.cpp	
+SOURCE		ctlbsstepcreateverifymodinfo.cpp
+SOURCE		ctlbsstepsetprivhandler.cpp
+SOURCE		ctlbsstepsetupprotocolstub.cpp
+SOURCE		ctlbsstepsetuproamselflocate.cpp
+SOURCE		ctlbsstepclearlog.cpp
+SOURCE		ctlbsstepconfighybridmodule.cpp
+SOURCE		ctlbsactiveyield.cpp
+SOURCE		ctlbsstepsetupstandaloneprivacymode.cpp
+SOURCE		ctlbsstepsetupstandaloneprivacyandsimplectlr.cpp
+SOURCE		ctlbsstepsetupstandaloneprivacywithnoctlr.cpp
+SOURCE		ctlbsportedstepbase.cpp
+SOURCE		ctlbsrequester.cpp
+SOURCE		ctlbsposclient.cpp
+SOURCE		ctlbsposclientholder.cpp
+SOURCE		ctlbsclientrequestor.cpp
+SOURCE		ctlbsclientlog.cpp
+SOURCE		ctlbsstepsetbehaviourmodeoriginal.cpp
+SOURCE		ctlbsstepsetptamode.cpp
+SOURCE		ctlbsstepsetatamode.cpp
+SOURCE		ctlbsstepsetptbmode.cpp
+
+// EPOC + Test Execute libraries.
+LIBRARY	euser.lib
+LIBRARY	testexecuteutils.lib 
+LIBRARY	testexecutelogclient.lib 
+
+// For logging
+LIBRARY			logcli.lib
+LIBRARY			logwrap.lib
+LIBRARY			lbsloggerapi.lib
+LIBRARY 		efsrv.lib
+LIBRARY			centralrepository.lib
+LIBRARY 		bafl.lib // BaflUtils
+
+// Lbs Libraries
+LIBRARY eposmodset.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/LbsAssistanceDataLogEvent.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,64 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+ @publishedPartner
+ @released
+*/
+
+#ifndef LBS_ASSISTANCE_DATA_LOG_EVENT_H
+#define LBS_ASSISTANCE_DATA_LOG_EVENT_H
+
+#include <lbs/lbslogevent.h>
+
+/** log event object for assistance data request */
+
+class CLbsAssistanceDataLogEvent : public CLbsLogEvent
+	{
+public:
+	IMPORT_C static CLbsAssistanceDataLogEvent* NewL(const TUint32 aRequestType, const TUint32 aReceiveType);
+	~CLbsAssistanceDataLogEvent();
+	// for assistance data
+	IMPORT_C void SetRequestAssistanceDataType(const TUint32 aMask);
+	IMPORT_C TUint32 RequestAssistanceDataType() const;
+	IMPORT_C void SetReceiveAssistanceDataType(const TUint32 aMask);
+	IMPORT_C TUint32 ReceiveAssistanceDataType() const;
+
+protected:
+	void DoExternalizeL(RWriteStream& aWriteStream) const;
+	void DoInternalizeL(RReadStream& aReadStream);
+	void DoUpdateL(const CLbsLogEvent& aSourceLogEvent);
+	void DoCopyL(CLbsLogEvent*& aTargetLogEvent) const;
+	TInt DataSize() const;
+private:
+	CLbsAssistanceDataLogEvent();
+	void ConstructL(const TUint32 aRequestType, const TUint32 aReceiveType);
+private:
+	/** requested assistance data type from application */
+	TUint32	iRequestAssistanceDataType;
+	/** received assistance data type from network */
+	TUint32	iReceiveAssistanceDataType;
+
+	}; // class CLbsAssistanceDataLogEvent
+
+
+#endif // LBS_ASSISTANCE_LOG_EVENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/LbsExternalLocateLogEvent.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,103 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+ @publishedPartner
+ @released
+*/
+
+#ifndef LBS_EXTERNAL_LOCATE_LOG_EVENT_H
+#define LBS_EXTERNAL_LOCATE_LOG_EVENT_H
+
+#include <lbs/lbslogevent.h>
+#include <lbs/lbsnetprotocolbase.h>
+
+#include <lbs/lbsloccommon.h> 			// For TLbsExternalRequestInfo
+#include "lbsnetcommon.h"			// For TLbsNetSessionId
+
+/**
+the privacy request parameter structure
+*/
+class TLbsLoggingPrivacyRequestParams
+    {
+public:    
+	TLbsNetSessionId			iSessionId;  
+	TLbsExternalRequestInfo		iRequestInfo;
+	TLbsNetPosRequestPrivacy	iRequestPrivacy;
+    };
+
+/**
+the privacy response parameter structure
+*/
+class TLbsLoggingPrivacyResponseParams
+	{
+public:	
+	TLbsNetSessionId iSessionId;
+	/** verification result to the privacy request */
+	CLbsNetworkProtocolBase::TLbsPrivacyResponse iResult;
+	} ;
+
+/** log event object for external locate request */
+class CLbsExternalLocateLogEvent : public CLbsLogEvent
+	{
+public:
+	IMPORT_C static CLbsExternalLocateLogEvent* NewL(TUid aRequestOriginator,TPositionInfoBase* aRefPosInfo, TPositionInfoBase* aPosInfo);
+	IMPORT_C void SetPrivacyRequestParams(const TLbsLoggingPrivacyRequestParams& aParams);
+	IMPORT_C void SetPrivacyResponseParams(const TLbsLoggingPrivacyResponseParams& aParams);
+	IMPORT_C void SetReferenceLocation(TPositionInfoBase* aPosInfo);
+	~CLbsExternalLocateLogEvent();
+
+	// for external locate
+	IMPORT_C TPositionInfoBase* ReferenceLocation() const;
+	IMPORT_C void SetRequestOriginator(TUid aRequestor);
+	IMPORT_C TUid RequestOriginator() const;
+	IMPORT_C TLbsLoggingPrivacyRequestParams PrivacyRequestParams() const;
+	IMPORT_C TLbsLoggingPrivacyResponseParams PrivacyResponseParams() const;
+
+protected:
+	void DoExternalizeL(RWriteStream& aWriteStream) const;
+	void DoInternalizeL(RReadStream& aReadStream);
+	void DoUpdateL(const CLbsLogEvent& aSourceLogEvent);
+	void DoCopyL(CLbsLogEvent*& aTargetLogEvent) const;
+	TInt DataSize() const;
+private:
+	CLbsExternalLocateLogEvent();
+	void ConstructL(TUid aRequestOriginator, TPositionInfoBase* aRefPosInfo, TPositionInfoBase* aPosInfo);
+	void CopyPrivacyRequestParams(TLbsLoggingPrivacyRequestParams& aTargetPrivacyInfo, 
+						   const TLbsLoggingPrivacyRequestParams& aSourcePrivacyInfo);
+	void CopyPrivacyResponseParams(TLbsLoggingPrivacyResponseParams& aTargetPrivacyInfo, 
+						   const TLbsLoggingPrivacyResponseParams& aSourcePrivacyInfo);
+private:
+	/** Descriptor of the request originator */
+	TUid							iRequestOriginator;
+	/** Privacy request/response info */
+	TLbsLoggingPrivacyRequestParams	iPrivacyReqInfo;
+	/** Indicate whether the MT-LR access is granted or not */
+	TLbsLoggingPrivacyResponseParams			iPrivacyResInfo;
+	/** The calculation method indicates MS-Based or Autonomous GPS is withint TPositionInfoBase */
+	/** The positioning mode used to calculate this location fix. */
+	// TPositionModuleInfo::TTechnologyType iPositionMode;
+	/** The returned reference location information if the request is completed successfully */
+	TPositionInfo* 					iRefPosInfo;
+	}; // class CLbsExternalLocateLogEvent
+
+#endif // LBS_EXTERNAL_LOCATE_LOG_EVENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/LbsLogEvent.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,127 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+ @publishedPartner
+ @released
+*/
+
+#ifndef LBS_LOG_EVENT_H
+#define LBS_LOG_EVENT_H
+
+#include <e32base.h>
+#include <e32err.h>
+#include <logwrap.h>
+#include <logcli.h>
+#include <lbs/lbsloggerdefs.h>
+
+#include <lbspositioninfo.h>
+#include <lbssatellite.h>
+/**
+ class for the privacy request information 
+*/
+class TPrivacyRequestParams;
+
+/**
+ class for the privacy response information 
+*/
+class TPrivacyResponseParams;
+
+enum TLbsRequestOutcome
+/**
+ enum for the request outcomes
+*/
+	{
+	ELbsRequestOutcomeInconclusive =0,
+	ELbsRequestOutcomeSuccess,
+	ELbsRequestOutcomeFail,
+	ELbsRequestOutcomeCancel,
+	};
+    
+class CLbsLogEvent : public CBase
+/**
+ Base class for the classes representing LBS events to be logged. It provides the common 
+ functionality (internalising, externalising, updating this class from another one and creating 
+ a copy of this class).
+ 
+ @prototype
+*/
+	{
+public:
+	IMPORT_C static CLbsLogEvent* NewL(const CLogEvent& aLogEvent);
+	IMPORT_C CLogEvent* ExternalizeL() const;
+	IMPORT_C void SetPositionInfo(TPositionInfoBase* aPosInfo);
+
+	virtual ~CLbsLogEvent();
+	void UpdateL(const CLbsLogEvent& aLogEvent);
+	void UpdateRootEvent(CLogEvent* aTargetEvent);
+	CLbsLogEvent* CopyL() const;
+	
+	// Inline functions
+	IMPORT_C void SetDirection(TBool aDirection);
+	IMPORT_C TBool Direction() const;
+	IMPORT_C TUid EventType() const;
+	IMPORT_C void SetEventType(TUid aId);
+	IMPORT_C void SetRequestOutcome(TLbsRequestOutcome aRequestOutcome);
+	IMPORT_C TLbsRequestOutcome RequestOutcome() const;
+	IMPORT_C TBool IsCostInformationAvailable() const;
+	IMPORT_C void SetCostInformation(TUint aCostInformation);
+	IMPORT_C TUint CostInformation() const;
+	IMPORT_C TPositionInfoBase* PositionInfo() const;
+	
+protected:
+	CLbsLogEvent();
+	void InternalizeL(const CLogEvent& aLogEvent);
+	TPositionInfo* CopyPosInfoToEvent(const TPositionInfoBase* aSrcosInfo);
+	void WritePosInfo(RWriteStream& aWriteStream, const TPositionInfo* aPosInfo) const;
+	void ReadPosInfo(RReadStream& aReadStream, TPositionInfo*& aPosInfo);
+	// for BC consideration, possible handling TAny* data member
+	// called by derived 3rd party classes
+	void BaseConstructL();
+	virtual void DoExternalizeL(RWriteStream& aReadStream) const = 0;
+	virtual void DoInternalizeL(RReadStream& aReadStream) = 0;
+	virtual void DoUpdateL(const CLbsLogEvent& aSourceLogEvent) = 0;
+	virtual void DoCopyL(CLbsLogEvent*& aTargetLogEvent) const = 0;
+	virtual TInt DataSize() const = 0;
+protected:
+	/** The size of the data from a TPositionInfo that is written to disk */
+	const TInt			iPosInfoWriteSize;
+	/** The Location Request Event Type */
+	TUid 				iEventType;
+	/** The returned location information if the request is completed successfully */
+	TPositionInfo*		iPosInfo;
+	/** Data for BC consideration, and inherited by derived CLbsLog classes */
+	TAny*				iReservedData;
+	
+private:
+	/**	MO-LR (True) to R_LOG_DIR_OUT and MT-LR to R_LOG_DIR_IN */
+	TBool				iDirection;
+	/** The outcome of the request */
+	TLbsRequestOutcome 	iRequestOutcome;
+	/** Flag which specifies if the cost information is available or not */
+	TBool 				iCostInformationAvailable;
+	/** The cost information */
+	TUint 				iCostInformation;
+	}; // class CLbsLogEvent
+	
+
+#endif // LBS_LOG_EVENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/LbsLogWriterEngine.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,122 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+ @internalTechnology
+ @released
+*/
+
+#ifndef LBS_LOG_WRITER_ENGINE_H
+#define LBS_LOG_WRITER_ENGINE_H
+
+#include <e32base.h>
+#include <lbslogevent.h>
+
+enum TLbsLogEventType
+/**
+ enum for type of LbsLogging event handled by Lbs Logging Engine	
+*/
+	{
+	ELbsLogNoEvent = 0,
+	ELbsLogAddEvent,
+	ELbsLogUpdateEvent
+	};
+	
+	
+typedef TUint32 TLbsLogWriterEventTypeGroup;
+
+enum TLbsLogWriterEventTypes
+	{
+	ELbsNoEventType = 				0x00000000,
+	ELbsSelfLocateEventType = 		0x00000001,
+	ELbsExternalLocateEventType = 	0x00000002,
+	ELbsTransmitLocationEventType = 0x00000004,
+	ELbsNetworkLocateEventType = 	0x00000008,
+	ELbsAssistanceDataEventType = 	0x00000010
+	};
+	
+class CLbsLogWriterEngine : public CActive
+/**
+ Active class which does the logging of LBS events. When it receives a new event, 
+ if it isn't processing anything it starts logging that event, otherwise it elaves it 
+ on a waiting queue.
+ 
+*/
+	{
+public:
+	static CLbsLogWriterEngine* NewL(TUint aMaxBufferSize);
+	~CLbsLogWriterEngine();
+	
+	TInt AddEventL(CLbsLogEvent& aLogEvent);
+	TInt UpdateEventL(CLbsLogEvent& aLogEvent);
+	// Start to log the event request asyn
+	TInt StartAddingEventType(CLogEventType& aType);
+	
+private:
+	CLbsLogWriterEngine(TUint aMaxBufferSize);
+	void ConstructL();
+
+	// Start to log the event request asyn
+	void StartLoggingEventL(CLbsLogEvent& aLogEvent);
+	void InitialiseLogEventTypeL(CLbsLogEvent& aLogEvent);
+	void AddLogEventToQueueL(CLbsLogEvent& aLogEvent);
+	
+private: // from CActive
+	void RunL();
+	void DoCancel();
+	TInt RunError(TInt aError);
+
+private:
+	/** The maximum numer of events that can be queued */
+	TUint 							iMaxBufferSize;
+	/** Flag indicating if there is an ID available of the last logged event */
+	TBool 							iLastLogIdAvailable;
+	/** The ID of the last logged event */
+	TLogId 							iLastLogId;
+	/** The array with the queued events */
+	RPointerArray<CLbsLogEvent> 	iLogEvents;
+	/** The array with the queued event types */
+	RArray<TLbsLogEventType>		iLogEventTypes;
+	/** Current processing event type */
+	TLbsLogEventType				iLastLogEventType;
+	/** Bitmask listing which event types have already been added */
+	TLbsLogWriterEventTypeGroup		iInitLogEventTypes;
+	/** The event type currently being logged */
+	CLogEventType* 					iEventTypeBeingLogged; 
+	/** Flag indicating if an event type is currently being added */
+	TBool 							iLogEventTypeInit;
+	/** The event that is being logged now */
+	CLogEvent* 						iEventBeingLogged;
+
+	/***/
+	TBool							iLoggingType;
+	/** Handle to the db file file sesstion */
+	RFs 							iFs;
+	/** CLogClient handler */
+	CLogClient* 					iClient;	
+	
+
+	
+__DECLARE_TEST; // Declaration for the invariant
+	}; // class CLbsLogWriterEngine
+
+#endif // LBS_LOG_WRITER_ENGINE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/LbsLogger.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,75 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+*/
+
+#ifndef LBS_LOGGER_H
+#define LBS_LOGGER_H
+
+#include <lbslogevent.h>
+#include <e32base.h>
+
+class CLbsLogWriterEngine;
+
+class RLbsLogger
+/**
+ Class the provides the APIs for adding and updating LBS events into the LogEng.
+ In order to add (or update) any event, a handle must have been opened for this class 
+ (so OpenL() must have been called, without calling Close() meanwhile on the class).
+ 
+ Internally, the engine, queues the add and update requests until they can be processed. The 
+ queue has a maximum size, so if too many items will get on the queue the AddEventL() method 
+ can return an error.
+
+ When the client finishes sending all the add and update requests, Close() should be 
+ called on the class. This will ensure that the internal engine logs all the events it 
+ queued into the LogEng. When calling Close() it will wait for LogEng to finish 
+ logging all the events.
+ 
+ @internalTechnology
+ @released
+*/
+	{
+public:
+	IMPORT_C RLbsLogger();
+	IMPORT_C ~RLbsLogger();
+	
+	IMPORT_C TInt Open(TUint aMaxBufferSize);
+	IMPORT_C TInt AddEvent(CLbsLogEvent& aLogEvent);
+	IMPORT_C TInt UpdateEvent(CLbsLogEvent& aLogEvent);
+	IMPORT_C TInt Close();
+	// for BC consideration
+	virtual void ExtensionInterfaceL(TUid aInterface, void*& aObject);
+
+private:
+	void CheckLoggingAdminSettings();
+
+private:
+	/** Pointer to the active object which does the logging */
+	CLbsLogWriterEngine* iLogWriterEngine;
+	
+	/** Flag to indicate if logging is currently On or Off, determined from the admin db setting. */
+	TBool iLoggingOn;
+	}; // class RLbsLogger
+
+#endif // LBS_LOGGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/LbsLoggerDefs.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,40 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+ @publishedPartner
+ @released
+*/
+
+#ifndef LBS_LOGGER_DEFS_H
+#define LBS_LOGGER_DEFS_H
+
+_LIT(KLbsLoggerPanic, "LBS Logger:");
+_LIT(KLbsLogSelfLocateDes, "Location Requested from On Board Application");
+_LIT(KLbsLogExternalLocateDes, "Location Requested by Remote Party");
+_LIT(KLbsLogX3PLocateDes, "Location Sent to Remote Party");
+_LIT(KLbsLogNetworkLocateDes, "Location Determined by Network");
+_LIT(KLbsLogAssistanceDataDes, "Location Data Obtained from Network");
+_LIT(KLbsLogMOLR, "R_LOG_DIR_OUT_MOLR");
+_LIT(KLbsLogMTLR, "R_LOG_DIR_IN_MTLR");
+
+#endif // LBS_LOGGER_DEFS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/LbsNetworkLocateLogEvent.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,61 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+ @publishedPartner
+ @released
+*/
+
+#ifndef LBS_NETWORK_LOCATE_LOG_EVENT_H
+#define LBS_NETWORK_LOCATE_LOG_EVENT_H
+
+#include <lbs/lbslogevent.h>
+
+/** log event object for network locate request */
+
+class CLbsNetworkLocateLogEvent : public CLbsLogEvent
+	{
+public:
+	IMPORT_C static CLbsNetworkLocateLogEvent* NewL(TUid aUid, TPositionInfoBase* aPosInfo);
+	~CLbsNetworkLocateLogEvent();
+	// for self locate
+	IMPORT_C TUid LocalApp() const;
+	IMPORT_C void SetLocalApp(TUid aUid);
+
+protected:
+	void DoExternalizeL(RWriteStream& aWriteStream) const;
+	void DoInternalizeL(RReadStream& aReadStream);
+	void DoUpdateL(const CLbsLogEvent& aSourceLogEvent);
+	void DoCopyL(CLbsLogEvent*& aTargetLogEvent) const;
+	TInt DataSize() const;
+private:
+	CLbsNetworkLocateLogEvent();
+	void ConstructL(TUid aUid, TPositionInfoBase* aPosInfo);
+		
+private:
+	/** The UID of local application request for the location information */
+	TUid 				iLocalApp;
+
+	}; // class CLbsNetworkLocateLogEvent
+
+
+#endif // LBS_NETWORK_LOCATE_LOG_EVENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/LbsSelfLocateLogEvent.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,60 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+ @publishedPartner
+ @released
+*/
+
+#ifndef LBS_SELF_LOCATE_LOG_EVENT_H
+#define LBS_SELF_LOCATE_LOG_EVENT_H
+
+#include <lbs/lbslogevent.h>
+
+/** log event object for self locate request */
+
+class CLbsSelfLocateLogEvent : public CLbsLogEvent
+	{
+public:
+	IMPORT_C static CLbsSelfLocateLogEvent* NewL(TUid aUid, TPositionInfoBase* aPosInfo);
+	~CLbsSelfLocateLogEvent();
+	// for self locate
+	IMPORT_C TUid LocalApp() const;
+	IMPORT_C void SetLocalApp(TUid aUid);
+
+protected:
+	void DoExternalizeL(RWriteStream& aWriteStream) const;
+	void DoInternalizeL(RReadStream& aReadStream);
+	void DoUpdateL(const CLbsLogEvent& aSourceLogEvent);
+	void DoCopyL(CLbsLogEvent*& aTargetLogEvent) const;
+	TInt DataSize() const;
+	
+private:
+	CLbsSelfLocateLogEvent();
+	void ConstructL(TUid aUid, TPositionInfoBase* aPosInfo);
+
+private:
+	/** The UID of local application request for the location information */
+	TUid 				iLocalApp;
+	}; // class CLbsSelfLocateLogEvent
+
+#endif // LBS_SELF_LOCATE_LOG_EVENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/LbsTransmitLocationLogEvent.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,63 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file
+ @publishedPartner
+ @released
+*/
+
+#ifndef LBS_TRANSMIT_LOCATION_LOG_EVENT_H
+#define LBS_TRANSMIT_LOCATION_LOG_EVENT_H
+
+#include <lbs/lbslogevent.h>
+
+/** log event object for transmit to 3rd party locate request */
+
+class CLbsTransmitLocationLogEvent : public CLbsLogEvent
+	{
+public:
+	IMPORT_C static CLbsTransmitLocationLogEvent* NewL(TUid aUid, TPositionInfoBase* aPosInfo, TDesC& aDestination);
+	~CLbsTransmitLocationLogEvent();
+	// for X3P
+	IMPORT_C TUid X3PApp() const;
+	IMPORT_C void SetX3PApp(TUid aUid);
+	IMPORT_C void SetDestination(TDesC& aDestination);
+	IMPORT_C TDesC& Destination() const;
+
+protected:
+	void DoExternalizeL(RWriteStream& aWriteStream) const;
+	void DoInternalizeL(RReadStream& aReadStream);
+	void DoUpdateL(const CLbsLogEvent& aSourceLogEvent);
+	void DoCopyL(CLbsLogEvent*& aTargetLogEvent) const;
+	TInt DataSize() const;
+private:
+	CLbsTransmitLocationLogEvent();
+	void ConstructL(TUid aUid, TPositionInfoBase* aPosInfo, TDesC& aDestination);
+	
+private:
+	/** The UID of 3rd party application request for the location information */
+	TUid 					iX3PApp;
+	/** Descriptor of the destination application */
+	TBuf<64>				iDestination;
+	}; // class CLbsTransmitLocationLogEvent
+
+#endif // LBS_TRANSMIT_LOCATION_LOG_EVENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/argutils.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,548 @@
+/**
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file argutils.h
+*/
+
+#ifndef __ARG_UTILS_H__
+#define __ARG_UTILS_H__
+
+// LBS includes.
+#include <lbs.h>
+#include <lbscommon.h>
+#include <lbsprivacycontroller.h>
+#include <lbsnetcommon.h>
+//-------------------------------------------------------------------------------------------------
+
+/**
+Static utility functions to populate and instantiate arguments for function calls
+
+@internalComponent
+@test
+*/
+
+const TInt KAlpha2Timeout = 12*1000*1000;
+const TInt KTTimeout = 8*1000*1000;
+const TInt KMOLRFixTime = 240*1000*1000;
+const TInt KMinHorizontalAcc = 50.0;
+const TInt KMinVerticalAcc = 1000.0;
+const TInt KDefaultMaxFixTime = 130*1000*1000;
+
+
+class ArgUtils
+	{
+public:
+	inline static void PopulateLC(RLbsAssistanceDataBuilderSet& aData)
+		{
+		aData.OpenL();
+		CleanupClosePushL(aData);
+		
+		// Access the Gps Reference Time which is the only data we support in this simple provider.
+		RUEPositioningGpsReferenceTimeBuilder* refTimeBuilder = NULL;
+
+		aData.GetDataBuilder(refTimeBuilder);
+		if (refTimeBuilder)
+			{
+			const TUint KAssistanceData_RefTime_Week = 12;
+			const TUint KAssistanceData_RefTime_Tow1MSec = 567;
+			// Fill out the reference time items we support - note the builder set is already open.
+			refTimeBuilder->SetField(TUEPositioningGpsReferenceTime::EGpsWeek, KAssistanceData_RefTime_Week);
+			refTimeBuilder->SetField(TUEPositioningGpsReferenceTime::EGpsTow1Msec, KAssistanceData_RefTime_Tow1MSec);
+
+			// Time stamp the data.
+			TTime timeStamp;
+			timeStamp.UniversalTime();
+
+			refTimeBuilder->SetTimeStamp(timeStamp);
+			}
+		}
+
+	inline static TLbsNetPosRequestPrivacy Privacy()
+		{
+		TLbsNetPosRequestPrivacy privacy;
+		privacy.SetRequestAdvice(TLbsNetPosRequestPrivacy::ERequestAdviceNotify);
+		privacy.SetRequestAction(TLbsNetPosRequestPrivacy::ERequestActionAllow);
+		return privacy;
+		}
+
+	inline static TLbsExternalRequestInfo RequestInfo()
+		{
+		TLbsExternalRequestInfo requestInfo;
+		requestInfo.SetRequesterId(_L8("+441234567891"));
+		requestInfo.SetClientName(_L8("THybridNWClient"));
+		requestInfo.SetClientExternalId(_L8("+441234567891"));	
+		return requestInfo;
+		}
+
+	inline static TPositionInfo PositionInfo()
+		{
+		TCoordinate coordinate(3.14159265359, 2.71828183);
+		TLocality locality(coordinate, 99.99, 99.99);
+		TTime time(101010101);
+		TPosition position(locality, time);
+		TPositionInfo positionInfo;
+		positionInfo.SetPosition(position);
+		return positionInfo;
+		}
+
+	inline static TPositionInfo ReferencePositionInfo()
+		{
+		// General case: This will be less accurate than the GPS Position and the Hybrid Position.
+		TCoordinate coordinate(51.5,-0.096, 2.0);
+		TLocality locality(coordinate, 1000.0, 1000.0);
+
+		// Setting time to current time
+		TTime time;
+		time.UniversalTime();
+		TPosition position(locality, time);
+
+		TPositionInfo positionInfo;
+		positionInfo.SetPosition(position);
+		positionInfo.SetUpdateType(EPositionUpdateGeneral);
+		positionInfo.SetPositionMode(TPositionModuleInfo::ETechnologyNetwork);
+		positionInfo.SetPositionModeReason(EPositionModeReasonNone);
+		return positionInfo;
+		}
+
+
+	inline static TPositionInfo MolrReferencePositionInfo()
+		{
+		// General case: This will be less accurate than the Reference Position and the Hybrid Position.
+		TCoordinate coordinate(3.14159265359, 2.71828183, 10.0);
+		TLocality locality(coordinate, 1000.0, 1000.0);
+
+		// Setting time to current time
+		TTime time;
+		time.UniversalTime();
+		TPosition position(locality, time);
+
+		TPositionInfo positionInfo;
+		positionInfo.SetPosition(position);
+		positionInfo.SetUpdateType(EPositionUpdateGeneral);
+		positionInfo.SetPositionMode(TPositionModuleInfo::ETechnologyNetwork);
+		positionInfo.SetPositionModeReason(EPositionModeReasonNone);
+		return positionInfo;
+		}
+
+
+	inline static TPositionInfo HybridPositionInfo()
+		{
+		// General case: This will be more accurate than ReferencePosition
+		// but less accurate than the GPS position
+		TCoordinate coordinate(51.502,-0.1055, 1.0);
+		TLocality locality(coordinate, 200.0, 200.0);
+
+		// Setting time to current time
+		TTime time;
+		time.UniversalTime();
+		TPosition position(locality, time);
+
+		TPositionInfo positionInfo;
+		positionInfo.SetPosition(position);
+		positionInfo.SetUpdateType(EPositionUpdateGeneral);
+		positionInfo.SetPositionMode(TPositionModuleInfo::ETechnologyNetwork | TPositionModuleInfo::ETechnologyAssisted);
+		positionInfo.SetPositionModeReason(EPositionModeReasonNone);
+		return positionInfo;
+		}
+
+
+	inline static TPositionInfo MolrHybridPositionInfo()
+		{
+		// General case: This will be more accurate than ReferencePosition
+		// but less accurate than the GPS position
+		TCoordinate coordinate(3.14159265359, 2.71828183);
+		TLocality locality(coordinate, 200.0, 200.0);
+
+		// Setting time to current time
+		TTime time;
+		time.UniversalTime();
+		TPosition position(locality, time);
+
+		TPositionInfo positionInfo;
+		positionInfo.SetPosition(position);
+		positionInfo.SetUpdateType(EPositionUpdateGeneral);
+		positionInfo.SetPositionMode(TPositionModuleInfo::ETechnologyNetwork | TPositionModuleInfo::ETechnologyAssisted);
+		positionInfo.SetPositionModeReason(EPositionModeReasonNone);
+		return positionInfo;
+		}
+
+
+	inline static TPositionInfo NetworkPositionInfo()
+		{
+		// General case: This will be more accurate than ReferencePosition
+		// but less accurate than the GPS position
+		TCoordinate coordinate(51.502,-0.1055, 1.0);
+		TLocality locality(coordinate, 100.0, 100.0);
+
+		// Setting time to current time
+		TTime time;
+		time.UniversalTime();
+		TPosition position(locality, time);
+
+		TPositionInfo positionInfo;
+		positionInfo.SetPosition(position);
+		positionInfo.SetUpdateType(EPositionUpdateGeneral);
+		positionInfo.SetPositionMode(TPositionModuleInfo::ETechnologyNetwork | TPositionModuleInfo::ETechnologyAssisted);
+		positionInfo.SetPositionModeReason(EPositionModeReasonNone);
+		return positionInfo;
+		}
+		
+	inline static TPositionInfo AccurateNetworkPositionInfo()
+		{
+		// General case: This will be more accurate than ReferencePosition
+		// but less accurate than the GPS position
+		TCoordinate coordinate(51.502,-0.1055, 1.0);
+		TLocality locality(coordinate, 10.0, 10.0);
+
+		// Setting time to current time
+		TTime time;
+		time.UniversalTime();
+		TPosition position(locality, time);
+
+		TPositionInfo positionInfo;
+		positionInfo.SetPosition(position);
+		positionInfo.SetUpdateType(EPositionUpdateGeneral);
+		positionInfo.SetPositionMode(TPositionModuleInfo::ETechnologyNetwork | TPositionModuleInfo::ETechnologyAssisted);
+		positionInfo.SetPositionModeReason(EPositionModeReasonNone);
+		return positionInfo;
+		}
+		
+	inline static TPositionInfo MolrNetworkPositionInfo()
+		{
+		// General case: This will be more accurate than ReferencePosition
+		// but less accurate than the GPS position
+		TCoordinate coordinate(3.14159265359, 2.71828183);
+		TLocality locality(coordinate, 100.0, 100.0);
+
+		// Setting time to current time
+		TTime time;
+		time.UniversalTime();
+		TPosition position(locality, time);
+
+		TPositionInfo positionInfo;
+		positionInfo.SetPosition(position);
+		positionInfo.SetUpdateType(EPositionUpdateGeneral);
+		positionInfo.SetPositionMode(TPositionModuleInfo::ETechnologyNetwork | TPositionModuleInfo::ETechnologyAssisted);
+		positionInfo.SetPositionModeReason(EPositionModeReasonNone);
+		return positionInfo;
+		}
+
+
+	inline static TLbsNetPosRequestQuality Quality()
+		{
+		TLbsNetPosRequestQuality quality;
+		quality.SetMaxFixTime(KTTimeout);
+		quality.SetMaxFixAge(0);
+		TRealX nan;
+		nan.SetNaN();
+		quality.SetMinHorizontalAccuracy(nan);
+		quality.SetMinVerticalAccuracy(nan);
+		return quality;
+		}
+
+	inline static TLbsNetPosRequestQuality QualityAlpha2()
+		{
+		TLbsNetPosRequestQuality quality;
+		quality.SetMaxFixTime(KAlpha2Timeout); 
+		quality.SetMaxFixAge(0);
+		TRealX nan;
+		nan.SetNaN();
+		quality.SetMinHorizontalAccuracy(nan);
+		quality.SetMinVerticalAccuracy(nan);
+		return quality;
+		}
+
+	inline static TLbsNetPosRequestMethod RequestMethod()
+		{
+		TLbsNetPosRequestMethod method;
+		TLbsNetPosMethod method1;
+		TLbsNetPosMethod method2;
+		method1.SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted); 
+		const TLbsNetPosMethod posMethods [] =
+			{
+			method1,method2
+			};
+		method.SetPosMethods(posMethods, 2);
+		return method;
+		}
+
+	inline static TLbsNetPosRequestMethod RequestTerminalBasedMethod()
+		{
+		TLbsNetPosRequestMethod method;
+		TLbsNetPosMethod method1;
+		method1.SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted);
+
+ 		const TLbsNetPosMethod posMethods [] =
+			{
+			method1
+			};
+		method.SetPosMethods(posMethods, 1);
+		return method;
+		}
+	
+	inline static TLbsNetPosRequestMethod RequestAutonomousMethod()
+		{
+		TLbsNetPosRequestMethod method;
+		TLbsNetPosMethod method1;
+		method1.SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyTerminal);
+
+ 		const TLbsNetPosMethod posMethods [] =
+			{
+			method1
+			};
+		method.SetPosMethods(posMethods, 1);
+		return method;
+		}
+			
+	inline static TLbsNetPosRequestMethod RequestHybridMethod()
+		{
+		TLbsNetPosRequestMethod method;
+		TLbsNetPosMethod method1;
+		TLbsNetPosMethod method2;
+		method1.SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted);
+		method2.SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyNetwork | TPositionModuleInfo::ETechnologyAssisted);
+
+ 		const TLbsNetPosMethod posMethods [] =
+			{
+			method1,method2
+			};
+		method.SetPosMethods(posMethods, 2);
+		return method;
+		}
+	
+			
+	inline static TLbsNetPosRequestMethod RequestTAPMethod()
+		{
+		TLbsNetPosRequestMethod method;
+		TLbsNetPosMethod method1;
+		method1.SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyNetwork | TPositionModuleInfo::ETechnologyAssisted);
+
+ 		const TLbsNetPosMethod posMethods [] =
+			{
+			method1
+			};
+		method.SetPosMethods(posMethods, 1);
+		return method;
+		}
+
+	inline static TLbsNetPosRequestMethod RequestTerminalAssistedAndTerminalBasedMethod()
+		{
+		TLbsNetPosRequestMethod method;
+		TLbsNetPosMethod method1;
+		TLbsNetPosMethod method2;
+		method1.SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyNetwork | TPositionModuleInfo::ETechnologyAssisted);
+		method2.SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted);
+
+ 		const TLbsNetPosMethod posMethods [] =
+			{
+			method1,method2
+			};
+		method.SetPosMethods(posMethods, 2);
+		return method;
+		}
+	
+	inline static TLbsNetPosRequestMethod RequestUnspecifiedMethod()
+		{
+		TLbsNetPosRequestMethod method;
+		TLbsNetPosMethod method1;
+		method1.SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyUnknown);
+
+ 		const TLbsNetPosMethod posMethods [] =
+			{
+			method1
+			};
+		method.SetPosMethods(posMethods, 1);
+		return method;
+		}	
+
+	inline static TInt Alpha2()
+		{
+		return KAlpha2Timeout;
+		}
+
+	inline static TBool CompareQuality(TLbsNetPosRequestOptionsAssistance* aOpts, 
+										TBool aIsclientConnected, 
+										TInt aHorizontalAccuracy, 
+										TInt aVerticalAccuracy, 
+										TInt aMaxFixTime, 
+										TInt aMaxFixAge, 
+										TLbsAssistanceDataItem aDataMask, 
+										TPositionModuleInfo::TTechnologyType aTechnologyType
+										)
+		{
+		TLbsNetPosRequestQuality quality;
+		aOpts->GetRequestQuality(quality);
+		
+		if(aIsclientConnected != aOpts->NewClientConnected())
+			{
+			return EFalse;
+			}
+		
+		if(quality.MinHorizontalAccuracy() != aHorizontalAccuracy)	 
+			{
+			return EFalse;
+			}
+			
+		if(quality.MinVerticalAccuracy()   != aVerticalAccuracy)
+			{
+			return EFalse;
+			}
+			
+		if(quality.MaxFixTime() != aMaxFixTime)
+			{
+			return EFalse;
+			}
+			
+		if(quality.MaxFixAge()  != aMaxFixAge)		
+			{
+			return EFalse;
+			}
+			
+		if(aOpts->DataRequestMask()  != aDataMask) 
+			{
+			return EFalse;
+			}
+		
+		if(aOpts->PosMode() != aTechnologyType)
+			{
+			return EFalse;
+			}
+			
+		return ETrue;
+		}
+		
+		
+	inline static TBool ComparePositionInfoToReference(const TPositionInfo aPosInfoA)
+		{
+		TPositionInfo refPosInfo = ReferencePositionInfo();
+	
+		TPosition posA;
+		TPosition posR;
+		aPosInfoA.GetPosition(posA);
+		refPosInfo.GetPosition(posR);
+		
+		if(posA.HorizontalAccuracy() != posR.HorizontalAccuracy())
+			{
+			return EFalse;	
+			}
+		
+		if(posA.VerticalAccuracy() != posR.VerticalAccuracy())
+			{
+			return EFalse;	
+			}
+
+		if(posA.Latitude() != posR.Latitude())
+			{
+			return EFalse;	
+			}
+
+		if(posA.Longitude() != posR.Longitude())
+			{
+			return EFalse;	
+			}
+
+		if(posA.Altitude() != posR.Altitude())
+			{
+			return EFalse;	
+			}
+
+		return ETrue;
+		}
+
+
+	
+	inline static TBool ComparePositionInfoToMolrRefPos(const TPositionInfo aPosInfoA)
+		{
+		TPositionInfo refPosInfo = MolrReferencePositionInfo();
+	
+		TPosition posA;
+		TPosition posR;
+		aPosInfoA.GetPosition(posA);
+		refPosInfo.GetPosition(posR);
+		
+		if(posA.HorizontalAccuracy() != posR.HorizontalAccuracy())
+			{
+			return EFalse;	
+			}
+		
+		if(posA.VerticalAccuracy() != posR.VerticalAccuracy())
+			{
+			return EFalse;	
+			}
+
+		if(posA.Latitude() != posR.Latitude())
+			{
+			return EFalse;	
+			}
+
+		if(posA.Longitude() != posR.Longitude())
+			{
+			return EFalse;	
+			}
+
+		if(posA.Altitude() != posR.Altitude())
+			{
+			return EFalse;	
+			}
+
+		return ETrue;
+		}
+		
+	inline static TBool ComparePositionInfoToNan(const TPositionInfo aPosInfoA)
+		{
+		TPosition pos;
+		aPosInfoA.GetPosition(pos);
+		
+		if(!Math::IsNaN(pos.HorizontalAccuracy()))
+			{
+			return EFalse;
+			}
+
+		if(!Math::IsNaN(pos.VerticalAccuracy()))
+			{
+			return EFalse;
+			}
+			
+		if(!Math::IsNaN(pos.Latitude()))
+			{
+			return EFalse;
+			}
+			
+		if(!Math::IsNaN(pos.Longitude()))
+			{
+			return EFalse;
+			}
+			
+		if(!Math::IsNaN(pos.Altitude()))	
+			{
+			return EFalse;
+			}
+			
+		return ETrue;
+			
+		}
+		
+	};
+
+//-------------------------------------------------------------------------------------------------
+
+#endif //__ARG_UTILS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsclientlog.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,97 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_LOG_H__
+#define __CT_LBS_CLIENT_LOG_H__
+
+//  INCLUDES
+#include <e32base.h>
+#include "TestExecuteStepBase.h"
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Implements the CLbsLog interface, and puts log entries in TEF log.
+*/
+class CT_LbsClientLog : public CBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CT_LbsClientLog* NewL(CTestExecuteLogger& aLogger);
+
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CT_LbsClientLog* NewLC(CTestExecuteLogger& aLogger);
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CT_LbsClientLog();
+
+    public: // New functions
+    
+    	void SetLogger(CTestExecuteLogger& aLogger){ iLogger = aLogger; };
+	    CTestExecuteLogger& Logger() {return iLogger;};
+
+    public: // Functions  from base classes
+
+        /**
+        * Add a line to the log file.
+        * @param aLine The line of text to append.
+        */
+        void Put(const TDesC& aLine);
+
+        /**
+        * Add an error line to the log file.
+        * @param aLine The error line of text to append.
+        */
+        void PutError(const TDesC& aLine);
+        
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+    	CT_LbsClientLog();
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        void ConstructL(CTestExecuteLogger& aLogger);
+
+        // By default, prohibit copy constructor
+        CT_LbsClientLog( const CT_LbsClientLog& );
+        // Prohibit assigment operator
+        CT_LbsClientLog& operator= ( const CT_LbsClientLog& );
+
+    private:  // Data
+        CTestExecuteLogger		iLogger;
+    };
+
+#endif // __CT_LBS_CLIENT_LOG_H__   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsclientrequestor.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,146 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_REQUESTOR_H__ 
+#define __CT_LBS_CLIENT_REQUESTOR_H__
+
+//  INCLUDES
+#include <e32base.h>
+#include <Lbs.h>
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+#include <testexecutelogger.h>
+
+
+// CONSTANTS
+const TInt KNoEvent = 42;
+
+// FORWARD DECLARATIONS
+class MCT_LbsRequestObserver;
+
+// CLASS DECLARATION
+
+/**
+*  ?one_line_short_description.
+*  ?other_description_lines
+*/
+class CT_LbsClientRequestor : public CActive
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        * @return A new instance of this class.
+        */
+        static CT_LbsClientRequestor* NewL(
+            /* IN  */   TUid                aPsyUid,
+			/* IN  */   MCT_LbsRequestObserver*   aObserver,
+			/* IN  */	const TDesC& aClientName,
+		    CTestExecuteLogger&						aLogger
+		    );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CT_LbsClientRequestor();
+
+    protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientRequestor(
+			/* IN  */   MCT_LbsRequestObserver*   aObserver,
+						TUid				aPsyUid
+			);
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        void ConstructL(const TDesC& aClientName, CTestExecuteLogger& aLogger);
+
+    public: // New functions
+        
+        const TTime& CompletionTimeUTC() const;
+       
+		TInt CompletionCode() const;
+
+		void ResetCompletionCode();
+
+        /**
+        * Performs a request to iPsy. Notifies iObserver when request is complete
+        */
+        void StartRequestL(TBool aDefaultPsy);
+
+		void RequestModuleStatusEvent();
+
+		TInt ReadModuleStatusEvent();
+
+		void ContinueRequesting();
+
+		void ClosePositioner();
+
+		TBool ReadModuleStatusModulesApi(CPosModules* aDb, TPositionModuleId aModuleId);
+		
+		TInt ReadModuleStatusClientApi(TPositionModuleId aModuleId);
+
+		void CancelModuleStatusEvent();
+
+    public: // Functions from base classes
+
+        void RunL();
+
+        void DoCancel();
+
+    protected: // New functions
+
+        void RequestComplete();
+
+    private:
+
+        // By default, prohibit copy constructor
+        CT_LbsClientRequestor( const CT_LbsClientRequestor& );
+        // Prohibit assigment operator
+        CT_LbsClientRequestor& operator= ( const CT_LbsClientRequestor& );
+        
+    	// Logger interface used for constructing result strings to be fed for the logger instance
+    	inline CTestExecuteLogger& Logger() {return iLogger;};
+
+    private:    // Data
+
+        RPositionServer     iPosServer;
+        RPositioner         iPositioner;
+		TBuf<100>			iName;
+
+		MCT_LbsRequestObserver*   iObserver;
+        TTime               iCompletionTimeUTC;
+        TInt                iCompletionCode;
+        TRequestStatus      iRequestStatus;
+        TPositionInfo       iModuleInfo;
+		TUid				iPsyUid;
+		TPositionModuleStatusEvent istatusEvent;
+		TBool iContinueEventRequesting;
+		
+        CTestExecuteLogger	iLogger;
+    };
+
+#endif      // __CT_LBS_CLIENT_REQUESTOR_H__  
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsdoposupdate.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,83 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file ctlbsdoposupd.h
+*/
+#ifndef  __CT_LBS_DOPOS_UPDATE_H__
+#define  __CT_LBS_DOPOS_UPDATE_H__
+
+#include <e32base.h>
+#include <lbs.h>
+
+
+_LIT(KCT_LbsDoPosUpdate, "CT_LbsDoPosUpdate");
+
+
+// Async callbacks
+class MT_LbsDoPosUpdateObserver
+	{
+public:
+	virtual void MT_LbsDoPosUpdateCallback(TRequestStatus& aStatus) = 0;	// do we need the aStatus...
+	};
+	
+	
+class CT_LbsDoPosUpdate: public CActive
+	{
+public:
+	~CT_LbsDoPosUpdate();
+	static CT_LbsDoPosUpdate* NewL(MT_LbsDoPosUpdateObserver* aObserver, TPositionModuleInfo::TTechnologyType aTechnologyType = TPositionModuleInfo::ETechnologyUnknown);
+    static CT_LbsDoPosUpdate* NewL(MT_LbsDoPosUpdateObserver* aObserver, const TPositionCriteriaBase& aCriteria);
+	TInt SetOptions(const TPositionUpdateOptionsBase& aPosOption);
+	void StartL(TPositionInfo& aPosInfo);
+	void CancelRequest();
+	void OpenPositioner(TPositionModuleInfo::TTechnologyType aTechnologyType = TPositionModuleInfo::ETechnologyUnknown);
+	void ClosePositioner(void);
+	void ConnectServer(void);
+	void CloseServer(void);
+	TInt CompleteRequest(TInt aRequestId);
+	
+protected:
+	//	Functions from CActive:
+	virtual void DoCancel();
+	virtual void RunL();
+	virtual TInt RunError(TInt aError);
+	
+private:
+	enum TOpenSubSessionType
+		{
+		EOpenSubSessionByModuleId,  //Open subsession with the location server by module id
+		EOpenSubSessionByCriteria    //Open subsession with the location server by criteria 
+		};
+		
+	CT_LbsDoPosUpdate(MT_LbsDoPosUpdateObserver* aObserver);
+	
+	void CT_LbsDoPosUpdate::ConstructL(TOpenSubSessionType aOpenSubSessionType,TPositionModuleInfo::TTechnologyType aTechnologyType, const TPositionCriteriaBase& aCriteria);
+	
+	// caller
+	MT_LbsDoPosUpdateObserver* iObserver;
+	
+	// Self locate server.
+	RPositionServer iServer;
+	RPositioner iPositioner;
+	};
+
+#endif // __CT_LBS_DOPOS_UPDATE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsdox3p.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,77 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file ctlbsdox3p.h
+*/
+
+#ifndef __CT_LBS_DO_X3P_H__
+#define __CT_LBS_DO_X3P_H__
+
+
+#include <e32base.h>
+#include <lbs.h>
+#include <lbsx3p.h>
+
+
+//class CT_LbsX3PDoTransmitPos;
+_LIT(KCT_LbsDoX3P, "CT_LbsDoX3P");
+
+// Async callbacks
+class MT_LbsDoX3PObserver
+	{
+public:
+	virtual void MT_LbsDoX3PCallback(TInt aTransmitId, TRequestStatus& aStatus) = 0;
+	};
+	
+	
+class CT_LbsDoX3P: public CActive
+	{
+public:
+	~CT_LbsDoX3P();
+	static CT_LbsDoX3P* NewL(MT_LbsDoX3PObserver* aObserver, TInt aTransmitId = 0);
+
+	TInt SetOptions(const TLbsTransmitPositionOptions& aTransmitOptions);
+
+	void StartL(const TDesC& aDestinationID, TUint aTransmitPriority, TPositionInfo & aTransmittedPosInfo);
+	
+protected:
+	//	Functions from CActive:
+	virtual void DoCancel();
+	virtual void RunL();
+	virtual TInt RunError(TInt aError);
+	
+private:
+	CT_LbsDoX3P(MT_LbsDoX3PObserver* aObserver, TInt aTransmitId);
+	void CT_LbsDoX3P::ConstructL();
+	
+	// Caller.
+	MT_LbsDoX3PObserver* iObserver;
+	
+	// Transmit server.
+	RLbsTransmitPositionServer iServer;
+	RLbsTransmitPosition iTransmitter;
+
+	// Id to allow multiple X3P to be carried out.
+	TInt iTransmitId;
+	};
+
+#endif // __CT_LBS_DO_X3P_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsnetsimstep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,177 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsNetsimstep.h
+// This contains the header file for LBS Net Sim Test Step Base
+// 
+//
+
+#ifndef __CT_LBS_NET_SIM_STEP_H__
+#define __CT_LBS_NET_SIM_STEP_H__
+
+// EPOC includes.
+#include <testexecutestepbase.h>
+
+// LBS test includes.
+#include <lbsnetsimtest.h>
+#include <lbsnetsimtestobserver.h>
+
+#include "ctlbstimerutils.h"
+
+
+const TInt KLbsKeepAlivePeriod = 10000;
+
+const TInt KKeepAliveTimerId = 0;
+const TInt KAbortTimerId = 34;
+
+/** Callback flags held as bits in a 32 bit word.
+*/
+typedef TUint32 TLbsCallbackFlags;
+
+const TLbsCallbackFlags KLbsCallback_None															= 0x0000;
+
+const TLbsCallbackFlags KLbsCallback_NetSim_Got_Connect												= 0x0001;
+const TLbsCallbackFlags KLbsCallback_NetSim_Got_Disconnect											= 0x0002;
+const TLbsCallbackFlags KLbsCallback_NetSim_Got_NotifyRegisterLcsMoLr								= 0x0004;
+const TLbsCallbackFlags KLbsCallback_NetSim_Got_NotifyReleaseLcsMoLr								= 0x0008;
+const TLbsCallbackFlags KLbsCallback_NetSim_Got_NotifyMeasurementControlLocation					= 0x0010;
+const TLbsCallbackFlags KLbsCallback_NetSim_Got_NotifyReleaseLcsLocationNotification				= 0x0020;
+const TLbsCallbackFlags KLbsCallback_NetSim_Got_NotifyFacilityLcsMoLrResult							= 0x0040;
+const TLbsCallbackFlags KLbsCallback_NetSim_Got_NotifyMeasurementReportLocation						= 0x0080;
+const TLbsCallbackFlags KLbsCallback_NetSim_Got_NotifyMeasurementReportRequestMoreAssistanceData	= 0x0100;
+const TLbsCallbackFlags KLbsCallback_NetSim_Got_NotifyMeasurementReportControlFailure 				= 0x0200;
+const TLbsCallbackFlags KLbsCallback_NetSim_Got_NotifyError											= 0x0400;
+const TLbsCallbackFlags KLbsCallback_NetSim_Got_ProcessMeasurementControlLocationError				= 0x0800;
+
+// NOTE: Derived test case will assume that they create new flags starting at 0x1000. If you add additional
+// flags here, the derived test cases will have to be updated also.
+
+const TLbsCallbackFlags KLbsCallback_MoLr =
+	KLbsCallback_NetSim_Got_NotifyRegisterLcsMoLr 				| // --> NET
+	KLbsCallback_NetSim_Got_NotifyMeasurementControlLocation	| // <-- NET
+	KLbsCallback_NetSim_Got_NotifyMeasurementReportLocation 	| // --> NET
+	KLbsCallback_NetSim_Got_NotifyFacilityLcsMoLrResult			| // <-- NET
+	KLbsCallback_NetSim_Got_NotifyReleaseLcsMoLr;				  // --> NET
+	
+//const TLbsCallbackFlags KLbsCallback_NetworkBasedLocation =
+//	KLbsCallback_NetSim_Got_NotifyRegisterLcsMoLr 					| // --> NET
+//	KLbsCallback_NetSim_Got_NotifyMeasurementControlLocation		| // <-- NET
+//	KLbsCallback_NetSim_Got_NotifyMeasurementReportControlFailure 	| // --> NET
+
+//	KLbsCallback_NetSim_Got_NotifyReleaseLcsMoLr;				  	  // --> NET	
+
+const TLbsCallbackFlags KLbsCallback_NetworkBasedLocation =
+	KLbsCallback_NetSim_Got_NotifyRegisterLcsMoLr 					| // --> NET
+	KLbsCallback_NetSim_Got_NotifyMeasurementControlLocation		| // <-- NET
+	KLbsCallback_NetSim_Got_NotifyMeasurementReportLocation			| // --> NET
+	KLbsCallback_NetSim_Got_NotifyFacilityLcsMoLrResult				| // <-- NET
+	KLbsCallback_NetSim_Got_NotifyReleaseLcsMoLr;				  	  // --> NET	
+
+const TLbsCallbackFlags KLbsCallback_MtLr =
+		// note: we get no notification of the 
+		KLbsCallback_NetSim_Got_NotifyReleaseLcsLocationNotification |  // response to privacy request
+		KLbsCallback_NetSim_Got_NotifyMeasurementControlLocation |		// location request
+		KLbsCallback_NetSim_Got_NotifyMeasurementReportLocation;
+
+
+class CT_LbsNetSimStep : public CTestStep,
+						 public	MT_LbsTimerUtilsObserver,
+						 public MLbsNetSimTestObserver
+{
+
+public:
+
+	virtual ~CT_LbsNetSimStep();
+
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+
+
+	// From MLbsNetSimTestObserver.	
+	virtual void Connected();
+	virtual void Disconnected();
+	virtual void NotifyRegisterLcsMoLr(const TDesC& aData);
+	virtual void NotifyReleaseLcsMoLr(TInt aReason);
+	virtual void NotifyMeasurementControlLocation(const TPositionInfo& aPosition, const RLbsAssistanceDataBuilderSet& aData, const TLbsNetPosRequestQuality& aQuality);
+	virtual void NotifyReleaseLcsLocationNotification(const CLbsNetworkProtocolBase::TLbsPrivacyResponse& aResult);
+	virtual void NotifyFacilityLcsMoLrResult(TInt aReason, const TPositionInfo& aPosition);
+	virtual void NotifyMeasurementReportLocation(const TPositionInfo& aPosition);
+	virtual void NotifyMeasurementReportRequestMoreAssistanceData(const TLbsAssistanceDataGroup& aFilter);
+	virtual void NotifyMeasurementReportControlFailure(TInt aReason);
+	virtual void NotifyError(MLbsNetSimTestObserver::EFunction aFunction, int aError);
+	virtual void ProcessMeasurementControlLocationError(TInt aError);
+
+protected:
+
+	CT_LbsNetSimStep();
+	
+	/** If aHaltTimerInterval is set, the test will continue for this period of time after all halt flags have been set
+	 */
+	void ConstructL(TTimeIntervalMicroSeconds32 aHaltTimerInterval = 0);
+	
+	/** Can be used to set the extended timer interval if not known at construct time
+	*/
+	void SetExtendedTimerInterval(TTimeIntervalMicroSeconds32 aHaltTimerInterval);
+
+	void SetCallbackFlag(TLbsCallbackFlags aCallbackFlag);
+	TBool TestCallbackFlags(TLbsCallbackFlags aExpectedFlags);
+
+
+	// From MT_LbsTimerUtilsObserver - keep alive timer to ensure we recvice all callbacks.
+	virtual void HandleTimerL(TInt aTimerId, const TTime& aTargetTime);
+
+	
+	enum  {		EConnecting = 0,	/** Waiting for the Net Sim to connect to the protocol module. */
+				EWaiting,			/** Waiting for all the callbacks to be fired. */
+				EExtendedWaiting,	/** Waiting for extended timer to fire */
+				EAborted,			/** Abort timer has fired before all callbacks fired */
+				EDone,				/** All the correct callbacks have been fired (and extended timer, if any, has fired), the test can end. */
+				ELast};				/** Used to allow extension of enums in derived classes - do not use! */
+
+	/** State machine variable for the test step.
+	*/
+	TInt iState;
+
+
+	/** Used to keep a record off all the callback events.
+	*/
+	TLbsCallbackFlags iCallbackFlags;
+	
+
+	/** Expected callback flags at test end.
+	*/
+	TLbsCallbackFlags iFlagsToHaltOn;
+	
+	/** If this is non-zero, the test will continue for this period of time after all halt flags have been set
+	*/
+	TTimeIntervalMicroSeconds32	iExtendedTimerInterval;
+	
+	/** Network Simulator, to allow MT-LRs and to monitor network messages.
+	*/
+	RLbsNetSimTest iNetSim;
+
+
+	/** Timer used to ensure the test step keeps processing until all the required callbacks
+		have been called. Otherwise we would execute the test step calls and return from the
+		doTestStepL function and miss the callbacks being fired.
+	*/
+	CT_LbsTimerUtils* iKeepAliveTimer;
+	
+	/** Timer used to abort the test step if all callbacks have not fired. Individual test cases can start this time with appropriate time.
+		
+	*/
+	CT_LbsTimerUtils* iAbortTimer;
+	
+};
+
+#endif // __CT_LBS_STEP_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsportedstepbase.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,340 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsportedstepbase.h
+// 
+//
+
+#ifndef __CT_LBS_PORTED_STEP_BASE_H__
+#define __CT_LBS_PORTED_STEP_BASE_H__
+
+//  INCLUDES
+#include <w32std.h>
+#include <LbsPositionInfo.h>
+#include <Lbs.h>
+#include <LbsCommon.h>
+#include <LbsRequestor.h>
+#include <centralrepository.h>
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+
+// CONSTANTS
+enum TPosSetupPsyDirective
+    {
+    EPosDisableTheRest = 0
+    };
+
+// UID:s for PSY:s
+const TInt32 KUidExternalGps        = 0x101f7a7d;
+const TInt32 KUidManualInput        = 0x101f7a7e;
+const TInt32 KUidDefault            = 0x101f7a7f;
+const TInt32 KUidStrategy           = 0x101f7a80;
+const TInt32 KUidSimulationPsy      = 0x101f7a81;
+const TInt32 KUidStubPositioner     = 0x01000019;
+const TInt32 KUidDynDbTestPsy       = 0x01000016;
+const TInt32 KUidInstallTestPsy     = 0x01000015;
+const TInt32 KUidTestPsySimulateIsa = 0x01000018;
+const TInt32 KUidTestPsy1           = 0x01000001;
+const TInt32 KUidTestPsy2           = 0x01000002;
+const TInt32 KUidTestPsy3           = 0x01000003;
+const TInt32 KUidTestPsy4           = 0x01000004;
+const TInt32 KUidTestPsy5           = 0x01000005;
+const TInt32 KUidTestPsy6           = 0x01000006;
+const TInt32 KUidTestPsy7           = 0x01000007;
+const TInt32 KUidTestPsy8           = 0x01000008;
+const TInt32 KUidTestPsy9           = 0x01000009;
+const TInt32 KUidTestPsy10          = 0x01000010;
+const TInt32 KUidTestPsy11          = 0x01000011;
+const TInt32 KUidTestPsy12          = 0x01000012;
+const TInt32 KUidTestPsy13          = 0x01000013;
+const TInt32 KUidTestPsy256         = 0x01000017;
+const TInt32 KUidTestPsyTp176       = 0x01000176;
+const TInt32 KUidMultiPsy           = 0x01010176;
+const TInt32 KUidTestStatusPsy      = 0x01000191;
+const TInt32 KUidTestTimerPsy       = 0x01000192;
+const TInt32 KUidExamplePsy         = 0x10001234; // TBD not impl UID
+const TInt32 KUidPanicPsy           = 0x01010210;
+const TInt32 KUidTestPsyPartialUpdate = 0x01000021;
+const TInt32 KUidPsySwitching       = 0x00000000; // TBD fill in when there ever is a switching psy
+const TInt32 KUidTestPsyMaxAge      = 0x01000020;
+const TInt32 KUidTestRangePsy       = 0x01000022;
+const TInt32 KUidTestSingPsy        = 0x01f0ff23;
+const TInt32 KUidTestTrackingPsy    = 0x01f0ff24;
+
+const TInt32 KTestProxyPsy1         = 0x01f0e001;
+const TInt32 KTestProxyPsy2         = 0x01f0e002;
+const TInt32 KTestProxyPsy3         = 0x01f0e003;
+const TInt32 KTestProxyPsy4         = 0x01f0e004;
+
+const TInt32 KInstallPsyTp273         = 0x01f0e005;
+
+const TInt32 KUidTestPsyPartialUpdate2 = 0x01000023;
+const TInt32 KUidSatInfoPsy         =    0x01010177;
+
+const TInt32 KUidBtgPsy         =    0x101FE999;
+const TInt32 KUidIgPsy          =    0x101FE999;
+
+const TInt KEspectedErrorCodePSY1 = KErrNone;
+const TInt KEspectedErrorCodePSY2 = KPositionPartialUpdate;
+const TInt KEspectedErrorCodePSY3 = KErrPositionBufferOverflow;
+const TInt KEspectedErrorCodePSY4 = KErrNone;
+
+// Central repository constants for Default Proxy.
+const TUid KCRUidDefaultProxyConfiguration = { 0x101f7a7f };
+const TUint32 KDefaultProxyLastWorkingGpsPsy = 0x10000001;
+
+
+// CLASS DECLARATION
+class CT_LbsClientLog;
+
+/****************************************************************************
+* The reason to have a new step base is that it is very much possible
+* that the all individual test steps have project related common variables 
+* and members 
+* and this is the place to define these common variable and members.
+* 
+****************************************************************************/
+class CT_LbsPortedStepBase : public CT_LbsStep
+	{
+public:
+	virtual ~CT_LbsPortedStepBase();
+	CT_LbsPortedStepBase(CT_LbsServer& aParent);
+	virtual TVerdict doTestStepPreambleL(); 
+    virtual TVerdict doTestStepL();
+	virtual TVerdict doTestStepPostambleL();
+
+//Please add your class members which will be common to all individual test steps:
+protected:
+	HBufC8*		iReadData;
+	HBufC8*		iWriteData;
+    
+public: // New functions
+    
+    /**
+    * Starts the test
+    */
+    virtual void StartL() = 0;
+    
+public: // Functions from base classes
+    
+    /**
+    * Runs the test in the module
+    * @param aIndex Indicates which internal test to run.
+    */
+    void StartL(TInt aIndex);    
+    
+protected: // New functions
+    
+    /**
+    * Setup privacy and notification override settings
+    * @param aPsyName   the name of the psy
+    * @param aDirective how to setup the PSY:s
+    *                   Enum def in this file.
+    */
+    void SetupPsyL(const TUid aPsyUid,
+                   TPosSetupPsyDirective aDirective = EPosDisableTheRest);
+    
+    /**
+    * Initialises the test.
+    * By default does nothing.
+    */
+    virtual void InitTestL();
+    
+    /**
+    * Cleans up after a test.
+    * Always called, even if the test leaves.
+    * By default does nothing.
+    */
+    virtual void CloseTest();
+    
+    /**
+    * Connect to epos server.
+    */
+    void ConnectL();
+    
+    /**
+    * Open a PSY by name.
+    */
+    TInt OpenPositionerByName(const TUid aPsyUid);
+    
+    /**
+    * Open default PSY.
+    */
+    TInt OpenPositioner();
+    
+    /**
+    * Close PSY by calling "iPositioner.Close()"
+    */
+    void ClosePositioner();
+    
+    /**
+    * Close connection with epos server.
+    */
+    void Disconnect();
+    
+    /**
+    * Perform a request to epos.
+    * Use this methods when requesting from 
+    * both a service and another requestor source, ie a Contact
+    */
+    void PerformRequestL(const TDesC& aService,
+                         const TDesC& aContact, 
+                         CRequestor::_TRequestorType aServiceIdType,
+                         CRequestor::_TRequestorType aContactIdType,
+                     // Set default values
+                     CRequestor::_TRequestorFormat aServiceFormat = CRequestor::EFormatApplication,
+                     CRequestor::_TRequestorFormat aContactFormat = CRequestor::EFormatTelephone
+     );
+    
+    /**
+    * Perform a request to epos. 
+    */
+    void PerformRequestL(const TDesC& aRequestor,
+        CRequestor::_TRequestorType aRequestorType,
+      CRequestor::_TRequestorFormat aRequestorFormat);
+    
+    /**
+    * Perform a synchronous request to epos and return errorcode. 
+    * Position info is returned in OUT parameter
+    */
+    TInt PerformSyncRequest(const TDesC& aServiceName,
+                   /* OUT */TPositionInfoBase* aModuleInfo);
+    
+    /**
+    * Check the result of a request to epos.
+    * Leaves if the error code is not the expected one.
+    * The log file is used to print the result from the request
+    */
+    void CheckRequestResultL(TInt aExpectedErrorCode, TBool aLogFlag = ETrue);
+    
+    /**
+    * Leaves if aCondition is false.
+    * @param aCondition something that should be true
+    */
+    void AssertTrueL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode);
+
+    /**
+     * Leaves if aCondition is false.
+     * @param aCondition something that should be true
+     */
+     void AssertTrueL(TBool aCondition, const TDesC& aErrorMsg);
+    
+    /**
+    * Get the last updated position info from positioner
+    * Uses GetLastKnownPosition() method.
+    * @return position info.
+    */
+    TPositionInfo AllocPositionInfoL();
+    
+    /**
+    * Verifies that a PSY has been loaded by getting its last reported status.
+    * Requires that the PSY report active in its constructor.
+    * @param aUid the PSYs Uid 
+    */ 
+    void VerifyPsyLoadedL(TPositionModuleId aUid); 
+    
+    /**
+    * Verifies that a PSY has been unloaded by getting its last reported status.
+    * Requires that the PSY report inactive in its destructor.
+    * @param aUid the PSYs Uid 
+    */ 
+    void VerifyPsyUnloadedL(TPositionModuleId aUid); 
+    
+    /**
+    * Request a position from the default psy
+    */ 
+    void RequestL(TPositionInfo& aPosInfo, const TInt& aRequestIndex, 
+    		const TInt& aExpectedErrorCode = 999);
+    
+    void LogErrorAndLeaveL(const TDesC& aErrorInfo,
+            const TInt   aReason = KErrGeneral);
+    
+    void SetSimDataFileL(const TDesC& aFileName);
+    
+    void ResetDefaultPSYLastWorkingExtGPSPSYL();
+
+    void VerifyPositionFromL(TPositionInfo& aPosInfo, TPositionModuleId& aModuleId);
+
+    void VerifyPositionL(TPositionInfo& aPosInfo, TReal64 aLat, 
+    		TReal64 aLong, TReal64 aAlt);
+
+    void VerifyRequestTimeLessThanL(TInt aExpectedReqTime);
+    
+    void ConstructL();
+    
+protected:  // Data
+
+    TInt                    iNrOfRequests;
+    TInt 					iRequestTime;
+    
+    TInt                    iModuleId;
+    TUid                    iUidExternalGps;         
+    TUid                    iUidManualInput;
+    TUid                    iUidDefault;
+    TUid                    iUidStrategy;
+    TUid                    iUidSimulationPsy;
+    TUid                    iUidStubPositioner;
+    TUid                    iUidDynDbTestPsy;      
+    TUid                    iUidInstallTestPsy;
+    TUid                    iUidTestPsySimulateIsa;
+    TUid                    iUidTestPsy1;
+    TUid                    iUidTestPsy2;        
+    TUid                    iUidTestPsy3;        
+    TUid                    iUidTestPsy4;        
+    TUid                    iUidTestPsy5;        
+    TUid                    iUidTestPsy6;         
+    TUid                    iUidTestPsy7;         
+    TUid                    iUidTestPsy8;         
+    TUid                    iUidTestPsy9;         
+    TUid                    iUidTestPsy10;         
+    TUid                    iUidTestPsy11;         
+    TUid                    iUidTestPsy12;
+    TUid                    iUidTestPsy13;        
+    TUid                    iUidTestPsy256;
+    TUid                    iUidTestPsyTp176;
+    TUid                    iUidMultiPsy;
+    TUid                    iUidExamplePsy;
+    TUid                    iUidTestStatusPsy;
+    TUid                    iUidTestTimerPsy;
+    TUid                    iUidPsySwitching;
+    TUid                    iUidPanicPsy;
+    TUid                    iUidTestPsyPartialUpdate;
+    TUid                    iUidTestPsyMaxAge;
+    TUid                    iUidTestRangePsy;
+    TUid                    iUidTestSingPsy;
+    TUid                    iUidTestTrackingPsy;
+    TUid                    iUidTestProxyPsy1;
+    TUid                    iUidTestProxyPsy2;        
+    TUid                    iUidTestProxyPsy3;        
+    TUid                    iUidTestProxyPsy4;
+    TUid                    iUidInstallPsyTp273;
+    TUid                    iUidPartialUpdate2;
+    TUid                    iUidSatInfoPsy;
+    TUid                    iUidBtgPsy;
+    TUid                    iUidIgPsy;
+    RPositionServer         iPosServer;
+    RPositioner             iPositioner;
+    
+    CActiveScheduler* 		iScheduler;
+    TBool    				iErrors;
+    RFs                 	iFileServer;
+    
+    CT_LbsClientLog*		iLog;
+    
+private:    // Data
+   
+    TRequestStatus          iStatus;
+    TPositionInfo           iModuleInfo;
+	};
+
+#endif // __CT_LBS_PORTED_STEP_BASE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsportedsuitedefs.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_PORTED_SUITEDEFS_H__
+#define __CT_LBS_CLIENT_PORTED_SUITEDEFS_H__
+
+// Please modify below value with your project and must match with your configuration ini file which is required to be modified as well
+_LIT(KTe_LbsPortedSuiteString,"TheString");
+_LIT(KTe_LbsPortedSuiteInt,"TheInt");
+_LIT(KTe_LbsPortedSuiteBool,"TheBool");
+
+// For test step panics
+_LIT(KTe_LbsPortedSuitePanic,"Te_LbsPortedSuite");
+
+#endif //__CT_LBS_CLIENT_PORTED_SUITEDEFS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsposclient.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,100 @@
+/*
+* Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_POS_CLIENT_H__
+#define __CT_LBS_POS_CLIENT_H__
+
+//  INCLUDES
+#include <LbsPositionInfo.h>
+#include <e32base.h>
+#include <lbs.h>
+
+// CONSTANTS
+
+// FUNCTION TYPES
+
+// FORWARD DECLARATIONS
+class CPositioner;
+class CT_LbsPosClientHolder;
+
+// CLASS DECLARATION
+
+/**
+*  Active object used to make position requests
+*
+*/
+class CT_LbsPosClient : public CActive
+    {
+    public:  // Constructors and destructor
+        
+        static CT_LbsPosClient* NewL(CT_LbsPosClientHolder* aParent, TUid aPsy);
+
+        static CT_LbsPosClient* NewL(CT_LbsPosClientHolder* aParent, TUid aPsy, RPositionServer& aPositionServer);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsPosClient();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+    	CT_LbsPosClient(CT_LbsPosClientHolder* aParent);
+
+        void ConstructL(TUid aPsy);    
+
+        void ConstructL(TUid aPsy, RPositionServer& aPositionServer);
+
+    public: // Functions from base classes
+    	
+        /**
+        * Starts a position request
+        */
+        void MakeRequest();
+
+        /**
+        * Get result
+        */
+        void GetResult(
+            TInt& aStatus, 
+            TPositionInfo& aModuleInfo,
+            TTimeIntervalMicroSeconds& aRequestTime
+            );
+
+    private:
+
+        void RunL();
+
+        void DoCancel();
+
+    private:
+        RPositioner						iPositioner;
+        RPositionServer					iPosServer;
+        TBool                       	iSameClient;
+        TPositionInfo					iModuleInfo;
+        TTime							iStartTime;
+        TTimeIntervalMicroSeconds		iRequestTime;
+        CT_LbsPosClientHolder*	iParent;
+    };
+
+#endif      // __CT_LBS_POS_CLIENT_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsposclientholder.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,112 @@
+/*
+* Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_HOLDER_H__
+#define __CT_LBS_CLIENT_POS_HOLDER_H__
+
+//  INCLUDES
+#include <e32base.h>
+#include "ctlbsportedstepbase.h"
+
+// CONSTANTS
+
+// FUNCTION TYPES
+
+// FORWARD DECLARATIONS
+class CPositionInfo;
+class CPositioner;
+class CT_LbsPosClient;
+
+// CLASS DECLARATION
+
+/**
+*  Active object used to make position requests
+*
+*/
+class CT_LbsPosClientHolder : public CActive
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        static CT_LbsPosClientHolder* NewLC(
+            TInt aRequestCount = 1, TUid aPsy = TUid::Uid(KUidDynDbTestPsy), TBool aSameServer = EFalse);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsPosClientHolder();
+
+    private:
+        
+        void ConstructL(TInt aRequestCount, TUid aPsy, TBool aSameServer);
+
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsPosClientHolder();
+
+    public: // Functions from base classes
+        
+        /**
+        * Starts a position request
+        */
+        void MakeRequests();
+
+        void StopRequests();
+
+		void SetCancelTime(TTimeIntervalMicroSeconds32 aTimeInterval);
+
+        /**
+        * Get result
+        */
+        void GetResult(
+            TInt& aStatus,  
+            TPositionInfo& aModuleInfo,
+            TTimeIntervalMicroSeconds& aRequestTime,
+            TInt aRequesterIndex = 0
+            );
+
+        void HandleRequestDone();
+
+        void SetRequesterWillCancelL(
+            TInt    aIndex = 0
+            );
+
+    protected:
+
+        void RunL();
+
+        void DoCancel();
+
+    private:
+
+        RPointerArray<CT_LbsPosClient>       iRequesters;
+        RPositionServer				    iPosServer;
+        TInt                            iNofRequestsDone;
+        RTimer                          iTimer;
+        RArray<TInt>                    iRequestersWhoWillCancel;
+        TBool                           iRequestsActive;
+		TTimeIntervalMicroSeconds32     iCancelTime;
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_HOLDER_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsrequester.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,149 @@
+/*
+* Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_REQUESTER_H__
+#define __CT_LBS_REQUESTER_H__
+
+//  INCLUDES
+#include <e32base.h>
+#include <Lbs.h>
+#include <testexecutelogger.h>
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class MCT_LbsRequestObserver;
+
+// CLASS DECLARATION
+
+/**
+*  ?one_line_short_description.
+*  ?other_description_lines
+*/
+class CT_LbsRequester : public CActive
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        * @return A new instance of this class.
+        */
+        static CT_LbsRequester* NewL(
+            /* IN  */   TUid                	aPsyUid,
+            /* IN  */   MCT_LbsRequestObserver*	aObserver,
+            CTestExecuteLogger&					aLogger
+            );
+        
+        /**
+		* Two-phased constructor.
+		* @return A new instance of this class.
+		*/
+		static CT_LbsRequester* NewL(
+		    /* IN  */   MCT_LbsRequestObserver*		aObserver,
+		    /* IN  */   TTimeIntervalMicroSeconds	aInterval,
+		    CTestExecuteLogger&						aLogger
+		    );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CT_LbsRequester();
+
+    protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsRequester(
+            /* IN  */   MCT_LbsRequestObserver*   aObserver
+            );
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        void ConstructL(TUid aPsyUid, CTestExecuteLogger& aLogger);
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        void ConstructL(TTimeIntervalMicroSeconds aInterval, CTestExecuteLogger& aLogger);
+
+    public: // New functions
+        
+        const TTime& CompletionTimeUTC() const;
+        TInt CompletionCode() const;
+        void GetPositionInfo(
+            TPositionInfo& aModuleInfo
+                        );
+
+		/**
+        * Set Requestorstack
+        */
+        TInt SetRequestorStackL(const TDesC& aService, const TDesC& aContact);
+
+        /**
+        * Performs a request to iPsy. Notifies iObserver when request is complete
+        */
+        void StartRequest();
+
+
+        /**
+        * Performs a request to iPsy. Notifies iObserver when request is complete
+        */
+        void SetUpdateIntervalL(TTimeIntervalMicroSeconds aInterval);
+
+        void SetUpdateType(const TInt& aUpdateType);
+
+    public: // Functions from base classes
+
+        void RunL();
+
+        void DoCancel();
+
+    protected: // New functions
+
+        void RequestComplete();
+
+    private:
+
+        // By default, prohibit copy constructor
+        CT_LbsRequester( const CT_LbsRequester& );
+        // Prohibit assigment operator
+        CT_LbsRequester& operator= ( const CT_LbsRequester& );
+        
+    	// Logger interface used for constructing result strings to be fed for the logger instance
+    	inline CTestExecuteLogger& Logger() {return iLogger;};
+
+    private:    // Data
+
+        RPositionServer     iPosServer;
+        RPositioner         iPositioner;
+
+        MCT_LbsRequestObserver*   iObserver;
+        TTime               iCompletionTimeUTC;
+        TInt                iCompletionCode;
+        TRequestStatus      iRequestStatus;
+        TPositionInfo       iModuleInfo;
+        
+        CTestExecuteLogger	iLogger;
+    };
+
+#endif      // __CT_LBS_REQUESTER_H__  
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsserver.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,66 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsServer.h
+// This contains the header file for LBS Test server
+// 
+//
+
+#ifndef __CT_LBS_SERVER_H__
+#define __CT_LBS_SERVER_H__
+
+// System includes
+#include <testexecuteserverbase.h>
+
+// User includes
+#include "ctlbsshareddata.h"
+
+//Literals Used
+_LIT(KTestCaseId, "tc_id");
+
+/** Configuration variable to state which module is in use for the test.
+
+This does not select the module to use, it's used to switch on test notifcation
+messages from the test step to the test module.
+
+Values:	"real" for use with the real A-GPS module.
+		"test" for use with the test module.
+*/
+_LIT(KLbsModuleType, "module_type");
+_LIT(KLbsModuleType_Real, "real");
+_LIT(KLbsModuleType_Test, "test");
+
+
+// Implements the LBS Test server
+class CT_LbsServer : public CTestServer
+	{
+public :
+	static CT_LbsServer* NewL();
+	// Creates the test steps based on the test step name 
+	virtual CTestStep* CreateTestStep(const TDesC& aStepName);
+	virtual ~CT_LbsServer();
+	CT_LbsServer();
+public:
+	CT_LbsSharedData* iSharedData;	
+
+	/**
+	iScheduler is a pointer to the active scheduler for use in the tests
+	@see CActiveScheduler
+	*/ 
+	CActiveScheduler* iScheduler;
+
+protected:
+	virtual void ConstructL(const TDesC& aName);
+	};
+
+#endif //__CT_LBS_SERVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsshareddata.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,75 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsSharedData.h
+// This contains CT_LbsSharedData
+// 
+//
+
+
+#ifndef __T_LBS_SHARED_DATA_H__
+#define __T_LBS_SHARED_DATA_H__
+
+// system includes
+#include <e32cmn.h>
+
+// Lbs includes
+#include <lbspositioninfo.h>
+#include <lbscommon.h>
+
+#include <lbslogevent.h>
+#include <lbsselflocatelogevent.h>
+#include <lbsexternallocatelogevent.h>
+#include <lbstransmitlocationlogevent.h>
+#include <lbsnetworklocatelogevent.h>
+#include <lbsassistancedatalogevent.h>
+
+class CT_LbsSharedData : public CBase
+{
+public:
+	static CT_LbsSharedData* NewL();
+	CT_LbsSharedData();
+	virtual ~CT_LbsSharedData();
+
+protected:
+	virtual void ConstructL();
+
+public:
+	RPointerArray<TAny>	iVerifyPosInfoArr;
+	RPointerArray<TAny>	iCurrentPosInfoArr;
+	
+	// For logging, different type arrays to store multiple events
+	RPointerArray<CLbsSelfLocateLogEvent>		iSelfLocateLogInfoArr;
+	RPointerArray<CLbsNetworkLocateLogEvent>	iNetworkLocateLogInfoArr;
+	RPointerArray<CLbsExternalLocateLogEvent>	iExternalLocateLogInfoArr;
+	RPointerArray<CLbsTransmitLocationLogEvent>	iX3PLocateLogInfoArr;
+	RPointerArray<CLbsAssistanceDataLogEvent>	iAssistanceDataLogInfoArr;
+		
+	TPositionModuleInfo iVerifyModuleInfo;
+	TPositionModuleInfo iCurrentModuleInfo;
+
+	TPositionModuleStatus iVerifyModuleStatus;
+	TPositionModuleStatus iCurrentModuleStatus;
+
+	TPositionModuleStatusEvent iVerifyModuleStatusEvent;
+	TPositionModuleStatusEvent iCurrentModuleStatusEvent;
+
+	TPositionUpdateOptions iVerifyUpdateOpts;
+	TPositionUpdateOptions iCurrentUpdateOpts;
+	
+	/** Flag used to indicate if the A-GPS integration test module is being used during testing.
+	*/
+	TBool iTestModuleInUse;
+};
+
+#endif // __T_LBS_SHARED_DATA_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,47 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsServer.h
+// This contains the header file for LBS  Test Step Base
+// 
+//
+
+#ifndef __CT_LBS_STEP_H__
+#define __CT_LBS_STEP_H__
+
+
+#include <testexecutestepbase.h>
+
+#include "ctlbsserver.h"
+
+
+class CT_LbsStep : public CTestStep
+{
+
+public:
+	virtual ~CT_LbsStep();
+
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+
+protected:
+	CT_LbsStep(CT_LbsServer& aParent);
+
+	// Class members which will be common to all individual test steps:
+	const CT_LbsServer& iParent;
+	
+
+private:
+};
+
+#endif // __CT_LBS_STEP_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepclearlog.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,54 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CTLbsStepClearLog.h
+// This contains the header file to clear the log
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#ifndef __CT_LBS_STEP_CLEARLOG_H__
+#define __CT_LBS_STEP_CLEARLOG_H__
+
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+
+// For logging
+#include "lbslogger.h"
+#include <logcli.h>
+#include <logview.h>
+#include <logwrap.h>
+
+#include "ctlbsasyncwaiter.h"
+
+_LIT(KLbsStep_ClearLog, "LbsStep_ClearLog"); 
+
+class CT_LbsStep_ClearLog : public CT_LbsStep
+	{
+public:
+	static CT_LbsStep_ClearLog* New(CT_LbsServer& aParent);
+	TVerdict doTestStepL();
+
+private:
+	CT_LbsStep_ClearLog(CT_LbsServer& aParent);
+		
+	};
+
+#endif // __CT_LBS_STEP_CLEARLOG_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepconfighybridmodule.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,52 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is the header file for the hybrid module configuration test step
+// 
+//
+
+#ifndef CTLBSSTEPCONFIGHYBRIDMODULE_H
+#define CTLBSSTEPCONFIGHYBRIDMODULE_H
+
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+#include <ctlbsagpshandler.h>
+
+// Literals used
+_LIT(KLbsStep_ConfigHybridModule, "LbsStep_ConfigHybridModule");
+
+class CT_LbsStep_ConfigHybridModule : public CT_LbsStep, MT_ResponseObserver
+	{
+public:
+	static CT_LbsStep_ConfigHybridModule* New(CT_LbsServer& aParent);
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepL();
+	virtual TVerdict doTestStepPostambleL();
+
+	// from MT_ResponseObserver
+	virtual void ProcessAGpsResponseMessage(const TT_LbsAGpsResponseMsg::TModuleResponseType aResponse);
+
+private:
+	CT_LbsStep_ConfigHybridModule(CT_LbsServer& aParent);
+
+	// Communication channel between A-Gps module and Test Harness
+	CT_LbsAGpsHandler* iAGpsHandler;
+	
+	// Configuration counter
+	TInt iConfigCtr;
+
+	// Partial verdict
+	TVerdict iVerdict;
+	};
+
+#endif //  CTLBSSTEPCONFIGHYBRIDMODULE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepcreateupdateinfo.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,38 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsStep_UpdateInfo.h
+// This contains the header file for Server Open Close Test
+// 
+//
+
+#ifndef __CT_LBS_CREATE_UPDATE_INFO_H__
+#define __CT_LBS_CREATE_UPDATE_INFO_H__
+
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+
+// Literals used
+_LIT(KLbsStep_CreateUpdateInfo, "LbsStep_CreateUpdateInfo");
+
+class CT_LbsStep_CreateUpdateInfo : public CT_LbsStep
+	{
+public:
+	static CT_LbsStep_CreateUpdateInfo* New(CT_LbsServer& aParent);
+	virtual TVerdict doTestStepL();
+
+private:
+	CT_LbsStep_CreateUpdateInfo(CT_LbsServer& aParent);
+	};
+
+#endif //__CT_LBS_CREATE_UPDATE_INFO_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepcreateverifymodinfo.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,38 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsStep_Create_Verify_ModInfo.h
+// This contains the header file for create verify module info step
+// 
+//
+
+#ifndef __CT_LBS_CREATE_VERIFY_MOD_INFO_H__
+#define __CT_LBS_CREATE_VERIFY_MOD_INFO_H__
+
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+
+// Literals used
+_LIT(KLbsStep_CreateVerifyModInfo, "LbsStep_CreateVerifyModInfo");
+
+class CT_LbsStep_CreateVerifyModInfo : public CT_LbsStep
+	{
+public:
+	static CT_LbsStep_CreateVerifyModInfo* New(CT_LbsServer& aParent);
+	virtual TVerdict doTestStepL();
+
+private:
+	CT_LbsStep_CreateVerifyModInfo(CT_LbsServer& aParent);
+	};
+
+#endif //__CT_LBS_CREATE_VERIFY_MOD_INFO_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepcreateverifymoduledata.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,38 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstepcreateverifymoduledata.h
+// This contains the header file for Server Open Close Test
+// 
+//
+
+#ifndef __CT_LBS_CREATE_VERIFY_MODULE_DATA_H__
+#define __CT_LBS_CREATE_VERIFY_MODULE_DATA_H__
+
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+
+// Literals used
+_LIT(KLbsStep_CreateVerifyModuleData, "LbsStep_CreateVerifyModuleData");
+
+class CT_LbsStep_CreateVerifyModuleData : public CT_LbsStep
+	{
+public:
+	static CT_LbsStep_CreateVerifyModuleData* New(CT_LbsServer& aParent);
+	virtual TVerdict doTestStepL();
+
+private:
+	CT_LbsStep_CreateVerifyModuleData(CT_LbsServer& aParent);
+	};
+
+#endif //__CT_LBS_CREATE_VERIFY_MODULE_DATA_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepcreateverifyposinfos.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,38 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsStep_VerifyPosInfos.h
+// This contains the header file for Server Open Close Test
+// 
+//
+
+#ifndef __CT_LBS_CREATE_VERIFY_POS_INFOS_H__
+#define __CT_LBS_CREATE_VERIFY_POS_INFOS_H__
+
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+
+// Literals used
+_LIT(KLbsStep_CreateVerifyPosInfos, "LbsStep_CreateVerifyPosInfos");
+
+class CT_LbsStep_CreateVerifyPosInfos : public CT_LbsStep
+	{
+public:
+	static CT_LbsStep_CreateVerifyPosInfos* New(CT_LbsServer& aParent);
+	virtual TVerdict doTestStepL();
+
+private:
+	CT_LbsStep_CreateVerifyPosInfos(CT_LbsServer& aParent);
+	};
+
+#endif //__CT_LBS_CREATE_VERIFY_POS_INFOS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepinstallscheduler.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,45 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsStep_InstallScheduler.h
+// This contains the header file for Install Active Scheduler Test Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#ifndef __CT_LBS_STEP_INSTALL_SCHEDULER_H__
+#define __CT_LBS_STEP_INSTALL_SCHEDULER_H__
+
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+
+_LIT(KLbsStep_InstallScheduler, "LbsStep_InstallScheduler"); 
+
+class CT_LbsStep_InstallScheduler : public CT_LbsStep
+	{
+public:
+	static CT_LbsStep_InstallScheduler* New(CT_LbsServer& aParent);
+	TVerdict doTestStepL();
+
+private:
+	CT_LbsStep_InstallScheduler(CT_LbsServer& aParent);
+	};
+
+#endif // __CT_LBS_STEP_INSTALL_SCHEDULER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepresetdefaultadmin.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,47 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsStep_ResetDefaultAdmin.h
+// This contains the header file for Reset Default Admin Settings Test Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#ifndef __CT_LBS_STEP_RESET_DEFAULT_ADMIN_H__
+#define __CT_LBS_STEP_RESET_DEFAULT_ADMIN_H__
+
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+
+_LIT(KLbsStep_ResetDefaultAdmin, "LbsStep_ResetDefaultAdmin"); 
+
+class CT_LbsStep_ResetDefaultAdmin : public CT_LbsStep
+	{
+public:
+	static CT_LbsStep_ResetDefaultAdmin* New(CT_LbsServer& aParent);
+	TVerdict doTestStepL();
+
+private:
+	CT_LbsStep_ResetDefaultAdmin(CT_LbsServer& aParent);
+	
+	
+	};
+
+#endif // __CT_LBS_STEP_RESET_DEFAULT_ADMIN_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepsetatamode.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsStep_SetATAMode.h
+// This contains the header file for Set Autonomous Mode Test Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#ifndef __CT_LBS_STEP_SET_ATA_MODE_H__
+#define __CT_LBS_STEP_SET_ATA_MODE_H__
+
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+
+_LIT(KLbsStep_SetATAMode, "LbsStep_SetATAMode"); 
+
+class CT_LbsStep_SetATAMode: public CT_LbsStep
+	{
+public:
+	static CT_LbsStep_SetATAMode* New(CT_LbsServer& aParent);
+	TVerdict doTestStepL();
+
+private:
+	CT_LbsStep_SetATAMode(CT_LbsServer& aParent);
+	
+	TBool SetAndVerifyATAModeL();
+	
+	};
+
+#endif // __CT_LBS_STEP_SET_ATA_MODE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepsetautonomousmode.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsStep_SetAutonomousMode.h
+// This contains the header file for Set Autonomous Mode Test Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#ifndef __CT_LBS_STEP_SET_AUTONOMOUS_MODE_H__
+#define __CT_LBS_STEP_SET_AUTONOMOUS_MODE_H__
+
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+
+_LIT(KLbsStep_SetAutonomousMode, "LbsStep_SetAutonomousMode"); 
+
+class CT_LbsStep_SetAutonomousMode : public CT_LbsStep
+	{
+public:
+	static CT_LbsStep_SetAutonomousMode* New(CT_LbsServer& aParent);
+	TVerdict doTestStepL();
+
+private:
+	CT_LbsStep_SetAutonomousMode(CT_LbsServer& aParent);
+	
+	TBool SetAndVerifyAutonomousGpsModeL();
+	
+	};
+
+#endif // __CT_LBS_STEP_SET_AUTONOMOUS_MODE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepsetbehaviourmodeoriginal.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsStep_SetBehaviourModeOriginal.h
+// This contains the header file for Set Autonomous Mode Test Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#ifndef __CT_LBS_STEP_SET_BEHAVIOUR_ORIGINAL_MODE_H__
+#define __CT_LBS_STEP_SET_BEHAVIOUR_ORIGINAL_MODE_H__
+
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+
+_LIT(KLbsStep_SetBehaviourModeOriginal, "LbsStep_SetBehaviourModeOriginal"); 
+
+class CT_LbsStep_SetBehaviourModeOriginal: public CT_LbsStep
+	{
+public:
+	static CT_LbsStep_SetBehaviourModeOriginal* New(CT_LbsServer& aParent);
+	TVerdict doTestStepL();
+
+private:
+	CT_LbsStep_SetBehaviourModeOriginal(CT_LbsServer& aParent);
+	
+	TBool SetAndVerifyBehaviourModeOriginalL();
+	
+	};
+
+#endif // __CT_LBS_STEP_SET_BEHAVIOUR_ORIGINAL_MODE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepsetprivhandler.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,49 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CTLbsStepSetPrivHandler.h
+// This contains the header file for Set Privacy Controller Test Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#ifndef __CT_LBS_STEP_SET_PRIVACY_HANDLER_H__
+#define __CT_LBS_STEP_SET_PRIVACY_HANDLER_H__
+
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+#include <lbsadmin.h>
+
+_LIT(KLbsStep_SetPrivacyHandler, "LbsStep_SetPrivacyHandler"); 
+
+class CT_LbsStep_SetPrivacyHandler : public CT_LbsStep
+	{
+public:
+	static CT_LbsStep_SetPrivacyHandler* New(CT_LbsServer& aParent);
+	TVerdict doTestStepL();
+
+private:
+	CT_LbsStep_SetPrivacyHandler(CT_LbsServer& aParent);
+	
+	TBool SetAndVerifyPrivacyHandlerL(CLbsAdmin::TPrivacyHandler aPrivacyHandlerType);
+	
+	};
+
+#endif // __CT_LBS_STEP_SET_PRIVACY_HANDLER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepsetptamode.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsStep_SetPTAMode.h
+// This contains the header file for Set Autonomous Mode Test Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#ifndef __CT_LBS_STEP_SET_PTA_MODE_H__
+#define __CT_LBS_STEP_SET_PTA_MODE_H__
+
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+
+_LIT(KLbsStep_SetPTAMode, "LbsStep_SetPTAMode"); 
+
+class CT_LbsStep_SetPTAMode: public CT_LbsStep
+	{
+public:
+	static CT_LbsStep_SetPTAMode* New(CT_LbsServer& aParent);
+	TVerdict doTestStepL();
+
+private:
+	CT_LbsStep_SetPTAMode(CT_LbsServer& aParent);
+	
+	TBool SetAndVerifyPTAModeL();
+	
+	};
+
+#endif // __CT_LBS_STEP_SET_PTA_MODE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepsetptbmode.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsStep_SetPTBMode.h
+// This contains the header file for Set Autonomous Mode Test Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#ifndef __CT_LBS_STEP_SET_PTB_MODE_H__
+#define __CT_LBS_STEP_SET_PTB_MODE_H__
+
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+
+_LIT(KLbsStep_SetPTBMode, "LbsStep_SetPTBMode"); 
+
+class CT_LbsStep_SetPTBMode: public CT_LbsStep
+	{
+public:
+	static CT_LbsStep_SetPTBMode* New(CT_LbsServer& aParent);
+	TVerdict doTestStepL();
+
+private:
+	CT_LbsStep_SetPTBMode(CT_LbsServer& aParent);
+	
+	TBool SetAndVerifyPTBModeL();
+	
+	};
+
+#endif // __CT_LBS_STEP_SET_PTB_MODE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepsetupprotocolstub.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,45 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsStep_SetupProtocolStub.h
+// This contains the header file for Set Autonomous Mode Test Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#ifndef __CT_LBS_STEP_SETUP_PROTOCOL_STUB_H__
+#define __CT_LBS_STEP_SETUP_PROTOCOL_STUB_H__
+
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+
+_LIT(KLbsStep_SetupProtocolStub, "LbsStep_SetupProtocolStub"); 
+
+class CT_LbsStep_SetupProtocolStub : public CT_LbsStep
+	{
+public:
+	static CT_LbsStep_SetupProtocolStub* New(CT_LbsServer& aParent);
+	TVerdict doTestStepL();
+
+private:
+	CT_LbsStep_SetupProtocolStub(CT_LbsServer& aParent);
+	};
+
+#endif // __CT_LBS_STEP_SETUP_PROTOCOL_STUB_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepsetuproamselflocate.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,45 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsStep_SetupRoamSelfLocate.h
+// This contains the header file for Set Autonomous Mode Test Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#ifndef __CT_LBS_STEP_SETUP_ROAM_SELF_LOCATE_H__
+#define __CT_LBS_STEP_SETUP_ROAM_SELF_LOCATE_H__
+
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+
+_LIT(KLbsStep_SetupRoamSelfLocate, "LbsStep_SetupRoamSelfLocate"); 
+
+class CT_LbsStep_SetupRoamSelfLocate : public CT_LbsStep
+	{
+public:
+	static CT_LbsStep_SetupRoamSelfLocate* New(CT_LbsServer& aParent);
+	TVerdict doTestStepL();
+
+private:
+	CT_LbsStep_SetupRoamSelfLocate(CT_LbsServer& aParent);
+	};
+
+#endif // __CT_LBS_STEP_SETUP_ROAM_SELF_LOCATE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepsetupstandaloneprivacyandsimplectlr.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,47 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstepsetupstandaloneprivacyandsimplectlr.h
+// This contains the header file for Set Autonomous Mode Test Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#ifndef __CT_LBS_STEP_SETUP_STANDALONE_PRIVACY_AND_SIMPLE_CTRL_H__
+#define __CT_LBS_STEP_SETUP_STANDALONE_PRIVACY_AND_SIMPLE_CTRL_H__
+
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+
+_LIT(KLbsStep_SetupStandalonePrivacyAndSimpleCtlr, "LbsStep_SetupStandalonePrivacyAndSimpleCtlr"); 
+
+
+
+class CT_LbsStep_SetupStandalonePrivacyAndSimpleCtlr : public CT_LbsStep
+	{
+public:
+	static CT_LbsStep_SetupStandalonePrivacyAndSimpleCtlr* New(CT_LbsServer& aParent);
+	TVerdict doTestStepL();
+
+private:
+	CT_LbsStep_SetupStandalonePrivacyAndSimpleCtlr(CT_LbsServer& aParent);
+	};
+
+#endif // __CT_LBS_STEP_SETUP_STANDALONE_PRIVACY_AND_SIMPLE_CTRL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepsetupstandaloneprivacymode.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,59 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsStep_SetupStandalonePrivacyMode.h
+// This contains the header file for Set Autonomous Mode Test Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#ifndef __CT_LBS_STEP_SETUP_STANDALONE_PRIVACY_MODE_H__
+#define __CT_LBS_STEP_SETUP_STANDALONE_PRIVACY_MODE_H__
+
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+
+_LIT(KLbsStep_SetupStandalonePrivacyMode, "LbsStep_SetupStandalonePrivacyMode"); 
+
+// lbsroot stuff (not ideal, currently defined in internal header file lbsrootcenrepdefs.h
+const TUint KLbsCenRepUidValue					= 0x10282266;
+const TUid  KLbsCenRepUid						= {KLbsCenRepUidValue};
+
+const TUint32 KLbsRootProcessNameFirstKey			= 0x00001000;
+const TUint32 KLbsRootProcessUidFirstKey			= 0x00002000;
+const TUint32 KLbsRootProcessIsServerFirstKey		= 0x00003000;
+
+const TUint32 KLbsSystemTransientKey				= 0x00000001;
+const TUint32 KLbsRootProcessTransientKey			= 0x00000002;
+
+const TUint32 KRootKeyMask							= 0xFFFFF000;	// don't care what the last 3 digits are
+
+
+class CT_LbsStep_SetupStandalonePrivacyMode : public CT_LbsStep
+	{
+public:
+	static CT_LbsStep_SetupStandalonePrivacyMode* New(CT_LbsServer& aParent);
+	TVerdict doTestStepL();
+
+private:
+	CT_LbsStep_SetupStandalonePrivacyMode(CT_LbsServer& aParent);
+	};
+
+#endif // __CT_LBS_STEP_SETUP_STANDALONE_PRIVACY_MODE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepsetupstandaloneprivacywithnoctlr.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,47 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstepsetupstandaloneprivacywithnoctlr.h
+// This contains the header file for Set Autonomous Mode Test Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#ifndef __CT_LBS_STEP_SETUP_STANDALONE_PRIVACY_WITH_NO_CTRL_H__
+#define __CT_LBS_STEP_SETUP_STANDALONE_PRIVACY_WITH_NO_CTRL_H__
+
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+
+_LIT(KLbsStep_SetupStandalonePrivacyWithNoCtlr, "LbsStep_SetupStandalonePrivacyWithNoCtlr"); 
+
+
+
+class CT_LbsStep_SetupStandalonePrivacyWithNoCtlr : public CT_LbsStep
+	{
+public:
+	static CT_LbsStep_SetupStandalonePrivacyWithNoCtlr* New(CT_LbsServer& aParent);
+	TVerdict doTestStepL();
+
+private:
+	CT_LbsStep_SetupStandalonePrivacyWithNoCtlr(CT_LbsServer& aParent);
+	};
+
+#endif // __CT_LBS_STEP_SETUP_STANDALONE_PRIVACY_WITH_NO_CTRL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepstartlbs.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,45 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstartlbs.h
+// This contains the header file for step to start lbs system
+// 
+//
+
+#ifndef __CT_LBS_STEP_START_LBS_H__
+#define __CT_LBS_STEP_START_LBS_H__
+
+// LBS includes.
+
+// LBS test includes.
+#include "ctlbsstep.h"
+
+const TUint KLbsTestDataSrcServerUidValue = 0x10282259;
+
+// Literals used
+_LIT(KLbsStep_StartLbs, "LbsStep_StartLbs");
+
+
+class CT_LbsStep_StartLbs : public CT_LbsStep
+	{
+public:
+	~CT_LbsStep_StartLbs();
+
+	static CT_LbsStep_StartLbs* New(CT_LbsServer& aParent);
+	virtual TVerdict doTestStepL();
+
+private:
+	CT_LbsStep_StartLbs(CT_LbsServer& aParent);
+	};
+
+#endif //__CT_LBS_STEP_START_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepstoplbs.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,44 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstartlbs.h
+// This contains the header file for step to start lbs system
+// 
+//
+
+#ifndef __CT_LBS_STEP_STOP_LBS_H__
+#define __CT_LBS_STEP_STOP_LBS_H__
+
+// LBS includes.
+
+// LBS test includes.
+#include "ctlbsstep.h"
+
+
+// Literals used
+_LIT(KLbsStep_StopLbs, "LbsStep_StopLbs");
+
+
+class CT_LbsStep_StopLbs : public CT_LbsStep
+	{
+public:
+	~CT_LbsStep_StopLbs();
+
+	static CT_LbsStep_StopLbs* New(CT_LbsServer& aParent);
+	virtual TVerdict doTestStepL();
+
+private:
+	CT_LbsStep_StopLbs(CT_LbsServer& aParent);
+	};
+
+#endif //__CT_LBS_STEP_STOP_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepverifyloginfo.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,163 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstepverifyloginfo.h
+// This contains the header file for verify position info array test step.
+// 
+//
+
+#ifndef __CT_LBS_VERIFY_LOG_INFO_H__
+#define __CT_LBS_VERIFY_LOG_INFO_H__
+
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+
+// From test implementation
+#include "lbstransmitlocationlogevent.h"
+//#include "Te_LbsLoggingSuiteStepBase.h"
+
+#include "lbslogger.h"
+#include <logcli.h>
+#include <logview.h>
+#include <logwrap.h>
+
+#include "tlbsutils.h"
+#include "ctlbsasyncwaiter.h"
+
+// Includes for Log Comparison
+#include <lbslogevent.h>
+#include <lbsselflocatelogevent.h>
+#include <lbsexternallocatelogevent.h>
+#include <lbstransmitlocationlogevent.h>
+#include <lbsnetworklocatelogevent.h>
+#include <lbsassistancedatalogevent.h>
+
+// Literals used
+_LIT(KLbsStep_VerifyLogInfo, "LbsStep_VerifyLogInfo");
+_LIT(KDest, "07712345678");
+
+#define REFPOS_LAT				52.2
+#define REFPOS_LONG				0.2
+#define REFPOS_ALT				10
+#define REFPOS_HORZ_ACCURACY	100
+#define REFPOS_VERT_ACCURACY	100
+
+#define REFPOS_LAT_OTHER		49.2
+#define REFPOS_LONG_OTHER		3.5
+#define REFPOS_ALT_OTHER		50.0
+#define REFPOS_HORZ_ACCURACY_OTHER	2.0
+#define REFPOS_VERT_ACCURACY_OTHER	3.0
+
+class CT_LbsStep_VerifyLogInfo : public CT_LbsStep
+	{
+public:
+	static CT_LbsStep_VerifyLogInfo* New(CT_LbsServer& aParent);
+	static CT_LbsStep_VerifyLogInfo* NewL(CT_LbsServer& aParent);
+	~CT_LbsStep_VerifyLogInfo();
+	CT_LbsStep_VerifyLogInfo();
+
+	TVerdict doTestStepPreambleL();
+	TVerdict doTestStepPostambleL();
+
+
+	virtual TVerdict doTestStepL();
+	static TInt SelfLocateLogEventTimestampCompare(const CLbsSelfLocateLogEvent& aLog1,
+										  const CLbsSelfLocateLogEvent& aLog2);
+
+
+	enum TLogType
+	{
+	/** Logging an Autonomous self Locate location request 3.3.1 */
+	EAutonomousSelfLocateRequest = 0,
+	
+	/** Logging an MO-LR Self Locate location request 3.3.2 */
+	EMOLRSelfLocateRequest,
+
+	/** Logging an MO-LR Cell Based location request 3.3.3 */
+	EMOLRCellBasedLocationRequest,
+
+	/** Logging an MO-LR Transmit to 3rd Party Location 3.3.4 */
+	EMOLRTransmitTo3rdPartyLocationRequest,
+
+	/** Logging a Mobile Terminated Location Request 3.3.5 */
+	EMTLR,
+	
+	/** Logging MO-LR Tracking Location Requests 3.3.6 */
+	EMOLRTrackingLocationRequest,
+	
+	/** Logging Autonomous Tracking Location Requests 3.3.7 */
+	EAutonomousTrackingLocationRequest,
+	
+	/** Update an existing Event log entry 3.3.8 */
+	EUpdateExistingEventLogEntry,
+		
+	};
+
+
+private:
+	CT_LbsStep_VerifyLogInfo(CT_LbsServer& aParent);
+	
+	TVerdict ReadFromLogL(TInt aUidForTheLogType);
+	void ClearLog();
+	void InitialiseRHS();
+	void InitialiseRHSforMTLR();
+	TPositionInfo* CommonPositionInfo();
+	
+	//5 log type test mechanisms
+	void SelfLocateLogTest();
+	void NetworkLocateLogTest();
+	void ExternalLocateLogTest();
+	void X3PLocateLogTest();
+	void AssistanceDataLogTest();
+	
+	//Top level functionality
+	void AutonomousSelfLocateLogTest();
+	void MOLRSelfLocateRequest();
+	void MOLRCellBasedLocationRequest();
+	void MOLRTransmitTo3rdPartyLocationRequest();
+	void MTLR();
+	void MOLRTrackingLocationRequest();
+	void AutonomousTrackingLocationRequest();
+	void SecondPositionFromArray(TPositionInfo* aPosInfoSecond);
+	
+	
+	TInt iLogType; // Can be defined in ENums
+	T_LbsUtils iUtils;
+	
+	// Member variables for Log reading
+	RFs itheFs;
+	CLogClient* iclient;
+	CLogViewEvent* iview;
+	CT_LbsAsyncWaiter* iActiveWaiter;
+	TPositionInfo* iRefPosTwo;
+		
+	// Right hand sides of comparisons
+	CLbsSelfLocateLogEvent*			iSelfLocateLogIntiailisedFromValues;
+	CLbsExternalLocateLogEvent*		iExternalLocateLogIntiailisedFromValues;
+	CLbsTransmitLocationLogEvent*	iX3PLogIntiailisedFromValues;
+	CLbsNetworkLocateLogEvent*		iNetworkLocateLogIntiailisedFromValues;
+	CLbsAssistanceDataLogEvent*		iAssistanceDataLogIntiailisedFromValuesFirst; 
+	
+	
+	// Comparison accuracy
+	T_LbsUtils::TComparisonAccuracyType iWhatAccuracyToUse;
+	
+
+
+
+protected:
+	void ConstructL();
+
+	};
+
+#endif //__CT_LBS_VERIFY_LOG_INFO_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepverifymodinfo.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,38 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstepmodinfo.h
+// This contains the header file for verify module information test step.
+// 
+//
+
+#ifndef __CT_LBS_VERIFY_MOD_INFO_H__
+#define __CT_LBS_VERIFY_MOD_INFO_H__
+
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+
+// Literals used
+_LIT(KLbsStep_VerifyModInfo, "LbsStep_VerifyModInfo");
+
+class CT_LbsStep_VerifyModInfo : public CT_LbsStep
+	{
+public:
+	static CT_LbsStep_VerifyModInfo* New(CT_LbsServer& aParent);
+	virtual TVerdict doTestStepL();
+
+private:
+	CT_LbsStep_VerifyModInfo(CT_LbsServer& aParent);
+	};
+
+#endif //__CT_LBS_VERIFY_MOD_INFO_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepverifymodstatus.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,38 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientstepmodinfo.h
+// This contains the header file for verify module information test step.
+// 
+//
+
+#ifndef __CT_LBS_VERIFY_MOD_STATUS_H__
+#define __CT_LBS_VERIFY_MOD_STATUS_H__
+
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+
+// Literals used
+_LIT(KLbsStep_VerifyModuleStatus, "LbsStep_VerifyModuleStatus");
+
+class CT_LbsStep_VerifyModStatus : public CT_LbsStep
+	{
+public:
+	static CT_LbsStep_VerifyModStatus* New(CT_LbsServer& aParent);
+	virtual TVerdict doTestStepL();
+
+private:
+	CT_LbsStep_VerifyModStatus(CT_LbsServer& aParent);
+	};
+
+#endif //__CT_LBS_VERIFY_MOD_STATUS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepverifyposinfos.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,38 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsStep_VerifyPosInfos.h
+// This contains the header file for verify position info array test step.
+// 
+//
+
+#ifndef __CT_LBS_VERIFY_POS_INFOS_H__
+#define __CT_LBS_VERIFY_POS_INFOS_H__
+
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+
+// Literals used
+_LIT(KLbsStep_VerifyPosInfos, "LbsStep_VerifyPosInfos");
+
+class CT_LbsStep_VerifyPosInfos : public CT_LbsStep
+	{
+public:
+	static CT_LbsStep_VerifyPosInfos* New(CT_LbsServer& aParent);
+	virtual TVerdict doTestStepL();
+
+private:
+	CT_LbsStep_VerifyPosInfos(CT_LbsServer& aParent);
+	};
+
+#endif //__CT_LBS_VERIFY_POS_INFOS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/ctlbsstepverifyroughposinfos.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,38 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsStep_VerifyPosInfos.h
+// This contains the header file for verify position info array test step.
+// 
+//
+
+#ifndef __CT_LBS_VERIFY_ROUGH_POS_INFOS_H__
+#define __CT_LBS_VERIFY_ROUGH_POS_INFOS_H__
+
+#include "ctlbsstep.h"
+#include "ctlbsserver.h"
+
+// Literals used
+_LIT(KLbsStep_VerifyRoughPosInfos, "LbsStep_VerifyRoughPosInfos");
+
+class CT_LbsStep_VerifyRoughPosInfos : public CT_LbsStep
+	{
+public:
+	static CT_LbsStep_VerifyRoughPosInfos* New(CT_LbsServer& aParent);
+	virtual TVerdict doTestStepL();
+
+private:
+	CT_LbsStep_VerifyRoughPosInfos(CT_LbsServer& aParent);
+	};
+
+#endif //__CT_LBS_VERIFY_ROUGH_POS_INFOS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/inc/mctlbsrequestobserver.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+#ifndef __MCT_LBS_REQUEST_OBSERVER_H__ 
+#define __MCT_LBS_REQUEST_OBSERVER_H__
+
+// CLASS DECLARATION
+
+/**
+*  Interface for notification when a CRequester request is complete.
+*
+*/
+class MCT_LbsRequestObserver
+    {
+    public:
+        
+        /**
+        * Called when a CRequester request has completed.
+        */
+		virtual void RequestCompleteL() = 0;
+
+    };
+
+#endif      // __MCT_LBS_REQUEST_OBSERVER_H__   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsactiveyield.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,80 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Common utils used by hybrid plugin tests
+// 
+//
+
+
+
+/**
+ @file ctlbsactiveyield.cpp
+*/
+
+#include <e32base.h>
+#include <e32std.h>
+
+#include <testexecutestepbase.h>
+
+
+void CheckForObserverEventTestsL(TTimeIntervalMicroSeconds32 aTimeout, CTestStep& aStep)
+	{
+	class CTimeout : public CTimer
+		{
+		CTestStep& iStep;
+
+		void RunL()  
+	    	{
+	    	iStep.SetTestStepError(KErrTimedOut);
+	    	CActiveScheduler::Stop();
+			}
+
+		CTimeout(CTestStep& aTestStep) : CTimer(EPriorityLow), iStep(aTestStep) { ; }
+		
+	public:
+		static CTimeout* NewL(CTestStep& aTestStep)
+			{
+			CTimeout* p = new (ELeave) CTimeout(aTestStep);
+			CleanupStack::PushL(p);
+			p->ConstructL();
+			CActiveScheduler::Add(p);
+			CleanupStack::Pop(p);
+			return p;
+			}
+		};
+		
+	CTimeout *pTimeout = CTimeout::NewL(aStep);
+	pTimeout->After(aTimeout);	
+	
+	CActiveScheduler::Start();
+
+	if(pTimeout->iStatus == KRequestPending)
+		{
+		pTimeout->Cancel();
+//		User::WaitForRequest(pTimeout->iStatus);
+		}
+	
+	pTimeout->Deque();
+	delete pTimeout;
+	
+	if(EPass != aStep.TestStepResult())
+		{
+		User::Leave(aStep.TestStepResult());
+		}
+	}
+	
+
+void ReturnToTestStep()
+	{
+	CActiveScheduler::Stop();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsclientlog.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,69 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+// INCLUDE FILES
+#include "ctlbsclientlog.h"
+#include <bautils.h>
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CT_LbsClientLog::CT_LbsClientLog()
+    {
+    }
+
+// EPOC default constructor can leave.
+void CT_LbsClientLog::ConstructL(CTestExecuteLogger& aLogger)
+    {
+    iLogger = aLogger;
+    }
+
+// Two-phased constructor.
+EXPORT_C CT_LbsClientLog* CT_LbsClientLog::NewL(CTestExecuteLogger& aLogger)
+    {
+    CT_LbsClientLog* self = NewLC(aLogger);
+    CleanupStack::Pop();
+    return self;
+    }
+
+// Two-phased constructor.
+EXPORT_C CT_LbsClientLog* CT_LbsClientLog::NewLC(CTestExecuteLogger& aLogger)
+    {
+    CT_LbsClientLog* self = new (ELeave) CT_LbsClientLog;
+    CleanupStack::PushL(self);
+    self->ConstructL(aLogger);
+    return self;
+    }
+
+// Destructor
+CT_LbsClientLog::~CT_LbsClientLog()
+    {    
+    }
+
+void CT_LbsClientLog::Put(const TDesC& aLine)
+   {
+   INFO_PRINTF1(aLine);
+   }
+
+void CT_LbsClientLog::PutError(const TDesC& aLine)
+   {
+   ERR_PRINTF1(aLine);
+   }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsclientrequestor.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,274 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+// INCLUDE FILES
+#include "ctlbsportedstepbase.h"
+#include "ctlbsclientrequestor.h"
+#include "mctlbsrequestobserver.h"
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// Two-phased constructor.
+CT_LbsClientRequestor* CT_LbsClientRequestor::NewL(
+	TUid                	aPsyUid,
+	MCT_LbsRequestObserver*	aObserver,
+	const TDesC&			aClientName,
+    CTestExecuteLogger&		aLogger
+    )
+	{
+    CT_LbsClientRequestor* self = new (ELeave) CT_LbsClientRequestor(aObserver, aPsyUid);
+    CleanupStack::PushL(self);
+    self->ConstructL(aClientName, aLogger);
+    CleanupStack::Pop();
+    return self;
+    }
+
+// Destructor
+CT_LbsClientRequestor::~CT_LbsClientRequestor()
+    {
+    iObserver = NULL;
+    Cancel();
+    iPosServer.Close();
+    }
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CT_LbsClientRequestor::CT_LbsClientRequestor(
+	MCT_LbsRequestObserver*   aObserver,
+	TUid				aPsyUid)
+    : CActive(EPriorityStandard), iObserver(aObserver), iCompletionCode(KNoEvent),
+	iPsyUid(aPsyUid), iContinueEventRequesting(FALSE)
+    {
+    }
+
+// EPOC default constructor can leave.
+void CT_LbsClientRequestor::ConstructL(
+	const TDesC& aClientName,
+    CTestExecuteLogger&		aLogger
+    )
+	{
+	iName = aClientName;
+    iLogger = aLogger;
+    User::LeaveIfError(iPosServer.Connect());
+    iModuleInfo = TPositionInfo();
+    CActiveScheduler::Add(this);
+    }
+
+// ---------------------------------------------------------
+// CRequester::CompletionTimeUTC
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+const TTime& CT_LbsClientRequestor::CompletionTimeUTC() const
+    {
+    return iCompletionTimeUTC;
+    }
+
+// ---------------------------------------------------------
+// CRequester::CompletionCode
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt CT_LbsClientRequestor::CompletionCode() const
+    {
+    return iCompletionCode;
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientRequestor::ResetCompletionCode
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientRequestor::ResetCompletionCode()
+	{
+	iCompletionCode = KNoEvent;
+	}
+
+// ---------------------------------------------------------
+// CRequester::StartRequest
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientRequestor::StartRequestL(TBool aDefaultPsy)
+    {    
+    _LIT(KService, "SAAA");
+	if (aDefaultPsy == FALSE)
+		{
+		User::LeaveIfError(iPositioner.Open(iPosServer, iPsyUid));    
+		}
+	else 
+		{
+		User::LeaveIfError(iPositioner.Open(iPosServer));
+		}
+	
+	
+	iPositioner.SetRequestor(CRequestor::ERequestorService,
+                             CRequestor::EFormatApplication,
+                             KService);
+
+    iPositioner.NotifyPositionUpdate(iModuleInfo, iStatus);
+    SetActive();
+    }
+
+// ---------------------------------------------------------
+// CRequester::RunL
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientRequestor::RunL()
+    {
+    iCompletionCode = iStatus.Int();
+    RequestComplete();
+	if (iContinueEventRequesting)
+		{
+		iContinueEventRequesting = FALSE;
+		RequestModuleStatusEvent();
+		}
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientRequestor::DoCancel
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientRequestor::DoCancel()
+    {
+	iPosServer.CancelRequest(EPositionServerNotifyModuleStatusEvent/*EPositionServerGetModuleStatus*/);
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientRequestor::RequestComplete
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientRequestor::RequestComplete()
+    {
+	if (iObserver)
+        {
+        TRAPD(err, iObserver->RequestCompleteL());
+        if(KErrNone != err)
+        	{
+        	_LIT(KClientRequestor, "Error in LbsClientRequestor: %d");
+        	ERR_PRINTF2(KClientRequestor, err);
+        	}
+        }
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientRequestor::RequestModuleStatusEvent
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientRequestor::RequestModuleStatusEvent()
+	{
+	istatusEvent.SetRequestedEvents(TPositionModuleStatusEvent::EEventAll);
+	iPosServer.NotifyModuleStatusEvent(istatusEvent, iStatus, iPsyUid);
+	if (!IsActive())
+		{
+		SetActive();
+		}
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientRequestor::CancelModuleStatusEvent
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientRequestor::CancelModuleStatusEvent()
+	{
+	iPosServer.CancelRequest(EPositionServerGetModuleStatus);
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientRequestor::ReadModuleStatusEvent
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt CT_LbsClientRequestor::ReadModuleStatusEvent()
+	{
+	TPositionModuleStatus modstatus = TPositionModuleStatus();
+	istatusEvent.GetModuleStatus(modstatus);
+	return modstatus.DeviceStatus();
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientRequestor::ReadModuleStatusClientApi
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt CT_LbsClientRequestor::ReadModuleStatusClientApi(TPositionModuleId aModuleId)
+	{
+	//Module status from Client API
+	TPositionModuleStatus moduleStatus = TPositionModuleStatus();
+	iPosServer.GetModuleStatus(moduleStatus, aModuleId);
+	return moduleStatus.DeviceStatus();
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientRequestor::ReadModuleStatusModulesApi
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TBool CT_LbsClientRequestor::ReadModuleStatusModulesApi(CPosModules* aDb, TPositionModuleId aModuleId)
+	{
+	//Module info from Modules API
+	TPositionModuleInfo moduleInfo;
+	CPosModuleIdList* prioList = aDb->ModuleIdListLC();
+	TInt modnr = prioList->Find(aModuleId);
+	aDb->GetModuleInfoL(prioList->At(modnr), moduleInfo);
+	CleanupStack::PopAndDestroy(prioList);
+	return moduleInfo.IsAvailable();
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientRequestor::ContinueRequesting
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientRequestor::ContinueRequesting()
+	{
+	iContinueEventRequesting = TRUE;;
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientRequestor::ClosePositioner
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientRequestor::ClosePositioner()
+	{
+	iPositioner.Close();
+	}
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsdoposupdate.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,197 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// ao wrapper around the a-gps mgr function NotifyPositionUpdate
+// 
+//
+
+
+
+/**
+ @file ctlbsdoposupd.cpp
+*/
+
+#include "ctlbsdoposupdate.h"
+#include "tlbsutils.h"
+
+
+CT_LbsDoPosUpdate* CT_LbsDoPosUpdate::NewL(MT_LbsDoPosUpdateObserver* aObserver, TPositionModuleInfo::TTechnologyType aTechnologyType)
+/**
+ *	'public constructor' may leave
+ */
+	{
+	TPositionCriteria dummyCritera;
+	CT_LbsDoPosUpdate* doPosUpdate = new(ELeave)CT_LbsDoPosUpdate(aObserver);
+	CleanupStack::PushL(doPosUpdate);
+	doPosUpdate->ConstructL(EOpenSubSessionByModuleId,aTechnologyType,dummyCritera);
+	CleanupStack::Pop(doPosUpdate);
+
+	return doPosUpdate;
+	}
+
+
+CT_LbsDoPosUpdate* CT_LbsDoPosUpdate::NewL(MT_LbsDoPosUpdateObserver* aObserver, const TPositionCriteriaBase& aCriteria)
+/**
+ *	'public constructor' may leave
+ */
+	{
+	TUint dummyTechnologyType = TPositionModuleInfo::ETechnologyUnknown;
+	CT_LbsDoPosUpdate* doPosUpdate = new(ELeave)CT_LbsDoPosUpdate(aObserver);
+	CleanupStack::PushL(doPosUpdate);
+	doPosUpdate->ConstructL(EOpenSubSessionByCriteria,dummyTechnologyType,aCriteria);
+	CleanupStack::Pop(doPosUpdate);
+
+	return doPosUpdate;
+	}
+
+
+CT_LbsDoPosUpdate::CT_LbsDoPosUpdate(MT_LbsDoPosUpdateObserver* aObserver) : CActive(EPriorityStandard), iObserver(aObserver)
+/**
+ * 	Constructor - will not leave
+ */
+	{ 	
+	CActiveScheduler::Add(this);
+	}
+
+
+void CT_LbsDoPosUpdate::OpenPositioner(TPositionModuleInfo::TTechnologyType aTechnologyType)
+	{
+	// Open the positioner.
+	if(TPositionModuleInfo::ETechnologyUnknown == aTechnologyType)	// use default 
+		{
+		User::LeaveIfError(iPositioner.Open(iServer));
+		}
+	else if(TPositionModuleInfo::ETechnologyTerminal == aTechnologyType)
+		{
+		T_LbsUtils utils;
+		// Get position using Agps module
+		TPositionModuleId moduleId;
+		moduleId = utils.GetAGpsModuleIdL(iServer);
+		User::LeaveIfError(iPositioner.Open(iServer, moduleId));	
+		}
+	else if(TPositionModuleInfo::ETechnologyNetwork == aTechnologyType)
+		{
+		T_LbsUtils utils;
+		// Get position using network module
+		TPositionModuleId moduleId;
+		moduleId = utils.GetNetworkModuleIdL(iServer);
+		User::LeaveIfError(iPositioner.Open(iServer, moduleId));	
+		}
+	else
+		{
+		__ASSERT_ALWAYS(EFalse, User::Panic(KCT_LbsDoPosUpdate, KErrNotSupported));	// not supported yet
+		}
+	}
+	
+void CT_LbsDoPosUpdate::ClosePositioner(void)
+	{
+	iPositioner.Close();
+	}
+	
+void CT_LbsDoPosUpdate::ConnectServer()
+	{
+	User::LeaveIfError(iServer.Connect());
+	}
+
+void CT_LbsDoPosUpdate::CloseServer()
+	{
+	iServer.Close();
+	}
+	
+void CT_LbsDoPosUpdate::ConstructL(TOpenSubSessionType aOpenSubSessionType,TPositionModuleInfo::TTechnologyType aTechnologyType, const TPositionCriteriaBase& aCriteria)
+	{
+	// Connect to the LBS self locate server.
+	User::LeaveIfError(iServer.Connect());
+	
+	if(aOpenSubSessionType == EOpenSubSessionByModuleId)
+		{
+		OpenPositioner(aTechnologyType);
+		}
+	
+	else if(aOpenSubSessionType == EOpenSubSessionByCriteria)
+		{
+		User::LeaveIfError(iPositioner.Open(iServer, aCriteria));
+		}
+	
+	// set requester will be removed, don't forget the pushl above
+	User::LeaveIfError(iPositioner.SetRequestor(	CRequestor::ERequestorService,
+													CRequestor::EFormatApplication,
+	    											_L("Tom Tom")));
+	
+	}
+	
+
+CT_LbsDoPosUpdate::~CT_LbsDoPosUpdate()
+/**
+ * 	Destructor
+ */
+	{
+	Cancel();
+
+	iPositioner.Close();
+	iServer.Close();
+	}
+
+
+TInt CT_LbsDoPosUpdate::SetOptions(const TPositionUpdateOptionsBase& aPosOption)
+	{
+	return iPositioner.SetUpdateOptions(aPosOption);
+	}
+
+
+void CT_LbsDoPosUpdate::StartL(TPositionInfo& aPosInfo)
+/**
+ * 	wrapper for async  function RLbsPositionUpdates::NotifyPositionUpdate(). 
+ *  Will panic if there's another outstanding request.
+ */
+	{	
+	__ASSERT_ALWAYS(!IsActive(), User::Panic(KCT_LbsDoPosUpdate, KErrInUse));
+
+	// Invoke the position update.	
+	iPositioner.NotifyPositionUpdate(aPosInfo, iStatus);
+	SetActive();
+	}
+
+void CT_LbsDoPosUpdate::CancelRequest()
+	{
+	// To allow us to cancel the request but not the active object, normally Cancel() would be used.
+	DoCancel();	
+	}
+
+void CT_LbsDoPosUpdate::DoCancel()
+	{	
+	iPositioner.CancelRequest(EPositionerNotifyPositionUpdate);
+	}
+
+
+void CT_LbsDoPosUpdate::RunL()
+	{
+	TInt err = iStatus.Int();
+	
+	// iStatus will contain error code
+	// async request completed. Notify caller via callback:
+	if (iObserver)
+		{
+		iObserver->MT_LbsDoPosUpdateCallback(iStatus);
+		}
+	}
+
+TInt CT_LbsDoPosUpdate::RunError(TInt aError)
+	{
+	return aError;
+	}
+
+TInt CT_LbsDoPosUpdate::CompleteRequest(TInt aRequestId)
+	{
+	return iPositioner.CompleteRequest(aRequestId);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsdox3p.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,96 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Async wrapper around a LBS X3P transmitter.
+// 
+//
+
+
+
+/**
+ @file ctlbsdox3p.cpp
+*/
+
+//#include <lbsx3p.h>
+
+#include "ctlbsdox3p.h"
+
+
+CT_LbsDoX3P* CT_LbsDoX3P::NewL(MT_LbsDoX3PObserver* aObserver, TInt aTransmitId)
+	{
+	CT_LbsDoX3P* self = new(ELeave)CT_LbsDoX3P(aObserver, aTransmitId);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop();
+
+	return self;
+	}
+
+
+CT_LbsDoX3P::CT_LbsDoX3P(MT_LbsDoX3PObserver* aObserver, TInt aTransmitId) : CActive(EPriorityStandard), iObserver(aObserver), iTransmitId(aTransmitId)
+	{ 	
+	CActiveScheduler::Add(this); 
+	}
+
+
+void CT_LbsDoX3P::ConstructL()
+	{
+	User::LeaveIfError(iServer.Connect());
+	User::LeaveIfError(iTransmitter.Open(iServer));
+	}
+	
+
+CT_LbsDoX3P::~CT_LbsDoX3P()
+	{
+	Cancel();
+
+	iTransmitter.Close();
+	iServer.Close();
+	}
+
+
+TInt CT_LbsDoX3P::SetOptions(const TLbsTransmitPositionOptions& aTransmitOptions)
+	{
+	return iTransmitter.SetTransmitOptions(aTransmitOptions);
+	}
+
+
+void CT_LbsDoX3P::StartL(const TDesC& aDestinationID, TUint aTransmitPriority, TPositionInfo & aTransmittedPosInfo)
+	{	
+	__ASSERT_ALWAYS(!IsActive(), User::Panic(KCT_LbsDoX3P, KErrInUse));
+
+	// Invoke the X3P transmit update.	
+	iTransmitter.TransmitPosition(aDestinationID, aTransmitPriority, iStatus, aTransmittedPosInfo);
+	SetActive();
+	}
+
+
+void CT_LbsDoX3P::DoCancel()
+	{
+	iTransmitter.CancelTransmitPosition(); 
+	}
+
+
+void CT_LbsDoX3P::RunL()
+	{
+	// Notify caller via callback, process the err in the callback.
+	if (iObserver)
+		{
+		iObserver->MT_LbsDoX3PCallback(iTransmitId, iStatus);
+		}
+	}
+
+TInt CT_LbsDoX3P::RunError(TInt aError)
+	{
+	return aError;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsnetsimstep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,280 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsnetsimstep.cpp
+// This is the class implementation for the LBS Test Step Base
+// 
+//
+
+#include "ctlbsnetsimstep.h"
+
+
+/**
+ * Constructor
+ */
+CT_LbsNetSimStep::CT_LbsNetSimStep() : iState(EConnecting)
+	{
+	}
+
+
+/**
+ * If parameter is supplied, it will cause the test to continue running for this period after all expected flags have been set
+ */ 
+void CT_LbsNetSimStep::ConstructL(TTimeIntervalMicroSeconds32 aHaltTimerInterval)
+	{
+	// Create the keep alive timer.
+	iKeepAliveTimer = CT_LbsTimerUtils::NewL(this, KKeepAliveTimerId);		
+	// Create the abort timer.
+	iAbortTimer = CT_LbsTimerUtils::NewL(this, KAbortTimerId);
+		
+	iExtendedTimerInterval = aHaltTimerInterval;
+	}
+
+/**
+ * Can be used to set the extended time interval if not known at construct time.
+ * // This will cause the test to continue running for this period after all expected flags have been set
+ */
+void CT_LbsNetSimStep::SetExtendedTimerInterval(TTimeIntervalMicroSeconds32 aHaltTimerInterval)
+	{
+	iExtendedTimerInterval = aHaltTimerInterval;	
+	}
+	
+	
+CT_LbsNetSimStep::~CT_LbsNetSimStep()
+	{
+	iKeepAliveTimer->Cancel();
+	delete iKeepAliveTimer;
+	iAbortTimer->Cancel();
+	delete iAbortTimer;
+	
+	}
+
+/**
+ * @return - TVerdict
+ * Implementation of CTestStep base class virtual
+ * It is used for doing all initialisation common to derived classes in here.
+ * Make it being able to leave if there are any errors here as there's no point in
+ * trying to run a test step if anything fails.
+ * The leave will be picked up by the framework.
+ */
+TVerdict CT_LbsNetSimStep::doTestStepPreambleL()
+	{
+	// Process some common pre setting to test steps then set SetTestStepResult to EFail or Epass.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsNetSimStep::doTestStepPreambleL()"));
+	SetTestStepResult(EPass);
+
+	return TestStepResult();
+	}
+
+
+/**
+ * @return - TVerdict
+ * Implementation of CTestStep base class virtual
+ * It is used for doing all after test treatment common to derived classes in here.
+ * Make it being able to leave
+ * The leave will be picked up by the framework.
+ */
+TVerdict CT_LbsNetSimStep::doTestStepPostambleL()
+	{
+	// Process some common post setting to test steps then set SetTestStepResult to EFail or Epass.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsNetSimStep::doTestStepPostabmleL()"));
+
+	//SetTestStepResult(EPass);  // or EFail
+	return TestStepResult();
+	}
+
+
+/** Used to mark each callback that has fired.
+*/
+void CT_LbsNetSimStep::SetCallbackFlag(TLbsCallbackFlags aCallbackFlag)
+	{
+//	INFO_PRINTF2(_L("CT_LbsNetSimStep::SetCallbackFlag: setting callback flag 0x%x"), aCallbackFlag);
+	iCallbackFlags |= aCallbackFlag;
+	}
+
+
+/** Used to determine which callback or callbacks have been fired.
+*/
+TBool CT_LbsNetSimStep::TestCallbackFlags(TLbsCallbackFlags aExpectedFlags)
+	{
+	if (iCallbackFlags == aExpectedFlags)
+		{
+		return ETrue;
+		}
+	return EFalse;
+	}
+
+
+/** Keep alive timer callback.
+
+	Check the state machine to determine when to halt the test. Once all the callbacks
+	have been received the test can end.
+
+	We have to call async functions from here also, as the callbacks are executed in another thread.
+*/
+void CT_LbsNetSimStep::HandleTimerL(TInt aTimerId, const TTime& aTargetTime)
+	{
+	// Not used.
+	(void)aTimerId;
+	(void)aTargetTime;
+
+	if(KAbortTimerId == aTimerId)
+		{
+		INFO_PRINTF1(_L("Abort timer fired"));
+		iState = EAborted;
+		iKeepAliveTimer->Cancel();
+		CActiveScheduler::Stop();
+		}
+	else
+		{	
+		// Check for test finish.
+		
+		ASSERT(aTimerId == KKeepAliveTimerId);
+		// We stop test from here when in the correct state and, there should not be anything outstanding.
+		if (iState == EWaiting && TestCallbackFlags(iFlagsToHaltOn))
+			{
+			if(iExtendedTimerInterval.Int())	// we need an extended timer
+				{
+				INFO_PRINTF1(_L("Starting extended timer"));
+				iState = EExtendedWaiting;
+				iKeepAliveTimer->SetTimer(iExtendedTimerInterval);
+				}
+			else
+				{
+				iState = EDone;
+				iAbortTimer->Cancel();	// note: this is ok since it will do nothing if timer never started
+				CActiveScheduler::Stop();
+				}
+			}
+		// expected callbacks have all fired, but waiting for an extended period of time before stopping
+		else if(iState == EExtendedWaiting)
+			{
+			INFO_PRINTF1(_L("Extended timer fired"));
+			iState = EDone;
+			iAbortTimer->Cancel();
+			CActiveScheduler::Stop();
+			}
+		// Keep going, still waiting for callbacks.	
+		else
+			{
+			TTimeIntervalMicroSeconds32 interval(KLbsKeepAlivePeriod);
+				
+			iKeepAliveTimer->SetTimer(interval);
+			}
+		}
+	}
+
+
+/** NetSim callbacks.
+*/
+void CT_LbsNetSimStep::Connected()
+	{
+	INFO_PRINTF1(_L("Got - NetSim Connect - Callback Event."));
+	
+	SetCallbackFlag(KLbsCallback_NetSim_Got_Connect);
+	
+	iState = EWaiting;
+	}
+
+
+void CT_LbsNetSimStep::Disconnected()
+	{
+	INFO_PRINTF1(_L("Got - NetSim Notify Disconnected - Callback Event."));
+	}
+
+
+void CT_LbsNetSimStep::NotifyRegisterLcsMoLr(const TDesC& aData)
+	{
+	(void)aData;
+	
+	INFO_PRINTF1(_L("Got - NetSim Notify Register Lcs MoLr - Callback Event."));
+	SetCallbackFlag(KLbsCallback_NetSim_Got_NotifyRegisterLcsMoLr);
+	}
+
+
+void CT_LbsNetSimStep::NotifyReleaseLcsMoLr(TInt aReason)
+	{
+	(void)aReason;
+		
+	INFO_PRINTF1(_L("Got - NetSim Notify Release Lcs MoLr - Callback Event."));
+	SetCallbackFlag(KLbsCallback_NetSim_Got_NotifyReleaseLcsMoLr);
+	}
+
+
+void CT_LbsNetSimStep::NotifyMeasurementControlLocation(const TPositionInfo& aPosition, 
+															  const RLbsAssistanceDataBuilderSet& aData, 
+															  const TLbsNetPosRequestQuality& aQuality)
+	{
+	(void)aPosition;
+	(void)aData;
+	(void)aQuality;
+	
+	INFO_PRINTF1(_L("Got - NetSim Notify Measurement Control Location - Callback Event."));
+	SetCallbackFlag(KLbsCallback_NetSim_Got_NotifyMeasurementControlLocation);
+	}
+
+
+void CT_LbsNetSimStep::NotifyReleaseLcsLocationNotification(const CLbsNetworkProtocolBase::TLbsPrivacyResponse& aResult)
+	{
+	(void)aResult;
+
+	INFO_PRINTF1(_L("Got - NetSim Notify Release Lcs Location Notification - Callback Event."));
+	SetCallbackFlag(KLbsCallback_NetSim_Got_NotifyReleaseLcsLocationNotification);
+	}
+
+
+void CT_LbsNetSimStep::NotifyFacilityLcsMoLrResult(TInt aReason, const TPositionInfo& aPosition)
+	{
+	(void)aReason;
+	(void)aPosition;
+
+	INFO_PRINTF1(_L("Got - NetSim Notify Facility Lcs MoLr Result - Callback Event."));
+	SetCallbackFlag(KLbsCallback_NetSim_Got_NotifyFacilityLcsMoLrResult);
+	}
+
+
+void CT_LbsNetSimStep::NotifyMeasurementReportLocation(const TPositionInfo& aPosition)
+	{	
+	(void)aPosition;
+
+	INFO_PRINTF1(_L("Got - Net Sim Notify Measurement Report - Callback Event."));
+	SetCallbackFlag(KLbsCallback_NetSim_Got_NotifyMeasurementReportLocation);
+	}
+
+
+void CT_LbsNetSimStep::NotifyMeasurementReportRequestMoreAssistanceData(const TLbsAssistanceDataGroup& aFilter)
+	{
+	(void)aFilter;
+
+	INFO_PRINTF1(_L("Got - Net Sim Notify Measurement Report Request More Assistance Data - Callback Event."));
+	SetCallbackFlag(KLbsCallback_NetSim_Got_NotifyMeasurementReportRequestMoreAssistanceData);
+	}
+
+
+void CT_LbsNetSimStep::NotifyMeasurementReportControlFailure(TInt aReason)
+	{
+	INFO_PRINTF2(_L("Got - Net Sim Notify Measurement Report Control Failure - Callback Event. Reason = %d"), aReason);
+	SetCallbackFlag(KLbsCallback_NetSim_Got_NotifyMeasurementReportControlFailure);
+	}
+
+void CT_LbsNetSimStep::NotifyError(MLbsNetSimTestObserver::EFunction aFunction, int aError)
+	{
+	INFO_PRINTF3(_L("Got - Net Sim Notify Error - Callback Event. Function = %d, Error = %d"), aFunction, aError);
+	SetCallbackFlag(KLbsCallback_NetSim_Got_NotifyError);
+	}
+
+void CT_LbsNetSimStep::ProcessMeasurementControlLocationError(TInt aError)
+	{
+	INFO_PRINTF2(_L("Got - Net Sim Process Measurement Control Location Error - Callback Event. Reason = %d"), aError);
+	SetCallbackFlag(KLbsCallback_NetSim_Got_ProcessMeasurementControlLocationError);	
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsportedstepbase.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,659 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+#include "ctlbsportedstepbase.h"
+#include "ctlbsportedsuitedefs.h"
+
+/*
+* ============================================================================
+* ============================================================================
+*/
+
+//  INCLUDES
+#include <TestExecuteStepBase.h>
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+#include <SimulationPSYInternalCRKeys.h>
+#include "ctlbsclientlog.h"
+
+// Device driver constants
+
+TVerdict CT_LbsPortedStepBase::doTestStepPreambleL()
+/**
+ * @return - TVerdict
+ * Implementation of CTestStep base class virtual
+ * It is used for doing all initialisation common to derived classes in here.
+ * Make it being able to leave if there are any errors here as there's no point in
+ * trying to run a test step if anything fails.
+ * The leave will be picked up by the framework.
+ */
+	{
+	// process some common pre setting to test steps then set SetTestStepResult to EFail or Epass.
+	SetTestStepResult(EPass);
+	return TestStepResult();
+	}
+
+TVerdict CT_LbsPortedStepBase::doTestStepPostambleL()
+/**
+ * @return - TVerdict
+ * Implementation of CTestStep base class virtual
+ * It is used for doing all after test treatment common to derived classes in here.
+ * Make it being able to leave
+ * The leave will be picked up by the framework.
+ */
+	{
+	// process some common post setting to test steps then set SetTestStepResult to EFail or Epass.
+	// SetTestStepResult(EPass);  // or EFail
+	return TestStepResult();
+	}
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CT_LbsPortedStepBase::CT_LbsPortedStepBase(CT_LbsServer& aParent): CT_LbsStep(aParent)
+    {
+    iUidExternalGps.iUid 		= KUidExternalGps;
+    iUidManualInput.iUid 		= KUidManualInput;
+    iUidDefault.iUid 			= KUidDefault;
+    iUidStrategy.iUid 			= KUidStrategy;
+    iUidStubPositioner.iUid 	= KUidStubPositioner;
+    iUidSimulationPsy.iUid 		= KUidSimulationPsy;
+    iUidDynDbTestPsy.iUid 		= KUidDynDbTestPsy;      
+    iUidInstallTestPsy.iUid 	= KUidInstallTestPsy;
+    iUidTestPsySimulateIsa.iUid = KUidTestPsySimulateIsa;
+    iUidTestPsy1.iUid       	= KUidTestPsy1;         
+    iUidTestPsy2.iUid       	= KUidTestPsy2;        
+    iUidTestPsy3.iUid       	= KUidTestPsy3;
+    iUidTestPsy4.iUid       	= KUidTestPsy4;        
+    iUidTestPsy5.iUid       	= KUidTestPsy5;        
+    iUidTestPsy6.iUid       	= KUidTestPsy6;         
+    iUidTestPsy7.iUid       	= KUidTestPsy7;         
+    iUidTestPsy8.iUid       	= KUidTestPsy8;         
+    iUidTestPsy9.iUid       	= KUidTestPsy9;         
+    iUidTestPsy10.iUid      	= KUidTestPsy10;         
+    iUidTestPsy11.iUid      	= KUidTestPsy11;         
+    iUidTestPsy12.iUid      	= KUidTestPsy12;
+    iUidTestPsy13.iUid      	= KUidTestPsy13;
+    iUidTestPsyTp176.iUid   	= KUidTestPsyTp176;
+    iUidMultiPsy.iUid       	= KUidMultiPsy;
+    iUidTestPsy256.iUid     	= KUidTestPsy256;        
+    iUidExamplePsy.iUid     	= KUidExamplePsy;
+    iUidTestStatusPsy.iUid  	= KUidTestStatusPsy;
+    iUidTestTimerPsy.iUid   	= KUidTestTimerPsy;
+    iUidPanicPsy.iUid          	= KUidPanicPsy;
+    iUidPsySwitching.iUid      	= KUidPsySwitching;
+    iUidTestPsyPartialUpdate.iUid  = KUidTestPsyPartialUpdate;
+    iUidTestPsyMaxAge.iUid     	= KUidTestPsyMaxAge;
+    iUidTestRangePsy.iUid      	= KUidTestRangePsy;
+    iUidTestSingPsy.iUid       	= KUidTestSingPsy;
+    iUidTestTrackingPsy.iUid   	= KUidTestTrackingPsy;
+    iUidTestProxyPsy1.iUid     	= KTestProxyPsy1;
+    iUidTestProxyPsy2.iUid     	= KTestProxyPsy2;
+    iUidTestProxyPsy3.iUid     	= KTestProxyPsy3;
+    iUidTestProxyPsy4.iUid     	= KTestProxyPsy4;
+    iUidInstallPsyTp273.iUid   	= KInstallPsyTp273;
+    iUidPartialUpdate2.iUid    	= KUidTestPsyPartialUpdate2; 
+    iUidSatInfoPsy.iUid        	= KUidSatInfoPsy;
+    iUidBtgPsy.iUid            	= KUidBtgPsy;
+    iUidIgPsy.iUid             	= KUidIgPsy;
+    }
+
+// Destructor
+CT_LbsPortedStepBase::~CT_LbsPortedStepBase()
+    {
+    iPositioner.Close();
+    iPosServer.Close();
+    delete iScheduler;
+    iFileServer.Close();   
+    }
+
+// ---------------------------------------------------------
+// CT_LbsPortedStepBase::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPortedStepBase::StartL(TInt aIndex)
+    {
+    if (aIndex == 0)
+        {
+        __UHEAP_MARK;
+        
+        iLog = CT_LbsClientLog::NewL(Logger());
+        
+	// Give extra time for epos server to shut down after previous tests:
+	User::After(2000000);
+        TRAPD(err, InitTestL());
+        if (err == KErrNone)
+            {
+            TRAP(err, StartL());
+            }
+        CloseTest();
+        
+        delete iLog;
+        __UHEAP_MARKEND;
+        
+        if (err != KErrNone)
+            {
+            User::Leave(err); // Not using LeaveIfError to allow positive error codes
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CT_LbsPortedStepBase::SetupPsyL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPortedStepBase::SetupPsyL(const TUid aPsyUid,
+                           TPosSetupPsyDirective /*aDirective*/)
+    {
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+
+    moduleUpdate->SetUpdateAvailability(EFalse);
+    CPosModuleIdList* prioList = db->ModuleIdListLC();
+
+    // Disable all PSY:s except aPsyUid
+    for (TInt i = 0 ; i < prioList->Count(); i++)
+        {
+        if ((*prioList)[i] != aPsyUid)
+            {
+            db->UpdateModuleL((*prioList)[i], *moduleUpdate);
+            }
+        }
+
+    // Enable the PSY that came as an in parameter
+    moduleUpdate->SetUpdateAvailability(ETrue);
+    db->UpdateModuleL(aPsyUid, *moduleUpdate);
+
+    CleanupStack::PopAndDestroy(prioList);
+    CleanupStack::PopAndDestroy(moduleUpdate);
+    CleanupStack::PopAndDestroy(db);
+    }
+// ---------------------------------------------------------
+// CT_LbsPortedStepBase::InitTestL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPortedStepBase::InitTestL()
+    {
+    }
+
+// ---------------------------------------------------------
+// CT_LbsPortedStepBase::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPortedStepBase::CloseTest()
+    {
+    }
+
+// ---------------------------------------------------------
+// CTe_LbsPortedStepBase::ConnectL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPortedStepBase::ConnectL()
+	{
+	TInt err = iPosServer.Connect();
+	if (err != KErrNone)
+		{
+		_LIT(KOpenError,
+			"TP%d, part %d failed. Unable to open connection to Epos, err = %d");
+		TBuf<100> error;
+		error.Format(KOpenError, iModuleId, iNrOfRequests, err);
+		LogErrorAndLeaveL(error);
+		}
+	}
+
+// ---------------------------------------------------------
+// CT_LbsPortedStepBase::OpenPositionerByName
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt CT_LbsPortedStepBase::OpenPositionerByName(
+                                  const TUid aPsyUid)
+	{
+	TInt err = iPositioner.Open(iPosServer, aPsyUid);
+	return err;
+	}
+
+// ---------------------------------------------------------
+// CT_LbsPortedStepBase::OpenPositionerL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt CT_LbsPortedStepBase::OpenPositioner()
+	{
+	TInt err = iPositioner.Open(iPosServer);
+	return err;
+	}
+
+// ---------------------------------------------------------
+// CT_LbsPortedStepBase::ClosePositioner
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPortedStepBase::ClosePositioner()
+    {
+    iPositioner.Close();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsPortedStepBase::Disconnect
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPortedStepBase::Disconnect()
+    {
+    iPosServer.Close();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsPortedStepBase::PerformRequest
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPortedStepBase::PerformRequestL(const TDesC& aRequestor,
+            CRequestor::_TRequestorType aRequestorType,
+          CRequestor::_TRequestorFormat aRequestorFormat)
+    {
+    iNrOfRequests++;
+
+    iModuleInfo = TPositionInfo();
+    TInt err = iPositioner.SetRequestor(aRequestorType,
+                             aRequestorFormat, aRequestor);
+    if (err != KErrNone)
+        {
+        _LIT(KErrRequestor, "Error when setting requestor in PerformRequestL");
+        LogErrorAndLeaveL(KErrRequestor, err);
+        }
+
+    iPositioner.NotifyPositionUpdate(iModuleInfo, iStatus);
+    }
+
+// ---------------------------------------------------------
+// CTe_LbsPortedStepBase::PerformRequestL
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPortedStepBase::PerformRequestL(
+    const TDesC& aService, const TDesC& aContact,
+    CRequestor::_TRequestorType aServiceIdType,
+    CRequestor::_TRequestorType aContactIdType,
+    CRequestor::_TRequestorFormat aServiceFormat,
+    CRequestor::_TRequestorFormat aContactFormat)
+	{
+	CRequestor* contactId = 
+        CRequestor::New(aContactIdType, aContactFormat, 
+                    aContact);
+
+	CRequestor* servId = 
+    	CRequestor::New(aServiceIdType, aServiceFormat, 
+                    aService);
+    
+	RRequestorStack stack = RRequestorStack();
+  	stack.Append(contactId);
+  	stack.Append(servId);
+
+  	CleanupStack::PushL(contactId);
+  	CleanupStack::PushL(servId);
+
+  	iNrOfRequests++;
+
+  	TInt err = iPositioner.SetRequestor(stack);
+  	stack.Close();
+  	if (err != KErrNone)
+        {
+        _LIT(KErrRequestor, "Error when setting requestor in PerformRequestL");
+        LogErrorAndLeaveL(KErrRequestor, err);
+        }
+  
+  	CleanupStack::PopAndDestroy(servId);
+  	CleanupStack::PopAndDestroy(contactId);
+  	iModuleInfo = TPositionInfo();
+  	iPositioner.NotifyPositionUpdate(iModuleInfo, iStatus);
+	}
+
+// ---------------------------------------------------------
+// CT_LbsPortedStepBase::PerformSyncRequestL
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt CT_LbsPortedStepBase::PerformSyncRequest(
+                            const TDesC& aServiceName,
+                            TPositionInfoBase* aModuleInfo)
+  {
+  iNrOfRequests++;
+  iPositioner.SetRequestor(CRequestor::ERequestorService,
+                           CRequestor::EFormatApplication, aServiceName);
+
+  iPositioner.NotifyPositionUpdate(*aModuleInfo, iStatus);
+  
+  User::WaitForRequest(iStatus);
+  TInt err = iStatus.Int();
+  return err;
+  }
+
+// ---------------------------------------------------------
+// CT_LbsPortedStepBase::CheckRequestResultL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPortedStepBase::CheckRequestResultL(TInt aExpectedErrorCode, TBool aLogFlag)
+    {
+    User::WaitForRequest(iStatus);
+
+    if (iStatus != aExpectedErrorCode)
+        {
+        _LIT(KError, "TP%d, request %d failed. iStatus = %d");
+        TBuf<100> error;
+        error.Format(KError, iModuleId, iNrOfRequests, iStatus.Int());
+        LogErrorAndLeaveL(error);
+        }
+    else {
+        if (aLogFlag)
+            {
+            _LIT(KMsg, "TP%d, part %d completed.");
+            TBuf<30> msg;
+            msg.Format(KMsg, iModuleId, iNrOfRequests);
+            INFO_PRINTF1(msg);
+            }
+        }    
+    }
+
+// ---------------------------------------------------------
+// CT_LbsPortedStepBase::AssertTrueL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPortedStepBase::AssertTrueL(TBool aCondition, 
+	const TDesC& aErrorMsg, TInt aErrorCode)
+	{
+	if (!aCondition)
+        {
+        TBuf<100> buf;
+        buf.Format(aErrorMsg, aErrorCode);
+        LogErrorAndLeaveL(buf);
+        }
+	}
+
+// ---------------------------------------------------------
+// CT_LbsPortedStepBase::AssertTrueL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPortedStepBase::AssertTrueL(TBool aCondition, 
+	const TDesC& aErrorMsg)
+	{
+	if (!aCondition)
+        {
+        LogErrorAndLeaveL(aErrorMsg);
+        }
+	}
+
+// ---------------------------------------------------------
+// CTe_LbsPortedStepBase::AllocPositionInfoL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TPositionInfo CT_LbsPortedStepBase::AllocPositionInfoL()
+    {
+    TPositionInfo moduleInfo = TPositionInfo();
+    iPositioner.GetLastKnownPosition(moduleInfo, iStatus);
+    return moduleInfo;
+    }
+
+// ---------------------------------------------------------
+// CT_LbsPortedStepBase::VerifyPsyLoadedL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPortedStepBase::VerifyPsyLoadedL(TPositionModuleId aUid)                           
+    {
+    _LIT(KVerPSYLoaded, "Verifies if PSY: %x, is loaded by getting its status");   
+    TBuf<100> buf;
+    buf.Format(KVerPSYLoaded, aUid.iUid);
+    INFO_PRINTF1(buf);   
+  
+    _LIT(KDevStatusErr, "The PSY has not reported expected Device Status."); 
+    TPositionModuleStatus moduleStatus;
+    iPosServer.GetModuleStatus (moduleStatus, aUid); 
+    AssertTrueL(TPositionModuleStatus::EDeviceReady == moduleStatus.DeviceStatus(), 
+    		KDevStatusErr, KErrGeneral);
+    }
+
+// ---------------------------------------------------------
+// CT_LbsPortedStepBase::VerifyPsyUnloadedL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPortedStepBase::VerifyPsyUnloadedL(TPositionModuleId aUid)                           
+    {
+    _LIT(KVerPSYUnloaded, "Verifies if PSY: %x, is unloaded by getting its status");   
+    TBuf<100> buf;
+    buf.Format(KVerPSYUnloaded, aUid.iUid);
+    INFO_PRINTF1(buf);   
+    
+    _LIT(KDevStatusErr, "The PSY has not reported expected Device Status."); 
+    TPositionModuleStatus moduleStatus;
+    iPosServer.GetModuleStatus(moduleStatus, aUid); 
+    AssertTrueL(TPositionModuleStatus::EDeviceInactive == moduleStatus.DeviceStatus(), 
+    		KDevStatusErr, KErrGeneral);
+    }
+
+// ---------------------------------------------------------
+// CT_LbsPortedStepBase::RequestL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPortedStepBase::RequestL(TPositionInfo& aPosInfo, 
+                                    const TInt& aRequestIndex, 
+                                    const TInt& aExpectedErrorCode)
+    {
+    TBuf<100> info;
+    _LIT(KInfo, "Making request: %d");
+    _LIT(KInfoCompCode, "Making request: %d, expecting completion code: %d.");
+    if (aExpectedErrorCode != 999)
+    	{
+        info.Format(KInfoCompCode, aRequestIndex, aExpectedErrorCode);
+    	}
+    else 
+    	{
+        info.Format(KInfo, aRequestIndex);    
+    	}    
+    INFO_PRINTF1(info);
+
+    aPosInfo.SetUpdateType(aRequestIndex); // Used here as request index
+
+    TTime starttime, stoptime;
+    starttime.UniversalTime();    
+
+    TRequestStatus status;
+    iPositioner.NotifyPositionUpdate(aPosInfo, status);
+    User::WaitForRequest(status);
+    
+    stoptime.UniversalTime();
+    iRequestTime = stoptime.Int64() - starttime.Int64();
+
+    if (aExpectedErrorCode != 999)
+    	{
+        _LIT(KUnexpectedErrCode, "Unexpected error code %d, expected %d.");
+        TBuf<200> buf;
+        buf.Format(KUnexpectedErrCode, status.Int(), aExpectedErrorCode);
+        AssertTrueL(status.Int() == aExpectedErrorCode, buf);
+    	}
+    }
+
+// ---------------------------------------------------------
+// CT_LbsPortedStepBase::LogErrorAndLeave
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+// 
+EXPORT_C void CT_LbsPortedStepBase::LogErrorAndLeaveL(const TDesC& aErrorInfo,
+                                              const TInt   aReason)
+    {
+    ERR_PRINTF2(aErrorInfo, aReason);
+    User::Leave(aReason);
+    }
+
+TVerdict CT_LbsPortedStepBase::doTestStepL()
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+	{
+    if (TestStepResult() == EPass)
+        {
+        CActiveScheduler* sched = new (ELeave) CActiveScheduler;
+        sched->Install(sched);
+        CleanupStack::PushL(sched);
+        StartL(0);
+        CleanupStack::PopAndDestroy(sched);
+
+        SetTestStepResult(EPass);
+        }
+    return TestStepResult();
+	}
+
+// ---------------------------------------------------------
+// CPosSimulationPSYTestProcedureBase::SetSimDataFile()
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPortedStepBase::SetSimDataFileL(const TDesC& aFileName)
+    {
+    CRepository* repository =
+    CRepository::NewLC(KCRUidSimulationPSY);
+    TInt err = repository->Set(KCRKeySimPSYSimulationFile,
+                        aFileName);
+    if (err != KErrNone)
+    	{
+    	_LIT(KErr, "CRepository::Set(KCRKeySimPSYSimulationFile...) returned error");
+    	INFO_PRINTF1(KErr);
+    	LogErrorAndLeaveL(KErr);
+    	}
+    	          
+    CleanupStack::PopAndDestroy(repository); 
+    }
+
+// ---------------------------------------------------------
+// CPosSimulationPSYTestProcedureBase::ResetDefaultPSYLastWorkingExtGPSPSYL()
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPortedStepBase::ResetDefaultPSYLastWorkingExtGPSPSYL()
+    {
+    TPositionModuleId modId = KPositionNullModuleId;
+    
+    CRepository* repos = CRepository::NewL( KCRUidDefaultProxyConfiguration );    
+    TBuf<40> idBuf;
+    idBuf.AppendNumFixedWidth( modId.iUid, EHex, 8);    
+    TInt err = repos->Set(KDefaultProxyLastWorkingGpsPsy, idBuf);
+    delete repos;
+    User::LeaveIfError(err);
+    
+	_LIT(KInfo, "ResetDefaultPSYLastWorkingExtGPSPSYL successfully executed.");
+	INFO_PRINTF1(KInfo);
+    }
+	
+// ---------------------------------------------------------
+// CPosSimulationPSYTestProcedureBase::VerifyPositionFromL
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPortedStepBase::VerifyPositionFromL(TPositionInfo& aPosInfo, 
+	TPositionModuleId& aModuleId)
+    {
+    if (aModuleId.iUid != aPosInfo.ModuleId().iUid)
+	   {		
+	   _LIT(KIncorrPsyErr,
+	   		"Position from wrong PSY received, got position from: %x, expected: %x.");
+	   TBuf<200> buf;
+	   buf.Format(KIncorrPsyErr, aPosInfo.ModuleId().iUid, aModuleId.iUid);
+	   LogErrorAndLeaveL(buf);
+	   }    
+    }
+
+// ---------------------------------------------------------
+// CPosSimulationPSYTestProcedureBase::VerifyPositionL
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPortedStepBase::VerifyPositionL(TPositionInfo& aPosInfo, 
+	TReal64 aLat, TReal64 aLong, TReal64 aAlt)
+	{
+	_LIT(KWrongFix, "Wrong Fix");
+	TPosition pos;
+	aPosInfo.GetPosition(pos);
+	AssertTrueL( aLat == pos.Latitude(), KWrongFix);
+	AssertTrueL( aLong == pos.Longitude(), KWrongFix);
+	AssertTrueL( aAlt == pos.Altitude(), KWrongFix);
+	}
+
+// ---------------------------------------------------------
+// CPosSimulationPSYTestProcedureBase::VerifyRequestTimeLessThanL
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPortedStepBase::VerifyRequestTimeLessThanL(TInt aExpectedReqTime)
+	{
+    if (iRequestTime > aExpectedReqTime)
+	    {
+	    _LIT(KTime, "Request time for last request was more than: %d");
+	    TBuf<100> buf;
+	    buf.Format(KTime, aExpectedReqTime);
+	    INFO_PRINTF1(buf);
+	    }
+	}
+
+void CT_LbsPortedStepBase::ConstructL()
+	{
+	iScheduler = new ( ELeave ) CActiveScheduler;
+	CActiveScheduler::Install(iScheduler);
+    User::LeaveIfError(iFileServer.Connect());
+	}
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsposclient.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,209 @@
+// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsposclient.h"
+#include "ctlbsposclientholder.h"
+#include <e32svr.h>
+#include <LbsIpc.h>
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CT_LbsPosClient::CT_LbsPosClient(CT_LbsPosClientHolder* aParent) 
+: CActive(EPriorityHigh), iParent(aParent)
+    {
+    CActiveScheduler::Add(this);
+    }
+     
+// Destructor
+CT_LbsPosClient::~CT_LbsPosClient()
+    {
+    Cancel();
+    iPositioner.Close();
+    if (!iSameClient)
+        iPosServer.Close();
+    }
+
+// ---------------------------------------------------------
+// CPosClient::ConstructL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPosClient::ConstructL(TUid aPsy)
+    {
+    //connect to EPos
+    User::LeaveIfError(iPosServer.Connect());
+    iSameClient = EFalse;
+    //Open subsession
+    User::LeaveIfError(iPositioner.Open(iPosServer, aPsy));
+    iModuleInfo = TPositionInfo();
+    }
+
+// ---------------------------------------------------------
+// CPosClient::ConstructL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPosClient::ConstructL(TUid aPsy, RPositionServer& aPositionServer)
+    {
+    //connect to EPos
+    //User::LeaveIfError(iPosServer.Connect());
+    iPosServer = aPositionServer;
+    iSameClient = ETrue;
+    //Open subsession
+    User::LeaveIfError(iPositioner.Open(iPosServer, aPsy));
+    iModuleInfo = TPositionInfo();
+    }
+// ---------------------------------------------------------
+// CPosClient::NewL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+CT_LbsPosClient* CT_LbsPosClient::NewL(CT_LbsPosClientHolder* aParent, TUid aPsy)
+    {
+    CT_LbsPosClient* self = new (ELeave) CT_LbsPosClient(aParent);
+    CleanupStack::PushL(self);
+    self->ConstructL(aPsy);
+    CleanupStack::Pop(self); // self
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CPosClient::NewL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+CT_LbsPosClient* CT_LbsPosClient::NewL(CT_LbsPosClientHolder* aParent, TUid aPsy, RPositionServer& aPositionServer)
+    {
+    CT_LbsPosClient* self = new (ELeave) CT_LbsPosClient(aParent);
+    CleanupStack::PushL(self);
+    self->ConstructL(aPsy, aPositionServer);
+    CleanupStack::Pop(self); // self
+    return self;
+    }
+
+
+// ---------------------------------------------------------
+// CPosClient::MakeRequest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPosClient::MakeRequest()
+    {
+    _LIT(KContact, "11111");
+    _LIT(KService, "SAAA");
+
+    //TPositionInfo moduleInfo = TPositionInfo();
+
+    CRequestor* contactId = 
+      CRequestor::New(CRequestor::ERequestorContact, 
+      CRequestor::EFormatTelephone, KContact);
+    
+    CRequestor* servId = 
+      CRequestor::New(CRequestor::ERequestorService, 
+      CRequestor::EFormatApplication, KService);
+    
+    RRequestorStack stack = RRequestorStack();
+    stack.Append(contactId);
+    stack.Append(servId);
+    
+    CleanupStack::PushL(contactId);
+    CleanupStack::PushL(servId);
+    
+    TInt err = iPositioner.SetRequestor(stack);
+    // what to do with err ???
+    
+    if (err)
+      {
+      // Do something here?
+      }
+    stack.Close();
+    
+    CleanupStack::PopAndDestroy(servId);
+    CleanupStack::PopAndDestroy(contactId);
+    
+    iStartTime.UniversalTime();
+
+    iPositioner.NotifyPositionUpdate(iModuleInfo, iStatus);
+    SetActive();
+    }
+
+// ---------------------------------------------------------
+// CPosClient::RunL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPosClient::RunL()
+    {
+    if (iStatus == KErrNone)
+        {
+        TTime now;
+        now.UniversalTime();
+        iRequestTime = now.MicroSecondsFrom(iStartTime);
+
+        iParent->HandleRequestDone();
+        }
+    else
+        {
+        _LIT(KErr, "iStatus != KErrNone");
+        RDebug::Print(KErr);
+        iParent->HandleRequestDone();
+        }
+    }
+
+// ---------------------------------------------------------
+// CPosClient::DoCancel
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPosClient::DoCancel()
+    {
+    iPositioner.CancelRequest(EPositionerNotifyPositionUpdate); // Specified in LbsIpc.h
+    TTime now;
+    now.UniversalTime();
+    iRequestTime = now.MicroSecondsFrom(iStartTime);
+    }
+
+// ---------------------------------------------------------
+// CPosClient::GetResult
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPosClient::GetResult(
+    TInt& aStatus, 
+    TPositionInfo& aModuleInfo,
+    TTimeIntervalMicroSeconds& aRequestTime)
+    {
+    aStatus = iStatus.Int();
+    aModuleInfo = iModuleInfo;
+    aRequestTime = iRequestTime;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsposclientholder.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,224 @@
+// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsposclientholder.h"
+#include "ctlbsposclient.h"
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CT_LbsPosClientHolder::CT_LbsPosClientHolder() 
+: CActive(EPriorityHigh), iRequestsActive(EFalse), iCancelTime(0)
+    {
+    }
+
+// ---------------------------------------------------------
+// CT_LbsPosClientHolder::ConstructL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPosClientHolder::ConstructL(TInt aRequestCount, TUid aPsy, TBool aSameServer) 
+    {
+    User::LeaveIfError(iTimer.CreateLocal());
+    CActiveScheduler::Add(this);
+    User::LeaveIfError(iPosServer.Connect());
+    CT_LbsPosClient* requester = NULL;
+    for (TInt i = 0; i < aRequestCount; i++)
+        {
+        if (aSameServer)
+            {
+            requester = CT_LbsPosClient::NewL(this, aPsy,iPosServer);
+            }
+        else
+            {
+            requester = CT_LbsPosClient::NewL(this, aPsy);
+            }
+        CleanupStack::PushL(requester);
+        User::LeaveIfError(iRequesters.Append(requester));
+        CleanupStack::Pop(requester);
+        }
+    }
+
+// ---------------------------------------------------------
+// CT_LbsPosClientHolder::NewLC
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+CT_LbsPosClientHolder* CT_LbsPosClientHolder::NewLC(TInt aRequestCount, TUid aPsy, TBool aSameServer) 
+    {
+    CT_LbsPosClientHolder* self = new (ELeave) CT_LbsPosClientHolder;
+    CleanupStack::PushL(self);
+    self->ConstructL(aRequestCount, aPsy, aSameServer);
+    return self;
+    }
+     
+
+
+// Destructor
+CT_LbsPosClientHolder::~CT_LbsPosClientHolder()
+    {
+    Cancel();
+    iTimer.Close();
+    iRequesters.ResetAndDestroy();
+    iRequesters.Close();
+    iRequestersWhoWillCancel.Close();
+    iPosServer.Close();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsPosClientHolder::MakeRequests
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPosClientHolder::MakeRequests()
+    {
+    if (iRequestsActive)
+        {
+        return;
+        }
+    iRequestsActive = ETrue;
+    TInt requesterCount = iRequesters.Count();
+    iNofRequestsDone = 0;
+    for (TInt i = 0; i < requesterCount; i++)
+        {
+        iRequesters[i]->MakeRequest();
+        }
+
+    // initiate cancelling if this is set.
+    if (iRequestersWhoWillCancel.Count() > 0)
+        {
+        iTimer.After(iStatus, iCancelTime);
+        SetActive();
+        }
+
+    CActiveScheduler::Start();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsPosClientHolder::HandleRequestDone
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPosClientHolder::HandleRequestDone()
+    {
+    iNofRequestsDone++;
+    if (iNofRequestsDone == iRequesters.Count())
+        {
+        iRequestsActive = EFalse;
+        CActiveScheduler::Stop();
+        }
+    }
+
+// ---------------------------------------------------------
+// CT_LbsPosClientHolder::RunL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPosClientHolder::RunL()
+    {
+    // Cancel certain requests.
+    TInt nofRequestersWhoWillCancel = iRequestersWhoWillCancel.Count();
+    for (TInt i = 0; i < nofRequestersWhoWillCancel; i++)
+        {
+        iRequesters[iRequestersWhoWillCancel[i]]->Cancel();
+        HandleRequestDone();
+        }
+    }
+
+// ---------------------------------------------------------
+// CT_LbsPosClientHolder::DoCancel
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPosClientHolder::DoCancel()
+    {
+    iTimer.Cancel();
+    }
+
+void CT_LbsPosClientHolder::StopRequests()
+    {
+    if (!iRequestsActive)
+        {
+        return;
+        }
+    Cancel();
+    TInt requesterCount = iRequesters.Count();
+    for (TInt i = 0; i < requesterCount; i++)
+        {
+        iRequesters[i]->Cancel();
+        }
+    CActiveScheduler::Stop();
+    iRequestsActive = EFalse;
+    }
+
+// ---------------------------------------------------------
+// CT_LbsPosClientHolder::GetResult
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPosClientHolder::GetResult(
+            TInt& aStatus, 
+            TPositionInfo& aModuleInfo,
+            TTimeIntervalMicroSeconds& aRequestTime,
+            TInt aRequesterIndex)
+    {
+    iRequesters[aRequesterIndex]->GetResult(aStatus, aModuleInfo, aRequestTime);
+    }
+
+
+
+// ---------------------------------------------------------
+// CT_LbsPosClientHolder::SetRequesterWillCancelL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPosClientHolder::SetCancelTime(TTimeIntervalMicroSeconds32 aTimeInterval)
+	{
+	iCancelTime = aTimeInterval;
+	}
+
+// ---------------------------------------------------------
+// CT_LbsPosClientHolder::SetRequesterWillCancelL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsPosClientHolder::SetRequesterWillCancelL(TInt aIndex)
+    {
+    TInt length = iRequestersWhoWillCancel.Count();
+    for (TInt i = 0; i < length; i++)
+        {
+        if (iRequestersWhoWillCancel[i] == aIndex) return;
+        }
+    User::LeaveIfError(iRequestersWhoWillCancel.Append(aIndex));
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsrequester.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,261 @@
+// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+// INCLUDE FILES
+#include "ctlbsrequester.h"
+#include "mctlbsrequestobserver.h"
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// Two-phased constructor.
+CT_LbsRequester* CT_LbsRequester::NewL(
+    TUid                	aPsyUid,
+    MCT_LbsRequestObserver*	aObserver,
+    CTestExecuteLogger&		aLogger
+    )
+    {
+    CT_LbsRequester* self = new (ELeave) CT_LbsRequester(aObserver);
+    CleanupStack::PushL(self);
+    self->ConstructL(aPsyUid, aLogger);
+    CleanupStack::Pop();
+    return self;
+    }
+
+// Two-phased constructor.
+CT_LbsRequester* CT_LbsRequester::NewL(
+    MCT_LbsRequestObserver*   aObserver,
+    TTimeIntervalMicroSeconds aInterval,
+    CTestExecuteLogger&		aLogger
+    )
+    {
+    CT_LbsRequester* self = new (ELeave) CT_LbsRequester(aObserver);
+    CleanupStack::PushL(self);
+    self->ConstructL(aInterval, aLogger);
+    CleanupStack::Pop();
+    return self;
+    }
+
+// Destructor
+CT_LbsRequester::~CT_LbsRequester()
+    {
+    iObserver = NULL;
+    Cancel();
+    iPositioner.Close();
+    iPosServer.Close();
+    }
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CT_LbsRequester::CT_LbsRequester(
+    MCT_LbsRequestObserver*   aObserver)
+    : CActive(EPriorityStandard), iObserver(aObserver)
+    {
+    }
+
+// EPOC default constructor can leave.
+void CT_LbsRequester::ConstructL(
+     TUid        aPsyUid,
+     CTestExecuteLogger&		aLogger
+     )
+	{
+    iLogger = aLogger;
+    User::LeaveIfError(iPosServer.Connect());
+    iModuleInfo = TPositionInfo();
+    iCompletionCode = KErrNone;
+    User::LeaveIfError(iPositioner.Open(iPosServer, aPsyUid));
+    _LIT(KService, "SAAA");
+    iPositioner.SetRequestor(CRequestor::ERequestorService,
+                             CRequestor::EFormatApplication,
+                             KService);
+    CActiveScheduler::Add(this);
+    }
+
+void CT_LbsRequester::ConstructL(
+    TTimeIntervalMicroSeconds aInterval,
+    CTestExecuteLogger&		aLogger
+    )
+	{
+	iLogger = aLogger;
+    User::LeaveIfError(iPosServer.Connect());
+    iModuleInfo = TPositionInfo();
+    iCompletionCode = KErrNone;
+    User::LeaveIfError(iPositioner.Open(iPosServer));
+    TPositionUpdateOptions posOption;
+	posOption.SetUpdateInterval(aInterval);
+    User::LeaveIfError(iPositioner.SetUpdateOptions(posOption));
+    _LIT(KService, "SAAA");
+    iPositioner.SetRequestor(CRequestor::ERequestorService,
+                             CRequestor::EFormatApplication,
+                             KService);
+    CActiveScheduler::Add(this);
+    }
+
+// ---------------------------------------------------------
+// CT_LbsRequester::CompletionTimeUTC
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+const TTime& CT_LbsRequester::CompletionTimeUTC() const
+    {
+    return iCompletionTimeUTC;
+    }
+
+// ---------------------------------------------------------
+// CT_LbsRequester::CompletionCode
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt CT_LbsRequester::CompletionCode() const
+    {
+    return iCompletionCode;
+    }
+
+// ---------------------------------------------------------
+// CT_LbsRequester::StartRequest
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsRequester::SetUpdateIntervalL(TTimeIntervalMicroSeconds aInterval)
+    {	
+	TPositionUpdateOptions posOption;
+	posOption.SetUpdateInterval(aInterval);	
+    User::LeaveIfError(iPositioner.SetUpdateOptions(posOption));
+    }
+
+// ---------------------------------------------------------
+// CT_LbsRequester::StartRequest
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+void CT_LbsRequester::StartRequest()
+    {    
+    iPositioner.NotifyPositionUpdate(iModuleInfo, iStatus);
+    SetActive();
+    }
+
+// LOCAL FUNCTIONS
+void CleanOpRequestorStack(TAny* aAnArray)
+    {
+    // Cleanup function the requestor stack
+    RRequestorStack* theStack = reinterpret_cast <RRequestorStack*> (aAnArray);
+    theStack->ResetAndDestroy();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsRequester::SetRequestorStackL
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt CT_LbsRequester::SetRequestorStackL(const TDesC& aService, const TDesC& aContact)
+	{
+	CRequestor* contactId = 
+		CRequestor::New(CRequestor::ERequestorContact, CRequestor::EFormatTelephone, 
+                    aContact);
+    
+    CRequestor* servId = 
+        CRequestor::New(CRequestor::ERequestorService, CRequestor::EFormatApplication, 
+        aService);
+
+    // Create a requestor stack containing one contact and one service (the service must be last added)
+    RRequestorStack stack = RRequestorStack();
+    CleanupStack::PushL(TCleanupItem(CleanOpRequestorStack ,&stack));
+    stack.Append(contactId);
+    stack.Append(servId);
+    
+    CleanupStack::PushL(contactId);
+    CleanupStack::PushL(servId);
+
+    TInt err = iPositioner.SetRequestor(stack);
+        
+    CleanupStack::PopAndDestroy(servId);
+    CleanupStack::PopAndDestroy(contactId);
+    stack.Close();
+    CleanupStack::PopAndDestroy(1); // CleanOpTp226 stack
+
+	return err;
+	}
+
+// ---------------------------------------------------------
+// CT_LbsRequester::RunL
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsRequester::RunL()
+    {
+    iCompletionCode = iStatus.Int();
+    iCompletionTimeUTC.UniversalTime();
+    RequestComplete();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsRequester::DoCancel
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsRequester::DoCancel()
+    {
+    iPositioner.CancelRequest(EPositionerNotifyPositionUpdate);
+    iCompletionTimeUTC.UniversalTime();
+    RequestComplete();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsRequester::RequestComplete
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsRequester::RequestComplete()
+    {
+    if (iObserver)
+        {
+        TRAPD(err, iObserver->RequestCompleteL());
+        if(KErrNone != err)
+        	{
+        	_LIT(KRequestCompleteError, "Error in LbsRequester: %d");
+        	ERR_PRINTF2(KRequestCompleteError, err);
+        	}
+        }
+    }
+
+void CT_LbsRequester::GetPositionInfo(
+            TPositionInfo& aModuleInfo)
+    {
+    aModuleInfo = iModuleInfo;
+    }
+
+// ---------------------------------------------------------
+// CT_LbsRequester::SetUpdateType
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsRequester::SetUpdateType(const TInt& aUpdateType)
+    {	
+    iModuleInfo.SetUpdateType(aUpdateType); 
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsserver.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,221 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsServer.cpp
+// This is the class implementation for the LBS  Test Server
+// 
+//
+
+// User includes
+#include "ctlbsserver.h"
+
+// System includes
+#include <e32std.h>
+#include <rsshared.h>
+
+// Header files of LBS  API Test Steps
+#include "ctlbsstepinstallscheduler.h"
+#include "ctlbsstepcreateverifymoduledata.h"
+#include "ctlbsstepcreateverifyposinfos.h"
+#include "ctlbsstepverifyposinfos.h"
+#include "ctlbsstepverifyroughposinfos.h"
+#include "ctlbsstepverifymodinfo.h"
+#include "ctlbsstepverifyloginfo.h"
+#include "ctlbsstepverifymodstatus.h"
+#include "ctlbsstepsetautonomousmode.h"
+#include "ctlbsstepsetprivhandler.h"
+#include "ctlbsstepresetdefaultadmin.h"
+#include "ctlbsstepstartlbs.h"
+#include "ctlbsstepstoplbs.h"
+#include "ctlbsstepcreateverifymodinfo.h"
+#include "ctlbsstepclearlog.h"
+#include "ctlbsstepconfighybridmodule.h"
+#include "ctlbsstepsetupstandaloneprivacymode.h"
+#include "ctlbsstepsetupstandaloneprivacyandsimplectlr.h"
+#include "ctlbsstepsetupstandaloneprivacywithnoctlr.h"
+#include "ctlbsstepsetbehaviourmodeoriginal.h"
+#include "ctlbsstepsetptamode.h"
+#include "ctlbsstepsetatamode.h"
+#include "ctlbsstepsetptbmode.h"
+
+CT_LbsServer::~CT_LbsServer()
+	{
+	delete iSharedData;
+	delete iScheduler;
+	}
+	
+	
+/**
+  Function : CT_LbsServer
+  Description : Constructor
+  @internalTechnology
+  @param :
+  @return : N/A
+  @precondition : none
+  @postcondition : none
+*/
+CT_LbsServer::CT_LbsServer()
+	{
+	}
+
+/**
+  Function : ConstructL
+  Description : 
+  @internalTechnology
+  @param :
+  @return : N/A
+  @precondition : none
+  @postcondition : none
+*/
+void CT_LbsServer::ConstructL(const TDesC& aName)
+	{
+	CTestServer::ConstructL(aName);
+
+	iScheduler = new (ELeave) CActiveScheduler();
+
+	// check what this does, do we need it...	
+	Logger().ShareAuto();	// enable the log system for all test threads via iParent.Logger()
+	}
+
+	
+/**
+  Function : CreateTestStep
+  Description : Creates a test step based on the step name read from the script file
+  @internalTechnology
+  @param : aStepName   The step name which needs to be created
+  @return : Created object of type CTestStep
+  @precondition : none
+  @postcondition : none
+*/
+CTestStep* CT_LbsServer::CreateTestStep(const TDesC& aStepName)
+	{
+	// NULL if insufficient memory. This suits the API.
+
+	// Common test steps, used by many different test cases.
+	if (aStepName == KLbsStep_InstallScheduler)
+		{
+		return CT_LbsStep_InstallScheduler::New(*this);
+		}
+
+	if (aStepName == KLbsStep_CreateVerifyModuleData)
+		{
+		return CT_LbsStep_CreateVerifyModuleData::New(*this);
+		}
+
+	if (aStepName == KLbsStep_CreateVerifyPosInfos)
+		{
+		return CT_LbsStep_CreateVerifyPosInfos::New(*this);
+		}
+
+	if (aStepName == KLbsStep_CreateVerifyModInfo)
+		{
+		return CT_LbsStep_CreateVerifyModInfo::New(*this);
+		}
+	
+	if (aStepName == KLbsStep_VerifyPosInfos)
+		{
+		return CT_LbsStep_VerifyPosInfos::New(*this);
+		}
+
+	if (aStepName == KLbsStep_VerifyRoughPosInfos)
+		{
+		return CT_LbsStep_VerifyRoughPosInfos::New(*this);
+		}
+
+	if(aStepName == KLbsStep_VerifyModInfo)	
+		{
+		return CT_LbsStep_VerifyModInfo::New(*this);
+		}
+
+	if (aStepName == KLbsStep_VerifyLogInfo)
+		{
+		return CT_LbsStep_VerifyLogInfo::New(*this);
+		}
+		
+	if (aStepName == KLbsStep_VerifyModuleStatus)
+		{
+		return CT_LbsStep_VerifyModStatus::New(*this);
+		}										
+  		
+  	if (aStepName == KLbsStep_StartLbs)
+  		{
+  		return CT_LbsStep_StartLbs::New(*this);
+  		}
+  		
+  	if (aStepName == KLbsStep_StopLbs)
+  		{
+  		return CT_LbsStep_StopLbs::New(*this);
+  		}						
+		
+	if (aStepName == KLbsStep_SetAutonomousMode)
+		{
+		return CT_LbsStep_SetAutonomousMode::New(*this);
+		}
+		
+	if (aStepName == KLbsStep_SetPrivacyHandler)
+		{
+		return CT_LbsStep_SetPrivacyHandler::New(*this);
+		}		
+		
+	if (aStepName == KLbsStep_ResetDefaultAdmin)
+		{
+		return CT_LbsStep_ResetDefaultAdmin::New(*this);
+		}		
+		
+	if (aStepName == KLbsStep_ClearLog)
+		{
+		return CT_LbsStep_ClearLog::New(*this);
+		}
+	
+	if (aStepName == KLbsStep_SetBehaviourModeOriginal)
+		{
+		return CT_LbsStep_SetBehaviourModeOriginal::New(*this);
+		}		
+    
+	if (aStepName == KLbsStep_SetPTAMode)
+		{
+		return CT_LbsStep_SetPTAMode::New(*this);
+		}		
+    
+    if (aStepName == KLbsStep_ConfigHybridModule)
+    	{
+    	return CT_LbsStep_ConfigHybridModule::New(*this);
+    	}
+      
+    if (aStepName == KLbsStep_SetupStandalonePrivacyMode)
+    	{
+    	return CT_LbsStep_SetupStandalonePrivacyMode::New(*this);
+    	}
+      
+    if (aStepName == KLbsStep_SetupStandalonePrivacyAndSimpleCtlr)
+    	{
+    	return CT_LbsStep_SetupStandalonePrivacyAndSimpleCtlr::New(*this);
+    	}
+      
+    if (aStepName == KLbsStep_SetupStandalonePrivacyWithNoCtlr)
+    	{
+    	return CT_LbsStep_SetupStandalonePrivacyWithNoCtlr::New(*this);
+    	}
+
+   	if (aStepName == KLbsStep_SetATAMode)
+		{
+		return CT_LbsStep_SetATAMode::New(*this);
+		}	
+   	
+   	if (aStepName == KLbsStep_SetPTBMode)
+		{
+		return CT_LbsStep_SetPTBMode::New(*this);
+		}   	
+      
+	return NULL;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsshareddata.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,111 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsSharedData.cpp
+// This file contains the shared data class for the Lbs  Test server
+// 
+//
+
+
+#include "ctlbsshareddata.h"
+
+/**
+  Function : NewL
+  Description : Constructor
+  @internalTechnology
+  @param :
+  @return : N/A
+  @precondition : none
+  @postcondition : none
+*/
+CT_LbsSharedData* CT_LbsSharedData::NewL()
+	{
+	CT_LbsSharedData* sharedData=new(ELeave) CT_LbsSharedData();
+	CleanupStack::PushL(sharedData);
+	sharedData->ConstructL();
+	CleanupStack::Pop(sharedData);
+
+	return sharedData;
+	}
+
+
+/**
+  Function : ConstructL
+  Description : Constructor
+  @internalTechnology
+  @param :
+  @return : N/A
+  @precondition : none
+  @postcondition : none
+*/
+void CT_LbsSharedData::ConstructL()
+	{
+	}
+
+
+/**
+  Function : CT_LbsSharedData
+  Description : Constructor
+  @internalTechnology
+  @param :
+  @return : N/A
+  @precondition : none
+  @postcondition : none
+*/
+CT_LbsSharedData::CT_LbsSharedData()
+	{
+	iTestModuleInUse = ETrue; // Default is to use the test module.
+	}
+	
+/**
+  Function : ~CT_LbsSharedData
+  Description : Destructor
+  @internalTechnology
+  @param :
+  @return : N/A
+  @precondition : none
+  @postcondition : none
+*/	
+CT_LbsSharedData::~CT_LbsSharedData()
+	{
+	// Clear arrays.
+	for (TInt i = 0; i < iVerifyPosInfoArr.Count(); ++i)
+		delete iVerifyPosInfoArr[i];
+	iVerifyPosInfoArr.Close();
+
+	for (TInt i = 0; i < iCurrentPosInfoArr.Count(); ++i)
+		delete iCurrentPosInfoArr[i];
+	iCurrentPosInfoArr.Close();
+		
+	//Clear logging arays
+	for (TInt i = 0; i < iSelfLocateLogInfoArr.Count(); ++i)
+		delete iSelfLocateLogInfoArr[i];	
+	iSelfLocateLogInfoArr.Close();
+	
+	for (TInt i = 0; i < iNetworkLocateLogInfoArr.Count(); ++i)
+		delete iNetworkLocateLogInfoArr[i];	
+	iNetworkLocateLogInfoArr.Close();
+	
+	for (TInt i = 0; i < iExternalLocateLogInfoArr.Count(); ++i)
+		delete iExternalLocateLogInfoArr[i];	
+	iExternalLocateLogInfoArr.Close();
+	
+	for (TInt i = 0; i < iX3PLocateLogInfoArr.Count(); ++i)
+		delete iX3PLocateLogInfoArr[i];	
+	iX3PLocateLogInfoArr.Close();
+	
+	for (TInt i = 0; i < iAssistanceDataLogInfoArr.Count(); ++i)
+		delete iAssistanceDataLogInfoArr[i];	
+	iAssistanceDataLogInfoArr.Close();
+	
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,67 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsStep.cpp
+// This is the class implementation for the LBS  Test Step Base
+// 
+//
+
+#include "ctlbsstep.h"
+
+#include "tlbsutils.h"
+#include "ctlbsasyncwaiter.h"
+
+
+/**
+ * @return - TVerdict
+ * Implementation of CTestStep base class virtual
+ * It is used for doing all initialisation common to derived classes in here.
+ * Make it being able to leave if there are any errors here as there's no point in
+ * trying to run a test step if anything fails.
+ * The leave will be picked up by the framework.
+ */
+TVerdict CT_LbsStep::doTestStepPreambleL()
+	{
+	// Process some common pre setting to test steps then set SetTestStepResult to EFail or Epass.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep::doTestStepPreambleL()"));
+	SetTestStepResult(EPass);
+
+	return TestStepResult();
+	}
+
+
+/**
+ * @return - TVerdict
+ * Implementation of CTestStep base class virtual
+ * It is used for doing all after test treatment common to derived classes in here.
+ * Make it being able to leave
+ * The leave will be picked up by the framework.
+ */
+TVerdict CT_LbsStep::doTestStepPostambleL()
+	{
+	// Process some common post setting to test steps then set SetTestStepResult to EFail or Epass.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep::doTestStepPostabmleL()"));
+
+	//SetTestStepResult(EPass);  // or EFail
+	return TestStepResult();
+	}
+
+
+CT_LbsStep::~CT_LbsStep()
+	{
+	}
+
+
+CT_LbsStep::CT_LbsStep(CT_LbsServer& aParent) : iParent(aParent)
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepclearlog.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,145 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstepclearlog.cpp
+// This is the class implementation to clear the log file
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+		  
+#include "ctlbsstepclearlog.h"
+
+
+CT_LbsStep_ClearLog::CT_LbsStep_ClearLog(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_ClearLog);
+	}
+
+/**
+Static Constructor
+*/
+CT_LbsStep_ClearLog* CT_LbsStep_ClearLog::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_ClearLog(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+/**
+@pre 	
+@return Test verdict
+@post	Log file cleared
+*/
+ 
+TVerdict CT_LbsStep_ClearLog::doTestStepL()
+	{
+	SetTestStepResult(EPass);
+
+	// Create necessary variables for Log reading
+	RFs theFs;
+	CLogClient* client;
+	CLogViewEvent* view;
+	CT_LbsAsyncWaiter* activeWaiter;
+		
+	//	Initialise variables
+	TInt ErrorCode = theFs.Connect();
+	if(ErrorCode)
+		{
+		INFO_PRINTF1(_L("\t Error: Open FileServer failed."));
+		SetTestStepResult(EFail);
+		}
+		
+
+    client = CLogClient::NewL(theFs, CActive::EPriorityStandard);
+	view = CLogViewEvent::NewL(*client, CActive::EPriorityStandard);
+	activeWaiter = CT_LbsAsyncWaiter::NewL();			// NEW activeWaiter
+	
+	
+	// Setup a time in the future, before which all events will be deleted
+ 	_LIT(KDateCorrect1,"20900101:"); 
+ 	TTime time;
+	TBuf <10> theDate(KDateCorrect1);
+	TInt err=time.Set(theDate); 
+	
+	// Ensure time has been set correctly
+	if(err != KErrNone)
+		{
+		INFO_PRINTF1(_L("Failed to set time"));
+		}
+		
+	if(err == KErrGeneral)
+		{
+		INFO_PRINTF1(_L("Time syntax is incorrect"));
+		}
+	
+	// Set the filter to view ALL logs
+	CLogFilter* filter = CLogFilter::NewL();			// NEW FILTER
+	CleanupStack::PushL(filter);
+	TBool res = view->SetFilterL(*filter, activeWaiter->iStatus);
+	if (res == EFalse)
+		{
+		INFO_PRINTF1(_L("\t No such events to filter in the view."));
+		client->Cancel();
+		}
+	else
+		{
+		// else If there are logs, flush them
+			
+		// Cancel outstanding requests
+		client->Cancel();	
+		activeWaiter->StartAndWait();
+		if (activeWaiter->iStatus != KErrNone)
+			{
+			INFO_PRINTF2(_L("\t Error: Cancel returned error %d."),activeWaiter->iStatus.Int());
+			SetTestStepResult(EFail);
+			}
+
+		// Clear ALL logs
+		client->ClearLog(time, activeWaiter->iStatus);
+		activeWaiter->StartAndWait();
+		if (activeWaiter->iStatus != KErrNone)
+			{
+			INFO_PRINTF2(_L("\t Error: Clear log returned error %d."),activeWaiter->iStatus.Int());
+			SetTestStepResult(EFail);
+			}	
+			
+		//Confirm log is cleared
+		if(view->CountL() != 0)
+			{
+			INFO_PRINTF2(_L("<FONT><B>ERROR: Log still has %d entries</B></FONT>"),view->CountL());
+			SetTestStepResult(EFail);
+			}
+				
+		}
+	
+	CleanupStack::PopAndDestroy(filter);	
+		
+	// Cleanup everything
+	view->Cancel();
+	client->Cancel();
+
+	delete view;
+	delete client;
+	theFs.Close();
+	delete activeWaiter;
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepconfighybridmodule.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,282 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is the class implementation for the configuration of the AGPS Hybrid Module
+// The main purpose of this test step is to allow flexible configurability of the AGps Hybrid Module
+// from the Test Harness.
+// Various configuration options are read from the ini files and sent to the AGps Hybrid Module through the TH channel.
+// The AGps Hybrid Module always acknowledges each configuration message (see ProcessAGpsResponseMessage() method below).
+// This test step has been written to understand '.ini' files containing sections such as [Config2] below:
+// [Config2]
+// agps_module_update_file = c:\testdata\configs\lbs_molr.ini
+// agps_module_multi_updates_opt = on
+// agps_module_assistance_data_opt= on
+// $update,1,2,49.2,NAN,NAN,2,3*
+// $update,1,2,49.2,NAN,NAN,2,3*
+// $update,1,2,49.2,3.5,50,2,3*
+// => Current module possible options are:
+// agps_module_multi_updates_opt = [ on | off ]
+// It sets the module to send multiple updates after Target Time.
+// - When this mode is "off" only one update is sent just after 'Target time' (that is, the next update item available 
+// from the module's update array).
+// - When this mode is "on", the module sends N + 1 updates between 'Target time' and 'Max fix time'
+// (currently hardcoded -> N = 2).
+// The final update is the next update item available from the module's update array.
+// The module calculates the first N updates from the final update, these updates contain incomplete
+// positions (NAN longitude and latitude, ...). 
+// Note:'Target time' specifies the time when the location update should be provided by the AGPS module.
+// 'Max fix time' specifies the time maximum time the module should spend calculating the current location.
+// agps_module_assistance_data_opt = [ on | off ]
+// Only applicable when in Preferred Terminal Mode. 
+// - When this mode is "on", for each new location request the AGps Module may Request new Assistance Data
+// (if it has not been delivered already, sometimes assistance data is delivered to the module before it is requested).
+// - When this mode is off, the default RequestAssistanceData(EAssistanceDataNone) call will always be made.		
+// agps_module_dynamic_ass_data_opt = [ on | off ] (off by default)
+// Switches between different assistance data delivery methods:
+// -> OFF - On the first RequestAssistanceData requests the assistance data aDataMask is always set to
+// the assistance data that it needs.  However for all subsequent assistance data requests the
+// aDataMask will always be set to 0.  This is the method used in all the hybrid tests.
+// -> ON - Here the module will always request any assistance data that it has not yet received. So on
+// the first assistanceData request the aDataMask is set to the assistance data it requires.  On
+// subsequent assistance data requests it will re-request the assistance data that has not yet
+// been delivered.  This is the method that should be used in SUPL tests.
+// agps_module_clear_all_opt = [ on | off ]
+// Sets all the possible module options to on.
+// agps_module_set_all_opt = [ on | off ]
+// Sets all the possible module options to off.
+// => $update command: 
+// The $update entries in the ini files are used to populate the AGps Hybrid Module update array.
+// Note: The Module's update array contains the update items used to generate the updates sent to the AGps Manager.
+// The $update command syntax should be as follows:
+// $update,num_of_updates,[num_of_measurements],[latitude],[longitude],[altitude],[horz_accuracy],[vert_accuracy],[update_err]*
+// - where num_of_updates is the number of updates to add to the update array. For values greater than 1, each update
+// will contain the same data position and measurement data as defined by the reminder of the sentence.
+// - where num_of_measurements is the number of satellite measurements to define (see TPositionGpsMeasurementData). 
+// If this value is 0 no measurement data is defined and only the position data is defined. 
+// Values for the actual measurement data will be generated automatically.
+// - where latitude, longitude, altitude, horz_accuracy, vert_accuracy are used to define the values for the 
+// TPositionInfo part of the TPositionSatelliteInfo.
+// - where update_err, is the error code to return to the manager for the update. If NOT defined the value will be KErrNone.
+// => Possible Enhancements: This test step might be enhanced later on to also additional functionality such as:
+// agps_module_update_error = -1
+// agps_module_update_timeout = 5000000
+// agps_module_multi_updates_opt = 2	// where 2 is the number of multi updates sent before  
+// // the final update is sent prior to 'Max fix time'
+// 
+//
+
+
+ 
+#include "ctlbsstepconfighybridmodule.h"
+
+#include "tlbsutils.h"
+
+
+_LIT(KUpdateFile, "agps_module_update_file");
+_LIT(KClearAllOpt, "agps_module_clear_all_opt");
+_LIT(KAssistanceDataOpt, "agps_module_assistance_data_opt");
+_LIT(KMultiUpdateOpt, "agps_module_multi_updates_opt");
+_LIT(KReqAssDatReqOpt, "agps_module_req_ass_data_req_opt");
+_LIT(KSetAllOpt, "agps_module_set_all_opt");
+_LIT(KSuplAssDataOpt, "agps_module_dynamic_ass_data_opt");
+_LIT(KUpdateTimeout, "agps_module_update_timeout");
+_LIT(KOption_OFF, "off");
+_LIT(KOption_ON, "on");
+_LIT(KNoFileName, "");
+
+
+/**
+ * Constructor
+ */
+CT_LbsStep_ConfigHybridModule::CT_LbsStep_ConfigHybridModule(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_ConfigHybridModule);
+	}
+
+
+/**
+Static Constructor
+*/
+CT_LbsStep_ConfigHybridModule* CT_LbsStep_ConfigHybridModule::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_ConfigHybridModule(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+/**
+ * @return - TVerdict code
+ * Override of base class virtual
+ */
+TVerdict CT_LbsStep_ConfigHybridModule::doTestStepPreambleL()
+	{
+	INFO_PRINTF1(_L("Test Preamble. CT_LbsStep_ConfigHybridModule"));
+
+	// create the test channel handler
+	iAGpsHandler = CT_LbsAGpsHandler::NewL(this);
+	
+	SetTestStepResult(EPass);
+	return TestStepResult();
+	}
+
+/**
+ * @return - TVerdict code
+ * Override of base class virtual
+ */
+TVerdict CT_LbsStep_ConfigHybridModule::doTestStepPostambleL()
+	{
+	INFO_PRINTF1(_L("Test Postamble. CT_LbsStep_ConfigHybridModule"));
+
+	delete iAGpsHandler;
+	iAGpsHandler = NULL;
+		
+	return TestStepResult();
+	}
+	
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsStep_ConfigHybridModule::doTestStepL()
+	{
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_ConfigHybridModule::doTestStepL()")); // ??
+
+	if (TestStepResult() == EPass)
+		{
+		TPtrC configFileName;
+		GetStringFromConfig(ConfigSection(), KUpdateFile, configFileName);
+		if (configFileName != KNoFileName)
+			{
+			iConfigCtr++;
+			iAGpsHandler->SendRequestUpdateInitMsg(configFileName, ConfigSection());		
+			}
+						
+		TPtrC clearAllOpt;
+		GetStringFromConfig(ConfigSection(), KClearAllOpt, clearAllOpt);
+		if (clearAllOpt == KOption_ON)
+			{
+			iConfigCtr++;
+			iAGpsHandler->SendRequestClearAllModuleOptions();
+			}
+
+		TPtrC updateOpt;
+		GetStringFromConfig(ConfigSection(), KMultiUpdateOpt, updateOpt);
+		if (updateOpt == KOption_OFF)
+			{
+			iConfigCtr++;
+			iAGpsHandler->SendRequestModuleOption(ELbsHybridModuleOptions_MultiUpdatesOn, EFalse);
+			}
+		else if (updateOpt == KOption_ON)
+			{
+			iConfigCtr++;
+			iAGpsHandler->SendRequestModuleOption(ELbsHybridModuleOptions_MultiUpdatesOn, ETrue);
+			}
+			
+		TPtrC assDataOpt;
+		GetStringFromConfig(ConfigSection(), KAssistanceDataOpt, assDataOpt);
+		if (assDataOpt == KOption_OFF)
+			{
+			iConfigCtr++;
+			iAGpsHandler->SendRequestModuleOption(ELbsHybridModuleOptions_AssistanceDataOn, EFalse);
+			}
+		else if (assDataOpt == KOption_ON)
+			{
+			iConfigCtr++;
+			iAGpsHandler->SendRequestModuleOption(ELbsHybridModuleOptions_AssistanceDataOn, ETrue);
+			}
+
+
+		TPtrC reqAssDataOpt;
+		GetStringFromConfig(ConfigSection(), KReqAssDatReqOpt, reqAssDataOpt);
+		if (reqAssDataOpt == KOption_OFF)
+			{
+			iConfigCtr++;
+			iAGpsHandler->SendRequestModuleOption(ELbsHybridModuleOptions_DisableReqAssistData, EFalse);
+			}
+		else if (reqAssDataOpt == KOption_ON)
+			{
+			iConfigCtr++;
+			iAGpsHandler->SendRequestModuleOption(ELbsHybridModuleOptions_DisableReqAssistData, ETrue);
+			}
+		
+		
+		TPtrC suplAssDataOpt;
+		GetStringFromConfig(ConfigSection(), KSuplAssDataOpt, suplAssDataOpt);
+		if (suplAssDataOpt == KOption_OFF)
+			{
+			iConfigCtr++;
+			iAGpsHandler->SendRequestModuleOption(ELbsHybridModuleOptions_DynamicAssistanceData, EFalse);
+			}
+		else if (suplAssDataOpt == KOption_ON)
+			{
+			iConfigCtr++;
+			iAGpsHandler->SendRequestModuleOption(ELbsHybridModuleOptions_DynamicAssistanceData, ETrue);
+			}
+
+
+
+		TPtrC setAllOpt;
+		GetStringFromConfig(ConfigSection(), KSetAllOpt, setAllOpt);
+		if (setAllOpt == KOption_ON)
+			{
+			iConfigCtr++;
+			iAGpsHandler->SendRequestSetAllModuleOptions();
+			}
+		TInt updateTimeout;
+		if (GetIntFromConfig(ConfigSection(), KUpdateTimeout, updateTimeout))
+			{
+			TTimeIntervalMicroSeconds timeoutVal(updateTimeout);
+			
+			iConfigCtr++;
+			iAGpsHandler->SendRequestTimeOutMsg(timeoutVal); 
+			}		
+
+		// All the configuration requests sent, now start the active scheduler
+		if (iConfigCtr)
+			{
+			CActiveScheduler::Start();
+			}
+		}
+	
+	
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_ConfigHybridModule::doTestStepL()"));	//??
+
+	return TestStepResult();
+	}
+
+
+void CT_LbsStep_ConfigHybridModule::ProcessAGpsResponseMessage(const TT_LbsAGpsResponseMsg::TModuleResponseType aResponse)
+	{
+	iConfigCtr--;
+
+	if (TT_LbsAGpsResponseMsg::EModuleResponseOk == aResponse)
+		{
+		// If any of the previous responses has failed do not override the verdict
+		if (iVerdict != EFail)
+			{
+			iVerdict = EPass;
+			}
+		}
+	else
+		{
+		iVerdict = EFail;
+		}
+	
+	if (!iConfigCtr)
+		{
+		SetTestStepResult(iVerdict);
+		CActiveScheduler::Stop();
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepcreateupdateinfo.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,67 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstep_createupdateinfo.cpp
+// This is the class implementation for the Notify Position Update Tests
+// 
+//
+ 
+#include "ctlbsstepcreateupdateinfo.h"
+
+#include "tlbsutils.h"
+
+
+_LIT(KUpdateInfoFile, "update_info_file");
+
+/**
+ * Constructor
+ */
+CT_LbsStep_CreateUpdateInfo::CT_LbsStep_CreateUpdateInfo(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_CreateUpdateInfo);
+	}
+
+
+/**
+Static Constructor
+*/
+CT_LbsStep_CreateUpdateInfo* CT_LbsStep_CreateUpdateInfo::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_CreateUpdateInfo(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsStep_CreateUpdateInfo::doTestStepL()
+	{
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_CreateUpdateInfo::doTestStepL()"));
+
+	if (TestStepResult() == EPass)
+		{
+		TPtrC configFileName;
+		GetStringFromConfig(ConfigSection(), KUpdateInfoFile, configFileName);
+		RPointerArray<TAny>& updateInfoArr = iParent.iSharedData->iUpdateArr;
+		//Populate the array by extracting the data from the ini file	
+		}
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_CreateUpdateInfo::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepcreateverifymodinfo.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,80 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstep_createverifymodinfo.cpp
+// This is the class implementation for the module info tests 
+// 
+//
+ 
+#include "ctlbsstepcreateverifymodinfo.h"
+
+#include "tlbsutils.h"
+
+//module_id in ini file
+_LIT(KLbsModuleId, "module_id");
+
+/**
+ * Constructor
+ */
+CT_LbsStep_CreateVerifyModInfo::CT_LbsStep_CreateVerifyModInfo(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_CreateVerifyModInfo);
+	}
+
+
+/**
+Static Constructor
+*/
+CT_LbsStep_CreateVerifyModInfo* CT_LbsStep_CreateVerifyModInfo::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_CreateVerifyModInfo(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsStep_CreateVerifyModInfo::doTestStepL()
+	{
+	// Helper test step used to Create the Verify Mod Information 
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_CreateVerifyModInfo::doTestStepL()"));
+
+	if (TestStepResult() == EPass)
+		{
+		TInt moduleid;
+		TBool moduleid_exists;
+		moduleid_exists = GetIntFromConfig(ConfigSection(), KLbsModuleId, moduleid);
+	    if(!moduleid_exists)
+			{
+			INFO_PRINTF1(_L("Could not get module Id from section"));
+    		SetTestStepResult(EFail);
+    		}
+	
+	    else
+		    {
+		    // Access the verify mod info and pass to utils func to be populated.
+			TPositionModuleInfo& modinfo = iParent.iSharedData->iVerifyModuleInfo;
+			T_LbsUtils utils;
+	        TPositionModuleId moduleUid = TUid::Uid(moduleid);
+	        utils.Create_ModuleInfoL(moduleUid,modinfo);		
+		    }
+	    }
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_CreateVerifyModInfo::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepcreateverifymoduledata.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,104 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstep_createverifymoduledata.cpp
+// This is the class implementation for the Notify Position Update Tests
+// 
+//
+ 
+#include "ctlbsstepcreateverifymoduledata.h"
+
+#include "tlbsutils.h"
+
+/**
+	"module_data_file" = name of the .ini file containing the module data items including
+	position info array entries, module stauts, module update options.
+
+	If the file name is not present the module data will contain default items.
+	See tlbsutils.cpp for details of support ini file commands.
+*/
+_LIT(KModuleDataFile, "module_data_file");
+
+/**
+ * Constructor
+ */
+CT_LbsStep_CreateVerifyModuleData::CT_LbsStep_CreateVerifyModuleData(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_CreateVerifyModuleData);
+	}
+
+
+/**
+Static Constructor
+*/
+CT_LbsStep_CreateVerifyModuleData* CT_LbsStep_CreateVerifyModuleData::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_CreateVerifyModuleData(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsStep_CreateVerifyModuleData::doTestStepL()
+	{
+	// Helper test step used to Create the Verify Position Information Array.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_CreateVerifyModuleData::doTestStepL()"));
+
+	if (TestStepResult() == EPass)
+		{
+		TPtrC configFileName;
+		GetStringFromConfig(ConfigSection(), KModuleDataFile, configFileName);
+
+		// Access the verify pos array and pass to utils func to be populated.
+		RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iVerifyPosInfoArr;
+		TPositionUpdateOptions& updateOpts = iParent.iSharedData->iVerifyUpdateOpts;
+		TPositionModuleStatus& modStatus = iParent.iSharedData->iVerifyModuleStatus;
+		T_LbsUtils utils;
+
+		// Populate the shared data items.
+		utils.GetConfigured_PosInfosL(configFileName, ConfigSection(), posInfoArr); // Note previous entries will be cleared.
+		utils.GetConfigured_ModuleStatusL(configFileName, ConfigSection(), modStatus);
+		utils.GetConfigured_ModuleUpdateOptionsL(configFileName, ConfigSection(), updateOpts);
+// remove aove module does not know abot update options...
+
+		// Notify the test module that it's required to update it's test data.
+		TPtrC modType;
+		GetStringFromConfig(ConfigSection(), KLbsModuleType, modType);
+		if (modType != KLbsModuleType_Real)
+			{
+			
+			TModuleDataIn modDataIn;
+			
+			modDataIn.iRequestType = TModuleDataIn::EModuleRequestConfig;
+			modDataIn.iConfigFileName = configFileName;
+			modDataIn.iConfigSection = ConfigSection();
+
+			// Now publish the ini file and section name to the test module - will block.
+			utils.NotifyModuleOfConfigChangeL(modDataIn);
+			}
+		else
+			{
+			iParent.iSharedData->iTestModuleInUse = EFalse;	// Indicate to test harness the real A-GPS integration module is being used.
+			}
+		}
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_CreateVerifyModuleData::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepcreateverifyposinfos.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,97 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstep_createverifyposinfos.cpp
+// This is the class implementation for the Notify Position Update Tests
+// 
+//
+ 
+#include "ctlbsstepcreateverifyposinfos.h"
+
+#include "tlbsutils.h"
+
+/**
+	"pos_infos_file" = name of the .ini file containing the position info array entries.
+
+	If the file name is not present the array will contain a single default TPositionInfo entry.
+	See tlbsutils.cpp for details of support ini file commands.
+*/
+_LIT(KPosInfosFile, "pos_infos_file");
+
+/**
+ * Constructor
+ */
+CT_LbsStep_CreateVerifyPosInfos::CT_LbsStep_CreateVerifyPosInfos(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_CreateVerifyPosInfos);
+	}
+
+
+/**
+Static Constructor
+*/
+CT_LbsStep_CreateVerifyPosInfos* CT_LbsStep_CreateVerifyPosInfos::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_CreateVerifyPosInfos(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsStep_CreateVerifyPosInfos::doTestStepL()
+	{
+	// Helper test step used to Create the Verify Position Information Array.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_CreateVerifyPosInfos::doTestStepL()"));
+
+	if (TestStepResult() == EPass)
+		{
+		TPtrC configFileName;
+		GetStringFromConfig(ConfigSection(), KPosInfosFile, configFileName);
+
+		// Access the verify pos array and pass to utils func to be populated.
+		RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iVerifyPosInfoArr;
+		T_LbsUtils utils;
+
+		utils.GetConfigured_PosInfosL(configFileName, ConfigSection(), posInfoArr); // Note previous entries will be cleared.
+
+		// Notify the test module that it's required to update it's test data.
+		TPtrC modType;
+		GetStringFromConfig(ConfigSection(), KLbsModuleType, modType);
+		if (modType != KLbsModuleType_Real)
+			{
+			
+			TModuleDataIn modDataIn;
+			
+			modDataIn.iRequestType = TModuleDataIn::EModuleRequestConfig;
+			modDataIn.iConfigFileName = configFileName;
+			modDataIn.iConfigSection = ConfigSection();
+
+			// Now publish the ini file and section name to the test module - will block.
+			utils.NotifyModuleOfConfigChangeL(modDataIn);
+			}
+		else
+			{
+			iParent.iSharedData->iTestModuleInUse = EFalse;	// Indicate to test harness the real A-GPS integration module is being used.			
+			}
+		}
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_CreateVerifyPosInfos::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepinstallscheduler.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,64 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstep_installscheduler.cpp
+// This is the class implementation for the Install Active Scheduler Test Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#include "ctlbsstepinstallscheduler.h"
+
+CT_LbsStep_InstallScheduler::CT_LbsStep_InstallScheduler(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_InstallScheduler);
+	}
+
+/**
+Static Constructor
+*/
+CT_LbsStep_InstallScheduler* CT_LbsStep_InstallScheduler::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_InstallScheduler(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+/**
+@pre 	No Active Scheduler installed in the worker test thread
+@return Test verdict
+@post	Test server's Active Scheduler member installed in worker thread
+*/
+TVerdict CT_LbsStep_InstallScheduler::doTestStepL()
+	{
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_InstallScheduler::doTestStepL()"));
+
+	if( CActiveScheduler::Current() )
+		{
+		INFO_PRINTF1(_L("Test Warning: Scheduler already installed in worker thread"));
+
+		return TestStepResult();
+		}
+	CActiveScheduler::Install( iParent.iScheduler );
+	
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_InstallScheduler::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepresetdefaultadmin.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,84 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstepresetdefaultadmin.cpp
+// This is the class implementation for the Reset Default Admin Test Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#include <centralrepository.h>		  
+#include "ctlbsstepresetdefaultadmin.h"
+#include <lbsadmin.h>
+
+CT_LbsStep_ResetDefaultAdmin::CT_LbsStep_ResetDefaultAdmin(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_ResetDefaultAdmin);
+	}
+
+/**
+Static Constructor
+*/
+CT_LbsStep_ResetDefaultAdmin* CT_LbsStep_ResetDefaultAdmin::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_ResetDefaultAdmin(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+/**
+@pre 	
+@return Test verdict
+@post	All admin settings reset to default
+*/
+TVerdict CT_LbsStep_ResetDefaultAdmin::doTestStepL()
+	{
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_ResetDefaultAdmin::doTestStepL()"));
+
+	CLbsAdmin* adminApi = CLbsAdmin::NewL();
+	CleanupStack::PushL(adminApi);
+	
+	TInt err = adminApi->ResetToDefault();	
+
+	if(!KErrNone == err)
+		{
+		SetTestStepResult(EFail);
+		}
+		
+	// Reset the LbsRoot cenrep also.
+	const TUid KLbsRootRepositoryUid = { 0x10282266 };
+	CRepository* rootRep = CRepository::NewLC(KLbsRootRepositoryUid);
+	err = rootRep->Reset();
+
+	if(!KErrNone == err)
+		{
+		SetTestStepResult(EFail);
+		}
+	
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_ResetDefaultAdmin::doTestStepL()"));
+
+	CleanupStack::PopAndDestroy(2, adminApi); 	
+
+	// Alow the change to be propagated
+	User::After(4000000);
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepsetatamode.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,99 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstepsetatamode.cpp
+// This is the class implementation for the Set Behaviour Mode Original Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+		  
+#include "ctlbsstepsetatamode.h"
+#include <lbsadmin.h>
+
+CT_LbsStep_SetATAMode::CT_LbsStep_SetATAMode(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_SetATAMode);
+	}
+
+/**
+Static Constructor
+*/
+CT_LbsStep_SetATAMode* CT_LbsStep_SetATAMode::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_SetATAMode(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+/**
+ */
+TBool CT_LbsStep_SetATAMode::SetAndVerifyATAModeL()
+ 	{
+ 	TBool ret = TRUE;
+	CLbsAdmin* adminApi = CLbsAdmin::NewL();
+	CleanupStack::PushL(adminApi);
+	
+	TInt err = adminApi->Set(KLbsSettingRoamingGpsMode, CLbsAdmin::EGpsAlwaysTerminalAssisted);
+	User::LeaveIfError(err);
+	err = adminApi->Set(KLbsSettingHomeGpsMode, CLbsAdmin::EGpsAlwaysTerminalAssisted);
+	User::LeaveIfError(err);
+	// Alow he setting to be propagated
+	User::After(2000000);
+
+	CLbsAdmin::TGpsMode gpsMode;
+	err = adminApi->Get(KLbsSettingRoamingGpsMode, gpsMode);
+	User::LeaveIfError(err);
+	if(gpsMode != CLbsAdmin::EGpsAlwaysTerminalAssisted)
+		{
+		INFO_PRINTF1(_L("Admin setting didn't work"));
+		ret = FALSE;
+		}					
+
+	err = adminApi->Get(KLbsSettingHomeGpsMode, gpsMode);
+	User::LeaveIfError(err);
+	if(gpsMode != CLbsAdmin::EGpsAlwaysTerminalAssisted)
+		{
+		INFO_PRINTF1(_L("Admin setting didn't work"));
+		ret = FALSE;
+		}					
+	CleanupStack::PopAndDestroy(adminApi);
+	
+	return ret;
+ 	}
+
+/**
+@pre 	
+@return Test verdict
+@post	Lbs Behaviour mode set to "original"
+*/
+TVerdict CT_LbsStep_SetATAMode::doTestStepL()
+	{
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_SetATAMode::doTestStepL()"));
+
+	if(!SetAndVerifyATAModeL())
+		{
+		SetTestStepResult(EFail);
+		}
+	
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_SetATAMode::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepsetautonomousmode.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,90 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstep_setautonomousmode.cpp
+// This is the class implementation for the Set Autonomous Moder Test Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+		  
+#include "ctlbsstepsetautonomousmode.h"
+#include <lbsadmin.h>
+
+CT_LbsStep_SetAutonomousMode::CT_LbsStep_SetAutonomousMode(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_SetAutonomousMode);
+	}
+
+/**
+Static Constructor
+*/
+CT_LbsStep_SetAutonomousMode* CT_LbsStep_SetAutonomousMode::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_SetAutonomousMode(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+/**
+ */
+TBool CT_LbsStep_SetAutonomousMode::SetAndVerifyAutonomousGpsModeL()
+ 	{
+ 	TBool ret = TRUE;
+	CLbsAdmin* adminApi = CLbsAdmin::NewL();
+	CleanupStack::PushL(adminApi);
+	CLbsAdmin::TGpsMode mode;
+	
+	TInt err = adminApi->Set(KLbsSettingHomeGpsMode, CLbsAdmin::EGpsAutonomous);	
+	User::LeaveIfError(err);
+	err = adminApi->Get(KLbsSettingHomeGpsMode, mode);	
+	User::LeaveIfError(err);
+	
+	if(mode != CLbsAdmin::EGpsAutonomous)
+		{
+		INFO_PRINTF1(_L("Admin setting didn't work"));
+		ret = FALSE;
+		}					
+	CleanupStack::PopAndDestroy(adminApi);
+
+	// Alow he setting to be propagated
+	User::After(2000000);
+	
+	return ret;
+ 	}
+
+/**
+@pre 	
+@return Test verdict
+@post	GPSMode set to autonomous
+*/
+TVerdict CT_LbsStep_SetAutonomousMode::doTestStepL()
+	{
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_SetAutonomousMode::doTestStepL()"));
+
+	if(!SetAndVerifyAutonomousGpsModeL())
+		{
+		SetTestStepResult(EFail);
+		}
+	
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_SetAutonomousMode::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepsetbehaviourmodeoriginal.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,91 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstepsetbehaviourmodeoriginal.cpp
+// This is the class implementation for the Set Behaviour Mode Original Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+		  
+#include "ctlbsstepsetbehaviourmodeoriginal.h"
+#include <lbsadmin.h>
+
+CT_LbsStep_SetBehaviourModeOriginal::CT_LbsStep_SetBehaviourModeOriginal(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_SetBehaviourModeOriginal);
+	}
+
+/**
+Static Constructor
+*/
+CT_LbsStep_SetBehaviourModeOriginal* CT_LbsStep_SetBehaviourModeOriginal::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_SetBehaviourModeOriginal(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+/**
+ */
+TBool CT_LbsStep_SetBehaviourModeOriginal::SetAndVerifyBehaviourModeOriginalL()
+ 	{
+ 	TBool ret = TRUE;
+	CLbsAdmin* adminApi = CLbsAdmin::NewL();
+	CleanupStack::PushL(adminApi);
+
+	CLbsAdmin::TLbsBehaviourMode behaviourMode;
+	
+	TInt err = adminApi->Set(KLbsSettingBehaviourMode, CLbsAdmin::ELbsBehaviourModeOriginal);
+	User::LeaveIfError(err);
+	err = adminApi->Get(KLbsSettingBehaviourMode, behaviourMode);	
+	User::LeaveIfError(err);
+	
+	if(behaviourMode != CLbsAdmin::ELbsBehaviourModeOriginal)
+		{
+		INFO_PRINTF1(_L("Admin setting didn't work"));
+		ret = FALSE;
+		}					
+	CleanupStack::PopAndDestroy(adminApi);
+
+	// Alow he setting to be propagated
+	User::After(2000000);
+	
+	return ret;
+ 	}
+
+/**
+@pre 	
+@return Test verdict
+@post	Lbs Behaviour mode set to "original"
+*/
+TVerdict CT_LbsStep_SetBehaviourModeOriginal::doTestStepL()
+	{
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_SetBehaviourModeOriginal::doTestStepL()"));
+
+	if(!SetAndVerifyBehaviourModeOriginalL())
+		{
+		SetTestStepResult(EFail);
+		}
+	
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_SetBehaviourModeOriginal::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepsetprivhandler.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,119 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstepsetprivhandler.cpp
+// This is the class implementation for the Set Privacy Controller Test Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+		  
+#include "ctlbsstepsetprivhandler.h"
+
+//Literals Used
+_LIT(KHandlerType, "privhandler_type");
+
+CT_LbsStep_SetPrivacyHandler::CT_LbsStep_SetPrivacyHandler(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_SetPrivacyHandler);
+	}
+
+/**
+Static Constructor
+*/
+CT_LbsStep_SetPrivacyHandler* CT_LbsStep_SetPrivacyHandler::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_SetPrivacyHandler(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+/**	Let LBS know whether we're using privacy controller or notifier:
+ */
+TBool CT_LbsStep_SetPrivacyHandler::SetAndVerifyPrivacyHandlerL(CLbsAdmin::TPrivacyHandler aPrivacyHandlerType)
+ 	{
+ 	TBool ret = TRUE;
+	CLbsAdmin* adminApi = CLbsAdmin::NewL();
+	CleanupStack::PushL(adminApi);
+	TInt err;
+	
+	//CLbsAdmin::TPrivacyHandler privacyHandler = CLbsAdmin::EPrivacyHandleByController;
+	err = adminApi->Set(KLbsSettingPrivacyHandler, aPrivacyHandlerType);
+	
+	User::LeaveIfError(err);
+	err = adminApi->Get(KLbsSettingPrivacyHandler, aPrivacyHandlerType);	
+	User::LeaveIfError(err);
+	
+	//Now we support 3 Privacy Handlers so need to comment out below check
+	//if(aPrivacyHandlerType != CLbsAdmin::EPrivacyHandleByController)
+	//	{
+	//	INFO_PRINTF1(_L("Admin setting didn't work"));
+	//	ret = FALSE;
+	//	}	
+					
+	CleanupStack::PopAndDestroy(adminApi);
+
+	// Allow he setting to be propagated
+	User::After(4 * 1000000);
+	
+	return ret;
+ 	}
+
+/**
+@pre 	
+@return Test verdict
+@post	GPSMode set to autonomous
+*/
+TVerdict CT_LbsStep_SetPrivacyHandler::doTestStepL()
+	{
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_SetPrivacyHandler::doTestStepL()"));
+
+	CLbsAdmin::TPrivacyHandler privacyHandlerType = CLbsAdmin::EPrivacyHandleByController;
+	TInt privhandlerconfig;
+
+	if (GetIntFromConfig(ConfigSection(), KHandlerType, privhandlerconfig))	
+		{
+		if(1 == privhandlerconfig)
+			{
+			privacyHandlerType = CLbsAdmin::EPrivacyHandleByController;
+			}
+		else if (2 == privhandlerconfig)
+			{
+			privacyHandlerType = CLbsAdmin::EPrivacyHandleByNotifier;
+			}
+		else if (3 == privhandlerconfig)
+			{
+			privacyHandlerType = CLbsAdmin::EPrivacyHandleByAdvancedNotifier;
+			}
+		else
+			{
+			INFO_PRINTF2(_L("&gt;&gt;Unrecognised privacyHandlerType: %d"), privacyHandlerType);
+			User::Invariant();
+			}
+
+		if(!SetAndVerifyPrivacyHandlerL(privacyHandlerType))
+			{
+			SetTestStepResult(EFail);
+			}
+		}
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_SetPrivacyHandler::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepsetptamode.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,99 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstepsetptamode.cpp
+// This is the class implementation for the Set Behaviour Mode Original Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+		  
+#include "ctlbsstepsetptamode.h"
+#include <lbsadmin.h>
+
+CT_LbsStep_SetPTAMode::CT_LbsStep_SetPTAMode(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_SetPTAMode);
+	}
+
+/**
+Static Constructor
+*/
+CT_LbsStep_SetPTAMode* CT_LbsStep_SetPTAMode::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_SetPTAMode(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+/**
+ */
+TBool CT_LbsStep_SetPTAMode::SetAndVerifyPTAModeL()
+ 	{
+ 	TBool ret = TRUE;
+	CLbsAdmin* adminApi = CLbsAdmin::NewL();
+	CleanupStack::PushL(adminApi);
+	
+	TInt err = adminApi->Set(KLbsSettingRoamingGpsMode, CLbsAdmin::EGpsPreferTerminalAssisted);
+	User::LeaveIfError(err);
+	err = adminApi->Set(KLbsSettingHomeGpsMode, CLbsAdmin::EGpsPreferTerminalAssisted);
+	User::LeaveIfError(err);
+	// Alow he setting to be propagated
+	User::After(2000000);
+
+	CLbsAdmin::TGpsMode gpsMode;
+	err = adminApi->Get(KLbsSettingRoamingGpsMode, gpsMode);
+	User::LeaveIfError(err);
+	if(gpsMode != CLbsAdmin::EGpsPreferTerminalAssisted)
+		{
+		INFO_PRINTF1(_L("Admin setting didn't work"));
+		ret = FALSE;
+		}					
+
+	err = adminApi->Get(KLbsSettingHomeGpsMode, gpsMode);
+	User::LeaveIfError(err);
+	if(gpsMode != CLbsAdmin::EGpsPreferTerminalAssisted)
+		{
+		INFO_PRINTF1(_L("Admin setting didn't work"));
+		ret = FALSE;
+		}					
+	CleanupStack::PopAndDestroy(adminApi);
+	
+	return ret;
+ 	}
+
+/**
+@pre 	
+@return Test verdict
+@post	Lbs Behaviour mode set to "original"
+*/
+TVerdict CT_LbsStep_SetPTAMode::doTestStepL()
+	{
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_SetPTAMode::doTestStepL()"));
+
+	if(!SetAndVerifyPTAModeL())
+		{
+		SetTestStepResult(EFail);
+		}
+	
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_SetPTAMode::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepsetptbmode.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,99 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstepsetptbmode.cpp
+// This is the class implementation for the Set Gps Mode PTB
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+		  
+#include "ctlbsstepsetptbmode.h"
+#include <lbsadmin.h>
+
+CT_LbsStep_SetPTBMode::CT_LbsStep_SetPTBMode(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_SetPTBMode);
+	}
+
+/**
+Static Constructor
+*/
+CT_LbsStep_SetPTBMode* CT_LbsStep_SetPTBMode::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_SetPTBMode(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+/**
+ */
+TBool CT_LbsStep_SetPTBMode::SetAndVerifyPTBModeL()
+ 	{
+ 	TBool ret = TRUE;
+	CLbsAdmin* adminApi = CLbsAdmin::NewL();
+	CleanupStack::PushL(adminApi);
+	
+	TInt err = adminApi->Set(KLbsSettingRoamingGpsMode, CLbsAdmin::EGpsPreferTerminalBased);
+	User::LeaveIfError(err);
+	err = adminApi->Set(KLbsSettingHomeGpsMode, CLbsAdmin::EGpsPreferTerminalBased);
+	User::LeaveIfError(err);
+	// Alow he setting to be propagated
+	User::After(2000000);
+
+	CLbsAdmin::TGpsMode gpsMode;
+	err = adminApi->Get(KLbsSettingRoamingGpsMode, gpsMode);
+	User::LeaveIfError(err);
+	if(gpsMode != CLbsAdmin::EGpsPreferTerminalBased)
+		{
+		INFO_PRINTF1(_L("Admin setting didn't work"));
+		ret = FALSE;
+		}					
+
+	err = adminApi->Get(KLbsSettingHomeGpsMode, gpsMode);
+	User::LeaveIfError(err);
+	if(gpsMode != CLbsAdmin::EGpsPreferTerminalBased)
+		{
+		INFO_PRINTF1(_L("Admin setting didn't work"));
+		ret = FALSE;
+		}					
+	CleanupStack::PopAndDestroy(adminApi);
+	
+	return ret;
+ 	}
+
+/**
+@pre 	
+@return Test verdict
+@post	Lbs Behaviour mode set to "original"
+*/
+TVerdict CT_LbsStep_SetPTBMode::doTestStepL()
+	{
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_SetPTBMode::doTestStepL()"));
+
+	if(!SetAndVerifyPTBModeL())
+		{
+		SetTestStepResult(EFail);
+		}
+	
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_SetPTBMode::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepsetupprotocolstub.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,78 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstep_setupprotocolstub.cpp
+// This is the class implementation for the Set Autonomous Moder Test Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+		  
+#include "ctlbsstepsetupprotocolstub.h"
+#include <lbsadmin.h>
+
+CT_LbsStep_SetupProtocolStub::CT_LbsStep_SetupProtocolStub(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_SetupProtocolStub);
+	}
+
+/**
+Static Constructor
+*/
+CT_LbsStep_SetupProtocolStub* CT_LbsStep_SetupProtocolStub::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_SetupProtocolStub(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+/**
+@pre 	
+@return Test verdict
+@post	GPSMode set to autonomous
+*/
+TVerdict CT_LbsStep_SetupProtocolStub::doTestStepL()
+	{
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_SetupProtocolStub::doTestStepL()"));
+
+	CLbsAdmin* adminApi = CLbsAdmin::NewL();
+	CleanupStack::PushL(adminApi);
+	TUid uid;
+
+	TInt err = adminApi->Set(KLbsSettingHomeProtocolModule, TUid::Uid(0x10282293));	
+	User::LeaveIfError(err);
+	err = adminApi->Get(KLbsSettingHomeProtocolModule, uid);	
+	User::LeaveIfError(err);
+	
+	if(uid.iUid != 0x10282293)
+		{
+		INFO_PRINTF1(_L("Admin setting didn't work"));
+		SetTestStepResult(EFail);
+		}					
+		
+	CleanupStack::PopAndDestroy(adminApi);
+
+	// Alow he setting to be propagated
+	User::After(2000000);
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_SetupProtocolStub::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepsetuproamselflocate.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,94 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstepsetuproamlocate.cpp
+// This is the class implementation for the Set Autonomous Moder Test Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+		  
+#include "ctlbsstepsetuproamselflocate.h"
+#include <lbsadmin.h>
+
+CT_LbsStep_SetupRoamSelfLocate::CT_LbsStep_SetupRoamSelfLocate(CT_LbsServer& aParent)
+:CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_SetupRoamSelfLocate);
+	}
+
+/**
+Static Constructor
+*/
+CT_LbsStep_SetupRoamSelfLocate* CT_LbsStep_SetupRoamSelfLocate::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_SetupRoamSelfLocate(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+/**
+@pre 	
+@return Test verdict
+@post	GPSMode set to autonomous
+*/
+TVerdict CT_LbsStep_SetupRoamSelfLocate::doTestStepL()
+	{
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_SetupRoamSelfLocate::doTestStepL()"));
+
+ 	CLbsAdmin* adminApi = CLbsAdmin::NewL();
+	CleanupStack::PushL(adminApi);
+	
+	// Switch on the self locate API when roaming.
+	CLbsAdmin::TSelfLocateService serviceSetting = CLbsAdmin::ESelfLocateUnknown;
+
+	TInt err = adminApi->Set(KLbsSettingRoamingSelfLocate, CLbsAdmin::ESelfLocateOn);
+	User::LeaveIfError(err);
+	err = adminApi->Get(KLbsSettingRoamingSelfLocate, serviceSetting);	
+	User::LeaveIfError(err);
+	
+	if(serviceSetting != CLbsAdmin::ESelfLocateOn)
+		{
+		INFO_PRINTF1(_L("Self locate API admin setting didn't work"));
+		SetTestStepResult(EFail);
+		}					
+	
+	// Set gps mode when roaming.
+	CLbsAdmin::TGpsMode gpsModeSetting = CLbsAdmin::EGpsModeUnknown;
+	
+	err = adminApi->Set(KLbsSettingRoamingGpsMode, CLbsAdmin::EGpsPreferTerminalBased);
+	User::LeaveIfError(err);
+	err = adminApi->Get(KLbsSettingRoamingGpsMode, gpsModeSetting);
+	User::LeaveIfError(err);
+	
+	if (gpsModeSetting != CLbsAdmin::EGpsPreferTerminalBased)
+		{
+		INFO_PRINTF1(_L("Gps mode admin setting didn't work"));
+		SetTestStepResult(EFail);
+		}
+		
+	CleanupStack::PopAndDestroy(adminApi);
+
+	// Alow he setting to be propagated
+	User::After(2000000);
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_SetupRoamSelfLocate::doTestStepL()"));
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepsetupstandaloneprivacyandsimplectlr.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,160 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstep_setupstandaloneprivacyandsimplectlr.cpp
+// This is the class implementation for the Set Autonomous Mode Test Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+		  
+#include "ctlbsstepsetupstandaloneprivacyandsimplectlr.h"
+#include <lbsadmin.h>
+#include <centralrepository.h>
+
+
+CT_LbsStep_SetupStandalonePrivacyAndSimpleCtlr::CT_LbsStep_SetupStandalonePrivacyAndSimpleCtlr(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_SetupStandalonePrivacyAndSimpleCtlr);
+	}
+
+/**
+Static Constructor
+*/
+CT_LbsStep_SetupStandalonePrivacyAndSimpleCtlr* CT_LbsStep_SetupStandalonePrivacyAndSimpleCtlr::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_SetupStandalonePrivacyAndSimpleCtlr(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+/**
+@pre 	
+@return Test verdict
+@post	LBS sub-system set to standalone privacy mode and using simple controller.
+*/
+TVerdict CT_LbsStep_SetupStandalonePrivacyAndSimpleCtlr::doTestStepL()
+	{
+	
+	// lbsroot stuff (not ideal, currently defined in internal header file lbsrootcenrepdefs.h
+	const TUint KLbsCenRepUidValue					= 0x10282266;
+	const TUid  KLbsCenRepUid						= {KLbsCenRepUidValue};
+
+	const TUint32 KLbsRootProcessNameFirstKey			= 0x00001000;
+	const TUint32 KLbsRootProcessUidFirstKey			= 0x00002000;
+	const TUint32 KLbsRootProcessIsServerFirstKey		= 0x00003000;
+
+	const TUint32 KLbsSystemTransientKey				= 0x00000001;
+	const TUint32 KLbsRootProcessTransientKey			= 0x00000002;
+
+	const TUint32 KRootKeyMask							= 0xFFFFF000;	// don't care what the last 3 digits are
+
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_SetupStandalonePrivacyAndSimpleCtlr::doTestStepL()"));
+	
+	// Set the privacy protocol module as the protocol module to load in admin settings
+	CLbsAdmin* adminApi = CLbsAdmin::NewL();
+	CleanupStack::PushL(adminApi);
+	
+	const TLbsProtocolModuleId KPrivacyPMUid = { 0x1028373C };
+	TInt err = adminApi->Set(KLbsSettingHomeProtocolModule, KPrivacyPMUid);	
+	User::LeaveIfError(err);
+	TUid uid;
+	err = adminApi->Get(KLbsSettingHomeProtocolModule, uid);	
+	User::LeaveIfError(err);
+	
+	if(uid.iUid != KPrivacyPMUid.iUid)
+		{
+		INFO_PRINTF1(_L("Admin setting didn't work"));
+		SetTestStepResult(EFail);
+		}					
+	
+	//Get privacy handler type
+	CLbsAdmin::TPrivacyHandler privacyHandlerType;
+	err = adminApi->Get(KLbsSettingPrivacyHandler, privacyHandlerType);	
+	User::LeaveIfError(err);
+	
+	// Set the privacy timeout action as 'network defined'
+	err = adminApi->Set(KLbsSettingPrivacyTimeoutAction, CLbsAdmin::EPrivacyTimeoutNetworkDefined);
+	User::LeaveIfError(err);
+	
+	// Set the maximum number of simultaneous privacy requests allowed
+	const TUint KMaxExternalLocateRequests(150);
+	err = adminApi->Set(KLbsSettingMaximumExternalLocateRequests, KMaxExternalLocateRequests);
+	User::LeaveIfError(err);
+
+	CleanupStack::PopAndDestroy(adminApi);
+
+	// Alow the setting to be propagated
+	User::After(2000000);
+		
+	// Set-up the LbsRoot cenrep file so that:
+	// 1) LbsRoot is transient.
+	// 2) LbsRoot starts the LBS subsystem in transient mode
+	// 3) LbsRoot only starts the NRH and NG.
+
+	CRepository* rootRep = CRepository::NewLC(KLbsCenRepUid);
+	
+	// Set Lbs system and LbsRoot process as transient.
+	
+	// Start the LBS sub-system in transient mode.
+	User::LeaveIfError(rootRep->Set(KLbsSystemTransientKey, 1));
+	User::LeaveIfError(rootRep->Set(KLbsRootProcessTransientKey, 1));
+	
+	// Set only NRH and NG to be started.
+	// First, clear out any existing startup entries.
+	TUint32 errorKey;
+	User::LeaveIfError(rootRep->Delete(KLbsRootProcessNameFirstKey, KRootKeyMask, errorKey));
+	User::LeaveIfError(rootRep->Delete(KLbsRootProcessUidFirstKey, KRootKeyMask, errorKey));
+	User::LeaveIfError(rootRep->Delete(KLbsRootProcessIsServerFirstKey, KRootKeyMask, errorKey));
+	
+	// Set NRH and NG as startup entries.
+	_LIT(KNGProcessName, "lbsnetgateway.exe");
+	const TUid KLbsNetworkGatewayUid = { 0x10281D46 };
+	User::LeaveIfError(rootRep->Set(KLbsRootProcessNameFirstKey, KNGProcessName));
+	User::LeaveIfError(rootRep->Set(KLbsRootProcessUidFirstKey, TInt(KLbsNetworkGatewayUid.iUid)));
+	User::LeaveIfError(rootRep->Set(KLbsRootProcessIsServerFirstKey, EFalse));
+
+	_LIT(KNRHProcessName, "lbsnetworkrequesthandler.exe");
+	const TUid KLbsNetRequestHandlerUid = { 0x10281D45 };
+	User::LeaveIfError(rootRep->Set(KLbsRootProcessNameFirstKey+1, KNRHProcessName));
+	User::LeaveIfError(rootRep->Set(KLbsRootProcessUidFirstKey+1, TInt(KLbsNetRequestHandlerUid.iUid)));
+	User::LeaveIfError(rootRep->Set(KLbsRootProcessIsServerFirstKey+1, ETrue));
+	
+	//If we are using Privacy Controller mode, start privacy controller as well
+	if(privacyHandlerType == CLbsAdmin::EPrivacyHandleByController)
+		{
+		_LIT(KPrivCtrlProcessName, "lbstestprivacycontrollersimple.exe");
+		const TUid KLbsPrivacyControllerUid = { 0x10283746 };
+		User::LeaveIfError(rootRep->Set(KLbsRootProcessNameFirstKey+2, KPrivCtrlProcessName));
+		User::LeaveIfError(rootRep->Set(KLbsRootProcessUidFirstKey+2, TInt(KLbsPrivacyControllerUid.iUid)));
+		User::LeaveIfError(rootRep->Set(KLbsRootProcessIsServerFirstKey+2, EFalse));
+		}
+	else
+		{
+		ERR_PRINTF1(_L("FAIL - Test Step is only useful with Privacy Controller"));
+		SetTestStepResult(EFail);
+		}
+	
+	CleanupStack::PopAndDestroy(rootRep);
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_SetupStandalonePrivacyAndSimpleCtlr::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepsetupstandaloneprivacymode.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,145 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstep_setupstandaloneprivacymode.cpp
+// This is the class implementation for the Set Autonomous Moder Test Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+		  
+#include "ctlbsstepsetupstandaloneprivacymode.h"
+#include <lbsadmin.h>
+#include <centralrepository.h>
+
+
+CT_LbsStep_SetupStandalonePrivacyMode::CT_LbsStep_SetupStandalonePrivacyMode(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_SetupStandalonePrivacyMode);
+	}
+
+/**
+Static Constructor
+*/
+CT_LbsStep_SetupStandalonePrivacyMode* CT_LbsStep_SetupStandalonePrivacyMode::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_SetupStandalonePrivacyMode(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+/**
+@pre 	
+@return Test verdict
+@post	LBS sub-system set to standalone privacy mode.
+*/
+TVerdict CT_LbsStep_SetupStandalonePrivacyMode::doTestStepL()
+	{
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_SetupStandalonePrivacyMode::doTestStepL()"));
+	
+	// Set the privacy protocol module as the protocol module to load in admin settings
+	CLbsAdmin* adminApi = CLbsAdmin::NewL();
+	CleanupStack::PushL(adminApi);
+	
+	const TLbsProtocolModuleId KPrivacyPMUid = { 0x1028373C };
+	TInt err = adminApi->Set(KLbsSettingHomeProtocolModule, KPrivacyPMUid);	
+	User::LeaveIfError(err);
+	TUid uid;
+	err = adminApi->Get(KLbsSettingHomeProtocolModule, uid);	
+	User::LeaveIfError(err);
+	
+	if(uid.iUid != KPrivacyPMUid.iUid)
+		{
+		INFO_PRINTF1(_L("Admin setting didn't work"));
+		SetTestStepResult(EFail);
+		}					
+	
+	//Get privacy handler type
+	CLbsAdmin::TPrivacyHandler privacyHandlerType;
+	err = adminApi->Get(KLbsSettingPrivacyHandler, privacyHandlerType);	
+	User::LeaveIfError(err);
+	
+	// Turn off the LBS logger
+	err = adminApi->Set(KLbsSettingLogger, CLbsAdmin::ELoggerOff);
+	User::LeaveIfError(err);
+
+	// Set the privacy timeout action as 'network defined'
+	err = adminApi->Set(KLbsSettingPrivacyTimeoutAction, CLbsAdmin::EPrivacyTimeoutNetworkDefined);
+	User::LeaveIfError(err);
+
+	// Set the maximum number of simultaneous privacy requests allowed
+	const TUint KMaxExternalLocateRequests(150);
+	err = adminApi->Set(KLbsSettingMaximumExternalLocateRequests, KMaxExternalLocateRequests);
+	User::LeaveIfError(err);
+
+	CleanupStack::PopAndDestroy(adminApi);
+
+	// Alow the setting to be propagated
+	User::After(2000000);
+		
+	// Set-up the LbsRoot cenrep file so that:
+	// 1) LbsRoot is transient.
+	// 2) LbsRoot starts the LBS subsystem in transient mode
+	// 3) LbsRoot only starts the NRH and NG.
+
+	CRepository* rootRep = CRepository::NewLC(KLbsCenRepUid);
+	
+	// Set Lbs system and LbsRoot process as transient.
+	
+	// Start the LBS sub-system in transient mode.
+	User::LeaveIfError(rootRep->Set(KLbsSystemTransientKey, 1));
+	User::LeaveIfError(rootRep->Set(KLbsRootProcessTransientKey, 1));
+	
+	// Set only NRH and NG to be started.
+	// First, clear out any existing startup entries.
+	TUint32 errorKey;
+	User::LeaveIfError(rootRep->Delete(KLbsRootProcessNameFirstKey, KRootKeyMask, errorKey));
+	User::LeaveIfError(rootRep->Delete(KLbsRootProcessUidFirstKey, KRootKeyMask, errorKey));
+	User::LeaveIfError(rootRep->Delete(KLbsRootProcessIsServerFirstKey, KRootKeyMask, errorKey));
+	
+	// Set NRH and NG as startup entries.
+	_LIT(KNGProcessName, "lbsnetgateway.exe");
+	const TUid KLbsNetworkGatewayUid = { 0x10281D46 };
+	User::LeaveIfError(rootRep->Set(KLbsRootProcessNameFirstKey, KNGProcessName));
+	User::LeaveIfError(rootRep->Set(KLbsRootProcessUidFirstKey, TInt(KLbsNetworkGatewayUid.iUid)));
+	User::LeaveIfError(rootRep->Set(KLbsRootProcessIsServerFirstKey, EFalse));
+
+	_LIT(KNRHProcessName, "lbsnetworkrequesthandler.exe");
+	const TUid KLbsNetRequestHandlerUid = { 0x10281D45 };
+	User::LeaveIfError(rootRep->Set(KLbsRootProcessNameFirstKey+1, KNRHProcessName));
+	User::LeaveIfError(rootRep->Set(KLbsRootProcessUidFirstKey+1, TInt(KLbsNetRequestHandlerUid.iUid)));
+	User::LeaveIfError(rootRep->Set(KLbsRootProcessIsServerFirstKey+1, ETrue));
+	
+	//If we are using Privacy Controller mode, start privacy controller as well
+	if(privacyHandlerType == CLbsAdmin::EPrivacyHandleByController)
+		{
+		_LIT(KPrivCtrlProcessName, "lbstestprivacycontroller.exe");
+		const TUid KLbsPrivacyControllerUid = { 0x10283750 };
+		User::LeaveIfError(rootRep->Set(KLbsRootProcessNameFirstKey+2, KPrivCtrlProcessName));
+		User::LeaveIfError(rootRep->Set(KLbsRootProcessUidFirstKey+2, TInt(KLbsPrivacyControllerUid.iUid)));
+		User::LeaveIfError(rootRep->Set(KLbsRootProcessIsServerFirstKey+2, EFalse));
+		}
+	
+	CleanupStack::PopAndDestroy(rootRep);
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_SetupStandalonePrivacyMode::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepsetupstandaloneprivacywithnoctlr.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,145 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstep_setupstandaloneprivacywithnoctlr.cpp
+// This is the class implementation for the Set Autonomous Mode Test Step
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+		  
+#include "ctlbsstepsetupstandaloneprivacywithnoctlr.h"
+#include <lbsadmin.h>
+#include <centralrepository.h>
+
+
+CT_LbsStep_SetupStandalonePrivacyWithNoCtlr::CT_LbsStep_SetupStandalonePrivacyWithNoCtlr(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_SetupStandalonePrivacyWithNoCtlr);
+	}
+
+/**
+Static Constructor
+*/
+CT_LbsStep_SetupStandalonePrivacyWithNoCtlr* CT_LbsStep_SetupStandalonePrivacyWithNoCtlr::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_SetupStandalonePrivacyWithNoCtlr(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+/**
+@pre 	
+@return Test verdict
+@post	LBS sub-system set to standalone privacy mode and using simple controller.
+*/
+TVerdict CT_LbsStep_SetupStandalonePrivacyWithNoCtlr::doTestStepL()
+	{
+	
+	// lbsroot stuff (not ideal, currently defined in internal header file lbsrootcenrepdefs.h
+	const TUint KLbsCenRepUidValue					= 0x10282266;
+	const TUid  KLbsCenRepUid						= {KLbsCenRepUidValue};
+
+	const TUint32 KLbsRootProcessNameFirstKey			= 0x00001000;
+	const TUint32 KLbsRootProcessUidFirstKey			= 0x00002000;
+	const TUint32 KLbsRootProcessIsServerFirstKey		= 0x00003000;
+
+	const TUint32 KLbsSystemTransientKey				= 0x00000001;
+	const TUint32 KLbsRootProcessTransientKey			= 0x00000002;
+
+	const TUint32 KRootKeyMask							= 0xFFFFF000;	// don't care what the last 3 digits are
+
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_SetupStandalonePrivacyWithNoCtlr::doTestStepL()"));
+	
+	// Set the privacy protocol module as the protocol module to load in admin settings
+	CLbsAdmin* adminApi = CLbsAdmin::NewL();
+	CleanupStack::PushL(adminApi);
+	
+	const TLbsProtocolModuleId KPrivacyPMUid = { 0x1028373C };
+	TInt err = adminApi->Set(KLbsSettingHomeProtocolModule, KPrivacyPMUid);	
+	User::LeaveIfError(err);
+	TUid uid;
+	err = adminApi->Get(KLbsSettingHomeProtocolModule, uid);	
+	User::LeaveIfError(err);
+	
+	if(uid.iUid != KPrivacyPMUid.iUid)
+		{
+		INFO_PRINTF1(_L("Admin setting didn't work"));
+		SetTestStepResult(EFail);
+		}
+	
+	//Get privacy handler type
+	CLbsAdmin::TPrivacyHandler privacyHandlerType;
+	err = adminApi->Get(KLbsSettingPrivacyHandler, privacyHandlerType);	
+	User::LeaveIfError(err);
+
+	// Set the privacy timeout action as 'network defined'
+	err = adminApi->Set(KLbsSettingPrivacyTimeoutAction, CLbsAdmin::EPrivacyTimeoutNetworkDefined);
+	User::LeaveIfError(err);
+
+	// Set the maximum number of simultaneous privacy requests allowed
+	const TUint KMaxExternalLocateRequests(150);
+	err = adminApi->Set(KLbsSettingMaximumExternalLocateRequests, KMaxExternalLocateRequests);
+	User::LeaveIfError(err);
+
+	CleanupStack::PopAndDestroy(adminApi);
+
+	// Alow the setting to be propagated
+	User::After(2000000);
+		
+	// Set-up the LbsRoot cenrep file so that:
+	// 1) LbsRoot is transient.
+	// 2) LbsRoot starts the LBS subsystem in transient mode
+	// 3) LbsRoot only starts the NRH and NG.
+
+	CRepository* rootRep = CRepository::NewLC(KLbsCenRepUid);
+	
+	// Set Lbs system and LbsRoot process as transient.
+	
+	// Start the LBS sub-system in transient mode.
+	User::LeaveIfError(rootRep->Set(KLbsSystemTransientKey, 1));
+	User::LeaveIfError(rootRep->Set(KLbsRootProcessTransientKey, 1));
+	
+	// Set only NRH and NG to be started.
+	// First, clear out any existing startup entries.
+	TUint32 errorKey;
+	User::LeaveIfError(rootRep->Delete(KLbsRootProcessNameFirstKey, KRootKeyMask, errorKey));
+	User::LeaveIfError(rootRep->Delete(KLbsRootProcessUidFirstKey, KRootKeyMask, errorKey));
+	User::LeaveIfError(rootRep->Delete(KLbsRootProcessIsServerFirstKey, KRootKeyMask, errorKey));
+	
+	// Set NRH and NG as startup entries.
+	_LIT(KNGProcessName, "lbsnetgateway.exe");
+	const TUid KLbsNetworkGatewayUid = { 0x10281D46 };
+	User::LeaveIfError(rootRep->Set(KLbsRootProcessNameFirstKey, KNGProcessName));
+	User::LeaveIfError(rootRep->Set(KLbsRootProcessUidFirstKey, TInt(KLbsNetworkGatewayUid.iUid)));
+	User::LeaveIfError(rootRep->Set(KLbsRootProcessIsServerFirstKey, EFalse));
+
+	_LIT(KNRHProcessName, "lbsnetworkrequesthandler.exe");
+	const TUid KLbsNetRequestHandlerUid = { 0x10281D45 };
+	User::LeaveIfError(rootRep->Set(KLbsRootProcessNameFirstKey+1, KNRHProcessName));
+	User::LeaveIfError(rootRep->Set(KLbsRootProcessUidFirstKey+1, TInt(KLbsNetRequestHandlerUid.iUid)));
+	User::LeaveIfError(rootRep->Set(KLbsRootProcessIsServerFirstKey+1, ETrue));
+
+	CleanupStack::PopAndDestroy(rootRep);
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_SetupStandalonePrivacyWithNoCtlr::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepstartlbs.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,146 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbslocdatasrc.cpp
+// This is the class implementation for the step to start the lbs system
+// EPOC includes.
+// LBS includes. 
+// 
+//
+
+// LBS test includes.
+#include "ctlbsstepstartlbs.h"
+#include "tlbsutils.h"
+#include "lbstestclient.h"
+
+/**
+ * Destructor
+ */
+CT_LbsStep_StartLbs::~CT_LbsStep_StartLbs()
+	{
+	}
+
+
+/**
+ * Constructor
+ */
+CT_LbsStep_StartLbs::CT_LbsStep_StartLbs(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_StartLbs);
+	}
+
+
+/**
+Static Constructor
+*/
+CT_LbsStep_StartLbs* CT_LbsStep_StartLbs::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_StartLbs(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsStep_StartLbs::doTestStepL()
+	{
+	// Test step used to start the location manager.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_StartLbs::doTestStepL()"));
+
+	//*******************************************************************/
+	// for diagnostics print out important Admin settings that will
+	// determine how lbs bahaves
+	
+	CLbsAdmin* adminApi = CLbsAdmin::NewL();
+	CleanupStack::PushL(adminApi);
+	
+	CLbsAdmin::TGpsMode mode;
+	TInt err = adminApi->Get(KLbsSettingHomeGpsMode, mode);	
+	if (err == KErrNone)
+		{
+		INFO_PRINTF2(_L("KLbsSettingHomeGpsMode = %d"),mode);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("KLbsSettingHomeGpsMode not in Admin"));
+		}
+			
+	CLbsAdmin::TSpecialFeature	specialFeature;
+	
+	err = adminApi->Get(KLbsSpecialFeatureIgnoreAccuracy, specialFeature);
+	if (err == KErrNone)
+		{
+		INFO_PRINTF2(_L("KLbsSpecialFeatureIgnoreAccuracy = %d"),specialFeature);
+		}
+	else
+		{
+		INFO_PRINTF1(_L("KLbsSpecialFeatureIgnoreAccuracy not in Admin"));
+		}
+	
+	err = adminApi->Get(KLbsSpecialFeatureAllowTBFinalNetPos, specialFeature);
+	if (err == KErrNone)
+		{
+		INFO_PRINTF2(_L("KLbsSpecialFeatureAllowTBFinalNetPos = %d"),specialFeature);
+		}
+		else
+		{
+		INFO_PRINTF1(_L("KLbsSpecialFeatureAllowTBFinalNetPos not in Admin"));
+		}
+		
+	err = adminApi->Get(KLbsSpecialFeatureWithholdDeliveryOfReferencePositions, specialFeature);
+	if (err == KErrNone)
+		{
+		INFO_PRINTF2(_L("KLbsSpecialFeatureWithholdDeliveryOfReferencePositions = %d"),specialFeature);
+		}
+		else
+		{
+		INFO_PRINTF1(_L("KLbsSpecialFeatureWithholdDeliveryOfReferencePositions not in Admin"));
+		}
+		
+	err = adminApi->Get(KLbsSpecialFeatureIntermediateFutileUpdate, specialFeature);
+	if (err == KErrNone)
+		{
+		INFO_PRINTF2(_L("KLbsSpecialFeatureIntermediateFutileUpdate = %d"),specialFeature);
+		}
+		else
+		{
+		INFO_PRINTF1(_L("KLbsSpecialFeatureIntermediateFutileUpdate not in Admin"));
+		}
+
+
+	CleanupStack::PopAndDestroy(adminApi);
+
+	//*******************************************************************/
+	
+	if (TestStepResult() == EPass)
+		{	
+		// Create the test properties.
+		T_LbsUtils utils;
+		utils.CreateTestPropertiesL();
+		
+		// Now start the LBS system
+		CLbsTestServer* testServer = CLbsTestServer::NewL();
+		CleanupStack::PushL(testServer);
+		User::LeaveIfError(testServer->StartLbsSystem());
+		CleanupStack::PopAndDestroy(testServer);
+		}
+		
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_StartLbs::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepstoplbs.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,76 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbslocdatasrc.cpp
+// This is the class implementation for the step to stop the lbs system
+// EPOC includes.
+// LBS includes. 
+// 
+//
+
+// LBS test includes.
+#include "ctlbsstepstoplbs.h"
+#include <lbstestclient.h>
+
+/**
+ * Destructor
+ */
+CT_LbsStep_StopLbs::~CT_LbsStep_StopLbs()
+	{
+	}
+
+
+/**
+ * Constructor
+ */
+CT_LbsStep_StopLbs::CT_LbsStep_StopLbs(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_StopLbs);
+	}
+
+
+/**
+Static Constructor
+*/
+CT_LbsStep_StopLbs* CT_LbsStep_StopLbs::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_StopLbs(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+ 
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsStep_StopLbs::doTestStepL()
+	{
+	// Test step used to stop the lbs system
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_StopLbs::doTestStepL()"));
+
+	if (TestStepResult() == EPass)
+		{
+		CLbsTestServer* testServer = CLbsTestServer::NewL();
+		CleanupStack::PushL(testServer);
+		User::LeaveIfError(testServer->StopLbsSystem());
+
+		CleanupStack::PopAndDestroy(testServer);
+		}
+		
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_StopLbs::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepverifyloginfo.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1177 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstepverifyloginfo.cpp
+// This is the class implementation for the log verification test step
+// 
+//
+ 
+#include "ctlbsstepverifyloginfo.h"
+
+_LIT(KLogType, "log_type");
+
+/**
+Public, non-leaving, static constructor
+*/
+CT_LbsStep_VerifyLogInfo* CT_LbsStep_VerifyLogInfo::New(CT_LbsServer& aParent)
+	{
+	CT_LbsStep_VerifyLogInfo* self = NULL;
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	TRAPD(err, self = NewL(aParent));
+	if(KErrNone != err)
+		{
+		self = NULL;
+		}
+	return self;
+	}
+/**
+ * Static Constructor that may leave
+ */
+CT_LbsStep_VerifyLogInfo* CT_LbsStep_VerifyLogInfo::NewL(CT_LbsServer& aParent)
+	{
+	CT_LbsStep_VerifyLogInfo* verifyLog = new(ELeave) CT_LbsStep_VerifyLogInfo(aParent);
+	CleanupStack::PushL(verifyLog);
+	verifyLog->ConstructL();
+	CleanupStack::Pop(verifyLog);
+
+	return verifyLog;
+	}
+/**
+2nd phase Constructor that may leave
+*/
+void CT_LbsStep_VerifyLogInfo::ConstructL()
+	{
+
+	// Create everything for the right hand side of all compares
+	_LIT(KTheDest,"07712345678");
+	TPtrC theDest(KTheDest);
+	
+	iX3PLogIntiailisedFromValues = CLbsTransmitLocationLogEvent::NewL(TUid::Uid(0), NULL, theDest);
+	iSelfLocateLogIntiailisedFromValues = CLbsSelfLocateLogEvent::NewL(TUid::Uid(0), NULL);
+	iExternalLocateLogIntiailisedFromValues = CLbsExternalLocateLogEvent::NewL(TUid::Uid(0), NULL, NULL);
+	iNetworkLocateLogIntiailisedFromValues = CLbsNetworkLocateLogEvent::NewL(TUid::Uid(0), NULL);
+	iAssistanceDataLogIntiailisedFromValuesFirst = CLbsAssistanceDataLogEvent::NewL(0, 0);	
+	
+	//Setup other reference position
+	iRefPosTwo = new TPositionInfo();
+	TPosition refpos;
+	refpos.SetCoordinate(REFPOS_LAT, REFPOS_LONG, REFPOS_ALT);
+	refpos.SetAccuracy(REFPOS_HORZ_ACCURACY, REFPOS_VERT_ACCURACY);
+	refpos.SetCurrentTime();
+	iRefPosTwo->SetPosition(refpos);
+	
+	
+	// read logs using CLogViewEvent
+	TInt ErrorCode = itheFs.Connect();
+	if(ErrorCode)
+		{
+		INFO_PRINTF1(_L("\t Error: Open FileServer failed."));
+		SetTestStepResult(EFail);
+		}
+		
+    iclient = CLogClient::NewL(itheFs, CActive::EPriorityStandard);
+	iview = CLogViewEvent::NewL(*iclient, CActive::EPriorityStandard);
+	
+	iActiveWaiter = CT_LbsAsyncWaiter::NewL();			// NEW iActiveWaiter
+	
+	}
+/**
+ * Destructor
+ */
+CT_LbsStep_VerifyLogInfo::~CT_LbsStep_VerifyLogInfo()
+	{
+	iview->Cancel();
+	iclient->Cancel();
+	delete iview;
+	delete iclient;
+	itheFs.Close();
+	delete iActiveWaiter;
+	// Delete everything for the right hand side of all compares
+	delete iRefPosTwo;
+	delete iSelfLocateLogIntiailisedFromValues;
+	delete iExternalLocateLogIntiailisedFromValues;
+	delete iNetworkLocateLogIntiailisedFromValues;
+	delete iAssistanceDataLogIntiailisedFromValuesFirst;
+	delete iX3PLogIntiailisedFromValues;
+
+	}
+
+
+/**
+ * Constructor
+ */
+CT_LbsStep_VerifyLogInfo::CT_LbsStep_VerifyLogInfo(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_VerifyLogInfo);
+	}
+
+
+TVerdict CT_LbsStep_VerifyLogInfo::doTestStepPreambleL()
+	{
+
+	return TestStepResult();
+	}
+
+TVerdict CT_LbsStep_VerifyLogInfo::doTestStepPostambleL()
+	{
+
+	return TestStepResult();
+	}
+
+
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsStep_VerifyLogInfo::doTestStepL()
+	{
+	// Helper test step used to Verify the Position Information Array.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_VerifyLogInfo::doTestStepL()"));
+
+	if (TestStepResult() == EPass)
+		{
+		
+		// Left and right parameters of compare functions.
+		if (GetIntFromConfig(ConfigSection(), KLogType, iLogType))
+			{
+
+
+			if(iParent.iSharedData->iTestModuleInUse) 
+				{
+				iWhatAccuracyToUse = T_LbsUtils::EExactAccuracy;
+				}
+			else
+				{
+				iWhatAccuracyToUse = T_LbsUtils::ERoughAccuracy;
+				}
+				
+			InitialiseRHS();
+			
+			switch(iLogType)
+				{
+				case EAutonomousSelfLocateRequest: // Enum 0
+	        		{
+	        		AutonomousSelfLocateLogTest();
+	        		}
+				break;
+				
+				case EMOLRSelfLocateRequest: // Enum 1
+		        	{
+					MOLRSelfLocateRequest();
+		        	}
+		        break;
+				
+				case EMOLRCellBasedLocationRequest: // Enum 2
+					{
+					MOLRCellBasedLocationRequest();
+					}
+				break;
+				
+				case EMOLRTransmitTo3rdPartyLocationRequest: // Enum 3
+				    {
+					MOLRTransmitTo3rdPartyLocationRequest();
+				    }
+		       	break;
+		       	
+				case EMTLR: // Enum 4
+		       		{
+					MTLR();
+		       		}
+		       	break;
+		       				
+				case EMOLRTrackingLocationRequest: // Enum 5
+			       	{
+		       		MOLRTrackingLocationRequest();
+		       		}
+		       	break;
+				
+				case EAutonomousTrackingLocationRequest: // Enum 6
+		       		{
+		       		AutonomousTrackingLocationRequest();
+		       		}
+		       	break;
+							
+				default:
+					{
+					INFO_PRINTF1(_L("<FONT><B>Failed to match a test case Id.</B></FONT>"));
+					SetTestStepResult(EFail);				
+					}
+				break;
+				}// End of switch
+			
+			ClearLog();
+			}// End of GetIntFromConfig()...
+				
+		} // End of "If TestStepResult..."
+
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_VerifyLogInfo::doTestStepL()"));
+
+	return TestStepResult();
+	}
+TVerdict CT_LbsStep_VerifyLogInfo::ReadFromLogL(TInt aUidForTheLogType)
+	{		
+
+	/**
+	 * Filter the type of log we are looking for based on UID 
+	 */
+	CLogFilter* filter = CLogFilter::NewL();			// NEW FILTER
+	CleanupStack::PushL(filter);
+	filter->SetEventType(TUid::Uid(aUidForTheLogType));
+	
+	/*
+	 * Obtain the last added event from LBS logger 		
+	 */
+	TBool res = iview->SetFilterL(*filter, iActiveWaiter->iStatus);
+	if (res == EFail)
+		{
+		INFO_PRINTF1(_L("\t Error: Set filter failed."));
+		return EFail;
+		}
+
+	iActiveWaiter->StartAndWait();
+	if (iActiveWaiter->iStatus != KErrNone)
+		{
+		INFO_PRINTF1(_L("\t Error: Create Log iview failed."));
+		return EFail;
+		}
+
+	/* 
+	 * Count how many of these events there are and 
+	 * store each event in the relevant array 
+	 */	 
+	
+	TInt count = iview->CountL();
+	TLinearOrder<CLbsSelfLocateLogEvent> selfLocLogOrder(SelfLocateLogEventTimestampCompare);
+	for(int i=0 ; i<count ; i++)
+		{
+		// Start at first event to have occured...
+		if(i==0 && count > 0)
+			{
+			// Get first event in order of occurance
+			if(!iview->LastL(iActiveWaiter->iStatus))
+				{
+				INFO_PRINTF2(_L("\t Error: Read last log failed with error %d."), iActiveWaiter->iStatus.Int());
+				return EFail;
+				}
+			}
+			
+		if(i>0 && i<count)
+			{
+			// Cancel outstanding request...
+			iActiveWaiter->Cancel();
+			iActiveWaiter->StartAndWait();
+			if (iActiveWaiter->iStatus != KErrNone)
+				{
+				INFO_PRINTF1(_L("\t Error: Failed to cancel outstanding request."));
+				return EFail;
+				}
+				
+			// Move onto the next event in order of occurance and store it in succession
+			if(!iview->PreviousL(iActiveWaiter->iStatus))
+				{
+				INFO_PRINTF2(_L("\t Error: Read previous log failed with error %d."), iActiveWaiter->iStatus.Int());
+				return EFail;	
+				}
+			}
+
+		CLogEvent* logEvent = CLogEvent::NewL();		// NEW LOGEVENT
+		CleanupStack::PushL(logEvent);
+		logEvent->CopyL(iview->Event());
+		
+		// Pass ownership to the relevant array
+		switch(aUidForTheLogType) 
+		{
+		case KLogLbsSelfLocateEventType:
+			{
+			RPointerArray<CLbsSelfLocateLogEvent>& logInfoArr = iParent.iSharedData->iSelfLocateLogInfoArr;	
+			CLbsSelfLocateLogEvent* selfLocateEv = static_cast<CLbsSelfLocateLogEvent*>(CLbsLogEvent::NewL(*logEvent));
+			CleanupStack::PushL(selfLocateEv);
+			// SelfLoc Log events seem to be returned out of order, so wee need to sort them
+			logInfoArr.InsertInOrder(selfLocateEv, selfLocLogOrder);
+			CleanupStack::Pop(selfLocateEv);
+			}
+			break;
+
+		case KLogLbsNetworkLocateEventType:
+			{
+			RPointerArray<CLbsNetworkLocateLogEvent>& logInfoArr = iParent.iSharedData->iNetworkLocateLogInfoArr;	
+			CLbsNetworkLocateLogEvent* networkLocateEv = static_cast<CLbsNetworkLocateLogEvent*>(CLbsLogEvent::NewL(*logEvent));
+			CleanupStack::PushL(networkLocateEv);
+			logInfoArr.AppendL(networkLocateEv); // Store it in the array
+			CleanupStack::Pop(networkLocateEv);			}
+			break;
+
+		case KLogLbsExternalLocateEventType:
+			{
+			RPointerArray<CLbsExternalLocateLogEvent>& logInfoArr = iParent.iSharedData->iExternalLocateLogInfoArr;			
+			CLbsExternalLocateLogEvent* externalLocateEv = static_cast<CLbsExternalLocateLogEvent*>(CLbsLogEvent::NewL(*logEvent));
+			CleanupStack::PushL(externalLocateEv);
+			logInfoArr.AppendL(externalLocateEv); // Store it in the array
+			CleanupStack::Pop(externalLocateEv);
+			}
+		break;
+
+		case KLogLbsTransmitLocationEventType:
+			{
+			RPointerArray<CLbsTransmitLocationLogEvent>& logInfoArr = iParent.iSharedData->iX3PLocateLogInfoArr;			
+			CLbsTransmitLocationLogEvent* x3pLocateEv = static_cast<CLbsTransmitLocationLogEvent*>(CLbsLogEvent::NewL(*logEvent));
+			CleanupStack::PushL(x3pLocateEv);
+			logInfoArr.AppendL(x3pLocateEv); // Store it in the array
+			CleanupStack::Pop(x3pLocateEv);
+			}
+		break;
+
+		case KLogLbsAssistanceDataEventType:
+			{
+			RPointerArray<CLbsAssistanceDataLogEvent>& logInfoArr = iParent.iSharedData->iAssistanceDataLogInfoArr;	
+			CLbsAssistanceDataLogEvent* assistanceLogEv = static_cast<CLbsAssistanceDataLogEvent*>(CLbsLogEvent::NewL(*logEvent));
+			CleanupStack::PushL(assistanceLogEv);
+			logInfoArr.AppendL(assistanceLogEv); // Store it in the array
+			CleanupStack::Pop(assistanceLogEv);
+			}
+		break;	
+
+		default:
+			{
+			INFO_PRINTF1(_L("\t Error: Couldnt match UID to a testable logtype."));
+			i = count; // Force loop exit
+			SetTestStepResult(EFail);
+			}		
+		}
+		
+		// Cleanup scoped variables
+		CleanupStack::PopAndDestroy(logEvent);
+		}// End of for loop
+		
+		// Cancel outstanding request...
+		iActiveWaiter->Cancel();
+		iActiveWaiter->StartAndWait();
+		if (iActiveWaiter->iStatus != KErrNone)
+			{
+			INFO_PRINTF1(_L("\t Error: Failed to cancel any outstanding requests."));
+			return EFail;
+			}
+
+	// Cleanup local variables
+	CleanupStack::PopAndDestroy(filter);
+				
+	return EPass;	
+	}
+	
+void CT_LbsStep_VerifyLogInfo::SelfLocateLogTest()
+	{
+
+	INFO_PRINTF1(_L("* * * * * * * * * * * * * * * * * * * * * *"));
+	INFO_PRINTF1(_L("SelfLocateLogTest>>"));
+	TVerdict res;
+	TBool compareResult;
+	
+	//	Empty SharedData values between update options tests
+	iParent.iSharedData->iSelfLocateLogInfoArr.Reset();
+			
+	// reads all self-locate log entries into iSelfLocateLogInfoArr:
+	res = ReadFromLogL(KLogLbsSelfLocateEventType);
+	
+	if (res == EFail) // if readfromlog fails...
+		{
+		INFO_PRINTF1(_L("<FONT><b>SelfLocateRequest > ReadFromLog Failed</b></font>"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+				
+		// Compare DB log event and expected log event
+		INFO_PRINTF1(_L("SelfLocateRequest > About to compare..."));
+		
+	
+		RPointerArray<CLbsSelfLocateLogEvent>& logInfoArr = iParent.iSharedData->iSelfLocateLogInfoArr;
+		
+		TInt sizeOfArray = logInfoArr.Count();
+		
+		if(	((sizeOfArray != 2) && (iLogType == EAutonomousTrackingLocationRequest)) ||
+			((sizeOfArray != 3) && (iLogType == EMOLRTrackingLocationRequest))
+			)
+			{
+			INFO_PRINTF2(_L("<FONT><b>Update Log test failed, there were %d Self Locate events</b></font>"),sizeOfArray);
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			//	Change reference location to be expected value
+			TPositionInfo* posInfoSecond = new TPositionInfo();
+			SecondPositionFromArray(posInfoSecond);
+			
+			for(TInt i = 0 ; i < sizeOfArray ; i++)
+				{
+				// note that events are in reverse order, therefore the reference position is last rather than first of 2
+				if(iLogType == EMOLRTrackingLocationRequest && i == 2)
+					{
+					iSelfLocateLogIntiailisedFromValues->SetPositionInfo(posInfoSecond);		
+					}
+				
+			
+				if(iLogType == EMOLRSelfLocateRequest && i == 1)
+					{
+					iSelfLocateLogIntiailisedFromValues->SetPositionInfo(posInfoSecond);
+					}
+				
+				compareResult = iUtils.Compare_SelfLocateLog(	*(reinterpret_cast<CLbsSelfLocateLogEvent*>(logInfoArr[i])) , 
+																*iSelfLocateLogIntiailisedFromValues
+															);	
+				if(!compareResult)
+					{
+					INFO_PRINTF2(_L("<FONT><b>SelfLocateRequest > compare returns false for element %d...</b></font>"),i);
+					SetTestStepResult(EFail);
+					}
+				else
+					{
+					INFO_PRINTF1(_L("SelfLocateRequest > compare returns true..."));
+					}
+				}
+				
+			delete posInfoSecond;
+		
+			}
+		}
+	
+	INFO_PRINTF1(_L("SelfLocateLogTest<<"));
+	INFO_PRINTF1(_L("* * * * * * * * * * * * * * * * * * * * * *"));
+	}
+
+
+void CT_LbsStep_VerifyLogInfo::NetworkLocateLogTest()
+	{
+	INFO_PRINTF1(_L("* * * * * * * * * * * * * * * * * * * * * *"));
+	INFO_PRINTF1(_L("NetworkLocateLogTest>>"));
+	TVerdict res;
+	TBool compareResult;
+
+	res = ReadFromLogL(KLogLbsNetworkLocateEventType);
+	
+	if (res == EFail) // if readfromlog fails...
+		{
+		INFO_PRINTF1(_L("<FONT><b>NetworkLocateRequest > Readfrom log failed</b></font>"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		// Compare DB log event and expected log event
+		INFO_PRINTF1(_L("NetworkSelfLocateRequest > About to compare..."));
+		
+		RPointerArray<CLbsNetworkLocateLogEvent>& logInfoArr = iParent.iSharedData->iNetworkLocateLogInfoArr;
+		
+		TInt sizeOfArray = logInfoArr.Count();
+		
+		
+		for(TInt i = 0 ; i < sizeOfArray ; i++)
+			{
+			
+			compareResult = iUtils.Compare_NetworkLocateLog(	*(reinterpret_cast<CLbsNetworkLocateLogEvent*>(logInfoArr[i])) , 
+																*iNetworkLocateLogIntiailisedFromValues
+														);	
+			if(!compareResult)
+				{
+				INFO_PRINTF2(_L("<FONT><b>NetworkLocateRequest > compare returns false for element %d...</b></font>"),i);
+				SetTestStepResult(EFail);
+				}
+			else
+				{
+				INFO_PRINTF1(_L("NetworkLocateRequest > compare returns true..."));
+				}	
+			}
+
+		}
+		
+	INFO_PRINTF1(_L("NetworkLocateLogTest<<"));
+	INFO_PRINTF1(_L("* * * * * * * * * * * * * * * * * * * * * *"));
+	}
+
+void CT_LbsStep_VerifyLogInfo::ExternalLocateLogTest()
+	{
+
+	INFO_PRINTF1(_L("* * * * * * * * * * * * * * * * * * * * * *"));
+	INFO_PRINTF1(_L("ExternalLocateLogTest>>"));
+	TVerdict res;
+	TBool compareResult;
+	
+	res = ReadFromLogL(KLogLbsExternalLocateEventType);
+	
+	if (res == EFail) // if readfromlog fails...
+		{
+		INFO_PRINTF1(_L("<FONT><b>ExternalLocateRequest > ReadFromLog Failed</b></font>"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		// Compare DB log event and expected log event
+		INFO_PRINTF1(_L("NetworkSelfLocateRequest > About to compare..."));
+
+		RPointerArray<CLbsExternalLocateLogEvent>& logInfoArr = iParent.iSharedData->iExternalLocateLogInfoArr;
+		
+		TInt sizeOfArray = logInfoArr.Count();
+		TPositionInfo* posInfoSecond = new TPositionInfo();
+		TPositionInfo* commonPosinfo = CommonPositionInfo();
+		for(TInt i = 0 ; i < sizeOfArray ; i++)
+			{			
+			if(iLogType==EMOLRTrackingLocationRequest && i%2==1)
+				{
+				TInt gatewayId = 271064388;	//	KLbsGpsLocManagerUidValue	
+				TUid gatewayUid = TUid::Uid(gatewayId);
+				iExternalLocateLogIntiailisedFromValues->SetRequestOriginator(gatewayUid);
+							
+				TLbsRequestOutcome tweakedOutcome = ELbsRequestOutcomeInconclusive;
+				iExternalLocateLogIntiailisedFromValues->SetRequestOutcome(tweakedOutcome); 	
+
+				SecondPositionFromArray(posInfoSecond);
+				iExternalLocateLogIntiailisedFromValues->SetReferenceLocation(posInfoSecond);
+				iExternalLocateLogIntiailisedFromValues->SetPositionInfo(commonPosinfo);
+				}
+
+			// logtype 5
+			if(iLogType==EMOLRTrackingLocationRequest && i%2==0)
+				{
+				TInt gatewayId = 271064388;	//	KLbsGpsLocManagerUidValueS	
+				TUid gatewayUid = TUid::Uid(gatewayId);
+				iExternalLocateLogIntiailisedFromValues->SetRequestOriginator(gatewayUid);
+				
+				//	Change outcome to expected value			
+				TLbsRequestOutcome tweakedOutcome = ELbsRequestOutcomeSuccess;
+				iExternalLocateLogIntiailisedFromValues->SetRequestOutcome(tweakedOutcome);
+				
+				//	Change reference location to be expected value
+				// Set the reference position, which also be used for any required verification.
+				TPosition refPos;
+				TPositionInfo* posInfo = new TPositionInfo();
+				refPos.SetCoordinate(REFPOS_LAT_OTHER, REFPOS_LONG_OTHER, REFPOS_ALT_OTHER);
+				refPos.SetAccuracy(REFPOS_HORZ_ACCURACY_OTHER, REFPOS_VERT_ACCURACY_OTHER);
+				refPos.SetCurrentTime();
+				static_cast<TPositionInfo*>(posInfo)->SetPosition(refPos);
+
+				iExternalLocateLogIntiailisedFromValues->SetReferenceLocation(posInfo);
+				delete posInfo;
+				}
+				
+			// logtype 1
+			if(iLogType==EMOLRSelfLocateRequest)
+			{
+				TInt locManagerId = 271064388;	//	KLbsGpsLocManagerUidValue
+				TUid locManagerUid = TUid::Uid(locManagerId);
+				iExternalLocateLogIntiailisedFromValues->SetRequestOriginator(locManagerUid);
+				
+				//	Change outcome to expected value			
+				TLbsRequestOutcome tweakedOutcome = ELbsRequestOutcomeSuccess;
+				iExternalLocateLogIntiailisedFromValues->SetRequestOutcome(tweakedOutcome);
+
+				//	Expect position to be NULL for first event
+				//	Set expected outcome of second External event
+				if(i==1)
+					{
+					TLbsRequestOutcome tweakedOutcome = ELbsRequestOutcomeInconclusive;
+					iExternalLocateLogIntiailisedFromValues->SetRequestOutcome(tweakedOutcome); 	
+					iExternalLocateLogIntiailisedFromValues->SetPositionInfo(commonPosinfo);
+					iExternalLocateLogIntiailisedFromValues->SetReferenceLocation(iRefPosTwo);
+					}
+			}
+			
+			if(iLogType==EMOLRTransmitTo3rdPartyLocationRequest && i==1)
+				{
+				TLbsRequestOutcome tweakedOutcome = ELbsRequestOutcomeInconclusive;
+				iExternalLocateLogIntiailisedFromValues->SetRequestOutcome(tweakedOutcome);
+				SecondPositionFromArray(posInfoSecond);
+				iExternalLocateLogIntiailisedFromValues->SetReferenceLocation(posInfoSecond);			 	
+				}
+				
+			if(iLogType==EMOLRTransmitTo3rdPartyLocationRequest && i==1)
+				{
+				iExternalLocateLogIntiailisedFromValues->SetPositionInfo(commonPosinfo);
+				}
+
+				
+			if(iLogType == EMTLR)
+				{
+				iExternalLocateLogIntiailisedFromValues->SetPositionInfo(commonPosinfo);
+				InitialiseRHSforMTLR();
+				}
+
+			
+			compareResult = iUtils.Compare_ExternalLocateLog(	*(reinterpret_cast<CLbsExternalLocateLogEvent*>(logInfoArr[i])) , 
+																*iExternalLocateLogIntiailisedFromValues
+															);	
+			if(!compareResult)
+				{
+				INFO_PRINTF2(_L("<FONT><b>ExternalLocateLog > compare returns false for element %d...</b></font>"),i);
+				SetTestStepResult(EFail);
+				}
+			else
+				{
+				INFO_PRINTF1(_L("ExternalLocateLog > compare returns true..."));
+				}
+			} // End for loop
+		delete commonPosinfo;
+		delete posInfoSecond;	
+		}
+		
+	INFO_PRINTF1(_L("ExternalLocateLogTest<<"));
+	INFO_PRINTF1(_L("* * * * * * * * * * * * * * * * * * * * * *"));
+
+	}
+	
+void CT_LbsStep_VerifyLogInfo::X3PLocateLogTest()
+	{
+	INFO_PRINTF1(_L("* * * * * * * * * * * * * * * * * * * * * *"));
+	INFO_PRINTF1(_L("X3PLocateLogTest>>"));
+	TVerdict res;
+	TBool compareResult;
+
+	res = ReadFromLogL(KLogLbsTransmitLocationEventType);
+	
+	if (res == EFail) // if readfromlog fails...
+		{
+		INFO_PRINTF1(_L("<FONT><b>X3PLocateRequest > ReadFromLog Failed</B></FONT>"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		// Compare DB log event and expected log event
+		INFO_PRINTF1(_L("X3PLocateLog > About to compare..."));
+		
+		RPointerArray<CLbsTransmitLocationLogEvent>& logInfoArr = iParent.iSharedData->iX3PLocateLogInfoArr;
+
+		TInt sizeOfArray = logInfoArr.Count();
+		
+		for(TInt i = 0 ; i < sizeOfArray ; i++)
+			{
+			compareResult = iUtils.Compare_TransmitLocationLog(	*(reinterpret_cast<CLbsTransmitLocationLogEvent*>(logInfoArr[i])) , 
+													*iX3PLogIntiailisedFromValues
+														);	
+			if(!compareResult)
+				{
+				INFO_PRINTF2(_L("<FONT><b>X3PLocateLogTest > compare returns false for element %d...</b></font>"),i);
+				SetTestStepResult(EFail);
+				}
+			else
+				{
+				INFO_PRINTF1(_L("X3PLocateLogTest > compare returns true..."));
+				}
+			}	
+		}
+
+	INFO_PRINTF1(_L("X3PLocateLogTest<<"));
+	INFO_PRINTF1(_L("* * * * * * * * * * * * * * * * * * * * * *"));
+	}
+
+void CT_LbsStep_VerifyLogInfo::AssistanceDataLogTest()
+	{
+
+	INFO_PRINTF1(_L("* * * * * * * * * * * * * * * * * * * * * *"));
+	INFO_PRINTF1(_L("AssistanceDataLogTest>>"));
+	TVerdict res;
+	TBool compareResult = ETrue;
+
+	res = ReadFromLogL(KLogLbsAssistanceDataEventType);
+	
+	if (res == EFail) // if readfromlog fails...
+		{
+		INFO_PRINTF1(_L("<FONT><b>AssistanceDataLog > ReadFromLog Failed</b></font>"));
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		// Compare DB log event and expected log event
+		INFO_PRINTF1(_L("AssistanceDataLog > About to compare..."));
+		
+		RPointerArray<CLbsAssistanceDataLogEvent>& logInfoArr = iParent.iSharedData->iAssistanceDataLogInfoArr;
+		
+		TInt sizeOfArray = logInfoArr.Count();
+		TPositionInfo* commonPosinfo = CommonPositionInfo();
+		for(TInt i = 0 ; i < sizeOfArray ; i++)
+			{
+		
+			if(	iLogType == EMOLRTrackingLocationRequest || 
+				iLogType ==EMOLRTransmitTo3rdPartyLocationRequest )
+				{
+				iAssistanceDataLogIntiailisedFromValuesFirst->SetRequestAssistanceDataType(0);	
+				}
+							
+			
+			/*
+		 	 *	If we run X3P log test on its own we get logs that are different than when its run 
+		 	 *	in sequence with other tests.
+			 */
+			if(sizeOfArray > 1 && iLogType ==EMOLRTransmitTo3rdPartyLocationRequest) 
+				{
+				if(i==1)
+					{
+					//	Second log has a mask of 0
+					iAssistanceDataLogIntiailisedFromValuesFirst->SetRequestAssistanceDataType(0);
+					compareResult = iUtils.Compare_AssistanceDataLog(	*(reinterpret_cast<CLbsAssistanceDataLogEvent*>(logInfoArr[i])) , 
+																		*iAssistanceDataLogIntiailisedFromValuesFirst
+																	);
+					}
+				else
+					{
+					iAssistanceDataLogIntiailisedFromValuesFirst->SetRequestAssistanceDataType(8);
+					compareResult = iUtils.Compare_AssistanceDataLog(	*(reinterpret_cast<CLbsAssistanceDataLogEvent*>(logInfoArr[i])) , 
+																		*iAssistanceDataLogIntiailisedFromValuesFirst
+																	);											
+					}	
+				} 
+
+			if(!compareResult)
+				{
+				INFO_PRINTF2(_L("<FONT><b>AssistanceDataLogTest > compare returns false for element %d...</b></FONT>"),i);
+				SetTestStepResult(EFail);
+				}
+			else
+				{
+				INFO_PRINTF1(_L("AssistanceDataLogTest > compare returns true..."));
+				}
+			}//	End of for loop
+			delete commonPosinfo;
+		}
+	
+	INFO_PRINTF1(_L("AssistanceDataLogTest<<"));
+	INFO_PRINTF1(_L("* * * * * * * * * * * * * * * * * * * * * *"));
+	}
+
+
+
+// Top level functionality
+
+void CT_LbsStep_VerifyLogInfo::AutonomousSelfLocateLogTest()
+	{
+	SelfLocateLogTest();
+	}
+
+void CT_LbsStep_VerifyLogInfo::MOLRSelfLocateRequest() 	// ** Similar **
+	{
+    ExternalLocateLogTest();
+	AssistanceDataLogTest();
+	SelfLocateLogTest();
+	}
+
+void CT_LbsStep_VerifyLogInfo::MOLRCellBasedLocationRequest()
+	{
+	NetworkLocateLogTest();
+	}
+
+void CT_LbsStep_VerifyLogInfo::MOLRTransmitTo3rdPartyLocationRequest()
+	{
+	AssistanceDataLogTest();
+    ExternalLocateLogTest();
+    X3PLocateLogTest();
+	}
+
+void CT_LbsStep_VerifyLogInfo::MTLR()	// ** Similar **
+	{
+	//	SelfLocateLogTest();
+	ExternalLocateLogTest();
+	AssistanceDataLogTest();
+	}
+
+void CT_LbsStep_VerifyLogInfo::MOLRTrackingLocationRequest()	// ** Similar **
+	{
+	SelfLocateLogTest();
+	AssistanceDataLogTest();
+	ExternalLocateLogTest();
+    }
+
+void CT_LbsStep_VerifyLogInfo::AutonomousTrackingLocationRequest()
+	{
+	SelfLocateLogTest();
+	}
+
+
+
+
+void CT_LbsStep_VerifyLogInfo::InitialiseRHS()
+	{
+	//	Variables needed for all reads
+	//	CommonToAll
+	TBool direction; // Inbound or outbound
+	
+	// wont be filled in components ELbsRequestOutcomeSuccess/ELbsRequestOutcomeFailed/...Inconclusive etc
+	TLbsRequestOutcome theSelfLocateRequestOutcome;
+	TLbsRequestOutcome theX3PRequestOutcome;
+	TLbsRequestOutcome theExternalLocateRequestOutcome;
+	TLbsRequestOutcome theNetworkLocateRequestOutcome;
+	TLbsRequestOutcome theAssistanceDataRequestOutcome;
+
+	//	Common to 4/5 but not assistance
+	TInt theCost;	// not implemented
+
+	//	Common to 4/5 but not external
+	TUid theLocalAppUid; 	// work out from PID
+
+	//	Common only to External Locate
+	TInt theOriginator;	// From network gateway
+	TInt theSessionNum;	// TNetLocSessionID?
+	TInt theSessionOwner;	// TNetLocSessionID?
+	TInt theAction;		// Set within privacy request
+	TInt theAdvice;		// Set within privacy request
+	TPtrC theClientName;	// Set within privacy request
+	TPtrC theExternalId;	// Set within privacy request
+	TPtrC theRequestor;	// Set within privacy request
+	TInt theResult;		// ENum within privacy response
+
+	//	Common only to X3P Locate
+	TUid theX3PUid;	 	// work out from PID
+	
+	//	Common only to Assistance
+	TInt theFirstRequestMask;	// Set within GPSlocmanager	// Set within GPSlocmanager for wanted
+	TInt theReceiveMask;	// Set within GPSlocmanager	// Set within GPSlocmanager for recieved
+	
+
+	//	Specialised variables
+	theCost = 0;
+	theLocalAppUid = TUid::Uid(RProcess().SecureId()); // Get this from ProcessId each time
+	TInt testX3PserverId = 271065697;
+	theX3PUid = TUid::Uid(testX3PserverId);	//	Id of NRH
+	TInt locServerAppId = 271064387;
+	TUid locServerAppUid = TUid::Uid(locServerAppId);
+
+	direction = EFalse;
+		
+	theSelfLocateRequestOutcome = ELbsRequestOutcomeSuccess;	// or ELbsRequestOutcomeFailed or Inconclusive etc
+	theX3PRequestOutcome = ELbsRequestOutcomeSuccess;// Set it to this for X3P test
+	theExternalLocateRequestOutcome = ELbsRequestOutcomeSuccess;
+	theNetworkLocateRequestOutcome = ELbsRequestOutcomeSuccess;
+	theAssistanceDataRequestOutcome = ELbsRequestOutcomeInconclusive; // Set it to this for X3P test
+
+	TPositionInfo* commonPosinfo = CommonPositionInfo();
+	
+	
+	//	Set up relevant 5 Log variables for comparison using position info etc
+	//	SELF LOCATE LOG
+	iSelfLocateLogIntiailisedFromValues->SetPositionInfo(commonPosinfo); 
+	iSelfLocateLogIntiailisedFromValues->SetDirection(direction);
+	iSelfLocateLogIntiailisedFromValues->SetLocalApp(theLocalAppUid);	// This apps UID
+	iSelfLocateLogIntiailisedFromValues->SetCostInformation(theCost); // set cost information if there are any;
+	iSelfLocateLogIntiailisedFromValues->SetRequestOutcome(theSelfLocateRequestOutcome); // by passing the location request outcome;	
+	
+	
+	//	EXTERNAL LOG
+	iExternalLocateLogIntiailisedFromValues->SetDirection(direction);
+	iExternalLocateLogIntiailisedFromValues->SetCostInformation(theCost);
+	iExternalLocateLogIntiailisedFromValues->SetRequestOutcome(theExternalLocateRequestOutcome); // by passing the location request outcome;	
+	//	No local app id to set for external log
+	//	Common only to External Locate
+	theOriginator = 271064389;		//	From Network request handler
+	theSessionOwner = 0;	//	268440115 TNetLocSessionID?
+	theSessionNum = 0;	// TNetLocSessionID?
+	theAction = 0;		// Set within privacy request 0
+	theAdvice = 0;		// Set within privacy request 0 = ERequestAdviceNotUsed, 1 = ERequestActionAllow
+	
+	_LIT(KClientName,"");
+	_LIT(KRequestor,"");
+	_LIT(KExternalId,"");
+	theClientName.Set(KClientName);	// Set within privacy request
+	theRequestor.Set(KRequestor);	// Set within privacy request
+	theExternalId.Set(KExternalId);	// Set within privacy request
+	theResult = 0;		// ENum within privacy response, 1 = ERequestAccepted
+	
+	// set privacy request parameters
+	TLbsLoggingPrivacyRequestParams reqParams; 
+	TLbsNetSessionId sessionId(TUid::Uid(0), (TUint32)theSessionNum);
+	reqParams.iSessionId.SetSessionOwner(TUid::Uid(theSessionOwner));
+	reqParams.iSessionId.SetSessionNum(theSessionNum);
+	reqParams.iRequestPrivacy.SetRequestAction((TLbsNetPosRequestPrivacy::TLbsRequestAction)theAction);
+	reqParams.iRequestPrivacy.SetRequestAdvice((TLbsNetPosRequestPrivacy::TLbsRequestAdvice)theAdvice);
+	
+	TPtrC8 ptrReq((TUint8*)theRequestor.Ptr(), theRequestor.Size());			
+	TPtrC8 ptrClient((TUint8*)theClientName.Ptr(), theClientName.Size());			
+	TPtrC8 ptrId((TUint8*)theExternalId.Ptr(), theExternalId.Size());			
+	reqParams.iRequestInfo.SetRequesterId(reinterpret_cast<const TDesC8&>(ptrReq));
+	reqParams.iRequestInfo.SetClientName(reinterpret_cast<const TDesC8&>(ptrClient));
+	reqParams.iRequestInfo.SetClientExternalId(reinterpret_cast<const TDesC8&>(ptrId));
+
+	//	set privacy response parameters
+	TLbsLoggingPrivacyResponseParams respParams;
+	respParams.iSessionId.SetSessionOwner(TUid::Uid(0));
+	respParams.iSessionId.SetSessionNum(0);
+	respParams.iResult = static_cast<CLbsNetworkProtocolBase::TLbsPrivacyResponse>(theResult);
+
+	iExternalLocateLogIntiailisedFromValues->SetRequestOriginator(TUid::Uid(theOriginator));
+	iExternalLocateLogIntiailisedFromValues->SetPrivacyRequestParams(reqParams); // set privacy request parameters from request originator
+	iExternalLocateLogIntiailisedFromValues->SetPrivacyResponseParams(respParams); // set privacy response parameters from privacy controller
+	iExternalLocateLogIntiailisedFromValues->SetReferenceLocation(commonPosinfo);
+
+	
+	//	X3P LOG	
+	iX3PLogIntiailisedFromValues->SetPositionInfo(commonPosinfo); 
+	iX3PLogIntiailisedFromValues->SetDirection(direction);
+	iX3PLogIntiailisedFromValues->SetCostInformation(theCost); // set cost information if there are any;
+	iX3PLogIntiailisedFromValues->SetRequestOutcome(theX3PRequestOutcome); // by passing the location request outcome;	
+	//	X3P log only
+	iX3PLogIntiailisedFromValues->SetX3PApp(theX3PUid);	// This apps Uid
+
+	
+		
+	//	FIRST ASSISTANCE DATA LOG
+	iAssistanceDataLogIntiailisedFromValuesFirst->SetDirection(direction);
+	iAssistanceDataLogIntiailisedFromValuesFirst->SetRequestOutcome(theAssistanceDataRequestOutcome); // by passing the location request outcome;	
+	//	No cost to set for assistance log
+	//	Common only to Assistance
+	theFirstRequestMask = 8;	//	Set within GPSlocmanager for wanted (8 for first in array, 0 for second)
+	theReceiveMask = 8;	//	Set within GPSlocmanager for recieved
+	iAssistanceDataLogIntiailisedFromValuesFirst->SetRequestAssistanceDataType(theFirstRequestMask);
+	iAssistanceDataLogIntiailisedFromValuesFirst->SetReceiveAssistanceDataType(theReceiveMask);
+
+
+
+	//	NETWORK LOCATE LOG
+	commonPosinfo->SetModuleId(TUid::Uid(0));
+	
+	iNetworkLocateLogIntiailisedFromValues->SetPositionInfo(commonPosinfo); 
+	iNetworkLocateLogIntiailisedFromValues->SetDirection(direction);
+	iNetworkLocateLogIntiailisedFromValues->SetCostInformation(theCost); // set cost information if there are any;
+	iNetworkLocateLogIntiailisedFromValues->SetRequestOutcome(theNetworkLocateRequestOutcome); // by passing the location request outcome;	
+	iNetworkLocateLogIntiailisedFromValues->SetLocalApp(locServerAppUid);	// This apps UID
+	
+	delete commonPosinfo;			
+	}
+	
+void CT_LbsStep_VerifyLogInfo::InitialiseRHSforMTLR()
+	{
+	//	For MTLR, most of the expected external logs values need to be completely different.
+
+	TInt theOriginator;	// From network gateway
+	TInt theSessionNum;	// TNetLocSessionID?
+	TInt theSessionOwner;	// TNetLocSessionID?
+	TInt theAction;		// Set within privacy request
+	TInt theAdvice;		// Set within privacy request
+	TPtrC8 theClientName;	// Set within privacy request
+	TPtrC8 theExternalId;	// Set within privacy request
+	TPtrC8 theRequestor;	// Set within privacy request
+	TInt theRequestResult;		// ENum within privacy response
+
+	theOriginator = 271064432;		//	From Protocol Module
+	theSessionOwner = 271064432;	//	Protocol Module
+	theSessionNum = 1;	// TNetLocSessionID?
+	theAction = 1;		// Set within privacy request 0
+	theAdvice = 1;		// Set within privacy request 0 = ERequestAdviceNotUsed, 1 = ERequestActionAllow
+	
+	_LIT8(KMTLRClientName,"MT-LR test client name");
+	_LIT8(KMTLRRequestor,"MT-LR test requester id");
+	_LIT8(KMTLRExternalId,"MT-LR test client external id");
+	theClientName.Set(KMTLRClientName);	// Set within privacy request
+	theRequestor.Set(KMTLRRequestor);	// Set within privacy request
+	theExternalId.Set(KMTLRExternalId);	// Set within privacy request
+	theRequestResult = 1;		// ENum within privacy response, 1 = ERequestAccepted
+
+
+	// set privacy request parameters
+	TLbsLoggingPrivacyRequestParams reqParams; 
+	TLbsNetSessionId sessionId(TUid::Uid(0), (TUint32)theSessionNum);
+	reqParams.iSessionId.SetSessionOwner(TUid::Uid(theSessionOwner));
+	reqParams.iSessionId.SetSessionNum(theSessionNum);
+	reqParams.iRequestPrivacy.SetRequestAction((TLbsNetPosRequestPrivacy::TLbsRequestAction)theAction);
+	reqParams.iRequestPrivacy.SetRequestAdvice((TLbsNetPosRequestPrivacy::TLbsRequestAdvice)theAdvice);
+	
+	TPtrC8 ptrReq((TUint8*)theRequestor.Ptr(), theRequestor.Size());			
+	TPtrC8 ptrClient((TUint8*)theClientName.Ptr(), theClientName.Size());			
+	TPtrC8 ptrId((TUint8*)theExternalId.Ptr(), theExternalId.Size());			
+	reqParams.iRequestInfo.SetRequesterId(reinterpret_cast<const TDesC8&>(ptrReq));
+	reqParams.iRequestInfo.SetClientName(reinterpret_cast<const TDesC8&>(ptrClient));
+	reqParams.iRequestInfo.SetClientExternalId(reinterpret_cast<const TDesC8&>(ptrId));
+
+	//	set privacy response parameters
+	TLbsLoggingPrivacyResponseParams respParams;
+	respParams.iSessionId.SetSessionOwner(TUid::Uid(theSessionOwner ));
+	respParams.iSessionId.SetSessionNum(theSessionNum );
+	respParams.iResult = static_cast<CLbsNetworkProtocolBase::TLbsPrivacyResponse>(theRequestResult);
+
+	iExternalLocateLogIntiailisedFromValues->SetRequestOriginator(TUid::Uid(theOriginator));
+	iExternalLocateLogIntiailisedFromValues->SetPrivacyRequestParams(reqParams); // set privacy request parameters from request originator
+	iExternalLocateLogIntiailisedFromValues->SetPrivacyResponseParams(respParams); // set privacy response parameters from privacy controller
+	}
+	
+void CT_LbsStep_VerifyLogInfo::ClearLog()
+ 	{
+	// Setup a time in the future, before which all events will be deleted
+ 	_LIT(KDateCorrect1,"20900101:"); 
+ 	TTime time;
+	TBuf <10> theDate(KDateCorrect1);
+	TInt err=time.Set(theDate); 
+	
+	// Ensure time has been set correctly
+	if(err != KErrNone)
+		{
+		INFO_PRINTF1(_L("Failed to set time"));
+		}
+		
+	if(err == KErrGeneral)
+		{
+		INFO_PRINTF1(_L("Time syntax is incorrect"));
+		}
+	
+	// Set the filter to view ALL logs
+	CLogFilter* filter = CLogFilter::NewL();			// NEW FILTER
+	CleanupStack::PushL(filter);
+	TBool res = iview->SetFilterL(*filter, iActiveWaiter->iStatus);
+	if (res == EFalse)
+		{
+		INFO_PRINTF1(_L("\t No such events to filter in the view."));
+		iclient->Cancel();
+		}
+	else
+		{
+		// else If there are logs, flush them
+			
+		// Cancel outstanding requests
+		iclient->Cancel();	
+		iActiveWaiter->StartAndWait();
+		if (iActiveWaiter->iStatus != KErrNone)
+			{
+			INFO_PRINTF2(_L("\t Error: Cancel returned error %d."),iActiveWaiter->iStatus.Int());
+			SetTestStepResult(EFail);
+			}
+
+		// Clear ALL logs
+		iclient->ClearLog(time, iActiveWaiter->iStatus);
+		iActiveWaiter->StartAndWait();
+		if (iActiveWaiter->iStatus != KErrNone)
+			{
+			INFO_PRINTF2(_L("\t Error: Clear log returned error %d."),iActiveWaiter->iStatus.Int());
+			SetTestStepResult(EFail);
+			}	
+			
+		//Confirm log is cleared
+		if(iview->CountL() != 0)
+			{
+			INFO_PRINTF2(_L("<FONT><B>ERROR: Log still has %d entries</B></FONT>"),iview->CountL());
+			SetTestStepResult(EFail);
+			}
+				
+		}
+	
+	CleanupStack::PopAndDestroy(filter);	
+
+	}
+void CT_LbsStep_VerifyLogInfo::SecondPositionFromArray(TPositionInfo* aPosInfoSecond)
+{
+
+	//All this in TPosInfo Structure
+	TUid theModuleId;	// use from VerifyLogInfo array
+	TPositionModuleInfo::TTechnologyType theTechType;
+	TPositionModeReason theModeReason;
+	TReal32 theVerAccuracy;
+	TReal32 theHorAccuracy;
+	TReal64 theLat;
+	TReal64 theLong;
+	TReal theAltitude;
+	
+	//	Initialise variables from Verify array
+	RPointerArray<TAny>& logInfoArr = iParent.iSharedData->iVerifyPosInfoArr;
+	TPositionInfo* tPosInfo = (reinterpret_cast<TPositionInfo*>(logInfoArr[0]));
+	TPosition tPos;
+	tPosInfo->GetPosition(tPos);
+		
+	theModuleId = 		TUid::Uid(271064388); // 271064388;
+	theTechType = 		tPosInfo->PositionMode();
+	theModeReason = 	tPosInfo->PositionModeReason();
+	theVerAccuracy = 	REFPOS_VERT_ACCURACY;	// For second x3p reference position comparison
+	theHorAccuracy = 	REFPOS_HORZ_ACCURACY;	// For second x3p reference position comparison
+	theLat = 			REFPOS_LAT;	// For second x3p reference position comparison
+	theLong = 			REFPOS_LONG;	// For second x3p reference position comparison
+	theAltitude = 		REFPOS_ALT;	// For second x3p reference position comparison
+
+
+	//	Setup position information using intialised variables
+	aPosInfoSecond->SetModuleId(theModuleId);
+	aPosInfoSecond->SetUpdateType(EPositionUpdateGeneral);
+	aPosInfoSecond->SetPositionMode((TPositionModuleInfo::TTechnologyType)theTechType);
+	aPosInfoSecond->SetPositionModeReason((TPositionModeReason)theModeReason);
+	TPosition position;
+	position.SetCurrentTime();
+	position.SetAccuracy(theHorAccuracy,theVerAccuracy);
+	position.SetCoordinate(theLat,theLong, theAltitude);
+	static_cast<TPositionInfo*>(aPosInfoSecond)->SetPosition(position);
+}
+
+
+TPositionInfo* CT_LbsStep_VerifyLogInfo::CommonPositionInfo()
+{
+	//All this in TPosInfo Structure
+	TUid theModuleId;	// use from VerifyLogInfo array
+	TPositionModuleInfo::TTechnologyType theTechType;
+	TPositionModeReason theModeReason;
+	TReal32 theVerAccuracy;
+	TReal32 theHorAccuracy;
+	TReal64 theLat;
+	TReal64 theLong;
+	TReal theAltitude;
+
+	//	All this in TPosInfo Structure use from VerifyLogInfo array
+	RPointerArray<TAny>& logInfoArr = iParent.iSharedData->iVerifyPosInfoArr;
+	
+	//	Initialise variables from Verify array
+	TPositionInfo* tPosInfo = (reinterpret_cast<TPositionInfo*>(logInfoArr[0]));
+	TPosition tPos;
+	tPosInfo->GetPosition(tPos);
+		
+	theModuleId = 		TUid::Uid(271064388); // 271064388;
+	theTechType = 		tPosInfo->PositionMode();
+	theModeReason = 	tPosInfo->PositionModeReason();
+	theVerAccuracy = 	tPos.VerticalAccuracy();
+	theHorAccuracy = 	tPos.HorizontalAccuracy();
+	theLat = 			tPos.Latitude();
+	theLong = 			tPos.Longitude();
+	theAltitude = 		tPos.Altitude();
+
+
+	//	Setup position information using intialised variables
+	TPositionInfo* posInfo = new TPositionInfo();
+	posInfo->SetModuleId(theModuleId);
+	posInfo->SetUpdateType(EPositionUpdateGeneral);
+	posInfo->SetPositionMode((TPositionModuleInfo::TTechnologyType)theTechType);
+	posInfo->SetPositionModeReason((TPositionModeReason)theModeReason);
+	TPosition position;
+	position.SetCurrentTime();
+	position.SetAccuracy(theHorAccuracy,theVerAccuracy);
+	position.SetCoordinate(theLat,theLong, theAltitude);
+	static_cast<TPositionInfo*>(posInfo)->SetPosition(position);
+	
+	return posInfo;
+}
+
+/** Compares the timestamps of two log events
+ 	returns 1 if the lhs is newer, -1 if the lhs is older or 0 if both are the same */
+TInt CT_LbsStep_VerifyLogInfo::SelfLocateLogEventTimestampCompare(const CLbsSelfLocateLogEvent& aLog1,
+														 const CLbsSelfLocateLogEvent& aLog2)
+	{
+	TPositionInfo* tPosInfo1 = static_cast<TPositionInfo*>(aLog1.PositionInfo());
+	TPositionInfo* tPosInfo2 = static_cast<TPositionInfo*>(aLog2.PositionInfo());
+	TPosition tPos1;
+	TPosition tPos2;
+	tPosInfo1->GetPosition(tPos1);
+	tPosInfo2->GetPosition(tPos2);
+	TInt64 t1 = tPos1.Time().Int64();
+	TInt64 t2 = tPos2.Time().Int64();
+	if(t1 < t2)
+		{
+		// lhs is Newer
+		return 1;
+		}
+	else if(t1 > t2)
+		{
+		// lhs is Older
+		return -1;
+		}
+	// the same
+	return 0;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepverifymodinfo.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,75 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstepverifymodinfo.cpp
+// This is the class implementation for the Verify Module Information test step
+// 
+//
+ 
+#include "ctlbsstepverifymodinfo.h"
+
+#include "tlbsutils.h"
+
+
+/**
+ * Constructor
+ */
+CT_LbsStep_VerifyModInfo::CT_LbsStep_VerifyModInfo(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_VerifyModInfo);
+	}
+
+
+/**
+Static Constructor
+*/
+CT_LbsStep_VerifyModInfo* CT_LbsStep_VerifyModInfo::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_VerifyModInfo(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsStep_VerifyModInfo::doTestStepL()
+	{
+	// Helper test step used to verify module information.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_VerifyModInfo::doTestStepL()"));
+
+	if (TestStepResult() == EPass)
+		{
+		// Access the module infos to be compared.
+		TPositionModuleInfo&	verifyModInfo = iParent.iSharedData->iVerifyModuleInfo;
+		TPositionModuleInfo&	currentModInfo = iParent.iSharedData->iCurrentModuleInfo;
+		T_LbsUtils utils;
+		
+		// Verify module informations are equal.
+		TBool res = utils.Compare_ModuleInfo(verifyModInfo, currentModInfo);
+		
+		// Fail test if they do not match.
+		if (!res)
+			{
+			SetTestStepResult(EFail);
+			}
+		}
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_VerifyModInfo::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepverifymodstatus.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,76 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstepverifymodinfo.cpp
+// This is the class implementation for the Verify Module Status test step
+// 
+//
+ 
+#include "ctlbsstepverifymodstatus.h"
+#include "tlbsutils.h"
+
+
+/**
+ * Constructor
+ */
+CT_LbsStep_VerifyModStatus::CT_LbsStep_VerifyModStatus(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_VerifyModuleStatus);
+	}
+
+
+/**
+Static Constructor
+*/
+CT_LbsStep_VerifyModStatus* CT_LbsStep_VerifyModStatus::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_VerifyModStatus(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsStep_VerifyModStatus::doTestStepL()
+	{
+	// Helper test step used to verify module information.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_VerifyModStatus::doTestStepL()"));
+
+	if (TestStepResult() == EPass)
+		{
+		// Access the module infos to be compared.
+		TPositionModuleStatus&	verifyModStatus = iParent.iSharedData->iVerifyModuleStatus;
+		TPositionModuleStatus&	currentModStatus = iParent.iSharedData->iCurrentModuleStatus;
+		T_LbsUtils utils;
+		
+		// Verify module informations are equal.
+		TBool res;
+		
+		res = utils.Compare_ModuleStatus(verifyModStatus, currentModStatus);
+		
+		// Fail test if they do not match.
+		if (!res)
+			{
+			SetTestStepResult(EFail);
+			}
+		}
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_VerifyModStatus::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepverifyposinfos.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,73 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstep_verifyposinfos.cpp
+// This is the class implementation for the Notify Position Update Tests
+// 
+//
+ 
+#include "ctlbsstepverifyposinfos.h"
+
+#include "tlbsutils.h"
+
+
+/**
+ * Constructor
+ */
+CT_LbsStep_VerifyPosInfos::CT_LbsStep_VerifyPosInfos(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_VerifyPosInfos);
+	}
+
+
+/**
+Static Constructor
+*/
+CT_LbsStep_VerifyPosInfos* CT_LbsStep_VerifyPosInfos::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_VerifyPosInfos(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsStep_VerifyPosInfos::doTestStepL()
+	{
+	// Helper test step used to Verify the Position Information Array.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_VerifyPosInfos::doTestStepL()"));
+
+	if (TestStepResult() == EPass)
+		{
+		// Access the arrays to be compared.
+		RPointerArray<TAny>& verifyPosInfoArr = iParent.iSharedData->iVerifyPosInfoArr;
+		RPointerArray<TAny>& currentPosInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+		T_LbsUtils utils;
+		
+		// Verify arrays are equal.
+		TBool res = utils.Compare_PosInfoArr(verifyPosInfoArr, currentPosInfoArr, T_LbsUtils::EExactAccuracy);
+		
+		// Fail test if arrays do not match.
+		if (!res)
+			SetTestStepResult(EFail);
+		}
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_VerifyPosInfos::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/common/src/ctlbsstepverifyroughposinfos.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,73 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsstep_verifyposinfos.cpp
+// This is the class implementation for the Notify Position Update Tests
+// 
+//
+ 
+#include "ctlbsstepverifyroughposinfos.h"
+
+#include "tlbsutils.h"
+
+
+/**
+ * Constructor
+ */
+CT_LbsStep_VerifyRoughPosInfos::CT_LbsStep_VerifyRoughPosInfos(CT_LbsServer& aParent) : CT_LbsStep(aParent)
+	{
+	SetTestStepName(KLbsStep_VerifyRoughPosInfos);
+	}
+
+
+/**
+Static Constructor
+*/
+CT_LbsStep_VerifyRoughPosInfos* CT_LbsStep_VerifyRoughPosInfos::New(CT_LbsServer& aParent)
+	{
+	return new CT_LbsStep_VerifyRoughPosInfos(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsStep_VerifyRoughPosInfos::doTestStepL()
+	{
+	// Helper test step used to Verify the Position Information Array.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_VerifyRoughPosInfos::doTestStepL()"));
+
+	if (TestStepResult() == EPass)
+		{
+		// Access the arrays to be compared.
+		RPointerArray<TAny>& verifyPosInfoArr = iParent.iSharedData->iVerifyPosInfoArr;
+		RPointerArray<TAny>& currentPosInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+		T_LbsUtils utils;
+		
+		// Verify arrays are equal.
+		TBool res = utils.Compare_PosInfoArr(verifyPosInfoArr, currentPosInfoArr, T_LbsUtils::ERoughAccuracy);
+		
+		// Fail test if arrays do not match.
+		if (!res)
+			SetTestStepResult(EFail);
+		}
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_VerifyRoughPosInfos::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/group/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,21 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "../lbstestutils/group/bld.inf"
+#include "../internal/lbstestserver/group/bld.inf"
+#include "../lbsclient/group/bld.inf"
+
+// Hybrid mode support
+#include "../lbstestchannel/group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/BWINS/lbstestclientU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,6 @@
+EXPORTS
+	?NewL@CLbsTestServer@@SAPAV1@XZ @ 1 NONAME ; class CLbsTestServer * CLbsTestServer::NewL(void)
+	?StopLbsSystem@CLbsTestServer@@QAEHXZ @ 2 NONAME ; int CLbsTestServer::StopLbsSystem(void)
+	?ResetLbsSystem@CLbsTestServer@@QAEHXZ @ 3 NONAME ; int CLbsTestServer::ResetLbsSystem(void)
+	?StartLbsSystem@CLbsTestServer@@QAEHXZ @ 4 NONAME ; int CLbsTestServer::StartLbsSystem(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/EABI/lbstestclientU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,6 @@
+EXPORTS
+	_ZN14CLbsTestServer13StopLbsSystemEv @ 1 NONAME
+	_ZN14CLbsTestServer4NewLEv @ 2 NONAME
+	_ZN14CLbsTestServer14ResetLbsSystemEv @ 3 NONAME
+	_ZN14CLbsTestServer14StartLbsSystemEv @ 4 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/group/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,22 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+PRJ_TESTEXPORTS
+../inc/lbstestclient.h	/epoc32/include/lbs/test/lbstestclient.h
+
+PRJ_TESTMMPFILES
+lbstestclient.mmp
+lbstestserver.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/group/lbstestclient.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,32 @@
+//
+// lbstestclient.mmp
+//
+// Project file for the LBS test client dll
+//
+
+TARGET		lbstestclient.dll
+TARGETTYPE	dll
+
+UID			0x1000007A 0x10282282
+
+CAPABILITY	All -Tcb
+
+SOURCEPATH	../src
+SOURCE	lbstestclient.cpp
+SOURCE	lbstestclientimpl.cpp
+
+// Generic server framework
+//SOURCEPATH		../../../../../locationmgmt/locationcore/LbsLocCommon/ServerFramework/src
+SOURCE	cserverlaunch.cpp
+SOURCE	rsecuresessionbase.cpp
+SOURCE	tserverstartparams.cpp
+SOURCE	tstartparamsbase.cpp
+
+
+USERINCLUDE	../inc
+//USERINCLUDE	../../../../../locationmgmt/locationcore/LbsLocCommon/ServerFramework/inc
+
+SYSTEMINCLUDE	/epoc32/include
+SYSTEMINCLUDE	/epoc32/include/lbs
+
+LIBRARY	euser.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/group/lbstestserver.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,42 @@
+//
+// lbstestserver.mmp
+//
+// Project file for the LBS test server
+//
+
+TARGET        lbstestserver.exe
+TARGETTYPE    exe
+
+UID           0x1000007A 0x10282283
+
+CAPABILITY All -Tcb
+
+SOURCEPATH	../src
+SOURCE	lbstestservermain.cpp
+SOURCE	lbstestserver.cpp
+SOURCE	lbstestsession.cpp
+
+// Generic server framework
+//SOURCEPATH		../../../../../locationmgmt/locationcore/LbsLocCommon/ServerFramework/src
+SOURCE	csecureasbase.cpp
+SOURCE	csecureserverbase.cpp
+SOURCE	csecuresessionbase.cpp
+SOURCE	cshutdowntimer.cpp
+SOURCE	messageutils.cpp
+SOURCE	tserverstartparams.cpp
+SOURCE	tprocessstartparams.cpp
+SOURCE	cprocesslaunch.cpp
+SOURCE	tstartparamsbase.cpp
+
+
+USERINCLUDE	../inc
+//USERINCLUDE	../../../../../locationmgmt/locationcore/lbsrootapi/inc
+//USERINCLUDE	../../../../../locationmgmt/locationcore/LbsLocCommon/ServerFramework/inc
+
+SYSTEMINCLUDE	/epoc32/include
+SYSTEMINCLUDE	/epoc32/include/lbs
+
+LIBRARY	euser.lib
+LIBRARY	efsrv.lib
+LIBRARY	lbsrootapi.lib
+LIBRARY lbspartnercommon.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/claunchedprocess.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,47 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Definition of class used to launch a LBS processes (non-server)
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+*/
+
+#ifndef __LBSPROCESSLAUNCH_H__
+#define __LBSPROCESSLAUNCH_H__
+
+#include <e32base.h>
+#include "tprocessstartparams.h"
+
+/**
+@internalTechnology
+@released
+
+CBase based Class, presents the launch process of the server side
+ */
+ class CLaunchedProcess : public CBase
+	{
+public:
+	static TInt CompleteProcessLaunch();
+	static TInt CompleteProcessLaunch(TProcessStartParams& aParams);
+protected:
+	static TInt DoCompleteProcessLaunchL();
+	static TInt DoCompleteProcessLaunchL(TProcessStartParams& aParams);
+	};
+	
+#endif // __LBSPROCESSLAUNCH_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/cprocesslaunch.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,49 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Definition of class used to launch a LBS processes (non-server)
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+*/
+
+#ifndef __LBSPROCESSLAUNCH_H__
+#define __LBSPROCESSLAUNCH_H__
+
+#include <e32base.h>
+#include "tprocessstartparams.h"
+
+/**
+@internalTechnology
+@released
+
+CBase based Class, presents the launch process of the server side
+ */
+ class CProcessLaunch : public CBase
+	{
+public:
+	static TInt CreateProcess();
+	static TInt CreateProcess(TProcessStartParams& aParams);
+	static TInt ProcessLaunch(TProcessStartParams& aParams);
+protected:
+	static TInt DoCreateProcessL();
+	static TInt DoCreateProcessL(TProcessStartParams& aParams);
+	static TInt DoProcessLaunch(TProcessStartParams& aParams);
+	};
+	
+#endif // __LBSPROCESSLAUNCH_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/cquietus.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,70 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+/*
+Quietus is Medieval Latin for discharged from an obligation, which comes form the Latin 
+(he is) at rest. So its a synonym for death :). See teh references below.
+Which is exaclt what this object is all about - it starts the process that will kill any
+process based around a CActiveScheduler.
+
+from Dictionary.com
+
+qui·e·tus
+
+   1. Something that serves to suppress, check, or eliminate.
+   2. Release from life; death.
+   3. A final discharge, as of a duty or debt.
+[Short for Middle English quietus (est), (he is) discharged (of an obligation),
+from Medieval Latin quitus (est), from Latin, (he is) at rest. See quiet.]
+
+from thesaurus.com
+Main Entry:  	death
+Part of Speech:  noun
+Definition:  	end
+Synonyms:  	afterlife, annihilation, bereavement, casualty, cessation, curtains*, darkness, decease, demise, departure, destruction, dissolution, downfall, dying, end, ending, eradication, eternal rest, euthanasia, exit, expiration, extermination, extinction, fatality, finis*, finish, future home, grave, grim reaper*, heaven, loss, mortality, necrosis, obliteration, oblivion, paradise, parting, passing, passing over, quietus, release, repose, ruin, ruination, silence, sleep, termination, tomb, un
+Antonyms:  	being, birth, existence, life, living, nascency
+Source:  	Roget's New Millennium™ Thesaurus, First Edition (v 1.2.1)
+Copyright © 2006 by Lexico Publishing Group, LLC. All rights reserved.
+* = informal or slang
+
+*/
+
+#ifndef __LBSQUIETUS_H__
+#define __LBSQUIETUS_H__
+
+#include <e32base.h>
+
+/** 
+@internalTechnology
+@released
+
+CActive object, starts the process to kill any
+process based around a CActiveScheduler.
+*/
+
+class CQuietus : public CActive
+	{
+public:
+	static CQuietus* NewL();
+	~CQuietus();
+	void CoupDeGrace();
+private:
+	CQuietus(); // make this private.
+	// from CActive
+	void RunL();
+	void DoCancel(); 
+	};
+	
+#endif // __LBSQUIETUS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/csecureasbase.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,74 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Definition of class used to start a LBS server process 
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+*/
+
+#ifndef __LBSSECUREASBASE_H__
+#define __LBSSECUREASBASE_H__
+
+#include <e32base.h>
+
+// forward classes
+class TServerStartParams;
+
+/**
+@internalTechnology
+@released
+
+ Interface to create server
+ */
+class MCreateServerImpl
+	{
+public:
+	virtual void CreateServerLC(TServerStartParams& aParams) = 0;
+	};
+
+/**
+@internalTechnology
+@released
+
+CActiveScheduler Class.
+ */
+class CSecureASBase : public CActiveScheduler
+	{
+public:
+	enum TSecureASBasePanic
+		{
+		ECreateServerLCNotOverridden = 0
+		};
+public:
+	CSecureASBase();
+	static TInt ServerLaunch(TServerStartParams& aParams);
+	static TInt ServerMain(TServerStartParams& aParams);
+protected:
+	static TInt RunServerL(TServerStartParams& aParams);
+	TInt CreateServer();
+		
+	// create the derived server object and leave it on the cleanup stack
+	//virtual void CreateServerLC(TServerStartParams& aParams);
+	MCreateServerImpl* GetImplLC();
+	void Panic(const TSecureASBasePanic aPanic);
+	};
+	
+
+	
+#endif // __LBSSECUREASBASE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/csecureprocessasbase.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,53 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Definition of class used to start a LBS non-server process 
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+*/
+
+#ifndef __LBSSECUREPROCESSASBASE_H__
+#define __LBSSECUREPROCESSASBASE_H__
+
+#include <e32base.h>
+
+/**
+@internalTechnology
+@released
+
+CActiveScheduler Class.
+ */
+class CSecureProcessASBase : public CActiveScheduler
+	{
+public:
+	/** Secure process panic type */
+	enum TSecureProcessASBasePanic
+		{
+		ECreateRootObjectNotOverridden = 1,
+		EEntryPointNotOverridden = 2	
+		};
+public:
+	// new bits for processes
+	virtual CBase* CreateRootObjectL();
+	virtual TInt EntryPointL(CBase* aObj);
+	virtual void Final();	
+	void Panic(const TSecureProcessASBasePanic aPanic);
+	};	
+	
+#endif //__LBSSECUREPROCESSASBASE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/csecureserverbase.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,100 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// csesureserverbase.h
+// Definition of class used to encapsulate a LBS server 
+// (for example,  LbsLocServer.exe)
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+*/
+
+
+#ifndef __LBSSECURESERVERBASE_H__
+#define __LBSSECURESERVERBASE_H__
+
+#include <e32base.h>
+
+// forward classes
+class CShutdownTimer;
+
+/** default server shutdown delay */
+const TTimeIntervalMicroSeconds32 KDefaultShutdownDelay = 2*1000*1000;
+
+// NB this and the panic list should be pblisghed all + released...
+/** Liternal used as the panic catageory by the server framework */
+_LIT(KServerFrameworkPanic, "ServerFramework");
+enum TServerFrameWorkPanics
+		{
+		ESecureSubSessionBaseUnknownSubSessionType = 1 // the sever does not reognise the session type.
+		};
+
+/** 
+@internalTechnology
+@released
+@see CShutdownTimer
+@see CPolicyServer
+
+CPolicy based class to provde security functionalities to the server base
+ */
+class CSecureServerBase : public CPolicyServer
+	{
+public:
+	/** Secure server base panic type */
+	enum ESecureServerBasePanic 
+		{
+		EBaseConstructNotCalled = 0,
+		EBaseCreateNotCalled = 1
+		};
+public:
+	// creation - called from CPolicyServer
+	virtual CSession2* NewSessionL(const TVersion &aVersion, const RMessage2& aMessage) const;
+	// secondary creation - called by the implementaion of NewSessionL above
+	virtual CSession2* DoNewSessionL(const TVersion &aVersion, const RMessage2& aMessage) const = 0;
+	virtual TVersion GetServerVersion() const = 0;
+	// destruction
+	virtual ~CSecureServerBase();
+public:
+	void IncSession();
+	void DecSession();
+
+	TInt GetSessionCount() const;
+	TTimeIntervalMicroSeconds32 GetShutdownDelay() const;
+	void SetShutdownDelay(const TTimeIntervalMicroSeconds32 aDelay);
+	// must be public to the sessions can so this is required.
+	void PanicServer(TInt aPanicCode) const;
+protected:
+	CSecureServerBase(TInt aPriority, const TPolicy& aSecurityPolicy);
+	void BaseConstructL(TBool aShutdownTimerRequired = ETrue);
+protected:
+	// property
+	// protected in case a derived class ever has to overload
+	/** number of sessions to the server */
+	TInt						iSessionCount;
+	/** shut down timer for the server */
+	CShutdownTimer*				iShutdownTimer;
+	/** shut down time delay */
+	TTimeIntervalMicroSeconds32 iShutdownDelay;
+private:
+	// property - really do mean private here
+	/** indicate whether the base construct has been called */
+	TBool iBaseConstructCalled;
+	};
+
+
+#endif  // __LBSSECURESERVERBASE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/csecuresessionbase.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,54 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// csesuresessionbase.h
+// CSession2 based secure session to the server
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+*/
+
+#ifndef __LBSSECURESESSIONBASE_H__
+#define __LBSSECURESESSIONBASE_H__
+
+#include <e32base.h>
+
+/** 
+@internalTechnology
+@released
+
+CSession2 based secure session to the server
+ */
+class CSecureSessionBase : public CSession2
+	{
+public:
+	CSecureSessionBase();
+	virtual ~CSecureSessionBase();
+	virtual void CreateL();
+	virtual void Disconnect(const RMessage2& aMessage);
+	virtual void ServiceL(const RMessage2& aMessage);
+	virtual void ServiceError(const RMessage2& aMessage, TInt aError);
+protected:
+	// Helpers
+	virtual void DispatchL(const RMessage2& aMessage) = 0;
+	virtual void DispatchError(const RMessage2& aMessage, const TInt aError) = 0; // force people to think about errors!
+	virtual void ConstructSubSessionL();
+	virtual void DestroySubSession();
+	};
+	
+#endif // __LBSSECURESESSIONBASE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/csecuresessionsubsessionbase.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,71 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Definition of secure subsession base class
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+*/
+
+#ifndef __LBSSECURESESSIONSUBSESSIONBASE_H__
+#define __LBSSECURESESSIONSUBSESSIONBASE_H__
+
+#include <e32base.h> // for CObject etc.
+#include "csecuresessionbase.h"
+#include "csecureserverbase.h"
+
+
+/** 
+@internalTechnology
+@released
+
+Subsession base class 
+ */
+class CSecureSessionSubSessionBase : public CSecureSessionBase
+	{
+public:
+	CSecureSessionSubSessionBase();
+	virtual ~CSecureSessionSubSessionBase();
+	virtual void CreateL();
+	virtual void CreateSubSessionL(const RMessage2& aMessage);
+	virtual void DestroySubSession(const RMessage2& aMessage);
+protected:
+	virtual void DispatchMessageL(const RMessage2& aMesssage);
+	const CSecureServerBase* Server() const;
+	// Helpers
+	virtual void DispatchL(const RMessage2& aMessage);
+	virtual void DispatchError(const RMessage2& aMessage, const TInt aError); // force people to think about errors!
+	virtual void ServiceMessageL(const RMessage2& aMessage) = 0;
+	virtual void ServiceMessageError(const RMessage2& aMessage, const TInt aError) = 0;
+protected:
+	// property
+	/** the array to store subsession object handles */
+	CObjectIx* 	iObjectIx;
+	/** the array container to store subsessions */
+	CObjectConIx* 	iContainerIx;
+	/** array to store subsessions */
+	CObjectCon* 	iObjectCon;
+private:
+	// property - really do mean private here
+	/** indicate whether the base construct has been called */
+	TBool iBaseCreateCalled;
+	};
+	
+
+	
+#endif // __LBSSECURESESSIONSUBSESSIONBASE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/cserverlaunch.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,42 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Definition of class used to launch a LBS server 
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+*/
+
+
+#ifndef __LBSSERVERLAUNCH_H__
+#define __LBSSERVERLAUNCH_H__
+
+#include <e32base.h>
+
+// forward classes
+class TServerStartParams;
+
+class CServerLaunch : public CBase
+	{
+public:
+	static TInt ServerLaunch(TServerStartParams& aParams);
+protected:
+	static TInt CreateServerProcess(TServerStartParams& aParams);
+	};
+	
+#endif // __LBSSERVERLAUNCH_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/cshutdowntimer.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,49 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Definition of class used to shut down a server after a specified time
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+*/
+
+#ifndef __LBSSHUTDOWNTIMER_H__
+#define __LBSSHUTDOWNTIMER_H__
+
+#include <e32base.h>
+
+/**
+@internalTechnology
+@released
+
+ CTimer base class, it is used to shut down the server in specified time span
+ */
+class CShutdownTimer : public CTimer
+	{
+public:
+	CShutdownTimer();
+	~CShutdownTimer();
+	void ConstructL();
+	void Start(const TTimeIntervalMicroSeconds32 aDelay);
+	void Stop();
+protected: 
+	// from CActive
+	void RunL();
+	};
+	
+#endif // __LBSSHUTDOWNTIMER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/csubsessionbase.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,124 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Definition of Subsession base object 
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+*/
+
+#ifndef __LBSSUBSESSIONBASE_H__
+#define __LBSSUBSESSIONBASE_H__
+
+#include <e32base.h>
+
+// forward classes
+class CSecureServerBase;
+
+/** 
+@internalTechnology
+@released
+
+Interface for release resource
+ */
+class MRelease
+	{
+public:
+	virtual void VirtualRelease() = 0; // THIS MUST delete any implementation!	
+	};
+
+/** 
+@internalTechnology
+
+MRelease interface function pointer
+ */
+typedef void (MRelease::* TReleaseFunc)();
+
+
+/** 
+@internalTechnology
+@released
+
+static class for push the resource needed to be released to stack
+ */
+class CleanupVirtualRelease
+	{
+public:
+	inline static void PushL(MRelease& aRef);
+private:
+	static void Release(TAny *aPtr);
+	};
+
+void CleanupVirtualReleasePushL(MRelease& aRef);
+
+
+/** 
+@internalTechnology
+@released
+@see MRelease
+
+/** 
+@internalTechnology
+@released
+@see MRelease
+
+MRelease based Interface, interface for subsession
+ */
+class MSubSessionImpl : public MRelease
+	{
+public:
+	virtual void DispatchL(const RMessage2& aMessage) = 0;
+	virtual void DispatchError(const RMessage2& aMessage, TInt aError) = 0;
+	virtual void CreateSubSessionL(const RMessage2& aMessage, const CSecureServerBase* aServer) = 0;
+	virtual void CloseSubSession() = 0;
+	};
+
+/**
+@internalTechnology
+@released
+@see MSubSessionImpl
+
+ Subsession base object
+ */
+class CSubSessionBase : public CObject
+	{
+public:
+	/** Panic type for subsession objects */
+	enum TSubSessionBasePanic
+		{
+		EDispatchLNotOverriden = 1,
+		EDispatchErrorNotOverriden = 2,
+		ECreateSubSessionLNotOverriden = 3,
+		ECloseSubSessionNotOverriden = 4
+		};
+public:
+	CSubSessionBase();
+	virtual ~CSubSessionBase();
+	MSubSessionImpl* GetImplL(const RMessage2& aMessage);
+	void SetImpl(MSubSessionImpl* aImpl);
+	MSubSessionImpl* Impl();
+protected:
+	void Panic(const TSubSessionBasePanic aPanic);
+protected:
+	// property - later derived class may wish to acess so protected, not private
+	/** Generic interface pointer to subsession implemetations */
+	MSubSessionImpl* iImpl;
+	};
+
+
+#endif // __LBSSUBSESSIONBASE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/lbsprocesssupervisor.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,126 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// lbsrootapi.h
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @released
+*/
+
+#ifndef __LBS_PROCESSSUPERVISOR_H__
+#define __LBS_PROCESSSUPERVISOR_H__
+
+#include <e32base.h>
+#include <e32def.h>
+#include <e32cmn.h>
+#include <e32std.h>
+#include <e32property.h>
+#include "lbsprocessuiddefs.h"
+
+/**
+ * Class which allows processes to register to be notified for closedown,
+ * and to confirm closedown when it is completed.
+ */
+class RLbsProcessSupervisor 
+	{
+public:
+	/**
+	 * Values for closedown request property which indicate whether the
+	 * process is to close itself down or reset itself.
+	 */
+	enum TProcessSignal
+		{
+		EProcessSignalUnknown = 0,
+		EProcessCloseDown,
+		EProcessReset
+		};
+
+public:
+	IMPORT_C static void InitializeL();
+	IMPORT_C static void ShutDownL();
+
+	IMPORT_C RLbsProcessSupervisor();
+	IMPORT_C void OpenL(TUid aModuleId);
+	IMPORT_C void Close();
+
+	IMPORT_C void CloseDownProcess();
+	IMPORT_C void ResetProcess();
+
+	void NotifyCloseDownRequest(TRequestStatus& aStatus);
+	IMPORT_C void CancelNotifyCloseDownRequest();
+	
+	TInt ProcessSignal();
+
+private:
+    RProperty   iRequestCloseDown;
+    TUid		iModuleId;
+	};
+
+/**
+ * Mixin class defining a function implemented by LBS processes/servers started 
+ * by LBS Root and which is called when the process/server is to close itself 
+ * down
+ */
+class MLbsProcessCloseDown
+    {
+public:
+    virtual void OnProcessCloseDown()  = 0;
+    };
+
+/**
+ * Mixin class defining a function implemented by LBS processes/servers started 
+ * by LBS Root and which is called when the process/server is to 'reset' itself
+ * (e.g. clear internal cache, state variable). This is expected mainly to be 
+ * used for test purposes.
+ */
+class MLbsProcessReset
+    {
+public:
+    virtual void OnProcessReset()  = 0;
+    };
+
+	
+class CLbsCloseDownRequestDetector : public CActive
+	{
+public:
+	// Not all process need to implement a reset function, so allow a default
+	// value of NULL for the reset observer.
+	IMPORT_C static CLbsCloseDownRequestDetector* NewL(
+									MLbsProcessCloseDown* aCloseDownObserver,
+													TUid aProcessUid,
+										MLbsProcessReset* aResetObserver = NULL);
+	~CLbsCloseDownRequestDetector();
+
+protected:
+	CLbsCloseDownRequestDetector(MLbsProcessCloseDown* aCloseDown,
+									MLbsProcessReset* aResetObserver);
+	void ConstructL(TUid aProcessUid);
+     
+protected:
+	//From CActive
+	virtual void RunL();
+	virtual void DoCancel();
+
+private:	
+	RLbsProcessSupervisor iLbsSupervisor;
+	MLbsProcessCloseDown* iCloseDownObserver;
+	MLbsProcessReset* iResetObserver;
+    };
+    
+#endif //__LBS_PROCESSSUPERVISOR_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/lbspropertykeydefs.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,102 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @released
+*/
+
+#ifndef LBSPROPERTYKEYDEFS_H
+#define LBSPROPERTYKEYDEFS_H
+
+#include <e32def.h>
+
+
+
+
+//This header splits up the key space for the process that defines the LBS P&S properties.
+//It then goes on to map ModuleId-Property type pairs to individual key vaules.
+
+
+//We offset from 0 - this is to make debugging easier (0 means a lot of things, 1000 is a better clue).
+//Also, several places in the implementation use the fact that 0 is NEVER a valid key value.
+
+const TUint KLbsPowerModeAdviceKeyBase			= 0x00001000;		//Base value for RLbsManagerPowerModeAdvice keys
+const TUint KLbsModuleInfoKeyBase				= 0x01001000;		//Base value for LbsModuleInfo keys
+const TUint KLbsModuleStatusKayBase				= 0x02001000;		//Base value for RLbsModuleStatus keys
+const TUint KLbsPositionUpdatesKeyBase			= 0x03001000;		//Base value for RLbsPositionUpdates keys
+const TUint	KLbsGpsMeasurementUpdatesKeyBase	= 0x03001100;		//Base value for RLbsGpsMeasurementUpdates keys
+const TUint KLbsPositionUpdateRequestsKeyBase	= 0x04001000;		//Base value for RLbsPositionUpdateRequests keys
+const TUint KLbsSystemModuleEventKeyBase		= 0x05001000;		//Base value for RLbsSystemModuleEvent keys
+
+// The following section lists the keys used by lbsnetinternalapi
+
+/* Key value used to publish message data */
+const TUint KNetGatewayMessageKey = 0x06001000;
+
+/* Key value used to publish the 'message read' acknowledgement */
+const TUint KNetGatewayMessageReadAckKey = 0x06001010;
+
+/* Key value used to publish message data */
+const TUint KNetRequestMessageKey = 0x06001020;
+
+/* Key value used to publish the 'message read' acknowledgement */
+const TUint KNetRequestMessageReadAckKey = 0x06001030;
+
+/* Key value used to publish message data */
+const TUint KNetworkLocationRequestMessageKey = 0x06001040;
+
+/* Key value used to publish message data */
+const TUint KNetworkLocationResponseMessageKey = 0x06001060;
+
+/* Key value used to publish network reference position data */
+const TUint KNetworkReferencePositionUpdateKey = 0x06001080;
+
+/* Key value used to publish network final position data */
+const TUint KNetworkFinalPositionUpdateKey = 0x06001088;
+
+/* Key value used to publish messages from AGPS Manager to Network Gateway  
+   and the corresponding acknowledgement */
+const TUint KNetAGPS2NGMessageKey = 0x06001090;
+const TUint KNetAGPS2NGMessageReadAckKey = 0x060010a0;
+
+/* Key value used to publish messages from the Network Gateway to the AGPS Manager  
+   and the corresponding acknowledgement */
+const TUint KNetNG2AGPSMessageKey = 0x060010b0;
+const TUint KNetNG2AGPSMessageReadAckKey = 0x060010c0;
+
+/* Key value used to publish network registration status */
+const TUint KNetworkRegistrationStatusKey = 0x060010d0;
+
+/* Key value used to support LS to NRH communication for client/network
+ * symmetry requirement*/
+const TUint KLSToNRHKey = 0x060010e0;
+
+/* Key value used to support NRH to LScommunication for client/network
+ * symmetry requirement */
+const TUint KNRHToLSKey = 0x060010f0;
+
+// End of section keys used by lbsnetinternalapi
+
+
+const TUint KLbsRootProcessKeyBase      		= 0x07001000;		//Base value for LBS Root Api keys
+const TUint KLbsAssistDataApiBase       		= 0x08001000;		//Base value for Assistance Data Api keys
+const TUint KLbsQualityProfileKeyBase      		= 0x09001000;		//Base value for Quality Profile keys
+const TUint KLbsSuplPushAPIBase		      		= 0x0A001000;		//Base value for SUPL Push API keys
+
+#endif	//LBSPROPERTYKEYDEFS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/lbsrootapi.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,54 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @released
+*/
+
+#ifndef __LBSROOTAPI_H__
+#define __LBSROOTAPI_H__
+
+#include "lbspropertykeydefs.h"
+#include "lbsprocesssupervisor.h"
+#include "lbssystemcontroller.h"
+#include "lbsprocessuiddefs.h"
+
+enum
+    {
+	KLbsStartupRequestKey = KLbsRootProcessKeyBase,
+	KLbsStartupCompleteKey,
+	KLbsCloseDownRequestKey,
+	KLbsCloseDownCompleteKey,
+	/**
+	 * Make sure this is the last one, as it's used as the base for 
+	 * the definition of n * 2 properties
+	 */
+    KLbsCloseDownBaseKey 
+    };
+
+_LIT(KLbsRootProcessName, "lbsroot.exe");
+
+// Full path of lbsroot executable
+_LIT(KLbsRootFileName, "\\sys\\bin\\lbsroot.exe");
+
+// Need a wildcard when checking to see whether a process is open, to cope
+// with system-derived accretions e.g. lbsroot.exe[0001]
+_LIT(KLbsRootProcessSearchString, "lbsroot.exe*");
+
+#endif //__LBSROOTAPI_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/lbssystemcontroller.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,169 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @released
+*/
+#ifndef __LBS_SYSTEMSTARTER_H__
+#define __LBS_SYSTEMSTARTER_H__
+
+#include <e32base.h>
+#include <e32def.h>
+#include <e32cmn.h>
+#include <e32std.h>
+#include <e32property.h>
+#include "lbstimer.h"
+
+class CLbsSystemStarter;
+
+
+const TInt KDefaultStartupTimeout = 30;
+
+// Responses to a request to start the LBS system
+enum
+    {
+    ELbsStartupSuccess,
+    ELbsStartupFail,
+    ELbsStartupRootNotFound
+    };
+// Responses to a request to close down the LBS system
+enum
+    {
+    ELbsCloseDownRejected,
+    ELbsCloseDownInProgress,
+    ELbsCloseDownComplete,
+    ELbsCloseDownRootNotFound
+    };
+
+class RLbsSystemController
+    {
+public:
+enum
+    {
+	ELbsCloseDown = 1,
+	ELbsCloseDownAndConfirm,
+	ELbsResetOnly, // Just tell the process to clear the cache etc. rather than close down completely
+	ELbsTotalCloseDown // Close the LBS Root process as well.
+    };
+public:
+	IMPORT_C static void InitializeL();
+	IMPORT_C static void ShutDownL();
+
+	IMPORT_C RLbsSystemController();
+	IMPORT_C void OpenL(TUid aModuleId);
+	IMPORT_C void Close();
+	
+	IMPORT_C void NotifySystemStartRequest(TRequestStatus& aStatus);
+	IMPORT_C TInt RequestSystemStartup();
+	IMPORT_C void SystemStartComplete(TInt aStartupResult);
+	IMPORT_C void NotifySystemCloseDownRequest(TRequestStatus& aStatus);
+	IMPORT_C TInt RequestSystemCloseDown();
+	IMPORT_C TInt RequestSystemCloseDown(TBool aNoWaitForResponse);
+	IMPORT_C void SystemCloseDownResponse(TInt aResponse);
+	IMPORT_C TInt GetCloseDownType();
+	IMPORT_C void RequestSystemReset();
+	IMPORT_C TInt RequestCompleteCloseDown();
+	
+	TInt GetStartupData(TDes8& aData);
+
+private:
+	TBool CheckLbsRootProcessIsUp();
+	
+private: 
+	RProperty    iLbsStartupRequest;
+	RProperty    iLbsStartupComplete;
+	RProperty    iLbsCloseDownRequest;
+	RProperty    iLbsCloseDownComplete;
+	};
+
+/*
+ *
+ * Observer used to pass system startup requests to the LBS Root process
+ */
+class MLbsSystemStartupObserver
+	{
+public:
+	virtual void OnStartupRequest() = 0;
+	};
+    
+/*
+ * Active object which monitors the property which signals
+ * when startup is required.
+ */
+class  CLbsSystemStartupRequestHandler : public CActive 
+	{
+public:
+	IMPORT_C static CLbsSystemStartupRequestHandler* NewL(
+                                 MLbsSystemStartupObserver* aObserver, 
+                                                         TUid aProcessUid);
+	IMPORT_C ~CLbsSystemStartupRequestHandler();
+	IMPORT_C void ConfirmStartup(TInt aStartupStatus);
+
+protected:
+	CLbsSystemStartupRequestHandler(MLbsSystemStartupObserver* aObserver);
+	void ConstructL(TUid aProcessUid);
+
+protected: // From CActive
+	void RunL();
+	void DoCancel();
+    
+private:
+	MLbsSystemStartupObserver* iObserver;
+	RLbsSystemController iLbsSystemController;    
+	};
+    
+/*
+ *
+ * Observer used to pass system startup requests to the LBS Root process
+ */
+class MLbsSystemCloseDownObserver
+    {
+public:
+    virtual void OnCloseDownRequest(TBool aConfirmCloseDownComplete) = 0;
+    virtual void OnResetRequest() = 0;
+    virtual void OnCompleteCloseDownRequest() = 0;
+    };
+    
+/*
+ * Active object which monitors the property which signals
+ * when closedown is required.
+ */
+class  CLbsSystemCloseDownRequestHandler : public CActive 
+	{
+public:
+	IMPORT_C static CLbsSystemCloseDownRequestHandler* NewL(
+							MLbsSystemCloseDownObserver* aObserver, 
+													TUid aProcessUid);
+    IMPORT_C ~CLbsSystemCloseDownRequestHandler();
+    IMPORT_C void ConfirmCloseDown(TInt aResponse);
+
+protected:
+    CLbsSystemCloseDownRequestHandler(MLbsSystemCloseDownObserver* aObserver);
+    void ConstructL(TUid aProcessUid);
+
+protected: // From CActive
+    void RunL();
+    void DoCancel();
+    
+private:
+    MLbsSystemCloseDownObserver* iObserver;
+    RLbsSystemController iLbsSystemController;    
+    };
+    
+#endif //__LBS_SYSTEMSTARTER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/lbstestclient.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,55 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Client-side code for the Lbs test server
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#ifndef LBSERVERCLIENT_H__
+#define LBSERVERCLIENT_H__
+
+
+class CLbsTestServerImpl;
+
+/** Class used to access the LBS test server.
+*/
+NONSHARABLE_CLASS(CLbsTestServer) : public CBase
+	{
+public:
+	IMPORT_C static CLbsTestServer* NewL();
+	~CLbsTestServer();
+
+public:
+	IMPORT_C TInt StopLbsSystem();
+	IMPORT_C TInt StartLbsSystem();
+	IMPORT_C TInt ResetLbsSystem();
+
+protected:
+	CLbsTestServer();
+	void ConstructL();
+
+private:
+	CLbsTestServerImpl* iImpl;
+	
+	TUint8 iReserved[12]; // reserved for future use (to preserve BC).
+	};	
+	
+#endif // LBSERVERCLIENT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/lbstestclientimpl.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,56 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Header for the implementation of the client-side code 
+// for the Lbs test server.
+// 
+//
+
+#include "rsecuresessionbase.h"
+#include "tserverstartparams.h"
+
+
+/* Session class that derives from the server framework session.
+*/
+NONSHARABLE_CLASS(RLbsTestSession) : public RSecureSessionBase
+	{
+public:
+	TVersion Version();	
+
+	TInt StopLbsSystem();
+	TInt StartLbsSystem();
+	TInt ResetLbsSystem();
+	};
+
+/* Implementation of the client code.
+*/
+NONSHARABLE_CLASS(CLbsTestServerImpl) : public CBase
+	{
+public:
+	static CLbsTestServerImpl* NewL();
+	~CLbsTestServerImpl();
+	
+	TInt StopLbsSystem();
+	TInt StartLbsSystem();
+	TInt ResetLbsSystem();
+	
+protected:
+	CLbsTestServerImpl();
+
+private:
+	void ConstructL();
+
+private:
+	RLbsTestSession iSession;
+	TServerStartParams 	iParams; // MUST live for as long as the client
+	};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/lbstestmessageenums.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,46 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// The message enums/opcodes shared between the client and the server sides
+// 
+//
+
+#ifndef LBSTESTMESSAGEENUMS_H__
+#define LBSTESTMESSAGEENUMS_H__
+
+#include "lbsmessageenums.h"
+
+enum ELbsTestClientServerMessageEnums
+	{	
+	//
+	// If you need to add any more message Ids, add them between
+	// EFirstLbsTestServerMessage and ELastLbsTestServerMessage.
+	// (Otherwise the security policy in lbstestserver.cpp may not
+	// allow the new message.)
+	//
+
+	// Start of lbstest specific messages after the last of the
+	// basic server framework messages, ELastSessionMessageId,
+	// which is defined as KMaxInt32/2 aka 16383 (0x3FFFFFFF)
+	// in lbsmessageenums.h
+	EFirstLbsTestServerMessage						= 0x40000000,
+	
+	ELbsTestStopLbsSystem							= EFirstLbsTestServerMessage,
+	ELbsTestStartLbsSystem							= 0x40000001,
+	ELbsTestResetLbsSystem							= 0x40000002,
+	
+	ELastLbsTestServerMessage,
+	
+	};
+
+#endif //LBSTESTMESSAGEENUMS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/lbstestopensessionparams.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,62 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// opensessionparams.h
+// 
+//
+
+#ifndef __OPENSESSIONPARAMS_H__
+#define __OPENSESSIONPARAMS_H__
+
+#include <e32std.h>
+#include <e32base.h>
+
+// class used to pass data about the sub session type to/from the client/server
+class TSubSessionType
+	{
+public:
+	enum TSubSessionTypeEnum
+		{
+		EExInvalidSubsession = 0,
+		EExTimeSubSession = 1,
+		EExServerNameSubSession = 2
+		};
+public:
+	TSubSessionType() 
+		{
+		};
+	TSubSessionType(const TSubSessionTypeEnum aSubSessionType) : iSubSessionType(aSubSessionType)
+		{
+		};
+	const TSubSessionTypeEnum GetSubSessionType() const
+		{
+		return iSubSessionType;
+		};
+protected:
+	TSubSessionTypeEnum iSubSessionType;
+	};
+	
+
+// this is a sample calss, to to show that you can pass
+// blocks of data around
+class TTimeOpenSessionParams
+	{
+public:
+	TInt 		iDummyNumberParam;
+	TBuf<32> 	iDummyBufParam;	
+	};
+	
+// this is another sample to prove that you don't need a class	
+typedef TInt TServerNameOpenSessionParams;
+
+#endif // __ OPENSESSIONPARAMS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/lbstestserver.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,50 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// serverside.h
+// server side exmaple of how to use the abstract server framework
+// 
+//
+
+#ifndef LBSTESTSERVER_H__
+#define LBSTESTSERVER_H__
+
+#include "tserverstartparams.h"
+#include "csecureasbase.h"
+#include "csecureserverbase.h"
+
+
+/* 
+*/
+class CLbsTestServerImpl : public CBase, public MCreateServerImpl
+	{
+public:
+	virtual void CreateServerLC(TServerStartParams& aParams);	
+	};
+	
+/* Main server class
+*/
+class CLbsTestServer : public CSecureServerBase
+	{
+public:
+	CLbsTestServer(TInt aPriority, const CPolicyServer::TPolicy& aSecurityPolicy);
+	~CLbsTestServer();
+	void ConstructL(const TDesC& aServerName);
+	CSession2* DoNewSessionL(const TVersion &aVersion, const RMessage2& aMessage) const;
+	TVersion GetServerVersion() const;
+protected:
+	// property
+	TVersion iVersion;
+	};
+	
+#endif //LBSTESTSERVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/lbstestserverdata.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,36 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// data which identifies the server used to communicate with the LBS
+// Network Request Handler
+// 
+//
+
+#ifndef LBSTESTSERVERDATA_H__
+#define LBSTESTSERVERDATA_H__
+
+// Define the file and process of the Lbs test server
+_LIT(KTestServerFileName, "\\sys\\bin\\lbstestserver.exe");
+_LIT(KTestServerName, "lbstestserver.exe");
+
+// Current version number of the Lbs test server.
+const TInt8 KTestServerMajorVersionNumber	= 1;
+const TInt8 KTestServerMinorVersionNumber	= 0;
+const TInt16 KTestServerBuildVersionNumber	= 0;
+
+// Uid3 of the Lbs test server
+const TUint KLbsTestServerUidValue			= 0x10282281;
+const TUid  KLbsTestServerUid				= {KLbsTestServerUidValue};
+
+
+#endif // LBSTESTSERVERDATA_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/lbstestsession.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,47 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// serverside.h
+// server side exmaple of how to use the abstract server framework
+// 
+//
+
+#ifndef LBSTESTSESSION_H__
+#define LBSTESTSESSION_H__
+
+#include "csecuresessionbase.h"
+#include "csecuresessionsubsessionbase.h"
+#include "csubsessionbase.h"
+#include "messageutils.h"
+
+	
+/* Session class that implements the actual functions.
+*/	
+class CLbsTestSession : public CSecureSessionBase
+	{
+public:
+	void CreateL();
+
+protected:
+	void DispatchL(const RMessage2& aMessage);
+	void DispatchError(const RMessage2& aMessage, const TInt aError);
+
+private:
+	void StopLbsSystem(const RMessage2& aMessage);
+	void StartLbsSystem(const RMessage2& aMessage);
+	void ResetLbsSystem(const RMessage2& aMessage);
+	
+	TBool FindRootProcess(RProcess& aProcess);
+	};
+	
+#endif //LBSTESTSESSION_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/messageutils.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,46 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Definition of utilty class used to write ans read RMessage2 and send panic message 
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+*/
+
+#ifndef __LBSMESSAGEUTILS_H__
+#define __LBSMESSAGEUTILS_H__
+
+#include <e32base.h>
+
+/** 
+@internalTechnology
+@released
+
+Message object handling class, include message writing, reading and send panic message to client.
+ */
+class MessageUtils
+	{
+public:
+	static TInt Write(const RMessage2& aMessage, const TInt aIndex, const TDesC16& aBuf);
+	static TInt Write(const RMessage2& aMessage, const TInt aIndex, const TDesC8& aBuf);
+	static TInt Read(const RMessage2& aMessage, const TInt aIndex, TDes16& aBuf);
+	static TInt Read(const RMessage2& aMessage, const TInt aIdnex, TDes8& aBuf);
+	static void PanicClient(const RMessage2&, const TDesC& aCat, const TInt aReason);
+	};
+	
+#endif // __LBSMESSAGEUTILS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/rsecuresessionbase.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,64 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// rsecureasbase.h
+// Definition of base class for secure sessions
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+*/
+
+
+#ifndef __LBSSECURESESSIONBASE_H__
+#define __LBSSECURESESSIONBASE_H__
+
+#include <e32std.h>
+#include "tserverstartparams.h"
+#include "lbsmessageenums.h"
+
+NONSHARABLE_CLASS(RSecureSessionBase) : public RSessionBase
+	{
+public:
+	TInt Connect(TServerStartParams& aParams);
+	virtual void Close();
+	virtual TVersion Version() = 0;
+	virtual TInt StartServer(TServerStartParams& aParams);
+	};
+	
+NONSHARABLE_CLASS(RSecureSubSessionBase) : public RSubSessionBase
+	{
+public:
+	// template code MUST be inlined
+	template <class S, class T>
+	inline TInt Open(RSecureSessionBase& aServer, S& aSubSessionType, T& aOpenData);
+	//TInt Open(RSecureSessionBase& aServer, const TInt& aOpenData);
+	virtual void Close();	
+	};
+
+template<class S, class T>
+TInt RSecureSubSessionBase::Open(RSecureSessionBase& aServer, S& aSubSessionType, T& aOpenData)
+	{
+	TPckg<S> subSessPckg(aSubSessionType);
+	TPckg<T> openPckg(aOpenData);
+	//TPckg<TInt> openPckg(aOpenData);
+	TIpcArgs args(&subSessPckg, &openPckg);
+	return CreateSubSession(aServer, ESecureSubSessionBaseOpen, args);	
+	}
+
+
+#endif	// __LBSSECURESESSSIONBASE_H__	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/tprocessstartparams.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,63 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Definition of class used to define process start parameters 
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+*/
+
+
+#ifndef __LBSPROCESSSTARTPARAMS_H__
+#define __LBSPROCESSSTARTPARAMS_H__
+
+#include <e32std.h>
+#include <e32base.h>
+#include "tstartparamsbase.h"
+
+/**
+@internalTechnology
+@released
+
+Parameters for starting the server process
+ */
+NONSHARABLE_CLASS(TProcessStartParams) : public TStartParamsBase
+	{
+public:
+	TProcessStartParams();
+	void SetProcessFileName(const TDesC& aExeName);
+	void SetProcessName(const TDesC& aProcessName);
+	void SetRendezvousRequired(TBool aRendezvousRequired);
+	TBool GetRendezvousRequired() const;
+	const TDesC& GetProcessFileName() const;
+	const TDesC& GetProcessName() const;
+	TPtrC GetAsCommandLine() const;
+private:
+	// from TStartParamsBase
+	void SetType();
+private:
+	// property and really do mean private here
+	/** whether or not the process Rendezvous is required */
+	TBool						iRendezvousRequired;
+	/** server process file name */
+	TFileName					iProcessFileName;
+	/** server process name */
+	TFileName					iProcessName;
+	};
+	
+#endif // __LBSPROCESSSTARTPARAMS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/tserverstartparams.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,69 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Definition of class used to define server start parameters 
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+*/
+
+#ifndef __SERVERSTARTPARAMS_H__
+#define __SERVERSTARTPARAMS_H__
+
+#include <e32std.h>
+#include <e32base.h>
+#include "tstartparamsbase.h"
+
+const TInt KServerFrameworkDefaultMessageSlots = 4;
+
+
+/** 
+@internalTechnology
+@released
+
+Parameters for starting server 
+ */
+NONSHARABLE_CLASS(TServerStartParams) : public TStartParamsBase
+	{
+public:
+	TServerStartParams();
+	void SetServerFileName(const TDesC& aExeName);
+	void SetServerName(const TDesC& aServerName);
+	void SetNumberOfServerSlots(TInt aSlots);
+	void SetServerUids(TUid aUid1, TUid aUid2, TUid aUid3);
+	const TDesC& GetServerFileName();
+	const TDesC& GetServerName();
+	TInt GetNumberOfServerSlots();
+	TPtrC GetAsCommandLine() const;
+	TUidType& GetServerUids();
+private:
+	// from TStartParamsBase
+	void SetType();
+private:
+	// property and really do mean private here
+	/** Server file name */
+	TFileName					iServerFileName;
+	/** Server name */
+	TFileName					iServerName;
+	/** Number of slots in server */
+	TInt							iNumberOfSlots;
+	/** a set of three unique identifiers (UIDs) identify the server */
+	TUidType 					iUids;
+	};
+	
+#endif // __SERVERSTARTPARAMS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/inc/tstartparamsbase.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,51 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Definition of class used to define server start parameters 
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+*/
+
+#ifndef __STARTPARAMSBASE_H__
+#define __STARTPARAMSBASE_H__
+
+#include <e32std.h>
+#include <e32base.h>
+
+
+const TUint KServerStartParamsTypeValue	= 0x10282243;
+const TUid  KServerStartParamsTypeUid	= {KServerStartParamsTypeValue};
+
+const TUint KProcessStartParamsTypeValue = 10282242;
+const TUid  KProcessStartParamsTypeUid	= {KProcessStartParamsTypeValue};
+
+
+NONSHARABLE_CLASS(TStartParamsBase)
+	{
+public:
+	virtual ~TStartParamsBase();
+	const TUid	GetType() const; 
+protected:	
+	void SetType(const TUid& aType);
+	virtual void SetType() = 0;
+private:
+	TUid	iType;
+	};
+
+#endif // __STARTPARAMSBASE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/src/claunchedprocess.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,172 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "lbsmemlogger.h"
+#include "claunchedprocess.h"
+#include "csecureprocessasbase.h"
+
+
+/** Create instance of trap handler and cleanup stack
+called by the launched process! 
+
+@return Symbian error code
+@internalTechnology
+@released
+ */
+ TInt CLaunchedProcess::CompleteProcessLaunch()
+   	{
+   	__UHEAP_MARK;
+   	CTrapCleanup* cleanup=CTrapCleanup::New();
+   	TInt r=KErrNoMemory;
+   	if (cleanup)
+   		{
+ 		TRAP(r,DoCompleteProcessLaunchL());
+   		delete cleanup;
+   		}
+   	__UHEAP_MARKEND;
+   	return r;	
+   
+   	}
+      	
+
+/** Create the server process, create, install and run the active scheduler
+wait for scheduler to be stopped to return process
+
+@return Symbian error code
+@internalTechnology
+@released
+ */
+ TInt CLaunchedProcess::DoCompleteProcessLaunchL()
+ 	{ 	
+   	TInt r = KErrNone;
+   	// create and install the active scheduler we need
+   	CSecureProcessASBase* s=new(ELeave) CSecureProcessASBase();
+   	CleanupStack::PushL(s);
+   	CActiveScheduler::Install(s);
+   	
+   	// Create the memory logger object for monitoring memory
+   	LBSMEMLOG_BEGIN();
+   
+   	CBase* baseObj = s->CreateRootObjectL();
+   
+   	CleanupStack::PushL(baseObj);
+   	
+   	r = s->EntryPointL(baseObj);
+   	
+   	RProcess().Rendezvous(KErrNone);
+   	
+   	// Ready to run
+   	CActiveScheduler::Start();
+   	
+   	//
+   	// Cleanup the client
+   	CleanupStack::PopAndDestroy(1);
+
+   	// Cleanup the mem logger
+   	LBSMEMLOG_END();
+ 
+   	//
+   	// do any _FINAL _ operations. If anything.. default does nothing
+   	s->Final();
+   	// Cleanup the scheduler
+   	CleanupStack::PopAndDestroy(s);
+   	return r;
+   	}		
+
+
+/** Create instance of trap cleanup stack and the process by specified parameters
+
+@param aParams A reference to TProcessStartParams object
+@return Symbian error code
+@see TProcessStartParams
+@internalTechnology
+@released
+ */
+ TInt CLaunchedProcess::CompleteProcessLaunch(TProcessStartParams& aParams)
+	{
+	__UHEAP_MARK;
+	CTrapCleanup* cleanup=CTrapCleanup::New();
+	TInt r=KErrNoMemory;
+	if (cleanup)
+		{
+		TRAP(r,DoCompleteProcessLaunchL(aParams));
+		delete cleanup;
+		}
+	__UHEAP_MARKEND;
+	return r;	
+
+	}
+
+/** Create the server process by specified parameters, create, install and run the active scheduler
+wait for scheduler to be stopped to return process
+
+@param aParams A reference to TProcessStartParams object
+@return Symbian error code
+@see TProcessStartParams
+@internalTechnology
+@released
+ */
+ TInt CLaunchedProcess::DoCompleteProcessLaunchL(TProcessStartParams& aParams)
+	{	
+ 	// first check that we are about to create the right type of server
+	if(aParams.GetType() != KProcessStartParamsTypeUid)
+		{
+		// this is not a process type that we understand. Has the caller
+		// pass TServerStartParams by mistake?
+		User::Leave(KErrArgument); // this aborts the server startup
+		}
+
+	// rename our main thread	
+	User::LeaveIfError(User::RenameThread(aParams.GetProcessName()));
+	
+	TInt r = KErrNone;
+	// create and install the active scheduler we need
+	CSecureProcessASBase* s=new(ELeave) CSecureProcessASBase();
+	CleanupStack::PushL(s);
+	CActiveScheduler::Install(s);
+
+   	// Create the memory logger object for monitoring memory
+   	LBSMEMLOG_BEGIN();
+
+	CBase* baseObj = s->CreateRootObjectL();
+
+	CleanupStack::PushL(baseObj);
+	
+	r = s->EntryPointL(baseObj);
+	
+	// is the process that started us interested in known that we are alive and well
+	if(aParams.GetRendezvousRequired())
+		{		
+		// tell any starting process that we have started successfully and are
+		// now ready to receieve mesages or process events
+		RProcess::Rendezvous(KErrNone);
+		}
+	// Ready to run
+	CActiveScheduler::Start();
+	//
+	// Cleanup the client
+	CleanupStack::PopAndDestroy(1);
+
+   	// Cleanup the mem logger
+   	LBSMEMLOG_END();
+
+	//
+	// do any _FINAL _ operations. If anything.. default does nothing
+	s->Final();
+	// Cleanup the scheduler
+	CleanupStack::PopAndDestroy(s);
+	return r;
+	}		
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/src/cprocesslaunch.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,102 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// processlaunch.cpp
+// 
+//
+
+#include <f32file.h>
+#include "cprocesslaunch.h"
+
+//----------------------------------------------------------------------------	
+
+/** called by the launcher! Launch the process by specified parameters
+find the process and launch it
+
+@param aParams A reference to TProcessStartParams object
+@return Symbian error code
+@see TProcessStartParams
+@internalTechnology
+@released
+ */
+TInt CProcessLaunch::ProcessLaunch(TProcessStartParams& aParams)
+// now prevents multiple instances of the same image being launched!
+// So P&S servers now look like realCServer2 servers.
+	{
+	TFullName fullName;
+	_LIT(KStar, "*");
+	TParse parser;
+	parser.SetNoWild(aParams.GetProcessFileName(), NULL, NULL);
+	fullName.Append(parser.NameAndExt());
+	fullName.Append(KStar);
+	
+	TFindProcess processFinder(fullName);
+	TInt err = KErrNotFound;
+	while (err = processFinder.Next(fullName), err == KErrNone)
+		{
+		RProcess process;
+		TInt processOpenErr = process.Open(processFinder);
+		if (processOpenErr == KErrNone)
+			{
+			TExitType exitType = process.ExitType();
+			if (exitType == EExitPending)
+				{
+				// Found a running instance of the process,
+				// so return without starting another instance.
+				process.Close();
+				return KErrNone;
+				}
+			}
+			process.Close();		
+		}
+	
+	// No running instance found, so start one.
+	return (DoProcessLaunch(aParams));
+	}
+
+/** Create the process by specified parameters and wait for the request
+
+@param aParams A reference to TProcessStartParams object
+@return Symbian error code
+@see TProcessStartParams
+@internalTechnology
+@released
+ */
+TInt CProcessLaunch::DoProcessLaunch(TProcessStartParams& aParams)
+	{
+	RProcess process;
+ 	
+ 	TInt r=process.Create(aParams.GetProcessFileName(),aParams.GetAsCommandLine());
+	if (r!=KErrNone)
+		{
+		return r;
+		}
+	// are we expecing to rendezvous with the process we have created above
+	if(aParams.GetRendezvousRequired())
+		{
+		TRequestStatus stat;
+		process.Rendezvous(stat);
+		if (stat!=KRequestPending)
+			{
+			process.Kill(0);
+			}
+		else
+			{
+			process.Resume();
+			}
+		User::WaitForRequest(stat);
+		r=(process.ExitType()==EExitPanic) ? KErrGeneral : stat.Int();
+		}
+	process.Close();
+	return r;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/src/cquietus.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,86 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "cquietus.h"
+
+/** static method to create CQuietus object
+
+@return The singleton CQuietus object
+@internalTechnology
+@released
+ */
+CQuietus* CQuietus::NewL()
+	{
+	CQuietus* self = new(ELeave) CQuietus();
+	return self;
+	}
+
+/** destructor, cancel any outstanding request
+
+@internalTechnology
+@released
+ */
+CQuietus::~CQuietus()
+	{
+	Cancel();
+	}
+	
+/** constructor, create CActive object with standard priority and add itself to AS
+
+@return The singleton CQuietus object
+@internalTechnology
+@released
+ */
+CQuietus::CQuietus() : CActive(CActive::EPriorityStandard)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+/** setactive itself and issue a message to force complete the request to enter into RunL
+
+@internalTechnology
+@released
+ */
+void CQuietus::CoupDeGrace()
+	{
+	// kill out active scheduler. thsi can only be done under a RunL, so we'll
+	// force ourselves into the active scheduler Q and kill ourseleves when we run
+	SetActive();
+	TRequestStatus* trs = &iStatus;
+	User::RequestComplete(trs, KErrNone);
+	}
+
+/** All it does is to kill the process!
+
+@internalTechnology
+@released
+ */
+void CQuietus::RunL()
+	{
+	// kill the controlling AS
+	CActiveScheduler::Stop();
+	}
+
+/** Do the cancel job if cancel is issued to cancel an outstanding request
+
+@internalTechnology
+@released
+ */
+void CQuietus::DoCancel()
+	{
+	// no operation!!
+	// This operationin NOT CANCELABLE by defination and design
+	// No this is NOT a bug :)
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/src/csecureasbase.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,131 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <e32debug.h>
+#include <lbsmemlogger.h>
+#include "lbsdevloggermacros.h"
+#include "csecureasbase.h"
+#include "tserverstartparams.h"
+
+/** 
+Default constructor
+
+@internalTechnology
+@released
+ */	
+CSecureASBase::CSecureASBase()
+	{
+	}
+	
+/** 
+The main sever entry point with sever start parameters, create the cleanup stack
+
+@param aParams A reference to TServerStartParams object
+@see TServerStartParams
+@return Symbian Standard Error code
+@internalTechnology
+@released
+ */	
+TInt CSecureASBase::ServerMain(TServerStartParams& aParams)
+	{
+	// called from the server process from E32Main
+	__UHEAP_MARK;
+	//
+	CTrapCleanup* cleanup=CTrapCleanup::New();
+	TInt r=KErrNoMemory;
+	if (cleanup)
+		{
+		TRAP(r,RunServerL(aParams));
+		delete cleanup;
+		}
+	//
+	__UHEAP_MARKEND;
+	return r;
+
+	} 	
+
+/** 
+start sever with parameters, create ActiveScheduler and install it
+create a server implementation and signal the client when initialisation completes
+start the AS object and wait to destroy.
+
+@param aParams A reference to TServerStartParams object
+@see TServerStartParams
+@return Symbian Standard Error code
+@internalTechnology
+@released
+ */	
+TInt CSecureASBase::RunServerL(TServerStartParams& aParams)
+	{
+	LBSLOG(ELogP3, "->CSecureASBase::RunServerL");
+		
+	// first check that we are about to create the right type of server
+	if(aParams.GetType() != KServerStartParamsTypeUid)
+		{
+		// this is not a process type that we understand. Has the caller
+		// pass TProcessStartParams by mistake?
+		User::Leave(KErrArgument); // this aborts the server startup
+		}
+	User::LeaveIfError(User::RenameThread(aParams.GetServerName()));
+	//
+	// create and install the active scheduler we need
+	CSecureASBase* s = new (ELeave) CSecureASBase();
+	CleanupStack::PushL(s);
+	CActiveScheduler::Install(s);
+	
+	LBSMEMLOG_BEGIN();
+	
+	// test with the impl  
+	MCreateServerImpl* impl = s->GetImplLC();	
+	//
+	// create the server (leave it on the cleanup stack)
+	impl->CreateServerLC(aParams);
+	//
+	// Initialisation complete, now signal the client
+	RProcess().Rendezvous(KErrNone);
+	//
+	// Ready to run
+	LBSLOG(ELogP3, "Calling CActiveScheduler::Start");
+	CActiveScheduler::Start();
+	//
+	// Cleanup the impl, server and scheduler. Impl is destroyed via ~CBase not the M class 
+	LBSLOG(ELogP3, "Calling CleanupStack::PopAndDestroy(3)");
+
+	CleanupStack::PopAndDestroy(3);
+	
+	LBSLOG(ELogP3, "<-CSecureASBase::RunServerL");
+
+	LBSMEMLOG_END();
+
+	return KErrNone;
+	}
+
+
+/** 
+Panic the server with CSecureASBase category
+
+@param aPanic Reason to painc
+@see TSecureASBasePanic 
+@internalTechnology
+@released
+ */	
+void CSecureASBase::Panic(const TSecureASBasePanic aPanic)
+	{
+	_LIT(KSecureAsBase, "CSecureASBase");
+	User::Panic(KSecureAsBase, aPanic);
+	}
+	
+
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/src/csecureprocessasbase.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,30 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "csecureprocessasbase.h"
+
+/** Panic the secure process
+
+@param aPanic A reference to TSecureProcessASBasePanic object
+@see TSecureProcessASBasePanic
+@internalTechnology
+@released
+ */
+void CSecureProcessASBase::Panic(const TSecureProcessASBasePanic aPanic)
+	{
+	_LIT(KSecureProcessAsBase, "CSecureProcessASBase");
+	User::Panic(KSecureProcessAsBase, aPanic);
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/src/csecureserverbase.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,189 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// csesuresessionbase.cpp
+// 
+//
+
+#include "csecureserverbase.h"
+#include "cshutdowntimer.h"
+#include <e32debug.h>
+/// Lbs
+#include "lbsdevloggermacros.h"
+
+/** 
+Create a new session, called from CPolicyServer
+
+@param aVersion TVersion reference
+@param aMessage RMessage2 object reference
+@return CSession2 based object pointer
+@internalTechnology
+@released
+ */	
+CSession2* CSecureServerBase::NewSessionL(const TVersion &aVersion, const RMessage2& aMessage) const
+	{
+	TVersion v = GetServerVersion();
+	if(!User::QueryVersionSupported(v, aVersion))
+		{
+		User::Leave(KErrNotSupported);	
+		}
+	CSession2* session = DoNewSessionL(aVersion, aMessage);
+	return session;
+	}
+	
+/** 
+destrcutor, cancel if any outstanding request of shutdown timer and release it.
+
+@internalTechnology
+@released
+ */	
+CSecureServerBase::~CSecureServerBase()
+	{
+	LBSLOG(ELogP1,"->CSecureServerBase::~CSecureServerBase");
+	if(iShutdownTimer)
+		{
+		if(iShutdownTimer->IsActive())
+			iShutdownTimer->Cancel();		
+		}
+	delete iShutdownTimer;
+	iShutdownTimer = NULL;
+	LBSLOG(ELogP1,"->CSecureServerBase::~CSecureServerBase");
+	}
+	
+/** 
+Create shut down timer
+
+@internalTechnology
+@released
+ */	
+void CSecureServerBase::BaseConstructL(TBool aShutdownTimerRequired)
+	{
+	LBSLOG(ELogP1,"->CSecureServerBase::BaseConstructL");
+	iBaseConstructCalled = ETrue;
+	if(aShutdownTimerRequired)
+		{
+		iShutdownTimer = new (ELeave) CShutdownTimer();
+		iShutdownTimer->ConstructL();
+		}
+	LBSLOG(ELogP1,"<-CSecureServerBase::BaseConstructL");
+	}
+
+/** 
+constructor, create server base with specified priority and policy, default shut down time delay
+
+@param aPriority Defined server priority
+@param aSecurityPolicy A TPolicy object reference, to define server security policy
+@internalTechnology
+@released
+ */	
+CSecureServerBase::CSecureServerBase(TInt aPriority, const TPolicy& aSecurityPolicy) : CPolicyServer(aPriority, aSecurityPolicy),
+																						iShutdownDelay(KDefaultShutdownDelay)	
+	{
+	// nothing to do?
+	}
+
+/** 
+Increase the session count by 1
+The function is called whenever a new session is created, cancel the current outstanding request of shutdown timer
+
+@internalTechnology
+@released
+ */	
+void CSecureServerBase::IncSession()
+	{
+	LBSLOG(ELogP1,"->CSecureServerBase::IncSession");
+	__ASSERT_ALWAYS(iBaseConstructCalled, PanicServer(EBaseConstructNotCalled));
+	++iSessionCount;
+	if(iShutdownTimer)
+		{
+		iShutdownTimer->Cancel();
+		}
+	LBSLOG(ELogP1,"<-CSecureServerBase::IncSession");	
+	}
+	
+/** 
+Decrease the session count by 1
+The function is called whenever a new session is released, start shutdown timer with current shut down timer delay
+
+@internalTechnology
+@released
+ */	
+void CSecureServerBase::DecSession()
+	{
+	LBSLOG(ELogP1,"->CSecureServerBase::DecSession");
+
+	__ASSERT_ALWAYS(iBaseConstructCalled, PanicServer(EBaseConstructNotCalled));
+	--iSessionCount;
+	if(iSessionCount > 0)
+		return; // bail out early
+	// ~CSecureSessionBase calls this, but it can be called after
+	// ~CSecureServerBase(!) e.g. a forced shutdown of the server with clients still connected
+	// so we need to guard this.
+	if(iShutdownTimer)
+		{
+		iShutdownTimer->Start(iShutdownDelay); // otherwise start the shutdown timer.
+		}
+	LBSLOG(ELogP1,"<-CSecureServerBase::DecSession");	
+	}
+
+/** 
+Return the session count
+
+@return Session count
+@internalTechnology
+@released
+ */	
+TInt CSecureServerBase::GetSessionCount() const
+		{
+		__ASSERT_ALWAYS(iBaseConstructCalled, PanicServer(EBaseConstructNotCalled));
+		return iSessionCount;
+		}
+
+/** 
+Get the current shut down delay
+
+@return Shut down time delay
+@internalTechnology
+@released
+ */			
+TTimeIntervalMicroSeconds32 CSecureServerBase::GetShutdownDelay() const
+	{
+	__ASSERT_ALWAYS(iBaseConstructCalled, PanicServer(EBaseConstructNotCalled));
+	return iShutdownDelay;
+	}
+
+/** 
+Set shut down delay
+
+@param aDelay Shut down time delay
+@internalTechnology
+@released
+ */	
+void CSecureServerBase::SetShutdownDelay(const TTimeIntervalMicroSeconds32 aDelay)
+	{
+	__ASSERT_ALWAYS(iBaseConstructCalled, PanicServer(EBaseConstructNotCalled));
+	iShutdownDelay = aDelay;
+	}
+
+/** 
+Panic the server with specified panic reason code
+
+@param aPanicCode Panic reason code
+@internalTechnology
+@released
+ */	
+void CSecureServerBase::PanicServer(TInt aPanicCode) const
+	{
+	_LIT(KSecureServerBase, "SecureServerBase");
+	User::Panic(KSecureServerBase, aPanicCode);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/src/csecuresessionbase.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,123 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// csesuresessionbase.cpp
+// 
+//
+
+#include "csecuresessionbase.h"
+#include "csecureserverbase.h"
+#include "lbsmessageenums.h"
+#include <e32debug.h>
+/// Lbs
+#include "lbsdevloggermacros.h"
+/** 
+constructor, call the CSession2 base class constructor
+
+@internalTechnology
+@released
+ */	
+CSecureSessionBase::CSecureSessionBase() : CSession2()
+	{
+	LBSLOG(ELogP1,"CSecureSessionBase::CSecureSessionBase");
+	}
+
+/** 
+destructor, decrease the server session count, which will inturn start shutdown timer.
+
+@internalTechnology
+@released
+ */	
+CSecureSessionBase::~CSecureSessionBase()
+	{
+	LBSLOG(ELogP1,"CSecureSessionBase::~CSecureSessionBase");
+	const CServer2* baseServer = Server();
+	reinterpret_cast<CSecureServerBase*>(const_cast<CServer2*>(baseServer))->DecSession(); // reduce the server session count - start shutdown timer etc.
+	}
+	
+
+/** 
+function is called by CSession2 to increase the server session count, which will inturn reset shutdown timer.
+
+@internalTechnology
+@released
+ */	
+void CSecureSessionBase::CreateL()
+	{
+	const CServer2* baseServer = Server();
+	reinterpret_cast<CSecureServerBase*>(const_cast<CServer2*>(baseServer))->IncSession(); // increase the server session count - stop shutdown timer etc.		
+	}
+	
+/** 
+Disconnect the session.
+
+@param aMessage A reference to RMessage2 object
+@internalTechnology
+@released
+ */	
+void CSecureSessionBase::Disconnect(const RMessage2& aMessage)
+	{
+	LBSLOG(ELogP1,"CSecureSessionBase::Disconnect");
+	CSession2::Disconnect(aMessage);
+	// used for a breakpoint
+	}
+	
+/** 
+Session message dispatch function 
+
+@param aMessage A reference to RMessage2 object
+@internalTechnology
+@released
+ */	
+void CSecureSessionBase::ServiceL(const RMessage2& aMessage)
+	{
+	DispatchL(aMessage); // if this leaves it hits CSession2::ServiceError (or the derived version of it)
+	}
+		
+/** 
+Session error message dispatch function, this is called when error happens, it dispatches the error locally and 
+then pass the error message to CSession2
+
+@param aMessage A reference to RMessage2 object
+@param aError Error code
+@internalTechnology
+@released
+ */	
+void CSecureSessionBase::ServiceError(const RMessage2& aMessage, TInt aError)
+	{
+	DispatchError(aMessage, aError); // provide the opportunity to do something locally
+	// now take the base class actions
+	CSession2::ServiceError(aMessage, aError); // will complete aMessage with aError if not already completed.
+	}
+
+/** 
+Nothing here. a place for extra subsession construction functionalities
+
+@internalTechnology
+@released
+ */	
+void CSecureSessionBase::ConstructSubSessionL()
+	{
+	// does nothing in the default base class
+	}
+
+/** 
+Nothing here. a place for extra subsession destruction functionalities
+
+@internalTechnology
+@released
+ */	
+void CSecureSessionBase::DestroySubSession()
+	{
+	// does nothing in the default base class
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/src/csecuresessionsubsessionbase.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,319 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <e32debug.h>
+#include "csecuresessionsubsessionbase.h"
+#include "csubsessionbase.h"
+#include "lbsmessageenums.h"
+#include "messageutils.h"
+#include "lbsdevloggermacros.h"
+
+/** 
+constructor, call the CSecureSessionBase base class constructor
+
+@internalTechnology
+@released
+ */	
+CSecureSessionSubSessionBase::CSecureSessionSubSessionBase() : CSecureSessionBase()
+	{
+	LBSLOG(ELogP3, "CSecureSessionSubSessionBase::CSecureSessionSubSessionBase()");
+	}
+
+/** 
+destructor, release the subsession handler container
+
+@internalTechnology
+@released
+ */	
+CSecureSessionSubSessionBase::~CSecureSessionSubSessionBase()
+	{
+	LBSLOG(ELogP3, "->CSecureSessionSubSessionBase::~CSecureSessionSubSessionBase()");
+
+	if (iObjectIx)
+		{
+		TInt count = iObjectIx->Count();
+		for(TInt i=0; i<count; i++)
+			{
+			CObject* theObj = (*iObjectIx)[i];
+			if (theObj)
+				{
+				TInt handle = iObjectIx->At(theObj);
+				// if we reach here somethingbad has happened. The server class
+				// (i.e. the session object) is being closed by the client, BEFORE
+				// the client has closes all of the open subsessions.
+				// So the only reasonable thingto do here is:
+				// delete the subsession - without closing it first. 'Cos this is
+				// _exactly_ what the client side has asked for (for some reason).
+				// The may or may not be legal, or even a good idea depending on the type of server
+				// that is being developeds. But the server framework should NOT
+				// prevent this from happening. Generating a panic is a 
+				// server developers choice, not a framework developers choice.
+				// We delete by calling CObjectIdx::Remove(). This will call CObject::Close.
+				// This in turn calls MSubSessionImpl::MRelease::VirtualRelease
+				// which will destroy the sub session for us.
+				// CloseSubSession should not be called directly.
+				iObjectIx->Remove(handle);
+				
+				//
+				// If the array length has changed, then update count and move back one space,
+				// so that the same cell will be re-inspected during the next iteration of the
+				// loop  This is because we have removed the current cell and therefore the
+				// next cell is actually in iObjectIx[i] (i.e. the current one).
+				TInt newCount = iObjectIx->Count();
+				
+				if (newCount != count)
+					{
+					count = newCount;
+					i--;
+					}
+
+				}
+			}
+		delete iObjectIx;
+		}
+	if (iContainerIx)
+		{
+		iContainerIx->Remove(iObjectCon);
+		delete iContainerIx;
+		}
+	// session decrementing handled in the parent class
+	LBSLOG(ELogP3, "<-CSecureSessionSubSessionBase::~CSecureSessionSubSessionBase()");
+	}
+	
+/** 
+called as part of the CSession2 construction. 
+Create subsession handler container and call the session CreateL function to increase the session count
+
+@internalTechnology
+@released
+ */	
+void CSecureSessionSubSessionBase::CreateL()
+	{
+	LBSLOG(ELogP3, "->CSecureSessionSubSessionBase::CreateL");
+	iObjectIx = CObjectIx::NewL();
+	iContainerIx = CObjectConIx::NewL();
+	iObjectCon = iContainerIx->CreateL();
+	CSecureSessionBase::CreateL(); // call the parent class to inc the session count
+	iBaseCreateCalled = ETrue;
+	LBSLOG(ELogP3, "<-CSecureSessionSubSessionBase::CreateL");
+	}
+	
+/** 
+Do the real thing for subsession construction.
+Check whether the session constructL function is called or not first. If not, panic the server,
+Create a subsession and push it to stack, get the implementation of subsession and invoke the 
+real subsession creation implementation.
+
+Add the subsession handler to container and write the handler to client address space through message object
+Complete the creating message.
+
+@param aMessage A RMessage2 reference.
+@internalTechnology
+@released
+ */	
+void CSecureSessionSubSessionBase::CreateSubSessionL(const RMessage2& aMessage)
+	{
+	__ASSERT_ALWAYS(iBaseCreateCalled, Server()->PanicServer(CSecureServerBase::EBaseCreateNotCalled));
+	CSubSessionBase* subSession = new (ELeave) CSubSessionBase();
+	// Note: Use the CObject::Close() function instead of usual destructor
+	// because it is needed to correctly decrement the reference count.
+	// Close() will destruct subSession anyway if the ref count == 0.
+	CleanupClosePushL(*subSession);
+
+	MSubSessionImpl* impl = subSession->GetImplL(aMessage);
+	CleanupVirtualReleasePushL(*impl); // call Release() on destruction
+	//CleanupVirtualRelease::PushL(*impl);
+	subSession->SetImpl(impl); // will take ownership(!)
+	CleanupStack::Pop(impl);
+
+	// We need to pass a handle to the controllign server down to the subsession object.
+	// Since the subsession impl object is a CBase object (NOT a CSession2 object)
+	// we haev to do this outherwise the subsession will not be able to referene the
+	// server - which seems like a useful thing to do.
+	const CSecureServerBase* server = reinterpret_cast<const CSecureServerBase*>(Server()); 	
+	impl->CreateSubSessionL(aMessage, server);
+	
+	iObjectCon->AddL(subSession);
+	TInt handle = iObjectIx->AddL(subSession);
+	TPckgC<TInt> pH(handle);
+	MessageUtils::Write(aMessage, 3, pH);
+	aMessage.Complete(KErrNone);
+	CleanupStack::Pop(subSession);
+	}
+	
+/** 
+Do the real thing for subsession destruction.
+Check whether the session constructL function is called or not first. If not, panic the server,
+get a subsession handler from container and complete the message if subsession is already close, 
+if not, close subsession and remove it from container then complete the message.
+
+@param aMessage A RMessage2 reference.
+@internalTechnology
+@released
+ */	
+void CSecureSessionSubSessionBase::DestroySubSession(const RMessage2& aMessage)
+	{
+	__ASSERT_ALWAYS(iBaseCreateCalled, Server()->PanicServer(CSecureServerBase::EBaseCreateNotCalled));
+	CSubSessionBase* subSession = reinterpret_cast<CSubSessionBase*>(iObjectIx->At(aMessage.Int3()));
+	
+	if (subSession == NULL)
+		{
+		aMessage.Complete(KErrBadHandle);
+		}
+	else
+		{
+		// we have been asked to close a subsession by the client side so
+		// do just that :). c.f. CSecureSessionSubSessionBase::~CSecureSessionSubSessionBase() above.
+		// In this case we do need to call CloseSubSession before deleting
+		// the subsession object.
+		// We delete by calling CObjectIdx::Remove().This will call CObject::Close.
+		// This in turn calls MSubSessionImpl::MRelease::VirtualRelease
+		// which willdestroy the sub session for us.
+		CSubSessionBase* subSession = static_cast<CSubSessionBase*>(iObjectIx->At(aMessage.Int3()));
+		iObjectIx->Remove(aMessage.Int3());
+		aMessage.Complete(KErrNone);
+		}
+	}
+
+/** 
+Check whether the session constructL function is called or not first. If not, panic the server,
+
+Dispatch the message at session level, only two types of message are handled here:
+SubSession Open and Close.
+The other messages are fwd to subsession via DispatchMessage.
+
+@param aMessage A RMessage2 reference.
+@internalTechnology
+@released
+ */	
+void CSecureSessionSubSessionBase::DispatchL(const RMessage2& aMessage)
+	{
+	__ASSERT_ALWAYS(iBaseCreateCalled, Server()->PanicServer(CSecureServerBase::EBaseCreateNotCalled));
+	switch(aMessage.Function())
+		{
+		case ESecureSubSessionBaseOpen:
+			CreateSubSessionL(aMessage);
+			break;
+		case ESecureSubSessionBaseClose:
+			DestroySubSession(aMessage);
+			break;
+		default:
+			// the message could be EITHER a session operation - which we have to handle here, or an operation
+			// handled by the subsession which we have to forward
+			DispatchMessageL(aMessage);
+			break;
+		}
+		
+	}
+
+/** 
+Check whether the session constructL function is called or not first. If not, panic the server,
+
+Check whether the message are for session or subsession
+Dispatch the message at subsession level
+get the subsession handler from container and dispatch the message to subsession implementation!
+
+@param aMessage A RMessage2 reference.
+@internalTechnology
+@released
+ */	
+void CSecureSessionSubSessionBase::DispatchMessageL(const RMessage2& aMessage)
+	{
+	__ASSERT_ALWAYS(iBaseCreateCalled, Server()->PanicServer(CSecureServerBase::EBaseCreateNotCalled));
+	// NB the test is intened to ignore a function enum of ELastSessionMessageId - this is not a valid command
+	if(aMessage.Function()<ELastSessionMessageId)
+		{
+		// the message is for the session
+		ServiceMessageL(aMessage); // implmented in the DERIVED CSessionBase class.
+		}
+	else if(aMessage.Function()>ELastSessionMessageId)
+		{
+		// MUST be a message for the subsystem object - delegate
+		CSubSessionBase* subSession = static_cast<CSubSessionBase*>(iObjectIx->At(aMessage.Int3()));
+		subSession->Impl()->DispatchL(aMessage);
+		}
+	}
+
+/** 
+Return the server
+
+@return Pointer to server base
+@internalTechnology
+@released
+ */	
+const CSecureServerBase* CSecureSessionSubSessionBase::Server() const
+	{
+	return reinterpret_cast<const CSecureServerBase*>(CSession2::Server());
+	}
+
+/** 
+Check whether the session constructL function is called or not first. If not, panic the server,
+
+Dispatch the message at session level, only two types of message are handled here:
+SubSession Open and Close.
+If error happened when open subsession, destroy the subsession.
+
+otherwise, pop the error messages to session or fwd to subsession via DispatchError.
+
+@param aMessage A RMessage2 reference.
+@param aError Error code.
+@internalTechnology
+@released
+ */	
+void CSecureSessionSubSessionBase::DispatchError(const RMessage2& aMessage, TInt aError)
+	{
+	__ASSERT_ALWAYS(iBaseCreateCalled, Server()->PanicServer(CSecureServerBase::EBaseCreateNotCalled));
+	CSubSessionBase* subSession = NULL;
+	switch(aMessage.Function())
+		{
+		case ESecureSubSessionBaseOpen:
+			if(aError == KErrArgument)
+				{
+				// panic the client we have NO idea what sort
+				// of sub session class the user was tryign to create. 
+				// This is a client side failure!, so shoot the client
+				MessageUtils::PanicClient(aMessage, KServerFrameworkPanic, ESecureSubSessionBaseUnknownSubSessionType);
+				// NB there is NOTHING to clean up here, everything is deleted via
+				// the cleanup stack, and the subsession object was never added to the
+				// obejct containers.... See CreateSubSessionL above
+				}
+			else
+				{
+				// CreateSubSessionL() has caused a Leave, so there is 
+				// no sub session object to clear up - just complete the
+				// message with an error
+				aMessage.Complete(aError);
+				}
+			break;
+		case ESecureSubSessionBaseClose:
+			// Panic? Non-leaving function that just left?
+			break;
+		default:
+			// DisplatchMessageL above has left - this could be becuase ServiceMessageL left or the subsession DisplatchL
+			// NB the test is intened to ignore a function enum of ELastSessionMessageId - this is not a valid command
+			if(aMessage.Function()<ELastSessionMessageId)
+				{
+				// the message is for the session
+				ServiceMessageError(aMessage, aError); // implmented in the DERIVED CSessionBase class.
+				}
+			else if(aMessage.Function()>ELastSessionMessageId)
+				{
+				// MUST be a message for the subsystem object - delegate
+				subSession = static_cast<CSubSessionBase*>(iObjectIx->At(aMessage.Int3()));
+				subSession->Impl()->DispatchError(aMessage, aError);
+				}
+			break;
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/src/cserverlaunch.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,77 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// serverlaunch.cpp
+// 
+//
+
+#include "cserverlaunch.h"
+#include "tserverstartparams.h"
+
+/** Launch the server by specified parameters
+find the process and launch it
+
+@param aParams A reference to TProcessStartParams object
+@return Symbian error code
+@see TProcessStartParams
+@internalTechnology
+@released
+ */
+TInt CServerLaunch::ServerLaunch(TServerStartParams& aParams)
+	{
+	TFindServer serverSearcher(aParams.GetServerName());
+	TFileName matchingFileName;
+	TInt error = serverSearcher.Next(matchingFileName); // we haev asked for a exact match, so the retunred filename can be ignored
+	if(error==KErrNone)
+		{
+		return KErrNone; // found it, so some other kind process has just started the server for us
+		}
+	else
+		{
+		error = CreateServerProcess(aParams);		
+		}
+	return error;
+	}
+
+/** create server process by specified parameters
+signal the clients and start the process, wait for any request.
+
+@param aParams A reference to TProcessStartParams object
+@return Symbian error code
+@see TProcessStartParams
+@internalTechnology
+@released
+ */
+TInt CServerLaunch::CreateServerProcess(TServerStartParams& aParams)
+	{
+	RProcess server;
+ 	
+ 	TInt r=server.Create(aParams.GetServerFileName(),aParams.GetAsCommandLine());
+	if (r!=KErrNone)
+		return r;
+	TRequestStatus stat;
+	server.Rendezvous(stat);
+	if (stat!=KRequestPending)
+		{
+		server.Kill(0);
+		}
+	else
+		{
+		server.Resume();
+		}
+	User::WaitForRequest(stat);
+	r=(server.ExitType()==EExitPanic) ? KErrGeneral : stat.Int();
+	server.Close();
+	return r;
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/src/cshutdowntimer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,97 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "cshutdowntimer.h"
+#include <e32debug.h>
+/// Lbs
+#include "lbsdevloggermacros.h"
+/** 
+Default constructor, set the timer to standard priority by default
+add timer to active scheduler
+
+@internalTechnology
+@released
+ */	
+CShutdownTimer::CShutdownTimer() : CTimer(CActive::EPriorityStandard)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+/** 
+Default destructor, cancel any outstanding request of timer active object
+
+@internalTechnology
+@released
+ */	
+CShutdownTimer::~CShutdownTimer()
+	{
+	LBSLOG(ELogP1,"CShutdownTimer::~CShutdownTimer");
+	Cancel();
+	}
+
+/** 
+Call CTimer base class to construct the shut down timer
+
+@internalTechnology
+@released
+ */	
+void CShutdownTimer::ConstructL()
+	{
+	// call the base class version
+	CTimer::ConstructL();
+	}
+
+/** 
+start the timer by specifying the shut down delay to issue a time request 
+
+@param aDelay Time interval in micro seconds
+@internalTechnology
+@released
+ */	
+void CShutdownTimer::Start(const TTimeIntervalMicroSeconds32 aDelay)
+	{
+	LBSLOG(ELogP1,"->CShutdownTimer::Start");
+	After(aDelay);
+	LBSLOG(ELogP1,"<-CShutdownTimer::Start");
+	}
+	
+/** 
+stop the timer by cancelling outstanding time request
+
+@internalTechnology
+@released
+ */	
+void CShutdownTimer::Stop()
+	{
+	LBSLOG(ELogP1,"->CShutdownTimer::Stop");
+	Cancel();
+	LBSLOG(ELogP1,"<-CShutdownTimer::Stop");
+	}
+	
+/** 
+inherited from CActive. Main message loop to deal with dispatched request
+stop the active scheduler whenever a request is received. 
+ this stops the AS that owns the CPolicyServer AO. So it stops the server.
+
+@internalTechnology
+@released
+ */	
+void CShutdownTimer::RunL()
+	{
+	LBSLOG(ELogP1,"->CShutdownTimer::RunL");
+	CActiveScheduler::Stop();
+	LBSLOG(ELogP1,"<-CShutdownTimer::Stop");
+
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/src/csubsessionbase.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,126 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "csubsessionbase.h"
+#include "lbsmessageenums.h"
+
+/** 
+inline function to push the item needed to be released when destroy, via a TCleanupItem object,
+which includes a MRelease function to release the resource.
+
+@param aRef A reference MRelease function
+@internalTechnology
+@released
+ */	
+inline void CleanupVirtualRelease::PushL(MRelease& aRef)
+	{
+	CleanupStack::PushL(TCleanupItem(&Release,&aRef));
+	}
+		
+/** 
+release the resource by calling the defined MRelease function
+
+@param aPrt A reference of MRelease function
+@internalTechnology
+@released
+ */	
+void CleanupVirtualRelease::Release(TAny* aPtr)
+	{
+	MRelease* ptr = reinterpret_cast<MRelease*>(aPtr);
+	TReleaseFunc func = &MRelease::VirtualRelease;
+	(ptr->*func)();
+	}
+	
+	
+/** 
+function to push the item needed to be released by calling CleanupVirtualRelease class,
+which includes a MRelease function to release the resource.
+
+@param aRef A reference MRelease function
+@internalTechnology
+@released
+ */	
+void CleanupVirtualReleasePushL(MRelease& aRef)
+	{
+	CleanupVirtualRelease::PushL(aRef);
+	}
+	
+/** 
+Default constructor
+Nothing here
+
+@internalTechnology
+@released
+ */	
+CSubSessionBase::CSubSessionBase()
+	{
+	// does nothing
+	}
+	
+/** 
+Default destructor
+Nothing here
+
+@internalTechnology
+@released
+ */	
+CSubSessionBase::~CSubSessionBase()
+	{
+	// nuke the impl object
+	if(iImpl)
+		{
+		iImpl->VirtualRelease();
+		iImpl=NULL;
+		}
+	}
+
+/** 
+Set the generic subsession implement pointer
+
+@param aImpl A generic interface pointer to MSubSessionImpl
+@see MSubSessionImpl
+@internalTechnology
+@released
+ */	
+void CSubSessionBase::SetImpl(MSubSessionImpl* aImpl)
+	{
+	iImpl = aImpl;
+	}
+	
+/** 
+Get the generic subsession implement pointer
+
+@return the generic interface pointer to MSubSessionImpl
+@see MSubSessionImpl
+@internalTechnology
+@released
+ */	
+MSubSessionImpl* CSubSessionBase::Impl()
+	{
+	return iImpl;
+	}
+
+/** 
+Invoke user panic by setting the category as CSubSessionBase
+
+@param aPanic A constant panic category TSubSessionBasePanic
+@internalTechnology
+@released
+ */	
+void CSubSessionBase::Panic(const TSubSessionBasePanic aPanic)
+	{
+	_LIT(KSubSessionBase, "CSubSessionBase");
+	User::Panic(KSubSessionBase, aPanic);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/src/lbstestclient.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,65 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Client side code for the LBS test server.
+// 
+//
+
+#include <e32base.h>
+#include <e32debug.h>
+#include "lbstestclient.h"
+#include "lbstestclientimpl.h"
+
+	
+///////////////////////////////////////////////////////////////////////////////
+// CLbsTestServer
+///////////////////////////////////////////////////////////////////////////////
+
+CLbsTestServer::CLbsTestServer()
+	{
+	
+	}
+	
+CLbsTestServer::~CLbsTestServer()
+	{
+	delete iImpl;
+	}
+
+EXPORT_C CLbsTestServer* CLbsTestServer::NewL()
+	{
+	CLbsTestServer* self = new (ELeave) CLbsTestServer;
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+void CLbsTestServer::ConstructL()
+	{
+	iImpl = CLbsTestServerImpl::NewL();
+	}
+
+EXPORT_C TInt CLbsTestServer::StopLbsSystem()
+	{
+	return iImpl->StopLbsSystem();
+	}
+
+EXPORT_C TInt CLbsTestServer::StartLbsSystem()
+	{
+	return iImpl->StartLbsSystem();
+	}
+
+EXPORT_C TInt CLbsTestServer::ResetLbsSystem()
+	{
+	return iImpl->ResetLbsSystem();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/src/lbstestclientimpl.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,108 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Implementation of the client-side code 
+// for the Lbs test server.
+// 
+//
+
+#include <e32base.h>
+#include "lbstestmessageenums.h"
+#include "lbstestserverdata.h"
+#include "lbstestclientimpl.h"
+
+
+///////////////////////////////////////////////////////////////////////////////
+// RLbsTestSession
+///////////////////////////////////////////////////////////////////////////////
+
+/** Get the version of this object.
+*/
+TVersion RLbsTestSession::Version()
+	{
+	return TVersion(KTestServerMajorVersionNumber,
+					KTestServerMinorVersionNumber,
+					KTestServerBuildVersionNumber);
+	}
+
+/** Force the LBS system to stop and shutdown.
+
+THIS FUNCTION SHOULD ONLY BE USED IN TEST CODE!
+
+This function will stop the LBS system immediately, even
+if it is currently processing a location request.
+*/
+TInt RLbsTestSession::StopLbsSystem()
+	{
+	return SendReceive(ELbsTestStopLbsSystem);
+	}
+
+TInt RLbsTestSession::StartLbsSystem()
+	{
+	return SendReceive(ELbsTestStartLbsSystem);
+	}
+
+TInt RLbsTestSession::ResetLbsSystem()
+	{
+	return SendReceive(ELbsTestResetLbsSystem);
+	}
+
+///////////////////////////////////////////////////////////////////////////////
+// CLbsTestServerImpl
+///////////////////////////////////////////////////////////////////////////////
+
+CLbsTestServerImpl::~CLbsTestServerImpl()
+	{
+	iSession.Close();
+	}
+	
+CLbsTestServerImpl::CLbsTestServerImpl()
+	{
+	}
+
+CLbsTestServerImpl* CLbsTestServerImpl::NewL()
+	{
+	CLbsTestServerImpl* self = new (ELeave) CLbsTestServerImpl;
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+	
+void CLbsTestServerImpl::ConstructL()
+	{
+	/**
+	 * See the ServerFramework code for the meaning of these params
+	 */
+	iParams.SetServerFileName(KTestServerFileName);
+	iParams.SetServerName(KTestServerName);
+	iParams.SetNumberOfServerSlots(KServerFrameworkDefaultMessageSlots);
+	iParams.SetServerUids(KNullUid, KNullUid, KLbsTestServerUid);
+	
+	User::LeaveIfError(iSession.Connect(iParams));	
+	}
+
+TInt CLbsTestServerImpl::StopLbsSystem()
+	{
+	return iSession.StopLbsSystem();
+	}
+
+TInt CLbsTestServerImpl::StartLbsSystem()
+	{
+	return iSession.StartLbsSystem();
+	}
+
+TInt CLbsTestServerImpl::ResetLbsSystem()
+	{
+	return iSession.ResetLbsSystem();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/src/lbstestserver.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,109 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// server side exmaple of how to use the abstract server framework
+// 
+//
+
+#include <e32debug.h>
+#include "lbstestserver.h"
+#include "lbstestserverdata.h"
+#include "lbstestmessageenums.h"
+#include "lbstestsession.h"
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Security Policy information
+///////////////////////////////////////////////////////////////////////////////
+const TUint myRangeCount = 4;
+const TInt myRanges[myRangeCount] = 
+    {
+    0, //range is 0-1 inclusive
+    ESecureSubSessionBaseClose, //range is ESecureSubSessionBaseClose to (EFirstLbsTestServerMessage - 1)
+    EFirstLbsTestServerMessage, //range is EFirstLbsTestServerMessage to (ELastLbsTestServerMessage - 1)
+    ELastLbsTestServerMessage // range is ELastLbsTestServerMessage to KMaxTInt inclusive
+    };
+    
+const TUint8 myElementsIndex[myRangeCount] = 
+    {
+    CPolicyServer::EAlwaysPass,
+    CPolicyServer::ENotSupported,
+    0,
+    CPolicyServer::ENotSupported
+    };
+    
+const CPolicyServer::TPolicyElement myElements[] = 
+    {
+    {_INIT_SECURITY_POLICY_C1(ECapabilityLocation), CPolicyServer::EFailClient}
+    };
+    
+const CPolicyServer::TPolicy myPolicy =
+    {
+    CPolicyServer::EAlwaysPass, //specifies all connect attempts should pass
+    myRangeCount,                   
+    myRanges,
+    myElementsIndex,
+    myElements,
+    };
+
+///////////////////////////////////////////////////////////////////////////////
+// Implementation of Server Framework functions
+///////////////////////////////////////////////////////////////////////////////
+
+MCreateServerImpl* CSecureASBase::GetImplLC()
+	{
+	CLbsTestServerImpl* impl = new(ELeave) CLbsTestServerImpl();
+	CleanupStack::PushL(impl);
+	return impl;
+	}
+
+void CLbsTestServerImpl::CreateServerLC(TServerStartParams& aParams)
+	{
+	CLbsTestServer* s = new(ELeave) CLbsTestServer(CActive::EPriorityStandard, myPolicy);
+	CleanupStack::PushL(s);
+	s->ConstructL(aParams.GetServerName());
+	// leave the server object on the CS
+	}
+	
+///////////////////////////////////////////////////////////////////////////////
+// CTestServer
+///////////////////////////////////////////////////////////////////////////////
+
+CLbsTestServer::CLbsTestServer(TInt aPriority, const CPolicyServer::TPolicy& aSecurityPolicy) : 
+	CSecureServerBase(aPriority, aSecurityPolicy),
+	iVersion(KTestServerMajorVersionNumber,
+			 KTestServerMinorVersionNumber,
+			 KTestServerBuildVersionNumber)
+	{
+	}
+	
+CLbsTestServer::~CLbsTestServer()
+	{
+	}
+	
+void CLbsTestServer::ConstructL(const TDesC& aServerName)
+	{
+	StartL(aServerName);
+	BaseConstructL(); // MUST BE CALLED	
+	}
+	
+CSession2* CLbsTestServer::DoNewSessionL(const TVersion& /*aVersion*/, const RMessage2& /*aMessage*/) const
+	{
+	return new (ELeave) CLbsTestSession(); // version number already checked at this point
+	}
+	
+	
+TVersion CLbsTestServer::GetServerVersion() const
+	{
+	return iVersion;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/src/lbstestservermain.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,37 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// servermain.cpp
+// THIS FILE MUST BE RENAMED TO THE NAME OF OF YOUR SERVER MAIN ENTRY POINT
+// DO NOT EDIT THE FILE CONTENTS
+// 
+//
+	
+	
+#include "e32base.h"
+#include "csecureasbase.h"
+#include "tserverstartparams.h"
+
+// sample E32Main
+// all servers should use this E32main(!), but in a renamed file.
+// Derived classes make use of the abstract method CSecureAsBase::CreateServerLC(const TServerStartParams& aParams)
+// For an implmenter that is your "E32Main"
+
+TInt E32Main()
+	{
+	TServerStartParams params;
+	TPtr ptr(reinterpret_cast<TText*>(&params), 0, sizeof(TServerStartParams)/sizeof(TText16));
+	User::CommandLine(ptr);
+	TInt err = CSecureASBase::ServerMain(params);
+	return err;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/src/lbstestsession.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,197 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// serverside.cpp
+// server side exmaple of how to use the abstract server framework
+// 
+//
+
+#include <e32debug.h>
+#include "lbstestsession.h"
+#include "lbstestmessageenums.h"
+#include "lbssystemcontroller.h"
+#include "tprocessstartparams.h"
+#include "cprocesslaunch.h"
+
+
+/* Called by the CServer2 code to complete construction of the session 
+*/
+void CLbsTestSession::CreateL()
+	{
+	CSecureSessionBase::CreateL(); // MUST do this
+	}
+	
+/* Service new client requests.
+*/
+void CLbsTestSession::DispatchL(const RMessage2& aMessage)
+	{
+	switch (aMessage.Function())
+		{
+		case ELbsTestStopLbsSystem:
+			{
+			StopLbsSystem(aMessage);
+			break;
+			}
+		case ELbsTestStartLbsSystem:
+			{
+			StartLbsSystem(aMessage);
+			break;
+			}
+		case ELbsTestResetLbsSystem:
+			{
+			ResetLbsSystem(aMessage);
+			break;
+			}
+		default:
+			{
+			aMessage.Complete(KErrNotSupported);
+			break;
+			}
+		}
+	}
+
+/* Handle leaves from DispatchL
+*/
+void CLbsTestSession::DispatchError(const RMessage2& /*aMessage*/, const TInt /*aError*/)
+	{
+	// Do nothing; leave error handling to the default behaviour
+	}
+
+/* Force the LBS system to stop.
+
+THIS FUNCTION SHOULD ONLY EVER BE USED FOR TEST PURPOSES.
+
+This function will tell LbsRoot to stop the LBS system immediately.
+It will not check to see if there are any active requests still
+being processed.
+*/
+void CLbsTestSession::StopLbsSystem(const RMessage2& aMessage)
+	{
+	TInt err(KErrUnknown);
+	RLbsSystemController systemController;
+	
+	// Open the system controller interface
+	RProcess process;
+	systemController.OpenL(process.SecureId());
+	CleanupClosePushL(systemController);
+	
+	// Logon to the root process to detect when it has exited
+	if (FindRootProcess(process))
+		{
+		TRequestStatus status;
+		process.Logon(status);
+		
+		// Force a complete close down of LBS
+		switch (systemController.RequestCompleteCloseDown())
+			{
+			case ELbsCloseDownRejected:
+				{
+				err = KErrInUse;
+				process.LogonCancel(status);
+				break;
+				}
+			case ELbsCloseDownComplete:
+				{
+				err = KErrNone;
+				break;
+				}
+			case ELbsCloseDownRootNotFound:
+				{
+				err = KErrDied;
+				process.LogonCancel(status);
+				break;
+				}
+			}
+		
+		User::WaitForRequest(status);
+		process.Close();
+		}
+
+	/* Wait until the LBS Root process has definitely gone down */
+	while(FindRootProcess(process))
+	/* do nothing ... */;
+	
+	CleanupStack::PopAndDestroy(&systemController);
+	aMessage.Complete(err);
+	}
+
+/* Start the LBS system
+
+THIS FUNCTION SHOULD ONLY EVER BE USED FOR TEST PURPOSES.
+
+If LbsRoot is not running then this function will start it.
+If LbsRoot is already running then this function will request
+it to start the system.
+*/
+void CLbsTestSession::StartLbsSystem(const RMessage2& aMessage)
+	{
+	TProcessStartParams params;
+	_LIT(KLbsRootFileName, "\\sys\\bin\\lbsroot.exe");
+	_LIT(KLbsRootProcessName, "lbsroot.exe");
+	params.SetProcessFileName(KLbsRootFileName);
+	params.SetProcessName(KLbsRootProcessName);
+	params.SetRendezvousRequired(ETrue);
+	TInt err = CProcessLaunch::ProcessLaunch(params);
+
+	aMessage.Complete(err);
+	}
+
+/* Reset the internal state of the LBS system
+
+THIS FUNCTION SHOULD ONLY EVER BE USED FOR TEST PURPOSES.
+
+This function tells the LBS system to reset its internal state
+and caches. Currently this means that:
+- The assistance data cache between lbsnetgateway and lbsagpsmanager is cleared.
+*/
+void CLbsTestSession::ResetLbsSystem(const RMessage2& aMessage)
+	{
+	RLbsSystemController systemController;
+	
+	// Open the system controller interface
+	RProcess process;
+	systemController.OpenL(process.SecureId());
+	CleanupClosePushL(systemController);
+	
+	// request a reset of the LBS system
+	systemController.RequestSystemReset();
+	
+	CleanupStack::PopAndDestroy(&systemController);
+	aMessage.Complete(KErrNone);
+	}
+
+TBool CLbsTestSession::FindRootProcess(RProcess& aProcess)
+	{
+	_LIT(KLbsRootProcessName, "lbsroot.exe*");
+	TInt err(KErrNotFound);
+	TFullName fullName;			
+	TFindProcess processFinder(KLbsRootProcessName);
+	while (err = processFinder.Next(fullName), err == KErrNone)
+		{
+		RProcess process;
+		TInt processOpenErr = process.Open(processFinder);
+		if (processOpenErr == KErrNone)
+			{
+			TExitType exitType = process.ExitType();
+			if (exitType == EExitPending)
+				{
+				// Found a running instance of lbsroot.exe,
+				aProcess = process;
+				return ETrue;
+				}
+			}
+		process.Close();		
+		}
+		
+	return EFalse;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/src/messageutils.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,120 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "messageutils.h"
+
+_LIT(KServerMessageUtilsWrite16, "RMessageWrite16");
+_LIT(KServerMessageUtilsWrite8, "RMessageWrite8");
+_LIT(KServerMessageUtilsRead16, "RMessageRead16");
+_LIT(KServerMessageUtilsRead8, "RMessageRead8");
+
+/** 
+write data in buffer to message by index
+
+@param aMessage A reference to RMessage2 object
+@param aIndex Index of message object
+@param aBuf 16 bits data buffer to write to message object
+@return Symbian standard error code
+@internalTechnology
+@released
+ */
+TInt MessageUtils::Write(const RMessage2& aMessage, const TInt aIndex, const TDesC16& aBuf)
+	{
+	TInt err = aMessage.Write(aIndex, aBuf); // assume a zero offset in the client side buffer
+	if(err)
+		{
+		PanicClient(aMessage, KServerMessageUtilsWrite16, err);
+		}
+	// also return the error code so that a server can cleanup is required...
+	return err;
+	}
+	
+/** 
+write data in buffer to message by index
+
+@param aMessage A reference to RMessage2 object
+@param aIndex Index of message object
+@param aBuf 8 bits data buffer to write to message object
+@return Symbian standard error code
+@internalTechnology
+@released
+ */
+ TInt MessageUtils::Write(const RMessage2& aMessage, const TInt aIndex, const TDesC8& aBuf)
+	{
+	TInt err = aMessage.Write(aIndex, aBuf); // assume a zero offset in the client side buffer
+	if(err)
+		{
+		PanicClient(aMessage, KServerMessageUtilsWrite8, err);
+		}
+	// also return the error code so that a server can cleanup is required...
+	return err;
+	}
+
+/** 
+read data to buffer from message by index
+
+@param aMessage A reference to RMessage2 object
+@param aIndex Index of message object
+@param aBuf 16 bits data buffer to store data from message object
+@return Symbian standard error code
+@internalTechnology
+@released
+ */	
+TInt MessageUtils::Read(const RMessage2& aMessage, const TInt aIndex, TDes16& aBuf)
+	{
+	TInt err = aMessage.Read(aIndex, aBuf); // assume a zero offset in the buffer
+	if(err)
+		{
+		PanicClient(aMessage, KServerMessageUtilsRead16, err);
+		}
+	// also return the error code so that a server can cleanup is required...
+	return err;
+	}
+
+/** 
+read data to buffer from message by index
+
+@param aMessage A reference to RMessage2 object
+@param aIndex Index of message object
+@param aBuf 8 bits data buffer to store data from message object
+@return Symbian standard error code
+@internalTechnology
+@released
+ */	
+TInt MessageUtils::Read(const RMessage2& aMessage, const TInt aIndex, TDes8& aBuf)
+	{
+	TInt err = aMessage.Read(aIndex, aBuf); // assume a zero offset in the buffer
+	if(err)
+		{
+		PanicClient(aMessage, KServerMessageUtilsRead8, err);
+		}	
+	// also return the error code so that a server can cleanup is required...
+	return err;
+	}
+	
+/** 
+Complete the message by sending a panic to client
+
+@param aMessage A reference to RMessage2 object
+@param aCat Panic category
+@param aReason Reason to panic the client
+@internalTechnology
+@released
+ */	
+void MessageUtils::PanicClient(const RMessage2& aMessage, const TDesC& aCat, const TInt aReason)
+	{
+	aMessage.Panic(aCat, aReason); // will also complete the RMessage
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/src/rsecuresessionbase.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,96 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// rsecureasbase.cpp
+// 
+//
+
+#include <e32debug.h>
+#include "cserverlaunch.h"
+#include "rsecuresessionbase.h"
+#include "csecureasbase.h"
+#include "lbsmessageenums.h"
+#include "lbsdevloggermacros.h"
+
+/** Client side session object connects to the server by starting server with specified parameter
+keep trying to kick off the server!
+
+@param aParams A reference to TProcessStartParams object
+@return Symbian error code
+@see TProcessStartParams
+@internalTechnology
+@released
+ */
+TInt RSecureSessionBase::Connect(TServerStartParams& aParams)
+	{
+	// be very cunning :) This has to slot into the existing RPositionServer::Connect
+	// The parameter will have to morph into a local variable but that should be the only change
+	TInt ret;
+	
+	TInt retry = 2;
+	FOREVER
+		{ 
+		TVersion version = Version();
+
+		ret = CreateSession(aParams.GetServerName(), version, aParams.GetNumberOfServerSlots());
+
+		if (ret != KErrNotFound && ret != KErrServerTerminated)
+			{
+			break;
+			}
+
+		if (--retry == 0)
+			{
+			break;
+			}
+
+		ret = StartServer(aParams);
+
+		if (ret != KErrAlreadyExists && ret != KErrNone)
+			{
+			break;
+			}
+		}
+	return ret;
+	}
+	
+/** Client side session object close the session handler
+
+@internalTechnology
+@released
+ */
+void RSecureSessionBase::Close()	
+	{
+	LBSLOG(ELogP1, "RSecureSessionBase::Close");
+	RHandleBase::Close();
+	}
+
+/**
+*/
+TInt RSecureSessionBase::StartServer(TServerStartParams& aParams)
+	{
+	return (CServerLaunch::ServerLaunch(aParams));
+	}
+	
+
+//------------------------------------------------------------------------------	
+	
+/** Client side subsession object issue the subsession close request.
+
+@internalTechnology
+@released
+ */
+void RSecureSubSessionBase::Close()	
+	{
+	CloseSubSession(ESecureSubSessionBaseClose);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/src/tprocessstartparams.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,116 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// tprocessstartparams.h
+// 
+//
+
+#include "tprocessstartparams.h"
+#include <e32math.h>
+
+/** Initialise start process parameters
+@internalTechnology
+@released
+ */
+TProcessStartParams::TProcessStartParams() : iRendezvousRequired(EFalse)
+	{
+	SetType();
+	}
+	
+/** set the rendezous requirement
+
+@internalTechnology
+@released
+ */
+ void TProcessStartParams::SetRendezvousRequired(TBool aRendezvousRequired)
+	{
+	iRendezvousRequired = aRendezvousRequired;
+	}
+	
+/** Get the rendezous requirement
+
+@return TBool, Rendezvous property
+@internalTechnology
+@released
+ */
+ TBool TProcessStartParams::GetRendezvousRequired() const
+	{
+	return iRendezvousRequired;
+	}
+	
+/** set the process file name
+
+@param aExeName The process file name
+@internalTechnology
+@released
+ */
+ void TProcessStartParams::SetProcessFileName(const TDesC& aExeName)
+	{
+	iProcessFileName = aExeName;
+	}
+	
+/** Set the process name
+
+@param aProcessName The process name
+@internalTechnology
+@released
+ */
+ void TProcessStartParams::SetProcessName(const TDesC& aProcessName)
+	{
+	iProcessName = aProcessName;
+	}	
+
+/** Get the process file name
+
+@return The process file name
+@internalTechnology
+@released
+ */
+ const TDesC& TProcessStartParams::GetProcessFileName() const
+	{
+	return iProcessFileName;
+	}
+	
+/** Get the process name
+
+@return The process name
+@internalTechnology
+@released
+ */
+ const TDesC& TProcessStartParams::GetProcessName() const
+	{
+	return iProcessName;
+	}
+		
+/** Get the command line buffer
+
+@return The descriptor to the commandline buffer
+@internalTechnology
+@released
+ */
+ TPtrC TProcessStartParams::GetAsCommandLine() const
+	{
+	TPtrC p(reinterpret_cast<const TText*>(this), sizeof(TProcessStartParams)/sizeof(TText));
+	return p;
+	}
+	
+/** 
+Fix the type of these params to KProcessStartParamsTypeUid
+
+@internalTechnology
+@released
+ */
+void TProcessStartParams::SetType()
+	{
+	TStartParamsBase::SetType(KProcessStartParamsTypeUid);
+	}	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/src/tserverstartparams.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,143 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "tserverstartparams.h"
+#include "e32math.h"
+
+/** 
+Initailise Server start parameters with default message slots
+
+@internalTechnology
+@released
+ */
+TServerStartParams::TServerStartParams() : iNumberOfSlots(KServerFrameworkDefaultMessageSlots)
+	{
+	SetType();
+	}
+	
+/** 
+Set server file name
+
+@internalTechnology
+@released
+ */
+void TServerStartParams::SetServerFileName(const TDesC& aExeName)
+	{
+	iServerFileName = aExeName;
+	}
+	
+/** 
+Set server name
+
+@internalTechnology
+@released
+ */
+ void TServerStartParams::SetServerName(const TDesC& aServerName)
+	{
+	iServerName = aServerName;
+	}
+	
+/** 
+set number of message slots
+
+@internalTechnology
+@released
+ */
+ void TServerStartParams::SetNumberOfServerSlots(TInt aSlots)
+	{
+	iNumberOfSlots = aSlots;
+	}
+	
+/** 
+set server Uids
+
+@internalTechnology
+@released
+ */
+void TServerStartParams::SetServerUids(TUid aUid1, TUid aUid2, TUid aUid3)	
+	{
+	TUidType uid(aUid1, aUid2, aUid3);
+	iUids = uid;
+	}
+	
+/** 
+get server file name 
+
+@internalTechnology
+@released
+ */
+const TDesC& TServerStartParams::GetServerFileName()
+	{
+	return iServerFileName;
+	}
+	
+/** 
+get server name
+
+@internalTechnology
+@released
+ */
+const TDesC& TServerStartParams::GetServerName()
+	{
+	return iServerName;
+	}
+
+/** 
+get number of message slots
+
+@internalTechnology
+@released
+ */
+TInt TServerStartParams::GetNumberOfServerSlots()
+	{
+	return iNumberOfSlots;
+	}
+		
+/** 
+get server start commandline buffer
+
+@return descriptor to the commandline buffer
+@internalTechnology
+@released
+ */
+TPtrC TServerStartParams::GetAsCommandLine() const
+	{ 
+	TPtrC p(reinterpret_cast<const TText*>(this), sizeof(TServerStartParams)/sizeof(TText));
+	TInt l = p.Length();
+	return p;
+	}
+
+/** 
+get server uids 
+
+@internalTechnology
+@released
+ */
+TUidType& TServerStartParams::GetServerUids()
+	{
+	return iUids;
+	}
+
+
+/** 
+Fix the type of these params to KServerStartParamsTypeUid
+
+@internalTechnology
+@released
+ */
+void TServerStartParams::SetType()
+	{
+	TStartParamsBase::SetType(KServerStartParamsTypeUid);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/internal/lbstestserver/src/tstartparamsbase.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,40 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Definition of class used to define server start parameters 
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+*/
+
+#include "tstartparamsbase.h"
+
+TStartParamsBase::~TStartParamsBase()
+	{
+	// nothing to do - virtual placeholder
+	}
+
+const TUid	TStartParamsBase::GetType() const
+	{
+	return iType;
+	}
+	
+void TStartParamsBase::SetType(const TUid& aType)	
+	{
+	iType = aType;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/group/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,27 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is the build file for the LBS client Tests
+// 
+//
+
+#include "../lbsexeclient/group/bld.inf"
+
+PRJ_TESTEXPORTS
+../scripts/smoketest_lbs.script			z:/smoketest/smoketest_lbs.script
+../scripts/setup_smoketest_lbs.script	z:/smoketest/setup_smoketest_lbs.script
+
+../testdata/smoketest_lbs.ini			z:/smoketest/smoketest_lbs.ini
+
+PRJ_TESTMMPFILES
+ctlbsclientserver.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/group/ctlbsclientserver.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,71 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientserver.mmp
+// This is the make file for the LBS Client Tests
+// TODO: Ensure we update below:
+// CAPABILITY 		 ALL -TCB
+// CAPABILITY        WriteDeviceData ReadDeviceData
+// 
+//
+
+CAPABILITY WriteDeviceData ReadDeviceData Location
+
+TARGET		lbsclienttestserver.exe
+TARGETTYPE	exe
+UID			0x1000007A 0x10282258
+VENDORID 	0x70000001
+
+#include 	"../../common/group/ctlbscommon.mmp"
+
+USERINCLUDE		../inc
+//USERINCLUDE		../../lbsassdata/inc
+
+// Lbs Client framework code.
+SOURCEPATH	../src
+SOURCE		ctlbsclientserver.cpp
+SOURCE		ctlbsclientstep.cpp
+
+// Lbs Client test step code.
+SOURCE		ctlbsclientstepsrvconnectclose.cpp
+SOURCE		ctlbsclientstepnotifyposupdate.cpp
+SOURCE		ctlbsclientstepopenclose.cpp
+SOURCE		ctlbsclientstepsrvversion.cpp
+SOURCE		ctlbsclientstepmodselect.cpp
+SOURCE		ctlbsclientstepmodinfo.cpp
+SOURCE		ctlbsclientsteplastknownpos.cpp
+SOURCE		ctlbsclientstepmultireq.cpp
+SOURCE		ctlbsclientgetlkpao.cpp
+SOURCE		ctlbsclientnotifyposupdao.cpp
+SOURCE		ctlbsclientstepmodstatus.cpp
+SOURCE		ctlbsclientstepupdateoptions.cpp
+SOURCE      ctlbsclientstepassistance.cpp
+SOURCE		ctlbsclientstepcellbasednpud.cpp
+SOURCE 		ctlbsclientsteppartialupdate.cpp
+SOURCE		ctlbsclientsteptracking.cpp
+SOURCE		ctlbsclientstepignoreaccurracysetting.cpp
+SOURCE		ctlbsclientstepignoreaccurracysettingtracking.cpp
+SOURCE		ctlbsclientstep_reset_assistance.cpp
+
+// LBS libraries.
+LIBRARY	lbsselflocate.lib
+LIBRARY	lbsloccommon.lib
+LIBRARY	lbsadmin.lib
+LIBRARY lbslocdatasource.lib
+LIBRARY lbsnetprotocol.lib
+LIBRARY lbsassistancedata.lib
+
+// LBS test libraries.
+LIBRARY lbstestutils.lib
+LIBRARY lbsnetsim.lib
+LIBRARY	lbstestclient.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclienteventtimer.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_EVENT_TIMER_H__ 
+#define __CT_LBS_CLIENT_EVENT_TIMER_H__
+
+//  INCLUDES
+#include <e32base.h>
+#include <testexecutelogger.h>
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class MCT_LbsRequestObserver;
+
+// CLASS DECLARATION
+
+/**
+*  This class is used to time the notification dialog
+*
+*/
+class CT_LbsClientEventTimer : public CActive
+    {
+    private:  // Constructors
+
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientEventTimer();
+
+        /**
+        * By default EPOC constructor is private.
+        */
+		void ConstructL(CTestExecuteLogger& aLogger);
+
+        // By default, prohibit copy constructor
+        CT_LbsClientEventTimer( const CT_LbsClientEventTimer& );
+        // Prohibit assigment operator
+        CT_LbsClientEventTimer& operator= ( const CT_LbsClientEventTimer& );
+        // Logger interface used for constructing result strings to be fed for the logger instance
+        inline CTestExecuteLogger& Logger() {return iLogger;};
+
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+		static CT_LbsClientEventTimer* NewL(CTestExecuteLogger& aLogger);
+
+        /**
+        * Two-phased constructor.
+        */
+		static CT_LbsClientEventTimer* NewLC(CTestExecuteLogger& aLogger);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientEventTimer();
+
+	public: // New functions
+
+		/**
+        * Start the timer
+        */
+		void Start(TInt aTimeout);
+
+		TInt CompletionCode() const;
+
+		void ResetCompletionCode();
+
+        /**
+        * Set who is observing timeouts
+        * @param aObserver the observing object
+        */
+		void SetObserver(
+        /* IN  */       MCT_LbsRequestObserver* aObserver
+        );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From CActive
+        */
+		void RunL();
+
+        /**
+        * From CActive
+        */
+		TInt RunError(TInt aError);
+
+		/**
+        * From CActive
+        */
+		void DoCancel();
+
+    protected: // New functions
+
+        void RequestComplete();
+
+	private: // Data
+		RTimer				iTimer;
+		MCT_LbsRequestObserver*	iObserver;
+		TInt                iCompletionCode;
+        
+        CTestExecuteLogger	iLogger;
+    };
+
+#endif      // __CT_LBS_CLIENT_EVENT_TIMER_H__   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientgetlkpao.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,69 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* This contains the header file for Get last known position 
+* 
+*
+*/
+
+
+
+
+
+/**
+ @file ctlbsclientgetlastknownposao.h
+*/
+#if (!defined __CT_LBS_CLIENT_LAST_KNOWN_POS_AO_H__)
+#define __CT_LBS_CLIENT_LAST_KNOWN_POS_AO_H__
+
+#include <e32base.h>
+#include <lbs.h>
+
+class MT_GetLastKnownPosObserver
+	{
+	public:
+	virtual void GetLastKnownPositionCallback(TRequestStatus& aStatus) = 0;	
+	};
+
+
+class CT_LbsClientGetLastKnownPosAO: public CActive
+	{
+public:
+	~CT_LbsClientGetLastKnownPosAO();
+	static CT_LbsClientGetLastKnownPosAO* NewL(MT_GetLastKnownPosObserver& aUser);
+	// wrapper for async positioner function GetLastKnownPosition()
+	void GetLastKnownPosL(RPositioner& aPositioner, TPositionInfo& aPosInfo);
+	
+protected:
+//	CActive:
+	// Redeclares the base class CActive::DoCancel(). 
+	virtual void DoCancel();
+	// Redeclares the base class CActive::RunL(). 
+	virtual void RunL();
+	// Redeclares the base class CActive::RunError(). 
+	virtual TInt RunError(TInt aError);
+	
+private:
+	// our status, so we know when request completes:
+	// positioner currently in use:
+	RPositioner iPositioner;
+	// type of request outstanding:
+	TInt		iRequestId;
+	// caller
+	MT_GetLastKnownPosObserver& iCaller;
+	
+	CT_LbsClientGetLastKnownPosAO(MT_GetLastKnownPosObserver& aCaller);
+	};
+
+#endif // _CT_LBS_CLIENT_LAST_KNOWN_POS_AO_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientnotifyposupdao.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,72 @@
+/**
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file ctlbsclientnotifyposupdao.h
+*/
+#if (!defined __CT_LBS_CLIENT_NOTIFY_POS_UPD_AO_H__)
+#define __CT_LBS_CLIENT_NOTIFY_POS_UPD_AO_H__
+
+#include <e32base.h>
+#include <lbs.h>
+
+
+class MT_NotifyPosUpdateObserver
+	{
+	public:
+	virtual void NotifyPositionUpdateCallback(TRequestStatus& aStatus) = 0;	
+	};
+
+
+class CT_LbsClientNotifyPosUpdAO: public CActive
+	{
+public:
+	// destructor
+	~CT_LbsClientNotifyPosUpdAO();
+
+	// constructor
+	static CT_LbsClientNotifyPosUpdAO* NewL(MT_NotifyPosUpdateObserver& aCaller);
+
+	// wrapper for async positioner function NotifyPositionUpdate()
+	void CT_LbsClientNotifyPosUpdAO::NotifyPosUpdateL(RPositioner& aPositioner, TPositionInfo& aPosInfo);
+	
+protected:
+//	CActive:
+	// Redeclares the base class CActive::DoCancel(). 
+	virtual void DoCancel();
+	// Redeclares the base class CActive::RunL(). 
+	virtual void RunL();
+	// Redeclares the base class CActive::RunError(). 
+	virtual TInt RunError(TInt aError);
+	
+private:
+	// our status, so we know when request completes:
+	// positioner currently in use:
+	RPositioner iPositioner;
+	// type of request outstanding:
+	TInt		iRequestId;
+	// caller
+	MT_NotifyPosUpdateObserver& iCaller;
+		
+	CT_LbsClientNotifyPosUpdAO(MT_NotifyPosUpdateObserver& aCaller);
+	};
+
+#endif // __CT_LBS_CLIENT_NOTIFY_POS_UPD_AO_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientobserver.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_OBSERVER_H__ 
+#define __CT_LBS_CLIENT_OBSERVER_H__
+
+//  INCLUDES
+#include <e32base.h>
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  ?one_line_short_description.
+*  ?other_description_lines
+*/
+class CT_LbsClientObserver : public CBase
+    {
+    public:  // New functions
+        
+        /**
+        * Waits for EPos server to shut down. If it is
+        * not running this method will return instantaneously.
+        */
+        static void WaitForEPosShutdown();
+        
+        /**
+        * Pushes WaitForEPosShutdown to the cleanup stack. It is useful when
+        * other cleanup items are dependent on EPos having released all its
+        * resources
+        */
+        static void EPosShutdownWaitPushL();
+        
+        /**
+        * Checks if EPos server is alive.
+        */
+        static TBool EPosAliveL();
+
+        /**
+        * Waits for privacy server to shut down. If it is
+        * not running this method will return instantaneously.
+        */
+        static void WaitForPrivacyServerShutdown();
+        
+        /**
+        * Pushes WaitForPrivacyServerShutdown to the cleanup stack. It is useful
+        * when other cleanup items are dependent on EPos having released all its
+        * resources
+        */
+        static void PrivacyServerShutdownWaitPushL();
+        
+        /**
+        * Checks if privacy server is alive.
+        */
+        static TBool PrivacyServerAliveL();
+
+    private: // New functions
+
+        /**
+        * Waits for a process to die. If the process is
+        * not running this method will return instantaneously.
+        * @param aProcessName The name of the process.
+        */
+        static void WaitForProcessDeath(
+        /* IN  */       const TDesC& aProcessName
+        );
+        
+        /**
+        * Checks if a process is alive.
+        * @param aProcessName The name of the process.
+        */
+        static TBool ProcessAliveL(
+        /* IN  */       const TDesC& aProcessName
+        );
+        
+    };
+
+#endif      // __CT_LBS_CLIENT_OBSERVER_H__  
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientperiodictester.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,253 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_PERIODIC_TESTER_H__
+#define __CT_LBS_CLIENT_PERIODIC_TESTER_H__
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+
+#include "Lbs.h"
+
+// CONSTANTS
+
+#ifdef __WINS__
+const TInt KToleratedEarliness  = 400000; //0.4 s
+#endif
+
+const TInt KTracePeriod = 10;
+
+// FORWARD DECLARATIONS
+class CT_LbsClientLog;
+
+// CLASS DECLARATION
+
+/**
+*  Helper class for periodic update tests
+*
+*/
+class CT_LbsClientPeriodicTester : public CActive
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CT_LbsClientPeriodicTester* NewL(
+		/* IN */	TTimeIntervalMicroSeconds aInterval, 
+		/* IN */	const TDesC& aSericeName,
+		/* IN */	CT_LbsClientLog* aLog,
+		/* IN */	TUid aUid, 
+		/* IN */	TInt aNumberOfRuns
+		);
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CT_LbsClientPeriodicTester();
+
+    public: // New functions
+        
+        /**
+        * Requests notification from positioner and set the active flag true.
+        */
+		void RequestNotification();
+
+		/**
+		* Changes current test parameters. Can only be called when previous test is completed
+		*/
+		void ChangeTestParametersL(
+		/* IN */	TTimeIntervalMicroSeconds aInterval, 
+		/* IN */	TInt aNumberOfRuns
+		);
+
+		/**
+		* Changes name in requestor information.
+		*/
+		void ChangeRequestorInformation(
+		/* IN */	const TDesC& aServiceName
+		);
+
+		/**
+		* Closes the positioner
+		*/
+		void ClosePositioner();
+
+		/**
+		* Opens the positioner
+		*/
+		void OpenPositionerL(
+		/* IN */	const TDesC& aServiceName
+		);
+
+		/**
+		* Sets the maxage parameter in position update options
+		*/
+		void SetMaxAgeL(
+		/* IN */	TTimeIntervalMicroSeconds aInterval
+		);
+		
+		/**
+		* Sets the partial update parameter in position update options
+		*/
+		void SetPartialUpdateL(
+		/* IN */	TBool aUpdateOption
+		);
+	
+		/**
+		* Sets the timeout parameter in position update options
+		*/
+		void SetTimeOutL(
+		/* IN */	TTimeIntervalMicroSeconds aInterval
+		);
+
+		/**
+		* Changes the update interval before the previous interval has completed one time
+		*/
+		void SetChangeParametersPrematurely(
+		/* IN */	TBool aCondition
+		);
+
+        /**
+		* A way to determine if any error has happened.
+		*/
+		TBool IsCompletedOK();
+
+        /**
+		* Get errorcode if error has occurred.
+		*/
+		TInt GetError();
+
+		/**
+		* Cancels periodic requests from EPos Server
+		*/
+		void CancelRequest();
+
+        /**
+		* Returns the position from the latest notift position request
+		*/
+		void GetPosition(TPositionInfo& aPosInfo);
+
+
+    public: // Functions from CActive
+
+        /**
+        * From CActive Service completed request.
+		* Defined as pure virtual by CActive;
+		* implementation provided by this class,
+        */
+        void RunL();
+
+        /**
+        * From CActive Cancel request.
+		* Defined as pure virtual by CActive;
+		* implementation provided by this class.
+        */
+        TInt RunError(TInt aError);
+
+		/**
+        * From CActive Cancel request.
+		* Defined as pure virtual by CActive;
+		* implementation provided by this class.
+        */
+		void DoCancel();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+    	CT_LbsClientPeriodicTester();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL(
+		/* IN */	TTimeIntervalMicroSeconds aInterval, 
+		/* IN */	const TDesC& aServiceName,
+		/* IN */	CT_LbsClientLog* aLog,
+		/* IN */	TUid aUid, 
+		/* IN */	TInt aNumberOfRuns
+		);
+
+		/**
+        * Evaluates condition, logs and leaves if false.
+        */
+		void AssertTrueL(
+		/* IN */	TBool aCondition, 
+		/* IN */	const TDesC& aErrorMsg,
+		/* IN */	TInt aErrorCode
+		);
+ 
+
+    private:    // Data
+        // EPos server instance
+		RPositionServer	iPosServer;
+        
+		// Positioner instance
+		RPositioner iPositioner;
+		
+		// Position information to be sent with NotifyPositionUpdate
+		TPositionInfo iPositionInfo;
+		
+		// Number of periodic updates to request
+		TInt iNumberOfUpdates;
+		
+		// Number of periodic updates received
+		TInt iNumberOfRuns;
+		
+		// Tells if the test is going to end prematurely with a chage of update interval
+		TBool iPrematureChangeOfParameters;
+
+		// Tells if the outstanding request is going to be canceled
+		TBool iCancelRequest;
+
+        // Tells if the outstanding request has been canceled
+        TBool iCanceledRequest; 
+        
+        // Tells if to write messages to log
+        TBool iWriteToLog;
+		
+		// The time for when the most recent position update was received
+		TTime iRecentTime;
+		
+		// The interval to request position updates between
+		TTimeIntervalMicroSeconds iInterval;
+		
+		// Test log
+		CT_LbsClientLog* iLog;
+		
+		// The name of the positioner
+		TBuf<100> iName;
+		
+		// The uid of the positioner
+		TUid iUid;
+
+        //Error indication
+        TBool iError;
+        
+        //Error indication
+        TInt iErrorCode;
+
+    };
+
+#endif      // __CT_LBS_CLIENT_PERIODIC_TESTER_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientportedsuiteserver.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,91 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// ctlbsclientportedserver.h
+// Test server for ported client tests
+// 
+//
+
+#ifndef __CT_LBS_CLIENT_PORTED_SERVER_H__
+#define __CT_LBS_CLIENT_PORTED_SERVER_H__
+
+#include <TestExecuteServerBase.h>
+
+#include "ctlbsserver.h"
+
+// CONSTANTS
+_LIT(KTestProcedure1, "TP1");
+_LIT(KTestProcedure2, "TP2");
+_LIT(KTestProcedure11, "TP11");
+_LIT(KTestProcedure17, "TP17");
+_LIT(KTestProcedure21, "TP21");
+_LIT(KTestProcedure22, "TP22");
+_LIT(KTestProcedure25, "TP25");
+_LIT(KTestProcedure27, "TP27");
+_LIT(KTestProcedure76, "TP76");
+_LIT(KTestProcedure93, "TP93");
+_LIT(KTestProcedure169, "TP169");
+_LIT(KTestProcedure173, "TP173");
+_LIT(KTestProcedure176, "TP176");
+_LIT(KTestProcedure178, "TP178");
+_LIT(KTestProcedure179, "TP179");
+_LIT(KTestProcedure188, "TP188");
+_LIT(KTestProcedure189, "TP189");
+_LIT(KTestProcedure193, "TP193");
+_LIT(KTestProcedure194, "TP194");
+_LIT(KTestProcedure195, "TP195");
+_LIT(KTestProcedure201, "TP201");
+_LIT(KTestProcedure203, "TP203");
+_LIT(KTestProcedure204, "TP204");
+_LIT(KTestProcedure208, "TP208");
+_LIT(KTestProcedure213, "TP213");
+_LIT(KTestProcedure217, "TP217");
+_LIT(KTestProcedure218, "TP218");
+_LIT(KTestProcedure222, "TP222");
+_LIT(KTestProcedure223, "TP223");
+_LIT(KTestProcedure224, "TP224");
+_LIT(KTestProcedure227, "TP227");
+_LIT(KTestProcedure254, "TP254");
+_LIT(KTestProcedure256, "TP256");
+_LIT(KTestProcedure257, "TP257");
+_LIT(KTestProcedure259, "TP259");
+_LIT(KTestProcedure261, "TP261");
+_LIT(KTestProcedure269, "TP269");
+_LIT(KTestProcedure271, "TP271");
+_LIT(KTestProcedure272, "TP272");
+_LIT(KTestProcedure274, "TP274");
+_LIT(KTestProcedure275, "TP275");
+_LIT(KTestProcedure4701, "TP4701");
+_LIT(KTestProcedure4702, "TP4702");
+_LIT(KTestProcedure4703, "TP4703");
+_LIT(KTestProcedure4704, "TP4704");
+_LIT(KTestProcedure4705, "TP4705");
+_LIT(KTestProcedure4706, "TP4706");
+_LIT(KTestProcedure4707, "TP4707");
+_LIT(KTestProcedure4708, "TP4708");
+_LIT(KTestProcedure4709, "TP4709");
+_LIT(KTestProcedure4722, "TP4722");
+_LIT(KTestProcedure4723, "TP4723");
+
+class CT_LbsClientPortedSuite : public CT_LbsServer
+	{
+public:
+	static CT_LbsClientPortedSuite* NewL();
+	// Base class pure virtual override
+	virtual CTestStep* CreateTestStep(const TDesC& aStepName);
+
+// Please Add/modify your class members
+private:
+	};
+
+#endif // __CT_LBS_CLIENT_PORTED_SERVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpositionconstants.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POSITION_CONSTANTS_H__ 
+#define __CT_LBS_CLIENT_POSITION_CONSTANTS_H__
+
+
+// CONSTANTS
+const TReal32 KHorizontalAcc = 40;
+const TReal32 KVerticalAcc = 40;
+
+const TReal64 KLatitude = 2;
+const TReal64 KLongitude = 3;
+const TReal32 KAltitude = 200;
+
+_LIT(KPositionTime, "20801027:161600");//YYYYMMDD:HHMMSS.MMMMMM
+
+const TReal32 KSpeed = 20;
+const TReal32 KHeading = 30;
+const TReal32 KSpeedAcc = 2;
+const TReal32 KHeadingAcc = 3;
+
+const TInt KSatelliteId = 30;
+const TReal32 KAzimuth = 30;
+const TReal32 KElevation = 30;
+const TBool KIsUsed = ETrue;
+const TInt KSignalStrength = 10;
+
+const TReal32 KAzimuthOdd = 35;
+const TReal32 KElevationOdd = 35;
+const TBool KIsUsedOdd = EFalse;
+const TInt KSignalStrengthOdd = 5;
+
+const TUint KNumberOfSatellitesInView = 12;
+const TUint KNumberOfSatellitesUsed = 6;
+_LIT(KSatelliteTime, "20021027:161600");
+const TReal32 KHorizontalDoPValue = 1;
+const TReal32 KVerticalDoPValue = 2;
+const TReal32 KTimeDoPValue = 20;  
+
+_LIT(KModuleName, "Multi PSY");
+
+
+#endif      // __CT_LBS_CLIENT_POSITION_CONSTANTS_H__   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp1.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP1_H__
+#define __CT_LBS_CLIENT_POS_TP1_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+*  Test procedure 1
+*
+*/
+class CT_LbsClientPosTp1 :public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+    	CT_LbsClientPosTp1(CT_LbsServer& aParent);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp1();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Deinitializes the test.
+        */
+        void CloseTest();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+	private: // New functions
+
+        /**
+        * Leaves if aCondition is false.
+        * @param aCondition something that should be true
+        */
+		void AssertTrueL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode);
+
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP1_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp11.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP11_H__
+#define __CT_LBS_CLIENT_POS_TP11_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 11
+*/
+class CT_LbsClientPosTp11 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp11(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp11();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+    private:    // New functions
+
+        /**
+        * Checks that EPos is alive, or that it is not alive
+        */
+        void CheckEPosActivityL(
+            TBool aExpectEPosLiveness
+            );
+
+        /**
+        * Checks if the server with name aServerName is alive
+        */
+        TBool ServerAliveL(const TDesC& aServerName);
+        
+        TFileName SearchAndReturnCompleteFileName(const TDesC& aFileName);
+
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP11_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp169.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP169_H__
+#define __CT_LBS_CLIENT_POS_TP169_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 169
+*
+*/
+class CT_LbsClientPosTp169 :public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp169(CT_LbsServer& aParent);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp169();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+	private: // New functions
+
+        /**
+        * Leaves if aCondition is false.
+        * @param aCondition something that should be true
+        */
+        void AssertTrueL(TBool aCondition, const TDesC& errorMsg);
+
+		/**
+        * Leaves if aCondition is false.
+        * @param aCondition something that should be true
+        */
+		void AssertTrueSecL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode);
+
+        /**
+		* This testpart tests error report "ESLI-5W9D7M Poison4 - Sort order after full reset"
+		* verifies that the Horizontal/Vertical accuracy 0 value is returned as NaN when reading
+		* the value from the modulesdb, uses the panic psy which has values 0 for
+		* horizontal and vertical accuracy
+		*/
+		void TestNaNFromPSY();
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP169_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp17.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP17_H__
+#define __CT_LBS_CLIENT_POS_TP17_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 17
+*
+*/
+class CT_LbsClientPosTp17 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+    	CT_LbsClientPosTp17(CT_LbsServer& aParent);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp17();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+	private: // New functions
+  
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP17_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp173.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP173_H__
+#define __CT_LBS_CLIENT_POS_TP173_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+#include "EPos_MPosModulesObserver.h" 
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 173
+*
+*/
+class CT_LbsClientPosTp173 : public CT_LbsPortedStepBase, public MPosModulesObserver
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+    	CT_LbsClientPosTp173(CT_LbsServer& aParent);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp173();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+    public: // New Functions
+    
+        /**
+		* Timeout request if the no notification has been sent
+		* by the server.
+		*/
+		void NotifyTimeout();
+
+        void HandleSettingsChangeL(TPosModulesEvent);
+
+        /**
+        * Leaves if aCondition is false.
+        * @param aCondition something that should be true
+        */
+        void AssertTrueL(TBool aCondition, const TDesC& errorMsg);
+
+		/**
+        * Leaves if aCondition is false.
+        * @param aCondition something that should be true
+        */
+		void AssertTrueSecL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode);
+
+        void CheckErrorL();
+
+        void DoEventHandlingL();
+        
+     protected:
+
+        TBool iNoEvents;
+        TBool iError;
+        TBuf<200> iErrorText;
+     
+     private: 
+
+        TInt iEvent;   
+        
+    };
+
+//// CLASS DECLARATION
+
+/**
+ *
+ */
+class CMyNotificationTimer : public CTimer 
+	{
+	public:
+	
+		/**
+        * Destructor.
+        */
+		virtual ~CMyNotificationTimer();
+
+	public:
+
+		/**
+        * Two-phased constructor.
+        */
+		static CMyNotificationTimer* NewLC(CT_LbsClientPosTp173* aMainControl);
+
+		/**
+        * Two-phased constructor.
+        */
+		static CMyNotificationTimer* NewL(CT_LbsClientPosTp173* aMainControl);
+
+	public:
+
+		/**
+		* Starts the power checking timer
+		*/
+		void StartNotificationTimer(); 
+
+		/** 
+		* Cancel the power checking timer.
+		*/
+		void DoCancel();
+
+	private:
+
+		/**
+        * EPOC constructor.
+        */
+		void ConstructL();
+
+		/**
+        * C++ default constructor.
+        */
+		CMyNotificationTimer(CT_LbsClientPosTp173* aMainControl);
+
+        /**
+        * From CActive. Handles an active object’s request completion
+        * event.
+        */
+        void RunL();
+
+		//Prohibit copy constructor
+        CMyNotificationTimer( const CMyNotificationTimer& );
+        // Prohibit assigment operator
+        CMyNotificationTimer& operator= ( const CMyNotificationTimer& );
+
+	private:
+		// a handler to the communicator
+		CT_LbsClientPosTp173*	iMainControl;
+		TInt		iNotificationTimout;
+	};
+
+#endif      // __CT_LBS_CLIENT_POS_TP173_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp176.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP176_H__
+#define __CT_LBS_CLIENT_POS_TP176_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 176
+*
+*/
+class CT_LbsClientPosTp176 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+    	CT_LbsClientPosTp176(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp176();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Called after the tests
+        */
+        void CloseTest();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Called after the tests
+        */
+        void InitTestL();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+
+    private: 
+       
+        TBool IsQualityUpdatedL(TUid aUid);
+
+    private:    // Data
+        TPositionQuality iQuality;
+        TPositionQuality iQualityTestPsy1;
+
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP176_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp178.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP178_H__
+#define __CT_LBS_CLIENT_POS_TP178_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 178
+*
+*/
+class CT_LbsClientPosTp178 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp178(CT_LbsServer& aParent);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp178();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Always called after the test, even if the test leaves
+        */
+        void CloseTest();
+
+	private: // New functions
+
+        /**
+        * Test that the positioner does a timeout 
+        * after the set update interval and that the request is not logged 
+        * in the request log
+        */
+        void TestTimeoutL();
+
+        /**
+        * Test that it is possible to cancel
+        * an outstanding request, and that the request is not logged 
+        * in the request log
+        */
+        void TestCancelL();
+
+        void TestOptionL();
+
+	private:
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP178_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp179.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP179_H__
+#define __CT_LBS_CLIENT_POS_TP179_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CONSTANTS
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 179
+*
+*/
+class CT_LbsClientPosTp179 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+    	CT_LbsClientPosTp179(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp179();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Called after the tests
+        */
+        void CloseTest();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP179_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp188.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP188_H__
+#define __CT_LBS_CLIENT_POS_TP188_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CONSTANTS
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 188
+*
+*/
+class CT_LbsClientPosTp188 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp188(CT_LbsServer& aParent);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp188();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+	private: // New functions
+
+		/**
+		* Prints the current Module status to log and compare it
+        * to iModuleStatus
+        *
+		* @param aStatus The current status reported to write to log
+		*/
+		void CheckModuleStatusL(
+		/* IN */ const TPositionModuleStatus& aStatus
+		);
+
+    private:
+        TPositionModuleStatus iModuleStatus;
+
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP188_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp189.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP189_H__
+#define __CT_LBS_CLIENT_POS_TP189_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CONSTANTS
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 189
+*
+*/
+class CT_LbsClientPosTp189 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp189(CT_LbsServer& aParent);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp189();
+	
+	public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+	private: // New functions
+		
+		/**
+		* Prints the current Module status to log
+		* @param aStatus The current status reported to write to log
+		*/
+		void CheckModuleStatusL(
+		/* IN */ const TPositionModuleStatus& aStatus,
+        /* IN */ const TBool aCheckStatus = EFalse
+		);
+		
+		/**
+		* Requests to be notified about certain events, wait for that event
+		* and log the event
+		* @param aEventToListenFor The event to listen for (EEventDataQualityStatus/EEventDeviceStatus)
+		*/
+		void RequestWaitAndLogEventL(
+		/* IN */ const TInt aEventToListenFor
+		);
+
+	private: // Data
+	
+		RPositioner				iPositioner2;
+        TPositionModuleStatus   iExpectedStatus;
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP189_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp193.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP193_H__
+#define __CT_LBS_CLIENT_POS_TP193_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 193
+*
+*/
+class CT_LbsClientPosTp193 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp193(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp193();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Called after the tests
+        */
+        void CloseTest();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP193_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp194.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP194_H__
+#define __CT_LBS_CLIENT_POS_TP194_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// FORWARD DECLARATION
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 194
+*
+*/
+class CT_LbsClientPosTp194 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp194(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp194();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        */
+        void StartL();
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP194_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp195.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP195_H__
+#define __CT_LBS_CLIENT_POS_TP195_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// FORWARD DECLARATION
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 195
+*
+*/
+class CT_LbsClientPosTp195 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+    	CT_LbsClientPosTp195(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp195();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        */
+        void StartL();
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP195_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp2.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP2_H__
+#define __CT_LBS_CLIENT_POS_TP2_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// FORWARD DECLARATIONS
+class TPositionSatelliteInfo;
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 2
+*
+*/
+class CT_LbsClientPosTp2 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+    	CT_LbsClientPosTp2(CT_LbsServer& aParent);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp2();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+	private: // New functions
+
+        /**
+        * Leaves if aCondition is false.
+        * @param aCondition something that should be true
+        */
+        void AssertTrueL(TBool aCondition, const TDesC& aErrorMsg);
+
+		void RequestL(TPositionInfoBase& aInfoBase);
+
+		void CheckPositionL(TPosition& aPosition);
+
+		void CheckPositionInfoL(TPositionInfo& aInfo);
+		void CheckPositionCourseInfoL(TPositionCourseInfo& aInfo);
+		void CheckPositionSatelliteInfoL(TPositionSatelliteInfo& aInfo);
+		void CheckGenericInfoL(HPositionGenericInfo& aInfo);
+
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP2_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp201.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP201_H__
+#define __CT_LBS_CLIENT_POS_TP201_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// FORWARD DECLARATION
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 201
+*
+*/
+class CT_LbsClientPosTp201 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp201(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp201();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        */
+        void StartL();
+
+    private:
+        void CheckRequestResultL(TInt aExpectedErrorCode, TRequestStatus& aStatus);
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP201_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp203.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP203_H__ 
+#define __CT_LBS_CLIENT_POS_TP203_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+#include "mctlbsrequestobserver.h"
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 203
+*
+*/
+class CT_LbsClientPosTp203 : public CT_LbsPortedStepBase, public MCT_LbsRequestObserver
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp203(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp203();
+
+    public: // Functions from base classes
+
+        static TInt DisablePsyL(TAny* aSelf);
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Deinitializes the test.
+        */
+        void CloseTest();
+
+        /**
+        * From CT_LbsPortedStepBase
+        */
+        void StartL();
+
+        /**
+        * From MCT_LbsRequestObserver
+        * Called when a CRequester request has completed.
+        */
+        void RequestCompleteL();
+
+    private: // Data
+    
+        CPeriodic* iPeriodicTimer;
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP203_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp204.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP204_H__ 
+#define __CT_LBS_CLIENT_POS_TP204_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+#include "mctlbsrequestobserver.h"
+
+// FORWARD DECLARATIONS
+class CBaBackupSessionWrapper;
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 204
+*
+*/
+class CT_LbsClientPosTp204 : public CT_LbsPortedStepBase, public MCT_LbsRequestObserver
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp204(CT_LbsServer& aParent);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp204();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+        
+        /**
+         * From MCT_LbsRequestObserver
+         * Called when a CT_LbsRequester request has completed.
+         */
+        void RequestCompleteL();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Called after the tests
+        */
+        void CloseTest();
+
+	private: // New functions
+        
+    private:
+        RPositionServer         iPosServer1;
+        RPositioner             iPositioner1;
+        CPeriodic*              iPeriodicTimer;
+        CBaBackupSessionWrapper*    iBackupWrapper;
+        TInt            		iCompletedRequests;
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP204_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp208.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP208_H__ 
+#define __CT_LBS_CLIENT_POS_TP208_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 208
+*
+*/
+class CT_LbsClientPosTp208 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp208(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp208();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Called after the tests
+        */
+        void CloseTest();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+    protected: // New functions
+
+        /**
+        * 
+        * Starts  nr of threads all connecting to the
+        * Epos server. If aFullTest also does 
+        * a number of position requests
+        */
+        TInt StartThreads(TBool aFullTest);
+
+        /**
+        *Fast connection only connects to epos no
+        *tracing no nothing. Verification of EJSH-5WJG82
+        */
+        TInt DoFastConnectionL();
+        
+    private:
+    
+    	TInt iThreadCount;  
+
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP208_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp21.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP21_H__
+#define __CT_LBS_CLIENT_POS_TP21_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 21
+*
+*/
+class CT_LbsClientPosTp21 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+    	CT_LbsClientPosTp21(CT_LbsServer& aParent);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp21();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Called after the tests
+        */
+        void CloseTest();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+    private:
+
+        /**
+        * Setup privacy and notification override settings
+        * @param aPsyUid    the uid of the psy
+        * @param aDirective how to setup the PSY:s
+        *                   Enum def in this file.
+        */
+        void SetupPsyL(const TUid aPsyUid,
+                       TBool aChoice);
+
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP21_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp213.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP213_H__
+#define __CT_LBS_CLIENT_POS_TP213_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+#include "mctlbsrequestobserver.h"
+
+// CONSTANTS
+
+// FORWARD DECLARATION
+class CT_LbsClientRequestor;
+class CT_LbsClientEventTimer;
+class CPosModules;
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 213
+*
+*/
+class CT_LbsClientPosTp213 : public CT_LbsPortedStepBase, public MCT_LbsRequestObserver
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp213(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp213();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        */
+        void StartL();
+
+		/**
+        * From CT_LbsPortedStepBase
+        * Called after the tests
+        */
+        void CloseTest();
+
+		/**
+        * From MCT_LbsRequestObserver
+        * Called when a CRequester request has completed.
+        */
+        void RequestCompleteL();
+			
+    private:
+
+		void EnablePsyL(
+			CPosModules&   aDb,
+			TUid             aPsy);
+			
+
+		void DisablePsyL(
+			CPosModules&   aDb,
+			TUid             aPsy);
+		
+    private:
+
+        void CheckRequestResultL(TInt aExpectedErrorCode, TRequestStatus& aStatus);
+
+        CT_LbsClientRequestor*       iclient1;
+		CT_LbsClientRequestor*       iclient2;
+		CT_LbsClientRequestor*       iclient3;
+		CT_LbsClientEventTimer*		    ieventtimer;
+		TInt					iCompletedRequests;
+		TBool					iNoFurtherEvents;
+		TBool					iErrorDuringExecution;
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP213_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp217.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP217_H__
+#define __CT_LBS_CLIENT_POS_TP217_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 217
+*
+*/
+class CT_LbsClientPosTp217 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp217(CT_LbsServer& aParent);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp217();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Deinitializes the test.
+        */
+        void CloseTest();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+	private: // New functions
+
+        /**
+        * Leaves if aCondition is false.
+        * @param aCondition something that should be true
+        */
+		void AssertTrueL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode);
+
+        /**
+        * Compares two TPositionInfoBase objects
+        * @return returns true if equal, otherwise false
+        */
+        TBool ComparePositionL(TPositionInfo aPosInfo1, TPositionInfo aPosInfo2);
+
+        /**
+        * Test that it is not possible to set erroneous maxage and updateInterval values
+        */
+        void ExtendedTesting1();
+
+        /**
+        * Check that it is possible to change MaxAge
+        * when the positioner already has a value
+        */
+        void ExtendedTesting2();
+    
+    private:
+    
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP217_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp218.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP218_H__
+#define __CT_LBS_CLIENT_POS_TP218_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 218
+*
+*/
+class CT_LbsClientPosTp218 :public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp218(CT_LbsServer& aParent);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp218();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Deinitializes the test.
+        */
+        void CloseTest();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+	private: // New functions
+
+        /**
+        * Leaves if aCondition is false.
+        * @param aCondition something that should be true
+        */
+		void AssertTrueL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode);
+
+        /**
+        * Compares two TPositionInfoBase objects
+        * @return returns true if equal, otherwise false
+        */
+        TBool ComparePositionL(TPositionInfo aPosInfo1, TPositionInfo aPosInfo2);
+
+        /*
+        * Setup the choosen default Psy
+        */
+        void SetupDefaultPsyL(const TUid aPsyUid);
+    
+    private:
+
+        RPositioner iPositioner1;
+        RPositioner iPositioner2;
+
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP218_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp22.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP22_H__
+#define __CT_LBS_CLIENT_POS_TP22_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// FORWARD DECLARATION
+class CT_LbsClientPeriodicTester;
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 22
+*
+*/
+class CT_LbsClientPosTp22 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+    	CT_LbsClientPosTp22(CT_LbsServer& aParent);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp22();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+		/**
+        * From CT_LbsPortedStepBase
+        * Called at close down of test
+        */
+		void CloseTest();
+	
+	private: // Data
+		RArray<TInt> iRequestArray;
+		CT_LbsClientPeriodicTester* iPeriodicTester1;
+		CT_LbsClientPeriodicTester* iPeriodicTester2;
+		
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP22_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp222.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP222_H__
+#define __CT_LBS_CLIENT_POS_TP222_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 222
+*
+*/
+class CT_LbsClientPosTp222 :public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp222(CT_LbsServer& aParent);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp222();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Deinitializes the test.
+        */
+        void CloseTest();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+	private: // New functions
+
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP222_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp223.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP223_H__
+#define __CT_LBS_CLIENT_POS_TP223_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 223
+*
+*/
+class CT_LbsClientPosTp223 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp223(CT_LbsServer& aParent);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp223();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+	private: // New functions
+
+		/**
+        * Leaves if aCondition is false.
+        * @param aCondition something that should be true
+        */
+		void AssertTrueSecL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode);
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP223_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp224.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP224_H__
+#define __CT_LBS_CLIENT_POS_TP224_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 224
+*
+*/
+class CT_LbsClientPosTp224 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp224(CT_LbsServer& aParent);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp224();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Deinitializes the test.
+        */
+        void CloseTest();
+
+	private: // New functions
+
+		/**
+        * Leaves if aCondition is false.
+        * @param aCondition something that should be true
+        */
+		void AssertTrueSecL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode);
+    
+        RPositionServer iServer;
+        RPositioner     iPositioner;
+        RPositioner     iPositioner2;
+   
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP224_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp227.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP227_H__
+#define __CT_LBS_CLIENT_POS_TP227_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 227
+*
+*/
+class CT_LbsClientPosTp227 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp227(CT_LbsServer& aParent);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp227();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Deinitializes the test.
+        */
+        void CloseTest();
+
+	private: // New functions
+
+		/**
+        * Leaves if aCondition is false.
+        * @param aCondition something that should be true
+        */
+		void AssertTrueL(TBool aCondition, const TDesC& aErrorMsg);
+   
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP227_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp25.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP25_H__
+#define __CT_LBS_CLIENT_POS_TP25_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+#include "mctlbsrequestobserver.h"
+
+// FORWARD DECLARATIONS
+class CT_LbsRequester;
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 25
+*
+*/
+class CT_LbsClientPosTp25 : public CT_LbsPortedStepBase, public MCT_LbsRequestObserver
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp25(CT_LbsServer& aParent);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp25();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+        /**
+        * From MCT_LbsRequestObserver
+        * Called when a CT_LbsRequester request has completed.
+        */
+        void RequestCompleteL();
+
+	private: // New functions
+
+        /**
+        * Leaves if aCondition is false.
+        * @param aCondition something that should be true
+        */
+        void AssertTrueL(TBool aCondition, const TDesC& aErrorMsg);
+
+    private: // Data
+
+        CT_LbsRequester*     iFastPsy;
+        CT_LbsRequester*     iMediumPsy;
+        CT_LbsRequester*     iSlowPsy;
+        TInt            iCompletedRequests;
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP25_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp254.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP254_H__
+#define __CT_LBS_CLIENT_POS_TP254_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// FORWARD DECLARATION
+class CPosRequestLog;
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 254
+*
+*/
+class CT_LbsClientPosTp254 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp254(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp254();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Deinitializes the test.
+        */
+        void CloseTest();
+
+        /**
+        * From CT_LbsPortedStepBase
+        */
+        void StartL();
+
+	private: // New functions
+
+		/**
+        * Deletes a file from the file system
+        * @param aFile the file name
+        */
+		void DeleteFileL(const TDesC& aFile);
+
+		/**
+        * Check if the specified file exists
+        * @param aFile the file name
+        */
+		TBool FileExistsL(const TDesC& aFile);
+
+        void CheckPositionL(TPosition& aPosition, TPosition& aLastPosition);
+
+		void CheckPositionInfoL(TPositionInfo& aInfo, TPositionInfo& aLastInfo);
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP254_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp256.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP256_H__
+#define __CT_LBS_CLIENT_POS_TP256_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 256
+*/
+class CT_LbsClientPosTp256 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp256(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp256();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Always called, even if the test leaves
+        */
+        void CloseTest();
+
+    private: // Functions
+
+        void CreateThreadsL();
+         void RequestL(TPositionInfoBase& aInfoBase);
+
+    private: // data   
+        
+        RArray<RThread>	        iThreads;
+        RPointerArray<HBufC>    iNames;
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP256_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp257.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP257_H__
+#define __CT_LBS_CLIENT_POS_TP257_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 257
+*
+*/
+class CT_LbsClientPosTp257 :public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp257(CT_LbsServer& aParent);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp257();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Deinitializes the test. 
+        * Always called even if test leaves.
+        */
+        void CloseTest();
+
+        /**
+        * From CT_LbsPortedStepBase
+        */
+        void StartL();
+
+	private: // New functions
+
+        /**
+        * Compares two TPositionInfoBase objects
+        * @return returns true if equal, otherwise false
+        */
+        TBool ComparePositionL(TPositionInfo aPosInfo1, TPositionInfo aPosInfo2);
+
+        /**
+        * Deletes a file from the file system
+        * @param aFile the file name
+        */
+		void DeleteFileL(const TDesC& aFile);
+
+		/**
+        * Check if the specified file exists
+        * @param aFile the file name
+        */
+		TBool FileExistsL(const TDesC& aFile);
+
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP257_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp259.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP259_H__
+#define __CT_LBS_CLIENT_POS_TP259_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 259
+*
+*/
+class CT_LbsClientPosTp259 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+    	CT_LbsClientPosTp259(CT_LbsServer& aParent);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp259();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Deinitializes the test. 
+        * Always called even if test leaves.
+        */
+        void CloseTest();
+
+        /**
+        * From CT_LbsPortedStepBase
+        */
+        void StartL();
+
+	private: // New functions
+        
+        /**
+        * First call the RPosServer::CancelRequest method with inparameter 
+        * EPositionerNotifyPositionUpdate and then call the RPositioner::CancelRequest
+        * method with EPositionServerNotifyModuleStatusEvent
+        */
+        void TestPart1L();
+        
+        /**
+        * Test some cases not included in TestPart1L
+        */
+        void TestPart2L();
+
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP259_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp261.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP261_H__ 
+#define __CT_LBS_CLIENT_POS_TP261_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// FORWARD DECLARATIONS
+class RRequestorStack;
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 261
+*
+*/
+class CT_LbsClientPosTp261 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp261(CT_LbsServer& aParent);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp261();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Deinitializes the test.
+        */
+        void CloseTest();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+	private: // New functions
+	
+        void VerifyRequestorStackL(RRequestorStack& aStack);
+
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP261_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp269.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP269_H__
+#define __CT_LBS_CLIENT_POS_TP269_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 269
+*/
+class CT_LbsClientPosTp269 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp269(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp269();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Always called, even if the test leaves
+        */
+        void CloseTest();
+
+    private: // Functions
+              
+        void SetupProxyPSYsL();
+
+        void AssertTrueSecL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode=KErrGeneral);
+
+    private: // data
+        
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP269_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp27.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP27_H__
+#define __CT_LBS_CLIENT_POS_TP27_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 27
+*
+*/
+class CT_LbsClientPosTp27 :public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp27(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp27();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Called after the tests
+        */
+        void CloseTest();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+        
+	private:
+
+		/**
+		* Cancel a position request using the dialog plugin
+		* (The request does not reach the PSY since the dialog plugin waits for a cancell call
+		*/
+		void MakeCancelRequestL(TTimeIntervalMicroSeconds32 aCancelTime, TTimeIntervalMicroSeconds aTimeLimit);
+
+		/**
+		* Perform a position request while cancelling two other 
+		* notification requests and make sure that Epos does not hang!
+		* Using a "slow" psy assures that the position request has reached the Psy
+		*/
+		void MakeCancelRequest2L(TTimeIntervalMicroSeconds32 aCancelTime, TTimeIntervalMicroSeconds aTimeLimit);
+
+		/**
+		* Check that a request that is cancelled when
+		* the request has reached the PSY is logged in the requestlog.
+		*/ 
+		void CheckCancelRequestL();
+
+        /**
+        * Enables the specified PSY, does NOT disable any
+        */
+        void EnablePsyL(const TUid aPsyUid);
+
+        /**
+        * Disables all Psys
+        */
+        void DisableAllPsyL();
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP27_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp271.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP271_H__
+#define __CT_LBS_CLIENT_POS_TP271_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 271
+*/
+class CT_LbsClientPosTp271 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp271(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp271();
+
+    public: // Functions from base classes
+    
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Always called, even if the test leaves
+        */
+        void CloseTest();
+
+    private: // Functions
+              
+        void SetupProxyPSYsL();
+
+        void AssertTrueSecL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode=KErrGeneral);
+
+        void VerifyPsyStartedTrackingL(TPositionModuleId& aUid);
+
+        void VerifyPsyStoppedTrackingL(TPositionModuleId& aUid, TRequestStatus& aStatus);
+
+        void VerifyPsyStoppedTrackingL(TPositionModuleId& aUid);
+        
+    private: // data
+        
+        TPositionModuleStatusEvent           iModuleEvent;
+        
+        TRequestStatus                       iEventStatus;
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP271_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp272.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP272_H__
+#define __CT_LBS_CLIENT_POS_TP272_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 272
+*/
+class CT_LbsClientPosTp272 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp272(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp272();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Always called, even if the test leaves
+        */
+        void CloseTest();
+
+    private: // Functions
+        
+        void RequestL(const TInt& aRequestIndex, 
+                      const TInt64& aMinTimeLimit,
+                      const TInt64& aMaxTimeLimit,
+                      const TInt& aPeriodicUpdateInterval=0);
+
+        void SetPeriodicUpdateL(const TInt& aUpdateInterval);
+
+        void AssertTrueSecL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode=KErrGeneral);
+
+    private: // data
+             
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP272_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp274.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP274_H__
+#define __CT_LBS_CLIENT_POS_TP274_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 274
+*/
+class CT_LbsClientPosTp274 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp274(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp274();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Always called, even if the test leaves
+        */
+        void CloseTest();
+
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP274_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp275.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP275_H__
+#define __CT_LBS_CLIENT_POS_TP275_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 275
+*
+*/
+class CT_LbsClientPosTp275 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp275(CT_LbsServer& aParent);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp275();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Deinitializes the test.
+        */
+        void CloseTest();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP275_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp4701.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP4701_H__
+#define __CT_LBS_CLIENT_POS_TP4701_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 4701
+*/
+class CT_LbsClientPosTp4701 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        CT_LbsClientPosTp4701(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp4701();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Always called, even if the test leaves
+        */
+        void CloseTest();
+
+    private: // Functions
+        
+        void SetupProxyPSYsL();
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP4701_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp4702.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP4702_H__
+#define __CT_LBS_CLIENT_POS_TP4702_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 4702
+*/
+class CT_LbsClientPosTp4702 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp4702(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp4702();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Always called, even if the test leaves
+        */
+        void CloseTest();
+
+    private: // Functions
+        
+        void SetupProxyPSYsL();
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP4702_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp4703.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP4703_H__
+#define __CT_LBS_CLIENT_POS_TP4703_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 4703
+*/
+class CT_LbsClientPosTp4703 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp4703(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp4703();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Always called, even if the test leaves
+        */
+        void CloseTest();
+
+    private: // Functions
+        
+        void SetupProxyPSYsL();
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP4703_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp4704.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP4704_H__
+#define __CT_LBS_CLIENT_POS_TP4704_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 4704
+*/
+class CT_LbsClientPosTp4704 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp4704(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp4704();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Always called, even if the test leaves
+        */
+        void CloseTest();
+
+    private: // Functions
+        
+        void SetupProxyPSYsL();
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP4704_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp4705.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP4705_H__
+#define __CT_LBS_CLIENT_POS_TP4705_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 4705
+*/
+class CT_LbsClientPosTp4705 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp4705(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp4705();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Always called, even if the test leaves
+        */
+        void CloseTest();
+
+    private: // Functions
+        
+        void SetupProxyPSYsL();
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP4705_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp4706.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP4706_H__
+#define __CT_LBS_CLIENT_POS_TP4706_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 4706
+*/
+class CT_LbsClientPosTp4706 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp4706(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp4706();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Always called, even if the test leaves
+        */
+        void CloseTest();
+
+    private: // Functions
+        
+        void SetupProxyPSYsL();
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP4706_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp4707.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP4707_H__
+#define __CT_LBS_CLIENT_POS_TP4707_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 4707
+*/
+class CT_LbsClientPosTp4707 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp4707(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp4707();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Always called, even if the test leaves
+        */
+        void CloseTest();
+
+    private: // Functions
+        
+        void SetupProxyPSYsL();
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP4707_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp4708.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP4708_H__
+#define __CT_LBS_CLIENT_POS_TP4708_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 4708
+*/
+class CT_LbsClientPosTp4708 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp4708(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp4708();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Always called, even if the test leaves
+        */
+        void CloseTest();
+
+    private: // Functions
+        
+        void SetupProxyPSYsL();
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP4708_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp4709.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP4709_H__
+#define __CT_LBS_CLIENT_POS_TP4709_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 4709
+*/
+class CT_LbsClientPosTp4709 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp4709(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp4709();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Always called, even if the test leaves
+        */
+        void CloseTest();
+
+    private: // Functions
+        
+        void SetupProxyPSYsL();
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP4709_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp4722.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP4722_H__
+#define __CT_LBS_CLIENT_POS_TP4722_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 4722
+*/
+class CT_LbsClientPosTp4722 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        CT_LbsClientPosTp4722(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp4722();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Always called, even if the test leaves
+        */
+        void CloseTest();
+
+    private: // Functions
+        
+        void SetupProxyPSYsL();
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP4722_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp4723.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP4723_H__
+#define __CT_LBS_CLIENT_POS_TP4723_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 4723
+*/
+class CT_LbsClientPosTp4723 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp4723(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp4723();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Always called, even if the test leaves
+        */
+        void CloseTest();
+
+    private: // Functions
+        
+        void SetupProxyPSYsL();
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP4723_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp76.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP76_H__
+#define __CT_LBS_CLIENT_POS_TP76_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 76
+*
+*/
+class CT_LbsClientPosTp76 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp76(CT_LbsServer& aParent);
+
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp76();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Runs the test in the module
+        */
+        void StartL();
+
+	private: // New functions
+
+        /**
+        * Leaves if aCondition is false.
+        * @param aCondition something that should be true
+        */
+        void AssertTrueL(TBool aCondition, const TDesC& errorMsg);
+
+		/**
+        * Leaves if aCondition is false.
+        * @param aCondition something that should be true
+        */
+		void AssertTrueSecL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode);
+
+        void CheckModuleInfoL(const TPositionModuleInfo& dbInfo,
+                              const TPositionModuleInfo& clientInfo);
+
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP76_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientpostp93.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __CT_LBS_CLIENT_POS_TP93_H__
+#define __CT_LBS_CLIENT_POS_TP93_H__
+
+//  INCLUDES
+#include "ctlbsportedstepbase.h"
+
+
+// CLASS DECLARATION
+
+/**
+*  Test procedure 93
+*
+*/
+class CT_LbsClientPosTp93 : public CT_LbsPortedStepBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CT_LbsClientPosTp93(CT_LbsServer& aParent);
+        
+        /**
+        * Destructor.
+        */
+        ~CT_LbsClientPosTp93();
+
+    public: // Functions from base classes
+
+        /**
+        * From CT_LbsPortedStepBase
+        * Deinitializes the test. Always called, even if test leaves.
+        */
+        void CloseTest();
+
+        /**
+        * From CT_LbsPortedStepBase
+        */
+        void StartL();
+	
+    private:
+		RArray<TInt> iRequestArray;
+		RArray<TPtrC> iNameArray;
+    };
+
+#endif      // __CT_LBS_CLIENT_POS_TP93_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientserver.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,46 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsClientServer.h
+// This contains the header file for LBS Client Test server
+// 
+//
+
+#ifndef __CT_LBS_CLIENT_SERVER_H__
+#define __CT_LBS_CLIENT_SERVER_H__
+
+// System includes
+
+// User includes
+#include "ctlbsserver.h"
+#include "ctlbsshareddata.h"
+
+
+_LIT(KLbsClientTestServer,"LbsClientTestServer");
+
+
+// Implements the LBS Client Test server
+class CT_LbsClientServer : public CT_LbsServer
+	{
+public :
+	static CT_LbsClientServer* NewL();
+	// Creates the test steps based on the test step name 
+	virtual CTestStep* CreateTestStep(const TDesC& aStepName);
+	~CT_LbsClientServer();
+	CT_LbsClientServer();
+
+protected:
+	void ConstructL(const TDesC& aName);
+	};
+
+#endif //__CT_LBS_CLIENT_SERVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientshareddata.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,58 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsClientSharedData.h
+// This contains the header file for CT_LbsClientSharedData
+// 
+//
+
+
+#ifndef __CT_LBS_CLIENT_SHARED_DATA_H__
+#define __CT_LBS_CLIENT_SHARED_DATA_H__
+
+// system includes
+#include <e32cmn.h>
+
+// Lbs includes
+#include <lbspositioninfo.h>
+#include <lbscommon.h>
+
+
+class CT_LbsClientSharedData : public CBase
+{
+public:
+	static CT_LbsClientSharedData* NewL();
+	CT_LbsClientSharedData();
+	~CT_LbsClientSharedData();
+
+private:
+	void ConstructL();
+
+public:
+	RPointerArray<TAny>	iVerifyPosInfoArr;
+	RPointerArray<TAny>	iCurrentPosInfoArr;
+	
+	TPositionModuleInfo iVerifyModuleInfo;
+	TPositionModuleInfo iCurrentModuleInfo;
+
+	TPositionModuleStatus iVerifyModuleStatus;
+	TPositionModuleStatus iCurrentModuleStatus;
+
+	TPositionModuleStatusEvent iVerifyModuleStatusEvent;
+	TPositionModuleStatusEvent iCurrentModuleStatusEvent;
+
+	TPositionUpdateOptions iVerifyUpdateOpts;
+	TPositionUpdateOptions iCurrentUpdateOpts;
+};
+
+#endif // __CT_LBS_CLIENT_SHARED_DATA_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientstep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,85 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsClientStep.h
+// This contains the header file for LBS Client Test Step Base
+// 
+//
+
+#ifndef __CT_LBS_CLIENT_STEP_H__
+#define __CT_LBS_CLIENT_STEP_H__
+
+#include <testexecutestepbase.h>
+#include <lbs.h>
+#include <lbsnetsimtest.h>
+
+#include "ctlbsclientserver.h"
+
+//todo: is this a sensible place to put this as it's used by many teststeps?
+const TTimeIntervalMicroSeconds32 delay10Seconds = 10000000;
+
+
+class CT_LbsClientStep : public CTestStep
+{
+
+public:
+	virtual ~CT_LbsClientStep();
+
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+
+protected:
+	CT_LbsClientStep(CT_LbsClientServer& aParent);
+
+
+	// Carryout a notify position update.
+	// Must have a connect server, and a open positioner
+	// also the pos info array is appened to
+	TInt DoNotifyUpdateL(TPositionInfoBase& aPosInfo);
+	
+	TInt DoLastKnownPosL(TPositionInfoBase& aPosInfo);
+
+	TInt OpenNetSim();
+	void SendResetAssistanceData(TLbsAssistanceDataGroup aMask);
+	void CloseNetSim();
+
+	CT_LbsClientServer& iParent;
+
+	RPositionServer iServer;
+	RPositioner iPositioner;
+
+	/** Net sim required for tests which invoke assistance data via AGPS module. */
+	RLbsNetSimTest iNetSim;
+	
+	/** Reference position used to setup Net sim and later verification. */
+	TPosition iRefPos;
+
+		
+private:
+	/**
+	Position call types - used by GetLocation() to determine which position update function to call
+
+	*/
+	enum _TPositionUpdateType
+		{
+		/** EDoNotifyPosUpdate - call NotifyPositionUpdate  */
+		EDoNotifyPosUpdate = 0,
+		/** EDoLastKnownPos - call GetLastKnownPosition */
+		EDoLastKnownPos = 0x01
+		};
+
+	TInt GetLocationL(TPositionInfoBase& aPosInfo, TUint32 aNotifyCallType);
+	
+};
+
+#endif // __CT_LBS_CLIENT_STEP_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientstep_reset_assistance.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,60 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientstep_reset_assistance.h
+// 
+//
+
+#ifndef __CT_LBS_CLIENT_STEP_RESET_ASSISTANCE_H__
+#define __CT_LBS_CLIENT_STEP_RESET_ASSISTANCE_H__
+
+#include "ctlbsclientstep.h"
+#include "ctlbsclientserver.h"
+#include "ctlbsclientnotifyposupdao.h"
+#include <lbsadmin.h>
+
+// Literals used
+_LIT(KLbsClientStep_ResetAssistance, "LbsClientStep_ResetAssistance");
+
+
+
+class CT_LbsClientStep_ResetAssistance : public CT_LbsClientStep, MT_NotifyPosUpdateObserver
+	{
+public:
+	~CT_LbsClientStep_ResetAssistance();
+
+	static CT_LbsClientStep_ResetAssistance* New(CT_LbsClientServer& aParent);
+	virtual TVerdict doTestStepL();
+
+    void NotifyPositionUpdateCallback(TRequestStatus& aStatus);
+
+   
+private:
+	CT_LbsClientStep_ResetAssistance(CT_LbsClientServer& aParent);
+	
+	void ConstructL();
+	void TempSetRequestorL();
+	TInt64 DoRequests(TBool aCold, TBool aReset);
+	
+	
+private:
+
+	// To allow changing admin settings.
+	CLbsAdmin*	iLbsAdmin;
+   
+	TBool	iRequestedAssData;
+	TBool	iReceivedAssData;
+	
+	};
+
+#endif //__CT_LBS_CLIENT_STEP_RESET_ASSISTANCE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientstepassistance.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,89 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientstepassistance.h
+// This contains the header file for assistance data Tests
+// 
+//
+
+#ifndef __CT_LBS_CLIENT_STEP_ASSISTANCE_H__
+#define __CT_LBS_CLIENT_STEP_ASSISTANCE_H__
+
+#include <lbsadmin.h>
+//Lbs test include
+#include "ctlbsnetsimstep.h"
+#include "ctlbsdoposupdate.h"
+#include "ctlbsclientserver.h"
+
+// Literals used
+_LIT(KLbsClientStep_Assistance, "LbsClientStep_Assistance");
+
+// Callbacks flags.
+const TLbsCallbackFlags KLbsCallback_Got_NotifyUpdate			= 0x1000;
+
+class CT_LbsClientStep_Assistance : public CT_LbsNetSimStep,	
+										   MT_LbsDoPosUpdateObserver
+										
+	{
+
+public:
+	~CT_LbsClientStep_Assistance();
+
+	static CT_LbsClientStep_Assistance* New(CT_LbsClientServer& aParent);
+	virtual TVerdict doTestStepL();
+
+	// From CT_LbsNetSimStep via CT_LbsAssDataStep
+	void Connected();
+	void Disconnected();
+	void NotifyRegisterLcsMoLr(const TDesC& aData);
+	void NotifyReleaseLcsMoLr(TInt aReason);
+	void NotifyMeasurementControlLocation(const TPositionInfo& aPosition, const RLbsAssistanceDataBuilderSet& aData, const TLbsNetPosRequestQuality& aQuality);
+	//void NotifyReleaseLcsLocationNotification(const CLbsNetworkProtocolBase::TLbsPrivacyResponse& aResult);
+	void NotifyFacilityLcsMoLrResult(TInt aReason, const TPositionInfo& aPosition);
+	void NotifyMeasurementReportLocation(const TPositionInfo& aPosition);
+	void NotifyMeasurementReportRequestMoreAssistanceData(const TLbsAssistanceDataGroup& aFilter);
+	void NotifyMeasurementReportControlFailure(TInt aReason);
+
+	// From MT_LbsDoPosUpdateObserver - Position notify update callback.
+	void MT_LbsDoPosUpdateCallback(TRequestStatus& aStatus);
+
+private:
+	
+	CT_LbsClientStep_Assistance(CT_LbsClientServer& aParent);
+	void ConstructL();
+
+
+	enum  {	EStartMTLRPrivReq = CT_LbsNetSimStep::ELast,
+			EStartMTLRLocReq};
+    
+    
+    CT_LbsClientServer& iParent;
+
+	/** Current test case being executed.
+	*/
+	TInt iTestCaseId;
+
+	// to allow changing admin settings:
+	CLbsAdmin*	iLbsAdmin;
+	
+	/** Active object wrapper to allow MO-LRs.
+	*/
+	CT_LbsDoPosUpdate* iDoPosUpdate;
+
+	/** Used to monitor the number of assistance data events we receviced during a test.
+	*/
+	TUint iAssEventCount;
+	
+	};
+
+#endif //__CT_LBS_CLIENT_STEP_ASSISTANCE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientstepcellbasednpud.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,92 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientstepcellbasednpud.h
+// This contains the header file for Notify Position Update Tests
+// 
+//
+
+#ifndef __CT_LBS_CLIENT_STEP_CELLBASED_NOTIFY_POS_UPDATE_H__
+#define __CT_LBS_CLIENT_STEP_CELLBASED_NOTIFY_POS_UPDATE_H__
+
+#include "ctlbsclientstep.h"
+#include "ctlbsclientserver.h"
+#include "ctlbsclientnotifyposupdao.h"
+#include "ctlbsnetsimstep.h"
+#include "ctlbsdoposupdate.h"
+
+#include <lbsadmin.h>
+#include <lbsnetsimtest.h>
+
+// Literals used
+_LIT(KLbsClientStep_CellBasedNotifyPosUpdate, "LbsClientStep_CellBasedNotifyPosUpdate");
+
+const TLbsCallbackFlags KLbsCallback_Got_NotifyPositionUpdate			= 0x1000;
+
+class CT_LbsClientStep_CellBasedNotifyPosUpdate : public CT_LbsNetSimStep,
+												  public MT_LbsDoPosUpdateObserver
+	{
+public:
+	~CT_LbsClientStep_CellBasedNotifyPosUpdate();
+
+	static CT_LbsClientStep_CellBasedNotifyPosUpdate* New(CT_LbsClientServer& aParent);
+	virtual TVerdict doTestStepL();
+    
+   	// From CT_LbsNetSimStep:
+	void Connected();
+	void Disconnected();
+	void NotifyRegisterLcsMoLr(const TDesC& aData);
+	void NotifyReleaseLcsMoLr(TInt aReason);
+	void NotifyMeasurementControlLocation(const TPositionInfo& aPosition, const RLbsAssistanceDataBuilderSet& aData, const TLbsNetPosRequestQuality& aQuality);
+	void NotifyReleaseLcsLocationNotification(const CLbsNetworkProtocolBase::TLbsPrivacyResponse& aResult);
+	void NotifyFacilityLcsMoLrResult(TInt aReason, const TPositionInfo& aPosition);
+	void NotifyMeasurementReportLocation(const TPositionInfo& aPosition);
+	void NotifyMeasurementReportRequestMoreAssistanceData(const TLbsAssistanceDataGroup& aFilter);
+	void NotifyMeasurementReportControlFailure(TInt aReason);
+	void NotifyError(MLbsNetSimTestObserver::EFunction aFunction, int aError);
+	void ProcessMeasurementControlLocationError(TInt aError);
+
+
+   // From MT_LbsDoPosUpdateObserver:
+   void MT_LbsDoPosUpdateCallback(TRequestStatus& aStatus);
+   
+   
+private:
+	CT_LbsClientStep_CellBasedNotifyPosUpdate(CT_LbsClientServer& aParent);
+
+	void ConstructL();
+	
+private:
+	
+	// whether the network should be available
+	TBool	iNetworkUnavailable;
+	
+	// whether (and when) the request should be cancelled
+	TBool	iCancel;
+	TBool	iCancelBeforePosUpdate;
+	TBool	iCancelOnPosUpdate;
+	TBool 	iIsCancelTest;
+	TBool	iMultiReq;
+	
+	// to allow us to set a ref location in NetSim for network-based updates and monitor network:
+	RLbsNetSimTest iNetSim;
+   
+	CT_LbsClientServer& iParent;
+
+	CT_LbsDoPosUpdate* iDoPosUpdate;
+			
+	// Number of NotifyPositionUpdates the test case should do
+	TUint iNumNPUDs;
+	};
+
+#endif //__CT_LBS_CLIENT_STEP_CELLBASED_NOTIFY_POS_UPDATE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientstepignoreaccurracysetting.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,47 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientstepignoreaccurracysetting.h
+// 
+//
+
+#ifndef __CT_LBS_CLIENT_STEP_IGNORE_ACCURACY_SETTING_H__
+#define __CT_LBS_CLIENT_STEP_IGNORE_ACCURACY_SETTING_H__
+
+#include <e32cmn.h>
+#include "ctlbsclientstep.h"
+#include "ctlbsclientserver.h"
+
+#include <ctlbsagpshandler.h>
+
+// Literals used
+_LIT(KLbsClientStep_IgnoreAccuracySetting, "LbsClientStep_IgnoreAccuracySetting");
+
+class CT_LbsClientStep_IgnoreAccuracySetting : public CT_LbsClientStep
+	{
+public:
+	~CT_LbsClientStep_IgnoreAccuracySetting();
+
+	static CT_LbsClientStep_IgnoreAccuracySetting* New(CT_LbsClientServer& aParent);
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepL();
+
+private:
+	CT_LbsClientStep_IgnoreAccuracySetting(CT_LbsClientServer& aParent);
+	void ConstructL();
+
+private:
+	TInt iTestCaseId;
+	};
+
+#endif //__CT_LBS_CLIENT_STEP_IGNORE_ACCURACY_SETTING_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientstepignoreaccurracysettingtracking.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientstepignoreaccurracysettingtracking.h
+// 
+//
+
+#ifndef __CT_LBS_CLIENT_STEP_IGNORE_ACCURACY_SETTING_TRACKING_H__
+#define __CT_LBS_CLIENT_STEP_IGNORE_ACCURACY_SETTING_TRACKING_H__
+
+#include <e32cmn.h>
+#include "ctlbsclientstep.h"
+#include "ctlbsclientserver.h"
+
+#include <ctlbsagpshandler.h>
+
+// Literals used
+_LIT(KLbsClientStep_IgnoreAccuracySettingTracking, "LbsClientStep_IgnoreAccuracySettingTracking");
+
+class CT_LbsClientStep_IgnoreAccuracySettingTracking : public CT_LbsClientStep
+	{
+public:
+	~CT_LbsClientStep_IgnoreAccuracySettingTracking();
+
+	static CT_LbsClientStep_IgnoreAccuracySettingTracking* New(CT_LbsClientServer& aParent);
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepL();
+
+private:
+	CT_LbsClientStep_IgnoreAccuracySettingTracking(CT_LbsClientServer& aParent);
+	void ConstructL();
+
+private:
+	TInt iTestCaseId;
+	RPointerArray<TAny> iExpectedUpdateArray;
+	};
+
+#endif //__CT_LBS_CLIENT_STEP_IGNORE_ACCURACY_SETTING_TRACKING_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientsteplastknownpos.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,41 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientsteplastknownpos.h
+// This contains the header file for  Last Known Position Tests
+// 
+//
+
+#ifndef __CT_LBS_CLIENT_STEP_LAST_KNOWN_POS_H__
+#define __CT_LBS_CLIENT_STEP_LAST_KNOWN_POS_H__
+
+#include "ctlbsclientstep.h"
+#include "ctlbsclientserver.h"
+
+// Literals used
+_LIT(KLbsClientStep_LastKnownPos, "LbsClientStep_LastKnownPos");
+
+class CT_LbsClientStep_LastKnownPos : public CT_LbsClientStep
+	{
+public:
+	~CT_LbsClientStep_LastKnownPos();
+
+	static CT_LbsClientStep_LastKnownPos* New(CT_LbsClientServer& aParent);
+	virtual TVerdict doTestStepL();
+	void SwitchOnselfLocateAPIL();
+	
+private:
+	CT_LbsClientStep_LastKnownPos(CT_LbsClientServer& aParent);
+	};
+
+#endif //__CT_LBS_CLIENT_STEP_LAST_KNOWN_POS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientstepmodinfo.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,40 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientstepmodinfo.h
+// This contains the header file for Module Information Tests
+// 
+//
+
+#ifndef __CT_LBS_CLIENT_STEP_MOD_INFO_H__
+#define __CT_LBS_CLIENT_STEP_MOD_INFO_H__
+
+#include "ctlbsclientstep.h"
+#include "ctlbsclientserver.h"
+
+// Literals used
+_LIT(KLbsClientStep_ModInfo, "LbsClientStep_ModInfo");
+
+class CT_LbsClientStep_ModInfo : public CT_LbsClientStep
+	{
+public:
+	~CT_LbsClientStep_ModInfo();
+
+	static CT_LbsClientStep_ModInfo* New(CT_LbsClientServer& aParent);
+	virtual TVerdict doTestStepL();
+
+private:
+	CT_LbsClientStep_ModInfo(CT_LbsClientServer& aParent);
+	};
+
+#endif //__CT_LBS_CLIENT_STEP_MOD_INFO_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientstepmodselect.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,73 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientstepmodselect.h
+// This contains the header file for Capability Tests
+// 
+//
+
+#ifndef __CT_LBS_CLIENT_STEP_MODSELECT_H__
+#define __CT_LBS_CLIENT_STEP_MODSELECT_H__
+
+#include "ctlbsclientstep.h"
+#include "ctlbsclientserver.h"
+#include <lbsnetsimtest.h>
+
+// Literals used
+_LIT(KLbsClientStep_ModSelect, "LbsClientStep_ModSelect");
+
+class CT_LbsClientStep_ModSelect : public CT_LbsClientStep
+	{
+public:
+	~CT_LbsClientStep_ModSelect();
+
+	static CT_LbsClientStep_ModSelect* New(CT_LbsClientServer& aParent);
+
+	virtual TVerdict doTestStepL();
+
+private:
+	CT_LbsClientStep_ModSelect(CT_LbsClientServer& aParent);
+
+	enum TModuleType
+		{
+		ERandomModule,
+		EAGPSModule,
+		ENetworkModule
+		};
+	enum TOpenSesstionMethod
+		{
+		ENone,
+		EWithCriteria,
+		EWithModuleId
+		};
+	
+	void DoModuleSelectionL(TOpenSesstionMethod aMethod, TModuleType aModuleType);
+	TInt SetupNetSimL();
+	
+	TInt Blocking_NotifyUpdateL();
+	TInt Blocking_NofifyUpdateWithCriteriaL(TPositionCriteria aCriteria);
+	TInt Blocking_NotifyUpdateWithModuleIdL(TPositionModuleId aModuleId);
+	TInt Blocking_NotifyUpdateCommonL();
+	
+	TBool VerifyLastModuleIdWasAGpsL();
+	TBool VerifyLastModuleIdWasNetworkL();
+		
+	RLbsNetSimTest 			iNetSim; 
+	
+	TPositionCriteria		iCriteria; // default capability is ECapabilityHorizontal 
+	TPositionQuality    	iQuality;
+	TPositionSelectionOrder iSelectOrder;
+	TPositionModuleId 		iModuleId;
+	};
+
+#endif //__CT_LBS_CLIENT_STEP_MODSELECT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientstepmodstatus.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,49 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientstepmodstatus.h
+// This contains the header file for Module Status Tests
+// 
+//
+
+#ifndef __CT_LBS_CLIENT_STEP_MOD_STAT_H__
+#define __CT_LBS_CLIENT_STEP_MOD_STAT_H__
+
+#include "ctlbsclientstep.h"
+#include "ctlbsclientserver.h"
+
+#include <lbscommon.h>
+
+// Literals used
+_LIT(KLbsClientStep_ModStatus, "LbsClientStep_ModStatus");
+
+class CT_LbsClientStep_ModStat : public CT_LbsClientStep
+	{
+public:
+	~CT_LbsClientStep_ModStat();
+
+	static CT_LbsClientStep_ModStat* New(CT_LbsClientServer& aParent);
+	virtual TVerdict doTestStepL();
+
+private:
+
+ 	TBool DoRequestAndVerifyModStatusEventsL(TPositionModuleStatusEvent::TModuleEvent aReqEventsMask, TPositionModuleStatus& aModStatus, TPositionModuleId aModId /*= KPositionNullModuleId*/);
+ 	TBool DoRequestAndVerifyAGPSModStatusEventsL(TPositionModuleStatusEvent::TModuleEvent aReqEventsMask, TPositionModuleStatus& aModStatus);
+	TInt DoRequestModStatusEventsWithError(TPositionModuleStatusEvent::TModuleEvent aReqEventsMask, TPositionModuleId aModId);
+	
+	TBool DoVerifyModStatus(TPositionModuleStatusEvent::TModuleEvent aExpectedModStatus,TPositionModuleId aModId);
+	
+	CT_LbsClientStep_ModStat(CT_LbsClientServer& aParent);
+	};
+
+#endif //__CT_LBS_CLIENT_STEP_MOD_STAT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientstepmultireq.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,77 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientstepmultireq.h
+// This contains the header file for multi requests Tests
+// 
+//
+
+#ifndef __CT_LBS_CLIENT_STEP_MULTIREQ_H__
+#define __CT_LBS_CLIENT_STEP_MULTIREQ_H__
+
+#include "ctlbsclientstep.h"
+#include "ctlbsclientserver.h"
+#include "ctlbsclientgetlkpao.h"
+#include "ctlbsclientnotifyposupdao.h"
+
+
+// Literals used
+_LIT(KLbsClientStep_MultiReq, "LbsClientStep_MultiReq");
+
+_LIT(KLbsMultiReqTestSuitePanic,"Lbs Multi Requests Test Suite Panic");
+
+
+class CT_LbsClientStep_MultiReq : public CT_LbsClientStep, public MT_GetLastKnownPosObserver, public MT_NotifyPosUpdateObserver
+	{
+public:
+	~CT_LbsClientStep_MultiReq();
+
+	static CT_LbsClientStep_MultiReq* NewL(CT_LbsClientServer& aParent);
+	static CT_LbsClientStep_MultiReq* New(CT_LbsClientServer& aParent);
+
+	virtual TVerdict doTestStepL();
+	
+//from MT_GetLastKnownPosObserver:
+	virtual void GetLastKnownPositionCallback(TRequestStatus& aStatus);
+//from MT_NotifyPosUpdateObserver:
+	virtual void NotifyPositionUpdateCallback(TRequestStatus& aStatus);
+// tidy up (must be public to allow calling through timer callback function)	
+	void CT_LbsClientStep_MultiReq::AsyncTidyUp();
+	
+private:
+
+	enum TMultiReqState
+	/** 
+	 *	 states
+	 */
+	    {
+	    EStateUnknown, 							/*!< state unknown. */
+	    EStateLastKnownPositionComplete, 		/*!< Last Known Position request has completed */
+	    EStateLastNotifyPositionUpdateComplete, /*!< Notify Position Update request has completed */
+	    EStateDone 								/*!< Last Known Position and Position Update requests have both completed  */
+	    };
+	TMultiReqState iState;
+
+	CT_LbsClientStep_MultiReq(CT_LbsClientServer& aParent);
+
+	// timer for requests timeouts
+	CPeriodic* iTimer;
+	
+	CT_LbsClientGetLastKnownPosAO*	iGetLastKnownPosAO;
+	CT_LbsClientNotifyPosUpdAO*		iNotifyPosUpdateAO;
+	
+	TPositionInfo* iTempPosInfo;
+		
+	};
+
+#endif //__CT_LBS_CLIENT_STEP_MULTIREQ_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientstepnotifyposupdate.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,62 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsClientStep_NotifyPosUpdate.h
+// This contains the header file for Notify Position Update Tests
+// 
+//
+
+#ifndef __CT_LBS_CLIENT_STEP_NOTIFY_POS_UPDATE_H__
+#define __CT_LBS_CLIENT_STEP_NOTIFY_POS_UPDATE_H__
+
+#include "ctlbsclientstep.h"
+#include "ctlbsclientserver.h"
+#include "ctlbsclientnotifyposupdao.h"
+#include <lbsadmin.h>
+
+_LIT(KNumPositions, "num_positions");
+
+// Literals used
+_LIT(KLbsClientStep_NotifyPosUpdate, "LbsClientStep_NotifyPosUpdate");
+
+
+
+class CT_LbsClientStep_NotifyPosUpdate : public CT_LbsClientStep, MT_NotifyPosUpdateObserver
+	{
+public:
+	~CT_LbsClientStep_NotifyPosUpdate();
+
+	static CT_LbsClientStep_NotifyPosUpdate* New(CT_LbsClientServer& aParent);
+	virtual TVerdict doTestStepL();
+
+    void NotifyPositionUpdateCallback(TRequestStatus& aStatus);
+
+   
+private:
+	CT_LbsClientStep_NotifyPosUpdate(CT_LbsClientServer& aParent);
+	
+	void ConstructL();
+	void TempSetRequestorL();
+	
+	
+private:
+
+	// To allow changing admin settings.
+	CLbsAdmin*	iLbsAdmin;
+   
+	TBool	iRequestedAssData;
+	TBool	iReceivedAssData;
+	
+	};
+
+#endif //__CT_LBS_CLIENT_STEP_NOTIFY_POS_UPDATE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientstepopenclose.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,43 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsClientStep_OpenClose.h
+// This contains the header file for Server Open Close Tests
+// 
+//
+
+#ifndef __CT_LBS_CLIENT_STEP_OPEN_CLOSE_H__
+#define __CT_LBS_CLIENT_STEP_OPEN_CLOSE_H__
+
+#include "ctlbsclientstep.h"
+#include "ctlbsclientserver.h"
+
+// Literals used
+_LIT(KLbsClientStep_OpenClose, "LbsClientStep_SrvOpenClose");
+
+class CT_LbsClientStep_OpenClose : public CT_LbsClientStep
+	{
+public:
+	~CT_LbsClientStep_OpenClose();
+
+	static CT_LbsClientStep_OpenClose* NewL(CT_LbsClientServer& aParent);
+	static CT_LbsClientStep_OpenClose* New(CT_LbsClientServer& aParent);
+
+	virtual TVerdict doTestStepL();
+
+private:
+	CT_LbsClientStep_OpenClose(CT_LbsClientServer& aParent);
+
+	};
+
+#endif //__CT_LBS_CLIENT_STEP_OPEN_CLOSE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientsteppartialupdate.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,78 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientsteppartialupdate.h
+// This contains the header file for  Update Options Tests
+// 
+//
+
+#ifndef __CT_LBS_CLIENT_PARTIALUPDATE_H__
+#define __CT_LBS_CLIENT_PARTIALUPDATE_H__
+
+#include "ctlbsclientserver.h"
+#include "ctlbsnetsimstep.h"
+#include "ctlbsdoposupdate.h"
+
+
+// Literals used
+_LIT(KLbsClientStep_PartialUpdate, "LbsClientStep_PartialUpdate");
+
+class CT_LbsClientStep_PartialUpdate : public CT_LbsNetSimStep,	MT_LbsDoPosUpdateObserver
+	{
+public:
+	~CT_LbsClientStep_PartialUpdate();
+
+	static CT_LbsClientStep_PartialUpdate* New(CT_LbsClientServer& aParent);
+	virtual TVerdict doTestStepL();
+
+	// From MLbsNetSimTestObserver.	
+	virtual void Connected();
+	virtual void NotifyRegisterLcsMoLr(const TDesC& aData);
+	virtual void NotifyReleaseLcsMoLr(TInt aReason);
+	virtual void NotifyMeasurementControlLocation(const TPositionInfo& aPosition, const RLbsAssistanceDataBuilderSet& aData, const TLbsNetPosRequestQuality& aQuality);
+	virtual void NotifyMeasurementReportLocation(const TPositionInfo& aPosition);
+	virtual void NotifyFacilityLcsMoLrResult(TInt aReason, const TPositionInfo& aPosition);
+
+	void MT_LbsDoPosUpdateCallback(TRequestStatus& aStatus);
+
+private:
+	CT_LbsClientStep_PartialUpdate(CT_LbsClientServer& aParent);
+	void ConstructL();
+
+	TInt OpenNetSim();
+	void CloseNetSim();
+	void VerifyPosInfos();
+
+private:
+
+	enum TPosUpdateStatus 
+		{
+		EPositionUpdateStart,
+		EPositionUpdateContinue,
+		EPositionUpdateComplete
+		};
+
+	
+	TInt iTestCaseId;
+	TPosUpdateStatus iPosUpdateStatus;
+
+	CT_LbsDoPosUpdate* iDoPosUpdatePtr;
+    CT_LbsClientServer& iParent;
+
+	TPositionInfo*	iPosInfoPtr1;
+	TPositionInfo*	iPosInfoPtr2;
+	TPosition 		iRefPos;
+	
+	};
+
+#endif //__CT_LBS_CLIENT_PARTIALUPDATE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientstepsrvconnectclose.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,40 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsClientStep_SrvConnectClose.h
+// This contains the header file for Server Connect Close Tests
+// 
+//
+
+#ifndef __CT_LBS_CLIENT_STEP_SRV_CONNECT_CLOSE_H__
+#define __CT_LBS_CLIENT_STEP_SRV_CONNECT_CLOSE_H__
+
+#include "ctlbsclientstep.h"
+#include "ctlbsclientserver.h"
+
+// Literals used
+_LIT(KLbsClientStep_SrvConnectClose, "LbsClientStep_SrvConnectClose");
+
+class CT_LbsClientStep_SrvConnectClose : public CT_LbsClientStep
+	{
+public:
+	~CT_LbsClientStep_SrvConnectClose();
+
+	static CT_LbsClientStep_SrvConnectClose* New(CT_LbsClientServer& aParent);
+	virtual TVerdict doTestStepL();
+
+private:
+	CT_LbsClientStep_SrvConnectClose(CT_LbsClientServer& aParent);
+	};
+
+#endif //__CT_LBS_CLIENT_STEP_SRV_CONNECT_CLOSE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientstepsrvversion.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,43 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsClientStep_SrvVersion.h
+// This contains the header file for Server Version Tests
+// 
+//
+
+#ifndef __CT_LBS_CLIENT_STEP_SRV_VERSION_H__
+#define __CT_LBS_CLIENT_STEP_SRV_VERSION_H__
+
+#include "ctlbsclientstep.h"
+#include "ctlbsclientserver.h"
+
+// Literals used
+_LIT(KLbsClientStep_SrvVersion, "LbsClientStep_SrvVersion");
+
+class CT_LbsClientStep_SrvVersion : public CT_LbsClientStep
+	{
+public:
+	~CT_LbsClientStep_SrvVersion();
+
+	static CT_LbsClientStep_SrvVersion* NewL(CT_LbsClientServer& aParent);
+	static CT_LbsClientStep_SrvVersion* New(CT_LbsClientServer& aParent);
+
+	virtual TVerdict doTestStepL();
+
+private:
+	CT_LbsClientStep_SrvVersion(CT_LbsClientServer& aParent);
+
+	};
+
+#endif //__CT_LBS_CLIENT_STEP_SRV_VERSION_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientsteptracking.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,75 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsClientTracking.h
+// This contains the header file for Tracking Tests
+// 
+//
+
+#ifndef __CT_LBS_CLIENT_TRACKING_H__
+#define __CT_LBS_CLIENT_TRACKING_H__
+
+#include "ctlbsclientstep.h"
+#include "ctlbsclientserver.h"
+
+#include <ctlbsagpshandler.h>
+
+// Literals used
+_LIT(KLbsClientStep_Tracking, "LbsClientStep_Tracking");
+
+class CT_LbsClientStep_Tracking : public CT_LbsClientStep, MT_ResponseObserver
+	{
+public:
+	~CT_LbsClientStep_Tracking();
+
+	static CT_LbsClientStep_Tracking* New(CT_LbsClientServer& aParent);
+	virtual TVerdict doTestStepL();
+
+	// from MT_ResponseObserver
+	virtual void ProcessAGpsResponseMessage(const TT_LbsAGpsResponseMsg::TModuleResponseType aResponse);
+		
+private:
+	CT_LbsClientStep_Tracking(CT_LbsClientServer& aParent);
+	void ConstructL();
+	
+	TBool VerifyFirstPosTime(const TTime& aTimeRequested, const TPositionInfo& aPosInfo, const TPositionUpdateOptions& aUpdateOpts);
+	TBool VerifyPosTime(const TTime& aTimeFirstPosReceived, const TPositionUpdateOptions& aUpdateOpts, TPositionInfo& aPosInfo, TInt aPosCount);
+
+	void DoTestCase();
+	
+	void DoInterval_TestCaseId_01();
+	void DoInterval_TestCaseId_02();
+	void DoInterval_TestCaseId_03();
+	void DoInterval_TestCaseId_04();
+	void DoInterval_TestCaseId_05();
+	void DoInterval_TestCaseId_06();
+	void DoInterval_TestCaseId_07();
+	void DoInterval_TestCaseId_08();
+	
+	void ConfigureModuleTimeOut(TTimeIntervalMicroSeconds& aTimeOut);
+		
+private:
+
+	TInt iVerifyInterval;
+	TInt iExpectedErr;
+	TInt iUpdateIndex;
+	TInt iUpdateWindowIndex;
+	TPositionUpdateOptions iUpdateOpts;
+	TPositionInfo iPosInfo;
+
+ 	TBool iCheckIfSameAsPreviousPosition;
+ 	TPositionInfo iPreviousPos;
+ 	TBool iSameAsPreviousPos;
+	};
+
+#endif //__CT_LBS_CLIENT_TRACKING_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/ctlbsclientstepupdateoptions.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,58 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsClientUpdateOptions.h
+// This contains the header file for  Update Options Tests
+// 
+//
+
+#ifndef __CT_LBS_CLIENT_UPDATEOPTIONS_H__
+#define __CT_LBS_CLIENT_UPDATEOPTIONS_H__
+
+#include "ctlbsclientstep.h"
+#include "ctlbsclientserver.h"
+#include <lbsadmin.h>
+
+
+// Literals used
+_LIT(KLbsClientStep_UpdateOptions, "LbsClientStep_UpdateOptions");
+
+class CT_LbsClientStep_UpdateOptions : public CT_LbsClientStep
+	{
+public:
+	~CT_LbsClientStep_UpdateOptions();
+
+	static CT_LbsClientStep_UpdateOptions* New(CT_LbsClientServer& aParent);
+	virtual TVerdict doTestStepL();
+		
+private:
+	CT_LbsClientStep_UpdateOptions(CT_LbsClientServer& aParent);
+	
+	void CT_LbsClientStep_UpdateOptions::TempSetRequestorL();
+	TBool CT_LbsClientStep_UpdateOptions::CompareUpdateOptions(TPositionUpdateOptions aPosA, TPositionUpdateOptions aPosB);
+	
+	TBool VerifyFirstPosTime(const TTime& aTimeRequested, const TPositionInfo& aPosInfo, const TPositionUpdateOptions& aUpdateOpts);
+	TBool VerifyPosTime(const TTime& aTimeFirstPosReceived, const TPositionUpdateOptions& aUpdateOpts, TPositionInfo& aPosInfo, TInt aPosCount);
+
+	
+private:
+
+	// to allow changing admin settings:
+	CLbsAdmin*	iLbsAdmin;
+
+	TBool	iRequestedAssData;
+	TBool	iReceivedAssData;
+		
+	};
+
+#endif //__CT_LBS_CLIENT_UPDATEOPTIONS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/inc/tctlbsclientmodulesobserver.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __TCT_LBS_CLIENT_MODULES_OBSERVER_H__ 
+#define __TCT_LBS_CLIENT_MODULES_OBSERVER_H__
+
+//  INCLUDES
+#include "EPos_MPosModulesObserver.h"
+
+// CLASS DECLARATION
+
+/**
+*  ?one_line_short_description.
+*  ?other_description_lines
+*/
+class TCT_LbsClientModulesObserver :public MPosModulesObserver
+    {
+    public:  // Functions from base classes
+
+        /**
+        * From MPosModulesDbObserver
+        */
+        inline void HandleSettingsChangeL(
+        /* IN  */       TPosModulesEvent /*aEvent*/
+        ){CActiveScheduler::Stop();};
+
+
+    };
+
+#endif      // __TCT_LBS_CLIENT_MODULES_OBSERVER_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/lbsexeclient/group/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,20 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_TESTMMPFILES
+ctlbsexeclient.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/lbsexeclient/group/ctlbsexeclient.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,37 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+TARGET        	ctlbsexeclient.exe
+TARGETTYPE    	exe
+UID           	0 0x03a157b5
+CAPABILITY		ALL -TCB
+VENDORID		0x70000001
+
+EPOCSTACKSIZE 	0x5000
+
+MACRO __LBS_VARIANT2
+
+SOURCEPATH    	../src
+
+SOURCE			ctlbsexeclient.cpp
+
+SYSTEMINCLUDE 	/epoc32/include
+SYSTEMINCLUDE 	/epoc32/include/lbs
+SYSTEMINCLUDE 	/epoc32/include/lbs/test
+
+LIBRARY 		euser.lib
+LIBRARY 		lbs.lib	
+LIBRARY 		efsrv.lib 
+LIBRARY 		eposmodset.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/lbsexeclient/src/ctlbsexeclient.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,254 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+#include <e32base.h>
+#include <f32file.h>
+#include <LbsPositionInfo.h>
+#include <Lbs.h>
+#include <LbsCommon.h>
+#include <LbsRequestor.h>
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+
+TInt DoTestL();
+
+TInt TestMainL()
+    {
+     // Create and install the active scheduler 
+    CActiveScheduler* exampleScheduler=new (ELeave) CActiveScheduler; 
+    CleanupStack::PushL(exampleScheduler); 
+    CActiveScheduler::Install(exampleScheduler); 
+    // Call function
+    TInt result = DoTestL();  
+    CleanupStack::PopAndDestroy(exampleScheduler);
+    return result;
+    }
+
+void TraceL(const TDesC& aMsg, RFile& aFile) 
+    {
+    const TInt KBufSize = 200;
+    TBuf8<KBufSize> tmp;
+    tmp.Copy(aMsg);
+    _LIT(KEnd,";\r\n");
+    tmp.Append(KEnd);
+    aFile.Write(tmp);
+    }
+
+/**
+* Setup PSY
+*/
+void SetupPsyL(const TUid aPsyUid)
+    {
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+
+    CPosModuleUpdate* enable = CPosModuleUpdate::NewLC();
+    CPosModuleUpdate* disable = CPosModuleUpdate::NewLC();
+
+    disable->SetUpdateAvailability(EFalse);
+    enable->SetUpdateAvailability(ETrue);
+
+    CPosModuleIdList* prioList = db->ModuleIdListLC();
+
+    for (TInt i = 0 ; i < prioList->Count(); i++)
+        {
+        if ((*prioList)[i] != aPsyUid)
+            {
+            // Disable all PSYs except one given as parameter
+            db->UpdateModuleL((*prioList)[i], *disable);
+            }
+        else
+            {
+            // Enable the PSY that came as an in parameter
+            db->UpdateModuleL((*prioList)[i], *enable);
+            }
+        }
+
+    CleanupStack::PopAndDestroy(prioList);
+    CleanupStack::PopAndDestroy(disable);
+    CleanupStack::PopAndDestroy(enable);
+    CleanupStack::PopAndDestroy(db);
+    }
+
+/**
+* Method used to generate a file name for trace.
+* If a trace file exist an index number i counted
+* one step until a trace file can be created.
+* Maximun number of exe client are currently hard
+* coded to 10;
+*/
+TBuf<40> GenerateFileNameForTraceL()
+    {
+    _LIT(KFileTrace, "c:\\logs\\execlientresult%d.txt");
+    RFs fileserver;
+    RFile file;
+    User::LeaveIfError(fileserver.Connect());
+    TBuf<40> ff;
+    ff.Append(KFileTrace);
+ 
+    for (TInt i = 1; i<10;i++) 
+        {
+        ff.Format(KFileTrace,i);
+        TInt err = file.Open(fileserver,ff, EFileWrite);
+        if (err == KErrNotFound) 
+            {
+            User::LeaveIfError(file.Create(fileserver,ff, EFileWrite));
+            break;
+            }
+        }
+    file.Close();
+    fileserver.Close();
+    return ff;
+}
+
+/**
+* Error checking and output error to Trace File.
+*/
+void AssertTrueL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode, RFile& aFile)
+  {
+  if (!aCondition)
+		{
+		TBuf<100> buf;
+		buf.Format(aErrorMsg, aErrorCode);
+		TraceL(buf, aFile);
+        //User::Leave(aErrorCode);
+		}
+  }
+
+/**
+* Performes the test by connecting to MLFW and makes 50 Location request
+*/
+TInt DoTestL()
+    {
+    TBuf<40> traceFile = GenerateFileNameForTraceL();
+
+    RFs fileserver;
+    RFile file;
+    User::LeaveIfError(fileserver.Connect());
+    CleanupClosePushL(fileserver);
+    User::LeaveIfError(file.Open(fileserver, traceFile, EFileWrite));
+    CleanupClosePushL(file);
+    _LIT(KClientStarted, "Client Started");
+    TraceL(KClientStarted, file);
+
+    const TInt32 KUidMultiPsy = 0x01010176;
+    TUid uidMultiPsy;
+    uidMultiPsy.iUid = KUidMultiPsy;      
+	SetupPsyL(uidMultiPsy);
+
+    _LIT(KMultiPsySetup, "MultiPsy set up");
+    TraceL(KMultiPsySetup, file);
+
+	TInt numberOfRuns = 50;
+    
+    RPositionServer	posServer;
+    CleanupClosePushL(posServer);
+    RPositioner positioner;
+    CleanupClosePushL(positioner);
+    TPositionInfo positionInfo = TPositionInfo();
+
+	_LIT(KConnectErr, "ERROR: Error when connecing to EPos server,  %d");
+	TInt err = posServer.Connect();
+	AssertTrueL(err == KErrNone, KConnectErr, err, file);
+
+	_LIT(KOpenErr, "ERROR: Error when opening positioner,  %d");
+	err = positioner.Open(posServer, uidMultiPsy);
+	AssertTrueL(err == KErrNone, KOpenErr, err, file);
+
+    _LIT(KService ,"Service");
+	err = positioner.SetRequestor(CRequestor::ERequestorService,
+							 CRequestor::EFormatApplication, KService);
+    _LIT(KRequestor, "ERROR: Not possible to set requestor");
+    AssertTrueL(err == KErrNone, KRequestor, err, file);
+    
+    TTime now, startTime;
+    TTimeIntervalMicroSeconds requestTime;
+    TRequestStatus status;
+    TInt64 reqTime;
+    TCoordinate corr(0,0,0);
+    TLocality loca(corr,0);
+    TPosition pos(loca, TTime(0));
+    TBool success = ETrue;
+    _LIT(KStartingRequests, "Starting requests");
+    TraceL(KStartingRequests, file);
+
+    for (TInt i = 0; i < numberOfRuns; i++)
+        {
+        startTime.UniversalTime();
+        positionInfo.SetPosition(pos);
+        positioner.NotifyPositionUpdate(positionInfo, status);
+        User::WaitForRequest(status);
+        err = status.Int();
+        if (err != KErrNone)
+            {
+            success=EFalse;
+            }
+        now.UniversalTime();
+        requestTime = now.MicroSecondsFrom(startTime);
+        _LIT(KError, "Request time, %d µs. Error code from Notify = %d");
+        TBuf<100> buf;
+        reqTime = requestTime.Int64();
+        buf.Format(KError, reqTime, err);
+        TraceL(buf, file);
+        TPosition result;
+        positionInfo.GetPosition(result);
+        // Sanity check
+        if (result.Latitude() == pos.Latitude() ||
+		    result.Longitude() == pos.Longitude() ||
+		    result.Altitude() == pos.Altitude())
+            {
+             success = EFalse;
+             _LIT(KErrorPositon, "ERROR:: The postion was not updated");
+             TraceL(KErrorPositon, file);
+            }
+        }
+    
+    CleanupStack::PopAndDestroy(&positioner);
+    CleanupStack::PopAndDestroy(&posServer);
+
+    if (success)
+        {
+        _LIT(KOk, "SUCCESS");
+        TraceL(KOk, file);
+        }
+    else
+        {
+        _LIT(KErr, "FAILED");
+        TraceL(KErr, file);
+        }
+
+    CleanupStack::PopAndDestroy(&file);
+    CleanupStack::PopAndDestroy(&fileserver);
+    
+    return (success) ? 0 : 1;
+    }
+
+// Cleanup stack harness
+GLDEF_C TInt E32Main()
+    {
+    __UHEAP_MARK;
+    CTrapCleanup* cleanupStack = CTrapCleanup::New();
+    TInt result = 1;
+    TRAPD(error, result = TestMainL());
+    _LIT(KLbsExeClient, "CT Lbs Exe Client");
+    __ASSERT_ALWAYS(!error, User::Panic(KLbsExeClient, error));
+    delete cleanupStack;
+    __UHEAP_MARKEND;
+    return result;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/scripts/setup_smoketest_lbs.script	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,22 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+RUN_UTILS MkDir			c:\smoketest\
+
+RUN_UTILS CopyFile 		z:\smoketest\smoketest_lbs.ini	c:\smoketest\smoketest_lbs.ini
+RUN_UTILS MakeReadWrite	c:\smoketest\smoketest_lbs.ini
+RUN_UTILS CopyFile 		z:\smoketest\smoketest_lbs.script	c:\smoketest\smoketest_lbs.script
+RUN_UTILS MakeReadWrite	c:\smoketest\smoketest_lbs.script
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/scripts/smoketest_lbs.script	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,37 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRINT Run LBS smoketest
+
+LOAD_SUITE LbsClientTestServer -SharedData
+WAIT 1000
+
+START_TESTCASE			SMOKE_LBS_0001
+//!	@SYMTestCaseID		SMOKE_LBS_0001
+//!	@SYMTestCaseDesc	Request module count (use GetNumModules) 
+//!						and ensure a count of 2 is returned to indicate the correct
+//!						number of modules is installed (Network and A-GPS modules).
+
+PRINT Run LbsClientTestServer
+
+RUN_TEST_STEP 010 LbsClientTestServer LbsStep_ResetDefaultAdmin 
+RUN_TEST_STEP 030 LbsClientTestServer LbsStep_StartLbs
+
+RUN_TEST_STEP 010 LbsClientTestServer LbsStep_InstallScheduler
+RUN_TEST_STEP 20 LbsClientTestServer LbsClientStep_ModInfo c:\smoketest\smoketest_lbs.ini LBS-Mod-Cnt-0001
+
+RUN_TEST_STEP 030 LbsClientTestServer LbsStep_StopLbs
+
+END_TESTCASE SMOKE_LBS_0001
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclienteventtimer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,168 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+// INCLUDE FILES
+#include "ctlbsclienteventtimer.h"
+#include "mctlbsrequestobserver.h"
+#include <coemain.h>
+#include "ctlbsclientrequestor.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CT_LbsClientEventTimer::CT_LbsClientEventTimer()
+	: CActive(EActivePriorityDefault),	
+	iTimer(),
+	iObserver(NULL),
+	iCompletionCode(KNoEvent)
+    {
+    }
+
+// EPOC default constructor can leave.
+void CT_LbsClientEventTimer::ConstructL(CTestExecuteLogger& aLogger)
+	{
+	iLogger = aLogger;
+    User::LeaveIfError(iTimer.CreateLocal());
+	CActiveScheduler::Add(this);
+    }
+
+// Two-phased constructor.
+CT_LbsClientEventTimer* CT_LbsClientEventTimer::NewL(CTestExecuteLogger& aLogger)
+    {
+	CT_LbsClientEventTimer* self = NewLC(aLogger);
+	CleanupStack::Pop();
+	return self;
+    }
+
+// Two-phased constructor.
+CT_LbsClientEventTimer* CT_LbsClientEventTimer::NewLC(CTestExecuteLogger& aLogger)
+    {
+	CT_LbsClientEventTimer* self =
+		new (ELeave) CT_LbsClientEventTimer(); 
+	CleanupStack::PushL(self); // push to clean-up stack
+	self->ConstructL(aLogger); // construct
+	return self; // return new object
+    }
+
+// Destructor
+CT_LbsClientEventTimer::~CT_LbsClientEventTimer()
+    {
+    iObserver = NULL;
+	Cancel();
+	iTimer.Close();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientEventTimer::SetObserver
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+// 
+void CT_LbsClientEventTimer::SetObserver(MCT_LbsRequestObserver* aObserver)
+    {
+    iObserver = aObserver;
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientEventTimer::CompletionCode
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt CT_LbsClientEventTimer::CompletionCode() const
+    {
+    return iCompletionCode;
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientEventTimer::ResetCompletionCode
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientEventTimer::ResetCompletionCode()
+	{
+	iCompletionCode = KNoEvent;
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientEventTimer::Start
+// starts the RTimer
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientEventTimer::Start(TInt aTimeout)
+    {
+	iTimer.After(iStatus, aTimeout);
+	SetActive();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientEventTimer::DoCancel
+// cancels the RTimer
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientEventTimer::DoCancel()
+    {
+	iTimer.Cancel();
+    }
+
+// ---------------------------------------------------------
+// CPosNotifierTimer::RunL
+// report a timeout to the observer
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientEventTimer::RunL()
+    {
+	iCompletionCode = iStatus.Int();
+	RequestComplete();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientEventTimer::RunError
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt CT_LbsClientEventTimer::RunError(TInt /*aError*/)
+    {
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientEventTimer::RequestComplete
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientEventTimer::RequestComplete()
+    {
+	if (iObserver)
+        {
+        TRAPD(err, iObserver->RequestCompleteL());
+        if(KErrNone != err)
+        	{
+        	_LIT(KRequestCompleteError, "Error in LbsRequester: %d");
+        	ERR_PRINTF2(KRequestCompleteError, err);
+        	}
+        }
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientgetlkpao.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,99 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TODO - should this be moved somewhere more central (testutils, say)?
+// 
+//
+
+
+
+/**
+ @file ctlbsclientgetlkpao.cpp
+*/
+
+#include "ctlbsclientgetlkpao.h"
+#include <lbs.h>
+
+_LIT(KGetLastKnownPosAO, "GetLastKnownPosAO");
+
+CT_LbsClientGetLastKnownPosAO::~CT_LbsClientGetLastKnownPosAO()
+/**
+ * 	Destructor
+ */
+	{
+	Cancel();
+	}
+	
+		
+
+CT_LbsClientGetLastKnownPosAO::CT_LbsClientGetLastKnownPosAO(MT_GetLastKnownPosObserver& aCaller) : CActive(EPriorityIdle), iCaller(aCaller)
+/**
+ * 	Constructor - will not leave
+ */
+ 	{ 	
+ 	CActiveScheduler::Add(this);
+	}
+
+
+CT_LbsClientGetLastKnownPosAO* CT_LbsClientGetLastKnownPosAO::NewL(MT_GetLastKnownPosObserver& aUser)
+/**
+ *	'public constructor' may leave
+ */
+	{
+	CT_LbsClientGetLastKnownPosAO* self = new(ELeave)CT_LbsClientGetLastKnownPosAO(aUser);
+	
+	return self;
+	}
+	
+	
+void CT_LbsClientGetLastKnownPosAO::GetLastKnownPosL(RPositioner& aPositioner, TPositionInfo& aPosInfo)
+/**
+ * 	wrapper for async positioner function GetLastKnownPosition(). 
+ *  Will panic if there's another outstanding request.
+ */
+	{	
+	__ASSERT_ALWAYS(!IsActive(), User::Panic(KGetLastKnownPosAO, KErrInUse));
+	
+	iPositioner = aPositioner;
+	
+	// TO DO: this requestor stuff will be removed when we're using the real Location Server:
+	User::LeaveIfError(iPositioner.SetRequestor(	CRequestor::ERequestorService,
+												CRequestor::EFormatApplication,
+												_L("Tom Tom")));
+	
+	iRequestId = EPositionerGetLastKnownPosition;	// required for cancel
+	
+	// Make async call
+	aPositioner.GetLastKnownPosition(aPosInfo, iStatus);
+	
+	// Let the active scheduler know we're waiting (active)
+	SetActive();
+	}
+	
+void CT_LbsClientGetLastKnownPosAO::DoCancel()
+	{	
+	iPositioner.CancelRequest(iRequestId);
+	}
+ 
+void CT_LbsClientGetLastKnownPosAO::RunL()
+	{
+	// iStatus will contain error code eg KErrUnknown if no position cached
+	// async request completed. Notify caller via callback:
+	iCaller.GetLastKnownPositionCallback(iStatus);
+	}
+
+TInt CT_LbsClientGetLastKnownPosAO::RunError(TInt aError)
+	{	// called if RunL leaves. aError contains the error code
+	return aError;
+	}
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientnotifyposupdao.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,102 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is the class implementation for the Notify position update tests
+// TODO - should this be moved somewhere more central (testutils, say)?
+// 
+//
+
+
+
+/**
+ @file ctlbsclientnotifyposupdao.cpp
+*/
+
+#include "ctlbsclientnotifyposupdao.h"
+#include <lbs.h>
+#include <lbsadmin.h>
+
+_LIT(KNotifyPosUpdAO, "NotifyPosUpdAO");
+
+CT_LbsClientNotifyPosUpdAO::~CT_LbsClientNotifyPosUpdAO()
+/**
+ * 	Destructor
+ */
+	{
+	Cancel();
+	}
+	
+		
+
+CT_LbsClientNotifyPosUpdAO::CT_LbsClientNotifyPosUpdAO(MT_NotifyPosUpdateObserver& aCaller) : CActive(EPriorityIdle), iCaller(aCaller)
+/**
+ * 	Constructor - will not leave
+ */
+ 	{ 	
+ 	CActiveScheduler::Add(this);
+	}
+
+
+CT_LbsClientNotifyPosUpdAO* CT_LbsClientNotifyPosUpdAO::NewL(MT_NotifyPosUpdateObserver& aCaller)
+/**
+ *	'public constructor' may leave
+ */
+	{
+	CT_LbsClientNotifyPosUpdAO* me = new(ELeave)CT_LbsClientNotifyPosUpdAO(aCaller);
+	
+	return me;
+	}
+	
+	
+void CT_LbsClientNotifyPosUpdAO::NotifyPosUpdateL(RPositioner& aPositioner, TPositionInfo& aPosInfo)
+/**
+ * 	wrapper for async positioner function NotifyPositionUpdate(). 
+ *  Will panic if there's another outstanding request.
+ */
+	{	
+	__ASSERT_ALWAYS(!IsActive(), User::Panic(KNotifyPosUpdAO, KErrInUse));
+	
+	iPositioner = aPositioner;
+	iRequestId = EPositionerNotifyPositionUpdate;	// required for cancel
+	
+	// TO DO: this requestor stuff will be removed when we're using the real Location Server:
+	User::LeaveIfError(iPositioner.SetRequestor(CRequestor::ERequestorService,
+												CRequestor::EFormatApplication,
+												_L("Tom Tom")));
+	
+	
+	// Make async call
+	aPositioner.NotifyPositionUpdate(aPosInfo, iStatus);
+	
+	// Let the active scheduler know we're waiting (active)
+	SetActive();
+	}
+	
+void CT_LbsClientNotifyPosUpdAO::DoCancel()
+	{	
+	TInt err = iPositioner.CancelRequest(iRequestId);
+	}
+	
+ 
+void CT_LbsClientNotifyPosUpdAO::RunL()
+	{
+	// iStatus will contain error code eg KErrUnknown if no position cached
+	// async request completed. Notify caller via callback:
+	iCaller.NotifyPositionUpdateCallback(iStatus);
+	}
+
+TInt CT_LbsClientNotifyPosUpdAO::RunError(TInt aError)
+	{	// called if RunL leaves. aError contains the error code
+	return aError;
+	}
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientobserver.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,153 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+// INCLUDE FILES
+#include    "ctlbsclientobserver.h"
+
+
+// CONSTANTS
+// Apparently the EposServer name is same on WINS and ARMI
+_LIT(KEPosServerName, "!PosServer");
+
+_LIT(KPrivacyServerName, "eposprivsrv"); // TBD: Is this name OK?
+
+// ================= MEMBER FUNCTIONS =======================
+
+
+// ---------------------------------------------------------
+// CT_LbsClientObserver::WaitForEPosShutdown
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientObserver::WaitForEPosShutdown()
+    {
+    WaitForProcessDeath(KEPosServerName);
+    }
+
+void EPosShutdownWaitCleanupItem(TAny*)
+    {
+    CT_LbsClientObserver::WaitForEPosShutdown();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientObserver::EPosShutdownWaitPushL
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientObserver::EPosShutdownWaitPushL()
+    {
+    CleanupStack::PushL(TCleanupItem(EPosShutdownWaitCleanupItem));
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientObserver::EPosAliveL
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TBool CT_LbsClientObserver::EPosAliveL()
+    {
+    return ProcessAliveL(KEPosServerName);
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientObserver::WaitForPrivacyServerShutdown
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientObserver::WaitForPrivacyServerShutdown()
+    {
+    WaitForProcessDeath(KPrivacyServerName);
+    }
+
+void PrivacyServerShutdownWaitCleanupItem(TAny*)
+    {
+    CT_LbsClientObserver::WaitForPrivacyServerShutdown();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientObserver::PrivacyServerShutdownWaitPushL
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientObserver::PrivacyServerShutdownWaitPushL()
+    {
+    CleanupStack::PushL(TCleanupItem(PrivacyServerShutdownWaitCleanupItem));
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientObserver::PrivacyServerAliveL
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TBool CT_LbsClientObserver::PrivacyServerAliveL()
+    {
+    return ProcessAliveL(KPrivacyServerName);
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientObserver::WaitForProcessDeath
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientObserver::WaitForProcessDeath(const TDesC& aProcessName)
+    {
+#ifdef __WINS__
+    RThread process;
+#else
+    RProcess process;
+#endif
+
+    if (process.Open(aProcessName))
+        {
+        return;
+        }
+
+    TRequestStatus status;
+    process.Logon(status);
+    User::WaitForRequest(status);
+
+    process.Close();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientObserver::ProcessAliveL
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TBool CT_LbsClientObserver::ProcessAliveL(const TDesC& aProcessName)
+    {
+	TFindServer find(aProcessName);
+    TFullName   name;
+    if (find.Next(name) == KErrNone) // server found
+		{
+		return ETrue;
+		}
+	else 
+		{
+		return EFalse;
+		}
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientperiodictester.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,457 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+// INCLUDE FILES
+#include "ctlbsclientperiodictester.h"
+#include "ctlbsclientlog.h"
+
+// CONSTANTS
+const TInt KSmallestUpdateIntervalToLog = 4000000; //2000000
+const TInt KMilliSecondTolerance = 2500000; //One second
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPeriodicTester::CPeriodicTester
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CT_LbsClientPeriodicTester::CT_LbsClientPeriodicTester() : CActive(CActive::EPriorityHigh), iError(EFalse), iErrorCode(KErrNone)
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPeriodicTester::ConstructL
+//
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CT_LbsClientPeriodicTester::ConstructL(
+	TTimeIntervalMicroSeconds aInterval, 
+	const TDesC& aServiceName, 
+	CT_LbsClientLog* aLog,
+	TUid aUid,
+	TInt aNumberOfRuns)
+    {
+    iLog = aLog;
+	iName = aServiceName;
+	iNumberOfRuns = aNumberOfRuns;
+	iInterval = aInterval;
+	iUid = aUid;
+	iNumberOfUpdates = 0;
+    iPrematureChangeOfParameters = EFalse;
+    iCanceledRequest = EFalse;
+    iCancelRequest = EFalse;
+    iWriteToLog = ETrue; //EFalse
+	iRecentTime = TTime(0);
+	iPositionInfo = TPositionInfo();
+
+	_LIT(KConnectErr, "Error when connecing to EPos server,  %d");
+	TInt err = iPosServer.Connect();
+	AssertTrueL(err == KErrNone, KConnectErr, err);
+
+	_LIT(KOpenErr, "Error when opening positioner,  %d");
+	err = iPositioner.Open(iPosServer, aUid);
+	AssertTrueL(err == KErrNone, KOpenErr, err);
+
+	TPositionUpdateOptions posOption;
+	posOption.SetUpdateInterval(aInterval);
+	
+	_LIT(KUpdateErr, "Error when setting update interval,  %d");
+	err = iPositioner.SetUpdateOptions(posOption);
+	AssertTrueL(err == KErrNone, KUpdateErr, err);
+
+	iPositioner.SetRequestor(CRequestor::ERequestorService,
+							 CRequestor::EFormatApplication, aServiceName);
+	
+	CActiveScheduler::Add(this);
+	}
+
+// -----------------------------------------------------------------------------
+// CPeriodicTester::NewL
+//
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CT_LbsClientPeriodicTester* CT_LbsClientPeriodicTester::NewL(
+	TTimeIntervalMicroSeconds aInterval,
+	const TDesC& aServiceName,
+	CT_LbsClientLog* aLog,
+	TUid aUid,
+	TInt aNumberOfRuns)
+    {
+    CT_LbsClientPeriodicTester* self = new( ELeave ) CT_LbsClientPeriodicTester;
+    
+    CleanupStack::PushL(self);
+    self->ConstructL(aInterval, aServiceName, aLog, aUid, aNumberOfRuns);
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+    
+// Destructor
+CT_LbsClientPeriodicTester::~CT_LbsClientPeriodicTester()
+    {
+    iPositioner.Close();
+	iPosServer.Close();
+	
+	iLog = NULL;
+	}
+
+// -----------------------------------------------------------------------------
+// CPeriodicTester::RunL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CT_LbsClientPeriodicTester::RunL()
+    {
+	iNumberOfUpdates++;
+    //User::Leave(-10); //used for testing the test code
+	TBuf<175> buf;
+	_LIT(KStatus,"Status invalid in RunL, status = %d");
+	buf.Format(KStatus, iStatus.Int());
+	AssertTrueL((iStatus == KErrNone || iStatus == KPositionQualityLoss || 
+                 iStatus == KErrCancel), buf, iStatus.Int());
+	if(iNumberOfUpdates <= iNumberOfRuns)
+		{
+		_LIT(KTime, "%F%H:%F%T:%F%S:%F%*C3");
+		TBuf<100> time;
+		TTime now;
+		now.UniversalTime();
+		TInt difference;
+		TInt smallestIntervalToLog = KSmallestUpdateIntervalToLog;
+		if(iNumberOfUpdates == 1)
+			{
+            difference = I64LOW(now.MicroSecondsFrom(iRecentTime).Int64());
+			}
+		else
+			{
+			difference = I64LOW(now.MicroSecondsFrom(iRecentTime).Int64());
+			}
+		
+        _LIT(KInterval, "The interval is %d, and the difference is %d");
+        TBuf<150> buf; 
+        buf.Format(KInterval,iInterval.Int64(), difference); 
+        iLog->Put (buf);
+		if((iInterval.Int64() > smallestIntervalToLog) && (I64LOW(iRecentTime.Int64()) != 0))
+			{
+			_LIT(KTimeErr, "ERROR: Time difference greater than tolerated interval, time difference = %d");
+			AssertTrueL(difference < (iInterval.Int64() +  KMilliSecondTolerance), KTimeErr, I64LOW(now.MicroSecondsFrom(iRecentTime).Int64()));
+            
+            if(difference < 0)
+				{
+                #ifdef __WINS__
+                _LIT(KEarlyErr, "ERROR: Negative time difference on WINS greater than 0.4s");
+                AssertTrueL((KToleratedEarliness > -(difference)), KEarlyErr, KErrTotalLossOfPrecision);
+                #else
+                _LIT(KEarlyErr, "ERROR: Time difference negative on target");
+				iLog->Put(KEarlyErr);
+				User::LeaveIfError(KErrTotalLossOfPrecision);
+                #endif
+
+				}
+			}
+
+		if(iWriteToLog && ((iNumberOfUpdates % KTracePeriod) == 0))
+            {
+		    now.UniversalTime();
+		    now.FormatL(time, KTime);
+    		_LIT(KLog, "Client got update no. %d at %S,  Time-diff = %d, Status = ");
+    		TBuf<175> buf;
+    		buf.Format(KLog, iNumberOfUpdates, &time, difference);
+    		buf.AppendNum(iStatus.Int());
+    		buf.Append(iName);
+    		_LIT(KNrOfRuns, "Nr of runs = ");
+            buf.Append(KNrOfRuns);
+            buf.AppendNum(iNumberOfRuns);
+            iLog->Put(buf);
+            }
+		
+		if(iPrematureChangeOfParameters)
+			{
+			iInterval = TTimeIntervalMicroSeconds(2000000);
+			User::After(I64LOW(iInterval.Int64()));
+	
+			TPositionUpdateOptions posOption;
+			posOption.SetUpdateInterval(iInterval);
+	
+			TInt err = iPositioner.SetUpdateOptions(posOption);
+			_LIT(KChange, "ERROR: Got error code when setting update options prematurely in ChangeTestParameters");
+			AssertTrueL(err == KErrNone, KChange, err);
+			iPrematureChangeOfParameters = EFalse;
+			}
+		
+		RequestNotification();
+            
+        if(iCancelRequest)
+			{
+			User::After(3000000);
+			iPositioner.CancelRequest(EPositionerNotifyPositionUpdate);
+			iCancelRequest = EFalse;
+            iCanceledRequest = ETrue;
+			}
+     
+        if(iCanceledRequest)
+            {
+            iCanceledRequest = EFalse;
+            _LIT(KCancelErr, "ERROR: Status was not KErrCancel after CancelRequest");
+			AssertTrueL(iStatus.Int() == KErrCancel, KCancelErr, KErrCancel);
+            }
+        }
+	else 
+		{
+		CActiveScheduler::Stop();
+		}
+		
+	}
+
+
+// -----------------------------------------------------------------------------
+// CT_LbsClientPeriodicTester::RunError
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CT_LbsClientPeriodicTester::RunError(TInt aError)
+    {
+    iError = ETrue;
+    iErrorCode = aError;
+    CActiveScheduler::Stop();
+    _LIT(KErrorInRunL, "Error code in RunError is, %d");
+    TBuf<100> buf;
+    buf.Format(KErrorInRunL, aError);
+    iLog -> Put(buf);
+    return KErrNone;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CT_LbsClientPeriodicTester::IsCompletedOK
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CT_LbsClientPeriodicTester::IsCompletedOK()
+    {
+    return !iError;
+    }
+
+// -----------------------------------------------------------------------------
+// CT_LbsClientPeriodicTester::GetError
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CT_LbsClientPeriodicTester::GetError()
+    {   
+    return iErrorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CT_LbsClientPeriodicTester::ChangeTestParametersL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CT_LbsClientPeriodicTester::ChangeTestParametersL(TTimeIntervalMicroSeconds aInterval, TInt aNumberOfRuns)
+	{
+	iNumberOfRuns = aNumberOfRuns;
+	iNumberOfUpdates = 0;
+	iInterval = aInterval;
+	iRecentTime = TTime(0);
+    iError = EFalse;
+    iErrorCode = KErrNone;
+	
+	TPositionUpdateOptions posOption;
+	posOption.SetUpdateInterval(aInterval);
+	
+	TInt err = iPositioner.SetUpdateOptions(posOption);
+	_LIT(KChange, "ERROR: When setting update options in ChangeTestParameters, err: %d");
+	AssertTrueL(err == KErrNone, KChange, err);
+	}
+
+// -----------------------------------------------------------------------------
+// CT_LbsClientPeriodicTester::ChangeRequestorInformation
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CT_LbsClientPeriodicTester::ChangeRequestorInformation(const TDesC& aServiceName)
+	{
+	iPositioner.SetRequestor(CRequestor::ERequestorService,
+							 CRequestor::EFormatApplication, aServiceName);
+	}
+
+// -----------------------------------------------------------------------------
+// CT_LbsClientPeriodicTester::ClosePositioner
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CT_LbsClientPeriodicTester::ClosePositioner()
+	{
+	iPositioner.Close();
+	}
+
+// -----------------------------------------------------------------------------
+// CT_LbsClientPeriodicTester::OpenPositionerL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CT_LbsClientPeriodicTester::OpenPositionerL(const TDesC& aServiceName)
+	{
+	_LIT(KOpenErr, "Error when opening positioner,  %d");
+	TInt err = iPositioner.Open(iPosServer, iUid);
+	AssertTrueL(err == KErrNone, KOpenErr, err);
+	
+	iPositioner.SetRequestor(CRequestor::ERequestorService,
+						 CRequestor::EFormatApplication, aServiceName);
+	}
+
+// -----------------------------------------------------------------------------
+// CT_LbsClientPeriodicTester::SetMaxAgeL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CT_LbsClientPeriodicTester::SetMaxAgeL(TTimeIntervalMicroSeconds aInterval)
+	{
+	TPositionUpdateOptions posOption;
+	posOption.SetUpdateInterval(iInterval);
+	posOption.SetMaxUpdateAge(aInterval);
+
+	TInt err = iPositioner.SetUpdateOptions(posOption);
+	_LIT(KChange, "ERROR: When setting max age in SetMaxAge, err: %d");
+	AssertTrueL(err == KErrNone, KChange, err);	
+	}
+
+// -----------------------------------------------------------------------------
+// CT_LbsClientPeriodicTester::SetPartialUpdateL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CT_LbsClientPeriodicTester::SetPartialUpdateL(TBool aUpdateOption)
+	{
+	TPositionUpdateOptions posOption;
+	posOption.SetUpdateInterval(iInterval);
+	posOption.SetAcceptPartialUpdates(aUpdateOption);
+
+	TInt err = iPositioner.SetUpdateOptions(posOption);
+	_LIT(KChange, "ERROR: When setting partial update in SetPartialUpdate, err: %d");
+	AssertTrueL(err == KErrNone, KChange, err);	
+	}
+
+// -----------------------------------------------------------------------------
+// CT_LbsClientPeriodicTester::SetTimeOutL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CT_LbsClientPeriodicTester::SetTimeOutL(TTimeIntervalMicroSeconds aInterval)
+	{
+	TPositionUpdateOptions posOption;
+	posOption.SetUpdateInterval(iInterval);
+	posOption.SetUpdateTimeOut(aInterval);
+
+	TInt err = iPositioner.SetUpdateOptions(posOption);
+	_LIT(KChange, "ERROR: When setting timeout in SetTimeOut");
+	AssertTrueL(err == KErrNone, KChange, err);	
+	}
+
+// -----------------------------------------------------------------------------
+// CT_LbsClientPeriodicTester::SetChangeParametersPrematurely
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CT_LbsClientPeriodicTester::SetChangeParametersPrematurely(TBool aCondition)
+	{
+	iPrematureChangeOfParameters = aCondition;
+	}
+
+// -----------------------------------------------------------------------------
+// CT_LbsClientPeriodicTester::CancelRequest
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CT_LbsClientPeriodicTester::CancelRequest()
+	{
+	iCancelRequest= ETrue;
+    iCanceledRequest = EFalse;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CT_LbsClientPeriodicTester::RequestNotification
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CT_LbsClientPeriodicTester::RequestNotification()
+	{
+    TTime now;
+    now.UniversalTime();
+    iRecentTime = now;
+	iPositioner.NotifyPositionUpdate(iPositionInfo, iStatus);
+	SetActive();
+	}
+
+// -----------------------------------------------------------------------------
+// CT_LbsClientPeriodicTester::RequestNotification
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CT_LbsClientPeriodicTester::GetPosition(TPositionInfo& aPosInfo)
+    {
+    aPosInfo = iPositionInfo;
+    }
+
+// -----------------------------------------------------------------------------
+// CT_LbsClientPeriodicTester::DoCancel
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CT_LbsClientPeriodicTester::DoCancel()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPeriodicTester::AssertTrueL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPeriodicTester::AssertTrueL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode)
+  {
+  if (!aCondition)
+		{
+		TBuf<100> buf;
+		buf.Format(aErrorMsg, aErrorCode);
+		iLog->Put(buf);
+        User::Leave(aErrorCode);
+		}
+  }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientportedsuiteserver.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,360 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// ctlbsclientportedserver.cpp
+// Test server for ported client tests
+// 
+//
+
+#include "ctlbsclientportedsuiteserver.h"
+#include "ctlbsclientpostp1.h"
+#include "ctlbsclientpostp2.h"
+#include "ctlbsclientpostp11.h"
+#include "ctlbsclientpostp17.h"
+#include "ctlbsclientpostp21.h"
+#include "ctlbsclientpostp22.h"
+#include "ctlbsclientpostp25.h"
+#include "ctlbsclientpostp27.h"
+#include "ctlbsclientpostp76.h"
+#include "ctlbsclientpostp93.h"
+#include "ctlbsclientpostp169.h"
+#include "ctlbsclientpostp173.h"
+#include "ctlbsclientpostp176.h"
+#include "ctlbsclientpostp178.h"
+#include "ctlbsclientpostp179.h"
+#include "ctlbsclientpostp188.h"
+#include "ctlbsclientpostp189.h"
+#include "ctlbsclientpostp193.h"
+#include "ctlbsclientpostp194.h"
+#include "ctlbsclientpostp195.h"
+#include "ctlbsclientpostp201.h"
+#include "ctlbsclientpostp203.h"
+#include "ctlbsclientpostp204.h"
+#include "ctlbsclientpostp208.h"
+#include "ctlbsclientpostp213.h"
+#include "ctlbsclientpostp217.h"
+#include "ctlbsclientpostp218.h"
+#include "ctlbsclientpostp222.h"
+#include "ctlbsclientpostp223.h"
+#include "ctlbsclientpostp224.h"
+#include "ctlbsclientpostp227.h"
+#include "ctlbsclientpostp254.h"
+#include "ctlbsclientpostp256.h"
+#include "ctlbsclientpostp257.h"
+#include "ctlbsclientpostp259.h"
+#include "ctlbsclientpostp261.h"
+#include "ctlbsclientpostp269.h"
+#include "ctlbsclientpostp271.h"
+#include "ctlbsclientpostp272.h"
+#include "ctlbsclientpostp274.h"
+#include "ctlbsclientpostp275.h"
+#include "ctlbsclientpostp4701.h"
+#include "ctlbsclientpostp4702.h"
+#include "ctlbsclientpostp4703.h"
+#include "ctlbsclientpostp4704.h"
+#include "ctlbsclientpostp4705.h"
+#include "ctlbsclientpostp4706.h"
+#include "ctlbsclientpostp4707.h"
+#include "ctlbsclientpostp4708.h"
+#include "ctlbsclientpostp4709.h"
+#include "ctlbsclientpostp4722.h"
+#include "ctlbsclientpostp4723.h"
+
+_LIT(KServerName,"te_LbsPortedSuite");
+CT_LbsClientPortedSuite* CT_LbsClientPortedSuite::NewL()
+/**
+ * @return - Instance of the test server
+ * Same code for Secure and non-secure variants
+ * Called inside the MainL() function to create and start the
+ * CTestServer derived server.
+ */
+	{
+	CT_LbsClientPortedSuite * server = new (ELeave) CT_LbsClientPortedSuite();
+	CleanupStack::PushL(server);
+
+	server->ConstructL(KServerName);
+	CleanupStack::Pop(server);
+	return server;
+	}
+
+
+// Secure variants much simpler
+// For EKA2, just an E32Main and a MainL()
+LOCAL_C void MainL()
+/**
+ * Secure variant
+ * Much simpler, uses the new Rendezvous() call to sync with the client
+ */
+	{
+	// Leave the hooks in for platform security
+#if (defined __DATA_CAGING__)
+	RProcess().DataCaging(RProcess::EDataCagingOn);
+	RProcess().DataCaging(RProcess::ESecureApiOn);
+#endif
+	CActiveScheduler* sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sched);
+	CT_LbsClientPortedSuite* server = NULL;
+	// Create the CTestServer derived server
+	TRAPD(err,server = CT_LbsClientPortedSuite::NewL());
+	if(!err)
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	delete server;
+	delete sched;
+	}
+
+
+
+GLDEF_C TInt E32Main()
+/**
+ * @return - Standard Epoc error code on process exit
+ * Secure variant only
+ * Process entry point. Called by client using RProcess API
+ */
+	{
+	__UHEAP_MARK;
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAPD(err,MainL());
+	delete cleanup;
+	__UHEAP_MARKEND;
+	return err;
+    }
+
+
+CTestStep* CT_LbsClientPortedSuite::CreateTestStep(const TDesC& aStepName)
+/**
+ * @return - A CTestStep derived instance
+ * Secure and non-secure variants
+ * Implementation of CTestServer pure virtual
+ */
+	{
+	CTestStep* testStep = NULL;
+	
+	if(aStepName == KTestProcedure1)
+		{
+		testStep = new CT_LbsClientPosTp1(*this);
+		}
+	if(aStepName == KTestProcedure2)
+		{
+		testStep = new CT_LbsClientPosTp2(*this);
+		}
+	if(aStepName == KTestProcedure11)
+		{
+		testStep = new CT_LbsClientPosTp11(*this);
+		}
+	if(aStepName == KTestProcedure17)
+		{
+		testStep = new CT_LbsClientPosTp17(*this);
+		}
+	if(aStepName == KTestProcedure21)
+		{
+		testStep = new CT_LbsClientPosTp21(*this);
+		}
+	if(aStepName ==KTestProcedure22)
+		{
+		testStep = new CT_LbsClientPosTp22(*this);
+		}
+	if(aStepName == KTestProcedure25)
+		{
+		testStep = new CT_LbsClientPosTp25(*this);
+		}
+	if(aStepName == KTestProcedure27)
+		{
+		testStep = new CT_LbsClientPosTp27(*this);
+		}
+	if(aStepName == KTestProcedure76)
+		{
+		testStep = new CT_LbsClientPosTp76(*this);
+		}
+	if(aStepName == KTestProcedure93)
+		{
+		testStep = new CT_LbsClientPosTp93(*this);
+		}
+	if(aStepName == KTestProcedure169)
+		{
+		testStep = new CT_LbsClientPosTp169(*this);
+		}
+	if(aStepName == KTestProcedure173)
+		{
+		testStep = new CT_LbsClientPosTp173(*this);
+		}
+	if(aStepName == KTestProcedure176)
+		{
+		testStep = new CT_LbsClientPosTp176(*this);
+		}
+	if(aStepName == KTestProcedure178)
+		{
+		testStep = new CT_LbsClientPosTp178(*this);
+		}
+	if(aStepName == KTestProcedure179)
+		{
+		testStep = new CT_LbsClientPosTp179(*this);
+		}
+	if(aStepName == KTestProcedure188)
+		{
+		testStep = new CT_LbsClientPosTp188(*this);
+		}
+	if(aStepName == KTestProcedure189)
+		{
+		testStep = new CT_LbsClientPosTp189(*this);
+		}
+	if(aStepName == KTestProcedure193)
+		{
+		testStep = new CT_LbsClientPosTp193(*this);
+		}
+	if(aStepName == KTestProcedure194)
+		{
+		testStep = new CT_LbsClientPosTp194(*this);
+		}
+	if(aStepName == KTestProcedure195)
+		{
+		testStep = new CT_LbsClientPosTp195(*this);
+		}
+	if(aStepName == KTestProcedure201)
+		{
+		testStep = new CT_LbsClientPosTp201(*this);
+		}
+	if(aStepName == KTestProcedure203)
+		{
+		testStep = new CT_LbsClientPosTp203(*this);
+		}
+	if(aStepName == KTestProcedure204)
+		{
+		testStep = new CT_LbsClientPosTp204(*this);
+		}
+	if(aStepName == KTestProcedure208)
+		{
+		testStep = new CT_LbsClientPosTp208(*this);
+		}
+	if(aStepName == KTestProcedure213)
+		{
+		testStep = new CT_LbsClientPosTp213(*this);
+		}
+	if(aStepName == KTestProcedure217)
+		{
+		testStep = new CT_LbsClientPosTp217(*this);
+		}
+	if(aStepName == KTestProcedure218)
+		{
+		testStep = new CT_LbsClientPosTp218(*this);
+		}
+	if(aStepName == KTestProcedure222)
+		{
+		testStep = new CT_LbsClientPosTp222(*this);
+		}
+	if(aStepName == KTestProcedure223)
+		{
+		testStep = new CT_LbsClientPosTp223(*this);
+		}
+	if(aStepName == KTestProcedure224)
+		{
+		testStep = new CT_LbsClientPosTp224(*this);
+		}
+	if(aStepName == KTestProcedure227)
+		{
+		testStep = new CT_LbsClientPosTp227(*this);
+		}
+	if(aStepName == KTestProcedure254)
+		{
+		testStep = new CT_LbsClientPosTp254(*this);
+		}
+	if(aStepName == KTestProcedure256)
+		{
+		testStep = new CT_LbsClientPosTp256(*this);
+		}
+	if(aStepName == KTestProcedure257)
+		{
+		testStep = new CT_LbsClientPosTp257(*this);
+		}
+	if(aStepName == KTestProcedure259)
+		{
+		testStep = new CT_LbsClientPosTp259(*this);
+		}
+	if(aStepName == KTestProcedure261)
+		{
+		testStep = new CT_LbsClientPosTp261(*this);
+		}
+	if(aStepName == KTestProcedure269)
+		{
+		testStep = new CT_LbsClientPosTp269(*this);
+		}
+	if(aStepName == KTestProcedure271)
+		{
+		testStep = new CT_LbsClientPosTp271(*this);
+		}
+	if(aStepName == KTestProcedure272)
+		{
+		testStep = new CT_LbsClientPosTp272(*this);
+		}
+	if(aStepName == KTestProcedure274)
+		{
+		testStep = new CT_LbsClientPosTp274(*this);
+		}
+	if(aStepName == KTestProcedure275)
+		{
+		testStep = new CT_LbsClientPosTp275(*this);
+		}
+	if(aStepName == KTestProcedure4701)
+		{
+		testStep = new CT_LbsClientPosTp4701(*this);
+		}
+	if(aStepName == KTestProcedure4702)
+		{
+		testStep = new CT_LbsClientPosTp4702(*this);
+		}
+	if(aStepName == KTestProcedure4703)
+		{
+		testStep = new CT_LbsClientPosTp4703(*this);
+		}
+	if(aStepName == KTestProcedure4704)
+		{
+		testStep = new CT_LbsClientPosTp4704(*this);
+		}
+	if(aStepName == KTestProcedure4705)
+		{
+		testStep = new CT_LbsClientPosTp4705(*this);
+		}
+	if(aStepName == KTestProcedure4706)
+		{
+		testStep = new CT_LbsClientPosTp4706(*this);
+		}
+	if(aStepName == KTestProcedure4707)
+		{
+		testStep = new CT_LbsClientPosTp4707(*this);
+		}
+	if(aStepName == KTestProcedure4708)
+		{
+		testStep = new CT_LbsClientPosTp4708(*this);
+		}
+	if(aStepName == KTestProcedure4709)
+		{
+		testStep = new CT_LbsClientPosTp4709(*this);
+		}
+	if(aStepName == KTestProcedure4722)
+		{
+		testStep = new CT_LbsClientPosTp4722(*this);
+		}
+	if(aStepName == KTestProcedure4723)
+		{
+		testStep = new CT_LbsClientPosTp4723(*this);
+		}
+	return testStep;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp1.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,265 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp1.h"
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+#include <LbsSatellite.h>
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp1::CT_LbsClientPosTp1(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{  
+	_LIT(KTestName, "TP1 - Request location from default PSY");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp1::~CT_LbsClientPosTp1()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp1::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp1::CloseTest()
+    {
+    ClosePositioner();
+    Disconnect();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp1::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp1::StartL()
+    {
+    ConnectL();
+    
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db); 
+
+    SetupPsyL(iUidMultiPsy);
+
+    _LIT(KSetupPSY, "TP1: Has Setup Multi PSY");
+    INFO_PRINTF1(KSetupPSY);
+    
+    //setting priority
+	TPositionModuleInfo moduleInfoHp;//Hp - high prio;
+	TPositionModuleInfo moduleInfoLp;//Lp - low prio;
+
+    CPosModuleIdList* prioList = db->ModuleIdListLC();	
+    db->GetModuleInfoL(prioList->At(0), moduleInfoHp);
+
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+    moduleUpdate->SetUpdateAvailability(ETrue);
+
+    if (iUidMultiPsy.iUid == moduleInfoHp.ModuleId().iUid)
+		{
+		// Case when Multi PSY has highest prio: 
+		// Ensuring it is enabled
+	    _LIT(KMultiHighest, "TP1: Case when Multi PSY has highest prio");
+	    INFO_PRINTF1(KMultiHighest);	    
+		db->UpdateModuleL((*prioList)[0], *moduleUpdate);
+		}
+	else
+		{
+		// Case when Multi PSY has not highest prio: 
+		// 
+	    _LIT(KMultiNotHighest, "TP1: Case when Multi PSY has NOT highest prio");	    
+	    INFO_PRINTF1(KMultiNotHighest);	    
+        db->GetModuleInfoL(iUidMultiPsy, moduleInfoLp);
+		// Ensuring it is enabled
+		db->UpdateModuleL(iUidMultiPsy, *moduleUpdate);
+
+		TUint hp = db->PriorityL(moduleInfoHp.ModuleId());
+		TUint lp = db->PriorityL(moduleInfoLp.ModuleId());
+
+		// Changing prio of highest prio PSY and Multi PSY.
+		// Setting Multi PSY to highest prio
+		db->SetModulePriorityL(iUidMultiPsy, hp);
+        db->SetModulePriorityL((*prioList)[0], lp); 
+		}
+
+	_LIT(KTestPSY1On, "TP1: Enabling Test PSY 1");
+    INFO_PRINTF1(KTestPSY1On);	    
+	db -> UpdateModuleL(iUidTestPsy1, *moduleUpdate);
+	_LIT(KTestPSY2On, "TP1: Enabling Test PSY 2");
+    INFO_PRINTF1(KTestPSY2On);
+	db -> UpdateModuleL(iUidTestPsy2, *moduleUpdate);
+    
+	CleanupStack::PopAndDestroy(moduleUpdate);
+	CleanupStack::PopAndDestroy(2, db); // db, prioList
+
+    User::LeaveIfError(OpenPositioner());
+
+    // Request data from default psy should be Multi psy
+    _LIT(KService, "service");
+    TPositionInfo posInfo = TPositionInfo();
+    TInt err = PerformSyncRequest(KService, &posInfo);
+    if (err != KErrNone)
+        {
+        _LIT(KErrorRequest, "The request was not completed with KErrNone");
+        LogErrorAndLeaveL(KErrorRequest, err);
+        }
+	
+    if (iUidMultiPsy.iUid != posInfo.ModuleId().iUid)
+		{
+		_LIT(KIncorrectPsyError, "TP1. Position from wrong PSY received");
+		LogErrorAndLeaveL(KIncorrectPsyError);
+		}
+
+	HPositionGenericInfo* genericInfo = HPositionGenericInfo::NewLC();
+	err = PerformSyncRequest(KService, &(*genericInfo));
+    if (err != KErrNone)
+        {
+        _LIT(KErrorRequest, "The request was not completed with KErrNone");
+        LogErrorAndLeaveL(KErrorRequest);
+        }
+
+	 if (iUidMultiPsy.iUid != (genericInfo -> ModuleId()).iUid)
+		{
+		_LIT(KIncorrectPsyError,
+           "TP1. Position from wrong PSY received");
+		LogErrorAndLeaveL(KIncorrectPsyError);
+		}
+
+	TPositionCourseInfo courseInfo = TPositionCourseInfo();
+	err = PerformSyncRequest(KService, &courseInfo);
+    if (err != KErrNone)
+        {
+        _LIT(KErrorRequest, "Course info supported by default, but request failed");
+        LogErrorAndLeaveL(KErrorRequest);
+        }
+
+	TPositionSatelliteInfo satelliteInfo = TPositionSatelliteInfo();
+	err = PerformSyncRequest(KService, &satelliteInfo);
+    if (err != KErrNone)
+        {
+        _LIT(KErrorRequest, "Satellite info supported by default, but request failed");
+        LogErrorAndLeaveL(KErrorRequest);
+        }	
+
+    //Changing the priority and verifiy that it still possilbe
+    //to request updated from a psy if basic position information
+    //is used and that it is not possilbe to request sat or cource
+    //any more.
+    SetupPsyL(iUidTestPsy2);
+    User::After(3000000);
+
+    // Request data from default psy should be test psy 2 now
+    err = PerformSyncRequest(KService, &posInfo);
+    if (err != KErrNone)
+        {
+        _LIT(KErrorRequest, "The request was not completed with KErrNone");
+        LogErrorAndLeaveL(KErrorRequest);
+        }
+	
+    if (iUidTestPsy2.iUid != posInfo.ModuleId().iUid)
+		{
+		_LIT(KIncorrectPsyError,
+           "TP1. Position from wrong PSY received");
+		LogErrorAndLeaveL(KIncorrectPsyError);
+		}
+
+	err = PerformSyncRequest(KService, &(*genericInfo));
+    if (err != KErrNone)
+        {
+        _LIT(KErrorRequest, "The request was not completed with KErrNone");
+        LogErrorAndLeaveL(KErrorRequest);
+        }
+
+	 if (iUidTestPsy2.iUid != (genericInfo -> ModuleId()).iUid)
+		{
+		_LIT(KIncorrectPsyError,
+           "TP1. Position from wrong PSY received");
+		LogErrorAndLeaveL(KIncorrectPsyError);
+        }
+
+    err = PerformSyncRequest(KService, &courseInfo);
+    if (err != KErrArgument)
+        {
+        _LIT(KErrorRequest, "Course info not supported by default, KErrArgument not returned");
+        LogErrorAndLeaveL(KErrorRequest);
+        }
+
+
+	err = PerformSyncRequest(KService, &satelliteInfo);
+    if (err != KErrArgument)
+        {
+        _LIT(KErrorRequest, "Satellite info not supported by default, KErrArgument not returned");
+        LogErrorAndLeaveL(KErrorRequest);
+        }
+
+    //check that it is possilbe to change the different
+    //type of class info during periodic request and
+    //that the periodic update will fail if the class
+    //type is incorrect.
+    TTimeIntervalMicroSeconds interval = TTimeIntervalMicroSeconds(1000000);
+    TPositionUpdateOptions posOption;
+	posOption.SetUpdateInterval(interval);
+	_LIT(KUpdateErr, "Error when setting update interval,  %d");
+	err = iPositioner.SetUpdateOptions(posOption);
+    AssertTrueL(err == KErrNone, KUpdateErr, err);
+
+    _LIT(KErrPeriodic, "The periodic request did not return KErrNone, %d");
+    err = PerformSyncRequest(KService, &posInfo);
+    AssertTrueL(err == KErrNone , KErrPeriodic, err);
+    
+    _LIT(KErrPeriodicArr, "The periodic request did not return KErrArgument, %d");
+    err = PerformSyncRequest(KService, &satelliteInfo);
+    AssertTrueL(err == KErrArgument , KErrPeriodicArr, err);
+    SetupPsyL(iUidMultiPsy);
+    User::After(3000000);
+    err = PerformSyncRequest(KService, &satelliteInfo);
+    AssertTrueL(err == KErrNone , KErrPeriodic, err);
+
+    CleanupStack::PopAndDestroy(genericInfo);
+    ClosePositioner();
+    Disconnect();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp1::AssertTrueSecL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp1::AssertTrueL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode)
+    {
+  	if (!aCondition)
+		{
+		TBuf<100> buf;
+		buf.Format(aErrorMsg, aErrorCode);
+		LogErrorAndLeaveL(buf);
+		}
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp11.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,133 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp11.h"
+#include "ctlbsclientobserver.h"
+#include <eikenv.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp11::CT_LbsClientPosTp11(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{  
+	_LIT(KTestName, "TP11 - EPos start and termination");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp11::~CT_LbsClientPosTp11()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp11::CheckEPosActivityL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp11::CheckEPosActivityL(TBool aExpectEPosLiveness)
+    {
+    if (aExpectEPosLiveness && !CT_LbsClientObserver::EPosAliveL())
+        {
+        _LIT(KError, "Expected EPos server to be alive but it wasn't");
+        LogErrorAndLeaveL(KError);
+        }
+    if (!aExpectEPosLiveness && CT_LbsClientObserver::EPosAliveL())
+        {
+        _LIT(KError, "Expected EPos server to be dead but it wasn't");
+        LogErrorAndLeaveL(KError);
+        }
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp11::ServerAliveL
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TBool CT_LbsClientPosTp11::ServerAliveL(const TDesC& aServerName)
+    {
+	TFindServer find(aServerName);
+    TFullName   name;
+    if (find.Next(name) == KErrNone) // server found
+		{
+		TBuf<100> buf;
+		_LIT(KFoundServer, "Found server: ");
+		buf.Append(KFoundServer);
+		buf.Append(name);
+		INFO_PRINTF1(buf);
+		return ETrue;
+		}
+	else 
+		{
+		return EFalse;
+		}
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp11::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp11::StartL()
+    {
+    const TInt KTimeEPosIsStillActive = 1000000;
+    const TInt KTimeEPosHasShutDown = 4000000;
+    
+    User::After(2000000);
+
+    CT_LbsClientObserver::WaitForEPosShutdown();
+
+    RPositionServer client1;
+    RPositionServer client2;
+    RPositionServer client3;
+
+    CheckEPosActivityL(EFalse);
+
+    User::LeaveIfError(client1.Connect());
+    CleanupClosePushL(client1);
+    CheckEPosActivityL(ETrue);
+
+    User::LeaveIfError(client2.Connect());
+    CleanupClosePushL(client2);
+    CheckEPosActivityL(ETrue);
+
+    User::LeaveIfError(client3.Connect());
+    CleanupClosePushL(client3);
+    CheckEPosActivityL(ETrue);
+
+    client1.Close();
+    CheckEPosActivityL(ETrue);
+    client2.Close();
+    CheckEPosActivityL(ETrue);
+    client3.Close();
+
+    User::After(TTimeIntervalMicroSeconds32(KTimeEPosIsStillActive));
+    CheckEPosActivityL(ETrue);
+    User::After(TTimeIntervalMicroSeconds32(
+        KTimeEPosHasShutDown - KTimeEPosIsStillActive));
+    CheckEPosActivityL(EFalse);
+
+    CleanupStack::Pop(3); // client1-3 
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp169.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,496 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp169.h"
+#include <badesca.h>
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+#include <LbsCommon.h>
+#include <LbsPositionInfo.h>
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp169::CT_LbsClientPosTp169(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{  
+	_LIT(KTestName, "TP169 - Modules Db Tests");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp169::~CT_LbsClientPosTp169()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp169::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp169::StartL()
+    {
+    _LIT(KErrorMsg1, "Wrong priority order in module list");
+   
+        
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+
+
+    CPosModuleIdList* prioList = db->ModuleIdListLC();
+
+//////////////////// TC194 //////////////////// List Modules
+    
+    _LIT(KErrorMsg4, "Mismatch between list by settings & aquisition API");
+    _LIT(KErrorMsg2, "Installed module in list is returned as uninstalled by IsModuleInstalled");
+    TUid moduleUid;
+    TUid moduleid1;
+    TUint lastPrio = 0;
+    TUint thisPrio = 0;
+	TInt count = 0;
+	TPositionModuleInfo moduleInfo;
+    for (count = 0 ; count < prioList->Count() ; count++)
+        {
+        moduleUid = (*prioList)[count];
+     ////////////////////////////////////
+        
+        
+        TBool IsInstalled=db->IsModuleInstalled(moduleUid);
+        AssertTrueL(IsInstalled,KErrorMsg2);
+                        
+        db->GetModuleInfoL((*prioList)[count], moduleInfo);
+        moduleid1=moduleInfo.ModuleId();
+        AssertTrueL(moduleid1==moduleUid,KErrorMsg4);
+      ////////////////////////////////////  
+        
+        thisPrio = db->PriorityL(moduleUid);
+
+        if (count > 0)
+            {
+            AssertTrueL(thisPrio > lastPrio,
+                        KErrorMsg1);
+            }
+
+        lastPrio = thisPrio;
+        }
+
+    CleanupStack::PopAndDestroy(prioList); // prioList
+
+//////////////////// TC195 //////////////////// Get Module Properties
+    
+
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC(); // destroy!
+    moduleUpdate->SetUpdateAvailability(ETrue);
+    moduleUpdate->SetUpdateCost(TPositionQuality::ECostCharge); // EEPosHigh
+    //////////////////////////////////////////////////
+    moduleUpdate->SetUpdateVisibility(ETrue);
+    db->UpdateModuleL(iUidTestPsy2, *moduleUpdate);
+
+        
+    db->SetModulePriorityL(iUidTestPsy2, 3);
+    
+    db->GetModuleInfoL(iUidTestPsy2, 
+                       moduleInfo);
+
+    
+
+    TPositionQuality quality;
+    moduleInfo.GetPositionQuality(quality);
+
+    _LIT(KModName, "Test PSY 2");
+    _LIT(KStatusErrorText, "Wrong status data in module info");
+    _LIT(KVersionErrorText, "Wrong version data in module info");
+    _LIT(KUidErrorText, "Wrong uid data in module info");
+    _LIT(KNameErrorText, "Wrong name data in module info");
+    _LIT(KPosTechErrorText, "Wrong pos tech data in module info");
+    _LIT(KTTFFErrorText, "Wrong TTFF data in module info");
+    _LIT(KTTFErrorText, "Wrong TTF data in module info");
+    _LIT(KHAccErrorText, "Wrong HAcc data in module info");
+    _LIT(KVAccErrorText, "Wrong VAcc data in module info");
+    _LIT(KCostErrorText, "Wrong cost data in module info");
+    _LIT(KPowerCostErrorText, "Wrong power cost data in module info");
+    _LIT(KClassesErrorText, "Wrong class info in module info");
+
+
+    AssertTrueL(moduleInfo.IsAvailable(), KStatusErrorText);
+    TVersion version = moduleInfo.Version();
+    AssertTrueL(version.iMajor == 1, KVersionErrorText);
+    AssertTrueL(version.iMinor == 0, KVersionErrorText);
+    AssertTrueL(version.iBuild == 0, KVersionErrorText);
+
+    AssertTrueL(moduleInfo.ModuleId() == iUidTestPsy2, KUidErrorText);
+    TBuf<100> moduleName;
+    moduleInfo.GetModuleName(moduleName);
+    AssertTrueL(moduleName == KModName, KNameErrorText);
+    AssertTrueL(moduleInfo.TechnologyType() == TPositionModuleInfo::ETechnologyTerminal,
+                                                KPosTechErrorText); 
+    
+	AssertTrueL(moduleInfo.ClassesSupported(EPositionInfoFamily) ==
+                                                (EPositionGenericInfoClass | EPositionInfoClass),
+                                                KClassesErrorText);
+
+	AssertTrueL(quality.TimeToFirstFix() == TTimeIntervalMicroSeconds(3000000),
+                                               KTTFFErrorText);
+    AssertTrueL(quality.TimeToNextFix() == TTimeIntervalMicroSeconds(3000000),
+                                               KTTFErrorText);
+    AssertTrueL(quality.HorizontalAccuracy() == 2, KHAccErrorText);
+    AssertTrueL(quality.VerticalAccuracy() == 3, KVAccErrorText);
+    AssertTrueL(quality.CostIndicator() == TPositionQuality::ECostCharge, 
+                                            KCostErrorText); // Updated cost value
+    AssertTrueL(quality.PowerConsumption() == TPositionQuality::EPowerZero, 
+                                                KPowerCostErrorText);
+
+//////////////////// TC196 //////////////////// Set Module Properties
+
+    _LIT(KErrorTp196b, "Cost not updated correctly");
+    _LIT(KErrorMsg3, "Wrong Visibility");
+    _LIT(KErrorMsgPrio, "Changing priority of an invisible module");
+
+    // Make sure test psy 2 is enabled.
+    CPosModuleUpdate* moduleUpdate196 = CPosModuleUpdate::NewLC(); // destroy!
+    moduleUpdate196->SetUpdateAvailability(ETrue);
+    moduleUpdate->SetUpdateCost(TPositionQuality::ECostZero);
+    db->UpdateModuleL(iUidTestPsy2, *moduleUpdate196);
+
+    // Disable psy
+    moduleUpdate196->SetUpdateAvailability(EFalse);
+    db->UpdateModuleL(iUidTestPsy2, *moduleUpdate196);
+
+    // Update cost variable to ECostZero
+    moduleUpdate196->SetUpdateCost(TPositionQuality::ECostZero);
+    db->UpdateModuleL(iUidTestPsy2, *moduleUpdate196);
+	db->GetModuleInfoL(iUidTestPsy2, 
+                       moduleInfo);
+    moduleInfo.GetPositionQuality(quality);
+    AssertTrueL(quality.CostIndicator() == TPositionQuality::ECostZero, KErrorTp196b);
+
+    // Update cost variable to ECostPossible
+    moduleUpdate196->SetUpdateCost(TPositionQuality::ECostPossible);
+    db->UpdateModuleL(iUidTestPsy2, *moduleUpdate196);
+	db->GetModuleInfoL(iUidTestPsy2, 
+                       moduleInfo);
+    moduleInfo.GetPositionQuality(quality);
+    AssertTrueL(quality.CostIndicator() == TPositionQuality::ECostPossible, KErrorTp196b);
+
+    // Update cost variable to high
+    moduleUpdate196->SetUpdateCost(TPositionQuality::ECostCharge);
+    db->UpdateModuleL(iUidTestPsy2, *moduleUpdate196);
+	db->GetModuleInfoL(iUidTestPsy2, 
+                       moduleInfo);
+    moduleInfo.GetPositionQuality(quality);
+    AssertTrueL(quality.CostIndicator() == TPositionQuality::ECostCharge, KErrorTp196b);
+    
+    
+    ////////////////////////////////////
+    moduleUpdate196->SetUpdateAvailability(ETrue);
+        
+    moduleUpdate196->SetUpdateVisibility(EFalse);
+    db->UpdateModuleL(iUidTestPsy2, *moduleUpdate196);
+    TBool IsVisble=db->IsModuleVisibleL(iUidTestPsy2);
+    AssertTrueL(IsVisble==EFalse,
+                        KErrorMsg3);
+                        
+    // Change priority of an invisible module
+    
+    TRAPD(err,db->SetModulePriorityL(iUidTestPsy2, 4));
+    AssertTrueL(err==KErrNotFound,KErrorMsgPrio);
+          
+                        
+    moduleUpdate196->SetUpdateVisibility(ETrue);
+    db->UpdateModuleL(iUidTestPsy2, *moduleUpdate196);
+    IsVisble=db->IsModuleVisibleL(iUidTestPsy2);
+    AssertTrueL(IsVisble,KErrorMsg3);   
+   ////////////////////////////////////
+
+//////////////////// TC197 //////////////////// Module Priority
+
+    // Change the priority of the external gps module, and check that the other
+    // modules are updated correctly
+    // Change from 6 to 3
+
+    _LIT(KErrorTextPrio, "Priority test failed after change of priority");
+    _LIT(KErrorVisibility1, "Invisible module is in list");
+    _LIT(KErrorVisibility2, "visible module is not in list after changing it from invisible");
+    db->SetModulePriorityL(iUidTestPsy2, 6);
+    prioList = db->ModuleIdListLC();
+    lastPrio = 0;
+    thisPrio = 0;
+    for (count = 0 ; count < prioList->Count() ; count++)
+        {
+        moduleUid = (*prioList)[count];
+        thisPrio = db->PriorityL(moduleUid);
+
+        if (count > 0)
+            {
+            AssertTrueL(thisPrio > lastPrio,
+                        KErrorMsg1);
+            }
+
+        lastPrio = thisPrio;
+        }
+
+    // Remember the uid:s of the modules close to iUidTestPsy2:
+    TUid uid2a = (*prioList)[2];
+    TUid uid3a = (*prioList)[3];
+    TUid uid4a = (*prioList)[4];
+    TUid uid5a = (*prioList)[5];
+    TUid uid6a = (*prioList)[6];
+    TUid uid7a = (*prioList)[7];
+    TUid uid8a = (*prioList)[8];
+    TUid uid0a = (*prioList)[0];
+
+    db->SetModulePriorityL(iUidTestPsy2, 3);
+
+    CleanupStack::PopAndDestroy(prioList); // prioList
+    prioList = db->ModuleIdListLC();
+
+    TUid uid2b = (*prioList)[2];
+    TUid uid3b = (*prioList)[3];
+    TUid uid4b = (*prioList)[4];
+    TUid uid5b = (*prioList)[5];
+    TUid uid6b = (*prioList)[6];
+    TUid uid7b = (*prioList)[7];
+    TUid uid8b = (*prioList)[8];
+    TUid uid0b = (*prioList)[0];
+
+    AssertTrueL(uid2a == uid2b, KErrorTextPrio);
+    AssertTrueL(uid3a == uid4b, KErrorTextPrio);
+    AssertTrueL(uid4a == uid5b, KErrorTextPrio);
+    AssertTrueL(uid5a == uid6b, KErrorTextPrio);
+    AssertTrueL(uid6a == uid3b, KErrorTextPrio);
+    AssertTrueL(uid7a == uid7b, KErrorTextPrio);
+    AssertTrueL(uid8a == uid8b, KErrorTextPrio);
+    AssertTrueL(uid0a == uid0b, KErrorTextPrio);
+    
+    db->SetModulePriorityL(iUidTestPsy2, 7);
+                                    
+    CleanupStack::PopAndDestroy(prioList); // prioList
+    prioList = db->ModuleIdListLC();
+
+    uid2a = (*prioList)[2];
+    uid3a = (*prioList)[3];
+    uid4a = (*prioList)[4];
+    uid5a = (*prioList)[5];
+    uid6a = (*prioList)[6];
+    uid7a = (*prioList)[7];
+    uid8a = (*prioList)[8];
+    uid0a = (*prioList)[0];
+    TUid uid1a = (*prioList)[1];
+
+    AssertTrueL(uid2b == uid2a, KErrorTextPrio);
+    AssertTrueL(uid3b == uid7a, KErrorTextPrio);
+    AssertTrueL(uid4b == uid3a, KErrorTextPrio);
+    AssertTrueL(uid5b == uid4a, KErrorTextPrio);
+    AssertTrueL(uid6b == uid5a, KErrorTextPrio);
+    AssertTrueL(uid7b == uid6a, KErrorTextPrio);
+    AssertTrueL(uid8b == uid8a, KErrorTextPrio);
+    AssertTrueL(uid0b == uid0a, KErrorTextPrio);
+
+
+    TInt bottomPrio = prioList->Count() - 1;
+
+    // Change top priority to bottom priority
+    
+    db->SetModulePriorityL(uid0a, bottomPrio);
+    CleanupStack::PopAndDestroy(prioList); // prioList
+    prioList = db->ModuleIdListLC();
+
+    AssertTrueL((*prioList)[0] == uid1a, KErrorTextPrio);
+    AssertTrueL(uid0a == (*prioList)[bottomPrio], KErrorTextPrio);
+    AssertTrueL(uid7a == (*prioList)[6], KErrorTextPrio);
+    
+
+    // Change bottom priority to top priority
+    TUid topPrioUid = (*prioList)[0];
+    TUid bottomPrioUid = (*prioList)[bottomPrio];
+    TUid nextBottomPrioUid = (*prioList)[bottomPrio - 1];
+
+    db->SetModulePriorityL(bottomPrioUid, 0);
+    CleanupStack::PopAndDestroy(prioList); // prioList
+    prioList = db->ModuleIdListLC();
+
+    AssertTrueL((*prioList)[0] == bottomPrioUid, KErrorTextPrio);
+    AssertTrueL((*prioList)[1] == topPrioUid, KErrorTextPrio);
+    AssertTrueL((*prioList)[bottomPrio] == nextBottomPrioUid, KErrorTextPrio);
+
+    CleanupStack::PopAndDestroy(prioList); // prioList
+    
+    ////////////////////////////////////
+    
+    db->SetModulePriorityL(iUidTestPsy2, 0);
+                                    
+    prioList = db->ModuleIdListLC();
+
+    uid0a = (*prioList)[0];
+    uid1a = (*prioList)[1];
+    uid2a = (*prioList)[2];
+    uid3a = (*prioList)[3];
+    uid4a = (*prioList)[4];
+    uid5a = (*prioList)[5];
+    uid6a = (*prioList)[6];
+    uid7a = (*prioList)[7];
+    uid8a = (*prioList)[8];
+    
+    moduleUpdate196->SetUpdateVisibility(EFalse);
+    db->UpdateModuleL(iUidTestPsy2, *moduleUpdate196);
+    
+    CleanupStack::PopAndDestroy(prioList); // prioList
+    prioList = db->ModuleIdListLC();
+    
+    TInt IsInList=prioList->Find(iUidTestPsy2);
+    AssertTrueL(IsInList==KErrNotFound, KErrorVisibility1);
+    
+   
+    uid0b = (*prioList)[0];
+    TUid uid1b = (*prioList)[1];
+    uid2b = (*prioList)[2];
+    uid3b = (*prioList)[3];
+    uid4b = (*prioList)[4];
+    uid5b = (*prioList)[5];
+    uid6b = (*prioList)[6];
+    uid7b = (*prioList)[7];
+    
+    
+    AssertTrueL(uid1a == uid0b, KErrorTextPrio);
+    AssertTrueL(uid2a == uid1b, KErrorTextPrio);
+    AssertTrueL(uid3a == uid2b, KErrorTextPrio);
+    AssertTrueL(uid4a == uid3b, KErrorTextPrio);
+    AssertTrueL(uid5a == uid4b, KErrorTextPrio);
+    AssertTrueL(uid6a == uid5b, KErrorTextPrio);
+    AssertTrueL(uid7a == uid6b, KErrorTextPrio);
+    AssertTrueL(uid8a == uid7b, KErrorTextPrio);
+    
+     moduleUpdate196->SetUpdateVisibility(ETrue);
+    db->UpdateModuleL(iUidTestPsy2, *moduleUpdate196);
+    
+    CleanupStack::PopAndDestroy(prioList); // prioList
+    prioList = db->ModuleIdListLC();
+    
+    IsInList=prioList->Find(iUidTestPsy2);
+        
+    TInt priority=db->PriorityL(iUidTestPsy2);
+   
+    
+    AssertTrueL(IsInList==priority, KErrorVisibility2);
+    
+    CleanupStack::PopAndDestroy(prioList); // prioList
+    CleanupStack::PopAndDestroy(2, moduleUpdate);
+    
+    ////////////////////////////////////
+    
+    CleanupStack::PopAndDestroy(db); // db
+
+	}
+
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp169::TestNaNFromPSY
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp169::TestNaNFromPSY()
+	{
+	_LIT(KFunctionName, "We are inside TestNaNFromPSY()");
+	INFO_PRINTF1(KFunctionName);
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+
+	TPositionModuleInfo moduleInfo;
+	TBuf<100> moduleName;
+
+	// Use Panic Psy in this test, should have Horizontal accuracy defined to 0
+	// and vertical accuracy not defined at all in resource file (should default to 0)
+	// and when reading these attributes using the modulesdb they should be of type NaN (Not A Number)
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+    moduleUpdate->SetUpdateAvailability(ETrue);
+    db->UpdateModuleL(iUidPanicPsy, *moduleUpdate);
+
+    db->GetModuleInfoL(iUidPanicPsy, 
+                       moduleInfo);
+
+	moduleInfo.GetModuleName(moduleName);
+
+    TPositionQuality quality;
+    moduleInfo.GetPositionQuality(quality);
+
+	if (!Math::IsNaN(quality.HorizontalAccuracy())) 
+		{
+		_LIT(KErrorAndLeave, "HorizontalAccuracy should be NaN");
+		LogErrorAndLeaveL(KErrorAndLeave);
+		}
+	else 
+		{
+		_LIT(KHorizontalAccuracy, "HorizontalAccuracy NaN");
+		INFO_PRINTF1(KHorizontalAccuracy);
+		}
+
+	if (!Math::IsNaN(quality.VerticalAccuracy())) 
+		{
+		_LIT(KErrorAndLeave, "VerticalAccuracy should be NaN");
+		LogErrorAndLeaveL(KErrorAndLeave);
+		}
+	else 
+		{
+		_LIT(KVerticalAccuracy, "VerticalAccuracy NaN");
+		INFO_PRINTF1(KVerticalAccuracy);
+		}
+
+    CleanupStack::PopAndDestroy(moduleUpdate);
+	CleanupStack::PopAndDestroy(db);
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp169::AssertTrueL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp169::AssertTrueL(TBool aCondition, const TDesC& aErrorMsg)
+    {
+  	if (!aCondition)
+		{
+		LogErrorAndLeaveL(aErrorMsg);
+		}
+    }
+
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp169::AssertTrueSecL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp169::AssertTrueSecL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode)
+    {
+  	if (!aCondition)
+		{
+		TBuf<100> buf;
+		buf.Format(aErrorMsg, aErrorCode);
+		LogErrorAndLeaveL(buf);
+		}
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp17.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,63 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp17.h"
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp17::CT_LbsClientPosTp17(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent) 
+	{  
+	_LIT(KTestName, "TP17 - Open nonexisting PSY");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp17::~CT_LbsClientPosTp17()
+	{
+	}
+// ---------------------------------------------------------
+// CT_LbsClientPosTp17::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp17::StartL()
+    {    
+    TUid nonExistent;
+    nonExistent.iUid = 0x01234DCBD;
+    
+    TBuf<100> output;        
+
+    ConnectL();
+    TInt err = OpenPositionerByName(nonExistent);
+    if (err != KErrNotFound )
+        {
+        output.Format(output, KErrNotFound , err);
+        LogErrorAndLeaveL(output);
+        }
+    Disconnect();
+    }
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp173.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,358 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp173.h"
+#include <badesca.h>
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+#include <LbsCommon.h>
+#include <LbsPositionInfo.h>
+#include "tctlbsclientmodulesobserver.h"
+
+
+void MyStopActive(TAny* /*aAny*/)
+    {
+    CActiveScheduler::Stop();
+    }
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp173::CT_LbsClientPosTp173(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{
+	_LIT(KTestName, "TP173 - Notify Module Events");
+	SetTestStepName(KTestName); 
+	}
+
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp173::~CT_LbsClientPosTp173()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp173::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp173::StartL()
+    {
+    iNoEvents = EFalse;
+    iError = EFalse;
+    // This test listens for events.
+    // There is no data in the event, so all that is needed to be done is
+    // to see that an event is generated. This test doesn't fail if unsuccessful,
+    // it hangs.
+
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+
+    db->SetObserverL(*this);
+
+    TInt prio = db->PriorityL(iUidTestPsy2);
+    if (prio > 0)
+        {
+        prio = 0;
+        }
+    else
+        {
+        prio = 1; // this assumes that more that one PSY is installed
+        }
+
+    CPosModuleUpdate* visibileUpdate = CPosModuleUpdate::NewLC();
+    visibileUpdate->SetUpdateVisibility(ETrue);
+    db->UpdateModuleL(iUidTestPsy2, *visibileUpdate);
+    
+    db->SetModulePriorityL(iUidTestPsy2, prio);
+    CleanupStack::PopAndDestroy(visibileUpdate);
+    
+
+    // Wait for event
+    DoEventHandlingL();
+
+    CPosModuleUpdate* availUpdate = CPosModuleUpdate::NewLC();
+
+
+	TPositionModuleInfo info;
+	db -> GetModuleInfoL(iUidTestPsy2, info);
+	TBool available = info.IsAvailable();
+
+    availUpdate->SetUpdateAvailability(/*ETrue*/ !available);
+    db->UpdateModuleL(iUidTestPsy2, *availUpdate);
+    
+    CleanupStack::PopAndDestroy(availUpdate);
+
+    // Wait for event
+    DoEventHandlingL();
+
+    CPosModuleUpdate* costUpdate = CPosModuleUpdate::NewLC();
+	
+	TPositionQuality quality;
+	info.GetPositionQuality(quality);
+	TPositionQuality::TCostIndicator indicator = quality.CostIndicator();
+    switch (indicator)
+    {
+        case TPositionQuality::ECostUnknown:
+            indicator = TPositionQuality::ECostZero;
+            break;
+        case TPositionQuality::ECostZero:
+            indicator = TPositionQuality::ECostPossible;
+            break;
+        case TPositionQuality::ECostPossible:
+            indicator = TPositionQuality::ECostCharge;
+            break;
+        case TPositionQuality::ECostCharge:
+            indicator = TPositionQuality::ECostPossible;
+            break;
+        default:
+        	_LIT(KErrorAndLeave, "quality indicator does not exist");
+            LogErrorAndLeaveL(KErrorAndLeave);
+    }
+
+    costUpdate->SetUpdateCost(/*TPositionQuality::ECostCharge*/ indicator);
+    db->UpdateModuleL(iUidTestPsy2, *costUpdate);
+    
+    CleanupStack::PopAndDestroy(costUpdate);
+
+    // Wait for event
+    DoEventHandlingL();
+
+    ////////////////////////////////////
+
+    CPosModuleUpdate* visibilityUpdate = CPosModuleUpdate::NewLC();
+    visibilityUpdate->SetUpdateVisibility(EFalse);
+    db->UpdateModuleL(iUidTestPsy2, *visibilityUpdate);
+    CleanupStack::PopAndDestroy(visibilityUpdate);
+    
+    DoEventHandlingL();
+    
+    ////////////////////////////////////
+    
+    CMyNotificationTimer* timer = CMyNotificationTimer::NewLC(this);
+	
+    TTimeIntervalMicroSeconds ttfUpdate(1000000);
+    TPositionQuality dynQualityUpdate;
+    dynQualityUpdate.SetHorizontalAccuracy(30.0);
+    dynQualityUpdate.SetTimeToNextFix(ttfUpdate);
+
+    timer->StartNotificationTimer();
+    iNoEvents = ETrue;
+    // Wait for event
+    DoEventHandlingL();
+    
+////////////////////////////////////
+   
+   
+    
+    
+    db->RemoveObserver();
+    CleanupStack::PopAndDestroy(2, db);
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp173::DoEventHandlingL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp173::DoEventHandlingL()
+    {
+	//User::After(20);
+	CActiveScheduler::Start();
+    CheckErrorL();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp173::CheckErrorL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp173::CheckErrorL()
+    {
+    if (iError)
+        {
+        LogErrorAndLeaveL(iErrorText);
+        }
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp173::HandleDatabaseChangeL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+void CT_LbsClientPosTp173::HandleSettingsChangeL(TPosModulesEvent /*aModuleEvent*/)
+    {
+       
+    CleanupStack::PushL(TCleanupItem(MyStopActive));
+    if (iNoEvents)
+        {
+        _LIT(KErrorText, "Event received when no event should have been received");
+        iErrorText = KErrorText;
+        iError = ETrue;
+        }
+
+    CleanupStack::PopAndDestroy();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp173::AssertTrueSecL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp173::AssertTrueSecL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode)
+    {
+    if (!aCondition)
+        {
+        TBuf<100> buf;
+        buf.Format(aErrorMsg, aErrorCode);
+        LogErrorAndLeaveL(buf);
+        }
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp173::NotifyTimeout
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp173::NotifyTimeout()
+	{
+    CleanupStack::PushL(TCleanupItem(MyStopActive));
+    if (!iNoEvents)
+        {
+        _LIT(KErrorText, "No event received when event should have been received");
+        iErrorText = KErrorText;
+        iError = ETrue;
+        }
+
+    CleanupStack::PopAndDestroy();
+	}
+
+// ---------------------------------------------------------
+// CNotificationTimer::~CNotificationTimer
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+//Implementation of a CNotificationTimer
+
+// destructor
+CMyNotificationTimer::~CMyNotificationTimer()
+	{
+	Cancel();
+	iMainControl = NULL;
+	}
+
+// ---------------------------------------------------------
+// CNotificationTimer::NewLC
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+// Two-phased constructor.
+CMyNotificationTimer* CMyNotificationTimer::NewLC(CT_LbsClientPosTp173* aMainControl)
+	{
+	CMyNotificationTimer* self=new (ELeave) CMyNotificationTimer(aMainControl);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+
+// ---------------------------------------------------------
+// CNotificationTimer::NewL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+// Two-phased constructor.
+CMyNotificationTimer* CMyNotificationTimer::NewL(CT_LbsClientPosTp173* aMainControl)
+	{
+	CMyNotificationTimer* self = NewLC(aMainControl);
+	CleanupStack::Pop();
+	return self;
+	}
+	
+// ---------------------------------------------------------
+// CNotificationTimer::StartNotificationTimer
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+void CMyNotificationTimer::StartNotificationTimer()
+	{
+	CTimer::After(iNotificationTimout);
+	}
+
+// ---------------------------------------------------------
+// CNotificationTimer::DoCancel
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CMyNotificationTimer::DoCancel()
+	{
+	CTimer::DoCancel();
+	}
+
+// ---------------------------------------------------------
+// CNotificationTimer::ConstructL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CMyNotificationTimer::ConstructL()
+	{
+	CTimer::ConstructL();
+	iNotificationTimout = 5000000;
+	//add this object to the active scheduler
+	CActiveScheduler::Add(this); 
+	}
+
+// ---------------------------------------------------------
+// CNotificationTimer::CNotificationTimer
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+//c++ default constructor
+CMyNotificationTimer::CMyNotificationTimer(CT_LbsClientPosTp173* aMainControl)
+:CTimer(CActive::EPriorityStandard)
+	{
+	iMainControl = aMainControl;
+	}
+        
+// ---------------------------------------------------------
+// CNotificationTimer::RunL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CMyNotificationTimer::RunL()
+	{
+	iMainControl->NotifyTimeout();
+	}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp176.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,203 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp176.h"
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp176::CT_LbsClientPosTp176(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{  
+	_LIT(KTestName, "TP176 - Basic PSY test");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp176::~CT_LbsClientPosTp176()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp176::CloseTest
+// Always called after the test, even if the test leaves
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp176::CloseTest()
+    {
+ 
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp176::CloseTest
+// Always called after the test, even if the test leaves
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp176::InitTestL()
+    {
+
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp176::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp176::StartL()
+    {
+    _LIT(KService, "service");
+    CPosModules *modDb = CPosModules::OpenL();
+    CleanupStack::PushL(modDb);
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+
+    moduleUpdate->SetUpdateAvailability(ETrue);
+    modDb->UpdateModuleL(iUidTestPsyTp176, *moduleUpdate);
+    modDb->UpdateModuleL(iUidTestPsy1, *moduleUpdate);
+
+    CleanupStack::PopAndDestroy(2);
+
+    ConnectL();
+
+    User::LeaveIfError(OpenPositionerByName(iUidTestPsyTp176));
+    TPositionInfo info = TPositionInfo();
+
+    // Request data from test psy 176 psy
+    TInt err = PerformSyncRequest(KService, &info);
+
+    if (err != KErrNone)
+        {
+        _LIT(KErrorRequest, "The request was not completed with KErrorNone");
+        LogErrorAndLeaveL(KErrorRequest);
+        }
+
+    // just to make sure that dynamic quality is updated
+    err = PerformSyncRequest(KService, &info);
+
+    if (err != KErrNone)
+        {
+        _LIT(KErrorRequest, "The request was not completed with KErrorNone");
+        LogErrorAndLeaveL(KErrorRequest);
+        }
+
+
+    HPositionGenericInfo* genericInfo = HPositionGenericInfo::NewLC();
+
+    // Request a genericInfo from test psy 176 should fail.    
+    err = PerformSyncRequest(KService, genericInfo);
+
+
+    //Magic number KErrHardwareNotAvailable is used to check that the psy is
+    //not responsible for determine if the class is supported. 
+    if (err == KErrHardwareNotAvailable)
+        {
+        _LIT(KErrorRequest, "The type checking was done in the PSY");
+        LogErrorAndLeaveL(KErrorRequest);
+        }
+	else if (err != KErrArgument)
+		{
+		_LIT(KErrWrongType, "Wrong error type returned");
+		LogErrorAndLeaveL(KErrWrongType);
+		}
+
+    
+    // not set uid
+    err = PerformSyncRequest(KService, &info);
+
+    if (err != KErrGeneral)
+        {
+        _LIT(KErrorRequest, "The request was not completed with KErrGeneral");
+        LogErrorAndLeaveL(KErrorRequest);
+        }
+
+ 
+    // incorrect uid, but existing
+    err = PerformSyncRequest(KService, &info);
+    if (err != KErrGeneral)
+        {
+        _LIT(KErrorRequest, "The request was not completed with KErrGeneral");
+        LogErrorAndLeaveL(KErrorRequest);
+        }
+
+    //incorrect uid
+    err = PerformSyncRequest(KService, &info);
+    if (err != KErrGeneral)
+        {
+        _LIT(KErrorRequest, "The request was not completed with KErrGeneral");
+        LogErrorAndLeaveL(KErrorRequest);
+        }
+
+
+    ClosePositioner();
+    Disconnect();
+
+    CleanupStack::PopAndDestroy(); //genericInfo
+    
+    }
+
+
+
+TBool CT_LbsClientPosTp176::IsQualityUpdatedL(TUid aUid)
+    {
+    TBool updated = ETrue;
+    CPosModules *modDb = CPosModules::OpenL();
+    CleanupStack::PushL(modDb);
+    
+    TPositionQuality dynQuality;
+
+    //TTimeIntervalMicroSeconds timeToFirstFix = dynQuality.TimeToNextFix();
+    TTimeIntervalMicroSeconds timeToFirstFixBefore;
+    TReal32 horAccBefore;
+    TReal32 horAccAfter = dynQuality.HorizontalAccuracy();
+
+    if (aUid == iUidTestPsyTp176)
+        {
+        timeToFirstFixBefore = iQuality.TimeToNextFix();
+        horAccBefore = iQuality.HorizontalAccuracy();
+        }
+    else
+        {
+        timeToFirstFixBefore = iQualityTestPsy1.TimeToNextFix();
+        horAccBefore = iQualityTestPsy1.HorizontalAccuracy();
+        }
+ 
+
+    if (horAccBefore != horAccAfter)
+        {
+        updated = ETrue;
+        iQuality = dynQuality;
+        _LIT(KUpdated, "Dynamic Quality is updated");
+        INFO_PRINTF1(KUpdated);
+        }
+    else
+        {
+        updated = EFalse;
+        _LIT(KNotUpdated, "Dynamic Quality is NOT updated");
+        INFO_PRINTF1(KNotUpdated);
+        }
+
+    CleanupStack::PopAndDestroy();
+    return updated;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp178.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,366 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp178.h"
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp178::CT_LbsClientPosTp178(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{  
+	_LIT(KTestName, "Tp178 - Request Timeout");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp178::~CT_LbsClientPosTp178()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp178::CloseTest
+// Always called after the test, even if the test leaves
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp178::CloseTest()
+{
+    ClosePositioner();
+    Disconnect();
+}
+
+
+TInt Timeout178(TAny* /*aNothing*/)
+    {
+    CActiveScheduler::Stop();
+    return KErrNone;
+    }
+
+void StartSchedulerForAWhile178L(TTimeIntervalMicroSeconds32 aTimeout)
+    {
+    CPeriodic* timer = CPeriodic::NewL(CActive::EPriorityStandard);
+    CleanupStack::PushL(timer);
+    timer->Start(aTimeout, aTimeout, TCallBack(Timeout178));
+    CActiveScheduler::Start();
+    CleanupStack::PopAndDestroy(timer);  
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp178::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp178::StartL()
+    {
+    _LIT(KServiceAccept, "SAAA");
+    
+    SetupPsyL(iUidTestPsy3);
+    
+    RPositioner positioner;
+    TPositionInfo info = TPositionInfo();
+    
+    ConnectL();
+    
+    User::LeaveIfError(positioner.Open(iPosServer,iUidTestPsy3));
+    CleanupClosePushL(positioner);
+    
+    TInt Err = positioner.SetRequestor(CRequestor::ERequestorService,
+        CRequestor::EFormatApplication, KServiceAccept);
+    
+    TPositionUpdateOptions updateOptionsLong, updateOptionsShort;
+    
+    TTimeIntervalMicroSeconds longInterval(7000000);
+    
+    updateOptionsLong.SetUpdateTimeOut(longInterval);
+    Err = positioner.SetUpdateOptions(updateOptionsLong);
+    
+    TTimeIntervalMicroSeconds shortInterval(2000000);
+    updateOptionsShort.SetUpdateTimeOut(shortInterval);
+    
+    TPositionUpdateOptions theUpdateOptions;
+    Err = positioner.GetUpdateOptions(theUpdateOptions);
+    
+    if (theUpdateOptions.UpdateTimeOut() != updateOptionsLong.UpdateTimeOut() ||
+        updateOptionsLong.UpdateTimeOut() != longInterval)
+    {
+        _LIT(KUpdateOptions, "The update option was not set correctly");
+        LogErrorAndLeaveL(KUpdateOptions);
+    }
+    
+    _LIT(KDelayMsg, "The successfull requests was completed within %d microsecs.");
+    _LIT(KCancelMsg, "The canceled requests was completed within %d microsecs.");
+    
+    TRequestStatus status;
+    
+    for (TInt i = 0; i < 10; i++) // makes 10 test inorder to get some statistic
+    {         
+        
+        positioner.SetUpdateOptions(updateOptionsLong);
+        TTime requestStartTime;
+        
+        requestStartTime.UniversalTime();
+        positioner.NotifyPositionUpdate(info, status);
+        User::WaitForRequest(status);
+        TTime requestStopTime;
+        requestStopTime.UniversalTime();
+        
+        TTimeIntervalMicroSeconds durationMicro = requestStopTime.MicroSecondsFrom(requestStartTime);
+        
+        TInt duration = durationMicro.Int64();
+        
+        TBuf<100> timeMsg;
+        timeMsg.Format(KDelayMsg, duration);
+        INFO_PRINTF1(timeMsg);
+        
+        //check error status
+        if (status != KErrNone)
+        {
+            _LIT(KErrPositionRequest, "error code returned from NotifyPositionUpdate, error code = %d");
+            TBuf<100> buf;
+            buf.Format(KErrPositionRequest, status.Int());
+            LogErrorAndLeaveL(buf);
+        }
+        
+        
+        TTimeIntervalMicroSeconds shortInterval(2000000);
+        updateOptionsShort.SetUpdateTimeOut(shortInterval);
+        
+        positioner.SetUpdateOptions(updateOptionsShort);
+        
+        requestStartTime.UniversalTime();
+        positioner.NotifyPositionUpdate(info, status);
+        User::WaitForRequest(status);
+        requestStopTime.UniversalTime();
+        
+        durationMicro = requestStopTime.MicroSecondsFrom(requestStartTime);
+        
+        duration = durationMicro.Int64();
+        
+#ifdef __WINS__
+        TTimeIntervalMicroSeconds winsFail(100000);
+        durationMicro = TTimeIntervalMicroSeconds(durationMicro.Int64()+winsFail.Int64());
+#endif
+        
+        timeMsg.Format(KCancelMsg, duration);
+        INFO_PRINTF1(timeMsg);
+        
+        
+        if (status != KErrTimedOut)
+        {
+            _LIT(KErrPositionRequest, "Request did not returned KErrTimedOut, status code = %d.");
+            TBuf<100> buf;
+            buf.Format(KErrPositionRequest, status.Int());
+            LogErrorAndLeaveL(buf);
+        }
+
+        //Check that the request was not aborted before the Interval
+        //Remove this condition if a lot of data is needed in test log.
+        if (durationMicro < shortInterval)
+        {
+            _LIT(KErrInterval, " The request was aborted before the set timed out ");
+            LogErrorAndLeaveL(KErrInterval);
+        }
+        
+        
+    } // end for loop
+    CleanupStack::PopAndDestroy(1); //positioner
+    Disconnect();
+
+    // Do timeout test
+    TestTimeoutL();
+
+    // Do cancel test
+    TestCancelL();
+
+    // ESLI-5QRA7U just check that it is not possible to set a timeout that is less than
+    // the update interval
+    TestOptionL();
+    }
+    
+// ---------------------------------------------------------
+// CT_LbsClientPosTp178::TestTimeout
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp178::TestTimeoutL()
+    {
+    _LIT(KSTART, "TestTimeout()");
+    _LIT(KEND, "TestTimeout() passed");
+    _LIT(KTIME, "Request took %d us");
+    
+    // Setup verification stuff
+    INFO_PRINTF1(KSTART);
+    
+    //TPrivDlgDiagnostics tmpdiag;
+    TTime requestStartTime;
+    TTime requestStopTime;
+    TTimeIntervalMicroSeconds durationMicro;
+    
+    TBuf<100> buf;
+    
+	_LIT(KService, "SAAA");
+    TPositionUpdateOptions updateOptions;
+    
+    TTimeIntervalMicroSeconds longInterval(7000000);
+    ConnectL();
+    SetupPsyL(iUidTestPsy3);
+
+    OpenPositionerByName(iUidTestPsy3);    
+    updateOptions.SetUpdateTimeOut(longInterval);
+    
+    // Access protected member (iPositioner) here
+    iPositioner.SetUpdateOptions(updateOptions);
+    
+    _LIT(KONE, "Perform first request, should NOT time out");
+    INFO_PRINTF1(KONE);
+    
+    requestStartTime.UniversalTime();
+    //Make one request to verify psy
+    PerformRequestL(KService, CRequestor::ERequestorService, CRequestor::EFormatApplication);
+    
+    CheckRequestResultL(KErrNone);
+    requestStopTime.UniversalTime();
+
+    durationMicro = requestStopTime.MicroSecondsFrom(requestStartTime);
+    TInt duration = durationMicro.Int64();
+    
+    buf.Format(KTIME, duration);
+    INFO_PRINTF1(buf);
+    
+    ClosePositioner();
+    
+    OpenPositionerByName(iUidTestPsy3);
+    // ECancelButton means that the Automatised class should wait for a cancel call
+    // before returning result
+    
+    updateOptions.SetUpdateTimeOut(longInterval);
+    
+    // Access protected (iPositioner) member here
+    iPositioner.SetUpdateOptions(updateOptions);
+    
+    _LIT(KTWO, "Perform second request, should not time out");
+    INFO_PRINTF1(KTWO);
+    
+    //Make one request to verify psy
+    TPositionInfo info = TPositionInfo();
+    requestStartTime.UniversalTime();
+    TInt err = PerformSyncRequest(KService, &info);
+    requestStopTime.UniversalTime();
+    
+    if (err != KErrNone)
+    {
+        _LIT(KError, "Wrong result from iStatus, should be KErrNone, was %d");
+        TBuf<100> buf;
+        buf.Format(KError, err);
+        LogErrorAndLeaveL(buf);
+    }
+    
+    durationMicro = requestStopTime.MicroSecondsFrom(requestStartTime); 
+    duration = durationMicro.Int64();
+    
+    buf.Format(KTIME, duration);
+    INFO_PRINTF1(buf);
+    
+    ClosePositioner();
+    Disconnect();
+
+    INFO_PRINTF1(KEND);
+}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp178::TestCancel
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp178::TestCancelL()
+    {
+    _LIT(KSTART, "TestCancel()");
+    _LIT(KEND, "TestCancel() passed");
+    
+    // Setup verification stuff
+    INFO_PRINTF1(KSTART);
+    
+	_LIT(KService, "SAAA");
+    ConnectL();
+    SetupPsyL(iUidTestPsy3);    
+   
+    OpenPositionerByName(iUidTestPsy3);
+    
+    PerformRequestL(KService, CRequestor::ERequestorService, CRequestor::EFormatApplication);
+    StartSchedulerForAWhile178L(2000000);
+    iPositioner.CancelRequest(EPositionerNotifyPositionUpdate); 
+    CheckRequestResultL(KErrCancel);
+
+    ClosePositioner();
+    Disconnect();
+
+    INFO_PRINTF1(KEND);
+}
+    
+
+void CT_LbsClientPosTp178::TestOptionL()
+    {
+    SetupPsyL(iUidTestPsy3);
+    
+    RPositioner positioner;
+    
+    ConnectL();
+    
+    User::LeaveIfError(positioner.Open(iPosServer,iUidTestPsy3));
+    CleanupClosePushL(positioner);
+    
+    _LIT(KKalle, "Kalle");
+    positioner.SetRequestor(CRequestor::ERequestorService,
+        CRequestor::EFormatApplication, KKalle);
+    
+    TPositionUpdateOptions updateOptions;
+    
+    TTimeIntervalMicroSeconds timeoutInterval(4000000);
+    TTimeIntervalMicroSeconds periodicInterval(7000000);
+    
+    updateOptions.SetUpdateTimeOut(timeoutInterval);
+    updateOptions.SetUpdateInterval(periodicInterval);
+    TInt err = positioner.SetUpdateOptions(updateOptions);
+    if (err != KErrArgument)
+        {
+        _LIT(KErrArg, "Possible to set timout < update interval, error code = %d");
+        TBuf<100> buf;
+        buf.Format(KErrArg, err);
+        INFO_PRINTF1(buf);
+        LogErrorAndLeaveL(buf);
+        }
+
+    //should never be runned;
+    CleanupStack::PopAndDestroy(1); //positioner
+    Disconnect();
+    }
+
+    
+// End of File
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp179.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,207 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp179.h"
+#include "ctlbsposclientholder.h"
+#include <e32keys.h>
+
+// CONSTANTS
+_LIT(KPosPhoneTimeLocaleFormat,
+     "         phone time: %F%H:%F%T:%F%S:%F%C");
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp179::CT_LbsClientPosTp179(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{ 
+	_LIT(KTestName, "Tp179 - One Client, same PSY");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp179::~CT_LbsClientPosTp179()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp179::CloseTest
+// Always called after the test, even if the test leaves
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp179::CloseTest()
+    {
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp179::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp179::StartL()
+    {  
+    const TInt NumClients = 3;
+	SetupPsyL(iUidTestPsy12);
+
+    //Make one request, the performance requirement are not valid for
+    //the first request.
+    TTime startTime, stopTime;
+    TTime serverStartTime, serverStopTime;
+    TTimeIntervalMicroSeconds requestTime, connectionTime;
+    TBuf<150> buf;
+
+    serverStartTime.UniversalTime();
+    ConnectL();
+    serverStopTime.UniversalTime();
+
+    User::LeaveIfError(OpenPositioner());
+
+    TPositionInfo posInfo = TPositionInfo();
+    _LIT(KService, "service");
+    // Request data from default psy should be test psy 2
+    startTime.UniversalTime();
+    TInt err = PerformSyncRequest(KService, &posInfo);
+    stopTime.UniversalTime();
+
+    if (err != KErrNone)
+        {
+        _LIT(KErrorRequest, "The request was not completed with KErrorNone");
+        LogErrorAndLeaveL(KErrorRequest);
+        }
+
+    requestTime = stopTime.MicroSecondsFrom(startTime);
+    connectionTime = serverStopTime.MicroSecondsFrom(serverStartTime);
+
+    // Added some extra timing here
+    _LIT(KDebug, "Connecting to Epos took: %d us");
+    buf.Format(KDebug, connectionTime.Int64());
+    INFO_PRINTF1(buf);
+    _LIT(KSeparator, "********");
+    INFO_PRINTF1(KSeparator);
+    buf.Zero();
+    _LIT(KFirstRequest, "The first request took: %d us");
+    buf.Format(KFirstRequest, requestTime.Int64());
+    INFO_PRINTF1(buf);
+    INFO_PRINTF1(KSeparator);
+
+    CT_LbsPosClientHolder* clients = CT_LbsPosClientHolder::NewLC(NumClients, iUidTestPsy12, ETrue);
+    
+    TTime starttime,stoptime;
+    
+    starttime.UniversalTime();
+    
+    clients->MakeRequests();
+    
+    stoptime.UniversalTime();
+    
+     // Substract total delay incurred due to TestPsy2...i.e 2sec
+    TInt duration=stoptime.Int64()-starttime.Int64()-2000000;
+    
+    _LIT(KMessage,"3 simultaneous requests from 3 different sub-sessions with a psy completed in %d microsec");
+    TBuf<256> message;
+    message.Format(KMessage,duration);
+    INFO_PRINTF1(message);
+    
+    if(duration>3000000)
+    {
+     _LIT(KTime, "Time taken>3 sec");
+     INFO_PRINTF1(KTime);
+    }
+    
+    TPositionInfo position[NumClients];
+
+    TTimeIntervalMicroSeconds
+        reqTime[NumClients],
+        reqTimeLimit(5000000),
+        timeDifferenceLimit(500000);
+    TInt status;
+    TBool error = EFalse;
+
+	//some printing mostly used for information purpose.
+    for (TInt i = 0; i < NumClients; i++)
+        {
+        clients->GetResult(status, position[i], reqTime[i], i);
+		TPosition tmp;
+		position[i].GetPosition(tmp);
+        if (status != 0)
+            {
+            _LIT(KError, "The position requested could not be retrieved, status = %d");
+            buf.Format(KError, status);
+            ERR_PRINTF1(buf);
+            error = ETrue;
+            }
+        if (reqTime[i].Int64() > reqTimeLimit.Int64())
+            {
+            _LIT(KErrorMsg, "The request time of client %d took more than 5 seconds, req. time = %d microsecs.");
+            buf.Format(KErrorMsg, i, reqTime[i].Int64());
+            ERR_PRINTF1(buf);
+            error = ETrue;
+            }
+        for (TInt j = 0; j < i; j++)
+            {
+            _LIT(KReqMsg, "client %d request time: %d");
+
+            buf.Format(KReqMsg, j, reqTime[j].Int64());
+            INFO_PRINTF1(buf);
+			TPosition posi;
+			TPosition posj;
+			position[i].GetPosition(posi);
+			position[j].GetPosition(posj);
+            posj.Time().FormatL(buf, KPosPhoneTimeLocaleFormat);
+            INFO_PRINTF1(buf);
+
+            buf.Format(KReqMsg, i, reqTime[i].Int64());
+            INFO_PRINTF1(buf);
+            posi.Time().FormatL(buf, KPosPhoneTimeLocaleFormat);
+            INFO_PRINTF1(buf);
+
+            _LIT(KSeparator, "********");
+            INFO_PRINTF1(KSeparator);
+
+            if (Abs(reqTime[i].Int64() - reqTime[j].Int64()) > timeDifferenceLimit.Int64())
+                {
+                _LIT(KMsg1, "Requests by client %d and %d wasn't served simultaniously: %d microsecs difference between reqTime.");
+                TBuf<150> buf;
+                buf.Format(KMsg1, i, j, Abs(reqTime[i].Int64() - reqTime[j].Int64()));
+                ERR_PRINTF1(buf);
+                error = ETrue;
+                }
+            if (Abs(posi.Time().Int64() - posj.Time().Int64()) > timeDifferenceLimit.Int64())
+                {
+                _LIT(KMsg2, "Requests by client %d and %d wasn't served simultaniously: %d microsecs difference between phoneTime.");
+                TBuf<150> buf;
+                buf.Format(KMsg2, i, j, Abs(posi.Time().Int64() - posj.Time().Int64()));
+                ERR_PRINTF1(buf);
+                error = ETrue;
+                }
+            }
+        }
+
+    CleanupStack::PopAndDestroy(); //clients
+    ClosePositioner();
+
+	Disconnect();
+
+    if (error)
+        User::Leave(KErrGeneral);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp188.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,178 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp188.h"
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+
+// CONSTANTS
+const TInt32 KUidNonExistingPsy = 0x01111111;
+const TInt KMaxMessageSize = 200;
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp188::CT_LbsClientPosTp188(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{  
+	_LIT(KTestName,"Tp188 - Get Module Status");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp188::~CT_LbsClientPosTp188()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp188::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp188::StartL()
+    {
+	SetupPsyL(iUidTestStatusPsy);
+
+    // Synchronous request to start server.
+    ConnectL();
+
+	// Request status information for PSY.
+	TPositionModuleStatus moduleStatus = TPositionModuleStatus();
+	TInt err = iPosServer.GetModuleStatus(moduleStatus, iUidTestStatusPsy);
+	_LIT(KErrFailStatus1, "1. Error when getting module status, error code = %d");
+	AssertTrueL(err == KErrNone, KErrFailStatus1, err);
+   
+    iModuleStatus.SetDeviceStatus(TPositionModuleStatus::EDeviceInactive);
+    iModuleStatus.SetDataQualityStatus(TPositionModuleStatus::EDataQualityUnknown);
+	
+	CheckModuleStatusL(moduleStatus);
+
+	// Disable PSY.
+	CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+
+    moduleUpdate->SetUpdateAvailability(EFalse);
+    db->UpdateModuleL(iUidTestStatusPsy, *moduleUpdate);
+
+	User::After(1000000);
+
+	// Request status information for PSY.
+	err = iPosServer.GetModuleStatus(moduleStatus, iUidTestStatusPsy);
+	_LIT(KErrFailStatus2, "2. Error when getting module status, error code = %d");
+	AssertTrueL(err == KErrNone, KErrFailStatus2, err);
+
+    iModuleStatus.SetDeviceStatus(TPositionModuleStatus::EDeviceDisabled);
+    iModuleStatus.SetDataQualityStatus(TPositionModuleStatus::EDataQualityUnknown);
+
+	User::After(1000000);
+
+	CheckModuleStatusL(moduleStatus);
+
+	// Request status information for a non-existing PSY.
+	TUid aNonExistingUid;
+	aNonExistingUid.iUid = KUidNonExistingPsy;
+	err = iPosServer.GetModuleStatus(moduleStatus, aNonExistingUid);
+	_LIT(KErrFailStatus3, "3. Error when getting module status, error code = %d");
+	AssertTrueL(err == KErrNotFound, KErrFailStatus3, err);
+	
+    SetupPsyL(iUidTestStatusPsy);
+
+	// Request to be notified about Module Status Events.
+	TPositionModuleStatusEvent statusEvent;
+	TRequestStatus status = KErrNone;
+	statusEvent.SetRequestedEvents(TPositionModuleStatusEvent::EEventDeviceStatus); // Obligatory to set Requested events, EEventAll works also.
+	iPosServer.NotifyModuleStatusEvent(statusEvent, status, iUidTestStatusPsy);
+	
+	// Open a subsession to PSY.
+	err = OpenPositionerByName(iUidTestStatusPsy);
+	_LIT(KErrFailStatus4, "4. Error when opening module , error code = %d");
+	AssertTrueL(err == KErrNone, KErrFailStatus4, err);
+	
+	CleanupStack::PopAndDestroy(moduleUpdate);
+    CleanupStack::PopAndDestroy(db);
+	
+	User::WaitForRequest(status);
+	_LIT(KErrFailStatus5, "5. Error in completed request, error code = %d");
+	AssertTrueL(status.Int() == KErrNone, KErrFailStatus5, err);
+
+	// Request status information for PSY.
+	err = iPosServer.GetModuleStatus(moduleStatus, iUidTestStatusPsy);
+	_LIT(KErrFailStatus6, "6. Error whe getting module status, error code = %d");
+	AssertTrueL(err == KErrNone, KErrFailStatus6, err);
+
+    iModuleStatus.SetDeviceStatus(TPositionModuleStatus::EDeviceReady);
+    iModuleStatus.SetDataQualityStatus(TPositionModuleStatus::EDataQualityNormal);
+	CheckModuleStatusL(moduleStatus);
+	
+	ClosePositioner();
+
+
+	Disconnect();
+
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp188::CheckModuleStatus
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp188::CheckModuleStatusL(const TPositionModuleStatus& aStatus)
+	{
+	TBuf<KMaxMessageSize> buf;	
+	_LIT(KStatus,"Checking module status");
+	INFO_PRINTF1(KStatus);
+	
+	_LIT(KDevSta, "Device Status (EDeviceUnknown = 0, EDeviceError = 1, EDeviceDisabled = 2, EDeviceInactive = 3, EDeviceInitialising = 4, EDeviceStandBy = 5,  EDeviceReady = 6, EDeviceActive = 7) :  %d");
+	buf.Format(KDevSta, aStatus.DeviceStatus());
+	INFO_PRINTF1(buf);
+	buf.Zero();
+	
+	_LIT(KDatQual, "Data Quality Status (EDataQualityUnknown = 0, EDataQualityLoss = 1, EDataQualityPartial = 2, EDataQualityNormal = 3) : ,  %d");
+	buf.Format(KDatQual, aStatus.DataQualityStatus());
+	INFO_PRINTF1(buf);
+	buf.Zero();
+	
+	//unused TInt myVar = iModuleStatus.DeviceStatus();
+	//unused TInt myVar2 = aStatus.DeviceStatus();
+
+    if (iModuleStatus.DeviceStatus() != aStatus.DeviceStatus() ||
+        iModuleStatus.DataQualityStatus() != aStatus.DataQualityStatus())
+        {
+        if (iModuleStatus.DeviceStatus() != aStatus.DeviceStatus())
+        {
+        	_LIT(KError, "Status is not correct, Status returned %d Status expected %d");
+        	buf.Format(KError, aStatus.DeviceStatus(), iModuleStatus.DeviceStatus());
+        	LogErrorAndLeaveL(buf);	
+        }
+        else
+        {
+        	_LIT(KError , "Quality is not correct, Quality returned %d Quality expected");
+        	buf.Format(KError, aStatus.DataQualityStatus(), iModuleStatus.DataQualityStatus());
+        	LogErrorAndLeaveL(KError);	
+        }
+        
+        }
+	}
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp189.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,343 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp189.h"
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+
+// CONSTANTS
+const TInt32 KUidNonExistingPsy = 0x01111111;
+const TInt KMaxMessageSize = 200;
+const TInt KNrOfDeviceStatusChanges = 8; // 9 since some are ignored
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp189::CT_LbsClientPosTp189(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{  
+	_LIT(KTestName, "Tp189 - Status Events");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp189::~CT_LbsClientPosTp189()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp189::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp189::StartL()
+    {
+   _LIT(KDeviceStatusValues, "Device Status Values (Unknown = 0, Error = 1, Disabled = 2, Inactive = 3, Initialising = 4, StandBy = 5,  Ready = 6, Active = 7)");
+   INFO_PRINTF1(KDeviceStatusValues);
+    _LIT(KDataQualityValue, "Data Quality Status (Unknown = 0, Loss = 1, Partial = 2, Normal = 3)");
+    INFO_PRINTF1(KDataQualityValue);
+
+    _LIT(KSetTestStatusPsy, "Setting up TestStatusPsy");
+    INFO_PRINTF1(KSetTestStatusPsy);
+
+	SetupPsyL(iUidTestStatusPsy);
+
+    TPositionModuleStatusEvent statusEvent2;
+    statusEvent2.SetRequestedEvents(TPositionModuleStatusEvent::EEventDeviceStatus); 
+	TRequestStatus status2 = KErrNone;
+    RPositionServer client2;
+	CleanupClosePushL(client2);
+	TInt err = client2.Connect();
+	_LIT(KConnectError, "TP18 Unable to open connection to Epos, return code %d");
+	AssertTrueL(err == KErrNone, KConnectError, err);
+    
+    // Synchronous request to start server.
+    ConnectL();
+
+	// 1. Request to be notified about Module Status Events.
+	TPositionModuleStatusEvent statusEvent;
+	TRequestStatus status = KErrNone;
+
+	// Open a subsession to PSY.1
+	_LIT(KOpenPSY, "Calling OpenPositionerByName");
+	INFO_PRINTF1(KOpenPSY);
+	err = OpenPositionerByName(iUidTestStatusPsy);
+	_LIT(KErrOpen, "1. Error when opening subsession to PSY , error code = %d");
+	AssertTrueL(err == KErrNone, KErrOpen, err);
+
+	
+	for(TInt i = 0; i < (KNrOfDeviceStatusChanges - 1); i++) //Iterate through different device statuses. Skip first and last
+		{
+		RequestWaitAndLogEventL(TPositionModuleStatusEvent::EEventDeviceStatus);
+		}
+	
+	RequestWaitAndLogEventL(TPositionModuleStatusEvent::EEventDataQualityStatus); //Test to be notified about data quality changes
+	
+	// Renew request before proceeding
+	statusEvent.SetRequestedEvents(TPositionModuleStatusEvent::EEventDeviceStatus); 
+	iPosServer.NotifyModuleStatusEvent(statusEvent, status, iUidTestStatusPsy);
+	
+	// 2. Disable PSY1.
+	CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+
+    moduleUpdate->SetUpdateAvailability(EFalse);
+    db->UpdateModuleL(iUidTestStatusPsy, *moduleUpdate);
+    _LIT(KWaitStatus, "Waiting for status after UpdateModuleL1");
+	INFO_PRINTF1(KWaitStatus);
+	User::WaitForRequest(status);
+	
+    _LIT(KWait, "Error when request completed, error code = %d");
+    iExpectedStatus.SetDeviceStatus(TPositionModuleStatus::EDeviceDisabled);
+    iExpectedStatus.SetDataQualityStatus(TPositionModuleStatus::EDataQualityNormal);
+
+    TPositionModuleStatus getStatus;
+    statusEvent.GetModuleStatus(getStatus);
+
+    if (iExpectedStatus.DeviceStatus() != getStatus.DeviceStatus() ||
+        iExpectedStatus.DataQualityStatus() != getStatus.DataQualityStatus())
+        {
+        TBuf<100> buf;
+        if (iExpectedStatus.DeviceStatus() != getStatus.DeviceStatus())
+        {
+        	_LIT(KError, "Status is not correct, Status returned %d Status expected %d");
+        	buf.Format(KError, getStatus.DeviceStatus(), iExpectedStatus.DeviceStatus());
+        	LogErrorAndLeaveL(buf);	
+        }
+        else
+        {
+        	_LIT(KError , "Quality is not correct, Quality returned %d Quality expected");
+        	buf.Format(KError, getStatus.DataQualityStatus(), iExpectedStatus.DataQualityStatus());
+        	LogErrorAndLeaveL(KError);	
+        }
+        }
+
+	// 3. Renew request
+	iPosServer.NotifyModuleStatusEvent(statusEvent, status, iUidTestStatusPsy);
+	_LIT(KNotifyModuleStatusEvent, "Called NotifyModuleStatusEvent");
+	INFO_PRINTF1(KNotifyModuleStatusEvent);
+	
+	// 4. Enable PSY1
+	moduleUpdate->SetUpdateAvailability(ETrue);
+    db->UpdateModuleL(iUidTestStatusPsy, *moduleUpdate);
+    _LIT(KWaitUpdateModuleL2, "Waiting for status after UpdateModuleL2");
+	INFO_PRINTF1(KWaitUpdateModuleL2);
+	
+	User::WaitForRequest(status);
+	AssertTrueL(status.Int() == KErrNone, KWait, status.Int());
+
+    // 5. Renew request
+	iPosServer.NotifyModuleStatusEvent(statusEvent, status, iUidTestStatusPsy);
+	client2.NotifyModuleStatusEvent(statusEvent2, status2, iUidMultiPsy);
+
+	// 7. Disable PSY1
+	_LIT(KDisable, "Disabling TestStatusPsy");
+	INFO_PRINTF1(KDisable);
+	moduleUpdate->SetUpdateAvailability(EFalse);
+    db->UpdateModuleL(iUidTestStatusPsy, *moduleUpdate);
+
+	// 9. Enable PSY2
+    _LIT(KEnable, "Enabling MultiPsy");
+	INFO_PRINTF1(KEnable);
+	moduleUpdate->SetUpdateAvailability(ETrue);
+    db->UpdateModuleL(iUidMultiPsy, *moduleUpdate);
+
+    _LIT(KStatus, "Waiting for status & status2");
+	INFO_PRINTF1(KStatus);
+	User::WaitForRequest(status, status2);
+    if (status == KRequestPending)
+        {
+        User::WaitForRequest(status);
+        }
+    else
+        {
+        User::WaitForRequest(status2);
+        }
+
+
+    AssertTrueL(status.Int() == KErrNone, KWait, status.Int());
+    AssertTrueL(status2.Int() == KErrNone, KWait, status2.Int());
+	
+	// 10. Renew request for all PSYs
+	iPosServer.NotifyModuleStatusEvent(statusEvent, status, iUidTestStatusPsy);
+	
+	// 11. Enable PSY1
+	moduleUpdate->SetUpdateAvailability(ETrue);
+    db->UpdateModuleL(iUidTestStatusPsy, *moduleUpdate);
+    _LIT(KWaitUpdateModuleL3, "Waiting for status after UpdateModuleL3");
+	INFO_PRINTF1(KWaitUpdateModuleL3);
+
+	User::WaitForRequest(status);
+	AssertTrueL(status.Int() == KErrNone, KWait, status.Int());
+
+	// Open a subsession to PSY.1
+	err = iPositioner2.Open(iPosServer, iUidTestStatusPsy);
+	_LIT(KErrOpenOther, "7. Error when opening subsession to PSY , error code = %d");
+	AssertTrueL(err == KErrNone, KErrOpenOther, err);
+
+    User::After(10000000); //wait for all psy event to timeout
+	// Renew request for all PSYs
+	iPosServer.NotifyModuleStatusEvent(statusEvent, status);
+    User::After(1000000);
+	// 14. Close subsession to PSY1. All events execept close event has happen
+	iPositioner2.Close();
+	_LIT(KStatusClose, "Waiting for status after Close");
+	INFO_PRINTF1(KStatusClose);
+
+	User::WaitForRequest(status);
+	err = status.Int();
+	_LIT(KStatusErr, "status: %d");
+	INFO_PRINTF2(KStatusErr, err);
+	AssertTrueL(err == KErrNone, KWait, err);
+
+
+	// 15. Renew request for PSY1
+	iPosServer.NotifyModuleStatusEvent(statusEvent, status, iUidTestStatusPsy);
+
+    User::After(600000);
+	// 16. Cancel request
+	TInt cancelErr = iPosServer.CancelRequest(EPositionServerNotifyModuleStatusEvent);
+	_LIT(KCancel, "7. Error canceling request, error code = %d");
+	AssertTrueL(cancelErr == KErrNone, KCancel, cancelErr);
+	_LIT(KStatusCancelRequest, "Waiting for status after CancelRequest");
+	INFO_PRINTF1(KStatusCancelRequest);
+
+	User::WaitForRequest(status);
+	AssertTrueL(status.Int() == KErrCancel, KCancel, status.Int());
+	
+	// 17. Cancel request again
+	cancelErr = iPosServer.CancelRequest(EPositionServerNotifyModuleStatusEvent);
+	AssertTrueL(cancelErr == KErrNotFound, KCancel, cancelErr);
+
+	// 18. Request for non-existing PSY.
+	_LIT(KNonExistingPSY, "Request for non-existing PSY");
+	INFO_PRINTF1(KNonExistingPSY);
+	TUid aNonExistingUid;
+	aNonExistingUid.iUid = KUidNonExistingPsy;
+	iPosServer.NotifyModuleStatusEvent(statusEvent, status, aNonExistingUid);
+	_LIT(KStatusWaiting, "Waiting for status");
+	INFO_PRINTF1(KStatusWaiting);
+	
+	User::WaitForRequest(status);
+	AssertTrueL(status.Int() == KErrNotFound, KWait, status.Int());
+	
+    
+	CleanupStack::PopAndDestroy(moduleUpdate);
+    CleanupStack::PopAndDestroy(db);
+    CleanupStack::PopAndDestroy(&client2);
+	
+    _LIT(KClosePositioner, "Calling ClosePositioner");
+	INFO_PRINTF1(KClosePositioner);
+	ClosePositioner();
+	
+	Disconnect();
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp189::CheckModuleStatus
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp189::RequestWaitAndLogEventL(const TInt aEventToListenFor)
+	{
+	TPositionModuleStatusEvent statusEvent;
+	TRequestStatus status = KErrNone;
+
+	if(aEventToListenFor == TPositionModuleStatusEvent::EEventDataQualityStatus)
+		{
+		statusEvent.SetRequestedEvents(TPositionModuleStatusEvent::EEventDataQualityStatus);
+		}
+	else
+		{
+		statusEvent.SetRequestedEvents(TPositionModuleStatusEvent::EEventDeviceStatus);
+		}
+
+	// Renew request
+	iPosServer.NotifyModuleStatusEvent(statusEvent, status, iUidTestStatusPsy);
+	
+	User::WaitForRequest(status);
+	_LIT(KErrLoopOpen, "Error in loop when opening subsession to PSY , error code = %d");
+	AssertTrueL(status.Int() == KErrNone, KErrLoopOpen, status.Int());
+	
+	// Get status information for PSY.
+	TPositionModuleStatus moduleStatus = TPositionModuleStatus();
+	TInt err = iPosServer.GetModuleStatus(moduleStatus, iUidTestStatusPsy);
+	_LIT(KGet, "Error when getting module status from PSY , error code = %d");
+	AssertTrueL(err == KErrNone, KGet, err);
+	CheckModuleStatusL(moduleStatus);
+	}
+// ---------------------------------------------------------
+// CT_LbsClientPosTp189::CheckModuleStatus
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp189::CheckModuleStatusL(const TPositionModuleStatus& aStatus , const TBool /*aCheckStatus*/)
+	{
+	TBuf<KMaxMessageSize> buf;	
+	_LIT(KStatus,"Checking module status");
+	INFO_PRINTF1(KStatus);
+	_LIT(KErrBoundary, "The value on status/quaity is out of range");
+
+    _LIT(KDevSta, "Device Status  =  %d");
+    TInt status = aStatus.DeviceStatus();
+    buf.Format(KDevSta, status);
+	INFO_PRINTF1(buf);
+	buf.Zero();
+	//check that status value is not out of range
+    switch(status)
+        {
+        case TPositionModuleStatus::EDeviceUnknown:
+        case TPositionModuleStatus::EDeviceError:
+        case TPositionModuleStatus::EDeviceInitialising:
+        case TPositionModuleStatus::EDeviceStandBy:
+        case TPositionModuleStatus::EDeviceReady:
+        case TPositionModuleStatus::EDeviceActive:
+        case TPositionModuleStatus::EDeviceInactive: //the psy should not be able to report this
+            break;
+        case TPositionModuleStatus::EDeviceDisabled: //the psy should not be able to report this
+        default:
+            LogErrorAndLeaveL(KErrBoundary);
+        }
+
+    
+
+	_LIT(KDatQual, "Data Quality Status =  %d");
+	TInt quality = aStatus.DataQualityStatus();
+    buf.Format(KDatQual, quality);
+	INFO_PRINTF1(buf);
+	buf.Zero();
+    //check that qauality value is not out of range
+    switch(quality)
+        {
+        case TPositionModuleStatus::EDataQualityUnknown:
+        case TPositionModuleStatus::EDataQualityLoss:
+        case TPositionModuleStatus::EDataQualityPartial:
+        case TPositionModuleStatus::EDataQualityNormal:
+            break;
+        default:
+            LogErrorAndLeaveL(KErrBoundary);
+        }
+	}
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp193.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,129 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp193.h"
+#include "ctlbsposclientholder.h"
+#include <e32keys.h>
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp193::CT_LbsClientPosTp193(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{
+	_LIT(KTestName, "TP193 - Maximum number of Clients");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp193::~CT_LbsClientPosTp193()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp193::CloseTest
+// Always called after the test, even if the test leaves
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp193::CloseTest()
+    {
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp193::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp193::StartL()
+    { 
+	SetupPsyL(iUidTestPsy2);
+	
+	User::After(2000000);
+
+	const TInt KNrOfClients = 25;
+	CT_LbsPosClientHolder* clients = CT_LbsPosClientHolder::NewLC(KNrOfClients,iUidTestPsy2);	
+    
+    TTime starttime,stoptime;
+    
+    starttime.UniversalTime();
+    
+    clients->MakeRequests();
+    
+    stoptime.UniversalTime();
+    
+    // Substract total delay incurred due to TestPsy2...i.e 2sec
+    TInt duration=stoptime.Int64()-starttime.Int64()-2000000;
+    
+    _LIT(KMessage,"25 simultaneous requests from 25 different sessions with a psy completed in %d microsec");
+    TBuf<256> message;
+    message.Format(KMessage,duration);
+    INFO_PRINTF1(message);
+    
+    if(duration>3000000)
+	    {
+	    _LIT(KTime, "Time taken>3 sec");
+	    INFO_PRINTF1(KTime);
+	    }
+
+	//check the result of the request
+	//only KErrNoMemory or KErrNone is allowed.
+	// CONSTANTS
+    
+   TPositionInfo position[KNrOfClients];
+
+    TTimeIntervalMicroSeconds reqTime[KNrOfClients];
+    TInt status;
+    TBool error = EFalse;
+    TBuf<150> buf;
+
+	//some printing mostly used for information purpose.
+    for (TInt i = 0; i < KNrOfClients; i++)
+        {
+        clients->GetResult(status, position[i], reqTime[i], i);
+        if (status != 0)
+            {
+            _LIT(KError, "The position requested could not be retrieved, status = %d");
+            buf.Format(KError, status);
+            ERR_PRINTF1(buf);
+            if (status != -4)
+                {
+                error = ETrue;
+                }
+            }
+            _LIT(KReqMsg, "client %d request time: %d");
+
+            buf.Format(KReqMsg, i, reqTime[i].Int64());
+            INFO_PRINTF1(buf);
+            _LIT(KSeparator, "********");
+            INFO_PRINTF1(KSeparator);
+        }
+
+    if (error)
+        {
+        _LIT(KErrorCode, "The requests was not completed with KErrNoMemory or KErrNone");
+        LogErrorAndLeaveL(KErrorCode);
+        }
+    CleanupStack::PopAndDestroy(clients); //clients
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp194.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,87 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+// INCLUDE FILES
+#include "ctlbsclientpostp194.h"
+#include "ctlbsclientperiodictester.h"
+
+// CONSTANTS
+_LIT(KServiceName1, " aaaaaaaaaaa");
+_LIT(KServiceName2, " bbbbbbbbbbb");
+
+// ================= MEMBER FUNCTIONS =======================
+
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp194::CT_LbsClientPosTp194(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{  
+	_LIT(KTestName, "TP194 - Periodic Updates, Duration test");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp194::~CT_LbsClientPosTp194()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp194::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp194::StartL()
+    {
+    
+	SetupPsyL(iUidMultiPsy);
+
+	TInt numberOfRuns = 100;
+	TTimeIntervalMicroSeconds interval5 = TTimeIntervalMicroSeconds(4000000);
+	TUid uid = iUidMultiPsy;
+	
+	CT_LbsClientPeriodicTester* periodicTester1 = CT_LbsClientPeriodicTester::NewL(interval5, KServiceName1, iLog, uid, numberOfRuns);
+	CleanupStack::PushL(periodicTester1);
+
+	CT_LbsClientPeriodicTester* periodicTester2 = CT_LbsClientPeriodicTester::NewL(interval5, KServiceName2, iLog, uid, numberOfRuns);
+	CleanupStack::PushL(periodicTester2);
+
+	periodicTester1->RequestNotification();
+	periodicTester2->RequestNotification();
+	
+	// Active scheduler is stopped two times.
+	CActiveScheduler::Start();
+	CActiveScheduler::Start();
+
+    //check for errors
+    TBool test1 = periodicTester1 -> IsCompletedOK(); 
+    TBool test2 = periodicTester2 -> IsCompletedOK();
+
+    CleanupStack::PopAndDestroy(2,periodicTester1);
+    
+    if (!test1 || !test2)
+        {
+        _LIT(KError, "Test did not complete with no error, check log file");
+        LogErrorAndLeaveL(KError);
+        }
+
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp195.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,129 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+// INCLUDE FILES
+#include "ctlbsclientpostp195.h"
+#include <LbsPositionInfo.h>
+#include <Lbs.h>
+#include <LbsCommon.h>
+#include <LbsRequestor.h>
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp195::CT_LbsClientPosTp195(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{  
+	_LIT(KTestName, "TP195 - Periodic Updates, Slow PSY");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp195::~CT_LbsClientPosTp195()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp195::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp195::StartL()
+    {
+	SetupPsyL(iUidTestPsy3);
+
+	TInt numberOfRuns = 5;
+	TTimeIntervalMicroSeconds interval = TTimeIntervalMicroSeconds(2000000);
+    const TInt slowPsyUpdate = 4000000;
+    
+    #ifdef __WINS__
+    const TInt KErrorInterval = 2500000;
+    #else
+    const TInt KErrorInterval = 500000;
+    #endif
+
+    
+    RPositionServer	posServer;
+    CleanupClosePushL(posServer);
+    RPositioner positioner;
+    CleanupClosePushL(positioner);
+    TPositionInfo positionInfo = TPositionInfo();
+
+	_LIT(KConnectErr, "Error when connecing to EPos server,  %d");
+	TInt err = posServer.Connect();
+	AssertTrueL(err == KErrNone, KConnectErr, err);
+
+	_LIT(KOpenErr, "Error when opening positioner,  %d");
+	err = positioner.Open(posServer, iUidTestPsy3);
+	AssertTrueL(err == KErrNone, KOpenErr, err);
+
+	TPositionUpdateOptions posOption;
+	posOption.SetUpdateInterval(interval);
+	
+	_LIT(KUpdateErr, "Error when setting update interval,  %d");
+	err = positioner.SetUpdateOptions(posOption);
+	AssertTrueL(err == KErrNone, KUpdateErr, err);
+
+    _LIT(KService ,"Service");
+	positioner.SetRequestor(CRequestor::ERequestorService,
+							 CRequestor::EFormatApplication, KService);
+
+    //do a couple of request and check the times between requests.
+
+    TTime now, startTime;
+    TTimeIntervalMicroSeconds requestTime;
+    _LIT(KErrorRequest, "Error in request");
+    TRequestStatus status;
+    TInt64 reqTime;
+    
+    for (TInt i = 0; i < numberOfRuns; i++)
+        {
+        startTime.UniversalTime();
+        positioner.NotifyPositionUpdate(positionInfo, status);
+        User::WaitForRequest(status);
+        err = status.Int();
+        AssertTrueL(err == KErrNone, KErrorRequest, err);
+        now.UniversalTime();
+        requestTime = now.MicroSecondsFrom(startTime);
+        _LIT(KError, "Request time, %d microsecs.");
+        TBuf<100> buf;
+        reqTime = requestTime.Int64();
+        buf.Format(KError, reqTime);
+        INFO_PRINTF1(buf);
+        if (i != 0)
+            {
+            //check that the time is ok, by accepting an error interval
+            TInt var1 = 2000000 + slowPsyUpdate + KErrorInterval;
+            TInt var2 = 2000000 + (slowPsyUpdate - KErrorInterval);
+            if (reqTime > var1 || reqTime < var2)
+                {
+                _LIT(KErrorInterval, "The update is not within valid range");
+                LogErrorAndLeaveL(KErrorInterval);
+                }
+            }
+        }
+    
+    CleanupStack::PopAndDestroy(&positioner);
+    CleanupStack::PopAndDestroy(&posServer);
+
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp2.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,213 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp2.h"
+#include "ctlbsclientpositionconstants.h"
+#include <LbsSatellite.h>
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp2::CT_LbsClientPosTp2(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{  
+	_LIT(KTestName, "TP2 - Request location from specific PSY");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp2::~CT_LbsClientPosTp2()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp2::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp2::StartL()
+    {
+	SetupPsyL(iUidMultiPsy);
+
+    //synchronous request
+    ConnectL();
+
+    User::LeaveIfError(OpenPositionerByName(iUidMultiPsy));
+
+    TPositionInfo info = TPositionInfo();
+
+	RequestL(info);
+	CheckPositionInfoL(info);
+	
+	TPositionCourseInfo courseInfo;
+
+	RequestL(courseInfo);
+	CheckPositionCourseInfoL(courseInfo);
+
+	TPositionSatelliteInfo satelliteInfo;
+
+	RequestL(satelliteInfo);
+	CheckPositionSatelliteInfoL(satelliteInfo);
+
+
+    HPositionGenericInfo* genericInfo = HPositionGenericInfo::NewLC();
+
+	RequestL(*genericInfo);
+	CheckGenericInfoL(*genericInfo);
+
+    CleanupStack::PopAndDestroy(); //genericInfo
+
+	ClosePositioner();
+
+	Disconnect();
+	}
+
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp2::AssertTrueL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp2::AssertTrueL(TBool aCondition, const TDesC& aErrorMsg)
+    {
+  	if (!aCondition)
+		{
+		LogErrorAndLeaveL(aErrorMsg);
+		}
+    }
+
+void CT_LbsClientPosTp2::RequestL(TPositionInfoBase& aInfoBase)
+	{
+	_LIT(KService, "service");
+    TInt err = PerformSyncRequest(KService, &aInfoBase);
+
+    if (err != KErrNone)
+        {
+        _LIT(KErrorRequest, "The request was not completed with KErrorNone, errCode = %d");
+		TBuf<100> buf;
+		buf.Format(KErrorRequest, err);
+        LogErrorAndLeaveL(buf);
+        }
+
+	_LIT(KIncorrectPsySyncRequestError,
+          "TP2. Position from wrong PSY received (sync request).");
+	AssertTrueL(iUidMultiPsy == aInfoBase.ModuleId(), KIncorrectPsySyncRequestError);
+	}
+
+void CT_LbsClientPosTp2::CheckPositionInfoL(TPositionInfo& aInfo)
+	{
+	TPosition pos;
+	aInfo.GetPosition(pos);
+	CheckPositionL(pos);
+	}
+
+void CT_LbsClientPosTp2::CheckPositionCourseInfoL(TPositionCourseInfo& aCourseInfo)
+	{
+	CheckPositionInfoL(aCourseInfo);
+	TCourse course;
+	aCourseInfo.GetCourse(course);
+	if (course.Heading() != KHeading ||
+		course.Speed() != KSpeed ||
+		course.SpeedAccuracy() != KSpeedAcc ||
+		course.HeadingAccuracy() != KHeadingAcc )
+		{
+		_LIT(KErrCourse, "Course not correct");
+		LogErrorAndLeaveL(KErrCourse);
+		}
+	}
+
+void CT_LbsClientPosTp2::CheckPositionSatelliteInfoL(TPositionSatelliteInfo& aSatelliteInfo)
+	{
+	CheckPositionCourseInfoL(aSatelliteInfo);
+	if((TUint)aSatelliteInfo.NumSatellitesUsed() != KNumberOfSatellitesUsed ||
+	   aSatelliteInfo.SatelliteTime() != TTime(KSatelliteTime) ||
+	   (TUint)aSatelliteInfo.NumSatellitesInView() != KNumberOfSatellitesInView ||
+	   aSatelliteInfo.HorizontalDoP() != KHorizontalDoPValue ||
+	   aSatelliteInfo.VerticalDoP() != KVerticalDoPValue ||
+	   aSatelliteInfo.TimeDoP() != KTimeDoPValue)
+	   {
+		_LIT(KErrBasicSat, "Basic satellite information not correct");
+		LogErrorAndLeaveL(KErrBasicSat);
+		}
+		TInt sats = aSatelliteInfo.NumSatellitesInView();
+	for (int i = 0; i < sats; i++)
+		{
+		TSatelliteData satelliteData;
+		TInt err = aSatelliteInfo.GetSatelliteData(i,satelliteData);
+		if (err != KErrNone)
+			{
+			_LIT(KErrGetSat, "Not possible to get satellite data, error code = %d");
+			TBuf<100> buf;
+			buf.Format(KErrGetSat, err);
+			LogErrorAndLeaveL(buf);
+			}
+		if ( (i%2) == 0 )
+			{
+			if(	satelliteData.SatelliteId() != (KSatelliteId +i) ||
+				satelliteData.Azimuth() != KAzimuth ||
+				satelliteData.Elevation() != KElevation ||
+				satelliteData.IsUsed() != KIsUsed ||
+				satelliteData.SignalStrength() != KSignalStrength)
+				{
+				_LIT(KErrSatDataEven, "Incorrect satellite data on even satellites");
+				LogErrorAndLeaveL(KErrSatDataEven);
+				}
+			}
+		else
+			{
+			if(	satelliteData.SatelliteId() != (KSatelliteId +i) ||
+				satelliteData.Azimuth() != KAzimuthOdd ||
+				satelliteData.Elevation() != KElevationOdd ||
+				satelliteData.IsUsed() != KIsUsedOdd ||
+				satelliteData.SignalStrength() != KSignalStrengthOdd)
+				{
+				_LIT(KErrSatDataOdd, "Incorrect satellite data on odd satellites");
+				LogErrorAndLeaveL(KErrSatDataOdd);
+				}
+			}
+
+		}
+	}
+
+void CT_LbsClientPosTp2::CheckGenericInfoL(HPositionGenericInfo& aGenericInfo)
+	{
+	CheckPositionInfoL(aGenericInfo);
+
+	}
+
+void CT_LbsClientPosTp2::CheckPositionL(TPosition& aPos)
+	{
+	if (aPos.Time() != TTime(KPositionTime) ||
+		aPos.HorizontalAccuracy() != KHorizontalAcc ||
+		aPos.VerticalAccuracy() != KVerticalAcc ||
+		aPos.Latitude() != KLatitude ||
+		aPos.Longitude() != KLongitude ||
+		aPos.Altitude() != KAltitude)
+		{
+		_LIT(KErrPosition, "Wrong position returned");
+		LogErrorAndLeaveL(KErrPosition);
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp201.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,188 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+// INCLUDE FILES
+#include "ctlbsclientpostp201.h"
+#include <LbsPositionInfo.h>
+#include <Lbs.h>
+#include <LbsCommon.h>
+#include <LbsRequestor.h>
+#include <s32file.h>
+#include "ctlbsclientobserver.h"
+
+// CONSTANTS
+const TInt KSecond = 1*1000*1000;
+const TInt KMaxSentenceLength = 60; //Max length of each line in EXEClient-logfile
+const TInt KNoOfEXCalls = 3; // Nr of calls to ExeClient
+_LIT(KExeClientPath, "ctlbsexeclient");
+_LIT(KExeResultPath, "c:\\logs\\execlientresult%d.txt");
+_LIT(KSucce, "Test %d was successful");
+_LIT(KFail, "Test %d failed");
+_LIT8(KSuccess, "SUCCESS"); //String to search for that indicates the test was succesful
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp201::CT_LbsClientPosTp201(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{  
+	_LIT(KTestName, "TP201 - Exe Client");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp201::~CT_LbsClientPosTp201()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp201::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp201::StartL()
+    {
+	
+    //This test can be run on emulator now.
+	TInt result;
+	TInt i;
+	TInt foundsucces; 
+	RProcess execlient[KNoOfEXCalls];
+	RFile file;
+	RFileReadStream fstream;
+	RFs fileSession;
+	User::LeaveIfError(fileSession.Connect());
+	CleanupClosePushL(fileSession);
+	CleanupClosePushL(fstream);
+	CleanupClosePushL(file);
+	CFileMan* fileMan = CFileMan::NewL(fileSession);
+	CleanupStack::PushL(fileMan);
+
+	_LIT(KRemoveFiles, "Remove files");
+	INFO_PRINTF1(KRemoveFiles);
+
+	//1. First check for old ExeClientResult-files to remove.
+	TBuf<40> filepath;
+    filepath.Append(KExeResultPath);
+	for ( i = 1; i<=KNoOfEXCalls; i++)
+		{
+		filepath.Format(KExeResultPath,i);
+		TInt err = fileMan->Delete(filepath, CFileMan::EOverWrite);
+		if (err != KErrNone && err != KErrNotFound)
+			{
+			_LIT(KErrRemoveDll, "Removal of a previous ExeClientResult-file failed!");
+			TBuf<50> buf;
+			buf.Format(KErrRemoveDll, err);
+			LogErrorAndLeaveL(buf);
+			}
+		}	
+	
+	_LIT(KStartClients, "Start clients");
+	INFO_PRINTF1(KStartClients);
+
+	//2. Make 3 calls to ExeClient.
+	for ( i = 1; i<= KNoOfEXCalls; i++)
+		{
+		//Start the execlient-process
+		result = execlient[i-1].Create(KExeClientPath, KNullDesC);
+		User::LeaveIfError(result);
+		execlient[i-1].Resume();	//make the execlient visible
+		User::After(6000000);
+		}
+	
+	CT_LbsClientObserver::WaitForEPosShutdown(); //Wait for Epos to complete
+    User::After(KSecond); //Wait for completion of writing to files. 1 minute.
+	for ( i = 0; i < KNoOfEXCalls; i++)
+		{	
+		TRequestStatus closed;
+		execlient[i].Logon(closed);
+		User::WaitForRequest(closed);
+
+	    TBuf<100> exit;
+	    _LIT(KExitClient, "Client %d exited: Type %d, Reason %d");
+	    exit.Format(KExitClient, 
+            	    i+1, execlient[i].ExitType(), execlient[i].ExitReason());
+        INFO_PRINTF1(exit);
+
+		execlient[i].Close(); //Close handle to exe-client
+		}
+	_LIT(KCheckResults, "Check results");
+	INFO_PRINTF1(KCheckResults);
+
+	//3. See if all calls were successes
+	TBuf<40> successinfo;
+	successinfo.Append(KSucce);
+	TBuf<40> failinfo;
+	failinfo.Append(KFail);
+	for ( i = 1; i <= KNoOfEXCalls; i++)
+		{
+		filepath.Format(KExeResultPath,i);
+		User::LeaveIfError(file.Open(fileSession, filepath, EFileShareReadersOnly));//open read only
+		fstream.Attach(file);
+
+		TBuf8<KMaxSentenceLength> dbuffer; //Buffer to place read data from file
+		TBuf8<KMaxSentenceLength> prevbuffer; //Buffer to place previous read data from file
+		TBool search = ETrue;
+		const TChar eoline(';');
+		while (search) 
+			{ 
+			dbuffer.Delete(0, KMaxSentenceLength);
+			TRAPD(ferr, (fstream.ReadL(dbuffer,eoline)));
+			if ( ferr == KErrEof) 
+				{
+				search = EFalse; //stop searching
+				}
+			else if ( ferr == KErrNone)
+				{
+				prevbuffer.Delete(0, KMaxSentenceLength);
+				prevbuffer = dbuffer;
+				}
+			else 
+				{
+				_LIT(KReadError, "Error when reading from log-file.");
+				LogErrorAndLeaveL(KReadError);
+				}
+			}
+		//Check if success
+		foundsucces = prevbuffer.Find(KSuccess);
+		if ( foundsucces != KErrNotFound)
+			{
+			successinfo.Format(KSucce,i);
+			INFO_PRINTF1(successinfo);
+			}
+		else
+			{
+			failinfo.Format(KFail,i);
+			LogErrorAndLeaveL(failinfo);
+			}
+		} //for
+
+	_LIT(KDone, "Done.");
+	INFO_PRINTF1(KDone);
+
+	//4. Let's clean...
+	CleanupStack::PopAndDestroy(fileMan); //fileMan
+	CleanupStack::PopAndDestroy(&file); //file
+	CleanupStack::PopAndDestroy(&fstream); //fstream
+	CleanupStack::PopAndDestroy(&fileSession); //fileSession
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp203.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,433 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+// INCLUDE FILES
+#include "ctlbsclientpostp203.h"
+#include "ctlbsrequester.h"
+#include <LbsPositionInfo.h>
+#include <Lbs.h>
+#include <LbsCommon.h>
+#include <LbsRequestor.h>
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+
+// ================= MEMBER FUNCTIONS =======================
+
+// Constructor.
+CT_LbsClientPosTp203::CT_LbsClientPosTp203(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+    {  
+    _LIT(KTestName, "TP203 - Periodic Update, default psy");
+    SetTestStepName(KTestName); 
+    }
+
+// Destructor
+CT_LbsClientPosTp203::~CT_LbsClientPosTp203()
+    {
+    RDebug::Print(_L("CT_LbsClientPosTp203::~CT_LbsClientPosTp203"));
+    }
+
+// ---------------------------------------------------------
+// CPosTp203::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp203::CloseTest()
+    {
+    RDebug::Print(_L("CT_LbsClientPosTp203::CloseTest"));
+
+    delete iPeriodicTimer;
+    iPeriodicTimer = NULL;
+    }
+
+// ---------------------------------------------------------
+// CPosTp203::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp203::StartL()
+    {
+    const TInt KLongErrorInterval = 3000000;
+    
+#ifdef __WINS__
+    const TInt KNormalErrorInterval = 1500000;
+#else
+    const TInt KNormalErrorInterval = 500000;
+#endif
+    
+    
+    TInt numberOfRuns = 6;
+    TInt normalInterval = 4500000;
+    // Using the same interval as the slow psy (TestPsy3) to make things easy.
+	TTimeIntervalMicroSeconds interval = TTimeIntervalMicroSeconds(normalInterval);
+    TTimeIntervalMicroSeconds shortInterval = TTimeIntervalMicroSeconds(1500000);
+
+    // Will happen the first time when default is changed
+    TInt longInterval = 8500000; 
+    TInt errorInterval = KNormalErrorInterval;
+
+    TInt requestUpdate = normalInterval;
+
+    RPositionServer	posServer;
+    CleanupClosePushL(posServer);
+	TInt err = posServer.Connect();
+	_LIT(KConnectErr, "Error when connecing to EPos server,  %d");
+	AssertTrueL(err == KErrNone, KConnectErr, err);  
+    
+	SetupPsyL(iUidMultiPsy);
+
+    RPositioner positioner;
+    CleanupClosePushL(positioner);
+    err = positioner.Open(posServer); // Use Default PSY
+	_LIT(KOpenErr, "Error when opening positioner,  %d");
+	AssertTrueL(err == KErrNone, KOpenErr, err);
+
+	TPositionInfo positionInfo = TPositionInfo();
+	TPositionUpdateOptions posOption;
+	posOption.SetUpdateInterval(interval);
+	
+	err = positioner.SetUpdateOptions(posOption);
+	_LIT(KUpdateErr, "Error when setting update interval,  %d");
+	AssertTrueL(err == KErrNone, KUpdateErr, err);
+
+    _LIT(KService ,"Service");
+	positioner.SetRequestor(CRequestor::ERequestorService,
+							 CRequestor::EFormatApplication, KService);
+
+    // Do a couple of request and check the times between requests.
+    TTime now, startTime;
+    TTimeIntervalMicroSeconds requestTime;
+    _LIT(KErrorRequest, "Error in request");
+    TRequestStatus status;
+    TInt64 reqTime;
+   
+    for (TInt i = 0; i < numberOfRuns; i++)
+        {
+        TBuf<100> info;
+        _LIT(KInfo, "Making request %d");
+    	info.Format(KInfo, i);
+        INFO_PRINTF1(info);
+        if (i == 2)
+            {
+            _LIT(KSetTestPSY3, "Setting up TestPsy3");
+            INFO_PRINTF1(KSetTestPSY3);
+            SetupPsyL(iUidTestPsy3);
+            User::After(1000000);
+            requestUpdate = longInterval;
+            errorInterval = KLongErrorInterval;
+            }
+        else
+            {
+            requestUpdate = normalInterval;
+            errorInterval = KNormalErrorInterval;
+            }
+        
+        _LIT(KWaitStatus1, "Waiting for status after NotifyPositionUpdate1");
+        INFO_PRINTF1(KWaitStatus1);
+        
+        startTime.UniversalTime();
+        positioner.NotifyPositionUpdate(positionInfo, status);
+        User::WaitForRequest(status);
+        now.UniversalTime();
+        
+        err = status.Int();
+        AssertTrueL(err == KErrNone, KErrorRequest, err);
+
+        requestTime = now.MicroSecondsFrom(startTime);
+        _LIT(KError, "Request time, %d microsecs.");
+        TBuf<100> buf;
+        reqTime = requestTime.Int64();
+        buf.Format(KError, reqTime);
+        INFO_PRINTF1(buf);
+        
+        if (i != 0)
+            {
+            // Check that the time is ok, by accepting an error interval
+            if (reqTime > (requestUpdate + errorInterval) || 
+            	reqTime < (requestUpdate - errorInterval))
+                {
+                _LIT(KErrorInterval, "The update is not within valid range");
+                LogErrorAndLeaveL(KErrorInterval);
+                }
+            }
+        
+        // Check that position was returned from correct PSY:
+        if (i < 2)
+        	{
+        	VerifyPositionFromL(positionInfo, iUidMultiPsy);
+        	}
+        else
+        	{
+        	VerifyPositionFromL(positionInfo, iUidTestPsy3);
+        	}
+        }
+    
+	_LIT(KSetUpdateOptions, "Calling SetUpdateOptions");
+	INFO_PRINTF1(KSetUpdateOptions);
+	posOption.SetUpdateInterval(shortInterval);
+	err = positioner.SetUpdateOptions(posOption);
+	AssertTrueL(err == KErrNone, KUpdateErr, err);
+
+    // Set up three PSYs the two onces with top priorities supports tracking 
+	// and the third one does not
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+
+    _LIT(KSetPriority0, "Enabling Tracking PSY with priority 0");
+	INFO_PRINTF1(KSetPriority0);
+    moduleUpdate->SetUpdateAvailability(ETrue);
+	User::After(1000000);
+	
+    db->UpdateModuleL(iUidTestTrackingPsy, *moduleUpdate);
+    db->SetModulePriorityL(iUidTestTrackingPsy, 0);
+	User::After(1000000);
+	
+	
+	
+	_LIT(KSetPriority1, "Enabling Timer PSY with priority 1");
+	/*INFO_PRINTF1(KSetPriority1);
+    db->UpdateModuleL(iUidTestTimerPsy, *moduleUpdate);
+    db -> SetModulePriorityL(iUidTestTimerPsy, 1);
+	User::After(1000000);*/
+
+	_LIT(KSetPriority2, "Enabling Multi PSY with priority 2");
+	/*INFO_PRINTF1(KSetPriority2);
+    db->UpdateModuleL(iUidMultiPsy, *moduleUpdate);
+    db -> SetModulePriorityL(iUidMultiPsy, 2);
+    User::After(1000000); // just to let the events happen in the server.*/
+    
+    
+    // Make one request to ensure that Start tracking is called.
+    positioner.NotifyPositionUpdate(positionInfo, status);
+    _LIT(KWaitStatus2, "Waiting for status after NotifyPositionUpdate2");
+    INFO_PRINTF1(KWaitStatus2);
+    RDebug::Print(KWaitStatus2);    
+    User::WaitForRequest(status);
+    err = status.Int();
+    AssertTrueL(err == KErrNone || err == KPositionQualityLoss, KErrorRequest, err);
+
+    TPosition pos;
+    positionInfo.GetPosition(pos);    
+    User::After(1000000);
+
+    // TestTrackingPsy returns 65.0 for Tracking requests and 30.0 for ordinary position requests
+    _LIT(KErrorAndLeave, "Wrong position returned from tracking PSY");
+    if (pos.Latitude() != 65.0 || pos.Longitude() != 65.0 || pos.Altitude() != 65.0)
+        {
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+	INFO_PRINTF1(KSetPriority1);
+    db->UpdateModuleL(iUidTestTimerPsy, *moduleUpdate);
+    db -> SetModulePriorityL(iUidTestTimerPsy, 1);
+	User::After(2000000); // MH move
+	
+    // Disable the psy with top priority, should result in switch of psy
+    _LIT(KDisablePSY, "Disabling Tracking PSY");
+    INFO_PRINTF1(KDisablePSY);
+    moduleUpdate->SetUpdateAvailability(EFalse);
+    db->UpdateModuleL(iUidTestTrackingPsy, *moduleUpdate);
+    // To let the events happen in the server.
+    User::After(2000000); 
+    
+    // Make one request to enable tracking
+    positioner.NotifyPositionUpdate(positionInfo, status);
+    _LIT(KWaitStatus4, "Waiting for status after NotifyPositionUpdate4");
+    INFO_PRINTF1(KWaitStatus4);
+    RDebug::Print(KWaitStatus4);    
+    User::WaitForRequest(status);
+    err = status.Int();
+    AssertTrueL(err == KErrNone || err == KPositionQualityLoss, KErrorRequest, err);
+
+    positionInfo.GetPosition(pos);
+    
+    // To let the events happen in the server.
+    User::After(2000000);
+        
+    // TestTimerPsy returns 55.0 for Tracking requests and 20.0 for ordinary position requests
+    if (pos.Latitude() != 55.0 || pos.Longitude() != 55.0 || pos.Altitude() != 55.0)
+        {
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    // Enable the psy with top priority, should result in switch back to that psy
+    _LIT(KEnablePSY, "Enabling tracking PSY");
+    INFO_PRINTF1(KEnablePSY);
+    moduleUpdate->SetUpdateAvailability(ETrue);
+    db->UpdateModuleL(iUidTestTrackingPsy, *moduleUpdate);
+    User::After(2000000); // just to let the events happen in the server.
+
+	// To enable tracking    
+    positioner.NotifyPositionUpdate(positionInfo, status);
+    _LIT(KWaitStatus6, "Waiting for status after NotifyPositionUpdate6");
+    INFO_PRINTF1(KWaitStatus6);
+    User::WaitForRequest(status);
+    err = status.Int();
+    AssertTrueL(err == KErrNone || err == KPositionQualityLoss, KErrorRequest, err);
+
+    // To let the events happen in the server.
+	User::After(2000000); 
+
+    positionInfo.GetPosition(pos);
+    // TestTrackingPsy returns 65.0 for Tracking requests and 30.0 for ordinary position requests
+    if (pos.Latitude() != 65.0 || pos.Longitude() != 65.0 || pos.Altitude() != 65.0)
+        {
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+    
+	INFO_PRINTF1(KSetPriority2);
+    db->UpdateModuleL(iUidMultiPsy, *moduleUpdate);
+    db -> SetModulePriorityL(iUidMultiPsy, 2);
+    // To let the events happen in the server. //MH
+    User::After(1000000); 
+
+    // Disable two psys with top priority that supports tracking.
+    _LIT(KDisableTimer,"Disabling Timer and Tracking PSY");
+    INFO_PRINTF1(KDisableTimer);
+    moduleUpdate->SetUpdateAvailability(EFalse);
+    db->UpdateModuleL(iUidTestTimerPsy, *moduleUpdate);
+    db->UpdateModuleL(iUidTestTrackingPsy, *moduleUpdate);
+    User::After(2000000); // just to let the events happen in the server.
+
+    positioner.NotifyPositionUpdate(positionInfo, status);
+    _LIT(KWaitStatus8, "Waiting for status after NotifyPositionUpdate8");
+    INFO_PRINTF1(KWaitStatus8);
+    User::WaitForRequest(status);
+    err = status.Int();
+    AssertTrueL(err == KErrNone, KErrorRequest, err);
+
+    if (iUidMultiPsy.iUid != positionInfo.ModuleId().iUid)
+		{
+		_LIT(KIncorrectPsyError,
+           "Position from wrong PSY received");
+		LogErrorAndLeaveL(KIncorrectPsyError);
+		}
+
+    // Disable a PSY during ongoing requesting
+    // Enable the the top three PSYs
+    _LIT(KEnableTimer,"Enabling Timer PSY");
+	INFO_PRINTF1(KEnableTimer);
+    moduleUpdate->SetUpdateAvailability(ETrue);
+    db->UpdateModuleL(iUidTestTimerPsy, *moduleUpdate);
+    db->UpdateModuleL(iUidTestTrackingPsy, *moduleUpdate);
+    moduleUpdate->SetUpdateAvailability(EFalse);
+    db->UpdateModuleL(iUidMultiPsy, *moduleUpdate);
+    // To let the events happen in the server.
+    User::After(2000000); 
+
+    const TInt KRequestInterval = 4000000;
+    TCallBack callback(DisablePsyL, this);
+    iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityStandard);
+    TTimeIntervalMicroSeconds32 disableTime = TTimeIntervalMicroSeconds32(2000000);
+    iPeriodicTimer->Start(disableTime, disableTime, callback);
+    CT_LbsRequester* request = CT_LbsRequester::NewL(this, KRequestInterval, Logger());   // TTF = 0s
+    CleanupStack::PushL(request);
+
+    // To enable tracking
+    _LIT(KRequest1, "Calling request->StartRequest1");
+    INFO_PRINTF1(KRequest1);
+    request->StartRequest(); // only one request should exist
+
+    CActiveScheduler::Start();
+
+    err = request ->CompletionCode();
+    _LIT(KErrCode, "Competion code is not KErrNone");
+    AssertTrueL(err == KErrNone, KErrCode, err);
+
+    request->GetPositionInfo(positionInfo);
+    User::After(2000000);    
+   
+    // Should get tracking data
+    _LIT(KRequest2, "Calling request->StartRequest2");
+    INFO_PRINTF1(KRequest2);
+    request->StartRequest(); // only one request should exist in reqlog
+
+    CActiveScheduler::Start();
+
+    err = request ->CompletionCode();
+    AssertTrueL(err == KErrNone, KErrCode, err);
+
+    request ->GetPositionInfo(positionInfo);
+    positionInfo.GetPosition(pos);
+
+    if (iUidTestTimerPsy.iUid != positionInfo.ModuleId().iUid)
+		{
+		_LIT(KIncorrectPsyError,
+           "Position from wrong PSY received");
+		LogErrorAndLeaveL(KIncorrectPsyError);
+		}
+    // TestTimerPsy returns 55.0 for Tracking requests and 20.0 for ordinary position requests
+    if (pos.Latitude() != 55.0 || pos.Longitude() != 55.0 || pos.Altitude() != 55.0)
+        {
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    _LIT(KSetPSY, "Setting up Tracking PSY");
+	INFO_PRINTF1(KSetPSY);
+    SetupPsyL(iUidTestTrackingPsy);
+    User::After(1500000); // just to let the events happen in the server.
+
+    CT_LbsRequester* request2 = CT_LbsRequester::NewL(this, interval, Logger());   // TTF = 0s
+    CleanupStack::PushL(request2);
+
+    iPeriodicTimer->Start(disableTime, disableTime, callback);
+    _LIT(KRequest3, "Calling request2->StartRequest");
+    INFO_PRINTF1(KRequest3);
+    request2->StartRequest(); // only one request should exist in reqlog
+
+    CActiveScheduler::Start();
+
+    err = request2 ->CompletionCode();
+    _LIT(KErrNotFoundCode, "Competion code is not KErrNone");
+    AssertTrueL(err == KErrNone, KErrNotFoundCode, err);
+
+    CleanupStack::PopAndDestroy(request2);
+    CleanupStack::PopAndDestroy(request);
+    CleanupStack::PopAndDestroy(moduleUpdate);
+    CleanupStack::PopAndDestroy(db);
+
+    CleanupStack::PopAndDestroy(&positioner);
+    CleanupStack::PopAndDestroy(&posServer);
+    
+    RDebug::Print(_L("CT_LbsClientPosTp203::StartL end"));
+	}
+
+TInt CT_LbsClientPosTp203::DisablePsyL(TAny* aSelf)
+    {
+    // Do not forget to cancel the timer
+    CT_LbsClientPosTp203* self = static_cast<CT_LbsClientPosTp203*> (aSelf);
+    self -> iPeriodicTimer -> Cancel();
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+    moduleUpdate->SetUpdateAvailability(EFalse);
+    TUid trackingId;
+    trackingId.iUid = KUidTestTrackingPsy;
+    db->UpdateModuleL(trackingId, *moduleUpdate);
+    CleanupStack::PopAndDestroy(moduleUpdate);
+    CleanupStack::PopAndDestroy(db);
+    return KErrNone;
+    }
+
+void CT_LbsClientPosTp203::RequestCompleteL()
+    {
+    CActiveScheduler::Stop();
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp204.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,129 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp204.h"
+#include "ctlbsclientobserver.h"
+#include <sbeclient.h>
+#include <babackup.h>
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include "ctlbsclientpositionconstants.h"
+
+// CONSTANTS
+
+// Constructor.
+CT_LbsClientPosTp204::CT_LbsClientPosTp204(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+    { 
+    _LIT(KTestName, "TP204 - BackUpTest");
+    SetTestStepName(KTestName); 
+    }
+
+// Destructor
+CT_LbsClientPosTp204::~CT_LbsClientPosTp204()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPosTp215::CloseTest
+// Always called after the test, even if the test leaves
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp204::CloseTest()
+    {
+    }
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPosTp204::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp204::StartL()
+    {
+    
+    TDriveList nullDriveList;
+	nullDriveList.Zero();
+	
+	using namespace conn;    
+    CSBEClient* SbeClient = CSBEClient::NewL();
+    CleanupStack::PushL(SbeClient);
+    
+    iCompletedRequests = 0;
+    
+    RPositionServer server;
+    CleanupClosePushL(server);
+    TInt err = server.Connect();
+    if (err != KErrNone)
+        {
+	  	_LIT(KBackupError1, "Cannot connect to Server");
+		INFO_PRINTF1(KBackupError1);				
+        User::Leave(KErrGeneral);
+        }
+
+  	_LIT(KBackupLog1, "connect to server success");
+	INFO_PRINTF1(KBackupLog1);				
+	server.Close();
+	
+    SbeClient->SetBURModeL(nullDriveList, EBURBackupFull, EBackupBase);
+	User::After(500000); // Wait for 500 milli seconds
+	
+    err = server.Connect();
+    if (err == KErrNone)
+        {
+	  	_LIT(KBackupError2, "connect to server works :-(");
+		INFO_PRINTF1(KBackupError2);				
+        User::Leave(KErrGeneral);
+        }
+
+	server.Close();
+
+    SbeClient->SetBURModeL(nullDriveList, EBURNormal, ENoBackup);
+	User::After(500000); // Wait for 500 milli seconds
+	
+    err = server.Connect();
+    if (err != KErrNone)
+        {
+	  	_LIT(KBackupError3, "connect to server doesn't work :-(");
+		INFO_PRINTF1(KBackupError3);				
+        User::Leave(KErrGeneral);
+        }
+
+    CleanupStack::PopAndDestroy(2);
+    
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp25::RequestCompleteL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp204::RequestCompleteL()
+    {
+    const TInt KNofRequesters = 3;
+    if (++iCompletedRequests == KNofRequesters)
+        {
+        CActiveScheduler::Stop();
+        }
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp208.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,556 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp208.h"
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+
+// CONSTANTS
+static const TInt KNrOfClients = 5;
+static const TInt KNrOfRuns = 20;
+
+static const TInt KServerMinHeapSize =  4096;
+static const TInt KServerMaxHeapSize =  128000;
+
+
+_LIT(KThread2Name, "req_location1");
+_LIT(KThread3Name, "req_location2");
+_LIT(KErrMsgThreadCreation, "failed to create thread");
+
+// ================= MEMBER FUNCTIONS =======================
+
+// Constructor.
+CT_LbsClientPosTp208::CT_LbsClientPosTp208(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+    {  
+    _LIT(KTestName, "TP208-Multi Thread Connection");
+    SetTestStepName(KTestName); 
+    }
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp208::~CT_LbsClientPosTp208()
+	{
+	}
+
+// ---------------------------------------------------------
+// CPosTp208::CloseTest
+// Always called after the test, even if the test leaves
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp208::CloseTest()
+    {
+    ClosePositioner();
+    Disconnect();
+    }
+
+// Struct passed to the thread in a TAny* 
+struct MyAnyData
+{
+    TBool     iFullTest; // If fulltest defined
+    TInt      iNrOfRuns; // number if requests to make for each thread
+};
+
+//
+// Performes the test by connecting to MLFW  
+// (and makes a number of Location requests if aFullTest is true
+//
+void DoTestL(TBool aFullTest, TInt aNumberOfRuns, TInt *aResult)
+    {
+    RPositionServer	posServer;
+	TInt errorCode = errorCode = posServer.Connect();
+
+    if (errorCode != KErrNone)
+        {
+        *aResult = KErrCouldNotConnect;
+        return;
+        }
+    CleanupClosePushL(posServer);
+
+    RPositioner positioner;
+
+
+    // Full test means requesting position updates
+    if (aFullTest)
+        {
+        TPositionInfo positionInfo = TPositionInfo();
+        const TInt32 KUidMultiPsy = 0x01010176;
+        TUid uidMultiPsy;
+        uidMultiPsy.iUid = KUidMultiPsy;
+        errorCode = positioner.Open(posServer, uidMultiPsy);
+        
+        if (errorCode != KErrNone) 
+        {
+            *aResult = errorCode;
+            return;
+        }
+        CleanupClosePushL(positioner);
+        
+        _LIT(KService ,"Service");
+        errorCode = positioner.SetRequestor(CRequestor::ERequestorService,
+            CRequestor::EFormatApplication, KService);
+        
+        if (errorCode != KErrNone)
+        {
+            *aResult = 1001;
+            return;
+        }
+        
+        TRequestStatus status;
+        TLocality loca(TCoordinate(0,0,0),0);
+        TPosition pos(loca, TTime(0));
+
+        for (TInt i = 0; i < aNumberOfRuns; i++)
+        {
+            positionInfo.SetPosition(pos);
+            positioner.NotifyPositionUpdate(positionInfo, status);
+            User::WaitForRequest(status);
+            TInt err = status.Int();
+            if (err != KErrNone)
+            {
+                *aResult = err;
+            }
+            TPosition result;
+            positionInfo.GetPosition(result);
+            
+            //sanity check
+            if (result.Latitude() == pos.Latitude() ||
+                result.Longitude() == pos.Longitude() ||
+                result.Altitude() == pos.Altitude())
+            {
+                //_LIT(KErrorPositon, "ERROR:: The postion was not updated");
+                errorCode = 1005;
+            }   
+        }
+        positioner.Close();
+        CleanupStack::PopAndDestroy(&positioner);
+    }
+    
+    posServer.Close();
+    CleanupStack::PopAndDestroy(&posServer);
+    }
+
+// ---------------------------------------------------------
+// LOCAL_C TInt MyThreadFunctionL(TAny* aData)
+// Runs the DoTestL in a TRAP nest
+// Panics this thread if any errors occurred
+// ---------------------------------------------------------
+//
+LOCAL_C TInt MyThreadFunctionL(TAny* aData)
+  {
+  __UHEAP_MARK;
+	CTrapCleanup* cleanup=CTrapCleanup::New(); // get clean-up stack
+
+    // Read parameters from TAny*
+    MyAnyData* info = (MyAnyData*) aData;
+
+    TInt result = KErrNone;
+    TInt err = KErrNone;
+    // Why must this function be TRAPPED?
+    TRAP(err, DoTestL(info->iFullTest, info->iNrOfRuns, &result));
+
+    _LIT(KErrorConnect, "Error when connecting to RPositionServer");
+    __ASSERT_ALWAYS(!err, User::Panic(KErrorConnect, err));
+    __ASSERT_ALWAYS(result == KErrNone, User::Panic(KErrorConnect, result));
+
+	delete cleanup; // destroy clean-up stack
+	__UHEAP_MARKEND;
+  return 0;
+  }
+
+// ---------------------------------------------------------
+// CPosTp208::StartThreads
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt CT_LbsClientPosTp208::StartThreads(TBool aFullTest)
+    {
+    TFixedArray<TRequestStatus, KNrOfClients> statusArray;
+    TFixedArray<RThread, KNrOfClients> threadArray;
+    TFixedArray<TInt, KNrOfClients> retArray;
+   
+    TBuf<150> buf;
+    TInt errorsFound = KErrNone;
+    _LIT(KInfoCreate, "Creating threads");
+    INFO_PRINTF1(KInfoCreate);
+    _LIT(KThreadName, "Thread %d");
+
+    // Introduce parameters for each thread.
+    MyAnyData info;
+
+    info.iNrOfRuns = KNrOfRuns;
+    info.iFullTest = aFullTest;
+    // Make sure that if one of the threads panic, whole emulator is not
+    // paniced (this has effect only in Wins).
+    TBool jit = User::JustInTime();
+    User::SetJustInTime(EFalse);
+
+    TInt i=0;
+    for (i=0; i<KNrOfClients; i++)
+        {
+        iThreadCount++;
+        buf.Zero();
+        buf.Format(KThreadName, iThreadCount);
+        retArray[i] = threadArray[i].Create(buf, MyThreadFunctionL, KDefaultStackSize, KServerMinHeapSize, KServerMaxHeapSize, &info);
+        if (retArray[i] != KErrNone)
+            {
+            _LIT(KErr, "Error when creating thread%d, errorcode %d");
+            buf.Format(KErr, i, retArray[i]);
+            INFO_PRINTF1(buf);
+            errorsFound++;
+            }
+        else 
+            {
+            _LIT(KErr, "Created thread %d");
+            buf.Format(KErr, i);
+            INFO_PRINTF1(buf);
+            threadArray[i].Logon(statusArray[i]); 
+            }
+        }
+ 
+    for (TInt j=0; j<KNrOfClients; j++)
+        {
+        if (retArray[j] == KErrNone) 
+            {
+            buf.Zero();
+            _LIT(KInfoResume, "Resuming thread %d");
+            buf.Format(KInfoResume, j);
+            //if (bDEBUG) 
+            INFO_PRINTF1(buf);
+            User::After(6000000);
+            threadArray[j].Resume();
+            }
+        }
+	for (i = KNrOfClients-1; i>=0; i--)
+        {
+
+        if (retArray[i] == KErrNone) User::WaitForRequest(statusArray[i]);
+        
+        buf.Zero();
+        buf.Format(KThreadName, i);
+
+        _LIT(KWaitForRequest, " User::WaitForRequest ");
+        buf.Append(KWaitForRequest);
+        INFO_PRINTF1(buf);
+
+        buf.Zero();
+        buf.Format(KThreadName, i);
+
+        if (threadArray[i].ExitType() == EExitPanic)
+            {
+            _LIT(KPanicExit, " EExitPanic ");
+            buf.Append(KPanicExit); 
+            INFO_PRINTF1(buf);
+            errorsFound++;
+            }
+        else if (threadArray[i].ExitType() == EExitKill)
+            {
+            _LIT(KKillExit, " EExitKill");
+            buf.Append(KKillExit); 
+            INFO_PRINTF1(buf);
+            }
+        else if (threadArray[i].ExitType() == EExitPending)
+            {
+            _LIT(KPendingExit, " EExitPending");
+            buf.Append(KPendingExit); 
+            INFO_PRINTF1(buf);
+            errorsFound++;
+            }
+        else
+            {
+            _LIT(KOtherExit, " other ");
+            buf.Append(KOtherExit);
+            INFO_PRINTF1(buf);
+            errorsFound++;
+            }
+        }
+
+      for (i=0; i<KNrOfClients; i++)
+        {
+         buf.Zero();
+         _LIT(KDEBUG, "Wrong reasoncode from Thread %d reasoncode %d");
+         buf.Format(KDEBUG, i, threadArray[i].ExitReason());
+         if (threadArray[i].ExitReason() != KErrNone) INFO_PRINTF1(buf);
+         threadArray[i].Close();
+        }
+
+    // Only affected on WINS emulator
+    User::SetJustInTime(jit);
+
+    return errorsFound;
+    }
+
+
+/**
+ * Connection is opened to location server,and closed
+ *
+ * If anything fails during the execution of this test, then function
+ * leaves with proper error code.
+ *
+ * Parameters:
+ **/
+void LocationRequestThreadMainPartL(TDes& aErrorBuf)
+    {
+    // Open connection to Location server
+    RPositionServer server;
+
+    TInt err = server.Connect(); 
+
+    if (err != KErrNone)
+        {
+        _LIT(KErrOpen, "Server open failed with code %d\r\n");
+        aErrorBuf.Format(KErrOpen, err);
+        }
+    else
+        {
+        _LIT(KOkOpen, "Server open ok\r\n");
+        aErrorBuf.Copy(KOkOpen);
+        }
+
+    User::LeaveIfError(err);
+
+    CleanupClosePushL(server);
+
+
+    CleanupStack::PopAndDestroy(1); // server, positioner
+
+    _LIT(KInfTestComplet, "Test completed ok for this thread\r\n");
+    aErrorBuf.Append(KInfTestComplet);
+    }
+
+/**
+ * This is the main function for threads that connects and
+ * disconnect from MLFW
+ *
+ * Function returns 0 if running of the test did not leave.
+ *Otherwise the leave code is returned.
+ **/
+LOCAL_C TInt LocationRequestThread(TAny* aData)
+{
+    // Create cleanupstack for this thread
+    CTrapCleanup* cleanup = CTrapCleanup::New();
+
+    // No parameters to read, just start main function.
+
+    HBufC* buf = HBufC::NewL(1024);
+
+    TPtr ptr = buf->Des();
+
+    // Run the actual test, and trap possible leave
+    TRAPD(leave, LocationRequestThreadMainPartL(ptr));
+
+    // Open connection to file server
+    RFs fs;
+    User::LeaveIfError(fs.Connect());
+
+    TInt index = *((TInt*) aData);
+
+    TBuf<30> errorFile;
+    _LIT(KInfThread, "c:\\logs\\thread%derrinfo.txt");
+    errorFile.Format(KInfThread, index);
+
+    // Open log file
+    RFile file;
+
+    TInt err = file.Replace(fs,errorFile,EFileStreamText|EFileWrite);
+
+    if (err != KErrNone)
+        {
+        User::Leave(err);
+        }
+
+    _LIT(KErrLeave, "*** This thread (thread %d) leave code: %d\r\n");
+    ptr.AppendFormat(KErrLeave, index, leave);
+
+    TFileText fileText;
+    fileText.Set(file);
+
+    fileText.Write(ptr);
+
+    // Close log file
+    file.Close();
+    fs.Close();
+
+    // Delete cleanup stack
+    delete cleanup;
+
+    // Exit this thread with leave code (KErrNone in successful case)
+    User::Exit(leave);
+
+    return 0;
+}
+
+// ---------------------------------------------------------
+// CPosTp208::DoFastConnectionL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt CT_LbsClientPosTp208::DoFastConnectionL()
+    {   
+    TInt err;
+
+    // Create two different threads. Each thread connects
+    // and disconnect from MLFW very fast.
+    const TInt KMinHeapSize =  4096;
+    const TInt KMaxHeapSize =  128000;
+
+    RThread thread2;
+    RThread thread3;
+
+    TInt thread2Id = 2;
+    TInt thread3Id = 3;
+
+    // Make sure that if one of the threads panic, whole emulator is not
+    // paniced (this has effect only in Wins).
+    User::SetJustInTime(EFalse);
+
+    _LIT(KInfo, "Create two threads");
+    INFO_PRINTF1(KInfo);
+
+    err = thread2.Create(KThread2Name, LocationRequestThread, KDefaultStackSize, 
+    KMinHeapSize, KMaxHeapSize, &thread2Id);
+
+    AssertTrueL(err == KErrNone, KErrMsgThreadCreation, err);   
+
+    err = thread3.Create(KThread3Name, LocationRequestThread, KDefaultStackSize, 
+    KMinHeapSize, KMaxHeapSize, &thread3Id);
+
+    AssertTrueL(err == KErrNone, KErrMsgThreadCreation, err);   
+
+    // Logon to each thread, so we can get a notification when they kill
+    // themselves.
+    TRequestStatus status2, status3;
+    thread2.Logon(status2);
+    thread3.Logon(status3);
+
+    _LIT(KStart, "Start the threads will connect to and disconnect to MLFW,");
+    INFO_PRINTF1(KStart);
+
+    // Start all treads.
+    thread2.Resume();
+    User::After(2000000);
+    thread3.Resume();
+
+
+    // Wait for all threads to exit 
+    User::WaitForRequest(status2); 
+    User::WaitForRequest(status3); 
+
+    // Actual test is now run.
+    _LIT(KInfoExit, "All threads have exited, exit reasons:");
+    INFO_PRINTF1(KInfoExit);
+
+    // Check that all threads had correct exit reason. Also log
+    // all the exit reasons into log file.
+    TInt exitReasonsCorrect = 0;
+
+    exitReasonsCorrect |= thread2.ExitReason();
+    exitReasonsCorrect |= thread3.ExitReason();
+
+    // Close all handles to threads.
+    thread2.Close();
+    thread3.Close();
+
+    // Return back to normal mode
+    User::SetJustInTime(ETrue);  
+    return exitReasonsCorrect;
+    }
+
+// ---------------------------------------------------------
+// CPosTp208::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp208::StartL()
+    {
+    //first do a simple connection test
+    TInt fasterr = DoFastConnectionL();
+    _LIT(KFailConnect, "Fast connection failed");
+    AssertTrueL(fasterr == KErrNone, KFailConnect, fasterr);  
+
+    SetupPsyL(iUidMultiPsy);
+
+    TInt nrOfRounds = 1;
+    TBuf<100> buf;
+    
+    _LIT(KPsitionUpdate, 
+    		">>>>>>>>>>Running StartThreads(ETrue) requesting position updates<<<<<<<<");
+    INFO_PRINTF1(KPsitionUpdate);
+
+    _LIT(KEmptySpace, "");
+    _LIT(KRound, ">>>>>>Round nr %d :");
+    _LIT(KErrorsFound, "Errors found!!!");
+    
+    for (TInt i=0; i<nrOfRounds; i++)
+        {
+        INFO_PRINTF1(KEmptySpace);
+        buf.Format(KRound, i);
+        INFO_PRINTF1(buf);
+        TTime now, startTime;
+        TTimeIntervalMicroSeconds requestTime;
+        
+        startTime.UniversalTime();
+        TInt res = StartThreads(ETrue);
+        if (res != KErrNone) 
+        	LogErrorAndLeaveL(KErrorsFound, res);
+        now.UniversalTime();
+        
+        requestTime = now.MicroSecondsFrom(startTime);
+        _LIT(KDebug, "%d requests from %d threads took: %d microsecs.");
+        buf.Zero();
+        TInt64 reqTime = requestTime.Int64();
+        buf.Format(KDebug, KNrOfClients * KNrOfRuns, KNrOfClients, reqTime);
+        INFO_PRINTF1(buf);
+      
+        }
+
+    _LIT(KConnectDisconnect, 
+    		">>>>>>>>>>Running StartThreads(EFalse) connect/disconnect Epos<<<<<<<<");
+    INFO_PRINTF1(KConnectDisconnect);
+    nrOfRounds = 5;
+    for (TInt j=0; j<nrOfRounds; j++)
+        {
+        INFO_PRINTF1(KEmptySpace);
+        buf.Format(KRound, j);
+        INFO_PRINTF1(buf);
+        TTime now, startTime;
+        TTimeIntervalMicroSeconds requestTime;
+       
+        startTime.UniversalTime();
+
+        // Threads only connects to Epos server and then disconnect
+        TInt res = StartThreads(EFalse);
+        if (res != KErrNone) 
+        	LogErrorAndLeaveL(KErrorsFound, res);
+        now.UniversalTime();
+        
+        requestTime = now.MicroSecondsFrom(startTime);
+        _LIT(KDebug, "%d threads connecting and disconnecting to Epos server took: %d microsecs.");
+        buf.Zero();
+        TInt64 reqTime = requestTime.Int64();
+        buf.Format(KDebug, KNrOfClients, reqTime);
+        INFO_PRINTF1(buf);
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp21.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,156 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+#include "ctlbsclientpostp21.h"
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS ======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp21::CT_LbsClientPosTp21(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{  
+	_LIT(KTestName, "TP21 - Enable/Disable PSY");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp21::~CT_LbsClientPosTp21()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp21::CloseTest
+// Always called after the test, even if the test leaves
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp21::CloseTest()
+    {
+    ClosePositioner();
+    Disconnect();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp21::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp21::StartL()
+    {
+    _LIT(KTestFailedText1, "Unable to open positioner, error code = %d");
+    _LIT(KRequestor, "SAAA");
+
+    TUid myPsyId = iUidStubPositioner;
+
+    // Setup - copy files
+
+    ConnectL();
+
+    // Enable myPsyId, disable all others
+    SetupPsyL(myPsyId, ETrue);
+    // Open subsession to enabled PSY
+    TInt error = OpenPositionerByName(myPsyId); // Psy is enabled by default
+    if (error != KErrNone)
+        {
+        TBuf<100> errMsg;
+        errMsg.Format(KTestFailedText1, error);
+        LogErrorAndLeaveL(errMsg);
+        }
+    // Make a request
+    PerformRequestL(KRequestor, CRequestor::ERequestorService, CRequestor::EFormatTelephone);
+    CheckRequestResultL(KErrNone);
+
+    // Disable the PSY and perform another request
+	SetupPsyL(myPsyId, EFalse);
+	User::After(10000000);
+    PerformRequestL(KRequestor, CRequestor::ERequestorService, CRequestor::EFormatTelephone);
+	CheckRequestResultL(KErrNotFound);
+	
+    // Close the subsession and create another one
+    ClosePositioner();
+        
+    error = OpenPositionerByName(myPsyId);
+    if (error != KErrNotFound)
+        {
+        TBuf<100> errMsg;
+        errMsg.Format(KTestFailedText1, error);
+        LogErrorAndLeaveL(errMsg);
+        }
+    
+    // Enable the module and make a request
+	SetupPsyL(myPsyId, ETrue);
+
+	error = OpenPositionerByName(myPsyId);
+    PerformRequestL(KRequestor, CRequestor::ERequestorService, CRequestor::EFormatTelephone);
+    CheckRequestResultL(KErrNone);
+
+    ClosePositioner();
+    Disconnect();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp21::SetupPsyL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp21::SetupPsyL(const TUid aPsyUid,
+                           TBool aChoice)
+	{
+	CPosModules* db = CPosModules::OpenL();
+	CleanupStack::PushL(db);
+	CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+	  
+	// Disable PSY
+	moduleUpdate->SetUpdateAvailability(EFalse);
+	CPosModuleIdList* prioList = db->ModuleIdListLC();
+	  
+	// Disable all PSY:s
+	TInt size = prioList->Count();
+	for (TInt i = 0 ; i < size; i++)
+		{
+	    db->UpdateModuleL((*prioList)[i], *moduleUpdate);
+	    }
+	
+	// Enable/Disable the PSY that came as an in parameter
+	if (aChoice) 
+		{	
+	    moduleUpdate->SetUpdateAvailability(ETrue);
+		} 
+	else 
+		{ 
+	    moduleUpdate->SetUpdateAvailability(EFalse);
+		}
+	
+	db->UpdateModuleL(aPsyUid, *moduleUpdate);
+	
+	CleanupStack::PopAndDestroy(prioList);
+	CleanupStack::PopAndDestroy(moduleUpdate);
+	CleanupStack::PopAndDestroy(db);
+
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp213.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,384 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+// INCLUDE FILES
+#include "ctlbsclientpostp213.h"
+#include "ctlbsclientrequestor.h"
+#include "ctlbsclienteventtimer.h"
+#include <LbsPositionInfo.h>
+#include <Lbs.h>
+#include <LbsCommon.h>
+#include <LbsRequestor.h>
+#include <s32file.h>
+
+// CONSTANTS
+_LIT(KClient1, "RunL client1");
+_LIT(KClient2, "RunL client2");
+_LIT(KClient3, "RunL client3");
+
+_LIT(KClient1Default, "RunL client1, default psy");
+_LIT(KClient2Default, "RunL client2, default psy");
+_LIT(KClient3Default, "RunL client3, default psy");
+
+//Error logs
+_LIT( KErrStatusMismatch, "Statuses does not conform to each other!" );
+_LIT( KEventReceived, "Client 3 received an event that shouldn't be received!" );
+_LIT( KCanceledRequest, "Client 2 didn't receive KErrCancel, but %d!" );
+_LIT( KFileNotDeleted, "File created by PSY NOT deleted! PSY really unloaded from memory?" );
+
+//File name. Beware, also declared in EPos_CTestStatusPsy.h!!!!
+_LIT(KDummyFileName, "c:\\TestStatusPsyIsNotUnloaded.txt");
+
+// ================= MEMBER FUNCTIONS =======================
+
+// Constructor.
+CT_LbsClientPosTp213::CT_LbsClientPosTp213(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+    {  
+    _LIT(KTestName, "TP213 - Disabling psy during request");
+    SetTestStepName(KTestName); 
+    }
+
+// Destructor
+CT_LbsClientPosTp213::~CT_LbsClientPosTp213()
+    {
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp213::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp213::CloseTest()
+    {
+	delete ieventtimer;
+	ieventtimer = NULL;
+
+	delete iclient1;
+	delete iclient2;
+	delete iclient3;
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp213::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp213::StartL()
+    {
+	TBool usedefaultpsy = FALSE; // Indicating if the default psy should be used
+	iNoFurtherEvents = FALSE;	// Client should receive events!
+	iErrorDuringExecution = FALSE;  // True if an error occurs 
+
+	//Enable PSY 
+	CPosModules* idb = CPosModules::OpenL();
+	CleanupStack::PushL(idb);
+	_LIT(KEnablePSY, "Enabling Test Status PSY");
+	INFO_PRINTF1(KEnablePSY);
+    EnablePsyL(*idb, iUidTestStatusPsy);
+	
+	// Event timer
+	ieventtimer = CT_LbsClientEventTimer::NewL(Logger());
+	ieventtimer->SetObserver(this);
+
+	// 3 clients
+	iclient1 = CT_LbsClientRequestor::NewL(iUidTestStatusPsy, this, KClient1, Logger());
+	iclient2 = CT_LbsClientRequestor::NewL(iUidTestStatusPsy, this, KClient2, Logger());
+	iclient3 = CT_LbsClientRequestor::NewL(iUidTestStatusPsy, this, KClient3, Logger());
+	
+	// Make a request with client 2
+	_LIT(KRequestClient2, "Calling StartRequestL for client2");
+	INFO_PRINTF1(KRequestClient2);
+	iclient2->StartRequestL(usedefaultpsy);
+	
+	// Make client3 listen for status events
+	iclient3->RequestModuleStatusEvent();
+
+	// Disable Psy 3
+	User::After(100000); //a small delay
+	_LIT(KDisablePSY, "Disabling Test Status PSY");
+	INFO_PRINTF1(KDisablePSY);
+	DisablePsyL(*idb, iUidTestStatusPsy);
+	
+	// Client1 reads Module Status
+	// Client API
+	TInt clientapistatus = iclient1->ReadModuleStatusClientApi(iUidTestStatusPsy);
+	_LIT(KClientApi, "Module Status from Client API: %d.");
+	TBuf<100> bufclientapi;
+	bufclientapi.Format(KClientApi, clientapistatus);
+	INFO_PRINTF1(bufclientapi);
+	
+	// Modules API
+	TInt modulesapistatus = iclient1->ReadModuleStatusModulesApi(idb, iUidTestStatusPsy);
+	_LIT(KModulesApi, "Module Status from Module API: (IsAvailable=) %d.");
+	TBuf<100> bufmodulesapi;
+	bufmodulesapi.Format(KModulesApi, modulesapistatus);
+	INFO_PRINTF1(bufmodulesapi);
+	// Compare received statuses
+	if ( !((modulesapistatus == 0) && (clientapistatus == TPositionModuleStatus::EDeviceDisabled)) )
+		{
+		iErrorDuringExecution = TRUE;
+		ERR_PRINTF1(KErrStatusMismatch);
+		}
+
+	iclient2->ClosePositioner();
+
+	delete iclient1;
+	delete iclient2;
+	delete iclient3; 
+
+	///////////////////// Default PSY /////////////////////////////////////
+	
+	// Do the same as before but now use the default PSY
+	iNoFurtherEvents = FALSE;	// Client should receive events!
+	_LIT(KDefaultPsyStart, "****** Testing Default PSY ******");
+	INFO_PRINTF1(KDefaultPsyStart);
+
+	// Enable Psy
+	INFO_PRINTF1(KEnablePSY);
+	EnablePsyL(*idb, iUidTestStatusPsy);
+
+	// 3 clients
+	iclient1 = CT_LbsClientRequestor::NewL(iUidTestStatusPsy, this, KClient1Default, Logger());
+	iclient2 = CT_LbsClientRequestor::NewL(iUidTestStatusPsy, this, KClient2Default, Logger());
+	iclient3 = CT_LbsClientRequestor::NewL(iUidTestStatusPsy, this, KClient3Default, Logger());
+
+	// Make a request with client 2
+	INFO_PRINTF1(KRequestClient2);
+	iclient2->StartRequestL(usedefaultpsy);
+	
+	// Make client3 listen for status events
+	iclient3->RequestModuleStatusEvent();
+
+	// Disable Psy 3
+	User::After(1000000); //A small delay
+	usedefaultpsy = TRUE; //Use default PSY
+	INFO_PRINTF1(KDisablePSY);
+	DisablePsyL(*idb, iUidTestStatusPsy);
+				
+	// Client1 reads Module Status
+	// Client API
+	clientapistatus = iclient1->ReadModuleStatusClientApi(iUidTestStatusPsy);
+	bufclientapi.Format(KClientApi, clientapistatus);
+	INFO_PRINTF1(bufclientapi);
+	
+	// Modules API
+	modulesapistatus = iclient1->ReadModuleStatusModulesApi(idb, iUidTestStatusPsy);
+	bufmodulesapi.Format(KModulesApi, modulesapistatus);
+	INFO_PRINTF1(bufmodulesapi);
+	// Compare received statuses
+	if ( !((modulesapistatus == 0) && (clientapistatus == TPositionModuleStatus::EDeviceDisabled)) )	
+		{
+		iErrorDuringExecution = TRUE;
+		ERR_PRINTF1(KErrStatusMismatch);
+		}
+	
+	iclient2->ClosePositioner();
+
+	delete iclient1;
+    iclient1 = NULL;
+	delete iclient2;
+    iclient2 = NULL;
+	delete iclient3;
+    iclient3 = NULL;
+ 
+	// Connect to EPos
+    User::LeaveIfError(iPosServer.Connect());
+
+	// Enable Psy
+	INFO_PRINTF1(KEnablePSY);
+	EnablePsyL(*idb, iUidTestStatusPsy);
+	
+    // Open subsession to Status Psy that still is disabled!!!
+	_LIT(KInfoStatusPSY, "Calling OpenPositionerByName for Test Status PSY");
+    INFO_PRINTF1(KInfoStatusPSY);  
+	TInt err = OpenPositionerByName(iUidTestStatusPsy);
+	User::After(100000); //A small delay
+
+	if (err != KErrNone)
+		{
+		_LIT(KErrorRequest, "OpenPositionerByName failed, errCode = %d");
+		TBuf<100> buf;
+		buf.Format(KErrorRequest, err);
+		LogErrorAndLeaveL(buf);
+		}
+	
+	// Make a position request
+	_LIT(KService, "service");
+	TPositionInfo positionInfo = TPositionInfo();
+	_LIT(KPerformSyncRequest, "Calling PerformSyncRequest");
+	INFO_PRINTF1(KPerformSyncRequest);
+    err = PerformSyncRequest(KService, &positionInfo);
+
+    if (err != KErrNone)
+        {
+        _LIT(KErrorRequest, "The last request was not completed with KErrorNone, errCode = %d");
+		TBuf<100> buf;
+		buf.Format(KErrorRequest, err);
+        LogErrorAndLeaveL(buf);
+        }
+	
+	//Close Positioner
+	ClosePositioner();
+
+	//Disconnect from Epos
+	Disconnect();
+
+	CleanupStack::PopAndDestroy(idb);
+
+	//Checking if any errors occured during execution
+	if (iErrorDuringExecution)
+		{
+		_LIT(KErrorAndLeave, "Error(s) occured during execution, closing test!");
+		LogErrorAndLeaveL(KErrorAndLeave);
+		}
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp213::EnablePsyL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp213::EnablePsyL(
+    CPosModules&   aDb,
+    TUid             aPsy)
+    {
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+    // Enable Psy
+    moduleUpdate->SetUpdateAvailability(ETrue);
+    aDb.UpdateModuleL(aPsy, *moduleUpdate);
+    CleanupStack::PopAndDestroy(moduleUpdate);
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp213::DisablePsyL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp213::DisablePsyL(
+    CPosModules&   aDb,
+    TUid             aPsy)
+    {
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+    // Disable Psy
+    moduleUpdate->SetUpdateAvailability(EFalse);
+    aDb.UpdateModuleL(aPsy, *moduleUpdate);
+    CleanupStack::PopAndDestroy(moduleUpdate);
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp213::RequestCompleteL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp213::RequestCompleteL()
+    {
+	if (iclient2->CompletionCode() != KNoEvent)
+		{
+		_LIT(KClient2Compl, "Client 2 request completed with %d.");
+		TBuf<100> bufclient2comp;
+		bufclient2comp.Format(KClient2Compl, iclient2->CompletionCode());
+		INFO_PRINTF1(bufclient2comp);
+		
+		if (iclient2->CompletionCode() != KErrCancel)
+			{
+			TBuf<80> errorMessage;
+			errorMessage.Format( KCanceledRequest, iclient2->CompletionCode() );
+			ERR_PRINTF1( errorMessage );
+			}
+
+		/*Testing if PSY is unloaded from memory. PSY created a temp-file that only should 
+			exist during its lifespan. */
+		User::After(5000000);
+		RFs fileserver;
+		RFile file;
+		User::LeaveIfError(fileserver.Connect());
+		TInt err = file.Open(fileserver, KDummyFileName, EFileWrite);
+		if (err == KErrNone || err == KErrInUse) 
+            {
+            ERR_PRINTF1(KFileNotDeleted);
+            }
+		file.Close();
+		fileserver.Close();
+
+		iclient2->ClosePositioner();
+		iclient2->ResetCompletionCode();
+		}
+
+	else if (iclient3->CompletionCode() != KNoEvent)
+		{	
+		iclient3->ResetCompletionCode();
+		_LIT(KClient3Compl, "Client 3 request completed, ");
+		INFO_PRINTF1(KClient3Compl);
+
+		if (iNoFurtherEvents) //Client 3 received event but should NOT have!
+			{	
+			iErrorDuringExecution = TRUE;
+			ERR_PRINTF1(KEventReceived);
+			}
+
+		//Read what event was received!
+		TInt eventReading = iclient3->ReadModuleStatusEvent();
+
+		if (eventReading != TPositionModuleStatus::EDeviceDisabled) //NO Disable Event!
+			{	
+			_LIT(KClientStatusRead, "Event received by client not EDeviceDisabled, but %d.");
+			TBuf<100> bufstatusread;
+			bufstatusread.Format(KClientStatusRead, eventReading);
+			INFO_PRINTF1(bufstatusread);
+
+			//Make client3 listen for status events again!!
+			iclient3->ContinueRequesting();
+			}
+		else //A Disable Event!
+			{
+			_LIT(KClient3ComplDisabled, "Client 3 received EDeviceDisabled event!");
+			INFO_PRINTF1(KClient3ComplDisabled);
+
+			//Make client3 listen for status events again!!
+			iclient3->ContinueRequesting();
+			
+			/*Wait 5 s for events before halting the scheduler. 
+				No further events for client 3 should be received! */
+			ieventtimer->Start(5000000);
+			iNoFurtherEvents = TRUE;
+			//Start Timer
+			_LIT(KStartTiming, "Start Timer, 5 s.");
+			INFO_PRINTF1(KStartTiming);
+			}
+		}
+	else if (ieventtimer->CompletionCode() != KNoEvent) //Time-out
+		{
+		ieventtimer->ResetCompletionCode() ;
+
+		//Stop Scheduler
+		_LIT(KTimeOut, "Timer Stopped.");
+		INFO_PRINTF1(KTimeOut);
+		CActiveScheduler::Stop();
+		}
+	else 
+		{
+		_LIT(KUnknownEvent, "Unknown request was completed!");
+		LogErrorAndLeaveL(KUnknownEvent);
+		}
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp217.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,513 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp217.h"
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+
+// CONSTANTS
+const TInt MAX_AGE_TIME = 10000000; // 10 sec
+
+_LIT(KKallesService, "Kalles Service");
+
+// ================= MEMBER FUNCTIONS =======================
+
+// Constructor.
+CT_LbsClientPosTp217::CT_LbsClientPosTp217(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+    {  
+    _LIT(KTestName, "TP217 - Max Age, specific Psy");
+    SetTestStepName(KTestName); 
+    }
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp217::~CT_LbsClientPosTp217()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp217::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp217::CloseTest()
+    {
+    ClosePositioner();
+    Disconnect();
+    }
+
+// This flag must be defined if MaxAge is NOT supported
+#ifdef MAX_AGE_NOT_SUPPORTED
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp217::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+// MaxAge NOT supported
+void CT_LbsClientPosTp217::StartL()
+    {
+    TTimeIntervalMicroSeconds maxAge = TTimeIntervalMicroSeconds(MAX_AGE_TIME);
+
+    SetupPsyL(iUidTestPsyMaxAge);
+
+    //connect to EPos
+    User::LeaveIfError(iPosServer.Connect());
+    TInt err = KErrNone;
+    TRequestStatus          myStatus;
+
+    // Open default psy
+    User::LeaveIfError(iPositioner.Open(iPosServer));
+    TBuf<150> buf;
+
+    TPositionUpdateOptions posOption;
+    posOption.SetMaxUpdateAge(maxAge);
+
+    _LIT(KTestMaxAge, "Testing that MaxAge is not supported");
+    INFO_PRINTF1(KTestMaxAge);
+	err = iPositioner.SetUpdateOptions(posOption);
+	_LIT(KErr, "MaxAge should NOT be supported instead code %d was returned");
+	AssertTrueL(err == KErrNotSupported, KErr, err);
+
+    TPositionInfo posInfo1 = TPositionInfo();
+    TPositionInfo posInfo2 = TPositionInfo();
+
+    iPositioner.SetRequestor(CRequestor::ERequestorService,
+                             CRequestor::EFormatApplication, KKallesService);
+
+    // Get position, first position
+    iPositioner.NotifyPositionUpdate(posInfo1, myStatus);
+   
+    User::WaitForRequest(myStatus);
+    
+    err = myStatus.Int();
+    _LIT(KNotifyPositionUpdate, "Error from NotifyPositionUpdate, err %d");
+    AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
+
+    _LIT(KWaitMaxAge, "Wait for half Max Age...");
+    INFO_PRINTF1(KWaitMaxAge);
+    // Wait half MAX_AGE_TIME
+    User::After(HALF_MAX_AGE_TIME);
+
+    // Get position again, should be the same as first position
+    iPositioner.NotifyPositionUpdate(posInfo2, myStatus);
+    User::WaitForRequest(myStatus);
+    err = myStatus.Int();
+    AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
+
+    if (ComparePositionL(posInfo1, posInfo2))
+        {
+        _LIT(KErrorAndLeave,
+        "The old position was returned from positioner, MaxAge seems to be supported!!!");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+    }
+
+#else
+// ---------------------------------------------------------
+// CT_LbsClientPosTp217::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+// MaxAge supported
+void CT_LbsClientPosTp217::StartL()
+    {
+    TTimeIntervalMicroSeconds maxAge = TTimeIntervalMicroSeconds(MAX_AGE_TIME);
+
+    //connect to EPos
+    User::LeaveIfError(iPosServer.Connect());
+    TInt err = KErrNone;
+    
+    SetupPsyL(iUidTestPsyMaxAge);
+    
+    //Open subsession
+    User::LeaveIfError(iPositioner.Open(iPosServer, iUidTestPsyMaxAge));
+    TBuf<150> buf;
+
+    TPositionInfo posInfo = TPositionInfo();
+    TPositionInfo posInfo2 = TPositionInfo();
+    TRequestStatus          myStatus;
+
+    iPositioner.SetRequestor(CRequestor::ERequestorService,
+                             CRequestor::EFormatApplication, KKallesService);
+
+    // Make sure that it is possible to get position from psy
+    iPositioner.NotifyPositionUpdate(posInfo, myStatus);
+    User::WaitForRequest(myStatus);
+    err = myStatus.Int();
+    _LIT(KNotifyPositionUpdate, "Error from NotifyPositionUpdate");
+    AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
+    
+    const TTimeIntervalMicroSeconds32 KSomeTime(1000000); //1 sec
+    User::After(KSomeTime);
+
+    // Make sure that the psy returns differens positions
+    iPositioner.NotifyPositionUpdate(posInfo2, myStatus);
+    User::WaitForRequest(myStatus);
+    err = myStatus.Int();
+    AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
+
+    if (ComparePositionL(posInfo, posInfo2))
+        {
+        _LIT(KErrorAndLeave, "The same position was returned from positioner!!!");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    TPositionUpdateOptions returnPosOption;
+    iPositioner.GetUpdateOptions(returnPosOption);
+    TTimeIntervalMicroSeconds returnInterval = returnPosOption.MaxUpdateAge();
+
+    _LIT(KMageAge, "Max age should not hold a value");
+    AssertTrueL(returnInterval == TTimeIntervalMicroSeconds(0), 
+    		KMageAge, KErrGeneral);
+
+    TPositionUpdateOptions posOption;
+	posOption.SetMaxUpdateAge(maxAge);
+	err = iPositioner.SetUpdateOptions(posOption);
+
+	_LIT(KChange, "ERROR: When setting max age in SetMaxAge, error %d");
+	AssertTrueL(err == KErrNone, KChange, err);
+
+    TPositionUpdateOptions returnPosOption2;
+    iPositioner.GetUpdateOptions(returnPosOption2);
+    
+    returnInterval = returnPosOption2.MaxUpdateAge();
+    _LIT(KNotMatch, "Max age does not match, %d %d ");
+    buf.Format(KNotMatch, returnInterval.Int64(), MAX_AGE_TIME);
+
+    AssertTrueL(returnInterval == maxAge, buf, KErrGeneral);
+    
+    TPositionInfo posInfo3 = TPositionInfo();
+    TPositionInfo posInfo4 = TPositionInfo();
+    TPositionInfo posInfo5 = TPositionInfo();
+    // Get position, first position
+    iPositioner.NotifyPositionUpdate(posInfo3, myStatus);
+   
+    User::WaitForRequest(myStatus);
+    err = myStatus.Int();
+    AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
+
+    TPosition position = TPosition();
+    posInfo.GetPosition(position);
+
+    // Wait half MAX_AGE_TIME
+	const TTimeIntervalMicroSeconds32 KHalfTime(MAX_AGE_TIME/2); //5 sec
+    User::After(KHalfTime);
+
+    // Get position again, should be the same as first position
+    iPositioner.NotifyPositionUpdate(posInfo4, myStatus);
+   
+    User::WaitForRequest(myStatus);
+    err = myStatus.Int();
+    AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
+
+    if (!ComparePositionL(posInfo3, posInfo4))
+        {
+        _LIT(KErrorAndLeave, "The same position was returned from positioner!!!");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    // Wait MAX_AGE_TIME
+	const TTimeIntervalMicroSeconds32 KTime(MAX_AGE_TIME); //10 sec
+    User::After(KTime);
+
+    // Get position again, should NOT be the same as earlier
+    iPositioner.NotifyPositionUpdate(posInfo5, myStatus);
+   
+    User::WaitForRequest(myStatus);
+    err = myStatus.Int();
+    AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
+
+    if (ComparePositionL(posInfo4, posInfo5))
+        {
+        _LIT(KErrorAndLeave, "The same position was returned from positioner!!!");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    //Try to set an interval that is less than MaxAge
+    TTimeIntervalMicroSeconds mySmallInterval = TTimeIntervalMicroSeconds(400000);
+    posOption.SetUpdateInterval(mySmallInterval);
+    posOption.SetMaxUpdateAge(maxAge);
+
+    err = iPositioner.SetUpdateOptions(posOption);
+    _LIT(KErr2, "Setting updateinterval less than MaxAge should result in KErrArgument, instead error %d");
+	AssertTrueL(err == KErrArgument, KErr2, err);
+
+    // Check that the MaxAge did not change
+    iPositioner.GetUpdateOptions(returnPosOption);
+    TTimeIntervalMicroSeconds interval = returnPosOption.MaxUpdateAge();
+
+    if (interval != maxAge)
+        {
+        _LIT(KErrorAndLeave, "MaxAge does not match %d with %d");
+        buf.Format(KErrorAndLeave, interval.Int64(), maxAge.Int64());
+        LogErrorAndLeaveL(buf);
+        }
+
+
+    ClosePositioner();
+    Disconnect();
+    
+    ExtendedTesting1();
+
+    ExtendedTesting2();
+    }
+
+#endif
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp217::ExtendedTesting1
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp217::ExtendedTesting1()
+    {
+    _LIT(KFunctionName, "We are inside ExtendedTesting1()");
+    INFO_PRINTF1(KFunctionName);
+    TTimeIntervalMicroSeconds maxAge = TTimeIntervalMicroSeconds(5000000);
+    TTimeIntervalMicroSeconds myInterval = TTimeIntervalMicroSeconds(400000);
+
+    // Set iUidTestPsyMaxAge to defaultpsy
+    SetupPsyL(iUidTestPsyMaxAge);
+
+    //connect to EPos
+    User::LeaveIfError(iPosServer.Connect());
+    TInt err = KErrNone;
+
+    // Open default psy
+    User::LeaveIfError(iPositioner.Open(iPosServer));
+
+    TPositionUpdateOptions posOption;
+
+    //Try to set an interval that is less than MaxAge
+    posOption.SetUpdateInterval(myInterval);
+    posOption.SetMaxUpdateAge(maxAge);
+
+    err = iPositioner.SetUpdateOptions(posOption);
+    _LIT(KErr2, "Setting updateinterval less than MaxAge should result in KErrArgument, instead error %d");
+	AssertTrueL(err == KErrArgument, KErr2, err);
+
+    // Check that the MaxAge did not change
+    TPositionUpdateOptions returnPosOption;
+    iPositioner.GetUpdateOptions(returnPosOption);
+
+    //Try to set an interval that is equal to MaxAge
+    posOption.SetUpdateInterval(maxAge);
+    posOption.SetMaxUpdateAge(maxAge);
+
+    err = iPositioner.SetUpdateOptions(posOption);
+    _LIT(KErr3, "Setting updateinterval equal to MaxAge should result in KErrArgument, instead error %d");
+	AssertTrueL(err == KErrArgument, KErr3, err);
+
+    ClosePositioner();
+    Disconnect();
+    _LIT(KFunctionDone, "ExtendedTesting1 Done");
+    INFO_PRINTF1(KFunctionDone);
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp217::ExtendedTesting2
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp217::ExtendedTesting2()
+    {
+    _LIT(KFunctionName, "We are inside ExtendedTesting2()");
+    INFO_PRINTF1(KFunctionName);
+    TTimeIntervalMicroSeconds maxAge = TTimeIntervalMicroSeconds(30000000); // 30 sec
+    TTimeIntervalMicroSeconds maxAge2 = TTimeIntervalMicroSeconds(4000000); // 4 sec
+
+    // The MaxAge psy adds one second to the timeout time, therefore 6 seconds here (just to be sure)
+    const TTimeIntervalMicroSeconds32 KSomeTime(6000000); //6 sec
+
+    //connect to EPos
+    User::LeaveIfError(iPosServer.Connect());
+    TInt err = KErrNone;
+    //Open subsession
+    User::LeaveIfError(iPositioner.Open(iPosServer, iUidTestPsyMaxAge));
+
+    SetupPsyL(iUidTestPsyMaxAge);
+
+    TPositionInfo posInfo1 = TPositionInfo();
+    TPositionInfo posInfo2 = TPositionInfo();
+    TPositionInfo posInfo3 = TPositionInfo();
+    TPositionInfo posInfo4 = TPositionInfo();
+
+    TRequestStatus          myStatus;
+
+    iPositioner.SetRequestor(CRequestor::ERequestorService,
+                             CRequestor::EFormatApplication, KKallesService);
+
+    // Make sure that it is possible to get position from psy
+    iPositioner.NotifyPositionUpdate(posInfo1, myStatus);
+    User::WaitForRequest(myStatus);
+    err = myStatus.Int();
+    _LIT(KNotifyPositionUpdate, "Error from NotifyPositionUpdate");
+    AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
+
+    // Add a short delay here so that the MaxAge Psy has the possibilty 
+    // to create a new random position (the randomization seed is created with a time)
+    User::After(2000000);
+
+    // Make sure that the psy returns differens positions
+    iPositioner.NotifyPositionUpdate(posInfo2, myStatus);
+    User::WaitForRequest(myStatus);
+    err = myStatus.Int();
+    AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
+
+    if (ComparePositionL(posInfo1, posInfo2))
+        {
+        _LIT(KErrorAndLeave, "The same position was returned from positioner!!!");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    // Set MaxAge
+    TPositionUpdateOptions posOption;
+	posOption.SetMaxUpdateAge(maxAge);
+	err = iPositioner.SetUpdateOptions(posOption);
+
+	_LIT(KChange, "ERROR: When setting max age in SetMaxAge, error %d");
+	AssertTrueL(err == KErrNone, KChange, err);
+    User::After(KSomeTime);
+
+    iPositioner.NotifyPositionUpdate(posInfo3, myStatus);
+    User::WaitForRequest(myStatus);
+    err = myStatus.Int();
+    AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
+
+    // This position should be the old one
+    if (!ComparePositionL(posInfo2, posInfo3))
+        {
+        _LIT(KErrorAndLeave, "The same position was returned from positioner!!!");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    // Now change MaxAge again and check that it has been changed
+	posOption.SetMaxUpdateAge(maxAge2);
+	err = iPositioner.SetUpdateOptions(posOption);
+
+	_LIT(KChange2, "ERROR: When setting max age in SetMaxAge (2), error %d");
+	AssertTrueL(err == KErrNone, KChange2, err);
+	_LIT(KTimeout, "Waiting for the new maxage-timeout");
+    INFO_PRINTF1(KTimeout);
+    User::After(KSomeTime);
+
+    iPositioner.NotifyPositionUpdate(posInfo4, myStatus);
+    User::WaitForRequest(myStatus);
+    err = myStatus.Int();
+    AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
+
+    // This position should be new since maxage has expired
+    if (ComparePositionL(posInfo3, posInfo4))
+        {
+        _LIT(KErrorAndLeave, "The same position was returned from positioner!!!");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    ClosePositioner();
+    Disconnect();
+    _LIT(KFunctionDone, "ExtendedTesting2() Done");
+    INFO_PRINTF1(KFunctionDone);
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp217::ComparePositionL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TBool CT_LbsClientPosTp217::ComparePositionL(TPositionInfo aPosInfo1, TPositionInfo aPosInfo2)
+    {
+    _LIT(KFunctionName, "We are inside ComparePositionL");
+    INFO_PRINTF1(KFunctionName);
+    TBool result = ETrue;
+    TBuf<150> buf;
+
+    TPosition pos1 = TPosition();
+    TPosition pos2 = TPosition();
+    aPosInfo1.GetPosition(pos1);
+    aPosInfo2.GetPosition(pos2);
+
+    TTime time1 = pos1.Time();
+    TTime time2 = pos2.Time();
+
+    if (time1 == time2)
+        {
+        _LIT(KEqualTime, "Equal Time");
+        INFO_PRINTF1(KEqualTime);
+        }
+    else 
+    	{
+    	_LIT(KNotEqualTime, "NOT Equal Time");
+    	INFO_PRINTF1(KNotEqualTime);
+    	}
+
+    if ((time1 != time2) || (pos1.Latitude() != pos2.Latitude()) || 
+        (pos1.Longitude() != pos2.Longitude()) || 
+        (pos1.Altitude() != pos2.Altitude()) )
+        {
+        // Not equal
+        result = EFalse;
+        _LIT(KNotEqual, "Not equal");
+        INFO_PRINTF1(KNotEqual);
+        _LIT(KPosition1, "Position1: Lat %f Long %f Alt %f");
+        buf.Format(KPosition1, pos1.Latitude(), pos1.Longitude() ,pos1.Altitude());
+        INFO_PRINTF1(buf);
+        _LIT(KPosition2, "Position1: Lat %f Long %f Alt %f");
+        buf.Format( KPosition2, pos2.Latitude(), pos2.Longitude() ,pos2.Altitude());
+        INFO_PRINTF1(buf);
+        }
+    else
+        {
+        _LIT(KEqual, "Equal");
+        INFO_PRINTF1(KEqual);
+        result = ETrue;
+        _LIT(KPosition1, "Position1: Lat %f Long %f Alt %f");
+        buf.Format( KPosition1, pos1.Latitude(), pos1.Longitude() ,pos1.Altitude());
+        INFO_PRINTF1(buf);
+        }
+
+    return result;
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp217::AssertTrueSecL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp217::AssertTrueL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode)
+    {
+  	if (!aCondition)
+		{
+        // LogErrorAndLeave does not leave if KErrNone is error
+        if (aErrorCode == KErrNone) aErrorCode = KErrGeneral;
+		TBuf<100> buf;
+		buf.Format(aErrorMsg, aErrorCode);
+		LogErrorAndLeaveL(buf, aErrorCode);
+		}
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp218.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,414 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp218.h"
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+#include <LbsSatellite.h>
+
+// CONSTANTS
+const TInt MAX_AGE_TIME = 10000000; // 10 sec
+const TInt HALF_MAX_AGE_TIME = 5000000; // 5 sec
+
+_LIT(KKallesService, "Kalles Service");
+
+// ================= MEMBER FUNCTIONS =======================
+
+// Constructor.
+CT_LbsClientPosTp218::CT_LbsClientPosTp218(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+    {  
+    _LIT(KTestName, "TP218 - Max Age, default Psy");
+    SetTestStepName(KTestName); 
+    }
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp218::~CT_LbsClientPosTp218()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp218::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp218::CloseTest()
+    {
+    ClosePositioner();
+    iPositioner1.Close();
+    iPositioner2.Close();
+    Disconnect();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp218::SetupDefaultPsyL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp218::SetupDefaultPsyL(const TUid aPsyUid)
+    {
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+
+	SetupPsyL(aPsyUid);
+	//setting priority
+	TPositionModuleInfo moduleInfoHp;//Hp - high prio;
+	TPositionModuleInfo moduleInfoLp;//Lp - low prio;
+
+    CPosModuleIdList* prioList = db->ModuleIdListLC();
+	
+    db->GetModuleInfoL(prioList->At(0), moduleInfoHp);
+
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+
+	if (aPsyUid.iUid == moduleInfoHp.ModuleId().iUid)
+		{
+        moduleUpdate->SetUpdateAvailability(ETrue);
+		db->UpdateModuleL((*prioList)[0], *moduleUpdate);
+		}
+	else
+		{
+        db->GetModuleInfoL(aPsyUid, moduleInfoLp);
+		db->UpdateModuleL(aPsyUid, *moduleUpdate);
+        TUint hp = db -> PriorityL(moduleInfoHp.ModuleId());
+		TUint lp = db -> PriorityL(moduleInfoLp.ModuleId());
+        db->SetModulePriorityL(aPsyUid, hp); //lp
+        db->SetModulePriorityL((*prioList)[0], lp); //hp
+		}
+
+	moduleUpdate->SetUpdateAvailability(ETrue);
+    db -> UpdateModuleL(aPsyUid, *moduleUpdate);
+    
+	CleanupStack::PopAndDestroy(moduleUpdate);
+	CleanupStack::PopAndDestroy(2); // db, prioList
+    }
+
+
+// This flag must be defined if MaxAge should NOT be tested
+#ifdef MAX_AGE_NOT_SUPPORTED
+// ---------------------------------------------------------
+// CT_LbsClientPosTp218::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+// >>>>>>>>>>>>>>>MaxAge NOT supported<<<<<<<<<<<<<<<<<<<<<<
+void CT_LbsClientPosTp218::StartL()
+    {
+    TTimeIntervalMicroSeconds maxAge = TTimeIntervalMicroSeconds(MAX_AGE_TIME);
+
+    // Set iUidTestPsyMaxAge to defaultpsy
+    SetupDefaultPsyL(iUidTestPsyMaxAge);
+
+    //connect to EPos
+    User::LeaveIfError(iPosServer.Connect());
+    TInt err = KErrNone;
+    TRequestStatus          myStatus;
+
+    // Open default psy
+    User::LeaveIfError(iPositioner.Open(iPosServer));
+    TBuf<150> buf;
+
+    SetupGlobalPrivacyL(TPosPrivacy(TPosPrivacy::EAcceptAll, EFalse));
+
+    TPositionUpdateOptions posOption;
+    posOption.SetMaxUpdateAge(maxAge);
+
+    _LIT(KTestMaxAge, "Testing that MaxAge is not supported");
+    INFO_PRINTF1(KTestMaxAge);
+	err = iPositioner.SetUpdateOptions(posOption);
+	_LIT(KErr, "MaxAge should NOT be supported instead code %d was returned");
+	AssertTrueL(err == KErrNotSupported, KErr, err);
+
+    TPositionInfo posInfo1 = TPositionInfo();
+    TPositionInfo posInfo2 = TPositionInfo();
+
+    iPositioner.SetRequestor(CRequestor::ERequestorService,
+                             CRequestor::EFormatApplication, KKallesService);
+
+    // Get position, first position
+    iPositioner.NotifyPositionUpdate(posInfo1, myStatus);
+   
+    User::WaitForRequest(myStatus);
+    
+    err = myStatus.Int();
+    _LIT(KNotifyPositionUpdate, "Error from NotifyPositionUpdate, err %d");
+    AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
+
+    _LIT(KWaitMaxAge, "Wait for half Max Age...");
+    INFO_PRINTF1(KWaitMaxAge);
+    // Wait half MAX_AGE_TIME
+    User::After(HALF_MAX_AGE_TIME);
+
+    // Get position again, should be the same as first position
+    iPositioner.NotifyPositionUpdate(posInfo2, myStatus);
+    User::WaitForRequest(myStatus);
+    err = myStatus.Int();
+    AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
+
+    if (ComparePositionL(posInfo1, posInfo2))
+        {
+        _LIT(KErrorAndLeave, 
+        "The old position was returned from positioner, MaxAge seems to be supported!!!");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    }
+
+#else
+// ---------------------------------------------------------
+// CT_LbsClientPosTp218::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+// >>>>>>>>>>>>>>>>>>>>MaxAge supported<<<<<<<<<<<<<<<<<<<<<<
+void CT_LbsClientPosTp218::StartL()
+    {   
+    TTimeIntervalMicroSeconds maxAge = TTimeIntervalMicroSeconds(MAX_AGE_TIME);
+
+    // Set iUidTestPsyMaxAge to defaultpsy
+    SetupDefaultPsyL(iUidTestPsyMaxAge);
+
+    //connect to EPos
+    User::LeaveIfError(iPosServer.Connect());
+    TInt err = KErrNone;
+
+    // Open default psy
+    User::LeaveIfError(iPositioner.Open(iPosServer));
+    TBuf<150> buf;
+
+    TPositionInfo posInfo = TPositionInfo();
+    TPositionInfo posInfo2 = TPositionInfo();
+    TRequestStatus          myStatus;
+
+    iPositioner.SetRequestor(CRequestor::ERequestorService,
+                             CRequestor::EFormatApplication, KKallesService);
+
+    // Make sure that it is possible to get position from psy
+    iPositioner.NotifyPositionUpdate(posInfo, myStatus);
+    User::WaitForRequest(myStatus);
+    err = myStatus.Int();
+    _LIT(KNotifyPositionUpdate, "Error from NotifyPositionUpdate, err %d");
+    AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
+    
+    // Make sure that the psy returns differens positions
+    iPositioner.NotifyPositionUpdate(posInfo2, myStatus);
+    User::WaitForRequest(myStatus);
+    err = myStatus.Int();
+    AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
+
+
+    TPositionUpdateOptions returnPosOption;
+    iPositioner.GetUpdateOptions(returnPosOption);
+    TTimeIntervalMicroSeconds returnInterval = returnPosOption.MaxUpdateAge();
+
+    _LIT(KMaxAge, "Max age should not hold a value");
+    AssertTrueL(returnInterval == TTimeIntervalMicroSeconds(0), KMaxAge, KErrGeneral);
+
+    TPositionUpdateOptions posOption;
+    posOption.SetMaxUpdateAge(maxAge);
+
+	err = iPositioner.SetUpdateOptions(posOption);
+	_LIT(KChange, "Error when setting max age in SetMaxAge, error %d");
+	AssertTrueL(err == KErrNone, KChange, err);
+
+    TPositionUpdateOptions returnPosOption2;
+    iPositioner.GetUpdateOptions(returnPosOption2);
+    
+    returnInterval = returnPosOption2.MaxUpdateAge();
+    _LIT(KMaxAgeNotMatch, "Max age does not match, %d %d ");
+    buf.Format(KMaxAgeNotMatch, returnInterval.Int64(), MAX_AGE_TIME);
+    AssertTrueL(returnInterval == maxAge, buf, KErrGeneral);
+    
+    TPositionInfo posInfo3 = TPositionInfo();
+    TPositionInfo posInfo4 = TPositionInfo();
+    TPositionInfo posInfo5 = TPositionInfo();
+    // Get position, first position
+    iPositioner.NotifyPositionUpdate(posInfo3, myStatus);
+   
+    User::WaitForRequest(myStatus);
+    
+    err = myStatus.Int();
+    AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
+
+    _LIT(KWaitMAxAge, "Wait for half Max Age...");
+    INFO_PRINTF1(KWaitMAxAge);
+    // Wait half MAX_AGE_TIME
+    User::After(HALF_MAX_AGE_TIME);
+
+    // Get position again, should be the same as first position
+    iPositioner.NotifyPositionUpdate(posInfo4, myStatus);
+    User::WaitForRequest(myStatus);
+    err = myStatus.Int();
+    AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
+
+    if (!ComparePositionL(posInfo3, posInfo4))
+        {
+        _LIT(KErrorAndLeave, "The old position was not returned from positioner!!!");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    // Wait MAX_AGE_TIME
+    _LIT(KWait, "Waiting waiting...");
+    INFO_PRINTF1(KWait);
+    User::After(MAX_AGE_TIME);
+
+    // Get position again, should NOT be the same as earlier
+    iPositioner.NotifyPositionUpdate(posInfo5, myStatus);
+   
+    User::WaitForRequest(myStatus);
+    err = myStatus.Int();
+    AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
+
+    if (ComparePositionL(posInfo4, posInfo5))
+        {
+        _LIT(KErrorAndLeave, "(1)The old position was returned from positioner!!!");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+    
+    _LIT(KChangePSY11, "Changing default psy to Psy11");
+    INFO_PRINTF1(KChangePSY11);
+    // Set iUidTestPsy11 psy to defaultpsy
+    SetupDefaultPsyL(iUidTestPsy11);
+
+    // Wait some time to make changes occur
+    User::After(5000000);
+    TPositionInfo posInfo6 = TPositionInfo();
+    TPositionInfo posInfo7 = TPositionInfo();
+
+    // Get position again, should NOT be the same as earlier
+    iPositioner.NotifyPositionUpdate(posInfo6, myStatus);
+   
+    User::WaitForRequest(myStatus);
+    err = myStatus.Int();
+    _LIT(KErr1, "Error from NotifyPositionUpdate for default psy, err1: %d");
+    AssertTrueL(err == KErrNone, KErr1, err);
+
+    if (ComparePositionL(posInfo5, posInfo6))
+        {
+        _LIT(KErrorAndLeave, 
+        		"(2)The old position was returned from positioner!!!");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    // Get position again, should NOT be the same as earlier
+    iPositioner.NotifyPositionUpdate(posInfo7, myStatus);
+   
+    User::WaitForRequest(myStatus);
+    err = myStatus.Int();
+    // TestPsy11 returns error every second request
+    _LIT(KErr2, "Error from NotifyPositionUpdate for default psy, err2: %d");
+    AssertTrueL(err == KPositionPartialUpdate, KErr2, err);
+
+    if (ComparePositionL(posInfo6, posInfo7))
+        {
+        _LIT(KErrorAndLeave, 
+        		"The old position was returned from default positioner!!!");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    ClosePositioner();
+    Disconnect();
+    }
+
+#endif
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp218::ComparePositionL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TBool CT_LbsClientPosTp218::ComparePositionL(TPositionInfo aPosInfo1, TPositionInfo aPosInfo2)
+    {
+    _LIT(KFunctionName, "We are inside ComparePositionL()");
+    INFO_PRINTF1(KFunctionName);
+    TBool result = ETrue;
+    TBuf<150> buf;
+
+    TPosition pos1 = TPosition();
+    TPosition pos2 = TPosition();
+    aPosInfo1.GetPosition(pos1);
+    aPosInfo2.GetPosition(pos2);
+
+    TTime time1 = pos1.Time();
+    TTime time2 = pos2.Time();
+
+    if (time1 == time2)
+        {
+        _LIT(KEqualTime, "Equal Time");
+        INFO_PRINTF1(KEqualTime);
+        }
+    else 
+    	{
+    	_LIT(KNotEqualTime, "NOT Equal Time");
+    	INFO_PRINTF1(KNotEqualTime);
+    	}
+
+    if ((time1 != time2) || (pos1.Latitude() != pos2.Latitude()) || 
+        (pos1.Longitude() != pos2.Longitude()) || 
+        (pos1.Altitude() != pos2.Altitude()) )
+        {
+        // Not equal
+        result = EFalse;
+        _LIT(KNotEqual, "Not equal");
+        INFO_PRINTF1(KNotEqual);
+        _LIT(KPosition1, "Position1: Lat %f Long %f Alt %f");
+        buf.Format(KPosition1, pos1.Latitude(), pos1.Longitude() ,pos1.Altitude());
+        INFO_PRINTF1(buf);
+        _LIT(KPosition2, "Position2: Lat %f Long %f Alt %f");
+        buf.Format(KPosition2, pos2.Latitude(), pos2.Longitude() ,pos2.Altitude());
+        INFO_PRINTF1(buf);
+        }
+    else
+        {
+        _LIT(KEqual, "Equal");
+        INFO_PRINTF1(KEqual);
+        result = ETrue;
+        _LIT(KPosition1, "Position1: Lat %f Long %f Alt %f");
+        buf.Format( KPosition1, pos1.Latitude(), pos1.Longitude() ,pos1.Altitude());
+        INFO_PRINTF1(buf);
+        }
+
+    return result;
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp218::AssertTrueSecL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp218::AssertTrueL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode)
+    {
+  	if (!aCondition)
+		{
+        // LogErrorAndLeave does not leave if KErrNone is error
+        if (aErrorCode == KErrNone) aErrorCode = KErrGeneral;
+		TBuf<100> buf;
+		buf.Format(aErrorMsg, aErrorCode);
+		LogErrorAndLeaveL(buf, aErrorCode);
+		}
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp22.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,494 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp22.h"
+#include "ctlbsclientlog.h"
+#include "ctlbsclientperiodictester.h"
+
+// CONSTANTS
+_LIT(KServiceName1, " aaaaaaaaaaa");
+_LIT(KServiceName2, " bbbbbbbbbbb");
+_LIT(KServiceName3, " ccccccccccc");
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp22::CT_LbsClientPosTp22(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{  
+	_LIT(KTestName, "TP22 - Periodic Location Updates");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp22::~CT_LbsClientPosTp22()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp22::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp22::StartL()
+    {
+    TInt numberOfRuns = 5;
+	TTimeIntervalMicroSeconds interval0 = TTimeIntervalMicroSeconds(0);
+	TTimeIntervalMicroSeconds interval2 = TTimeIntervalMicroSeconds(2000000);
+	TTimeIntervalMicroSeconds interval4 = TTimeIntervalMicroSeconds(4000000);
+	TTimeIntervalMicroSeconds interval5 = TTimeIntervalMicroSeconds(5000000);
+	TTimeIntervalMicroSeconds interval7 = TTimeIntervalMicroSeconds(7000000);
+	TTimeIntervalMicroSeconds interval8 = TTimeIntervalMicroSeconds(8000000);
+    TTimeIntervalMicroSeconds timeoutValue = TTimeIntervalMicroSeconds(10000000);
+    
+    TUid uidWithTimer = iUidTestTimerPsy;
+	TUid uidWithoutTimer = iUidTestPsy1;
+    TInt errorsFound = KErrNone;
+    TBuf<150> buf;
+
+    SetupPsyL(iUidTestTimerPsy);
+
+    // Prepare for test
+    iPeriodicTester1 = CT_LbsClientPeriodicTester::NewL(interval0, KServiceName1, iLog, uidWithTimer, 0);
+    iPeriodicTester1->RequestNotification();
+    CActiveScheduler::Start();
+    iPeriodicTester1->ClosePositioner();
+
+	// 1.
+    _LIT(KPart1, "<<<<<<<<< PART1 >>>>>>>>>>");
+    INFO_PRINTF1(KPart1);
+    iPeriodicTester1->OpenPositionerL(KServiceName1);
+	iPeriodicTester1->ChangeTestParametersL(interval5, numberOfRuns);
+
+    iPeriodicTester1->RequestNotification();
+    CActiveScheduler::Start();
+    // Check that correct fix is returned
+    TPositionInfo posInfo;
+    iPeriodicTester1->GetPosition(posInfo);
+
+    TPosition pos;
+    posInfo.GetPosition(pos);
+    // TestTimerPsy returns 55.0 for Tracking requests and 20.0 for ordinary position requests
+    if (pos.Latitude() != 55.0|| pos.Longitude() != 55.0 || pos.Altitude() != 55.0)
+        {
+        _LIT(KErrorAndLeave, "Wrong position returned from tracking PSY");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+	iPeriodicTester1->ClosePositioner();
+    if (!iPeriodicTester1->IsCompletedOK())
+        {
+        _LIT(KErr, "iPeriodicTester1 returned error (1): %d");
+        buf.Format(KErr,iPeriodicTester1->GetError());
+        INFO_PRINTF1(buf);
+        errorsFound++;
+        }
+
+    //Make another ordinary request
+    // Not included in TC
+    iPeriodicTester1->OpenPositionerL(KServiceName1);
+	iPeriodicTester1->ChangeTestParametersL(interval0, 0);
+	iPeriodicTester1->RequestNotification();
+
+	CActiveScheduler::Start();
+    iPeriodicTester1->GetPosition(posInfo);
+    posInfo.GetPosition(pos);
+    // TestTimerPsy returns 55.0 for Tracking requests and 20.0 for ordinary position requests
+    if (pos.Latitude() != 20.0|| pos.Longitude() != 20.0 || pos.Altitude() != 20.0)
+        {
+        _LIT(KErrorAndLeave, "Wrong position returned from PSY");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    iPeriodicTester1->ClosePositioner();
+    if (!iPeriodicTester1->IsCompletedOK())
+        {
+        _LIT(KErr, "iPeriodicTester1 returned error (1_1): %d");
+        buf.Format(KErr,iPeriodicTester1->GetError());
+        INFO_PRINTF1(buf);
+        errorsFound++;
+        }
+
+    ///////////////
+
+    // 2.
+    _LIT(KPart2, "<<<<<<<<< PART2 >>>>>>>>>>");
+    INFO_PRINTF1(KPart2);
+	SetupPsyL(uidWithoutTimer);
+	iPeriodicTester2 = CT_LbsClientPeriodicTester::NewL(interval5, KServiceName2, iLog, uidWithoutTimer, numberOfRuns);
+	iPeriodicTester2->RequestNotification();
+	CActiveScheduler::Start();
+	iPeriodicTester2->ClosePositioner();
+
+    if (!iPeriodicTester2->IsCompletedOK())
+        {
+        _LIT(KErr, "iPeriodicTester2 returned error (1): %d");
+        buf.Format(KErr,iPeriodicTester2->GetError());
+        INFO_PRINTF1(buf);
+        errorsFound++;
+        }
+	
+    //Make another ordinary request
+    // Not included in TC
+    iPeriodicTester2->OpenPositionerL(KServiceName1);
+	iPeriodicTester2->ChangeTestParametersL(interval0, 0);
+	iPeriodicTester2->RequestNotification();
+	CActiveScheduler::Start();
+    iPeriodicTester2->ClosePositioner();
+    if (!iPeriodicTester1->IsCompletedOK())
+        {
+        _LIT(KErr, "iPeriodicTester2 returned error (1_1): %d");
+        buf.Format(KErr,iPeriodicTester1->GetError());
+        INFO_PRINTF1(buf);
+        errorsFound++;
+        }
+
+    ///////////////
+
+	// 3.
+    _LIT(KPart3, "<<<<<<<<< PART3 >>>>>>>>>>");
+    INFO_PRINTF1(KPart3);
+	SetupPsyL(uidWithTimer);
+	iPeriodicTester1->OpenPositionerL(KServiceName1);
+
+	iPeriodicTester1->ChangeTestParametersL(interval7, 3);
+	iPeriodicTester1->RequestNotification();
+	CActiveScheduler::Start();
+    if (!iPeriodicTester1->IsCompletedOK())
+        {
+        _LIT(KErr, "iPeriodicTester1 returned error (2): %d");
+        buf.Format(KErr,iPeriodicTester1->GetError());
+        INFO_PRINTF1(buf);
+        errorsFound++;
+        }
+	
+	iPeriodicTester1->ChangeTestParametersL(interval4, 5);
+	iPeriodicTester1->RequestNotification();
+	CActiveScheduler::Start();
+	iPeriodicTester1->ClosePositioner();
+
+    if (!iPeriodicTester1->IsCompletedOK())
+        {
+        _LIT(KErr, "iPeriodicTester1 returned error (3): %d");
+        buf.Format(KErr,iPeriodicTester1->GetError());
+        INFO_PRINTF1(buf);
+        errorsFound++;
+        }
+
+	// 4.
+    _LIT(KPart4, "<<<<<<<<< PART4 >>>>>>>>>>");
+    INFO_PRINTF1(KPart4);
+	SetupPsyL(uidWithoutTimer);
+	iPeriodicTester2->OpenPositionerL(KServiceName2);
+	iPeriodicTester2->ChangeTestParametersL(interval7, 3);
+	iPeriodicTester2->RequestNotification();
+	CActiveScheduler::Start();
+
+    if (!iPeriodicTester2->IsCompletedOK())
+        {
+        _LIT(KErr, "iPeriodicTester2 returned error (2): %d");
+        buf.Format(KErr,iPeriodicTester2->GetError());
+        INFO_PRINTF1(buf);
+        errorsFound++;
+        }
+	
+	iPeriodicTester2->ChangeTestParametersL(interval4, 5);
+	iPeriodicTester2->RequestNotification();
+	CActiveScheduler::Start();
+	iPeriodicTester2->ClosePositioner();
+
+    if (!iPeriodicTester2->IsCompletedOK())
+        {
+        _LIT(KErr, "iPeriodicTester2 returned error (3): %d");
+        buf.Format(KErr,iPeriodicTester2->GetError());
+        INFO_PRINTF1(buf);
+        errorsFound++;
+        }
+	
+	// 5.
+    _LIT(KPart5, "<<<<<<<<< PART5 >>>>>>>>>>");
+    INFO_PRINTF1(KPart5);
+	SetupPsyL(uidWithTimer);
+    iPeriodicTester1->OpenPositionerL(KServiceName1);
+	iPeriodicTester1->ChangeTestParametersL(interval4, 3);
+	iPeriodicTester1->RequestNotification();
+	CActiveScheduler::Start();
+    if (!iPeriodicTester1->IsCompletedOK())
+        {
+        _LIT(KErr, "iPeriodicTester1 returned error (4): %d");
+        buf.Format(KErr,iPeriodicTester1->GetError());
+        INFO_PRINTF1(buf);
+        errorsFound++;
+        }
+
+    iPeriodicTester1->ChangeTestParametersL(interval0, 0);
+
+    iPeriodicTester1->RequestNotification();
+	CActiveScheduler::Start();
+    if (!iPeriodicTester1->IsCompletedOK())
+        {
+        _LIT(KErr, "iPeriodicTester1 returned error (4_1): %d");
+        buf.Format(KErr,iPeriodicTester1->GetError());
+        INFO_PRINTF1(buf);
+        errorsFound++;
+        }
+    
+    TPositionInfo posInfo1;
+    iPeriodicTester1->GetPosition(posInfo1);
+
+    TPosition pos1;
+    posInfo1.GetPosition(pos1);
+    // TestTimerPsy returns 55.0 for Tracking requests and 20.0 for ordinary position requests
+    if (pos1.Latitude() != 20.0 || pos1.Longitude() != 20.0 || pos1.Altitude() != 20.0)
+        {
+        _LIT(KErrorAndLeave, "Wrong position returned from PSY, StopTracking has not been called");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    iPeriodicTester1->ClosePositioner();
+
+	
+	// 6.
+    _LIT(KPart6, "<<<<<<<<< PART6 >>>>>>>>>>");
+    INFO_PRINTF1(KPart6);
+	SetupPsyL(uidWithoutTimer);
+    iPeriodicTester2->OpenPositionerL(KServiceName2);
+    // Make two requests (note that nr of requests made is 1 + 1, since one is
+    // made directly when calling RequestNotification)
+    iPeriodicTester2->ChangeTestParametersL(interval0, 1);
+	iPeriodicTester2->RequestNotification();
+	CActiveScheduler::Start();
+    iPeriodicTester2->ClosePositioner();
+
+
+    if (!iPeriodicTester2->IsCompletedOK())
+        {
+        _LIT(KErr, "iPeriodicTester2 returned error (4): %d");
+        buf.Format(KErr,iPeriodicTester2->GetError());
+        INFO_PRINTF1(buf);
+        errorsFound++;
+        }
+		
+	// 7.
+    _LIT(KPart7, "<<<<<<<<< PART7 >>>>>>>>>>");
+    INFO_PRINTF1(KPart7);
+    SetupPsyL(uidWithoutTimer);
+	iPeriodicTester2->OpenPositionerL(KServiceName2);
+    iPeriodicTester2->ChangeTestParametersL(interval4, 3);
+	iPeriodicTester2->RequestNotification();
+	CActiveScheduler::Start();
+    if (!iPeriodicTester2->IsCompletedOK())
+        {
+        _LIT(KErr, "iPeriodicTester2 returned error (5): %d");
+        buf.Format(KErr,iPeriodicTester2->GetError());
+        INFO_PRINTF1(buf);
+        errorsFound++;
+        }
+
+	iPeriodicTester2->ChangeTestParametersL(interval0, 0);
+    iPeriodicTester2->ClosePositioner();
+    
+	// 8.
+    _LIT(KPart8, "<<<<<<<<< PART8 >>>>>>>>>>");
+    INFO_PRINTF1(KPart8);
+	SetupPsyL(uidWithTimer);
+    iPeriodicTester1->OpenPositionerL(KServiceName1);
+    // Make two requests (note that nr of requests made is 1 + 1, since one is
+    // made directly when calling RequestNotification)
+    iPeriodicTester1->ChangeTestParametersL(interval0, 1);
+	iPeriodicTester1->RequestNotification();
+	CActiveScheduler::Start();
+
+    // Check that correct fix is returned
+    iPeriodicTester1->GetPosition(posInfo1);
+    posInfo1.GetPosition(pos1);
+    // TestTimerPsy returns 55.0 for Tracking requests and 20.0 for ordinary position requests
+    if (pos1.Latitude() != 20.0 || pos1.Longitude() != 20.0 || pos1.Altitude() != 20.0)
+        {
+        _LIT(KErrorAndLeave, "Wrong position returned from PSY, StopTracking has not been called");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    iPeriodicTester1->ClosePositioner();
+    if (!iPeriodicTester1->IsCompletedOK())
+        {
+        _LIT(KErr, "iPeriodicTester1 returned error (5): %d");
+        buf.Format(KErr,iPeriodicTester1->GetError());
+        INFO_PRINTF1(buf);
+        errorsFound++;
+        }
+    
+	// 9.
+    _LIT(KPart9, "<<<<<<<<< PART9 >>>>>>>>>>");
+    INFO_PRINTF1(KPart9);
+	SetupPsyL(uidWithoutTimer);
+	iPeriodicTester2->OpenPositionerL(KServiceName2);
+    iPeriodicTester2->ChangeTestParametersL(interval4, 3);
+	iPeriodicTester2->RequestNotification();
+	CActiveScheduler::Start();
+    if (!iPeriodicTester2->IsCompletedOK())
+        {
+        _LIT(KErr, "iPeriodicTester2 returned error (6): %d");
+        buf.Format(KErr,iPeriodicTester2->GetError());
+        INFO_PRINTF1(buf);
+        errorsFound++;
+        }
+	
+	iPeriodicTester2->ChangeRequestorInformation(KServiceName3);
+	iPeriodicTester2->ChangeTestParametersL(interval4, 3);
+	iPeriodicTester2->RequestNotification();
+	CActiveScheduler::Start();
+    if (!iPeriodicTester2->IsCompletedOK())
+        {
+        _LIT(KErr, "iPeriodicTester2 returned error (7): %d");
+        buf.Format(KErr,iPeriodicTester2->GetError());
+        INFO_PRINTF1(buf);
+        errorsFound++;
+        }
+
+	iPeriodicTester2->ChangeTestParametersL(interval0, 0);
+    iPeriodicTester2->ClosePositioner();
+    
+	// 10.
+    _LIT(KPart10, "<<<<<<<<< PART10 >>>>>>>>>>");
+    INFO_PRINTF1(KPart10);
+	iPeriodicTester2->OpenPositionerL(KServiceName2);
+    iPeriodicTester2->ChangeTestParametersL(interval4, 0);
+	iPeriodicTester2->RequestNotification();
+	CActiveScheduler::Start();
+    if (!iPeriodicTester2->IsCompletedOK())
+        {
+        _LIT(KErr, "iPeriodicTester2 returned error (8): %d");
+        buf.Format(KErr,iPeriodicTester2->GetError());
+        INFO_PRINTF1(buf);
+        errorsFound++;
+        }
+
+	iPeriodicTester2->ChangeTestParametersL(interval0, 0);
+    iPeriodicTester2->ClosePositioner();
+
+	// 11.
+    _LIT(KPart11, "<<<<<<<<< PART11 >>>>>>>>>>");
+    INFO_PRINTF1(KPart11);
+	iPeriodicTester2->OpenPositionerL(KServiceName2);
+    iPeriodicTester2->ChangeTestParametersL(interval4, 0); //only one periodic
+	iPeriodicTester2->RequestNotification();
+	CActiveScheduler::Start();
+	iPeriodicTester2->ClosePositioner();
+    if (!iPeriodicTester2->IsCompletedOK())
+        {
+        _LIT(KErr, "iPeriodicTester2 returned error (9): %d");
+        buf.Format(KErr,iPeriodicTester2->GetError());
+        INFO_PRINTF1(buf);
+        errorsFound++;
+        }
+
+	// 12.
+    _LIT(KPart12, "<<<<<<<<< PART12 >>>>>>>>>>");
+    INFO_PRINTF1(KPart12);
+	iPeriodicTester2->OpenPositionerL(KServiceName2);
+	iPeriodicTester2->ChangeTestParametersL(interval8, 2);
+	iPeriodicTester2->RequestNotification();
+	CActiveScheduler::Start();
+    if (!iPeriodicTester2->IsCompletedOK())
+        {
+        _LIT(KErr, "iPeriodicTester2 returned error (10): %d");
+        buf.Format(KErr,iPeriodicTester2->GetError());
+        INFO_PRINTF1(buf);
+        errorsFound++;
+        }
+	
+    // Check that setting MaxAge does not "screw" things up
+    iPeriodicTester2->SetMaxAgeL(interval2);
+
+	iPeriodicTester2->ChangeTestParametersL(interval8, 2);
+	iPeriodicTester2->RequestNotification();
+	CActiveScheduler::Start();
+    if (!iPeriodicTester2->IsCompletedOK())
+        {
+        _LIT(KErr, "iPeriodicTester2 returned error (11): %d");
+        buf.Format(KErr,iPeriodicTester2->GetError());
+        INFO_PRINTF1(buf);
+        errorsFound++;
+        }
+
+	iPeriodicTester2->SetPartialUpdateL(ETrue);
+	iPeriodicTester2->ChangeTestParametersL(interval8, 2);
+	iPeriodicTester2->RequestNotification();
+	CActiveScheduler::Start();
+    if (!iPeriodicTester2->IsCompletedOK())
+        {
+        _LIT(KErr, "iPeriodicTester2 returned error (12): %d");
+        buf.Format(KErr,iPeriodicTester2->GetError());
+        INFO_PRINTF1(buf);
+        errorsFound++;
+        }
+
+	iPeriodicTester2->SetTimeOutL(timeoutValue); //must be greater than the interval
+	iPeriodicTester2->ChangeTestParametersL(interval8, 2);
+	iPeriodicTester2->RequestNotification();
+	CActiveScheduler::Start();
+    iPeriodicTester2->ClosePositioner();
+    if (!iPeriodicTester2->IsCompletedOK())
+        {
+        _LIT(KErr, "iPeriodicTester2 returned error (13): %d");
+        buf.Format(KErr,iPeriodicTester2->GetError());
+        INFO_PRINTF1(buf);
+        errorsFound++;
+        }
+
+	//13.
+    _LIT(KPart13, "<<<<<<<<< PART13 >>>>>>>>>>");
+    INFO_PRINTF1(KPart13);
+	iPeriodicTester2->OpenPositionerL(KServiceName2);
+    iPeriodicTester2->ChangeTestParametersL(interval4, 4);
+	iPeriodicTester2->SetChangeParametersPrematurely(ETrue);
+	iPeriodicTester2->RequestNotification();
+	CActiveScheduler::Start();
+    iPeriodicTester2->ClosePositioner();
+
+    if (!iPeriodicTester2->IsCompletedOK())
+        {
+        _LIT(KErr, "iPeriodicTester2 returned error (8): %d");
+        buf.Format(KErr,iPeriodicTester2->GetError());
+        INFO_PRINTF1(buf);
+        errorsFound++;
+        }
+
+    if (errorsFound != KErrNone)
+        {
+        _LIT(KErrorAndLeave, "Errors found in TP22");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+	}
+
+void CT_LbsClientPosTp22::CloseTest()
+	{
+	delete iPeriodicTester1;
+	iPeriodicTester1 = NULL;
+	delete iPeriodicTester2;
+	iPeriodicTester2 = NULL;
+	iRequestArray.Reset();
+	iRequestArray.Close();
+	}
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp222.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,196 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp222.h"
+
+// CONSTANTS
+// ================= MEMBER FUNCTIONS =======================
+
+// Constructor.
+CT_LbsClientPosTp222::CT_LbsClientPosTp222(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+    {  
+    _LIT(KTestName, "TP222 - Partial Update test");
+    SetTestStepName(KTestName); 
+    }
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp222::~CT_LbsClientPosTp222()
+	{
+	}
+
+// ---------------------------------------------------------
+// CPosTp222::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp222::CloseTest()
+    {
+    ClosePositioner();
+    Disconnect();
+    }   
+
+// This flag must be defined if testing partial update NOT supported
+#ifdef PARTIAL_UPDATE_NOT_SUPPORTED
+// ---------------------------------------------------------
+// CPosTp222::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+// If partial update is NOT supported
+void CT_LbsClientPosTp222::StartL()
+    {
+    _LIT(KPartialUpdateTest, "-----Testing that PartialUpdate is NOT supported-----");
+    INFO_PRINTF1(KPartialUpdateTest);
+    SetupPsyL(iUidTestPsyPartialUpdate);
+    SetupGlobalPrivacyL(TPosPrivacy(TPosPrivacy::EAcceptAll, EFalse));
+    _LIT(KService, "PellesKattlåda");
+
+    ConnectL();
+    User::LeaveIfError(OpenPositionerByName(iUidTestPsyPartialUpdate));
+
+    TPositionUpdateOptions updateOptions;
+    // Check that partial update is not supported
+    updateOptions.SetAcceptPartialUpdates(ETrue);
+    
+    TInt res = iPositioner.SetUpdateOptions(updateOptions);
+    _LIT(KSetUpdateOptions, "SetUpdateOptions should not be supported, instead error %d was return");
+    AssertTrueL(res == KErrNotSupported, KSetUpdateOptions, res);
+    
+    TPositionInfo info = TPositionInfo();
+    TInt err = PerformSyncRequest(KService, &info);
+    _LIT(KErrRequest2, "error when performing sync request nr2, err: %d");
+    AssertTrueL(err == KErrNone, KErrRequest2, err);
+    // Check that a "full" position is returned
+    TPosition pos = TPosition();
+    info.GetPosition(pos);
+
+    if (pos.Latitude() == 30 && pos.Longitude() == 40 && pos.Altitude() == 50)
+        {
+        _LIT(KErrorAndLeave, 
+        	"Partial update position returned from positioner when this feature should be disabled");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }   
+
+    ClosePositioner();
+    Disconnect();
+
+    _LIT(KFunctionDone, "Test Completed successfully");
+    INFO_PRINTF1(KFunctionDone);
+    }
+
+#else
+// ---------------------------------------------------------
+// CPosTp222::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+// If partial update is supported
+void CT_LbsClientPosTp222::StartL()
+    {
+    _LIT(KPartialUpdateTest, "-----Testing that PartialUpdate is supported-----");
+    INFO_PRINTF1(KPartialUpdateTest);
+    SetupPsyL(iUidTestPsyPartialUpdate);
+
+    ConnectL();
+    User::LeaveIfError(OpenPositionerByName(iUidTestPsyPartialUpdate));
+    _LIT(KService, "PellesKaninlaada");
+
+    TPositionUpdateOptions updateOptions;
+    TPositionUpdateOptions resultOptions;
+    // Check that partial update is not set
+    TBool res = updateOptions.AcceptPartialUpdates();
+    if (res)
+        {
+        _LIT(KErrorAndLeave, "Partial update default is not correct");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    updateOptions.SetAcceptPartialUpdates(ETrue);
+    TInt response = iPositioner.SetUpdateOptions(updateOptions);
+    _LIT(KSetUpdateOptions, "SetUpdateOptions returned error: %d");
+    AssertTrueL(response == KErrNone, KSetUpdateOptions, res);
+
+    // Check that partial update has been set
+    iPositioner.GetUpdateOptions(resultOptions);
+    res = resultOptions.AcceptPartialUpdates();
+    if (!res)
+        {
+        _LIT(KErrorAndLeave, "Partial update not correctly set");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    TPositionInfo info = TPositionInfo();
+    TInt err = PerformSyncRequest(KService, &info);
+    _LIT(KErrRequest, "error when performing sync request, err: %d");
+    AssertTrueL(err == KPositionPartialUpdate, KErrRequest, err);
+    
+    //Check that a "partial update" position is returned
+    TPosition pos = TPosition();
+    info.GetPosition(pos);
+
+    if (pos.Latitude() != 30 || pos.Longitude() != 40 || pos.Altitude() != 50)
+        {
+        _LIT(KErrorAndLeave,
+        		"Wrong position returned from positioner(partial update)");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    // Disable partialupdate
+    updateOptions.SetAcceptPartialUpdates(EFalse);
+    response = iPositioner.SetUpdateOptions(updateOptions);
+    _LIT(KSetUpdateOptions1, 
+    		"SetUpdateOptions returned error when disabling partial update err: %d");
+    AssertTrueL(response == KErrNone, KSetUpdateOptions1, res);
+
+    // Check that partial update has been disabled
+    iPositioner.GetUpdateOptions(resultOptions);
+    res = resultOptions.AcceptPartialUpdates();
+    if (res)
+        {
+        _LIT(KErrorAndLeave, "Partial update should not be set");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    TPositionInfo info2 = TPositionInfo();
+    err = PerformSyncRequest(KService, &info2);
+    _LIT(KErrRequest2, "error when performing sync request nr2, err: %d");
+    AssertTrueL(err == KErrNone, KErrRequest2, err);
+    // Check that a "full" position is returned
+    TPosition pos2 = TPosition();
+    info2.GetPosition(pos2);
+
+    if (pos2.Latitude() == 30 && pos2.Longitude() == 40 && pos2.Altitude() == 50)
+        {
+        _LIT(KErrorAndLeave, "Partial update position returned from positioner");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    ClosePositioner();
+    Disconnect();
+    _LIT(KFunctionDone, "Test Completed successfully");
+    INFO_PRINTF1(KFunctionDone);
+    }
+#endif
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp223.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,87 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp223.h"
+#include <badesca.h>
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+#include <LbsCommon.h>
+#include <LbsPositionInfo.h>
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// Constructor.
+CT_LbsClientPosTp223::CT_LbsClientPosTp223(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+    {  
+    _LIT(KTestName, "TP223 - Range check in PSY");
+    SetTestStepName(KTestName); 
+    }
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp223::~CT_LbsClientPosTp223()
+	{
+	}
+
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp223::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp223::StartL()
+    {
+  
+    _LIT(KErrorMsg, "Get Module did not return KErrNotFound, error code = %d");
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+   
+    TPositionModuleInfo moduleInfo;
+
+    TRAPD(err,db->GetModuleInfoL(iUidTestRangePsy, 
+                       moduleInfo));
+
+    AssertTrueSecL(err == KErrNotFound,KErrorMsg, err);
+ 
+    CleanupStack::PopAndDestroy(db); // db
+
+	}
+
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp223::AssertTrueSecL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp223::AssertTrueSecL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode)
+    {
+  	if (!aCondition)
+		{
+		TBuf<100> buf;
+		buf.Format(aErrorMsg, aErrorCode);
+		LogErrorAndLeaveL(buf);
+		}
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp224.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,110 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp224.h"
+#include <LbsCommon.h>
+#include <LbsPositionInfo.h>
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// Constructor.
+CT_LbsClientPosTp224::CT_LbsClientPosTp224(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+    {  
+    _LIT(KTestName, 
+    		"TP224 - MPositionerStatus out of scope after closing PSY subsession");
+    SetTestStepName(KTestName); 
+    }
+
+// Destructor
+CT_LbsClientPosTp224::~CT_LbsClientPosTp224() 
+	{
+    iPositioner.Close();
+    iPositioner2.Close();
+    iServer.Close();
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp224::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+
+void CT_LbsClientPosTp224::CloseTest()
+    {
+    iPositioner.Close();
+    iPositioner2.Close();
+    iServer.Close();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp224::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp224::StartL()
+    {   
+    _LIT(KConnectErr, "Error when connecting to EPos server, %d");
+    _LIT(KOpenErr, "Error when opening positioner, %d");
+
+    TInt err;
+    err = iServer.Connect();	
+    AssertTrueSecL(err == KErrNone, KConnectErr, err);
+
+	SetupPsyL(iUidTestSingPsy);
+    err = iPositioner.Open(iServer, iUidTestSingPsy);
+    AssertTrueSecL(err == KErrNone, KOpenErr, err);
+
+    err = iPositioner2.Open(iServer, iUidTestSingPsy);
+	AssertTrueSecL(err == KErrNone, KOpenErr, err);
+
+    iPositioner.Close();
+    iPositioner2.Close(); // Before error correction -> Panic because of MPositionerStatus deleted  
+
+    err = iPositioner.Open(iServer, iUidTestSingPsy);
+    AssertTrueSecL(err == KErrNone, KOpenErr, err);
+    err = iPositioner2.Open(iServer, iUidTestSingPsy);
+    AssertTrueSecL(err == KErrNone, KOpenErr, err);
+
+    iPositioner2.Close();
+    iPositioner.Close();
+
+    iServer.Close();
+    }
+
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp224::AssertTrueSecL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp224::AssertTrueSecL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode)
+    {
+  	if (!aCondition)
+		{
+		TBuf<100> buf;
+		buf.Format(aErrorMsg, aErrorCode);
+		LogErrorAndLeaveL(buf);
+		}
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp227.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,210 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp227.h"
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+#include <LbsCommon.h>
+#include <LbsPositionInfo.h>
+
+
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// Constructor.
+CT_LbsClientPosTp227::CT_LbsClientPosTp227(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+    {  
+    _LIT(KTestName, "TP227 - Settings API performance");
+    SetTestStepName(KTestName); 
+    }
+
+// Destructor
+CT_LbsClientPosTp227::~CT_LbsClientPosTp227() 
+	{
+    
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp227::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+
+void CT_LbsClientPosTp227::CloseTest()
+    {
+    
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp227::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp227::StartL()
+    {   
+    TTime startTime;
+    TTime stopTime;
+        
+    startTime.UniversalTime();
+    
+    CPosModules* db = CPosModules::OpenL();
+    stopTime.UniversalTime();
+    
+    TInt duration =  stopTime.Int64() - startTime.Int64();
+    
+    if (duration > 500000)
+		{
+    	_LIT(KDelayMsg, "Time taken to create CPosModules object was more than 0.5 second, it was %d microsecs.");
+        TBuf<100> error;
+        error.Format(KDelayMsg, duration);
+        INFO_PRINTF1(error);    
+		}
+    else
+        {
+        _LIT(KDelayMsg, "Time taken to create CPosModules object was %d microsecs.");
+        TBuf<100> debug;
+        debug.Format(KDelayMsg, duration);
+        INFO_PRINTF1(debug);
+        }
+    
+    CleanupStack::PushL(db);
+          
+    startTime.UniversalTime();
+    CPosModuleIdList* prioList = db->ModuleIdListLC();
+    
+    stopTime.UniversalTime();
+    duration =  stopTime.Int64() - startTime.Int64();
+    
+    if (duration > 20000)
+		{
+    	_LIT(KDelayMsg, "Time taken to get list using ModuleIdListLC() was more than 0.02 second, it was %d microsecs.");
+        TBuf<100> error;
+        error.Format(KDelayMsg, duration);
+        INFO_PRINTF1(error);
+		}
+    else
+        {
+        _LIT(KDelayMsg, "Time taken to get list using ModuleIdListLC() was %d microsecs.");
+        TBuf<100> debug;
+        debug.Format(KDelayMsg, duration);
+        INFO_PRINTF1(debug);
+        }
+
+    TPositionModuleInfo moduleInfo;
+    TInt64 MaxDuration=0;
+    
+    for ( TInt count = 0 ; count < prioList->Count() ; count++)
+        {                    
+        startTime.UniversalTime();
+        db->GetModuleInfoL((*prioList)[count], moduleInfo);
+        stopTime.UniversalTime();
+        duration =  stopTime.Int64() - startTime.Int64();
+        
+        if( duration>MaxDuration )
+            MaxDuration=duration;           
+        }
+
+    if (MaxDuration > 10000)
+		{
+    	_LIT(KDelayMsg, "Time taken for GetModuleInfoL() was more than 0.01 sec, it was %d microsecs.");
+        TBuf<100> error;
+        error.Format(KDelayMsg, duration);
+        INFO_PRINTF1(error);
+		}
+    else
+        {
+        _LIT(KDelayMsg, "Time taken for GetModuleInfoL() was %d microsecs.");
+        TBuf<100> debug;
+        debug.Format(KDelayMsg, duration);
+        INFO_PRINTF1(debug);
+        }
+    
+    CleanupStack::PopAndDestroy(prioList); // prioList
+    
+    TInt visiblestate=1;
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC(); // destroy!
+    moduleUpdate->SetUpdateAvailability(ETrue);
+    
+    MaxDuration=0;
+    for(TInt i=0;i<10;i++)
+    {
+	    if(visiblestate)
+	    { 
+	    moduleUpdate->SetUpdateVisibility(EFalse);
+	    visiblestate=0;
+	    }
+	    else
+	    { 
+	    moduleUpdate->SetUpdateVisibility(ETrue);
+	    visiblestate=1;
+	    }
+	    
+	    db->UpdateModuleL(iUidTestPsy2, *moduleUpdate);
+	    
+	    startTime.UniversalTime();
+	    prioList = db->ModuleIdListLC();
+	    stopTime.UniversalTime();
+	    duration =  stopTime.Int64() - startTime.Int64();
+	    
+	    if( duration> MaxDuration)
+	    MaxDuration=duration;
+
+	    CleanupStack::PopAndDestroy(prioList);
+    }
+  
+    if (MaxDuration > 50000)
+		{
+    	_LIT(KDelayMsg, "Time taken was more than 0.05 second, it was %d microsecs.");
+        TBuf<100> error;
+        error.Format(KDelayMsg, duration);
+        INFO_PRINTF1(error);
+		}
+    else
+        {
+        _LIT(KDelayMsg, "Time taken was %d microsecs.");
+        TBuf<100> debug;
+        debug.Format(KDelayMsg, duration);
+        INFO_PRINTF1(debug);
+        }
+        
+       CleanupStack::PopAndDestroy(2); //moduleUpdate,db   
+    }
+    
+// ---------------------------------------------------------
+// CT_LbsClientPosTp227::AssertTrueSecL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp227::AssertTrueL(TBool aCondition, const TDesC& aErrorMsg)
+    {
+  	if (!aCondition)
+		{
+		TBuf<100> buf;
+		buf.Format(aErrorMsg);
+		LogErrorAndLeaveL(buf);
+		}
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp25.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,175 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp25.h"
+#include "ctlbsrequester.h"
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+
+// CONSTANTS
+
+// ==================== LOCAL FUNCTIONS ====================
+
+// ---------------------------------------------------------
+// EnablePsyL. Enables a specific psy
+// ---------------------------------------------------------
+//
+void EnablePsyL(
+    CPosModules&   aDb,
+    TUid             aPsy)
+    {
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+    // Enable Psy
+    moduleUpdate->SetUpdateAvailability(ETrue);
+    aDb.UpdateModuleL(aPsy, *moduleUpdate);
+    CleanupStack::PopAndDestroy(moduleUpdate);
+
+    }
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp25::CT_LbsClientPosTp25(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{  
+	_LIT(KTestName, "TP25 - Request location from multiple PSYs");
+	SetTestStepName(KTestName); 
+	}
+
+// Destructor
+CT_LbsClientPosTp25::~CT_LbsClientPosTp25()
+    {
+    delete iFastPsy;
+    delete iMediumPsy;
+    delete iSlowPsy;
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp25::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp25::StartL()
+    {
+    
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+
+    EnablePsyL(*db, iUidTestPsy12);// 0 sec
+    EnablePsyL(*db, iUidTestPsy4);// 3 sec
+    EnablePsyL(*db, iUidTestPsy9);// 6 sec
+
+    CleanupStack::PopAndDestroy(); // db
+
+    iFastPsy = CT_LbsRequester::NewL(iUidTestPsy12, this, Logger());   
+    iMediumPsy = CT_LbsRequester::NewL(iUidTestPsy4, this, Logger()); 
+    iSlowPsy = CT_LbsRequester::NewL(iUidTestPsy9, this, Logger());    
+    iCompletedRequests = 0;
+
+    TTime starttime,stoptime;
+    starttime.UniversalTime();
+    
+    // Make request to slow psy first
+    iSlowPsy->StartRequest();
+    iFastPsy->StartRequest();
+    iMediumPsy->StartRequest();
+
+    // Wait for completion
+    CActiveScheduler::Start();
+    
+    stoptime.UniversalTime();
+    
+    // Substract total delay incurred due to PSY's...i.e 6sec
+    TInt duration=stoptime.Int64()-starttime.Int64()-6000000;
+    
+        
+    _LIT(KMessage,"3 simultaneous requests from 3 different sessions completed in %d microsec");
+    TBuf<256> error;
+    error.Format(KMessage,duration);
+    INFO_PRINTF1(error);
+    
+    if(duration>3000000)
+    {
+    _LIT(KTime, "Time taken>3 sec");
+    INFO_PRINTF1(KTime);
+    }
+    
+       // Evaluate result
+    _LIT(KPsyFast, "testpsy12");  
+    _LIT(KPsyMedium, "testpsy4"); 
+    _LIT(KPsySlow, "testpsy9");   
+
+    _LIT(KReturnedErrorCode, "Positioner %S returned error code %d");
+    TBuf<256> output;
+    output.Format(KReturnedErrorCode, &KPsyFast, iFastPsy->CompletionCode());
+   AssertTrueL(iFastPsy->CompletionCode() == KErrNone, output);
+
+    output.Format(KReturnedErrorCode, &KPsyMedium, iMediumPsy->CompletionCode());
+    AssertTrueL(iMediumPsy->CompletionCode() == KErrNone, output);
+
+    output.Format(KReturnedErrorCode, &KPsySlow, iSlowPsy->CompletionCode());
+    AssertTrueL(iSlowPsy->CompletionCode() == KErrNone, output);
+    _LIT(KWrongComplOrder, "Positioners completed out of order");
+    
+    AssertTrueL(
+        iFastPsy->CompletionTimeUTC() < iMediumPsy->CompletionTimeUTC() &&
+        iMediumPsy->CompletionTimeUTC() < iSlowPsy->CompletionTimeUTC(),
+        KWrongComplOrder);
+
+    delete iFastPsy;
+    delete iMediumPsy;
+    delete iSlowPsy;
+    iFastPsy = NULL;
+    iMediumPsy = NULL;
+    iSlowPsy = NULL;
+
+    _LIT(KTEXT, "TP25 Passed! :)");
+    INFO_PRINTF1(KTEXT);
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp25::RequestCompleteL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp25::RequestCompleteL()
+    {
+    const TInt KNofRequesters = 3;
+    if (++iCompletedRequests == KNofRequesters)
+        {
+        CActiveScheduler::Stop();
+        }
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp25::AssertTrueL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp25::AssertTrueL(TBool aCondition, const TDesC& aErrorMsg)
+    {
+  	if (!aCondition)
+		{
+		LogErrorAndLeaveL(aErrorMsg);
+		}
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp254.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,390 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+// INCLUDE FILES
+#include "ctlbsclientpostp254.h"
+#include <f32file.h>
+#include <bautils.h>
+#include <LbsSatellite.h>
+
+// CONSTANTS
+_LIT(KLastPosition, "c:\\private\\101f97b2\\LastKnownPos.dat");
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp254::CT_LbsClientPosTp254(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{  
+	_LIT(KTestName, "TP254 - Get last known position");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp254::~CT_LbsClientPosTp254()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp254::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp254::CloseTest()
+    {
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp254::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp254::StartL()
+    {
+    User::After(2000000);
+    DeleteFileL(KLastPosition);
+	SetupPsyL(iUidTestPsy11);
+
+    RPositionServer	posServer;
+    CleanupClosePushL(posServer);
+    RPositioner positioner;
+    CleanupClosePushL(positioner);
+    TPositionInfo positionInfo = TPositionInfo();
+    TPositionInfo positionInfoLast = TPositionInfo();
+
+	_LIT(KConnectErr, "Error when connecing to EPos server,  %d");
+	TInt err = posServer.Connect();
+	AssertTrueL(err == KErrNone, KConnectErr, err);
+
+	_LIT(KOpenErr, "Error when opening positioner,  %d");
+    err = positioner.Open(posServer,iUidTestPsy11 ); //use defalut psy
+	AssertTrueL(err == KErrNone, KOpenErr, err);
+
+
+    _LIT(KService ,"Service");
+	positioner.SetRequestor(CRequestor::ERequestorService,
+							 CRequestor::EFormatApplication, KService);
+
+    TRequestStatus status;
+    status = KRequestPending;
+
+    positionInfoLast.SetUpdateType(EPositionUpdateUnknown); // just to make a difference
+    
+    positioner.GetLastKnownPosition(positionInfoLast, status);
+    User::WaitForRequest(status);
+    err = status.Int();
+    _LIT(KErrorRequest, "Get last known position did not return with KErrUnKnown %d");
+    AssertTrueL(err == KErrUnknown, KErrorRequest, err);
+
+    //Verification of TR SBUY-5WHGS3 i.e even if the psy has a really fast
+    //responce time a last known position should be saved.
+    status = KRequestPending;
+
+    positioner.NotifyPositionUpdate(positionInfo, status);
+    User::WaitForRequest(status);
+    err = status.Int();
+    _LIT(KErrPosition, "Not possible to make a request");
+    AssertTrueL(err == KErrNone, KErrPosition, err);
+
+    positioner.GetLastKnownPosition(positionInfoLast, status);
+    User::WaitForRequest(status);
+    err = status.Int();
+    _LIT(KErrorFast, "Get last known position after fast psy did not work %d");
+    AssertTrueL(err == KErrNone, KErrorFast, err);
+
+    positioner.Close();
+    posServer.Close();
+
+    const TTimeIntervalMicroSeconds32 KPosWaitServerShutDown( 6000000 );
+    User::After(KPosWaitServerShutDown);
+    DeleteFileL(KLastPosition);
+    SetupPsyL(iUidTestPsyMaxAge);
+	err = posServer.Connect();
+	AssertTrueL(err == KErrNone, KConnectErr, err);
+    err = positioner.Open(posServer); //use defalut psy
+	AssertTrueL(err == KErrNone, KOpenErr, err);
+	positioner.SetRequestor(CRequestor::ERequestorService,
+							 CRequestor::EFormatApplication, KService);
+
+    
+    status = KRequestPending;
+
+    positioner.NotifyPositionUpdate(positionInfo, status);
+    User::WaitForRequest(status);
+    err = status.Int();
+    AssertTrueL(err == KErrNone, KErrPosition, err);
+
+    //Now there should exist a last known position
+    positioner.GetLastKnownPosition(positionInfoLast, status);
+    User::WaitForRequest(status);
+    err = status.Int();
+    _LIT(KErrorRequestLast, "Get last known position did not return with KErrNone %d");
+    AssertTrueL(err == KErrNone, KErrorRequestLast, err);
+
+    CheckPositionInfoL(positionInfo, positionInfoLast);
+
+	TPositionSatelliteInfo satelliteInfoLast = TPositionSatelliteInfo();
+    positioner.GetLastKnownPosition(satelliteInfoLast, status);
+    User::WaitForRequest(status);
+    err = status.Int();
+    
+    AssertTrueL(err == KErrArgument, KErrorRequest, err);
+
+    positioner.NotifyPositionUpdate(positionInfo, status);
+    User::WaitForRequest(status);
+    err = status.Int();
+    AssertTrueL(err == KErrNone, KErrPosition, err);
+
+    positioner.GetLastKnownPosition(positionInfoLast, status);
+    User::WaitForRequest(status);
+    err = status.Int();
+    AssertTrueL(err == KErrNone, KErrorRequest, err);
+
+    CheckPositionInfoL(positionInfo, positionInfoLast);
+
+    positioner.Close();
+    posServer.Close();
+
+    //connect again
+	err = posServer.Connect();
+	AssertTrueL(err == KErrNone, KConnectErr, err);
+    err = positioner.Open(posServer); //use defalut psy
+	AssertTrueL(err == KErrNone, KOpenErr, err);
+	positioner.SetRequestor(CRequestor::ERequestorService,
+							 CRequestor::EFormatApplication, KService);
+
+
+    TPositionInfo positionInfoLast1 = TPositionInfo();
+    positioner.GetLastKnownPosition(positionInfoLast1, status);
+    User::WaitForRequest(status);
+    err = status.Int();
+    AssertTrueL(err == KErrNone, KErrorRequest, err);    
+    CheckPositionInfoL(positionInfoLast, positionInfoLast1);
+
+    positioner.Close();
+    posServer.Close();
+	User::After(6000000);
+
+    //The position is written to persistant storeage since TEF is shutdown.
+    if (!FileExistsL(KLastPosition))
+        {
+        _LIT(KErrStore, "The dat file not created");
+        LogErrorAndLeaveL(KErrStore);
+        }
+
+    //Connect again
+	err = posServer.Connect();
+	AssertTrueL(err == KErrNone, KConnectErr, err);
+    err = positioner.Open(posServer); //use defalut psy
+	AssertTrueL(err == KErrNone, KOpenErr, err);
+	positioner.SetRequestor(CRequestor::ERequestorService,
+							 CRequestor::EFormatApplication, KService);
+
+
+    TPositionInfo positionInfoLast2 = TPositionInfo();
+    positioner.GetLastKnownPosition(positionInfoLast2, status);
+    User::WaitForRequest(status);
+    err = status.Int();
+    AssertTrueL(err == KErrNone, KErrorRequest, err);    
+    CheckPositionInfoL(positionInfoLast, positionInfoLast2);
+
+    RPositionServer	posServer1;
+    CleanupClosePushL(posServer1);
+    RPositioner positioner1;
+    CleanupClosePushL(positioner1);
+    SetupPsyL(iUidMultiPsy);
+	_LIT(KConnect1Err, "Error when connecing to EPos server,  %d");
+	err = posServer1.Connect();
+	AssertTrueL(err == KErrNone, KConnect1Err, err);
+
+	_LIT(KOpen1Err, "Error when opening positioner,  %d");
+    err = positioner1.Open(posServer); //use defalut psy
+	AssertTrueL(err == KErrNone, KOpen1Err, err);
+	positioner1.SetRequestor(CRequestor::ERequestorService,
+							 CRequestor::EFormatApplication, KService);
+
+    positioner1.NotifyPositionUpdate(positionInfo, status);
+    User::WaitForRequest(status);
+    err = status.Int();
+    AssertTrueL(err == KErrNone, KErrPosition, err);
+
+    positioner.GetLastKnownPosition(positionInfoLast, status);
+    User::WaitForRequest(status);
+    err = status.Int();
+    AssertTrueL(err == KErrNone, KErrorRequest, err);
+    CheckPositionInfoL(positionInfo, positionInfoLast);
+
+    //just to make sure that positioner1 also gets the correct position
+    positioner1.GetLastKnownPosition(positionInfoLast, status);
+    User::WaitForRequest(status);
+    err = status.Int();
+    AssertTrueL(err == KErrNone, KErrorRequest, err);
+    CheckPositionInfoL(positionInfo, positionInfoLast);
+
+    SetupPsyL(iUidTestPsyPartialUpdate);
+    User::After(1000000);
+    TPositionInfo positionInfoPartial = TPositionInfo();
+    TPositionUpdateOptions updateOption = TPositionUpdateOptions();
+    updateOption.SetAcceptPartialUpdates(ETrue);
+    positioner1.SetUpdateOptions(updateOption);
+
+    positioner1.NotifyPositionUpdate(positionInfoPartial, status);
+    User::WaitForRequest(status);
+    err = status.Int();
+    _LIT(KErrPositionPartial, "no partial position returned %d");
+    AssertTrueL(err == KPositionPartialUpdate, KErrPositionPartial, err);
+
+    positioner.GetLastKnownPosition(positionInfoLast, status);
+    User::WaitForRequest(status);
+    err = status.Int();
+    AssertTrueL(err == KErrNone, KErrorRequest, err);
+    
+    TPosition pos;
+    TPosition lastPos;
+	positionInfoPartial.GetPosition(pos);
+    positionInfoLast.GetPosition(lastPos);
+    
+    if (pos.Time() == lastPos.Time())
+		{
+		_LIT(KErrPosition, "Partial position was cached");
+		LogErrorAndLeaveL(KErrPosition);
+		}
+
+    CleanupStack::PopAndDestroy(&positioner1);
+    CleanupStack::PopAndDestroy(&posServer1);
+    CleanupStack::PopAndDestroy(&positioner);
+    CleanupStack::PopAndDestroy(&posServer);
+
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp254::DeleteFileL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp254::DeleteFileL(const TDesC& aFile)
+    {
+    RFs fs;
+    TInt err = fs.Connect();
+
+    err = fs.Delete(aFile);
+    fs.Close();
+    if (err == KErrNone)
+        {
+        _LIT(KDebugText, "TP254: The specified file deleted");
+        INFO_PRINTF1(KDebugText);
+        }
+    else
+        {
+        if (err == KErrInUse)
+            {
+            _LIT(KErrText, "TP254: The specified file could not be deleted it is already in use, errorcode %d");
+            INFO_PRINTF1(aFile);
+            TBuf<100> buf;
+            buf.Format(KErrText, err);
+            AssertTrueL(err==0, KErrText, err);
+            }
+        else if (err == KErrNotFound)
+            {
+            _LIT(KDebugText, "TP254: The specified file could not be found ,errorcode %d");
+            TBuf<100> buf;
+            buf.Format(KDebugText, err);
+            INFO_PRINTF1(buf);
+            }
+        else
+            {
+            _LIT(KErrText, "TP254: The specified file could not be deleted, errorcode %d");
+            TBuf<100> buf;
+            buf.Format(KErrText, err);
+            AssertTrueL(err==0, KErrText, err);
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp254::FileExistsL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TBool CT_LbsClientPosTp254::FileExistsL(const TDesC& aFile)
+    {
+    RFs fs;
+    TInt err = fs.Connect();
+    TBool exists = EFalse;
+    
+    if(KErrNone==err)
+    	{
+    	exists = BaflUtils::FileExists(fs, aFile);
+    	if (exists)
+    		{
+    		_LIT(KErrText, "TP254: The specified file does not exist");
+    		INFO_PRINTF1(KErrText);
+    		}
+    	else
+    		{
+    		_LIT(KErrText, "TP254: The specified file exists");
+    		INFO_PRINTF1(KErrText);
+    		}
+    	}
+    
+    fs.Close();
+    return exists;
+    }
+
+void CT_LbsClientPosTp254::CheckPositionInfoL(TPositionInfo& aInfo, TPositionInfo& aLastInfo)
+	{
+    if (aInfo.UpdateType() != aLastInfo.UpdateType())
+        {
+        _LIT(KErrUpdateType, "Update type not stored correctly");
+        LogErrorAndLeaveL(KErrUpdateType);
+        }
+    if (aLastInfo.ModuleId().iUid != 0)
+		{
+		_LIT(KIncorrectPsyError,
+           "Uid not reseted");
+		LogErrorAndLeaveL(KIncorrectPsyError);
+		}
+	TPosition pos;
+    TPosition lastPos;
+	aInfo.GetPosition(pos);
+    aLastInfo.GetPosition(lastPos);
+	CheckPositionL(pos, lastPos);
+	}
+
+void CT_LbsClientPosTp254::CheckPositionL(TPosition& aPos, TPosition& aLastPos)
+	{
+	if (aPos.Time() != aLastPos.Time() ||
+		aPos.HorizontalAccuracy() != aLastPos.HorizontalAccuracy() ||
+		aPos.VerticalAccuracy() != aLastPos.VerticalAccuracy() ||
+		aPos.Latitude() != aLastPos.Latitude() ||
+		aPos.Longitude() != aLastPos.Longitude() ||
+		aPos.Altitude() != aLastPos.Altitude())
+		{
+		_LIT(KErrPosition, "Wrong position returned");
+		LogErrorAndLeaveL(KErrPosition);
+		}
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp256.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,291 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleIdList.h>
+#include "ctlbsclientpostp256.h"
+#include <e32std.h>
+
+// CONSTANTS
+const TInt KNoMultipleClients=2;
+const TUint KMaxHeapSize=0x80000;
+
+// Structure for passing parameters to threads
+struct MyThreadData
+    {
+    TBool iTestFlag;
+    };
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp256::CT_LbsClientPosTp256(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{  
+	_LIT(KTestName, "Tp256 - Location Settings and Multiple Clients");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp256::~CT_LbsClientPosTp256()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp256::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp256::StartL()
+    {
+    _LIT(KMultipleErr, "Error %d when multiple clients access the CPosModules, err from client:%d");
+    _LIT(KSuccess, "Client %d is successful");
+    _LIT(KAllErr, "All clients gets error when multiple clients access the CPosModules");
+    _LIT(KPanicErr, "Panic when multiple clients access the CPosModules,  Thread: %d panics");
+    
+    TFixedArray<TRequestStatus, KNoMultipleClients> statuses;
+    //make a request just to make sure att all databases are created.
+
+	SetupPsyL(iUidMultiPsy);
+
+    //synchronous request
+    ConnectL();
+
+    User::LeaveIfError(OpenPositionerByName(iUidMultiPsy));
+
+    TPositionInfo info = TPositionInfo();
+
+	RequestL(info);
+
+    //potenial memory leak if above function leav
+    ClosePositioner();
+    Disconnect();
+
+    //End first request.
+
+
+    TInt errorsFound = KErrNone;
+    CreateThreadsL();
+
+    for (TInt i=0; i<iThreads.Count(); i++)
+        { 
+        iThreads[i].Logon(statuses[i]);
+        iThreads[i].Resume();
+        }
+    
+    for (TInt t=0; t<iThreads.Count(); t++)
+        {
+        TInt exitReason = iThreads[t].ExitReason();
+        
+        TBuf<150> buf;
+        if (exitReason != KErrNone) 
+            {      
+            buf.Format(KMultipleErr, exitReason, t);
+            INFO_PRINTF1(buf);
+
+            errorsFound++;
+            }
+        else
+            {
+            buf.Format(KSuccess, t);
+            INFO_PRINTF1(buf);
+            }
+        AssertTrueL(iThreads[t].ExitType() != EExitPanic, KPanicErr, t);
+        }
+    
+    AssertTrueL(errorsFound < KNoMultipleClients, KAllErr, KErrGeneral);   
+    
+    _LIT(KPass, "CT_LbsClientPosTp256 passed!!!");
+    INFO_PRINTF1(KPass);
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp256::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp256::CloseTest()
+    {
+    for (TInt i=0; i<iThreads.Count(); i++)
+        {
+        iThreads[i].Close();
+        }
+
+    iThreads.Close();
+    iNames.ResetAndDestroy();
+    }
+
+// ---------------------------------------------------------
+// void RunTestL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void RunTestL(TAny* aData)
+    {
+    const TInt KNrOfRounds = 50;
+   
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+
+    TInt nrOfModules = 0;
+
+    // Read parameters from TAny*
+    MyThreadData* info = (MyThreadData*) aData;
+    TInt i = 0;
+    for (i=0;i<KNrOfRounds; i++)
+        {
+        //db->ResetAllModulesL();
+        CPosModuleIdList* myDebugList = db->ModuleIdListLC();
+        
+        nrOfModules = myDebugList->Count();
+        TPositionModuleInfo debugModuleInfo;
+        TBuf<40> moduleName;
+        TPositionQuality quality;
+        
+        for (TInt i=0;i<nrOfModules;i++)
+            {
+            db->GetModuleInfoL(myDebugList->At(i), debugModuleInfo);
+            moduleName.Zero();
+            debugModuleInfo.GetModuleName(moduleName);
+            debugModuleInfo.GetPositionQuality(quality);
+            }
+            CleanupStack::PopAndDestroy(myDebugList);
+        }
+
+   for (i=0;i<KNrOfRounds; i++)
+        {
+        // The first thread does this
+        if (info->iTestFlag)
+            {
+            for (TInt j=0;j<nrOfModules;j++)
+                {
+                // Just change priority
+                db->SetModulePriorityL(nrOfModules-j-1, j);
+                }
+            }
+        // And all the other thread does this
+        else
+            {
+            CPosModuleIdList* myDebugList = db->ModuleIdListLC();
+            
+            TInt debugCount = myDebugList->Count();
+            TPositionModuleInfo debugModuleInfo;
+            TBuf<20> moduleName;
+            TPositionQuality quality;
+            
+            for (TInt i=0;i<debugCount;i++)
+                {
+                db->GetModuleInfoL(myDebugList->At(i), debugModuleInfo);
+                moduleName.Zero();
+                debugModuleInfo.GetModuleName(moduleName);
+                debugModuleInfo.GetPositionQuality(quality);
+                }
+            CleanupStack::PopAndDestroy(myDebugList);
+            }
+        }
+        
+
+    CleanupStack::PopAndDestroy(db);
+    }
+
+// ---------------------------------------------------------
+// LOCAL_C TInt ThreadFunction
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+LOCAL_C TInt ThreadFunction(TAny* aData)
+    {
+    __UHEAP_MARK;
+    CTrapCleanup* cleanup=CTrapCleanup::New(); // get clean-up stack
+    
+    if (cleanup == NULL)
+        {
+        return KErrNoMemory;
+        }
+    // we need an ActiveScheduler 
+    CActiveScheduler scheduler;
+    CActiveScheduler::Install(&scheduler);   
+
+    TRAPD(err, RunTestL(aData));
+    
+    delete cleanup; // destroy clean-up stack
+    __UHEAP_MARKEND;
+    return err;
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp256::CreateThreadsL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp256::CreateThreadsL()
+    {
+    _LIT(KThreadName, "TP256 test thread%d");
+    _LIT(KCreateThreadErr, "Create thread failed with %d");
+
+    for (TInt i=0; i<KNoMultipleClients; i++)
+        {
+        // Introduce parameters for each thread.
+        MyThreadData info;
+        
+        if (i == 0) info.iTestFlag = ETrue;
+        else info.iTestFlag = EFalse;
+
+        RThread thread;
+        TBuf<32> name;
+	    name.Format(KThreadName, 1+iThreads.Count());
+
+        TInt err;
+        err = thread.Create(name, ThreadFunction, KDefaultStackSize, KMinHeapSize, KMaxHeapSize, reinterpret_cast<TAny*>(&info));
+        AssertTrueL(err == KErrNone, KCreateThreadErr, err);                                                                  
+        
+        iThreads.Append(thread);
+        }
+    }
+
+
+void CT_LbsClientPosTp256::RequestL(TPositionInfoBase& aInfoBase)
+	{
+	_LIT(KService, "service");
+    TInt err = PerformSyncRequest(KService, &aInfoBase);
+
+    if (err != KErrNone)
+        {
+        _LIT(KErrorRequest, "The request was not completed with KErrorNone, errCode = %d");
+		TBuf<100> buf;
+		buf.Format(KErrorRequest, err);
+        LogErrorAndLeaveL(buf);
+        }
+
+	_LIT(KIncorrectPsySyncRequestError,
+          "TP2. Position from wrong PSY received (sync request).");
+    if (iUidMultiPsy != aInfoBase.ModuleId())
+        {
+        LogErrorAndLeaveL(KIncorrectPsySyncRequestError);
+        }
+	}
+    
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp257.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,592 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp257.h"
+
+// CONSTANTS
+_LIT(KLastPosition, "c:\\private\\101f97b2\\LastKnownPos.dat");
+
+// ================= MEMBER FUNCTIONS =======================
+
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp257::CT_LbsClientPosTp257(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{  
+	_LIT(KTestName, "Tp257-GetLastKnown Position, update options");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp257::~CT_LbsClientPosTp257()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp257::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp257::CloseTest()
+    {
+    // Disconnect disconnects from "iPosServer"
+    Disconnect();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp257::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp257::StartL()
+    {
+
+    // make sure Server is closed
+    User::After(2100000);
+    
+    // Remove getlastknown data file
+    DeleteFileL(KLastPosition);
+
+    SetupPsyL(iUidMultiPsy);
+    ConnectL();
+
+    TInt err = KErrNone;
+
+    RPositioner positioner1;
+    RPositioner positioner2;
+    TRequestStatus status1;
+    TRequestStatus status2;
+    TPositionInfo moduleInfo1;
+    TPositionInfo moduleInfo2;
+    TPositionInfo moduleInfo3;
+    TPositionInfo moduleInfoMaxAge1;
+    TPositionInfo moduleInfoMaxAge2;
+    
+    // 1) Connect to server and open positioner
+    err = positioner1.Open(iPosServer);
+    CleanupClosePushL(positioner1);
+    if (err != KErrNone)
+    	{
+    	_LIT(KErrorAndLeave, "Could not open positioner");
+    	LogErrorAndLeaveL(KErrorAndLeave);
+    	}
+        
+    _LIT(KKalleService, "KallesService");
+    err = positioner1.SetRequestor(CRequestor::ERequestorService,
+                           CRequestor::EFormatApplication, KKalleService);
+    if (err != KErrNone)
+    	{
+    	_LIT(KErrorAndLeave, "Could not set requestor");
+    	LogErrorAndLeaveL(KErrorAndLeave);
+    	}
+
+    // 2) Request a position
+    positioner1.NotifyPositionUpdate(moduleInfo1, status1);
+    User::WaitForRequest(status1);
+    if (status1.Int() != KErrNone)
+    	{
+    	_LIT(KErrorAndLeave, "Wrong status1 returned: ");
+    	LogErrorAndLeaveL(KErrorAndLeave, status1.Int());
+    	}
+
+    // Not included in TC, just test that it is possible to get a lastknownposition
+    positioner1.GetLastKnownPosition(moduleInfo2, status1);
+    User::WaitForRequest(status1);
+    if (status1.Int() != KErrNone)
+    	{
+    	_LIT(KErrorAndLeave, "Wrong status3 returned: ");
+    	LogErrorAndLeaveL(KErrorAndLeave, status1.Int());
+    	}
+
+    if (!ComparePositionL(moduleInfo1, moduleInfo2))
+        {
+        _LIT(KErrorAndLeave, "1. The old position1 was not returned!!!");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    // 3) Set update interval to 5 seconds, if there are no ongoing 
+    // position requests a GetLastKnown request is OK
+    TPositionUpdateOptions posOption;
+	posOption.SetUpdateInterval(TTimeIntervalMicroSeconds(5000000));
+
+    err = positioner1.SetUpdateOptions(posOption);
+	_LIT(KChange, "Error when setting update interval, error %d");
+	AssertTrueL(err == KErrNone, KChange, err);
+
+    positioner1.GetLastKnownPosition(moduleInfo2, status1);
+    User::WaitForRequest(status1);
+
+    if (status1.Int() != KErrNone)
+    	{
+    	_LIT(KErrorAndLeave, "KErrNone should be returned from a tracking session");
+    	LogErrorAndLeaveL(KErrorAndLeave, status1.Int());
+    	}
+
+    // Reset interval
+    posOption.SetUpdateInterval(TTimeIntervalMicroSeconds(0));
+    err = positioner1.SetUpdateOptions(posOption);
+
+    // Get last known position
+    positioner1.GetLastKnownPosition(moduleInfo3, status1);
+    User::WaitForRequest(status1);
+    if (status1.Int() != KErrNone)
+    	{
+    	_LIT(KErrorAndLeave, "Wrong status1 returned 2: ");
+    	LogErrorAndLeaveL(KErrorAndLeave, status1.Int());
+    	}
+
+    if (!ComparePositionL(moduleInfo1, moduleInfo3))
+        {
+        _LIT(KErrorAndLeave, "2. The old position2 was not returned!!!");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    // 5 ) Set maxage to five seconds
+    TPositionUpdateOptions posOption2;
+    posOption2.SetMaxUpdateAge(TTimeIntervalMicroSeconds(5000000));
+	err = positioner1.SetUpdateOptions(posOption2);
+	_LIT(KChange1, "Error when setting max age in SetMaxUpdateAge, error %d");
+	AssertTrueL(err == KErrNone, KChange1, err);
+
+    //Wait for five seconds
+    User::After(5000000);
+
+    // 6) Get last known position
+    positioner1.GetLastKnownPosition(moduleInfo3, status1);
+    User::WaitForRequest(status1);
+    if (status1.Int() != KErrNone)
+    	{
+    	_LIT(KErrorAndLeave, "Wrong status1 returned 3");
+    	LogErrorAndLeaveL(KErrorAndLeave);
+    	}
+
+    if (!ComparePositionL(moduleInfo1, moduleInfo3))
+        {
+        _LIT(KErrorAndLeave, "3. The old position was not returned from positioner!!!");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    // 7) Open the maxage psy
+    SetupPsyL(iUidTestPsyMaxAge);
+    err = positioner2.Open(iPosServer, iUidTestPsyMaxAge);
+    CleanupClosePushL(positioner2);
+    _LIT(KKalleService2, "KallesService2");
+    err = positioner2.SetRequestor(CRequestor::ERequestorService,
+                           CRequestor::EFormatApplication, KKalleService2);
+
+    _LIT(KErrOepnMaxAge, "Could not open the maxage psy");
+	AssertTrueL(err == KErrNone, KErrOepnMaxAge, err);
+
+    positioner2.NotifyPositionUpdate(moduleInfoMaxAge1, status2);
+    User::WaitForRequest(status2);
+    err = status2.Int();
+    if (err != KErrNone)
+    	{
+    	_LIT(KErrorAndLeave, "Wrong status2 returned");
+    	LogErrorAndLeaveL(KErrorAndLeave);
+    	}
+
+    // 8)
+    positioner1.NotifyPositionUpdate(moduleInfo1, status1);
+    User::WaitForRequest(status1);
+    err = status1.Int();
+
+    // 9) Set maxage to four seconds for positioner2
+    posOption2.SetMaxUpdateAge(TTimeIntervalMicroSeconds(4000000));
+	err = positioner2.SetUpdateOptions(posOption2);
+	_LIT(KErrSetMaxAge, "Error when setting max age in SetMaxUpdateAge, error %d");
+	AssertTrueL(err == KErrNone, KErrSetMaxAge, err);
+
+    positioner2.NotifyPositionUpdate(moduleInfoMaxAge2, status2);
+    User::WaitForRequest(status2);
+    err = status2.Int();
+    if (err != KErrNone) 
+    	{
+    	_LIT(KErrorAndLeave, "Wrong status2 returned");
+    	LogErrorAndLeaveL(KErrorAndLeave);
+    	}
+    // Check moduleInfoMaxAge2 and moduleInfoMaxAge1 here, should be the same
+    _LIT(KCheckMaxAge, "Check MaxAge position");
+    INFO_PRINTF1(KCheckMaxAge);
+    if (!ComparePositionL(moduleInfoMaxAge1, moduleInfoMaxAge2))
+        {
+        _LIT(KErrorAndLeave, "The maxage position was not returned from maxage positioner!!!");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+    // Close maxage positioner
+    positioner2.Close();
+
+    // 10) Check moduleInfo2 and moduleInfo1 here, should be the same
+    positioner1.GetLastKnownPosition(moduleInfo2, status1);
+    User::WaitForRequest(status1);
+    if (!ComparePositionL(moduleInfo2, moduleInfo1))
+        {
+        _LIT(KErrorAndLeave, "The same maxage position was not returned from positioner for client 1!!!");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    // 11)
+    TPositionUpdateOptions posOption3;
+    posOption3.SetUpdateTimeOut(TTimeIntervalMicroSeconds(4000000));
+	err = positioner1.SetUpdateOptions(posOption3);
+	_LIT(KErrSetTimeout, "Error when setting timeout in SetUpdateOptions, error %d");
+	AssertTrueL(err == KErrNone, KErrSetTimeout, err);
+
+	_LIT(KWaitForCancel, "Wait for cancel...");
+    INFO_PRINTF1(KWaitForCancel);
+    
+    // 12)
+    positioner1.GetLastKnownPosition(moduleInfo2, status1);
+
+    // Wait for five seconds
+    User::After(5000000);
+    _LIT(KWaitForRequest, "Wait for WaitForRequest(status1)...");
+    INFO_PRINTF1(KWaitForRequest);   
+    User::WaitForRequest(status1);
+    // Check moduleInfo2 and moduleInfo1 here, should be the same
+    if (!ComparePositionL(moduleInfo2, moduleInfo1))
+        {
+        _LIT(KErrorAndLeave, "4. The same position was not returned from positioner for client 1!!!");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    // 13 ) Check with partial update
+    SetupPsyL(iUidTestPsyPartialUpdate);
+    err = positioner2.Open(iPosServer, iUidTestPsyPartialUpdate);
+    if (err != KErrNone)
+    	{
+    	_LIT(KErrorAndLeave, "Could not open PartialUpdate positioner");
+    	LogErrorAndLeaveL(KErrorAndLeave);
+    	}
+
+    _LIT(KPellesService, "PellesService");
+    err = positioner2.SetRequestor(CRequestor::ERequestorService,
+                           CRequestor::EFormatApplication, KPellesService);
+
+    // Get a position from partial update psy
+    positioner2.NotifyPositionUpdate(moduleInfo1, status2);
+    User::WaitForRequest(status2);
+    err = status2.Int();
+    if (err != KErrNone)
+    	{
+    	_LIT(KErrorAndLeave, "Wrong status returned from partial update psy");
+    	LogErrorAndLeaveL(KErrorAndLeave, err);
+    	}
+
+    TPositionUpdateOptions updateOptions;
+    updateOptions.SetAcceptPartialUpdates(ETrue);
+    err = positioner2.SetUpdateOptions(updateOptions);
+    _LIT(KErrSetPartialupdate, "Error when setting partialupdate in SetUpdateOptions, error %d");
+    AssertTrueL(err == KErrNone, KErrSetPartialupdate, err);
+
+    // 14) GetLastKnownPosition from partial update psy
+    positioner2.GetLastKnownPosition(moduleInfo2, status1);
+    User::WaitForRequest(status1);
+    // Check moduleInfo2 and moduleInfo1 here, should be the same
+    if (!ComparePositionL(moduleInfo2, moduleInfo1))
+        {
+        _LIT(KErrorAndLeave, "5. The same partial update position was not returned from positioner!!!");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    // 15) Get another position from partial update psy, this should be a partial update position
+    // and should not be saved as lastknownposition
+    positioner2.NotifyPositionUpdate(moduleInfo1, status2);
+    User::WaitForRequest(status2);
+    err = status2.Int();
+    if (err != KPositionPartialUpdate)
+    	{
+    	_LIT(KErrorAndLeave, "Partial Update PSY did not return KPositionPartialUpdate");
+    	LogErrorAndLeaveL(KErrorAndLeave, err);
+    	}
+
+    // 16) GetLastKnownPosition from partial update psy
+    positioner2.GetLastKnownPosition(moduleInfo3, status1);
+    User::WaitForRequest(status1);
+    // Check moduleInfo2 and moduleInfo1 here, should NOT be the same
+    if (ComparePositionL(moduleInfo1, moduleInfo2))
+        {
+        _LIT(KErrorAndLeave, "6. The partial update position should NOT have been returned");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    // Check moduleInfo3 and moduleInfo2 here, should be the same
+    if (ComparePositionL(moduleInfo3, moduleInfo1))
+        {
+        _LIT(KErrorAndLeave, "7. The old position was not returned");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    // Close all connections
+    positioner1.Close();
+    positioner2.Close();
+    
+    // 17 ) Start a periodic update session 
+    _LIT(KPeriodicUpdate, "Checking periodic update session");
+    INFO_PRINTF1(KPeriodicUpdate);
+	posOption.SetUpdateInterval(TTimeIntervalMicroSeconds(5000000));
+
+    // Connect to server and open positioner
+    err = positioner1.Open(iPosServer);
+    if (err != KErrNone)
+    	{
+    	_LIT(KErrorAndLeave, "Could not open positioner");
+    	LogErrorAndLeaveL(KErrorAndLeave);
+    	}
+        
+    _LIT(KKallesPeriodicService, "KallesPeriodicService");
+    err = positioner1.SetRequestor(CRequestor::ERequestorService,
+                           CRequestor::EFormatApplication, KKallesPeriodicService);
+    if (err != KErrNone)
+    	{
+    	_LIT(KErrorAndLeave, "Could not set requestor");
+    	LogErrorAndLeaveL(KErrorAndLeave);
+    	}
+
+    err = positioner1.SetUpdateOptions(posOption);
+    _LIT(KErrSetUpdateOption, "Could not set updateoptions");
+	AssertTrueL(err == KErrNone, KErrSetUpdateOption, err);
+    
+    TRequestStatus status;
+    positioner1.NotifyPositionUpdate(moduleInfo1, status);
+    User::WaitForRequest(status);
+
+    posOption.SetUpdateInterval(TTimeIntervalMicroSeconds(0));
+    // Settings update interval to 0 should stop the periodic update
+    err = positioner1.SetUpdateOptions(posOption);
+    _LIT(KErrSetUpdateOption2, "Could not set updateoptions2");
+	AssertTrueL(err == KErrNone, KErrSetUpdateOption2, err);
+
+    // Get GetLastKnownPosition from the stopped periodic update session
+    positioner1.GetLastKnownPosition(moduleInfo2, status);
+    User::WaitForRequest(status);
+    // Check moduleInfo2 and moduleInfo1 here, should be the same
+    if (!ComparePositionL(moduleInfo1, moduleInfo2))
+        {
+        _LIT(KErrorAndLeave, "1. The periodic update session position was not equal to getlastknown position");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    positioner1.Close();
+    moduleInfo1 = TPositionInfo();
+    moduleInfo2 = TPositionInfo();
+
+    // 18 ) Start a periodic update session
+    INFO_PRINTF1(KPeriodicUpdate);
+	posOption.SetUpdateInterval(TTimeIntervalMicroSeconds(5000000));
+
+    // Connect to server and open positioner
+    err = positioner1.Open(iPosServer);
+    if (err != KErrNone)
+    	{
+    	_LIT(KErrorAndLeave, "Could not open positioner");
+    	LogErrorAndLeaveL(KErrorAndLeave);
+    	}
+        
+    err = positioner1.SetRequestor(CRequestor::ERequestorService,
+                           CRequestor::EFormatApplication, KKallesPeriodicService);
+    if (err != KErrNone)
+    	{
+    	_LIT(KErrorAndLeave, "Could not set requestor");
+    	LogErrorAndLeaveL(KErrorAndLeave);
+    	}
+
+    // Connect to server and open positioner
+    err = positioner2.Open(iPosServer);
+    if (err != KErrNone)
+    	{
+    	_LIT(KErrorAndLeave, "Could not open positioner2");
+    	LogErrorAndLeaveL(KErrorAndLeave);
+    	}
+        
+    err = positioner2.SetRequestor(CRequestor::ERequestorService,
+                           CRequestor::EFormatApplication, KKallesPeriodicService);
+    if (err != KErrNone)
+    	{
+    	_LIT(KErrorAndLeave, "Could not set requestor");
+    	LogErrorAndLeaveL(KErrorAndLeave);
+    	}
+
+
+    err = positioner1.SetUpdateOptions(posOption);
+	AssertTrueL(err == KErrNone, KErrSetUpdateOption, err);
+
+    positioner1.NotifyPositionUpdate(moduleInfo1, status);
+    User::WaitForRequest(status);
+    
+    posOption.SetUpdateInterval(TTimeIntervalMicroSeconds(0));
+    // Settings update interval to 0 should stop the periodic update
+    err = positioner1.SetUpdateOptions(posOption);
+	AssertTrueL(err == KErrNone, KErrSetUpdateOption2, err);
+
+    positioner2.GetLastKnownPosition(moduleInfo2, status1);
+    User::WaitForRequest(status1);
+
+    // Check moduleInfo2 and moduleInfo1 here, should be the same
+    if (!ComparePositionL(moduleInfo1, moduleInfo2))
+        {
+        _LIT(KErrorAndLeave, "2. The periodic update session position was not equal to getlastknown position");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    positioner1.Close();
+    positioner2.Close();
+
+    CleanupStack::PopAndDestroy(1); //positioner2
+    CleanupStack::PopAndDestroy(1); //positioner1
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp257::ComparePositionL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TBool CT_LbsClientPosTp257::ComparePositionL(TPositionInfo aPosInfo1, TPositionInfo aPosInfo2)
+    {
+    _LIT(KFunctionName, "We are inside ComparePositionL");
+    INFO_PRINTF1(KFunctionName);
+    TBool result = ETrue;
+    TBuf<150> buf;
+
+    TPosition pos1 = TPosition();
+    TPosition pos2 = TPosition();
+    aPosInfo1.GetPosition(pos1);
+    aPosInfo2.GetPosition(pos2);
+
+    TTime time1 = pos1.Time();
+    TTime time2 = pos2.Time();
+
+    if (time1 == time2)
+        {
+        _LIT(KTime, "Equal Time");
+        INFO_PRINTF1(KTime);
+        }
+    else 
+    	{
+    	_LIT(KTime, "NOT Equal Time");
+    	INFO_PRINTF1(KTime);
+    	}
+
+    if ((time1 != time2) || (pos1.Latitude() != pos2.Latitude()) || 
+        (pos1.Longitude() != pos2.Longitude()) || 
+        (pos1.Altitude() != pos2.Altitude()) )
+        {
+        // Not equal
+        result = EFalse;
+        _LIT(KNotEqual, "Not equal");
+        INFO_PRINTF1(KNotEqual);
+        _LIT(KPosition1, "Position1: Lat %f Long %f Alt %f");
+        buf.Format(KPosition1, pos1.Latitude(), pos1.Longitude() ,pos1.Altitude());
+        INFO_PRINTF1(buf);
+        _LIT(KPosition2, "Position2: Lat %f Long %f Alt %f");
+        buf.Format(KPosition2, pos2.Latitude(), pos2.Longitude() ,pos2.Altitude());
+        INFO_PRINTF1(buf);
+        }
+    else
+        {
+        _LIT(KEqual, "Equal");
+        INFO_PRINTF1(KEqual);
+        result = ETrue;
+        _LIT(KPosition1, "Position1: Lat %f Long %f Alt %f");
+        buf.Format(KPosition1, pos1.Latitude(), pos1.Longitude() ,pos1.Altitude());
+        INFO_PRINTF1(buf);
+        }
+    return result;
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp257::DeleteFileL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp257::DeleteFileL(const TDesC& aFile)
+    {
+    RFs fs;
+    TInt err = fs.Connect();
+
+    err = fs.Delete(aFile);
+    fs.Close();
+    if (err == KErrNone)
+        {
+        _LIT(KDebugText, "TP257: The specified file deleted");
+        INFO_PRINTF1(KDebugText);
+        }
+    else
+        {
+        if (err == KErrInUse)
+            {
+            _LIT(KErrText, "TP257: The specified file could not be deleted it is already in use, errorcode %d");
+            INFO_PRINTF1(aFile);
+            TBuf<100> buf;
+            buf.Format(KErrText, err);
+            AssertTrueL(err==0, KErrText, err);
+            }
+        else if (err == KErrNotFound)
+            {
+            _LIT(KDebugText, "TP257: The specified file could not be found ,errorcode %d");
+            TBuf<100> buf;
+            buf.Format(KDebugText, err);
+            INFO_PRINTF1(buf);
+            }
+        else
+            {
+            _LIT(KErrText, "TP257: The specified file could not be deleted, errorcode %d");
+            TBuf<100> buf;
+            buf.Format(KErrText, err);
+            AssertTrueL(err==0, KErrText, err);
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp254::FileExistsL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TBool CT_LbsClientPosTp257::FileExistsL(const TDesC& aFile)
+    {
+    TBool exist = EFalse;
+    RFs fs;
+    RFile file;
+    TInt err = fs.Connect();
+
+    err = file.Open(fs, aFile, EFileRead);
+    if (err==KErrNotFound) // file does not exist
+        {
+        fs.Close();
+        _LIT(KErrText, "TP257: The specified file does not exist");
+        INFO_PRINTF1(KErrText);
+        }
+    else
+        {
+        exist = ETrue;
+        _LIT(KErrText, "TP257: The specified file exists");
+        INFO_PRINTF1(KErrText);
+        file.Close();
+        fs.Close();
+        }
+    return exist;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp259.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,200 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp259.h"
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp259::CT_LbsClientPosTp259(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent) 
+	{
+	_LIT(KTestName, "TP259 - Cancel Request with incorrect enum values");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp259::~CT_LbsClientPosTp259()
+	{
+	}
+// ---------------------------------------------------------
+// CT_LbsClientPosTp259::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp259::CloseTest()
+    {
+    ClosePositioner(); 
+    Disconnect();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp259::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp259::StartL()
+    {
+    // TestPart1 tests the separate case described in Error Report 
+    // "SBUY-5W8KJ6-Bug in subsession selection when forwarding requests"
+    TestPart1L();
+    
+    // Testpart2 tests some other scenarios not included in TestPart1L
+    TestPart2L();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp259::TestPart1L
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp259::TestPart1L()
+    {
+    _LIT(KFunctionsName, "We are inside TestPart1L()");
+    INFO_PRINTF1(KFunctionsName);
+    ConnectL();
+
+    // First call the RPosServer::CancelRequest method with inparameter 
+    // EPositionerNotifyPositionUpdate and then call the RPositioner::CancelRequest
+    // method with EPositionServerNotifyModuleStatusEvent
+
+    _LIT(KCancelRequest, "iPosServer.CancelRequest(EPositionerNotifyPositionUpdate)");
+    INFO_PRINTF1(KCancelRequest);
+    TInt cancelErr = iPosServer.CancelRequest(EPositionerNotifyPositionUpdate);
+    if (cancelErr != KErrNotSupported)
+    	{
+    	_LIT(KErrorAndLeave, "The CancelRequest(EPositionerNotifyPositionUpdate) call did not return KErrNotSupported");
+    	LogErrorAndLeaveL(KErrorAndLeave);
+    	}
+    
+    SetupPsyL(iUidMultiPsy);
+    User::LeaveIfError(OpenPositionerByName(iUidMultiPsy));
+
+    _LIT(KModuleStatusEvent, "iPositioner.CancelRequest(EPositionServerNotifyModuleStatusEvent);");
+    INFO_PRINTF1(KModuleStatusEvent);
+    TInt err = iPositioner.CancelRequest(EPositionServerNotifyModuleStatusEvent);
+    if (err != KErrNotSupported)
+    	{
+    	_LIT(KErrorAndLeave, "The CancelRequest(EPositionServerNotifyModuleStatusEvent) call did not return KErrNotFound");
+    	LogErrorAndLeaveL(KErrorAndLeave);
+    	}
+    
+    ClosePositioner();
+    Disconnect();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp259::TestPart2L
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp259::TestPart2L()
+    {
+    _LIT(KFunctionsName,"We are inside TestPart2L()");
+    INFO_PRINTF1(KFunctionsName);
+    SetupPsyL(iUidMultiPsy);
+    ConnectL();
+    TInt err = KErrNone;
+    User::LeaveIfError(OpenPositionerByName(iUidMultiPsy));
+
+    err = iPositioner.CancelRequest(EPositionServerNotifyModuleStatusEvent);
+    if (err != KErrNotSupported)
+        {
+        _LIT(KErrorAndLeave, "The CancelRequest(EPositionServerNotifyModuleStatusEvent) call did not return KErrNotFound");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    // Verify that a RPosServer.CancelRequest(EPositionServerNotifyModuleStatusEvent) (incorrect call)
+    // call does not affect the RPositioner.NotifyPositionUpdate call
+    _LIT(KKalle, "Kalle");
+    PerformRequestL(KKalle, CRequestor::ERequestorService, CRequestor::EFormatTelephone); 
+    err = iPosServer.CancelRequest(EPositionServerNotifyModuleStatusEvent);
+    if (err != KErrNotFound)
+        {
+        _LIT(KErrorAndLeave, "The CancelRequest(EPositionServerNotifyModuleStatusEvent) call did not return KErrNotFound");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+    CheckRequestResultL(KErrNone);
+
+    // Verify that a RPositioner.CancelRequest(EPositionServerNotifyModuleStatusEvent) (incorrect call)
+    // call does not affect the RPositioner.NotifyPositionUpdate call
+    PerformRequestL(KKalle, CRequestor::ERequestorService, CRequestor::EFormatTelephone); 
+    err = iPositioner.CancelRequest(EPositionServerNotifyModuleStatusEvent);
+    if (err != KErrNotSupported)
+        {
+        _LIT(KErrorAndLeave, "The CancelRequest(EPositionServerNotifyModuleStatusEvent) call did not return KErrNotFound");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    CheckRequestResultL(KErrNone);
+
+    err = iPositioner.CancelRequest(EPositionerNotifyPositionUpdate);
+    if (err != KErrNotFound) 
+        {
+        _LIT(KErrorAndLeave, "The CancelRequest(EPositionerNotifyPositionUpdate) call did not return KErrNotFound");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    ClosePositioner();
+
+    // According to error report "SBUY-5W8KJ6 - Bug in subsession selection when forwarding requests"
+    // CancelRequest call will return with KErrNotSupported
+    TInt cancelErr = iPosServer.CancelRequest(EPositionerNotifyPositionUpdate);
+    if (cancelErr != KErrNotSupported)
+        {
+        _LIT(KErrorAndLeave, "The CancelRequest(EPositionerNotifyPositionUpdate) call did not return KErrNotSupported");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    // According to error report "SBUY-5W8KJ6 - Bug in subsession selection when forwarding requests"
+    // CancelRequest call will return with KErrNotSupported
+    _LIT(KLastKnownPosition, "iPosServer.CancelRequest(EPositionerGetLastKnownPosition)");
+    INFO_PRINTF1(KLastKnownPosition);
+    cancelErr = iPosServer.CancelRequest(EPositionerGetLastKnownPosition);
+    if (cancelErr != KErrNotSupported)
+        {
+        _LIT(KErrorAndLeave, "The CancelRequest(EPositionerGetLastKnownPosition) call did not return KErrNotSupported");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    //Make a request and then cancel a GetLastKnownPosition request that hasn't been made
+    //and check that the position request is not affected
+    User::LeaveIfError(OpenPositionerByName(iUidMultiPsy));
+    PerformRequestL(KKalle, CRequestor::ERequestorService, CRequestor::EFormatTelephone);
+
+    cancelErr = iPosServer.CancelRequest(EPositionerGetLastKnownPosition);
+    if (cancelErr != KErrNotSupported) 
+        {
+        _LIT(KErrorAndLeave, "The CancelRequest(EPositionerGetLastKnownPosition call did not return KErrNotSupported");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    CheckRequestResultL(KErrNone);
+
+    ClosePositioner();
+    Disconnect();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp261.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,256 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp261.h"
+#include <s32strm.h>
+#include <s32mem.h>
+
+// CONSTANTS
+
+// LOCAL FUNCTIONS
+void CleanOp(TAny* aAnArray)
+    {
+    // Cleanup function the requestor stack
+    RRequestorStack* theStack = reinterpret_cast <RRequestorStack*> (aAnArray);
+    theStack->ResetAndDestroy();
+    }
+
+// ================= MEMBER FUNCTIONS =======================
+
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp261::CT_LbsClientPosTp261(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{  
+	_LIT(KTestName,"Tp261 - RequestorStack Externalize/Internalize");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp261::~CT_LbsClientPosTp261()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp261::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp261::CloseTest()
+    {
+    ClosePositioner();
+    Disconnect();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp261::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp261::StartL()
+    {
+    _LIT(KService1, "Service1");
+    _LIT(KService2, "Service2");
+    _LIT(KService3, "Service3");
+
+    _LIT(KContact1, "Contact1");
+    _LIT(KContact2, "Contact2");
+    _LIT(KContact3, "Contact3");
+
+    CRequestor* serviceId1 = 
+		CRequestor::NewL(CRequestor::ERequestorService, CRequestor::EFormatApplication, 
+                    KService1);
+
+    CRequestor* serviceId2 = 
+        CRequestor::NewL(CRequestor::ERequestorService, CRequestor::EFormatApplication, 
+                    KService2);
+
+    CRequestor* serviceId3 = 
+        CRequestor::NewL(CRequestor::ERequestorService, CRequestor::EFormatApplication, 
+                    KService3);
+
+    CRequestor* contactId1 = 
+        CRequestor::NewL(CRequestor::ERequestorContact, CRequestor::EFormatTelephone, 
+                    KContact1);
+
+    CRequestor* contactId2 = 
+        CRequestor::NewL(CRequestor::ERequestorContact, CRequestor::EFormatUrl, 
+                    KContact2);
+
+    CRequestor* contactId3 = 
+        CRequestor::NewL(CRequestor::ERequestorContact, CRequestor::EFormatMail, 
+                    KContact3);
+
+    RRequestorStack stack = RRequestorStack();
+    CleanupStack::PushL(TCleanupItem(CleanOp ,&stack));
+
+    CleanupStack::PushL(serviceId1);
+    CleanupStack::PushL(serviceId2);
+    CleanupStack::PushL(serviceId3);
+    CleanupStack::PushL(contactId1);
+    CleanupStack::PushL(contactId2);
+    CleanupStack::PushL(contactId3);
+    
+    ConnectL();
+    OpenPositioner();
+    
+    stack.Append(serviceId1);
+    stack.Append(contactId1);
+    stack.Append(contactId2);
+    stack.Append(serviceId2);
+    stack.Append(contactId3);
+    stack.Append(serviceId3);
+
+    CleanupStack::Pop(contactId3);
+    CleanupStack::Pop(contactId2);
+    CleanupStack::Pop(contactId1);
+    CleanupStack::Pop(serviceId3);
+    CleanupStack::Pop(serviceId2);
+    CleanupStack::Pop(serviceId1);
+
+    TInt err = iPositioner.SetRequestor(stack);
+    if (err != KErrNone)
+    	{
+    	_LIT(KErrorAndLeave, "Problems setting requestorstack");
+    	LogErrorAndLeaveL(KErrorAndLeave);
+    	}
+    	
+    const TInt KPosBufFlatExpandSize = 100;
+    
+    //ExternalizeL
+    CBufFlat* bufFlat = CBufFlat::NewL(KPosBufFlatExpandSize);
+    CleanupStack::PushL(bufFlat);
+    
+    RBufWriteStream stream(*bufFlat);
+    CleanupClosePushL(stream);        
+    stack.ExternalizeL(stream);
+    
+    TPtr8 dataPtr((TUint8*)NULL, 0);
+    dataPtr.Set(bufFlat->Ptr(0));    
+
+    CleanupStack::PopAndDestroy(&stream);                
+
+    HBufC8* tempBuf = HBufC8::NewLC(bufFlat->Size());
+    TPtr8 ptr = tempBuf->Des();
+    ptr = dataPtr;
+    
+    //Internalize
+    bufFlat->InsertL(0, ptr);
+    
+    RBufReadStream rstream(*bufFlat);
+    CleanupClosePushL(rstream);
+    
+    RRequestorStack stack2 = RRequestorStack();
+    CleanupStack::PushL(TCleanupItem(CleanOp ,&stack2));
+
+    stack2.InternalizeL(rstream);
+    
+    // Verify the requestor stack
+    VerifyRequestorStackL(stack2);
+    _LIT(KResult, "The RequestorStack is correct after Externalize/Internalize");
+    INFO_PRINTF1(KResult);
+
+    CleanupStack::PopAndDestroy(1); // CleanupOp stack2
+
+    CleanupStack::PopAndDestroy(&rstream);
+    CleanupStack::PopAndDestroy(tempBuf);
+    CleanupStack::PopAndDestroy(bufFlat);
+    CleanupStack::PopAndDestroy(1); // CleanupOp stack1
+
+    ClosePositioner();
+    Disconnect();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp261::VerifyRequestorStackL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp261::VerifyRequestorStackL(RRequestorStack& aStack)
+    {    
+    TInt count = aStack.Count();
+    
+    _LIT(KService1, "Service1");
+    _LIT(KService2, "Service2");
+    _LIT(KService3, "Service3");
+
+    _LIT(KContact1, "Contact1");
+    _LIT(KContact2, "Contact2");
+    _LIT(KContact3, "Contact3");
+
+    // Hardcoded number of requestors
+    if (count != 6)
+        {
+        _LIT(KErrorAndLeave, "Wrong number of requestors in the stack");
+        LogErrorAndLeaveL(KErrorAndLeave);
+        }
+
+    if (aStack[0]->RequestorType() != CRequestor::ERequestorService
+           || aStack[0]->RequestorFormat() != CRequestor::EFormatApplication
+           || aStack[0]->RequestorData() != KService1)
+            {
+            _LIT(KErrorAndLeave, "Wrong requestor(1) in stack");
+            LogErrorAndLeaveL(KErrorAndLeave);
+            }
+
+    if (aStack[1]->RequestorType() != CRequestor::ERequestorContact
+           || aStack[1]->RequestorFormat() != CRequestor::EFormatTelephone
+           || aStack[1]->RequestorData() != KContact1)
+            {
+            _LIT(KErrorAndLeave, "Wrong requestor(2) in stack");
+            LogErrorAndLeaveL(KErrorAndLeave);
+            }
+
+    if (aStack[2]->RequestorType() != CRequestor::ERequestorContact
+           || aStack[2]->RequestorFormat() != CRequestor::EFormatUrl
+           || aStack[2]->RequestorData() != KContact2)
+            {
+            _LIT(KErrorAndLeave, "Wrong requestor(3) in stack");
+            LogErrorAndLeaveL(KErrorAndLeave);
+            }
+
+    if (aStack[3]->RequestorType() != CRequestor::ERequestorService
+           || aStack[3]->RequestorFormat() != CRequestor::EFormatApplication
+           || aStack[3]->RequestorData() != KService2)
+            {
+            _LIT(KErrorAndLeave, "Wrong requestor(4) in stack");
+            LogErrorAndLeaveL(KErrorAndLeave);
+            }
+
+    if (aStack[4]->RequestorType() != CRequestor::ERequestorContact
+           || aStack[4]->RequestorFormat() != CRequestor::EFormatMail
+           || aStack[4]->RequestorData() != KContact3)
+            {
+            _LIT(KErrorAndLeave, "Wrong requestor(5) in stack");
+            LogErrorAndLeaveL(KErrorAndLeave);
+            }
+
+    if (aStack[5]->RequestorType() != CRequestor::ERequestorService
+           || aStack[5]->RequestorFormat() != CRequestor::EFormatApplication
+           || aStack[5]->RequestorData() != KService3)
+            {
+            _LIT(KErrorAndLeave, "Wrong requestor(6) in stack");
+            LogErrorAndLeaveL(KErrorAndLeave);
+            }    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp269.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,229 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp269.h"
+#include <LbsSatellite.h>
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+#include <e32std.h>
+
+// CONSTANTS                                
+
+const TInt KEspectedErrorCodePSY1Request6 = KErrDied;
+const TInt KEspectedErrorCodePSY1Request8 = KErrBadPower;
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp269::CT_LbsClientPosTp269(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{  
+	_LIT(KTestName, "Tp269 - Fallback in Default Proxy (CR0526)");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp269::~CT_LbsClientPosTp269()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp269::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp269::StartL()
+    {    
+    ConnectL();
+
+    SetupProxyPSYsL();
+
+    TInt err = OpenPositioner();
+    _LIT(KOpenErr, "Error when opening positioner, %d");
+    AssertTrueSecL(err == KErrNone, KOpenErr, err);
+    
+    _LIT(KServiceName, "TP269");
+    iPositioner.SetRequestor(CRequestor::ERequestorService, CRequestor::EFormatApplication, KServiceName);
+
+    TUint request = 0;
+    
+    TPositionInfo posInfo;
+    /////////////////////////////////////////////
+	// Request 1
+	/////////////////////////////////////////////    
+    RequestL(posInfo, ++request, KEspectedErrorCodePSY2);
+   
+    // Used test PSYs reports ready when loaded, inactive when unloaded
+    VerifyPsyLoadedL(iUidTestProxyPsy1);
+    VerifyPsyLoadedL(iUidTestProxyPsy2);
+
+    /////////////////////////////////////////////
+	// Request 2
+	/////////////////////////////////////////////
+    RequestL(posInfo, ++request, KEspectedErrorCodePSY1);
+    VerifyPsyLoadedL(iUidTestProxyPsy1);
+
+    /////////////////////////////////////////////
+	// Request 3
+	/////////////////////////////////////////////
+    RequestL(posInfo, ++request, KEspectedErrorCodePSY3);
+    VerifyPsyLoadedL(iUidTestProxyPsy1);
+    VerifyPsyLoadedL(iUidTestProxyPsy2);
+    VerifyPsyLoadedL(iUidTestProxyPsy3);
+    
+    /////////////////////////////////////////////
+	// Request 4
+	/////////////////////////////////////////////
+    RequestL(posInfo, ++request, KEspectedErrorCodePSY3);
+    VerifyPsyLoadedL(iUidTestProxyPsy1);
+    VerifyPsyLoadedL(iUidTestProxyPsy2);
+    VerifyPsyLoadedL(iUidTestProxyPsy3);
+
+    /////////////////////////////////////////////
+	// Request 5
+	/////////////////////////////////////////////
+    RequestL(posInfo, ++request, KEspectedErrorCodePSY2);
+    VerifyPsyLoadedL(iUidTestProxyPsy1);
+    VerifyPsyLoadedL(iUidTestProxyPsy2);
+    
+    /////////////////////////////////////////////
+	// Request 6
+	/////////////////////////////////////////////
+    RequestL(posInfo, ++request, KEspectedErrorCodePSY1Request6);
+    VerifyPsyLoadedL(iUidTestProxyPsy1);
+    VerifyPsyLoadedL(iUidTestProxyPsy2);
+    VerifyPsyLoadedL(iUidTestProxyPsy3);
+
+    // Switch priority
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+    
+    db->SetModulePriorityL(iUidTestProxyPsy3, 1);
+    db->SetModulePriorityL(iUidTestProxyPsy2, 2);
+
+    /////////////////////////////////////////////
+	// Request 7
+	/////////////////////////////////////////////
+    RequestL(posInfo, ++request, KEspectedErrorCodePSY3);
+    VerifyPsyLoadedL(iUidTestProxyPsy1);
+    VerifyPsyLoadedL(iUidTestProxyPsy3);
+
+    /////////////////////////////////////////////
+	// Request 8
+	/////////////////////////////////////////////
+    RequestL(posInfo, ++request, KEspectedErrorCodePSY1Request8);
+    VerifyPsyLoadedL(iUidTestProxyPsy1);
+    VerifyPsyLoadedL(iUidTestProxyPsy2);
+    VerifyPsyLoadedL(iUidTestProxyPsy3);
+
+    // Switch back priority
+    db->SetModulePriorityL(iUidTestProxyPsy2, 1);
+    db->SetModulePriorityL(iUidTestProxyPsy3, 2);
+
+    CleanupStack::PopAndDestroy(db);
+    
+    /////////////////////////////////////////////
+	// Request 9
+	/////////////////////////////////////////////
+    TPositionSatelliteInfo satInfo;
+    RequestL(satInfo, ++request, KErrArgument);
+
+    /////////////////////////////////////////////
+	// Request 10
+	/////////////////////////////////////////////
+    TPositionCourseInfo courseInfo;
+    RequestL(courseInfo, ++request, KEspectedErrorCodePSY3);
+      
+    VerifyPsyLoadedL(iUidTestProxyPsy3);
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp269::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp269::CloseTest()
+    {
+    iPositioner.Close();
+    iPosServer.Close();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp269::AssertTrueSecL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp269::AssertTrueSecL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode)
+    {
+  	if (!aCondition)
+		{
+		TBuf<100> buf;
+		buf.Format(aErrorMsg, aErrorCode);
+		LogErrorAndLeaveL(buf);
+		}
+    }
+   
+// ---------------------------------------------------------
+// CT_LbsClientPosTp269::SetupProxyPSYsL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp269::SetupProxyPSYsL()
+    {
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+
+    moduleUpdate->SetUpdateAvailability(EFalse);
+    
+    CPosModuleIdList* prioList = db->ModuleIdListLC();
+	
+    // Disable all PSY:s except PSYs used by this TP269, TP270
+    for (TInt i = 0 ; i < prioList->Count(); i++)
+        {
+        if ((*prioList)[i] != iUidTestProxyPsy1 &&
+            (*prioList)[i] != iUidTestProxyPsy2 &&
+            (*prioList)[i] != iUidTestProxyPsy3)
+            {
+            db->UpdateModuleL((*prioList)[i], *moduleUpdate);
+            }
+        }
+    moduleUpdate->SetUpdateAvailability(ETrue);
+    db->UpdateModuleL(iUidTestProxyPsy1, *moduleUpdate);
+    db->UpdateModuleL(iUidTestProxyPsy2, *moduleUpdate);
+    db->UpdateModuleL(iUidTestProxyPsy3, *moduleUpdate);
+
+    db->SetModulePriorityL(iUidTestProxyPsy1, 0);
+    db->SetModulePriorityL(iUidTestProxyPsy2, 1);
+    db->SetModulePriorityL(iUidTestProxyPsy3, 2);
+
+    CleanupStack::PopAndDestroy(prioList);
+    CleanupStack::PopAndDestroy(moduleUpdate);
+    CleanupStack::PopAndDestroy(db);
+    } 
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp27.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,336 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp27.h"
+#include "ctlbsposclientholder.h"
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+#include <e32keys.h>
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp27::CT_LbsClientPosTp27(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{  
+	_LIT(KTestName,"TP27 - Cancel Request");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp27::~CT_LbsClientPosTp27()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp27::CloseTest
+// Always called after the test, even if the test leaves
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp27::CloseTest()
+    {
+    ClosePositioner();
+	Disconnect();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp27::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp27::StartL()
+    {
+    SetupPsyL(iUidDynDbTestPsy);
+    TTimeIntervalMicroSeconds timeLimit(5000000);
+    ConnectL();
+    User::LeaveIfError(OpenPositioner());
+
+    TPositionInfo posInfo = TPositionInfo();
+    _LIT(KService, "service");
+    TInt err = PerformSyncRequest(KService, &posInfo);
+
+    if (err != KErrNone)
+        {
+        _LIT(KErrorRequest, "The request was not completed with KErrorNone");
+        LogErrorAndLeaveL(KErrorRequest);
+        }
+	ClosePositioner();
+	Disconnect();
+	//Cancel quick (most likely before the PSY gets involved
+	MakeCancelRequestL(TTimeIntervalMicroSeconds32(100), timeLimit );
+	//Cancel after 1 second so that the PSY gets involved.
+	MakeCancelRequestL(TTimeIntervalMicroSeconds32(1000000), timeLimit);
+
+	CheckCancelRequestL();
+
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp27::MakeCancelRequestL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp27::MakeCancelRequestL(TTimeIntervalMicroSeconds32 aCancelTime, TTimeIntervalMicroSeconds aTimeLimit)
+	{	
+	const TInt KNrOfClients = 1;
+    CT_LbsPosClientHolder* clients = CT_LbsPosClientHolder::NewLC(KNrOfClients);
+
+    clients->SetRequesterWillCancelL();
+	clients ->SetCancelTime(aCancelTime);
+    clients->MakeRequests();
+
+    TInt status;
+
+    TPositionInfo myModuleInfo;
+    TTimeIntervalMicroSeconds reqTime;
+    clients->GetResult(status, myModuleInfo, reqTime);
+
+    if (status != KErrCancel)
+        {
+        _LIT(KReqWasNotCancelled, "The request was not cancelled, return code %d");
+        TBuf<100> buf;
+        buf.Format(KReqWasNotCancelled, status);
+        LogErrorAndLeaveL(buf);
+        }
+   
+    if (reqTime > aTimeLimit)
+        {
+        _LIT(KError, "The request took too long, %d microsecs. It was probably never cancelled");
+        TBuf<100> buf;
+        buf.Format(KError, reqTime.Int64());
+        LogErrorAndLeaveL(buf);
+        }
+
+    _LIT(KMsg, "The request was cancelled after %d microsecs.");
+    TBuf<100> buf;
+    buf.Format(KMsg, reqTime.Int64());
+    INFO_PRINTF1(buf);
+    CleanupStack::PopAndDestroy(clients); //clients
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp27::MakeCancelRequest2L
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp27::MakeCancelRequest2L(TTimeIntervalMicroSeconds32 aCancelTime, TTimeIntervalMicroSeconds aTimeLimit)
+	{	
+	_LIT(KCancelRequest,"MakeCancelRequest2L");
+	INFO_PRINTF1(KCancelRequest);
+
+	RFs fs;
+	TInt err = fs.Connect();
+    CleanupClosePushL(fs);
+
+    DisableAllPsyL();
+	ConnectL();
+	// TestPsy9 waits for 6 sec before returning a position
+    EnablePsyL(iUidTestPsy9);
+    err = OpenPositionerByName(iUidTestPsy9);
+	if (err != KErrNone)
+		{
+		TBuf<150> buf;
+		_LIT(KErr, "OpenPositionerByName failed with %d");
+		buf.Format(KErr, err);
+		LogErrorAndLeaveL(buf);
+		}
+	
+	_LIT(KPerformRequest,"The request info");
+	PerformRequestL(KPerformRequest, CRequestor::ERequestorService, CRequestor::EFormatApplication);
+
+	const TInt KNrOfClients = 2;
+	// TestPsy6 waits for 5 sec before returning a position
+    EnablePsyL(iUidTestPsy6);
+    CT_LbsPosClientHolder* clients = CT_LbsPosClientHolder::NewLC(KNrOfClients, iUidTestPsy6, ETrue);
+
+	clients->SetRequesterWillCancelL();
+	clients->SetCancelTime(aCancelTime);
+
+    clients->MakeRequests();
+	CheckRequestResultL(KErrNone);
+
+    TInt status;
+    TPositionInfo myModuleInfo;
+    TTimeIntervalMicroSeconds reqTime;
+    clients->GetResult(status, myModuleInfo, reqTime);
+
+    if (status != KErrCancel)
+        {
+        _LIT(KReqWasNotCancelled, "The request was not cancelled, return code %d");
+        TBuf<100> buf;
+        buf.Format(KReqWasNotCancelled, status);
+        LogErrorAndLeaveL(buf);
+        }
+
+    if (reqTime > aTimeLimit)
+        {
+        _LIT(KError, "The request took too long, %d microsecs. It was probably never cancelled");
+        TBuf<100> buf;
+        buf.Format(KError, reqTime.Int64());
+        LogErrorAndLeaveL(buf);
+        }
+
+    _LIT(KMsg, "The request was cancelled after %d microsecs.");
+    TBuf<100> buf;
+    buf.Format(KMsg, reqTime.Int64());
+    INFO_PRINTF1(buf);
+    
+	ClosePositioner();
+	Disconnect();
+
+	//Check request log
+	RArray<TInt> arrayId;
+	CleanupClosePushL(arrayId);
+	err = KErrNone;
+
+	if (err != KErrNone)
+		{
+		TBuf<150> buf;
+		_LIT(KErr, "GetLogEntryListL() returned error, %d");
+		buf.Format(KErr, err);
+		LogErrorAndLeaveL(buf);
+		}
+
+	// All requests should have been logged, including the cancelled requests
+	TInt numberOfElements = arrayId. Count();
+
+	if (numberOfElements != 3)
+	{
+	buf.Zero();
+	_LIT(KErrLog,"ERROR: The log contains wrong number of entries, was %d");
+	buf.Format(KErrLog, numberOfElements);
+	INFO_PRINTF1(buf);
+	_LIT(KErrAndLeave, "Cancelled request has not been logged!!!");
+	LogErrorAndLeaveL(KErrAndLeave);
+	}
+
+	CleanupStack::PopAndDestroy(&arrayId);
+	CleanupStack::PopAndDestroy(clients); //clients
+	CleanupStack::PopAndDestroy(1); // privCtrl
+	CleanupStack::PopAndDestroy(1); //fs
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp27::CheckCancelRequestL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp27::CheckCancelRequestL()
+	{
+	_LIT(KFunctionName, "We are inside CheckCancelRequestL");
+	INFO_PRINTF1(KFunctionName);
+
+	RFs fs;
+    User::LeaveIfError(fs.Connect());
+    CleanupClosePushL(fs);
+
+	// TestPsy9 waits for 6 sec before returning a position
+	SetupPsyL(iUidTestPsy9);
+	TTimeIntervalMicroSeconds32 cancelTime(2000000); // 2 sec
+	const TInt KNrOfClients = 1;
+    CT_LbsPosClientHolder* clients = CT_LbsPosClientHolder::NewLC(KNrOfClients, iUidTestPsy9);
+
+    clients->SetRequesterWillCancelL();
+	clients->SetCancelTime(cancelTime);
+    clients->MakeRequests();
+
+    TInt status;
+
+    TPositionInfo myModuleInfo;
+    TTimeIntervalMicroSeconds reqTime;
+    clients->GetResult(status, myModuleInfo, reqTime);
+
+    if (status != KErrCancel)
+        {
+        _LIT(KReqWasNotCancelled, "The request was not cancelled, return code %d");
+        TBuf<100> buf;
+        buf.Format(KReqWasNotCancelled, status);
+        LogErrorAndLeaveL(buf);
+        }
+
+    _LIT(KMsg, "The request was cancelled after %d microsecs.");
+    TBuf<100> buf;
+    buf.Format(KMsg, reqTime.Int64());
+    INFO_PRINTF1(buf);
+
+	//Check request log
+	RArray<TInt> arrayId;
+	CleanupClosePushL(arrayId);
+	
+	CleanupStack::PopAndDestroy(&arrayId);
+	CleanupStack::PopAndDestroy(clients); //clients
+	CleanupStack::PopAndDestroy(1); // privCtrl
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp27::DisableAllPsyL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp27::DisableAllPsyL()
+    {
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+
+    // Disable PSY
+    moduleUpdate->SetUpdateAvailability(EFalse);
+    CPosModuleIdList* prioList = db->ModuleIdListLC();
+
+    // Disable all PSY:s
+    for (TInt i = 0 ; i < prioList->Count(); i++)
+        {
+        db->UpdateModuleL((*prioList)[i], *moduleUpdate);
+        }
+
+    CleanupStack::PopAndDestroy(prioList);
+    CleanupStack::PopAndDestroy(moduleUpdate);
+    CleanupStack::PopAndDestroy(db);
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp27::DisableAllPsyL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp27::EnablePsyL(const TUid aPsyUid)
+    {
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+
+    // Enable the PSY that came as an in parameter
+    moduleUpdate->SetUpdateAvailability(ETrue);
+    db->UpdateModuleL(aPsyUid, *moduleUpdate);
+
+    CleanupStack::PopAndDestroy(moduleUpdate);
+    CleanupStack::PopAndDestroy(db);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp271.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,282 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp271.h"
+
+#include <LbsSatellite.h>
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+#include <e32std.h>
+
+// CONSTANTS                                
+
+const TInt KUpdateInterval  = 1000;
+const TInt KUpdateInterval2 = 2000;
+
+// ================= MEMBER FUNCTIONS =======================
+
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp271::CT_LbsClientPosTp271(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{ 
+	_LIT(KTestName,"Tp271-Fallback in Default Proxy,Perodic Update");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp271::~CT_LbsClientPosTp271()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp271::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp271::StartL()
+    {   
+    ConnectL();
+
+    SetupProxyPSYsL();
+    
+    iModuleEvent.SetRequestedEvents(TPositionModuleStatusEvent::EEventAll);
+
+    TInt err = OpenPositioner();
+    _LIT(KOpenErr, "Error when opening positioner, %d");
+    AssertTrueSecL(err == KErrNone, KOpenErr, err);
+    
+    _LIT(KServiceName, "TP271");
+    iPositioner.SetRequestor(CRequestor::ERequestorService, CRequestor::EFormatApplication, KServiceName);
+
+    TUint request = 20;    
+    TPositionInfo posInfo;
+    /////////////////////////////////////////////
+	// Request 1
+	/////////////////////////////////////////////    
+    RequestL(posInfo, ++request, KEspectedErrorCodePSY2);
+   
+    // Used test PSYs reports ready when loaded, inactive when unloaded
+    VerifyPsyLoadedL(iUidTestProxyPsy1);
+    VerifyPsyLoadedL(iUidTestProxyPsy2);
+
+    // Set periodic update
+    TPositionUpdateOptions updateOptions;
+	updateOptions.SetUpdateInterval(TTimeIntervalMicroSeconds(KUpdateInterval));
+
+	err = iPositioner.SetUpdateOptions(updateOptions);
+    _LIT(KUpdateErr, "Error when setting update interval,  %d");
+	AssertTrueL(err == KErrNone, KUpdateErr, err);    
+    
+    /////////////////////////////////////////////
+	// Request 2
+	/////////////////////////////////////////////
+    RequestL(posInfo, ++request, KEspectedErrorCodePSY3);
+   
+    
+    /////////////////////////////////////////////
+	// Request 3
+	/////////////////////////////////////////////
+    RequestL(posInfo, ++request, KEspectedErrorCodePSY2);
+
+    VerifyPsyStartedTrackingL(iUidTestProxyPsy1); // Verify that still loaded, latest reported event
+    VerifyPsyStartedTrackingL(iUidTestProxyPsy2); // should still be the same
+    VerifyPsyStartedTrackingL(iUidTestProxyPsy3); 
+
+    /////////////////////////////////////////////
+	// Request 4
+	/////////////////////////////////////////////    
+    updateOptions.SetUpdateInterval(TTimeIntervalMicroSeconds(KUpdateInterval2));
+    err = iPositioner.SetUpdateOptions(updateOptions);
+	AssertTrueL(err == KErrNone, KUpdateErr, err);    
+
+    RequestL(posInfo, ++request, KEspectedErrorCodePSY2);
+    
+    VerifyPsyStartedTrackingL(iUidTestProxyPsy1);
+    VerifyPsyStartedTrackingL(iUidTestProxyPsy2);
+   
+    /////////////////////////////////////////////
+	// Request 5
+	/////////////////////////////////////////////
+    updateOptions.SetUpdateInterval(TTimeIntervalMicroSeconds(0));
+    err = iPositioner.SetUpdateOptions(updateOptions);
+	AssertTrueL(err == KErrNone, KUpdateErr, err);    
+    
+    VerifyPsyStoppedTrackingL(iUidTestProxyPsy1);
+    VerifyPsyStoppedTrackingL(iUidTestProxyPsy2);
+
+    RequestL(posInfo, ++request, KEspectedErrorCodePSY3);
+ 
+    VerifyPsyStoppedTrackingL(iUidTestProxyPsy1); // Verifies that still loaded,
+    VerifyPsyStoppedTrackingL(iUidTestProxyPsy2); // Verifies that still loaded,
+
+    /////////////////////////////////////////////
+	// Request 6
+	/////////////////////////////////////////////
+    updateOptions.SetUpdateInterval(TTimeIntervalMicroSeconds(KUpdateInterval));
+	err = iPositioner.SetUpdateOptions(updateOptions);
+	AssertTrueL(err == KErrNone, KUpdateErr, err);    
+    
+    RequestL(posInfo, ++request, KEspectedErrorCodePSY1);
+            
+    iPositioner.Close();
+    
+    VerifyPsyUnloadedL(iUidTestProxyPsy1);
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp271::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp271::CloseTest()
+    {
+    iPositioner.Close();
+    iPosServer.Close();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp271::AssertTrueSecL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp271::AssertTrueSecL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode)
+    {
+  	if (!aCondition)
+		{
+		TBuf<100> buf;
+		buf.Format(aErrorMsg, aErrorCode);
+		LogErrorAndLeaveL(buf);
+		}
+    }
+   
+// ---------------------------------------------------------
+// CT_LbsClientPosTp271::SetupProxyPSYsL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp271::SetupProxyPSYsL()
+    {
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+
+    moduleUpdate->SetUpdateAvailability(EFalse);
+    
+    CPosModuleIdList* prioList = db->ModuleIdListLC();
+
+    // Disable all PSY:s except PSYs used by this TP271, TP270
+    for (TInt i = 0 ; i < prioList->Count(); i++)
+        {
+        if ((*prioList)[i] != iUidTestProxyPsy1 &&
+            (*prioList)[i] != iUidTestProxyPsy2 &&
+            (*prioList)[i] != iUidTestProxyPsy3)
+            {
+            db->UpdateModuleL((*prioList)[i], *moduleUpdate);
+            }
+        }
+    moduleUpdate->SetUpdateAvailability(ETrue);
+    db->UpdateModuleL(iUidTestProxyPsy1, *moduleUpdate);
+    db->UpdateModuleL(iUidTestProxyPsy2, *moduleUpdate);
+    db->UpdateModuleL(iUidTestProxyPsy3, *moduleUpdate);
+
+    db->SetModulePriorityL(iUidTestProxyPsy1, 0);
+    db->SetModulePriorityL(iUidTestProxyPsy2, 1);
+    db->SetModulePriorityL(iUidTestProxyPsy3, 2);
+
+    CleanupStack::PopAndDestroy(prioList);
+    CleanupStack::PopAndDestroy(moduleUpdate);
+    CleanupStack::PopAndDestroy(db);
+    } 
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp271::VerifyPsyStartedUnloadedL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp271::VerifyPsyStartedTrackingL(TPositionModuleId& aUid)                           
+    {
+    _LIT(KPSYStatus,"Verifies if correct PSY is loaded by getting its status");
+    INFO_PRINTF1(KPSYStatus);
+
+    _LIT(KDeviceStatusErr, "The PSY has not reported expected Device Status and is not notified about start tracking"); 
+    
+    TPositionModuleStatus moduleStatus;
+    iPosServer.GetModuleStatus(moduleStatus, aUid); 
+
+    AssertTrueL(TPositionModuleStatus::EDeviceInitialising == moduleStatus.DeviceStatus(), KDeviceStatusErr, KErrGeneral);
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp271::VerifyPsyStoppedTrackingL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp271::VerifyPsyStoppedTrackingL(TPositionModuleId& /*aUid*/, TRequestStatus& aStatus)
+    {
+    _LIT(KPSYStatus,"Verifies that correct PSY has stopped tracking and is unloaded");
+    INFO_PRINTF1(KPSYStatus);
+    
+    _LIT(KStoppedTrackingErr, "The PSY has not reported expected device status and has not stopped tracking"); 
+    
+    TPositionModuleStatus moduleStatus;
+   
+    User::WaitForRequest(aStatus); 
+             
+    iModuleEvent.GetModuleStatus(moduleStatus);
+   
+    AssertTrueL(TPositionModuleStatus::EDeviceStandBy == moduleStatus.DeviceStatus(), 
+                KStoppedTrackingErr, 
+                KErrGeneral);
+
+   
+    }
+// ---------------------------------------------------------
+// CT_LbsClientPosTp271::VerifyPsyStoppedTrackingL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp271::VerifyPsyStoppedTrackingL(TPositionModuleId& aUid)
+    {
+    _LIT(KPSYStatus,"Verifies that correct PSY has stopped tracking and is unloaded");
+    INFO_PRINTF1(KPSYStatus);
+    
+    _LIT(KStoppedTrackingErr, "The PSY has not reported expected device status and has not stopped tracking"); 
+    
+    TPositionModuleStatus moduleStatus;
+   
+    iPosServer.GetModuleStatus(moduleStatus, aUid); 
+   
+    AssertTrueL(TPositionModuleStatus::EDeviceStandBy == moduleStatus.DeviceStatus(), 
+                KStoppedTrackingErr, 
+                KErrGeneral);
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp272.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,196 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp272.h"
+
+#include <e32std.h>
+
+// CONSTANTS                                
+const TInt KUpdateInterval  = 10000000;
+const TInt KUpdateInterval2 = 15000000;
+const TInt KUpdateInterval3 = 2000000;
+
+const TInt KMinTimeLimitRequest1 = 0;
+const TInt KMaxTimeLimitRequest1 = 2000000;
+
+const TInt KMinTimeLimitRequest2 = 9000000;
+const TInt KMaxTimeLimitRequest2 = 12000000;
+
+const TInt KMinTimeLimitRequest3 = 14000000;
+const TInt KMaxTimeLimitRequest3 = 17000000;
+
+const TInt KMinTimeLimitRequest4 = 0;
+const TInt KMaxTimeLimitRequest4 = 3000000;//200000;
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp272::CT_LbsClientPosTp272(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{  
+	_LIT(KTestName,"Tp272-Perodic Update, Changing the interval");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp272::~CT_LbsClientPosTp272()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp272::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp272::StartL()
+    {
+    _LIT(KOpenErr, "Error when opening MultiPSY, %d");
+    _LIT(KServiceName, "TP272");
+    
+    SetupPsyL(iUidMultiPsy);
+    
+    ConnectL();
+    
+    TInt err = OpenPositionerByName(iUidMultiPsy);
+    AssertTrueSecL(err == KErrNone, KOpenErr, err);
+    
+    iPositioner.SetRequestor(CRequestor::ERequestorService, CRequestor::EFormatApplication, KServiceName);
+
+    SetPeriodicUpdateL(KUpdateInterval);
+    
+    TInt request=0;
+    // NotifyPositionUpdate should be called direct by the server on the first request 
+    // even if update interval is used
+    RequestL(++request, KMinTimeLimitRequest1, KMaxTimeLimitRequest1);    
+   
+    // Even if same update interval is set again should the first request complete direct
+    SetPeriodicUpdateL(KUpdateInterval);
+    RequestL(++request, KMinTimeLimitRequest2, KMaxTimeLimitRequest2);
+
+    // NotifyPositionUpdate should be called after the update interval on the second request 
+    // but when the update interval is changed should it be called direct
+    RequestL(++request, KMinTimeLimitRequest2, KMaxTimeLimitRequest2, KUpdateInterval2);
+    
+    // Now should the request time be about 10 sec
+    RequestL(++request, KMinTimeLimitRequest3, KMaxTimeLimitRequest3); 
+
+    SetPeriodicUpdateL(KUpdateInterval3);
+
+    // Should return direct since update interval changed again
+    RequestL(++request, KMinTimeLimitRequest4, KMaxTimeLimitRequest4);
+    
+
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp272::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp272::CloseTest()
+    {
+    iPositioner.Close();
+    iPosServer.Close();
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp272::AssertTrueSecL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp272::AssertTrueSecL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode)
+    {
+  	if (!aCondition)
+		{
+		TBuf<100> buf;
+		buf.Format(aErrorMsg, aErrorCode);
+		LogErrorAndLeaveL(buf);
+		}
+    }
+  
+// ---------------------------------------------------------
+// CT_LbsClientPosTp272::RequestL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp272::RequestL(const TInt& aRequestIndex, 
+                         const TInt64& aMinTimeLimit,
+                         const TInt64& aMaxTimeLimit,
+                         const TInt& aPeriodicUpdateInterval)
+	{
+    _LIT(KUnexpectedErrCode, "Unexpected error code %d returned by the used PSY");
+    _LIT(KRequestMaxTimeErr, "Request took to long");
+    _LIT(KRequestMinTimeErr, "Request was to fast");
+    _LIT(KRequestTime, "Request took %d microsecs");
+
+    TBuf<100> info;
+    _LIT(KInfo, "Making request %d");
+    info.Format(KInfo, aRequestIndex);
+    INFO_PRINTF1(info);
+    
+    TTime start, stop;
+    start.UniversalTime();
+
+    TPositionInfo posInfo;
+    TRequestStatus  status;
+    iPositioner.NotifyPositionUpdate(posInfo, status);
+
+    if (aPeriodicUpdateInterval != 0)
+        {
+        User::After(5000000);
+        SetPeriodicUpdateL(KUpdateInterval2);
+        }
+
+    User::WaitForRequest(status);
+    stop.UniversalTime();  
+    
+    TInt64 usec = (stop.Int64() - start.Int64());
+	info.Format(KRequestTime, usec);
+    INFO_PRINTF1(info);
+
+    AssertTrueL(status.Int() == KErrNone, KUnexpectedErrCode, status.Int());
+    
+    AssertTrueSecL(usec <= aMaxTimeLimit, KRequestMaxTimeErr); 
+    AssertTrueSecL(usec >= aMinTimeLimit, KRequestMinTimeErr); 
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp272::SetPeriodicUpdateL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp272::SetPeriodicUpdateL(const TInt& aUpdateInterval)
+    {
+    _LIT(KUpdateErr, "Error when setting update interval, %d");
+
+    TPositionUpdateOptions updateOptions;
+	updateOptions.SetUpdateInterval(TTimeIntervalMicroSeconds(aUpdateInterval));
+    TInt err = iPositioner.SetUpdateOptions(updateOptions);
+	AssertTrueL(err == KErrNone, KUpdateErr, err);   
+
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp274.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,88 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp274.h"
+
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+
+// ================= MEMBER FUNCTIONS =======================
+
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp274::CT_LbsClientPosTp274(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{  
+	_LIT(KTestName, "Tp274-Disable PSY, Epos server crash (ESLI-649HQH)");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp274::~CT_LbsClientPosTp274()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp274::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp274::StartL()
+    {
+    ConnectL();
+
+    SetupPsyL(iUidMultiPsy);
+
+    User::LeaveIfError(OpenPositionerByName(iUidMultiPsy));
+
+    RPositioner positioner;
+    User::LeaveIfError(positioner.Open(iPosServer, iUidMultiPsy));
+    CleanupClosePushL(positioner);    
+
+    iPositioner.Close();
+    
+    CPosModules* modulesDb = CPosModules::OpenL();
+    CleanupStack::PushL(modulesDb);
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC(); 
+    moduleUpdate->SetUpdateAvailability(EFalse);
+    modulesDb->UpdateModuleL(iUidMultiPsy, *moduleUpdate);
+    CleanupStack::PopAndDestroy(2, modulesDb);
+
+    CleanupStack::PopAndDestroy(&positioner);
+    
+    iPosServer.Close();
+
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp274::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp274::CloseTest()
+    {
+    iPositioner.Close();
+    iPosServer.Close();
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp275.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,75 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp275.h"
+#include <babackup.h>
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp275::CT_LbsClientPosTp275(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{ 
+	_LIT(KTestName, "TP275 - BackUpTest");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp275::~CT_LbsClientPosTp275()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp275::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp275::CloseTest()
+    {
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp275::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp275::StartL()
+    {
+    ///////////////////////////////
+    CBaBackupSessionWrapper* backupWrapper = CBaBackupSessionWrapper::NewL();
+    CleanupStack::PushL(backupWrapper);
+    TBackupOperationAttributes backStart(MBackupObserver::EReleaseLockReadOnly,
+        MBackupOperationObserver::EStart);
+    backupWrapper->NotifyBackupOperationL(backStart);	
+    RPositionServer server;
+    CleanupClosePushL(server);
+    User::LeaveIfError(server.Connect());
+    User::After(2000000);
+
+    CleanupStack::PopAndDestroy(2, backupWrapper);    
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp4701.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,134 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp4701.h"
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp4701::CT_LbsClientPosTp4701(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+    {  
+    _LIT(KTestName, "TP4701 - Default Proxy fallback-Active\\Ready Status1");
+    SetTestStepName(KTestName); 
+    }
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp4701::~CT_LbsClientPosTp4701()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPosTp4701::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4701::CloseTest()
+    {
+    ClosePositioner();
+    Disconnect();
+    }
+
+// ---------------------------------------------------------
+// CPosTp4701::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4701::StartL()
+    {    
+    ConnectL();
+
+    SetupProxyPSYsL();
+    ResetDefaultPSYLastWorkingExtGPSPSYL();
+    
+    User::After(4000000);
+
+    TInt err = OpenPositioner();
+    _LIT(KOpenErr, "Error when opening positioner, %d");
+    AssertTrueL(err == KErrNone, KOpenErr, err);
+    
+    _LIT(KServiceName, "TP4701");
+    iPositioner.SetRequestor(CRequestor::ERequestorService, 
+    		CRequestor::EFormatApplication, KServiceName);
+    
+    /////////////////////////////////////////////
+	// Request 1
+	/////////////////////////////////////////////
+    TInt request = 4701;
+    
+    TPositionInfo posInfo;
+    RequestL(posInfo, request, KEspectedErrorCodePSY1);    
+
+    VerifyPositionFromL(posInfo, iUidTestProxyPsy2);    
+    VerifyRequestTimeLessThanL(8500000);
+    
+    // Default proxy fallbacks to testproxypsy2 
+    // because of time-shift,fix will 
+    // be given by TestProxyPsy2 first.
+    VerifyPsyLoadedL(iUidTestProxyPsy1);
+    VerifyPsyLoadedL(iUidTestProxyPsy2);
+
+    VerifyPositionL(posInfo, 10, 20, 30);
+    }
+   
+// ---------------------------------------------------------
+// CPosTp4701::SetupProxyPSYsL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4701::SetupProxyPSYsL()
+    {
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+    moduleUpdate->SetUpdateAvailability(EFalse);
+    
+    // Disable all PSY:s except PSYs used by this test case
+    CPosModuleIdList* prioList = db->ModuleIdListLC();    
+    for (TInt i = 0 ; i < prioList->Count(); i++)
+        {
+        if ((*prioList)[i] != iUidTestProxyPsy1 &&
+            (*prioList)[i] != iUidTestProxyPsy2)
+            {
+            db->UpdateModuleL((*prioList)[i], *moduleUpdate);
+            }
+        }
+    moduleUpdate->SetUpdateAvailability(ETrue);
+    db->UpdateModuleL(iUidTestProxyPsy1, *moduleUpdate);
+    db->UpdateModuleL(iUidTestProxyPsy2, *moduleUpdate);
+    
+    db->SetModulePriorityL(iUidTestProxyPsy1, 0);
+    db->SetModulePriorityL(iUidTestProxyPsy2, 1);
+    
+    CleanupStack::PopAndDestroy(prioList);
+    CleanupStack::PopAndDestroy(moduleUpdate);
+    CleanupStack::PopAndDestroy(db);
+    } 
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp4702.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,131 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp4702.h"
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp4702::CT_LbsClientPosTp4702(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+    {  
+    _LIT(KTestName, "TP4702 - Default Proxy fallback-Active\\Ready Status2");
+    SetTestStepName(KTestName); 
+    }
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp4702::~CT_LbsClientPosTp4702()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPosTp4702::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4702::CloseTest()
+    {
+    ClosePositioner();
+    Disconnect();
+    }
+
+// ---------------------------------------------------------
+// CPosTp4702::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4702::StartL()
+    {   
+    ConnectL();
+   
+    SetupProxyPSYsL();
+
+    TInt err = OpenPositioner();
+    _LIT(KOpenErr, "Error when opening positioner, %d");
+    AssertTrueL(err == KErrNone, KOpenErr, err);
+    
+    _LIT(KServiceName, "TP4702");
+    iPositioner.SetRequestor(CRequestor::ERequestorService, CRequestor::EFormatApplication, KServiceName);
+
+    /////////////////////////////////////////////
+	// Request 1
+	/////////////////////////////////////////////
+    TInt request = 4702;
+    TPositionInfo posInfo;
+    RequestL(posInfo, request, KEspectedErrorCodePSY1);    
+
+    VerifyPositionFromL(posInfo, iUidTestProxyPsy1);
+    VerifyRequestTimeLessThanL(7500000);    
+    
+    /*Default proxy fallbacks to testproxypsy2 because of time-shift,fix will 
+      be given by TestProxyPsy1 first.*/
+    VerifyPsyLoadedL(iUidTestProxyPsy1);
+    VerifyPsyLoadedL(iUidTestProxyPsy2);
+
+    VerifyPositionL(posInfo, 5, 15, 25);
+    }
+ 
+// ---------------------------------------------------------
+// CPosTp4702::SetupProxyPSYsL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4702::SetupProxyPSYsL()
+    {
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+
+    moduleUpdate->SetUpdateAvailability(EFalse);
+    
+    CPosModuleIdList* prioList = db->ModuleIdListLC();
+	
+    // Disable all PSY:s except PSYs used by this test case
+    
+    for (TInt i = 0 ; i < prioList->Count(); i++)
+        {
+        if ((*prioList)[i] != iUidTestProxyPsy1 &&
+            (*prioList)[i] != iUidTestProxyPsy2)
+            {
+            db->UpdateModuleL((*prioList)[i], *moduleUpdate);
+            }
+        }
+    moduleUpdate->SetUpdateAvailability(ETrue);
+    db->UpdateModuleL(iUidTestProxyPsy1, *moduleUpdate);
+    db->UpdateModuleL(iUidTestProxyPsy2, *moduleUpdate);
+    
+    db->SetModulePriorityL(iUidTestProxyPsy1, 0);
+    db->SetModulePriorityL(iUidTestProxyPsy2, 1);
+    
+    CleanupStack::PopAndDestroy(prioList);
+    CleanupStack::PopAndDestroy(moduleUpdate);
+    CleanupStack::PopAndDestroy(db);
+    } 
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp4703.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,132 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp4703.h"
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp4703::CT_LbsClientPosTp4703(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+    { 
+    _LIT(KTestName, "TP4703 - Default Proxy fallback-other status1");
+    SetTestStepName(KTestName); 
+    }
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp4703::~CT_LbsClientPosTp4703()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPosTp4703::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4703::CloseTest()
+    {
+	ClosePositioner();
+	Disconnect();
+    }
+
+// ---------------------------------------------------------
+// CPosTp4703::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4703::StartL()
+    {    
+    ConnectL();
+
+    SetupProxyPSYsL();
+
+    TInt err = OpenPositioner();
+    _LIT(KOpenErr, "Error when opening positioner, %d");
+    AssertTrueL(err == KErrNone, KOpenErr, err);
+    
+    _LIT(KServiceName, "TP4703");
+    iPositioner.SetRequestor(CRequestor::ERequestorService, CRequestor::EFormatApplication, KServiceName);
+
+    // First request a pre position request
+    TInt request = 100;
+    TPositionInfo posInfo;
+    RequestL(posInfo, request, KEspectedErrorCodePSY1);
+    
+    /////////////////////////////////////////////
+	// Request 1
+	/////////////////////////////////////////////
+    request = 4703;
+    RequestL(posInfo, request, KEspectedErrorCodePSY1);    
+
+    VerifyPositionFromL(posInfo, iUidTestProxyPsy2);
+    VerifyRequestTimeLessThanL(5001000);    
+   
+    VerifyPositionL(posInfo, 10, 20, 30);
+    }
+    
+// ---------------------------------------------------------
+// CPosTp4703::SetupProxyPSYsL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4703::SetupProxyPSYsL()
+    {
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+
+    moduleUpdate->SetUpdateAvailability(EFalse);
+    
+    CPosModuleIdList* prioList = db->ModuleIdListLC();
+	
+    // Disable all PSY:s except PSYs used by this test case
+    
+    for (TInt i = 0 ; i < prioList->Count(); i++)
+        {
+        if ((*prioList)[i] != iUidTestProxyPsy1 &&
+            (*prioList)[i] != iUidTestProxyPsy2)
+            {
+            db->UpdateModuleL((*prioList)[i], *moduleUpdate);
+            }
+        }
+    moduleUpdate->SetUpdateAvailability(ETrue);
+    db->UpdateModuleL(iUidTestProxyPsy1, *moduleUpdate);
+    db->UpdateModuleL(iUidTestProxyPsy2, *moduleUpdate);
+    
+    db->SetModulePriorityL(iUidTestProxyPsy1, 0);
+    db->SetModulePriorityL(iUidTestProxyPsy2, 1);
+    
+    CleanupStack::PopAndDestroy(prioList);
+    CleanupStack::PopAndDestroy(moduleUpdate);
+    CleanupStack::PopAndDestroy(db);
+    } 
+
+//  End of File
+
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp4704.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,114 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp4704.h"
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp4704::CT_LbsClientPosTp4704(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+    {  
+    _LIT(KTestName, "TP4704 - Default Proxy fallback-other status2");
+    SetTestStepName(KTestName); 
+    }
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp4704::~CT_LbsClientPosTp4704()
+    {
+    }
+
+void CT_LbsClientPosTp4704::CloseTest()
+    {
+    ClosePositioner();
+    Disconnect();
+    }
+
+void CT_LbsClientPosTp4704::StartL()
+    {
+    ConnectL();
+
+    SetupProxyPSYsL();
+
+    TInt err = OpenPositioner();
+    _LIT(KOpenErr, "Error when opening positioner, %d");
+    AssertTrueL(err == KErrNone, KOpenErr, err);
+    
+    _LIT(KServiceName, "TP4704");
+    iPositioner.SetRequestor(CRequestor::ERequestorService, CRequestor::EFormatApplication, KServiceName);
+
+    // Requesting a pre position request
+    TInt request = 100;
+    TPositionInfo posInfo;
+    RequestL(posInfo, request, KEspectedErrorCodePSY1);
+      
+    /////////////////////////////////////////////
+	// Request 1
+	/////////////////////////////////////////////
+    request = 4704;    
+    RequestL(posInfo, request, KEspectedErrorCodePSY1);
+
+    VerifyPositionFromL(posInfo, iUidTestProxyPsy1);
+    VerifyRequestTimeLessThanL(4001000);    
+    
+    VerifyPositionL(posInfo, 5, 15, 25);
+    }
+   
+void CT_LbsClientPosTp4704::SetupProxyPSYsL()
+    {
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+
+    moduleUpdate->SetUpdateAvailability(EFalse);
+    
+    CPosModuleIdList* prioList = db->ModuleIdListLC();
+	
+    // Disable all PSY:s except PSYs used by this test case
+    
+    for (TInt i = 0 ; i < prioList->Count(); i++)
+        {
+        if ((*prioList)[i] != iUidTestProxyPsy1 &&
+            (*prioList)[i] != iUidTestProxyPsy2)
+            {
+            db->UpdateModuleL((*prioList)[i], *moduleUpdate);
+            }
+        }
+    moduleUpdate->SetUpdateAvailability(ETrue);
+    db->UpdateModuleL(iUidTestProxyPsy1, *moduleUpdate);
+    db->UpdateModuleL(iUidTestProxyPsy2, *moduleUpdate);
+    
+    db->SetModulePriorityL(iUidTestProxyPsy1, 0);
+    db->SetModulePriorityL(iUidTestProxyPsy2, 1);
+    
+    CleanupStack::PopAndDestroy(prioList);
+    CleanupStack::PopAndDestroy(moduleUpdate);
+    CleanupStack::PopAndDestroy(db);
+    } 
+
+//  End of File
+
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp4705.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,139 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp4705.h"
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp4705::CT_LbsClientPosTp4705(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+    {  
+    _LIT(KTestName, "TP4705 - Default Proxy fallback-partial update1");
+    SetTestStepName(KTestName); 
+    }
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp4705::~CT_LbsClientPosTp4705()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPosTp4705::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4705::CloseTest()
+    {
+    ClosePositioner();
+    Disconnect();
+    }
+
+// ---------------------------------------------------------
+// CPosTp4705::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4705::StartL()
+    {
+    ConnectL();
+
+    SetupProxyPSYsL();
+
+    TInt err = OpenPositioner();
+    _LIT(KOpenErr, "Error when opening positioner, %d");
+    AssertTrueL(err == KErrNone, KOpenErr, err);
+    
+    _LIT(KServiceName, "TP4705");
+    iPositioner.SetRequestor(CRequestor::ERequestorService, CRequestor::EFormatApplication, KServiceName);
+
+    /////////////////////////////////////////////
+	// Request 1
+	/////////////////////////////////////////////
+    // Check that partial update is not supported
+    TPositionUpdateOptions updateOptions;
+    updateOptions.SetAcceptPartialUpdates(ETrue);
+    iPositioner.SetUpdateOptions(updateOptions);
+        
+    TInt request = 4705;
+    TPositionInfo posInfo;
+    RequestL(posInfo, request, KEspectedErrorCodePSY2);    
+      
+    VerifyPositionFromL(posInfo, iUidTestPsyPartialUpdate);
+    VerifyRequestTimeLessThanL(8001000);
+          
+    /*Default proxy fallbacks to TestPsyPartialUpdate because of time-shift,partial 
+      update will be given by TestPsyPartialUpdate.Request to TestProxyPsy1
+      gets cancelled after cleanup time.*/
+    VerifyPsyLoadedL(iUidTestProxyPsy1);
+    VerifyPsyLoadedL(iUidTestPsyPartialUpdate);
+    
+    VerifyPositionL(posInfo, 30, 40, 50);
+    }
+
+// ---------------------------------------------------------
+// CPosTp4705::SetupProxyPSYsL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4705::SetupProxyPSYsL()
+    {
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+
+    moduleUpdate->SetUpdateAvailability(EFalse);
+    
+    CPosModuleIdList* prioList = db->ModuleIdListLC();
+	
+    // Disable all PSY:s except PSYs used by this test case
+    
+    for (TInt i = 0 ; i < prioList->Count(); i++)
+        {
+        if ((*prioList)[i] != iUidTestProxyPsy1 &&
+            (*prioList)[i] != iUidTestPsyPartialUpdate)
+            {
+            db->UpdateModuleL((*prioList)[i], *moduleUpdate);
+            }
+        }
+    moduleUpdate->SetUpdateAvailability(ETrue);
+    db->UpdateModuleL(iUidTestProxyPsy1, *moduleUpdate);
+    db->UpdateModuleL(iUidTestPsyPartialUpdate, *moduleUpdate);
+    
+    db->SetModulePriorityL(iUidTestProxyPsy1, 0);
+    db->SetModulePriorityL(iUidTestPsyPartialUpdate, 1);
+    
+    CleanupStack::PopAndDestroy(prioList);
+    CleanupStack::PopAndDestroy(moduleUpdate);
+    CleanupStack::PopAndDestroy(db);
+    } 
+
+//  End of File
+
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp4706.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,135 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp4706.h"
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp4706::CT_LbsClientPosTp4706(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+    {  
+    _LIT(KTestName, "TP4706 - Default Proxy fallback-partial update2");
+    SetTestStepName(KTestName); 
+    }
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp4706::~CT_LbsClientPosTp4706()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPosTp4706::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4706::CloseTest()
+    {
+    ClosePositioner();
+    Disconnect();
+    }
+
+// ---------------------------------------------------------
+// CPosTp4706::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4706::StartL()
+    {
+    ConnectL();
+
+    SetupProxyPSYsL();
+
+    TInt err = OpenPositioner();
+    _LIT(KOpenErr, "Error when opening positioner, %d");
+    AssertTrueL(err == KErrNone, KOpenErr, err);
+    
+    _LIT(KServiceName, "TP4706");
+    iPositioner.SetRequestor(CRequestor::ERequestorService, CRequestor::EFormatApplication, KServiceName);
+
+    // Issue a pre position request
+    TInt request=100;
+    TPositionInfo posInfo;
+    RequestL(posInfo, request, KEspectedErrorCodePSY1);
+    
+    /////////////////////////////////////////////
+	// Request 1
+	/////////////////////////////////////////////
+    // Check that partial update is not supported    
+    TPositionUpdateOptions updateOptions;
+    updateOptions.SetAcceptPartialUpdates(ETrue);
+    iPositioner.SetUpdateOptions(updateOptions);
+         
+    request = 4706;
+    RequestL(posInfo, request, KEspectedErrorCodePSY2);  
+      
+    VerifyPositionFromL(posInfo, iUidPartialUpdate2);
+    VerifyRequestTimeLessThanL(5001000);
+    
+    VerifyPositionL(posInfo, 55, 65, 75);
+    }
+ 
+// ---------------------------------------------------------
+// CPosTp4706::SetupProxyPSYsL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4706::SetupProxyPSYsL()
+    {
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+
+    moduleUpdate->SetUpdateAvailability(EFalse);
+    
+    CPosModuleIdList* prioList = db->ModuleIdListLC();
+	
+    // Disable all PSY:s except PSYs used by this test case
+    
+    for (TInt i = 0 ; i < prioList->Count(); i++)
+        {
+        if ((*prioList)[i] != iUidTestPsyPartialUpdate &&
+            (*prioList)[i] != iUidPartialUpdate2)
+            {
+            db->UpdateModuleL((*prioList)[i], *moduleUpdate);
+            }
+        }
+    moduleUpdate->SetUpdateAvailability(ETrue);
+    db->UpdateModuleL(iUidTestPsyPartialUpdate, *moduleUpdate);
+    db->UpdateModuleL(iUidPartialUpdate2, *moduleUpdate);
+    
+    db->SetModulePriorityL(iUidTestPsyPartialUpdate, 0);
+    db->SetModulePriorityL(iUidPartialUpdate2, 1);
+    
+    CleanupStack::PopAndDestroy(prioList);
+    CleanupStack::PopAndDestroy(moduleUpdate);
+    CleanupStack::PopAndDestroy(db);
+    } 
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp4707.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,137 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp4707.h"
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp4707::CT_LbsClientPosTp4707(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+    {  
+    _LIT(KTestName, "TP4707 - Default Proxy fallback-partial update3");
+    SetTestStepName(KTestName); 
+    }
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp4707::~CT_LbsClientPosTp4707()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPosTp4707::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4707::CloseTest()
+    {
+    ClosePositioner();
+    Disconnect();
+    }
+
+// ---------------------------------------------------------
+// CPosTp4707::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4707::StartL()
+    {
+    ConnectL();
+
+    SetupProxyPSYsL();
+
+    TInt err = OpenPositioner();
+    _LIT(KOpenErr, "Error when opening positioner, %d");
+    AssertTrueL(err == KErrNone, KOpenErr, err);
+    
+    _LIT(KServiceName, "TP4707");
+    iPositioner.SetRequestor(CRequestor::ERequestorService, CRequestor::EFormatApplication, KServiceName);
+
+    // Issue a pre position request
+    TInt request = 100;
+    TPositionInfo posInfo;
+    RequestL(posInfo, request, KEspectedErrorCodePSY1);
+    
+    /////////////////////////////////////////////
+	// Request 1
+	/////////////////////////////////////////////
+    // Check that partial update is not supported
+    TPositionUpdateOptions updateOptions;
+    updateOptions.SetAcceptPartialUpdates(ETrue);    
+    iPositioner.SetUpdateOptions(updateOptions);
+    
+    request = 4707;
+    RequestL(posInfo, request, KEspectedErrorCodePSY2);    
+
+    VerifyPositionFromL(posInfo, iUidTestPsyPartialUpdate);    
+    VerifyRequestTimeLessThanL(5001000);
+    
+    VerifyPositionL(posInfo, 30, 40, 50);
+    }
+    
+// ---------------------------------------------------------
+// CPosTp4707::SetupProxyPSYsL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4707::SetupProxyPSYsL()
+    {
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+
+    moduleUpdate->SetUpdateAvailability(EFalse);
+    
+    CPosModuleIdList* prioList = db->ModuleIdListLC();
+	
+    // Disable all PSY:s except PSYs used by this test case
+    
+    for (TInt i = 0 ; i < prioList->Count(); i++)
+        {
+        if ((*prioList)[i] !=  iUidTestProxyPsy1 &&
+            (*prioList)[i] != iUidTestPsyPartialUpdate)
+            {
+            db->UpdateModuleL((*prioList)[i], *moduleUpdate);
+            }
+        }
+    moduleUpdate->SetUpdateAvailability(ETrue);
+    db->UpdateModuleL(iUidTestProxyPsy1, *moduleUpdate);
+    db->UpdateModuleL(iUidTestPsyPartialUpdate, *moduleUpdate);
+    
+    db->SetModulePriorityL(iUidTestProxyPsy1, 0);
+    db->SetModulePriorityL(iUidTestPsyPartialUpdate, 1);
+    
+    CleanupStack::PopAndDestroy(prioList);
+    CleanupStack::PopAndDestroy(moduleUpdate);
+    CleanupStack::PopAndDestroy(db);
+    } 
+
+//  End of File
+
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp4708.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,144 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp4708.h"
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp4708::CT_LbsClientPosTp4708(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+    {
+    _LIT(KTestName, "TP4708 - Default Proxy-Configure time-shift values");
+    SetTestStepName(KTestName); 
+    }
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp4708::~CT_LbsClientPosTp4708()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPosTp4708::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4708::CloseTest()
+    {
+    ClosePositioner();
+    Disconnect();
+    }
+
+// ---------------------------------------------------------
+// CPosTp4708::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4708::StartL()
+    {
+    ConnectL();
+
+    SetupProxyPSYsL();
+
+    TInt err = OpenPositioner();
+    _LIT(KOpenErr, "Error when opening positioner, %d");
+    AssertTrueL(err == KErrNone, KOpenErr, err);
+    
+    _LIT(KServiceName, "TP4708");
+    iPositioner.SetRequestor(CRequestor::ERequestorService, 
+    		CRequestor::EFormatApplication, KServiceName);
+        
+    /////////////////////////////////////////////
+	// Request 1
+	/////////////////////////////////////////////
+    TInt request = 4708;
+    TPositionInfo posInfo;
+    RequestL(posInfo, request, KEspectedErrorCodePSY1);    
+      
+    VerifyPositionFromL(posInfo, iUidTestProxyPsy2);    
+    VerifyRequestTimeLessThanL(8000000);
+    
+    // Default proxy fallbacks to testproxypsy2 
+    // because of time-shift,fix will 
+    // be given by TestProxyPsy2 first.
+    VerifyPsyLoadedL(iUidTestProxyPsy1);
+    VerifyPsyLoadedL(iUidTestProxyPsy2);
+
+    VerifyPositionL(posInfo, 10, 20, 30);
+    
+    /////////////////////////////////////////////
+	// Request 2
+	/////////////////////////////////////////////
+    request = 100;    
+    RequestL(posInfo, request, KEspectedErrorCodePSY1);
+
+    request = 4708;
+    RequestL(posInfo, request, KEspectedErrorCodePSY1);
+      
+    VerifyPositionFromL(posInfo, iUidTestProxyPsy2);
+    VerifyRequestTimeLessThanL(5001000);
+    
+    VerifyPositionL(posInfo, 10, 20, 30);    
+    }
+
+// ---------------------------------------------------------
+// CPosTp4708::SetupProxyPSYsL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4708::SetupProxyPSYsL()
+    {
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+    moduleUpdate->SetUpdateAvailability(EFalse);
+    	
+    // Disable all PSY:s except PSYs used by this test case
+    CPosModuleIdList* prioList = db->ModuleIdListLC();
+    for (TInt i = 0 ; i < prioList->Count(); i++)
+        {
+        if ((*prioList)[i] !=  iUidTestProxyPsy1 &&
+            (*prioList)[i] != iUidTestProxyPsy2)
+            {
+            db->UpdateModuleL((*prioList)[i], *moduleUpdate);
+            }
+        }
+    moduleUpdate->SetUpdateAvailability(ETrue);
+    db->UpdateModuleL(iUidTestProxyPsy1, *moduleUpdate);
+    db->UpdateModuleL(iUidTestProxyPsy2, *moduleUpdate);
+    
+    db->SetModulePriorityL(iUidTestProxyPsy1, 0);
+    db->SetModulePriorityL(iUidTestProxyPsy2, 1);
+    
+    CleanupStack::PopAndDestroy(prioList);
+    CleanupStack::PopAndDestroy(moduleUpdate);
+    CleanupStack::PopAndDestroy(db);
+    } 
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp4709.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,138 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include <centralrepository.h>
+#include "ctlbsclientpostp4709.h"
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp4709::CT_LbsClientPosTp4709(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+    {
+    _LIT(KTestName, "TP4709 - Default Proxy-Configure Cleanup Timeout");
+    SetTestStepName(KTestName); 
+    }
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp4709::~CT_LbsClientPosTp4709()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPosTp4709::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4709::CloseTest()
+    {
+    ClosePositioner();
+    Disconnect();
+    }
+
+// ---------------------------------------------------------
+// CPosTp4709::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4709::StartL()
+    {    
+    ConnectL();
+
+    SetupProxyPSYsL();
+
+    TInt err = OpenPositioner();
+    _LIT(KOpenErr, "Error when opening positioner, %d");
+    AssertTrueL(err == KErrNone, KOpenErr, err);
+    
+    _LIT(KServiceName, "TP4709");
+    iPositioner.SetRequestor(CRequestor::ERequestorService, 
+    		CRequestor::EFormatApplication, KServiceName);
+
+    ResetDefaultPSYLastWorkingExtGPSPSYL();
+    
+    TInt request = 100;
+    TPositionInfo posInfo;
+    RequestL(posInfo, request, KEspectedErrorCodePSY1);
+    
+    /////////////////////////////////////////////
+	// Request 1
+	/////////////////////////////////////////////
+                                              
+    // Check that partial update is not supported
+    // Check this with TP/TC document, Fredrik
+    //
+    TPositionUpdateOptions updateOptions;
+    updateOptions.SetAcceptPartialUpdates(ETrue);
+    TInt res = iPositioner.SetUpdateOptions(updateOptions);
+    User::LeaveIfError(res);
+    
+    request = 4709;
+    RequestL(posInfo, request, KEspectedErrorCodePSY2);    
+
+    VerifyPositionFromL(posInfo, iUidTestPsyPartialUpdate);
+    VerifyRequestTimeLessThanL(4400000);
+    
+    VerifyPositionL(posInfo, 30, 40, 50);
+    }
+
+// ---------------------------------------------------------
+// CPosTp4709::SetupProxyPSYsL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4709::SetupProxyPSYsL()
+    {
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+    moduleUpdate->SetUpdateAvailability(EFalse);
+    
+    // Disable all PSY:s except PSYs used by this test case
+    CPosModuleIdList* prioList = db->ModuleIdListLC();    
+    for (TInt i = 0 ; i < prioList->Count(); i++)
+        {
+        if ((*prioList)[i] !=  iUidTestProxyPsy1 &&
+            (*prioList)[i] != iUidTestPsyPartialUpdate)
+            {
+            db->UpdateModuleL((*prioList)[i], *moduleUpdate);
+            }
+        }
+    moduleUpdate->SetUpdateAvailability(ETrue);
+    db->UpdateModuleL(iUidTestProxyPsy1, *moduleUpdate);
+    db->UpdateModuleL(iUidTestPsyPartialUpdate, *moduleUpdate);
+    
+    db->SetModulePriorityL(iUidTestProxyPsy1, 0);
+    db->SetModulePriorityL(iUidTestPsyPartialUpdate, 1);
+    
+    CleanupStack::PopAndDestroy(prioList);
+    CleanupStack::PopAndDestroy(moduleUpdate);
+    CleanupStack::PopAndDestroy(db);
+    } 
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp4722.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,166 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp4722.h"
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp4722::CT_LbsClientPosTp4722(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+    {  
+    _LIT(KTestName, "TP4722 - Default Proxy -Prefer working GPS PSY");
+    SetTestStepName(KTestName); 
+    }
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp4722::~CT_LbsClientPosTp4722()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPosTp4722::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4722::CloseTest()
+    {
+    ClosePositioner();
+    Disconnect();
+    }
+
+// ---------------------------------------------------------
+// CPosTp4722::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4722::StartL()
+    {
+    ConnectL();
+
+    SetupProxyPSYsL();
+	ResetDefaultPSYLastWorkingExtGPSPSYL();
+	
+    TInt err = OpenPositioner();
+    _LIT(KOpenErr, "Error when opening positioner, %d");
+    AssertTrueL(err == KErrNone, KOpenErr, err);
+    
+    _LIT(KServiceName, "TP4722");
+    iPositioner.SetRequestor(CRequestor::ERequestorService, 
+    		CRequestor::EFormatApplication, KServiceName);
+
+    TPositionSatelliteInfo posInfo;
+
+    // Pre request
+    TInt request = 100;
+    RequestL(posInfo, request, KErrNone);
+    
+    /////////////////////////////////////////////
+	// Request 1
+	/////////////////////////////////////////////
+    request = 4722;    
+    RequestL(posInfo, request, KErrNone);
+    VerifyPositionFromL(posInfo, iUidSatInfoPsy);    
+    VerifyRequestTimeLessThanL(4001000);
+
+    VerifyPositionL(posInfo, 40, 50, 60);
+
+	// Default PSY should pre-load SetInfo PSY since it is External and supports GPS
+    VerifyPsyLoadedL(iUidSatInfoPsy);
+ 
+    ClosePositioner();
+    Disconnect();
+    
+    const TTimeIntervalMicroSeconds32 KPosWaitServerShutDown( 6000000 );
+    User::After(KPosWaitServerShutDown);
+
+    ConnectL();
+    SetupProxyPSYsL();
+    err = OpenPositioner();
+    AssertTrueL(err == KErrNone, KOpenErr, err);
+
+    iPositioner.SetRequestor(CRequestor::ERequestorService, 
+    		CRequestor::EFormatApplication, KServiceName);
+    
+    /////////////////////////////////////////////
+	// Request 2
+	/////////////////////////////////////////////
+    RequestL(posInfo, request, KErrNone);    
+
+    VerifyPositionFromL(posInfo, iUidSatInfoPsy);    
+    VerifyRequestTimeLessThanL(4001000);
+
+    VerifyPositionL(posInfo, 40, 50, 60);
+
+	// Default PSY won't pre-load Multi PSY since it is Internal
+	VerifyPsyUnloadedL(iUidMultiPsy);
+	// Default PSY should pre-load SetInfo PSY since it is External and supports GPS
+    VerifyPsyLoadedL(iUidSatInfoPsy);
+    }
+
+// ---------------------------------------------------------
+// CPosTp4722::SetupProxyPSYsL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4722::SetupProxyPSYsL()
+    {
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+
+    moduleUpdate->SetUpdateAvailability(EFalse);
+    
+    CPosModuleIdList* prioList = db->ModuleIdListLC();
+	
+    // Disable all PSY:s except PSYs used by this test case
+    
+    for (TInt i = 0 ; i < prioList->Count(); i++)
+        {
+        if ((*prioList)[i] != iUidMultiPsy &&
+            (*prioList)[i] != iUidSatInfoPsy)
+            {
+            db->UpdateModuleL((*prioList)[i], *moduleUpdate);
+            }
+        }
+    moduleUpdate->SetUpdateAvailability(ETrue);
+    db->UpdateModuleL(iUidMultiPsy, *moduleUpdate);
+    db->UpdateModuleL(iUidSatInfoPsy, *moduleUpdate);
+    
+    db->SetModulePriorityL(iUidMultiPsy, 0);
+    db->SetModulePriorityL(iUidSatInfoPsy, 1);
+    
+    CleanupStack::PopAndDestroy(prioList);
+    CleanupStack::PopAndDestroy(moduleUpdate);
+    CleanupStack::PopAndDestroy(db);
+    } 
+
+//  End of File
+
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp4723.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,144 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp4723.h"
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp4723::CT_LbsClientPosTp4723(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+    {
+    _LIT(KTestName, "TP4723 - Default Proxy -Configure working GPS PSY");
+    SetTestStepName(KTestName); 
+    }
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp4723::~CT_LbsClientPosTp4723()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPosTp4723::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4723::CloseTest()
+    {
+    ClosePositioner();
+    Disconnect();
+    }
+
+// ---------------------------------------------------------
+// CPosTp4723::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4723::StartL()
+    {
+    ConnectL();
+    SetupProxyPSYsL();
+	
+	TPositionModuleId modId = iUidSatInfoPsy;
+    CRepository* repos = CRepository::NewL( KCRUidDefaultProxyConfiguration );    
+    TBuf<40> idBuf;
+    idBuf.AppendNumFixedWidth( modId.iUid, EHex, 8);
+    TInt error = repos->Set(KDefaultProxyLastWorkingGpsPsy, idBuf);
+    delete repos;
+    User::LeaveIfError(error);
+	
+    TInt err = OpenPositioner();
+    _LIT(KOpenErr, "Error when opening positioner, %d");
+    AssertTrueL(err == KErrNone, KOpenErr, err);
+    
+    _LIT(KServiceName, "TP4723");
+    iPositioner.SetRequestor(CRequestor::ERequestorService, 
+		CRequestor::EFormatApplication, KServiceName);
+
+    TPositionSatelliteInfo posInfo;
+    // Request value should be 4722, even for TP4723...
+    TInt request = 4722;
+    
+    // Default PSY won't pre-load Multi PSY since it is Internal
+    VerifyPsyUnloadedL(iUidMultiPsy);
+    // Default PSY should pre-load SetInfo PSY since it is External and supports GPS
+    VerifyPsyLoadedL(iUidSatInfoPsy);
+    
+	/////////////////////////////////////////////
+	// Request 1
+	/////////////////////////////////////////////
+    RequestL(posInfo, request, KEspectedErrorCodePSY1);    
+      
+    VerifyPositionFromL(posInfo, iUidSatInfoPsy);    
+    VerifyRequestTimeLessThanL(1200000);
+    
+    VerifyPsyLoadedL(iUidSatInfoPsy);
+    
+    VerifyPositionL(posInfo, 40, 50, 60);
+    }
+
+// ---------------------------------------------------------
+// CPosTp4723::SetupProxyPSYsL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp4723::SetupProxyPSYsL()
+    {
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+
+    moduleUpdate->SetUpdateAvailability(EFalse);
+    
+    CPosModuleIdList* prioList = db->ModuleIdListLC();
+	
+    // Disable all PSY:s except PSYs used by this test case
+    
+    for (TInt i = 0 ; i < prioList->Count(); i++)
+        {
+        if ((*prioList)[i] != iUidMultiPsy &&
+            (*prioList)[i] != iUidSatInfoPsy)
+            {
+            db->UpdateModuleL((*prioList)[i], *moduleUpdate);
+            }
+        }
+    moduleUpdate->SetUpdateAvailability(ETrue);
+    db->UpdateModuleL(iUidMultiPsy, *moduleUpdate);
+    db->UpdateModuleL(iUidSatInfoPsy, *moduleUpdate);
+    
+    db->SetModulePriorityL(iUidMultiPsy, 0);
+    db->SetModulePriorityL(iUidSatInfoPsy, 1);
+    
+    CleanupStack::PopAndDestroy(prioList);
+    CleanupStack::PopAndDestroy(moduleUpdate);
+    CleanupStack::PopAndDestroy(db);
+    } 
+
+//  End of File
+
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp76.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,261 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp76.h"
+#include <badesca.h>
+#include <EPos_CPosModules.h>
+#include <EPos_CPosModuleUpdate.h>
+#include <EPos_CPosModuleIdList.h>
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp76::CT_LbsClientPosTp76(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{  
+	_LIT(KTestName,"TP76 - Get module data");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp76::~CT_LbsClientPosTp76()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp76::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp76::StartL()
+    {
+	// Open connection to Epos    
+	RPositionServer posServer;
+	CleanupClosePushL(posServer);
+	TInt err = posServer.Connect();    
+	_LIT(KConnectError, "TP76. Unable to open connection to Epos, return code %d");
+	AssertTrueSecL(err == KErrNone, KConnectError, err);
+
+	// Set priority for those psys that will be used in this tp.
+	// The order will be testpsy1(externalgps),testpsy2,testpsy3
+	TUid uidPsy1 = iUidTestPsy1;
+	TUid uidPsy2 = iUidTestPsy2;
+	TUid uidPsy3 = iUidTestPsy3;
+
+    SetupPsyL(uidPsy1); // will disable all except uidPsy1
+
+    CPosModules* db = CPosModules::OpenL();
+    CleanupStack::PushL(db);
+
+    // Enable the PSY test psys 
+    CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
+    moduleUpdate -> SetUpdateAvailability(ETrue);
+    db->SetModulePriorityL(uidPsy1, 0);
+    db->SetModulePriorityL(uidPsy2, 1);
+    db->SetModulePriorityL(uidPsy3, 1);
+    db->UpdateModuleL(uidPsy1, *moduleUpdate);
+    db->UpdateModuleL(uidPsy2, *moduleUpdate);
+    db->UpdateModuleL(uidPsy3, *moduleUpdate);
+    CleanupStack::PopAndDestroy(moduleUpdate);
+
+    // Setup the PSY:s in the correct order
+    CPosModuleIdList* prioList = db->ModuleIdListLC();
+    TInt numModules = prioList->Count();
+    TPositionModuleInfo modInfoPsy2; //used to comapre that the same result is returned.
+    db -> GetModuleInfoL(uidPsy2, modInfoPsy2);
+    CleanupStack::PopAndDestroy(2); // db, prioList
+	
+	// Get default positioning module info. (testpsy1 or externalgps)
+	TPositionModuleInfo modInfo;
+    TPositionModuleId defaultId;
+    err = posServer.GetDefaultModuleId(defaultId);
+    _LIT(KDefaultModuleId, "Not possible to get default module id");
+    AssertTrueSecL(err == KErrNone, KDefaultModuleId, err);
+    // Check that the correct id was returned.
+    if (defaultId != uidPsy1)
+        {
+        _LIT(KErrorWrongModule, "Default module was not returned in GetDefaultModuleId()");
+        LogErrorAndLeaveL(KErrorWrongModule);
+        }
+
+    // Get default module info by using the id returned.
+    err = posServer.GetModuleInfoById(defaultId, modInfo);
+	_LIT(KGetDefPosModInfoError,
+            "TP76. Error occured at GetModuleInfoById, return code %d");
+	AssertTrueSecL(err == KErrNone, KGetDefPosModInfoError, err);
+	// Check if the received psy is the right one
+	_LIT(KIncorrectPsyError,
+           "TP76. Incorrect PSY returned from Epos.");
+	AssertTrueL(uidPsy1 == modInfo.ModuleId(), KIncorrectPsyError);
+    /////END TEST DEFAULT/////
+
+	/////////////////////////////////
+    ///// TestGetModuleInfoById /////
+	/////////////////////////////////
+
+    // Get info from specific psy (testpsy2)
+	_LIT(KGetPosModInfoError, "Wrong data received from Epos");
+    err = posServer.GetModuleInfoById(uidPsy2, modInfo);
+	AssertTrueSecL(err == 0, KGetPosModInfoError, err);
+	AssertTrueL(modInfo.ModuleId() == uidPsy2, KGetPosModInfoError);
+    CheckModuleInfoL(modInfoPsy2, modInfo);
+    /////END TEST GetModuleInfoById/////
+
+	/////////////////////////////////////
+    ///// Test GetModuleInfoByIndex /////
+	/////////////////////////////////////
+
+	// Get info from the testpsys (testpsy1, testpsy2, testpsy3)
+    TPositionModuleId id1;
+    TPositionModuleId id2;
+    TPositionModuleId id3;
+    TUint count;
+	err = posServer.GetNumModules(count);
+	_LIT(KNumPosModInfoError,
+            "TP76. Error occured at GetNumModules error code returned, return code %d");
+	AssertTrueSecL(err == 0,KNumPosModInfoError,err);
+	_LIT(KIncorrectNoOfModules,
+           "TP76. Incorrect number of modules.");
+    TUint no = (TUint) numModules; //Bad API implementation
+	AssertTrueL(count == no, KIncorrectNoOfModules);
+
+    err = posServer.GetModuleInfoByIndex(0, modInfo);
+    AssertTrueSecL(err == KErrNone, KGetDefPosModInfoError, err);
+    id1 = modInfo.ModuleId();
+    if (!(id1 == uidPsy1 ||
+        id1 == uidPsy2 ||
+        id1 == uidPsy3))
+        {
+        LogErrorAndLeaveL(KGetPosModInfoError);
+        }
+
+    err = posServer.GetModuleInfoByIndex(1, modInfo);
+    AssertTrueSecL(err == 0, KGetDefPosModInfoError, err);
+    id2 = modInfo.ModuleId();
+    if (!(id2 == uidPsy1 ||
+        id2 == uidPsy2 ||
+        id2 == uidPsy3))
+        {
+        LogErrorAndLeaveL(KGetPosModInfoError);
+        }
+
+    err = posServer.GetModuleInfoByIndex(2, modInfo);
+    AssertTrueSecL(err == 0, KGetDefPosModInfoError, err);
+    id3 = modInfo.ModuleId();
+    if (!(id3 == uidPsy1 ||
+        id3 == uidPsy2 ||
+        id3 == uidPsy3))
+        {
+        LogErrorAndLeaveL(KGetPosModInfoError);
+        }
+    
+    // Assuming that only 3 PSYs are installed
+    err = posServer.GetModuleInfoByIndex(3, modInfo);
+    AssertTrueSecL(err == 0, KGetDefPosModInfoError, err);
+
+    ///// END TEST GetModuleInfoByIndex /////
+
+	CleanupStack::PopAndDestroy(); //posServer
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp76::CheckModuleInfoL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp76::CheckModuleInfoL(const TPositionModuleInfo& dbInfo,
+                                const TPositionModuleInfo& clientInfo)
+    {
+    _LIT(KNotSame, "Module Info from settings is not the same as when read by GetModuleInfoById");
+    if (dbInfo.IsAvailable() != clientInfo.IsAvailable() ||
+        dbInfo.ModuleId() != clientInfo.ModuleId() ||
+        dbInfo.DeviceLocation() != clientInfo.DeviceLocation() ||
+        dbInfo.Capabilities() != clientInfo.Capabilities() ||
+        dbInfo.TechnologyType() != clientInfo.TechnologyType() ||
+        dbInfo.Version().iBuild != clientInfo.Version().iBuild ||
+        dbInfo.Version().iMajor != clientInfo.Version().iMajor ||
+        dbInfo.Version().iMinor != clientInfo.Version().iMinor ||
+        dbInfo.Version().Name() != clientInfo.Version().Name() ||
+        dbInfo.ClassesSupported(EPositionInfoFamily) != clientInfo.ClassesSupported(EPositionInfoFamily))
+        {
+        LogErrorAndLeaveL(KNotSame);
+        }
+    TPositionQuality dbQuality;
+    TPositionQuality clientQuality;
+    dbInfo.GetPositionQuality(dbQuality);
+    clientInfo.GetPositionQuality(clientQuality);
+    if (dbQuality.TimeToFirstFix() != clientQuality.TimeToFirstFix() ||
+        dbQuality.TimeToNextFix() != clientQuality.TimeToNextFix() ||
+        dbQuality.HorizontalAccuracy() != clientQuality.HorizontalAccuracy() ||
+        dbQuality.VerticalAccuracy() != clientQuality.VerticalAccuracy() ||
+        dbQuality.CostIndicator() != clientQuality.CostIndicator() || 
+        dbQuality.PowerConsumption() != clientQuality.PowerConsumption() )
+        {
+        LogErrorAndLeaveL(KNotSame);
+        }
+
+
+    TBuf<30> name1;
+    TBuf<30> name2;
+    dbInfo.GetModuleName(name1);
+    clientInfo.GetModuleName(name2);
+    if (name1 != name2)
+        {
+        LogErrorAndLeaveL(KNotSame);
+        }
+    }
+
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp76::AssertTrueL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp76::AssertTrueL(TBool aCondition, const TDesC& aErrorMsg)
+    {
+  	if (!aCondition)
+		{
+		LogErrorAndLeaveL(aErrorMsg);
+		}
+    }
+
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp76::AssertTrueSecL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp76::AssertTrueSecL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode)
+    {
+  	if (!aCondition)
+		{
+		TBuf<100> buf;
+		buf.Format(aErrorMsg, aErrorCode);
+		LogErrorAndLeaveL(buf);
+		}
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientpostp93.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,229 @@
+// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+//  INCLUDES
+#include "ctlbsclientpostp93.h"
+#include "ctlbsclientperiodictester.h"
+
+// CONSTANTS
+_LIT(KServiceName1, " aaaaaaaaaaa");
+_LIT(KServiceName2, " bbbbbbbbbbb");
+_LIT(KServiceName3, " ccccccccccc");
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp93::CT_LbsClientPosTp93(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
+	{  
+	_LIT(KTestName,"TP93 - Periodic Updates, Multiple clients");
+	SetTestStepName(KTestName); 
+	}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+CT_LbsClientPosTp93::~CT_LbsClientPosTp93()
+	{
+	}
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp93::CloseTest
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp93::CloseTest()
+    {
+	iRequestArray.Reset();
+	iNameArray.Reset();
+	iRequestArray.Close();
+	iNameArray.Close();
+
+    }
+
+// ---------------------------------------------------------
+// CT_LbsClientPosTp93::StartL
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CT_LbsClientPosTp93::StartL()
+    {
+	SetupPsyL(iUidMultiPsy);
+	
+	TPtrC name1(KServiceName1);
+	TPtrC name2(KServiceName2);
+	TPtrC name3(KServiceName3);
+	
+	iNameArray.Append(name1);
+	iNameArray.Append(name2);
+	iNameArray.Append(name3);
+
+	TInt numberOfRuns = 25;
+	TTimeIntervalMicroSeconds interval1 = TTimeIntervalMicroSeconds(1000000);
+	TTimeIntervalMicroSeconds interval3 = TTimeIntervalMicroSeconds(3000000);
+	TTimeIntervalMicroSeconds interval5 = TTimeIntervalMicroSeconds(5000000);
+	TTimeIntervalMicroSeconds interval11 = TTimeIntervalMicroSeconds(11000000);
+	TTimeIntervalMicroSeconds interval13 = TTimeIntervalMicroSeconds(13000000);
+	TTimeIntervalMicroSeconds interval17 = TTimeIntervalMicroSeconds(17000000);
+
+	
+	TUid uid = iUidMultiPsy;
+    TInt errorsFound = KErrNone;
+	
+	CT_LbsClientPeriodicTester* periodicTester1 = 
+					CT_LbsClientPeriodicTester::NewL(interval1, 
+														KServiceName1, 
+														iLog, 
+														uid, 
+														numberOfRuns);
+	CleanupStack::PushL(periodicTester1);
+
+	CT_LbsClientPeriodicTester* periodicTester2 = 
+					CT_LbsClientPeriodicTester::NewL(interval3, 
+														KServiceName2, 
+														iLog, 
+														uid, 
+														numberOfRuns);
+	CleanupStack::PushL(periodicTester2);
+
+	CT_LbsClientPeriodicTester* periodicTester3 = 
+					CT_LbsClientPeriodicTester::NewL(interval5, 
+														KServiceName3, 
+														iLog, 
+														uid, 
+														numberOfRuns);
+	CleanupStack::PushL(periodicTester3);
+
+	periodicTester1->RequestNotification();
+	periodicTester2->RequestNotification();
+	periodicTester3->RequestNotification();
+
+	// Active scheduler is stopped three times.
+	CActiveScheduler::Start();
+	CActiveScheduler::Start();
+	CActiveScheduler::Start();
+
+    if (!periodicTester1->IsCompletedOK() || 
+    		!periodicTester2->IsCompletedOK() || 
+    		!periodicTester3->IsCompletedOK())
+        {
+        _LIT(KErr, "ERROR: periodicTester1-3 returned error");
+        INFO_PRINTF1(KErr);
+        errorsFound++;
+        }
+
+	CleanupStack::PopAndDestroy(3, periodicTester1);
+	
+	CT_LbsClientPeriodicTester* periodicTester4 = 
+						CT_LbsClientPeriodicTester::NewL(interval3, 
+															KServiceName1, 
+															iLog, 
+															uid, 
+															numberOfRuns);
+	CleanupStack::PushL(periodicTester4);
+
+	CT_LbsClientPeriodicTester* periodicTester5 = 
+						CT_LbsClientPeriodicTester::NewL(interval3, 
+															KServiceName2, 
+															iLog, 
+															uid, 
+															numberOfRuns);
+	CleanupStack::PushL(periodicTester5);
+
+	CT_LbsClientPeriodicTester* periodicTester6 = 
+						CT_LbsClientPeriodicTester::NewL(interval3, 
+															KServiceName3, 
+															iLog, 
+															uid, 
+															numberOfRuns);
+	CleanupStack::PushL(periodicTester6);
+
+	periodicTester4->RequestNotification();
+	periodicTester5->RequestNotification();
+	periodicTester6->RequestNotification();
+
+	// Active scheduler is stopped three times.
+	CActiveScheduler::Start();
+	CActiveScheduler::Start();
+	CActiveScheduler::Start();
+
+    if (!periodicTester4->IsCompletedOK() || 
+    		!periodicTester5->IsCompletedOK() || 
+    		!periodicTester6->IsCompletedOK())
+        {
+        _LIT(KErr, "ERROR: periodicTester4-6 returned error");
+        INFO_PRINTF1(KErr);
+        errorsFound++;
+        }
+
+	CleanupStack::PopAndDestroy(3, periodicTester4);
+	
+	CT_LbsClientPeriodicTester* periodicTester7 = 
+						CT_LbsClientPeriodicTester::NewL(interval11, 
+															KServiceName1, 
+															iLog, 
+															uid, 
+															numberOfRuns);
+	CleanupStack::PushL(periodicTester7);
+
+	CT_LbsClientPeriodicTester* periodicTester8 = 
+						CT_LbsClientPeriodicTester::NewL(interval13, 
+															KServiceName2, 
+															iLog, 
+															uid, 
+															numberOfRuns);
+	CleanupStack::PushL(periodicTester8);
+
+	CT_LbsClientPeriodicTester* periodicTester9 = 
+						CT_LbsClientPeriodicTester::NewL(interval17, 
+															KServiceName3, 
+															iLog, 
+															uid, 
+															numberOfRuns);
+	CleanupStack::PushL(periodicTester9);
+
+	periodicTester7->RequestNotification();
+	periodicTester8->RequestNotification();
+	periodicTester9->RequestNotification();
+
+	// Active scheduler is stopped three times.
+	CActiveScheduler::Start();
+	CActiveScheduler::Start();
+	CActiveScheduler::Start();
+
+    if (!periodicTester7->IsCompletedOK() || 
+    		!periodicTester8->IsCompletedOK() || 
+    		!periodicTester9->IsCompletedOK())
+        {
+        _LIT(KErr, "ERROR : periodicTester7-9 returned error");
+        INFO_PRINTF1(KErr);
+        errorsFound++;
+        }
+
+	CleanupStack::PopAndDestroy(3, periodicTester7);
+
+    if (errorsFound != KErrNone)
+        {
+        _LIT(KErr, "Errors returned from some periodicTester");
+        LogErrorAndLeaveL(KErr);
+        }
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientserver.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,281 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsClientServer.cpp
+// This is the class implementation for the LBS Client Test Server
+// 
+//
+
+// User includes
+#include "ctlbsclientserver.h"
+
+// System includes
+#include <e32std.h>
+#include <rsshared.h>
+
+// Header files of LBS Client API Test Steps
+#include "ctlbsstepconfighybridmodule.h"
+#include "ctlbsclientstepsrvconnectclose.h"
+#include "ctlbsclientstepnotifyposupdate.h"
+#include "ctlbsclientstepcellbasednpud.h"
+#include "ctlbsclientstepopenclose.h"
+#include "ctlbsclientstepsrvversion.h"
+#include "ctlbsclientstepmodselect.h"
+#include "ctlbsclientstepmodinfo.h"
+#include "ctlbsclientsteplastknownpos.h"
+#include "ctlbsclientstepmultireq.h"
+#include "ctlbsclientstepmodstatus.h"
+#include "ctlbsclientstepupdateoptions.h"
+#include "ctlbsclientstepassistance.h"
+#include "ctlbsclientsteppartialupdate.h"
+#include "ctlbsclientsteptracking.h"
+#include "ctlbsclientstepignoreaccurracysetting.h"
+#include "ctlbsclientstepignoreaccurracysettingtracking.h"
+#include "ctlbsclientstep_reset_assistance.h"
+
+/**
+  MainL()
+  Description :		This is the main function which installs the 
+					active scheduler and creates an object of the Email server
+  @internalTechnology
+  @param  none
+  @return none
+  @pre    None
+  @post   None
+*/
+LOCAL_C void MainL()
+	{
+	__UHEAP_MARK;
+	CActiveScheduler* sched = new (ELeave) CActiveScheduler;
+	CleanupStack::PushL(sched);
+	CActiveScheduler::Install(sched);
+
+	__UHEAP_MARK;
+	// this registers the server with the active scheduler and calls SetActive
+	CT_LbsClientServer* server = CT_LbsClientServer::NewL();
+
+	// signal to the client that we are ready by
+	// rendevousing process
+	RProcess::Rendezvous(KErrNone);
+
+	// run the active scheduler
+	sched->Start();
+
+	// clean up
+	delete server;
+	
+	__UHEAP_MARKEND;
+	
+	CleanupStack::PopAndDestroy(sched);
+	__UHEAP_MARKEND;
+	}
+
+
+
+
+/**
+  E32Main()
+  Description :	It is the entry point 
+  @internalTechnology
+  @param  none
+  @return Returns the error code
+  @pre    None
+  @post   None
+*/
+GLDEF_C TInt E32Main()
+	{
+	__UHEAP_MARK;
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+
+	TRAPD(err, MainL());
+
+	delete cleanup;
+	__UHEAP_MARKEND;
+
+	return err;
+	}
+    
+
+
+/**
+  NewL()
+  Constructs a CT_LbsClientServer object.
+  Uses two phase construction and leaves nothing on the CleanupStack.
+  @internalTechnology
+  @param  none
+  @return Created object of type CT_LbsClientServer
+  @pre    None
+  @post   None
+*/
+CT_LbsClientServer* CT_LbsClientServer::NewL()
+	{
+	CT_LbsClientServer*server = new(ELeave) CT_LbsClientServer();
+	CleanupStack::PushL(server);
+	server->ConstructL(KLbsClientTestServer);
+	CleanupStack::Pop(server);
+	return server;
+	}
+
+
+CT_LbsClientServer::~CT_LbsClientServer()
+	{
+	// DELETE EVERYTHIGN THAT IS ALLOCATED IN THE ConstructL(!)
+	delete iSharedData;
+	iSharedData = NULL;
+	}
+	
+	
+/**
+  Function : CT_LbsClientServer
+  Description : Constructor
+  @internalTechnology
+  @param :
+  @return : N/A
+  @precondition : none
+  @postcondition : none
+*/
+CT_LbsClientServer::CT_LbsClientServer()
+	{
+	}
+
+/**
+  Function : ConstructL
+  Description : 
+  @internalTechnology
+  @param :
+  @return : N/A
+  @precondition : none
+  @postcondition : none
+*/
+void CT_LbsClientServer::ConstructL(const TDesC& aName)
+	{
+	CT_LbsServer::ConstructL(aName);
+	
+	iSharedData = CT_LbsSharedData::NewL();
+	}
+
+	
+/**
+  Function : CreateTestStep
+  Description : Creates a test step based on the step name read from the script file
+  @internalTechnology
+  @param : aStepName   The step name which needs to be created
+  @return : Created object of type CTestStep
+  @precondition : none
+  @postcondition : none
+*/
+CTestStep* CT_LbsClientServer::CreateTestStep(const TDesC& aStepName)
+	{
+	// NULL if insufficient memory. This suits the API.
+
+	// Test case test steps, each test step supports one or more test cases.
+	if(aStepName == KLbsStep_ConfigHybridModule)	
+		{
+		return CT_LbsStep_ConfigHybridModule::New(*this);
+		}	
+
+	if(aStepName == KLbsClientStep_SrvConnectClose)		
+		{
+		return CT_LbsClientStep_SrvConnectClose::New(*this);
+		}
+		
+	if(aStepName == KLbsClientStep_OpenClose)		
+		{
+		return CT_LbsClientStep_OpenClose::New(*this);
+		}
+					
+	if(aStepName == KLbsClientStep_SrvVersion)		
+		{
+		return CT_LbsClientStep_SrvVersion::New(*this);
+		}		
+		
+	if(aStepName == KLbsClientStep_NotifyPosUpdate)	
+		{
+		return CT_LbsClientStep_NotifyPosUpdate::New(*this);
+		}
+		
+	if(aStepName == KLbsClientStep_CellBasedNotifyPosUpdate)	
+		{
+		return CT_LbsClientStep_CellBasedNotifyPosUpdate::New(*this);
+		}		
+
+	if(aStepName == KLbsClientStep_ModSelect)	
+		{
+		return CT_LbsClientStep_ModSelect::New(*this);
+		}
+
+	if(aStepName == KLbsClientStep_ModInfo)	
+		{
+		return CT_LbsClientStep_ModInfo::New(*this);
+		}
+
+	if(aStepName == KLbsClientStep_LastKnownPos)	
+		{
+		return CT_LbsClientStep_LastKnownPos::New(*this);
+		}
+		
+	if(aStepName == KLbsClientStep_MultiReq)	
+		{
+		return CT_LbsClientStep_MultiReq::New(*this);
+		}
+		
+	if(aStepName == KLbsClientStep_ModStatus)	
+		{
+		return CT_LbsClientStep_ModStat::New(*this);
+		}
+
+	if(aStepName == KLbsClientStep_UpdateOptions)	
+		{
+		return CT_LbsClientStep_UpdateOptions::New(*this);
+		}		
+    
+    if(aStepName == KLbsClientStep_Assistance)	
+		{
+		return CT_LbsClientStep_Assistance::New(*this);
+		}
+
+    if(aStepName == KLbsClientStep_PartialUpdate)	
+		{
+		return CT_LbsClientStep_PartialUpdate::New(*this);
+		}
+    if(aStepName == KLbsClientStep_IgnoreAccuracySetting)
+    	{
+    	return CT_LbsClientStep_IgnoreAccuracySetting::New(*this);
+    	}
+    if(aStepName == KLbsClientStep_IgnoreAccuracySettingTracking)
+    	{
+    	return CT_LbsClientStep_IgnoreAccuracySettingTracking::New(*this);
+    	}
+
+	if (aStepName == KLbsClientStep_Tracking)
+		{
+		return CT_LbsClientStep_Tracking::New(*this);
+		}
+
+	if (aStepName == KLbsClientStep_Tracking)
+		{
+		return CT_LbsClientStep_Tracking::New(*this);
+		}
+
+	if (aStepName == KLbsClientStep_ResetAssistance)
+		{
+		return CT_LbsClientStep_ResetAssistance::New(*this);
+		}
+
+	// Let base class handle any common test steps - will return NULL if test step is not supported.
+	return CT_LbsServer::CreateTestStep(aStepName);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientshareddata.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,89 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsClientSharedData.cpp
+// This file contains the shared data class for the Lbs Client Test server
+// 
+//
+
+
+#include "ctlbsclientshareddata.h"
+
+
+/**
+  Function : NewL
+  Description : Constructor
+  @internalTechnology
+  @param :
+  @return : N/A
+  @precondition : none
+  @postcondition : none
+*/
+CT_LbsClientSharedData* CT_LbsClientSharedData::NewL()
+	{
+	CT_LbsClientSharedData* sharedData=new(ELeave) CT_LbsClientSharedData();
+	CleanupStack::PushL(sharedData);
+	sharedData->ConstructL();
+	CleanupStack::Pop(sharedData);
+
+	return sharedData;
+	}
+
+
+/**
+  Function : ConstructL
+  Description : Constructor
+  @internalTechnology
+  @param :
+  @return : N/A
+  @precondition : none
+  @postcondition : none
+*/
+void CT_LbsClientSharedData::ConstructL()
+	{
+	}
+
+
+/**
+  Function : CT_LbsClientSharedData
+  Description : Constructor
+  @internalTechnology
+  @param :
+  @return : N/A
+  @precondition : none
+  @postcondition : none
+*/
+CT_LbsClientSharedData::CT_LbsClientSharedData()
+	{
+	}
+	
+/**
+  Function : ~CT_LbsClientSharedData
+  Description : Destructor
+  @internalTechnology
+  @param :
+  @return : N/A
+  @precondition : none
+  @postcondition : none
+*/	
+CT_LbsClientSharedData::~CT_LbsClientSharedData()
+	{
+	// Clear arrays.
+	for (TInt i = 0; i < iVerifyPosInfoArr.Count(); ++i)
+		delete iVerifyPosInfoArr[i];
+	iVerifyPosInfoArr.Close();
+
+	for (TInt i = 0; i < iCurrentPosInfoArr.Count(); ++i)
+		delete iCurrentPosInfoArr[i];
+	iCurrentPosInfoArr.Close();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientstep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,202 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsClientStep.cpp
+// This is the class implementation for the LBS Client Test Step Base
+// 
+//
+
+#include "ctlbsclientstep.h"
+
+#include "tlbsutils.h"
+#include "ctlbsasyncwaiter.h"
+
+
+#define REFPOS_LAT				52.2
+#define REFPOS_LONG				0.2
+#define REFPOS_ALT				10
+#define REFPOS_HORZ_ACCURACY	100
+#define REFPOS_VERT_ACCURACY	100
+
+/**
+ * @return - TVerdict
+ * Implementation of CTestStep base class virtual
+ * It is used for doing all initialisation common to derived classes in here.
+ * Make it being able to leave if there are any errors here as there's no point in
+ * trying to run a test step if anything fails.
+ * The leave will be picked up by the framework.
+ */
+TVerdict CT_LbsClientStep::doTestStepPreambleL()
+	{
+	// Process some common pre setting to test steps then set SetTestStepResult to EFail or Epass.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsClientStep::doTestStepPreambleL()"));
+	SetTestStepResult(EPass);
+
+	return TestStepResult();
+	}
+
+
+/**
+ * @return - TVerdict
+ * Implementation of CTestStep base class virtual
+ * It is used for doing all after test treatment common to derived classes in here.
+ * Make it being able to leave
+ * The leave will be picked up by the framework.
+ */
+TVerdict CT_LbsClientStep::doTestStepPostambleL()
+	{
+	// Process some common post setting to test steps then set SetTestStepResult to EFail or Epass.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsClientStep::doTestStepPostabmleL()"));
+
+	//SetTestStepResult(EPass);  // or EFail
+	return TestStepResult();
+	}
+
+
+CT_LbsClientStep::~CT_LbsClientStep()
+	{
+	}
+
+
+CT_LbsClientStep::CT_LbsClientStep(CT_LbsClientServer& aParent) : iParent(aParent)
+	{
+	}
+
+
+TInt CT_LbsClientStep::DoNotifyUpdateL(TPositionInfoBase& aPosInfo)
+{
+	return  GetLocationL(aPosInfo, EDoNotifyPosUpdate);
+}
+
+TInt CT_LbsClientStep::DoLastKnownPosL(TPositionInfoBase& aPosInfo)
+{
+	return GetLocationL(aPosInfo, EDoLastKnownPos);
+}
+
+
+TInt CT_LbsClientStep::GetLocationL(TPositionInfoBase& aPosInfo, TUint32 aNotifyCallType)
+{
+	// Use wrapper active object for the async call below.
+	CT_LbsAsyncWaiter*	waiter = CT_LbsAsyncWaiter::NewL();
+	CleanupStack::PushL(waiter);
+
+	// Set requestor, note we use the same values as DUMMY_REQUESTOR so we don't have
+	// to include the header file from the test server, to keep code generic when test pos server goes.
+		
+	// TODO: NOTE for the new server, there is no requirement to SetRequestor so we can
+	// remove later.
+	User::LeaveIfError(iPositioner.SetRequestor(	CRequestor::ERequestorService,
+													CRequestor::EFormatApplication,
+													_L("Tom Tom")));
+
+	// Determine the position function to call and get the actual position
+	if (EDoNotifyPosUpdate == aNotifyCallType)
+		{
+		iPositioner.NotifyPositionUpdate(aPosInfo, waiter->iStatus);
+		}
+	else if (EDoLastKnownPos == aNotifyCallType)
+		{
+		iPositioner.GetLastKnownPosition(aPosInfo, waiter->iStatus);
+		}
+		
+	else
+		User::LeaveIfError(KErrArgument);
+		
+	// Wait for and process the result.
+	waiter->StartAndWait();
+
+	TInt err = waiter->Result();
+	if (KErrNone == err)
+		{
+		INFO_PRINTF1(_L("position obtained successfully"));
+	
+		const TPositionInfo& posInfo = reinterpret_cast<const TPositionInfo&>(aPosInfo);
+		
+
+		TPosition pos;
+		posInfo.GetPosition(pos);
+		TReal32 lat 	= pos.Latitude();
+		TReal32 lng 	= pos.Longitude();
+		TReal32 hac  	= pos.HorizontalAccuracy();
+		TReal vac		= pos.VerticalAccuracy();
+
+		INFO_PRINTF2(_L("lat: %f"),lat);
+		INFO_PRINTF2(_L("lng: %f"),lng);
+		INFO_PRINTF2(_L("hac: %f"),hac);
+		INFO_PRINTF2(_L("vac: %f"),vac);
+
+		}
+	else
+		{
+		INFO_PRINTF2(_L("position update failed with error %d"), err);
+		}
+
+	CleanupStack::PopAndDestroy(waiter);
+
+	return err;
+}
+
+
+	
+TInt CT_LbsClientStep::OpenNetSim()
+	{
+	// Connect to net sim.
+	TInt err = iNetSim.ConnectL(NULL);
+	if (err)
+		{
+		return err;
+		}
+
+
+	// Set the reference position, which also be used for any required verification.
+	iRefPos.SetCoordinate(REFPOS_LAT, REFPOS_LONG, REFPOS_ALT);
+	iRefPos.SetAccuracy(REFPOS_HORZ_ACCURACY, REFPOS_VERT_ACCURACY);
+	iRefPos.SetCurrentTime();
+
+	if (!iNetSim.SetReferenceLocation(iRefPos))
+		{
+		iNetSim.Close();
+
+		return KErrGeneral;
+		}	
+		
+
+	// Set plugin to use.
+	TUid pluginUid;
+	if(iParent.iSharedData->iTestModuleInUse)
+		{
+		pluginUid = TUid::Uid(KSimpleAssistanceDataProviderPluginUidValue);
+		}
+	else
+		{
+		pluginUid = TUid::Uid(KSuplAssistanceDataProviderPluginUidValue);
+		}
+	if (!iNetSim.SetAssistanceDataProvider(pluginUid))
+		{
+		iNetSim.Close();
+
+		return KErrGeneral;
+		}
+		
+	return err;
+	}
+
+void CT_LbsClientStep::SendResetAssistanceData(TLbsAssistanceDataGroup aMask)
+	{
+	iNetSim.SendResetAssistanceData(aMask);
+	}
+
+void CT_LbsClientStep::CloseNetSim()
+	{
+	iNetSim.Close();	
+	}	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientstep_reset_assistance.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,258 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is the class implementation for the Notify Position Update Tests
+// 
+//
+ 
+#include "ctlbsclientstep_reset_assistance.h"
+
+#include <lbs.h>
+#include <lbssatellite.h>
+
+#include "tlbsutils.h"
+#include "ctlbsasyncwaiter.h"
+
+
+const TTimeIntervalMicroSeconds KModuleTimeout = 6000000;//makes test module time out(which should be more than the Maxtime in lbsprofile.ini)
+
+const TInt KNumberOfRequests = 10; // the number of requests to do to be near the average
+
+const TInt KWaitTimeForCoolDown = 10 * 1000 * 1000; // how long to wait to make sure the integration module gets turned off
+
+/**
+ *	Sets a Requestor for now - TODO will be removed with new location server
+ */
+void CT_LbsClientStep_ResetAssistance::TempSetRequestorL()
+ 	{	
+	User::LeaveIfError(iPositioner.SetRequestor(	CRequestor::ERequestorService,
+												CRequestor::EFormatApplication,
+												_L("Tom Tom")));
+ 	}
+
+
+/**
+ * Destructor
+ */
+CT_LbsClientStep_ResetAssistance::~CT_LbsClientStep_ResetAssistance()
+	{
+	delete 	iLbsAdmin;	
+	}
+
+
+/**
+ * Constructor
+ */
+CT_LbsClientStep_ResetAssistance::CT_LbsClientStep_ResetAssistance(CT_LbsClientServer& aParent) : CT_LbsClientStep(aParent),iLbsAdmin(NULL),iRequestedAssData(FALSE), iReceivedAssData(FALSE)
+	{
+	
+	SetTestStepName(KLbsClientStep_ResetAssistance);
+	}
+
+
+/**
+Static Constructor
+*/
+CT_LbsClientStep_ResetAssistance* CT_LbsClientStep_ResetAssistance::New(CT_LbsClientServer& aParent)
+	{
+	
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	
+	CT_LbsClientStep_ResetAssistance* testStep = new CT_LbsClientStep_ResetAssistance(aParent);
+	if (testStep)
+		{
+		TInt err = KErrNone;
+
+		TRAP(err, testStep->ConstructL());
+		if (err)
+			{
+			delete testStep;
+			testStep = NULL;
+			}
+		}
+	return testStep;
+	}
+
+
+void CT_LbsClientStep_ResetAssistance::ConstructL()
+	{
+	// create the admin
+	iLbsAdmin = CLbsAdmin::NewL();
+
+	}
+
+//from MT_NotifyPosUpdateObserver:
+/**
+ * 	Callback - called when NotifyPositionUpdate request completes
+ */
+
+void CT_LbsClientStep_ResetAssistance::NotifyPositionUpdateCallback(TRequestStatus& aStatus)
+	{
+	TInt err = aStatus.Int();
+	if (KErrCancel != err)	
+		{
+		SetTestStepResult(EFail); // the request always gets cancelled (see test 0122)
+		}
+	CActiveScheduler::Stop();
+	}
+
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsClientStep_ResetAssistance::doTestStepL()
+	{
+	// Generic test step used to test the LBS Client Notify position update API.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsClientStep_ResetAssistance::doTestStepL()"));
+
+	if (TestStepResult()==EPass)
+		{
+		TInt err = KErrNone;
+		
+		iParent.iSharedData->iTestModuleInUse = EFalse;
+
+		// Connect to self locate server.
+		err = iServer.Connect();
+		User::LeaveIfError(err);
+		CleanupClosePushL(iServer);
+		
+		// Setup netsim.
+		User::LeaveIfError(OpenNetSim());
+
+		TTimeIntervalMicroSeconds resetRequestTime;
+		resetRequestTime = DoRequests(EFalse, ETrue);
+		INFO_PRINTF2(_L("Requests from warm with reset assistance data took on average %d miliseconds to complete."), (resetRequestTime.Int64()/KNumberOfRequests)/1000);
+
+		
+		TTimeIntervalMicroSeconds coldRequestTime;
+		coldRequestTime = DoRequests(ETrue, EFalse);
+		INFO_PRINTF2(_L("Requests from cold took on average %d miliseconds to complete."), (coldRequestTime.Int64()/KNumberOfRequests)/1000);
+		
+		TTimeIntervalMicroSeconds warmRequestTime;
+		warmRequestTime = DoRequests(EFalse, EFalse);
+		INFO_PRINTF2(_L("Requests from warm took on average %d miliseconds to complete."), (warmRequestTime.Int64()/KNumberOfRequests)/1000);
+
+		INFO_PRINTF2(_L("Requests from warm with reset assistance data took on average %d miliseconds to complete."), (resetRequestTime.Int64()/KNumberOfRequests)/1000);
+		INFO_PRINTF2(_L("Requests from cold took on average %d miliseconds to complete."), (coldRequestTime.Int64()/KNumberOfRequests)/1000);
+/*		if(warmRequestTime >= resetRequestTime/2 || resetRequestTime < (coldRequestTime*3)/4)
+			{
+			INFO_PRINTF1(_L("Reseting assistance data didn't fit into the right time frame"));
+			SetTestStepResult(EFail);
+			}
+*/
+		CloseNetSim();
+			
+		// All done, clean up.
+		CleanupStack::PopAndDestroy(&iServer);		
+		}
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsClientStep_ResetAssistance::doTestStepL()"));
+
+	return TestStepResult();
+	}
+
+TInt64 CT_LbsClientStep_ResetAssistance::DoRequests(TBool aCold, TBool aReset)
+	{
+	if(!aCold)
+		{
+		// *** Warming up module				
+		// Open positioner.
+		TInt err = iPositioner.Open(iServer);
+		User::LeaveIfError(err);
+		CleanupClosePushL(iPositioner);
+
+		// Request notify for the expected reference position.
+		TPositionInfo actualRefPosInfo;
+		err = DoNotifyUpdateL(actualRefPosInfo);
+		if (KErrNone != err)
+			{
+			INFO_PRINTF2(_L("Failed test, reference position request returned err %d."), err);
+			SetTestStepResult(EFail);
+			}		
+	
+		TPositionInfo posInfo;
+		// Get the actual position
+		err = DoNotifyUpdateL(posInfo);
+		if (KErrNone != err)
+			{
+			INFO_PRINTF2(_L("Failed test, position request returned err %d."), err);
+			SetTestStepResult(EFail);
+			}
+		}
+
+	TTimeIntervalMicroSeconds requestTime;
+	requestTime = 0;
+	// *** Doing the repeated requests with reset assistance data in between if it's requested so
+	for(TInt count = 0; count < KNumberOfRequests; ++count)
+		{
+		if(aReset)
+			{
+			SendResetAssistanceData(0xFFFFFFFF);
+			}
+		
+		if(aCold)
+			{
+			// Open positioner.
+			TInt err = iPositioner.Open(iServer);
+			User::LeaveIfError(err);
+			CleanupClosePushL(iPositioner);
+			}
+		
+		TTime startTime;
+		startTime.UniversalTime(); // start the clock
+
+		if(aCold)
+			{
+			// Request notify for the expected reference position.
+			TPositionInfo actualRefPosInfo;
+			TInt err = DoNotifyUpdateL(actualRefPosInfo);
+			if (KErrNone != err)
+				{
+				INFO_PRINTF2(_L("Failed test, reference position request returned err %d."), err);
+				SetTestStepResult(EFail);
+				}		
+			}
+		TPositionInfo posInfo;
+		// Get the actual position
+		TInt err = DoNotifyUpdateL(posInfo);
+		if (KErrNone != err)
+			{
+			INFO_PRINTF2(_L("Failed test, position request returned err %d."), err);
+			SetTestStepResult(EFail);
+			}
+
+		TTime endTime;
+		endTime.UniversalTime(); // stop the clock
+		TTimeIntervalMicroSeconds interval;
+		interval = endTime.MicroSecondsFrom(startTime);
+		INFO_PRINTF2(_L("Request took %d microseconds to complete."), interval.Int64());
+		requestTime = requestTime.Int64() + interval.Int64();
+
+		if(aCold)
+			{
+			CleanupStack::PopAndDestroy(&iPositioner);
+			User::After(KWaitTimeForCoolDown);
+			}
+		}			
+
+	if(!aCold)
+		{
+		// Cleanup.
+		CleanupStack::PopAndDestroy(&iPositioner);
+		User::After(KWaitTimeForCoolDown);
+		}
+	return requestTime.Int64();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientstepassistance.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,432 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_LbsClientStepAssistance.cpp
+// This is the class implementation for the LBS Client Step Assistance
+// 
+//
+
+//LBS includes.
+#include <lbs.h>
+#include <lbsnetcommon.h>
+#include <lbsnetprotocolbase.h>
+
+// LBS test includes.
+#include "ctlbsclientstepassistance.h"
+#include "tlbsutils.h"
+
+
+const TInt KAssistanceDataProviderPluginUidValue = 0x1028225B;
+
+
+/**
+Static Constructor
+*/
+CT_LbsClientStep_Assistance* CT_LbsClientStep_Assistance::New(CT_LbsClientServer& aParent)
+	{
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	CT_LbsClientStep_Assistance* testStep = new CT_LbsClientStep_Assistance(aParent);
+	if (testStep)
+		{
+		TInt err = KErrNone;
+
+		TRAP(err, testStep->ConstructL());
+		if (err)
+			{
+			delete testStep;
+			testStep = NULL;
+			}
+		}
+	return testStep;
+	}
+
+/**
+ * Constructor
+ */
+CT_LbsClientStep_Assistance::CT_LbsClientStep_Assistance(CT_LbsClientServer& aParent) : CT_LbsNetSimStep(), iParent(aParent),iLbsAdmin(NULL)
+	{
+	SetTestStepName(KLbsClientStep_Assistance);
+	}
+
+
+void CT_LbsClientStep_Assistance::ConstructL()
+	{
+	// Create the base class objects.
+    CT_LbsNetSimStep::ConstructL();
+	
+	// and the active object wrapper for the notify position update.
+	iDoPosUpdate = CT_LbsDoPosUpdate::NewL(this);
+	
+	// create the admin
+	iLbsAdmin = CLbsAdmin::NewL();
+	}
+
+/**
+ * Destructor
+ */
+CT_LbsClientStep_Assistance::~CT_LbsClientStep_Assistance()
+	{
+	delete 	iLbsAdmin;
+
+	iDoPosUpdate->Cancel();
+	delete iDoPosUpdate;
+
+	}
+
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsClientStep_Assistance::doTestStepL()
+	{
+	// Generic test step used to test the LBS Client Notify position update API with assistant data.
+	INFO_PRINTF1(_L("&gt;&gt; CT_LbsClientStep_Assistance::doTestStepL()"));
+
+	if (TestStepResult() == EPass)
+		{		
+												
+		// Expected callbacks flags, most test steps require MO-LR.
+		iFlagsToHaltOn =	KLbsCallback_NetSim_Got_Connect | 		// Net Sim callback events.
+							KLbsCallback_MoLr |
+							KLbsCallback_Got_NotifyUpdate;	// notifypositionupdate completed.
+				
+		// Carry out unique test actions.
+		if (GetIntFromConfig(ConfigSection(), KTestCaseId, iTestCaseId))
+			{
+			switch (iTestCaseId)
+				{
+			
+				case 16:
+			       {   					
+				
+				   // Set 'assisted-if-possible' (EGpsPreferTerminalBased) mode
+				
+					CLbsAdmin::TGpsMode mode;
+					
+					User::LeaveIfError(iLbsAdmin->Set(KLbsSettingHomeGpsMode, CLbsAdmin::EGpsPreferTerminalBased));
+					User::LeaveIfError(iLbsAdmin->Get(KLbsSettingHomeGpsMode, mode));
+										
+					if(mode != CLbsAdmin::EGpsPreferTerminalBased)
+						{
+						SetTestStepResult(EFail);
+						}
+				
+				    }
+					break;
+				
+				
+				case 18: 
+                   {
+                    	
+                                	
+                   // Set 'assisted-if-possible' (EGpsPreferTerminalBased) mode
+				
+					CLbsAdmin::TGpsMode mode;
+					
+					User::LeaveIfError(iLbsAdmin->Set(KLbsSettingHomeGpsMode, CLbsAdmin::EGpsPreferTerminalBased));
+					User::LeaveIfError(iLbsAdmin->Get(KLbsSettingHomeGpsMode, mode));
+					
+					if(mode != CLbsAdmin::EGpsPreferTerminalBased)
+						{
+						SetTestStepResult(EFail);
+						}
+				   }
+					break;
+			
+				//  Test case LBS-NotifyPosUpdate-0020
+				case 20:
+					{
+
+                    // Set 'assisted-if-possible' (EGpsPreferTerminalBased) mode
+				
+					CLbsAdmin::TGpsMode mode;
+					
+					User::LeaveIfError(iLbsAdmin->Set(KLbsSettingHomeGpsMode, CLbsAdmin::EGpsPreferTerminalBased));
+					User::LeaveIfError(iLbsAdmin->Get(KLbsSettingHomeGpsMode, mode));
+					// TO DO - ideally we should wait for the admin callback for this change here instead of pausing:
+				 	User::After(5000000);
+					if(mode != CLbsAdmin::EGpsPreferTerminalBased)
+						{
+						SetTestStepResult(EFail);
+						}
+					}
+					break;
+				
+				default:
+					{
+					User::Panic(KLbsClientStep_Assistance, KErrUnknown);
+					}					
+				}
+			}
+					
+	
+	// Inform the test module of the required test mode - will block.
+	
+	// TODO remove modDataIn stuff all of it
+//	utils.NotifyModuleOfConfigChangeL(modDataIn);
+			
+	// Connect to net sim.
+
+	iNetSim.ConnectL(/*(MLbsNetSimTestObserver*)*/this);
+
+	// Setup net sim's assistance data.
+
+	// Create reference location. The test step will verify this is returned correctly
+	// in the netsim callbacks only, it will not be used by the test assistance data provider.
+ 
+	// Location to use.
+	RPointerArray<TAny>& srcPosInfoArr = iParent.iSharedData->iVerifyPosInfoArr;
+	TPositionInfo* srcPosInfo = reinterpret_cast<TPositionInfo*>(srcPosInfoArr[0]);
+	TPosition srcPos;
+	srcPosInfo->GetPosition(srcPos);
+	
+		if (!iNetSim.SetReferenceLocation(srcPos))
+			{
+			INFO_PRINTF1(_L("Failed test, can't set NetSim's reference location."));
+			SetTestStepResult(EFail);
+
+			iNetSim.Close();
+
+			return TestStepResult();
+			}	
+	// Set plugin to use.			
+	TUid pluginUid = TUid::Uid(KAssistanceDataProviderPluginUidValue);
+		if (!iNetSim.SetAssistanceDataProvider(pluginUid))
+			{
+			INFO_PRINTF1(_L("Failed test, can't set NetSim's assistance data plugin uid."));
+			SetTestStepResult(EFail);
+			
+			iNetSim.Close();
+
+			return TestStepResult();
+			}
+	
+	
+		// Kick off the keep alive timer - do last to ensure NetSim is ready otherwise the
+		// timer callback may start a MO-LR if the NetSim connected to early.
+		TTimeIntervalMicroSeconds32 interval(KLbsKeepAlivePeriod);
+
+		iKeepAliveTimer->SetTimer(interval);
+
+
+		// Kick off test.
+		CActiveScheduler::Start();
+
+
+		// Clean up.
+
+		//iNetSim.ClearAssistanceDataFilters();
+		iNetSim.Close();
+		}
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsClientStep_Assistance::doTestStepL()"));
+
+	return TestStepResult();
+	}
+	
+	/** NetSim callbacks given for a MoLr, which we invoke as a result of the notify position update.
+*/
+
+// This method called when a client connects to the gateway API
+
+void CT_LbsClientStep_Assistance::Connected()
+	{
+	// Call base implementation.
+	CT_LbsNetSimStep::Connected();
+	
+	switch (iTestCaseId)
+		{
+		
+		case 16:
+			{
+			//Configure network simulation to ensure it does not deliver assistance data.
+			//need to be changed
+			TBool ret = iNetSim.SetResponseError(KErrNotReady, ETrue);
+			}
+			break;
+				
+		// All other test cases required a MO-LR.
+		default:
+			{
+			// Create a posinfo and store in our shared array for later verification.
+			RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+			TPositionInfo* posInfo = new(ELeave) TPositionInfo();
+
+			T_LbsUtils utils;
+			utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+
+			posInfoArr.Append(posInfo);
+
+			// Kick off pos update - this will invoke the assistance data processing
+			// within the test module. The result of this will be reported back to
+			// the test step via the module data bus monitor.
+			iDoPosUpdate->StartL(*posInfo);
+			
+			// Move to the waiting state.
+			iState = CT_LbsNetSimStep::EWaiting;
+			}
+		}
+	}
+
+
+//called when a client disconnects to the gateway API
+void CT_LbsClientStep_Assistance::Disconnected()
+	{
+	// Call base implementation.
+	CT_LbsNetSimStep::Disconnected();
+	}
+
+// The data to start MoLr . If this blank then we are starting an MoLr, if not then X3P 		
+void CT_LbsClientStep_Assistance::NotifyRegisterLcsMoLr(const TDesC& aData)
+	{
+	// Call base implementation.
+	CT_LbsNetSimStep::NotifyRegisterLcsMoLr(aData);
+
+	// Verify the aData is blank to indicate this is a MOLR.
+	if (aData != KNullDesC)
+		{
+		INFO_PRINTF1(_L("Failed test, register contains data."));
+		SetTestStepResult(EFail);	
+		}
+	}					
+// The reason the MoLr ended					
+void CT_LbsClientStep_Assistance::NotifyReleaseLcsMoLr(TInt aReason)
+	{
+	// Call base implementation.
+	CT_LbsNetSimStep::NotifyReleaseLcsMoLr(aReason);
+
+	if (aReason != KErrNone)
+	    {	
+		INFO_PRINTF2(_L("Failed test, bad release reason %d."), aReason);
+		SetTestStepResult(EFail);
+	    }
+			
+	}
+// A measurement control   
+
+void CT_LbsClientStep_Assistance::NotifyMeasurementControlLocation(const TPositionInfo& aPosition, 
+															  const RLbsAssistanceDataBuilderSet& aData, 
+  														      const TLbsNetPosRequestQuality& aQuality)
+	
+	{
+	T_LbsUtils utils;	
+	
+	// Call base implementation.
+	CT_LbsNetSimStep::NotifyMeasurementControlLocation(aPosition, aData, aQuality);
+
+	// Verify the reference position - use the entry in the verify pos info array.
+	RPointerArray<TAny>& verifyPosInfoArr = iParent.iSharedData->iVerifyPosInfoArr;
+	TPositionInfo* verifyPosInfo = reinterpret_cast<TPositionInfo*>(verifyPosInfoArr[0]);
+	
+	if (!utils.Compare_PosInfo(*verifyPosInfo, aPosition, T_LbsUtils::ERoughAccuracy))
+		{
+		INFO_PRINTF1(_L("Failed test, position incorrect."));
+		SetTestStepResult(EFail);
+		}
+		
+		
+// TODO: Check if we can verify aQuality in any way.
+	(void)aQuality;
+	}
+	
+	
+void CT_LbsClientStep_Assistance::NotifyFacilityLcsMoLrResult(TInt aReason, const TPositionInfo& aPosition)
+	{
+	// Call base implementation.
+	CT_LbsNetSimStep::NotifyFacilityLcsMoLrResult(aReason, aPosition);
+	
+	if (aReason != KErrNone)
+		{	
+		INFO_PRINTF2(_L("Failed test, bad release reason %d."), aReason);
+		SetTestStepResult(EFail);
+		}
+	
+	// Verify the position returned from the network, this will be the same position
+	// we sent to the network as the result of the MO-LR, thus use the entry given by
+	// the test module.
+	T_LbsUtils utils;
+	RPointerArray<TAny>& verifyPosInfoArr = iParent.iSharedData->iVerifyPosInfoArr;
+	TPositionInfo* verifyPosInfo = reinterpret_cast<TPositionInfo*>(verifyPosInfoArr[0]);
+	
+	if (!utils.Compare_PosInfo(*verifyPosInfo, aPosition, T_LbsUtils::ERoughAccuracy))
+		{
+		INFO_PRINTF1(_L("Failed test, position incorrect."));
+		SetTestStepResult(EFail);
+		}	
+	}
+
+void CT_LbsClientStep_Assistance::NotifyMeasurementReportLocation(const TPositionInfo& aPosition)
+	{	
+	// Call base implementation.
+	CT_LbsNetSimStep::NotifyMeasurementReportLocation(aPosition);
+	
+	// Verify the position given to the network, this will be the same position
+	// returned as the result of the MO-LR, thus use the entry given by
+	// the test module.
+	T_LbsUtils utils;
+	RPointerArray<TAny>& verifyPosInfoArr = iParent.iSharedData->iVerifyPosInfoArr;
+	TPositionInfo* verifyPosInfo = reinterpret_cast<TPositionInfo*>(verifyPosInfoArr[0]);
+	
+	if (!utils.Compare_PosInfo(*verifyPosInfo, aPosition, T_LbsUtils::ERoughAccuracy))
+		{
+		INFO_PRINTF1(_L("Failed test, position incorrect."));
+		SetTestStepResult(EFail);
+		}
+	}
+
+void CT_LbsClientStep_Assistance::NotifyMeasurementReportControlFailure(TInt aReason)
+	{
+	// Call base implementation.
+	CT_LbsNetSimStep::NotifyMeasurementReportControlFailure(aReason);
+
+    INFO_PRINTF2(_L("Failed test, got un-expected control failure with reason code = %d."), aReason);
+	SetTestStepResult(EFail);
+	
+	}
+	
+void CT_LbsClientStep_Assistance::NotifyMeasurementReportRequestMoreAssistanceData(const TLbsAssistanceDataGroup& aFilter)
+	{
+	(void)aFilter;
+
+	INFO_PRINTF1(_L("Got - Net Sim Notify Measurement Report Request More Assistance Data - Callback Event."));
+	
+	// Note that we do NOT set the callback flag here (since it may not be set and the base class does an equivalence test, so we don't test for it)
+	}	
+	
+/**	Notify position update callback.
+
+	The notify position update as completed. We can mark as done in the callback flags.
+*/
+void CT_LbsClientStep_Assistance::MT_LbsDoPosUpdateCallback(TRequestStatus& aStatus)
+	{
+	INFO_PRINTF1(_L("Got - Notify Update - Callback Event."));
+	
+	SetCallbackFlag(KLbsCallback_Got_NotifyUpdate);
+	
+	if (KErrNone != aStatus.Int())
+		{
+		INFO_PRINTF2(_L("Failed test, pos info request err = %d."), aStatus.Int());
+		SetTestStepResult(EFail);
+		}
+	
+// TODO also we expect this to happen before the last netsim callbacks happen if not
+// we can't use current pos in those funcs maybe have to use the verify one not as nice.	
+
+
+	}	
+
+
+//END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientstepcellbasednpud.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,474 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientstep_cellbasednpud.cpp
+// This is the class implementation for the Notify Position Update Tests
+// 
+//
+ 
+#include "ctlbsclientstepcellbasednpud.h"
+
+#include <lbs.h>
+#include <lbssatellite.h>
+
+#include "tlbsutils.h"
+#include "ctlbsasyncwaiter.h"
+
+
+// constant definitions
+
+_LIT(KLbsClientStepCellBasedNotifyPosUpdate, "LbsClientStepCellBasedNotifyPosUpdate");
+
+// by default, a test case will abort after this time if all callbacks not completed:
+// Note that this must be less than the TEF timeout in the script to be of any value
+TTimeIntervalMicroSeconds32 KDefaultAbortTimerPeriod = 90*1000000;	// 1.5 mins 
+
+// by default, a test case running with real gps hardware will abort after this time 
+// Note that this must be less than the TEF timeout in the script to be of any value
+TTimeIntervalMicroSeconds32 KDefaultAbortTimerPeriod_real = 100*1000000;	// 5 mins
+
+
+/**
+ * Destructor
+ */
+CT_LbsClientStep_CellBasedNotifyPosUpdate::~CT_LbsClientStep_CellBasedNotifyPosUpdate()
+	{
+	iDoPosUpdate->Cancel();
+	delete iDoPosUpdate;
+	}
+
+
+/**
+ * Constructor
+ */
+CT_LbsClientStep_CellBasedNotifyPosUpdate::CT_LbsClientStep_CellBasedNotifyPosUpdate(CT_LbsClientServer& aParent) : iParent(aParent)
+	{	
+	SetTestStepName(KLbsClientStep_CellBasedNotifyPosUpdate);
+	}
+
+
+/**
+Static Constructor
+*/
+CT_LbsClientStep_CellBasedNotifyPosUpdate* CT_LbsClientStep_CellBasedNotifyPosUpdate::New(CT_LbsClientServer& aParent)
+	{
+	// Can't leave, so return NULL if insufficient memory
+	CT_LbsClientStep_CellBasedNotifyPosUpdate* testStep = new CT_LbsClientStep_CellBasedNotifyPosUpdate(aParent);
+	if (testStep)
+		{
+		TInt err = KErrNone;
+
+		TRAP(err, testStep->ConstructL());
+		if (err)
+			{
+			delete testStep;
+			testStep = NULL;
+			}
+		}
+	return testStep;
+	
+	}	
+	
+void CT_LbsClientStep_CellBasedNotifyPosUpdate::ConstructL()
+	{
+	// Create the base class object.
+    CT_LbsNetSimStep::ConstructL();
+	
+	// Active object wrapper for the notify position update.
+	iDoPosUpdate = CT_LbsDoPosUpdate::NewL(this, TPositionModuleInfo::ETechnologyNetwork);
+	
+	}
+	
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsClientStep_CellBasedNotifyPosUpdate::doTestStepL()
+	{
+	// Generic test step used to test the LBS Client Notify position update API.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsClientStep_CellBasedNotifyPosUpdate::doTestStepL()"));
+
+	if (TestStepResult()==EPass) // TODO still don't see why we need this...
+		{
+		iNetworkUnavailable = FALSE;
+		iIsCancelTest = FALSE;
+   		iCancel = FALSE;
+		iCancelOnPosUpdate = FALSE;
+		iCancelBeforePosUpdate = FALSE;
+		iMultiReq = EFalse;
+		iNumNPUDs = iParent.iSharedData->iVerifyPosInfoArr.Count(); // how many NPUDs to do
+		
+		// Expected callbacks flags
+		iFlagsToHaltOn =	KLbsCallback_NetSim_Got_Connect | 	
+							KLbsCallback_NetworkBasedLocation |
+							KLbsCallback_Got_NotifyPositionUpdate;	// notifypositionupdate completed.
+	
+		
+		TTimeIntervalMicroSeconds32 abortInterval;
+		if(iParent.iSharedData->iTestModuleInUse)
+			{
+			abortInterval = KDefaultAbortTimerPeriod;
+			}
+		else
+			{	
+			abortInterval = KDefaultAbortTimerPeriod_real;
+			}
+		
+		// Carryout unique test actions.
+		TInt testCaseId;
+		if (GetIntFromConfig(ConfigSection(), KTestCaseId, testCaseId))
+			{
+				switch (testCaseId)
+				{												
+				case 1:	// LBS-NotifyPosUpdateCellBased-0001 Request a cell-based location
+					{
+					// nothing to do 
+					}
+					break;
+				
+				case 2:	// LBS-NotifyPosUpdateCellBased-0002	Request a cell-based location and cancel before it completes
+					{
+					iCancel = ETrue;
+					iFlagsToHaltOn =	KLbsCallback_NetSim_Got_Connect |
+										KLbsCallback_Got_NotifyPositionUpdate;
+					}
+					break;
+				
+				case 3:	// LBS-NotifyPosUpdateCellBased-0003	Request a cell-based location, when network unavailable
+					{
+					iNetworkUnavailable = ETrue;
+					// TO DO - are these the right flags (get NO NetSIm callbacks while network unavailable)?
+					iFlagsToHaltOn &= ~KLbsCallback_NetworkBasedLocation;
+					}
+					break;
+					
+				case 4:	// LBS-NotifyPosUpdateCellBased-0004 multiple sequential npuds
+					{
+					iMultiReq = ETrue;
+					}
+					break;
+					
+				case 5:	// LBS-NotifyPosUpdateCellBased-0005	Request a cell-based location and attempt to cancel when the update is received
+					{
+					iCancelOnPosUpdate = ETrue;
+					iFlagsToHaltOn =	KLbsCallback_NetSim_Got_Connect |
+										KLbsCallback_Got_NotifyPositionUpdate;
+					}
+					break;
+					
+				case 6:	// LBS-NotifyPosUpdateCellBased-0006	Request a cell-based location and cancel before a position update is generated
+					{
+					iCancelBeforePosUpdate = ETrue;
+					iFlagsToHaltOn =	KLbsCallback_NetSim_Got_Connect |
+										KLbsCallback_Got_NotifyPositionUpdate;
+					}
+					
+					break;			
+	
+				default:
+					User::Panic(KLbsClientStepCellBasedNotifyPosUpdate, KErrUnknown);			
+				}
+			}
+		else
+			{
+			User::Panic(KLbsClientStepCellBasedNotifyPosUpdate, KErrUnknown);
+			}	
+			
+		iIsCancelTest = (iCancel || iCancelBeforePosUpdate || iCancelOnPosUpdate);	
+		
+		// Steps common to all tests:
+		
+		// Connect to net sim
+		iNetSim.ConnectL(this);
+
+	// Configure NetSim:	
+		// Set reference location:
+		RPointerArray<TAny>& srcPosInfoArr = iParent.iSharedData->iVerifyPosInfoArr;
+		TPositionInfo* srcPosInfo = reinterpret_cast<TPositionInfo*>(srcPosInfoArr[0]);
+		TPosition srcPos;
+		srcPosInfo->GetPosition(srcPos);
+		if (!iNetSim.SetReferenceLocation(srcPos))
+			{
+			INFO_PRINTF1(_L("CT_LbsClientStep_CellBasedNotifyPosUpdate::doTestStepL() Failed: Can't set NetSim's reference location."));
+			SetTestStepResult(EFail);
+			}	
+		
+		// Set plugin to use for getting assistance data:
+		TUid pluginUid;
+		if(iParent.iSharedData->iTestModuleInUse)
+			{
+			pluginUid = TUid::Uid(KSimpleAssistanceDataProviderPluginUidValue);
+			}
+		else
+			{
+			pluginUid = TUid::Uid(KSuplAssistanceDataProviderPluginUidValue);
+			}
+		if (!iNetSim.SetAssistanceDataProvider(pluginUid))
+			{
+			INFO_PRINTF1(_L("Can't set NetSim's assistance data plugin uid."));
+			SetTestStepResult(EFail);
+			}
+			
+		// make network unavailable if appropriate:
+		if(iNetworkUnavailable)
+			{
+			// Tell netsim to make network unavailable until further notice:
+			if(!iNetSim.SetResponseError(RLbsNetSimTest::KNetSimNetworkNotAvailable, ETrue))	//sticky
+				{
+				INFO_PRINTF1(_L("CT_LbsClientStep_CellBasedNotifyPosUpdate::doTestStepL() Failed: Can't set NetSim's response error."));
+				SetTestStepResult(EFail);
+				}
+			}			
+			
+		// Kick off the keep alive timer - do last to ensure NetSim is ready otherwise the
+		// timer callback may start a MO-LR if the NetSim connected too early.
+		TTimeIntervalMicroSeconds32 interval(KLbsKeepAlivePeriod);
+
+		iKeepAliveTimer->SetTimer(interval);
+
+		// don't wait for TEF to timeout and abort
+		iAbortTimer->SetTimer(abortInterval);
+
+		// Kick off test.
+		CActiveScheduler::Start();
+			
+		if(EDone != iState)
+			{
+			INFO_PRINTF2(_L("Failed test, finished in state %d"), iState);
+			INFO_PRINTF3(_L("Callback flags currently set = 0x%x. Expecting 0x%x"), iCallbackFlags, iFlagsToHaltOn);
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			INFO_PRINTF2(_L("Got all expected callbacks (0x%x)"), iCallbackFlags);			
+			}
+						
+		iNetSim.Close();
+			
+		}
+		
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsClientStep_CellBasedNotifyPosUpdate::doTestStepL()"));
+
+	return TestStepResult();
+	}
+
+
+void CT_LbsClientStep_CellBasedNotifyPosUpdate::Connected()
+	{
+	// Call base implementation.
+	CT_LbsNetSimStep::Connected();
+			
+	if(iCancelBeforePosUpdate)
+		{
+		TPositionInfo* posInfo = new(ELeave) TPositionInfo();
+		iDoPosUpdate->StartL(*posInfo);
+	
+		iNumNPUDs--;
+	
+		// Wait for all expected callback flags to be set:
+		iState = CT_LbsNetSimStep::EWaiting;	
+		
+		// Cancel the request for the cancel test.
+		iDoPosUpdate->CancelRequest();
+		delete posInfo;
+		}
+	else
+		{
+		T_LbsUtils utils;
+		// Create a posinfo and store in our shared array for later verification.
+		RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+		TPositionInfo* posInfo = new(ELeave) TPositionInfo();
+		utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+		posInfoArr.Append(posInfo);
+		
+		iDoPosUpdate->StartL(*posInfo);
+	
+		iNumNPUDs--;
+	
+		// Wait for all expected callback flags to be set:
+		iState = CT_LbsNetSimStep::EWaiting;	
+		
+		// Cancel the request for the cancel test.
+		if(iCancel)				
+			{
+			User::After((TTimeIntervalMicroSeconds32)100000);   // arbitrary delay as workaround for DEF107349
+			iDoPosUpdate->CancelRequest();
+			}			
+		}
+	}
+	
+void CT_LbsClientStep_CellBasedNotifyPosUpdate::Disconnected()
+	{
+	// Call base implementation.
+	CT_LbsNetSimStep::Disconnected();
+	}
+
+void CT_LbsClientStep_CellBasedNotifyPosUpdate::NotifyRegisterLcsMoLr(const TDesC& aData)
+	{
+    if (!iIsCancelTest)
+    	{
+    	// Call base implementation.
+		CT_LbsNetSimStep::NotifyRegisterLcsMoLr(aData);
+    	}
+	}
+
+void CT_LbsClientStep_CellBasedNotifyPosUpdate::NotifyReleaseLcsMoLr(TInt aReason)
+	{
+	if (!iIsCancelTest)
+    	{
+		// Call base implementation.
+		CT_LbsNetSimStep::NotifyReleaseLcsMoLr(aReason);	
+    	}	
+	}
+
+// Measurement Control has been received from Network:
+void CT_LbsClientStep_CellBasedNotifyPosUpdate::NotifyMeasurementControlLocation(const TPositionInfo& aPosition, const RLbsAssistanceDataBuilderSet& aData, const TLbsNetPosRequestQuality& aQuality)
+	{
+	if (!iIsCancelTest)
+    	{
+		// Call base implementation.
+		CT_LbsNetSimStep::NotifyMeasurementControlLocation(aPosition, aData, aQuality);
+    	}
+	}
+
+void CT_LbsClientStep_CellBasedNotifyPosUpdate::NotifyReleaseLcsLocationNotification(const CLbsNetworkProtocolBase::TLbsPrivacyResponse& aResult)
+	{
+	if (!iIsCancelTest)
+    	{
+		// Call base implementation.
+		CT_LbsNetSimStep::NotifyReleaseLcsLocationNotification(aResult);
+    	}	
+	}
+
+void CT_LbsClientStep_CellBasedNotifyPosUpdate::NotifyFacilityLcsMoLrResult(TInt aReason, const TPositionInfo& aPosition)
+	{
+	if (!iIsCancelTest)
+    	{
+		// Call base implementation.
+		CT_LbsNetSimStep::NotifyFacilityLcsMoLrResult(aReason, aPosition);
+    	}
+	}
+
+// Our position has been reported to network
+void CT_LbsClientStep_CellBasedNotifyPosUpdate::NotifyMeasurementReportLocation(const TPositionInfo& aPosition)
+	{
+	if(iCancelOnPosUpdate)
+		{
+		iDoPosUpdate->CancelRequest();
+		}
+	if (!iIsCancelTest)
+    	{
+		// Call base implementation.
+		CT_LbsNetSimStep::NotifyMeasurementReportLocation(aPosition);
+    	}
+	}
+
+void CT_LbsClientStep_CellBasedNotifyPosUpdate::NotifyMeasurementReportRequestMoreAssistanceData(const TLbsAssistanceDataGroup& aFilter)
+	{
+	if (!iIsCancelTest)
+    	{
+		// Call base implementation.
+		CT_LbsNetSimStep::NotifyMeasurementReportRequestMoreAssistanceData(aFilter);
+    	}
+	}
+
+void CT_LbsClientStep_CellBasedNotifyPosUpdate::NotifyMeasurementReportControlFailure(TInt aReason)
+	{
+	if (!iIsCancelTest && !iMultiReq)
+    	{
+		// Call base implementation.
+		CT_LbsNetSimStep::NotifyMeasurementReportControlFailure(aReason);
+		}
+	else if (iMultiReq && ! ((aReason == KErrPositionHighPriorityReceive) || (aReason == KErrServerBusy)))
+		{
+		INFO_PRINTF2(_L("FAILED: NotifyMeasurementReportControlFailure with reason = %d"), aReason);
+		SetTestStepResult(EFail);
+		}
+	}
+
+void CT_LbsClientStep_CellBasedNotifyPosUpdate::NotifyError(MLbsNetSimTestObserver::EFunction aFunction, int aError)
+	{
+	// Call base implementation.
+	CT_LbsNetSimStep::NotifyError(aFunction, aError);
+	}
+
+void CT_LbsClientStep_CellBasedNotifyPosUpdate::ProcessMeasurementControlLocationError(TInt aError)
+	{
+	// Call base implementation.
+	CT_LbsNetSimStep::ProcessMeasurementControlLocationError(aError);
+	}
+
+/**	Notify position update callback.
+*/
+void CT_LbsClientStep_CellBasedNotifyPosUpdate::MT_LbsDoPosUpdateCallback(TRequestStatus& aStatus)
+	{
+	TInt err = aStatus.Int();
+	
+	INFO_PRINTF2(_L("CT_LbsClientStep_CellBasedNotifyPosUpdate::MT_LbsDoPosUpdateCallback: Got - Notify Update - Callback Event. Error = %d"), err);
+	
+	if(!iNumNPUDs)	// only set the flag when we've got them all
+		{
+		SetCallbackFlag(KLbsCallback_Got_NotifyPositionUpdate);
+		}
+		
+	if(iNetworkUnavailable)
+		{
+		if(KErrTimedOut != err && KErrDisconnected != err)
+			{
+			INFO_PRINTF2(_L("FAILED: MT_LbsDoPosUpdateCallback with error %d, expecting KErrTimedOut"), err);
+			SetTestStepResult(EFail);
+			}
+		}
+	else
+		{
+		if(iCancel)
+			{
+			if(KErrCancel != err && KErrNone != err)
+				{
+				INFO_PRINTF2(_L("FAILED: MT_LbsDoPosUpdateCallback with error = %d"), err);
+				SetTestStepResult(EFail);
+				}
+			}
+		else 
+			{
+			if(iCancelBeforePosUpdate)
+				{
+				if(KErrCancel != err)
+					{
+					INFO_PRINTF2(_L("FAILED: MT_LbsDoPosUpdateCallback with error = %d"), err);
+					SetTestStepResult(EFail);
+					}
+				}
+			else 
+				{
+				if(KErrNone != err)
+					{
+					INFO_PRINTF2(_L("FAILED: MT_LbsDoPosUpdateCallback with error = %d"), err);
+					SetTestStepResult(EFail);
+					}
+				}
+			}		
+		}
+	
+	if(iNumNPUDs--)
+		{	
+		// Create another posinfo and store in our shared array for later verification.
+		RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+		TPositionInfo* posInfo = new(ELeave) TPositionInfo();
+		posInfoArr.Append(posInfo);
+			
+		iDoPosUpdate->StartL(*posInfo);
+		}	
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientstepignoreaccurracysetting.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,450 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientstepignoreaccurracysetting.cpp
+// 
+//
+ 
+#include "ctlbsclientstepignoreaccurracysetting.h"
+
+#include <lbs.h>
+#include <lbssatellite.h>
+#include <lbsadmin.h>
+
+#include "tlbsutils.h"
+#include "ctlbsasyncwaiter.h"
+
+#define EXPECTED_GPS_ACCURACY_HORIZONTAL 10
+#define EXPECTED_GPS_ACCURACY_VERTICAL 10
+
+const TTimeIntervalMicroSeconds KModuleTimeout = 5000000;//makes test module time out(which should be more than the Maxtime in lbsprofile.ini)
+
+/**
+ * Construction.
+ */
+CT_LbsClientStep_IgnoreAccuracySetting* CT_LbsClientStep_IgnoreAccuracySetting::New(CT_LbsClientServer& aParent)
+	{
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	CT_LbsClientStep_IgnoreAccuracySetting* testStep = new CT_LbsClientStep_IgnoreAccuracySetting(aParent);
+	if (testStep)
+		{
+		TInt err = KErrNone;
+
+		TRAP(err, testStep->ConstructL());
+		if (err)
+			{
+			delete testStep;
+			testStep = NULL;
+			}
+		}
+		
+	return testStep;
+	}
+
+
+CT_LbsClientStep_IgnoreAccuracySetting::CT_LbsClientStep_IgnoreAccuracySetting(CT_LbsClientServer& aParent) 
+	: CT_LbsClientStep(aParent), iTestCaseId(0)
+	{
+	SetTestStepName(KLbsClientStep_IgnoreAccuracySetting);
+	}
+
+
+void CT_LbsClientStep_IgnoreAccuracySetting::ConstructL()
+	{
+	// Connect server.
+	User::LeaveIfError(iServer.Connect());
+	}
+
+
+/**
+ * Destructor
+ */
+CT_LbsClientStep_IgnoreAccuracySetting::~CT_LbsClientStep_IgnoreAccuracySetting()
+	{
+	iPositioner.Close();
+	CloseNetSim();
+	iServer.Close();	
+	}
+/**
+ * The set-up for the tests open the net sim, where required (the terminal based 
+ * tests) and open the connection to the server. Also it sets the update options 
+ * for the requests with those in the ini file. RPositioner is open through one 
+ * of the three APIs, depending on the tests
+ */
+TVerdict CT_LbsClientStep_IgnoreAccuracySetting::doTestStepPreambleL()
+	{
+	// Process some common pre setting to test steps then set SetTestStepResult to EFail or Epass.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsClientStep::doTestStepPreambleL()"));
+	SetTestStepResult(EPass);
+	T_LbsUtils utils;
+
+	if(GetIntFromConfig(ConfigSection(), KTestCaseId, iTestCaseId))
+		{
+		switch(iTestCaseId)
+			{ // open the network simulator for the tests that run in terminal based
+			case 151: // LBS-IGNORE-ACCURACY-ON-TERMINAL-BASED-001
+			case 152: // LBS-IGNORE-ACCURACY-ON-TERMINAL-BASED-002
+			case 153: // LBS-IGNORE-ACCURACY-ON-TERMINAL-BASED-003
+				{
+				CloseNetSim();
+				User::LeaveIfError(OpenNetSim());
+				break;
+				}
+			default:
+				{
+				}
+			}
+
+		switch(iTestCaseId)
+			{ // open the positioner for the tests that are doing a position update
+			  // the positioner is opened through the required API for each test
+			case 1: // LBS-IGNORE-ACCURACY-ENABLED-001
+			case 2: // LBS-IGNORE-ACCURACY-DISABLED-001
+				{ // do nothing, these tests don't ask for a position update
+				break;
+				}
+			case 3: // LBS-IGNORE-ACCURACY-ABSENT-001
+			case 101: // LBS-MOLR-IGNORE-ACCURACY-ON-ACCURATE-001
+			case 104: // LBS-MOLR-IGNORE-ACCURACY-ON-INACCURATE-001
+			case 107: // LBS-MOLR-IGNORE-ACCURACY-ON-TIMEOUT-001
+			case 110: // LBS-IGNORE-ACCURACY-ON-PARTIAL-UPDATE-001
+			case 111: // LBS-IGNORE-ACCURACY-ON-PARTIAL-UPDATE-002
+			case 114: // LBS-IGNORE-ACCURACY-ON-EARLY-COMPLETE-001
+			case 151: // LBS-IGNORE-ACCURACY-ON-TERMINAL-BASED-001
+			case 201: // LBS-MOLR-IGNORE-ACCURACY-OFF-ACCURATE-001
+			case 204: // LBS-MOLR-IGNORE-ACCURACY-OFF-INACCURATE-001
+			case 207: // LBS-MOLR-IGNORE-ACCURACY-OFF-TIMEOUT-001
+			case 210: // LBS-IGNORE-ACCURACY-OFF-PARTIAL-UPDATE-001
+			case 211: // LBS-IGNORE-ACCURACY-OFF-PARTIAL-UPDATE-002
+			case 214: // LBS-IGNORE-ACCURACY-OFF-EARLY-COMPLETE-001
+				{
+				User::LeaveIfError(iPositioner.Open(iServer));
+				break;
+				}
+			case 102: // LBS-MOLR-IGNORE-ACCURACY-ON-ACCURATE-002
+			case 105: // LBS-MOLR-IGNORE-ACCURACY-ON-INACCURATE-002
+			case 108: // LBS-MOLR-IGNORE-ACCURACY-ON-TIMEOUT-002
+			case 152: // LBS-IGNORE-ACCURACY-ON-TERMINAL-BASED-002
+			case 202: // LBS-MOLR-IGNORE-ACCURACY-OFF-ACCURATE-002
+			case 205: // LBS-MOLR-IGNORE-ACCURACY-OFF-INACCURATE-002
+			case 208: // LBS-MOLR-IGNORE-ACCURACY-OFF-TIMEOUT-002
+				{
+				TPositionModuleId networkModuleId = utils.GetAGpsModuleIdL(iServer);
+				User::LeaveIfError(iPositioner.Open(iServer, networkModuleId));
+				break;
+				}
+			case 103: // LBS-MOLR-IGNORE-ACCURACY-ON-ACCURATE-003
+			case 106: // LBS-MOLR-IGNORE-ACCURACY-ON-INACCURATE-003
+			case 109: // LBS-MOLR-IGNORE-ACCURACY-ON-TIMEOUT-003
+			case 153: // LBS-IGNORE-ACCURACY-ON-TERMINAL-BASED-003
+			case 203: // LBS-MOLR-IGNORE-ACCURACY-OFF-ACCURATE-003
+			case 206: // LBS-MOLR-IGNORE-ACCURACY-OFF-INACCURATE-003
+			case 209: // LBS-MOLR-IGNORE-ACCURACY-OFF-TIMEOUT-003
+				{
+				TPositionCriteria criteria;
+				TPositionQuality    quality;
+				// set up the required accuracy
+				quality.SetHorizontalAccuracy(EXPECTED_GPS_ACCURACY_HORIZONTAL);
+				quality.SetVerticalAccuracy(EXPECTED_GPS_ACCURACY_VERTICAL);
+				criteria.SetRequiredQuality(quality);
+				User::LeaveIfError(iPositioner.Open(iServer, criteria));
+				break;
+				}
+			default:
+				{
+				SetTestStepResult(EFail);
+				}
+			}
+		if(iTestCaseId != 1 && iTestCaseId !=2)
+			{ // Loading the update options for all tests, except those that 
+			  // don't request a position update
+			TPtrC configFileName;
+			_LIT(KUpdateOptionsFile, "pos_infos_file");
+
+			GetStringFromConfig(ConfigSection(), KUpdateOptionsFile, configFileName);
+			
+			TPositionUpdateOptions updateOpts;
+
+			utils.GetConfigured_ModuleUpdateOptionsL(configFileName, ConfigSection(), updateOpts);
+			iPositioner.SetUpdateOptions(updateOpts);
+			}
+		}
+	else
+		{
+		SetTestStepResult(EFail);
+		}
+
+	return TestStepResult();
+	}
+	
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsClientStep_IgnoreAccuracySetting::doTestStepL()
+	{
+	// Generic test step used to test the LBS SetUpdateOptions API.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsClientStep_IgnoreAccuracySetting::doTestStepL()"));
+
+	if(iTestCaseId == 1 || iTestCaseId == 2)
+		{ // Testing the ignore accuracy setting is as required
+		CLbsAdmin* lbsAdmin = CLbsAdmin::NewL();
+		CleanupStack::PushL(lbsAdmin);
+		CLbsAdmin::TSpecialFeature ignoreAccuracySetting;
+		TInt err = lbsAdmin->Get(KLbsSpecialFeatureIgnoreAccuracy, ignoreAccuracySetting);
+		if(err != KErrNone)
+			{
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			switch(iTestCaseId)
+				{
+				case 1:  // LBS-IGNORE-ACCURACY-ENABLED-001
+					{
+					if(ignoreAccuracySetting != CLbsAdmin::ESpecialFeatureOn)
+						{
+						SetTestStepResult(EFail);
+						}
+					break;
+					}
+				case 2:  // LBS-IGNORE-ACCURACY-DISABLED-001
+					{
+					if(ignoreAccuracySetting != CLbsAdmin::ESpecialFeatureOff)
+						{
+						SetTestStepResult(EFail);
+						}					
+					break;
+					}
+				default:
+					{
+					SetTestStepResult(EFail);
+					}
+				}
+			}
+		
+		CleanupStack::PopAndDestroy(lbsAdmin);
+		}
+	else
+		{
+		// Testing the ignore accuracy setting is absent
+		if(iTestCaseId == 3)
+			{ // Testing the ignore accuracy setting is absent
+			CLbsAdmin* lbsAdmin = CLbsAdmin::NewL();
+			CleanupStack::PushL(lbsAdmin);
+			TInt err(KErrNone);
+			CLbsAdmin::TSpecialFeature ignoreAccuracySetting;
+			err = lbsAdmin->Get(KLbsSpecialFeatureIgnoreAccuracy, ignoreAccuracySetting);
+			if(err != KErrNone || ignoreAccuracySetting != CLbsAdmin::ESpecialFeatureOff)
+				{
+				SetTestStepResult(EFail);
+				}
+			CleanupStack::PopAndDestroy(lbsAdmin);
+			}
+
+		switch(iTestCaseId)
+			{ // Requesting the module to delay it's response so we get a time-out
+			case 107: // LBS-MOLR-IGNORE-ACCURACY-ON-TIMEOUT-001
+			case 108: // LBS-MOLR-IGNORE-ACCURACY-ON-TIMEOUT-002
+			case 109: // LBS-MOLR-IGNORE-ACCURACY-ON-TIMEOUT-003
+			case 207: // LBS-MOLR-IGNORE-ACCURACY-OFF-TIMEOUT-001
+			case 208: // LBS-MOLR-IGNORE-ACCURACY-OFF-TIMEOUT-002
+			case 209: // LBS-MOLR-IGNORE-ACCURACY-OFF-TIMEOUT-003
+				{
+				if (iParent.iSharedData->iTestModuleInUse)
+					{
+					T_LbsUtils utils;
+					TModuleDataIn modDataIn;
+	
+					modDataIn.iRequestType = TModuleDataIn::EModuleRequestTimeOut;
+					modDataIn.iTimeOut = KModuleTimeout;
+				
+					utils.NotifyModuleOfConfigChangeL(modDataIn);	// This will block.
+					}
+				else
+					{
+					SetTestStepResult(EFail);
+					}
+				break;
+				}
+			default:
+				{
+				break;
+				}
+			}
+	
+		if (TestStepResult()==EPass) 
+			{
+			T_LbsUtils utils;
+
+			// Create a posinfo and store in our shared array for later verification.
+			RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+			// The posInfo shouldn't be put on the cleanup stack because ownership is passed to the parent
+			TPositionInfo* posInfo = new(ELeave) TPositionInfo();
+	
+			utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+	
+			posInfoArr.Append(posInfo);
+			TInt err;
+			
+			// Request a position update
+			switch(iTestCaseId)
+				{
+				case 114: // LBS-IGNORE-ACCURACY-ON-EARLY-COMPLETE-001
+				case 214: // LBS-IGNORE-ACCURACY-OFF-EARLY-COMPLETE-001
+					{ // In the early complete tests we request for a position
+					  // update in a different way so the client can complete 
+					  // the request early
+					err = DoNotifyUpdateL(*posInfo);
+					if(err != KPositionPartialUpdate)
+						{
+						SetTestStepResult(EFail);
+						break;
+						}
+					
+					TRequestStatus status;
+					iPositioner.NotifyPositionUpdate(*posInfo, status);
+					
+					err = iPositioner.CompleteRequest(EPositionerNotifyPositionUpdate);
+					if(err != KErrNone)
+						{
+						SetTestStepResult(EFail);
+						}
+					// this should complete with either KErrNone or KErrCancel
+					User::WaitForRequest(status);
+					
+					err = status.Int();
+					break;
+					}
+				default:
+					{
+					// Get the actual position
+					err = DoNotifyUpdateL(*posInfo);
+					}
+				}
+
+			if(iTestCaseId == 151 || iTestCaseId == 153)
+				{ // expect reference position in the appropiate terminal based tests
+				if(KErrNone != err)
+					{
+					SetTestStepResult(EFail);
+					}
+				else
+					{
+					// Verify reference position.
+					TPositionInfo verifyRefPosInfo;
+					verifyRefPosInfo.SetPosition(iRefPos);
+
+					if (!utils.Compare_PosInfo(verifyRefPosInfo, *posInfo))
+						{
+						if(!iParent.iSharedData->iTestModuleInUse)
+							{
+							WARN_PRINTF1(_L("WARNING: position received was not reference position"));	
+							}
+						else
+							{	
+							INFO_PRINTF1(_L("Failed test, reference position incorrect."));
+							SetTestStepResult(EFail);
+							}
+						}
+					}
+				err = DoNotifyUpdateL(*posInfo);
+				}
+
+			// check we receive the appropiate error code from the request we made
+			switch(iTestCaseId)
+				{
+				case 101: // LBS-MOLR-IGNORE-ACCURACY-ON-ACCURATE-001
+				case 104: // LBS-MOLR-IGNORE-ACCURACY-ON-INACCURATE-001
+				case 201: // LBS-MOLR-IGNORE-ACCURACY-OFF-ACCURATE-001
+				case 102: // LBS-MOLR-IGNORE-ACCURACY-ON-ACCURATE-002
+				case 105: // LBS-MOLR-IGNORE-ACCURACY-ON-INACCURATE-002
+				case 151: // LBS-IGNORE-ACCURACY-ON-TERMINAL-BASED-001
+				case 152: // LBS-IGNORE-ACCURACY-ON-TERMINAL-BASED-002
+				case 153: // LBS-IGNORE-ACCURACY-ON-TERMINAL-BASED-003
+				case 202: // LBS-MOLR-IGNORE-ACCURACY-OFF-ACCURATE-002
+				case 103: // LBS-MOLR-IGNORE-ACCURACY-ON-ACCURATE-003
+				case 106: // LBS-MOLR-IGNORE-ACCURACY-ON-INACCURATE-003
+				case 203: // LBS-MOLR-IGNORE-ACCURACY-OFF-ACCURATE-003
+					{
+					if (KErrNone != err)
+						{
+						INFO_PRINTF2(_L("Failed test, error = %d."), err);
+						SetTestStepResult(EFail);
+						}
+					break;
+					}
+				case 107: // LBS-MOLR-IGNORE-ACCURACY-ON-TIMEOUT-001
+				case 108: // LBS-MOLR-IGNORE-ACCURACY-ON-TIMEOUT-002
+				case 109: // LBS-MOLR-IGNORE-ACCURACY-ON-TIMEOUT-003
+				case 207: // LBS-MOLR-IGNORE-ACCURACY-OFF-TIMEOUT-001
+				case 208: // LBS-MOLR-IGNORE-ACCURACY-OFF-TIMEOUT-002
+				case 209: // LBS-MOLR-IGNORE-ACCURACY-OFF-TIMEOUT-003
+					{
+					if (KErrTimedOut != err)
+						{
+						INFO_PRINTF2(_L("Failed test, expected KErrTimedOut, got error = %d."), err);
+						SetTestStepResult(EFail);
+						}
+					break;
+					}
+				case 3: // LBS-IGNORE-ACCURACY-ABSENT-001
+				case 110: // LBS-IGNORE-ACCURACY-ON-PARTIAL-UPDATE-001
+				case 204: // LBS-MOLR-IGNORE-ACCURACY-OFF-INACCURATE-001
+				case 205: // LBS-MOLR-IGNORE-ACCURACY-OFF-INACCURATE-002
+				case 206: // LBS-MOLR-IGNORE-ACCURACY-OFF-INACCURATE-003
+				case 210: // LBS-IGNORE-ACCURACY-OFF-PARTIAL-UPDATE-001
+					{
+					if (KPositionQualityLoss != err)
+						{
+						INFO_PRINTF2(_L("Failed test, expected KPositionQualityLoss, got error = %d."), err);
+						SetTestStepResult(EFail);
+						}
+					break;
+					}
+				case 111: // LBS-IGNORE-ACCURACY-ON-PARTIAL-UPDATE-002
+				case 211: // LBS-IGNORE-ACCURACY-OFF-PARTIAL-UPDATE-002
+					{
+					if (KPositionPartialUpdate != err)
+						{
+						INFO_PRINTF2(_L("Failed test, expected KPositionPartialUpdate, got error = %d."), err);
+						SetTestStepResult(EFail);
+						}
+					break;
+					}
+				case 114: // LBS-IGNORE-ACCURACY-ON-EARLY-COMPLETE-001
+				case 214: // LBS-IGNORE-ACCURACY-OFF-EARLY-COMPLETE-001
+					{
+					if (KPositionEarlyComplete != err)
+						{
+						INFO_PRINTF2(_L("Failed test, expected KPositionEarlyComplete, got error = %d."), err);
+						SetTestStepResult(EFail);
+						}
+					break;
+					}
+				default:
+					{
+					INFO_PRINTF2(_L("Failed test, unexpected Test Case Id %d"), iTestCaseId);
+					SetTestStepResult(EFail);
+					}
+				}
+			}
+		}
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsClientStep_IgnoreAccuracySetting::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientstepignoreaccurracysettingtracking.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,219 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientstepignoreaccurracysetting.cpp
+// 
+//
+ 
+#include "ctlbsclientstepignoreaccurracysettingtracking.h"
+
+#include <lbs.h>
+#include <lbssatellite.h>
+
+#include "tlbsutils.h"
+#include "ctlbsasyncwaiter.h"
+
+_LIT(KUpdateArraySection, "update_array_section");
+
+/**
+ * Construction.
+ */
+CT_LbsClientStep_IgnoreAccuracySettingTracking* CT_LbsClientStep_IgnoreAccuracySettingTracking::New(CT_LbsClientServer& aParent)
+	{
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	CT_LbsClientStep_IgnoreAccuracySettingTracking* testStep = new CT_LbsClientStep_IgnoreAccuracySettingTracking(aParent);
+	if (testStep)
+		{
+		TInt err = KErrNone;
+
+		TRAP(err, testStep->ConstructL());
+		if (err)
+			{
+			delete testStep;
+			testStep = NULL;
+			}
+		}
+		
+	return testStep;
+	}
+
+
+CT_LbsClientStep_IgnoreAccuracySettingTracking::CT_LbsClientStep_IgnoreAccuracySettingTracking(CT_LbsClientServer& aParent) 
+	: CT_LbsClientStep(aParent), iTestCaseId(0)
+	{
+	SetTestStepName(KLbsClientStep_IgnoreAccuracySettingTracking);
+	}
+
+
+void CT_LbsClientStep_IgnoreAccuracySettingTracking::ConstructL()
+	{
+	// Connect server.
+	User::LeaveIfError(iServer.Connect());
+	}
+
+
+/**
+ * Destructor
+ */
+CT_LbsClientStep_IgnoreAccuracySettingTracking::~CT_LbsClientStep_IgnoreAccuracySettingTracking()
+	{
+	for(TInt index = 0; index < iExpectedUpdateArray.Count(); ++index)
+		{
+		delete iExpectedUpdateArray[index];
+		}
+	iExpectedUpdateArray.Close();
+	iPositioner.Close();
+	iServer.Close();	
+	}
+
+TVerdict CT_LbsClientStep_IgnoreAccuracySettingTracking::doTestStepPreambleL()
+	{
+	// Process some common pre setting to test steps then set SetTestStepResult to EFail or Epass.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsClientStep::doTestStepPreambleL()"));
+	SetTestStepResult(EPass);
+
+	if(GetIntFromConfig(ConfigSection(), KTestCaseId, iTestCaseId))
+		{
+		switch(iTestCaseId)
+			{
+			case 112: // LBS-IGNORE-ACCURACY-ON-TRACKING-001
+			case 212: // LBS-IGNORE-ACCURACY-OFF-TRACKING-001
+				{ // do nothing
+				User::LeaveIfError(iPositioner.Open(iServer));
+
+				T_LbsUtils utils;
+				TPtrC configFileName;
+				_LIT(KUpdateOptionsFile, "pos_infos_file");
+
+				GetStringFromConfig(ConfigSection(), KUpdateOptionsFile, configFileName);
+				
+				TPositionUpdateOptions updateOpts;
+
+				utils.GetConfigured_ModuleUpdateOptionsL(configFileName, ConfigSection(), updateOpts);
+				iPositioner.SetUpdateOptions(updateOpts);
+				
+				TPtrC updateArraySection;
+				GetStringFromConfig(ConfigSection(), KUpdateArraySection, updateArraySection);
+				
+				utils.GetConfigured_PosInfosL(configFileName, updateArraySection, iExpectedUpdateArray);
+
+				break;
+				}
+			default:
+				{
+				SetTestStepResult(EFail);
+				}
+			}
+		}
+	else
+		{
+		SetTestStepResult(EFail);
+		}
+
+	return TestStepResult();
+	}
+	
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsClientStep_IgnoreAccuracySettingTracking::doTestStepL()
+	{
+	// Generic test step used to test the LBS SetUpdateOptions API.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsClientStep_IgnoreAccuracySettingTracking::doTestStepL()"));
+
+	if (TestStepResult()==EPass) 
+		{
+		T_LbsUtils utils;
+		TPositionInfo* posInfo = new(ELeave) TPositionInfo();
+		CleanupStack::PushL(posInfo);
+
+		// Perfom test.
+		TInt err = KErrNone;
+		TPosition pos;
+		TInt numOfPosInfos = 5;
+
+		for(TInt updateIndex = 0 ; TestStepResult()==EPass && updateIndex < numOfPosInfos; 
+											++updateIndex)
+			{
+			// Do request to position update.
+			err = DoNotifyUpdateL(*posInfo);
+
+			switch(iTestCaseId)
+				{
+				case 212: // LBS-IGNORE-ACCURACY-OFF-TRACKING-001
+					{
+					switch(updateIndex)
+						{
+						case 0:
+						case 1:
+						case 3:
+							{
+							if(KPositionQualityLoss != err)
+								{
+								SetTestStepResult(EFail);
+								}
+							break;
+							}
+						case 2:
+						case 4:
+							{
+							if(KErrNone != err)
+								{
+								SetTestStepResult(EFail);
+								}
+							break;
+							}
+						default:
+							{
+							SetTestStepResult(EFail);
+							}
+						}
+					TPositionInfoBase* expectedPosition = 
+						static_cast<TPositionInfoBase*>(iExpectedUpdateArray[updateIndex]);
+					if(!utils.Compare_PosInfo(*posInfo, *expectedPosition))
+						{
+						SetTestStepResult(EFail);
+						}
+					break;
+					}
+				case 112: // LBS-IGNORE-ACCURACY-ON-TRACKING-001
+					{
+					if(KErrNone != err)
+						{
+						SetTestStepResult(EFail);
+						}
+					TPositionInfoBase* expectedPosition = 
+						static_cast<TPositionInfoBase*>(iExpectedUpdateArray[updateIndex]);
+					if(!utils.Compare_PosInfo(*posInfo, *expectedPosition))
+						{
+						SetTestStepResult(EFail);
+						}
+					break;
+					}
+				default:
+					{
+					SetTestStepResult(EFail);
+					}
+				}
+			}
+		CleanupStack::PopAndDestroy(posInfo);
+		}
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsClientStep_IgnoreAccuracySettingTracking::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientsteplastknownpos.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,728 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientstep_lastknownpos.cpp
+// This is the class implementation for the Last Known Position Tests
+// 
+//
+ 
+#include "ctlbsclientsteplastknownpos.h"
+
+#include <lbs.h>
+#include "lbsadmin.h"
+#include "lbssatellite.h"
+#include "tlbsutils.h"
+#include "ctlbsasyncwaiter.h"
+
+/**
+ * Destructor
+ */
+CT_LbsClientStep_LastKnownPos::~CT_LbsClientStep_LastKnownPos()
+	{
+	}
+
+
+/**
+ * Constructor
+ */
+CT_LbsClientStep_LastKnownPos::CT_LbsClientStep_LastKnownPos(CT_LbsClientServer& aParent) : CT_LbsClientStep(aParent)
+	{
+	SetTestStepName(KLbsClientStep_LastKnownPos);
+	}
+
+
+/**
+Static Constructor
+*/
+CT_LbsClientStep_LastKnownPos* CT_LbsClientStep_LastKnownPos::New(CT_LbsClientServer& aParent)
+	{
+	return new CT_LbsClientStep_LastKnownPos(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+void CT_LbsClientStep_LastKnownPos::SwitchOnselfLocateAPIL()
+	{
+	CLbsAdmin* adminApi = CLbsAdmin::NewL();
+	CleanupStack::PushL(adminApi);
+	adminApi->Set(KLbsSettingHomeSelfLocate, CLbsAdmin::ESelfLocateOn);	
+	CleanupStack::PopAndDestroy(adminApi);
+	}
+
+
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsClientStep_LastKnownPos::doTestStepL()
+	{
+	// Generic test step used to test the LBS Client Notify position update API.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsClientStep_LastKnownPos::doTestStepL()"));
+
+	if (TestStepResult() == EPass)
+		{
+		TInt err = KErrNone;
+		
+		// Wait for server to cease to be - thus ensuring cache is empty
+		//User::After(10000000);   //Not needed
+		
+		// Carryout unique test actions.
+		TInt testCaseId;
+		if (GetIntFromConfig(ConfigSection(), KTestCaseId, testCaseId))
+			{
+			if(testCaseId == 2)
+				{
+				//The delay below is to make sure that there is no request to server for at least 200 seconds
+				//so that it will shutdown and clear cache.
+
+				User::After(3*1000*1000);
+				}
+
+			// Connect to self locate server.
+			User::LeaveIfError(iServer.Connect());
+			CleanupClosePushL(iServer);
+				
+			switch (testCaseId)
+				{
+				// Test case LBS-LastKnownPos-0001
+				case 1:
+				// Test case LBS-LastKnownPos-0101
+				case 101:
+				    {
+					T_LbsUtils utils;
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+                    if(testCaseId==101)
+	                    {
+	                    // For this test an additional reference position will be returned.
+					
+						// Setup netsim.
+						User::LeaveIfError(OpenNetSim());
+							
+						// Request notify for the expected reference position.
+						TPositionInfo actualRefPosInfo;
+							
+						err = DoNotifyUpdateL(actualRefPosInfo);
+						if (err)
+							{
+							INFO_PRINTF2(_L("Failed test, reference position request returned err %d."), err);
+							SetTestStepResult(EFail);							
+							}
+								
+						// Verify reference position.
+						TPositionInfo verifyRefPosInfo;
+							
+						verifyRefPosInfo.SetPosition(iRefPos);
+						if (!utils.Compare_PosInfo(verifyRefPosInfo, actualRefPosInfo))
+							{
+							INFO_PRINTF1(_L("Failed test, reference position incorrect."));
+							SetTestStepResult(EFail);
+							}	
+	                    }
+					
+					
+				    TPosition pos;		// original position
+					TTime timeStamp;	// timestamp inside original received position
+					
+				    // Carry out a notify update to ensure last known cache is filled.
+					TPositionInfo notifyPosInfo;
+					User::LeaveIfError(DoNotifyUpdateL(notifyPosInfo));
+
+					// get the position data:
+					notifyPosInfo.GetPosition(pos);
+					
+					timeStamp = pos.Time();
+					INFO_PRINTF1(_L("Original position timeStamp: "));
+					INFO_PRINTF4(_L("%d/%d/%d"), timeStamp.DateTime().Day() + 1, timeStamp.DateTime().Month() + 1, timeStamp.DateTime().Year());
+					INFO_PRINTF5(_L("at %d :%d :%d :%d"), timeStamp.DateTime().Hour(), timeStamp.DateTime().Minute(), timeStamp.DateTime().Second(), timeStamp.DateTime().Second());
+						
+					// Create a posinfo and store in our shared array for later verification.
+					RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+					TPositionInfo* posInfo = new(ELeave) TPositionInfo();
+	
+					utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+
+					posInfoArr.Append(posInfo);
+
+					// Get the last known position
+					err = DoLastKnownPosL(*posInfo);
+					if (KErrNone != err)
+						{
+						SetTestStepResult(EFail);
+						}
+					else
+						{								
+						TTime timeStamp_cached;		
+						posInfo->GetPosition(pos);	
+						timeStamp_cached = pos.Time();
+						
+						timeStamp = pos.Time();
+						INFO_PRINTF1(_L("Cached position timeStamp: "));
+						INFO_PRINTF4(_L("%d/%d/%d"), timeStamp_cached.DateTime().Day() + 1, timeStamp_cached.DateTime().Month() + 1, timeStamp_cached.DateTime().Year());
+						INFO_PRINTF5(_L("at %d :%d :%d :%d"), timeStamp_cached.DateTime().Hour(), timeStamp_cached.DateTime().Minute(), timeStamp_cached.DateTime().Second(), timeStamp_cached.DateTime().Second());
+													
+						// verify that the timestamp matches the original one:
+						if(timeStamp_cached != timeStamp)
+							{
+							SetTestStepResult(EFail);
+							}
+						
+						}
+					CleanupStack::PopAndDestroy(&iPositioner);
+					if (testCaseId == 101)
+						{
+						CloseNetSim();
+						}
+					break;
+					}
+				
+				// NEGATIVE TEST
+				// Test case LBS-LastKnownPos-0002
+				case 2:
+					{
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+
+					// DONT carry out a notify update to ensure last known cache is filled.
+
+					// Create a posinfo to store position info from LastKnownPosition method.
+					TPositionInfo posInfo;
+
+					// Get the last known position
+					err = DoLastKnownPosL(posInfo);
+					if (KErrUnknown != err)
+						{
+						INFO_PRINTF2(_L("Failed with error %d when expecting error KErrUnknown, indicating no position in cache"), err);
+						SetTestStepResult(EFail);
+						}
+						
+					// Wait for a time period and verify that location info is not published.
+					// 10seconds
+					User::After(10000000);
+					
+					// Get the last known position
+					err = DoLastKnownPosL(posInfo);
+					if (KErrUnknown != err)
+						{
+						INFO_PRINTF2(_L("Failed with error %d when expecting error KErrUnknown, indicating no position in cache"), err);
+						SetTestStepResult(EFail);
+						}
+						
+					CleanupStack::PopAndDestroy(&iPositioner);
+					break;
+					}
+					
+
+				// NEGATIVE TEST	
+				// Test case LBS-LastKnownPos-0004
+				case 4:
+					{
+					T_LbsUtils utils;
+					TPositionModuleId networkModuleId = utils.GetNetworkModuleIdL(iServer);
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer, networkModuleId));
+					CleanupClosePushL(iPositioner);
+
+					// Setup netsim.
+					User::LeaveIfError(OpenNetSim());
+						
+					// Carry out a notify update to ensure last known cache is filled.
+					TPositionInfo actualRefPosInfo;
+						
+					err = DoNotifyUpdateL(actualRefPosInfo);
+										
+					if (err)
+						{
+						INFO_PRINTF2(_L("Failed test, reference position request returned err %d."), err);
+						SetTestStepResult(EFail);							
+						}
+							
+					// Verify reference position.
+					TPositionInfo verifyRefPosInfo;
+					verifyRefPosInfo.SetPosition(iRefPos);
+					if (!utils.Compare_PosInfo(verifyRefPosInfo, actualRefPosInfo))
+						{
+						INFO_PRINTF1(_L("Failed test, reference position incorrect."));
+						SetTestStepResult(EFail);
+						}
+				    
+				    // ** Create a position info which is not supported by the network module **
+					TPositionSatelliteInfo positionSatelliteInfo;
+
+					// Get the last known position
+					err = DoLastKnownPosL(positionSatelliteInfo);
+					if (KErrArgument != err)
+						{
+						SetTestStepResult(EFail);
+						}
+												
+					CleanupStack::PopAndDestroy(&iPositioner);
+					// Close netsim.
+					CloseNetSim();
+					break;
+					}
+									
+				// Test case LBS-LastKnownPos-0006
+				case 6:
+					{
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+											
+					CLbsAdmin* adminApi = CLbsAdmin::NewL();
+					CleanupStack::PushL(adminApi);
+					
+					adminApi->Set(KLbsSettingHomeSelfLocate, CLbsAdmin::ESelfLocateOff);
+					
+					TPositionInfo posInfo;
+
+					// Get the last known position
+					err = DoLastKnownPosL(posInfo);
+					if (KErrAccessDenied != err)
+						{
+						SetTestStepResult(EFail);
+						}
+
+					CleanupStack::PopAndDestroy(adminApi);
+					CleanupStack::PopAndDestroy(&iPositioner);
+
+					SwitchOnselfLocateAPIL();
+
+					break;		
+					}
+
+				// Test case LBS-LastKnownPos-0007
+				case 7:
+				// Test case LBS-LastKnownPos-0102
+				case 102:
+					{
+					T_LbsUtils utils;
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+                    if(testCaseId==102)
+	                    {
+	                    // For this test an additional reference position will be returned.
+					
+						// Setup netsim.
+						User::LeaveIfError(OpenNetSim());
+							
+						// Request notify for the expected reference position.
+						TPositionInfo actualRefPosInfo;
+							
+						err = DoNotifyUpdateL(actualRefPosInfo);
+						if (err)
+							{
+							INFO_PRINTF2(_L("Failed test, reference position request returned err %d."), err);
+							SetTestStepResult(EFail);							
+							}
+								
+						// Verify reference position.
+						TPositionInfo verifyRefPosInfo;
+							
+						verifyRefPosInfo.SetPosition(iRefPos);
+						if (!utils.Compare_PosInfo(verifyRefPosInfo, actualRefPosInfo))
+							{
+							INFO_PRINTF1(_L("Failed test, reference position incorrect."));
+							SetTestStepResult(EFail);
+							}	
+	                    }
+														
+					// Carry out a notify update to ensure last known cache is filled.
+					TPositionInfo notifyPosInfo;
+					TInt err = DoNotifyUpdateL(notifyPosInfo);
+					User::LeaveIfError(err);
+
+					// Create a posinfo and store in our shared array for later verification.
+					RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+					TPositionInfo* posInfo = new(ELeave) TPositionInfo();
+
+				
+					utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+
+					posInfoArr.Append(posInfo);
+
+					// Get the last known position
+					CT_LbsAsyncWaiter*	waiter = CT_LbsAsyncWaiter::NewL();
+					CleanupStack::PushL(waiter);
+
+					User::LeaveIfError(iPositioner.SetRequestor(	CRequestor::ERequestorService,
+																	CRequestor::EFormatApplication,
+																	_L("Tom Tom")));
+																	
+					iPositioner.GetLastKnownPosition(*posInfo, waiter->iStatus);
+									
+					TInt errCancel = iPositioner.CancelRequest(EPositionerGetLastKnownPosition);
+						
+					waiter->StartAndWait();
+
+					TInt errLkp = waiter->Result();
+
+					CleanupStack::PopAndDestroy(waiter);
+					
+					// Sync Cancel() call returns either KErrNone or KErrNotFound. 
+					if ( errCancel != KErrNone && errCancel != KErrNotFound )
+						{
+						INFO_PRINTF1(_L("<FONT><B>Cancel must return KErrNone or KErrNotFound</B></FONT>"));
+						SetTestStepResult(EFail);									
+						}
+					// If Cancel() returns KErrNone, then the original request may complete with KErrCancel.
+					if (errCancel != KErrNone &&  (errLkp != KErrCancel && errLkp != KErrNone )  )
+						{
+						INFO_PRINTF1(_L("<FONT><B>Cancel must return KErrCancel or KErrNone</B></FONT>"));
+						SetTestStepResult(EFail);									
+						}
+						
+						
+					CleanupStack::PopAndDestroy(&iPositioner);
+					if (testCaseId == 102)
+						{
+						CloseNetSim();
+						}			
+					break;		
+					}		
+					
+				// Test case LBS-LastKnownPos-0008
+				case 8:
+					{
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+
+					// DONT get the last known position, but DO cancel
+					err = iPositioner.CancelRequest(EPositionerNotifyPositionUpdate);
+					
+					if (KErrNotFound != err)
+						{
+						//Didnt cancel or complete successfully.
+						SetTestStepResult(EFail);
+						}
+
+					CleanupStack::PopAndDestroy(&iPositioner);
+									
+					break;		
+					}	
+					
+
+				// Test case LBS-LastKnownPos-0009
+				case 9:
+					{
+					//DONT open connection to Position Server
+
+					TPositionInfo posInfo;
+
+					// Get the last known position, THIS SHOULD PANIC WITH EPositionServerBadHandle
+					TRequestStatus status;
+					iPositioner.GetLastKnownPosition(posInfo, status);
+					err = iPositioner.CancelRequest(EPositionerNotifyPositionUpdate);
+
+					if (KErrNone == err)
+						{
+						//Completed Successfully.
+						SetTestStepResult(EFail);
+						}
+
+					CleanupStack::PopAndDestroy(&iPositioner);
+					
+					SwitchOnselfLocateAPIL();
+					
+					break;		
+					}	
+					
+
+				// Test case LBS-LastKnownPos-0012
+				case 12:
+					{
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+
+					// Carry out a notify update to ensure last known cache is filled.
+					TPositionInfo notifyPosInfo;
+					User::LeaveIfError(DoNotifyUpdateL(notifyPosInfo));
+
+					TPositionInfo posInfo;
+
+					// Get the last known position while self Locate Server is busy
+					err = DoLastKnownPosL(posInfo);
+
+					if (KErrServerBusy != err)
+						{
+						// Completed successfully.
+						INFO_PRINTF1(_L("<FONT><B>**Test should pass if GetLastKnownPosition() fails with KErrServerBusy **</B></FONT>"));
+						SetTestStepResult(EFail);
+						}
+					CleanupStack::PopAndDestroy(&iPositioner);
+					break;	
+					}
+			
+			
+				// Test case LBS-LastKnownPos-0014
+				case 14:
+					{
+					// Testcase placeholder
+					// Request multiples LKPs from different clients concurrently 
+					SetTestStepResult(EFail);						
+					break;
+					}
+			
+			
+				// Test case LBS-LastKnownPos-0015
+				case 15:
+				// Test case LBS-LastKnownPos-0103
+				case 103:
+					{
+					T_LbsUtils utils;
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);		
+					if(testCaseId==103)
+	                    {
+	                    // For this test an additional reference position will be returned.
+					
+						// Setup netsim.
+						User::LeaveIfError(OpenNetSim());
+							
+						// Request notify for the expected reference position.
+						TPositionInfo actualRefPosInfo;
+							
+						err = DoNotifyUpdateL(actualRefPosInfo);
+						if (err)
+							{
+							INFO_PRINTF2(_L("Failed test, reference position request returned err %d."), err);
+							SetTestStepResult(EFail);							
+							}
+								
+						// Verify reference position.
+						TPositionInfo verifyRefPosInfo;
+							
+						verifyRefPosInfo.SetPosition(iRefPos);
+						if (!utils.Compare_PosInfo(verifyRefPosInfo, actualRefPosInfo))
+							{
+							INFO_PRINTF1(_L("Failed test, reference position incorrect."));
+							SetTestStepResult(EFail);
+							}	
+	                    }
+																				
+					// Carry out a notify update to ensure last known cache is filled.
+					TPositionInfo notifyPosInfo;
+					TInt err = DoNotifyUpdateL(notifyPosInfo);
+					User::LeaveIfError(err);
+					
+					// Create a posinfo and store in our shared array for later verification.
+					RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+					
+					
+					utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+					
+					CT_LbsAsyncWaiter*	waiter = CT_LbsAsyncWaiter::NewL();
+					CleanupStack::PushL(waiter);
+					
+					TInt numpositions = iParent.iSharedData->iVerifyPosInfoArr.Count();
+					while(numpositions--)
+						{
+						RPositioner positioner;
+						// Open positioner.
+						User::LeaveIfError(positioner.Open(iServer));
+						CleanupClosePushL(positioner);		
+												
+						TPositionInfo* posInfo = new(ELeave) TPositionInfo();
+						posInfoArr.Append(posInfo);
+
+						// LastKnownPosition from multiple sub sessions
+
+						User::LeaveIfError(positioner.SetRequestor(	CRequestor::ERequestorService,
+																		CRequestor::EFormatApplication,
+																		_L("Tom Tom")));
+																		
+						positioner.GetLastKnownPosition(*posInfo, waiter->iStatus);
+						waiter->StartAndWait();
+						TInt res = waiter->Result();
+						
+						if(KErrNone != res)
+							{
+							//One of the LKPs failed, so test fails.
+							SetTestStepResult(EFail);
+							}
+						CleanupStack::PopAndDestroy(&positioner);
+						}
+
+						CleanupStack::PopAndDestroy(waiter);
+						CleanupStack::PopAndDestroy(&iPositioner);
+					    if (testCaseId == 103)
+							{
+							CloseNetSim();
+							}
+					break;	
+					}
+				// Test case LBS-LastKnownPos-0016
+				case 16:
+				// Test case LBS-LastKnownPos-0104
+				case 104:
+					{
+					T_LbsUtils utils;
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+                    if(testCaseId==104)
+	                    {
+	                    // For this test an additional reference position will be returned.
+					
+						// Setup netsim.
+						User::LeaveIfError(OpenNetSim());
+							
+						// Request notify for the expected reference position.
+						TPositionInfo actualRefPosInfo;
+							
+						err = DoNotifyUpdateL(actualRefPosInfo);
+						if (err)
+							{
+							INFO_PRINTF2(_L("Failed test, reference position request returned err %d."), err);
+							SetTestStepResult(EFail);							
+							}
+								
+						// Verify reference position.
+						TPositionInfo verifyRefPosInfo;
+							
+						verifyRefPosInfo.SetPosition(iRefPos);
+						if (!utils.Compare_PosInfo(verifyRefPosInfo, actualRefPosInfo))
+							{
+							INFO_PRINTF1(_L("Failed test, reference position incorrect."));
+							SetTestStepResult(EFail);
+							}	
+	                    }
+		
+					// Carry out a notify update to ensure last known cache is filled.
+					TPositionInfo notifyPosInfo;
+					User::LeaveIfError(DoNotifyUpdateL(notifyPosInfo));
+
+					// Create a posinfo and store in our shared array for later verification.
+					RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+
+				
+					utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+
+					TInt numPositions = iParent.iSharedData->iVerifyPosInfoArr.Count();
+					while(numPositions--)
+						{
+						TPositionInfo* posInfo = new(ELeave) TPositionInfo();
+						posInfoArr.Append(posInfo);
+						
+						err = DoLastKnownPosL(*posInfo);
+						if (KErrNone != err)
+							{
+							SetTestStepResult(EFail);
+							}
+						}
+					
+					CleanupStack::PopAndDestroy(&iPositioner);
+					if (testCaseId == 104)
+						{
+						CloseNetSim();
+						}
+					break;	
+					}
+				// Test case LBS-LastKnownPos-0105	
+				case 105:
+			    	{
+			    	T_LbsUtils utils;
+			    	TPositionModuleId networkModuleId = utils.GetNetworkModuleIdL(iServer);
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer, networkModuleId));
+					CleanupClosePushL(iPositioner);
+
+					// Setup netsim.
+					User::LeaveIfError(OpenNetSim());
+						
+					TPosition pos;		// original position
+					TTime timeStamp;	// timestamp inside original received position
+					
+					// Carry out a notify update to ensure last known cache is filled.
+					TPositionInfo actualRefPosInfo;
+						
+					err = DoNotifyUpdateL(actualRefPosInfo);
+										
+					if (err)
+						{
+						INFO_PRINTF2(_L("Failed test, reference position request returned err %d."), err);
+						SetTestStepResult(EFail);							
+						}
+												
+					// get the position data:
+					actualRefPosInfo.GetPosition(pos);
+					
+					timeStamp = pos.Time();
+					INFO_PRINTF1(_L("Original position timeStamp: "));
+					INFO_PRINTF4(_L("%d/%d/%d"), timeStamp.DateTime().Day() + 1, timeStamp.DateTime().Month() + 1, timeStamp.DateTime().Year());
+					INFO_PRINTF5(_L("at %d :%d :%d :%d"), timeStamp.DateTime().Hour(), timeStamp.DateTime().Minute(), timeStamp.DateTime().Second(), timeStamp.DateTime().Second());
+						
+					// Create a posinfo and store in our shared array for later verification.
+					RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+					TPositionInfo* posInfo = new(ELeave) TPositionInfo();
+	
+					utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+
+					posInfoArr.Append(posInfo);
+
+					// Get the last known position
+					err = DoLastKnownPosL(*posInfo);
+					if (KErrNone != err)
+						{
+						SetTestStepResult(EFail);
+						}
+					else
+						{								
+						TTime timeStamp_cached;		
+						posInfo->GetPosition(pos);	
+						timeStamp_cached = pos.Time();
+						
+						timeStamp = pos.Time();
+						INFO_PRINTF1(_L("Cached position timeStamp: "));
+						INFO_PRINTF4(_L("%d/%d/%d"), timeStamp_cached.DateTime().Day() + 1, timeStamp_cached.DateTime().Month() + 1, timeStamp_cached.DateTime().Year());
+						INFO_PRINTF5(_L("at %d :%d :%d :%d"), timeStamp_cached.DateTime().Hour(), timeStamp_cached.DateTime().Minute(), timeStamp_cached.DateTime().Second(), timeStamp_cached.DateTime().Second());
+													
+						// verify that the timestamp matches the original one:
+						if(timeStamp_cached != timeStamp)
+							{
+							SetTestStepResult(EFail);
+							}
+						
+						}
+														
+					CleanupStack::PopAndDestroy(&iPositioner);
+					// Close netsim.
+					CloseNetSim();
+					break;
+					}
+				
+				default:
+					{
+					User::Leave(KErrArgument);
+					}
+				}
+			}
+
+		// All done, clean up.
+
+		CleanupStack::PopAndDestroy(&iServer);		
+		}
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsClientStep_LastKnownPos::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientstepmodinfo.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,377 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientstepmodinfo.cpp
+// This is the class implementation for the Module Information Tests
+// 
+//
+ 
+#include "ctlbsclientstepmodinfo.h"
+
+#include <lbs.h>
+
+#include "tlbsutils.h"
+
+/** "num_of_mods" = the expected number (TUint) of modules returned from RPositionServer::GetNumModules().
+*/
+_LIT(KNumOfMods, "num_of_mods");
+
+/** "default_mod_id" = the expected module id returned from RPositionServer::GetDefaultModuleId(),
+	value is decimal.
+*/
+_LIT(KDefaultModId, "default_mod_id");
+
+
+
+/**
+ * Destructor
+ */
+CT_LbsClientStep_ModInfo::~CT_LbsClientStep_ModInfo()
+	{
+	}
+
+
+/**
+ * Constructor
+ */
+CT_LbsClientStep_ModInfo::CT_LbsClientStep_ModInfo(CT_LbsClientServer& aParent) : CT_LbsClientStep(aParent)
+	{
+	SetTestStepName(KLbsClientStep_ModInfo);
+	}
+
+
+/**
+Static Constructor
+*/
+CT_LbsClientStep_ModInfo* CT_LbsClientStep_ModInfo::New(CT_LbsClientServer& aParent)
+	{
+	return new CT_LbsClientStep_ModInfo(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsClientStep_ModInfo::doTestStepL()
+	{
+	// Generic test step used to test the LBS Client Notify position update API.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsClientStep_ModInfo::doTestStepL()"));
+
+	if (TestStepResult() == EPass)
+		{
+		TInt err = KErrNone;
+		TUint 					numOfMods;
+		TInt 					modIndex;
+		TPositionModuleId		modId;
+		TPositionModuleInfo&	currentModInfo = iParent.iSharedData->iCurrentModuleInfo;
+							
+		// Connect to self locate server.
+		User::LeaveIfError(iServer.Connect());
+		CleanupClosePushL(iServer);
+		
+		// Carryout unique test actions.
+		TInt testCaseId;
+		if (GetIntFromConfig(ConfigSection(), KTestCaseId, testCaseId))
+			{
+			switch (testCaseId)
+				{
+				// Test case LBS-ModCnt-0001
+				case 1:
+					{
+					// Find the number of modules installed.
+					TUint verifyNumOfMods;
+
+					if (GetIntFromConfig(ConfigSection(), KNumOfMods, reinterpret_cast<TInt&>(verifyNumOfMods)))
+						{
+						err = iServer.GetNumModules(numOfMods);
+						if ((KErrNone != err) || (verifyNumOfMods != numOfMods))
+							{
+							INFO_PRINTF4(_L("Incorrect err = %d, or num of modules %d should be %d"), err, numOfMods, verifyNumOfMods);
+							SetTestStepResult(EFail);	
+							}
+						}
+						else
+						{
+							INFO_PRINTF1(_L("No num_of_mods variable set in .ini file"));
+							SetTestStepResult(EFail);
+						}
+						break;
+					}
+					
+				// Test case LBS-ModCnt-0002
+				case 2:
+					{
+				
+					// Call GetNumModules with no connection to server.
+					RPositionServer server;	// Don't use iServer as it's open for every test.
+
+					server.GetNumModules(numOfMods);	// No need to check err, call will panic.
+					break;
+					}
+
+				// Test case LBS-ModCnt-0003
+				// Test case LBS-ModCnt-0004
+				case 3:
+				case 4:
+					{
+					// Find the number of modules installed.
+					TUint verifyNumOfMods;
+
+					if (GetIntFromConfig(ConfigSection(), KNumOfMods, reinterpret_cast<TInt&>(verifyNumOfMods)))
+						{
+						err = iServer.GetNumModules(numOfMods);
+						if ((KErrNone != err) || (verifyNumOfMods != numOfMods))
+							{
+							INFO_PRINTF4(_L("Incorrect err = %d, or num of modules %d should be %d"), err, numOfMods, verifyNumOfMods);
+							SetTestStepResult(EFail);	
+							}
+						}
+						else
+						{
+							INFO_PRINTF1(_L("No num_of_mods variable set in .ini file"));
+							SetTestStepResult(EFail);
+						}
+
+					// Setup verification data
+					const TInt KNumModules = 3;
+					_LIT(KLitModName1, "OtherModule");
+					_LIT(KLitModName2, "SIRF_Loc_AGPS_Module");
+					_LIT(KLitModName2_C, "C_Drive_SIRF_Module");
+					_LIT(KLitModName3, "TEST_Loc_AGPS_Module");
+					TPositionModuleId modId;
+					TPositionModuleInfo modInfArray[KNumModules];
+					modId.iUid = 271064389;			// othermodule.ini
+					modInfArray[0].SetModuleId(modId);
+					modInfArray[0].SetModuleName(KLitModName1);
+					modInfArray[0].SetIsAvailable(ETrue);
+					modId.iUid = 271064388;			// sirfdatasource.ini
+					modInfArray[1].SetModuleId(modId);
+					if (testCaseId == 3)
+						modInfArray[1].SetModuleName(KLitModName2);
+					else
+						modInfArray[1].SetModuleName(KLitModName2_C);
+					modInfArray[1].SetIsAvailable(ETrue);
+					modId.iUid = 271064388;			// xtestmodule.ini
+					modInfArray[2].SetModuleId(modId);
+					modInfArray[2].SetModuleName(KLitModName3);
+					modInfArray[2].SetIsAvailable(ETrue);
+						
+					if (err == KErrNone)
+						{
+						// Verify the expected modules were returned
+						for (TInt i=0; i < numOfMods; i++)
+							{
+							TPositionModuleInfo modInfo;
+							err = iServer.GetModuleInfoByIndex(i, modInfo);
+							if (err == KErrNone)
+								{
+								// Check module info is as expected
+								for (TInt j=0; j < KNumModules; j++)
+									{
+									// Check module info
+									if (!modInfArray[j].IsAvailable())
+										continue;
+									// Check ID
+									if (modInfo.ModuleId() != modInfArray[j].ModuleId())
+										continue;
+									// Check name
+									TBuf<32> modName, verifyName;
+									modInfo.GetModuleName(modName);
+									modInfArray[j].GetModuleName(verifyName);
+									if (modName.Compare(verifyName) == 0)
+										{
+										// Use the available to flag module info already 
+										// seen in modInfArray.
+										modInfArray[j].SetIsAvailable(EFalse);
+										break;
+										}
+									}
+								}
+							else
+								{
+								INFO_PRINTF3(_L("Error getting module info %d (%d)"), i, err);
+								SetTestStepResult(EFail);
+								}
+							}
+							
+						// Check that all modules were seen
+						for (TInt k=0; k < KNumModules; k++)
+							{
+							if (modInfArray[k].IsAvailable())
+								{
+								INFO_PRINTF2(_L("Expected module %d not found"), k);
+								SetTestStepResult(EFail);
+								}
+							}
+						}
+					break;
+					}
+
+
+				// TODO:
+				// how do we compare the mod info items, will have to read the ini file ourselfs
+				// no point in having our own ini file type like we have for posinfo
+				// have a test step does the reading of the standard modinfo ini file
+				// have a test step to install the modinfo ini file
+
+
+				// Test case LBS-ModInfo-0001
+				case 11:
+					{
+					// Get mod info, normal functional test.
+					//iServer.GetNumModules(numOfMods);
+				    
+					//err = iServer.GetModuleInfoByIndex(numOfMods-1, currentModInfo);
+					err = iServer.GetModuleInfoByIndex(0, currentModInfo);
+					if (KErrNone != err)
+						{
+						INFO_PRINTF2(_L("Incorrect err = %d"), err);
+						SetTestStepResult(EFail);	
+						}
+					break;
+					}
+				
+				// Test case LBS-ModInfo-0002
+				case 12:
+					{
+					// Get mod info using a invalid index.
+					modIndex = -1;
+					
+					err = iServer.GetModuleInfoByIndex(modIndex, currentModInfo);
+					if (KErrNotFound != err)
+						{
+						INFO_PRINTF3(_L("Incorrect err = %d, should be %d"), err, KErrNotFound);
+						SetTestStepResult(EFail);	
+						}
+					break;
+					}
+				
+				// Test case LBS-ModInfo-0003
+				case 13:
+					{
+					// Get mod info using a invalid index.
+					User::LeaveIfError(iServer.GetNumModules(numOfMods));
+					modIndex = numOfMods + 1; // This will give us a invalid index.
+					
+					err = iServer.GetModuleInfoByIndex(modIndex, currentModInfo);
+					if (KErrNotFound != err)
+						{
+						INFO_PRINTF3(_L("Incorrect err = %d, should be %d"), err, KErrNotFound);
+						SetTestStepResult(EFail);	
+						}
+					break;
+					}
+
+				// Test case LBS-ModInfo-0004
+				case 14:
+					{
+					// Get mod info with no connection to the server.
+					RPositionServer server;	// Don't use iServer as it's open for every test.
+					
+					server.GetModuleInfoByIndex(0, currentModInfo);	// No need to check err, call will panic.
+					break;
+					}
+
+				// Test case LBS-ModInfo-0005
+				case 15:
+					{
+					// Get mod info using a valid id.
+					TPositionModuleInfo	modInfo;
+					
+					// Determine a valid module id, use get mod by index
+					User::LeaveIfError(iServer.GetModuleInfoByIndex(0, modInfo));
+					modId = modInfo.ModuleId();
+
+					// Carry out test of a valid id					
+					err = iServer.GetModuleInfoById(modId, currentModInfo);
+					if (KErrNone != err)
+						{
+						INFO_PRINTF2(_L("Incorrect err = %d"), err);
+						SetTestStepResult(EFail);	
+						}
+					break;
+					}
+				
+				// Test case LBS-ModInfo-0006
+				case 16:
+					{
+					// Get mod info with invalid id.
+					modId = KPositionNullModuleId;
+					
+					err = iServer.GetModuleInfoById(modId, currentModInfo);
+					if (KErrNotFound != err)
+						{
+						INFO_PRINTF3(_L("Incorrect err = %d, should be %d"), err, KErrNotFound);
+						SetTestStepResult(EFail);	
+						}
+					break;
+					}
+				
+				// Test case LBS-ModInfo-0007
+				case 17:
+					{
+					// Get mod info with no connection to the server.
+					RPositionServer server;	// Don't use iServer as it's open for every test.
+					
+					server.GetModuleInfoById(KPositionNullModuleId, currentModInfo);	// No need to check err, call will panic.
+					break;
+					}
+
+				// Test case LBS-ModInfo-0008
+				case 18:
+					{
+					// Get default mod id.
+					TPositionModuleId verifyModId;
+					if (GetIntFromConfig(ConfigSection(), KDefaultModId, reinterpret_cast<TInt&>(verifyModId)))
+						{
+						err = iServer.GetDefaultModuleId(modId);
+						if ((KErrNone != err) || (verifyModId != modId))
+							{
+							INFO_PRINTF4(_L("Incorrect err = %d, or default module id %d should be %d"), err, modId, verifyModId);
+							SetTestStepResult(EFail);	
+							}
+						}
+						
+					else
+						{
+						INFO_PRINTF1(_L("No default_mod_id variable set in .ini file"));
+						SetTestStepResult(EFail);
+						}
+					break;		
+					}
+
+				// Test case LBS-ModInfo-0009
+				case 19:
+					{
+					// Get default mod id with no connection to server.
+					RPositionServer server;	// Don't use iServer as it's open for every test.
+					
+					server.GetDefaultModuleId(modId);	// No need to check err, call will panic.
+					break;
+					}
+				}
+			}
+			
+		// All done, clean up.
+		CleanupStack::PopAndDestroy(&iServer);		
+		}
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsClientStep_ModInfo::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientstepmodselect.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,603 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientstepmodselect.cpp
+// This is the class implementation for the Module Selection Tests
+// 
+//
+ 
+#include "ctlbsclientstepmodselect.h"
+
+#include "tlbsutils.h"
+
+/**
+ * Destructor
+ */
+CT_LbsClientStep_ModSelect::~CT_LbsClientStep_ModSelect()
+	{
+	}
+
+
+/**
+ * Constructor
+ */
+CT_LbsClientStep_ModSelect::CT_LbsClientStep_ModSelect(CT_LbsClientServer& aParent) : CT_LbsClientStep(aParent)
+	{
+	iModuleId=TUid::Null();
+	SetTestStepName(KLbsClientStep_ModSelect);
+	}
+
+/**
+Static Constructor
+*/
+CT_LbsClientStep_ModSelect* CT_LbsClientStep_ModSelect::New(CT_LbsClientServer& aParent)
+	{
+	return new CT_LbsClientStep_ModSelect(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+/**
+ * Verifies that the last position retrieved was from the a-gps module
+ */
+TBool CT_LbsClientStep_ModSelect::VerifyLastModuleIdWasAGpsL()
+	{
+	TPositionInfo* posInfo = static_cast<TPositionInfo*>(iParent.iSharedData->iCurrentPosInfoArr[iParent.iSharedData->iCurrentPosInfoArr.Count()-1]);
+	TPositionModuleId checkModId = posInfo->ModuleId();
+	TPositionModuleId verifyModId;
+	
+	T_LbsUtils utils;
+	
+	verifyModId = utils.GetAGpsModuleIdL(iServer);
+	
+	if(checkModId == verifyModId)
+		{
+		INFO_PRINTF2(_L("Module IDs Match: Get AGPS Module Id %d"), checkModId.iUid);
+		return ETrue;
+		}
+	else
+		{
+		INFO_PRINTF3(_L("Module IDs Do Not Match: Expected %d, Receive %d"), verifyModId.iUid, checkModId.iUid);
+		return EFalse;
+		}	
+	}
+
+/**
+ * Verifies that the last position retrieved was from the network module
+ */
+TBool CT_LbsClientStep_ModSelect::VerifyLastModuleIdWasNetworkL()
+	{
+	TPositionInfo* posInfo = static_cast<TPositionInfo*>(iParent.iSharedData->iCurrentPosInfoArr[iParent.iSharedData->iCurrentPosInfoArr.Count()-1]);
+	TPositionModuleId checkModId = posInfo->ModuleId();
+	TPositionModuleId verifyModId;
+	
+	T_LbsUtils utils;
+	verifyModId = utils.GetNetworkModuleIdL(iServer);
+	
+	if(checkModId == verifyModId)
+		{
+		INFO_PRINTF2(_L("Module IDs Match: Get Network Module Id %d"), checkModId.iUid);
+		return ETrue;
+		}
+	else
+		{
+		INFO_PRINTF3(_L("Module IDs Do Not Match: Expected %d, Receive %d"), verifyModId, checkModId);
+		return EFalse;
+		}	
+	
+	}
+
+TInt CT_LbsClientStep_ModSelect::Blocking_NotifyUpdateL()
+	{
+	
+	TInt err;
+	
+	User::LeaveIfError(iPositioner.Open(iServer));
+	INFO_PRINTF1(_L("Opened RPositioner successfully with RPositionServer"));
+	CleanupClosePushL(iPositioner);
+
+	err = Blocking_NotifyUpdateCommonL();
+	
+	CleanupStack::PopAndDestroy(&iPositioner);
+	
+	return err;
+	}
+	
+TInt CT_LbsClientStep_ModSelect::Blocking_NotifyUpdateWithModuleIdL(TPositionModuleId aModuleId)
+	{	
+	TInt err;
+	
+	User::LeaveIfError(iPositioner.Open(iServer, aModuleId));
+	INFO_PRINTF1(_L("Opened RPositioner successfully with RPositionServer and TPositionModuleId"));
+	CleanupClosePushL(iPositioner);
+
+	err = Blocking_NotifyUpdateCommonL();
+	
+	CleanupStack::PopAndDestroy(&iPositioner);
+	
+	return err;
+	}
+
+
+/**
+ *	Opens a subsession with the requested criteria and retrieves a location update 
+ *  which it appends to the current array of positions
+ */
+TInt CT_LbsClientStep_ModSelect::Blocking_NofifyUpdateWithCriteriaL(TPositionCriteria aCriteria)
+	{
+	TInt err;
+	
+	User::LeaveIfError(iPositioner.Open(iServer, aCriteria));
+	INFO_PRINTF1(_L("Opened RPositioner successfully with RPositionServer and TPositionCriteria"));
+	CleanupClosePushL(iPositioner);
+
+	err = Blocking_NotifyUpdateCommonL();
+	
+	CleanupStack::PopAndDestroy(&iPositioner);
+	
+	return err;
+	}
+
+
+TInt CT_LbsClientStep_ModSelect::Blocking_NotifyUpdateCommonL()
+	{
+	TInt err = KErrNone;
+	
+	// Create a posinfo and store in our shared array for later verification.
+	RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+	TPositionInfo* posInfo = new(ELeave) TPositionInfo();
+	
+	T_LbsUtils utils;
+	utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+
+	posInfoArr.Append(posInfo);
+	
+	err = DoNotifyUpdateL(*posInfo);
+	
+	return err;	
+	}
+
+/**
+ * Connect to netsim and set up reference position
+ * return KErrNone if successful
+ */
+TInt CT_LbsClientStep_ModSelect::SetupNetSimL()
+	{
+	TInt err = iNetSim.ConnectL(NULL); //connect to netsim but ingnore the callbacks
+	if (err != KErrNone)
+		{
+		INFO_PRINTF2(_L("Cannot connect to netsim, return with error %d"), err);	
+		return err;
+		}
+	else
+		{
+		//set up reference position
+		RPointerArray<TAny>& srcPosInfoArr = iParent.iSharedData->iVerifyPosInfoArr;
+		TPositionInfo* srcPosInfo = reinterpret_cast<TPositionInfo*>(srcPosInfoArr[0]);
+		TPosition srcPos;
+		srcPosInfo->GetPosition(srcPos);
+		
+		if (!iNetSim.SetReferenceLocation(srcPos))
+			{
+			INFO_PRINTF1(_L("Test Failed: can't set NetSim's reference location."));
+			iNetSim.Close();
+			return KErrGeneral;
+			}
+		// Set plugin to use for getting assistance data:
+		TUid pluginUid;
+		if(iParent.iSharedData->iTestModuleInUse)
+			{
+			pluginUid = TUid::Uid(KSimpleAssistanceDataProviderPluginUidValue);
+			}
+		else
+			{
+			pluginUid = TUid::Uid(KSuplAssistanceDataProviderPluginUidValue);
+			}
+		if (!iNetSim.SetAssistanceDataProvider(pluginUid))
+			{
+			INFO_PRINTF1(_L("Test Failed: Can't set NetSim's assistance data plugin uid."));
+			SetTestStepResult(EFail);
+			iNetSim.Close();
+			return KErrGeneral;
+			}
+		}
+	return KErrNone;
+	}
+
+/**
+ * do notify position update with required postion criteria and verify the position 
+ * received is from expected module
+ */	
+void CT_LbsClientStep_ModSelect::DoModuleSelectionL(TOpenSesstionMethod aMethod, TModuleType aModuleType)
+	{
+	TInt err = KErrNone;
+
+	//do netsim connection and configure reference position
+	err = SetupNetSimL();
+	if (err !=KErrNone)
+		{
+		SetTestStepResult(EFail);
+		return;
+		}
+
+	switch (aMethod)
+		{
+		case EWithCriteria:
+			err = Blocking_NofifyUpdateWithCriteriaL(iCriteria);
+			break;
+			
+		case EWithModuleId:
+			err = Blocking_NotifyUpdateWithModuleIdL(iModuleId);
+			break;
+			
+		case ENone:
+			err = Blocking_NotifyUpdateL();
+			break;
+			
+		default:
+			break;
+		}
+	
+	
+	if(KErrNone == err)
+		{
+		// Verify that the last position was 
+		// retrieved by the expected module: module ids not defined yet
+		switch (aModuleType)
+			{
+			case EAGPSModule:
+				if(!VerifyLastModuleIdWasAGpsL())
+					{
+					SetTestStepResult(EFail);
+					}
+			break;
+			
+			case ENetworkModule:
+				if (!VerifyLastModuleIdWasNetworkL())
+					{
+					SetTestStepResult(EFail);
+					break;
+					}
+			break;
+			
+			case ERandomModule:
+				if (!VerifyLastModuleIdWasNetworkL() && !VerifyLastModuleIdWasAGpsL())
+					{
+					SetTestStepResult(EFail);
+					}
+			break;
+			
+			default:
+			break;
+			}
+		
+		}
+	else
+		{
+		SetTestStepResult(EFail);
+		}
+
+	iNetSim.Close();
+	}
+
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsClientStep_ModSelect::doTestStepL()
+	{
+	// Generic test step used to test the LBS Client Notify position update API.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsClientStep_ModSelect::doTestStepL()"));
+
+	if (TestStepResult()==EPass)
+		{
+
+		TInt err = KErrNone;
+		
+		// Connect to self locate server.
+		User::LeaveIfError(iServer.Connect());
+		CleanupClosePushL(iServer);
+		
+		//reset the default value
+		iCriteria.ClearCriteria();
+		iQuality = TPositionQuality();
+		iSelectOrder.ClearSelectionOrder(); 
+		
+		TInt testCaseId;
+		if (GetIntFromConfig(ConfigSection(), KTestCaseId, testCaseId))
+			{
+			switch (testCaseId)
+				{
+				case 01:	// test module selection by capabilities 
+							// LBS-Capability-0001
+					{
+					iCriteria.AddRequiredCapabilities(TPositionModuleInfo::ECapabilitySatellite);
+					DoModuleSelectionL(EWithCriteria, EAGPSModule);			
+					} 
+					break;
+
+				case 03:	// test module selection by unsupported capabilities 
+							// LBS-Capability-0003
+					{
+					// Set capabilities not supported by either (gps/network) module:
+					iCriteria.AddRequiredCapabilities(TPositionModuleInfo::ECapabilityMedia);
+					err = iPositioner.Open(iServer, iCriteria);
+					if(KErrNotFound != err)
+						{
+						INFO_PRINTF2(_L("Test failed: wrong error returned %d"), err);
+						SetTestStepResult(EFail);
+						if(KErrNone == err)
+							{
+							iPositioner.Close();
+							}						
+						}
+					
+					iCriteria.ClearCriteria();
+					User::LeaveIfError(iPositioner.Open(iServer, iCriteria));
+					iPositioner.Close();
+					}  
+					break;
+					
+				case 04: //required more than one capability
+						 //LBS-Capability-0004	
+					{
+					iCriteria.AddRequiredCapabilities(TPositionModuleInfo::ECapabilityHorizontal);
+					iCriteria.AddRequiredCapabilities(TPositionModuleInfo::ECapabilitySatellite);
+					DoModuleSelectionL(EWithCriteria, EAGPSModule);	
+					} 
+					break;
+					
+				case 11:	// test module selection by horizontal/vertical accuracy 
+							// LBS-Quality-0001
+					{
+					// set up the required accuracy
+					iQuality.SetHorizontalAccuracy(AGPS_MODINFO_HORIZONTAL_ACCURACY);
+					iQuality.SetVerticalAccuracy(AGPS_MODINFO_VERTICAL_ACCURACY);
+					
+					iCriteria.SetRequiredQuality(iQuality);
+					
+					DoModuleSelectionL(EWithCriteria, EAGPSModule);		
+					}
+					break;
+					
+				case 12:	// test module selection by time to first fix 
+							// LBS-Quality-0002
+					{
+					TTimeIntervalMicroSeconds timetofirstfix(NETWORK_MODINFO_TIME_TO_FIRST_FIX);
+					 
+					// set up the required TTFF
+					iQuality.SetTimeToFirstFix(timetofirstfix);
+					
+					iCriteria.SetRequiredQuality(iQuality);
+					
+					DoModuleSelectionL(EWithCriteria, ENetworkModule);		
+					}
+					break;
+					
+				case 13:	// test module selection by power consumption 
+							// LBS-Quality-0003
+					// this test case can only be run in test module
+					// in xtestmodule.ini powerconsumption need to be changed to 1
+					{
+					if (!iParent.iSharedData->iTestModuleInUse)
+						{
+						INFO_PRINTF1(_L("This test case can ONLY be run with Test A-GPS Module"));
+						User::Panic(_L("Client Module Selection"), 1);
+						}
+					iQuality.SetPowerConsumption(TPositionQuality::EPowerLow);
+					iCriteria.SetRequiredQuality(iQuality);	
+					
+					//because both modules have the same power consumption value
+					//agps module will be selected by default
+					DoModuleSelectionL(EWithCriteria, ENetworkModule);
+					}			
+					break;
+								
+				case 14:	// test module selection by cost limit 
+							// LBS-Quality-0004
+					{
+					iQuality.SetCostIndicator(AGPS_MODINFO_COST_INDICATOR);
+					iCriteria.SetRequiredQuality(iQuality);
+					
+					DoModuleSelectionL(EWithCriteria, EAGPSModule);	
+					}					
+					break;
+				
+				case 15: 	// setting a higher accuracy than all existing modules for module selection
+							// LBS-Quality-0005
+					{
+					//set an required horizontal accuracy as 1 meter
+					iQuality.SetHorizontalAccuracy(1); 	
+					iCriteria.SetRequiredQuality(iQuality);
+					err = iPositioner.Open(iServer, iCriteria);
+					if(KErrNotFound != err)
+						{
+						INFO_PRINTF2(_L("Test failed: wrong error returned %d"), err);
+						SetTestStepResult(EFail);
+						if(KErrNone == err)
+							{
+							iPositioner.Close();
+							}						
+						}
+					}
+					break;
+						
+ 				case 16:
+ 							// LBS-Quality-0006 - TTFF lower than module's and H-Acc lower (more accurate) than module's. Specified V-Acc is met by module.
+ 					{
+ 					//set required TTFF=20s, TTNF=1, H-Acc=10m, V-Acc=200m
+ 					iQuality.SetTimeToFirstFix(10000000);
+ 					iQuality.SetTimeToNextFix(1000000);
+ 					iQuality.SetHorizontalAccuracy(10); 
+ 					iQuality.SetVerticalAccuracy(200);
+ 										
+ 					iCriteria.SetRequiredQuality(iQuality);
+ 					err = iPositioner.Open(iServer, iCriteria);
+ 					if(KErrNotFound != err)
+ 						{
+ 						INFO_PRINTF2(_L("Test failed: wrong error returned %d"), err);
+ 						SetTestStepResult(EFail);
+ 						if(KErrNone == err)
+ 							{
+ 							iPositioner.Close();
+ 							}						
+ 						}
+ 					}
+ 					break;
+ 					
+ 				case 17:
+ 							// LBS-Quality-0007 - TTFF lower than module's and H-Acc/V-Acc lower than module's. Power and Cost match module's
+ 					{
+ 					//set required TTFF=20s, TTNF=1, H-Acc=10m, V-Acc=10m
+ 					iQuality.SetTimeToFirstFix(10000000);
+ 					iQuality.SetTimeToNextFix(1000000);
+ 					iQuality.SetHorizontalAccuracy(10); 
+ 					iQuality.SetVerticalAccuracy(10);
+ 					
+ 					iQuality.SetCostIndicator(TPositionQuality::ECostCharge);	
+ 					iQuality.SetPowerConsumption(TPositionQuality::EPowerMedium);
+ 					
+ 					iCriteria.SetRequiredQuality(iQuality);
+ 					err = iPositioner.Open(iServer, iCriteria);
+ 					if(KErrNotFound != err)
+ 						{
+ 						INFO_PRINTF2(_L("Test failed: wrong error returned %d"), err);
+ 						SetTestStepResult(EFail);
+ 						if(KErrNone == err)
+ 							{
+ 							iPositioner.Close();
+ 							}						
+ 						}
+ 					}
+ 					break;
+						
+				case 21:	// Request Location update with default request ordering 
+							// LBS-SelectionOrder-0001 
+					{
+					DoModuleSelectionL(ENone,EAGPSModule);					
+					}
+					break;
+						
+				case 22:	// Request location update with cost/time/accuracy/power mgmt in order of importance
+					{		// LBS-SelectionOrder-0002
+					User::LeaveIfError(iSelectOrder.SetOrderCostIndicator(TPositionSelectionOrder::EOrderVeryHigh));
+					User::LeaveIfError(iSelectOrder.SetOrderTimeToFirstFix(TPositionSelectionOrder::EOrderHigh));
+					User::LeaveIfError(iSelectOrder.SetOrderHorizontalAccuracy(TPositionSelectionOrder::EOrderFairlyHigh));
+					User::LeaveIfError(iSelectOrder.SetOrderPowerConsumption(TPositionSelectionOrder::EOrderMedium));
+					
+					iCriteria.SetSelectionOrder(iSelectOrder);
+					
+					DoModuleSelectionL(EWithCriteria, EAGPSModule);
+					}
+					break;
+							
+							// Test requires test A-GPS module to have accuracy of <100m. This must be better than Network Module.
+				case 32:	// Check that we can fall back on the selection order process (stage 3) when capabilities and qualities of both modules are equal.
+					{		// LBS-ModuleSelection-0002 
+					iQuality.SetHorizontalAccuracy(500);
+					iCriteria.SetRequiredQuality(iQuality);
+					
+					DoModuleSelectionL(EWithCriteria, EAGPSModule);
+					}
+					break;
+						
+							// Test requires test A-GPS module and Network Module to have equal horizontal accuracy
+				case 33:	// Check that we can ack on the Rpositioner Framework when both modules appear identical.
+					{		// LBS-ModuleSelection-0003
+					if (!iParent.iSharedData->iTestModuleInUse)
+						{
+						INFO_PRINTF1(_L("This test case can ONLY be run with Test A-GPS Module"));
+						User::Panic(_L("Client Module Selection"), 1);
+						}
+					iQuality.SetHorizontalAccuracy(100);
+					iCriteria.SetRequiredQuality(iQuality);
+					
+					User::LeaveIfError(iSelectOrder.SetOrderHorizontalAccuracy(TPositionSelectionOrder::EOrderVeryHigh));
+					iCriteria.SetSelectionOrder(iSelectOrder);
+					
+					DoModuleSelectionL(EWithCriteria, ERandomModule);			
+					}
+					break;
+						
+				case 34:	// Select default module on connecting to the RPositioner
+					{		// LBS-ModuleSelection-0004 
+					DoModuleSelectionL(EWithCriteria, EAGPSModule);
+					}
+					break;	
+					
+					
+				case 35:	// Select A-GPS module by its ID
+					{		// LBS-ModuleSelection-0005					
+					iModuleId.iUid = APGS_MODINFO_MODULE_ID;
+					DoModuleSelectionL(EWithModuleId, EAGPSModule);				
+					}
+					break;	
+					
+					
+				case 36: 	// Select Network module by its ID
+					{		// LBS-ModuleSelection-0006		
+					iModuleId.iUid = NETWORK_MODINFO_MODULE_ID;
+					DoModuleSelectionL(EWithModuleId, ENetworkModule);				
+					}
+					break;	
+					
+				case 37: // Test requires test A-GPS module and Network Module to have equal power consumption
+						 // when both modules match the iCriteria, check default module is used for position update
+						 // LBS-ModuleSelection-0007
+					{
+					iQuality.SetPowerConsumption(TPositionQuality::EPowerLow);
+					iCriteria.SetRequiredQuality(iQuality);
+					
+					User::LeaveIfError(iSelectOrder.SetOrderPowerConsumption(TPositionSelectionOrder::EOrderVeryHigh));
+					iCriteria.SetSelectionOrder(iSelectOrder);
+					
+					DoModuleSelectionL(EWithCriteria, ERandomModule);
+					}
+					break;
+					
+				case 38:
+						//LBS-ModuleSelection-0008
+					{
+					if (!iParent.iSharedData->iTestModuleInUse)
+						{
+						INFO_PRINTF1(_L("This test case can ONLY be run with Test A-GPS Module"));
+						User::Panic(_L("Client Module Selection"), 1);
+						}
+					iQuality.SetHorizontalAccuracy(100);
+					iCriteria.SetRequiredQuality(iQuality);
+					
+					User::LeaveIfError(iSelectOrder.SetOrderHorizontalAccuracy(TPositionSelectionOrder::EOrderVeryHigh));
+					User::LeaveIfError(iSelectOrder.SetOrderPowerConsumption(TPositionSelectionOrder::EOrderVeryHigh));
+					iCriteria.SetSelectionOrder(iSelectOrder);
+					
+					// Verify that the last position was retrieved by a-gps module, which has lower power consumption.
+					DoModuleSelectionL(EWithCriteria, ENetworkModule);
+					}
+					break;
+							
+				default:
+					{
+					INFO_PRINTF1(_L("Invalid Test Case"));
+					User::Leave(KErrArgument);
+					}	
+				}	
+			}	
+		CleanupStack::PopAndDestroy(&iServer);	
+		} // end if TestStepResult
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsClientStep_ModSelect::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientstepmodstatus.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,567 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientstepmodstatus.cpp
+// This is the class implementation for the Module Information Tests
+// 
+//
+ 
+#include "ctlbsclientstepmodstatus.h"
+#include "ctlbsclientstep.h"
+
+#include <e32property.h>
+#include <lbs.h>
+
+#include "tlbsutils.h"
+#include "ctlbsasyncwaiter.h"
+
+/**
+ * Destructor
+ */
+CT_LbsClientStep_ModStat::~CT_LbsClientStep_ModStat()
+	{
+	}
+
+
+/**
+ * Constructor
+ */
+CT_LbsClientStep_ModStat::CT_LbsClientStep_ModStat(CT_LbsClientServer& aParent) : CT_LbsClientStep(aParent)
+	{
+	SetTestStepName(KLbsClientStep_ModStatus);
+	}
+
+
+/**
+Static Constructor
+*/
+CT_LbsClientStep_ModStat* CT_LbsClientStep_ModStat::New(CT_LbsClientServer& aParent)
+	{
+	return new CT_LbsClientStep_ModStat(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+/**
+ *	Sets requested event mask as specified for supplied module. 
+ *  Kicks test module to cause events requested then waits for event(s)
+ *  Updates the supplied module status 
+ *  returns TRUE if everything went as expected, FALSE otherwise
+ */
+ /**
+ *	Sets requested event mask as specified for supplied module. 
+ *  Kicks test module to cause events requested then waits for event(s)
+ *  Updates the supplied module status 
+ *  returns TRUE if everything went as expected, FALSE otherwise
+ */
+ TBool CT_LbsClientStep_ModStat::DoRequestAndVerifyModStatusEventsL(TPositionModuleStatusEvent::TModuleEvent aReqEventsMask, TPositionModuleStatus& aModStatus, TPositionModuleId aModId = KPositionNullModuleId )
+	{
+	TBool result = TRUE;
+	TPositionModuleStatusEvent statusEvent;
+	TPositionModuleId agpsmodId;
+								
+	// we're interested in the agps module id
+	T_LbsUtils utils;
+	agpsmodId = utils.GetAGpsModuleIdL(iServer);
+	
+	//  Set event mask to select requested status events								
+	statusEvent.SetRequestedEvents(aReqEventsMask);
+	
+	// verify the set worked
+	if(statusEvent.RequestedEvents() != aReqEventsMask)
+		{
+		INFO_PRINTF2(_L("Requested Events don't match. Got0x%x"), statusEvent.RequestedEvents());
+		return FALSE;
+		}
+	
+	CT_LbsAsyncWaiter* waiter = CT_LbsAsyncWaiter::NewL();
+	
+	// Request module status event using supplied module id
+	iServer.NotifyModuleStatusEvent(statusEvent, waiter->iStatus, aModId);
+	
+	TPositionModuleStatusEvent::TModuleEvent eventsExpected = 0;
+	
+	// assume we are interested in the agps module since we can't control events from network module
+	ASSERT(aModId == agpsmodId || aModId == KPositionNullModuleId);
+	
+	// kick the test agps module to cause the requested status event(s)
+	TPckgBuf<TModuleDataIn> modDataInBuf;
+	TModuleDataIn& modDataIn = modDataInBuf();
+	
+	modDataIn.iRequestType = TModuleDataIn::EModuleRequestEventKickOff; 
+		modDataIn.iKickOffEventType = 0;
+	if(aReqEventsMask & TPositionModuleStatusEvent::EEventDeviceStatus)
+		{
+		modDataIn.iKickOffEventType |= TModuleDataIn::EKickOffEventTypeDevice;
+		eventsExpected |= TPositionModuleStatusEvent::EEventDeviceStatus;
+		}
+
+	if(aReqEventsMask & TPositionModuleStatusEvent::EEventDataQualityStatus)
+		{
+		modDataIn.iKickOffEventType |= TModuleDataIn::EKickOffEventTypeDataQuality;
+		eventsExpected |= TPositionModuleStatusEvent::EEventDataQualityStatus;
+		}
+	
+	User::LeaveIfError(RProperty::Set(KUidSystemCategory, ELbsTestAGpsModuleIn, modDataInBuf));
+
+
+	// Wait for event(s)
+	while(result && eventsExpected)
+		{
+		waiter->StartAndWait();
+		User::LeaveIfError(waiter->Result());
+
+
+		TInt result = waiter->Result();
+		
+		TPositionModuleStatusEvent::TModuleEvent eventsOccurred = statusEvent.OccurredEvents();
+		
+		ASSERT(eventsOccurred);
+		
+		if(result)
+			{
+			INFO_PRINTF2(_L("Unexpected error returned %d"), result);
+			result = FALSE;
+			}
+		// Verify correct event(s) happenned			
+		else 
+			{
+				
+			if(eventsOccurred & ~(eventsExpected))
+				{
+				INFO_PRINTF2(_L("Unexpected event received 0x%x"), statusEvent.OccurredEvents());
+				result = FALSE;						
+				}
+			
+			if(statusEvent.ModuleId() == agpsmodId)
+				{
+				eventsExpected &= ~eventsOccurred;	
+				}
+				
+			// Request next module status event
+			if (eventsExpected)
+				{
+				iServer.NotifyModuleStatusEvent(statusEvent, waiter->iStatus/*request*/, aModId);
+				}
+			}	
+		}
+		
+	// TODO - appropriate to do this here?
+	// device status event happened. Read in new status (this will be verified in future test step):
+	statusEvent.GetModuleStatus(aModStatus);
+	
+	delete waiter;
+	
+	return result;
+	}
+
+/**
+ *	Sets requested event mask as specified for agps module. 
+ *  Kicks test module to cause events requested then waits for event(s)
+ *  Updates the supplied module status 
+ *  returns TRUE if everything went as expected, FALSE otherwise
+ */
+ TBool CT_LbsClientStep_ModStat::DoRequestAndVerifyAGPSModStatusEventsL(TPositionModuleStatusEvent::TModuleEvent aReqEventsMask, TPositionModuleStatus& aModStatus)
+ 	{
+	TPositionModuleId modId;
+								
+	// we're interested in the agps module id
+	T_LbsUtils utils;
+	modId = utils.GetAGpsModuleIdL(iServer);
+					
+	return DoRequestAndVerifyModStatusEventsL(aReqEventsMask, aModStatus, modId);
+ 	}
+ 	
+ 	
+/**
+ * Sets requested event mask as specified for supplied module and asks to be notified of events
+ * (note does not kick test module to cause events; use only if expect error to be returned)
+ * Waits for event and returns error
+ */
+TInt CT_LbsClientStep_ModStat::DoRequestModStatusEventsWithError(TPositionModuleStatusEvent::TModuleEvent aReqEventsMask, TPositionModuleId aModId)
+	{
+	//TRequestStatus request;					
+	TPositionModuleStatusEvent statusEvent;
+	
+	statusEvent.SetRequestedEvents(aReqEventsMask);
+					
+	CT_LbsAsyncWaiter* waiter = CT_LbsAsyncWaiter::NewL();
+		
+	iServer.NotifyModuleStatusEvent(statusEvent, waiter->iStatus, aModId);
+	
+	waiter->StartAndWait();
+
+	TInt result = waiter->Result();
+
+	//User::WaitForRequest(request);
+	delete waiter;
+	
+	return result;
+	
+	}
+
+TBool CT_LbsClientStep_ModStat::DoVerifyModStatus(TPositionModuleStatusEvent::TModuleEvent aExpectedModStatus,TPositionModuleId aModId)
+	{
+	// Initialise current module status.
+	TPositionModuleStatus& currentModStatus = iParent.iSharedData->iCurrentModuleStatus;
+	iServer.GetModuleStatus(currentModStatus,aModId);
+
+	if(currentModStatus.DeviceStatus()!=aExpectedModStatus)
+		{
+		INFO_PRINTF3(_L("Module in Unexpected State - %d and not %d"),currentModStatus.DeviceStatus(),aExpectedModStatus);
+		SetTestStepResult(EFail);	
+		return EFalse;
+		}
+	else
+		{
+		INFO_PRINTF2(_L("Module in Expected State %d"),aExpectedModStatus);
+		return ETrue;
+		}
+	}
+	
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsClientStep_ModStat::doTestStepL()
+	{
+	// Generic test step used to test the LBS Client Notify position update API.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsClientStep_ModStat::doTestStepL()"));
+
+	if (TestStepResult() == EPass)
+		{
+		TInt err = KErrNone;
+			
+		// Connect to self locate server.
+		User::LeaveIfError(iServer.Connect());
+		CleanupClosePushL(iServer);
+		
+		// Carryout unique test actions.
+		TInt testCaseId;
+		if (GetIntFromConfig(ConfigSection(), KTestCaseId, testCaseId))
+			{
+			switch (testCaseId)
+				{
+				// Test case LBS-ModStatus-0001 to 0004
+				case 01:
+				case 02:
+				case 03:				
+				case 04:
+					{
+					TPositionModuleId testmodId;
+					
+					T_LbsUtils utils;
+					testmodId = utils.GetAGpsModuleIdL(iServer);
+					
+					// Get the module device status.
+					TPositionModuleStatus& modStatus = iParent.iSharedData->iCurrentModuleStatus;					
+					err = iServer.GetModuleStatus(modStatus, testmodId);
+					if(KErrNone != err)
+						{
+						INFO_PRINTF2(_L("Failed with err %d"), err);
+						SetTestStepResult(EFail);	
+						}
+					}
+					break;
+					
+				// Test case LBS-ModStatus-0005
+				case 05:
+					{
+					TPositionModuleId badmodId;
+					T_LbsUtils utils;
+					badmodId = utils.GetBadModuleId();
+					
+					// Get the module device status.
+					TPositionModuleStatus moduleStatus;
+					
+					err = iServer.GetModuleStatus(moduleStatus, badmodId);
+					if(KErrNotFound != err)
+						{
+						INFO_PRINTF2(_L("Failed with err %d. Should have been KErrNotFound(-1)"), err);
+						SetTestStepResult(EFail);	
+						}
+					}
+					break;					
+										
+				// LBS-Mod-Status-Event-0002
+				case 22:
+					{
+					TPositionModuleStatus& testmodStatus = iParent.iSharedData->iCurrentModuleStatus;
+												
+					// Get device status events for any module:										
+					if(!DoRequestAndVerifyModStatusEventsL(TPositionModuleStatusEvent::EEventDeviceStatus, testmodStatus))
+						{
+						SetTestStepResult(EFail);
+						}
+					}
+					break;
+					
+				// LBS-Mod-Status-Event-0003
+				case 23:
+					{
+					TPositionModuleStatus& testmodStatus = iParent.iSharedData->iCurrentModuleStatus;
+					
+					// Get device status events	for (test) agps module		
+					if(!DoRequestAndVerifyAGPSModStatusEventsL(TPositionModuleStatusEvent::EEventDeviceStatus, testmodStatus))
+						{
+						SetTestStepResult(EFail);
+						}
+					
+					// Get device status events again				
+					if(!DoRequestAndVerifyModStatusEventsL(TPositionModuleStatusEvent::EEventDeviceStatus, testmodStatus))
+						{
+						SetTestStepResult(EFail);
+						}
+					}
+					break;
+				
+				// LBS-Mod-Status-Event-0004
+				case 24:
+					{
+					TPositionModuleStatus& testmodStatus = iParent.iSharedData->iCurrentModuleStatus;
+						
+					// Get device status events				
+					if(!DoRequestAndVerifyAGPSModStatusEventsL(TPositionModuleStatusEvent::EEventDeviceStatus, testmodStatus))
+						{
+						SetTestStepResult(EFail);
+						}
+					}
+					break;
+				
+				// LBS-Mod-Status-Event-0005
+				case 25:
+					{
+					TPositionModuleStatus& testmodStatus = iParent.iSharedData->iCurrentModuleStatus;
+					// Get device status events				
+					if(!DoRequestAndVerifyAGPSModStatusEventsL(TPositionModuleStatusEvent::EEventDataQualityStatus, testmodStatus))
+						{
+						SetTestStepResult(EFail);
+						}					
+					}
+					break;
+										
+				// LBS-Mod-Status-Event-0009
+				case 29:
+					{
+					TPositionModuleStatus& testmodStatus = iParent.iSharedData->iCurrentModuleStatus;
+					
+					//In feature when system events support, change TPositionModuleStatusEvent::EEventAll 
+					// Get device status events				
+					if(!DoRequestAndVerifyAGPSModStatusEventsL(((TPositionModuleStatusEvent::EEventDeviceStatus)|(TPositionModuleStatusEvent::EEventDataQualityStatus)), testmodStatus))
+						{
+						SetTestStepResult(EFail);
+						}					
+					}
+					break;
+															
+				// LBS-Mod-Status-Event-0010
+				case 30:
+					{
+					TPositionModuleId modId;
+					TInt err;
+						
+					// use bad module id
+					T_LbsUtils utils;
+					modId = utils.GetBadModuleId();
+								
+					err = DoRequestModStatusEventsWithError(TPositionModuleStatusEvent::EEventDataQualityStatus, modId);								
+					if(KErrNotFound != err)
+						{
+						SetTestStepResult(EFail);
+						}
+					}
+					break;
+															
+				// LBS-Mod-Status-Event-0011
+				case 31:
+					{
+					TPositionModuleId modId;
+					TInt err;
+						
+					// use agps module id
+					T_LbsUtils utils;
+					modId = utils.GetAGpsModuleIdL(iServer);
+								
+					err = DoRequestModStatusEventsWithError(0, modId);								
+					if(KErrArgument != err)
+						{
+						SetTestStepResult(EFail);
+						}
+					}
+					break;
+
+				// LBS-Mod-Status-Event-0012
+				case 32:
+					{
+					TPositionModuleId modId;
+					TRequestStatus request;					
+					TPositionModuleStatusEvent statusEvent;
+						
+					// use agps module id
+					T_LbsUtils utils;
+					modId = utils.GetAGpsModuleIdL(iServer);
+					
+					statusEvent.SetRequestedEvents(TPositionModuleStatusEvent::EEventDeviceStatus);
+										
+					iServer.NotifyModuleStatusEvent(statusEvent, request, modId);
+					
+					TInt err = iServer.CancelRequest(EPositionServerNotifyModuleStatusEvent);
+					if(KErrNone == err)
+						{
+						User::WaitForRequest(request);
+						if(KErrCancel != request.Int())
+							{
+							INFO_PRINTF2(_L("Failed: KErrCancel not returned, Got %d"), request.Int());
+							SetTestStepResult(EFail);
+							}
+						}
+					else
+						{
+						INFO_PRINTF2(_L("Failed: CancelRequest returned error %d"), err);
+						SetTestStepResult(EFail);
+						}
+					}
+					break;
+				
+				// LBS-Mod-Status-Event-0013
+				case 33:
+					{
+					TInt err = iServer.CancelRequest(EPositionServerNotifyModuleStatusEvent);
+					if(KErrNotFound != err)
+						{
+						INFO_PRINTF2(_L("Failed: CancelRequest returned error %d, expecting KErrNotFound"), err);
+						SetTestStepResult(EFail);						
+						}
+					}
+					break;
+
+				// LBS-Mod-Status-Event-0014
+				case 34:
+					{
+					// close server since we don't want to be connected for this test
+					iServer.Close();
+					
+					TInt err = iServer.CancelRequest(EPositionServerNotifyModuleStatusEvent);
+					
+					// if we get here, something went wrong, so panic
+					SetTestStepResult(EFail);
+					
+					User::Panic(KLbsClientStep_ModStatus, KErrGeneral);
+					}
+					break;
+					
+				// LBS-Mod-Status-Event-0015
+				case 35:
+					{
+					TPositionModuleId modId;
+					TRequestStatus request;					
+					TPositionModuleStatusEvent statusEvent;
+						
+					// use agps module id
+					T_LbsUtils utils;
+					modId = utils.GetAGpsModuleIdL(iServer);
+					
+					// set requested events mask
+					statusEvent.SetRequestedEvents(TPositionModuleStatusEvent::EEventDeviceStatus);
+					
+					// ask to be notified of requested events					
+					iServer.NotifyModuleStatusEvent(statusEvent, request, modId);
+					
+					// ask to be notified of requested events a second time (panics)					
+					iServer.NotifyModuleStatusEvent(statusEvent, request, modId);
+					
+					// if we get here, something went wrong, so panic
+					SetTestStepResult(EFail);
+					
+					User::Panic(KLbsClientStep_ModStatus, KErrGeneral);
+					}
+					break;
+				case 101:
+					{
+					// This test requires net sim to be open.
+					OpenNetSim();
+					
+					// Select the network module.
+					T_LbsUtils utils;
+					TPositionModuleId modId;
+					modId = utils.GetNetworkModuleIdL(iServer);
+					User::LeaveIfError(iPositioner.Open(iServer, modId));
+					CleanupClosePushL(iPositioner);
+					
+					// Initialise the position info variable.
+					TPositionInfo* posInfo = new(ELeave) TPositionInfo();
+					CleanupStack::PushL(posInfo);
+						
+					// set requested events mask so we get notified on EEventDeviceStatus (any status change)
+					TPositionModuleStatusEvent statusEvent;
+					statusEvent.SetRequestedEvents(TPositionModuleStatusEvent::EEventDeviceStatus);
+					CT_LbsAsyncWaiter* waiter = CT_LbsAsyncWaiter::NewL();
+					iServer.NotifyModuleStatusEvent(statusEvent, waiter->iStatus, modId);
+					
+					// Verify that the module status is ready before we make any requests.
+					DoVerifyModStatus(TPositionModuleStatus::EDeviceReady,modId);
+
+					// Request a position update, we should then see a state change to EDeviceActive
+					TRequestStatus status;		
+					INFO_PRINTF1(_L("Performing NotifyPositionUpdate()"));
+					iPositioner.NotifyPositionUpdate(*posInfo,status);
+					// Use the waiter object so that we can get the device status change.
+					waiter->StartAndWait();
+					waiter->Result();
+					
+					// Check that the change that happened was the correct thing.
+					TPositionModuleStatusEvent::TModuleEvent eventsExpected = TPositionModuleStatusEvent::EEventDeviceStatus;
+					TPositionModuleStatusEvent::TModuleEvent eventsOccurred = statusEvent.OccurredEvents();
+					
+					if(eventsOccurred!=eventsExpected)
+						{
+						INFO_PRINTF1(_L("No Module Status Event have Occured"));
+						SetTestStepResult(EFail);
+						}
+					
+					
+					// Verify the device is now active
+					DoVerifyModStatus(TPositionModuleStatus::EDeviceActive,modId);	
+					
+					INFO_PRINTF1(_L("Position Received"));
+					User::WaitForRequest(status);
+
+					//Verify that the position is EDeviceReady again
+					DoVerifyModStatus(TPositionModuleStatus::EDeviceReady,modId);
+				
+					// Tidy up everything
+					CloseNetSim();					
+					delete waiter;
+					CleanupStack::PopAndDestroy(posInfo);	
+					CleanupStack::PopAndDestroy(&iPositioner);	
+					}
+					break;					
+				default:
+					{
+					User::Panic(KLbsClientStep_ModStatus, KErrUnknown);
+					}					
+				}
+				
+
+			}
+			
+		// All done, clean up.
+		CleanupStack::PopAndDestroy(&iServer);		
+		}
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsClientStep_ModStat::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientstepmultireq.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,463 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientstepmultireq.cpp
+// This is the class implementation for the Multi-Request Tests
+// 
+//
+ 
+#include "ctlbsclientstepmultireq.h"
+
+#include <lbs.h>
+#include <lbscommon.h>
+#include <lbspositioninfo.h>
+#include <lbsipc.h>
+
+#include "tlbsutils.h"
+
+// constant definitions
+_LIT(KLbsClientStepMultiReq, "LbsClientStepMultiReq");
+
+
+/**
+ * Destructor
+ */
+CT_LbsClientStep_MultiReq::~CT_LbsClientStep_MultiReq()
+	{
+	delete	iGetLastKnownPosAO;
+	delete	iNotifyPosUpdateAO;	
+	delete  iTimer;
+	delete 	iTempPosInfo;
+	}
+
+
+/**
+ * Constructor
+ */
+CT_LbsClientStep_MultiReq::CT_LbsClientStep_MultiReq(CT_LbsClientServer& aParent) : CT_LbsClientStep(aParent), iState(EStateUnknown), iTempPosInfo(NULL)
+	{
+	SetTestStepName(KLbsClientStep_MultiReq);
+	}
+
+
+/**
+Static Constructor
+*/
+CT_LbsClientStep_MultiReq* CT_LbsClientStep_MultiReq::NewL(CT_LbsClientServer& aParent)
+	{
+	return new(ELeave) CT_LbsClientStep_MultiReq(aParent);
+	}
+
+
+/**
+Static Constructor
+*/
+CT_LbsClientStep_MultiReq* CT_LbsClientStep_MultiReq::New(CT_LbsClientServer& aParent)
+	{
+	return new CT_LbsClientStep_MultiReq(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+	
+
+/**
+ * 	Callback - called when NotifyPositionUpdate request completes
+ */
+void CT_LbsClientStep_MultiReq::NotifyPositionUpdateCallback(TRequestStatus& aStatus)
+/**
+ *	Called when async NotifyPositionUpdate completes
+ */
+	{
+	TInt testCaseId;
+
+	if (GetIntFromConfig(ConfigSection(), KTestCaseId, testCaseId))
+		{
+		switch (testCaseId)
+			{
+			case 01:		// multiple requests of different types
+				{
+				if(KErrNone == aStatus.Int())
+					{
+					switch(iState)
+						{
+						case EStateUnknown:					
+							{
+							iState = EStateLastNotifyPositionUpdateComplete;
+							}
+							break;
+							
+						case EStateLastKnownPositionComplete:
+							{ 
+							iState = EStateDone;
+							AsyncTidyUp();
+							// note: we'll now drop back into the main test step
+							}
+							break;			
+							
+						case EStateLastNotifyPositionUpdateComplete:
+						case EStateDone :								
+						// fall through
+						default:
+							{
+							User::Panic(KLbsClientStepMultiReq, KErrUnknown);
+							}
+							break;	
+						}	
+					}
+				else
+					{
+					INFO_PRINTF2(_L("NotifyModuleStatusEvent completed. Status = %d"), aStatus.Int());	
+					SetTestStepResult(EFail);
+					AsyncTidyUp();
+					}
+				}// end case 01
+				break;
+			case 02:	// 
+				{
+				switch(iState)
+					{
+					case EStateUnknown:					
+						{
+						iState = EStateLastNotifyPositionUpdateComplete;
+						}
+						break;						
+
+					case EStateLastKnownPositionComplete:
+						{
+						iState = EStateDone;
+						AsyncTidyUp();
+						}
+						break;
+	
+					case EStateLastNotifyPositionUpdateComplete:											
+					case EStateDone :								
+					// fall through
+					default:
+						{
+						User::Panic(KLbsClientStepMultiReq, KErrUnknown);
+						}
+						break;	
+					}	
+				}
+				break;
+			default:
+				{
+				User::Panic(KLbsClientStepMultiReq, KErrUnknown);
+				}
+			
+			}// end switch testCaseId
+		}// end if GetIntFromConfig
+	}
+
+ 
+ 
+/**
+ * 	Callback - called when GetLastKnownPosition request completes
+ */
+void CT_LbsClientStep_MultiReq::GetLastKnownPositionCallback(TRequestStatus& aStatus)
+/**
+ *	Called when NotifyModuleStatusEvent completes
+ */
+	{
+	TInt testCaseId;
+
+	if (GetIntFromConfig(ConfigSection(), KTestCaseId, testCaseId))
+		{
+		switch (testCaseId)
+			{
+			case 01:		// multiple requests of different types
+				{
+				if(KErrNone == aStatus.Int())
+					{
+					switch(iState)
+						{
+						case EStateUnknown:					
+							{
+							iState = EStateLastKnownPositionComplete;
+							}
+							break;
+							
+						case EStateLastNotifyPositionUpdateComplete:				
+							{ 
+							iState = EStateDone;
+							AsyncTidyUp();
+							// note: we'll now drop back into the main test step
+							}
+							break;			
+							
+						case EStateLastKnownPositionComplete:
+						case EStateDone :								
+						// fall through
+						default:
+							{
+							User::Panic(KLbsClientStepMultiReq, KErrUnknown);
+							}
+						break;
+						
+						}	
+					}
+				else
+					{
+					INFO_PRINTF2(_L("NotifyModuleStatusEvent completed. Status =%d"), aStatus.Int());	
+					SetTestStepResult(EFail);
+					AsyncTidyUp();
+					}
+					
+				}// end case 01
+				break;
+			case 02: // NotifyPositionUpdate then GetLKP, latter cancelled
+				{
+				switch(iState)
+					{
+					case EStateUnknown:
+						{
+						iState = EStateLastKnownPositionComplete;
+						TInt err = aStatus.Int();
+						switch(err)
+							{
+							case KErrNone:
+								{
+								INFO_PRINTF1(_L("MultiReq test: Last Known Position request completed successfully"));
+								}
+								break;
+							case KErrCancel:
+								{
+								INFO_PRINTF1(_L("MultiReq test: Last Known Position request completed with KErrCancel"));
+								}
+								break;
+							case KErrUnknown:
+								{
+								INFO_PRINTF1(_L("MultiReq test: Last Known Position request completed with KErrUnknown"));
+								}
+								break;
+							default:
+								{
+		
+								SetTestStepResult(EFail);
+								AsyncTidyUp();								
+								}
+								break;
+							}
+						}
+						break;
+																	
+					case EStateLastNotifyPositionUpdateComplete:	
+						{
+						iState = EStateDone;
+						TInt err = aStatus.Int();
+						if(KErrNone != err)
+							{
+							SetTestStepResult(EFail);
+							}
+						AsyncTidyUp();
+						}
+						break;
+						
+					case EStateLastKnownPositionComplete:						
+					case EStateDone :								
+					// fall through
+					default:
+						{
+						User::Panic(KLbsClientStepMultiReq, KErrUnknown);
+						}					
+					}// end switch(iState)
+				}// end case 2
+				break;
+				
+			default:
+				{
+				User::Panic(KLbsClientStepMultiReq, KErrUnknown);
+				}
+			break;				
+			}
+		}			
+	}
+	
+	
+/**
+ *	tidy up everything
+ */
+void CT_LbsClientStep_MultiReq::AsyncTidyUp()
+	{
+	if ( iTimer->IsActive() )
+		{
+		iTimer->Cancel();
+		}	
+	// Cancel any outstanding requests (to be tested):
+	if(iNotifyPosUpdateAO->IsActive())
+		{
+		iNotifyPosUpdateAO->Cancel();
+		}
+	if(iGetLastKnownPosAO->IsActive())
+		{
+		iGetLastKnownPosAO->Cancel();
+		}
+	CActiveScheduler::Stop();
+	}
+	
+	
+/**
+ *	Callback function - called if timer fires (requests did not all complete in time)
+ */
+static TInt TimerCallback(TAny* aPointer)
+	{
+	//the timer expired and we have not got the responses to our lbs requests
+	static_cast<CT_LbsClientStep_MultiReq*>(aPointer)->INFO_PRINTF1(_L(">>TEST FAILED: timer fired"));
+	static_cast<CT_LbsClientStep_MultiReq*>(aPointer)->AsyncTidyUp();
+	static_cast<CT_LbsClientStep_MultiReq*>(aPointer)->SetTestStepResult(EFail);
+
+	return KErrNone;	
+	}
+	
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsClientStep_MultiReq::doTestStepL()
+	{
+	// Generic test step used to test the LBS Client Notify position update API.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsClientStep_MultiReq::doTestStepL()"));
+		
+	if (TestStepResult()==EPass)
+		{		
+		// Connect to self locate server.
+		User::LeaveIfError(iServer.Connect());
+		CleanupClosePushL(iServer);
+		
+		TInt testCaseId;
+		if (GetIntFromConfig(ConfigSection(), KTestCaseId, testCaseId))
+			{
+			switch (testCaseId)
+				{
+				case 01:		// multiple requests of different types
+					{
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+
+					// Carry out a notify update to ensure last known cache is filled (note: this blocks!)
+					TPositionInfo notifyPosInfo;
+					User::LeaveIfError(DoNotifyUpdateL(notifyPosInfo));
+
+					// Create 2 posinfos and store in our shared array for later verification.
+					RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+					TPositionInfo* posInfoLastKnown = new(ELeave) TPositionInfo();
+					TPositionInfo* posInfoNotifyUpd = new(ELeave) TPositionInfo();
+							
+					T_LbsUtils utils;
+					utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+
+					// these get deleted by the base class destructor
+					posInfoArr.Append(posInfoLastKnown);
+					posInfoArr.Append(posInfoNotifyUpd);
+
+					// Start GetLastKnownPosition request:
+					iGetLastKnownPosAO = CT_LbsClientGetLastKnownPosAO::NewL(*this);					
+				
+					iGetLastKnownPosAO->GetLastKnownPosL(iPositioner, *posInfoLastKnown);
+					
+					// Start NotifyPositionUpdate request:
+					iNotifyPosUpdateAO = CT_LbsClientNotifyPosUpdAO::NewL(*this);
+					
+					iNotifyPosUpdateAO->NotifyPosUpdateL(iPositioner, *posInfoNotifyUpd);
+					
+					// Start a timer to make sure neither of above times out:
+					iTimer = CPeriodic::New(CActive::EPriorityStandard);						
+					TCallBack callbackFunction = TCallBack(TimerCallback, this);
+					iTimer->Start( delay10Seconds, 0, callbackFunction);
+					
+					// can start the scheduler now as there are async requests issued
+					CActiveScheduler::Start();
+					
+					// All requests have now completed (and scheduler stopped)
+					
+					CleanupStack::PopAndDestroy(&iPositioner);					
+					} // end case 1
+					break;
+					
+				case 02:	// cancel one of two outstanding requests
+					{
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+
+					// Create a posinfo and store in our shared array for later verification.
+					RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+					TPositionInfo* posInfoNotifyUpd = new(ELeave) TPositionInfo();
+							
+					T_LbsUtils utils;
+					utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+
+					// this gets deleted by the base class destructor:
+					posInfoArr.Append(posInfoNotifyUpd);
+					
+					// Start NotifyPositionUpdate request:
+					iNotifyPosUpdateAO = CT_LbsClientNotifyPosUpdAO::NewL(*this);
+					
+					iNotifyPosUpdateAO->NotifyPosUpdateL(iPositioner, *posInfoNotifyUpd);
+											
+					// Start a GetLastKnownPosition:
+					// don't put in verify array as this may be cancelled:
+					iTempPosInfo = new(ELeave) TPositionInfo();
+					
+					iGetLastKnownPosAO = CT_LbsClientGetLastKnownPosAO::NewL(*this);					
+				
+					iGetLastKnownPosAO->GetLastKnownPosL(iPositioner, *iTempPosInfo);
+					
+					// cancel the last known position. Note that we do this directly, NOT by calling the AO's cancel()
+					// so that the AO's RunL(), and therefore our callback, will be called and we can check the result
+					TInt err;
+					err = iPositioner.CancelRequest(EPositionerGetLastKnownPosition);
+					if(KErrNotFound != err)
+						{
+						SetTestStepResult(EFail);
+						}
+					
+					// Start a timer to make sure neither of above times out:
+					iTimer = CPeriodic::New(CActive::EPriorityStandard);						
+					TCallBack callbackFunction = TCallBack(TimerCallback, this);
+					
+					//
+					// 
+					// NB - THIS VALUE WAS 10 SEC AND THE TIMER EXPIRED, CAUSING THE TEST
+					// TO FAIL. NEED TO FIND OUT WHY THIS VALUE IS OK BUT THAT ONE WAS NOT.
+					// PUT BACK TEMPORARILY TO GET RID OF REGRESSION FAILURE
+					//
+					iTimer->Start( 22000000, 0, callbackFunction);
+					
+					// can start the scheduler now as there are async requests issued
+					CActiveScheduler::Start();
+					
+					// All requests have now completed
+					
+					CleanupStack::PopAndDestroy(&iPositioner);					
+					}
+					break;
+					
+				default:
+					{
+					User::Leave(KErrArgument);
+					}
+				}// end switch
+			}//end if GetIntFromConfig
+					
+		CleanupStack::PopAndDestroy(&iServer);	
+
+		} // end if TestStepResult
+		
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsClientStep_MultiReq::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientstepnotifyposupdate.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1441 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientstep_notifyposupdate.cpp
+// This is the class implementation for the Notify Position Update Tests
+// 
+//
+ 
+#include "ctlbsclientstepnotifyposupdate.h"
+
+#include <lbs.h>
+#include <lbssatellite.h>
+
+#include "tlbsutils.h"
+#include "ctlbsasyncwaiter.h"
+
+
+// constant definitions
+_LIT(KLbsClientStepNotifyPosUpdate, "LbsClientStepNotifyPosUpdate");
+
+//profile_id in ini file
+_LIT(KLbsProfileId, "profile_id");
+
+//max_time in ini file
+_LIT(KLbsMaxTime, "max_time");
+
+
+const TTimeIntervalMicroSeconds KModuleTimeout = 6000000;//makes test module time out(which should be more than the Maxtime in lbsprofile.ini)
+
+/**
+ *	Sets a Requestor for now - TODO will be removed with new location server
+ */
+void CT_LbsClientStep_NotifyPosUpdate::TempSetRequestorL()
+ 	{	
+	User::LeaveIfError(iPositioner.SetRequestor(	CRequestor::ERequestorService,
+												CRequestor::EFormatApplication,
+												_L("Tom Tom")));
+ 	}
+
+
+/**
+ * Destructor
+ */
+CT_LbsClientStep_NotifyPosUpdate::~CT_LbsClientStep_NotifyPosUpdate()
+	{
+	delete 	iLbsAdmin;	
+	}
+
+
+/**
+ * Constructor
+ */
+CT_LbsClientStep_NotifyPosUpdate::CT_LbsClientStep_NotifyPosUpdate(CT_LbsClientServer& aParent) : CT_LbsClientStep(aParent),iLbsAdmin(NULL),iRequestedAssData(FALSE), iReceivedAssData(FALSE)
+	{
+	
+	SetTestStepName(KLbsClientStep_NotifyPosUpdate);
+	}
+
+
+/**
+Static Constructor
+*/
+CT_LbsClientStep_NotifyPosUpdate* CT_LbsClientStep_NotifyPosUpdate::New(CT_LbsClientServer& aParent)
+	{
+	
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	
+	CT_LbsClientStep_NotifyPosUpdate* testStep = new CT_LbsClientStep_NotifyPosUpdate(aParent);
+	if (testStep)
+		{
+		TInt err = KErrNone;
+
+		TRAP(err, testStep->ConstructL());
+		if (err)
+			{
+			delete testStep;
+			testStep = NULL;
+			}
+		}
+	return testStep;
+	}
+
+
+void CT_LbsClientStep_NotifyPosUpdate::ConstructL()
+	{
+	// create the admin
+	iLbsAdmin = CLbsAdmin::NewL();
+
+	}
+
+//from MT_NotifyPosUpdateObserver:
+/**
+ * 	Callback - called when NotifyPositionUpdate request completes
+ */
+
+void CT_LbsClientStep_NotifyPosUpdate::NotifyPositionUpdateCallback(TRequestStatus& aStatus)
+	{
+	TInt err = aStatus.Int();
+	if (KErrCancel != err)	
+		{
+		SetTestStepResult(EFail); // the request always gets cancelled (see test 0122)
+		}
+	CActiveScheduler::Stop();
+	}
+
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsClientStep_NotifyPosUpdate::doTestStepL()
+	{
+	// Generic test step used to test the LBS Client Notify position update API.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsClientStep_NotifyPosUpdate::doTestStepL()"));
+
+	if (TestStepResult()==EPass)
+		{
+		TInt err = KErrNone;
+				
+		// Connect to self locate server.
+		err = iServer.Connect();
+		User::LeaveIfError(err);
+		CleanupClosePushL(iServer);
+		
+		// Carryout unique test actions.
+		TInt testCaseId;
+		if (GetIntFromConfig(ConfigSection(), KTestCaseId, testCaseId))
+			{
+				switch (testCaseId)
+				{
+				// Test case LBS-NotifyPosUpdate-0001
+				case 1:
+				case 29: // Test case LBS-NotifyPosUpdate-0029
+				case 30: // Test case LBS-NotifyPosUpdate-0030
+				case 101:
+				case 105:
+				case 201: // in Lbs "original" mode no ref position!	
+					{
+					T_LbsUtils utils;
+
+					// Open positioner.
+					err = iPositioner.Open(iServer);
+					User::LeaveIfError(err);
+					CleanupClosePushL(iPositioner);
+
+					// For this test an additional reference position will be returned.
+					if ((testCaseId == 101) || (testCaseId == 105))
+						{
+						
+						if (testCaseId == 105)
+							{	
+							TModuleDataIn modDataIn; // Used to send test information to the test module.
+							modDataIn.iRequestType = TModuleDataIn::EModuleRequestTestMode;
+							modDataIn.iAssDataTestMode = TModuleDataIn::EModuleTestModeAssDataOn_EarlyPosUpdates;
+							// Inform the test module of the required test mode - will block.
+							utils.NotifyModuleOfConfigChangeL(modDataIn);
+							}
+						
+						// Setup netsim.
+						User::LeaveIfError(OpenNetSim());
+						
+						// Request notify for the expected reference position.
+						TPositionInfo actualRefPosInfo;
+						
+						err = DoNotifyUpdateL(actualRefPosInfo);
+						if (err)
+							{
+							INFO_PRINTF2(_L("Failed test, reference position request returned err %d."), err);
+
+							SetTestStepResult(EFail);							
+							}
+							
+						// Verify reference position.
+						TPositionInfo verifyRefPosInfo;
+						
+						verifyRefPosInfo.SetPosition(iRefPos);
+						if (!utils.Compare_PosInfo(verifyRefPosInfo, actualRefPosInfo))
+							{
+							if(!iParent.iSharedData->iTestModuleInUse)
+								{
+								WARN_PRINTF1(_L("WARNING: position received was not reference position"));	
+								}
+							else
+								{	
+								INFO_PRINTF1(_L("Failed test, reference position incorrect."));
+								SetTestStepResult(EFail);
+								}
+							}
+						}
+
+
+					// Create a posinfo and store in our shared array for later verification.
+					RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+					TPositionInfo* posInfo = new(ELeave) TPositionInfo();
+	
+					utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+
+					posInfoArr.Append(posInfo);
+	
+					// Get the actual position
+					err = DoNotifyUpdateL(*posInfo);
+					if (KErrNone != err)
+						{
+						SetTestStepResult(EFail);
+						}
+
+					// Cleanup.
+					CleanupStack::PopAndDestroy(&iPositioner);
+					if ((testCaseId == 101) || (testCaseId == 105))
+						{
+						CloseNetSim();
+						}
+				 
+					break;
+					}
+
+				
+				// Test case LBS-NotifyPosUpdate-0003		
+				case 3:
+					{
+					// Select the Network module because it does not support TPositionSatelliteInfo,
+					// then request position update and expect satellite info, which should return
+					// in KErrArgument.
+					TPositionModuleId	modId;
+					
+					T_LbsUtils utils;
+					modId = utils.GetNetworkModuleIdL(iServer);
+
+					// Select the network module.
+					User::LeaveIfError(iPositioner.Open(iServer, modId));
+					CleanupClosePushL(iPositioner);
+
+					// Try to get the actual position, using TPositionSatellite which is not
+					// supported by the selected module.
+					TPositionSatelliteInfo posInfo;
+					
+					err = DoNotifyUpdateL(posInfo);
+					if (KErrArgument == err)
+						{
+						INFO_PRINTF2(_L("correct err %d returned"), err);
+						}
+					else
+						{
+						INFO_PRINTF2(_L("incorrect err %d returned"), err);
+						SetTestStepResult(EFail);
+						}						
+					
+					CleanupStack::PopAndDestroy(&iPositioner);
+					break;
+					}
+					
+				// Test case LBS-NotifyPosUpdate-0005						
+				case 5:	
+					{
+				
+					CLbsAdmin::TSelfLocateService selflocate;
+					
+					
+					User::LeaveIfError(iLbsAdmin->Set(KLbsSettingHomeSelfLocate, CLbsAdmin::ESelfLocateOff));
+					User::LeaveIfError(iLbsAdmin->Get(KLbsSettingHomeSelfLocate, selflocate));
+					
+					if(selflocate != CLbsAdmin::ESelfLocateOff)
+						{
+						SetTestStepResult(EFail);
+						}
+					else
+						{
+						// Open positioner.
+						err = iPositioner.Open(iServer);
+						User::LeaveIfError(err);
+						CleanupClosePushL(iPositioner);
+
+						TPositionInfo notifyPosInfo;
+						err = DoNotifyUpdateL(notifyPosInfo);
+						if(KErrAccessDenied != err)
+							{
+							SetTestStepResult(EFail);
+							}
+						}
+					User::LeaveIfError(iLbsAdmin->Set(KLbsSettingHomeSelfLocate, CLbsAdmin::ESelfLocateOn));
+
+				    CleanupStack::PopAndDestroy(&iPositioner);
+	
+					}
+					break;
+				
+				// Test case LBS-NotifyPosUpdate-0006	
+				case 6:	
+					{
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+
+					TPositionInfo posInfoNotifyUpd;
+					
+					TRequestStatus status;
+					TBool cancelled;
+					
+					TempSetRequestorL();
+					iPositioner.NotifyPositionUpdate(posInfoNotifyUpd, status);
+					
+					TInt err = iPositioner.CancelRequest(EPositionerNotifyPositionUpdate);
+					
+					if(KErrNone == err)
+						{
+							cancelled = TRUE;
+						}
+					else
+						{
+							cancelled = FALSE;
+						}
+											
+					// this should complete with either KErrNone or KErrCancel
+					User::WaitForRequest(status);
+					
+					err = status.Int();
+					
+					if(cancelled)
+						{
+						if((KErrCancel != err) && (KErrNone != err))
+							{
+							SetTestStepResult(EFail); 
+							}
+						}
+					else
+						{
+						if(KErrNone != err)
+							{
+							SetTestStepResult(EFail);
+							}
+						}
+											
+					CleanupStack::PopAndDestroy(&iPositioner);					
+
+					}
+					break;
+					
+			  	// Test case LBS-NotifyPosUpdate-0007
+				case 7:
+					{
+					// Note: Not connecting to position server.
+					TPositionInfo notifyPosInfo;
+					TRequestStatus status;
+					
+					// should panic with EPositionServerBadHandle 
+					iPositioner.NotifyPositionUpdate(notifyPosInfo, status);
+					}
+					break;
+					
+				// Test case LBS-NotifyPosUpdate-0008
+				case 8:	
+					{
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+				
+					TPositionInfo notifyPosInfo, notifyPosInfo2;
+					TRequestStatus status, status2;
+					
+					TempSetRequestorL();
+					// attempt multiple NotifyPositionUpdates on same subsession:
+					iPositioner.NotifyPositionUpdate(notifyPosInfo, status);
+					
+					// expected to panic with EPositionDuplicateRequest:
+					iPositioner.NotifyPositionUpdate(notifyPosInfo2, status2);
+					
+					// need to block here so that loc server can run and recieve both
+					// requests - its the second request that causes the panic!
+					User::After(1);
+					// if we get here, we've failed to panic
+					SetTestStepResult(EFail);
+										
+					CleanupStack::PopAndDestroy(&iPositioner);					
+					}
+					break;						
+					
+				// Test case LBS-NotifyPosUpdate-0014	INCOMPLETE
+				case 14:
+					{
+					// Set 'autonomous' mode
+					CLbsAdmin::TGpsMode mode;
+					
+					User::LeaveIfError(iLbsAdmin->Set(KLbsSettingHomeGpsMode, CLbsAdmin::EGpsAutonomous));
+					User::LeaveIfError(iLbsAdmin->Get(KLbsSettingHomeGpsMode, mode));
+					
+					// TODO: figure out how to get notifications of assistance data requests (MLbsNetSimTestObserver?)
+					// If we get notification before Notify Update completes, then we fail
+					
+					if(mode != CLbsAdmin::EGpsAutonomous)
+						{
+						SetTestStepResult(EFail);
+						}
+					else	// Request a location update
+						{
+						// Open positioner.
+						User::LeaveIfError(iPositioner.Open(iServer));
+						CleanupClosePushL(iPositioner);
+				
+						// Create a posinfos and store in our shared array for later verification.
+						RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+								
+						T_LbsUtils utils;
+						utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+						
+						TPositionInfo* posInfoNotifyUpd = new(ELeave) TPositionInfo();
+
+						posInfoArr.Append(posInfoNotifyUpd);
+						
+						err = DoNotifyUpdateL(*posInfoNotifyUpd);
+						if (KErrNone != err)
+							{
+							SetTestStepResult(EFail);
+							}
+							
+						CleanupStack::PopAndDestroy(&iPositioner);
+						}
+					
+					
+					}
+					break;
+
+				// Test case LBS-NotifyPosUpdate-0015	UNSUPPORTED
+				case 15:
+					{
+					// this test should not be run; lbs currently doesn't support AlwaysTerminalBased mode
+					__ASSERT_ALWAYS(FALSE, User::Panic(_L("LBS-NotifyPosUpdate-0015 should not be run"), KErrNotSupported));					
+					
+					// Set 'assisted-only' (EGpsAlwaysTerminalBased) mode
+					CLbsAdmin::TGpsMode mode;
+					
+					User::LeaveIfError(iLbsAdmin->Set(KLbsSettingHomeGpsMode, CLbsAdmin::EGpsAlwaysTerminalBased));
+					User::LeaveIfError(iLbsAdmin->Get(KLbsSettingHomeGpsMode, mode));
+					
+					// TODO: figure out how to get notifications of assistance data requests (MLbsNetSimTestObserver?)
+					// If we do not get notification before Notify Update completes, then we fail
+					
+					if(mode != CLbsAdmin::EGpsAlwaysTerminalBased)
+						{
+						SetTestStepResult(EFail);
+						}
+					else	// Request a location update
+						{
+						// Open positioner.
+						User::LeaveIfError(iPositioner.Open(iServer));
+						CleanupClosePushL(iPositioner);
+				
+						// Create a posinfos and store in our shared array for later verification.
+						RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+								
+						T_LbsUtils utils;
+						utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+						
+						TPositionInfo* posInfoNotifyUpd = new(ELeave) TPositionInfo();
+
+						posInfoArr.Append(posInfoNotifyUpd);
+						
+						err = DoNotifyUpdateL(*posInfoNotifyUpd);	// can use this blocking version if netsim uses callbacks for assistance data notifications
+						// TODO iRequestedAssData needs to be set in assist data callback
+						if (KErrNone != err || !iRequestedAssData || !iReceivedAssData)
+							{
+							SetTestStepResult(EFail);
+							}
+							
+						// verify that preferred positioning mode was used:
+						if(EPositionModeReasonNone != posInfoNotifyUpd->PositionMode())
+							{
+							SetTestStepResult(EFail);
+							}
+						
+						CleanupStack::PopAndDestroy(&iPositioner);
+						}
+					}
+					break;
+					
+				// Test case LBS-NotifyPosUpdate-0016	INCOMPLETE
+				case 16:
+					{
+					// Set 'assisted-if-possible' (EGpsPreferTerminalBased) mode
+					CLbsAdmin::TGpsMode mode;
+					
+					User::LeaveIfError(iLbsAdmin->Set(KLbsSettingHomeGpsMode, CLbsAdmin::EGpsPreferTerminalBased));
+					User::LeaveIfError(iLbsAdmin->Get(KLbsSettingHomeGpsMode, mode));
+					
+					#pragma message("TO DO: LBS-NotifyPosUpdate-0016	INCOMPLETE")					
+					// figure out how to get notifications of assistance data requests (MLbsNetSimTestObserver?)
+					// If we do not get notification before Notify Update completes, then we fail
+					
+					// do we need to do something to make sure that we require assistancce data (no assistance data already retrieved)?
+					
+					// Configure NetSim to indciate that network is not available
+					
+					
+					if(mode != CLbsAdmin::EGpsPreferTerminalBased)
+						{
+						SetTestStepResult(EFail);
+						}
+					else	// Request a location update
+						{
+						// Open positioner.
+						User::LeaveIfError(iPositioner.Open(iServer));
+						CleanupClosePushL(iPositioner);
+				
+						// Create a posinfos and store in our shared array for later verification.
+						RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+								
+						T_LbsUtils utils;
+						utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+						
+						TPositionInfo* posInfoNotifyUpd = new(ELeave) TPositionInfo();
+
+						posInfoArr.Append(posInfoNotifyUpd);
+						
+						err = DoNotifyUpdateL(*posInfoNotifyUpd);	// can use this blocking version if netsim uses callbacks for assistance data notifications
+						if (KErrNone != err || !iRequestedAssData)
+							{
+							SetTestStepResult(EFail);
+							}
+							
+						// verify that preferred positioning mode was not used:
+						if(EPositionModeReasonNetworkError != posInfoNotifyUpd->PositionMode())
+							{
+							SetTestStepResult(EFail);
+							}
+						
+						CleanupStack::PopAndDestroy(&iPositioner);
+						}
+					}
+					break;
+					
+				// Test case LBS-NotifyPosUpdate-0017	UNSUPPORTED
+				case 17:
+					{
+					// this test should not be run; lbs currently doesn't support AlwaysTerminalBased mode
+					__ASSERT_ALWAYS(FALSE, User::Panic(_L("LBS-NotifyPosUpdate-0017 should not be run"), KErrNotSupported));
+										
+					// Set 'assisted-only' (EGpsAlwaysTerminalBased) mode
+					CLbsAdmin::TGpsMode mode;
+					
+					User::LeaveIfError(iLbsAdmin->Set(KLbsSettingHomeGpsMode, CLbsAdmin::EGpsAlwaysTerminalBased));
+					User::LeaveIfError(iLbsAdmin->Get(KLbsSettingHomeGpsMode, mode));					
+					
+					// Configure NetSim to indciate that network is not available
+					
+					
+					if(mode != CLbsAdmin::EGpsAlwaysTerminalBased)
+						{
+						SetTestStepResult(EFail);
+						}
+					else	// Request a location update
+						{
+						// Open positioner.
+						User::LeaveIfError(iPositioner.Open(iServer));
+						CleanupClosePushL(iPositioner);
+										
+						TPositionInfo posInfoNotifyUpd;
+						
+						err = DoNotifyUpdateL(posInfoNotifyUpd);	// can use this blocking version if netsim uses callbacks for assistance data notifications
+						if (KErrPositionMethodFailure != err)
+							{
+							SetTestStepResult(EFail);
+							}
+						
+						CleanupStack::PopAndDestroy(&iPositioner);
+						}
+					}
+					break;
+					
+				// Test case LBS-NotifyPosUpdate-0018	INCOMPLETE
+				case 18:
+					{
+					#pragma message("TO DO: LBS-NotifyPosUpdate-0018	INCOMPLETE")
+					// Set 'assisted-if-possible' (EGpsPreferTerminalBased) mode
+					CLbsAdmin::TGpsMode mode;
+					
+					User::LeaveIfError(iLbsAdmin->Set(KLbsSettingHomeGpsMode, CLbsAdmin::EGpsPreferTerminalBased));
+					User::LeaveIfError(iLbsAdmin->Get(KLbsSettingHomeGpsMode, mode));
+					
+					// TODO: figure out how to get notifications of assistance data requests (MLbsNetSimTestObserver?)
+					// If we do not get notification before Notify Update completes, then we fail
+					
+					// TODO: do we need to do something to make sure that we require assistancce data (no assistance data already retrieved)?
+					
+					// TODO Configure NetSim to return bad/no assistance data
+					// this may involve writing an assistance data plugin to provide bad data!?
+					
+					if(mode != CLbsAdmin::EGpsPreferTerminalBased)
+						{
+						SetTestStepResult(EFail);
+						}
+					else	// Request a location update
+						{
+						// Open positioner.
+						User::LeaveIfError(iPositioner.Open(iServer));
+						CleanupClosePushL(iPositioner);
+				
+						// Create a posinfos and store in our shared array for later verification.
+						RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+								
+						T_LbsUtils utils;
+						utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+						
+						TPositionInfo* posInfoNotifyUpd = new(ELeave) TPositionInfo();
+
+						posInfoArr.Append(posInfoNotifyUpd);
+						
+						err = DoNotifyUpdateL(*posInfoNotifyUpd);	// can use this blocking version if netsim uses callbacks for assistance data notifications
+						if (KErrNone != err || !iRequestedAssData)
+							{
+							SetTestStepResult(EFail);
+							}
+							
+						// verify that preferred positioning mode was not used and appropriate reason given:
+						if(EPositionModeReasonDataError != posInfoNotifyUpd->PositionMode())
+							{
+							SetTestStepResult(EFail);
+							}
+						
+						CleanupStack::PopAndDestroy(&iPositioner);
+						}
+					}
+					break;
+
+				// Test case LBS-NotifyPosUpdate-0019
+				case 19:
+					{
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+			
+					// Create a posinfos and store in our shared array for later verification.
+					RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+							
+					T_LbsUtils utils;
+					utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+					
+					TInt numPositions = iParent.iSharedData->iVerifyPosInfoArr.Count();
+					while(numPositions--)
+						{
+						TPositionInfo* posInfoNotifyUpd = new(ELeave) TPositionInfo();
+
+						posInfoArr.Append(posInfoNotifyUpd);
+						
+						User::After(500*1000); 	// on Winscw all the target time requests
+												// can get stamped with exactly the same
+												// time and thus all three requests may be
+												// satified from the one the bus
+												// then the test fails! This behaviour is OK but 
+												// not what the test is trying to test for . Hence ensure
+												// all three target times are different by the delay
+
+						err = DoNotifyUpdateL(*posInfoNotifyUpd);
+						if (KErrNone != err)
+							{
+							SetTestStepResult(EFail);
+							}
+						}
+	
+					// Cleanup.
+					CleanupStack::PopAndDestroy(&iPositioner);
+					}
+					break;									
+
+			    // Test case LBS-NotifyPosUpdate-0022	
+			    case 22:
+					{
+					TInt profileid_ini,maxtime_ini;
+			        TBool profileid_exists,maxtime_exists;
+			        profileid_exists = GetIntFromConfig(ConfigSection(), KLbsProfileId, profileid_ini);
+		            if(!profileid_exists)
+						{
+						INFO_PRINTF1(_L("Could not get profileid from ini file"));
+			    		SetTestStepResult(EFail);
+			    		}
+					
+			    	maxtime_exists = GetIntFromConfig(ConfigSection(), KLbsMaxTime, maxtime_ini);
+		            if(!maxtime_exists)
+						{
+						INFO_PRINTF1(_L("Could not get maxtime from ini file"));
+			    		SetTestStepResult(EFail);
+			    		}
+										
+					TLbsQualityProfileId profileId;
+					//Set SelfLocate quality profile & valid id(which is exist in lbsprofile.ini)
+					User::LeaveIfError(iLbsAdmin->Set(KLbsSettingQualityProfileSelfLocate, TLbsQualityProfileId(profileid_ini)));
+					// Verify that the setting is what we expect
+					User::LeaveIfError(iLbsAdmin->Get(KLbsSettingQualityProfileSelfLocate, profileId));
+					if(profileId != TLbsQualityProfileId(profileid_ini))
+						{
+						SetTestStepResult(EFail);
+						}
+					else	// Request a location update
+						{
+						// Open positioner.
+						User::LeaveIfError(iPositioner.Open(iServer));
+						CleanupClosePushL(iPositioner);
+				
+						// Create a posinfos and store in our shared array for later verification.
+						RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+								
+						T_LbsUtils utils;
+						utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+						
+						TPositionInfo* posInfoNotifyUpd = new(ELeave) TPositionInfo();
+						posInfoArr.Append(posInfoNotifyUpd);
+                        
+                        TTime timeRequested,timeReceived;
+                                               
+                        // Position requested at
+						timeRequested.UniversalTime();
+                                                                      
+                        //Do request position update
+                        err = DoNotifyUpdateL(*posInfoNotifyUpd);
+						if ((KErrNone != err) && (KPositionQualityLoss != err))
+							{
+							INFO_PRINTF2(_L("NotifyUpdate failed with %d "), err);	
+							SetTestStepResult(EFail);
+							}
+                        //Need to verify MaxTime 
+                        else						
+					     {
+					     // Check we dont have a final network postion
+					     if (posInfoNotifyUpd->PositionMode() & TPositionModuleInfo::ETechnologyNetwork)
+					     	{
+					     	INFO_PRINTF1(_L("Failed: Recieved a final network postion"));
+					     	SetTestStepResult(EFail);
+					     	}
+					     
+					     TPosition pos;
+						 posInfoNotifyUpd->GetPosition(pos);
+						 //Position received at
+						 timeReceived = pos.Time();
+					     
+					     //Timedifference between position actually received and position actually requested
+					     TInt64 timediff;
+	                     timediff = timeReceived.Int64() - timeRequested.Int64();
+	                	 //compare timediff with maxtime 
+						 if(timediff > maxtime_ini)
+							{
+							INFO_PRINTF1(_L("Failed: Position received outside time range"));
+							SetTestStepResult(EFail);									
+						    }
+					     					     
+					    }
+						
+						CleanupStack::PopAndDestroy(&iPositioner);
+						}
+					}
+					break;
+					
+				// Test case LBS-NotifyPosUpdate-0024						
+				case 24: 					
+				// Test case LBS-NotifyPosUpdate-0025
+				case 25:
+					{
+				    TInt profileid_ini;
+			        TBool profileid_exists;
+			        profileid_exists = GetIntFromConfig(ConfigSection(), KLbsProfileId, profileid_ini);
+		            if(!profileid_exists)
+						{
+						INFO_PRINTF1(_L("Could not get profileid from section"));
+			    		SetTestStepResult(EFail);
+			    		}
+										
+					TLbsQualityProfileId profileId;
+					//Set SelfLocate quality profile & valid id(which is exist in lbsprofile.ini) 
+					User::LeaveIfError(iLbsAdmin->Set(KLbsSettingQualityProfileSelfLocate, TLbsQualityProfileId(profileid_ini)));
+					// Verify that the setting is what we expect
+					User::LeaveIfError(iLbsAdmin->Get(KLbsSettingQualityProfileSelfLocate, profileId));
+					if(profileId != TLbsQualityProfileId(profileid_ini))
+						{
+						SetTestStepResult(EFail);
+						}
+					else	// Request a location update
+						{
+						if(testCaseId==24) 
+						   {
+							//makes test module timeout
+							if (iParent.iSharedData->iTestModuleInUse)
+								{
+								T_LbsUtils utils;
+								TModuleDataIn modDataIn;
+
+								modDataIn.iRequestType = TModuleDataIn::EModuleRequestTimeOut;
+								modDataIn.iTimeOut = KModuleTimeout;
+							
+								utils.NotifyModuleOfConfigChangeL(modDataIn);	// This will block.
+								}
+						   }
+						// Open positioner.
+						User::LeaveIfError(iPositioner.Open(iServer));
+						CleanupClosePushL(iPositioner);
+				
+						TPositionInfo posInfoNotifyUpd;
+						//Do request to position update
+                        err = DoNotifyUpdateL(posInfoNotifyUpd);
+				        //Position received at
+						
+						if (testCaseId == 24)
+							{
+							if (err != KErrTimedOut)
+								{
+								INFO_PRINTF1(_L("<FONT><B>position update not failed with error -33</B></FONT>"));
+								SetTestStepResult(EFail);
+								}
+
+							}
+						else
+							{
+							if (err != KPositionQualityLoss)
+								SetTestStepResult(EFail);
+							}				
+					    											
+						CleanupStack::PopAndDestroy(&iPositioner);
+						}
+					}
+					break;
+
+				// Test case LBS-NotifyPosUpdate-0027
+				case 27:
+				// Test case LBS-NotifyPosUpdate-0028
+				case 28:
+					{
+					TInt profileid_ini;
+			        TBool profileid_exists;
+			        TPositionUpdateOptions options;
+					T_LbsUtils utils;
+
+					profileid_exists = GetIntFromConfig(ConfigSection(), KLbsProfileId, profileid_ini);
+		            if(!profileid_exists)
+						{
+						INFO_PRINTF1(_L("Could not get profileid from ini file"));
+			    		SetTestStepResult(EFail);
+			    		}
+					
+					//Set SelfLocate quality profile & valid id(which is exist in lbsprofile.ini)
+					User::LeaveIfError(iLbsAdmin->Set(KLbsSettingQualityProfileSelfLocate, TLbsQualityProfileId(profileid_ini)));
+
+					if(testCaseId==28) 
+					   {
+						//makes test module timeout
+						const TTimeIntervalMicroSeconds KModuleTimeout = 60000000; // 1 minute
+						if (iParent.iSharedData->iTestModuleInUse)
+							{
+							T_LbsUtils utils;
+							TModuleDataIn modDataIn;
+
+							modDataIn.iRequestType = TModuleDataIn::EModuleRequestTimeOut;
+							modDataIn.iTimeOut = KModuleTimeout;
+								
+							utils.NotifyModuleOfConfigChangeL(modDataIn);	// This will block.
+							}
+					   }
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+			
+					// Create a posinfos and store in our shared array for later verification.
+					RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+					utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+
+					TPositionInfo* posInfoUpd = new(ELeave) TPositionInfo();
+					posInfoArr.Append(posInfoUpd);
+					
+					
+ 					options.SetUpdateInterval(0);
+ 					const TTimeIntervalMicroSeconds KMaxFix = 30000000; // 30s
+					options.SetUpdateTimeOut(KMaxFix); 					
+ 					iPositioner.SetUpdateOptions(options);
+	
+					err = DoNotifyUpdateL(*posInfoUpd);
+					
+					if (testCaseId == 27)
+						{
+						if (err != KPositionQualityLoss)
+							SetTestStepResult(EFail);
+						}
+					else
+						{
+						if (err != KErrTimedOut)
+							SetTestStepResult(EFail);
+						}				
+					// Cleanup.
+					CleanupStack::PopAndDestroy(&iPositioner);
+					}
+					break;									
+				
+				case 26:
+					{
+					//Set up a 15 second interval between updates, with a 5 second timeout
+					TPositionUpdateOptions posUpdateOpts(15000000, 5000000, 0, EFalse);
+
+					// Open positioner.											    
+					err = iPositioner.Open(iServer);
+					User::LeaveIfError(err);
+					if(err != KErrNone)
+						{
+						INFO_PRINTF1(_L("** SubSession Failed to open **"));
+						SetTestStepResult(EFail);	
+						}
+					CleanupClosePushL(iPositioner);
+
+					TPositionInfo* posInfo = new(ELeave) TPositionInfo();
+					CleanupStack::PushL(posInfo);
+
+					iPositioner.SetUpdateOptions(posUpdateOpts);	
+					User::LeaveIfError(iPositioner.SetRequestor(	CRequestor::ERequestorService,
+																CRequestor::EFormatApplication,
+																_L("Tom Tom")));
+					TRequestStatus status;		
+																			
+					//Ask for a position update (should get this one)
+					iPositioner.NotifyPositionUpdate(*posInfo,status);
+
+					User::WaitForRequest(status);						 	
+					if(status != KErrNone)
+						{
+						INFO_PRINTF2(_L("Failed test, expected KErrNone, request finished with err %d."), status.Int());
+						SetTestStepResult(EFail);
+						}			   
+
+const TTimeIntervalMicroSeconds KModuleTimeout = 60000000; // 1 minute
+const TTimeIntervalMicroSeconds KModuleNoTimeout = 0; 
+					// Set a delay in the test AGPS manager big enough to guarantee 
+					// we won't get a response to the next one
+					if (iParent.iSharedData->iTestModuleInUse)
+						{
+						T_LbsUtils utils;
+						TModuleDataIn modDataIn;
+
+						modDataIn.iRequestType = TModuleDataIn::EModuleRequestTimeOut;
+						modDataIn.iTimeOut = KModuleTimeout;
+							
+						utils.NotifyModuleOfConfigChangeL(modDataIn);	// This will block.
+						}
+
+					// Try again. Shouldn't get a response this time as it times out.
+					iPositioner.NotifyPositionUpdate(*posInfo,status);
+
+					User::WaitForRequest(status);	
+					if(status != KErrTimedOut)
+						{
+						INFO_PRINTF2(_L("Failed test, expected KErrTimedOut, request finished with err %d."), status.Int());
+						SetTestStepResult(EFail);
+						}			   
+
+					// Get rid of the AGPS manager delay.
+					if (iParent.iSharedData->iTestModuleInUse)
+						{
+						T_LbsUtils utils;
+						TModuleDataIn modDataIn;
+
+						modDataIn.iRequestType = TModuleDataIn::EModuleRequestTimeOut;
+						modDataIn.iTimeOut = KModuleNoTimeout;
+							
+						utils.NotifyModuleOfConfigChangeL(modDataIn);	// This will block.
+						}
+	
+					//Ask for a position update (should get this one again)
+					iPositioner.NotifyPositionUpdate(*posInfo,status);
+
+					User::WaitForRequest(status);						 	
+					if(status != KErrNone)
+						{
+						INFO_PRINTF2(_L("Failed test, expected KErrNone, request finished with err %d."), status.Int());
+						SetTestStepResult(EFail);
+						}			   
+						
+					iPositioner.Close();
+
+					CleanupStack::PopAndDestroy(posInfo);
+					CleanupStack::PopAndDestroy(&iPositioner);
+					} // case 26
+				break;
+				 // Test case LBS-NotifyPosUpdate-0122	
+			    case 122:
+					{
+					const TLbsQualityProfileId KLbsTest0122QualityProfileId = 5;
+					TLbsQualityProfileId profileId122(KLbsTest0122QualityProfileId);
+					TLbsQualityProfileId oldProfileId(9);
+    				iLbsAdmin->Get(KLbsSettingQualityProfileSelfLocate, oldProfileId);
+	
+    				iLbsAdmin->Set(KLbsSettingQualityProfileSelfLocate, profileId122);
+    				
+    				iLbsAdmin->Get(KLbsSettingQualityProfileSelfLocate, profileId122);
+					if (profileId122 != KLbsTest0122QualityProfileId)
+						{
+						INFO_PRINTF2(_L("Fail test: profile should be 5 but its %d."), profileId122);
+						SetTestStepResult(EFail);
+						}
+					
+					// the profile.ini file contains a MaxTime= 2147483647
+					CT_LbsClientNotifyPosUpdAO* notifyPosUpdateAO;
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+
+					// Create a posinfo and store in our shared array for later verification.
+					RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+					TPositionInfo* posInfoNotifyUpd = new(ELeave) TPositionInfo();
+							
+					T_LbsUtils utils;
+					utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+
+					// this gets deleted by the base class destructor:
+					posInfoArr.Append(posInfoNotifyUpd);
+					
+					TModuleDataIn modDataIn;
+
+					modDataIn.iRequestType = TModuleDataIn::EModuleRequestTimeOut;
+					modDataIn.iTimeOut = KModuleTimeout;
+						
+					utils.NotifyModuleOfConfigChangeL(modDataIn);	// This will block.
+			
+					// Start NotifyPositionUpdate request:
+					notifyPosUpdateAO = CT_LbsClientNotifyPosUpdAO::NewL(*this);
+					
+					notifyPosUpdateAO->NotifyPosUpdateL(iPositioner, *posInfoNotifyUpd);
+			//		User::After(3*1000*1000);
+		
+					
+					TInt err;
+					err = iPositioner.CancelRequest(EPositionerNotifyPositionUpdate);
+					if(KErrNone != err)
+						{
+						SetTestStepResult(EFail);
+						}
+						
+					// can start the scheduler now as there are async requests issued
+					CActiveScheduler::Start();
+						
+					CleanupStack::PopAndDestroy(&iPositioner);	
+					
+	 				iLbsAdmin->Set(KLbsSettingQualityProfileSelfLocate, oldProfileId);
+  
+				
+					}
+					break;
+						
+ 				// Test that the final network position is not passed on to the client if they
+ 				// switch to autonomous mode mid-way through a session.
+ 				case 1001:
+ 					{
+ 					// Set preferred TB mode
+ 					// Set 'assisted-if-possible' (EGpsPreferTerminalBased) mode
+ 					CLbsAdmin::TGpsMode mode;
+ 					
+ 					User::LeaveIfError(iLbsAdmin->Set(KLbsSettingHomeGpsMode, CLbsAdmin::EGpsPreferTerminalBased));
+ 					User::LeaveIfError(iLbsAdmin->Get(KLbsSettingHomeGpsMode, mode));
+ 					
+ 					if(mode != CLbsAdmin::EGpsPreferTerminalBased)
+ 						{
+ 						SetTestStepResult(EFail);
+ 						}
+ 					else	// Request a location update
+ 						{
+ 
+ 						// Open positioner.
+ 						User::LeaveIfError(iPositioner.Open(iServer));
+ 
+ 						const TTimeIntervalMicroSeconds KMicroSecondsValue(60*1000*1000);
+ 						TPositionUpdateOptions posOption;
+ 						posOption.SetUpdateTimeOut(KMicroSecondsValue);
+ 						User::LeaveIfError(iPositioner.SetUpdateOptions(posOption));
+ 
+ 						CleanupClosePushL(iPositioner);
+ 
+ 						// Create a posinfos and store in our shared array for later verification.
+ 						RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+ 								
+ 						T_LbsUtils utils;
+ 						utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+ 						
+ 						// Setup netsim.
+ 						User::LeaveIfError(OpenNetSim());
+ 						TLbsNetPosRequestQuality quality;
+ 						quality.SetMinHorizontalAccuracy(200);
+ 						quality.SetMinVerticalAccuracy(20000);
+ 						iNetSim.SetQuality(quality);
+ 						
+ 						TPositionInfo* posInfoNotifyUpd = new(ELeave) TPositionInfo();
+ 
+ 						posInfoArr.Append(posInfoNotifyUpd);
+ 						
+ 						// Send the first NPUD & block on response
+ 						err = DoNotifyUpdateL(*posInfoNotifyUpd);
+ 						if (KErrNone != err)
+ 							{
+ 							SetTestStepResult(EFail);
+ 							}
+ 							
+ 						// Set autonomous mode
+ 						CLbsAdmin::TGpsMode mode;
+ 						
+ 						User::LeaveIfError(iLbsAdmin->Set(KLbsSettingHomeGpsMode, CLbsAdmin::EGpsAutonomous));
+ 						User::LeaveIfError(iLbsAdmin->Get(KLbsSettingHomeGpsMode, mode));
+ 						
+ 						if(mode != CLbsAdmin::EGpsAutonomous)
+ 							{
+ 							SetTestStepResult(EFail);
+ 							}
+ 						else	// Request a location update
+ 							{
+ 							//TPositionModuleInfo::TTechnologyType techType;
+ 
+ 							// Send the second NPUD & block on response
+ 							err = DoNotifyUpdateL(*posInfoNotifyUpd);
+ 							
+ 							// This should not give a final network position response
+ 							//techType = posInfoNotifyUpd->PositionMode();
+ 							
+ 							if(err != KPositionQualityLoss)
+ 								{							
+ 								SetTestStepResult(EFail);
+ 								}
+ 							}
+ 							
+ 						CleanupStack::PopAndDestroy(&iPositioner);
+ 						CloseNetSim();
+ 						}
+ 
+ 					break;
+ 					}						
+								
+				// Test that the final network position is not passed on to the client if they
+				// switch to autonomous mode mid-way through a session.
+				case 1002:
+					{
+					// Set preferred TB mode
+					// Set 'assisted-if-possible' (EGpsPreferTerminalBased) mode
+					CLbsAdmin::TGpsMode mode;
+					
+					User::LeaveIfError(iLbsAdmin->Set(KLbsSettingHomeGpsMode, CLbsAdmin::EGpsPreferTerminalBased));
+					User::LeaveIfError(iLbsAdmin->Get(KLbsSettingHomeGpsMode, mode));
+					
+					if(mode != CLbsAdmin::EGpsPreferTerminalBased)
+						{
+						SetTestStepResult(EFail);
+						}
+					else	// Request a location update
+						{
+
+						// Open positioner.
+						User::LeaveIfError(iPositioner.Open(iServer));
+
+						const TTimeIntervalMicroSeconds KMicroSecondsValue(60*1000*1000);
+						TPositionUpdateOptions posOption;
+						posOption.SetUpdateTimeOut(KMicroSecondsValue);
+						User::LeaveIfError(iPositioner.SetUpdateOptions(posOption));
+
+						CleanupClosePushL(iPositioner);
+
+						// Create a posinfos and store in our shared array for later verification.
+						RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+								
+						T_LbsUtils utils;
+						utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+						
+						// Setup netsim.
+						User::LeaveIfError(OpenNetSim());
+						TLbsNetPosRequestQuality quality;
+						quality.SetMinHorizontalAccuracy(200);
+						quality.SetMinVerticalAccuracy(20000);
+						iNetSim.SetQuality(quality);
+						
+						TPositionInfo* posInfoNotifyUpd = new(ELeave) TPositionInfo();
+
+						posInfoArr.Append(posInfoNotifyUpd);
+						
+						// Send the first NPUD & block on response
+						err = DoNotifyUpdateL(*posInfoNotifyUpd);
+						if (KErrNone != err)
+							{
+							SetTestStepResult(EFail);
+							}
+							
+						TPositionModuleInfo::TTechnologyType techType;
+						
+						// Wait for 10 seconds to allow the FNP to come in then send the next NPUD
+						User::After(10*1000*1000);
+
+						// Send the second NPUD & block on response
+						err = DoNotifyUpdateL(*posInfoNotifyUpd);
+						
+						// This should give a final network position response
+						techType = posInfoNotifyUpd->PositionMode();
+						
+						if(techType != (TPositionModuleInfo::ETechnologyNetwork | 
+										TPositionModuleInfo::ETechnologyAssisted))
+							{							
+							INFO_PRINTF1(_L("Failed test, did not get a final network position."));
+							SetTestStepResult(EFail);
+							}
+							
+						CleanupStack::PopAndDestroy(&iPositioner);
+						CloseNetSim();
+						}
+
+					break;
+					}
+				
+				//Tests within SetUpdateOptions test to ensure that the correct Location Position
+				// is retured from the cache on a second NPUD (with correct MaxAge set).  This test
+				// tests to make sure that if the last position to arrive was a reference position
+				// that the reference position is returned
+				case 1003:
+					{
+					//Setup in the TB mode
+					CLbsAdmin::TGpsMode mode;
+					
+					User::LeaveIfError(iLbsAdmin->Set(KLbsSettingHomeGpsMode, CLbsAdmin::EGpsPreferTerminalBased));
+					User::LeaveIfError(iLbsAdmin->Get(KLbsSettingHomeGpsMode, mode));
+					
+					if(mode != CLbsAdmin::EGpsPreferTerminalBased)
+						{
+						SetTestStepResult(EFail);
+						}
+					else	// Request a location update
+						{
+					
+						// Open positioner.
+						User::LeaveIfError(iPositioner.Open(iServer));
+						CleanupClosePushL(iPositioner);
+						
+						//Setup netsim
+						User::LeaveIfError(OpenNetSim());
+						TLbsNetPosRequestQuality quality;
+						quality.SetMinHorizontalAccuracy(200);
+						quality.SetMinVerticalAccuracy(20000);
+						iNetSim.SetQuality(quality);
+						
+						//xx
+			 			// Set the reference position, which also be used for any required verification.
+			 			TPosition refPos;
+
+						#define REFPOS_LAT				1
+						#define REFPOS_LONG				1
+						#define REFPOS_ALT				1
+						#define REFPOS_HORZ_ACCURACY	1
+						#define REFPOS_VERT_ACCURACY	1
+						
+						refPos.SetCoordinate(REFPOS_LAT, REFPOS_LONG, REFPOS_ALT);
+						refPos.SetAccuracy(REFPOS_HORZ_ACCURACY, REFPOS_VERT_ACCURACY);
+						refPos.SetCurrentTime();
+						iNetSim.SetReferenceLocation(refPos);
+						User::After(500*1000);	
+						//xx;
+						//Do first NPUD, this should get a reference position on the reference cache
+						TPositionInfo posInfo;
+						TPositionInfo posInfob;
+						
+						// Send the first NPUD & block on response
+						err = DoNotifyUpdateL(posInfo);
+						if (KErrNone != err)
+							{
+							SetTestStepResult(EFail);
+							}
+						
+						//Change the update options to set the MaxUpdateAge
+						TPositionUpdateOptions posOpts;
+						posOpts.SetMaxUpdateAge(1*1000000);
+							
+						iPositioner.SetUpdateOptions(posOpts);
+						
+						//Do the second NPUD, which should return a position from the cache
+						// At this point in time the AGPS module will not yet have produced a position
+						err = DoNotifyUpdateL(posInfob);
+						if (KErrNone != err)
+							{
+							SetTestStepResult(EFail);
+							}
+						
+						//Check to see if the returned position is a reference position
+						TPositionModuleInfo::TTechnologyType techType;
+						techType = posInfob.PositionMode();
+						
+						if(techType != TPositionModuleInfo::ETechnologyNetwork)
+							{							
+							INFO_PRINTF1(_L("Failed test, did not get a Network Reference Position."));
+							SetTestStepResult(EFail);
+							}
+						
+						//Since the second position is taken from the cache, check to see the two positions match
+						T_LbsUtils utils;
+						if(!utils.Compare_PosInfo(posInfo, posInfob))
+							{
+							INFO_PRINTF1(_L("Failed test, the two positions are not the same!"));
+							SetTestStepResult(EFail);
+							}
+						
+						CleanupStack::PopAndDestroy(&iPositioner);
+						CloseNetSim();
+						}
+					
+					break;
+					}
+				case 1004:
+					{       
+				     	TTimeIntervalMicroSeconds iTimeOut;
+			     		TTime iStartTime;
+	     				TPositionSatelliteInfo iPos, iPos2;
+	     				TBool iEOP;
+	     				// Open positioner.
+     					User::LeaveIfError(iPositioner.Open(iServer));
+	     				CleanupClosePushL(iPositioner);
+
+	     				TPositionUpdateOptions updateOptions;
+	     				iTimeOut = 2000000; // Two second timeout.
+	     
+	     				const TTimeIntervalMicroSeconds KTimeOut(iTimeOut);
+	     				updateOptions.SetUpdateTimeOut(KTimeOut);
+	     				updateOptions.SetAcceptPartialUpdates(ETrue);
+     					iPositioner.SetUpdateOptions(updateOptions);
+     
+	     				// Store initial time
+	    			 	iStartTime.UniversalTime();
+         
+     					TInt err = DoNotifyUpdateL(iPos);
+						if (KErrNone != err)
+							{
+							SetTestStepResult(EFail);
+							}
+     
+     					TTimeIntervalMicroSeconds timeLeft,maxUpdate;
+	     				TTime cTime;
+	     				//TPositionSatelliteInfo pos = iPos;
+        
+	     				cTime.UniversalTime();
+	     				iEOP = EFalse;
+     					while (!iEOP)
+     						{
+	     					cTime.UniversalTime();
+	     					// Requesting another update must be the first thing done in RunL
+     						timeLeft = (iTimeOut.Int64() - cTime.MicroSecondsFrom(iStartTime).Int64());
+	     					maxUpdate = 100000;
+    
+    	 					if (timeLeft <= 0) 
+     							{
+	     						iEOP = ETrue;
+	     						timeLeft = 1; // Use a very small value for the last update
+		     					}
+    	 					else
+     							{
+	     						const TTimeIntervalMicroSeconds KTimeOut(timeLeft);
+	     						TPositionUpdateOptions posOpts;
+	     						posOpts.SetUpdateTimeOut(KTimeOut);
+	     						posOpts.SetMaxUpdateAge(maxUpdate);
+	     						posOpts.SetAcceptPartialUpdates(ETrue);
+	     						iPositioner.SetUpdateOptions(posOpts);
+     
+	     						err = DoNotifyUpdateL(iPos);
+     							if (KErrNone != err)
+     								{
+     								SetTestStepResult(EFail);
+	     							} 
+     							else
+		  	   						{	
+									// We have a valid position, test passed
+		     							SetTestStepResult(EPass);
+	     								iEOP = ETrue;
+	     								}
+	     							}
+		     				} // end while
+	     				CleanupStack::PopAndDestroy(&iPositioner);
+     					break;
+					}								
+
+				// Test case LBS-NotifyPosUpdate-0106 for demonstration of INC117582
+				case 106:
+					{
+					
+					TPositionModuleId id;
+					iServer.GetDefaultModuleId(id);
+					
+					
+					RPositioner positioner1;
+					err = positioner1.Open(iServer, id);
+					User::LeaveIfError(err);
+
+					RPositioner positioner2;
+					err = positioner2.Open(iServer, id);
+					User::LeaveIfError(err);
+
+					RPositioner positioner3;
+					err = positioner3.Open(iServer, id);
+					User::LeaveIfError(err);
+
+					RPositioner positioner4;
+					err = positioner4.Open(iServer, id);
+					User::LeaveIfError(err);
+
+					RPositioner positioner5;
+					err = positioner5.Open(iServer, id);
+					User::LeaveIfError(err);
+
+					RPositioner positioner6;
+					err = positioner6.Open(iServer, id);
+					User::LeaveIfError(err);
+
+					RPositioner positioner7;
+					err = positioner7.Open(iServer, id);
+					User::LeaveIfError(err);
+
+					
+					positioner1.Close();
+					positioner2.Close();
+					positioner3.Close();
+					positioner6.Close();
+					positioner7.Close();	// leaving 4 and 5 still open
+					
+					User::After(2000000);  //allow time for close to work through the locserver
+					
+				 
+					break;
+					}
+				
+				default:
+					User::Panic(KLbsClientStepNotifyPosUpdate, KErrUnknown);					
+						
+    		    }
+			}
+			
+		// All done, clean up.
+		CleanupStack::PopAndDestroy(&iServer);		
+		}
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsClientStep_NotifyPosUpdate::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientstepopenclose.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,273 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientstep_openclose.cpp
+// This is the class implementation for the Server Open Close Tests
+// 
+//
+ 
+#include "ctlbsclientstepopenclose.h"
+
+#include <lbs.h>
+
+
+/**
+ * Destructor
+ */
+CT_LbsClientStep_OpenClose::~CT_LbsClientStep_OpenClose()
+	{
+	}
+
+
+/**
+ * Constructor
+ */
+CT_LbsClientStep_OpenClose::CT_LbsClientStep_OpenClose(CT_LbsClientServer& aParent) :  CT_LbsClientStep(aParent)
+	{
+	SetTestStepName(KLbsClientStep_OpenClose);
+	}
+
+
+/**
+Static Constructor
+*/
+CT_LbsClientStep_OpenClose* CT_LbsClientStep_OpenClose::New(CT_LbsClientServer& aParent)
+	{
+	return new CT_LbsClientStep_OpenClose(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsClientStep_OpenClose::doTestStepL()
+	{
+	// Generic test step used to test the LBS Client server open and close APIs.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsClientStep_OpenClose::doTestStepL()"));
+
+	if (TestStepResult() == EPass)
+		{
+		
+		TUint howManyModules = 0;
+		TPositionModuleInfo myModuleInfo;
+		TInt err = KErrNone;
+		TPositionCriteria criteria;
+		
+		
+		// Carryout common test action.
+		err = iServer.Connect();	// Function under test.
+		if (KErrNone == err)
+			{
+			INFO_PRINTF1(_L("server opened"));
+			
+						
+			// Carryout unquie test actions.
+			TInt testCaseId;
+			if (GetIntFromConfig(ConfigSection(), KTestCaseId, testCaseId))
+				{
+					switch (testCaseId)
+					{
+						// Test case LBS-OpenClose-0001
+						case 1:
+							{	
+							TPositionModuleId serverDefaultModuleId;
+							User::LeaveIfError(iServer.GetDefaultModuleId(serverDefaultModuleId));
+							err = iPositioner.Open(iServer, serverDefaultModuleId);
+							if(err != KErrNone)
+								{
+								INFO_PRINTF1(_L("** SubSession Failed to open **"));
+								SetTestStepResult(EFail);
+								}
+							}
+							break;
+					
+						// Test case LBS-OpenClose-0002
+						case 2:
+							{
+							User::LeaveIfError(iServer.GetNumModules(howManyModules));  
+							User::LeaveIfError(iServer.GetModuleInfoByIndex(howManyModules-1, myModuleInfo));
+							err = iPositioner.Open(iServer, myModuleInfo.ModuleId());
+							if(err != KErrNone)
+								{
+								INFO_PRINTF1(_L("** SubSession Failed to open **"));
+								SetTestStepResult(EFail);	
+								}
+							}
+							break;
+					
+						// Test case LBS-OpenClose-0003
+						case 3:
+							{
+							// PassInNullUID
+							err = iPositioner.Open(iServer, KPositionNullModuleId );
+							if (KErrNotFound == err)
+								{
+								INFO_PRINTF1(_L("** SubSession failed to open: Negative Test Successful **"));
+								}
+								else
+								{
+								INFO_PRINTF1(_L("** SubSession Opened, test failed **"));
+								SetTestStepResult(EFail);
+								}
+							}
+							break;
+							
+						// Test case LBS-OpenCloseExtend-0001
+						case 11:
+							{
+							criteria.AddRequiredCapabilities(TPositionModuleInfo::ECapabilitySatellite);
+							err = iPositioner.Open(iServer, criteria);
+							if(err != KErrNone)
+								{
+								INFO_PRINTF1(_L("** SubSession Failed to open **"));
+								SetTestStepResult(EFail);	
+								}
+							}
+							break;
+							
+						// Test case LBS-OpenCloseExtend-0002
+						case 12:
+							{
+						    // Set capabilities not supported by the module:
+							criteria.AddRequiredCapabilities(TPositionModuleInfo::ECapabilityAddress);
+							err = iPositioner.Open(iServer, criteria);
+							if (KErrNotFound == err)
+								{
+								INFO_PRINTF1(_L("** SubSession failed to open: Negative Test Successful **"));
+								}
+							else
+								{
+								INFO_PRINTF1(_L("** SubSession Opened, test failed **"));
+								SetTestStepResult(EFail);
+								}
+							}
+							break;
+							
+						// Test case LBS-OpenCloseMultiple-0001
+						case 20:
+							{
+							User::LeaveIfError(iPositioner.Open(iServer));
+							RPositioner positioner2;
+							err = positioner2.Open(iServer);
+							if(err != KErrNone)
+								{
+								INFO_PRINTF1(_L("** SubSession Failed to open **"));
+								SetTestStepResult(EFail);	
+								}
+							positioner2.Close();
+							}
+							break;
+
+						// Test case LBS-ReOpen-0001
+						case 30:
+							{
+							User::LeaveIfError(iPositioner.Open(iServer));
+							User::LeaveIfError(iPositioner.Open(iServer));
+							}
+							break;
+						// Test case LBS-OpenClose-0041
+						case 41:
+							{	
+							err = iServer.CancelRequest(EPositionerNotifyPositionUpdate);
+							if(err != KErrNotFound)
+								{
+								INFO_PRINTF2(_L("** Failed to return KErrnotFound, instead returned %d**"),err);
+								SetTestStepResult(EFail);
+								}
+							}
+							break;
+							
+						// Test case LBS-OpenClose-0042
+						case 42:
+							{
+							err = iPositioner.Open(iServer);
+							if(err != KErrNone)
+								{
+								INFO_PRINTF1(_L("** SubSession Failed to open **"));
+								SetTestStepResult(EFail);
+								}
+							
+							err = 0; // reset Err
+								
+							err = iPositioner.CancelRequest(EPositionerNotifyPositionUpdate);
+							if(err != KErrNotFound)
+								{
+								INFO_PRINTF2(_L("** Failed to return KErrnotFound, instead returned %d**"),err);
+								SetTestStepResult(EFail);
+								}
+							}
+							break;
+
+						// Test case LBS-OpenClose-0043
+						case 43:
+							{
+							err = iPositioner.Open(iServer);
+							if(err != KErrNone)
+								{
+								INFO_PRINTF1(_L("** SubSession Failed to open **"));
+								SetTestStepResult(EFail);
+								}
+							
+							err = 0; // reset Err
+								
+							err = iPositioner.CancelRequest(EPositionerGetLastKnownPosition);
+							if(err != KErrNotFound)
+								{
+								INFO_PRINTF2(_L("** Failed to return KErrnotFound, instead returned %d**"),err);
+								SetTestStepResult(EFail);
+								}
+							}
+							break;
+							
+						// Test case LBS-OpenClose-0044
+						case 44:
+							{	
+							err = iServer.CancelRequest(EPositionServerNotifyModuleStatusEvent);
+							if(err != KErrNotFound)
+								{
+								INFO_PRINTF2(_L("** Failed to return KErrnotFound, instead returned %d**"),err);
+								SetTestStepResult(EFail);
+								}
+							}
+							break;
+					
+					default:
+						User::Leave(KErrArgument);
+						break;
+					}
+				
+				iPositioner.Close();
+				iServer.Close();	
+				}
+			else
+				{ 
+				INFO_PRINTF1(_L("Bad Ini file"));
+				SetTestStepResult(EFail);
+				}
+			} 
+		else
+			{
+			INFO_PRINTF1(_L("SubSession failed to open"));
+			SetTestStepResult(EFail);
+			}
+
+		}
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsClientStep_OpenClose::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientsteppartialupdate.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,990 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientsteppartialupdate.cpp
+// This is the class implementation for the UpdateOptions Tests
+// 
+//
+ 
+#include "ctlbsclientsteppartialupdate.h"
+
+#include <lbs.h>
+#include <lbssatellite.h>
+
+#include "tlbsutils.h"
+#include "ctlbsasyncwaiter.h"
+
+#define EXPECTED_GPS_ACCURACY_HORIZONTAL 20
+#define EXPECTED_GPS_ACCURACY_VERTICAL 20
+
+#define KLbsKeepAlivePeriod 		10000
+
+#define REFPOS_LAT				2
+#define REFPOS_LONG				3
+#define REFPOS_ALT				10
+#define REFPOS_HORZ_ACCURACY	100
+#define REFPOS_VERT_ACCURACY	100
+
+#define REFPOS_HORZ_ACCURACY_BETTER	5
+#define REFPOS_VERT_ACCURACY_BETTER	5
+
+
+const TInt KTestAssistanceDataProviderPluginUidValue = 0x10281D77;
+const TInt KRealAssistanceDataProviderPluginUidValue = 0x1028225B;
+
+
+/**
+ * Destructor
+ */
+CT_LbsClientStep_PartialUpdate::~CT_LbsClientStep_PartialUpdate()
+	{
+	delete iDoPosUpdatePtr;
+	}
+
+
+/**
+ * Constructor
+ */
+CT_LbsClientStep_PartialUpdate::CT_LbsClientStep_PartialUpdate(CT_LbsClientServer& aParent) : CT_LbsNetSimStep(), iParent(aParent)
+	{
+	SetTestStepName(KLbsClientStep_PartialUpdate);
+	}
+
+
+/**
+Static Constructor
+*/
+CT_LbsClientStep_PartialUpdate* CT_LbsClientStep_PartialUpdate::New(CT_LbsClientServer& aParent)
+	{
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	CT_LbsClientStep_PartialUpdate* testStep = new CT_LbsClientStep_PartialUpdate(aParent);
+	if (testStep)
+		{
+		TInt err = KErrNone;
+
+		TRAP(err, testStep->ConstructL());
+		if (err)
+			{
+			delete testStep;
+			testStep = NULL;
+			}
+		}
+	return testStep;
+	}	
+	
+void CT_LbsClientStep_PartialUpdate::ConstructL()
+	{
+	// Create the base class objects.
+    CT_LbsNetSimStep::ConstructL();
+	
+	// and the active object wrapper for the notify position update.
+	iDoPosUpdatePtr = CT_LbsDoPosUpdate::NewL(this, TPositionModuleInfo::ETechnologyTerminal);
+
+	}
+
+	
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsClientStep_PartialUpdate::doTestStepL()
+	{
+	// Generic test step used to test the LBS SetUpdateOptions API.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsClientStep_PartialUpdate::doTestStepL()"));
+
+	if (TestStepResult()==EPass) 
+		{
+		TInt err = KErrNone;
+		iPosUpdateStatus = EPositionUpdateStart;
+		
+		//Configure partial Updates
+		TPositionUpdateOptions optsA;
+		optsA.SetAcceptPartialUpdates(ETrue);
+			
+		if(!optsA.AcceptPartialUpdates())
+			{
+			INFO_PRINTF1(_L("Partial Updates not set."));
+			SetTestStepResult(EFail);
+			}	
+		
+		err = iDoPosUpdatePtr->SetOptions(optsA);
+		User::LeaveIfError(err);
+		
+		CLbsAdmin* lbsAdminApi = CLbsAdmin::NewL();
+		CleanupStack::PushL(lbsAdminApi);
+
+		// Carryout unique test actions.
+		if (GetIntFromConfig(ConfigSection(), KTestCaseId, iTestCaseId))
+			{
+				switch (iTestCaseId)
+				{
+				// Test case LBS-Partial-Update-Options-0001
+				case 1:
+					{
+					CLbsAdmin::TGpsMode gpsMode = CLbsAdmin::EGpsAutonomous;
+					lbsAdminApi->Set(KLbsSettingHomeGpsMode,gpsMode);
+
+					//Configure Partial Update to EFalse
+					TPositionUpdateOptions updOpts;
+					updOpts.SetUpdateTimeOut(10*1000000);
+					updOpts.SetAcceptPartialUpdates(EFalse);
+					if(EFalse != updOpts.AcceptPartialUpdates())
+						{
+						INFO_PRINTF1(_L("Partial Updates not set."));
+						SetTestStepResult(EFail);
+						}	
+					
+					err = iDoPosUpdatePtr->SetOptions(updOpts);
+					User::LeaveIfError(err);
+					
+					break;
+					}
+	
+				// Test case LBS-Partial-Update-Options-0002
+				case 2:
+				case 3:
+				case 4:
+				case 5:
+				case 6:
+				case 7:
+					{
+					CLbsAdmin::TGpsMode gpsMode = CLbsAdmin::EGpsAutonomous;
+					lbsAdminApi->Set(KLbsSettingHomeGpsMode,gpsMode);
+
+					break;
+					}
+					
+				case 21:
+				case 22:
+				case 24:
+				case 25:
+				case 26:
+					{
+					CLbsAdmin::TGpsMode gpsMode = CLbsAdmin::EGpsPreferTerminalBased;
+					lbsAdminApi->Set(KLbsSettingHomeGpsMode,gpsMode);
+
+					break;
+					}
+					
+				case 23:
+					{
+					CLbsAdmin::TGpsMode gpsMode = CLbsAdmin::EGpsPreferTerminalBased;
+					lbsAdminApi->Set(KLbsSettingHomeGpsMode,gpsMode);
+
+					//Configure Partial Update to EFalse
+					TPositionUpdateOptions updOpts;
+					updOpts.SetAcceptPartialUpdates(EFalse);
+					if(EFalse != updOpts.AcceptPartialUpdates())
+						{
+						INFO_PRINTF1(_L("Partial Updates not set."));
+						SetTestStepResult(EFail);
+						}	
+					
+					err = iDoPosUpdatePtr->SetOptions(updOpts);
+					User::LeaveIfError(err);
+					
+					break;
+					}
+
+				case 27:
+				case 28:
+					{
+					//Tracking
+					CLbsAdmin::TGpsMode gpsMode;
+					if(iTestCaseId == 27)
+						{
+						gpsMode = CLbsAdmin::EGpsAutonomous;
+						}
+					else
+						{
+						gpsMode = CLbsAdmin::EGpsPreferTerminalBased;
+						}
+
+					lbsAdminApi->Set(KLbsSettingHomeGpsMode,gpsMode);
+
+					TPositionUpdateOptions updOpts;
+					updOpts.SetUpdateInterval(10*1000000); //Set Update Interval to 10 secs
+					updOpts.SetAcceptPartialUpdates(ETrue);
+					
+					err = iDoPosUpdatePtr->SetOptions(updOpts);
+					User::LeaveIfError(err);
+
+					break;
+					}
+
+				default:
+					User::Panic(KLbsClientStep_PartialUpdate, KErrUnknown);					
+						
+					}
+				}
+		
+		User::LeaveIfError(OpenNetSim());
+
+		// Kick off the test abort and keep alive timers.
+		TTimeIntervalMicroSeconds32 keepAliveInterval(KLbsKeepAlivePeriod);
+		iKeepAliveTimer->SetTimer(keepAliveInterval);
+
+		// Kick off test.
+		CActiveScheduler::Start();
+
+		// Verify location data.
+		VerifyPosInfos();
+
+		//Reset Test module timeout
+		TModuleDataIn modDataIn; 
+		modDataIn.iRequestType = TModuleDataIn::EModuleRequestTimeOut;
+		modDataIn.iTimeOut = 0;
+
+		T_LbsUtils utils;
+		utils.NotifyModuleOfConfigChangeL(modDataIn);
+
+		// Clean up.
+		CloseNetSim();
+		
+		CleanupStack::PopAndDestroy(lbsAdminApi);
+		}
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsClientStep_PartialUpdate::doTestStepL()"));
+
+	return TestStepResult();
+	}
+
+
+void CT_LbsClientStep_PartialUpdate::Connected()
+	{
+	// Call base implementation.
+	//CT_LbsNetSimStep::Connected();
+	
+	// Create a posinfo and store in our shared array for later verification.
+	T_LbsUtils utils;
+	RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+	utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+
+	iPosInfoPtr1 = new(ELeave) TPositionInfo();
+	posInfoArr.Append(iPosInfoPtr1);
+	iPosInfoPtr2 = new(ELeave) TPositionInfo();
+	posInfoArr.Append(iPosInfoPtr2);
+
+	//For test case 22, Set Reference Position better than required position
+	if(iTestCaseId == 22)
+		{
+		// Set the reference position, which also be used for any required verification.
+		iRefPos.SetCoordinate(REFPOS_LAT, REFPOS_LONG, REFPOS_ALT);
+		iRefPos.SetAccuracy(REFPOS_HORZ_ACCURACY_BETTER, REFPOS_VERT_ACCURACY_BETTER);
+		iRefPos.SetCurrentTime();
+
+		if (!iNetSim.SetReferenceLocation(iRefPos))
+			{
+			INFO_PRINTF1(_L("Failed test, can't set NetSim's reference location."));
+			SetTestStepResult(EFail);
+			}	
+		}
+
+	// Kick off pos update.
+	iDoPosUpdatePtr->StartL(*iPosInfoPtr1);
+	}
+
+
+void CT_LbsClientStep_PartialUpdate::MT_LbsDoPosUpdateCallback(TRequestStatus& aStatus)
+	{
+	INFO_PRINTF1(_L("Got - Client Notify Update Complete - Callback Event."));
+	
+	T_LbsUtils utils;
+	TInt err = aStatus.Int();
+	
+	switch(iTestCaseId)
+		{
+		case 1:
+			{
+			if (KPositionQualityLoss != err)
+				{
+				SetTestStepResult(EFail);
+				}
+			
+			iState = EWaiting;
+			break;
+			}
+
+		case 2:
+		case 3:
+			{
+			if (KPositionPartialUpdate != err)
+				{
+				SetTestStepResult(EFail);
+				}	
+
+			if(iPosUpdateStatus != EPositionUpdateComplete)
+				{
+				// Kick off pos update.
+				iDoPosUpdatePtr->StartL(*iPosInfoPtr2);
+				iPosUpdateStatus = EPositionUpdateComplete;				
+				}
+			else
+				iState = EWaiting;
+			
+			break;
+			}
+
+		case 4:
+			{
+			if (KErrNone != err)
+				{
+				SetTestStepResult(EFail);
+				}	
+
+			if(iPosUpdateStatus != EPositionUpdateComplete)
+				{
+				// Kick off pos update.
+				iDoPosUpdatePtr->StartL(*iPosInfoPtr2);
+				iPosUpdateStatus = EPositionUpdateComplete;				
+				}
+			else
+				iState = EWaiting;
+
+			break;
+			}
+
+		case 5:
+		case 6:
+		
+		case 21:
+		case 22:
+			{
+			if(iPosUpdateStatus != EPositionUpdateComplete)
+				{
+				if(iTestCaseId == 5 || iTestCaseId == 21)
+					{
+					if (KPositionPartialUpdate != err)
+						{
+						SetTestStepResult(EFail);
+						}	
+					}
+				else
+					{
+					if (KErrNone != err)
+						{
+						SetTestStepResult(EFail);
+						}	
+					}
+				}
+			else
+				{
+				if (KPositionEarlyComplete != err)
+					{
+					SetTestStepResult(EFail);
+					}	
+				}
+
+			if(iPosUpdateStatus != EPositionUpdateComplete)
+				{
+				TModuleDataIn modDataIn; // Used to send test information to the test module.
+				modDataIn.iRequestType = TModuleDataIn::EModuleRequestTimeOut;
+				modDataIn.iTimeOut = 5*1000000;
+				
+				// Send timeout value to test module - will block.
+				utils.NotifyModuleOfConfigChangeL(modDataIn);
+
+				// Kick off pos update.
+				iDoPosUpdatePtr->StartL(*iPosInfoPtr2);
+
+				err = iDoPosUpdatePtr->CompleteRequest(EPositionerNotifyPositionUpdate);
+				if (err != KErrNone)
+					{
+					SetTestStepResult(EFail);
+					}	
+				
+				iPosUpdateStatus = EPositionUpdateComplete;				
+
+				}
+			else
+				{
+				//if(iTestCaseId == 5 || iTestCaseId == 6)
+					{
+					iState = EWaiting;	
+					}
+				}
+
+			break;
+			}
+			
+		case 7:
+			{
+			if(iPosUpdateStatus != EPositionUpdateComplete)
+				{
+				if (KPositionPartialUpdate != err)
+					{
+					SetTestStepResult(EFail);
+					}	
+					
+				// Kick off pos update.
+				iDoPosUpdatePtr->StartL(*iPosInfoPtr2);
+				iPosUpdateStatus = EPositionUpdateComplete;				
+				}
+			else
+				{
+				if (KErrNone != err)
+					{
+					SetTestStepResult(EFail);
+					}	
+					
+				err = iDoPosUpdatePtr->CompleteRequest(EPositionerNotifyPositionUpdate);
+				if (err != KErrNotFound)
+					{
+					SetTestStepResult(EFail);
+					}	
+				iState = EWaiting;	
+				}
+
+			break;
+			}			
+		
+		case 23:
+			{
+			if (KErrNone != err)
+				{
+				SetTestStepResult(EFail);
+				}	
+
+			break;
+			}
+
+		case 24:
+		case 27:
+			{
+			if(iPosUpdateStatus != EPositionUpdateComplete)
+				{
+				if (KPositionPartialUpdate != err)
+					{
+					SetTestStepResult(EFail);
+					}
+
+				if(iPosUpdateStatus == EPositionUpdateStart)
+					{
+					iDoPosUpdatePtr->StartL(*iPosInfoPtr2);
+					iPosUpdateStatus = EPositionUpdateContinue;
+					}
+				else
+					{
+					TModuleDataIn modDataIn; // Used to send test information to the test module.
+					modDataIn.iRequestType = TModuleDataIn::EModuleRequestTimeOut;
+					modDataIn.iTimeOut = 5*1000000;
+					
+					// Send timeout value to test module - will block.
+					utils.NotifyModuleOfConfigChangeL(modDataIn);
+
+					RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+					TPositionInfo* posInfoPtr3;
+					posInfoPtr3 = new(ELeave) TPositionInfo();
+					posInfoArr.Append(posInfoPtr3);
+					
+					// Kick off pos update.
+					iDoPosUpdatePtr->StartL(*posInfoPtr3);
+
+					err = iDoPosUpdatePtr->CompleteRequest(EPositionerNotifyPositionUpdate);
+					if (err != KErrNone)
+						{
+						SetTestStepResult(EFail);
+						}	
+	
+					iPosUpdateStatus = EPositionUpdateComplete;				
+					}
+				}
+			else
+				{
+				if (KPositionEarlyComplete != err)
+					{
+					SetTestStepResult(EFail);
+					}	
+					
+				//if (iTestCaseId == 27)
+				//	{
+					iState = EWaiting;
+				//	}	
+				}
+
+			break;
+			}
+
+		case 25:
+		case 26:
+			{
+			if(iPosUpdateStatus != EPositionUpdateComplete)
+				{
+				if (KPositionPartialUpdate != err)
+					{
+					SetTestStepResult(EFail);
+					}
+
+				if(iPosUpdateStatus == EPositionUpdateStart)
+					{
+					iDoPosUpdatePtr->StartL(*iPosInfoPtr2);
+					iPosUpdateStatus = EPositionUpdateContinue;
+					}
+				else
+					{
+					RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+					TPositionInfo* posInfoPtr3;
+					posInfoPtr3 = new(ELeave) TPositionInfo();
+					posInfoArr.Append(posInfoPtr3);
+					
+					// Kick off pos update.
+					iDoPosUpdatePtr->StartL(*posInfoPtr3);
+
+					iPosUpdateStatus = EPositionUpdateComplete;				
+					}
+				}
+			else
+				{
+				if (KPositionPartialUpdate != err && KPositionQualityLoss != err)
+					{
+					_LIT(KUnexpectedErrorWhilePartialUpdate, "Unexpected error returned: %d");
+					INFO_PRINTF2(KUnexpectedErrorWhilePartialUpdate, err);
+					SetTestStepResult(EFail);
+					}
+						
+				err = iDoPosUpdatePtr->CompleteRequest(EPositionerNotifyPositionUpdate);
+				if (err != KErrNotFound)
+					{
+					SetTestStepResult(EFail);
+					}	
+				
+				iState =EWaiting;
+				
+				TPositionInfo* curPosInfo = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iCurrentPosInfoArr[0]);
+				TPositionInfo* curPosInfo2 = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iCurrentPosInfoArr[1]);
+				TPositionInfo* curPosInfo3 = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iCurrentPosInfoArr[2]);
+				}
+
+			break;
+			}
+
+		case 28:
+			{
+			if(iPosUpdateStatus != EPositionUpdateComplete)
+				{
+				if (KPositionPartialUpdate != err)
+					{
+					SetTestStepResult(EFail);
+					}
+
+				if(iPosUpdateStatus == EPositionUpdateStart)
+					{
+					iDoPosUpdatePtr->StartL(*iPosInfoPtr2);
+					iPosUpdateStatus = EPositionUpdateContinue;
+					}
+				else
+					{
+					TModuleDataIn modDataIn; // Used to send test information to the test module.
+					modDataIn.iRequestType = TModuleDataIn::EModuleRequestTimeOut;
+					modDataIn.iTimeOut = 5*1000000;
+					
+					// Send timeout value to test module - will block.
+					utils.NotifyModuleOfConfigChangeL(modDataIn);
+
+					RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+					TPositionInfo* posInfoPtr3;
+					posInfoPtr3 = new(ELeave) TPositionInfo();
+					posInfoArr.Append(posInfoPtr3);
+					
+					// Kick off pos update.
+					iDoPosUpdatePtr->StartL(*posInfoPtr3);
+
+					err = iDoPosUpdatePtr->CompleteRequest(EPositionerNotifyPositionUpdate);
+					if (err != KErrNone)
+						{
+						SetTestStepResult(EFail);
+						}	
+	
+					iPosUpdateStatus = EPositionUpdateComplete;				
+					}
+				}
+			else
+				{
+				if (KPositionEarlyComplete != err)
+					{
+					SetTestStepResult(EFail);
+					}
+				
+				iState = EWaiting;	
+				}
+
+			break;
+			}
+			
+		default:
+			break;
+		}
+	}	
+
+void CT_LbsClientStep_PartialUpdate::VerifyPosInfos()
+	{
+	T_LbsUtils utils;
+	T_LbsUtils::TComparisonAccuracyType accType;
+	
+	if(iParent.iSharedData->iTestModuleInUse) 
+		{
+		accType = T_LbsUtils::EExactAccuracy;
+		}
+	else
+		{
+		accType = T_LbsUtils::ERoughAccuracy;
+		}
+	
+	switch(iTestCaseId)
+		{
+		case 5:
+		case 6:
+			{
+			//Verify Position returned - It should be the position returned earlier
+			TPositionInfo* curPosInfoPtr1 = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iCurrentPosInfoArr[0]);
+			TPositionInfo* curPosInfoPtr2 = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iCurrentPosInfoArr[1]);
+			TPositionInfo* verPosInfoPtr = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iVerifyPosInfoArr[0]);
+
+			if (!utils.Compare_PosInfo(*curPosInfoPtr1, *verPosInfoPtr, accType))
+				{
+				INFO_PRINTF1(_L("Failed test, position incorrect."));
+				SetTestStepResult(EFail);
+			    }
+
+			if (!utils.Compare_PosInfo(*curPosInfoPtr2, *verPosInfoPtr, accType))
+				{
+				INFO_PRINTF1(_L("Failed test, position incorrect."));
+				SetTestStepResult(EFail);
+			    }
+			
+			break;
+			}
+			
+		case 7:
+			{
+			//Verify Position returned - It should be the position returned earlier
+			TPositionInfo* curPosInfoPtr1 = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iCurrentPosInfoArr[0]);
+			TPositionInfo* curPosInfoPtr2 = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iCurrentPosInfoArr[1]);
+
+			TPositionInfo* verPosInfoPtr1 = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iVerifyPosInfoArr[0]);
+			TPositionInfo* verPosInfoPtr2 = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iVerifyPosInfoArr[1]);
+
+			if (!utils.Compare_PosInfo(*curPosInfoPtr1, *verPosInfoPtr1, accType))
+				{
+				INFO_PRINTF1(_L("Failed test, position incorrect."));
+				SetTestStepResult(EFail);
+			    }
+
+			if (!utils.Compare_PosInfo(*curPosInfoPtr2, *verPosInfoPtr2, accType))
+				{
+				INFO_PRINTF1(_L("Failed test, position incorrect."));
+				SetTestStepResult(EFail);
+			    }
+
+			break;
+			}
+			
+		case 21:
+		case 22:
+			{
+			//Verify Position returned - It should be the position returned earlier
+			TPositionInfo* curPosInfoPtr1 = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iCurrentPosInfoArr[0]);
+			TPositionInfo* curPosInfoPtr2 = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iCurrentPosInfoArr[1]);
+
+			TPositionInfo refPosInfo;
+			refPosInfo.SetPosition(iRefPos);
+
+			if (!utils.Compare_PosInfo(*curPosInfoPtr1, refPosInfo, accType))
+				{
+				INFO_PRINTF1(_L("Failed test, position incorrect."));
+				SetTestStepResult(EFail);
+			    }
+
+			if (!utils.Compare_PosInfo(*curPosInfoPtr2, refPosInfo, accType))
+				{
+				INFO_PRINTF1(_L("Failed test, position incorrect."));
+				SetTestStepResult(EFail);
+			    }
+
+			break;
+			}
+
+		case 23:
+			{
+			//Verify Position returned - It should be the position returned earlier
+			TPositionInfo* curPosInfoPtr = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iCurrentPosInfoArr[0]);
+
+			TPositionInfo refPosInfo;
+			refPosInfo.SetPosition(iRefPos);
+
+			if (!utils.Compare_PosInfo(*curPosInfoPtr, refPosInfo, accType))
+				{
+				INFO_PRINTF1(_L("Failed test, position incorrect."));
+				SetTestStepResult(EFail);
+			    }
+
+			break;
+			}
+		
+		case 24:
+		case 25:
+		case 26:
+		case 28:
+			{
+			//Verify Position returned - It should be the position returned earlier
+			TPositionInfo* curPosInfoPtr1 = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iCurrentPosInfoArr[0]);
+			TPositionInfo* curPosInfoPtr2 = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iCurrentPosInfoArr[1]);
+			TPositionInfo* curPosInfoPtr3 = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iCurrentPosInfoArr[2]);
+
+			TPositionInfo* verPosInfoPtr1 = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iVerifyPosInfoArr[0]);
+			TPositionInfo* verPosInfoPtr2 = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iVerifyPosInfoArr[1]);
+
+			TPositionInfo refPosInfo;
+			refPosInfo.SetPosition(iRefPos);
+
+			if (!utils.Compare_PosInfo(*curPosInfoPtr1, refPosInfo, accType))
+				{
+				INFO_PRINTF1(_L("Failed test, position incorrect."));
+				SetTestStepResult(EFail);
+			    }
+
+			if (!utils.Compare_PosInfo(*curPosInfoPtr2, *verPosInfoPtr1, accType))
+				{
+				INFO_PRINTF1(_L("Failed test, position incorrect."));
+				SetTestStepResult(EFail);
+			    }
+
+			//if(iTestCaseId == 26 || iTestCaseId == 25)
+			//	{
+			//	if (!utils.Compare_PosInfo(*curPosInfoPtr3, *verPosInfoPtr2, accType))
+			//		{
+			//		INFO_PRINTF1(_L("Failed test, position incorrect."));
+			//		SetTestStepResult(EFail);
+			//	    }
+			//	}
+			//else
+			//	{
+				if (!utils.Compare_PosInfo(*curPosInfoPtr3, *verPosInfoPtr1, accType))
+					{
+					INFO_PRINTF1(_L("Failed test, position incorrect."));
+					SetTestStepResult(EFail);
+				    }
+			//	}
+			
+			break;
+			}
+
+		case 27:
+			{
+			//Verify Position returned - It should be the position returned earlier
+			TPositionInfo* curPosInfoPtr1 = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iCurrentPosInfoArr[0]);
+			TPositionInfo* curPosInfoPtr2 = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iCurrentPosInfoArr[1]);
+			TPositionInfo* curPosInfoPtr3 = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iCurrentPosInfoArr[2]);
+
+			TPositionInfo* verPosInfoPtr1 = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iVerifyPosInfoArr[0]);
+			TPositionInfo* verPosInfoPtr2 = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iVerifyPosInfoArr[1]);
+
+			if (!utils.Compare_PosInfo(*curPosInfoPtr1, *verPosInfoPtr1, accType))
+				{
+				INFO_PRINTF1(_L("Failed test, position incorrect."));
+				SetTestStepResult(EFail);
+			    }
+
+			if (!utils.Compare_PosInfo(*curPosInfoPtr2, *verPosInfoPtr2, accType))
+				{
+				INFO_PRINTF1(_L("Failed test, position incorrect."));
+				SetTestStepResult(EFail);
+			    }
+
+			if (!utils.Compare_PosInfo(*curPosInfoPtr3, *verPosInfoPtr2, accType))
+				{
+				INFO_PRINTF1(_L("Failed test, position incorrect."));
+				SetTestStepResult(EFail);
+			    }
+			
+			break;
+			}
+		    
+		default:
+			break;
+		}
+	}
+
+
+void CT_LbsClientStep_PartialUpdate::NotifyRegisterLcsMoLr(const TDesC& aData)
+	{
+	(void)aData;
+	}
+
+void CT_LbsClientStep_PartialUpdate::NotifyMeasurementControlLocation(const TPositionInfo& aPosition, const RLbsAssistanceDataBuilderSet& aData, const TLbsNetPosRequestQuality& aQuality)
+	{
+	(void)aPosition;
+	(void)aData;
+	(void)aQuality;
+
+	}
+	
+void CT_LbsClientStep_PartialUpdate::NotifyMeasurementReportLocation(const TPositionInfo& aPosition)
+	{
+
+	T_LbsUtils utils;
+	T_LbsUtils::TComparisonAccuracyType accType;
+	if(iParent.iSharedData->iTestModuleInUse) 
+		{
+		accType = T_LbsUtils::EExactAccuracy;
+		}
+	else
+		{
+		accType = T_LbsUtils::ERoughAccuracy;
+		}
+	
+	switch(iTestCaseId)
+		{
+		case 21:
+		case 22:
+			{
+			TPositionInfo refPosInfo;
+			refPosInfo.SetPosition(iRefPos);
+			if (!utils.Compare_PosInfo(refPosInfo, aPosition, accType))
+				{
+				INFO_PRINTF1(_L("Failed test, position incorrect."));
+				SetTestStepResult(EFail);
+			    } 
+			    
+			break;
+			}
+
+		case 24:
+		case 25:
+		case 28:
+			{
+			TPositionInfo* verPosInfoPtr = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iVerifyPosInfoArr[0]);
+
+			if (!utils.Compare_PosInfo(*verPosInfoPtr, aPosition, accType))
+				{
+				INFO_PRINTF1(_L("Failed test, position incorrect."));
+				SetTestStepResult(EFail);
+			    } 
+			    
+			break;
+			}
+
+		/*case 25:
+			{
+			TPositionInfo* verPosInfoPtr = reinterpret_cast<TPositionInfo*>(iParent.iSharedData->iVerifyPosInfoArr[1]);
+
+			if (!utils.Compare_PosInfo(*verPosInfoPtr, aPosition, accType))
+				{
+				INFO_PRINTF1(_L("Failed test, position incorrect."));
+				SetTestStepResult(EFail);
+			    } 
+			    
+			break;
+			}*/
+			
+		case 26:
+			{
+			//INFO_PRINTF1(_L("Position should not be sent to Network"));
+			//SetTestStepResult(EFail);
+		    
+		    break;
+		    }
+
+		default:
+			break;
+			
+		}
+	}
+
+void CT_LbsClientStep_PartialUpdate::NotifyFacilityLcsMoLrResult(TInt aReason, const TPositionInfo& aPosition)
+	{
+	(void)aReason;
+	(void)aPosition;
+	}
+
+void CT_LbsClientStep_PartialUpdate::NotifyReleaseLcsMoLr(TInt aReason)
+	{
+	(void)aReason;
+	if(iTestCaseId == 23)
+		{
+		iState = EWaiting;
+		}
+	}
+
+
+TInt CT_LbsClientStep_PartialUpdate::OpenNetSim()
+	{
+	TInt err = KErrNone;
+	
+	//Connect to NetSim
+	err = iNetSim.ConnectL(this);
+	if (err)
+		{
+		SetTestStepResult(EFail);
+		return KErrGeneral;
+		}
+	
+	// Set the reference position, which also be used for any required verification.
+	iRefPos.SetCoordinate(REFPOS_LAT, REFPOS_LONG, REFPOS_ALT);
+	iRefPos.SetAccuracy(REFPOS_HORZ_ACCURACY, REFPOS_VERT_ACCURACY);
+	iRefPos.SetCurrentTime();
+
+	if (!iNetSim.SetReferenceLocation(iRefPos))
+		{
+		INFO_PRINTF1(_L("Failed test, can't set NetSim's reference location."));
+		SetTestStepResult(EFail);
+		iNetSim.Close();
+		return KErrGeneral;
+		}	
+
+	//Set the position quality required by the network.
+	TTimeIntervalMicroSeconds maxFixTime(60 * 1000000);
+
+	TLbsNetPosRequestQuality netPosQuality;
+	netPosQuality.SetMaxFixTime(maxFixTime);
+	netPosQuality.SetMinHorizontalAccuracy(iRefPos.HorizontalAccuracy());
+	netPosQuality.SetMinVerticalAccuracy(iRefPos.VerticalAccuracy());
+								
+	if (!iNetSim.SetQuality(netPosQuality))
+		{
+		INFO_PRINTF1(_L("Failed test, can't set NetSim's quality."));
+		SetTestStepResult(EFail);
+		iNetSim.Close();
+		return KErrGeneral;
+		}
+			
+	TUid pluginUid;		
+	if(iParent.iSharedData->iTestModuleInUse) 
+		{
+		// Set plugin to use.
+		pluginUid = TUid::Uid(KTestAssistanceDataProviderPluginUidValue);	
+		}
+	else
+		{
+		// Real AGPS Uid
+		pluginUid = TUid::Uid(KRealAssistanceDataProviderPluginUidValue);	
+		}
+
+	if (!iNetSim.SetAssistanceDataProvider(pluginUid))
+		{
+		INFO_PRINTF1(_L("Failed test, can't set NetSim's assistance data plugin uid."));
+		SetTestStepResult(EFail);
+		iNetSim.Close();
+		return KErrGeneral;
+		} 
+	
+	return KErrNone;
+	}
+
+void CT_LbsClientStep_PartialUpdate::CloseNetSim()
+	{
+	iNetSim.Close();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientstepsrvconnectclose.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,230 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientstep_srvconnectclose.cpp
+// This is the class implementation for the Server Connect Close Tests
+// 
+//
+ 
+#include "ctlbsclientstepsrvconnectclose.h"
+
+#include <lbs.h>
+
+/**
+ * Destructor
+ */
+CT_LbsClientStep_SrvConnectClose::~CT_LbsClientStep_SrvConnectClose()
+	{
+	}
+
+
+/**
+ * Constructor
+ */
+CT_LbsClientStep_SrvConnectClose::CT_LbsClientStep_SrvConnectClose(CT_LbsClientServer& aParent) : CT_LbsClientStep(aParent)
+	{
+	SetTestStepName(KLbsClientStep_SrvConnectClose);
+	}
+
+
+/**
+Static Constructor
+*/
+CT_LbsClientStep_SrvConnectClose* CT_LbsClientStep_SrvConnectClose::New(CT_LbsClientServer& aParent)
+	{
+	return new CT_LbsClientStep_SrvConnectClose(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsClientStep_SrvConnectClose::doTestStepL()
+	{
+	// Generic test step used to test the LBS Client server open and close APIs.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsClientStep_SrvConnectClose::doTestStepL()"));
+
+	if (TestStepResult() == EPass)
+		{
+		// Carryout common test action.
+		TInt err = KErrNone;
+		err = iServer.Connect();	// Function under test.
+		CleanupClosePushL(iServer);
+		
+		if (KErrNone == err)
+			{
+			INFO_PRINTF1(_L("server opened"));
+			
+			// Carryout unique test actions.
+			TInt testCaseId;
+			if (GetIntFromConfig(ConfigSection(), KTestCaseId, testCaseId))
+				{
+					switch (testCaseId)
+					{
+						// Test case LBS-ConnectClose-0001
+						case 1:
+							// Only requires create, connect and close for RPositionServer object
+							// Connect and close occur outside the switch.
+							break;
+					
+						// Test case LBS-ConnectClose-0002
+						case 2:
+							{
+							OpenNetSim();
+							RPositioner positioner;
+							User::LeaveIfError(positioner.Open(iServer));
+							TPositionInfo posInfo;
+							TRequestStatus status;
+							
+							TPositionUpdateOptions optsA;
+							TTimeIntervalMicroSeconds interval = 60 * 1000000;	// 1 minute interval
+							// note: do 2 NPUDs because the first may complete before we close
+							optsA.SetUpdateInterval(interval);
+							positioner.NotifyPositionUpdate(posInfo, status);
+							User::WaitForRequest(status);
+							
+							// this will not complete quickly, so we'll def have an outstanding request when we close
+							positioner.NotifyPositionUpdate(posInfo, status);
+							positioner.Close();
+							CloseNetSim();
+							}
+							break;
+					
+						// Test case LBS-ConnectClose-0003
+						case 3:
+							{
+							// Will panic, not interested in any return err.
+							iServer.Connect();
+							}
+							break;
+							
+						// Test case LBS-ConnectClose-0004
+						case 4:
+							{
+							RPositionServer server2;
+
+							err = server2.Connect();	
+							if(err != KErrNone)
+								{
+								INFO_PRINTF1(_L("<FONT><B>Server2 connect() didn't return KErrNone</B></FONT>"));
+								SetTestStepResult(EFail);
+								}
+						
+							else
+								{
+								server2.Close();
+								}
+							}
+							break;
+						//Test case LBS-ConnectClose-0005
+						case 5:
+						    {
+						    // look in the kernels process list for the server
+                            _LIT(KLocServerName, "*locserver*"); // NB you MUST use this server name for the location server. 
+                                        				   // see KPositionServerName in the location server code (server side)
+                            TFindThread serverSearcher(KLocServerName);
+                            TFileName matchingFileName;
+                            TInt matchCount = 0;
+                            while(serverSearcher.Next(matchingFileName) == KErrNone)
+	                          {
+	                           // we have a match, there should only be one
+	                           matchCount++;
+	                          }
+                            // start checking
+                            if(matchCount!=1)
+	                          {
+	                           /* fail the test - we somehow have more than one location server running. 
+	                              May have been one left over from a previous test */	                    
+	                           INFO_PRINTF1(_L("somehow have more than one location server running"));
+						       SetTestStepResult(EFail); 
+	                          }
+                            RThread iserverThread;
+                            TInt err;
+	                        err=iserverThread.Open(matchingFileName);
+	                        User::LeaveIfError(err);
+                            TThreadId iserverThreadId = iserverThread.Id();
+                            // log the thread ID
+                            // we now try and explicitly start a 2nd copy of the position server. 
+                            //We expect not to get a 2nd copy, but to //connect to the existing copy. 
+                            // create an connect to the lcoation server
+                            RPositionServer server2;
+                            User::LeaveIfError(server2.Connect());
+                            CleanupClosePushL(server2);
+                            // search again
+                            serverSearcher.Find(KLocServerName);
+                            matchCount = 0;
+                            while(serverSearcher.Next(matchingFileName) == KErrNone)
+	                            {
+	                            // we have a match, there should only be one
+	                             matchCount++;
+	                            }
+                            // sanity check
+                           if(matchCount!=1)
+	                        {
+	                         /*SDA 3_50 Failure here
+	                          fail the test - we have two servers.*/
+	                         INFO_PRINTF1(_L("we have two servers"));
+					         SetTestStepResult(EFail); 
+	                         
+	                        }
+                          else
+	                        {
+	                        // we have one server so check the thread its match
+	                        RThread server2Thread;
+	                        err=server2Thread.Open(matchingFileName);
+	                        User::LeaveIfError(err);
+	                        TThreadId server2ThreadId = server2Thread.Id();
+	                     
+	                        if(iserverThreadId != server2ThreadId)
+		                      {
+		                       /*different thread ids - somehow
+		                         fail the test here */
+		                       INFO_PRINTF1(_L("Different thread ids "));
+					           SetTestStepResult(EFail); 
+		              		  }
+	                        }
+                            CleanupStack::PopAndDestroy(&server2);
+				           }
+                	       break;
+                    default:
+					User::Leave(KErrArgument);
+					break;
+						
+					}
+				}
+			else
+				{
+				INFO_PRINTF1(_L("<FONT><B>Failed to read from ini file correctly</B></FONT>"));
+				SetTestStepResult(EFail);
+				}
+			}
+		else
+			{
+			INFO_PRINTF1(_L("<FONT><B>server failed to open</B></FONT>"));
+			SetTestStepResult(EFail);
+			}
+
+		// Carryout final common test action.			
+		CleanupStack::PopAndDestroy(&iServer);
+		}
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsClientStep_SrvConnectClose::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientstepsrvversion.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,127 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientstepsrvversion.cpp
+// This is the class implementation for the Server Version Tests
+// 
+//
+ 
+#include "ctlbsclientstepsrvversion.h"
+
+#include <lbs.h>
+
+	
+_LIT(Ksrvvermajor, "srv_ver_major");
+_LIT(Ksrvverminor, "srv_ver_minor");
+_LIT(Ksrvverbuild, "srv_ver_build");
+
+
+/**
+ * Destructor
+ */
+CT_LbsClientStep_SrvVersion::~CT_LbsClientStep_SrvVersion()
+	{
+	}
+
+
+/**
+ * Constructor
+ */
+CT_LbsClientStep_SrvVersion::CT_LbsClientStep_SrvVersion(CT_LbsClientServer& aParent) : CT_LbsClientStep(aParent)
+	{
+	SetTestStepName(KLbsClientStep_SrvVersion);
+	}
+
+
+/**
+Static Constructor
+*/
+CT_LbsClientStep_SrvVersion* CT_LbsClientStep_SrvVersion::New(CT_LbsClientServer& aParent)
+	{
+	return new CT_LbsClientStep_SrvVersion(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}
+
+
+
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsClientStep_SrvVersion::doTestStepL()
+	{
+	// Generic test step used to test the LBS Client server open and close APIs.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsClientStep_SrvVersion::doTestStepL()"));
+
+	if (TestStepResult() == EPass)
+		{
+		RPositionServer server;
+		TInt err = KErrNone;
+		
+		// Carryout common test action.
+		err = server.Connect();
+		if (KErrNone == err)
+			{
+			INFO_PRINTF1(_L("server opened"));
+			
+			// Carryout unique test actions.
+			// Test case LBS-APIVersion-0001
+			
+			TVersion serverversion;
+			serverversion = server.Version();
+			TInt MajorVersionNumber = 0;
+			TInt MinorVersionNumber = 0;
+			TInt BuildVersionNumber = 0;
+			if(!(GetIntFromConfig(ConfigSection(), Ksrvvermajor, MajorVersionNumber) &&
+			     GetIntFromConfig(ConfigSection(), Ksrvverminor, MinorVersionNumber) &&
+				 GetIntFromConfig(ConfigSection(), Ksrvverbuild, BuildVersionNumber)))
+				{
+				INFO_PRINTF1(_L("Bad ini file Build info."));
+				User::Leave(KErrArgument);
+				}
+			
+			//Check expected Version matches tested version
+			if (MajorVersionNumber == static_cast<TInt>(serverversion.iMajor) &&
+				MinorVersionNumber == static_cast<TInt>(serverversion.iMinor) &&
+				BuildVersionNumber == static_cast<TInt>(serverversion.iBuild))
+				{
+				INFO_PRINTF1(_L("Expected Version Matches"));
+				}
+			else
+				{
+				INFO_PRINTF1(_L("Expected Version Differs"));
+				SetTestStepResult(EFail);
+				}
+				
+			}
+		else
+			{
+			INFO_PRINTF1(_L("server failed to open"));
+			SetTestStepResult(EFail);
+			}
+			
+	
+		// Carryout final common test action.			
+		if (KErrNone == err)
+			{
+			server.Close();
+			}
+		}
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsClientStep_SrvVersion::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientsteptracking.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,668 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientstep_tracking.cpp
+// This is the class implementation for the Tracking Tests
+// 
+//
+ 
+#include "ctlbsclientsteptracking.h"
+
+#include <lbs.h>
+#include <lbssatellite.h>
+
+#include "tlbsutils.h"
+#include "ctlbsasyncwaiter.h"
+
+
+/**
+ * Construction.
+ */
+CT_LbsClientStep_Tracking* CT_LbsClientStep_Tracking::New(CT_LbsClientServer& aParent)
+	{
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	CT_LbsClientStep_Tracking* testStep = new CT_LbsClientStep_Tracking(aParent);
+	if (testStep)
+		{
+		TInt err = KErrNone;
+
+		TRAP(err, testStep->ConstructL());
+		if (err)
+			{
+			delete testStep;
+			testStep = NULL;
+			}
+		}
+		
+	return testStep;
+	}
+
+
+CT_LbsClientStep_Tracking::CT_LbsClientStep_Tracking(CT_LbsClientServer& aParent) : CT_LbsClientStep(aParent),
+	iVerifyInterval(ETrue), iExpectedErr(KErrNone), iUpdateIndex(0)
+	{
+	SetTestStepName(KLbsClientStep_Tracking);
+	}
+
+
+void CT_LbsClientStep_Tracking::ConstructL()
+	{
+	// Setup netsim.
+	User::LeaveIfError(OpenNetSim());
+	
+	// Connect server.
+	User::LeaveIfError(iServer.Connect());
+	
+	// Open positioner.
+	User::LeaveIfError(iPositioner.Open(iServer));
+	}
+
+
+/**
+ * Destructor
+ */
+CT_LbsClientStep_Tracking::~CT_LbsClientStep_Tracking()
+	{
+	iPositioner.Close();
+	iServer.Close();	
+	CloseNetSim();
+	}
+
+
+const TTimeIntervalMicroSeconds KTimestampMargin = 500000; //+/-0.5s
+
+TBool CT_LbsClientStep_Tracking::VerifyFirstPosTime(const TTime& aTimeRequested, const TPositionInfo& aPosInfo, const TPositionUpdateOptions& aUpdateOpts)
+	{
+	TTime timeReceived, timeStamp;
+	TPosition pos;
+					
+    TInt64 maxtime;
+    maxtime = aUpdateOpts.UpdateTimeOut().Int64();
+	if(!maxtime)	
+		{
+		#pragma message("TO DO: CT_LbsClientStep_Tracking::VerifyFirstPosTime - Update when moduleinfo supported")	
+		const TTimeIntervalMicroSeconds ttff = 90*1000000;	// TO DO - this should be retrieved from the module info (currently hardcoded in locserver too)
+		maxtime = ttff.Int64();
+		}
+										
+	// get current time
+	timeReceived.UniversalTime();
+	
+	// get the position data:
+	aPosInfo.GetPosition(pos);
+	
+	INFO_PRINTF1(_L("First position received at: "));	
+	INFO_PRINTF4(_L("%d/%d/%d"), timeReceived.DateTime().Day() + 1, timeReceived.DateTime().Month() + 1, timeReceived.DateTime().Year());
+	INFO_PRINTF5(_L("at %d :%d :%d :%d"), timeReceived.DateTime().Hour(), timeReceived.DateTime().Minute(), timeReceived.DateTime().Second(), timeReceived.DateTime().MicroSecond());
+	
+	timeStamp = pos.Time();
+	INFO_PRINTF1(_L("First position timeStamp: "));
+	INFO_PRINTF4(_L("%d/%d/%d"), timeStamp.DateTime().Day() + 1, timeStamp.DateTime().Month() + 1, timeStamp.DateTime().Year());
+	INFO_PRINTF5(_L("at %d :%d :%d :%d"), timeStamp.DateTime().Hour(), timeStamp.DateTime().Minute(), timeStamp.DateTime().Second(), timeStamp.DateTime().MicroSecond());	
+	
+	TInt64 timediff;
+	timediff = timeReceived.Int64() - aTimeRequested.Int64();
+	
+	// *first* position received can arrive 'immediately' and up to timeout, or maxtimetofirstfix if timeout not specified
+	if(timediff > maxtime)
+		{
+		INFO_PRINTF1(_L("Failed: First Position received outside time range"));
+		return FALSE;									
+		}
+	else
+		{
+		return TRUE;
+		}
+	}
+	
+	
+/**
+ aPosCount - which position in a set of periodic positions this is (first position = 0)
+ */
+TBool CT_LbsClientStep_Tracking::VerifyPosTime(const TTime& aTimeFirstPosStamped, const TPositionUpdateOptions& aUpdateOpts, TPositionInfo& aPosInfo, TInt aPosCount)
+	{
+	TTime timeReceived, timeStamp;
+	TPosition pos;
+    TInt64 interval = aUpdateOpts.UpdateInterval().Int64();	
+    TTimeIntervalMicroSeconds timeout;
+    timeout = aUpdateOpts.UpdateTimeOut().Int64();
+    	
+    // should call different function for first position:		
+    __ASSERT_ALWAYS(aPosCount > 0, User::Panic(_L("Update options test"), KErrArgument));				
+    
+	// get current time
+	timeReceived.UniversalTime();
+	
+	// get the position data:
+	aPosInfo.GetPosition(pos);
+	
+	INFO_PRINTF1(_L("Position received at: "));	
+	INFO_PRINTF4(_L("%d/%d/%d"), timeReceived.DateTime().Day() + 1, timeReceived.DateTime().Month() + 1, timeReceived.DateTime().Year());
+	INFO_PRINTF5(_L("at %d :%d :%d :%d"), timeReceived.DateTime().Hour(), timeReceived.DateTime().Minute(), timeReceived.DateTime().Second(), timeReceived.DateTime().MicroSecond());
+	
+	timeStamp = pos.Time();
+	INFO_PRINTF1(_L("Position timeStamp: "));
+	INFO_PRINTF4(_L("%d/%d/%d"), timeStamp.DateTime().Day() + 1, timeStamp.DateTime().Month() + 1, timeStamp.DateTime().Year());
+	INFO_PRINTF5(_L("at %d :%d :%d :%d"), timeStamp.DateTime().Hour(), timeStamp.DateTime().Minute(), timeStamp.DateTime().Second(), timeStamp.DateTime().MicroSecond());
+
+	TTime windowstart = aTimeFirstPosStamped + static_cast<TTimeIntervalMicroSeconds>(aPosCount * interval) - KTimestampMargin;
+	TTime windowend = windowstart + timeout + KTimestampMargin;
+
+	INFO_PRINTF1(_L("valid window start: "));	
+	INFO_PRINTF4(_L("%d/%d/%d"), windowstart.DateTime().Day() + 1, windowstart.DateTime().Month() + 1, windowstart.DateTime().Year());
+	INFO_PRINTF5(_L("at %d :%d :%d :%d"), windowstart.DateTime().Hour(), windowstart.DateTime().Minute(), windowstart.DateTime().Second(), windowstart.DateTime().MicroSecond());
+
+	if(timeStamp < windowstart && timeReceived < windowstart)
+		{
+		INFO_PRINTF1(_L("Failed: Position received outside time range"));
+		return FALSE;
+		}
+	if(timeout.Int64() && (timeStamp > windowend || timeReceived > windowend))
+		{
+		INFO_PRINTF1(_L("valid window end: "));	
+		INFO_PRINTF4(_L("%d/%d/%d"), windowend.DateTime().Day() + 1, windowend.DateTime().Month() + 1, windowend.DateTime().Year());
+		INFO_PRINTF5(_L("at %d :%d :%d :%d"), windowend.DateTime().Hour(), windowend.DateTime().Minute(), windowend.DateTime().Second(), windowend.DateTime().MicroSecond());
+		
+		return FALSE;
+		}
+	else
+		{
+		return TRUE;
+		}
+	}
+
+	
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsClientStep_Tracking::doTestStepL()
+	{
+	// Generic test step used to test the LBS SetUpdateOptions API.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsClientStep_Tracking::doTestStepL()"));
+
+	if (TestStepResult()==EPass) 
+		{
+		// Determine the test case id.
+		TInt testCaseId;
+		if (GetIntFromConfig(ConfigSection(), KTestCaseId, testCaseId))
+			{
+			// Set the update options.
+			T_LbsUtils utils;
+			TPtrC configFileName;
+			_LIT(KUpdateOptionsFile, "agps_module_update_file");
+	
+			GetStringFromConfig(ConfigSection(), KUpdateOptionsFile, configFileName);
+
+			utils.GetConfigured_ModuleUpdateOptionsL(configFileName, ConfigSection(), iUpdateOpts);
+			iPositioner.SetUpdateOptions(iUpdateOpts);
+			
+			// count the number of updates from the .ini file
+			RPointerArray<TLbsModuleUpdateItem> posInfoArray;
+			utils.GetConfigured_UpdateArrayL(configFileName, ConfigSection(), posInfoArray);
+			TInt numOfPosInfos = posInfoArray.Count();
+			posInfoArray.ResetAndDestroy();
+
+			// Perfom test.
+			TInt err = KErrNone;
+			TPosition pos;
+			TTime timeFirstStamped;
+			TTime timeRequested;
+			iUpdateWindowIndex = 0;
+			if(testCaseId == 8)
+				{
+				iCheckIfSameAsPreviousPosition = ETrue;
+				}
+			else
+				{
+				iCheckIfSameAsPreviousPosition = EFalse;				
+				}
+
+			
+			for (iUpdateIndex = 0 ; iUpdateIndex < numOfPosInfos; iUpdateIndex++)
+				{				
+				// Get and log current time.
+				timeRequested.UniversalTime();
+				INFO_PRINTF1(_L("Position requested at: "));	
+				INFO_PRINTF4(_L("%d/%d/%d"), timeRequested.DateTime().Day() + 1, timeRequested.DateTime().Month() + 1, timeRequested.DateTime().Year());
+				INFO_PRINTF5(_L("at %d :%d :%d :%d"), timeRequested.DateTime().Hour(), timeRequested.DateTime().Minute(), timeRequested.DateTime().Second(), timeRequested.DateTime().MicroSecond());
+
+				// Do request to position update.
+				err = DoNotifyUpdateL(iPosInfo);
+
+				iPosInfo.GetPosition(pos);
+				
+				// First update, ref pos, KErrNone.
+				if (iUpdateIndex == 0)
+					{
+					// Verify time taken for first update.
+					timeFirstStamped = pos.Time();	// Need to remember the time we received this update.
+					if(!VerifyFirstPosTime(timeRequested, iPosInfo, iUpdateOpts))
+						{
+						SetTestStepResult(EFail);									
+						}
+
+					// Verify reference position.
+					TPositionInfo verifyRefPosInfo;
+					
+					verifyRefPosInfo.SetPosition(iRefPos);
+					if (!utils.Compare_PosInfo(verifyRefPosInfo, iPosInfo))
+						{
+						INFO_PRINTF1(_L("Failed test, reference position incorrect."));
+						SetTestStepResult(EFail);
+						}
+						
+					// Expected error.
+					iExpectedErr = KErrNone;
+					
+					// Expect to verify interval time, for other updates.
+					iVerifyInterval = ETrue;
+					iPreviousPos = iPosInfo;
+					}
+
+				// Remaining updates.
+				else
+					{
+					// Increment the expected time interval 'window' the update is expected to arrive in
+					iUpdateWindowIndex++;
+				
+					// Determine expected err, and any special test actions.
+					switch (iUpdateIndex)
+						{
+						// Second update, gps accurate, KErrNone, after n * intervals.
+						case 1:
+							{
+							iExpectedErr = KErrNone;
+						
+							if(testCaseId == 7)
+								{
+								DoInterval_TestCaseId_07();
+								}
+							else if(testCaseId == 8)
+								{
+								DoInterval_TestCaseId_08();
+								}
+							else
+								{
+								// Got the first accurate gps update, switch on partial updates.
+								iUpdateOpts.SetAcceptPartialUpdates(ETrue);
+								iPositioner.SetUpdateOptions(iUpdateOpts);
+								}
+
+							break;
+							}
+
+						// Remaining updates as per test case.
+						default:
+							{
+							switch (testCaseId)
+								{
+								// Test case LBS-Tracking-001
+								case 1:
+									{
+									DoInterval_TestCaseId_01();
+
+									break;
+									}
+
+								// Test case LBS-Tracking-002
+								case 2:
+									{
+									DoInterval_TestCaseId_02();
+									
+									break;
+									}
+
+								// Test case LBS-Tracking-003
+								case 3:
+									{
+									DoInterval_TestCaseId_03();
+								
+									break;
+									}
+
+								// Test case LBS-Tracking-004									
+								case 4:
+									{
+									DoInterval_TestCaseId_04();
+										
+									break;
+									}
+									
+								// Test case LBS-Tracking-005
+								case 5:
+									{
+									DoInterval_TestCaseId_05();
+									
+									break;
+									}
+
+								// Test case LBS-Tracking-006
+								case 6:
+									{
+									DoInterval_TestCaseId_06();
+									
+									break;
+									}
+									
+								// Test case LBS-Tracking-007
+								case 7:
+									{
+									DoInterval_TestCaseId_07();
+																	
+									break;
+									}
+
+								// Test case LBS-Tracking-008
+								case 8:
+									{
+									DoInterval_TestCaseId_08();
+																	
+									break;
+									}
+								}
+							}
+						break;
+						}
+
+					// Verify correct interval for update, if required.
+					if (iVerifyInterval)
+						{
+						if(!VerifyPosTime(timeFirstStamped, iUpdateOpts, iPosInfo, iUpdateWindowIndex))
+							{
+							INFO_PRINTF1(_L("Failed: Position received outside time range"));
+							SetTestStepResult(EFail);
+							}
+						}
+					
+					if(iCheckIfSameAsPreviousPosition)
+						{
+						if(iSameAsPreviousPos && !utils.Compare_PosInfo(iPreviousPos, iPosInfo))
+							{
+							INFO_PRINTF1(_L("Failed test, position different from previous, when it should be same."));
+							SetTestStepResult(EFail);
+							}
+						if(!iSameAsPreviousPos && utils.Compare_PosInfo(iPreviousPos, iPosInfo))
+							{
+							INFO_PRINTF1(_L("Failed test, position same as previous, when it should be different."));
+							SetTestStepResult(EFail);
+							}
+						}
+					iPreviousPos = iPosInfo;
+					}
+					
+				// Verify err.
+				if (err != iExpectedErr)
+					{
+					SetTestStepResult(EFail);						
+					}
+				}
+		
+			}
+		
+		}
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsClientStep_Tracking::doTestStepL()"));
+
+	return TestStepResult();
+	}
+
+
+// Test 1 - expected updates
+//
+// Ref pos,				KErrNone,				before interval
+// Gps pos (accurate),	KErrNone,				after n * intervals
+// Gps pos (accurate),	KErrNone, 				after interval
+// Gps pos (partial),	KPositionPartialUpdate,	after interval
+//
+void CT_LbsClientStep_Tracking::DoInterval_TestCaseId_01()
+{
+
+	switch (iUpdateIndex)
+		{
+		case 2:	// Third update, gps accurate, KErrNone.
+			{
+			iExpectedErr = KErrNone;
+			
+			break;
+			}
+	
+		case 3:	// Last update, gps inaccurate, KPositionPartialUpdate.	
+			{
+			iExpectedErr = KPositionPartialUpdate;
+		
+			break;
+			}
+		}
+	}
+
+
+// Test 2 - expected updates
+//
+// Ref pos,				KErrNone,	before interval
+// Gps pos (accurate),	KErrNone,	after n * intervals
+// Gps pos (accurate),	KErrNone,	after interval
+// Gps pos (accurate),	KErrNone,	after interval
+//
+void CT_LbsClientStep_Tracking::DoInterval_TestCaseId_02()
+{
+
+	switch (iUpdateIndex)
+		{
+		case 2:	// Third update, gps accurate, KErrNone.
+		case 3: // Last update, gps accurate, KErrNone.
+			{
+			iExpectedErr = KErrNone;
+			
+			break;
+			}
+		}
+	}
+
+
+// Test 3 - expected updates
+//
+// Ref pos,				KErrNone,				before interval
+// Gps pos (accurate),	KErrNone,				after n * intervals
+// Gps pos (NAN),		KPositionPartialUpdate,	after interval
+// Gps pos (NAN),		KPositionPartialUpdate,	after interval
+//
+void CT_LbsClientStep_Tracking::DoInterval_TestCaseId_03()
+{
+
+	switch (iUpdateIndex)
+		{
+		case 2:	// Third update, gps NAN, KPositionPartialUpdate.
+		case 3:	// Last update, gps NAN, KPositionPartialUpdate.	
+			{
+			iExpectedErr = KPositionPartialUpdate;
+		
+			break;
+			}
+		}
+	}
+
+
+// Test 4 - expected updates
+//
+// Ref pos,					KErrNone,				before interval
+// Gps pos (accurate),		KErrNone,				after n * intervals
+// Gps pos (inaccurate),	KPositionPartialUpdate,	after interval
+// Gps pos (inaccurate),	KPositionPartialUpdate,	after interval
+//
+void CT_LbsClientStep_Tracking::DoInterval_TestCaseId_04()
+{
+
+	switch (iUpdateIndex)
+		{
+		case 2:	// Third update, gps accurate, KPositionPartialUpdate.
+		case 3:	// Last update, gps inaccurate, KPositionPartialUpdate.	
+			{
+			iExpectedErr = KPositionPartialUpdate;
+		
+			break;
+			}
+		}
+	}
+
+
+// Test 5 - expected updates
+//
+// Ref pos,					KErrNone,		before interval
+// Gps pos (accurate),		KErrNone,		after n * intervals
+// Gps pos (accurate),		KErrNonee,		after interval
+// Gps pos (not delivered),	KErrTimedOut,	after interval
+//
+void CT_LbsClientStep_Tracking::DoInterval_TestCaseId_05()
+{
+
+	switch (iUpdateIndex)
+		{
+		case 2:	// Third update, gps accurate, KErrNone.
+			{
+			iExpectedErr = KErrNone;			
+
+			// Send timeout to the A-GPS hybrid module - we expect further updates to timeout.
+			TTimeIntervalMicroSeconds timeOutVal(40000000);
+			
+			ConfigureModuleTimeOut(timeOutVal);
+			
+			break;
+			}
+	
+		case 3:	// Last update, gps inaccurate, KPositionPartialUpdate.	
+			{
+			iExpectedErr = KErrTimedOut;
+			iVerifyInterval = EFalse;
+			
+			// Reset the timeout in the A-GPS module.
+			TTimeIntervalMicroSeconds timeOutVal(0);
+			ConfigureModuleTimeOut(timeOutVal);
+			break;
+			}
+		}
+	}
+
+// Test 6 - expected updates
+//
+// Ref pos,					KErrNone,				before interval
+// Gps pos (accurate),		KErrNone,				after n * intervals
+// Gps pos (inaccurate),	KPositionPartialUpdate,	after interval
+// Gps pos (NAN),			KPositionQualityLoss,	before interval (because of futile udpate)
+// Gps pos (inaccurate),	KPositionPartialUpdate,	after interval
+//
+void CT_LbsClientStep_Tracking::DoInterval_TestCaseId_06()
+{
+
+	switch (iUpdateIndex)
+		{
+		case 2:	// Third update, gps inaccurate, KPositionPartialUpdate.
+			{
+			iExpectedErr = KPositionPartialUpdate;
+			break;
+			}
+			
+		case 3:	// Fourth update, gps NAN, KPositionQualityLoss.
+			{
+			iExpectedErr = KPositionQualityLoss;
+			
+			// This update should have happened before the next expected 
+			// interval window (because it's a futile update from the
+			// GPS module), so it will be in the previous 'window'
+			iUpdateWindowIndex--;
+			break;
+			}
+	
+		case 4:	// Last update, gps inaccurate, KPositionPartialUpdate.	
+			{
+			iExpectedErr = KPositionPartialUpdate;
+			break;
+			}
+		}
+	}
+
+// Test 7 - expected updates
+//
+// Ref pos,					KErrNone,				before interval
+// Gps pos (accurate),		KErrNone,				after n * intervals
+// Gps pos (inaccurate),	KPositionQualityLoss,	after timeout
+//
+void CT_LbsClientStep_Tracking::DoInterval_TestCaseId_07()
+	{
+	switch (iUpdateIndex)
+		{
+		case 1:
+			{
+			iExpectedErr = KErrNone;
+			break;
+			}
+		case 2:
+			{
+			iVerifyInterval = EFalse;
+			iExpectedErr = KPositionQualityLoss;
+			break;
+			}
+		}
+	}
+
+void CT_LbsClientStep_Tracking::DoInterval_TestCaseId_08()
+	{
+	iExpectedErr = KErrNone;
+	switch (iUpdateIndex)
+		{
+		case 1:
+		case 3:
+			{
+			iSameAsPreviousPos = EFalse;
+			break;
+			}
+		case 2:
+			{
+			iSameAsPreviousPos = ETrue;
+			break;
+			}
+		}	
+	}
+
+// A-GPS hybrid module configuration function.
+void CT_LbsClientStep_Tracking::ConfigureModuleTimeOut(TTimeIntervalMicroSeconds& aTimeOut)
+	{
+	CT_LbsAGpsHandler* modHandler;
+	modHandler = CT_LbsAGpsHandler::NewL(this);
+
+	// Send timeout request.
+	modHandler->SendRequestTimeOutMsg(aTimeOut);
+
+	// Wait for response from module.	
+	CActiveScheduler::Start();
+	
+	delete modHandler;
+	}
+
+
+// Response back from A-GPS hybrid module to notify the test it has got the timeout request.
+void CT_LbsClientStep_Tracking::ProcessAGpsResponseMessage(const TT_LbsAGpsResponseMsg::TModuleResponseType aResponse)
+	{
+	if (TT_LbsAGpsResponseMsg::EModuleResponseOk != aResponse)
+		{
+		// fail test could not config module!
+		INFO_PRINTF2(_L("Unable to configure hybrid module, err %d."), aResponse);	
+		SetTestStepResult(EFail);						
+		}
+		
+		// Return back to test.
+		CActiveScheduler::Stop();	
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/src/ctlbsclientstepupdateoptions.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1274 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsclientstep_UpdateOptions.cpp
+// This is the class implementation for the UpdateOptions Tests
+// 
+//
+ 
+#include "ctlbsclientstepupdateoptions.h"
+
+#include <lbs.h>
+#include <lbssatellite.h>
+
+#include "tlbsutils.h"
+#include "ctlbsasyncwaiter.h"
+
+#define EXPECTED_GPS_ACCURACY_HORIZONTAL 100
+#define EXPECTED_GPS_ACCURACY_VERTICAL 100
+
+const TTimeIntervalMicroSeconds KTimestampMargin = 500000; //+/-0.5s
+
+/**
+ 
+ */
+TBool CT_LbsClientStep_UpdateOptions::VerifyFirstPosTime(const TTime& aTimeRequested, const TPositionInfo& aPosInfo, const TPositionUpdateOptions& aUpdateOpts)
+	{
+	TTime timeReceived, timeStamp;
+	TPosition pos;
+					
+    TInt64 maxtime;
+    maxtime = aUpdateOpts.UpdateTimeOut().Int64();
+	if(!maxtime)	
+		{
+		#pragma message("TO DO: CT_LbsClientStep_UpdateOptions::VerifyFirstPosTime - Update when moduleinfo supported")	
+		const TTimeIntervalMicroSeconds ttff = 90*1000000;	// TO DO - this should be retrieved from the module info (currently hardcoded in locserver too)
+		maxtime = ttff.Int64();
+		}
+										
+	// get current time
+	timeReceived.UniversalTime();
+	
+	// get the position data:
+	aPosInfo.GetPosition(pos);
+	
+	INFO_PRINTF1(_L("First position received at: "));	
+	INFO_PRINTF4(_L("%d/%d/%d"), timeReceived.DateTime().Day() + 1, timeReceived.DateTime().Month() + 1, timeReceived.DateTime().Year());
+	INFO_PRINTF5(_L("at %d :%d :%d :%d"), timeReceived.DateTime().Hour(), timeReceived.DateTime().Minute(), timeReceived.DateTime().Second(), timeReceived.DateTime().MicroSecond());
+	
+	timeStamp = pos.Time();
+	INFO_PRINTF1(_L("First position timeStamp: "));
+	INFO_PRINTF4(_L("%d/%d/%d"), timeStamp.DateTime().Day() + 1, timeStamp.DateTime().Month() + 1, timeStamp.DateTime().Year());
+	INFO_PRINTF5(_L("at %d :%d :%d :%d"), timeStamp.DateTime().Hour(), timeStamp.DateTime().Minute(), timeStamp.DateTime().Second(), timeStamp.DateTime().MicroSecond());	
+	
+	TInt64 timediff;
+	timediff = timeReceived.Int64() - aTimeRequested.Int64();
+	
+	// *first* position received can arrive 'immediately' and up to timeout, or maxtimetofirstfix if timeout not specified
+	if(timediff > maxtime)
+		{
+		INFO_PRINTF1(_L("Failed: First Position received outside time range"));
+		return FALSE;									
+		}
+	else
+		{
+		return TRUE;
+		}
+	
+	}
+	
+	
+/**
+ aPosCount - which position in a set of periodic positions this is (first position = 0)
+ */
+TBool CT_LbsClientStep_UpdateOptions::VerifyPosTime(const TTime& aTimeFirstPosStamped, const TPositionUpdateOptions& aUpdateOpts, TPositionInfo& aPosInfo, TInt aPosCount)
+	{
+	TTime timeReceived, timeStamp;
+	TPosition pos;
+    TInt64 interval = aUpdateOpts.UpdateInterval().Int64();	
+    TTimeIntervalMicroSeconds timeout;
+    timeout = aUpdateOpts.UpdateTimeOut().Int64();
+    	
+    // should call different function for first position:		
+    __ASSERT_ALWAYS(aPosCount > 0, User::Panic(_L("Update options test"), KErrArgument));				
+    
+	// get current time
+	timeReceived.UniversalTime();
+	
+	// get the position data:
+	aPosInfo.GetPosition(pos);
+	
+	INFO_PRINTF1(_L("Position received at: "));	
+	INFO_PRINTF4(_L("%d/%d/%d"), timeReceived.DateTime().Day() + 1, timeReceived.DateTime().Month() + 1, timeReceived.DateTime().Year());
+	INFO_PRINTF5(_L("at %d :%d :%d :%d"), timeReceived.DateTime().Hour(), timeReceived.DateTime().Minute(), timeReceived.DateTime().Second(), timeReceived.DateTime().MicroSecond());
+	
+	timeStamp = pos.Time();
+	INFO_PRINTF1(_L("Position timeStamp: "));
+	INFO_PRINTF4(_L("%d/%d/%d"), timeStamp.DateTime().Day() + 1, timeStamp.DateTime().Month() + 1, timeStamp.DateTime().Year());
+	INFO_PRINTF5(_L("at %d :%d :%d :%d"), timeStamp.DateTime().Hour(), timeStamp.DateTime().Minute(), timeStamp.DateTime().Second(), timeStamp.DateTime().MicroSecond());
+
+	TTime windowstart = aTimeFirstPosStamped + static_cast<TTimeIntervalMicroSeconds>(aPosCount * interval) - KTimestampMargin;
+	TTime windowend = windowstart + timeout + KTimestampMargin;
+
+	INFO_PRINTF1(_L("valid window start: "));	
+	INFO_PRINTF4(_L("%d/%d/%d"), windowstart.DateTime().Day() + 1, windowstart.DateTime().Month() + 1, windowstart.DateTime().Year());
+	INFO_PRINTF5(_L("at %d :%d :%d :%d"), windowstart.DateTime().Hour(), windowstart.DateTime().Minute(), windowstart.DateTime().Second(), windowstart.DateTime().MicroSecond());
+
+	if(timeStamp < windowstart)
+		{
+		INFO_PRINTF1(_L("Failed: Position received outside time range"));
+		return FALSE;
+		}
+	if(timeout.Int64() && (timeStamp > windowend))
+		{
+		INFO_PRINTF1(_L("valid window end: "));	
+		INFO_PRINTF4(_L("%d/%d/%d"), windowend.DateTime().Day() + 1, windowend.DateTime().Month() + 1, windowend.DateTime().Year());
+		INFO_PRINTF5(_L("at %d :%d :%d :%d"), windowend.DateTime().Hour(), windowend.DateTime().Minute(), windowend.DateTime().Second(), windowend.DateTime().MicroSecond());
+		
+		return FALSE;
+		}
+	else
+		{
+		return TRUE;
+		}
+	}
+	
+
+
+
+// constant definitions
+_LIT(KLbsClientStepUpdateOptions, "LbsClientStepUpdateOptions");
+
+/**
+ *	Sets a Requestor for now - TO DO will be removed with new location server?
+ */
+void CT_LbsClientStep_UpdateOptions::TempSetRequestorL()
+ 	{	
+	User::LeaveIfError(iPositioner.SetRequestor(	CRequestor::ERequestorService,
+												CRequestor::EFormatApplication,
+												_L("Tom Tom")));
+ 	}
+
+
+/**
+ * Destructor
+ */
+CT_LbsClientStep_UpdateOptions::~CT_LbsClientStep_UpdateOptions()
+	{
+	delete 	iLbsAdmin;	
+	}
+
+
+/**
+ * Constructor
+ */
+CT_LbsClientStep_UpdateOptions::CT_LbsClientStep_UpdateOptions(CT_LbsClientServer& aParent) : CT_LbsClientStep(aParent), iLbsAdmin(NULL), iRequestedAssData(FALSE), iReceivedAssData(FALSE)
+	{
+	SetTestStepName(KLbsClientStep_UpdateOptions);
+	}
+
+
+/**
+Static Constructor
+*/
+CT_LbsClientStep_UpdateOptions* CT_LbsClientStep_UpdateOptions::New(CT_LbsClientServer& aParent)
+	{
+	return new CT_LbsClientStep_UpdateOptions(aParent);
+	// Note the lack of ELeave.
+	// This means that having insufficient memory will return NULL;
+	}	
+	
+
+/**
+Compare UpdateOptions
+*/
+TBool CT_LbsClientStep_UpdateOptions::CompareUpdateOptions(TPositionUpdateOptions aPosA, TPositionUpdateOptions aPosB)
+	{
+	TBool isEqual = ETrue;
+
+	if(aPosA.AcceptPartialUpdates() != aPosB.AcceptPartialUpdates()) 
+		{
+			return EFalse;
+		}
+		
+	if(aPosA.MaxUpdateAge() != aPosB.MaxUpdateAge())
+		{
+			return EFalse;
+		}
+		
+	if(aPosA.PositionClassSize() != aPosB.PositionClassSize())
+		{
+			return EFalse;
+		}
+		
+	if(aPosA.PositionClassType() != aPosB.PositionClassType())
+		{
+			return EFalse;
+		}
+		
+	if(aPosA.UpdateInterval() != aPosB.UpdateInterval())
+		{
+			return EFalse;
+		}
+		
+	if(aPosA.UpdateTimeOut() != aPosB.UpdateTimeOut())
+		{
+			return EFalse;
+		}
+		
+	return isEqual;
+	
+	}
+	
+/**
+ * @return - TVerdict code
+ * Override of base class pure virtual
+ * Our implementation only gets called if the base class doTestStepPreambleL() did
+ * not leave. That being the case, the current test result value will be EPass.
+ */
+TVerdict CT_LbsClientStep_UpdateOptions::doTestStepL()
+	{
+	// Generic test step used to test the LBS SetUpdateOptions API.
+	INFO_PRINTF1(_L("&gt;&gt;CT_LbsClientStep_UpdateOptions::doTestStepL()"));
+
+	if (TestStepResult()==EPass) 
+		{
+		TInt err = KErrNone;
+		
+		// Connect to self locate server.
+		User::LeaveIfError(iServer.Connect());
+		CleanupClosePushL(iServer);
+		
+		// Carryout unique test actions.
+		TInt testCaseId;
+		if (GetIntFromConfig(ConfigSection(), KTestCaseId, testCaseId))
+			{
+				switch (testCaseId)
+				{
+				// Test case LBS-UpdateOptions-001
+				case 1:
+					{
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+					TPositionUpdateOptions optsA;
+					
+					TPositionUpdateOptions optsB;
+					iPositioner.SetUpdateOptions(optsA);
+					iPositioner.GetUpdateOptions(optsB);
+					if (!CompareUpdateOptions(optsA, optsB))
+						{
+						SetTestStepResult(EFail);
+						}
+
+					CleanupStack::PopAndDestroy(&iPositioner);
+					
+					break;
+					}
+				
+				// Test case LBS-UpdateOptions-002
+				case 2:
+					{
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+					//(aInterval, aTimeOut, aMaxAge, TBool aAcceptPartialUpdates=EFalse)
+					TPositionUpdateOptions optsA(-1, 0, 0, EFalse);
+					
+					CleanupStack::PopAndDestroy(&iPositioner);
+					
+					break;
+					}
+					
+				// Test case LBS-UpdateOptions-003
+				case 3:
+					{
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+
+					TPositionUpdateOptions optsA(0, -1, 0, EFalse);
+					
+					CleanupStack::PopAndDestroy(&iPositioner);
+					
+					break;
+					}	
+					
+				// Test case LBS-UpdateOptions-004
+				case 4:
+					{
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+
+					TPositionUpdateOptions optsA(0, 0, -1, EFalse);
+					
+					CleanupStack::PopAndDestroy(&iPositioner);
+					
+					break;
+					}	
+					
+					
+				// Test case LBS-UpdateOptions-005
+				case 5:
+					{
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+					
+					TPositionUpdateOptions& updateOpts = iParent.iSharedData->iVerifyUpdateOpts;
+					iPositioner.SetUpdateOptions(updateOpts);
+					
+					// Create a posinfo and store in our shared array for later verification.
+					RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+					TPositionInfo* posInfo = new(ELeave) TPositionInfo();
+	
+					T_LbsUtils utils;
+					utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+
+					posInfoArr.Append(posInfo);
+	
+					TTime timeRequested;
+					timeRequested.UniversalTime();
+					INFO_PRINTF1(_L("Position requested at: "));	
+					INFO_PRINTF4(_L("%d/%d/%d"), timeRequested.DateTime().Day() + 1, timeRequested.DateTime().Month() + 1, timeRequested.DateTime().Year());
+					INFO_PRINTF5(_L("at %d :%d :%d :%d"), timeRequested.DateTime().Hour(), timeRequested.DateTime().Minute(), timeRequested.DateTime().Second(), timeRequested.DateTime().MicroSecond());
+					
+
+					// Get the actual position
+					err = DoNotifyUpdateL(*posInfo);
+					if (KErrNone != err || !VerifyFirstPosTime(timeRequested, *posInfo, updateOpts))
+						{
+						SetTestStepResult(EFail);
+						}
+					CleanupStack::PopAndDestroy(&iPositioner);
+
+					break;
+					}
+					
+					
+				// Test case LBS-UpdateOptions-006
+				case 6:
+					{
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+					
+					RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+					T_LbsUtils utils;
+					utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+
+					// Create a posinfo and store in our shared array for later verification.
+					TPositionInfo* posInfo = new(ELeave) TPositionInfo();
+					posInfoArr.Append(posInfo);					
+					
+					TRequestStatus status;
+										
+					TPositionUpdateOptions tempOpts;
+					// set a fairly long interval (1 minute) to ensure the 2nd request doesn't complete too quicky:
+					tempOpts.SetUpdateInterval(60*1000000);
+					tempOpts.SetUpdateTimeOut(300*1000000);
+					iPositioner.SetUpdateOptions(tempOpts);
+					iPositioner.GetUpdateOptions(tempOpts);			
+					
+					TempSetRequestorL();
+					
+					TTime timeRequested;					
+					TTime timeFirstStamped;							
+					
+					INFO_PRINTF2(_L("Requesting position (current interval set to %d): "),tempOpts.UpdateInterval().Int64() );
+					timeRequested.UniversalTime();
+					err = DoNotifyUpdateL(*posInfo);
+					if (KErrNone != err)
+						{
+						INFO_PRINTF2(_L("Failed: Position Update failed with %d"), err);
+						SetTestStepResult(EFail);
+						}
+					else
+						{
+						TPosition pos;
+						posInfo->GetPosition(pos);
+						
+						// need to remember the time we received this one:		
+						timeFirstStamped = pos.Time();		
+						if(!VerifyFirstPosTime(timeRequested, *posInfo, tempOpts))
+							{
+							SetTestStepResult(EFail);									
+							}
+						}
+						
+					// Create another posinfo and store in our shared array for later verification.						
+					posInfo = new(ELeave) TPositionInfo();
+					posInfoArr.Append(posInfo);					
+											
+					INFO_PRINTF2(_L("Requesting position (current interval set to %d): "), tempOpts.UpdateInterval().Int64());
+					
+					// this should complete after original interval (1 min), despite setting a new interval while it's outstanding:
+					iPositioner.NotifyPositionUpdate(*posInfo, status);	
+
+					// set configured update options while update still outstanding:
+					TPositionUpdateOptions& updateOpts = iParent.iSharedData->iVerifyUpdateOpts;					
+					iPositioner.SetUpdateOptions(updateOpts);
+					iPositioner.GetUpdateOptions(updateOpts);
+					
+					INFO_PRINTF2(_L("Interval now set to %d microseconds"), updateOpts.UpdateInterval().Int64());
+					
+					User::WaitForRequest(status);
+					
+					// verify time for 'outstanding when interval changed' position										
+					if(!VerifyPosTime(timeFirstStamped, tempOpts, *posInfo, 1))
+						{
+						INFO_PRINTF1(_L("CT_LbsClientStep_UpdateOptions::doTestStepL() Failed: Time received outside valid range"));
+						SetTestStepResult(EFail);									
+						}
+					else
+						{
+						TInt numOfPosInfos = iParent.iSharedData->iVerifyPosInfoArr.Count() - 2;	// -2 because first 2 positions used above
+						for(TInt i = 0 ; i < numOfPosInfos ; i++)
+							{
+							// get current time
+							timeRequested.UniversalTime();
+							INFO_PRINTF1(_L("Position requested at: "));	
+							INFO_PRINTF4(_L("%d/%d/%d"), timeRequested.DateTime().Day() + 1, timeRequested.DateTime().Month() + 1, timeRequested.DateTime().Year());
+							INFO_PRINTF5(_L("at %d :%d :%d :%d"), timeRequested.DateTime().Hour(), timeRequested.DateTime().Minute(), timeRequested.DateTime().Second(), timeRequested.DateTime().MicroSecond());
+							
+							//Do request to position update
+							posInfo = new(ELeave) TPositionInfo();
+							posInfoArr.Append(posInfo);					
+							
+							err = DoNotifyUpdateL(*posInfo);
+							if (KErrNone != err)
+								{
+								INFO_PRINTF2(_L("Failed: Position Update failed with %d"), err);
+								SetTestStepResult(EFail);
+								}
+							else
+								{	
+								if(i > 0)
+									{							
+									if(!VerifyPosTime(timeFirstStamped, updateOpts, *posInfo, i))
+										{
+										INFO_PRINTF1(_L("Failed: Position received outside time range"));
+										SetTestStepResult(EFail);
+										}
+									}
+								else	// first position
+									{
+									TPosition pos;
+									
+									posInfo->GetPosition(pos);
+									
+									// need to remember the time we received this one:		
+									timeFirstStamped = pos.Time();		
+									if(!VerifyFirstPosTime(timeRequested, *posInfo, updateOpts))
+										{
+										SetTestStepResult(EFail);									
+										}
+									}		
+								}	
+							}
+						}
+
+					CleanupStack::PopAndDestroy(&iPositioner);
+					
+					break;
+					}
+					
+					
+				// Test case LBS-UpdateOptions-007
+				case 7:
+				case 107:
+					{
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+
+
+					// For this test an additional reference position will be returned.
+					if (testCaseId == 107)
+						{
+						// Setup netsim.
+						User::LeaveIfError(OpenNetSim());
+						
+						// Request notify for the expected reference position.
+						TPositionInfo actualRefPosInfo;
+						
+						err = DoNotifyUpdateL(actualRefPosInfo);
+						if (err)
+							{
+							INFO_PRINTF2(_L("Failed test, reference position request returned err %d."), err);
+
+							SetTestStepResult(EFail);							
+							}
+							
+						// Verify reference position.
+						T_LbsUtils utils;
+						TPositionInfo verifyRefPosInfo;
+						
+						verifyRefPosInfo.SetPosition(iRefPos);
+						if (!utils.Compare_PosInfo(verifyRefPosInfo, actualRefPosInfo))
+							{
+							INFO_PRINTF1(_L("Failed test, reference position incorrect."));
+							SetTestStepResult(EFail);
+							}
+						}
+					
+					
+					TPositionUpdateOptions& updateOpts = iParent.iSharedData->iVerifyUpdateOpts;
+															
+					iPositioner.SetUpdateOptions(updateOpts);
+					
+					// verify that the set worked:
+					ASSERT(updateOpts.UpdateInterval() == iParent.iSharedData->iVerifyUpdateOpts.UpdateInterval());
+					
+					// Create a posinfo and store in our shared array for later verification.
+					RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+					T_LbsUtils utils;
+					utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+
+					TPositionInfo* posInfo;
+					TTime timeRequested;
+					
+					iPositioner.GetUpdateOptions(updateOpts);
+										
+					TInt  numOfPosInfos = iParent.iSharedData->iVerifyPosInfoArr.Count();
+					TTime timeFirstStamped;
+					for(TInt i = 0 ; i < numOfPosInfos ; i++)
+						{
+						// get current time
+						timeRequested.UniversalTime();
+						INFO_PRINTF1(_L("Position requested at: "));	
+						INFO_PRINTF4(_L("%d/%d/%d"), timeRequested.DateTime().Day() + 1, timeRequested.DateTime().Month() + 1, timeRequested.DateTime().Year());
+						INFO_PRINTF5(_L("at %d :%d :%d :%d"), timeRequested.DateTime().Hour(), timeRequested.DateTime().Minute(), timeRequested.DateTime().Second(), timeRequested.DateTime().MicroSecond());
+
+						//Do request to position update
+						posInfo = new(ELeave) TPositionInfo();
+						posInfoArr.Append(posInfo);
+																		
+						err = DoNotifyUpdateL(*posInfo);
+						if (KErrNone != err)
+							{
+							INFO_PRINTF2(_L("NotifyUpdate failed with %d "), err);	
+							SetTestStepResult(EFail);
+							}
+						else
+							{
+							if(i > 0)
+								{							
+								if(!VerifyPosTime(timeFirstStamped, updateOpts, *posInfo, i))
+									{
+									INFO_PRINTF1(_L("Failed: Position received outside time range"));
+									SetTestStepResult(EFail);
+									}
+								}
+							else	// first position
+								{
+								TPosition pos;
+								
+								posInfo->GetPosition(pos);
+								
+								// need to remember the time we received this one:		
+								timeFirstStamped = pos.Time();		
+								if(!VerifyFirstPosTime(timeRequested, *posInfo, updateOpts))
+									{
+									SetTestStepResult(EFail);									
+									}
+								}				
+							}
+						}
+
+					// Clean up.						
+					CleanupStack::PopAndDestroy(&iPositioner);
+					if (testCaseId == 107)
+						{
+						CloseNetSim();
+						}
+
+					break;
+					}
+					
+				// Test case LBS-UpdateOptions-008
+				case 8:
+					{
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+					
+					//2 second interval
+					TPositionUpdateOptions optsA(2000000, 0, 0, EFalse);
+					optsA.SetUpdateInterval(-1);
+					
+					CleanupStack::PopAndDestroy(&iPositioner);
+
+					break;
+					}
+					
+				// Test case LBS-UpdateOptions-009
+				case 9:
+					{
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+					
+
+					//10 second interval
+					TPositionUpdateOptions posUpdateOptsA(10000000, 0, 0, EFalse);
+					TPositionUpdateOptions posUpdateOptsB; 
+					iPositioner.SetUpdateOptions(posUpdateOptsA);
+					iPositioner.GetUpdateOptions(posUpdateOptsB);
+					
+					if(!CompareUpdateOptions(posUpdateOptsA, posUpdateOptsB))
+						{
+						INFO_PRINTF1(_L("SetUpdate and GetUpdate comparison didn't match"));
+						SetTestStepResult(EFail);
+						}	
+												
+					//5 second timeout
+					posUpdateOptsA.SetUpdateTimeOut(5000000);
+					iPositioner.SetUpdateOptions(posUpdateOptsA);
+					iPositioner.GetUpdateOptions(posUpdateOptsB);
+					
+					if(!CompareUpdateOptions(posUpdateOptsA, posUpdateOptsB))
+						{
+						INFO_PRINTF1(_L("SetUpdate and GetUpdate comparison didn't match"));
+						SetTestStepResult(EFail);
+						}
+						
+					TPositionInfo posInfo;
+					
+					// TO DO - is this sufficient, or should we really be testing how long it takes to timeout?
+	
+					// Get the actual position, should time out on AGPS side
+					// ** Configure test gps module to cause a timeout
+					err = DoNotifyUpdateL(posInfo);
+					if (KErrTimedOut != err)
+						{
+						INFO_PRINTF1(_L("<FONT><B>AGPS module didn't timeout as expected.</B></FONT>"));
+						SetTestStepResult(EFail);
+						}						
+						
+					CleanupStack::PopAndDestroy(&iPositioner);
+
+					break;
+					}
+					
+					
+				// Test case LBS-UpdateOptions-010
+				case 10:
+					{
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+					
+					TPositionUpdateOptions optsA;
+					optsA.SetUpdateTimeOut(-1);
+						
+					CleanupStack::PopAndDestroy(&iPositioner);
+					break;
+					}
+	
+					
+				// Test case LBS-UpdateOptions-011
+				case 11:
+					{
+					// Open positioner with
+					// configured required quality
+					TPositionCriteria	criteria;
+					TPositionQuality    quality;
+					
+					// set up the required accuracy
+					quality.SetHorizontalAccuracy(EXPECTED_GPS_ACCURACY_HORIZONTAL);
+					quality.SetVerticalAccuracy(EXPECTED_GPS_ACCURACY_VERTICAL);
+					
+					criteria.SetRequiredQuality(quality);
+					User::LeaveIfError(iPositioner.Open(iServer, criteria));
+					CleanupClosePushL(iPositioner);
+					
+					//Configure partial Updates
+					TPositionUpdateOptions optsA;
+					optsA.SetAcceptPartialUpdates(EFalse);
+					if(EFalse != optsA.AcceptPartialUpdates())
+						{
+						INFO_PRINTF1(_L("Partial Updates not set."));
+						SetTestStepResult(EFail);
+						}	
+					
+					iPositioner.SetUpdateOptions(optsA);
+					
+					
+					// NOTE:
+					// -Expect to call NPU once, and have module return 2 partial updates
+					//  before finally returning the complete update.
+					// -We need a way to inform the module that it nedes to return partial updates
+					//  When we have AcceptPartialUpdates SwitchedOff.
+										
+					// ** Test AGPS manager must already be configured to return partial location info
+					// ** We should only see the full location info to required accuracy etc
+					TPositionInfo positionInfo;
+					TPositionInfo positionInfoTemp = reinterpret_cast<TPositionInfo&>(iParent.iSharedData->iVerifyPosInfoArr[2]);
+	
+					// Get the actual position
+					err = DoNotifyUpdateL(positionInfo);
+					if (KErrNone != err)
+						{
+						SetTestStepResult(EFail);
+						}
+					else
+						{
+						//Compare posInfo with Moduledata 3
+						T_LbsUtils utils;
+						if(!utils.Compare_PosInfo(positionInfo, positionInfoTemp))
+							{
+							INFO_PRINTF1(_L("<FONT><B>We didn't recieve complete update.</B></FONT>"));
+							SetTestStepResult(EFail);
+							}
+						}
+																
+					CleanupStack::PopAndDestroy(&iPositioner);
+
+					break;
+					}
+	
+				// Test case LBS-UpdateOptions-012
+				case 12:
+					{
+					// Open positioner with
+					// configured required quality
+					TPositionCriteria	criteria;
+					TPositionQuality    quality;
+					
+					// set up the required accuracy
+					quality.SetHorizontalAccuracy(EXPECTED_GPS_ACCURACY_HORIZONTAL);
+					quality.SetVerticalAccuracy(EXPECTED_GPS_ACCURACY_VERTICAL);
+					
+					criteria.SetRequiredQuality(quality);
+					err = iPositioner.Open(iServer, criteria);
+					User::LeaveIfError(err);
+					CleanupClosePushL(iPositioner);
+					
+					//Configure partial Updates
+					TPositionUpdateOptions optsA;
+					optsA.SetAcceptPartialUpdates(ETrue);
+					if(!optsA.AcceptPartialUpdates())
+						{
+						INFO_PRINTF1(_L("Partial Updates not set."));
+						SetTestStepResult(EFail);
+						}	
+					
+					err = iPositioner.SetUpdateOptions(optsA);
+					User::LeaveIfError(err);
+					
+					// NOTE:
+					// -Expect to call NPU repeatedly to recieve each partial update
+					// -We need a way to inform the module that it nedes to return partial updates
+					//  When we have AcceptPartialUpdates SwitchedOff.
+										
+					// ** Test AGPS manager must already be configured to return partial location info
+					// ** We should only see the full location info to required accuracy etc
+
+					// Create a posinfo and store in our shared array for later verification.
+					RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
+					T_LbsUtils utils;
+					utils.ResetAndDestroy_PosInfoArr(posInfoArr);	// Clear previous entries before new entry is appended.
+
+					TInt loopCount = iParent.iSharedData->iCurrentPosInfoArr.Count()-1;
+					// Get the actual position
+					for(int i = 0 ; i < loopCount ; i++ )
+						{
+						TPositionInfo* positionInfo = new(ELeave) TPositionInfo();
+						posInfoArr.Append(positionInfo);
+						
+						err = DoNotifyUpdateL(*positionInfo);
+						if (KErrNone != err)
+							{
+							SetTestStepResult(EFail);
+							}	
+						}
+									
+					CleanupStack::PopAndDestroy(&iPositioner);
+
+					break;
+					}
+				
+				// Test case LBS-UpdateOptions-013
+				case 13:
+					{
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);					
+					
+					TPositionInfo posInfo;
+					TPositionInfo posInfob;
+	
+					// This call to NPU puts a location in cache
+					err = DoNotifyUpdateL(posInfo);
+					if (KErrNone != err)
+						{
+						SetTestStepResult(EFail);
+						}
+						
+					// TO DO - read these from config?
+					TPositionUpdateOptions posOpts;
+					posOpts.SetMaxUpdateAge(1*1000000);
+					posOpts.SetUpdateInterval(5*1000000);
+					
+					if((posOpts.MaxUpdateAge() != 1000000) || (posOpts.UpdateInterval() != 5000000))
+						{
+						SetTestStepResult(EFail);
+						}
+						
+					iPositioner.SetUpdateOptions(posOpts);
+											
+					//Retrieve cached location with second call to NPU
+					err = DoNotifyUpdateL(posInfob);
+					if (KErrNone != err)
+						{
+						SetTestStepResult(EFail);
+						}
+					
+					//INTERNAL COMPARISON
+					//Make sure we've retrieved the cached location						
+					T_LbsUtils utils;
+					if(!utils.Compare_PosInfo(posInfo, posInfob))
+						{
+						SetTestStepResult(EFail);
+						}
+
+					CleanupStack::PopAndDestroy(&iPositioner);
+
+					break;
+					}	
+					
+			
+					
+					
+					
+				// Test case LBS-UpdateOptions-014
+				case 14:
+					{
+					T_LbsUtils utils;
+					TPositionModuleId networkModId = utils.GetNetworkModuleIdL(iServer);
+									
+					// Open positioners.
+					User::LeaveIfError(iPositioner.Open(iServer, networkModId));
+					CleanupClosePushL(iPositioner);
+					
+					RPositionServer server2;
+					RPositioner positioner2;
+					
+					// Connect to self locate servers.
+					User::LeaveIfError(server2.Connect());
+					CleanupClosePushL(server2);
+					
+					TPositionModuleId aGpsModId = utils.GetAGpsModuleIdL(server2);			
+					
+					User::LeaveIfError(positioner2.Open(server2, aGpsModId));
+					CleanupClosePushL(positioner2);
+					
+					
+					TPositionUpdateOptions optsA; 
+					TPositionUpdateOptions optsB;
+					
+					optsA.SetMaxUpdateAge(10000000);
+					optsA.SetUpdateInterval(5000000);
+					
+					optsB.SetMaxUpdateAge(0);
+					optsB.SetUpdateInterval(2000000);
+					
+					TPositionInfo posInfo;
+					TPositionInfo posInfob;
+	
+	
+					// Get the actual position
+					err = DoNotifyUpdateL(posInfo);
+					if (KErrNone != err)
+						{
+						SetTestStepResult(EFail);
+						}
+						
+					err = DoNotifyUpdateL(posInfob);
+					if (KErrNone != err)
+						{
+						SetTestStepResult(EFail);
+						}
+
+					CleanupStack::PopAndDestroy(&positioner2);
+					CleanupStack::PopAndDestroy(&server2);
+					CleanupStack::PopAndDestroy(&iPositioner);
+
+					break;
+					}
+					
+					
+				
+				
+				// Test case LBS-UpdateOptions-015
+				case 15:
+					{
+					T_LbsUtils utils;
+					TPositionModuleId networkModId = utils.GetNetworkModuleIdL(iServer);
+									
+					// Open positioners.
+					User::LeaveIfError(iPositioner.Open(iServer, networkModId));
+					CleanupClosePushL(iPositioner);
+					
+					RPositionServer server2;
+					RPositioner positioner2;
+					
+					// Connect to self locate servers.
+					User::LeaveIfError(server2.Connect());
+					CleanupClosePushL(server2);
+					
+					User::LeaveIfError(positioner2.Open(server2, networkModId));
+					CleanupClosePushL(positioner2);
+					
+					
+					TPositionUpdateOptions optsA; 
+					TPositionUpdateOptions optsB;
+					
+					optsA.SetMaxUpdateAge(10000000);
+					optsA.SetUpdateInterval(5000000);
+					
+					optsB.SetMaxUpdateAge(0);
+					optsB.SetUpdateInterval(2000000);
+					
+					TPositionInfo posInfo;
+					TPositionInfo posInfob;
+	
+	
+					// Get the actual position
+					err = DoNotifyUpdateL(posInfo);
+					if (KErrNone != err)
+						{
+						SetTestStepResult(EFail);
+						}
+						
+					// Loop? Keep calling until full info recieved.
+					err = DoNotifyUpdateL(posInfob);
+					if (KErrNone != err)
+						{
+						SetTestStepResult(EFail);
+						}
+
+					CleanupStack::PopAndDestroy(&positioner2);
+					CleanupStack::PopAndDestroy(&server2);
+					CleanupStack::PopAndDestroy(&iPositioner);
+
+					break;
+					}
+					
+					
+					
+					
+					
+				// Test case LBS-UpdateOptions-016
+				case 16:
+					{
+					T_LbsUtils utils;
+					TPositionModuleId networkModId = utils.GetNetworkModuleIdL(iServer);
+									
+					// Open positioners.
+					User::LeaveIfError(iPositioner.Open(iServer, networkModId));
+					CleanupClosePushL(iPositioner);
+					
+					RPositionServer server2;
+					RPositioner positioner2;
+					
+					//Connect to self locate server
+					TPositionModuleId aGpsModId = utils.GetAGpsModuleIdL(server2);	
+					
+					User::LeaveIfError(positioner2.Open(iServer, aGpsModId));
+					CleanupClosePushL(positioner2);
+					
+					TPositionUpdateOptions optsA; 
+					TPositionUpdateOptions optsB;
+					
+					optsA.SetMaxUpdateAge(10000000);
+					optsA.SetUpdateInterval(5000000);
+					
+					optsB.SetMaxUpdateAge(0);
+					optsB.SetUpdateInterval(2000000);
+					
+					TPositionInfo posInfo;
+					TPositionInfo posInfob;
+	
+					// Get the actual position
+					err = DoNotifyUpdateL(posInfo);
+					if (KErrNone != err)
+						{
+						SetTestStepResult(EFail);
+						}
+						
+					// Loop? Keep calling until full info recieved.
+					err = DoNotifyUpdateL(posInfob);
+					if (KErrNone != err)
+						{
+						SetTestStepResult(EFail);
+						}
+
+					CleanupStack::PopAndDestroy(&positioner2);
+					CleanupStack::PopAndDestroy(&server2);
+					CleanupStack::PopAndDestroy(&iPositioner);
+
+					break;
+					}
+					
+					
+					
+				// Test case LBS-UpdateOptions-017
+				case 17:
+					{
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+					
+					
+					TPositionUpdateOptions optsA;
+					optsA.SetUpdateInterval(1000000);
+					optsA.SetMaxUpdateAge(5000000);
+					
+					if((optsA.MaxUpdateAge() != 5000000) || (optsA.UpdateInterval() != 1000000))
+						{
+						SetTestStepResult(EFail);
+						}
+						
+					iPositioner.SetUpdateOptions(optsA);
+					// Test AGPS manager must already be configured to return partial location info
+		
+					TPositionInfo posInfo;
+	
+					// This call to NPU puts a location in cache
+					err = DoNotifyUpdateL(posInfo);
+					if (KErrNone != err)
+						{
+						SetTestStepResult(EFail);
+						}
+						
+					/*
+						MaxUpdateAge () returns the current age limit for 
+						information returned by NotifyPositionUpdate(). 
+						Zero is returned when there is no acceptable age limit.
+					*/
+					
+					if(optsA.MaxUpdateAge() != 0)
+						{
+						SetTestStepResult(EFail);
+						}
+
+					CleanupStack::PopAndDestroy(&iPositioner);
+
+					break;
+					}
+					
+				// Test case LBS-UpdateOptions-018
+				case 18:
+					{
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+										
+					TPositionUpdateOptions optsA;
+					optsA.SetMaxUpdateAge(-1);
+					
+					CleanupStack::PopAndDestroy(&iPositioner);
+
+					break;
+					}
+					
+					
+				// Test case LBS-UpdateOptions-019
+				case 19:
+					{
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+					
+					//MaxUpdateAge comparision replacede by verify data step
+					TPositionUpdateOptions& updateOpts = iParent.iSharedData->iVerifyUpdateOpts;
+					
+					TPositionInfo posInfoA, posInfoB;
+					
+					//Get fresh location and have it in cache
+					err = DoNotifyUpdateL(posInfoA);
+					if (KErrNone != err)
+						{
+						SetTestStepResult(EFail);
+						}
+					
+					//Second call to NPU should have maxupdateage set.
+					iPositioner.SetUpdateOptions(updateOpts);
+					
+					err = DoNotifyUpdateL(posInfoB);
+					if (KErrNone != err)
+						{
+						SetTestStepResult(EFail);
+						}
+					
+					T_LbsUtils utils;
+						
+					if(!utils.Compare_PosInfo(posInfoA, posInfoB))
+							{
+							//Cached copy doesnt match retrieved copy.
+							SetTestStepResult(EFail);
+							}
+						
+					CleanupStack::PopAndDestroy(&iPositioner);
+					
+					break;
+					}
+
+				// Test case LBS-UpdateOptions-020
+				case 20:
+					{
+					// Open positioner.
+					User::LeaveIfError(iPositioner.Open(iServer));
+					CleanupClosePushL(iPositioner);
+ 					
+					TPositionInfo cachedInfo, firstposInfo, secondposInfo;
+ 
+  					TPositionUpdateOptions& updateOpts = iParent.iSharedData->iVerifyUpdateOpts;
+					updateOpts.SetUpdateInterval(0);
+					updateOpts.SetMaxUpdateAge(0);
+					//Second call to NPU should have maxupdateage set.
+					iPositioner.SetUpdateOptions(updateOpts);
+   					
+					// Get fresh location and have it in cache
+					err = DoNotifyUpdateL(cachedInfo);
+					if (KErrNone != err)
+						{
+						SetTestStepResult(EFail);
+						}
+					
+					// Change the max fix time
+					updateOpts.SetMaxUpdateAge(5000000);
+					iPositioner.SetUpdateOptions(updateOpts);
+			
+					// Wait 4 seconds
+					User::After(4000000);
+				
+					// Get a position should be the same as in the cache
+					err = DoNotifyUpdateL(firstposInfo);
+					if (KErrNone != err)
+						{
+						SetTestStepResult(EFail);
+						}
+						
+					// Wait 2 seconds
+					User::After(2000000);
+					// Get a position should not be the same as the cache
+					err = DoNotifyUpdateL(secondposInfo);
+					if (KErrNone != err)
+						{
+						SetTestStepResult(EFail);
+						}
+				
+					T_LbsUtils utils;
+			
+					TBool a = utils.Compare_PosInfo(cachedInfo, firstposInfo);
+					TBool b = utils.Compare_PosInfo(firstposInfo, secondposInfo);
+						
+					if(!a || b)
+						{
+						//Cached copy doesnt match retrieved copy.
+						SetTestStepResult(EFail);
+						}
+						
+					CleanupStack::PopAndDestroy(&iPositioner);
+
+					break;
+					}
+					
+					
+					// Test case LBS-UpdateOptions-101 (for DEF118183)
+					case 101:
+						{
+						// Open positioner.
+						User::LeaveIfError(iPositioner.Open(iServer));
+						CleanupClosePushL(iPositioner);					
+						
+						TPositionInfo posInfoa;
+						TPositionInfo posInfob;
+						TPositionInfo posInfoc;
+		
+						// This call to NPU puts a location in cache
+						err = DoNotifyUpdateL(posInfoa);
+						if (KErrNone != err)
+							{
+							INFO_PRINTF2(_L("Failed: During first call to NPU err is %d"), err);
+							SetTestStepResult(EFail);
+							}
+
+						TPositionUpdateOptions posOpts;
+						posOpts.SetMaxUpdateAge(1*1000000);
+						posOpts.SetUpdateInterval(5*1000000);
+						
+						if((posOpts.MaxUpdateAge() != 1000000) || (posOpts.UpdateInterval() != 5000000))
+							{
+							INFO_PRINTF1(_L("Failed: During check of options values"));
+							SetTestStepResult(EFail);
+							}
+							
+						iPositioner.SetUpdateOptions(posOpts);
+												
+						//Retrieve cached location with second call to NPU
+						err = DoNotifyUpdateL(posInfob);
+						if (KErrNone != err)
+							{
+							INFO_PRINTF2(_L("Failed: During NPU 2 value is %d"), err);
+							SetTestStepResult(EFail);
+							}
+						
+						//INTERNAL COMPARISON
+						//Make sure we've retrieved the cached location						
+						T_LbsUtils utils;
+						if(!utils.Compare_PosInfo(posInfoa, posInfob))
+							{
+							INFO_PRINTF1(_L("Failed: During comparison of pos info values"));
+							SetTestStepResult(EFail);
+							}
+						
+						// Make 3rd call to NPU - this one to be cancelled
+						TRequestStatus status;
+						iPositioner.NotifyPositionUpdate(posInfoc, status);	
+
+						// Wait 2 seconds and then cancel
+						User::After(2000000);
+						err = iPositioner.CancelRequest(EPositionerNotifyPositionUpdate);
+						if (KErrNone != err)
+							{
+							// Pre-DefectFix code would return -1 at this point since there would have been no request to cancel
+							INFO_PRINTF2(_L("Failed: Cancel request was rejected with error %d"), err);
+							SetTestStepResult(EFail);						
+							}
+						
+						User::WaitForRequest(status);
+						if (KErrCancel != status.Int())
+							{
+							// Pre-DefectFix code would return 0 at this point to indicate a successfully returned position
+							INFO_PRINTF2(_L("Failed: Expected NPU to complete with KErrCancel but actual value is %d"), status.Int());
+							SetTestStepResult(EFail);
+							}
+
+						CleanupStack::PopAndDestroy(&iPositioner);
+						
+						break;
+						}
+						
+						
+					
+				default:
+					User::Panic(KLbsClientStepUpdateOptions, KErrUnknown);					
+						
+					}
+				
+				}
+		
+			
+		// All done, clean up.
+		CleanupStack::PopAndDestroy(&iServer);		
+		}
+
+	INFO_PRINTF1(_L("&lt;&lt;CT_LbsClientStep_UpdateOptions::doTestStepL()"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbsclient/testdata/smoketest_lbs.ini	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,45 @@
+[LBS-Mod-Cnt-0001]
+tc_id=1
+num_of_mods=2
+
+[LBS-Mod-Cnt-0002]
+tc_id=2
+
+[LBS-Mod-Cnt-0003]
+tc_id=3
+num_of_mods=3
+
+[LBS-Mod-Cnt-0004]
+tc_id=4
+num_of_mods=3
+
+[LBS-Mod-Info-0001]
+tc_id=11
+module_id=271064388
+
+
+[LBS-Mod-Info-0002]
+tc_id=12
+
+[LBS-Mod-Info-0003]
+tc_id=13
+
+[LBS-Mod-Info-0004]
+tc_id=14
+
+[LBS-Mod-Info-0005]
+tc_id=15
+module_id=271064388
+
+[LBS-Mod-Info-0006]
+tc_id=16
+
+[LBS-Mod-Info-0007]
+tc_id=17
+
+[LBS-Mod-Info-0008]
+tc_id=18
+default_mod_id=271064388
+
+[LBS-Mod-Info-0009]
+tc_id=19
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestchannel/BWINS/LbsTestChannelU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,26 @@
+EXPORTS
+	??0RT_LbsChannel@@QAE@XZ @ 1 NONAME ; RT_LbsChannel::RT_LbsChannel(void)
+	??0TT_LbsAGpsRequestError@@QAE@H@Z @ 2 NONAME ; TT_LbsAGpsRequestError::TT_LbsAGpsRequestError(int)
+	??0TT_LbsAGpsRequestOptions@@QAE@W4TLbsHybridModuleOptions@@@Z @ 3 NONAME ; TT_LbsAGpsRequestOptions::TT_LbsAGpsRequestOptions(enum TLbsHybridModuleOptions)
+	??0TT_LbsAGpsRequestOptions@@QAE@W4TLbsHybridModuleOptions@@H@Z @ 4 NONAME ; TT_LbsAGpsRequestOptions::TT_LbsAGpsRequestOptions(enum TLbsHybridModuleOptions, int)
+	??0TT_LbsAGpsRequestTimeOut@@QAE@ABVTTimeIntervalMicroSeconds@@@Z @ 5 NONAME ; TT_LbsAGpsRequestTimeOut::TT_LbsAGpsRequestTimeOut(class TTimeIntervalMicroSeconds const &)
+	??0TT_LbsAGpsRequestUpdateInitMsg@@QAE@ABVTDesC16@@0@Z @ 6 NONAME ; TT_LbsAGpsRequestUpdateInitMsg::TT_LbsAGpsRequestUpdateInitMsg(class TDesC16 const &, class TDesC16 const &)
+	??0TT_LbsAGpsResponseMsg@@QAE@ABW4TModuleResponseType@0@@Z @ 7 NONAME ; TT_LbsAGpsResponseMsg::TT_LbsAGpsResponseMsg(enum TT_LbsAGpsResponseMsg::TModuleResponseType const &)
+	??0TT_LbsMsgBase@@IAE@W4TLbsMsgType@0@@Z @ 8 NONAME ; TT_LbsMsgBase::TT_LbsMsgBase(enum TT_LbsMsgBase::TLbsMsgType)
+	??0TT_LbsMsgBase@@QAE@XZ @ 9 NONAME ; TT_LbsMsgBase::TT_LbsMsgBase(void)
+	?CancelSendMessageNotification@RT_LbsChannel@@QAEXXZ @ 10 NONAME ; void RT_LbsChannel::CancelSendMessageNotification(void)
+	?Close@RT_LbsChannel@@QAEXXZ @ 11 NONAME ; void RT_LbsChannel::Close(void)
+	?ConfigFileName@TT_LbsAGpsRequestUpdateInitMsg@@QBEABVTDesC16@@XZ @ 12 NONAME ; class TDesC16 const & TT_LbsAGpsRequestUpdateInitMsg::ConfigFileName(void) const
+	?ConfigSection@TT_LbsAGpsRequestUpdateInitMsg@@QBEABVTDesC16@@XZ @ 13 NONAME ; class TDesC16 const & TT_LbsAGpsRequestUpdateInitMsg::ConfigSection(void) const
+	?Error@TT_LbsAGpsRequestError@@QBEHXZ @ 14 NONAME ; int TT_LbsAGpsRequestError::Error(void) const
+	?InitializeL@RT_LbsChannel@@SAXW4TT_LbsChannelId@1@@Z @ 15 NONAME ; void RT_LbsChannel::InitializeL(enum RT_LbsChannel::TT_LbsChannelId)
+	?ModuleOption@TT_LbsAGpsRequestOptions@@QBE?AW4TLbsHybridModuleOptions@@XZ @ 16 NONAME ; enum TLbsHybridModuleOptions TT_LbsAGpsRequestOptions::ModuleOption(void) const
+	?ModuleValue@TT_LbsAGpsRequestOptions@@QBEHXZ @ 17 NONAME ; int TT_LbsAGpsRequestOptions::ModuleValue(void) const
+	?OpenL@RT_LbsChannel@@QAEXW4TT_LbsChannelId@1@AAVMT_LbsChannelObserver@@@Z @ 18 NONAME ; void RT_LbsChannel::OpenL(enum RT_LbsChannel::TT_LbsChannelId, class MT_LbsChannelObserver &)
+	?ResponseType@TT_LbsAGpsResponseMsg@@QBE?AW4TModuleResponseType@1@XZ @ 19 NONAME ; enum TT_LbsAGpsResponseMsg::TModuleResponseType TT_LbsAGpsResponseMsg::ResponseType(void) const
+	?SendMessage@RT_LbsChannel@@QAEXABVTT_LbsMsgBase@@AAVTRequestStatus@@@Z @ 20 NONAME ; void RT_LbsChannel::SendMessage(class TT_LbsMsgBase const &, class TRequestStatus &)
+	?ShutDownL@RT_LbsChannel@@SAXW4TT_LbsChannelId@1@@Z @ 21 NONAME ; void RT_LbsChannel::ShutDownL(enum RT_LbsChannel::TT_LbsChannelId)
+	?TimeOut@TT_LbsAGpsRequestTimeOut@@QBEABVTTimeIntervalMicroSeconds@@XZ @ 22 NONAME ; class TTimeIntervalMicroSeconds const & TT_LbsAGpsRequestTimeOut::TimeOut(void) const
+	?Type@TT_LbsMsgBase@@QBE?AW4TLbsMsgType@1@XZ @ 23 NONAME ; enum TT_LbsMsgBase::TLbsMsgType TT_LbsMsgBase::Type(void) const
+	??0TT_LbsAGpsRequestForcedUpdate@@QAE@XZ @ 24 NONAME ; TT_LbsAGpsRequestForcedUpdate::TT_LbsAGpsRequestForcedUpdate(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestchannel/EABI/LbsTestChannelu.def	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,36 @@
+EXPORTS
+	_ZN13RT_LbsChannel11InitializeLENS_15TT_LbsChannelIdE @ 1 NONAME
+	_ZN13RT_LbsChannel11SendMessageERK13TT_LbsMsgBaseR14TRequestStatus @ 2 NONAME
+	_ZN13RT_LbsChannel29CancelSendMessageNotificationEv @ 3 NONAME
+	_ZN13RT_LbsChannel5CloseEv @ 4 NONAME
+	_ZN13RT_LbsChannel5OpenLENS_15TT_LbsChannelIdER21MT_LbsChannelObserver @ 5 NONAME
+	_ZN13RT_LbsChannel9ShutDownLENS_15TT_LbsChannelIdE @ 6 NONAME
+	_ZN13RT_LbsChannelC1Ev @ 7 NONAME
+	_ZN13RT_LbsChannelC2Ev @ 8 NONAME
+	_ZN13TT_LbsMsgBaseC1ENS_11TLbsMsgTypeE @ 9 NONAME
+	_ZN13TT_LbsMsgBaseC1Ev @ 10 NONAME
+	_ZN13TT_LbsMsgBaseC2ENS_11TLbsMsgTypeE @ 11 NONAME
+	_ZN13TT_LbsMsgBaseC2Ev @ 12 NONAME
+	_ZN21TT_LbsAGpsResponseMsgC1ERKNS_19TModuleResponseTypeE @ 13 NONAME
+	_ZN21TT_LbsAGpsResponseMsgC2ERKNS_19TModuleResponseTypeE @ 14 NONAME
+	_ZN22TT_LbsAGpsRequestErrorC1Ei @ 15 NONAME
+	_ZN22TT_LbsAGpsRequestErrorC2Ei @ 16 NONAME
+	_ZN24TT_LbsAGpsRequestOptionsC1E23TLbsHybridModuleOptions @ 17 NONAME
+	_ZN24TT_LbsAGpsRequestOptionsC1E23TLbsHybridModuleOptionsi @ 18 NONAME
+	_ZN24TT_LbsAGpsRequestOptionsC2E23TLbsHybridModuleOptions @ 19 NONAME
+	_ZN24TT_LbsAGpsRequestOptionsC2E23TLbsHybridModuleOptionsi @ 20 NONAME
+	_ZN24TT_LbsAGpsRequestTimeOutC1ERK25TTimeIntervalMicroSeconds @ 21 NONAME
+	_ZN24TT_LbsAGpsRequestTimeOutC2ERK25TTimeIntervalMicroSeconds @ 22 NONAME
+	_ZN30TT_LbsAGpsRequestUpdateInitMsgC1ERK7TDesC16S2_ @ 23 NONAME
+	_ZN30TT_LbsAGpsRequestUpdateInitMsgC2ERK7TDesC16S2_ @ 24 NONAME
+	_ZNK13TT_LbsMsgBase4TypeEv @ 25 NONAME
+	_ZNK21TT_LbsAGpsResponseMsg12ResponseTypeEv @ 26 NONAME
+	_ZNK22TT_LbsAGpsRequestError5ErrorEv @ 27 NONAME
+	_ZNK24TT_LbsAGpsRequestOptions11ModuleValueEv @ 28 NONAME
+	_ZNK24TT_LbsAGpsRequestOptions12ModuleOptionEv @ 29 NONAME
+	_ZNK24TT_LbsAGpsRequestTimeOut7TimeOutEv @ 30 NONAME
+	_ZNK30TT_LbsAGpsRequestUpdateInitMsg13ConfigSectionEv @ 31 NONAME
+	_ZNK30TT_LbsAGpsRequestUpdateInitMsg14ConfigFileNameEv @ 32 NONAME
+	_ZN29TT_LbsAGpsRequestForcedUpdateC1Ev @ 33 NONAME
+	_ZN29TT_LbsAGpsRequestForcedUpdateC2Ev @ 34 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestchannel/group/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,21 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRJ_TESTMMPFILES
+lbstestchannel.mmp
+
+PRJ_TESTEXPORTS
+../inc/tlbschannel.h		/epoc32/include/lbs/test/tlbschannel.h	
+../inc/tlbschannelutils.h	/epoc32/include/lbs/test/tlbschannelutils.h	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestchannel/group/lbstestchannel.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,39 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file lbstestchannel.mmp
+// 
+//
+
+TARGET			lbstestchannel.dll
+TARGETTYPE		DLL
+
+//CAPABILITY	ProtServ LocalServices WriteDeviceData ReadDeviceData Location
+CAPABILITY ALL -TCB
+
+UID			0x1000007A 0x10282291
+
+
+SYSTEMINCLUDE	/epoc32/include
+SYSTEMINCLUDE	/epoc32/include/lbs
+SYSTEMINCLUDE	/epoc32/include/lbs/test
+
+USERINCLUDE		../inc
+
+SOURCEPATH		../src
+
+SOURCE			tlbschannel.cpp
+SOURCE			tlbschannelutils.cpp
+
+// EPOC libraries.
+LIBRARY	euser.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestchannel/inc/tlbschannel.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,112 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file TLbschannel.h
+// This is the header file which contains the channel utilities for communication between
+// the test harness and the test AGps module.
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#ifndef TLbsCHANNEL_H
+#define TLbsCHANNEL_H
+
+// User includes
+#include "tlbschannelutils.h"
+
+// Epoc includes
+#include <e32property.h>
+
+
+class MT_LbsChannelObserver;
+class CT_ChannelMonitor;
+
+
+/** Logical channel used for communication between Test Harness and
+the test A-GPS module. 
+
+Messages are:
+- sent by calling SendMessage.
+- received via the Mixin callback MT_LbsChannelObserver::ProcessChannelMessage.
+*/
+NONSHARABLE_CLASS(RT_LbsChannel)
+	{
+public:
+	enum TT_LbsChannelId
+		{
+		EChannelUnknown			= -1,
+		EChannelTH2TAGPS 		= 0,
+		EChannelTAGPS2TH		= 1
+		};
+
+	IMPORT_C static void InitializeL(TT_LbsChannelId aChannelId);
+	IMPORT_C static void ShutDownL(TT_LbsChannelId aChannelId);
+	
+	IMPORT_C RT_LbsChannel();
+	IMPORT_C void OpenL(TT_LbsChannelId aChannelId, MT_LbsChannelObserver& aObserver);
+	IMPORT_C void Close();
+
+	IMPORT_C void SendMessage(const TT_LbsMsgBase& aMessage, TRequestStatus& aStatus);
+	IMPORT_C void CancelSendMessageNotification();
+
+private:
+	RProperty iSendProperty;
+	RProperty iSendMsgReadProperty;
+	CT_ChannelMonitor* iMonitor;
+	};
+
+/** Observer for incoming messages from a channel
+*/
+class MT_LbsChannelObserver
+	{
+public:	
+	/** Called when a message arrives from a channel.
+	@param aChannelId The channel being monitored. 
+	@param aMessage The message received. */
+	virtual void ProcessChannelMessage(RT_LbsChannel::TT_LbsChannelId aChannelId, const TT_LbsMsgBase& aMessage) = 0;
+	};
+
+/**
+Monitors for incoming messages from a channel.
+*/
+NONSHARABLE_CLASS(CT_ChannelMonitor) : public CActive
+	{
+public:
+	static CT_ChannelMonitor* NewL(MT_LbsChannelObserver& aObserver, RT_LbsChannel::TT_LbsChannelId aChannelId, TUid aPropId, TUint aPropKey, TUint aAckPropKey);
+	~CT_ChannelMonitor();
+		
+	void RunL();
+	void DoCancel();
+	TInt RunError(TInt aError);
+	
+private:
+	void NotifyChannelMessage();
+	CT_ChannelMonitor(MT_LbsChannelObserver& aObserver, RT_LbsChannel::TT_LbsChannelId aChannelId);
+	void ConstructL(TUid aPropId, TUint aPropKey, TUint aAckPropKey);
+
+private:
+	MT_LbsChannelObserver&			 iObserver;
+	RT_LbsChannel::TT_LbsChannelId iChannelId;
+	
+	RProperty iReceiveProperty;
+	RProperty iReceiveMsgReadProperty;
+	};
+
+#endif // TLbsCHANNEL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestchannel/inc/tlbschannelutils.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,237 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file tlbschannelutils.h
+// This is the header file which contains the msg data types and other utilities
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#ifndef TLBSCHANNELUTILS_H
+#define TLBSCHANNELUTILS_H
+
+#include <lbs/test/tlbsutils.h>
+
+
+/* Key value used to publish messages from Test Harness to Test AGPS Module 
+   and the corresponding acknowledgement */
+const TUint KTH2TAGPSMessageKey = 0x0F001010;
+const TUint KTH2TAGPSMessageReadAckKey = 0x0F001020;
+/* Key value used to publish messages from Test AGPS Module to Test Harness  
+   and the corresponding acknowledgement */
+const TUint KTAGPS2THMessageKey = 0x0F001030;
+const TUint KTAGPS2THMessageReadAckKey = 0x0F001040;
+
+
+
+/** Base class for messages sent between the Test Harness and Test A-Gps Module.
+
+This class defines the types of messages and reserves a buffer to store
+information, but it can't be used itself. Instead derived classes will
+implement each of the types of messages and supply accessor functions.
+
+*/
+class TT_LbsMsgBase
+	{
+public:
+	/** List of all possible message types.
+	
+	Each type of message listed here must be implemented as a
+	separate class that inherits from TLbsNetInternalMsgBase.
+	*/
+	enum TLbsMsgType
+		{
+		EUnknown = 0,
+		EModuleRequestUpdateInit,	// TH --> AGPS-Module
+		EModuleRequestTimeOut,		// TH --> AGPS-Module
+		EModuleRequestOptions,		// TH --> AGPS-Module
+		EModuleRequestError,		// TH --> AGPS-Module
+		EModuleRequestForcedUpdate,	// TH --> AGPS-Module
+		EModuleResponse				// AGPS-Module --> TH
+		};
+
+public:
+	IMPORT_C TT_LbsMsgBase();
+	
+	IMPORT_C TLbsMsgType Type() const;
+
+protected:
+	// Derived classes set their type by using these constructors.
+	IMPORT_C TT_LbsMsgBase(TLbsMsgType aType);	
+
+private:
+	TLbsMsgType iType;
+	
+protected:	
+	// A TUint64 is used to ensure that any objects that use the buffer 
+	// are at least 8byte aligned. (The compiler will organise the arrangement
+	// of iBuffer within TLbsNetInternalMsgBase to be aligned to the minimum
+	// for a TUint64, which is 8bytes.)
+	TUint64 iBuffer[((1576 - (sizeof(TLbsMsgType))) >> 3)];
+	};
+	
+/** 
+Test A-Gps Module Request UpdateInit Message
+*/
+NONSHARABLE_CLASS(TT_LbsAGpsRequestUpdateInitMsg) : public TT_LbsMsgBase
+	{
+public:
+	IMPORT_C TT_LbsAGpsRequestUpdateInitMsg(const TDesC& aConfigFileName, const TDesC& aConfigSection);
+	
+	IMPORT_C const TDesC& ConfigFileName() const;
+	IMPORT_C const TDesC& ConfigSection() const;
+
+private:
+	TT_LbsAGpsRequestUpdateInitMsg();
+
+private:
+	struct ST_LbsAGpsRequestUpdateInit
+		{
+		TBuf<KMaxModuleDataBusIniFileName>	iConfigFileName; 	/** Config request data. */
+		TBuf<40>							iConfigSection;  	/** Config request data. */
+		};
+
+	inline ST_LbsAGpsRequestUpdateInit& Data();
+	inline const ST_LbsAGpsRequestUpdateInit& Data() const;
+	};
+
+/** 
+Test A-Gps Module Request TimeOut Message
+*/
+NONSHARABLE_CLASS(TT_LbsAGpsRequestTimeOut) : public TT_LbsMsgBase
+	{
+public:
+	IMPORT_C TT_LbsAGpsRequestTimeOut(const TTimeIntervalMicroSeconds& aTimeOut);
+	IMPORT_C const TTimeIntervalMicroSeconds& TimeOut() const;
+
+private:
+	TT_LbsAGpsRequestTimeOut();
+
+private:
+	struct ST_LbsAGpsRequestTimeOut
+		{
+		TTimeIntervalMicroSeconds 	iTimeOut;	/** Module time out. */
+		};	
+	inline ST_LbsAGpsRequestTimeOut& Data();
+	inline const ST_LbsAGpsRequestTimeOut& Data() const;
+	};
+
+/** 
+Test A-Gps Module Request Options Message
+*/
+NONSHARABLE_CLASS(TT_LbsAGpsRequestOptions) : public TT_LbsMsgBase
+	{
+public:
+	IMPORT_C TT_LbsAGpsRequestOptions(TLbsHybridModuleOptions aModuleOption);
+	IMPORT_C TT_LbsAGpsRequestOptions(TLbsHybridModuleOptions aModuleOption, TBool aOptionValue);
+
+	IMPORT_C TLbsHybridModuleOptions ModuleOption() const;
+	IMPORT_C TBool ModuleValue() const;
+
+private:
+	TT_LbsAGpsRequestOptions();
+
+private:
+	struct ST_LbsAGpsRequestOptions
+		{
+		TLbsHybridModuleOptions 	iModuleOption; 	// Module option
+		TBool	 					iModuleValue; 	// Value for the module option
+		};	
+
+	inline ST_LbsAGpsRequestOptions& Data();
+	inline const ST_LbsAGpsRequestOptions& Data() const;
+	};
+
+/** 
+Test A-Gps Module Request Error Message
+*/
+NONSHARABLE_CLASS(TT_LbsAGpsRequestError) : public TT_LbsMsgBase
+	{
+public:
+	IMPORT_C TT_LbsAGpsRequestError(TInt aOptions);
+	IMPORT_C TInt Error() const;
+
+private:
+	TT_LbsAGpsRequestError();
+
+private:
+	struct ST_LbsAGpsRequestError
+		{
+		TInt iError;				/** Module Error Code */
+		};	
+
+	inline ST_LbsAGpsRequestError& Data();
+	inline const ST_LbsAGpsRequestError& Data() const;
+	};
+
+/** 
+Test A-Gps Module Request Forced Update Message
+
+This message forces the test A-Gps module to send
+the next position update from the update array
+now, even if there is no outstanding request from LBS.
+*/
+NONSHARABLE_CLASS(TT_LbsAGpsRequestForcedUpdate) : public TT_LbsMsgBase
+	{
+public:
+	IMPORT_C TT_LbsAGpsRequestForcedUpdate();
+
+private:
+	struct ST_LbsAGpsRequestForcedUpdate
+		{
+		TInt iDummy;				/** Dummy value; unused */
+		};	
+
+	inline ST_LbsAGpsRequestForcedUpdate& Data();
+	inline const ST_LbsAGpsRequestForcedUpdate& Data() const;
+	};
+	
+/** 
+Test A-Gps Module Response Message
+*/
+NONSHARABLE_CLASS(TT_LbsAGpsResponseMsg) : public TT_LbsMsgBase
+	{
+public:
+
+    enum TModuleResponseType
+		{
+		EModuleResponseOk,
+		EModuleErr
+		};
+		
+	IMPORT_C TT_LbsAGpsResponseMsg(const TModuleResponseType& 	aResponse);
+
+	IMPORT_C TModuleResponseType ResponseType() const;
+
+private:
+	TT_LbsAGpsResponseMsg();
+
+private:
+
+	struct ST_LbsAGpsResponse
+		{
+		TModuleResponseType iResponseType;
+		};
+	
+	inline ST_LbsAGpsResponse& Data();
+	inline const ST_LbsAGpsResponse& Data() const;
+	};	
+	
+#endif // TLBSCHANNELUTILS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestchannel/src/tlbschannel.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,247 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file T_Lbschannel.cpp
+// This is the Cpp file which contains the channel for communication between
+// the test harness and the test AGps module.
+// 
+//
+
+// User includes
+#include "tlbschannel.h"
+
+const TInt KLbsChannelIdMax = RT_LbsChannel::EChannelTAGPS2TH;
+//const TInt KCategoryKeyIndex	 = 0;
+const TInt KReadPropKeyIndex 	 = 1;
+const TInt KReadPropAckKeyIndex  = 2;
+const TInt KWritePropKeyIndex 	 = 3;
+const TInt KWritePropAckKeyIndex = 4;
+
+/** The array contains description (property size, keys and Ids) of all the channels supported by 
+    the RT_LbsChannel interface */
+const TUint KPropTable[KLbsChannelIdMax+1][5]=
+	{
+	{0, KTH2TAGPSMessageKey, KTH2TAGPSMessageReadAckKey, KTAGPS2THMessageKey, KTAGPS2THMessageReadAckKey}, 
+	{0, KTAGPS2THMessageKey, KTAGPS2THMessageReadAckKey, KTH2TAGPSMessageKey, KTH2TAGPSMessageReadAckKey}, 
+	};
+
+///////////////////////////////////////////////////////////////////////////////
+// RT_LbsChannel
+///////////////////////////////////////////////////////////////////////////////
+
+EXPORT_C void RT_LbsChannel::InitializeL(TT_LbsChannelId aChannelId)
+	{
+	const TSecurityPolicy KReadPolicy(ECapability_None);
+	const TSecurityPolicy KWritePolicy(ECapabilityWriteDeviceData);
+	
+	TInt err = RProperty::Define(KUidSystemCategory,
+								 KPropTable[aChannelId][KWritePropKeyIndex],
+								 RProperty::ELargeByteArray, 
+								 KReadPolicy, KWritePolicy, 
+								 sizeof(TT_LbsMsgBase));
+	if (err != KErrNone && err != KErrAlreadyExists)
+		{
+		User::Leave(err);
+		}
+						 
+	err = RProperty::Define(KUidSystemCategory,
+							KPropTable[aChannelId][KWritePropAckKeyIndex],
+							RProperty::EInt,
+							KReadPolicy, KWritePolicy);
+	if (err != KErrNone && err != KErrAlreadyExists)
+		{
+		User::Leave(err);
+		}
+										 
+	User::LeaveIfError(RProperty::Set(KUidSystemCategory, KPropTable[aChannelId][KWritePropAckKeyIndex], 0));
+	}
+
+
+EXPORT_C void RT_LbsChannel::ShutDownL(TT_LbsChannelId aChannelId)
+	{
+	User::LeaveIfError(RProperty::Delete(KPropTable[aChannelId][KWritePropKeyIndex]));
+	User::LeaveIfError(RProperty::Delete(KPropTable[aChannelId][KWritePropAckKeyIndex]));
+	}
+
+
+EXPORT_C RT_LbsChannel::RT_LbsChannel()
+	{
+	}
+	
+
+/** 
+
+The channel must first be initialised before this is called, otherwise the
+resources needed by the channel will not have been allocated.
+
+@param aObserver Reference to the observer class used to notify of new messages. 
+@param aChannelId Uid of the RProperty category used for this channel.
+
+@leave
+*/
+EXPORT_C void RT_LbsChannel::OpenL(TT_LbsChannelId aChannelId, MT_LbsChannelObserver& aObserver)
+	{	
+	__ASSERT_DEBUG(iSendProperty.Handle()==NULL, User::Invariant());
+	__ASSERT_DEBUG(iSendMsgReadProperty.Handle()==NULL, User::Invariant());
+	
+	User::LeaveIfError(iSendProperty.Attach(KUidSystemCategory, KPropTable[aChannelId][KWritePropKeyIndex]));
+	User::LeaveIfError(iSendMsgReadProperty.Attach(KUidSystemCategory, KPropTable[aChannelId][KWritePropAckKeyIndex]));
+	
+	iMonitor = CT_ChannelMonitor::NewL(aObserver, aChannelId, KUidSystemCategory, 
+										KPropTable[aChannelId][KReadPropKeyIndex], 
+										KPropTable[aChannelId][KReadPropAckKeyIndex]);
+	}
+
+/** Close the connection.
+
+This function closes the connection and frees any resources 
+created in RTbsChannel::OpenL().
+*/	
+EXPORT_C void RT_LbsChannel::Close()
+	{
+	CancelSendMessageNotification();
+	
+	delete iMonitor;
+	iSendProperty.Close();
+	iSendMsgReadProperty.Close();
+	}
+
+/** Send a message through the channel.
+    
+This is an asynchronous function that only completes when the message 
+has been read. 
+
+If another call is made to this function before a previous one has 
+completed then aStatus will be completed straight away, with the 
+completion code KErrInUse.
+    
+@param aMessage The message to be sent.
+@param aStatus Request status that is completed when the message has
+			   been read. If there is an error sending the message
+			   it will be stored in aStatus.Int().
+*/
+EXPORT_C void RT_LbsChannel::SendMessage(const TT_LbsMsgBase& aMessage, 
+												 TRequestStatus& aStatus)
+	{
+	// Must check that the previous message was read
+	TInt sendAck;
+	iSendMsgReadProperty.Get(sendAck);
+	if (sendAck == 1)
+		{
+		// Pending message has not been read yet; flag an error
+		TRequestStatus* statPtr = &aStatus;
+		User::RequestComplete(statPtr, KErrInUse);
+		}
+	else
+		{
+		// Publish the new message
+		iSendMsgReadProperty.Set(1);
+		iSendMsgReadProperty.Subscribe(aStatus);
+		TPckgC<TT_LbsMsgBase> pckg(aMessage);
+		iSendProperty.Set(pckg);
+		}	
+	}
+			
+/** Cancel the current request status for SendMessage().
+*/
+EXPORT_C void RT_LbsChannel::CancelSendMessageNotification()
+	{
+	iSendMsgReadProperty.Cancel();
+	}	
+
+
+///////////////////////////////////////////////////////////////////////////////
+// CT_ChannelMonitor - used to listen for incoming messages 
+///////////////////////////////////////////////////////////////////////////////
+CT_ChannelMonitor* CT_ChannelMonitor::NewL(MT_LbsChannelObserver& aObserver, RT_LbsChannel::TT_LbsChannelId aChannelId, TUid aPropId, TUint aPropKey, TUint aAckPropKey)
+	{
+	CT_ChannelMonitor* self = new (ELeave) CT_ChannelMonitor(aObserver, aChannelId);
+	CleanupStack::PushL(self);
+	self->ConstructL(aPropId, aPropKey, aAckPropKey);
+	CleanupStack::Pop();
+	return self;
+	}
+
+CT_ChannelMonitor::CT_ChannelMonitor(MT_LbsChannelObserver& aObserver, RT_LbsChannel::TT_LbsChannelId aChannelId) :
+	CActive(EPriorityStandard),
+	iObserver(aObserver),
+	iChannelId(aChannelId)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+CT_ChannelMonitor::~CT_ChannelMonitor()
+	{
+	Cancel();
+	iReceiveProperty.Close();
+	iReceiveMsgReadProperty.Close();	
+	}
+
+void CT_ChannelMonitor::ConstructL(TUid aPropId, TUint aPropKey, TUint aAckPropKey)
+	{
+	__ASSERT_DEBUG(iReceiveProperty.Handle()==NULL, User::Invariant());		//Handle open.
+	__ASSERT_DEBUG(iReceiveMsgReadProperty.Handle()==NULL, User::Invariant());		//Handle open.
+	
+	User::LeaveIfError(iReceiveProperty.Attach(aPropId, aPropKey));
+	User::LeaveIfError(iReceiveMsgReadProperty.Attach(aPropId, aAckPropKey));
+	
+	NotifyChannelMessage();
+	// flag we are ready for receiving messages
+	iReceiveMsgReadProperty.Set(0);
+	}
+	
+void CT_ChannelMonitor::NotifyChannelMessage()
+	{
+	iReceiveProperty.Subscribe(iStatus);
+	SetActive();	
+	}
+
+void CT_ChannelMonitor::RunL()
+	{
+	TInt result = iStatus.Int();
+	switch (result)
+		{
+		case KErrNone:
+			{
+			// Read property
+			TT_LbsMsgBase msg;
+			TPckg<TT_LbsMsgBase> pckg(msg);
+			iReceiveProperty.Get(pckg);
+			
+			// resubscribe for further messages
+			NotifyChannelMessage();
+			
+			// Notify observer
+			iObserver.ProcessChannelMessage(iChannelId, msg);
+
+			// flag message as read
+			iReceiveMsgReadProperty.Set(0);
+			break;	
+			}
+		default:
+			{
+			User::Leave(result);
+			break;
+			}
+		}
+	}
+	
+void CT_ChannelMonitor::DoCancel()
+	{
+	iReceiveProperty.Cancel();
+	}
+	
+TInt CT_ChannelMonitor::RunError(TInt /*aError*/)
+	{
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestchannel/src/tlbschannelutils.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,257 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is the source file which contains the msg data types and other utilities
+// 
+//
+
+#include "tlbschannelutils.h"
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Base Test Message Class
+///////////////////////////////////////////////////////////////////////////////
+
+
+EXPORT_C TT_LbsMsgBase::TLbsMsgType TT_LbsMsgBase::Type() const
+	{
+	return iType;
+	}
+	
+EXPORT_C TT_LbsMsgBase::TT_LbsMsgBase() :
+	iType(EUnknown)
+	{
+	// Check that the internal buffer is 8-byte aligned.
+	__ASSERT_COMPILE((_FOFF(TT_LbsMsgBase, iBuffer) & 0x40) == 0x0);
+	}
+
+EXPORT_C TT_LbsMsgBase::TT_LbsMsgBase(TLbsMsgType aType):
+	iType(aType)
+	{
+	}
+	
+///////////////////////////////////////////////////////////////////////////////
+// Test A-Gps Module Request Update Initialization Message
+///////////////////////////////////////////////////////////////////////////////
+EXPORT_C TT_LbsAGpsRequestUpdateInitMsg::TT_LbsAGpsRequestUpdateInitMsg(const TDesC& aConfigFileName, const TDesC& aConfigSection)
+																		: TT_LbsMsgBase(EModuleRequestUpdateInit)
+	{
+	// Must make sure that the data to be stored is not bigger than the buffer.
+	__ASSERT_COMPILE(sizeof(ST_LbsAGpsRequestUpdateInit) <= sizeof(iBuffer));
+
+	// In-place construction of the data member
+	new(&Data()) ST_LbsAGpsRequestUpdateInit;
+		
+	ST_LbsAGpsRequestUpdateInit& data = Data();
+
+	data.iConfigFileName = aConfigFileName;	
+	data.iConfigSection = aConfigSection;	
+	}
+	
+EXPORT_C const TDesC& TT_LbsAGpsRequestUpdateInitMsg::ConfigFileName()  const
+	{
+	return Data().iConfigFileName;
+	}
+
+EXPORT_C const TDesC& TT_LbsAGpsRequestUpdateInitMsg::ConfigSection()  const
+	{
+	return Data().iConfigSection;
+	}
+
+inline TT_LbsAGpsRequestUpdateInitMsg::ST_LbsAGpsRequestUpdateInit& TT_LbsAGpsRequestUpdateInitMsg::Data()
+	{
+	return reinterpret_cast<ST_LbsAGpsRequestUpdateInit&>(iBuffer);
+	}
+	
+inline const TT_LbsAGpsRequestUpdateInitMsg::ST_LbsAGpsRequestUpdateInit& TT_LbsAGpsRequestUpdateInitMsg::Data() const
+	{
+	return reinterpret_cast<const ST_LbsAGpsRequestUpdateInit&>(iBuffer);
+	}
+	
+	
+///////////////////////////////////////////////////////////////////////////////
+// Test A-Gps Module Request TimeOut Message
+///////////////////////////////////////////////////////////////////////////////
+
+EXPORT_C TT_LbsAGpsRequestTimeOut::TT_LbsAGpsRequestTimeOut(const TTimeIntervalMicroSeconds& aTimeOut)
+															: TT_LbsMsgBase(EModuleRequestTimeOut)
+	{
+	// Must make sure that the data to be stored is not bigger than the buffer.
+	__ASSERT_COMPILE(sizeof(ST_LbsAGpsRequestTimeOut) <= sizeof(iBuffer));
+
+	// In-place construction of the data member
+	new(&Data()) ST_LbsAGpsRequestTimeOut;
+		
+	ST_LbsAGpsRequestTimeOut& data = Data();
+
+	data.iTimeOut = aTimeOut;
+	}
+
+EXPORT_C const TTimeIntervalMicroSeconds& TT_LbsAGpsRequestTimeOut::TimeOut() const
+	{
+	return Data().iTimeOut;
+	}	
+
+inline TT_LbsAGpsRequestTimeOut::ST_LbsAGpsRequestTimeOut& TT_LbsAGpsRequestTimeOut::Data()
+	{
+	return reinterpret_cast<ST_LbsAGpsRequestTimeOut&>(iBuffer);
+	}
+	
+inline const TT_LbsAGpsRequestTimeOut::ST_LbsAGpsRequestTimeOut& TT_LbsAGpsRequestTimeOut::Data() const
+	{
+	return reinterpret_cast<const ST_LbsAGpsRequestTimeOut&>(iBuffer);
+	}	
+
+///////////////////////////////////////////////////////////////////////////////
+// Test A-Gps Module Request Options
+///////////////////////////////////////////////////////////////////////////////
+EXPORT_C TT_LbsAGpsRequestOptions::TT_LbsAGpsRequestOptions(TLbsHybridModuleOptions aModuleOption) 
+															: TT_LbsMsgBase(EModuleRequestOptions)
+	{
+	// Must make sure that the data to be stored is not bigger than the buffer.
+	__ASSERT_COMPILE(sizeof(ST_LbsAGpsRequestOptions) <= sizeof(iBuffer));
+
+	// In-place construction of the data member
+	new(&Data()) ST_LbsAGpsRequestOptions;
+		
+	ST_LbsAGpsRequestOptions& data = Data();
+
+	data.iModuleOption = aModuleOption;
+	}
+
+EXPORT_C TT_LbsAGpsRequestOptions::TT_LbsAGpsRequestOptions(TLbsHybridModuleOptions aModuleOption, 
+															TBool aModuleValue) 
+															: TT_LbsMsgBase(EModuleRequestOptions)
+	{
+	// Must make sure that the data to be stored is not bigger than the buffer.
+	__ASSERT_COMPILE(sizeof(ST_LbsAGpsRequestOptions) <= sizeof(iBuffer));
+
+	// In-place construction of the data member
+	new(&Data()) ST_LbsAGpsRequestOptions;
+		
+	ST_LbsAGpsRequestOptions& data = Data();
+
+	data.iModuleOption = aModuleOption;
+	data.iModuleValue = aModuleValue;
+	}
+	
+EXPORT_C TLbsHybridModuleOptions TT_LbsAGpsRequestOptions::ModuleOption() const
+	{
+	return Data().iModuleOption;
+	}
+	
+EXPORT_C TBool TT_LbsAGpsRequestOptions::ModuleValue() const
+	{
+	return Data().iModuleValue;
+	}
+	
+inline TT_LbsAGpsRequestOptions::ST_LbsAGpsRequestOptions& TT_LbsAGpsRequestOptions::Data()
+	{
+	return reinterpret_cast<ST_LbsAGpsRequestOptions&>(iBuffer);
+	}
+	
+inline const TT_LbsAGpsRequestOptions::ST_LbsAGpsRequestOptions& TT_LbsAGpsRequestOptions::Data() const
+	{
+	return reinterpret_cast<const ST_LbsAGpsRequestOptions&>(iBuffer);
+	}	
+	
+///////////////////////////////////////////////////////////////////////////////
+// Test A-Gps Module Request Error
+///////////////////////////////////////////////////////////////////////////////
+EXPORT_C TT_LbsAGpsRequestError::TT_LbsAGpsRequestError(TInt aError)
+														: TT_LbsMsgBase(EModuleRequestError)
+	{
+	// Must make sure that the data to be stored is not bigger than the buffer.
+	__ASSERT_COMPILE(sizeof(ST_LbsAGpsRequestError) <= sizeof(iBuffer));
+
+	// In-place construction of the data member
+	new(&Data()) ST_LbsAGpsRequestError;
+		
+	ST_LbsAGpsRequestError& data = Data();
+
+	data.iError = aError;
+	}
+
+EXPORT_C TInt TT_LbsAGpsRequestError::Error() const
+	{
+	return Data().iError;
+	}
+	
+inline TT_LbsAGpsRequestError::TT_LbsAGpsRequestError::ST_LbsAGpsRequestError& TT_LbsAGpsRequestError::Data()
+	{
+	return reinterpret_cast<ST_LbsAGpsRequestError&>(iBuffer);
+	}
+	
+inline const TT_LbsAGpsRequestError::ST_LbsAGpsRequestError& TT_LbsAGpsRequestError::Data() const
+	{
+	return reinterpret_cast<const ST_LbsAGpsRequestError&>(iBuffer);
+	}	
+
+///////////////////////////////////////////////////////////////////////////////
+// Test A-Gps Module Request Forced Update
+///////////////////////////////////////////////////////////////////////////////
+
+EXPORT_C TT_LbsAGpsRequestForcedUpdate::TT_LbsAGpsRequestForcedUpdate()
+														: TT_LbsMsgBase(EModuleRequestForcedUpdate)
+	{
+	// Must make sure that the data to be stored is not bigger than the buffer.
+	__ASSERT_COMPILE(sizeof(ST_LbsAGpsRequestForcedUpdate) <= sizeof(iBuffer));
+
+	// In-place construction of the data member
+	new(&Data()) ST_LbsAGpsRequestForcedUpdate;
+		
+	ST_LbsAGpsRequestForcedUpdate& data = Data();
+	}
+
+inline TT_LbsAGpsRequestForcedUpdate::ST_LbsAGpsRequestForcedUpdate& TT_LbsAGpsRequestForcedUpdate::Data()
+	{
+	return reinterpret_cast<ST_LbsAGpsRequestForcedUpdate&>(iBuffer);
+	}
+	
+inline const TT_LbsAGpsRequestForcedUpdate::ST_LbsAGpsRequestForcedUpdate& TT_LbsAGpsRequestForcedUpdate::Data() const
+	{
+	return reinterpret_cast<const ST_LbsAGpsRequestForcedUpdate&>(iBuffer);
+	}
+	
+///////////////////////////////////////////////////////////////////////////////
+// Test A-Gps Module Response Message
+///////////////////////////////////////////////////////////////////////////////
+
+EXPORT_C TT_LbsAGpsResponseMsg::TT_LbsAGpsResponseMsg(const TModuleResponseType& 	aResponse)
+							  						: TT_LbsMsgBase(EModuleResponse)
+	{
+	// Must make sure that the data to be stored is not bigger than the buffer.
+	__ASSERT_COMPILE(sizeof(ST_LbsAGpsResponse) <= sizeof(iBuffer));
+
+	// In-place construction of the data member
+	new(&Data()) ST_LbsAGpsResponse;
+		
+	ST_LbsAGpsResponse& data = Data();
+
+	data.iResponseType = aResponse;
+	}
+
+EXPORT_C TT_LbsAGpsResponseMsg::TModuleResponseType TT_LbsAGpsResponseMsg::ResponseType() const
+	{
+	return Data().iResponseType;
+	}
+			
+inline TT_LbsAGpsResponseMsg::ST_LbsAGpsResponse& TT_LbsAGpsResponseMsg::Data()
+	{
+	return reinterpret_cast<ST_LbsAGpsResponse&>(iBuffer);
+	}
+	
+inline const TT_LbsAGpsResponseMsg::ST_LbsAGpsResponse& TT_LbsAGpsResponseMsg::Data() const
+	{
+	return reinterpret_cast<const ST_LbsAGpsResponse&>(iBuffer);
+	}	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestutils/BWINS/LbsTestUtilsU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,63 @@
+EXPORTS
+	??0T_LbsUtils@@QAE@XZ @ 1 NONAME ; T_LbsUtils::T_LbsUtils(void)
+	??1CT_LbsTimerUtils@@UAE@XZ @ 2 NONAME ; CT_LbsTimerUtils::~CT_LbsTimerUtils(void)
+	??1T_LbsUtils@@QAE@XZ @ 3 NONAME ; T_LbsUtils::~T_LbsUtils(void)
+	?CancelTimer@CT_LbsTimerUtils@@QAEXXZ @ 4 NONAME ; void CT_LbsTimerUtils::CancelTimer(void)
+	?Compare_ModuleInfo@T_LbsUtils@@QAEHAAVTPositionModuleInfo@@0@Z @ 5 NONAME ; int T_LbsUtils::Compare_ModuleInfo(class TPositionModuleInfo &, class TPositionModuleInfo &)
+	?Compare_ModuleStatus@T_LbsUtils@@QAEHAAVTPositionModuleStatus@@0@Z @ 6 NONAME ; int T_LbsUtils::Compare_ModuleStatus(class TPositionModuleStatus &, class TPositionModuleStatus &)
+	?Compare_ModuleUpdateOptions@@YAHAAVTPositionUpdateOptions@@0@Z @ 7 NONAME ; int Compare_ModuleUpdateOptions(class TPositionUpdateOptions &, class TPositionUpdateOptions &)
+	?Compare_PosInfo@T_LbsUtils@@QAEHABVTPositionInfoBase@@0@Z @ 8 NONAME ; int T_LbsUtils::Compare_PosInfo(class TPositionInfoBase const &, class TPositionInfoBase const &)
+	?Compare_PosInfo@T_LbsUtils@@QAEHABVTPositionInfoBase@@0W4TComparisonAccuracyType@1@@Z @ 9 NONAME ; int T_LbsUtils::Compare_PosInfo(class TPositionInfoBase const &, class TPositionInfoBase const &, enum T_LbsUtils::TComparisonAccuracyType)
+	?Compare_PosInfoArr@T_LbsUtils@@QAEHAAV?$RPointerArray@X@@0@Z @ 10 NONAME ; int T_LbsUtils::Compare_PosInfoArr(class RPointerArray<void> &, class RPointerArray<void> &)
+	?Compare_PosInfoArr@T_LbsUtils@@QAEHAAV?$RPointerArray@X@@0W4TComparisonAccuracyType@1@@Z @ 11 NONAME ; int T_LbsUtils::Compare_PosInfoArr(class RPointerArray<void> &, class RPointerArray<void> &, enum T_LbsUtils::TComparisonAccuracyType)
+	?Compare_PositionQuality@T_LbsUtils@@QAEHAAVTPositionQuality@@0@Z @ 12 NONAME ; int T_LbsUtils::Compare_PositionQuality(class TPositionQuality &, class TPositionQuality &)
+	?CreateTestPropertiesL@T_LbsUtils@@QAEXXZ @ 13 NONAME ; void T_LbsUtils::CreateTestPropertiesL(void)
+	?Create_ModuleInfoL@T_LbsUtils@@QAEXVTUid@@AAVTPositionModuleInfo@@@Z @ 14 NONAME ; void T_LbsUtils::Create_ModuleInfoL(class TUid, class TPositionModuleInfo &)
+	?GetAGpsModuleIdL@T_LbsUtils@@QAE?AVTUid@@AAVRPositionServer@@@Z @ 15 NONAME ; class TUid T_LbsUtils::GetAGpsModuleIdL(class RPositionServer &)
+	?GetBadModuleId@T_LbsUtils@@QAE?AVTUid@@XZ @ 16 NONAME ; class TUid T_LbsUtils::GetBadModuleId(void)
+	?GetConfigured_ModuleStatusL@T_LbsUtils@@QAEXABVTDesC16@@0AAVTPositionModuleStatus@@@Z @ 17 NONAME ; void T_LbsUtils::GetConfigured_ModuleStatusL(class TDesC16 const &, class TDesC16 const &, class TPositionModuleStatus &)
+	?GetConfigured_ModuleUpdateOptionsL@T_LbsUtils@@QAEXABVTDesC16@@0AAVTPositionUpdateOptions@@@Z @ 18 NONAME ; void T_LbsUtils::GetConfigured_ModuleUpdateOptionsL(class TDesC16 const &, class TDesC16 const &, class TPositionUpdateOptions &)
+	?GetConfigured_PosInfosL@T_LbsUtils@@QAEXABVTDesC16@@0AAV?$RPointerArray@X@@@Z @ 19 NONAME ; void T_LbsUtils::GetConfigured_PosInfosL(class TDesC16 const &, class TDesC16 const &, class RPointerArray<void> &)
+	?GetNetworkModuleIdL@T_LbsUtils@@QAE?AVTUid@@AAVRPositionServer@@@Z @ 20 NONAME ; class TUid T_LbsUtils::GetNetworkModuleIdL(class RPositionServer &)
+	?NewL@CT_LbsAsyncWaiter@@SAPAV1@XZ @ 21 NONAME ; class CT_LbsAsyncWaiter * CT_LbsAsyncWaiter::NewL(void)
+	?NewL@CT_LbsTimerUtils@@SAPAV1@PAVMT_LbsTimerUtilsObserver@@H@Z @ 22 NONAME ; class CT_LbsTimerUtils * CT_LbsTimerUtils::NewL(class MT_LbsTimerUtilsObserver *, int)
+	?NotifyModuleOfConfigChangeL@T_LbsUtils@@QAEXABVTModuleDataIn@@@Z @ 23 NONAME ; void T_LbsUtils::NotifyModuleOfConfigChangeL(class TModuleDataIn const &)
+	?ResetAndDestroy_PosInfoArr@T_LbsUtils@@QAEXAAV?$RPointerArray@X@@@Z @ 24 NONAME ; void T_LbsUtils::ResetAndDestroy_PosInfoArr(class RPointerArray<void> &)
+	?Result@CT_LbsAsyncWaiter@@QBEHXZ @ 25 NONAME ; int CT_LbsAsyncWaiter::Result(void) const
+	?SetTimer@CT_LbsTimerUtils@@QAEXABVTTime@@@Z @ 26 NONAME ; void CT_LbsTimerUtils::SetTimer(class TTime const &)
+	?SetTimer@CT_LbsTimerUtils@@QAEXVTTimeIntervalMicroSeconds32@@@Z @ 27 NONAME ; void CT_LbsTimerUtils::SetTimer(class TTimeIntervalMicroSeconds32)
+	?StartAndWait@CT_LbsAsyncWaiter@@QAEXXZ @ 28 NONAME ; void CT_LbsAsyncWaiter::StartAndWait(void)
+	?VerifySimpleAssistanceData@T_LbsUtils@@QAEHAAVRUEPositioningGpsReferenceTimeReader@@@Z @ 29 NONAME ; int T_LbsUtils::VerifySimpleAssistanceData(class RUEPositioningGpsReferenceTimeReader &)
+	?Verify_PositionIsValid@T_LbsUtils@@QAEHAAVTPositionInfo@@@Z @ 30 NONAME ; int T_LbsUtils::Verify_PositionIsValid(class TPositionInfo &)
+	?WaitForModuleToRequestAssistanceDataL@T_LbsUtils@@QAEXXZ @ 31 NONAME ; void T_LbsUtils::WaitForModuleToRequestAssistanceDataL(void)
+	?Compare_AssistanceDataLog@T_LbsUtils@@QAEHABVCLbsAssistanceDataLogEvent@@0@Z @ 32 NONAME ; int T_LbsUtils::Compare_AssistanceDataLog(class CLbsAssistanceDataLogEvent const &, class CLbsAssistanceDataLogEvent const &)
+	?Compare_ExternalLocateLog@T_LbsUtils@@QAEHABVCLbsExternalLocateLogEvent@@0@Z @ 33 NONAME ; int T_LbsUtils::Compare_ExternalLocateLog(class CLbsExternalLocateLogEvent const &, class CLbsExternalLocateLogEvent const &)
+	?Compare_LogBase@T_LbsUtils@@QAEHABVCLbsLogEvent@@0@Z @ 34 NONAME ; int T_LbsUtils::Compare_LogBase(class CLbsLogEvent const &, class CLbsLogEvent const &)
+	?Compare_NetworkLocateLog@T_LbsUtils@@QAEHABVCLbsNetworkLocateLogEvent@@0@Z @ 35 NONAME ; int T_LbsUtils::Compare_NetworkLocateLog(class CLbsNetworkLocateLogEvent const &, class CLbsNetworkLocateLogEvent const &)
+	?Compare_SelfLocateLog@T_LbsUtils@@QAEHABVCLbsSelfLocateLogEvent@@0@Z @ 36 NONAME ; int T_LbsUtils::Compare_SelfLocateLog(class CLbsSelfLocateLogEvent const &, class CLbsSelfLocateLogEvent const &)
+	?Compare_TransmitLocationLog@T_LbsUtils@@QAEHABVCLbsTransmitLocationLogEvent@@0@Z @ 37 NONAME ; int T_LbsUtils::Compare_TransmitLocationLog(class CLbsTransmitLocationLogEvent const &, class CLbsTransmitLocationLogEvent const &)
+	??0TLbsModuleUpdateItem@@QAE@XZ @ 38 NONAME ; TLbsModuleUpdateItem::TLbsModuleUpdateItem(void)
+	?Error@TLbsModuleUpdateItem@@QBEHXZ @ 39 NONAME ; int TLbsModuleUpdateItem::Error(void) const
+	?Measurement@TLbsModuleUpdateItem@@QBEABVTPositionGpsMeasurementInfo@@XZ @ 40 NONAME ; class TPositionGpsMeasurementInfo const & TLbsModuleUpdateItem::Measurement(void) const
+	?Position@TLbsModuleUpdateItem@@QBEABVTPositionSatelliteInfo@@XZ @ 41 NONAME ; class TPositionSatelliteInfo const & TLbsModuleUpdateItem::Position(void) const
+	?SetError@TLbsModuleUpdateItem@@QAEXH@Z @ 42 NONAME ; void TLbsModuleUpdateItem::SetError(int)
+	?SetMeasurement@TLbsModuleUpdateItem@@QAEXABVTPositionGpsMeasurementInfo@@@Z @ 43 NONAME ; void TLbsModuleUpdateItem::SetMeasurement(class TPositionGpsMeasurementInfo const &)
+	?SetPosition@TLbsModuleUpdateItem@@QAEXABVTPositionSatelliteInfo@@@Z @ 44 NONAME ; void TLbsModuleUpdateItem::SetPosition(class TPositionSatelliteInfo const &)
+	?Write@CT_Dumper@@SAXV?$TRefByValue@$$CBVTDesC16@@@@ZZ @ 45 NONAME ; void CT_Dumper::Write(class TRefByValue<class TDesC16 const >, ...)
+	?OverWrite@CT_Dumper@@SAXXZ @ 46 NONAME ; void CT_Dumper::OverWrite(void)
+	?GetConfigured_UpdateArrayL@T_LbsUtils@@QAEXABVTDesC16@@0AAV?$RPointerArray@VTLbsModuleUpdateItem@@@@@Z @ 47 NONAME ; void T_LbsUtils::GetConfigured_UpdateArrayL(class TDesC16 const &, class TDesC16 const &, class RPointerArray<class TLbsModuleUpdateItem> &)
+	?NewL@CT_LbsAGpsHandler@@SAPAV1@PAVMT_ResponseObserver@@@Z @ 48 NONAME ; class CT_LbsAGpsHandler * CT_LbsAGpsHandler::NewL(class MT_ResponseObserver *)
+	?SendRequestClearAllModuleOptions@CT_LbsAGpsHandler@@QAEXXZ @ 49 NONAME ; void CT_LbsAGpsHandler::SendRequestClearAllModuleOptions(void)
+	?SendRequestError@CT_LbsAGpsHandler@@QAEXH@Z @ 50 NONAME ; void CT_LbsAGpsHandler::SendRequestError(int)
+	?SendRequestModuleOption@CT_LbsAGpsHandler@@QAEXW4TLbsHybridModuleOptions@@H@Z @ 51 NONAME ; void CT_LbsAGpsHandler::SendRequestModuleOption(enum TLbsHybridModuleOptions, int)
+	?SendRequestSetAllModuleOptions@CT_LbsAGpsHandler@@QAEXXZ @ 52 NONAME ; void CT_LbsAGpsHandler::SendRequestSetAllModuleOptions(void)
+	?SendRequestTimeOutMsg@CT_LbsAGpsHandler@@QAEXABVTTimeIntervalMicroSeconds@@@Z @ 53 NONAME ; void CT_LbsAGpsHandler::SendRequestTimeOutMsg(class TTimeIntervalMicroSeconds const &)
+	?SendRequestUpdateInitMsg@CT_LbsAGpsHandler@@QAEXABVTDesC16@@0@Z @ 54 NONAME ; void CT_LbsAGpsHandler::SendRequestUpdateInitMsg(class TDesC16 const &, class TDesC16 const &)
+	?Delay@TLbsModuleUpdateItem@@QBEHXZ @ 55 NONAME ; int TLbsModuleUpdateItem::Delay(void) const
+	?SetDelay@TLbsModuleUpdateItem@@QAEXH@Z @ 56 NONAME ; void TLbsModuleUpdateItem::SetDelay(int)
+	??1CT_AgpsModuleEventListener@@UAE@XZ @ 57 NONAME ; CT_AgpsModuleEventListener::~CT_AgpsModuleEventListener(void)
+	?GetExpected_ModuleModes@T_LbsUtils@@QAEXABVTDesC16@@0AAV?$RPointerArray@VTLbsGpsOptions@@@@@Z @ 58 NONAME ; void T_LbsUtils::GetExpected_ModuleModes(class TDesC16 const &, class TDesC16 const &, class RPointerArray<class TLbsGpsOptions> &)
+	?NewL@CT_AgpsModuleEventListener@@SAPAV1@AAVMT_AgpsModuleEventHandler@@@Z @ 59 NONAME ; class CT_AgpsModuleEventListener * CT_AgpsModuleEventListener::NewL(class MT_AgpsModuleEventHandler &)
+	?GetConfigured_ClientDetailsL@T_LbsUtils@@QAEXABVTDesC16@@0AAV?$RArray@VTCTClientDetails@@@@@Z @ 60 NONAME ; void T_LbsUtils::GetConfigured_ClientDetailsL(class TDesC16 const &, class TDesC16 const &, class RArray<class TCTClientDetails> &)
+	?SendRequestForcedUpdate@CT_LbsAGpsHandler@@QAEXXZ @ 61 NONAME ; void CT_LbsAGpsHandler::SendRequestForcedUpdate(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestutils/EABI/LbsTestUtilsU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,91 @@
+EXPORTS
+	_Z27Compare_ModuleUpdateOptionsR22TPositionUpdateOptionsS0_ @ 1 NONAME
+	_ZN10T_LbsUtils14GetBadModuleIdEv @ 2 NONAME
+	_ZN10T_LbsUtils15Compare_PosInfoERK17TPositionInfoBaseS2_ @ 3 NONAME
+	_ZN10T_LbsUtils15Compare_PosInfoERK17TPositionInfoBaseS2_NS_23TComparisonAccuracyTypeE @ 4 NONAME
+	_ZN10T_LbsUtils16GetAGpsModuleIdLER15RPositionServer @ 5 NONAME
+	_ZN10T_LbsUtils18Compare_ModuleInfoER19TPositionModuleInfoS1_ @ 6 NONAME
+	_ZN10T_LbsUtils18Compare_PosInfoArrER13RPointerArrayIvES2_ @ 7 NONAME
+	_ZN10T_LbsUtils18Compare_PosInfoArrER13RPointerArrayIvES2_NS_23TComparisonAccuracyTypeE @ 8 NONAME
+	_ZN10T_LbsUtils18Create_ModuleInfoLE4TUidR19TPositionModuleInfo @ 9 NONAME
+	_ZN10T_LbsUtils19GetNetworkModuleIdLER15RPositionServer @ 10 NONAME
+	_ZN10T_LbsUtils20Compare_ModuleStatusER21TPositionModuleStatusS1_ @ 11 NONAME
+	_ZN10T_LbsUtils21CreateTestPropertiesLEv @ 12 NONAME
+	_ZN10T_LbsUtils22Verify_PositionIsValidER13TPositionInfo @ 13 NONAME
+	_ZN10T_LbsUtils23Compare_PositionQualityER16TPositionQualityS1_ @ 14 NONAME
+	_ZN10T_LbsUtils23GetConfigured_PosInfosLERK7TDesC16S2_R13RPointerArrayIvE @ 15 NONAME
+	_ZN10T_LbsUtils26ResetAndDestroy_PosInfoArrER13RPointerArrayIvE @ 16 NONAME
+	_ZN10T_LbsUtils26VerifySimpleAssistanceDataER36RUEPositioningGpsReferenceTimeReader @ 17 NONAME
+	_ZN10T_LbsUtils27GetConfigured_ModuleStatusLERK7TDesC16S2_R21TPositionModuleStatus @ 18 NONAME
+	_ZN10T_LbsUtils27NotifyModuleOfConfigChangeLERK13TModuleDataIn @ 19 NONAME
+	_ZN10T_LbsUtils34GetConfigured_ModuleUpdateOptionsLERK7TDesC16S2_R22TPositionUpdateOptions @ 20 NONAME
+	_ZN10T_LbsUtilsC1Ev @ 21 NONAME
+	_ZN10T_LbsUtilsC2Ev @ 22 NONAME
+	_ZN10T_LbsUtilsD1Ev @ 23 NONAME
+	_ZN10T_LbsUtilsD2Ev @ 24 NONAME
+	_ZN16CT_LbsTimerUtils11CancelTimerEv @ 25 NONAME
+	_ZN16CT_LbsTimerUtils4NewLEP24MT_LbsTimerUtilsObserveri @ 26 NONAME
+	_ZN16CT_LbsTimerUtils8SetTimerE27TTimeIntervalMicroSeconds32 @ 27 NONAME
+	_ZN16CT_LbsTimerUtils8SetTimerERK5TTime @ 28 NONAME
+	_ZN16CT_LbsTimerUtilsD0Ev @ 29 NONAME
+	_ZN16CT_LbsTimerUtilsD1Ev @ 30 NONAME
+	_ZN16CT_LbsTimerUtilsD2Ev @ 31 NONAME
+	_ZN17CT_LbsAsyncWaiter12StartAndWaitEv @ 32 NONAME
+	_ZN17CT_LbsAsyncWaiter4NewLEv @ 33 NONAME
+	_ZNK17CT_LbsAsyncWaiter6ResultEv @ 34 NONAME
+	_ZTI16CT_LbsTimerUtils @ 35 NONAME ; #<TI>#
+	_ZTI17CConfigReaderBase @ 36 NONAME ; #<TI>#
+	_ZTI17CT_LbsAsyncWaiter @ 37 NONAME ; #<TI>#
+	_ZTI20CPosInfoConfigReader @ 38 NONAME ; #<TI>#
+	_ZTI23CUpdateOptsConfigReader @ 39 NONAME ; #<TI>#
+	_ZTI25CModuleStatusConfigReader @ 40 NONAME ; #<TI>#
+	_ZTV16CT_LbsTimerUtils @ 41 NONAME ; #<VT>#
+	_ZTV17CConfigReaderBase @ 42 NONAME ; #<VT>#
+	_ZTV17CT_LbsAsyncWaiter @ 43 NONAME ; #<VT>#
+	_ZTV20CPosInfoConfigReader @ 44 NONAME ; #<VT>#
+	_ZTV23CUpdateOptsConfigReader @ 45 NONAME ; #<VT>#
+	_ZTV25CModuleStatusConfigReader @ 46 NONAME ; #<VT>#
+	_ZN10T_LbsUtils37WaitForModuleToRequestAssistanceDataLEv @ 47 NONAME
+	_ZN10T_LbsUtils21Compare_SelfLocateLogERK22CLbsSelfLocateLogEventS2_ @ 48 NONAME
+	_ZN10T_LbsUtils24Compare_NetworkLocateLogERK25CLbsNetworkLocateLogEventS2_ @ 49 NONAME
+	_ZN10T_LbsUtils25Compare_AssistanceDataLogERK26CLbsAssistanceDataLogEventS2_ @ 50 NONAME
+	_ZN10T_LbsUtils25Compare_ExternalLocateLogERK26CLbsExternalLocateLogEventS2_ @ 51 NONAME
+	_ZN10T_LbsUtils27Compare_TransmitLocationLogERK28CLbsTransmitLocationLogEventS2_ @ 52 NONAME
+	_ZNK20TLbsModuleUpdateItem11MeasurementEv @ 53 NONAME
+	_ZN20TLbsModuleUpdateItem11SetPositionERK22TPositionSatelliteInfo @ 54 NONAME
+	_ZN20TLbsModuleUpdateItem14SetMeasurementERK27TPositionGpsMeasurementInfo @ 55 NONAME
+	_ZNK20TLbsModuleUpdateItem5ErrorEv @ 56 NONAME
+	_ZNK20TLbsModuleUpdateItem8PositionEv @ 57 NONAME
+	_ZN20TLbsModuleUpdateItem8SetErrorEi @ 58 NONAME
+	_ZN20TLbsModuleUpdateItemC1Ev @ 59 NONAME
+	_ZN20TLbsModuleUpdateItemC2Ev @ 60 NONAME
+	_ZTI19CUpdateConfigReader @ 61 NONAME
+	_ZTV19CUpdateConfigReader @ 62 NONAME
+	_ZN9CT_Dumper5WriteE11TRefByValueIK7TDesC16Ez @ 63 NONAME
+	_ZN9CT_Dumper9OverWriteEv @ 64 NONAME
+	_ZN10T_LbsUtils26GetConfigured_UpdateArrayLERK7TDesC16S2_R13RPointerArrayI20TLbsModuleUpdateItemE @ 65 NONAME
+	_ZN17CT_LbsAGpsHandler16SendRequestErrorEi @ 66 NONAME
+	_ZN17CT_LbsAGpsHandler21SendRequestTimeOutMsgERK25TTimeIntervalMicroSeconds @ 67 NONAME
+	_ZN17CT_LbsAGpsHandler23SendRequestModuleOptionE23TLbsHybridModuleOptionsi @ 68 NONAME
+	_ZN17CT_LbsAGpsHandler24SendRequestUpdateInitMsgERK7TDesC16S2_ @ 69 NONAME
+	_ZN17CT_LbsAGpsHandler30SendRequestSetAllModuleOptionsEv @ 70 NONAME
+	_ZN17CT_LbsAGpsHandler32SendRequestClearAllModuleOptionsEv @ 71 NONAME
+	_ZN17CT_LbsAGpsHandler4NewLEP19MT_ResponseObserver @ 72 NONAME
+	_ZTI17CT_LbsAGpsHandler @ 73 NONAME ; #<TI>#
+	_ZTV17CT_LbsAGpsHandler @ 74 NONAME ; #<VT>#
+	_ZN20TLbsModuleUpdateItem8SetDelayEi @ 75 NONAME
+	_ZNK20TLbsModuleUpdateItem5DelayEv @ 76 NONAME
+	_ZN10T_LbsUtils23GetExpected_ModuleModesERK7TDesC16S2_R13RPointerArrayI14TLbsGpsOptionsE @ 77 NONAME
+	_ZN26CT_AgpsModuleEventListener4NewLER25MT_AgpsModuleEventHandler @ 78 NONAME
+	_ZN26CT_AgpsModuleEventListenerD0Ev @ 79 NONAME
+	_ZN26CT_AgpsModuleEventListenerD1Ev @ 80 NONAME
+	_ZN26CT_AgpsModuleEventListenerD2Ev @ 81 NONAME
+	_ZTI26CT_AgpsModuleEventListener @ 82 NONAME
+	_ZTI28CAgpsModuleModesConfigReader @ 83 NONAME
+	_ZTV26CT_AgpsModuleEventListener @ 84 NONAME
+	_ZTV28CAgpsModuleModesConfigReader @ 85 NONAME
+	_ZN10T_LbsUtils28GetConfigured_ClientDetailsLERK7TDesC16S2_R6RArrayI16TCTClientDetailsE @ 86 NONAME
+	_ZTI26CClientDetailsConfigReader @ 87 NONAME
+	_ZTV26CClientDetailsConfigReader @ 88 NONAME
+	_ZN17CT_LbsAGpsHandler23SendRequestForcedUpdateEv @ 89 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestutils/group/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,25 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRJ_TESTMMPFILES
+lbstestutils.mmp
+
+PRJ_TESTEXPORTS
+../inc/tlbsutils.h		/epoc32/include/lbs/test/tlbsutils.h	
+../inc/ctlbsasyncwaiter.h	/epoc32/include/lbs/test/ctlbsasyncwaiter.h
+../inc/ctlbstimerutils.h	/epoc32/include/lbs/test/ctlbstimerutils.h
+../inc/ctdumper.h		/epoc32/include/lbs/test/ctdumper.h
+../inc/ctlbsagpshandler.h	/epoc32/include/lbs/test/ctlbsagpshandler.h
+../inc/ctlbsagpsmoduleeventlistener.h /epoc32/include/lbs/test/ctlbsagpsmoduleeventlistener.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestutils/group/lbstestutils.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,62 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file lbstestutils.mmp
+// 
+//
+
+TARGET			lbstestutils.dll
+TARGETTYPE		DLL
+
+//CAPABILITY	ProtServ LocalServices WriteDeviceData ReadDeviceData Location
+CAPABILITY ALL -TCB
+
+MACRO ENABLE_LBS_TEST_LOGGER
+
+UID			0x1000007A 0x10282260
+
+
+SYSTEMINCLUDE	/epoc32/include
+SYSTEMINCLUDE	/epoc32/include/lbs
+SYSTEMINCLUDE	/epoc32/include/lbs/test
+
+USERINCLUDE		../inc
+//USERINCLUDE		../../../../locationrequestmgmt/networkrequesthandler/inc
+
+SOURCEPATH		../src
+SOURCE			tlbsutils.cpp
+SOURCE			ctlbsasyncwaiter.cpp
+SOURCE			ctlbstimerutils.cpp
+SOURCE			ctlbsconfigreader.cpp
+SOURCE			ctdumper.cpp
+SOURCE			ctlbsagpshandler.cpp
+SOURCE			ctlbsagpsmoduleeventlistener.cpp
+SOURCE			ctlbstestlogger.cpp
+
+// EPOC libraries.
+LIBRARY	euser.lib
+LIBRARY efsrv.lib
+
+// LBS libraries.
+LIBRARY	lbsselflocate.lib
+LIBRARY	lbsloccommon.lib
+LIBRARY lbsassistancedata.lib
+LIBRARY lbsloggerapi.lib
+LIBRARY	flogger.lib
+
+// For Log Comparison
+LIBRARY		lbsprivacycontroller.lib
+LIBRARY		lbsnetprotocol.lib
+
+LIBRARY		lbstestchannel.lib 
+LIBRARY		lbslocdatasource.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestutils/inc/ctdumper.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,43 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#ifndef CTDUMPER_H
+#define CTDUMPER_H
+
+#include <e32base.h>
+
+#define LBSDUMPNEWLOG() 				CT_Dumper::OverWrite()
+#define LBSDUMP(L1) 					CT_Dumper::Write(_L(L1))
+#define LBSDUMP2(L1,L2) 				CT_Dumper::Write(_L(L1), L2)
+
+	
+/** Dumper used by the GPS module to dump the update array in a file.
+*/
+class CT_Dumper : public CBase
+	{
+public:
+	IMPORT_C static void OverWrite();
+	IMPORT_C static void Write(TRefByValue<const TDesC16> aFmt, ...);
+	}; 
+
+#endif // CTDUMPER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestutils/inc/ctlbsagpshandler.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,93 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Definition of Test Harness request handler component.
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#ifndef CTLBSAGPSHANDLER_H
+#define CTLBSAGPSHANDLER_H
+
+#include <e32hashtab.h>
+#include <lbs/test/tlbschannel.h>
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Test Harness Request Handler Channel
+///////////////////////////////////////////////////////////////////////////////
+
+/** Observer for TH Request Handler interface
+*/
+class MT_ResponseObserver
+	{
+public:
+	virtual void ProcessAGpsResponseMessage(const TT_LbsAGpsResponseMsg::TModuleResponseType aResponse) = 0;
+	};
+
+/** Manager for the TH channel.
+
+This class handles sending and receiving messages on the Test Harness channel.
+It is implemented as an active object to allow it to asnychronously wait for 
+messages to arrive. Sending is synchronous.
+*/
+class CT_LbsAGpsHandler : public CActive, 
+						  public MT_LbsChannelObserver
+	{
+public:
+	IMPORT_C static CT_LbsAGpsHandler* NewL(MT_ResponseObserver* aObserver);
+	~CT_LbsAGpsHandler();
+
+	IMPORT_C void SendRequestUpdateInitMsg(const TDesC& aConfigFileName, 
+								  const TDesC& aConfigSection);
+	IMPORT_C void SendRequestTimeOutMsg(const TTimeIntervalMicroSeconds& aTimeOut);
+	IMPORT_C void SendRequestSetAllModuleOptions();
+	IMPORT_C void SendRequestClearAllModuleOptions();
+	IMPORT_C void SendRequestModuleOption(TLbsHybridModuleOptions aOption, TBool aValue);
+	IMPORT_C void SendRequestForcedUpdate();
+	IMPORT_C void SendRequestError(TInt aError);
+
+			
+private:
+	CT_LbsAGpsHandler(MT_ResponseObserver* aObserver);
+	void ConstructL();
+	
+	// from CActive
+	void RunL();
+	void DoCancel();
+	TInt RunError(TInt aError);
+	
+	// Send a message.
+	void SendRequestMessage(const TT_LbsMsgBase* aMessage);
+
+	// Buffer a message.
+	void BufferMessage(const TT_LbsMsgBase* aMessage);
+	
+	// from MT_LbsChannelObserver
+	void ProcessChannelMessage(RT_LbsChannel::TT_LbsChannelId aChannelId, const TT_LbsMsgBase& aMessage);
+
+private:
+	MT_ResponseObserver* iObserver;
+	RT_LbsChannel iTHChannel;
+	RPointerArray<TT_LbsMsgBase> iMsgBuffer;
+	};
+
+
+#endif // CTLBSAGPSHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestutils/inc/ctlbsagpsmoduleeventlistener.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,62 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#ifndef __CT_LBS_AGPS_MODULE_EVENT_LISTENER_H__
+#define __CT_LBS_AGPS_MODULE_EVENT_LISTENER_H__
+
+#include "tlbsutils.h"
+#include <lbs/lbslocdatasourcegpsbase.h>
+#include <e32property.h>
+
+class MT_AgpsModuleEventHandler
+	{
+public:
+	virtual void OnSetGpsOptions(const TLbsGpsOptions& aGpsOptions) = 0;
+	};
+
+class CT_AgpsModuleEventListener : public CActive
+/**
+ * This class listens to events published by the AGPS Module.
+ * 
+ * @internalComponent
+*/
+	{
+public:
+	IMPORT_C static CT_AgpsModuleEventListener* NewL(MT_AgpsModuleEventHandler& aHandler);
+	IMPORT_C ~CT_AgpsModuleEventListener();
+	
+private:
+	CT_AgpsModuleEventListener(MT_AgpsModuleEventHandler& aHandler);
+	void ConstructL();
+	
+	void RunL();
+	void DoCancel();
+
+private:
+	/** The call back class */
+	MT_AgpsModuleEventHandler& iHandler;
+	/** The property that will subscribe to the AGPS Module mode changes key */
+	RProperty iModeChangesProperty;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestutils/inc/ctlbsasyncwaiter.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,53 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsasyncwaiter.h
+// This is the header file for CT_LbsAsyncWaiter 
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#ifndef __CT_LBS_ASYNC_WAITER_H__
+#define __CT_LBS_ASYNC_WAITER_H__
+
+//epoc includes
+#include <e32base.h>
+
+// Implements functions related to active objects
+class CT_LbsAsyncWaiter : public CActive
+	{
+public:
+	IMPORT_C static CT_LbsAsyncWaiter* NewL();
+	~CT_LbsAsyncWaiter();
+
+	IMPORT_C void StartAndWait();
+	IMPORT_C TInt Result() const;
+
+private:
+	CT_LbsAsyncWaiter();
+	// from CActive
+	virtual void RunL();
+	virtual void DoCancel();
+
+private:
+	TInt iError;
+	};
+
+#endif // __CT_LBS_ASYNC_WAITER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestutils/inc/ctlbsconfigreader.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,406 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsconfigreader.h
+// This is the header file which contains the ini file configuration reader classes
+// 
+//
+
+#ifndef __CT_LBS_CONFIG_READER_H__
+#define __CT_LBS_CONFIG_READER_H__
+
+
+// Epoc includes
+#include <e32cmn.h>
+
+// LBS includes
+#include <lbs.h>
+#include <lbscommon.h>
+#include <lbspositioninfo.h>
+#include <LbsLocDataSourceGpsBase.h>
+
+// LBS test includes
+#include "tlbsutils.h"
+
+// Forward Declaration
+
+
+
+const TInt KMaxSentence = 200;
+const TInt KMaxFields = 20;
+const TInt KMaxIniFileBuffer = 100;
+const TInt KMaxConfigReaderIniFileName = 100;
+
+class CConfigReaderBase : public CBase
+	{
+public:
+    virtual ~CConfigReaderBase();
+
+	/** Main entry function which reads the ini file, fills out the data items defined in the
+		derived classes. Once NewL as been called to construct the object, this should then be
+		called. */
+	void ProcessL();
+
+protected:
+	/** Converts a string to a TInt value. */
+	void ExtractValueL(const TPtrC8& aField, TInt& aValue);
+	
+	/** Converts a string to a TReal32 value. */
+	void ExtractValueL(const TPtrC8& aField, TReal32& aValue);
+	
+	/** Converts a string to a TReal64 value. */
+	void ExtractValueL(const TPtrC8& aField, TReal64& aValue);
+
+//	void ExtractDegreesL(const TPtrC8& aField, TReal64& aDegrees); this maybe handy so we can have lat, long in degrees not raw real numbers...
+//	void ExtractTimeL(const TPtrC8& aTime, TDateTime& aTheTime);
+//	void ExtractDateL(const TPtrC8& aDate, TDateTime& aTheDate);
+
+//	Derived classes provide the implementation.
+	/** Parses a full sentence read from the ini file. */
+	virtual void HandleSentenceL()=0;
+	
+	/** Fills the data item (detailed in the derived class) with default values. */
+	virtual void DefaultData()=0;
+	
+	/** Fills the data item (detailed in the derived class) with values parsed from the sentence. */
+	virtual void ExtractDataL()=0;
+	
+	CConfigReaderBase(const TDesC &aConfigFileName);
+	
+	CConfigReaderBase(const TDesC& aConfigFileName, const TDesC& aConfigSection);
+	
+private:
+	/** Adds valid sentence character to the field. Once the field delimiter is found the field
+		is appended to the field array. */
+	void AppendFieldChar(TUint aChar);
+	
+	/** Process sentences read from the ini file buffer. A complete valid sentence is passed
+		to HandeSentenceL() to allow the derived class to process the sentence fields into
+		it's data items. */
+	void ProcessStringL(const TDesC8& aData);
+
+private:	
+//	enum TReadState {EWantStart, EWantTerminator};
+
+	enum TReadState {/*	EStart, */
+						EStartSection,
+						EProcessSection,
+						EStartSentence,
+						EProcessSentence,
+						EHalt};
+
+
+	//const TDesC iConfigFileName;	// can we try this, but we will not be able to add the path
+	/** Configuration ini filename to open and read. */
+	TBuf<KMaxConfigReaderIniFileName> iConfigFileName;
+	TBuf<KMaxSentence> iConfigSection;
+	
+	/** State machine variable used while processing a sentence. */
+	TReadState iReadState;
+
+	/** The sentence buffer, to store a valid sentence ready for processing. */
+	TBuf8<KMaxSentence> iSentence;
+	
+
+	TBuf8<KMaxSentence> iReadSection;
+
+protected:
+	/** Field array. Each field is delimited by a ',' or '*' and will be converted into the
+		member variable of the data item defined in the derived class. */
+	TPtrC8 iFields[KMaxFields];
+	
+	/** Number of fields in the field array. */
+	TInt iNumFields;
+	
+	/** Where the field starts in the sentence string. */
+	TInt iFieldStart;
+	
+	/** Length of the field. */
+	TInt iFieldLength;
+	};
+
+
+
+// Default values for TPosition,
+#define DEFAULT_NOTIFY_POS_UPDATE_LATITUDE            49.2
+#define DEFAULT_NOTIFY_POS_UPDATE_LONGITUDE            3.5
+#define DEFAULT_NOTIFY_POS_UPDATE_ALTITUDE            50.0
+#define DEFAULT_NOTIFY_POS_UPDATE_HORIZONTAL_ACCURACY  2.0
+#define DEFAULT_NOTIFY_POS_UPDATE_VERTICAL_ACCURACY    3.0
+
+// TCourse and
+#define DEFAULT_NOTIFY_POS_UPDATE_SPEED             26.66f
+#define DEFAULT_NOTIFY_POS_UPDATE_HEADING           25.0
+#define DEFAULT_NOTIFY_POS_UPDATE_SPEED_ACCURACY    2.0
+#define DEFAULT_NOTIFY_POS_UPDATE_HEADING_ACCURACY  10.0
+
+// TSatelliteData - first satellite
+#define DEFAULT_NOTIFY_POS_UPDATE_SATELLITE_ID1      10
+#define DEFAULT_NOTIFY_POS_UPDATE_AZIMUTH1           50.0
+#define DEFAULT_NOTIFY_POS_UPDATE_ELEVATION1         27.0
+#define DEFAULT_NOTIFY_POS_UPDATE_IS_USED1           ETrue
+#define DEFAULT_NOTIFY_POS_UPDATE_SIGNAL_STRENGTH1   4
+
+// TSatelliteData - second stellite
+#define DEFAULT_NOTIFY_POS_UPDATE_SATELLITE_ID2      11
+#define DEFAULT_NOTIFY_POS_UPDATE_AZIMUTH2           47.0
+#define DEFAULT_NOTIFY_POS_UPDATE_ELEVATION2         30.0
+#define DEFAULT_NOTIFY_POS_UPDATE_IS_USED2           EFalse
+#define DEFAULT_NOTIFY_POS_UPDATE_SIGNAL_STRENGTH2   3
+
+
+
+
+class CUpdateConfigReader : public CConfigReaderBase
+	{
+public:
+
+	enum TUpdateFields
+		{
+		EUpdateType = 0,	// Must be present
+		EUpdateRepeat,
+		ENumOfMeasurements,
+
+		// TCoordinate
+		EPosLatitude,			/** TCoordinate.iLatitude, TReal64 */
+		EPosLongitude,			/** TCoordinate.iLongitude, TReal64 */
+		EPosAltitude,			/** TCoordinate.iAltitude, TReal32 */
+	
+		// TLocalitiy
+		EPosHorzAccuracy,		/** TLocality.iHorizontalAccuracy, TReal32 */
+		EPosVertAccuracy,		/** TLocality.iVerticalAccuracy, TReal32 */
+
+		// Optional
+		EUpdateErr,
+		EUpdateDelay			/** Time to delay, can be negative to force early update */
+	};
+
+
+	static CUpdateConfigReader* NewL(const TDesC &aConfigFileName, const TDesC& aConfigSection, RPointerArray<TLbsModuleUpdateItem>& aUpdateArr);
+
+protected:
+	void HandleSentenceL();
+
+	void DefaultData();
+	void ExtractDataL();
+		
+private:
+	CUpdateConfigReader(const TDesC &aConfigFileName, const TDesC& aConfigSection, RPointerArray<TLbsModuleUpdateItem>& aUpdateArr);
+	void ConstructL();  
+
+	RPointerArray<TLbsModuleUpdateItem>& iUpdateArr;
+	TLbsModuleUpdateItem* iUpdate;
+	};
+
+
+
+
+class CPosInfoConfigReader : public CConfigReaderBase
+	{
+public:
+
+	enum TPosInfoFields
+		{
+		EPosType = 0,	// Must be present
+		EposRepeat,
+
+		// TCoordinate
+		EPosLatitude,			/** TCoordinate.iLatitude, TReal64 */
+		EPosLongitude,			/** TCoordinate.iLongitude, TReal64 */
+		EPosAltitude,			/** TCoordinate.iAltitude, TReal32 */
+		EPosDatum,				/** TCoordinate.iDatum, TUid */
+	
+		// TLocalitiy
+		EPosHorzAccuracy,		/** TLocality.iHorizontalAccuracy, TReal32 */
+		EPosVertAccuracy,		/** TLocality.iVerticalAccuracy, TReal32 */
+	
+		// TPosition
+	//	EPosTime,	/** TPosition.iTime, TTime */	// see comment below
+	
+		// TCourse
+		EPosSpeed,				/** TCourse.iSpeed, TReal32 */
+		EPosHeading,			/** TCourse.iHeading, TReal32 */
+		EPosSpeedAccuracy,		/** TCourse.iSpeedAccuracy, TReal32 */
+		EPosHeadingAccuracy,	/** TCourse.iHeadingAccuracy, TReal32 */
+	};
+
+
+	static CPosInfoConfigReader* NewL(const TDesC &aConfigFileName, const TDesC& aConfigSection, RPointerArray<TAny>& aPosInfoArr);
+
+protected:
+	void HandleSentenceL();
+
+	void DefaultData();
+	void ExtractDataL();
+		
+private:
+	CPosInfoConfigReader(const TDesC &aConfigFileName, const TDesC& aConfigSection, RPointerArray<TAny>& aPosInfoArr);
+	void ConstructL();  
+
+	RPointerArray<TAny>& iPosInfoArr;
+	TPositionInfoBase* iPosInfo;
+	};
+
+
+
+/** CModuleStatusConfigReader is a reader class to process module status sentences.
+	Once processed the aModuleStatus item will be filled with field values held in
+	the sentence.
+	
+	The supported sentence is "modstatus", which MUST start with '$' and end with '*',
+	fields MUST be delimted by ',' and the sentence MUST NOT contain any white space.
+
+	$modstatus,device_field,data_quality_field*
+
+		where device_field is one of
+			device_error
+			device_disable
+			device_inactive
+			device_initialising
+			device_standby
+			device_ready
+			device_active
+
+		where data_quality_field is one of 
+			data_quality_loss
+			data_quality_partial
+			data_quality_normal
+			
+*/
+class CModuleStatusConfigReader : public CConfigReaderBase
+	{
+public:
+
+	enum TModuleStatusFields
+		{
+		EModuleStatusType = 0,	// Must be present, only 1 type 'modstatus'.
+
+		// TPositionModuleStatus fields.
+		EModuleStatusDevice,		/**	TPositionModuleStatus.iDeviceStatus, TDeviceStatus */
+		EModuleStatusDataQuality	/** TPositionModuleStatus.iDataQualityStatus, TDataQualityStatus */
+	};
+
+	static CModuleStatusConfigReader* NewL(const TDesC &aConfigFileName, const TDesC& aConfigSection, TPositionModuleStatus& aModuleStatus);
+
+protected:
+	/** Converts a string to a TPositionModuleStatus::TDeviceStatus enum value. */
+	void ExtractValueDevice(const TPtrC8& aField, TPositionModuleStatus::TDeviceStatus& aValue);
+	
+	/** Converts a string to a TPositionModuleStatus::TDataQualityStatus enum value. */
+	void ExtractValueDataQuality(const TPtrC8& aField, TPositionModuleStatus::TDataQualityStatus& aValue);
+
+	/** See CConfigReaderBase for comments. */
+	void HandleSentenceL();
+	void DefaultData();
+	void ExtractDataL();
+	
+private:
+	CModuleStatusConfigReader(const TDesC &aConfigFileName, const TDesC& aConfigSection, TPositionModuleStatus& aModuleStatus);
+
+	/** Reference to the module status data item to be setup. */
+	TPositionModuleStatus& iModuleStatus;
+	};
+
+
+
+/* and a class reader for module update options
+updateoptions,100,100,100,false
+interval,
+timeout
+maxage
+partialupdates
+*/
+
+class CUpdateOptsConfigReader : public CConfigReaderBase
+	{
+public:
+
+	enum TUpdateOptsFields
+		{
+		EUpdateOptsType = 0,	// Must be present, only 1 type 'updateoptions'
+
+		// TPositionUpdateOptions
+		EUpdateOptsInterval,		/**	TPositionUpdateOptions.iUpdateInterval, TTimeIntervalMicroSeconds */
+		EUpdateOptsTimeOut,			/** TPositionUpdateOptions.iUpdateTimeOut, TTimeIntervalMicroSeconds */
+		EUpdateOptsMaxAge,			/** TPositionUpdateOptions.iMaxUpdateAge, TTimeIntervalMicroSeconds */
+		EUpdateOptsPartialUpdates	/** TBool TPositionUpdateOptions.iAcceptPartialUpdates, TBool */
+	};
+
+
+	static CUpdateOptsConfigReader* NewL(const TDesC &aConfigFileName, const TDesC& aConfigSection, TPositionUpdateOptions& aUpdateOpts);
+
+protected:
+	/** Converts string to a TTimeIntervalMicroSeconds value. */
+	void ExtractValueL(const TPtrC8& aField, TTimeIntervalMicroSeconds& aValue);
+	
+	/** Converts string to a TBool value. */
+	void ExtractValue(const TPtrC8& aField, TBool& aValue);
+
+	void HandleSentenceL();
+
+	void DefaultData();
+	void ExtractDataL();
+	
+private:
+	CUpdateOptsConfigReader(const TDesC &aConfigFileName, const TDesC& aConfigSection, TPositionUpdateOptions& aUpdateOpts);
+
+	TPositionUpdateOptions& iUpdateOpts;
+	};
+
+/*
+ * Class reader for the expected modes in which the module is asked to run
+ */
+class CAgpsModuleModesConfigReader : public CConfigReaderBase
+	{
+private:
+	enum TModuleModesFields
+		{
+		EModuleModesType = 0,			// must be present and needs to be 'modulemodes'
+		EGpsModeField, 					// the GPS mode
+		EBegginingOfGpsOptionsArray		// where the array of gps options items starts
+		};
+public:
+	static CAgpsModuleModesConfigReader* NewL(const TDesC &aConfigFileName, const TDesC& aConfigSection, 
+					RPointerArray<TLbsGpsOptions>& aModuleModes);
+private:
+	CAgpsModuleModesConfigReader(const TDesC &aConfigFileName, const TDesC& aConfigSection, 
+					RPointerArray<TLbsGpsOptions>& aModuleModes);
+	void HandleSentenceL();
+	
+	void DefaultData();
+	void ExtractDataL();
+
+private:
+	RPointerArray<TLbsGpsOptions>& iModuleModes;
+	};
+
+/*
+ * Class reader for details of all clients making requests in a test
+ */
+class CClientDetailsConfigReader : public CConfigReaderBase
+	{
+public:
+	static CClientDetailsConfigReader* NewL(const TDesC &aConfigFileName, const TDesC& aConfigSection, 
+					RArray<TCTClientDetails>& aClientDetailsArray);
+private:
+	CClientDetailsConfigReader(const TDesC &aConfigFileName, const TDesC& aConfigSection, 
+					RArray<TCTClientDetails>& aClientDetailsArray);
+	void HandleSentenceL();
+	
+	void DefaultData();
+	void ExtractDataL();
+
+private:
+	RArray<TCTClientDetails>& iClientDetailsArray;
+	};
+#endif //__CT_LBS_CONFIG_READER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestutils/inc/ctlbstestlogger.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,88 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef LBS_TEST_LOGGER_H
+#define LBS_TEST_LOGGER_H
+
+//************************************************************************************************************
+#include <e32base.h>
+
+//-------------------------------------------------------------------------------	
+/** Enum for log txt priority
+Priorities 0 - 2 are for logging component internal events.
+Priority 3 is for logging major component events that may have a major influence on other components.
+Priorities 3 - 4 are for logging lbs system level events.
+@InternalTechnology
+@prototype
+*/
+enum TLogPriority
+	{
+	/** The lowest priority. Use for hex dump and other low priority information. */
+	ELogP0 = 0,
+	/** Use for method enter/exit logging. */
+	ELogP1 = 1,
+	/** Use for low priority, component internal event and data logging. */
+	ELogP2 = 2,
+	/** Use for important component events like timeouts, warnings and errors. */
+	ELogP3 = 3,
+	/** Use for IPC only. */
+	ELogP4 = 4,
+	/** The highest priority. Use only for really major user, network or hardware events.*/
+	ELogP5 = 5
+	};
+	
+/** Log entry type.
+@InternalTechnology
+@prototype
+*/
+enum TLogType
+	{
+	ELogNormal  = 0,
+	ELogWarning = 1,
+	ELogError 	= 2
+	};
+	
+//-------------------------------------------------------------------------------	
+/** Logger for development and debug purpose
+The log format will be
+
+Time			File name	Process Id	Log Priority			Log text
+[08:51:00.997500] [File Name] 	[Process Id] 	[Log Text Priority] 	Any Log text
+
+note the maximum buffer size limitation KLogBufferSize=150
+
+[File Name] see RProcess::FileName()
+[Process Id]see RProcess::Id() 
+[Log Text Priority]  - [P0]- [P5]
+
+@InternalTechnology
+@prototype
+*/
+class LbsTestLogger
+	{
+public:
+	
+	static void Write(TLogType aType, TLogPriority aPrior, TRefByValue<const TDesC16> aFmt, ...);
+	static void Write(TLogType aType, TLogPriority aPrior, TRefByValue<const TDesC8> aFmt, ...);
+	
+	static void HexDump(TLogPriority aPrior, const TUint8 *aPtr, TInt aLen);
+	
+private:
+	static void CreateLogDir();
+	static void CreateLogTxt(TLogType aType, TLogPriority aPrior, TDes16& aBuf);
+	static void CreateLogTxt(TLogType aType, TLogPriority aPrior, TDes8& aBuf);
+	}; 
+
+#endif //LBS_TEST_LOGGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestutils/inc/ctlbstestloggermacros.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,75 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef LBS_TEST_LOGGER_MACROS_H
+#define LBS_TEST_LOGGER_MACROS_H
+
+#include "ctlbstestlogger.h"
+
+#ifdef ENABLE_LBS_TEST_LOGGER
+	#define TESTLOG(L1,L2) 							LbsTestLogger::Write(ELogNormal, L1, _L(L2))
+	#define TESTLOG2(L1,L2,L3) 						LbsTestLogger::Write(ELogNormal, L1, _L(L2), L3)
+	#define TESTLOG3(L1,L2,L3,L4) 					LbsTestLogger::Write(ELogNormal, L1, _L(L2), L3, L4)
+	#define TESTLOG4(L1,L2,L3,L4,L5) 				LbsTestLogger::Write(ELogNormal, L1, _L(L2), L3, L4, L5)
+	#define TESTLOG5(L1,L2,L3,L4,L5,L6) 			LbsTestLogger::Write(ELogNormal, L1, _L(L2), L3, L4, L5, L6)
+	#define TESTLOG6(L1,L2,L3,L4,L5,L6,L7)			LbsTestLogger::Write(ELogNormal, L1, _L(L2), L3, L4, L5, L6, L7)
+	#define TESTLOG7(L1,L2,L3,L4,L5,L6,L7,L8)		LbsTestLogger::Write(ELogNormal, L1, _L(L2), L3, L4, L5, L6, L7, L8)
+	#define TESTLOG8(L1,L2,L3,L4,L5,L6,L7,L8,L9)	LbsTestLogger::Write(ELogNormal, L1, _L(L2), L3, L4, L5, L6, L7, L8, L9)	
+	#define TESTLOGHEX(L1,L2,L3)					LbsTestLogger::HexDump(L1,L2,L3)
+
+
+	
+	
+	#define TESTLOG_ERR(L1,L2) 					LbsTestLogger::Write(ELogError, L1, _L(L2))
+	#define TESTLOG_ERR2(L1,L2,L3) 				LbsTestLogger::Write(ELogError, L1, _L(L2), L3)
+	#define TESTLOG_ERR3(L1,L2,L3,L4) 			LbsTestLogger::Write(ELogError, L1, _L(L2), L3, L4)
+	#define TESTLOG_ERR4(L1,L2,L3,L4,L5) 		LbsTestLogger::Write(ELogError, L1, _L(L2), L3, L4, L5)
+	#define TESTLOG_ERR5(L1,L2,L3,L4,L5,L6) 	LbsTestLogger::Write(ELogError, L1, _L(L2), L3, L4, L5, L6)
+	#define TESTLOG_ERR6(L1,L2,L3,L4,L5,L6,L7)	LbsTestLogger::Write(ELogError, L1, _L(L2), L3, L4, L5, L6, L7)
+
+	#define TESTLOG_WARN(L1,L2) 				LbsTestLogger::Write(ELogWarning, L1, _L(L2))
+	#define TESTLOG_WARN2(L1,L2,L3) 			LbsTestLogger::Write(ELogWarning, L1, _L(L2), L3)
+	#define TESTLOG_WARN3(L1,L2,L3,L4) 			LbsTestLogger::Write(ELogWarning, L1, _L(L2), L3, L4)
+	#define TESTLOG_WARN4(L1,L2,L3,L4,L5) 		LbsTestLogger::Write(ELogWarning, L1, _L(L2), L3, L4, L5)
+	#define TESTLOG_WARN5(L1,L2,L3,L4,L5,L6) 	LbsTestLogger::Write(ELogWarning, L1, _L(L2), L3, L4, L5, L6)
+	#define TESTLOG_WARN6(L1,L2,L3,L4,L5,L6,L7)	LbsTestLogger::Write(ELogWarning, L1, _L(L2), L3, L4, L5, L6, L7)
+#else
+	#define TESTLOG(L1,L2)
+	#define TESTLOG2(L1,L2,L3)
+	#define TESTLOG3(L1,L2,L3,L4)
+	#define TESTLOG4(L1,L2,L3,L4,L5)
+	#define TESTLOG5(L1,L2,L3,L4,L5,L6)
+	#define TESTLOG6(L1,L2,L3,L4,L5,L6,L7)
+	#define TESTLOG7(L1,L2,L3,L4,L5,L6,L7,L8)	
+	#define TESTLOG8(L1,L2,L3,L4,L5,L6,L7,L8,L9)
+	
+	#define TESTLOGHEX(L1,L2,L3)
+	
+	#define TESTLOG_ERR(L1,L2)
+	#define TESTLOG_ERR2(L1,L2,L3)
+	#define TESTLOG_ERR3(L1,L2,L3,L4)
+	#define TESTLOG_ERR4(L1,L2,L3,L4,L5)
+	#define TESTLOG_ERR5(L1,L2,L3,L4,L5,L6)
+	#define TESTLOG_ERR6(L1,L2,L3,L4,L5,L6,L7)
+
+	#define TESTLOG_WARN(L1,L2)
+	#define TESTLOG_WARN2(L1,L2,L3)
+	#define TESTLOG_WARN3(L1,L2,L3,L4)
+	#define TESTLOG_WARN4(L1,L2,L3,L4,L5)
+	#define TESTLOG_WARN5(L1,L2,L3,L4,L5,L6)
+	#define TESTLOG_WARN6(L1,L2,L3,L4,L5,L6,L7)
+#endif // ENABLE_LBS_TEST_TESTLOGGER
+
+#endif //LBS_TEST_LOGGER_MACROS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestutils/inc/ctlbstimerutils.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,62 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbstimerutils.h
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#ifndef __CT_LBS_TIMER_UTILS_H__
+#define __CT_LBS_TIMER_UTILS_H__
+
+#include <e32base.h>
+
+class MT_LbsTimerUtilsObserver
+	{
+public:
+	virtual void HandleTimerL(TInt aTimerId, const TTime& aTargetTime) = 0;
+	};
+
+
+class CT_LbsTimerUtils : public CTimer
+	{
+public:
+	IMPORT_C static CT_LbsTimerUtils* NewL(MT_LbsTimerUtilsObserver* aObserver, TInt aTimerId);
+	
+	IMPORT_C ~CT_LbsTimerUtils();
+	
+	IMPORT_C void SetTimer(const TTimeIntervalMicroSeconds32 aPeriod);
+	IMPORT_C void SetTimer(const TTime& aUtcTargetTime);
+
+	IMPORT_C void CancelTimer();
+
+protected:
+	CT_LbsTimerUtils(MT_LbsTimerUtilsObserver* aObserver, TInt aTimerId);
+	void ConstructL();
+	
+	void RunL();
+	
+private:
+	MT_LbsTimerUtilsObserver* iObserver;
+	TInt  iTimerId;
+	TTime iTargetTime;
+	};
+
+#endif //__CT_LBS_TIMER_UTILS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestutils/inc/tlbsutils.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,404 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file tlbsutils.h
+// This is the header file which contains the common utility functions
+// 
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @test
+*/
+
+#ifndef __T_LBS_UTILS_H__
+#define __T_LBS_UTILS_H__
+
+
+// Epoc includes
+#include <e32cmn.h>
+
+// LBS includes
+#include <lbs.h>
+#include <lbscommon.h>
+#include <lbspositioninfo.h>
+#include <lbs/lbsassistancereferencetime.h>
+#include <lbsclasstypes.h>
+#include <lbs/lbsadmin.h>
+#include <lbssatellite.h>
+#include <lbs/lbsgpsmeasurement.h>
+#include <lbs/lbslocdatasourcegpsbase.h>
+
+// Forward Declaration
+
+// Includes for Log Comparison
+#include <lbs/lbslogevent.h>
+#include <lbs/lbsselflocatelogevent.h>
+#include <lbs/lbsexternallocatelogevent.h>
+#include <lbs/lbstransmitlocationlogevent.h>
+#include <lbs/lbsnetworklocatelogevent.h>
+#include <lbs/lbsassistancedatalogevent.h>
+
+
+
+
+// Property Keys
+enum TLbsTestPropertyKeys
+	{
+	ELbsTestAGpsModuleIn = 1301,
+	ELbsTestAGpsModuleOut = 2301,
+	ELbsTestClockPluginOut = 3301,
+	ELbsTestAGpsModuleModeChanges = 4301,
+	ELbsTestAGpsModuleResetAssistanceDataFlag = 5301
+	};
+
+enum KLbsTestAGpsModuleResetAssistanceDataStates
+	{
+	ELbsTestAGpsResetAssistanceDataNotReceived,
+	ELbsTestAGpsResetAssistanceDataReceived
+	};
+
+
+const TInt KMaxModuleDataBusIniFileName = 100;
+
+// assistance data providers:
+const TInt KSimpleAssistanceDataProviderPluginUidValue = 0x10281D77;
+const TInt KSuplAssistanceDataProviderPluginUidValue = 0x1028225B;
+
+
+/** Update structure to hold both measurement and position (location) information.
+*/
+class TLbsModuleUpdateItem
+	{
+public:
+	IMPORT_C TLbsModuleUpdateItem();
+	
+	IMPORT_C const TPositionSatelliteInfo& Position() const;
+	IMPORT_C const TPositionGpsMeasurementInfo& Measurement() const;
+	IMPORT_C TInt Error() const;
+	IMPORT_C TInt Delay() const;
+	
+	IMPORT_C void SetPosition(const TPositionSatelliteInfo& aReport);
+	IMPORT_C void SetMeasurement(const TPositionGpsMeasurementInfo& aMeasurement);
+	IMPORT_C void SetError(TInt aError);
+	IMPORT_C void SetDelay(TInt aDelay);
+	
+
+protected:	
+	TPositionSatelliteInfo		iPosition;
+	TPositionGpsMeasurementInfo	iMeasurement;
+	TInt						iError;
+	TInt						iDelay;
+	};
+
+
+
+// Passing data to test module.
+class TModuleDataIn
+	{
+public:
+	/** Supported request types. */
+	enum TModuleRequestType
+		{
+		EModuleRequestConfig,
+		EModuleRequestEventKickOff,
+		EModuleRequestTestMode,
+		EModuleRequestTimeOut,
+		EModuleRequestError,
+		EModuleRequestTimeStampOffset,
+		EModuleRequestOptionsChangeReportMode
+		};
+	TModuleRequestType iRequestType;
+
+	
+	/** Config request data. */
+	TBuf<KMaxModuleDataBusIniFileName>	iConfigFileName;
+	TBuf<40>							iConfigSection;	// bug if you make it bigger, more data we add, we get a -9 buf overflow on the property read
+
+	
+	/** Event kick off request data. */
+	enum _TKickOffEventType
+		{
+		EKickOffEventTypeDevice=0x01, 
+		EKickOffEventTypeDataQuality=0x02
+		};	
+	typedef TUint TKickOffEventType;
+	TKickOffEventType iKickOffEventType;
+
+	
+	/** Assistance event data. */
+	enum TAssDataEventType
+		{	
+		EAssDataEventExpectSingle,
+		EAssDataEventExpectMultiple
+		};
+	TAssDataEventType iAssDataEventType;	
+
+
+	/** Module test mode. */
+	enum TTestMode	
+		{
+		EModuleTestModeAssDataOff,
+		EModuleTestModeAssDataOn,
+		EModuleTestModeAssDataOn_TimeStamp,
+		EModuleTestModeAssDataOn_Cancel_Stage1,
+		EModuleTestModeAssDataOn_Cancel_Stage2,
+		EModuleTestModeAssDataOn_Unsolicited,
+		EModuleTestModeAssDataOn_NoNetwork,
+		EModuleTestModeAssDataOn_DataNotAvailable,
+		EModuleTestModeAssDataOn_SomeDataNotAvailable,
+		EModuleTestModeAssDataOn_InvalidDataRequest,
+		EModuleTestModeAssDataOn_InvalidDataGet,
+		EModuleTestModeAssDataOn_EarlyPosUpdates
+		};
+	TTestMode iAssDataTestMode;
+
+	enum TGpsOptionsChangeReportMode
+		{
+		EGpsModuleDoReportOptionsChange,
+		EGpsModuleDoNotReportOptionsChange,
+		};
+	TGpsOptionsChangeReportMode iOptionsChangeReportMode;
+
+	/** Module time out. */
+	TTimeIntervalMicroSeconds iTimeOut;
+	
+	/** Module Error Code */
+	TInt iError;
+
+	/** Used to alter the time stamp of the posinfo. */
+	TTimeIntervalMicroSeconds iTimeStampOffset;
+	};
+
+
+// Retriving data from the test module.
+class TModuleDataOut 
+	{
+public:
+	
+	enum TModuleRequestType
+		{
+		EModuleResponse,
+		EModuleGpsMode,
+		};
+	TModuleRequestType iRequestType;
+
+    enum TModuleResponseType
+		{
+		EModuleResponseOk,
+		EModuleAssDataRequestedOk,
+		EModuleAssDataOk,
+		EModuleAssDataCancelledOk, // may not be possible to verify from within module, hence may remove
+		EModuleStartupOk,
+		EModuleShutdownOk,
+		EModuleErr	/** Set if any of the above failed. */
+		};
+
+	TModuleResponseType iResponse;
+    CLbsAdmin::TGpsMode iGpsMode; /** Used to retrive GPS mode from the module. */
+	};	
+
+
+// Retriving data from the test clock plugin.
+class TClockPluginDataOut
+	{
+public:
+	enum TClockPluginResponseType
+		{
+		EClockPluginResponseOk,
+		EClockPluginErr	/** Set if any of the above failed. */
+		};
+
+	TClockPluginResponseType iResponse;
+	};
+
+
+
+// Assistance Data Simple Provider Default values.
+const TUint KAssistanceData_RefTime_Week = 12;
+const TUint KAssistanceData_RefTime_Tow1MSec = 567;
+
+// Module Info values
+/*
+ * the A-GPS value are from testproduct\agpsmodule\group\xtestmodule.ini
+ * most the AGPS module module info are the same as the LbsLocDataSourcePlugins\sirf\group\sirfdatasource.ini
+ * except "Module name", "Version", "ClassesSupported", "DataSourceId"
+ */
+//Module ID
+#define APGS_MODINFO_MODULE_ID      			271064388
+#define NETWORK_MODINFO_MODULE_ID   			271064387 
+//Module name   
+#define AGPS_MODINFO_MOD_NAME                  	_L("TEST_Loc_AGPS_Module")
+#define NETWORK_MODINFO_MOD_NAME               	_L("NetLocManager")
+//
+#define AGPS_MODINFO_IS_AVAILABLE			    (ETrue)
+#define NETWORK_MODINFO_IS_AVAILABLE			(ETrue)
+//Technology type
+#define AGPS_MODINFO_TECHNOLOGY_TYPE            (TPositionModuleInfo::TTechnologyType(TPositionModuleInfo::ETechnologyTerminal | \
+																					  TPositionModuleInfo::ETechnologyAssisted))
+#define NETWORK_MODINFO_TECHNOLOGY_TYPE         (TPositionModuleInfo::TTechnologyType(TPositionModuleInfo::ETechnologyNetwork))
+//version
+#define AGPS_MODINFO_VERSION                    (TVersion(1,2,3))
+#define NETWORK_MODINFO_VERSION                 (TVersion(0,1,1))
+//device location
+#define AGPS_MODINFO_DEVICE_LOCATION            (TPositionModuleInfo::TDeviceLocation(TPositionModuleInfo::EDeviceInternal))
+#define NETWORK_MODINFO_DEVICE_LOCATION         (TPositionModuleInfo::TDeviceLocation(TPositionModuleInfo::EDeviceExternal))
+//capabilities
+#define AGPS_MODINFO_CAPABILITIES 				(TPositionModuleInfo::TCapabilities(TPositionModuleInfo::ECapabilityHorizontal | \
+																					TPositionModuleInfo::ECapabilityVertical | \
+																					TPositionModuleInfo::ECapabilitySpeed | \
+																					TPositionModuleInfo::ECapabilityDirection | \
+																					TPositionModuleInfo::ECapabilitySatellite))
+#define NETWORK_MODINFO_CAPABILITIES			(TPositionModuleInfo::TCapabilities(TPositionModuleInfo::ECapabilityHorizontal| \
+																					TPositionModuleInfo::ECapabilityVertical | \
+																					TPositionModuleInfo::ECapabilitySpeed | \
+																					TPositionModuleInfo::ECapabilityDirection))
+//classes supported
+#define AGPS_MODINFO_CLASSES_SUPPORTED_POSITION_FAMILY 		(EPositionInfoClass|EPositionGenericInfoClass| \
+															 EPositionCourseInfoClass|EPositionSatelliteInfoClass)
+#define NETWORK_MODINFO_CLASSES_SUPPORTED_POSITION_FAMILY 	(EPositionInfoClass|EPositionGenericInfoClass| \
+															 EPositionCourseInfoClass|EPositionSatelliteInfoClass)
+//time to first fix
+#define AGPS_MODINFO_TIME_TO_FIRST_FIX         (TTimeIntervalMicroSeconds(90000000))
+#define NETWORK_MODINFO_TIME_TO_FIRST_FIX      (TTimeIntervalMicroSeconds(20000000))
+//time to next fix
+#define AGPS_MODINFO_TIME_TO_NEXT_FIX          (TTimeIntervalMicroSeconds(1000000))
+#define NETWORK_MODINFO_TIME_TO_NEXT_FIX       (TTimeIntervalMicroSeconds(20000000))
+//horizontal accuracy
+#define AGPS_MODINFO_HORIZONTAL_ACCURACY       5.4f
+#define NETWORK_MODINFO_HORIZONTAL_ACCURACY    100.0f
+//vertical accuracy
+#define AGPS_MODINFO_VERTICAL_ACCURACY         5.4f
+#define NETWORK_MODINFO_VERTICAL_ACCURACY      100.0f
+//cost indication
+#define AGPS_MODINFO_COST_INDICATOR            (TPositionQuality::ECostPossible)
+#define NETWORK_MODINFO_COST_INDICATOR         (TPositionQuality::ECostCharge)
+//power consumption
+#define AGPS_MODINFO_POWER_CONSUMPTION         (TPositionQuality::EPowerLow)
+#define NETWORK_MODINFO_POWER_CONSUMPTION      (TPositionQuality::EPowerLow)
+
+/**
+ Current LBS system has two positioning module: A-GPS and Network Loc manager
+ This value might be changed if more positioning modules are added in the future
+*/
+#define MAX_POSITIONING_MODULES					2
+
+class TCTClientDetails
+	{
+public:
+	inline TCTClientDetails()
+	: iSessionIdDelay(0), iSessionStepDelay(0), iCancelRequest(EFalse), iSessionIdCancel(0), iSessionStepCancel(0), iNumberOfNPUDs(1), iUpdateOptions(0)
+	{}
+public:
+	TInt iSessionIdDelay;
+	TInt iSessionStepDelay;
+	TBool iCancelRequest;
+	TInt iSessionIdCancel;
+	TInt iSessionStepCancel;	
+	TInt iNumberOfNPUDs;
+	TPositionUpdateOptions iUpdateOptions;
+	};
+
+// Implements a class to contain the utility functions.
+class T_LbsUtils
+	{	
+public:
+	enum TComparisonAccuracyType
+		{
+		ERoughAccuracy, EExactAccuracy
+		};
+
+	IMPORT_C T_LbsUtils();
+	IMPORT_C ~T_LbsUtils();
+
+	IMPORT_C void CreateTestPropertiesL();
+	// 
+	IMPORT_C void GetConfigured_ModuleInfoL(const TDesC& aConfigFileName, const TDesC& aConfigSection, TPositionModuleInfo& aModInfo);
+
+	IMPORT_C void GetConfigured_PosInfosL(const TDesC& aConfigFileName, const TDesC& aConfigSection, RPointerArray<TAny>& aPosInfoArr);
+	IMPORT_C void GetConfigured_UpdateArrayL(const TDesC& aConfigFileName, const TDesC& aConfigSection, RPointerArray<TLbsModuleUpdateItem>& aUpdateArr);
+	IMPORT_C void GetConfigured_ModuleStatusL(const TDesC& aConfigFileName, const TDesC& aConfigSection, TPositionModuleStatus& aModuleStatus);
+	IMPORT_C void GetConfigured_ModuleUpdateOptionsL(const TDesC& aConfigFileName, const TDesC& aConfigSection, TPositionUpdateOptions& aUpdateOpts);
+	IMPORT_C void GetConfigured_ClientDetailsL(const TDesC& aConfigFileName, const TDesC& aConfigSection, 
+									RArray<TCTClientDetails>& aClientDetailsArray);
+
+	IMPORT_C void GetExpected_ModuleModes(const TDesC& aConfigFileName, const TDesC& aConfigSection, RPointerArray<TLbsGpsOptions>& aModuleModes);
+
+	IMPORT_C void NotifyModuleOfConfigChangeL(const TModuleDataIn& aModuleDataIn);
+	IMPORT_C void WaitForModuleToRequestAssistanceDataL();
+
+	IMPORT_C TBool Compare_PosInfo(const TPositionInfoBase& aPosInfoSideA, const TPositionInfoBase& aPosInfoSideB);
+	IMPORT_C TBool Compare_PosInfo(const TPositionInfoBase& aPosInfoSideA, const TPositionInfoBase& aPosInfoSideB, TComparisonAccuracyType aCmpAccuracy);
+	 
+	IMPORT_C TBool Compare_PosInfoArr(RPointerArray<TAny>& aPosInfoArrSideA, RPointerArray<TAny>& aPosInfoArrSideB);
+	IMPORT_C TBool Compare_PosInfoArr(RPointerArray<TAny>& aPosInfoArrSideA, RPointerArray<TAny>& aPosInfoArrSideB, TComparisonAccuracyType aCmpAccuracy);
+
+	IMPORT_C void ResetAndDestroy_PosInfoArr(RPointerArray<TAny>& aPosInfoArr);
+	
+	IMPORT_C TPositionModuleId GetNetworkModuleIdL(RPositionServer& aServer);
+	IMPORT_C TPositionModuleId GetAGpsModuleIdL(RPositionServer& aServer);
+	IMPORT_C TPositionModuleId GetBadModuleId();
+	
+	IMPORT_C TBool Compare_ModuleInfo(TPositionModuleInfo& aModInfoSideA, TPositionModuleInfo& aModInfoSideB);
+	IMPORT_C TBool Compare_PositionQuality(TPositionQuality& aQualitySideA, TPositionQuality& aQualitySideB);
+	IMPORT_C TBool Compare_ModuleStatus(TPositionModuleStatus& aModStatusSideA, TPositionModuleStatus& aModStatusSideB);
+	IMPORT_C TBool Compare_ModuleUpdateOptions(TPositionUpdateOptions& aModUpdateOptsSideA, TPositionUpdateOptions& aModUpdateOptsSideB);
+	IMPORT_C TBool Verify_PositionIsValid(TPositionInfo& aPosInfo);
+
+	// Assistance data functions
+	// IMPORT_C void CreateSimpleAssistanceData(/*TLbsAssistanceDataGroup aDataMask, RDataReaderRootBase& aGpsRefTimeReader*/);
+	IMPORT_C TBool VerifySimpleAssistanceData(RUEPositioningGpsReferenceTimeReader& aGpsRefTimeReader);
+    IMPORT_C void  Create_ModuleInfoL(TPositionModuleId aModuleId, TPositionModuleInfo& aModInfo);
+
+
+	IMPORT_C TBool Compare_LogBase(const CLbsLogEvent& aLogEventSideA, const CLbsLogEvent& aLogEventSideB);
+	IMPORT_C TBool Compare_SelfLocateLog(const CLbsSelfLocateLogEvent& aSelfLocateLogSideA, const CLbsSelfLocateLogEvent& aSelfLocateLogB);
+	IMPORT_C TBool Compare_NetworkLocateLog(const CLbsNetworkLocateLogEvent& aNetworkLocateLogSideA, const CLbsNetworkLocateLogEvent& aNetworkLocateLogB);
+	IMPORT_C TBool Compare_ExternalLocateLog(const CLbsExternalLocateLogEvent& aExternalLocateLogSideA, const CLbsExternalLocateLogEvent& aExternalLocateLogSideB);
+	IMPORT_C TBool Compare_TransmitLocationLog(const CLbsTransmitLocationLogEvent& aX3PLogSideA, const CLbsTransmitLocationLogEvent& aX3PLogSideB);
+	IMPORT_C TBool Compare_AssistanceDataLog(const CLbsAssistanceDataLogEvent& aAssistanceDataLogSideA, const CLbsAssistanceDataLogEvent& aAssistanceDataLogSideB);
+	
+	// Needed to compare destinations within TransmitLocation Logs
+	TBool Compare_Destinations(TDesC16& aDestinationFromRealLog, TDesC16& aDestinationFromExpectedLog);
+	
+
+	IMPORT_C TInt SupportedType(const TUint32& aType, const TInt& aSize);
+	IMPORT_C TInt CopyPositionTypes(TPositionInfoBase& aTo, const TPositionInfoBase& aFrom);
+
+private:
+	TInt GetModIdByTechnology(RPositionServer& aServer, TPositionModuleInfo::TTechnologyType aTechnologyType, TPositionModuleId& aModuleId);
+	// Needed to compare external locate logs.
+	TBool Compare_ExternalRequestPrivacyRequestParams(const TLbsLoggingPrivacyRequestParams& aLogPrivacyRequestParamsSideA, const TLbsLoggingPrivacyRequestParams& aLogPrivacyRequestParamsSideB);
+	TBool Compare_ExternalRequestPrivacyResponseParams(const TLbsLoggingPrivacyResponseParams& aExternalRequestPrivacyResponseSideA, const TLbsLoggingPrivacyResponseParams& aExternalRequestPrivacyResponseSideB);
+	TBool Compare_ExternalRequestInfo(const TLbsExternalRequestInfo& aExternalRequestInfoSideA, const TLbsExternalRequestInfo& aExternalRequestInfoSideB);
+	TBool Compare_ExternalRequestPrivacy(const TLbsNetPosRequestPrivacy& aExternalRequestPrivacySideA, const TLbsNetPosRequestPrivacy& aExternalRequestPrivacySideB);
+	};
+
+
+/** Possible set of Module options. 
+	Held by AGps Hybrid module as bits in a 32 bitmap.
+*/
+enum TLbsHybridModuleOptions
+{
+	EHybridModuleOptions_ClearAll = 0x0000,
+	ELbsHybridModuleOptions_AssistanceDataOn = 0x0001,
+	ELbsHybridModuleOptions_MultiUpdatesOn = 0x0002,
+	ELbsHybridModuleOptions_DisableReqAssistData = 0x0004,
+	ELbsHybridModuleOptions_DynamicAssistanceData = 0x008,	//Assistance Data delivery variant used in SUPL tests
+	ELbsHybridModuleOptions_SetAll = 0x000F
+};
+
+#endif //__T_LBS_UTILS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestutils/src/ctdumper.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,69 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <flogger.h>
+#include <ctdumper.h>
+
+const TInt KLbsDevLogMaxBufSize = 150;
+_LIT(KLbsDevLogFolder, "refFiles");
+_LIT(KLbsDevLogFile,"gpsUpdates.txt");
+
+
+/** Static function, overwrites de log file if it already exists.
+@internalTechnology
+@prototype
+*/
+EXPORT_C void CT_Dumper::OverWrite()
+	{
+	RFileLogger logger;
+	TInt err = logger.Connect();
+	
+	if (err == KErrNone)
+		{
+		logger.CreateLog(KLbsDevLogFolder, KLbsDevLogFile, EFileLoggingModeOverwrite);
+		}
+		
+	logger.Close();
+	}
+
+
+/** Static function, one parameter
+@param aFmt TDes string reference 
+@internalTechnology
+@prototype
+*/
+EXPORT_C void CT_Dumper::Write(TRefByValue<const TDesC16> aFmt, ...)
+	{
+	RFileLogger logger;
+	TInt err = logger.Connect();
+	
+	if (err == KErrNone)
+		{
+		VA_LIST list;
+		VA_START(list, aFmt);
+		TBuf16<KLbsDevLogMaxBufSize> strList;
+		strList.FormatList(aFmt, list);
+		VA_END(list);
+		TBuf16<KLbsDevLogMaxBufSize> txt;
+		
+		txt.Append(strList);
+
+		logger.CreateLog(KLbsDevLogFolder, KLbsDevLogFile, EFileLoggingModeAppend);
+		logger.SetDateAndTime(EFalse, EFalse);
+		logger.Write(txt);		
+		}
+		
+	logger.Close();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestutils/src/ctlbsagpshandler.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,170 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Implementation of Test Harness request handler component.
+// 
+//
+
+
+#include <e32base.h>
+#include "ctlbsagpshandler.h"
+
+const TInt KBufferedMsgMaxCount = 6;
+
+CT_LbsAGpsHandler::CT_LbsAGpsHandler(MT_ResponseObserver* aObserver) : 
+	CActive(EPriorityStandard),
+	iObserver(aObserver)
+	{
+	}
+	
+CT_LbsAGpsHandler::~CT_LbsAGpsHandler()
+	{
+	Cancel();
+	iTHChannel.Close();
+	iMsgBuffer.ResetAndDestroy();
+	}
+
+EXPORT_C CT_LbsAGpsHandler* CT_LbsAGpsHandler::NewL(MT_ResponseObserver* aObserver)
+	{
+	CT_LbsAGpsHandler* self = new (ELeave) CT_LbsAGpsHandler(aObserver);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+	
+void CT_LbsAGpsHandler::ConstructL()
+	{
+    RT_LbsChannel::InitializeL(RT_LbsChannel::EChannelTH2TAGPS);
+	iMsgBuffer.ReserveL(KBufferedMsgMaxCount);
+	iTHChannel.OpenL(RT_LbsChannel::EChannelTH2TAGPS, *this);
+	CActiveScheduler::Add(this);
+	}
+
+EXPORT_C void CT_LbsAGpsHandler::SendRequestUpdateInitMsg(const TDesC& aConfigFileName, 
+												 		  const TDesC& aConfigSection)
+	{
+  	TT_LbsAGpsRequestUpdateInitMsg* aMsg = new TT_LbsAGpsRequestUpdateInitMsg(aConfigFileName, aConfigSection);
+ 	 	
+ 	BufferMessage(aMsg);		
+	}
+
+EXPORT_C void CT_LbsAGpsHandler::SendRequestTimeOutMsg(const TTimeIntervalMicroSeconds& aTimeOut) 
+	{
+ 	TT_LbsAGpsRequestTimeOut* aMsg = new TT_LbsAGpsRequestTimeOut(aTimeOut);
+ 	 	
+ 	BufferMessage(aMsg);		
+	}
+
+EXPORT_C void CT_LbsAGpsHandler::SendRequestSetAllModuleOptions()
+	{
+ 	TT_LbsAGpsRequestOptions* aMsg = new TT_LbsAGpsRequestOptions(ELbsHybridModuleOptions_SetAll);
+	 	
+ 	BufferMessage(aMsg);		
+	}	
+
+EXPORT_C void CT_LbsAGpsHandler::SendRequestClearAllModuleOptions()
+	{
+ 	TT_LbsAGpsRequestOptions* aMsg = new TT_LbsAGpsRequestOptions(EHybridModuleOptions_ClearAll);
+	 	
+ 	BufferMessage(aMsg);		
+	}
+	
+EXPORT_C void CT_LbsAGpsHandler::SendRequestModuleOption(TLbsHybridModuleOptions aOption, TBool aValue)
+	{
+ 	TT_LbsAGpsRequestOptions* aMsg = new TT_LbsAGpsRequestOptions(aOption, aValue);
+ 	 	
+ 	BufferMessage(aMsg);	
+	}
+
+EXPORT_C void CT_LbsAGpsHandler::SendRequestForcedUpdate()
+	{
+	TT_LbsAGpsRequestForcedUpdate* msg = new TT_LbsAGpsRequestForcedUpdate();
+ 	 	
+ 	BufferMessage(msg);
+	}
+	
+EXPORT_C void CT_LbsAGpsHandler::SendRequestError(TInt aError)
+	{
+ 	TT_LbsAGpsRequestError* aMsg = new TT_LbsAGpsRequestError(aError);
+ 	 	
+ 	BufferMessage(aMsg);		
+	}
+
+
+void CT_LbsAGpsHandler::RunL()
+	{
+	User::LeaveIfError(iStatus.Int());
+	
+	if (iMsgBuffer.Count() > 0)
+		{	
+		SendRequestMessage(iMsgBuffer[0]);
+		iMsgBuffer.Remove(0);
+		}
+	}
+
+void CT_LbsAGpsHandler::DoCancel()
+	{
+	iTHChannel.CancelSendMessageNotification();
+	}
+	
+TInt CT_LbsAGpsHandler::RunError(TInt aError)
+	{
+	return aError;
+	}
+
+void CT_LbsAGpsHandler::SendRequestMessage(const TT_LbsMsgBase* aMessage)
+	{
+	iTHChannel.SendMessage(*aMessage, iStatus);
+	// The msg has now been sent to the channel. We can now delete it.
+	delete(aMessage);
+	SetActive();
+	}
+	
+void CT_LbsAGpsHandler::BufferMessage(const TT_LbsMsgBase* aMessage)
+	{	
+	if (!IsActive())
+		{
+		// The AO is not active, so there should be no buffered messages.
+		__ASSERT_DEBUG(iMsgBuffer.Count() == 0, User::Invariant());
+		
+		// Immediately send the new message.
+		SendRequestMessage(aMessage);
+		}
+	else
+		{
+		__ASSERT_ALWAYS(iMsgBuffer.Count() < KBufferedMsgMaxCount, User::Invariant());
+
+		// Still waiting for acknowledgement that a previous message
+		// was read, so buffer this new message.
+		iMsgBuffer.Append(aMessage);
+		}
+	}				
+
+void CT_LbsAGpsHandler::ProcessChannelMessage(RT_LbsChannel::TT_LbsChannelId /*aChannelId*/, 
+												 const TT_LbsMsgBase& aMessage)
+	{
+
+	switch (aMessage.Type())
+		{
+		case TT_LbsMsgBase::EModuleResponse:
+			{
+			const TT_LbsAGpsResponseMsg& msg = static_cast<const TT_LbsAGpsResponseMsg&>(aMessage);
+			iObserver->ProcessAGpsResponseMessage(msg.ResponseType());
+			break;
+			}
+		default:
+			//LBSLOG_ERR2(ELogP2, "Unexpected message type: %d \n", aMessage.Type());
+			break;
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestutils/src/ctlbsagpsmoduleeventlistener.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,67 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+#include "ctlbsagpsmoduleeventlistener.h"
+
+EXPORT_C CT_AgpsModuleEventListener* CT_AgpsModuleEventListener::NewL(MT_AgpsModuleEventHandler& aHandler)
+	{
+	CT_AgpsModuleEventListener* self = new(ELeave) CT_AgpsModuleEventListener(aHandler);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+EXPORT_C CT_AgpsModuleEventListener::~CT_AgpsModuleEventListener()
+	{
+	Cancel();
+	iModeChangesProperty.Close();
+	}
+
+CT_AgpsModuleEventListener::CT_AgpsModuleEventListener(MT_AgpsModuleEventHandler& aHandler)
+	: CActive(EPriorityHigh), iHandler(aHandler)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+void CT_AgpsModuleEventListener::ConstructL()
+	{
+	User::LeaveIfError(iModeChangesProperty.Attach(KUidSystemCategory, ELbsTestAGpsModuleModeChanges));
+	iModeChangesProperty.Subscribe(iStatus);
+	SetActive();
+	}
+
+void CT_AgpsModuleEventListener::RunL()
+	{
+	TInt err = iStatus.Int();
+	iModeChangesProperty.Subscribe(iStatus);
+	SetActive();
+	if(KErrNone == err)
+		{
+		TLbsGpsOptionsArray options;
+		TPckg<TLbsGpsOptionsArray> pckgOptions(options);
+		err = iModeChangesProperty.Get(pckgOptions);
+		if(KErrNone == err)
+			{
+			iHandler.OnSetGpsOptions(options);
+			}
+		}
+	}
+
+void CT_AgpsModuleEventListener::DoCancel()
+	{
+	iModeChangesProperty.Cancel();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestutils/src/ctlbsasyncwaiter.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,129 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsasyncwaiter.cpp
+// 
+//
+
+// User includes
+#include "ctlbsasyncwaiter.h"
+
+
+/**
+  Function : NewL
+  Description : Creates an object of CT_LbsAsyncWaiter
+  @internalTechnology
+  @param :
+  @return : N/A
+  @precondition : none
+  @postcondition : none
+*/
+EXPORT_C CT_LbsAsyncWaiter* CT_LbsAsyncWaiter::NewL()
+	{
+	CT_LbsAsyncWaiter* self = new(ELeave) CT_LbsAsyncWaiter();
+	return self;
+	}
+
+	
+/**
+  Function : CT_LbsAsyncWaiter
+  Description : Constructor
+  @internalTechnology
+  @param :
+  @return : N/A
+  @precondition : none
+  @postcondition : none
+*/
+CT_LbsAsyncWaiter::CT_LbsAsyncWaiter() : CActive(EPriorityStandard)
+	{
+	CActiveScheduler::Add(this);
+	}	
+
+
+/**
+  Function : CT_LbsAsyncWaiter
+  Description : Destructor
+  @internalTechnology
+  @param :
+  @return : N/A
+  @precondition : none
+  @postcondition : none
+*/
+CT_LbsAsyncWaiter::~CT_LbsAsyncWaiter()
+	{
+	Cancel();
+	}
+
+	
+/**
+  Function : StartAndWait
+  Description : Starts the Active scheduler
+  @internalTechnology
+  @param :
+  @return : N/A
+  @precondition : none
+  @postcondition : none
+*/
+EXPORT_C void CT_LbsAsyncWaiter::StartAndWait()
+	{
+	SetActive();
+	iError = iStatus.Int();
+	CActiveScheduler::Start();
+	}
+	
+	
+/**
+  Function : Result
+  Description : Gives the error
+  @internalTechnology
+  @param :
+  @return : N/A
+  @precondition : none
+  @postcondition : none
+*/
+EXPORT_C TInt CT_LbsAsyncWaiter::Result() const
+	{
+	return iError;
+	}
+	
+	
+/**
+  Function : RunL
+  Description : 
+  @internalTechnology
+  @param :
+  @return : N/A
+  @precondition : none
+  @postcondition : none
+*/
+void CT_LbsAsyncWaiter::RunL()
+	{
+	iError = iStatus.Int();
+	CActiveScheduler::Stop();
+	}
+
+	
+/**
+  Function : DoCancel
+  Description : 
+  @internalTechnology
+  @param :
+  @return : N/A
+  @precondition : none
+  @postcondition : none
+*/
+void CT_LbsAsyncWaiter::DoCancel()
+	{
+	iError = KErrCancel;
+	CActiveScheduler::Stop();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestutils/src/ctlbsconfigreader.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1027 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbsconfigreader.cpp
+// This is the Cpp file which contains the ini file configuration reader classes
+// 
+//
+
+// User includes
+#include "ctlbsconfigreader.h"
+
+// Epoc includes
+#include <f32file.h>
+
+// Lbs includes
+#include <lbsclasstypes.h>
+#include <lbssatellite.h>
+
+// Literals Used
+_LIT8(KNotANumber, "nan");
+
+
+CConfigReaderBase::CConfigReaderBase(const TDesC& aConfigFileName, const TDesC& aConfigSection) : iConfigFileName(aConfigFileName), iConfigSection(aConfigSection)
+	{	
+	}
+
+
+CConfigReaderBase::~CConfigReaderBase()
+	{
+	}
+
+
+void CConfigReaderBase::AppendFieldChar(TUint aChar)
+	{
+	if (iSentence.Length() >= iSentence.MaxLength())
+		{
+		return;
+		}
+	
+	iSentence.Append(aChar);
+
+	// If aChar is not a field delimiter then just add it to buffer and return
+	if (aChar != ',' && aChar != '*')
+		{
+		iFieldLength++;
+		return;
+		}
+
+	// Got a field delimiter increase the number of fields
+	// aChar == ',' || aChar == '*'
+
+	TPtrC8 thisField = iSentence.Mid(iFieldStart, iFieldLength);
+	iFields[iNumFields].Set(thisField);
+	iNumFields++;
+
+	// Next field starts here
+	iFieldStart  = iSentence.Length();
+	iFieldLength = 0;
+	}
+
+
+void CConfigReaderBase::ProcessStringL(const TDesC8& aData)
+	{
+	TInt length = aData.Length();
+	
+	for (TInt index = 0; index < length; index++)
+		{
+		TUint ch = aData[index];
+
+		switch(iReadState)
+			{
+			// Keep reading until a section is found.
+			case EStartSection:
+				{
+				if (ch == '[')
+					{
+					iReadSection.SetLength(0);
+					iReadState = EProcessSection;
+					}
+				break;
+				}
+
+			// Found a section, keep reading until end of section found.
+			case EProcessSection:
+				{
+				// End of section, check if it's ours.
+				if (ch == ']')
+					{
+					// Need to convert from TBuf8 to TBuf for the comparision.
+					TBuf<KMaxSentence> cmpSection;
+					cmpSection.Copy(iReadSection);
+					
+					// Not our section.
+					if (iConfigSection.Compare(cmpSection) != 0)
+						{
+						iReadState = EStartSection;
+						}
+
+					// Is our section.
+					else
+						{					
+						iReadState = EStartSentence;
+						}
+					}
+				else
+					{
+					iReadSection.Append(ch);
+					}
+				break;
+				}
+				
+			case EStartSentence:
+				{
+				//
+				if (ch == '$')
+					{
+					iReadState = EProcessSentence;
+					iSentence.SetLength(0);
+					iNumFields   = 0;
+					iFieldStart  = 0;
+					iFieldLength = 0;
+					for (TInt i = 0; i < KMaxFields; i++)
+						{
+						iFields[i].Set(KNullDesC8);
+						}
+					}
+				
+				// If we find a section we know to stop reading sentences for our section
+				// and we let the other section be handled, but it will not match ours.
+				else if (ch == '[')
+					{
+					iReadSection.SetLength(0);
+					iReadState = EProcessSection;
+					}
+				
+				break;
+				}
+
+			case EProcessSentence:
+				{
+				AppendFieldChar(ch); // calling this don't you end up with a * in the field, does it matter
+				
+				if (ch == '*')
+					{
+					iReadState = EStartSentence;
+					HandleSentenceL();
+					}			
+				break;
+				}
+			}
+		}
+	}
+
+
+void CConfigReaderBase::ExtractValueL(const TPtrC8& aField, TInt& aValue)
+	{
+	if (aField.Length() != 0)
+		{
+		TLex8 lex(aField);
+		TInt err = lex.Val(aValue);
+		User::LeaveIfError(err);
+		}
+	}
+
+
+void CConfigReaderBase::ExtractValueL(const TPtrC8& aField, TReal32& aValue)
+	{
+	TRealX nan;
+	nan.SetNaN();
+	
+	aValue = nan;
+	
+	if (aField.Length() != 0)
+		{
+		if (aField.CompareF(KNotANumber))
+			{
+			TLex8 lex(aField);
+			TInt err = lex.Val(aValue);
+			User::LeaveIfError(err);
+			}
+		}
+	}
+
+
+void CConfigReaderBase::ExtractValueL(const TPtrC8& aField, TReal64& aValue)
+	{
+	TRealX nan;
+	nan.SetNaN();
+	
+	aValue = nan;
+	
+	if (aField.Length() != 0)
+		{
+		if (aField.CompareF(KNotANumber))
+			{
+			TLex8 lex(aField);
+			TInt err = lex.Val(aValue);
+			User::LeaveIfError(err);
+			}
+		}
+	}
+
+/*
+void CConfigReaderBase::ExtractDegreesL(const TPtrC8& aField, TReal64& aDegrees)
+	{
+	TRealX nan;
+	nan.SetNaN();
+
+	aDegrees = nan;
+
+	if (aField.Length() != 0)
+		{
+		TLex8 lex(aField);
+		TInt err = lex.Val(aDegrees);
+		User::LeaveIfError(err);
+		
+		ConvertDecimalMinutesToDecimalDegrees(aDegrees);
+		}
+	}
+*/
+
+
+void CConfigReaderBase::ProcessL()
+	{
+	if (iConfigFileName.Length() == 0)
+		{
+		User::LeaveIfError(KErrArgument);
+		}
+	
+	RFs fs;
+	User::LeaveIfError(fs.Connect());
+	CleanupClosePushL(fs);	
+	
+	RFile iniFile;
+
+	User::LeaveIfError(iniFile.Open(fs, iConfigFileName, EFileRead|EFileShareReadersOnly));
+
+	CleanupClosePushL(iniFile);
+	
+	TBuf8<KMaxIniFileBuffer> buf;
+	
+	// Loop until EOF.
+	User::LeaveIfError(iniFile.Read(buf));
+	while (buf.Length() > 0)
+		{
+		// Process data read from file.
+		ProcessStringL(buf);
+		
+		// Refresh buffer from file.
+		User::LeaveIfError(iniFile.Read(buf));
+		}
+
+	CleanupStack::PopAndDestroy(2, &fs);	// iniFile, fs.
+	}
+
+
+
+
+
+
+
+/*********************** Update Info Reader ************************/
+
+CUpdateConfigReader* CUpdateConfigReader::NewL(const TDesC &aConfigFileName, const TDesC& aConfigSection, RPointerArray<TLbsModuleUpdateItem>& aUpdateArr)
+	{
+	return new (ELeave) CUpdateConfigReader(aConfigFileName, aConfigSection, aUpdateArr);
+	}
+
+
+CUpdateConfigReader::CUpdateConfigReader(const TDesC &aConfigFileName, const TDesC& aConfigSection, RPointerArray<TLbsModuleUpdateItem>& aUpdateArr) : CConfigReaderBase(aConfigFileName, aConfigSection), iUpdateArr(aUpdateArr)
+	{
+	}
+
+
+void CUpdateConfigReader::HandleSentenceL()
+	{
+	// Not a update sentence, ignore all other valid sentences.
+	if (	(iNumFields == EUpdateType) || (iFields[EUpdateType].Compare(_L8("update")) != 0) )
+		{
+		return;
+		}
+
+	// Determine the number of times to repeat the update.
+	TInt repeat = 1;
+
+	if (iFields[EUpdateRepeat].Length() != 0)
+		{
+		ExtractValueL(iFields[1], repeat);
+		}
+
+	// Determine the number of measurements for each update.
+	TInt numOfMeasurements = 0;
+	
+	if (iFields[ENumOfMeasurements].Length() != 0)
+		{
+		ExtractValueL(iFields[ENumOfMeasurements], numOfMeasurements);	// make this member, then set up this + error in the default + extract maybe
+		}
+
+	// Add repeat items to the pos info array.
+	for (TInt i = 0; i < repeat; i++)
+	{
+		TPositionGpsMeasurementInfo measureInfo;
+		TPositionGpsMeasurementData measureData;
+
+
+		// Alloc a update item.
+		iUpdate = new(ELeave) TLbsModuleUpdateItem();
+
+
+		// Set measurement info.
+		for (TInt j = 0; j < numOfMeasurements; j++)
+			{
+			measureData.SetSatelliteId(j + 1);
+			measureData.SetCarrierNoiseRatio((j+1) + 1);
+			measureData.SetDoppler((j+1) + 2);
+			measureData.SetWholeGpsChips((j+1) + 3);
+			measureData.SetFractionalGpsChips((j+1) + 4);
+			measureData.SetMultiPathIndicator(TPositionGpsMeasurementData::EMultiPathLow);
+			measureData.SetPseudoRangeRmsError((j+1) + 5);
+
+			User::LeaveIfError(measureInfo.AppendMeasurementData(measureData));
+			}
+		measureInfo.SetGpsTimeOfWeek(i + 1000);
+		iUpdate->SetMeasurement(measureInfo);
+
+		
+		// Set position update.		
+		// Optional fields are present fill out pos info based on them.
+		if (iFields[3].Length() != 0)
+			{
+			DefaultData();	// This will ensure the pos info items are set to a default value for any incomplete sentences.
+			ExtractDataL();
+			}
+
+		// Otherwise use default values.			
+		else
+			{
+			DefaultData();
+			}
+
+
+		// Optional error value is present. Set update error.
+		TInt updateErr = KErrNone;
+		if (iFields[EUpdateErr].Length() != 0)
+			{
+			ExtractValueL(iFields[EUpdateErr], updateErr);		
+			}
+		iUpdate->SetError(updateErr);
+		
+		// Optional time delay(could be negative)
+		TInt updateDelay = 0;
+		if (iFields[EUpdateDelay].Length() != 0)
+			{
+			ExtractValueL(iFields[EUpdateDelay], updateDelay);
+			}
+		iUpdate->SetDelay(updateDelay);
+
+				
+		// Add to array, and reset pointer.
+		iUpdateArr.AppendL(iUpdate);
+		iUpdate = NULL;
+		}	
+	}
+
+
+void CUpdateConfigReader::ExtractDataL()
+	{
+	// Access the position info from the update structure.
+	TPositionSatelliteInfo	posInfo = iUpdate->Position();
+	TPosition position;
+
+	// Process fields.
+	TReal64 latitude;
+	TReal64 longitude;
+	TReal32 altitude;
+	TReal32 horzAccuracy;
+	TReal32 vertAccuracy;
+
+	ExtractValueL(iFields[EPosLatitude], latitude);
+	ExtractValueL(iFields[EPosLongitude], longitude);
+	ExtractValueL(iFields[EPosAltitude], altitude);
+	ExtractValueL(iFields[EPosHorzAccuracy], horzAccuracy);
+	ExtractValueL(iFields[EPosVertAccuracy], vertAccuracy);
+
+	// Set values.
+	position.SetCoordinate(latitude, longitude, altitude);
+	position.SetAccuracy(horzAccuracy, vertAccuracy);
+	position.SetCurrentTime();
+		
+	posInfo.SetPosition(position);
+
+	iUpdate->SetPosition(posInfo);
+	}
+
+
+void CUpdateConfigReader::DefaultData()
+	{
+	// Access the position info from the update structure.
+	TPositionSatelliteInfo	posSatalliteInfo = iUpdate->Position();
+
+
+	// Fill out default position data.
+	TPosition position;
+
+	position.SetCoordinate(DEFAULT_NOTIFY_POS_UPDATE_LATITUDE, DEFAULT_NOTIFY_POS_UPDATE_LONGITUDE, DEFAULT_NOTIFY_POS_UPDATE_ALTITUDE);
+	position.SetAccuracy(DEFAULT_NOTIFY_POS_UPDATE_HORIZONTAL_ACCURACY, DEFAULT_NOTIFY_POS_UPDATE_VERTICAL_ACCURACY);
+	position.SetCurrentTime();
+		
+	posSatalliteInfo.SetPosition(position);
+
+
+	// Fill out default course data.
+	TCourse course;
+
+	course.SetSpeed(DEFAULT_NOTIFY_POS_UPDATE_SPEED);
+	course.SetHeading(DEFAULT_NOTIFY_POS_UPDATE_HEADING);
+	course.SetSpeedAccuracy(DEFAULT_NOTIFY_POS_UPDATE_SPEED_ACCURACY);
+	course.SetHeadingAccuracy(DEFAULT_NOTIFY_POS_UPDATE_HEADING_ACCURACY);
+		
+	posSatalliteInfo.SetCourse(course);
+
+
+	// Fill out default satalliteInfo.
+	TSatelliteData satellite;
+
+	satellite.SetSatelliteId(DEFAULT_NOTIFY_POS_UPDATE_SATELLITE_ID1);
+	satellite.SetAzimuth(DEFAULT_NOTIFY_POS_UPDATE_AZIMUTH1);
+	satellite.SetElevation(DEFAULT_NOTIFY_POS_UPDATE_ELEVATION1);
+	satellite.SetIsUsed(DEFAULT_NOTIFY_POS_UPDATE_IS_USED1);
+	satellite.SetSignalStrength(DEFAULT_NOTIFY_POS_UPDATE_SIGNAL_STRENGTH1);
+		
+	posSatalliteInfo.AppendSatelliteData(satellite);
+
+	satellite.SetSatelliteId(DEFAULT_NOTIFY_POS_UPDATE_SATELLITE_ID2);
+	satellite.SetAzimuth(DEFAULT_NOTIFY_POS_UPDATE_AZIMUTH2);
+	satellite.SetElevation(DEFAULT_NOTIFY_POS_UPDATE_ELEVATION2);
+	satellite.SetIsUsed(DEFAULT_NOTIFY_POS_UPDATE_IS_USED2);
+	satellite.SetSignalStrength(DEFAULT_NOTIFY_POS_UPDATE_SIGNAL_STRENGTH2);
+		
+	posSatalliteInfo.AppendSatelliteData(satellite);
+
+
+	iUpdate->SetPosition(posSatalliteInfo);
+	}
+
+
+
+
+
+
+/*********************** Position Info Reader ************************/
+
+CPosInfoConfigReader* CPosInfoConfigReader::NewL(const TDesC &aConfigFileName, const TDesC& aConfigSection, RPointerArray<TAny>& aPosInfoArr)
+	{
+	return new (ELeave) CPosInfoConfigReader(aConfigFileName, aConfigSection, aPosInfoArr);
+	}
+
+
+CPosInfoConfigReader::CPosInfoConfigReader(const TDesC &aConfigFileName, const TDesC& aConfigSection, RPointerArray<TAny>& aPosInfoArr) : CConfigReaderBase(aConfigFileName, aConfigSection), iPosInfoArr(aPosInfoArr)
+	{
+	}
+
+
+void CPosInfoConfigReader::HandleSentenceL()
+	{
+	// Not a position info sentence, ignore all other valid sentences.
+	if (	(iNumFields == 0) || (
+			(iFields[0].Compare(_L8("position")) != 0) &&	
+			(iFields[0].Compare(_L8("course")) != 0) &&
+			(iFields[0].Compare(_L8("satellite")) != 0) ))
+		{
+		return;
+		}
+
+	// Determine the number of times to repeat the pos info.
+	TInt repeat = 1;
+
+	if (iFields[1].Length() != 0)
+		{
+		ExtractValueL(iFields[1], repeat);
+		}
+
+	// Add repeat items to the pos info array.
+	for (TInt i = 0; i < repeat; i++)
+	{
+		// Alloc a Satellite type info.
+		iPosInfo = new(ELeave) TPositionSatelliteInfo();
+				
+		// Optional fields are present fill out pos info based on them.
+		if (iFields[2].Length() != 0)
+			{
+			DefaultData();	// This will ensure the pos info items are set to a default value for any incomplete sentences.
+			ExtractDataL();
+			}
+
+		// Otherwise use default values.			
+		else
+			{
+			DefaultData();
+			}
+			
+		// Add to array, and reset pointer.
+		User::LeaveIfError(iPosInfoArr.Append(iPosInfo));
+		iPosInfo = NULL;
+		}	
+	}
+
+// i think we will always have to call default to ensure we set things for missing fields
+void CPosInfoConfigReader::ExtractDataL()
+	{
+	// TODO: we need to support something like this, ie $position,1,10,2.3* which is lat, long only
+	// I think it will because extract value deals with empty strings
+	if (iPosInfo->PositionClassType() & EPositionInfoClass)
+		{
+		TPosition position;
+		TPositionInfo& posInfo = static_cast<TPositionInfo&>(*iPosInfo);
+	
+		TReal64 latitude;
+		TReal64 longitude;
+		TReal32 altitude;
+		// TODO: TUid datum;
+		TReal32 horzAccuracy;
+		TReal32 vertAccuracy;
+
+		ExtractValueL(iFields[EPosLatitude], latitude);
+		ExtractValueL(iFields[EPosLongitude], longitude);
+		ExtractValueL(iFields[EPosAltitude], altitude);
+		// TODO: ExtractUidL() not sure what datum is
+		ExtractValueL(iFields[EPosHorzAccuracy], horzAccuracy);
+		ExtractValueL(iFields[EPosVertAccuracy], vertAccuracy);
+
+		position.SetCoordinate(latitude, longitude, altitude);
+		position.SetAccuracy(horzAccuracy, vertAccuracy);
+		position.SetCurrentTime();
+		
+		posInfo.SetPosition(position);
+		}
+
+	if (iPosInfo->PositionClassType() & EPositionCourseInfoClass)
+		{
+		TCourse course;
+		TPositionCourseInfo& posCourseInfo = static_cast<TPositionCourseInfo&>(*iPosInfo);
+
+		TReal32 speed;
+		TReal32 heading;
+		TReal32 speedAccuracy;
+		TReal32 headingAccuracy;
+
+		ExtractValueL(iFields[EPosSpeed], speed);
+		ExtractValueL(iFields[EPosHeading], heading);
+		ExtractValueL(iFields[EPosSpeedAccuracy], speedAccuracy);
+		ExtractValueL(iFields[EPosHeadingAccuracy], headingAccuracy);
+						
+		course.SetSpeed(speed);
+		course.SetHeading(heading);
+		course.SetSpeedAccuracy(speedAccuracy);
+		course.SetHeadingAccuracy(headingAccuracy);
+		
+		posCourseInfo.SetCourse(course);		
+		}
+
+	if (iPosInfo->PositionClassType() & EPositionSatelliteInfoClass)
+		{
+		// TODO satellite info
+		}	
+	}
+
+
+void CPosInfoConfigReader::DefaultData()
+	{
+
+	if (iPosInfo->PositionClassType() & EPositionInfoClass)
+		{
+		TPosition position;
+		TPositionInfo& posInfo = static_cast<TPositionInfo&>(*iPosInfo);
+
+		position.SetCoordinate(DEFAULT_NOTIFY_POS_UPDATE_LATITUDE, DEFAULT_NOTIFY_POS_UPDATE_LONGITUDE, DEFAULT_NOTIFY_POS_UPDATE_ALTITUDE);
+		position.SetAccuracy(DEFAULT_NOTIFY_POS_UPDATE_HORIZONTAL_ACCURACY, DEFAULT_NOTIFY_POS_UPDATE_VERTICAL_ACCURACY);
+		position.SetCurrentTime();
+		
+		posInfo.SetPosition(position);
+		}
+
+	if (iPosInfo->PositionClassType() & EPositionCourseInfoClass)
+		{
+		TCourse course;
+		TPositionCourseInfo& posCourseInfo = static_cast<TPositionCourseInfo&>(*iPosInfo);
+
+		course.SetSpeed(DEFAULT_NOTIFY_POS_UPDATE_SPEED);
+		course.SetHeading(DEFAULT_NOTIFY_POS_UPDATE_HEADING);
+		course.SetSpeedAccuracy(DEFAULT_NOTIFY_POS_UPDATE_SPEED_ACCURACY);
+		course.SetHeadingAccuracy(DEFAULT_NOTIFY_POS_UPDATE_HEADING_ACCURACY);
+		
+		posCourseInfo.SetCourse(course);
+		}
+
+	if (iPosInfo->PositionClassType() & EPositionSatelliteInfoClass)
+		{
+		TSatelliteData satellite;
+		TPositionSatelliteInfo& posSatalliteInfo = static_cast<TPositionSatelliteInfo&>(*iPosInfo);
+
+		satellite.SetSatelliteId(DEFAULT_NOTIFY_POS_UPDATE_SATELLITE_ID1);
+		satellite.SetAzimuth(DEFAULT_NOTIFY_POS_UPDATE_AZIMUTH1);
+		satellite.SetElevation(DEFAULT_NOTIFY_POS_UPDATE_ELEVATION1);
+		satellite.SetIsUsed(DEFAULT_NOTIFY_POS_UPDATE_IS_USED1);
+		satellite.SetSignalStrength(DEFAULT_NOTIFY_POS_UPDATE_SIGNAL_STRENGTH1);
+		
+		posSatalliteInfo.AppendSatelliteData(satellite);
+
+		satellite.SetSatelliteId(DEFAULT_NOTIFY_POS_UPDATE_SATELLITE_ID2);
+		satellite.SetAzimuth(DEFAULT_NOTIFY_POS_UPDATE_AZIMUTH2);
+		satellite.SetElevation(DEFAULT_NOTIFY_POS_UPDATE_ELEVATION2);
+		satellite.SetIsUsed(DEFAULT_NOTIFY_POS_UPDATE_IS_USED2);
+		satellite.SetSignalStrength(DEFAULT_NOTIFY_POS_UPDATE_SIGNAL_STRENGTH2);
+		
+		posSatalliteInfo.AppendSatelliteData(satellite);
+		}
+
+/* For extended tests when/if we have them.
+	if (infoBase.PositionClassType() & EPositionClassTestExtension)
+		{
+		TExtPosInfo* genInfo = reinterpret_cast<TExtPosInfo*>(buffer);
+
+		genInfo->iGalaxy = DEFAULT_NOTIFY_POS_UPDATE_EXT_GALAXY;
+		genInfo->iSolarSystem = DEFAULT_NOTIFY_POS_UPDATE_EXT_SOLARSYS;
+		genInfo->iStarDate = DEFAULT_NOTIFY_POS_UPDATE_EXT_STARDATE;
+		}	
+*/
+	}
+
+
+/*********************** Module Status Reader ************************/
+
+CModuleStatusConfigReader* CModuleStatusConfigReader::NewL(const TDesC &aConfigFileName, const TDesC& aConfigSection, TPositionModuleStatus& aModuleStatus)
+	{
+	return new (ELeave) CModuleStatusConfigReader(aConfigFileName, aConfigSection, aModuleStatus);
+	}
+
+
+CModuleStatusConfigReader::CModuleStatusConfigReader(const TDesC &aConfigFileName, const TDesC& aConfigSection, TPositionModuleStatus& aModuleStatus) : CConfigReaderBase(aConfigFileName, aConfigSection), iModuleStatus(aModuleStatus)
+	{
+	}
+
+
+void CModuleStatusConfigReader::ExtractValueDevice(const TPtrC8& aField, TPositionModuleStatus::TDeviceStatus& aValue)
+	{
+	// Set device status.
+	if (aField.Length() != 0)
+		{
+		if (aField.Compare(_L8("device_error")) == 0)
+			{
+			aValue = TPositionModuleStatus::EDeviceError;
+			}
+			
+		else if (aField.Compare(_L8("device_disable")) == 0)
+			{
+			aValue = TPositionModuleStatus::EDeviceDisabled;
+			}
+			
+		else if (aField.Compare(_L8("device_inactive")) == 0)
+			{
+			aValue = TPositionModuleStatus::EDeviceInactive;
+			}
+			
+		else if (aField.Compare(_L8("device_initalising")) == 0)
+			{
+			aValue = TPositionModuleStatus::EDeviceInitialising;
+			}
+			
+		else if (aField.Compare(_L8("device_standby")) == 0)
+			{
+			aValue = TPositionModuleStatus::EDeviceStandBy;
+			}
+			
+		else if (aField.Compare(_L8("device_ready")) == 0)
+			{
+			aValue = TPositionModuleStatus::EDeviceReady;
+			}
+			
+		else if (aField.Compare(_L8("device_active")) == 0)
+			{
+			aValue = TPositionModuleStatus::EDeviceActive;
+			}		
+		}
+	}
+
+
+void CModuleStatusConfigReader::ExtractValueDataQuality(const TPtrC8& aField, TPositionModuleStatus::TDataQualityStatus& aValue)
+	{
+	// Set data quality.
+	if (aField.Length() != 0)
+		{
+		if (aField.Compare(_L8("data_quality_loss")) == 0)
+			{
+			aValue = TPositionModuleStatus::EDataQualityLoss;
+			}
+
+		else if (aField.Compare(_L8("data_quality_partial")) == 0)
+			{
+			aValue = TPositionModuleStatus::EDataQualityPartial;
+			}
+
+		else if (aField.Compare(_L8("data_quality_normal")) == 0)
+			{
+			aValue = TPositionModuleStatus::EDataQualityNormal;
+			}
+		}
+	}
+
+
+void CModuleStatusConfigReader::HandleSentenceL()
+	{
+	// Not a 'updateoptions' sentence, ignore all other valid sentences.
+	if ( (iNumFields == 0) || (iFields[EModuleStatusType].Compare(_L8("modstatus")) != 0) )
+		{
+		return;	
+		}
+
+	// Set default values for any fields not present in the sentence.
+	DefaultData();
+
+	// Set values from set fields in the sentence.
+	if (iNumFields == 3)
+		{
+		ExtractDataL();
+		}	
+	}
+	
+	
+void CModuleStatusConfigReader::ExtractDataL()
+	{
+	
+	TPositionModuleStatus::TDeviceStatus device;
+	TPositionModuleStatus::TDataQualityStatus dataQuality;			
+		
+	ExtractValueDevice(iFields[EModuleStatusDevice], device);
+	ExtractValueDataQuality(iFields[EModuleStatusDataQuality], dataQuality);
+
+	iModuleStatus.SetDeviceStatus(device);
+	iModuleStatus.SetDataQualityStatus(dataQuality);
+	}
+
+
+void CModuleStatusConfigReader::DefaultData()
+	{
+	iModuleStatus.SetDeviceStatus(TPositionModuleStatus::EDeviceReady);
+	iModuleStatus.SetDataQualityStatus(TPositionModuleStatus::EDataQualityNormal);
+	}
+
+
+
+	
+/*********************** Update Options Reader ************************/
+
+CUpdateOptsConfigReader* CUpdateOptsConfigReader::NewL(const TDesC &aConfigFileName, const TDesC& aConfigSection, TPositionUpdateOptions& aUpdateOpts)
+	{
+	return new (ELeave) CUpdateOptsConfigReader(aConfigFileName, aConfigSection, aUpdateOpts);
+	}
+
+
+CUpdateOptsConfigReader::CUpdateOptsConfigReader(const TDesC &aConfigFileName, const TDesC& aConfigSection, TPositionUpdateOptions& aUpdateOpts) : CConfigReaderBase(aConfigFileName, aConfigSection), iUpdateOpts(aUpdateOpts)
+	{
+	
+	}
+
+
+void CUpdateOptsConfigReader::ExtractValueL(const TPtrC8& aField, TTimeIntervalMicroSeconds& aValue)
+	{
+	if (aField.Length() != 0)
+		{
+		TLex8 lex(aField);
+		TInt64 value;
+		TInt err = lex.Val(value);
+		User::LeaveIfError(err);
+		aValue = value;
+		}
+	}
+
+
+void CUpdateOptsConfigReader::ExtractValue(const TPtrC8& aField, TBool& aValue)
+	{
+	aValue = EFalse;	
+	if (aField.Length() != 0)
+		{
+		if (aField.Compare(_L8("true")) == 0)
+			{
+			aValue = ETrue;
+			}
+		}
+	}
+
+
+void CUpdateOptsConfigReader::HandleSentenceL()
+	{
+	// Not a 'updateoptions' sentence, ignore all other valid sentences.
+	if ( (iNumFields == 0) || (iFields[EUpdateOptsType].Compare(_L8("updateoptions")) != 0) )
+		{
+		return;	
+		}
+
+	// Set default values for any fields not present in the sentence.
+	DefaultData();
+
+	// Set values from set fields in the sentence.
+	if (iNumFields == 5)
+		{
+		ExtractDataL();
+		}	
+	}
+	
+	
+void CUpdateOptsConfigReader::ExtractDataL()
+	{
+	TTimeIntervalMicroSeconds interval;
+	TTimeIntervalMicroSeconds timeout;
+	TTimeIntervalMicroSeconds maxage;
+	TBool partialUpdates;
+
+	ExtractValueL(iFields[EUpdateOptsInterval], interval);
+	ExtractValueL(iFields[EUpdateOptsTimeOut], timeout);
+	ExtractValueL(iFields[EUpdateOptsMaxAge], maxage);
+	ExtractValue(iFields[EUpdateOptsPartialUpdates], partialUpdates);
+
+	iUpdateOpts.SetUpdateInterval(interval);
+	iUpdateOpts.SetUpdateTimeOut(timeout);
+	iUpdateOpts.SetMaxUpdateAge(maxage);
+	iUpdateOpts.SetAcceptPartialUpdates(partialUpdates);
+	}
+
+
+void CUpdateOptsConfigReader::DefaultData()
+	{
+	iUpdateOpts.SetUpdateInterval(0);
+	iUpdateOpts.SetUpdateTimeOut(0);
+	iUpdateOpts.SetMaxUpdateAge(0);
+	iUpdateOpts.SetAcceptPartialUpdates(EFalse);
+	}
+
+
+
+
+CAgpsModuleModesConfigReader* CAgpsModuleModesConfigReader::NewL(const TDesC &aConfigFileName, const TDesC& aConfigSection, 
+					RPointerArray<TLbsGpsOptions>& aModuleModes)
+	{
+	return new (ELeave) CAgpsModuleModesConfigReader(aConfigFileName, aConfigSection, aModuleModes);
+	}
+CAgpsModuleModesConfigReader::CAgpsModuleModesConfigReader(const TDesC &aConfigFileName, const TDesC& aConfigSection, 
+					RPointerArray<TLbsGpsOptions>& aModuleModes)
+	: CConfigReaderBase(aConfigFileName, aConfigSection), iModuleModes(aModuleModes)
+	{
+	}
+
+void CAgpsModuleModesConfigReader::HandleSentenceL()
+	{
+	// Not a 'modulemodes' sentence, ignore all other valid sentences.
+	if ( (iNumFields == 0) || (iFields[EModuleModesType].Compare(_L8("modulemodes")) != 0) )
+		{
+		return;	
+		}
+
+	// Set default values for any fields not present in the sentence.
+	DefaultData();
+
+	// Set values from set fields in the sentence.
+	if (iNumFields > 1)
+		{
+		ExtractDataL();
+		}		
+	}
+	
+void CAgpsModuleModesConfigReader::DefaultData()
+/**
+ * Does nothing since there is no default data to be set for the expected gps mode
+ */
+	{
+	}
+
+void CAgpsModuleModesConfigReader::ExtractDataL()
+	{
+	TInt gpsModeInt;
+	ExtractValueL(iFields[EGpsModeField], gpsModeInt);
+	CLbsAdmin::TGpsMode gpsMode(static_cast<CLbsAdmin::TGpsMode>(gpsModeInt));
+
+	if(iNumFields == EGpsModeField+1)
+		{ // there is no options array
+		TLbsGpsOptions* gpsOptions = new(ELeave) TLbsGpsOptions;
+		gpsOptions->SetGpsMode(gpsMode);
+		iModuleModes.AppendL(gpsOptions);
+		}
+	else
+		{
+		TLbsGpsOptionsArray* gpsOptionsArray = new(ELeave) TLbsGpsOptionsArray;
+		gpsOptionsArray->SetGpsMode(gpsMode);
+		
+		for(TInt index = EBegginingOfGpsOptionsArray; index < iNumFields; ++index)
+			{
+			TLbsGpsOptionsItem optionsItem;
+			TInt posUpdateTypeInt;
+			ExtractValueL(iFields[index], posUpdateTypeInt);
+			TLbsGpsOptionsItem::TPosUpdateType posUpdateType(static_cast<TLbsGpsOptionsItem::TPosUpdateType>(posUpdateTypeInt));
+			optionsItem.SetLocUpdateType(posUpdateType);
+			gpsOptionsArray->AppendOptionItem(optionsItem);
+			}
+		
+		iModuleModes.AppendL(gpsOptionsArray);
+		}
+	}
+
+
+CClientDetailsConfigReader* CClientDetailsConfigReader::NewL(const TDesC &aConfigFileName, const TDesC& aConfigSection, 
+					RArray<TCTClientDetails>& aClientDetailsArray)
+	{
+	return new (ELeave) CClientDetailsConfigReader(aConfigFileName, aConfigSection, aClientDetailsArray);
+	}
+CClientDetailsConfigReader::CClientDetailsConfigReader(const TDesC &aConfigFileName, const TDesC& aConfigSection, 
+					RArray<TCTClientDetails>& aClientDetailsArray)
+	: CConfigReaderBase(aConfigFileName, aConfigSection), 
+		iClientDetailsArray(aClientDetailsArray)
+	{
+	}
+
+void CClientDetailsConfigReader::HandleSentenceL()
+	{
+	// Not a 'clientdetails' sentence, ignore all other valid sentences.
+	if ( (iNumFields == 0) || (iFields[0].Compare(_L8("clientdetails")) != 0) )
+		{
+		return;	
+		}
+
+	ExtractDataL();
+	}
+	
+void CClientDetailsConfigReader::DefaultData()
+/**
+ * Does nothing since there is no default data to be set for the expected gps mode
+ */
+	{
+	}
+
+void CClientDetailsConfigReader::ExtractDataL()
+	{
+	TCTClientDetails clientDetails;
+	TInt value;
+	
+	if(iNumFields > 1)
+		{ // initial delay - after which session ID it should start - default is 0
+		ExtractValueL(iFields[1], value);
+		clientDetails.iSessionIdDelay = value;
+		}
+	
+	if(iNumFields > 2)
+		{ // initial delay - after which step in the session it should start - default is 0
+		ExtractValueL(iFields[2], value);
+		clientDetails.iSessionStepDelay = value;
+		}
+
+	if(iNumFields > 3)
+		{ // number of NPUDs issued by the client - default is 1 
+		ExtractValueL(iFields[3], value);
+		clientDetails.iNumberOfNPUDs = value > 0 ? value : 1;
+		}
+	
+	if(iNumFields > 4)
+		{ // the update interval - default is 0 (no tracking)
+		ExtractValueL(iFields[4], value);
+		clientDetails.iUpdateOptions.SetUpdateInterval(value);
+		}
+	
+	if(clientDetails.iNumberOfNPUDs == 1 || clientDetails.iUpdateOptions.UpdateInterval() == 0)
+		{ // if one of the params indicates no tracking then set the others to say the same
+		clientDetails.iUpdateOptions.SetUpdateInterval(0);
+		}
+
+	if(iNumFields > 5)
+		{ // the max fix time - default is 0 (no timeout)
+		ExtractValueL(iFields[5], value);
+		clientDetails.iUpdateOptions.SetUpdateTimeOut(value);
+		}
+
+	if(iNumFields > 6)
+		{ // the max update age - default is 0
+		ExtractValueL(iFields[6], value);
+		clientDetails.iUpdateOptions.SetMaxUpdateAge(value);
+		}
+	
+	if(iNumFields > 7)
+		{ // if partial updates should be accepted - default is EFalse
+		if (iFields[7].Compare(_L8("true")) == 0)
+			{
+			clientDetails.iUpdateOptions.SetAcceptPartialUpdates(ETrue);
+			}
+		}
+
+	if(iNumFields > 8)
+		{
+			{ // if partial updates should be accepted - default is EFalse
+			if (iFields[8].Compare(_L8("cancel")) == 0)
+				{
+				clientDetails.iCancelRequest = ETrue;
+				}
+			}		
+		}
+	
+	if(iNumFields > 9)
+		{ // delay after which step in the session the last request should be cancelled - default is 0
+		ExtractValueL(iFields[9], value);
+		clientDetails.iSessionIdCancel = value;
+		}	
+	
+	if(iNumFields > 10)
+		{ // delay after which session ID the last request should be cancelled - default is 0
+		ExtractValueL(iFields[10], value);
+		clientDetails.iSessionStepCancel = value;
+		}	
+	
+	iClientDetailsArray.AppendL(clientDetails);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestutils/src/ctlbstestlogger.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,273 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// lbstestlogger.cpp
+// System
+// 
+//
+
+#include <e32base.h>
+#include <e32debug.h>
+#include <flogger.h>
+#include <f32file.h>
+
+// Component
+#include "ctlbstestlogger.h"
+
+const TInt KLbsDevLogMaxBufSize = 256;
+_LIT(KTimeFormat, "%H:%T:%S.%C");
+_LIT(KLogPath, "\\logs\\LbsTestLogs\\");
+_LIT(KLbsDevLogFolder, "LbsTestLogs");
+_LIT(KLbsDevLogFile,"lbstest.txt");
+_LIT(KLbsDevLogError, "Error: ");
+_LIT(KLbsDevLogWarning, "Warning: ");
+_LIT(KLbsDevLogSep," | ");
+_LIT(KLbsDevLog, "LbsDevLog");
+
+
+const TInt KLbsHexDumpWidth=16;
+_LIT(KLbsFirstFormatString,"%04x : ");
+_LIT(KLbsSecondFormatString,"%02x ");
+_LIT(KLbsThirdFormatString,"%c");
+_LIT(KLbsThreeSpaces,"   ");
+_LIT(KLbsTwoSpaces,"  ");
+const TText KLbsFullStopChar='.';
+
+//-----------------------------------------------------------------------------
+// LbsTestLogger
+//-----------------------------------------------------------------------------
+
+void LbsTestLogger::CreateLogDir()
+	{
+	TInt err;
+	
+	// Create the directory
+	RFs fs;
+	err = fs.Connect();
+	if(KErrNone == err)
+		{
+		err = fs.MkDirAll(KLogPath);
+		fs.Close();	
+		}
+	}
+	
+
+/** Static function, one parameter
+@param aPrior Log entry priority
+@param aFmt TDes string reference 
+@InternalTechnology
+@prototype
+*/
+void LbsTestLogger::Write(TLogType aType, TLogPriority aPrior, TRefByValue<const TDesC16> aFmt, ...)
+	{
+	RFileLogger logger;
+	TInt err = logger.Connect();
+	
+	if (err == KErrNone)
+		{
+		VA_LIST list;
+		VA_START(list, aFmt);
+		TBuf16<KLbsDevLogMaxBufSize> strList;
+		strList.FormatList(aFmt, list);
+		VA_END(list);
+		TBuf16<KLbsDevLogMaxBufSize> txt;
+		
+		CreateLogTxt(aType, aPrior, txt);
+		txt.Append(strList.Left(KLbsDevLogMaxBufSize - txt.Length()));
+
+		CreateLogDir();
+		
+		logger.CreateLog(KLbsDevLogFolder, KLbsDevLogFile, EFileLoggingModeAppend);
+		logger.SetDateAndTime(EFalse, EFalse);
+		logger.Write(txt);
+
+		}
+		
+	logger.Close();
+	}
+
+/** Static function to dump the hex data
+@param aPrior Log entry priority
+@param aPtr TUnit8 pointer to hex data
+@param aLen length of hex data
+@InternalTechnology
+@prototype
+*/
+void LbsTestLogger::HexDump(TLogPriority aPrior, const TUint8 *aPtr, TInt aLen)
+	{
+	if (aPtr==NULL)     // nothing to do
+		return;
+
+	RFileLogger logger;
+	TInt err = logger.Connect();
+	CreateLogDir();	
+	logger.CreateLog(KLbsDevLogFolder, KLbsDevLogFile, EFileLoggingModeAppend);
+	logger.SetDateAndTime(EFalse, EFalse);
+	
+	// based on RFileLogger
+	TBuf<KLbsDevLogMaxBufSize> buf;
+	TBuf8<KLbsDevLogMaxBufSize> temp;
+	TInt i=0;
+	TBuf8<KLbsDevLogMaxBufSize> prefix;
+	CreateLogTxt(ELogNormal, aPrior, prefix);
+	
+	while (aLen>0)
+		{
+		TInt n=(aLen>KLbsHexDumpWidth ? KLbsHexDumpWidth : aLen);
+		buf.Copy(prefix);
+		buf.AppendFormat(KLbsFirstFormatString,i);
+		
+		TInt j;
+		for (j=0; j<n; j++)
+			buf.AppendFormat(KLbsSecondFormatString,aPtr[i+j]);
+			
+		while (j++<KLbsHexDumpWidth)
+			buf.Append(KLbsThreeSpaces);
+			
+		buf.Append(KLbsTwoSpaces);
+		for (j=0; j<n; j++)
+			buf.AppendFormat(KLbsThirdFormatString,(aPtr[i+j]<32 || aPtr[i+j]>126) ? KLbsFullStopChar : aPtr[i+j]);
+
+		logger.Write(buf);
+
+		buf.SetLength(0);
+		temp.SetLength(0);
+		aLen-=n;
+		i+=n;
+		}
+
+	logger.Close();
+	}
+	
+/** private function, create common log text
+@param aPrior Log entry priority
+@param aBuf The log prefix buffer
+@InternalTechnology
+@prototype
+*/
+void LbsTestLogger::CreateLogTxt(TLogType aType, TLogPriority aPrior, TDes16& aBuf)
+	{
+	TTime currentTime;
+	currentTime.UniversalTime();
+	TBuf16<32> cTimeStr;
+	TInt err = KErrNone;
+	TRAP(err, currentTime.FormatL(cTimeStr, KTimeFormat);)
+	if(err)
+		User::Panic(KLbsDevLog, err);
+	
+	TFileName dirName = RProcess().FileName();
+	TInt16 pos = dirName.LocateReverse('\\') + 1;
+	TPtr16 fileName = dirName.MidTPtr(pos);
+	TUint64 procId = RProcess().Id().Id();
+	
+	aBuf.Append(cTimeStr);
+	aBuf.Append(KLbsDevLogSep);
+
+	aBuf.Append(fileName);
+	aBuf.Append(KLbsDevLogSep);
+	
+	//aBuf.AppendFormat(_L16("%LX"),procId);
+	//aBuf.Append(KLbsDevLogSep);
+	
+	aBuf.AppendFormat(_L16("P%d"),aPrior);
+	aBuf.Append(KLbsDevLogSep);
+		
+	if (aType == ELogError)
+		{
+		aBuf.Append(KLbsDevLogError);
+		}
+	else if (aType == ELogWarning)
+		{
+		aBuf.Append(KLbsDevLogWarning);
+		}
+	}
+
+
+/** Static function, one parameter
+@param aPrior Log entry priority
+@param aFmt Log entry
+@InternalTechnology
+@prototype
+*/
+void LbsTestLogger::Write(TLogType aType, TLogPriority aPrior, TRefByValue<const TDesC8> aFmt, ...)
+	{
+	RFileLogger logger;
+	TInt err = logger.Connect();
+	
+	if (err == KErrNone)
+		{
+		VA_LIST list;
+		VA_START(list, aFmt);
+		TBuf8<KLbsDevLogMaxBufSize> strList;
+		strList.FormatList(aFmt, list);
+		VA_END(list);
+
+		TBuf8<KLbsDevLogMaxBufSize> txt;
+		CreateLogTxt(aType, aPrior, txt);
+		txt.Append(strList.Left(KLbsDevLogMaxBufSize - txt.Length()));
+
+		CreateLogDir();
+		logger.CreateLog(KLbsDevLogFolder, KLbsDevLogFile, EFileLoggingModeAppend);
+		logger.SetDateAndTime(EFalse, EFalse);
+		logger.Write(txt);
+
+		}
+		
+	logger.Close();
+	}
+
+/** private function, create common log text
+@param aPrior Log entry priority
+@param aBuf The log prefix buffer
+@InternalTechnology
+@prototype
+*/
+void LbsTestLogger::CreateLogTxt(TLogType aType, TLogPriority aPrior, TDes8& aBuf)
+	{
+	TTime currentTime;
+	currentTime.UniversalTime();
+	TBuf<32> cTimeStr;
+	TInt err = KErrNone;
+	TRAP(err, currentTime.FormatL(cTimeStr, KTimeFormat);)
+	if(err)
+		User::Panic(KLbsDevLog, err);
+	
+	TBuf8<32> cTimeStr8;
+	cTimeStr8.Copy(cTimeStr);
+	
+	TFileName dirName = RProcess().FileName();
+	TInt pos = dirName.LocateReverse('\\') + 1;
+	TPtr fileName = dirName.MidTPtr(pos);
+	TUint64 procId = RProcess().Id().Id();
+	
+	aBuf.Append(cTimeStr8);
+	aBuf.Append(KLbsDevLogSep);
+
+	aBuf.Append(fileName);
+	aBuf.Append(KLbsDevLogSep);
+	
+	//aBuf.AppendFormat(_L8("%LX"),procId);
+	//aBuf.Append(KLbsDevLogSep);
+	
+	aBuf.AppendFormat(_L8("P%d"),aPrior);
+	aBuf.Append(KLbsDevLogSep);
+	
+	if (aType == ELogError)
+		{
+		aBuf.Append(KLbsDevLogError);
+		}
+	else if (aType == ELogWarning)
+		{
+		aBuf.Append(KLbsDevLogWarning);
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestutils/src/ctlbstimerutils.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,154 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file ctlbstimerutils.cpp
+// 
+//
+
+
+#include "ctlbstimerutils.h"
+
+
+/**
+  Function : NewL
+  Description :  It performs the two construction and returns an object
+  				 of type CT_MsgTimerUtils
+  @internalTechnology
+  @param :
+  @return : N/A
+  @precondition : none
+  @postcondition : none
+*/
+EXPORT_C CT_LbsTimerUtils* CT_LbsTimerUtils::NewL(MT_LbsTimerUtilsObserver* aObserver, TInt aTimerId)
+	{
+	CT_LbsTimerUtils* self = new(ELeave) CT_LbsTimerUtils(aObserver, aTimerId);
+
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop();
+
+	return self;
+	}
+
+
+/**
+  Function : CT_MsgTimerUtils
+  Description : Constructor
+  @internalTechnology
+  @param :
+  @return : N/A
+  @precondition : none
+  @postcondition : none
+*/
+CT_LbsTimerUtils::CT_LbsTimerUtils(MT_LbsTimerUtilsObserver* aObserver, TInt aTimerId)
+	:
+	CTimer(CTimer::EPriorityHigh),
+	iObserver(aObserver),
+	iTimerId(aTimerId)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+
+/**
+  Function : ~CT_MsgTimerUtils
+  Description : Destructor
+  @internalTechnology
+  @param :
+  @return : N/A
+  @precondition : none
+  @postcondition : none
+*/
+EXPORT_C CT_LbsTimerUtils::~CT_LbsTimerUtils()
+	{
+	Cancel();
+	}
+
+void CT_LbsTimerUtils::ConstructL()
+	{
+	CTimer::ConstructL();
+	}
+
+
+/**
+  Function : After
+  Description : Calls the After function CTimer for the given number of secs
+  @internalTechnology
+  @param :
+  @return : N/A
+  @precondition : none
+  @postcondition : none
+*/
+EXPORT_C void CT_LbsTimerUtils::SetTimer(const TTimeIntervalMicroSeconds32 aPeriod)
+{
+	iTargetTime = 0;
+	HighRes(aPeriod);
+}
+	
+	
+EXPORT_C void CT_LbsTimerUtils::SetTimer(const TTime& aUtcTargetTime)
+	{
+	Cancel();
+	
+	iTargetTime = aUtcTargetTime;
+
+	TTime zeroTime(0);
+
+	if (aUtcTargetTime == zeroTime)
+		{
+		return;
+		}
+	
+	TTime timeNow;
+	timeNow.UniversalTime();
+	
+	TTimeIntervalMicroSeconds delay(0);
+	
+	if (timeNow < aUtcTargetTime)
+		{
+		delay = aUtcTargetTime.MicroSecondsFrom(timeNow);
+		}
+
+	TInt delay32 = static_cast<TInt>(I64LOW(delay.Int64()));
+	
+	if (delay32 < 0)
+		{
+		delay32 = 0;
+		}
+
+	TTimeIntervalMicroSeconds32 time32 = TTimeIntervalMicroSeconds32(delay32);
+	
+	HighRes(time32);
+	}
+	
+EXPORT_C void CT_LbsTimerUtils::CancelTimer()
+	{
+	Cancel();
+	}
+	
+/**
+  Function : RunL
+  Description : Gives the status of the operation 
+  @internalTechnology
+  @param :
+  @return : N/A
+  @precondition : none
+  @postcondition : none
+*/
+void CT_LbsTimerUtils::RunL()
+	{
+	if (iObserver)
+		{
+		iObserver->HandleTimerL(iTimerId, iTargetTime);
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lbs/lbstestutils/src/tlbsutils.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1318 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file CT_Utils.cpp
+// This is the Cpp file which contains the utility functions common across the servers
+// 
+//
+
+// User includes
+#include "tlbsutils.h"
+#include "ctlbsconfigreader.h"
+#include "ctlbsasyncwaiter.h"
+#include "ctlbstestloggermacros.h"
+
+// Epoc includes
+#include <f32file.h>
+#include <e32math.h>
+#include <e32property.h>
+
+// Lbs includes
+#include <lbsclasstypes.h>
+#include <lbssatellite.h>
+
+
+// defines
+#define BAD_MODULE_ID	0x87654321
+
+
+/**
+*/
+EXPORT_C TLbsModuleUpdateItem::TLbsModuleUpdateItem()
+	{
+	}
+
+
+/**
+*/
+EXPORT_C const TPositionSatelliteInfo& TLbsModuleUpdateItem::Position() const
+	{
+	return iPosition;
+	}
+
+/**
+*/
+EXPORT_C void TLbsModuleUpdateItem::SetPosition(const TPositionSatelliteInfo& aPosition)
+	{
+	iPosition = aPosition;
+	}
+
+
+/**
+*/
+EXPORT_C const TPositionGpsMeasurementInfo& TLbsModuleUpdateItem::Measurement() const
+	{
+	return iMeasurement;
+	}
+
+/**
+*/
+EXPORT_C void TLbsModuleUpdateItem::SetMeasurement(const TPositionGpsMeasurementInfo& aMeasurement)
+	{
+	iMeasurement = aMeasurement;
+	}
+
+
+/**
+*/
+EXPORT_C TInt TLbsModuleUpdateItem::Error() const
+	{
+	return iError;
+	}
+
+/**
+*/
+EXPORT_C void TLbsModuleUpdateItem::SetDelay(TInt aDelay)
+	{
+	iDelay = aDelay;
+	}
+
+/**
+*/
+EXPORT_C TInt TLbsModuleUpdateItem::Delay() const
+	{
+	return iDelay;
+	}
+
+/**
+*/
+EXPORT_C void TLbsModuleUpdateItem::SetError(TInt aError)
+	{
+	iError = aError;
+	}
+
+
+
+EXPORT_C T_LbsUtils::T_LbsUtils()
+/** Constructor.
+*/
+	{
+	}
+
+
+EXPORT_C T_LbsUtils::~T_LbsUtils()
+/** Destructor.
+*/
+	{
+	}
+
+
+/*EXPORT_C static*/ /*void GetDefault_ModuleStatusInfo(TModuleConfiguredStatus& aStatusInfo)
+	{
+		(void)aStatusInfo;	
+	}
+*/
+
+
+EXPORT_C void T_LbsUtils::CreateTestPropertiesL()
+/** Creates the test properties for the test module. To allow data to be passed between
+	test steps and the test module.
+*/
+	{
+	const TSecurityPolicy KReadPolicy(ECapability_None);
+	const TSecurityPolicy KWritePolicy(ECapabilityWriteDeviceData);
+
+
+	// Create the test module data bus properties.
+	TInt err;
+	
+	// Data to the test module.
+	err = RProperty::Define(KUidSystemCategory, ELbsTestAGpsModuleIn, RProperty::ELargeByteArray, KReadPolicy, KWritePolicy, sizeof(TModuleDataIn));
+	if ((KErrNone != err) && (KErrAlreadyExists != err))
+	{
+		User::LeaveIfError(err);
+	}
+	
+	// Data from the test module.
+	err = RProperty::Define(KUidSystemCategory, ELbsTestAGpsModuleOut, RProperty::ELargeByteArray, KReadPolicy, KWritePolicy, sizeof(TModuleDataOut));
+	if ((KErrNone != err) && (KErrAlreadyExists != err))
+	{
+		User::LeaveIfError(err);
+	}
+
+	// Data from the test clock plugin.
+	err = RProperty::Define(KUidSystemCategory, ELbsTestClockPluginOut, RProperty::ELargeByteArray, KReadPolicy, KWritePolicy, sizeof(TClockPluginDataOut));
+	if ((KErrNone != err) && (KErrAlreadyExists != err))
+	{
+		User::LeaveIfError(err);
+	}
+	
+	// Creating the property for allowing the AGPS module to report when the mode it's running in changes
+	err = RProperty::Define(KUidSystemCategory, ELbsTestAGpsModuleModeChanges, RProperty::ELargeByteArray, KReadPolicy, KWritePolicy, sizeof(TLbsGpsOptionsArray));
+	if ((KErrNone != err) && (KErrAlreadyExists != err))
+		{
+			User::LeaveIfError(err);
+		}
+
+	// Create other test properties here also - just update the TLbsTestPropertyKeys enum don't add extra Categories.
+
+	}
+
+
+EXPORT_C void T_LbsUtils::GetConfigured_PosInfosL(const TDesC& aConfigFileName, const TDesC& aConfigSection, RPointerArray<TAny>& aPosInfoArr)
+/** Fills a position info array with values read from a configuration ini file.
+
+@param aConfigFileName	The name of the ini file to read. If the file name is empty (0 length) then
+						the array will contain a single pos info item with default values.
+@param aConfigSection	The section within the ini file to read data from.
+@param aPosInfoArr		The pos info array to which the items are added. The array will cleared of
+						existing items.
+*/
+	{
+	// Clear array.
+	ResetAndDestroy_PosInfoArr(aPosInfoArr);
+
+	// Check for config file, if not present create a single default TPositionInfo.
+	if (aConfigFileName.Length() == 0)
+		{
+		TPositionSatelliteInfo* posInfo = new(ELeave) TPositionSatelliteInfo();
+		TPosition position;
+
+		position.SetCoordinate(DEFAULT_NOTIFY_POS_UPDATE_LATITUDE, DEFAULT_NOTIFY_POS_UPDATE_LONGITUDE, DEFAULT_NOTIFY_POS_UPDATE_ALTITUDE);
+		position.SetAccuracy(DEFAULT_NOTIFY_POS_UPDATE_HORIZONTAL_ACCURACY, DEFAULT_NOTIFY_POS_UPDATE_VERTICAL_ACCURACY);
+		position.SetCurrentTime();
+	
+		posInfo->SetPosition(position);
+
+		User::LeaveIfError(aPosInfoArr.Append(posInfo));			
+		}
+	
+	else
+		{
+		CPosInfoConfigReader* reader;
+	
+		reader = CPosInfoConfigReader::NewL(aConfigFileName, aConfigSection, aPosInfoArr);
+		CleanupStack::PushL(reader);
+		
+		reader->ProcessL();
+	
+		CleanupStack::PopAndDestroy(reader);
+		}
+	}
+
+EXPORT_C void T_LbsUtils::GetConfigured_UpdateArrayL(const TDesC& aConfigFileName, const TDesC& aConfigSection, RPointerArray<TLbsModuleUpdateItem>& aUpdateArr)
+/** Fills an updata array structure with values read from a configuration ini file.
+
+@param aConfigFileName	The name of the ini file to read. If the file name is empty (0 length) then
+						default values will be used.
+@param aConfigSection	The section within the ini file to read data from.
+@param aUpdateArr		The update array to be populated.
+*/
+	{
+	// Use default values if file name not given.
+	if (aConfigFileName.Length() == 0)
+		{
+		// I am not sure we want to fill in the array with default values - ??
+		}
+	
+	else
+		{
+		CUpdateConfigReader* reader;
+	
+		reader = CUpdateConfigReader::NewL(aConfigFileName, aConfigSection, aUpdateArr);
+		CleanupStack::PushL(reader);
+		
+		reader->ProcessL();
+	
+		CleanupStack::PopAndDestroy(reader);
+		}
+	}
+
+
+// don't think we need this...
+EXPORT_C void T_LbsUtils::GetConfigured_ModuleStatusL(const TDesC& aConfigFileName, const TDesC& aConfigSection, TPositionModuleStatus& aModuleStatus)
+	{
+	// Use default values if file name not given.
+	if (aConfigFileName.Length() == 0)
+		{
+		aModuleStatus.SetDeviceStatus(TPositionModuleStatus::EDeviceReady);
+		aModuleStatus.SetDataQualityStatus(TPositionModuleStatus::EDataQualityNormal);
+		}
+	else
+		{
+		CModuleStatusConfigReader* reader;
+	
+		reader = CModuleStatusConfigReader::NewL(aConfigFileName, aConfigSection, aModuleStatus);
+		CleanupStack::PushL(reader);
+				
+		reader->ProcessL();
+	
+		CleanupStack::PopAndDestroy(reader);
+		}
+	}
+
+
+EXPORT_C void T_LbsUtils::GetConfigured_ModuleUpdateOptionsL(const TDesC& aConfigFileName, const TDesC& aConfigSection, TPositionUpdateOptions& aUpdateOpts)
+/** Fills a module updata options class/structure with values read from a configuration ini file.
+
+@param aConfigFileName	The name of the ini file to read. If the file name is empty (0 length) then
+						default values will be used.
+@param aConfigSection	The section within the ini file to read data from.
+@param aUpdateOpts		The modified update options structure.
+*/
+	{
+	// Use default values if file name not given.
+	if (aConfigFileName.Length() == 0)
+		{
+		aUpdateOpts.SetUpdateInterval(0);
+		aUpdateOpts.SetUpdateTimeOut(0);
+		aUpdateOpts.SetMaxUpdateAge(0);
+		aUpdateOpts.SetAcceptPartialUpdates(EFalse);			
+		}
+	
+	else
+		{
+		CUpdateOptsConfigReader* reader;
+	
+		reader = CUpdateOptsConfigReader::NewL(aConfigFileName, aConfigSection, aUpdateOpts);
+		CleanupStack::PushL(reader);
+		
+		reader->ProcessL();
+	
+		CleanupStack::PopAndDestroy(reader);
+		}
+	}
+
+EXPORT_C void T_LbsUtils::GetConfigured_ClientDetailsL(const TDesC& aConfigFileName, const TDesC& aConfigSection, 
+						RArray<TCTClientDetails>& aClientDetailsArray)
+/** Gets the delays for each client with values read from a configuration ini file.
+
+@param aConfigFileName		The name of the ini file to read. If the file name is empty (0 length) then
+							default values will be used.
+@param aConfigSection		The section within the ini file to read data from.
+@param aClientDelayArray	The array of client delays.
+*/
+	{
+	// Use default values if file name not given.
+	if (aConfigFileName.Length() == 0)
+		{ // by default have one client
+		TCTClientDetails client;
+		aClientDetailsArray.AppendL(client);
+		return;
+		}
+	
+	else
+		{
+		CClientDetailsConfigReader* reader;
+		reader = CClientDetailsConfigReader::NewL(aConfigFileName, aConfigSection, aClientDetailsArray);
+		CleanupStack::PushL(reader);
+		
+		reader->ProcessL();
+	
+		CleanupStack::PopAndDestroy(reader);
+		if(aClientDetailsArray.Count() == 0)
+			{ // by default have one client
+			TCTClientDetails client;
+			aClientDetailsArray.AppendL(client);
+			}
+		}
+	}
+
+EXPORT_C void T_LbsUtils::GetExpected_ModuleModes(const TDesC& aConfigFileName, const TDesC& aConfigSection, RPointerArray<TLbsGpsOptions>& aModuleModes)
+	{
+	if (aConfigFileName.Length() == 0)
+		{
+		return;
+		}
+	
+	CAgpsModuleModesConfigReader* reader;
+	reader = CAgpsModuleModesConfigReader::NewL(aConfigFileName, aConfigSection, aModuleModes);
+	CleanupStack::PushL(reader);
+	reader->ProcessL();
+	CleanupStack::PopAndDestroy(reader);
+	}
+
+
+EXPORT_C void T_LbsUtils::NotifyModuleOfConfigChangeL(const TModuleDataIn& aModuleDataIn)
+/** Notify the module of a configuration change.
+
+Used when the test harness has read a configuration file and wishes to notify the test module
+that it should also do a read of the configuration file. To ensure both the test harness and
+the test module are using the same reference data.
+	
+The ELbsTestAGpsModuleIn property is used to pass the ini file and section names to the
+test module. The ELbsTestAGpsModuleOut is then used to receive an response from the test module.
+
+@param aConfigFileName	The file name string to send to the test mdoule.
+@param aConfigSection	The ini section name string to send to the test module.
+*/
+	{
+	// Ask to be notified when the module receives the ini file re-read request.
+
+	// Attach and subscribe to listen for data bus updates. Use the async waiter to process
+	// the update.
+	RProperty modDataOutProperty;
+	User::LeaveIfError(modDataOutProperty.Attach(KUidSystemCategory, ELbsTestAGpsModuleOut));
+
+	CT_LbsAsyncWaiter* waiter = CT_LbsAsyncWaiter::NewL();
+	CleanupStack::PushL(waiter);
+
+	modDataOutProperty.Subscribe(waiter->iStatus);
+
+
+	// Publish the file and section names to the module, to inform the module it has to
+	// carry out a re-read of the ini file.
+	TPckgBuf<TModuleDataIn> modDataInBuf;
+	TModuleDataIn& modDataIn = modDataInBuf();
+
+	// Copy across all the data items.
+	modDataIn.iRequestType = aModuleDataIn.iRequestType;
+	modDataIn.iConfigFileName = aModuleDataIn.iConfigFileName;
+	modDataIn.iConfigSection = aModuleDataIn.iConfigSection;
+	modDataIn.iAssDataEventType = aModuleDataIn.iAssDataEventType;
+	modDataIn.iAssDataTestMode = aModuleDataIn.iAssDataTestMode;
+	modDataIn.iKickOffEventType = aModuleDataIn.iKickOffEventType;
+	modDataIn.iTimeOut = aModuleDataIn.iTimeOut;
+	modDataIn.iError = aModuleDataIn.iError;
+	modDataIn.iTimeStampOffset = aModuleDataIn.iTimeStampOffset;
+    modDataIn.iOptionsChangeReportMode = aModuleDataIn.iOptionsChangeReportMode;
+
+	User::LeaveIfError(RProperty::Set(KUidSystemCategory, ELbsTestAGpsModuleIn, modDataInBuf));
+
+	TBool noResponse = ETrue;
+
+	// Wait for the notification from the test module.	
+	while(noResponse)
+		{
+	waiter->StartAndWait();
+	User::LeaveIfError(waiter->Result());
+
+	// Now ensure the notification response was good.
+	TModuleDataOut modDataOut;
+	TPckg<TModuleDataOut> modDataOutPckg(modDataOut);
+
+	User::LeaveIfError(modDataOutProperty.Get(modDataOutPckg));
+
+		if ((TModuleDataOut::EModuleResponse == modDataOut.iRequestType) && (TModuleDataOut::EModuleResponseOk == modDataOut.iResponse)) 
+		{
+			noResponse = EFalse;
+			}
+		}
+
+	CleanupStack::PopAndDestroy(waiter);
+	}
+
+
+EXPORT_C void T_LbsUtils::WaitForModuleToRequestAssistanceDataL()
+/** Wait for notification that the test AGPS module as requested assistance data.
+
+	Blocking function used to determine when the test module has requested assistance data as part of its location update.
+*/
+	{
+	RProperty modDataOutProperty;
+	User::LeaveIfError(modDataOutProperty.Attach(KUidSystemCategory, ELbsTestAGpsModuleOut));
+
+	CT_LbsAsyncWaiter* waiter = CT_LbsAsyncWaiter::NewL();
+	CleanupStack::PushL(waiter);
+
+	modDataOutProperty.Subscribe(waiter->iStatus);
+
+	// Wait for the notification from the test module.	
+	waiter->StartAndWait();
+	User::LeaveIfError(waiter->Result());
+
+	// Ensure the correct response is given.
+	TModuleDataOut modDataOut;
+	TPckg<TModuleDataOut> modDataOutPckg(modDataOut);
+
+	User::LeaveIfError(modDataOutProperty.Get(modDataOutPckg));
+	
+	if (TModuleDataOut::EModuleAssDataRequestedOk != modDataOut.iResponse)
+		{
+		User::LeaveIfError(KErrArgument);
+		}
+
+	CleanupStack::PopAndDestroy(waiter);
+	}
+
+EXPORT_C TBool T_LbsUtils::Compare_PosInfo(const TPositionInfoBase& aPosInfoSideA, const TPositionInfoBase& aPosInfoSideB)
+/** Compare two position info structures. Ensure all fields match excatly.
+
+@param aPosInfoSideA	The first structure to compare.
+@param aPosInfoSideB	The second structure to compare.
+@return					ETrue if both structure match excatly else EFalse.
+*/
+	{
+	return Compare_PosInfo(aPosInfoSideA, aPosInfoSideB, EExactAccuracy);
+	}
+
+
+EXPORT_C TBool T_LbsUtils::Compare_PosInfo(const TPositionInfoBase& aPosInfoSideA, const TPositionInfoBase& aPosInfoSideB, TComparisonAccuracyType aCmpAccuracy)
+	{
+	// TODO compare base class items, such as module id, position mode, etc.
+
+	TUint32 typeA = aPosInfoSideA.PositionClassType();
+	TUint32 typeB = aPosInfoSideB.PositionClassType();
+	
+	// Compare TPositionInfo type items.
+	if(typeA & typeB & EPositionInfoClass)
+		{
+		TESTLOG(ELogP1, "T_LbsUtils::Compare_PosInfo() Both positions are of type EPositionInfoClass");
+		const TPositionInfo& posInfoSideA = reinterpret_cast<const TPositionInfo&>(aPosInfoSideA);
+		const TPositionInfo& posInfoSideB = reinterpret_cast<const TPositionInfo&>(aPosInfoSideB);
+		
+		TPosition posSideA;
+		TPosition posSideB;
+		posInfoSideA.GetPosition(posSideA);
+		posInfoSideB.GetPosition(posSideB);
+
+		// Carry out an exact check when comparing items.
+		if (EExactAccuracy == aCmpAccuracy)
+			{
+			TESTLOG(ELogP1, "T_LbsUtils::Compare_PosInfo() Comparing positions for exact match");
+			// Compare latitude. 
+			if (Math::IsNaN(posSideA.Latitude()) && Math::IsNaN(posSideB.Latitude()))
+				;
+			else if (posSideA.Latitude() != posSideB.Latitude())
+				{
+				TESTLOG(ELogP1, "T_LbsUtils::Compare_PosInfo() Positions don't match!");
+				TESTLOG3(ELogP1, "Latitudes %d and %d respectively", posSideA.Latitude(), posSideB.Latitude());
+				return EFalse;
+				}
+			
+			// Compare longitude.
+			if (Math::IsNaN(posSideA.Longitude()) && Math::IsNaN(posSideB.Longitude()))
+				;
+			else if (posSideA.Longitude() != posSideB.Longitude())
+				{
+				TESTLOG(ELogP1, "T_LbsUtils::Compare_PosInfo() Positions don't match!");
+				TESTLOG3(ELogP1, "Longitudes %d and %d respectively", posSideA.Longitude(), posSideB.Longitude());
+				return EFalse;
+				}		
+			
+			// Compare altitude.
+			if (Math::IsNaN(posSideA.Altitude()) && Math::IsNaN(posSideB.Altitude()))
+				;
+			else if (posSideA.Altitude() != posSideB.Altitude())
+				{
+				TESTLOG(ELogP1, "T_LbsUtils::Compare_PosInfo() Positions don't match!");
+				TESTLOG3(ELogP1, "Altitudes %d and %d respectively", posSideA.Altitude(), posSideB.Altitude());				
+				return EFalse;
+				}
+			
+			// Compare datum.
+			if (posSideA.Datum() != posSideB.Datum())
+				{
+				TESTLOG(ELogP1, "T_LbsUtils::Compare_PosInfo() Positions don't match!");
+				TESTLOG3(ELogP1, "Datums %d and %d respectively", posSideA.Datum(), posSideB.Datum());				
+				return EFalse;
+				}				
+			
+			// Compare horizontal accuracy.
+			if (Math::IsNaN(posSideA.HorizontalAccuracy()) && Math::IsNaN(posSideB.HorizontalAccuracy()))
+				;
+			else if (posSideA.HorizontalAccuracy() != posSideB.HorizontalAccuracy())
+				{
+				TESTLOG(ELogP1, "T_LbsUtils::Compare_PosInfo() Positions don't match!");
+				TESTLOG3(ELogP1, "Horizontal Accuracies %d and %d respectively", posSideA.HorizontalAccuracy(), posSideB.HorizontalAccuracy());				
+				return EFalse;
+				}		
+			
+			// Compare vertical accuracy.
+			if (Math::IsNaN(posSideA.VerticalAccuracy()) && Math::IsNaN(posSideB.VerticalAccuracy()))
+				;
+			else if (posSideA.VerticalAccuracy() != posSideB.VerticalAccuracy())
+				{
+				TESTLOG(ELogP1, "T_LbsUtils::Compare_PosInfo() Positions don't match!");
+				TESTLOG3(ELogP1, "Vertical Accuracies %d and %d respectively", posSideA.VerticalAccuracy(), posSideB.VerticalAccuracy());				
+				return EFalse;
+				}		
+			}
+		else
+			{
+			// Check latitude + longitude using horz accuracy.
+			TReal horzAct = posSideA.HorizontalAccuracy(); // Use the verify accuracy value (which is side A).
+			TReal distance ;			
+	
+			TESTLOG(ELogP1, "T_LbsUtils::Compare_PosInfo() Comparing positions for 'rough' match");			
+		//	if(NAN != horzAct)
+				{
+				// The following is a temporary patch until TPositionInfo.Distance() is implemented:				
+/* 
+	from http://www.movable-type.co.uk/scripts/GIS-FAQ-5.1.html
+	
+	presuming a spherical Earth with radius R (see below), and the locations of the two points in spherical coordinates (longitude and latitude) are lon1,lat1 and lon2,lat2 then the
+
+	Haversine Formula (from R.W. Sinnott, "Virtues of the Haversine", Sky and Telescope, vol. 68, no. 2, 1984, p. 159):
+
+	dlon = lon2 - lon1
+	dlat = lat2 - lat1
+	a = sin^2(dlat/2) + cos(lat1) * cos(lat2) * sin^2(dlon/2)
+	c = 2 * arcsin(min(1,sqrt(a)))
+	d = R * c
+
+	will give mathematically and computationally exact results. 
+	
+*/				
+				const TReal pi = 3.141592653589793;
+				const TReal earthRadius = 6367 * 1000;	// earth radius in metres
+				
+				TReal32 latA = posSideA.Latitude() * (pi/180);
+				TReal32 latB = posSideB.Latitude() * (pi/180);
+				TReal32 lonA = posSideA.Longitude() * (pi/180);
+				TReal32 lonB = posSideB.Longitude() * (pi/180);
+				
+				TReal dlon = (lonB - lonA);	
+				TReal dlat = (latB - latA);
+				TReal sin_half_dlat, sin_half_dlon, coslatA, coslatB;
+				
+				Math::Sin(sin_half_dlat, dlat/2);
+				Math::Sin(sin_half_dlon, dlon/2);
+				Math::Cos(coslatA, latA);
+				Math::Cos(coslatB, latB);
+				
+				TReal a = (sin_half_dlat * sin_half_dlat) + (coslatA * coslatB * (sin_half_dlon * sin_half_dlon));
+				TReal sqrt_a;
+				Math::Sqrt(sqrt_a, a);
+				TReal arcsinmin;
+				
+				TReal min = Min(static_cast<TReal>(1), sqrt_a);
+				Math::ASin(arcsinmin, min);
+				
+				distance = earthRadius * (2 * arcsinmin);
+				
+				//__ASSERT_ALWAYS(!Math::IsNaN(distance), User::Panic(_L("Lbs Test Utils"), KErrGeneral));
+				if(Math::IsNaN(latA) || Math::IsNaN(lonA) || Math::IsNaN(horzAct))
+					{	
+					TESTLOG(ELogP1, "T_LbsUtils::Compare_PosInfo() Positions don't match because contains NaNs!");	
+					return EFalse;			
+					}
+				else if(distance > horzAct + 30)	// lrm allow for 30m discrepency for now TO DO figure out whether we should be able to check finer accuracy
+					{
+					TESTLOG(ELogP1, "T_LbsUtils::Compare_PosInfo() Positions don't match because distance greater than reported accuracy + margin!");
+					return EFalse;
+					}
+				}
+				
+			/*	put back later:	
+			TReal32 horzAct = posSideA.HorizontalAccuracy(); // Use the verify accuracy value (which is side A).
+			TReal32 distance ;			
+			
+			posSideA.Distance(posSideB, distance);
+			if (distance > horzAct)
+				return EFalse;
+		
+			// Check altitude using vert accuracy.
+			TReal32 vertAct = posSideA.VerticalAccuracy(); // Use the verify accuracy value (which is side A).
+			TReal32 height = Abs(posSideA.Altitude() - posSideB.Altitude());
+			if (height > vertAct)
+				return EFalse;
+			*/
+			
+			}
+			
+		// TODO, we don't compare times, not sure if this is something we would do later on
+//		if (posSideA.Time() != posSideB.Time())
+//			return EFalse;
+		
+		return ETrue;
+		}
+
+	// Compare TPositionCourseInfo type items.		
+	if (typeA & typeB & EPositionCourseInfoClass)
+		{
+		TESTLOG(ELogP1, "T_LbsUtils::Compare_PosInfo() Both positions are of type EPositionCourseInfoClass");
+		// TODO
+		}
+
+	// Compare TPositionSatelliteInfo type items.
+	if (typeA & typeB & EPositionSatelliteInfoClass)
+		{
+		TESTLOG(ELogP1, "T_LbsUtils::Compare_PosInfo() Both positions are of type EPositionSatelliteInfoClass");
+		// TODO
+		}
+
+/* For extended tests when we have them.
+	if (infoBase.PositionClassType() & EPositionClassTestExtension)
+		{
+		}
+*/
+	return EFalse;
+	}
+	
+	
+EXPORT_C TBool T_LbsUtils::Compare_PosInfoArr(RPointerArray<TAny>& aPosInfoArrSideA, RPointerArray<TAny>& aPosInfoArrSideB)
+	{
+	return Compare_PosInfoArr(aPosInfoArrSideA, aPosInfoArrSideB, EExactAccuracy);
+	}
+
+EXPORT_C TBool T_LbsUtils::Compare_PosInfoArr(RPointerArray<TAny>& aPosInfoArrSideA, RPointerArray<TAny>& aPosInfoArrSideB, TComparisonAccuracyType aCmpAccuracy)
+	{
+	// Only compare items if the arrays are the same size.
+	if (aPosInfoArrSideA.Count() == aPosInfoArrSideB.Count())
+		{
+		TPositionInfoBase* posInfoA;
+		TPositionInfoBase* posInfoB;
+		TBool res;
+		
+		for (TInt i = 0; i < aPosInfoArrSideA.Count(); ++i)
+			{
+			posInfoA = reinterpret_cast<TPositionInfoBase*>(aPosInfoArrSideA[i]);
+			posInfoB = reinterpret_cast<TPositionInfoBase*>(aPosInfoArrSideB[i]);
+			
+			res = Compare_PosInfo(*posInfoA, *posInfoB, aCmpAccuracy);
+			if (!res)
+				return EFalse;
+			}
+		}
+	
+	else
+		{
+		TESTLOG(ELogP1, "T_LbsUtils::Compare_PosInfoArr() Failed because different number of positions in arrays being compared!");
+		return EFalse;
+		}
+	return ETrue;
+	}
+
+
+EXPORT_C void T_LbsUtils::ResetAndDestroy_PosInfoArr(RPointerArray<TAny>& aPosInfoArr)
+	{
+		for (TInt i = 0; i < aPosInfoArr.Count(); ++i)
+			delete aPosInfoArr[i];
+		aPosInfoArr.Reset();	
+	}
+
+
+EXPORT_C TPositionModuleId T_LbsUtils::GetNetworkModuleIdL(RPositionServer& aServer)
+	{
+	TPositionModuleId modId;
+
+	User::LeaveIfError(GetModIdByTechnology(aServer, TPositionModuleInfo::ETechnologyNetwork, modId));
+	
+	return modId;
+	}
+
+
+EXPORT_C TPositionModuleId T_LbsUtils::GetAGpsModuleIdL(RPositionServer& aServer)
+	{
+	TPositionModuleId modId;
+
+	User::LeaveIfError(GetModIdByTechnology(aServer, (TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted), modId));
+	
+	return modId;
+	}
+	
+EXPORT_C TPositionModuleId T_LbsUtils::GetBadModuleId()
+	{
+	TPositionModuleId modId;
+	
+	modId.iUid = BAD_MODULE_ID;
+		
+	return modId;
+	}	
+
+
+EXPORT_C TBool T_LbsUtils::Compare_ModuleInfo(TPositionModuleInfo& aModInfoSideA, TPositionModuleInfo& aModInfoSideB)
+	{
+	// Compare all module information items and quality.
+	
+	// Compare module id.
+	if (aModInfoSideA.ModuleId() != aModInfoSideB.ModuleId())
+		{
+		return EFalse;
+		}	
+
+	//	Compare is available flag.
+	if (aModInfoSideA.IsAvailable() != aModInfoSideB.IsAvailable())
+		{
+		return EFalse;
+		}	
+
+	// Compare technology type.
+	if (aModInfoSideA.TechnologyType() != aModInfoSideB.TechnologyType())
+		{
+		return EFalse;
+		}	
+
+	//	Compare device location.
+	if (aModInfoSideA.DeviceLocation() != aModInfoSideB.DeviceLocation())
+		{
+		return EFalse;
+		}	
+
+	//	Compare capabilities.
+	if (aModInfoSideA.Capabilities() != aModInfoSideB.Capabilities())
+		{
+		return EFalse;
+		}	
+
+	// Compare each of the family classes. Use min and max enum values.
+	for (TInt i = EPositionInfoFamily; i <= EPositionUpdateOptionsFamily; i++)
+		{
+		if (aModInfoSideA.ClassesSupported(static_cast<TPositionClassFamily>(i)) != aModInfoSideB.ClassesSupported(static_cast<TPositionClassFamily>(i)))
+			{
+			return EFalse;
+			}	
+		}
+		
+	// Compare version.
+	if ((aModInfoSideA.Version().iMajor != aModInfoSideB.Version().iMajor) ||
+		(aModInfoSideA.Version().iMinor != aModInfoSideB.Version().iMinor) ||
+		(aModInfoSideA.Version().iBuild != aModInfoSideB.Version().iBuild))
+		{
+		return EFalse;
+		}	
+
+	// Compare module name.
+	TBuf<KPositionMaxModuleName> modNameSideA;
+	TBuf<KPositionMaxModuleName> modNameSideB;
+
+	aModInfoSideA.GetModuleName(modNameSideA);
+	aModInfoSideB.GetModuleName(modNameSideB);
+	if (0 != modNameSideA.Compare(modNameSideB))
+	{
+		return EFalse;
+	}
+
+	// Compare module quality.
+	TPositionQuality qualitySideA;
+	TPositionQuality qualitySideB;	
+	
+	aModInfoSideA.GetPositionQuality(qualitySideA);
+	aModInfoSideB.GetPositionQuality(qualitySideB);
+	
+	return Compare_PositionQuality(qualitySideA, qualitySideB);
+	}
+
+EXPORT_C TBool T_LbsUtils::Compare_ModuleStatus(TPositionModuleStatus& aModStatusSideA, TPositionModuleStatus& aModStatusSideB)
+	{
+	// Compare device status.
+	if (aModStatusSideA.DeviceStatus() != aModStatusSideB.DeviceStatus())
+		{
+		return EFalse;
+		}	
+
+	//	Compare quality status.
+	if (aModStatusSideA.DataQualityStatus() != aModStatusSideB.DataQualityStatus())
+		{
+		return EFalse;
+		}	
+		
+	return TRUE;
+	}
+	
+	
+EXPORT_C TBool Compare_ModuleUpdateOptions(TPositionUpdateOptions& aModUpdateOptsSideA, TPositionUpdateOptions& aModUpdateOptsSideB)
+	{
+	// Compare base class items.
+	if(aModUpdateOptsSideA.PositionClassSize() != aModUpdateOptsSideB.PositionClassSize())
+		{
+			return EFalse;
+		}
+
+	if(aModUpdateOptsSideA.PositionClassType() != aModUpdateOptsSideB.PositionClassType())
+		{
+			return EFalse;
+		}
+	
+	// Compare interval option.
+	if(aModUpdateOptsSideA.UpdateInterval() != aModUpdateOptsSideB.UpdateInterval())
+		{
+			return EFalse;
+		}
+	
+	// Compare timeout option.
+	if(aModUpdateOptsSideA.UpdateTimeOut() != aModUpdateOptsSideB.UpdateTimeOut())
+		{
+			return EFalse;
+		}
+
+	// Compare maxage option.
+	if(aModUpdateOptsSideA.MaxUpdateAge() != aModUpdateOptsSideB.MaxUpdateAge())
+		{
+			return EFalse;
+		}
+
+	// Compare partial update option.
+	if(aModUpdateOptsSideA.AcceptPartialUpdates() != aModUpdateOptsSideB.AcceptPartialUpdates()) 
+		{
+			return EFalse;
+		}
+		
+	return ETrue;
+	}
+
+
+EXPORT_C TBool T_LbsUtils::Compare_PositionQuality(TPositionQuality& aQualitySideA, TPositionQuality& aQualitySideB)
+/** Compare two position quality structures.
+
+@param aQualitySideA	
+@param aQualitySideB	
+*/
+	{
+	// Check if each quality contains the same number of assigned quality items.
+	if (aQualitySideA.HighWaterMark() != aQualitySideB.HighWaterMark())
+	{
+		return EFalse;
+	}
+	
+	// Compare each quality item.
+	TInt endId = aQualitySideA.HighWaterMark();
+	
+	for (TInt i = 0; i <= endId; i++)
+		{
+		// Element for each side must be defined.
+		if (!aQualitySideA.IsDefined(i) || !aQualitySideB.IsDefined(i))
+			{
+			return EFalse;
+			}
+
+		// Now compare the actual element.
+		TPositionQualityItem::TResult res;
+		if (KErrNone != aQualitySideA.Compare(aQualitySideB, i, res))
+			{
+			return EFalse;	
+			}
+		if (TPositionQualityItem::EIsEqual != res)
+			{
+			return EFalse;
+			}
+		}
+
+	return ETrue;	
+	}
+
+
+/**
+ *  Verifies that the supplied position is 'reasonable'
+ *
+ */
+EXPORT_C TBool T_LbsUtils::Verify_PositionIsValid(TPositionInfo& aPosInfo)
+	{
+	TBool valid = TRUE;
+	TPosition pos;
+	TReal32 alt;
+	TReal64 lat, longt;
+	
+	aPosInfo.GetPosition(pos);
+	
+	alt = pos.Altitude();
+	lat = pos.Latitude();
+	longt = pos.Longitude();
+	
+	// TO DO figure out what values are reasonable here (in Milton somewhere!?)
+	// We could use the normal verify posinfo stuff, and check to see if the values are roughly equal.
+	// Either update this func (add a parameter) or new func like the compare posinfo func we have
+	if(alt == 0 || lat == 0 || longt == 0)
+		{
+		valid = FALSE;
+		}
+	
+	
+	return valid;
+	}
+
+
+// May not be required.
+//EXPORT_C void T_LbsUtils::CreateSimpleAssistanceData(/*TLbsAssistanceDataGroup aDataMask, RDataReaderRootBase& aGpsRefTimeReader*/)
+//	{
+
+//	}
+
+/** Ensure the simple assistance data is correct. Typically the data is given by the simple
+	assistance data provider module used by the Net Sim.
+	
+@param aRefTimeReader The assistance data reader which holds the reference time data, the 
+						reader must be opened (use OpenL()) before calling this function.
+*/
+EXPORT_C TBool T_LbsUtils::VerifySimpleAssistanceData(RUEPositioningGpsReferenceTimeReader& aRefTimeReader)
+	{    
+	TUint week;
+	TUint tow1MSec;	                                            
+
+	// Access the reference time values.
+	aRefTimeReader.GetField(TUEPositioningGpsReferenceTime::EGpsWeek, week);
+	aRefTimeReader.GetField(TUEPositioningGpsReferenceTime::EGpsTow1Msec, tow1MSec);
+			
+	// Verify the reference time values.
+	TBool passed = ETrue;
+	
+	passed &= (week == KAssistanceData_RefTime_Week);
+	passed &= (tow1MSec == KAssistanceData_RefTime_Tow1MSec);
+
+	return passed;
+	}
+
+/** Create the module information depending on module id(i'e either agps_manager or network location manager) 
+    Fills a module info class/structure with values depending on the module id. 
+
+    @param  aModuleId       module id within the ini file
+    @param  aModInfo		The modified module info structure.
+*/
+EXPORT_C void T_LbsUtils::Create_ModuleInfoL(TPositionModuleId aModuleId, TPositionModuleInfo& aModInfo)
+
+	{  
+	   TPositionQuality posQuality;
+	
+	// Use these values if the module is a-gps manager 
+		if (aModuleId == (TUid::Uid(APGS_MODINFO_MODULE_ID)))
+		 {
+		 aModInfo.SetModuleId(TUid::Uid(APGS_MODINFO_MODULE_ID));
+	     aModInfo.SetIsAvailable(AGPS_MODINFO_IS_AVAILABLE);
+	     aModInfo.SetModuleName(AGPS_MODINFO_MOD_NAME);
+	     aModInfo.SetTechnologyType(AGPS_MODINFO_TECHNOLOGY_TYPE);
+	     aModInfo.SetDeviceLocation(AGPS_MODINFO_DEVICE_LOCATION);
+	     aModInfo.SetCapabilities(AGPS_MODINFO_CAPABILITIES);
+	      
+	     // Classes Supported - this is a binary bitmap, but support for each class 
+    	// has to be set individually.
+		
+	 	TInt supportedClasses = AGPS_MODINFO_CLASSES_SUPPORTED_POSITION_FAMILY; 
+    	TPositionClassFamily currentClass = EPositionInfoFamily;
+    	while(currentClass <= EPositionUpdateOptionsFamily)
+        	{
+        	aModInfo.SetClassesSupported(currentClass, supportedClasses & 1); 
+        	supportedClasses >>= 1;
+        	currentClass = static_cast<TPositionClassFamily>(static_cast<TInt>(currentClass) + 1);   		
+        	}
+	     	     
+	     aModInfo.SetVersion(AGPS_MODINFO_VERSION);
+    	 posQuality.SetTimeToFirstFix(AGPS_MODINFO_TIME_TO_FIRST_FIX);
+	     posQuality.SetTimeToNextFix(AGPS_MODINFO_TIME_TO_NEXT_FIX);
+    	 posQuality.SetHorizontalAccuracy(AGPS_MODINFO_HORIZONTAL_ACCURACY);
+	     posQuality.SetVerticalAccuracy(AGPS_MODINFO_VERTICAL_ACCURACY);
+    	 posQuality.SetCostIndicator(AGPS_MODINFO_COST_INDICATOR);
+	     posQuality.SetPowerConsumption(AGPS_MODINFO_POWER_CONSUMPTION);
+       	 aModInfo.SetPositionQuality(posQuality);
+      	 }
+	
+	//need to change after network location manager module is avaliable
+	//Use these values if the module is network location manager
+	   else if(aModuleId ==(TUid::Uid(NETWORK_MODINFO_MODULE_ID)))
+		   {
+		   aModInfo.SetModuleId(TUid::Uid(NETWORK_MODINFO_MODULE_ID));
+	       aModInfo.SetIsAvailable(NETWORK_MODINFO_IS_AVAILABLE);
+	       aModInfo.SetModuleName(NETWORK_MODINFO_MOD_NAME);
+	       aModInfo.SetTechnologyType(NETWORK_MODINFO_TECHNOLOGY_TYPE);
+	       aModInfo.SetDeviceLocation(NETWORK_MODINFO_DEVICE_LOCATION);
+	       aModInfo.SetCapabilities(NETWORK_MODINFO_CAPABILITIES);
+	       // Classes Supported - this is a binary bitmap, but support for each class 
+    	   // has to be set individually.
+		
+	 	   TInt supportedClasses = NETWORK_MODINFO_CLASSES_SUPPORTED_POSITION_FAMILY; 
+    	   TPositionClassFamily currentClass = EPositionInfoFamily;
+    	   while(currentClass <= EPositionUpdateOptionsFamily)
+        	{
+        	aModInfo.SetClassesSupported(currentClass, supportedClasses & 1); 
+        	supportedClasses >>= 1;
+        	currentClass = static_cast<TPositionClassFamily>(static_cast<TInt>(currentClass) + 1);   		
+        	}
+	      	      
+	       aModInfo.SetVersion(NETWORK_MODINFO_VERSION);
+    	   posQuality.SetTimeToFirstFix(NETWORK_MODINFO_TIME_TO_FIRST_FIX);
+	       posQuality.SetTimeToNextFix(NETWORK_MODINFO_TIME_TO_NEXT_FIX);
+    	   posQuality.SetHorizontalAccuracy(NETWORK_MODINFO_HORIZONTAL_ACCURACY);
+	       posQuality.SetVerticalAccuracy(NETWORK_MODINFO_VERTICAL_ACCURACY);
+    	   posQuality.SetCostIndicator(NETWORK_MODINFO_COST_INDICATOR);
+	       posQuality.SetPowerConsumption(NETWORK_MODINFO_POWER_CONSUMPTION); 
+	       aModInfo.SetPositionQuality(posQuality);
+		  }
+	  else
+	     {
+	       	User::Leave(KErrArgument);
+	      
+	     }  
+	 }
+
+TInt T_LbsUtils::GetModIdByTechnology(RPositionServer& aServer, TPositionModuleInfo::TTechnologyType aTechnologyType, TPositionModuleId& aModuleId)
+/** Searchs for a module which matches the required technology type. Once found the module id of the matched module
+	is given. The first module found which supports the technology will be returned.
+
+@param aServer			A position server. A client must have a connection with the server.
+@param aTechnologyType	The technology to match.
+@param aModuleId		The returned module id of the module which supports the required technology.
+@return					Err code:	KErrNone it module found.
+									KErrNotFound if no module is found which matches the required technology.
+									Any other system errors.
+*/
+{
+	TInt err;
+	TUint numMods;
+
+	err = aServer.GetNumModules(numMods);
+	if (KErrNone == err)
+		{
+		TInt i = 0;
+		TPositionModuleInfo	modInfo;
+		
+		// Look at each module until we find the required technology type.
+		while (i < numMods)
+			{
+			err = aServer.GetModuleInfoByIndex(i, modInfo);
+		
+			// Found it.
+			if (modInfo.TechnologyType() == aTechnologyType)
+				{
+				aModuleId = modInfo.ModuleId();
+				
+				return err;
+				}
+			i++;
+			}
+		}
+		
+	else
+	{
+		return err;
+	}
+	
+	return KErrNotFound;
+}
+
+
+/**
+ * Method for comparing base class member variables in Logevent types
+ */
+TBool T_LbsUtils::Compare_LogBase(const CLbsLogEvent& aLogEventSideA, const CLbsLogEvent& aLogEventSideB)
+{
+	if(aLogEventSideA.Direction() != aLogEventSideB.Direction())
+		return EFalse;
+	
+	if(aLogEventSideA.EventType() != aLogEventSideB.EventType())
+		return EFalse;
+	
+	if(aLogEventSideA.RequestOutcome() != aLogEventSideB.RequestOutcome())
+		return EFalse;
+
+	if(aLogEventSideA.IsCostInformationAvailable() != aLogEventSideB.IsCostInformationAvailable())
+		return EFalse;
+	else
+		{
+		//check cost info for each side
+		if(aLogEventSideA.CostInformation() != aLogEventSideB.CostInformation())
+		return EFalse;
+		}
+		
+	TPositionInfoBase* sideAPosInfo = reinterpret_cast<TPositionInfoBase*>(aLogEventSideA.PositionInfo());
+	TPositionInfoBase* sideBPosInfo = reinterpret_cast<TPositionInfoBase*>(aLogEventSideB.PositionInfo());
+	if(sideAPosInfo != NULL)
+		{
+		// If the actual log has a non-NULL posinfo...
+		if((*aLogEventSideA.PositionInfo()).ModuleId() != (*aLogEventSideB.PositionInfo()).ModuleId())
+			return EFalse;	
+		
+		if(!Compare_PosInfo(*aLogEventSideA.PositionInfo(), *aLogEventSideB.PositionInfo()))
+			return EFalse;	
+		}
+		else
+		{	
+			// else cheach that both sides have NULL
+			if(!(sideAPosInfo == NULL && sideBPosInfo == NULL))
+				return EFalse;	
+		}
+		
+
+
+return ETrue;
+}
+/**
+ * Method for comparing SelfLocateLog
+ */
+EXPORT_C TBool T_LbsUtils::Compare_SelfLocateLog(const CLbsSelfLocateLogEvent& aSelfLocateLogSideA, const CLbsSelfLocateLogEvent& aSelfLocateLogSideB)
+{
+	//Compare base class member variables
+	if(!Compare_LogBase(aSelfLocateLogSideA, aSelfLocateLogSideB))
+		return EFalse;
+	
+	if(aSelfLocateLogSideA.LocalApp() != aSelfLocateLogSideB.LocalApp())
+		return EFalse;
+	
+	return ETrue;
+}
+
+/**
+ * Method for comparing NetworkLocateLog
+ */
+EXPORT_C TBool T_LbsUtils::Compare_NetworkLocateLog(const CLbsNetworkLocateLogEvent& aNetworkLocateLogSideA, const CLbsNetworkLocateLogEvent& aNetworkLocateLogSideB)
+{
+	//Compare base class member variables
+	if(!Compare_LogBase(aNetworkLocateLogSideA, aNetworkLocateLogSideB))
+		return EFalse;
+	
+	if(aNetworkLocateLogSideA.LocalApp() != aNetworkLocateLogSideB.LocalApp())
+		return EFalse;
+	
+	return ETrue;
+}
+
+/**
+ * Method for comparing ExternalLocateLog
+ */
+EXPORT_C TBool T_LbsUtils::Compare_ExternalLocateLog(const CLbsExternalLocateLogEvent& aExternalLocateLogSideA, const CLbsExternalLocateLogEvent& aExternalLocateLogSideB)
+{
+	//Compare base class member variables
+	if(!Compare_LogBase(aExternalLocateLogSideA, aExternalLocateLogSideB))
+		return EFalse;
+	
+	if(!Compare_PosInfo(*aExternalLocateLogSideA.ReferenceLocation(), *aExternalLocateLogSideB.ReferenceLocation()))
+			return EFalse;				
+	
+	if(aExternalLocateLogSideA.RequestOriginator() != aExternalLocateLogSideB.RequestOriginator())
+		return EFalse;
+	
+	if(!Compare_ExternalRequestPrivacyRequestParams(aExternalLocateLogSideA.PrivacyRequestParams(), aExternalLocateLogSideB.PrivacyRequestParams()))
+		return EFalse;
+	
+	if(!Compare_ExternalRequestPrivacyResponseParams(aExternalLocateLogSideA.PrivacyResponseParams(), aExternalLocateLogSideB.PrivacyResponseParams()))
+		return EFalse;
+	
+return ETrue;
+}
+
+
+
+/**
+ * Method for comparing X3PLog
+ */
+EXPORT_C TBool T_LbsUtils::Compare_TransmitLocationLog(const CLbsTransmitLocationLogEvent& aX3PLogSideA, const CLbsTransmitLocationLogEvent& aX3PLogSideB)
+{
+	//Compare base class member variables
+	if(!Compare_LogBase(aX3PLogSideA, aX3PLogSideB))
+		return EFalse;
+	
+	if(aX3PLogSideA.X3PApp() != aX3PLogSideB.X3PApp())
+		return EFalse;
+	
+	if(!Compare_Destinations(aX3PLogSideA.Destination(), aX3PLogSideB.Destination()))
+		return EFalse;
+	
+	return ETrue;
+}
+
+
+/**
+ * Method for comparing AssistanceDataLog
+ */
+EXPORT_C TBool T_LbsUtils::Compare_AssistanceDataLog(const CLbsAssistanceDataLogEvent& aAssistanceDataLogSideA, const CLbsAssistanceDataLogEvent& aAssistanceDataLogSideB)
+{
+	//Compare base class member variables
+	if(!Compare_LogBase(aAssistanceDataLogSideA, aAssistanceDataLogSideB))
+		return EFalse;
+	
+	if(aAssistanceDataLogSideA.RequestAssistanceDataType() != aAssistanceDataLogSideB.RequestAssistanceDataType())
+		return EFalse;
+	
+
+	if(aAssistanceDataLogSideA.ReceiveAssistanceDataType() != aAssistanceDataLogSideB.ReceiveAssistanceDataType())
+		return EFalse;	
+	
+	return ETrue;
+}
+
+
+/**
+ * Method needed to compare external locate logs.
+ */
+TBool T_LbsUtils::Compare_ExternalRequestPrivacyRequestParams(const TLbsLoggingPrivacyRequestParams& aLogPrivacyRequestParamsSideA, const TLbsLoggingPrivacyRequestParams& aLogPrivacyRequestParamsSideB)
+{
+	if(aLogPrivacyRequestParamsSideA.iSessionId != aLogPrivacyRequestParamsSideB.iSessionId)
+		return EFalse;
+	
+	if(!Compare_ExternalRequestInfo(aLogPrivacyRequestParamsSideA.iRequestInfo, aLogPrivacyRequestParamsSideB.iRequestInfo))
+		return EFalse;
+	
+	if(!Compare_ExternalRequestPrivacy(aLogPrivacyRequestParamsSideA.iRequestPrivacy, aLogPrivacyRequestParamsSideB.iRequestPrivacy))
+		return EFalse;
+	
+	
+	
+	return ETrue;
+}
+
+
+/**
+ * Method needed to compare external locate logs.
+ * Compares TLbsExternalRequestInfo class.
+ */
+TBool T_LbsUtils::Compare_ExternalRequestInfo(const TLbsExternalRequestInfo& aExternalRequestInfoSideA, const TLbsExternalRequestInfo& aExternalRequestInfoSideB)
+{
+	TLbsRequesterId requesterIdSideA, requesterIdSideB;
+	TLbsClientName clientNameSideA, clientNameSideB;
+	TLbsClientExternalId clientExternalIdSideA, clientExternalIdSideB;
+	
+	aExternalRequestInfoSideA.GetRequesterId(requesterIdSideA);
+	aExternalRequestInfoSideA.GetClientName(clientNameSideA);
+	aExternalRequestInfoSideA.GetClientExternalId(clientExternalIdSideA);	
+	
+	aExternalRequestInfoSideB.GetRequesterId(requesterIdSideB);
+	aExternalRequestInfoSideB.GetClientName(clientNameSideB);
+	aExternalRequestInfoSideB.GetClientExternalId(clientExternalIdSideB);	
+	
+	// If these values are different, then return false
+	if(requesterIdSideA.Compare(requesterIdSideB))	// Should return 0 if equal
+		return EFalse;
+	
+	if(clientNameSideA.Compare(clientNameSideB))
+		return EFalse;
+		
+	if(clientExternalIdSideA.Compare(clientExternalIdSideB))
+		return EFalse;
+	
+	
+	return ETrue;
+}
+
+
+/**
+ * Method needed to compare external locate logs.
+ * Compares TLbsNetPosRequestPrivacy class.
+ */
+TBool T_LbsUtils::Compare_ExternalRequestPrivacy(const TLbsNetPosRequestPrivacy& aExternalRequestPrivacySideA, const TLbsNetPosRequestPrivacy& aExternalRequestPrivacySideB)
+{
+	if(aExternalRequestPrivacySideA.RequestAdvice() != aExternalRequestPrivacySideB.RequestAdvice())
+		return EFalse;
+	
+	if(aExternalRequestPrivacySideA.RequestAction() != aExternalRequestPrivacySideB.RequestAction())
+		return EFalse;
+	
+	return ETrue;
+}
+
+
+/**
+ * Method needed to compare external locate logs.
+ * Compares TPrivacyResponseParams class.
+ */
+TBool T_LbsUtils::Compare_ExternalRequestPrivacyResponseParams(const TLbsLoggingPrivacyResponseParams& aExternalRequestPrivacyResponseSideA, const TLbsLoggingPrivacyResponseParams& aExternalRequestPrivacyResponseSideB)
+{
+	if(aExternalRequestPrivacyResponseSideA.iSessionId != aExternalRequestPrivacyResponseSideB.iSessionId)
+		return EFalse;
+	
+	if(aExternalRequestPrivacyResponseSideA.iResult != aExternalRequestPrivacyResponseSideB.iResult)
+		return EFalse;
+		
+	return ETrue;
+}
+
+/**
+ * Method needed to Transmit to 3rd party destinations
+ * Compares TDesC16.
+ */
+TBool T_LbsUtils::Compare_Destinations(TDesC16& aDestinationFromRealLog, TDesC16& aDestinationFromExpectedLog)
+	{
+	if(aDestinationFromRealLog != aDestinationFromExpectedLog)
+		return EFalse;
+	
+	return ETrue;
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apfile/APFILE.MMP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+//
+// APFILE.MMP for component APFILE
+//
+
+/**
+@file
+
+@SYMPurpose apfile.dll Internal server helpers
+*/
+
+
+target          apfile.dll
+CAPABILITY All -Tcb
+targettype      DLL
+UID		0x1000008D 0x10003A3B
+VENDORID 0x70000001
+
+SOURCEPATH	../apfile
+
+userinclude   ../inc
+systeminclude   /epoc32/include
+
+macro UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER
+
+source			APFREC.CPP APFSTD.CPP aprfndr.cpp APRuleBased.CPP ApLaunchChecker.cpp ApSidChecker.cpp apuninstallmonitor.cpp
+source			apfmimecontentpolicy.cpp
+
+library         euser.lib efsrv.lib apparc.lib apgrfx.lib bafl.lib apserv.lib ecom.lib 
+library			apmime.lib caf.lib
+
+#if !defined(WINC)
+macro			USING_ECOM_RECOGS
+#endif
+
+#if defined(SYMBIAN_APPARC_APPINFO_CACHE)
+deffile			APFILE_UI_FRAMEWORKS.DEF
+#else
+deffile			APFILE_9_REMOVE_UI_FRAMEWORKS_V1.DEF
+#endif
+
+
+START RESOURCE ../apfile/apfmimecontentpolicy.rss
+HEADER  
+TARGETPATH   /resource/apps
+END
+
+START WINS
+	baseaddress	0x43000000
+END
+
+START MARM
+END
+
+// For the benefit of Eshell which cannot build a resource registration file
+START RESOURCE	eshell_reg.rss
+TARGETPATH	/private/10003a3f/apps
+END
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apfile/APFREC.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,419 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <apfrec.h>
+#include <e32uid.h>
+#include <f32file.h>
+#include <apadef.h>
+#include "APFSTD.H" // Panics etc.
+
+#ifdef USING_ECOM_RECOGS
+#include <ecom/ecom.h>
+#endif
+
+//
+// class TRecognizer
+//
+
+CApaScanningFileRecognizer::TRecognizer::TRecognizer(HBufC* aName)
+	: iName(aName)
+	{
+	}
+
+///////////////////////////////
+// CApaRecognizerDll
+///////////////////////////////
+
+class CApaRecognizerDll : public CBase
+	{
+public:
+	CApaRecognizerDll(HBufC* aName);
+	~CApaRecognizerDll(); // closes lib and deletes next
+
+	enum TPresence { ENotPresent, EIsPresent, ESuperseded };
+	inline TPresence Present() const { return iPresent; }
+	inline void Present(TPresence aPresence) { iPresent = aPresence; }
+	
+	inline CApaFileRecognizerType* Recognizer() { return iRec; }
+	inline void SetRecognizer(CApaFileRecognizerType& aRec) { iRec = &aRec; }
+public:
+	//lint --e{1925} Suppress "public data member" - bad OO but handy
+	CApaRecognizerDll* iNext;
+	CApaScanningFileRecognizer::TRecognizer iId; // cached so that this data can be accessed from other threads (RLibrary cant be used in this case)
+private:
+	RLibrary iLibrary;
+	TPresence iPresent;
+	CApaFileRecognizerType* iRec; // not ownership
+	};
+
+
+CApaRecognizerDll::~CApaRecognizerDll()
+	{
+	delete iId.iName;
+	iLibrary.Close();
+	delete iNext;
+	iRec = NULL;
+	}
+
+CApaRecognizerDll::CApaRecognizerDll(HBufC* aName)
+	: iId(aName)
+	{
+	}
+
+#ifdef USING_ECOM_RECOGS
+// CleanupEComArray function is used for cleanup support 
+// of locally declared arrays.
+void CleanUpEComInfoArray(TAny* aInfoArray)
+	{
+	RImplInfoPtrArray* infoArray = (static_cast<RImplInfoPtrArray*>(aInfoArray));
+	infoArray->ResetAndDestroy();
+	infoArray->Close();
+	}
+#endif
+
+// class CApaBackupOperationObserver
+CApaScanningFileRecognizer::CApaBackupOperationObserver::CApaBackupOperationObserver(CApaScanningFileRecognizer& aRecognizer)
+	: iRecognizer(aRecognizer)
+	{
+	TRAP_IGNORE(iSession = CBaBackupSessionWrapper::NewL());
+	}
+
+CApaScanningFileRecognizer::CApaBackupOperationObserver::~CApaBackupOperationObserver()
+	{
+	if (iSession)
+		{
+		iSession->DeRegisterBackupOperationObserver(*this);
+		delete iSession;
+		}
+	}
+
+void CApaScanningFileRecognizer::CApaBackupOperationObserver::RegisterObserverL()
+	{
+	if (iSession)
+		{
+		iSession->RegisterBackupOperationObserverL(*this);
+		}
+	}
+
+void CApaScanningFileRecognizer::CApaBackupOperationObserver::HandleBackupOperationEventL(const TBackupOperationAttributes& aBackupOperationAttributes)
+	{
+	if ((aBackupOperationAttributes.iFileFlag == MBackupObserver::EReleaseLockReadOnly ||
+		aBackupOperationAttributes.iFileFlag == MBackupObserver::EReleaseLockNoAccess)
+		&& aBackupOperationAttributes.iOperation == EStart)
+		{
+		// release recognizers not in rom
+		CApaRecognizerDll* rec=iRecognizer.iRecognizerLib;
+		while (rec)
+			{
+			CApaRecognizerDll* next=rec->iNext;
+			TDriveUnit drive(rec->iId.iDrive);
+			const TChar driveName=drive.Name()[0];
+			if(driveName != TChar('Z'))
+				{
+				iRecognizer.RemoveRecognizer(*rec);// ignore errors
+				}
+			rec = next;
+			}
+		}
+
+	if (aBackupOperationAttributes.iFileFlag == MBackupObserver::ETakeLock &&
+		(aBackupOperationAttributes.iOperation == EEnd ||
+		aBackupOperationAttributes.iOperation == EAbort))
+		{
+		iRecognizer.ScanForRecognizersL();
+		}
+	}
+
+TInt CApaScanningFileRecognizer::CApaBackupOperationObserver::UpdateCounter() const
+	{
+	return iUpdateCounter;
+	}
+
+void CApaScanningFileRecognizer::CApaBackupOperationObserver::SetUpdateCounter(TInt aValue)
+	{
+	iUpdateCounter = aValue;
+	}
+
+
+///////////////////////////////
+// CApaScanningFileRecognizer
+///////////////////////////////
+
+
+EXPORT_C CApaScanningFileRecognizer* CApaScanningFileRecognizer::NewL(RFs& aFs,MApaAppStarter* aAppStarter)
+	{
+	CApaScanningFileRecognizer* self=new(ELeave) CApaScanningFileRecognizer(aFs,aAppStarter);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	self->ScanForRecognizersL();
+	CleanupStack::Pop(); // self
+	return self;
+	}
+
+
+EXPORT_C CApaScanningFileRecognizer::CApaScanningFileRecognizer(RFs& aFs,MApaAppStarter* aAppStarter)
+	: CApaFileRecognizer(aFs), iAppStarter(aAppStarter)
+	{}
+
+
+EXPORT_C void CApaScanningFileRecognizer::ConstructL()
+	{
+	iObserver = new (ELeave) CApaBackupOperationObserver(*this);
+	iObserver->RegisterObserverL();
+	}
+
+
+EXPORT_C CApaScanningFileRecognizer::~CApaScanningFileRecognizer()
+	{
+	DestroyRecognizerList();
+	delete iRecognizerLib;
+	delete iObserver;
+	iAppStarter = NULL;
+	}
+
+EXPORT_C void CApaScanningFileRecognizer::ScanForRecognizersL()
+	{
+	// set all recognizers to not present - pending rediscoivery
+	CApaRecognizerDll* rec=iRecognizerLib;
+	while (rec)
+		{
+		rec->Present(CApaRecognizerDll::ENotPresent);
+		rec = rec->iNext;
+		}
+
+	ScanForEcomRecognizersL();
+	//
+	// remove any recognizers that are no longer present
+	rec=iRecognizerLib;
+	while (rec)
+		{
+		CApaRecognizerDll* next=rec->iNext;
+		if (rec->Present()==CApaRecognizerDll::ENotPresent)
+			RemoveRecognizer(*rec);
+		rec = next;
+		}
+	}
+
+
+TInt CApaScanningFileRecognizer::RemoveRecognizer(CApaRecognizerDll& aDll)
+	{
+	// try to remove the recognizer from the list
+	TInt ret=RemoveFileRecognizerType(aDll.Recognizer());
+	if (ret!=KErrNone && ret!=KErrNotFound)
+		return ret;
+	//
+	// get a handle to the previous entry in the list
+	CApaRecognizerDll* prev=NULL;
+	CApaRecognizerDll* dll=iRecognizerLib;
+	while (dll && (dll != &aDll))
+		{
+		prev = dll;
+		dll = dll->iNext;
+		}
+		
+	if (!dll)
+		{
+		Panic(EPanicLibraryNotInList);
+		}
+	else
+		{
+		// remove the dll
+		if (prev)
+			prev->iNext = dll->iNext;
+		else
+			iRecognizerLib = dll->iNext;
+		dll->iNext = NULL;
+		delete dll;
+		iObserver->SetUpdateCounter( iObserver->UpdateCounter()+ 1 );
+		}
+	return KErrNone;
+	}
+
+EXPORT_C TInt CApaScanningFileRecognizer::RecognizerCount()
+	{
+	CApaRecognizerDll* lib=iRecognizerLib;
+	TInt count=0;
+	while (lib)
+		{
+		count++;
+		lib = lib->iNext;
+		}
+	return count;
+	}
+
+
+EXPORT_C CApaScanningFileRecognizer::CRecognizerArray* CApaScanningFileRecognizer::RecognizerListLC()const
+	{
+	CRecognizerArray* list=new(ELeave) CArrayFixFlat<TRecognizer>(1);
+	CleanupStack::PushL(list);
+	CApaRecognizerDll* dll=iRecognizerLib;
+	while (dll)
+		{
+		list->AppendL(dll->iId);
+		dll = dll->iNext;
+		}
+	return list;
+	}
+
+EXPORT_C const CApaScanningFileRecognizer::TRecognizer& CApaScanningFileRecognizer::operator[](TInt aIndex)const
+	{
+	__ASSERT_ALWAYS(aIndex>=0,Panic(EPanicNegativeIndex));
+	// scan to correct dll
+	TInt num=0;
+	CApaRecognizerDll* dll=iRecognizerLib;
+	while (dll && num++<aIndex)
+		dll = dll->iNext;
+	__ASSERT_ALWAYS(dll,Panic(EPanicIndexOutOfRange));
+	//
+	// get info from dll
+	return dll->iId; //lint !e613 Suppress possible use of null pointer - asserted above
+	}
+
+EXPORT_C TInt CApaScanningFileRecognizer::UpdateCounter()const
+	{
+	return iObserver->UpdateCounter();
+	}
+
+EXPORT_C void CApaScanningFileRecognizer::SetEcomRecognizersFromListL(const CRecognizerArray& aList)
+	{
+	//for ecom style
+	for (TInt i=0 ; i<aList.Count() ; i++)
+		{
+		TDriveUnit drive(aList[i].iDrive);
+		TRAPD(ret, LoadEcomRecognizerL(drive,aList[i].iUid));
+		if (ret==KErrNoMemory)
+			{
+			User::Leave(ret); 
+			}
+		}
+	}
+
+EXPORT_C void CApaScanningFileRecognizer::SetEcomRecognizerL(const TRecognizer& aRecognizer)
+	{
+	//for ecom style 
+	TDriveUnit drive(aRecognizer.iDrive);
+	LoadEcomRecognizerL(drive,aRecognizer.iUid);
+	}
+
+//to find the name of  ecom style file recognizer corresponding to aImplUID
+#ifdef USING_ECOM_RECOGS
+HBufC* RecognizerNameL(TUid aImplUID)
+	{
+	RImplInfoPtrArray implementationInfoArray;
+	TCleanupItem cleanup(CleanUpEComInfoArray, &implementationInfoArray);
+	CleanupStack::PushL(cleanup);
+	REComSession::ListImplementationsL(KUidFileRecogInterfaceUid,implementationInfoArray);
+	const TInt availCount = implementationInfoArray.Count();
+	for (TInt ii=0;ii<availCount;++ii)
+		{
+		CImplementationInformation* info = implementationInfoArray[ii];
+		TUid uid = info->ImplementationUid();
+		if(uid.iUid == aImplUID.iUid )
+			{
+			HBufC* recogName = info->DisplayName().AllocL();
+			CleanupStack::PopAndDestroy(&implementationInfoArray);
+			return recogName;
+			}
+		}
+	CleanupStack::PopAndDestroy(&implementationInfoArray);
+	return KNullDesC().AllocL();
+	}
+
+//load the ecom file recognizer
+void CApaScanningFileRecognizer::LoadEcomRecognizerL(TDriveUnit& aDrive,TUid aUid)
+	{
+	// check we haven't loaded this one already
+	CApaRecognizerDll* lib=iRecognizerLib;
+	CApaRecognizerDll* last=NULL; // the previous one in the list
+	while (lib)
+		{
+		if (lib->iId.iUid==aUid)
+			{// we may have to override one
+			if (lib->Present()!=CApaRecognizerDll::ENotPresent)
+				{
+				return; // already found
+				}
+			else
+				{
+				lib->Present(CApaRecognizerDll::EIsPresent);
+				return;
+				}
+			}			
+		last = lib;
+		lib = lib->iNext;
+		}
+	// load the library
+	HBufC* recogName=RecognizerNameL(aUid);
+	CleanupStack::PushL(recogName);
+	lib = new(ELeave) CApaRecognizerDll(recogName);
+	CleanupStack::Pop(recogName);
+	CleanupStack::PushL(lib);
+	TRAPD(error,lib->SetRecognizer(*CApaFileRecognizerType::CreateFileRecognizerL(aUid)));
+	if(!error && lib->Recognizer())
+		{
+		lib->Present(CApaRecognizerDll::EIsPresent);
+		SetAppStarter(lib->Recognizer(),iAppStarter);
+		AddFileRecognizerType(lib->Recognizer());
+		lib->iId.iUid = aUid;
+		lib->iId.iDrive = aDrive;
+		iObserver->SetUpdateCounter( iObserver->UpdateCounter() + 1 );
+		//
+		// add lib to the library list
+		if (last)
+			{
+			while (last->iNext)
+				{
+				last=last->iNext;
+				}
+			__ASSERT_ALWAYS(last->iNext==NULL,Panic(EPanicIndexOutOfRange));
+			last->iNext = lib;
+			}
+		else
+			{
+			iRecognizerLib = lib;
+			}
+		CleanupStack::Pop(lib); // lib
+		}
+	else
+		{
+		CleanupStack::PopAndDestroy(lib); // lib
+		}
+	}
+#else
+void CApaScanningFileRecognizer::LoadEcomRecognizerL(TDriveUnit&,TUid)
+	{
+	} //lint !e1762 Suppress member function could be made const
+
+#endif
+
+void CApaScanningFileRecognizer::ScanForEcomRecognizersL()
+	{
+#ifdef USING_ECOM_RECOGS
+	//scan ecom plugin
+	RImplInfoPtrArray implementationArray;
+	TCleanupItem cleanup(CleanUpEComInfoArray, &implementationArray);
+	CleanupStack::PushL(cleanup);
+	REComSession::ListImplementationsL(KUidFileRecogInterfaceUid,implementationArray);
+	const TInt availCount = implementationArray.Count();
+	for (TInt count=0;count<availCount;++count)
+		{
+		const CImplementationInformation* info = implementationArray[count];
+		TUid uid = info->ImplementationUid();
+		TDriveUnit drive=info-> Drive();
+		TRAP_IGNORE(LoadEcomRecognizerL(drive,uid));
+		}
+	CleanupStack::PopAndDestroy(&implementationArray); 
+#endif
+	} //lint !e1762 Suppress member function could be made const
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apfile/APFSTD.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,26 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "APFSTD.H"
+
+
+GLDEF_C void Panic(TApfPanic aPanic)
+//
+// Panic the process with APPARC as the category.
+//
+	{
+	_LIT(KAppFilePanic,"APFILE");
+	User::Panic(KAppFilePanic,aPanic);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apfile/APFSTD.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,41 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+#if !defined(__APFSTD_H__)
+#define __APFSTD_H__
+
+#if !defined(__E32STD_H__)
+#include <e32std.h>
+#endif
+
+enum TApfPanic
+	{
+	EPanicFindAllAppsNotCalled,
+	EPanicLibraryNotInList,
+	EPanicInvalidFilename,
+	EPanicIndexOutOfRange,
+	EPanicNegativeIndex,
+	//
+	EDPanicBadDirName,
+	EDPanicDriveOutOfRange,
+	EDPanicStartDriveOutOfRange
+	};
+
+
+GLREF_C void Panic(TApfPanic aPanic);
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apfile/APRuleBased.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,157 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file
+// 
+//
+
+#include <aprulebased.h>
+#include <aplaunchchecker.h>
+#include "APFSTD.H" // Panics etc.
+
+void CleanUpEComInfoArray(TAny* aInfoArray);
+
+///////////////////////////////
+// CApaRuleBasedDll
+///////////////////////////////
+/** The rule-based framework. Mantain all rule-based plug-ins available in the system */
+class CApaRuleBasedDll : public CBase
+	{
+public:
+	CApaRuleBasedDll();
+	~CApaRuleBasedDll(); // closes lib and deletes next
+public:
+	enum TPresence { ENotPresent, EIsPresent };
+	inline TPresence Present() const { return iPresent; }
+	inline void Present(TPresence aPresence) { iPresent = aPresence; }
+	inline TUid Uid() const { return iUid; }
+	inline void Uid(TUid aUid) { iUid = aUid; }
+	inline CAppLaunchChecker* LaunchChecker() { return iLaunchChecker; }
+	inline void LaunchChecker(CAppLaunchChecker* aLaunchChecker) { iLaunchChecker = aLaunchChecker; }
+private:
+	TPresence iPresent;
+	TUid iUid;
+	CAppLaunchChecker* iLaunchChecker; // pointer to plug-in implementation
+	};
+
+CApaRuleBasedDll::CApaRuleBasedDll()
+	{
+	}
+
+CApaRuleBasedDll::~CApaRuleBasedDll()
+	{
+	delete iLaunchChecker;
+	}
+
+/** The function provides access to launch checker interface by index */
+EXPORT_C CAppLaunchChecker* CApaScanningRuleBasedPlugIns::operator[](TInt aIndex) const
+	{
+	return iRuleBasedLib[aIndex]->LaunchChecker();
+	} 
+
+EXPORT_C CApaScanningRuleBasedPlugIns* CApaScanningRuleBasedPlugIns::NewL()
+	{
+	CApaScanningRuleBasedPlugIns* self = new(ELeave) CApaScanningRuleBasedPlugIns();
+	CleanupStack::PushL(self);
+	self -> ScanForRuleBasedPlugInsL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+EXPORT_C CApaScanningRuleBasedPlugIns::~CApaScanningRuleBasedPlugIns()
+	{
+	iRuleBasedLib.ResetAndDestroy();
+	}
+
+/** The function loads the ecom rule-based plug-ins */
+void CApaScanningRuleBasedPlugIns::LoadEcomRuleBasedPlugInL(TUid aUid)
+	{
+	// check we haven't loaded this one already
+	for(TInt index = 0; index < iRuleBasedLib.Count(); index++)
+		{
+		CApaRuleBasedDll* lib = iRuleBasedLib[index];
+		if (lib->Uid() == aUid)
+			{// already found
+			lib -> Present(CApaRuleBasedDll::EIsPresent);
+			return;
+			}			
+		}
+
+	// load the library
+	CApaRuleBasedDll* lib = new(ELeave) CApaRuleBasedDll();
+	CleanupStack::PushL(lib);
+	TRAPD(error, lib -> LaunchChecker(CAppLaunchChecker::NewL(aUid)));
+	if((error == KErrNone) && lib -> LaunchChecker())
+		{
+		lib->Present(CApaRuleBasedDll::EIsPresent);
+		lib->Uid(aUid);
+
+		// add lib to the library list
+		iRuleBasedLib.Append(lib);
+		CleanupStack::Pop(lib);
+		}
+	else 
+		{
+		CleanupStack::PopAndDestroy(lib);
+		}
+	}
+
+/** The function scans and initializes all rule-based plug-ins available in the system */
+EXPORT_C void CApaScanningRuleBasedPlugIns::ScanForRuleBasedPlugInsL()
+	{
+	// set all rule based plug-ins to not present - pending rediscoivery
+	TInt index;
+	for (index = 0; index < iRuleBasedLib.Count(); index++)
+		{
+		CApaRuleBasedDll* rule = iRuleBasedLib[index];
+		rule -> Present(CApaRuleBasedDll::ENotPresent);
+		}
+	
+	//scan ecom plugin
+	RImplInfoPtrArray implementationArray;
+	TCleanupItem cleanup(CleanUpEComInfoArray, &implementationArray);
+	CleanupStack::PushL(cleanup);
+	REComSession::ListImplementationsL(KUidRuleBasedInterfaceUid, implementationArray);
+	const TInt availCount = implementationArray.Count();
+	for (TInt count = 0; count < availCount; ++count)
+		{
+		const CImplementationInformation* info = implementationArray[count];
+		TUid uid = info -> ImplementationUid();
+		LoadEcomRuleBasedPlugInL(uid);
+		}
+	CleanupStack::PopAndDestroy(&implementationArray);
+	
+	// remove any rule based plug-ins that are no longer present
+	index = 0;
+	while (index < iRuleBasedLib.Count())
+		{
+		CApaRuleBasedDll* rule = iRuleBasedLib[index];
+		if (rule -> Present() == CApaRuleBasedDll::ENotPresent)
+			{
+			iRuleBasedLib.Remove(index);
+			delete rule;
+			}
+		else
+			{
+			index++;
+			}
+		}
+	}
+
+/** The function returns number of plug-ins available in the system*/
+EXPORT_C  TInt CApaScanningRuleBasedPlugIns::ImplementationCount() const
+	{
+	return iRuleBasedLib.Count();
+	}
+
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apfile/ApLaunchChecker.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,47 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <aplaunchchecker.h>
+
+CAppLaunchChecker*	CAppLaunchChecker::NewL(const TUid aUid)
+/** Create an interface implementation to satisfy the specified interface.
+@param aUid Com interface implementation UID.
+@return The new application launch checker object. */
+	{
+	TAny* ptr = REComSession::CreateImplementationL(aUid, 
+		_FOFF(CAppLaunchChecker, iDtor_ID_Key));
+	return reinterpret_cast<CAppLaunchChecker*> (ptr);
+	}
+
+/** The destruction of interface implementation. */
+EXPORT_C CAppLaunchChecker::~CAppLaunchChecker()
+	{
+	REComSession::DestroyedImplementation(iDtor_ID_Key);
+	}
+
+EXPORT_C void CAppLaunchChecker::Reserved_1()
+	{
+	
+	}
+
+EXPORT_C void CAppLaunchChecker::Reserved_2()
+	{
+
+	}
+
+EXPORT_C void CAppLaunchChecker::Reserved_3()
+	{
+
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apfile/ApSidChecker.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,103 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <apsidchecker.h>
+#include <ecom/ecom.h>
+
+//const TUid KAppSidCheckerInterfaceUid = {0x10281FBB}; //old interface used when checking based only on SID
+const TUid KAppSidCheckerInterfaceUid = {0x20007D8C}; // current interface used when checking based on SID and drive number
+
+
+CAppSidChecker* CAppSidChecker::CheckerForAppType(const TUid &aAppTypeUid)
+	{
+	TEComResolverParams resolverParams;
+	TBuf8<KMaxUidName> sidName;
+	sidName.Copy(aAppTypeUid.Name());
+	resolverParams.SetDataType(sidName);
+	TAny* ptr = NULL;
+	TRAP_IGNORE( ptr = REComSession::CreateImplementationL(
+			KAppSidCheckerInterfaceUid,
+			_FOFF(CAppSidChecker, iDtor_ID_Key),
+			NULL, resolverParams) );
+	return reinterpret_cast<CAppSidChecker*>(ptr);
+	}
+
+/** The destruction of the interface implementation */
+EXPORT_C CAppSidChecker::~CAppSidChecker()
+	{
+	REComSession::DestroyedImplementation(iDtor_ID_Key);
+	iReserved1 = NULL;
+	iReserved2 = NULL;
+	iReserved3 = NULL;
+	}
+
+EXPORT_C void CAppSidChecker::SetRescanCallBackL(const TCallBack&)
+	{
+	}
+
+EXPORT_C void CAppSidChecker::reserved1()
+	{
+	}
+
+EXPORT_C void CAppSidChecker::reserved2()
+	{
+	}
+
+EXPORT_C void CAppSidChecker::reserved3()
+	{
+	}
+
+RSidCheckerMap::RSidCheckerMap( TCallBack aRescanCallBack ) :
+		iRescanCallBack( aRescanCallBack )
+	{
+	}
+
+CAppSidChecker& RSidCheckerMap::FindSidCheckerL(TUid aAppType)
+	{
+	CAppSidChecker* checker = NULL;
+	CAppSidChecker** checkerPtr = Find(aAppType.iUid);
+	if(checkerPtr)
+		{
+		checker = *checkerPtr;
+		}
+	else
+		{
+		// No CAppSidChecker instance loaded, try to find one
+		checker = CAppSidChecker::CheckerForAppType(aAppType);
+		if(checker)
+			{
+			CleanupStack::PushL(checker);
+			InsertL(aAppType.iUid, checker);
+			CleanupStack::Pop(checker);
+			checker->SetRescanCallBackL(iRescanCallBack);
+			}
+		else
+			{
+			User::Leave(KErrNotFound);
+			}
+		}
+	return *checker;
+	}
+
+void RSidCheckerMap::Close()
+	{
+	TIter iter(*this);
+	while(iter.NextValue())
+		{
+		delete *(iter.CurrentValue());
+		iter.RemoveCurrent();
+		}
+	RHashMap<TUint,CAppSidChecker*>::Close();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apfile/apfmimecontentpolicy.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,526 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+// INCLUDE FILES
+#include <apfmimecontentpolicy.h>
+#include <f32file.h> // RFs
+#include <barsread.h>
+#include <barsc.h> 
+#include <apfmimecontentpolicy.rsg>
+#include <caf/content.h>
+#include <e32base.h>
+#include <apgcli.h>    // For RApaLsSession 
+
+// Resource file name.
+_LIT(KCEResourceFile, "z:\\resource\\apps\\apfmimecontentpolicy.rsc"); 
+
+// This is needed for resource reading.
+const TInt KCCMask(0x00000fff);
+
+
+NONSHARABLE_CLASS(CApfMimeContentPolicyImpl) : public CBase
+	{
+public:	 // Constructors and destructor
+	static CApfMimeContentPolicyImpl* NewL();
+	static CApfMimeContentPolicyImpl* NewL(RFs& aFs);
+	~CApfMimeContentPolicyImpl();	
+
+public:  // New functions
+	TBool IsClosedType(const TDesC& aMimeType) const;
+	TBool IsClosedExtension(const TDesC& aFileExtension) const;
+	TBool IsClosedFileL(const TDesC& aFileName) const;
+	TBool IsDRMEnvelopeL(const TDesC& aFileName) const;	
+	TBool IsClosedFileL(RFile& aFileHandle) const;
+	TBool IsDRMEnvelopeL(RFile& aFileHandle) const;
+
+private:	
+	CApfMimeContentPolicyImpl();
+	void ConstructL();
+    void ConstructL(RFs& aFs);
+	TBool IsClosedFileL(RFile& aFileHandle, const TDesC& aFileName) const;
+	void ReadResourcesL(RFs& aFs);
+
+private:
+	CDesCArrayFlat* iCcl;	// Closed content list.
+	CDesCArrayFlat* iExtList;	// Closed extensions list.
+	RApaLsSession   iLs;	// A session to the Application Architecture server.
+    mutable RFs iFs;	//	File session
+    TBool   iFsConnected;	// ETrue if connected to file server, else EFalse
+	};
+
+
+//
+// class CApfMimeContentPolicy
+//
+
+/**
+C++ default constructor.
+*/
+CApfMimeContentPolicy::CApfMimeContentPolicy()
+	{
+	// Nothing to do here.
+	}
+
+/**
+By default Symbian 2nd phase constructor is private.
+*/
+void CApfMimeContentPolicy::ConstructL()
+	{
+	iImpl = CApfMimeContentPolicyImpl::NewL();
+	}
+
+/**
+By default Symbian 2nd phase constructor is private.
+@param aFs  A handle to a shared file server session.
+*/
+void CApfMimeContentPolicy::ConstructL(RFs& aFs)
+	{
+	iImpl = CApfMimeContentPolicyImpl::NewL(aFs);
+	}
+
+/**
+Creates a new Mime Content Policy object, and puts a pointer to it onto the cleanup stack.
+@return  The new Mime Content Policy object.
+*/
+EXPORT_C CApfMimeContentPolicy* CApfMimeContentPolicy::NewLC()
+	{
+	CApfMimeContentPolicy* self = new (ELeave) CApfMimeContentPolicy();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+    
+/**
+Creates a new Mime Content Policy object, and puts a pointer to it onto the cleanup stack.
+@param aFs  A handle to a shared file server session. 
+@return  The new Mime Content Policy object.
+*/
+EXPORT_C CApfMimeContentPolicy* CApfMimeContentPolicy::NewLC(RFs& aFs)
+	{
+	CApfMimeContentPolicy* self = new (ELeave) CApfMimeContentPolicy();
+	CleanupStack::PushL(self);
+	self->ConstructL(aFs);
+	return self;
+	}
+	
+/**
+Creates a new Mime Content Policy object.
+@return  The new Mime Content Policy object.
+*/
+EXPORT_C CApfMimeContentPolicy* CApfMimeContentPolicy::NewL()
+	{
+	CApfMimeContentPolicy* self = NewLC();
+	CleanupStack::Pop();
+	return self;
+	}
+
+/**
+Creates a new Mime Content Policy object.
+@param aFs  A handle to a shared file server session.
+@return  	The new Mime Content Policy object.
+*/
+EXPORT_C CApfMimeContentPolicy* CApfMimeContentPolicy::NewL(RFs& aFs)
+	{
+	CApfMimeContentPolicy* self = NewLC(aFs);
+	CleanupStack::Pop();
+	return self;
+	}
+
+
+/**
+Destructor.
+*/
+EXPORT_C CApfMimeContentPolicy::~CApfMimeContentPolicy()
+	{
+	delete iImpl;
+	}
+
+/**
+Checks if given MIME type is included in closed content list.
+@param aMimeType  The mime type to be checked.   
+@return  ETrue if given MIME type is in closed content list else returns EFalse.
+*/
+EXPORT_C TBool CApfMimeContentPolicy::IsClosedType(const TDesC& aMimeType)
+	{	
+	return iImpl->IsClosedType(aMimeType);
+	}
+
+/**
+Checks the extension of given file against list of closed file extensions.
+@param aFileExtension File extension to be checked.
+@return ETrue if extension of given file name is in closed extensions list else returns EFalse.
+*/
+EXPORT_C TBool CApfMimeContentPolicy::IsClosedExtension(const TDesC& aFileExtension)
+	{
+	return iImpl->IsClosedExtension(aFileExtension);
+	}
+
+/**
+Checks if given file is Closed or not.
+This method checks for forward lock and superdistribution statuses of the file, in addition to IsClosedExtension 
+and IsClosedType checks.
+
+@param aFileName  A file to be checked   
+@return  ETrue if given file is closed else returns EFalse.
+@leave KErrNone, if successful; otherwise one of the other system-wide error codes
+*/
+EXPORT_C TBool CApfMimeContentPolicy::IsClosedFileL(const TDesC& aFileName)
+	{
+	return iImpl->IsClosedFileL(aFileName);
+	}
+
+
+/**
+Checks if given file is a DRM envelope. Can leave if file handling fails.
+@param aFileName  A file to be checked. 
+@return ETrue if file is DRM envelope else returns EFalse.
+@leave	KErrCANotSupported if the requested attribute does not exist. 
+KErrPermissionDenied if the access to the protected content is not permitted 
+by the CAF Agent. Otherwise one of the other CAF error codes defined in 
+caferr.h or one of the other system-wide error codes for any other errors.  
+*/
+EXPORT_C TBool CApfMimeContentPolicy::IsDRMEnvelopeL(const TDesC& aFileName)
+	{
+	return iImpl->IsDRMEnvelopeL(aFileName);
+	}
+
+/**
+Checks if given file is Closed or not. This method checks for forward lock and 
+superdistribution statuses of the file, in addition to IsClosedExtension and IsClosedType checks.
+Remember to make a file handle sharable. When a file handle is shared, the RFs handle has to be shared too. 
+@param aFileHandle  Handle to the file to be checked.  
+@return ETrue if given file is closed else returns EFalse.
+@leave KErrNone, if successful; KErrBadHandle if an invalid handle has been passed as a parameter.
+otherwise one of the other system-wide error codes
+*/
+EXPORT_C TBool CApfMimeContentPolicy::IsClosedFileL(RFile& aFileHandle)
+	{
+	return iImpl->IsClosedFileL(aFileHandle);
+	}
+
+
+/**
+Checks if given file is a DRM envelope. Can leave if file handling fails.
+@param aFileHandle  Handle to the file to be checked. 
+@return ETrue if file is DRM envelope else returns EFalse.
+@leave	KErrCANotSupported if the requested attribute does not exist. 
+KErrPermissionDenied if the access to the protected content is not permitted 
+by the CAF Agent. Otherwise one of the other CAF error codes defined in 
+caferr.h or one of the other system-wide error codes for any other errors.  
+*/
+EXPORT_C TBool CApfMimeContentPolicy::IsDRMEnvelopeL(RFile& aFileHandle)
+	{
+	return iImpl->IsDRMEnvelopeL(aFileHandle);
+	}
+
+//
+// class CApfMimeContentPolicyImpl
+//
+
+/**
+C++ default constructor.
+*/
+CApfMimeContentPolicyImpl::CApfMimeContentPolicyImpl()
+	{
+	// C++ default constructor can NOT contain any code, that
+	}
+
+/**
+By default Symbian 2nd phase constructor is private.
+*/
+void CApfMimeContentPolicyImpl::ConstructL()
+	{
+	// Resource reading is done without coe & eikon env.
+	User::LeaveIfError(iFs.Connect());
+	iFsConnected = ETrue;
+	
+	User::LeaveIfError(iFs.ShareProtected());
+	ReadResourcesL(iFs);
+	}
+	
+/**
+By default Symbian 2nd phase constructor is private.
+@param aFs A handle to a shared file server session. 
+*/
+void CApfMimeContentPolicyImpl::ConstructL(RFs& aFs)
+	{
+	iFsConnected = EFalse;
+	iFs = aFs;	
+	ReadResourcesL(iFs);
+	}
+
+/**
+Two-phased constructor.
+*/
+CApfMimeContentPolicyImpl* CApfMimeContentPolicyImpl::NewL()
+	{
+	CApfMimeContentPolicyImpl* self = new (ELeave) CApfMimeContentPolicyImpl();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	
+	return self;
+	}
+
+/**
+Two-phased constructor.
+*/
+CApfMimeContentPolicyImpl* CApfMimeContentPolicyImpl::NewL(RFs& aFs)
+	{
+	CApfMimeContentPolicyImpl* self = new (ELeave) CApfMimeContentPolicyImpl();
+	CleanupStack::PushL(self);
+	self->ConstructL(aFs);
+	CleanupStack::Pop(self);
+
+	return self;
+	}
+	
+/**
+Destructor.
+*/
+CApfMimeContentPolicyImpl::~CApfMimeContentPolicyImpl()
+	{
+	iLs.Close();
+	
+	if(iFsConnected)
+        iFs.Close();
+
+	delete iCcl;
+	delete iExtList;
+	}
+
+/**
+Checks if given MIME type is included in closed content list.
+@param aMimeType  The mime type to be checked.
+@return ETrue if given MIME type is in closed content list else returns EFalse.
+*/
+TBool CApfMimeContentPolicyImpl::IsClosedType(const TDesC& aMimeType) const 
+	{
+	TInt dummy = 0;
+	 
+	// Check if given descriptor is in closed content list.
+	// Find() returns 0 if found from array, non-zero if not.
+	const TBool found = (iCcl->FindIsq(aMimeType, dummy) == 0);
+	return found;
+	}
+
+/**
+Checks the extension of given file against list of closed file extensions.
+@param aFileExtension File extension to be checked.
+@return  ETrue  if extension of given file name is in closed extensions list else returns EFalse.
+*/
+TBool CApfMimeContentPolicyImpl::IsClosedExtension(const TDesC& aFileExtension) const
+	{
+	TInt dummy = 0;
+
+	// Check if given descriptor is in closed content list.
+	// Find() returns 0 if found from array, non-zero if not.
+	const TBool found = (iExtList->FindIsq(aFileExtension, dummy) == 0);
+	return found;
+	}
+	
+/**
+Checks if given file is Closed or not. This method checks for forward lock and superdistribution statuses 
+of the file, in addition to IsClosedExtension and IsClosedType checks.
+@param aFileName  A file to be checked.
+@return ETrue if given file is closed else returns EFalse. 
+@leave KErrNone, if successful; otherwise one of the other system-wide error codes.
+*/
+TBool CApfMimeContentPolicyImpl::IsClosedFileL(const TDesC& aFileName) const
+	{
+	RFile file;
+    TInt protectionError;
+
+    // open file to be checked for protection
+    protectionError = file.Open(iFs, aFileName, EFileRead | EFileShareReadersOnly);
+    
+    // If the file is already opened using EFileShareAny (which is against best practices), we have to use it also.
+    if (protectionError == KErrInUse) 
+        protectionError = file.Open(iFs, aFileName, EFileRead | EFileShareAny);
+    
+    User::LeaveIfError(protectionError);
+
+    CleanupClosePushL(file);
+    const TBool retVal = IsClosedFileL(file, aFileName);
+    CleanupStack::PopAndDestroy(); // file
+    return retVal;
+	}
+	
+/**
+Checks if given file is Closed or not. This method checks for forward lock and superdistribution statuses 
+of the file, in addition to IsClosedExtension and IsClosedType checks.
+@param aFileHandle  Handle to the file to be checked.   
+@return ETrue if given file is closed else returns EFalse.
+@leave KErrNone, if successful; KErrBadHandle if an invalid handle has been passed as a parameter.
+otherwise one of the other system-wide error codes.
+*/
+TBool CApfMimeContentPolicyImpl::IsClosedFileL(RFile& aFileHandle) const
+	{
+	if (aFileHandle.SubSessionHandle())
+	    {
+	    TFileName name;
+	    aFileHandle.Name(name);
+        return IsClosedFileL(aFileHandle, name);
+    	}
+
+    User::Leave(KErrBadHandle);
+    return EFalse;	// to keep compiler happy
+	}
+
+/**
+Checks if given file is Closed or not.
+@param aFileHandle  Handle to the file to be checked.
+@param aFileName  File to be checked.
+@return ETrue if given file is closed else returns EFalse.
+@leave KErrNone, if successful; KErrBadHandle if an invalid handle has been passed as a parameter.
+otherwise one of the other system-wide error codes.
+*/
+TBool CApfMimeContentPolicyImpl::IsClosedFileL(RFile& aFileHandle, const TDesC& aFileName) const
+	{
+    TInt value = 0; 
+    // allocate a content object
+    ContentAccess::CContent* content = ContentAccess::CContent::NewL(aFileHandle);
+    
+    // Check if file is protected
+    // If the file type can not be determined just forget it.
+    if (content->GetAttribute(ContentAccess::EIsProtected, value) == KErrNone)
+        {
+        if (value)
+ 		    {
+        	// File is DRM protected
+        	value = 0;
+        	// Check if file is forwardable
+        	if (content->GetAttribute(ContentAccess::EIsForwardable, value) == KErrNone)
+        	    {
+        	    delete content;
+        	    if (!value)
+                    {
+                    // EIsProtected == ETrue &&  EIsForwardable == EFalse => EForwardLocked
+                    // If forwardlocked, sending never allowed, so return without further ado.
+			        return ETrue;	
+                    }
+                else
+                    {
+                    // EIsProtected == ETrue &&  EIsForwardable == ETrue => ESuperDistributable
+                    // No need to check extension or mime type for files that are superdistributable,
+			        // they must not be blocked in any case.
+			        return EFalse;
+                    }
+        	    }
+ 		    }
+        }
+    
+    delete content;
+    content = NULL;
+    
+    // Check file extension.	
+	TParse parser;
+	parser.Set(aFileName, NULL, NULL);
+	if (IsClosedExtension(parser.Ext()))
+		return ETrue;
+
+	// Recognize and check MIME type.	
+	TDataType recData;
+	TUid uid;
+	const TInt err(iLs.AppForDocument(aFileHandle, uid, recData));
+	User::LeaveIfError(err);
+	    
+	return IsClosedType(recData.Des());   // Check MIME type.
+	}
+
+/**
+Checks if given file is a DRM envelope. Can leave if file handling fails.
+@param aFileName  A file to be checked.
+@return ETrue if file is DRM envelope else returns EFalse.
+@leave	KErrCANotSupported if the requested attribute does not exist.
+KErrPermissionDenied if the access to the protected content is not permitted 
+by the CAF Agent. Otherwise one of the other CAF error codes defined in 
+caferr.h or one of the other system-wide error codes for any other errors.
+*/
+TBool CApfMimeContentPolicyImpl::IsDRMEnvelopeL(const TDesC& aFileName) const
+	{
+    // allocate a content object
+    ContentAccess::CContent* content = ContentAccess::CContent::NewLC(aFileName, ContentAccess::EContentShareReadOnly);
+    
+    TInt value = 0;
+    User::LeaveIfError(content->GetAttribute(ContentAccess::EIsProtected, value));
+    CleanupStack::PopAndDestroy(content);
+    
+    return (value != 0);    // File is DRM protected if value != 0
+	}
+	
+/**
+Checks if given file is a DRM envelope. Can leave if file handling fails.
+@param aFileHandle  Handle to the file to be checked.
+@return ETrue if file is DRM envelope else returns EFalse.
+@leave	KErrCANotSupported if the requested attribute does not exist. 
+KErrPermissionDenied if the access to the protected content is not permitted 
+by the CAF Agent. Otherwise one of the other CAF error codes defined in 
+caferr.h or one of the other system-wide error codes for any other errors. 
+*/
+TBool CApfMimeContentPolicyImpl::IsDRMEnvelopeL(RFile& aFileHandle) const
+	{
+    // allocate a content object
+    ContentAccess::CContent* content = ContentAccess::CContent::NewLC(aFileHandle);
+    
+    TInt value = 0;
+    User::LeaveIfError(content->GetAttribute(ContentAccess::EIsProtected, value));
+    CleanupStack::PopAndDestroy(content);
+       
+    return (value != 0);    // File is DRM protected if value != 0
+	}
+
+	
+/**
+Reads closed content list and closed extensions list. Connects to RApaLsSession.
+Called by constructor.
+@param aFs A handle to a shared file server session. 
+*/
+void CApfMimeContentPolicyImpl::ReadResourcesL(RFs& aFs)
+	{
+	TResourceReader reader;	
+
+	// Resource reading is done without coe & eikon env.
+	RResourceFile rsFile;
+	rsFile.OpenL(aFs, KCEResourceFile);
+	CleanupClosePushL(rsFile);
+
+	// Read closed content list.
+	// Remove offset from id
+    HBufC8* rBuffer = rsFile.AllocReadLC(R_COMMONENG_CLOSED_CONTENT_LIST & KCCMask);
+	reader.SetBuffer(rBuffer);
+	ASSERT(!iCcl);
+	iCcl = reader.ReadDesCArrayL();
+	CleanupStack::PopAndDestroy(rBuffer); // rBuffer
+
+	// Read closed extensions list.
+	// Remove offset from id
+    rBuffer = rsFile.AllocReadLC(R_COMMONENG_CLOSED_EXTENSIONS_LIST & KCCMask); 
+	reader.SetBuffer(rBuffer);
+	ASSERT(!iExtList);
+	iExtList = reader.ReadDesCArrayL();
+	CleanupStack::PopAndDestroy(2); // rBuffer, rsFile 
+	    
+    // Sort lists to enable binary find
+    iCcl->Sort();
+    iExtList->Sort();
+
+	// Connect RApaLsSession and leave it open for the whole
+	// lifetime of the object.
+	User::LeaveIfError(iLs.Connect());
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apfile/apfmimecontentpolicy.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,79 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+NAME CCLS
+
+#include <uikon.rh>
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+//----------------------------------------------------
+//    r_commoneng_closed_content_list
+//	  Contains all MIME types in closed content list.	    
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_commoneng_closed_content_list
+    {
+    items=
+        {	
+        LBUF { txt="application/vnd.oma.drm.message"; },
+		LBUF { txt="application/vnd.oma.drm.rights+xml"; },
+		LBUF { txt="application/vnd.oma.drm.rights+wbxml"; },
+		LBUF { txt="application/vnd.nokia.ringing-tone"; },
+		LBUF { txt="audio/amr-wb"; },
+		LBUF { txt="audio/sp-midi"; },
+		LBUF { txt="image/vnd.nok.3Dscreensaver"; },
+		LBUF { txt="image/vnd.nok-wallpaper"; },
+		LBUF { txt="image/vnd.nok-oplogo"; },
+		LBUF { txt="image/vnd.nok-oplogo-color"; },
+		LBUF { txt="application/java"; },
+		LBUF { txt="application/java-archive"; },
+		LBUF { txt="application/x-java-archive"; },
+		LBUF { txt="text/vnd.sun.j2me.app-descriptor"; },
+		LBUF { txt="application/x-NokiaGameData"; },
+		LBUF { txt="application/vnd.symbian.install"; },
+		LBUF { txt="x-epoc/x-sisx-app"; }  
+        };
+    }
+
+//----------------------------------------------------
+//    r_commoneng_closed_extensions_list
+//	  List of closed file extensions.	
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_commoneng_closed_extensions_list
+    {
+    items=
+        {
+		LBUF { txt=".dm"; },
+		LBUF { txt=".dr"; },
+		LBUF { txt=".drc"; },
+		LBUF { txt=".ott"; },
+		LBUF { txt=".awb"; },
+		LBUF { txt=".mid"; },
+		LBUF { txt=".c3d"; },
+		LBUF { txt=".jar"; },
+		LBUF { txt=".ngd"; },
+		LBUF { txt=".sis"; },
+		LBUF { txt=".sisx"; }
+        };
+    }
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apfile/aprfndr.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,458 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "aprfndr.h"
+#include "APFDEF.H"
+#include "APFSTD.H"
+#include "../apgrfx/APGAIR.H"
+#include <apsserv.h>
+#include "../apgrfx/apprivate.h"
+#include <apsidchecker.h>
+
+/////////////////////////////
+// CApaAppRegFinder
+/////////////////////////////
+
+EXPORT_C CApaAppRegFinder* CApaAppRegFinder::NewL(const RFs& aFs)
+	{
+	CApaAppRegFinder* self=NewLC(aFs);
+	CleanupStack::Pop(self);
+	return self;
+	}
+	
+EXPORT_C CApaAppRegFinder* CApaAppRegFinder::NewLC(const RFs& aFs)
+	{
+	CApaAppRegFinder* self=new (ELeave) CApaAppRegFinder(aFs);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+	
+CApaAppRegFinder::CApaAppRegFinder(const RFs& aFs)
+	: iFs(aFs),
+	  iListOfFolders(2),
+	  iSidCheckerMap(CApaAppListServer::Self()?CApaAppListServer::Self()->RescanCallBack():TCallBack(NULL,NULL))
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+	  ,iRemovableMediaDriveScan(EFalse)
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+
+	{
+	}
+
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+CApaAppRegFinder::~CApaAppRegFinder()
+	{
+	iListOfFolders.ResetAndDestroy();
+	iListOfFolders.Close();
+	iListOfDrives.Close();
+	iSidCheckerMap.Close();
+	delete iFileList; // should already be deleted and NULL at this point
+	}
+#else
+CApaAppRegFinder::~CApaAppRegFinder()
+	{
+	iListOfFolders.ResetAndDestroy();
+	iListOfFolders.Close();
+	if (iListOfDrives)
+		{
+		iListOfDrives->Close();
+		delete iListOfDrives;
+		}
+	iSidCheckerMap.Close();
+	
+	delete iFileList; // should already be deleted and NULL at this point
+	}
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+
+void CApaAppRegFinder::ConstructL()
+	{
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+	BuildDriveListL();
+#else
+	GetDriveListL();
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+	GetFolderListL();
+	}
+
+#ifndef SYMBIAN_APPARC_APPINFO_CACHE
+void CApaAppRegFinder::GetDriveListL()
+	{
+	TDriveList driveList;
+	User::LeaveIfError(iFs.DriveList(driveList));
+	iListOfDrives = new(ELeave) RArray<TDriveUnitInfo>(4);
+	BuildDriveListL(iFs, driveList, *iListOfDrives);
+	}
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+
+_LIT(KAppRegRscSearchPath,"\\private\\10003a3f\\apps\\");
+_LIT(KAppRegRscImportSearchPath,"\\private\\10003a3f\\import\\apps\\");
+_LIT(KAppRegRscImportNonNativeSearchPath,"\\private\\10003a3f\\import\\apps\\NonNative\\Resource\\");
+
+void CApaAppRegFinder::GetFolderListL()
+	{
+	TPtrC ptr(KAppRegRscSearchPath);
+	HBufC* searchPath = ptr.AllocLC();
+	User::LeaveIfError(iListOfFolders.Append(searchPath));
+	CleanupStack::Pop(searchPath);
+	searchPath = NULL;
+
+	ptr.Set(KAppRegRscImportSearchPath);
+	searchPath = ptr.AllocLC();
+	User::LeaveIfError(iListOfFolders.Append(searchPath));
+	CleanupStack::Pop(searchPath);
+
+	ptr.Set(KAppRegRscImportNonNativeSearchPath);
+	searchPath = ptr.AllocLC();
+	User::LeaveIfError(iListOfFolders.Append(searchPath));
+	CleanupStack::Pop(searchPath);
+	}
+
+#ifndef SYMBIAN_APPARC_APPINFO_CACHE
+void CApaAppRegFinder::BuildDriveListL(const RFs& aFs, const TDriveList& aSourceDriveList, RArray<TDriveUnitInfo>& aDestDriveList)
+	{ // static
+	TInt drive(EDriveY);
+	TDriveUnitInfo driveUnitInfo;
+	while(drive >= EDriveA)
+		{
+		if (aSourceDriveList[drive]!=KDriveAbsent)
+			{
+			TDriveInfo driveInfo;
+			TInt ret = aFs.Drive(driveInfo,drive);	
+			if (ret==KErrNone)
+				{
+				if (driveInfo.iType!=EMediaNotPresent && driveInfo.iType!=EMediaRemote)
+					{
+					driveUnitInfo.iDriveUnit=drive;
+					driveUnitInfo.iDriveAtt=driveInfo.iDriveAtt;
+					User::LeaveIfError(aDestDriveList.Append(driveUnitInfo));
+					}
+				}
+			}
+		--drive;
+		}
+	driveUnitInfo.iDriveUnit=EDriveZ;
+	driveUnitInfo.iDriveAtt=KDriveAttRom;	
+	User::LeaveIfError(aDestDriveList.Append(driveUnitInfo));
+	}
+
+EXPORT_C void CApaAppRegFinder::FindAllAppsL()
+	{
+	delete iFileList;
+	iFileList = NULL;
+	if(iListOfDrives)
+		{
+		iListOfDrives->Close();
+		delete iListOfDrives;
+		iListOfDrives = NULL;
+		}
+	GetDriveListL();
+	iCurrentIndexInDriveList=-1;
+	iCurrentIndexInFolderList=0;
+	iScanStage=EScanStageNonImportROM;
+	iLastChkedApp = KNullUid;
+	}
+
+#else
+void CApaAppRegFinder::BuildDriveListL()
+	{
+	TDriveList driveList;
+	User::LeaveIfError(iFs.DriveList(driveList));
+
+	TInt drive(EDriveY);
+	TDriveUnitInfo driveUnitInfo;
+	while(drive >= EDriveA)
+		{
+		if (driveList[drive]!=KDriveAbsent)
+			{
+			TDriveInfo driveInfo;
+			TInt ret = iFs.Drive(driveInfo,drive);
+			if (ret==KErrNone)
+				{
+				if (iRemovableMediaDriveScan)
+					{// iListOfDrives should have list of all the removable drives irrespective of presence of the media
+					if ((driveInfo.iType != EMediaRemote) && (driveInfo.iDriveAtt & KDriveAttRemovable))
+						{
+						driveUnitInfo.iDriveUnit=drive;
+						driveUnitInfo.iDriveAtt=driveInfo.iDriveAtt;
+						User::LeaveIfError(iListOfDrives.Append(driveUnitInfo));
+						}
+					}
+				else
+					{
+					if (driveInfo.iType!=EMediaNotPresent && driveInfo.iType!=EMediaRemote)
+						{
+						driveUnitInfo.iDriveUnit=drive;
+						driveUnitInfo.iDriveAtt=driveInfo.iDriveAtt;
+						User::LeaveIfError(iListOfDrives.Append(driveUnitInfo));
+						}
+					}
+				}
+			}
+		--drive;
+		}
+	if (!iRemovableMediaDriveScan)
+		{
+		driveUnitInfo.iDriveUnit=EDriveZ;
+		driveUnitInfo.iDriveAtt=KDriveAttRom;
+		User::LeaveIfError(iListOfDrives.Append(driveUnitInfo));
+		}
+	}
+
+EXPORT_C void CApaAppRegFinder::FindAllRemovableMediaAppsL()
+	{
+	iRemovableMediaDriveScan = ETrue;	
+	FindAllAppsL();
+	}
+
+EXPORT_C const RArray<TDriveUnitInfo>& CApaAppRegFinder::DriveList() const
+	{
+	return (iListOfDrives);
+	}
+
+EXPORT_C void CApaAppRegFinder::FindAllAppsL()
+	{
+	delete iFileList;
+	iFileList = NULL;
+	iListOfDrives.Reset();
+	BuildDriveListL();
+	iCurrentIndexInDriveList=-1;
+	iCurrentIndexInFolderList=0;
+	iScanStage = EScanStageNonImportROM;	
+	iRemovableMediaDriveScan = EFalse;
+	iLastChkedApp = KNullUid;
+	}
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+
+/** Scans the applications in following order:
+1. non-import y-a,z but only on ROM drives
+2. import on all non-ROM drives in the order y-a,z
+3. import on all ROM drives in the order y-a,z
+
+Upgrades of apparc server (via Software Install) are currently disallowed. 
+This means it is not possible to install registration files to \private\10003a3f\apps 
+(on any drive), so there is no need to scan \private\10003a3f\apps on non ROM based drives.
+*/
+EXPORT_C TBool CApaAppRegFinder::NextL(TApaAppEntry& aAppRegistrationEntry, const RPointerArray<HBufC>& aForcedRegistrations)
+	{
+	TBool entryFound = EFalse;
+	while (DoNextL(aAppRegistrationEntry, aForcedRegistrations, entryFound))
+		{
+		//do nothing. the point is to keep calling DoNextL
+		}
+	return entryFound;
+	}
+
+TBool CApaAppRegFinder::DoNextL(TApaAppEntry& aAppRegistrationEntry, const RPointerArray<HBufC>& aForcedRegistrations, TBool& aEntryFound)
+	{
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+	__ASSERT_ALWAYS(iListOfDrives.Count(),Panic(EPanicFindAllAppsNotCalled));
+#else
+	__ASSERT_ALWAYS(iListOfDrives,Panic(EPanicFindAllAppsNotCalled));
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+
+	if (!iFileList)
+		{// scan the next drive/dir
+		iFileIndex = 0;
+		while (GetNextDriveAndFolder())
+			{
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+			if (GetFileListL((iListOfDrives[iCurrentIndexInDriveList]).iDriveUnit, *iListOfFolders[iCurrentIndexInFolderList])==KErrNone)
+#else
+			if (GetFileListL(((*iListOfDrives)[iCurrentIndexInDriveList]).iDriveUnit, *iListOfFolders[iCurrentIndexInFolderList])==KErrNone)
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+				{
+				break;
+				}
+			}
+		if (!iFileList)
+			{
+			aEntryFound = EFalse;
+			return EFalse; // no more drives to scan
+			}
+		}
+	// scan the file list
+	while (iFileIndex<iFileList->Count())
+		{
+		const TEntry& entry=(*iFileList)[iFileIndex++];
+		if (!ApaUtils::HandleAsRegistrationFile(entry.iType))
+			{
+			continue; // only interested in app registration resource files
+			}
+			
+		TParse parse;
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+		const TDriveName driveName = (iListOfDrives[iCurrentIndexInDriveList]).iDriveUnit.Name();
+#else
+		const TDriveName driveName = ((*iListOfDrives)[iCurrentIndexInDriveList]).iDriveUnit.Name();
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+		parse.Set(entry.iName, iListOfFolders[iCurrentIndexInFolderList], &driveName);
+
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+		if (iListOfDrives[iCurrentIndexInDriveList].iDriveAtt&KDriveAttRemovable)
+#else
+		if ((*iListOfDrives)[iCurrentIndexInDriveList].iDriveAtt&KDriveAttRemovable)
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+			{
+			if (entry[2] != iLastChkedApp) //Check for validity only if it has not yet been checked
+				{
+				TUid appTypeUid;
+				if(entry[0].iUid == KUidPrefixedNonNativeRegistrationResourceFile)
+					{
+					appTypeUid = entry[1];
+					}
+				else
+					{
+					appTypeUid = KNullUid;
+					}
+				
+				// Get the CAppSidChecker for this type of executable
+				TBool validRegistration = ETrue;
+				#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+				TRAPD(err, validRegistration = iSidCheckerMap.FindSidCheckerL(appTypeUid).AppRegisteredAt(entry[2], (iListOfDrives)[iCurrentIndexInDriveList].iDriveUnit));
+				#else
+				TRAPD(err, validRegistration = iSidCheckerMap.FindSidCheckerL(appTypeUid).AppRegisteredAt(entry[2], (*iListOfDrives)[iCurrentIndexInDriveList].iDriveUnit));
+				#endif // SYMBIAN_APPARC_APPINFO_CACHE
+				iLastChkedApp = entry[2];
+				if(err == KErrNone)
+					{
+					if(!validRegistration)
+						{
+						// Check if this registration file should be included
+						// despite not being officially reported as a valid registration
+						HBufC* fullName = parse.FullName().AllocLC();
+						TInt pos = aForcedRegistrations.FindInOrder(fullName, TLinearOrder<HBufC>(CApaAppList::CompareStrings));
+						CleanupStack::PopAndDestroy(fullName);
+						if (pos == KErrNotFound)
+							{
+							continue;
+							}
+						}
+					}
+				else if(err != KErrNotFound)
+					{
+					User::Leave(err);
+					}
+				}
+			else
+				{
+				continue;
+				}
+			}
+		aAppRegistrationEntry.iUidType = entry.iType;
+		aAppRegistrationEntry.iFullName = parse.FullName();
+		aEntryFound = ETrue; // we found one
+		return EFalse;
+		}
+	// current Drive has been exhausted
+	delete iFileList;
+	iFileList = NULL;
+	return ETrue; // scan the next drive
+	}
+	
+TBool CApaAppRegFinder::GetNextDriveAndFolder()	
+	{
+	TBool found=ETrue;
+	TBool checkNextFolder=ETrue;
+	TDriveUnitInfo driveUnitInfo;
+	while (checkNextFolder)
+		{
+		// move to next folder
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+		if (++iCurrentIndexInDriveList>=iListOfDrives.Count())
+#else
+		if (++iCurrentIndexInDriveList>=iListOfDrives->Count())
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+			{
+			iCurrentIndexInDriveList=0;
+			++iScanStage;
+			}
+		
+		//Get drive info
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+		driveUnitInfo=iListOfDrives[iCurrentIndexInDriveList];
+#else
+		driveUnitInfo=(*iListOfDrives)[iCurrentIndexInDriveList];
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+		//check folder
+		switch (iScanStage)
+			{
+			case EScanStageNonImportROM:
+				if (driveUnitInfo.iDriveAtt==KDriveAttRom)
+					{
+					iCurrentIndexInFolderList=0;
+					checkNextFolder=EFalse;
+					}
+				break;
+			case EScanStageImportNonROM:
+				if (driveUnitInfo.iDriveAtt!=KDriveAttRom)
+					{
+					iCurrentIndexInFolderList=1;
+					checkNextFolder=EFalse;
+					}
+				break;
+			case EScanStageImportNonNativeResourceNonROM:
+				if (driveUnitInfo.iDriveAtt!=KDriveAttRom)
+					{
+					iCurrentIndexInFolderList=2;
+					checkNextFolder=EFalse;
+					}
+				break;
+			case EScanStageImportROM:
+				if (driveUnitInfo.iDriveAtt==KDriveAttRom)
+					{
+					iCurrentIndexInFolderList=1;
+					checkNextFolder=EFalse;
+					}
+				break;
+			case EScanStageImportNonNativeResourceROM:
+				if (driveUnitInfo.iDriveAtt==KDriveAttRom)
+					{
+					iCurrentIndexInFolderList=2;
+					checkNextFolder=EFalse;
+					}
+				break;
+			case EScanStageComplete:
+				checkNextFolder=EFalse;
+				found=EFalse;
+				break;
+			default:
+				break;	
+			}
+		}
+	return found;
+	}	
+	
+_LIT(KAppRegRscSearchAnyFile,"*");
+
+TInt CApaAppRegFinder::GetFileListL(TDriveUnit aDriveUnit, const TDesC& aPathName)
+	{
+	const TDriveName driveName=aDriveUnit.Name();
+	TParse parse;
+	TInt error = parse.Set(KAppRegRscSearchAnyFile,&aPathName,&driveName);
+	User::LeaveIfError(error);
+	TInt ret = iFs.GetDir(parse.FullName(), KEntryAttAllowUid, ESortNone, iFileList);
+	CheckErrorL(ret);
+	return ret;
+	}
+
+void CApaAppRegFinder::CheckErrorL(TInt aError)
+// static
+	{
+	if (aError!=KErrNone && aError!=KErrNotFound && aError!=KErrPathNotFound && aError!=KErrNotReady
+		&& aError!=KErrDisMounted && aError!=KErrCorrupt && aError!=KErrNotSupported && aError!=KErrBadName && aError!=KErrLocked)
+		{
+		User::Leave(aError);
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apfile/aprfndr.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,96 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __APRFNDR_H__
+#define __APRFNDR_H__
+
+#include <apaid.h>
+#include <f32file.h>
+#include <apsidchecker.h>
+
+class TDriveUnitInfo;
+
+/**
+@internalComponent
+*/
+class CApaAppRegFinder : public CBase
+	{
+public: // Construction / Destruction
+	IMPORT_C static CApaAppRegFinder* NewL(const RFs& aFs);
+	IMPORT_C static CApaAppRegFinder* NewLC(const RFs& aFs);
+	~CApaAppRegFinder();
+private: // Private construction
+	CApaAppRegFinder(const RFs& aFs);
+	void ConstructL();
+public:
+	IMPORT_C TBool NextL(TApaAppEntry& aEntry, 	const RPointerArray<HBufC>& aForcedRegistrations); // increments a scan for all apps
+	IMPORT_C void FindAllAppsL(); // sets up a scan for all apps
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+	IMPORT_C const RArray<TDriveUnitInfo>& DriveList() const;
+	IMPORT_C void FindAllRemovableMediaAppsL();	// sets up a scan for all removable media apps
+#endif	// SYMBIAN_APPARC_APPINFO_CACHE
+
+private:
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+	void BuildDriveListL();
+#else
+	void GetDriveListL();
+	static void BuildDriveListL(const RFs& aFs, const TDriveList& aSourceDriveList, RArray<TDriveUnitInfo>& aDestDriveList);
+#endif	// SYMBIAN_APPARC_APPINFO_CACHE
+	TInt GetFileListL(TDriveUnit aDriveUnit, const TDesC& aPathName);
+	void GetFolderListL();
+	static void CheckErrorL(TInt aError);
+	TBool DoNextL(TApaAppEntry& aEntry, const RPointerArray<HBufC>& aForcedRegistrations,
+		TBool& aEntryFound);
+	TBool GetNextDriveAndFolder();
+
+private:
+	enum TScanStage
+		{
+		EScanStageNonImportROM,
+		EScanStageImportNonROM, 
+		EScanStageImportNonNativeResourceNonROM,
+		EScanStageImportROM,
+		EScanStageImportNonNativeResourceROM,
+		EScanStageComplete
+		};
+	
+
+private:
+	CDir* iFileList;
+	TInt iCurrentIndexInDriveList;
+	TInt iCurrentIndexInFolderList;
+	TInt iFileIndex;
+	const RFs& iFs;
+	RPointerArray<HBufC> iListOfFolders;
+	TInt iScanStage;
+	RSidCheckerMap iSidCheckerMap;
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+	RArray<TDriveUnitInfo> iListOfDrives;
+	TBool iRemovableMediaDriveScan;
+#else
+	RArray<TDriveUnitInfo>* iListOfDrives;
+#endif	// SYMBIAN_APPARC_APPINFO_CACHE
+	TUid iLastChkedApp; //Uid of the last app whose sid cheking has been done.
+	};
+	
+class TDriveUnitInfo 
+{
+public:
+ TDriveUnit iDriveUnit; 
+ TUint		iDriveAtt;
+};
+	
+#endif // __APRFNDR_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apfile/apuninstallmonitor.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,109 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "apuninstallmonitor.h"
+
+// This active object has lower priority than CApaAppListServer but higher than file scanning periodic timer.
+const TInt KAppUninstallPriority=CActive::EPriorityStandard-10; 
+
+//
+// CApaAppUnInstallMonitor class
+//
+EXPORT_C CApaAppUnInstallMonitor* CApaAppUnInstallMonitor::NewL(CApaAppListServer* aApaServer)
+	{
+	CApaAppUnInstallMonitor* self = new(ELeave) CApaAppUnInstallMonitor(aApaServer);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+CApaAppUnInstallMonitor::CApaAppUnInstallMonitor(CApaAppListServer* aApaServer) :
+		CActive(KAppUninstallPriority),
+		iApaServer(aApaServer),
+		iWaitingForStartUninstall(ETrue)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+void CApaAppUnInstallMonitor::ConstructL()
+	{
+	User::LeaveIfError(iSwisProperty.Attach(KUidSystemCategory, Swi::KUidSoftwareInstallKey));
+	}
+
+EXPORT_C CApaAppUnInstallMonitor::~CApaAppUnInstallMonitor()
+	{
+	Cancel();
+	iSwisProperty.Close();
+	}
+
+EXPORT_C void CApaAppUnInstallMonitor::Start()
+	{
+	DoStart();
+	}
+
+TBool CApaAppUnInstallMonitor::UnInstallInProgress() const
+	{
+	return ((iSwisState & Swi::KSwisOperationMask) & Swi::ESwisUninstall)
+			&& ((iSwisState & Swi::KSwisOperationStatusMask) == Swi::ESwisStatusNone);
+	}
+
+void CApaAppUnInstallMonitor::RunL()
+	{
+	if(iStatus.Int() == KErrNone)
+		{
+		DoStart();
+		
+		if (iWaitingForStartUninstall)
+			{
+			if (UnInstallInProgress())
+				{
+				iWaitingForStartUninstall = EFalse;
+				iApaServer->HandleStartUninstallEvent();
+				}
+			}
+		else
+			{ // waiting for end uninstall
+			if (!UnInstallInProgress())
+				{
+				iWaitingForStartUninstall = ETrue;
+				TRAP_IGNORE(iApaServer->HandleEndUninstallEventL()); // let user try again if OOM
+				}
+			
+			}
+		}
+	}
+	
+void CApaAppUnInstallMonitor::DoStart()
+	{
+	iSwisProperty.Subscribe(iStatus);
+	TInt err = iSwisProperty.Get(KUidSystemCategory, Swi::KUidSoftwareInstallKey, iSwisState);
+	if(err == KErrNone)
+		{
+		SetActive();
+		}
+	else
+		{
+		iSwisProperty.Cancel();
+		}
+	}
+
+void CApaAppUnInstallMonitor::DoCancel()
+	{
+	iSwisProperty.Cancel();
+	}
+	
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apfile/apuninstallmonitor.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,56 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __APUNINSTALLMONITOR_H__
+#define __APUNINSTALLMONITOR_H__
+
+#include <e32base.h>
+#include <e32property.h>
+#include <swi/swispubsubdefs.h>
+#include <apsserv.h>
+
+
+class CApaAppListServer;
+
+NONSHARABLE_CLASS(CApaAppUnInstallMonitor) : public CActive
+/** 
+CApaAppUnInstallMonitor
+
+A low priority (EPriorityLow) active object which monitors software
+install for installations/uninstallation of applications.
+
+@internalComponent
+*/
+	{
+public:
+	IMPORT_C static CApaAppUnInstallMonitor* NewL(CApaAppListServer*);
+	IMPORT_C ~CApaAppUnInstallMonitor();
+	IMPORT_C void Start();
+private:
+	CApaAppUnInstallMonitor(CApaAppListServer*);
+	void ConstructL();
+	void RunL();
+	void RunError();
+	void DoStart();
+	void DoCancel();
+	TBool UnInstallInProgress() const;
+private:
+	CApaAppListServer* iApaServer;
+	RProperty iSwisProperty;
+	TInt iSwisState;
+	TBool iWaitingForStartUninstall;
+	};
+	
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apfile/eshell_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,31 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// eshell ui registration resource file, provided so that
+// eshell can be handled as an application in UIs such as Techview
+// 
+//
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x101F7AE7
+
+RESOURCE APP_REGISTRATION_INFO 
+	{
+	app_file="eshell";
+	//
+	embeddability=KAppNotEmbeddable;
+	newfile=KAppDoesNotSupportNewFile;
+
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apgrfx/APGAIR.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,254 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "APGAIR.H"
+#include "APGAPLST.H"
+#include "APGICNFL.H" 
+#include "APFDEF.H"
+
+extern void CleanupServiceArray(TAny* aServiceArray);
+
+CApaAppInfoReader::CApaAppInfoReader(RFs& aFs, const TUid aAppUid)
+	: iFs(aFs),
+	iAppUid(aAppUid),
+	iTimeStamp(0),
+	iDefaultScreenNumber(0),
+#ifndef SYMBIAN_APPARC_APPINFO_CACHE
+	iDefaultIconsUsed(EFalse),
+#endif	//SYMBIAN_APPARC_APPINFO_CACHE
+	iNonMbmIconFile(EFalse),
+	iLocalisableResourceFileTimeStamp(0),
+	iApplicationLanguage(ELangNone),
+	iIndexOfFirstOpenService(-1)
+	{
+	}
+
+CApaAppInfoReader::~CApaAppInfoReader()
+	{
+	delete iAppBinaryFullName;
+	delete iCaption;
+	delete iShortCaption;
+	delete iIcons;
+	if (iViewDataArray)
+		{
+		iViewDataArray->ResetAndDestroy();
+		delete iViewDataArray;
+		}
+	delete iOwnedFileArray;
+	delete iIconFileName;
+	delete iLocalisableResourceFileName;
+	
+	if (iServiceArray)
+ 		{
+ 		CleanupServiceArray(iServiceArray);
+ 		iServiceArray = NULL;
+  		}
+	delete iOpaqueData;
+	}
+
+// The behaviour of the following function is a little non-standard, as it
+// transfers ownership of the pointer owned by a CApaAppInfoReader derived object
+// to the caller. This means that this function is only designed to be called once.
+// Doing things this way provides a small performance optimisation by enabling the caller
+// to delete it's stored pointer, and replace it with one returned by this function,
+// instead of having to copy the object (copying could be expensive for the methods
+// of this class that need to return arrays).
+HBufC* CApaAppInfoReader::AppBinaryFullName()
+	{
+	HBufC* fileName = iAppBinaryFullName;
+	iAppBinaryFullName = NULL; // ownership transferred to caller
+	return fileName;
+	}
+
+TUidType CApaAppInfoReader::AppBinaryUidType() const
+	{
+	return iAppBinaryUidType;
+	}
+
+TTime CApaAppInfoReader::TimeStamp() const
+	{
+	return iTimeStamp;
+	}
+
+TTime CApaAppInfoReader::IconFileTimeStamp() const
+     {
+     return iIconFileTimeStamp;
+     }
+
+void CApaAppInfoReader::Capability(TDes8& aCapabilityBuf) const
+	{
+	TApaAppCapabilityBuf buf(iCapability);
+	TApaAppCapability::CopyCapability(aCapabilityBuf, buf);
+	}
+
+TUint CApaAppInfoReader::DefaultScreenNumber() const
+	{
+	return iDefaultScreenNumber;
+	}
+
+// The behaviour of the following function is a little non-standard, as it
+// transfers ownership of the pointer owned by a CApaAppInfoReader derived object
+// to the caller. This means that this function is only designed to be called once.
+// Doing things this way provides a small performance optimisation by enabling the caller
+// to delete it's stored pointer, and replace it with one returned by this function,
+// instead of having to copy the object (copying could be expensive for the methods
+// of this class that need to return arrays).
+HBufC* CApaAppInfoReader::Caption()
+	{
+	HBufC* caption = iCaption;
+	iCaption = NULL; // ownership transferred to caller
+	return caption;
+	}
+
+// The behaviour of the following function is a little non-standard, as it
+// transfers ownership of the pointer owned by a CApaAppInfoReader derived object
+// to the caller. This means that this function is only designed to be called once.
+// Doing things this way provides a small performance optimisation by enabling the caller
+// to delete it's stored pointer, and replace it with one returned by this function,
+// instead of having to copy the object (copying could be expensive for the methods
+// of this class that need to return arrays).
+HBufC* CApaAppInfoReader::ShortCaption()
+	{
+	HBufC* shortCaption = iShortCaption;
+	iShortCaption = NULL; // ownership transferred to caller
+	return shortCaption;
+	}
+
+// The behaviour of the following function is a little non-standard, as it
+// transfers ownership of the pointer owned by a CApaAppInfoReader derived object
+// to the caller. This means that this function is only designed to be called once.
+// Doing things this way provides a small performance optimisation by enabling the caller
+// to delete it's stored pointer, and replace it with one returned by this function,
+// instead of having to copy the object (copying could be expensive for the methods
+// of this class that need to return arrays).
+CApaAppIconArray* CApaAppInfoReader::Icons()
+	{
+	CApaAppIconArray* icons = iIcons;
+	iIcons = NULL; // ownership transferred to caller
+	return icons;
+	}
+
+#ifndef SYMBIAN_APPARC_APPINFO_CACHE
+TBool CApaAppInfoReader::DefaultIconsUsed() const
+	{
+	return iDefaultIconsUsed;
+	}
+#else
+TInt CApaAppInfoReader::NumOfAppIcons() const
+	{
+	return iNumOfAppIcons;
+	}
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+
+// The behaviour of the following function is a little non-standard, as it
+// transfers ownership of the pointer owned by a CApaAppInfoReader derived object
+// to the caller. This means that this function is only designed to be called once.
+// Doing things this way provides a small performance optimisation by enabling the caller
+// to delete it's stored pointer, and replace it with one returned by this function,
+// instead of having to copy the object (copying could be expensive for the methods
+// of this class that need to return arrays).
+CArrayPtrFlat<CApaAppViewData>* CApaAppInfoReader::Views()
+	{
+	CArrayPtrFlat<CApaAppViewData>* viewDataArray = iViewDataArray;
+	iViewDataArray = NULL; // ownership transferred to caller
+	return viewDataArray;
+	}
+	
+// The behaviour of the following function is a little non-standard, as it
+// transfers ownership of the pointer owned by a CApaAppInfoReader derived object
+// to the caller. This means that this function is only designed to be called once.
+// Doing things this way provides a small performance optimisation by enabling the caller
+// to delete it's stored pointer, and replace it with one returned by this function,
+// instead of having to copy the object (copying could be expensive for the methods
+// of this class that need to return arrays).
+CDesCArray* CApaAppInfoReader::OwnedFiles()
+	{
+	CDesCArray* ownedFileArray = iOwnedFileArray;
+	iOwnedFileArray = NULL; // ownership transferred to caller
+	return ownedFileArray;
+	}
+
+// The behaviour of the following function is a little non-standard, as it
+// transfers ownership of the pointer owned by a CApaAppInfoReader derived object
+// to the caller. This means that this function is only designed to be called once.
+// Doing things this way provides a small performance optimisation by enabling the caller
+// to delete it's stored pointer, and replace it with one returned by this function,
+// instead of having to copy the object (copying could be expensive for the methods
+// of this class that need to return arrays).
+HBufC* CApaAppInfoReader::IconFileName()
+	{
+	HBufC* iconFileName = iIconFileName;
+	iIconFileName = NULL; // ownership transferred to caller
+	return iconFileName;
+	}
+
+TBool CApaAppInfoReader::NonMbmIconFile() const
+	{
+	return iNonMbmIconFile;
+	}
+
+// The behaviour of the following function is a little non-standard, as it
+// transfers ownership of the pointer owned by a CApaAppInfoReader derived object
+// to the caller. This means that this function is only designed to be called once.
+// Doing things this way provides a small performance optimisation by enabling the caller
+// to delete it's stored pointer, and replace it with one returned by this function,
+// instead of having to copy the object (copying could be expensive for the methods
+// of this class that need to return arrays).
+HBufC* CApaAppInfoReader::LocalisableResourceFileName()
+	{
+	HBufC* localisableResourceFileName = iLocalisableResourceFileName;
+	iLocalisableResourceFileName = NULL; // ownership transferred to caller
+	return localisableResourceFileName;
+	}
+
+TTime CApaAppInfoReader::LocalisableResourceFileTimeStamp() const
+	{
+	return iLocalisableResourceFileTimeStamp;
+	}
+	
+TLanguage CApaAppInfoReader::AppLanguage() const
+	{
+	return iApplicationLanguage;
+	}
+
+// The behaviour of the following function is a little non-standard, as it
+// transfers ownership of the pointer owned by a CApaAppInfoReader derived object
+// to the caller. This means that this function is only designed to be called once.
+// Doing things this way provides a small performance optimisation by enabling the caller
+// to delete it's stored pointer, and replace it with one returned by this function,
+// instead of having to copy the object (copying could be expensive for the methods
+// of this class that need to return arrays).
+CArrayFixFlat<TApaAppServiceInfo>* CApaAppInfoReader::ServiceArray(TInt& aIndexOfFirstOpenService)
+	{
+	CArrayFixFlat<TApaAppServiceInfo>* serviceArray = iServiceArray;
+	iServiceArray = NULL;
+	aIndexOfFirstOpenService = iIndexOfFirstOpenService;
+	return serviceArray;
+	}
+
+
+// The behaviour of the following function is a little non-standard, as it
+// transfers ownership of the pointer owned by a CApaAppInfoReader derived object
+// to the caller. This means that this function is only designed to be called once.
+// Doing things this way provides a small performance optimisation by enabling the caller
+// to delete it's stored pointer, and replace it with one returned by this function,
+// instead of having to copy the object (copying could be expensive for the methods
+// of this class that need to return arrays).
+HBufC8* CApaAppInfoReader::OpaqueData()
+	{
+	HBufC8* opaqueData = iOpaqueData;
+	iOpaqueData = NULL;
+	return opaqueData;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apgrfx/APGAIR.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,258 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#if !defined(__APGAIR_H__)
+#define __APGAIR_H__
+
+#if !defined(__APAID_H__)
+#include <apaid.h>
+#endif
+#if !defined(__APMSTD_H__)
+#include <apmstd.h>
+#endif
+
+#include <barsc.h>
+#include <barsread.h>
+
+/**
+@internalComponent
+*/
+class ApaUtils
+	{
+public:
+	IMPORT_C static TBool HandleAsRegistrationFile(const TUidType& aUidType);
+	};
+
+/** The 2nd UID that defines a resource file as being an application registration resource file.
+
+@internalComponent
+*/
+const TUid KUidAppRegistrationFile ={0x101F8021};
+
+class CApaMaskedBitmap;
+class CApaAppViewData;
+class TEntry;
+class RFs;
+class CResourceFile;
+class RResourceReader;
+class CApaAppList;
+class CApaAppIconArray;
+
+/**
+@internalComponent
+*/
+
+NONSHARABLE_CLASS(CApaIconLoader) : public CBase
+	{
+public:
+	static CApaIconLoader* NewL(RFs& aFs);
+	static CApaIconLoader* NewLC(RFs& aFs);
+	~CApaIconLoader();
+
+	void AddIconArrayL(const CApaAppIconArray& aIcons);
+	void LoadAllIconsL();
+	TBool LoadIconsL(TInt aNumOfIcons, const TDesC& aMbmFileName, CArrayPtr<CApaMaskedBitmap>& aIcons);
+
+private:
+	CApaIconLoader(RFs& aFs);
+	void ConstructL();
+	TInt IconIndexL(const TDesC& aFileName, TBool& aUseCache);
+	static TInt CompareIcons(const CApaMaskedBitmap& aFirst, const CApaMaskedBitmap& aSecond);
+
+private:
+	struct TKeyValuePair
+		{
+	public:
+		HBufC* iFileName; // key
+		TInt iIndex; // value
+		};
+private:
+	RFs& iFs;
+	RArray<TKeyValuePair> iIconIndexArray;
+	TInt iCachedArrayIndex;
+	RPointerArray<CApaAppIconArray> iIconArrays;
+	};
+
+/**
+@internalComponent
+*/
+NONSHARABLE_CLASS(CApaAppIconArray) : public CBase
+	{
+public:
+	static CApaAppIconArray* NewL(); // creates a dummy icon array
+	static CApaAppIconArray* NewAppIconsL(TInt aNumOfIcons, const TDesC& aMbmFileName, CApaIconLoader& aIconLoader);
+	static CApaAppIconArray* NewViewIconsL(TInt aNumOfIcons, const TDesC& aMbmFileName, CApaIconLoader& aIconLoader);
+	static CApaAppIconArray* NewDefaultIconsL(); // creates a CApaAppIconArray that uses the default icons
+	static CApaAppIconArray* NewRealDefaultIconsLC(TInt aNumOfIcons, const TDesC& aMbmFileName, CApaIconLoader& aIconLoader); // creates the CApaAppIconArray that contains the default icons
+	~CApaAppIconArray();
+
+	TBool LoadIconsL();
+
+	CApaMaskedBitmap* IconBySize(const TSize& aSize) const;
+	CArrayFixFlat<TSize>* IconSizesL() const;
+	TInt Count() const;
+	TBool DefaultIconsUsed() const;
+	CApaMaskedBitmap* operator[](TInt aIndex) const;
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE	
+	TBool AreAppIconsLoaded() const;
+	TBool AreViewIconsLoaded() const;
+#endif	// SYMBIAN_APPARC_APPINFO_CACHE
+	
+private:
+	static CApaAppIconArray* NewL(TInt aNumOfIcons, const TDesC& aMbmFileName, CApaIconLoader& aIconLoader, TBool aFallbackToDefaultIcons);
+	static CApaAppIconArray* NewLC(TInt aNumOfIcons, const TDesC& aMbmFileName, CApaIconLoader& aIconLoader, TBool aFallbackToDefaultIcons);
+	CApaAppIconArray();
+	CApaAppIconArray(TInt aNumOfIcons, CApaIconLoader& aIconLoader, TBool aFallbackToDefaultIcons);
+	void ConstructL(const TDesC& aMbmFileName);
+	void GetDefaultIconsL();
+	const CApaAppIconArray& DefaultIcons() const;
+	
+private:
+	TInt iNumOfIcons;
+	CApaIconLoader* iIconLoader;
+	TBool iFallbackToDefaultIcons;
+	HBufC* iMbmFileName;
+	TBool iDefaultIconsUsed;
+	CArrayPtrFlat<CApaMaskedBitmap>* iIcons;
+	CApaAppList* iDefaultIconsProvider;
+	};
+
+class CApaAppInfoReader : public CBase
+/**
+Abstract base class for application information readers.
+
+Concrete implementations should read information from some
+data source and implement policy specific to each reader.
+
+@internalComponent
+*/
+	{
+public:
+	~CApaAppInfoReader();
+public:
+	HBufC* AppBinaryFullName();
+	TUidType AppBinaryUidType() const;
+	TTime TimeStamp() const;
+	TTime IconFileTimeStamp() const;
+	void Capability(TDes8& aCapabilityBuf) const;
+	TUint DefaultScreenNumber() const;
+	HBufC* Caption();
+	HBufC* ShortCaption();
+	CApaAppIconArray* Icons();
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE	
+	TInt NumOfAppIcons() const;
+	virtual CApaIconLoader* IconLoader() = 0;
+#else	
+	TBool DefaultIconsUsed() const;
+#endif	// SYMBIAN_APPARC_APPINFO_CACHE
+	CArrayPtrFlat<CApaAppViewData>* Views();
+	CDesCArray* OwnedFiles();
+	HBufC* IconFileName();
+	TBool NonMbmIconFile() const;
+	HBufC* LocalisableResourceFileName();
+	TTime LocalisableResourceFileTimeStamp() const;
+	TLanguage AppLanguage() const;
+	CArrayFixFlat<TApaAppServiceInfo>* ServiceArray(TInt& aIndexOfFirstOpenService);
+	HBufC8* OpaqueData();
+
+public:
+	virtual TBool Read()=0;
+protected:
+	CApaAppInfoReader(RFs& aFs, const TUid aAppUid);
+	
+protected:
+	RFs& iFs;
+	TUid iAppUid;
+	HBufC* iAppBinaryFullName;
+	TUidType iAppBinaryUidType;
+	TTime iTimeStamp;
+	TTime iIconFileTimeStamp;
+	TApaAppCapability iCapability;
+	TUint iDefaultScreenNumber;
+	HBufC* iCaption;
+	HBufC* iShortCaption;
+	CApaAppIconArray* iIcons;
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+	TInt iNumOfAppIcons;
+#else
+	TBool iDefaultIconsUsed;
+#endif
+	CArrayPtrFlat<CApaAppViewData>* iViewDataArray;
+	CDesCArray* iOwnedFileArray;
+	HBufC* iIconFileName;
+	TBool iNonMbmIconFile; // ETrue if icon filename is not an MBM file, however, EFalse does not necessarily mean it is an MBM file
+	HBufC* iLocalisableResourceFileName;
+	TTime iLocalisableResourceFileTimeStamp;
+	TLanguage iApplicationLanguage;
+	CArrayFixFlat<TApaAppServiceInfo>* iServiceArray;
+	TInt iIndexOfFirstOpenService;
+	TBool iOpenServiceIsLegacy;
+	HBufC8* iOpaqueData;
+	};
+
+class CApaAppInfoReaderV2 : public CApaAppInfoReader
+/**
+Reads application information from a combination of registration file,
+optional localisable resource file and optional icon file.
+Application information stored in this way is referred to as version 2.
+
+@internalComponent
+*/
+	{
+public:
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+	static CApaAppInfoReaderV2* NewL(RFs& aFs, const TDesC& aRegistrationFileName, const TUid aAppUid);
+	virtual CApaIconLoader* IconLoader();
+#else
+	static CApaAppInfoReaderV2* NewL(RFs& aFs, const TDesC& aRegistrationFileName, const TUid aAppUid,const TDesC& aDefaultAppIconFileName);
+#endif	// SYMBIAN_APPARC_APPINFO_CACHE
+	~CApaAppInfoReaderV2();
+
+public:
+	virtual TBool Read();
+	static TBool FileIsMbm(const TDesC& aFileName);
+
+private:
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+	CApaAppInfoReaderV2(RFs& aFs, const TDesC& aRegistrationFileName, const TUid aAppUid);
+#else
+	CApaAppInfoReaderV2(RFs& aFs, const TDesC& aRegistrationFileName, const TUid aAppUid, const TDesC& aDefaultAppIconFileName);
+#endif
+	void ConstructL();
+	void ReadMandatoryInfoL(CResourceFile*& aRegistrationFile, RResourceReader& aResourceReader);
+	void ReadNonLocalisableInfoL(RResourceReader& aResourceReader, CResourceFile*& aLocalisableResourceFile, TUint& aLocalisableResourceId);
+	void ReadNonLocalisableOptionalInfoL(RResourceReader& aResourceReader, const CResourceFile* aRegistrationFile, CResourceFile* aLocalisableResourceFile);
+	void ReadDataTypesL(RResourceReader& aResourceReader, CArrayFixFlat<TDataTypeWithPriority>& aDatatypes);
+	void ReadLocalisableInfoL(const CResourceFile* aResourceFile, TUint aResourceId, TBool& aUseDefaultIcons);
+	HBufC* FullIconFileNameL(const TDesC& aIconFileName) const;
+	TBool HasWriteDeviceDataCap();
+    void ReadAppSecurityInfo();
+	
+    TBool FileIsMbmWithGenericExtensionL(const TDesC& aFileName) const;
+	static HBufC8* ReadOpaqueDataL(TUint aResourceId, const CResourceFile* aRegistrationFile, CResourceFile* aLocalisableResourceFile);
+
+private:
+	const TDesC& iRegistrationFileName;
+	TBool iHasWriteDeviceDataCap;
+    TBool iIsSidTrusted;
+    // This flag is used to determine if app security info was allready read
+    TBool iSecurityInfoHasBeenRead;
+	CApaIconLoader* iIconLoader;	
+#ifndef SYMBIAN_APPARC_APPINFO_CACHE
+	const TDesC& iDefaultAppIconFileName;
+#endif
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apgrfx/APGAIRV2.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1281 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "APGAIR.H"
+#include <apgaplst.h>
+#include <bautils.h>
+#include "APGICNFL.H" 
+#include "APFDEF.H"
+#include "apprivate.h"
+#include <barsc2.h>
+#include <barsread2.h>
+#include <e32uid.h>
+#include "APGSTD.H"
+
+#include "apsecutils.h"
+
+const TUint KResourceOffsetMask = 0xFFFFF000;
+
+
+_LIT(KAppBinaryPathAndExtension,"\\sys\\bin\\.exe");
+_LIT(KV1AppPathAndExtension, "\\system\\apps\\.app");
+const TInt KAppRegistrationInfoResourceId = 1;
+
+#ifndef SYMBIAN_APPARC_APPINFO_CACHE
+CApaAppInfoReaderV2* CApaAppInfoReaderV2::NewL(RFs& aFs, const TDesC& aRegistrationFileName, const TUid aAppUid,const TDesC& aDefaultAppIconFileName)
+	{
+	CApaAppInfoReaderV2* self = new(ELeave) CApaAppInfoReaderV2(aFs, aRegistrationFileName, aAppUid,aDefaultAppIconFileName);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+CApaAppInfoReaderV2::CApaAppInfoReaderV2(RFs& aFs, const TDesC& aRegistrationFileName, const TUid aAppUid,const TDesC& aDefaultAppIconFileName)
+	: CApaAppInfoReader(aFs, aAppUid),
+	iRegistrationFileName(aRegistrationFileName),iDefaultAppIconFileName(aDefaultAppIconFileName)
+	{
+	}
+#else
+CApaAppInfoReaderV2* CApaAppInfoReaderV2::NewL(RFs& aFs, const TDesC& aRegistrationFileName, const TUid aAppUid)
+	{
+	CApaAppInfoReaderV2* self = new(ELeave) CApaAppInfoReaderV2(aFs, aRegistrationFileName, aAppUid);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+CApaAppInfoReaderV2::CApaAppInfoReaderV2(RFs& aFs, const TDesC& aRegistrationFileName, const TUid aAppUid)
+	: CApaAppInfoReader(aFs, aAppUid),
+	iRegistrationFileName(aRegistrationFileName)
+	{
+	}
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+
+void CApaAppInfoReaderV2::ConstructL()
+	{
+	iIconLoader = CApaIconLoader::NewL(iFs);
+	}
+
+CApaAppInfoReaderV2::~CApaAppInfoReaderV2()
+	{
+	delete iIconLoader;
+	}
+
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+// The behaviour of the following function is a little non-standard, as it
+// transfers ownership of the pointer owned by a CApaAppInfoReaderV2 object
+// to the caller. This means that this function is only designed to be called once.
+// Doing things this way provides a small performance optimisation by enabling the caller
+// to delete it's stored pointer, and replace it with one returned by this function,
+// instead of having to copy the object (copying could be expensive for the methods
+// of this class that need to return arrays).
+CApaIconLoader* CApaAppInfoReaderV2::IconLoader()
+	{
+	CApaIconLoader* iconLoader = iIconLoader;
+	iIconLoader = NULL; // ownership transferred to caller
+	return iconLoader;
+	}
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+
+// this method reads the minimum information required to register an app
+// if this fails (Leaves), we say the read has been unsuccessful
+void CApaAppInfoReaderV2::ReadMandatoryInfoL(CResourceFile*& aRegistrationFile, RResourceReader& aResourceReader)
+	{
+	TEntry entry;
+	User::LeaveIfError(iFs.Entry(iRegistrationFileName, entry));
+	iTimeStamp = entry.iModified;
+	
+	TUint fileOffset = 0;
+	TInt fileLength = 0;
+	TUid middleUid(KUidApp);
+
+	// in the case of a non-native application, the resource file
+	// has been padded with the application type uid
+	
+	if (TParsePtrC(iRegistrationFileName).Path().CompareF(KLitPathForNonNativeResourceAndIconFiles)==0)
+		{
+		fileOffset=sizeof(TCheckedUid);
+		fileLength=entry.iSize-fileOffset;
+		middleUid=entry[1];
+		if (middleUid.iUid==KNullUid.iUid)
+			{
+			User::Leave(KErrCorrupt);
+			}
+		}
+
+	aRegistrationFile = CResourceFile::NewL(iFs, iRegistrationFileName, fileOffset, fileLength);
+	aResourceReader.OpenL(aRegistrationFile, KAppRegistrationInfoResourceId);
+
+	aResourceReader.ReadUint32L(); // skip over LONG reserved_long
+	aResourceReader.ReadUint32L(); // skip over LLINK reserved_llink
+
+	// read LTEXT app_file
+	const TPtrC appFile(aResourceReader.ReadTPtrCL());
+	TParse parse; // this object gets used for 2 purposes: first to check that a TParsePtrC can be created over "appFile" without it panicking, and second to construct iAppBinaryFullName
+	User::LeaveIfError(parse.SetNoWild(appFile, NULL, NULL)); // do this before creating a TParsePtrC, since TParsePtrC's constructor panics if it fails (which would provide an easy way for malware to kill the Apparc server)
+	const TParsePtrC appFileParser(appFile);
+
+	// read LONG attributes
+	iCapability.iAttributes = aResourceReader.ReadUint32L();
+
+	if (!appFileParser.NamePresent())
+		{
+		User::Leave(KErrCorrupt);
+		}
+	const TPtrC appNameWithoutExtension(appFileParser.Name());
+	const TPtrC registrationFileDrive(TParsePtrC(iRegistrationFileName).Drive());
+	TUid firstUid(TUid::Null());
+	if (iCapability.iAttributes & TApaAppCapability::ENonNative)
+		{
+		if (!appFileParser.PathPresent() || !appFileParser.ExtPresent())
+			{
+			User::Leave(KErrCorrupt);
+			}
+		const TPtrC appFilePath(appFileParser.Path());
+		const TPtrC appFileNameAndExt(appFileParser.NameAndExt());
+		TPtrC appFileDrive(registrationFileDrive);
+		if (appFileParser.DrivePresent())
+			{
+			appFileDrive.Set(appFileParser.Drive());
+			}
+		User::LeaveIfError(parse.SetNoWild(appFileDrive, &appFilePath, &appFileNameAndExt));
+		// keep firstUid as TUid::Null()
+		}
+	else if (iCapability.iAttributes & TApaAppCapability::EBuiltAsDll)
+		{
+		// legacy dll-style app
+		User::LeaveIfError(parse.SetNoWild(registrationFileDrive, &KV1AppPathAndExtension, &appNameWithoutExtension));
+		User::LeaveIfError(parse.AddDir(appNameWithoutExtension));
+		firstUid = KDynamicLibraryUid;
+		}
+	else
+		{
+		// exe-style app
+		User::LeaveIfError(parse.SetNoWild(registrationFileDrive, &KAppBinaryPathAndExtension, &appNameWithoutExtension));
+		firstUid = KExecutableImageUid;
+		}
+	iAppBinaryFullName = parse.FullName().AllocL();
+
+	// set the TUidType for the app binary
+	// cannot read the TEntry info from the app binary because it's in \sys\bin
+	iAppBinaryUidType = TUidType(firstUid, middleUid, iAppUid);
+	}
+
+// reads as much info as it can
+// at least captions and icons must be setup on return from this method (using defaults if necessary)
+TBool CApaAppInfoReaderV2::Read()
+	{
+	CResourceFile* registrationFile = NULL;
+	RResourceReader resourceReader;
+	TRAPD(ret, ReadMandatoryInfoL(registrationFile, resourceReader));
+	if (ret != KErrNone)
+		{
+		resourceReader.Close();
+		delete registrationFile;
+		return EFalse; // might have read something, but failed to setup enough info to make it worthwhile trying to read any more
+		}
+
+	CResourceFile* localisableFile = NULL;
+	TUint localisableResourceId = 1; // only initialising this here to keep the compiler happy, as it's concerned that the variable might be used without having been initialised. The variable should be initialised later, before it's used
+	TRAP(ret, ReadNonLocalisableInfoL(resourceReader, localisableFile, localisableResourceId));
+
+	if (ret == KErrNone)
+		{
+		TRAP(ret, ReadNonLocalisableOptionalInfoL(resourceReader, registrationFile, localisableFile));
+		}
+
+	TBool useDefaultIcons=ETrue;
+
+	if (ret == KErrNone && localisableFile)
+		{
+		TRAP(ret, ReadLocalisableInfoL(localisableFile, localisableResourceId, useDefaultIcons));
+		}
+	delete localisableFile;
+	resourceReader.Close();
+	delete registrationFile;
+
+	// if anything went wrong, we tell the caller that the read was unsuccessful. Some
+	// of the members of this class may not contain complete data, but this doesn't matter
+	// because the caller shouldn't try to access the data if the read was unsuccessful
+	TBool readSuccessful = (ret == KErrNone);
+
+	if (useDefaultIcons)
+		{
+		delete iIcons;
+		iIcons = NULL;
+		TRAP_IGNORE(iIcons = CApaAppIconArray::NewDefaultIconsL());
+		}
+
+	return readSuccessful;
+	}
+
+HBufC* CApaAppInfoReaderV2::FullIconFileNameL(const TDesC& aIconFileName) const
+	{
+	HBufC* filename = NULL;
+	if (aIconFileName.Length() == 0)
+		{
+		return NULL;
+		}
+	/*
+	 * aIconFileName may contain a valid string in some format (for eg. URI format) other than path to a regular file on disk
+	 * and that can be a mbm or non-mbm file. Such a filename will be reported as invalid filename by iFs.IsValidName() method. 
+	 * aIconFileName will be returned since it is a valid string. 
+	 */	
+	if(!iFs.IsValidName(aIconFileName))
+		{
+		filename = aIconFileName.AllocL();
+		return filename;
+		}
+	
+	TParsePtrC parsePtr(aIconFileName);
+	if (parsePtr.IsWild()
+		|| !parsePtr.PathPresent()
+		|| !parsePtr.NamePresent())
+		{
+		return NULL;
+		}
+	// check for fully qualified icon filename
+	if (parsePtr.DrivePresent() && BaflUtils::FileExists(iFs, aIconFileName))
+		{
+		filename = aIconFileName.AllocL();
+		}
+	else
+		{
+		// check for icon file on same drive as localisable resource file
+		TParse parse;
+		TPtrC localisableResourceFileDrive = TParsePtrC(*iLocalisableResourceFileName).Drive();
+		TInt ret = parse.SetNoWild(localisableResourceFileDrive, &aIconFileName, NULL);
+		if (ret == KErrNone && BaflUtils::FileExists(iFs, parse.FullName()))
+			{
+			filename = parse.FullName().AllocL();
+			}
+		else
+			{
+			TPtrC registrationFileDrive = TParsePtrC(iRegistrationFileName).Drive();
+			if (TInt(TDriveUnit(registrationFileDrive)) != TInt(TDriveUnit(localisableResourceFileDrive)))
+				{
+				// check for icon file on same drive as registration file
+				ret = parse.SetNoWild(registrationFileDrive, &aIconFileName, NULL);
+				if (ret == KErrNone && BaflUtils::FileExists(iFs, parse.FullName()))
+					{
+					filename = parse.FullName().AllocL();
+					}
+				}
+			}
+		}
+	return filename;
+	}
+
+void CApaAppInfoReaderV2::ReadLocalisableInfoL(const CResourceFile* aResourceFile, TUint aResourceId, TBool& aUseDefaultIcons)
+	{
+	RResourceReader resourceReader;
+	resourceReader.OpenLC(aResourceFile, aResourceId);
+
+	resourceReader.ReadUint32L(); // skip over LONG reserved_long
+	resourceReader.ReadUint32L(); // skip over LLINK reserved_llink
+
+	// read LTEXT short_caption
+	iShortCaption = resourceReader.ReadHBufCL();
+
+	resourceReader.ReadUint32L(); // skip over LONG reserved_long
+	resourceReader.ReadUint32L(); // skip over LLINK reserved_llink
+
+	// read LTEXT caption
+	iCaption = resourceReader.ReadHBufCL();
+
+	// read WORD number_of_icons
+	const TInt numOfIcons = resourceReader.ReadInt16L();
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+	iNumOfAppIcons = numOfIcons;
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+
+	// read LTEXT icon_file
+	TPtrC iconFile = resourceReader.ReadTPtrCL();
+	
+	iIconFileName = FullIconFileNameL(iconFile);
+	if (iIconFileName)
+		{
+		TEntry entry;
+		TInt ret = iFs.Entry(*iIconFileName, entry);
+		if (KErrNone == ret)
+			{
+			iIconFileTimeStamp = entry.iModified;
+			}
+			
+		aUseDefaultIcons = EFalse;
+		if (iFs.IsValidName(*iIconFileName))
+			{
+			if(FileIsMbmWithGenericExtensionL(*iIconFileName))
+				{
+				if (numOfIcons > 0)
+					{
+					CApaAppIconArray* iconArray = CApaAppIconArray::NewAppIconsL(numOfIcons, *iIconFileName, *iIconLoader);
+					delete iIcons;
+					iIcons = iconArray;
+					}
+				else
+					{
+					aUseDefaultIcons = ETrue;		
+					}
+				}
+			else
+				{
+				iNonMbmIconFile = ETrue;
+				}
+			}
+		//If the filename is not a valid name then the file is treated as a non-mbm file.
+		else
+			{
+			iNonMbmIconFile = ETrue;
+			}
+		}
+	// read LEN WORD STRUCT view_list[]
+	const TInt numOfViews = resourceReader.ReadInt16L();
+	if (numOfViews > 0)
+		{
+		iViewDataArray = new(ELeave) CArrayPtrFlat<CApaAppViewData>(1);
+		}
+	for(TInt view = 0; view < numOfViews; ++view)
+		{
+		CApaAppViewData* viewData=CApaAppViewData::NewLC();
+		resourceReader.ReadUint32L(); // skip over LONG reserved_long
+		resourceReader.ReadUint32L(); // skip over LLINK reserved_llink
+
+		// read LONG uid
+		const TUid viewUid = {resourceReader.ReadInt32L()};
+		viewData->SetUid(viewUid);
+		// read LONG screen_mode
+		const TInt screenMode = {resourceReader.ReadInt32L()};
+		viewData->SetScreenMode(screenMode);
+
+		resourceReader.ReadUint32L(); // skip over LONG reserved_long
+		resourceReader.ReadUint32L(); // skip over LLINK reserved_llink
+
+		// read LTEXT caption
+		TPtrC viewCaption = resourceReader.ReadTPtrCL();
+		viewData->SetCaptionL(viewCaption);
+		// read WORD number_of_icons
+		const TInt numOfViewIcons = resourceReader.ReadInt16L();
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+		viewData->SetNumOfViewIcons(numOfViewIcons);
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+		// read LTEXT icon_file
+		TPtrC viewIconFile = resourceReader.ReadTPtrCL();
+		HBufC* const fullViewIconFileName = FullIconFileNameL(viewIconFile);
+		if (fullViewIconFileName)
+			{
+			CleanupStack::PushL(fullViewIconFileName);
+			viewIconFile.Set(*fullViewIconFileName);
+			viewData->SetIconFileNameL(viewIconFile);
+			
+			if (iFs.IsValidName(viewIconFile))
+				{
+				if(!FileIsMbmWithGenericExtensionL(viewIconFile))
+					{
+					viewData->SetNonMbmIconFile(ETrue);
+					}
+				}
+			//If the filename is not a valid name then the file is treated as a non-mbm file.
+			else
+				{
+				viewData->SetNonMbmIconFile(ETrue);
+				}
+			}
+		else
+			{
+			viewIconFile.Set(KNullDesC);
+			if (numOfViewIcons > 0 && iIconFileName)
+				{
+				viewIconFile.Set(*iIconFileName); // default to app icon filename
+				}
+			}
+		if (numOfViewIcons > 0 && iFs.IsValidName(viewIconFile) && (FileIsMbmWithGenericExtensionL(viewIconFile)))
+			{
+			CApaAppIconArray* iconArray = CApaAppIconArray::NewViewIconsL(numOfViewIcons, viewIconFile, *iIconLoader);
+			viewData->SetIconArray(iconArray);
+			iconArray = NULL;
+			}
+		if (fullViewIconFileName)
+			{
+			CleanupStack::PopAndDestroy(fullViewIconFileName);
+			}
+		iViewDataArray->AppendL(viewData);
+		CleanupStack::Pop(viewData);
+		}
+#ifndef SYMBIAN_APPARC_APPINFO_CACHE
+	iIconLoader->LoadAllIconsL();
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+	// Read LTEXT group_name
+	// If a localised group name has been specified, it overrides
+	// The group name (if any), specified by APP_REGISTRATION_INFO
+
+	TApaAppGroupName groupName;
+	TRAPD(ret, (groupName = resourceReader.ReadTPtrCL()));
+	if (ret != KErrNone)
+		{
+		 if (ret != KErrEof)
+			 {
+	         User::Leave(ret);
+			 }
+		}
+	else
+		{
+	     if (groupName.Length() > 0)
+			 {
+			 iCapability.iGroupName = groupName;
+			 }
+		}
+
+	CleanupStack::PopAndDestroy(&resourceReader);
+	}
+
+
+TBool CApaAppInfoReaderV2::FileIsMbm(const TDesC& aFileName)
+	{ // static
+	if (aFileName.Length() > 0)
+		{
+		TParsePtrC parsePtr(aFileName);
+		_LIT(KFileExtensionMBM, ".MBM");
+		if (parsePtr.Ext().CompareF(KFileExtensionMBM) == 0)
+			{
+			return ETrue;
+			}
+		}
+	return EFalse;
+	}
+
+
+
+
+/*An MBM file may have a generic icon extension. In this case, as a way to check whether the file is an MBM one, 
+it is necessary to read the content of the fist four 32bit words of it and find out whether these words correspond to 
+KWriteonceFileStoreUid, KMultiBitmapFileImageUid, zero and KMultiBitmapFileImageChecksum respectively (defined in graphics/gditools/bmconv/bmconv.h).
+So the file is opened and the first 4 32 bit words are extracted and compared with the header information of standard MBM file.
+If they match, the function returns ETrue, else it returns EFalse */
+TBool CApaAppInfoReaderV2::FileIsMbmWithGenericExtensionL(const TDesC& aFileName) const 
+      { 
+      if (aFileName.Length() > 0) 
+            { 
+            //open a file in Share mode - this will allow other methods to access it too
+            RFile file;
+            User::LeaveIfError(file.Open(iFs,aFileName,EFileShareReadersOnly));
+            //this is done beacuse the file can also be accessed by applist at the same time
+            //buffer stores the 16 bytes of the file
+            CleanupClosePushL(file);
+            TBuf8<16> buffer;
+            User::LeaveIfError(file.Read(buffer,16));
+            CleanupStack::PopAndDestroy();//file
+            //we use a constant pointer to the buffer to read header info
+        	TPtrC8 filePointer(buffer);
+        	
+            /*The first 16 bytes of an MBM file are the same for any generic MBM file.
+            These are :
+            KWriteOnceFileStoreUid = 0x10000037(Emulator MBM file) 0x10000041(ROM image)	
+            KMultiBitMapFileImageUid = 0x10000042(Emulator MBM file) 	0x00000001(ROM image)
+            Zero = 0x00000000(Emulator MBM file) 0x0000000C(ROM image)
+            checksum = 0x47396439(Emulator MBM file) 0x10000040(ROM image)
+            The first 16 bytes of the given file is compared with these standard values to ascertain it is MBM file*/
+        	if((filePointer[3]==0x10)&&(filePointer[2]==0x00)&&(filePointer[1]==0x00)&&(filePointer[0]==0x37))
+        		{//KWriteOnceFileStoreUid = 0x10000037
+        		if((filePointer[7]==0x10)&&(filePointer[6]==0x00)&&(filePointer[5]==0x00)&&(filePointer[4]==0x42))
+        			{//KMultiBitMapFileImageUid = 0x10000042
+        			if((filePointer[11]==0x00)&&(filePointer[10]==0x00)&&(filePointer[9]==0x00)&&(filePointer[8]==0x00))
+        				{//Zero = 0x00000000)
+        				if((filePointer[15]==0x47)&&(filePointer[14]==0x39)&&(filePointer[13]==0x64)&&(filePointer[12]==0x39))
+        					{//checksum = 0x47396439
+        					return ETrue;
+        					}
+        				}
+        			}
+        		}
+        	//Else Check for ROM Image MBM file's header
+        	else if((filePointer[3]==0x10)&&(filePointer[2]==0x00)&&(filePointer[1]==0x00)&&(filePointer[0]==0x41))
+        		{//KWriteOnceFileStoreUid = 0x10000041
+        		if((filePointer[7]==0x00)&&(filePointer[6]==0x00)&&(filePointer[5]==0x00)&&(filePointer[4]==0x01))
+        			{//KMultiBitMapFileImageUid = 0x00000001
+        			if((filePointer[11]==0x00)&&(filePointer[10]==0x00)&&(filePointer[9]==0x00)&&(filePointer[8]==0x0C))
+        				{//Zero = 0x0000000C)
+        				if((filePointer[15]==0x10)&&(filePointer[14]==0x00)&&(filePointer[13]==0x00)&&(filePointer[12]==0x40))
+        					{//checksum = 0x10000040
+        					return ETrue;
+        					}
+        				}
+        			}
+        		}
+        	}
+      return EFalse;
+      }
+
+HBufC8* CApaAppInfoReaderV2::ReadOpaqueDataL(TUint aResourceId, const CResourceFile* aRegistrationFile, CResourceFile* aLocalisableResourceFile)
+	{ // static
+	HBufC8* opaqueData = NULL;
+	if (aResourceId == 0)
+		{
+		opaqueData = HBufC8::NewL(0);
+		}
+	else
+		{
+		if (aResourceId & KResourceOffsetMask)
+			{
+			// expecting opaque data to be in the localisable resource file
+			if (aLocalisableResourceFile)
+				{
+				aLocalisableResourceFile->ConfirmSignatureL();
+				opaqueData = aLocalisableResourceFile->AllocReadLC(aResourceId);
+				CleanupStack::Pop(opaqueData);
+				}
+			else
+				{
+				opaqueData = HBufC8::NewL(0);
+				}
+			}
+		else
+			{
+			// expecting opaque data to be in the registration file
+			__ASSERT_ALWAYS(aRegistrationFile, Panic(EPanicNullPointer));
+			opaqueData = aRegistrationFile->AllocReadLC(aResourceId); //lint !e613 Suppress ossible use of null pointer
+			CleanupStack::Pop(opaqueData);
+			}
+		}
+	return opaqueData;
+	}
+
+void CApaAppInfoReaderV2::ReadNonLocalisableOptionalInfoL(RResourceReader& aResourceReader, const CResourceFile* aRegistrationFile, CResourceFile* aLocalisableResourceFile)
+	{
+	// read LEN WORD STRUCT service_list[]
+	TInt serviceCount = 0;
+	// service information was not present in the first release of the registration file
+	// APP_REGISTRATION_INFO resource struct
+	// this method must not leave if the registration file doesn't contain service information, so the
+	// following call to ReadInt16L is trapped to ensure this method doesn't leave just because
+	// there is no more information in the resource to read (KErrEof)
+	TRAPD(err, serviceCount = aResourceReader.ReadInt16L());
+	if (err != KErrNone)
+		{
+		if (err != KErrEof)
+			{
+			User::Leave(err);
+			}
+		return; // end of resource reached
+		}
+	else
+		{
+		if ((!iServiceArray) && (serviceCount > 0))
+			{
+			iServiceArray = new(ELeave) CArrayFixFlat<TApaAppServiceInfo>(4);
+			}
+		while (serviceCount--)
+			{
+			const TUid serviceUid = {aResourceReader.ReadUint32L()};
+			
+			if ((serviceUid == KOpenServiceUid) && (iOpenServiceIsLegacy))
+				{
+				__ASSERT_DEBUG(iIndexOfFirstOpenService == 0, User::Invariant());
+				// If we found an Open service in the SERVICE_INFO declaration
+				// then we must ignore the legacy one
+				(*iServiceArray)[0].Release();
+				iServiceArray->Delete(0);
+				iOpenServiceIsLegacy = EFalse;
+				iIndexOfFirstOpenService = -1;
+				}
+			
+			CArrayFixFlat<TDataTypeWithPriority>* datatypes = new(ELeave) CArrayFixFlat<TDataTypeWithPriority>(5);
+			CleanupStack::PushL(datatypes);
+			ReadDataTypesL(aResourceReader, *datatypes);
+			
+			const TUint resourceId = aResourceReader.ReadUint32L();
+			HBufC8* opaqueData = NULL;
+			opaqueData = ReadOpaqueDataL(resourceId, aRegistrationFile, aLocalisableResourceFile);
+			CleanupStack::PushL(opaqueData);
+			
+			TApaAppServiceInfo serviceInfo(serviceUid, datatypes, opaqueData); // takes ownership of opaqueData
+			iServiceArray->AppendL(serviceInfo);
+			CleanupStack::Pop(opaqueData);
+			CleanupStack::Pop(datatypes);
+			if ((serviceUid == KOpenServiceUid) && (iIndexOfFirstOpenService < 0))
+				{
+				iIndexOfFirstOpenService = iServiceArray->Count() - 1;
+				}
+			}
+		// read LLINK opaque_data
+		const TUint resourceId = aResourceReader.ReadUint32L();
+		delete iOpaqueData;
+		iOpaqueData = NULL;
+		iOpaqueData = ReadOpaqueDataL(resourceId, aRegistrationFile, aLocalisableResourceFile);
+		}
+	}
+
+void CApaAppInfoReaderV2::ReadNonLocalisableInfoL(RResourceReader& aResourceReader, CResourceFile*& aLocalisableResourceFile, TUint& aLocalisableResourceId)
+	{
+	__ASSERT_DEBUG(aLocalisableResourceFile == NULL, User::Invariant());
+
+	// read LTEXT localisable_resource_file
+	TPtrC localisableResourceFileName(aResourceReader.ReadTPtrCL());
+	if (localisableResourceFileName.Length() > 0 && iFs.IsValidName(localisableResourceFileName))
+		{
+		// determine the language specific name of the localisable resource file
+		TParse parse;
+		TParsePtrC parsePtr(iRegistrationFileName);
+		User::LeaveIfError(parse.SetNoWild(parsePtr.Drive(), &KAppResourceFileExtension, &localisableResourceFileName));
+		TFileName resourceFileName(parse.FullName());
+		BaflUtils::NearestLanguageFile(iFs, resourceFileName, iApplicationLanguage);
+		iLocalisableResourceFileName = resourceFileName.AllocL();
+
+		TEntry entry;
+		User::LeaveIfError(iFs.Entry(*iLocalisableResourceFileName, entry));
+		iLocalisableResourceFileTimeStamp = entry.iModified;
+	
+
+		// open the localisable resource file	
+		aLocalisableResourceFile = CResourceFile::NewL(iFs, resourceFileName, 0, 0);
+		}
+
+	// read LONG localisable_resource_id
+	aLocalisableResourceId = aResourceReader.ReadUint32L();
+	if (aLocalisableResourceFile && (aLocalisableResourceId & KResourceOffsetMask))
+		{
+		aLocalisableResourceFile->ConfirmSignatureL();
+		}
+
+	iCapability.iAppIsHidden=aResourceReader.ReadInt8L();
+	iCapability.iEmbeddability = static_cast<TApaAppCapability::TEmbeddability>(aResourceReader.ReadInt8L());
+	iCapability.iSupportsNewFile=aResourceReader.ReadInt8L();
+	iCapability.iLaunchInBackground = aResourceReader.ReadInt8L();
+	iCapability.iGroupName = aResourceReader.ReadTPtrCL();
+
+	// read BYTE default_screen_number
+	iDefaultScreenNumber = aResourceReader.ReadUint8L();
+ 	
+	//read the datatypes
+	CArrayFixFlat<TDataTypeWithPriority>* datatypes = new(ELeave) CArrayFixFlat<TDataTypeWithPriority>(5);
+	CleanupStack::PushL(datatypes);
+	ReadDataTypesL(aResourceReader, *datatypes);
+	//dataTypes is deleted if 
+	// A. There are no legacy datatypes
+	// B. Control panel plugin apps are not allowed to register MIME types.If they happen to have any, these datatypes should be ignored.
+	if ((iCapability.iAttributes & TApaAppCapability::EControlPanelItem) || (datatypes->Count() == 0))
+		{
+		CleanupStack::PopAndDestroy(datatypes);
+		}
+	else
+		{
+		__ASSERT_DEBUG(!iServiceArray, User::Invariant());
+		iServiceArray = new(ELeave) CArrayFixFlat<TApaAppServiceInfo>(4);
+		HBufC8* opaqueData = HBufC8::NewL(0);
+		CleanupStack::PushL(opaqueData);
+		TApaAppServiceInfo serviceInfo(KOpenServiceUid, datatypes, opaqueData);
+		iServiceArray->AppendL(serviceInfo);
+		CleanupStack::Pop(opaqueData);
+		CleanupStack::Pop(datatypes);
+		iIndexOfFirstOpenService = 0;
+		iOpenServiceIsLegacy = ETrue;
+		}
+
+	// read LEN WORD STRUCT file_ownership_list[]
+	const TInt fileOwnershipArraySize = aResourceReader.ReadInt16L();
+	if (fileOwnershipArraySize > 0)
+		{
+		iOwnedFileArray = new(ELeave) CDesCArraySeg(1);
+		}
+	for (TInt i=0; i < fileOwnershipArraySize; i++)
+		{
+		TPtrC fileNamePtr = aResourceReader.ReadTPtrCL();
+		iOwnedFileArray->AppendL(fileNamePtr);
+		}
+	}
+	
+void CApaAppInfoReaderV2::ReadDataTypesL(RResourceReader& aResourceReader,
+	CArrayFixFlat<TDataTypeWithPriority>& aDatatypes)
+	{
+	// read LEN WORD STRUCT datatype_list[]
+	const TInt dataTypeArraySize = aResourceReader.ReadInt16L();
+	if (dataTypeArraySize <= 0)
+		{
+		return;
+		}
+	
+	for (TInt i=0; i < dataTypeArraySize; i++)
+		{
+		TDataTypePriority priority = static_cast<TDataTypePriority>(aResourceReader.ReadInt32L());
+        
+		//Check for data priority of UnTrusted apps however the trusted apps will not have any restrictions 
+		//over the data priority.	
+		//If an untrusted app has write device data capability (i.e. still has priority = KDataTypePrioritySystem),
+		//do not restrict to KDataTypeUnTrustedPriorityThreshold
+		if (priority > KDataTypeUnTrustedPriorityThreshold || priority == KDataTypePrioritySystem )
+		    {
+		    ReadAppSecurityInfo();
+
+            if (priority == KDataTypePrioritySystem)
+                {
+                // Check that the app has capability WriteDeviceData
+                if (!iHasWriteDeviceDataCap)
+                    {
+                    priority = KDataTypePriorityNormal;
+                    }
+                }
+            else
+                {
+                //data priority for UnTrusted apps would be capped if it is greater than the threshold priority i.e, KMaxTInt16.
+                TInt match=iRegistrationFileName.MatchF(KLitPathForUntrustedRegistrationResourceFiles);
+                if (match != KErrNotFound && !iIsSidTrusted) 
+                    {
+                    //if registration file is in import directory and 
+                    //its sid is in unprotected range - downgrade the priority
+                    priority = KDataTypeUnTrustedPriorityThreshold;	
+                    }
+                }
+		    }
+		TPtrC8 dataTypePtr = aResourceReader.ReadTPtrC8L();
+		TDataType dataType(dataTypePtr);
+		TDataTypeWithPriority dataTypeWithPriority(dataType, priority);
+		aDatatypes.AppendL(dataTypeWithPriority);
+		}
+	}
+
+// This method can be used to check whether app has a WriteDeviceCap 
+// and its sid is trusted
+void CApaAppInfoReaderV2::ReadAppSecurityInfo()
+    {
+    if (!iSecurityInfoHasBeenRead)
+        {
+        __ASSERT_DEBUG( iAppBinaryFullName, Panic(EPanicNullPointer) );
+        const TInt err = CApaSecurityUtils::CheckAppSecurity( *iAppBinaryFullName, 
+                                        iHasWriteDeviceDataCap,
+                                        iIsSidTrusted);
+        if ( KErrNone != err )
+            {
+            iHasWriteDeviceDataCap = EFalse;
+            iIsSidTrusted = EFalse;
+            }
+        iSecurityInfoHasBeenRead = ETrue;   
+        }
+    }
+
+//
+// Class CApaIconLoader
+//
+
+CApaIconLoader* CApaIconLoader::NewL(RFs& aFs)
+	{
+	CApaIconLoader* self = NewLC(aFs);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+CApaIconLoader* CApaIconLoader::NewLC(RFs& aFs)
+	{
+	CApaIconLoader* self = new(ELeave) CApaIconLoader(aFs);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+
+CApaIconLoader::CApaIconLoader(RFs& aFs) :
+		iFs(aFs)
+	{
+	}
+
+void CApaIconLoader::ConstructL()
+	{
+	} //lint !e1762 Suppress member function could be made const
+
+
+CApaIconLoader::~CApaIconLoader()
+	{
+	TInt arrayCount = iIconIndexArray.Count();
+	while (--arrayCount >= 0)
+		{
+		delete (iIconIndexArray[arrayCount].iFileName);
+		}
+	iIconIndexArray.Close();
+	iIconArrays.Close();
+	}
+
+void CApaIconLoader::AddIconArrayL(const CApaAppIconArray& aIcons)
+	{
+	iIconArrays.AppendL(&aIcons);
+	}
+
+void CApaIconLoader::LoadAllIconsL()
+	{
+	const TInt iconArraysCount = iIconArrays.Count();
+	CleanupClosePushL(iIconArrays);
+	for (TInt ii = 0; ii <iconArraysCount; ++ii)
+		{
+		iIconArrays[ii]->LoadIconsL();
+		}
+	CleanupStack::PopAndDestroy(&iIconArrays);
+	}
+
+// given an mbm filename, returns the next index to read from the file
+// always set aUseCache to EFalse on first call in a sequence of calls
+TInt CApaIconLoader::IconIndexL(const TDesC& aFileName, TBool& aUseCache)
+	{
+	if (aUseCache)
+		{
+		TInt ret = iIconIndexArray[iCachedArrayIndex].iIndex++;
+		return ret;
+		}
+	else
+		{
+		aUseCache = ETrue;
+		}
+
+	// if filename in array, get the next index
+	TInt ret = 0;
+	const TInt arrayCount = iIconIndexArray.Count();
+	TInt arrayIndex;
+	for (arrayIndex = 0; arrayIndex < arrayCount; arrayIndex++)
+		{
+		__ASSERT_DEBUG(iIconIndexArray[arrayIndex].iFileName, Panic(EDPanicInvalidIconIndexArray));
+		if (iIconIndexArray[arrayIndex].iFileName->CompareF(aFileName) == 0)
+			{
+			ret = iIconIndexArray[arrayIndex].iIndex++;
+			iCachedArrayIndex = arrayIndex;
+			break;
+			}
+		}
+
+	if (arrayIndex >= arrayCount)
+		{
+		// filename not found, add it to array
+		TKeyValuePair keyValuePair;
+		keyValuePair.iFileName = aFileName.AllocL();
+		keyValuePair.iIndex = 0;
+		ret = keyValuePair.iIndex++;
+		User::LeaveIfError(iIconIndexArray.Append(keyValuePair));
+		iCachedArrayIndex = arrayCount;
+		}
+	return ret;
+	}
+	
+
+
+// returns EFalse if there was an error obtaining aMbmFileName's entry information,
+// otherwise returns ETrue.
+// Leaves if an error occurs while trying to populate aIcons or sort icons
+TBool CApaIconLoader::LoadIconsL(TInt aNumOfIcons, const TDesC& aMbmFileName, CArrayPtr<CApaMaskedBitmap>& aIcons)
+	{
+	TEntry entry;
+	TInt error=iFs.Entry(aMbmFileName,entry);
+	if (error!=KErrNone)
+		{
+		return EFalse;
+		}
+	TInt iconIndex;
+	TInt fileIndex;
+	TBool useCache = EFalse;
+
+	
+	// create link to CApaAppList which owns this object as it has a separate share protected RFs
+	// which can be used to load bitmap icons 
+	CApaAppList* const appList = CApaAppList::Self();
+	
+	RFile mbmFile;
+	CleanupClosePushL(mbmFile);
+	User::LeaveIfError(mbmFile.Open(appList->ShareProtectedFileServer(), aMbmFileName, EFileShareReadersOnly));
+
+	for(iconIndex=0; iconIndex<aNumOfIcons; ++iconIndex)	
+		{		
+		CApaMaskedBitmap* bitmap = CApaMaskedBitmap::NewLC();
+		fileIndex = IconIndexL(aMbmFileName, useCache);
+		User::LeaveIfError(bitmap->Load(mbmFile, 2*fileIndex));
+		User::LeaveIfError((bitmap->Mask())->Load(mbmFile,2*fileIndex+1));		
+		aIcons.AppendL(bitmap);
+		CleanupStack::Pop(bitmap);		
+		}
+	
+	CleanupStack::PopAndDestroy(&mbmFile); // close mbmFile	
+
+	// now sort them in ascending order of size
+	TInt numberOfIcons = aIcons.Count();
+	// create a new array that we can sort by area, populated from aIcons
+	RPointerArray<CApaMaskedBitmap> ptrArray(numberOfIcons);
+	CleanupClosePushL(ptrArray);
+	TLinearOrder<CApaMaskedBitmap> order(CApaIconLoader::CompareIcons);
+	for (iconIndex=0; iconIndex<numberOfIcons; iconIndex++)
+		{
+		User::LeaveIfError(ptrArray.InsertInOrderAllowRepeats(aIcons[iconIndex], order));
+		}
+	// copy the sorted icon pointers back into aIcons - must not Leave inside the loop below
+	for (iconIndex=0; iconIndex<numberOfIcons; iconIndex++)
+		{
+		aIcons[iconIndex]=ptrArray[iconIndex];
+		}
+	CleanupStack::PopAndDestroy(&ptrArray);
+
+	return ETrue;
+	}
+
+TInt CApaIconLoader::CompareIcons(const CApaMaskedBitmap& aFirst, const CApaMaskedBitmap& aSecond)
+	{ // static
+	TSize sizeFirst = aFirst.SizeInPixels();
+	TInt areaFirst = sizeFirst.iWidth*sizeFirst.iHeight;
+	TSize sizeSecond = aSecond.SizeInPixels();
+	TInt areaSecond = sizeSecond.iWidth*sizeSecond.iHeight;
+	return areaFirst - areaSecond;
+	}
+
+//
+// Class CApaAppIconArray
+//
+
+CApaAppIconArray* CApaAppIconArray::NewL()
+	{
+	return new(ELeave) CApaAppIconArray();
+	}
+
+/* public factory functions */
+CApaAppIconArray* CApaAppIconArray::NewAppIconsL(TInt aNumOfIcons, const TDesC& aMbmFileName, CApaIconLoader& aIconLoader)
+	{
+	return NewL(aNumOfIcons,aMbmFileName,aIconLoader,ETrue);
+	}
+
+CApaAppIconArray* CApaAppIconArray::NewViewIconsL(TInt aNumOfIcons, const TDesC& aMbmFileName, CApaIconLoader& aIconLoader)
+	{
+	return NewL(aNumOfIcons,aMbmFileName,aIconLoader,EFalse);
+	}
+
+CApaAppIconArray* CApaAppIconArray::NewDefaultIconsL()
+	{
+	CApaAppIconArray* self = NewL();
+	CleanupStack::PushL(self);
+	self->GetDefaultIconsL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+CApaAppIconArray* CApaAppIconArray::NewRealDefaultIconsLC(TInt aNumOfIcons, const TDesC& aMbmFileName, CApaIconLoader& aIconLoader)
+	{
+	return NewLC(aNumOfIcons,aMbmFileName,aIconLoader,EFalse);
+	}
+
+/* real NewL and NewLC, private */
+CApaAppIconArray* CApaAppIconArray::NewL(TInt aNumOfIcons, const TDesC& aMbmFileName, CApaIconLoader& aIconLoader, TBool aFallbackToDefaultIcons)
+	{
+	CApaAppIconArray* self = NewLC(aNumOfIcons,aMbmFileName,aIconLoader,aFallbackToDefaultIcons);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+CApaAppIconArray* CApaAppIconArray::NewLC(TInt aNumOfIcons, const TDesC& aMbmFileName, CApaIconLoader& aIconLoader, TBool aFallbackToDefaultIcons)
+	{
+	CApaAppIconArray* self = new(ELeave) CApaAppIconArray(aNumOfIcons,aIconLoader,aFallbackToDefaultIcons);
+	CleanupStack::PushL(self);
+	self->ConstructL(aMbmFileName);
+	return self;
+	}
+
+CApaAppIconArray::CApaAppIconArray()
+	{
+	}
+
+CApaAppIconArray::CApaAppIconArray(TInt aNumOfIcons, CApaIconLoader& aIconLoader, TBool aFallbackToDefaultIcons) :
+		iNumOfIcons(aNumOfIcons),
+		iIconLoader(&aIconLoader),
+		iFallbackToDefaultIcons(aFallbackToDefaultIcons)
+	{
+	}
+
+void CApaAppIconArray::ConstructL(const TDesC& aMbmFileName)
+	{
+	iMbmFileName = aMbmFileName.AllocL();
+	ASSERT(iIconLoader);
+	iIconLoader->AddIconArrayL(*this);
+	}
+
+CApaAppIconArray::~CApaAppIconArray()
+	{
+	if(iDefaultIconsUsed)
+		{
+		ASSERT(iDefaultIconsProvider);
+		if(iDefaultIconsProvider)
+			iDefaultIconsProvider->ReleaseDefaultIconArray();
+		}
+	delete iMbmFileName;
+	if (iIcons)
+		{
+		iIcons->ResetAndDestroy();
+		delete iIcons;
+		}
+	iDefaultIconsProvider = NULL;
+	iIconLoader = NULL;
+	}
+
+// returns EFalse if there was an error obtaining iMbmFileName's entry information,
+// otherwise returns ETrue or leaves with a system-wide error code
+TBool CApaAppIconArray::LoadIconsL()
+	{
+	ASSERT(iIconLoader);
+	ASSERT(!iDefaultIconsUsed);
+	ASSERT(!iIcons);
+	iIcons = new(ELeave) CArrayPtrFlat<CApaMaskedBitmap>(5);
+	TBool badMbmEntryInfo = EFalse;
+	TRAPD(err,badMbmEntryInfo = !iIconLoader->LoadIconsL(iNumOfIcons,*iMbmFileName,*iIcons));
+
+	// We'll be called by the iconLoader at most once, and after we've been called,
+	// it might be destroyed. So we shouldn't keep a pointer to it anymore.
+	iIconLoader = NULL;
+
+	if ((badMbmEntryInfo || err != KErrNone) && iFallbackToDefaultIcons)
+		{
+		GetDefaultIconsL();
+		}
+	else if (badMbmEntryInfo)
+		{
+		return EFalse;
+		}
+	else if (err != KErrNone)
+		{
+		User::Leave(err);
+		}
+	return ETrue;
+	}
+
+CApaMaskedBitmap* CApaAppIconArray::IconBySize(const TSize& aSize) const
+	{
+	if(iDefaultIconsUsed)
+		{
+		return DefaultIcons().IconBySize(aSize);
+		}
+	else if(iIcons == NULL && iIconLoader == NULL)
+		{
+		// Then we've been created with the default constructor, just pretend
+		// there's no icon of the right size
+		return NULL;
+		}
+	else if(iIcons == NULL)
+		{
+#ifndef SYMBIAN_APPARC_APPINFO_CACHE
+		// Arriving here means the the icons need loading but havn't been loaded yet.
+		// when we have lazy loading, this will be a trigger condition for loading them
+		ASSERT(iIcons);
+		return NULL;
+		}
+	else
+		{
+#else
+		// Arriving here means the the icons need loading but havn't been loaded yet.
+		TRAPD(err, iIconLoader->LoadAllIconsL());
+		if (err != KErrNone)
+			{
+			return NULL;
+			}
+		}
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+
+	const TInt count = iIcons->Count();
+	CApaMaskedBitmap* bmp=NULL;
+	for (TInt ii=0;ii<count;ii++)
+		{
+		if ((*iIcons)[ii]->SizeInPixels()==aSize)
+			bmp=(*iIcons)[ii];
+		}
+	if (!bmp)
+		{// if the exact size has not been found get one with nearest but smaller area
+		TInt differenceOfClosest=KMaxTInt;
+		TInt indexOfClosest=KMaxTInt;
+		TInt reqArea=aSize.iHeight*aSize.iWidth;
+		TSize bmpSize;
+		TInt difference;
+		for (TInt jj=0;jj<count;jj++)
+			{
+			bmpSize=(*iIcons)[jj]->SizeInPixels();
+			difference=reqArea-bmpSize.iHeight*bmpSize.iWidth;
+			if (difference<differenceOfClosest && difference>=0)
+				{
+				differenceOfClosest=difference;
+				indexOfClosest=jj;
+				}
+			}
+		if (indexOfClosest<KMaxTInt)
+			bmp=(*iIcons)[indexOfClosest];
+		}
+	return bmp;
+#ifndef SYMBIAN_APPARC_APPINFO_CACHE
+	}
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+	}
+
+CArrayFixFlat<TSize>* CApaAppIconArray::IconSizesL() const
+	{
+	if(iDefaultIconsUsed)
+		{
+		return DefaultIcons().IconSizesL();
+		}
+	else if(iIcons == NULL && iIconLoader == NULL)
+		{
+		return new(ELeave)CArrayFixFlat<TSize>(1);
+		}
+	else if(iIcons == NULL)
+		{
+#ifndef SYMBIAN_APPARC_APPINFO_CACHE
+		// Arriving here means the the icons need loading but havn't been loaded yet.
+		// when we have lazy loading, this will be a trigger condition for loading them
+		ASSERT(iIcons);
+		return new(ELeave)CArrayFixFlat<TSize>(1);
+		}
+	else
+		{
+#else
+		// Arriving here means the the icons need loading but havn't been loaded yet.
+		TRAPD(err, iIconLoader->LoadAllIconsL());
+		if (err != KErrNone)
+			{
+			return new(ELeave)CArrayFixFlat<TSize>(1);
+			}
+		}
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+	const TInt count=iIcons->Count();
+	CArrayFixFlat<TSize>* arrayOfSizes=new(ELeave)CArrayFixFlat<TSize>(1);
+	CleanupStack::PushL(arrayOfSizes);
+	for(TInt ii=0;ii<count;ii++)
+		{
+		arrayOfSizes->AppendL((*iIcons)[ii]->SizeInPixels());
+		}
+	CleanupStack::Pop(arrayOfSizes);
+	return arrayOfSizes;
+#ifndef SYMBIAN_APPARC_APPINFO_CACHE
+		}
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+	}
+
+TInt CApaAppIconArray::Count() const
+	{
+	if(iDefaultIconsUsed)
+		{
+		return DefaultIcons().Count();
+		}
+	else if(iIcons == NULL && iIconLoader == NULL)
+		{
+		return 0;
+		}
+#ifndef SYMBIAN_APPARC_APPINFO_CACHE
+	else if(iIcons == NULL)
+		{
+		// Arriving here means the the icons need loading but havn't been loaded yet.
+		// when we have lazy loading, this will be a trigger condition for loading them
+		ASSERT(iIcons);
+		return 0;
+		}
+	else
+		{
+		return iIcons->Count();
+		}
+#else
+	else if(iIcons == NULL)
+		{
+		// Arriving here means the the icons need loading but havn't been loaded yet.
+		TRAPD(err, iIconLoader->LoadAllIconsL());
+		if (err != KErrNone)
+			{
+			return 0;
+			}
+		}
+	return iIcons->Count();
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+	}
+
+TBool CApaAppIconArray::DefaultIconsUsed() const
+	{
+	return iDefaultIconsUsed;
+	}
+
+CApaMaskedBitmap* CApaAppIconArray::operator[](TInt aIndex) const
+	{
+	if(iDefaultIconsUsed)
+		{
+		return DefaultIcons()[aIndex];
+		}
+	else if(iIcons == NULL && iIconLoader == NULL)
+		{
+		Panic(EPanicIndexOutOfRange);
+		return NULL;
+		}
+#ifndef SYMBIAN_APPARC_APPINFO_CACHE
+	else if(iIcons == NULL)
+		{
+		// Arriving here means the the icons need loading but havn't been loaded yet.
+		// when we have lazy loading, this will be a trigger condition for loading them
+		ASSERT(iIcons);
+		return NULL;
+		}
+	else
+		{
+		return (*iIcons)[aIndex];
+		}
+#else
+	else if(iIcons == NULL)
+		{
+		// Arriving here means the the icons need loading but havn't been loaded yet.
+		TRAPD(err, iIconLoader->LoadAllIconsL());
+		if (err != KErrNone)
+			{
+			return NULL;
+			}
+		}
+	return (*iIcons)[aIndex];
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+	}
+
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+TBool CApaAppIconArray::AreAppIconsLoaded() const
+	{
+	if (iDefaultIconsUsed)
+		{
+		return ETrue;
+		}
+	if (iNumOfIcons > 0 && !iIcons)
+		{
+		return EFalse;	
+		}
+	return ETrue;
+	}
+
+TBool CApaAppIconArray::AreViewIconsLoaded() const
+	{
+	if (iNumOfIcons > 0 && !iIcons )
+		{
+		return EFalse;
+		}
+	return ETrue;	
+	}
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+
+void CApaAppIconArray::GetDefaultIconsL()
+	{
+	ASSERT(!iDefaultIconsUsed);
+	iDefaultIconsProvider = CApaAppList::Self();
+	ASSERT(iDefaultIconsProvider);
+	iDefaultIconsProvider->AcquireDefaultIconArrayL();
+	iDefaultIconsUsed = ETrue;
+	delete iMbmFileName;
+	iMbmFileName = NULL;
+	if (iIcons)
+		{
+	 	iIcons->ResetAndDestroy();
+		delete iIcons;
+		iIcons = NULL;
+		}
+	}
+
+const CApaAppIconArray& CApaAppIconArray::DefaultIcons() const
+	{
+	ASSERT(iDefaultIconsUsed && iDefaultIconsProvider);
+	return iDefaultIconsProvider->DefaultIconArray();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apgrfx/APGAPLST.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,2157 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "apgaplst.h"
+#include "apgstd.h" 
+#include "apfdef.h"
+#include "..\apparc\trace.h"
+#include "apgnotif.h"
+#include "..\apfile\aprfndr.h"
+#include <e32math.h>
+#include <bautils.h>
+#include <s32mem.h>
+#include "apgpriv.h"
+#include "apgair.h"
+#include "apgicnfl.h"
+#include "apprivate.h"
+#include <e32uid.h>
+
+
+// Delays in the pseudo idle object that builds the application list
+//
+
+const TInt KIdleStartDelay=0;
+const TInt KMaxOpaqueDataLength = 0x1000; // maximum length of opaque data that can be passed between client and apparc server via a TApaAppServiceInfo object - this can be increased in future if needed
+const TInt KBufferExpansionGranularity = 0x100;
+const TInt KNumberOfIconsInDefaultMbm = 3;
+const TInt KAppListToFileStartDelay = 60000000;
+
+
+//
+// Class CApaLangChangeMonitor
+//
+
+NONSHARABLE_CLASS(CApaAppList::CApaLangChangeMonitor) : public CActive
+ 		{
+ 	/**
+ 	Utility class used to monitor locale/language change event.
+ 	@internalComponent
+ 	*/
+ 	public:
+ 		static CApaLangChangeMonitor* NewL(CApaAppList& aAppList);
+ 		~CApaLangChangeMonitor();
+ 		void Start();
+ 		
+ 	private:
+ 		CApaLangChangeMonitor(CApaAppList& aAppList);
+ 		void ConstructL();
+ 		
+ 	private:	//from CActive
+ 		void RunL();
+ 		void DoCancel();
+ 		TInt RunError(TInt aError);
+ 		
+ 	private:
+ 		RChangeNotifier iLangNotifier;
+ 		CApaAppList& iAppList;
+ 		TLanguage iPrevLanguage;
+ 		};
+ 
+ 		
+ 
+//
+// Local functions
+//
+
+void CleanupServiceArray(TAny* aServiceArray)
+	{
+	__ASSERT_DEBUG(aServiceArray, Panic(EPanicNullPointer));
+	CArrayFixFlat<TApaAppServiceInfo>* serviceArray = static_cast<CArrayFixFlat<TApaAppServiceInfo>*>(aServiceArray);
+	TInt serviceCount = serviceArray->Count();
+	if (serviceCount > 0)
+		{
+		for (TInt i = serviceCount - 1; i >= 0; i--)
+			{
+			(*serviceArray)[i].Release();
+			}
+		}
+	delete serviceArray;
+	serviceArray = 0;
+	}
+
+
+//
+// Class CApaAppViewData
+//
+
+CApaAppViewData::~CApaAppViewData()
+	{
+	delete iIcons;
+	delete iCaption;
+	delete iIconFileName;
+	}
+
+CApaAppViewData::CApaAppViewData()
+	: iNonMbmIconFile(EFalse)
+	{
+	}
+
+void CApaAppViewData::ConstructL()
+	{
+	iIcons=CApaAppIconArray::NewL();
+	}
+
+CApaAppViewData* CApaAppViewData::NewLC()
+	{
+	CApaAppViewData* self=new(ELeave) CApaAppViewData();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;	
+	}
+
+void CApaAppViewData::SetUid(TUid aUid)
+	{
+	iUid=aUid;
+	}
+
+void CApaAppViewData::SetScreenMode(TInt aScreenMode)
+	{
+	iScreenMode=aScreenMode;
+	}
+
+EXPORT_C TInt CApaAppViewData::ScreenMode() const
+	{
+	return iScreenMode;
+	}
+
+void CApaAppViewData::SetCaptionL(const TDesC& aCaption)
+	{
+	HBufC* newCaption=aCaption.AllocL();
+	delete(iCaption); // after the AllocL succeeds
+	iCaption=newCaption;
+	}
+
+void CApaAppViewData::SetIconArray(CApaAppIconArray* aIcons)
+	{
+	delete iIcons;
+	iIcons = aIcons;
+	}
+
+void CApaAppViewData::SetIconFileNameL(const TDesC& aFileName)
+	{
+	HBufC* fileName = aFileName.AllocL();
+	delete iIconFileName; // after the AllocL succeeds
+	iIconFileName = fileName;
+	}
+
+void CApaAppViewData::SetNonMbmIconFile(TBool aNonMbmIconFile)
+	{
+	iNonMbmIconFile = aNonMbmIconFile;
+	}
+
+EXPORT_C TUid CApaAppViewData::Uid() const
+	{
+	return iUid;
+	}
+
+EXPORT_C CApaMaskedBitmap* CApaAppViewData::Icon(const TSize& aSize) const
+	{
+	__ASSERT_ALWAYS(iIcons, Panic(EPanicNullPointer));
+	return iIcons->IconBySize(aSize);
+	}
+
+EXPORT_C CArrayFixFlat<TSize>* CApaAppViewData::IconSizesL() const
+	{
+	__ASSERT_ALWAYS(iIcons, Panic(EPanicNullPointer));
+	return iIcons->IconSizesL();
+	}
+
+EXPORT_C TPtrC CApaAppViewData::IconFileName() const
+	{
+	if (iIconFileName)
+		{
+		return *iIconFileName;
+		}
+	else
+		{
+		return TPtrC(KNullDesC);
+		}
+	}
+
+EXPORT_C TBool CApaAppViewData::NonMbmIconFile() const
+	{
+	return iNonMbmIconFile;
+	}
+
+
+//
+// class CApaAppEntry
+//
+
+CApaAppEntry* CApaAppEntry::NewL(const TApaAppEntry& aAppEntry)
+	{ // static
+	CApaAppEntry* self=new(ELeave) CApaAppEntry(aAppEntry.iUidType);
+	CleanupStack::PushL(self);
+	self->ConstructL(aAppEntry.iFullName);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+CApaAppEntry::~CApaAppEntry()
+	{
+	delete iFullName;
+	}
+
+void CApaAppEntry::Get(TApaAppEntry& aAppEntry) const
+	{
+	aAppEntry.iFullName=*iFullName;
+	aAppEntry.iUidType=iUidType;
+	}
+
+CApaAppEntry::CApaAppEntry(const TUidType& aUidType)
+	: iUidType(aUidType)
+	{
+	}
+
+void CApaAppEntry::ConstructL(const TDesC& aFileName)
+	{
+	iFullName=aFileName.AllocL();
+	}
+
+
+//
+// class TApaAppServiceInfo
+//
+
+TApaAppServiceInfo::TApaAppServiceInfo()
+	: iUid(KNullUid),
+	  iDataTypes(0),
+	  iOpaqueData(NULL)
+	{
+	}
+
+TApaAppServiceInfo::TApaAppServiceInfo(TUid aUid, 
+	CArrayFixFlat<TDataTypeWithPriority>* aDataTypes, HBufC8* aOpaqueData)
+	: iUid(aUid),
+	  iDataTypes(aDataTypes),
+	  iOpaqueData(aOpaqueData)
+	{
+	__ASSERT_DEBUG(iDataTypes, Panic(EPanicNullPointer));
+	__ASSERT_DEBUG(iOpaqueData, Panic(EPanicNullPointer));
+	}
+
+void TApaAppServiceInfo::ExternalizeL(RWriteStream& aStream) const
+	{
+	__ASSERT_DEBUG(iDataTypes, User::Invariant());
+	__ASSERT_DEBUG(iDataTypes, Panic(EPanicNullPointer));
+	__ASSERT_DEBUG(iOpaqueData, Panic(EPanicNullPointer));
+	aStream << iUid;
+	aStream << *iDataTypes; //lint !e613 Possible use of null pointer - Asserted above
+	aStream << *iOpaqueData;//lint !e613 Possible use of null pointer - Asserted above
+	}
+
+void TApaAppServiceInfo::InternalizeL(RReadStream& aStream)
+	{
+	aStream >> iUid;
+	iDataTypes = new(ELeave) CArrayFixFlat<TDataTypeWithPriority>(1);
+	aStream >> *iDataTypes;
+	iOpaqueData = HBufC8::NewL(aStream, KMaxOpaqueDataLength);
+	}
+
+void TApaAppServiceInfo::Release()
+	{
+	if (iDataTypes)
+		{
+		iDataTypes->Reset();
+		delete iDataTypes;		
+		iDataTypes = NULL;
+		}
+	if (iOpaqueData)
+		{
+		delete iOpaqueData;
+		iOpaqueData = NULL;
+		}
+	}
+
+CArrayFixFlat<TDataTypeWithPriority>& TApaAppServiceInfo::DataTypes()
+	{
+	__ASSERT_DEBUG(iDataTypes, Panic(EPanicNullPointer));
+	return *iDataTypes; //lint !e613 Possible use of null pointer - Asserted above
+	}
+
+/** Returns the service UID.
+
+Note that some APIs may store a UID other than a service UID
+in a TApaAppServiceInfo object. Such APIs clearly state what
+the UID represents.
+
+@return the service UID.
+*/
+EXPORT_C TUid TApaAppServiceInfo::Uid() const
+	{
+	return iUid;
+	}
+	
+EXPORT_C const CArrayFixFlat<TDataTypeWithPriority>& TApaAppServiceInfo::DataTypes() const
+	{
+	__ASSERT_DEBUG(iDataTypes, Panic(EPanicNullPointer));	
+	return *iDataTypes; //lint !e613 Possible use of null pointer - Asserted above
+	}
+
+/** Returns the service implementation's opaque data.
+
+For each service UID registered by an application, the associated
+opaque data indicates how the service is implemented by that application.
+
+The meaning of the opaque data is not known to the framework, it will vary
+according to the service.
+
+For some services the opaque data may be a name intended for user display,
+for others it may be structured data that the service's client-side code can interpret.
+
+@return the service implementation's opaque data.
+*/
+EXPORT_C const TDesC8& TApaAppServiceInfo::OpaqueData() const
+	{
+	if (iOpaqueData)
+		{
+		return *iOpaqueData;
+		}
+	return KNullDesC8;
+	}
+
+//
+// class CApaAppServiceInfoArray
+//
+
+CApaAppServiceInfoArray::CApaAppServiceInfoArray()
+	{
+	}
+
+//
+// class CApaAppServiceInfoArrayWrapper
+//
+
+CApaAppServiceInfoArrayWrapper* CApaAppServiceInfoArrayWrapper::NewL(CArrayFix<TApaAppServiceInfo>* aServiceInfoArray)
+	{
+	CApaAppServiceInfoArrayWrapper* self = new CApaAppServiceInfoArrayWrapper(aServiceInfoArray);
+	if (!self)
+		{
+		CleanupServiceArray(aServiceInfoArray);
+		User::LeaveNoMemory();
+		}
+	return self;
+	}
+
+CApaAppServiceInfoArrayWrapper::CApaAppServiceInfoArrayWrapper(CArrayFix<TApaAppServiceInfo>* aServiceInfoArray)
+	: iServiceInfoArray(aServiceInfoArray)
+	{
+	}
+
+CApaAppServiceInfoArrayWrapper::~CApaAppServiceInfoArrayWrapper()
+	{
+	CleanupServiceArray(iServiceInfoArray);
+	iServiceInfoArray = NULL;
+	}
+
+TArray<TApaAppServiceInfo> CApaAppServiceInfoArrayWrapper::Array()
+	{
+	__ASSERT_ALWAYS(iServiceInfoArray, Panic(EPanicNullPointer));
+	return iServiceInfoArray->Array();
+	}
+
+
+//
+// Class CApaAppData
+//
+
+EXPORT_C CApaAppData* CApaAppData::NewL(const TApaAppEntry& aAppEntry, RFs& aFs, const TDesC& aDefaultAppIconFileName)
+	{
+	CApaAppData* self=new(ELeave) CApaAppData(aFs);
+	CleanupStack::PushL(self);
+	self->ConstructL(aAppEntry, aDefaultAppIconFileName);
+	CleanupStack::Pop(); // self
+	return self;
+	}
+
+CApaAppData::CApaAppData(RFs& aFs)
+	:iCaption(NULL), iShortCaption(NULL), 
+	iIsPresent(CApaAppData::EIsPresent), iFs(aFs),
+	iNonMbmIconFile(EFalse),
+	iApplicationLanguage(ELangNone), iIndexOfFirstOpenService(-1),
+	iNonNativeApplicationType(TUid::Null())
+	{
+	}
+
+void CApaAppData::ConstructL(const TApaAppEntry& aAppEntry, const TDesC& aDefaultAppIconFileName)
+	{
+	iUidType = aAppEntry.iUidType; // if the 2nd UID is KUidAppRegistrationFile, iUidType will be updated in StoreApplicationInformation to reflect the TUidType for the application binary
+	if (ApaUtils::HandleAsRegistrationFile(aAppEntry.iUidType))
+		{
+		iRegistrationFile = aAppEntry.iFullName.AllocL();
+		}
+	else
+		{
+		iFullName = aAppEntry.iFullName.AllocL();
+		}
+
+	iCapabilityBuf.FillZ(iCapabilityBuf.MaxLength());
+	iIcons = CApaAppIconArray::NewL();
+	iViewDataArray=new(ELeave) CArrayPtrFlat<CApaAppViewData>(1);
+	iOwnedFileArray=new(ELeave) CDesCArraySeg(1);
+	User::LeaveIfError(StoreApplicationInformation(aDefaultAppIconFileName));
+	}
+
+
+
+// Return a standard error code
+// The value returned only reflect the caption status
+// If there is errors setting up captions the old values are retained
+// All other errors are silently ignored
+// General notes:
+// 1. This method is deliberately very similar to the old CApaAppData::GetAifData
+//    in order to maintain behavioural compatibility for V1 apps
+// 2. Be very careful in this method, because it can be called on a newly constructed object,
+//    or on an existing object, so don't assume member data pointers will be NULL
+TInt CApaAppData::StoreApplicationInformation(const TDesC& aDefaultAppIconFileName)
+	{
+	HBufC* caption = NULL;
+	HBufC* shortCaption = NULL;
+
+	iTimeStamp = TTime(0); // cannot init in constructor because this function can be called on an existing CApaAppData object
+
+	CApaAppInfoReader* appInfoReader = NULL;
+	TBool readSuccessful = EFalse;
+	TBool isNonNativeApp = EFalse;
+	if (iRegistrationFile != NULL)
+		{
+		if (TParsePtrC(*iRegistrationFile).Path().CompareF(KLitPathForNonNativeResourceAndIconFiles)==0)
+			{
+			isNonNativeApp = ETrue;
+			}
+		__ASSERT_ALWAYS(&aDefaultAppIconFileName,Panic(EPanicNullDefaultAppIconFileName));
+
+		TRAPD(err,appInfoReader = CApaAppInfoReaderV2::NewL(iFs, *iRegistrationFile, iUidType[2], aDefaultAppIconFileName));
+		if(err != KErrNone)
+			{
+			appInfoReader = NULL;
+			}
+
+		if (appInfoReader == NULL)
+			{
+			if (iFullName == NULL)
+				{
+				// assume that if iFullName is NULL, this method has been called as part
+				// of constructing a new app data object. The CApaAppInfoReader derived object
+				// could not be created, therefore we have no way to determine the full filename
+				// of the app binary, so give up
+				return KErrNoMemory;
+				}
+			}
+		else
+			{
+			readSuccessful = appInfoReader->Read();
+			HBufC* appBinaryFullName=appInfoReader->AppBinaryFullName();
+			if (appBinaryFullName)
+				{
+				delete iFullName;
+				iFullName = appBinaryFullName;
+				}
+			if (iFullName == NULL)
+				{
+				delete appInfoReader;
+				return KErrNoMemory;
+				}
+			// if this object has just been constructed, iUidType is currently the TUidType
+			// of the registration file, it should be the TUidType of the app binary file
+			TUidType uidType = appInfoReader->AppBinaryUidType();
+			if (uidType[1].iUid != KNullUid.iUid)
+				{
+				iUidType = uidType;
+				}
+			}
+		}
+
+	if (appInfoReader != NULL)
+		{
+		// must get captions and icons regardless of value of readSuccessful,
+		// because the V1 reader might have read captions
+		// and default icons from a caption file/default AIF, even if other info wasn't read
+		// from an application specific AIF file (!readSuccessful)
+		// this is done to maintain behavioural compatibility with V1
+		caption = appInfoReader->Caption();
+		shortCaption = appInfoReader->ShortCaption();
+
+		CApaAppIconArray* icons = appInfoReader->Icons();
+		if(icons)
+			{
+			delete iIcons;
+			iIcons = icons;
+			}
+		else
+			{
+			TRAPD(err,icons = CApaAppIconArray::NewL());
+			if(err == KErrNone)
+				{
+				delete iIcons;
+				iIcons = icons;
+				}
+			}
+			
+		iTimeStamp = appInfoReader->TimeStamp();
+		delete iLocalisableResourceFileName;
+		iLocalisableResourceFileName = appInfoReader->LocalisableResourceFileName();
+		iLocalisableResourceFileTimeStamp = appInfoReader->LocalisableResourceFileTimeStamp();
+
+		if (isNonNativeApp)
+			{
+			// In the case of a non-native app, the resource file has been prefixed with a
+			// TCheckedUid, the second of whose UIDs is the non-native application type uid.
+			TEntry entry;
+			__ASSERT_ALWAYS(iRegistrationFile, Panic(EPanicNullPointer));
+			const TInt error=iFs.Entry(*iRegistrationFile, entry);
+			if (error!=KErrNone)
+				{
+				delete appInfoReader;
+				return error;
+				}
+			__ASSERT_DEBUG(entry.iType[0].iUid==KUidPrefixedNonNativeRegistrationResourceFile, Panic(EPanicUnexpectedUid));
+			iNonNativeApplicationType=entry.iType[1];
+			}
+
+		delete iOpaqueData;
+		iOpaqueData = appInfoReader->OpaqueData();
+
+		if (readSuccessful)
+			{
+			appInfoReader->Capability(iCapabilityBuf);
+
+			iDefaultScreenNumber = appInfoReader->DefaultScreenNumber();
+
+			delete iIconFileName;
+			iIconFileName = appInfoReader->IconFileName();
+			iNonMbmIconFile = appInfoReader->NonMbmIconFile();
+			iApplicationLanguage = appInfoReader->AppLanguage();
+					
+			// views
+			iViewDataArray->ResetAndDestroy();
+			CArrayPtrFlat<CApaAppViewData>* viewDataArray = appInfoReader->Views();
+			if (viewDataArray)
+				{
+				delete iViewDataArray;
+				iViewDataArray = viewDataArray;
+				}
+
+			// owned files
+			iOwnedFileArray->Reset();
+			CDesCArray* ownedFileArray = appInfoReader->OwnedFiles();
+			if (ownedFileArray)
+				{
+				delete iOwnedFileArray;
+				iOwnedFileArray = ownedFileArray;
+				}
+			
+			UpdateServiceArray(appInfoReader->ServiceArray(iIndexOfFirstOpenService));
+			}
+		delete appInfoReader;
+		}
+
+	if (!caption)
+		{
+		TParsePtrC parse (*iFullName);
+		caption = parse.Name().Alloc();
+		}
+
+	// Put the captions into place
+	if (caption)
+		{
+		if (!shortCaption)
+			{
+			shortCaption = caption->Alloc();
+			if (!shortCaption)
+				{
+				delete caption;
+				caption = NULL;
+				}
+			}
+		}
+	if (caption)
+		{
+		delete iCaption;
+		iCaption = caption;
+		delete iShortCaption;
+		iShortCaption = shortCaption;
+		}
+
+	return caption ? KErrNone : KErrNoMemory;
+	}
+
+EXPORT_C CApaAppData::~CApaAppData()
+// Just delete components, NOT iNext (next CApaAppData in the list).
+	{
+	delete iSuccessor;
+	delete iCaption;
+	delete iShortCaption;
+	delete iFullName;
+	delete iIcons;
+
+	if(iViewDataArray)
+		{
+		iViewDataArray->ResetAndDestroy();
+		delete iViewDataArray;
+		}
+	delete iOwnedFileArray;
+	delete iIconFileName;
+	delete iLocalisableResourceFileName;
+	if (iServiceArray)
+		{
+		CleanupServiceArray(iServiceArray);
+		iServiceArray = NULL;
+		}
+	delete iOpaqueData;
+	delete iRegistrationFile;
+	iNext = NULL;
+	}
+
+void CApaAppData::UpdateServiceArray(CArrayFixFlat<TApaAppServiceInfo>* aNewServiceArray)
+	{
+	// clear out any existing service info
+	if (iServiceArray)
+		{
+		CleanupServiceArray(iServiceArray);
+		iServiceArray = NULL;
+		}
+	// store new service array
+	iServiceArray = aNewServiceArray;
+	}
+	
+TDataTypePriority CApaAppData::DataType(const TDataType& aDataType, const CArrayFixFlat<TDataTypeWithPriority>& aDataTypeArray) const
+	{
+	TInt count=aDataTypeArray.Count();
+	for (TInt ii=0;ii<count;ii++)
+		{
+		const TDataTypeWithPriority& type=aDataTypeArray[ii];
+		if (type.iDataType==aDataType)
+			{
+			return type.iPriority;
+			}
+		else
+			{
+			TPtrC8 src=type.iDataType.Des8();
+			TPtrC8 trg=aDataType.Des8();
+			if (src.Match(trg)==0 || trg.Match(src)==0)
+				{
+				if (type.iPriority == KDataTypePrioritySystem)
+					{
+					// This is more or less a magic number so don't decrement
+					return KDataTypePrioritySystem;
+					}
+				else
+					{
+					return (TInt16)(type.iPriority-1);
+					}
+				}
+			}
+		}
+	return KDataTypePriorityNotSupported;
+	}
+
+/**
+ * Returns the CApaMaskedBitmap of size aSize for the application associated
+ * with this CApaAppData. If there is not a bitmap of exact size aSize then 
+ * the icon closest to but smaller than the one asked for is returned, or NULL if
+ * none is smaller.
+ * 
+ * @since Uikon1.2
+ */
+EXPORT_C CApaMaskedBitmap* CApaAppData::Icon(TSize aSize) const
+	{
+	__ASSERT_ALWAYS(iIcons, Panic(EPanicNullPointer));
+	return iIcons->IconBySize(aSize);
+	}
+
+/**
+ * Returns a pointer to the small, medium or large application icon for aIconIndex equal to 0, 1 or 2 respectively.
+ * Panics if aIconIndex is not one of these three values.
+ *
+ * This method is superseded by an overload which returns the icon by finding the closest match to a specified size.
+ *
+ * @deprecated
+ */
+EXPORT_C CApaMaskedBitmap* CApaAppData::Icon(TInt aIconIndex) const
+	{
+	__ASSERT_DEBUG(aIconIndex>-1 && aIconIndex<3, Panic(EDPanicBadIconSize)); //only support old behaviour
+	TSize sizeExpected;
+	switch(aIconIndex)
+		{
+	case KApaIconIndexSmall:
+		sizeExpected=TSize(24,24);
+		break;
+	case KApaIconIndexMedium:
+		sizeExpected=TSize(32,32);
+		break;
+	case KApaIconIndexLarge:
+		sizeExpected=TSize(48,48);
+		break;
+	default:
+		break;
+		}
+	return Icon(sizeExpected);
+	}
+
+EXPORT_C CArrayFixFlat<TSize>* CApaAppData::IconSizesL() const
+/** Gets the sizes of icons available for the application. 
+
+@return A pointer to an array of the icon sizes. The caller takes ownership. */
+	{
+	__ASSERT_ALWAYS(iIcons, Panic(EPanicNullPointer));;
+	return iIcons->IconSizesL();
+	}
+
+EXPORT_C TApaAppEntry CApaAppData::AppEntry() const
+/** Constructs an application entry based on this object.
+
+@return The application entry. */
+	{
+	return TApaAppEntry(iUidType,*iFullName);
+	}
+
+
+EXPORT_C void CApaAppData::Capability(TDes8& aCapabilityBuf)const
+/** Gets the application's capabilities.
+
+@param aCapabilityBuf On return, contains the application's capabilities, 
+specified as a TApaAppCapabilityBuf object. */
+	{
+	TApaAppCapability::CopyCapability(aCapabilityBuf,iCapabilityBuf);
+	}
+
+/**
+ * Returns a pointer to the array of view data objects current for this application. Does not imply transfer of ownership.
+ *
+ * @since App-Framework_6.1
+ */
+EXPORT_C CArrayPtrFlat<CApaAppViewData>* CApaAppData::Views() const
+	{
+	return iViewDataArray;
+	}
+
+/**
+ * Returns a pointer to the array of files for which this application claims ownership. Does not imply transfer of ownership.
+ *
+ * @since App-Framework_6.1
+ */
+EXPORT_C CDesCArray* CApaAppData::OwnedFiles() const
+	{
+	return iOwnedFileArray;
+	}
+
+TBool CApaAppData::Update(const TDesC& aDefaultAppIconFileName)
+// returns true if changes were made to the cached data
+	{
+	__APA_PROFILE_START(17);
+	TBool changed=EFalse;
+
+	// Get app info file entry
+	TEntry entry;
+	TInt ret;
+	if (iRegistrationFile != NULL)
+		{
+		ret = iFs.Entry(*iRegistrationFile, entry);
+		if (ret==KErrNone && entry.iModified!=iTimeStamp)
+			{
+			// assume registration file may have changed
+			changed = ETrue;
+			}
+		else
+			{
+			if (iLocalisableResourceFileName)
+				{
+				// see if localisable resource information might have changed
+				TParse parse;
+				ret = parse.SetNoWild(KAppResourceFileExtension, iLocalisableResourceFileName, NULL);
+				if (ret == KErrNone)
+					{
+					TFileName resourceFileName(parse.FullName());
+					BaflUtils::NearestLanguageFile(iFs, resourceFileName);
+					if (resourceFileName.CompareF(*iLocalisableResourceFileName)!=0)
+						{
+						changed = ETrue;
+						}
+					else
+						{
+						ret = iFs.Entry(*iLocalisableResourceFileName, entry);
+						if ((ret==KErrNotFound && iLocalisableResourceFileTimeStamp!=TTime(0)) ||
+							(ret==KErrNone && entry.iModified!=iLocalisableResourceFileTimeStamp))
+							{
+							changed = ETrue;
+							}
+						}
+					}
+				}
+			}
+		}
+	if (changed)
+		{
+		// Ignore result, nothing we can do in case failure
+		// and the old values should be preserved
+        const TInt ignore = StoreApplicationInformation(aDefaultAppIconFileName);
+		} //lint !e529 Suppress symbol 'ignore' not subsequently referenced
+		
+	__APA_PROFILE_END(17);
+	return changed;
+	}
+
+EXPORT_C TDataTypePriority CApaAppData::DataType(const TDataType& aDataType) const
+// returns the priority of the data type
+/** If the application supports the specified data type, the function returns 
+the priority with which it should be selected for handling it.
+
+If the application does not support the specified data type, 
+KDataTypePriorityNotSupported is returned.
+
+Note that the function supports wildcard matching, using "*" and "?". In the case 
+of a wildcard match, the priority value returned is reduced by 1, so that in this 
+case, the application could never have the maximum priority 
+(KDataTypePriorityUserSpecified).
+
+@param aDataType The data type of interest.
+@return The priority with which the application should be selected for handling 
+the specified data type, or KDataTypePriorityNotSupported if the data type is 
+not supported. */
+	{
+	if (iIndexOfFirstOpenService >= 0)
+		{
+		__ASSERT_ALWAYS(iServiceArray, Panic(EPanicNullPointer));
+		const CArrayFixFlat<TDataTypeWithPriority>& dataTypeArray = 
+			(*iServiceArray)[iIndexOfFirstOpenService].DataTypes();
+		return DataType(aDataType, dataTypeArray);
+		}
+	return KDataTypePriorityNotSupported;
+	}
+
+
+EXPORT_C TBool CApaAppData::IsPending() const
+	{
+	return (iIsPresent==CApaAppData::EPresentPendingUpdate 
+		|| iIsPresent==CApaAppData::ENotPresentPendingUpdate);
+	}
+
+EXPORT_C TBool CApaAppData::CanUseScreenMode(TInt aScreenMode)
+/** Tests whether the specified screen mode is valid for any of 
+this application's views. If the app has no views, the function 
+assumes that only the default screen mode (at screen mode index 
+zero) is allowed. This function is used by CApaAppList to create 
+a list of valid applications.
+
+@param aScreenMode The index of the screen mode.
+@return True if screen mode is valid, otherwise false. */
+	{
+	const TInt count=iViewDataArray->Count();
+	// If there are no views, assume only the default screen mode is allowed
+	TBool ret=(count==0 && aScreenMode==0);
+	for(TInt ii=0;ii<count;ii++)
+		{
+		const CApaAppViewData* data=(*iViewDataArray)[ii];
+		if(data->ScreenMode()==aScreenMode)
+			{
+			ret=ETrue;
+			break;
+			}
+		}
+	return ret;
+	}
+
+EXPORT_C void CApaAppData::GetIconInfo(TInt& aIconCount, TInt& aDefaultIconsUsed) const
+/** Gets icon information for the app
+
+@param aIconCount On return, this contains the number of app icons
+@param aDefaultIconsUsed On return, this indicates whether the default icons have been used
+*/
+	{
+	__ASSERT_ALWAYS(iIcons, Panic(EPanicNullPointer));;
+	aIconCount = iIcons->Count();
+	aDefaultIconsUsed = iIcons->DefaultIconsUsed();
+	}
+
+/** Gets the default screen number used by the application.
+
+A device may have more than once screen. This function
+returns the number associated with the screen which will
+be the default screen used by the application.
+
+@return The default screen number
+*/
+EXPORT_C TUint CApaAppData::DefaultScreenNumber() const
+	{
+	return iDefaultScreenNumber;
+	}
+
+/** Returns true if app info was provided by a registration file
+
+@return true if app info was provided by a registration file
+*/
+EXPORT_C TBool CApaAppData::RegistrationFileUsed() const
+	{
+	return iRegistrationFile != NULL;
+	}
+
+/** Returns the full filename of the registration resource file
+
+@return The full path and filename of the registration resource file.
+@internalTechnology
+*/
+EXPORT_C TPtrC CApaAppData::RegistrationFileName() const
+	{
+	if (iRegistrationFile)
+		{
+		return *iRegistrationFile;
+		}
+	else
+		{
+		return TPtrC(KNullDesC);
+		}
+	}
+
+
+/** Returns the full filename of the localisable resource file
+
+@return The full path and filename of the localisable resource file.
+@internalTechnology
+*/
+EXPORT_C TPtrC CApaAppData::LocalisableResourceFileName() const
+	{
+	if (iLocalisableResourceFileName)
+		{
+		return *iLocalisableResourceFileName;
+		}
+	else
+		{
+		return TPtrC(KNullDesC);
+		}
+	}
+
+
+/** Returns the non-native application opaque data
+
+@return The non-native application opaque data.
+@internalComponent
+*/
+EXPORT_C TPtrC8 CApaAppData::OpaqueData() const
+	{
+	if (iOpaqueData)
+		{
+		return *iOpaqueData;
+		}
+	else
+		{
+		return TPtrC8(KNullDesC8);
+		}
+	}
+
+EXPORT_C TUid CApaAppData::NonNativeApplicationType() const
+/** @internalComponent */
+	{
+	return iNonNativeApplicationType;
+	}
+
+/** Returns the full filename of the file containing application icons
+
+@return The full path and filename of the icon file.
+*/
+EXPORT_C TPtrC CApaAppData::IconFileName() const
+	{
+	if (iIconFileName)
+		{
+		return *iIconFileName;
+		}
+	else
+		{
+		return TPtrC(KNullDesC);
+		}
+	}
+
+/** Returns true if the application provides a non-MBM icon filename.
+
+If this function returns false, this does not necessarily mean
+an MBM icon filename is provided.
+
+@return true if the application provides a non-MBM icon filename.
+*/
+EXPORT_C TBool CApaAppData::NonMbmIconFile() const
+	{
+	return iNonMbmIconFile;
+	}
+
+
+/** Determines the current language the application is using to display its
+user interface.
+@return The current language.
+*/	
+EXPORT_C TLanguage CApaAppData::ApplicationLanguage() const
+	{
+	return iApplicationLanguage;
+	}
+
+/** Returns true if the application implements the specified service.
+@param aServiceUid The service UID.
+@return true if the application implements the specified service.
+@internalComponent
+*/
+EXPORT_C TBool CApaAppData::ImplementsService(TUid aServiceUid) const
+	{
+	if (iServiceArray)
+		{
+		TInt count = iServiceArray->Count();
+		for (TInt i = count-1; i >= 0; i--)
+			{
+			if ((*iServiceArray)[i].Uid() == aServiceUid)
+				{
+				return ETrue;
+				}
+			}
+		}
+	return EFalse;
+	}
+	
+/** Checks if the application implements the specified service and if the 
+service explicitly supports the datatype. Explicitly means that the datatype is
+listed in the service's list of datatype in the registration file and is
+not the general datatype associated with the application (aka the Open service).
+@param aServiceUid The service UID.
+@param aDataType The datattype
+@return The priority. KDataTypePriorityNotSupported if the app doesn't support
+this service with this datatype.
+@internalComponent
+*/
+TInt CApaAppData::ImplementsServiceWithDataType(TUid aServiceUid, const TDataType& aDataType) const
+	{
+	TInt result = KDataTypePriorityNotSupported;
+	if (iServiceArray)
+		{
+		TInt count = iServiceArray->Count();
+		for (TInt i = count-1; i >= 0; i--)
+			{
+			// There can be more than one instance of a given service so we iterate
+			// through the whole service list even if we have already found a suitable
+			// service.
+			if ((*iServiceArray)[i].Uid() == aServiceUid)
+				{
+				const CArrayFixFlat<TDataTypeWithPriority>& datatypes =
+					(*iServiceArray)[i].DataTypes();
+				TInt priority = DataType(aDataType, datatypes);
+				if (priority > result)
+					{
+					result = priority;
+					}
+				}
+			}
+		}
+	return result;
+	}
+
+EXPORT_C void CApaAppData::SetShortCaptionL(const TDesC& aShortCaption)
+	{
+	__ASSERT_ALWAYS(iShortCaption, Panic(EPanicNullPointer));
+	if(iShortCaption->Compare(aShortCaption) != 0)
+		{
+		HBufC* newShortCaption=aShortCaption.AllocL();
+		delete iShortCaption; // after the AllocL succeeds
+		iShortCaption = newShortCaption;
+		}
+	}
+
+//
+// Class CApaAppList
+//
+
+EXPORT_C CApaAppList* CApaAppList::NewL(RFs& aFs,CApaAppRegFinder* aAppRegFinder,TBool aLoadMbmIconsOnDemand, TInt aIdlePeriodicDelay)
+	{
+	CApaAppList* self=new CApaAppList(aFs, aAppRegFinder,aLoadMbmIconsOnDemand, aIdlePeriodicDelay);
+	if (!self)
+		{
+		delete aAppRegFinder;
+		User::LeaveNoMemory();
+		}
+	else
+		{
+		CleanupStack::PushL(self);
+		self->ConstructL();
+		CleanupStack::Pop(self);
+		}
+	return self;
+	}
+
+CApaAppList::CApaAppList(RFs& aFs, CApaAppRegFinder* aAppRegFinder,TBool aLoadMbmIconsOnDemand, TInt aIdlePeriodicDelay)
+	:iFs(aFs),
+	iFlags(0),
+	iAppRegFinder(aAppRegFinder),
+	iIdlePeriodicDelay(aIdlePeriodicDelay),
+	iLoadMbmIconsOnDemand(aLoadMbmIconsOnDemand)
+	{
+	}
+	
+void CApaAppList::ConstructL()
+	{
+	User::LeaveIfError(iFsShareProtected.Connect());
+	User::LeaveIfError(iFsShareProtected.ShareProtected());
+	User::LeaveIfError(Dll::SetTls(this));
+	
+	//Start language change monitor.
+	iAppLangMonitor = CApaLangChangeMonitor::NewL(*this);
+	}
+	
+EXPORT_C CApaAppList::~CApaAppList()
+/** Frees all resources prior to destruction, including the application data list. */
+	{
+	iValidFirstAppData = NULL;
+	iFlags&=~EFirstScanComplete;
+	CApaAppData* next = NULL;
+	for (CApaAppData* appData=iAppData; appData; appData = next)
+		{
+		next = appData->iNext;
+		delete appData;
+		}
+	iAppData = NULL;
+	iObserver = NULL;
+	
+	iFsShareProtected.Close();
+	
+	delete iDefaultIconArray;
+	delete iDefaultAppIcon;
+	delete iAppRegFinder;
+	delete iAppIdler;
+	}
+
+EXPORT_C void CApaAppList::StartIdleUpdateL()
+/** Updates the list asynchronously, using an idle time active object, 
+and no observer. When the update is finished, the resulting app 
+list is stored. */
+	{
+
+	// find the default icons (.mbm file) for applications, wrt current locale
+	TFileName* tempFileName = new(ELeave) TFileName;
+	CleanupStack::PushL(tempFileName);
+	tempFileName->Append(KDefaultAppIconMbm);
+	BaflUtils::NearestLanguageFile(iFs, *tempFileName); 
+	delete iDefaultAppIcon;
+	iDefaultAppIcon = NULL;	
+	iDefaultAppIcon = HBufC::NewL(tempFileName->Size());
+	
+	TPtr iconptr = iDefaultAppIcon->Des();
+	iconptr.Append(*tempFileName);
+	CleanupStack::PopAndDestroy(tempFileName); 
+	
+	// DEF076594 - if changing locale, need to update the default icons here
+	// If updating the default icons array fails, the array is left in the state
+	// it was in before the call.	
+	if(iDefaultIconArray)
+		{
+		TRAP_IGNORE(UpdateDefaultIconsL());
+		}
+	
+	// start to scan.
+	if (iAppIdler)
+		{
+		delete iAppIdler;
+		iAppIdler=NULL;
+		}
+
+	// DEF072701
+	// When performing the update scan let the idle object have lower priority.
+	if (IsFirstScanComplete())
+		{
+		iAppIdler=CPeriodic::NewL(CActive::EPriorityLow);
+		}
+	else
+		{
+		iAppIdler=CPeriodic::NewL(CActive::EPriorityStandard);
+		}
+	SetPending(iAppData);
+	iCurrentApp=TApaAppEntry();
+	iScanStage=EFirstStageScan;
+	__ASSERT_ALWAYS(iAppRegFinder, Panic(EPanicNullPointer));
+	iAppRegFinder->FindAllAppsL();
+ 
+ 	// DEF072701
+ 	// If this is the first scan i.e the boot scan then it may take some time. Thus
+ 	// the periodic delay value should be used so that this process will stop periodically 
+ 	// to allow time for other processes.
+ 	// If this is just a re-scan it should take much less time. Therefore it should just
+ 	// be completed in one go rather than periodically delayed. Thus the delay value
+ 	// should be set to 0.
+	iAppIdler->Start(KIdleStartDelay, IsFirstScanComplete()? 0 : iIdlePeriodicDelay, TCallBack(IdleUpdateCallbackL, this));
+	}
+
+EXPORT_C void CApaAppList::StartIdleUpdateL(MApaAppListObserver* aObserver)
+/** Updates the list asynchronously, using an idle time active object 
+and an observer. When the update is finished, the resulting app list 
+is stored and the observer is notified with an MApaAppListServObserver::EAppListChanged 
+message, if the list changed.
+@param aObserver Observer to be notified when the update has finished. */
+	{
+	iObserver=aObserver;
+	if (iAppIdler==NULL)
+		{
+		// if iAppIdler exists then we're already in the middle of an update and
+		// may have changed iUpdateCounter without yet reporting the changes
+		iOldUpdateCounter=iUpdateCounter;
+		}
+	
+	StartIdleUpdateL();
+	}
+
+// Stop scanning applications if and uninstallation has started	
+EXPORT_C void CApaAppList::StopScan()
+	{
+	if (iAppIdler)
+		{
+		delete iAppIdler;
+		iAppIdler=NULL;
+		}
+	UndoSetPending(iAppData);
+	}
+	
+// Allow scanning when uninstallation is complete
+EXPORT_C void CApaAppList::RestartScanL()
+	{
+	TRAP_IGNORE(PurgeL());
+	StartIdleUpdateL();
+	}
+
+EXPORT_C void CApaAppList::InitListL(MApaAppListObserver* aObserver)
+/** Starts updating the list asynchronously, by calling StartIdleUpdateL().
+
+@param aObserver Observer to be notified when the update has finished. */
+	{
+	StartIdleUpdateL(aObserver);
+	}
+	
+TInt CApaAppList::IdleUpdateCallbackL(TAny* aObject)
+	{
+	CApaAppList* self=reinterpret_cast<CApaAppList*>(aObject);
+	const TBool moreToCome=self->IdleUpdateL();
+	if (moreToCome==EFalse)
+		{
+		if(self->iScanStage==EFirstStageScan)
+			{
+			self->iScanStage=EScanFinished;
+			self->StopIdlerL();	
+			}
+		}
+	return moreToCome;
+	}
+
+void CApaAppList::StopIdlerL()
+	{
+ 
+	delete iAppIdler;
+	iAppIdler=NULL;
+		
+	// now that the scan is finished, iDefaultAppIcon is deleted
+	delete iDefaultAppIcon;
+	iDefaultAppIcon=NULL;
+			
+	if (iObserver)
+		{
+		if (iOldUpdateCounter!=iUpdateCounter)
+			{
+			//NotifyUpdate will notify clients for both list update and scan complete.
+			iObserver->NotifyUpdate(MApaAppListServObserver::EAppListChanged);
+			}
+		else
+			{
+			//NotifyScanComplete will notify clients for scan complete.
+			iObserver->NotifyScanComplete();
+			}
+			
+		iObserver=NULL;
+		}
+	}
+
+TInt CApaAppList::IdleUpdateL()
+// returns ETrue if there is more scanning to be done.
+	{
+	TBool more=EFalse;
+	__ASSERT_ALWAYS(iAppRegFinder, Panic(EPanicNullPointer));
+	TRAPD(err,more=iAppRegFinder->NextL(iCurrentApp, iForcedRegistrations));
+	if (err!=KErrNone)
+		return more;
+	TBool hasChanged=EFalse;
+	if (more)
+		{
+		TRAPD(err,UpdateNextAppL(iCurrentApp,hasChanged));
+		if (err!=KErrNone)
+			{
+			SetNotFound(iAppData,hasChanged);
+			more=EFalse; // abandon ship
+			}
+		}
+	else
+		{
+		SetNotFound(iAppData,hasChanged);
+		PurgeL();
+		}
+	//
+	if (hasChanged)
+		iUpdateCounter++;
+	return more;
+	}
+
+EXPORT_C TBool CApaAppList::IsIdleUpdateComplete() const
+/** Tests whether an asynchronous update of the list is currently in progress.
+
+@return True if no asynchronous update of the list is currently in progress, 
+otherwise false. */
+	{
+	return iAppIdler == NULL;
+	}
+
+void CApaAppList::SetPending(CApaAppData* aAppData)
+	// set all apps to pending update - we'll find them again as we scan
+	{
+  	for (; aAppData; aAppData = aAppData->iNext)
+		{
+		if (aAppData->iIsPresent==CApaAppData::ENotPresent 
+			|| aAppData->iIsPresent==CApaAppData::ENotPresentPendingUpdate)
+			{
+			aAppData->iIsPresent = CApaAppData::ENotPresentPendingUpdate;
+			}
+		else
+			{
+			aAppData->iIsPresent = CApaAppData::EPresentPendingUpdate;
+			}
+		}
+	}
+
+void CApaAppList::UndoSetPending(CApaAppData* aAppData)
+	// Reset all apps to pevious pending state so they don't get purged
+	{
+  	for (; aAppData; aAppData = aAppData->iNext)
+		{
+		if (aAppData->iIsPresent == CApaAppData::EPresentPendingUpdate)
+			{
+			aAppData->iIsPresent = CApaAppData::EIsPresent;
+			}
+		}
+	}
+
+void CApaAppList::SetNotFound(CApaAppData* aAppData, TBool& aHasChanged)
+	// mark any unfound apps not present
+	{
+	while (aAppData)
+		{
+		if (aAppData->IsPending())
+			{
+			aAppData->iIsPresent = CApaAppData::ENotPresent;
+			aHasChanged = ETrue;
+			}
+		aAppData = aAppData->iNext;
+		}
+	}
+
+void CApaAppList::AddToList( CApaAppData* aAppData )
+{
+	__ASSERT_DEBUG(aAppData, Panic(EPanicNullPointer));
+	aAppData->iNext=iAppData;
+	iAppData=aAppData;
+}
+
+void CApaAppList::UpdateNextAppL(const TApaAppEntry& aAppEntry,TBool& aHasChanged)
+	{
+	CApaAppData* appData=AppDataByUid(aAppEntry.iUidType[2]);
+	if (appData==NULL)
+		{// not in list, so add it at the start
+		TRAPD(err,appData=CApaAppData::NewL(aAppEntry, iFs, *iDefaultAppIcon));
+		if (err==KErrNone)
+			{
+			AddToList( appData );
+			aHasChanged=ETrue;
+			}
+		}
+	else if (appData->IsPending())
+		{ // not found yet during current scan - we may need to override this one
+		
+		// On a system which scans for registration .RSC files (V2 apps) first, followed by
+		// .APP files (V1 apps), it's valid for a V1 app to override a V2 app (if the V2 app
+		// has just been removed). If this is the case, assume it's ok to compare the V1 .APP filename,
+		// with the V2 .RSC filename as their filenames will never match (which is what we want in this case).
+		TPtrC currentFileName;
+		if (appData->RegistrationFileUsed())
+			{
+			currentFileName.Set(*appData->iRegistrationFile);
+			}
+		else
+			{
+			currentFileName.Set(*appData->iFullName);
+			}
+		if (aAppEntry.iFullName.CompareF(currentFileName)!=0)
+			{
+			delete appData->iSuccessor;
+			appData->iSuccessor = NULL;
+			appData->iSuccessor = CApaAppEntry::NewL(aAppEntry);
+
+
+			appData->iIsPresent = CApaAppData::ESuperseded;
+			aHasChanged=ETrue;
+			}
+		else
+			{
+			if (appData->Update(*iDefaultAppIcon)
+				|| appData->iIsPresent==CApaAppData::ENotPresentPendingUpdate) 
+				{
+				aHasChanged=ETrue; 
+				}
+			appData->iIsPresent = CApaAppData::EIsPresent;
+			}
+		}
+	
+	}
+
+/**
+@internalComponent
+*/
+EXPORT_C CApaAppData* CApaAppList::FindAndAddSpecificAppL(CApaAppRegFinder* aFinder, TUid aAppUid)
+	{
+//Scans and adds the specified application to the app list if found
+	__ASSERT_DEBUG(aFinder, Panic(EPanicNullPointer));
+	TBool found = EFalse;
+	TApaAppEntry appEntry;
+	aFinder->FindAllAppsL();
+	while (aFinder->NextL(appEntry, iForcedRegistrations))
+		{
+		if (appEntry.iUidType[2] == aAppUid)
+			{
+			found = ETrue;
+			break;
+			}
+		}
+	
+	CApaAppData* app = NULL;
+	if (found)
+		{
+		// add the app to the list
+		TBool hasChanged = EFalse;
+		CApaAppData* prevFirstAppInList = iAppData;
+		UpdateNextAppL(appEntry, hasChanged);
+		if (iAppData != prevFirstAppInList)
+			{
+			// assume the new app was added to the list
+			app = iAppData;
+			}
+		if (hasChanged)
+			iUpdateCounter++;
+		}
+	return app;
+	}
+
+EXPORT_C void CApaAppList::PurgeL()
+/** Removes any applications from the list if they are no longer present 
+on the phone. It updates applications that have been 
+superceded. */
+	{
+	CApaAppData* appData=iAppData;
+	CApaAppData* prev=NULL;
+	while (appData)
+		{
+		CApaAppData* next=appData->iNext;
+		if (appData->iIsPresent==CApaAppData::ENotPresent)
+			{
+			if (prev)
+				prev->iNext=next;
+			else
+				iAppData=next;
+			delete appData;
+			}
+		else if (appData->iIsPresent==CApaAppData::ESuperseded)
+			{
+			CApaAppData* newApp=NULL;
+			TApaAppEntry appEntry;
+			appData->iSuccessor->Get(appEntry);
+			TRAPD(err,newApp=CApaAppData::NewL(appEntry, iFs,*iDefaultAppIcon));
+			if (err==KErrNone)
+				{
+				// remove the old one and add the new one in its place
+				if (prev)
+					prev->iNext=newApp;
+				else
+					iAppData=newApp;
+				newApp->iNext = appData->iNext;
+				delete appData;
+				// increment the iterator
+				prev = newApp;
+				}
+			}
+		else
+			prev=appData;
+		appData=next;
+		}
+ 
+	ScanComplete();
+	}
+
+EXPORT_C TInt CApaAppList::Count() const
+/** Gets the count of applications present in the app list.
+
+@return The number of applications in the list. */
+
+	{
+	TInt count=0;
+	CApaAppData* appData=iAppData;
+	while (appData)
+		{
+		count++;
+		appData=appData->iNext;
+		}
+	return count;
+	}
+
+EXPORT_C CApaAppData* CApaAppList::FirstApp() const
+/** Gets a pointer to the first application in the list 
+that can use the default screen mode.
+
+@return A pointer to the first application. */
+	{
+	return FirstApp(0);
+	}
+
+EXPORT_C CApaAppData* CApaAppList::FirstApp(TInt aScreenMode) const
+/** Gets a pointer to the first application in the list 
+that can use the specified screen mode.
+
+@param aScreenMode The index of the screen mode. Specifying 
+KIgnoreScreenMode returns the first application in the list, 
+regardless of screen mode.
+@return A pointer to the first application that can use the 
+specified screen mode. */
+	{
+
+	CApaAppData* appData=iValidFirstAppData;
+
+	if(aScreenMode!=KIgnoreScreenMode)
+		{
+		while (appData && !appData->CanUseScreenMode(aScreenMode))
+			appData = appData->iNext;
+		}
+
+	return appData;
+	}
+
+EXPORT_C CApaAppData* CApaAppList::NextApp(const CApaAppData* aApp) const
+/** Gets a pointer to the next application after aApp in the list 
+that can use the default screen mode.
+
+@param aApp A pointer to an application in the list.
+@return A pointer to the next application after aApp in the list 
+that can use the default screen mode.
+@panic APGRFX 12 aApp is NULL. */
+	{
+	return NextApp(aApp,0);
+	}
+
+EXPORT_C CApaAppData* CApaAppList::NextApp(const CApaAppData* aApp, TInt aScreenMode) const
+/** Gets a pointer to the next application after aApp in the list 
+that can use the specified screen mode.
+
+@param aApp A pointer to an application in the list. 
+@param aScreenMode The index of the screen mode. Specifying 
+KIgnoreScreenMode returns the next application in the list, 
+regardless of screen mode.
+@return A pointer to the next application after aApp in the list 
+that can use the specified screen mode.
+@panic APGRFX 12 aApp is NULL. */
+
+	{
+	__ASSERT_ALWAYS(aApp,Panic(EPanicNoAppDataSupplied));
+	//
+	CApaAppData* iApp=aApp->iNext; //lint !e613 Possible use of null pointer - Asserted above
+
+	if(aScreenMode!=KIgnoreScreenMode)
+		while (iApp && !iApp->CanUseScreenMode(aScreenMode))
+			iApp = iApp->iNext;
+
+	return iApp;
+	}
+
+EXPORT_C CApaAppData* CApaAppList::AppDataByUid(TUid aAppUid) const
+/** Gets a pointer to the application in the list whose third 
+UID matches the specified UID.
+
+@param aAppUid An application's third UID. 
+@return A pointer to the application, if successful. Null, 
+if no match is found or if KNullUid was specified. */
+	{
+	if (aAppUid==KNullUid)
+		return NULL; // never match null UID as it represents an un-UIDed file
+	CApaAppData* appData=iAppData;
+	while (appData)
+		{
+		if (appData->AppEntry().iUidType[2]==aAppUid)
+			return appData;
+		appData=appData->iNext;
+		}
+	return NULL;
+	}
+
+EXPORT_C CApaAppData* CApaAppList::AppDataByFileName(const TDesC& aFullFileName) const
+/** Gets a pointer to the application in the list whose application
+file name matches the one specified
+
+@param aFullFileName a file name. 
+@return A pointer to the application, if successful. Null, 
+if no match is found or if KNullDesC was specified.
+@internalTechnology
+*/
+	{
+	if (aFullFileName.Length()==0)
+		{
+		return NULL; // never match null UID as it represents an un-UIDed file
+		}
+	CApaAppData* appData=iAppData;
+	while (appData)
+		{
+		if (appData->AppEntry().iFullName.CompareF(aFullFileName)==0)
+			{
+			return appData;
+			}
+		appData=appData->iNext;
+		}
+	return NULL;
+	}
+	
+/**
+Adds a registration file to the iForcedRegistrations array.
+
+@param aRegistrationFile The function takes ownership of the HBufC.
+@internalComponent
+*/
+EXPORT_C void CApaAppList::AddForcedRegistrationL(HBufC* aRegistrationFile)
+	{
+	TInt err = iForcedRegistrations.InsertInOrder(aRegistrationFile, TLinearOrder<HBufC>(CompareStrings));
+	if (err == KErrAlreadyExists) // We silently ignore attempts to insert duplicates
+		{
+		delete aRegistrationFile;
+		}
+	else
+		{
+		User::LeaveIfError(err);
+		}
+	} //lint !e818 Suppress pointer parameter 'aRegistrationFile' could be declared as pointing to const
+	
+EXPORT_C void CApaAppList::ResetForcedRegistrations()
+	{
+	iForcedRegistrations.ResetAndDestroy();
+	}
+
+EXPORT_C TInt CApaAppList::UpdateCounter() const
+/** Gets the number of times the application list has been updated. 
+It returns zero for a newly created empty list.
+
+@return The number of times the list has been changed since it was 
+created. */
+	{
+	return iUpdateCounter;
+	}
+
+EXPORT_C TUid CApaAppList::PreferredDataHandlerL(const TDataType& aDataType) const
+/** Finds the preferred application to handle the specified data type.
+
+@param aDataType The data type of interest.
+@return The third UID of the application in the list which has the 
+highest priority for handling the specified data type. A null UID is 
+returned if no application in the list can handle the specified data type. */
+	{
+	TInt dummy;
+	return PreferredDataHandlerL(aDataType, NULL, dummy);
+	}
+	
+EXPORT_C TUid CApaAppList::PreferredDataHandlerL(const TDataType& aDataType, const TUid* aServiceUid, TInt& aPriority) const
+/** Finds the preferred application to handle the specified data type.
+
+@param aDataType The data type of interest.
+@param aServiceUid The optional service UID.
+@param aPriority The priority associated with the returned app.
+@return The third UID of the application in the list which has the 
+highest priority for handling a combination of the specified data type
+and service. A null UID is returned if no application in the list can
+handle the combination of specified data type and service.
+@internalComponent
+*/
+	{
+	// If there is a service uid we first try to use the service specific list
+	// of datatypes
+	if (aServiceUid)
+		{
+		CApaAppData* appData=iAppData;
+		aPriority=KDataTypePriorityNotSupported;
+		TUid uid={0};
+		while (appData)
+			{
+			TInt priority = appData->ImplementsServiceWithDataType(*aServiceUid, aDataType);
+			if (priority > aPriority)
+				{
+				aPriority=priority;
+				uid=appData->AppEntry().iUidType[2];
+				}
+			appData=appData->iNext;
+			}
+		if (aPriority != KDataTypePriorityNotSupported)
+			{
+			return uid;
+			}
+		}
+	
+	CApaAppData* appData=iAppData;
+	aPriority=KDataTypePriorityNotSupported;
+	TUid uid={0};
+	while (appData)
+		{
+		TInt priority=appData->DataType(aDataType);
+		if ((priority > aPriority) &&
+			(!aServiceUid || (aServiceUid && appData->ImplementsService(*aServiceUid))))
+			{
+			aPriority=priority;
+			uid=appData->AppEntry().iUidType[2];
+			}
+		appData=appData->iNext;
+		}
+	return uid;
+	}
+
+void CApaAppList::ScanComplete()
+	{
+	if(!IsFirstScanComplete() && iObserver)
+		iObserver->InitialListPopulationComplete();
+	iValidFirstAppData = iAppData;
+	iFlags|=EFirstScanComplete;
+	}
+
+/**
+ *
+ * Tests whether the first scan for list of Apps has completed.
+ *
+ * @return   "TBool"
+ *            True, if the first scan for list of Apps has completed; false, otherwise.
+ * @internalComponent
+ */
+EXPORT_C TBool CApaAppList::IsFirstScanComplete() const
+	{
+	return iFlags&EFirstScanComplete;
+	}
+
+EXPORT_C TBool CApaAppList::AppScanInProgress() const
+/** @internalComponent */
+	{
+	return (iAppIdler!=NULL) && iAppIdler->IsActive();
+	}
+
+/**
+@internalComponent
+*/
+EXPORT_C CBufFlat* CApaAppList::ServiceArrayBufferL(TUid aAppUid) const
+	{
+	CApaAppData* app = FirstApp(KIgnoreScreenMode);
+	while (app && app->AppEntry().iUidType[2] != aAppUid)
+		{
+		app = NextApp(app, KIgnoreScreenMode);
+		}
+
+	if (app)
+		{
+		if (!app->RegistrationFileUsed())
+			{
+			User::Leave(KErrNotSupported);
+			}
+		if (app->iServiceArray)
+			{
+			CBufFlat* const buf = CBufFlat::NewL(KBufferExpansionGranularity);
+			CleanupStack::PushL(buf);
+			RBufWriteStream writeStream(*buf);
+			writeStream << *(app->iServiceArray);
+			writeStream.CommitL();
+			writeStream.Release();
+			CleanupStack::Pop(buf);
+			return buf;
+			}
+		}
+	User::Leave(KErrNotFound);
+	return NULL; // to keep compiler happy
+	}
+
+/**
+@internalComponent
+*/
+EXPORT_C CBufFlat* CApaAppList::ServiceUidBufferL(TUid aAppUid) const
+	{
+	CApaAppData* app = FirstApp(KIgnoreScreenMode);
+	while (app && app->AppEntry().iUidType[2] != aAppUid)
+		{
+		app = NextApp(app, KIgnoreScreenMode);
+		}
+
+	if (app)
+		{
+		if (!app->RegistrationFileUsed())
+			{
+			User::Leave(KErrNotSupported);
+			}
+		if (app->iServiceArray)
+			{
+			CArrayFixFlat<TApaAppServiceInfo>& serviceArray = *(app->iServiceArray);
+			CArrayFixFlat<TUid>* uidArray = new(ELeave) CArrayFixFlat<TUid>(4);
+			CleanupStack::PushL(uidArray);
+			for (TInt i = serviceArray.Count()-1; i >= 0; i--)
+				{
+				uidArray->AppendL(serviceArray[i].Uid());
+				}
+			CBufFlat* const buf = CBufFlat::NewL(KBufferExpansionGranularity);
+			CleanupStack::PushL(buf);
+			RBufWriteStream writeStream(*buf);
+			writeStream << *uidArray;
+			writeStream.CommitL();
+			writeStream.Release();
+			CleanupStack::Pop(buf);
+			CleanupStack::PopAndDestroy(uidArray);
+			return buf;
+			}
+		}
+	User::Leave(KErrNotFound);
+	return NULL; // to keep compiler happy
+	}
+
+/**
+@internalComponent
+*/
+EXPORT_C CBufFlat* CApaAppList::ServiceOpaqueDataBufferL(TUid aAppUid, TUid aServiceUid) const
+	{
+	CApaAppData* app = FirstApp(KIgnoreScreenMode);
+	while (app && app->AppEntry().iUidType[2] != aAppUid)
+		{
+		app = NextApp(app, KIgnoreScreenMode);
+		}
+
+	if (app)
+		{
+		if (!app->RegistrationFileUsed())
+			{
+			User::Leave(KErrNotSupported);
+			}
+		if (app->iServiceArray)
+			{
+			CArrayFixFlat<TApaAppServiceInfo>* implArray = NULL;
+			CArrayFixFlat<TApaAppServiceInfo>& serviceArray = *(app->iServiceArray);
+			for (TInt i = serviceArray.Count()-1; i >= 0; i--)
+				{
+				const TApaAppServiceInfo& infoRef = serviceArray[i];
+				if (infoRef.Uid() == aServiceUid)
+					{
+					if (!implArray)
+						{
+						implArray = new(ELeave) CArrayFixFlat<TApaAppServiceInfo>(4);
+						CleanupStack::PushL(TCleanupItem(CleanupServiceArray, implArray));
+						}
+					CArrayFixFlat<TDataTypeWithPriority>* dummy =
+						new(ELeave) CArrayFixFlat<TDataTypeWithPriority>(1);
+					CleanupStack::PushL(dummy);					
+					TApaAppServiceInfo info(aServiceUid, dummy, infoRef.OpaqueData().AllocLC());
+					implArray->AppendL(info);
+					CleanupStack::Pop(const_cast<TDesC8*>(&info.OpaqueData()));
+					CleanupStack::Pop(dummy);
+					}
+				}
+			if (implArray)
+				{
+				CBufFlat* const buf = CBufFlat::NewL(KBufferExpansionGranularity);
+				CleanupStack::PushL(buf);
+				RBufWriteStream writeStream(*buf);
+				writeStream << *implArray;
+				writeStream.CommitL();
+				writeStream.Release();
+				CleanupStack::Pop(buf);
+				CleanupStack::PopAndDestroy(implArray);
+				return buf;
+				}
+			}
+		}
+	User::Leave(KErrNotFound);
+	return NULL; // to keep compiler happy
+	}
+
+/**
+@internalComponent
+*/
+EXPORT_C CBufFlat* CApaAppList::ServiceImplArrayBufferL(TUid aServiceUid) const
+	{
+	CApaAppData* app = FirstApp(KIgnoreScreenMode);
+	// build an array containing all implementations of the service identified by aServiceUid
+	CArrayFixFlat<TApaAppServiceInfo>* implArray = NULL;
+	while (app)
+		{
+		if (app->iServiceArray)
+			{
+			for (TInt i = app->iServiceArray->Count()-1; i >= 0; i--)
+				{
+				const TApaAppServiceInfo& infoRef = (*app->iServiceArray)[i];
+				if (infoRef.Uid() == aServiceUid)
+					{
+					if (!implArray)
+						{
+						implArray = new(ELeave) CArrayFixFlat<TApaAppServiceInfo>(4);
+						CleanupStack::PushL(TCleanupItem(CleanupServiceArray, implArray));
+						}
+					CArrayFixFlat<TDataTypeWithPriority>* datatypes = DataTypeArrayDeepCopyLC(infoRef.DataTypes());
+					HBufC8* data = infoRef.OpaqueData().AllocLC();
+					TApaAppServiceInfo info(app->AppEntry().iUidType[2], datatypes, data);
+					implArray->AppendL(info);
+					CleanupStack::Pop(data);
+					CleanupStack::Pop(datatypes);
+					}
+				}
+			}
+		app = NextApp(app, KIgnoreScreenMode);
+		}
+
+	if (implArray)
+		{
+		CBufFlat* const buf = CBufFlat::NewL(KBufferExpansionGranularity);
+		CleanupStack::PushL(buf);
+		RBufWriteStream writeStream(*buf);
+		writeStream << *(implArray);
+		writeStream.CommitL();
+		writeStream.Release();
+		CleanupStack::Pop(buf);
+		CleanupStack::PopAndDestroy(implArray);
+		return buf;
+		}
+	User::Leave(KErrNotFound);
+	return NULL; // to keep compiler happy
+	}
+
+EXPORT_C CBufFlat* CApaAppList::ServiceImplArrayBufferL(TUid aServiceUid, const TDataType& aDataType) const
+	{
+	CApaAppData* app = FirstApp(KIgnoreScreenMode);
+	// build an array containing all implementations of the service identified by aServiceUid
+	CArrayFixFlat<TApaAppServiceInfo>* implArray = NULL;
+	while (app)
+		{
+		if (app->iServiceArray)
+			{
+			for (TInt i = app->iServiceArray->Count()-1; i >= 0; i--)
+				{
+				const TApaAppServiceInfo& infoRef = (*app->iServiceArray)[i];
+				if (infoRef.Uid() == aServiceUid)
+					{
+				 	if (KDataTypePriorityNotSupported != app->DataType(aDataType, infoRef.DataTypes()))
+						{
+						if (!implArray)
+							{
+							implArray = new(ELeave) CArrayFixFlat<TApaAppServiceInfo>(4);
+							CleanupStack::PushL(TCleanupItem(CleanupServiceArray, implArray));
+							}
+						CArrayFixFlat<TDataTypeWithPriority>* datatypes = DataTypeArrayDeepCopyLC(infoRef.DataTypes());
+						HBufC8* data = infoRef.OpaqueData().AllocLC();
+						TApaAppServiceInfo info(app->AppEntry().iUidType[2], datatypes, data);
+						implArray->AppendL(info);
+						CleanupStack::Pop(data);
+						CleanupStack::Pop(datatypes);
+						}
+					}
+				}
+			}
+		app = NextApp(app, KIgnoreScreenMode);
+		}
+
+	if (implArray)
+		{
+		CBufFlat* const buf = CBufFlat::NewL(KBufferExpansionGranularity);
+		CleanupStack::PushL(buf);
+		RBufWriteStream writeStream(*buf);
+		writeStream << *(implArray);
+		writeStream.CommitL();
+		writeStream.Release();
+		CleanupStack::Pop(buf);
+		CleanupStack::PopAndDestroy(implArray);
+		return buf;
+		}
+	User::Leave(KErrNotFound);
+	return NULL; // to keep compiler happy
+	}
+	
+CArrayFixFlat<TDataTypeWithPriority>* CApaAppList::DataTypeArrayDeepCopyLC(const CArrayFixFlat<TDataTypeWithPriority>& aOriginal) const
+	{
+	CArrayFixFlat<TDataTypeWithPriority>* result = new(ELeave) CArrayFixFlat<TDataTypeWithPriority>(1);
+	CleanupStack::PushL(result);
+	TInt ii = 0;
+	TInt end = aOriginal.Count();
+	while (ii < end)
+		{
+		result->AppendL(aOriginal[ii]);
+		ii++;
+		}
+	return result;
+	}
+	
+EXPORT_C TInt CApaAppList::CompareStrings(const HBufC& aFirst, const HBufC& aSecond)
+	{
+	return aFirst.CompareF(aSecond);
+	}
+
+EXPORT_C CApaAppList* CApaAppList::Self()
+	{ // static
+	return static_cast<CApaAppList*>(Dll::Tls());
+	}
+	
+/*EXPORT_C*/ RFs& CApaAppList::ShareProtectedFileServer()
+	{
+	return iFsShareProtected; //lint !e1536 Exposing low access member - need to consider a redesign or design clarification here(iFsShareProtected should be owned be the one that needs it) but postpone for now as that may require large changes
+	}
+	
+CApaAppIconArray* CApaAppList::LoadDefaultIconsL() const
+	{
+	__ASSERT_ALWAYS(iDefaultAppIcon, Panic(EPanicNullPointer));
+	CApaIconLoader* iconLoader = CApaIconLoader::NewLC(iFs);
+	CApaAppIconArray* icons = CApaAppIconArray::NewRealDefaultIconsLC(KNumberOfIconsInDefaultMbm,*iDefaultAppIcon, *iconLoader);
+	const TBool badMbmEntryInfo = !icons->LoadIconsL();
+	if(badMbmEntryInfo)
+		{
+		CleanupStack::PopAndDestroy(2,iconLoader);
+		return CApaAppIconArray::NewL();
+		}
+	else
+		{
+		CleanupStack::Pop(icons);
+		CleanupStack::PopAndDestroy(iconLoader);
+		}
+	return icons;
+	}
+
+void CApaAppList::AcquireDefaultIconArrayL() const
+	{
+	ASSERT(iDefaultIconUsageCount >= 0);
+	if (iDefaultIconUsageCount == 0)
+		{
+		iDefaultIconArray = LoadDefaultIconsL();
+		}
+	++iDefaultIconUsageCount;
+	}
+
+// Should NEVER be called by an object that does not call AcquireDefaultIconArrayL and
+// ReleaseDefaultIconArray at the beginning and end of its lifetime respectively
+const CApaAppIconArray& CApaAppList::DefaultIconArray() const
+	{
+	__ASSERT_ALWAYS(iDefaultIconArray, Panic(EPanicNullPointer));
+	return *iDefaultIconArray;
+	}
+
+void CApaAppList::ReleaseDefaultIconArray() const
+	{
+	ASSERT(iDefaultIconUsageCount > 0);
+	if(0 == --iDefaultIconUsageCount)
+		{
+		delete iDefaultIconArray;
+		iDefaultIconArray = NULL;		
+		}
+	}
+	
+// DEF077478 - Required to update the default icons that the app list holds.
+void CApaAppList::UpdateDefaultIconsL()
+	{
+	CApaAppIconArray* iconArray = LoadDefaultIconsL();
+	if (iconArray)
+		{
+		delete iDefaultIconArray;
+		iDefaultIconArray = iconArray;
+		}
+	}
+
+
+// ApaUtils
+
+EXPORT_C TBool ApaUtils::HandleAsRegistrationFile(const TUidType& aUidType)
+	{ // static
+	return (aUidType[1].iUid==KUidAppRegistrationFile.iUid ||
+		   aUidType[0].iUid==KUidPrefixedNonNativeRegistrationResourceFile);
+	}
+	
+// Returns ETrue if a language change event is received and a re-scan is in progress otherwise EFalse. 
+EXPORT_C TBool CApaAppList::IsLanguageChangePending() const
+	{
+	return (iFlags & ELangChangePending);
+	}
+//
+// Class CApaLangChangeMonitor
+//
+
+CApaAppList::CApaLangChangeMonitor::~CApaLangChangeMonitor()
+	{	
+	Cancel();
+	iLangNotifier.Close();
+	}
+
+CApaAppList::CApaLangChangeMonitor* CApaAppList::CApaLangChangeMonitor::NewL(CApaAppList& aAppList)
+	{ // static	
+	CApaLangChangeMonitor* self=new(ELeave) CApaLangChangeMonitor(aAppList);
+	self->ConstructL();
+	return self;
+	}
+
+CApaAppList::CApaLangChangeMonitor::CApaLangChangeMonitor(CApaAppList& aAppList)
+	: CActive(EPriorityNormal),
+	iAppList(aAppList)
+	{	
+	iPrevLanguage = User::Language();
+	CActiveScheduler::Add(this);
+	}
+
+void CApaAppList::CApaLangChangeMonitor::ConstructL()
+	{
+	User::LeaveIfError(iLangNotifier.Create());
+	Start();
+	}
+ 
+void CApaAppList::CApaLangChangeMonitor::Start()
+	{
+	iLangNotifier.Logon(iStatus);
+	SetActive();
+ 	}
+ 
+void CApaAppList::CApaLangChangeMonitor::DoCancel()
+	{
+ 	iLangNotifier.LogonCancel();
+	}
+ 
+void CApaAppList::CApaLangChangeMonitor::RunL()
+	{
+	// Logon to get further events before handling current request.
+	TRequestStatus status = iStatus;
+	Start();
+	
+	// if it is a language change event, start a rescan on app-list.
+ 	if (status.Int() == EChangesLocale && iPrevLanguage != User::Language())
+		{		
+		iPrevLanguage = User::Language();
+		iAppList.iFlags |= CApaAppList::ELangChangePending;
+		iAppList.StartIdleUpdateL(iAppList.iObserver);
+		}
+	}
+
+TInt CApaAppList::CApaLangChangeMonitor::RunError(TInt /*aError*/)
+	{
+	// Reset ELangChangePending flag if RunL leaves.
+	iAppList.iFlags &= ~CApaAppList::ELangChangePending;
+	// Reset iPrevLanguage to ELangNone if RunL leaves.
+	iPrevLanguage = ELangNone;
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apgrfx/APGAPLSTV2.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3082 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "APGAPLST.H"
+#include "APGSTD.H" 
+#include "APFDEF.H"
+#include "../apparc/TRACE.H"
+#include "apgnotif.h"
+#include "../apfile/aprfndr.h"
+#include <e32math.h>
+#include <bautils.h>
+#include <s32mem.h>
+#include "APGPRIV.H"
+#include "APGAIR.H"
+#include "APGICNFL.H"
+#include "apprivate.h"
+#include <e32uid.h>
+#ifdef SYMBIAN_BAFL_SYSUTIL
+#include <bafl/sysutil.h>
+#endif
+
+
+// Delays in the pseudo idle object that builds the application list
+//
+
+const TInt KIdleStartDelay=0;
+const TInt KMaxOpaqueDataLength = 0x1000; // maximum length of opaque data that can be passed between client and apparc server via a TApaAppServiceInfo object - this can be increased in future if needed
+const TInt KBufferExpansionGranularity = 0x100;
+const TInt KNumberOfIconsInDefaultMbm = 3;
+const TInt KAppListToFileStartDelay = 60000000;
+#ifdef SYMBIAN_BAFL_SYSUTIL
+const TInt KInfoBufLength=KSysUtilVersionTextLength;
+//This file is used for storing the rom version. If actual rom version differs from the one stored here the applist is not restored.
+//This file is versioned to avoid a data compatability break on adding further information to this file.
+//On adding further info to this file, KROMVersionCacheFileMajorVersion or KROMVersionCacheFileMinorVersion or KROMVersionCacheFileBuildVersion needs to be incremented appropriately.
+_LIT(KROMVersionStringCacheFileName, "ROMVersionCache.bin");
+const TInt8 KROMVersionCacheFileMajorVersion=1;
+const TInt8 KROMVersionCacheFileMinorVersion=0;
+const TInt16 KROMVersionCacheFileBuildVersion=0;
+#endif
+
+//
+// Class CApaLangChangeMonitor
+//
+
+NONSHARABLE_CLASS(CApaAppList::CApaLangChangeMonitor) : public CActive
+		{
+	/**
+	Utility class used to monitor locale/language change event.
+	@internalComponent
+	*/
+	public:
+		static CApaLangChangeMonitor* NewL(CApaAppList& aAppList);
+		~CApaLangChangeMonitor();
+		void Start();
+		
+	private:
+		CApaLangChangeMonitor(CApaAppList& aAppList);
+		void ConstructL();
+		
+	private:	//from CActive
+		void RunL();
+		void DoCancel();
+		TInt RunError(TInt aError);
+		
+	private:
+		RChangeNotifier iLangNotifier;
+		CApaAppList& iAppList;
+		TLanguage iPrevLanguage;
+		};
+
+		
+//
+// Local functions
+//
+
+void CleanupServiceArray(TAny* aServiceArray)
+	{
+	__ASSERT_DEBUG(aServiceArray, Panic(EPanicNullPointer));
+	CArrayFixFlat<TApaAppServiceInfo>* serviceArray = static_cast<CArrayFixFlat<TApaAppServiceInfo>*>(aServiceArray);
+	TInt serviceCount = serviceArray->Count();
+	if (serviceCount > 0)
+		{
+		for (TInt i = serviceCount - 1; i >= 0; i--)
+			{
+			(*serviceArray)[i].Release();
+			}
+		}
+	delete serviceArray;
+	serviceArray = 0;
+	}
+
+
+//
+// Class CApaAppViewData
+//
+
+CApaAppViewData::~CApaAppViewData()
+	{
+	delete iIcons;
+	delete iCaption;
+	delete iIconFileName;
+	}
+
+CApaAppViewData::CApaAppViewData()
+	: iNonMbmIconFile(EFalse)
+	{
+	}
+
+void CApaAppViewData::ConstructL()
+	{
+	iIcons=CApaAppIconArray::NewL();
+	}
+
+CApaAppViewData* CApaAppViewData::NewLC()
+	{
+	CApaAppViewData* self=new(ELeave) CApaAppViewData();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;	
+	}
+
+void CApaAppViewData::SetUid(TUid aUid)
+	{
+	iUid=aUid;
+	}
+
+void CApaAppViewData::SetScreenMode(TInt aScreenMode)
+	{
+	iScreenMode=aScreenMode;
+	}
+
+EXPORT_C TInt CApaAppViewData::ScreenMode() const
+	{
+	return iScreenMode;
+	}
+
+void CApaAppViewData::SetCaptionL(const TDesC& aCaption)
+	{
+	HBufC* newCaption=aCaption.AllocL();
+	delete(iCaption); // after the AllocL succeeds
+	iCaption=newCaption;
+	}
+
+void CApaAppViewData::SetIconArray(CApaAppIconArray* aIcons)
+	{
+	delete iIcons;
+	iIcons = aIcons;
+	}
+
+void CApaAppViewData::SetIconFileNameL(const TDesC& aFileName)
+	{
+	HBufC* fileName = aFileName.AllocL();
+	delete iIconFileName; // after the AllocL succeeds
+	iIconFileName = fileName;
+	}
+
+void CApaAppViewData::SetNumOfViewIcons(TInt aNumOfViewIcons)
+	{
+	iNumOfViewIcons = aNumOfViewIcons;
+	}
+
+void CApaAppViewData::SetNonMbmIconFile(TBool aNonMbmIconFile)
+	{
+	iNonMbmIconFile = aNonMbmIconFile;
+	}
+
+EXPORT_C TUid CApaAppViewData::Uid() const
+	{
+	return iUid;
+	}
+
+EXPORT_C CApaMaskedBitmap* CApaAppViewData::Icon(const TSize& aSize) const
+	{
+	return iIcons->IconBySize(aSize);
+	}
+
+EXPORT_C CArrayFixFlat<TSize>* CApaAppViewData::IconSizesL() const
+	{
+	return iIcons->IconSizesL();
+	}
+
+EXPORT_C TPtrC CApaAppViewData::IconFileName() const
+	{
+	if (iIconFileName)
+		{
+		return *iIconFileName;
+		}
+	else
+		{
+		return TPtrC(KNullDesC);
+		}
+	}
+
+EXPORT_C TBool CApaAppViewData::NonMbmIconFile() const
+	{
+	return iNonMbmIconFile;
+	}
+
+
+//
+// class CApaAppEntry
+//
+
+CApaAppEntry* CApaAppEntry::NewL(const TApaAppEntry& aAppEntry)
+	{ // static
+	CApaAppEntry* self=new(ELeave) CApaAppEntry(aAppEntry.iUidType);
+	CleanupStack::PushL(self);
+	self->ConstructL(aAppEntry.iFullName);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+CApaAppEntry::~CApaAppEntry()
+	{
+	delete iFullName;
+	}
+
+void CApaAppEntry::Get(TApaAppEntry& aAppEntry) const
+	{
+	aAppEntry.iFullName=*iFullName;
+	aAppEntry.iUidType=iUidType;
+	}
+
+CApaAppEntry::CApaAppEntry(const TUidType& aUidType)
+	: iUidType(aUidType)
+	{
+	}
+
+void CApaAppEntry::ConstructL(const TDesC& aFileName)
+	{
+	iFullName=aFileName.AllocL();
+	}
+
+
+//
+// class TApaAppServiceInfo
+//
+
+TApaAppServiceInfo::TApaAppServiceInfo()
+	: iUid(KNullUid),
+	  iDataTypes(0),
+	  iOpaqueData(NULL)
+	{
+	}
+
+TApaAppServiceInfo::TApaAppServiceInfo(TUid aUid, 
+	CArrayFixFlat<TDataTypeWithPriority>* aDataTypes, HBufC8* aOpaqueData)
+	: iUid(aUid),
+	  iDataTypes(aDataTypes),
+	  iOpaqueData(aOpaqueData)
+	{
+	__ASSERT_DEBUG(iDataTypes, Panic(EPanicNullPointer));
+	__ASSERT_DEBUG(iOpaqueData, Panic(EPanicNullPointer));
+	}
+
+void TApaAppServiceInfo::ExternalizeL(RWriteStream& aStream) const
+	{
+	__ASSERT_DEBUG(iDataTypes, Panic(EPanicNullPointer));
+	__ASSERT_DEBUG(iOpaqueData, Panic(EPanicNullPointer));
+	aStream << iUid;
+	aStream << *iDataTypes; //lint !e613 Possible use of null pointer - Asserted above
+	aStream << *iOpaqueData;//lint !e613 Possible use of null pointer - Asserted above
+	}
+
+void TApaAppServiceInfo::InternalizeL(RReadStream& aStream)
+	{
+	aStream >> iUid;
+	iDataTypes = new(ELeave) CArrayFixFlat<TDataTypeWithPriority>(1);
+	aStream >> *iDataTypes;
+	iOpaqueData = HBufC8::NewL(aStream, KMaxOpaqueDataLength);
+	}
+
+void TApaAppServiceInfo::Release()
+	{
+	if (iDataTypes)
+		{
+		iDataTypes->Reset();
+		delete iDataTypes;		
+		}
+	if (iOpaqueData)
+		{
+		delete iOpaqueData;
+		iOpaqueData = NULL;
+		}
+	}
+
+CArrayFixFlat<TDataTypeWithPriority>& TApaAppServiceInfo::DataTypes()
+	{
+	__ASSERT_DEBUG(iDataTypes, Panic(EPanicNullPointer));
+	return *iDataTypes; //lint !e613 Possible use of null pointer - Asserted above
+	}
+
+/** Returns the service UID.
+
+Note that some APIs may store a UID other than a service UID
+in a TApaAppServiceInfo object. Such APIs clearly state what
+the UID represents.
+
+@return the service UID.
+*/
+EXPORT_C TUid TApaAppServiceInfo::Uid() const
+	{
+	return iUid;
+	}
+	
+EXPORT_C const CArrayFixFlat<TDataTypeWithPriority>& TApaAppServiceInfo::DataTypes() const
+	{
+	__ASSERT_DEBUG(iDataTypes, Panic(EPanicNullPointer));	
+	return *iDataTypes; //lint !e613 Possible use of null pointer - Asserted above
+	}
+
+/** Returns the service implementation's opaque data.
+
+For each service UID registered by an application, the associated
+opaque data indicates how the service is implemented by that application.
+
+The meaning of the opaque data is not known to the framework, it will vary
+according to the service.
+
+For some services the opaque data may be a name intended for user display,
+for others it may be structured data that the service's client-side code can interpret.
+
+@return the service implementation's opaque data.
+*/
+EXPORT_C const TDesC8& TApaAppServiceInfo::OpaqueData() const
+	{
+	if (iOpaqueData)
+		{
+		return *iOpaqueData;
+		}
+	return KNullDesC8;
+	}
+
+//
+// class CApaAppServiceInfoArray
+//
+
+CApaAppServiceInfoArray::CApaAppServiceInfoArray()
+	{
+	}
+
+//
+// class CApaAppServiceInfoArrayWrapper
+//
+
+CApaAppServiceInfoArrayWrapper* CApaAppServiceInfoArrayWrapper::NewL(CArrayFix<TApaAppServiceInfo>* aServiceInfoArray)
+	{
+	CApaAppServiceInfoArrayWrapper* self = new CApaAppServiceInfoArrayWrapper(aServiceInfoArray);
+	if (!self)
+		{
+		CleanupServiceArray(aServiceInfoArray);
+		User::LeaveNoMemory();
+		}
+	return self;
+	}
+
+CApaAppServiceInfoArrayWrapper::CApaAppServiceInfoArrayWrapper(CArrayFix<TApaAppServiceInfo>* aServiceInfoArray)
+	: iServiceInfoArray(aServiceInfoArray)
+	{
+	}
+
+CApaAppServiceInfoArrayWrapper::~CApaAppServiceInfoArrayWrapper()
+	{
+	CleanupServiceArray(iServiceInfoArray);
+	iServiceInfoArray = NULL;
+	}
+
+TArray<TApaAppServiceInfo> CApaAppServiceInfoArrayWrapper::Array()
+	{
+	return iServiceInfoArray->Array();
+	}
+
+
+//
+// Class CApaAppData
+//
+
+EXPORT_C CApaAppData* CApaAppData::NewL(const TApaAppEntry& aAppEntry, RFs& aFs)
+	{
+	CApaAppData* self=new(ELeave) CApaAppData(aFs);
+	CleanupStack::PushL(self);
+	self->ConstructL(aAppEntry);
+	CleanupStack::Pop(); // self
+	return self;
+	}
+
+CApaAppData::CApaAppData(RFs& aFs)
+	:iCaption(NULL), iShortCaption(NULL), 
+	iIsPresent(CApaAppData::EIsPresent), iFs(aFs),
+	iNonMbmIconFile(EFalse),
+	iApplicationLanguage(ELangNone), iIndexOfFirstOpenService(-1),
+	iNonNativeApplicationType(TUid::Null()),
+	iShortCaptionFromResourceFile(NULL)
+	{
+	}
+
+void CApaAppData::ConstructL(const TApaAppEntry& aAppEntry)
+	{
+	iUidType = aAppEntry.iUidType; // if the 2nd UID is KUidAppRegistrationFile, iUidType will be updated in StoreApplicationInformation to reflect the TUidType for the application binary
+	if (ApaUtils::HandleAsRegistrationFile(aAppEntry.iUidType))
+		{
+		iRegistrationFile = aAppEntry.iFullName.AllocL();
+		}
+	else
+		{
+		iFullName = aAppEntry.iFullName.AllocL();
+		}
+
+	iCapabilityBuf.FillZ(iCapabilityBuf.MaxLength());
+	iIcons = CApaAppIconArray::NewL();
+	iViewDataArray=new(ELeave) CArrayPtrFlat<CApaAppViewData>(1);
+	iOwnedFileArray=new(ELeave) CDesCArraySeg(1);
+	User::LeaveIfError(StoreApplicationInformation());
+	}
+
+// Return a standard error code
+// The value returned only reflect the caption status
+// If there is errors setting up captions the old values are retained
+// All other errors are silently ignored
+// General notes:
+// 1. This method is deliberately very similar to the old CApaAppData::GetAifData
+//    in order to maintain behavioural compatibility for V1 apps
+// 2. Be very careful in this method, because it can be called on a newly constructed object,
+//    or on an existing object, so don't assume member data pointers will be NULL
+TInt CApaAppData::StoreApplicationInformation()
+	{
+	HBufC* caption = NULL;
+	HBufC* shortCaption = NULL;
+
+	iTimeStamp = TTime(0); // cannot init in constructor because this function can be called on an existing CApaAppData object
+
+	CApaAppInfoReader* appInfoReader = NULL;
+	TBool readSuccessful = EFalse;
+	TBool isNonNativeApp = EFalse;
+	if (iRegistrationFile != NULL)
+		{
+		if (TParsePtrC(*iRegistrationFile).Path().CompareF(KLitPathForNonNativeResourceAndIconFiles)==0)
+			{
+			isNonNativeApp = ETrue;
+			}
+
+		TRAPD(err,appInfoReader = CApaAppInfoReaderV2::NewL(iFs, *iRegistrationFile, iUidType[2]));
+		if(err != KErrNone)
+			{
+			appInfoReader = NULL;
+			}
+
+		if (appInfoReader == NULL)
+			{
+			if (iFullName == NULL)
+				{
+				// assume that if iFullName is NULL, this method has been called as part
+				// of constructing a new app data object. The CApaAppInfoReader derived object
+				// could not be created, therefore we have no way to determine the full filename
+				// of the app binary, so give up
+				return KErrNoMemory;
+				}
+			}
+		else
+			{
+			readSuccessful = appInfoReader->Read();
+			HBufC* appBinaryFullName=appInfoReader->AppBinaryFullName();
+			if (appBinaryFullName)
+				{
+				delete iFullName;
+				iFullName = appBinaryFullName;
+				}
+			if (iFullName == NULL)
+				{
+				delete appInfoReader;
+				return KErrNoMemory;
+				}
+			// if this object has just been constructed, iUidType is currently the TUidType
+			// of the registration file, it should be the TUidType of the app binary file
+			TUidType uidType = appInfoReader->AppBinaryUidType();
+			if (uidType[1].iUid != KNullUid.iUid)
+				{
+				iUidType = uidType;
+				}
+			}
+		}
+
+	if (appInfoReader != NULL)
+		{
+		// must get captions regardless of value of readSuccessful,
+		// because the V1 reader might have read captions
+		// this is done to maintain behavioural compatibility with V1
+		caption = appInfoReader->Caption();
+		shortCaption = appInfoReader->ShortCaption();
+
+		CApaAppIconArray* icons = appInfoReader->Icons();
+		if(icons)
+			{
+			delete iIcons;
+			iIcons = icons;
+			iIconLoader = appInfoReader->IconLoader();
+			}
+		else
+			{			
+			TRAPD(err, icons = CApaAppIconArray::NewL());
+			if(err == KErrNone)
+				{
+				delete iIcons;
+				iIcons = icons;
+				}
+			}
+		iTimeStamp = appInfoReader->TimeStamp();
+		delete iLocalisableResourceFileName;
+		iLocalisableResourceFileName = appInfoReader->LocalisableResourceFileName();
+		iLocalisableResourceFileTimeStamp = appInfoReader->LocalisableResourceFileTimeStamp();
+
+		if (isNonNativeApp)
+			{
+			// In the case of a non-native app, the resource file has been prefixed with a
+			// TCheckedUid, the second of whose UIDs is the non-native application type uid.
+			TEntry entry;
+			const TInt error=iFs.Entry(*iRegistrationFile, entry);
+			if (error!=KErrNone)
+				{
+				delete appInfoReader;
+				return error;
+				}
+			__ASSERT_DEBUG(entry.iType[0].iUid==KUidPrefixedNonNativeRegistrationResourceFile, Panic(EPanicUnexpectedUid));
+			iNonNativeApplicationType=entry.iType[1];
+			}
+
+		delete iOpaqueData;
+		iOpaqueData = appInfoReader->OpaqueData();
+
+		if (readSuccessful)
+			{
+			appInfoReader->Capability(iCapabilityBuf);
+
+			iDefaultScreenNumber = appInfoReader->DefaultScreenNumber();
+
+			delete iIconFileName;
+			iIconFileName = appInfoReader->IconFileName();
+			iIconFileTimeStamp = appInfoReader->IconFileTimeStamp();
+			iNonMbmIconFile = appInfoReader->NonMbmIconFile();
+			iNumOfAppIcons = appInfoReader->NumOfAppIcons();
+			iApplicationLanguage = appInfoReader->AppLanguage();
+					
+			// views
+			iViewDataArray->ResetAndDestroy();
+			CArrayPtrFlat<CApaAppViewData>* viewDataArray = appInfoReader->Views();
+			if (viewDataArray)
+				{
+				delete iViewDataArray;
+				iViewDataArray = viewDataArray;
+				
+				if(!iIconLoader && ViewMbmIconsRequireLoading())
+				    {
+				    //if VIEW_DATA contains a MBM icon we need to initialize iIconLoader
+				    iIconLoader = appInfoReader->IconLoader();
+				    }
+				}
+
+			// owned files
+			iOwnedFileArray->Reset();
+			CDesCArray* ownedFileArray = appInfoReader->OwnedFiles();
+			if (ownedFileArray)
+				{
+				delete iOwnedFileArray;
+				iOwnedFileArray = ownedFileArray;
+				}
+			
+			UpdateServiceArray(appInfoReader->ServiceArray(iIndexOfFirstOpenService));
+			}
+		delete appInfoReader;
+		}
+
+	if (!caption)
+		{
+		TParsePtrC parse (*iFullName);
+		caption = parse.Name().Alloc();
+		}
+
+	// Put the captions into place
+	if (caption)
+		{
+		if (!shortCaption)
+			{
+			shortCaption = caption->Alloc();
+			if (!shortCaption)
+				{
+				delete caption;
+				caption = NULL;
+				}
+			}
+		}
+	if (caption)
+		{
+		delete iCaption;
+		iCaption = caption;
+		delete iShortCaption;
+		iShortCaption = shortCaption;
+		}
+
+	return caption ? KErrNone : KErrNoMemory;
+	}
+
+EXPORT_C CApaAppData::~CApaAppData()
+// Just delete components, NOT iNext (next CApaAppData in the list).
+	{
+	delete iSuccessor;
+	delete iCaption;
+	delete iShortCaption;
+	delete iFullName;
+	delete iShortCaptionFromResourceFile;
+	delete iCaptionFromResourceFile;
+	delete iIcons;
+	delete iIconLoader;
+	if(iViewDataArray)
+		{
+		iViewDataArray->ResetAndDestroy();
+		delete iViewDataArray;
+		}
+	delete iOwnedFileArray;
+	delete iIconFileName;
+	delete iIconFileNameFromResourceFile;
+	delete iLocalisableResourceFileName;
+	if (iServiceArray)
+		{
+		CleanupServiceArray(iServiceArray);
+		iServiceArray = NULL;
+		}
+	delete iOpaqueData;
+	delete iRegistrationFile;
+	iNext = NULL;
+	}
+
+void CApaAppData::UpdateServiceArray(CArrayFixFlat<TApaAppServiceInfo>* aNewServiceArray)
+	{
+	// clear out any existing service info
+	if (iServiceArray)
+		{
+		CleanupServiceArray(iServiceArray);
+		iServiceArray = NULL;
+		}
+	// store new service array
+	iServiceArray = aNewServiceArray;
+	}
+	
+TDataTypePriority CApaAppData::DataType(const TDataType& aDataType, const CArrayFixFlat<TDataTypeWithPriority>& aDataTypeArray) const
+	{
+	TInt count=aDataTypeArray.Count();
+	for (TInt ii=0;ii<count;ii++)
+		{
+		const TDataTypeWithPriority& type=aDataTypeArray[ii];
+		if (type.iDataType==aDataType)
+			{
+			return type.iPriority;
+			}
+		else
+			{
+			TPtrC8 src=type.iDataType.Des8();
+			TPtrC8 trg=aDataType.Des8();
+			if (src.Match(trg)==0 || trg.Match(src)==0)
+				{
+				if (type.iPriority == KDataTypePrioritySystem)
+					{
+					// This is more or less a magic number so don't decrement
+					return KDataTypePrioritySystem;
+					}
+				else
+					{
+					return (TInt16)(type.iPriority-1);
+					}
+				}
+			}
+		}
+	return KDataTypePriorityNotSupported;
+	}
+
+/**
+ * Returns the CApaMaskedBitmap of size aSize for the application associated
+ * with this CApaAppData. If the icons for the application are not yet loaded then it would be loaded first.
+ * If there is not a bitmap of exact size aSize then 
+ * the icon closest to but smaller than the one asked for is returned, or NULL if
+ * none is smaller.
+ * 
+ * @since Uikon1.2
+ */
+EXPORT_C CApaMaskedBitmap* CApaAppData::Icon(TSize aSize) const
+	{
+	return iIcons->IconBySize(aSize);
+	}
+
+/**
+ * Returns a pointer to the small, medium or large application icon for aIconIndex equal to 0, 1 or 2 respectively.
+ * Panics if aIconIndex is not one of these three values.
+ *
+ * This method is superseded by an overload which returns the icon by finding the closest match to a specified size.
+ *
+ * @deprecated
+ */
+EXPORT_C CApaMaskedBitmap* CApaAppData::Icon(TInt aIconIndex) const
+	{
+	__ASSERT_DEBUG(aIconIndex>-1 && aIconIndex<3, Panic(EDPanicBadIconSize)); //only support old behaviour
+	TSize sizeExpected;
+	switch(aIconIndex)
+		{
+	case KApaIconIndexSmall:
+		sizeExpected=TSize(24,24);
+		break;
+	case KApaIconIndexMedium:
+		sizeExpected=TSize(32,32);
+		break;
+	case KApaIconIndexLarge:
+		sizeExpected=TSize(48,48);
+		break;
+	default:
+		break;
+		}
+	return Icon(sizeExpected);
+	}
+
+void CApaAppData::LoadIconsL()
+	{
+	iIconLoader->LoadAllIconsL();
+	}
+
+EXPORT_C CArrayFixFlat<TSize>* CApaAppData::IconSizesL()const
+/** Gets the sizes of icons available for the application. 
+* If the icons for the application are not yet loaded then it would be loaded first.
+
+@return A pointer to an array of the icon sizes. The caller takes ownership. */
+	{
+	return iIcons->IconSizesL();
+	}
+
+EXPORT_C TApaAppEntry CApaAppData::AppEntry() const
+/** Constructs an application entry based on this object.
+
+@return The application entry. */
+	{
+	return TApaAppEntry(iUidType,*iFullName);
+	}
+
+
+EXPORT_C void CApaAppData::Capability(TDes8& aCapabilityBuf)const
+/** Gets the application's capabilities.
+
+@param aCapabilityBuf On return, contains the application's capabilities, 
+specified as a TApaAppCapabilityBuf object. */
+	{
+	TApaAppCapability::CopyCapability(aCapabilityBuf,iCapabilityBuf);
+	}
+
+/**
+ * Returns a pointer to the array of view data objects current for this application. Does not imply transfer of ownership.
+ *
+ * @since App-Framework_6.1
+ */
+EXPORT_C CArrayPtrFlat<CApaAppViewData>* CApaAppData::Views() const
+	{
+	return iViewDataArray;
+	}
+
+/**
+ * Returns a pointer to the array of files for which this application claims ownership. Does not imply transfer of ownership.
+ *
+ * @since App-Framework_6.1
+ */
+EXPORT_C CDesCArray* CApaAppData::OwnedFiles() const
+	{
+	return iOwnedFileArray;
+	}
+
+TBool CApaAppData::Update()
+// returns true if changes were made to the cached data
+	{
+	__APA_PROFILE_START(17);
+	TBool changed=EFalse;
+
+	// Get app info file entry
+	TEntry entry;
+	TInt ret;
+	if (iRegistrationFile != NULL)
+		{
+		ret = iFs.Entry(*iRegistrationFile, entry);
+		if (ret==KErrNone && entry.iModified!=iTimeStamp)
+			{
+			// assume registration file may have changed
+			changed = ETrue;
+			}
+		else
+			{
+			if (iLocalisableResourceFileName)
+				{
+				// see if localisable resource information might have changed
+				TParse parse;
+				ret = parse.SetNoWild(KAppResourceFileExtension, iLocalisableResourceFileName, NULL);
+				if (ret == KErrNone)
+					{
+					TFileName resourceFileName(parse.FullName());
+					BaflUtils::NearestLanguageFile(iFs, resourceFileName);
+					if (resourceFileName.CompareF(*iLocalisableResourceFileName)!=0)
+						{
+						changed = ETrue;
+						}
+					else
+						{
+						ret = iFs.Entry(*iLocalisableResourceFileName, entry);
+						if ((ret==KErrNotFound && iLocalisableResourceFileTimeStamp!=TTime(0)) ||
+							(ret==KErrNone && entry.iModified!=iLocalisableResourceFileTimeStamp))
+							{
+							changed = ETrue;
+							}
+						}
+					}
+				}
+			}
+		}
+	if (changed)
+		{
+		// re-read data
+		// Ignore result, nothing we can do in case failure
+		// and the old values should be preserved
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+		const TInt ignore = StoreApplicationInformation();
+#else
+        const TInt ignore = StoreApplicationInformation(aDefaultAppIconFileName);
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+		} //lint !e529 Symbol 'ignore' not subsequently referenced
+		
+	else 
+		{
+		if (iIconFileName)
+			{
+			ret = iFs.Entry(*iIconFileName, entry);
+			// See if the icon file has been "modified"
+			// It could have been replaced with a differnt version, deleted or added 
+			// if the icon file specified in the resource was missing
+			if ((ret==KErrNotFound && iIconFileTimeStamp!=TTime(0)) ||
+					(ret==KErrNone && entry.iModified!=iIconFileTimeStamp))
+					{
+					// Assume the icon file has changed
+					iIconFileTimeStamp = entry.iModified;
+					changed = ETrue;
+					}
+			}
+		}
+
+	__APA_PROFILE_END(17);
+	return changed;
+	}
+
+EXPORT_C TDataTypePriority CApaAppData::DataType(const TDataType& aDataType) const
+// returns the priority of the data type
+/** If the application supports the specified data type, the function returns 
+the priority with which it should be selected for handling it.
+
+If the application does not support the specified data type, 
+KDataTypePriorityNotSupported is returned.
+
+Note that the function supports wildcard matching, using "*" and "?". In the case 
+of a wildcard match, the priority value returned is reduced by 1, so that in this 
+case, the application could never have the maximum priority 
+(KDataTypePriorityUserSpecified).
+
+@param aDataType The data type of interest.
+@return The priority with which the application should be selected for handling 
+the specified data type, or KDataTypePriorityNotSupported if the data type is 
+not supported. */
+	{
+	if (iIndexOfFirstOpenService >= 0)
+		{
+		const CArrayFixFlat<TDataTypeWithPriority>& dataTypeArray = 
+			(*iServiceArray)[iIndexOfFirstOpenService].DataTypes();
+		return DataType(aDataType, dataTypeArray);
+		}
+	return KDataTypePriorityNotSupported;
+	}
+
+
+EXPORT_C TBool CApaAppData::IsPending() const
+/* Returns true if the app info is not yet updated by the current scan. */
+	{
+	return (iIsPresent==CApaAppData::EPresentPendingUpdate 
+		|| iIsPresent==CApaAppData::ENotPresentPendingUpdate);
+	}
+
+EXPORT_C TBool CApaAppData::CanUseScreenMode(TInt aScreenMode)
+/** Tests whether the specified screen mode is valid for any of 
+this application's views. If the app has no views, the function 
+assumes that only the default screen mode (at screen mode index 
+zero) is allowed. This function is used by CApaAppList to create 
+a list of valid applications.
+
+@param aScreenMode The index of the screen mode.
+@return True if screen mode is valid, otherwise false. */
+	{
+	const TInt count=iViewDataArray->Count();
+	// If there are no views, assume only the default screen mode is allowed
+	TBool ret=(count==0 && aScreenMode==0);
+	for(TInt ii=0;ii<count;ii++)
+		{
+		const CApaAppViewData* data=(*iViewDataArray)[ii];
+		if(data->ScreenMode()==aScreenMode)
+			{
+			ret=ETrue;
+			break;
+			}
+		}
+	return ret;
+	}
+
+EXPORT_C void CApaAppData::GetIconInfo(TInt& aIconCount, TInt& aDefaultIconsUsed) const
+/** Gets icon information for the app. If the icons for the application are not yet loaded then it would be loaded first.
+
+@param aIconCount On return, this contains the number of app icons
+@param aDefaultIconsUsed On return, this indicates whether the default icons have been used
+*/
+	{
+	aIconCount = iIcons->Count();
+	aDefaultIconsUsed = iIcons->DefaultIconsUsed();
+	}
+
+/** Gets the default screen number used by the application.
+
+A device may have more than once screen. This function
+returns the number associated with the screen which will
+be the default screen used by the application.
+
+@return The default screen number
+*/
+EXPORT_C TUint CApaAppData::DefaultScreenNumber() const
+	{
+	return iDefaultScreenNumber;
+	}
+
+/** Returns true if app info was provided by a registration file
+
+@return true if app info was provided by a registration file
+*/
+EXPORT_C TBool CApaAppData::RegistrationFileUsed() const
+	{
+	return iRegistrationFile != NULL;
+	}
+
+/** Returns the full filename of the registration resource file
+
+@return The full path and filename of the registration resource file.
+@internalTechnology
+*/
+EXPORT_C TPtrC CApaAppData::RegistrationFileName() const
+	{
+	if (iRegistrationFile)
+		{
+		return *iRegistrationFile;
+		}
+	else
+		{
+		return TPtrC(KNullDesC);
+		}
+	}
+
+
+/** Returns the full filename of the localisable resource file
+
+@return The full path and filename of the localisable resource file.
+@internalTechnology
+*/
+EXPORT_C TPtrC CApaAppData::LocalisableResourceFileName() const
+	{
+	if (iLocalisableResourceFileName)
+		{
+		return *iLocalisableResourceFileName;
+		}
+	else
+		{
+		return TPtrC(KNullDesC);
+		}
+	}
+
+
+/** Returns the non-native application opaque data
+
+@return The non-native application opaque data.
+@internalComponent
+*/
+EXPORT_C TPtrC8 CApaAppData::OpaqueData() const
+	{
+	if (iOpaqueData)
+		{
+		return *iOpaqueData;
+		}
+	else
+		{
+		return TPtrC8(KNullDesC8);
+		}
+	}
+
+EXPORT_C TUid CApaAppData::NonNativeApplicationType() const
+/** @internalComponent */
+	{
+	return iNonNativeApplicationType;
+	}
+
+/** Returns the full filename of the file containing application icons
+
+@return The full path and filename of the icon file.
+*/
+EXPORT_C TPtrC CApaAppData::IconFileName() const
+	{
+	if (iIconFileName)
+		{
+		return *iIconFileName;
+		}
+	else
+		{
+		return TPtrC(KNullDesC);
+		}
+	}
+
+/** Returns true if the application provides a non-MBM icon filename.
+
+If this function returns false, this does not necessarily mean
+an MBM icon filename is provided.
+
+@return true if the application provides a non-MBM icon filename.
+*/
+EXPORT_C TBool CApaAppData::NonMbmIconFile() const
+	{
+	return iNonMbmIconFile;
+	}
+
+
+/** Determines the current language the application is using to display its
+user interface.
+@return The current language.
+*/	
+EXPORT_C TLanguage CApaAppData::ApplicationLanguage() const
+	{
+	return iApplicationLanguage;
+	}
+
+/** Returns true if the application implements the specified service.
+@param aServiceUid The service UID.
+@return true if the application implements the specified service.
+@internalComponent
+*/
+EXPORT_C TBool CApaAppData::ImplementsService(TUid aServiceUid) const
+	{
+	if (iServiceArray)
+		{
+		TInt count = iServiceArray->Count();
+		for (TInt i = count-1; i >= 0; i--)
+			{
+			if ((*iServiceArray)[i].Uid() == aServiceUid)
+				{
+				return ETrue;
+				}
+			}
+		}
+	return EFalse;
+	}
+	
+/** Checks if the application implements the specified service and if the 
+service explicitly supports the datatype. Explicitly means that the datatype is
+listed in the service's list of datatype in the registration file and is
+not the general datatype associated with the application (aka the Open service).
+@param aServiceUid The service UID.
+@param aDataType The datattype
+@return The priority. KDataTypePriorityNotSupported if the app doesn't support
+this service with this datatype.
+@internalComponent
+*/
+TInt CApaAppData::ImplementsServiceWithDataType(TUid aServiceUid, const TDataType& aDataType) const
+	{
+	TInt result = KDataTypePriorityNotSupported;
+	if (iServiceArray)
+		{
+		TInt count = iServiceArray->Count();
+		for (TInt i = count-1; i >= 0; i--)
+			{
+			// There can be more than one instance of a given service so we iterate
+			// through the whole service list even if we have already found a suitable
+			// service.
+			if ((*iServiceArray)[i].Uid() == aServiceUid)
+				{
+				const CArrayFixFlat<TDataTypeWithPriority>& datatypes =
+					(*iServiceArray)[i].DataTypes();
+				TInt priority = DataType(aDataType, datatypes);
+				if (priority > result)
+					{
+					result = priority;
+					}
+				}
+			}
+		}
+	return result;
+	}
+
+EXPORT_C void CApaAppData::SetShortCaptionL(const TDesC& aShortCaption)
+	{
+	if(iShortCaption->Compare(aShortCaption) != 0)
+		{
+		HBufC* newShortCaption=aShortCaption.AllocL();
+		if (!iShortCaptionFromResourceFile)
+			{ // store the rsc file caption into iShortCaptionFromResourceFile so that it can be externalized.
+			iShortCaptionFromResourceFile = iShortCaption;
+			}
+		else
+			{
+			delete iShortCaption;
+			}
+		iShortCaption = newShortCaption;
+		}
+	}
+
+/** Sets the caption of the application. If the caption is from central repository,
+ it overrides tha value from the resource file.  
+*/
+EXPORT_C void CApaAppData::SetCaptionL(const TDesC& aCaption)
+	{
+	if(iCaption->Compare(aCaption) != 0)
+		{
+		HBufC* newCaption=aCaption.AllocL();
+		if (!iCaptionFromResourceFile)
+			{ // store the rsc file caption into iCaptionFromResourceFile so that it can be externalized.
+			iCaptionFromResourceFile = iCaption;
+			}
+		else
+			{
+			delete iCaption;
+			}
+		iCaption = newCaption;
+		}
+	}
+
+/** Sets the icon details of an application. If these details are from the central repository,
+ it overrides the value in the resource file and loads it.
+*/
+EXPORT_C void CApaAppData::SetIconsL(const TDesC& aFileName, TInt aNumIcons)
+	{
+	if (iIconFileName && 
+		iIconFileName->Compare(aFileName) == 0 &&
+		iNumOfAppIcons == aNumIcons)
+		return;
+
+	if (!iIconFileNameFromResourceFile)
+		{
+	 	iNumOfAppIconsFromResourceFile = iNumOfAppIcons;
+	 	iIconFileNameFromResourceFile = iIconFileName;
+	 	iIconFileName = NULL;
+	 	iNonMbmIconFileFromResourceFile = iNonMbmIconFile;
+	 	iIconFileTimeStampFromResourceFile = iIconFileTimeStamp;
+		}
+		
+	iNonMbmIconFile = !CApaAppInfoReaderV2::FileIsMbm(aFileName);
+	iNumOfAppIcons = aNumIcons;
+	
+	if (aFileName != KNullDesC)
+		{
+		iIconFileName = aFileName.AllocL();
+		if (!iNonMbmIconFile)
+			{
+			if (iNumOfAppIcons > 0)
+				{
+				// Creates an Application Icon Array
+				CApaAppIconArray* icons = CApaAppIconArray::NewAppIconsL(iNumOfAppIcons, *iIconFileName, *iIconLoader);
+				delete iIcons;
+				iIcons = icons;
+				}
+			}
+		else
+			{	// Creates an Empty Icon Array if application has Non-Mbm Icons
+			CApaAppIconArray* icons = CApaAppIconArray::NewL();
+			delete iIcons;
+			iIcons = icons;
+			}
+		}
+	else
+		{
+		CApaAppIconArray* icons = CApaAppIconArray::NewDefaultIconsL();
+		delete iIcons;
+		iIcons = icons;
+		}
+	}
+
+void CApaAppData::SetAppPending()
+	{
+	if (iIsPresent == CApaAppData::ENotPresent 
+		|| iIsPresent == CApaAppData::ENotPresentPendingUpdate)
+		{
+		iIsPresent = CApaAppData::ENotPresentPendingUpdate;
+		}
+	else
+		{
+		iIsPresent = CApaAppData::EPresentPendingUpdate;
+		}
+	}
+
+//
+// Class CApaAppList
+//
+
+EXPORT_C CApaAppList* CApaAppList::NewL(RFs& aFs,CApaAppRegFinder* aAppRegFinder, TBool aLoadMbmIconsOnDemand, TInt aIdlePeriodicDelay)
+	{
+	CApaAppList* self=new CApaAppList(aFs, aAppRegFinder, aLoadMbmIconsOnDemand, aIdlePeriodicDelay);
+	if (!self)
+		{
+		delete aAppRegFinder;
+		User::LeaveNoMemory();
+		}
+	else
+		{
+		CleanupStack::PushL(self);
+		self->ConstructL();
+		CleanupStack::Pop(self);
+		}
+	return self;
+	}
+
+CApaAppList::CApaAppList(RFs& aFs, CApaAppRegFinder* aAppRegFinder, TBool aLoadMbmIconsOnDemand, TInt aIdlePeriodicDelay)
+	:iFs(aFs),
+	iFlags(0),
+	iAppRegFinder(aAppRegFinder),
+	iIdlePeriodicDelay(aIdlePeriodicDelay),
+	iLoadMbmIconsOnDemand(aLoadMbmIconsOnDemand),
+    iUninstalledApps(NULL)	
+	{
+	}
+
+void CApaAppList::ConstructL()
+	{
+	User::LeaveIfError(iFsShareProtected.Connect());
+	User::LeaveIfError(iFsShareProtected.ShareProtected());
+	User::LeaveIfError(Dll::SetTls(this));
+	
+	//Start language change monitor.
+	iAppLangMonitor = CApaLangChangeMonitor::NewL(*this);
+	GetAppsListCachePathL();
+	}
+	
+EXPORT_C CApaAppList::~CApaAppList()
+/** Frees all resources prior to destruction, including the application data list. */
+	{
+	iValidFirstAppData = NULL;
+	DeleteAppData();
+
+	iAppData = NULL;
+	iObserver = NULL;
+	iFsShareProtected.Close();
+
+	delete iDefaultIconArray;
+	delete iDefaultAppIconMbmFileName;
+	delete iAppRegFinder;
+	delete iAppIdler;
+	delete iAppListStorer;
+	delete iAppIconLoader;
+	delete iAppLangMonitor;
+	iAppsListCacheFileName.Close();
+	iAppsListCacheBackUpFileName.Close();
+	iAppsListCachePath.Close();
+	}
+
+// Stop scanning applications if and uninstallation has started	
+EXPORT_C void CApaAppList::StopScan(TBool aNNAInstall)
+	{
+	if (aNNAInstall)
+		{
+		iNNAInstallation = ETrue;
+		}
+	if (iAppIdler)
+		{
+		delete iAppIdler;
+		iAppIdler=NULL;
+		}
+	UndoSetPending(iAppData);
+	}
+	
+// Allow scanning when uninstallation is complete
+EXPORT_C void CApaAppList::RestartScanL()
+	{
+	TRAP_IGNORE(PurgeL());
+	StartIdleUpdateL();
+	}
+	
+EXPORT_C TBool CApaAppList::AppListUpdatePending()
+	{
+	return iNNAInstallation;
+	}
+
+void CApaAppList::UndoSetPending(CApaAppData* aAppData)
+	// Reset all apps to pevious pending state so they don't get purged
+	{
+  	for (; aAppData; aAppData = aAppData->iNext)
+		{
+		if (aAppData->iIsPresent == CApaAppData::EPresentPendingUpdate)
+			{
+			aAppData->iIsPresent = CApaAppData::EIsPresent;
+			}
+		}
+	}
+
+EXPORT_C void CApaAppList::StartIdleUpdateL()
+/** Updates the list asynchronously, using an idle time active object, 
+and no observer. When the update is finished, the resulting app 
+list is stored. */
+	{
+	// find the default icons (.mbm file) for applications, wrt current locale
+	CreateDefaultAppIconFileNameL();
+
+	// File operation is abandoned if it is in progress.
+	if (iAppListStorer && iAppListStorer->IsActive())
+		{
+		delete iAppListStorer;
+		iAppListStorer = NULL;
+		}
+
+	// Stops icon loading if it is in progress.
+	if (iAppIconLoader && iAppIconLoader->IsActive())
+		{
+		delete iAppIconLoader;
+		iAppIconLoader = NULL;
+		}
+
+	// DEF076594 - if changing locale, need to update the default icons here
+	// If updating the default icons array fails, the array is left in the state
+	// it was in before the call.
+	if(iDefaultIconArray)
+		{
+		TRAP_IGNORE(UpdateDefaultIconsL());
+		}
+
+	// start to scan.
+	if (iAppIdler)
+		{
+		delete iAppIdler;
+		iAppIdler=NULL;
+		}
+		
+	// DEF072701
+	// When performing the update scan let the idle object have lower priority.
+	if (IsFirstScanComplete())
+		{
+		iAppIdler=CPeriodic::NewL(CActive::EPriorityLow);
+		}
+	else
+		{
+		iAppIdler=CPeriodic::NewL(CActive::EPriorityStandard);
+		}
+	SetPending(iAppData);
+	iAppRegFinder->FindAllAppsL();
+ 
+ 	// DEF072701
+ 	// If this is the first scan i.e the boot scan then it may take some time. Thus
+ 	// the periodic delay value should be used so that this process will stop periodically 
+ 	// to allow time for other processes.
+ 	// If this is just a re-scan it should take much less time. Therefore it should just
+ 	// be completed in one go rather than periodically delayed. Thus the delay value
+ 	// should be set to 0.
+	iAppIdler->Start(KIdleStartDelay, IsFirstScanComplete()? 0 : iIdlePeriodicDelay, TCallBack(IdleUpdateCallbackL, this));
+	}
+
+EXPORT_C void CApaAppList::StartIdleUpdateL(MApaAppListObserver* aObserver)
+/** Updates the list asynchronously, using an idle time active object 
+and an observer. When the update is finished, the resulting app list 
+is stored and the observer is notified with an MApaAppListServObserver::EAppListChanged 
+message, if the list changed.
+@param aObserver Observer to be notified when the update has finished. */
+	{
+	iObserver=aObserver;
+
+	// Rename Appslist.bin file to AppsList_Backup.bin, so that it can be renamed back, if rescan/update scan does not change applist.
+	TInt replaceError = iFs.Replace(iAppsListCacheFileName, iAppsListCacheBackUpFileName);
+	if (replaceError != KErrNone)
+		{
+		iFs.Delete(iAppsListCacheFileName);
+		}
+	StartIdleUpdateL();
+	}
+
+void CApaAppList::CreateDefaultAppIconFileNameL()
+	{
+	TFileName tempFileName(KDefaultAppIconMbm);
+	BaflUtils::NearestLanguageFile(iFs, tempFileName);
+	delete iDefaultAppIconMbmFileName;
+	iDefaultAppIconMbmFileName = NULL;
+	iDefaultAppIconMbmFileName = tempFileName.AllocL();
+	}
+
+EXPORT_C void CApaAppList::InitListL(MApaAppListObserver* aObserver)
+/** It Restores the data present in the AppsList.bin file and updates the applist. 
+ * If Restore operation fails then it 
+ * starts updating the list asynchronously, by calling StartIdleUpdateL().
+
+@param aObserver Observer to be notified when the update has finished. */
+	{
+	DeleteAppsListBackUpAndTempFiles();
+	TInt ret = KErrGeneral;
+//#ifndef __WINS__ // on the emulator, don't read app list from file, as doing so means apps
+                 // built while the emulator isn't running won't appear in the list
+	TRAP(ret, RestoreL());
+//#endif
+	if (ret != KErrNone)
+		{
+		// There was an error during restore, so update the list asynchronously.
+		DeleteAppData();
+		iFs.Delete(iAppsListCacheFileName);
+		StartIdleUpdateL(aObserver);
+		}
+	else
+		{
+		iObserver = aObserver;
+		if (iLoadMbmIconsOnDemand)
+			{
+			InitiateStoringOfAppList();
+			}
+		else
+			{
+			StartIconLoadingL();
+			}
+		}
+	}
+
+void CApaAppList::StartIconLoadingL()
+	{
+	iAppIconLoader = new(ELeave) CApaIdleIconLoader(iAppData, iFs, *this);
+	iAppIconLoader->Start();
+	}
+
+void CApaAppList::ScanRemovableDrivesAndUpdateL()
+/** Rename Appslist.bin file to AppsList_Backup.bin, so that it can be renamed back, 
+     if the update scan on removable media drives does not change applist. */
+	{
+	const RArray<TDriveUnitInfo>& listOfRemovableMediaDrives = iAppRegFinder->DriveList();
+	const TInt count = listOfRemovableMediaDrives.Count();
+
+	// Removable media scan would take place only if removable drives are present.
+	if (count)
+		{
+		CApaAppData* appData = iAppData;
+		while (appData)
+			{
+			for (TInt driveIndex = 0; driveIndex < count; ++driveIndex)
+				{
+				if (TParsePtrC(*appData->iRegistrationFile).Drive() == listOfRemovableMediaDrives[driveIndex].iDriveUnit.Name())
+					{
+					appData->SetAppPending();
+					break;
+					}
+				}
+			appData = appData->iNext;
+			}
+
+		while (IdleUpdateL())
+			{ // It updates the removable media apps present in AppList if it has changed.
+
+			};
+		}
+	}
+
+void CApaAppList::DeleteAppsListBackUpAndTempFiles()
+/** Deletes all files inside AppsListCache folder except AppsList.bin */
+	{
+	_LIT(KTemp, "AppsList.bin");
+	CDir* cache = NULL;
+	TInt ret = iFs.GetDir(iAppsListCachePath, KEntryAttNormal, ESortNone, cache);
+	if (ret == KErrNone)
+		{
+		const TInt count = cache->Count();
+		for (TInt i = 0; i < count; ++i)
+			{
+			TBufC<KMaxFileName> cacheFileName = (*cache)[i].iName;
+	#if defined (SYMBIAN_BAFL_SYSUTIL)
+				if ((cacheFileName.Match(KTemp) == KErrNotFound) && (cacheFileName.Match(KROMVersionStringCacheFileName) == KErrNotFound)) 
+	#else
+				if ((cacheFileName.Match(KTemp) == KErrNotFound)) 
+	#endif
+				{
+				TFileName fileNameToDelete;
+				fileNameToDelete.Append(iAppsListCachePath);
+				fileNameToDelete.Append(cacheFileName);
+				iFs.Delete(fileNameToDelete);
+				}
+			}
+		delete cache;
+		}
+	}
+
+void CApaAppList::RestoreL()
+/** It restores the data present in the AppsList.bin file */
+	{
+	RFileReadStream theReadStream;
+	User::LeaveIfError(theReadStream.Open(iFs, iAppsListCacheFileName, EFileRead));
+	CleanupClosePushL(theReadStream);
+	
+	TLanguage appListFileLanguage = (TLanguage)theReadStream.ReadInt32L();
+	if (appListFileLanguage != User::Language())
+		{
+		User::Leave(KErrNotSupported);
+		}
+		
+#if defined (SYMBIAN_BAFL_SYSUTIL)
+	//Build the filename for the cache file
+	TInt maxSizeofFileName = iAppsListCachePath.Length() + KROMVersionStringCacheFileName().Length();
+	RBuf romVersionCacheFileName;
+	romVersionCacheFileName.CreateL(maxSizeofFileName);
+	romVersionCacheFileName.CleanupClosePushL();
+	romVersionCacheFileName.Append(iAppsListCachePath);
+	romVersionCacheFileName.Append(KROMVersionStringCacheFileName());
+	
+	RFileReadStream romVerStream;
+	User::LeaveIfError(romVerStream.Open(iFs,romVersionCacheFileName,EFileRead));
+	CleanupClosePushL(romVerStream);
+	
+	TVersion actualROMVersionCacheFileVersion(KROMVersionCacheFileMajorVersion, KROMVersionCacheFileMinorVersion, KROMVersionCacheFileBuildVersion);
+	TVersionName actualROMVersionCacheFileVersionName = actualROMVersionCacheFileVersion.Name();
+	
+	//read the rom file version
+	TInt8 romVersionCacheFileMajorVersion = romVerStream.ReadInt8L();
+	TInt8 romVersionCacheFileMinorVersion = romVerStream.ReadInt8L();
+	TInt16 romVersionCacheFileBuildVersion = romVerStream.ReadInt16L();
+	TVersion romVersionCacheFileVersion(romVersionCacheFileMajorVersion, romVersionCacheFileMinorVersion, romVersionCacheFileBuildVersion);
+	TVersionName romVersionCacheFileVersionName = romVersionCacheFileVersion.Name();
+	
+	//If persisted file version differs from what apparc can handle, recreate rom version file and applist.bin
+	if (romVersionCacheFileVersionName.Compare(actualROMVersionCacheFileVersionName) != 0)
+		{
+		User::Leave(KErrGeneral);
+		}
+		
+	//Read the length & value of software version from it.
+	TBuf<KInfoBufLength> softwareVersion;
+	TUint32 length = romVerStream.ReadUint32L();
+	if (length>KInfoBufLength)
+		{
+		//File must be corrupt, an attempt to read will panic
+		User::Leave(KErrCorrupt);
+		}	
+	romVerStream.ReadL(softwareVersion, length);
+
+	//the persisted version has been successfully read
+	//read the actual current version string
+	TBuf<KInfoBufLength> actualSoftwareVersion;
+	TInt err = SysUtil::GetSWVersion(actualSoftwareVersion); //use the SysUtil implementation
+	if(err == KErrNone)
+		{
+		if (softwareVersion.Compare(actualSoftwareVersion) != 0)
+			{
+			//Leave if the current version is different from the previous stored version and recreate applist.
+#ifdef _DEBUG
+			RDebug::Print(_L("!!Firmware update detected!! Rebuilding AppList"));
+#endif
+			User::Leave(KErrGeneral);
+			}
+		}
+	else
+		{
+		//Leave if any error reading the version information, except if file is not present
+		if (err != KErrPathNotFound && err != KErrNotFound)
+			{
+#ifdef _DEBUG
+			RDebug::Print(_L("!!Error %d reading Firmware version.  Rebuilding AppList"),err);
+#endif
+			User::Leave(err);
+			}
+		}
+	CleanupStack::PopAndDestroy(2); //romVerStream, romVersionCacheFileName
+#endif
+	
+	// Create Default Icon File Name
+	CreateDefaultAppIconFileNameL();
+	
+	TInt ret = KErrNone;
+	while (ret == KErrNone)
+		{
+		CApaAppData* const pApp = new (ELeave) CApaAppData(iFs);
+		CleanupStack::PushL(pApp);
+
+		// Restore entries till we leave
+		TRAP(ret, pApp->InternalizeL(theReadStream));
+		
+		if (ret != KErrNone && ret != KErrEof)
+			{
+			User::Leave(ret);
+			}
+		// Check that the app has not been added to the list twice
+		if (ret == KErrNone && !AppDataByUid(pApp->iUidType[2]))
+			{
+			AddToList(pApp);
+			CleanupStack::Pop(pApp);
+			}
+		else
+			{ // Delete pApp if an End of File condition is reached or the app has been added to the list twice
+			CleanupStack::PopAndDestroy(pApp);
+			}
+		}	
+	// Close the stream;
+	CleanupStack::PopAndDestroy(&theReadStream);
+
+	iFs.Rename(iAppsListCacheFileName, iAppsListCacheBackUpFileName);
+	iAppRegFinder->FindAllRemovableMediaAppsL();	// Builds the Removable Media Drive List
+
+	iFlags |= ENotifyUpdateOnFirstScanComplete;
+
+	// It runs an update scan on removable media apps.
+	ScanRemovableDrivesAndUpdateL();
+	}
+
+EXPORT_C TBool CApaAppList::IsLanguageChangePending() const
+/** Returns ETrue if a language change event is received and a re-scan is in progress otherwise EFalse. */
+	{
+	return (iFlags & ELangChangePending);
+	}
+
+void CApaAppData::InternalizeL(RReadStream& aReadStream)
+/** Internalizes the appdata from the AppsList.bin file */
+	{
+	TUint highTime = aReadStream.ReadUint32L();
+	TUint lowTime = aReadStream.ReadUint32L();
+	iTimeStamp = TTime(MAKE_TINT64(highTime, lowTime));
+
+	highTime = aReadStream.ReadUint32L();
+	lowTime = aReadStream.ReadUint32L();
+	iIconFileTimeStamp = TTime(MAKE_TINT64(highTime, lowTime));
+	iCaption = HBufC::NewL(aReadStream, KMaxFileName);	// Caption
+	iShortCaption = HBufC::NewL(aReadStream, KMaxFileName);	// Shortcaption
+	iFullName = HBufC::NewL(aReadStream, KMaxFileName);		// Filename of application binary
+
+	TUid uid1;
+	uid1.iUid = aReadStream.ReadUint32L();
+	TUid uid2;
+	uid2.iUid = aReadStream.ReadUint32L();	
+	TUid uid3;
+	uid3.iUid = aReadStream.ReadUint32L();
+	iUidType = TUidType(uid1, uid2, uid3);	// Application UID
+	
+	aReadStream >> iCapabilityBuf;
+
+	iRegistrationFile = HBufC::NewL(aReadStream, KMaxFileName);	// Registration Filename
+		
+	iDefaultScreenNumber = aReadStream.ReadUint32L();	// Default Screen number
+	
+	iNumOfAppIcons = aReadStream.ReadInt32L();	// No. of icons
+
+	iNonMbmIconFile = aReadStream.ReadUint32L();
+
+	HBufC* iconFileName = HBufC::NewL(aReadStream, KMaxFileName);	// Icon Filename
+	if (*iconFileName != KNullDesC)
+		{
+		iIconFileName = iconFileName;
+		if (!iNonMbmIconFile)
+			{
+			if (iNumOfAppIcons > 0)
+				{ // Create IconLoader to load icons
+				iIconLoader = CApaIconLoader::NewL(iFs);
+				// Creates an Application Icon Array
+				iIcons = CApaAppIconArray::NewAppIconsL(iNumOfAppIcons, *iIconFileName, *iIconLoader);
+				}
+			else
+			    TRAP_IGNORE(iIcons = CApaAppIconArray::NewDefaultIconsL()); // Creates and Loads Default Icons.
+			}
+		else
+			{	// Creates an Empty Icon Array if application has Non-Mbm Icons
+			iIcons = CApaAppIconArray::NewL();
+			}
+		}
+	else
+		{
+		delete iconFileName;
+		TRAP_IGNORE(iIcons = CApaAppIconArray::NewDefaultIconsL()); // Creates and Loads Default Icons.
+		}
+
+	HBufC* localisableResourceFileName = HBufC::NewL(aReadStream, KMaxFileName);	// Registration Filename
+	if (*localisableResourceFileName != KNullDesC)
+		{
+		iLocalisableResourceFileName = localisableResourceFileName;
+		}
+	else
+		{
+		delete localisableResourceFileName;
+		}	
+
+	highTime = aReadStream.ReadUint32L();
+	lowTime = aReadStream.ReadUint32L();
+	iLocalisableResourceFileTimeStamp = TTime(MAKE_TINT64(highTime, lowTime));	// Localisable file timestamp
+
+	iApplicationLanguage = (TLanguage)aReadStream.ReadInt32L();	// Application Language
+
+	iIndexOfFirstOpenService = aReadStream.ReadUint32L();		// Index of first open service
+
+	iNonNativeApplicationType.iUid = aReadStream.ReadUint32L();
+
+	HBufC8* opaqueData = HBufC8::NewL(aReadStream, KMaxFileName);	// Opaque Data
+	if (*opaqueData != KNullDesC8)
+		{
+		iOpaqueData = opaqueData;
+		}
+	else
+		{
+		delete opaqueData;
+		}
+
+	iViewDataArray = new(ELeave) CArrayPtrFlat<CApaAppViewData>(1);	// ViewDataArray
+	const TInt viewCount = aReadStream.ReadInt32L();
+	TInt i;	
+	for (i = 0; i < viewCount; ++i)
+		{
+		CApaAppViewData* pView = CApaAppViewData::NewLC();
+
+		pView->iCaption = HBufC::NewL(aReadStream, KMaxFileName);
+		pView->iNumOfViewIcons = aReadStream.ReadUint32L();
+		pView->iNonMbmIconFile = aReadStream.ReadUint32L();
+		HBufC* iconFileName = HBufC::NewL(aReadStream, KMaxFileName);	// Icon Filename		
+		if (*iconFileName != KNullDesC)
+			{
+			pView->iIconFileName = iconFileName;
+			if (!pView->iNonMbmIconFile)
+				{
+				if (pView->iNumOfViewIcons > 0)
+					{
+					if (!iIconLoader)
+						{	// Create Icon Loader if it was not done for App or any of the previous views for the App.
+						iIconLoader = CApaIconLoader::NewL(iFs);
+						}
+					// Creates an Application View Icon Array
+					CApaAppIconArray* iconViewArray = CApaAppIconArray::NewViewIconsL(pView->iNumOfViewIcons, *pView->iIconFileName, *iIconLoader);
+					pView->SetIconArray(iconViewArray);
+					}
+				}
+			}
+		else
+			{
+			delete iconFileName;
+			}
+		pView->iScreenMode = aReadStream.ReadUint32L();
+		pView->iUid.iUid = aReadStream.ReadUint32L();
+
+		iViewDataArray->AppendL(pView);
+		CleanupStack::Pop(pView);
+		}
+
+	iServiceArray = new(ELeave) CArrayFixFlat<TApaAppServiceInfo>(1);
+	const TInt serviceCount = aReadStream.ReadUint32L();
+
+	for (i = 0; i < serviceCount; ++i)
+		{
+		TApaAppServiceInfo serviceInfo ;
+		aReadStream >> serviceInfo;
+		iServiceArray->AppendL(serviceInfo);
+		}
+
+	iOwnedFileArray = new(ELeave) CDesCArraySeg(1);
+	const TInt fileCount = aReadStream.ReadUint32L();	
+	for (i = 0; i < fileCount; ++i)
+		{
+		TFileName ownedFile;
+		aReadStream >> ownedFile;
+		iOwnedFileArray->AppendL(ownedFile);
+		}
+	}
+
+TBool CApaAppData::ViewMbmIconsRequireLoading() const
+	{
+	const TInt count = iViewDataArray->Count();
+	for (TInt i = 0; i < count; ++i)
+		{
+		const CApaAppViewData* const viewData = iViewDataArray->At(i);
+		if ((!viewData->iNonMbmIconFile) && (!viewData->iIcons->AreViewIconsLoaded()))
+			{
+			return ETrue;
+			}
+		}
+	return EFalse;
+	}
+	
+TBool CApaAppData::MbmIconsRequireLoading() const
+	{
+	if (!iNonMbmIconFile)
+		{
+		if (!iIcons->AreAppIconsLoaded())
+			{
+			return ETrue;
+			}
+		}
+
+	if (ViewMbmIconsRequireLoading())
+		{// if a view has mbm icons, and its not yet loaded we should load its icons.
+		return ETrue;
+		}
+	return EFalse; // icons were loaded already so no need to load them again.
+	}
+
+void CApaAppData::ExternalizeL(RWriteStream& aWriteStream) const
+	{
+	aWriteStream.WriteUint32L(I64HIGH(iTimeStamp.Int64()));
+	aWriteStream.WriteUint32L(I64LOW(iTimeStamp.Int64()));
+
+	if (iIconFileNameFromResourceFile)
+		{
+		aWriteStream.WriteUint32L(I64HIGH(iIconFileTimeStampFromResourceFile.Int64()));
+	    aWriteStream.WriteUint32L(I64LOW(iIconFileTimeStampFromResourceFile.Int64()));
+		}
+	else
+		{
+	aWriteStream.WriteUint32L(I64HIGH(iIconFileTimeStamp.Int64()));
+	aWriteStream.WriteUint32L(I64LOW(iIconFileTimeStamp.Int64()));
+		}
+		
+	if (iCaptionFromResourceFile)	// Caption present in the resource file would be externalized if the one in applist has dynamically changed
+		{
+		aWriteStream << *iCaptionFromResourceFile;
+		}
+	else
+		{
+		aWriteStream << *iCaption;
+		}
+		
+	if (iShortCaptionFromResourceFile)	// Short caption present in the resource file would be externalized if the one in applist has dynamically changed
+		{
+		aWriteStream << *iShortCaptionFromResourceFile;
+		}
+	else
+		{
+		aWriteStream << *iShortCaption;
+		}
+	aWriteStream << *iFullName;	// FullName
+
+	TInt i;
+	for (i = 0; i < 3; ++i)
+		{
+		aWriteStream << iUidType[i];	// Uid Type
+		}
+
+	aWriteStream << iCapabilityBuf;
+	aWriteStream << RegistrationFileName();	// Registration filename
+	aWriteStream.WriteUint32L(iDefaultScreenNumber);	// Default screen number
+
+	if (iIconFileNameFromResourceFile)
+		{
+		aWriteStream.WriteUint32L(iNumOfAppIconsFromResourceFile);	// number of icons
+
+		aWriteStream.WriteUint32L(iNonMbmIconFileFromResourceFile);
+
+		aWriteStream << *iIconFileNameFromResourceFile;
+		}
+	else
+		{
+	aWriteStream.WriteUint32L(iNumOfAppIcons);	// number of icons
+
+	aWriteStream.WriteUint32L(iNonMbmIconFile);
+
+	aWriteStream << IconFileName();
+		}
+
+	aWriteStream << LocalisableResourceFileName();
+
+	aWriteStream.WriteUint32L(I64HIGH(iLocalisableResourceFileTimeStamp.Int64()));
+	aWriteStream.WriteUint32L(I64LOW(iLocalisableResourceFileTimeStamp.Int64()));
+
+	aWriteStream.WriteInt32L(iApplicationLanguage);
+
+	aWriteStream.WriteUint32L(iIndexOfFirstOpenService);
+
+	aWriteStream.WriteUint32L(iNonNativeApplicationType.iUid);
+
+	aWriteStream << OpaqueData();
+	
+	TInt count = iViewDataArray->Count();
+	aWriteStream.WriteUint32L(count);
+
+	for (i = 0; i < count; ++i)
+		{
+		const CApaAppViewData* const viewData = iViewDataArray->At(i);
+		aWriteStream << *(viewData->iCaption);
+		aWriteStream.WriteUint32L(viewData->iNumOfViewIcons);
+		aWriteStream.WriteUint32L(viewData->iNonMbmIconFile);
+		aWriteStream << viewData->IconFileName();		
+		aWriteStream.WriteUint32L(viewData->iScreenMode);
+		aWriteStream.WriteUint32L(viewData->iUid.iUid);
+		}
+
+	// TApaAppServiceInfo service array
+	if (iServiceArray)
+		{
+		count = iServiceArray->Count();
+		aWriteStream.WriteUint32L(count);
+		for (i = 0; i < count; ++i)
+			{
+			aWriteStream << iServiceArray->At(i);
+			}
+		}
+	else
+		{
+		aWriteStream.WriteUint32L(NULL);
+		}
+
+	if (iOwnedFileArray)
+		{
+		count = iOwnedFileArray->MdcaCount();
+		aWriteStream.WriteUint32L(count);
+		for (i = 0; i < count; ++i)
+			{
+			aWriteStream << (*iOwnedFileArray)[i];
+			}
+		}
+	else
+		{
+		aWriteStream.WriteUint32L(0);
+		}
+	}
+
+TInt CApaAppList::IdleUpdateCallbackL(TAny* aObject)
+	{
+	CApaAppList* self=REINTERPRET_CAST(CApaAppList*,aObject);
+	const TBool moreToCome=self->IdleUpdateL();
+	if (moreToCome==EFalse)
+		{
+		//Reset language change flag if scanning is over.
+		if (self->IsLanguageChangePending())
+			{
+			self->iFlags &= ~ELangChangePending;
+			}
+		self->StopIdler();
+		if (self->iLoadMbmIconsOnDemand)
+			{
+			self->InitiateStoringOfAppList();
+			}
+		else
+			{
+			self->StartIconLoadingL();
+			}
+		}
+	return moreToCome;
+	}
+
+void CApaAppList::StoreL()
+	{
+	iAppListStorer = CApaAppListStorer::NewL(iAppData, iFs, *this);
+	iAppListStorer->StartL(KAppListToFileStartDelay);
+	}
+
+void CApaAppList::NotifyObserver()
+	{
+	if (iObserver)
+		{
+		if (iFlags & EAppListHasChanged || iFlags & ENotifyUpdateOnFirstScanComplete)
+			{
+			// NotifyUpdate will notify clients for both list update and scan complete.
+			iObserver->NotifyUpdate(MApaAppListServObserver::EAppListChanged);
+			}
+		else
+			{
+			// NotifyScanComplete will notify clients for scan complete.
+			iObserver->NotifyScanComplete();
+			}
+		iObserver=NULL;
+		}
+	}
+
+void CApaAppList::StopIdler()
+	{
+ 	delete iAppIdler;
+	iAppIdler=NULL;
+	}
+
+TInt CApaAppList::IdleUpdateL()
+// returns ETrue if there is more scanning to be done.
+	{
+	TBool more=EFalse;
+	TApaAppEntry currentApp = TApaAppEntry();
+	TRAPD(err,more=iAppRegFinder->NextL(currentApp, iForcedRegistrations));
+	if (err!=KErrNone)
+		{
+		if (iFlags & ENotifyUpdateOnFirstScanComplete)
+			{
+			User::Leave(err);
+			}
+		return more;
+		}
+	TBool hasChanged=EFalse;
+	if (more)
+		{
+		TRAPD(err,UpdateNextAppL(currentApp,hasChanged));
+		if (err!=KErrNone)
+			{
+			SetNotFound(iAppData,hasChanged);
+			if (iFlags & ENotifyUpdateOnFirstScanComplete)
+				{
+				User::Leave(err);
+				}	
+			more=EFalse; // abandon ship
+			}
+		}
+	else
+		{
+		SetNotFound(iAppData,hasChanged);
+		PurgeL();
+		}
+
+	if (hasChanged)
+		{
+		iFlags |= EAppListHasChanged;
+		}
+	return more;
+	}
+
+EXPORT_C TBool CApaAppList::IsIdleUpdateComplete() const
+/** Tests whether an asynchronous update of the list is currently in progress.
+
+@return True if no asynchronous update of the list is currently in progress, 
+otherwise false. */
+	{
+	return iAppIdler == NULL;
+	}
+
+void CApaAppList::SetPending(CApaAppData* aAppData)
+	// set all apps to pending update - we'll find them again as we scan
+	{
+  	for (; aAppData; aAppData = aAppData->iNext)
+		{
+		aAppData->SetAppPending();
+		}
+	}
+
+void CApaAppList::SetNotFound(CApaAppData* aAppData, TBool& aHasChanged)
+	// mark any unfound apps not present
+	{
+	while (aAppData)
+		{
+		if (aAppData->IsPending())
+			{
+			aAppData->iIsPresent = CApaAppData::ENotPresent;
+			aHasChanged = ETrue;
+			}
+		aAppData = aAppData->iNext;
+		}
+	}
+
+void CApaAppList::AddToList( CApaAppData* aAppData )
+{
+	__ASSERT_DEBUG(aAppData, Panic(EPanicNullPointer));
+	aAppData->iNext=iAppData;
+	iAppData=aAppData;
+}
+
+void CApaAppList::UpdateNextAppL(const TApaAppEntry& aAppEntry,TBool& aHasChanged)
+	{
+	CApaAppData* appData=AppDataByUid(aAppEntry.iUidType[2]);
+	if (appData==NULL)
+		{// not in list, so add it at the start
+		TRAPD(err,appData=CApaAppData::NewL(aAppEntry, iFs));
+		if (err==KErrNone)
+			{
+			AddToList( appData );
+			aHasChanged=ETrue;
+			}
+		}
+	else if (appData->IsPending())
+		{ // not found yet during current scan - we may need to override this one
+		
+		// On a system which scans for registration .RSC files (V2 apps) first, followed by
+		// .APP files (V1 apps), it's valid for a V1 app to override a V2 app (if the V2 app
+		// has just been removed). If this is the case, assume it's ok to compare the V1 .APP filename,
+		// with the V2 .RSC filename as their filenames will never match (which is what we want in this case).
+		TPtrC currentFileName;
+		if (appData->RegistrationFileUsed())
+			{
+			currentFileName.Set(*appData->iRegistrationFile);
+			}
+		else
+			{
+			currentFileName.Set(*appData->iFullName);
+			}
+		if (aAppEntry.iFullName.CompareF(currentFileName)!=0)
+			{
+			delete appData->iSuccessor;
+			appData->iSuccessor = NULL;
+			appData->iSuccessor = CApaAppEntry::NewL(aAppEntry);
+
+
+			appData->iIsPresent = CApaAppData::ESuperseded;
+			aHasChanged=ETrue;
+			}
+		else
+			{
+			if (appData->Update()
+				|| appData->iIsPresent==CApaAppData::ENotPresentPendingUpdate) 
+				{
+				aHasChanged=ETrue; 
+				}
+			appData->iIsPresent = CApaAppData::EIsPresent;
+			}
+		}
+	}
+
+/**
+@internalComponent
+*/
+EXPORT_C CApaAppData* CApaAppList::FindAndAddSpecificAppL(CApaAppRegFinder* aFinder, TUid aAppUid)
+	{
+//Scans and adds the specified application to the app list if found
+	__ASSERT_DEBUG(aFinder, Panic(EPanicNullPointer));
+	TBool found = EFalse;
+	TApaAppEntry appEntry;
+	aFinder->FindAllAppsL();
+	while (aFinder->NextL(appEntry, iForcedRegistrations))
+		{
+		if (appEntry.iUidType[2] == aAppUid)
+			{
+			found = ETrue;
+			break;
+			}
+		}
+	
+	CApaAppData* app = NULL;
+	if (found)
+		{
+		// add the app to the list
+		TBool hasChanged = EFalse;
+		CApaAppData* prevFirstAppInList = iAppData;
+		UpdateNextAppL(appEntry, hasChanged);
+		if (iAppData != prevFirstAppInList)
+			{
+			// assume the new app was added to the list
+			app = iAppData;
+			}
+		if (hasChanged)
+			{
+			iFlags |= EAppListHasChanged;
+			}
+		}
+	return app;
+	}
+
+EXPORT_C void CApaAppList::PurgeL()
+/** Removes any applications from the list if they are no longer present 
+on the phone. It updates applications that have been 
+superceded. */
+	{
+	CApaAppData* appData=iAppData;
+	CApaAppData* prev=NULL;
+	while (appData)
+		{
+		CApaAppData* next=appData->iNext;
+		if (appData->iIsPresent==CApaAppData::ENotPresent)
+			{
+			if (prev)
+				prev->iNext=next;
+			else
+				iAppData=next;
+ 
+			//Add uninstalled application UID to a list
+            if(iUninstalledApps==NULL)
+                iUninstalledApps=new(ELeave) CArrayFixFlat<TUid>(1);
+            
+            iUninstalledApps->AppendL(appData->AppEntry().iUidType[2]);
+ 			
+			delete appData;
+			}
+		else if (appData->iIsPresent==CApaAppData::ESuperseded)
+			{
+			CApaAppData* newApp=NULL;
+			TApaAppEntry appEntry;
+			appData->iSuccessor->Get(appEntry);
+			TRAPD(err,newApp=CApaAppData::NewL(appEntry, iFs));
+			if (err==KErrNone)
+				{
+				// remove the old one and add the new one in its place
+				if (prev)
+					prev->iNext=newApp;
+				else
+					iAppData=newApp;
+				newApp->iNext = appData->iNext;
+				delete appData;
+				// increment the iterator
+				prev = newApp;
+				}
+			}
+		else
+			prev=appData;
+		appData=next;
+		}
+	}
+
+EXPORT_C TInt CApaAppList::Count() const
+/** Gets the count of applications present in the app list.
+
+@return The number of applications in the list. */
+
+	{
+	TInt count=0;
+	CApaAppData* appData=iAppData;
+	while (appData)
+		{
+		count++;
+		appData=appData->iNext;
+		}
+	return count;
+	}
+
+EXPORT_C CApaAppData* CApaAppList::FirstApp() const
+/** Gets a pointer to the first application in the list 
+that can use the default screen mode.
+
+@return A pointer to the first application. */
+	{
+	return FirstApp(0);
+	}
+
+EXPORT_C CApaAppData* CApaAppList::FirstApp(TInt aScreenMode) const
+/** Gets a pointer to the first application in the list 
+that can use the specified screen mode.
+
+@param aScreenMode The index of the screen mode. Specifying 
+KIgnoreScreenMode returns the first application in the list, 
+regardless of screen mode.
+@return A pointer to the first application that can use the 
+specified screen mode. */
+	{
+
+	CApaAppData* appData=iValidFirstAppData;
+
+	if(aScreenMode!=KIgnoreScreenMode)
+		{
+		while (appData && !appData->CanUseScreenMode(aScreenMode))
+			appData = appData->iNext;
+		}
+
+	return appData;
+	}
+
+EXPORT_C CApaAppData* CApaAppList::NextApp(const CApaAppData* aApp) const
+/** Gets a pointer to the next application after aApp in the list 
+that can use the default screen mode.
+
+@param aApp A pointer to an application in the list.
+@return A pointer to the next application after aApp in the list 
+that can use the default screen mode.
+@panic APGRFX 12 aApp is NULL. */
+	{
+	return NextApp(aApp,0);
+	}
+
+EXPORT_C CApaAppData* CApaAppList::NextApp(const CApaAppData* aApp, TInt aScreenMode) const
+/** Gets a pointer to the next application after aApp in the list 
+that can use the specified screen mode.
+
+@param aApp A pointer to an application in the list. 
+@param aScreenMode The index of the screen mode. Specifying 
+KIgnoreScreenMode returns the next application in the list, 
+regardless of screen mode.
+@return A pointer to the next application after aApp in the list 
+that can use the specified screen mode.
+@panic APGRFX 12 aApp is NULL. */
+
+	{
+	__ASSERT_ALWAYS(aApp,Panic(EPanicNoAppDataSupplied));
+	//
+	CApaAppData* iApp=aApp->iNext; //lint !e613 Suppress possible use of null pointer - asserted above
+
+	if(aScreenMode!=KIgnoreScreenMode)
+		while (iApp && !iApp->CanUseScreenMode(aScreenMode))
+			iApp = iApp->iNext;
+
+	return iApp;
+	}
+
+EXPORT_C CApaAppData* CApaAppList::AppDataByUid(TUid aAppUid) const
+/** Gets a pointer to the application in the list whose third 
+UID matches the specified UID.
+
+@param aAppUid An application's third UID. 
+@return A pointer to the application, if successful. Null, 
+if no match is found or if KNullUid was specified. */
+	{
+	if (aAppUid==KNullUid)
+		return NULL; // never match null UID as it represents an un-UIDed file
+	CApaAppData* appData=iAppData;
+	while (appData)
+		{
+		if (appData->AppEntry().iUidType[2]==aAppUid)
+			return appData;
+		appData=appData->iNext;
+		}
+	return NULL;
+	}
+
+EXPORT_C CApaAppData* CApaAppList::AppDataByFileName(const TDesC& aFullFileName) const
+/** Gets a pointer to the application in the list whose application
+file name matches the one specified
+
+@param aFullFileName a file name. 
+@return A pointer to the application, if successful. Null, 
+if no match is found or if KNullDesC was specified.
+@internalTechnology
+*/
+	{
+	if (aFullFileName.Length()==0)
+		{
+		return NULL; // never match null UID as it represents an un-UIDed file
+		}
+	CApaAppData* appData=iAppData;
+	while (appData)
+		{
+		if (appData->AppEntry().iFullName.CompareF(aFullFileName)==0)
+			{
+			return appData;
+			}
+		appData=appData->iNext;
+		}
+	return NULL;
+	}
+	
+/**
+Adds a registration file to the iForcedRegistrations array.
+
+@param aRegistrationFile The function takes ownership of the HBufC.
+@internalComponent
+*/
+EXPORT_C void CApaAppList::AddForcedRegistrationL(HBufC* aRegistrationFile)
+	{
+	TInt err = iForcedRegistrations.InsertInOrder(aRegistrationFile, TLinearOrder<HBufC>(CompareStrings));
+	if (err == KErrAlreadyExists) // We silently ignore attempts to insert duplicates
+		{
+		delete aRegistrationFile;
+		}
+	else
+		{
+		User::LeaveIfError(err);
+		}
+	} //lint !e818 Suppress pointer parameter 'aRegistrationFile' could be declared as pointing to const
+	
+EXPORT_C void CApaAppList::ResetForcedRegistrations()
+	{
+	iForcedRegistrations.ResetAndDestroy();
+	}
+
+EXPORT_C TUid CApaAppList::PreferredDataHandlerL(const TDataType& aDataType) const
+/** Finds the preferred application to handle the specified data type.
+
+@param aDataType The data type of interest.
+@return The third UID of the application in the list which has the 
+highest priority for handling the specified data type. A null UID is 
+returned if no application in the list can handle the specified data type. */
+	{
+	TInt dummy;
+	return PreferredDataHandlerL(aDataType, NULL, dummy);
+	}
+	
+EXPORT_C TUid CApaAppList::PreferredDataHandlerL(const TDataType& aDataType, const TUid* aServiceUid, TInt& aPriority) const
+/** Finds the preferred application to handle the specified data type.
+
+@param aDataType The data type of interest.
+@param aServiceUid The optional service UID.
+@param aPriority The priority associated with the returned app.
+@return The third UID of the application in the list which has the 
+highest priority for handling a combination of the specified data type
+and service. A null UID is returned if no application in the list can
+handle the combination of specified data type and service.
+@internalComponent
+*/
+	{
+	// If there is a service uid we first try to use the service specific list
+	// of datatypes
+	if (aServiceUid)
+		{
+		CApaAppData* appData=iAppData;
+		aPriority=KDataTypePriorityNotSupported;
+		TUid uid={0};
+		while (appData)
+			{
+			TInt priority = appData->ImplementsServiceWithDataType(*aServiceUid, aDataType);
+			if (priority > aPriority)
+				{
+				aPriority=priority;
+				uid=appData->AppEntry().iUidType[2];
+				}
+			appData=appData->iNext;
+			}
+		if (aPriority != KDataTypePriorityNotSupported)
+			{
+			return uid;
+			}
+		}
+	
+	CApaAppData* appData=iAppData;
+	aPriority=KDataTypePriorityNotSupported;
+	TUid uid={0};
+	while (appData)
+		{
+		TInt priority=appData->DataType(aDataType);
+		if ((priority > aPriority) &&
+			(!aServiceUid || (aServiceUid && appData->ImplementsService(*aServiceUid))))
+			{
+			aPriority=priority;
+			uid=appData->AppEntry().iUidType[2];
+			}
+		appData=appData->iNext;
+		}
+	return uid;
+	}
+  
+void CApaAppList::DeleteAppData()
+	{
+	iValidFirstAppData = NULL;
+	iFlags &= ~EFirstScanComplete;
+	iFlags &= ~EAppListHasChanged;
+	iFlags &= ~ELangChangePending;
+	
+	CApaAppData* next = NULL;
+	for (CApaAppData* appData=iAppData; appData; appData = next)
+		{
+		next = appData->iNext;
+		delete appData;
+		}
+	iAppData = NULL;
+	}
+
+void CApaAppList::ScanComplete()
+	{
+	if (!(iFlags & EFirstScanComplete) && iObserver)
+		iObserver->InitialListPopulationComplete();
+	iValidFirstAppData = iAppData;
+	iFlags|=EFirstScanComplete;
+	iNNAInstallation = EFalse;
+	}
+
+/**
+ *
+ * Tests whether the first scan for list of Apps has completed.
+ *
+ * @return   "TBool"
+ *            True, if the first scan for list of Apps has completed; false, otherwise.
+ * @internalComponent
+ */
+EXPORT_C TBool CApaAppList::IsFirstScanComplete() const
+	{
+	return iFlags&EFirstScanComplete;
+	}
+
+EXPORT_C TBool CApaAppList::AppScanInProgress() const
+/** @internalComponent */
+	{
+	return (iAppIdler!=NULL) && iAppIdler->IsActive();
+	}
+
+/**
+@internalComponent
+*/
+EXPORT_C CBufFlat* CApaAppList::ServiceArrayBufferL(TUid aAppUid) const
+	{
+	CApaAppData* app = FirstApp(KIgnoreScreenMode);
+	while (app && app->AppEntry().iUidType[2] != aAppUid)
+		{
+		app = NextApp(app, KIgnoreScreenMode);
+		}
+
+	if (app)
+		{
+		if (!app->RegistrationFileUsed())
+			{
+			User::Leave(KErrNotSupported);
+			}
+		if (app->iServiceArray)
+			{
+			CBufFlat* const buf = CBufFlat::NewL(KBufferExpansionGranularity);
+			CleanupStack::PushL(buf);
+			RBufWriteStream writeStream(*buf);
+			writeStream << *(app->iServiceArray);
+			writeStream.CommitL();
+			writeStream.Release();
+			CleanupStack::Pop(buf);
+			return buf;
+			}
+		}
+	User::Leave(KErrNotFound);
+	return NULL; // to keep compiler happy
+	}
+
+/**
+@internalComponent
+*/
+EXPORT_C CBufFlat* CApaAppList::ServiceUidBufferL(TUid aAppUid) const
+	{
+	CApaAppData* app = FirstApp(KIgnoreScreenMode);
+	while (app && app->AppEntry().iUidType[2] != aAppUid)
+		{
+		app = NextApp(app, KIgnoreScreenMode);
+		}
+
+	if (app)
+		{
+		if (!app->RegistrationFileUsed())
+			{
+			User::Leave(KErrNotSupported);
+			}
+		if (app->iServiceArray)
+			{
+			CArrayFixFlat<TApaAppServiceInfo>& serviceArray = *(app->iServiceArray);
+			CArrayFixFlat<TUid>* uidArray = new(ELeave) CArrayFixFlat<TUid>(4);
+			CleanupStack::PushL(uidArray);
+			for (TInt i = serviceArray.Count()-1; i >= 0; i--)
+				{
+				uidArray->AppendL(serviceArray[i].Uid());
+				}
+			CBufFlat* const buf = CBufFlat::NewL(KBufferExpansionGranularity);
+			CleanupStack::PushL(buf);
+			RBufWriteStream writeStream(*buf);
+			writeStream << *uidArray;
+			writeStream.CommitL();
+			writeStream.Release();
+			CleanupStack::Pop(buf);
+			CleanupStack::PopAndDestroy(uidArray);
+			return buf;
+			}
+		}
+	User::Leave(KErrNotFound);
+	return NULL; // to keep compiler happy
+	}
+
+/**
+@internalComponent
+*/
+EXPORT_C CBufFlat* CApaAppList::ServiceOpaqueDataBufferL(TUid aAppUid, TUid aServiceUid) const
+	{
+	CApaAppData* app = FirstApp(KIgnoreScreenMode);
+	while (app && app->AppEntry().iUidType[2] != aAppUid)
+		{
+		app = NextApp(app, KIgnoreScreenMode);
+		}
+
+	if (app)
+		{
+		if (!app->RegistrationFileUsed())
+			{
+			User::Leave(KErrNotSupported);
+			}
+		if (app->iServiceArray)
+			{
+			CArrayFixFlat<TApaAppServiceInfo>* implArray = NULL;
+			CArrayFixFlat<TApaAppServiceInfo>& serviceArray = *(app->iServiceArray);
+			for (TInt i = serviceArray.Count()-1; i >= 0; i--)
+				{
+				const TApaAppServiceInfo& infoRef = serviceArray[i];
+				if (infoRef.Uid() == aServiceUid)
+					{
+					if (!implArray)
+						{
+						implArray = new(ELeave) CArrayFixFlat<TApaAppServiceInfo>(4);
+						CleanupStack::PushL(TCleanupItem(CleanupServiceArray, implArray));
+						}
+					CArrayFixFlat<TDataTypeWithPriority>* dummy =
+						new(ELeave) CArrayFixFlat<TDataTypeWithPriority>(1);
+					CleanupStack::PushL(dummy);					
+					TApaAppServiceInfo info(aServiceUid, dummy, infoRef.OpaqueData().AllocLC());
+					implArray->AppendL(info);
+					CleanupStack::Pop(CONST_CAST(TDesC8*,&info.OpaqueData()));
+					CleanupStack::Pop(dummy);
+					}
+				}
+			if (implArray)
+				{
+				CBufFlat* const buf = CBufFlat::NewL(KBufferExpansionGranularity);
+				CleanupStack::PushL(buf);
+				RBufWriteStream writeStream(*buf);
+				writeStream << *implArray;
+				writeStream.CommitL();
+				writeStream.Release();
+				CleanupStack::Pop(buf);
+				CleanupStack::PopAndDestroy(implArray);
+				return buf;
+				}
+			}
+		}
+	User::Leave(KErrNotFound);
+	return NULL; // to keep compiler happy
+	}
+
+/**
+@internalComponent
+*/
+EXPORT_C CBufFlat* CApaAppList::ServiceImplArrayBufferL(TUid aServiceUid) const
+	{
+	CApaAppData* app = FirstApp(KIgnoreScreenMode);
+	// build an array containing all implementations of the service identified by aServiceUid
+	CArrayFixFlat<TApaAppServiceInfo>* implArray = NULL;
+	while (app)
+		{
+		if (app->iServiceArray)
+			{
+			for (TInt i = app->iServiceArray->Count()-1; i >= 0; i--)
+				{
+				const TApaAppServiceInfo& infoRef = (*app->iServiceArray)[i];
+				if (infoRef.Uid() == aServiceUid)
+					{
+					if (!implArray)
+						{
+						implArray = new(ELeave) CArrayFixFlat<TApaAppServiceInfo>(4);
+						CleanupStack::PushL(TCleanupItem(CleanupServiceArray, implArray));
+						}
+					CArrayFixFlat<TDataTypeWithPriority>* datatypes = DataTypeArrayDeepCopyLC(infoRef.DataTypes());
+					HBufC8* data = infoRef.OpaqueData().AllocLC();
+					TApaAppServiceInfo info(app->AppEntry().iUidType[2], datatypes, data);
+					implArray->AppendL(info);
+					CleanupStack::Pop(data);
+					CleanupStack::Pop(datatypes);
+					}
+				}
+			}
+		app = NextApp(app, KIgnoreScreenMode);
+		}
+
+	if (implArray)
+		{
+		CBufFlat* const buf = CBufFlat::NewL(KBufferExpansionGranularity);
+		CleanupStack::PushL(buf);
+		RBufWriteStream writeStream(*buf);
+		writeStream << *(implArray);
+		writeStream.CommitL();
+		writeStream.Release();
+		CleanupStack::Pop(buf);
+		CleanupStack::PopAndDestroy(implArray);
+		return buf;
+		}
+	User::Leave(KErrNotFound);
+	return NULL; // to keep compiler happy
+	}
+
+EXPORT_C CBufFlat* CApaAppList::ServiceImplArrayBufferL(TUid aServiceUid, const TDataType& aDataType) const
+	{
+	CApaAppData* app = FirstApp(KIgnoreScreenMode);
+	// build an array containing all implementations of the service identified by aServiceUid
+	CArrayFixFlat<TApaAppServiceInfo>* implArray = NULL;
+	while (app)
+		{
+		if (app->iServiceArray)
+			{
+			for (TInt i = app->iServiceArray->Count()-1; i >= 0; i--)
+				{
+				const TApaAppServiceInfo& infoRef = (*app->iServiceArray)[i];
+				if (infoRef.Uid() == aServiceUid)
+					{
+				 	if (KDataTypePriorityNotSupported != app->DataType(aDataType, infoRef.DataTypes()))
+						{
+						if (!implArray)
+							{
+							implArray = new(ELeave) CArrayFixFlat<TApaAppServiceInfo>(4);
+							CleanupStack::PushL(TCleanupItem(CleanupServiceArray, implArray));
+							}
+						CArrayFixFlat<TDataTypeWithPriority>* datatypes = DataTypeArrayDeepCopyLC(infoRef.DataTypes());
+						HBufC8* data = infoRef.OpaqueData().AllocLC();
+						TApaAppServiceInfo info(app->AppEntry().iUidType[2], datatypes, data);
+						implArray->AppendL(info);
+						CleanupStack::Pop(data);
+						CleanupStack::Pop(datatypes);
+						}
+					}
+				}
+			}
+		app = NextApp(app, KIgnoreScreenMode);
+		}
+
+	if (implArray)
+		{
+		CBufFlat* const buf = CBufFlat::NewL(KBufferExpansionGranularity);
+		CleanupStack::PushL(buf);
+		RBufWriteStream writeStream(*buf);
+		writeStream << *(implArray);
+		writeStream.CommitL();
+		writeStream.Release();
+		CleanupStack::Pop(buf);
+		CleanupStack::PopAndDestroy(implArray);
+		return buf;
+		}
+	User::Leave(KErrNotFound);
+	return NULL; // to keep compiler happy
+	}
+	
+CArrayFixFlat<TDataTypeWithPriority>* CApaAppList::DataTypeArrayDeepCopyLC(const CArrayFixFlat<TDataTypeWithPriority>& aOriginal) const
+	{
+	CArrayFixFlat<TDataTypeWithPriority>* result = new(ELeave) CArrayFixFlat<TDataTypeWithPriority>(1);
+	CleanupStack::PushL(result);
+	TInt ii = 0;
+	TInt end = aOriginal.Count();
+	while (ii < end)
+		{
+		result->AppendL(aOriginal[ii]);
+		ii++;
+		}
+	return result;
+	}
+	
+EXPORT_C TInt CApaAppList::CompareStrings(const HBufC& aFirst, const HBufC& aSecond)
+	{
+	return aFirst.CompareF(aSecond);
+	}
+
+EXPORT_C CApaAppList* CApaAppList::Self()
+	{ // static
+	return STATIC_CAST(CApaAppList*,Dll::Tls());
+	}
+	
+/*EXPORT_C*/ RFs& CApaAppList::ShareProtectedFileServer()
+	{
+	return iFsShareProtected; //lint !e1536 Exposing low access member - need to consider a redesign or design clarification here(iFsShareProtected should be owned be the one that needs it) but postpone for now as that may require large changes
+	}
+	
+CApaAppIconArray* CApaAppList::LoadDefaultIconsL() const
+	{
+	CApaIconLoader* iconLoader = CApaIconLoader::NewLC(iFs);
+	CApaAppIconArray* icons = CApaAppIconArray::NewRealDefaultIconsLC(KNumberOfIconsInDefaultMbm,*iDefaultAppIconMbmFileName, *iconLoader);
+	const TBool badMbmEntryInfo = !icons->LoadIconsL();
+	if(badMbmEntryInfo)
+		{
+		CleanupStack::PopAndDestroy(2,iconLoader);
+		return CApaAppIconArray::NewL();
+		}
+	else
+		{
+		CleanupStack::Pop(icons);
+		CleanupStack::PopAndDestroy(iconLoader);
+		}
+	return icons;
+	}
+
+void CApaAppList::AcquireDefaultIconArrayL() const
+	{
+	ASSERT(iDefaultIconUsageCount >= 0);
+	if (iDefaultIconUsageCount == 0)
+		{
+		iDefaultIconArray = LoadDefaultIconsL();
+		}
+	++iDefaultIconUsageCount;
+	}
+
+// Should NEVER be called by an object that does not call AcquireDefaultIconArrayL and
+// ReleaseDefaultIconArray at the beginning and end of its lifetime respectively
+const CApaAppIconArray& CApaAppList::DefaultIconArray() const
+	{
+	__ASSERT_ALWAYS(iDefaultIconArray, Panic(EPanicNullPointer));
+	return *iDefaultIconArray;
+	}
+
+void CApaAppList::ReleaseDefaultIconArray() const
+	{
+	ASSERT(iDefaultIconUsageCount > 0);
+	if(0 == --iDefaultIconUsageCount)
+		{
+		delete iDefaultIconArray;
+		iDefaultIconArray = NULL;		
+		}
+	}
+	
+// DEF077478 - Required to update the default icons that the app list holds.
+void CApaAppList::UpdateDefaultIconsL()
+	{
+	CApaAppIconArray* iconArray = LoadDefaultIconsL();
+	if (iconArray)
+		{
+		delete iDefaultIconArray;
+		iDefaultIconArray = iconArray;
+		}
+	}
+
+void CApaAppList::DeleteAppListStorer()
+	{
+	delete iAppListStorer;
+	iAppListStorer = NULL;
+	}
+
+void CApaAppList::DeleteAppIconLoader()
+	{
+	delete iAppIconLoader;
+	iAppIconLoader = NULL;
+	}
+
+void CApaAppList::InitiateStoringOfAppList()
+	{
+	ScanComplete();	
+	NotifyObserver();
+	iFlags &= ~ENotifyUpdateOnFirstScanComplete;
+	// now that the scan is finished, iDefaultAppIconMbmFileName is deleted
+	delete iDefaultAppIconMbmFileName;
+	iDefaultAppIconMbmFileName=NULL;
+	// if applist has not changed and AppsList_Backup.bin file exists then it is replaced back to AppsList.bin
+	if (!(iFlags & EAppListHasChanged) && BaflUtils::FileExists(iFs, iAppsListCacheBackUpFileName))
+		{
+		TInt replaceError = iFs.Replace(iAppsListCacheBackUpFileName, iAppsListCacheFileName);
+		if (replaceError == KErrNone)
+			{
+			return;
+			}
+		}
+    iFlags &= ~EAppListHasChanged;
+	iFs.Delete(iAppsListCacheBackUpFileName);
+	TInt err = iFs.MkDir(iAppsListCachePath);
+	if (err == KErrNone || err == KErrAlreadyExists)
+		{
+		TRAP(err, StoreL());
+		if (err)
+			{
+			DeleteAppListStorer();
+			}
+		}
+	}
+//
+// Class CApaAppListStorer
+//
+
+CApaAppList::CApaAppListStorer::CApaAppListStorer(CApaAppData* aFirstAppData, RFs& aFs, CApaAppList& aAppList) : CActive(EPriorityIdle), iCurrentAppData(aFirstAppData), iFs(aFs), iAppList(aAppList)
+	{
+	}
+
+CApaAppList::CApaAppListStorer::~CApaAppListStorer()
+	{
+	Cancel();
+	iWriteStream.Close();
+	iFs.Delete(iTempFilename);
+	iTimer.Close();
+	iCurrentAppData = NULL;
+	}
+
+CApaAppList::CApaAppListStorer* CApaAppList::CApaAppListStorer::NewL(CApaAppData* aFirstAppData, RFs& aFs, CApaAppList& aAppList)
+	{
+	CApaAppListStorer* self = new(ELeave) CApaAppListStorer(aFirstAppData, aFs, aAppList);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+void CApaAppList::CApaAppListStorer::ConstructL()
+	{
+	User::LeaveIfError(iTimer.CreateLocal());
+	CActiveScheduler::Add(this);
+	}
+
+void CApaAppList::CApaAppListStorer::StartL(const TTimeIntervalMicroSeconds32& aDelay)
+	{
+	User::LeaveIfError(iWriteStream.Temp(iFs, iAppList.iAppsListCachePath, iTempFilename, EFileWrite));
+	iWriteStream.WriteInt32L(User::Language());
+
+#if defined (SYMBIAN_BAFL_SYSUTIL)
+	//Write a cache of the ROM version to a separate stream
+	//Build the filename for the cache file
+	TInt maxSizeofFileName = iAppList.iAppsListCachePath.Length() + KROMVersionStringCacheFileName().Length();
+	RBuf romVersionCacheFileName;
+	romVersionCacheFileName.CreateL(maxSizeofFileName);
+	romVersionCacheFileName.CleanupClosePushL();
+	romVersionCacheFileName.Append(iAppList.iAppsListCachePath);
+	romVersionCacheFileName.Append(KROMVersionStringCacheFileName());
+	
+	RFileWriteStream romVerStream;
+	User::LeaveIfError(romVerStream.Replace(iFs,romVersionCacheFileName,EFileWrite));
+	CleanupClosePushL(romVerStream);
+	
+	// Write the file version that apparc can handle.
+	romVerStream.WriteInt8L(KROMVersionCacheFileMajorVersion);
+	romVerStream.WriteInt8L(KROMVersionCacheFileMinorVersion);
+	romVerStream.WriteInt16L(KROMVersionCacheFileBuildVersion);
+		
+	TBuf<KInfoBufLength> version;
+	SysUtil::GetSWVersion(version);
+	
+	// Write the software version even if SysUtil returns err since all conditions are taken care during restore.
+	romVerStream.WriteUint32L(version.Length());
+	romVerStream.WriteL(version, version.Length());
+	CleanupStack::PopAndDestroy(2); //romVerStream, romVersionCacheFileName
+#endif //(SYMBIAN_BAFL_SYSUTIL)
+	
+	iTimer.After(iStatus, aDelay);
+	SetActive();
+	}
+
+void CApaAppList::CApaAppListStorer::RunL()
+	{ 
+	// iStatus could be KErrNone or negative when timer completes, irrespective of its status we need to re-queue the request.
+	if (iCurrentAppData)
+		{
+		StoreEntryL(iWriteStream, *iCurrentAppData);
+		iCurrentAppData = iCurrentAppData->Next();
+		SetActive();
+		TRequestStatus* status = &iStatus;
+		User::RequestComplete(status, KErrNone);
+		}
+	else
+		{
+		iWriteStream.CommitL();
+		iWriteStream.Close();
+
+		TInt err = iFs.Replace(iTempFilename, iAppList.iAppsListCacheFileName);
+		if (err != KErrNone)
+			{
+			iFs.Delete(iTempFilename);
+			}
+		iAppList.DeleteAppListStorer();
+		}
+	}
+
+void CApaAppList::CApaAppListStorer::StoreEntryL(RWriteStream& aWriteStream, const CApaAppData& aApp)
+	{
+	aWriteStream << aApp;
+	}
+
+void CApaAppList::CApaAppListStorer::DoCancel()
+	{
+	iTimer.Cancel();
+	}
+
+TInt CApaAppList::CApaAppListStorer::RunError(TInt /*aError*/)
+	{
+	iAppList.DeleteAppListStorer();
+	return KErrNone;
+	}
+
+//
+// Class CApaIdleIconLoader
+//
+
+CApaAppList::CApaIdleIconLoader::CApaIdleIconLoader(CApaAppData* aFirstAppData, RFs& aFs, CApaAppList& aAppList) : CActive(EPriorityLow), iCurrentAppData(aFirstAppData), iFs(aFs), iAppList(aAppList)
+	{ // Priority is less than KAppListServerPriority, to maintain server responsiveness.
+	CActiveScheduler::Add(this);
+	}
+
+CApaAppList::CApaIdleIconLoader::~CApaIdleIconLoader()
+	{
+	Cancel();
+	iCurrentAppData = NULL;
+	}
+
+void CApaAppList::CApaIdleIconLoader::Start()
+	{
+	SetActive();
+	TRequestStatus* status = &iStatus;
+	User::RequestComplete(status, KErrNone);
+	}
+
+void CApaAppList::CApaIdleIconLoader::RunL()
+/** if the icons are not already loaded on demand then it would be loaded here. */
+	{
+	while (iCurrentAppData && !iCurrentAppData->MbmIconsRequireLoading())
+		{
+		iCurrentAppData = iCurrentAppData->Next();
+		}
+
+	if(iCurrentAppData)
+		{
+		Start();
+		CApaAppData* const appData = iCurrentAppData;
+		iCurrentAppData = iCurrentAppData->Next();
+		appData->LoadIconsL();
+		}
+	else
+		{
+		iAppList.InitiateStoringOfAppList();
+		iAppList.DeleteAppIconLoader();
+		}
+	}
+
+void CApaAppList::CApaIdleIconLoader::DoCancel()
+	{
+	}
+
+TInt CApaAppList::CApaIdleIconLoader::RunError(TInt /*aError*/)
+	{
+	return KErrNone;
+	}
+
+// ApaUtils
+
+EXPORT_C TBool ApaUtils::HandleAsRegistrationFile(const TUidType& aUidType)
+	{ // static
+	return (aUidType[1].iUid==KUidAppRegistrationFile.iUid ||
+		   aUidType[0].iUid==KUidPrefixedNonNativeRegistrationResourceFile);
+	}
+	
+
+//
+// Class CApaLangChangeMonitor
+//
+
+CApaAppList::CApaLangChangeMonitor::~CApaLangChangeMonitor()
+	{	
+	Cancel();
+	iLangNotifier.Close();
+	}
+
+CApaAppList::CApaLangChangeMonitor* CApaAppList::CApaLangChangeMonitor::NewL(CApaAppList& aAppList)
+	{ // static	
+	CApaLangChangeMonitor* self=new(ELeave) CApaLangChangeMonitor(aAppList);
+	self->ConstructL();
+	return self;
+	}
+
+CApaAppList::CApaLangChangeMonitor::CApaLangChangeMonitor(CApaAppList& aAppList)
+	: CActive(EPriorityNormal),
+	iAppList(aAppList)
+	{	
+	iPrevLanguage = User::Language();
+	CActiveScheduler::Add(this);
+	}
+
+void CApaAppList::CApaLangChangeMonitor::ConstructL()
+	{
+	User::LeaveIfError(iLangNotifier.Create());
+	Start();
+	}
+ 
+void CApaAppList::CApaLangChangeMonitor::Start()
+	{
+	iLangNotifier.Logon(iStatus);
+	SetActive();
+	}
+
+void CApaAppList::CApaLangChangeMonitor::DoCancel()
+	{
+	iLangNotifier.LogonCancel();
+	}
+
+void CApaAppList::CApaLangChangeMonitor::RunL()
+	{
+	// Logon to get further events before handling current request.
+	TRequestStatus status = iStatus;
+	Start();
+	
+	// if it is a language change event, start a rescan on app-list.
+	if (status.Int() == EChangesLocale && iPrevLanguage != User::Language())
+		{		
+		iPrevLanguage = User::Language();
+		iAppList.iFlags |= CApaAppList::ELangChangePending;
+		iAppList.StartIdleUpdateL(iAppList.iObserver);
+		}
+	}
+
+TInt CApaAppList::CApaLangChangeMonitor::RunError(TInt /*aError*/)
+	{
+	// Reset ELangChangePending flag if RunL leaves.
+	iAppList.iFlags &= ~CApaAppList::ELangChangePending;
+	// Reset iPrevLanguage to ELangNone if RunL leaves.
+	iPrevLanguage = ELangNone;
+	return KErrNone;
+	}
+
+void CApaAppList::GetAppsListCachePathL()
+	{
+	_LIT(KAppsListCacheFileName, ":\\private\\10003a3f\\AppsListCache\\AppsList.bin");
+	_LIT(KAppsListCacheBackUpFileName, ":\\private\\10003a3f\\AppsListCache\\AppsList_Backup.bin");
+	_LIT(KAppsListCachePath, ":\\private\\10003a3f\\AppsListCache\\");
+	TChar sysDrive = RFs::GetSystemDriveChar();
+	TInt maxSizeofFileName = KAppsListCacheFileName().Length() + 1;
+	iAppsListCacheFileName.CreateL(maxSizeofFileName);
+	iAppsListCacheFileName.Append(sysDrive);
+	iAppsListCacheFileName.Append(KAppsListCacheFileName());
+	maxSizeofFileName = KAppsListCacheBackUpFileName().Length() + 1;
+	iAppsListCacheBackUpFileName.CreateL(maxSizeofFileName);
+	iAppsListCacheBackUpFileName.Append(sysDrive);
+	iAppsListCacheBackUpFileName.Append(KAppsListCacheBackUpFileName());
+	maxSizeofFileName = KAppsListCachePath().Length() + 1;
+	iAppsListCachePath.CreateL(maxSizeofFileName);
+	iAppsListCachePath.Append(sysDrive);
+	iAppsListCachePath.Append(KAppsListCachePath());
+	}
+
+
+// The function transfers ownership of the pointer owned by a CApaAppList to the caller
+// to avoid copying the array.
+
+EXPORT_C CArrayFixFlat<TUid>* CApaAppList::UninstalledAppArray()
+    {
+    CArrayFixFlat<TUid>* uninstalledApps=iUninstalledApps;
+    iUninstalledApps=NULL;
+    return uninstalledApps;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apgrfx/APGCLI.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3096 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "../apserv/APSCLSV.H"
+#include "APGCLI.H"
+#include "APACMDLN.H"
+#include "APGSTD.H"
+#include "APGICNFL.H"
+#include <apsserv.h>
+#include <apmrec.h>
+#include <s32mem.h>
+#include "APGPRIV.H"
+#include <apadef.h>
+#include "apprivate.h"
+
+#if defined(USE_IH_RAISE_EVENT)
+#include <SystemMonitor/RaiseEvent.h>
+#include <test/testinstrumentation.h>
+#endif
+
+class CApaLsSessionExtension;
+
+const TUint KInitialIconBufSize=sizeof(TSize)*6+sizeof(TInt);
+const TUint KInitialViewDataBufSize=sizeof(TApaAppViewInfo)*6+sizeof(TInt);
+const TUint KInitialOwnedFilesBufSize=sizeof(TFileName)*6+sizeof(TInt);
+const TUint KDefaultBufSize = 0x400;
+const TUint KAsyncMessageSlots=4; //one slot each for, RApaLsSession::SetNotify, RApaLsSession::
+                                  //RegisterListPopulationCompleteObserver and RApaLsSession::NotifyOnDataMappingChange
+                                  //CAsyncFileRecognition::Start makes an asynch request of apparc server.
+
+_LIT8(KAllDataTypes,"*");
+
+extern void CleanupServiceArray(TAny* aServiceArray);
+
+IMPORT_C extern const TInt KMinApplicationStackSize;
+
+class MArrayFiller
+	{
+public:
+	virtual void AppendItemL(RReadStream& aReadStream)=0;
+	};
+
+class TSizeArrayFiller : public MArrayFiller
+	{
+public:
+	inline TSizeArrayFiller(CArrayFixFlat<TSize>& aArray) :iArray(aArray) {}
+	virtual void AppendItemL(RReadStream& aReadStream);
+private:
+	CArrayFixFlat<TSize>& iArray;
+	};
+
+class TViewDataArrayFiller : public MArrayFiller
+	{
+public:
+	inline TViewDataArrayFiller(CApaAppViewArray& aArray) :iArray(aArray) {}
+	virtual void AppendItemL(RReadStream& aReadStream);
+private:
+	CApaAppViewArray& iArray;
+	};
+
+class TDesCArrayFiller : public MArrayFiller
+	{
+public:
+	inline TDesCArrayFiller(CDesCArray& aArray) :iArray(aArray) {}
+	virtual void AppendItemL(RReadStream& aReadStream);
+private:
+	CDesCArray& iArray;
+	};
+
+/**
+This class is used to simplify the usage of the asynchronous RApaLsSession::RecognizeFilesL() function.
+@internalComponent
+*/
+class CAsyncFileRecognition : public CActive
+	{
+public:
+	CAsyncFileRecognition(CDataRecognitionResultArray& aResult, TRequestStatus& aUsersRequestStatus, CApaLsSessionExtension& aSession);
+	~CAsyncFileRecognition();
+	void Start(const TDesC& aPath, const TDesC8& aDataType);
+private:
+	void RunL();
+	void DoCancel();
+private: // data
+	TPckgBuf<TUint> iRequiredBufferSizePckg;
+	CDataRecognitionResultArray& iResult;
+	TRequestStatus& iUsersRequestStatus;
+	CApaLsSessionExtension& iSession;
+	const TDesC* iPath;
+	const TDesC8* iDataType;
+	};
+
+/**
+This class is an extension class for RApaLsSession. It was added to reduce the need
+of BC breaks in later releases.
+@internalComponent
+*/
+class CApaLsSessionExtension : public CBase
+	{
+public:
+	CApaLsSessionExtension(RApaLsSession& aSession);
+	~CApaLsSessionExtension();
+
+	void SendReceive(TInt aFunction,const TIpcArgs& aArgs,TRequestStatus& aStatus) const;
+	TInt SendReceive(TInt aFunction,const TIpcArgs& aArgs) const;
+
+	// file recognition functions
+	void RecognizeFilesL(const TDesC& aPath, const TDesC8& aDataType, CDataRecognitionResultArray& aResult, TRequestStatus& aStatus);
+	void CancelRecognizeFiles();
+	void FilesRecognized(const TDesC& aPath, TInt aRequiredBufferSize, CDataRecognitionResultArray& aResult, TRequestStatus& aUsersRequestStatus, const TRequestStatus& aErrorCode);
+	TBool RecognitionActive() const;
+private:
+	RApaLsSession& iSession;	// we are a friend of this class!
+	CAsyncFileRecognition* iAsyncFileRecognition;
+	};
+
+/**
+An entry of a CDataRecognitionResultArray object. Stores TDataRecognitionResult and the file name
+in a compact format.
+@internalComponent
+*/
+class CDataRecognitionResultArrayEntry : public CBase
+	{
+public:
+	CDataRecognitionResultArrayEntry(HBufC* aFileName, HBufC8* aDataType, TUid aUid, TInt aConfidence);
+	~CDataRecognitionResultArrayEntry();
+	void GetDataRecognitionResult(TDataRecognitionResult& aResult) const;
+	const TDesC& FileName() const;
+private:
+	HBufC* iFileName;
+	HBufC8* iDataType;
+	TUid iUid;
+	TInt iConfidence;
+	};
+
+//////////////////////////////
+// CAsyncFileRecognition
+//////////////////////////////
+
+CAsyncFileRecognition::CAsyncFileRecognition(CDataRecognitionResultArray& aResult, TRequestStatus& aUsersRequestStatus, CApaLsSessionExtension& aSession)
+	: CActive(EPriorityStandard),
+	  iResult(aResult),
+	  iUsersRequestStatus(aUsersRequestStatus),
+	  iSession(aSession)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+void CAsyncFileRecognition::Start(const TDesC& aPath, const TDesC8& aDataType)
+	{
+	iPath = &aPath;
+	iDataType = &aDataType;
+	iStatus = KRequestPending;
+	iSession.SendReceive(EAppListServRecognizeFilesAsync,TIpcArgs(&aPath,&iRequiredBufferSizePckg,&aDataType),iStatus);
+	SetActive();
+	}
+
+CAsyncFileRecognition::~CAsyncFileRecognition()
+	{
+	Cancel();
+	iPath = NULL;
+	iDataType = NULL;
+	}
+
+void CAsyncFileRecognition::RunL()
+	{
+	iSession.FilesRecognized(*iPath, iRequiredBufferSizePckg(), iResult, iUsersRequestStatus, iStatus);
+	}
+
+void CAsyncFileRecognition::DoCancel()
+	{
+	iSession.SendReceive(ECancelRecognizeFiles,TIpcArgs(TIpcArgs::ENothing));
+	TRequestStatus* status = &iUsersRequestStatus;
+	User::RequestComplete( status, KErrCancel );
+	}
+
+//////////////////////////////
+// CApaLsSessionExtension
+//////////////////////////////
+
+CApaLsSessionExtension::CApaLsSessionExtension(RApaLsSession& aSession)
+	: iSession(aSession),
+	  iAsyncFileRecognition(NULL)
+	{
+	}
+
+CApaLsSessionExtension::~CApaLsSessionExtension()
+	{
+	delete iAsyncFileRecognition;
+	}
+
+void CApaLsSessionExtension::SendReceive(TInt aFunction,const TIpcArgs& aArgs,TRequestStatus& aStatus) const
+	{
+	iSession.SendReceive(aFunction,aArgs,aStatus); //lint !e1060 Suppress protected member is not accessible to non-member non-friend
+	}
+
+TInt CApaLsSessionExtension::SendReceive(TInt aFunction,const TIpcArgs& aArgs) const
+	{
+	return iSession.SendReceive(aFunction,aArgs); //lint !e1060 Suppress protected member is not accessible to non-member non-friend
+	}
+
+/**
+Asynchronous recognition of a directory.
+Function uses an internal CAsyncFileRecognition object to hide the 
+second server message (transferring the data to the client) from the user.
+When the path is not correct or the server is already busy with another 
+recognition request, the function completes the request with an error.
+@internalComponent
+*/
+void CApaLsSessionExtension::RecognizeFilesL(const TDesC& aPath, const TDesC8& aDataType, CDataRecognitionResultArray& aResult, TRequestStatus& aStatus)
+	{
+	_LIT(KBackslash,"\\");
+
+	if(aPath.Right(1) != KBackslash)
+		{
+		TRequestStatus* status = &aStatus;
+		User::RequestComplete(status,KErrPathNotFound);
+		}
+	
+	aResult.SetPath(aPath);
+	aStatus = KRequestPending;
+
+	if(!iAsyncFileRecognition)
+		{
+		iAsyncFileRecognition = new (ELeave) CAsyncFileRecognition(aResult, aStatus, *this);
+		iAsyncFileRecognition->Start(aPath, aDataType);
+		}
+	else
+		{
+		TRequestStatus* status = &aStatus;
+		User::RequestComplete(status,KErrInUse);
+		}
+	}
+
+TBool CApaLsSessionExtension::RecognitionActive() const
+	{
+	return iAsyncFileRecognition ? ETrue : EFalse;
+	}
+
+void CApaLsSessionExtension::CancelRecognizeFiles()
+	{
+	if(iAsyncFileRecognition)
+		{
+		iAsyncFileRecognition->Cancel();
+		delete iAsyncFileRecognition;
+		iAsyncFileRecognition = NULL;
+		}
+	}
+
+void CApaLsSessionExtension::FilesRecognized(const TDesC& aPath, TInt aRequiredBufferSize, CDataRecognitionResultArray& aResult, TRequestStatus& aUsersRequestStatus, const TRequestStatus& aErrorCode)
+/**
+Callback function called by an CAsyncFileRecognition object, when an asynchronous
+recognition has finished. If the recognition was successful, the data is transferred
+to the client-side.
+@internalComponent
+*/
+	{
+	TRequestStatus* status = &aUsersRequestStatus;
+	if(aErrorCode == KErrNone)
+		{
+		// transfer the result
+		TRAPD(error,iSession.TransferAndInternalizeDataL(aPath, aRequiredBufferSize, aResult));
+		User::RequestComplete(status, error);
+		}
+	else
+		{
+		User::RequestComplete(status, aErrorCode.Int());
+		}
+	delete iAsyncFileRecognition;
+	iAsyncFileRecognition = 0;
+	}
+
+
+///////////////////////////////////////
+// CDataRecognitionResultArrayEntry
+///////////////////////////////////////
+
+CDataRecognitionResultArrayEntry::CDataRecognitionResultArrayEntry(HBufC* aFileName, HBufC8* aDataType, TUid aUid, TInt aConfidence)
+	: iFileName(aFileName), 
+	  iDataType(aDataType), 
+	  iUid(aUid), 
+	  iConfidence(aConfidence)
+	{
+	}
+
+CDataRecognitionResultArrayEntry::~CDataRecognitionResultArrayEntry()
+	{
+	delete iFileName;
+	delete iDataType;
+	}
+
+void CDataRecognitionResultArrayEntry::GetDataRecognitionResult(TDataRecognitionResult& aResult) const
+	{
+	TDataRecognitionResult result;
+	if(iDataType->Length() != 0)
+		{
+		TDataType dataType(*iDataType);
+		result.iDataType = dataType;
+		}
+	else
+		{
+		TDataType dataType(iUid);
+		result.iDataType = dataType;
+		}
+	result.iConfidence = iConfidence;
+	aResult = result;
+	}
+
+const TDesC& CDataRecognitionResultArrayEntry::FileName() const
+	{
+	if (iFileName == NULL)
+		return KNullDesC;
+	else
+		return *iFileName;
+	}
+
+
+///////////////////////////////////
+// CDataRecognitionResultArray
+///////////////////////////////////
+
+/**
+Constructor
+@publishedAll
+@released
+*/
+EXPORT_C CDataRecognitionResultArray::CDataRecognitionResultArray()
+	{
+	}
+
+/**
+Destructor
+@publishedAll
+@released
+*/
+EXPORT_C CDataRecognitionResultArray::~CDataRecognitionResultArray()
+	{
+	iEntries.ResetAndDestroy();
+	}
+
+/**
+Returns the path of the recognition results.
+@publishedAll
+@released
+@return The path of the recognition results
+*/
+EXPORT_C const TFileName& CDataRecognitionResultArray::Path() const
+	{
+	return iPath;
+	}
+
+/**
+Returns the number of entries in the CDataRecognitionResultArray.
+@publishedAll
+@released
+@return The number of entries in the CDataRecognitionResultArray.
+*/
+EXPORT_C TUint CDataRecognitionResultArray::Count() const
+	{
+	return iEntries.Count();
+	}
+
+/**
+Returns the recognition result of the given index.
+@publishedAll
+@released
+@param aResult On successful completion, this parameter contains the recognition result at the given index.
+@param aIndex The index of the recognition result to be returned. An invalid index causes
+the function to leave with KErrNotFound.
+@return The requested TDataRecognitionResult object
+@leave KErrNotFound An invalid index is passed
+*/
+EXPORT_C void CDataRecognitionResultArray::GetDataRecognitionResultL(TDataRecognitionResult& aResult, const TUint aIndex) const
+	{
+	if( aIndex >= iEntries.Count() )
+		{
+		User::Leave(KErrNotFound);
+		}
+	iEntries[aIndex]->GetDataRecognitionResult(aResult);
+	}
+
+/**
+Returns the file name of the object at the given index.
+@publishedAll
+@released
+@param aFileName On successful completion, this parameter contains the file name of the object at the given index. 
+@param aIndex Specifies which file name to be returned. An invalid index causes
+the function to leave with KErrNotFound.
+@return The requested file name
+@leave KErrNotFound An invalid index is passed
+*/
+EXPORT_C void CDataRecognitionResultArray::GetFileNameL(TFileName& aFileName, const TUint aIndex) const
+	{
+	if( aIndex >= iEntries.Count() )
+		{
+		User::Leave(KErrNotFound);
+		}
+	aFileName.Zero();
+	aFileName.Copy( (iEntries[aIndex]->FileName()) );
+	}
+
+TUint CDataRecognitionResultArray::InternalizeL(const CBufFlat& aBuffer)
+	{
+	RBufReadStream readStream;
+	
+	readStream.Open(aBuffer);
+	const TInt count=readStream.ReadUint32L();
+	for (TInt i=0; i<count; ++i)
+		{
+		const TInt fileNameLength = readStream.ReadUint8L();
+		HBufC* const fileName = HBufC::NewLC(fileNameLength);
+		TPtr fileNamePtr = fileName->Des();
+		readStream.ReadL(fileNamePtr,fileNameLength);
+
+		const TInt dataTypeLength = readStream.ReadUint8L();
+		HBufC8* const dataType = HBufC8::NewLC(dataTypeLength);
+		TPtr8 dataTypePtr = dataType->Des();
+		readStream.ReadL(dataTypePtr,dataTypeLength);
+
+		TUid uid;
+		uid.iUid = readStream.ReadInt32L();
+		
+		TInt const confidence = readStream.ReadInt32L();
+		
+		CDataRecognitionResultArrayEntry* entry = new (ELeave) CDataRecognitionResultArrayEntry(fileName,dataType,uid,confidence);
+		iEntries.Append(entry);
+		
+		CleanupStack::Pop(dataType);	// ownership was transferred to "entry"
+		CleanupStack::Pop(fileName);	// ownership was transferred to "entry"
+		}
+
+	readStream.Close();
+		
+	return KErrNone;
+	}
+
+void CDataRecognitionResultArray::SetPath(const TFileName& aPath)
+	{
+	iPath.Copy(aPath);
+	}
+
+////////////////////////////////////
+//RApaLsSession
+////////////////////////////////////
+
+EXPORT_C RApaLsSession::RApaLsSession()
+	: iExtension(0)
+	{}
+
+
+
+/** Connects a client to the application architecture server, creating a session 
+with it.
+
+@return KErrNone if successful; otherwise, one of the system-wide error codes. 
+*/
+EXPORT_C TInt RApaLsSession::Connect()
+	{
+	TInt r=CreateSession(KAppListServerName,Version(),KAsyncMessageSlots);
+	return(r); 
+	}
+
+
+
+/** Gets the version of the application architecture server.
+
+@return The version number. 
+*/
+EXPORT_C TVersion RApaLsSession::Version(void) const
+	{
+	return(TVersion(KAppListServMajorVersionNumber,KAppListServMinorVersionNumber,KAppListServBuildVersionNumber));
+	}
+
+
+
+/** Gets the total number of applications.
+
+Control panel applications are excluded.
+
+@param aCount On return, the total number of applications.
+@return KErrNone if successful, otherwise one of the system-wide error codes. 
+*/
+EXPORT_C TInt RApaLsSession::AppCount(TInt& aCount) const
+	{
+	return DoAppCount(aCount,EAppListServAppCount);
+	}
+
+
+
+/** Gets the total number of embeddable applications.
+
+Control panel applications are excluded.
+
+@param aCount On return, the total number of embeddable applications.
+@return KErrNone, if successful, otherwise one of the system-wide error codes. 
+*/
+EXPORT_C TInt RApaLsSession::EmbeddableAppCount(TInt& aCount) const
+	{
+	return DoAppCount(aCount,EAppListServEmbedCount);
+	}
+
+TInt RApaLsSession::DoAppCount(TInt& aCount,TInt aCommand) const
+// returns the number of embeddable apps in the server side list
+	{
+	__ASSERT_DEBUG(aCommand==EAppListServEmbedCount || aCommand==EAppListServAppCount,Panic(EDPanicWrongCommand));
+	const TInt returnValue=SendReceiveWithReconnect(aCommand,TIpcArgs());
+	if (returnValue<0)
+		{
+		return returnValue;
+		}
+	aCount=returnValue;
+	return KErrNone;
+	}
+
+
+
+/** Initialises the process of getting all applications in the cached list.
+
+Control panel applications are excluded.
+
+A call to this function is followed by subsequent and repeated calls to GetNextApp() 
+to retrieve all applications in the cached list.
+
+@return KErrNone, if successful, otherwise one of the system-wide error codes. 
+*/
+EXPORT_C TInt RApaLsSession::GetAllApps() const
+	{
+	return GetAllApps(0);
+	}
+
+
+
+/** Initialises the process of getting all applications in the cached list.
+
+Control panel applications are excluded.
+
+A call to this function is followed by subsequent and repeated calls to GetNextApp() 
+to retrieve all applications supporting aScreenMode in the cached list.
+
+@param aScreenMode Only applications which define a view supporting aScreenMode
+will be returned by subsequent calls to GetNextApp(). If an application does not
+define views in it's application information file, only screen mode 0 is supported.
+@return KErrNone, if successful, otherwise one of the system-wide error codes. 
+*/
+EXPORT_C TInt RApaLsSession::GetAllApps(TInt aScreenMode) const
+	{
+	return GetFilteredApps(TApaAppCapability::EControlPanelItem, 0, aScreenMode); // exclude control panel apps
+	}
+
+
+
+/** Initialises the process of getting all embeddable applications from the cached list.
+
+Control panel applications are excluded.
+
+A call to this function is followed by subsequent and repeated calls to GetNextApp() 
+to retrieve embeddable applications in the cached list.
+
+Only applications which specify KAppEmbeddable or KAppEmbeddableOnly in their
+application information file will be returned by subsequent calls to GetNextApp().
+
+@return KErrNone, if successful, otherwise one of the system-wide error codes. 
+*/
+EXPORT_C TInt RApaLsSession::GetEmbeddableApps() const
+	{
+	return GetEmbeddableApps(0);
+	}
+
+
+
+/** Initialises the process of getting embeddable applications from the cached list
+that support the specified screen mode.
+
+Control panel applications are excluded.
+
+A call to this function is followed by subsequent and repeated calls to GetNextApp() 
+to retrieve embeddable applications in the cached list.
+
+Only applications which specify KAppEmbeddable or KAppEmbeddableOnly in their
+application information file will be returned by subsequent calls to GetNextApp().
+
+@param aScreenMode Only embeddable applications which define a view supporting
+aScreenMode will be returned by subsequent calls to GetNextApp(). If an application
+does not define views in it's application information file, only screen mode 0 is supported.
+@return KErrNone, if successful, otherwise one of the system-wide error codes. 
+*/
+EXPORT_C TInt RApaLsSession::GetEmbeddableApps(TInt aScreenMode) const
+	{
+	TApaEmbeddabilityFilter filter;
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddable);
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddableOnly);
+	return GetFilteredApps(filter, aScreenMode);
+	}
+
+
+
+/** Initialises the process of getting all applications matching aFilter in the
+cached list.
+
+Control panel applications are excluded.
+
+A call to this function is followed by subsequent and repeated calls to GetNextApp() 
+to retrieve all applications matching aFilter in the cached list.
+
+@param aFilter Defines the filter to be applied to the cached list.
+@return KErrNone, if successful, otherwise one of the system-wide error codes. 
+*/
+EXPORT_C TInt RApaLsSession::GetFilteredApps(const TApaEmbeddabilityFilter& aFilter) const
+	{
+	return GetFilteredApps(aFilter, 0);
+	}
+
+
+
+/** Initialises the process of getting all applications matching aFilter in the
+cached list.
+
+Control panel applications are excluded.
+
+A call to this function is followed by subsequent and repeated calls to GetNextApp() 
+to retrieve all applications matching aFilter in the cached list.
+
+@param aFilter Defines the filter to be applied to the cached list.
+@param aScreenMode Only applications which define a view supporting aScreenMode
+will be returned by subsequent calls to GetNextApp(). If an application does not
+define views in it's application information file, only screen mode 0 is supported.
+@return KErrNone, if successful, otherwise one of the system-wide error codes. 
+*/
+EXPORT_C TInt RApaLsSession::GetFilteredApps(const TApaEmbeddabilityFilter& aFilter, TInt aScreenMode) const
+	{
+	const TPckgC<TApaEmbeddabilityFilter> filter(aFilter);
+	return SendReceiveWithReconnect(EAppListServInitFilteredEmbedList,TIpcArgs(aScreenMode,&filter));
+	}
+
+
+
+/** Initialises the process of getting all applications matching the specified
+application attributes.
+
+A call to this function is followed by subsequent and repeated calls to GetNextApp() 
+to retrieve all applications matching the filter in the cached list.
+
+Attributes are defined by TApaAppCapability::TCapabilityAttribute
+
+@param aCapabilityAttributeMask Specifies the attributes whose values will be
+used to filter the cached list. If the mask specifies more than one attribute,
+all associated attribute values must match.
+@param aCapabilityAttributeValue Specifies the attribute values for each attribute
+identified by the mask.
+@return KErrNone, if successful, otherwise one of the system-wide error codes.
+@see TCapabilityAttribute 
+*/
+EXPORT_C TInt RApaLsSession::GetFilteredApps(TUint aCapabilityAttributeMask, TUint aCapabilityAttributeValue) const
+	{
+	return GetFilteredApps(aCapabilityAttributeMask, aCapabilityAttributeValue, 0);
+	}
+
+
+
+/** Initialises the process of getting all applications matching the specified
+application attributes.
+
+A call to this function is followed by subsequent and repeated calls to GetNextApp() 
+to retrieve all applications matching the filter in the cached list.
+
+Attributes are defined by TApaAppCapability::TCapabilityAttribute
+
+@param aCapabilityAttributeMask Specifies the attributes whose values will be
+used to filter the cached list. If the mask specifies more than one attribute,
+all associated attribute values must match.
+@param aCapabilityAttributeValue Specifies the attribute values for each attribute
+identified by the mask.
+@param aScreenMode Only applications which define a view supporting aScreenMode
+will be returned by subsequent calls to GetNextApp(). If an application does not
+define views in it's application information file, only screen mode 0 is supported.
+@return KErrNone, if successful, otherwise one of the system-wide error codes.
+@see TCapabilityAttribute 
+*/
+EXPORT_C TInt RApaLsSession::GetFilteredApps(TUint aCapabilityAttributeMask, TUint aCapabilityAttributeValue, TInt aScreenMode) const
+	{
+	return SendReceiveWithReconnect(EAppListServInitAttrFilteredList,TIpcArgs(aScreenMode, aCapabilityAttributeMask, aCapabilityAttributeValue));
+	}
+
+
+
+/** Initialises the process of getting server applications in the cached list.
+
+Control panel applications are excluded.
+
+A call to this function is followed by subsequent and repeated calls to GetNextApp() 
+to retrieve server applications in the cached list.
+
+Only applications which specify one or more services in their application
+information file will be returned by subsequent calls to GetNextApp().
+
+@return KErrNone, if successful, otherwise one of the system-wide error codes.
+@publishedPartner
+@released
+*/
+EXPORT_C TInt RApaLsSession::GetServerApps(TUid aServiceUid) const
+	{
+	return GetServerApps(aServiceUid, 0);
+	}
+
+
+
+/** Initialises the process of getting server applications in the cached list.
+
+Control panel applications are excluded.
+
+A call to this function is followed by subsequent and repeated calls to GetNextApp() 
+to retrieve server applications in the cached list.
+
+Only applications which specify one or more services in their application
+information file will be returned by subsequent calls to GetNextApp().
+
+@param aScreenMode Only server applications which define a view supporting
+aScreenMode will be returned by subsequent calls to GetNextApp(). If an application
+does not define views in its application information file, only screen mode 0 is supported.
+@return KErrNone, if successful, otherwise one of the system-wide error codes.
+@publishedPartner
+@released
+*/
+EXPORT_C TInt RApaLsSession::GetServerApps(TUid aServiceUid, TInt aScreenMode) const
+	{
+	return SendReceiveWithReconnect(EAppListServInitServerAppList,TIpcArgs(aScreenMode, aServiceUid.iUid));
+	}
+
+
+
+/** Gets information about the next application or embeddable application from 
+the cached list.
+
+A sequence of calls to this function must always be preceded by a call to 
+one of GetAllApps(), GetEmbeddableApps() or GetFilteredApps().
+
+@param aInfo On return, contains application information.
+@return KErrNone if successful; ENoMoreAppsInList, if there are no more applications 
+in the list; EAppListInvalid if the server's initial population of the list has
+not completed; otherwise one of the other system wide error codes. 
+*/
+EXPORT_C TInt RApaLsSession::GetNextApp(TApaAppInfo& aInfo) const
+	{
+	return GetNextApp(aInfo,0);
+	}
+
+
+
+/** Gets information about the next application or embeddable application from 
+the cached list.
+
+A sequence of calls to this function must always be preceded by a call to 
+one of GetAllApps(), GetEmbeddableApps() or GetFilteredApps().
+
+@param aInfo On return, contains application information.
+@param aScreenMode This parameter is ignored.
+@return KErrNone if successful; ENoMoreAppsInList, if there are no more applications 
+in the list; EAppListInvalid if the server's initial population of the list has
+not completed; otherwise one of the other system wide error codes. 
+*/
+EXPORT_C TInt RApaLsSession::GetNextApp(TApaAppInfo& aInfo,TInt aScreenMode) const
+	{
+	TPckg<TApaAppInfo> info(aInfo);
+	TInt ret=SendReceiveWithReconnect(EAppListServGetNextApp,TIpcArgs(aScreenMode,&info));
+	if (ret==KErrNone)
+		aInfo = info();
+	else if (ret==KErrNotFound)
+		ret = ENoMoreAppsInList;
+	else if (ret==KErrCorrupt)
+		ret = EAppListInvalid;
+	return ret;
+	}
+
+
+
+/** Gets information about the application with the specified UID.
+
+@param aInfo On return, contains the application information, if an application 
+with the specified UID is found. If no matching application is found, then 
+this object is not changed.
+@param aAppUid The application specific UID.
+@return KErrNone if successful; KErrNotFound if a matching entry could not be found; 
+otherwise one of the other system wide error codes. 
+*/
+EXPORT_C TInt RApaLsSession::GetAppInfo(TApaAppInfo& aInfo,TUid aAppUid) const
+	{
+	TPckg<TApaAppInfo> info(aInfo);
+	return SendReceiveWithReconnect(EAppListServGetAppInfo,TIpcArgs(aAppUid.iUid,&info));
+	} //lint !e1764 Suppress reference parameter 'aInfo' could be declared const ref
+	
+/** Sets the short caption of the application.
+
+Overrides the short caption specified in the localizable resource file for this application.
+Short captions set using this API will only take effect until the next device reset.
+
+@param aShortCaption The short caption of the application. The maximum length allowed is KApaMaxAppCaption.
+@param aLanguage The language corresponding to the caption. If this is ELangNone the caption is used
+for all languages for which a language specific short caption has not been set.
+@param aAppUid The uid of the application.
+@return KErrNone if successful, otherwise one of the system wide error codes.
+*/ 
+EXPORT_C TInt RApaLsSession::SetAppShortCaption(const TDesC& aShortCaption, TLanguage aLanguage, TUid aAppUid)
+	{
+	if (aShortCaption.Length() > KApaMaxAppCaption || aShortCaption.Length() == 0)
+		{
+		return KErrArgument;
+		}
+	return SendReceiveWithReconnect(EAppListServSetAppShortCaption, TIpcArgs(aAppUid.iUid, &aShortCaption, aLanguage));
+	} //lint !e1762 Suppress member function could be made const
+
+/** Gets the default screen-number of the application with the specified UID.
+
+@param aDefaultScreenNumber On return, contains the default screen-number, if an application 
+with the specified UID is found. If no matching application is found, then 
+this object is not changed.
+@param aAppUid The application specific UID.
+@return KErrNone if successful; KErrNotFound if a matching entry could not be found; 
+otherwise one of the other system wide error codes. 
+*/
+EXPORT_C TInt RApaLsSession::GetDefaultScreenNumber(TInt& aDefaultScreenNumber, TUid aAppUid) const
+	{
+	const TInt result=SendReceiveWithReconnect(EAppListServGetDefaultScreenNumber, TIpcArgs(aAppUid.iUid));
+	if (result<0)
+		{
+		return result;
+		}
+	aDefaultScreenNumber=result;
+	return KErrNone;
+	}
+
+
+/** Gets the capabilities of the application with the specified UID.
+
+@param aCapabilityBuf A modifiable descriptor that, on return, contains the 
+application's capability information. The data returned in the descriptor 
+is mapped by the TApaAppCapability class. If no matching application is found, 
+then the content of this descriptor is not changed.
+@param aAppUid The application specific UID.
+@return KErrNone, if successful; KErrNotFound, if no matching entry can be found; otherwise 
+one of the other system wide error codes. 
+*/
+EXPORT_C TInt RApaLsSession::GetAppCapability(TDes8& aCapabilityBuf,TUid aAppUid) const
+	{
+	return SendReceiveWithReconnect(EAppListServGetAppCapability,TIpcArgs(&aCapabilityBuf,aAppUid.iUid));
+	}
+
+
+
+/** Starts an application defined by the specified command line information.
+    This is an asynchronous method which doesn't wait for the process creation to complete.
+    To be informed of the process creation success, 
+    then appropriate overloaded method taking a TRequestStatus parameter should be used.
+    
+This is only recommended for non document based applications.
+
+View based applications are usually started by activating a specific view 
+using CCoeAppUi::ActivateViewL. Alternatively, using StartApp() to start a 
+view based application will activate the application's default view.
+
+@param aCommandLine The command line.
+@return KErrNone, if successful; KErrNotFound, if the application cannot be 
+found; otherwise one of the other system-wide error codes. 
+@see CCoeAppUi::ActivateViewL() 
+*/
+EXPORT_C TInt RApaLsSession::StartApp(const CApaCommandLine& aCommandLine)
+	{
+	return DoStartApp(aCommandLine, NULL,NULL);
+	}
+	
+/** Starts an application defined by the specified command line information.
+    This is an asynchronous method which doesn't wait for the process creation to complete.
+    To be informed of the process creation success, 
+    then appropriate overloaded method taking a TRequestStatus parameter should be used.
+
+This is only recommended for non document based applications.
+
+View based applications are usually started by activating a specific view 
+using CCoeAppUi::ActivateViewL. Alternatively, using StartApp() to start a 
+view based application will activate the application's default view.
+
+@param aCommandLine The command line.
+@param aThreadId On return, the id of the main thread started.
+@return KErrNone, if successful; KErrNotFound, if the application cannot be 
+found; otherwise one of the other system-wide error codes. 
+@see CCoeAppUi::ActivateViewL() 
+*/	
+EXPORT_C TInt RApaLsSession::StartApp(const CApaCommandLine& aCommandLine,TThreadId& aThreadId)
+	{
+	return DoStartApp(aCommandLine, &aThreadId,NULL);
+	}
+
+	
+/** Starts an application defined by the specified command line information.
+
+This is only recommended for non document based applications.
+
+View based applications are usually started by activating a specific view 
+using CCoeAppUi::ActivateViewL. Alternatively, using StartApp() to start a 
+view based application will activate the application's default view.
+
+@param aCommandLine The command line.
+@param aThreadId On return, the id of the main thread started.
+@param aRequestStatusForRendezvous If not NULL, the asynchronous RProcess::Rendezvous() 
+function is called (being passed this TRequestStatus object) before RProcess::Resume() is called on 
+the new application process. If this function does not return KErrNone, RProcess::Rendezvous() will
+not be called passing aRequestStatusForRendezvous, so in this case the caller must not wait
+on aRequestStatusForRendezvous.
+@return KErrNone, if successful; KErrNotFound, if the application cannot be 
+found; otherwise one of the other system-wide error codes. 
+@see CCoeAppUi::ActivateViewL() 
+*/
+EXPORT_C TInt RApaLsSession::StartApp(const CApaCommandLine& aCommandLine,TThreadId& aThreadId,TRequestStatus* aRequestStatusForRendezvous )
+	{
+	return DoStartApp(aCommandLine, &aThreadId,aRequestStatusForRendezvous);
+	}
+
+
+TInt RApaLsSession::DoStartApp(const CApaCommandLine& aCommandLine, TThreadId* aThreadId,TRequestStatus* aRequestStatusForRendezvous)
+	{
+	TRAPD(error, DoStartAppL(aCommandLine, aThreadId, aRequestStatusForRendezvous));
+	return error;
+	}
+
+void RApaLsSession::DoStartAppL(const CApaCommandLine& aCommandLine, TThreadId* aThreadId,TRequestStatus* aRequestStatusForRendezvous)
+	{
+	// This function does not require "this" object to be connected to the Apparc server,
+	// but if not, it works with some limitations (see the following document for a list
+	// of these limitations: 
+	// generic/app-framework/Documentation/PREQ967_solution_constraints.doc).
+
+#if defined(USE_IH_RAISE_EVENT)
+	const TInt appStartupInstrumentationEventIdBase=aCommandLine.AppStartupInstrumentationEventIdBase();
+	if (appStartupInstrumentationEventIdBase!=0)
+		{
+		IH_DECLARE( lInstrumentationHandler );
+		IH_CREATE( lInstrumentationHandler );
+		IH_RAISE_EVENT( lInstrumentationHandler, appStartupInstrumentationEventIdBase+MTestInstrumentation::TIDOffsetBeginApplicationFirstRedraw );
+		IH_RAISE_EVENT( lInstrumentationHandler, appStartupInstrumentationEventIdBase+MTestInstrumentation::TIDOffsetBeginApplicationReadyForInput );
+		IH_DELETE( lInstrumentationHandler );
+		}
+#endif
+
+ 	// Retrieve the executable name from the CApaCommandLine object passed in.
+	const TPtrC logicalExecutableName(aCommandLine.ExecutableName());
+	// Rule-based app launching is not allowed unless there is a connected RApaLsSession object.
+	if(Handle() != KNullHandle)
+		{
+		// requesting from rule-based plug-ins if we can run an application 
+		// if server fails while requested rule-based plug-ins it returns a negative value - proceed with launching the application in this case
+		TBool okayToRun = SendReceiveWithReconnect(EAppListServRuleBasedLaunching, TIpcArgs(&logicalExecutableName));
+		if(!okayToRun)
+			{
+			User::Leave(KErrCancel);
+			}
+		}
+
+	TFileName nativeExecutableNameOfNonNativeApplication;
+	RProcess process;
+	HBufC8* opaqueData=NULL;
+	CleanupStack::PushL(TCleanupItem(DeletePointerToPointerToTAny, &opaqueData));
+
+	// if we're connected to the Apparc server, try to get the opaque-data and native-executable name
+	// (the latter is only if it's a non-native application that we're launching)
+	if (Handle()!=KNullHandle)
+		{
+		const TInt lengthOfOpaqueData=User::LeaveIfError(SendReceiveWithReconnect(EAppListServGetNativeExecutableNameIfNonNative, TIpcArgs(&nativeExecutableNameOfNonNativeApplication, &logicalExecutableName)));
+		if (lengthOfOpaqueData>0)
+			{
+			User::LeaveIfError(GetOpaqueData(opaqueData, lengthOfOpaqueData));
+			}
+		}
+
+	// try first to create the application process without interacting with the Apparc server at all - 
+	// assumes "logicalExecutableName" is itself a native executable
+	TUidType uidType(KNullUid, KNullUid, KNullUid);
+	TInt err = process.CreateWithStackOverride(logicalExecutableName, KNullDesC, uidType, MinApplicationStackSize(), EOwnerProcess);
+	 
+	// If we haven't been able to create the process using the native executable name from the command line
+	// object, instead try to create it using the native executable name of the non-native application.
+	// Can only do this if apparc is connected and thus this name has been retrieved above and 
+	// nativeExecutableNameOfNonNativeApplication populated.
+	if ((err != KErrNone) && nativeExecutableNameOfNonNativeApplication.Length()>0)
+			{
+			err = process.CreateWithStackOverride(nativeExecutableNameOfNonNativeApplication, KNullDesC, uidType, MinApplicationStackSize(), EOwnerProcess);
+			}
+
+	// if we managed to create the process via either of the two methods attempted above (with the native 
+	// name or the native name of the non-native app), finish setting it up and "resume" it
+	if (err == KErrNone)
+		{
+		CleanupStack::PushL(TCleanupItem(CleanupOperation, &process));
+		if (opaqueData!=NULL)
+			{
+			const_cast<CApaCommandLine&>(aCommandLine).SetOpaqueDataL(*opaqueData);
+			}
+		aCommandLine.SetProcessEnvironmentL(process);
+		if (aThreadId!=NULL)
+			{
+			GetThreadIdL(*aThreadId, process);
+			}
+		if (aRequestStatusForRendezvous!=NULL)
+			{
+			process.Rendezvous(*aRequestStatusForRendezvous);
+			}
+		// Note - must not leave between here and the end of this method because we only expect
+		// the caller to wait on aRequestStatusForRendezvous if this method does not leave.
+		if(aRequestStatusForRendezvous != NULL && *aRequestStatusForRendezvous != KRequestPending)
+			{
+			User::WaitForRequest(*aRequestStatusForRendezvous);
+			User::Leave(aRequestStatusForRendezvous->Int()); // item on cleanupstack terminates and closes the process
+			}
+		else
+			{
+			process.Resume();	
+			}
+		CleanupStack::Pop(&process);	
+		process.Close();
+		}
+	else // Couldn't create a process
+		{
+		if (Handle()==KNullHandle) // not connected to apparc
+			{
+			const TPtrC executableName(aCommandLine.ExecutableName());
+			
+			// Java applications have an empty ExecutableName, as they use the CApaCommandLine's
+			// opaque-data attribute. Not connected to apparc so can't start a non-native app.
+			// Therefore we should handle this case with KErrNotSupported rather than whatever
+			// RProcess::Create returns when passed an empty descriptor.  
+			if (executableName.Length() == 0)
+				{
+				User::Leave(KErrNotSupported);
+				}
+				
+			// Otherwise return the error code from RProcess::Create.
+			User::Leave(err);
+			
+			}
+		else // Handle()!=KNullHandle
+			{
+			// we can only proceed with the remaining option if we're connected to the Apparc server	
+			// as a last resort, try use the legacy file-recognizer framework to launch the application
+			TThreadId dummyThreadId;
+			TPckg<TThreadId> threadId((aThreadId!=NULL)? *aThreadId: dummyThreadId);
+			const TInt opcode=(aThreadId==NULL)?
+									EAppListServStartAppWithoutReturningThreadId:
+									EAppListServStartAppReturningThreadId;
+			TIpcArgs ipcArgs;
+			aCommandLine.GetIpcArgsLC(ipcArgs);
+			if (aThreadId!=NULL)
+				{
+				ipcArgs.Set(CApaCommandLine::EIpcFirstFreeSlot, &threadId);
+				}
+			User::LeaveIfError(SendReceiveWithReconnect(opcode, ipcArgs));
+			if (aRequestStatusForRendezvous!=NULL)
+				{
+				User::RequestComplete(aRequestStatusForRendezvous,KErrNone);
+				}
+			CleanupStack::PopAndDestroy(); // the TIpcArgs
+			}
+		}
+	CleanupStack::PopAndDestroy(&opaqueData);
+	} //lint !e1762 Suppress member function could be made const
+	
+void RApaLsSession::CleanupOperation(TAny* aAny)
+	{
+	RProcess* activeProcess = reinterpret_cast<RProcess*>(aAny);	
+	activeProcess->Terminate(KErrGeneral);
+	activeProcess->Close();
+	}
+	
+void RApaLsSession::GetThreadIdL(TThreadId& aThreadId, const RProcess& aProcess)
+	{ // static
+	TFullName fullName(aProcess.Name());
+	_LIT(KCCMain,"::Main");
+	fullName.Append(KCCMain);
+	RThread thread;
+	User::LeaveIfError(thread.Open(fullName,EOwnerThread));
+	aThreadId=thread.Id();
+	thread.Close();
+	}
+
+void RApaLsSession::DeletePointerToPointerToTAny(TAny* aPointerToPointerToTAny)
+	{ // static
+	__ASSERT_ALWAYS(aPointerToPointerToTAny, Panic(EPanicNullPointer));
+	delete *static_cast<TAny**>(aPointerToPointerToTAny); //lint !e613 Suppress possible use of null pointer
+	} //lint !e818 Suppress pointer parameter could be declared as pointing to const
+
+/**
+Sets up slots 0 and 1 in aIpcArgs - assumes that slots 2 and 3 have already been set up; 
+it then invokes aOpcode
+*/
+TInt RApaLsSession::GetExecutableName(TDes& aNativeExecutableName, TDes& aLogicalExecutableName, HBufC8*& aOpaqueData, TIpcArgs& aIpcArgs, TInt aOpcode) const
+	{
+	aNativeExecutableName.SetLength(0); // if this comes out zero-length from EAppListServExecutableNameForXxx below then use the logicalExecutableName in RProcess::Create (in this case it's a native C++ application)
+	aIpcArgs.Set(0, &aNativeExecutableName);
+	aIpcArgs.Set(1, &aLogicalExecutableName);
+	const TInt lengthOfOpaqueData=SendReceiveWithReconnect(aOpcode, aIpcArgs);
+	if (lengthOfOpaqueData<0)
+		{
+		return lengthOfOpaqueData; // it's an error code
+		}
+	if (lengthOfOpaqueData>0)
+		{
+		return GetOpaqueData(aOpaqueData, lengthOfOpaqueData);
+		}
+	aOpaqueData=NULL;
+	return KErrNone;
+	}
+
+TInt RApaLsSession::GetOpaqueData(HBufC8*& aOpaqueData, TInt aLengthOfOpaqueData) const
+	{
+	HBufC8* const opaqueData=HBufC8::New(aLengthOfOpaqueData);
+	if (opaqueData==NULL)
+		{
+		return KErrNoMemory;
+		}
+	TPtr8 opaqueData_asWritable(opaqueData->Des());
+	const TInt error=SendReceiveWithReconnect(EAppListServGetOpaqueData, TIpcArgs(&opaqueData_asWritable));
+	if (error!=KErrNone)
+		{
+		delete opaqueData;
+		return error;
+		}
+	aOpaqueData=opaqueData;
+	return error;
+	}
+
+TInt RApaLsSession::StartApplicationPassingFileHandle(const TDesC& aNativeExecutableName, const TDesC& aLogicalExecutableName, const TDesC8* aOpaqueData, const RFile& aFile, TThreadId& aThreadId, TRequestStatus* aRequestStatusForRendezvous)
+	{
+	TFileName documentName;
+	aFile.FullName(documentName);
+	CApaCommandLine* commandLine=NULL;	
+	TRAPD(error, commandLine=CApaCommandLine::NewLC();
+			commandLine->SetCommandL(EApaCommandOpen);
+			commandLine->SetExecutableNameL(aLogicalExecutableName);
+			commandLine->SetFileByHandleL(aFile);
+			commandLine->SetDocumentNameL(documentName);
+			if (aOpaqueData!=NULL)
+				{
+				commandLine->SetOpaqueDataL(*aOpaqueData);
+				}
+			StartApplicationL(aNativeExecutableName, *commandLine, aThreadId, aRequestStatusForRendezvous);
+			CleanupStack::PopAndDestroy(commandLine));
+	return error;
+	}
+	
+TInt RApaLsSession::StartApplicationPassingDocumentName(const TDesC& aNativeExecutableName, const TDesC& aLogicalExecutableName, const TDesC8* aOpaqueData, const TDesC& aDocumentName, TThreadId& aThreadId,TApaCommand aCommand, TRequestStatus* aRequestStatusForRendezvous)
+	{
+	CApaCommandLine* commandLine=NULL;
+	TRAPD(error, commandLine=CApaCommandLine::NewLC();
+			commandLine->SetCommandL(aCommand);
+			commandLine->SetExecutableNameL(aLogicalExecutableName);
+			commandLine->SetDocumentNameL(aDocumentName);
+			if (aOpaqueData!=NULL)
+				{
+				commandLine->SetOpaqueDataL(*aOpaqueData);
+				}
+			StartApplicationL(aNativeExecutableName, *commandLine, aThreadId, aRequestStatusForRendezvous);
+			CleanupStack::PopAndDestroy(commandLine));
+	return error;
+	}
+
+void RApaLsSession::StartApplicationL(const TDesC& aNativeExecutableName, const CApaCommandLine& aCommandLine, TThreadId& aThreadId, TRequestStatus* aRequestStatusForRendezvous)
+	{ 
+	RProcess process;
+	TPtrC actualNativeExecutableName(aNativeExecutableName);
+	if (actualNativeExecutableName.Length()==0)
+		{
+		actualNativeExecutableName.Set(aCommandLine.ExecutableName()); // it's a native C++ application, rather than a MIDlet, Python script, etc
+		}
+
+	if(Handle() != KNullHandle)
+		{
+		//requesting from rule-based plug-ins if we can run an application 
+		TBool okayToRun = SendReceiveWithReconnect(EAppListServRuleBasedLaunching, TIpcArgs(&actualNativeExecutableName));
+		//If server fails while requested rule-based plug-ins it returns a negative value. 
+		//We shall proceed with launching an application in this case.
+		if(!okayToRun)
+			{
+			User::Leave(KErrCancel); 
+			}
+		}
+
+	TUidType uidType(KNullUid, KNullUid, KNullUid);
+	User::LeaveIfError(process.CreateWithStackOverride(actualNativeExecutableName, KNullDesC, uidType, MinApplicationStackSize(), EOwnerProcess)); // RProcess::CreateWithStackOveride - TESTED
+		
+	CleanupClosePushL(process);
+	aCommandLine.SetProcessEnvironmentL(process);
+	GetThreadIdL(aThreadId, process);
+	if (aRequestStatusForRendezvous!=NULL)
+		{
+		process.Rendezvous(*aRequestStatusForRendezvous);
+		}
+	process.Resume();
+	CleanupStack::PopAndDestroy(&process);
+	} //lint !e1762 Suppress member function could be made const
+
+
+
+/** Gets the data (MIME) type for data taken from a file with a specified name.
+
+@param aName The full filename, including drive and path, of the file containing the data.
+@param aBuffer A buffer containing data taken from the specified file; typically 
+the data is read from the beginning of the file.
+@param aDataType On return, contains the result of the attempt to recognize 
+data. 
+@return KErrNone, if successful; otherwise one of the other system-wide error 
+codes. 
+*/
+EXPORT_C TInt RApaLsSession::RecognizeData(const TDesC& aName, const TDesC8& aBuffer, TDataRecognitionResult& aDataType) const
+	{
+	TPckg<TDataRecognitionResult> result(aDataType);
+	return SendReceiveWithReconnect(EAppListServRecognizeData,TIpcArgs(&result, &aName, &aBuffer));
+	} //lint !e1764: Suppress reference parameter could be declared const ref
+
+/** Gets the data (MIME) type for data in a file passed by handle.
+
+@param aFile The file containing the data. Before this function can be called,
+the file server session which owns this file handle must first be marked as shareable by 
+calling RFs::ShareProtected().
+@param aDataType On return, contains the result of the attempt to recognize 
+data. 
+@return KErrNone, if successful; otherwise one of the other system-wide error 
+codes. */
+EXPORT_C TInt RApaLsSession::RecognizeData(const RFile& aFile, TDataRecognitionResult& aDataType) const
+	{
+	TPckg<TDataRecognitionResult> result(aDataType);
+	TIpcArgs ipcArgs(&result);
+	const TInt error = aFile.TransferToServer(ipcArgs, 1, 2);
+	if (error != KErrNone)
+		{
+		return error;
+		}
+	return SendReceiveWithReconnect(EAppListServRecognizeDataPassedByFileHandle,ipcArgs);
+	} //lint !e1764 Suppress reference parameter 'aDataType' could be declared const ref
+
+
+
+/** Tests whether data taken from a named file has the specified 
+data (MIME) type.
+
+@param aName The name of the file containing the data.
+@param aBuffer A buffer containing data taken from the specified file; typically 
+the data is read from the beginning of the file.
+@param aDataType The data (MIME) type.
+@param aResult On return, contains the result of the test.
+@return KErrNone, if successful; otherwise one of the other system-wide error 
+codes. 
+*/
+EXPORT_C TInt RApaLsSession::RecognizeSpecificData(const TDesC& aName, const TDesC8& aBuffer, const TDataType& aDataType, TBool& aResult) const
+	{
+	const TPckgC<TDataType> dataType(aDataType);
+	const TInt returnValue=SendReceiveWithReconnect(EAppListServRecognizeSpecificData,TIpcArgs(&dataType, &aName, &aBuffer));
+	if (returnValue<0)
+		{
+		return returnValue;
+		}
+	aResult=returnValue;
+	return KErrNone;
+	}
+	
+EXPORT_C TInt RApaLsSession::RecognizeFilesL(const TDesC& aPath, CDataRecognitionResultArray& aResult) const
+/** 
+Gets the data (MIME) type for files in a specified directory. Because this call may take a long
+time to complete, the asynchronous version is strongly recommended. Furthermore, it is not possible
+to use this synchronous function while an asynchronous request is still active.
+@publishedAll
+@released
+@param aPath A valid path. Note that the path must end with a backslash.
+@param aResult If the call was successful, this parameter contains the recognition result.
+@return KErrNone, if successful; otherwise one of the other system-wide error codes.
+*/
+	{
+	return RecognizeFilesL(aPath, KAllDataTypes, aResult);
+	}
+
+EXPORT_C TInt RApaLsSession::RecognizeFilesL(const TDesC& aPath, const TDesC8& aDataType, CDataRecognitionResultArray& aResult) const
+/** 
+Gets the data (MIME) type for files in a specified directory. Because this call may take a long
+time to complete, the asynchronous version is strongly recommended. Furthermore, it is not possible
+to use this synchronous function while an asynchronous request is still active.
+@publishedAll
+@released
+@param aPath A valid path. Note that the path must end with a backslash.
+@param aDataType A data type filter. Wildcards are allowed. For example, "text*" would also
+add "text/plain" data types to the result.
+@param aResult If the call was successful, this parameter contains the recognition result.
+@return KErrNone, if successful; otherwise one of the other system-wide error codes.
+*/
+	{
+	if(iExtension && iExtension->RecognitionActive())
+		{
+		return KErrInUse;
+		}
+	_LIT(KBackslash,"\\");
+	if(aPath.Right(1) != KBackslash)
+		{
+		return KErrPathNotFound;
+		}
+
+	TPckgBuf<TUint> requiredBufferSizePckg;
+	aResult.SetPath(aPath);
+	TInt error = SendReceiveWithReconnect(EAppListServRecognizeFiles,TIpcArgs(&aPath,&requiredBufferSizePckg,&aDataType));
+	if(KErrNone == error)
+		{
+		error=TransferAndInternalizeDataL(aPath, requiredBufferSizePckg(), aResult);
+		}
+	return error;
+
+	}
+
+EXPORT_C void RApaLsSession::RecognizeFilesL(const TDesC& aPath, CDataRecognitionResultArray& aResult, TRequestStatus& aStatus)
+/** 
+Gets the data (MIME) type for files in a specified directory.
+@publishedAll
+@released
+@param aPath A valid path. Note that the path must end with a backslash.
+@param aResult If the call was successful, this parameter contains the recognition result.
+@param aStatus A request status object.
+*/
+	{
+	RecognizeFilesL(aPath,KAllDataTypes,aResult,aStatus);
+	}
+
+EXPORT_C void RApaLsSession::RecognizeFilesL(const TDesC& aPath, const TDesC8& aDataType, CDataRecognitionResultArray& aResult, TRequestStatus& aStatus)
+/** 
+Gets the data (MIME) type for files in a specified directory.
+@publishedAll
+@released
+@param aPath A valid path. Note that the path must end with a backslash.
+@param aDataType A data type filter. Wildcards are allowed. For example, "text*" would also
+add "text/plain" data types to the result.
+@param aResult If the call was successful, this parameter contains the recognition result.
+@param aStatus A request status object
+*/
+	{
+	if(iExtension == NULL)
+		{
+		iExtension = new (ELeave) CApaLsSessionExtension(*this);
+		}
+	iExtension->RecognizeFilesL(aPath, aDataType, aResult, aStatus);
+	}
+
+TInt RApaLsSession::TransferAndInternalizeDataL(const TDesC& aPath, const TInt aRequiredBufferSize, CDataRecognitionResultArray& aResult) const
+/**
+This function transfers the data to the client-side and "fills" the CDataRecognitionResultArray object. 
+@internalComponent
+*/
+{
+	CBufFlat* const buffer=CBufFlat::NewL(aRequiredBufferSize);
+	CleanupStack::PushL(buffer);
+	buffer->ExpandL(0,aRequiredBufferSize);
+	TPtr8 bufPtr=buffer->Ptr(0);
+
+	// transfer recognition buffer
+	TInt error = SendReceiveWithReconnect(EAppListServTransferRecognitionResult,TIpcArgs(&aPath,&bufPtr,aRequiredBufferSize));
+	if(KErrNone == error)
+		{
+		error = aResult.InternalizeL(*buffer);
+		}
+	CleanupStack::PopAndDestroy(buffer);
+	return error;
+	}
+
+EXPORT_C void RApaLsSession::CancelRecognizeFiles()
+/** 
+Cancels any outstanding asynchronous recognition requests.
+@publishedAll
+@released
+*/
+	{
+	if(iExtension)
+		{
+		iExtension->CancelRecognizeFiles();
+		}
+	}
+
+EXPORT_C void RApaLsSession::Close()
+/** 
+Closes the session. Needs to be called to avoid memory leaks.
+@publishedAll
+@released
+*/
+	{
+	CancelRecognizeFiles();
+	RHandleBase::Close();
+	delete iExtension;
+	iExtension = NULL;
+	}
+
+EXPORT_C TInt RApaLsSession::RecognizeSpecificData(const RFile& aFile, const TDataType& aDataType, TBool& aResult) const
+/** Tests whether data taken from a file passed by handle has the specified 
+data (MIME) type.
+
+@param aFile The file containing the data. Before this function can be called,
+the file server session which owns this file handle must first be marked as shareable by 
+calling RFs::ShareProtected().
+@param aDataType The data (MIME) type.
+@param aResult On return, contains the result of the test.
+@return KErrNone, if successful; otherwise one of the other system-wide error 
+codes. */
+	{
+	const TPckgC<TDataType> dataType(aDataType);
+	TIpcArgs ipcArgs(&dataType);
+	TInt returnValue = aFile.TransferToServer(ipcArgs, 1, 2);
+	if (returnValue == KErrNone)
+		{
+		returnValue=SendReceiveWithReconnect(EAppListServRecognizeSpecificDataPassedByFileHandle,ipcArgs);
+		}
+	if (returnValue < KErrNone)
+		{
+		return returnValue;
+		}
+	aResult=returnValue;
+	return KErrNone;
+	}
+
+
+/** Gets the UID of an application that can handle the specified data (MIME) type.
+
+If no application can be found, the function returns the UID of the preferred 
+default handler. If none of the default handlers can handle the data type, 
+then a NULL UID is returned.
+
+@param aDataType The data (MIME) type.
+@param aAppUid On return, the UID of the application that can handle the data 
+(MIME) type; this may be NULL.
+@return KErrNone, if successful; otherwise one of the other system-wide error 
+codes. 
+*/
+EXPORT_C TInt RApaLsSession::AppForDataType(const TDataType& aDataType, TUid& aAppUid) const
+	{
+	const TPckgC<TDataType> dataType(aDataType);
+	TPckg<TUid> uid(aAppUid);
+	return SendReceiveWithReconnect(EAppListServAppForDataType,TIpcArgs(&dataType,&uid));
+	} //lint !e1764 Suppress reference parameter 'aAppUid' could be declared const ref
+
+
+/** Finds and launches an application to handle the document contained in the specified 
+file.
+
+@param aFileName The document name.
+@param aThreadId On return, the id of the main thread started.
+@param aLaunchType Not used. Reserved for future use.
+@return KErrNone, if successful; EAppListInvalid, if the server's initial population of 
+the list has not completed; KErrNotFound, if a matching entry could not be found; otherwise 
+one of the other system-wide error codes. 
+*/
+EXPORT_C TInt RApaLsSession::StartDocument(const TDesC& aFileName, TThreadId& aThreadId, TLaunchType /*aLaunchType*/)
+	{
+	HBufC8* buffer=NULL;
+	TInt error=GetBufferFromFile(buffer, aFileName);
+	if (error!=KErrNone)
+		{
+		return error;
+		}
+	TFileName nativeExecutableName; // the name of the EXE that we pass to RProcess::Create
+	TFileName logicalExecutableName; // the name of the MIDlet, Python script, etc
+	HBufC8* opaqueData=NULL;
+	TIpcArgs ipcArgs;
+	ipcArgs.Set(2, &aFileName);
+	ipcArgs.Set(3, buffer);
+	error=GetExecutableName(nativeExecutableName, logicalExecutableName, opaqueData, ipcArgs, EAppListServGetExecutableNameGivenDocument);
+	if (error!=KErrNone)
+		{
+		delete buffer;
+		return error;
+		}
+	error = StartApplicationPassingDocumentName(nativeExecutableName, logicalExecutableName, opaqueData, aFileName, aThreadId, EApaCommandOpen, NULL);
+	delete opaqueData;
+	if(error!=KErrNone && error!=KErrCancel)
+		{
+		TPckg<TThreadId> threadId(aThreadId);
+		error = SendReceiveWithReconnect(EAppListServStartDocument,TIpcArgs(&threadId, &aFileName, buffer));
+		}
+	delete buffer;
+	return error;
+	}
+
+EXPORT_C TInt RApaLsSession::StartDocument(RFile& aFile, TThreadId& aThreadId, TRequestStatus* aRequestStatusForRendezvous/*=NULL*/)
+/** Finds and launches an application to handle the document contained in the specified file
+
+@param aFile  The file handle. Before this function can be called,
+the file server session which owns this file handle must first be marked as shareable by 
+calling RFs::ShareProtected().
+@param aThreadId On return, the id of the main thread started.
+@param aRequestStatusForRendezvous If not NULL, the asynchronous RProcess::Rendezvous() 
+function is called (being passed this TRequestStatus object) before RProcess::Resume() is called on 
+the new application process.
+@return KErrNone, if successful; KErrNotFound, if no suitable application can 
+be found; otherwise one of the other system-wide error codes. */
+	{
+	TFileName nativeExecutableName; // the name of the EXE that we pass to RProcess::Create
+	TFileName logicalExecutableName; // the name of the MIDlet, Python script, etc
+	HBufC8* opaqueData=NULL;
+	TIpcArgs ipcArgs;
+	TInt error=aFile.TransferToServer(ipcArgs, 2, 3);
+	if (error == KErrNone)
+		{
+		error=GetExecutableName(nativeExecutableName, logicalExecutableName, opaqueData, ipcArgs, EAppListServGetExecutableNameGivenDocumentPassedByFileHandle);
+		}
+	if (error!=KErrNone)
+		{
+		return error;
+		}
+	error=StartApplicationPassingFileHandle(nativeExecutableName, logicalExecutableName, opaqueData, aFile, aThreadId, aRequestStatusForRendezvous);
+	delete opaqueData;
+	return error;
+	} //lint !e1764 Suppress reference parameter could be declared const ref
+
+
+/** Launches an application that can handle the specified data (MIME) type.
+
+The application handles the document contained in the specified file.
+
+@param aFileName The document name.
+@param aDataType The data (MIME) type.
+@param aThreadId On return, the id of the main thread started.
+@param aLaunchType Not used. Reserved for future use.
+@return KErrNone, if successful; EAppListInvalid if the server's initial population of 
+the list has not completed; KErrNotFound, if no suitable application can 
+be found; otherwise one of the other system-wide error codes. 
+*/
+EXPORT_C TInt RApaLsSession::StartDocument(const TDesC& aFileName, const TDataType& aDataType, TThreadId& aThreadId, TLaunchType /*aLaunchType*/)
+	{
+	TFileName nativeExecutableName; // the name of the EXE that we pass to RProcess::Create
+	TFileName logicalExecutableName; // the name of the MIDlet, Python script, etc
+	HBufC8* opaqueData=NULL;
+	const TPckgC<TDataType> dataType(aDataType);
+	TIpcArgs ipcArgs;
+	ipcArgs.Set(2, &dataType);
+	TInt error=GetExecutableName(nativeExecutableName, logicalExecutableName, opaqueData, ipcArgs, EAppListServGetExecutableNameGivenDataType);
+	if (error!=KErrNone)
+		{
+		return error;
+		}
+	error = StartApplicationPassingDocumentName(nativeExecutableName, logicalExecutableName, opaqueData, aFileName, aThreadId,EApaCommandOpen,NULL);
+	delete opaqueData;
+	if(error!=KErrNone && error!=KErrCancel)
+		{
+		TPckg<TThreadId> threadId(aThreadId);
+		error = SendReceiveWithReconnect(EAppListServStartDocumentByDataType,TIpcArgs(&threadId, &aFileName, &dataType));
+		}
+	return error;
+	}
+
+EXPORT_C TInt RApaLsSession::StartDocument(RFile& aFile, const TDataType& aDataType, TThreadId& aThreadId, TRequestStatus* aRequestStatusForRendezvous/*=NULL*/)
+/** Finds and launches an application to handle the document contained in the specified file
+
+@param aFile The file handle.
+@param aDataType The data (MIME) type.
+@param aThreadId On return, the id of the main thread started.
+@param aRequestStatusForRendezvous If not NULL, the asynchronous RProcess::Rendezvous() 
+function is called (being passed this TRequestStatus object) before RProcess::Resume() is called on 
+the new application process.
+@return KErrNone, if successful; KErrNotFound, if no suitable application can 
+be found; otherwise one of the other system-wide error codes. */
+	{
+	TFileName nativeExecutableName; // the name of the EXE that we pass to RProcess::Create
+	TFileName logicalExecutableName; // the name of the MIDlet, Python script, etc
+	HBufC8* opaqueData=NULL;
+	const TPckgC<TDataType> dataType(aDataType);
+	TIpcArgs ipcArgs;
+	ipcArgs.Set(2, &dataType);
+	TInt error=GetExecutableName(nativeExecutableName, logicalExecutableName, opaqueData, ipcArgs, EAppListServGetExecutableNameGivenDataType);
+	if (error!=KErrNone)
+		{
+		return error;
+		}
+	error=StartApplicationPassingFileHandle(nativeExecutableName, logicalExecutableName, opaqueData, aFile, aThreadId, aRequestStatusForRendezvous);
+	delete opaqueData;
+	return error;
+	} //lint !e1764 Suppress reference parameter could be declared const ref
+
+EXPORT_C TInt RApaLsSession::StartDocument(const TDesC& aFileName, TUid aAppUid, TThreadId& aThreadId, TLaunchType aLaunchType)
+/** Launches the application identified by the specified UID.
+
+The application handles the document contained in the specified file.
+
+@param aFileName The document name.
+@param aAppUid The application specific UID.
+@param aThreadId On return, the id of the main thread started.
+@param aLaunchType Not used. Reserved for future use.
+@return KErrNone, if successful; EAppListInvalid if the server's initial population of 
+the list has not completed; KErrNotFound, if no suitable application can 
+be found; otherwise one of the other system-wide error codes. */
+	{
+	TFileName nativeExecutableName; // the name of the EXE that we pass to RProcess::Create
+	TFileName logicalExecutableName; // the name of the MIDlet, Python script, etc
+	HBufC8* opaqueData=NULL;
+	TIpcArgs ipcArgs;
+	ipcArgs.Set(2, aAppUid.iUid);
+	TInt error=GetExecutableName(nativeExecutableName, logicalExecutableName, opaqueData, ipcArgs, EAppListServGetExecutableNameGivenAppUid);
+	if (error!=KErrNone)
+		{
+		return error;
+		}
+	error = StartApplicationPassingDocumentName(nativeExecutableName, logicalExecutableName, opaqueData, aFileName, aThreadId,EApaCommandOpen,NULL);
+	delete opaqueData;
+	if(error!=KErrNone && error!=KErrCancel)
+		{
+		error = StartAndCreate(EAppListServStartDocumentByUid,aFileName,aAppUid,aThreadId,aLaunchType);
+		}
+	return error;
+	}
+
+EXPORT_C TInt RApaLsSession::StartDocument(RFile& aFile, TUid aAppUid, TThreadId& aThreadId, TRequestStatus* aRequestStatusForRendezvous/*=NULL*/)
+/** Finds and launches an application to handle the document contained in the specified file
+
+@param aFile The file handle.
+@param aAppUid The application specific UID.
+@param aThreadId On return, the id of the main thread started.
+@param aRequestStatusForRendezvous If not NULL, the asynchronous RProcess::Rendezvous() 
+function is called (being passed this TRequestStatus object) before RProcess::Resume() is called on 
+the new application process.
+@return KErrNone, if successful; KErrNotFound, if no suitable application can 
+be found; otherwise one of the other system-wide error codes. */
+	{
+	TFileName nativeExecutableName; // the name of the EXE that we pass to RProcess::Create
+	TFileName logicalExecutableName; // the name of the MIDlet, Python script, etc
+	HBufC8* opaqueData=NULL;
+	TIpcArgs ipcArgs;
+	ipcArgs.Set(2, aAppUid.iUid);
+	TInt error=GetExecutableName(nativeExecutableName, logicalExecutableName, opaqueData, ipcArgs, EAppListServGetExecutableNameGivenAppUid);
+	if (error!=KErrNone)
+		{
+		return error;
+		}
+	error=StartApplicationPassingFileHandle(nativeExecutableName, logicalExecutableName, opaqueData, aFile, aThreadId, aRequestStatusForRendezvous);
+	delete opaqueData;
+	return error;
+	} //lint !e1764 Suppress reference parameter could be declared const ref
+
+
+/** Launches the application identified by the specified UID and creates a new document.
+
+To create a document file with the passed document name, the application needs to override the 3-parameter
+overload of ProcessCommandParametersL() to call the 2-parameter overload.
+
+Otherwise, a document will be created with the default document name present in the application resource file.
+If default document name is empty or not provided, no document is created.
+
+If the application resource file is not present, a document with application caption name is created.
+
+@param aFileName The document name.
+@param aAppUid The application specific UID. 
+@param aThreadId On return, the id of the main thread started.
+@param aLaunchType Not used. Reserved for future use.
+@return KErrNone, if successful; EAppListInvalid if the server's initial population of 
+the list has not completed; KErrNotFound, if no suitable application can 
+be found; otherwise one of the other system-wide error codes. 
+@see CEikAppUi::ProcessCommandParametersL().
+*/
+EXPORT_C TInt RApaLsSession::CreateDocument(const TDesC& aFileName, TUid aAppUid, TThreadId& aThreadId, TLaunchType aLaunchType)
+	{
+	TFileName nativeExecutableName; // the name of the EXE that we pass to RProcess::Create
+	TFileName logicalExecutableName; // the name of the MIDlet, Python script, etc
+	HBufC8* opaqueData=NULL;
+	TIpcArgs ipcArgs;
+	ipcArgs.Set(2, aAppUid.iUid);
+	TInt error=GetExecutableName(nativeExecutableName, logicalExecutableName, opaqueData, ipcArgs, EAppListServGetExecutableNameGivenAppUid);
+	if (error!=KErrNone)
+		{
+		return error;
+		}
+	error = StartApplicationPassingDocumentName(nativeExecutableName, logicalExecutableName, opaqueData, aFileName, aThreadId,EApaCommandCreate,NULL);
+	delete opaqueData;
+	if(error!=KErrNone && error!=KErrCancel)
+		{
+		error = StartAndCreate(EAppListServCreateDocumentByUid,aFileName,aAppUid,aThreadId,aLaunchType);
+		}
+	return error;
+	}
+	
+TInt RApaLsSession::StartAndCreate(TInt aRqst,const TDesC& aFileName, TUid aAppUid, TThreadId& aThreadId, TLaunchType /*aLaunchType*/)
+	{
+	TPckg<TThreadId> threadId(aThreadId);
+	return SendReceiveWithReconnect(aRqst,TIpcArgs(&threadId, &aFileName, aAppUid.iUid));
+	} 	//lint !e1762 !e1764
+		//Suppress reference parameter 'aThreadId' could be declared const ref
+		//Suppress member function could be made const
+
+
+
+
+/** Gets the available icon sizes for the application with the specified UID.
+
+@param aAppUid The application specific UID.
+@param aArrayToFill On return, the array contains all of the available icon 
+sizes.
+@return KErrNone, if successful; KErrNotFound, if no matching application can 
+be found; KErrNotSupported, if the application provides icons in non-MBM format;
+otherwise one of the other system wide error codes. 
+*/
+EXPORT_C TInt RApaLsSession::GetAppIconSizes(TUid aAppUid, CArrayFixFlat<TSize>& aArrayToFill) const
+	{
+	TRAPD(error,DoGetAppIconSizesL(aAppUid,aArrayToFill));
+	return error;
+	}
+
+void RApaLsSession::FetchArrayL(MArrayFiller& aArrayFiller,TUid aAppUid, TInt aOpcode, TInt aInitialBufSize) const
+	{
+	CBufFlat* buffer=CBufFlat::NewL(aInitialBufSize);
+	CleanupStack::PushL(buffer);
+	buffer->ExpandL(0,aInitialBufSize);
+	TPtr8 bufPtr=buffer->Ptr(0);
+	const TInt sizeRequired=User::LeaveIfError(SendReceiveWithReconnect(aOpcode,TIpcArgs(aAppUid.iUid,buffer->Size(),&bufPtr)));
+	if (sizeRequired>0)
+		{
+		__ASSERT_DEBUG(sizeRequired>buffer->Size(),User::Invariant());
+		CleanupStack::PopAndDestroy(buffer);
+		buffer=CBufFlat::NewL(sizeRequired);
+		CleanupStack::PushL(buffer);
+		buffer->ExpandL(0,sizeRequired);
+		bufPtr.Set(buffer->Ptr(0));
+#if defined(_DEBUG)
+		const TInt check=
+#endif
+		User::LeaveIfError(SendReceiveWithReconnect(aOpcode,TIpcArgs(aAppUid.iUid,buffer->Size(),&bufPtr)));
+		__ASSERT_DEBUG(check==0,User::Invariant());
+		}
+	RBufReadStream readStream;
+	readStream.Open(*buffer);
+	const TInt count=readStream.ReadUint32L();
+	for (TInt i=0; i<count; ++i)
+		{
+		aArrayFiller.AppendItemL(readStream);
+		}
+	CleanupStack::PopAndDestroy(buffer);
+	}
+
+void RApaLsSession::DoGetAppIconSizesL(TUid aAppUid, CArrayFixFlat<TSize>& aArrayToFill) const
+	{
+	TSizeArrayFiller arrayFiller(aArrayToFill);
+	FetchArrayL(arrayFiller, aAppUid, EAppListServGetAppIconSizes, KInitialIconBufSize);
+	}
+
+
+
+/** Gets the nearest matching application icon for the application with the specified 
+UID.
+
+The function gets the icon whose size matches the specified size. If there 
+is no exact match, then the function gets the closest smaller icon.
+
+This function should be used in preference to the TInt GetAppIcon(TUid,TInt,CApaMaskedBitmap&); 
+overload.
+
+@param aAppUid The application specific UID.
+@param aSize The required size of the icon.
+@param aAppBitmap On return, the application icon.
+@return KErrNone, if successful; KErrNotFound, if a matching entry could not be found, or no 
+icon equal to or smaller than the specified size can be found; KErrNotSupported, if the
+application provides icons in non-MBM format; otherwise one of the other system wide
+error codes. 
+*/
+EXPORT_C TInt RApaLsSession::GetAppIcon(TUid aAppUid, TSize aSize, CApaMaskedBitmap& aAppBitmap) const
+	{
+	SReturnData_AppIconByUidAndSize returnData = {0,0};
+	TPckg<SReturnData_AppIconByUidAndSize> returnData_asDescriptor(returnData);
+	TInt error=SendReceiveWithReconnect(EAppListServAppIconByUidAndSize,TIpcArgs(aAppUid.iUid,aSize.iWidth,aSize.iHeight,&returnData_asDescriptor));
+	if (error==KErrNone)
+		{
+		error=aAppBitmap.Duplicate(returnData.iIcon);
+		if (error==KErrNone)
+			{
+			error=aAppBitmap.Mask()->Duplicate(returnData.iIconMask);
+			}
+		}
+	return error;
+	}
+
+
+
+/** 
+ gets the bitmap handles from the Server, forms these up into a CApaMaskedBitmap
+
+Sets aAppBitmap to be the small, medium or large app icon of the app with uid 
+aAppUid, when aSize=0, 1 or 2 respectively.
+Panics the caller if a different index is specified.
+The overload which takes a TSize should be used instead.
+
+@deprecated 
+@param aAppUid The application specific UID.
+@param aSize The required size of the icon.
+@param aAppBitmap On return, the application icon.
+@return KErrNone, if successful; KErrNotFound, if a matching entry could not be found, or no 
+icon equal to or smaller than the specified size can be found; KErrNotSupported, if the 
+application provides icons in non-MBM format, otherwise one of the other system wide 
+error codes.
+*/
+EXPORT_C TInt RApaLsSession::GetAppIcon(TUid aAppUid, TInt aSize, CApaMaskedBitmap& aAppBitmap) const
+	{
+	__ASSERT_ALWAYS((aSize>=0) && (aSize<3), Panic(EDPanicBadIconSize));
+	SReturnData_AppIconByUid returnData = {0,0};
+	TPckg<SReturnData_AppIconByUid> returnData_asDescriptor(returnData);
+	TInt error=SendReceiveWithReconnect(EAppListServAppIconByUid,TIpcArgs(aAppUid.iUid,aSize,&returnData_asDescriptor));
+	if (error==KErrNone)
+		{
+		error=aAppBitmap.Duplicate(returnData.iIcon);
+		if (error==KErrNone)
+			{
+			error=aAppBitmap.Mask()->Duplicate(returnData.iIconMask);
+			}
+		}
+	return error;
+	}
+
+
+	
+EXPORT_C TInt RApaLsSession::GetAppIcon(TUid aAppUid, RFile& aFile) const 
+/** Gets an open shareable read only file handle to the application icon file for the 
+application with the specified UID. 
+
+An icon file can only be defined by applications providing an application registration file.
+
+An icon file may be in any graphics format and contain one or more icons.
+
+On entering this function, aFile must be non-open. It is recommended that aFile is 
+pushed onto the cleanup-stack (via CleanupClosePushL()) before this function is called.
+
+@param aAppUid The application specific UID.
+@param aFile On return, a read only open file handle to the icon file.
+@return KErrNone, if successful; KErrNotFound, if a matching application could not be found, 
+or an icon filename was not defined; otherwise one of the other system wide error codes. 
+@see GetAppIcon 
+*/ 
+	{
+	__ASSERT_ALWAYS(aFile.SubSessionHandle() == KNullHandle, Panic(EDPanicHandleAlreadySet));
+	TPckgBuf<TInt> fileHandle;
+	TInt sessionHandleOrErrorCode = SendReceiveWithReconnect(EAppListServAppIconFileHandle, TIpcArgs(aAppUid.iUid, &fileHandle));
+	if (sessionHandleOrErrorCode >= KErrNone)
+	    {
+	    sessionHandleOrErrorCode = aFile.AdoptFromServer(sessionHandleOrErrorCode, fileHandle());
+	    }
+	return sessionHandleOrErrorCode;
+	}   
+
+
+
+EXPORT_C TInt RApaLsSession::AppForDocument(const TDesC& aFileName, TUid& aAppUid, TDataType& aDataType) const
+/** Gets the data (MIME) type of the data in the specified file and gets the UID 
+of an application that can handle this type.
+
+@param aFileName The name of the file containing the data.
+@param aAppUid On return, the UID of the application that can handle the data 
+(MIME) type; this may be NULL.
+@param aDataType On return, the data (MIME) type.
+@return KErrNone, if successful; otherwise one of the other system-wide error 
+codes. */
+	{
+	return DoAppForDocumentOptionallySpecifyingService(aFileName, TUid::Null(), aAppUid, aDataType, EAppListServAppForDocument);
+	}
+
+
+/** Gets the data (MIME) type of the data in the specified file and gets the UID 
+of an application that can handle this type.
+
+@param aFile The file containing the data. Before this function can be called,
+the file server session which owns this file handle must first be marked as shareable by 
+calling RFs::ShareProtected().
+@param aAppUid On return, the UID of the application that can handle the data 
+(MIME) type; this may be NULL.
+@param aDataType On return, the data (MIME) type.
+@return KErrNone, if successful; otherwise one of the other system-wide error 
+codes. 
+*/
+EXPORT_C TInt RApaLsSession::AppForDocument(const RFile& aFile, TUid& aAppUid, TDataType& aDataType) const
+	{
+	return DoAppForDocumentOptionallySpecifyingService(aFile, TUid::Null(), aAppUid, aDataType, EAppListServAppForDocumentPassedByFileHandle);
+	}
+
+/** Tests whether the file is a native executable (DLL or EXE).
+
+@param aFileName The name of the file containing the data.
+@param aProgram On return, true, if the file contains application code; false, 
+otherwise.
+@return KErrNone, if successful; otherwise one of the other system-wide error 
+codes. 
+*/
+EXPORT_C TInt RApaLsSession::IsProgram(const TDesC& aFileName, TBool& aProgram) const
+	{
+	_LIT(KLitSysBin, "\\sys\\bin\\");
+	aProgram=(TParsePtrC(aFileName).Path().CompareF(KLitSysBin)==0);
+	return KErrNone;
+	}
+
+/** Gets the confidence threshold for successful data recognition.
+
+This is the minimum acceptable confidence level that must be reported by a 
+data recognizer for data to be accepted as of a given type.
+
+@param aConfidence On return, the confidence threshold. 
+@return KErrNone, if successful; otherwise one of the other system-wide error 
+codes. 
+*/
+EXPORT_C TInt RApaLsSession::GetAcceptedConfidence(TInt& aConfidence) const
+	{
+	TPckg<TInt> confidence(aConfidence);
+	return SendReceiveWithReconnect(EAppListServGetConfidence,TIpcArgs(&confidence));
+	} //lint !e1764 Suppress reference parameter could be declared const ref
+
+
+
+/** Sets the confidence threshold for successful data recognition.
+
+This is the minimum acceptable confidence level that must be reported by a 
+data recognizer for data to be accepted as of a given type.
+
+@param aConfidence The confidence threshold. Although this is an integer value, 
+data recognizers use the discrete values defined by the CApaDataRecognizerType::TRecognitionConfidence 
+enumeration.
+@return KErrNone, if successful; otherwise one of the other system-wide error 
+codes. 
+@capability WriteDeviceData 
+*/
+EXPORT_C TInt RApaLsSession::SetAcceptedConfidence(TInt aConfidence)
+	{
+	return SendReceiveWithReconnect(EAppListServSetConfidence,TIpcArgs(aConfidence));
+	} //lint !e1762 Suppress member function could be made const
+
+
+EXPORT_C TInt RApaLsSession::GetPreferredBufSize(TInt& aPreferredBufSize) const
+/** Gets the preferred number of bytes of data to read from a file for the purpose 
+of recognizing the data type.
+
+This should be used to determine the size of buffer to pass to the 3-parameter 
+overload of RecognizeData() or to the 4-parameter overload of RecognizeSpecificData().
+
+@param aPreferredBufSize On return, contains either the largest buffer size required 
+by any of the currently installed data-recognizers, or the value that would be 
+returned by GetMaxDataBufSize(), whichever is less.
+@return KErrNone, if successful; otherwise one of the other system-wide error 
+codes.
+@see GetMaxDataBufSize() */
+	{
+	const TInt preferredBufSize=SendReceiveWithReconnect(EAppListServPreferredBufSize, TIpcArgs());
+	if (preferredBufSize<KErrNone)
+		{
+		return preferredBufSize; // it's an error
+		}
+	aPreferredBufSize=preferredBufSize;
+	return KErrNone;
+	}
+
+EXPORT_C TInt RApaLsSession::GetMaxDataBufSize(TInt& aBufSize) const
+/** Gets the maximum size of the data that can be read from a file for the purpose 
+of recognizing the data type.
+
+To determine the size of buffer to pass to the 3-parameter overload of RecognizeData() 
+or to the 4-parameter overload of RecognizeSpecificData(), use GetPreferredBufSize() 
+rather than this function.
+
+@param aBufSize On return, contains the maximum size.
+@return KErrNone, if successful; otherwise one of the other system-wide error 
+codes.
+@see SetMaxDataBufSize()
+@see GetPreferredBufSize() */
+	{
+	const TInt returnValue=SendReceiveWithReconnect(EAppListServGetBufSize,TIpcArgs());
+	if (returnValue<0)
+		{
+		return returnValue;
+		}
+	aBufSize=returnValue;
+	return KErrNone;
+	}
+
+
+
+/** Sets the maximum size of the data that can be read from a file for the purpose 
+of recognizing the data type.
+
+The value is not used when the client explicitly supplies a buffer, for example 
+in calls to RecognizeData() and RecognizeSpecificData(), but is used in the 
+implementation of functions such as StartDocument() and CreateDocument().
+
+Unless explicitly set, a default value of KApaAppListServMaxBuffer is used.
+
+@param aBufSize The maximum size of data to be read.
+@return KErrNone, if successful; otherwise one of the other system-wide error 
+codes. 
+@see CreateDocument()
+@see StartDocument()
+@see RecognizeData()
+@see RecognizeSpecificData() 
+*/
+EXPORT_C TInt RApaLsSession::SetMaxDataBufSize(TInt aBufSize)
+	{
+	return SendReceiveWithReconnect(EAppListServSetBufSize,TIpcArgs(aBufSize));
+	} //lint !e1762 Suppress member function could be made const
+
+
+
+/** Gets a list of recognized data(MIME) types by all recognizers.
+
+@param aDataTypes The array of data (MIME) types.
+@return KErrNone, if successful; otherwise one of the other system-wide error 
+codes. 
+*/
+EXPORT_C TInt RApaLsSession::GetSupportedDataTypesL(CDataTypeArray& aDataTypes) const
+	{
+	// gets the datatype count in terms of buffer length; negative value means one of the system-wide error
+	TInt ret=SendReceiveWithReconnect(EAppListServGetDataTypesPhase1,TIpcArgs());
+	if (ret>0)
+		{
+		CBufFlat* const buf=CBufFlat::NewL(ret);
+		CleanupStack::PushL(buf);
+		buf->ExpandL(0,ret);
+		TPtr8 ptr=buf->Ptr(0);
+		ret=SendReceiveWithReconnect(EAppListServGetDataTypesPhase2,TIpcArgs(&ptr));
+		if (ret==KErrNone)
+			{
+			RBufReadStream readStream(*buf);
+			readStream >> aDataTypes;
+			}
+		CleanupStack::PopAndDestroy(buf);
+		}
+	return ret;
+	}
+
+
+
+/** Gets the icon for the specified view published by the application that has 
+the specified UID.
+
+The icon returned is that which is closest in size to the specified size.
+
+@param aAppUid The application specific UID.
+@param aViewUid The UID identifying the view.
+@param aSize The requested size of the icon.
+@param aViewBitmap On return, the icon that is closest in size to the requested 
+size.
+@return KErrNone, if successful; KErrNotFound, if no matching application nor matching view 
+can be found; KErrNotSupported, if the application provides icons in non-MBM format;
+otherwise one of the other system wide error codes. 
+*/
+EXPORT_C TInt RApaLsSession::GetAppViewIcon(TUid aAppUid, TUid aViewUid, const TSize& aSize, CApaMaskedBitmap& aViewBitmap) const
+	{
+	const TApaAppViewIconSizeData appViewIconSizeData(aAppUid, aViewUid, aSize);
+	const TPckgC<TApaAppViewIconSizeData> inputData(appViewIconSizeData);
+	SReturnData_ViewIconByUidAndSize returnData = {0,0};
+	TPckg<SReturnData_ViewIconByUidAndSize> returnData_asDescriptor(returnData);
+	TInt error=SendReceiveWithReconnect(EAppListServViewIconByUidAndSize,TIpcArgs(&inputData,&returnData_asDescriptor));
+	if (error==KErrNone)
+		{
+		error=aViewBitmap.Duplicate(returnData.iIcon);
+		if (error==KErrNone)
+			{
+			error=aViewBitmap.Mask()->Duplicate(returnData.iIconMask);
+			}
+		}
+	return error;
+	}
+
+
+
+/** Gets the views published by the application that has the specified UID.
+
+Information on each view is contained in a TApaAppViewInfo object, and this 
+set of objects is put into the array supplied by the caller.
+
+@param aAppViews On return, the array contains information on all of the views 
+published by the specified application.
+@param aAppUid The application specific UID.
+@return KErrNone, if successful; KErrNotFound, if no matching application can 
+be found; otherwise one of the other system wide error codes.
+@see TApaAppViewInfo 
+*/
+EXPORT_C TInt RApaLsSession::GetAppViews(CApaAppViewArray& aAppViews, TUid aAppUid) const
+	{
+	TRAPD(error,DoGetAppViewsL(aAppViews,aAppUid));
+	return error;
+	}
+
+void RApaLsSession::DoGetAppViewsL(CApaAppViewArray& aArrayToFill, TUid aAppUid) const
+	{
+	TViewDataArrayFiller arrayFiller(aArrayToFill);
+	FetchArrayL(arrayFiller, aAppUid, EAppListServGetAppViews, KInitialViewDataBufSize);
+	}
+
+
+
+/** Gets the list of file names for which the application with the specified 
+UID claims ownership.
+
+The list is written to a descriptor array supplied by the caller.
+
+Note that if the function fails due to lack of memory, the array is left in 
+an undefined state.
+
+@param aAppOwnedFiles On return, the descriptor array contains the file names.
+@param aAppUid The application specific UID.
+@return KErrNone, if successful; KErrNotFound, if no matching application can 
+be found; otherwise one of the other system wide error codes. 
+*/
+EXPORT_C TInt RApaLsSession::GetAppOwnedFiles(CDesCArray& aAppOwnedFiles, TUid aAppUid) const
+	{
+	TRAPD(error,DoGetAppOwnedFilesL(aAppOwnedFiles,aAppUid));
+	return error;
+	}
+
+
+
+/** Gets the number of icons defined by the app that has the specified UID
+
+Applications that don't define icons in their application information file will
+return an aCount value of zero when this function is called.
+
+@param aAppUid The application specific UID
+@param aCount On return, contains the number of icons defined by the application
+@return KErrNone, if successful; KErrNotFound, if a matching application could not be found;
+KErrNotSupported, if the application provides icons in non-MBM format; otherwise one of 
+the other system-wide error codes. 
+*/
+EXPORT_C TInt RApaLsSession::NumberOfOwnDefinedIcons(TUid aAppUid, TInt& aCount) const
+	{
+	TPckgBuf<TInt> pckg;
+	TInt ret=SendReceiveWithReconnect(EAppListServNumberOfOwnDefinedIcons,TIpcArgs(aAppUid.iUid,&pckg));
+	if (ret==KErrNone)
+		{
+		aCount=pckg();
+		}
+	return ret;
+	}
+
+
+
+/** Gets the full filename of a file containing application icons for the
+application with the specified UID.
+
+An icon file can only be defined by applications providing an application registration file.
+
+An icon file may be in any graphics format and contain one or more icons.
+
+@param aAppUid The application specific UID.
+@param aFullFileName On return, the full filename of a file containing one or more
+application icons. Returns a pointer to the filename and transfers ownership to the caller.
+@return KErrNone, if successful; KErrNotFound, if a matching application could not be found,
+or an icon filename was not defined; KErrNotSupported, if the application does not
+provide an application registration file; otherwise one of the other system wide error codes. 
+*/
+EXPORT_C TInt RApaLsSession::GetAppIcon(TUid aAppUid, HBufC*& aFullFileName) const
+	{
+	TFileName fileName;
+	TPckg<TFileName> filenamePckg(fileName);
+	TInt ret=SendReceiveWithReconnect(EAppListServAppIconFileName, TIpcArgs(aAppUid.iUid, &filenamePckg));
+	if (ret==KErrNone)
+		{
+		HBufC* fullFileName = HBufC::New(fileName.Length());
+		if (fullFileName == NULL)
+			{
+			return KErrNoMemory;
+			}
+		else
+			{
+			*fullFileName = fileName;
+			aFullFileName = fullFileName; // ownership transferred to caller
+			}
+		}
+	return ret;
+	}
+
+
+
+/** Gets the full filename of a file containing view-specific icons for the application
+with the specified UID and view.
+
+A file containing view-specific icons can only be defined by applications providing
+an application registration file.
+
+A view icon file may be in any graphics format and contain one or more view icons.
+
+@param aAppUid The application specific UID.
+@param aViewUid The UID identifying the view.
+@param aFullFileName On return, the full filename of a file containing one or more
+view icons. Returns a pointer to the filename and transfers ownership to the caller.
+@return KErrNone, if successful; KErrNotFound, if no matching application nor matching view
+could be found, or a view icon filename was not defined; KErrNotSupported, if the application
+does not provide an application registration file; otherwise one of the other system wide error codes. 
+*/
+EXPORT_C TInt RApaLsSession::GetAppViewIcon(TUid aAppUid, TUid aViewUid, HBufC*& aFullFileName) const
+	{
+	TFileName fileName;
+	TPckg<TFileName> filenamePckg(fileName);
+	TInt ret=SendReceiveWithReconnect(EAppListServAppViewIconFileName, TIpcArgs(aAppUid.iUid, aViewUid.iUid, &filenamePckg));
+	if (ret==KErrNone)
+		{
+		HBufC* fullFileName = HBufC::New(fileName.Length());
+		if (fullFileName == NULL)
+			{
+			return KErrNoMemory;
+			}
+		else
+			{
+			*fullFileName = fileName;
+			aFullFileName = fullFileName; // ownership transferred to caller
+			}
+		}
+	return ret;
+	}
+
+
+
+/** Changes an existing data type mapping, or adds a new one.
+
+If the data type is not currently mapped, a new mapping is added. 
+If the data type is mapped, its mapping is replaced.
+
+@capability WriteDeviceData Prevent addition of data type mappings by malicious programs.
+@param aDataType A new or existing data type.
+@param aPriority The priority with which the application handles the data type.
+@param aUid The UID of the application to associate with the data type.
+@return KErrNone on success, or a system-wide error code. 
+*/
+EXPORT_C TInt RApaLsSession::InsertDataMapping(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid)
+	{
+	return InsertDataMapping(aDataType, aPriority, aUid, KOpenServiceUid);
+	}
+
+/** Changes an existing data type mapping, or adds a new one.
+
+If the data type is not currently mapped, a new mapping is added. 
+If the data type is mapped, its mapping is replaced.
+
+@capability WriteDeviceData Prevent addition of data type mappings by malicious programs.
+@param aDataType A new or existing data type.
+@param aPriority The priority with which the application handles the data type.
+@param aUid The UID of the application to associate with the data type.
+@param aServiceUid The UID of the service.
+@return KErrNone on success, or a system-wide error code. 
+*/
+EXPORT_C TInt RApaLsSession::InsertDataMapping(const TDataType& aDataType, TDataTypePriority aPriority, 
+	TUid aUid, TUid aServiceUid)
+	{
+	const TPckgC<TDataType> dataType(aDataType);
+	return SendReceiveWithReconnect(EAppListInsertDataMapping, 
+		TIpcArgs(&dataType, TInt(aPriority), aUid.iUid, aServiceUid.iUid));
+	} //lint !e1762 Suppress member function could be made const
+
+/** Changes an existing data type mapping, or adds a new one.
+If the data type is not currently mapped, it is added.
+If the data type is mapped with a priority lower than aPriority, the new mapping replaces the existing one. 
+Otherwise, no change is made.
+
+@capability WriteDeviceData Prevent addition of data type mappings by malicious programs.
+@param aDataType A new or existing data type.
+@param aPriority The priority with which the application handles the data type.
+@param aUid The UID of the application to associate with the data type.
+@param aInserted Non-zero if the new mapping was added or an existing mapping replaced, zero otherwise.
+@return KErrNone on success, or a system-wide error code. 
+*/
+EXPORT_C TInt RApaLsSession::InsertDataMappingIfHigher(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid, TBool& aInserted)
+	{
+	TPckgBuf<TBool> inserted(EFalse);
+	const TPckgC<TDataType> dataType(aDataType);
+	const TInt ret = SendReceiveWithReconnect(EAppListInsertDataMappingIfHigher, TIpcArgs(&dataType, TInt(aPriority), aUid.iUid, &inserted));
+	if(ret == KErrNone)
+		{
+		aInserted = inserted();
+		}
+	return ret;
+	} //lint !e1762 Suppress member function could be made const
+
+
+
+/** Removes an existing user mapping between an application and data-type made through InsertDataMapping() or InsertDataMappingIfHigher().
+
+@capability WriteDeviceData Prevent removal of data type mappings by malicious programs.
+@param aDataType Data type whose mapping should be removed.
+@panic USER 0 The specified data type cannot be found. Debug builds only.
+@return KErrNone on success, or a system-wide error code. 
+@see InsertDataMapping()
+@see InsertDataMappingIfHigher()
+*/
+EXPORT_C TInt RApaLsSession::DeleteDataMapping(const TDataType& aDataType)
+	{
+	return DeleteDataMapping(aDataType, KOpenServiceUid);
+	}
+
+/** Removes an existing data type mapping.
+
+@capability WriteDeviceData Prevent removal of data type mappings by malicious programs.
+@param aDataType Data type whose mapping should be removed.
+@param aServiceUid The UID of the service.
+@panic USER 0 The specified data type cannot be found. Debug builds only.
+@return KErrNone on success, or a system-wide error code. 
+*/
+EXPORT_C TInt RApaLsSession::DeleteDataMapping(const TDataType& aDataType, TUid aServiceUid)
+	{
+	const TPckgC<TDataType> dataType(aDataType);
+	return SendReceiveWithReconnect(EAppListDeleteDataMapping, TIpcArgs(&dataType, aServiceUid.iUid));
+	} //lint !e1762 Suppress member function could be made const
+	
+/** Gets the application associated with the data type and the service uid from
+the datatype store. 
+
+The function will only look into the datatype store and will not use the 
+default type associations. This is different from the AppForDataTypeAndService() function.
+
+@param aDataType The data (MIME) type.
+@param aAppUid On return, the UID of the application that can handle the data 
+(MIME) type; this may be NULL.
+@param aServiceUid The UID of the service.
+@return KErrNone, if successful; otherwise one of the other system-wide error 
+codes. 
+*/
+EXPORT_C TInt RApaLsSession::GetAppByDataType(const TDataType& aDataType, TUid aServiceUid, TUid& aAppUid) const
+	{
+	const TPckgC<TDataType> dataType(aDataType);
+	TPckg<TUid> uid(aAppUid);
+	const TInt returnValue=SendReceiveWithReconnect(EAppListServGetAppByDataType,TIpcArgs(&dataType, aServiceUid.iUid, &uid));
+	if (returnValue<0)
+		{
+		return returnValue;
+		}
+	if (aAppUid == KNullUid)
+		{
+		return KErrNotFound;
+		}
+	else
+		{
+		return KErrNone;
+		}
+	} //lint !e1764 Suppress reference parameter 'aAppUid' could be declared const ref
+
+/** Determines the current language an application is using to display its
+user interface.
+@param aAppUid The application specific UID.
+@param aLanguage On return, the application language.  
+@return KErrNone, if successful; KErrNotFound, if a matching application could not be found; 
+otherwise one of the other system wide error codes.
+*/
+EXPORT_C TInt RApaLsSession::ApplicationLanguage(TUid aAppUid, TLanguage& aLanguage) const
+	{
+	TPckgBuf<TLanguage> pckg;
+	TInt errVal = SendReceiveWithReconnect(EAppListServApplicationLanguage, TIpcArgs(aAppUid.iUid, &pckg));
+	if (errVal == KErrNone)
+		{
+		aLanguage = pckg();
+		}
+	return errVal;
+	}
+
+/** Gets the services implemented by the application that has the specified
+application UID.
+
+The returned CApaAppServiceInfoArray object contains an array of TApaAppServiceInfo objects.
+
+Information on each service implementation is contained in a TApaAppServiceInfo object.
+
+TApaAppServiceInfo::Uid() returns the service UID of the service implemented by the
+specified application UID.
+
+@param aAppUid The application specific UID.
+@return A pointer to a CApaAppServiceInfoArray object left on the cleanup stack.
+@leave KErrNotFound No matching application can be found, or a matching application
+does not implement any services.
+@leave KErrNotSupported The specified application does not provide an application
+registration file.
+@leave KErrNoMemory There is insufficient memory to perform the operation.
+@see CApaAppServiceInfoArray::Array()
+@see TApaAppServiceInfo
+@publishedPartner
+@released
+*/
+EXPORT_C CApaAppServiceInfoArray* RApaLsSession::GetAppServicesLC(TUid aAppUid) const
+	{
+	CArrayFixFlat<TApaAppServiceInfo>* serviceArray = new(ELeave) CArrayFixFlat<TApaAppServiceInfo>(4);
+	CleanupStack::PushL(TCleanupItem(CleanupServiceArray, serviceArray));
+	CBufBase* buffer = GetServiceBufferLC(EAppListServGetAppServices, aAppUid);
+	RBufReadStream readStream(*buffer);
+	readStream >> *serviceArray;
+	CleanupStack::PopAndDestroy(buffer);
+	CleanupStack::Pop(serviceArray);
+	CApaAppServiceInfoArrayWrapper* wrapper = CApaAppServiceInfoArrayWrapper::NewL(serviceArray); // takes ownership of serviceArray
+	CleanupStack::PushL(wrapper);
+	return wrapper;
+	}
+
+CBufBase* RApaLsSession::GetServiceBufferLC(TInt aOpcode, TUid aUid1, TUid aUid2/*=KNullUid*/) const
+	{
+	CBufFlat* buffer=CBufFlat::NewL(KDefaultBufSize); // allocate buffer with a default size that should be large enough in most cases
+	CleanupStack::PushL(buffer);
+	buffer->ExpandL(0,KDefaultBufSize);
+	TPtr8 bufPtr=buffer->Ptr(0);
+	const TInt sizeRequired=User::LeaveIfError(SendReceiveWithReconnect(aOpcode,TIpcArgs(aUid1.iUid,aUid2.iUid,buffer->Size(),&bufPtr)));
+	if (sizeRequired>0)
+		{
+		CleanupStack::PopAndDestroy(buffer);
+		buffer=CBufFlat::NewL(sizeRequired);
+		CleanupStack::PushL(buffer);
+		buffer->ExpandL(0,sizeRequired);
+		bufPtr.Set(buffer->Ptr(0));
+#if defined(_DEBUG)
+		const TInt check=
+#endif
+		User::LeaveIfError(SendReceiveWithReconnect(aOpcode,TIpcArgs(aUid1.iUid,aUid2.iUid,0,&bufPtr)));
+		__ASSERT_DEBUG(check==0,User::Invariant());
+		}
+	return buffer;
+	}
+	
+CBufBase* RApaLsSession::GetServiceBufferLC(TInt aOpcode, TUid aUid1, const TDataType& aDataType) const
+	{
+	const TPckgC<TDataType> dataType(aDataType);
+	CBufFlat* buffer=CBufFlat::NewL(KDefaultBufSize); // allocate buffer with a default size that should be large enough in most cases
+	CleanupStack::PushL(buffer);
+	buffer->ExpandL(0,KDefaultBufSize);
+	TPtr8 bufPtr=buffer->Ptr(0);
+	const TInt sizeRequired=User::LeaveIfError(SendReceiveWithReconnect(aOpcode,TIpcArgs(aUid1.iUid,&dataType,buffer->Size(),&bufPtr)));
+	if (sizeRequired>0)
+		{
+		CleanupStack::PopAndDestroy(buffer);
+		buffer=CBufFlat::NewL(sizeRequired);
+		CleanupStack::PushL(buffer);
+		buffer->ExpandL(0,sizeRequired);
+		bufPtr.Set(buffer->Ptr(0));
+#if defined(_DEBUG)
+		const TInt check=
+#endif
+		User::LeaveIfError(SendReceiveWithReconnect(aOpcode,TIpcArgs(aUid1.iUid,&dataType,0,&bufPtr)));
+		__ASSERT_DEBUG(check==0,User::Invariant());
+		}
+	return buffer;	
+	}
+
+
+
+/** Gets the service implementations for the specified service UID.
+
+The returned CApaAppServiceInfoArray object contains an array of TApaAppServiceInfo objects.
+
+Information on each implementation is contained in a TApaAppServiceInfo object.
+
+TApaAppServiceInfo::Uid() returns the UID of the application that implements the
+specified service UID.
+
+@param aServiceUid The service UID.
+@return A pointer to a CApaAppServiceInfoArray object left on the cleanup stack.
+@leave KErrNotFound No service implementations for the specified service UID can be found.
+@leave EAppListInvalid The server's initial population of the list has not completed.
+@leave KErrNoMemory There is insufficient memory to perform the operation.
+@see CApaAppServiceInfoArray::Array()
+@see TApaAppServiceInfo
+@publishedPartner
+@released
+*/
+EXPORT_C CApaAppServiceInfoArray* RApaLsSession::GetServiceImplementationsLC(TUid aServiceUid) const
+	{
+	CArrayFixFlat<TApaAppServiceInfo>* serviceArray = new(ELeave) CArrayFixFlat<TApaAppServiceInfo>(4);
+	CleanupStack::PushL(TCleanupItem(CleanupServiceArray, serviceArray));
+	CBufBase* buffer = GetServiceBufferLC(EAppListServGetServiceImplementations, aServiceUid);
+	RBufReadStream readStream(*buffer);
+	readStream >> *serviceArray;
+	CleanupStack::PopAndDestroy(buffer);
+	CleanupStack::Pop(serviceArray);
+	CApaAppServiceInfoArrayWrapper* wrapper = CApaAppServiceInfoArrayWrapper::NewL(serviceArray); // takes ownership of serviceArray
+	CleanupStack::PushL(wrapper);
+	return wrapper;
+	}
+	
+EXPORT_C CApaAppServiceInfoArray* RApaLsSession::GetServiceImplementationsLC(TUid aServiceUid, const TDataType& aDataType) const
+/** Gets the service implementations for the specified service UID. The implementation must also be
+able to handle the data type given as argument.
+
+The returned CApaAppServiceInfoArray object contains an array of TApaAppServiceInfo objects.
+
+Information on each implementation is contained in a TApaAppServiceInfo object.
+
+TApaAppServiceInfo::Uid() returns the UID of the application that implements the
+specified service UID.
+
+@param aServiceUid The service UID.
+@param aDataType The data type that must be supported by the implementation.
+@return A pointer to a CApaAppServiceInfoArray object left on the cleanup stack.
+@leave KErrNotFound No service implementations for the specified service UID can be found.
+@leave EAppListInvalid The server's initial population of the list has not completed.
+@leave KErrNoMemory There is insufficient memory to perform the operation.
+@see CApaAppServiceInfoArray::Array()
+@see TApaAppServiceInfo
+@publishedPartner
+@released
+*/
+	{
+	CArrayFixFlat<TApaAppServiceInfo>* serviceArray = new(ELeave) CArrayFixFlat<TApaAppServiceInfo>(4);
+	CleanupStack::PushL(TCleanupItem(CleanupServiceArray, serviceArray));
+	CBufBase* buffer = GetServiceBufferLC(EAppListServGetServiceImplementationsDataType, aServiceUid, aDataType);
+	RBufReadStream readStream(*buffer);
+	readStream >> *serviceArray;
+	CleanupStack::PopAndDestroy(buffer);
+	CleanupStack::Pop(serviceArray);
+	CApaAppServiceInfoArrayWrapper* wrapper = CApaAppServiceInfoArrayWrapper::NewL(serviceArray); // takes ownership of serviceArray
+	CleanupStack::PushL(wrapper);
+	return wrapper;
+	}
+
+/** Gets the service UIDs implemented by the application with the specified UID.
+
+@param aAppUid The application specific UID.
+@param aServiceUids On return, contains the service UIDs implemented by the specified
+application UID.
+@leave KErrNotFound No matching application can be found, or a matching application
+does not implement any services.
+@leave KErrNotSupported The specified application does not provide an application
+registration file.
+@leave KErrNoMemory There is insufficient memory to perform the operation.
+@publishedPartner
+@released
+*/
+EXPORT_C void RApaLsSession::GetAppServicesL(TUid aAppUid, CArrayFixFlat<TUid>& aServiceUids) const
+	{
+	CBufBase* buffer = GetServiceBufferLC(EAppListServGetAppServiceUids, aAppUid);
+	RBufReadStream readStream(*buffer);
+	readStream >> aServiceUids;
+	CleanupStack::PopAndDestroy(buffer);
+	}
+
+
+
+/** Gets the service implementation's opaque data for the specified application and service.
+
+The specified application may provide more than one implementation of the specified service.
+
+The returned CApaAppServiceInfoArray object contains an array of TApaAppServiceInfo objects,
+each of which provides information on an implementation.
+
+For each TApaAppServiceInfo object, TApaAppServiceInfo::Uid() returns the specified service UID.
+
+@param aAppUid The application specific UID.
+@param aServiceUid The service UID.
+@return A pointer to a CApaAppServiceInfoArray object left on the cleanup stack.
+@leave KErrNotFound No matching application can be found, or a matching application
+does not implement the specified service.
+@leave KErrNotSupported The specified application does not provide an application
+registration file.
+@leave KErrNoMemory There is insufficient memory to perform the operation.
+@see CApaAppServiceInfoArray::Array()
+@see TApaAppServiceInfo
+@publishedPartner
+@released
+*/
+EXPORT_C CApaAppServiceInfoArray* RApaLsSession::GetAppServiceOpaqueDataLC(TUid aAppUid, TUid aServiceUid) const
+	{
+	CArrayFixFlat<TApaAppServiceInfo>* serviceArray = new(ELeave) CArrayFixFlat<TApaAppServiceInfo>(4);
+	CleanupStack::PushL(TCleanupItem(CleanupServiceArray, serviceArray));
+	CBufBase* buffer = GetServiceBufferLC(EAppListServGetAppServiceOpaqueData, aAppUid, aServiceUid);
+	RBufReadStream readStream(*buffer);
+	readStream >> *serviceArray;
+	CleanupStack::PopAndDestroy(buffer);
+	CleanupStack::Pop(serviceArray);
+	CApaAppServiceInfoArrayWrapper* wrapper = CApaAppServiceInfoArrayWrapper::NewL(serviceArray); // takes ownership of serviceArray
+	CleanupStack::PushL(wrapper);
+	return wrapper;
+	}
+
+
+
+/** Gets the UID of an application that can handle the specified data (MIME) type and service.
+
+If no application can be found, the function returns the UID of the preferred 
+default handler. If none of the default handlers can handle the combination
+of data type and service, then a NULL UID is returned in aAppUid.
+
+@param aDataType The data (MIME) type.
+@param aServiceUid The service UID.
+@param aAppUid On return, the UID of the application that can handle the data 
+(MIME) type and service; this may be NULL.
+@return KErrNone, if successful; otherwise one of the other system-wide error 
+codes.
+@publishedPartner
+@released
+*/
+EXPORT_C TInt RApaLsSession::AppForDataTypeAndService(const TDataType& aDataType, TUid aServiceUid, TUid& aAppUid) const
+	{
+	const TPckgC<TDataType> dataType(aDataType);
+	TPckg<TUid> uid(aAppUid);
+	return SendReceiveWithReconnect(EAppListServAppForDataTypeAndService,TIpcArgs(&dataType, aServiceUid.iUid,&uid));
+	} //lint !e1764 Suppress reference parameter 'aAppUid' could be declared const ref
+
+EXPORT_C TInt RApaLsSession::AppForDocumentAndService(const TDesC& aFileName, TUid aServiceUid, TUid& aAppUid, TDataType& aDataType) const
+/** Gets the data (MIME) type of the data in the specified file and gets the UID 
+of an application that can handle this type and service.
+
+@param aFileName The name of the file containing the data.
+@param aServiceUid The service UID
+@param aUid On return, the UID of the application that can handle the data 
+(MIME) type and service; this may be NULL.
+@param aDataType On return, the data (MIME) type.
+@return KErrNone, if successful; otherwise one of the other system-wide error 
+codes.
+@publishedPartner
+@released
+*/
+	{
+	return DoAppForDocumentOptionallySpecifyingService(aFileName, aServiceUid, aAppUid, aDataType, EAppListServAppForDocumentAndService);
+	}
+
+EXPORT_C TInt RApaLsSession::AppForDocumentAndService(const RFile& aFile, TUid aServiceUid, TUid& aAppUid, TDataType& aDataType) const
+/** Gets the data (MIME) type of the data in the specified file and gets the UID 
+of an application that can handle this type and service.
+
+@param aFile The file handle.  Before this function can be called,
+the file server session which owns this file handle must first be marked as shareable by 
+calling RFs::ShareProtected().
+@param aServiceUid The service UID.
+@param aUid On return, the UID of the application that can handle the data 
+(MIME) type and service; this may be NULL.
+@param aDataType On return, the data (MIME) type.
+@return KErrNone, if successful; otherwise one of the other system-wide error 
+codes.
+@publishedPartner
+@released
+*/
+	{
+	return DoAppForDocumentOptionallySpecifyingService(aFile, aServiceUid, aAppUid, aDataType, EAppListServAppForDocumentAndServicePassedByFileHandle);
+	}
+
+TInt RApaLsSession::DoAppForDocumentOptionallySpecifyingService(const TDesC& aFileName, TUid aServiceUid, TUid& aAppUid, TDataType& aDataType, TInt aOpcode) const
+	{
+	if (aFileName.Length()==0)
+		{
+		aAppUid = KNullUid;
+		return KErrNone;
+		}
+	HBufC8* buffer=NULL;
+	TInt error=GetBufferFromFile(buffer, aFileName);
+	if (error!=KErrNone)
+		{
+		return error;
+		}
+	SReturnData_AppForDocument returnData;
+	TPckg<SReturnData_AppForDocument> returnData_asDescriptor(returnData);
+	error=SendReceiveWithReconnect(aOpcode,TIpcArgs(&returnData_asDescriptor, aServiceUid.iUid, &aFileName, buffer));
+	delete buffer;
+	buffer=NULL;
+	if (error==KErrNone)
+		{
+		aAppUid=returnData.iUid;
+		aDataType=returnData.iDataType;
+		}
+	return error;
+	}
+
+TInt RApaLsSession::DoAppForDocumentOptionallySpecifyingService(const RFile& aFile, TUid aServiceUid, TUid& aAppUid, TDataType& aDataType, TInt aOpcode) const
+	{
+	SReturnData_AppForDocument returnData;
+	TPckg<SReturnData_AppForDocument> returnData_asDescriptor(returnData);
+	TIpcArgs ipcArgs(&returnData_asDescriptor, aServiceUid.iUid);
+	TInt error=aFile.TransferToServer(ipcArgs, 2, 3);
+	if (error == KErrNone)
+		{
+		error=SendReceiveWithReconnect(aOpcode, ipcArgs);
+		}
+	if (error==KErrNone)
+		{
+		aAppUid=returnData.iUid;
+		aDataType=returnData.iDataType;
+		}
+	return error;
+	}
+
+TInt RApaLsSession::GetBufferFromFile(HBufC8*& aBuffer, const TDesC& aFileName) const
+	{
+	TInt preferredBufSize=0;
+	const TInt error=GetPreferredBufSize(preferredBufSize);
+	if (error<KErrNone)
+		{
+		return error;
+		}
+	HBufC8* const buffer=HBufC8::New(Max(8, preferredBufSize)); // 8 is a sensible minimum
+	if (buffer==NULL)
+		{
+		return KErrNoMemory;
+		}
+	const RFs* fsSession=FsSession();
+	RFs tempFsSession;
+	if (fsSession==NULL)
+		{
+		const TInt error=tempFsSession.Connect();
+		if (error!=KErrNone)
+			{
+			delete buffer;
+			return error;
+			}
+		fsSession=&tempFsSession;
+		}
+	if (fsSession->IsValidName(aFileName))
+		{
+		TPtr8 buffer_asWritable(buffer->Des());
+		const TInt error=fsSession->ReadFileSection(aFileName, 0, buffer_asWritable, preferredBufSize);
+		if (error!=KErrNone)
+			{
+			delete buffer;
+			tempFsSession.Close();
+			return error;
+			}
+		}
+	if (fsSession==&tempFsSession)
+		{
+		tempFsSession.Close();
+		}
+	aBuffer=buffer;
+	return KErrNone;
+	}
+
+EXPORT_C void RApaLsSession::SetFsSessionL(RFs& aFsSession)
+/**
+@internalTechnology
+*/
+	{ // static
+	User::LeaveIfError(Dll::SetTls(&aFsSession));
+	}
+
+EXPORT_C void RApaLsSession::ClearFsSession()
+/**
+@internalTechnology
+*/
+	{ // static
+	Dll::FreeTls();
+	}
+
+EXPORT_C RFs* RApaLsSession::FsSession()
+/**
+@internalComponent
+*/
+	{ // static
+	return static_cast<RFs*>(Dll::Tls());
+	}
+
+/** @publishedPartner */
+EXPORT_C void RApaLsSession::RegisterNonNativeApplicationTypeL(TUid aApplicationType, const TDesC& aNativeExecutable)
+	{
+	User::LeaveIfError(SendReceiveWithReconnect(EAppListServRegisterNonNativeApplicationType, TIpcArgs(aApplicationType.iUid, &aNativeExecutable)));
+	} //lint !e1762 Suppress member function could be made const
+
+/** @publishedPartner */
+EXPORT_C void RApaLsSession::DeregisterNonNativeApplicationTypeL(TUid aApplicationType)
+	{
+	User::LeaveIfError(SendReceiveWithReconnect(EAppListServDeregisterNonNativeApplicationType, TIpcArgs(aApplicationType.iUid)));
+	} //lint !e1762 Suppress member function could be made const
+	
+/** @publishedPartner */
+EXPORT_C void RApaLsSession::PrepareNonNativeApplicationsUpdatesL()
+	{
+	TIpcArgs ipcArgs(0, 0, 0, 0);
+	User::LeaveIfError(SendReceiveWithReconnect(EAppListServPrepareNonNativeApplicationsUpdates, ipcArgs));
+	} //lint !e1762 Suppress member function could be made const
+
+/** @publishedPartner */
+EXPORT_C void RApaLsSession::RegisterNonNativeApplicationL(TUid aApplicationType, const TDriveUnit& aDrive, CApaRegistrationResourceFileWriter& aRegistrationResourceFile, CApaLocalisableResourceFileWriter* aLocalisableResourceFile, const RFile* aIconFile)
+	{
+	TIpcArgs ipcArgs(0, 0, 0, 0);
+	RBuf8 ipcParameter0;
+	CleanupClosePushL(ipcParameter0);
+	RBuf8 ipcParameter1;
+	CleanupClosePushL(ipcParameter1);
+	if (aLocalisableResourceFile==NULL)
+		{
+		__ASSERT_ALWAYS(aIconFile==NULL, Panic(EPanicIconFileWithoutLocalisableResourceFile));
+		ipcArgs.Set(1, NULL);
+		}
+	else
+		{
+		TParse* const parser=new(ELeave) TParse;
+		CleanupStack::PushL(parser);
+		const TDriveName driveName(aDrive.Name()); // TDriveName is a TBuf<2>
+
+		if (aIconFile!=NULL)
+			{
+			User::LeaveIfError(aIconFile->TransferToServer(ipcArgs, 2, 3));
+
+			TFileName* const fileName=new(ELeave) TFileName;
+			CleanupStack::PushL(fileName);
+			User::LeaveIfError(aIconFile->Name(*fileName));
+			parser->SetNoWild(*fileName, &KLitPathForNonNativeResourceAndIconFiles, &driveName);
+			aLocalisableResourceFile->SetIconFileL(parser->FullName());
+			CleanupStack::PopAndDestroy(fileName);
+			}
+		aLocalisableResourceFile->GenerateFileContentsL(ipcParameter1); // must be done after the aLocalisableResourceFile->SetIconFileL call (if there is one)
+		const TDesC8& ipcParameter1_asConst=ipcParameter1;
+		ipcArgs.Set(1, &ipcParameter1_asConst);
+
+		TBuf<30> fileName;
+		fileName.Format(KLitFormatForLocalisableResourceFile, aRegistrationResourceFile.AppUid().iUid);
+		parser->SetNoWild(fileName, &KLitPathForNonNativeResourceAndIconFiles, &driveName);
+		aRegistrationResourceFile.SetLocalisableResourceFileL(parser->FullName());
+
+		CleanupStack::PopAndDestroy(parser);
+		}
+	aRegistrationResourceFile.GenerateFileContentsL(ipcParameter0); // must be done after the aRegistrationResourceFile.SetLocalisableResourceFileL call (if there is one)
+	SNonNativeApplicationInfo nonNativeApplicationInfo;
+	nonNativeApplicationInfo.iApplicationType=aApplicationType;
+	nonNativeApplicationInfo.iDrive=aDrive;
+	ipcParameter0.ReAllocL(sizeof(SNonNativeApplicationInfo)+ipcParameter0.Length());
+	ipcParameter0.Insert(0, TPckgC<SNonNativeApplicationInfo>(nonNativeApplicationInfo));
+	const TDesC8& ipcParameter0_asConst=ipcParameter0;
+	ipcArgs.Set(0, &ipcParameter0_asConst);
+
+	User::LeaveIfError(SendReceiveWithReconnect(EAppListServRegisterNonNativeApplication, ipcArgs));
+	CleanupStack::PopAndDestroy(2, &ipcParameter0);
+	} //lint !e1762 Suppress member function could be made const
+
+/** @publishedPartner */
+EXPORT_C void RApaLsSession::DeregisterNonNativeApplicationL(TUid aApplication)
+	{
+	User::LeaveIfError(SendReceiveWithReconnect(EAppListServDeregisterNonNativeApplication, TIpcArgs(aApplication.iUid)));
+	} //lint !e1762 Suppress member function could be made const
+	
+/**
+Commits the non-native application updates. This is a synchronous method which waits 
+until the application list is updated.
+	 
+@see ForceCommitNonNativeApplicationsUpdatesL
+@publishedPartner
+@released
+*/
+
+EXPORT_C void RApaLsSession::CommitNonNativeApplicationsUpdatesL()
+	{
+	TIpcArgs ipcArgs(EFalse, 0, 0, 0);
+	User::LeaveIfError(SendReceiveWithReconnect(EAppListServCommitNonNativeApplications, ipcArgs));
+	} //lint !e1762 Suppress member function could be made const
+
+
+/**
+Commits the non-native application updates. This is an asynchronous method which will not wait until 
+the application list is updated. CApaAppListNotifier class should be used to synchronize the completion 
+of updating the application list. 
+ 
+@see CommitNonNativeApplicationsUpdatesL
+@see CApaAppListNotifier
+@publishedPartner
+@released
+*/
+
+EXPORT_C void RApaLsSession::ForceCommitNonNativeApplicationsUpdatesL()
+	{
+	TIpcArgs ipcArgs(ETrue, 0, 0, 0);
+	User::LeaveIfError(SendReceiveWithReconnect(EAppListServCommitNonNativeApplications, ipcArgs));
+	}
+
+/** 
+Rolls back all changes made to the list of installed non-native applications since the last call to
+PrepareNonNativeApplicationsUpdatesL().
+
+This function can be called even if PrepareNonNativeApplicationsUpdatesL() hasn't been called before (in which
+case it does nothing).
+
+@publishedPartner
+*/
+EXPORT_C TInt RApaLsSession::RollbackNonNativeApplicationsUpdates()
+	{
+	TIpcArgs ipcArgs(0, 0, 0, 0);
+	return SendReceiveWithReconnect(EAppListServRollbackNonNativeApplications, ipcArgs);
+	} //lint !e1762 Suppress member function could be made const
+
+EXPORT_C void RApaLsSession::SetNotify(TBool aCompleteImmediatelyIfNoScanImpendingOrInProgress, TRequestStatus& aStatus)
+/**
+@internalTechnology */
+	{
+	SendReceive(ESetNotify,TIpcArgs(aCompleteImmediatelyIfNoScanImpendingOrInProgress),aStatus);
+	} //lint !e1762 Suppress member function could be made const
+
+EXPORT_C void RApaLsSession::CancelNotify()
+/**
+@internalTechnology */
+	{
+	SendReceive(ECancelNotify,TIpcArgs());
+	} //lint !e1762 Suppress member function could be made const
+	
+/**
+Gets the application type of the application. For a native application the type is KNullUid.
+@return A standard error code.
+@publishedPartner
+@released
+@param aTypeUid On return contains the application's type
+@param aAppUid The application's UID passed into TIpcArgs	
+*/
+EXPORT_C TInt RApaLsSession::GetAppType(TUid& aTypeUid, TUid aAppUid) const
+	{
+	TPckg<TUid> uid(aTypeUid);
+	return SendReceiveWithReconnect(EAppListServGetAppType,TIpcArgs(aAppUid.iUid,&uid));
+	} //lint !e1764 Suppress reference parameter 'aTypeUid' could be declared const ref
+	
+/**
+This function is only for use by Software Install.
+
+As part of the fix for defect INC069526, we added a check in apparc. We check if the application has 
+been installed before adding it to the apparc db. A side-effect of this fix is that it is not possible 
+to launch applications that are being installed from the installation process itself. This is a regresssion.
+
+To fix this regression we added this function. It allows Software Install to specify a list of registration
+files that need to be included in apparc's list even if they have not been marked as installed in the
+SISRegistry or JavaRegistry. The list of registration files is cleared once Software Install notifies
+(via P&S) the end of the installation (whether successful or not).
+The function also forces a rescan and only returns when this rescan is complete. This is because 
+Software Install needs to be sure the registration files have been added to apparc's list before 
+trying to launch the recently installed applications.
+
+@param aRegFiles The list of registration files for which the SISRegistry check must be ignored.
+@return A standard error code.
+@internalAll
+@released
+*/
+EXPORT_C TInt RApaLsSession::ForceRegistration(const RPointerArray<TDesC>& aRegFiles)
+	{
+	CBufFlat* buffer = 0;
+	TRAPD(err, buffer = CreateRegFilesBufferL(aRegFiles));
+	if (err != KErrNone)
+		{
+		return err;
+		}
+	TPtr8 ptr = buffer->Ptr(0);
+	const TInt returnValue=SendReceiveWithReconnect(EAppListServForceRegistration,TIpcArgs(&ptr));
+	delete buffer;
+	return returnValue;
+	} //lint !e1762 Suppress member function could be made const
+	
+TInt RApaLsSession::SendReceiveWithReconnect(TInt aFunction,const TIpcArgs& aIpcArgs) const
+	{
+	TInt ret = SendReceive(aFunction, aIpcArgs);
+	if(ret != KErrServerTerminated)
+		{
+		return ret;
+		}
+
+	RApaLsSession ls;
+	TInt err=ls.Connect();
+	if (err==KErrNone)
+		{
+		RApaLsSession* const localThis = const_cast<RApaLsSession*>(this);
+		localThis->Close();
+		localThis->iHandle=ls.iHandle;
+		ret = SendReceive(aFunction, aIpcArgs);
+		}
+	return ret;
+	}
+
+void RApaLsSession::DoGetAppOwnedFilesL(CDesCArray& aArrayToFill, TUid aAppUid) const
+	{
+	TDesCArrayFiller arrayFiller(aArrayToFill);
+	FetchArrayL(arrayFiller, aAppUid, EAppListServGetFileOwnershipInfo, KInitialOwnedFilesBufSize);
+	}
+
+EXPORT_C void RApaLsSession::RegisterListPopulationCompleteObserver(TRequestStatus& aStatus) const
+/** Registers an observer with apparc server to notify when the initial population of applist is completed
+
+@param aStatus Request status object. On successful completion contains KErrNone, otherwise one of the 
+system-wide error codes. 
+@see CancelListPopulationCompleteObserver()
+*/
+	{
+	SendReceive(ERegisterListPopulationCompleteObserver,TIpcArgs(TIpcArgs::ENothing),aStatus);
+	}
+
+EXPORT_C TInt RApaLsSession::CancelListPopulationCompleteObserver() const
+/** Cancels the observer registered with apparc server to notify when the initial population of applist is completed
+ 
+@return KErrNone, if successful; otherwise one of the system-wide error codes. 
+*/
+	{
+	return SendReceiveWithReconnect(ECancelListPopulationCompleteObserver,TIpcArgs(TIpcArgs::ENothing));
+	}
+
+EXPORT_C TInt RApaLsSession::MatchesSecurityPolicy(TBool& aMatches, TUid aAppUid, const TSecurityPolicy& aSecurityPolicy) const
+/** Tests whether the given TSecurityPolicy matches with the application TSecurityPolicy.
+
+@param aMatches On return, contains the result. ETrue if the application TSecurityPolicy matches the given TSecurityPolicy or else EFalse
+@param aAppUid Uid of the application for which the security policy has to be matched
+@param aSecurityPolicy TSecurityPolicy to test whether the application with given uid matches with its TSecurityPolicy or not.
+@return KErrNone, if successful; otherwise one of the other system-wide error codes.
+@see TSecurityPolicy
+*/
+	{
+	const TPckgC<TSecurityPolicy> securityPolicy(aSecurityPolicy);
+	const TInt result = SendReceiveWithReconnect(EMatchesSecurityPolicy,TIpcArgs(aAppUid.iUid, &securityPolicy));
+
+	if (result>=0)
+		{
+		aMatches = result;
+		}
+	return result;
+	}
+
+EXPORT_C void RApaLsSession::RApaLsSession_Reserved1()
+	{
+	}
+	
+EXPORT_C void RApaLsSession::RApaLsSession_Reserved2()
+	{
+	}
+	
+EXPORT_C void RApaLsSession::NotifyOnDataMappingChange(TRequestStatus& aRequestStatus)
+/** Notification of changes in data-type mapping
+
+This asynchronous function (whose corresponding "cancel" operation is CancelNotifyOnDataTypeMappingChange) completes when any data-type / application-UID association changes, i.e. when the default application handling a particular MIME-type changes.
+
+@param aRequestStatus As is normal for an asynchronous operation, this object is set to something other than KRequestPending when the asynchronous operation that has been triggered by this function completes.
+@see CancelNotifyOnDataTypeMappingChange
+*/
+	{
+	SendReceive(ENotifyOnDataMappingChange,TIpcArgs(), aRequestStatus);
+ 	} //lint !e1762 Suppress member function could be made const
+ 	
+EXPORT_C void RApaLsSession::CancelNotifyOnDataMappingChange()
+/** Cancellation of notification of changes in data-type mapping
+
+This cancels the outstanding the NotifyOnDataTypeMappingChange issued by this client, if there is one outstanding. Otherwise it does nothing.
+@see NotifyOnDataTypeMappingChange
+*/
+	{
+	SendReceive(ECancelNotifyOnDataMappingChange,TIpcArgs());
+	} //lint !e1762 Suppress member function could be made const
+
+CBufFlat* RApaLsSession::CreateRegFilesBufferL(const RPointerArray<TDesC>& aRegFiles)
+	{
+	// Serialize the array
+	// Format of the buffer is :
+	// 4 bytes for array item count
+	// for each item : 4 bytes for length and then the string contents
+	const TInt count = aRegFiles.Count();
+	TInt requiredBufferSize = 4;	// For the array item count
+	for (TInt index = 0; index < count; ++index)
+		{
+		requiredBufferSize += 4;	// For the string length
+		requiredBufferSize += aRegFiles[index]->Size();
+		}
+	
+	CBufFlat* const buffer = CBufFlat::NewL(requiredBufferSize);
+	CleanupStack::PushL(buffer);
+	buffer->ExpandL(0,requiredBufferSize);
+	RBufWriteStream writeStream;
+	writeStream.Open(*buffer);
+	CleanupClosePushL(writeStream);
+	writeStream.WriteUint32L(count);
+	for (TInt index = 0; index < count; ++index)
+		{
+		writeStream.WriteUint32L(aRegFiles[index]->Length());
+		writeStream.WriteL(*aRegFiles[index]);
+		}
+	writeStream.CommitL();
+	CleanupStack::PopAndDestroy(&writeStream);
+	CleanupStack::Pop(buffer);
+	return buffer;
+	}
+
+// TSizeArrayFiller
+
+void TSizeArrayFiller::AppendItemL(RReadStream& aReadStream)
+	{
+	TSize size;
+	size.iWidth =aReadStream.ReadUint32L();
+	size.iHeight=aReadStream.ReadUint32L();
+	iArray.AppendL(size);
+	}
+
+
+
+// TViewDataArrayFiller
+
+void TViewDataArrayFiller::AppendItemL(RReadStream& aReadStream)
+	{
+	TApaAppViewInfo info;
+	aReadStream >> info;
+	iArray.AppendL(info);
+	}
+
+
+
+// TDesCArrayFiller
+
+void TDesCArrayFiller::AppendItemL(RReadStream& aReadStream)
+	{
+	TFileName info;
+	aReadStream >> info;
+	iArray.AppendL(info);
+	}
+
+/* @internalComponent
+*/
+EXPORT_C TUint MinApplicationStackSize()
+	{
+	return KMinApplicationStackSize;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apgrfx/APGCTL.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,400 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <e32uid.h>
+#include "APGCTL.H"
+#include "APGICNFL.H" 
+#include "APGSTD.H" 
+#include "APFDEF.H"
+#include "../apparc/TRACE.H"
+#include "APGCLI.H"
+#include "APACMDLN.H"
+
+///////////////////////////////////////////
+// CApaSystemControl
+///////////////////////////////////////////
+
+CApaSystemControl* CApaSystemControl::NewL(RFs& aFs,const TDesC& aFullPath,const TUidType aUidType)
+	{
+	CApaSystemControl* self=new(ELeave) CApaSystemControl(aFs);
+	CleanupStack::PushL(self);
+	self->ConstructL(aFullPath,aUidType);
+	CleanupStack::Pop();
+	return self;
+	}
+
+CApaSystemControl::CApaSystemControl(RFs& aFs)
+	:iExists(ETrue),
+	 iFs(aFs)
+	{}
+
+
+CApaSystemControl::~CApaSystemControl()
+	{
+	delete iCaption;
+	delete iShortCaption;
+	delete iIcon;
+	iNext = NULL;
+	}
+
+void CApaSystemControl::ConstructL(const TDesC& aFullPath,const TUidType aUidType)
+	{
+	//
+	// check the file type
+	if (aUidType[1]!=KUidApp) 
+		User::Leave(KErrNotSupported);
+
+	iFullPath=aFullPath;
+	iUidType=aUidType;
+
+	//Construct the new style control panel application. 
+	RApaLsSession ls;
+	User::LeaveIfError(ls.Connect());
+	CleanupClosePushL(ls);
+	TApaAppInfo info;
+	if(ls.GetAppInfo(info, aUidType[2])==KErrNone && info.iCaption.Length()>0)
+		{
+		iCaption=info.iCaption.AllocL();
+		iShortCaption=iCaption->AllocL();
+		}
+	// get the icon for the application
+	CApaMaskedBitmap *icon=CApaMaskedBitmap::NewLC();
+	User::LeaveIfError(ls.GetAppIcon(aUidType[2], TSize(48,48), *icon));
+	CleanupStack::Pop(icon);
+	iIcon=icon;
+	CleanupStack::PopAndDestroy(&ls);
+
+	if (!iCaption)
+		{
+		TParsePtrC ptr(aFullPath);
+		iCaption = ptr.Name().AllocL();
+		iShortCaption = iCaption->AllocL();
+		}
+	}
+
+EXPORT_C void CApaSystemControl::CreateL()
+/*
+Connects to apparc server and ask the server to launch an application.
+*/
+	{
+	RApaLsSession apparcsession;
+	User::LeaveIfError(apparcsession.Connect());
+	CleanupClosePushL(apparcsession);
+	TThreadId threadId;
+	CApaCommandLine *commandLine=CApaCommandLine::NewLC();
+	commandLine->SetExecutableNameL(iFullPath);
+	commandLine->SetCommandL(EApaCommandRunWithoutViews);
+	User::LeaveIfError(apparcsession.StartApp(*commandLine,threadId));
+	CleanupStack::PopAndDestroy(2,&apparcsession);
+		
+	//To preserve the existing synchronous behaviour of control panel items
+	//we logon to the newly started control panel thread and wait
+	//till it exits.
+	RThread thread;
+	User::LeaveIfError(thread.Open(threadId,EOwnerThread));
+	TRequestStatus status;
+	thread.Logon(status);
+	User::WaitForRequest(status);
+	thread.Close();
+	} //lint !e1762 Member function could be made const - Lint is wrong, it should not be const
+
+EXPORT_C TUid CApaSystemControl::Type()const
+/** Gets the UID that uniquely identifies the control.
+
+@return The UID. */
+	{
+	return iUidType[2];
+	}
+
+EXPORT_C TFileName CApaSystemControl::FileName()const
+/** Gets the full path name of the control. 
+
+@return The full path name. */
+	{
+	return iFullPath;
+	}
+
+EXPORT_C CApaMaskedBitmap* CApaSystemControl::Icon()const
+/** Gets the control's icon.
+
+@return The icon bitmap. */
+	{
+	return iIcon;
+	}
+
+EXPORT_C TPtrC CApaSystemControl::Caption()const
+/** Gets the control's caption.
+
+@return A non-modifiable pointer descriptor representing the control's caption. */
+	{
+	__ASSERT_DEBUG(iCaption,Panic(EDPanicNoCaptionInControl));
+	return *iCaption;
+	}
+
+
+EXPORT_C TPtrC CApaSystemControl::ShortCaption()const
+/** Gets the control's short caption.
+
+@return A non-modifiable pointer descriptor representing the control's short 
+caption. */
+	{
+	__ASSERT_DEBUG(iCaption,Panic(EDPanicNoCaptionInControl));
+	if (iShortCaption)
+		return *iShortCaption;
+	else
+		return *iCaption;
+	}
+
+///////////////////////////////////////////
+// CApaSystemControlList
+///////////////////////////////////////////
+
+EXPORT_C CApaSystemControlList* CApaSystemControlList::NewL(RFs& aFs)
+/** Allocates and constructs a control panel application list. After construction, 
+it calls UpdateL(), to initialise the list.
+
+@param aFs Handle to a file server session.
+@return	The newly created control panel application list. */
+	{
+	CApaSystemControlList* self=new(ELeave) CApaSystemControlList(aFs);
+	CleanupStack::PushL(self);
+	self->UpdateL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+EXPORT_C CApaSystemControlList::~CApaSystemControlList()
+/** Destructor. */
+	{
+	CApaSystemControl* control=iControl;
+	CApaSystemControl* next;
+	while (control)
+		{
+		next = control->iNext;
+		delete control;
+		control = next;
+		}
+	iControl = NULL;
+	}
+
+EXPORT_C TInt CApaSystemControlList::Count()const
+/** Gets the number of control panel applications in the list.
+
+@return The number of control panel applications in the list. */
+	{
+	TInt count=0;
+	CApaSystemControl* control=iControl;
+	while (control)
+		{
+		count++;
+		control = control->iNext;
+		}
+	return count;
+	}
+
+
+EXPORT_C TInt CApaSystemControlList::Index(TUid aType)const
+/** Gets the index into the list of the control panel application 
+whose third UID matches the specified UID.
+
+@param aType The control panel application specific UID.
+@return The index of the control panel application if there is a 
+match, or KErrNotFound if not. */
+	{
+	TInt count=0;
+	CApaSystemControl* control=iControl;
+	while (control && control->Type()!=aType)
+		{
+		count++;
+		control = control->iNext;
+		}
+	if (!control)
+		count = KErrNotFound;
+	return count;
+	}
+
+
+EXPORT_C CApaSystemControl* CApaSystemControlList::Control(TInt aIndex)const
+/** Gets the control panel application at the specified index in the list.
+
+@param aIndex Index of a control panel application in the list. 
+@return The control panel application at the specified index in the list.
+@panic APGRFX 10. The index is out of range. */
+
+	{
+	TInt count=0;
+	CApaSystemControl* control=iControl;
+	while (control && count!=aIndex)
+		{
+		count++;
+		control = control->iNext;
+		}
+	//
+	__ASSERT_ALWAYS(control,Panic(EPanicIndexOutOfRange));
+	return control;
+	}
+
+
+EXPORT_C CApaSystemControl* CApaSystemControlList::Control(TUid aType)const
+/** Gets the control panel application in the list with the specified UID. 
+
+@param aType The control panel application's third UID. 
+@return The control panel application whose type matches aType, or null 
+if none match. */
+
+	{
+	CApaSystemControl* control=iControl;
+	while (control && control->Type()!=aType)
+		control = control->iNext;
+	return control;
+	}
+
+
+CApaSystemControl* CApaSystemControlList::PreviousControl(const CApaSystemControl* aControl) const
+	{
+	CApaSystemControl* control=iControl;
+	CApaSystemControl* previous=NULL;
+	while (control && control!=aControl)
+		{
+		previous = control;
+		control = control->iNext;
+		}
+	if (!control)
+		previous = NULL;
+	return previous;
+	}
+
+
+EXPORT_C void CApaSystemControlList::UpdateL()
+/** Updates the list of control panel applications. For each new one found, a CApaSystemControl 
+object is created and added to the list. Control panel applications that no longer 
+exist are removed, and applications already in the list can be replaced 
+by ones found on earlier drives in the search order(y:->a: then z:). */
+
+// increments iUpdateCount if list has changed
+// if an error occurs, the list will not be complete but will be functional
+ 
+	{
+	__SHOW_TRACE(_L("Starting CApaSystemControlList::UpdateL()"));
+	// set all the current controls to "dont exist", so we can find them again
+	CApaSystemControl* control=iControl;
+	while (control)
+		{
+		control->iExists = EFalse;
+		control = control->iNext;
+		}
+
+	//Connect to the apparc server and get the control panel application. 
+	TBool listChanged=EFalse;
+	RApaLsSession apparcsession;
+	User::LeaveIfError(apparcsession.Connect());
+	CleanupClosePushL(apparcsession);
+	//Set the filter
+	User::LeaveIfError(apparcsession.GetFilteredApps(TApaAppCapability::EControlPanelItem,TApaAppCapability::EControlPanelItem));
+	
+	TApaAppInfo aInfo;
+	//Fetch the control panel information one by one and add a corresponding control
+	//to the control's list.
+	while(apparcsession.GetNextApp(aInfo) == KErrNone)
+		{
+		control=Control(aInfo.iUid);
+		if (control == NULL)
+			{// not in list, so add it at the start
+			__SHOW_TRACE(_L("...New control located"));
+			listChanged=ETrue;
+			TUidType uidType(KExecutableImageUid,KUidApp,aInfo.iUid);
+			TRAPD(err,control = CApaSystemControl::NewL(iFs,aInfo.iFullName,uidType));
+			if (err==KErrNone)
+				{
+				__SHOW_TRACE(_L("...control added"));
+				control->iNext = iControl;
+				iControl = control;
+				}
+			}
+		else if (!control->iExists)
+			{// not already found - we made need to override this one
+			if (aInfo.iFullName.CompareF(control->FileName()) != 0)
+				{
+				__SHOW_TRACE(_L("...new instance of control - delete old one"));
+				// delete the old one before creating the new one so that the correct library is loaded
+				CApaSystemControl* prev=PreviousControl(control);
+				if (prev)
+					{
+					prev->iNext=control->iNext;
+					}
+				else
+					{
+					iControl=control->iNext;
+					}
+				delete control;
+				control=NULL;
+				listChanged=ETrue;
+				// create the new one. Add it to the list if this is successful
+				__SHOW_TRACE(_L("...create new one"));
+				TUidType uidType(KExecutableImageUid,KUidApp,aInfo.iUid);
+				TRAPD(err,control = CApaSystemControl::NewL(iFs,aInfo.iFullName,uidType));
+				if (err==KErrNone)
+					{
+					__SHOW_TRACE(_L("...new one created"));
+					control->iNext=iControl;
+					iControl=control;
+					}
+				}
+			else
+				{
+				control->iExists=ETrue;
+				}
+			}
+		}
+		
+	CleanupStack::PopAndDestroy(&apparcsession); //apparcsession destroy
+
+	CApaSystemControl* previousControl=NULL;
+	control = iControl;
+	while (control)
+		{
+		if (!control->iExists)
+			{
+			listChanged=ETrue;
+			if (!previousControl)
+				{// this must be the first control in the list, ie iControl
+				iControl = control->iNext;
+				delete control;
+				control = iControl;
+				}
+			else
+				{
+				previousControl->iNext = control->iNext;
+				delete control;
+				previousControl = previousControl->iNext;
+				control = previousControl->iNext;
+				}
+			}
+		else
+			{
+			control = control->iNext;
+			}
+		}
+	//
+	// increment the counter if the list has changed
+	if (listChanged)
+		{
+		iUpdateCount++;
+		}
+	}
+
+CApaSystemControlList::CApaSystemControlList(RFs& aFs):iFs(aFs)
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apgrfx/APGDOOR.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,870 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <s32stor.h>
+#include <fbs.h>
+
+#include "APGDOOR.H"
+#include "APGICNFL.H"
+#include "APGCLI.H"
+#include "APACLN.H"
+#include "APGSTD.H"
+#include "APGPRIV.H"
+#include "APFDEF.H"
+
+#include "../apparc/TRACE.H"
+
+const TUid KUidApaDoorStateStream={0x1000012a}; // build invariant
+const TInt KHugeGranularity=4096; // 4k granularity for the door's host buffer
+// default icon size only used if door was created by a model door, set to glass, but does not support glass
+#define KDefaultIconSizeInTwips TSize(500,500)
+
+///////////////////////////////////////////
+// CApaDoor
+///////////////////////////////////////////
+
+EXPORT_C CApaDoor* CApaDoor::NewLC(RFs& aFs, CApaDocument& aDoc,const TSize& aDefaultIconSizeInTwips)
+/** Creates a new wrapper for the specified embedded document and places a
+pointer to it onto the cleanup stack.
+
+The door is of the specified size. The wrapper takes ownership of the document; 
+if creation of the wrapper fails, the document object is destroyed.
+
+@param aFs A file server session.
+@param aDoc The document for which the door is to be created.
+@param aDefaultIconSizeInTwips The size of the door in twips.
+@return  The new embedded document wrapper object. */
+	{
+	CApaDoor* self=new CApaDoor(aFs, aDoc,aDefaultIconSizeInTwips);
+	if (!self)
+		{
+		__ASSERT_DEBUG(aDoc.Process(), Panic(EDPanicNoProcess));
+		aDoc.Process()->DestroyDocument(&aDoc);
+		User::LeaveNoMemory();
+		}
+	CleanupStack::PushL(self);
+	self->ConstructL(); //lint !e613 Possible use of null pointer - Lint is wrong, see User::LeaveNoMemory() above
+	return self;
+	}
+
+
+EXPORT_C CApaDoor* CApaDoor::NewL(RFs& aFs, CApaDocument& aDoc,const TSize& aDefaultIconSizeInTwips)
+/** Creates a new wrapper for the specified embedded document.
+
+The door is of the specified size. The wrapper takes ownership of the document; 
+if creation of the wrapper fails, the document object is destroyed.
+
+@param aFs A file server session.
+@param aDoc The document for which the door is to be created.
+@param aDefaultIconSizeInTwips The size of the door in twips.
+@return  The new embedded document wrapper object. */
+	{
+	CApaDoor* self = CApaDoor::NewLC(aFs, aDoc,aDefaultIconSizeInTwips);
+	CleanupStack::Pop();
+	return self;
+	}
+
+
+EXPORT_C CApaDoor* CApaDoor::NewL(RFs& aFs, const CStreamStore& aStore,TStreamId aStreamId,CApaProcess& aProcess)
+// Creates a door and restores it
+// Should only be called by the TApaPictureFactory
+//
+	{
+	CApaDoor* self=new(ELeave) CApaDoor(aFs, aProcess);
+	CleanupStack::PushL(self);
+	self->RestoreL(aStore,aStreamId);
+	CleanupStack::Pop();
+	return self;
+	}
+
+
+CApaDoor::CApaDoor(RFs& aFs, CApaDocument& aDoc,const TSize& aDefaultIconSizeInTwips)
+	:iFs(aFs),
+	iApaProcess(aDoc.Process()),
+	iApaDoc(&aDoc),
+	iIconSizeInTwips(aDefaultIconSizeInTwips)
+	{__DECLARE_NAME(_S("CApaDoor"));}
+
+
+CApaDoor::CApaDoor(RFs& aFs, CApaProcess& aProcess)
+	:iFs(aFs),
+	iApaProcess(&aProcess)
+	{__DECLARE_NAME(_S("CApaDoor"));}
+
+
+EXPORT_C CApaDoor::~CApaDoor()
+/** Destructor.
+
+Frees all resources owned by the object, prior to its destruction. In particular, 
+it destroys the document, removing all references to it from the application 
+process. */
+	{
+	delete iPicture;
+	if (iApaDoc)
+		iApaProcess->DestroyDocument(iApaDoc); // removes it from the process and deletes it
+	delete iAppCaption;
+	delete iStore;
+	delete iStoreHost;
+	iApaProcess = NULL;
+	iApaDoc = NULL;
+	}
+
+
+void CApaDoor::ConstructL()
+	{
+	__SHOW_TRACE(_L("Starting CApaDoor::ConstructL"));
+	__APA_PROFILE_START(3);
+	__ASSERT_ALWAYS(iApaDoc,Panic(EPanicNoDocumentOnConstruction));
+	//
+	// check that the doc supports embedding
+	TApaAppCapabilityBuf buf;
+	__ASSERT_DEBUG(iApaDoc->Application(), Panic(EDPanicNoApplication));
+	iApaDoc->Application()->Capability(buf);
+	if (buf().iEmbeddability==TApaAppCapability::ENotEmbeddable)
+		User::Leave(KErrNotSupported);
+	//
+	__SHOW_TRACE(_L("...doc is embeddable"));
+	//
+	// set up the icon
+	SetFormatToIconL();
+	//
+	__PROFILE_END(3);
+	}
+
+TStreamId CApaDoor::StoreL(CStreamStore& aTargetStore)const
+/** Stores the embedded document in the specified store as an embedded store.
+
+This function saves the format of the door. It also stores the document, if 
+the document exists in memory, otherwise, it simply copies the stream containing 
+the embedded document into the specified store.
+
+@param aStore The store into which the embedded document is to be stored.
+@return The stream ID of the head stream for the embedded document. This stream 
+contains the stream dictionary through which the embedded document and its 
+door can be restored. */
+	{
+	__SHOW_TRACE(_L("Starting CApaDoor::StoreL"));
+	__APA_PROFILE_START(4);
+	// create stream dictionary
+	CStreamDictionary* streamDic = CStreamDictionary::NewLC();
+	//
+	// stream out door's state
+	ExternalizeBaseStreamL(aTargetStore,*streamDic);
+	ExternalizeStateStreamL(aTargetStore,*streamDic);
+	//
+	// store the doc if it exists, otherwise copy the persistent data directly
+	TStreamId id;
+	RStoreWriteStream stream;
+	if (iApaDoc)
+		{
+		// create an embedded store in a new write stream
+		id = stream.CreateL(aTargetStore);
+		CEmbeddedStore* target=CEmbeddedStore::NewLC(stream); // takes ownership of stream
+		streamDic->AssignL(KUidApaDoorDocStream,id);
+		StoreDocL(*target);
+		// close the new embedded store
+		target->CommitL();
+		CleanupStack::PopAndDestroy(); // target
+		}
+	else if (iStore)
+		{
+		RStoreWriteStream trg;
+		id = trg.CreateLC(aTargetStore);
+		CopyStoreL(*iStore,trg);
+		CleanupStack::PopAndDestroy(); // trg
+		streamDic->AssignL(KUidApaDoorDocStream,id);
+		}
+	else 
+		Panic(EPanicNoDocOrStoreWhenStoring); // impossible situation
+	//
+	// store the stream dictionary and return its stream id
+	id = stream.CreateLC(aTargetStore);
+	stream<< *streamDic;
+	stream.CommitL();
+	CleanupStack::PopAndDestroy(); // stream
+	//
+	// tidy up
+	CleanupStack::PopAndDestroy(); // streamDic
+	__PROFILE_END(4);
+	return id;
+	}
+
+
+void CApaDoor::CopyStoreL(const CEmbeddedStore& aSourceStore,RWriteStream& aTargetStream)
+// static method
+// copies an embedded store containing a doc to aTargetStream
+//
+	{
+	__SHOW_TRACE(_L("Starting CApaDoor::CopyStoreL"));
+	// read the contents of aSourceStore's rootstream (so I can write it out in a mo')
+	CStreamDictionary* root=ReadStreamDictionaryLC(aSourceStore,aSourceStore.Root());
+	//
+	// copy the source store directly
+	MStreamBuf* host=aSourceStore.Host();
+	__ASSERT_DEBUG(host, Panic(EDPanicNoHostForStore));
+	TStreamPos pos=aSourceStore.Position(aSourceStore.Root());
+	host->SeekL(host->ERead,EStreamBeginning);
+	RReadStream stream(host);
+	aTargetStream.WriteL(stream,pos.Offset());
+	//
+	// write the root stream
+	aTargetStream<< *root;
+	aTargetStream.CommitL();
+	CleanupStack::PopAndDestroy(); // root
+	}
+
+EXPORT_C void CApaDoor::RestoreL(const CStreamStore& aSourceStore,TStreamId aStreamId)
+/** Restores the embedded document from the specified store.
+
+The format of the door is set to iconic if the embedded document is password 
+protected.
+
+@param aStore The store from which the embedded document is to be restored. 
+@param aHeadStreamId The stream ID of the head stream for the embedded document. 
+This stream contains the stream dictionary through which the embedded document 
+and its door can be restored. */
+	{
+	__SHOW_TRACE(_L("Starting CApaDoor::RestoreL"));
+	__APA_PROFILE_START(5);
+	__ASSERT_DEBUG(iApaProcess,Panic(EDPanicNoProcess));
+	//
+	if (iApaDoc)
+		{
+		iApaProcess->DestroyDocument(iApaDoc);
+		iApaDoc = NULL;
+		}
+	delete iStore;
+	delete iStoreHost;
+	iStore=NULL;
+	iStoreHost = NULL;
+	//
+	// internalize the streamDic from the headstream
+	CStreamDictionary* streamDic=ReadStreamDictionaryLC(aSourceStore,aStreamId);
+	//
+	// internalize the door's state
+	__APA_PROFILE_START(13);
+	TSize currentSize=InternalizeBaseStreamL(aSourceStore,*streamDic);
+	InternalizeStateStreamL(aSourceStore,*streamDic,currentSize);
+	__APA_PROFILE_END(13);
+	//
+	// internalize the embedded store
+	__APA_PROFILE_START(14);
+	RStoreReadStream src;
+	src.OpenL(aSourceStore,streamDic->At(KUidApaDoorDocStream));
+	iStore = CEmbeddedStore::FromL(src);
+	CleanupStack::PopAndDestroy(); // streamDic
+	streamDic = NULL;
+	__APA_PROFILE_END(14);
+	//
+	// internalize the doc's stream dict
+	streamDic = ReadStreamDictionaryLC(*iStore,iStore->Root());
+	//
+	// set the door's format 
+	if (iFormat==EIconic || (streamDic->At(KUidSecurityStream)!=KNullStreamId))
+		// iconify automatically if a password is required for access
+		SetFormatToIconL();
+	else
+		{
+		TRAPD(ret, SetFormatToGlassL() );
+		if (ret==KErrNone)
+			{
+			__ASSERT_DEBUG(iPicture, Panic(EDPanicNoPictureOnDrawing));
+			iPicture->SetSizeInTwips(currentSize);
+			}
+		else if (ret!=KErrNoMemory)
+			// problem loading app/doc - just iconify it for now...
+			SetFormatToIconL();
+		else
+			User::Leave(ret);
+		}	
+	CleanupStack::PopAndDestroy(); // streamDic
+	__PROFILE_END(5);
+	}
+
+
+void CApaDoor::StoreDocL(CPersistentStore& aTargetStore)const
+// stores the doc if it's in memory, otherwise panics!
+// aStore should be protected before calling this method
+//
+	{
+	__SHOW_TRACE(_L("Starting CApaDoor::StoreDocL"));
+	__ASSERT_ALWAYS(iApaDoc,Panic(EPanicNoDocumentOnStore)); // the doc must be in memory to be stored
+	//
+	// create a stream dic
+	CStreamDictionary* streamDic=CStreamDictionary::NewLC();
+	// store the doc
+	iApaDoc->StoreL(aTargetStore,*streamDic);
+	// write store's root stream
+	CApaProcess::WriteRootStreamL(aTargetStore,*streamDic,*iApaDoc->Application());
+	// tidy up
+	CleanupStack::PopAndDestroy(); // streamDic
+	}
+
+
+void CApaDoor::RestoreDocL(const CPersistentStore& aSourceStore)
+// restores the document from the embedded store
+// leaves with KErrNotFound if the app dll cant be located
+//
+	{
+	__SHOW_TRACE(_L("Starting CApaDoor::RestoreDocL"));
+	__ASSERT_ALWAYS(!iApaDoc,Panic(EPanicDocAlreadyExists));
+	//
+	// read the stream dic from the doc's root stream
+	CStreamDictionary* streamDic=ReadStreamDictionaryLC(aSourceStore,aSourceStore.Root());
+	//
+	// read the app id from the store
+	TApaAppIdentifier appId = CApaProcess::ReadAppIdentifierL(aSourceStore,*streamDic);
+	//
+	__ASSERT_DEBUG(iApaProcess,Panic(EDPanicNoProcess));
+	// if the app exists find it, load it and create a doc, else leave if the correct app cannot be found
+	CApaDocument* doc = // create an unrestored doc and adds it to the process list
+	iApaProcess->AddNewDocumentL(appId.iAppUid);
+	TApaDocCleanupItem cleanup(iApaProcess,doc);
+	CleanupStack::PushL(cleanup);
+	doc->RestoreL(aSourceStore,*streamDic); // restores the doc
+	iApaDoc = doc;
+	CleanupStack::Pop(); // doc
+	CleanupStack::PopAndDestroy(); // streamDic
+	}
+
+
+CStreamDictionary* CApaDoor::ReadStreamDictionaryLC(const CStreamStore& aSourceStore,TStreamId aStreamId)
+// static method
+//
+	{
+	__APA_PROFILE_START(12);
+	// read the stream dic from the doc's root stream
+	CStreamDictionary* streamDic=CStreamDictionary::NewLC();
+	RStoreReadStream stream;
+	stream.OpenLC(aSourceStore,aStreamId);
+	stream>> *streamDic;
+	CleanupStack::PopAndDestroy(); // root
+	__APA_PROFILE_END(12);
+	return streamDic;
+	}
+
+
+void CApaDoor::ExternalizeL(RWriteStream& /*aStream*/)const
+	{
+	Panic(EPanicMethodNotSupported);
+	}
+
+
+void CApaDoor::ExternalizeStateStreamL(CStreamStore& aStore,CStreamDictionary& aStreamDict)const
+	{
+	__SHOW_TRACE(_L("Starting CApaDoor::ExternalizeStateStreamL"));
+	__ASSERT_ALWAYS(iAppCaption,Panic(EPanicNoCaption));
+	__ASSERT_ALWAYS(iPicture,Panic(EPanicNoPictureInDoor));
+	RStoreWriteStream stream;
+	TStreamId id=stream.CreateLC(aStore);
+	//
+	stream<< *iAppCaption;
+	TSize size;
+	if (iFormat==EIconic || iFormat==ETemporarilyIconic)
+		GetSizeInTwips(size);
+	else 
+		size = iIconSizeInTwips;
+	stream<< size;
+	//
+	stream.CommitL();
+	CleanupStack::PopAndDestroy(); // stream
+	aStreamDict.AssignL(KUidApaDoorStateStream,id);
+	}
+
+
+void CApaDoor::InternalizeStateStreamL(const CStreamStore& aStore,const CStreamDictionary& aStreamDict,TSize aDefaultIconSize)
+	{
+	__SHOW_TRACE(_L("Starting CApaDoor::InternalizeStateStreamL"));
+	TStreamId id=aStreamDict.At(KUidApaDoorStateStream);
+	if (id!=KNullStreamId)
+		{
+		RStoreReadStream stream;
+		stream.OpenLC(aStore,id);
+		TApaAppCaption caption;
+		stream>> caption;
+		delete iAppCaption;
+		iAppCaption = NULL;
+		iAppCaption = caption.AllocL();
+		stream>> iIconSizeInTwips;
+		CleanupStack::PopAndDestroy(); // stream
+		}
+	else
+		{// use default settings
+		delete iAppCaption;
+		iAppCaption = NULL;
+		iAppCaption = HBufC::NewL(0);
+		if (iFormat==EIconic)
+			iIconSizeInTwips = aDefaultIconSize;
+		else
+			iIconSizeInTwips = KDefaultIconSizeInTwips;
+		}
+	}
+
+
+void CApaDoor::DetachFromStoreL(TDetach aDegree)
+/** Detaches the door from its store, restoring any unrestored elements of the picture, 
+if necessary.
+
+@param aDegree Degree to which picture is detached.
+@see CApaDocument::DetachFromStoreL() */
+	{
+	__SHOW_TRACE(_L("Starting CApaDoor::DetachFromStoreL"));
+	if (iApaDoc)
+		{
+		iApaDoc->DetachFromStoreL(aDegree);
+		if (!iStoreHost)
+			{
+			delete iStore;
+			iStore = NULL;
+			}
+		}
+	else if (!iStoreHost)
+		{
+		if (aDegree==EDetachDraw)
+			{
+			delete iStore;
+			iStore = NULL;
+			// now all I can do is draw as I am, any attempt to change me will result in a panic
+			}
+		else
+			{
+			__ASSERT_ALWAYS(iStore,Panic(EPanicNoStoreOnDetach));
+			// instantiate the mem buffer, and a stream to write to it
+			CBufSeg* bufSeg = CBufSeg::NewL(KHugeGranularity);
+			CleanupStack::PushL(bufSeg);
+			HBufBuf* buf=HBufBuf::NewL(*bufSeg,0);
+			RWriteStream writeStream(buf);
+			writeStream.PushL();
+			// write the store to the mem buffer
+			CopyStoreL(*iStore,writeStream);
+			CleanupStack::Pop(2); // bufSeg,writeStream
+			//
+			// set iStoreHost as host for the embedded store
+			MStreamBuf* host=iStore->Host();
+			__ASSERT_ALWAYS(host!=NULL,Panic(EDPanicNoHostForStore));
+			iStore->Detach();
+			host->Release(); //lint !e613 Suppress possible use of null pointer
+			iStore->Reattach(buf);
+			iStoreHost = bufSeg;
+			}
+		}
+	}
+
+
+EXPORT_C CApaDocument* CApaDoor::DocumentL(TBool aCheckPassword)
+// leaves with KErrNotFound if the doc needs to be restored but the app dll cannot be found
+//
+/** Returns a pointer to the embedded document represented by this wrapper.
+
+If necessary, the document is restored from its embedded store.
+
+Note that if the wrapper does not have a reference to the embedded document 
+store, then the function raises a APGRFX 13 panic. Constructing this wrapper 
+through a TApaPictureFactory or storing the embedded document through CApaDoor::StoreL() 
+ensures that this wrapper has a reference to the embedded document store.
+
+@param aCheckPassword If ETrue, any password is checked before returning a 
+pointer to the document. If EFalse, the password is not checked.
+@return A pointer to the embedded document.
+@see TApaPictureFactory
+@see CApaDoor::StoreL()
+@see CApaDocument::ValidatePasswordL() */
+	{
+	__SHOW_TRACE(_L("Starting CApaDoor::DocumentL"));
+	//
+	if (!iApaDoc)
+		{
+		__ASSERT_ALWAYS(iStore,Panic(EPanicNoStoreOnRestore));
+		RestoreDocL(*iStore);
+		}
+	else if (aCheckPassword)
+		iApaDoc->ValidatePasswordL();
+	//
+	return iApaDoc;
+	}
+
+EXPORT_C void CApaDoor::SetFormatToTemporaryIconL(TBool aEnabled)
+// if the door is currently iconic do nothing
+// if the door is glass switch it's format to iconic, but ensure that when externalized the format will be persisted as glass
+//
+/** Switches the format of the door between temporarily iconic and glass.
+
+If the door is iconic, then the function does nothing.
+
+@param aEnabled If ETrue and the format is currently glass, then the format 
+switches to temporarily iconic; this is the default. If EFalse and the format 
+is currently temporarily iconic, then the format switches to glass. */
+	{
+	__SHOW_TRACE(_L("Starting CApaDoor::SetFormatToTemporaryIconL"));
+	if (aEnabled && iFormat==EGlassDoor) 
+		{
+		TSize glassSize;
+		GetSizeInTwips(glassSize);
+		SetFormatToIconL();
+		iFormat = ETemporarilyIconic;
+		iIconSizeInTwips = glassSize; //abuse it!
+		}
+	else if (!aEnabled && iFormat==ETemporarilyIconic)
+		SetFormatToGlassL();
+	}
+
+#ifdef __VC32__
+#pragma optimize("g", off) // Disable due to problem with MSVC
+#endif
+EXPORT_C void CApaDoor::SetFormatToIconL()
+/** Sets the format of the door to iconic.
+
+The application's icon is used, or, if this cannot be found, the default icon 
+is used instead. The function leaves only if construction of the default icon 
+object fails. */
+	{
+	__SHOW_TRACE(_L("Starting CApaDoor::SetFormatToIconL"));
+	__APA_PROFILE_START(6);
+	if (iFormat==ETemporarilyIconic && iPicture)
+		{
+		GetSizeInTwips(iIconSizeInTwips);
+		iFormat = EIconic;
+		}
+	else if (iFormat!=EIconic || !iPicture)
+		{
+		TUid appUid;
+		if (iApaDoc)
+			{
+			__ASSERT_DEBUG(iApaDoc->Application(), Panic(EDPanicNoApplication));
+			appUid = iApaDoc->Application()->AppDllUid();
+			}
+		else
+			{
+			appUid = AppUidFromStreamL();
+			}
+
+		TInt ret=KErrNone;
+		if (!iAppCaption)
+			{
+			RApaLsSession ls;
+			CleanupClosePushL(ls);
+			ret=ls.Connect();
+			if (ret==KErrNone)
+				{
+				TApaAppInfo info;
+				ret=ls.GetAppInfo(info,appUid);
+				if (ret==KErrNone)
+					{
+					iAppCaption = info.iCaption.AllocL();
+					}
+				}
+			CleanupStack::PopAndDestroy(&ls);
+			}
+
+		if (!iAppCaption)	// no caption found
+			iAppCaption = HBufC::NewL(0);
+
+		CPicture* icon=CApaIconPicture::NewL(iIconSizeInTwips, appUid);
+		delete iPicture;
+		iPicture = icon;
+		iFormat = EIconic;
+		}
+	__PROFILE_END(6);
+	}
+#ifdef __VC32__
+#pragma optimize("g", on)
+#endif
+
+
+TUid CApaDoor::AppUidFromStreamL() const
+	{
+	__ASSERT_DEBUG(iStore,Panic(EDPanicNoStoreOnIconify));
+	__APA_PROFILE_START(15);
+	CStreamDictionary* streamDic=ReadStreamDictionaryLC(*iStore,iStore->Root());
+	TApaAppIdentifier appId=CApaProcess::ReadAppIdentifierL(*iStore,*streamDic);
+	CleanupStack::PopAndDestroy(streamDic);
+	__APA_PROFILE_END(15);
+	return appId.iAppUid;
+	}
+	
+
+EXPORT_C void CApaDoor::SetFormatToGlassL()
+/** Sets the format of the door to glass.
+
+The function asks the document to create a fresh copy of the door and destroys 
+any existing copy. If the process of creating the door completes without leaving, 
+but returns a zero pointer, then the function raises an APGRFX 17 panic.
+
+The function leaves with:
+
+KErrNotSupported, if the document does not support being represented by a 
+glass door.
+
+KErrNotFound, if the application DLL cannot be found.
+
+If the function leaves, the format remains unchanged.
+
+@see CApaDocument::GlassPictureL() */
+	{
+	__SHOW_TRACE(_L("Starting CApaDoor::SetFormatToGlassL"));
+	__APA_PROFILE_START(7);
+	if (iFormat!=EGlassDoor || !iPicture)
+		{
+		if (!iApaDoc)
+			{
+			__ASSERT_DEBUG(iStore,Panic(EDPanicNoStoreOnGlassing));
+			RestoreDocL(*iStore);
+			}
+		if (iApaDoc->Capability().CanDrawGlass())
+			{
+			CPicture* glass = iApaDoc->GlassPictureL();
+			__ASSERT_ALWAYS(glass,Panic(EPanicNoGlassPicture));
+			if (iPicture)
+				iPicture->GetSizeInTwips(iIconSizeInTwips); // store the current icon size
+			delete iPicture;
+			iPicture = glass;
+			iFormat = EGlassDoor;
+			}
+		else
+			User::Leave(KErrNotSupported); // glass pic's not supported
+		}
+	__PROFILE_END(7);
+	}
+
+
+EXPORT_C TUid CApaDoor::AppUidL()const
+/** Gets the application specific UID associated with the embedded document.
+
+@return The application specific UID. */
+	{
+	if (iApaDoc)
+		{
+		__ASSERT_DEBUG(iApaDoc->Application(), Panic(EDPanicNoApplication));
+		return iApaDoc->Application()->AppDllUid();
+		}
+	//
+	__ASSERT_ALWAYS(iStore,Panic(EPanicNoStoreOnAppUid));
+	//
+	// read uid from store's headstream
+	CStreamDictionary* streamDic = ReadStreamDictionaryLC(*iStore,iStore->Root());
+	TApaAppIdentifier appId = CApaProcess::ReadAppIdentifierL(*iStore,*streamDic);
+	CleanupStack::PopAndDestroy(); // streamDic
+	return appId.iAppUid;
+	}
+	
+
+void CApaDoor::Draw(CGraphicsContext& aGc,const TPoint& aTopLeft,const TRect& aClipRect,
+						MGraphicsDeviceMap* aMap)const
+/** Draws the door either as glass or as an icon depending on the format.
+
+@param aGc The graphics context.
+@param aTopLeft The co-ordinates where the top left corner pixel of the picture 
+should be placed. Note that whether this is actually drawn depends on the 
+clipping area defined.
+@param aClipRect A clipping rectangle.
+@param aMap The device map for the graphics device. */
+	{
+	__ASSERT_DEBUG(iPicture,Panic(EDPanicNoPictureOnDrawing));
+	//
+	iPicture->Draw(aGc,aTopLeft,aClipRect,aMap);
+	}
+
+void CApaDoor::GetOriginalSizeInTwips(TSize& aSize)const
+/** Get the door's original size, in twips.
+
+@param aSize The size, in twips. */
+	{
+	__ASSERT_DEBUG(iPicture,Panic(EDPanicNoPicture));
+	iPicture->GetOriginalSizeInTwips(aSize);
+	}
+
+void CApaDoor::SetScaleFactor(TInt aScaleFactorWidth,TInt aScaleFactorHeight)
+/** Sets the door's scale factors.
+
+@param aScaleFactorWidth The width scale factor, in percent.
+@param aScaleFactorHeight The height scale factor, in percent. */
+	{
+	__ASSERT_DEBUG(iPicture,Panic(EDPanicNoPicture));
+	iPicture->SetScaleFactor(aScaleFactorWidth,aScaleFactorHeight);
+	}
+
+TInt CApaDoor::ScaleFactorWidth()const
+/** Gets the door's width scale factor.
+
+@return The width scale factor, in percent. */
+	{
+	__ASSERT_DEBUG(iPicture,Panic(EDPanicNoPicture));
+	return iPicture->ScaleFactorWidth();
+	}
+
+TInt CApaDoor::ScaleFactorHeight()const
+/** Gets the door's height scale factor.
+
+@return The height scale factor, in percent. */
+	{
+	__ASSERT_DEBUG(iPicture,Panic(EDPanicNoPicture));
+	return iPicture->ScaleFactorHeight();
+	}
+
+void CApaDoor::SetCropInTwips(const TMargins& aMargins)
+/** Sets the cropping margins of a picture in twips.
+
+These are relative to the original unscaled size of the picture.
+
+@param aMargins The cropping margins, in twips. */
+	{
+	__ASSERT_DEBUG(iPicture,Panic(EDPanicNoPicture));
+	iPicture->SetCropInTwips(aMargins);
+	}
+
+void CApaDoor::GetCropInTwips(TMargins& aMargins)const
+/** Gets the cropping margins of the door in twips.
+
+These margins are relative to the original unscaled size of the picture.
+
+@param aMargins The cropping margins, in twips. */
+	{
+	__ASSERT_DEBUG(iPicture,Panic(EDPanicNoPicture));
+	iPicture->GetCropInTwips(aMargins);
+	}
+
+TPictureCapability CApaDoor::Capability()const
+/** Gets the picture's capabilities.
+
+These include whether it is scalable and croppable.
+
+@return The capabilities of the picture. */
+	{
+	__ASSERT_DEBUG(iPicture,Panic(EDPanicNoPicture));
+	return iPicture->Capability();
+	}
+
+TSize CApaDoor::GlassDoorSize()const
+	{
+	TSize size;
+	if (iFormat==EGlassDoor)
+		GetSizeInTwips(size);
+	else if (iFormat==ETemporarilyIconic)
+		{
+		if (!iApaDoc)
+			size = iIconSizeInTwips;
+		else
+			{
+			// there's a doc, so get a glass door from it just in case it's size has changed since I changed format
+			CPicture* glass = NULL;
+			TRAP_IGNORE(glass = iApaDoc->GlassPictureL()); 
+			__ASSERT_ALWAYS(glass,Panic(EPanicNoGlassPicture));
+			glass->GetSizeInTwips(size); //lint !e613 Possible use of null pointer - Asserted above
+			delete glass;
+			}
+		}
+	else
+		Panic(EIllegalCallToGlassDoorSize);
+	return size;
+	}
+
+
+void CApaDoor::SetIconSizeInTwips(TSize aSize)
+// for use of factory
+	{
+	if (iFormat==EGlassDoor)
+		iIconSizeInTwips = aSize;
+	else
+		SetSizeInTwips(aSize);
+	}
+
+
+///////////////////////////////////
+// TApaPictureFactory
+///////////////////////////////////
+
+#define KDoNotApplyIconSize TSize(-1,-1)
+
+/** Constructor for TApaPictureFactory */
+EXPORT_C TApaPictureFactory::TApaPictureFactory()
+	:iApaProcess(NULL),
+	iIconSize(TSize(0,0))
+	{
+	}
+
+EXPORT_C TApaPictureFactory::TApaPictureFactory(CApaProcess* aAppProcess)
+	:iApaProcess(aAppProcess),
+	iIconSize(KDoNotApplyIconSize)
+/** Constructs a door factory object for the specified application process.
+
+@param aAppProcess The application process. */
+	{}
+
+EXPORT_C void TApaPictureFactory::NewPictureL(TPictureHeader& aPictureHeader,const CStreamStore& aPictureStore)const
+// called (by the containing doc) to restore an app door from its header
+//
+/** Constructs and restores an application's door (picture) from a stream in the 
+specified store.
+
+The restored door is a CApaDoor type object.
+
+Note that the function can leave with KErrNoMemory if creation of the CApaDoor 
+object fails.
+
+@param aPictureHeader The header identifying the door to be restored. The 
+UID identifying the door must be KUidPictureTypeDoor, otherwise the function 
+leaves with KErrNotSupported. On entry, the door picture must be represented 
+by a stream ID, otherwise the function leaves with KErrBadHandle; on return, 
+the door picture is represented by a pointer to an internalized CApaDoor object.
+@param aPictureStore The store from which the door will be restored.
+@see TPictureHeader
+@see TPictureHeader::iPicture */
+	{
+	__SHOW_TRACE(_L("Starting TApaPictureFactory::NewPictureL"));
+	if (aPictureHeader.iPictureType!=KUidPictureTypeDoor)
+		User::Leave(KErrNotSupported); // wrong type
+	if (!aPictureHeader.iPicture.IsId())
+		User::Leave(KErrBadHandle); // not an id - can't restore
+	//
+	// create and restore the door
+	TStreamId id = aPictureHeader.iPicture.AsId();
+//	RFs fs;
+//	User::LeaveIfError(fs.Connect());
+//	CleanupClosePushL(fs);
+	__ASSERT_DEBUG(iApaProcess, Panic(EDPanicNoProcess));
+	if(iApaProcess)
+		{
+		CApaDoor* door = CApaDoor::NewL(iApaProcess->FsSession()/*fs*/,aPictureStore,id,*CONST_CAST(CApaProcess*,iApaProcess));
+		aPictureHeader.iPicture = door;
+		//
+		// set the icon size if requested
+		if (iIconSize!=KDoNotApplyIconSize)
+			door->SetIconSizeInTwips(iIconSize);
+		}
+//	CleanupStack::PopAndDestroy(); // fs - it's not needed any more as the base class doesn't use it
+	}
+
+
+////////////////////////////////////
+// HBufBuf
+////////////////////////////////////
+
+HBufBuf* HBufBuf::NewL(CBufBase& aBuf,TInt aPos,TInt aMode)
+//
+// Create a pre-set buffer stream buffer.
+//
+	{
+	HBufBuf* buf=new(ELeave) HBufBuf;
+	buf->Set(aBuf,aPos,aMode);
+	return buf;
+	}
+
+void HBufBuf::DoRelease()
+//
+// Finished with this stream buffer.
+//
+	{
+	delete this;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apgrfx/APGICNFL.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,2441 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <e32std.h>
+#include <s32file.h>
+#include <s32ucmp.h>
+#include <bautils.h>
+#include <barsread.h>
+#include <barsc.h>
+#include <barsread2.h>
+#include <barsc2.h>
+#include <apfdef.h>
+#include "APGAIR.H"
+
+#ifdef _DEBUG
+#include "APGSTD.H" // panic codes
+#endif // _DEBUG
+
+#if defined(UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER)
+// the two #defines immediately below are #defined to "nothing" so that only the minimal set of functions that ought to be "removed" because of SYMBIAN_REMOVE_UI_FRAMEWORKS_V1 (but which are needed still because of UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER) are actually exported
+#define IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER
+#define EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER
+#endif // UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER
+
+#include "APGICNFL.H"
+
+#if !defined(EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER)
+// we're compiling a source file that doesn't define EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER, so give it it's default "value" of "EXPORT_C"
+#define EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER EXPORT_C
+#endif
+
+//
+// Try and reduce the bitmap mask depth to 1bpp (2 colours)
+//
+LOCAL_D CFbsBitmap* TryCompressMaskL(const CFbsBitmap& aMask)
+	{
+	CFbsBitmap* newMask=NULL;
+	if (aMask.DisplayMode()!=EGray2 && aMask.IsMonochrome())
+		{
+		newMask=new(ELeave) CFbsBitmap;
+		CleanupStack::PushL(newMask);
+		const TSize size=aMask.SizeInPixels();
+		User::LeaveIfError(newMask->Create(size,EGray2));
+		CFbsBitmapDevice* device=CFbsBitmapDevice::NewL(newMask);
+		CleanupStack::PushL(device);
+		CFbsBitGc* gc=NULL;
+		User::LeaveIfError(device->CreateContext(gc));
+		CleanupStack::PushL(gc);
+		TPoint origin(0,0);
+		gc->BitBlt(origin,&aMask);
+		CleanupStack::PopAndDestroy(2); // gc, device
+		CleanupStack::Pop(newMask);
+		}
+	return newMask;
+	}
+
+//
+// Class CApaMaskedBitmap
+//
+
+CApaMaskedBitmap::CApaMaskedBitmap()
+:CFbsBitmap()
+	{}
+
+EXPORT_C CApaMaskedBitmap::~CApaMaskedBitmap()
+/** Destructor.
+
+Frees resources owned by the object prior to its destruction. */
+	{
+	delete iMask;
+	}
+
+EXPORT_C CApaMaskedBitmap* CApaMaskedBitmap::NewLC()
+/** Creates a default application icon object.
+
+@return A pointer to the new application icon object. */
+	{
+	CApaMaskedBitmap* self=new(ELeave) CApaMaskedBitmap;
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+
+EXPORT_C CApaMaskedBitmap* CApaMaskedBitmap::NewL(const CApaMaskedBitmap* aSourceIcon)
+/** Creates a new application icon object, making a duplicate copy of an existing 
+application icon.
+
+@param aSourceIcon A pointer to an existing application icon.
+@return A pointer to the new application icon object. */
+	{
+	CApaMaskedBitmap* self=new(ELeave) CApaMaskedBitmap;
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	User::LeaveIfError( self->iMask->Duplicate(aSourceIcon->Mask()->Handle()) );
+	User::LeaveIfError( self->Duplicate(aSourceIcon->Handle()) );
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+void CApaMaskedBitmap::ConstructL()
+	{
+	__DECLARE_NAME(_S("CApaMaskedBitmap"));
+	if (!iFbs)
+		User::Leave(KErrCouldNotConnect);
+	iMask=new(ELeave) CFbsBitmap;
+	}
+
+EXPORT_C CFbsBitmap* CApaMaskedBitmap::Mask() const
+/** Gets the icon's mask.
+
+@return A pointer to the mask bitmap. */
+	{
+	return iMask;
+	}
+
+EXPORT_C void CApaMaskedBitmap::InternalizeL(RReadStream& aStream)
+/** Internalizes the application icon from the read stream.
+
+@param aStream The read stream. */
+	{
+	__ASSERT_DEBUG(iMask, Panic(EPanicNullPointer));
+	CFbsBitmap::InternalizeL(aStream);
+	aStream >> *iMask;
+
+	// Try to reduce the colour depth of the bitmap mask
+	CFbsBitmap* tempMask;
+	tempMask = TryCompressMaskL(*iMask);
+	// tempMask = NULL if iMask could not be reduced
+	if (tempMask != NULL)
+		{
+		delete iMask;
+		iMask = tempMask;
+		}
+	}
+
+void CApaMaskedBitmap::SetRomBitmapL(TUint8* aRomPointer)
+	{
+	__ASSERT_DEBUG(iMask, Panic(EPanicNullPointer));
+	TInt bitmapSize = 0;
+	CFbsBitmap::SetRomBitmapL(reinterpret_cast<CBitwiseBitmap*>(aRomPointer),bitmapSize);
+
+	aRomPointer += bitmapSize;
+
+	iMask->SetRomBitmapL(reinterpret_cast<CBitwiseBitmap*>(aRomPointer),bitmapSize);
+	}
+
+EXPORT_C void CApaMaskedBitmap::ExternalizeL(RWriteStream& aStream) const
+/** Externalises the application icon to the specified stream.
+
+@param aStream The write stream. */
+	{
+	__ASSERT_DEBUG(iMask, Panic(EPanicNullPointer));
+	CFbsBitmap::ExternalizeL(aStream);
+	aStream << *iMask;
+	}
+
+
+EXPORT_C void CApaMaskedBitmap::SetMaskBitmap(CFbsBitmap* aMask)
+/**
+Sets the icon's mask
+
+@publishedAll
+@released
+@param     aMask A pointer to the mask bitmap       
+*/
+	{
+	delete iMask;
+	iMask = aMask;
+	}
+
+
+
+#if (defined(UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER))
+
+
+
+//
+// Class CApaAIFCaption
+//
+
+CApaAIFCaption::~CApaAIFCaption()
+	{
+	delete iCaption;
+	}
+
+CApaAIFCaption* CApaAIFCaption::NewLC(TLanguage aLanguage,const TDesC& aCaption)
+	// static
+	{
+	CApaAIFCaption* self=new(ELeave) CApaAIFCaption;
+	CleanupStack::PushL(self);
+	self->ConstructL(aLanguage,aCaption);
+	return self;
+	}
+
+void CApaAIFCaption::ConstructL(TLanguage aLanguage,const TDesC& aCaption)
+	{
+	iLanguage=aLanguage;
+    HBufC* newCaption=aCaption.AllocL();
+	delete(iCaption); // after the AllocL succeeds
+	iCaption=newCaption;
+	}
+
+TLanguage CApaAIFCaption::Language() const
+	{
+	return iLanguage;
+	}
+
+TApaAppCaption CApaAIFCaption::Caption() const
+	{
+	return *iCaption;
+	}
+
+CApaAIFCaption::CApaAIFCaption()
+	{
+	}
+
+void CApaAIFCaption::InternalizeL(RReadStream& aStream)
+	{
+	HBufC* newCaption=HBufC::NewL(aStream,KApaMaxAppCaption);
+	delete(iCaption);
+	iCaption=newCaption;
+	iLanguage=(TLanguage)aStream.ReadInt16L();
+	}
+
+void CApaAIFCaption::ExternalizeL(RWriteStream& aStream) const
+	{
+	aStream << *iCaption;
+	aStream.WriteInt16L(iLanguage);
+	}
+
+
+//
+// Class CApaAIFViewData
+//
+
+CApaAIFViewData::~CApaAIFViewData()
+	{
+	if (iCaptionArray)
+		iCaptionArray->ResetAndDestroy();
+	delete iCaptionArray;
+	if (iIconArray)
+		iIconArray->ResetAndDestroy();
+	delete iIconArray;
+	delete iIconIndexArray;
+	}
+
+CApaAIFViewData::CApaAIFViewData()
+	{}
+
+void CApaAIFViewData::ConstructL()
+	{
+	iCaptionArray=new(ELeave) CArrayPtrFlat<CApaAIFCaption>(4);
+	iIconArray=new(ELeave) CArrayPtrFlat<CApaMaskedBitmap>(4);
+	}
+
+CApaAIFViewData* CApaAIFViewData::NewLC()
+	// static
+	{
+	CApaAIFViewData* self=new(ELeave) CApaAIFViewData;
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+
+CApaAIFViewData* CApaAIFViewData::NewLC(const CApaAIFViewData& aSourceData)
+	{
+	CApaAIFViewData* self = CApaAIFViewData::NewLC();
+	self->ConstructL(aSourceData);
+	return self;
+	}
+
+void CApaAIFViewData::ConstructL(const CApaAIFViewData& aSourceData)
+	{
+	// Make a copy of aSourceData in this object
+	// N.B. this is not an atomic operation and if the function leaves
+	// there is no guarantee that this object will be in a valid state.
+	// Should only be called from CApaAIFViewData::NewLC(const CApaAIFViewData& aSourceData)
+	//
+	// Screen mode
+	iScreenMode = aSourceData.iScreenMode;
+	// Icon array
+	TInt count = (aSourceData.iIconArray ? aSourceData.iIconArray->Count() : 0);
+	TInt i;
+	for (i=0; i < count; i++)
+		{
+		// Get the icon from array and duplicate it
+		const CApaMaskedBitmap& srcIcon = (*aSourceData.iIconArray->At(i));
+		CApaMaskedBitmap* icon = CApaMaskedBitmap::NewLC();
+		User::LeaveIfError(icon->Duplicate(srcIcon.Handle()));
+
+		CFbsBitmap* mask = new(ELeave) CFbsBitmap();
+		CleanupStack::PushL(mask);
+		User::LeaveIfError(mask->Duplicate(srcIcon.Mask()->Handle()));
+		icon->SetMaskBitmap(mask);
+		CleanupStack::Pop(mask);
+
+		iIconArray->AppendL(icon);
+		CleanupStack::Pop(icon);
+		}
+	// Caption array
+	count = (aSourceData.iCaptionArray ? aSourceData.iCaptionArray->Count() : 0);
+	for (i=0; i < count; i++)
+		{
+		const CApaAIFCaption& srcCaption = (*aSourceData.iCaptionArray->At(i));
+		CApaAIFCaption* caption = CApaAIFCaption::NewLC(srcCaption.Language(), srcCaption.Caption());
+		iCaptionArray->AppendL(caption);
+		CleanupStack::Pop(caption);
+		}
+	// View UID
+	iViewUid = aSourceData.iViewUid;
+	// Icon index array
+	count = (aSourceData.iIconIndexArray ? aSourceData.iIconIndexArray->Count() : 0);
+	for (i=0; i < count; i++)
+		{
+		AddIconIndexL(aSourceData.iIconIndexArray->At(i));
+		}
+	}
+
+void CApaAIFViewData::LoadIconsL(const TDesC& aFileName, TUint aMbmOffset)
+	{
+	// This function is called when loading the AIF version 2 format
+	// When loading the RSC block, any view icons will have been added to iIconIndexArray as MBM indexes.
+	// This function loads the view icons from the MBM using these indexes.
+	__ASSERT_DEBUG(iIconArray->Count()==0,Panic(EDPanicArrayNotEmpty));
+	const TInt iconCount = (iIconIndexArray ? iIconIndexArray->Count() : 0);
+	for (TInt i=0; i < iconCount; i++)
+		{
+		const TInt mbmIndex = iIconIndexArray->At(i) * 2;	// Each icon is a mask and bitmap == 2 items in MBM
+		CApaMaskedBitmap* icon = CApaMaskedBitmap::NewLC();
+		CFbsBitmap* mask = new(ELeave) CFbsBitmap();
+		CleanupStack::PushL(mask);
+		User::LeaveIfError(icon->Load(aFileName, mbmIndex, ETrue, aMbmOffset));
+		User::LeaveIfError(mask->Load(aFileName, mbmIndex + 1, ETrue, aMbmOffset));
+		icon->SetMaskBitmap(mask);
+		CleanupStack::Pop(mask);
+		iIconArray->AppendL(icon);
+		CleanupStack::Pop(icon);
+		}
+	}
+
+void CApaAIFViewData::InternalizeL(RReadStream& aStream)
+	{
+	// Uid
+	iViewUid.iUid=aStream.ReadInt32L();
+	// Screen mode
+	iScreenMode=aStream.ReadInt32L();
+	// Captions
+	if (iCaptionArray)
+		iCaptionArray->ResetAndDestroy();
+	else
+		iCaptionArray=new(ELeave) CArrayPtrFlat<CApaAIFCaption>(1);
+	TCardinality card;
+	aStream>>card;
+	const TInt captionCount(card);
+	CApaAIFCaption* caption=NULL;
+	for (TInt ii=0;ii<captionCount;ii++)
+		{
+		caption=new(ELeave) CApaAIFCaption();
+		CleanupStack::PushL(caption);
+		aStream >> *caption;
+		iCaptionArray->AppendL(caption);
+		CleanupStack::Pop(caption);
+		}
+	// Icons
+	if (iIconArray)
+		iIconArray->ResetAndDestroy();
+	else
+		iIconArray=new(ELeave) CArrayPtrFlat<CApaMaskedBitmap>(2);
+	aStream>>card;
+	const TInt iconCount(card);
+	CApaMaskedBitmap* icon=NULL;
+	for (TInt jj=0;jj<iconCount;jj++)
+		{
+		icon=CApaMaskedBitmap::NewLC();
+		aStream >> *icon;
+		iIconArray->AppendL(icon);
+		CleanupStack::Pop(icon);
+		}
+	}
+
+void CApaAIFViewData::ExternalizeL(RWriteStream& aStream) const
+	{
+	// Uid
+	aStream.WriteInt32L(iViewUid.iUid);
+	// Screen Mode
+	aStream.WriteInt32L(iScreenMode);
+	// Captions
+	const TInt captionCount=iCaptionArray->Count();
+	aStream<<TCardinality(captionCount);
+	for (TInt ii=0;ii<captionCount;ii++)
+		{
+		aStream << *((*iCaptionArray)[ii]);
+		}
+	// Icons
+	const TInt iconCount=iIconArray->Count();
+	aStream<<TCardinality(iconCount);
+	for (TInt jj=0;jj<iconCount;jj++)
+		{
+		aStream << *((*iIconArray)[jj]);
+		}
+	}
+
+void CApaAIFViewData::SetScreenMode(TInt aScreenMode)
+	{
+	iScreenMode=aScreenMode;
+	}
+
+void CApaAIFViewData::AddCaptionL(TLanguage aLanguage,const TDesC& aCaption)
+	{
+	CApaAIFCaption* caption=CApaAIFCaption::NewLC(aLanguage,aCaption);
+	iCaptionArray->AppendL(caption);
+	CleanupStack::Pop(caption);
+	}
+
+void CApaAIFViewData::AddIconL(CApaMaskedBitmap& aIcon)
+	{
+	CApaMaskedBitmap* icon=CApaMaskedBitmap::NewL(&aIcon);
+	CleanupStack::PushL(icon);
+	iIconArray->AppendL(icon);
+	CleanupStack::Pop(icon);
+	}
+
+void CApaAIFViewData::AddIconIndexL(TInt aIndex)
+	{
+	if (!iIconIndexArray)
+		{
+		iIconIndexArray = new(ELeave) CArrayFixFlat<TInt>(4);
+		}
+	iIconIndexArray->AppendL(aIndex);
+	}
+
+void CApaAIFViewData::SetViewUid(TUid aUid)
+	{
+	iViewUid=aUid;
+	}
+
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER TApaAppCaption CApaAIFViewData::CaptionL(TLanguage aLanguage) const
+	{
+	RFs fs;
+	CleanupClosePushL(fs);
+	User::LeaveIfError(fs.Connect());
+	RArray<TLanguage> downgradePath;
+	CleanupClosePushL(downgradePath);
+	BaflUtils::GetDowngradePathL(fs,aLanguage,downgradePath);
+	TApaAppCaption result(KNullDesC);
+	const TInt languagecount=downgradePath.Count();
+	const TInt count=iCaptionArray->Count();
+	for (TInt j=0; j<languagecount; j++)
+		{
+		for (TInt ii=0;ii<count;ii++)
+			{
+			const CApaAIFCaption& caption=*(*iCaptionArray)[ii];
+			if (caption.Language()==downgradePath[j])
+				{
+				result=caption.Caption();
+				j=languagecount; // to exit outer loop
+				break;
+				}
+			}
+		}
+	CleanupStack::PopAndDestroy(2, &fs);
+	return result;
+	}
+
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER CApaMaskedBitmap* CApaAIFViewData::IconByIndexL(TInt aIndex) const
+	{
+	return (*iIconArray)[aIndex];
+	}
+
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER TInt CApaAIFViewData::NumberOfIcons() const
+	{
+	return (iIconIndexArray ? iIconIndexArray->Count() : iIconArray->Count());
+	}
+
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER TUid CApaAIFViewData::ViewUid() const
+	{
+	return iViewUid;
+	}
+
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER TInt CApaAIFViewData::ScreenMode() const
+	{
+	return iScreenMode;
+	}
+
+//
+// Class CApaAppInfoFile
+//
+
+CApaAppInfoFile::CApaAppInfoFile(RFs& aFs)
+:iFs(aFs)
+	{}
+
+void CApaAppInfoFile::TCaptionHeader::InternalizeL(RReadStream& aStream)
+	{
+	aStream >> iCaption;
+	iLanguage=(TLanguage)aStream.ReadInt16L();
+	}
+
+void CApaAppInfoFile::TCaptionHeader::ExternalizeL(RWriteStream& aStream) const
+	{
+	aStream	<< iCaption;
+	aStream.WriteInt16L(iLanguage);
+	}
+
+void CApaAppInfoFile::TIconHeader::InternalizeL(RReadStream& aStream)
+	{
+	aStream >> iIcon;
+	iIconSideInPixels=aStream.ReadInt16L();
+	}
+
+void CApaAppInfoFile::TIconHeader::ExternalizeL(RWriteStream& aStream) const
+	{
+	aStream	<< iIcon;
+	aStream.WriteInt16L(iIconSideInPixels);
+	}
+
+void CApaAppInfoFile::TDataTypeHeader::InternalizeL(RReadStream& aStream)
+	{
+	aStream >> iDataType;
+	iPriority=aStream.ReadInt16L();
+	}
+
+void CApaAppInfoFile::TDataTypeHeader::ExternalizeL(RWriteStream& aStream) const
+	{
+	aStream << iDataType;
+	aStream.WriteInt16L(iPriority);
+	}
+
+void CApaAppInfoFile::TViewDataHeader::InternalizeL(RReadStream& aStream)
+	{
+	aStream >> iViewData;
+	}
+
+void CApaAppInfoFile::TViewDataHeader::ExternalizeL(RWriteStream& aStream) const
+	{
+	aStream << iViewData;
+	}
+
+void CApaAppInfoFile::TFileOwnershipInfoHeader::InternalizeL(RReadStream& aStream)
+	{
+	aStream >> iOwnedFileName;
+	}
+
+void CApaAppInfoFile::TFileOwnershipInfoHeader::ExternalizeL(RWriteStream& aStream) const
+	{
+	aStream	<< iOwnedFileName;
+	}
+
+CApaAppInfoFile::~CApaAppInfoFile()
+	{
+	if (iCaptionHeaderArray)
+		{
+		const TInt maxIndex=iCaptionHeaderArray->Count() - 1;
+		for(TInt i=maxIndex; i>=0; i--)
+			{
+			const TSwizzle<HBufC>& caption = iCaptionHeaderArray->At(i).iCaption; 
+			if (caption.IsPtr())
+				{
+				delete caption.AsPtr();
+				iCaptionHeaderArray->Delete(i);
+				}
+			}
+		}
+	delete iCaptionHeaderArray;
+	delete iIconHeaderArray;
+	if (iDataTypeHeaderArray)
+		{
+		const TInt maxIndex=iDataTypeHeaderArray->Count() - 1;
+		for(TInt i=maxIndex; i>=0; i--)
+			{
+			const TSwizzle<TDataType>& dataType = iDataTypeHeaderArray->At(i).iDataType;
+			if (dataType.IsPtr())
+				{
+				delete dataType.AsPtr();
+				iDataTypeHeaderArray->Delete(i);
+				}
+			}
+		}
+	delete iDataTypeHeaderArray;
+	if (iViewDataHeaderArray)
+		{
+		const TInt maxIndex=iViewDataHeaderArray->Count() - 1;
+		for(TInt i=maxIndex; i>=0; i--)
+			{
+			const TSwizzle<CApaAIFViewData>& viewData = iViewDataHeaderArray->At(i).iViewData;
+			if (viewData.IsPtr())
+				{
+				delete viewData.AsPtr();
+				iViewDataHeaderArray->Delete(i);
+				}
+			}
+		}
+	delete iViewDataHeaderArray;
+	if (iFileOwnershipInfoHeaderArray)
+		{
+		const TInt maxIndex=iFileOwnershipInfoHeaderArray->Count() - 1;
+		for(TInt i=maxIndex; i>=0; i--)
+			{
+			const TSwizzle<HBufC>& fileName = iFileOwnershipInfoHeaderArray->At(i).iOwnedFileName;
+			if (fileName.IsPtr())
+				{
+				delete fileName.AsPtr();
+				iFileOwnershipInfoHeaderArray->Delete(i);
+				}
+			}
+		}
+	delete iFileOwnershipInfoHeaderArray;
+	delete iStore;
+	}
+
+void CApaAppInfoFile::ConstructL()
+	{
+	iCaptionHeaderArray=new(ELeave) CArrayFixFlat<TCaptionHeader>(4);
+	iIconHeaderArray=new(ELeave) CArrayFixFlat<TIconHeader>(4);
+	iDataTypeHeaderArray=new(ELeave) CArrayFixFlat<TDataTypeHeader>(4);
+	iViewDataHeaderArray=new(ELeave) CArrayFixFlat<TViewDataHeader>(4);
+	iFileOwnershipInfoHeaderArray=new(ELeave) CArrayFixFlat<TFileOwnershipInfoHeader>(4);
+	}
+
+//
+// Class CApaAppInfoFileReader
+//
+
+CApaAppInfoFileReader::CApaAppInfoFileReader(RFs& aFs)
+	:CApaAppInfoFile(aFs)
+	{}
+
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER CApaAppInfoFileReader::~CApaAppInfoFileReader()
+/** Destructor.
+
+Destroys all resources owned by the aif file reader. */
+	{
+	delete iDefaultCaption;
+	delete iAifFileName;
+	}
+
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER CApaAppInfoFileReader* CApaAppInfoFileReader::NewLC(RFs& aFs, const TDesC& aFileName,TUid aUid)
+/** Allocates and constructs the aif file reader and internalises the contents 
+of the specified aif file.
+
+@param aFs Connected session with the file server.
+@param aFileName The full path and (language-neutral) filename of the aif file.
+@param aApplicationUid The application's UID. If you specify a value other 
+than KNullUid, the aif file must have this value as its third (most derived) 
+UID.
+@leave KErrCorrupt The UID specified is incorrect, or if KNullUid was specified, 
+the aif file's second UID was not KUidAppInfoFile.
+@return Pointer to the newly constructed and initialised aif file reader. The 
+object is left on the cleanup stack. */
+	{
+	CApaAppInfoFileReader* self=new(ELeave) CApaAppInfoFileReader(aFs);
+	CleanupStack::PushL(self);
+	self->ConstructL(aFileName,aUid);
+	return self;
+	}
+
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER CApaAppInfoFileReader* CApaAppInfoFileReader::NewL(RFs& aFs, const TDesC& aFileName,TUid aUid)
+/** Allocates and constructs the aif file reader and internalises the contents 
+of the specified aif file.
+
+@param aFs Connected session with the file server.
+@param aFileName The full path and (language-neutral) filename of the aif file.
+@param aApplicationUid The application's UID. If you specify a value other 
+than KNullUid, the aif file must have this as its third (most derived) UID.
+@leave KErrCorrupt The UID specified is incorrect, or if KNullUid was specified, 
+the aif file's second UID was not KUidAppInfoFile.
+@return Pointer to the newly constructed and initialised aif file reader. The 
+object is popped from the cleanup stack. */
+	{
+	CApaAppInfoFileReader* self=CApaAppInfoFileReader::NewLC(aFs, aFileName,aUid);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+void CApaAppInfoFileReader::ConstructL(const TDesC& aFileName,TUid aMostDerivedUid)
+	{
+	__DECLARE_NAME(_S("CApaAppInfoFileReader"));
+	CApaAppInfoFile::ConstructL();
+	TParse parse;
+	User::LeaveIfError(parse.Set(aFileName,NULL,NULL));
+	iDefaultCaption=parse.Name().AllocL();
+	TFileName localFileName;
+	localFileName.Copy(aFileName);
+	BaflUtils::NearestLanguageFile(iFs,localFileName);
+	iRomPointer=iFs.IsFileInRom(localFileName);
+
+	iAifFileName = localFileName.AllocL();
+
+	// Get the file type
+	TEntry entry;
+	User::LeaveIfError(iFs.Entry(localFileName, entry));
+	if (!entry.IsTypeValid())
+		{
+		// Invalid UID
+		User::Leave(KErrCorrupt);
+		}
+
+	// Determine the type of AIF file
+	const TUidType& type = entry.iType;
+	if ((
+#if defined(UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER)
+		type[1] == KUidInterimFormatFileForJavaMIDletInstaller
+#endif
+		) && (aMostDerivedUid == KNullUid || type[2] == aMostDerivedUid))
+		{
+		// Read old AIF format file
+		CFileStore* store = CFileStore::OpenL(iFs,localFileName,EFileRead|EFileShareReadersOnly);
+		iStore = store;
+		RStoreReadStream inStream;
+		inStream.OpenLC(*store,store->Root());
+		InternalizeL(inStream);
+		CleanupStack::PopAndDestroy(&inStream);
+		}
+	else
+		{
+		// it's the wrong file!!!!!
+		User::Leave(KErrCorrupt);
+		}
+	}
+
+void CApaAppInfoFileReader::LoadAifFileVersionTwoL(const TDesC& aFileName, TUid aMostDerivedUid)
+	{
+	// Version 2 AIF format:
+	//
+	//  +--------------------- - - -------- - - ---+
+	//  |  UID  | RSC len | RSC block |  MBM block |
+	//  +--------------------- - - -------- - - ---+
+	//
+	// UID = 4 bytes (incl. checksum)
+	// RSC len = 4 bytes
+	// RSC block = RSC len bytes + padding to make MBM block 4-byte aligned
+	// MBM block = remainder of file, 4-byte aligned
+	//
+	// Read 16-bit block for length of RSC file
+	RFile file;
+	User::LeaveIfError(file.Open(iFs, aFileName, EFileRead | EFileShareReadersOnly));
+	CleanupClosePushL(file);
+	TInt aifHeaderOffset = 16;	// skip over UID and checksum
+	User::LeaveIfError(file.Seek(ESeekStart, aifHeaderOffset));
+	TBuf8<4> buffer;
+	User::LeaveIfError(file.Read(buffer));
+	const TInt rscLength = buffer[0] | (buffer[1] << 8) | (buffer[2] << 16) | (buffer[3] << 24);
+	TInt fileSize = 0;
+	User::LeaveIfError(file.Size(fileSize));
+	CleanupStack::PopAndDestroy(&file);
+
+	// Open RSC file using offset
+	RResourceFile resFile;
+	resFile.OpenL(iFs, aFileName, aifHeaderOffset + 4, rscLength);
+	CleanupClosePushL(resFile);
+
+	// Read the first resource (AIF_DATA struct)
+	HBufC8* resource = resFile.AllocReadLC(1);
+
+	TResourceReader reader;
+	reader.SetBuffer(resource);
+
+	// Read app UID
+	const TInt uid = reader.ReadInt32();
+	if ((aMostDerivedUid != KNullUid) && (uid != aMostDerivedUid.iUid))
+		{
+		User::Leave(KErrCorrupt);
+		}
+	// Num icons
+	const TInt numIcons = reader.ReadInt16();
+
+	// Caption array
+	const TInt captionArraySize = reader.ReadInt16();
+	TInt i;
+	for (i=0; i < captionArraySize; i++)
+		{
+		TCaptionHeader header;
+		header.iLanguage = static_cast<TLanguage>(reader.ReadInt16());
+		TPtrC caption = reader.ReadTPtrC();
+		header.iCaption = caption.AllocLC();
+		iCaptionHeaderArray->AppendL(header);
+		CleanupStack::Pop(header.iCaption);
+		}
+
+	// Read capability flags
+	iCapability.iAppIsHidden = reader.ReadInt8();
+	iCapability.iEmbeddability = static_cast<TApaAppCapability::TEmbeddability>(reader.ReadInt8());
+	iCapability.iSupportsNewFile = reader.ReadInt8();
+	iCapability.iLaunchInBackground = reader.ReadInt8();
+
+	// Group name
+	iCapability.iGroupName = reader.ReadTPtrC();
+
+	// Datatype list
+	const TInt dataTypeArraySize = reader.ReadInt16();
+	for (i=0; i < dataTypeArraySize; i++)
+		{
+		TDataTypeHeader dataTypeHeader;
+		dataTypeHeader.iPriority = (TDataTypePriority)reader.ReadInt16();
+		TPtrC8 dataTypePtr = reader.ReadTPtrC8();
+		TDataType* dataType = new(ELeave) TDataType(dataTypePtr);
+		CleanupStack::PushL(dataType);
+		dataTypeHeader.iDataType = dataType;
+		iDataTypeHeaderArray->AppendL(dataTypeHeader);
+		CleanupStack::Pop(dataType);
+		}
+
+	// Read MBM block
+	iMbmOffset = aifHeaderOffset + 4 + rscLength;
+	// Calculate any padding after the RSC (MBM block must be 4-byte aligned)
+	TInt mbmPadding = (rscLength % 4);
+	if (mbmPadding)
+		mbmPadding = 4 - mbmPadding;
+	iMbmOffset += mbmPadding;
+	TInt iconIndex = 0;
+	if (fileSize > iMbmOffset)
+		{
+		// Populate the icon array
+		AddIconHeadersL(aFileName, iMbmOffset, numIcons);
+		iconIndex += numIcons;
+		}
+
+	// View list
+	const TInt viewListArraySize = reader.ReadInt16();
+	for (i=0; i < viewListArraySize; i++)
+		{
+		CApaAIFViewData* viewData = CApaAIFViewData::NewLC();
+		viewData->SetViewUid(TUid::Uid(reader.ReadInt32()));	// Read UID
+		viewData->SetScreenMode(reader.ReadInt32());			// Read screenmode
+		TInt numViewIcons = reader.ReadInt16();					// Read num icons
+		TInt j = 0;
+		for ( ; j < numViewIcons; j++)
+			{
+			viewData->AddIconIndexL(iconIndex);
+			iconIndex++;
+			}
+		// Read caption array
+		const TInt viewCaptArraySize = reader.ReadInt16();
+		for (j=0; j < viewCaptArraySize; j++)
+			{
+			TLanguage langCode = static_cast<TLanguage>(reader.ReadInt16());
+			TPtrC caption = reader.ReadTPtrC();
+			viewData->AddCaptionL(langCode, caption);
+			}
+		TViewDataHeader header;
+		header.iViewData = viewData;
+		iViewDataHeaderArray->AppendL(header);
+		CleanupStack::Pop(viewData);
+		}
+
+	// File ownership list
+	const TInt fileOwnershipArraySize = reader.ReadInt16();
+	for (i=0; i < fileOwnershipArraySize; i++)
+		{
+		// Filename
+		TFileOwnershipInfoHeader ownership;
+		TPtrC fileNamePtr = reader.ReadTPtrC();
+		ownership.iOwnedFileName = fileNamePtr.AllocLC();
+		iFileOwnershipInfoHeaderArray->AppendL(ownership);
+		CleanupStack::Pop(ownership.iOwnedFileName);
+		}
+	CleanupStack::PopAndDestroy(2, &resFile);
+	}
+
+void CApaAppInfoFileReader::AddIconHeadersL(const TDesC& aFileName, TInt32 aFileOffset, TInt aNumIcons)
+	{
+	CFbsBitmap* bmp = new(ELeave) CFbsBitmap();
+	CleanupStack::PushL(bmp);
+	for (TInt i=0; i < aNumIcons; i++)
+		{
+		User::LeaveIfError(bmp->Load(aFileName, i * 2, ETrue, aFileOffset));
+		TSize iconSize = bmp->SizeInPixels();
+		TIconHeader header;
+		header.iIcon = NULL;
+		header.iIconMain = NULL;
+		header.iIconMask = NULL;
+		header.iIconSideInPixels = iconSize.iWidth;
+		iIconHeaderArray->AppendL(header);
+		}
+	CleanupStack::PopAndDestroy(bmp);
+	}
+
+void CApaAppInfoFileReader::InternalizeL(RReadStream& aStream)
+	{
+	aStream>> *iCaptionHeaderArray;		// Internalizes the headers only
+	aStream>> *iIconHeaderArray;
+	aStream>> iCapability;
+	TInt version=EAifVersionOriginal;
+	TRAP_IGNORE(version=aStream.ReadInt32L());
+	if (version<EAifVersionAddsDataType)
+		return;
+	aStream>> *iDataTypeHeaderArray;
+	if (version<EAifVersionAddsViewData)
+		return;
+	aStream>> *iViewDataHeaderArray;
+	if (version<EAifVersionAddsFileOwnershipInfo)
+		return;
+	aStream>> *iFileOwnershipInfoHeaderArray;
+#if defined(UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER)
+	if (version<EAifVersionAddsJavaMIDletInfo)
+		return;
+	iJavaMIDletInfo_AmsAuthId=aStream.ReadUint32L();
+	iJavaMIDletInfo_MIDlet=aStream.ReadInt32L();
+#endif
+	}
+
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER TApaAppCaption CApaAppInfoFileReader::CaptionL(TLanguage aLanguage)
+// Find language id and return matching caption, loaded from file.
+// Does not allocate storage for the caption so there's no need to delete the array elements.
+/** Searches for the most appropriate caption in the aif file for the language 
+specified.
+
+If a caption in the specified language is not found, the function searches 
+for the best alternative using the language downgrade path.
+
+If there are no captions at all in the aif file, a default caption is used 
+(the aif filename).
+
+@param aLanguage The language of the required caption.
+@return The application's caption. */
+	{
+	RFs fs;
+	CleanupClosePushL(fs);
+	User::LeaveIfError(fs.Connect());
+	RArray<TLanguage> downgradePath;
+	CleanupClosePushL(downgradePath);
+	BaflUtils::GetDowngradePathL(fs,aLanguage,downgradePath);
+	TApaAppCaption result(*iDefaultCaption);
+	const TInt count=iCaptionHeaderArray->Count();
+	if (count>0)
+		{
+		const TInt languageCount=downgradePath.Count();
+		TInt captionIndex=KErrNotFound;
+		for (TInt j=0; j<languageCount; j++)
+			{
+			for (TInt i=0;i<count;i++)
+				{		
+				if ((*iCaptionHeaderArray)[i].iLanguage==downgradePath[j])
+					{
+					captionIndex=i;
+					j=languageCount;//to exit outer loop
+					break;
+					}
+				}
+			}
+		TCaptionHeader pCaptionHeader;
+		if (captionIndex!=KErrNotFound)
+			{
+			pCaptionHeader=(*iCaptionHeaderArray)[captionIndex];
+			}
+		else		// use caption for the first language specified in the aif file
+					// since we don't have anything more suitable
+			{ 		
+			pCaptionHeader=(*iCaptionHeaderArray)[0];
+			}
+
+		if (iStore)
+			{
+			RStoreReadStream inStream;
+			inStream.OpenLC(*iStore,pCaptionHeader.iCaption.AsId());
+			inStream >> result;
+			CleanupStack::PopAndDestroy(&inStream);
+			}
+		else
+			{
+			__ASSERT_DEBUG(pCaptionHeader.iCaption.IsPtr(), Panic(EPanicNoCaption));
+			result = *(pCaptionHeader.iCaption);
+			}
+		downgradePath.Reset();
+		}
+	CleanupStack::PopAndDestroy(2, &fs);
+	return result;
+	}
+
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER void CApaAppInfoFileReader::StretchDrawL(CFbsBitmap* aSource,CFbsBitmap* aTarget,TSize aSizeInPixels)
+/** Creates a new bitmap based on another, stretched or compressed to the specified 
+size.
+
+@param aSource The source bitmap to copy.
+@param aTarget The target bitmap. On return, this is set to be a copy of aSource, 
+but stretched or compressed to the specified size.
+@param aSizeInPixels The required size for the target bitmap. */
+	{
+	User::LeaveIfError(aTarget->Create(aSizeInPixels,aSource->DisplayMode()));
+	CFbsBitmapDevice* bitDev=CFbsBitmapDevice::NewL(aTarget);
+	CleanupStack::PushL(bitDev);
+	CFbsBitGc* gc;
+	User::LeaveIfError(bitDev->CreateContext((CGraphicsContext*&)gc));
+	gc->DrawBitmap(TRect(aSizeInPixels),aSource);
+	delete gc;
+	CleanupStack::PopAndDestroy(bitDev);
+	}
+
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER TInt CApaAppInfoFileReader::NumberOfBitmaps() const
+/** Returns the number of icons in the aif file.
+
+@return The number of icons in the aif file. */
+	{
+	return iIconHeaderArray->Count();
+	}
+
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER CApaMaskedBitmap* CApaAppInfoFileReader::CreateMaskedBitmapByIndexLC(TInt aIndex)
+	{
+	const TInt count=iIconHeaderArray->Count();
+	if (count<=aIndex) // panic?
+		User::Leave(KErrNotFound);
+	//
+	CApaMaskedBitmap* icon=CApaMaskedBitmap::NewLC();
+	if (iStore)
+		{
+		RStoreReadStream inStream;
+		inStream.OpenLC(*iStore,(*iIconHeaderArray)[aIndex].iIcon.AsId());
+		MStreamBuf* src=inStream.Source();
+		__ASSERT_DEBUG(src, Panic(EPanicNullPointer));
+		const TUid uid = TUid::Uid(inStream.ReadInt32L());
+		src->SeekL(MStreamBuf::ERead,-4);
+		if (uid==KCBitwiseBitmapUid)
+			{
+			TUint32* fileOffsetPtr=(TUint32*) src;
+			fileOffsetPtr+=4;
+			icon->SetRomBitmapL(iRomPointer+(*fileOffsetPtr));
+			}
+		else
+			{
+			inStream >> *icon;
+			}
+		CleanupStack::PopAndDestroy(&inStream);
+		}
+	else
+		{
+		CFbsBitmap* mask = new(ELeave) CFbsBitmap();
+		CleanupStack::PushL(mask);
+		TInt mbmIndex = aIndex * 2;		// we need to map 'icon index' to 'mbm index' (bmp + mask)
+		__ASSERT_DEBUG(iAifFileName, Panic(EPanicNullPointer));
+		User::LeaveIfError(icon->Load(*iAifFileName, mbmIndex, ETrue, iMbmOffset));
+		User::LeaveIfError(mask->Load(*iAifFileName, mbmIndex + 1, ETrue, iMbmOffset));
+		icon->SetMaskBitmap(mask);
+		CleanupStack::Pop(mask);
+		}
+	//
+	return icon;
+	}
+
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER CApaMaskedBitmap* CApaAppInfoFileReader::CreateMaskedBitmapL(TInt aIconSideInPixels)
+//
+// Use CreateMaskedBitmapByIndexLC. To access a bitmap by size use RApaLsSession APIs.
+//
+/** Creates a new masked bitmap based on the one in the aif file whose size is 
+closest to the size specified.
+
+If all bitmaps in the file are larger than the size specified, the new bitmap 
+is based on the smallest and is shrunk to the specified size.
+
+@deprecated
+@param aIconSideInPixels The maximum width and height in pixels of the bitmap. 
+The new bitmap will be this size, or smaller.
+@leave KErrNotFound There are no bitmaps in the file.
+@return Pointer to the new bitmap. The caller takes ownership. */
+	{
+	__ASSERT_DEBUG(iIconHeaderArray, Panic(EPanicNullPointer));
+	const TInt count=iIconHeaderArray->Count();
+	if (count==0)
+		User::Leave(KErrNotFound);
+	//
+	TInt closest=0;
+	TInt smallest=0;
+	TInt minSoFar=KMaxTInt;
+	TInt smallestSoFar=KMaxTInt;
+	TInt delta=0;
+	for (TInt i=0;i<count;i++)
+		{
+		TIconHeader* pIconHeader=(&(*iIconHeaderArray)[i]);
+		delta = aIconSideInPixels-pIconHeader->iIconSideInPixels; // Abs()
+		if (pIconHeader->iIconSideInPixels<smallestSoFar)
+			{ // the smallest is used if they're all too big
+			smallest = i;
+			smallestSoFar = pIconHeader->iIconSideInPixels;
+			}
+		if (delta>=0 && delta<minSoFar)
+			{
+			minSoFar=delta;
+			closest=i;
+			if (delta==0)
+				break;
+			}
+		}
+	//
+	if (minSoFar==KMaxTInt)
+		closest = smallest;
+	//
+	CApaMaskedBitmap* icon = CreateMaskedBitmapByIndexLC(closest);
+	//
+	if (minSoFar==KMaxTInt)
+		{// all the icons are too big - squash down the smallest
+		CApaMaskedBitmap* newIcon=CApaMaskedBitmap::NewLC();
+		TSize iconSize(aIconSideInPixels,aIconSideInPixels);
+		StretchDrawL(icon,newIcon,iconSize);
+		StretchDrawL(icon->Mask(),newIcon->Mask(),iconSize);
+		CleanupStack::Pop(newIcon);
+		CleanupStack::PopAndDestroy(icon);
+		return newIcon;
+		}
+	CleanupStack::Pop(icon);
+	return icon;
+	}
+
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER void CApaAppInfoFileReader::Capability(TDes8& aInfo)const
+/** Gets the capability information read from the aif file.
+
+@param aInfo A TApaAppCapabilityBuf object. On return, this contains the application's 
+capabilities. */
+	{
+	TApaAppCapabilityBuf buf(iCapability);
+	TApaAppCapability::CopyCapability(aInfo,buf);
+	}
+
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER void CApaAppInfoFileReader::DataTypesSupportedL(CArrayFix<TDataTypeWithPriority>& aTypeList) const
+/** Gets the MIME types supported by the application, and their priorities. 
+
+@param aTypeList An empty array. On return, this contains the MIME type priorities 
+read from the aif file. MIME type priorities determine which application is 
+launched to display a particular document.
+@panic APGRFX 29 The aTypeList array is not empty when calling the function. 
+Debug builds only.
+@panic APGRFX 33 The internal array holding the MIME type information is uninitialised. 
+Debug builds only. */
+	{
+	__ASSERT_DEBUG(aTypeList.Count()==0,Panic(EDPanicArrayNotEmpty));
+	__ASSERT_DEBUG(iDataTypeHeaderArray,Panic(EDPanicInvalidDataTypeArray));
+	TInt count=iDataTypeHeaderArray->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		const TDataTypeHeader& header=(*iDataTypeHeaderArray)[i];
+		if (iStore)
+			{
+			RStoreReadStream inStream;
+			inStream.OpenLC(*iStore,header.iDataType.AsId());
+			TDataType dataType;
+			inStream >> dataType;
+			aTypeList.AppendL(TDataTypeWithPriority(dataType,header.iPriority));
+			CleanupStack::PopAndDestroy(&inStream);
+			}
+		else
+			{
+			aTypeList.AppendL(TDataTypeWithPriority(*(header.iDataType), header.iPriority));
+			}
+		}
+	}
+
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER void CApaAppInfoFileReader::GetViewsL(CArrayPtr<CApaAIFViewData>& aViewList) const
+/** Gets the application view data contained in the aif file.
+
+The view data is an array of view UIDs and their associated captions and icons.
+
+@internalComponent
+@param aViewList An empty array. On return, this contains the view data read 
+from the aif file. If the file does not contain any application view data, 
+this array will be empty on return.
+@panic APGRFX 29 The aViewList array is not empty when calling the function. 
+Debug builds only.
+@panic APGRFX 34 The internal array holding the view data is uninitialised. 
+Debug builds only. */
+	{
+	__ASSERT_DEBUG(aViewList.Count()==0,Panic(EDPanicArrayNotEmpty));
+	__ASSERT_DEBUG(iViewDataHeaderArray,Panic(EDPanicInvalidViewArray));
+	TInt count=iViewDataHeaderArray->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		const TViewDataHeader& header=(*iViewDataHeaderArray)[i];
+		if (iStore)
+			{
+			CApaAIFViewData* viewData=CApaAIFViewData::NewLC();
+			RStoreReadStream inStream;
+			inStream.OpenLC(*iStore,header.iViewData.AsId());
+			inStream >> *viewData;
+			aViewList.AppendL(viewData);
+			CleanupStack::PopAndDestroy(&inStream);
+			CleanupStack::Pop(viewData);
+			}
+		else
+			{
+			// Load any icons for the view
+			// Have to create a copy here as the old AIF format (above) gives external ownership
+			// of CApaAIFViewData items in aViewList.
+			CApaAIFViewData* headerViewData = header.iViewData.AsPtr();
+			CApaAIFViewData* viewData = CApaAIFViewData::NewLC(*headerViewData);
+			viewData->LoadIconsL(*iAifFileName, iMbmOffset);
+			aViewList.AppendL(viewData);
+			CleanupStack::Pop(viewData);
+			}
+		}
+	}
+
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER void CApaAppInfoFileReader::GetOwnedFilesL(CDesCArray& aOwnedFilesList) const
+/** Gets a list of the files that the application has claimed ownership of in the 
+aif file.
+
+@param aOwnedFilesList An empty array. On return, this contains the names 
+of the files identified as being owned by the application.
+@panic APGRFX 29 The aOwnedFilesList array is not empty when calling the function. 
+Debug builds only.
+@panic APGRFX 35 The internal array holding the owned files list is uninitialised. 
+Debug builds only. */
+	{
+	__ASSERT_DEBUG(aOwnedFilesList.Count()==0,Panic(EDPanicArrayNotEmpty));
+	__ASSERT_DEBUG(iFileOwnershipInfoHeaderArray,Panic(EDPanicInvalidFileOwnershipArray));
+	const TInt count=iFileOwnershipInfoHeaderArray->Count();
+	for (TInt ii=0; ii<count; ii++)
+		{
+		const TFileOwnershipInfoHeader& header=(*iFileOwnershipInfoHeaderArray)[ii];
+		if (iStore)
+			{
+			TFileName fileName;
+			RStoreReadStream inStream;
+			inStream.OpenLC(*iStore,header.iOwnedFileName.AsId());
+			inStream >> fileName;
+			aOwnedFilesList.AppendL(fileName);
+			CleanupStack::PopAndDestroy(&inStream);
+			}
+		else
+			{
+			aOwnedFilesList.AppendL(*(header.iOwnedFileName));
+			}
+		}
+	}
+
+
+//
+// Class CApaAppInfoFileWriter
+//
+
+CApaAppInfoFileWriter::CApaAppInfoFileWriter(RFs& aFs)
+	:CApaAppInfoFile(aFs)
+	{}
+
+EXPORT_C CApaAppInfoFileWriter::~CApaAppInfoFileWriter()
+// Must delete caption and icon pointers that have been set in AddCaptionL and AddIconL
+	{
+	if (iCaptionHeaderArray)
+		{
+		const TInt maxIndex=iCaptionHeaderArray->Count() - 1;
+		for(TInt i=maxIndex; i>=0; i--)
+			{
+			const TCaptionHeader& pCaption=(*iCaptionHeaderArray)[i];
+			if (pCaption.iCaption.IsPtr())
+				{
+				delete pCaption.iCaption.AsPtr();
+				iCaptionHeaderArray->Delete(i);
+				}
+			}
+		}
+	if (iIconHeaderArray)
+		{
+		const TInt maxIndex=iIconHeaderArray->Count() - 1;
+		for(TInt i=maxIndex; i>=0; i--)
+			{
+			const TIconHeader& pIcon=(*iIconHeaderArray)[i];
+			if (pIcon.iIcon.IsPtr())
+				{
+				delete pIcon.iIcon.AsPtr();
+				iIconHeaderArray->Delete(i);
+				}
+			}
+		}
+	if (iDataTypeHeaderArray)
+		{
+		const TInt maxIndex=iDataTypeHeaderArray->Count() - 1;
+		for(TInt i=maxIndex; i>=0; i--)
+			{
+			const TDataTypeHeader& pData=(*iDataTypeHeaderArray)[i];
+			if (pData.iDataType.IsPtr())
+				{
+				delete pData.iDataType.AsPtr();
+				iDataTypeHeaderArray->Delete(i);
+				}
+			}
+		}
+	if (iViewDataHeaderArray)
+		{
+		const TInt maxIndex=iViewDataHeaderArray->Count() - 1;
+		for(TInt i=maxIndex; i>=0; i--)
+			{
+			const TViewDataHeader& pView=(*iViewDataHeaderArray)[i];
+			if (pView.iViewData.IsPtr())
+				{
+				delete pView.iViewData.AsPtr();
+				iViewDataHeaderArray->Delete(i);
+				}
+			}
+		}
+	if (iFileOwnershipInfoHeaderArray)
+		{
+		const TInt maxIndex=iFileOwnershipInfoHeaderArray->Count() - 1;
+		for(TInt i=maxIndex; i>=0; i--)
+			{
+			const TFileOwnershipInfoHeader& pView=(*iFileOwnershipInfoHeaderArray)[i];
+			if (pView.iOwnedFileName.IsPtr())
+				{
+				delete pView.iOwnedFileName.AsPtr();
+				iFileOwnershipInfoHeaderArray->Delete(i);
+				}
+			}
+		}
+	delete iMap;		// Must delete before iStore
+	}
+
+// CApaResourceFileWriterBase::MDataSink
+
+void CApaResourceFileWriterBase::MDataSink::WriteBufferL(const TDesC8& aBuffer)
+	{
+	if (aBuffer.Length()>0)
+		{
+		if (iBufferSinkForCompressedUnicodeFormat!=NULL)
+			{
+			WriteInCompressedUnicodeFormatL(aBuffer.Length(), aBuffer, EFalse);
+			}
+		else
+			{
+			DoWriteBufferL(aBuffer);
+			iNumberOfBytesWhenUncompressed+=aBuffer.Length();
+			}
+		}
+	}
+
+void CApaResourceFileWriterBase::MDataSink::WriteCompressedUnicodeRunL(TInt aNumberOfBytesWhenUncompressed, const TDesC8& aTextAsCompressedUnicode)
+	{
+	WriteInCompressedUnicodeFormatL(aNumberOfBytesWhenUncompressed, aTextAsCompressedUnicode, ETrue);
+	}
+
+void CApaResourceFileWriterBase::MDataSink::WriteInCompressedUnicodeFormatL(TInt aNumberOfBytesWhenUncompressed, const TDesC8& aData, TBool aCompressedUnicode)
+	{
+	__ASSERT_DEBUG(iBufferSinkForCompressedUnicodeFormat!=NULL, Panic(EPanicWrongResourceFormat1));
+	const TInt dataLength=aData.Length();
+	__ASSERT_DEBUG(((dataLength==0) && ((aNumberOfBytesWhenUncompressed==0) || (aNumberOfBytesWhenUncompressed==1))) ||
+				   ((dataLength>0) && (aNumberOfBytesWhenUncompressed>0)), Panic(EPanicBadCompressedUnicodeRun));
+	if (dataLength>0)
+		{
+		if ((iNumberOfBytesWhenUncompressed==0) && (iBufferSinkForCompressedUnicodeFormat->iNumberOfBytesWhenUncompressed==0))
+			{
+			if (aCompressedUnicode)
+				{
+				iFlags|=EFlag_InCompressedUnicodeRun;
+				}
+			else
+				{
+				iFlags&=~EFlag_InCompressedUnicodeRun;
+				}
+			}
+		else if ((iFlags&EFlag_InCompressedUnicodeRun)^(aCompressedUnicode? EFlag_InCompressedUnicodeRun: 0)) // if we're changing the state of the EFlag_InCompressedUnicodeRun flag
+			{
+			FlushL(EFalse);
+			iFlags^=EFlag_InCompressedUnicodeRun; // toggle the EFlag_InCompressedUnicodeRun flag
+			}
+		static_cast<MDataSink*>(iBufferSinkForCompressedUnicodeFormat)->DoWriteBufferL(aData);
+		}
+	iBufferSinkForCompressedUnicodeFormat->iNumberOfBytesWhenUncompressed+=aNumberOfBytesWhenUncompressed;
+	}
+
+TInt CApaResourceFileWriterBase::MDataSink::NumberOfBytesWhenUncompressed() const
+	{
+	TInt numberOfBytesWhenUncompressed=iNumberOfBytesWhenUncompressed;
+	if (iBufferSinkForCompressedUnicodeFormat!=NULL)
+		{
+		numberOfBytesWhenUncompressed+=iBufferSinkForCompressedUnicodeFormat->iNumberOfBytesWhenUncompressed;
+		}
+	return numberOfBytesWhenUncompressed;
+	}
+
+CApaResourceFileWriterBase::MDataSink::MDataSink(RBufferSink* aBufferSinkForCompressedUnicodeFormat)
+	:iNumberOfBytesWhenUncompressed(0),
+	 iFlags(0),
+	 iBufferSinkForCompressedUnicodeFormat(aBufferSinkForCompressedUnicodeFormat)
+	{
+	}
+
+void CApaResourceFileWriterBase::MDataSink::FlushL(TBool aFinalFlush)
+	{
+	if (iBufferSinkForCompressedUnicodeFormat!=NULL)
+		{
+		RBuf8 run;
+		CleanupClosePushL(run);
+		TInt numberOfBytesInRunWhenUncompressed=0;
+		iBufferSinkForCompressedUnicodeFormat->FlushAndGetAndResetL(numberOfBytesInRunWhenUncompressed, run);
+		if (numberOfBytesInRunWhenUncompressed>0)
+			{
+			if ((iNumberOfBytesWhenUncompressed==0) && ((iFlags&EFlag_InCompressedUnicodeRun)==0))
+				{
+				WriteRunLengthL(0); // insert initial zero-length run-length as we're not starting with compressed Unicode
+				}
+			__ASSERT_DEBUG(run.Length()>0, Panic(EPanicBadRunLength));
+			WriteRunLengthL(run.Length());
+			DoWriteBufferL(run);
+			iNumberOfBytesWhenUncompressed+=numberOfBytesInRunWhenUncompressed;
+			}
+		CleanupStack::PopAndDestroy(&run);
+		if (aFinalFlush && (iNumberOfBytesWhenUncompressed==0))
+			{
+			WriteRunLengthL(0); // write a zero-length run-length as the resource is completely empty
+			}
+		}
+	}
+
+void CApaResourceFileWriterBase::MDataSink::Reset(TInt& aNumberOfBytesWhenUncompressed)
+	{
+	aNumberOfBytesWhenUncompressed=iNumberOfBytesWhenUncompressed;
+	iNumberOfBytesWhenUncompressed=0;
+	iFlags=0;
+	}
+
+void CApaResourceFileWriterBase::MDataSink::WriteRunLengthL(TInt aRunLength)
+	{
+	__ASSERT_DEBUG((aRunLength&~0x7fff)==0, Panic(EPanicBadRunLengthParameter));
+	__ASSERT_DEBUG(CompressedUnicodeFormat(), Panic(EPanicWrongResourceFormat2));
+	TBuf8<2> buffer;
+	if (aRunLength&~0x7f)
+		{
+		buffer.Append((aRunLength>>8)|0x80);
+		}
+	buffer.Append(aRunLength&0xff);
+	DoWriteBufferL(buffer); // must call DoWriteBufferL here (not WriteBufferL) so that iNumberOfBytesWhenUncompressed is not altered
+	}
+
+// CApaResourceFileWriterBase::RBufferSink
+
+CApaResourceFileWriterBase::RBufferSink::RBufferSink(RBufferSink* aBufferSinkForCompressedUnicodeFormat)
+	:MDataSink(aBufferSinkForCompressedUnicodeFormat)
+	{
+	}
+
+void CApaResourceFileWriterBase::RBufferSink::ConstructLC()
+	{
+	iBuffer.CreateL(20);
+	CleanupClosePushL(*this);
+	}
+
+void CApaResourceFileWriterBase::RBufferSink::Close()
+	{
+	iBuffer.Close();
+	}
+
+void CApaResourceFileWriterBase::RBufferSink::FlushAndGetAndResetL(TInt& aNumberOfBytesWhenUncompressed, RBuf8& aBuffer)
+	{
+	FlushL(ETrue);
+	iBuffer.Swap(aBuffer);
+	Reset(aNumberOfBytesWhenUncompressed);
+	}
+
+void CApaResourceFileWriterBase::RBufferSink::DoWriteBufferL(const TDesC8& aBuffer)
+	{
+	if (iBuffer.MaxLength()-iBuffer.Length()<aBuffer.Length())
+		{
+		iBuffer.ReAllocL(iBuffer.Length()+aBuffer.Length()+20);
+		}
+	iBuffer.Append(aBuffer);
+	}
+
+// CApaResourceFileWriterBase
+
+CApaResourceFileWriterBase::CApaResourceFileWriterBase()
+	{
+	}
+
+void CApaResourceFileWriterBase::DoGenerateFileContentsL(RBuf8& aBuffer, TUid aUid2, TUid aUid3) const
+	{
+	TInt mainResourceSizeInBytesWhenUncompressed=0;
+	RBuf8 mainResourceInFormatContainingCompressedUnicode;
+	MainResourceInCompiledFormatLC(mainResourceSizeInBytesWhenUncompressed, mainResourceInFormatContainingCompressedUnicode, ETrue);
+	TInt temp=0;
+	RBuf8 mainResourceInFormatNotContainingCompressedUnicode;
+	MainResourceInCompiledFormatLC(temp, mainResourceInFormatNotContainingCompressedUnicode, EFalse);
+	__ASSERT_DEBUG(temp==mainResourceSizeInBytesWhenUncompressed, Panic(EPanicInconsistentResourceSizeInBytes));
+	TBool mainResourceInCompressedUnicodeFormat=ETrue;
+	TPtrC8 mainResourceInSmallestFormat(mainResourceInFormatContainingCompressedUnicode);
+	if (mainResourceInSmallestFormat.Length()>=mainResourceInFormatNotContainingCompressedUnicode.Length())
+		{
+		mainResourceInCompressedUnicodeFormat=EFalse;
+		mainResourceInSmallestFormat.Set(mainResourceInFormatNotContainingCompressedUnicode);
+		}
+	TBool secondResourceInCompressedUnicodeFormat=EFalse;
+	const TDesC8* const secondResource=SecondResourceL(secondResourceInCompressedUnicodeFormat);
+	RBufferSink bufferSink(NULL);
+	bufferSink.ConstructLC();
+
+	WriteUidTypeL(bufferSink, aUid2, aUid3);
+	WriteUint8L(bufferSink, 0); // flags
+	WriteLittleEndianUint16L(bufferSink, (secondResource==NULL)? mainResourceSizeInBytesWhenUncompressed: Max(mainResourceSizeInBytesWhenUncompressed, secondResource->Length())); // the size in bytes of the largest resource in the file when uncompressed
+	TUint bitArray=0; // bit-array (one per top-level resource) indicating whether each top-level resource contains compressed unicode or not
+	if (mainResourceInCompressedUnicodeFormat)
+		{
+		bitArray|=0x01;
+		}
+	if (secondResourceInCompressedUnicodeFormat)
+		{
+		bitArray|=0x02;
+		}
+	WriteUint8L(bufferSink, bitArray);
+	WriteBufferL(bufferSink, mainResourceInSmallestFormat);
+	if (secondResource!=NULL)
+		{
+		WriteBufferL(bufferSink, *secondResource);
+		}
+	TInt filePosition=16+1+2+1;
+	WriteLittleEndianUint16L(bufferSink, filePosition);
+	filePosition+=mainResourceInSmallestFormat.Length();
+	WriteLittleEndianUint16L(bufferSink, filePosition);
+	if (secondResource!=NULL)
+		{
+		filePosition+=secondResource->Length();
+		WriteLittleEndianUint16L(bufferSink, filePosition);
+		}
+	TInt notUsed;
+	bufferSink.FlushAndGetAndResetL(notUsed, aBuffer);
+
+	CleanupStack::PopAndDestroy(3, &mainResourceInFormatContainingCompressedUnicode);
+	}
+
+void CApaResourceFileWriterBase::WriteUidTypeL(MDataSink& aDataSink, TUid aUid2, TUid aUid3) const
+	{
+	aDataSink.WriteBufferL(TCheckedUid(TUidType(TUid::Uid(0x101f4a6b), aUid2, aUid3)).Des());
+	}
+
+void CApaResourceFileWriterBase::WriteTextL(MDataSink& aDataSink, const TDesC& aText) const
+	{
+	// LTEXT
+
+	WriteUint8L(aDataSink, aText.Length());
+	if (!aDataSink.CompressedUnicodeFormat())
+		{
+		if ((aDataSink.NumberOfBytesWhenUncompressed()%2)!=0)
+			{
+			WriteUint8L(aDataSink, 0xab);
+			}
+		const TInt lengthOfTextInBytes=aText.Size();
+		WriteBufferL(aDataSink, TPtrC8(reinterpret_cast<const TUint8*>(aText.Ptr()), lengthOfTextInBytes));
+		}
+	else
+		{
+		TInt numberOfBytesWhenUncompressed=aText.Size();
+		if ((aDataSink.NumberOfBytesWhenUncompressed()%2)!=0)
+			{
+			++numberOfBytesWhenUncompressed; // for the padding-byte 0xab when it's uncompressed
+			}
+		HBufC8* const textAsCompressedUnicode=AsCompressedUnicodeLC(aText);
+		aDataSink.WriteCompressedUnicodeRunL(numberOfBytesWhenUncompressed, *textAsCompressedUnicode);
+		CleanupStack::PopAndDestroy(textAsCompressedUnicode);
+		}
+	}
+
+void CApaResourceFileWriterBase::WriteText8L(MDataSink& aDataSink, const TDesC8& aText8) const
+	{
+	// LTEXT8
+
+	WriteUint8L(aDataSink, aText8.Length());
+	WriteBufferL(aDataSink, aText8);
+	}
+
+void CApaResourceFileWriterBase::WriteUint8L(MDataSink& aDataSink, TUint aUint8) const
+	{
+	TBuf8<1> buffer;
+	buffer.Append(aUint8&0xff);
+	aDataSink.WriteBufferL(buffer);
+	}
+
+void CApaResourceFileWriterBase::WriteLittleEndianUint16L(MDataSink& aDataSink, TUint aUint16) const
+	{
+	TBuf8<2> buffer;
+	buffer.Append(aUint16&0xff);
+	buffer.Append((aUint16>>8)&0xff);
+	aDataSink.WriteBufferL(buffer);
+	}
+
+void CApaResourceFileWriterBase::WriteLittleEndianUint32L(MDataSink& aDataSink, TUint aUint32) const
+	{
+	TBuf8<4> buffer;
+	buffer.Append(aUint32&0xff);
+	buffer.Append((aUint32>>8)&0xff);
+	buffer.Append((aUint32>>16)&0xff);
+	buffer.Append((aUint32>>24)&0xff);
+	aDataSink.WriteBufferL(buffer);
+	}
+
+void CApaResourceFileWriterBase::WriteBufferL(MDataSink& aDataSink, const TDesC8& aBuffer) const
+	{
+	aDataSink.WriteBufferL(aBuffer);
+	}
+
+HBufC8* CApaResourceFileWriterBase::AsCompressedUnicodeLC(const TDesC& aUncompressedUnicode)
+	{
+	TUnicodeCompressor unicodeCompressor;
+	TMemoryUnicodeSource decompressedUnicode1(aUncompressedUnicode.Ptr());
+	TMemoryUnicodeSource decompressedUnicode2(aUncompressedUnicode.Ptr());
+	
+	// Create a buffer big enough to hold all the compressed output
+	TInt compressedUnicodeSizeInBytes = TUnicodeCompressor::CompressedSizeL(decompressedUnicode1, aUncompressedUnicode.Length());
+	HBufC8* const compressedUnicodeBuffer=HBufC8::NewLC(compressedUnicodeSizeInBytes);
+	TUint8* const compressedUnicodeBuffer_asBytePointer=const_cast<TUint8*>(compressedUnicodeBuffer->Ptr());
+	
+	// Compress the Unicode string
+	TInt numberOfInputElementsConsumed = 0;
+	TInt numberOfOutputBytes = 0;
+	unicodeCompressor.CompressL(compressedUnicodeBuffer_asBytePointer, decompressedUnicode2, compressedUnicodeSizeInBytes, aUncompressedUnicode.Length(), &numberOfOutputBytes, &numberOfInputElementsConsumed);
+	TInt temp = 0;
+	unicodeCompressor.FlushL(compressedUnicodeBuffer_asBytePointer, compressedUnicodeSizeInBytes, temp);
+	numberOfOutputBytes+=temp;
+	TPtr8 compressedUnicodeBuffer_asWritable(compressedUnicodeBuffer->Des());
+	compressedUnicodeBuffer_asWritable.SetLength(numberOfOutputBytes);
+	return compressedUnicodeBuffer;
+	}
+
+void CApaResourceFileWriterBase::MainResourceInCompiledFormatLC(TInt& aMainResourceSizeInBytesWhenUncompressed, RBuf8& aBuffer, TBool aCompressedUnicodeFormat) const
+	{
+	CleanupClosePushL(aBuffer);
+	RBufferSink bufferSinkForCompressedUnicodeFormat(NULL);
+	if (aCompressedUnicodeFormat)
+		{
+		bufferSinkForCompressedUnicodeFormat.ConstructLC();
+		}
+	RBufferSink bufferSink(aCompressedUnicodeFormat? &bufferSinkForCompressedUnicodeFormat: NULL);
+	bufferSink.ConstructLC();
+	MainResourceInCompiledFormatL(bufferSink);
+	bufferSink.FlushAndGetAndResetL(aMainResourceSizeInBytesWhenUncompressed, aBuffer);
+	CleanupStack::PopAndDestroy(&bufferSink);
+	if (aCompressedUnicodeFormat)
+		{
+		CleanupStack::PopAndDestroy(&bufferSinkForCompressedUnicodeFormat);
+		}
+	}
+
+// CApaRegistrationResourceFileWriter
+
+/** 
+Creates a new CApaRegistrationResourceFileWriter instance.
+
+@param aAppUid The UID of the application.
+@param aAppFile The name and extension of the file to generate.
+@param aAttributes The attributes of the application. See the TApaAppCapability class for more details.
+@return A pointer to the new CApaRegistrationResourceFileWriter instance.
+
+@publishedPartner
+@released
+*/
+EXPORT_C CApaRegistrationResourceFileWriter* CApaRegistrationResourceFileWriter::NewL(TUid aAppUid, const TDesC& aAppFile, TUint aAttributes)
+// aAppFile does not need to have the drive set
+	{ // static
+	CApaRegistrationResourceFileWriter* const self=new(ELeave) CApaRegistrationResourceFileWriter(aAppUid, aAttributes);
+	CleanupStack::PushL(self);
+	self->ConstructL(aAppFile);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+/** 
+The destructor for the CApaRegistrationResourceFileWriter class.
+
+@publishedPartner
+@released
+*/
+EXPORT_C CApaRegistrationResourceFileWriter::~CApaRegistrationResourceFileWriter()
+	{
+	delete iAppFile;
+	delete iLocalisableResourceFile;
+	delete iGroupName;
+	delete iOpaqueData;
+
+	TInt i;
+	for (i=iDataTypeList.Count()-1; i>=0; --i)
+		{
+		delete iDataTypeList[i].iType;
+		}
+	iDataTypeList.Close();
+
+	for (i=iFileOwnershipList.Count()-1; i>=0; --i)
+		{
+		delete iFileOwnershipList[i].iFileName;
+		}
+	iFileOwnershipList.Close();
+	}
+
+TUid CApaRegistrationResourceFileWriter::AppUid() const
+/** @internalComponent */
+	{
+	return iAppUid;
+	}
+
+void CApaRegistrationResourceFileWriter::GenerateFileContentsL(RBuf8& aBuffer) const
+/** @internalComponent */
+	{
+	DoGenerateFileContentsL(aBuffer, KUidAppRegistrationFile, iAppUid);
+	}
+
+void CApaRegistrationResourceFileWriter::SetLocalisableResourceFileL(const TDesC& aLocalisableResourceFile)
+/** @internalComponent */
+	{
+	HBufC* const localisableResourceFile=aLocalisableResourceFile.AllocL();
+	delete iLocalisableResourceFile;
+	iLocalisableResourceFile=localisableResourceFile;
+	}
+
+/** 
+Sets or clears the hidden attribute. The usual purpose of the hidden attribute is to 
+decide if the application should appear in the task list or not but this could vary between
+products.
+
+@param aAppIsHidden The value of the hidden flag.
+
+@publishedPartner
+@released
+*/
+EXPORT_C void CApaRegistrationResourceFileWriter::SetAppIsHiddenL(TBool aAppIsHidden)
+	{
+	iAppIsHidden=aAppIsHidden? 1: 0;
+	}
+
+/** 
+Sets the embeddability attribute. See the TApaAppCapability::TEmbeddability class for more details.
+
+@param aEmbeddability The value of the embeddability flags.
+
+@publishedPartner
+@released
+*/
+EXPORT_C void CApaRegistrationResourceFileWriter::SetEmbeddabilityL(TApaAppCapability::TEmbeddability aEmbeddability)
+	{
+	iEmbeddability=aEmbeddability;
+	}
+
+/** 
+Specifies if the application supports the creation of a new file or not.
+
+@param aSupportsNewFile ETrue to specify that the application supports the creation of a new file.
+
+@publishedPartner
+@released
+*/
+EXPORT_C void CApaRegistrationResourceFileWriter::SetSupportsNewFileL(TBool aSupportsNewFile)
+	{
+	iSupportsNewFile=aSupportsNewFile? 1: 0;
+	}
+
+/** 
+Specifies if the application must be launched in the background.
+
+@param aLaunchInBackground ETrue if the application must be launched in the background, EFalse otherwise.
+
+@publishedPartner
+@released
+*/
+EXPORT_C void CApaRegistrationResourceFileWriter::SetLaunchInBackgroundL(TBool aLaunchInBackground)
+	{
+	iLaunchInBackground=aLaunchInBackground;
+	}
+
+/** 
+Sets the name of the application group.
+
+@param aGroupName The name of the application group.
+
+@publishedPartner
+@released
+*/
+EXPORT_C void CApaRegistrationResourceFileWriter::SetGroupNameL(const TDesC& aGroupName)
+	{
+	HBufC* const groupName=aGroupName.AllocL();
+	delete iGroupName;
+	iGroupName=groupName;
+	}
+
+/** 
+Sets the default screen number. This can be used to specify the preferred screen on devices
+that support more than one screen.
+
+@param aDefaultScreenNumber The name of the default screen.
+
+@publishedPartner
+@released
+*/
+EXPORT_C void CApaRegistrationResourceFileWriter::SetDefaultScreenNumberL(TInt aDefaultScreenNumber)
+	{
+	iDefaultScreenNumber=aDefaultScreenNumber;
+	}
+
+/** 
+Sets the opaque data. The opaque data is some data that is specific to the type of application.
+
+@publishedPartner
+@released
+*/
+EXPORT_C void CApaRegistrationResourceFileWriter::SetOpaqueDataL(const TDesC8& aOpaqueData)
+	{
+	HBufC8* const opaqueData=aOpaqueData.AllocL();
+	delete iOpaqueData;
+	iOpaqueData=opaqueData;
+	}
+
+/** 
+Adds a datatype to the list of datatypes that the application can handle.
+
+@param aPriority The priority.
+@param aType The datatype.
+
+@publishedPartner
+@released
+*/
+EXPORT_C void CApaRegistrationResourceFileWriter::AddDataTypeL(TInt aPriority, const TDesC8& aType)
+	{
+	SDataType dataType;
+	dataType.iPriority=aPriority;
+	dataType.iType=aType.AllocLC();
+	iDataTypeList.AppendL(dataType);
+	CleanupStack::Pop(dataType.iType);
+	}
+
+/** 
+Adds a file to the list of files owned by the CApaRegistrationResourceFileWriter instances. These files
+are deleted if an error occurs whil registering the new applications.
+
+@param aFileName The name of the file.
+
+@publishedPartner
+@released
+*/
+EXPORT_C void CApaRegistrationResourceFileWriter::AddFileOwnershipInfoL(const TDesC& aFileName)
+	{
+	SFileOwnershipInfo fileOwnershipInfo;
+	fileOwnershipInfo.iFileName=aFileName.AllocLC();
+	iFileOwnershipList.AppendL(fileOwnershipInfo);
+	CleanupStack::Pop(fileOwnershipInfo.iFileName);
+	}
+
+CApaRegistrationResourceFileWriter::CApaRegistrationResourceFileWriter(TUid aAppUid, TUint aAttributes)
+	:iAppUid(aAppUid),
+	 iAppFile(NULL),
+	 iAttributes(aAttributes),
+	 iLocalisableResourceFile(NULL),
+	 iAppIsHidden(0),
+	 iEmbeddability(TApaAppCapability::ENotEmbeddable),
+	 iSupportsNewFile(0),
+	 iLaunchInBackground(0),
+	 iGroupName(NULL),
+	 iDefaultScreenNumber(0),
+	 iOpaqueData(NULL)
+	{
+	}
+
+void CApaRegistrationResourceFileWriter::ConstructL(const TDesC& aAppFile)
+	{
+	iAppFile=aAppFile.AllocL();
+	iLocalisableResourceFile=NULL;
+	}
+
+void CApaRegistrationResourceFileWriter::WriteDataTypeL(MDataSink& aDataSink, const SDataType& aDataType) const
+	{
+	// DATATYPE
+
+	// LONG priority
+	WriteLittleEndianUint32L(aDataSink, aDataType.iPriority);
+
+	// LTEXT8 type(KMaxDataTypeLength)
+	WriteText8L(aDataSink, *aDataType.iType);
+	}
+
+void CApaRegistrationResourceFileWriter::WriteFileOwnershipInfoL(MDataSink& aDataSink, const SFileOwnershipInfo& aFileOwnershipInfo) const
+	{
+	// FILE_OWNERSHIP_INFO
+
+	// LTEXT file_name(KMaxFileNameLength)
+	WriteTextL(aDataSink, *aFileOwnershipInfo.iFileName);
+	}
+
+void CApaRegistrationResourceFileWriter::MainResourceInCompiledFormatL(MDataSink& aDataSink) const
+	{
+	// APP_REGISTRATION_INFO
+
+	// LONG reserved_long = 0
+	WriteLittleEndianUint32L(aDataSink, 0);
+
+	// LLINK reserved_llink = 0
+	WriteLittleEndianUint32L(aDataSink, 0);
+	__ASSERT_DEBUG(iAppFile, Panic(EPanicNullPointer));
+	// LTEXT app_file(KMaxFileNameLength) = ""
+	WriteTextL(aDataSink, *iAppFile);
+
+	// LONG attributes = 0
+	WriteLittleEndianUint32L(aDataSink, iAttributes);
+
+	// LTEXT localisable_resource_file(KMaxFileNameLength) = ""
+	TPtrC localisableResourceFile(KNullDesC);
+	if (iLocalisableResourceFile!=NULL)
+		{
+		localisableResourceFile.Set(*iLocalisableResourceFile);
+		}
+	WriteTextL(aDataSink, localisableResourceFile);
+
+	// LONG localisable_resource_id = 1
+	WriteLittleEndianUint32L(aDataSink, 1);
+
+	// BYTE hidden = KAppNotHidden
+	WriteUint8L(aDataSink, iAppIsHidden);
+
+	// BYTE embeddability = KAppNotEmbeddable
+	WriteUint8L(aDataSink, iEmbeddability);
+
+	// BYTE newfile = KAppDoesNotSupportNewFile
+	WriteUint8L(aDataSink, iSupportsNewFile);
+
+	// BYTE launch = KAppLaunchInForeground
+	WriteUint8L(aDataSink, iLaunchInBackground);
+
+	// LTEXT group_name(KAppMaxGroupName) = ""
+	TPtrC groupName(KNullDesC);
+	if (iGroupName!=NULL)
+		{
+		groupName.Set(*iGroupName);
+		}
+	WriteTextL(aDataSink, groupName);
+
+	// BYTE default_screen_number = 0
+	WriteUint8L(aDataSink, iDefaultScreenNumber);
+
+	// LEN WORD STRUCT datatype_list[]
+	TInt i;
+	const TInt numberOfDataTypes=iDataTypeList.Count();
+	WriteLittleEndianUint16L(aDataSink, numberOfDataTypes);
+	for (i=0; i<numberOfDataTypes; ++i)
+		{
+		WriteDataTypeL(aDataSink, iDataTypeList[i]);
+		}
+
+	// LEN WORD STRUCT file_ownership_list[]
+	const TInt numberOfOwnershipItems=iFileOwnershipList.Count();
+	WriteLittleEndianUint16L(aDataSink, numberOfOwnershipItems);
+	for (i=0; i<numberOfOwnershipItems; ++i)
+		{
+		WriteFileOwnershipInfoL(aDataSink, iFileOwnershipList[i]);
+		}
+
+	// LEN WORD STRUCT service_list[]
+	WriteLittleEndianUint16L(aDataSink, 0);
+
+	// LLINK opaque_data = 0
+	WriteLittleEndianUint32L(aDataSink, (iOpaqueData!=NULL)? 2: 0);
+	}
+
+const TDesC8* CApaRegistrationResourceFileWriter::SecondResourceL(TBool& aSecondResourceInCompressedUnicodeFormat) const
+	{
+	aSecondResourceInCompressedUnicodeFormat=EFalse;
+	return iOpaqueData;
+	}
+
+// CApaLocalisableResourceFileWriter
+
+EXPORT_C CApaLocalisableResourceFileWriter* CApaLocalisableResourceFileWriter::NewL(const TDesC& aShortCaption, const TDesC& aCaption, TInt aNumberOfIcons, const TDesC& aGroupName)
+	{ // static
+	CApaLocalisableResourceFileWriter* const self=new(ELeave) CApaLocalisableResourceFileWriter(aNumberOfIcons);
+	CleanupStack::PushL(self);
+	self->ConstructL(aShortCaption, aCaption, aGroupName);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+EXPORT_C CApaLocalisableResourceFileWriter::~CApaLocalisableResourceFileWriter()
+	{
+	delete iShortCaption;
+	delete iCaptionAndIcon.iCaption;
+	delete iCaptionAndIcon.iIconFile;
+	delete iGroupName;
+	}
+
+void CApaLocalisableResourceFileWriter::GenerateFileContentsL(RBuf8& aBuffer) const
+/** @internalComponent */
+	{
+	DoGenerateFileContentsL(aBuffer, TUid::Null(), TUid::Null());
+	}
+
+void CApaLocalisableResourceFileWriter::SetIconFileL(const TDesC& aIconFile)
+/** @internalComponent */
+	{
+	HBufC* const iconFile=aIconFile.AllocL();
+	delete iCaptionAndIcon.iIconFile;
+	iCaptionAndIcon.iIconFile=iconFile;
+	}
+
+CApaLocalisableResourceFileWriter::CApaLocalisableResourceFileWriter(TInt aNumberOfIcons)
+	:iShortCaption(NULL),
+	 iGroupName(NULL)
+	{
+	iCaptionAndIcon.iCaption=NULL;
+	iCaptionAndIcon.iNumberOfIcons=aNumberOfIcons;
+	iCaptionAndIcon.iIconFile=NULL;
+	}
+
+void CApaLocalisableResourceFileWriter::ConstructL(const TDesC& aShortCaption, const TDesC& aCaption, const TDesC& aGroupName)
+	{
+	iShortCaption=aShortCaption.AllocL();
+	iCaptionAndIcon.iCaption=aCaption.AllocL();
+	iCaptionAndIcon.iIconFile=NULL;
+	iGroupName=aGroupName.AllocL();
+	}
+
+void CApaLocalisableResourceFileWriter::WriteCaptionAndIconInfoL(MDataSink& aDataSink, const SCaptionAndIconInfo& aCaptionAndIcon) const
+	{
+	// CAPTION_AND_ICON_INFO
+
+	// LONG reserved_long = 0
+	WriteLittleEndianUint32L(aDataSink, 0);
+
+	// LLINK reserved_llink = 0
+	WriteLittleEndianUint32L(aDataSink, 0);
+
+	// LTEXT caption(KMaxCaption) = ""
+	WriteTextL(aDataSink, *aCaptionAndIcon.iCaption);
+
+	// WORD number_of_icons = 0
+	WriteLittleEndianUint16L(aDataSink, aCaptionAndIcon.iNumberOfIcons);
+
+	// LTEXT icon_file(KMaxFileNameLength) = ""
+	TPtrC iconFile(KNullDesC);
+	if (aCaptionAndIcon.iIconFile!=NULL)
+		{
+		iconFile.Set(*aCaptionAndIcon.iIconFile);
+		}
+	WriteTextL(aDataSink, iconFile);
+	}
+
+void CApaLocalisableResourceFileWriter::MainResourceInCompiledFormatL(MDataSink& aDataSink) const
+	{
+	// LOCALISABLE_APP_INFO
+
+	// LONG reserved_long = 0
+	WriteLittleEndianUint32L(aDataSink, 0);
+
+	// LLINK reserved_llink = 0
+	WriteLittleEndianUint32L(aDataSink, 0);
+	__ASSERT_DEBUG(iShortCaption, Panic(EPanicNullPointer));
+	// LTEXT short_caption(KMaxCaption) = ""
+	WriteTextL(aDataSink, *iShortCaption);
+
+	// STRUCT caption_and_icon
+	WriteCaptionAndIconInfoL(aDataSink, iCaptionAndIcon);
+
+	// LEN WORD STRUCT view_list[]
+	WriteLittleEndianUint16L(aDataSink, 0);
+	__ASSERT_DEBUG(iGroupName, Panic(EPanicNullPointer));
+	//	LTEXT group_name(KAppMaxGroupName) = ""
+	WriteTextL(aDataSink, *iGroupName);
+	}
+
+const TDesC8* CApaLocalisableResourceFileWriter::SecondResourceL(TBool& aSecondResourceInCompressedUnicodeFormat) const
+	{
+	aSecondResourceInCompressedUnicodeFormat=EFalse;
+	return NULL;
+	}
+
+#if defined(UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER)
+
+// ForJavaMIDletInstaller
+
+EXPORT_C void ForJavaMIDletInstaller::CheckInterimFormatFileNotCorruptL(RFile& aInterimFormatFile)
+	{ // static
+	RFile temporaryDuplicateOfFile; // this is needed as CFileStore::FromLC takes ownership of the file that it's passed, and closes the RFile object passed in - we still want to use it, so we'll create this temporary duplicate RFile object (it also handily means we don't have to rewind the RFile to the start when we copy it below)
+	User::LeaveIfError(temporaryDuplicateOfFile.Duplicate(aInterimFormatFile));
+	CFileStore* const fileStore=CFileStore::FromLC(temporaryDuplicateOfFile); // CFileStore::FromLC takes *immediate* ownership of the file it's passed (i.e. before doing anything that can leave)
+	if (fileStore->Type()[1]!=KUidInterimFormatFileForJavaMIDletInstaller)
+		{
+		User::Leave(KErrCorrupt);
+		}
+	RStoreReadStream rootStream;
+	rootStream.OpenLC(*fileStore,fileStore->Root());
+	RFs unconnectedFs; // should not actually be used, so we don't need to use a real, connected RFs
+	CApaAppInfoFileReader* const appInfoFileReader=new(ELeave) CApaAppInfoFileReader(unconnectedFs);
+	CleanupStack::PushL(appInfoFileReader);
+	appInfoFileReader->CApaAppInfoFile::ConstructL();
+	appInfoFileReader->InternalizeL(rootStream); // will leave if the file is corrupt/badly formed
+	CleanupStack::PopAndDestroy(3, fileStore);
+	}
+
+EXPORT_C void ForJavaMIDletInstaller::GetJavaMIDletInfoL(RFs& aFs, const TDesC& aFileName,TUint32& aJavaMIDletInfo_AmsAuthId,TUint32& aJavaMIDletInfo_MIDlet)
+	{ // static
+	CApaAppInfoFileReader* const appInfoFileReader=CApaAppInfoFileReader::NewLC(aFs, aFileName);
+	aJavaMIDletInfo_AmsAuthId=appInfoFileReader->iJavaMIDletInfo_AmsAuthId;
+	aJavaMIDletInfo_MIDlet=appInfoFileReader->iJavaMIDletInfo_MIDlet;
+	CleanupStack::PopAndDestroy(appInfoFileReader);
+	}
+
+EXPORT_C CApaAppInfoFileWriter* ForJavaMIDletInstaller::NewInterimFormatFileWriterLC(RFs& aFs,const TDesC& aFileName,TUid aApplicationUid,TUint32 aJavaMIDletInfo_AmsAuthId,TInt aJavaMIDletInfo_MIDlet)
+	{ // static
+	CApaAppInfoFileWriter* self=new(ELeave) CApaAppInfoFileWriter(aFs);
+	CleanupStack::PushL(self);
+	self->ConstructL(aFileName,aApplicationUid,KUidInterimFormatFileForJavaMIDletInstaller,aJavaMIDletInfo_AmsAuthId,aJavaMIDletInfo_MIDlet);
+	return self;
+	}
+
+#endif // UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER
+
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER CApaAppInfoFileWriter* CApaAppInfoFileWriter::NewLC(RFs& aFs, const TDesC& aFileName,TUid aUid)
+/** Allocates and constructs an aif file writer. It leaves if the path of the 
+specified aif file does not exist.
+
+@param aFs Connected session with the file server.
+@param aFileName The full path and (language-neutral) filename of the aif file.
+@param aUid The application's third (most derived) UID. 
+@return Pointer to the newly constructed and initialised aif file writer. 
+The object is left on the cleanup stack. */
+	{
+	CApaAppInfoFileWriter* self=new(ELeave) CApaAppInfoFileWriter(aFs);
+	CleanupStack::PushL(self);
+	self->ConstructL(aFileName,aUid);
+	return self;
+	}
+
+void CApaAppInfoFileWriter::ConstructL(const TDesC& aFileName,TUid aUid
+#if defined(UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER)
+									   ,TUid aMiddleUid/*=KUidAppInfoFile*/,TUint32 aJavaMIDletInfo_AmsAuthId/*=0*/,TInt aJavaMIDletInfo_MIDlet/*=0*/
+#endif
+									   )
+	{
+	__DECLARE_NAME(_S("CApaAppInfoFileWriter"));
+	CApaAppInfoFile::ConstructL();
+	TInt ret=iFs.MkDirAll(aFileName);
+    if (ret!=KErrAlreadyExists)
+        User::LeaveIfError(ret);
+	CFileStore* store=CDirectFileStore::ReplaceL(iFs,aFileName,EFileRead|EFileWrite);
+	iStore = store;
+#if defined(UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER)
+	iJavaMIDletInfo_AmsAuthId=aJavaMIDletInfo_AmsAuthId;
+	iJavaMIDletInfo_MIDlet=aJavaMIDletInfo_MIDlet;
+#else
+	const TUid aMiddleUid=KUidAppInfoFile;
+#endif
+	store->SetTypeL(TUidType(KDirectFileStoreLayoutUid,aMiddleUid,aUid));
+	iMap=CStoreMap::NewL(*store);	// Ready for Storing components
+	}
+
+void CApaAppInfoFileWriter::ExternalizeL(RWriteStream& aStream) const
+	{
+	__ASSERT_DEBUG(iCaptionHeaderArray, Panic(EPanicNullPointer));
+	aStream<< *iCaptionHeaderArray;
+	aStream<< *iIconHeaderArray;
+	aStream<< iCapability;
+	aStream.WriteInt32L(
+#if defined(UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER)
+						EAifVersionAddsJavaMIDletInfo
+#else
+						EAifVersionAddsFileOwnershipInfo
+#endif
+						);
+	aStream<< *iDataTypeHeaderArray;
+	aStream<< *iViewDataHeaderArray;
+	aStream << *iFileOwnershipInfoHeaderArray;
+#if defined(UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER)
+	aStream.WriteUint32L(iJavaMIDletInfo_AmsAuthId);
+	aStream.WriteInt32L(iJavaMIDletInfo_MIDlet);
+#endif
+	}
+
+EXPORT_C void CApaAppInfoFileWriter::StoreL()
+	{
+	__ASSERT_DEBUG(iMap, Panic(EPanicNullPointer));
+	__ASSERT_DEBUG(iStore, Panic(EPanicNullPointer));
+	RStoreWriteStream outStream(*iMap);
+	TStreamId id=outStream.CreateLC(*iStore);
+	ExternalizeL(outStream);
+	outStream.CommitL();
+	CleanupStack::PopAndDestroy(&outStream);
+	iMap->Reset();
+	iStore->SetRootL(id);
+	iStore->CommitL();
+	}
+
+EXPORT_C void CApaAppInfoFileWriter::AddCaptionL(TLanguage aLanguage,const TDesC& aCaption)
+/** Appends a caption in the specified language to the aif file.
+
+@param aLanguage The language of the specified caption.
+@param aCaption The new caption.
+@leave KErrBadName The caption's name is longer than KApaMaxAppCaption characters. */
+
+// Write caption out to a new stream and add to iCaptionHeaderArray
+	{
+	if (aCaption.Length()>KApaMaxAppCaption)
+		User::Leave(KErrBadName);
+	TCaptionHeader captionHeader;
+	captionHeader.iLanguage=aLanguage;
+	captionHeader.iCaption=aCaption.AllocL();
+	CleanupStack::PushL(captionHeader.iCaption.AsPtr());
+	RStoreWriteStream outStream;
+	__ASSERT_DEBUG(iStore, Panic(EPanicNullPointer));
+	TStreamId id=outStream.CreateLC(*iStore);
+	outStream << *captionHeader.iCaption;
+	outStream.CommitL();
+	CleanupStack::PopAndDestroy(&outStream);
+	iMap->BindL(captionHeader.iCaption,id);
+	iCaptionHeaderArray->AppendL(captionHeader);
+	CleanupStack::Pop(captionHeader.iCaption);
+	}
+
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER void CApaAppInfoFileWriter::AddIconL(const TDesC& aIconFileName)
+/** Loads the icon's bitmap and mask from the specified mbm file 
+and writes the icon to the aif file. Takes ownership of the icon.
+
+@param aIconFileName Full path and filename of the icon file (with a .mbm 
+extension) containing the icon bitmap at identifier 0 and its mask at 1. */
+
+// Icon file must contain 2 bitmaps: icon and mask, and they are assumed to be the same size.
+	{
+	CApaMaskedBitmap* icon=CApaMaskedBitmap::NewLC();
+	User::LeaveIfError(icon->Load(aIconFileName,0));
+	User::LeaveIfError((icon->Mask())->Load(aIconFileName,1));
+	CleanupStack::Pop(icon);
+	AddIconL(*icon);
+	}
+
+EXPORT_C void CApaAppInfoFileWriter::AddIconL(CApaMaskedBitmap& aIcon)
+/** Writes the specified pre-loaded icon to the aif file, and takes ownership of it.
+
+@param aIcon The new icon. */
+
+// Guaranteed to take ownership of the aIcon
+// Will delete aIcon if it leaves
+	{
+	CleanupStack::PushL(&aIcon);
+	TIconHeader iconHeader;
+	iconHeader.iIcon = &aIcon;
+	iconHeader.iIconSideInPixels = aIcon.SizeInPixels().iWidth;
+	RStoreWriteStream outStream;
+	__ASSERT_DEBUG(iStore, Panic(EPanicNullPointer));
+	TStreamId id=outStream.CreateLC(*iStore);
+	outStream << *iconHeader.iIcon;
+	outStream.CommitL();
+	CleanupStack::PopAndDestroy(&outStream);
+	iMap->BindL(iconHeader.iIcon,id);
+	iIconHeaderArray->AppendL(iconHeader);
+	CleanupStack::Pop(&aIcon);
+	}
+
+EXPORT_C TInt CApaAppInfoFileWriter::SetCapability(const TDesC8& aInfo)
+/** Sets the application's capability information. Note that the 
+information is not written to the aif file until StoreL() is called.
+@param aInfo A TApaAppCapabilityBuf object.
+@return KErrNone always. */
+	{
+	// check that aInfo is of a permissable length
+	TApaAppCapabilityBuf buf;
+	TApaAppCapability::CopyCapability(buf,aInfo);
+	iCapability = buf();
+	return KErrNone;
+	}
+
+EXPORT_C void CApaAppInfoFileWriter::AddDataTypeL(const TDataTypeWithPriority& aTypePriority)
+	{
+	__ASSERT_DEBUG(aTypePriority.iDataType.Des8().Length()>0,Panic(EDPanicBadDataType));
+	__ASSERT_DEBUG(aTypePriority.iPriority<KDataTypePriorityUserSpecified,Panic(EDPanicBadDataType));
+	TDataTypeHeader header;
+	TDataType* dataType=new(ELeave) TDataType(aTypePriority.iDataType);
+	CleanupStack::PushL(dataType);
+	header.iDataType=dataType;
+	RStoreWriteStream outStream;
+	__ASSERT_DEBUG(iStore, Panic(EPanicNullPointer));
+	TStreamId id=outStream.CreateLC(*iStore);
+	outStream << *header.iDataType;
+	outStream.CommitL();
+	CleanupStack::PopAndDestroy(&outStream);
+	__ASSERT_DEBUG(iMap, Panic(EPanicNullPointer));
+	iMap->BindL(header.iDataType,id);
+	header.iPriority=aTypePriority.iPriority;
+	iDataTypeHeaderArray->AppendL(header);
+	CleanupStack::Pop(dataType);
+	}
+
+//
+// Adds a view with id aViewId to the data to be stored in the AIF. Icons and captions can be added to the
+// view before it is stored - view data is written to an inline store so all the information for the view must
+// be added and then the call to store the data made.
+//
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER void CApaAppInfoFileWriter::AddViewL(TUid aViewId)
+// Write view data out to a new stream and add to iViewDataHeaderArray
+	{
+	AddViewL(aViewId,0);
+	}
+
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER void CApaAppInfoFileWriter::AddViewL(TUid aViewId,TInt aScreenMode)
+	{
+	TViewDataHeader viewDataHeader;
+	CApaAIFViewData* viewData=CApaAIFViewData::NewLC();
+	viewData->SetViewUid(aViewId);
+	viewData->SetScreenMode(aScreenMode);
+	viewDataHeader.iViewData=viewData;
+	__ASSERT_DEBUG(iViewDataHeaderArray, Panic(EPanicNullPointer));
+	iViewDataHeaderArray->AppendL(viewDataHeader);
+	CleanupStack::Pop(viewData);
+	}
+
+//
+// Stores the view data in the AIF, writing the store inline.
+//
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER void CApaAppInfoFileWriter::StoreViewL(TUid aViewId)
+	{
+	__ASSERT_DEBUG(iViewDataHeaderArray, Panic(EPanicNullPointer));
+	const TInt count=iViewDataHeaderArray->Count();
+	for (TInt ii=0;ii<count;ii++)
+		{
+		const TViewDataHeader& pData=(*iViewDataHeaderArray)[ii];
+		if (pData.iViewData.AsPtr()->ViewUid() == aViewId)
+			{
+			RStoreWriteStream outStream;
+			__ASSERT_DEBUG(iStore, Panic(EPanicNullPointer));
+			TStreamId id=outStream.CreateLC(*iStore);
+			outStream << *pData.iViewData;
+			outStream.CommitL();
+			CleanupStack::PopAndDestroy(&outStream);
+			iMap->BindL(pData.iViewData,id);
+			return;
+			}
+		}
+	}
+
+//
+// Adds the icon aIcon to the view data with id aViewId which will later be stored in the AIF.
+//
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER void CApaAppInfoFileWriter::AddViewIconL(CApaMaskedBitmap& aIcon,TUid aViewId)
+	{
+	CApaAIFViewData* viewData=NULL;
+	__ASSERT_DEBUG(iViewDataHeaderArray, Panic(EPanicNullPointer));
+	const TInt count=iViewDataHeaderArray->Count();
+	for (TInt ii=0;ii<count;ii++)
+		{
+		const TViewDataHeader& pData=(*iViewDataHeaderArray)[ii];
+		if (pData.iViewData.AsPtr()->ViewUid() == aViewId)
+			{
+			viewData=pData.iViewData.AsPtr();
+			}
+		}
+	if (viewData)
+		viewData->AddIconL(aIcon);
+	}
+
+//
+// Adds the caption aCaption in langauge aLanguage to the view data with id aViewId which will later be stored in the AIF.
+//
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER void CApaAppInfoFileWriter::AddViewCaptionL(TLanguage aLanguage,const TDesC& aCaption,TUid aViewId)
+	{
+	CApaAIFViewData* viewData=NULL;
+	const TInt count=iViewDataHeaderArray->Count();
+	for (TInt ii=0;ii<count;ii++)
+		{
+		const TViewDataHeader& pData=(*iViewDataHeaderArray)[ii];
+		if (pData.iViewData.AsPtr()->ViewUid() == aViewId)
+			{
+			viewData=pData.iViewData.AsPtr();
+			}
+		}
+	if (viewData)
+		viewData->AddCaptionL(aLanguage,aCaption);
+	}
+
+//
+// Adds the name aOwnedFileName to the list of files described as being owned by this application to later be stored in the AIF.
+//
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER void CApaAppInfoFileWriter::AddOwnedFileL(const TDesC& aOwnedFileName)
+	{
+	if (aOwnedFileName.Length()>KMaxFileName)
+		User::Leave(KErrBadName);
+	TFileOwnershipInfoHeader fileOwnershipInfoHeader;
+	fileOwnershipInfoHeader.iOwnedFileName=aOwnedFileName.AllocL();
+	CleanupStack::PushL(fileOwnershipInfoHeader.iOwnedFileName.AsPtr());
+	RStoreWriteStream outStream;
+	__ASSERT_DEBUG(iStore, Panic(EPanicNullPointer));
+	TStreamId id=outStream.CreateLC(*iStore);
+	outStream << *fileOwnershipInfoHeader.iOwnedFileName;
+	outStream.CommitL();
+	CleanupStack::PopAndDestroy(&outStream);
+	__ASSERT_DEBUG(iMap, Panic(EPanicNullPointer));
+	iMap->BindL(fileOwnershipInfoHeader.iOwnedFileName,id);
+	__ASSERT_DEBUG(iFileOwnershipInfoHeaderArray, Panic(EPanicNullPointer));
+	iFileOwnershipInfoHeaderArray->AppendL(fileOwnershipInfoHeader);
+	CleanupStack::Pop(fileOwnershipInfoHeader.iOwnedFileName);
+	}
+
+CApaAppCaptionFileReader::CApaAppCaptionFileReader(RFs& aFs,const TDesC& aAppFileName)
+: iFs(aFs)
+	{
+	__ASSERT_DEBUG((aAppFileName.Length()+KApparcExtraLengthOfCaptionFileName<KMaxFileName),Panic(EFilenameTooLong));
+	TParse appFileNameParse;
+	appFileNameParse.Set(aAppFileName,NULL,NULL);
+	iCaptionFileName=appFileNameParse.DriveAndPath(); //extract path name 
+	iCaptionFileName.Append(appFileNameParse.Name()); //add app name without extension
+	iCaptionFileName.Append(KApaCaptionFileSuffix); //add suffix
+	iCaptionFileName.Append(KAppResourceFileExtension); //add extension
+	BaflUtils::NearestLanguageFile(aFs,iCaptionFileName);
+	}
+
+void CApaAppCaptionFileReader::GetCaptionsL(TApaAppCaption& aCaption,TApaAppCaption& aShortCaption)
+//reads the caption and shortcaption of the current language from the appropriate caption file
+	{	
+	CResourceFile* file = CResourceFile::NewL(iFs, iCaptionFileName, 0, 0);
+	CleanupStack::PushL(file);
+	RResourceReader reader;
+	reader.OpenL(file, 1);
+	CleanupClosePushL(reader);
+	aCaption = reader.ReadTPtrCL();
+	aShortCaption = reader.ReadTPtrCL();
+	CleanupStack::PopAndDestroy(&reader);
+	CleanupStack::PopAndDestroy(file);
+
+	if ((!aShortCaption.Length())&&(aCaption.Length()))
+		aShortCaption=aCaption;
+	else if ((!aCaption.Length())&&(aShortCaption.Length()))
+		aCaption=aShortCaption;	
+	}
+
+//
+// Sets the drive of aAifName to the current locale drive.
+// Assumes that aAifName is already a valid full filename.
+//
+EXPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER void AppInfoFileUtils::GetAifFileName(const RFs& aFs,TDes& aAifName)
+	{ // static
+	TFileName aifName(aAifName);
+	BaflUtils::NearestLanguageFile(aFs,aifName);
+	aAifName=aifName;
+	}
+
+//
+// Sets aAifName to the full path of the relevant .AIF file.
+// Note that this may be on a different drive to the .APP file if the system drive has been
+// set to point to a new locale that has been downloaded.
+//
+void AppInfoFileUtils::GetAifFileNameL(const RFs& aFs,const TDesC& aFullName,TDes& aAifName)
+	{ // static
+	TParse parse;
+	User::LeaveIfError(parse.Set(KAppInfoFileExtension,&aFullName,NULL));
+	aAifName=parse.FullName();
+	AppInfoFileUtils::GetAifFileName(aFs,aAifName);
+	}
+	
+#endif // UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apgrfx/APGPRIV.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,140 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "APGPRIV.H"
+#include <e32hal.h>
+#include <s32strm.h>
+#include "APGCLI.H"
+#include "APGICNFL.H"
+#include "APGSTD.H"
+
+#define KDefaultIconSizeInPixels TSize(96,96)
+
+CApaIconPicture* CApaIconPicture::NewL(const TSize& aIconSizeInTwips, const TUid aAppUid)
+	{
+	CApaIconPicture* self=new(ELeave) CApaIconPicture(aIconSizeInTwips, aAppUid);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	self->CreateIconL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+CApaIconPicture::CApaIconPicture(const TSize& aIconSizeInTwips, const TUid aAppUid)
+	: iAppUid(aAppUid),
+	iOriginalSizeInTwips(aIconSizeInTwips),
+	iScaleFactorWidth(1000),
+	iScaleFactorHeight(1000)
+	{
+	__DECLARE_NAME(_S("CApaIconPicture"));
+	}
+
+void CApaIconPicture::ConstructL()
+	{
+	TMachineInfoV1Buf machineInfoBuf;
+	User::LeaveIfError( UserHal::MachineInfo(machineInfoBuf) );
+	TMachineInfoV1& machineInfo=machineInfoBuf();
+	iDisplaySizeInTwips = machineInfo.iPhysicalScreenSize;
+	iDisplaySizeInPixels = machineInfo.iDisplaySizeInPixels;
+	//
+	}
+
+CApaIconPicture::~CApaIconPicture()
+	{
+	delete iIcon;
+	}
+
+
+void CApaIconPicture::CreateIconL()
+	{
+	// calculate the size of icon required in pixels
+	TSize sizeInPixels;
+	sizeInPixels.iWidth = (iOriginalSizeInTwips.iWidth*iDisplaySizeInPixels.iWidth*ScaleFactorWidth())/(iDisplaySizeInTwips.iWidth*1000);
+	sizeInPixels.iHeight = (iOriginalSizeInTwips.iHeight*iDisplaySizeInPixels.iHeight*ScaleFactorHeight())/(iDisplaySizeInTwips.iHeight*1000);
+	// if the required icon is not square get a large one and gdi will squash it during drawing
+	CApaMaskedBitmap* newIcon = CApaMaskedBitmap::NewLC();
+	RApaLsSession ls;
+	CleanupClosePushL(ls);
+	User::LeaveIfError(ls.Connect());
+	User::LeaveIfError(ls.GetAppIcon(iAppUid, sizeInPixels, *newIcon));
+	delete iIcon;
+	iIcon = newIcon;
+	CleanupStack::PopAndDestroy(&ls);
+	CleanupStack::Pop(newIcon);
+	//
+	// set physical size
+	TSize iconSizeInTwips;
+	iconSizeInTwips.iWidth = (iOriginalSizeInTwips.iWidth*ScaleFactorWidth())/1000;
+	iconSizeInTwips.iHeight = (iOriginalSizeInTwips.iHeight*ScaleFactorHeight())/1000;
+	iIcon->SetSizeInTwips(iconSizeInTwips);
+	}
+
+void CApaIconPicture::Draw(CGraphicsContext& aGc,const TPoint& aTopLeft,const TRect& aClipRect,
+						   MGraphicsDeviceMap* aMap) const
+	{
+	__ASSERT_DEBUG(iIcon,Panic(EDPanicNoIconInPicture));
+	//
+	TSize sizeInPixels(0,0);
+	sizeInPixels.iWidth = aMap->HorizontalTwipsToPixels(iOriginalSizeInTwips.iWidth);
+	sizeInPixels.iHeight = aMap->VerticalTwipsToPixels(iOriginalSizeInTwips.iHeight);
+	sizeInPixels.iWidth = (ScaleFactorWidth()*sizeInPixels.iWidth)/1000;
+	sizeInPixels.iHeight = (ScaleFactorHeight()*sizeInPixels.iHeight)/1000;
+	//
+	TRect originalRectInPixels(aTopLeft,sizeInPixels);
+	aGc.SetClippingRect(aClipRect);
+	aGc.DrawBitmap(originalRectInPixels,iIcon);
+	aGc.CancelClippingRect();
+	}
+
+	
+void CApaIconPicture::InternalizeL(RReadStream& /*aStream*/)
+	{} //lint !e1762 Suppress member function could be made const
+
+
+	
+void CApaIconPicture::ExternalizeL(RWriteStream& /*aStream*/)const
+	{}
+
+
+void CApaIconPicture::GetOriginalSizeInTwips(TSize& aOriginalSize) const
+	{
+	aOriginalSize = iOriginalSizeInTwips;
+	}
+
+
+void CApaIconPicture::SetScaleFactor(TInt aScaleFactorWidth,TInt aScaleFactorHeight)
+	{
+	iScaleFactorWidth = aScaleFactorWidth;
+	iScaleFactorHeight = aScaleFactorHeight;
+	TRAP_IGNORE(CreateIconL()); // ignore any error, just keep using the current icon instead
+	}
+
+
+TInt CApaIconPicture::ScaleFactorWidth() const
+	{
+	return iScaleFactorWidth;
+	}
+
+
+TInt CApaIconPicture::ScaleFactorHeight() const
+	{
+	return iScaleFactorHeight;
+	}
+
+
+TPictureCapability CApaIconPicture::Capability() const
+	{
+	return TPictureCapability(TPictureCapability::ENotScaleable,EFalse); // scalable, not cropable
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apgrfx/APGPRIV.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,87 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __APAPRIV_H__
+#define __APAPRIV_H__
+
+#if !defined(__E32STD_H__)
+#include <e32std.h>
+#endif
+#if !defined(__S32MEM_H__)
+#include <s32mem.h>
+#endif
+#if !defined(__GDI_H__)
+#include <gdi.h>
+#endif
+#include <apaid.h>
+
+// classes referenced:
+class CApaMaskedBitmap;
+//
+
+class HBufBuf : public TBufBuf
+	{
+public:
+	static HBufBuf* NewL(CBufBase& aBuf,TInt aPos,TInt aMode=ERead|EWrite);
+private:
+	void DoRelease();
+	};
+
+
+class CApaIconPicture : public CPicture
+	{
+public:
+	static CApaIconPicture* NewL(const TSize& aIconSizeInTwips, const TUid aAppUid);
+	//
+	void Draw(CGraphicsContext& aGc,const TPoint& aTopLeft,const TRect& aClipRect,MGraphicsDeviceMap* aMap)const;
+	TPictureCapability Capability() const;
+	TInt ScaleFactorWidth() const;
+	TInt ScaleFactorHeight() const;
+	void SetScaleFactor(TInt aScaleFactorWidth,TInt aScaleFactorHeight);
+	void GetOriginalSizeInTwips(TSize& aOriginalSize) const;
+	//
+	void InternalizeL(RReadStream& aStream);
+	void ExternalizeL(RWriteStream& aStream)const;
+	~CApaIconPicture();
+private: 
+	CApaIconPicture(const TSize& aIconSizeInTwips, const TUid aAppUid);
+	void ConstructL();
+	void CreateIconL();
+private:
+	CApaMaskedBitmap* iIcon; // null unless the current format is EIcon
+	TUid iAppUid;
+	TSize iOriginalSizeInTwips;
+	TInt iScaleFactorWidth;		   // Stored as percent * 10
+	TInt iScaleFactorHeight;	   // Stored as percent * 10
+	TSize iDisplaySizeInPixels;
+	TSize iDisplaySizeInTwips;
+	};
+
+class CApaAppServiceInfoArrayWrapper : public CApaAppServiceInfoArray
+	{
+public:
+	static CApaAppServiceInfoArrayWrapper* NewL(CArrayFix<TApaAppServiceInfo>* aServiceInfoArray);
+	~CApaAppServiceInfoArrayWrapper();
+	TArray<TApaAppServiceInfo> Array();
+private:
+	CApaAppServiceInfoArrayWrapper(CArrayFix<TApaAppServiceInfo>* aServiceInfoArray);
+private:
+	CArrayFix<TApaAppServiceInfo>* iServiceInfoArray;
+	};
+
+
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apgrfx/APGRFX.MMP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+//
+// APGRFX.MMP for component APGRFX
+//
+
+/**
+@file
+
+@SYMPurpose apgrfx.dll Apparc server client APIs + wserv wrapper utilities
+*/
+
+target          apgrfx.dll
+CAPABILITY All -Tcb
+targettype      DLL
+UID		0x1000008D 0x10003A3C
+VENDORID 0x70000001
+
+option MSVC /Od
+
+SOURCEPATH	../apgrfx
+
+userinclude		../inc
+systeminclude   /epoc32/include
+
+source          APGCTL.CPP APGDOOR.CPP APGICNFL.CPP APGSTD.CPP APGTASK.CPP
+source		APGWGNAM.CPP APGCLI.CPP APGPRIV.CPP
+source		apgnotif.cpp APGAIR.CPP APGAIRV2.CPP APSCLI.CPP apgconstdata.cpp
+SOURCE		apsecutils.cpp
+
+#if defined SYMBIAN_APPARC_APPINFO_CACHE
+source          	APGAPLSTV2.CPP
+#else
+source          	APGAPLST.CPP
+#endif
+
+library         euser.lib apparc.lib apmime.lib gdi.lib estor.lib efsrv.lib fbscli.lib
+library         bitgdi.lib ws32.lib bafl.lib
+library         apserv.lib apfile.lib
+
+#ifdef USE_IH_RAISE_EVENT
+LIBRARY			instrumentationhandler.lib
+#endif // USE_IH_RAISE_EVENT
+
+#ifdef SYMBIAN_BAFL_SYSUTIL
+library sysutil.lib
+#endif
+
+macro			SYMBIAN_SUPPORT_UI_FRAMEWORKS_V1
+
+#define UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER
+macro UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER
+
+#if defined(UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER)
+	#if defined(SYMBIAN_APPARC_APPINFO_CACHE)
+	deffile		APGRFX_UI_FRAMEWORKS.DEF
+	#else
+	deffile		APGRFX_9_REMOVE_UI_FRAMEWORKS_V1_EXCEPT_REMNANT_FOR_JAVA_MIDLET_INSTALLER.DEF
+	#endif
+#else
+deffile			APGRFX_9_REMOVE_UI_FRAMEWORKS_V1.DEF
+#endif
+
+START WINS
+	baseaddress	0x42F00000
+END
+
+START MARM
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apgrfx/APGSTD.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,26 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "APGSTD.H"
+
+
+GLDEF_C void Panic(TApgPanic aPanic)
+//
+// Panic the process with APPARC as the category.
+//
+	{
+	_LIT(KApGrfxPanic,"APGRFX");
+	User::Panic(KApGrfxPanic,aPanic);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apgrfx/APGSTD.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,92 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+#if !defined(__APGSTD_H__)
+#define __APGSTD_H__
+
+#if !defined(__E32STD_H__)
+#include <e32std.h>
+#endif
+
+
+enum TApgPanic
+	{
+	EPanicDefaultIcnFileDoesNotExist,
+	EIllegalCallToGlassDoorSize,
+	EPanicGetAppsNotInitialized,
+	EPanicNullWindowGroupName,
+	EPanicMethodNotSupported,
+	EPanicIconAlreadyExists,
+	EPanicDocAlreadyExists,
+	EPanicInvalidParameter,
+	EPanicNoDocumentOnConstruction,
+	EPanicNoDocOrStoreWhenStoring,
+	EPanicIndexOutOfRange,
+	EPanicNoDocumentOnStore,
+	EPanicNoAppDataSupplied,
+	EPanicNoStoreOnRestore,
+	EPanicNoStoreOnDetach,
+	EPanicNoStoreOnAppUid,
+	EPanicNoPictureInDoor,
+	EPanicNoGlassPicture,
+	EPanicNoStreamDic,
+	EPanicNoCaption,
+	//
+	EDPanicNoCaptionInControl,
+	EDPanicNoHostForStore,
+	EDPanicNoPictureOnDrawing,
+	EDPanicNoStoreOnGlassing,
+	EDPanicNoStoreOnIconify,
+	EDPanicNoIconInPicture,
+	EDPanicWrongCommand,
+	EDPanicNoProcess,
+	EDPanicBadList,
+	EDPanicArrayNotEmpty,
+	EDPanicBadDataType,
+	EDPanicBadIconSize,
+	EDPanicInvalidObserver,
+	EDPanicInvalidDataTypeArray,
+	EDPanicInvalidViewArray,
+	EDPanicInvalidFileOwnershipArray,
+	EDPanicInvalidHandle,
+	EPanicCaptionAlreadyExists,
+	EPanicShortCaptionAlreadyExists,
+	EFilenameTooLong,
+	EPanicNoAppName,
+	EPanicInconsistentResourceSizeInBytes,
+	EPanicBadUnicodeCompression1,
+	EPanicBadUnicodeCompression2,
+	EPanicWrongResourceFormat1,
+	EPanicWrongResourceFormat2,
+	EPanicBadCompressedUnicodeRun,
+	EPanicBadRunLengthParameter,
+	EPanicNullPointer,
+	EPanicIconFileWithoutLocalisableResourceFile,
+	EPanicUnexpectedUid,
+	EPanicBadRunLength,
+	EPanicUpdatedAppsListNotEmpty, // Unused
+	EPanicNullDefaultAppIconFileName,
+	EDPanicNoPicture,
+	EDPanicNoApplication,
+	EDPanicInvalidIconIndexArray,
+	EDPanicHandleAlreadySet
+	};
+
+
+GLREF_C void Panic(TApgPanic aPanic);
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apgrfx/APGTASK.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,514 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "APGTASK.H"
+#include "APGWGNAM.H"
+#include <w32std.h>
+
+//
+// class TApatask
+//
+
+
+	
+EXPORT_C TApaTask::TApaTask(RWsSession& aWsSession)
+	: iWsSession(aWsSession), iWgId(0)
+/** Constructs an empty task object, taking a reference to a window server session.
+
+An object of this type is constructed by an instance of the TApaTaskList class.
+
+The object represents a task when it is assigned a task's window group ID.
+
+@param aWsSession The window server session.
+@see TApaTaskList */
+	{
+	}
+
+EXPORT_C void TApaTask::SetWgId(TInt aWgId)
+/** Sets this task's window group ID.
+
+@param aWgId The ID to be assigned. */
+	{
+	iWgId=aWgId;
+	}
+
+EXPORT_C TInt TApaTask::WgId() const
+/** Gets the ID of this task's window group.
+
+@return The window group ID. For an empty task object, this is zero. */
+	{
+	return iWgId;
+	}
+
+EXPORT_C TBool TApaTask::Exists() const
+/** Tests whether this TApaTask object is empty. This object represents the
+state of the task at the time at which it was constructed and is not subsequently
+updated. Therefore, this does not indicate that the task itself exists and should not 
+be used to test whether or not a particular task is running or not.
+
+@return True, if the task is not empty; false, otherwise.
+@see TApaTaskList::FindDoc()
+@see TApaTaskList::FindApp()
+@see TApaTaskList::FindByPos() */
+	{
+	return(iWgId>0);
+	}
+
+EXPORT_C TThreadId TApaTask::ThreadId() const
+/** Gets the ID of this task's thread
+
+@return The thread ID. */
+	{
+	TThreadId threadId;
+	if (iWsSession.GetWindowGroupClientThreadId(iWgId,threadId)==KErrNotFound)
+		{
+		threadId=TThreadId(KNullThreadId);
+		}
+	return(threadId);
+	}
+
+EXPORT_C void TApaTask::BringToForeground()
+/** Brings this task to the foreground.
+
+If the task uses the View architecture, then the task's top view is activated. */
+	{
+	iWsSession.SetWindowGroupOrdinalPosition(iWgId,0);
+	SendSystemEvent(EApaSystemEventBroughtToForeground);
+	}
+
+EXPORT_C void TApaTask::SendToBackground()
+/** Sends this task to the background.
+
+The task whose window group is at the next ordinal position is brought up 
+to the foreground. In addition, the new foreground task's top view is activated, 
+if it uses the View architecture. */
+	{
+	iWsSession.SetWindowGroupOrdinalPosition(iWgId,-1);
+	}
+
+EXPORT_C void TApaTask::EndTask()
+/** Requests normal closing of this task. 
+
+@capability PowerMgmt is required to close system tasks. */
+	{
+	RProcess client;
+	if (client.HasCapability(ECapabilityPowerMgmt))
+		{
+		SendSystemEvent(EApaSystemEventSecureShutdown, EEventPowerMgmt);
+		}
+	
+	// Always send the old shutdown message for backward compatibility. Will not shut down system tasks.
+	SendSystemEvent(EApaSystemEventShutdown); 
+	}
+	
+EXPORT_C void TApaTask::KillTask()
+/** Kills this task. 
+@capability PowerMgmt
+*/
+	{
+	RThread thread;
+	TInt err=thread.Open(ThreadId());
+	if (!err)
+		{
+		RProcess process;
+		thread.Process(process);
+		process.Terminate(0);
+		process.Close();
+		thread.Close();
+		}
+	} //lint !e1762 Suppress Member function 'TApaTask::KillTask(void)' could be made const
+
+
+EXPORT_C TInt TApaTask::SwitchOpenFile(const TDesC& aFilename)
+/** Requests the task to close its existing document, and to open an existing document.
+
+An application (task) may handle the request by overriding CEikAppUi::OpenFileL() if required.
+
+@param aFilename The name of the document to be opened.
+@return KErrNone, if the request was successfully sent to the task; otherwise one of the other
+system-wide error codes. */
+	{
+	TInt err=CheckSwitchFile();
+	if (!err)
+#if defined(_UNICODE)
+		{
+		TPtrC8 messageBuffer((TUint8*) aFilename.Ptr(),aFilename.Length()<<1);
+		err=SendMessage(KUidApaMessageSwitchOpenFile,messageBuffer);
+		}
+#else
+		err=SendMessage(KUidApaMessageSwitchOpenFile,aFilename);
+#endif
+	return err;
+	}
+
+EXPORT_C TInt TApaTask::SwitchCreateFile(const TDesC& aFilename)
+/** Requests the task to close its existing document, and to create and open a new 
+document.
+
+An application (task) may handle the request by overriding CEikAppUi::CreateFileL() if required.
+
+@param aFilename The name of the new document.
+@return KErrNone, if the request was successfully sent to the task; otherwise one of the other
+system-wide error codes. */
+	{
+	TInt err=CheckSwitchFile();
+	if (!err)
+#if defined(_UNICODE)
+		{
+		TPtrC8 messageBuffer((TUint8*) aFilename.Ptr(),aFilename.Length()<<1);
+		err=SendMessage(KUidApaMessageSwitchCreateFile,messageBuffer);
+		}
+#else
+		err=SendMessage(KUidApaMessageSwitchCreateFile,aFilename);
+#endif
+	return err;
+	}
+
+TInt TApaTask::CheckSwitchFile() const
+	//
+	// private - checks whether the task will respond to a switch files event
+	//
+	{
+	HBufC* buf=HBufC::NewMax(CApaWindowGroupName::EMaxLength);
+	if (!buf)
+		return KErrNoMemory;
+	TInt err=KErrNone;
+	TPtr des=buf->Des();
+	err=iWsSession.GetWindowGroupNameFromIdentifier(iWgId, des);
+	if (!err)
+		{
+		CApaWindowGroupName* wgName=CApaWindowGroupName::New(iWsSession, buf); // takes ownership (if it succeeds)
+		if (!wgName)
+			{
+			delete buf;
+			return KErrNoMemory;
+			}
+		if (wgName->IsBusy())
+			err=KErrNotReady;
+		if (!(wgName->RespondsToSwitchFilesEvent()))
+			err=KErrNotSupported;
+		delete wgName;
+		}
+	else
+		delete buf;
+	return err;   
+	}
+
+EXPORT_C TInt TApaTask::SendMessage(TUid aUid,const TDesC8& aParams)
+/** Sends a message to this task's window group.
+
+The message is handled by the UI framework, specifically by CEikAppUI::ProcessMessageL(). 
+
+
+@param aUid The UID identifying the message. By default, the UI framework 
+recognizes only two messages, KUidApaMessageSwitchOpenFileValue and KUidApaMessageSwitchCreateFileValue.
+@param aParams The message. The format and meaning of the message depends on 
+the specific type as identified by the UID.
+@return KErrNone, if successful; otherwise, one of the other system-wide error 
+codes.
+@see CEikAppUi::ProcessMessageL()
+@see TEventCode
+@see TWsEvent
+@see RWindowGroup::FetchMessage() */
+	{
+	return iWsSession.SendMessageToWindowGroup(iWgId,aUid,aParams);
+	}
+
+EXPORT_C void TApaTask::SendKey(TInt aKeyCode,TInt aModifiers)
+/** Sends a key event encapsulating the specified character code and specified modifier 
+keys state to the task's window group.
+
+Key events are handled by the UI framework, specifically by CCoeAppui::HandleWsEventL().
+
+@capability SwEvent
+@param aKeyCode The character code.
+@param aModifiers State of the modifier keys. 
+@see CCoeAppUi::HandleWsEventL() */
+	{
+	TKeyEvent key;
+	key.iCode=aKeyCode;
+	key.iModifiers=aModifiers;
+	key.iRepeats=0;
+	SendKey(key);
+	}
+
+EXPORT_C void TApaTask::SendKey(const TKeyEvent& aKey)
+/** Sends the specified key event to the task's window group.
+
+Key events are handled by the UI framework, specifically by CCoeAppui::HandleWsEventL().
+
+@capability SwEvent
+@param aKey The key event.
+@see CCoeAppUi::HandleWsEventL()
+@see TKeyEvent */
+	{
+	TWsEvent event;
+	event.SetType(EEventKey);
+	*event.Key()=aKey;
+	event.SetTimeNow();
+	iWsSession.SendEventToWindowGroup(iWgId,event);
+	}
+
+EXPORT_C void TApaTask::SendSystemEvent(TApaSystemEvent aEvent)
+/** Sends a system event to this task's window group.
+
+Events are handled by the UI framework, specifically by CEikAppUi::HandleSystemEventL().
+
+@capability SwEvent
+@param aEvent The event type.
+@see CEikAppUi
+@see CCoeAppUi::HandleSystemEventL()
+@see TApaSystemEvent */
+	{
+	SendSystemEvent(aEvent, EEventUser); 
+	}
+
+void TApaTask::SendSystemEvent(TApaSystemEvent aEvent, TEventCode aType)
+/** 
+@internalTechnology
+*/
+	{
+	TWsEvent event;
+	event.SetType(aType);
+	*(TApaSystemEvent*)(event.EventData())=aEvent;
+	event.SetTimeNow();
+	iWsSession.SendEventToWindowGroup(iWgId,event);
+	}
+
+//
+// class TApaTaskList
+//
+
+
+	
+EXPORT_C TApaTaskList::TApaTaskList(RWsSession& aWsSession)
+	: iWsSession(aWsSession)
+/** Constructs the task list object, taking a reference to a window server session.
+
+@param aWsSession The window server session. */
+	{
+	}
+
+EXPORT_C TApaTask TApaTaskList::FindApp(const TDesC& aAppName)
+/** Searches for a task that has the specified caption.
+
+The result of the search depends on the number of tasks that have the specified 
+caption.
+
+If there is only one task, then that task is returned.
+
+If there is more than one task, then the task returned depends on whether 
+the first one found is in the foreground:
+
+if the first task found is in the foreground, then the task returned by this 
+function is the one with the highest window group ordinal value, i.e. the 
+task which is furthest from the foreground.
+
+if the first task found is not in the foreground, then that is the task that 
+is returned.
+
+If no matching task is found, then the object returned is an empty task, and 
+calling TApaTask::Exists() on it returns false.
+
+@param aAppName The caption.
+@return A task having the specified caption, or an empty task. */
+	{
+	TApaTask task(iWsSession);
+	TInt wgId=0;
+	TInt matchId=0;
+	TInt fgWgId=FindByPos(0).WgId();
+	CApaWindowGroupName::FindByCaption(aAppName, iWsSession, wgId);
+	if (wgId==fgWgId)
+		{
+		while (wgId>=0)
+			{
+			matchId=wgId;
+			CApaWindowGroupName::FindByCaption(aAppName, iWsSession, wgId);
+			}
+		}
+	else 
+		matchId=wgId;
+	task.SetWgId(matchId);
+	return(task);
+	}
+
+EXPORT_C TApaTask TApaTaskList::FindDoc(const TDesC& aDocName)
+/** Searches for the task that is handling the specified document.
+
+@param aDocName The name of the document.
+@return The task that is handling the specified document. If no such task exists, 
+then this is an empty task, i.e. a subsequent call to TApaTask::Exists() returns 
+false. */
+	{
+	TInt wgId=0;
+	CApaWindowGroupName::FindByDocName(aDocName, iWsSession, wgId);
+	TApaTask task(iWsSession);
+	task.SetWgId(wgId);
+	return(task);
+	}
+
+EXPORT_C TApaTask TApaTaskList::FindByPos(TInt aPos)
+/** Searches for a task by the ordinal position of its window group.
+
+@param aPos The ordinal position of a task's window group. A zero value refers 
+to the foreground task.
+@return The task at the specified position. If there is no task at the specified 
+position, or the specified position is invalid, then the object returned is 
+an empty task, and calling TApaTask::Exists() on it returns false. */
+	{
+	TApaTask task(iWsSession);
+	TRAP_IGNORE(FindByPosL(task,aPos));
+	return(task);
+	}
+
+void TApaTaskList::FindByPosL(TApaTask& aTask,TInt aPos)
+	{
+	TInt wgId=0;
+	const TInt count=iWsSession.NumWindowGroups(0);
+	if (count)
+		{
+		CArrayFixFlat<TInt>* wgIdArray=new(ELeave) CArrayFixFlat<TInt>(count);
+		CleanupStack::PushL(wgIdArray);
+		CApaWindowGroupName* wgName=CApaWindowGroupName::NewL(iWsSession);
+		CleanupStack::PushL(wgName);
+		User::LeaveIfError(iWsSession.WindowGroupList(0,wgIdArray)); // priority 0 == mostly normal apps but some may be hidden window groups
+
+		for (TInt ii=0; ii<wgIdArray->Count(); ii++) // must ask for count each time as this may change
+			{ 
+			wgId=(*wgIdArray)[ii];
+			wgName->ConstructFromWgIdL(wgId);
+			if(wgName->Hidden())
+				{
+				wgIdArray->Delete(ii--); // array element removed so now need to do this index again
+				}
+			}
+		
+		if (aPos>=count || aPos<0)
+			aPos=count-1;
+
+		if(aPos<wgIdArray->Count())
+			wgId=(*wgIdArray)[aPos];
+
+		CleanupStack::PopAndDestroy(2);	// wgIdArray, wgName
+		}
+	aTask.SetWgId(wgId);
+	}
+
+
+EXPORT_C TApaTask TApaTaskList::FindApp(TUid aAppUid)
+/** Searches for a task running the specified application.
+
+The result of the search depends on the number of tasks that are running the 
+specified application.
+
+If there is only one task, then that task is returned.
+
+If there is more than one task, then the task returned depends on whether 
+the first one found is in the foreground:
+
+if the first task found is in the foreground, then the task returned by this 
+function is the one with the highest window group ordinal value, i.e. the 
+task which is furthest from the foreground.
+
+if the first task found is not in the foreground, then that is the task that 
+is returned.
+
+If no matching task is found, then the object returned is an empty task, and 
+calling TApaTask::Exists() on it returns false.
+
+@param aAppUid The application specific UID.
+@return A task having the specified caption, or an empty task. */
+	{
+	TApaTask task(iWsSession);
+	TInt wgId=0;
+	TInt matchId=0;
+	TInt fgWgId=FindByPos(0).WgId();
+	CApaWindowGroupName::FindByAppUid(aAppUid,iWsSession,wgId);
+	if (wgId==fgWgId)
+		{
+		while (wgId>=0)
+			{
+			matchId=wgId;
+			CApaWindowGroupName::FindByAppUid(aAppUid,iWsSession,wgId);
+			}
+		}
+	else 
+		matchId=wgId;
+	task.SetWgId(matchId);
+	return task;
+	}
+
+EXPORT_C TInt TApaTaskList::CycleTasks(TUid aAppUid,TCycleDirection aDirection)
+/** Brings the next task in the set of tasks running the specified application to 
+the foreground.
+
+If there is only one task, then no change occurs.
+
+If the foremost task in the set is not the foreground task, then this is made 
+the foreground task.
+
+Thereafter, successive calls to this function bring the next task in the set 
+to the foreground. The direction of the cycling can be specified and has the 
+following effect:
+
+for the forwards direction, the foreground task is sent to the background; 
+the next foremost task is made the foreground task.
+
+for the backwards direction, the task with the highest window group ordinal 
+value, i.e. the task in the set which is furthest from the foreground, is 
+brought to the foreground. The task that was the foremost task in the set 
+is moved back by one position.
+
+If the task brought to the foreground uses the View architecture, then the 
+its top view is activated.
+
+@param aAppUid The application specific UID. 
+@param aDirection The direction of cycling.
+@return KErrNone, if successful; KErrNotFound, if there are no tasks running 
+the specified application. */
+	{
+	TInt sendToBgWgId=KErrNotFound;
+	TInt wgId=0;
+	TInt fgWgId=FindByPos(0).WgId();
+	CApaWindowGroupName::FindByAppUid(aAppUid,iWsSession,wgId);
+	TInt matchId=wgId;
+	if (wgId==fgWgId)											// If first match is at foreground
+		{
+		if (aDirection==EBackwards)
+			{
+			while (wgId>=0)										// Go for last match
+				{
+				matchId=wgId;
+				CApaWindowGroupName::FindByAppUid(aAppUid,iWsSession,wgId);
+				}
+			}
+		else
+			{
+			CApaWindowGroupName::FindByAppUid(aAppUid,iWsSession,wgId);
+			if (wgId<0)											// If no other match
+				return KErrNone;
+			sendToBgWgId=matchId;
+			matchId=wgId;										// Go for second match
+			}
+		}
+	if (matchId>=0)
+		{
+		iWsSession.SetWindowGroupOrdinalPosition(matchId,0);
+		if (sendToBgWgId>=0)
+			iWsSession.SetWindowGroupOrdinalPosition(sendToBgWgId,-1);	// Send it to background
+		return KErrNone;
+		}
+	return KErrNotFound;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apgrfx/APGWGNAM.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,674 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "APGWGNAM.H"
+#include "APGSTD.H"
+#include "APGTASK.H"
+
+const TInt KUidBufLength=8;
+const TInt KMinWindowGroupNameLength=5/*delimiters+status)*/+KUidBufLength;
+const TInt KMaxWindowGroupNameLength=KMinWindowGroupNameLength+2*KMaxFileName;
+const TInt KMaxSearchStringLength=KMaxFileName+6/* 3*delim+3*wild */;
+typedef TBuf<KMaxSearchStringLength> TApaSearchString;
+
+_LIT(KDefaultWindowGroupName,"00\x00\x30\x30\x30\x30\x30\x30\x30\x30\x0\x0");
+_LIT(KSearchAnyFile,"*");
+_LIT(KFormatStatus,"%02x");
+
+EXPORT_C CApaWindowGroupName::~CApaWindowGroupName()
+/** Destructor.
+
+Frees resources owned by the object prior to its destruction. */
+	{	   
+	delete iBuf;
+	}
+
+EXPORT_C CApaWindowGroupName* CApaWindowGroupName::New(const RWsSession& aWsSession, HBufC* aWgName)
+	//
+	// non leaving static initializer from full name - takes ownership
+	// ONLY TO BE USED WITH A VALID (i.e existing) WINDOW GROUP NAME
+	//
+/** Creates a window group name object and takes ownership of the heap descriptor 
+containing a name.
+
+The name must have valid format. Typically, this is an existing window group 
+name.
+
+Note that the function cannot leave.
+
+@param aWsSession A window server session.
+@param aWgName A heap descriptor containing a valid window group name. This 
+pointer must not be null, otherwise the function raises an APGRFX 3 panic.
+@return A pointer to the new window group name object. */
+	{
+	CApaWindowGroupName* This=NULL;
+	if (aWgName)
+		{
+		This=new CApaWindowGroupName(aWsSession);
+		if (This)
+			{
+			This->iBuf=aWgName;
+			This->GetStatusFromName();
+			}
+		}
+	else
+		Panic(EPanicNullWindowGroupName);
+	return This;
+	}
+
+EXPORT_C CApaWindowGroupName* CApaWindowGroupName::NewL(const RWsSession& aWsSession)
+	//
+	// static initializer for blank window group name
+	//
+/** Creates a window group name object and assigns a default name to it.
+
+@param aWsSession A window server session.
+@return A pointer to the new window group name object. */
+	{
+	CApaWindowGroupName* This=NewLC(aWsSession);
+	CleanupStack::Pop();
+	return This;
+	}
+
+EXPORT_C CApaWindowGroupName* CApaWindowGroupName::NewL(const RWsSession& aWsSession, TInt aWgId)
+	//
+	// static initializer for existing window group name given by aWgId
+	//
+/** Creates a window group name object and assigns to it the name taken from the 
+specified window group.
+
+@param aWsSession A window server session.
+@param aWgId The ID of a window group.
+@return A pointer to the new window group name object. */
+	{
+	CApaWindowGroupName* This=NewLC(aWsSession, aWgId);
+	CleanupStack::Pop();
+	return This;
+	}
+
+EXPORT_C CApaWindowGroupName* CApaWindowGroupName::NewL(const RWsSession& aWsSession, const TDesC& aWgName)
+	//
+	// static initializer from full name
+	// ONLY TO BE USED WITH A VALID (i.e existing) WINDOW GROUP NAME
+	//
+/** Creates a window group name object and assigns to it the specified name.
+
+The name must have a valid format. Typically, this is an existing window group 
+name.
+
+@param aWsSession A window server session.
+@param aWgName A valid window group name.
+@return A pointer to the new window group name object. */
+	{
+	CApaWindowGroupName* This=NewLC(aWsSession, aWgName);
+	CleanupStack::Pop();
+	return This;
+	}
+
+EXPORT_C CApaWindowGroupName* CApaWindowGroupName::NewLC(const RWsSession& aWsSession)
+	//
+	// static initializer for blank window group name
+	//
+/** Creates a window group name object, assigns a default name to it, and puts 
+a pointer to the new object onto the cleanup stack.
+
+@param aWsSession A window server session. 
+@return A pointer to the new window group name object. */
+	{
+	CApaWindowGroupName* This=new(ELeave) CApaWindowGroupName(aWsSession);
+	CleanupStack::PushL(This);
+	This->DefaultConstructL();
+	return This;
+	}
+
+EXPORT_C CApaWindowGroupName* CApaWindowGroupName::NewLC(const RWsSession& aWsSession, TInt aWgId)
+	//
+	// static initializer for existing window group name given by aWgId
+	//
+/** Creates a window group name object, assigns to it the name taken from the specified 
+window group, and puts a pointer to the new object onto the cleanup stack.
+
+@param aWsSession A window server session.
+@param aWgId The ID of a window group.
+@return A pointer to the new window group name object. */
+	{
+	CApaWindowGroupName* This=new(ELeave) CApaWindowGroupName(aWsSession);
+	CleanupStack::PushL(This);
+	This->ConstructFromWgIdL(aWgId);
+	return This;
+	}
+
+EXPORT_C CApaWindowGroupName* CApaWindowGroupName::NewLC(const RWsSession& aWsSession, const TDesC& aWgName)
+	//
+	// static initializer from full name
+	// ONLY TO BE USED WITH A VALID (i.e existing) WINDOW GROUP NAME
+	//
+/** Creates a window group name object, assigns to it the specified name, and puts 
+a pointer to the new object onto the cleanup stack.
+
+The name must have valid format. Typically, this is an existing window group 
+name.
+
+@param aWsSession A window server session.
+@param aWgName A valid window group name.
+@return A pointer to the new window group name object. */
+	{
+	CApaWindowGroupName* This=new(ELeave) CApaWindowGroupName(aWsSession);
+	CleanupStack::PushL(This);
+	This->iBuf=aWgName.AllocL();
+	This->GetStatusFromName();
+	return This;
+	}
+
+CApaWindowGroupName::CApaWindowGroupName(const RWsSession& aWsSession) 
+	: iWsSession(aWsSession)
+	//
+	// private c'tor 
+	//
+	{
+	}
+
+
+void CApaWindowGroupName::DefaultConstructL()
+	{
+	iStatus=0;
+	iBuf = KDefaultWindowGroupName().AllocL();
+	}	
+
+EXPORT_C void CApaWindowGroupName::ConstructFromWgIdL(TInt aWgId)
+	//
+	// Allocate and format iBuf according to existing name given by aWgId
+	//
+/** Assigns to this object the name taken from the specified window group.
+
+Any previously existing name contained by this window group name object is 
+lost.
+
+If the specified window group does not exist or it has no name, then a default 
+name is assigned.
+
+@param aWgId The ID of a window group. */
+	{
+	delete iBuf;
+	iBuf=NULL;
+	if (aWgId>0)
+		{
+		TBuf<KMaxWindowGroupNameLength> name;
+		((RWsSession&)iWsSession).GetWindowGroupNameFromIdentifier(aWgId, name);
+		if (name.Length()==0) // name not set
+			DefaultConstructL();
+		else
+			{
+			iBuf=name.AllocL();
+			GetStatusFromName();
+			}
+		}
+	else
+		DefaultConstructL();
+	}
+
+EXPORT_C void CApaWindowGroupName::SetWindowGroupNameL(const TDesC& aWgName)
+/** Sets the full window group name in this object.
+
+@param aWgName The full window group name. */
+	{
+	delete iBuf;
+	iBuf=NULL;
+	iBuf=aWgName.AllocL();
+	GetStatusFromName();
+	}
+
+EXPORT_C void CApaWindowGroupName::SetWindowGroupName(HBufC* aWgName)
+/** Sets the full window group name in this object, taking ownership of the specified 
+heap descriptor.
+
+The function cannot leave.
+
+@param aWgName A heap descriptor containing the full window group name. The 
+pointer must not be null, otherwise the function raises a APGRFX 3 panic. */
+	{
+	if (aWgName)
+		{
+		if (iBuf != aWgName)
+			{
+			delete iBuf;
+			iBuf=aWgName;
+			}
+		GetStatusFromName();
+		}
+	else
+		Panic(EPanicNullWindowGroupName);
+	}
+
+EXPORT_C void CApaWindowGroupName::FindByAppUid(TUid aAppUid, RWsSession& aWsSession, TInt& aPrevWgId)
+/** Searches for the next window group by application UID.
+
+A running application, also known as a task, is associated with a window group. 
+The function searches for the next task running the specified application, 
+and returns its associated window group ID.
+
+@param aAppUid The application specific UID.
+@param aWsSession A window server session.
+@param aPrevWgId On entry, the previous window group ID. On return, the next 
+window group ID. On first call to this function pass a zero value. When there 
+are no more matching window groups, contains KErrNotFound. */
+	{
+	TBuf<20> match(KSearchAnyFile);	// status
+	match.Append(0);
+	TBuf<8> uidBuf;
+	//Type casting the Uid (which is TInt) to TUint to perform proper conversion
+	//when aAppUid.iUid is negative.
+	uidBuf.Num(TUint(aAppUid.iUid), EHex);
+	match.Append(uidBuf);  // uid
+	match.Append(0);
+	match.Append('*');	// caption
+	match.Append(0);	
+	match.Append('*');	// docname
+	aPrevWgId=aWsSession.FindWindowGroupIdentifier(aPrevWgId, match, 0);
+	}
+
+EXPORT_C void CApaWindowGroupName::FindByCaption(const TDesC& aCaption, RWsSession& aWsSession, TInt& aPrevWgId)
+/** Searches for the next window group by caption.
+
+A running application, also known as a task, is associated with a window group. 
+The function searches for the next task having the specified caption, and 
+returns its associated window group ID.
+
+@param aCaption The caption.
+@param aWsSession A window server session.
+@param aPrevWgId On entry, the previous window group ID. On return, the next 
+window group ID. On first call to this function pass a zero value. When there 
+are no more matching window groups, contains KErrNotFound. */
+	{
+	TApaSearchString match(KSearchAnyFile); // status
+	match.Append(0);
+	match.Append('*'); // uid
+	match.Append(0);
+	match.Append(aCaption);	 // caption
+	match.Append(0);
+	match.Append('*'); //doc name
+	aPrevWgId=aWsSession.FindWindowGroupIdentifier(aPrevWgId, match, 0);
+	}
+
+EXPORT_C void CApaWindowGroupName::FindByDocName(const TDesC& aDocName, RWsSession& aWsSession, TInt& aPrevWgId)
+/** Searches for the next window group by document name.
+
+A running application, also known as a task, is associated with a window group. 
+The function searches for the next task handling the specified document, and 
+returns its associated window group ID.
+
+@param aDocName The name of the document.
+@param aWsSession A window server session.
+@param aPrevWgId On entry, the previous window group ID. On return, the next 
+window group ID. On first call to this function pass a zero value. When there 
+are no more matching window groups, contains KErrNotFound. */
+	{
+	TApaSearchString match(KSearchAnyFile); // status
+	match.Append(0);
+	match.Append('*'); // uid
+	match.Append(0);
+	match.Append('*'); // caption
+	match.Append(0);
+	match.Append(aDocName);
+	aPrevWgId=aWsSession.FindWindowGroupIdentifier(aPrevWgId, match, 0);
+	}
+
+EXPORT_C void CApaWindowGroupName::SetBusy(TBool aBusy)
+/** Sets the task's busy status in this object.
+
+@param aBusy ETrue, marks the task as busy; EFalse, marks the task as not 
+busy.
+@see CEikonEnv::SetBusy() */
+	{
+	iStatus&=(~EBusy);
+	if (aBusy)
+		iStatus|=EBusy;
+	WriteStatusToName();
+	}
+
+EXPORT_C TBool CApaWindowGroupName::IsBusy() const
+/** Tests whether the task is marked as busy.
+
+@return True, if the task is marked as busy; false, otherwise.
+@see CEikonEnv::IsBusy() */
+	{
+	return iStatus&EBusy;
+	}
+
+EXPORT_C void CApaWindowGroupName::SetSystem(TBool aSystem)
+/** Sets the task's system status in this object.
+
+@param aSystem ETrue, marks the task as a system task; EFalse, marks the task 
+as not a system task.
+@see CEikonEnv::SetSystem() */
+	{
+	iStatus&=(~ESystem);
+	if (aSystem)
+		iStatus|=ESystem;
+	WriteStatusToName();
+	}
+
+EXPORT_C TBool CApaWindowGroupName::IsSystem() const
+/** Tests whether the task is marked as a system task.
+
+@return True, if the task is marked as a system task; false, otherwise. 
+@see CEikonEnv::IsSystem() */
+	{
+	return iStatus&ESystem;
+	}
+
+EXPORT_C void CApaWindowGroupName::SetDocNameIsAFile(TBool aDocNameIsAFile)
+/** Sets the document name status in this object.
+
+@param aDocNameIsAFile ETrue, the document name is a filename; EFalse, the 
+document name is not a filename.
+@see CEikonEnv::SetDocNameIsAFile() */
+	{
+	iStatus&=(~EDocNameNotAFile);
+	if (!aDocNameIsAFile)
+		iStatus|=EDocNameNotAFile;
+	WriteStatusToName();
+	}
+
+EXPORT_C TBool CApaWindowGroupName::DocNameIsAFile() const
+/** Tests whether the document name is a file.
+
+@return True, if the document name is a file; false, otherwise.
+@see CEikonEnv::DocNameIsAFile() */
+	{
+	return !(iStatus&EDocNameNotAFile);
+	}
+
+EXPORT_C void CApaWindowGroupName::SetRespondsToShutdownEvent(TBool aRespondsToShutdownEvent)
+/** Sets the task's shutdown handling status in this object.
+
+@param aRespondsToShutdownEvent ETrue, if the task can deal with a shutdown 
+request; EFalse, if the task cannot deal with a shutdown request.
+@see CEikonEnv::SetRespondsToShutdownEvent() */
+	{
+	iStatus&=(~EDoesNotRespondToShutdownEvent);
+	if (!aRespondsToShutdownEvent)
+		iStatus|=EDoesNotRespondToShutdownEvent;
+	WriteStatusToName();
+	}
+
+EXPORT_C TBool CApaWindowGroupName::RespondsToShutdownEvent() const
+/** Tests whether the task can deal with a request to shutdown.
+
+@return True, if the task can deal with a request to shutdown; false, otherwise. 
+
+@see CEikonEnv::RespondsToShutdownEvent() */
+	{
+	return !(iStatus&EDoesNotRespondToShutdownEvent);
+	}
+
+EXPORT_C void CApaWindowGroupName::SetRespondsToSwitchFilesEvent(TBool aRespondsToSwitchFilesEvent)
+/** Sets the task's switch file handling status in this object.
+
+@param aRespondsToSwitchFilesEvent ETrue, if the task can deal with a request 
+to switch file; EFalse, if the task cannot deal with with a request to switch 
+files.
+@see CEikonEnv::SetRespondsToSwitchFilesEvent() */
+	{
+	iStatus&=(~EDoesNotRespondToSwitchFilesEvent);
+	if (!aRespondsToSwitchFilesEvent)
+		iStatus|=EDoesNotRespondToSwitchFilesEvent;
+	WriteStatusToName();
+	}
+
+EXPORT_C TBool CApaWindowGroupName::RespondsToSwitchFilesEvent() const
+/** Tests whether the task can deal with a request to switch files.
+
+@return True, if the task can deal with a request to switch files; false otherwise.
+@see CEikonEnv::RespondsToSwitchFilesEvent() */
+	{
+	return !(iStatus&EDoesNotRespondToSwitchFilesEvent);
+	}
+
+EXPORT_C void CApaWindowGroupName::SetHidden(TBool aIsHidden)
+/** Marks the task as hidden.
+
+In general, tasks marked as hidden do not appear in tasklists. 
+Specifically, TApaTask::FindByPos() will ignore any tasks marked as hidden.
+
+@param aIsHidden ETrue if the task is to be marked as hidden; EFalse if not. */
+	{
+	iStatus&=(~EIsHidden);
+	if (aIsHidden)
+		iStatus|=EIsHidden;
+	WriteStatusToName();
+	}
+
+EXPORT_C TBool CApaWindowGroupName::Hidden() const
+/** Tests whether the task is marked as hidden.
+
+@return True if the task is hidden; false otherwise. */
+	{
+	return (iStatus&EIsHidden);
+	}
+
+EXPORT_C void CApaWindowGroupName::SetAppReady(TBool aIsReady)
+/** Sets the task as ready.
+
+@param aIsReady ETrue if the task is to be marked as ready; EFalse if not. */
+	{
+	iStatus&=(~EAppReady);
+	if (aIsReady)
+		iStatus|=EAppReady;
+	WriteStatusToName();
+	}
+
+EXPORT_C TBool CApaWindowGroupName::IsAppReady() const
+/** Tests whether the task is marked as ready.
+
+@return True if the task is ready; false otherwise. */
+	{
+	return (iStatus&EAppReady);
+	}
+
+EXPORT_C void CApaWindowGroupName::SetAppUid(TUid aAppUid)
+/** Sets the specified UID into the window group name in this object.
+
+@param aAppUid The application specific UID. */
+	{
+	TInt start=FindDelimiter(EEndStatus);
+	if (start>0)
+		{
+		start++;
+		TInt end=FindDelimiter(EEndUid);
+		if (end>0)
+			{
+			TBuf<KUidBufLength> uidBuf;
+		 	//Type casting the Uid (which is TInt) to TUint to perform proper conversion
+			//when aAppUid.iUid is negative.
+			uidBuf.Num(TUint(aAppUid.iUid), EHex);
+			TPtr des=iBuf->Des();
+			des.Replace(start, end-start, uidBuf);
+			}
+		}
+	}
+
+
+EXPORT_C TUid CApaWindowGroupName::AppUid() const
+/** Gets the UID of the task's application.
+
+@return The application specific UID. If the format of the window group name 
+is not recognized, then this is zero. */
+	{
+	TUid uid=TUid::Null();
+	TInt start=FindDelimiter(EEndStatus);
+	if (start>0)
+		{
+		start++;
+		TInt end=FindDelimiter(EEndUid);
+		if ((end-start) == KUidBufLength)
+			{
+			TBuf<KUidBufLength> uidBuf=iBuf->Mid(start, end-start);
+			TLex lex(uidBuf);
+			TUint32 val = 0;
+			lex.Val(val, EHex); //Ignoring error code since we anyways have to return null uid if this returns an error.
+			uid.iUid = val;
+			}
+		}
+	return uid;
+	}
+
+EXPORT_C void CApaWindowGroupName::SetCaptionL(const TDesC& aCaption)
+/** Sets the specified caption into the window group name in this object.
+
+@param aCaption The caption. */
+	{	 
+	TInt start=FindDelimiter(EEndUid);
+	if (start>0)
+		{
+		start++;
+		TInt end=FindDelimiter(EEndCaption);
+		if (end>0)
+			{
+			TInt length=end-start;
+			ReAllocIfNecessaryL(aCaption.Length()-length);
+			TPtr des=iBuf->Des();
+			des.Replace(start, length, aCaption);
+			}
+		}
+	}
+
+EXPORT_C TPtrC CApaWindowGroupName::Caption() const
+/** Gets the task's caption.
+
+@return A non-modifiable pointer descriptor representing the caption. If the 
+format of the window group name is not recognized, then this is a zero length 
+descriptor. */
+	{
+	TInt start=FindDelimiter(EEndUid);
+	if (start>0)
+		{
+		start++;
+		TInt end=FindDelimiter(EEndCaption);
+		if (end>0)
+			return iBuf->Mid(start, end-start);
+		}
+	return TPtrC(); // error
+	}
+
+EXPORT_C void CApaWindowGroupName::SetDocNameL(const TDesC& aDocName)
+/** Sets the specified document name into the window group name in this object.
+
+@param aDocName The document name. */
+	{
+	TInt start=FindDelimiter(EEndCaption);
+	if (start>0)
+		{
+		start++;
+		TInt end=iBuf->Length();
+		if (end>0)
+			{
+			TInt length=end-start;
+			ReAllocIfNecessaryL(aDocName.Length()-length);
+			TPtr des=iBuf->Des();
+			des.Replace(start, length, aDocName);
+			}
+		}
+	}
+
+EXPORT_C TPtrC CApaWindowGroupName::DocName() const
+/** Gets the name of the document that the task is handling.
+
+@return A non-modifiable pointer descriptor representing the document name. 
+If the format of the window group name is not recognized, then this is a zero 
+length descriptor. */
+	{
+	TInt start=FindDelimiter(EEndCaption);
+	if (start>0)
+		{
+		start++;
+		TInt end=iBuf->Length();
+		if (end>0)
+			return iBuf->Mid(start, end-start);
+		}
+	return TPtrC(); // error
+	}
+
+EXPORT_C TInt CApaWindowGroupName::SetWindowGroupName(RWindowGroup& aGroupWin) const
+	//
+	// Set aGroupWin's name to the current name in iBuf (returns WServ error code)
+	//
+/** Sets the window group name contained by this object into the specified window 
+group.
+
+@param aGroupWin The window group.
+@return KErrNone, if successful; otherwise, one of the other system-wide error 
+codes. */
+	{
+	return aGroupWin.SetName(*iBuf);
+	}
+
+EXPORT_C TPtrC CApaWindowGroupName::WindowGroupName() const
+/** Gets the full window group name.
+
+@return A non-modifiable pointer descriptor representing the full window group 
+name. */
+	{
+	return *iBuf;
+	}
+
+void CApaWindowGroupName::WriteStatusToName()
+	//
+	// replaces two digit hex number at front of iBuf by iStatus 
+	//
+	{
+	TBuf<2> status;
+	status.Format(KFormatStatus, iStatus);
+	TPtr des=iBuf->Des();
+	des.Replace(0,2,status);
+	}
+
+void CApaWindowGroupName::GetStatusFromName()
+	//
+	// Extracts the two digit hex number at front of iBuf into iStatus 
+	//
+	{
+	TBuf<2> status=iBuf->Left(2);
+	TLex lex(status);
+	lex.Val(iStatus, EHex);
+	}
+
+TInt CApaWindowGroupName::FindDelimiter(TApaDelimiter aDelim) const
+	//
+	// returns the pos of aDelim or KErrNotFound
+	//
+	{
+	TInt pos=-1;
+	TInt length=iBuf->Length();
+	for (TInt i=0; i<aDelim; i++)
+		{
+		TInt nextPos=(iBuf->Right(length-pos-1)).Locate(0);
+		if (nextPos<0)
+			return KErrNotFound;
+		pos=pos+nextPos+1;
+		}
+	return pos;
+	}
+
+void CApaWindowGroupName::ReAllocIfNecessaryL(TInt aExtraLengthReqd)
+	//
+	// Reallocates iBuf if currentLength+extraLength<totalLength
+	//
+	{
+	TInt existing=iBuf->Length();
+	TInt total=existing+aExtraLengthReqd;
+	if (total>iBuf->Des().MaxLength())
+		iBuf=iBuf->ReAllocL(total);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apgrfx/APSCLI.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,101 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Client access to the AppArc server
+// 
+//
+
+#include <e32base.h>
+#include <e32svr.h>
+#include <e32math.h>
+#include <apasvst.h>
+#include <apsserv.h>
+#include <e32uid.h>
+
+_LIT(KNameApaImage,"APSEXE");
+const TUid KServerUid3  = { 0x10003A3F };
+const TInt KApaServThreadMaxHeapSize = 0x100000; // 1Mb
+const TInt KApaServThreadStackSize = 0x3000; // Apparc server need extra stack as it has a lot of filenames and parse objects on stack from time to time
+
+EXPORT_C TInt StartupApaServer(MApaAppStarter& aAppStarter)
+/**
+Start the server in a thread, using the supplied app starter.
+
+@internalTechnology
+*/
+	{
+	RThread server;
+	TInt r=server.Create(NameApaServServerThread(),ApaServThreadStart,KApaServThreadStackSize,KMinHeapSize,KApaServThreadMaxHeapSize,&aAppStarter,EOwnerThread);
+	if (r!=KErrNone)
+		return r;
+	TRequestStatus stat;
+	server.Rendezvous(stat);
+	if (stat!=KRequestPending)
+		server.Kill(0);		// abort startup
+	else
+		server.Resume();	// logon OK - start the server
+	User::WaitForRequest(stat);		// wait for start or death
+	server.Close();
+	return stat.Int();
+	}
+
+EXPORT_C TInt StartupApaServerProcess()
+/**
+StartupApaServerProcess
+Start the server in a process, (or thread in EKA1 WINS). Simultaneous launching
+of two such processes should be detected when the second one attempts to
+create the server object, failing with KErrAlreadyExists.
+
+@publishedPartner 
+*/
+	{
+	const TUidType uidType(KNullUid, KNullUid, KServerUid3);
+	TInt r=KErrNone;
+	
+#ifdef APA_SERVER_IN_THREAD
+	// In WINS the server is a DLL, the exported entrypoint returns a TInt
+	// which represents the real entry-point for the server thread
+	RLibrary lib;
+	r=lib.Load(KNameApaImage,uidType);
+	if (r!=KErrNone)
+		return r;
+	TLibraryFunction ordinal1=lib.Lookup(1);
+	TThreadFunction serverFunc=reinterpret_cast<TThreadFunction>(ordinal1());
+	// To deal with the unique thread (+semaphore!) naming in EPOC, and that we may
+	// be trying to restart a server that has just exited we attempt to create a
+	// unique thread name for the server.
+	// This uses Math::Random() to generate a 32-bit random number for the name
+	TName name(NameApaServServerThread());
+	name.AppendNum(Math::Random(),EHex);
+	RThread server;
+	r=server.Create(name, serverFunc, KApaServThreadStackSize, NULL, &lib, NULL, KMinHeapSize,KApaServThreadMaxHeapSize, EOwnerProcess);
+	lib.Close();
+#else
+	// On ARM or any EKA2 target, the server is an EXE.
+	// Create a process from it.
+	RProcess server;
+	r=server.Create(KNameApaImage,KNullDesC,uidType);
+#endif
+	
+	if (r!=KErrNone)
+		return r;
+	TRequestStatus stat;
+	server.Rendezvous(stat);
+	if (stat!=KRequestPending)
+		server.Kill(0);		// abort startup
+	else
+		server.Resume();	// logon OK - start the server
+	User::WaitForRequest(stat);		// wait for start or death
+	server.Close();
+	return stat.Int();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apgrfx/apgconstdata.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,32 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <e32def.h>
+
+/*
+ * patchable const data values
+ * 
+ * To patch these values, add a line to an iby or oby file that is included in the rom being built using the following format:
+ *
+ * "patchdata <dll> @ <symbol> <newvalue>"
+ *
+ * e.g. to enable on-demand recognizer loading, use the following line:
+ * "patchdata apserv.dll @ KApaLoadDataRecognizersOnDemand 1"
+ */
+
+/* The default value here is zero. A more appropriate value should 
+   be set in the SystemGUI via the patchable constant.
+*/
+EXPORT_C extern const TInt KMinApplicationStackSize = 0;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apgrfx/apgnotif.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,92 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "apgnotif.h"
+#include "APGSTD.H"
+
+EXPORT_C CApaAppListNotifier::~CApaAppListNotifier()
+/** The destructor calls Cancel() and closes the session with the server. 
+
+@see CActive::Cancel() */
+	{
+	Cancel();
+	iLsSession.Close();
+	}
+
+
+EXPORT_C CApaAppListNotifier* CApaAppListNotifier::NewL(MApaAppListServObserver* aObserver, TPriority aPriority)
+/** Allocates and constructs an application list change notifier. 
+
+It creates a session with the application architecture server (RApaLsSession), 
+issues the notification request to the server and adds itself to the active scheduler.
+
+@param aObserver Observer whose HandleAppListEvent() function is called when an 
+application is added or deleted.
+@param aPriority The active object priority.
+@return The application list change notifier. */
+	{
+	__ASSERT_DEBUG(aObserver!=NULL,Panic(EDPanicInvalidObserver));
+	CApaAppListNotifier* self=new(ELeave) CApaAppListNotifier(*aObserver, aPriority);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(); // self
+	return self;
+	}
+
+CApaAppListNotifier::CApaAppListNotifier(MApaAppListServObserver& aObserver, TPriority aPriority)
+	:CActive(aPriority),
+	iObserver(aObserver)
+	{	
+	}
+
+void CApaAppListNotifier::ConstructL()
+	{
+	User::LeaveIfError(iLsSession.Connect());
+	iLsSession.SetNotify(EFalse, iStatus);
+	CActiveScheduler::Add(this);
+	SetActive();
+	}
+
+void CApaAppListNotifier::DoCancel()
+	{
+	iLsSession.CancelNotify();
+	}
+
+void CApaAppListNotifier::RunL()
+	{
+	TInt status=iStatus.Int();
+	User::LeaveIfError(status);
+	iLsSession.SetNotify(EFalse, iStatus); // requeue before handling in case the handling changes things
+	SetActive();
+	iObserver.HandleAppListEvent(status);
+	}
+
+//
+// MApaAppListServObserver
+//
+/** Constructor for MApaAppListServObserver */
+EXPORT_C MApaAppListServObserver::MApaAppListServObserver()
+	{
+	}
+
+/** Reserved for future use */	
+EXPORT_C void MApaAppListServObserver::MApaAppListServObserver_Reserved1()
+	{
+	}
+
+/** Reserved for future use */	
+EXPORT_C void MApaAppListServObserver::MApaAppListServObserver_Reserved2()
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apgrfx/apprivate.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,30 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// AP_PRIVATE.H
+// 
+//
+
+
+#if !defined(__AP_PRIVATE_H__)
+#define __AP_PRIVATE_H__
+
+#include <e32std.h>
+
+const TUint KUidPrefixedNonNativeRegistrationResourceFile=0x1027289d;
+
+_LIT(KLitPathForNonNativeResourceAndIconFiles, "\\private\\10003a3f\\import\\apps\\NonNative\\Resource\\");
+_LIT(KLitFormatForRegistrationResourceFile, "%08x_reg.rsc");
+_LIT(KLitFormatForLocalisableResourceFile, "%08x_loc.rsc");
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apgrfx/apsecutils.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,60 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Security issues related methods used across apparc
+// 
+//
+
+#include <e32std.h>
+#include <e32cmn.h> //for TSecureId
+#include "apsecutils.h"
+
+
+/**
+ * Check if application has a WriteDeviceData capability
+ * and if it's SID is in the protected range
+ * 
+ * @param aAppFilename path to application exe file
+ * @param aHasWriteDeviceDataCap returns ETrue if app has WriteDeviceData cap
+ * @param aIsSidProtected returns ETrue if application SID is in the protected range
+ * @return KErrNone if succesful, error code otherwise
+ */
+EXPORT_C TInt CApaSecurityUtils::CheckAppSecurity( const TPtrC& aAppFilename, 
+                                              TBool& aHasWriteDeviceDataCap, 
+                                              TBool& aIsSidProtected )
+    { 
+    aHasWriteDeviceDataCap = EFalse;
+    aIsSidProtected = EFalse;
+    
+    RLibrary::TInfoBuf infoBuf;
+    TInt ret = RLibrary::GetInfo( aAppFilename, infoBuf );
+    if ( KErrNone == ret )
+        {
+        if ( infoBuf().iSecurityInfo.iCaps.HasCapability(
+                                                ECapabilityWriteDeviceData ) )
+            {
+            aHasWriteDeviceDataCap = ETrue;
+            }
+
+        const TSecureId appSid = infoBuf().iSecurityInfo.iSecureId;
+
+        if( IsSidProtected( TUint32( appSid ) ) )
+            {
+            aIsSidProtected = ETrue;
+            }
+
+        }
+    return ret;
+    }
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apgrfx/apsecutils.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,37 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __APSECUTILS_H__
+#define __APSECUTILS_H__
+
+/** AppArc security utils.
+
+This is a set of security related methods for apparc internal usage.
+
+@internalComponent 
+*/
+class CApaSecurityUtils
+    {
+public:
+    IMPORT_C static TInt CheckAppSecurity( const TPtrC& aAppFilename, 
+                                           TBool& aHasWriteDeviceDataCap, 
+                                           TBool& aIsSidProtected );
+private:
+    inline static TBool IsSidProtected( const TUint32 aSid );
+    };
+    
+#include "apsecutils.inl"
+    
+#endif // __APSECUTILS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apgrfx/apsecutils.inl	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,31 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __APSECUTILS_INL__
+#define __APSECUTILS_INL__
+
+/** 
+ * Determines whether an EXE SID is within the protected range\d
+ * 
+ * @param aSid The SID to check
+ * @return ETrue if it is protected
+ */
+inline TBool CApaSecurityUtils::IsSidProtected( const TUint32 aSid )
+     {
+     // If bit 31 is set then Sid is unprotected
+     return (aSid & 0x80000000) ? EFalse : ETrue;
+     }
+
+#endif // __APSECUTILS_INL__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apparc/APACMDLN.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,815 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <apacmdln.h>
+#include "APASTD.H" // Panics etc.
+#include <s32mem.h>
+
+#include <e32svr.h>
+
+_LIT(KLitTokenServerDifferentiator, "-srvDfr=");
+_LIT(KLitTokenDefaultScreenNumber, "-dsc=");
+_LIT(KLitTokenParentWindowGroupID, "-prntwgid=");
+_LIT(KLitTokenDebugMemFail, "-debugMemFail:");
+_LIT(KLitTokenAppStartupInstrumentationEventIdBase, "-appStartupInstrEvIdBase=");
+_LIT(KLitTokenOpaqueData, "-opaque=");
+
+// CApaCommandLine
+
+CApaCommandLine::CApaCommandLine() : 
+	iDocumentName( NULL), iExecutableName(NULL), iOpaqueData(NULL),
+	iTailEnd(NULL), iCommand(EApaCommandRun),
+	iServerDifferentiator(0), iDefaultScreenNumber(-1),
+	iParentWindowGroupID(0), iDebugMemFail(0), iAppStartupInstrumentationEventIdBase(0),
+	iFile(), iParentProcessId(KNullProcessId)
+	//
+	// private c'tor - initialize using NewLC()
+	//
+	{
+	}
+
+EXPORT_C CApaCommandLine::~CApaCommandLine()
+/** Destructor.
+
+Frees resources owned by the object prior to deletion. */
+	{
+	delete iDocumentName;
+	delete iExecutableName;
+	delete iOpaqueData;
+	delete iTailEnd;
+	iFile.Close();
+	}
+
+EXPORT_C CApaCommandLine* CApaCommandLine::NewL()
+/** Creates an empty command line object.
+
+@return A pointer to the new command line object. */
+	{
+	CApaCommandLine* This=CApaCommandLine::NewLC();
+	CleanupStack::Pop();
+	return This;
+	}
+
+EXPORT_C void CApaCommandLine::ConstructCmdLineFromMessageL(const RMessage2& aMessage)
+/** Acts as a second constructor and completes a commandline object from 
+	the aMessage object.
+
+@internalTechnology */
+	{
+	const TInt bufLen = aMessage.GetDesLengthL(EIpcSlotMain);
+	HBufC8* const buffer=HBufC8::NewLC(bufLen);
+	{TPtr8 buffer_asWritable(buffer->Des());
+	aMessage.ReadL(EIpcSlotMain, buffer_asWritable);}
+	RDesReadStream stream;
+	stream.Open(*buffer);
+	InternalizeL(stream);
+	CleanupStack::PopAndDestroy(buffer);
+
+	iFile.AdoptFromClient(aMessage, EIpcSlotFsSession, EIpcSlotFile); // ignore the returned error - assume it means that no file has been passed across
+	}
+
+void CApaCommandLine::GetCommandLineFromProcessEnvironmentL()
+	{
+	const TInt bufLen = User::ParameterLength(EEnvironmentSlotMain);
+	if (bufLen==KErrNotFound)
+		{
+		HBufC* const commandLineString=HBufC::NewLC(User::CommandLineLength());
+		{TPtr commandLineString_asWritable(commandLineString->Des());
+		User::CommandLine(commandLineString_asWritable);}
+		User::LeaveIfError(Parse(*commandLineString));
+		CleanupStack::PopAndDestroy(commandLineString);
+		}
+	else
+		{
+		User::LeaveIfError(bufLen); // in case bufLen is some error other than KErrNotFound
+		HBufC8* const buffer=HBufC8::NewLC(bufLen);
+		{TPtr8 buffer_asWritable(buffer->Des());
+		User::LeaveIfError(User::GetDesParameter(EEnvironmentSlotMain, buffer_asWritable));}
+		RDesReadStream stream;
+		stream.Open(*buffer);
+		InternalizeL(stream);
+		CleanupStack::PopAndDestroy(buffer);
+		}
+
+	iFile.AdoptFromCreator(EEnvironmentSlotFsSession, EEnvironmentSlotFile); // ignore the returned error - assume it means that no file has been passed across
+	}
+
+EXPORT_C CApaCommandLine* CApaCommandLine::NewLC()
+/** Creates an empty command line object, and puts a pointer to it onto the cleanup 
+stack.
+
+@return A pointer to the new command line object. */
+	{
+	CApaCommandLine* This=new(ELeave) CApaCommandLine;
+	CleanupStack::PushL(This);
+	return This;
+	}
+
+EXPORT_C void CApaCommandLine::SetDocumentNameL(const TDesC& aDocName)
+/** Sets the document name from the specified descriptor.
+
+If the document name has embedded spaces, then it must be enclosed within 
+quotation marks.
+
+@param aDocName A descriptor containing the document name. */
+	{
+	HBufC* const documentName=aDocName.AllocL();
+	delete iDocumentName; // only done after the AllocL succeeds
+	iDocumentName=documentName;
+	}
+
+EXPORT_C TPtrC CApaCommandLine::DocumentName() const
+/** Gets the document name from the launch information.
+
+@return A pointer descriptor representing the document name. The document 
+name is returned without any enclosing quotation marks. If the launch information 
+contains no document name, then the pointer descriptor has zero length. */
+	{
+	if (iDocumentName!=NULL)
+		{
+		return *iDocumentName;
+		}
+	return KNullDesC();
+	}
+
+EXPORT_C void CApaCommandLine::SetExecutableNameL(const TDesC& aExecutableName)
+/** Sets the executable name from the specified descriptor.
+
+@param aExecutableName A descriptor containing the executable name. */
+	{
+	HBufC* const executableName=aExecutableName.AllocL();
+	delete iExecutableName; // only done after the AllocL succeeds
+	iExecutableName=executableName;
+	}
+
+EXPORT_C TPtrC CApaCommandLine::ExecutableName() const
+/** Gets the executable name from the launch information.
+
+@return A pointer descriptor representing the executable name. */
+	{
+	if (iExecutableName!=NULL)
+		{
+		return *iExecutableName;
+		}
+	return KNullDesC();
+	}
+
+EXPORT_C void CApaCommandLine::SetOpaqueDataL(const TDesC8& aOpaqueData)
+/** Sets the opaque-data from the specified 8-bit descriptor.
+
+This is called internally and populated from the data in the application's registration resource file, 
+i.e. from the resource indicated by the opaque_data field of the APP_REGISTRATION_INFO resource (if the 
+opaque_data field was non-zero).
+
+@param aOpaqueData An 8-bit descriptor containing the opaque-data. */
+	{
+	HBufC8* const opaqueData = aOpaqueData.AllocL();
+	delete iOpaqueData;
+	iOpaqueData = opaqueData;
+	}
+
+EXPORT_C TPtrC8 CApaCommandLine::OpaqueData() const
+/** Gets the opaque-data from the launch information.
+
+See the description of SetOpaqueDataL. By default, this attribute is an empty descriptor.
+
+@see SetOpaqueDataL
+@return An 8-bit pointer descriptor representing the opaque-data. */
+	{
+	if (iOpaqueData != NULL)
+		{
+		return *iOpaqueData;
+		}
+	return KNullDesC8();
+	}
+
+EXPORT_C void CApaCommandLine::SetCommandL(TApaCommand aCommand)
+/** Sets the command code.
+
+The command code is used to indicate how an application is to be launched.
+
+@see TApaCommand
+@param aCommand The command code. */
+	{
+	iCommand=aCommand;
+	}
+
+EXPORT_C TApaCommand CApaCommandLine::Command() const
+/** Gets the command code from the launch information.
+
+See the description of SetCommandL.
+
+@see SetCommandL
+@see TApaCommand
+@return The command code. */
+	{
+	return iCommand;
+	}
+
+EXPORT_C void CApaCommandLine::SetTailEndL(const TDesC8& aTailEnd)
+/** Sets the trailing data.
+
+The UI Framework provides a specific set of pre-defined command line 
+options. Additional user defined or pre-defined command line options, 
+may be passed to an application by setting the TailEnd.
+
+@param aTailEnd An 8 bit descriptor containing the trailing data. */
+	{
+	HBufC8* const newTailEnd=aTailEnd.AllocL();
+	delete iTailEnd; // only done after the AllocL succeeds
+	iTailEnd=newTailEnd;
+	}
+
+EXPORT_C TPtrC8 CApaCommandLine::TailEnd() const
+/** Gets the trailing data from the launch information.
+
+See the description of SetTailEndL.
+
+@see SetTailEndL
+@return A pointer descriptor representing the trailing data. If the launch 
+information contains no trailing data, then the pointer descriptor has zero 
+length. */
+	{
+	if (iTailEnd!=NULL)
+		{
+		return *iTailEnd;
+		}
+	return KNullDesC8();
+	}
+
+EXPORT_C void CApaCommandLine::SetFileByHandleL(const RFile& aFile)
+/** Sets the file to be passed into the application (by handle). 
+This will then be retrieved by that application-process calling GetFileByHandleL().
+
+@publishedPartner
+@released
+@param aFile The file object to be passed into the application. No transfer of this 
+object's ownership takes place in this function. */
+	{
+	__ASSERT_ALWAYS(aFile.SubSessionHandle()!=KNullHandle, Panic(EPanicInvalidHandle));
+	__ASSERT_ALWAYS(iFile.SubSessionHandle()==KNullHandle, Panic(EPanicHandleAlreadySet));
+	User::LeaveIfError(iFile.Duplicate(aFile));
+	}
+
+EXPORT_C void CApaCommandLine::GetFileByHandleL(RFile& aFile) const
+/** Opens (by handle) the file that was passed into SetFileByHandleL by the process launching the local application.
+
+On entering this function, aFile must be non-open. It is recommended that aFile is 
+pushed onto the cleanup-stack (via CleanupClosePushL()) before this function is called.
+
+@publishedPartner
+@released
+@param aFile The file object to be set up from the handle passed into the application. The 
+caller has the responsibility to Close() this object, even if this function leaves. */
+	{
+	__ASSERT_ALWAYS(aFile.SubSessionHandle()==KNullHandle, Panic(EPanicHandleAlreadySet));
+	if (iFile.SubSessionHandle()!=KNullHandle)
+		{
+		User::LeaveIfError(aFile.Duplicate(iFile));
+		}
+	}
+
+/** Assigns a command line to a process (EKA2 only). 
+
+This replaces the EKA1 method which involved retrieving the full command line (using 
+CApaCommandLine::FullCommandLine()) and passing it to the process (or thread on the 
+emulator).
+
+This function is used as follows (the order of the first 2 steps is irrelevant):-
+- create the process and load the executable (RProcess::Create()),
+- create the command line object (CApaCommandLine::NewLC()), and set it up using 
+the various setter functions, for instance SetDocumentNameL(),
+- call SetProcessEnvironmentL() to assign the command line to the process,
+- call Resume() on the process.
+
+Note that this sequence of steps bypasses the application architecture, and is 
+not recommended. RApaLsSession::StartApp() is the recommended way to 
+launch an application with a command line.
+
+@param aProcess The process to which the command line is assigned.
+@leave KErrNotSupported This indicates that the function was called on EKA1.
+@see RApaLsSession::StartApp()
+*/
+EXPORT_C void CApaCommandLine::SetProcessEnvironmentL(RProcess& aProcess) const
+	{
+	HBufC8* const streamableAttributes=StreamableAttributesLC();
+	User::LeaveIfError(aProcess.SetParameter(EEnvironmentSlotMain, *streamableAttributes));
+	CleanupStack::PopAndDestroy(streamableAttributes);
+
+	if (iFile.SubSessionHandle()!=KNullHandle)
+		{
+		User::LeaveIfError(iFile.TransferToProcess(aProcess, EEnvironmentSlotFsSession, EEnvironmentSlotFile));
+		}
+	}
+
+EXPORT_C void CApaCommandLine::GetIpcArgsLC(TIpcArgs& aIpcArgs) const
+/**
+@internalTechnology
+*/
+	{
+	aIpcArgs.Set(EIpcSlotMain, StreamableAttributesLC());
+	if (iFile.SubSessionHandle()!=KNullHandle)
+		{
+		User::LeaveIfError(iFile.TransferToServer(aIpcArgs, EIpcSlotFsSession, EIpcSlotFile));
+		}
+	}
+
+EXPORT_C TInt CApaCommandLine::GetCommandLineFromProcessEnvironment(CApaCommandLine*& aCommandLine)
+/** Constructs a command line object.
+
+If command line information is provided in the environment-slots it creates command line object from
+process environment-slots, else creates it from the information returned by User::CommandLine().
+
+It can be called from a context where there is no CTrapCleanup.
+
+Calling this function more than once in a process is not supported and will result in an empty command
+line being returned. If an application wants to inspect any part of its command line, it 
+should override CEikAppUi::ProcessCommandParametersL(CApaCommandLine& aCommandLine) and call the base
+class implementation if required.
+
+@see CEikAppUi::ProcessCommandParametersL(CApaCommandLine& aCommandLine).
+@param aCommandLine On return, a pointer to a newly constructed command line object.
+@return KErrNone, if successful; otherwise one of the other system-wide error codes.
+@internalTechnology */
+	{ // static
+	aCommandLine = NULL;
+	CApaCommandLine* const commandLine = new CApaCommandLine;
+	if(!commandLine)
+		return KErrNoMemory;
+	
+	CTrapCleanup* trapCleanup = NULL;
+	if (!User::TrapHandler())
+		{
+		trapCleanup = CTrapCleanup::New(); // we're being called from an environment without a cleanup-stack, so temporarily create one here
+		if(!trapCleanup)
+			{
+			delete commandLine;
+			return KErrNoMemory;
+			}
+		}
+	
+	TRAPD(error, commandLine->GetCommandLineFromProcessEnvironmentL());
+	aCommandLine = commandLine;
+	delete trapCleanup;
+	return error;
+	}
+
+EXPORT_C void CApaCommandLine::SetParentProcessId(TProcessId aProcessId)
+/** Sets the Parent Process ID for the Child Process launched with this command line.
+
+This establishes a Parent-Child relationship which ensures that the child process is
+terminated when the parent terminates.
+
+@param aProcessId The Process ID. */
+	{
+	iParentProcessId=aProcessId;
+	}
+
+EXPORT_C TProcessId CApaCommandLine::ParentProcessId() const
+/** Gets the Parent Process ID of the Child Process launched with this command line.
+
+See the description of SetParentProcessId.
+
+@see SetParentProcessId
+@return The Parent Process ID. */
+	{
+	return iParentProcessId;
+	}
+
+
+void CApaCommandLine::ExternalizeL(RWriteStream& aStream) const
+	{
+	// iFile is not supported via RReadStream/RWriteStream
+	aStream << DocumentName();
+	aStream << ExecutableName();
+	aStream << OpaqueData();
+	aStream << TailEnd();
+	aStream.WriteInt32L(iCommand);
+	aStream.WriteInt32L(iServerDifferentiator);
+	aStream.WriteInt32L(iDefaultScreenNumber);
+	aStream.WriteInt32L(iParentWindowGroupID);
+	aStream.WriteInt32L(iDebugMemFail);
+	aStream.WriteInt32L(iAppStartupInstrumentationEventIdBase);
+	aStream.WriteInt32L(iParentProcessId);
+	}
+
+
+void CApaCommandLine::InternalizeL(RReadStream& aStream)
+	{
+	// iFile is not supported via RReadStream/RWriteStream
+	const TInt KMaxBufLength = 4000;
+	iDocumentName = HBufC::NewL(aStream,KMaxBufLength);
+	iExecutableName = HBufC::NewL(aStream,KMaxBufLength);
+	iOpaqueData = HBufC8::NewL(aStream, KMaxBufLength);
+	iTailEnd = HBufC8::NewL(aStream,KMaxBufLength);
+	iCommand = static_cast<TApaCommand>(aStream.ReadInt32L());
+	iServerDifferentiator = aStream.ReadInt32L();
+	iDefaultScreenNumber = aStream.ReadInt32L();
+	iParentWindowGroupID = aStream.ReadInt32L();
+	iDebugMemFail = aStream.ReadInt32L();
+	iAppStartupInstrumentationEventIdBase = aStream.ReadInt32L();
+	iParentProcessId=aStream.ReadInt32L();
+	}
+
+HBufC8* CApaCommandLine::StreamableAttributesLC() const
+	{
+	CBufFlat* const buffer = CBufFlat::NewL(128);
+	CleanupStack::PushL(buffer);
+	RBufWriteStream writeStream;
+	writeStream.Truncate(*buffer);
+	ExternalizeL(writeStream);
+	writeStream.CommitL();
+	HBufC8* const bufferAsDescriptor = buffer->Ptr(0).AllocL();
+	CleanupStack::PopAndDestroy(buffer);
+	CleanupStack::PushL(bufferAsDescriptor);
+	return bufferAsDescriptor;
+	}
+
+EXPORT_C void CApaCommandLine::SetServerNotRequiredL()
+/** Sets that no server is required.
+
+The value of server differentiator is set to zero, to indicate that no server
+is required.
+
+See the description of SetServerRequiredL.
+@see SetServerRequiredL
+*/
+	{
+	SetServerDifferentiatorL(0);
+	}
+
+EXPORT_C void CApaCommandLine::SetServerRequiredL(TUint aServerDifferentiator)
+/** Sets the required server.
+
+The server differentiator is a number generated by the client that helps to uniquely 
+identify the server. It is used by an application to indicate whether a server should
+be created and how it should be named.
+
+@param aServerDifferentiator A differentiator for the required server.*/
+
+	{
+	SetServerDifferentiatorL(aServerDifferentiator);
+	}
+
+void CApaCommandLine::SetServerDifferentiatorL(TUint aServerDifferentiator)
+	{
+	iServerDifferentiator=aServerDifferentiator;
+	}
+	
+EXPORT_C TUint CApaCommandLine::ServerRequired() const
+/** Gets the server differentiator.
+
+See the description of SetServerRequiredL.
+
+@see SetServerRequiredL
+@return The non-zero differentiator for the server, else zero indicating a server 
+is not required.*/
+	{
+	return iServerDifferentiator;
+	}
+
+EXPORT_C void CApaCommandLine::SetDefaultScreenL(TInt aDefaultScreenNumber)
+/** Provides support for devices with more than one screen.  A number representing the default
+or startup screen may be passed to an application.
+Screen numbers and characteristics are defined in the window server initialisation 
+file (wsini.ini).
+
+@param aDefaultScreenNumber The number of the default (startup) screen. */
+	{
+	__ASSERT_ALWAYS(aDefaultScreenNumber>=0, Panic(EPanicInvalidScreenNumber));
+	iDefaultScreenNumber=aDefaultScreenNumber;
+	}
+
+EXPORT_C TInt CApaCommandLine::DefaultScreen() const
+/** Extracts and returns the default (startup) screen that was specified in the command line.
+
+@return	A number representing the default (startup) screen.  0 (Zero) if nothing present. */
+	{
+	return Max(0, iDefaultScreenNumber);
+	}
+	
+EXPORT_C TBool CApaCommandLine::IsDefaultScreenSet() const
+/**
+@internalTechnology
+*/
+	{
+	return (iDefaultScreenNumber>=0);
+ 	}
+
+EXPORT_C void CApaCommandLine::SetParentWindowGroupID(TInt aParentWindowGroupID)
+/** Sets the ID of the parent window-group - the application should create its own 
+window-group as a child off this parent.
+
+@param aParentWindowGroupID The ID of the parent window-group - the application 
+should create its window-group as a child off this parent. */
+	{
+	iParentWindowGroupID=aParentWindowGroupID;
+	}
+
+EXPORT_C TInt CApaCommandLine::ParentWindowGroupID() const
+/** Returns the ID of the parent window-group - the application should create its own 
+window-group as a child of this parent.
+
+@return The ID of the parent window-group - the application should create its 
+window-group as a child off this . */
+	{
+	return iParentWindowGroupID;
+	}
+
+EXPORT_C void CApaCommandLine::SetDebugMemFailL(TInt aDebugMemFail)
+/** @internalAll */
+	{
+	iDebugMemFail=aDebugMemFail;
+	}
+
+EXPORT_C TInt CApaCommandLine::DebugMemFail() const
+/** @internalAll */
+	{
+	return iDebugMemFail;
+	}
+
+EXPORT_C void CApaCommandLine::SetAppStartupInstrumentationEventIdBaseL(TInt aAppStartupInstrumentationEventIdBase)
+/** @internalAll */
+	{
+	iAppStartupInstrumentationEventIdBase=aAppStartupInstrumentationEventIdBase;
+	}
+
+EXPORT_C TInt CApaCommandLine::AppStartupInstrumentationEventIdBase() const
+/** @internalAll */
+	{
+	return iAppStartupInstrumentationEventIdBase;
+	}
+
+EXPORT_C TInt CApaCommandLine::EnvironmentSlotForPublicUse(TInt aIndex)
+/** Returns the index of a process environment-slot for public use (in other words, 
+one that is not used internally by CApaCommandLine). The number of slots available 
+for public use can be found in the (private) enum value CApaCommandLine::ENumberOfEnvironmentSlotsForPublicUse, 
+(this value may be increased over time). The returned value can then be passed into 
+any of the Open(TInt,...) functions on RSessionBase, RMutex, RChunk, RCondVar, etc, 
+or into User::GetTIntParameter(), User::GetDesParameter(), etc, depending on the type 
+of the object in that environment slot.
+
+@param aIndex The logical index of the public environment-slot. This must be greater 
+than or equal to zero, and less than CApaCommandLine::ENumberOfEnvironmentSlotsForPublicUse.
+@return The physical index of an environment-slot in the local process. */
+	{ // static
+	__ASSERT_ALWAYS((aIndex>=0) && (aIndex<ENumberOfEnvironmentSlotsForPublicUse), Panic(EPanicEnvironmentSlotNotForPublicUse));
+	return EFirstEnvironmentSlotForPublicUse+aIndex;
+	}
+
+TInt CApaCommandLine::Parse(const TDesC& aCmdLine)
+// does the opposite of SetCmdLineL, i.e. sets iDocumentName, iExecutableName, iTailEnd, iCommand, iServerDifferentiator, iDefaultScreenNumber, iParentWindowGroupID , iDebugMemFail & iAppStartupInstrumentationEventIdBase from aCmdLine
+// also sets iOpaqueData
+	{
+	const TInt cmdLength=aCmdLine.Length();
+
+	// these variables are all "shadows" of member variables - we'll set the member variables corresponding to these at the end of this function, once all memory-allocation has succeeded, to make this function atomic
+	TInt endLibNameOffset=cmdLength-1;
+	TInt endDocNameOffset=cmdLength-1;
+	HBufC* documentName=NULL;
+	HBufC* executableName=NULL;
+	HBufC8* tailEnd=NULL;
+	HBufC8* opaqueData=NULL;
+	TApaCommand command=EApaCommandRun;
+	TInt serverDifferentiator=0;
+	TInt defaultScreenNumber=-1;
+	TInt parentWindowGroupID=0;
+	TInt debugMemFail=0;
+	TInt appStartupInstrumentationEventIdBase=0;
+	TInt notUsed;
+
+	TBool openQuote=EFalse;
+	TBool foundEndLibName=EFalse;
+	for (TInt i=0; i<cmdLength; ++i)
+		{
+		TChar current=aCmdLine[i];
+		if (current=='"')
+			{
+			openQuote=!openQuote;
+			continue;
+			};
+		if ((current==' ') && !openQuote)
+			{
+			// space found outside of quotes
+			if (foundEndLibName)
+				{
+				endDocNameOffset=i-1;
+				break; // parse no further
+				}
+			endLibNameOffset=i-1;
+			foundEndLibName=ETrue;
+			}
+		}
+	if (endLibNameOffset>-1)
+		{
+		executableName=StripQuotes(aCmdLine.Left(endLibNameOffset+1)).Alloc();
+		if (executableName==NULL)
+			{
+			delete documentName;
+			delete executableName;
+			delete tailEnd;
+			delete opaqueData;
+			return KErrNoMemory;
+			}
+		}
+	TInt offset=endDocNameOffset-endLibNameOffset;
+	if (offset>1)
+		{
+		TChar commandLetter=aCmdLine[endLibNameOffset+2];
+		switch (commandLetter)
+			{
+		case KApaCommandLetterOpen:
+			command=EApaCommandOpen;
+			break;
+		case KApaCommandLetterCreate:
+			command=EApaCommandCreate;
+			break;
+		case KApaCommandLetterViewActivate:
+			command=EApaCommandViewActivate;
+			break;
+		case KApaCommandLetterRunWithoutViews:
+			command=EApaCommandRunWithoutViews;
+			break;
+		case KApaCommandLetterBackgroundAndWithoutViews:
+			command=EApaCommandBackgroundAndWithoutViews;
+			break;
+		case KApaCommandLetterRun:
+		default:
+			break;
+		case KApaCommandLetterBackground:
+			command=EApaCommandBackground;
+			break;
+			}
+
+		if (offset>2)
+			{
+			const TInt documentNameStartPosition=endLibNameOffset+3;
+			documentName=StripQuotes(aCmdLine.Mid(documentNameStartPosition, (endDocNameOffset+1)-documentNameStartPosition)).Alloc();
+			if (documentName==NULL)
+				{
+				delete documentName;
+				delete executableName;
+				delete tailEnd;
+				delete opaqueData;
+				return KErrNoMemory;
+				}
+			}
+		}
+	const TInt KNumberOfSupportedOptions=6;
+	TFixedArray<SOption, KNumberOfSupportedOptions> optionArray;
+	optionArray[0].iToken=&KLitTokenServerDifferentiator;
+	optionArray[0].iResult=&serverDifferentiator;
+	optionArray[0].iRadix=EDecimal;
+	optionArray[1].iToken=&KLitTokenDefaultScreenNumber;
+	optionArray[1].iResult=&defaultScreenNumber;
+	optionArray[1].iRadix=EDecimal;
+	optionArray[2].iToken=&KLitTokenParentWindowGroupID;
+	optionArray[2].iResult=&parentWindowGroupID;
+	optionArray[2].iRadix=EDecimal;
+	optionArray[3].iToken=&KLitTokenDebugMemFail;
+	optionArray[3].iResult=&debugMemFail;
+	optionArray[3].iRadix=EHex;
+	optionArray[4].iToken=&KLitTokenAppStartupInstrumentationEventIdBase;
+	optionArray[4].iResult=&appStartupInstrumentationEventIdBase;
+	optionArray[4].iRadix=EDecimal;
+	optionArray[5].iToken=&KLitTokenOpaqueData;
+	optionArray[5].iResult=&notUsed;
+	optionArray[5].iRadix=EDecimal; // should not used if the command-line is well-formed
+	TLex lex(aCmdLine.Mid(endDocNameOffset+1));
+	lex.Mark();
+	for (TInt optionIndex=0; optionIndex<KNumberOfSupportedOptions; ++optionIndex)
+		{
+		lex.SkipSpace();
+		SOption& option=optionArray[optionIndex];
+		const TPtrC remainder(lex.Remainder());
+		__ASSERT_DEBUG(option.iToken, Panic(EDPanicInvalidToken));
+		const TInt tokenLength=option.iToken->Length();
+		if ((remainder.Length()>=tokenLength) && (remainder.Left(tokenLength).CompareF(*option.iToken)==0))
+			{
+			if (option.iToken==&KLitTokenOpaqueData)
+				{
+				TInt endOfOpaqueDataIndex = 0;			
+				for (TInt i=tokenLength; i<remainder.Length(); ++i)
+					{
+					TChar current=remainder[i];
+					if (current==' ')
+						{
+						endOfOpaqueDataIndex = i;
+						break; // parse no further
+						}
+					}
+				if(endOfOpaqueDataIndex > tokenLength)
+					{
+					const TInt opaqueDataLength = endOfOpaqueDataIndex - tokenLength;
+					delete opaqueData;
+					opaqueData=TPtrC8(reinterpret_cast<const TUint8*>(remainder.Mid(tokenLength, opaqueDataLength).Ptr()),opaqueDataLength*sizeof(TText)).Alloc();
+					if (opaqueData==NULL)
+						{
+						delete documentName;
+						delete executableName;
+						delete tailEnd;
+						return KErrNoMemory;
+						}
+					lex.Inc(tokenLength + opaqueDataLength);
+					lex.Mark();
+					}
+				else
+					{
+					delete opaqueData;
+					delete documentName;
+					delete executableName;
+					delete tailEnd;
+					// invalid command line. copy TLex.Val behavior
+					return KErrGeneral;
+					}
+				}
+			else
+				{
+				ASSERT(option.iResult);
+				const TInt originalValue=*option.iResult;
+				lex.Inc(tokenLength);
+				TUint16 val = static_cast<TUint16> (*option.iResult);
+				if (lex.Val(val, option.iRadix)==KErrNone)
+					{
+					lex.Mark();
+					}
+				else
+					{
+					*option.iResult=originalValue;
+					}
+				}
+			}
+		}
+	lex.UnGetToMark();
+	lex.SkipSpace();
+	const TPtrC remainder(lex.Remainder());
+	const TInt lengthOfRemainder=remainder.Length();
+	if (lengthOfRemainder>0)
+		{
+		tailEnd=TPtrC8(reinterpret_cast<const TUint8*>(remainder.Ptr()),lengthOfRemainder*sizeof(TText)).Alloc();
+		if (tailEnd==NULL)
+			{
+			delete documentName;
+			delete executableName;
+			delete tailEnd;
+			delete opaqueData;
+			return KErrNoMemory;
+			}
+		}
+
+	// we can now set the member variables as all memory-allocation has succeeded
+	delete iDocumentName;
+	iDocumentName=documentName;
+	delete iExecutableName;
+	iExecutableName=executableName;
+	delete iTailEnd;
+	iTailEnd=tailEnd;
+	iCommand=command;
+	iServerDifferentiator=serverDifferentiator;
+	iDefaultScreenNumber=defaultScreenNumber;
+	iParentWindowGroupID=parentWindowGroupID;
+	iDebugMemFail=debugMemFail;
+	iAppStartupInstrumentationEventIdBase=appStartupInstrumentationEventIdBase;
+	delete iOpaqueData;
+	iOpaqueData = opaqueData;
+	return KErrNone;
+	}
+
+TPtrC CApaCommandLine::StripQuotes(const TDesC& aDes) const
+	//
+	// return aDes stripped of any enclosing quotes 
+	//
+	{
+	TInt start=0;
+	TInt end=aDes.Length()-1;
+	TPtrC ret;
+	if (end>=0)
+		{
+		if (aDes[0]=='"')
+			{
+			start++;
+			}
+		if (aDes[end]=='"')
+			{
+			end--;
+			}
+		TInt length=end-start+1;
+		if (length>0)
+			{
+			ret.Set(aDes.Mid(start, length));
+			}
+		}
+	return ret;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apparc/APADLL.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,70 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __APADLL_H__
+#define __APADLL_H__
+
+#if !defined(__E32STD_H__)
+#include <e32std.h>
+#endif
+#if !defined(__E32BASE_H__)
+#include <e32base.h>
+#endif
+#if !defined(__APADEF_H__)
+#include <apadef.h>
+#endif
+#if !defined(__APPARC_H__)
+#include <apparc.h>
+#endif
+
+
+// classes referenced
+class CApaApplication;
+class RFs;
+
+NONSHARABLE_CLASS(CApaAppHolder) : public CBase
+/** Provides an interface for obtaining data gathered differently for DLLs and EXEs. Derived
+classes create and own the application object. The equivalent of the old CApaDll derives from this.*/
+{
+public:
+	CApaAppHolder();
+	~CApaAppHolder();
+
+	virtual TFileName FileName() const = 0;
+	virtual TUid Uid() const = 0;
+	virtual CApaApplication* Application() const = 0;
+
+protected:
+	void UpdateAppsRefToThis();
+};
+
+NONSHARABLE_CLASS(CApaExe) : public CApaAppHolder
+	{
+public:
+	CApaExe();
+	~CApaExe();
+
+	TFileName FileName() const;
+	TUid Uid() const;
+	CApaApplication* Application() const;
+
+	void CreateApplicationL(TApaApplicationFactory aApplicationFactory); // Uses the factory to create the application
+private:
+	CApaApplication* iApplication;
+	HBufC* iAppName;
+	TUid iFileUid;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apparc/APAFLREC.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,340 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <f32file.h>
+#include <apaflrec.h>
+#include <apaid.h>
+#include <apacmdln.h>
+#include "APASTD.H"
+#include "APGCLI.H"
+
+#ifdef USING_ECOM_RECOGS
+#include <ecom/ecom.h>
+#endif
+
+//
+//CFileRecognizerExtension Class
+//
+//stores the destructor key to track the instance of ecom implementation class
+class CFileRecognizerExtension : public CBase
+ 	{
+public:
+	static CFileRecognizerExtension* NewL(TUid aDtorKey);
+ 	~CFileRecognizerExtension();
+	//returns the destructor key
+ 	TUid DestructorUid()const;
+private:
+	CFileRecognizerExtension(TUid aDtorKey);
+private:
+ 	//destructor key to track the instance of ecom implementation class
+	TUid iDtorKey;
+	};
+
+//
+// Class CApaFileRecognizer
+//
+
+EXPORT_C CApaFileRecognizer::CApaFileRecognizer(RFs& aFs)
+	:iFs(aFs)
+	{}
+
+
+EXPORT_C CApaFileRecognizer::~CApaFileRecognizer()
+	{
+	DestroyRecognizerList();
+	delete iAppLocator;
+	//lint -esym(1740,CApaFileRecognizer::iFileRecognizerList) not directly freed - see DestroyRecognizerList()
+	}
+
+	
+EXPORT_C void CApaFileRecognizer::DestroyRecognizerList()
+// this method exists to allow subclassers to destroy the list earlier if they wish
+	{
+	CApaFileRecognizerType* rec=iFileRecognizerList;
+	//delete one element after the other in the list
+	while (rec!=NULL )
+		{
+		CApaFileRecognizerType* prev=NULL;
+		prev = rec;
+		rec=rec->iNext;
+		delete prev;
+		}
+	iFileRecognizerList=NULL;
+	}
+
+
+EXPORT_C void CApaFileRecognizer::SetAppLocator(CApaAppLocator* aAppLocator)
+// takes ownership of the locator
+	{
+	iAppLocator = aAppLocator;
+	}
+
+static TUidType UidTypeL(const TDesC& aFullFileName, const RFs& aFs)
+	{	
+	_LIT(KSysBin, "\\sys\\bin\\");
+	if (TParsePtrC(aFullFileName).Path().CompareF(KSysBin)==0)
+		{
+		RLoader loader;
+		User::LeaveIfError(loader.Connect());
+		CleanupClosePushL(loader);
+		TPckgBuf<RLibrary::TInfo> dllInfo;
+		User::LeaveIfError(loader.GetInfo(aFullFileName, dllInfo));
+		CleanupStack::PopAndDestroy(&loader);
+		return dllInfo().iUids;
+		}
+	TEntry entry;
+	User::LeaveIfError(aFs.Entry(aFullFileName,entry));
+	return entry.iType;
+	}
+
+EXPORT_C CApaFileRecognizerType* CApaFileRecognizer::RecognizeFileL(const TDesC& aFullFileName,const TUidType* aUidType)
+// Returns the specific recognizer if the file is recogized as a runnable file. or NULL if not.
+// TUidType is optional, if not supplied it will be read from the file.
+// Leaves, if any files required cannot be found or if OOM.
+// Leaves with KErrNotSupported, if file cannot be recognized.
+	{
+	const TUidType uidType((aUidType!=NULL)? *aUidType: UidTypeL(aFullFileName, iFs));
+	CApaFileRecognizerType* rec=iFileRecognizerList;
+	CApaFileRecognizerType::TRecognizedType type;
+	while (rec!=NULL)
+		{
+		type=rec->RecognizeFileL(iFs,aFullFileName,uidType);
+		if (type==CApaFileRecognizerType::EOtherFile)	
+			{
+			rec=NULL;						// Recognised but not runnable so stop search now
+			break;
+			}
+		if (type!=CApaFileRecognizerType::ENotRecognized)
+			{
+ 			break;
+			}
+		rec=rec->iNext;
+		}
+	if (rec==NULL)
+		{
+		User::Leave(KErrNotSupported);
+		}
+	return rec;
+	}
+
+EXPORT_C void CApaFileRecognizer::AddFileRecognizerType(CApaFileRecognizerType* aFileRecognizerType)
+// Add given RecognizerType to the end of the recognizer list.
+// Set's it's iFileRecognizer pointer to "this" - recognizers may call AppDataByUid
+	{
+	aFileRecognizerType->iNext=NULL;
+	aFileRecognizerType->iFileRecognizer=this;
+	CApaFileRecognizerType* rec=iFileRecognizerList;
+	if (rec==NULL)
+		iFileRecognizerList=aFileRecognizerType;
+	else
+		{
+		while (rec->iNext!=NULL)
+			rec=rec->iNext;
+		rec->iNext=aFileRecognizerType;
+		}
+	}
+
+
+EXPORT_C TInt CApaFileRecognizer::RemoveFileRecognizerType(const CApaFileRecognizerType* aFileRecognizerType)
+// remove the given recognizer from the list if it is not locked
+// return an error code if removal failed
+	{
+	CApaFileRecognizerType* rec=iFileRecognizerList;
+	CApaFileRecognizerType* prev=NULL;
+	// find the recognizer in the list
+	while (rec!=NULL && rec!=aFileRecognizerType)
+		{
+		prev = rec;
+		rec=rec->iNext;
+		}
+	// did we find a match
+	if (!rec)
+		return KErrNotFound;
+	// is the matching recognizer locked
+	if (rec->Locked())
+		return KErrLocked;
+	// remove the recognizer from the list, then delete it
+	if (prev)
+		prev->iNext = rec->iNext;
+	else
+		iFileRecognizerList = rec->iNext;
+	rec->iNext = NULL;
+	delete rec;
+	return KErrNone;
+	}
+
+
+EXPORT_C CApaAppLocator* CApaFileRecognizer::AppLocator() const
+	{
+	__ASSERT_ALWAYS(iAppLocator,Panic(EPanicNoAppLocator));
+	//
+	return iAppLocator;
+	}
+
+
+//
+// Class CApaFileRecognizerType
+//
+
+EXPORT_C CApaFileRecognizerType::CApaFileRecognizerType():iFileRecognizerExtn(NULL)
+	{
+	}
+
+
+EXPORT_C CApaFileRecognizerType::~CApaFileRecognizerType()
+	{
+#ifdef USING_ECOM_RECOGS
+	//if ecom plugin is used destroy its implementation
+	if(iFileRecognizerExtn!=NULL)
+		{
+		REComSession::DestroyedImplementation(iFileRecognizerExtn->DestructorUid());
+		delete iFileRecognizerExtn;
+		}
+#else
+	iFileRecognizerExtn = NULL;
+#endif
+	delete iCapabilityBuf;
+	delete iFullFileName;
+	iFileRecognizer = NULL;
+	iAppStarter = NULL;
+	iNext = NULL;
+	}
+
+EXPORT_C TThreadId CApaFileRecognizerType::AppRunL(const CApaCommandLine& aCommandLine) const
+	{
+	__ASSERT_ALWAYS(iAppStarter,Panic(EPanicNoAppStarter));
+	//
+	return iAppStarter->StartAppL(aCommandLine);
+	}
+
+CApaFileRecognizerType::TRecognizedType CApaFileRecognizerType::RecognizeFileL(RFs& aFs,const TDesC& aFullFileName,TUidType aUidType)
+	{
+	// set the UID's and name
+	iFileType = aUidType[1];
+	iAppUid = aUidType[2];
+	delete iFullFileName;
+	iFullFileName = NULL;
+	iFullFileName = aFullFileName.AllocL();
+	//
+	// see if we recognize it
+	iRecognizedType = ENotRecognized;
+	TRecognizedType type=DoRecognizeFileL(aFs,aUidType);
+	if (type==ENotRecognized)
+		{
+		delete iFullFileName;
+		iFullFileName=NULL;
+		}
+	else
+		{
+		if(!iCapabilityBuf)
+			{
+			// Actually, iCapabilityBuf is not needed anymore, but in order not to break BC,
+			// we must still support it (in case someone calls CApaFileRecognizerType::Capability).
+			iCapabilityBuf = new(ELeave) TApaAppCapabilityBuf;
+			iCapabilityBuf->FillZ(iCapabilityBuf->MaxLength());
+			}
+		}
+	return type;
+	}
+
+
+EXPORT_C void CApaFileRecognizerType::Capability(TDes8& aCapabilityBuf)const
+	{
+	__ASSERT_ALWAYS(iCapabilityBuf,Panic(EPanicCapabilityNotSet)); // capability has been called when no file has been recognized
+	//
+	TApaAppCapability::CopyCapability(aCapabilityBuf,*iCapabilityBuf);
+	}
+
+
+EXPORT_C void CApaFileRecognizerType::Lock()
+	{
+	iLock++;
+	}
+
+
+EXPORT_C void CApaFileRecognizerType::Unlock()
+	{
+	if (iLock>0)
+		iLock--;
+	}
+
+
+TBool CApaFileRecognizerType::Locked()const
+	{
+	return (iLock>0);
+	}
+
+EXPORT_C void CApaFileRecognizerType::Reserved_1()
+	{}
+
+#ifdef USING_ECOM_RECOGS
+// instantiate the ecom implementation class 
+EXPORT_C CApaFileRecognizerType* CApaFileRecognizerType::CreateFileRecognizerL(TUid aImplUid)
+	{
+	CApaFileRecognizerType* fileRecType = NULL;
+	TUid tempDtorKey = KNullUid;
+	fileRecType = static_cast<CApaFileRecognizerType*>(REComSession::CreateImplementationL(aImplUid, tempDtorKey));
+	CleanupStack::PushL(fileRecType);
+	fileRecType->iFileRecognizerExtn=CFileRecognizerExtension::NewL(tempDtorKey);
+	CleanupStack::Pop(fileRecType);
+	return fileRecType;
+	}
+#else
+EXPORT_C CApaFileRecognizerType* CApaFileRecognizerType::CreateFileRecognizerL(TUid)
+	{
+	return NULL;
+	}
+#endif
+
+CFileRecognizerExtension::CFileRecognizerExtension(TUid aDtorKey)
+ 	:iDtorKey(aDtorKey)
+ 	{
+	}
+
+CFileRecognizerExtension* CFileRecognizerExtension::NewL(TUid aDtorKey)
+	{
+	//instantiate CFileRecognizerExtension with the destructor key of the ecom implentation instance
+	CFileRecognizerExtension* self=new(ELeave) CFileRecognizerExtension(aDtorKey);
+	return self;
+	}
+
+CFileRecognizerExtension::~CFileRecognizerExtension()
+ 	{
+ 	}
+
+//returns the destructor key of the ecom implentation instance
+TUid CFileRecognizerExtension::DestructorUid()const
+ 	{
+ 	return iDtorKey;
+ 	}
+
+//
+// MApaAppStarter
+//
+
+/** Constructor for MApaAppStarter. */
+EXPORT_C MApaAppStarter::MApaAppStarter()
+	{
+	}
+
+/** Reserved for future use */
+EXPORT_C void MApaAppStarter::MApaAppStarter_Reserved1()
+	{
+	}
+	
+/** Reserved for future use */
+EXPORT_C void MApaAppStarter::MApaAppStarter_Reserved2()
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apparc/APAID.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,379 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <apaid.h>
+#include <s32strm.h>
+#include "APASTD.H"
+
+
+/////////////////////////////
+// TApaAppIdentifier
+/////////////////////////////
+
+EXPORT_C TApaAppIdentifier::TApaAppIdentifier()
+/** Constructs an empty application identifier.
+
+The data is not initialised. */
+	{}
+
+EXPORT_C TApaAppIdentifier::TApaAppIdentifier(TUid aAppUid,const TFileName& aDllName)
+	: iAppUid(aAppUid),
+	iFullName(aDllName)
+/** Constructs an application identifier from the specified application 
+DLL file name and extension, and the specified application UID.
+@param aAppUid The application specific UID.
+@param aDllName The filename and extension of the application DLL. */
+	{}
+
+EXPORT_C void TApaAppIdentifier::ExternalizeL(RWriteStream& aStream)const
+/** Externalises the application identifier to a write stream.
+
+@param aStream The write stream. */
+	{
+	aStream<< iAppUid;
+	aStream<< iFullName;
+	}
+
+EXPORT_C void TApaAppIdentifier::InternalizeL(RReadStream& aStream)
+/** Internalises the application identifier from a read stream.
+
+@param aStream The read stream. */
+	{
+	aStream>> iAppUid;
+	aStream>> iFullName;
+	}
+
+/////////////////////////////
+// TApaAppEntry
+/////////////////////////////
+
+EXPORT_C TApaAppEntry::TApaAppEntry()
+	: iUidType(TUidType()),
+	iFullName(KNullDesC)
+/** Constructs an empty application entry object.
+
+The full path name is empty, and the triplet of UIDs forming the UID type 
+are set to null UIDs. */
+	{}
+
+
+EXPORT_C TApaAppEntry::TApaAppEntry(const TUidType& aAppUidType,const TFileName& aDllName)
+	: iUidType(aAppUidType),
+	iFullName(aDllName)
+/** Constructs an application entry object from the specified application 
+DLL full path name and UID type. 
+@param aAppUidType UID type.
+@param aDllName Application DLL full path name. */
+	{}
+
+
+EXPORT_C void TApaAppEntry::ExternalizeL(RWriteStream& aStream)const
+/** Externalises the application entry to a write stream.
+
+@param aStream The write stream. */
+	{
+	aStream<< iUidType[0];
+	aStream<< iUidType[1];
+	aStream<< iUidType[2];
+	aStream<< iFullName;
+	}
+
+
+EXPORT_C void TApaAppEntry::InternalizeL(RReadStream& aStream)
+/** Internalises the application entry from a read stream.
+
+@param aStream The read stream. */
+	{
+	TUid uid1;
+	TUid uid2;
+	TUid uid3;
+	aStream>> uid1;
+	aStream>> uid2;
+	aStream>> uid3;
+	iUidType = TUidType(uid1,uid2,uid3);
+	aStream>> iFullName;
+	}
+
+
+/////////////////////////////
+// TApaAppInfo
+/////////////////////////////
+
+EXPORT_C TApaAppInfo::TApaAppInfo()
+	: iUid(TUid()),
+	iFullName(KNullDesC),
+	iCaption(KNullDesC),
+	iShortCaption(KNullDesC)
+/** Constructs an empty application information object.
+
+The full path name is empty, the captions are empty and the application specific 
+UID is set to the null UID. */
+	{}
+
+
+EXPORT_C TApaAppInfo::TApaAppInfo(TUid aAppUid,const TFileName& aDllName,const TApaAppCaption& aCaption)
+	: iUid(aAppUid),
+	iFullName(aDllName),
+	iCaption(aCaption),
+	iShortCaption(aCaption)
+/** Constructs an application information object from the specified full DLL path 
+name, UID and full length caption.
+
+@param aAppUid The application specific UID. 
+@param aDllName The full path name of the application DLL. 
+@param aCaption The application caption. */
+	{}
+
+EXPORT_C TApaAppInfo::TApaAppInfo(TUid aAppUid,const TFileName& aDllName,const TApaAppCaption& aCaption,const TApaAppCaption& aShortCaption)
+	: iUid(aAppUid),
+	iFullName(aDllName),
+	iCaption(aCaption),
+	iShortCaption(aShortCaption)
+/** Constructs an application information object from the specified full DLL path 
+name, UID, caption and short caption.
+
+@param aAppUid The application specific UID. 
+@param aDllName The full path name of the application DLL. 
+@param aCaption The application caption. 
+@param aShortCaption The application short caption. */
+	{}
+
+EXPORT_C void TApaAppInfo::ExternalizeL(RWriteStream& aStream)const
+/** Externalises the application information to a write stream.
+
+@param aStream The write stream. */
+	{
+	aStream<< iUid;
+	aStream<< iFullName;
+	aStream<< iCaption;
+	aStream<< iShortCaption;
+	}
+
+EXPORT_C void TApaAppInfo::InternalizeL(RReadStream& aStream)
+/** Internalises the application information from a read stream.
+
+@param aStream The read stream. */
+	{
+	aStream>> iUid;
+	aStream>> iFullName;
+	aStream>> iCaption;
+	aStream>> iShortCaption;
+	}
+
+
+/////////////////////////////
+// TApaAppViewInfo
+/////////////////////////////
+
+EXPORT_C TApaAppViewInfo::TApaAppViewInfo()
+	: iUid(KNullUid),
+	iViewCaption(KNullDesC)
+/** Constructs an empty object.
+
+Specifically, it sets the view UID to KNullUid and empties the application 
+caption, i.e. sets it to KNullDesC. */
+	{}
+
+
+EXPORT_C TApaAppViewInfo::TApaAppViewInfo(TUid aAppUid,const TApaAppCaption& aViewCaption, TInt aScreenMode)
+	: iUid(aAppUid),
+	iViewCaption(aViewCaption),
+	iScreenMode(aScreenMode)
+	{}
+
+
+EXPORT_C void TApaAppViewInfo::ExternalizeL(RWriteStream& aStream)const
+/** Externalises the application view information to a write stream.
+
+@param aStream The write stream. */
+	{
+	aStream<< iUid;
+	aStream<< iViewCaption;
+	aStream.WriteInt32L(iScreenMode);
+	}
+
+
+EXPORT_C void TApaAppViewInfo::InternalizeL(RReadStream& aStream)
+/** Internalises the application view information from a read stream.
+
+@param aStream The read stream. */
+	{
+	aStream>> iUid;
+	aStream>> iViewCaption;
+	iScreenMode=aStream.ReadInt32L();
+	}
+
+
+///////////////////////////////////////
+// class TApaAppCapability
+///////////////////////////////////////
+
+EXPORT_C void TApaAppCapability::InternalizeL(RReadStream& aStream)
+	{
+	DoInternalizeL(aStream, iLaunchInBackground, iGroupName);
+	}
+	
+EXPORT_C void TApaAppCapability::Internalize7_0L(RReadStream& aStream)
+/**
+@deprecated
+*/
+	{
+	TBool dummyBool;
+	TApaAppGroupName dummyGroupName;
+	DoInternalizeL(aStream,dummyBool,dummyGroupName);
+	}
+
+void TApaAppCapability::DoInternalizeL(RReadStream& aStream, TBool& aLaunchInBackground, TApaAppGroupName& aGroupName)
+/** Internalises the application capabilities from a read stream.
+
+@param aStream The read stream. */
+	{
+	TInt version = aStream.ReadInt32L();
+	iEmbeddability = TEmbeddability(aStream.ReadInt32L());
+	iSupportsNewFile = aStream.ReadInt32L();
+	iAppIsHidden = aStream.ReadInt32L();
+
+	// initialise values of members which may not be in the stream
+	aLaunchInBackground = EFalse;
+	aGroupName.Zero();
+
+	if (version==1)
+		return;
+
+	// Calypso extension to allow apps to be launched in the background
+	aLaunchInBackground = aStream.ReadInt32L();
+	if (version==2)
+		return;
+
+	aStream >> aGroupName;
+	if (version == 3)
+		return;
+
+	iAttributes = aStream.ReadUint32L();
+	if (version == 4)
+		return;
+	
+	Panic(EDPanicInvalidVersionNumber);
+	}
+
+EXPORT_C void TApaAppCapability::ExternalizeL(RWriteStream& aStream) const
+/** Externalises the application capabilities to a write stream.
+
+@param aStream The write stream. */
+	{
+	aStream.WriteInt32L(EVersion);
+	aStream.WriteInt32L(iEmbeddability);
+	aStream.WriteInt32L(iSupportsNewFile);
+	aStream.WriteInt32L(iAppIsHidden);
+	aStream.WriteInt32L(iLaunchInBackground);
+	aStream << iGroupName;
+	aStream.WriteUint32L(iAttributes);
+	}
+	
+const TInt KOldVersion=1;
+	
+EXPORT_C void TApaAppCapability::Externalize7_0L(RWriteStream& aStream) const
+/** Externalises the application capabilities to a write stream.
+
+@param aStream The write stream. 
+@deprecated*/
+	{
+	aStream.WriteInt32L(KOldVersion);
+	aStream.WriteInt32L(iEmbeddability);
+	aStream.WriteInt32L(iSupportsNewFile);
+	aStream.WriteInt32L(iAppIsHidden);
+	}
+	
+EXPORT_C void TApaAppCapability::CopyCapability(TDes8& aDest,const TDesC8& aSource)
+/** A utility function that can copy capability information from one descriptor 
+to another.
+
+@param aDest Target descriptor.
+@param aSource Source descriptor. */
+	{
+	TInt maxLen=aDest.MaxLength();
+	aDest.FillZ(maxLen); // zero fill in case aSource is shorter
+	aDest.Copy(aSource.Left(Min(aSource.Length(),maxLen)));
+	aDest.SetLength(maxLen);
+	}
+
+
+///////////////////////////////////////
+// class TApaEmbeddabilityFilter
+///////////////////////////////////////
+EXPORT_C TApaEmbeddabilityFilter::TApaEmbeddabilityFilter()
+	: iEmbeddabilityFlags(0)
+/** Constructs an empty embeddability filter. */
+	{
+	}
+
+EXPORT_C void TApaEmbeddabilityFilter::AddEmbeddability(TApaAppCapability::TEmbeddability aEmbeddability)
+/** Adds aEmbeddability to the filter.
+
+@param aEmbeddability TEmbeddability value to add to the filter. */
+	{
+	__ASSERT_ALWAYS(aEmbeddability >= 0 && static_cast<TUint>(aEmbeddability) < (sizeof(TUint)*8), Panic(EPanicEmbeddabilityOutOfRange));
+	iEmbeddabilityFlags |= (1 << aEmbeddability);
+	}
+
+EXPORT_C TBool TApaEmbeddabilityFilter::MatchesEmbeddability(TApaAppCapability::TEmbeddability aEmbeddability) const
+/** Compares aEmbeddability with the filter.
+
+@param aEmbeddability TEmbeddability value to compare.
+@return True, if aEmbeddability is included in the filter; false, otherwise. */
+	{
+	__ASSERT_ALWAYS(aEmbeddability >= 0 && static_cast<TUint>(aEmbeddability) < (sizeof(TUint)*8), Panic(EPanicEmbeddabilityOutOfRange));
+	TUint embeddabilityFlag = (1 << aEmbeddability);
+	if (embeddabilityFlag & iEmbeddabilityFlags)
+		{
+		return ETrue;
+		}
+	return EFalse;
+	}
+
+//
+// CApaAppFinder
+//
+
+/** Constructor for CApaAppFinder */
+EXPORT_C CApaAppFinder::CApaAppFinder()
+	{
+	}
+
+/* Reserved for future use */
+EXPORT_C void CApaAppFinder::CApaAppFinder_Reserved1()
+	{
+	}
+
+/* Reserved for future use */
+EXPORT_C void CApaAppFinder::CApaAppFinder_Reserved2()
+	{
+	}
+	
+//
+// CApaAppServiceInfoArray
+//
+
+EXPORT_C CApaAppServiceInfoArray::CApaAppServiceInfoArray()
+	{
+	}
+	
+EXPORT_C void CApaAppServiceInfoArray::CApaAppServiceInfoArray_Reserved1()
+	{
+	}
+
+EXPORT_C void CApaAppServiceInfoArray::CApaAppServiceInfoArray_Reserved2()
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apparc/APAMDR.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,676 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "APASTD.H" // Panics etc.
+#include <apadbase.h>
+#include <apamdr.h>
+#include <apparc.h>
+#include <apgdoor.h>
+
+#include <s32stor.h>
+#include <s32file.h>
+#include <s32std.h>
+#include <s32mem.h>
+
+#ifdef _UNICODE
+#define KUidApaDoorBaseStream KUidApaDoorBaseStream16
+#else
+#define KUidApaDoorBaseStream KUidApaDoorBaseStream8
+#endif
+
+#ifdef _UNICODE
+const TUid KUidApaDoorBaseStream16={0x10003A36};
+#else
+const TUid KUidApaDoorBaseStream8={0x10000146};
+#endif
+const TInt KHugeGranularity=4096; // 4k granularity for the door's host buffer
+
+////////////////////////////////////
+// HBufBuf
+////////////////////////////////////
+
+class HBufBuf : public TBufBuf
+	{
+public:
+	static HBufBuf* NewL(CBufBase& aBuf,TInt aPos,TInt aMode=ERead|EWrite);
+private:
+	void DoRelease();
+	};
+
+
+HBufBuf* HBufBuf::NewL(CBufBase& aBuf,TInt aPos,TInt aMode)
+//
+// Create a pre-set buffer stream buffer.
+//
+	{
+	HBufBuf* buf=new(ELeave) HBufBuf;
+	buf->Set(aBuf,aPos,aMode);
+	return buf;
+	}
+
+
+void HBufBuf::DoRelease()
+//
+// Finished with this stream buffer.
+//
+	{
+	delete this;
+	}
+
+
+////////////////////////////////////
+// CApaDoorBase
+////////////////////////////////////
+
+EXPORT_C CApaDoorBase::CApaDoorBase()
+	{
+	}
+
+EXPORT_C void CApaDoorBase::ExternalizeBaseStreamL(CStreamStore& aStore,CStreamDictionary& aStreamDict)const
+/** Externalises the information contained in this base class to a stream in the 
+specified store.
+
+The resulting stream ID is associated with an internal UID, and placed in 
+the specified stream dictionary.
+
+@publishedAll
+@released
+@param aStore The store to contain the stream.
+@param aStreamDict The stream dictionary to contain the stream ID (and an associated 
+internal UID). */
+	{
+	RStoreWriteStream stream;
+	TStreamId id=stream.CreateLC(aStore);
+	//
+	// write the format
+	if (iFormat==ETemporarilyIconic)
+		stream.WriteInt8L(EGlassDoor);
+	else
+		stream.WriteInt8L(iFormat);
+	//
+	// write the size
+	TSize size;
+	if (iFormat==ETemporarilyIconic)
+		size = GlassDoorSize();
+	else
+		GetSizeInTwips(size);
+	stream<< size;
+	// 
+	// write the source and close
+	stream<< iSource;
+	stream.CommitL();
+	CleanupStack::PopAndDestroy(); // stream
+	aStreamDict.AssignL(KUidApaDoorBaseStream,id);
+	}
+
+
+
+EXPORT_C TSize CApaDoorBase::InternalizeBaseStreamL(const CStreamStore& aStore,const CStreamDictionary& aStreamDict)
+/** Internalises the information for this base class from a stream in the specified 
+store, and returns the size of the icon or glass door.
+
+The stream ID is extracted from the specified stream dictionary. The UID associated 
+with the stream ID is the same as that used when externalising.
+
+@publishedAll 
+@released
+@param aStore The store containing the stream.
+@param aStreamDict The steam dictionary containing the stream ID.
+@return The size of the icon or glass door, in twips. */
+	{
+	TStreamId id=aStreamDict.At(KUidApaDoorBaseStream);
+	if (id==KNullStreamId)
+		User::Leave(KErrCorrupt); //  there is no base stream - the file is not valid (used to panic EPanicNoBaseDoorStream)
+	RStoreReadStream stream;
+	stream.OpenLC(aStore,id);
+	iFormat = (TFormat)stream.ReadInt8L();
+	__ASSERT_DEBUG(iFormat==EIconic || iFormat==EGlassDoor,Panic(EDPanicIllegalDoorFormat));
+	TSize size;
+	stream>> size;
+	stream>> iSource;
+	CleanupStack::PopAndDestroy(); // stream
+	return size;
+	}
+
+// Virtual functions from CPicture
+
+EXPORT_C TStreamId CApaDoorBase::StoreL(CStreamStore& aStore) const
+/** Stores the Embedded Document to the specified store.
+
+@publishedAll 
+@released
+@param aStore The store containing the stream.
+@return The ID of the (head) stream used to store the Embedded Document */
+	{
+	return CPicture::StoreL(aStore);
+	}
+
+EXPORT_C void CApaDoorBase::SetScaleFactor(TInt aScaleFactorWidth,TInt aScaleFactorHeight)
+/** Sets the Embedded Document's scale factors
+
+@publishedAll 
+@released
+@param aScaleFactorWidth The width scale factor, in percent
+@param aScaleFactorHeight The height scale factor, in percent
+*/
+	{
+	CPicture::SetScaleFactor(aScaleFactorWidth, aScaleFactorHeight);
+	}
+
+EXPORT_C void CApaDoorBase::SetCropInTwips(const TMargins& aMargins)
+/** Sets the cropping margins of a Embedded Document in twips.
+These are relative to the original unscaled size of the Embedded Document.
+
+@publishedAll 
+@released
+@param aMargins The cropping margins of the Embedded Document, in twips
+*/	
+	{
+	CPicture::SetCropInTwips(aMargins);
+	}
+	
+EXPORT_C TPictureCapability CApaDoorBase::Capability() const
+/** Gets the Embedded Document's capabilities.
+These include whether it is scalable and croppable.
+
+@publishedAll 
+@released
+@return The capabilities of the Embedded Document
+*/
+	{
+	return CPicture::Capability();
+	}
+	
+EXPORT_C void CApaDoorBase::GetCropInTwips(TMargins& aMargins) const 
+/** Gets the cropping margins of a Embedded Document in twips.
+These margins are relative to the original unscaled size of the Embedded Document.
+
+@publishedAll 
+@released
+@param aMargins The cropping margins of the Embedded Document, in twips 
+*/
+	{
+	CPicture::GetCropInTwips(aMargins);
+	}
+
+EXPORT_C TInt CApaDoorBase::ScaleFactorWidth() const
+/** Gets the Embedded Document's width scale factor.
+
+@publishedAll 
+@released
+@return The width scale factor, in percent
+*/	
+	{
+	return CPicture::ScaleFactorWidth();
+	}
+
+EXPORT_C TInt CApaDoorBase::ScaleFactorHeight() const
+/** Gets the Embedded Document height scale factor.
+
+@publishedAll 
+@released
+@return The height scale factor, in percent
+*/
+	{
+	return CPicture::ScaleFactorHeight();
+	}
+
+EXPORT_C TBool CApaDoorBase::LineBreakPossible(TUint aClass,TBool aBeforePicture,TBool aHaveSpaces) const
+/** States whether a line break is possible, either before or after an Embedded Document.
+The default implementation returns ETrue, implying that there is a break opportunity both before and after the Embedded Document, whether or not a space is present.
+This may be overridden for special types of Embedded Documents.
+
+@publishedAll 
+@released
+@param aClass The line breaking class of the adjacent character
+@param aBeforePicture ETrue, if the adjacent character is before the Embedded Document; EFalse, if the adjacent character is afterwards
+@param aHaveSpaces ETrue, if spaces occur between the adjacent character and the Embedded Document; EFalse, otherwise
+@return ETrue, if a line break is possible; EFalse, otherwise. 
+*/	
+	{
+	return CPicture::LineBreakPossible(aClass, aBeforePicture, aHaveSpaces);
+	}
+
+EXPORT_C TBool CApaDoorBase::NativePixelSize(TSize& aPixelSize)
+/** Returns the native pixel size of the bitmap. 
+
+Derived classes might be implemented as bitmaps, in that case it might be interesting to know this.
+@publishedAll 
+@released
+@param aPixelSize The pixel size
+@return TBool ETrue, if the derived classes are implemented as bitmaps; EFalse, otherwise.
+*/	
+	{
+	return CPicture::NativePixelSize(aPixelSize);
+	}
+
+/** Reserved for future use */
+EXPORT_C void CApaDoorBase::CApaDoorBase_Reserved1()
+	{
+	}
+
+/** Reserved for future use */
+EXPORT_C void CApaDoorBase::CApaDoorBase_Reserved2()
+	{
+	}
+
+///////////////////////////////////
+// TApaModelDoorFactory
+///////////////////////////////////
+
+EXPORT_C TApaModelDoorFactory::TApaModelDoorFactory(const MApaModelHeaderFactory* aFactory)
+	:iHeaderFactory(aFactory)
+/** Constructs a door factory object.
+
+@param aFactory A pointer to a factory object for constructing the application 
+model wrapper object, also known as the application model header, a CApaModelHeader 
+type. The application model wrapper is provided by the application model (not 
+the application UI), and supplies the knowledge for internalizing the application 
+model data from an embedded store.
+@see CApaModelHeader
+@see MApaModelHeaderFactory */
+	{}
+
+
+EXPORT_C void TApaModelDoorFactory::NewPictureL(TPictureHeader& aPictureHeader,const CStreamStore& aPictureStore)const
+/** Constructs and restores an application's door (picture) from a stream in the 
+specified store.
+
+The restored door is a CApaModelDoor type object.
+
+@param aPictureHeader The header identifying the door to be restored. The 
+UID identifying the door must be KUidPictureTypeDoor, otherwise the function 
+leaves with KErrNotSupported. On entry, the door picture must be represented 
+by a stream ID, otherwise the function leaves with KErrBadHandle; on return, 
+the door picture is represented by a pointer to an internalized CApaModelDoor 
+object.
+@param aPictureStore The store from which the door will be restored.
+@see TPictureHeader::iPicture */
+	{
+	if (aPictureHeader.iPictureType!=KUidPictureTypeDoor)
+		User::Leave(KErrNotSupported); // wrong type
+	if (!aPictureHeader.iPicture.IsId())
+		User::Leave(KErrBadHandle); // not an id - can't restore
+	//
+	// create and restore the door
+	TStreamId id = aPictureHeader.iPicture.AsId();
+	aPictureHeader.iPicture = CApaModelDoor::NewL(aPictureStore,id,iHeaderFactory);
+	}
+
+
+///////////////////////////////////
+// CApaModelDoor
+///////////////////////////////////
+
+
+EXPORT_C CApaModelDoor* CApaModelDoor::NewL(CApaModelHeader* aHeader)
+/** Creates a model door object.
+
+@param aHeader A pointer to an existing concrete application model wrapper 
+object.
+@return A pointer to the new model door object. */
+	{
+	CApaModelDoor* self = new(ELeave) CApaModelDoor(aHeader);
+	return self;
+	}
+
+
+EXPORT_C CApaModelDoor* CApaModelDoor::NewLC(CApaModelHeader* aHeader)
+/** Creates a model door object, and puts a pointer to it onto the cleanup stack.
+
+@param aHeader A pointer to an existing concrete application model wrapper 
+object.
+@return A pointer to the new model door object. */
+	{
+	CApaModelDoor* self = CApaModelDoor::NewL(aHeader);
+	CleanupStack::PushL(self);
+	return self;
+	}
+
+
+EXPORT_C CApaModelDoor* CApaModelDoor::NewL(const CStreamStore& aStore,TStreamId aHeadStreamId,const MApaModelHeaderFactory* aFactory)
+/** Creates a model door object and restores it from an embedded store within the 
+specified store.
+
+@param aStore The store from which the model door is to be restored.
+@param aHeadStreamId The head stream ID. This is the ID of the stream containing 
+the stream dictionary which is restored as part of the process of creating 
+this model door object. The stream dictionary contains the ID of the stream 
+hosting the embedded store.
+@param aFactory A pointer to a factory object for constructing the application 
+model wrapper object, also known as the application model header, a CApaModelHeader 
+type.
+@return A pointer to the new model door object.
+@see MApaModelHeaderFactory */
+	{
+	CApaModelDoor* self = new(ELeave) CApaModelDoor();
+	CleanupStack::PushL(self);
+	self->RestoreL(aStore,aHeadStreamId,aFactory);
+	CleanupStack::Pop();
+	return self;
+	}
+
+
+CApaModelDoor::CApaModelDoor()
+	{__DECLARE_NAME(_S("CApaModelDoor"));}
+
+
+CApaModelDoor::CApaModelDoor(CApaModelHeader* aHeader)
+	:iModelHeader(aHeader)
+	{}
+
+
+EXPORT_C CApaModelDoor::~CApaModelDoor()
+/** Destructor.
+
+Frees all resources owned by the object, prior to its destruction. */
+	{
+	delete iModelHeader;
+	delete iStore;
+	delete iStoreHost;
+	}
+
+
+EXPORT_C TStreamId CApaModelDoor::StoreL(CStreamStore& aTargetStore)const
+/** Stores the model data in the specified store as an embedded store.
+
+The function stores the model data, if the model exists in memory, otherwise, 
+it simply copies the stream containing the embedded document into the specified 
+store.
+
+@param aStore The store in which the model data is to be stored.
+@return The stream ID of the head stream for the embedded model data. This 
+stream contains the stream dictionary through which the embedded data and 
+its door can be restored. */
+	{
+	// create stream dictionary
+	CStreamDictionary* streamDic = CStreamDictionary::NewLC();
+	//
+	// stream out door's state
+	ExternalizeBaseStreamL(aTargetStore,*streamDic);
+	//
+	// store the model 
+	TStreamId id;
+	RStoreWriteStream stream;
+	if (iModelHeader)
+		{
+		// create an embedded store in a new write stream
+		id = stream.CreateL(aTargetStore);
+		CEmbeddedStore* target=CEmbeddedStore::NewLC(stream); // takes ownership of stream
+		streamDic->AssignL(KUidApaDoorDocStream,id);
+		// store the model
+		CStreamDictionary* rootDict=CStreamDictionary::NewLC();
+		iModelHeader->StoreL(*target,*rootDict);
+		CApaProcess::WriteRootStreamL(*target,*rootDict,iModelHeader->AppId());
+		CleanupStack::PopAndDestroy(); // rootDict
+		// close the new embedded store
+		target->CommitL();
+		CleanupStack::PopAndDestroy(); // target
+		}
+	else if (iStore)
+		{
+		RStoreWriteStream trg;
+		id = trg.CreateLC(aTargetStore);
+		CopyStoreL(*iStore,trg);
+		CleanupStack::PopAndDestroy(); // trg
+		streamDic->AssignL(KUidApaDoorDocStream,id);
+		}
+	else 
+		Panic(EPanicNoModelHeaderWhenStoring); // impossible situation
+	//
+	// store the stream dictionary and return its stream id
+	id = stream.CreateLC(aTargetStore);
+	stream<< *streamDic;
+	stream.CommitL();
+	CleanupStack::PopAndDestroy(2); // stream,streamDic
+	return id;
+	}
+
+
+void CApaModelDoor::CopyStoreL(const CEmbeddedStore& aSourceStore,RWriteStream& aTargetStream)
+// static method
+// copies an embedded store containing a doc to aTargetStream
+//
+	{
+	// read the contents of aSourceStore's rootstream (so I can write it out in a mo')
+	CStreamDictionary* root=ReadStreamDictionaryLC(aSourceStore,aSourceStore.Root());
+	//
+	// copy the source store directly
+	MStreamBuf* host=aSourceStore.Host();
+	TStreamPos pos=aSourceStore.Position(aSourceStore.Root());
+	host->SeekL(host->ERead,EStreamBeginning);
+	RReadStream stream(host);
+	aTargetStream.WriteL(stream,pos.Offset());
+	//
+	// write the root stream
+	aTargetStream<< *root;
+	aTargetStream.CommitL();
+	CleanupStack::PopAndDestroy(); // root
+	}
+
+
+EXPORT_C void CApaModelDoor::RestoreL(const CStreamStore& aSourceStore,TStreamId aHeadStreamId,const MApaModelHeaderFactory* aFactory)
+/** Restores the embedded model data from the specified store.
+
+@param aStore The store from which the embedded model data is to be restored.
+@param aHeadStreamId The stream ID of the head stream for the embedded model 
+data. This stream contains the stream dictionary through which the embedded 
+model data and its door can be restored.
+@param aFactory A pointer to a factory object for constructing the application 
+model wrapper object, also known as the application model header, a CApaModelHeader 
+type. The application model wrapper is provided by the application model (not 
+the application UI), and supplies the knowledge for internalizing the application 
+model data from an embedded store. The pointer must not be null, otherwise 
+the function raises an APPARC 22 panic. */
+	{
+	__ASSERT_ALWAYS(aFactory,Panic(EPanicNoFactory));
+	//
+	delete iStore;
+	delete iStoreHost;
+	iStore=NULL;
+	iStoreHost = NULL;
+	//
+	// internalize the streamDic from the headstream
+	CStreamDictionary* streamDic=ReadStreamDictionaryLC(aSourceStore,aHeadStreamId);
+	//
+	// internalize the door's state
+	TSize size=InternalizeBaseStreamL(aSourceStore,*streamDic);
+	SetSizeInTwips(size);
+	//
+	// internalize the embedded store
+	RStoreReadStream src;
+	src.OpenL(aSourceStore,streamDic->At(KUidApaDoorDocStream));
+	CleanupStack::PopAndDestroy(); // streamDic
+	streamDic = NULL;
+	iStore = CEmbeddedStore::FromL(src);
+	//
+	// check for a security stream, then internalize the model
+	TRAP_IGNORE(InternalizeModelL(*aFactory)); //lint !e613 Possible use of null pointer - Asserted above
+	// ignore any leave, we still have the data in the store to fall back on
+	}
+
+
+void CApaModelDoor::InternalizeModelL(const MApaModelHeaderFactory& aFactory)
+// internalizes the model if the data is not encrypted
+// if the factory does not recognize the doc type, NewHeaderL() will leave (probably KErrNotSupported)
+	{	
+	CStreamDictionary* streamDic = ReadStreamDictionaryLC(*iStore,iStore->Root());
+	if (streamDic->At(KUidSecurityStream)==KNullStreamId)
+		{// not encrypted, so internalize the model
+		TApaAppIdentifier appId = CApaProcess::ReadAppIdentifierL(*iStore,*streamDic);
+		iModelHeader = aFactory.NewHeaderL(*iStore,*streamDic,appId);
+		}
+	CleanupStack::PopAndDestroy(); // streamDic
+	}
+
+
+CStreamDictionary* CApaModelDoor::ReadStreamDictionaryLC(const CStreamStore& aSourceStore,TStreamId aStreamId)
+// static method
+//
+	{
+	// read the stream dic from the doc's root stream
+	CStreamDictionary* streamDic=CStreamDictionary::NewLC();
+	RStoreReadStream stream;
+	stream.OpenLC(aSourceStore,aStreamId);
+	stream>> *streamDic;
+	CleanupStack::PopAndDestroy(); // root
+	return streamDic;
+	}
+
+
+TSize CApaModelDoor::GlassDoorSize()const
+	{
+	TSize size;
+	GetSizeInTwips(size);
+	return size;
+	}
+
+
+EXPORT_C void CApaModelDoor::DetachFromStoreL(TDetach aDegree)
+/** Restores the model to the specified degree.
+
+@param aDegree The degree to which restoration is needed. */
+	{
+	if (iModelHeader)
+		{
+		iModelHeader->DetachFromStoreL(aDegree);
+		if (!iStoreHost)
+			{
+			delete iStore;
+			iStore = NULL;
+			}
+		}
+	else if (!iStoreHost)
+		{
+		if (aDegree==EDetachDraw)
+			{
+			delete iStore;
+			iStore = NULL;
+			// now all I can do is draw as I am, any attempt to change me will result in a panic
+			}
+		else
+			{
+			__ASSERT_ALWAYS(iStore,Panic(EPanicNoStoreOnDetach));
+			// instantiate the mem buffer, and a stream to write to it
+			CBufSeg* bufSeg = CBufSeg::NewL(KHugeGranularity);
+			CleanupStack::PushL(bufSeg);
+			HBufBuf* buf=HBufBuf::NewL(*bufSeg,0);
+			RWriteStream writeStream(buf);
+			writeStream.PushL();
+			// write the store to the mem buffer
+			CopyStoreL(*iStore,writeStream);
+			CleanupStack::Pop(2); // bufSeg,writeStream
+			//
+			// set iStoreHost as host for the embedded store
+			MStreamBuf* host=iStore->Host();
+			__ASSERT_ALWAYS(host!=NULL,Panic(EDPanicNoHostForStore));
+			iStore->Detach();
+			host->Release(); //lint !e613 Possible use of null pointer - Asserted above
+			iStore->Reattach(buf);
+			iStoreHost = bufSeg;
+			}
+		}
+	}
+
+
+
+EXPORT_C void CApaModelDoor::Draw(CGraphicsContext& /*aGc*/,const TPoint& /*aTopLeft*/,const TRect& /*aClipRect*/,
+						MGraphicsDeviceMap* /*aMap*/)const
+/**
+Not supported; if called, raises an APPARC 17 panic.
+@removed
+*/
+	{
+	Panic(EPanicNotSupported);
+	}
+
+
+
+
+EXPORT_C void CApaModelDoor::ExternalizeL(RWriteStream& /*aStream*/)const
+/**
+Not supported; if called, raises an APPARC 17 panic. 
+@removed
+*/
+	{
+	Panic(EPanicNotSupported);
+	}
+
+
+EXPORT_C void CApaModelDoor::GetOriginalSizeInTwips(TSize& aSize)const
+/** Gets the door's original size, in twips.
+
+@param aSize This size, in twips. */
+	{
+	aSize = TSize(500,500); // ?
+	}
+
+
+EXPORT_C void CApaModelDoor::SetScaleFactor(TInt aScaleFactorWidth,TInt aScaleFactorHeight)
+/** Sets the door's scale factors.
+
+@param aScaleFactorWidth The width scale factor, in percent.
+@param aScaleFactorHeight The height scale factor, in percent. */
+	{
+	iScaleFactor.iWidth = aScaleFactorWidth;
+	iScaleFactor.iHeight = aScaleFactorHeight;
+	}
+
+
+EXPORT_C TInt CApaModelDoor::ScaleFactorWidth()const
+/** Gets the door's width scale factor.
+
+@return The width scale factor, in percent. */
+	{
+	return iScaleFactor.iWidth;
+	}
+
+
+EXPORT_C TInt CApaModelDoor::ScaleFactorHeight()const
+/** Gets the door's height scale factor.
+
+@return The height scale factor, in percent. */
+	{
+	return iScaleFactor.iHeight;
+	}
+
+// CApaModelHeader
+
+/** Constructor for CApaModelHeader */
+EXPORT_C CApaModelHeader::CApaModelHeader()
+	{
+	}
+
+/** Reserved for future use */
+EXPORT_C void CApaModelHeader::Reserved_1()
+	{}
+
+/** Reserved for future use */	
+EXPORT_C void CApaModelHeader::Reserved_2()
+	{}
+
+// MApaModelHeaderFactory
+
+/** Constructor for MApaModelHeaderFactory */
+EXPORT_C MApaModelHeaderFactory::MApaModelHeaderFactory()
+	{}
+
+/** Reserved for future use */
+EXPORT_C void MApaModelHeaderFactory::MApaModelHeaderFactory_Reserved1()
+	{}
+
+/** Reserved for future use */
+EXPORT_C void MApaModelHeaderFactory::MApaModelHeaderFactory_Reserved2()
+	{}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apparc/APASTD.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,26 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "APASTD.H"
+#include <f32file.h>
+
+GLDEF_C void Panic(TApaPanic aPanic)
+//
+// Panic the process with APPARC as the category.
+//
+	{
+	_LIT(KAppArcPanic,"APPARC");
+	User::Panic(KAppArcPanic,aPanic);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apparc/APASTD.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,86 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+#if !defined(__APASTD_H__)
+#define __APASTD_H__
+
+#if !defined(__E32STD_H__)
+#include <e32std.h>
+#endif
+
+enum TApaPanic
+	{
+	EPanicApplicationAlreadyExists,
+	EPanicDocumentNotCreated,
+	EPanicCapabilityNotSet,
+	EPanicNotExactlyOneDoc,
+	EPanicMoreThanOneDoc,
+	EPanicAppListNotEmpty,
+	EPanicDocListNotEmpty,
+	EPanicFileNameTooLong,
+	EPanicNoGlassDoorMethodSupplied,
+	EPanicNoModelHeaderWhenStoring,
+	EPanicNoBaseDoorStream,
+	EPanicAppNotInList,
+	EPanicNoCleanupItem,
+	EPanicNoApplication,
+	EPanicNoAppStarter,
+	EPanicNoAppLocator,
+	EPanicNoIconInDoor,
+	EPanicNotSupported,
+	EPanicNoStreamDic,
+	EPanicNoAppFinder,
+	EPanicNoDocument,
+	EPanicNoCaption,
+	EPanicNoFactory,
+	EPanicNoStore,
+	EPanicNoStoreOnDetach,
+	EPanicWrongStoreType,
+	//
+	EDPanicNoApp,
+	EDPanicDocWithNoApp,
+	EDPanicRemovingNullApp,
+	EDPanicIllegalDoorFormat,
+	EDPanicNoHostForStore,
+	EDPanicWrongCommand,
+	//
+	EPanicEmbeddabilityOutOfRange,
+	//
+	EPanicBadApplicationFactoryType,
+	EPanicUidsDoNotMatch,
+	//
+	EPanicServerDifferentiatorZero,
+	//
+	EPanicInvalidHandle,
+	EPanicHandleAlreadySet,
+	EPanicInvalidSubSession,
+	EPanicEnvironmentSlotNotForPublicUse,
+	EPanicBadHeapCellRestorerState,
+	//
+	EPanicInvalidScreenNumber,
+	EPanicNullPointer,
+	EDPanicInvalidToken,
+	EDPanicNoAppRemover,
+	EDPanicNoProcess,
+	EDPanicNoAppHolder,
+	EDPanicInvalidVersionNumber
+	};
+
+
+GLREF_C void Panic(TApaPanic aPanic);
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apparc/APPARC.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1387 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <apparc.h> // stuff everyone will want ie most things
+#include <apacln.h> // CleanupStack protection for CApaDocument
+#include "APADLL.H" // CApaDll CApaExe CApaAppHolder
+#include "APASTD.H" // Panics etc.
+#include <e32uid.h> // KExecutableImageUid
+
+#include <s32stor.h>
+#include <s32file.h>
+#include <s32std.h>
+
+#ifdef USING_ECOM_RECOGS
+#include <ecom/ecom.h>
+#include <ecom/implementationinformation.h>
+#endif
+
+#include "../apparc/TRACE.H"
+
+const TInt KAppProcessArrayGranularity(1);
+
+_LIT(KApplicationLocation,"\\sys\\bin\\");
+  
+/////////////////////////////
+// Doc cleanup method
+/////////////////////////////
+
+EXPORT_C void TApaDocCleanupItem::DoCleanup(TAny* aPtr)
+	{
+	__ASSERT_ALWAYS(aPtr,Panic(EPanicNoCleanupItem));
+	TApaDocCleanupItem* cleanup = reinterpret_cast<TApaDocCleanupItem*>(aPtr);
+	__ASSERT_ALWAYS(cleanup->iApaProcess,Panic(EPanicNoCleanupItem));//lint !e613 Possible use of null pointer - Asserted above
+	cleanup->iApaProcess->DestroyDocument(cleanup->iApaDoc); //lint !e613 Possible use of null pointer - Asserted above
+	}
+
+
+/////////////////////////////
+// CApaAppHolder
+/////////////////////////////
+
+CApaAppHolder::CApaAppHolder()
+	{}
+
+
+CApaAppHolder::~CApaAppHolder()
+	{
+	}
+
+void CApaAppHolder::UpdateAppsRefToThis()
+	{
+	CApaApplication* app = Application();
+	__ASSERT_ALWAYS(app,Panic(EPanicNoApplication));
+	app->iAppHolder = this;	//lint !e613 Possible use of null pointer - Asserted above
+	}
+
+#ifdef USING_ECOM_RECOGS
+/////////////////////////////
+// CApaExe
+/////////////////////////////
+
+CApaExe::CApaExe()
+	{}
+
+CApaExe::~CApaExe()
+	{
+	delete iAppName;
+	delete iApplication;
+	}
+
+TFileName CApaExe::FileName()const
+	{
+	if (iAppName)
+		{
+		return *iAppName;
+		}
+	else
+		{
+		return KNullDesC();
+		}
+	}
+
+TUid CApaExe::Uid()const
+	{
+	return iFileUid;
+	}
+
+CApaApplication* CApaExe::Application() const
+	{
+	return iApplication;
+	}
+
+void CApaExe::CreateApplicationL(TApaApplicationFactory aApplicationFactory)
+	{
+	__ASSERT_ALWAYS(!iApplication,Panic(EPanicApplicationAlreadyExists));
+	iApplication = aApplicationFactory.CreateApplicationL();
+	iFileUid = aApplicationFactory.AppFileUid();
+	User::LeaveIfNull(iApplication);
+	iAppName = aApplicationFactory.AppFileNameL();
+	UpdateAppsRefToThis();
+	}
+
+#endif // USING_ECOM_RECOGS
+
+EXPORT_C void CApaDocument::OpenFileL(CFileStore*&, RFile&)
+	{
+	}
+
+EXPORT_C void CApaDocument::Reserved_2()
+	{}
+
+
+/////////////////////
+// CApaApplication
+/////////////////////
+
+/** Constructor for CApaApplication */
+EXPORT_C CApaApplication::CApaApplication()
+	{
+	}
+
+EXPORT_C TFileName CApaApplication::AppFullName()const
+/** Returns the full name and path of the application.
+
+The default implementation returns the full path name of the application DLL.
+
+An application can provide its own implementation. 
+
+@return Full path name of the application.
+@see CApaApplication::DllName() */
+	{
+	return DllName();
+	}
+
+
+EXPORT_C TFileName CApaApplication::DllName()const
+/** Returns the full name and path of the loaded application DLL.
+
+@return Full path name of the application DLL. */
+	{
+	__ASSERT_DEBUG(iAppHolder, Panic(EDPanicNoAppHolder));
+	return iAppHolder->FileName();
+	}
+
+
+EXPORT_C TInt CApaApplication::GenerateFileName(RFs& aFs,TFileName& aRootName)
+/** Generates a unique filename based on the file name contained within the specified 
+full path name.
+
+If necessary, the function creates the directory structure that is defined 
+in the specified full path name.
+
+If the file name does not yet exist, then this is the file name chosen. If 
+this file name already exists, then a file name of the form: name(nn) is generated, 
+where nn are decimal digits. The value of nn is incremented until a name is 
+generated that is unique within the directory structure. A minimum of two 
+decimal digits is generated.
+
+The function is used by the UI framework.
+
+@param aFs Handle to a file server session. 
+@param aRootName The full path name.
+@return KErrNone if successful, otherwise one of the other system-wide error 
+codes. Specifically: KErrBadName if the file name portion of the specified 
+full path name has invalid format; KErrArgument if the drive, path or file 
+name parts are missing from the specified full path name; KErrOverflow if 
+the generated filename becomes too long; KErrNoMemory if there is insufficient 
+memory to perform the operation.
+@see CEikAppUi */
+	{
+	// check that filename is valid
+	if (!aFs.IsValidName(aRootName))
+		return KErrBadName;
+	//
+	// check that a drive, path and root filename have been specified
+	TParsePtr parsePtr(aRootName);
+	if (!parsePtr.DrivePresent() || !parsePtr.PathPresent() || !parsePtr.NamePresent())
+		return KErrArgument;
+	//
+	// create the path if necessary
+	TInt ret=aFs.MkDirAll(parsePtr.DriveAndPath());
+	if (ret!=KErrNone && ret!=KErrAlreadyExists)
+		return ret;
+	//
+	// Create the Rbuf object to hold a filename (return if no mem available)
+	RBuf newName;
+	ret = newName.Create(aRootName, KMaxFileName+8);
+	if (ret!=KErrNone)
+		return KErrNoMemory;
+	//	
+	// generate a valid filename that doesn't already exist...
+	TEntry entry;
+	TInt i=1;
+	_LIT(KFormatStringOne,"%S%S(%02d)%S");
+	TBuf<16> format;
+	format=KFormatStringOne;
+	while (aFs.Entry(newName,entry)==KErrNone)		// Continue until DoesNotExist or PathDoesNotExist, etc
+		{
+		if (i>=100)
+			{
+			_LIT(KFormatStringTwo,"%S%S(%d)%S");
+			format=KFormatStringTwo;
+			}
+		TPtrC driveAndPath=parsePtr.DriveAndPath();
+		TPtrC name=parsePtr.Name();
+		TPtrC ext=parsePtr.Ext();
+		newName.Format(format,&driveAndPath,&name,i++,&ext);
+		if (newName.Length()>KMaxFileName)
+			{
+			newName.Close();
+			return KErrOverflow;
+			}
+		}
+	//
+	// set the new filename and return
+	aRootName = newName;
+	newName.Close();
+	return KErrNone;
+	}
+
+
+EXPORT_C CDictionaryStore* CApaApplication::OpenIniFileL(RFs& aFs)const
+/** Opens the .ini file associated with the application, constructs the dictionary 
+store object and returns a pointer to it.
+
+The implementation of this function is provided by the OpenIniFileLC() function. 
+The function pops the pointer returned by OpenIniFileLC() from the cleanup 
+stack.
+
+@param aFs Handle to a file server session. 
+@return A pointer to the dictionary store object representing the application's 
+.ini file. 
+@see CApaApplication::OpenIniFileLC() */
+	{
+	CDictionaryStore* store=OpenIniFileLC(aFs);
+	CleanupStack::Pop(); // store
+	return store;
+	}
+
+EXPORT_C CApaApplication::~CApaApplication()
+	{
+#ifdef USING_ECOM_RECOGS
+	if (iDtorKey!=TUid::Null()) // only some CApaApplication objects are ECom objects (i.e. only those corresponding to embedded applications, not top-level applications)
+		{
+		REComSession::DestroyedImplementation(iDtorKey);
+		}
+#endif // USING_ECOM_RECOGS
+	iAppHolder = NULL;
+	}
+
+EXPORT_C void CApaApplication::NewAppServerL(CApaAppServer*& /*aAppServer*/)
+/** Virtual function called by the framework when the application
+has been launched as a server application.
+Applications that wish to be used as server applications must
+override this function to return their implemetation of the server.
+@param aAppServer The server pointer to be set. */
+	{
+	User::Leave(KErrNotSupported);
+	}
+
+/** Reserved for future use */
+EXPORT_C void CApaApplication::CApaApplication_Reserved1()
+	{
+	}
+
+/** Reserved for future use */
+EXPORT_C void CApaApplication::CApaApplication_Reserved2()
+	{
+	}
+
+/////////////////////////////
+// CApaDocument
+/////////////////////////////
+
+/** Constructor for CApaDocument */
+EXPORT_C CApaDocument::CApaDocument()
+	{
+	}
+
+EXPORT_C CApaDocument::CApaDocument(CApaApplication& aApp,CApaProcess& aProcess)
+	: iApplication(&aApp),
+	iApaProcess(&aProcess)
+/** Constructs the document object with the specified application and process.
+
+Derived classes must define and implement a constructor through which both 
+the associated application and process can be specified. A typical implementation 
+calls this constructor through a constructor initialization list.
+
+@param aApp The application.
+@param aProcess The process.
+@see CEikDocument */
+	{}
+
+
+EXPORT_C CApaDocument::~CApaDocument()
+/** Destructor.
+
+The implementation is empty. */
+	{
+	iContainer = NULL;
+	iApplication = NULL;
+	iApaProcess = NULL;
+	}
+
+
+EXPORT_C CApaDocument::TCapability CApaDocument::Capability() const
+/** Gets the document's capabilities.
+
+Capabilities are encapsulated by an instance of a TCapability class, a public 
+class defined inside this class.
+
+The default implementation returns a default TCapability object, indicating 
+that the document does not support any of the defined capabilities.
+
+If a document does support one or more of the capabilities, it should override 
+this function to return a suitably initialised object.
+
+@return The document's capabilities */
+	{
+	return TCapability();
+	}
+
+
+EXPORT_C void CApaDocument::ValidatePasswordL() const
+/** Checks the document password.
+
+The default implementation is empty.
+
+If a document is intended to be password protected, the UI application should 
+provide an implementation that forces the user to enter the password and validate 
+the input.
+
+If the document is protected by a password and the password entered by the 
+user is incorrect, the function should leave with KErrLocked, otherwise it 
+should just return. */
+	{}
+
+
+EXPORT_C CPicture* CApaDocument::GlassPictureL()
+// Return handle to glass picture, creating one if not already created.
+// returns NULL as glass pictures are not supported by default
+/** Gets an object that can draw a representation of the document's content.
+
+If the document supports being embedded as a glass door, then the UI application 
+must provide an implementation for this function.
+
+The default implementation raises an APPARC 8 panic.
+
+@return A pointer to a glass door. */
+	{
+	Panic(EPanicNoGlassDoorMethodSupplied);
+	//
+	return NULL;
+	}
+
+
+EXPORT_C void CApaDocument::ExternalizeL(RWriteStream& /*aStream*/)const
+	{}
+
+EXPORT_C CApaDocument::TCapability::TCapability()
+	:iCapability(0),TCapability_Reserved1(0)
+/** Constructs a default capability object.
+
+All capabilities are marked as "not supported". */
+	{}
+
+/////////////////////////////
+// TApaAppHolderInfo
+/////////////////////////////
+
+class TApaAppHolderInfo
+	{
+public:
+	TApaAppHolderInfo(CApaAppHolder* aAppHolder);
+public:
+	CApaAppHolder* iAppHolder;
+	TBool iToBeRemoved;
+	};
+
+TApaAppHolderInfo::TApaAppHolderInfo(CApaAppHolder* aAppHolder)
+	:iAppHolder(aAppHolder), iToBeRemoved(EFalse)
+	{
+	}
+
+/////////////////////////////
+// CApaParentProcessMonitor
+/////////////////////////////
+
+class CApaParentProcessMonitor : public CActive
+	{
+public: // Construction / destruction
+	static CApaParentProcessMonitor* NewL(TProcessId aProcessId);
+	~CApaParentProcessMonitor();
+	void ConstructL();
+private:
+	CApaParentProcessMonitor(TProcessId aProcessId);
+public: // From CActive
+	void RunL();
+	void DoCancel();
+private:
+	TProcessId iProcessId;
+	RProcess iProcess;
+	};
+
+CApaParentProcessMonitor* CApaParentProcessMonitor::NewL(TProcessId aProcessId)
+	{
+	CApaParentProcessMonitor* self=new (ELeave) CApaParentProcessMonitor(aProcessId);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+CApaParentProcessMonitor::CApaParentProcessMonitor(TProcessId aProcessId)
+	: CActive(EPriorityLow)
+	{
+	iProcessId=aProcessId;
+	}
+
+CApaParentProcessMonitor::~CApaParentProcessMonitor()
+	{
+	Cancel();
+	}
+
+void CApaParentProcessMonitor::ConstructL()
+	{
+	User::LeaveIfError(iProcess.Open(iProcessId));
+	iProcess.Logon(iStatus);
+	if(iStatus==KErrNoMemory)
+		{
+		User::WaitForRequest(iStatus);
+		User::Leave(KErrNoMemory);
+		}
+	CActiveScheduler::Add(this);
+	SetActive();
+	}
+
+void CApaParentProcessMonitor::RunL()
+	{
+	// Do something that will kill the child when the parent process terminates
+	if(iStatus==KErrNone)
+		{
+		RProcess proc;
+		proc.Terminate(KErrNone);
+		}
+	}
+
+void CApaParentProcessMonitor::DoCancel()
+	{
+	iProcess.LogonCancel(iStatus);
+	}
+
+/////////////////////////////
+// CApaProcess
+/////////////////////////////
+
+/** Constructor for CApaProcess */
+EXPORT_C CApaProcess::CApaProcess()
+	{
+	}
+
+EXPORT_C CApaProcess* CApaProcess::NewL(const RFs& aFs)
+/** Creates and returns a pointer to a new application process.
+
+This function is not used by UI applications.
+
+@param aFs Handle to a file server session.
+@return Pointer to the new application process. */
+	{
+	CApaProcess* self=new(ELeave) CApaProcess(aFs);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop();
+	return self;
+	}
+
+EXPORT_C CApaProcess::CApaProcess(const RFs& aFs)
+	:iFsSession(aFs)
+/** Constructs the application process object with the specified file session handle.
+
+Derived classes must define and implement a constructor through which 
+the file session handle can be specified. A 
+typical implementation calls this constructor through a constructor initialization 
+list.
+
+This constructor is used by the UI framework.
+
+@deprecated
+@param aFs Handle to a file server session */
+	{}
+
+const TInt KPriorityGreaterThanShutter=102;
+
+EXPORT_C void CApaProcess::ConstructL()
+/** Completes construction of the application process object.
+
+Implementers of derived classes must call this function as part of the second 
+stage construction of an object. Typically, derived classes implement their 
+own NewL() function and call ConstructL() as part of that implementation. */
+	{
+	//
+	iAppList = new(ELeave) CArrayFixFlat<TApaAppHolderInfo>(KAppProcessArrayGranularity);
+	iDocList = new(ELeave) CArrayFixFlat<CApaDocument*>(KAppProcessArrayGranularity);
+	iMainDocFileName = HBufC::NewL(KMaxFileName);
+	iApplicationRemover=CIdle::NewL(KPriorityGreaterThanShutter);	// Use an idle object so that app has chance to clear its call stack
+	}
+
+EXPORT_C void CApaProcess::ConstructL(TProcessId aParentProcessId)
+/** Completes construction of the application process object, passing in a Parent Process Identifier.
+
+Implementers of derived classes must call this function as part of the second 
+stage construction of an object. Typically, derived classes implement their 
+own NewL() function and call ConstructL() as part of that implementation.
+
+@param aParentProcessId Id of the parent process. This process will terminate when the parent does. */
+	{
+	ConstructL();
+	if(KNullProcessId!=aParentProcessId)
+		{
+		iMonitor=CApaParentProcessMonitor::NewL(aParentProcessId);
+		}
+	}
+
+EXPORT_C CApaProcess::~CApaProcess()
+// If this is called without calling ResetL() or CApaDocument::SaveL() first, data may be lost
+//
+/** Frees resources prior to destruction.
+
+Documents must be saved before the application process is deleted, otherwise 
+data may be lost.
+
+In debug mode, the destructor raises an APPARC 6 panic if documents still 
+exist, and an APPARC 5 panic if applications still exist. */
+	{
+	if (iMainDoc)
+		{
+		DestroyDocument(iMainDoc);
+		iMainDoc = NULL;
+		}
+	if (iDocList)
+		{
+		__ASSERT_DEBUG(iDocList->Count()==0,Panic(EPanicDocListNotEmpty));
+		for (TInt i=iDocList->Count()-1 ; i>=0 ; i--)
+			{
+			delete (*iDocList)[i]; // delete stray doc's in release mode, just to be tidy
+			}
+		}
+	if (iAppList)
+		{
+		for (TInt i=iAppList->Count()-1 ; i>=0 ; i--)
+			{
+			delete ((*iAppList)[i]).iAppHolder;
+			}
+		}
+	delete iAppList;
+	delete iDocList;
+	delete iMainDocFileName;
+	delete iApplicationRemover;
+	delete iMonitor;
+	}
+
+
+EXPORT_C void CApaProcess::ResetL()
+/** Resets the the application process to its initial state.
+
+Specifically, it saves the main document, deletes the main and all embedded 
+documents from memory, resets the main document filename and deletes all applications 
+except the main application.
+
+The function can leave if saving the main document fails. */
+	{
+	if (iMainDoc)
+		{
+		iMainDoc->SaveL();
+		DeleteAllDocs(); // sets iMainDoc to NULL, deletes all apps except main
+		}
+	__ASSERT_DEBUG(iMainDocFileName, Panic(EPanicNoDocument));
+	*iMainDocFileName=KNullDesC;
+	}
+
+
+void CApaProcess::DeleteAllDocs()
+// deletes all docs
+// deletes all apps except main app
+// sets iMainDoc* to NULL
+//
+	{
+	CApaAppHolder* mainAppHolder=NULL;
+	if (iMainDoc)
+		{
+		__ASSERT_DEBUG(iMainDoc->Application(), Panic(EDPanicNoApp));
+		mainAppHolder = iMainDoc->Application()->iAppHolder;
+		for (TInt i=iDocList->Count()-1 ; i>=0 ; i--)
+			if ((*iDocList)[i]==iMainDoc)
+				{
+				iDocList->Delete(i); // removes from array, but doesnt destroy
+				delete iMainDoc;
+				iMainDoc = NULL;
+				}
+		}
+	__ASSERT_ALWAYS(iDocList->Count()==0,Panic(EPanicDocListNotEmpty));
+	iDocList->Reset();
+	if (iAppList)
+		{
+		for (TInt ii=iAppList->Count()-1 ; ii>=0 ; ii--) // need to iterate backwards as the array changes size during the loop
+			{
+			if ((*iAppList)[ii].iAppHolder!=mainAppHolder)
+				{
+				delete (*iAppList)[ii].iAppHolder;
+				iAppList->Delete(ii);
+				}
+			}
+		iAppList->Compress();
+		}
+	}
+
+
+EXPORT_C void CApaProcess::SetMainDocFileName(const TDesC& aMainDocFileName)
+/** Sets the filename of the main document.
+
+@param aMainDocFileName The filename to be set.
+@panic APPARC 7 If the length of aMainDocFileName is greater than KMaxFileName or the
+length of the last filename set by SetMainDocFileNameL if greater
+@see KMaxFileName */
+	{
+	__ASSERT_DEBUG( iMainDocFileName, Panic(EPanicNullPointer));
+	__ASSERT_ALWAYS( aMainDocFileName.Length()<=iMainDocFileName->Des().MaxLength() ,Panic(EPanicFileNameTooLong));
+	*iMainDocFileName = aMainDocFileName;
+	}
+
+EXPORT_C void CApaProcess::SetMainDocFileNameL(const TDesC& aMainDocFileName)
+/** Sets the filename of the main document.
+
+@param aMainDocFileName The filename to be set. There is no restriction on the
+length of this descriptor. */
+	{
+	__ASSERT_ALWAYS( iMainDocFileName, Panic(EPanicNullPointer));
+	const TInt newLength = aMainDocFileName.Length() < KMaxFileName ? KMaxFileName : aMainDocFileName.Length();
+	if (newLength != iMainDocFileName->Des().MaxLength())
+		{
+		HBufC* const newMainDocFileName = HBufC::NewL(newLength);
+		delete iMainDocFileName;
+		iMainDocFileName = newMainDocFileName;
+		}
+	SetMainDocFileName(aMainDocFileName);
+	}
+
+EXPORT_C void CApaProcess::SetMainDocument(CApaDocument* aDocument)
+/** Sets the main document.
+
+@param aDocument A pointer to the document to be set as the main document 
+of the application process. This must be a an object created by the AddNewDocumentL() 
+or OpenNewDocumentL() functions 
+@see CApaProcess::AddNewDocumentL()
+@see CApaProcess::OpenNewDocumentL() */
+	{
+	__ASSERT_ALWAYS( iDocList, Panic(EPanicNullPointer));
+	// check that the prospective main doc has actually been added to the array
+	for (TInt i=iDocList->Count()-1 ; i>=0 ; i--)
+		{
+		if ((*iDocList)[i]==aDocument)
+			break;
+		if (i==0)
+			Panic(EPanicNoDocument);
+		}
+	// assign it once it has checked out
+	iMainDoc = aDocument;
+	}
+
+EXPORT_C CApaDocument* CApaProcess::AddNewDocumentL(TApaApplicationFactory aApplicationFactory)
+/** Creates and adds a new document using the specified application factory.
+
+The document may be a main document or an embedded document.
+
+Any document created with this function must be destroyed using DestroyDocument().
+
+@param aApplicationFactory Should be created implicitly by passing a pointer to
+a factory function, an ECOM plugin UID, or a CImplementationInformation reference.
+@return A pointer to the new document.
+@see CApaProcess::DestroyDocument()
+@see CApaApplication */
+	{
+#ifdef USING_ECOM_RECOGS
+	__SHOW_TRACE(_L("Starting CApaProcess::AddNewDocumentL"));
+	__APA_PROFILE_START(0);
+
+	CApaAppHolder* appHolder = AddAppExeL(aApplicationFactory);	
+
+	// use the app to create a doc
+	CApaDocument* doc=NULL;
+	TRAPD(ret,doc=CreateDocL(appHolder->Application()));
+	if (ret!=KErrNone)
+		// remove app as it has been orphaned
+		RemoveApp(appHolder);
+	User::LeaveIfError(ret);
+	__PROFILE_END(0);
+	return doc;
+#else // USING_ECOM_RECOGS
+	(void)aApplicationFactory;
+	return NULL;
+#endif // USING_ECOM_RECOGS
+	} //lint !e1762 Member function could be made const - Not true
+
+
+
+void CApaProcess::RemoveApp(CApaAppHolder* aAppHolder)
+// removes app holder from the list if it exists, panics otherwise
+	{
+	__ASSERT_ALWAYS(iAppList, Panic(EPanicNullPointer));
+	TInt i = 0;
+	for (i=iAppList->Count()-1 ; i>=0 ; i--)
+		{
+		if ((*iAppList)[i].iAppHolder==aAppHolder) // the main app may be alive on its own if Reset() has just been called
+			{
+			delete aAppHolder; // the main app may be alive on its own if Reset() has just been called
+			iAppList->Delete(i);
+			break;
+			}
+		}
+	if (i<0)
+		Panic(EPanicAppNotInList);
+	}
+
+
+EXPORT_C CApaDocument* CApaProcess::OpenNewDocumentL(CFileStore*& aStore,CStreamDictionary*& aStreamDic,const TDesC& aDocFullFileName,TUint aFileMode)
+/** Opens the specified file and restores the content as a document.
+
+The created document can be merged into or embedded in another document.
+
+Any document created with this function must be destroyed using DestroyDocument().
+
+@param aStore On return, this contains a pointer to the store object created 
+during the restore.
+@param aStreamDic On return, this contains a pointer to the stream dictionary 
+object created during the restore. 
+@param aDocFullFileName The name of the file containing the document. 
+@param aFileMode The mode in which to open the file. 
+@return A pointer to the restored document.
+@see TFileMode
+@see CApaProcess::DestroyDocument() */
+	{
+	__SHOW_TRACE(_L("Starting CApaProcess::OpenNewDocumentL"));
+	__APA_PROFILE_START(1);
+	TParse parser;
+	User::LeaveIfError(iFsSession.Parse(aDocFullFileName,parser)); 
+	// open doc as a file store & read in the header
+	CFileStore* docStore;
+	CStreamDictionary* streamDic = ReadRootStreamLC(FsSession(),docStore,parser.FullName(),aFileMode);
+	CleanupStack::PushL(docStore);
+	// read in the app id info
+	TApaAppIdentifier appId=ReadAppIdentifierL(*docStore,*streamDic);
+	// create the doc
+	CApaDocument* importedDoc =	AddNewDocumentL(appId.iAppUid);
+	// restore the document
+	TApaDocCleanupItem cleanup(this,importedDoc);
+	CleanupStack::PushL(cleanup);
+	importedDoc->RestoreL(*docStore,*streamDic);
+	CleanupStack::Pop(3); //docStore,importedDoc,streamDic
+	aStore = docStore;
+	aStreamDic = streamDic;
+	__PROFILE_END(1);
+	return importedDoc;
+	}
+
+EXPORT_C TApaAppIdentifier CApaProcess::ReadAppIdentifierL(const CStreamStore& aStore,const CStreamDictionary& aStreamDic)
+// this is a static method
+/** Reads the application identifier from its stream in the specified store and 
+returns it.
+
+The location of the stream is found in the specified stream dictionary.
+
+@param aStore The store from which the application identifier should be read. 
+@param aStreamDic The stream dictionary containing the stream ID of the application 
+identifier stream. The stream dictionary can be found in the root stream of 
+the store.
+@return The application identifier. */
+	{
+	__SHOW_TRACE(_L("Starting CApaProcess::ReadAppIdentifierL"));
+	TStreamId infoStreamId=aStreamDic.At(KUidAppIdentifierStream);
+	TApaAppIdentifier appId;
+	// create a stream and read in the data
+	RStoreReadStream stream;
+	stream.OpenLC(aStore,infoStreamId);
+	stream>> appId;
+	stream.Close();
+	CleanupStack::PopAndDestroy(); // stream
+	return appId;	
+	}
+
+
+EXPORT_C void CApaProcess::WriteAppIdentifierL(CStreamStore& aStore,CStreamDictionary& aStreamDic,const TApaAppIdentifier& aAppId)
+// this is a static method
+/** Writes the application identifier to a new stream in the specified store and 
+records the location of this stream in the specified stream dictionary.
+
+@param aStore The store to which the application identifier should be written. 
+
+@param aStreamDic The stream dictionary. 
+@param aAppId The application identifier to be externalised to a stream. */
+	{
+	__SHOW_TRACE(_L("Starting CApaProcess::WriteAppIdentifierL"));
+	// create a stream
+	RStoreWriteStream stream;
+	TStreamId streamId=stream.CreateLC(aStore);
+	// stream the header
+	stream<< aAppId;
+	stream.CommitL();
+	CleanupStack::PopAndDestroy(); // id stream
+	// enter the stream in the dictionary
+	aStreamDic.AssignL(KUidAppIdentifierStream,streamId);
+	}
+
+
+EXPORT_C CStreamDictionary* CApaProcess::ReadRootStreamLC(RFs& aFs,CFileStore*& aStore,const TDesC& aDocFullFileName,TUint aFileMode)
+/** Reads the stream dictionary contained as the root stream in the specified document 
+file.
+
+The function constructs, and returns a pointer to the stream dictionary object 
+and puts the pointer to the stream dictionary object onto the cleanup stack. 
+It also returns a pointer to the created file store object through an argument 
+reference. 
+
+The file must be a valid document file; otherwise the function leaves with one of 
+the system-wide error codes.
+
+@param aFs Handle to a file server session.
+@param aStore On return, a pointer to the newly created file store object. 
+@param aDocFullFileName The full path name of the document file. 
+@param aFileMode The mode in which to open the file.
+@return A pointer to the stream dictionary object read from the root stream 
+of the store. 
+@see TFileMode */
+	{ // static
+	__SHOW_TRACE(_L("Starting CApaProcess::ReadRootStreamLC (file-name overload)"));
+	CStreamDictionary* const streamDictionary=CStreamDictionary::NewLC();
+	CFileStore* const store=CFileStore::OpenLC(aFs,aDocFullFileName,aFileMode);
+	DoReadRootStreamL(*streamDictionary, *store);
+	aStore=store; // delay assignment until nothing can go wrong to avoid destroying the store twice if a leave occurs
+	CleanupStack::Pop(store);
+	return streamDictionary;
+	}
+
+
+EXPORT_C CStreamDictionary* CApaProcess::ReadRootStreamLC(CFileStore*& aStore, const RFile& aFile)
+/**
+@internalTechnology
+*/
+	{ // static
+	__SHOW_TRACE(_L("Starting CApaProcess::ReadRootStreamLC (file-handle overload)"));
+	CStreamDictionary* const streamDictionary=CStreamDictionary::NewLC();
+	RFile duplicateFile;
+	CleanupClosePushL(duplicateFile);
+	User::LeaveIfError(duplicateFile.Duplicate(aFile)); // this is because CFileStore::FromLC closes the file its passed (and stores its own duplicate)
+	CFileStore* const store=CFileStore::FromL(duplicateFile);
+	CleanupStack::PopAndDestroy(&duplicateFile);
+	CleanupStack::PushL(store);
+	DoReadRootStreamL(*streamDictionary, *store);
+	aStore=store; // delay assignment until nothing can go wrong to avoid destroying the store twice if a leave occurs
+	CleanupStack::Pop(store);
+	return streamDictionary;
+	}
+
+
+void CApaProcess::DoReadRootStreamL(CStreamDictionary& aStreamDictionary, const CFileStore& aStore)
+	{ // static
+	const TStreamId rootStreamId=aStore.Root();
+	if ((aStore.Type()[1]!=KUidAppDllDoc) || (rootStreamId==KNullStreamId))
+		{
+		User::Leave(KErrCorrupt);
+		}
+	RStoreReadStream rootStream;
+	rootStream.OpenLC(aStore, rootStreamId);
+	rootStream>>aStreamDictionary;
+	CleanupStack::PopAndDestroy(&rootStream);
+	}
+
+
+EXPORT_C void CApaProcess::WriteRootStreamL(CPersistentStore& aStore,CStreamDictionary& aStreamDic,const CApaApplication& aApp)
+// this is a static method
+/** Writes the application identifier (derived from the application object CApaApplication) 
+followed by the stream dictionary to the store and makes the stream dictionary the root stream of the
+store.
+
+Typically, the function is called by the application when it 
+implements a file create or file save type operation. It is called after all 
+model and UI data has been persisted. The IDs of the streams containing the 
+model and UI data should have been lodged in the stream dictionary.
+
+In effect, the function finishes off the file save or file
+create type operation, leaving the file containing the store in a valid state
+with the standard interface.
+
+@param aStore  The store to which the root stream is to be written. Before
+calling this function, a reference to the store must be saved by putting a
+pointer onto the cleanup stack or by making it member data of a class. This
+ensures that it is not orphaned in the event of this function leaving.
+@param aStreamDic The stream dictionary containing the locations and associated 
+UIDs of other streams in the store.
+@param aApp  The application used to create the main document in the file
+being written. The application identifier to be written is constructed from
+this application object. */
+	{
+	__SHOW_TRACE(_L("Starting CApaProcess::WriteRootStreamL(app)"));
+	// get the app dll name
+	TParse dllPath;
+	dllPath.SetNoWild(aApp.DllName(),NULL,NULL);
+	// set up an app identifier
+	TApaAppIdentifier appId(aApp.AppDllUid(),dllPath.NameAndExt());
+	// Write the root stream
+	WriteRootStreamL(aStore,aStreamDic,appId);
+	}
+
+
+EXPORT_C void CApaProcess::WriteRootStreamL(CPersistentStore& aStore,CStreamDictionary& aStreamDic,const TApaAppIdentifier& aAppId)
+// this is a static method
+/** Writes the application identifier followed by the stream dictionary 
+to the store and makes the stream dictionary the root stream of the store.
+
+Typically, the function is called by the application when it 
+implements a file create or file save type operation. It is called after all 
+model and UI data has been persisted. The IDs of the streams containing the 
+model and UI data should have been lodged in the stream dictionary.
+
+In effect, the function finishes off the file save or file
+create type operation, leaving the file containing the store in a valid state
+with the standard interface.
+
+@param aStore  The store to which the root stream is to be written. Before
+calling this function, a reference to the store must be saved by putting a
+pointer onto the cleanup stack or by making it member data of a class. This
+ensures that it is not orphaned in the event of this function leaving.
+@param aStreamDic The stream dictionary containing the locations and associated 
+UIDs of other streams in the store.
+@param aAppId  The application identifier to be written into the application
+identifier stream. */
+	{
+	__SHOW_TRACE(_L("Starting CApaProcess::WriteRootStreamL(id)"));
+	// create a stream
+	WriteAppIdentifierL(aStore,aStreamDic,aAppId);
+	// externalize the dictionary
+	RStoreWriteStream stream;
+	TStreamId streamId=stream.CreateLC(aStore);
+	stream<< aStreamDic;
+	stream.CommitL();
+	CleanupStack::PopAndDestroy(); // dictionary stream
+	// set the dictionary stream as the root stream
+	aStore.SetRootL(streamId);
+	}
+
+
+EXPORT_C void CApaProcess::DestroyDocument(CApaDocument* aDoc)
+/** Destroys the specified document.
+
+All references to the document are removed, and associated resources are freed. 
+Specifically, the function deletes any associated application and unloads 
+the application DLL, provided that no other documents of that application 
+type are still open.
+
+All document objects created through CApaProcess must be deleted using this 
+function.
+
+@param aDoc A pointer to the document to be destroyed. 
+@see CApaApplication
+@see CApaProcess */
+	{
+	__SHOW_TRACE(_L("Starting CApaProcess::DestroyDocument(app)"));
+	//
+	if (aDoc)
+		{
+		// delete the doc, keeping a handle to its app
+		CApaApplication* app=aDoc->Application();
+		__ASSERT_DEBUG(app!=NULL,Panic(EDPanicDocWithNoApp));
+		// remove the doc from the list, keeping a handle to the doc
+		TBool appStillRequired=EFalse;
+		__ASSERT_ALWAYS(iDocList, Panic(EPanicNullPointer));
+		for (TInt i=iDocList->Count()-1 ; i>=0 ; i--)
+			{//check through the list, remove the right doc, and see if the app is used by any other docs
+			if ((*iDocList)[i]==aDoc)
+				{
+				iDocList->Delete(i); // removes from array, but doesnt destroy
+				iDocList->Compress();
+				}
+			else if ((*iDocList)[i]->Application()==app)
+				appStillRequired = ETrue;
+			}
+		// null the main doc handle if we delete the main doc
+		if (aDoc==iMainDoc)
+			iMainDoc = NULL;
+		
+		delete aDoc; // del
+		
+		// remove app if no other doc's use it and it's not the main app
+		if ((!appStillRequired)&&(iMainDoc)&&(app!=iMainDoc->Application()))
+			{
+			MarkApplicationForRemoval(app);
+			__ASSERT_DEBUG(iApplicationRemover, Panic(EDPanicNoAppRemover));
+			if (!iApplicationRemover->IsActive())
+				{
+				iApplicationRemover->Start(TCallBack(CApaProcess::IdleRemoveApplications,this));
+				}
+			}
+		}
+	}
+
+
+TInt CApaProcess::IdleRemoveApplications(TAny* aThis)
+// Remove applications on callback of idle object. Using an idle object gives an embedded application a chance to clear
+// its call stack before its dll is closed
+//
+	{
+	CApaProcess* process=reinterpret_cast<CApaProcess*>(aThis);
+	__ASSERT_DEBUG(process, Panic(EDPanicNoProcess));
+	process->RemoveMarkedApplications();
+	return 0;
+	}
+
+
+void CApaProcess::RemoveMarkedApplications()
+// Remove any applications that have been marked for removal, closing their dlls also
+//
+	{
+	__ASSERT_DEBUG(iAppList, Panic(EPanicNullPointer));
+	for (TInt i=iAppList->Count()-1 ; i>=0 ; i--)
+		if ((*iAppList)[i].iToBeRemoved)
+			{
+			delete (*iAppList)[i].iAppHolder;
+			iAppList->Delete(i); // remove from array
+			iAppList->Compress();
+			}
+	}
+
+
+void CApaProcess::MarkApplicationForRemoval(const CApaApplication* aApp)
+// Mark the application in the app list for removal by idle object
+//
+	{
+	__ASSERT_DEBUG(aApp!=NULL,Panic(EDPanicRemovingNullApp));
+	__ASSERT_DEBUG(iAppList, Panic(EPanicNullPointer));
+	// remove the app from the list, keeping a handle to it
+	for (TInt i=iAppList->Count()-1 ; i>=0 ; i--)
+		{
+		__ASSERT_DEBUG((*iAppList)[i].iAppHolder, Panic(EDPanicNoAppHolder));
+		if ((*iAppList)[i].iAppHolder->Application()==aApp)
+			{
+			(*iAppList)[i].iToBeRemoved=ETrue;
+			}
+	}
+
+	}
+
+
+CApaDocument* CApaProcess::CreateDocL(CApaApplication* aApp)
+// creates a new doc with aApp and adds it to the list before returning a handle to it
+//
+	{
+	__SHOW_TRACE(_L("Starting CApaProcess::CreateDocL"));
+	__ASSERT_DEBUG(aApp,Panic(EDPanicNoApp));
+	//
+	// create a new doc with the app
+	CApaDocument* doc=aApp->CreateDocumentL(this); //lint !e613 Possible use of null pointer - Asserted above
+	__ASSERT_ALWAYS(doc!=NULL,Panic(EPanicDocumentNotCreated));
+	// add the doc to the list
+	CleanupStack::PushL(doc);
+	iDocList->AppendL(doc);
+	CleanupStack::Pop(); // doc
+	// return a	handle to the doc
+	return doc;
+	}
+
+
+CApaAppHolder* CApaProcess::FindAppInListL(const TDesC& aAppFileName,TUid aUid)const
+// returns pointer to a matching app, or NULL if not in list
+//
+	{
+	__ASSERT_DEBUG(iAppList, Panic(EPanicNullPointer));
+	TInt index=iAppList->Count();
+	if (aUid!=KNullUid)
+		{// search by UID
+		while (--index>=0)
+			{
+			__ASSERT_DEBUG((*iAppList)[index].iAppHolder, Panic(EDPanicNoAppHolder));
+			if ((*iAppList)[index].iAppHolder->Uid()==aUid)
+				{
+				(*iAppList)[index].iToBeRemoved = FALSE;
+				return (*iAppList)[index].iAppHolder; // match found
+				}
+			}
+		}
+	else
+		{// search by name as no UID has been supplied
+		TParse app; TParse suspect;
+		User::LeaveIfError(app.Set(aAppFileName,NULL,NULL));
+		while (--index>=0)
+			{
+			__ASSERT_DEBUG((*iAppList)[index].iAppHolder, Panic(EDPanicNoAppHolder));
+			suspect.SetNoWild((*iAppList)[index].iAppHolder->FileName(),NULL,NULL);
+			if (!app.Name().CompareF(suspect.Name()))
+				{
+				(*iAppList)[index].iToBeRemoved = FALSE;
+				return (*iAppList)[index].iAppHolder; // match found
+				}
+			}
+		}
+	return NULL; // no match found
+	}
+
+#ifdef USING_ECOM_RECOGS
+CApaExe* CApaProcess::AddAppExeL(TApaApplicationFactory aApplicationFactory)
+	{
+	CApaExe* exe = new(ELeave) CApaExe();
+	CleanupStack::PushL(exe);
+	
+	// create the app
+	exe->CreateApplicationL(aApplicationFactory);
+	__ASSERT_DEBUG(exe->Application(), Panic(EPanicNullPointer));
+	exe->Application()->PreDocConstructL();
+	
+	// add the application to the list and return a pointer to it
+	TApaAppHolderInfo info(exe);
+	__ASSERT_DEBUG(iAppList, Panic(EPanicNullPointer));
+	iAppList->AppendL(info);
+	CleanupStack::Pop(exe);
+
+	return exe;
+	}
+#endif // USING_ECOM_RECOGS
+
+
+EXPORT_C TPtrC CApaProcess::MainDocFileName()const
+/** Returns the filename of the main document.
+
+@return A non-modifiable pointer descriptor to the main document filename. 
+For non file-based applications, the length of this descriptor is zero. */
+	{
+	if (iMainDocFileName!=NULL)
+		{
+		return *iMainDocFileName;
+		}
+	return KNullDesC();
+	}
+
+/** Reserved for future use */
+EXPORT_C void CApaProcess::CApaProcess_Reserved1()
+	{
+	}
+
+/** Reserved for future use */
+EXPORT_C void CApaProcess::CApaProcess_Reserved2()
+	{
+	}
+
+/////////////////////////////
+// TApaApplicationFactory
+/////////////////////////////
+
+/**
+Default constructor
+*/
+
+/** Constructor for TApaApplicationFactory */
+EXPORT_C TApaApplicationFactory::TApaApplicationFactory()
+	:iType(ETypeFunction),
+	 iData(0),
+	 iApplication(NULL)
+	{
+	}
+
+/** 
+Constructor.
+@publishedAll
+@released
+@param aFunction The function from which the application is to be created.
+*/
+EXPORT_C TApaApplicationFactory::TApaApplicationFactory(TFunction aFunction)
+	:iType(ETypeFunction),
+	 iData(reinterpret_cast<TUint>(aFunction)),
+	 iApplication(NULL)
+	{
+	}
+
+/** 
+Constructor. Use this constructor in preference to the constructor taking a "TUid" parameter 
+if at all possible as it is much more efficient.
+@publishedAll
+@released
+@param aEmbeddedApplicationInformation The ECOM implementation-information of the embedded application to be created.
+*/
+EXPORT_C TApaApplicationFactory::TApaApplicationFactory(const CImplementationInformation& aEmbeddedApplicationInformation)
+	:iType(ETypeEmbeddedApplicationInformation),
+	 iData(reinterpret_cast<TUint>(&aEmbeddedApplicationInformation)),
+	 iApplication(NULL)
+	{
+	}
+
+/** 
+Constructor. Use the constructor taking a "const CImplementationInformation&" parameter in preference 
+to this constructor if at all possible as it is much more efficient.
+@publishedAll
+@released
+@param aEmbeddedApplicationUid The ECOM implementation-UID of the embedded application to be created.
+*/
+EXPORT_C TApaApplicationFactory::TApaApplicationFactory(TUid aEmbeddedApplicationUid)
+	:iType(ETypeEmbeddedApplicationUid),
+	 iData(aEmbeddedApplicationUid.iUid),
+	 iApplication(NULL)
+	{
+	}
+
+#ifdef USING_ECOM_RECOGS
+CApaApplication* TApaApplicationFactory::CreateApplicationL() const
+	{
+	CApaApplication* application = NULL;
+
+	switch (iType)
+		{
+		case ETypeFunction:
+			{
+			__ASSERT_DEBUG(iData, Panic(EPanicNullPointer));
+			application=(*reinterpret_cast<TFunction>(iData))();
+			break;
+			}
+		case ETypeEmbeddedApplicationInformation:
+			{
+			__ASSERT_DEBUG(iData, Panic(EPanicNullPointer));
+			const CImplementationInformation& embeddedApplicationInformation=*reinterpret_cast<const CImplementationInformation*>(iData);
+			TUid uid = embeddedApplicationInformation.ImplementationUid();
+			application=CreateEmbeddedApplicationL(uid);
+			break;
+			}
+		case ETypeEmbeddedApplicationUid:
+			{
+			TUid uid = TUid::Uid(iData);
+			application=CreateEmbeddedApplicationL(uid);
+			break;
+			}
+		default:
+			Panic(EPanicBadApplicationFactoryType);
+		}
+
+	return application;
+	}
+
+HBufC* TApaApplicationFactory::AppFileNameL() const
+	{
+	HBufC* appFileName = NULL;
+	switch (iType)
+		{
+		case ETypeFunction:
+			{
+			// Assume that if the type is a function pointer then the app is not embedded (so
+			// the filename is the filename of this process).
+			appFileName = RProcess().FileName().AllocL();
+			break;
+			}
+		case ETypeEmbeddedApplicationInformation:
+			{
+			const CImplementationInformation& embeddedApplicationInformation=*REINTERPRET_CAST(const CImplementationInformation*,iData);
+			appFileName = FullAppFileNameL(embeddedApplicationInformation.DisplayName());
+			break;
+			}
+		case ETypeEmbeddedApplicationUid:
+			{
+			TUid uid = TUid::Uid(iData);
+			HBufC* displayName = EmbeddedApplicationDisplayNameLC(uid);
+			appFileName = FullAppFileNameL(*displayName);
+			CleanupStack::PopAndDestroy(displayName);
+			break;
+			}
+		default:
+			Panic(EPanicBadApplicationFactoryType);
+		}
+
+	return appFileName;
+	}
+
+TUid TApaApplicationFactory::AppFileUid() const
+	{
+	TUid uid=KNullUid;
+	switch (iType)
+		{
+		case ETypeFunction:
+			{
+			uid = RProcess().Type()[2];
+			break;
+			}
+		case ETypeEmbeddedApplicationInformation:
+			{
+			const CImplementationInformation& embeddedApplicationInformation=*REINTERPRET_CAST(const CImplementationInformation*,iData);
+			uid = embeddedApplicationInformation.ImplementationUid();
+			break;
+			}
+		case ETypeEmbeddedApplicationUid:
+			{
+			uid = TUid::Uid(iData);
+			break;
+			}
+		default:
+			Panic(EPanicBadApplicationFactoryType);
+		}
+	return uid;
+	}
+
+HBufC* TApaApplicationFactory::FullAppFileNameL(const TDesC& aAppName)
+	{
+	// This was appropriately changed for data caging (binaries placed in \sys\bin\)
+	TFileName fileName;
+	Dll::FileName(fileName);
+
+	TParse parse;
+	parse.SetNoWild(aAppName, &KApplicationLocation, &fileName);
+	return parse.FullName().AllocL();
+	}
+
+CApaApplication* TApaApplicationFactory::CreateEmbeddedApplicationL(TUid aUid)
+	{ // static
+	CApaApplication* const application=static_cast<CApaApplication*>(REComSession::CreateImplementationL(aUid,_FOFF(CApaApplication,iDtorKey)));
+	const TUid appUid = application->AppDllUid();
+	__ASSERT_ALWAYS(appUid==aUid, Panic(EPanicUidsDoNotMatch));
+	return application;
+	}
+
+
+HBufC* TApaApplicationFactory::EmbeddedApplicationDisplayNameLC(TUid aUid)
+	{ // static
+	HBufC* displayName=NULL;
+
+	RImplInfoPtrArray implementationArray;
+	CleanupStack::PushL(TCleanupItem(CleanupImplementationArray,&implementationArray));
+	REComSession::ListImplementationsL(KUidFileEmbeddedApplicationInterfaceUid,implementationArray);
+	for (TInt i=implementationArray.Count()-1; i>=0; --i)
+		{
+		const CImplementationInformation& implementationInformation=*implementationArray[i];
+		if (implementationInformation.ImplementationUid().iUid==aUid.iUid)
+			{
+			displayName=implementationInformation.DisplayName().AllocL();
+			break;
+			}
+		}
+	CleanupStack::PopAndDestroy(&implementationArray);
+	if (displayName==NULL)
+		{
+		User::Leave(KErrNotFound);
+		}
+	CleanupStack::PushL(displayName);
+
+	return displayName;
+	}
+
+void TApaApplicationFactory::CleanupImplementationArray(TAny* aImplementationArray)
+	{ // static
+	__ASSERT_DEBUG(aImplementationArray, Panic(EPanicNullPointer));
+	RImplInfoPtrArray& implementationArray=*static_cast<RImplInfoPtrArray*>(aImplementationArray);
+	implementationArray.ResetAndDestroy();
+	implementationArray.Close();
+	}
+	
+//
+// MApaEmbeddedDocObserver
+//
+
+/** Constructor for MApaEmbeddedDocObserver */
+EXPORT_C MApaEmbeddedDocObserver::MApaEmbeddedDocObserver()
+	{
+	}
+
+/** Reserved for future use */
+EXPORT_C void MApaEmbeddedDocObserver::MApaEmbeddedDocObserver_Reserved1()
+	{
+	}
+
+/** Reserved for future use */
+EXPORT_C void MApaEmbeddedDocObserver::MApaEmbeddedDocObserver_Reserved2()
+	{
+	}
+#endif // USING_ECOM_RECOGS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apparc/APPARC.MMP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+//
+// APPARC.MMP for component APPARC
+//
+
+/**
+@file
+
+@SYMPurpose apparc.dll Application apparc base classes
+*/
+
+
+target          apparc.dll
+CAPABILITY All -Tcb
+targettype      DLL
+UID		0x1000008D 0x10003A3D
+VENDORID 0x70000001
+
+SOURCEPATH	../apparc
+userinclude		../inc
+systeminclude   /epoc32/include
+
+source          APACMDLN.CPP APAFLREC.CPP APAID.CPP APAMDR.CPP
+source          APASTD.CPP APPARC.CPP
+source          ApaAppServer.cpp
+source          ApaAppClient.cpp
+
+library         euser.lib efsrv.lib gdi.lib estor.lib 
+
+
+#if !defined(WINC)
+macro			USING_ECOM_RECOGS
+library         ecom.lib
+#endif
+
+deffile			APPARC_9_REMOVE_UI_FRAMEWORKS_V1.DEF
+
+START WINS
+	baseaddress	0x40000000
+END
+
+START MARM
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apparc/ApaAppClient.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,222 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "ApaServerAppPriv.h"
+
+void AppServerPanic(TApaAppServerPanic aReason)
+	{
+	_LIT(KPanic, "ApaAppClient");
+	User::Panic(KPanic, aReason);
+	}
+	
+void CleanupServerName(TAny* aParam)
+	{
+	HBufC** pServerName = static_cast<HBufC**>(aParam);
+	delete *pServerName;
+	*pServerName = NULL;
+	}
+
+/** Protected constructor, instantiable services must derive from this class.*/
+EXPORT_C RApaAppServiceBase::RApaAppServiceBase()
+: iServerName(NULL)
+	{
+	}
+
+/** Closes the service and the connection to the server app.*/
+EXPORT_C void RApaAppServiceBase::Close()
+	{
+	delete iServerName;
+	iServerName = NULL;
+	RSessionBase::Close();
+	}
+	
+/** Connects to an already running server application, through an already connected service. 
+@param aClient A service which is already connected.*/
+EXPORT_C void RApaAppServiceBase::ConnectExistingAppL(const RApaAppServiceBase& aClient)
+	{
+	__ASSERT_DEBUG(!iServerName, AppServerPanic(EApaAppServerPanicClientAlreadyConnected));
+	iServerName = aClient.iServerName->AllocL();
+	ConnectL();
+	}
+
+/** Connects to an already running server application, through an already connected service. 
+@param aClient A service which is already connected.
+@param aSecurityPolicy The TSecurityPolicy which should be matched with the TSecurityPolicy of the app to be connected.
+
+@see TSecurityPolicy*/
+EXPORT_C void RApaAppServiceBase::ConnectExistingAppL(const RApaAppServiceBase& aClient, const TSecurityPolicy& aSecurityPolicy)
+	{
+	__ASSERT_DEBUG(!iServerName, AppServerPanic(EApaAppServerPanicClientAlreadyConnected));
+	iServerName = aClient.iServerName->AllocL();
+	ConnectL(aSecurityPolicy);
+	}
+
+/** Connects to an already running server application, by name.
+@param aName The name of the server hosted by the server app.*/
+EXPORT_C void RApaAppServiceBase::ConnectExistingByNameL(const TDesC& aServerName)
+	{
+	__ASSERT_DEBUG(!iServerName, AppServerPanic(EApaAppServerPanicClientAlreadyConnected));
+	iServerName = aServerName.AllocL();
+	ConnectL();
+	}
+
+/** Connects to an already running server application, by name.
+@param aName The name of the server hosted by the server app.
+@param aSecurityPolicy The TSecurityPolicy which should be matched with the TSecurityPolicy of the app to be connected.
+
+@see TSecurityPolicy*/
+EXPORT_C void RApaAppServiceBase::ConnectExistingByNameL(const TDesC& aServerName, const TSecurityPolicy& aSecurityPolicy)
+	{
+	__ASSERT_DEBUG(!iServerName, AppServerPanic(EApaAppServerPanicClientAlreadyConnected));
+	iServerName = aServerName.AllocL();
+	ConnectL(aSecurityPolicy);
+	}
+
+void RApaAppServiceBase::ConnectL()
+	{
+	CleanupStack::PushL(TCleanupItem(CleanupServerName, &iServerName));
+	TUid serviceUid = ServiceUid();
+	User::LeaveIfError(CreateSession(*iServerName,*reinterpret_cast<TVersion*>(&serviceUid)));
+	CleanupStack::Pop(&iServerName);
+	}
+
+void RApaAppServiceBase::ConnectL(const TSecurityPolicy& aSecurityPolicy)
+	{
+	CleanupStack::PushL(TCleanupItem(CleanupServerName, &iServerName));
+	TUid serviceUid = ServiceUid();
+	User::LeaveIfError(CreateSession(*iServerName, *reinterpret_cast<TVersion*>(&serviceUid), -1, EIpcSession_Unsharable, &aSecurityPolicy));
+	CleanupStack::Pop(&iServerName);
+	}
+
+/** Gets the name of the server hosted by the server application.
+@return the name of the server application, will be empty if
+the service is not connected*/
+EXPORT_C TPtrC RApaAppServiceBase::ServerName() const
+	{
+	if (iServerName)
+		{
+		return *iServerName;
+		}
+	else
+		{
+		return KNullDesC();
+		}
+	}
+
+/** Requests notification of server application exit.
+@param aStatus On completion, this contains the exit code of the server application.
+@see CApaServerAppExitMonitor*/
+EXPORT_C void RApaAppServiceBase::NotifyServerExit(TRequestStatus& aStatus) const
+	{
+	SendReceive(EApaAppServerNotifyServerExit,TIpcArgs(),aStatus);
+	}
+	
+/** Cancels the request for notification of server application exit.*/
+EXPORT_C void RApaAppServiceBase::CancelNotifyServerExit() const
+	{
+	SendReceive(EApaAppServerCancelNotifyServerExit);	
+	}
+
+/** Extension mechanism - for internal BC proofing. */
+EXPORT_C void RApaAppServiceBase::ExtensionInterface(TUid /*aInterfaceId*/, TAny*& /*aImplementaion*/)
+	{
+	}
+EXPORT_C void RApaAppServiceBase::RApaAppServiceBase_Reserved1()
+	{
+	}
+
+EXPORT_C void RApaAppServiceBase::RApaAppServiceBase_Reserved2()
+	{
+	}
+
+/** Transfers the ownership of the session passed to self.
+@param aClient A service which is already connected. On return, this service will be reset.
+@leave KErrArgument The session passed is not connected.
+@panic ApaAppClient 3 The client getting the ownership already has a connected session. Debug builds only.
+*/	
+EXPORT_C void RApaAppServiceBase::TransferExistingSessionL(RApaAppServiceBase& aClient)
+	{
+	__ASSERT_DEBUG(!iServerName, AppServerPanic(EApaAppServerPanicClientAlreadyConnected));
+	if(aClient.iServerName == NULL)
+		{
+		User::Leave(KErrArgument);
+		}
+	if(this != &aClient)
+		{
+		iServerName = aClient.iServerName;
+		iApaReserved1 = aClient.iApaReserved1;
+		iApaReserved2 = aClient.iApaReserved2;
+		SetHandle(aClient.Handle());
+		aClient.iServerName = NULL;
+		aClient.SetHandle(0);
+		}
+	}
+	
+//
+// CApaServerAppExitMonitor
+//
+
+/** Creates a new monitor object and starts monitoring server app lifetime.
+@param aClient A connected server app session, which requires monitoring.
+@param aObserver An implementer of the MApaServerAppExitObserver that wants to be notified of server app exits.
+@param aPriority The active object priority that this monitor should run at.
+@return a new instance of a monitor. */
+EXPORT_C CApaServerAppExitMonitor* CApaServerAppExitMonitor::NewL(RApaAppServiceBase& aClient, MApaServerAppExitObserver& aObserver, TInt aPriority)
+	{
+	CApaServerAppExitMonitor* self = new(ELeave) CApaServerAppExitMonitor(aClient, aObserver, aPriority);
+	return self;
+	}
+	
+/** Creates a new monitor object, places it on the cleanup stack and starts monitoring server app lifetime.
+@param aClient A connected server app session, which requires monitoring.
+@param aObserver An implementer of the MApaServerAppExitObserver that wants to be notified of server app exits.
+@param aPriority The active object priority that this monitor should run at.
+@return a new instance of a monitor, which is placed on the cleanup stack. */
+EXPORT_C CApaServerAppExitMonitor* CApaServerAppExitMonitor::NewLC(RApaAppServiceBase& aClient, MApaServerAppExitObserver& aObserver, TInt aPriority)
+	{
+	CApaServerAppExitMonitor* self = new(ELeave) CApaServerAppExitMonitor(aClient, aObserver, aPriority);
+	CleanupStack::PushL(self);
+	return self;
+	}
+	
+/** The destructor stops monitoring of server app exit. */
+EXPORT_C CApaServerAppExitMonitor::~CApaServerAppExitMonitor()
+	{
+	Cancel();
+	}
+
+CApaServerAppExitMonitor::CApaServerAppExitMonitor(RApaAppServiceBase& aClient, MApaServerAppExitObserver& aObserver, TInt aPriority)
+: CActive(aPriority), iClient(aClient), iObserver(aObserver)
+	{
+	CActiveScheduler::Add(this);
+	iClient.NotifyServerExit(iStatus);
+	SetActive();
+	}
+
+void CApaServerAppExitMonitor::RunL()
+	{
+	TInt reason = iStatus.Int();
+	iObserver.HandleServerAppExit(reason);
+	}
+
+void CApaServerAppExitMonitor::DoCancel()
+	{
+	iClient.CancelNotifyServerExit();
+	}
+
+TInt CApaServerAppExitMonitor::RunError(TInt aError)
+	{
+	return aError;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apparc/ApaAppServer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,335 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "ApaServerAppPriv.h"
+
+//
+// CApaAppServiceBase
+//
+
+/** Constructor. */
+EXPORT_C CApaAppServiceBase::CApaAppServiceBase()
+	{
+	}
+	
+/** An implementation of the CreateL() method from CSession2.
+This can be further overridden by derived classes, but such
+implementations should also base-call. */
+EXPORT_C void CApaAppServiceBase::CreateL()
+	{
+	}
+
+/** Destructor. */
+EXPORT_C CApaAppServiceBase::~CApaAppServiceBase()
+	{
+	if (!iNotifyExitMsg.IsNull() && (iExitReason != KRequestPending))
+		{
+		iNotifyExitMsg.Complete(iExitReason);
+		}
+	}
+
+/** Virtual framework function that is called on receipt
+of a message from the client. This allows the service implementation
+to define a security policy for messages from the client.
+The default behaviour of this function is to pass security checks.
+@param	aMsg The message to check.
+@param	aAction A reference to the action to take if the security check
+		fails. This is either a value from TFailureAction or a negative
+		value which has meaning to the CustomFailureActionL() method of
+		a derived class.
+		The policy server framework gives this value a default of
+		EFailClient.  If a derived implementation wishes a
+		different value, then it should change this.
+@param 	aMissing A reference to the list of security attributes missing
+		from the checked process.  The policy server initialises this
+		object to zero (that is a sid of 0, a vid of 0, and no capabilities).
+		If derived implementations wish to take advantage of a list of
+		missing attributes in their implementation of CustomFailureActionL(),
+		then they should set those missing attributes here in
+		CustomSecurityCheckL().
+@return A value from CPolicyServer::TCustomResult.
+@see CPolicyServer */
+EXPORT_C CPolicyServer::TCustomResult CApaAppServiceBase::SecurityCheckL(const RMessage2& /*aMsg*/, TInt& /*aAction*/, TSecurityInfo& /*aMissing*/)
+	{
+	return CPolicyServer::EPass;	// default is to pass security checks
+	}
+
+/** Framework function to handle client messages.
+Derived classes should override this method to receive messages from the client.
+These messages should have function ids starting from
+REikAppServiceBase::KServiceCmdBase.
+The behaviour for any unrecognised messages must be to
+base-call.
+@param aMessage The clients request message.
+@panic ApaAppServer 0 If this function does not recognise the function ID.*/
+EXPORT_C void CApaAppServiceBase::ServiceL(const RMessage2& aMessage)
+	{
+	switch (aMessage.Function())
+		{
+		case EApaAppServerNotifyServerExit:
+			NotifyServerExit(aMessage);
+			break;
+			
+		case EApaAppServerCancelNotifyServerExit:
+			CancelNotifyServerExit(aMessage);
+			break;
+			
+		default:
+			PanicAppServerClient(aMessage, EApaAppServerPanicIllegalFunction);
+			break;
+		}
+	}
+
+/** Handle leave errors from ServiceL().
+@param aMessage The client message that was being processed when the leave occured.
+@param aError The leave code. */
+EXPORT_C void CApaAppServiceBase::ServiceError(const RMessage2& aMessage,TInt aError)
+	{
+	CSession2::ServiceError(aMessage,aError);
+	}
+EXPORT_C TInt CApaAppServiceBase::CountResources()
+	{
+	return CSession2::CountResources();
+	}
+	
+EXPORT_C void CApaAppServiceBase::Disconnect(const RMessage2& aMessage)
+	{
+	CSession2::Disconnect(aMessage);
+	}
+void CApaAppServiceBase::NotifyServerExit(const RMessage2& aMessage)
+	{
+	if (!iNotifyExitMsg.IsNull())
+		{
+		PanicAppServerClient(aMessage, EApaAppServerPanicNotifyExitActive);
+		}
+	else
+		{
+		iNotifyExitMsg = aMessage;
+		iExitReason = KRequestPending;
+		}
+	}
+
+void CApaAppServiceBase::CancelNotifyServerExit(const RMessage2& aMessage) const
+	{
+	if (!iNotifyExitMsg.IsNull())
+		{
+		iNotifyExitMsg.Complete(KErrCancel);
+		}
+	aMessage.Complete(KErrNone);
+	}
+
+void CApaAppServiceBase::SendAppServerExitNotification(TInt aExitReason)
+	{
+	if (iExitReason == KRequestPending)
+		{
+		iExitReason = aExitReason;
+		}
+	}
+
+/** Extension mechanism - for internal BC proofing. */
+EXPORT_C void CApaAppServiceBase::ExtensionInterface(TUid /*aInterfaceId*/, TAny*& /*aImplementaion*/)
+	{
+	}
+EXPORT_C void CApaAppServiceBase::CApaAppServiceBase_Reserved1()
+	{
+	}
+	
+EXPORT_C void CApaAppServiceBase::CApaAppServiceBase_Reserved2()
+	{
+	}
+//
+// CApaAppServer
+//
+
+const TUint KApaAppServerRangeCount = 1;
+const TInt KApaAppServerRanges[KApaAppServerRangeCount] = 
+	{
+	0, //range is 0-KMaxTInt inclusive
+	};
+const TUint8 KApaAppServerElementsIndex[KApaAppServerRangeCount] = 
+	{
+	CPolicyServer::ECustomCheck, 	//applies to 0th range (req num: 0-KMaxTInt)
+	};
+//const CPolicyServer::TPolicyElement KApaAppServerElements[0] = 
+//	{
+//	}
+const CPolicyServer::TPolicy KApaAppServerPolicy =
+	{
+	CPolicyServer::ECustomCheck,
+	KApaAppServerRangeCount,					
+	KApaAppServerRanges,
+	KApaAppServerElementsIndex,
+	0,
+	};
+/** Constructor. */
+EXPORT_C CApaAppServer::CApaAppServer()
+:CPolicyServer(0,
+			   KApaAppServerPolicy,
+			   EUnsharableSessions)
+	{
+	}
+
+/** Destructor */
+EXPORT_C CApaAppServer::~CApaAppServer()
+	{
+	}
+
+/** Virtual ConstructL() function to allow second stage construction.
+This can be overridden for derived class construction, but must be
+base-called.
+@param aFixedServerName - the name that this server will use. */
+EXPORT_C void CApaAppServer::ConstructL(const TDesC& aFixedServerName)
+	{
+	StartL(aFixedServerName);
+	}
+
+EXPORT_C CSession2* CApaAppServer::NewSessionL(const TVersion& /*aVersion*/,const RMessage2& aMessage) const
+	{
+	TUid serviceUid = ConnectMessageServiceUid(aMessage);
+	return CreateServiceL(serviceUid);
+	}
+
+/** The server's main security checking function.
+This delegates connect checks to CreateServiceSecurityCheckL
+and checks on other messages to the target service implementation's
+SecurityCheckL function.
+For framework use only.
+@internalComponent */
+EXPORT_C CPolicyServer::TCustomResult CApaAppServer::CustomSecurityCheckL(const RMessage2& aMsg, TInt& aAction, TSecurityInfo& aMissing)
+	{
+	if (aMsg.Function() == RMessage2::EConnect)
+		{
+		TUid serviceUid = ConnectMessageServiceUid(aMsg);
+		return CreateServiceSecurityCheckL(serviceUid, aMsg, aAction, aMissing);
+		}
+	else
+		{
+		CApaAppServiceBase* service = static_cast<CApaAppServiceBase*>(aMsg.Session());
+		if (service)
+			{
+			return service->SecurityCheckL(aMsg, aAction, aMissing);
+			}
+		else
+			{
+			return CPolicyServer::EFail;
+			}
+		}
+	}
+
+/** Service creation function.
+When a client wants to connect to a server app, this function will be
+called to create the service requested by the client.
+This function must be overridden by server apps to create their
+implementations of the requested service.
+If the server app's implementation of this function does not recognise
+the service UID, it must base-call.
+@param aServiceType The UID of the service that the client wants to connect to.
+@return an object derived from CApaAppServiceBase that can handle the
+service type requested by the client. */
+EXPORT_C CApaAppServiceBase* CApaAppServer::CreateServiceL(TUid /*aServiceType*/) const
+	{
+	User::Leave(KErrNotSupported);
+	return NULL;
+	}
+
+/** Notifies clients that the server is going to exit.
+If a server application exits for any non-standard reason (ie anything
+except EEikCmdExit) this function should be called to forward the reason
+to the client. The UI framework will call this with EEikCmdExit if it has
+not already been done.
+@param aReason The exit reason from the server app. This will either be a
+               command ID, eg EEikCmdExit, or an error code, eg KErrServerTerminated.
+@see CEikAppUi::Exit */
+EXPORT_C void CApaAppServer::NotifyServerExit(TInt aReason)
+	{
+	iSessionIter.SetToFirst();
+	CSession2* s;
+	while ((s=iSessionIter++)!=NULL)
+		{
+		static_cast<CApaAppServiceBase*>(s)->SendAppServerExitNotification(aReason);
+		}
+	}
+
+/** Function to allow security checks on the client before they
+connect to a service.
+Server apps should override this method if they want to restict
+connections to some services to clients with particular capabilities.
+@param aServiceType The UID of the service that the client wants to connect to.
+@param	aMsg The message to check.
+@param	aAction A reference to the action to take if the security check
+		fails. This is either a value from TFailureAction or a negative
+		value which has meaning to the CustomFailureActionL() method of
+		a derived class.
+		The policy server framework gives this value a default of
+		EFailClient.  If a derived implementation wishes a
+		different value, then it should change this.
+@param 	aMissing A reference to the list of security attributes missing
+		from the checked process.  The policy server initialises this
+		object to zero (that is a sid of 0, a vid of 0, and no capabilities).
+		If derived implementations wish to take advantage of a list of
+		missing attributes in their implementation of CustomFailureActionL(),
+		then they should set those missing attributes here in
+		CustomSecurityCheckL().
+@return A value from CPolicyServer::TCustomResult.
+@see CPolicyServer */
+EXPORT_C CPolicyServer::TCustomResult CApaAppServer::CreateServiceSecurityCheckL(TUid /*aServiceType*/, const RMessage2& /*aMsg*/, TInt& /*aAction*/, TSecurityInfo& /*aMissing*/)
+	{
+	return CPolicyServer::EPass;
+	}
+
+TUid CApaAppServer::ConnectMessageServiceUid(const RMessage2& aMessage) const
+	{
+	// note: this function uses knowledge of the internal structure
+	// of connect messages
+	return TUid::Uid(aMessage.Int0());
+	}
+// From CServer2
+EXPORT_C void CApaAppServer::DoConnect(const RMessage2& aMessage)
+	{
+	CServer2::DoConnect(aMessage);
+	}
+	
+// Reserved
+EXPORT_C void CApaAppServer::CApaAppServer_Reserved1()
+	{
+	}
+	
+EXPORT_C void CApaAppServer::CApaAppServer_Reserved2()
+	{
+	}
+/** Extension mechanism - for internal BC proofing. */
+EXPORT_C void CApaAppServer::ExtensionInterface(TUid /*aInterfaceId*/, TAny*& /*aImplementaion*/)
+	{
+	}
+EXPORT_C MApaServerAppExitObserver::MApaServerAppExitObserver()
+	{
+	}
+	
+EXPORT_C void MApaServerAppExitObserver::MApaServerAppExitObserver_Reserved1()
+	{
+	}
+	
+EXPORT_C void MApaServerAppExitObserver::MApaServerAppExitObserver_Reserved2()
+	{
+	}
+//
+// static functions
+//
+
+void PanicAppServerClient(const RMessagePtr2& aMessage,TInt aPanic)
+	{
+	_LIT(KPanic,"ApaAppServer");
+	aMessage.Panic(KPanic,aPanic);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apparc/ApaServerAppPriv.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,33 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef APASERVERAPPPRIV_H
+#define APASERVERAPPPRIV_H
+
+#include "ApaServerApp.h"
+
+
+// client/server command ids for RApaAppServiceBase and CApaAppServiceBase
+enum TApaAppServerCommandId
+	{
+	EApaAppServerNotifyServerExit = 1,
+	EApaAppServerCancelNotifyServerExit
+	};
+
+
+void PanicAppServerClient(const RMessagePtr2& aMessage,TInt aCode);
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apparc/TRACE.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,29 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// peppers apparc code with RDebug::Print()'s under certain circumstances...
+//
+
+// #define __SHOW_TRACE(aString) RDebug::Print(aString)
+//
+
+
+
+#define __SHOW_TRACE(aString)
+
+/*
+#define __APA_PROFILE_START(aNum) RDebug::ProfileStart(aNum)
+#define __APA_PROFILE_END(aNum) RDebug::ProfileEnd(aNum)
+*/
+#define __APA_PROFILE_START(aNum)
+#define __APA_PROFILE_END(aNum)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apserv/APSCLSV.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,191 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#if !defined(__APGCLSV_H__)
+#define __APGCLSV_H__
+
+#if !defined(__E32BASE_H__)
+#include <e32base.h>
+#endif
+#if !defined(__APAID_H__)
+#include <apaid.h>
+#endif
+#if !defined(__APMSTD_H__)
+#include <apmstd.h>
+#endif
+
+// A version must be specifyed when creating a session with the server
+const TUint KAppListServMajorVersionNumber=7;
+const TUint KAppListServMinorVersionNumber=1;
+const TUint KAppListServBuildVersionNumber=117;
+
+enum TAppListServRanges
+	{
+	EFirstUnrestrictedOpcodeInAppListServ,
+	EFirstOpcodeNeedingWriteDeviceDataInAppListServ=100,
+	};
+
+// opcodes used in message passing between client and server
+enum TCountServRqst
+	{
+	//No Capability requirement
+	EAppListServFirst = EFirstUnrestrictedOpcodeInAppListServ,
+	EAppListServInitFullList,
+	EAppListServInitEmbedList,
+	EAppListServGetNextApp,
+	EAppListServEmbedCount,
+	EAppListServAppCount,
+	EAppListServGetAppInfo,
+	EAppListServGetAppCapability,
+	EAppListServStartAppWithoutReturningThreadId,
+	EAppListServStartAppReturningThreadId,
+	EAppListServRecognizeData,
+	EAppListServRecognizeDataPassedByFileHandle,
+	EAppListServRecognizeSpecificData,
+	EAppListServRecognizeSpecificDataPassedByFileHandle,
+	EAppListServAppForDataType,
+	EAppListServStartDocument,
+	EAppListServStartDocumentByDataType,
+	EAppListServStartDocumentByUid,
+	EAppListServCreateDocumentByUid,
+	EAppListServGetExecutableNameGivenDocument,
+	EAppListServGetExecutableNameGivenDocumentPassedByFileHandle,
+	EAppListServGetExecutableNameGivenDataType,
+	EAppListServGetExecutableNameGivenAppUid,
+	EAppListServGetOpaqueData,
+	EAppListServGetNativeExecutableNameIfNonNative,
+	EAppListServAppIconByUid,
+	EAppListServAppForDocument,
+	EAppListServAppForDocumentPassedByFileHandle,
+	EAppListServGetConfidence,
+	EAppListServGetBufSize,
+	EAppListServSetBufSize,
+	EAppListServGetDataTypesPhase1,
+	EAppListServGetDataTypesPhase2,
+	ESetNotify,
+	ECancelNotify,
+	EDCloseServer,
+	EAppListServAppIconByUidAndSize,
+	EAppListServGetAppIconSizes,
+	EAppListServGetAppViews,
+	EAppListServViewIconByUidAndSize,
+	EAppListServGetFileOwnershipInfo,
+	EAppListServNumberOfOwnDefinedIcons,
+	EAppListServInitFilteredEmbedList,
+	EAppListServInitAttrFilteredList,
+	EAppListServAppIconFileName,
+	EAppListServAppViewIconFileName,
+	EAppListServInitServerAppList,
+	EAppListServGetAppServices,
+	EAppListServGetServiceImplementations,
+	EAppListServGetServiceImplementationsDataType,
+	EAppListServGetAppServiceUids,
+	EAppListServGetAppServiceOpaqueData,
+	EAppListServAppForDataTypeAndService,
+	EAppListServAppForDocumentAndService,
+	EAppListServAppForDocumentAndServicePassedByFileHandle,
+	EAppListServApplicationLanguage,
+	ERegisterListPopulationCompleteObserver,
+	ECancelListPopulationCompleteObserver,
+	EAppListServPreferredBufSize,
+	EAppListServRecognizeFiles,
+	EAppListServRecognizeFilesAsync,
+	ECancelRecognizeFiles,
+	EAppListServTransferRecognitionResult,
+	EAppListServGetAppByDataType,
+	EAppListServGetDefaultScreenNumber,
+	EAppListServRuleBasedLaunching,
+	EAppListServRegisterNonNativeApplicationType,
+	EAppListServDeregisterNonNativeApplicationType,
+	EAppListServPrepareNonNativeApplicationsUpdates,
+	EAppListServRegisterNonNativeApplication,
+	EAppListServDeregisterNonNativeApplication,
+	EAppListServCommitNonNativeApplications,
+	EAppListServRollbackNonNativeApplications,
+	EAppListServGetAppType,
+	ENotifyOnDataMappingChange,
+	ECancelNotifyOnDataMappingChange,
+	EMatchesSecurityPolicy,
+	EAppListServSetAppShortCaption,
+	EAppListServForceRegistration,
+	EDebugHeapMark,
+	EDebugHeapMarkEnd,
+	EDebugHeapFailNext,
+	EDebugClearAppInfoArray,
+	EDebugFlushRecognitionCache,
+	EDebugSetLoadRecognizersOnDemand,
+	EDebugPerformOutstandingRecognizerUnloading,
+	EAppListServAppIconFileHandle,
+	EDebugAddFailingNonNativeApplicationsUpdate,
+	EDebugAddPanicingNonNativeApplicationsUpdate,
+	EDebugAddRollbackPanicingNonNativeApplicationsUpdate, // = 89
+	EAppListServAppInfoProvidedByRegistrationFile = 99,
+	//WriteDeviceData Capability requirement
+	// ER5
+	EAppListServSetConfidence=EFirstOpcodeNeedingWriteDeviceDataInAppListServ,
+	// 8.1
+	EAppListInsertDataMapping,
+	EAppListInsertDataMappingIfHigher,
+	EAppListDeleteDataMapping,
+	// End Marker no Capability
+	EAppListFirstUnusedOpcode,
+ 	};
+
+
+enum TApaClientPanic
+	{
+	EClientBadRequest,
+	EClientBadDescriptor,
+	ENotifierAlreadyPresent,
+	ENoSupportedDataTypes,
+	EObserverAlreadyPresent,
+	ENotifyOnDataMappingChangeRequestOutstanding
+#if defined(UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER)
+	,EInvalidFileName
+#endif
+	};
+
+
+struct SReturnData_AppForDocument
+	{
+	TUid iUid;
+	TDataType iDataType;
+	};
+
+struct SReturnData_AppIconByUid
+	{
+	TInt iIcon;
+	TInt iIconMask;
+	};
+
+struct SReturnData_AppIconByUidAndSize
+	{
+	TInt iIcon;
+	TInt iIconMask;
+	};
+
+struct SReturnData_ViewIconByUidAndSize
+	{
+	TInt iIcon;
+	TInt iIconMask;
+	};
+
+struct SNonNativeApplicationInfo
+	{
+	TUid iApplicationType;
+	TInt iDrive;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apserv/APSCONSTDATA.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,87 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <e32def.h>
+
+/*
+ * patchable const data values
+ * 
+ * these values control whether apparc tries to save memory by unloading data
+ * recognizers when they are not being used
+ *
+ * To patch these values, add a line to an iby or oby file that is included in the rom being built using the following format:
+ *
+ * "patchdata <dll> @ <symbol> <newvalue>"
+ *
+ * e.g. to enable on-demand recognizer loading, use the following line:
+ * "patchdata apserv.dll @ KApaLoadDataRecognizersOnDemand 1"
+ */
+
+
+/**
+ * Patchable constant.  Determines whether, in the interest of saving memory, AppArc unloads data 
+ * recognizers when they are not being used.
+ *
+ * @SYMPatchable
+ * @see KApaUnloadRecognizersTimeout 
+ *
+ */
+EXPORT_C extern const TInt KApaLoadDataRecognizersOnDemand = 0;
+
+/**
+ * Patchable constant.  Determines how long (in microseconds) a recognizer may remain unused before it gets deleted.
+ * 
+ * @SYMPatchable
+ * @see KApaLoadDataRecognizersOnDemand 
+ *
+ */ 
+EXPORT_C extern const TInt KApaUnloadRecognizersTimeout = 10000000; // 10 seconds in microseconds
+
+
+/* 
+ * emulator support
+ * to enable on-demand recognizer loading on the emulator, add the following line to your epoc.ini
+ * patchdata_apserv_dll_KApaLoadDataRecognizersOnDemand 1
+ */
+
+/*
+ * Patchable constant.  
+ *
+ * @SYMPatchable
+ * @see KApaDrivesToMonitor 
+ *
+ */
+
+EXPORT_C extern const TInt KApaDrivesToMonitor = 0x3FFFFFF; 
+/*
+The constant value 0x3FFFFFF represents that all drives (z->a(Least Significant Bit)) are monitored by default.
+It is computed in the following way.
+	        ZY XWVU TSRQ PONM LKJI HGFE DCBA
+	 		11 1111 1111 1111 1111 1111 1111. 
+If the bit representing a drive is set (to 1) it is monitored for file change notifications. 
+Else it is not. 
+*/
+
+/** 
+ * Patchable constant.  Determines whether apparc tries to save memory in the font bitmap
+ * server, by only loading MBM icons on demand.
+ * The default value is 0.
+ * When set to zero, all MBM icons are loaded at device boot and never unloaded.
+ * When set to non-zero, no MBM icons are loaded at device boot. MBM icons are
+ * loaded on demand (and never unloaded afterwards). 
+ * 
+ * @SYMPatchable
+ */
+EXPORT_C extern const TInt KApaLoadMbmIconsOnDemand = 0;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apserv/APSERV.MMP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+//
+// APSERV.MMP for component APSERV
+//
+
+/**
+@file
+
+@SYMPurpose apserv.dll Apparc server
+*/
+
+
+target          apserv.dll
+CAPABILITY All -Tcb
+targettype      DLL
+UID		0x1000008D 0x10003A3E
+VENDORID 0x70000001
+
+SOURCEPATH	../apserv
+
+userinclude		../inc ../apparc
+userinclude		../apgrfx
+systeminclude   /epoc32/include
+
+
+source          APSSERV.CPP APSSES.CPP APSSTD.CPP APSSCAN.CPP
+source          APSSTART.CPP APSRECCACHE.cpp APSRECUTIL.CPP
+source	        APSCONSTDATA.CPP
+source          apsnnapps.cpp apsnnappupdates.cpp
+source			apsiconcaptionoverride.cpp
+
+library         euser.lib efsrv.lib apparc.lib apgrfx.lib apmime.lib fbscli.lib apfile.lib
+library         estor.lib bafl.lib ws32.lib
+library			centralrepository.lib
+
+#if !defined(WINC)
+macro			USING_ECOM_RECOGS
+library         ecom.lib
+#endif
+
+macro UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER
+
+deffile 	APSERV.DEF
+
+START WINS
+	baseaddress	0x43700000
+END
+
+START MARM
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apserv/APSRECCACHE.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,391 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "APSRECCACHE.h"
+#include "APSSES.H"
+
+//////////////////////////////////////////////////////////////////////////////
+// Constants
+
+const TUint KMaxNumberOfEntries = 200;
+//////////////////////////////////////////////////////////////////////////////
+
+CRecognitionResultHashMapEntry* CRecognitionResultHashMapEntry::NewL(const TDesC& aFileName, TTime aLastModified, const TDataRecognitionResult& aResult, CRecognitionResultHashMapEntry* aNext)
+	{
+	CRecognitionResult* result = CRecognitionResult::NewL(aFileName, aResult);
+	CleanupClosePushL(*result);
+	CRecognitionResultHashMapEntry* self = new(ELeave) CRecognitionResultHashMapEntry(aLastModified, result, aNext);
+	CleanupStack::Pop(result);	
+	return self;
+	}
+
+CRecognitionResultHashMapEntry::CRecognitionResultHashMapEntry(TTime aLastModified, CRecognitionResult* aResult, CRecognitionResultHashMapEntry* aNext)
+	: iLastModified(aLastModified), iResult(aResult), iNext(aNext)
+	{
+	}
+
+CRecognitionResultHashMapEntry::~CRecognitionResultHashMapEntry()
+	{
+	iResult->Close();
+	iResult = NULL;
+	delete iNext;
+	}
+
+void CRecognitionResultHashMapEntry::UpdateL(TTime aLastModified, const TDataRecognitionResult& aResult)
+	{
+	// since other objects  might have a pointer to the CRecognitionResult object
+	// and rely on the value not changing we need to create a new object to take 
+	// its place.
+	
+	CRecognitionResult* result = CRecognitionResult::NewL(FileName(), aResult);
+	iResult->Close();
+	iResult = result;
+	
+	iLastModified = aLastModified;
+	}
+
+///////////////////////////////////////////////////////////////////////
+// CRecognitionResultHashMap
+///////////////////////////////////////////////////////////////////////
+
+CRecognitionResultHashMap::CRecognitionResultHashMap()
+	{
+	}
+
+CRecognitionResultHashMap::~CRecognitionResultHashMap()
+	{
+	for(TUint i = 0; i < KFileHashMapEntries; i++)
+		{
+		delete Entry(i);
+		}
+	}
+
+CRecognitionResult* CRecognitionResultHashMap::Get(const TDesC& aKey, TTime& aLastModified) const
+	{
+	const TUint index = GetIndex(aKey);
+
+	for(const CRecognitionResultHashMapEntry* entry = Entry(index); entry; entry = entry->Next())
+		{
+		if(entry->FileName().Compare(aKey) == 0)
+			{
+			aLastModified = entry->LastModified();
+			return entry->Result();
+			}
+		}
+	return NULL;
+	}
+
+/**
+Adds a recognition result to the hash map of the particular directory.
+This is only done if it isn't already existing.
+The return value specifies if the number of entries was increased by one (ETrue) or not.
+@internalComponent
+*/
+TBool CRecognitionResultHashMap::AddL(const TDesC& aKey, TTime aLastModified, const TDataRecognitionResult& aResult)
+	{
+	const TUint index = GetIndex(aKey);
+
+	//check if there already is an entry for the file
+	for(CRecognitionResultHashMapEntry* entry = Entry(index); entry; entry = entry->Next())
+		{
+		if(entry->FileName().Compare(aKey) == 0)
+			{
+			// already there -> check modification date
+			if( entry->LastModified() != aLastModified )
+				{
+				entry->UpdateL(aLastModified, aResult);
+				}
+
+			return EFalse;
+			}
+		}
+
+	//create new entry
+	SetEntry(index, CRecognitionResultHashMapEntry::NewL(aKey, aLastModified, aResult, Entry(index)));
+	iNumberOfEntries++;
+	return ETrue;
+	}
+	
+TUint CRecognitionResultHashMap::GetIndex(const TDesC& aKey) const
+	{
+	// That's the hash algorithm
+	TUint hash = aKey.Length();
+	for(TUint i=0;i< aKey.Length();i++)
+		{
+		hash += aKey[i];
+		}
+	return hash % KFileHashMapEntries;
+	}
+	
+
+///////////////////////////////////////////////////////////////////////
+// CCacheDirectoryEntry
+///////////////////////////////////////////////////////////////////////
+
+CCacheDirectoryEntry* CCacheDirectoryEntry::NewL(const TDesC& aDirectory)
+	{
+	CCacheDirectoryEntry* self = new(ELeave) CCacheDirectoryEntry;
+	CleanupStack::PushL(self);
+	self->iDirectory = aDirectory.AllocL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+CCacheDirectoryEntry::CCacheDirectoryEntry()
+	{
+	}
+
+CCacheDirectoryEntry::~CCacheDirectoryEntry()
+	{
+	delete iDirectory;
+	}
+
+const TInt CCacheDirectoryEntry::iOffset = _FOFF(CCacheDirectoryEntry,iDlink);
+
+///////////////////////////////////////////////////////////////////////
+// CApsRecognitionCache
+///////////////////////////////////////////////////////////////////////
+
+CApsRecognitionCache::CApsRecognitionCache(RFs& aFs)
+	: iFs(aFs),
+	  iDirectoryHeader(CCacheDirectoryEntry::iOffset),
+	  iIter(iDirectoryHeader)
+	{
+	}
+
+CApsRecognitionCache::~CApsRecognitionCache()
+	{
+    CCacheDirectoryEntry* anyitem;
+    
+    iIter.SetToFirst();
+    while ((anyitem = iIter++) != NULL)
+        {
+        anyitem->iDlink.Deque();
+        delete anyitem;
+        };
+	}
+
+/**
+Adds a recognition result to the cache. An object is not added, when an up-to-date
+version is already in the cache or if it's not possible to check the file's LastModified().
+@internalComponent
+*/
+void CApsRecognitionCache::AddL(const TDesC& aDirectory, const TDesC& aFileName, const TDataRecognitionResult& aRecognitionResult)
+	{
+	TTime lastModified;
+	TFileName fullFileName(aDirectory);
+	fullFileName.Append(aFileName);
+	if(iFs.Modified(fullFileName, lastModified) != KErrNone)
+		{
+	#if defined(_DEBUG)
+		RDebug::Print(_L("CApsRecognitionCache::AddL(): File '%S' was not added to the cache, cannot get the modified attribute (full filename is required for the cache to work)."), &fullFileName);
+	#endif
+		return;
+		}
+	DoAddL(aDirectory, aFileName, lastModified, aRecognitionResult);
+	}
+ 
+/**
+Adds a recognition result to the cache. An object is not added, when an up-to-date
+version is already in the cache or if it's not possible to check the file's LastModified().
+@internalComponent
+*/
+void CApsRecognitionCache::AddL(const RFile& aFile, const TDesC& aDirectory, const TDesC& aFileName, const TDataRecognitionResult& aRecognitionResult)
+	{
+	TTime lastModified;
+	if(aFile.Modified(lastModified) != KErrNone)
+		{
+	#if defined(_DEBUG)
+		TFileName fullFileName(aDirectory);
+		fullFileName.Append(aFileName);
+		RDebug::Print(_L("CApsRecognitionCache::AddL(): File '%S' was not added to the cache, cannot get the modified attribute."), &fullFileName);
+	#endif
+		return;
+		}
+	DoAddL(aDirectory, aFileName, lastModified, aRecognitionResult);
+	}
+
+/**
+Adds a recognition result to the cache. An object is not added, when an up-to-date
+version is already in the cache or if it's not possible to check the file's LastModified().
+@internalComponent
+*/
+void CApsRecognitionCache::DoAddL(const TDesC& aDirectory, const TDesC& aFileName, const TTime& aLastModified, const TDataRecognitionResult& aRecognitionResult)
+	{
+	if(iNumberOfEntries > KMaxNumberOfEntries)
+		{
+		Cleanup();
+		}
+		
+	CCacheDirectoryEntry* entry = NULL;
+    iIter.SetToFirst();
+    while ((entry = iIter++) != NULL)
+    	{
+		if(CompareDirectories(entry->Directory(),aDirectory))
+			{
+			// move directory to top (it is likely to be used again soon)
+			entry->iDlink.Deque();
+			iDirectoryHeader.AddFirst(*entry);
+			break;
+			}
+    	}
+
+	if(!entry)
+		{
+		// create directory and append it
+		entry = CCacheDirectoryEntry::NewL(aDirectory);
+		iDirectoryHeader.AddFirst(*entry);
+		}
+
+	// insert to correct directory
+	if(entry->Files().AddL(aFileName, aLastModified, aRecognitionResult))
+		{
+		iNumberOfEntries++;
+		}
+	}
+
+/**
+Searches the cache for the particular recognition result. If the file was not modified since the
+file was recognized, the stored recognition result is returned.
+@internalComponent
+*/
+TBool CApsRecognitionCache::Get(const TDesC& aDirectory, const TDesC& aFileName, TDataRecognitionResult& aRecognitionResult)
+	{
+	TTime lastModified;
+	TFileName fileName(aDirectory);
+	fileName.Append(aFileName);
+	const TInt error = iFs.Modified(fileName, lastModified);
+	if(error != KErrNone) 
+		{
+		return EFalse;
+		}
+
+	CRecognitionResult* result = DoGet(aDirectory, aFileName, lastModified);
+	if(result)
+		{
+		result->Get(aRecognitionResult);
+		result->Close(); // decrease reference count since we're not exposing the object
+		return ETrue;
+		}
+	return EFalse;
+	}
+
+/**
+Searches the cache for the particular recognition result. If the file was not modified since the
+file was recognized, the stored recognition result is returned.
+
+N.B. The returned value is reference counted!
+@internalComponent
+*/
+CRecognitionResult* CApsRecognitionCache::Get(const RFile& aFile, const TDesC& aDirectory, const TDesC& aFileName)
+	{	
+	TTime lastModified;
+	const TInt error = aFile.Modified(lastModified);
+	if(error != KErrNone)
+		{
+		return NULL;
+		}
+
+	return DoGet(aDirectory, aFileName, lastModified);
+	}
+
+/**
+Searches the cache for the particular recognition result. If the file was not modified since the
+file was recognized, the stored recognition result is returned.
+
+N.B. The returned value is reference counted!
+@internalComponent
+*/
+CRecognitionResult* CApsRecognitionCache::DoGet(const TDesC& aDirectory, const TDesC& aFileName, const TTime& aLastModified)
+	{	
+	CRecognitionResult* result = NULL;
+	CCacheDirectoryEntry* entry;
+
+    iIter.SetToFirst();
+    while ((entry = iIter++) != NULL)
+    	{
+    	if(CompareDirectories(entry->Directory(),aDirectory))
+    		{
+    		TTime cachedLastModified;
+			result = entry->Files().Get(aFileName, cachedLastModified);
+			if(result)
+				{
+				if(cachedLastModified != aLastModified)
+					{
+					result->Close();
+					result = NULL;
+					}
+				}
+
+			// move directory to top (it is likely to be used again soon)
+			entry->iDlink.Deque();
+			iDirectoryHeader.AddFirst(*entry);
+			break;
+    		}
+    	}
+	return result;
+	}
+
+/**
+A fast comparison of two directory names.
+Should be faster than the "normal" TDesC16::Compare function, because
+there is no need to check which string is "greater".
+@internalComponent
+*/
+TBool CApsRecognitionCache::CompareDirectories(const TDesC& aDir1, const TDesC& aDir2) const
+	{
+	TBool equal = ETrue;
+	if(aDir1.Length() == aDir2.Length())
+		{
+		// start with the last character, as directories tend to be the same at the beginning
+		for(TInt i=aDir1.Length()-1; i>=0; i--)
+			{
+			if(aDir1[i] != aDir2[i])
+				{
+				// return as soon one character is "wrong"
+				equal = EFalse;
+				break;
+				}
+			}
+		}
+	else
+		{
+		equal = EFalse;
+		}
+	return equal;
+	}
+/**
+Removes the least-often used directory in the cache.
+@internalComponent
+*/
+void CApsRecognitionCache::Cleanup()
+	{
+    CCacheDirectoryEntry* item = iDirectoryHeader.Last();
+    iNumberOfEntries -= item->NumberOfEntries();
+    item->iDlink.Deque();
+    delete item;
+	}
+
+/**
+Empties the cache. Useful mainly for testing.
+@internalComponent
+*/
+void CApsRecognitionCache::Flush()
+	{
+	while(!iDirectoryHeader.IsEmpty())
+		{
+		Cleanup();
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apserv/APSRECCACHE.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,157 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#if !defined(__APSRECCACHE_H__)
+#define __APSRECCACHE_H__
+
+#include <e32base.h>
+#include <apmrec.h>
+#include "APSRECUTIL.H"
+
+const TUint KFileHashMapEntries = 40;
+
+/**
+An entry for a recognized file in the recognition cache.
+The entries is organized as single-linked list.
+The recognition result itself is reference-counted.
+@internalComponent
+*/
+class CRecognitionResultHashMapEntry : public CBase
+	{
+public:
+	static CRecognitionResultHashMapEntry* NewL(const TDesC& aFileName, TTime aLastModified, const TDataRecognitionResult& aResult, CRecognitionResultHashMapEntry* aNext);
+	~CRecognitionResultHashMapEntry();
+	
+	inline const CRecognitionResultHashMapEntry* Next() const { return iNext; }
+	inline CRecognitionResultHashMapEntry* Next() { return iNext; }
+	inline TTime LastModified() const { return iLastModified; }
+	inline const TDesC& FileName() const { return iResult->FileName(); }
+	inline CRecognitionResult* Result() const { iResult->Open(); return iResult; }
+		
+	void UpdateL(TTime aLastModified, const TDataRecognitionResult& aResult);
+private:
+	CRecognitionResultHashMapEntry(TTime aLastModified, CRecognitionResult* aResult, CRecognitionResultHashMapEntry* aNext);
+private:
+	TTime iLastModified;
+	CRecognitionResult* iResult;
+	CRecognitionResultHashMapEntry* iNext;
+	};
+
+/**
+A hash map for finding and adding recognition results.
+
+@internalComponent
+*/
+class CRecognitionResultHashMap : public CBase
+	{
+public:
+	CRecognitionResultHashMap();
+	~CRecognitionResultHashMap();
+	CRecognitionResult* Get(const TDesC& aKey, TTime& aLastModified) const;
+	TBool AddL(const TDesC& aKey, TTime aLastModified, const TDataRecognitionResult& aResult);
+	inline TUint NumberOfEntries() const { return iNumberOfEntries; }
+protected:
+	TUint GetIndex(const TDesC& aKey) const;
+private:
+	inline CRecognitionResultHashMapEntry* Entry(TUint aIndex);
+	inline const CRecognitionResultHashMapEntry* Entry(TUint aIndex) const;
+	inline void SetEntry(TUint aIndex, CRecognitionResultHashMapEntry* aEntry);
+private:
+	TUint iNumberOfEntries;
+	CRecognitionResultHashMapEntry* iEntries[KFileHashMapEntries];
+	};
+
+/**
+A directory entry in the cache.
+Such an entry doesn't necessarily hold all files of a directory, but
+only the ones that have been recognized so far.
+@internalComponent
+*/
+class CCacheDirectoryEntry : public CBase
+	{
+public:
+	static CCacheDirectoryEntry* NewL(const TDesC& aDirectory);
+	~CCacheDirectoryEntry();
+	inline const TDesC& Directory() const { return *iDirectory; }
+	inline CRecognitionResultHashMap& Files() { return iFiles; } //lint !e1536 Suppress exposing low access member
+	inline TUint NumberOfEntries() const { return iFiles.NumberOfEntries(); }
+private:
+	CCacheDirectoryEntry();
+public:
+	static const TInt iOffset;
+private:
+	HBufC* iDirectory; // own copy!
+	CRecognitionResultHashMap iFiles;
+	TDblQueLink iDlink;
+	friend class CApsRecognitionCache;
+	};
+
+/**
+A recognition result cache.
+The cache holds a list of directories (stored as an RPointerArray). Recently
+used directories are stored on top of the list, rarely used directories are
+stored at the bottom. 
+
+This strategy improves performance: 
+search for files is started at the top (principle of locality) 
+and cleanup is done from the bottom.
+
+The files themselves are stored in a hash map (within directories).
+@internalComponent
+*/
+class CApsRecognitionCache : public CBase
+	{
+public:
+	CApsRecognitionCache(RFs& aFs);
+	~CApsRecognitionCache();
+	void AddL(const TDesC& aDirectory, const TDesC& aFileName, const TDataRecognitionResult& aRecognitionResult);
+	void AddL(const RFile& aFile, const TDesC& aDirectory, const TDesC& aFileName, const TDataRecognitionResult& aRecognitionResult);
+	TBool Get(const TDesC& aDirectory, const TDesC& aFileName, TDataRecognitionResult& aRecognitionResult);
+	CRecognitionResult* Get(const RFile& aFile, const TDesC& aDirectory, const TDesC& aFileName);
+	void Flush();
+private:
+	void DoAddL(const TDesC& aDirectory, const TDesC& aFileName, const TTime& aLastModified, const TDataRecognitionResult& aRecognitionResult);
+	CRecognitionResult* DoGet(const TDesC& aDirectory, const TDesC& aFileName, const TTime& aLastModified);
+	TBool CompareDirectories(const TDesC& aDir1, const TDesC& aDir2) const;
+	void Cleanup();
+private: // data
+	RFs& iFs;
+	TDblQue<CCacheDirectoryEntry> iDirectoryHeader;
+	TDblQueIter<CCacheDirectoryEntry> iIter;
+	TUint iNumberOfEntries;
+	};
+
+
+//inlines
+
+inline CRecognitionResultHashMapEntry* CRecognitionResultHashMap::Entry(TUint aIndex)
+	{
+	ASSERT(aIndex < KFileHashMapEntries);
+	return iEntries[aIndex];
+	}  //lint !e1762 Suppress member function could be made const
+
+inline const CRecognitionResultHashMapEntry* CRecognitionResultHashMap::Entry(TUint aIndex) const
+	{
+	ASSERT(aIndex < KFileHashMapEntries);
+	return iEntries[aIndex];
+	}
+
+inline void CRecognitionResultHashMap::SetEntry(TUint aIndex, CRecognitionResultHashMapEntry* aEntry)
+	{
+	ASSERT(Entry(aIndex) == aEntry->Next());
+	iEntries[aIndex] = aEntry;
+	}
+
+#endif // __APSRECCACHE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apserv/APSRECUTIL.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,275 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Classes for synchronous and asynchronous file recognitions (of a directory)
+// 
+//
+
+
+#include "APSRECUTIL.H"
+#include "APSRECCACHE.h"
+
+//////////////////////////////
+// CRecognitionResult
+//////////////////////////////
+
+CRecognitionResult* CRecognitionResult::NewL(const TDesC& aFileName, const TDataRecognitionResult& aRecognitionResult)
+	{
+	ASSERT(aFileName.Find(_L("\\")) == KErrNotFound); // the filename should not contain any path
+
+	HBufC* fileName = aFileName.AllocLC();
+	HBufC8* dataType = aRecognitionResult.iDataType.Des8().AllocLC();	
+	CRecognitionResult* self = new(ELeave) CRecognitionResult(fileName, dataType, aRecognitionResult.iDataType.Uid(), aRecognitionResult.iConfidence);
+	CleanupStack::Pop(2, fileName);
+	return self;
+	}
+
+CRecognitionResult::CRecognitionResult(HBufC* aFileName, HBufC8* aDataType, TUid aUid, TInt aConfidence)
+	: iFileName(aFileName),
+	  iDataType(aDataType),
+ 	  iUid(aUid), 
+	  iConfidence(aConfidence)
+	{
+	}
+
+CRecognitionResult::~CRecognitionResult()
+	{
+	delete iFileName;
+	delete iDataType;
+	}
+
+void CRecognitionResult::Get(TDataRecognitionResult& aRecognitionResult)
+	{
+	if(iUid == KNullUid)
+
+		{
+		aRecognitionResult.iDataType = TDataType(*iDataType);
+		}
+	else
+		{
+		aRecognitionResult.iDataType = TDataType(iUid);
+		}
+	aRecognitionResult.iConfidence = iConfidence;
+	}
+	
+
+
+TUint CRecognitionResult::GetRequiredBufferSize() const
+	{
+	return iFileName->Size() + iDataType->Size() + sizeof(TUid) + sizeof(TInt) + 2;
+	}
+
+void CRecognitionResult::WriteToStreamL(RWriteStream& aWriteStream)
+	{
+	aWriteStream.WriteUint8L(iFileName->Length());
+	aWriteStream.WriteL(*iFileName);
+	aWriteStream.WriteUint8L(iDataType->Length());
+	aWriteStream.WriteL(*iDataType);
+	aWriteStream.WriteInt32L(iUid.iUid);
+	aWriteStream.WriteInt32L(iConfidence);
+	}
+	
+///////////////////////////////////
+// CDirectoryRecognitionResult
+///////////////////////////////////
+
+CDirectoryRecognitionResult::CDirectoryRecognitionResult(HBufC* aPath, HBufC8* aDataTypeFilter)
+	: iPath(aPath), iDataTypeFilter(aDataTypeFilter)
+	{
+	iRequiredBufferSize = sizeof(TUint);
+	}
+
+CDirectoryRecognitionResult::~CDirectoryRecognitionResult()
+	{
+	delete iPath;
+	delete iDataTypeFilter;
+	
+	const TInt count = iEntries.Count();
+	for(TInt i = 0; i < count; i++)
+		{
+		iEntries[i]->Close();
+		}
+	iEntries.Reset();
+	}
+
+void CDirectoryRecognitionResult::AppendL(CRecognitionResult* aEntry)
+	{
+	if(iDataTypeFilter)
+		{
+		if(aEntry->DataType().Match(*iDataTypeFilter) == KErrNotFound)
+			{
+			aEntry->Close(); //if we don't take ownership we must decrease reference count
+			return;
+			}
+		}
+
+	iEntries.AppendL(aEntry);
+	iRequiredBufferSize += aEntry->GetRequiredBufferSize();
+	} //lint !e818: Pointer parameter could be declared as pointing to const
+
+void CDirectoryRecognitionResult::WriteToStreamL(RWriteStream& aWriteStream)
+	{
+	aWriteStream.WriteUint32L(iEntries.Count());
+	for (TInt i=0; i < iEntries.Count(); i++)
+		{
+		iEntries[i]->WriteToStreamL(aWriteStream);
+		}
+	aWriteStream.CommitL();
+	}
+
+//////////////////////////////////////////////////////////
+// CFileRecognitionUtility
+//////////////////////////////////////////////////////////
+
+CFileRecognitionUtility::CFileRecognitionUtility(CApaAppListServer& aServer, TInt aMaxBufSize, RFs& aFs)
+	: CActive(0), 
+	  iServer(aServer), 
+	  iMaxBufSize(aMaxBufSize), 
+	  iFs(aFs),
+	  iIndex(0),
+	  iStep(0)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+CFileRecognitionUtility::~CFileRecognitionUtility()
+	{
+	Cancel();
+	delete iEntryList;
+	
+	iPath = NULL;
+	iResult = NULL;
+	}
+
+void CFileRecognitionUtility::RecognizeSynchronouslyL(CDirectoryRecognitionResult& aResult)
+	{
+	iPath = &(aResult.Path());
+	iResult = &aResult;
+
+	User::LeaveIfError(iFs.IsValidName(iPath->Des()));
+
+	ReadDirectoryL();
+
+	// recognize files and calculate size of buffer
+	for(iIndex=0;iIndex<iEntryList->Count();iIndex++)
+		{
+		RecognizeFileL();
+		}
+		
+	delete iEntryList;
+	iEntryList = NULL;
+	}
+
+void CFileRecognitionUtility::RecognizeAsynchronously(CDirectoryRecognitionResult& aResult, const RMessage2& aMessage)
+	{
+	iIndex = 0;
+	iStep = 0;
+	iPath = &(aResult.Path());
+	iResult = &aResult;
+	iMessage = aMessage;
+
+	NextStep();
+	}
+
+void CFileRecognitionUtility::ReadDirectoryL()
+	{
+	delete iEntryList;
+	iEntryList = NULL;
+
+	// read directory content
+	User::LeaveIfError(iFs.GetDir(iPath->Des(),KEntryAttNormal,EDirsAnyOrder,iEntryList));
+	}
+	
+TInt CFileRecognitionUtility::BufferSizeL() const
+	{
+	const TInt preferredBufferSize = iServer.DataRecognizerPreferredBufSizeL();
+	TInt bufSize=Min(preferredBufferSize,iMaxBufSize);
+	if (bufSize<1)
+		{
+		bufSize=8; // sensible minimum.
+		}
+	return bufSize;
+	}
+
+void CFileRecognitionUtility::RecognizeFileL()
+	{
+	TFileName fullFileName(*iPath);
+	fullFileName.Append((*iEntryList)[iIndex].iName);
+	RFile file;
+	User::LeaveIfError(file.Open(iFs, fullFileName, EFileRead | EFileShareReadersOnly));
+	CleanupClosePushL(file);
+	
+	CRecognitionResult* result = NULL;
+	TRAP_IGNORE(result = iServer.RecognizeDataAsCRecognitionResultL(file, BufferSizeL()));
+	if(result)
+		{
+		CleanupClosePushL(*result);
+		iResult->AppendL(result);
+		CleanupStack::Pop(result);
+		}
+	
+	CleanupStack::PopAndDestroy(&file);
+	}
+
+void CFileRecognitionUtility::CancelRecognitionRequest()
+	{
+	if(iStep <= 1)
+		{
+		Cancel();
+		iMessage.Complete(KErrCancel);	
+		}
+	}
+
+void CFileRecognitionUtility::NextStep()
+	{
+	TRequestStatus* pStatus = &iStatus;
+	User::RequestComplete(pStatus, KErrNone);
+	SetActive();
+	}
+
+void CFileRecognitionUtility::RunL()
+	{
+	switch(iStep)
+		{
+		case 0:		// first step: read the directory content
+			ReadDirectoryL();
+			iIndex=0;
+			iStep++;
+			NextStep();
+			break;
+		case 1:		// read current file and recognize it
+			if(iIndex < iEntryList->Count())
+				{
+				RecognizeFileL();
+				iIndex++;
+				NextStep();
+				}
+			else	// finished
+				{
+				iMessage.WriteL(1,TPckgBuf<TUint>(iResult->RequiredBufferSize()));
+				iMessage.Complete(KErrNone);
+				iStep++;	// to show that we have completed the request
+				delete iEntryList;
+				iEntryList = NULL;
+				}
+			break;
+		default:
+			break;
+		}
+	}
+
+void CFileRecognitionUtility::DoCancel()
+	{
+	iIndex = 0;
+	iStep = 0;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apserv/APSRECUTIL.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,110 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+#if !defined(__APSRECUTIL_H__)
+#define __APSRECUTIL_H__
+
+#if !defined(__E32BASE_H__)
+#include <e32base.h>
+#endif
+
+#include <apmrec.h>
+#include <apsserv.h>
+
+/**
+Reference-counted object which stores a recognition result in a more compact format
+than TDataRecognitionResult does. Also includes the file name.
+
+The reason why instances of this class are reference-counted is that they might 
+be "owned" by the cache and CDirectoryRecognitionResult at the same time. If both
+of them had their own copies unnecessarily much memory would be wasted.
+@internalComponent
+*/
+class CRecognitionResult : public CObject
+	{
+public:
+	static CRecognitionResult* NewL(const TDesC& aFileName, const TDataRecognitionResult& aRecognitionResult);
+	TUint GetRequiredBufferSize() const;
+	void WriteToStreamL(RWriteStream& aWriteStream);
+	
+	void Get(TDataRecognitionResult& aRecognitionResult);
+	inline const TDesC8& DataType() const { return *iDataType; }
+	inline const TDesC& FileName() const { return *iFileName; }
+	
+private:
+	CRecognitionResult(HBufC* aFileName, HBufC8* aDataType, TUid aUid, TInt aConfidence);
+	~CRecognitionResult();
+private:
+	HBufC* iFileName;
+	HBufC8* iDataType;
+	TUid iUid;
+	TInt iConfidence;
+	};
+
+/**
+Holds the recognition results of all files of a directory.
+@internalComponent
+*/
+class CDirectoryRecognitionResult : public CBase
+	{
+public:
+	CDirectoryRecognitionResult(HBufC* aPath, HBufC8* aDataTypeFilter);
+	virtual ~CDirectoryRecognitionResult();
+	void AppendL(CRecognitionResult* aEntry);
+	void WriteToStreamL(RWriteStream& aWriteStream);
+	inline TInt RequiredBufferSize() const {return iRequiredBufferSize;}
+	inline HBufC& Path() { return *iPath; }
+private:
+	TInt iRequiredBufferSize;
+	HBufC* iPath;
+	HBufC8* iDataTypeFilter;
+	RPointerArray<CRecognitionResult> iEntries;
+	};
+
+/**
+Utility class which does synchronous and asynchronous file recognitions of a directory
+@internalComponent
+*/
+class CFileRecognitionUtility : public CActive
+	{
+public:
+	CFileRecognitionUtility(CApaAppListServer& aServer, TInt aMaxBufSize, RFs& aFs);
+	~CFileRecognitionUtility();
+	void RecognizeSynchronouslyL(CDirectoryRecognitionResult& aResult);
+	void RecognizeAsynchronously(CDirectoryRecognitionResult& aResult, const RMessage2& aMessage);
+	void CancelRecognitionRequest();
+protected:
+	void ReadDirectoryL();
+	void RecognizeFileL();
+private:
+	void NextStep();
+	void RunL();
+	void DoCancel();
+	TInt BufferSizeL() const;
+	
+private:
+	HBufC* iPath;
+	CDirectoryRecognitionResult* iResult;
+	CApaAppListServer& iServer;
+	TInt iMaxBufSize;
+	RFs& iFs;
+	CDir* iEntryList;
+	TInt iIndex;
+	TInt iStep;
+	RMessage2 iMessage;
+	};
+
+#endif	// __APSRECUTIL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apserv/APSSCAN.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,343 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// AppArc recognizer and application scanning
+// 
+//
+
+#include "APSSCAN.H"
+#ifdef USING_ECOM_RECOGS
+#include <ecom/ecom.h>
+#endif
+
+class CApaFsMonitor::CApaFsNotifier : public CActive
+	{
+public:
+	~CApaFsNotifier();
+	static CApaFsNotifier* NewLC(RFs& aFs, const TDesC& aLocation, MApaFsChangeObserver& aObserver);
+	void Start(TNotifyType aNotifyType);
+private:
+	CApaFsNotifier(RFs& aFs, MApaFsChangeObserver& aObserver);
+	void DoCancel();
+	void RunL();
+private:
+	RFs& iFs;
+	MApaFsChangeObserver& iObserver;
+	HBufC* iLocation;
+	};
+
+CApaFsMonitor::CApaFsNotifier::~CApaFsNotifier()
+	{
+	Cancel();
+	delete iLocation;
+	}
+
+CApaFsMonitor::CApaFsNotifier* CApaFsMonitor::CApaFsNotifier::NewLC(RFs& aFs, const TDesC& aLocation, MApaFsChangeObserver& aObserver)
+	{ // static
+	CApaFsNotifier* self=new(ELeave) CApaFsNotifier(aFs, aObserver);
+	CleanupStack::PushL(self);
+	self->iLocation = aLocation.AllocL();
+	return self;
+	}
+
+CApaFsMonitor::CApaFsNotifier::CApaFsNotifier(RFs& aFs, MApaFsChangeObserver& aObserver)
+	: CActive(EPriorityLow), // priority must be higher than that of CApaFsMonitor::iFsTimer, to ensure the RunL of each completed CApaFsNotifier object is executed before the RunL of a completed CApaFsMonitor::iFsTimer
+	iFs(aFs),
+	iObserver(aObserver)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+
+void CApaFsMonitor::CApaFsNotifier::Start(TNotifyType aNotifyType)
+	{
+	if (iLocation->Length())
+		{
+		iFs.NotifyChange(aNotifyType, iStatus, *iLocation);
+		}
+	else
+		{
+		iFs.NotifyChange(aNotifyType, iStatus);
+		}
+	SetActive();
+	}
+
+void CApaFsMonitor::CApaFsNotifier::DoCancel()
+	{
+	iFs.NotifyChangeCancel(iStatus);
+	}
+
+void CApaFsMonitor::CApaFsNotifier::RunL()
+	{
+	if (iStatus == KErrNone)
+		{
+		iObserver.FsChanged();
+		}
+	}
+
+
+
+// An FsMonitor checks for any changes to the file system
+// If a change is detected, a CallBack function is called after a short pause.
+// If there are further changes, the CallBack is not called again until after 3 secs have elapsed.
+
+const TInt KApaFsMonitorPause=250000;			// Wait 0.25s before calling CallBack
+const TInt KApaFsMonitorPeriod=3000000;			// Don't call CallBack again before 3s have elapsed
+
+//
+// Class CApaFsMonitor
+//
+
+EXPORT_C CApaFsMonitor::~CApaFsMonitor()
+/** Deletes the timer object, file system change notification
+active objects and location descriptors. */
+	{
+	if (iFsTimer)
+		{
+		iFsTimer->Cancel();
+		delete iFsTimer;
+		}
+	iNotifiers.ResetAndDestroy();
+	iNotifiers.Close();
+	}
+
+CApaFsMonitor::CApaFsMonitor(RFs& aFs, TCallBack aCallBack)
+ 	:iFs(aFs),
+ 	iCallBack(aCallBack)
+	{
+	}
+
+
+EXPORT_C CApaFsMonitor* CApaFsMonitor::NewL(RFs& aFs,const TDesC& aLocation, TCallBack aCallBack)
+/** Allocates and constructs a file system monitor.
+
+@param aFs A session with the file server.
+@param aLocation Optional name of the file or directory to be 
+monitored. If the length of the descriptor is zero, the object 
+monitors changes to all files and directories in the file system.
+Additional locations to monitor may be specified by calling
+AddLocationL.
+@param aCallBack The callback function.
+@return The file system monitor.
+@see CApaFsMonitor::AddLocationL() */
+	{
+	CApaFsMonitor* self=new(ELeave) CApaFsMonitor(aFs, aCallBack);
+	CleanupStack::PushL(self);
+	self->iFsTimer=CPeriodic::NewL(CActive::EPriorityIdle);
+	self->AddLocationL(aLocation);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+/** Adds an additional file system location to monitor.
+
+@param aLocation Name of the file or directory to be monitored. */
+EXPORT_C void CApaFsMonitor::AddLocationL(const TDesC& aLocation)
+	{
+	CApaFsNotifier* const notifier = CApaFsNotifier::NewLC(iFs, aLocation, *this);
+	User::LeaveIfError(iNotifiers.Append(notifier));
+	CleanupStack::Pop(notifier);
+	}
+
+/** Cancels all file system notification active objects owned by
+this monitor.
+
+A call to this function may be followed immediately by a call
+to Start() to change the notification type.
+
+@see CApaFsMonitor::Start() */
+EXPORT_C void CApaFsMonitor::Cancel()
+	{
+	const TInt notifierCount = iNotifiers.Count();
+	for (TInt ii=0; ii < notifierCount; ii++)
+		{
+		iNotifiers[ii]->Cancel();
+		}
+	}
+
+TBool CApaFsMonitor::AnyNotificationImpending() const
+	{
+	for (TInt i=iNotifiers.Count()-1; i>=0; --i)
+		{
+		if (iNotifiers[i]->iStatus!=KRequestPending)
+			{
+			return ETrue;
+			}
+		}
+	return EFalse;
+	}
+
+void CApaFsMonitor::FsChanged()
+	{
+	iFsHasChanged=ETrue;
+	if (!iIsBlocked && !iFsTimer->IsActive())
+		iFsTimer->Start(KApaFsMonitorPause,KApaFsMonitorPeriod,TCallBack(TimerCallBack,this));
+	}
+
+EXPORT_C void CApaFsMonitor::Start(TNotifyType aNotifyType)
+/** Sets the type of notification required and starts a file system notification
+active object for each location being monitored.
+
+You can either request notification of changes to all files in the file system, 
+or to specific files, depending on the aLocation parameter specified in the NewL() 
+function.
+
+@param aNotifyType A set of flags that indicate what kinds of change should cause 
+notifications. */
+	{
+	iNotifyType=aNotifyType;
+
+	DoStart();
+	}
+
+void CApaFsMonitor::DoStart()
+	{
+	const TInt notifierCount = iNotifiers.Count();
+	for (TInt ii=0; ii < notifierCount; ii++)
+		{
+		CApaFsNotifier* const notifier = iNotifiers[ii];
+		if (!notifier->IsActive())
+			{
+			notifier->Start(iNotifyType);
+			}
+		}
+	}
+
+EXPORT_C TNotifyType CApaFsMonitor::NotifyType() const
+/** Gets the type of notification as passed to Start(). 
+
+If Start() has not yet been called, the type of notification is undefined.
+
+@return Flags that indicate what kinds of change should cause notifications. */
+	{
+	return iNotifyType;
+	}
+
+EXPORT_C void CApaFsMonitor::SetBlocked(TBool aIsBlocked)
+/** Blocks or unblocks file system monitoring. 
+
+While in a blocked state, the callback never gets called. If monitoring is 
+unblocked using this function, and a change has occurred when in the blocked 
+state then the timer is started, causing the callback to be called initially 
+after 0.25 seconds, followed by subsequent delays of 3 seconds.
+
+@param aIsBlocked True to block callbacks, false to unblock them. */
+	{
+	iIsBlocked=aIsBlocked;
+	if (iIsBlocked==EFalse)		// If end of a blocked period, notify if a change was detected
+		{
+		if (iFsHasChanged && !iFsTimer->IsActive())
+			{
+			iFsTimer->Start(KApaFsMonitorPause,KApaFsMonitorPeriod,TCallBack(TimerCallBack,this));
+			}
+		}
+	}
+
+TInt CApaFsMonitor::TimerCallBack(TAny* aObject)
+	{
+	CApaFsMonitor* self=(CApaFsMonitor*)aObject;
+	if (self->iFsHasChanged && !self->iIsBlocked)
+		{
+		self->iFsHasChanged=EFalse;
+		self->DoStart();
+		self->iCallBack.CallBack();		// Should not leave, but if it does, it's OK
+		}
+	else
+		self->iFsTimer->Cancel();
+	return KErrNone;
+	}
+
+
+#ifdef USING_ECOM_RECOGS
+//
+// CApaEComMonitor class
+//
+CApaEComMonitor::CApaEComMonitor(TCallBack aCallBack)
+	: CActive(EPriorityIdle), iCallBack (aCallBack)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+CApaEComMonitor::~CApaEComMonitor()
+	{
+	Cancel();
+	delete iEComTimer;
+	if (iEComSession)
+		{
+		iEComSession->Close();
+		}
+	}
+
+CApaEComMonitor* CApaEComMonitor::NewL(TCallBack aCallBack)
+	{
+	CApaEComMonitor* self=new(ELeave) CApaEComMonitor(aCallBack);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+void CApaEComMonitor::ConstructL()
+	{
+	iEComSession = &(REComSession::OpenL());
+	iEComTimer = CPeriodic::NewL(CActive::EPriorityIdle);
+	}
+
+void CApaEComMonitor::DoCancel()
+	{
+	iEComTimer->Cancel();
+	iEComSession->CancelNotifyOnChange(iStatus);
+	}
+
+void CApaEComMonitor::Start ()
+	{
+	DoStart();
+	}
+
+void CApaEComMonitor::DoStart()
+	{
+	iEComSession->NotifyOnChange (iStatus);
+	SetActive();
+	}
+
+//callback to to call the ecomrecognizer scanning routine upon notification from ECom
+TInt CApaEComMonitor::TimerCallBack(TAny* aObject)
+	{
+	CApaEComMonitor* self=(CApaEComMonitor*)aObject;
+	if (self->iEComHasChanged)
+		{
+		self->iEComHasChanged=EFalse;
+		self->DoStart();
+		self->iCallBack.CallBack();		// Should not leave, but if it does, it's OK
+		}
+	else
+		self->iEComTimer->Cancel();
+	return KErrNone;
+	}
+
+const TInt KApaEComMonitorPause=250000;			// Wait 0.25s before calling CallBack
+const TInt KApaEComMonitorPeriod=3000000;			// Don't call CallBack again before 3s have elapsed
+
+void CApaEComMonitor::RunL()
+	{
+	if (iStatus == KErrNone)
+		{
+		iEComHasChanged = ETrue;
+		if  (!iEComTimer->IsActive())
+			{
+			iEComTimer->Start(KApaEComMonitorPause,KApaEComMonitorPeriod,TCallBack(TimerCallBack,this));
+			}
+		}
+	}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apserv/APSSERV.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1162 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+#include <e32svr.h>
+#include <u32hal.h>
+#include <bautils.h>
+#include "APSSERV.H"
+#include "APFREC.H"
+#include "APSSES.H"
+#include "APSSTD.H"
+#include "../apfile/aprfndr.h"
+#include "APGAPLST.H"
+#include "APSSCAN.H"
+#include "APSSTD.H"
+#include "APASVST.H"
+#include "datastor.h"
+#include "APSRECCACHE.h"
+#include "apsnnapps.h"
+#include "../apfile/apuninstallmonitor.h"
+#include "../apgrfx/apprivate.h"
+#include "apsiconcaptionoverride.h"
+
+_LIT(KAppArcServerSemaphore,"AppArcServerSemaphore");
+_LIT(KAppArcServerThread,"AppArcServerThread");
+_LIT(KAppRegistrationFileImportLocation, "?:\\private\\10003a3f\\import\\apps\\");
+_LIT(KAppResourceAppsLocation, "?:\\resource\\apps\\");
+_LIT(KNonNativeApplicationTypeRegistry, ":\\private\\10003a3f\\NonNativeTypes.dat");
+
+/*
+ * patchable const data values defined in ApsConstData.cpp
+ */
+
+IMPORT_C extern const TInt KApaLoadDataRecognizersOnDemand;
+IMPORT_C extern const TInt KApaUnloadRecognizersTimeout;
+IMPORT_C extern const TInt KApaDrivesToMonitor;
+IMPORT_C extern const TInt KApaLoadMbmIconsOnDemand;
+
+const TUint8 KPolicyElementWriteDeviceData = 0;
+
+//To monitor all drives.
+const TInt KApaMonitorAllDrives = 0x3FFFFFF;
+
+const TUint KRangeCount = 3; 
+
+const TInt KAppListServRanges[KRangeCount] = 
+	{	
+	EFirstUnrestrictedOpcodeInAppListServ,
+	EFirstOpcodeNeedingWriteDeviceDataInAppListServ, 
+	EAppListFirstUnusedOpcode,
+	};
+
+const TUint8 KElementsIndex[KRangeCount] =
+	{
+	CPolicyServer::EAlwaysPass,			//Always passing no capability required [0-99]
+	KPolicyElementWriteDeviceData,		//Requires WriteDeviceData				 [100-(EAppListFirstUnusedOpcode-1)]
+	CPolicyServer::ENotSupported, 		//Not Supported		[EAppListFirstUnusedOpcode-End]
+	};
+
+const CPolicyServer::TPolicyElement KPolicyElements[] = 
+	{ 
+	{_INIT_SECURITY_POLICY_C1(ECapabilityWriteDeviceData), CPolicyServer::EFailClient} 
+	};
+
+const CPolicyServer::TPolicy KApaServPolicy =
+	{
+	CPolicyServer::EAlwaysPass, 
+	KRangeCount,
+	KAppListServRanges,
+	KElementsIndex, 	
+	KPolicyElements 	
+	};
+ 	
+
+
+//////////////////////////////
+// CApaAppListServer
+//////////////////////////////
+
+const TInt KAppListServerPriority=CActive::EPriorityStandard;
+/**
+NameApaServStartSemaphore
+
+@internalTechnology
+*/
+EXPORT_C TPtrC NameApaServStartSemaphore()
+	{
+	TPtrC nameApaServStartSemaphore(KAppArcServerSemaphore);
+	return nameApaServStartSemaphore;
+	}
+
+/**
+NameApaServServerThread
+
+@internalTechnology 
+*/
+EXPORT_C TPtrC NameApaServServerThread()
+	{
+	TPtrC nameApaServServerThread(KAppArcServerThread);
+	return nameApaServServerThread;
+	}
+
+EXPORT_C CApaAppListServer* CApaAppListServer::Self()
+	{ // static
+	return static_cast<CApaAppListServer*>(Dll::Tls());
+	}
+
+EXPORT_C CApaAppListServer* CApaAppListServer::NewL(MApaAppStarter* aAppStarter)
+// Create a new CApaAppListServer which owns it's own resources
+	{
+	CApaAppListServer* self=new(ELeave) CApaAppListServer(KAppListServerPriority);
+	CleanupStack::PushL(self);
+	self->ConstructL(aAppStarter);
+	CleanupStack::Pop();
+	return self;
+	}
+
+CApaAppListServer::CApaAppListServer(TInt aPriority)
+	: CPolicyServer(aPriority,KApaServPolicy),
+	iAppList(0),
+	iTypeStoreModified(0),
+	iLoadRecognizersOnDemand(KApaLoadDataRecognizersOnDemand),
+	iLoadMbmIconsOnDemand(KApaLoadMbmIconsOnDemand)
+	{
+	
+	#ifdef __WINS__
+	// KApaLoadDataRecognizersOnDemand and KApaloadIconsOnDemand are Rom patchable constants,
+	// so need an emulator equivalent
+	// if WINS then read value from epoc.ini
+	// requires licencees to set property in epoc.ini
+
+	TInt halValue = 0;
+	if (UserSvr::HalFunction(EHalGroupEmulator, EEmulatorHalIntProperty, (TAny*)"patchdata_apserv_dll_KApaLoadDataRecognizersOnDemand", &halValue) == KErrNone)
+		{
+		iLoadRecognizersOnDemand = halValue;
+		}
+	if (UserSvr::HalFunction(EHalGroupEmulator, EEmulatorHalIntProperty, (TAny*)"patchdata_apserv_dll_KApaLoadMbmIconsOnDemand", &halValue) == KErrNone)
+		{
+		iLoadMbmIconsOnDemand = halValue;
+		}
+	#endif
+
+	__DECLARE_NAME(_S("CApaAppListServer"));
+	}
+
+void CApaAppListServer::ConstructL(MApaAppStarter* aAppStarter)
+	{
+	StartL(KAppListServerName);
+	User::LeaveIfError(Dll::SetTls(this));
+	User::LeaveIfError(iFs.Connect());
+	
+	iScanningFileRecognizer=CApaScanningFileRecognizer::NewL(iFs,aAppStarter);
+		
+	// Get the idle timeout delay from the commandline if specified. The default is 50000ms
+	const TInt cmdLineLen = User::CommandLineLength();
+	TInt idlePeriodicDelay=50000; //default value
+	if(cmdLineLen)
+		{
+		_LIT(KIdleTimeout,"IDLE_TIMEOUT_PERIODIC_DELAY_");
+		
+		// Extract the command line into a buffer
+		HBufC* cmdLine = HBufC::NewLC(cmdLineLen);
+		TPtr cmdLinePtr = cmdLine->Des();
+		User::CommandLine(cmdLinePtr);
+		cmdLinePtr.UpperCase();
+				
+		// Check if there is an idle timeout value given
+		TInt idleTimeOutArgPos = cmdLinePtr.Find(KIdleTimeout);
+		if(KErrNotFound != idleTimeOutArgPos)
+			{
+			// Extract the value out of the command line argument
+			const TInt idleTimeOutValuePos = idleTimeOutArgPos + KIdleTimeout().Length();
+			TInt i = idleTimeOutValuePos;
+			while (i < cmdLineLen)
+				{
+				TChar c(cmdLinePtr[i]);
+				if (!c.IsDigit())
+					{
+					break;
+					}
+				i++;
+				}
+			TLex idleTimeOutParser(cmdLinePtr.Mid(idleTimeOutValuePos, (i-idleTimeOutValuePos)));
+		  	User::LeaveIfError(idleTimeOutParser.Val(idlePeriodicDelay));	  					  	
+			}
+							
+		// Check if the recognition cache should be used or not. By default the cache is used
+		iRecognitionCache = 0;
+		_LIT(KWithoutRecognitionCache,"WITHOUT_RECOGNITION_CACHE");
+		if(KErrNotFound == cmdLinePtr.Find(KWithoutRecognitionCache))
+			{
+			iRecognitionCache = new (ELeave) CApsRecognitionCache(iFs);
+			}
+			
+		_LIT(KTextShellMode,"TEXT_SHELL_MODE");
+		if (KErrNotFound == cmdLinePtr.Find(KTextShellMode))
+			{
+			// We are NOT running in text shell mode so connect to wserv session
+			User::LeaveIfError(iWsSession.Connect());
+			iRuleBasedPlugIns = CApaScanningRuleBasedPlugIns::NewL();
+			}
+
+		CleanupStack::PopAndDestroy(cmdLine);		
+		}
+	else
+		{
+		// no arguments so cache is used
+		iRecognitionCache = new (ELeave) CApsRecognitionCache(iFs);
+		// and rule based plugins are enabled
+		User::LeaveIfError(iWsSession.Connect());
+		iRuleBasedPlugIns = CApaScanningRuleBasedPlugIns::NewL();
+		}
+	
+	CApaAppRegFinder* appRegFinder=CApaAppRegFinder::NewL(iFs); //non-standard transfer of ownership, no need for CleanupStack
+	iAppList=CApaAppList::NewL(iFs, appRegFinder, iLoadMbmIconsOnDemand, idlePeriodicDelay); // takes ownership of scanner
+
+	// If the phone rebooted halfway through processing updates, there will be a log file left
+	// look for one and recover if neccessary
+	CApsNonNativeApplicationsManager::RecoverFromUpdateLogL(iFs);
+
+	iDataRecognizer=CApaScanningDataRecognizer::NewL(iFs, !iLoadRecognizersOnDemand);
+
+	ConstructPathsToMonitorL();	
+
+	if ( iAppFsMonitor )
+		{
+		iAppFsMonitor->Start(ENotifyFile);
+		iAppFsMonitor->SetBlocked(ETrue);			
+		}
+	TRAP_IGNORE(iAppList->InitListL(this));
+	
+#ifdef USING_ECOM_RECOGS
+	iRecEcomMonitor=CApaEComMonitor::NewL(TCallBack(&PlugInNotifyCallBack,this));
+	iRecEcomMonitor->Start();
+#endif
+	iTypeStoreManager=CTypeStoreManager::NewL(iFs);
+	TRAPD(err,iTypeStoreManager->RestoreL());
+	if(err==KErrNone)
+		{
+		User::LeaveIfError(iFs.Modified(iTypeStoreManager->IniFileName(),iTypeStoreModified));
+		}
+	iTypeStoreMonitor=CApaFsMonitor::NewL(iFs,iTypeStoreManager->IniFileName(),TCallBack(&TypeStoreNotifyCallback,this));
+	iTypeStoreMonitor->Start(ENotifyWrite); // this presumably needs to be ENotifyWrite rather than ENotifyFile (the latter being used or the other CApaFsMonitor objects) because CTypeStoreManager internally uses CDictionaryFileStore::OpenL, which presumably itself uses RFile::Open, which isn't covered by ENotifyFile according to its documentation
+	TypeStoreNotifyCallback(this);
+	iBaBackupSessionWrapper=CBaBackupSessionWrapper::NewL();
+	iBaBackupSessionWrapper->RegisterBackupOperationObserverL(*((MBackupOperationObserver*)this));
+
+	TChar sysDrive = RFs::GetSystemDriveChar();
+	TInt maxSizeofFileName = KNonNativeApplicationTypeRegistry().Length() + 1;
+	iNonNativeApplicationTypeRegistry.CreateL(maxSizeofFileName);
+	iNonNativeApplicationTypeRegistry.Append(sysDrive);
+	iNonNativeApplicationTypeRegistry.Append(KNonNativeApplicationTypeRegistry());
+
+	TRAP_IGNORE(InternalizeNonNativeApplicationTypeArrayL());	// We don't want a corrupt file to prevent from starting
+	if(iLoadRecognizersOnDemand)
+		{
+		iRecognizerUnloadTimer=CPeriodic::NewL(EPriorityNormal);
+		}
+	iAppUnInstallMonitor = CApaAppUnInstallMonitor::NewL(this);
+	iAppUnInstallMonitor->Start();
+
+	iIconCaptionOverrides = new(ELeave) CApaIconCaptionOverrides();
+	iIconCaptionObserver = CApaIconCaptionCenrepObserver::NewL(*iIconCaptionOverrides);
+	iIconCaptionObserver->LoadOverridesL();
+	}
+	
+void CApaAppListServer::ConstructPathsToMonitorL()
+	{
+	TInt drivesToMonitor = KApaDrivesToMonitor;
+	#ifdef __WINS__
+	// KApaDrivesToMonitor is a Rom patchable constant, so need an emulator equivalent
+	// if WINS then read value from epoc.ini requires licencees to set property in epoc.ini
+	// Usage: In epoc.ini patchdata_apserv_dll_KApaDrivesToMonitor 4
+	
+	TInt valueOfKApaDrivesToMonitor = 0;
+	if (UserSvr::HalFunction(EHalGroupEmulator,EEmulatorHalIntProperty,(TAny*)"patchdata_apserv_dll_KApaDrivesToMonitor",&valueOfKApaDrivesToMonitor) == KErrNone)
+		{
+		drivesToMonitor = valueOfKApaDrivesToMonitor;
+		}
+	#endif
+	
+	if ( drivesToMonitor != KApaMonitorAllDrives )
+		{
+		// 1. Create and add CApaFsNotifier for all locations belonging to a drive if the drive is set to monitor.
+		// 2. Do this for all the drives which are required to monitor.
+		TInt maskBit = 1;
+		TChar driveLetter;
+		//Only bits from 0(EDriveA)- 25(EDriveZ) are valid other bits are ignored from 32-bit KApaDrivesToMonitor.
+		for ( TInt i = EDriveA; i <= EDriveZ; i++ )
+			{
+			if ( drivesToMonitor & maskBit )
+				{
+				RFs::DriveToChar(i,driveLetter);
+				RBuf pathToBeMonitored;
+				TBuf<1> drive;
+				drive.Append(driveLetter);
+				
+				//Creating or Adding <driveLetter>:\private\10003a3f\import\apps\ path to monitor.
+				pathToBeMonitored.CreateL(KAppRegistrationFileImportLocation());				
+				CleanupClosePushL(pathToBeMonitored);
+				pathToBeMonitored.Replace(0,1,drive);				
+				if ( iAppFsMonitor == NULL )
+					{
+					iAppFsMonitor=CApaFsMonitor::NewL(iFs, pathToBeMonitored, TCallBack(&AppFsNotifyCallBack, this));
+					}
+				else
+					{
+					iAppFsMonitor->AddLocationL(pathToBeMonitored);		
+					}
+				CleanupStack::PopAndDestroy(&pathToBeMonitored);
+			
+				//Adding <driveLetter>:\resource\apps\ path to monitor.
+				pathToBeMonitored.CreateL(KAppResourceAppsLocation());
+				CleanupClosePushL(pathToBeMonitored);
+				pathToBeMonitored.Replace(0,1,drive);			
+				iAppFsMonitor->AddLocationL(pathToBeMonitored);
+				CleanupStack::PopAndDestroy(&pathToBeMonitored);
+				}
+			maskBit = maskBit << 1;
+			}	
+		}
+	else
+		{
+		iAppFsMonitor=CApaFsMonitor::NewL(iFs, KAppRegistrationFileImportLocation, TCallBack(&AppFsNotifyCallBack, this));
+		iAppFsMonitor->AddLocationL(KAppResourceAppsLocation);
+		}	
+	}
+	
+EXPORT_C CApaAppListServer::~CApaAppListServer()
+	{
+	delete iIconCaptionObserver;
+	delete iIconCaptionOverrides;
+	if(iBaBackupSessionWrapper)
+		iBaBackupSessionWrapper->DeRegisterBackupOperationObserver(*this);
+	delete iAppUnInstallMonitor;
+	delete iScanningFileRecognizer;
+	delete iAppList; // deletes scanners
+	delete iDataRecognizer;
+	delete iTypeStoreManager;
+	delete iAppFsMonitor;	
+	delete iTypeStoreMonitor;
+	delete iBaBackupSessionWrapper;
+	delete iRecognitionCache;
+#ifdef USING_ECOM_RECOGS
+	delete iRecEcomMonitor;
+#else
+	iRecEcomMonitor = NULL;
+#endif
+	iFs.Close();
+	iAppCmdLine=NULL;
+	iWsSession.Close();	
+	delete 	iRuleBasedPlugIns;
+	for (TInt i=iNonNativeApplicationTypeArray.Count()-1; i>=0; --i)
+		{
+		delete iNonNativeApplicationTypeArray[i].iNativeExecutable;
+		}
+	iNonNativeApplicationTypeArray.Close();
+	iCustomAppList.ResetAndDestroy();
+	iCustomAppList.Close();
+	delete iRecognizerUnloadTimer;
+	iNonNativeApplicationTypeRegistry.Close();
+	}
+
+EXPORT_C void CApaAppListServer::HandleStartUninstallEvent()
+	{
+	if ( iAppFsMonitor )
+		{
+		iAppFsMonitor->SetBlocked(ETrue);	
+		}
+	AppList().StopScan();
+	}
+EXPORT_C void CApaAppListServer::HandleEndUninstallEventL()
+	{
+	if ( iAppFsMonitor )
+		{
+		iAppFsMonitor->SetBlocked(EFalse);	
+		}
+	AppList().RestartScanL();
+	}
+
+CSession2* CApaAppListServer::NewSessionL(const TVersion& aVersion,const RMessage2&/* aMessage*/) const
+
+// Create a new server session.
+	{
+	// check we're the right version
+	TVersion v(KAppListServMajorVersionNumber,KAppListServMinorVersionNumber,KAppListServBuildVersionNumber);
+	if (!User::QueryVersionSupported(v,aVersion))
+		User::Leave(KErrNotSupported);
+	// make new session
+	return CApaAppListServSession::NewL(const_cast<CApaAppListServer&>(*this), const_cast<RFs&>(iFs));
+	}
+
+//
+// scanning code here
+//
+
+EXPORT_C TCallBack CApaAppListServer::RescanCallBack()
+	{
+	return TCallBack(&AppFsNotifyWithForcedRegistrationsResetCallBack,this);
+	}
+
+TInt CApaAppListServer::AppFsNotifyWithForcedRegistrationsResetCallBack(TAny* aPtr)
+	{
+	ASSERT(aPtr);
+	reinterpret_cast<CApaAppListServer*>(aPtr)->AppList().ResetForcedRegistrations();
+	return AppFsNotifyCallBack(aPtr);
+	}
+
+TInt CApaAppListServer::AppFsNotifyCallBack(TAny* aObject)
+	{
+	ASSERT(aObject);
+	reinterpret_cast<CApaAppListServer*>(aObject)->UpdateApps();
+	return KErrNone;
+	}
+
+TInt CApaAppListServer::PlugInNotifyCallBack(TAny* aObject)
+	{
+	//update the pre-Platform-security style  recognizers and rule-based plug-ins
+	ASSERT(aObject);
+	reinterpret_cast<CApaAppListServer*>(aObject)->UpdatePlugIns();
+	return KErrNone;
+	}
+
+TInt CApaAppListServer::TypeStoreNotifyCallback(TAny* aObject)
+	{
+	ASSERT(aObject);
+	reinterpret_cast<CApaAppListServer*>(aObject)->UpdateTypeStore();
+	return KErrNone;
+	}
+
+void CApaAppListServer::UpdateApps()
+// update the list
+	{
+	// File system change, rescan
+	TRAP_IGNORE(iAppList->StartIdleUpdateL (this));
+	}
+
+void CApaAppListServer::NotifyUpdate(TInt aReason)
+// tell all sessions to update their clients
+	{
+	// Updates the applist with the icon caption details from the Central Repository.
+	TRAP_IGNORE(UpdateAppListByIconCaptionOverridesL());
+	// The short caption value sets through the API has got the highest precedence over the
+	// values found in either central repository or resource file.
+	TRAP_IGNORE(UpdateAppListByShortCaptionL());
+		
+    //Delete any data mappings in service registry related to uninstalled applications.
+    CArrayFixFlat<TUid>* uninstalledApps=iAppList->UninstalledAppArray();
+    TBool modificationStatus=EFalse;
+    TBool modified;
+    
+    if(uninstalledApps)
+        {
+        TInt count=uninstalledApps->Count();
+        for(int index=0;index<count;index++)
+            {
+            modified=iTypeStoreManager->DeleteApplicationDataMappings((*uninstalledApps)[index]);
+        
+            //Set modificationStatus if any data mapping is removed from the service registry
+            if(modified)
+                modificationStatus=ETrue;
+            }
+        
+        delete uninstalledApps;
+        
+        //If service registry is modified, store it to a file
+        if(modificationStatus)
+            TRAP_IGNORE(iTypeStoreManager->StoreL());
+        }
+    
+	// iterate through sessions
+	iSessionIter.SetToFirst();
+	CApaAppListServSession* ses=static_cast<CApaAppListServSession*>(&(*iSessionIter++));
+	while (ses!=NULL)
+		{
+		ses->NotifyClients(aReason);	
+		ses=static_cast<CApaAppListServSession*>(&(*iSessionIter++));
+		}
+	}
+
+void CApaAppListServer::UpdatePlugIns()
+// update the pre-Platform-security style, ecom style recognizers and rule-based plug-ins
+	{
+	TRAP_IGNORE(iScanningFileRecognizer->ScanForRecognizersL());
+	//we want the recognizers to be loaded either if:
+	// 1) they are not loaded on demand
+	// 2) they are loaded on demand and actively used
+	// 3) they are loaded on demand but waiting for the timer to be unloaded
+	if(!iLoadRecognizersOnDemand || iRecognizerUsageCount > 0 || (iRecognizerUnloadTimer && iRecognizerUnloadTimer->IsActive()))
+		{
+		TRAP_IGNORE(iDataRecognizer->LoadRecognizersL());
+		}
+	if (iRecognitionCache)
+		{	// RecognitionCache is flushed if there are any changes in plugins, i.e.,if:
+			// 1. New ECom Plugin is installed.
+			// 2. Existing ECom Plugin is uninstalled.
+		iRecognitionCache->Flush();
+		}
+
+	TRAP_IGNORE(iRuleBasedPlugIns->ScanForRuleBasedPlugInsL());
+	}
+
+void CApaAppListServer::UpdateTypeStore()
+// Update the internal type store if things have changed
+	{
+	TRAP_IGNORE(DoUpdateTypeStoreL());
+	}
+
+void CApaAppListServer::DoUpdateTypeStoreL()
+	{
+	TTime modified;
+	TInt err=iFs.Modified(iTypeStoreManager->IniFileName(),modified);
+	// check the time stamp to see if we are interested in an update
+	if (modified>iTypeStoreModified && err==KErrNone)
+		{
+		CTypeStoreManager* manager=CTypeStoreManager::NewL(iFs);
+		CleanupStack::PushL(manager);
+		manager->RestoreL();
+		iTypeStoreModified=modified;
+		delete iTypeStoreManager;
+		iTypeStoreManager=manager;
+		CleanupStack::Pop(manager); 
+		}
+	for (iSessionIter.SetToFirst(); ; iSessionIter++) //lint !e1757 prefix operator not defined for TDblQueIter
+		{
+     	CSession2* const session=iSessionIter;
+     	if (session==NULL)
+			{
+  			break;
+			}
+     	static_cast<CApaAppListServSession*>(session)->NotifyClientOfDataMappingChange();
+		}
+	}
+
+void CApaAppListServer::HandleBackupOperationEventL(const TBackupOperationAttributes& aBackupOperationAttributes)
+//
+// Handle a signal from the backup server to indicate that a backup has started or finished.
+//
+	{
+	switch(aBackupOperationAttributes.iOperation)
+		{
+	case MBackupOperationObserver::ENone:
+	case MBackupOperationObserver::EAbort:
+		break;
+	case MBackupOperationObserver::EStart:
+		if ( iAppFsMonitor )
+			{
+			iAppFsMonitor->SetBlocked(ETrue);	
+			}
+		break;
+	case MBackupOperationObserver::EEnd:
+		if ( iAppFsMonitor )
+			{
+			iAppFsMonitor->SetBlocked(EFalse);	
+			}
+		break;
+	default:
+		Panic(EEventFromBackupObserverError);
+		break;
+		}
+	}
+
+void CApaAppListServer::InitialListPopulationComplete()
+	{
+	if ( iAppFsMonitor )
+		{
+		iAppFsMonitor->SetBlocked(EFalse);	
+		}
+	
+	// notify clients (whoever is interested) that initial population of list is completed
+	iSessionIter.SetToFirst();
+	CApaAppListServSession* ses=static_cast<CApaAppListServSession*>(&(*iSessionIter++));
+	// iterate through sessions
+	while (ses!=NULL)
+		{
+		ses->NotifyClientForCompletionOfListPopulation();	
+		ses=static_cast<CApaAppListServSession*>(&(*iSessionIter++));
+		}
+	}
+
+void CApaAppListServer::RegisterNonNativeApplicationTypeL(TUid aApplicationType, const TDesC& aNativeExecutable)
+	{
+	for (TInt i=iNonNativeApplicationTypeArray.Count()-1; i>=0; --i)
+		{
+		if (iNonNativeApplicationTypeArray[i].iTypeUid.iUid==aApplicationType.iUid)
+			{
+			User::Leave(KErrAlreadyExists);
+			}
+		}
+	SNonNativeApplicationType nonNativeApplicationType;
+	nonNativeApplicationType.iTypeUid.iUid=aApplicationType.iUid;
+	nonNativeApplicationType.iNativeExecutable=aNativeExecutable.AllocLC();
+	iNonNativeApplicationTypeArray.AppendL(nonNativeApplicationType);
+	CleanupStack::Pop(nonNativeApplicationType.iNativeExecutable);
+	CleanupStack::PushL(TCleanupItem(DeleteLastNonNativeApplicationType, this));
+	ExternalizeNonNativeApplicationTypeArrayL();
+	CleanupStack::Pop(this); // the TCleanupItem
+	}
+
+void CApaAppListServer::DeregisterNonNativeApplicationTypeL(TUid aApplicationType)
+	{
+	TInt i;
+	for (i=iNonNativeApplicationTypeArray.Count()-1; i>=0; --i)
+		{
+		if (iNonNativeApplicationTypeArray[i].iTypeUid.iUid==aApplicationType.iUid)
+			{
+			break;
+			}
+		}
+	if (i>=0)
+		{
+		ExternalizeNonNativeApplicationTypeArrayL(i);
+		delete iNonNativeApplicationTypeArray[i].iNativeExecutable;
+		iNonNativeApplicationTypeArray[i].iNativeExecutable = NULL;
+		iNonNativeApplicationTypeArray.Remove(i);
+		}
+	}
+
+void CApaAppListServer::InternalizeNonNativeApplicationTypeArrayL()
+	{
+	RFile file;
+	CleanupClosePushL(file);
+	const TInt error=file.Open(iFs, iNonNativeApplicationTypeRegistry, EFileShareReadersOnly|EFileStream|EFileRead);
+	if (error==KErrNone) // don't leave if the file can't be opened (because it doesn't exist, or because the directory we're looking for it in doesn't exist)
+		{
+		RFileReadStream sourceStream;
+		sourceStream.Attach(file); // file gets closed by this call, but that's okay, we don't need it any more (sourceStream has its own copy of this RFile object that it owns)
+		CleanupClosePushL(sourceStream);
+		TCardinality arrayCount;
+		arrayCount.InternalizeL(sourceStream);
+		for (TInt i=0; i<TInt(arrayCount); ++i)
+			{
+			SNonNativeApplicationType nonNativeApplicationType;
+			nonNativeApplicationType.iTypeUid.iUid=sourceStream.ReadUint32L();
+			nonNativeApplicationType.iNativeExecutable=HBufC::NewLC(sourceStream, KMaxFileName);
+			iNonNativeApplicationTypeArray.AppendL(nonNativeApplicationType);
+			CleanupStack::Pop(nonNativeApplicationType.iNativeExecutable);
+			}
+		CleanupStack::PopAndDestroy(&sourceStream);
+		}
+	CleanupStack::PopAndDestroy(&file);
+	}
+
+void CApaAppListServer::ExternalizeNonNativeApplicationTypeArrayL(TInt aIndexToIgnore/*=-1*/) const
+	{
+	RFs& fs=const_cast<RFs&>(iFs);
+	fs.MkDirAll(iNonNativeApplicationTypeRegistry); // ignore any error
+	RFile file;
+	CleanupClosePushL(file);
+	User::LeaveIfError(file.Replace(fs, iNonNativeApplicationTypeRegistry, EFileShareExclusive|EFileStream|EFileWrite));
+	RFileWriteStream targetStream;
+	targetStream.Attach(file); // file gets closed by this call, but that's okay, we don't need it any more (targetStream has its own copy of this RFile object that it owns)
+	CleanupClosePushL(targetStream);
+	const TInt arrayCount(iNonNativeApplicationTypeArray.Count());
+	TInt arrayCountToExternalize=arrayCount;
+	if (aIndexToIgnore>=0)
+		{
+		--arrayCountToExternalize;
+		}
+	TCardinality(arrayCountToExternalize).ExternalizeL(targetStream);
+	for (TInt i=0; i<arrayCount; ++i)
+		{
+		if (i!=aIndexToIgnore)
+			{
+			const SNonNativeApplicationType& nonNativeApplicationType=iNonNativeApplicationTypeArray[i];
+			targetStream.WriteUint32L(nonNativeApplicationType.iTypeUid.iUid);
+			targetStream << *nonNativeApplicationType.iNativeExecutable;
+			}
+		}
+	targetStream.CommitL();
+	CleanupStack::PopAndDestroy(2, &file);
+	}
+
+TPtrC CApaAppListServer::NativeExecutableL(TUid aNonNativeApplicationType) const
+	{
+	for (TInt i=iNonNativeApplicationTypeArray.Count()-1; i>=0; --i)
+		{
+		const SNonNativeApplicationType& nonNativeApplicationType=iNonNativeApplicationTypeArray[i];
+		if (nonNativeApplicationType.iTypeUid.iUid==aNonNativeApplicationType.iUid)
+			{
+			return *nonNativeApplicationType.iNativeExecutable;
+			}
+		}
+	User::Leave(KErrNotSupported); // not KErrNotFound
+	return KNullDesC();
+	}
+
+void CApaAppListServer::DeleteLastNonNativeApplicationType(TAny* aThis)
+	{ // static
+	CApaAppListServer& self=*static_cast<CApaAppListServer*>(aThis);
+	const TInt arrayIndex=self.iNonNativeApplicationTypeArray.Count()-1;
+	delete self.iNonNativeApplicationTypeArray[arrayIndex].iNativeExecutable;
+	self.iNonNativeApplicationTypeArray[arrayIndex].iNativeExecutable = NULL;
+	self.iNonNativeApplicationTypeArray.Remove(arrayIndex);
+	}
+
+void CApaAppListServer::NotifyScanComplete()
+	{
+	// Updates the applist with the icon caption details from the Central Repository.
+	TRAP_IGNORE(UpdateAppListByIconCaptionOverridesL());
+	// The short caption value sets through the API has got the highest precedence over the
+	// values found in either central repository or resource file.		
+	TRAP_IGNORE(UpdateAppListByShortCaptionL());
+
+	// iterate through sessions
+	iSessionIter.SetToFirst();
+	CApaAppListServSession* ses=static_cast<CApaAppListServSession*>(&(*iSessionIter++));
+	while (ses!=NULL)
+		{
+		ses->NotifyScanComplete();	
+		ses=static_cast<CApaAppListServSession*>(&(*iSessionIter++));
+		}
+	}
+
+void CApaAppListServer::AddCustomAppInfoInListL(CCustomAppInfoData* aCustomAppInfo)
+	{
+	TBool replaced=EFalse;
+	for (TInt i=iCustomAppList.Count()-1; i>=0; --i)
+		{
+		if ((aCustomAppInfo->Uid()==iCustomAppList[i]->Uid()) && (aCustomAppInfo->Language()==iCustomAppList[i]->Language()))
+			{
+			CCustomAppInfoData* oldAppInfo = iCustomAppList[i];
+			iCustomAppList[i]=aCustomAppInfo;
+			delete oldAppInfo;
+			replaced=ETrue;
+			break;
+			}
+		}
+	//Add ELangNone items at the end and others at the beginning
+	if(!replaced)
+		{
+		if(aCustomAppInfo->Language()==ELangNone)
+			{
+			iCustomAppList.AppendL(aCustomAppInfo);
+			}
+		else
+			{
+			iCustomAppList.InsertL(aCustomAppInfo,0);
+			}
+		}
+	
+	} //lint !e818 Suppress pointer parameter could be declared as pointing to const - this method takes ownership
+
+
+void CApaAppListServer::UpdateAppListByShortCaptionL()
+	{
+	CApaAppData* app=NULL;
+	//Items with ELangNone are always found at the end and other languages at the beginning
+	//While iterating from end to beginning, we overwrite short caption set by ELangNone if there is any provided for the application language
+	for (TInt i=iCustomAppList.Count()-1; i>=0; --i)
+		{
+		const CCustomAppInfoData* const customAppInfo=iCustomAppList[i];
+		app=iAppList->AppDataByUid(customAppInfo->Uid());
+		if ( app && ((app->ApplicationLanguage()==customAppInfo->Language()) || (customAppInfo->Language()==ELangNone)))
+			{
+			app->SetShortCaptionL(*customAppInfo->ShortCaption());
+			}
+		}
+	}
+
+void CApaAppListServer::UpdateAppListByIconCaptionOverridesL()
+	{
+	// get the language downgrade path, so that most appropriate language can be used
+	RArray<TLanguage> languageDowngradePath;
+	CleanupClosePushL(languageDowngradePath);
+	BaflUtils::GetDowngradePathL(iFs, User::Language(), languageDowngradePath);
+	for (CApaAppData* app = iAppList->FirstApp(); app; app = iAppList->NextApp(app))
+		{
+		CApaIconCaptionOverridesForApp* appOverride = iIconCaptionOverrides->OverrideForApp(app->AppEntry().iUidType[2]);
+		if (appOverride)
+			{
+			TApaIconCaptionOverrideReader overrideReader = appOverride->Reader(languageDowngradePath);
+			const TDesC* shortCaption = overrideReader.ShortCaption();
+			if (shortCaption)
+				app->SetShortCaptionL(*shortCaption);
+			const TDesC* caption = overrideReader.Caption();
+			if (caption)
+				app->SetCaptionL(*caption);
+			const TDesC* iconFileName = overrideReader.IconFileName();
+			if (overrideReader.NumIconsSet() && iconFileName)
+				app->SetIconsL(*iconFileName, overrideReader.NumIcons());
+			}
+		}
+	CleanupStack::PopAndDestroy(&languageDowngradePath);
+	}
+
+CCustomAppInfoData* CCustomAppInfoData::NewL(TUid aAppUid, TLanguage aLanguage, const TDesC& aShortCaption)
+	{
+	CCustomAppInfoData* self=new(ELeave) CCustomAppInfoData(aAppUid, aLanguage);
+    CleanupStack::PushL(self);
+	self->ConstructL(aShortCaption);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+CCustomAppInfoData::~CCustomAppInfoData()
+	{
+	delete iShortCaption;
+	}
+
+CCustomAppInfoData::CCustomAppInfoData(TUid aAppUid, TLanguage aLanguage)
+	:iUid(aAppUid),
+	iLanguage(aLanguage)
+	{
+	}
+
+void CCustomAppInfoData::ConstructL(const TDesC& aShortCaption)
+	{
+	iShortCaption=aShortCaption.AllocL();
+	}
+
+/*
+ * Data Recognizer calls
+ */
+ 
+TBool CApaAppListServer::CachedRecognitionResult(const TParseBase& aParser, TDataRecognitionResult& aResult) const
+	{
+	if(iRecognitionCache && aParser.PathPresent() && aParser.NamePresent())
+		{
+		return iRecognitionCache->Get(aParser.DriveAndPath(), aParser.NameAndExt(), aResult);
+		}
+	return EFalse;
+	}
+
+/**
+N.B. The @c CRecognitionResult object is reference counted so it must be closed!
+*/
+CRecognitionResult* CApaAppListServer::CachedRecognitionResult(const RFile& aFile, const TParseBase& aParser) const
+	{
+	if(iRecognitionCache && aParser.PathPresent() && aParser.NamePresent())
+		{
+		return iRecognitionCache->Get(aFile, aParser.DriveAndPath(), aParser.NameAndExt());
+		}
+	return NULL;
+	}
+
+void CApaAppListServer::CacheRecognitionResultL(const TParseBase& aParser, const TDataRecognitionResult& aResult)
+	{
+	if(iRecognitionCache && aParser.PathPresent() && aParser.NamePresent())
+		{
+		iRecognitionCache->AddL(aParser.DriveAndPath(), aParser.NameAndExt(), aResult);
+		}
+	}
+
+void CApaAppListServer::CacheRecognitionResultL(const RFile& aFile, const TParseBase& aParser, const TDataRecognitionResult& aResult)
+	{
+	if(iRecognitionCache && aParser.PathPresent() && aParser.NamePresent())
+		{
+		iRecognitionCache->AddL(aFile, aParser.DriveAndPath(), aParser.NameAndExt(), aResult);
+		}
+	}
+
+TDataRecognitionResult CApaAppListServer::RecognizeDataL(const TDesC& aName, const TDesC8& aBuffer)
+	{
+	TParsePtrC parser(iFs.IsValidName(aName) ? aName : KNullDesC);
+	TDataRecognitionResult result;
+	
+	// check cache	
+	if(!CachedRecognitionResult(parser, result))
+		{
+		// recognize
+		if(iLoadRecognizersOnDemand)
+			{
+			LoadRecognizersLC();
+			}
+		result = iDataRecognizer->RecognizeL(aName, aBuffer);
+		if(iLoadRecognizersOnDemand)
+			{
+			CleanupStack::PopAndDestroy();
+			}
+
+		// add to cache
+		CacheRecognitionResultL(parser, result);
+		}
+	
+	return result;	
+	}
+
+TDataRecognitionResult CApaAppListServer::RecognizeDataL(RFile& aFile, TInt aPreferredBufSize)
+	{
+	CRecognitionResult* result = RecognizeDataAsCRecognitionResultL(aFile, aPreferredBufSize);
+	TDataRecognitionResult ret;
+	result->Get(ret);
+	result->Close();
+	return ret;
+	}
+
+/**
+Same as @c RecognizeDataL(RFile&, TInt) but returns a @c CRecognitionResult 
+instead of a @c TDataRecognitionResult.
+
+N.B. The @c CRecognitionResult object is reference counted so it must be closed!
+*/
+CRecognitionResult* CApaAppListServer::RecognizeDataAsCRecognitionResultL(RFile& aFile, TInt aPreferredBufSize)
+	{
+	CRecognitionResult* result = NULL;
+	
+	TFileName fileName;
+	User::LeaveIfError(aFile.FullName(fileName));
+	TParsePtrC parser(fileName); //fileName is valid since it comes from RFile
+
+	//check cache
+	result = CachedRecognitionResult(aFile,parser);
+	if(!result)
+		{
+		// recognize
+		if(iLoadRecognizersOnDemand)
+			{
+			LoadRecognizersLC();
+			}
+		const TDataRecognitionResult recResult = iDataRecognizer->RecognizeL(aFile, aPreferredBufSize);
+		if(iLoadRecognizersOnDemand)
+			{
+			CleanupStack::PopAndDestroy();
+			}
+		
+		//add to cache
+		CacheRecognitionResultL(aFile, parser, recResult);
+
+		result = CRecognitionResult::NewL(parser.NameAndExt(), recResult);
+		}
+	
+	return result;
+	}
+
+TBool CApaAppListServer::RecognizeDataL(const TDesC& aName, const TDesC8& aBuffer, const TDataType& aDataType)
+	{
+	if(iLoadRecognizersOnDemand)
+		{
+		LoadRecognizersLC();
+		}
+	const TBool ret = iDataRecognizer->RecognizeL(aName,aBuffer,aDataType);
+	if(iLoadRecognizersOnDemand)
+		{
+		CleanupStack::PopAndDestroy();
+		}
+	return ret;
+	}
+
+TBool CApaAppListServer::RecognizeDataL(RFile& aFile, TInt aPreferredBufSize, const TDataType& aDataType)
+	{
+	if(iLoadRecognizersOnDemand)
+		{
+		LoadRecognizersLC();
+		}
+	const TBool ret = iDataRecognizer->RecognizeL(aFile,aPreferredBufSize,aDataType);
+	if(iLoadRecognizersOnDemand)
+		{
+		CleanupStack::PopAndDestroy();
+		}
+	return ret;
+	}
+
+TInt CApaAppListServer::DataRecognizerPreferredBufSizeL()
+	{
+	if(iLoadRecognizersOnDemand)
+		{
+		LoadRecognizersLC();
+		}
+	const TInt ret = iDataRecognizer->PreferredBufSize();
+	if(iLoadRecognizersOnDemand)
+		{
+		CleanupStack::PopAndDestroy();
+		}
+	return ret;
+	}
+
+void CApaAppListServer::DataTypeL(CDataTypeArray& aArray)
+	{
+	if(iLoadRecognizersOnDemand)
+		{
+		LoadRecognizersLC();
+		}
+	iDataRecognizer->DataTypeL(aArray);
+	if(iLoadRecognizersOnDemand)
+		{
+		CleanupStack::PopAndDestroy();
+		}
+	}
+
+/*
+ * Recognizer loading/unloading code
+ */
+
+void CApaAppListServer::LoadRecognizersLC()
+	{
+	ASSERT(iLoadRecognizersOnDemand);
+
+	LoadRecognizersL();
+	TCleanupItem cleanup(CApaAppListServer::RecognizerCleanup, this);
+	CleanupStack::PushL(cleanup);
+	}
+
+void CApaAppListServer::RecognizerCleanup(TAny* aSelf)
+	{
+	if (aSelf)
+		{
+		static_cast<CApaAppListServer*>(aSelf)->UnloadRecognizers();
+		}
+	}
+
+void CApaAppListServer::LoadRecognizersL()
+	{
+	ASSERT(iLoadRecognizersOnDemand);
+
+	if(iRecognizerUnloadTimer->IsActive())
+		{
+		__ASSERT_DEBUG(iRecognizerUsageCount==0,Panic(EReferenceCountingError1));
+		iRecognizerUnloadTimer->Cancel();
+		}
+	else if(iRecognizerUsageCount==0)
+		{
+		iDataRecognizer->LoadRecognizersL();
+		}
+
+	++iRecognizerUsageCount;
+	}
+
+TInt CApaAppListServer::UnloadRecognizers()
+	{
+	ASSERT(iLoadRecognizersOnDemand);
+
+	--iRecognizerUsageCount;
+	__ASSERT_DEBUG(iRecognizerUsageCount>=0,Panic(EReferenceCountingError2));
+	if (iRecognizerUsageCount==0)
+		{
+		iRecognizerUnloadTimer->Start(KApaUnloadRecognizersTimeout,0,TCallBack(CApaAppListServer::DoUnloadRecognizersCallback,this));
+		}
+	return KErrNone;
+	}
+	
+TInt CApaAppListServer::DoUnloadRecognizersCallback(TAny* aSelf)
+	{
+	TInt ret=KErrNone;
+	if (aSelf)
+		{
+		ret = static_cast<CApaAppListServer*>(aSelf)->DoUnloadRecognizers();
+		}
+	return ret;
+	}
+
+TInt CApaAppListServer::DoUnloadRecognizers()
+	{
+	ASSERT(iLoadRecognizersOnDemand);
+
+	// need to cancel the periodic timer since we only want a oneshot timer
+	iRecognizerUnloadTimer->Cancel();
+	iDataRecognizer->UnloadRecognizers();
+	return KErrNone;
+	}
+	
+void CApaAppListServer::GetAppByDataType(const TDataType& aDataType, TUid& aUid) const
+	{
+	iTypeStoreManager->GetAppByDataType(aDataType, aUid);
+	}
+	
+void CApaAppListServer::GetAppByDataType(const TDataType& aDataType, TUid aServiceUid, TUid& aUid) const
+	{
+	iTypeStoreManager->GetAppByDataType(aDataType, aServiceUid, aUid);
+	}
+	
+TBool CApaAppListServer::InsertAndStoreIfHigherL(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid)
+	{
+	return iTypeStoreManager->InsertAndStoreIfHigherL(aDataType, aPriority, aUid);
+	}
+	
+void CApaAppListServer::InsertAndStoreDataMappingL(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid, TUid aServiceUid)
+	{
+	iTypeStoreManager->InsertAndStoreDataMappingL(aDataType, aPriority, aUid, aServiceUid);
+	}
+	
+void CApaAppListServer::DeleteAndStoreDataMappingL(const TDataType& aDataType, TUid aServiceUid)
+	{
+	iTypeStoreManager->DeleteAndStoreDataMappingL(aDataType, aServiceUid);
+	}
+	
+CApaFileRecognizer* CApaAppListServer::FileRecognizer()
+	{ 
+	return static_cast<CApaFileRecognizer*>(iScanningFileRecognizer); 
+	}
+
+TBool CApaAppListServer::LoadMbmIconsOnDemand() const
+	{
+	return iLoadMbmIconsOnDemand;
+	}
+
+#ifdef _DEBUG
+
+/**
+Flushes the recognition cache.
+
+Useful for debugging.
+*/
+void CApaAppListServer::FlushRecognitionCache()
+	{
+	if(iRecognitionCache)
+		iRecognitionCache->Flush();
+	}
+
+/**
+Sets whether or not recognizers should be loaded when they are needed.
+
+Useful for debugging.
+*/	
+void CApaAppListServer::SetLoadRecognizersOnDemandL(TBool aLoadRecognizersOnDemand)
+	{
+	if(iLoadRecognizersOnDemand == aLoadRecognizersOnDemand)
+		return;
+	
+	CPeriodic* newUnloadTimer;
+	if(aLoadRecognizersOnDemand)
+		{
+		ASSERT(!iRecognizerUnloadTimer);
+		newUnloadTimer = CPeriodic::NewL(EPriorityNormal);
+		}
+	else
+		{
+		ASSERT(iRecognizerUnloadTimer);
+		newUnloadTimer = NULL;
+		}
+	CleanupStack::PushL(newUnloadTimer);
+	
+	CApaScanningDataRecognizer* newDataRecognizer = CApaScanningDataRecognizer::NewL(iFs,!aLoadRecognizersOnDemand);
+	delete iDataRecognizer;
+	iDataRecognizer = newDataRecognizer;
+	
+	delete iRecognizerUnloadTimer;
+	iRecognizerUnloadTimer = newUnloadTimer;
+	CleanupStack::Pop(newUnloadTimer);
+	
+	iRecognizerUsageCount = 0;
+	iLoadRecognizersOnDemand = aLoadRecognizersOnDemand;	
+	}
+
+/**
+If recognizers are set to be loaded on demand this method can be used to perform
+the unloading synchronously, instead of waiting for the unloading timer to go off.
+
+Useful for debugging.
+*/
+void CApaAppListServer::PerformOutstandingRecognizerUnloading()
+	{
+	if(iLoadRecognizersOnDemand && iRecognizerUnloadTimer->IsActive())
+		{
+		__ASSERT_DEBUG(iRecognizerUsageCount==0,Panic(EReferenceCountingError3));
+		DoUnloadRecognizers();
+		}
+	}
+
+#endif //_DEBUG
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apserv/APSSES.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,2291 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// AppArc server session
+// 
+//
+
+#include <e32svr.h>
+#include <apacmdln.h>
+#include <apaflrec.h>
+#include <apsserv.h>
+#include "APSSES.H"
+#ifdef _DEBUG
+#include "APSSTD.H"
+#endif //_DEBUG
+#include "APSCLSV.H"
+#include <apsscan.h>
+#include <apgaplst.h>
+#include <apgicnfl.h>
+#include <apmrec.h>
+#include <apmstd.h>
+#include <apmfndr.h>
+#include <datastor.h>
+#include <s32mem.h>
+#include <s32strm.h>
+#include <s32file.h>
+#include "../apgrfx/apprivate.h"
+#include "apgnotif.h"
+#include "../apfile/aprfndr.h"
+#include "ApLaunchChecker.h"
+#include "apsnnapps.h"
+
+#include "apsecutils.h"
+
+const TInt KApaAppListServMaxBuffer=256;
+#include "APSRECCACHE.h"
+const TInt KApaAppInfoArrayGranularity=4;
+const TInt KApaAppInfoDesMaxLength=sizeof(TApaAppInfo);
+
+#if defined(__PROFILE)
+_LIT(KProfileAppForDocumentL, "AppForDocumentL - %d.%06d seconds");
+_LIT(KProfileAppForDocumentPassedByFileHandleL, "AppForDocumentPassedByFileHandleL - %d.%06d seconds");
+#endif
+_LIT(KApaPanicCli,"APSERV-CLI");
+const TInt KFinishedScanning=-2;
+
+
+class MArrayItemWriter
+	{
+public:
+	virtual TInt ArrayItemCount() const=0;
+	virtual TInt ArrayItemSize() const=0;
+	virtual void WriteArrayItemL(RWriteStream& aWriteStream,TInt aIndex) const=0;
+	};
+
+class TSizeArrayItemWriter : public MArrayItemWriter
+	{
+public:
+	inline TSizeArrayItemWriter(const CArrayFix<TSize>& aArray) : iArray(aArray) {}
+	
+	// from MArrayItemWriter
+	TInt ArrayItemCount() const;
+	TInt ArrayItemSize() const;
+	void WriteArrayItemL(RWriteStream& aWriteStream,TInt aIndex) const;
+private:
+	const CArrayFix<TSize>& iArray;
+	};
+
+class TViewDataArrayItemWriter : public MArrayItemWriter
+	{
+public:
+	inline TViewDataArrayItemWriter(const CArrayPtr<CApaAppViewData>& aArray) : iArray(aArray) {}
+	
+	// from MArrayItemWriter
+	TInt ArrayItemCount() const;
+	TInt ArrayItemSize() const;
+	void WriteArrayItemL(RWriteStream& aWriteStream,TInt aIndex) const;
+private:
+	const CArrayPtr<CApaAppViewData>& iArray;
+	};
+
+class TDesCArrayItemWriter : public MArrayItemWriter
+	{
+public:
+	inline TDesCArrayItemWriter(const CDesCArray& aArray) : iArray(aArray) {}
+	
+	// from MArrayItemWriter
+	TInt ArrayItemCount() const;
+	TInt ArrayItemSize() const;
+	void WriteArrayItemL(RWriteStream& aWriteStream,TInt aIndex) const;
+private:
+	const CDesCArray& iArray;
+	};
+
+
+class CApaAppListServSession::CApaAppInfo
+	{
+public:
+	CApaAppInfo();
+	~CApaAppInfo();
+	void SetUid(const TUid aUid);
+	void SetCaptionL(const TDesC& aCaption);
+	void SetShortCaptionL(const TDesC& aShortCaption);
+	void SetFullNameL(const TDesC& aFullName);
+	inline TPtrC Caption() const;
+	inline TPtrC ShortCaption() const;
+	inline TPtrC FullName() const;
+	inline TUid Uid() const;
+private:
+	TUid iUid;
+	HBufC* iCaption;
+	HBufC* iShortCaption;
+	HBufC* iFullName;
+	};
+
+inline TPtrC CApaAppListServSession::CApaAppInfo::Caption() const
+	{ return *iCaption; }
+
+inline TPtrC CApaAppListServSession::CApaAppInfo::ShortCaption() const
+	{ return *iShortCaption; }
+
+inline TPtrC CApaAppListServSession::CApaAppInfo::FullName() const
+	{ return *iFullName; }
+
+inline TUid CApaAppListServSession::CApaAppInfo::Uid() const
+	{ return iUid; }
+
+// CApaAppListServSession
+
+CApaAppListServSession* CApaAppListServSession::NewL(CApaAppListServer& aServer, RFs& aFs)
+	{
+	CApaAppListServSession* self=new(ELeave) CApaAppListServSession(aServer, aFs);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(); // self
+	return self;
+	}
+
+CApaAppListServSession::CApaAppListServSession(CApaAppListServer& aServer, RFs& aFs)
+	: CSession2(),
+	iServ(aServer),
+	iFs(aFs),
+	iMaxBufSize(KApaAppListServMaxBuffer),
+	iApaAppInfoArray(KApaAppInfoArrayGranularity),
+	iOpaqueData_pendingDispatchToClient(NULL)
+	{}
+
+void CApaAppListServSession::ConstructL()
+	{
+	iFileRecognitionUtility = new (ELeave) CFileRecognitionUtility(iServ, iMaxBufSize, iFs);
+	iNonNativeApplicationsManager = CApsNonNativeApplicationsManager::NewL(iServ,iFs);
+	}
+
+CApaAppListServSession::~CApaAppListServSession()
+	{
+	delete iNonNativeApplicationsManager;
+	delete iBuffer;
+	iApaAppInfoArray.ResetAndDestroy();
+	iApaAppInfoArray.Close();
+	delete iFileRecognitionUtility;
+	delete iRecognitionResult;
+	delete iOpaqueData_pendingDispatchToClient;
+	}
+
+void CApaAppListServSession::ServiceL(const RMessage2& aMessage)
+	{
+	TBool completeMessage=ETrue;
+	switch (aMessage.Function())
+		{
+	case ESetNotify:
+		SetNotify(aMessage);
+		completeMessage=EFalse;
+		break;
+	case ERegisterListPopulationCompleteObserver:
+		RegisterListPopulationCompleteObserver(aMessage);
+		completeMessage=EFalse;
+		break;
+	case ECancelListPopulationCompleteObserver:
+		CancelListPopulationCompleteObserver();
+		break;
+	case EAppListServInitFullList:
+		User::Leave(KErrNotSupported);
+	case EAppListServInitEmbedList:
+		User::Leave(KErrNotSupported);
+	case EAppListServInitFilteredEmbedList:
+		InitListL(aMessage,EListFilteredEmbeddedApps);
+		break;
+	case EAppListServInitAttrFilteredList:
+		InitListL(aMessage,EListCapabilityAttrFilteredApps);
+		break;
+	case EAppListServInitServerAppList:
+		InitListL(aMessage,EListServerApps);
+		break;
+	case EAppListServGetNextApp:
+		GetNextAppL(aMessage);
+		break;
+	case EAppListServEmbedCount:
+		EmbedCount(aMessage);
+		break;
+	case EAppListServAppCount:
+		AppCount(aMessage);
+		break;
+	case EAppListServGetAppInfo:
+		GetAppInfoL(aMessage);
+		break;
+	case EAppListServGetAppCapability:
+		GetAppCapabilityL(aMessage);
+		break;
+	case EAppListServGetDefaultScreenNumber:
+		GetDefaultScreenNumberL(aMessage);
+		break;
+	case EAppListServStartAppWithoutReturningThreadId:
+		StartAppL(aMessage,EFalse);
+		break;
+	case EAppListServStartAppReturningThreadId:
+		StartAppL(aMessage,ETrue);
+		break;
+	case EAppListServRecognizeData:
+		RecognizeDataL(aMessage);
+		break;
+	case EAppListServRecognizeDataPassedByFileHandle:
+		RecognizeDataPassedByFileHandleL(aMessage);
+		break;
+	case EAppListServRecognizeSpecificData:
+		RecognizeSpecificDataL(aMessage);
+		break;
+	case EAppListServRecognizeSpecificDataPassedByFileHandle:
+		RecognizeSpecificDataPassedByFileHandleL(aMessage);
+		break;
+	case EAppListServAppForDataType:
+		AppForDataTypeL(aMessage);
+		break;
+	case EAppListServStartDocument:
+		StartDocumentL(aMessage,EStart);
+		break;
+	case EAppListServStartDocumentByDataType:
+		StartDocumentL(aMessage,EStartByDataType);
+		break;
+	case EAppListServStartDocumentByUid:
+		StartDocumentL(aMessage,EStartByUid);
+		break;
+	case EAppListServCreateDocumentByUid:
+		StartDocumentL(aMessage,ECreateByUid);
+		break;
+	case EAppListServGetExecutableNameGivenDocument:
+		GetExecutableNameGivenDocumentL(aMessage);
+		break;
+	case EAppListServGetExecutableNameGivenDocumentPassedByFileHandle:
+		GetExecutableNameGivenDocumentPassedByFileHandleL(aMessage);
+		break;
+	case EAppListServGetExecutableNameGivenDataType:
+		GetExecutableNameGivenDataTypeL(aMessage);
+		break;
+	case EAppListServGetExecutableNameGivenAppUid:
+		GetExecutableNameGivenAppUidL(aMessage);
+		break;
+	case EAppListServGetOpaqueData:
+		GetOpaqueDataL(aMessage);
+		break;
+	case EAppListServGetNativeExecutableNameIfNonNative:
+		GetNativeExecutableNameIfNonNativeL(aMessage);
+		break;
+	case EAppListServAppIconByUid:
+		IconForAppL(aMessage);
+		break;
+	case EAppListServAppForDocument:
+		AppForDocumentL(aMessage, NULL);
+		break;
+	case EAppListServAppForDocumentPassedByFileHandle:
+		AppForDocumentPassedByFileHandleL(aMessage, NULL);
+		break;
+	case EAppListServGetConfidence:
+		GetConfidenceL(aMessage);
+		break;
+	case EAppListServSetConfidence:
+		SetConfidence(aMessage);
+		break;
+	case EAppListServGetBufSize:
+		GetBufSize(aMessage);
+		break;
+	case EAppListServSetBufSize:
+		SetBufSize(aMessage);
+		break;
+	case EAppListServGetDataTypesPhase1:
+		GetDataTypesCountL(aMessage);
+		break;
+	case EAppListServGetDataTypesPhase2:
+		GetDataTypesL(aMessage);
+		break;
+	case ECancelNotify:
+		CancelNotify();
+		break;
+	case EAppListServAppIconByUidAndSize:
+		IconForAppBySizeL(aMessage);
+		break;
+	case EAppListServAppIconFileHandle:
+		IconFileHandleForAppL(aMessage);
+		break;	
+	case EAppListServGetAppIconSizes:
+		AppIconSizesL(aMessage);
+		break;
+	case EAppListServViewIconByUidAndSize:
+		IconForViewBySizeL(aMessage);
+		break;
+	case EAppListServGetAppViews:
+		AppViewsL(aMessage);
+		break;
+	case EAppListServGetFileOwnershipInfo:
+		AppFileOwnershipInfoL(aMessage);
+		break;
+	case EAppListServNumberOfOwnDefinedIcons:
+		NumberOfOwnDefinedIconsL(aMessage);
+		break;
+	case EAppListServApplicationLanguage:
+		ApplicationLanguageL(aMessage);
+		break;
+	case EAppListServAppInfoProvidedByRegistrationFile: // private OpCode for CEikApplication's use only
+		AppInfoProvidedByRegistrationFileL(aMessage);
+		break;
+	case EAppListServAppIconFileName:
+		IconFileNameL(aMessage);
+		break;
+	case EAppListServAppViewIconFileName:
+		ViewIconFileNameL(aMessage);
+		break;
+	case EAppListInsertDataMapping:
+	case EAppListInsertDataMappingIfHigher:
+		InsertDataMappingL(aMessage);
+		break;
+	case EAppListDeleteDataMapping:
+		DeleteDataMappingL(aMessage);
+		break;
+	case EAppListServGetAppByDataType:
+		GetAppByDataTypeL(aMessage);
+		break;		
+	case EAppListServGetAppServices:
+	case EAppListServGetServiceImplementations:
+	case EAppListServGetServiceImplementationsDataType:
+	case EAppListServGetAppServiceUids:
+	case EAppListServGetAppServiceOpaqueData:
+		GetAppServicesL(aMessage);
+		break;
+	case EAppListServAppForDataTypeAndService:
+		AppForDataTypeAndServiceL(aMessage);
+		break;
+	case EAppListServAppForDocumentAndService:
+		{
+		const TUid serviceUid=TUid::Uid(aMessage.Int1());
+		AppForDocumentL(aMessage, &serviceUid);
+		}
+		break;
+	case EAppListServAppForDocumentAndServicePassedByFileHandle:
+		{
+		const TUid serviceUid(TUid::Uid(aMessage.Int1()));
+		AppForDocumentPassedByFileHandleL(aMessage, &serviceUid);
+		}
+		break;
+	case EAppListServRegisterNonNativeApplicationType:
+		RegisterNonNativeApplicationTypeL(aMessage);
+		break;
+	case EAppListServDeregisterNonNativeApplicationType:
+		DeregisterNonNativeApplicationTypeL(aMessage);
+		break;
+	case EAppListServPrepareNonNativeApplicationsUpdates:
+		iNonNativeApplicationsManager->PrepareNonNativeApplicationsUpdatesL();
+		break;
+	case EAppListServRegisterNonNativeApplication:
+		iNonNativeApplicationsManager->RegisterNonNativeApplicationL(aMessage);
+		break;
+	case EAppListServDeregisterNonNativeApplication:
+		iNonNativeApplicationsManager->DeregisterNonNativeApplicationL(aMessage);
+		break;
+	case EAppListServCommitNonNativeApplications:
+		iNonNativeApplicationsManager->CommitNonNativeApplicationsUpdatesL(aMessage);
+		completeMessage=EFalse;
+		break;
+	case EAppListServRollbackNonNativeApplications:
+		iNonNativeApplicationsManager->RollbackNonNativeApplicationsUpdates();
+		break;
+	case EAppListServGetAppType:
+		GetAppTypeL(aMessage);
+		break;
+	case EAppListServForceRegistration:
+		ForceRegistrationL(aMessage);
+		completeMessage=EFalse;
+		break;
+	case EAppListServPreferredBufSize:
+		aMessage.Complete(PreferredBufSize());
+		break;
+	case EAppListServRecognizeFiles:
+		RecognizeFilesL(aMessage);
+		break;
+	case EAppListServTransferRecognitionResult:
+		TransferRecognitionResultL(aMessage);
+		break;
+	case EAppListServRecognizeFilesAsync:
+		RecognizeFilesAsyncL(aMessage);
+		completeMessage=EFalse;
+		break;
+	case ECancelRecognizeFiles:
+		CancelRecognizeFiles();
+		break;
+	case EAppListServRuleBasedLaunching:
+		RuleBasedLaunchingL(aMessage);
+		break;
+	case EMatchesSecurityPolicy:
+		MatchesSecurityPolicyL(aMessage);
+		break;
+	case EAppListServSetAppShortCaption:
+		SetAppShortCaptionL(aMessage);
+		break;
+	case ENotifyOnDataMappingChange:
+		NotifyOnDataMappingChange(aMessage);
+		completeMessage=EFalse;
+		break;
+	case ECancelNotifyOnDataMappingChange:
+		CancelNotifyOnDataMappingChange();
+		break;
+	case EDebugHeapMark:
+	#ifdef _DEBUG
+		__UHEAP_MARK;
+	#endif
+		break;
+	case EDebugHeapMarkEnd:
+	#ifdef _DEBUG
+		__UHEAP_MARKENDC(aMessage.Int0());
+	#endif
+		break;
+	case EDebugHeapFailNext:
+	#ifdef _DEBUG
+		__UHEAP_FAILNEXT(aMessage.Int0());
+	#endif
+		break;
+	case EDebugClearAppInfoArray:
+	#ifdef _DEBUG
+		iApaAppInfoArray.ResetAndDestroy();
+		iApaAppInfoArray.Compress();
+	#endif
+		break;
+	case EDebugFlushRecognitionCache:
+	#ifdef _DEBUG
+		iServ.FlushRecognitionCache();
+	#endif
+		break;
+	case EDebugSetLoadRecognizersOnDemand:
+	#ifdef _DEBUG
+		iServ.SetLoadRecognizersOnDemandL(aMessage.Int0());
+	#endif
+		break;
+	case EDebugPerformOutstandingRecognizerUnloading:
+	#ifdef _DEBUG
+		iServ.PerformOutstandingRecognizerUnloading();
+		REComSession::FinalClose();
+	#endif
+		break;
+	case EDebugAddFailingNonNativeApplicationsUpdate:
+	#ifdef _DEBUG
+		iNonNativeApplicationsManager->ForceFailInNonNativeApplicationsUpdatesL();
+	#endif
+		break;
+	case EDebugAddPanicingNonNativeApplicationsUpdate:
+	#ifdef _DEBUG
+		iNonNativeApplicationsManager->ForcePanicInNonNativeApplicationsUpdatesL();
+	#endif
+		break;
+	case EDebugAddRollbackPanicingNonNativeApplicationsUpdate:
+	#ifdef _DEBUG
+		iNonNativeApplicationsManager->ForcePanicInNonNativeApplicationsRollbackL();
+	#endif
+		break;
+	default:
+		aMessage.Panic(KApaPanicCli,EClientBadRequest);
+		break;
+		}
+		
+	if (completeMessage && !aMessage.IsNull())
+		{
+		aMessage.Complete(KErrNone);
+		}
+	}
+void CApaAppListServSession::NotifyOnDataMappingChange(const RMessage2& aMessage)
+	{ 
+	if (!iMessage_NotifyOnDataMappingChange.IsNull())
+			{
+			aMessage.Panic(KApaPanicCli,ENotifyOnDataMappingChangeRequestOutstanding);
+			}
+	else
+			{
+			iMessage_NotifyOnDataMappingChange=aMessage;
+			}
+	}
+void CApaAppListServSession::CancelNotifyOnDataMappingChange()
+	{
+	if (!iMessage_NotifyOnDataMappingChange.IsNull())
+			{
+			iMessage_NotifyOnDataMappingChange.Complete(KErrCancel);
+			}
+	} //lint !e1762 Suppress member function could be made const
+
+
+TInt CApaAppListServSession::PreferredBufSize() const
+	{
+	TInt preferredBufferSize = 0;
+	TRAPD(err, preferredBufferSize = iServ.DataRecognizerPreferredBufSizeL());
+	return (err==KErrNone) ? Min(iMaxBufSize, preferredBufferSize) : iMaxBufSize;
+	}
+
+void CApaAppListServSession::RegisterNonNativeApplicationTypeL(const RMessage2& aMessage)
+	{
+	const TUid applicationType(TUid::Uid(aMessage.Int0()));
+	HBufC* const nativeExecutable=HBufC::NewLC(User::LeaveIfError(aMessage.GetDesLength(1)));
+	{TPtr nativeExecutable_asWritable(nativeExecutable->Des());
+	aMessage.ReadL(1, nativeExecutable_asWritable);}
+	iServ.RegisterNonNativeApplicationTypeL(applicationType, *nativeExecutable);
+	CleanupStack::PopAndDestroy(nativeExecutable);
+	}
+
+void CApaAppListServSession::DeregisterNonNativeApplicationTypeL(const RMessage2& aMessage)
+	{
+	const TUid applicationType(TUid::Uid(aMessage.Int0()));
+	iServ.DeregisterNonNativeApplicationTypeL(applicationType);
+	}
+
+void CApaAppListServSession::GetAppTypeL(const RMessage2& aMessage)
+	{
+	TInt uid = aMessage.Int0();
+	CApaAppData* appData = iServ.AppList().AppDataByUid(TUid::Uid(uid));
+	if (!appData)
+		{
+		aMessage.Complete(KErrNotFound);
+		return;
+		}
+	TPckgBuf<TUid> typeUid(appData->NonNativeApplicationType());
+	aMessage.WriteL(1,typeUid);
+	aMessage.Complete(KErrNone);
+	}
+	
+void CApaAppListServSession::ForceRegistrationL(const RMessage2& aMessage)
+	{
+	TInt bufferSize = aMessage.GetDesLength(0);
+	User::LeaveIfError(bufferSize);
+	HBufC8* const buffer=HBufC8::NewLC(bufferSize);
+	TPtr8 buffer_asWritable(buffer->Des());
+	aMessage.ReadL(0,buffer_asWritable);
+		
+	RDesReadStream readStream(*buffer);
+	CleanupClosePushL(readStream);
+	const TUint count=readStream.ReadUint32L();
+	for (TUint i = 0; i < count; ++i)
+		{
+		TUint length = readStream.ReadUint32L();
+		HBufC* regFile = HBufC::NewLC(length);
+  		TPtr ptr(regFile->Des());
+  		readStream.ReadL(ptr, length);
+		iServ.AppList().AddForcedRegistrationL(regFile);
+		CleanupStack::Pop(regFile);
+		}
+	CleanupStack::PopAndDestroy(&readStream);
+	
+	CleanupStack::PopAndDestroy(buffer);
+	
+	// Trigger a rescan, when rescan completes it will complete iNotifyOnScanCompleteMsg
+	iNotifyOnScanCompleteMsg=aMessage;
+	iServ.UpdateApps();
+	}
+	
+void CApaAppListServSession::AppForDocumentPassedByFileHandleL(const RMessage2& aMessage, const TUid* aServiceUid)
+	{
+#if defined(__PROFILE)
+	TProfile profile;
+	RDebug::ProfileReset(5,1);
+	RDebug::ProfileStart(5);
+#endif
+	RFile file;
+	CleanupClosePushL(file);
+	User::LeaveIfError(file.AdoptFromClient(aMessage, 2, 3));
+	SReturnData_AppForDocument returnData;
+	returnData.iDataType=iServ.RecognizeDataL(file, PreferredBufSize()).iDataType;
+	returnData.iUid=(returnData.iDataType!=TDataType())? AppForDataTypeL(returnData.iDataType, aServiceUid): TUid::Null();
+	CleanupStack::PopAndDestroy(&file);
+	aMessage.WriteL(0,TPckgC<SReturnData_AppForDocument>(returnData));
+#if defined(__PROFILE)
+	RDebug::ProfileEnd(5);
+	RDebug::ProfileResult(&profile,5,1);
+	RDebug::Print(KProfileAppForDocumentPassedByFileHandleL,profile.iTime/1000000,profile.iTime%1000000);
+	RDebug::ProfileStart(5);
+#endif
+	}
+
+void CApaAppListServSession::AppForDocumentL(const RMessage2& aMessage, const TUid* aServiceUid)
+	{
+#if defined(__PROFILE)
+	TProfile profile;
+	RDebug::ProfileReset(5,1);
+	RDebug::ProfileStart(5);
+#endif
+	HBufC* const fileName=HBufC::NewLC(User::LeaveIfError(aMessage.GetDesLength(2)));
+	{TPtr fileName_asWritable(fileName->Des());
+	aMessage.ReadL(2,fileName_asWritable);}
+	HBufC8* const buffer=HBufC8::NewLC(User::LeaveIfError(aMessage.GetDesLength(3)));
+	{TPtr8 buffer_asWritable(buffer->Des());
+	aMessage.ReadL(3,buffer_asWritable);}
+	SReturnData_AppForDocument returnData;
+	returnData.iDataType=iServ.RecognizeDataL(*fileName, *buffer).iDataType;
+	returnData.iUid=(returnData.iDataType!=TDataType())? AppForDataTypeL(returnData.iDataType, aServiceUid): TUid::Null();
+#if defined(__PROFILE)
+	RDebug::ProfileEnd(5);
+	RDebug::ProfileResult(&profile,5,1);
+	RDebug::Print(KProfileAppForDocumentL,profile.iTime/1000000,profile.iTime%1000000);
+	RDebug::ProfileStart(5);
+#endif
+	CleanupStack::PopAndDestroy(2, fileName);
+	aMessage.WriteL(0,TPckgC<SReturnData_AppForDocument>(returnData));
+	}
+
+void CApaAppListServSession::GetConfidenceL(const RMessage2& aMessage)
+// void GetAcceptedConfidence(TInt& aConfidence);
+	{
+	aMessage.WriteL(0,TPckgBuf<TInt>(iServ.DataRecognizer()->AcceptedConfidence()));
+	}
+
+void CApaAppListServSession::SetConfidence(const RMessage2& aMessage)
+// SetAcceptedConfidence(TInt aConfidence);
+	{
+	__ASSERT_DEBUG(iServ.DataRecognizer(), Panic(EPanicNullPointer));
+	iServ.DataRecognizer()->SetAcceptedConfidence(aMessage.Int0());
+	}
+
+void CApaAppListServSession::GetBufSize(const RMessage2& aMessage)
+// GetMaxDataBufSize(TInt& aBufSize);
+	{
+	aMessage.Complete(iMaxBufSize);
+	}
+
+void CApaAppListServSession::SetBufSize(const RMessage2& aMessage)
+// SetMaxDataBufSize(TInt aBufSize);
+	{
+	iMaxBufSize=aMessage.Int0();
+	}
+
+void CApaAppListServSession::GetDataTypesCountL(const RMessage2& aMessage)
+	{
+	delete iBuffer;
+	iBuffer=NULL;
+	CDataTypeArray* const dataTypes=new(ELeave) CDataTypeArray(5);
+	CleanupStack::PushL(dataTypes);
+	iServ.DataTypeL(*dataTypes);
+	TInt completionCode=0; // not KErrNone, as completion code of zero tells the client that zero data types were found
+	if (dataTypes->Count()>0)
+		{
+		CBufBase* const buffer=CBufFlat::NewL(sizeof(TDataType)); 
+		CleanupStack::PushL(buffer); 
+		RBufWriteStream writeStream(*buffer); 
+		writeStream<<*dataTypes; 
+		CleanupStack::Pop(buffer); 
+		iBuffer=buffer;
+		completionCode=iBuffer->Ptr(0).Size(); // number of bytes in buffer (not number of data types)
+		}
+	CleanupStack::PopAndDestroy(dataTypes);
+	aMessage.Complete(completionCode);
+	}
+
+void CApaAppListServSession::GetDataTypesL(const RMessage2& aMessage)
+// GetSupportedDataTypes(CDataTypeArray& aDataTypes);
+	{
+	if(iBuffer==NULL)
+		{
+		aMessage.Panic(KApaPanicCli,ENoSupportedDataTypes);
+		}
+	else
+		{
+		aMessage.WriteL(0,iBuffer->Ptr(0));
+		delete iBuffer;
+		iBuffer=NULL;
+		}
+	}
+
+CApaAppData& CApaAppListServSession::FindAppInListL(TUid aUid)
+	{
+	TApaAppEntry dummy;
+	CApaAppData* app=NULL;
+	if (!FindAppInList(app, dummy, aUid))
+		{
+		User::Leave(KErrNotFound);
+		}
+	return *app;
+	}
+
+void CApaAppListServSession::SendArrayL(const MArrayItemWriter& aArrayItemWriter,const RMessage2& aMessage) const
+	{
+	const TInt sizeOfBuffer=aMessage.Int1();
+	const TInt arrayItemCount=aArrayItemWriter.ArrayItemCount();
+	const TInt sizeRequired=sizeof(TInt)+(arrayItemCount*aArrayItemWriter.ArrayItemSize());
+	__ASSERT_DEBUG(sizeRequired>0,User::Invariant());
+	if (sizeRequired>sizeOfBuffer)
+		{
+		User::Leave(sizeRequired); // causes aMessage to complete with sizeRequired
+		}
+	CBufFlat* const buf=CBufFlat::NewL(sizeRequired);
+	CleanupStack::PushL(buf);
+	buf->ExpandL(0,sizeRequired);
+	RBufWriteStream writeStream;
+	writeStream.Open(*buf);
+	writeStream.WriteUint32L(arrayItemCount);
+	for (TInt i=0; i<arrayItemCount; ++i)
+		{
+		aArrayItemWriter.WriteArrayItemL(writeStream,i);
+		}
+	writeStream.CommitL();
+	aMessage.WriteL(2,buf->Ptr(0));
+	CleanupStack::PopAndDestroy(buf);
+	}
+
+void CApaAppListServSession::AppIconSizesL(const RMessage2& aMessage)
+	{
+	const TUid uid=TUid::Uid(aMessage.Int0());
+	CApaAppData& app = FindAppInListL(uid);
+	if (app.NonMbmIconFile())
+		{
+		User::Leave(KErrNotSupported);
+		}
+		
+	CArrayFixFlat<TSize>* array = app.IconSizesL();
+	CleanupStack::PushL(array);
+	TSizeArrayItemWriter arrayItemWriter(*array);		
+	SendArrayL(arrayItemWriter, aMessage);
+	CleanupStack::PopAndDestroy(array);
+	}
+
+void CApaAppListServSession::AppViewsL(const RMessage2& aMessage)
+	{
+	const TUid uid=TUid::Uid(aMessage.Int0());
+	CApaAppData& app = FindAppInListL(uid);
+	TViewDataArrayItemWriter arrayItemWriter(*app.Views());
+	SendArrayL(arrayItemWriter,aMessage);
+	}
+
+void CApaAppListServSession::AppFileOwnershipInfoL(const RMessage2& aMessage)
+	{
+	const TUid uid=TUid::Uid(aMessage.Int0());
+	CApaAppData& app = FindAppInListL(uid);
+	TDesCArrayItemWriter arrayItemWriter(*app.OwnedFiles());
+	SendArrayL(arrayItemWriter,aMessage);
+	}
+
+void CApaAppListServSession::NumberOfOwnDefinedIconsL(const RMessage2& aMessage)
+	{
+	const TUid uid=TUid::Uid(aMessage.Int0());
+	TApaAppEntry entry;
+	CApaAppData* app=NULL;
+	if (!FindAppInList(app,entry,uid))
+		{
+		User::Leave(KErrNotFound);
+		}
+	if (app->NonMbmIconFile())
+		{
+		User::Leave(KErrNotSupported);
+		}
+	TInt count, defaultIconsUsed;
+	app->GetIconInfo(count, defaultIconsUsed);
+	if (defaultIconsUsed)
+		{
+		count=0;
+		}
+	TPckgC<TInt> pckg(count); 
+	aMessage.Write(1,pckg);
+	}
+	
+void CApaAppListServSession::ApplicationLanguageL(const RMessage2& aMessage)
+	{
+	const TUid appUid = TUid::Uid(aMessage.Int0());
+	TApaAppEntry appEntry;
+	CApaAppData* appData = NULL;
+	if (!FindAppInList(appData, appEntry, appUid))
+		{
+		User::Leave(KErrNotFound);
+		}
+	const TLanguage appLanguage = appData->ApplicationLanguage();
+	TPckgC<TLanguage> pckg(appLanguage); 
+	aMessage.Write(1,pckg);
+	}
+	
+
+void CApaAppListServSession::IconForViewBySizeL(const RMessage2& aMessage)
+	// Passes back handles to the icon and mask bitmaps for bitmap sharing 
+	{
+	TApaAppViewIconSizeData appViewIconSizeData;
+	{TPckg<TApaAppViewIconSizeData> appViewIconSizeData_asDescriptor(appViewIconSizeData);
+	aMessage.ReadL(0,appViewIconSizeData_asDescriptor);}
+	TApaAppEntry entry;
+	CApaAppData* app=NULL;
+	if (!FindAppInList(app,entry,appViewIconSizeData.iAppUid))
+		{
+		User::Leave(KErrNotFound);
+		}
+	ASSERT(app->Views());
+	const CArrayPtr<CApaAppViewData>& viewDataArray=*app->Views();
+	CApaMaskedBitmap* icon=NULL;
+	const TInt count=viewDataArray.Count();
+	for (TInt ii=0; ii<count; ii++)
+		{
+		const CApaAppViewData& appViewData=*viewDataArray[ii];
+		if (appViewData.Uid()==appViewIconSizeData.iViewUid)
+			{
+			if (appViewData.NonMbmIconFile())
+				{
+				User::Leave(KErrNotSupported);
+				}
+			icon=appViewData.Icon(appViewIconSizeData.iSize);
+			break;
+			}
+		}
+	if (icon==NULL)
+		{
+		User::Leave(KErrNotFound);
+		}
+	SReturnData_ViewIconByUidAndSize returnData;
+	returnData.iIcon=icon->Handle();
+	returnData.iIconMask=icon->Mask()->Handle();
+	aMessage.WriteL(1,TPckgC<SReturnData_ViewIconByUidAndSize>(returnData));
+	}
+
+void CApaAppListServSession::IconForAppBySizeL(const RMessage2& aMessage)
+	{
+	const TUid uid=TUid::Uid(aMessage.Int0());
+	const TSize size(aMessage.Int1(),aMessage.Int2());
+	TApaAppEntry entry;
+	CApaAppData* app=NULL;
+	if (!FindAppInList(app,entry,uid))
+		{
+		User::Leave(KErrNotFound);
+		}
+	if (app->NonMbmIconFile())
+		{
+		User::Leave(KErrNotSupported);
+		}
+	CApaMaskedBitmap* const icon=app->Icon(size);
+	if (icon==NULL)
+		{
+		User::Leave(KErrNotFound);
+		}
+	SReturnData_AppIconByUidAndSize returnData;
+	returnData.iIcon=icon->Handle();
+	returnData.iIconMask=icon->Mask()->Handle();
+	aMessage.WriteL(3,TPckgC<SReturnData_AppIconByUidAndSize>(returnData));
+
+	}
+
+void CApaAppListServSession::IconFileHandleForAppL(const RMessage2& aMessage)
+	{
+	const TUid uid=TUid::Uid(aMessage.Int0());
+	TApaAppEntry entry;
+	CApaAppData* app=NULL;
+	if (!FindAppInList(app,entry,uid))
+		{
+		User::Leave(KErrNotFound);
+		}
+	TPtrC iconFileName = app->IconFileName();
+	if (iconFileName.Length()==0)
+		{
+		User::Leave(KErrNotFound);
+		}
+	RFs fs;
+	User::LeaveIfError(fs.Connect());
+	CleanupClosePushL(fs);
+	User::LeaveIfError(fs.ShareProtected());
+	RFile file;
+	CleanupClosePushL(file);
+	User::LeaveIfError(file.Open(fs, iconFileName, EFileShareReadersOnly));
+	User::LeaveIfError(file.TransferToClient(aMessage, 1));
+	CleanupStack::PopAndDestroy(2, &fs); //file and fs
+	}
+
+void CApaAppListServSession::IconForAppL(const RMessage2& aMessage)
+// from GetAppIcon(TUid aAppUid, TInt aSideInPixels, CApaMaskedBitmap& aAppBitmap);
+// BUT!  It's interface is uid, side, icon handle, mask handle for bitmap sharing 
+// and avoiding IPC overhead
+	{
+	const TUid uid=TUid::Uid(aMessage.Int0());
+	const TInt side=aMessage.Int1();
+	TApaAppEntry entry;
+	CApaAppData* app=NULL;
+	if (!FindAppInList(app,entry,uid))
+		{
+		User::Leave(KErrNotFound);
+		}
+	if (app->NonMbmIconFile())
+		{
+		User::Leave(KErrNotSupported);
+		}
+	CApaMaskedBitmap* const icon=app->Icon(side);
+	if (icon==NULL)
+		{
+		User::Leave(KErrNotFound);
+		}
+	SReturnData_AppIconByUid returnData;
+	returnData.iIcon=icon->Handle();
+	returnData.iIconMask=icon->Mask()->Handle();
+	aMessage.WriteL(2,TPckgC<SReturnData_AppIconByUid>(returnData));
+	}
+
+void CApaAppListServSession::AppForDataTypeL(const RMessage2& aMessage)
+// from AppForDataType(const TDataType& aDataType, TUid& aAppUid);
+	{
+	if (sizeof(TDataType) != aMessage.GetDesLengthL(0))
+		{
+		//Leave with KErrArgument if client passes other than TDataType
+		User::Leave(KErrArgument);
+		}
+	TDataType dataType;
+	{TPckg<TDataType> dataType_asDescriptor(dataType);
+	aMessage.ReadL(0,dataType_asDescriptor);}
+	TPckgBuf<TUid> uid_asDescriptor(AppForDataTypeL(dataType, NULL));
+	aMessage.WriteL(1,uid_asDescriptor);
+	aMessage.Complete(KErrNone);
+	}
+
+void CApaAppListServSession::AppForDataTypeAndServiceL(const RMessage2& aMessage)
+	{
+	TDataType dataType;
+	{TPckg<TDataType> dataType_asDescriptor(dataType);
+	aMessage.ReadL(0,dataType_asDescriptor);}
+	const TUid serviceUid=TUid::Uid(aMessage.Int1());
+	TPckgBuf<TUid> uid(AppForDataTypeL(dataType, &serviceUid));
+	aMessage.WriteL(2,uid);
+	aMessage.Complete(KErrNone);
+	}
+
+TUid CApaAppListServSession::AppForDataTypeL(const TDataType& aDataType, const TUid* aServiceUid)
+	{
+	// It is possible to register apps as datatype handlers with system priority,
+	// which means that they are not overridable by user mappings.
+	// So search the list of apps for a datahandler and get the associated
+	// priority
+	TUid uid;
+	TInt priority;
+	uid=AppList().PreferredDataHandlerL(aDataType, aServiceUid, priority);
+	if (priority == KDataTypePrioritySystem)
+		{
+		// We have found a handler with system priority
+		return uid;
+		}
+		
+	// No handler with system priority so see if there is a user mapping
+	TUid userUid = KNullUid;
+	if (aServiceUid)
+		{
+		iServ.GetAppByDataType(aDataType,*aServiceUid,userUid);
+		}
+	else
+		{
+		iServ.GetAppByDataType(aDataType,userUid);
+		}
+	TApaAppEntry entry;
+	CApaAppData* app=NULL;
+	if ((userUid.iUid!=0) && FindAppInList(app,entry,userUid))
+		{
+		// The user mapping is valid
+		return userUid;
+		}
+		
+	// A user mapping was not found or is invalid so try to use
+	// the uid returned by PreferredDataHandlerL.
+	if (uid.iUid==0 && aDataType.IsNative())
+		{
+		uid=aDataType.Uid();
+		}
+	return uid;
+	}
+
+void CApaAppListServSession::InsertDataMappingL(const RMessage2& aMessage)
+	{
+	TPckgBuf<TDataType> dataType;
+	aMessage.ReadL(0, dataType);
+	TDataTypePriority priority = aMessage.Int1();
+	const TUid appUid = { aMessage.Int2() };
+
+	if(priority>KDataTypeUnTrustedPriorityThreshold || priority == KDataTypePrioritySystem ) 
+	   {   
+	   CApaAppData* appData = AppList().AppDataByUid(appUid);
+	   if( appData )	
+		  {
+          TBool hasWriteDeviceDataCap( EFalse );
+          TBool isSidTrusted( EFalse );
+          
+          CApaSecurityUtils::CheckAppSecurity( appData->AppEntry().iFullName, 
+                                               hasWriteDeviceDataCap,
+                                               isSidTrusted);
+          
+          if (priority == KDataTypePrioritySystem )
+              {
+              // Check if the app has capability WriteDeviceData
+              if ( !hasWriteDeviceDataCap )
+                  {
+                  priority = KDataTypePriorityNormal;
+                  }
+              }
+          else
+              {
+              TPtrC registrationFilePath = appData->RegistrationFileName ( );
+              TInt match = registrationFilePath.MatchF (
+                                          KLitPathForUntrustedRegistrationResourceFiles );
+              //Check if registration file is in path for untrusted apps 
+              //and its SID is untrusted
+              if (match != KErrNotFound && !isSidTrusted )
+                  {
+                  // "cap" the priority if UnTrusted apps claim for priority higher 
+                  // than UnTrusted apps Threshold priority
+                  priority = KDataTypeUnTrustedPriorityThreshold;
+                  }
+              }
+          }
+	   else
+		  {
+              //if the application is not present in the applist 
+              //then the priority will be reduced to Threshold
+              priority = KDataTypeUnTrustedPriorityThreshold;
+		  }
+	   }
+	const TUid serviceUid = { aMessage.Int3() };
+	if(aMessage.Function() == EAppListInsertDataMappingIfHigher)
+		{
+		const TBool response = iServ.InsertAndStoreIfHigherL(dataType(), priority, appUid);
+		aMessage.WriteL(3, TPckgC<TBool>(response));
+
+		}
+	else
+		{
+		iServ.InsertAndStoreDataMappingL(dataType(), priority, appUid, serviceUid);
+		}
+	}
+
+void CApaAppListServSession::DeleteDataMappingL(const RMessage2& aMessage)
+	{
+	TPckgBuf<TDataType> dataType;
+	aMessage.ReadL(0, dataType);
+	const TUid serviceUid = { aMessage.Int1() };
+	TUid uid;
+	iServ.GetAppByDataType(dataType(),serviceUid,uid);
+	if (uid != KNullUid)
+		{
+		// TypeStore doesn't support deletion of an inexistent mapping
+		iServ.DeleteAndStoreDataMappingL(dataType(), serviceUid);
+		aMessage.Complete(KErrNone);
+		}
+	else
+		{
+		aMessage.Complete(KErrNotFound);
+		}
+	}
+	
+void CApaAppListServSession::GetAppByDataTypeL(const RMessage2& aMessage) const
+	{
+	TPckgBuf<TDataType> dataType;
+	aMessage.ReadL(0,dataType);
+	const TUid serviceUid = { aMessage.Int1() };
+	TUid uid;
+	iServ.GetAppByDataType(dataType(),serviceUid,uid);
+	TPckgC<TUid> uidpckg(uid);
+	aMessage.WriteL(2,uidpckg);
+	aMessage.Complete(KErrNone);
+	}
+
+void CApaAppListServSession::StartDocumentL(const RMessage2& aMessage,TAppListDocumentStart aStartType)
+// from StartDocument(const TDesC& aFileName, TThreadId& aId, TLaunchType aLaunchType);
+// from StartDocument(const TDesC& aFileName, const TDataType& aDataType, TThreadId& aId, TLaunchType aLaunchType);
+// from StartDocument(const TDesC& aFileName, TUid aAppUid, TThreadId& aId, TLaunchType aLaunchType);
+// from CreateDocument(const TDesC& aFileName, TUid aAppUid, TThreadId& aId, TLaunchType aLaunchType);
+// This method needs to open the file, mime type it then launch it.
+	{
+	HBufC* const fileName=HBufC::NewLC(User::LeaveIfError(aMessage.GetDesLength(1)));
+	{TPtr fileName_asWritable(fileName->Des());
+	aMessage.ReadL(1,fileName_asWritable);}
+
+	TUid uid;
+	if ((aStartType==EStartByUid) || (aStartType==ECreateByUid))
+		{
+		uid.iUid=aMessage.Int2();
+		}
+	else
+		{
+		TDataType* const dataType=new(ELeave) TDataType();
+		CleanupStack::PushL(dataType);
+		if (aStartType==EStart)
+			{
+			HBufC8* const buffer=HBufC8::NewLC(User::LeaveIfError(aMessage.GetDesLength(2)));
+			{TPtr8 buffer_asWritable(buffer->Des());
+			aMessage.ReadL(2,buffer_asWritable);}
+			*dataType=iServ.RecognizeDataL(*fileName, *buffer).iDataType;
+			CleanupStack::PopAndDestroy(buffer);
+			}
+		else
+			{
+			__ASSERT_DEBUG(aStartType==EStartByDataType,User::Invariant());
+			TPckg<TDataType> dataType_asDescriptor(*dataType);
+			aMessage.ReadL(2,dataType_asDescriptor);
+			}
+		uid=AppForDataTypeL(*dataType, NULL);
+		CleanupStack::PopAndDestroy(dataType);
+		}
+	const TThreadId threadId=StartDocumentL(*fileName,uid,(aStartType==ECreateByUid)? EApaCommandCreate: EApaCommandOpen);
+	CleanupStack::PopAndDestroy(fileName);
+	aMessage.WriteL(0, TPckgC<TThreadId>(threadId));
+	}
+
+TThreadId CApaAppListServSession::StartDocumentL(const TDesC& aFileName, TUid aUid, TApaCommand aCommand)
+// Launch the document of aFileName with the app with Uid aUid
+	{
+	CApaAppData* app=NULL;
+	CApaFileRecognizerType* type=NULL;
+	TApaAppEntry entry;
+	const TBool findApp=FindAppInList(app,entry,aUid);
+	if (findApp)
+	    {
+	    if (app->RegistrationFileUsed())
+			{
+			TApaAppCapabilityBuf buf;
+			app->Capability(buf);
+	 		if (((buf().iEmbeddability == TApaAppCapability::EEmbeddableOnly) || (buf().iEmbeddability == TApaAppCapability::EEmbeddableUiNotStandAlone)) && !(buf().iAttributes & TApaAppCapability::EBuiltAsDll))
+	              {
+				   User::Leave(KErrNotSupported);		
+                  }
+	 		}
+	    }
+
+	if (!findApp || aUid.iUid==0)
+		{
+		// if we can't bind the type from the Mime type stuff then use the old scheme
+		TRAP_IGNORE(type=FileRecognizer()->RecognizeFileL(aFileName));
+		}
+	else
+		{
+		if (findApp)
+			{
+			TRAP_IGNORE(type=FileRecognizer()->RecognizeFileL(entry.iFullName));
+			}
+		}
+	if (!type)
+		{
+		User::Leave(KErrNotFound);
+		}
+	if (aFileName.Length()==0)
+		{
+		return type->RunL(EApaCommandRun,NULL,NULL);
+		}
+	return type->RunL(aCommand,&aFileName,NULL);
+	}
+
+void CApaAppListServSession::GetExecutableNameGivenDocumentL(const RMessage2& aMessage)
+	{
+	HBufC* const name=HBufC::NewLC(User::LeaveIfError(aMessage.GetDesLength(2)));
+	{TPtr name_asWritable(name->Des());
+	aMessage.ReadL(2, name_asWritable);}
+	HBufC8* const buffer=HBufC8::NewLC(User::LeaveIfError(aMessage.GetDesLength(3)));
+	{TPtr8 buffer_asWritable(buffer->Des());
+	aMessage.ReadL(3, buffer_asWritable);}
+	const TDataType dataType(iServ.RecognizeDataL(*name, *buffer).iDataType);
+	CleanupStack::PopAndDestroy(2, name);
+
+	const TUid appUid(AppForDataTypeL(dataType, NULL));
+	GetExecutableNameL(aMessage, appUid);
+	}
+
+void CApaAppListServSession::GetExecutableNameGivenDocumentPassedByFileHandleL(const RMessage2& aMessage)
+	{
+	RFile file;
+	CleanupClosePushL(file);
+	User::LeaveIfError(file.AdoptFromClient(aMessage, 2, 3));
+	const TDataType dataType(iServ.RecognizeDataL(file, PreferredBufSize()).iDataType);
+	CleanupStack::PopAndDestroy(&file);
+
+	const TUid appUid(AppForDataTypeL(dataType, NULL));
+	GetExecutableNameL(aMessage, appUid);
+	}
+
+void CApaAppListServSession::GetExecutableNameGivenDataTypeL(const RMessage2& aMessage)
+	{
+	if (sizeof(TDataType) != aMessage.GetDesLengthL(2))
+		{
+		//Leave with KErrArgument if client passes other than TDataType
+		User::Leave(KErrArgument);
+		}
+	TDataType dataType;
+	{TPckg<TDataType> dataType_asDescriptor(dataType);
+	aMessage.ReadL(2, dataType_asDescriptor);}
+	const TUid appUid(AppForDataTypeL(dataType, NULL));
+	GetExecutableNameL(aMessage, appUid);
+	}
+
+void CApaAppListServSession::GetExecutableNameGivenAppUidL(const RMessage2& aMessage)
+	{
+	const TUid appUid(TUid::Uid(aMessage.Int2()));
+	GetExecutableNameL(aMessage, appUid);
+	}
+
+void CApaAppListServSession::GetExecutableNameL(const RMessage2& aMessage, TUid aAppUid)
+	{
+	CApaAppData* appData=NULL;
+	TApaAppEntry entry;
+	if (!FindAppInList(appData, entry, aAppUid))
+		{
+		User::Leave(AppList().IsFirstScanComplete() ?
+					KErrNotFound : RApaLsSession::EAppListInvalid);
+		}
+	const TDesC& executableName(entry.iFullName);
+	if (executableName.Length() == 0)
+		{
+		User::Leave(KErrNotFound);
+		}
+	aMessage.WriteL(1, executableName); // the "logical" executable name - for non-native applications this is the name of the MIDlet, Python script, etc
+	WriteNativeExecutableIfNonNativeAndPrepareForClientRetrievalOfOpaqueDataL(aMessage, 0, *appData);
+	}
+
+void CApaAppListServSession::GetNativeExecutableNameIfNonNativeL(const RMessage2& aMessage)
+	{
+	RBuf logicalExecutableName;
+	logicalExecutableName.CreateL(User::LeaveIfError(aMessage.GetDesLength(1)));
+	CleanupClosePushL(logicalExecutableName);
+	aMessage.ReadL(1, logicalExecutableName);
+	CApaAppData* const appData=AppList().AppDataByFileName(logicalExecutableName);
+	if (appData!=NULL)
+		{
+		WriteNativeExecutableIfNonNativeAndPrepareForClientRetrievalOfOpaqueDataL(aMessage, 0, *appData);
+		}
+	CleanupStack::PopAndDestroy(&logicalExecutableName);
+	}
+
+void CApaAppListServSession::WriteNativeExecutableIfNonNativeAndPrepareForClientRetrievalOfOpaqueDataL(const RMessage2& aMessage, TInt aMessageSlotForNativeExecutable, const CApaAppData& aAppData)
+	{
+	HBufC8* opaqueData=NULL;
+	const TPtrC8 opaqueData_asTPtrC8(aAppData.OpaqueData());
+	const TInt lengthOfOpaqueData(opaqueData_asTPtrC8.Length());
+	if (lengthOfOpaqueData>0)
+		{
+		opaqueData=opaqueData_asTPtrC8.AllocLC();
+		}
+	const TUid nonNativeApplicationType(aAppData.NonNativeApplicationType());
+	if (nonNativeApplicationType!=TUid::Null())
+		{
+		aMessage.WriteL(aMessageSlotForNativeExecutable, iServ.NativeExecutableL(nonNativeApplicationType));
+		}
+	delete iOpaqueData_pendingDispatchToClient; // only done when the potentially leaving stuff has all succeeded
+	iOpaqueData_pendingDispatchToClient=opaqueData; // want to do this, even if opaqueData is NULL
+	if (opaqueData!=NULL)
+		{
+		CleanupStack::Pop(opaqueData);
+		aMessage.Complete(lengthOfOpaqueData);
+		}
+	}
+
+void CApaAppListServSession::GetOpaqueDataL(const RMessage2& aMessage)
+	{
+	if (iOpaqueData_pendingDispatchToClient==NULL)
+		{
+		User::Leave(KErrGeneral); // the protocol was broken: EAppListServGetOpaqueData can only be called immediately after one of the EAppListServGetExecutableNameGivenXxx or EAppListServGetNativeExecutableNameGivenXxx opcodes - see the client-side implementation of this protocol in RApaLsSession::GetOpaqueData (and the places that call it)
+		}
+	aMessage.WriteL(0, *iOpaqueData_pendingDispatchToClient);
+	delete iOpaqueData_pendingDispatchToClient;
+	iOpaqueData_pendingDispatchToClient=NULL;
+	}
+
+void CApaAppListServSession::GetAppInfoL(TUid aUid, TApaAppInfo& aInfo)
+	{
+	CApaAppData* app=NULL;
+	TApaAppEntry entry;
+	if (!FindAppInList(app,entry,aUid))
+		{
+		User::Leave(KErrNotFound);
+		}
+	aInfo.iUid = entry.iUidType[2];
+	aInfo.iFullName = entry.iFullName;
+	aInfo.iCaption = app->Caption();
+	aInfo.iShortCaption = app->ShortCaption();
+	}
+	
+void CApaAppListServSession::DoRecognizeUnpackLC(HBufC*& aName, HBufC8*& aBuffer, const RMessage2& aMessage)
+	{
+	__ASSERT_DEBUG(aName==NULL,User::Invariant());
+	__ASSERT_DEBUG(aBuffer==NULL,User::Invariant());
+	aName=HBufC::NewLC(User::LeaveIfError(aMessage.GetDesLength(1)));
+	TPtr name(aName->Des());
+	aMessage.ReadL(1, name);
+	aBuffer=HBufC8::NewLC(User::LeaveIfError(aMessage.GetDesLength(2)));
+	TPtr8 buffer(aBuffer->Des());
+	aMessage.ReadL(2, buffer);
+	}
+
+void CApaAppListServSession::RecognizeDataL(const RMessage2& aMessage)
+// Recognize the data type of an object
+	{
+	HBufC* name=NULL;
+	HBufC8* buffer=NULL;
+	DoRecognizeUnpackLC(name,buffer,aMessage);
+
+	const TDataRecognitionResult result = iServ.RecognizeDataL(*name, *buffer);
+
+	CleanupStack::PopAndDestroy(2); // name & buffer
+	aMessage.WriteL(0,TPckgC<TDataRecognitionResult>(result));
+	}
+
+
+void CApaAppListServSession::RecognizeFilesL(const RMessage2& aMessage)
+	{
+	// if there is an outstanding async. request, we even don't allow 
+	// a synchronous request at the same time (due to the two required
+	// server messages)
+	if (iAsyncRecognitionActive)
+		{
+		User::Leave(KErrInUse);
+		}
+
+	_LIT8(KAllDataTypes,"*");
+
+	// retrieve pathname
+	HBufC* const path=HBufC::NewLC(User::LeaveIfError(aMessage.GetDesLength(0)));
+	TPtr pathPtr(path->Des());
+	aMessage.ReadL(0,pathPtr);
+
+	// retrieve data type filter
+	HBufC8* const dataType = HBufC8::NewLC(User::LeaveIfError(aMessage.GetDesLength(2)));
+	TPtr8 dataTypePtr(dataType->Des());
+	aMessage.ReadL(2,dataTypePtr);
+
+	delete iRecognitionResult;
+	iRecognitionResult = NULL;
+
+	if(dataType->Compare(KAllDataTypes) == 0)
+		{
+		iRecognitionResult = new (ELeave) CDirectoryRecognitionResult(path, NULL);
+		CleanupStack::PopAndDestroy(dataType);
+		}
+	else
+		{
+		iRecognitionResult = new (ELeave) CDirectoryRecognitionResult(path,dataType);	
+		CleanupStack::Pop(dataType);
+		}
+
+	CleanupStack::Pop(path);		// ownership transferred to CDirectoryRecognitionResult
+	ASSERT(iFileRecognitionUtility);
+	iFileRecognitionUtility->RecognizeSynchronouslyL(*iRecognitionResult);
+	aMessage.WriteL(1,TPckgBuf<TUint>(iRecognitionResult->RequiredBufferSize()));
+	}
+
+void CApaAppListServSession::TransferRecognitionResultL(const RMessage2& aMessage)
+	{
+	if(iRecognitionResult == NULL)
+		User::Leave(KErrNotReady);
+
+	iAsyncRecognitionActive = EFalse;
+
+	// if data is too big for buffer, tell client
+	const TInt sizeOfBuffer=aMessage.Int2();	
+	if(sizeOfBuffer < iRecognitionResult->RequiredBufferSize())
+		User::Leave(KErrTooBig);
+
+	// buffer is big enough -> write result to buffer
+	CBufFlat* const buf=CBufFlat::NewL(iRecognitionResult->RequiredBufferSize());
+	CleanupStack::PushL(buf);
+	buf->ExpandL(0,iRecognitionResult->RequiredBufferSize());
+
+	RBufWriteStream writeStream;
+	writeStream.Open(*buf);
+	iRecognitionResult->WriteToStreamL(writeStream);
+	aMessage.WriteL(1,buf->Ptr(0));
+
+	delete iRecognitionResult;
+	iRecognitionResult = NULL;
+
+	CleanupStack::PopAndDestroy(buf);
+	}
+
+void CApaAppListServSession::RecognizeFilesAsyncL(const RMessage2& aMessage)
+	{
+	if (iAsyncRecognitionActive)
+		{
+		User::Leave(KErrInUse);
+		}
+	else
+		{
+		_LIT8(KAllDataTypes,"*");
+
+		HBufC* path=HBufC::NewLC(User::LeaveIfError(aMessage.GetDesLength(0)));
+		TPtr pathPtr(path->Des());
+		aMessage.ReadL(0,pathPtr);
+
+		// retrieve data type filter
+		HBufC8* dataType = 0;
+		dataType=HBufC8::NewLC(User::LeaveIfError(aMessage.GetDesLength(2)));
+		TPtr8 dataTypePtr(dataType->Des());
+		aMessage.ReadL(2,dataTypePtr);
+
+		delete iRecognitionResult;
+		iRecognitionResult = NULL;
+
+		if(dataType->Compare(KAllDataTypes) == 0)
+			{
+			iRecognitionResult = new (ELeave) CDirectoryRecognitionResult(path,NULL);
+			CleanupStack::PopAndDestroy(dataType);
+			}
+		else
+			{
+			iRecognitionResult = new (ELeave) CDirectoryRecognitionResult(path,dataType);
+			CleanupStack::Pop(dataType);
+			}
+
+		CleanupStack::Pop(path);	// ownership transferred to CDirectoryRecognitionResult
+		ASSERT(iFileRecognitionUtility);
+		iFileRecognitionUtility->RecognizeAsynchronously(*iRecognitionResult,aMessage);
+		iAsyncRecognitionActive = ETrue;
+		}
+	}
+
+/** The function interrogates all available rule based plug-ins if apparc can launch application with 
+given full name. It loops through all plug-ins until gets value different from 
+CAppLaunchChecker::EAppLaunchIndifferent. 
+The application will be launched if the return code is not equal to
+CAppLaunchChecker::EAppLaunchDecline 
+*/
+void CApaAppListServSession::RuleBasedLaunchingL(const RMessage2& aMessage)
+	{
+	CApaScanningRuleBasedPlugIns* theRuleBasedPlugIns = iServ.RuleBasedPlugIns();
+	if(!theRuleBasedPlugIns)
+		{
+		//we proceed with launching even if rule based plug-ins framework was not initialized
+		aMessage.Complete(ETrue);
+		return;
+		}
+
+	HBufC* theFullFileName=HBufC::NewLC(User::LeaveIfError(aMessage.GetDesLength(0)));
+	TPtr theFullFileNamePtr(theFullFileName->Des());
+	aMessage.ReadL(0, theFullFileNamePtr);
+	TUid theUid = AppUidFromFullFileNameL(theFullFileNamePtr);
+	CleanupStack::PopAndDestroy(theFullFileName); 
+
+	CAppLaunchChecker::TAppLaunchCode theLaunchCode = CAppLaunchChecker::EAppLaunchIndifferent;	
+	TInt theNumImp = theRuleBasedPlugIns->ImplementationCount();
+
+	TApaTaskList theTaskList(iServ.WsSession());
+	for(TInt ii = 0; ii < theNumImp; ii++)
+		{
+		CAppLaunchChecker* theLauncherChecker = (*theRuleBasedPlugIns)[ii];
+		TRAP_IGNORE((theLaunchCode = theLauncherChecker->OkayToLaunchL(theUid, theTaskList)));
+		if(theLaunchCode > CAppLaunchChecker::EAppLaunchIndifferent)
+			break;
+		}
+	//writing the result
+	TBool okayToLaunch = theLaunchCode != CAppLaunchChecker::EAppLaunchDecline;
+	aMessage.Complete(okayToLaunch);
+	}
+
+/** 
+@param aFullFileName This filename is parsed and the path is replaced with "\\sys\\bin\\". 
+		And uses ".exe" if no other is provided in the filename passed.  If drive name is 
+		present in the filename then it scans through the \\sys\\bin of that particular drive,
+		otherwise it scans through the \\sys\\bin folders in all the avaliable drives.
+@return Returns the Application Uid for the aFullFileName application.
+*/
+TUid CApaAppListServSession::AppUidFromFullFileNameL(const TDesC& aFullFileName) const
+	{
+	_LIT(KSysBin, "\\sys\\bin\\");
+	_LIT(KFileExtension, ".EXE");
+	
+	RLoader loader;
+	User::LeaveIfError(loader.Connect());
+	CleanupClosePushL(loader);
+	TPckgBuf<RLibrary::TInfo> dllInfo;
+	TInt error = KErrNotFound;
+
+	TParse parse;
+	parse.Set(aFullFileName,NULL,NULL);
+	if (parse.DrivePresent())
+		{
+		const TPtrC appDrive = parse.Drive();
+		TBuf<KMaxFileName>fileName(appDrive);
+		fileName.Append(KSysBin);
+		User::LeaveIfError(parse.SetNoWild(fileName, &aFullFileName, &KFileExtension));
+		error = loader.GetInfo(parse.FullName(), dllInfo);
+		}
+	else
+		{
+		// scan all drives
+		User::LeaveIfError(parse.SetNoWild(KSysBin, &aFullFileName, &KFileExtension)); 
+		TFileName tempFileName(parse.FullName());
+		TDriveList driveList;
+		User::LeaveIfError(iFs.DriveList(driveList));
+		for (TInt driveNumber = EDriveY; driveNumber != KFinishedScanning; driveNumber = NextDriveToScan(driveNumber))
+			{
+			if (driveList[driveNumber]!=0)
+				{
+				User::LeaveIfError(parse.SetNoWild(TDriveUnit(driveNumber).Name(), &tempFileName, NULL));
+				error = loader.GetInfo(parse.FullName(), dllInfo);
+				if (error == KErrNone)
+					{
+					break;
+					}
+				}
+			}
+		}
+	CleanupStack::PopAndDestroy(&loader);
+	if (error == KErrNone)
+		{
+		return dllInfo().iUids[2];
+		}
+
+	//we can't use RFs::Entry if path refers to a system directory i.e. \\sys\\bin
+	User::LeaveIfError(parse.SetNoWild(aFullFileName, NULL, NULL));
+	if(parse.Path().FindF(KSysBin) == 0)
+		{
+		User::Leave(KErrNotFound);
+		}
+	
+	//the following valid for non-native applications
+	TEntry entry;
+	error = iFs.Entry(aFullFileName, entry);
+	if (error != KErrNone)
+		{
+		// Since we cannot get the Uid of NonNative apps by passing filename to RFs::Entry
+		CApaAppData* appData = AppList().AppDataByFileName(aFullFileName);
+		if (appData)
+			{
+			TApaAppEntry appEntry = appData->AppEntry();
+			return appEntry.iUidType[2];
+			}
+		User::Leave(KErrNotFound);
+		}
+			
+	return entry.iType[2];
+	}
+
+TInt CApaAppListServSession::NextDriveToScan(TInt aCurrentDrive)
+// applies the scanning order y:->a: then z:
+	{
+	if (aCurrentDrive == EDriveZ)
+		{
+		return KFinishedScanning;
+		}
+	else if (aCurrentDrive == 0)
+		{
+		return EDriveZ; // finally scan the last one
+		}
+	else if (aCurrentDrive > 0 && aCurrentDrive < KMaxDrives)
+		{
+		return aCurrentDrive - 1;
+		}
+	else
+		{
+		return KErrGeneral; // never gets here, but it wont compile otherwise
+		}
+	}
+
+void CApaAppListServSession::CancelRecognizeFiles()
+	{
+	if (iAsyncRecognitionActive)
+		{
+		ASSERT(iFileRecognitionUtility);
+		iFileRecognitionUtility->CancelRecognitionRequest();
+		iAsyncRecognitionActive = EFalse;
+		}
+	}
+
+void CApaAppListServSession::RecognizeDataPassedByFileHandleL(const RMessage2& aMessage)
+// Recognize the data type of an object
+	{
+	RFile file;
+	CleanupClosePushL(file);
+	User::LeaveIfError(file.AdoptFromClient(aMessage, 1, 2));
+	const TDataRecognitionResult result(iServ.RecognizeDataL(file, PreferredBufSize()));
+	CleanupStack::PopAndDestroy(&file);
+	aMessage.WriteL(0, TPckgC<TDataRecognitionResult>(result));
+	}
+	
+void CApaAppListServSession::RecognizeSpecificDataL(const RMessage2& aMessage)
+// Determine whether an object is of a specific data type
+	{
+	HBufC* name=NULL;
+	HBufC8* buffer=NULL;
+	DoRecognizeUnpackLC(name,buffer,aMessage);
+	TDataType dataType;
+	{TPckg<TDataType> dataType_asDescriptor(dataType);
+	aMessage.ReadL(0, dataType_asDescriptor);}
+	aMessage.Complete(iServ.RecognizeDataL(*name,*buffer,dataType));
+	CleanupStack::PopAndDestroy(2); // name & buffer
+	}
+
+void CApaAppListServSession::RecognizeSpecificDataPassedByFileHandleL(const RMessage2& aMessage)
+	{
+	RFile file;
+	CleanupClosePushL(file);
+	User::LeaveIfError(file.AdoptFromClient(aMessage, 1, 2));
+	TDataType dataType;
+	{TPckg<TDataType> dataType_asDescriptor(dataType);
+	aMessage.ReadL(0,dataType_asDescriptor);}
+	aMessage.Complete(iServ.RecognizeDataL(file, PreferredBufSize(), dataType));
+	CleanupStack::PopAndDestroy(&file);
+	}
+
+void CApaAppListServSession::InitListL(const RMessage2& aMessage, TAppListType aType)
+// carries out initialisation prior to starting to pass a new list across
+	{
+	iAppListType = aType;
+	iAppListScreenMode = aMessage.Int0();
+	if (aType == EListFilteredEmbeddedApps)
+		{
+		TApaEmbeddabilityFilter filter;
+		{TPckg<TApaEmbeddabilityFilter> filter_asDescriptor(filter);
+		aMessage.ReadL(1,filter_asDescriptor);}
+		iEmbeddabilityFilter = filter;
+		}
+	if (aType == EListCapabilityAttrFilteredApps)
+		{
+		iCapabilityAttrFilterMask = aMessage.Int1();
+		iCapabilityAttrFilterValue = aMessage.Int2();
+		}
+	if (aType == EListServerApps)
+		{
+		iServiceUid = TUid::Uid(aMessage.Int1());
+		}
+	iApaAppInfoArray.ResetAndDestroy();
+	iFlags|=EAppListPopulationPending;
+	}
+
+void CApaAppListServSession::EmbedCount(const RMessage2& aMessage) const
+// writes back the number of embedded apps in the list
+	{
+	TInt count=0;
+	const CApaAppList& list=AppList();
+	CApaAppData* app = list.FirstApp();
+	TApaEmbeddabilityFilter filter;
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddable);
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddableOnly);
+	while (app)
+		{
+		if (!AppIsControlPanelItem(*app) && AppMatchesEmbeddabilityFilter(*app, filter))
+			{
+			count++;
+			}
+		app = list.NextApp(app);
+		}
+	aMessage.Complete(count);
+	}
+
+void CApaAppListServSession::AppCount(const RMessage2& aMessage) const
+// writes back the number of apps in the list
+	{
+	TInt count=0;
+	const CApaAppList& list=AppList();
+	CApaAppData* app = list.FirstApp();
+	while (app)
+		{
+		if (!AppIsControlPanelItem(*app))
+			{
+			count++;
+			}
+		app = list.NextApp(app);
+		}
+	aMessage.Complete(count);
+	}
+
+void CApaAppListServSession::GetNextAppL(const RMessage2& aMessage)
+	{
+	if (iFlags&EAppListPopulationPending)
+		{
+		const CApaAppList& list=AppList();
+		if (!(list.IsFirstScanComplete()))
+			{
+			User::Leave(KErrCorrupt);
+			}
+
+		iApaAppInfoArray.ResetAndDestroy();
+		for (CApaAppData* appData = list.FirstApp(iAppListScreenMode); appData != NULL; appData = list.NextApp(appData, iAppListScreenMode))
+			{
+			if (iAppListType==EListFilteredEmbeddedApps && (AppIsControlPanelItem(*appData) || !AppMatchesEmbeddabilityFilter(*appData, iEmbeddabilityFilter)))
+				{
+				continue;
+				}
+			if (iAppListType==EListCapabilityAttrFilteredApps && !AppMatchesCapabilityAttrFilter(*appData))
+				{
+				continue;
+				}
+			if (iAppListType==EListServerApps && !appData->ImplementsService(iServiceUid))
+				{
+				continue;
+				}
+			CApaAppInfo* apaAppInfo= new (ELeave)CApaAppInfo();
+			CleanupStack::PushL(apaAppInfo);
+			apaAppInfo->SetCaptionL(appData->Caption());
+			apaAppInfo->SetShortCaptionL(appData->ShortCaption());
+			apaAppInfo->SetFullNameL(appData->AppEntry().iFullName);
+			apaAppInfo->SetUid(appData->AppEntry().iUidType[2]);
+			User::LeaveIfError(iApaAppInfoArray.Append(apaAppInfo));
+			CleanupStack::Pop(apaAppInfo);
+			}
+		iFlags&=~EAppListPopulationPending;
+		}
+
+	if (iApaAppInfoArray.Count()==0)
+		{
+		User::Leave(KErrNotFound);
+		}
+	TApaAppInfo* info=new(ELeave)TApaAppInfo; 
+	CleanupStack::PushL(info);
+	CApaAppInfo* apaAppInfo = iApaAppInfoArray[0];
+	info->iUid = apaAppInfo->Uid();
+	info->iFullName = apaAppInfo->FullName();
+	info->iCaption = apaAppInfo->Caption();
+	// Get the length of the target descriptor
+	TInt targetLen=aMessage.GetDesMaxLength(1);
+	if (targetLen==KApaAppInfoDesMaxLength)
+		{
+		info->iShortCaption = apaAppInfo->ShortCaption();
+		}
+	//
+	iApaAppInfoArray.Remove(0);
+	delete apaAppInfo;
+	TPckgC<TApaAppInfo> infoPk(*info);
+	if (targetLen<KApaAppInfoDesMaxLength)
+		{
+		infoPk.Set(infoPk.Left(_FOFF(TApaAppInfo,iShortCaption))); // reduce the length of infoPk to the 7.0 size of TApaAppInfo
+		}
+	aMessage.WriteL(1,infoPk);
+	CleanupStack::PopAndDestroy(info);
+	}
+
+TBool CApaAppListServSession::AppMatchesEmbeddabilityFilter(const CApaAppData& aAppData, const TApaEmbeddabilityFilter& aEmbeddabilityFilter) const
+// returns True if aAppData's embeddability matches the filter set by InitListL
+	{
+	TApaAppCapabilityBuf capabilityBuf;
+	aAppData.Capability(capabilityBuf);
+	if (aEmbeddabilityFilter.MatchesEmbeddability(capabilityBuf().iEmbeddability))
+		{
+		return ETrue;
+		}
+	return EFalse;
+	}
+
+TBool CApaAppListServSession::AppMatchesCapabilityAttrFilter(const CApaAppData& aAppData) const
+// returns True if aAppData's capability attributes match the filter set by InitListL
+	{
+	TApaAppCapabilityBuf capabilityBuf;
+	aAppData.Capability(capabilityBuf);
+	if ((capabilityBuf().iAttributes & iCapabilityAttrFilterMask) == (iCapabilityAttrFilterValue & iCapabilityAttrFilterMask))
+		{
+		return ETrue;
+		}
+	return EFalse;
+	}
+
+TBool CApaAppListServSession::AppIsControlPanelItem(const CApaAppData& aAppData)
+// returns True if aAppData represents a control panel app
+	{
+	TApaAppCapabilityBuf capabilityBuf;
+	aAppData.Capability(capabilityBuf);
+	if (capabilityBuf().iAttributes & TApaAppCapability::EControlPanelItem)
+		{
+		return ETrue;
+		}
+	return EFalse;
+	}
+
+TBool CApaAppListServSession::FindAppInList(CApaAppData*& aApp,TApaAppEntry& aEntry,TUid aAppUid)
+// locate app in list, return EFalse if it isn't present
+// search is regardless of screen mode.
+	{
+	const CApaAppList& list=AppList();
+	aApp = list.AppDataByUid(aAppUid);
+	TBool found=EFalse;
+	if (aApp)
+		{
+		found = ETrue;
+		aEntry = aApp->AppEntry();
+		}
+	
+	TBool appPendingOnLangChange = found && list.IsLanguageChangePending() && aApp->IsPending();	
+		
+	if ((!found || appPendingOnLangChange) && !list.IsIdleUpdateComplete())
+		{
+		// 1. app wasn't found, but an app scan is currently in progress,
+		// so try to find and add the specific app we're looking for to the list
+		
+		// 2. On language change event, current app scan could not yet update the found app, 
+		// so try to update the specific app we're looking for, in the list.
+		CApaAppData* app = NULL;
+		if(aAppUid!=KNullUid)
+			{
+			TRAPD(ret, app = FindSpecificAppL(aAppUid));
+			if (ret == KErrNone && app)
+				{
+				// app has been found and added to the app list
+				aApp = app;
+				aEntry = aApp->AppEntry();
+				found = ETrue;
+				}
+ 			}
+ 		}
+	return found;
+	}
+
+CApaAppData* CApaAppListServSession::FindSpecificAppL(TUid aAppUid)
+	{
+	//Scans the drives and folder lists for the specific app
+	CApaAppRegFinder* regFinder = CApaAppRegFinder::NewLC(iFs);
+	CApaAppData* app = iServ.AppList().FindAndAddSpecificAppL(regFinder, aAppUid);
+	CleanupStack::PopAndDestroy(regFinder);
+	return app;
+	}
+
+void CApaAppListServSession::GetAppInfoL(const RMessage2& aMessage)
+	{
+	// get UID of required app
+	const TUid uid=TUid::Uid(aMessage.Int0());
+	TApaAppInfo* info=new(ELeave) TApaAppInfo; // on heap to avoid running out of stack
+	CleanupStack::PushL(info);
+	GetAppInfoL(uid, *info);
+	TPckgC<TApaAppInfo> infoPk(*info);	
+	aMessage.WriteL(1,infoPk);
+	CleanupStack::PopAndDestroy(info);
+	}
+
+void CApaAppListServSession::GetAppCapabilityL(const RMessage2& aMessage)
+	{	  								  
+	const TUid uid=TUid::Uid(aMessage.Int1());
+	CApaAppData* app=NULL;
+	TApaAppEntry entry;
+	if (!FindAppInList(app,entry,uid))
+		{
+		User::Leave(KErrNotFound);
+		}
+	TInt targetLen=aMessage.GetDesMaxLength(0);
+	HBufC8* buf=HBufC8::NewLC(User::LeaveIfError(targetLen));
+	TPtr8 ptr=buf->Des();
+	app->Capability(ptr);
+	ptr.SetLength(targetLen);
+	aMessage.WriteL(0,*buf);
+	CleanupStack::PopAndDestroy(buf); 
+	}
+
+void CApaAppListServSession::GetDefaultScreenNumberL(const RMessage2& aMessage)
+	{
+	const TUid uid=TUid::Uid(aMessage.Int0());
+	CApaAppData* app=NULL;
+	TApaAppEntry entry;
+	if (!FindAppInList(app,entry,uid))
+		{
+		User::Leave(KErrNotFound);
+		}
+	aMessage.Complete(app->DefaultScreenNumber());
+	}
+
+void CApaAppListServSession::StartAppL(const RMessage2& aMessage, TBool aReturnThreadId)
+	{
+	CApaCommandLine* commandLine=CApaCommandLine::NewLC();
+	commandLine->ConstructCmdLineFromMessageL(aMessage);
+
+	CApaFileRecognizerType* type=NULL;
+	TRAP_IGNORE(type=FileRecognizer()->RecognizeFileL(commandLine->ExecutableName()));
+	if (type==NULL)
+		{
+		User::Leave(KErrNotFound);
+		}
+	CleanupStack::PushL(TCleanupItem(&NullifyAppCommandLinePointer,&iServ));
+	iServ.SetAppCmdLine(commandLine);
+	TPtrC fileName=commandLine->DocumentName();
+	TPtrC8 tailEnd=commandLine->TailEnd();
+	const TThreadId threadId(type->RunL(commandLine->Command(),(fileName.Length()?&fileName:NULL),(tailEnd.Length()?&tailEnd:NULL))); // pass in NULL for components that are not present
+	CleanupStack::PopAndDestroy(&iServ); // calls iServ.SetAppCmdLine(NULL);
+	CleanupStack::PopAndDestroy(commandLine);
+
+	if (aReturnThreadId)
+		{
+		aMessage.WriteL(CApaCommandLine::EIpcFirstFreeSlot,TPckgC<TThreadId>(threadId));
+		}
+	}
+
+void CApaAppListServSession::SetNotify(const RMessage2& aMessage)
+	{
+	if (!iNotifyMessage.IsNull())
+		{
+		aMessage.Panic(KApaPanicCli,ENotifierAlreadyPresent);
+		}
+	else
+		{
+		const TBool completeImmediatelyIfNoScanImpendingOrInProgress=aMessage.Int0();
+		if ((!completeImmediatelyIfNoScanImpendingOrInProgress) ||
+			iServ.AppFsMonitor().AnyNotificationImpending() ||
+			AppList().AppScanInProgress())
+			{
+			iNotifyMessage=aMessage;
+			}
+		else
+			{
+			aMessage.Complete(KErrNone);
+			}
+		}
+	}
+
+void CApaAppListServSession::CancelNotify()
+	{
+	NotifyClients(KErrCancel);
+	}
+
+void CApaAppListServSession::NotifyClients(TInt aReason)
+	{
+	if (!iNotifyMessage.IsNull())
+		{
+		iNotifyMessage.Complete(aReason);
+		}
+	//Notify client for scan complete.
+	NotifyScanComplete();
+	}
+
+void CApaAppListServSession::AppInfoProvidedByRegistrationFileL(const RMessage2& aMessage)
+	{
+	// get UID of required app
+	const TUid uid=TUid::Uid(aMessage.Int0());
+
+	// locate app in list
+	CApaAppData* app=NULL;
+	TApaAppEntry entry;
+	if (!FindAppInList(app,entry,uid))
+		{
+		User::Leave(KErrNotFound);
+		}
+
+	const TBool registrationFileUsed = app->RegistrationFileUsed();
+	TPckgC<TBool> pckg(registrationFileUsed);
+	aMessage.WriteL(1, pckg);
+	}
+
+void CApaAppListServSession::IconFileNameL(const RMessage2& aMessage)
+	{
+	// get UID of required app
+	const TUid uid=TUid::Uid(aMessage.Int0());
+
+	// locate app in list
+	CApaAppData* app=NULL;
+	TApaAppEntry entry;
+	if (!FindAppInList(app,entry,uid))
+		{
+		User::Leave(KErrNotFound);
+		}
+
+	if (!app->RegistrationFileUsed())
+		{
+		User::Leave(KErrNotSupported);
+		}
+	else
+		{
+		TPtrC iconFileName(app->IconFileName());
+		if (iconFileName.Length() == 0)
+			{
+			User::Leave(KErrNotFound);
+			}
+		else
+			{
+			TFileName fileName = iconFileName;
+			TPckgC<TFileName> pckg(fileName);
+			aMessage.WriteL(1, pckg);
+			}
+		}
+	}
+
+void CApaAppListServSession::ViewIconFileNameL(const RMessage2& aMessage)
+	{
+	// get UID of required app
+	const TUid uid=TUid::Uid(aMessage.Int0());
+	// get UID of required view
+	const TUid viewUid=TUid::Uid(aMessage.Int1());
+
+	TPtrC viewIconFileName;
+
+	// locate app in list
+	CApaAppData* app=NULL;
+	TApaAppEntry entry;
+	if (!FindAppInList(app,entry,uid))
+		{
+		User::Leave(KErrNotFound);
+		}
+
+	if (!app->RegistrationFileUsed())
+		{
+		User::Leave(KErrNotSupported);
+		}
+	else
+		{
+		const CArrayPtr<CApaAppViewData>& viewDataArray=*app->Views();
+		const TInt count=viewDataArray.Count();
+		for (TInt ii=0; ii<count; ii++)
+			{
+			const CApaAppViewData& appViewData=*viewDataArray[ii];
+			if (appViewData.Uid()==viewUid)
+				{
+				viewIconFileName.Set(appViewData.IconFileName());
+				break;
+				}
+			}
+		if (viewIconFileName.Length() == 0)
+			{
+			User::Leave(KErrNotFound);
+			}
+		else
+			{
+			TFileName fileName = viewIconFileName;
+			TPckgC<TFileName> pckg(fileName);
+			aMessage.WriteL(2, pckg);
+			}
+		}
+	}
+
+void CApaAppListServSession::GetAppServicesL(const RMessage2& aMessage)
+	{
+	const TInt initialBufSize = aMessage.Int2();
+	if (initialBufSize)
+		{
+		delete iBuffer;
+		iBuffer = NULL;
+		iBuffer = GetServiceBufferL(aMessage);
+		if (iBuffer->Size() > initialBufSize)
+			{
+			// default buffer provided by client is too small, ask client to provide buffer of correct size
+			User::Leave(iBuffer->Ptr(0).Size());
+			}
+		}
+	__ASSERT_ALWAYS(iBuffer, aMessage.Panic(KApaPanicCli,EClientBadRequest));
+	aMessage.WriteL(3, iBuffer->Ptr(0));
+	delete iBuffer;
+	iBuffer = NULL;
+	}
+
+CBufBase* CApaAppListServSession::GetServiceBufferL(const RMessage2& aMessage) const
+	{
+	CBufBase* buffer = NULL;
+	const TUid uid = TUid::Uid(aMessage.Int0());
+	switch (aMessage.Function())
+		{
+	case EAppListServGetAppServices:
+		buffer = AppList().ServiceArrayBufferL(uid);
+		break;
+	case EAppListServGetServiceImplementations:
+		buffer = AppList().ServiceImplArrayBufferL(uid);
+		break;
+	case EAppListServGetServiceImplementationsDataType:
+		{
+		TDataType dataType;
+		TPckg<TDataType> dataType_asDescriptor(dataType);
+		aMessage.ReadL(1,dataType_asDescriptor);
+		buffer = AppList().ServiceImplArrayBufferL(uid, dataType);
+		}
+		break;
+	case EAppListServGetAppServiceUids:
+		buffer = AppList().ServiceUidBufferL(uid);
+		break;
+	case EAppListServGetAppServiceOpaqueData:
+		buffer = AppList().ServiceOpaqueDataBufferL(uid, TUid::Uid(aMessage.Int1()));
+		break;
+	default:
+		aMessage.Panic(KApaPanicCli,EClientBadRequest);
+		User::Leave(KErrNotSupported);
+		break;
+		}
+	return buffer;
+	}
+
+void CApaAppListServSession::NullifyAppCommandLinePointer(TAny* aServer)
+	{
+	static_cast<CApaAppListServer*>(aServer)->SetAppCmdLine(NULL);
+	}
+
+CApaAppListServSession::CApaAppInfo::CApaAppInfo()
+	:iUid(KNullUid), iCaption(NULL), iShortCaption(NULL), iFullName(NULL)
+	{
+	}
+
+CApaAppListServSession::CApaAppInfo::~CApaAppInfo()
+	{
+	delete iCaption;
+	delete iShortCaption;
+	delete iFullName;
+	}
+
+void CApaAppListServSession::CApaAppInfo::SetUid(const TUid aUid)
+	{
+	iUid=aUid;
+	}
+
+void CApaAppListServSession::CApaAppInfo::SetCaptionL(const TDesC& aCaption)
+	{
+	HBufC* caption = aCaption.AllocL();
+	delete iCaption;
+	iCaption = caption;
+	}
+
+void CApaAppListServSession::CApaAppInfo::SetShortCaptionL(const TDesC& aShortCaption)
+	{
+	HBufC* shortCaption = aShortCaption.AllocL();
+	delete iShortCaption;
+	iShortCaption = shortCaption;
+	}
+
+void CApaAppListServSession::CApaAppInfo::SetFullNameL(const TDesC& aFullName)
+	{
+	HBufC* fullName = aFullName.AllocL();
+	delete iFullName;
+	iFullName = fullName;
+	}
+
+void CApaAppListServSession::RegisterListPopulationCompleteObserver(const RMessage2& aMessage)
+	{
+	if (!iCompletionOfListPopulationObserverMsg.IsNull())
+		{
+		aMessage.Panic(KApaPanicCli,EObserverAlreadyPresent);
+		}
+	else
+		{
+		if(AppList().IsFirstScanComplete())
+			{
+			aMessage.Complete(KErrNone);
+			}
+		else
+			{
+			iCompletionOfListPopulationObserverMsg=aMessage;
+			}
+		}
+	}
+
+void CApaAppListServSession::NotifyClientForCompletionOfListPopulation()
+	{
+	if (!iCompletionOfListPopulationObserverMsg.IsNull())
+		{
+		iCompletionOfListPopulationObserverMsg.Complete(KErrNone);
+		}
+	} //lint !e1762 Suppress member function could be made const
+
+
+void CApaAppListServSession::CancelListPopulationCompleteObserver()
+	{
+	if (!iCompletionOfListPopulationObserverMsg.IsNull())
+		{
+		iCompletionOfListPopulationObserverMsg.Complete(KErrCancel);
+		}
+	} //lint !e1762 Suppress member function could be made const
+	
+void CApaAppListServSession::NotifyClientOfDataMappingChange()
+	{
+	if (!iMessage_NotifyOnDataMappingChange.IsNull())
+		{
+		iMessage_NotifyOnDataMappingChange.Complete(KErrNone);
+		}
+	} //lint !e1762 Suppress member function could be made const
+
+void CApaAppListServSession::MatchesSecurityPolicyL(const RMessage2& aMessage)
+	{
+	const TUid appUid=TUid::Uid(aMessage.Int0());
+	TApaAppInfo* const appInfo=new(ELeave) TApaAppInfo;
+	CleanupStack::PushL(appInfo);
+	//Get the app info for the given App uid.
+	GetAppInfoL(appUid, *appInfo);
+	const TPtrC executableName(appInfo->iFullName);
+	//Create a process only if the executable name is of non zero length
+	if (executableName.Length() != 0)
+		{
+		RProcess process;
+		TInt result = process.Create(executableName, KNullDesC);
+		//Proceed with checking the security policy if the process is created normally
+		if (result == KErrNone)
+			{
+			TPckgBuf<TSecurityPolicy> securityPolicy;
+			aMessage.ReadL(1,securityPolicy);
+			aMessage.Complete(securityPolicy().CheckPolicy(process));
+			process.Close();
+			}
+		else
+			{
+			aMessage.Complete(result);
+			}
+		}
+	else
+		{
+		aMessage.Complete(KErrNotFound);
+		}
+	CleanupStack::PopAndDestroy(appInfo);
+	}
+	
+void CApaAppListServSession::SetAppShortCaptionL(const RMessage2& aMessage)
+	{
+	const TUid uid=TUid::Uid(aMessage.Int0());
+	CApaAppData* app=NULL;
+	TApaAppEntry entry;
+	if (!FindAppInList(app,entry,uid))
+		{
+		User::Leave(KErrNotFound);
+		}
+
+	TInt length=aMessage.GetDesLength(1);
+	if(length < 0)
+		{
+		User::Leave(length);
+		}
+
+	HBufC* const shortCaption=HBufC::NewLC(length);
+	TPtr captionPtr(shortCaption->Des());
+	aMessage.ReadL(1, captionPtr);
+
+	TLanguage appLanguage=TLanguage(aMessage.Int2());
+	CCustomAppInfoData* customAppInfo=CCustomAppInfoData::NewL(uid, appLanguage, *shortCaption);
+	CleanupStack::PushL(customAppInfo);
+	iServ.AddCustomAppInfoInListL(customAppInfo);
+	CleanupStack::Pop(customAppInfo);
+	if(app->ApplicationLanguage() == appLanguage)
+		{
+		app->SetShortCaptionL(*shortCaption);
+		}
+	else if(appLanguage==ELangNone)
+		{
+		iServ.UpdateAppListByShortCaptionL(); 
+		}
+	CleanupStack::PopAndDestroy(shortCaption);
+	}
+
+void CApaAppListServSession::NotifyScanComplete()
+	{
+	//See if the session is intrested in scan complete notification.
+	if (!iNotifyOnScanCompleteMsg.IsNull())
+		{
+		iNotifyOnScanCompleteMsg.Complete(KErrNone);
+		}
+	iNonNativeApplicationsManager->NotifyScanComplete();
+	} //lint !e1762 Suppress member function could be made const
+	
+// TSizeArrayItemWriter
+
+TInt TSizeArrayItemWriter::ArrayItemCount() const
+	{
+	return iArray.Count();
+	}
+
+TInt TSizeArrayItemWriter::ArrayItemSize() const
+	{
+	return sizeof(TSize);
+	}
+
+void TSizeArrayItemWriter::WriteArrayItemL(RWriteStream& aWriteStream,TInt aIndex) const
+	{
+	const TSize& size = iArray[aIndex];
+	aWriteStream.WriteUint32L(size.iWidth);
+	aWriteStream.WriteUint32L(size.iHeight);
+	}
+
+// TViewDataArrayItemWriter
+
+TInt TViewDataArrayItemWriter::ArrayItemCount() const
+	{
+	return iArray.Count();
+	}
+
+TInt TViewDataArrayItemWriter::ArrayItemSize() const
+	{
+	return sizeof(TApaAppViewInfo);
+	}
+
+void TViewDataArrayItemWriter::WriteArrayItemL(RWriteStream& aWriteStream,TInt aIndex) const
+	{
+	const CApaAppViewData& appViewData=*(iArray[aIndex]);
+	aWriteStream << TApaAppViewInfo(appViewData.Uid(),appViewData.Caption(),appViewData.ScreenMode());
+	}
+
+// TDesCArrayItemWriter
+
+TInt TDesCArrayItemWriter::ArrayItemCount() const
+	{
+	return iArray.Count();
+	}
+
+TInt TDesCArrayItemWriter::ArrayItemSize() const
+	{
+	return sizeof(TFileName);
+	}
+
+void TDesCArrayItemWriter::WriteArrayItemL(RWriteStream& aWriteStream,TInt aIndex) const
+	{
+	aWriteStream << iArray[aIndex];
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apserv/APSSES.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,227 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#if !defined(__APSSES_H__)
+#define __APSSES_H__
+
+#if !defined(__E32BASE_H__)
+#include <e32base.h>
+#endif
+#if !defined(__APSSERV_H__)
+#include <APSSERV.H>
+#endif
+#if !defined(__F32FILE_H__)
+#include <f32file.h>
+#endif
+#if !defined(__APAID_H__)
+#include <apaid.h>
+#endif
+#if !defined(__APSCLSV_H__)
+#include "APSCLSV.H"
+#endif
+
+#include "APGAPLST.H"
+#include "APSRECUTIL.H"
+
+// classes defined
+class CApaAppListServSession;
+//
+// classes referenced
+class CApaAppList;
+class CApaAppData;
+class CApaFileRecognizer;
+class CApaScanningDataRecognizer;
+class TDataType;
+class CTypeStoreManager;
+class CApsNonNativeApplicationsManager;
+//
+class MArrayItemWriter;
+
+class CFileRecognitionUtility;
+
+class CApaAppListServSession : public CSession2
+	{
+public:
+	// construct/destruct
+	static CApaAppListServSession* NewL(CApaAppListServer& aServer, RFs& aFs);
+	~CApaAppListServSession();
+	//service request
+	virtual void ServiceL(const RMessage2 &aMessage);
+	void NotifyClients(TInt aReason);
+	void NotifyClientForCompletionOfListPopulation();
+	void NotifyClientOfDataMappingChange();
+	void NotifyScanComplete();
+private:
+	CApaAppListServSession(CApaAppListServer& aServer, RFs& aFs);
+	void ConstructL();
+	void NotifyOnDataMappingChange(const RMessage2& aMessage);
+	void CancelNotifyOnDataMappingChange();
+private:
+	enum TAppListType {
+		ENoList,
+		EListFilteredEmbeddedApps,
+		EListCapabilityAttrFilteredApps,
+		EListServerApps
+		};
+	enum TAppListDocumentStart {
+		EStart,
+		EStartByDataType,
+		EStartByUid,
+		ECreateByUid
+		};
+private:
+	class CApaAppInfo;
+private:
+	void AppCount(const RMessage2& aMessage) const;
+	void EmbedCount(const RMessage2& aMessage) const;
+	void GetNextAppL(const RMessage2& aMessage);
+	void InitListL(const RMessage2& aMessage, TAppListType aType);
+	void GetAppInfoL(const RMessage2& aMessage);
+	void GetAppInfoL(TUid aUid, TApaAppInfo& aInfo);
+	void GetAppCapabilityL(const RMessage2& aMessage);
+	void GetDefaultScreenNumberL(const RMessage2& aMessage);
+	void StartAppL(const RMessage2& aMessage, TBool aReturnThreadId);
+	//
+	// Data recognition stuff
+	void RecognizeDataL(const RMessage2& aMessage);
+	void RecognizeDataPassedByFileHandleL(const RMessage2& aMessage);
+	void RecognizeSpecificDataL(const RMessage2& aMessage);
+	void RecognizeSpecificDataPassedByFileHandleL(const RMessage2& aMessage);
+	static void DoRecognizeUnpackLC(HBufC*& aName, HBufC8*& aBuffer, const RMessage2& aMessage);
+	//
+	void AppForDataTypeL(const RMessage2& aMessage);
+	void StartDocumentL(const RMessage2& aMessage,TAppListDocumentStart aStartType);
+	TThreadId StartDocumentL(const TDesC& aFileName, TUid aUid, TApaCommand aCommand);
+	void GetExecutableNameGivenDocumentL(const RMessage2& aMessage);
+	void GetExecutableNameGivenDocumentPassedByFileHandleL(const RMessage2& aMessage);
+	void GetExecutableNameGivenDataTypeL(const RMessage2& aMessage);
+	void GetExecutableNameGivenAppUidL(const RMessage2& aMessage);
+	void GetExecutableNameL(const RMessage2& aMessage, TUid aAppUid);
+	void GetNativeExecutableNameIfNonNativeL(const RMessage2& aMessage);
+	void WriteNativeExecutableIfNonNativeAndPrepareForClientRetrievalOfOpaqueDataL(const RMessage2& aMessage, TInt aMessageSlotForNativeExecutable, const CApaAppData& aAppData);
+	void GetOpaqueDataL(const RMessage2& aMessage);
+	TUid AppForDataTypeL(const TDataType& aDataType, const TUid* aServiceUid);
+	void AppForDocumentL(const RMessage2& aMessage, const TUid* aServiceUid);
+	//
+	void IconForAppL(const RMessage2& aMessage);
+	//
+	void IconForAppBySizeL(const RMessage2& aMessage);
+	void AppIconSizesL(const RMessage2& aMessage);
+	void IconFileHandleForAppL(const RMessage2& aMessage);
+	//
+	void AppViewsL(const RMessage2& aMessage);
+	void IconForViewBySizeL(const RMessage2& aMessage);
+	void AppFileOwnershipInfoL(const RMessage2& aMessage);
+	//
+	void NumberOfOwnDefinedIconsL(const RMessage2& aMessage);
+	//
+	void AppInfoProvidedByRegistrationFileL(const RMessage2& aMessage);
+	void IconFileNameL(const RMessage2& aMessage);
+	void ViewIconFileNameL(const RMessage2& aMessage);
+	//
+	void RecognizeFilesL(const RMessage2& aMessage);
+	void TransferRecognitionResultL(const RMessage2& aMessage);
+	void RecognizeFilesAsyncL(const RMessage2& aMessage);
+	void RuleBasedLaunchingL(const RMessage2& aMessage);
+	void CancelRecognizeFiles();
+	//
+	void InsertDataMappingL(const RMessage2& aMessage);
+	void DeleteDataMappingL(const RMessage2& aMessage);
+	void GetAppByDataTypeL(const RMessage2& aMessage) const;
+	//
+	void GetAppServicesL(const RMessage2& aMessage);
+	CBufBase* GetServiceBufferL(const RMessage2& aMessage) const;
+	void AppForDataTypeAndServiceL(const RMessage2& aMessage);
+	void AppForDocumentPassedByFileHandleL(const RMessage2& aMessage, const TUid* aServiceUid);
+
+	void RegisterNonNativeApplicationTypeL(const RMessage2& aMessage);
+	void DeregisterNonNativeApplicationTypeL(const RMessage2& aMessage);
+
+	void GetAppTypeL(const RMessage2& aMessage);
+	void ForceRegistrationL(const RMessage2& aMessage);
+	inline const CApaAppList& AppList() const;
+	inline CApaFileRecognizer* FileRecognizer() const;
+	CApaAppData& FindAppInListL(TUid aUid);
+	TBool FindAppInList(CApaAppData*& aApp,TApaAppEntry& aEntry,TUid aAppUid);
+	TBool AppMatchesEmbeddabilityFilter(const CApaAppData& aAppData, const TApaEmbeddabilityFilter& aEmbeddabilityFilter) const;
+	TBool AppMatchesCapabilityAttrFilter(const CApaAppData& aAppData) const;
+	static TBool AppIsControlPanelItem(const CApaAppData& aAppData);
+
+	void GetConfidenceL(const RMessage2& aMessage);
+	void SetConfidence(const RMessage2& aMessage);
+	void GetBufSize(const RMessage2& aMessage);
+	void SetBufSize(const RMessage2& aMessage);
+	void GetDataTypesCountL(const RMessage2& aMessage);
+	void GetDataTypesL(const RMessage2& aMessage);
+	void SetNotify(const RMessage2& aMessage);
+	void CancelNotify();
+	//
+	void SendArrayL(const MArrayItemWriter& aArrayItemWriter,const RMessage2& aMessage) const;
+	//
+	void ApplicationLanguageL(const RMessage2& aMessage);
+	void RegisterListPopulationCompleteObserver(const RMessage2& aMessage);
+	void CancelListPopulationCompleteObserver();
+	void MatchesSecurityPolicyL(const RMessage2& aMessage);
+	//
+	void SetAppShortCaptionL(const RMessage2& aMessage);
+
+	static void NullifyAppCommandLinePointer(TAny* aServer);
+	TInt PreferredBufSize() const;
+	CApaAppData* FindSpecificAppL(TUid aAppUid);
+	TUid AppUidFromFullFileNameL(const TDesC& aFullFileName) const;
+	static TInt NextDriveToScan(TInt aCurrentDrive);
+	
+private:
+	enum
+		{
+		ENotifyPresent=0x01,
+		EAppListPopulationPending=0x02
+		};
+
+private:
+	CApaAppListServer& iServ;
+	TInt iFlags;
+	RFs& iFs;
+	TInt iMaxBufSize;
+	CBufBase* iBuffer;
+	RMessage2 iNotifyMessage;
+	RMessage2 iNotifyOnScanCompleteMsg;
+	RPointerArray<CApaAppInfo> iApaAppInfoArray;	//contains the most recent "snapshot" of the applist taken by GetNextAppL.
+	TAppListType iAppListType;
+	TInt iAppListScreenMode;
+	TApaEmbeddabilityFilter iEmbeddabilityFilter;
+	TUint iCapabilityAttrFilterMask; // contains bit flags from TCapabilityAttribute
+	TUint iCapabilityAttrFilterValue; // contains bit flags from TCapabilityAttribute
+	TUid iServiceUid;
+	RMessage2 iCompletionOfListPopulationObserverMsg;
+	CDirectoryRecognitionResult* iRecognitionResult;
+	CFileRecognitionUtility* iFileRecognitionUtility;
+	TBool iAsyncRecognitionActive;
+	HBufC8* iOpaqueData_pendingDispatchToClient;
+	RMessagePtr2 iMessage_NotifyOnDataMappingChange;
+	CApsNonNativeApplicationsManager* iNonNativeApplicationsManager;
+	};
+
+//
+// inlines
+//
+
+inline const CApaAppList& CApaAppListServSession::AppList() const
+	{ return ((CApaAppListServer*)Server())->AppList(); } 
+
+inline CApaFileRecognizer* CApaAppListServSession::FileRecognizer() const
+	{ return ((CApaAppListServer*)Server())->FileRecognizer(); }
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apserv/APSSTART.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,132 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// The main startup of the AppArc server
+// 
+//
+
+#include <apsserv.h>
+#include <fbs.h>
+
+#include "APASVST.H"
+#include "APAFLREC.H"
+
+#include <eikdll.h>
+
+NONSHARABLE_CLASS(CSvActiveScheduler) : public CActiveScheduler
+	{
+public:
+	static void NewLC();
+	virtual void Error(TInt anError) const;
+	};
+
+GLDEF_C void CSvActiveScheduler::NewLC()
+//
+// Create and install the active scheduler.
+//
+	{
+	CSvActiveScheduler* pA=new(ELeave) CSvActiveScheduler;
+	CleanupStack::PushL(pA);
+	CActiveScheduler::Install(pA);
+	}
+
+GLDEF_C void CSvActiveScheduler::Error(TInt) const
+//
+// Called if any Run() method leaves.
+//
+	{
+	}
+
+static void CleanupRFbsSession(TAny*)
+	{
+	RFbsSession::Disconnect();
+	}
+
+static void RunServerL(MApaAppStarter* aAppStarter)
+//
+// Perform all server initialisation, in particular creation of the
+// scheduler and server and then run the scheduler
+//
+	{
+	MApaAppStarter* appStarter = aAppStarter;
+	// create and install the active scheduler we need
+	CSvActiveScheduler::NewLC();
+	// create a RFbsSession
+	User::LeaveIfError(RFbsSession::Connect());
+	CleanupStack::PushL(TCleanupItem(CleanupRFbsSession, NULL));
+	//
+	// create the server (leave it on the cleanup stack)
+	CApaAppListServer* appListServer = CApaAppListServer::NewL(appStarter);
+	CleanupStack::PushL(appListServer);
+	//
+	// Initialisation complete, now signal the client
+#ifdef APA_SERVER_IN_THREAD
+	RThread::Rendezvous(KErrNone);
+#else
+	if(aAppStarter)
+		{
+		// Launching in a thread within an existing process.
+		RThread::Rendezvous(KErrNone);
+		}
+	else
+		{
+		RProcess::Rendezvous(KErrNone);
+		}
+#endif
+	//
+	// Ready to run
+	CActiveScheduler::Start();
+	//
+	// Cleanup the server, RFbsSession and scheduler
+	CleanupStack::PopAndDestroy(3);
+	}
+
+static TInt RunServer(MApaAppStarter* aAppStarter)
+//
+// Main entry-point for the server thread
+//
+	{
+	__UHEAP_MARK;
+	TInt r;
+	// naming the server thread after the server helps to debug panics
+	r=RThread::RenameMe(NameApaServServerThread());
+	//
+	if (r == KErrNone)
+		{
+		CTrapCleanup* cleanup=CTrapCleanup::New();
+		r=KErrNoMemory;
+		if (cleanup)
+			{
+			TRAP(r,RunServerL(aAppStarter));
+			REComSession::FinalClose();
+			delete cleanup;
+			}
+		}
+	//
+	__UHEAP_MARKEND;
+	return r;
+	}
+
+/**
+ApaServThreadStart
+
+@internalTechnology
+*/
+EXPORT_C TInt ApaServThreadStart(TAny* aAppStarter)
+//
+// thread entry-point function.
+//
+	{
+	MApaAppStarter* appStarter = reinterpret_cast<MApaAppStarter*>(aAppStarter);
+	return RunServer(appStarter);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apserv/APSSTD.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,25 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "APSSTD.H"
+
+
+GLDEF_C void Panic(TApaPanic aPanic)
+// Panic the server
+//
+	{
+	_LIT(KApaServPan,"APASERV");
+	User::Panic(KApaServPan,aPanic);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apserv/APSSTD.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,68 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+#if !defined(__APSSTD_H__)
+#define __APSSTD_H__
+
+#if !defined(__E32STD_H__)
+#include <e32std.h>
+#endif
+#if !defined(__APAFLREC_H__)
+#include <apaflrec.h>
+#endif
+
+
+enum TApaPanic
+	{
+	ESvrCreateServer,
+	ESvrStartServer,
+	EMainSchedulerError,
+	//
+	EDSvrNoApp,
+	EEventFromBackupObserverError,
+	EReferenceCountingError1,
+	EReferenceCountingError2,
+	EReferenceCountingError3,
+	EPanicNullPointer,
+	ENonNativeAppsUpdateLogOpenedTwice,
+	ENonNativeAppsTFileDetailsPathNotSet,
+	ENonNativeAppsTFileDetailsPathAlreadySet,
+	ENonNativeAppsTFileDetailsOpenInBadState,
+	ENonNativeAppsTFileDetailsOpenWithRealPathSet,
+	ENonNativeAppsTFileDetailsOpenWithTempPathSet,
+	ENonNativeAppsTFileDetailsRenameToRealInBadState,
+	ENonNativeAppsTFileDetailsRenameToRealWithoutTempPath,
+	ENonNativeAppsTFileDetailsRenameToRealWithoutRealPath,
+	ENonNativeAppsTFileDetailsRenameToTempInBadState,
+	ENonNativeAppsTFileDetailsRenameToTempWithoutRealPathSet,
+	ENonNativeAppsTFileDetailsRenameToTempWithTempPathSet,
+	ENonNativeAppsTFileDetailsCreateTempInBadState,
+	ENonNativeAppsTFileDetailsCreateTempWithTempPathSet,
+	ENonNativeAppsTFileDetailsDeleteInBadState,
+	ENonNativeAppsTFileDetailsDeleteTemporaryInBadState,
+	ENonNativeAppsTFileDetailsRestoreRealInBadState,
+	ENonNativeAppsFileDeleterOverflow,
+	ENonNativeAppsFileReplacerOverflow,
+	ENonNativeAppsNegativeStoredFilePosition,
+	ENonNativeAppsTestHandlingPanicDuringUpdate,
+	ENonNativeAppsTestHandlingPanicDuringRollback,
+	ENonNativeAppsNonNativeApplicationsUpdateInternalizeNewUpdateInBadState
+	};
+
+
+GLREF_C void Panic(TApaPanic aPanic);
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apserv/apsiconcaptionoverride.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,570 @@
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @internalComponent
+*/
+
+#include "apsiconcaptionoverride.h"
+#include <centralrepository.h>
+#include <apadef.h>
+
+//constants defined
+const TUid KUidIconCaptionRepository = { 0x1028583d }; // Central Repository UID
+const TUint32 KAppBits = 0xFF000000; // App mask bits
+const TUint32 KFieldBits = 0x00FF0000; // Field mask bits
+const TUint32 KUidKey = 0x00FFFFFF; // UID mask bits
+
+// Field id values for short caption, caption, icon count, icon file name
+// of an application.
+enum TFieldId
+	{
+	EOverrideFieldShortCaption,
+	EOverrideFieldCaption,
+	EOverrideFieldNumIcons,
+	EOverrideFieldIconFileName
+	};
+
+/** 
+Stores the Central Repository configuration details into a Hash table.
+Two Hash tables defined to store integer and string type data separately.
+*/
+NONSHARABLE_CLASS(CApaIconCaptionOverrideStore) : public CBase
+	{
+public:
+	CApaIconCaptionOverrideStore();
+	~CApaIconCaptionOverrideStore();
+	
+	const TDesC* String(TUint32 aKey) const;
+	void SetStringL(TUint32 aKey, const TDesC& aString);
+	const TInt* Int(TUint32 aKey) const;
+	void SetIntL(TUint32 aKey, TInt aInt);
+	
+private:
+	typedef RHashMap<TUint32, TInt> RIntMap;
+	RIntMap iIntMap;
+	typedef RHashMap<TUint32, HBufC*> RStringMap;
+	RStringMap iStringMap;
+	};
+
+
+
+// Constructor
+CApaIconCaptionOverrideStore::CApaIconCaptionOverrideStore()
+	{
+	}
+
+// Destructor
+CApaIconCaptionOverrideStore::~CApaIconCaptionOverrideStore()
+	{
+	RStringMap::TIter pString(iStringMap);
+	for (HBufC* const* str = pString.NextValue();
+		 str;
+		 str = pString.NextValue())
+		 delete *str;
+	iStringMap.Close();
+	iIntMap.Close();
+	}
+
+/** 
+Looks up a specified key in the associative array and returns a pointer to the corresponding value.
+
+@param aKey The key object of type integer to look up.
+@return A pointer to the corresponding string value.  
+*/
+const TDesC* CApaIconCaptionOverrideStore::String(TUint32 aKey) const
+	{
+	HBufC* const * pStr = iStringMap.Find(aKey);
+	if (pStr)
+		return *pStr;
+	else
+		return NULL;
+	}
+
+/**
+Inserts the key-value pair into the array (string Hash table).
+
+@param aKey The key object of type integer to add to the array.
+@param aString The value object of type string to associate with aKey.
+*/
+void CApaIconCaptionOverrideStore::SetStringL(TUint32 aKey, const TDesC& aString)
+	{
+	HBufC* newStr = aString.AllocL();
+	HBufC* const * pStr = iStringMap.Find(aKey);
+	CleanupStack::PushL(newStr);
+	if (pStr)
+		{
+		delete *pStr;
+		}
+	iStringMap.InsertL(aKey, newStr);
+	CleanupStack::Pop(newStr);
+	}
+
+/**
+Looks up a specified key in the associative array and returns a pointer to the corresponding value.
+
+@param aKey The key object of type integer to look up
+@return A pointer to the corresponding integer value.
+*/
+const TInt* CApaIconCaptionOverrideStore::Int(TUint32 aKey) const
+	{
+	const TInt * pInt = iIntMap.Find(aKey);
+	return pInt;
+	}
+
+/**
+Inserts the key-value pair into the array (integer Hash table)
+
+@param aKey The key object of type integer to add to the array.
+@param aInt The value object of type integer to associate with aKey.
+*/
+void CApaIconCaptionOverrideStore::SetIntL(TUint32 aKey, TInt aInt)
+	{
+	iIntMap.InsertL(aKey, aInt);
+	}
+
+/**
+A utility class used to write information into a store (CApaIconCaptionOverrideStore).
+*/
+NONSHARABLE_CLASS(TApaIconCaptionOverrideWriter)
+	{
+public:
+	TApaIconCaptionOverrideWriter(CApaIconCaptionOverrideStore& aStore);
+
+	void LoadFieldFromCenRepL(CRepository* aRepository, TUint32 aFullKey);
+
+private:
+	CApaIconCaptionOverrideStore& iStore;
+	};
+
+
+TApaIconCaptionOverrideWriter::TApaIconCaptionOverrideWriter(CApaIconCaptionOverrideStore& aStore)
+: iStore(aStore)
+	{
+	}
+
+/**
+Reads the Central Repository integer, string settings and inserts the key-value pair into Store.
+
+Each setting is enumerated by a 32-bit key. The top 8 bits of the key is for app identification,
+the next 8 bits is for field (short caption (00), caption (01),total number of icons (02), 
+icon filename (03)) identification and next 16 bits for language identification.
+
+It is computed in the following way
+
+	00XXXXXX - App UID field
+	XX00XXXX - Short Caption field
+	XX01XXXX - Caption field
+	XX02XXXX - Icon count field
+	XX03XXXX - Icon Filename field
+	XXXX0000 - Language field
+
+First it performs a bitwise NOT operation on application mask key (KAppBits) and its value is bitwise
+AND with the 32 bit key of the field.
+
+It performs a bitwise AND with the field mask key (KFieldBits) and does a bitwise right shift to 16 bits
+to extract the field bit value from the 32 bit key.
+
+It reads each field's (short caption, caption, total number of icons, icon file name) value from the
+Central Repository and inserts into a Store (Hash table).
+
+@param aRepository The object provides access to Central Repository
+@param aFullKey The 32-bit field key
+*/
+void TApaIconCaptionOverrideWriter::LoadFieldFromCenRepL(CRepository* aRepository, TUint32 aFullKey)
+	{
+	TUint32 key = aFullKey & ~KAppBits;
+	TUint32 fieldId = (key & KFieldBits) >> 16;
+	switch (fieldId)
+		{
+		case EOverrideFieldShortCaption:
+			{
+			TApaAppCaption shortCaption;
+			if (aRepository->Get(aFullKey, shortCaption) == KErrNone)
+				iStore.SetStringL(key, shortCaption);
+			break;
+			}
+		case EOverrideFieldCaption:
+			{
+			TApaAppCaption caption;
+			if (aRepository->Get(aFullKey, caption) == KErrNone)
+				iStore.SetStringL(key, caption);
+			break;
+			}
+		case EOverrideFieldNumIcons:
+			int numIcons;
+			if (aRepository->Get(aFullKey, numIcons) == KErrNone)
+				iStore.SetIntL(key, numIcons);
+			break;
+		case EOverrideFieldIconFileName:
+			{
+			TFileName fileName;
+			if (aRepository->Get(aFullKey, fileName) == KErrNone)
+				iStore.SetStringL(key, fileName);
+			break;
+			}
+		default:
+			break;
+		}
+	}
+
+// Constructor
+TApaIconCaptionOverrideReader::TApaIconCaptionOverrideReader(const CApaIconCaptionOverrideStore& aStore, const RArray<TLanguage>& aLanguageDowngradePath)
+: iStore(aStore), iLanguageDowngradePath(aLanguageDowngradePath)
+	{
+	}
+
+/**
+Gets the short caption value of the corresponding setting from store.
+*/
+const TDesC* TApaIconCaptionOverrideReader::ShortCaption() const
+	{
+	return GetString(EOverrideFieldShortCaption);
+	}
+
+/**
+Gets the caption value of the corresponding setting from store.
+*/
+const TDesC* TApaIconCaptionOverrideReader::Caption() const
+	{
+	return GetString(EOverrideFieldCaption);
+	}
+
+/**
+Checks whether the number of icons are set.
+@return ETrue when the number of icons are set else returns EFalse.  
+*/
+TBool TApaIconCaptionOverrideReader::NumIconsSet() const
+	{
+	return GetInt(EOverrideFieldNumIcons) != NULL;
+	}
+
+/**
+Gets the total number of icons of the corresponding setting from store.
+*/
+TInt TApaIconCaptionOverrideReader::NumIcons() const
+	{
+	const TInt* pInt = GetInt(EOverrideFieldNumIcons);
+	if (pInt)
+		return *pInt;
+	else
+		return 0;
+	}
+
+/**
+Gets the icon file name of the corresponding setting from store.
+*/
+const TDesC* TApaIconCaptionOverrideReader::IconFileName() const
+	{
+	return GetString(EOverrideFieldIconFileName);
+	}
+
+/**
+Reads store and retrieves the corresponding string value of the passed field Id.
+
+Gets the configuration information with reference to the language downgrade path, with
+ELangNone as default language, in case there is no match is found.
+
+@param aFieldId Field Id values for short caption, caption, icon count, icon file name.
+@return A pointer to the corresponding string value.
+*/
+const TDesC* TApaIconCaptionOverrideReader::GetString(TUint32 aFieldId) const
+	{
+	TInt count = iLanguageDowngradePath.Count();
+	for (TInt ii=0; ii<count; ii++)
+		{
+		TLanguage language = iLanguageDowngradePath[ii];
+		TUint32 key = (aFieldId << 16) | language;
+		const TDesC* pString = iStore.String(key);
+		if (pString)
+			return pString;
+		}
+	// default fallback language is ELangNone
+	TUint32 key = (aFieldId << 16) | ELangNone;
+	const TDesC* pString = iStore.String(key);
+	if (pString)
+		return pString;
+	return NULL;
+	}
+
+/**
+Reads store and retrieves the corresponding integer value of the passed field Id.
+
+Gets the configuration information with reference to the language downgrade path, with
+ELangNone as default language, in case there is no match is found.
+
+@param aFieldId Field Id values for short caption, caption, icon count, icon file name.
+@return A pointer to the corresponding integer value.
+*/
+const TInt* TApaIconCaptionOverrideReader::GetInt(TUint32 aFieldId) const
+	{
+	TInt count = iLanguageDowngradePath.Count();
+	for (TInt ii=0; ii<count; ii++)
+		{
+		TLanguage language = iLanguageDowngradePath[ii];
+		TUint32 key = (aFieldId << 16) | language;
+		const TInt* pInt = iStore.Int(key);
+		if (pInt)
+			return pInt;
+		}
+	// default fallback language is ELangNone
+	TUint32 key = (aFieldId << 16) | ELangNone;
+	const TInt* pInt = iStore.Int(key);
+	if (pInt)
+		return pInt;
+	return NULL;
+	}
+
+// Constructor
+CApaIconCaptionOverridesForApp::CApaIconCaptionOverridesForApp()
+	{
+	}
+
+// Destructor
+CApaIconCaptionOverridesForApp::~CApaIconCaptionOverridesForApp()
+	{
+	delete iStore;
+	}
+
+CApaIconCaptionOverridesForApp* CApaIconCaptionOverridesForApp::NewL()
+	{
+	CApaIconCaptionOverridesForApp* self = new (ELeave) CApaIconCaptionOverridesForApp;
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(); // self
+	return self;
+	}
+
+/** 2nd phase constructor that creates an object to store the Central Repository configuration
+details (integer & string values) into separate Hash tables.
+*/
+void CApaIconCaptionOverridesForApp::ConstructL()
+	{
+	iStore = new(ELeave) CApaIconCaptionOverrideStore;
+	}
+
+/**
+Finds all the settings that exist and match the specification given by partial key (aAppKey) and
+application mask key (KAppBits) from the Central Repository.
+
+All the 32-bit field keys have been retrieved from the Central Repository and stored into an array.
+It performs a bitwise NOT operation on application mask key (KAppBits) and its value is bitwise AND
+with each of the value retrieved from the array. If the new value does not match with the UID mask key,
+it tries to read each field setting value and stores the information into a store (Hash tables).
+
+@param aRepository The object provides access to Central Repository.
+@param aAppKey partial key.
+*/
+void CApaIconCaptionOverridesForApp::LoadFromCenRepL(CRepository* aRepository, TUint32 aAppKey)
+	{
+	TApaIconCaptionOverrideWriter writer(*iStore);
+	RArray<TUint32> appKeys;
+	CleanupClosePushL(appKeys);
+	User::LeaveIfError(aRepository->FindL(aAppKey, KAppBits, appKeys));
+	TInt count = appKeys.Count();
+	for (TInt ii=0; ii<count; ii++)
+		{
+		TUint32 key = appKeys[ii];
+		if ((key & ~KAppBits) == KUidKey)
+			continue;
+		writer.LoadFieldFromCenRepL(aRepository, key);
+		}
+	CleanupStack::PopAndDestroy(&appKeys);	
+	}
+
+/**
+Creates an object to read the configuration information with reference to the language downgrade path,
+with ELangNone used as the default language, if no better match is found.
+*/
+TApaIconCaptionOverrideReader CApaIconCaptionOverridesForApp::Reader(const RArray<TLanguage>& aLanguageDowngradePath) const
+	{
+	TApaIconCaptionOverrideReader reader(*iStore, aLanguageDowngradePath);
+	return reader;
+	}
+
+// Constructor
+CApaIconCaptionOverrides::CApaIconCaptionOverrides()
+	{
+	}
+
+// Destructor
+CApaIconCaptionOverrides::~CApaIconCaptionOverrides()
+	{
+	DeleteOverrides();
+	}
+
+void CApaIconCaptionOverrides::LoadFromCenRepL()
+	{
+	CRepository* cenrep = CRepository::NewLC(KUidIconCaptionRepository);
+	LoadFromCenRepL(cenrep);
+	CleanupStack::PopAndDestroy(cenrep);
+	}
+
+/**
+Finds all the settings that exist and match the specification given by partial and mask keys, from the
+Central Repository. If the settings are found, it reads the values and stores icon, caption details
+into the store.
+*/
+void CApaIconCaptionOverrides::LoadFromCenRepL(CRepository* aRepository)
+	{
+	DeleteOverrides();
+
+	RArray<TUint32> appKeys;
+	CleanupClosePushL(appKeys);
+	aRepository->FindL(KUidKey, ~KAppBits, appKeys);	// ignore return. if no overrides found, array will be empty
+	TInt count = appKeys.Count();
+	for (TInt ii=0; ii<count; ii++)
+		{
+		TUint32 key = appKeys[ii];
+		TInt appUidVal;
+		User::LeaveIfError(aRepository->Get(key, appUidVal));
+		TUid appUid = { appUidVal };
+		CApaIconCaptionOverridesForApp* app = CApaIconCaptionOverridesForApp::NewL();
+		CleanupStack::PushL(app);
+		app->LoadFromCenRepL(aRepository, key);
+		SetOverrideForAppL(appUid, app);
+		CleanupStack::Pop(app);
+		}
+	CleanupStack::PopAndDestroy(&appKeys);
+	}
+
+/**
+Searches Hash table that keeps a map of app UIDs to configuration information for supplied application
+and returns a pointer to an object that keeps information of icon caption overrides for an application, if
+any suitable entry is found; otherwise NULL.
+*/
+CApaIconCaptionOverridesForApp* CApaIconCaptionOverrides::OverrideForApp(TUid aAppUid) const
+	{
+	CApaIconCaptionOverridesForApp* const * override = iMap.Find(aAppUid.iUid);
+	if (override)
+		return *override;
+	else
+		return NULL;
+	}
+
+/**
+Inserts key-value pair into an array (Hash table), if found, updates it.
+*/
+void CApaIconCaptionOverrides::SetOverrideForAppL(TUid aAppUid, CApaIconCaptionOverridesForApp* aOverrides)
+	{
+	//Searches the Hash table with the app UID, if it's found, it returns the corresponding entry;
+	CApaIconCaptionOverridesForApp* prev = OverrideForApp(aAppUid);
+	if (aOverrides)
+		{
+		iMap.InsertL(aAppUid.iUid, aOverrides);
+		}
+	else
+		{
+		iMap.Remove(aAppUid.iUid);
+		}
+	delete prev; // delete the found entry as InsertL() replaces it.
+	}
+
+/**
+Removes all the mapping done with app UIDs in Hash table for the icon caption overrides.
+*/
+void CApaIconCaptionOverrides::DeleteOverrides()
+	{
+	RAppOverrideMap::TIter pOverride(iMap);
+	for (CApaIconCaptionOverridesForApp* const* override = pOverride.NextValue();
+		 override;
+		 override = pOverride.NextValue())
+		 delete *override;
+	iMap.Close();
+	}
+
+
+CApaIconCaptionCenrepObserver::CApaIconCaptionCenrepObserver(CApaIconCaptionOverrides& aOverrides)
+: CActive(EPriorityStandard), iOverrides(aOverrides)
+	{
+	CActiveScheduler::Add(this);
+	}
+	
+// Creates a Central Repository observer
+CApaIconCaptionCenrepObserver* CApaIconCaptionCenrepObserver::NewL(CApaIconCaptionOverrides& aOverrides)
+	{
+	CApaIconCaptionCenrepObserver* self = new (ELeave) CApaIconCaptionCenrepObserver(aOverrides);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop();
+	return self;
+	}
+
+// Destructor
+CApaIconCaptionCenrepObserver::~CApaIconCaptionCenrepObserver()
+	{
+	Cancel();
+	delete iRepository;
+	}
+
+/** 2nd phase constructor that creates a Central Repository object to access the repository with the
+specified UID and starts notification.
+*/
+void CApaIconCaptionCenrepObserver::ConstructL()
+	{
+	TRAP_IGNORE(iRepository = CRepository::NewL(KUidIconCaptionRepository));
+	Start();
+	}
+
+/**
+Finds all the settings that exist and match the specification given by partial and mask keys, from the
+Central Repository, if it exists.
+*/
+void CApaIconCaptionCenrepObserver::LoadOverridesL()
+	{
+	if (iRepository)
+		iOverrides.LoadFromCenRepL(iRepository);
+	}
+
+/**
+Requests a notification on any change in the Central Repository. Only one notification can be
+received per call to NotifyRequest().
+*/
+void CApaIconCaptionCenrepObserver::Start()
+	{
+	if (iRepository)
+		{
+		iRepository->NotifyRequest(0, 0, iStatus);	// notify on all key changes
+		SetActive();
+		}
+	}
+
+/**
+Handles an active object's request completion event.
+*/
+void CApaIconCaptionCenrepObserver::RunL()
+	{
+	TInt err = iStatus.Int();
+	Start();
+	User::LeaveIfError(err);
+	LoadOverridesL();
+	}
+	
+/**
+Cancels a notification previously requested from NotifyRequest
+*/
+void CApaIconCaptionCenrepObserver::DoCancel()
+	{
+	iRepository->NotifyCancel(0, 0);
+	}
+	
+
+TInt CApaIconCaptionCenrepObserver::RunError(TInt /*aError*/)
+	{
+	//Return KErrNone if RunL leaves to avoid a E32User-CBase 47 panic.
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apserv/apsiconcaptionoverride.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,128 @@
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @internalComponent
+*/
+
+
+#ifndef APSICONCAPTIONOVERRIDE_H
+#define APSICONCAPTIONOVERRIDE_H
+
+#include <e32base.h>
+#include <e32hashtab.h>
+
+class CRepository;
+class CApaIconCaptionOverrideStore;
+
+
+/**
+ * Read icon and caption details for an app according to the
+ * language downgrade path, with ELangNone used as the default
+ * language if no better match found.
+
+ @see CApaIconCaptionOverrideStore
+ */
+NONSHARABLE_CLASS(TApaIconCaptionOverrideReader)
+	{
+public:
+	TApaIconCaptionOverrideReader(const CApaIconCaptionOverrideStore& aStore, const RArray<TLanguage>& aLanguageDowngradePath);
+	
+	const TDesC* ShortCaption() const;
+	const TDesC* Caption() const;
+	TBool NumIconsSet() const;
+	TInt NumIcons() const;
+	const TDesC* IconFileName() const;
+
+private:
+	const TDesC* GetString(TUint32 aFieldId) const;
+	const TInt* GetInt(TUint32 aFieldId) const;
+	
+private:
+	const CApaIconCaptionOverrideStore& iStore;
+	const RArray<TLanguage>& iLanguageDowngradePath;
+	};
+
+/**
+* Stores the icon and caption overrides for an application.
+*/
+NONSHARABLE_CLASS(CApaIconCaptionOverridesForApp) : public CBase
+	{
+public:
+	static CApaIconCaptionOverridesForApp* NewL();
+	~CApaIconCaptionOverridesForApp();
+	CApaIconCaptionOverridesForApp();
+	void ConstructL();
+
+	void LoadFromCenRepL(CRepository* aRepository, TUint32 aAppKey);
+
+	TApaIconCaptionOverrideReader Reader(const RArray<TLanguage>& aLanguageDowngradePath) const;
+	
+private:
+	CApaIconCaptionOverrideStore* iStore;
+	};
+
+
+/**
+ * Store all of the icon and caption override data indexed by app UID
+ */
+NONSHARABLE_CLASS(CApaIconCaptionOverrides) : public CBase
+	{
+public:
+	CApaIconCaptionOverrides();
+	~CApaIconCaptionOverrides();
+
+	void LoadFromCenRepL();
+	void LoadFromCenRepL(CRepository* aRepository);
+
+	CApaIconCaptionOverridesForApp* OverrideForApp(TUid aAppUid) const;
+	void SetOverrideForAppL(TUid aAppUid, CApaIconCaptionOverridesForApp* aOverrides);	// takes ownership
+
+private:
+	void DeleteOverrides();
+
+private:
+	typedef RHashMap<TInt, CApaIconCaptionOverridesForApp*> RAppOverrideMap;
+	RAppOverrideMap iMap;
+	};
+	
+/**
+* Watches for changes in the Central Repositiory and update the overrides when they occur.
+*/
+NONSHARABLE_CLASS(CApaIconCaptionCenrepObserver) : public CActive
+	{
+public:
+	static CApaIconCaptionCenrepObserver* NewL(CApaIconCaptionOverrides& aOverrides);
+	CApaIconCaptionCenrepObserver(CApaIconCaptionOverrides& aOverrides);
+	~CApaIconCaptionCenrepObserver();
+	void ConstructL();
+	void LoadOverridesL();
+	
+private:
+	void Start();
+
+	void RunL();
+	void DoCancel();
+	TInt RunError(TInt aError);
+	
+private:
+	CApaIconCaptionOverrides& iOverrides;
+	CRepository* iRepository;	// owned
+	};
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apserv/apsnnapps.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,733 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Non-Native application registration functionality for the AppArc server session
+// 
+//
+
+
+#include "apsnnapps.h"
+
+#include <bautils.h>
+#include <f32file.h>
+#include <s32file.h>
+
+#include "APSCLSV.H"
+#include "APSSERV.H"
+#include "APSSTD.H"
+#include "../apgrfx/apprivate.h"
+#include "apsnnappupdates.h"
+
+/**
+KNonNativeApplicationsUpdateLog
+@internalComponent
+*/
+_LIT(KNonNativeApplicationsUpdateLog, ":\\private\\10003a3f\\UpdatedAppsList.bin");
+
+/**************************************************************************************************************
+ * CApsNonNativeApplicationsUpdateList
+ **************************************************************************************************************/
+
+CApsNonNativeApplicationsUpdateList* CApsNonNativeApplicationsUpdateList::NewL(RFs& aFs)
+	{
+	CApsNonNativeApplicationsUpdateList* self = new(ELeave) CApsNonNativeApplicationsUpdateList(aFs);
+	return self;
+	}
+
+void CApsNonNativeApplicationsUpdateList::RecoverFromUpdateLogL(RFs& aFs, RFile& aFile)
+	{
+	CleanupClosePushL(aFile);
+	CApsNonNativeApplicationsUpdateList* self = new(ELeave) CApsNonNativeApplicationsUpdateList(aFs);
+	CleanupStack::PushL(self);
+	self->RecoverFromUpdateLogL(aFile); // consumes aFile
+	CleanupStack::PopAndDestroy(self);
+	CleanupStack::Pop(&aFile);
+	}
+
+
+CApsNonNativeApplicationsUpdateList::CApsNonNativeApplicationsUpdateList(RFs& aFs) :
+		iFs(aFs)
+	{
+	}
+
+CApsNonNativeApplicationsUpdateList::~CApsNonNativeApplicationsUpdateList()
+	{
+	CApsNonNativeApplicationsUpdate* update = iUpdateListHead;
+	while(update != NULL)
+		{
+		CApsNonNativeApplicationsUpdate* next = update->Next();
+		delete update;
+		update = next;
+		}
+	}
+
+void CApsNonNativeApplicationsUpdateList::RecoverFromUpdateLogL(RFile& aFile)
+	{
+	RFileReadStream readStream;
+	CleanupClosePushL(readStream);
+	RFile logFileDupe;
+	User::LeaveIfError(logFileDupe.Duplicate(aFile));
+	readStream.Attach(logFileDupe); // Attach takes ownership of & Nulls the handle passed to it
+	TInt pos = 0;
+	InternalizeL(readStream,pos);
+	CleanupStack::PopAndDestroy(&readStream);
+
+	/* Great, we've read in all our performed updates and deleted all the ones that were fully
+	   rolled back.
+	   The next step is to roll back the rest of the updates. We'll need to create an
+	   update log as it was before the reboot, so that further rollbacks we successfully perform
+	   can also be logged in it */
+	
+	// pos should point to the end of the last compelte action recorded in the file
+	// remove any invalid or half-written actions by truncating to pos
+	User::LeaveIfError(aFile.SetSize(pos));
+	RApsUpdateLog updateLog(iFs);
+	updateLog.Open(aFile,pos); // consumes aFile
+	CleanupClosePushL(updateLog);
+
+	if(iEEndOfUpdateRequiredToFixLog)
+		{
+		updateLog.LogWriteStream().WriteInt8L(CApsNonNativeApplicationsUpdate::EEndOfUpdate);
+		updateLog.LogWriteStream().CommitL(); // puts us back to an alpha stopping point
+		}
+
+	if(iLogReplayCurrentUpdate != NULL)
+		{
+		switch(iLogReplayCurrentUpdate->iState)
+			{
+		case CApsNonNativeApplicationsUpdate::ENew:
+			/* current update was never performed. Start rollback at the previous one,
+			   which will be in EPerformed */
+			iLogReplayCurrentUpdate = iLogReplayCurrentUpdate->Previous();
+			ASSERT(iLogReplayCurrentUpdate == NULL || iLogReplayCurrentUpdate->iState == CApsNonNativeApplicationsUpdate::EPerformed);
+			break;
+		case CApsNonNativeApplicationsUpdate::EPerforming:
+		case CApsNonNativeApplicationsUpdate::EPerformed:
+		case CApsNonNativeApplicationsUpdate::ERollingBack:
+			break;
+		case CApsNonNativeApplicationsUpdate::ERolledBack:
+			User::Leave(KErrCorrupt);
+			break;
+			}
+		Rollback(iLogReplayCurrentUpdate, updateLog);
+		}
+	CleanupStack::PopAndDestroy(&updateLog);
+	}
+
+void CApsNonNativeApplicationsUpdateList::InternalizeL(RReadStream& aStream, TInt& aPosition)
+	{
+	TInt err = KErrNone;
+	while(err == KErrNone)
+		{
+		TRAP(err,InternalizeActionL(aStream,aPosition));
+		if(err == KErrNone || err == KErrCorrupt || err == KErrEof)
+			{
+			// We anticipate that the last update we try to read may be incomplete or corrupt.
+			// if we get either of these, jsut stop reading in the list of updates.
+			}
+		else
+			{
+			// something really unexpected, e.g. KErrNoMemory
+			User::Leave(err);
+			}
+		}
+	CApsNonNativeApplicationsUpdate* update = iUpdateListHead;
+	while(update) 
+		{
+		update->PostInternalizeL();
+		update = update->Next();
+		}
+	}
+
+void CApsNonNativeApplicationsUpdateList::InternalizeActionL(RReadStream& aStream, TInt& aPosition)
+	{
+	TInt pos = aPosition;
+
+	CApsNonNativeApplicationsUpdate::TLogActionType action =
+		static_cast<CApsNonNativeApplicationsUpdate::TLogActionType>(aStream.ReadInt8L());
+	CApsNonNativeApplicationsUpdate::TLogUpdateType type =
+		static_cast<CApsNonNativeApplicationsUpdate::TLogUpdateType>(aStream.ReadInt8L());
+	TUid appUid;
+	appUid.iUid = aStream.ReadInt32L();
+	pos += sizeof(TInt8) + sizeof(TInt8) + sizeof(TUint32);
+
+	switch(action)
+		{
+	case CApsNonNativeApplicationsUpdate::ENewUpdate:
+		// for ENewUpdate, this is not a valid stopping point,
+		// so we don't want to change aPosition unless it completes successfully.
+		InternalizeNewUpdateL(aStream, pos, type, appUid);
+		aPosition = pos;
+		break;
+	case CApsNonNativeApplicationsUpdate::EPerformUpdate:
+		// for EPerformUpdate, this is a beta stopping point, and
+		// InternalizePerformUpdateL will only ever update aPosition to
+		// another stopping point, so we can give it the real aPosition.
+		// Since it's a beta stopping point, we need to set iEEndofUpdateRequiredToFixLog
+		iEEndOfUpdateRequiredToFixLog = ETrue;
+		aPosition = pos;
+		InternalizePerformUpdateL(aStream, aPosition, type, appUid);
+		iEEndOfUpdateRequiredToFixLog = EFalse;
+		break;
+	case CApsNonNativeApplicationsUpdate::ERollbackUpdate:
+		// this action has the same behaviour as EPerformUpdate
+		iEEndOfUpdateRequiredToFixLog = ETrue;
+		aPosition = pos;
+		InternalizeRollbackUpdateL(aStream, aPosition, type, appUid);
+		iEEndOfUpdateRequiredToFixLog = EFalse;
+		break;
+	default:
+		User::Leave(KErrCorrupt);
+		break;
+		}
+	}
+
+void CApsNonNativeApplicationsUpdateList::InternalizeNewUpdateL(RReadStream& aStream, TInt& aPosition, CApsNonNativeApplicationsUpdate::TLogUpdateType aType, TUid aUid)
+	{
+	// check that this is the first update or the previous update was performed completely
+	if(iLogReplayCurrentUpdate !=  NULL && (iLogReplayCurrentUpdate->iState != CApsNonNativeApplicationsUpdate::EPerformed || iLogReplayCurrentUpdate->Next() != NULL))
+		{
+		User::Leave(KErrCorrupt);
+		}
+
+	/*
+	 create the update object, depending on type
+	 */
+	CApsNonNativeApplicationsUpdate* update = NULL;
+	switch(aType) 
+		{
+	case CApsNonNativeApplicationsUpdate::ERegisterApplication:
+		update = CApsRegisterNonNativeApplication::NewL(iFs, aUid, TDriveName(), CApsNonNativeApplicationsUpdate::ENeedsInternalizing);
+		break;
+	case CApsNonNativeApplicationsUpdate::EDeregisterApplication:
+		update = CApsDeregisterNonNativeApplication::NewL(iFs, *CApaAppListServer::Self(), aUid, CApsNonNativeApplicationsUpdate::ENeedsInternalizing);
+		break;
+#ifdef _DEBUG
+	case CApsNonNativeApplicationsUpdate::EFail:
+		update = new(ELeave) CApsAlwaysFailUpdate(iFs, CApsNonNativeApplicationsUpdate::ENeedsInternalizing);
+		break;
+	case CApsNonNativeApplicationsUpdate::EPanic:
+		update = new(ELeave) CApsAlwaysPanicUpdate(iFs, CApsNonNativeApplicationsUpdate::ENeedsInternalizing);
+		break;
+	case CApsNonNativeApplicationsUpdate::ERollbackPanic:
+		update = new(ELeave) CApsAlwaysPanicOnRollbackUpdate(iFs, CApsNonNativeApplicationsUpdate::ENeedsInternalizing);
+		break;
+#endif
+	default:
+		User::Leave(KErrCorrupt);
+		break;
+		}
+	CleanupStack::PushL(update);
+	update->InternalizeNewUpdateL(aStream, aPosition);
+	CleanupStack::Pop(update);
+	/* alpha stopping point.
+	   update->iState should be ENew now.
+	 */
+	Append(update);
+	iLogReplayCurrentUpdate = update;
+	}
+
+void CApsNonNativeApplicationsUpdateList::InternalizePerformUpdateL(RReadStream& aStream, TInt& aPosition, CApsNonNativeApplicationsUpdate::TLogUpdateType aType, TUid aUid)
+	{
+	if(iLogReplayCurrentUpdate == NULL || iLogReplayCurrentUpdate->iState != CApsNonNativeApplicationsUpdate::ENew)
+		{
+		User::Leave(KErrCorrupt);
+		}
+	if(iLogReplayCurrentUpdate->Uid() != aUid || iLogReplayCurrentUpdate->iType != aType)
+		{
+		User::Leave(KErrCorrupt);
+		}
+	/*
+	 tell the update to read in its log
+	 */
+	iLogReplayCurrentUpdate->InternalizePerformUpdateL(aStream, aPosition);
+	// the function above will return iff EEndOfUpdate is reached
+	}
+
+
+void CApsNonNativeApplicationsUpdateList::InternalizeRollbackUpdateL(RReadStream& aStream, TInt& aPosition, CApsNonNativeApplicationsUpdate::TLogUpdateType aType, TUid aUid)
+	{
+	if(iLogReplayCurrentUpdate == NULL)
+		{
+		User::Leave(KErrCorrupt);
+		}
+	if( iLogReplayCurrentUpdate->iState != CApsNonNativeApplicationsUpdate::EPerforming
+	 && iLogReplayCurrentUpdate->iState != CApsNonNativeApplicationsUpdate::EPerformed
+	 && iLogReplayCurrentUpdate->iState != CApsNonNativeApplicationsUpdate::ERollingBack)
+		{
+		User::Leave(KErrCorrupt);
+		}
+	if(iLogReplayCurrentUpdate->iType != aType || iLogReplayCurrentUpdate->Uid() != aUid)
+		{
+		User::Leave(KErrCorrupt);
+		}
+	
+	iLogReplayCurrentUpdate->InternalizeRollbackUpdateL(aStream, aPosition);
+	// the function above will return iff EEndOfUpdate is reached
+
+	if(iLogReplayCurrentUpdate->iState == CApsNonNativeApplicationsUpdate::ERolledBack)
+		{
+		iLogReplayCurrentUpdate = iLogReplayCurrentUpdate->Previous();
+		}
+	}
+
+void CApsNonNativeApplicationsUpdateList::Append(CApsNonNativeApplicationsUpdate* aUpdate)
+	{
+	if(iUpdateListHead == NULL)
+		{
+		iUpdateListHead = aUpdate;
+		return;
+		}
+
+	CApsNonNativeApplicationsUpdate* update = iUpdateListHead;
+	while(update->iNext != NULL)
+		{
+		update = update->iNext;
+		}
+	update->iNext = aUpdate;
+	aUpdate->iPrevious = update;
+	}
+
+void CApsNonNativeApplicationsUpdateList::ExecuteL()
+	{
+	RApsUpdateLog updateLog(iFs);
+	updateLog.OpenL();
+	CleanupClosePushL(updateLog);
+	CApsNonNativeApplicationsUpdate* update = iUpdateListHead;
+	while(update != NULL)
+		{
+		TRAPD(err,update->PerformUpdateL(updateLog));
+		if(err == KErrNone)
+			{
+			update = update->Next();
+			}
+		else
+			{
+			// call rollback on everything, including the one that failed
+			// since it may have to clean up half-finished stuff
+			Rollback(update, updateLog);
+			User::Leave(err);
+			}
+		}
+	CleanupStack::PopAndDestroy(&updateLog);
+	}
+
+void CApsNonNativeApplicationsUpdateList::Rollback(CApsNonNativeApplicationsUpdate* aStartPoint, RApsUpdateLog& aUpdateLog)
+	{
+	CApsNonNativeApplicationsUpdate* update = aStartPoint;
+
+	while(update != NULL)
+		{
+		TRAP_IGNORE(update->RollbackUpdateL(aUpdateLog));
+		update = update->Previous();
+		}
+	}
+
+/**
+@internalComponent
+*/
+RApsUpdateLog::RApsUpdateLog(RFs& aFs) :
+		iFs(aFs)
+	{
+	TChar drive = RFs::GetSystemDriveChar();
+	iLogFileName.Append(drive);
+	iLogFileName.Append(KNonNativeApplicationsUpdateLog);
+	}
+
+/**
+RApsUpdateLog::OpenL
+
+Opens a write stream to a log file that keeps track of what updates have been performed.
+
+@internalComponent
+*/
+void RApsUpdateLog::OpenL()
+	{
+	User::LeaveIfError(iLogWriteStream.Replace(iFs,iLogFileName,EFileShareExclusive|EFileStream|EFileWrite));
+	}
+
+/**
+RApsUpdateLog::Open
+
+Opens a write stream to a log file that keeps track of what updates have been performed.
+
+@internalComponent
+*/
+void RApsUpdateLog::Open(RFile& aFile, TUint aSeekPos)
+	{
+	iLogWriteStream.Attach(aFile, aSeekPos);
+	}
+
+/**
+RApsUpdateLog::Close
+
+Cleans up the list of new Registration files created during this set of updates
+and deletes the log files created.
+
+@internalComponent
+*/
+void RApsUpdateLog::Close()
+	{
+	_LIT(KLitPathForTemporaryFiles, "\\private\\10003a3f\\temp\\");
+	const TInt count = iDrivesAffected.Count();
+	CFileMan* fileman = NULL;
+	TRAPD(err, fileman = CFileMan::NewL(iFs));
+	if (err == KErrNone) 
+		{
+		for(TInt i = 0; i < count; ++i)
+			{
+			TFileName dir(*(iDrivesAffected[i]));
+			dir.Append(KLitPathForTemporaryNonNativeResourceAndIconFiles);
+			fileman->RmDir(dir); // recursive
+			iFs.RmDir(KLitPathForTemporaryFiles); // non-recursive
+			}
+		delete fileman;
+		}
+	
+	iFilesRegistered.ResetAndDestroy();
+	iDrivesAffected.ResetAndDestroy();
+	iLogWriteStream.Close();
+	iFs.Delete(iLogFileName);
+	}
+
+
+/**
+CApsNonNativeApplicationsUpdateList::RApsUpdateLog holds a list of registration files that have
+been written during this transaction. This list is used by the Deregistration
+command as the forced-updates list.
+
+This stops them from being incorrectly hidden from the scan performed to find
+the registration file to delete.
+
+@internalComponent
+*/
+RPointerArray<HBufC>& RApsUpdateLog::NewRegistrationFiles()
+	{
+	return iFilesRegistered;
+	}
+
+
+/**
+CApsNonNativeApplicationsUpdateList::RApsUpdateLog holds a list of drives that have been used
+in the transaction. This is then used to clean up the temporary file directories
+
+@internalComponent
+*/
+RPointerArray<HBufC>& RApsUpdateLog::DrivesAffected()
+	{
+	return iDrivesAffected;
+	}
+
+/**
+Returns the stream that updates should write their recovery log data to
+@internalComponent
+*/
+RWriteStream& RApsUpdateLog::LogWriteStream()
+	{
+	return iLogWriteStream;
+	}
+
+/**************************************************************************************************************
+ * CApsNonNativeApplicationsManager
+ **************************************************************************************************************/
+
+void CApsNonNativeApplicationsManager::NotifyScanComplete()
+	{
+	//See if the session is intrested in scan complete notification.
+	if (!iNotifyOnScanCompleteMsg.IsNull())
+		{
+		iNotifyOnScanCompleteMsg.Complete(KErrNone);
+		}
+	} //lint !e1762 Suppress member function could be made const
+
+
+CApsNonNativeApplicationsManager* CApsNonNativeApplicationsManager::NewL(CApaAppListServer& aServ, RFs& aFs)
+	{
+	CApsNonNativeApplicationsManager* self = new(ELeave)CApsNonNativeApplicationsManager(aServ, aFs);
+	return self;
+	}
+
+CApsNonNativeApplicationsManager::~CApsNonNativeApplicationsManager()
+	{
+	delete iUpdateList;
+	}
+
+CApsNonNativeApplicationsManager::CApsNonNativeApplicationsManager(CApaAppListServer& aServ, RFs& aFs) :
+		iServ(aServ),
+		iFs(aFs)
+	{
+	}
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+void CApsNonNativeApplicationsManager::PrepareNonNativeApplicationsUpdatesL()
+	{
+	if (iServ.AppList().AppScanInProgress())
+		{
+		iServ.AppList().StopScan(ETrue); //Stop updating applist now, we anyways have to update it when we are commiting these changes
+		}
+	if (iNonNativeApplicationsUpdateAppsLock) 
+		{
+		User::Leave(KErrInUse);
+		}
+
+	ASSERT(iUpdateList == NULL);
+	
+	iUpdateList = CApsNonNativeApplicationsUpdateList::NewL(iFs);
+	iNonNativeApplicationsUpdateAppsLock = ETrue;
+	}
+
+
+void CApsNonNativeApplicationsManager::CheckForUpdateAppsLockL()
+	{
+	if (!iNonNativeApplicationsUpdateAppsLock)
+		{
+		// PrepareNonNativeApplicationsUpdatesL hasn't been called successfully
+		User::Leave(KErrNotReady);
+		}	
+	}
+
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+ void CApsNonNativeApplicationsManager::RegisterNonNativeApplicationL(const RMessage2& aMessage)
+	{
+	CheckForUpdateAppsLockL();
+	CleanupStack::PushL(TCleanupItem(&StaticAbortNonNativeApplicationsUpdates,this));
+	DoRegisterNonNativeApplicationL(aMessage);
+	CleanupStack::Pop(this);
+	}
+
+
+void CApsNonNativeApplicationsManager::DoRegisterNonNativeApplicationL(const RMessage2& aMessage)
+	{
+	// an RBuf for creating the file names in.
+	// create it here so it's below ipcParameter0 on the cleanup stack
+	RBuf target;
+	CleanupClosePushL(target);
+
+	// read in the resource file from aMessage
+	RBuf8 ipcParameter0(HBufC8::NewL(aMessage.GetDesLengthL(0)));
+	CleanupClosePushL(ipcParameter0);
+	aMessage.ReadL(0, ipcParameter0);
+	if (ipcParameter0.Length()<=sizeof(SNonNativeApplicationInfo)+sizeof(TCheckedUid))
+		{
+		User::Leave(KErrArgument);
+		}
+
+	// get drivename
+	const SNonNativeApplicationInfo nonNativeApplicationInfo = *reinterpret_cast<const SNonNativeApplicationInfo*>(ipcParameter0.Ptr());
+	TDriveName driveName = TDriveUnit(nonNativeApplicationInfo.iDrive).Name();
+
+	// get uid
+	const TUid applicationUid(TCheckedUid(ipcParameter0.Mid(sizeof(SNonNativeApplicationInfo), sizeof(TCheckedUid))).UidType()[2]);
+	if (applicationUid==TUid::Null())
+		{
+		User::Leave(KErrArgument);
+		}
+
+	// construct resource file name
+	target.CreateL(driveName, KMaxFileName);
+	target.Append(KLitPathForNonNativeResourceAndIconFiles);
+	const TInt startOfFileName=target.Length(); // take note of this so we can chop off the file name later
+	target.AppendFormat(KLitFormatForRegistrationResourceFile, applicationUid.iUid);
+
+	// prepare registrationResourceFileDataPrefix
+	const TUidType uidPrefix(TUid::Uid(KUidPrefixedNonNativeRegistrationResourceFile), nonNativeApplicationInfo.iApplicationType, applicationUid);
+	const TBufC8<sizeof(TCheckedUid)> registrationResourceFileDataPrefix(TCheckedUid(uidPrefix).Des());
+
+	// create the object that will actually perform the update
+	CApsRegisterNonNativeApplication* updateObject = CApsRegisterNonNativeApplication::NewL(iFs, applicationUid, driveName);
+	CleanupStack::PushL(updateObject);
+
+	// write resource file to temp location
+	updateObject->SetResourceFileTargetLocation(target);
+	updateObject->WriteResourceFileL(ipcParameter0.Mid(sizeof(SNonNativeApplicationInfo)), &registrationResourceFileDataPrefix);
+	
+	if (aMessage.Int1()!=0) // if there is a localisable resource-file
+		{
+		RBuf8 ipcParameter1(HBufC8::NewL(User::LeaveIfError(aMessage.GetDesLength(1))));
+		CleanupClosePushL(ipcParameter1);
+		aMessage.ReadL(1, ipcParameter1);
+		
+		// construct localisable resoure file name
+		target.SetLength(startOfFileName);
+		target.AppendFormat(KLitFormatForLocalisableResourceFile, applicationUid.iUid);
+
+		updateObject->SetLocalisableResourceFileTargetLocation(target);
+		// write localisable resource file to temp location
+		updateObject->WriteLocalisableResourceFileL(ipcParameter1, NULL);
+		CleanupStack::PopAndDestroy(&ipcParameter1);
+
+		if (aMessage.Int2()!=0) // if there is an icon-file
+			{
+			RFile iconFile;
+			CleanupClosePushL(iconFile);
+			User::LeaveIfError(iconFile.AdoptFromClient(aMessage, 2, 3));
+			RBuf iconFileName;
+			CleanupClosePushL(iconFileName);
+			iconFileName.CreateL(KMaxFileName);
+			User::LeaveIfError(iconFile.Name(iconFileName));
+
+			if (startOfFileName+iconFileName.Length()>KMaxFileName)
+				{
+				User::Leave(KErrArgument);
+				}
+			target.SetLength(startOfFileName);
+			target.Append(iconFileName);
+			updateObject->SetIconFileTargetLocation(target);
+			updateObject->CopyIconFileL(iconFile);
+
+			CleanupStack::PopAndDestroy(2, &iconFile); // iconFileName, iconFile
+			}
+		}
+
+	CleanupStack::Pop(updateObject);
+	iUpdateList->Append(updateObject);
+
+	CleanupStack::PopAndDestroy(2, &target); // ipcParameter0, target
+	}
+
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+void CApsNonNativeApplicationsManager::DeregisterNonNativeApplicationL(const RMessage2& aMessage)
+	{
+	CheckForUpdateAppsLockL();
+	CleanupStack::PushL(TCleanupItem(&StaticAbortNonNativeApplicationsUpdates,this));
+	const TUid applicationUid(TUid::Uid(aMessage.Int0()));
+	iUpdateList->Append(CApsDeregisterNonNativeApplication::NewL(iFs, iServ, applicationUid));
+	CleanupStack::Pop(this);
+	}
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#ifdef _DEBUG
+void CApsNonNativeApplicationsManager::ForceFailInNonNativeApplicationsUpdatesL()
+	{
+	CheckForUpdateAppsLockL();
+	CleanupStack::PushL(TCleanupItem(&StaticAbortNonNativeApplicationsUpdates,this));
+	iUpdateList->Append(new(ELeave) CApsAlwaysFailUpdate(iFs));
+	CleanupStack::Pop(this);
+	}
+
+void CApsNonNativeApplicationsManager::ForcePanicInNonNativeApplicationsUpdatesL()
+	{
+	CheckForUpdateAppsLockL();
+	CleanupStack::PushL(TCleanupItem(&StaticAbortNonNativeApplicationsUpdates,this));
+	iUpdateList->Append(new(ELeave) CApsAlwaysPanicUpdate(iFs));
+	CleanupStack::Pop(this);
+	}
+
+void CApsNonNativeApplicationsManager::ForcePanicInNonNativeApplicationsRollbackL()
+	{
+	CheckForUpdateAppsLockL();
+	CleanupStack::PushL(TCleanupItem(&StaticAbortNonNativeApplicationsUpdates,this));
+	iUpdateList->Append(new(ELeave) CApsAlwaysPanicOnRollbackUpdate(iFs));
+	CleanupStack::Pop(this);
+	}
+
+#endif // _DEBUG
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+void CApsNonNativeApplicationsManager::CommitNonNativeApplicationsUpdatesL(const RMessage2& aMessage)
+	{
+	CheckForUpdateAppsLockL();
+
+	TRAPD(err,iUpdateList->ExecuteL());
+
+	// Failure or success, we can't be hanging on to the lock after this function completes
+	delete iUpdateList;
+	iUpdateList = NULL;
+	iNonNativeApplicationsUpdateAppsLock = EFalse;
+	
+	if (KErrNone != err)
+		{
+		if(iServ.AppList().AppListUpdatePending())
+			{
+			// Trigger a rescan
+			iServ.UpdateApps();	
+			}
+		User::Leave(err); // bail out at this point if things didn't go to plan
+		}
+	
+	if(aMessage.Int0()==(TInt) ETrue)	
+		//The request is completed without waiting till completion application list preparation. 
+		aMessage.Complete(KErrNone); 
+	else	
+		//The request is not completed till completion application list preparation.		
+		iNotifyOnScanCompleteMsg=aMessage;
+	
+	// Trigger a rescan
+	iServ.UpdateApps();
+	}
+
+/**
+This function has the word "Rollback" in it because it used to actually roll back the
+updates that had been preformed but whose effects were hidden from the public APIs until commit.
+
+The real updates no longer happen until commit-time, so there's no real rolling back to be done here.
+The real rolling back is done automatically by iUpdateList, during the commit call, if neccessary.
+*/
+void CApsNonNativeApplicationsManager::RollbackNonNativeApplicationsUpdates()
+	{
+	AbortNonNativeApplicationsUpdates();
+	}
+
+void CApsNonNativeApplicationsManager::AbortNonNativeApplicationsUpdates()
+	{
+	if (!iNonNativeApplicationsUpdateAppsLock)
+		{
+		// It is always ok to call this function but if we haven't called PrepareNonNativeApplicationsUpdatesL()
+		// there isn't anything to do
+		return;
+		}
+	if(iServ.AppList().AppListUpdatePending())
+		{
+		// Trigger a rescan
+		iServ.UpdateApps();	
+		}
+	delete iUpdateList;
+	iUpdateList = NULL;
+	iNonNativeApplicationsUpdateAppsLock = EFalse;
+	}
+
+void CApsNonNativeApplicationsManager::StaticAbortNonNativeApplicationsUpdates(TAny* aSelf)
+	{
+	static_cast<CApsNonNativeApplicationsManager*>(aSelf)->AbortNonNativeApplicationsUpdates();
+	}
+
+void CApsNonNativeApplicationsManager::RecoverFromUpdateLogL(RFs& aFs)
+	{
+	TChar drive = RFs::GetSystemDriveChar();
+	TFileName logPath;
+	logPath.Append(drive);
+	logPath.Append(KNonNativeApplicationsUpdateLog);
+	RFile logFile;
+	TInt err = logFile.Open(aFs,logPath,EFileShareExclusive|EFileStream|EFileWrite);
+	if(err == KErrNotFound || err == KErrPathNotFound)
+		{
+		// no log file, nothing to do.
+		return;
+		}
+	User::LeaveIfError(err);
+	// this function takes over ownership of logFile
+	TRAP(err,CApsNonNativeApplicationsUpdateList::RecoverFromUpdateLogL(aFs, logFile));
+	if(err != KErrNone)
+		{
+		// there's nothing we can do, just delete it and move on
+		aFs.Delete(logPath);
+		}
+	
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apserv/apsnnapps.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,218 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef APSNNAPPS_H
+#define APSNNAPPS_H
+
+#include <e32base.h>
+#include <f32file.h>
+#include <s32file.h>
+
+#include "apsnnappupdates.h"
+
+// classes referenced
+class CApaAppListServer;
+class CApsNonNativeApplicationsUpdateList;
+
+_LIT(KLitPathForTemporaryNonNativeResourceAndIconFiles, "\\private\\10003a3f\\temp\\NonNativeUpdates\\");
+
+/**
+@internalComponent
+*/
+NONSHARABLE_CLASS(CApsNonNativeApplicationsManager) : public CBase
+	{
+public:
+	static CApsNonNativeApplicationsManager* NewL(CApaAppListServer& aServ, RFs& aFs);
+	~CApsNonNativeApplicationsManager();
+
+private:
+	CApsNonNativeApplicationsManager(CApaAppListServer& aServ, RFs& aFs);
+
+public:
+	void NotifyScanComplete();
+	void PrepareNonNativeApplicationsUpdatesL();
+	void RegisterNonNativeApplicationL(const RMessage2& aMessage);
+	void DeregisterNonNativeApplicationL(const RMessage2& aMessage);
+#ifdef _DEBUG
+	void ForceFailInNonNativeApplicationsUpdatesL();
+	void ForcePanicInNonNativeApplicationsUpdatesL();
+	void ForcePanicInNonNativeApplicationsRollbackL();
+#endif
+	void CommitNonNativeApplicationsUpdatesL(const RMessage2& aMessage);
+	void RollbackNonNativeApplicationsUpdates();
+	static void RecoverFromUpdateLogL(RFs& aFs);
+
+private:
+	void DoRegisterNonNativeApplicationL(const RMessage2& aMessage);
+	void AbortNonNativeApplicationsUpdates();
+	static void StaticAbortNonNativeApplicationsUpdates(TAny* aSelf);
+	void CheckForUpdateAppsLockL();
+
+private:
+	CApaAppListServer& iServ;
+	RFs& iFs;
+	RMessage2 iNotifyOnScanCompleteMsg;
+	TBool iNonNativeApplicationsUpdateAppsLock;
+	CApsNonNativeApplicationsUpdateList* iUpdateList;
+	};
+
+class RApsUpdateLog;
+
+/**
+This class holds a list of updates to the non-native apps registry that should
+be performed as one transaction, along with code to execute / rollback the updates.
+
+
+
+Update list structure:
+
+These are the possible valid types of list:
+(* means "can occur 0 or more times", ? means "can occur 0 or 1 times")
+
+EPerformed*, EPerforming?, ENew*
+EPerformed*, ERollingBack?, ERolledBack*, ENew*
+
+The list can be destructed in any of these states:
+
+EPerformed*, ERolledBack*, ENew*
+
+@internalComponent
+*/
+NONSHARABLE_CLASS(CApsNonNativeApplicationsUpdateList) : public CBase
+	{
+public:
+	static CApsNonNativeApplicationsUpdateList* NewL(RFs& aFs);
+	static void RecoverFromUpdateLogL(RFs& aFs, RFile& aFile);
+	~CApsNonNativeApplicationsUpdateList();
+
+private:
+	CApsNonNativeApplicationsUpdateList(RFs& aFs);
+	void RecoverFromUpdateLogL(RFile& aFile);
+
+public:
+	void Append(CApsNonNativeApplicationsUpdate* aUpdate);
+	void ExecuteL();
+
+private:
+	void Rollback(CApsNonNativeApplicationsUpdate* aStartPoint, RApsUpdateLog& aUpdateLog);
+	void SetLogWriteStream(RWriteStream* aStream);
+	void InternalizeL(RReadStream& aStream, TInt& aPosition);
+	void InternalizeActionL(RReadStream& aStream, int& aPosition);
+	void InternalizeNewUpdateL(RReadStream& aStream, TInt& aPosition, CApsNonNativeApplicationsUpdate::TLogUpdateType aType, TUid aUid);
+	void InternalizePerformUpdateL(RReadStream& aStream, TInt& aPosition, CApsNonNativeApplicationsUpdate::TLogUpdateType aType, TUid aUid);
+	void InternalizeRollbackUpdateL(RReadStream& aStream, TInt& aPosition, CApsNonNativeApplicationsUpdate::TLogUpdateType aType, TUid aUid);
+
+private:
+	RFs& iFs;
+	CApsNonNativeApplicationsUpdate* iUpdateListHead;
+	CApsNonNativeApplicationsUpdate* iLogReplayCurrentUpdate;
+	TBool iEEndOfUpdateRequiredToFixLog; // for recovering from the log. This is ETrue if we've reached a beta stopping point.
+	};
+
+
+/*
+This class opens & owns the recovery log file
+
+Recovery log structure:
+
+As updates are performed, they are written to a log. The log's format on disk is documented here.
+
+When we read the log in, there are certain points that are considered to be "valid stopping points"
+These points are at the end of every useful section of data. When we keep track of the stream-position
+during internalization, we make sure that the position we record is always at one of these points, never
+between them.
+This means that we can then truncate the log to the last of these points and then append new operations to the
+log.
+There are two types of stopping points, i've called them alpha and beta. At an alpha stopping point we
+can start appending new operations to the log immediately. At a beta stopping point, we must append a
+EEndOfUpdate marker first.
+
+
+These points are denoted in the structure below with "--- stopping point ---"
+
+LogStructure =
+{
+	(NewUpdateSection,
+	PerformUpdateSection)*
+	RollbackUpdateSection*
+}
+
+NewUpdateSection = 
+{
+	Int8  ENewUpdate
+	Int8  TLogUpdateType
+	Int32 TUid
+	... dependent on update type ...
+	--- alpha stopping point ---
+}
+
+PerformUpdateSection =
+{
+	Int8  EPerformUpdate
+	Int8  TLogUpdateType
+	Int32 TUid
+	--- beta stopping point ---
+	(UpdateContinuationSection | UpdateStateChangeSection)*
+	Int8  EEndOfUpdate
+	--- alpha stopping point ---
+}
+
+RollbackUpdateSection =
+{
+	Int8  ERollbackUpdate
+	Int8  TLogUpdateType
+	Int32 TUid
+	--- beta stopping point ---
+	(UpdateContinuationSection | UpdateStateChangeSection)*
+	Int8  EEndOfUpdate
+	--- alpha stopping point ---
+}
+
+UpdateContinuationSection =
+{
+	Int8 EUpdateContinuation
+	... dependent on update type ...
+	--- beta stopping point ---
+}
+
+UpdateStateChangeSection =
+{
+	Int8 EChangeOfUpdateState
+	Int8 TState
+	--- beta stopping point ---
+}
+
+@internalComponent
+*/
+NONSHARABLE_CLASS(RApsUpdateLog) 
+	{
+public:
+	RApsUpdateLog(RFs& aFs);
+	void OpenL();
+	void Open(RFile& aFile, TUint aSeekPos);
+	void Close();
+	RPointerArray<HBufC>& NewRegistrationFiles();
+	RPointerArray<HBufC>& DrivesAffected();
+	RWriteStream& LogWriteStream();
+private:
+	RFs& iFs;
+	// RPointerArray neccessary for use with CApaAppRegFinder
+	RPointerArray<HBufC> iFilesRegistered;
+	RPointerArray<HBufC> iDrivesAffected;
+	RFileWriteStream iLogWriteStream;
+	TFileName iLogFileName;
+	};
+
+#endif // APSNNAPPS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apserv/apsnnappupdates.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1276 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Non-Native application registration functionality for the AppArc server session
+// 
+//
+
+
+#include "apsnnappupdates.h"
+
+#include <bautils.h>
+#include <f32file.h>
+#include <s32file.h>
+
+#include "APAID.H"
+#include "APGAPLST.H"
+#include "APSSERV.H"
+#include "APSSTD.H"
+#include "../apfile/aprfndr.h"
+#include "../apgrfx/apprivate.h"
+#include "apsnnapps.h"
+
+
+/**************************************************************************************************************
+ * TFilePositionReset
+ **************************************************************************************************************/
+
+/**
+This class is used to ensure that a RFile's read/write position is reset to its original value
+if a leave occurs.
+
+@internalComponent
+*/
+NONSHARABLE_CLASS(TFilePositionReset)
+	{
+public:
+	TFilePositionReset(RFile& aFile) :
+	 		iFile(aFile),
+ 			iOriginalFilePosition(-1)
+ 		{
+	 	}
+
+	void RewindToStartLC()
+		{
+		TInt originalFilePosition=0;
+		User::LeaveIfError(iFile.Seek(ESeekCurrent, originalFilePosition)); // retrieves the current file-position
+		TInt newFilePosition=0;
+		User::LeaveIfError(iFile.Seek(ESeekStart, newFilePosition)); // RFile::Seek(ESeekStart,..) will not modify the TInt, but needs a reference.
+		iOriginalFilePosition=originalFilePosition;
+		CleanupStack::PushL(TCleanupItem(&StaticReset, this));
+		}
+
+	TInt Reset()
+		{
+		__ASSERT_DEBUG(iOriginalFilePosition>=0, Panic(ENonNativeAppsNegativeStoredFilePosition));
+		const TInt error = iFile.Seek(ESeekStart, iOriginalFilePosition);
+		iOriginalFilePosition=-1;
+		return error;
+		}
+
+private:
+	static void StaticReset(TAny* aThis)
+		{
+		// ignore the error code from this, we can't do anything about it
+		static_cast<TFilePositionReset*>(aThis)->Reset();
+		}
+
+private:
+	RFile& iFile;
+	TInt iOriginalFilePosition;
+	};
+
+
+/**************************************************************************************************************
+ * TFileDetails
+ **************************************************************************************************************/
+
+TFileDetails::TFileDetails() :
+		iState(EStateNull) 
+	{
+	}
+
+/*
+Returns the real path, (aka the target location) of this file
+*/
+const TDesC& TFileDetails::Path()
+	{
+	__ASSERT_DEBUG(iPath != KNullDesC, Panic(ENonNativeAppsTFileDetailsPathNotSet));
+	return iPath;
+	}
+
+
+/*
+Sets the real path, (aka the target location) of this file
+*/
+void TFileDetails::SetPath(const TDesC& aPath)
+	{
+	__ASSERT_DEBUG(iPath == KNullDesC, Panic(ENonNativeAppsTFileDetailsPathAlreadySet));
+	iPath = aPath;
+	}
+
+
+/*
+Determines whether this TFileDetails has a real path set.
+If thie object doesn't have a real path set, it is assumed to not be in use
+*/
+TBool TFileDetails::Exists() const
+	{
+	return (iPath != KNullDesC);
+	}
+
+
+/*
+Releases whatever file handle is currently held, whether it is on the real file,
+temporary file, or none at all
+*/
+void TFileDetails::CloseHandle()
+	{
+	iHandle.Close();
+	}
+
+
+/*
+Opens a handle on a real file
+*/
+void TFileDetails::OpenL(RFs& aFs, const TFileName& aFileName)
+	{
+	__ASSERT_DEBUG(iState == EStateNull, Panic(ENonNativeAppsTFileDetailsOpenInBadState));
+	__ASSERT_DEBUG(iPath == KNullDesC, Panic(ENonNativeAppsTFileDetailsOpenWithRealPathSet));
+	__ASSERT_DEBUG(iTempPath == KNullDesC, Panic(ENonNativeAppsTFileDetailsOpenWithTempPathSet));
+
+	User::LeaveIfError(iHandle.Open(aFs, aFileName, EFileShareExclusive|EFileStream|EFileWrite));
+	iPath = aFileName;
+	iState = EStateReal;
+	}
+
+/*
+Creates a new, temporary file to write new data into
+Used in the preparation of a register-application update to create new resource
+and icon files before they are moved into their target locations.
+*/
+void TFileDetails::CreateTemporaryL(RFs& aFs, const TFileName& aDir)
+	{
+	__ASSERT_DEBUG(iState == EStateNull, Panic(ENonNativeAppsTFileDetailsCreateTempInBadState));
+	__ASSERT_DEBUG(iTempPath == KNullDesC, Panic(ENonNativeAppsTFileDetailsCreateTempWithTempPathSet));
+	RFile file;
+	CleanupClosePushL(file);
+	// TODO: remove this hack if/when RFile::Temp is fixed by base
+	TInt tempErr = KErrAlreadyExists;
+	/* RFile::Temp is a bit dodgy, at least on Winscw with the proxy FS */
+	for(TInt tries = 0; tempErr == KErrAlreadyExists && tries < 50; ++tries)
+		{
+		tempErr = file.Temp(aFs, aDir, iTempPath, EFileShareExclusive|EFileStream|EFileWrite);
+		}
+	User::LeaveIfError(tempErr);
+	CleanupStack::Pop(&file);
+	iHandle = file;
+	iState = EStateTemporary;
+	}
+
+/*
+Makes aFile a duplicates of the file handle owned by this class.
+Used to write to a file created by CreateTemporaryL()
+*/
+void TFileDetails::GetDuplicateHandleL(RFile& aFile)
+	{
+	User::LeaveIfError(aFile.Duplicate(iHandle));
+	}
+
+
+/*
+RenameToRealL
+
+Used to perform a register-appliction update
+This uses the same code as the non-leaving
+RenameToReal().
+*/
+void TFileDetails::RenameToRealL(RFs& aFs)
+	{
+	User::LeaveIfError(RenameToReal(aFs));
+	}
+
+/*
+RenameToReal
+
+Used by RenameToRealL() and RestoreReal()
+@see RenameToRealL
+@see RestoreReal
+*/
+TInt TFileDetails::RenameToReal(RFs& aFs)
+	{
+	__ASSERT_DEBUG(iState == EStateTemporary, Panic(ENonNativeAppsTFileDetailsRenameToRealInBadState));
+	__ASSERT_DEBUG(iTempPath != KNullDesC, Panic(ENonNativeAppsTFileDetailsRenameToRealWithoutTempPath));
+	__ASSERT_DEBUG(iPath != KNullDesC, Panic(ENonNativeAppsTFileDetailsRenameToRealWithoutRealPath));
+	TParse parse;
+	parse.SetNoWild(iPath,NULL,NULL);
+	if(!BaflUtils::FolderExists(aFs,parse.DriveAndPath())) 
+		{
+		TInt err = aFs.MkDirAll(parse.DriveAndPath());
+		if(err != KErrNone)
+			{
+			return err;
+			}
+		}
+	//Check if file already exists, if it exists delete it because we might be trying to register an upgrade
+	if(BaflUtils::FileExists(aFs, iPath))
+		{
+		TInt err = BaflUtils::DeleteFile(aFs, iPath);
+		if(KErrNone != err)
+			{
+			return err;
+			}
+		}
+	TInt err = iHandle.Rename(iPath);
+	if(err != KErrNone)
+		{
+		return err;
+		}
+	iTempPath.Zero();
+	iState = EStateReal;
+	return KErrNone;
+	}
+
+/*
+RenameToTemporaryL
+
+Used to perform a deregister-application update
+*/
+void TFileDetails::RenameToTemporaryL(RFs& aFs, const TFileName& aDir)
+	{
+	__ASSERT_DEBUG(iState == EStateReal, Panic(ENonNativeAppsTFileDetailsRenameToTempInBadState));
+	__ASSERT_DEBUG(iPath != KNullDesC, Panic(ENonNativeAppsTFileDetailsRenameToTempWithoutRealPathSet));
+	__ASSERT_DEBUG(iTempPath == KNullDesC, Panic(ENonNativeAppsTFileDetailsRenameToTempWithTempPathSet));
+	/* create a temp file and delete it to get an unused filename */
+	RFile file;
+	CleanupClosePushL(file);
+	// TODO: remove this hack if/when RFile::Temp is fixed by base
+	TInt tempErr = KErrAlreadyExists;
+	/* RFile::Temp is a bit dodgy, at least on Winscw with the proxy FS */
+	for(TInt tries = 0; tempErr == KErrAlreadyExists && tries < 50; ++tries)
+		{
+		tempErr = file.Temp(aFs, aDir, iTempPath, EFileShareExclusive|EFileStream|EFileWrite);
+		}
+	User::LeaveIfError(tempErr);
+	CleanupStack::PopAndDestroy(&file); // close the file handle
+	const TInt err = aFs.Delete(iTempPath);
+	if(err != KErrNone && err != KErrNotFound) 
+		{
+		User::Leave(err);
+		}
+
+	User::LeaveIfError(iHandle.Rename(iTempPath));
+	iState = EStateTemporary;
+	}
+
+
+/*
+Delete
+
+Whatever the state, real or temporary, delete it.
+Used in the rollback phase of a register-application update.
+
+This function releases the handle (if any) and sets the state back to EStateNull
+*/
+TInt TFileDetails::Delete(RFs& aFs)
+	{
+	__ASSERT_DEBUG(iState == EStateNull || iState == EStateReal || iState == EStateTemporary,
+			Panic(ENonNativeAppsTFileDetailsDeleteInBadState));
+	if(iState == EStateNull)
+		{
+		return KErrNone;
+		}
+
+	iHandle.Close();
+	TInt err;
+	if(iState == EStateReal)
+		{
+		err = aFs.Delete(iPath);
+		}
+	else if(iState == EStateTemporary)
+		{
+		err = aFs.Delete(iTempPath);
+		}
+	else
+		{
+		err = KErrGeneral;
+		ASSERT(EFalse);
+		}
+	iPath.Zero();
+	iTempPath.Zero();
+	iState = EStateNull;
+	return err;
+	}
+
+
+/*
+DeleteTemporary
+
+Check that the state is EStateTemporary, and delete it.
+This function is used by the destructor of a deregister-application update
+
+This function releases the handle (if any) and sets the state back to EStateNull
+*/
+TInt TFileDetails::DeleteTemporary(RFs& aFs)
+	{
+	__ASSERT_DEBUG(iState == EStateNull || iState == EStateTemporary,
+			Panic(ENonNativeAppsTFileDetailsDeleteTemporaryInBadState));
+	if(iState == EStateNull || iState == EStateTemporary)
+		{
+		return Delete(aFs);
+		}
+	return KErrGeneral;
+	}
+
+
+/*
+RestoreReal
+
+Whatever the state, real or temporary, try to move it back to the real location.
+Used in the rollback phase of a deregister-application update.
+
+This function releases the handle (if any) and sets the state back to EStateNull
+*/
+TInt TFileDetails::RestoreReal(RFs& aFs)
+	{
+	__ASSERT_DEBUG(iState == EStateNull || iState == EStateReal || iState == EStateTemporary,
+		Panic(ENonNativeAppsTFileDetailsRestoreRealInBadState));
+	if(iState == EStateNull)
+		{
+		return KErrNone;
+		}
+
+	TInt err = KErrNone;
+	if(iState == EStateReal)
+		{
+		iHandle.Close();
+		}
+	else if(iState == EStateTemporary)
+		{
+		err = RenameToReal(aFs);
+		iHandle.Close();
+		}
+	else
+		{
+		ASSERT(EFalse);
+		}
+	iPath.Zero();
+	iTempPath.Zero();
+	iState = EStateNull;
+	return err;
+	}
+
+
+void TFileDetails::ExternalizeL(RWriteStream& aStream)
+	{
+	aStream.WriteUint8L(iState);
+	aStream.WriteUint32L(iPath.Length());
+	aStream.WriteL(iPath);
+	aStream.WriteUint32L(iTempPath.Length());
+	aStream.WriteL(iTempPath);
+	}
+
+void TFileDetails::ExternalizeContinuationL(RWriteStream& aStream, TInt aTag)
+	{
+	aStream.WriteInt8L(CApsNonNativeApplicationsUpdate::EContinuationOfUpdate);
+	aStream.WriteInt8L(aTag);
+	ExternalizeL(aStream);
+	aStream.CommitL(); // beta stopping point
+	}
+
+TInt TFileDetails::ExternalizeContinuation(RWriteStream& aStream, TInt aTag)
+	{
+	TRAPD(err,ExternalizeContinuationL(aStream,aTag));
+	return err;
+	}
+
+void TFileDetails::InternalizeL(RReadStream& aStream, TInt& aPosition)
+	{
+	TState state = static_cast<TState>(aStream.ReadUint8L());
+	TUint pathLen = aStream.ReadUint32L();
+	if(pathLen > KMaxFileName)
+		{
+		User::Leave(KErrCorrupt);
+		}
+	TFileName path;
+	aStream.ReadL(path, pathLen);
+	TUint tempPathLen = aStream.ReadUint32L();
+	if(tempPathLen > KMaxFileName)
+		{
+		User::Leave(KErrCorrupt);
+		}
+	TFileName tempPath;
+	aStream.ReadL(tempPath, tempPathLen);
+
+	/* all dangerous operations are now out of the way */
+	iState = state;
+	iPath = path;
+	iTempPath = tempPath;
+	// state, length, path, length, temppath
+	aPosition += sizeof(TUint8) +  sizeof(TUint32) + (pathLen * sizeof(TText)) +  sizeof(TUint32) + (tempPathLen * sizeof(TText));
+	}
+
+/*
+Works out what file we had a handle on when the log was written, and try to regain it.
+*/	
+void TFileDetails::PostInternalizeL(RFs& aFs)
+	{
+	TInt err;
+	switch(iState)
+		{
+	case EStateNull:
+		if(iTempPath != KNullDesC)
+			{
+			User::Leave(KErrCorrupt);
+			}
+		break;
+	case EStateTemporary:
+		if(iTempPath == KNullDesC)
+			{
+			User::Leave(KErrCorrupt);
+			}
+		err = iHandle.Open(aFs, iTempPath, EFileShareExclusive|EFileStream|EFileWrite);
+		if(err == KErrNotFound || err == KErrPathNotFound)
+			{
+			iTempPath.Zero();
+			iPath.Zero();
+			iState = EStateNull;
+			}
+		else 
+			{
+			User::LeaveIfError(err);
+			}
+		break;
+	case EStateReal:
+		if(iPath == KNullDesC)
+			{
+			User::Leave(KErrCorrupt);
+			}
+		err = iHandle.Open(aFs, iPath, EFileShareExclusive|EFileStream|EFileWrite);
+		if(err == KErrNotFound || err == KErrPathNotFound)
+			{
+			iTempPath.Zero();
+			iPath.Zero();
+			iState = EStateNull;
+			}
+		else 
+			{
+			User::LeaveIfError(err);
+			}
+		break;
+	default:
+		User::Leave(KErrCorrupt);
+		break;
+		}
+	}
+
+/**************************************************************************************************************
+ * CApsNonNativeApplicationsUpdate
+ **************************************************************************************************************/
+
+CApsNonNativeApplicationsUpdate::CApsNonNativeApplicationsUpdate(RFs& aFs, TUid aUid, TState aState, TLogUpdateType aType) :
+		iState(aState),
+		iFs(aFs),
+		iType(aType),
+		iUid(aUid)
+	{
+	}
+
+CApsNonNativeApplicationsUpdate::~CApsNonNativeApplicationsUpdate()
+	{
+	}
+
+CApsNonNativeApplicationsUpdate* CApsNonNativeApplicationsUpdate::Previous() const
+	{
+	return iPrevious;
+	}
+
+CApsNonNativeApplicationsUpdate* CApsNonNativeApplicationsUpdate::Next() const
+	{
+	return iNext;
+	}
+
+TUid CApsNonNativeApplicationsUpdate::Uid() 
+	{
+	return iUid;
+	}
+
+void CApsNonNativeApplicationsUpdate::PerformUpdateL(RApsUpdateLog& aUpdateLog)
+	{
+	ASSERT(iState == ENew);
+	RWriteStream& stream = aUpdateLog.LogWriteStream();
+
+	/* NewUpdateSection */
+	stream.WriteInt8L(ENewUpdate);
+	stream.WriteInt8L(iType);
+	stream.WriteInt32L(iUid.iUid);
+	ExternalizeL(stream);
+	stream.CommitL(); // alpha stopping point
+
+	/* PerformUpdateSection */
+	stream.WriteInt8L(EPerformUpdate);
+	stream.WriteInt8L(iType);
+	stream.WriteInt32L(iUid.iUid);     // beta stopping points
+	StateChangeL(EPerforming, stream); // ...
+	DoPerformUpdateL(aUpdateLog);      // ...
+	StateChangeL(EPerformed, stream);  // ...
+	stream.WriteInt8L(EEndOfUpdate);
+	stream.CommitL();                  // alpha stopping point
+	}
+
+void CApsNonNativeApplicationsUpdate::RollbackUpdateL(RApsUpdateLog& aUpdateLog)
+	{
+	ASSERT(iState == EPerforming || iState == EPerformed || iState == ERollingBack);
+	RWriteStream& stream = aUpdateLog.LogWriteStream();
+	stream.WriteInt8L(ERollbackUpdate);
+	stream.WriteInt8L(iType);
+	stream.WriteInt32L(iUid.iUid);
+	stream.CommitL();                   // beta stopping point
+ 	// even if we're already in ERollingBack because we crashed and are reattempting it,
+ 	// it's harmless to write a duplicate statechange to the log
+	StateChangeL(ERollingBack, stream); // beta stopping points
+	DoRollbackUpdate(aUpdateLog);       // ...
+	StateChangeL(ERolledBack, stream);  // ...
+	stream.WriteInt8L(EEndOfUpdate);
+	stream.CommitL();                   // alpha stopping point
+	}
+
+TFileName CApsNonNativeApplicationsUpdate::TemporaryFilePathL(TDriveName& aDrive)
+	{
+	TFileName dir(aDrive);
+	
+	// this is safe since KMaxFileName >= (KMaxDriveName + length(KLitPathForTemporaryNonNativeResourceAndIconFiles))
+	dir.Append(KLitPathForTemporaryNonNativeResourceAndIconFiles);
+
+	if(!BaflUtils::FolderExists(iFs,dir)) 
+		{
+		User::LeaveIfError(iFs.MkDirAll(dir));
+		}	
+	return dir;
+	}
+
+void CApsNonNativeApplicationsUpdate::StateChangeL(TState aState, RWriteStream& aStream)
+	{
+	iState = aState;
+	aStream.WriteInt8L(EChangeOfUpdateState);
+	aStream.WriteInt8L(iState);
+	aStream.CommitL(); // beta stopping point
+	}
+
+void CApsNonNativeApplicationsUpdate::InternalizeStateChangeL(RReadStream& aStream, TInt& aPosition)
+	{
+	TState state = static_cast<TState>(aStream.ReadInt8L());
+	++aPosition;
+	iState = state;
+	}
+
+void CApsNonNativeApplicationsUpdate::InternalizeNewUpdateL(RReadStream& aStream, TInt& aPosition)
+	{
+	__ASSERT_DEBUG(iState == ENeedsInternalizing, Panic(ENonNativeAppsNonNativeApplicationsUpdateInternalizeNewUpdateInBadState));
+	/*
+	internalize all member variables to how they were before any updates were performed.
+	*/
+	InternalizeL(aStream, aPosition);
+	
+	iState = ENew; /* the update is now OK to add to the list */
+	}
+
+void CApsNonNativeApplicationsUpdate::InternalizePerformUpdateL(RReadStream& aStream, TInt& aPosition)
+	{
+	/*
+	internalize any state changes and update-specific continuations, until EEndOfUpdate
+	*/
+	SharedInternalizeLoopL(aStream, aPosition);
+	}
+
+void CApsNonNativeApplicationsUpdate::InternalizeRollbackUpdateL(RReadStream& aStream, TInt& aPosition)
+	{
+	/*
+	internalize any state changes and update-specific continuations, until EEndOfUpdate
+	*/
+	SharedInternalizeLoopL(aStream, aPosition);
+	}
+
+void CApsNonNativeApplicationsUpdate::SharedInternalizeLoopL(RReadStream& aStream, TInt& aPosition)
+	{
+	while (ETrue)
+		{
+		TInt pos = aPosition;
+		TLogActionType action = static_cast<TLogActionType>(aStream.ReadInt8L());
+		pos += sizeof(TInt8);
+		/* we are at a beta stopping point at the start of each loop iteration,
+		   so don't update aPosition until we have reached the end of the loop.
+		   give the funcitons a copy to stop them updating aPosition direclty and
+		   then leaving */
+		switch(action)
+			{
+		case EChangeOfUpdateState:
+			InternalizeStateChangeL(aStream, pos);
+			break;
+		case EContinuationOfUpdate:
+			InternalizeUpdateContinuationL(aStream, pos);
+			break;
+		case EEndOfUpdate:
+			aPosition = pos;
+			return;
+		default:
+			User::Leave(KErrCorrupt);
+			break;
+			}
+		aPosition = pos;
+		}
+	}
+
+/*
+ Default implemenation of a virtual function. does nothing.
+
+ In this method, subclasses should write out all important, subclass-specific data.
+ It will be called before DoPerformUpdateL.
+ */
+void CApsNonNativeApplicationsUpdate::ExternalizeL(RWriteStream& /*aStream*/)
+	{
+	}
+
+/*
+ Default implemenation of a virtual function. does nothing.
+
+ In this method, subclasses read in any subclass-specific data that was written out
+ by ExternalizeL().
+ */
+void CApsNonNativeApplicationsUpdate::InternalizeL(RReadStream& /*aStream*/, TInt& /*aPosition*/)
+	{
+	}
+
+/*
+ Default implemenation of a virtual function. does nothing.
+
+ In this method, subclasses should handle any EContinuationOfUpdate messages that
+ they might have written to the log during DoPerformUpdateL or DoRollbackUpdate
+ */
+void CApsNonNativeApplicationsUpdate::InternalizeUpdateContinuationL(RReadStream& /*aStream*/, TInt& /*aPosition*/)
+	{
+	}
+
+/*
+ Default implemenation of a virtual function. does nothing.
+
+ In this method, subclasses should do any internal initialization that is dependent on
+ data that may be changed by InternalizeUpdateContinuationL().
+ 
+ InternalizeUpdateContinuationL() may be called many times over and its implementation
+ may change the same member variable many times.
+ This function will only be called once, and it will be called after the entire log has
+ been read and InternalizeUpdateContinuationL() has been called for the last time.
+ */
+void CApsNonNativeApplicationsUpdate::PostInternalizeL()
+	{
+	}
+
+/**************************************************************************************************************
+ * CApsRegisterNonNativeApplication
+ **************************************************************************************************************/
+
+CApsRegisterNonNativeApplication* CApsRegisterNonNativeApplication::NewL(RFs& aFs, TUid aUid, const TDriveName& aDrive, TState aState)
+	{
+	return new(ELeave) CApsRegisterNonNativeApplication(aFs, aUid, aDrive, aState);
+	}
+
+CApsRegisterNonNativeApplication::CApsRegisterNonNativeApplication(RFs& aFs, TUid aUid, const TDriveName& aDrive, TState aState) :
+		CApsNonNativeApplicationsUpdate(aFs, aUid, aState, ERegisterApplication),
+		iDrive(aDrive)
+	{
+	}
+
+void CApsRegisterNonNativeApplication::SetResourceFileTargetLocation(const TDesC& aLocation)
+	{
+	iResourceFile.SetPath(aLocation);
+	}
+
+void CApsRegisterNonNativeApplication::SetLocalisableResourceFileTargetLocation(const TDesC& aLocation)
+	{
+	iLocalisableResourceFile.SetPath(aLocation);
+	}
+
+void CApsRegisterNonNativeApplication::SetIconFileTargetLocation(const TDesC& aLocation)
+	{
+	iIconFile.SetPath(aLocation);
+	}
+
+void CApsRegisterNonNativeApplication::WriteResourceFileL(const TDesC8& aData, const TDesC8* aDataPrefix) 
+	{
+	WriteResourceFileL(iResourceFile, aData, aDataPrefix);
+	}
+
+void CApsRegisterNonNativeApplication::WriteLocalisableResourceFileL(const TDesC8& aData, const TDesC8* aDataPrefix)
+	{
+	WriteResourceFileL(iLocalisableResourceFile, aData, aDataPrefix);
+	}
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+Create a new file in a designated temporary-files directory
+*/
+void CApsRegisterNonNativeApplication::NewTemporaryFileL(TFileDetails& aFile)
+	{
+	TFileName path(TemporaryFilePathL(iDrive));
+	aFile.CreateTemporaryL(iFs,path);
+	}
+
+/**
+Writes a resource file to a new temporary file
+ */
+void CApsRegisterNonNativeApplication::WriteResourceFileL(TFileDetails& aFile, const TDesC8& aData, const TDesC8* aDataPrefix)
+	{
+	// create temp file, put stuff on the cleanup stack
+	NewTemporaryFileL(aFile);
+	RFileWriteStream targetStream;
+	CleanupClosePushL(targetStream);
+
+	// the stream takes ownership of the file handle and closes it, so make a copy
+	RFile targetFile;
+	aFile.GetDuplicateHandleL(targetFile);
+	targetStream.Attach(targetFile); // will take ownership of the handle and set targetFile to a Null handle
+
+	if (aDataPrefix!=NULL)
+		{
+		targetStream.WriteL(*aDataPrefix);
+		}
+	targetStream.WriteL(aData);
+	targetStream.CommitL();
+
+	CleanupStack::PopAndDestroy(&targetStream);
+	}
+
+/**
+This function will copy the file provided to a new temporary file.
+Upon success or failure, the read/write position of aSourceFile should remain unchanged.
+ */
+void CApsRegisterNonNativeApplication::CopyIconFileL(RFile& aSourceFile)
+	{
+	NewTemporaryFileL(iIconFile);
+
+	// RFile*Stream::Attach will take ownership of the handle we give it, but we want to hold
+	// on to the handles we have. To achieve this, we give Attach a copy of the file handle,
+	// for both streams.
+	RFileWriteStream targetStream;
+	CleanupClosePushL(targetStream);
+	RFile targetFile;
+	iIconFile.GetDuplicateHandleL(targetFile);
+	targetStream.Attach(targetFile);
+
+	// rewind to start, but restore original position if a leave occurs
+	TFilePositionReset filePositionReset(aSourceFile);
+	filePositionReset.RewindToStartLC();
+
+	RFileReadStream sourceStream;
+	CleanupClosePushL(sourceStream);
+	RFile sourceFile;
+	User::LeaveIfError(sourceFile.Duplicate(aSourceFile));
+	sourceStream.Attach(sourceFile);
+
+	targetStream.WriteL(sourceStream);
+	targetStream.CommitL();
+	CleanupStack::PopAndDestroy(&sourceStream);
+
+	// perform these seperately so we can leave if Reset fails
+	CleanupStack::Pop(&filePositionReset);
+	User::LeaveIfError(filePositionReset.Reset());
+
+	CleanupStack::PopAndDestroy(&targetStream);
+	}
+
+void CApsRegisterNonNativeApplication::DoPerformUpdateL(RApsUpdateLog& aUpdateLog)
+	{
+	HBufC* hDrive = iDrive.AllocL();
+	TInt err = aUpdateLog.DrivesAffected().InsertInOrder(hDrive, TLinearOrder<HBufC>(CApaAppList::CompareStrings));
+	if(err != KErrNone)
+		{
+		delete hDrive;
+		}
+
+	if ((err != KErrNone) &&
+	    (err != KErrAlreadyExists)) // We silently ignore attempts to insert duplicates
+		{
+		User::Leave(err);
+		}
+	
+	RWriteStream& stream = aUpdateLog.LogWriteStream();
+
+	iResourceFile.RenameToRealL(iFs);
+
+	/* make a note of what's changed */
+	iResourceFile.ExternalizeContinuationL(stream, EResourceFileUpdate);
+
+	if(iLocalisableResourceFile.Exists()) 
+		{
+		iLocalisableResourceFile.RenameToRealL(iFs);
+		iResourceFile.ExternalizeContinuationL(stream, ELocalisableResourceFileUpdate);
+		}
+
+	if(iIconFile.Exists())
+		{
+		iIconFile.RenameToRealL(iFs);
+		iResourceFile.ExternalizeContinuationL(stream, EIconFileUpdate);
+		}
+	
+	HBufC* hPath = iResourceFile.Path().AllocL();
+	err = aUpdateLog.NewRegistrationFiles().InsertInOrder(hPath, TLinearOrder<HBufC>(CApaAppList::CompareStrings));
+	if(err != KErrNone)
+		{
+		delete hPath;
+		}
+	
+	if ((err != KErrNone) &&
+	    (err != KErrAlreadyExists)) // We silently ignore attempts to insert duplicates
+		{
+		User::Leave(err);
+		}
+	}
+
+void CApsRegisterNonNativeApplication::DoRollbackUpdate(RApsUpdateLog& aUpdateLog)
+	{
+	RWriteStream& stream = aUpdateLog.LogWriteStream();
+
+	/* TFileDetails::Delete() is safe to call whatever state the object is in.
+
+	   if it was never opened, it'll do nothing, otherwise it'll delete whichever
+	   file (real/temp) it has a handle on.
+	
+	   ignore the return codes since we can't do anything about it if they fail */
+	iResourceFile.Delete(iFs);
+	iResourceFile.ExternalizeContinuation(stream, EResourceFileUpdate);
+
+	iLocalisableResourceFile.Delete(iFs);
+	iResourceFile.ExternalizeContinuation(stream, ELocalisableResourceFileUpdate);
+
+	iIconFile.Delete(iFs);
+	iResourceFile.ExternalizeContinuation(stream, EIconFileUpdate);
+	}
+
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+void CApsRegisterNonNativeApplication::ExternalizeL(RWriteStream& aStream)
+	{
+	/* write our initial state to the log stream */
+	aStream.WriteUint32L(iDrive.Length());
+	aStream.WriteL(iDrive);
+	iResourceFile.ExternalizeL(aStream);
+	iLocalisableResourceFile.ExternalizeL(aStream);
+	iIconFile.ExternalizeL(aStream);
+	}
+
+void CApsRegisterNonNativeApplication::InternalizeL(RReadStream& aStream, TInt& aPosition)
+	{
+	// we can update aPosition whenever we like in this function since we're protected
+	// from it being left at a bad value by the copy taken by CApsNonNativeApplicationsUpdateList::InternalizeActionL
+	TUint driveLen = aStream.ReadUint32L();
+	aPosition += sizeof(TUint32);
+	if(driveLen > KMaxDriveName)
+		{
+		User::Leave(KErrCorrupt);
+		}
+	iDrive.Zero();
+	aStream.ReadL(iDrive, driveLen);
+	aPosition += driveLen * sizeof(TText);
+
+	iResourceFile.InternalizeL(aStream, aPosition);
+	iLocalisableResourceFile.InternalizeL(aStream, aPosition);
+	iIconFile.InternalizeL(aStream, aPosition);
+	}
+	
+void CApsRegisterNonNativeApplication::InternalizeUpdateContinuationL(RReadStream& aStream, TInt& aPosition)
+	{
+	// we can update aPosition whenever we like in this function since we're protected
+	// from it being left at a bad value by the copy taken by CApsNonNativeApplicationsUpdate::SharedInternalizeLoopL
+
+	TLogContinuationType type = static_cast<TLogContinuationType>(aStream.ReadInt8L());
+	aPosition += sizeof(TInt8);
+
+	switch(type)
+		{
+	case EResourceFileUpdate:
+		iResourceFile.InternalizeL(aStream, aPosition);
+		break;
+	case ELocalisableResourceFileUpdate:
+		iLocalisableResourceFile.InternalizeL(aStream, aPosition);
+		break;
+	case EIconFileUpdate:
+		iIconFile.InternalizeL(aStream, aPosition);
+		break;
+	default:
+		User::Leave(KErrCorrupt);
+		break;
+		}
+	}
+
+void CApsRegisterNonNativeApplication::PostInternalizeL()
+	{
+	iResourceFile.PostInternalizeL(iFs);
+	iLocalisableResourceFile.PostInternalizeL(iFs);
+	iIconFile.PostInternalizeL(iFs);
+	}
+	
+CApsRegisterNonNativeApplication::~CApsRegisterNonNativeApplication()
+	{
+	/*
+	if we performed the update successfully, just close the handles and leave
+	the reg files in place.
+
+	in all other cases, just delete everything that still exists
+	 */
+	if(iState == EPerformed) 
+		{
+		iResourceFile.CloseHandle();
+		iLocalisableResourceFile.CloseHandle();
+		iIconFile.CloseHandle();
+		}
+	else
+		{
+		iResourceFile.Delete(iFs);
+		iLocalisableResourceFile.Delete(iFs);
+		iIconFile.Delete(iFs);
+		}
+	}
+
+
+/**************************************************************************************************************
+ * CApsDeregisterNonNativeApplication
+ **************************************************************************************************************/
+
+CApsDeregisterNonNativeApplication* CApsDeregisterNonNativeApplication::NewL(RFs& aFs, CApaAppListServer& aServ, TUid aUid, TState aState)
+	{
+	return new(ELeave)CApsDeregisterNonNativeApplication(aFs, aServ, aUid, aState);
+	}
+
+CApsDeregisterNonNativeApplication::CApsDeregisterNonNativeApplication(RFs& aFs, CApaAppListServer& aServ, TUid aUid, TState aState) :
+		CApsNonNativeApplicationsUpdate(aFs, aUid, aState, EDeregisterApplication),
+		iServ(aServ)
+	{
+	}
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+
+CApaAppData* CApsDeregisterNonNativeApplication::FindAppDataLC(RApsUpdateLog& aUpdateLog)
+	{
+	/* search back through the list for a an update concerning the same Uid */
+	CApsNonNativeApplicationsUpdate* prev = Previous();
+	while(prev != NULL)
+		{
+		if(prev->Uid() == Uid())
+			break;
+		prev = prev->Previous();
+		}
+
+	/* if none found, use apparc's app list as a shortcut */
+	CApaAppData* appData = NULL;
+	if(prev == NULL)
+		{
+		appData = iServ.AppList().AppDataByUid(Uid());
+
+		if(appData != NULL) 
+			{
+			// create a new AppData so we can put it on the cleanup stack.
+			// if the NewL fails for whatever reson, fall back to the search code below
+
+			// this is a bit tricky because we need to create the appdata from a
+			// TApaAppEntry for the reg file, but using appData->AppEntry() will give us
+			// one for the dll.
+			TApaAppEntry entry;
+			entry.iFullName = appData->RegistrationFileName();
+			TEntry fsEntry;
+
+			User::LeaveIfError(iFs.Entry(entry.iFullName,fsEntry));
+			entry.iUidType = fsEntry.iType;
+
+			appData = NULL;
+			#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+ 				TRAP_IGNORE(appData = CApaAppData::NewL(entry,iFs));
+ 			#else
+ 				{
+ 				// find the default icons (.mbm file) for applications, wrt current locale
+ 				TFileName* tempFileName = NULL;
+ 				tempFileName->Append(KDefaultAppIconMbm);
+ 				BaflUtils::NearestLanguageFile(iFs, *tempFileName); 
+ 				HBufC* defaultAppIcon = tempFileName->AllocL();
+ 				TRAP_IGNORE(appData = CApaAppData::NewL(entry,iFs,*defaultAppIcon));
+ 				}
+ 			#endif //SYMBIAN_APPARC_APPINFO_CACHE
+			if(appData != NULL)
+				{
+				CleanupStack::PushL(appData);
+				return appData;
+				}
+			}
+		}
+
+	/*
+	 * If the appData wasn't found or we can't trust the app list because of previous updates,
+	 * attempt to find and load the appData manually
+	 */
+	CApaAppRegFinder* regFinder = CApaAppRegFinder::NewLC(iFs);
+	TBool found = EFalse;
+	TApaAppEntry appEntry;
+
+	regFinder->FindAllAppsL();
+	RPointerArray<HBufC>& forcedRegs = aUpdateLog.NewRegistrationFiles();
+
+	while(regFinder->NextL(appEntry,forcedRegs))
+		{
+		if (appEntry.iUidType[2] == Uid())
+			{
+			found = ETrue;
+			break;
+			}
+		}
+	CleanupStack::PopAndDestroy(regFinder);
+
+	if(found)
+		{
+		#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+ 			appData = CApaAppData::NewL(appEntry, iFs);
+ 		#else
+			{
+ 			// find the default icons (.mbm file) for applications, wrt current locale
+ 			TFileName* tempFileName = NULL;
+ 			tempFileName->Append(KDefaultAppIconMbm);
+ 			BaflUtils::NearestLanguageFile(iFs, *tempFileName); 
+ 			HBufC* defaultAppIcon = tempFileName->AllocL();
+ 			appData = CApaAppData::NewL(appEntry, iFs,*defaultAppIcon);	
+ 			}
+ 		#endif //SYMBIAN_APPARC_APPINFO_CACHE 
+		CleanupStack::PushL(appData);
+		return appData;
+		}
+
+	CleanupStack::PushL(static_cast<CApaAppData*>(NULL));
+	return NULL;
+	}
+		
+void CApsDeregisterNonNativeApplication::RenameToTemporaryL(TFileDetails& aFile, RApsUpdateLog& aUpdateLog)
+	{
+	/* get the drive */
+	TParse parse;
+	parse.SetNoWild(aFile.Path(), NULL, NULL);
+	if(!parse.DrivePresent())
+		{
+		// should really never happen
+		User::Leave(KErrPathNotFound);
+		}
+	TDriveName drive(parse.Drive());
+
+	HBufC* hDrive = drive.AllocL();
+	TInt err = aUpdateLog.DrivesAffected().InsertInOrder(hDrive, TLinearOrder<HBufC>(CApaAppList::CompareStrings));
+	if(err != KErrNone)
+		{
+		delete hDrive;
+		}
+	
+	TFileName path(TemporaryFilePathL(drive));
+
+	aFile.RenameToTemporaryL(iFs,path);
+	}
+
+void CApsDeregisterNonNativeApplication::DoPerformUpdateL(RApsUpdateLog& aUpdateLog)
+	{
+	CApaAppData* appData = FindAppDataLC(aUpdateLog);
+	if(appData == NULL)
+		{
+		/*
+		 * App not found.
+		 * Behavioural backwards compatibility says we shouldn't raise an error here,
+		 * instead just let it go and carry on.
+		 */
+		CleanupStack::Pop(appData);
+		return;
+		}
+
+	/*
+	 for each of the 3 files, open a handle on the real file if it exists
+	 the first one (iResourceFile) is mandatory
+	 */
+	TRAPD(err,iResourceFile.OpenL(iFs, appData->RegistrationFileName()));
+	if(err != KErrNone && err != KErrNotFound)
+		{
+		User::Leave(err);
+		}
+
+	if(appData->LocalisableResourceFileName() != KNullDesC)
+		{
+		TRAP(err,iLocalisableResourceFile.OpenL(iFs, appData->LocalisableResourceFileName()));
+		if(err != KErrNone && err != KErrNotFound)
+			{
+			User::Leave(err);
+			}
+		}
+
+	if(appData->IconFileName() != KNullDesC)
+		{
+		TRAP(err,iIconFile.OpenL(iFs, appData->IconFileName()));
+		if(err != KErrNone && err != KErrNotFound)
+			{
+			User::Leave(err);
+			}
+		}
+
+	CleanupStack::PopAndDestroy(appData);
+
+	/*
+	 perform the actual updates
+	 */
+	RWriteStream& stream = aUpdateLog.LogWriteStream();
+
+	if(iIconFile.Exists())
+		{
+		RenameToTemporaryL(iIconFile, aUpdateLog);
+		iIconFile.ExternalizeContinuationL(stream, EIconFileUpdate);
+		}
+	
+	if(iLocalisableResourceFile.Exists())
+		{
+		RenameToTemporaryL(iLocalisableResourceFile, aUpdateLog);
+		iLocalisableResourceFile.ExternalizeContinuationL(stream, ELocalisableResourceFileUpdate);
+		}
+
+	RenameToTemporaryL(iResourceFile, aUpdateLog);
+	iResourceFile.ExternalizeContinuationL(stream, EResourceFileUpdate);
+	}
+
+void CApsDeregisterNonNativeApplication::DoRollbackUpdate(RApsUpdateLog& aUpdateLog)
+	{
+	RWriteStream& stream = aUpdateLog.LogWriteStream();
+
+	iResourceFile.RestoreReal(iFs);
+	iResourceFile.ExternalizeContinuation(stream, EResourceFileUpdate);
+
+	iLocalisableResourceFile.RestoreReal(iFs);
+	iLocalisableResourceFile.ExternalizeContinuation(stream, ELocalisableResourceFileUpdate);
+	
+	iIconFile.RestoreReal(iFs);
+	iIconFile.ExternalizeContinuation(stream, EIconFileUpdate);
+	}
+
+void CApsDeregisterNonNativeApplication::ExternalizeL(RWriteStream& aStream)
+	{
+	iResourceFile.ExternalizeL(aStream);
+	iLocalisableResourceFile.ExternalizeL(aStream);
+	iIconFile.ExternalizeL(aStream);
+	}
+
+void CApsDeregisterNonNativeApplication::InternalizeL(RReadStream& aStream, TInt& aPosition)
+	{
+	// we can update aPosition whenever we like in this function since we're protected
+	// from it being left at a bad value by the copy taken by CApsNonNativeApplicationsUpdateList::InternalizeActionL
+	iResourceFile.InternalizeL(aStream, aPosition);
+	iLocalisableResourceFile.InternalizeL(aStream, aPosition);
+	iIconFile.InternalizeL(aStream, aPosition);
+	}
+
+void CApsDeregisterNonNativeApplication::InternalizeUpdateContinuationL(RReadStream& aStream, TInt& aPosition)
+	{
+	// we can update aPosition whenever we like in this function since we're protected
+	// from it being left at a bad value by the copy taken by CApsNonNativeApplicationsUpdate::SharedInternalizeLoopL
+
+	TLogContinuationType type = static_cast<TLogContinuationType>(aStream.ReadInt8L());
+	aPosition += sizeof(TInt8);
+
+	switch(type)
+		{
+	case EResourceFileUpdate:
+		iResourceFile.InternalizeL(aStream, aPosition);
+		break;
+	case ELocalisableResourceFileUpdate:
+		iLocalisableResourceFile.InternalizeL(aStream, aPosition);
+		break;
+	case EIconFileUpdate:
+		iIconFile.InternalizeL(aStream, aPosition);
+		break;
+	default:
+		User::Leave(KErrCorrupt);
+		break;
+		}
+	}
+
+void CApsDeregisterNonNativeApplication::PostInternalizeL()
+	{
+	iResourceFile.PostInternalizeL(iFs);
+	iLocalisableResourceFile.PostInternalizeL(iFs);
+	iIconFile.PostInternalizeL(iFs);
+	}
+
+CApsDeregisterNonNativeApplication::~CApsDeregisterNonNativeApplication()
+	{
+	/*
+	if we performed the update successfully, we need to delete the temporary
+
+	in all other cases, just delete everything that still exists
+	 */
+	if(iState == EPerformed) 
+		{
+		// in this state we know that Perform has completed successfully.
+		iResourceFile.DeleteTemporary(iFs);
+		iLocalisableResourceFile.DeleteTemporary(iFs);
+		iIconFile.DeleteTemporary(iFs);
+		}
+	else
+		{
+		// Hopefully these are now (back) in their target locations.
+		// if they're not, there's nothing we can do now, so abandon them either way
+		iResourceFile.CloseHandle();
+		iLocalisableResourceFile.CloseHandle();
+		iIconFile.CloseHandle();
+		}
+	}
+
+#ifdef _DEBUG
+/**************************************************************************************************************
+ * CApsAlwaysFailUpdate
+ **************************************************************************************************************/
+
+CApsAlwaysFailUpdate::CApsAlwaysFailUpdate(RFs& aFs, TState aState) :
+		CApsNonNativeApplicationsUpdate(aFs,TUid::Uid(0xDEADBEEF),aState,EFail)
+	{
+	}
+
+void CApsAlwaysFailUpdate::DoPerformUpdateL(RApsUpdateLog& /*aUpdateLog*/)
+	{
+	User::Leave(KErrGeneral);
+	}
+
+/**************************************************************************************************************
+ * CApsAlwaysPanicUpdate
+ **************************************************************************************************************/
+
+CApsAlwaysPanicUpdate::CApsAlwaysPanicUpdate(RFs& aFs, TState aState) :
+		CApsNonNativeApplicationsUpdate(aFs,TUid::Uid(0xCAFEBABE),aState,EPanic)
+	{
+	}
+
+void CApsAlwaysPanicUpdate::DoPerformUpdateL(RApsUpdateLog& /*aUpdateLog*/)
+	{
+	TBool jit = User::JustInTime();
+	User::SetJustInTime(EFalse);
+	Panic(ENonNativeAppsTestHandlingPanicDuringUpdate);
+	User::SetJustInTime(jit);
+	}
+
+/**************************************************************************************************************
+ * CApsAlwaysPanicOnRollbackUpdate
+ **************************************************************************************************************/
+
+CApsAlwaysPanicOnRollbackUpdate::CApsAlwaysPanicOnRollbackUpdate(RFs& aFs, TState aState) :
+		CApsNonNativeApplicationsUpdate(aFs,TUid::Uid(0x1337D00D),aState,ERollbackPanic)
+	{
+	}
+
+void CApsAlwaysPanicOnRollbackUpdate::DoRollbackUpdate(RApsUpdateLog& /*aUpdateLog*/)
+	{
+	TBool jit = User::JustInTime();
+	User::SetJustInTime(EFalse);
+	Panic(ENonNativeAppsTestHandlingPanicDuringRollback);
+	User::SetJustInTime(jit);
+	}
+
+#endif // _DEBUG
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apserv/apsnnappupdates.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,346 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef APSNNAPPUPDATES_H
+#define APSNNAPPUPDATES_H
+
+#include <e32base.h>
+#include <f32file.h>
+	
+
+
+// classes referenced
+class CApaAppData;
+class CApaAppListServer;
+class RApsUpdateLog;
+class RWriteStream;
+
+/**
+This class keeps track of a resource file or icon file, 
+whether it is in its final location or a temporary directory.
+
+The NonNativeApps updates system makes heavy use of moving files
+between temporary and final locations, in an attempt to provide
+atomicity of update lists.
+
+@internalComponent
+*/
+NONSHARABLE_CLASS(TFileDetails)
+	{
+public:
+	TFileDetails();
+	const TDesC& Path();
+	void SetPath(const TDesC& aPath);
+	TBool Exists() const;
+	void CloseHandle();
+	
+	void OpenL(RFs& aFs, const TFileName& aFileName);
+	void CreateTemporaryL(RFs& aFs, const TFileName& aDir);
+	void GetDuplicateHandleL(RFile& aFile);
+
+	void RenameToRealL(RFs& aFs);
+	void RenameToTemporaryL(RFs& aFs, const TFileName& aDir);
+	TInt Delete(RFs& aFs);
+	TInt DeleteTemporary(RFs& aFs);
+	TInt RestoreReal(RFs& aFs);
+
+	void ExternalizeL(RWriteStream& aStream);
+	void ExternalizeContinuationL(RWriteStream& aStream, TInt aTag);
+	TInt ExternalizeContinuation(RWriteStream& aStream, TInt aTag);
+	void InternalizeL(RReadStream& aStream, TInt& aPosition);
+	void PostInternalizeL(RFs& aFs);
+
+private:
+	TInt RenameToReal(RFs& aFs);
+
+private:
+	enum TState
+		{
+		EStateInvalid = 0,
+		EStateNull,
+		EStateTemporary,
+		EStateReal
+		};
+	TState iState;
+	TFileName iPath;
+	TFileName iTempPath;
+	RFile iHandle;
+	};
+
+/**
+Abstract base class for objects that represent updates to the non-native applications
+registry. Subclasses must implement the DoPerformUpdateL and DoRollbackUpdate methods.
+
+- DoPerformUpdateL will only ever be called once or not at all
+- DoPerformUpdateL will be called first, if at all
+- DoRollbackUpdate will not be called before DoPerformUpdateL
+- DoRollbackUpdate will be called if DoPerformUpdateL fails on this update or any subsequent one
+- DoRollbackUpdate will not be called twice
+- The object may be deleted at any time.
+
+If the device is turned off / crashes partway through performing updates, 
+the following will be called upon reboot:
+
+- The subclass' NewL, with dummy values instead of class-specific data (if any)
+- InternalizePerformLogL() will be called immediately afterwards
+- InternalizeRollbackLogL() iff a rollback action for this update is in the log
+- PostInternalizeL() will be called after the log has been read in entirely
+- DoRollbackUpdaetL() may then be called if, after replaying the log, the class' state is
+                      EPerforming, EPerformed or ERollingBack
+
+@internalComponent
+*/
+NONSHARABLE_CLASS(CApsNonNativeApplicationsUpdate) : public CBase
+	{
+public: // Types
+	enum TState
+		{
+		ENew,
+		ENeedsInternalizing,
+		EPerforming,
+		EPerformed,
+		ERollingBack,
+		ERolledBack
+		};
+	
+	enum TLogActionType
+		{
+		EInvalidAction = 0,
+		ENewUpdate,				// Indicates the record of an update's initial state
+		EPerformUpdate,			// Indicates the start of a Perform-update log
+		ERollbackUpdate,        // Indicates the start of a Rollback-update log
+		EContinuationOfUpdate,  // Specifies that the current update's log has not finished
+		EChangeOfUpdateState,   // Similar to EContinuationOfUpdate, but used by this superclass
+		EEndOfUpdate            // Specifies that the current update's log has finished
+		};
+
+	enum TLogUpdateType
+		{
+		EInvalidUpdate = 0,
+		ERegisterApplication,   // Indicates the start of a RegisterApplication update
+		EDeregisterApplication, // Indicates the start of a DeregisterApplication update
+#ifdef _DEBUG
+		EFail,                  // Indicates the start of a Forced-Fail update
+		EPanic,                 // Indicates the start of a Forced-Panic update
+		ERollbackPanic          // Indicates the start of a Forced-Panic-On-Rollback update
+#endif
+		};
+
+public:
+	~CApsNonNativeApplicationsUpdate();
+
+protected:
+	CApsNonNativeApplicationsUpdate(RFs& aFs, TUid aUid, TState aState, TLogUpdateType aType);
+
+public: 
+	CApsNonNativeApplicationsUpdate* Previous() const;
+	CApsNonNativeApplicationsUpdate* Next() const;
+	TUid Uid();
+	void PerformUpdateL(RApsUpdateLog& aUpdateLog);
+	void RollbackUpdateL(RApsUpdateLog& aUpdateLog);
+	void InternalizeStateChangeL(RReadStream& aStream, TInt& aPosition);
+
+	void InternalizeNewUpdateL(RReadStream& aStream, TInt& aPosition);
+	void InternalizePerformUpdateL(RReadStream& aStream, TInt& aPosition);
+	void InternalizeRollbackUpdateL(RReadStream& aStream, TInt& aPosition);
+
+protected:
+	TFileName TemporaryFilePathL(TDriveName& aDrive);
+	void StateChangeL(TState aState, RWriteStream& aStream);
+
+private:
+	void SharedInternalizeLoopL(RReadStream& aStream, TInt& aPosition);
+
+	virtual void DoPerformUpdateL(RApsUpdateLog& aUpdateLog) = 0;
+	virtual void DoRollbackUpdate(RApsUpdateLog& aUpdateLog) = 0;
+
+	virtual void ExternalizeL(RWriteStream& aStream);
+	virtual void InternalizeL(RReadStream& aStream, TInt& aPosition);
+	virtual void InternalizeUpdateContinuationL(RReadStream& aStream, TInt& aPosition);
+	virtual void PostInternalizeL();
+
+
+protected:
+	TState iState;
+	RFs& iFs;
+
+private:
+	friend class CApsNonNativeApplicationsUpdateList; // so it can link up iPrevious/iNext
+	const TLogUpdateType iType;
+	CApsNonNativeApplicationsUpdate* iPrevious;
+	CApsNonNativeApplicationsUpdate* iNext;
+	const TUid iUid;
+	};
+
+/**
+Implementation of CApsNonNativeApplicationsUpdate that performs the registration of a
+non-native application.
+
+The Write/Copy methods of this class should be used to prepare the update,
+they will write resource and icon files to a temporary directory.
+
+When this update is executed, the files will be moved to the locations set with the
+Set*FileTargetLocation functions.
+
+@internalComponent
+*/
+NONSHARABLE_CLASS(CApsRegisterNonNativeApplication) : public CApsNonNativeApplicationsUpdate
+	{
+public:
+	static CApsRegisterNonNativeApplication* NewL(RFs& aFs, TUid aUid, const TDriveName& aDrive, TState aState = ENew);
+	~CApsRegisterNonNativeApplication();
+
+private:
+	CApsRegisterNonNativeApplication(RFs& aFs, TUid aUid, const TDriveName& aDrive, TState aState);
+
+public:
+	void SetResourceFileTargetLocation(const TDesC& aLocation);
+	void WriteResourceFileL(const TDesC8& aData, const TDesC8* aDataPrefix);
+
+	void SetLocalisableResourceFileTargetLocation(const TDesC& aLocation);
+	void WriteLocalisableResourceFileL( const TDesC8& aData, const TDesC8* aDataPrefix);
+
+	void SetIconFileTargetLocation(const TDesC& aLocation);
+	void CopyIconFileL(RFile& aSourceFile);
+
+private:	
+	void NewTemporaryFileL(TFileDetails& aFile);
+	void WriteResourceFileL(TFileDetails& aFile, const TDesC8& aData, const TDesC8* aDataPrefix);
+
+	// from CApsNonNativeApplicationsUpdate
+	void DoPerformUpdateL(RApsUpdateLog& aUpdateLog);
+	void DoRollbackUpdate(RApsUpdateLog& aUpdateLog);
+	void ExternalizeL(RWriteStream& aStream);
+	void InternalizeL(RReadStream& aStream, TInt& aPosition);
+	void InternalizeUpdateContinuationL(RReadStream& aStream, TInt& aPosition);
+	void PostInternalizeL();
+
+
+private:
+	enum TLogContinuationType 
+		{
+		EInvalidContinuation = 0,
+		EResourceFileUpdate,
+		ELocalisableResourceFileUpdate,
+		EIconFileUpdate
+		};
+	TDriveName iDrive;
+	TFileDetails iResourceFile;
+	TFileDetails iLocalisableResourceFile;
+	TFileDetails iIconFile;
+	};
+
+/**
+Implementation of CApsNonNativeApplicationsUpdate that performs the deregistration of a
+non-native application.
+
+@internalComponent
+*/
+NONSHARABLE_CLASS(CApsDeregisterNonNativeApplication) : public CApsNonNativeApplicationsUpdate
+	{
+public:
+	static CApsDeregisterNonNativeApplication* NewL(RFs& aFs, CApaAppListServer& aServ, TUid aUid, TState aState = ENew);
+	~CApsDeregisterNonNativeApplication();
+
+private:
+	CApsDeregisterNonNativeApplication(RFs& aFs, CApaAppListServer& aServ, TUid aUid, TState aState);
+
+private:
+	void RenameToTemporaryL(TFileDetails& aFile, RApsUpdateLog& aUpdateLog);
+	CApaAppData* FindAppDataLC(RApsUpdateLog& aUpdateLog);
+
+	// from CApsNonNativeApplicationsUpdate
+	void DoPerformUpdateL(RApsUpdateLog& aUpdateLog);
+	void DoRollbackUpdate(RApsUpdateLog& aUpdateLog);
+	void ExternalizeL(RWriteStream& aStream);
+	void InternalizeL(RReadStream& aStream, TInt& aPosition);
+	void InternalizeUpdateContinuationL(RReadStream& aStream, TInt& aPosition);
+	void PostInternalizeL();
+
+private:
+	enum TLogContinuationType 
+		{
+		EInvalidContinuation = 0,
+		EResourceFileUpdate,
+		ELocalisableResourceFileUpdate,
+		EIconFileUpdate
+		};
+	CApaAppListServer& iServ;
+	TFileDetails iResourceFile;
+	TFileDetails iLocalisableResourceFile;
+	TFileDetails iIconFile;
+	};
+
+
+#ifdef _DEBUG
+/**
+CApsAlwaysFailUpdate
+
+A dummy CNonNativeApplicationsUpdate for testing purpouses.
+Always fails with KErrGeneral when performed
+
+@internalComponent
+*/
+NONSHARABLE_CLASS(CApsAlwaysFailUpdate) : public CApsNonNativeApplicationsUpdate
+	{
+public:
+	CApsAlwaysFailUpdate(RFs& aFs, TState aState = ENew);
+private:
+	// from CApsNonNativeApplicationsUpdate
+	void DoPerformUpdateL(RApsUpdateLog& aUpdateLog);
+	void DoRollbackUpdate(RApsUpdateLog&) {}
+	};
+
+
+/**
+CApsAlwaysPanicUpdate
+
+A dummy CNonNativeApplicationsUpdate for testing purpouses.
+Always panics when performed
+
+@internalComponent
+*/
+NONSHARABLE_CLASS(CApsAlwaysPanicUpdate) : public CApsNonNativeApplicationsUpdate
+	{
+public:
+	CApsAlwaysPanicUpdate(RFs& aFs, TState aState = ENew);
+private:
+	// from CApsNonNativeApplicationsUpdate
+	void DoPerformUpdateL(RApsUpdateLog& aUpdateLog);
+	void DoRollbackUpdate(RApsUpdateLog&) {}
+	};
+
+
+/**
+CApsAlwaysPanicOnRollbackUpdate
+
+A dummy CNonNativeApplicationsUpdate for testing purpouses.
+Always panics upon rollback
+
+@internalComponent
+*/
+NONSHARABLE_CLASS(CApsAlwaysPanicOnRollbackUpdate) : public CApsNonNativeApplicationsUpdate
+	{
+public:
+	CApsAlwaysPanicOnRollbackUpdate(RFs& aFs, TState aState = ENew);
+private:
+	// from CApsNonNativeApplicationsUpdate
+	void DoPerformUpdateL(RApsUpdateLog&) {}
+	void DoRollbackUpdate(RApsUpdateLog& aUpdateLog);
+	};
+#endif // _DEBUG
+
+
+#endif // APSNNAPPUPDATES_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apsexe/APSEXE.MMP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+//
+// APSEXE.MMP server launch code for AppArc server
+//
+
+/**
+@file
+
+@SYMPurpose apsexe.dll Apparc server stub
+*/
+target          apsexe.exe
+targettype      EXE
+CAPABILITY ProtServ
+
+UID		0x1000008D 0x10003A3F
+VENDORID 0x70000001
+
+SOURCEPATH	../apsexe
+
+userinclude		../inc
+systeminclude   /epoc32/include
+
+source			APSMAIN.CPP
+
+library  euser.lib  apserv.lib
+
+
+// Apparc server need extra stack as it has a lot of
+// filenames and parse objects on stack from time to time
+epocstacksize	0x3000
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apsexe/APSMAIN.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,63 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// The main startup of the AppArc server
+// 
+//
+
+#include "APASVST.H"
+
+
+#ifdef APA_SERVER_IN_THREAD
+// The server binary is an "EPOCEXE" target type
+// Thus the server parameter passing and startup code for WINS and EPOC are
+// significantly different.
+//
+// In EKA1 WINS, the EPOCEXE target is a DLL with an entry point called WinsMain,
+// taking no parameters and returning TInt. This is not really valid as a thread
+// function which takes a TAny* parameter which we need.
+//
+// So the DLL entry-point WinsMain() is used to return a TInt representing the
+// real thread function within the DLL. This is good as long as
+// sizeof(TInt)>=sizeof(ApaServThreadStart).
+//
+
+IMPORT_C TInt WinsMain();
+EXPORT_C TInt WinsMain()
+//
+// WINS DLL entry-point. Just return the real thread function 
+// cast to TInt
+//
+	{
+	return reinterpret_cast<TInt>(&ApaServThreadStart);
+	}
+
+GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
+//
+//	DLL entry point
+//
+	{
+	return(KErrNone);
+	}
+
+#else
+
+TInt E32Main()
+//
+//	EXE entry point
+//
+	{
+	return ApaServThreadStart(NULL);
+	}
+	
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apstart/apstart.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,200 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <apacmdln.h>
+#include "apstart.h"
+#include "apststd.h"
+
+const TInt KAppArcAppListInitialCompletionTimeout = 10000000; //10s
+
+CApaAppStart::CApaAppStart()
+	{
+	}
+
+CApaAppStart::~CApaAppStart()
+	{
+	iApaLsSession.Close();
+	}
+
+/**
+Used to create an instance of @c CApaAppStart class
+
+@return An instance of @c CApaAppStart
+*/
+EXPORT_C CApaAppStart* CApaAppStart::NewL()
+	{
+ 	CApaAppStart* self = new(ELeave) CApaAppStart();
+	return self;
+	}
+
+/**
+Wait for apparc server to complete initial population of its app list. If list 
+population doesn't complete within @c KAppArcAppListInitialCompletionTimeout, 
+this function will leave with KErrTimedOut.
+
+@panic If Apsexe.exe isn't started.
+@leave KErrTimedOut if apparc doesn't complete the initial list population within KAppArcAppListInitialCompletionTimeout.
+@leave With system-wide error-codes for generic errors.
+*/
+void CApaAppStart::WaitForApparcToInitialiseL()
+	{
+	// Make sure we have a usable session...
+	if (iApaLsSession.Handle()==KNullHandle)
+		{
+		const TInt err = iApaLsSession.Connect(); 
+		if(err != KErrNone)
+			{
+			Panic(EApsexeNotRunning);
+			}
+		}
+	
+	//...and a timer
+	RTimer timer;
+	User::LeaveIfError(timer.CreateLocal());
+	CleanupClosePushL(timer); 
+	
+	// Request apparc to notify us when the initial list population is complete
+	TRequestStatus apparcStatus;
+	iApaLsSession.RegisterListPopulationCompleteObserver(apparcStatus);
+
+	// Request a timeout.
+	TRequestStatus timerStatus;
+	timer.After(timerStatus, TTimeIntervalMicroSeconds32(KAppArcAppListInitialCompletionTimeout));
+	
+	// As soon as either request completes, cancel the other
+	User::WaitForRequest(timerStatus, apparcStatus);
+	if (timerStatus == KRequestPending)
+		{
+		timer.Cancel();
+		User::WaitForRequest(timerStatus);
+		}
+	else
+		{
+		// Timeout
+		User::LeaveIfError(iApaLsSession.CancelListPopulationCompleteObserver());
+		User::WaitForRequest(apparcStatus);
+		User::Leave(KErrTimedOut);
+		}
+		
+	CleanupStack::PopAndDestroy(&timer);
+	}
+
+/** 
+Set up the CApaCommandLine object which will be used to start the app.
+*/
+void CApaAppStart::SetupCommandLineL(CApaCommandLine& aCmdLine,
+					const TDesC& aFileName,
+					const TDesC8& aArgs,
+					TBool aViewLess,
+					TBool aStartInBackground)
+	{
+	
+	aCmdLine.SetExecutableNameL(aFileName);
+	aCmdLine.SetTailEndL(aArgs) ;
+	
+	// Define how the app will be launched 		
+	if (!aStartInBackground && !aViewLess)
+		{
+		aCmdLine.SetCommandL(EApaCommandRun);
+		}
+	else if (aStartInBackground && !aViewLess)
+		{
+		aCmdLine.SetCommandL(EApaCommandBackground);
+		}
+	else if (!aStartInBackground && aViewLess)
+		{
+		aCmdLine.SetCommandL(EApaCommandRunWithoutViews);
+		}
+	else 
+		{
+		aCmdLine.SetCommandL(EApaCommandBackgroundAndWithoutViews);
+		}
+	}
+
+/**
+Start an application as defined by the specified command line information. Feedback about 
+when the application is actually up and running is given via @c aRequestStatusForRendezvous.
+
+Rule-based launching and non-native applications are supported only after 
+@c WaitForApparcToInitialiseL has been called. 
+@see struct INIT_APPARC.
+
+@param aFileName The full filename of the application.
+@param aArgs The arguments passed to the application.
+@param aViewLess Indicates whether the application has a view.
+@param aStartInBackground Indicates whether the application should start in background.
+@param aThreadId The id of the main thread for the application.
+@param aRequestStatusForRendezvous To be used for deferred return of the application startup status.
+
+@leave With a system-wide error-code e.g. if @c aFileName doesn't exists or if memory couldn't be allcoated.
+*/
+void CApaAppStart::StartAppL(const TDesC& aFileName, 
+					const TDesC& aArgs, 
+					TBool aViewLess, 
+					TBool aStartInBackground, 
+					TThreadId& aThreadId, 
+					TRequestStatus& aRequestStatusForRendezvous)
+	{
+	DoStartAppL(aFileName, aArgs, aViewLess, aStartInBackground, aThreadId, &aRequestStatusForRendezvous);
+	}
+
+
+/**
+Start an application as defined by the specified command line information. No feedback is provided 
+about when the application is actually up and running.
+
+Rule-based launching and non-native applications are supported only after 
+@c WaitForApparcToInitialiseL has been called. 
+@see struct INIT_APPARC.
+
+@param aFileName The full filename of the application.
+@param aArgs The arguments passed to the application.
+@param aViewLess Indicates whether the application has a view.
+@param aStartInBackground Indicates whether the application should start in background.
+@param aThreadId The id of the main thread for the application.
+
+@leave With a system-wide error-code e.g. if @c aFileName doesn't exists or if memory couldn't be allcoated.
+*/
+void CApaAppStart::StartAppL(const TDesC& aFileName, 
+					const TDesC& aArgs, 
+					TBool aViewLess, 
+					TBool aStartInBackground, 
+					TThreadId& aThreadId)
+	{
+	DoStartAppL(aFileName, aArgs, aViewLess, aStartInBackground, aThreadId, NULL);
+	}
+
+
+void CApaAppStart::DoStartAppL(const TDesC &aFileName, 
+					const TDesC& aArgs, 
+					TBool aViewLess, 
+					TBool aStartInBackground, 
+					TThreadId& aThreadId, 
+					TRequestStatus* aRequestStatusForRendezvous)
+	{
+	// Create an 8-bit variant of aArgs
+	RBuf writableArgs;
+	writableArgs.CreateL(aArgs);
+	CleanupClosePushL(writableArgs);
+	TPtr8 args8 = writableArgs.Collapse();
+	
+	CApaCommandLine* const cmdLine = CApaCommandLine::NewLC();
+	SetupCommandLineL(*cmdLine, aFileName, args8, aViewLess, aStartInBackground) ;
+
+	User::LeaveIfError(iApaLsSession.StartApp(*cmdLine, aThreadId, aRequestStatusForRendezvous));
+	
+	CleanupStack::PopAndDestroy(cmdLine);
+	CleanupStack::PopAndDestroy(&writableArgs);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apstart/apstart.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,51 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __APSTART_H
+#define __APSTART_H
+
+#include <apgcli.h>
+#include <apastarter.h>
+
+/**
+Start applications using RApaLsSession.
+
+@internalTechnology
+@prototype
+*/
+NONSHARABLE_CLASS(CApaAppStart) : public CApaStarter
+	{
+public:	
+	IMPORT_C static CApaAppStart* NewL();
+	
+	//from CBase			
+	~CApaAppStart();
+	
+	//from CApaStarter
+	void WaitForApparcToInitialiseL();
+	void StartAppL(const TDesC& aFileName, const TDesC& aArgs, TBool aViewLess, TBool aStartInBackground, TThreadId& aThreadId);
+	void StartAppL(const TDesC& aFileName, const TDesC& aArgs, TBool aViewLess, TBool aStartInBackground, TThreadId& aThreadId, TRequestStatus& aRequestStatusForRendezvous);
+	
+private:
+	CApaAppStart();
+	void ConstructL();			
+	static void SetupCommandLineL(CApaCommandLine& aCmdLine, const TDesC& aFileName, const TDesC8& aArgs, TBool aViewLess, TBool aStartInBackground);
+	void DoStartAppL(const TDesC &aFileName, const TDesC &aArgs, TBool aViewLess, TBool aStartInBackground, TThreadId& aThreadId, TRequestStatus* aRequestStatusForRendezvous);
+
+private:
+	RApaLsSession iApaLsSession;		
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apstart/apstart.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,30 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+TARGET			apstart.dll	
+TARGETTYPE		dll
+TARGETPATH		/sys/bin
+UID				0x1000008D 0x200086A0
+CAPABILITY 		PowerMgmt ReadDeviceData WriteDeviceData ProtServ SwEvent // same as SysStart.exe
+VENDORID 		0x70000001
+
+USERINCLUDE		../inc
+SYSTEMINCLUDE 	/epoc32/include
+
+SOURCEPATH		../apstart
+SOURCE			apstart.cpp
+SOURCE			apststd.cpp
+
+LIBRARY			euser.lib apparc.lib apgrfx.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apstart/apststd.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,26 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <e32std.h>
+#include "apststd.h"
+
+void Panic(TApaPanic aPanic)
+//
+// Panic the process with APSTART as the category.
+//
+	{
+	_LIT(KApStartPanic,"APSTART");
+	User::Panic(KApStartPanic, aPanic);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/apstart/apststd.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,26 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __APSTSTD
+#define __APSTSTD
+
+enum TApaPanic
+	{
+	EApsexeNotRunning
+	};
+
+extern void Panic(TApaPanic aPanic);
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/bwins/APFILE_9_REMOVE_UI_FRAMEWORKS_V1U.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,72 @@
+EXPORTS
+	??0CApaScanningFileRecognizer@@IAE@AAVRFs@@PAVMApaAppStarter@@@Z @ 1 NONAME
+	??1CApaAppLocatorProxy@@UAE@XZ @ 2 NONAME ABSENT
+	??1CApaScanningAppFinder@@UAE@XZ @ 3 NONAME ABSENT
+	??1CApaScanningFileRecognizer@@UAE@XZ @ 4 NONAME
+	?ConstructL@CApaScanningFileRecognizer@@IAEXXZ @ 5 NONAME
+	?DefaultAppInfoFileName@CApaScanningAppFinder@@UBE?AV?$TBuf@$0BAA@@@XZ @ 6 NONAME ABSENT
+	?FindAllAppsL@CApaScanningAppFinder@@UAEXXZ @ 7 NONAME ABSENT
+	?FindAppL@CApaScanningAppFinder@@UAE?AV?$TBuf@$0BAA@@@ABVTDesC16@@VTUid@@@Z @ 8 NONAME ABSENT
+	?GetAppCapabilityByUid@CApaAppLocatorProxy@@UAEHAAVTDes8@@VTUid@@@Z @ 9 NONAME ABSENT
+	?GetAppEntryByUid@CApaAppLocatorProxy@@UAEHAAVTApaAppEntry@@VTUid@@@Z @ 10 NONAME ABSENT
+	?NewL@CApaAppLocatorProxy@@SAPAV1@AAVRFs@@@Z @ 11 NONAME ABSENT
+	?NewL@CApaScanningAppFinder@@SAPAV1@ABVRFs@@@Z @ 12 NONAME ABSENT
+	?NewL@CApaScanningFileRecognizer@@SAPAV1@AAVRFs@@PAVMApaAppStarter@@@Z @ 13 NONAME
+	?NewLC@CApaScanningAppFinder@@SAPAV1@ABVRFs@@@Z @ 14 NONAME ABSENT
+	?NextL@CApaScanningAppFinder@@UAEHAAVTApaAppEntry@@@Z @ 15 NONAME ABSENT
+	?RecognizerCount@CApaScanningFileRecognizer@@QAEHXZ @ 16 NONAME
+	?RecognizerListLC@CApaScanningFileRecognizer@@QBEPAV?$CArrayFixFlat@VTRecognizer@CApaScanningFileRecognizer@@@@XZ @ 17 NONAME
+	?ScanForRecognizersL@CApaScanningFileRecognizer@@QAEXXZ @ 18 NONAME
+	?SetRecognizersFromListL@CApaScanningFileRecognizer@@QAEXABV?$CArrayFixFlat@VTRecognizer@CApaScanningFileRecognizer@@@@@Z @ 19 NONAME ABSENT
+	?TempPath@CApaScanningAppFinder@@UBE?AV?$TBuf@$0BAA@@@XZ @ 20 NONAME ABSENT
+	?TempPath@Apfile@@SA?AVTPtrC16@@XZ @ 21 NONAME ABSENT
+	??ACApaScanningFileRecognizer@@QBEABVTRecognizer@0@H@Z @ 22 NONAME ; class CApaScanningFileRecognizer::TRecognizer const & CApaScanningFileRecognizer::operator[](int) const
+	?SetRecognizerL@CApaScanningFileRecognizer@@QAEXABVTRecognizer@1@@Z @ 23 NONAME ABSENT
+	?UpdateCounter@CApaScanningFileRecognizer@@QBEHXZ @ 24 NONAME
+	??1CApaScanningControlFinder@@UAE@XZ @ 25 NONAME ABSENT
+	?DefaultAppInfoFileName@CApaScanningControlFinder@@UBE?AV?$TBuf@$0BAA@@@XZ @ 26 NONAME ABSENT
+	?FindAllAppsL@CApaScanningControlFinder@@UAEXXZ @ 27 NONAME ABSENT
+	?FindAppL@CApaScanningControlFinder@@UAE?AV?$TBuf@$0BAA@@@ABVTDesC16@@VTUid@@@Z @ 28 NONAME ABSENT
+	?NewL@CApaScanningControlFinder@@SAPAV1@ABVRFs@@@Z @ 29 NONAME ABSENT
+	?NewLC@CApaScanningControlFinder@@SAPAV1@ABVRFs@@@Z @ 30 NONAME ABSENT
+	?NextL@CApaScanningControlFinder@@UAEHAAVTApaAppEntry@@@Z @ 31 NONAME ABSENT
+	?TempPath@CApaScanningControlFinder@@UBE?AV?$TBuf@$0BAA@@@XZ @ 32 NONAME ABSENT
+	?SetEcomRecognizerL@CApaScanningFileRecognizer@@QAEXABVTRecognizer@1@@Z @ 33 NONAME
+	?SetEcomRecognizersFromListL@CApaScanningFileRecognizer@@QAEXABV?$CArrayFixFlat@VTRecognizer@CApaScanningFileRecognizer@@@@@Z @ 34 NONAME
+	?FindAllAppsL@CApaAppRegFinder@@QAEXXZ @ 35 NONAME ; void CApaAppRegFinder::FindAllAppsL(void)
+	?FindAppL@CApaAppRegFinder@@QAE?AV?$TBuf@$0BAA@@@ABVTDesC16@@VTUid@@@Z @ 36 NONAME ABSENT ; class TBuf<256> CApaAppRegFinder::FindAppL(class TDesC16 const &, class TUid)
+	?NewL@CApaAppRegFinder@@SAPAV1@ABVRFs@@@Z @ 37 NONAME ; class CApaAppRegFinder * CApaAppRegFinder::NewL(class RFs const &)
+	?NewLC@CApaAppRegFinder@@SAPAV1@ABVRFs@@@Z @ 38 NONAME ; class CApaAppRegFinder * CApaAppRegFinder::NewLC(class RFs const &)
+	?NextL@CApaAppRegFinder@@QAEHAAVTApaAppEntry@@ABV?$RPointerArray@VHBufC16@@@@@Z @ 39 NONAME ; int CApaAppRegFinder::NextL(class TApaAppEntry &, class RPointerArray<class HBufC16> const &)
+	?TempPath@CApaAppRegFinder@@UBE?AV?$TBuf@$0BAA@@@XZ @ 40 NONAME ABSENT ; class TBuf<256> CApaAppRegFinder::TempPath(void) const
+	??1CAppLaunchChecker@@UAE@XZ @ 41 NONAME ; CAppLaunchChecker::~CAppLaunchChecker(void)
+	??ACApaScanningRuleBasedPlugIns@@QBEPAVCAppLaunchChecker@@H@Z @ 42 NONAME ; class CAppLaunchChecker * CApaScanningRuleBasedPlugIns::operator[](int) const
+	??1CApaScanningRuleBasedPlugIns@@UAE@XZ @ 43 NONAME ; CApaScanningRuleBasedPlugIns::~CApaScanningRuleBasedPlugIns(void)
+	?NewL@CApaScanningRuleBasedPlugIns@@SAPAV1@XZ @ 44 NONAME ; class CApaScanningRuleBasedPlugIns * CApaScanningRuleBasedPlugIns::NewL(void)
+	?ScanForRuleBasedPlugInsL@CApaScanningRuleBasedPlugIns@@QAEXXZ @ 45 NONAME ; void CApaScanningRuleBasedPlugIns::ScanForRuleBasedPlugInsL(void)
+	?ImplementationCount@CApaScanningRuleBasedPlugIns@@QBEHXZ @ 46 NONAME ; int CApaScanningRuleBasedPlugIns::ImplementationCount(void) const
+	?Reserved_1@CAppLaunchChecker@@EAEXXZ @ 47 NONAME ; void CAppLaunchChecker::Reserved_1(void)
+	?Reserved_2@CAppLaunchChecker@@EAEXXZ @ 48 NONAME ; void CAppLaunchChecker::Reserved_2(void)
+	?Reserved_3@CAppLaunchChecker@@EAEXXZ @ 49 NONAME ; void CAppLaunchChecker::Reserved_3(void)
+	??1CAppSidChecker@@UAE@XZ @ 50 NONAME ; CAppSidChecker::~CAppSidChecker(void)
+	?SetRescanCallBackL@CAppSidChecker@@UAEXABVTCallBack@@@Z @ 51 NONAME ; void CAppSidChecker::SetRescanCallBackL(class TCallBack const &)
+	?reserved1@CAppSidChecker@@EAEXXZ @ 52 NONAME ; void CAppSidChecker::reserved1(void)
+	?reserved2@CAppSidChecker@@EAEXXZ @ 53 NONAME ; void CAppSidChecker::reserved2(void)
+	?reserved3@CAppSidChecker@@EAEXXZ @ 54 NONAME ; void CAppSidChecker::reserved3(void)
+	X @ 55 NONAME ABSENT ; dummy entry for DriveList function used for Argus and above releases
+	X @ 56 NONAME ABSENT ; dummy entry for FindAllRemovableMediaAppsL function used for Argus and above releases
+	??1CApaAppUnInstallMonitor@@UAE@XZ @ 57 NONAME ; CApUnInstallMonitor::~CApUnInstallMonitor(void)
+	?Start@CApaAppUnInstallMonitor@@QAEXXZ @ 58 NONAME ; void CApUnInstallMonitor::Start(void)
+	?NewL@CApaAppUnInstallMonitor@@SAPAV1@PAVCApaAppListServer@@@Z @ 59 NONAME ; class CApUnInstallMonitor * CApUnInstallMonitor::NewL(class CApaAppListServer *)
+	??1CApfMimeContentPolicy@@UAE@XZ @ 60 NONAME ; CApfMimeContentPolicy::~CApfMimeContentPolicy(void)
+	?IsClosedExtension@CApfMimeContentPolicy@@QAEHABVTDesC16@@@Z @ 61 NONAME ; int CApfMimeContentPolicy::IsClosedExtension(class TDesC16 const &)
+	?IsClosedFileL@CApfMimeContentPolicy@@QAEHAAVRFile@@@Z @ 62 NONAME ; int CApfMimeContentPolicy::IsClosedFileL(class RFile &)
+	?IsClosedFileL@CApfMimeContentPolicy@@QAEHABVTDesC16@@@Z @ 63 NONAME ; int CApfMimeContentPolicy::IsClosedFileL(class TDesC16 const &)
+	?IsClosedType@CApfMimeContentPolicy@@QAEHABVTDesC16@@@Z @ 64 NONAME ; int CApfMimeContentPolicy::IsClosedType(class TDesC16 const &)
+	?IsDRMEnvelopeL@CApfMimeContentPolicy@@QAEHAAVRFile@@@Z @ 65 NONAME ; int CApfMimeContentPolicy::IsDRMEnvelopeL(class RFile &)
+	?IsDRMEnvelopeL@CApfMimeContentPolicy@@QAEHABVTDesC16@@@Z @ 66 NONAME ; int CApfMimeContentPolicy::IsDRMEnvelopeL(class TDesC16 const &)
+	?NewL@CApfMimeContentPolicy@@SAPAV1@AAVRFs@@@Z @ 67 NONAME ; class CApfMimeContentPolicy * CApfMimeContentPolicy::NewL(class RFs &)
+	?NewL@CApfMimeContentPolicy@@SAPAV1@XZ @ 68 NONAME ; class CApfMimeContentPolicy * CApfMimeContentPolicy::NewL(void)
+	?NewLC@CApfMimeContentPolicy@@SAPAV1@AAVRFs@@@Z @ 69 NONAME ; class CApfMimeContentPolicy * CApfMimeContentPolicy::NewLC(class RFs &)
+	?NewLC@CApfMimeContentPolicy@@SAPAV1@XZ @ 70 NONAME ; class CApfMimeContentPolicy * CApfMimeContentPolicy::NewLC(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/bwins/APFILE_UI_FRAMEWORKSU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,73 @@
+EXPORTS
+	??0CApaScanningFileRecognizer@@IAE@AAVRFs@@PAVMApaAppStarter@@@Z @ 1 NONAME
+	??1CApaAppLocatorProxy@@UAE@XZ @ 2 NONAME ABSENT
+	??1CApaScanningAppFinder@@UAE@XZ @ 3 NONAME ABSENT
+	??1CApaScanningFileRecognizer@@UAE@XZ @ 4 NONAME
+	?ConstructL@CApaScanningFileRecognizer@@IAEXXZ @ 5 NONAME
+	?DefaultAppInfoFileName@CApaScanningAppFinder@@UBE?AV?$TBuf@$0BAA@@@XZ @ 6 NONAME ABSENT
+	?FindAllAppsL@CApaScanningAppFinder@@UAEXXZ @ 7 NONAME ABSENT
+	?FindAppL@CApaScanningAppFinder@@UAE?AV?$TBuf@$0BAA@@@ABVTDesC16@@VTUid@@@Z @ 8 NONAME ABSENT
+	?GetAppCapabilityByUid@CApaAppLocatorProxy@@UAEHAAVTDes8@@VTUid@@@Z @ 9 NONAME ABSENT
+	?GetAppEntryByUid@CApaAppLocatorProxy@@UAEHAAVTApaAppEntry@@VTUid@@@Z @ 10 NONAME ABSENT
+	?NewL@CApaAppLocatorProxy@@SAPAV1@AAVRFs@@@Z @ 11 NONAME ABSENT
+	?NewL@CApaScanningAppFinder@@SAPAV1@ABVRFs@@@Z @ 12 NONAME ABSENT
+	?NewL@CApaScanningFileRecognizer@@SAPAV1@AAVRFs@@PAVMApaAppStarter@@@Z @ 13 NONAME
+	?NewLC@CApaScanningAppFinder@@SAPAV1@ABVRFs@@@Z @ 14 NONAME ABSENT
+	?NextL@CApaScanningAppFinder@@UAEHAAVTApaAppEntry@@@Z @ 15 NONAME ABSENT
+	?RecognizerCount@CApaScanningFileRecognizer@@QAEHXZ @ 16 NONAME
+	?RecognizerListLC@CApaScanningFileRecognizer@@QBEPAV?$CArrayFixFlat@VTRecognizer@CApaScanningFileRecognizer@@@@XZ @ 17 NONAME
+	?ScanForRecognizersL@CApaScanningFileRecognizer@@QAEXXZ @ 18 NONAME
+	?SetRecognizersFromListL@CApaScanningFileRecognizer@@QAEXABV?$CArrayFixFlat@VTRecognizer@CApaScanningFileRecognizer@@@@@Z @ 19 NONAME ABSENT
+	?TempPath@CApaScanningAppFinder@@UBE?AV?$TBuf@$0BAA@@@XZ @ 20 NONAME ABSENT
+	?TempPath@Apfile@@SA?AVTPtrC16@@XZ @ 21 NONAME ABSENT
+	??ACApaScanningFileRecognizer@@QBEABVTRecognizer@0@H@Z @ 22 NONAME ; class CApaScanningFileRecognizer::TRecognizer const & CApaScanningFileRecognizer::operator[](int) const
+	?SetRecognizerL@CApaScanningFileRecognizer@@QAEXABVTRecognizer@1@@Z @ 23 NONAME ABSENT
+	?UpdateCounter@CApaScanningFileRecognizer@@QBEHXZ @ 24 NONAME
+	??1CApaScanningControlFinder@@UAE@XZ @ 25 NONAME ABSENT
+	?DefaultAppInfoFileName@CApaScanningControlFinder@@UBE?AV?$TBuf@$0BAA@@@XZ @ 26 NONAME ABSENT
+	?FindAllAppsL@CApaScanningControlFinder@@UAEXXZ @ 27 NONAME ABSENT
+	?FindAppL@CApaScanningControlFinder@@UAE?AV?$TBuf@$0BAA@@@ABVTDesC16@@VTUid@@@Z @ 28 NONAME ABSENT
+	?NewL@CApaScanningControlFinder@@SAPAV1@ABVRFs@@@Z @ 29 NONAME ABSENT
+	?NewLC@CApaScanningControlFinder@@SAPAV1@ABVRFs@@@Z @ 30 NONAME ABSENT
+	?NextL@CApaScanningControlFinder@@UAEHAAVTApaAppEntry@@@Z @ 31 NONAME ABSENT
+	?TempPath@CApaScanningControlFinder@@UBE?AV?$TBuf@$0BAA@@@XZ @ 32 NONAME ABSENT
+	?SetEcomRecognizerL@CApaScanningFileRecognizer@@QAEXABVTRecognizer@1@@Z @ 33 NONAME
+	?SetEcomRecognizersFromListL@CApaScanningFileRecognizer@@QAEXABV?$CArrayFixFlat@VTRecognizer@CApaScanningFileRecognizer@@@@@Z @ 34 NONAME
+	?FindAllAppsL@CApaAppRegFinder@@QAEXXZ @ 35 NONAME ; void CApaAppRegFinder::FindAllAppsL(void)
+	?FindAppL@CApaAppRegFinder@@QAE?AV?$TBuf@$0BAA@@@ABVTDesC16@@VTUid@@@Z @ 36 NONAME ABSENT ; class TBuf<256> CApaAppRegFinder::FindAppL(class TDesC16 const &, class TUid)
+	?NewL@CApaAppRegFinder@@SAPAV1@ABVRFs@@@Z @ 37 NONAME ; class CApaAppRegFinder * CApaAppRegFinder::NewL(class RFs const &)
+	?NewLC@CApaAppRegFinder@@SAPAV1@ABVRFs@@@Z @ 38 NONAME ; class CApaAppRegFinder * CApaAppRegFinder::NewLC(class RFs const &)
+	?NextL@CApaAppRegFinder@@QAEHAAVTApaAppEntry@@ABV?$RPointerArray@VHBufC16@@@@@Z @ 39 NONAME ; int CApaAppRegFinder::NextL(class TApaAppEntry &, class RPointerArray<class HBufC16> const &)
+	?TempPath@CApaAppRegFinder@@UBE?AV?$TBuf@$0BAA@@@XZ @ 40 NONAME ABSENT ; class TBuf<256> CApaAppRegFinder::TempPath(void) const
+	??1CAppLaunchChecker@@UAE@XZ @ 41 NONAME ; CAppLaunchChecker::~CAppLaunchChecker(void)
+	??ACApaScanningRuleBasedPlugIns@@QBEPAVCAppLaunchChecker@@H@Z @ 42 NONAME ; class CAppLaunchChecker * CApaScanningRuleBasedPlugIns::operator[](int) const
+	??1CApaScanningRuleBasedPlugIns@@UAE@XZ @ 43 NONAME ; CApaScanningRuleBasedPlugIns::~CApaScanningRuleBasedPlugIns(void)
+	?NewL@CApaScanningRuleBasedPlugIns@@SAPAV1@XZ @ 44 NONAME ; class CApaScanningRuleBasedPlugIns * CApaScanningRuleBasedPlugIns::NewL(void)
+	?ScanForRuleBasedPlugInsL@CApaScanningRuleBasedPlugIns@@QAEXXZ @ 45 NONAME ; void CApaScanningRuleBasedPlugIns::ScanForRuleBasedPlugInsL(void)
+	?ImplementationCount@CApaScanningRuleBasedPlugIns@@QBEHXZ @ 46 NONAME ; int CApaScanningRuleBasedPlugIns::ImplementationCount(void) const
+	?Reserved_1@CAppLaunchChecker@@EAEXXZ @ 47 NONAME ; void CAppLaunchChecker::Reserved_1(void)
+	?Reserved_2@CAppLaunchChecker@@EAEXXZ @ 48 NONAME ; void CAppLaunchChecker::Reserved_2(void)
+	?Reserved_3@CAppLaunchChecker@@EAEXXZ @ 49 NONAME ; void CAppLaunchChecker::Reserved_3(void)
+	??1CAppSidChecker@@UAE@XZ @ 50 NONAME ; CAppSidChecker::~CAppSidChecker(void)
+	?SetRescanCallBackL@CAppSidChecker@@UAEXABVTCallBack@@@Z @ 51 NONAME ; void CAppSidChecker::SetRescanCallBackL(class TCallBack const &)
+	?reserved1@CAppSidChecker@@EAEXXZ @ 52 NONAME ; void CAppSidChecker::reserved1(void)
+	?reserved2@CAppSidChecker@@EAEXXZ @ 53 NONAME ; void CAppSidChecker::reserved2(void)
+	?reserved3@CAppSidChecker@@EAEXXZ @ 54 NONAME ; void CAppSidChecker::reserved3(void)
+	?DriveList@CApaAppRegFinder@@QBEABV?$RArray@VTDriveUnitInfo@@@@XZ @ 55 NONAME ; class RArray<class TDriveUnitInfo> const & CApaAppRegFinder::DriveList(void) const
+	?FindAllRemovableMediaAppsL@CApaAppRegFinder@@QAEXXZ @ 56 NONAME ; void CApaAppRegFinder::FindAllRemovableMediaAppsL(void)
+	??1CApaAppUnInstallMonitor@@UAE@XZ @ 57 NONAME ; CApaAppUnInstallMonitor::~CApaAppUnInstallMonitor(void)
+	?NewL@CApaAppUnInstallMonitor@@SAPAV1@PAVCApaAppListServer@@@Z @ 58 NONAME ; class CApaAppUnInstallMonitor * CApaAppUnInstallMonitor::NewL(class CApaAppListServer *)
+	?Start@CApaAppUnInstallMonitor@@QAEXXZ @ 59 NONAME ; void CApaAppUnInstallMonitor::Start(void)
+	??1CApfMimeContentPolicy@@UAE@XZ @ 60 NONAME ; CApfMimeContentPolicy::~CApfMimeContentPolicy(void)
+	?IsClosedExtension@CApfMimeContentPolicy@@QAEHABVTDesC16@@@Z @ 61 NONAME ; int CApfMimeContentPolicy::IsClosedExtension(class TDesC16 const &)
+	?IsClosedFileL@CApfMimeContentPolicy@@QAEHAAVRFile@@@Z @ 62 NONAME ; int CApfMimeContentPolicy::IsClosedFileL(class RFile &)
+	?IsClosedFileL@CApfMimeContentPolicy@@QAEHABVTDesC16@@@Z @ 63 NONAME ; int CApfMimeContentPolicy::IsClosedFileL(class TDesC16 const &)
+	?IsClosedType@CApfMimeContentPolicy@@QAEHABVTDesC16@@@Z @ 64 NONAME ; int CApfMimeContentPolicy::IsClosedType(class TDesC16 const &)
+	?IsDRMEnvelopeL@CApfMimeContentPolicy@@QAEHAAVRFile@@@Z @ 65 NONAME ; int CApfMimeContentPolicy::IsDRMEnvelopeL(class RFile &)
+	?IsDRMEnvelopeL@CApfMimeContentPolicy@@QAEHABVTDesC16@@@Z @ 66 NONAME ; int CApfMimeContentPolicy::IsDRMEnvelopeL(class TDesC16 const &)
+	?NewL@CApfMimeContentPolicy@@SAPAV1@AAVRFs@@@Z @ 67 NONAME ; class CApfMimeContentPolicy * CApfMimeContentPolicy::NewL(class RFs &)
+	?NewL@CApfMimeContentPolicy@@SAPAV1@XZ @ 68 NONAME ; class CApfMimeContentPolicy * CApfMimeContentPolicy::NewL(void)
+	?NewLC@CApfMimeContentPolicy@@SAPAV1@AAVRFs@@@Z @ 69 NONAME ; class CApfMimeContentPolicy * CApfMimeContentPolicy::NewLC(class RFs &)
+	?NewLC@CApfMimeContentPolicy@@SAPAV1@XZ @ 70 NONAME ; class CApfMimeContentPolicy * CApfMimeContentPolicy::NewLC(void)
+	_E32Dll=__E32Dll	; Entry point for emulation
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/bwins/APGRFX_9_REMOVE_UI_FRAMEWORKS_V1U.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,264 @@
+EXPORTS
+	??0RApaLsSession@@QAE@XZ @ 1 NONAME ; public: __thiscall RApaLsSession::RApaLsSession(void)
+	??0TApaPictureFactory@@QAE@PAVCApaProcess@@@Z @ 2 NONAME ; public: __thiscall TApaPictureFactory::TApaPictureFactory(class CApaProcess *)
+	??0TApaTask@@QAE@AAVRWsSession@@@Z @ 3 NONAME ; public: __thiscall TApaTask::TApaTask(class RWsSession &)
+	??0TApaTaskList@@QAE@AAVRWsSession@@@Z @ 4 NONAME ; public: __thiscall TApaTaskList::TApaTaskList(class RWsSession &)
+	??1CApaAppInfoFileReader@@UAE@XZ @ 5 NONAME ABSENT ; public: virtual __thiscall CApaAppInfoFileReader::~CApaAppInfoFileReader(void)
+	??1CApaAppInfoFileWriter@@UAE@XZ @ 6 NONAME ABSENT ; public: virtual __thiscall CApaAppInfoFileWriter::~CApaAppInfoFileWriter(void)
+	??1CApaAppList@@UAE@XZ @ 7 NONAME ; public: virtual __thiscall CApaAppList::~CApaAppList(void)
+	??1CApaDoor@@UAE@XZ @ 8 NONAME ; public: virtual __thiscall CApaDoor::~CApaDoor(void)
+	??1CApaMaskedBitmap@@UAE@XZ @ 9 NONAME ; public: virtual __thiscall CApaMaskedBitmap::~CApaMaskedBitmap(void)
+	??1CApaWindowGroupName@@UAE@XZ @ 10 NONAME ; public: virtual __thiscall CApaWindowGroupName::~CApaWindowGroupName(void)
+	?AddCaptionL@CApaAppInfoFileWriter@@QAEXW4TLanguage@@ABVTDesC16@@@Z @ 11 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::AddCaptionL(enum TLanguage,class TDesC16 const &)
+	?AddIconL@CApaAppInfoFileWriter@@QAEXAAVCApaMaskedBitmap@@@Z @ 12 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::AddIconL(class CApaMaskedBitmap &)
+	?AddIconL@CApaAppInfoFileWriter@@QAEXABVTDesC16@@@Z @ 13 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::AddIconL(class TDesC16 const &)
+	?AppCount@RApaLsSession@@QBEHAAH@Z @ 14 NONAME ; public: int __thiscall RApaLsSession::AppCount(int &)const 
+	?AppDataByUid@CApaAppList@@QBEPAVCApaAppData@@VTUid@@@Z @ 15 NONAME ; public: class CApaAppData * __thiscall CApaAppList::AppDataByUid(class TUid)const 
+	?AppEntry@CApaAppData@@QBE?AVTApaAppEntry@@XZ @ 16 NONAME ; public: class TApaAppEntry  __thiscall CApaAppData::AppEntry(void)const 
+	?AppUid@CApaWindowGroupName@@QBE?AVTUid@@XZ @ 17 NONAME ; public: class TUid  __thiscall CApaWindowGroupName::AppUid(void)const 
+	?AppUidL@CApaDoor@@QBE?AVTUid@@XZ @ 18 NONAME ; public: class TUid  __thiscall CApaDoor::AppUidL(void)const 
+	?BringToForeground@TApaTask@@QAEXXZ @ 19 NONAME ; public: void __thiscall TApaTask::BringToForeground(void)
+	?Capability@CApaAppData@@QBEXAAVTDes8@@@Z @ 20 NONAME ; public: void __thiscall CApaAppData::Capability(class TDes8 &)const 
+	?Capability@CApaAppInfoFileReader@@QBEXAAVTDes8@@@Z @ 21 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileReader::Capability(class TDes8 &)const 
+	?Caption@CApaWindowGroupName@@QBE?AVTPtrC16@@XZ @ 22 NONAME ; public: class TPtrC16  __thiscall CApaWindowGroupName::Caption(void)const 
+	?CaptionL@CApaAppInfoFileReader@@QAE?AV?$TBuf@$0BAA@@@W4TLanguage@@@Z @ 23 NONAME ABSENT ; public: class TBuf<256>  __thiscall CApaAppInfoFileReader::CaptionL(enum TLanguage)
+	?Connect@RApaLsSession@@QAEHXZ @ 24 NONAME ; public: int __thiscall RApaLsSession::Connect(void)
+	?ConstructFromWgIdL@CApaWindowGroupName@@QAEXH@Z @ 25 NONAME ; public: void __thiscall CApaWindowGroupName::ConstructFromWgIdL(int)
+	?Count@CApaAppList@@QBEHXZ @ 26 NONAME ; public: int __thiscall CApaAppList::Count(void)const 
+	?CreateMaskedBitmapL@CApaAppInfoFileReader@@QAEPAVCApaMaskedBitmap@@H@Z @ 27 NONAME ABSENT ; public: class CApaMaskedBitmap * __thiscall CApaAppInfoFileReader::CreateMaskedBitmapL(int)
+	?CycleTasks@TApaTaskList@@QAEHVTUid@@W4TCycleDirection@1@@Z @ 28 NONAME ; public: int __thiscall TApaTaskList::CycleTasks(class TUid,enum TApaTaskList::TCycleDirection)
+	?DocName@CApaWindowGroupName@@QBE?AVTPtrC16@@XZ @ 29 NONAME ; public: class TPtrC16  __thiscall CApaWindowGroupName::DocName(void)const 
+	?DocNameIsAFile@CApaWindowGroupName@@QBEHXZ @ 30 NONAME ; public: int __thiscall CApaWindowGroupName::DocNameIsAFile(void)const 
+	?DocumentL@CApaDoor@@QAEPAVCApaDocument@@H@Z @ 31 NONAME ; public: class CApaDocument * __thiscall CApaDoor::DocumentL(int)
+	?EmbeddableAppCount@RApaLsSession@@QBEHAAH@Z @ 32 NONAME ; public: int __thiscall RApaLsSession::EmbeddableAppCount(int &)const 
+	?EndTask@TApaTask@@QAEXXZ @ 33 NONAME ; public: void __thiscall TApaTask::EndTask(void)
+	?Exists@TApaTask@@QBEHXZ @ 34 NONAME ; public: int __thiscall TApaTask::Exists(void)const 
+	?ExternalizeL@CApaMaskedBitmap@@QBEXAAVRWriteStream@@@Z @ 35 NONAME ; public: void __thiscall CApaMaskedBitmap::ExternalizeL(class RWriteStream &)const 
+	?FindApp@TApaTaskList@@QAE?AVTApaTask@@ABVTDesC16@@@Z @ 36 NONAME ; public: class TApaTask  __thiscall TApaTaskList::FindApp(class TDesC16 const &)
+	?FindApp@TApaTaskList@@QAE?AVTApaTask@@VTUid@@@Z @ 37 NONAME ; public: class TApaTask  __thiscall TApaTaskList::FindApp(class TUid)
+	?FindByAppUid@CApaWindowGroupName@@SAXVTUid@@AAVRWsSession@@AAH@Z @ 38 NONAME ; public: static void __cdecl CApaWindowGroupName::FindByAppUid(class TUid,class RWsSession &,int &)
+	?FindByCaption@CApaWindowGroupName@@SAXABVTDesC16@@AAVRWsSession@@AAH@Z @ 39 NONAME ; public: static void __cdecl CApaWindowGroupName::FindByCaption(class TDesC16 const &,class RWsSession &,int &)
+	?FindByDocName@CApaWindowGroupName@@SAXABVTDesC16@@AAVRWsSession@@AAH@Z @ 40 NONAME ; public: static void __cdecl CApaWindowGroupName::FindByDocName(class TDesC16 const &,class RWsSession &,int &)
+	?FindByPos@TApaTaskList@@QAE?AVTApaTask@@H@Z @ 41 NONAME ; public: class TApaTask  __thiscall TApaTaskList::FindByPos(int)
+	?FindDoc@TApaTaskList@@QAE?AVTApaTask@@ABVTDesC16@@@Z @ 42 NONAME ; public: class TApaTask  __thiscall TApaTaskList::FindDoc(class TDesC16 const &)
+	?FirstApp@CApaAppList@@QBEPAVCApaAppData@@XZ @ 43 NONAME ; public: class CApaAppData * __thiscall CApaAppList::FirstApp(void)const 
+	?GetAllApps@RApaLsSession@@QBEHXZ @ 44 NONAME ; public: int __thiscall RApaLsSession::GetAllApps(void)const 
+	?GetAppCapability@RApaLsSession@@QBEHAAVTDes8@@VTUid@@@Z @ 45 NONAME ; public: int __thiscall RApaLsSession::GetAppCapability(class TDes8 &,class TUid)const 
+	?GetAppInfo@RApaLsSession@@QBEHAAVTApaAppInfo@@VTUid@@@Z @ 46 NONAME ; public: int __thiscall RApaLsSession::GetAppInfo(class TApaAppInfo &,class TUid)const 
+	?GetEmbeddableApps@RApaLsSession@@QBEHXZ @ 47 NONAME ; public: int __thiscall RApaLsSession::GetEmbeddableApps(void)const 
+	?GetNextApp@RApaLsSession@@QBEHAAVTApaAppInfo@@@Z @ 48 NONAME ; public: int __thiscall RApaLsSession::GetNextApp(class TApaAppInfo &)const 
+	?InternalizeL@CApaMaskedBitmap@@QAEXAAVRReadStream@@@Z @ 49 NONAME ; public: void __thiscall CApaMaskedBitmap::InternalizeL(class RReadStream &)
+	?IsBusy@CApaWindowGroupName@@QBEHXZ @ 50 NONAME ; public: int __thiscall CApaWindowGroupName::IsBusy(void)const 
+	?IsSystem@CApaWindowGroupName@@QBEHXZ @ 51 NONAME ; public: int __thiscall CApaWindowGroupName::IsSystem(void)const 
+	?KillTask@TApaTask@@QAEXXZ @ 52 NONAME ; public: void __thiscall TApaTask::KillTask(void)
+	?Mask@CApaMaskedBitmap@@QBEPAVCFbsBitmap@@XZ @ 53 NONAME ; public: class CFbsBitmap * __thiscall CApaMaskedBitmap::Mask(void)const 
+	?New@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@PAVHBufC16@@@Z @ 54 NONAME ; public: static class CApaWindowGroupName * __cdecl CApaWindowGroupName::New(class RWsSession const &,class HBufC16 *)
+	?NewL@CApaAppInfoFileReader@@SAPAV1@AAVRFs@@ABVTDesC16@@VTUid@@@Z @ 55 NONAME ABSENT ; public: static class CApaAppInfoFileReader * __cdecl CApaAppInfoFileReader::NewL(class RFs &,class TDesC16 const &,class TUid)
+	?NewL@CApaAppList@@SAPAV1@AAVRFs@@PAVCApaAppFinder@@@Z @ 56 NONAME ; public: static class CApaAppList * __cdecl CApaAppList::NewL(class RFs &,class CApaAppFinder *)
+	?NewL@CApaDoor@@SAPAV1@AAVRFs@@AAVCApaDocument@@ABVTSize@@@Z @ 57 NONAME ; public: static class CApaDoor * __cdecl CApaDoor::NewL(class RFs &,class CApaDocument &,class TSize const &)
+	?NewL@CApaDoor@@SAPAV1@AAVRFs@@ABVCStreamStore@@VTStreamId@@AAVCApaProcess@@@Z @ 58 NONAME ; public: static class CApaDoor * __cdecl CApaDoor::NewL(class RFs &,class CStreamStore const &,class TStreamId,class CApaProcess &)
+	?NewL@CApaMaskedBitmap@@SAPAV1@PAV1@@Z @ 59 NONAME ; public: static class CApaMaskedBitmap * __cdecl CApaMaskedBitmap::NewL(class CApaMaskedBitmap *)
+	?NewL@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@@Z @ 60 NONAME ; public: static class CApaWindowGroupName * __cdecl CApaWindowGroupName::NewL(class RWsSession const &)
+	?NewL@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@ABVTDesC16@@@Z @ 61 NONAME ; public: static class CApaWindowGroupName * __cdecl CApaWindowGroupName::NewL(class RWsSession const &,class TDesC16 const &)
+	?NewL@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@H@Z @ 62 NONAME ; public: static class CApaWindowGroupName * __cdecl CApaWindowGroupName::NewL(class RWsSession const &,int)
+	?NewLC@CApaAppInfoFileReader@@SAPAV1@AAVRFs@@ABVTDesC16@@VTUid@@@Z @ 63 NONAME ABSENT ; public: static class CApaAppInfoFileReader * __cdecl CApaAppInfoFileReader::NewLC(class RFs &,class TDesC16 const &,class TUid)
+	?NewLC@CApaAppInfoFileWriter@@SAPAV1@AAVRFs@@ABVTDesC16@@VTUid@@@Z @ 64 NONAME ABSENT ; public: static class CApaAppInfoFileWriter * __cdecl CApaAppInfoFileWriter::NewLC(class RFs &,class TDesC16 const &,class TUid)
+	?NewLC@CApaDoor@@SAPAV1@AAVRFs@@AAVCApaDocument@@ABVTSize@@@Z @ 65 NONAME ; public: static class CApaDoor * __cdecl CApaDoor::NewLC(class RFs &,class CApaDocument &,class TSize const &)
+	?NewLC@CApaMaskedBitmap@@SAPAV1@XZ @ 66 NONAME ; public: static class CApaMaskedBitmap * __cdecl CApaMaskedBitmap::NewLC(void)
+	?NewLC@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@@Z @ 67 NONAME ; public: static class CApaWindowGroupName * __cdecl CApaWindowGroupName::NewLC(class RWsSession const &)
+	?NewLC@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@ABVTDesC16@@@Z @ 68 NONAME ; public: static class CApaWindowGroupName * __cdecl CApaWindowGroupName::NewLC(class RWsSession const &,class TDesC16 const &)
+	?NewLC@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@H@Z @ 69 NONAME ; public: static class CApaWindowGroupName * __cdecl CApaWindowGroupName::NewLC(class RWsSession const &,int)
+	?NewPictureL@TApaPictureFactory@@UBEXAAVTPictureHeader@@ABVCStreamStore@@@Z @ 70 NONAME ; public: virtual void __thiscall TApaPictureFactory::NewPictureL(class TPictureHeader &,class CStreamStore const &)const 
+	?NextApp@CApaAppList@@QBEPAVCApaAppData@@PBV2@@Z @ 71 NONAME ; public: class CApaAppData * __thiscall CApaAppList::NextApp(class CApaAppData const *)const 
+	?PurgeL@CApaAppList@@QAEXXZ @ 72 NONAME ; public: void __thiscall CApaAppList::PurgeL(void)
+	?RespondsToShutdownEvent@CApaWindowGroupName@@QBEHXZ @ 73 NONAME ; public: int __thiscall CApaWindowGroupName::RespondsToShutdownEvent(void)const 
+	?RespondsToSwitchFilesEvent@CApaWindowGroupName@@QBEHXZ @ 74 NONAME ; public: int __thiscall CApaWindowGroupName::RespondsToSwitchFilesEvent(void)const 
+	?RestoreL@CApaDoor@@QAEXABVCStreamStore@@VTStreamId@@@Z @ 75 NONAME ; public: void __thiscall CApaDoor::RestoreL(class CStreamStore const &,class TStreamId)
+	?SendKey@TApaTask@@QAEXABUTKeyEvent@@@Z @ 76 NONAME ; public: void __thiscall TApaTask::SendKey(struct TKeyEvent const &)
+	?SendKey@TApaTask@@QAEXHH@Z @ 77 NONAME ; public: void __thiscall TApaTask::SendKey(int,int)
+	?SendMessage@TApaTask@@QAEHVTUid@@ABVTDesC8@@@Z @ 78 NONAME ; public: int __thiscall TApaTask::SendMessage(class TUid,class TDesC8 const &)
+	?SendSystemEvent@TApaTask@@QAEXW4TApaSystemEvent@@@Z @ 79 NONAME ; public: void __thiscall TApaTask::SendSystemEvent(enum TApaSystemEvent)
+	?SendToBackground@TApaTask@@QAEXXZ @ 80 NONAME ; public: void __thiscall TApaTask::SendToBackground(void)
+	?SetAppUid@CApaWindowGroupName@@QAEXVTUid@@@Z @ 81 NONAME ; public: void __thiscall CApaWindowGroupName::SetAppUid(class TUid)
+	?SetBusy@CApaWindowGroupName@@QAEXH@Z @ 82 NONAME ; public: void __thiscall CApaWindowGroupName::SetBusy(int)
+	?SetCapability@CApaAppInfoFileWriter@@QAEHABVTDesC8@@@Z @ 83 NONAME ABSENT ; public: int __thiscall CApaAppInfoFileWriter::SetCapability(class TDesC8 const &)
+	?SetCaptionL@CApaWindowGroupName@@QAEXABVTDesC16@@@Z @ 84 NONAME ; public: void __thiscall CApaWindowGroupName::SetCaptionL(class TDesC16 const &)
+	?SetDocNameIsAFile@CApaWindowGroupName@@QAEXH@Z @ 85 NONAME ; public: void __thiscall CApaWindowGroupName::SetDocNameIsAFile(int)
+	?SetDocNameL@CApaWindowGroupName@@QAEXABVTDesC16@@@Z @ 86 NONAME ; public: void __thiscall CApaWindowGroupName::SetDocNameL(class TDesC16 const &)
+	?SetFormatToGlassL@CApaDoor@@QAEXXZ @ 87 NONAME ; public: void __thiscall CApaDoor::SetFormatToGlassL(void)
+	?SetFormatToIconL@CApaDoor@@QAEXXZ @ 88 NONAME ; public: void __thiscall CApaDoor::SetFormatToIconL(void)
+	?SetFormatToTemporaryIconL@CApaDoor@@QAEXH@Z @ 89 NONAME ; public: void __thiscall CApaDoor::SetFormatToTemporaryIconL(int)
+	?SetRespondsToShutdownEvent@CApaWindowGroupName@@QAEXH@Z @ 90 NONAME ; public: void __thiscall CApaWindowGroupName::SetRespondsToShutdownEvent(int)
+	?SetRespondsToSwitchFilesEvent@CApaWindowGroupName@@QAEXH@Z @ 91 NONAME ; public: void __thiscall CApaWindowGroupName::SetRespondsToSwitchFilesEvent(int)
+	?SetSystem@CApaWindowGroupName@@QAEXH@Z @ 92 NONAME ; public: void __thiscall CApaWindowGroupName::SetSystem(int)
+	?SetWgId@TApaTask@@QAEXH@Z @ 93 NONAME ; public: void __thiscall TApaTask::SetWgId(int)
+	?SetWindowGroupName@CApaWindowGroupName@@QAEXPAVHBufC16@@@Z @ 94 NONAME ; public: void __thiscall CApaWindowGroupName::SetWindowGroupName(class HBufC16 *)
+	?SetWindowGroupName@CApaWindowGroupName@@QBEHAAVRWindowGroup@@@Z @ 95 NONAME ; public: int __thiscall CApaWindowGroupName::SetWindowGroupName(class RWindowGroup &)const 
+	?SetWindowGroupNameL@CApaWindowGroupName@@QAEXABVTDesC16@@@Z @ 96 NONAME ; public: void __thiscall CApaWindowGroupName::SetWindowGroupNameL(class TDesC16 const &)
+	?StartApp@RApaLsSession@@QAEHABVCApaCommandLine@@@Z @ 97 NONAME ; public: int __thiscall RApaLsSession::StartApp(class CApaCommandLine const &)
+	?StoreL@CApaAppInfoFileWriter@@QAEXXZ @ 98 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::StoreL(void)
+	?StretchDrawL@CApaAppInfoFileReader@@SAXPAVCFbsBitmap@@0VTSize@@@Z @ 99 NONAME ABSENT ; public: static void __cdecl CApaAppInfoFileReader::StretchDrawL(class CFbsBitmap *,class CFbsBitmap *,class TSize)
+	?SwitchCreateFile@TApaTask@@QAEHABVTDesC16@@@Z @ 100 NONAME ; public: int __thiscall TApaTask::SwitchCreateFile(class TDesC16 const &)
+	?SwitchOpenFile@TApaTask@@QAEHABVTDesC16@@@Z @ 101 NONAME ; public: int __thiscall TApaTask::SwitchOpenFile(class TDesC16 const &)
+	?ThreadId@TApaTask@@QBE?AVTThreadId@@XZ @ 102 NONAME ; public: class TThreadId  __thiscall TApaTask::ThreadId(void)const 
+	?UpdateCounter@CApaAppList@@QBEHXZ @ 103 NONAME ; public: int __thiscall CApaAppList::UpdateCounter(void)const 
+	?UpdateL@CApaAppList@@QAEXXZ @ 104 NONAME ; public: void __thiscall CApaAppList::UpdateL(void)
+	?Version@RApaLsSession@@QBE?AVTVersion@@XZ @ 105 NONAME ; public: class TVersion  __thiscall RApaLsSession::Version(void)const 
+	?WgId@TApaTask@@QBEHXZ @ 106 NONAME ; public: int __thiscall TApaTask::WgId(void)const 
+	?WindowGroupName@CApaWindowGroupName@@QBE?AVTPtrC16@@XZ @ 107 NONAME ; public: class TPtrC16  __thiscall CApaWindowGroupName::WindowGroupName(void)const 
+	??1CApaSystemControlList@@UAE@XZ @ 108 NONAME ; public: virtual __thiscall CApaSystemControlList::~CApaSystemControlList(void)
+	?Caption@CApaSystemControl@@QBE?AVTPtrC16@@XZ @ 109 NONAME ; public: class TPtrC16  __thiscall CApaSystemControl::Caption(void)const 
+	?Control@CApaSystemControlList@@QBEPAVCApaSystemControl@@H@Z @ 110 NONAME ; public: class CApaSystemControl * __thiscall CApaSystemControlList::Control(int)const 
+	?Control@CApaSystemControlList@@QBEPAVCApaSystemControl@@VTUid@@@Z @ 111 NONAME ; public: class CApaSystemControl * __thiscall CApaSystemControlList::Control(class TUid)const 
+	?Count@CApaSystemControlList@@QBEHXZ @ 112 NONAME ; public: int __thiscall CApaSystemControlList::Count(void)const 
+	?CreateL@CApaSystemControl@@QAEXXZ @ 113 NONAME ; public: void __thiscall CApaSystemControl::CreateL(void)
+	?FileName@CApaSystemControl@@QBE?AV?$TBuf@$0BAA@@@XZ @ 114 NONAME ; public: class TBuf<256>  __thiscall CApaSystemControl::FileName(void)const 
+	?Icon@CApaSystemControl@@QBEPAVCApaMaskedBitmap@@XZ @ 115 NONAME ; public: class CApaMaskedBitmap * __thiscall CApaSystemControl::Icon(void)const 
+	?Index@CApaSystemControlList@@QBEHVTUid@@@Z @ 116 NONAME ; public: int __thiscall CApaSystemControlList::Index(class TUid)const 
+	?NewL@CApaSystemControlList@@SAPAV1@AAVRFs@@AAVCApaAppFinder@@ABVTDesC16@@@Z @ 117 NONAME ABSENT ; public: static class CApaSystemControlList * __cdecl CApaSystemControlList::NewL(class RFs &,class CApaAppFinder &,class TDesC16 const &)
+	?Type@CApaSystemControl@@QBE?AVTUid@@XZ @ 118 NONAME ; public: class TUid  __thiscall CApaSystemControl::Type(void)const 
+	?UpdateL@CApaSystemControlList@@QAEXXZ @ 119 NONAME ; public: void __thiscall CApaSystemControlList::UpdateL(void)
+	?AddDataTypeL@CApaAppInfoFileWriter@@QAEXABVTDataTypeWithPriority@@@Z @ 120 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::AddDataTypeL(class TDataTypeWithPriority const &)
+	?AppForDataType@RApaLsSession@@QBEHABVTDataType@@AAVTUid@@@Z @ 121 NONAME ; public: int __thiscall RApaLsSession::AppForDataType(class TDataType const &,class TUid &)const 
+	?AppForDocument@RApaLsSession@@QBEHABVTDesC16@@AAVTUid@@AAVTDataType@@@Z @ 122 NONAME ; public: int __thiscall RApaLsSession::AppForDocument(class TDesC16 const &,class TUid &,class TDataType &)const 
+	?CreateDocument@RApaLsSession@@QAEHABVTDesC16@@VTUid@@AAVTThreadId@@W4TLaunchType@1@@Z @ 123 NONAME ; public: int __thiscall RApaLsSession::CreateDocument(class TDesC16 const &,class TUid,class TThreadId &,enum RApaLsSession::TLaunchType)
+	?DataType@CApaAppData@@QBEFABVTDataType@@@Z @ 124 NONAME ; public: short __thiscall CApaAppData::DataType(class TDataType const &)const 
+	?DataTypesSupportedL@CApaAppInfoFileReader@@QBEXAAV?$CArrayFix@VTDataTypeWithPriority@@@@@Z @ 125 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileReader::DataTypesSupportedL(class CArrayFix<class TDataTypeWithPriority> &)const 
+	?GetAcceptedConfidence@RApaLsSession@@QBEHAAH@Z @ 126 NONAME ; public: int __thiscall RApaLsSession::GetAcceptedConfidence(int &)const 
+	?GetAppIcon@RApaLsSession@@QBEHVTUid@@HAAVCApaMaskedBitmap@@@Z @ 127 NONAME ; public: int __thiscall RApaLsSession::GetAppIcon(class TUid,int,class CApaMaskedBitmap &)const 
+	?GetMaxDataBufSize@RApaLsSession@@QBEHAAH@Z @ 128 NONAME ; public: int __thiscall RApaLsSession::GetMaxDataBufSize(int &)const 
+	?GetSupportedDataTypesL@RApaLsSession@@QBEHAAV?$CArrayFixFlat@VTDataType@@@@@Z @ 129 NONAME ; public: int __thiscall RApaLsSession::GetSupportedDataTypesL(class CArrayFixFlat<class TDataType> &)const 
+	?IsProgram@RApaLsSession@@QBEHABVTDesC16@@AAH@Z @ 130 NONAME ; public: int __thiscall RApaLsSession::IsProgram(class TDesC16 const &,int &)const 
+	?PreferredDataHandlerL@CApaAppList@@QBE?AVTUid@@ABVTDataType@@@Z @ 131 NONAME ; public: class TUid  __thiscall CApaAppList::PreferredDataHandlerL(class TDataType const &)const 
+	?RecognizeData@RApaLsSession@@QBEHABVTDesC16@@ABVTDesC8@@AAVTDataRecognitionResult@@@Z @ 132 NONAME ; public: int __thiscall RApaLsSession::RecognizeData(class TDesC16 const &,class TDesC8 const &,class TDataRecognitionResult &)const 
+	?RecognizeSpecificData@RApaLsSession@@QBEHABVTDesC16@@ABVTDesC8@@ABVTDataType@@AAH@Z @ 133 NONAME ; public: int __thiscall RApaLsSession::RecognizeSpecificData(class TDesC16 const &,class TDesC8 const &,class TDataType const &,int &)const 
+	?SetAcceptedConfidence@RApaLsSession@@QAEHH@Z @ 134 NONAME ; public: int __thiscall RApaLsSession::SetAcceptedConfidence(int)
+	?SetMaxDataBufSize@RApaLsSession@@QAEHH@Z @ 135 NONAME ; public: int __thiscall RApaLsSession::SetMaxDataBufSize(int)
+	?StartDocument@RApaLsSession@@QAEHABVTDesC16@@AAVTThreadId@@W4TLaunchType@1@@Z @ 136 NONAME ; public: int __thiscall RApaLsSession::StartDocument(class TDesC16 const &,class TThreadId &,enum RApaLsSession::TLaunchType)
+	?StartDocument@RApaLsSession@@QAEHABVTDesC16@@ABVTDataType@@AAVTThreadId@@W4TLaunchType@1@@Z @ 137 NONAME ; public: int __thiscall RApaLsSession::StartDocument(class TDesC16 const &,class TDataType const &,class TThreadId &,enum RApaLsSession::TLaunchType)
+	?StartDocument@RApaLsSession@@QAEHABVTDesC16@@VTUid@@AAVTThreadId@@W4TLaunchType@1@@Z @ 138 NONAME ; public: int __thiscall RApaLsSession::StartDocument(class TDesC16 const &,class TUid,class TThreadId &,enum RApaLsSession::TLaunchType)
+	?StartIdleUpdateL@CApaAppList@@QAEXXZ @ 139 NONAME ; public: void __thiscall CApaAppList::StartIdleUpdateL(void)
+	??1CApaAppListNotifier@@UAE@XZ @ 140 NONAME ; public: virtual __thiscall CApaAppListNotifier::~CApaAppListNotifier(void)
+	?NewL@CApaAppListNotifier@@SAPAV1@PAVMApaAppListServObserver@@W4TPriority@CActive@@@Z @ 141 NONAME ; public: static class CApaAppListNotifier * __cdecl CApaAppListNotifier::NewL(class MApaAppListServObserver *,enum CActive::TPriority)
+	?StartIdleUpdateL@CApaAppList@@QAEXPAVMApaAppListObserver@@@Z @ 142 NONAME ; public: void __thiscall CApaAppList::StartIdleUpdateL(class MApaAppListObserver *)
+	?GetAppIcon@RApaLsSession@@QBEHVTUid@@VTSize@@AAVCApaMaskedBitmap@@@Z @ 143 NONAME ; public: int __thiscall RApaLsSession::GetAppIcon(class TUid,class TSize,class CApaMaskedBitmap &)const 
+	?GetAppIconSizes@RApaLsSession@@QBEHVTUid@@AAV?$CArrayFixFlat@VTSize@@@@@Z @ 144 NONAME ; public: int __thiscall RApaLsSession::GetAppIconSizes(class TUid,class CArrayFixFlat<class TSize> &)const 
+	?Icon@CApaAppData@@QBEPAVCApaMaskedBitmap@@VTSize@@@Z @ 145 NONAME ; public: class CApaMaskedBitmap * __thiscall CApaAppData::Icon(class TSize)const 
+	?IconSizesL@CApaAppData@@QBEPAV?$CArrayFixFlat@VTSize@@@@XZ @ 146 NONAME ; public: class CArrayFixFlat<class TSize> * __thiscall CApaAppData::IconSizesL(void)const 
+	?Icon@CApaAppData@@QBEPAVCApaMaskedBitmap@@H@Z @ 147 NONAME ; public: class CApaMaskedBitmap * __thiscall CApaAppData::Icon(int)const 
+	?Hidden@CApaWindowGroupName@@QAEHXZ @ 148 NONAME ; public: int __thiscall CApaWindowGroupName::Hidden(void)
+	?SetHidden@CApaWindowGroupName@@QAEXH@Z @ 149 NONAME ; public: void __thiscall CApaWindowGroupName::SetHidden(int)
+	?AddViewCaptionL@CApaAppInfoFileWriter@@QAEXW4TLanguage@@ABVTDesC16@@VTUid@@@Z @ 150 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::AddViewCaptionL(enum TLanguage,class TDesC16 const &,class TUid)
+	?AddViewIconL@CApaAppInfoFileWriter@@QAEXAAVCApaMaskedBitmap@@VTUid@@@Z @ 151 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::AddViewIconL(class CApaMaskedBitmap &,class TUid)
+	?AddViewL@CApaAppInfoFileWriter@@QAEXVTUid@@@Z @ 152 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::AddViewL(class TUid)
+	?CaptionL@CApaAIFViewData@@QBE?AV?$TBuf@$0BAA@@@W4TLanguage@@@Z @ 153 NONAME ABSENT ; public: class TBuf<256>  __thiscall CApaAIFViewData::CaptionL(enum TLanguage)const 
+	?GetAppViewIcon@RApaLsSession@@QBEHVTUid@@0ABVTSize@@AAVCApaMaskedBitmap@@@Z @ 154 NONAME ; public: int __thiscall RApaLsSession::GetAppViewIcon(class TUid,class TUid,class TSize const &,class CApaMaskedBitmap &)const 
+	?GetAppViews@RApaLsSession@@QBEHAAV?$CArrayFixFlat@VTApaAppViewInfo@@@@VTUid@@@Z @ 155 NONAME ; public: int __thiscall RApaLsSession::GetAppViews(class CArrayFixFlat<class TApaAppViewInfo> &,class TUid)const 
+	?GetViewsL@CApaAppInfoFileReader@@QBEXAAV?$CArrayPtr@VCApaAIFViewData@@@@@Z @ 156 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileReader::GetViewsL(class CArrayPtr<class CApaAIFViewData> &)const 
+	?Icon@CApaAppViewData@@QBEPAVCApaMaskedBitmap@@ABVTSize@@@Z @ 157 NONAME ; public: class CApaMaskedBitmap * __thiscall CApaAppViewData::Icon(class TSize const &)const 
+	?IconByIndexL@CApaAIFViewData@@QBEPAVCApaMaskedBitmap@@H@Z @ 158 NONAME ABSENT ; public: class CApaMaskedBitmap * __thiscall CApaAIFViewData::IconByIndexL(int)const 
+	?IconSizesL@CApaAppViewData@@QBEPAV?$CArrayFixFlat@VTSize@@@@XZ @ 159 NONAME ; public: class CArrayFixFlat<class TSize> * __thiscall CApaAppViewData::IconSizesL(void)const 
+	?NumberOfIcons@CApaAIFViewData@@QBEHXZ @ 160 NONAME ABSENT ; public: int __thiscall CApaAIFViewData::NumberOfIcons(void)const 
+	?StoreViewL@CApaAppInfoFileWriter@@QAEXVTUid@@@Z @ 161 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::StoreViewL(class TUid)
+	?Uid@CApaAppViewData@@QBE?AVTUid@@XZ @ 162 NONAME ; public: class TUid  __thiscall CApaAppViewData::Uid(void)const 
+	?ViewUid@CApaAIFViewData@@QBE?AVTUid@@XZ @ 163 NONAME ABSENT ; public: class TUid  __thiscall CApaAIFViewData::ViewUid(void)const 
+	?Views@CApaAppData@@QBEPAV?$CArrayPtrFlat@VCApaAppViewData@@@@XZ @ 164 NONAME ; public: class CArrayPtrFlat<class CApaAppViewData> * __thiscall CApaAppData::Views(void)const 
+	?AddOwnedFileL@CApaAppInfoFileWriter@@QAEXABVTDesC16@@@Z @ 165 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::AddOwnedFileL(class TDesC16 const &)
+	?GetOwnedFilesL@CApaAppInfoFileReader@@QBEXAAVCDesC16Array@@@Z @ 166 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileReader::GetOwnedFilesL(class CDesC16Array &)const 
+	?OwnedFiles@CApaAppData@@QBEPAVCDesC16Array@@XZ @ 167 NONAME ; public: class CDesC16Array * __thiscall CApaAppData::OwnedFiles(void)const 
+	?GetAppOwnedFiles@RApaLsSession@@QBEHAAVCDesC16Array@@VTUid@@@Z @ 168 NONAME ; public: int __thiscall RApaLsSession::GetAppOwnedFiles(class CDesC16Array &,class TUid)const 
+	?StartApp@RApaLsSession@@QAEHABVCApaCommandLine@@AAVTThreadId@@@Z @ 169 NONAME ; public: int __thiscall RApaLsSession::StartApp(class CApaCommandLine const &,class TThreadId &)
+	?GetAifFileName@AppInfoFileUtils@@SAXABVRFs@@AAVTDes16@@@Z @ 170 NONAME ABSENT ; public: static void __cdecl AppInfoFileUtils::GetAifFileName(class RFs const &,class TDes16 &)
+	?AddViewL@CApaAppInfoFileWriter@@QAEXVTUid@@H@Z @ 171 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::AddViewL(class TUid,int)
+	?CanUseScreenMode@CApaAppData@@QAEHH@Z @ 172 NONAME ; public: int __thiscall CApaAppData::CanUseScreenMode(int)
+	?FirstApp@CApaAppList@@QBEPAVCApaAppData@@H@Z @ 173 NONAME ; public: class CApaAppData * __thiscall CApaAppList::FirstApp(int)const 
+	?GetAllApps@RApaLsSession@@QBEHH@Z @ 174 NONAME ; public: int __thiscall RApaLsSession::GetAllApps(int)const 
+	?GetEmbeddableApps@RApaLsSession@@QBEHH@Z @ 175 NONAME ; public: int __thiscall RApaLsSession::GetEmbeddableApps(int)const 
+	?GetNextApp@RApaLsSession@@QBEHAAVTApaAppInfo@@H@Z @ 176 NONAME ; public: int __thiscall RApaLsSession::GetNextApp(class TApaAppInfo &,int)const 
+	?NextApp@CApaAppList@@QBEPAVCApaAppData@@PBV2@H@Z @ 177 NONAME ; public: class CApaAppData * __thiscall CApaAppList::NextApp(class CApaAppData const *,int)const 
+	?ScreenMode@CApaAIFViewData@@QBEHXZ @ 178 NONAME ABSENT ; public: int __thiscall CApaAIFViewData::ScreenMode(void)const 
+	?ScreenMode@CApaAppViewData@@QBEHXZ @ 179 NONAME ; public: int __thiscall CApaAppViewData::ScreenMode(void)const 
+	?ShortCaption@CApaSystemControl@@QBE?AVTPtrC16@@XZ @ 180 NONAME ; public: class TPtrC16  __thiscall CApaSystemControl::ShortCaption(void)const 
+	?IsIdleUpdateComplete@CApaAppList@@QBEHXZ @ 181 NONAME ; public: int __thiscall CApaAppList::IsIdleUpdateComplete(void)const 
+	?IsAppReady@CApaWindowGroupName@@QBEHXZ @ 182 NONAME ; public: int __thiscall CApaWindowGroupName::IsAppReady(void)const 
+	?SetAppReady@CApaWindowGroupName@@QAEXH@Z @ 183 NONAME ; public: void __thiscall CApaWindowGroupName::SetAppReady(int)
+	?InitListL@CApaAppList@@QAEXPAVMApaAppListObserver@@@Z @ 184 NONAME ; public: void __thiscall CApaAppList::InitListL(class MApaAppListObserver *)
+	?NumberOfBitmaps@CApaAppInfoFileReader@@QBEHXZ @ 185 NONAME ABSENT ; public: int __thiscall CApaAppInfoFileReader::NumberOfBitmaps(void)const 
+	?IsFirstScanComplete@CApaAppList@@QBEHXZ @ 186 NONAME ; public: int __thiscall CApaAppList::IsFirstScanComplete(void)const 
+	?SetMaskBitmap@CApaMaskedBitmap@@QAEXPAVCFbsBitmap@@@Z @ 187 NONAME ; public: void __thiscall CApaMaskedBitmap::SetMaskBitmap(class CFbsBitmap *)
+	?GetAppInfo_7_0@RApaLsSession@@ABEHAAVTApaAppInfo_7_0@@VTUid@@@Z @ 188 NONAME ABSENT ; int RApaLsSession::GetAppInfo_7_0(class TApaAppInfo_7_0 &, class TUid) const
+	?GetNextApp_7_0@RApaLsSession@@ABEHAAVTApaAppInfo_7_0@@@Z @ 189 NONAME ABSENT ; int RApaLsSession::GetNextApp_7_0(class TApaAppInfo_7_0 &) const
+	?GetNextApp_7_0@RApaLsSession@@ABEHAAVTApaAppInfo_7_0@@H@Z @ 190 NONAME ABSENT ; int RApaLsSession::GetNextApp_7_0(class TApaAppInfo_7_0 &, int) const
+	?GetIconInfo@CApaAppData@@QAEXAAH0@Z @ 191 NONAME ; public: void __thiscall CApaAppData::GetIconInfo(int &,int &)
+	?NumberOfOwnDefinedIcons@RApaLsSession@@QBEHVTUid@@AAH@Z @ 192 NONAME ; public: int __thiscall RApaLsSession::NumberOfOwnDefinedIcons(class TUid,int &)const 
+	?GetFilteredApps@RApaLsSession@@QBEHABVTApaEmbeddabilityFilter@@@Z @ 193 NONAME ; public: int __thiscall RApaLsSession::GetFilteredApps(class TApaEmbeddabilityFilter const &)const 
+	?GetFilteredApps@RApaLsSession@@QBEHABVTApaEmbeddabilityFilter@@H@Z @ 194 NONAME ; public: int __thiscall RApaLsSession::GetFilteredApps(class TApaEmbeddabilityFilter const &,int)const 
+	?NewL@CApaAppList@@SAPAV1@AAVRFs@@PAVCApaAppFinder@@PAVCApaAppRegFinder@@@Z @ 195 NONAME ; class CApaAppList * CApaAppList::NewL(class RFs &, class CApaAppFinder *, class CApaAppRegFinder *)
+	?DefaultScreenNumber@CApaAppData@@QBEIXZ @ 196 NONAME ; unsigned int CApaAppData::DefaultScreenNumber(void) const
+	?GetFilteredApps@RApaLsSession@@QBEHII@Z @ 197 NONAME ; int RApaLsSession::GetFilteredApps(unsigned int, unsigned int) const
+	?GetFilteredApps@RApaLsSession@@QBEHIIH@Z @ 198 NONAME ; int RApaLsSession::GetFilteredApps(unsigned int, unsigned int, int) const
+	?RegistrationFileUsed@CApaAppData@@QBEHXZ @ 199 NONAME ; int CApaAppData::RegistrationFileUsed(void) const
+	?GetAppIcon@RApaLsSession@@QBEHVTUid@@AAPAVHBufC16@@@Z @ 200 NONAME ; int RApaLsSession::GetAppIcon(class TUid, class HBufC16 * &) const
+	?IconFileName@CApaAppData@@QBE?AVTPtrC16@@XZ @ 201 NONAME ; class TPtrC16 CApaAppData::IconFileName(void) const
+	?GetAppViewIcon@RApaLsSession@@QBEHVTUid@@0AAPAVHBufC16@@@Z @ 202 NONAME ; int RApaLsSession::GetAppViewIcon(class TUid, class TUid, class HBufC16 * &) const
+	?IconFileName@CApaAppViewData@@QBE?AVTPtrC16@@XZ @ 203 NONAME ; class TPtrC16 CApaAppViewData::IconFileName(void) const
+	?NonMbmIconFile@CApaAppData@@QBEHXZ @ 204 NONAME ; int CApaAppData::NonMbmIconFile(void) const
+	?NonMbmIconFile@CApaAppViewData@@QBEHXZ @ 205 NONAME ; int CApaAppViewData::NonMbmIconFile(void) const
+	?StartupApaServer@@YAHAAVMApaAppStarter@@@Z @ 206 NONAME ; int StartupApaServer(class MApaAppStarter &)
+	?StartupApaServerProcess@@YAHXZ @ 207 NONAME ; int StartupApaServerProcess(void)
+	?DeleteDataMapping@RApaLsSession@@QAEHABVTDataType@@@Z @ 208 NONAME ; int RApaLsSession::DeleteDataMapping(class TDataType const &)
+	?InsertDataMapping@RApaLsSession@@QAEHABVTDataType@@FVTUid@@@Z @ 209 NONAME ; int RApaLsSession::InsertDataMapping(class TDataType const &, short, class TUid)
+	?InsertDataMappingIfHigher@RApaLsSession@@QAEHABVTDataType@@FVTUid@@AAH@Z @ 210 NONAME ; int RApaLsSession::InsertDataMappingIfHigher(class TDataType const &, short, class TUid, int &)
+	?ApplicationLanguage@CApaAppData@@QBE?AW4TLanguage@@XZ @ 211 NONAME ; enum TLanguage CApaAppData::ApplicationLanguage(void) const
+	?ApplicationLanguage@RApaLsSession@@QBEHVTUid@@AAW4TLanguage@@@Z @ 212 NONAME ; int RApaLsSession::ApplicationLanguage(class TUid, enum TLanguage &) const
+	?NewL@CApaSystemControlList@@SAPAV1@AAVRFs@@@Z @ 213 NONAME ; class CApaSystemControlList * CApaSystemControlList::NewL(class RFs &)
+	?AppForDataTypeAndService@RApaLsSession@@QBEHABVTDataType@@VTUid@@AAV3@@Z @ 214 NONAME ; int RApaLsSession::AppForDataTypeAndService(class TDataType const &, class TUid, class TUid &) const
+	?AppForDocumentAndService@RApaLsSession@@QBEHAAVRFile@@VTUid@@AAV3@AAVTDataType@@@Z @ 215 NONAME ; int RApaLsSession::AppForDocumentAndService(class RFile &, class TUid, class TUid &, class TDataType &) const
+	?AppForDocumentAndService@RApaLsSession@@QBEHABVTDesC16@@VTUid@@AAV3@AAVTDataType@@@Z @ 216 NONAME ; int RApaLsSession::AppForDocumentAndService(class TDesC16 const &, class TUid, class TUid &, class TDataType &) const
+	?GetAppServiceOpaqueDataLC@RApaLsSession@@QBEPAVCApaAppServiceInfoArray@@VTUid@@0@Z @ 217 NONAME ; class CApaAppServiceInfoArray * RApaLsSession::GetAppServiceOpaqueDataLC(class TUid, class TUid) const
+	?GetAppServicesL@RApaLsSession@@QBEXVTUid@@AAV?$CArrayFixFlat@VTUid@@@@@Z @ 218 NONAME ; void RApaLsSession::GetAppServicesL(class TUid, class CArrayFixFlat<class TUid> &) const
+	?GetAppServicesLC@RApaLsSession@@QBEPAVCApaAppServiceInfoArray@@VTUid@@@Z @ 219 NONAME ; class CApaAppServiceInfoArray * RApaLsSession::GetAppServicesLC(class TUid) const
+	?GetServerApps@RApaLsSession@@QBEHVTUid@@@Z @ 220 NONAME ; int RApaLsSession::GetServerApps(class TUid) const
+	?GetServerApps@RApaLsSession@@QBEHVTUid@@H@Z @ 221 NONAME ; int RApaLsSession::GetServerApps(class TUid, int) const
+	?GetServiceImplementationsLC@RApaLsSession@@QBEPAVCApaAppServiceInfoArray@@VTUid@@@Z @ 222 NONAME ; class CApaAppServiceInfoArray * RApaLsSession::GetServiceImplementationsLC(class TUid) const
+	?ImplementsService@CApaAppData@@QBEHVTUid@@@Z @ 223 NONAME ; int CApaAppData::ImplementsService(class TUid) const
+	?OpaqueData@TApaAppServiceInfo@@QBEABVTDesC8@@XZ @ 224 NONAME ; class TDesC8 const & TApaAppServiceInfo::OpaqueData(void) const
+	?PreferredDataHandlerL@CApaAppList@@QBE?AVTUid@@ABVTDataType@@PBV2@@Z @ 225 NONAME ; class TUid CApaAppList::PreferredDataHandlerL(class TDataType const &, class TUid const *) const
+	?ServiceArrayBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@@Z @ 226 NONAME ; class CBufFlat * CApaAppList::ServiceArrayBufferL(class TUid) const
+	?ServiceImplArrayBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@@Z @ 227 NONAME ; class CBufFlat * CApaAppList::ServiceImplArrayBufferL(class TUid) const
+	?ServiceOpaqueDataBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@0@Z @ 228 NONAME ; class CBufFlat * CApaAppList::ServiceOpaqueDataBufferL(class TUid, class TUid) const
+	?ServiceUidBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@@Z @ 229 NONAME ; class CBufFlat * CApaAppList::ServiceUidBufferL(class TUid) const
+	?Uid@TApaAppServiceInfo@@QBE?AVTUid@@XZ @ 230 NONAME ; class TUid TApaAppServiceInfo::Uid(void) const
+	?StartDocument@RApaLsSession@@QAEHAAVRFile@@AAVTThreadId@@PAVTRequestStatus@@@Z @ 231 NONAME ; int RApaLsSession::StartDocument(class RFile &, class TThreadId &, class TRequestStatus *)
+	?CreateMaskedBitmapByIndexLC@CApaAppInfoFileReader@@QAEPAVCApaMaskedBitmap@@H@Z @ 232 NONAME ABSENT ; class CApaMaskedBitmap * CApaAppInfoFileReader::CreateMaskedBitmapByIndexLC(int)
+	?CancelListPopulationCompleteObserver@RApaLsSession@@QBEHXZ @ 233 NONAME ; int RApaLsSession::CancelListPopulationCompleteObserver(void) const
+	?RegisterListPopulationCompleteObserver@RApaLsSession@@QBEXAAVTRequestStatus@@@Z @ 234 NONAME ; void RApaLsSession::RegisterListPopulationCompleteObserver(class TRequestStatus &) const
+	?NewInterimFormatFileWriterLC@ForJavaMIDletInstaller@@SAPAVCApaAppInfoFileWriter@@AAVRFs@@ABVTDesC16@@VTUid@@KH@Z @ 235 NONAME ABSENT ; class CApaAppInfoFileWriter * ForJavaMIDletInstaller::NewInterimFormatFileWriterLC(class RFs &, class TDesC16 const &, class TUid, unsigned long, int)
+	?CheckInterimFormatFileNotCorruptL@ForJavaMIDletInstaller@@SAXAAVRFile@@@Z @ 236 NONAME ABSENT ; void ForJavaMIDletInstaller::CheckInterimFormatFileNotCorruptL(class RFile &)
+	?RegisterJavaMIDletViaIterimFormat@RApaLsSession@@QAEHABVTDesC16@@AAVRFile@@@Z @ 237 NONAME ABSENT ; int RApaLsSession::RegisterJavaMIDletViaIterimFormat(class TDesC16 const &, class RFile &)
+	?DeregisterJavaMIDlet@RApaLsSession@@QAEHABVTDesC16@@@Z @ 238 NONAME ABSENT ; int RApaLsSession::DeregisterJavaMIDlet(class TDesC16 const &)
+	?AppForDocument@RApaLsSession@@QBEHAAVRFile@@AAVTUid@@AAVTDataType@@@Z @ 239 NONAME ; int RApaLsSession::AppForDocument(class RFile &, class TUid &, class TDataType &) const
+	?ClearFsSession@RApaLsSession@@SAXXZ @ 240 NONAME ; void RApaLsSession::ClearFsSession(void)
+	?FsSession@RApaLsSession@@SAPAVRFs@@XZ @ 241 NONAME ; class RFs * RApaLsSession::FsSession(void)
+	?RecognizeData@RApaLsSession@@QBEHAAVRFile@@AAVTDataRecognitionResult@@@Z @ 242 NONAME ; int RApaLsSession::RecognizeData(class RFile &, class TDataRecognitionResult &) const
+	?RecognizeSpecificData@RApaLsSession@@QBEHAAVRFile@@ABVTDataType@@AAH@Z @ 243 NONAME ; int RApaLsSession::RecognizeSpecificData(class RFile &, class TDataType const &, int &) const
+	?SetFsSessionL@RApaLsSession@@SAXAAVRFs@@@Z @ 244 NONAME ; void RApaLsSession::SetFsSessionL(class RFs &)
+	?StartDocument@RApaLsSession@@QAEHAAVRFile@@ABVTDataType@@AAVTThreadId@@PAVTRequestStatus@@@Z @ 245 NONAME ; int RApaLsSession::StartDocument(class RFile &, class TDataType const &, class TThreadId &, class TRequestStatus *)
+	?StartDocument@RApaLsSession@@QAEHAAVRFile@@VTUid@@AAVTThreadId@@PAVTRequestStatus@@@Z @ 246 NONAME ; int RApaLsSession::StartDocument(class RFile &, class TUid, class TThreadId &, class TRequestStatus *)
+	?GetPreferredBufSize@RApaLsSession@@QBEHAAH@Z @ 247 NONAME ; public: int __thiscall RApaLsSession::GetPreferredBufSize(int &)const 
+	?GetJavaMIDletInfoL@ForJavaMIDletInstaller@@SAXAAVRFs@@ABVTDesC16@@AAK2@Z @ 248 NONAME ABSENT ; void ForJavaMIDletInstaller::GetJavaMIDletInfoL(class RFs &, class TDesC16 const &, unsigned long &, unsigned long &)
+	?HandleAsRegistrationFile@ApaUtils@@SAHABVTUidType@@@Z @ 249 NONAME ; int ApaUtils::HandleAsRegistrationFile(class TUidType const &)
+	?DataTypes@TApaAppServiceInfo@@QBEABV?$CArrayFixFlat@VTDataTypeWithPriority@@@@XZ @ 250 NONAME ; class CArrayFixFlat<class TDataTypeWithPriority> const & TApaAppServiceInfo::DataTypes(void) const
+	?GetServiceImplementationsLC@RApaLsSession@@QBEPAVCApaAppServiceInfoArray@@VTUid@@ABVTDataType@@@Z @ 251 NONAME ; class CApaAppServiceInfoArray * RApaLsSession::GetServiceImplementationsLC(class TUid, class TDataType const &) const
+	?ServiceImplArrayBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@ABVTDataType@@@Z @ 252 NONAME ; class CBufFlat * CApaAppList::ServiceImplArrayBufferL(class TUid, class TDataType const &) const
+	?Close@RApaLsSession@@QAEXXZ @ 253 NONAME ; void RApaLsSession::Close(void)
+	?RegisterNonNativeApplicationType@RApaLsSession@@QAEHVTUid@@ABVTDesC16@@@Z @ 254 NONAME ; int RApaLsSession::RegisterNonNativeApplicationType(class TUid, class TDesC16 const &)
+	?DeregisterNonNativeApplicationType@RApaLsSession@@QAEHVTUid@@@Z @ 255 NONAME ; int RApaLsSession::DeregisterNonNativeApplicationType(class TUid)
+	?RegisterNonNativeApplication@RApaLsSession@@QAEHVTUid@@AAVRFile@@PAV3@2@Z @ 256 NONAME ; int RApaLsSession::RegisterNonNativeApplication(class TUid, class RFile &, class RFile &, class RFile &)
+	?DeregisterNonNativeApplication@RApaLsSession@@QAEHVTUid@@@Z @ 257 NONAME ; int RApaLsSession::DeregisterNonNativeApplication(class TUid)
+	?AppDataByFileName@CApaAppList@@QBEPAVCApaAppData@@ABVTDesC16@@@Z @ 258 NONAME ; class CApaAppData* CApaAppList::AppDataByFileName(class TDesC16 const &) const
+	?LocalisableResourceFileName@CApaAppData@@QBE?AVTPtrC16@@XZ @ 259 NONAME ; class TPtrC16 CApaAppData::LocalisableResourceFileName(void) const
+	?OpaqueData@CApaAppData@@QBE?AVTPtrC8@@XZ @ 260 NONAME ; class TPtrC8 CApaAppData::OpaqueData(void) const
+	?RegistrationFileName@CApaAppData@@QBE?AVTPtrC16@@XZ @ 261 NONAME ; class TPtrC16 CApaAppData::RegistrationFileName(void) const
+	?SetAppShortCaption@RApaLsSession@@QAEHABVTDesC16@@W4TLanguage@@VTUid@@@Z @ 262 NONAME ; int RApaLsSession::SetAppShortCaption(class TDesC16 const &, enum TLanguage, class TUid)
+	?CheckAppSecurity@CApaSecurityUtils@@SAHABVTPtrC16@@AAH1@Z @ 263 NONAME ; int CApaSecurityUtils::CheckAppSecurity(class TPtrC16 const &, int &, int &)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/bwins/APGRFX_9_REMOVE_UI_FRAMEWORKS_V1_EXCEPT_REMNANT_FOR_JAVA_MIDLET_INSTALLERU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,334 @@
+EXPORTS
+	??0RApaLsSession@@QAE@XZ @ 1 NONAME ; public: __thiscall RApaLsSession::RApaLsSession(void)
+	??0TApaPictureFactory@@QAE@PAVCApaProcess@@@Z @ 2 NONAME ; public: __thiscall TApaPictureFactory::TApaPictureFactory(class CApaProcess *)
+	??0TApaTask@@QAE@AAVRWsSession@@@Z @ 3 NONAME ; public: __thiscall TApaTask::TApaTask(class RWsSession &)
+	??0TApaTaskList@@QAE@AAVRWsSession@@@Z @ 4 NONAME ; public: __thiscall TApaTaskList::TApaTaskList(class RWsSession &)
+	??1CApaAppInfoFileReader@@UAE@XZ @ 5 NONAME ABSENT ; public: virtual __thiscall CApaAppInfoFileReader::~CApaAppInfoFileReader(void)
+	??1CApaAppInfoFileWriter@@UAE@XZ @ 6 NONAME ; public: virtual __thiscall CApaAppInfoFileWriter::~CApaAppInfoFileWriter(void)
+	??1CApaAppList@@UAE@XZ @ 7 NONAME ; public: virtual __thiscall CApaAppList::~CApaAppList(void)
+	??1CApaDoor@@UAE@XZ @ 8 NONAME ; public: virtual __thiscall CApaDoor::~CApaDoor(void)
+	??1CApaMaskedBitmap@@UAE@XZ @ 9 NONAME ; public: virtual __thiscall CApaMaskedBitmap::~CApaMaskedBitmap(void)
+	??1CApaWindowGroupName@@UAE@XZ @ 10 NONAME ; public: virtual __thiscall CApaWindowGroupName::~CApaWindowGroupName(void)
+	?AddCaptionL@CApaAppInfoFileWriter@@QAEXW4TLanguage@@ABVTDesC16@@@Z @ 11 NONAME ; public: void __thiscall CApaAppInfoFileWriter::AddCaptionL(enum TLanguage,class TDesC16 const &)
+	?AddIconL@CApaAppInfoFileWriter@@QAEXAAVCApaMaskedBitmap@@@Z @ 12 NONAME ; public: void __thiscall CApaAppInfoFileWriter::AddIconL(class CApaMaskedBitmap &)
+	?AddIconL@CApaAppInfoFileWriter@@QAEXABVTDesC16@@@Z @ 13 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::AddIconL(class TDesC16 const &)
+	?AppCount@RApaLsSession@@QBEHAAH@Z @ 14 NONAME ; public: int __thiscall RApaLsSession::AppCount(int &)const 
+	?AppDataByUid@CApaAppList@@QBEPAVCApaAppData@@VTUid@@@Z @ 15 NONAME ; public: class CApaAppData * __thiscall CApaAppList::AppDataByUid(class TUid)const 
+	?AppEntry@CApaAppData@@QBE?AVTApaAppEntry@@XZ @ 16 NONAME ; public: class TApaAppEntry  __thiscall CApaAppData::AppEntry(void)const 
+	?AppUid@CApaWindowGroupName@@QBE?AVTUid@@XZ @ 17 NONAME ; public: class TUid  __thiscall CApaWindowGroupName::AppUid(void)const 
+	?AppUidL@CApaDoor@@QBE?AVTUid@@XZ @ 18 NONAME ; public: class TUid  __thiscall CApaDoor::AppUidL(void)const 
+	?BringToForeground@TApaTask@@QAEXXZ @ 19 NONAME ; public: void __thiscall TApaTask::BringToForeground(void)
+	?Capability@CApaAppData@@QBEXAAVTDes8@@@Z @ 20 NONAME ; public: void __thiscall CApaAppData::Capability(class TDes8 &)const 
+	?Capability@CApaAppInfoFileReader@@QBEXAAVTDes8@@@Z @ 21 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileReader::Capability(class TDes8 &)const 
+	?Caption@CApaWindowGroupName@@QBE?AVTPtrC16@@XZ @ 22 NONAME ; public: class TPtrC16  __thiscall CApaWindowGroupName::Caption(void)const 
+	?CaptionL@CApaAppInfoFileReader@@QAE?AV?$TBuf@$0BAA@@@W4TLanguage@@@Z @ 23 NONAME ABSENT ; public: class TBuf<256>  __thiscall CApaAppInfoFileReader::CaptionL(enum TLanguage)
+	?Connect@RApaLsSession@@QAEHXZ @ 24 NONAME ; public: int __thiscall RApaLsSession::Connect(void)
+	?ConstructFromWgIdL@CApaWindowGroupName@@QAEXH@Z @ 25 NONAME ; public: void __thiscall CApaWindowGroupName::ConstructFromWgIdL(int)
+	?Count@CApaAppList@@QBEHXZ @ 26 NONAME ; public: int __thiscall CApaAppList::Count(void)const 
+	?CreateMaskedBitmapL@CApaAppInfoFileReader@@QAEPAVCApaMaskedBitmap@@H@Z @ 27 NONAME ABSENT ; public: class CApaMaskedBitmap * __thiscall CApaAppInfoFileReader::CreateMaskedBitmapL(int)
+	?CycleTasks@TApaTaskList@@QAEHVTUid@@W4TCycleDirection@1@@Z @ 28 NONAME ; public: int __thiscall TApaTaskList::CycleTasks(class TUid,enum TApaTaskList::TCycleDirection)
+	?DocName@CApaWindowGroupName@@QBE?AVTPtrC16@@XZ @ 29 NONAME ; public: class TPtrC16  __thiscall CApaWindowGroupName::DocName(void)const 
+	?DocNameIsAFile@CApaWindowGroupName@@QBEHXZ @ 30 NONAME ; public: int __thiscall CApaWindowGroupName::DocNameIsAFile(void)const 
+	?DocumentL@CApaDoor@@QAEPAVCApaDocument@@H@Z @ 31 NONAME ; public: class CApaDocument * __thiscall CApaDoor::DocumentL(int)
+	?EmbeddableAppCount@RApaLsSession@@QBEHAAH@Z @ 32 NONAME ; public: int __thiscall RApaLsSession::EmbeddableAppCount(int &)const 
+	?EndTask@TApaTask@@QAEXXZ @ 33 NONAME ; public: void __thiscall TApaTask::EndTask(void)
+	?Exists@TApaTask@@QBEHXZ @ 34 NONAME ; public: int __thiscall TApaTask::Exists(void)const 
+	?ExternalizeL@CApaMaskedBitmap@@QBEXAAVRWriteStream@@@Z @ 35 NONAME ; public: void __thiscall CApaMaskedBitmap::ExternalizeL(class RWriteStream &)const 
+	?FindApp@TApaTaskList@@QAE?AVTApaTask@@ABVTDesC16@@@Z @ 36 NONAME ; public: class TApaTask  __thiscall TApaTaskList::FindApp(class TDesC16 const &)
+	?FindApp@TApaTaskList@@QAE?AVTApaTask@@VTUid@@@Z @ 37 NONAME ; public: class TApaTask  __thiscall TApaTaskList::FindApp(class TUid)
+	?FindByAppUid@CApaWindowGroupName@@SAXVTUid@@AAVRWsSession@@AAH@Z @ 38 NONAME ; public: static void __cdecl CApaWindowGroupName::FindByAppUid(class TUid,class RWsSession &,int &)
+	?FindByCaption@CApaWindowGroupName@@SAXABVTDesC16@@AAVRWsSession@@AAH@Z @ 39 NONAME ; public: static void __cdecl CApaWindowGroupName::FindByCaption(class TDesC16 const &,class RWsSession &,int &)
+	?FindByDocName@CApaWindowGroupName@@SAXABVTDesC16@@AAVRWsSession@@AAH@Z @ 40 NONAME ; public: static void __cdecl CApaWindowGroupName::FindByDocName(class TDesC16 const &,class RWsSession &,int &)
+	?FindByPos@TApaTaskList@@QAE?AVTApaTask@@H@Z @ 41 NONAME ; public: class TApaTask  __thiscall TApaTaskList::FindByPos(int)
+	?FindDoc@TApaTaskList@@QAE?AVTApaTask@@ABVTDesC16@@@Z @ 42 NONAME ; public: class TApaTask  __thiscall TApaTaskList::FindDoc(class TDesC16 const &)
+	?FirstApp@CApaAppList@@QBEPAVCApaAppData@@XZ @ 43 NONAME ; public: class CApaAppData * __thiscall CApaAppList::FirstApp(void)const 
+	?GetAllApps@RApaLsSession@@QBEHXZ @ 44 NONAME ; public: int __thiscall RApaLsSession::GetAllApps(void)const 
+	?GetAppCapability@RApaLsSession@@QBEHAAVTDes8@@VTUid@@@Z @ 45 NONAME ; public: int __thiscall RApaLsSession::GetAppCapability(class TDes8 &,class TUid)const 
+	?GetAppInfo@RApaLsSession@@QBEHAAVTApaAppInfo@@VTUid@@@Z @ 46 NONAME ; public: int __thiscall RApaLsSession::GetAppInfo(class TApaAppInfo &,class TUid)const 
+	?GetEmbeddableApps@RApaLsSession@@QBEHXZ @ 47 NONAME ; public: int __thiscall RApaLsSession::GetEmbeddableApps(void)const 
+	?GetNextApp@RApaLsSession@@QBEHAAVTApaAppInfo@@@Z @ 48 NONAME ; public: int __thiscall RApaLsSession::GetNextApp(class TApaAppInfo &)const 
+	?InternalizeL@CApaMaskedBitmap@@QAEXAAVRReadStream@@@Z @ 49 NONAME ; public: void __thiscall CApaMaskedBitmap::InternalizeL(class RReadStream &)
+	?IsBusy@CApaWindowGroupName@@QBEHXZ @ 50 NONAME ; public: int __thiscall CApaWindowGroupName::IsBusy(void)const 
+	?IsSystem@CApaWindowGroupName@@QBEHXZ @ 51 NONAME ; public: int __thiscall CApaWindowGroupName::IsSystem(void)const 
+	?KillTask@TApaTask@@QAEXXZ @ 52 NONAME ; public: void __thiscall TApaTask::KillTask(void)
+	?Mask@CApaMaskedBitmap@@QBEPAVCFbsBitmap@@XZ @ 53 NONAME ; public: class CFbsBitmap * __thiscall CApaMaskedBitmap::Mask(void)const 
+	?New@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@PAVHBufC16@@@Z @ 54 NONAME ; public: static class CApaWindowGroupName * __cdecl CApaWindowGroupName::New(class RWsSession const &,class HBufC16 *)
+	?NewL@CApaAppInfoFileReader@@SAPAV1@AAVRFs@@ABVTDesC16@@VTUid@@@Z @ 55 NONAME ABSENT ; public: static class CApaAppInfoFileReader * __cdecl CApaAppInfoFileReader::NewL(class RFs &,class TDesC16 const &,class TUid)
+	?NewL@CApaAppList@@SAPAV1@AAVRFs@@PAVCApaAppRegFinder@@HH@Z @ 56 NONAME ; class CApaAppList * CApaAppList::NewL(class RFs &, class CApaAppRegFinder *, int,int)
+	?NewL@CApaDoor@@SAPAV1@AAVRFs@@AAVCApaDocument@@ABVTSize@@@Z @ 57 NONAME ; public: static class CApaDoor * __cdecl CApaDoor::NewL(class RFs &,class CApaDocument &,class TSize const &)
+	?NewL@CApaDoor@@SAPAV1@AAVRFs@@ABVCStreamStore@@VTStreamId@@AAVCApaProcess@@@Z @ 58 NONAME ; public: static class CApaDoor * __cdecl CApaDoor::NewL(class RFs &,class CStreamStore const &,class TStreamId,class CApaProcess &)
+	?NewL@CApaMaskedBitmap@@SAPAV1@PBV1@@Z @ 59 NONAME ; class CApaMaskedBitmap * CApaMaskedBitmap::NewL(class CApaMaskedBitmap const *)
+	?NewL@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@@Z @ 60 NONAME ; public: static class CApaWindowGroupName * __cdecl CApaWindowGroupName::NewL(class RWsSession const &)
+	?NewL@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@ABVTDesC16@@@Z @ 61 NONAME ; public: static class CApaWindowGroupName * __cdecl CApaWindowGroupName::NewL(class RWsSession const &,class TDesC16 const &)
+	?NewL@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@H@Z @ 62 NONAME ; public: static class CApaWindowGroupName * __cdecl CApaWindowGroupName::NewL(class RWsSession const &,int)
+	?NewLC@CApaAppInfoFileReader@@SAPAV1@AAVRFs@@ABVTDesC16@@VTUid@@@Z @ 63 NONAME ABSENT ; public: static class CApaAppInfoFileReader * __cdecl CApaAppInfoFileReader::NewLC(class RFs &,class TDesC16 const &,class TUid)
+	?NewLC@CApaAppInfoFileWriter@@SAPAV1@AAVRFs@@ABVTDesC16@@VTUid@@@Z @ 64 NONAME ABSENT ; public: static class CApaAppInfoFileWriter * __cdecl CApaAppInfoFileWriter::NewLC(class RFs &,class TDesC16 const &,class TUid)
+	?NewLC@CApaDoor@@SAPAV1@AAVRFs@@AAVCApaDocument@@ABVTSize@@@Z @ 65 NONAME ; public: static class CApaDoor * __cdecl CApaDoor::NewLC(class RFs &,class CApaDocument &,class TSize const &)
+	?NewLC@CApaMaskedBitmap@@SAPAV1@XZ @ 66 NONAME ; public: static class CApaMaskedBitmap * __cdecl CApaMaskedBitmap::NewLC(void)
+	?NewLC@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@@Z @ 67 NONAME ; public: static class CApaWindowGroupName * __cdecl CApaWindowGroupName::NewLC(class RWsSession const &)
+	?NewLC@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@ABVTDesC16@@@Z @ 68 NONAME ; public: static class CApaWindowGroupName * __cdecl CApaWindowGroupName::NewLC(class RWsSession const &,class TDesC16 const &)
+	?NewLC@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@H@Z @ 69 NONAME ; public: static class CApaWindowGroupName * __cdecl CApaWindowGroupName::NewLC(class RWsSession const &,int)
+	?NewPictureL@TApaPictureFactory@@UBEXAAVTPictureHeader@@ABVCStreamStore@@@Z @ 70 NONAME ; public: virtual void __thiscall TApaPictureFactory::NewPictureL(class TPictureHeader &,class CStreamStore const &)const 
+	?NextApp@CApaAppList@@QBEPAVCApaAppData@@PBV2@@Z @ 71 NONAME ; public: class CApaAppData * __thiscall CApaAppList::NextApp(class CApaAppData const *)const 
+	?PurgeL@CApaAppList@@QAEXXZ @ 72 NONAME ; public: void __thiscall CApaAppList::PurgeL(void)
+	?RespondsToShutdownEvent@CApaWindowGroupName@@QBEHXZ @ 73 NONAME ; public: int __thiscall CApaWindowGroupName::RespondsToShutdownEvent(void)const 
+	?RespondsToSwitchFilesEvent@CApaWindowGroupName@@QBEHXZ @ 74 NONAME ; public: int __thiscall CApaWindowGroupName::RespondsToSwitchFilesEvent(void)const 
+	?RestoreL@CApaDoor@@QAEXABVCStreamStore@@VTStreamId@@@Z @ 75 NONAME ; public: void __thiscall CApaDoor::RestoreL(class CStreamStore const &,class TStreamId)
+	?SendKey@TApaTask@@QAEXABUTKeyEvent@@@Z @ 76 NONAME ; public: void __thiscall TApaTask::SendKey(struct TKeyEvent const &)
+	?SendKey@TApaTask@@QAEXHH@Z @ 77 NONAME ; public: void __thiscall TApaTask::SendKey(int,int)
+	?SendMessage@TApaTask@@QAEHVTUid@@ABVTDesC8@@@Z @ 78 NONAME ; public: int __thiscall TApaTask::SendMessage(class TUid,class TDesC8 const &)
+	?SendSystemEvent@TApaTask@@QAEXW4TApaSystemEvent@@@Z @ 79 NONAME ; public: void __thiscall TApaTask::SendSystemEvent(enum TApaSystemEvent)
+	?SendToBackground@TApaTask@@QAEXXZ @ 80 NONAME ; public: void __thiscall TApaTask::SendToBackground(void)
+	?SetAppUid@CApaWindowGroupName@@QAEXVTUid@@@Z @ 81 NONAME ; public: void __thiscall CApaWindowGroupName::SetAppUid(class TUid)
+	?SetBusy@CApaWindowGroupName@@QAEXH@Z @ 82 NONAME ; public: void __thiscall CApaWindowGroupName::SetBusy(int)
+	?SetCapability@CApaAppInfoFileWriter@@QAEHABVTDesC8@@@Z @ 83 NONAME ; public: int __thiscall CApaAppInfoFileWriter::SetCapability(class TDesC8 const &)
+	?SetCaptionL@CApaWindowGroupName@@QAEXABVTDesC16@@@Z @ 84 NONAME ; public: void __thiscall CApaWindowGroupName::SetCaptionL(class TDesC16 const &)
+	?SetDocNameIsAFile@CApaWindowGroupName@@QAEXH@Z @ 85 NONAME ; public: void __thiscall CApaWindowGroupName::SetDocNameIsAFile(int)
+	?SetDocNameL@CApaWindowGroupName@@QAEXABVTDesC16@@@Z @ 86 NONAME ; public: void __thiscall CApaWindowGroupName::SetDocNameL(class TDesC16 const &)
+	?SetFormatToGlassL@CApaDoor@@QAEXXZ @ 87 NONAME ; public: void __thiscall CApaDoor::SetFormatToGlassL(void)
+	?SetFormatToIconL@CApaDoor@@QAEXXZ @ 88 NONAME ; public: void __thiscall CApaDoor::SetFormatToIconL(void)
+	?SetFormatToTemporaryIconL@CApaDoor@@QAEXH@Z @ 89 NONAME ; public: void __thiscall CApaDoor::SetFormatToTemporaryIconL(int)
+	?SetRespondsToShutdownEvent@CApaWindowGroupName@@QAEXH@Z @ 90 NONAME ; public: void __thiscall CApaWindowGroupName::SetRespondsToShutdownEvent(int)
+	?SetRespondsToSwitchFilesEvent@CApaWindowGroupName@@QAEXH@Z @ 91 NONAME ; public: void __thiscall CApaWindowGroupName::SetRespondsToSwitchFilesEvent(int)
+	?SetSystem@CApaWindowGroupName@@QAEXH@Z @ 92 NONAME ; public: void __thiscall CApaWindowGroupName::SetSystem(int)
+	?SetWgId@TApaTask@@QAEXH@Z @ 93 NONAME ; public: void __thiscall TApaTask::SetWgId(int)
+	?SetWindowGroupName@CApaWindowGroupName@@QAEXPAVHBufC16@@@Z @ 94 NONAME ; public: void __thiscall CApaWindowGroupName::SetWindowGroupName(class HBufC16 *)
+	?SetWindowGroupName@CApaWindowGroupName@@QBEHAAVRWindowGroup@@@Z @ 95 NONAME ; public: int __thiscall CApaWindowGroupName::SetWindowGroupName(class RWindowGroup &)const 
+	?SetWindowGroupNameL@CApaWindowGroupName@@QAEXABVTDesC16@@@Z @ 96 NONAME ; public: void __thiscall CApaWindowGroupName::SetWindowGroupNameL(class TDesC16 const &)
+	?StartApp@RApaLsSession@@QAEHABVCApaCommandLine@@@Z @ 97 NONAME ; public: int __thiscall RApaLsSession::StartApp(class CApaCommandLine const &)
+	?StoreL@CApaAppInfoFileWriter@@QAEXXZ @ 98 NONAME ; public: void __thiscall CApaAppInfoFileWriter::StoreL(void)
+	?StretchDrawL@CApaAppInfoFileReader@@SAXPAVCFbsBitmap@@0VTSize@@@Z @ 99 NONAME ABSENT ; public: static void __cdecl CApaAppInfoFileReader::StretchDrawL(class CFbsBitmap *,class CFbsBitmap *,class TSize)
+	?SwitchCreateFile@TApaTask@@QAEHABVTDesC16@@@Z @ 100 NONAME ; public: int __thiscall TApaTask::SwitchCreateFile(class TDesC16 const &)
+	?SwitchOpenFile@TApaTask@@QAEHABVTDesC16@@@Z @ 101 NONAME ; public: int __thiscall TApaTask::SwitchOpenFile(class TDesC16 const &)
+	?ThreadId@TApaTask@@QBE?AVTThreadId@@XZ @ 102 NONAME ; public: class TThreadId  __thiscall TApaTask::ThreadId(void)const 
+	?UpdateCounter@CApaAppList@@QBEHXZ @ 103 NONAME ; public: int __thiscall CApaAppList::UpdateCounter(void)const 
+	?UpdateL@CApaAppList@@QAEXXZ @ 104 NONAME ABSENT ; public: void __thiscall CApaAppList::UpdateL(void)
+	?Version@RApaLsSession@@QBE?AVTVersion@@XZ @ 105 NONAME ; public: class TVersion  __thiscall RApaLsSession::Version(void)const 
+	?WgId@TApaTask@@QBEHXZ @ 106 NONAME ; public: int __thiscall TApaTask::WgId(void)const 
+	?WindowGroupName@CApaWindowGroupName@@QBE?AVTPtrC16@@XZ @ 107 NONAME ; public: class TPtrC16  __thiscall CApaWindowGroupName::WindowGroupName(void)const 
+	??1CApaSystemControlList@@UAE@XZ @ 108 NONAME ; public: virtual __thiscall CApaSystemControlList::~CApaSystemControlList(void)
+	?Caption@CApaSystemControl@@QBE?AVTPtrC16@@XZ @ 109 NONAME ; public: class TPtrC16  __thiscall CApaSystemControl::Caption(void)const 
+	?Control@CApaSystemControlList@@QBEPAVCApaSystemControl@@H@Z @ 110 NONAME ; public: class CApaSystemControl * __thiscall CApaSystemControlList::Control(int)const 
+	?Control@CApaSystemControlList@@QBEPAVCApaSystemControl@@VTUid@@@Z @ 111 NONAME ; public: class CApaSystemControl * __thiscall CApaSystemControlList::Control(class TUid)const 
+	?Count@CApaSystemControlList@@QBEHXZ @ 112 NONAME ; public: int __thiscall CApaSystemControlList::Count(void)const 
+	?CreateL@CApaSystemControl@@QAEXXZ @ 113 NONAME ; public: void __thiscall CApaSystemControl::CreateL(void)
+	?FileName@CApaSystemControl@@QBE?AV?$TBuf@$0BAA@@@XZ @ 114 NONAME ; public: class TBuf<256>  __thiscall CApaSystemControl::FileName(void)const 
+	?Icon@CApaSystemControl@@QBEPAVCApaMaskedBitmap@@XZ @ 115 NONAME ; public: class CApaMaskedBitmap * __thiscall CApaSystemControl::Icon(void)const 
+	?Index@CApaSystemControlList@@QBEHVTUid@@@Z @ 116 NONAME ; public: int __thiscall CApaSystemControlList::Index(class TUid)const 
+	?NewL@CApaSystemControlList@@SAPAV1@AAVRFs@@AAVCApaAppFinder@@ABVTDesC16@@@Z @ 117 NONAME ABSENT ; public: static class CApaSystemControlList * __cdecl CApaSystemControlList::NewL(class RFs &,class CApaAppFinder &,class TDesC16 const &)
+	?Type@CApaSystemControl@@QBE?AVTUid@@XZ @ 118 NONAME ; public: class TUid  __thiscall CApaSystemControl::Type(void)const 
+	?UpdateL@CApaSystemControlList@@QAEXXZ @ 119 NONAME ; public: void __thiscall CApaSystemControlList::UpdateL(void)
+	?AddDataTypeL@CApaAppInfoFileWriter@@QAEXABVTDataTypeWithPriority@@@Z @ 120 NONAME ; public: void __thiscall CApaAppInfoFileWriter::AddDataTypeL(class TDataTypeWithPriority const &)
+	?AppForDataType@RApaLsSession@@QBEHABVTDataType@@AAVTUid@@@Z @ 121 NONAME ; public: int __thiscall RApaLsSession::AppForDataType(class TDataType const &,class TUid &)const 
+	?AppForDocument@RApaLsSession@@QBEHABVTDesC16@@AAVTUid@@AAVTDataType@@@Z @ 122 NONAME ; public: int __thiscall RApaLsSession::AppForDocument(class TDesC16 const &,class TUid &,class TDataType &)const 
+	?CreateDocument@RApaLsSession@@QAEHABVTDesC16@@VTUid@@AAVTThreadId@@W4TLaunchType@1@@Z @ 123 NONAME ; public: int __thiscall RApaLsSession::CreateDocument(class TDesC16 const &,class TUid,class TThreadId &,enum RApaLsSession::TLaunchType)
+	?DataType@CApaAppData@@QBEJABVTDataType@@@Z @ 124 NONAME ; long CApaAppData::DataType(class TDataType const &) const
+	?DataTypesSupportedL@CApaAppInfoFileReader@@QBEXAAV?$CArrayFix@VTDataTypeWithPriority@@@@@Z @ 125 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileReader::DataTypesSupportedL(class CArrayFix<class TDataTypeWithPriority> &)const 
+	?GetAcceptedConfidence@RApaLsSession@@QBEHAAH@Z @ 126 NONAME ; public: int __thiscall RApaLsSession::GetAcceptedConfidence(int &)const 
+	?GetAppIcon@RApaLsSession@@QBEHVTUid@@HAAVCApaMaskedBitmap@@@Z @ 127 NONAME ; public: int __thiscall RApaLsSession::GetAppIcon(class TUid,int,class CApaMaskedBitmap &)const 
+	?GetMaxDataBufSize@RApaLsSession@@QBEHAAH@Z @ 128 NONAME ; public: int __thiscall RApaLsSession::GetMaxDataBufSize(int &)const 
+	?GetSupportedDataTypesL@RApaLsSession@@QBEHAAV?$CArrayFixFlat@VTDataType@@@@@Z @ 129 NONAME ; public: int __thiscall RApaLsSession::GetSupportedDataTypesL(class CArrayFixFlat<class TDataType> &)const 
+	?IsProgram@RApaLsSession@@QBEHABVTDesC16@@AAH@Z @ 130 NONAME ; public: int __thiscall RApaLsSession::IsProgram(class TDesC16 const &,int &)const 
+	?PreferredDataHandlerL@CApaAppList@@QBE?AVTUid@@ABVTDataType@@@Z @ 131 NONAME ; public: class TUid  __thiscall CApaAppList::PreferredDataHandlerL(class TDataType const &)const 
+	?RecognizeData@RApaLsSession@@QBEHABVTDesC16@@ABVTDesC8@@AAVTDataRecognitionResult@@@Z @ 132 NONAME ; public: int __thiscall RApaLsSession::RecognizeData(class TDesC16 const &,class TDesC8 const &,class TDataRecognitionResult &)const 
+	?RecognizeSpecificData@RApaLsSession@@QBEHABVTDesC16@@ABVTDesC8@@ABVTDataType@@AAH@Z @ 133 NONAME ; public: int __thiscall RApaLsSession::RecognizeSpecificData(class TDesC16 const &,class TDesC8 const &,class TDataType const &,int &)const 
+	?SetAcceptedConfidence@RApaLsSession@@QAEHH@Z @ 134 NONAME ; public: int __thiscall RApaLsSession::SetAcceptedConfidence(int)
+	?SetMaxDataBufSize@RApaLsSession@@QAEHH@Z @ 135 NONAME ; public: int __thiscall RApaLsSession::SetMaxDataBufSize(int)
+	?StartDocument@RApaLsSession@@QAEHABVTDesC16@@AAVTThreadId@@W4TLaunchType@1@@Z @ 136 NONAME ; public: int __thiscall RApaLsSession::StartDocument(class TDesC16 const &,class TThreadId &,enum RApaLsSession::TLaunchType)
+	?StartDocument@RApaLsSession@@QAEHABVTDesC16@@ABVTDataType@@AAVTThreadId@@W4TLaunchType@1@@Z @ 137 NONAME ; public: int __thiscall RApaLsSession::StartDocument(class TDesC16 const &,class TDataType const &,class TThreadId &,enum RApaLsSession::TLaunchType)
+	?StartDocument@RApaLsSession@@QAEHABVTDesC16@@VTUid@@AAVTThreadId@@W4TLaunchType@1@@Z @ 138 NONAME ; public: int __thiscall RApaLsSession::StartDocument(class TDesC16 const &,class TUid,class TThreadId &,enum RApaLsSession::TLaunchType)
+	?StartIdleUpdateL@CApaAppList@@QAEXXZ @ 139 NONAME ; public: void __thiscall CApaAppList::StartIdleUpdateL(void)
+	??1CApaAppListNotifier@@UAE@XZ @ 140 NONAME ; public: virtual __thiscall CApaAppListNotifier::~CApaAppListNotifier(void)
+	?NewL@CApaAppListNotifier@@SAPAV1@PAVMApaAppListServObserver@@W4TPriority@CActive@@@Z @ 141 NONAME ; public: static class CApaAppListNotifier * __cdecl CApaAppListNotifier::NewL(class MApaAppListServObserver *,enum CActive::TPriority)
+	?StartIdleUpdateL@CApaAppList@@QAEXPAVMApaAppListObserver@@@Z @ 142 NONAME ; public: void __thiscall CApaAppList::StartIdleUpdateL(class MApaAppListObserver *)
+	?GetAppIcon@RApaLsSession@@QBEHVTUid@@VTSize@@AAVCApaMaskedBitmap@@@Z @ 143 NONAME ; public: int __thiscall RApaLsSession::GetAppIcon(class TUid,class TSize,class CApaMaskedBitmap &)const 
+	?GetAppIconSizes@RApaLsSession@@QBEHVTUid@@AAV?$CArrayFixFlat@VTSize@@@@@Z @ 144 NONAME ; public: int __thiscall RApaLsSession::GetAppIconSizes(class TUid,class CArrayFixFlat<class TSize> &)const 
+	?Icon@CApaAppData@@QBEPAVCApaMaskedBitmap@@VTSize@@@Z @ 145 NONAME ; public: class CApaMaskedBitmap * __thiscall CApaAppData::Icon(class TSize)const 
+	?IconSizesL@CApaAppData@@QBEPAV?$CArrayFixFlat@VTSize@@@@XZ @ 146 NONAME ; public: class CArrayFixFlat<class TSize> * __thiscall CApaAppData::IconSizesL(void)const 
+	?Icon@CApaAppData@@QBEPAVCApaMaskedBitmap@@H@Z @ 147 NONAME ; public: class CApaMaskedBitmap * __thiscall CApaAppData::Icon(int)const 
+	?Hidden@CApaWindowGroupName@@QBEHXZ @ 148 NONAME ; int CApaWindowGroupName::Hidden(void) const
+	?SetHidden@CApaWindowGroupName@@QAEXH@Z @ 149 NONAME ; public: void __thiscall CApaWindowGroupName::SetHidden(int)
+	?AddViewCaptionL@CApaAppInfoFileWriter@@QAEXW4TLanguage@@ABVTDesC16@@VTUid@@@Z @ 150 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::AddViewCaptionL(enum TLanguage,class TDesC16 const &,class TUid)
+	?AddViewIconL@CApaAppInfoFileWriter@@QAEXAAVCApaMaskedBitmap@@VTUid@@@Z @ 151 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::AddViewIconL(class CApaMaskedBitmap &,class TUid)
+	?AddViewL@CApaAppInfoFileWriter@@QAEXVTUid@@@Z @ 152 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::AddViewL(class TUid)
+	?CaptionL@CApaAIFViewData@@QBE?AV?$TBuf@$0BAA@@@W4TLanguage@@@Z @ 153 NONAME ABSENT ; public: class TBuf<256>  __thiscall CApaAIFViewData::CaptionL(enum TLanguage)const 
+	?GetAppViewIcon@RApaLsSession@@QBEHVTUid@@0ABVTSize@@AAVCApaMaskedBitmap@@@Z @ 154 NONAME ; public: int __thiscall RApaLsSession::GetAppViewIcon(class TUid,class TUid,class TSize const &,class CApaMaskedBitmap &)const 
+	?GetAppViews@RApaLsSession@@QBEHAAV?$CArrayFixFlat@VTApaAppViewInfo@@@@VTUid@@@Z @ 155 NONAME ; public: int __thiscall RApaLsSession::GetAppViews(class CArrayFixFlat<class TApaAppViewInfo> &,class TUid)const 
+	?GetViewsL@CApaAppInfoFileReader@@QBEXAAV?$CArrayPtr@VCApaAIFViewData@@@@@Z @ 156 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileReader::GetViewsL(class CArrayPtr<class CApaAIFViewData> &)const 
+	?Icon@CApaAppViewData@@QBEPAVCApaMaskedBitmap@@ABVTSize@@@Z @ 157 NONAME ; public: class CApaMaskedBitmap * __thiscall CApaAppViewData::Icon(class TSize const &)const 
+	?IconByIndexL@CApaAIFViewData@@QBEPAVCApaMaskedBitmap@@H@Z @ 158 NONAME ABSENT ; public: class CApaMaskedBitmap * __thiscall CApaAIFViewData::IconByIndexL(int)const 
+	?IconSizesL@CApaAppViewData@@QBEPAV?$CArrayFixFlat@VTSize@@@@XZ @ 159 NONAME ; public: class CArrayFixFlat<class TSize> * __thiscall CApaAppViewData::IconSizesL(void)const 
+	?NumberOfIcons@CApaAIFViewData@@QBEHXZ @ 160 NONAME ABSENT ; public: int __thiscall CApaAIFViewData::NumberOfIcons(void)const 
+	?StoreViewL@CApaAppInfoFileWriter@@QAEXVTUid@@@Z @ 161 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::StoreViewL(class TUid)
+	?Uid@CApaAppViewData@@QBE?AVTUid@@XZ @ 162 NONAME ; public: class TUid  __thiscall CApaAppViewData::Uid(void)const 
+	?ViewUid@CApaAIFViewData@@QBE?AVTUid@@XZ @ 163 NONAME ABSENT ; public: class TUid  __thiscall CApaAIFViewData::ViewUid(void)const 
+	?Views@CApaAppData@@QBEPAV?$CArrayPtrFlat@VCApaAppViewData@@@@XZ @ 164 NONAME ; public: class CArrayPtrFlat<class CApaAppViewData> * __thiscall CApaAppData::Views(void)const 
+	?AddOwnedFileL@CApaAppInfoFileWriter@@QAEXABVTDesC16@@@Z @ 165 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::AddOwnedFileL(class TDesC16 const &)
+	?GetOwnedFilesL@CApaAppInfoFileReader@@QBEXAAVCDesC16Array@@@Z @ 166 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileReader::GetOwnedFilesL(class CDesC16Array &)const 
+	?OwnedFiles@CApaAppData@@QBEPAVCDesC16Array@@XZ @ 167 NONAME ; public: class CDesC16Array * __thiscall CApaAppData::OwnedFiles(void)const 
+	?GetAppOwnedFiles@RApaLsSession@@QBEHAAVCDesC16Array@@VTUid@@@Z @ 168 NONAME ; public: int __thiscall RApaLsSession::GetAppOwnedFiles(class CDesC16Array &,class TUid)const 
+	?StartApp@RApaLsSession@@QAEHABVCApaCommandLine@@AAVTThreadId@@@Z @ 169 NONAME ; public: int __thiscall RApaLsSession::StartApp(class CApaCommandLine const &,class TThreadId &)
+	?GetAifFileName@AppInfoFileUtils@@SAXABVRFs@@AAVTDes16@@@Z @ 170 NONAME ABSENT ; public: static void __cdecl AppInfoFileUtils::GetAifFileName(class RFs const &,class TDes16 &)
+	?AddViewL@CApaAppInfoFileWriter@@QAEXVTUid@@H@Z @ 171 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::AddViewL(class TUid,int)
+	?CanUseScreenMode@CApaAppData@@QAEHH@Z @ 172 NONAME ; public: int __thiscall CApaAppData::CanUseScreenMode(int)
+	?FirstApp@CApaAppList@@QBEPAVCApaAppData@@H@Z @ 173 NONAME ; public: class CApaAppData * __thiscall CApaAppList::FirstApp(int)const 
+	?GetAllApps@RApaLsSession@@QBEHH@Z @ 174 NONAME ; public: int __thiscall RApaLsSession::GetAllApps(int)const 
+	?GetEmbeddableApps@RApaLsSession@@QBEHH@Z @ 175 NONAME ; public: int __thiscall RApaLsSession::GetEmbeddableApps(int)const 
+	?GetNextApp@RApaLsSession@@QBEHAAVTApaAppInfo@@H@Z @ 176 NONAME ; public: int __thiscall RApaLsSession::GetNextApp(class TApaAppInfo &,int)const 
+	?NextApp@CApaAppList@@QBEPAVCApaAppData@@PBV2@H@Z @ 177 NONAME ; public: class CApaAppData * __thiscall CApaAppList::NextApp(class CApaAppData const *,int)const 
+	?ScreenMode@CApaAIFViewData@@QBEHXZ @ 178 NONAME ABSENT ; public: int __thiscall CApaAIFViewData::ScreenMode(void)const 
+	?ScreenMode@CApaAppViewData@@QBEHXZ @ 179 NONAME ; public: int __thiscall CApaAppViewData::ScreenMode(void)const 
+	?ShortCaption@CApaSystemControl@@QBE?AVTPtrC16@@XZ @ 180 NONAME ; public: class TPtrC16  __thiscall CApaSystemControl::ShortCaption(void)const 
+	?IsIdleUpdateComplete@CApaAppList@@QBEHXZ @ 181 NONAME ; public: int __thiscall CApaAppList::IsIdleUpdateComplete(void)const 
+	?IsAppReady@CApaWindowGroupName@@QBEHXZ @ 182 NONAME ; public: int __thiscall CApaWindowGroupName::IsAppReady(void)const 
+	?SetAppReady@CApaWindowGroupName@@QAEXH@Z @ 183 NONAME ; public: void __thiscall CApaWindowGroupName::SetAppReady(int)
+	?InitListL@CApaAppList@@QAEXPAVMApaAppListObserver@@@Z @ 184 NONAME ; public: void __thiscall CApaAppList::InitListL(class MApaAppListObserver *)
+	?NumberOfBitmaps@CApaAppInfoFileReader@@QBEHXZ @ 185 NONAME ABSENT ; public: int __thiscall CApaAppInfoFileReader::NumberOfBitmaps(void)const 
+	?IsFirstScanComplete@CApaAppList@@QBEHXZ @ 186 NONAME ; public: int __thiscall CApaAppList::IsFirstScanComplete(void)const 
+	?SetMaskBitmap@CApaMaskedBitmap@@QAEXPAVCFbsBitmap@@@Z @ 187 NONAME ; public: void __thiscall CApaMaskedBitmap::SetMaskBitmap(class CFbsBitmap *)
+	?GetAppInfo_7_0@RApaLsSession@@ABEHAAVTApaAppInfo_7_0@@VTUid@@@Z @ 188 NONAME ABSENT ; int RApaLsSession::GetAppInfo_7_0(class TApaAppInfo_7_0 &, class TUid) const
+	?GetNextApp_7_0@RApaLsSession@@ABEHAAVTApaAppInfo_7_0@@@Z @ 189 NONAME ABSENT ; int RApaLsSession::GetNextApp_7_0(class TApaAppInfo_7_0 &) const
+	?GetNextApp_7_0@RApaLsSession@@ABEHAAVTApaAppInfo_7_0@@H@Z @ 190 NONAME ABSENT ; int RApaLsSession::GetNextApp_7_0(class TApaAppInfo_7_0 &, int) const
+	?GetIconInfo@CApaAppData@@QBEXAAH0@Z @ 191 NONAME ; void CApaAppData::GetIconInfo(int &, int &) const
+	?NumberOfOwnDefinedIcons@RApaLsSession@@QBEHVTUid@@AAH@Z @ 192 NONAME ; public: int __thiscall RApaLsSession::NumberOfOwnDefinedIcons(class TUid,int &)const 
+	?GetFilteredApps@RApaLsSession@@QBEHABVTApaEmbeddabilityFilter@@@Z @ 193 NONAME ; public: int __thiscall RApaLsSession::GetFilteredApps(class TApaEmbeddabilityFilter const &)const 
+	?GetFilteredApps@RApaLsSession@@QBEHABVTApaEmbeddabilityFilter@@H@Z @ 194 NONAME ; public: int __thiscall RApaLsSession::GetFilteredApps(class TApaEmbeddabilityFilter const &,int)const 
+	?NewL@CApaAppList@@SAPAV1@AAVRFs@@PAVCApaAppFinder@@PAVCApaAppRegFinder@@H@Z @ 195 NONAME ABSENT ; class CApaAppList * CApaAppList::NewL(class RFs &, class CApaAppFinder *, class CApaAppRegFinder *, int)	
+	?DefaultScreenNumber@CApaAppData@@QBEIXZ @ 196 NONAME ; unsigned int CApaAppData::DefaultScreenNumber(void) const
+	?GetFilteredApps@RApaLsSession@@QBEHII@Z @ 197 NONAME ; int RApaLsSession::GetFilteredApps(unsigned int, unsigned int) const
+	?GetFilteredApps@RApaLsSession@@QBEHIIH@Z @ 198 NONAME ; int RApaLsSession::GetFilteredApps(unsigned int, unsigned int, int) const
+	?RegistrationFileUsed@CApaAppData@@QBEHXZ @ 199 NONAME ; int CApaAppData::RegistrationFileUsed(void) const
+	?GetAppIcon@RApaLsSession@@QBEHVTUid@@AAPAVHBufC16@@@Z @ 200 NONAME ; int RApaLsSession::GetAppIcon(class TUid, class HBufC16 * &) const
+	?IconFileName@CApaAppData@@QBE?AVTPtrC16@@XZ @ 201 NONAME ; class TPtrC16 CApaAppData::IconFileName(void) const
+	?GetAppViewIcon@RApaLsSession@@QBEHVTUid@@0AAPAVHBufC16@@@Z @ 202 NONAME ; int RApaLsSession::GetAppViewIcon(class TUid, class TUid, class HBufC16 * &) const
+	?IconFileName@CApaAppViewData@@QBE?AVTPtrC16@@XZ @ 203 NONAME ; class TPtrC16 CApaAppViewData::IconFileName(void) const
+	?NonMbmIconFile@CApaAppData@@QBEHXZ @ 204 NONAME ; int CApaAppData::NonMbmIconFile(void) const
+	?NonMbmIconFile@CApaAppViewData@@QBEHXZ @ 205 NONAME ; int CApaAppViewData::NonMbmIconFile(void) const
+	?StartupApaServer@@YAHAAVMApaAppStarter@@@Z @ 206 NONAME ; int StartupApaServer(class MApaAppStarter &)
+	?StartupApaServerProcess@@YAHXZ @ 207 NONAME ; int StartupApaServerProcess(void)
+	?DeleteDataMapping@RApaLsSession@@QAEHABVTDataType@@@Z @ 208 NONAME ; int RApaLsSession::DeleteDataMapping(class TDataType const &)
+	?InsertDataMapping@RApaLsSession@@QAEHABVTDataType@@JVTUid@@@Z @ 209 NONAME ; int RApaLsSession::InsertDataMapping(class TDataType const &, long, class TUid)
+	?InsertDataMappingIfHigher@RApaLsSession@@QAEHABVTDataType@@JVTUid@@AAH@Z @ 210 NONAME ; int RApaLsSession::InsertDataMappingIfHigher(class TDataType const &, long, class TUid, int &)
+	?ApplicationLanguage@CApaAppData@@QBE?AW4TLanguage@@XZ @ 211 NONAME ; enum TLanguage CApaAppData::ApplicationLanguage(void) const
+	?ApplicationLanguage@RApaLsSession@@QBEHVTUid@@AAW4TLanguage@@@Z @ 212 NONAME ; int RApaLsSession::ApplicationLanguage(class TUid, enum TLanguage &) const
+	?NewL@CApaSystemControlList@@SAPAV1@AAVRFs@@@Z @ 213 NONAME ; class CApaSystemControlList * CApaSystemControlList::NewL(class RFs &)
+	?AppForDataTypeAndService@RApaLsSession@@QBEHABVTDataType@@VTUid@@AAV3@@Z @ 214 NONAME ; int RApaLsSession::AppForDataTypeAndService(class TDataType const &, class TUid, class TUid &) const
+	?AppForDocumentAndService@RApaLsSession@@QBEHABVRFile@@VTUid@@AAV3@AAVTDataType@@@Z @ 215 NONAME ; int RApaLsSession::AppForDocumentAndService(class RFile const &, class TUid, class TUid &, class TDataType &) const
+	?AppForDocumentAndService@RApaLsSession@@QBEHABVTDesC16@@VTUid@@AAV3@AAVTDataType@@@Z @ 216 NONAME ; int RApaLsSession::AppForDocumentAndService(class TDesC16 const &, class TUid, class TUid &, class TDataType &) const
+	?GetAppServiceOpaqueDataLC@RApaLsSession@@QBEPAVCApaAppServiceInfoArray@@VTUid@@0@Z @ 217 NONAME ; class CApaAppServiceInfoArray * RApaLsSession::GetAppServiceOpaqueDataLC(class TUid, class TUid) const
+	?GetAppServicesL@RApaLsSession@@QBEXVTUid@@AAV?$CArrayFixFlat@VTUid@@@@@Z @ 218 NONAME ; void RApaLsSession::GetAppServicesL(class TUid, class CArrayFixFlat<class TUid> &) const
+	?GetAppServicesLC@RApaLsSession@@QBEPAVCApaAppServiceInfoArray@@VTUid@@@Z @ 219 NONAME ; class CApaAppServiceInfoArray * RApaLsSession::GetAppServicesLC(class TUid) const
+	?GetServerApps@RApaLsSession@@QBEHVTUid@@@Z @ 220 NONAME ; int RApaLsSession::GetServerApps(class TUid) const
+	?GetServerApps@RApaLsSession@@QBEHVTUid@@H@Z @ 221 NONAME ; int RApaLsSession::GetServerApps(class TUid, int) const
+	?GetServiceImplementationsLC@RApaLsSession@@QBEPAVCApaAppServiceInfoArray@@VTUid@@@Z @ 222 NONAME ; class CApaAppServiceInfoArray * RApaLsSession::GetServiceImplementationsLC(class TUid) const
+	?ImplementsService@CApaAppData@@QBEHVTUid@@@Z @ 223 NONAME ; int CApaAppData::ImplementsService(class TUid) const
+	?OpaqueData@TApaAppServiceInfo@@QBEABVTDesC8@@XZ @ 224 NONAME ; class TDesC8 const & TApaAppServiceInfo::OpaqueData(void) const
+	?PreferredDataHandlerL@CApaAppList@@QBE?AVTUid@@ABVTDataType@@PBV2@AAH@Z @ 225 NONAME ; class TUid CApaAppList::PreferredDataHandlerL(class TDataType const &, class TUid const *, int &) const
+	?ServiceArrayBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@@Z @ 226 NONAME ; class CBufFlat * CApaAppList::ServiceArrayBufferL(class TUid) const
+	?ServiceImplArrayBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@@Z @ 227 NONAME ; class CBufFlat * CApaAppList::ServiceImplArrayBufferL(class TUid) const
+	?ServiceOpaqueDataBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@0@Z @ 228 NONAME ; class CBufFlat * CApaAppList::ServiceOpaqueDataBufferL(class TUid, class TUid) const
+	?ServiceUidBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@@Z @ 229 NONAME ; class CBufFlat * CApaAppList::ServiceUidBufferL(class TUid) const
+	?Uid@TApaAppServiceInfo@@QBE?AVTUid@@XZ @ 230 NONAME ; class TUid TApaAppServiceInfo::Uid(void) const
+	?StartDocument@RApaLsSession@@QAEHAAVRFile@@AAVTThreadId@@PAVTRequestStatus@@@Z @ 231 NONAME ; int RApaLsSession::StartDocument(class RFile &, class TThreadId &, class TRequestStatus *)
+	?CreateMaskedBitmapByIndexLC@CApaAppInfoFileReader@@QAEPAVCApaMaskedBitmap@@H@Z @ 232 NONAME ABSENT ; class CApaMaskedBitmap * CApaAppInfoFileReader::CreateMaskedBitmapByIndexLC(int)
+	?CancelListPopulationCompleteObserver@RApaLsSession@@QBEHXZ @ 233 NONAME ; int RApaLsSession::CancelListPopulationCompleteObserver(void) const
+	?RegisterListPopulationCompleteObserver@RApaLsSession@@QBEXAAVTRequestStatus@@@Z @ 234 NONAME ; void RApaLsSession::RegisterListPopulationCompleteObserver(class TRequestStatus &) const
+	?NewInterimFormatFileWriterLC@ForJavaMIDletInstaller@@SAPAVCApaAppInfoFileWriter@@AAVRFs@@ABVTDesC16@@VTUid@@KH@Z @ 235 NONAME ; class CApaAppInfoFileWriter * ForJavaMIDletInstaller::NewInterimFormatFileWriterLC(class RFs &, class TDesC16 const &, class TUid, unsigned long, int)
+	?CheckInterimFormatFileNotCorruptL@ForJavaMIDletInstaller@@SAXAAVRFile@@@Z @ 236 NONAME ; void ForJavaMIDletInstaller::CheckInterimFormatFileNotCorruptL(class RFile &)
+	?RegisterJavaMIDletViaIterimFormat@RApaLsSession@@QAEHABVTDesC16@@AAVRFile@@@Z @ 237 NONAME ABSENT ; int RApaLsSession::RegisterJavaMIDletViaIterimFormat(class TDesC16 const &, class RFile &)
+	?DeregisterJavaMIDlet@RApaLsSession@@QAEHABVTDesC16@@@Z @ 238 NONAME ABSENT ; int RApaLsSession::DeregisterJavaMIDlet(class TDesC16 const &)
+	?AppForDocument@RApaLsSession@@QBEHABVRFile@@AAVTUid@@AAVTDataType@@@Z @ 239 NONAME ; int RApaLsSession::AppForDocument(class RFile const &, class TUid &, class TDataType &) const
+	?ClearFsSession@RApaLsSession@@SAXXZ @ 240 NONAME ; void RApaLsSession::ClearFsSession(void)
+	?FsSession@RApaLsSession@@SAPAVRFs@@XZ @ 241 NONAME ; class RFs * RApaLsSession::FsSession(void)
+	?RecognizeData@RApaLsSession@@QBEHABVRFile@@AAVTDataRecognitionResult@@@Z @ 242 NONAME ; int RApaLsSession::RecognizeData(class RFile const &, class TDataRecognitionResult &) const	
+	?RecognizeSpecificData@RApaLsSession@@QBEHABVRFile@@ABVTDataType@@AAH@Z @ 243 NONAME ; int RApaLsSession::RecognizeSpecificData(class RFile const &, class TDataType const &, int &) const
+	?SetFsSessionL@RApaLsSession@@SAXAAVRFs@@@Z @ 244 NONAME ; void RApaLsSession::SetFsSessionL(class RFs &)
+	?StartDocument@RApaLsSession@@QAEHAAVRFile@@ABVTDataType@@AAVTThreadId@@PAVTRequestStatus@@@Z @ 245 NONAME ; int RApaLsSession::StartDocument(class RFile &, class TDataType const &, class TThreadId &, class TRequestStatus *)
+	?StartDocument@RApaLsSession@@QAEHAAVRFile@@VTUid@@AAVTThreadId@@PAVTRequestStatus@@@Z @ 246 NONAME ; int RApaLsSession::StartDocument(class RFile &, class TUid, class TThreadId &, class TRequestStatus *)
+	?GetPreferredBufSize@RApaLsSession@@QBEHAAH@Z @ 247 NONAME ; public: int __thiscall RApaLsSession::GetPreferredBufSize(int &)const 
+	?GetJavaMIDletInfoL@ForJavaMIDletInstaller@@SAXAAVRFs@@ABVTDesC16@@AAK2@Z @ 248 NONAME ; void ForJavaMIDletInstaller::GetJavaMIDletInfoL(class RFs &, class TDesC16 const &, unsigned long &, unsigned long &)
+	?HandleAsRegistrationFile@ApaUtils@@SAHABVTUidType@@@Z @ 249 NONAME ; int ApaUtils::HandleAsRegistrationFile(class TUidType const &)
+	?DataTypes@TApaAppServiceInfo@@QBEABV?$CArrayFixFlat@VTDataTypeWithPriority@@@@XZ @ 250 NONAME ; class CArrayFixFlat<class TDataTypeWithPriority> const & TApaAppServiceInfo::DataTypes(void) const
+	?GetServiceImplementationsLC@RApaLsSession@@QBEPAVCApaAppServiceInfoArray@@VTUid@@ABVTDataType@@@Z @ 251 NONAME ; class CApaAppServiceInfoArray * RApaLsSession::GetServiceImplementationsLC(class TUid, class TDataType const &) const
+	?ServiceImplArrayBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@ABVTDataType@@@Z @ 252 NONAME ; class CBufFlat * CApaAppList::ServiceImplArrayBufferL(class TUid, class TDataType const &) const
+	?Close@RApaLsSession@@QAEXXZ @ 253 NONAME ; void RApaLsSession::Close(void)
+	??0MApaAppListServObserver@@IAE@XZ @ 254 NONAME ; MApaAppListServObserver::MApaAppListServObserver(void)
+	??0TApaPictureFactory@@IAE@XZ @ 255 NONAME ; TApaPictureFactory::TApaPictureFactory(void)
+	?MApaAppListServObserver_Reserved1@MApaAppListServObserver@@EAEXXZ @ 256 NONAME ; void MApaAppListServObserver::MApaAppListServObserver_Reserved1(void)
+	?MApaAppListServObserver_Reserved2@MApaAppListServObserver@@EAEXXZ @ 257 NONAME ; void MApaAppListServObserver::MApaAppListServObserver_Reserved2(void)
+	?RApaLsSession_Reserved1@RApaLsSession@@EAEXXZ @ 258 NONAME ; void RApaLsSession::RApaLsSession_Reserved1(void)
+	?RApaLsSession_Reserved2@RApaLsSession@@EAEXXZ @ 259 NONAME ; void RApaLsSession::RApaLsSession_Reserved2(void)
+	??0CDataRecognitionResultArray@@QAE@XZ @ 260 NONAME ; CDataRecognitionResultArray::CDataRecognitionResultArray(void)
+	??1CDataRecognitionResultArray@@UAE@XZ @ 261 NONAME ; CDataRecognitionResultArray::~CDataRecognitionResultArray(void)
+	?CancelRecognizeFiles@RApaLsSession@@QAEXXZ @ 262 NONAME ; void RApaLsSession::CancelRecognizeFiles(void)
+	?Count@CDataRecognitionResultArray@@QBEIXZ @ 263 NONAME ; unsigned int CDataRecognitionResultArray::Count(void) const
+	?GetDataRecognitionResultL@CDataRecognitionResultArray@@QBEXAAVTDataRecognitionResult@@I@Z @ 264 NONAME ; void CDataRecognitionResultArray::GetDataRecognitionResultL(class TDataRecognitionResult &, unsigned int) const
+	?GetFileNameL@CDataRecognitionResultArray@@QBEXAAV?$TBuf@$0BAA@@@I@Z @ 265 NONAME ; void CDataRecognitionResultArray::GetFileNameL(class TBuf<256> &, unsigned int) const
+	?Path@CDataRecognitionResultArray@@QBEABV?$TBuf@$0BAA@@@XZ @ 266 NONAME ; class TBuf<256> const & CDataRecognitionResultArray::Path(void) const
+	?RecognizeFilesL@RApaLsSession@@QBEHABVTDesC16@@AAVCDataRecognitionResultArray@@@Z @ 267 NONAME ; int RApaLsSession::RecognizeFilesL(class TDesC16 const &, class CDataRecognitionResultArray &) const
+	?RecognizeFilesL@RApaLsSession@@QBEHABVTDesC16@@ABVTDesC8@@AAVCDataRecognitionResultArray@@@Z @ 268 NONAME ; int RApaLsSession::RecognizeFilesL(class TDesC16 const &, class TDesC8 const &, class CDataRecognitionResultArray &) const
+	?RecognizeFilesL@RApaLsSession@@QAEXABVTDesC16@@AAVCDataRecognitionResultArray@@AAVTRequestStatus@@@Z @ 269 NONAME ; void RApaLsSession::RecognizeFilesL(class TDesC16 const &, class CDataRecognitionResultArray &, class TRequestStatus &)
+	?RecognizeFilesL@RApaLsSession@@QAEXABVTDesC16@@ABVTDesC8@@AAVCDataRecognitionResultArray@@AAVTRequestStatus@@@Z @ 270 NONAME ; void RApaLsSession::RecognizeFilesL(class TDesC16 const &, class TDesC8 const &, class CDataRecognitionResultArray &, class TRequestStatus &)
+	?InsertDataMapping@RApaLsSession@@QAEHABVTDataType@@JVTUid@@1@Z @ 271 NONAME ; int RApaLsSession::InsertDataMapping(class TDataType const &, long, class TUid, class TUid)
+	?DeleteDataMapping@RApaLsSession@@QAEHABVTDataType@@VTUid@@@Z @ 272 NONAME ; int RApaLsSession::DeleteDataMapping(class TDataType const &, class TUid)
+	?GetAppByDataType@RApaLsSession@@QBEHABVTDataType@@VTUid@@AAV3@@Z @ 273 NONAME ; int RApaLsSession::GetAppByDataType(class TDataType const &, class TUid, class TUid &) const
+	?StartApp@RApaLsSession@@QAEHABVCApaCommandLine@@AAVTThreadId@@PAVTRequestStatus@@@Z @ 274 NONAME ; int RApaLsSession::StartApp(class CApaCommandLine const &, class TThreadId &, class TRequestStatus *)
+	?RegisterNonNativeApplicationTypeL@RApaLsSession@@QAEXVTUid@@ABVTDesC16@@@Z @ 275 NONAME ; void RApaLsSession::RegisterNonNativeApplicationTypeL(class TUid, class TDesC16 const &)
+	?DeregisterNonNativeApplicationTypeL@RApaLsSession@@QAEXVTUid@@@Z @ 276 NONAME ; void RApaLsSession::DeregisterNonNativeApplicationTypeL(class TUid)
+	?RegisterNonNativeApplicationL@RApaLsSession@@QAEXVTUid@@ABVTDriveUnit@@AAVCApaRegistrationResourceFileWriter@@PAVCApaLocalisableResourceFileWriter@@PBVRFile@@@Z @ 277 NONAME ; void RApaLsSession::RegisterNonNativeApplicationL(class TUid, class TDriveUnit const &, class CApaRegistrationResourceFileWriter &, class CApaLocalisableResourceFileWriter *, class RFile const *)
+	?DeregisterNonNativeApplicationL@RApaLsSession@@QAEXVTUid@@@Z @ 278 NONAME ; void RApaLsSession::DeregisterNonNativeApplicationL(class TUid)
+	?AppDataByFileName@CApaAppList@@QBEPAVCApaAppData@@ABVTDesC16@@@Z @ 279 NONAME ; class CApaAppData* CApaAppList::AppDataByFileName(class TDesC16 const &) const
+	?LocalisableResourceFileName@CApaAppData@@QBE?AVTPtrC16@@XZ @ 280 NONAME ; class TPtrC16 CApaAppData::LocalisableResourceFileName(void) const
+	?OpaqueData@CApaAppData@@QBE?AVTPtrC8@@XZ @ 281 NONAME ; class TPtrC8 CApaAppData::OpaqueData(void) const
+	?RegistrationFileName@CApaAppData@@QBE?AVTPtrC16@@XZ @ 282 NONAME ; class TPtrC16 CApaAppData::RegistrationFileName(void) const
+	?GetDefaultScreenNumber@RApaLsSession@@QBEHAAHVTUid@@@Z @ 283 NONAME ; int RApaLsSession::GetDefaultScreenNumber(int &, class TUid) const
+	?FindAndAddSpecificAppL@CApaAppList@@QAEPAVCApaAppData@@PAVCApaAppRegFinder@@VTUid@@@Z @ 284 NONAME ; class CApaAppData * CApaAppList::FindAndAddSpecificAppL(class CApaAppRegFinder *, class TUid)
+	?MatchesSecurityPolicy@RApaLsSession@@QBEHAAHVTUid@@ABVTSecurityPolicy@@@Z @ 285 NONAME ; int RApaLsSession::MatchesSecurityPolicy(int &, class TUid, class TSecurityPolicy const &) const
+	?AddDataTypeL@CApaRegistrationResourceFileWriter@@QAEXHABVTDesC8@@@Z @ 286 NONAME ; void CApaRegistrationResourceFileWriter::AddDataTypeL(int, class TDesC8 const &)
+	?AddFileOwnershipInfoL@CApaRegistrationResourceFileWriter@@QAEXABVTDesC16@@@Z @ 287 NONAME ; void CApaRegistrationResourceFileWriter::AddFileOwnershipInfoL(class TDesC16 const &)
+	?NewL@CApaLocalisableResourceFileWriter@@SAPAV1@ABVTDesC16@@0H0@Z @ 288 NONAME ; class CApaLocalisableResourceFileWriter * CApaLocalisableResourceFileWriter::NewL(class TDesC16 const &, class TDesC16 const &, int, class TDesC16 const &)
+	?NewL@CApaRegistrationResourceFileWriter@@SAPAV1@VTUid@@ABVTDesC16@@I@Z @ 289 NONAME ; class CApaRegistrationResourceFileWriter * CApaRegistrationResourceFileWriter::NewL(class TUid, class TDesC16 const &, unsigned int)
+	?NonNativeApplicationType@CApaAppData@@QBE?AVTUid@@XZ @ 290 NONAME ; class TUid CApaAppData::NonNativeApplicationType(void) const
+	?SetAppIsHiddenL@CApaRegistrationResourceFileWriter@@QAEXH@Z @ 291 NONAME ; void CApaRegistrationResourceFileWriter::SetAppIsHiddenL(int)
+	?SetDefaultScreenNumberL@CApaRegistrationResourceFileWriter@@QAEXH@Z @ 292 NONAME ; void CApaRegistrationResourceFileWriter::SetDefaultScreenNumberL(int)
+	?SetEmbeddabilityL@CApaRegistrationResourceFileWriter@@QAEXW4TEmbeddability@TApaAppCapability@@@Z @ 293 NONAME ; void CApaRegistrationResourceFileWriter::SetEmbeddabilityL(enum TApaAppCapability::TEmbeddability)
+	?SetGroupNameL@CApaRegistrationResourceFileWriter@@QAEXABVTDesC16@@@Z @ 294 NONAME ; void CApaRegistrationResourceFileWriter::SetGroupNameL(class TDesC16 const &)
+	?SetLaunchInBackgroundL@CApaRegistrationResourceFileWriter@@QAEXH@Z @ 295 NONAME ; void CApaRegistrationResourceFileWriter::SetLaunchInBackgroundL(int)
+	?SetOpaqueDataL@CApaRegistrationResourceFileWriter@@QAEXABVTDesC8@@@Z @ 296 NONAME ; void CApaRegistrationResourceFileWriter::SetOpaqueDataL(class TDesC8 const &)
+	?SetSupportsNewFileL@CApaRegistrationResourceFileWriter@@QAEXH@Z @ 297 NONAME ; void CApaRegistrationResourceFileWriter::SetSupportsNewFileL(int)
+	??1CApaLocalisableResourceFileWriter@@UAE@XZ @ 298 NONAME ; CApaLocalisableResourceFileWriter::~CApaLocalisableResourceFileWriter(void)
+	??1CApaRegistrationResourceFileWriter@@UAE@XZ @ 299 NONAME ; CApaRegistrationResourceFileWriter::~CApaRegistrationResourceFileWriter(void)
+	?AppScanInProgress@CApaAppList@@QBEHXZ @ 300 NONAME ; int CApaAppList::AppScanInProgress(void) const
+	?CancelNotify@RApaLsSession@@QAEXXZ @ 301 NONAME ; void RApaLsSession::CancelNotify(void)
+	?SetNotify@RApaLsSession@@QAEXHAAVTRequestStatus@@@Z @ 302 NONAME ; void RApaLsSession::SetNotify(int, class TRequestStatus &)
+	?CancelNotifyOnDataMappingChange@RApaLsSession@@QAEXXZ @ 303 NONAME ; void RApaLsSession::CancelNotifyOnDataMappingChange(void)
+	?NotifyOnDataMappingChange@RApaLsSession@@QAEXAAVTRequestStatus@@@Z @ 304 NONAME ; void RApaLsSession::NotifyOnDataMappingChange(class TRequestStatus &)
+	?GetAppType@RApaLsSession@@QBEHAAVTUid@@V2@@Z @ 305 NONAME ; int RApaLsSession::GetAppType(class TUid &, class TUid) const
+	?CommitNonNativeApplicationsUpdatesL@RApaLsSession@@QAEXXZ @ 306 NONAME ; void RApaLsSession::CommitNonNativeApplicationsUpdatesL(void)
+	?PrepareNonNativeApplicationsUpdatesL@RApaLsSession@@QAEXXZ @ 307 NONAME ; void RApaLsSession::PrepareNonNativeApplicationsUpdatesL(void)
+	?RollbackNonNativeApplicationsUpdates@RApaLsSession@@QAEHXZ @ 308 NONAME ; int RApaLsSession::RollbackNonNativeApplicationsUpdates(void)
+	?SetUpdatedAppsList@CApaAppList@@QAEXPAVCUpdatedAppsList@@@Z @ 309 NONAME ABSENT ; void CApaAppList::SetUpdatedAppsList(class CUpdatedAppsList *)
+	?UpdatedAppsList@CApaAppList@@QAEPAVCUpdatedAppsList@@XZ @ 310 NONAME ABSENT ; class CUpdatedAppsList * CApaAppList::UpdatedAppsList(void)
+	??1CApaAppData@@UAE@XZ @ 311 NONAME ; CApaAppData::~CApaAppData(void)
+	?NewL@CApaAppData@@SAPAV1@ABVTApaAppEntry@@AAVRFs@@ABVTDesC16@@@Z @ 312 NONAME ; class CApaAppData * CApaAppData::NewL(class TApaAppEntry const &, class RFs &, class TDesC16 const &)
+	?Self@CApaAppList@@SAPAV1@XZ @ 313 NONAME ; class CApaAppList * CApaAppList::Self(void)
+	?ShareProtectedFileServer@CApaAppList@@QAEAAVRFs@@XZ @ 314 NONAME ABSENT ; class RFs & CApaAppList::ShareProtectedFileServer(void)
+	X @ 315 NONAME ABSENT ; Old @internalComponent function that never needed to be exported
+	X @ 316 NONAME ABSENT ; Old @internalComponent function that never needed to be exported
+	X @ 317 NONAME ABSENT ; Old @internalComponent function that never needed to be exported
+	X @ 318 NONAME ABSENT ; Old @internalComponent function that never needed to be exported
+	?SetAppShortCaption@RApaLsSession@@QAEHABVTDesC16@@W4TLanguage@@VTUid@@@Z @ 319 NONAME ; int RApaLsSession::SetAppShortCaption(class TDesC16 const &, enum TLanguage, class TUid)
+	?SetShortCaptionL@CApaAppData@@QAEXABVTDesC16@@@Z @ 320 NONAME ; void CApaAppData::SetShortCaptionL(class TDesC16 const &)
+	?ForceRegistration@RApaLsSession@@QAEHABV?$RPointerArray@VTDesC16@@@@@Z @ 321 NONAME ; int RApaLsSession::ForceRegistration(class RPointerArray<class TDesC16> const &)
+	?AddForcedRegistrationL@CApaAppList@@QAEXPAVHBufC16@@@Z @ 322 NONAME ; void CApaAppList::AddForcedRegistrationL(class HBufC16 *)
+	?CompareStrings@CApaAppList@@SAHABVHBufC16@@0@Z @ 323 NONAME ; int CApaAppList::CompareStrings(class HBufC16 const &, class HBufC16 const &)
+	?ResetForcedRegistrations@CApaAppList@@QAEXXZ @ 324 NONAME ; void CApaAppList::ResetForcedRegistrations(void)
+	?RestartScanL@CApaAppList@@QAEXXZ @ 325 NONAME ; void CApaAppList::RestartScanL(void)
+	?StopScan@CApaAppList@@QAEXXZ @ 326 NONAME ; void CApaAppList::StopScan(void)
+	?MinApplicationStackSize@@YAIXZ @ 327 NONAME ; unsigned int MinApplicationStackSize(void)
+	?KMinApplicationStackSize@@3HB @ 328 NONAME ; int const KMinApplicationStackSize
+	?CheckAppSecurity@CApaSecurityUtils@@SAHABVTPtrC16@@AAH1@Z @ 329 NONAME ; int CApaSecurityUtils::CheckAppSecurity(class TPtrC16 const &, int &, int &)
+	?GetAppIcon@RApaLsSession@@QBEHVTUid@@AAVRFile@@@Z @ 330 NONAME ; int RApaLsSession::GetAppIcon(class TUid, class RFile &) const
+	?IsLanguageChangePending@CApaAppList@@QBEHXZ @ 331 NONAME ; int CApaAppList::IsLanguageChangePending(void) const
+	?IsPending@CApaAppData@@QBEHXZ @ 332 NONAME ; int CApaAppData::IsPending(void) const
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/bwins/APGRFX_UI_FRAMEWORKSU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,338 @@
+EXPORTS
+	??0RApaLsSession@@QAE@XZ @ 1 NONAME ; public: __thiscall RApaLsSession::RApaLsSession(void)
+	??0TApaPictureFactory@@QAE@PAVCApaProcess@@@Z @ 2 NONAME ; public: __thiscall TApaPictureFactory::TApaPictureFactory(class CApaProcess *)
+	??0TApaTask@@QAE@AAVRWsSession@@@Z @ 3 NONAME ; public: __thiscall TApaTask::TApaTask(class RWsSession &)
+	??0TApaTaskList@@QAE@AAVRWsSession@@@Z @ 4 NONAME ; public: __thiscall TApaTaskList::TApaTaskList(class RWsSession &)
+	??1CApaAppInfoFileReader@@UAE@XZ @ 5 NONAME ABSENT ; public: virtual __thiscall CApaAppInfoFileReader::~CApaAppInfoFileReader(void)
+	??1CApaAppInfoFileWriter@@UAE@XZ @ 6 NONAME ; public: virtual __thiscall CApaAppInfoFileWriter::~CApaAppInfoFileWriter(void)
+	??1CApaAppList@@UAE@XZ @ 7 NONAME ; public: virtual __thiscall CApaAppList::~CApaAppList(void)
+	??1CApaDoor@@UAE@XZ @ 8 NONAME ; public: virtual __thiscall CApaDoor::~CApaDoor(void)
+	??1CApaMaskedBitmap@@UAE@XZ @ 9 NONAME ; public: virtual __thiscall CApaMaskedBitmap::~CApaMaskedBitmap(void)
+	??1CApaWindowGroupName@@UAE@XZ @ 10 NONAME ; public: virtual __thiscall CApaWindowGroupName::~CApaWindowGroupName(void)
+	?AddCaptionL@CApaAppInfoFileWriter@@QAEXW4TLanguage@@ABVTDesC16@@@Z @ 11 NONAME ; public: void __thiscall CApaAppInfoFileWriter::AddCaptionL(enum TLanguage,class TDesC16 const &)
+	?AddIconL@CApaAppInfoFileWriter@@QAEXAAVCApaMaskedBitmap@@@Z @ 12 NONAME ; public: void __thiscall CApaAppInfoFileWriter::AddIconL(class CApaMaskedBitmap &)
+	?AddIconL@CApaAppInfoFileWriter@@QAEXABVTDesC16@@@Z @ 13 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::AddIconL(class TDesC16 const &)
+	?AppCount@RApaLsSession@@QBEHAAH@Z @ 14 NONAME ; public: int __thiscall RApaLsSession::AppCount(int &)const 
+	?AppDataByUid@CApaAppList@@QBEPAVCApaAppData@@VTUid@@@Z @ 15 NONAME ; public: class CApaAppData * __thiscall CApaAppList::AppDataByUid(class TUid)const 
+	?AppEntry@CApaAppData@@QBE?AVTApaAppEntry@@XZ @ 16 NONAME ; public: class TApaAppEntry  __thiscall CApaAppData::AppEntry(void)const 
+	?AppUid@CApaWindowGroupName@@QBE?AVTUid@@XZ @ 17 NONAME ; public: class TUid  __thiscall CApaWindowGroupName::AppUid(void)const 
+	?AppUidL@CApaDoor@@QBE?AVTUid@@XZ @ 18 NONAME ; public: class TUid  __thiscall CApaDoor::AppUidL(void)const 
+	?BringToForeground@TApaTask@@QAEXXZ @ 19 NONAME ; public: void __thiscall TApaTask::BringToForeground(void)
+	?Capability@CApaAppData@@QBEXAAVTDes8@@@Z @ 20 NONAME ; public: void __thiscall CApaAppData::Capability(class TDes8 &)const 
+	?Capability@CApaAppInfoFileReader@@QBEXAAVTDes8@@@Z @ 21 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileReader::Capability(class TDes8 &)const 
+	?Caption@CApaWindowGroupName@@QBE?AVTPtrC16@@XZ @ 22 NONAME ; public: class TPtrC16  __thiscall CApaWindowGroupName::Caption(void)const 
+	?CaptionL@CApaAppInfoFileReader@@QAE?AV?$TBuf@$0BAA@@@W4TLanguage@@@Z @ 23 NONAME ABSENT ; public: class TBuf<256>  __thiscall CApaAppInfoFileReader::CaptionL(enum TLanguage)
+	?Connect@RApaLsSession@@QAEHXZ @ 24 NONAME ; public: int __thiscall RApaLsSession::Connect(void)
+	?ConstructFromWgIdL@CApaWindowGroupName@@QAEXH@Z @ 25 NONAME ; public: void __thiscall CApaWindowGroupName::ConstructFromWgIdL(int)
+	?Count@CApaAppList@@QBEHXZ @ 26 NONAME ; public: int __thiscall CApaAppList::Count(void)const 
+	?CreateMaskedBitmapL@CApaAppInfoFileReader@@QAEPAVCApaMaskedBitmap@@H@Z @ 27 NONAME ABSENT ; public: class CApaMaskedBitmap * __thiscall CApaAppInfoFileReader::CreateMaskedBitmapL(int)
+	?CycleTasks@TApaTaskList@@QAEHVTUid@@W4TCycleDirection@1@@Z @ 28 NONAME ; public: int __thiscall TApaTaskList::CycleTasks(class TUid,enum TApaTaskList::TCycleDirection)
+	?DocName@CApaWindowGroupName@@QBE?AVTPtrC16@@XZ @ 29 NONAME ; public: class TPtrC16  __thiscall CApaWindowGroupName::DocName(void)const 
+	?DocNameIsAFile@CApaWindowGroupName@@QBEHXZ @ 30 NONAME ; public: int __thiscall CApaWindowGroupName::DocNameIsAFile(void)const 
+	?DocumentL@CApaDoor@@QAEPAVCApaDocument@@H@Z @ 31 NONAME ; public: class CApaDocument * __thiscall CApaDoor::DocumentL(int)
+	?EmbeddableAppCount@RApaLsSession@@QBEHAAH@Z @ 32 NONAME ; public: int __thiscall RApaLsSession::EmbeddableAppCount(int &)const 
+	?EndTask@TApaTask@@QAEXXZ @ 33 NONAME ; public: void __thiscall TApaTask::EndTask(void)
+	?Exists@TApaTask@@QBEHXZ @ 34 NONAME ; public: int __thiscall TApaTask::Exists(void)const 
+	?ExternalizeL@CApaMaskedBitmap@@QBEXAAVRWriteStream@@@Z @ 35 NONAME ; public: void __thiscall CApaMaskedBitmap::ExternalizeL(class RWriteStream &)const 
+	?FindApp@TApaTaskList@@QAE?AVTApaTask@@ABVTDesC16@@@Z @ 36 NONAME ; public: class TApaTask  __thiscall TApaTaskList::FindApp(class TDesC16 const &)
+	?FindApp@TApaTaskList@@QAE?AVTApaTask@@VTUid@@@Z @ 37 NONAME ; public: class TApaTask  __thiscall TApaTaskList::FindApp(class TUid)
+	?FindByAppUid@CApaWindowGroupName@@SAXVTUid@@AAVRWsSession@@AAH@Z @ 38 NONAME ; public: static void __cdecl CApaWindowGroupName::FindByAppUid(class TUid,class RWsSession &,int &)
+	?FindByCaption@CApaWindowGroupName@@SAXABVTDesC16@@AAVRWsSession@@AAH@Z @ 39 NONAME ; public: static void __cdecl CApaWindowGroupName::FindByCaption(class TDesC16 const &,class RWsSession &,int &)
+	?FindByDocName@CApaWindowGroupName@@SAXABVTDesC16@@AAVRWsSession@@AAH@Z @ 40 NONAME ; public: static void __cdecl CApaWindowGroupName::FindByDocName(class TDesC16 const &,class RWsSession &,int &)
+	?FindByPos@TApaTaskList@@QAE?AVTApaTask@@H@Z @ 41 NONAME ; public: class TApaTask  __thiscall TApaTaskList::FindByPos(int)
+	?FindDoc@TApaTaskList@@QAE?AVTApaTask@@ABVTDesC16@@@Z @ 42 NONAME ; public: class TApaTask  __thiscall TApaTaskList::FindDoc(class TDesC16 const &)
+	?FirstApp@CApaAppList@@QBEPAVCApaAppData@@XZ @ 43 NONAME ; public: class CApaAppData * __thiscall CApaAppList::FirstApp(void)const 
+	?GetAllApps@RApaLsSession@@QBEHXZ @ 44 NONAME ; public: int __thiscall RApaLsSession::GetAllApps(void)const 
+	?GetAppCapability@RApaLsSession@@QBEHAAVTDes8@@VTUid@@@Z @ 45 NONAME ; public: int __thiscall RApaLsSession::GetAppCapability(class TDes8 &,class TUid)const 
+	?GetAppInfo@RApaLsSession@@QBEHAAVTApaAppInfo@@VTUid@@@Z @ 46 NONAME ; public: int __thiscall RApaLsSession::GetAppInfo(class TApaAppInfo &,class TUid)const 
+	?GetEmbeddableApps@RApaLsSession@@QBEHXZ @ 47 NONAME ; public: int __thiscall RApaLsSession::GetEmbeddableApps(void)const 
+	?GetNextApp@RApaLsSession@@QBEHAAVTApaAppInfo@@@Z @ 48 NONAME ; public: int __thiscall RApaLsSession::GetNextApp(class TApaAppInfo &)const 
+	?InternalizeL@CApaMaskedBitmap@@QAEXAAVRReadStream@@@Z @ 49 NONAME ; public: void __thiscall CApaMaskedBitmap::InternalizeL(class RReadStream &)
+	?IsBusy@CApaWindowGroupName@@QBEHXZ @ 50 NONAME ; public: int __thiscall CApaWindowGroupName::IsBusy(void)const 
+	?IsSystem@CApaWindowGroupName@@QBEHXZ @ 51 NONAME ; public: int __thiscall CApaWindowGroupName::IsSystem(void)const 
+	?KillTask@TApaTask@@QAEXXZ @ 52 NONAME ; public: void __thiscall TApaTask::KillTask(void)
+	?Mask@CApaMaskedBitmap@@QBEPAVCFbsBitmap@@XZ @ 53 NONAME ; public: class CFbsBitmap * __thiscall CApaMaskedBitmap::Mask(void)const 
+	?New@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@PAVHBufC16@@@Z @ 54 NONAME ; public: static class CApaWindowGroupName * __cdecl CApaWindowGroupName::New(class RWsSession const &,class HBufC16 *)
+	?NewL@CApaAppInfoFileReader@@SAPAV1@AAVRFs@@ABVTDesC16@@VTUid@@@Z @ 55 NONAME ABSENT ; public: static class CApaAppInfoFileReader * __cdecl CApaAppInfoFileReader::NewL(class RFs &,class TDesC16 const &,class TUid)
+	?NewL@CApaAppList@@SAPAV1@AAVRFs@@PAVCApaAppRegFinder@@HH@Z @ 56 NONAME ; class CApaAppList * CApaAppList::NewL(class RFs &, class CApaAppRegFinder *, int, int)
+	?NewL@CApaDoor@@SAPAV1@AAVRFs@@AAVCApaDocument@@ABVTSize@@@Z @ 57 NONAME ; public: static class CApaDoor * __cdecl CApaDoor::NewL(class RFs &,class CApaDocument &,class TSize const &)
+	?NewL@CApaDoor@@SAPAV1@AAVRFs@@ABVCStreamStore@@VTStreamId@@AAVCApaProcess@@@Z @ 58 NONAME ; public: static class CApaDoor * __cdecl CApaDoor::NewL(class RFs &,class CStreamStore const &,class TStreamId,class CApaProcess &)
+	?NewL@CApaMaskedBitmap@@SAPAV1@PBV1@@Z @ 59 NONAME ; class CApaMaskedBitmap * CApaMaskedBitmap::NewL(class CApaMaskedBitmap const *)
+	?NewL@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@@Z @ 60 NONAME ; public: static class CApaWindowGroupName * __cdecl CApaWindowGroupName::NewL(class RWsSession const &)
+	?NewL@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@ABVTDesC16@@@Z @ 61 NONAME ; public: static class CApaWindowGroupName * __cdecl CApaWindowGroupName::NewL(class RWsSession const &,class TDesC16 const &)
+	?NewL@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@H@Z @ 62 NONAME ; public: static class CApaWindowGroupName * __cdecl CApaWindowGroupName::NewL(class RWsSession const &,int)
+	?NewLC@CApaAppInfoFileReader@@SAPAV1@AAVRFs@@ABVTDesC16@@VTUid@@@Z @ 63 NONAME ABSENT ; public: static class CApaAppInfoFileReader * __cdecl CApaAppInfoFileReader::NewLC(class RFs &,class TDesC16 const &,class TUid)
+	?NewLC@CApaAppInfoFileWriter@@SAPAV1@AAVRFs@@ABVTDesC16@@VTUid@@@Z @ 64 NONAME ABSENT ; public: static class CApaAppInfoFileWriter * __cdecl CApaAppInfoFileWriter::NewLC(class RFs &,class TDesC16 const &,class TUid)
+	?NewLC@CApaDoor@@SAPAV1@AAVRFs@@AAVCApaDocument@@ABVTSize@@@Z @ 65 NONAME ; public: static class CApaDoor * __cdecl CApaDoor::NewLC(class RFs &,class CApaDocument &,class TSize const &)
+	?NewLC@CApaMaskedBitmap@@SAPAV1@XZ @ 66 NONAME ; public: static class CApaMaskedBitmap * __cdecl CApaMaskedBitmap::NewLC(void)
+	?NewLC@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@@Z @ 67 NONAME ; public: static class CApaWindowGroupName * __cdecl CApaWindowGroupName::NewLC(class RWsSession const &)
+	?NewLC@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@ABVTDesC16@@@Z @ 68 NONAME ; public: static class CApaWindowGroupName * __cdecl CApaWindowGroupName::NewLC(class RWsSession const &,class TDesC16 const &)
+	?NewLC@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@H@Z @ 69 NONAME ; public: static class CApaWindowGroupName * __cdecl CApaWindowGroupName::NewLC(class RWsSession const &,int)
+	?NewPictureL@TApaPictureFactory@@UBEXAAVTPictureHeader@@ABVCStreamStore@@@Z @ 70 NONAME ; public: virtual void __thiscall TApaPictureFactory::NewPictureL(class TPictureHeader &,class CStreamStore const &)const 
+	?NextApp@CApaAppList@@QBEPAVCApaAppData@@PBV2@@Z @ 71 NONAME ; public: class CApaAppData * __thiscall CApaAppList::NextApp(class CApaAppData const *)const 
+	?PurgeL@CApaAppList@@QAEXXZ @ 72 NONAME ; public: void __thiscall CApaAppList::PurgeL(void)
+	?RespondsToShutdownEvent@CApaWindowGroupName@@QBEHXZ @ 73 NONAME ; public: int __thiscall CApaWindowGroupName::RespondsToShutdownEvent(void)const 
+	?RespondsToSwitchFilesEvent@CApaWindowGroupName@@QBEHXZ @ 74 NONAME ; public: int __thiscall CApaWindowGroupName::RespondsToSwitchFilesEvent(void)const 
+	?RestoreL@CApaDoor@@QAEXABVCStreamStore@@VTStreamId@@@Z @ 75 NONAME ; public: void __thiscall CApaDoor::RestoreL(class CStreamStore const &,class TStreamId)
+	?SendKey@TApaTask@@QAEXABUTKeyEvent@@@Z @ 76 NONAME ; public: void __thiscall TApaTask::SendKey(struct TKeyEvent const &)
+	?SendKey@TApaTask@@QAEXHH@Z @ 77 NONAME ; public: void __thiscall TApaTask::SendKey(int,int)
+	?SendMessage@TApaTask@@QAEHVTUid@@ABVTDesC8@@@Z @ 78 NONAME ; public: int __thiscall TApaTask::SendMessage(class TUid,class TDesC8 const &)
+	?SendSystemEvent@TApaTask@@QAEXW4TApaSystemEvent@@@Z @ 79 NONAME ; public: void __thiscall TApaTask::SendSystemEvent(enum TApaSystemEvent)
+	?SendToBackground@TApaTask@@QAEXXZ @ 80 NONAME ; public: void __thiscall TApaTask::SendToBackground(void)
+	?SetAppUid@CApaWindowGroupName@@QAEXVTUid@@@Z @ 81 NONAME ; public: void __thiscall CApaWindowGroupName::SetAppUid(class TUid)
+	?SetBusy@CApaWindowGroupName@@QAEXH@Z @ 82 NONAME ; public: void __thiscall CApaWindowGroupName::SetBusy(int)
+	?SetCapability@CApaAppInfoFileWriter@@QAEHABVTDesC8@@@Z @ 83 NONAME ; public: int __thiscall CApaAppInfoFileWriter::SetCapability(class TDesC8 const &)
+	?SetCaptionL@CApaWindowGroupName@@QAEXABVTDesC16@@@Z @ 84 NONAME ; public: void __thiscall CApaWindowGroupName::SetCaptionL(class TDesC16 const &)
+	?SetDocNameIsAFile@CApaWindowGroupName@@QAEXH@Z @ 85 NONAME ; public: void __thiscall CApaWindowGroupName::SetDocNameIsAFile(int)
+	?SetDocNameL@CApaWindowGroupName@@QAEXABVTDesC16@@@Z @ 86 NONAME ; public: void __thiscall CApaWindowGroupName::SetDocNameL(class TDesC16 const &)
+	?SetFormatToGlassL@CApaDoor@@QAEXXZ @ 87 NONAME ; public: void __thiscall CApaDoor::SetFormatToGlassL(void)
+	?SetFormatToIconL@CApaDoor@@QAEXXZ @ 88 NONAME ; public: void __thiscall CApaDoor::SetFormatToIconL(void)
+	?SetFormatToTemporaryIconL@CApaDoor@@QAEXH@Z @ 89 NONAME ; public: void __thiscall CApaDoor::SetFormatToTemporaryIconL(int)
+	?SetRespondsToShutdownEvent@CApaWindowGroupName@@QAEXH@Z @ 90 NONAME ; public: void __thiscall CApaWindowGroupName::SetRespondsToShutdownEvent(int)
+	?SetRespondsToSwitchFilesEvent@CApaWindowGroupName@@QAEXH@Z @ 91 NONAME ; public: void __thiscall CApaWindowGroupName::SetRespondsToSwitchFilesEvent(int)
+	?SetSystem@CApaWindowGroupName@@QAEXH@Z @ 92 NONAME ; public: void __thiscall CApaWindowGroupName::SetSystem(int)
+	?SetWgId@TApaTask@@QAEXH@Z @ 93 NONAME ; public: void __thiscall TApaTask::SetWgId(int)
+	?SetWindowGroupName@CApaWindowGroupName@@QAEXPAVHBufC16@@@Z @ 94 NONAME ; public: void __thiscall CApaWindowGroupName::SetWindowGroupName(class HBufC16 *)
+	?SetWindowGroupName@CApaWindowGroupName@@QBEHAAVRWindowGroup@@@Z @ 95 NONAME ; public: int __thiscall CApaWindowGroupName::SetWindowGroupName(class RWindowGroup &)const 
+	?SetWindowGroupNameL@CApaWindowGroupName@@QAEXABVTDesC16@@@Z @ 96 NONAME ; public: void __thiscall CApaWindowGroupName::SetWindowGroupNameL(class TDesC16 const &)
+	?StartApp@RApaLsSession@@QAEHABVCApaCommandLine@@@Z @ 97 NONAME ; public: int __thiscall RApaLsSession::StartApp(class CApaCommandLine const &)
+	?StoreL@CApaAppInfoFileWriter@@QAEXXZ @ 98 NONAME ; public: void __thiscall CApaAppInfoFileWriter::StoreL(void)
+	?StretchDrawL@CApaAppInfoFileReader@@SAXPAVCFbsBitmap@@0VTSize@@@Z @ 99 NONAME ABSENT ; public: static void __cdecl CApaAppInfoFileReader::StretchDrawL(class CFbsBitmap *,class CFbsBitmap *,class TSize)
+	?SwitchCreateFile@TApaTask@@QAEHABVTDesC16@@@Z @ 100 NONAME ; public: int __thiscall TApaTask::SwitchCreateFile(class TDesC16 const &)
+	?SwitchOpenFile@TApaTask@@QAEHABVTDesC16@@@Z @ 101 NONAME ; public: int __thiscall TApaTask::SwitchOpenFile(class TDesC16 const &)
+	?ThreadId@TApaTask@@QBE?AVTThreadId@@XZ @ 102 NONAME ; public: class TThreadId  __thiscall TApaTask::ThreadId(void)const 
+	?UpdateCounter@CApaAppList@@QBEHXZ @ 103 NONAME ABSENT ; public: int __thiscall CApaAppList::UpdateCounter(void)const 
+	?UpdateL@CApaAppList@@QAEXXZ @ 104 NONAME ABSENT ; public: void __thiscall CApaAppList::UpdateL(void)
+	?Version@RApaLsSession@@QBE?AVTVersion@@XZ @ 105 NONAME ; public: class TVersion  __thiscall RApaLsSession::Version(void)const 
+	?WgId@TApaTask@@QBEHXZ @ 106 NONAME ; public: int __thiscall TApaTask::WgId(void)const 
+	?WindowGroupName@CApaWindowGroupName@@QBE?AVTPtrC16@@XZ @ 107 NONAME ; public: class TPtrC16  __thiscall CApaWindowGroupName::WindowGroupName(void)const 
+	??1CApaSystemControlList@@UAE@XZ @ 108 NONAME ; public: virtual __thiscall CApaSystemControlList::~CApaSystemControlList(void)
+	?Caption@CApaSystemControl@@QBE?AVTPtrC16@@XZ @ 109 NONAME ; public: class TPtrC16  __thiscall CApaSystemControl::Caption(void)const 
+	?Control@CApaSystemControlList@@QBEPAVCApaSystemControl@@H@Z @ 110 NONAME ; public: class CApaSystemControl * __thiscall CApaSystemControlList::Control(int)const 
+	?Control@CApaSystemControlList@@QBEPAVCApaSystemControl@@VTUid@@@Z @ 111 NONAME ; public: class CApaSystemControl * __thiscall CApaSystemControlList::Control(class TUid)const 
+	?Count@CApaSystemControlList@@QBEHXZ @ 112 NONAME ; public: int __thiscall CApaSystemControlList::Count(void)const 
+	?CreateL@CApaSystemControl@@QAEXXZ @ 113 NONAME ; public: void __thiscall CApaSystemControl::CreateL(void)
+	?FileName@CApaSystemControl@@QBE?AV?$TBuf@$0BAA@@@XZ @ 114 NONAME ; public: class TBuf<256>  __thiscall CApaSystemControl::FileName(void)const 
+	?Icon@CApaSystemControl@@QBEPAVCApaMaskedBitmap@@XZ @ 115 NONAME ; public: class CApaMaskedBitmap * __thiscall CApaSystemControl::Icon(void)const 
+	?Index@CApaSystemControlList@@QBEHVTUid@@@Z @ 116 NONAME ; public: int __thiscall CApaSystemControlList::Index(class TUid)const 
+	?NewL@CApaSystemControlList@@SAPAV1@AAVRFs@@AAVCApaAppFinder@@ABVTDesC16@@@Z @ 117 NONAME ABSENT ; public: static class CApaSystemControlList * __cdecl CApaSystemControlList::NewL(class RFs &,class CApaAppFinder &,class TDesC16 const &)
+	?Type@CApaSystemControl@@QBE?AVTUid@@XZ @ 118 NONAME ; public: class TUid  __thiscall CApaSystemControl::Type(void)const 
+	?UpdateL@CApaSystemControlList@@QAEXXZ @ 119 NONAME ; public: void __thiscall CApaSystemControlList::UpdateL(void)
+	?AddDataTypeL@CApaAppInfoFileWriter@@QAEXABVTDataTypeWithPriority@@@Z @ 120 NONAME ; public: void __thiscall CApaAppInfoFileWriter::AddDataTypeL(class TDataTypeWithPriority const &)
+	?AppForDataType@RApaLsSession@@QBEHABVTDataType@@AAVTUid@@@Z @ 121 NONAME ; public: int __thiscall RApaLsSession::AppForDataType(class TDataType const &,class TUid &)const 
+	?AppForDocument@RApaLsSession@@QBEHABVTDesC16@@AAVTUid@@AAVTDataType@@@Z @ 122 NONAME ; public: int __thiscall RApaLsSession::AppForDocument(class TDesC16 const &,class TUid &,class TDataType &)const 
+	?CreateDocument@RApaLsSession@@QAEHABVTDesC16@@VTUid@@AAVTThreadId@@W4TLaunchType@1@@Z @ 123 NONAME ; public: int __thiscall RApaLsSession::CreateDocument(class TDesC16 const &,class TUid,class TThreadId &,enum RApaLsSession::TLaunchType)
+	?DataType@CApaAppData@@QBEJABVTDataType@@@Z @ 124 NONAME ; long CApaAppData::DataType(class TDataType const &) const
+	?DataTypesSupportedL@CApaAppInfoFileReader@@QBEXAAV?$CArrayFix@VTDataTypeWithPriority@@@@@Z @ 125 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileReader::DataTypesSupportedL(class CArrayFix<class TDataTypeWithPriority> &)const 
+	?GetAcceptedConfidence@RApaLsSession@@QBEHAAH@Z @ 126 NONAME ; public: int __thiscall RApaLsSession::GetAcceptedConfidence(int &)const 
+	?GetAppIcon@RApaLsSession@@QBEHVTUid@@HAAVCApaMaskedBitmap@@@Z @ 127 NONAME ; public: int __thiscall RApaLsSession::GetAppIcon(class TUid,int,class CApaMaskedBitmap &)const 
+	?GetMaxDataBufSize@RApaLsSession@@QBEHAAH@Z @ 128 NONAME ; public: int __thiscall RApaLsSession::GetMaxDataBufSize(int &)const 
+	?GetSupportedDataTypesL@RApaLsSession@@QBEHAAV?$CArrayFixFlat@VTDataType@@@@@Z @ 129 NONAME ; public: int __thiscall RApaLsSession::GetSupportedDataTypesL(class CArrayFixFlat<class TDataType> &)const 
+	?IsProgram@RApaLsSession@@QBEHABVTDesC16@@AAH@Z @ 130 NONAME ; public: int __thiscall RApaLsSession::IsProgram(class TDesC16 const &,int &)const 
+	?PreferredDataHandlerL@CApaAppList@@QBE?AVTUid@@ABVTDataType@@@Z @ 131 NONAME ; public: class TUid  __thiscall CApaAppList::PreferredDataHandlerL(class TDataType const &)const 
+	?RecognizeData@RApaLsSession@@QBEHABVTDesC16@@ABVTDesC8@@AAVTDataRecognitionResult@@@Z @ 132 NONAME ; public: int __thiscall RApaLsSession::RecognizeData(class TDesC16 const &,class TDesC8 const &,class TDataRecognitionResult &)const 
+	?RecognizeSpecificData@RApaLsSession@@QBEHABVTDesC16@@ABVTDesC8@@ABVTDataType@@AAH@Z @ 133 NONAME ; public: int __thiscall RApaLsSession::RecognizeSpecificData(class TDesC16 const &,class TDesC8 const &,class TDataType const &,int &)const 
+	?SetAcceptedConfidence@RApaLsSession@@QAEHH@Z @ 134 NONAME ; public: int __thiscall RApaLsSession::SetAcceptedConfidence(int)
+	?SetMaxDataBufSize@RApaLsSession@@QAEHH@Z @ 135 NONAME ; public: int __thiscall RApaLsSession::SetMaxDataBufSize(int)
+	?StartDocument@RApaLsSession@@QAEHABVTDesC16@@AAVTThreadId@@W4TLaunchType@1@@Z @ 136 NONAME ; public: int __thiscall RApaLsSession::StartDocument(class TDesC16 const &,class TThreadId &,enum RApaLsSession::TLaunchType)
+	?StartDocument@RApaLsSession@@QAEHABVTDesC16@@ABVTDataType@@AAVTThreadId@@W4TLaunchType@1@@Z @ 137 NONAME ; public: int __thiscall RApaLsSession::StartDocument(class TDesC16 const &,class TDataType const &,class TThreadId &,enum RApaLsSession::TLaunchType)
+	?StartDocument@RApaLsSession@@QAEHABVTDesC16@@VTUid@@AAVTThreadId@@W4TLaunchType@1@@Z @ 138 NONAME ; public: int __thiscall RApaLsSession::StartDocument(class TDesC16 const &,class TUid,class TThreadId &,enum RApaLsSession::TLaunchType)
+	?StartIdleUpdateL@CApaAppList@@QAEXXZ @ 139 NONAME ; public: void __thiscall CApaAppList::StartIdleUpdateL(void)
+	??1CApaAppListNotifier@@UAE@XZ @ 140 NONAME ; public: virtual __thiscall CApaAppListNotifier::~CApaAppListNotifier(void)
+	?NewL@CApaAppListNotifier@@SAPAV1@PAVMApaAppListServObserver@@W4TPriority@CActive@@@Z @ 141 NONAME ; public: static class CApaAppListNotifier * __cdecl CApaAppListNotifier::NewL(class MApaAppListServObserver *,enum CActive::TPriority)
+	?StartIdleUpdateL@CApaAppList@@QAEXPAVMApaAppListObserver@@@Z @ 142 NONAME ; public: void __thiscall CApaAppList::StartIdleUpdateL(class MApaAppListObserver *)
+	?GetAppIcon@RApaLsSession@@QBEHVTUid@@VTSize@@AAVCApaMaskedBitmap@@@Z @ 143 NONAME ; public: int __thiscall RApaLsSession::GetAppIcon(class TUid,class TSize,class CApaMaskedBitmap &)const 
+	?GetAppIconSizes@RApaLsSession@@QBEHVTUid@@AAV?$CArrayFixFlat@VTSize@@@@@Z @ 144 NONAME ; public: int __thiscall RApaLsSession::GetAppIconSizes(class TUid,class CArrayFixFlat<class TSize> &)const 
+	?Icon@CApaAppData@@QBEPAVCApaMaskedBitmap@@VTSize@@@Z @ 145 NONAME ; public: class CApaMaskedBitmap * __thiscall CApaAppData::Icon(class TSize)const 
+	?IconSizesL@CApaAppData@@QBEPAV?$CArrayFixFlat@VTSize@@@@XZ @ 146 NONAME ; public: class CArrayFixFlat<class TSize> * __thiscall CApaAppData::IconSizesL(void)const 
+	?Icon@CApaAppData@@QBEPAVCApaMaskedBitmap@@H@Z @ 147 NONAME ; public: class CApaMaskedBitmap * __thiscall CApaAppData::Icon(int)const 
+	?Hidden@CApaWindowGroupName@@QBEHXZ @ 148 NONAME ; int CApaWindowGroupName::Hidden(void) const
+	?SetHidden@CApaWindowGroupName@@QAEXH@Z @ 149 NONAME ; public: void __thiscall CApaWindowGroupName::SetHidden(int)
+	?AddViewCaptionL@CApaAppInfoFileWriter@@QAEXW4TLanguage@@ABVTDesC16@@VTUid@@@Z @ 150 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::AddViewCaptionL(enum TLanguage,class TDesC16 const &,class TUid)
+	?AddViewIconL@CApaAppInfoFileWriter@@QAEXAAVCApaMaskedBitmap@@VTUid@@@Z @ 151 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::AddViewIconL(class CApaMaskedBitmap &,class TUid)
+	?AddViewL@CApaAppInfoFileWriter@@QAEXVTUid@@@Z @ 152 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::AddViewL(class TUid)
+	?CaptionL@CApaAIFViewData@@QBE?AV?$TBuf@$0BAA@@@W4TLanguage@@@Z @ 153 NONAME ABSENT ; public: class TBuf<256>  __thiscall CApaAIFViewData::CaptionL(enum TLanguage)const 
+	?GetAppViewIcon@RApaLsSession@@QBEHVTUid@@0ABVTSize@@AAVCApaMaskedBitmap@@@Z @ 154 NONAME ; public: int __thiscall RApaLsSession::GetAppViewIcon(class TUid,class TUid,class TSize const &,class CApaMaskedBitmap &)const 
+	?GetAppViews@RApaLsSession@@QBEHAAV?$CArrayFixFlat@VTApaAppViewInfo@@@@VTUid@@@Z @ 155 NONAME ; public: int __thiscall RApaLsSession::GetAppViews(class CArrayFixFlat<class TApaAppViewInfo> &,class TUid)const 
+	?GetViewsL@CApaAppInfoFileReader@@QBEXAAV?$CArrayPtr@VCApaAIFViewData@@@@@Z @ 156 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileReader::GetViewsL(class CArrayPtr<class CApaAIFViewData> &)const 
+	?Icon@CApaAppViewData@@QBEPAVCApaMaskedBitmap@@ABVTSize@@@Z @ 157 NONAME ; public: class CApaMaskedBitmap * __thiscall CApaAppViewData::Icon(class TSize const &)const 
+	?IconByIndexL@CApaAIFViewData@@QBEPAVCApaMaskedBitmap@@H@Z @ 158 NONAME ABSENT ; public: class CApaMaskedBitmap * __thiscall CApaAIFViewData::IconByIndexL(int)const 
+	?IconSizesL@CApaAppViewData@@QBEPAV?$CArrayFixFlat@VTSize@@@@XZ @ 159 NONAME ; public: class CArrayFixFlat<class TSize> * __thiscall CApaAppViewData::IconSizesL(void)const 
+	?NumberOfIcons@CApaAIFViewData@@QBEHXZ @ 160 NONAME ABSENT ; public: int __thiscall CApaAIFViewData::NumberOfIcons(void)const 
+	?StoreViewL@CApaAppInfoFileWriter@@QAEXVTUid@@@Z @ 161 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::StoreViewL(class TUid)
+	?Uid@CApaAppViewData@@QBE?AVTUid@@XZ @ 162 NONAME ; public: class TUid  __thiscall CApaAppViewData::Uid(void)const 
+	?ViewUid@CApaAIFViewData@@QBE?AVTUid@@XZ @ 163 NONAME ABSENT ; public: class TUid  __thiscall CApaAIFViewData::ViewUid(void)const 
+	?Views@CApaAppData@@QBEPAV?$CArrayPtrFlat@VCApaAppViewData@@@@XZ @ 164 NONAME ; public: class CArrayPtrFlat<class CApaAppViewData> * __thiscall CApaAppData::Views(void)const 
+	?AddOwnedFileL@CApaAppInfoFileWriter@@QAEXABVTDesC16@@@Z @ 165 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::AddOwnedFileL(class TDesC16 const &)
+	?GetOwnedFilesL@CApaAppInfoFileReader@@QBEXAAVCDesC16Array@@@Z @ 166 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileReader::GetOwnedFilesL(class CDesC16Array &)const 
+	?OwnedFiles@CApaAppData@@QBEPAVCDesC16Array@@XZ @ 167 NONAME ; public: class CDesC16Array * __thiscall CApaAppData::OwnedFiles(void)const 
+	?GetAppOwnedFiles@RApaLsSession@@QBEHAAVCDesC16Array@@VTUid@@@Z @ 168 NONAME ; public: int __thiscall RApaLsSession::GetAppOwnedFiles(class CDesC16Array &,class TUid)const 
+	?StartApp@RApaLsSession@@QAEHABVCApaCommandLine@@AAVTThreadId@@@Z @ 169 NONAME ; public: int __thiscall RApaLsSession::StartApp(class CApaCommandLine const &,class TThreadId &)
+	?GetAifFileName@AppInfoFileUtils@@SAXABVRFs@@AAVTDes16@@@Z @ 170 NONAME ABSENT ; public: static void __cdecl AppInfoFileUtils::GetAifFileName(class RFs const &,class TDes16 &)
+	?AddViewL@CApaAppInfoFileWriter@@QAEXVTUid@@H@Z @ 171 NONAME ABSENT ; public: void __thiscall CApaAppInfoFileWriter::AddViewL(class TUid,int)
+	?CanUseScreenMode@CApaAppData@@QAEHH@Z @ 172 NONAME ; public: int __thiscall CApaAppData::CanUseScreenMode(int)
+	?FirstApp@CApaAppList@@QBEPAVCApaAppData@@H@Z @ 173 NONAME ; public: class CApaAppData * __thiscall CApaAppList::FirstApp(int)const 
+	?GetAllApps@RApaLsSession@@QBEHH@Z @ 174 NONAME ; public: int __thiscall RApaLsSession::GetAllApps(int)const 
+	?GetEmbeddableApps@RApaLsSession@@QBEHH@Z @ 175 NONAME ; public: int __thiscall RApaLsSession::GetEmbeddableApps(int)const 
+	?GetNextApp@RApaLsSession@@QBEHAAVTApaAppInfo@@H@Z @ 176 NONAME ; public: int __thiscall RApaLsSession::GetNextApp(class TApaAppInfo &,int)const 
+	?NextApp@CApaAppList@@QBEPAVCApaAppData@@PBV2@H@Z @ 177 NONAME ; public: class CApaAppData * __thiscall CApaAppList::NextApp(class CApaAppData const *,int)const 
+	?ScreenMode@CApaAIFViewData@@QBEHXZ @ 178 NONAME ABSENT ; public: int __thiscall CApaAIFViewData::ScreenMode(void)const 
+	?ScreenMode@CApaAppViewData@@QBEHXZ @ 179 NONAME ; public: int __thiscall CApaAppViewData::ScreenMode(void)const 
+	?ShortCaption@CApaSystemControl@@QBE?AVTPtrC16@@XZ @ 180 NONAME ; public: class TPtrC16  __thiscall CApaSystemControl::ShortCaption(void)const 
+	?IsIdleUpdateComplete@CApaAppList@@QBEHXZ @ 181 NONAME ; public: int __thiscall CApaAppList::IsIdleUpdateComplete(void)const 
+	?IsAppReady@CApaWindowGroupName@@QBEHXZ @ 182 NONAME ; public: int __thiscall CApaWindowGroupName::IsAppReady(void)const 
+	?SetAppReady@CApaWindowGroupName@@QAEXH@Z @ 183 NONAME ; public: void __thiscall CApaWindowGroupName::SetAppReady(int)
+	?InitListL@CApaAppList@@QAEXPAVMApaAppListObserver@@@Z @ 184 NONAME ; public: void __thiscall CApaAppList::InitListL(class MApaAppListObserver *)
+	?NumberOfBitmaps@CApaAppInfoFileReader@@QBEHXZ @ 185 NONAME ABSENT ; public: int __thiscall CApaAppInfoFileReader::NumberOfBitmaps(void)const 
+	?IsFirstScanComplete@CApaAppList@@QBEHXZ @ 186 NONAME ; public: int __thiscall CApaAppList::IsFirstScanComplete(void)const 
+	?SetMaskBitmap@CApaMaskedBitmap@@QAEXPAVCFbsBitmap@@@Z @ 187 NONAME ; public: void __thiscall CApaMaskedBitmap::SetMaskBitmap(class CFbsBitmap *)
+	?GetAppInfo_7_0@RApaLsSession@@ABEHAAVTApaAppInfo_7_0@@VTUid@@@Z @ 188 NONAME ABSENT ; int RApaLsSession::GetAppInfo_7_0(class TApaAppInfo_7_0 &, class TUid) const
+	?GetNextApp_7_0@RApaLsSession@@ABEHAAVTApaAppInfo_7_0@@@Z @ 189 NONAME ABSENT ; int RApaLsSession::GetNextApp_7_0(class TApaAppInfo_7_0 &) const
+	?GetNextApp_7_0@RApaLsSession@@ABEHAAVTApaAppInfo_7_0@@H@Z @ 190 NONAME ABSENT ; int RApaLsSession::GetNextApp_7_0(class TApaAppInfo_7_0 &, int) const
+	?GetIconInfo@CApaAppData@@QBEXAAH0@Z @ 191 NONAME ; void CApaAppData::GetIconInfo(int &, int &) const
+	?NumberOfOwnDefinedIcons@RApaLsSession@@QBEHVTUid@@AAH@Z @ 192 NONAME ; public: int __thiscall RApaLsSession::NumberOfOwnDefinedIcons(class TUid,int &)const 
+	?GetFilteredApps@RApaLsSession@@QBEHABVTApaEmbeddabilityFilter@@@Z @ 193 NONAME ; public: int __thiscall RApaLsSession::GetFilteredApps(class TApaEmbeddabilityFilter const &)const 
+	?GetFilteredApps@RApaLsSession@@QBEHABVTApaEmbeddabilityFilter@@H@Z @ 194 NONAME ; public: int __thiscall RApaLsSession::GetFilteredApps(class TApaEmbeddabilityFilter const &,int)const 
+	?NewL@CApaAppList@@SAPAV1@AAVRFs@@PAVCApaAppFinder@@PAVCApaAppRegFinder@@H@Z @ 195 NONAME ABSENT ; class CApaAppList * CApaAppList::NewL(class RFs &, class CApaAppFinder *, class CApaAppRegFinder *, int)	
+	?DefaultScreenNumber@CApaAppData@@QBEIXZ @ 196 NONAME ; unsigned int CApaAppData::DefaultScreenNumber(void) const
+	?GetFilteredApps@RApaLsSession@@QBEHII@Z @ 197 NONAME ; int RApaLsSession::GetFilteredApps(unsigned int, unsigned int) const
+	?GetFilteredApps@RApaLsSession@@QBEHIIH@Z @ 198 NONAME ; int RApaLsSession::GetFilteredApps(unsigned int, unsigned int, int) const
+	?RegistrationFileUsed@CApaAppData@@QBEHXZ @ 199 NONAME ; int CApaAppData::RegistrationFileUsed(void) const
+	?GetAppIcon@RApaLsSession@@QBEHVTUid@@AAPAVHBufC16@@@Z @ 200 NONAME ; int RApaLsSession::GetAppIcon(class TUid, class HBufC16 * &) const
+	?IconFileName@CApaAppData@@QBE?AVTPtrC16@@XZ @ 201 NONAME ; class TPtrC16 CApaAppData::IconFileName(void) const
+	?GetAppViewIcon@RApaLsSession@@QBEHVTUid@@0AAPAVHBufC16@@@Z @ 202 NONAME ; int RApaLsSession::GetAppViewIcon(class TUid, class TUid, class HBufC16 * &) const
+	?IconFileName@CApaAppViewData@@QBE?AVTPtrC16@@XZ @ 203 NONAME ; class TPtrC16 CApaAppViewData::IconFileName(void) const
+	?NonMbmIconFile@CApaAppData@@QBEHXZ @ 204 NONAME ; int CApaAppData::NonMbmIconFile(void) const
+	?NonMbmIconFile@CApaAppViewData@@QBEHXZ @ 205 NONAME ; int CApaAppViewData::NonMbmIconFile(void) const
+	?StartupApaServer@@YAHAAVMApaAppStarter@@@Z @ 206 NONAME ; int StartupApaServer(class MApaAppStarter &)
+	?StartupApaServerProcess@@YAHXZ @ 207 NONAME ; int StartupApaServerProcess(void)
+	?DeleteDataMapping@RApaLsSession@@QAEHABVTDataType@@@Z @ 208 NONAME ; int RApaLsSession::DeleteDataMapping(class TDataType const &)
+	?InsertDataMapping@RApaLsSession@@QAEHABVTDataType@@JVTUid@@@Z @ 209 NONAME ; int RApaLsSession::InsertDataMapping(class TDataType const &, long, class TUid)
+	?InsertDataMappingIfHigher@RApaLsSession@@QAEHABVTDataType@@JVTUid@@AAH@Z @ 210 NONAME ; int RApaLsSession::InsertDataMappingIfHigher(class TDataType const &, long, class TUid, int &)
+	?ApplicationLanguage@CApaAppData@@QBE?AW4TLanguage@@XZ @ 211 NONAME ; enum TLanguage CApaAppData::ApplicationLanguage(void) const
+	?ApplicationLanguage@RApaLsSession@@QBEHVTUid@@AAW4TLanguage@@@Z @ 212 NONAME ; int RApaLsSession::ApplicationLanguage(class TUid, enum TLanguage &) const
+	?NewL@CApaSystemControlList@@SAPAV1@AAVRFs@@@Z @ 213 NONAME ; class CApaSystemControlList * CApaSystemControlList::NewL(class RFs &)
+	?AppForDataTypeAndService@RApaLsSession@@QBEHABVTDataType@@VTUid@@AAV3@@Z @ 214 NONAME ; int RApaLsSession::AppForDataTypeAndService(class TDataType const &, class TUid, class TUid &) const
+	?AppForDocumentAndService@RApaLsSession@@QBEHABVRFile@@VTUid@@AAV3@AAVTDataType@@@Z @ 215 NONAME ; int RApaLsSession::AppForDocumentAndService(class RFile const &, class TUid, class TUid &, class TDataType &) const
+	?AppForDocumentAndService@RApaLsSession@@QBEHABVTDesC16@@VTUid@@AAV3@AAVTDataType@@@Z @ 216 NONAME ; int RApaLsSession::AppForDocumentAndService(class TDesC16 const &, class TUid, class TUid &, class TDataType &) const
+	?GetAppServiceOpaqueDataLC@RApaLsSession@@QBEPAVCApaAppServiceInfoArray@@VTUid@@0@Z @ 217 NONAME ; class CApaAppServiceInfoArray * RApaLsSession::GetAppServiceOpaqueDataLC(class TUid, class TUid) const
+	?GetAppServicesL@RApaLsSession@@QBEXVTUid@@AAV?$CArrayFixFlat@VTUid@@@@@Z @ 218 NONAME ; void RApaLsSession::GetAppServicesL(class TUid, class CArrayFixFlat<class TUid> &) const
+	?GetAppServicesLC@RApaLsSession@@QBEPAVCApaAppServiceInfoArray@@VTUid@@@Z @ 219 NONAME ; class CApaAppServiceInfoArray * RApaLsSession::GetAppServicesLC(class TUid) const
+	?GetServerApps@RApaLsSession@@QBEHVTUid@@@Z @ 220 NONAME ; int RApaLsSession::GetServerApps(class TUid) const
+	?GetServerApps@RApaLsSession@@QBEHVTUid@@H@Z @ 221 NONAME ; int RApaLsSession::GetServerApps(class TUid, int) const
+	?GetServiceImplementationsLC@RApaLsSession@@QBEPAVCApaAppServiceInfoArray@@VTUid@@@Z @ 222 NONAME ; class CApaAppServiceInfoArray * RApaLsSession::GetServiceImplementationsLC(class TUid) const
+	?ImplementsService@CApaAppData@@QBEHVTUid@@@Z @ 223 NONAME ; int CApaAppData::ImplementsService(class TUid) const
+	?OpaqueData@TApaAppServiceInfo@@QBEABVTDesC8@@XZ @ 224 NONAME ; class TDesC8 const & TApaAppServiceInfo::OpaqueData(void) const
+	?PreferredDataHandlerL@CApaAppList@@QBE?AVTUid@@ABVTDataType@@PBV2@AAH@Z @ 225 NONAME ; class TUid CApaAppList::PreferredDataHandlerL(class TDataType const &, class TUid const *, int &) const
+	?ServiceArrayBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@@Z @ 226 NONAME ; class CBufFlat * CApaAppList::ServiceArrayBufferL(class TUid) const
+	?ServiceImplArrayBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@@Z @ 227 NONAME ; class CBufFlat * CApaAppList::ServiceImplArrayBufferL(class TUid) const
+	?ServiceOpaqueDataBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@0@Z @ 228 NONAME ; class CBufFlat * CApaAppList::ServiceOpaqueDataBufferL(class TUid, class TUid) const
+	?ServiceUidBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@@Z @ 229 NONAME ; class CBufFlat * CApaAppList::ServiceUidBufferL(class TUid) const
+	?Uid@TApaAppServiceInfo@@QBE?AVTUid@@XZ @ 230 NONAME ; class TUid TApaAppServiceInfo::Uid(void) const
+	?StartDocument@RApaLsSession@@QAEHAAVRFile@@AAVTThreadId@@PAVTRequestStatus@@@Z @ 231 NONAME ; int RApaLsSession::StartDocument(class RFile &, class TThreadId &, class TRequestStatus *)
+	?CreateMaskedBitmapByIndexLC@CApaAppInfoFileReader@@QAEPAVCApaMaskedBitmap@@H@Z @ 232 NONAME ABSENT ; class CApaMaskedBitmap * CApaAppInfoFileReader::CreateMaskedBitmapByIndexLC(int)
+	?CancelListPopulationCompleteObserver@RApaLsSession@@QBEHXZ @ 233 NONAME ; int RApaLsSession::CancelListPopulationCompleteObserver(void) const
+	?RegisterListPopulationCompleteObserver@RApaLsSession@@QBEXAAVTRequestStatus@@@Z @ 234 NONAME ; void RApaLsSession::RegisterListPopulationCompleteObserver(class TRequestStatus &) const
+	?NewInterimFormatFileWriterLC@ForJavaMIDletInstaller@@SAPAVCApaAppInfoFileWriter@@AAVRFs@@ABVTDesC16@@VTUid@@KH@Z @ 235 NONAME ; class CApaAppInfoFileWriter * ForJavaMIDletInstaller::NewInterimFormatFileWriterLC(class RFs &, class TDesC16 const &, class TUid, unsigned long, int)
+	?CheckInterimFormatFileNotCorruptL@ForJavaMIDletInstaller@@SAXAAVRFile@@@Z @ 236 NONAME ; void ForJavaMIDletInstaller::CheckInterimFormatFileNotCorruptL(class RFile &)
+	?RegisterJavaMIDletViaIterimFormat@RApaLsSession@@QAEHABVTDesC16@@AAVRFile@@@Z @ 237 NONAME ABSENT ; int RApaLsSession::RegisterJavaMIDletViaIterimFormat(class TDesC16 const &, class RFile &)
+	?DeregisterJavaMIDlet@RApaLsSession@@QAEHABVTDesC16@@@Z @ 238 NONAME ABSENT ; int RApaLsSession::DeregisterJavaMIDlet(class TDesC16 const &)
+	?AppForDocument@RApaLsSession@@QBEHABVRFile@@AAVTUid@@AAVTDataType@@@Z @ 239 NONAME ; int RApaLsSession::AppForDocument(class RFile const &, class TUid &, class TDataType &) const
+	?ClearFsSession@RApaLsSession@@SAXXZ @ 240 NONAME ; void RApaLsSession::ClearFsSession(void)
+	?FsSession@RApaLsSession@@SAPAVRFs@@XZ @ 241 NONAME ; class RFs * RApaLsSession::FsSession(void)
+	?RecognizeData@RApaLsSession@@QBEHABVRFile@@AAVTDataRecognitionResult@@@Z @ 242 NONAME ; int RApaLsSession::RecognizeData(class RFile const &, class TDataRecognitionResult &) const	
+	?RecognizeSpecificData@RApaLsSession@@QBEHABVRFile@@ABVTDataType@@AAH@Z @ 243 NONAME ; int RApaLsSession::RecognizeSpecificData(class RFile const &, class TDataType const &, int &) const
+	?SetFsSessionL@RApaLsSession@@SAXAAVRFs@@@Z @ 244 NONAME ; void RApaLsSession::SetFsSessionL(class RFs &)
+	?StartDocument@RApaLsSession@@QAEHAAVRFile@@ABVTDataType@@AAVTThreadId@@PAVTRequestStatus@@@Z @ 245 NONAME ; int RApaLsSession::StartDocument(class RFile &, class TDataType const &, class TThreadId &, class TRequestStatus *)
+	?StartDocument@RApaLsSession@@QAEHAAVRFile@@VTUid@@AAVTThreadId@@PAVTRequestStatus@@@Z @ 246 NONAME ; int RApaLsSession::StartDocument(class RFile &, class TUid, class TThreadId &, class TRequestStatus *)
+	?GetPreferredBufSize@RApaLsSession@@QBEHAAH@Z @ 247 NONAME ; public: int __thiscall RApaLsSession::GetPreferredBufSize(int &)const 
+	?GetJavaMIDletInfoL@ForJavaMIDletInstaller@@SAXAAVRFs@@ABVTDesC16@@AAK2@Z @ 248 NONAME ; void ForJavaMIDletInstaller::GetJavaMIDletInfoL(class RFs &, class TDesC16 const &, unsigned long &, unsigned long &)
+	?HandleAsRegistrationFile@ApaUtils@@SAHABVTUidType@@@Z @ 249 NONAME ; int ApaUtils::HandleAsRegistrationFile(class TUidType const &)
+	?DataTypes@TApaAppServiceInfo@@QBEABV?$CArrayFixFlat@VTDataTypeWithPriority@@@@XZ @ 250 NONAME ; class CArrayFixFlat<class TDataTypeWithPriority> const & TApaAppServiceInfo::DataTypes(void) const
+	?GetServiceImplementationsLC@RApaLsSession@@QBEPAVCApaAppServiceInfoArray@@VTUid@@ABVTDataType@@@Z @ 251 NONAME ; class CApaAppServiceInfoArray * RApaLsSession::GetServiceImplementationsLC(class TUid, class TDataType const &) const
+	?ServiceImplArrayBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@ABVTDataType@@@Z @ 252 NONAME ; class CBufFlat * CApaAppList::ServiceImplArrayBufferL(class TUid, class TDataType const &) const
+	?Close@RApaLsSession@@QAEXXZ @ 253 NONAME ; void RApaLsSession::Close(void)
+	??0MApaAppListServObserver@@IAE@XZ @ 254 NONAME ; MApaAppListServObserver::MApaAppListServObserver(void)
+	??0TApaPictureFactory@@IAE@XZ @ 255 NONAME ; TApaPictureFactory::TApaPictureFactory(void)
+	?MApaAppListServObserver_Reserved1@MApaAppListServObserver@@EAEXXZ @ 256 NONAME ; void MApaAppListServObserver::MApaAppListServObserver_Reserved1(void)
+	?MApaAppListServObserver_Reserved2@MApaAppListServObserver@@EAEXXZ @ 257 NONAME ; void MApaAppListServObserver::MApaAppListServObserver_Reserved2(void)
+	?RApaLsSession_Reserved1@RApaLsSession@@EAEXXZ @ 258 NONAME ; void RApaLsSession::RApaLsSession_Reserved1(void)
+	?RApaLsSession_Reserved2@RApaLsSession@@EAEXXZ @ 259 NONAME ; void RApaLsSession::RApaLsSession_Reserved2(void)
+	??0CDataRecognitionResultArray@@QAE@XZ @ 260 NONAME ; CDataRecognitionResultArray::CDataRecognitionResultArray(void)
+	??1CDataRecognitionResultArray@@UAE@XZ @ 261 NONAME ; CDataRecognitionResultArray::~CDataRecognitionResultArray(void)
+	?CancelRecognizeFiles@RApaLsSession@@QAEXXZ @ 262 NONAME ; void RApaLsSession::CancelRecognizeFiles(void)
+	?Count@CDataRecognitionResultArray@@QBEIXZ @ 263 NONAME ; unsigned int CDataRecognitionResultArray::Count(void) const
+	?GetDataRecognitionResultL@CDataRecognitionResultArray@@QBEXAAVTDataRecognitionResult@@I@Z @ 264 NONAME ; void CDataRecognitionResultArray::GetDataRecognitionResultL(class TDataRecognitionResult &, unsigned int) const
+	?GetFileNameL@CDataRecognitionResultArray@@QBEXAAV?$TBuf@$0BAA@@@I@Z @ 265 NONAME ; void CDataRecognitionResultArray::GetFileNameL(class TBuf<256> &, unsigned int) const
+	?Path@CDataRecognitionResultArray@@QBEABV?$TBuf@$0BAA@@@XZ @ 266 NONAME ; class TBuf<256> const & CDataRecognitionResultArray::Path(void) const
+	?RecognizeFilesL@RApaLsSession@@QBEHABVTDesC16@@AAVCDataRecognitionResultArray@@@Z @ 267 NONAME ; int RApaLsSession::RecognizeFilesL(class TDesC16 const &, class CDataRecognitionResultArray &) const
+	?RecognizeFilesL@RApaLsSession@@QBEHABVTDesC16@@ABVTDesC8@@AAVCDataRecognitionResultArray@@@Z @ 268 NONAME ; int RApaLsSession::RecognizeFilesL(class TDesC16 const &, class TDesC8 const &, class CDataRecognitionResultArray &) const
+	?RecognizeFilesL@RApaLsSession@@QAEXABVTDesC16@@AAVCDataRecognitionResultArray@@AAVTRequestStatus@@@Z @ 269 NONAME ; void RApaLsSession::RecognizeFilesL(class TDesC16 const &, class CDataRecognitionResultArray &, class TRequestStatus &)
+	?RecognizeFilesL@RApaLsSession@@QAEXABVTDesC16@@ABVTDesC8@@AAVCDataRecognitionResultArray@@AAVTRequestStatus@@@Z @ 270 NONAME ; void RApaLsSession::RecognizeFilesL(class TDesC16 const &, class TDesC8 const &, class CDataRecognitionResultArray &, class TRequestStatus &)
+	?InsertDataMapping@RApaLsSession@@QAEHABVTDataType@@JVTUid@@1@Z @ 271 NONAME ; int RApaLsSession::InsertDataMapping(class TDataType const &, long, class TUid, class TUid)
+	?DeleteDataMapping@RApaLsSession@@QAEHABVTDataType@@VTUid@@@Z @ 272 NONAME ; int RApaLsSession::DeleteDataMapping(class TDataType const &, class TUid)
+	?GetAppByDataType@RApaLsSession@@QBEHABVTDataType@@VTUid@@AAV3@@Z @ 273 NONAME ; int RApaLsSession::GetAppByDataType(class TDataType const &, class TUid, class TUid &) const
+	?StartApp@RApaLsSession@@QAEHABVCApaCommandLine@@AAVTThreadId@@PAVTRequestStatus@@@Z @ 274 NONAME ; int RApaLsSession::StartApp(class CApaCommandLine const &, class TThreadId &, class TRequestStatus *)
+	?RegisterNonNativeApplicationTypeL@RApaLsSession@@QAEXVTUid@@ABVTDesC16@@@Z @ 275 NONAME ; void RApaLsSession::RegisterNonNativeApplicationTypeL(class TUid, class TDesC16 const &)
+	?DeregisterNonNativeApplicationTypeL@RApaLsSession@@QAEXVTUid@@@Z @ 276 NONAME ; void RApaLsSession::DeregisterNonNativeApplicationTypeL(class TUid)
+	?RegisterNonNativeApplicationL@RApaLsSession@@QAEXVTUid@@ABVTDriveUnit@@AAVCApaRegistrationResourceFileWriter@@PAVCApaLocalisableResourceFileWriter@@PBVRFile@@@Z @ 277 NONAME ; void RApaLsSession::RegisterNonNativeApplicationL(class TUid, class TDriveUnit const &, class CApaRegistrationResourceFileWriter &, class CApaLocalisableResourceFileWriter *, class RFile const *)
+	?DeregisterNonNativeApplicationL@RApaLsSession@@QAEXVTUid@@@Z @ 278 NONAME ; void RApaLsSession::DeregisterNonNativeApplicationL(class TUid)
+	?AppDataByFileName@CApaAppList@@QBEPAVCApaAppData@@ABVTDesC16@@@Z @ 279 NONAME ; class CApaAppData* CApaAppList::AppDataByFileName(class TDesC16 const &) const
+	?LocalisableResourceFileName@CApaAppData@@QBE?AVTPtrC16@@XZ @ 280 NONAME ; class TPtrC16 CApaAppData::LocalisableResourceFileName(void) const
+	?OpaqueData@CApaAppData@@QBE?AVTPtrC8@@XZ @ 281 NONAME ; class TPtrC8 CApaAppData::OpaqueData(void) const
+	?RegistrationFileName@CApaAppData@@QBE?AVTPtrC16@@XZ @ 282 NONAME ; class TPtrC16 CApaAppData::RegistrationFileName(void) const
+	?GetDefaultScreenNumber@RApaLsSession@@QBEHAAHVTUid@@@Z @ 283 NONAME ; int RApaLsSession::GetDefaultScreenNumber(int &, class TUid) const
+	?FindAndAddSpecificAppL@CApaAppList@@QAEPAVCApaAppData@@PAVCApaAppRegFinder@@VTUid@@@Z @ 284 NONAME ; class CApaAppData * CApaAppList::FindAndAddSpecificAppL(class CApaAppRegFinder *, class TUid)
+	?MatchesSecurityPolicy@RApaLsSession@@QBEHAAHVTUid@@ABVTSecurityPolicy@@@Z @ 285 NONAME ; int RApaLsSession::MatchesSecurityPolicy(int &, class TUid, class TSecurityPolicy const &) const
+	?AddDataTypeL@CApaRegistrationResourceFileWriter@@QAEXHABVTDesC8@@@Z @ 286 NONAME ; void CApaRegistrationResourceFileWriter::AddDataTypeL(int, class TDesC8 const &)
+	?AddFileOwnershipInfoL@CApaRegistrationResourceFileWriter@@QAEXABVTDesC16@@@Z @ 287 NONAME ; void CApaRegistrationResourceFileWriter::AddFileOwnershipInfoL(class TDesC16 const &)
+	?NewL@CApaLocalisableResourceFileWriter@@SAPAV1@ABVTDesC16@@0H0@Z @ 288 NONAME ; class CApaLocalisableResourceFileWriter * CApaLocalisableResourceFileWriter::NewL(class TDesC16 const &, class TDesC16 const &, int, class TDesC16 const &)
+	?NewL@CApaRegistrationResourceFileWriter@@SAPAV1@VTUid@@ABVTDesC16@@I@Z @ 289 NONAME ; class CApaRegistrationResourceFileWriter * CApaRegistrationResourceFileWriter::NewL(class TUid, class TDesC16 const &, unsigned int)
+	?NonNativeApplicationType@CApaAppData@@QBE?AVTUid@@XZ @ 290 NONAME ; class TUid CApaAppData::NonNativeApplicationType(void) const
+	?SetAppIsHiddenL@CApaRegistrationResourceFileWriter@@QAEXH@Z @ 291 NONAME ; void CApaRegistrationResourceFileWriter::SetAppIsHiddenL(int)
+	?SetDefaultScreenNumberL@CApaRegistrationResourceFileWriter@@QAEXH@Z @ 292 NONAME ; void CApaRegistrationResourceFileWriter::SetDefaultScreenNumberL(int)
+	?SetEmbeddabilityL@CApaRegistrationResourceFileWriter@@QAEXW4TEmbeddability@TApaAppCapability@@@Z @ 293 NONAME ; void CApaRegistrationResourceFileWriter::SetEmbeddabilityL(enum TApaAppCapability::TEmbeddability)
+	?SetGroupNameL@CApaRegistrationResourceFileWriter@@QAEXABVTDesC16@@@Z @ 294 NONAME ; void CApaRegistrationResourceFileWriter::SetGroupNameL(class TDesC16 const &)
+	?SetLaunchInBackgroundL@CApaRegistrationResourceFileWriter@@QAEXH@Z @ 295 NONAME ; void CApaRegistrationResourceFileWriter::SetLaunchInBackgroundL(int)
+	?SetOpaqueDataL@CApaRegistrationResourceFileWriter@@QAEXABVTDesC8@@@Z @ 296 NONAME ; void CApaRegistrationResourceFileWriter::SetOpaqueDataL(class TDesC8 const &)
+	?SetSupportsNewFileL@CApaRegistrationResourceFileWriter@@QAEXH@Z @ 297 NONAME ; void CApaRegistrationResourceFileWriter::SetSupportsNewFileL(int)
+	??1CApaLocalisableResourceFileWriter@@UAE@XZ @ 298 NONAME ; CApaLocalisableResourceFileWriter::~CApaLocalisableResourceFileWriter(void)
+	??1CApaRegistrationResourceFileWriter@@UAE@XZ @ 299 NONAME ; CApaRegistrationResourceFileWriter::~CApaRegistrationResourceFileWriter(void)
+	?AppScanInProgress@CApaAppList@@QBEHXZ @ 300 NONAME ; int CApaAppList::AppScanInProgress(void) const
+	?CancelNotify@RApaLsSession@@QAEXXZ @ 301 NONAME ; void RApaLsSession::CancelNotify(void)
+	?SetNotify@RApaLsSession@@QAEXHAAVTRequestStatus@@@Z @ 302 NONAME ; void RApaLsSession::SetNotify(int, class TRequestStatus &)
+	?CancelNotifyOnDataMappingChange@RApaLsSession@@QAEXXZ @ 303 NONAME ; void RApaLsSession::CancelNotifyOnDataMappingChange(void)
+	?NotifyOnDataMappingChange@RApaLsSession@@QAEXAAVTRequestStatus@@@Z @ 304 NONAME ; void RApaLsSession::NotifyOnDataMappingChange(class TRequestStatus &)
+	?GetAppType@RApaLsSession@@QBEHAAVTUid@@V2@@Z @ 305 NONAME ; int RApaLsSession::GetAppType(class TUid &, class TUid) const
+	?CommitNonNativeApplicationsUpdatesL@RApaLsSession@@QAEXXZ @ 306 NONAME ; void RApaLsSession::CommitNonNativeApplicationsUpdatesL(void)
+	?PrepareNonNativeApplicationsUpdatesL@RApaLsSession@@QAEXXZ @ 307 NONAME ; void RApaLsSession::PrepareNonNativeApplicationsUpdatesL(void)
+	?RollbackNonNativeApplicationsUpdates@RApaLsSession@@QAEHXZ @ 308 NONAME ; int RApaLsSession::RollbackNonNativeApplicationsUpdates(void)
+	?SetUpdatedAppsList@CApaAppList@@QAEXPAVCUpdatedAppsList@@@Z @ 309 NONAME ABSENT ; void CApaAppList::SetUpdatedAppsList(class CUpdatedAppsList *)
+	?UpdatedAppsList@CApaAppList@@QAEPAVCUpdatedAppsList@@XZ @ 310 NONAME ABSENT ; class CUpdatedAppsList * CApaAppList::UpdatedAppsList(void)
+	??1CApaAppData@@UAE@XZ @ 311 NONAME ; CApaAppData::~CApaAppData(void)
+	?NewL@CApaAppData@@SAPAV1@ABVTApaAppEntry@@AAVRFs@@@Z @ 312 NONAME ; class CApaAppData * CApaAppData::NewL(class TApaAppEntry const &, class RFs &)
+	?Self@CApaAppList@@SAPAV1@XZ @ 313 NONAME ; class CApaAppList * CApaAppList::Self(void)
+	?ShareProtectedFileServer@CApaAppList@@QAEAAVRFs@@XZ @ 314 NONAME ABSENT ; class RFs & CApaAppList::ShareProtectedFileServer(void)
+	X @ 315 NONAME ABSENT ; Old @internalComponent function that never needed to be exported
+	X @ 316 NONAME ABSENT ; Old @internalComponent function that never needed to be exported
+	X @ 317 NONAME ABSENT ; Old @internalComponent function that never needed to be exported
+	X @ 318 NONAME ABSENT ; Old @internalComponent function that never needed to be exported
+	?SetAppShortCaption@RApaLsSession@@QAEHABVTDesC16@@W4TLanguage@@VTUid@@@Z @ 319 NONAME ; int RApaLsSession::SetAppShortCaption(class TDesC16 const &, enum TLanguage, class TUid)
+	?SetShortCaptionL@CApaAppData@@QAEXABVTDesC16@@@Z @ 320 NONAME ; void CApaAppData::SetShortCaptionL(class TDesC16 const &)
+	?ForceRegistration@RApaLsSession@@QAEHABV?$RPointerArray@VTDesC16@@@@@Z @ 321 NONAME ; int RApaLsSession::ForceRegistration(class RPointerArray<class TDesC16> const &)
+	?AddForcedRegistrationL@CApaAppList@@QAEXPAVHBufC16@@@Z @ 322 NONAME ; void CApaAppList::AddForcedRegistrationL(class HBufC16 *)
+	?CompareStrings@CApaAppList@@SAHABVHBufC16@@0@Z @ 323 NONAME ; int CApaAppList::CompareStrings(class HBufC16 const &, class HBufC16 const &)
+	?ResetForcedRegistrations@CApaAppList@@QAEXXZ @ 324 NONAME ; void CApaAppList::ResetForcedRegistrations(void)
+	?RestartScanL@CApaAppList@@QAEXXZ @ 325 NONAME ; void CApaAppList::RestartScanL(void)
+	?StopScan@CApaAppList@@QAEXH@Z @ 326 NONAME ; void CApaAppList::StopScan(TBool)
+	?MinApplicationStackSize@@YAIXZ @ 327 NONAME ; unsigned int MinApplicationStackSize(void)
+	?KMinApplicationStackSize@@3HB @ 328 NONAME ; int const KMinApplicationStackSize
+	?IsLanguageChangePending@CApaAppList@@QBEHXZ @ 329 NONAME ; int CApaAppList::IsLanguageChangePending(void) const
+	?IsPending@CApaAppData@@QBEHXZ @ 330 NONAME ; int CApaAppData::IsPending(void) const
+	?GetAppIcon@RApaLsSession@@QBEHVTUid@@AAVRFile@@@Z @ 331 NONAME ; int RApaLsSession::GetAppIcon(class TUid, class RFile &) const
+	?CheckAppSecurity@CApaSecurityUtils@@SAHABVTPtrC16@@AAH1@Z @ 332 NONAME ; int CApaSecurityUtils::CheckAppSecurity(class TPtrC16 const &, int &, int &)
+	?SetCaptionL@CApaAppData@@QAEXABVTDesC16@@@Z @ 333 NONAME ; void CApaAppData::SetCaptionL(class TDesC16 const &)
+	?SetIconsL@CApaAppData@@QAEXABVTDesC16@@H@Z @ 334 NONAME ; void CApaAppData::SetIconsL(class TDesC16 const &, int)
+	?ForceCommitNonNativeApplicationsUpdatesL@RApaLsSession@@QAEXXZ @ 335 NONAME ; void RApaLsSession::ForceCommitNonNativeApplicationsUpdatesL(void)
+	?AppListUpdatePending@CApaAppList@@QAEHXZ @ 336 NONAME ; int CApaAppList::AppListUpdatePending(void)
+	?UninstalledAppArray@CApaAppList@@QAEPAV?$CArrayFixFlat@VTUid@@@@XZ @ 337 NONAME ; class CArrayFixFlat<class TUid> * CApaAppList::UninstalledAppArray(void)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/bwins/APP.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1 @@
+EXPORTS ?NewApplication@@YAPAVCApaApplication@@XZ @1 NONAME
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/bwins/APPARCTESTSERVERu.def	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?NewServer@@YAHXZ @ 1 NONAME ; int __cdecl NewServer(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/bwins/APPARCU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,181 @@
+EXPORTS
+	??0CApaDocument@@IAE@AAVCApaApplication@@AAVCApaProcess@@@Z @ 1 NONAME ; protected: __thiscall CApaDocument::CApaDocument(class CApaApplication &,class CApaProcess &)
+	??0CApaFileRecognizer@@IAE@AAVRFs@@@Z @ 2 NONAME ; protected: __thiscall CApaFileRecognizer::CApaFileRecognizer(class RFs &)
+	??0CApaFileRecognizerType@@IAE@XZ @ 3 NONAME ; protected: __thiscall CApaFileRecognizerType::CApaFileRecognizerType(void)
+	??0CApaProcess@@IAE@ABVRFs@@AAVCApaAppFinder@@@Z @ 4 NONAME ; protected: __thiscall CApaProcess::CApaProcess(class RFs const &,class CApaAppFinder &)
+	??0TApaAppEntry@@QAE@ABVTUidType@@ABV?$TBuf@$0BAA@@@@Z @ 5 NONAME ; public: __thiscall TApaAppEntry::TApaAppEntry(class TUidType const &,class TBuf<256> const &)
+	??0TApaAppEntry@@QAE@XZ @ 6 NONAME ; public: __thiscall TApaAppEntry::TApaAppEntry(void)
+	??0TApaAppIdentifier@@QAE@VTUid@@ABV?$TBuf@$0BAA@@@@Z @ 7 NONAME ; public: __thiscall TApaAppIdentifier::TApaAppIdentifier(class TUid,class TBuf<256> const &)
+	??0TApaAppIdentifier@@QAE@XZ @ 8 NONAME ; public: __thiscall TApaAppIdentifier::TApaAppIdentifier(void)
+	??0TApaAppInfo@@QAE@VTUid@@ABV?$TBuf@$0BAA@@@1@Z @ 9 NONAME ; public: __thiscall TApaAppInfo::TApaAppInfo(class TUid,class TBuf<256> const &,class TBuf<256> const &)
+	??0TApaAppInfo@@QAE@XZ @ 10 NONAME ; public: __thiscall TApaAppInfo::TApaAppInfo(void)
+	??0TApaModelDoorFactory@@QAE@PBVMApaModelHeaderFactory@@@Z @ 11 NONAME ; public: __thiscall TApaModelDoorFactory::TApaModelDoorFactory(class MApaModelHeaderFactory const *)
+	??0TCapability@CApaDocument@@QAE@XZ @ 12 NONAME ; public: __thiscall CApaDocument::TCapability::TCapability(void)
+	??1CApaCommandLine@@UAE@XZ @ 13 NONAME ; public: virtual __thiscall CApaCommandLine::~CApaCommandLine(void)
+	??1CApaDocument@@UAE@XZ @ 14 NONAME ; public: virtual __thiscall CApaDocument::~CApaDocument(void)
+	??1CApaFileRecognizer@@UAE@XZ @ 15 NONAME ; public: virtual __thiscall CApaFileRecognizer::~CApaFileRecognizer(void)
+	??1CApaFileRecognizerType@@MAE@XZ @ 16 NONAME ; protected: virtual __thiscall CApaFileRecognizerType::~CApaFileRecognizerType(void)
+	??1CApaModelDoor@@UAE@XZ @ 17 NONAME ; public: virtual __thiscall CApaModelDoor::~CApaModelDoor(void)
+	??1CApaProcess@@UAE@XZ @ 18 NONAME ; public: virtual __thiscall CApaProcess::~CApaProcess(void)
+	?AddFileRecognizerType@CApaFileRecognizer@@IAEXPAVCApaFileRecognizerType@@@Z @ 19 NONAME ; protected: void __thiscall CApaFileRecognizer::AddFileRecognizerType(class CApaFileRecognizerType *)
+	?AddNewDocumentL@CApaProcess@@QAEPAVCApaDocument@@ABVTDesC16@@VTUid@@@Z @ 20 NONAME ; public: class CApaDocument * __thiscall CApaProcess::AddNewDocumentL(class TDesC16 const &,class TUid)
+	?AppFullName@CApaApplication@@UBE?AV?$TBuf@$0BAA@@@XZ @ 21 NONAME ; public: virtual class TBuf<256>  __thiscall CApaApplication::AppFullName(void)const 
+	?AppLocator@CApaFileRecognizer@@QBEPAVCApaAppLocator@@XZ @ 22 NONAME ; public: class CApaAppLocator * __thiscall CApaFileRecognizer::AppLocator(void)const 
+	?AppRunL@CApaFileRecognizerType@@IBE?AVTThreadId@@ABVCApaCommandLine@@@Z @ 23 NONAME ; protected: class TThreadId  __thiscall CApaFileRecognizerType::AppRunL(class CApaCommandLine const &)const 
+	?Capability@CApaDocument@@UBE?AVTCapability@1@XZ @ 24 NONAME ; public: virtual class CApaDocument::TCapability  __thiscall CApaDocument::Capability(void)const 
+	?Capability@CApaFileRecognizerType@@QBEXAAVTDes8@@@Z @ 25 NONAME ; public: void __thiscall CApaFileRecognizerType::Capability(class TDes8 &)const 
+	?Command@CApaCommandLine@@QBE?AW4TApaCommand@@XZ @ 26 NONAME ; public: enum TApaCommand  __thiscall CApaCommandLine::Command(void)const 
+	?ConstructL@CApaProcess@@IAEXXZ @ 27 NONAME ; protected: void __thiscall CApaProcess::ConstructL(void)
+	?CopyCapability@TApaAppCapability@@SAXAAVTDes8@@ABVTDesC8@@@Z @ 28 NONAME ; public: static void __cdecl TApaAppCapability::CopyCapability(class TDes8 &,class TDesC8 const &)
+	?DestroyDocument@CApaProcess@@QAEXPAVCApaDocument@@@Z @ 29 NONAME ; public: void __thiscall CApaProcess::DestroyDocument(class CApaDocument *)
+	?DestroyRecognizerList@CApaFileRecognizer@@IAEXXZ @ 30 NONAME ; protected: void __thiscall CApaFileRecognizer::DestroyRecognizerList(void)
+	?DllName@CApaApplication@@QBE?AV?$TBuf@$0BAA@@@XZ @ 31 NONAME ; public: class TBuf<256>  __thiscall CApaApplication::DllName(void)const 
+	?DoCleanup@TApaDocCleanupItem@@CAXPAX@Z @ 32 NONAME ; private: static void __cdecl TApaDocCleanupItem::DoCleanup(void *)
+	?DocumentName@CApaCommandLine@@QBE?AVTPtrC16@@XZ @ 33 NONAME ; public: class TPtrC16  __thiscall CApaCommandLine::DocumentName(void)const 
+	?Draw@CApaModelDoor@@UBEXAAVCGraphicsContext@@ABVTPoint@@ABVTRect@@PAVMGraphicsDeviceMap@@@Z @ 34 NONAME ; public: virtual void __thiscall CApaModelDoor::Draw(class CGraphicsContext &,class TPoint const &,class TRect const &,class MGraphicsDeviceMap *)const 
+	?ExternalizeBaseStreamL@CApaDoorBase@@IBEXAAVCStreamStore@@AAVCStreamDictionary@@@Z @ 35 NONAME ; protected: void __thiscall CApaDoorBase::ExternalizeBaseStreamL(class CStreamStore &,class CStreamDictionary &)const 
+	?ExternalizeL@CApaDocument@@UBEXAAVRWriteStream@@@Z @ 36 NONAME ; public: virtual void __thiscall CApaDocument::ExternalizeL(class RWriteStream &)const 
+	?ExternalizeL@CApaModelDoor@@UBEXAAVRWriteStream@@@Z @ 37 NONAME ; public: virtual void __thiscall CApaModelDoor::ExternalizeL(class RWriteStream &)const 
+	?ExternalizeL@TApaAppCapability@@QBEXAAVRWriteStream@@@Z @ 38 NONAME ; public: void __thiscall TApaAppCapability::ExternalizeL(class RWriteStream &)const 
+	?ExternalizeL@TApaAppEntry@@QBEXAAVRWriteStream@@@Z @ 39 NONAME ; public: void __thiscall TApaAppEntry::ExternalizeL(class RWriteStream &)const 
+	?ExternalizeL@TApaAppIdentifier@@QBEXAAVRWriteStream@@@Z @ 40 NONAME ; public: void __thiscall TApaAppIdentifier::ExternalizeL(class RWriteStream &)const 
+	?ExternalizeL@TApaAppInfo@@QBEXAAVRWriteStream@@@Z @ 41 NONAME ; public: void __thiscall TApaAppInfo::ExternalizeL(class RWriteStream &)const 
+	?FullCommandLine@CApaCommandLine@@QBE?AVTPtrC16@@XZ @ 42 NONAME ; public: class TPtrC16  __thiscall CApaCommandLine::FullCommandLine(void)const 
+	?GenerateFileName@CApaApplication@@SAHAAVRFs@@AAV?$TBuf@$0BAA@@@@Z @ 43 NONAME ; public: static int __cdecl CApaApplication::GenerateFileName(class RFs &,class TBuf<256> &)
+	?GetOriginalSizeInTwips@CApaModelDoor@@UBEXAAVTSize@@@Z @ 44 NONAME ; public: virtual void __thiscall CApaModelDoor::GetOriginalSizeInTwips(class TSize &)const 
+	?GlassPictureL@CApaDocument@@UAEPAVCPicture@@XZ @ 45 NONAME ; public: virtual class CPicture * __thiscall CApaDocument::GlassPictureL(void)
+	?InternalizeBaseStreamL@CApaDoorBase@@IAE?AVTSize@@ABVCStreamStore@@ABVCStreamDictionary@@@Z @ 46 NONAME ; protected: class TSize  __thiscall CApaDoorBase::InternalizeBaseStreamL(class CStreamStore const &,class CStreamDictionary const &)
+	?InternalizeL@TApaAppCapability@@QAEXAAVRReadStream@@@Z @ 47 NONAME ; public: void __thiscall TApaAppCapability::InternalizeL(class RReadStream &)
+	?InternalizeL@TApaAppEntry@@QAEXAAVRReadStream@@@Z @ 48 NONAME ; public: void __thiscall TApaAppEntry::InternalizeL(class RReadStream &)
+	?InternalizeL@TApaAppIdentifier@@QAEXAAVRReadStream@@@Z @ 49 NONAME ; public: void __thiscall TApaAppIdentifier::InternalizeL(class RReadStream &)
+	?InternalizeL@TApaAppInfo@@QAEXAAVRReadStream@@@Z @ 50 NONAME ; public: void __thiscall TApaAppInfo::InternalizeL(class RReadStream &)
+	?LibraryName@CApaCommandLine@@QBE?AVTPtrC16@@XZ @ 51 NONAME ; public: class TPtrC16  __thiscall CApaCommandLine::LibraryName(void)const 
+	?MainDocFileName@CApaProcess@@QBE?AVTPtrC16@@XZ @ 52 NONAME ; public: class TPtrC16  __thiscall CApaProcess::MainDocFileName(void)const 
+	?New@CApaCommandLine@@SAPAV1@PAVHBufC16@@@Z @ 53 NONAME ; public: static class CApaCommandLine * __cdecl CApaCommandLine::New(class HBufC16 *)
+	?NewL@CApaCommandLine@@SAPAV1@ABVTDesC16@@@Z @ 54 NONAME ; public: static class CApaCommandLine * __cdecl CApaCommandLine::NewL(class TDesC16 const &)
+	?NewL@CApaCommandLine@@SAPAV1@XZ @ 55 NONAME ; public: static class CApaCommandLine * __cdecl CApaCommandLine::NewL(void)
+	?NewL@CApaModelDoor@@SAPAV1@ABVCStreamStore@@VTStreamId@@PBVMApaModelHeaderFactory@@@Z @ 56 NONAME ; public: static class CApaModelDoor * __cdecl CApaModelDoor::NewL(class CStreamStore const &,class TStreamId,class MApaModelHeaderFactory const *)
+	?NewL@CApaModelDoor@@SAPAV1@PAVCApaModelHeader@@@Z @ 57 NONAME ; public: static class CApaModelDoor * __cdecl CApaModelDoor::NewL(class CApaModelHeader *)
+	?NewL@CApaProcess@@SAPAV1@ABVRFs@@AAVCApaAppFinder@@@Z @ 58 NONAME ; public: static class CApaProcess * __cdecl CApaProcess::NewL(class RFs const &,class CApaAppFinder &)
+	?NewLC@CApaCommandLine@@SAPAV1@ABVTDesC16@@@Z @ 59 NONAME ; public: static class CApaCommandLine * __cdecl CApaCommandLine::NewLC(class TDesC16 const &)
+	?NewLC@CApaCommandLine@@SAPAV1@XZ @ 60 NONAME ; public: static class CApaCommandLine * __cdecl CApaCommandLine::NewLC(void)
+	?NewLC@CApaModelDoor@@SAPAV1@PAVCApaModelHeader@@@Z @ 61 NONAME ; public: static class CApaModelDoor * __cdecl CApaModelDoor::NewLC(class CApaModelHeader *)
+	?NewPictureL@TApaModelDoorFactory@@UBEXAAVTPictureHeader@@ABVCStreamStore@@@Z @ 62 NONAME ; public: virtual void __thiscall TApaModelDoorFactory::NewPictureL(class TPictureHeader &,class CStreamStore const &)const 
+	?OpenAppInfoFileL@CApaApplication@@QBEPAVCApaAppInfoFileReader@@XZ @ 63 NONAME ; public: class CApaAppInfoFileReader * __thiscall CApaApplication::OpenAppInfoFileL(void)const 
+	?OpenIniFileL@CApaApplication@@QBEPAVCDictionaryStore@@AAVRFs@@@Z @ 64 NONAME ; public: class CDictionaryStore * __thiscall CApaApplication::OpenIniFileL(class RFs &)const 
+	?OpenNewDocumentL@CApaProcess@@QAEPAVCApaDocument@@AAPAVCFileStore@@AAPAVCStreamDictionary@@ABVTDesC16@@I@Z @ 65 NONAME ; public: class CApaDocument * __thiscall CApaProcess::OpenNewDocumentL(class CFileStore * &,class CStreamDictionary * &,class TDesC16 const &,unsigned int)
+	?ReadAppIdentifierL@CApaProcess@@SA?AVTApaAppIdentifier@@ABVCStreamStore@@ABVCStreamDictionary@@@Z @ 66 NONAME ; public: static class TApaAppIdentifier  __cdecl CApaProcess::ReadAppIdentifierL(class CStreamStore const &,class CStreamDictionary const &)
+	?ReadRootStreamLC@CApaProcess@@SAPAVCStreamDictionary@@AAVRFs@@AAPAVCFileStore@@ABVTDesC16@@I@Z @ 67 NONAME ; public: static class CStreamDictionary * __cdecl CApaProcess::ReadRootStreamLC(class RFs &,class CFileStore * &,class TDesC16 const &,unsigned int)
+	?RecognizeFileL@CApaFileRecognizer@@QAEPAVCApaFileRecognizerType@@ABVTDesC16@@PBVTUidType@@@Z @ 68 NONAME ; public: class CApaFileRecognizerType * __thiscall CApaFileRecognizer::RecognizeFileL(class TDesC16 const &,class TUidType const *)
+	?NewAppServerL@CApaApplication@@UAEXAAPAVCApaAppServer@@@Z @ 69 NONAME ; void CApaApplication::NewAppServerL(class CApaAppServer * &)
+	?OpenFileL@CApaDocument@@EAEXAAPAVCFileStore@@AAVRFile@@@Z @ 70 NONAME ; void CApaDocument::OpenFileL(class CFileStore * &, class RFile &)
+	?Reserved_2@CApaDocument@@EAEXXZ @ 71 NONAME ; private: virtual void __thiscall CApaDocument::Reserved_2(void)
+	?ResetL@CApaProcess@@QAEXXZ @ 72 NONAME ; public: void __thiscall CApaProcess::ResetL(void)
+	?RestoreL@CApaModelDoor@@QAEXABVCStreamStore@@VTStreamId@@PBVMApaModelHeaderFactory@@@Z @ 73 NONAME ; public: void __thiscall CApaModelDoor::RestoreL(class CStreamStore const &,class TStreamId,class MApaModelHeaderFactory const *)
+	?ScaleFactorHeight@CApaModelDoor@@UBEHXZ @ 74 NONAME ; public: virtual int __thiscall CApaModelDoor::ScaleFactorHeight(void)const 
+	?ScaleFactorWidth@CApaModelDoor@@UBEHXZ @ 75 NONAME ; public: virtual int __thiscall CApaModelDoor::ScaleFactorWidth(void)const 
+	?SetAppLocator@CApaFileRecognizer@@IAEXPAVCApaAppLocator@@@Z @ 76 NONAME ; protected: void __thiscall CApaFileRecognizer::SetAppLocator(class CApaAppLocator *)
+	?SetCommandL@CApaCommandLine@@QAEXW4TApaCommand@@@Z @ 77 NONAME ; public: void __thiscall CApaCommandLine::SetCommandL(enum TApaCommand)
+	?SetDocumentNameL@CApaCommandLine@@QAEXABVTDesC16@@@Z @ 78 NONAME ; public: void __thiscall CApaCommandLine::SetDocumentNameL(class TDesC16 const &)
+	?SetFullCommandLine@CApaCommandLine@@QAEHPAVHBufC16@@@Z @ 79 NONAME ; public: int __thiscall CApaCommandLine::SetFullCommandLine(class HBufC16 *)
+	?SetFullCommandLineL@CApaCommandLine@@QAEXABVTDesC16@@@Z @ 80 NONAME ; public: void __thiscall CApaCommandLine::SetFullCommandLineL(class TDesC16 const &)
+	?SetLibraryNameL@CApaCommandLine@@QAEXABVTDesC16@@@Z @ 81 NONAME ; public: void __thiscall CApaCommandLine::SetLibraryNameL(class TDesC16 const &)
+	?SetMainDocFileName@CApaProcess@@QAEXABVTDesC16@@@Z @ 82 NONAME ; public: void __thiscall CApaProcess::SetMainDocFileName(class TDesC16 const &)
+	?SetMainDocument@CApaProcess@@QAEXPAVCApaDocument@@@Z @ 83 NONAME ; public: void __thiscall CApaProcess::SetMainDocument(class CApaDocument *)
+	?SetReserveLengthL@CApaCommandLine@@QAEXH@Z @ 84 NONAME ; public: void __thiscall CApaCommandLine::SetReserveLengthL(int)
+	?SetScaleFactor@CApaModelDoor@@UAEXHH@Z @ 85 NONAME ; public: virtual void __thiscall CApaModelDoor::SetScaleFactor(int,int)
+	?SetTailEndL@CApaCommandLine@@QAEXABVTDesC8@@@Z @ 86 NONAME ; public: void __thiscall CApaCommandLine::SetTailEndL(class TDesC8 const &)
+	?StoreL@CApaModelDoor@@UBE?AVTStreamId@@AAVCStreamStore@@@Z @ 87 NONAME ; public: virtual class TStreamId  __thiscall CApaModelDoor::StoreL(class CStreamStore &)const 
+	?TailEnd@CApaCommandLine@@QBE?AVTPtrC8@@XZ @ 88 NONAME ; public: class TPtrC8  __thiscall CApaCommandLine::TailEnd(void)const 
+	?ValidatePasswordL@CApaDocument@@UBEXXZ @ 89 NONAME ; public: virtual void __thiscall CApaDocument::ValidatePasswordL(void)const 
+	?WriteAppIdentifierL@CApaProcess@@SAXAAVCStreamStore@@AAVCStreamDictionary@@ABVTApaAppIdentifier@@@Z @ 90 NONAME ; public: static void __cdecl CApaProcess::WriteAppIdentifierL(class CStreamStore &,class CStreamDictionary &,class TApaAppIdentifier const &)
+	?WriteRootStreamL@CApaProcess@@SAXAAVCPersistentStore@@AAVCStreamDictionary@@ABVCApaApplication@@@Z @ 91 NONAME ; public: static void __cdecl CApaProcess::WriteRootStreamL(class CPersistentStore &,class CStreamDictionary &,class CApaApplication const &)
+	?WriteRootStreamL@CApaProcess@@SAXAAVCPersistentStore@@AAVCStreamDictionary@@ABVTApaAppIdentifier@@@Z @ 92 NONAME ; public: static void __cdecl CApaProcess::WriteRootStreamL(class CPersistentStore &,class CStreamDictionary &,class TApaAppIdentifier const &)
+	?DetachFromStoreL@CApaModelDoor@@UAEXW4TDetach@CPicture@@@Z @ 93 NONAME ; public: virtual void __thiscall CApaModelDoor::DetachFromStoreL(enum CPicture::TDetach)
+	?Lock@CApaFileRecognizerType@@QAEXXZ @ 94 NONAME ; public: void __thiscall CApaFileRecognizerType::Lock(void)
+	?RemoveFileRecognizerType@CApaFileRecognizer@@IAEHPBVCApaFileRecognizerType@@@Z @ 95 NONAME ; protected: int __thiscall CApaFileRecognizer::RemoveFileRecognizerType(class CApaFileRecognizerType const *)
+	?Unlock@CApaFileRecognizerType@@QAEXXZ @ 96 NONAME ; public: void __thiscall CApaFileRecognizerType::Unlock(void)
+	??0TApaLastUsedEntry@@QAE@V?$TBuf@$0BAA@@@VTUid@@@Z @ 97 NONAME ABSENT ; public: __thiscall TApaLastUsedEntry::TApaLastUsedEntry(class TBuf<256>,class TUid)
+	??0TApaLastUsedEntry@@QAE@XZ @ 98 NONAME ABSENT ; public: __thiscall TApaLastUsedEntry::TApaLastUsedEntry(void)
+	?AddLastUsedEntryL@CApaRecentFile@@SAXAAVRFs@@ABVTDesC16@@VTUid@@@Z @ 99 NONAME ABSENT ; public: static void __cdecl CApaRecentFile::AddLastUsedEntryL(class RFs &,class TDesC16 const &,class TUid)
+	?ExternalizeL@TApaLastUsedEntry@@QBEXAAVRWriteStream@@@Z @ 100 NONAME ABSENT ; public: void __thiscall TApaLastUsedEntry::ExternalizeL(class RWriteStream &)const 
+	?GetRecentFileL@CApaRecentFile@@SA?AVTApaLastUsedEntry@@AAVRFs@@VTUid@@H@Z @ 101 NONAME ABSENT ; public: static class TApaLastUsedEntry  __cdecl CApaRecentFile::GetRecentFileL(class RFs &,class TUid,int)
+	?GetRecentFileListL@CApaRecentFile@@SAPAV?$CArrayFixFlat@VTApaLastUsedEntry@@@@AAVRFs@@VTUid@@@Z @ 102 NONAME ABSENT ; public: static class CArrayFixFlat<class TApaLastUsedEntry> * __cdecl CApaRecentFile::GetRecentFileListL(class RFs &,class TUid)
+	?InternalizeL@TApaLastUsedEntry@@QAEXAAVRReadStream@@@Z @ 103 NONAME ABSENT ; public: void __thiscall TApaLastUsedEntry::InternalizeL(class RReadStream &)
+	?Reserved_1@CApaFileRecognizerType@@EAEXXZ @ 104 NONAME ; private: virtual void __thiscall CApaFileRecognizerType::Reserved_1(void)
+	?Reserved_1@CApaModelHeader@@EAEXXZ @ 105 NONAME ; private: virtual void __thiscall CApaModelHeader::Reserved_1(void)
+	??0TApaAppViewInfo@@QAE@VTUid@@ABV?$TBuf@$0BAA@@@H@Z @ 106 NONAME ; public: __thiscall TApaAppViewInfo::TApaAppViewInfo(class TUid,class TBuf<256> const &,int)
+	??0TApaAppViewInfo@@QAE@XZ @ 107 NONAME ; public: __thiscall TApaAppViewInfo::TApaAppViewInfo(void)
+	?ExternalizeL@TApaAppViewInfo@@QBEXAAVRWriteStream@@@Z @ 108 NONAME ; public: void __thiscall TApaAppViewInfo::ExternalizeL(class RWriteStream &)const 
+	?InternalizeL@TApaAppViewInfo@@QAEXAAVRReadStream@@@Z @ 109 NONAME ; public: void __thiscall TApaAppViewInfo::InternalizeL(class RReadStream &)
+	??0TApaAppInfo@@QAE@VTUid@@ABV?$TBuf@$0BAA@@@11@Z @ 110 NONAME ; public: __thiscall TApaAppInfo::TApaAppInfo(class TUid,class TBuf<256> const &,class TBuf<256> const &,class TBuf<256> const &)
+	??0TApaAppInfo_7_0@@QAE@VTUid@@ABV?$TBuf@$0BAA@@@1@Z @ 111 NONAME ABSENT; TApaAppInfo_7_0::TApaAppInfo_7_0(class TUid, class TBuf<256> const &, class TBuf<256> const &)
+	??0TApaAppInfo_7_0@@QAE@XZ @ 112 NONAME ABSENT; TApaAppInfo_7_0::TApaAppInfo_7_0(void)
+	?ExternalizeL@TApaAppInfo_7_0@@QBEXAAVRWriteStream@@@Z @ 113 NONAME ABSENT; void TApaAppInfo_7_0::ExternalizeL(class RWriteStream &) const
+	?InternalizeL@TApaAppInfo_7_0@@QAEXAAVRReadStream@@@Z @ 114 NONAME ABSENT; void TApaAppInfo_7_0::InternalizeL(class RReadStream &)
+	?Externalize7_0L@TApaAppCapability@@ABEXAAVRWriteStream@@@Z @ 115 NONAME ; void TApaAppCapability::Externalize7_0L(class RWriteStream &) const
+	?Internalize7_0L@TApaAppCapability@@QAEXAAVRReadStream@@@Z @ 116 NONAME ; void TApaAppCapability::Internalize7_0L(class RReadStream &)
+	??0TApaEmbeddabilityFilter@@QAE@XZ @ 117 NONAME ; public: __thiscall TApaEmbeddabilityFilter::TApaEmbeddabilityFilter(void)
+	?AddEmbeddability@TApaEmbeddabilityFilter@@QAEXW4TEmbeddability@TApaAppCapability@@@Z @ 118 NONAME ; public: void __thiscall TApaEmbeddabilityFilter::AddEmbeddability(enum TApaAppCapability::TEmbeddability)
+	?MatchesEmbeddability@TApaEmbeddabilityFilter@@QBEHW4TEmbeddability@TApaAppCapability@@@Z @ 119 NONAME ; public: int __thiscall TApaEmbeddabilityFilter::MatchesEmbeddability(enum TApaAppCapability::TEmbeddability)const 
+	?SetMainDocFileNameL@CApaProcess@@QAEXABVTDesC16@@@Z @ 120 NONAME ; public: void __thiscall CApaProcess::SetMainDocFileNameL(class TDesC16 const &)
+	?CreateFileRecognizerL@CApaFileRecognizerType@@SAPAV1@VTUid@@@Z @ 121 NONAME ; public: static class CApaFileRecognizerType * __cdecl CApaFileRecognizerType::CreateFileRecognizerL(class TUid)
+	??0TApaApplicationFactory@@QAE@ABVCImplementationInformation@@@Z @ 122 NONAME ; TApaApplicationFactory::TApaApplicationFactory(class CImplementationInformation const &)
+	??0TApaApplicationFactory@@QAE@P6APAVCApaApplication@@XZ@Z @ 123 NONAME ; TApaApplicationFactory::TApaApplicationFactory(class CApaApplication * (*)(void))
+	??0TApaApplicationFactory@@QAE@VTUid@@@Z @ 124 NONAME ; TApaApplicationFactory::TApaApplicationFactory(class TUid)
+	??1CApaApplication@@UAE@XZ @ 125 NONAME ; CApaApplication::~CApaApplication(void)
+	?AddNewDocumentL@CApaProcess@@QAEPAVCApaDocument@@VTApaApplicationFactory@@@Z @ 126 NONAME ; class CApaDocument * CApaProcess::AddNewDocumentL(class TApaApplicationFactory)
+	??0CApaAppServer@@IAE@XZ @ 127 NONAME ; CApaAppServer::CApaAppServer(void)
+	??0CApaAppServiceBase@@QAE@XZ @ 128 NONAME ; CApaAppServiceBase::CApaAppServiceBase(void)
+	??0RApaAppServiceBase@@IAE@XZ @ 129 NONAME ; RApaAppServiceBase::RApaAppServiceBase(void)
+	??1CApaAppServer@@UAE@XZ @ 130 NONAME ; CApaAppServer::~CApaAppServer(void)
+	??1CApaAppServiceBase@@UAE@XZ @ 131 NONAME ; CApaAppServiceBase::~CApaAppServiceBase(void)
+	??1CApaServerAppExitMonitor@@UAE@XZ @ 132 NONAME ; CApaServerAppExitMonitor::~CApaServerAppExitMonitor(void)
+	?CancelNotifyServerExit@RApaAppServiceBase@@QAEXXZ @ 133 NONAME ; void RApaAppServiceBase::CancelNotifyServerExit(void)
+	?Close@RApaAppServiceBase@@QAEXXZ @ 134 NONAME ; void RApaAppServiceBase::Close(void)
+	?ConnectExistingAppL@RApaAppServiceBase@@QAEXABV1@@Z @ 135 NONAME ; void RApaAppServiceBase::ConnectExistingAppL(class RApaAppServiceBase const &)
+	?ConnectExistingByNameL@RApaAppServiceBase@@QAEXABVTDesC16@@@Z @ 136 NONAME ; void RApaAppServiceBase::ConnectExistingByNameL(class TDesC16 const &)
+	?ConstructL@CApaAppServer@@UAEXABVTDesC16@@@Z @ 137 NONAME ; void CApaAppServer::ConstructL(class TDesC16 const &)
+	?CreateL@CApaAppServiceBase@@MAEXXZ @ 138 NONAME ; void CApaAppServiceBase::CreateL(void)
+	?CreateServiceL@CApaAppServer@@UBEPAVCApaAppServiceBase@@VTUid@@@Z @ 139 NONAME ; class CApaAppServiceBase * CApaAppServer::CreateServiceL(class TUid) const
+	?CreateServiceSecurityCheckL@CApaAppServer@@UAE?AW4TCustomResult@CPolicyServer@@VTUid@@ABVRMessage2@@AAHAAVTSecurityInfo@@@Z @ 140 NONAME ; enum CPolicyServer::TCustomResult CApaAppServer::CreateServiceSecurityCheckL(class TUid, class RMessage2 const &, int &, class TSecurityInfo &)
+	?CustomSecurityCheckL@CApaAppServer@@MAE?AW4TCustomResult@CPolicyServer@@ABVRMessage2@@AAHAAVTSecurityInfo@@@Z @ 141 NONAME ; enum CPolicyServer::TCustomResult CApaAppServer::CustomSecurityCheckL(class RMessage2 const &, int &, class TSecurityInfo &)
+	?ExtensionInterface@CApaAppServer@@EAEXVTUid@@AAPAX@Z @ 142 NONAME ; void CApaAppServer::ExtensionInterface(class TUid, void * &)
+	?ExtensionInterface@CApaAppServiceBase@@EAEXVTUid@@AAPAX@Z @ 143 NONAME ; void CApaAppServiceBase::ExtensionInterface(class TUid, void * &)
+	?ExtensionInterface@RApaAppServiceBase@@EAEXVTUid@@AAPAX@Z @ 144 NONAME ; void RApaAppServiceBase::ExtensionInterface(class TUid, void * &)
+	?NewL@CApaServerAppExitMonitor@@SAPAV1@AAVRApaAppServiceBase@@AAVMApaServerAppExitObserver@@H@Z @ 145 NONAME ; class CApaServerAppExitMonitor * CApaServerAppExitMonitor::NewL(class RApaAppServiceBase &, class MApaServerAppExitObserver &, int)
+	?NewLC@CApaServerAppExitMonitor@@SAPAV1@AAVRApaAppServiceBase@@AAVMApaServerAppExitObserver@@H@Z @ 146 NONAME ; class CApaServerAppExitMonitor * CApaServerAppExitMonitor::NewLC(class RApaAppServiceBase &, class MApaServerAppExitObserver &, int)
+	?NewSessionL@CApaAppServer@@EBEPAVCSession2@@ABVTVersion@@ABVRMessage2@@@Z @ 147 NONAME ; class CSession2 * CApaAppServer::NewSessionL(class TVersion const &, class RMessage2 const &) const
+	?NotifyServerExit@CApaAppServer@@QAEXH@Z @ 148 NONAME ; void CApaAppServer::NotifyServerExit(int)
+	?NotifyServerExit@RApaAppServiceBase@@QAEXAAVTRequestStatus@@@Z @ 149 NONAME ; void RApaAppServiceBase::NotifyServerExit(class TRequestStatus &)
+	?SecurityCheckL@CApaAppServiceBase@@UAE?AW4TCustomResult@CPolicyServer@@ABVRMessage2@@AAHAAVTSecurityInfo@@@Z @ 150 NONAME ; enum CPolicyServer::TCustomResult CApaAppServiceBase::SecurityCheckL(class RMessage2 const &, int &, class TSecurityInfo &)
+	?ServerName@RApaAppServiceBase@@QAE?AVTPtrC16@@XZ @ 151 NONAME ; class TPtrC16 RApaAppServiceBase::ServerName(void)
+	?ServerRequired@CApaCommandLine@@QBEIXZ @ 152 NONAME ; unsigned int CApaCommandLine::ServerRequired(void) const
+	?ServiceError@CApaAppServiceBase@@MAEXABVRMessage2@@H@Z @ 153 NONAME ; void CApaAppServiceBase::ServiceError(class RMessage2 const &, int)
+	?ServiceL@CApaAppServiceBase@@MAEXABVRMessage2@@@Z @ 154 NONAME ; void CApaAppServiceBase::ServiceL(class RMessage2 const &)
+	?SetServerNotRequiredL@CApaCommandLine@@QAEXXZ @ 155 NONAME ; void CApaCommandLine::SetServerNotRequiredL(void)
+	?SetServerRequiredL@CApaCommandLine@@QAEXI@Z @ 156 NONAME ; void CApaCommandLine::SetServerRequiredL(unsigned int)
+	?ExecutableName@CApaCommandLine@@QBE?AVTPtrC16@@XZ @ 157 NONAME ; class TPtrC16 CApaCommandLine::ExecutableName(void) const
+	?ConstructCmdLineFromMessageL@CApaCommandLine@@QAEXABVRMessage2@@@Z @ 158 NONAME ; void CApaCommandLine::ConstructCmdLineFromMessageL(class RMessage2 const &)
+	Apparc_Dummy1 @ 159 NONAME
+	Apparc_Dummy2 @ 160 NONAME
+	?GetIpcArgsLC@CApaCommandLine@@QBEXAAVTIpcArgs@@@Z @ 161 NONAME ; void CApaCommandLine::GetIpcArgsLC(class TIpcArgs &) const
+	Apparc_Dummy3 @ 162 NONAME
+	?GetCommandLineFromProcessEnvironment@CApaCommandLine@@SAHAAPAV1@@Z @ 163 NONAME ; static int CApaCommandLine::GetCommandLineFromProcessEnvironment(class CApaCommandLine * &)
+	??0CApaProcess@@IAE@ABVRFs@@@Z @ 164 NONAME ; CApaProcess::CApaProcess(class RFs const &)
+	?SetExecutableNameL@CApaCommandLine@@QAEXABVTDesC16@@@Z @ 165 NONAME ; void CApaCommandLine::SetExecutableNameL(class TDesC16 const &)
+	?SetProcessEnvironmentL@CApaCommandLine@@QBEXAAVRProcess@@@Z @ 166 NONAME ; void CApaCommandLine::SetProcessEnvironmentL(class RProcess &) const
+	?NewL@CApaProcess@@SAPAV1@ABVRFs@@@Z @ 167 NONAME ; class CApaProcess * CApaProcess::NewL(class RFs const &)
+	?EnvironmentSlotForPublicUse@CApaCommandLine@@SAHH@Z @ 168 NONAME ; int CApaCommandLine::EnvironmentSlotForPublicUse(int)
+	?GetFileByHandleL@CApaCommandLine@@QBEXAAVRFile@@@Z @ 169 NONAME ; void CApaCommandLine::GetFileByHandleL(class RFile &) const
+	?SetFileByHandleL@CApaCommandLine@@QAEXABVRFile@@@Z @ 170 NONAME ; void CApaCommandLine::SetFileByHandleL(class RFile const &)
+	?DefaultScreen@CApaCommandLine@@QBEHXZ @ 171 NONAME ; int CApaCommandLine::DefaultScreen(void) const
+	?SetDefaultScreenL@CApaCommandLine@@QAEXH@Z @ 172 NONAME ; void CApaCommandLine::SetDefaultScreenL(int)
+	?ParentWindowGroupID@CApaCommandLine@@QBEHXZ @ 173 NONAME ; int CApaCommandLine::ParentWindowGroupID(void) const
+	?SetParentWindowGroupID@CApaCommandLine@@QAEXH@Z @ 174 NONAME ; void CApaCommandLine::SetParentWindowGroupID(int)
+	?DebugMemFail@CApaCommandLine@@QBEHXZ @ 175 NONAME ; int CApaCommandLine::DebugMemFail(void) const
+	?SetAppStartupInstrumentationEventIdBaseL@CApaCommandLine@@QAEXH@Z @ 176 NONAME ; void CApaCommandLine::SetAppStartupInstrumentationEventIdBaseL(int)
+	?SetDebugMemFailL@CApaCommandLine@@QAEXH@Z @ 177 NONAME ; void CApaCommandLine::SetDebugMemFailL(int)
+	?ReadRootStreamLC@CApaProcess@@SAPAVCStreamDictionary@@AAPAVCFileStore@@ABVRFile@@@Z @ 178 NONAME ; class CStreamDictionary * CApaProcess::ReadRootStreamLC(class CFileStore * &, class RFile const &)
+	?AppStartupInstrumentationEventIdBase@CApaCommandLine@@QBEHXZ @ 179 NONAME ; int CApaCommandLine::AppStartupInstrumentationEventIdBase(void) const
+	?ConstructL@CApaProcess@@IAEXAAVTProcessId@@@Z @ 180 NONAME ; void CApaProcess::ConstructL(class TProcessId &)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/bwins/APPARC_9_REMOVE_UI_FRAMEWORKS_V1U.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,239 @@
+EXPORTS
+	??0CApaDocument@@IAE@AAVCApaApplication@@AAVCApaProcess@@@Z @ 1 NONAME ; protected: __thiscall CApaDocument::CApaDocument(class CApaApplication &,class CApaProcess &)
+	??0CApaFileRecognizer@@IAE@AAVRFs@@@Z @ 2 NONAME ; protected: __thiscall CApaFileRecognizer::CApaFileRecognizer(class RFs &)
+	??0CApaFileRecognizerType@@IAE@XZ @ 3 NONAME ; protected: __thiscall CApaFileRecognizerType::CApaFileRecognizerType(void)
+	??0CApaProcess@@IAE@ABVRFs@@AAVCApaAppFinder@@@Z @ 4 NONAME ABSENT ; protected: __thiscall CApaProcess::CApaProcess(class RFs const &,class CApaAppFinder &)
+	??0TApaAppEntry@@QAE@ABVTUidType@@ABV?$TBuf@$0BAA@@@@Z @ 5 NONAME ; public: __thiscall TApaAppEntry::TApaAppEntry(class TUidType const &,class TBuf<256> const &)
+	??0TApaAppEntry@@QAE@XZ @ 6 NONAME ; public: __thiscall TApaAppEntry::TApaAppEntry(void)
+	??0TApaAppIdentifier@@QAE@VTUid@@ABV?$TBuf@$0BAA@@@@Z @ 7 NONAME ; public: __thiscall TApaAppIdentifier::TApaAppIdentifier(class TUid,class TBuf<256> const &)
+	??0TApaAppIdentifier@@QAE@XZ @ 8 NONAME ; public: __thiscall TApaAppIdentifier::TApaAppIdentifier(void)
+	??0TApaAppInfo@@QAE@VTUid@@ABV?$TBuf@$0BAA@@@1@Z @ 9 NONAME ; public: __thiscall TApaAppInfo::TApaAppInfo(class TUid,class TBuf<256> const &,class TBuf<256> const &)
+	??0TApaAppInfo@@QAE@XZ @ 10 NONAME ; public: __thiscall TApaAppInfo::TApaAppInfo(void)
+	??0TApaModelDoorFactory@@QAE@PBVMApaModelHeaderFactory@@@Z @ 11 NONAME ; public: __thiscall TApaModelDoorFactory::TApaModelDoorFactory(class MApaModelHeaderFactory const *)
+	??0TCapability@CApaDocument@@QAE@XZ @ 12 NONAME ; public: __thiscall CApaDocument::TCapability::TCapability(void)
+	??1CApaCommandLine@@UAE@XZ @ 13 NONAME ; public: virtual __thiscall CApaCommandLine::~CApaCommandLine(void)
+	??1CApaDocument@@UAE@XZ @ 14 NONAME ; public: virtual __thiscall CApaDocument::~CApaDocument(void)
+	??1CApaFileRecognizer@@UAE@XZ @ 15 NONAME ; public: virtual __thiscall CApaFileRecognizer::~CApaFileRecognizer(void)
+	??1CApaFileRecognizerType@@MAE@XZ @ 16 NONAME ; protected: virtual __thiscall CApaFileRecognizerType::~CApaFileRecognizerType(void)
+	??1CApaModelDoor@@UAE@XZ @ 17 NONAME ; public: virtual __thiscall CApaModelDoor::~CApaModelDoor(void)
+	??1CApaProcess@@UAE@XZ @ 18 NONAME ; public: virtual __thiscall CApaProcess::~CApaProcess(void)
+	?AddFileRecognizerType@CApaFileRecognizer@@IAEXPAVCApaFileRecognizerType@@@Z @ 19 NONAME ; protected: void __thiscall CApaFileRecognizer::AddFileRecognizerType(class CApaFileRecognizerType *)
+	?AddNewDocumentL@CApaProcess@@QAEPAVCApaDocument@@ABVTDesC16@@VTUid@@@Z @ 20 NONAME ABSENT ; public: class CApaDocument * __thiscall CApaProcess::AddNewDocumentL(class TDesC16 const &,class TUid)
+	?AppFullName@CApaApplication@@UBE?AV?$TBuf@$0BAA@@@XZ @ 21 NONAME ; public: virtual class TBuf<256>  __thiscall CApaApplication::AppFullName(void)const 
+	?AppLocator@CApaFileRecognizer@@QBEPAVCApaAppLocator@@XZ @ 22 NONAME ; public: class CApaAppLocator * __thiscall CApaFileRecognizer::AppLocator(void)const 
+	?AppRunL@CApaFileRecognizerType@@IBE?AVTThreadId@@ABVCApaCommandLine@@@Z @ 23 NONAME ; protected: class TThreadId  __thiscall CApaFileRecognizerType::AppRunL(class CApaCommandLine const &)const 
+	?Capability@CApaDocument@@UBE?AVTCapability@1@XZ @ 24 NONAME ; public: virtual class CApaDocument::TCapability  __thiscall CApaDocument::Capability(void)const 
+	?Capability@CApaFileRecognizerType@@QBEXAAVTDes8@@@Z @ 25 NONAME ; public: void __thiscall CApaFileRecognizerType::Capability(class TDes8 &)const 
+	?Command@CApaCommandLine@@QBE?AW4TApaCommand@@XZ @ 26 NONAME ; public: enum TApaCommand  __thiscall CApaCommandLine::Command(void)const 
+	?ConstructL@CApaProcess@@IAEXXZ @ 27 NONAME ; protected: void __thiscall CApaProcess::ConstructL(void)
+	?CopyCapability@TApaAppCapability@@SAXAAVTDes8@@ABVTDesC8@@@Z @ 28 NONAME ; public: static void __cdecl TApaAppCapability::CopyCapability(class TDes8 &,class TDesC8 const &)
+	?DestroyDocument@CApaProcess@@QAEXPAVCApaDocument@@@Z @ 29 NONAME ; public: void __thiscall CApaProcess::DestroyDocument(class CApaDocument *)
+	?DestroyRecognizerList@CApaFileRecognizer@@IAEXXZ @ 30 NONAME ; protected: void __thiscall CApaFileRecognizer::DestroyRecognizerList(void)
+	?DllName@CApaApplication@@QBE?AV?$TBuf@$0BAA@@@XZ @ 31 NONAME ; public: class TBuf<256>  __thiscall CApaApplication::DllName(void)const 
+	?DoCleanup@TApaDocCleanupItem@@CAXPAX@Z @ 32 NONAME ; private: static void __cdecl TApaDocCleanupItem::DoCleanup(void *)
+	?DocumentName@CApaCommandLine@@QBE?AVTPtrC16@@XZ @ 33 NONAME ; public: class TPtrC16  __thiscall CApaCommandLine::DocumentName(void)const 
+	?Draw@CApaModelDoor@@UBEXAAVCGraphicsContext@@ABVTPoint@@ABVTRect@@PAVMGraphicsDeviceMap@@@Z @ 34 NONAME ; public: virtual void __thiscall CApaModelDoor::Draw(class CGraphicsContext &,class TPoint const &,class TRect const &,class MGraphicsDeviceMap *)const 
+	?ExternalizeBaseStreamL@CApaDoorBase@@IBEXAAVCStreamStore@@AAVCStreamDictionary@@@Z @ 35 NONAME ; protected: void __thiscall CApaDoorBase::ExternalizeBaseStreamL(class CStreamStore &,class CStreamDictionary &)const 
+	?ExternalizeL@CApaDocument@@UBEXAAVRWriteStream@@@Z @ 36 NONAME ; public: virtual void __thiscall CApaDocument::ExternalizeL(class RWriteStream &)const 
+	?ExternalizeL@CApaModelDoor@@UBEXAAVRWriteStream@@@Z @ 37 NONAME ; public: virtual void __thiscall CApaModelDoor::ExternalizeL(class RWriteStream &)const 
+	?ExternalizeL@TApaAppCapability@@QBEXAAVRWriteStream@@@Z @ 38 NONAME ; public: void __thiscall TApaAppCapability::ExternalizeL(class RWriteStream &)const 
+	?ExternalizeL@TApaAppEntry@@QBEXAAVRWriteStream@@@Z @ 39 NONAME ; public: void __thiscall TApaAppEntry::ExternalizeL(class RWriteStream &)const 
+	?ExternalizeL@TApaAppIdentifier@@QBEXAAVRWriteStream@@@Z @ 40 NONAME ; public: void __thiscall TApaAppIdentifier::ExternalizeL(class RWriteStream &)const 
+	?ExternalizeL@TApaAppInfo@@QBEXAAVRWriteStream@@@Z @ 41 NONAME ; public: void __thiscall TApaAppInfo::ExternalizeL(class RWriteStream &)const 
+	?FullCommandLine@CApaCommandLine@@QBE?AVTPtrC16@@XZ @ 42 NONAME ABSENT ; public: class TPtrC16  __thiscall CApaCommandLine::FullCommandLine(void)const 
+	?GenerateFileName@CApaApplication@@SAHAAVRFs@@AAV?$TBuf@$0BAA@@@@Z @ 43 NONAME ; public: static int __cdecl CApaApplication::GenerateFileName(class RFs &,class TBuf<256> &)
+	?GetOriginalSizeInTwips@CApaModelDoor@@UBEXAAVTSize@@@Z @ 44 NONAME ; public: virtual void __thiscall CApaModelDoor::GetOriginalSizeInTwips(class TSize &)const 
+	?GlassPictureL@CApaDocument@@UAEPAVCPicture@@XZ @ 45 NONAME ; public: virtual class CPicture * __thiscall CApaDocument::GlassPictureL(void)
+	?InternalizeBaseStreamL@CApaDoorBase@@IAE?AVTSize@@ABVCStreamStore@@ABVCStreamDictionary@@@Z @ 46 NONAME ; protected: class TSize  __thiscall CApaDoorBase::InternalizeBaseStreamL(class CStreamStore const &,class CStreamDictionary const &)
+	?InternalizeL@TApaAppCapability@@QAEXAAVRReadStream@@@Z @ 47 NONAME ; public: void __thiscall TApaAppCapability::InternalizeL(class RReadStream &)
+	?InternalizeL@TApaAppEntry@@QAEXAAVRReadStream@@@Z @ 48 NONAME ; public: void __thiscall TApaAppEntry::InternalizeL(class RReadStream &)
+	?InternalizeL@TApaAppIdentifier@@QAEXAAVRReadStream@@@Z @ 49 NONAME ; public: void __thiscall TApaAppIdentifier::InternalizeL(class RReadStream &)
+	?InternalizeL@TApaAppInfo@@QAEXAAVRReadStream@@@Z @ 50 NONAME ; public: void __thiscall TApaAppInfo::InternalizeL(class RReadStream &)
+	?LibraryName@CApaCommandLine@@QBE?AVTPtrC16@@XZ @ 51 NONAME ABSENT ; public: class TPtrC16  __thiscall CApaCommandLine::LibraryName(void)const 
+	?MainDocFileName@CApaProcess@@QBE?AVTPtrC16@@XZ @ 52 NONAME ; public: class TPtrC16  __thiscall CApaProcess::MainDocFileName(void)const 
+	?New@CApaCommandLine@@SAPAV1@PAVHBufC16@@@Z @ 53 NONAME ABSENT ; public: static class CApaCommandLine * __cdecl CApaCommandLine::New(class HBufC16 *)
+	?NewL@CApaCommandLine@@SAPAV1@ABVTDesC16@@@Z @ 54 NONAME ABSENT ; public: static class CApaCommandLine * __cdecl CApaCommandLine::NewL(class TDesC16 const &)
+	?NewL@CApaCommandLine@@SAPAV1@XZ @ 55 NONAME ; public: static class CApaCommandLine * __cdecl CApaCommandLine::NewL(void)
+	?NewL@CApaModelDoor@@SAPAV1@ABVCStreamStore@@VTStreamId@@PBVMApaModelHeaderFactory@@@Z @ 56 NONAME ; public: static class CApaModelDoor * __cdecl CApaModelDoor::NewL(class CStreamStore const &,class TStreamId,class MApaModelHeaderFactory const *)
+	?NewL@CApaModelDoor@@SAPAV1@PAVCApaModelHeader@@@Z @ 57 NONAME ; public: static class CApaModelDoor * __cdecl CApaModelDoor::NewL(class CApaModelHeader *)
+	?NewL@CApaProcess@@SAPAV1@ABVRFs@@AAVCApaAppFinder@@@Z @ 58 NONAME ABSENT ; public: static class CApaProcess * __cdecl CApaProcess::NewL(class RFs const &,class CApaAppFinder &)
+	?NewLC@CApaCommandLine@@SAPAV1@ABVTDesC16@@@Z @ 59 NONAME ABSENT ; public: static class CApaCommandLine * __cdecl CApaCommandLine::NewLC(class TDesC16 const &)
+	?NewLC@CApaCommandLine@@SAPAV1@XZ @ 60 NONAME ; public: static class CApaCommandLine * __cdecl CApaCommandLine::NewLC(void)
+	?NewLC@CApaModelDoor@@SAPAV1@PAVCApaModelHeader@@@Z @ 61 NONAME ; public: static class CApaModelDoor * __cdecl CApaModelDoor::NewLC(class CApaModelHeader *)
+	?NewPictureL@TApaModelDoorFactory@@UBEXAAVTPictureHeader@@ABVCStreamStore@@@Z @ 62 NONAME ; public: virtual void __thiscall TApaModelDoorFactory::NewPictureL(class TPictureHeader &,class CStreamStore const &)const 
+	?OpenAppInfoFileL@CApaApplication@@QBEPAVCApaAppInfoFileReader@@XZ @ 63 NONAME ABSENT ; public: class CApaAppInfoFileReader * __thiscall CApaApplication::OpenAppInfoFileL(void)const 
+	?OpenIniFileL@CApaApplication@@QBEPAVCDictionaryStore@@AAVRFs@@@Z @ 64 NONAME ; public: class CDictionaryStore * __thiscall CApaApplication::OpenIniFileL(class RFs &)const 
+	?OpenNewDocumentL@CApaProcess@@QAEPAVCApaDocument@@AAPAVCFileStore@@AAPAVCStreamDictionary@@ABVTDesC16@@I@Z @ 65 NONAME ; public: class CApaDocument * __thiscall CApaProcess::OpenNewDocumentL(class CFileStore * &,class CStreamDictionary * &,class TDesC16 const &,unsigned int)
+	?ReadAppIdentifierL@CApaProcess@@SA?AVTApaAppIdentifier@@ABVCStreamStore@@ABVCStreamDictionary@@@Z @ 66 NONAME ; public: static class TApaAppIdentifier  __cdecl CApaProcess::ReadAppIdentifierL(class CStreamStore const &,class CStreamDictionary const &)
+	?ReadRootStreamLC@CApaProcess@@SAPAVCStreamDictionary@@AAVRFs@@AAPAVCFileStore@@ABVTDesC16@@I@Z @ 67 NONAME ; public: static class CStreamDictionary * __cdecl CApaProcess::ReadRootStreamLC(class RFs &,class CFileStore * &,class TDesC16 const &,unsigned int)
+	?RecognizeFileL@CApaFileRecognizer@@QAEPAVCApaFileRecognizerType@@ABVTDesC16@@PBVTUidType@@@Z @ 68 NONAME ; public: class CApaFileRecognizerType * __thiscall CApaFileRecognizer::RecognizeFileL(class TDesC16 const &,class TUidType const *)
+	?NewAppServerL@CApaApplication@@UAEXAAPAVCApaAppServer@@@Z @ 69 NONAME ; void CApaApplication::NewAppServerL(class CApaAppServer * &)
+	?OpenFileL@CApaDocument@@EAEXAAPAVCFileStore@@AAVRFile@@@Z @ 70 NONAME ; void CApaDocument::OpenFileL(class CFileStore * &, class RFile &)
+	?Reserved_2@CApaDocument@@EAEXXZ @ 71 NONAME ; private: virtual void __thiscall CApaDocument::Reserved_2(void)
+	?ResetL@CApaProcess@@QAEXXZ @ 72 NONAME ; public: void __thiscall CApaProcess::ResetL(void)
+	?RestoreL@CApaModelDoor@@QAEXABVCStreamStore@@VTStreamId@@PBVMApaModelHeaderFactory@@@Z @ 73 NONAME ; public: void __thiscall CApaModelDoor::RestoreL(class CStreamStore const &,class TStreamId,class MApaModelHeaderFactory const *)
+	?ScaleFactorHeight@CApaModelDoor@@UBEHXZ @ 74 NONAME ; public: virtual int __thiscall CApaModelDoor::ScaleFactorHeight(void)const 
+	?ScaleFactorWidth@CApaModelDoor@@UBEHXZ @ 75 NONAME ; public: virtual int __thiscall CApaModelDoor::ScaleFactorWidth(void)const 
+	?SetAppLocator@CApaFileRecognizer@@IAEXPAVCApaAppLocator@@@Z @ 76 NONAME ; protected: void __thiscall CApaFileRecognizer::SetAppLocator(class CApaAppLocator *)
+	?SetCommandL@CApaCommandLine@@QAEXW4TApaCommand@@@Z @ 77 NONAME ; public: void __thiscall CApaCommandLine::SetCommandL(enum TApaCommand)
+	?SetDocumentNameL@CApaCommandLine@@QAEXABVTDesC16@@@Z @ 78 NONAME ; public: void __thiscall CApaCommandLine::SetDocumentNameL(class TDesC16 const &)
+	?SetFullCommandLine@CApaCommandLine@@QAEHPAVHBufC16@@@Z @ 79 NONAME ABSENT ; public: int __thiscall CApaCommandLine::SetFullCommandLine(class HBufC16 *)
+	?SetFullCommandLineL@CApaCommandLine@@QAEXABVTDesC16@@@Z @ 80 NONAME ABSENT ; public: void __thiscall CApaCommandLine::SetFullCommandLineL(class TDesC16 const &)
+	?SetLibraryNameL@CApaCommandLine@@QAEXABVTDesC16@@@Z @ 81 NONAME ABSENT ; public: void __thiscall CApaCommandLine::SetLibraryNameL(class TDesC16 const &)
+	?SetMainDocFileName@CApaProcess@@QAEXABVTDesC16@@@Z @ 82 NONAME ; public: void __thiscall CApaProcess::SetMainDocFileName(class TDesC16 const &)
+	?SetMainDocument@CApaProcess@@QAEXPAVCApaDocument@@@Z @ 83 NONAME ; public: void __thiscall CApaProcess::SetMainDocument(class CApaDocument *)
+	?SetReserveLengthL@CApaCommandLine@@QAEXH@Z @ 84 NONAME ABSENT ; public: void __thiscall CApaCommandLine::SetReserveLengthL(int)
+	?SetScaleFactor@CApaModelDoor@@UAEXHH@Z @ 85 NONAME ; public: virtual void __thiscall CApaModelDoor::SetScaleFactor(int,int)
+	?SetTailEndL@CApaCommandLine@@QAEXABVTDesC8@@@Z @ 86 NONAME ; public: void __thiscall CApaCommandLine::SetTailEndL(class TDesC8 const &)
+	?StoreL@CApaModelDoor@@UBE?AVTStreamId@@AAVCStreamStore@@@Z @ 87 NONAME ; public: virtual class TStreamId  __thiscall CApaModelDoor::StoreL(class CStreamStore &)const 
+	?TailEnd@CApaCommandLine@@QBE?AVTPtrC8@@XZ @ 88 NONAME ; public: class TPtrC8  __thiscall CApaCommandLine::TailEnd(void)const 
+	?ValidatePasswordL@CApaDocument@@UBEXXZ @ 89 NONAME ; public: virtual void __thiscall CApaDocument::ValidatePasswordL(void)const 
+	?WriteAppIdentifierL@CApaProcess@@SAXAAVCStreamStore@@AAVCStreamDictionary@@ABVTApaAppIdentifier@@@Z @ 90 NONAME ; public: static void __cdecl CApaProcess::WriteAppIdentifierL(class CStreamStore &,class CStreamDictionary &,class TApaAppIdentifier const &)
+	?WriteRootStreamL@CApaProcess@@SAXAAVCPersistentStore@@AAVCStreamDictionary@@ABVCApaApplication@@@Z @ 91 NONAME ; public: static void __cdecl CApaProcess::WriteRootStreamL(class CPersistentStore &,class CStreamDictionary &,class CApaApplication const &)
+	?WriteRootStreamL@CApaProcess@@SAXAAVCPersistentStore@@AAVCStreamDictionary@@ABVTApaAppIdentifier@@@Z @ 92 NONAME ; public: static void __cdecl CApaProcess::WriteRootStreamL(class CPersistentStore &,class CStreamDictionary &,class TApaAppIdentifier const &)
+	?DetachFromStoreL@CApaModelDoor@@UAEXW4TDetach@CPicture@@@Z @ 93 NONAME ; public: virtual void __thiscall CApaModelDoor::DetachFromStoreL(enum CPicture::TDetach)
+	?Lock@CApaFileRecognizerType@@QAEXXZ @ 94 NONAME ; public: void __thiscall CApaFileRecognizerType::Lock(void)
+	?RemoveFileRecognizerType@CApaFileRecognizer@@IAEHPBVCApaFileRecognizerType@@@Z @ 95 NONAME ; protected: int __thiscall CApaFileRecognizer::RemoveFileRecognizerType(class CApaFileRecognizerType const *)
+	?Unlock@CApaFileRecognizerType@@QAEXXZ @ 96 NONAME ; public: void __thiscall CApaFileRecognizerType::Unlock(void)
+	??0TApaLastUsedEntry@@QAE@V?$TBuf@$0BAA@@@VTUid@@@Z @ 97 NONAME ABSENT ; public: __thiscall TApaLastUsedEntry::TApaLastUsedEntry(class TBuf<256>,class TUid)
+	??0TApaLastUsedEntry@@QAE@XZ @ 98 NONAME ABSENT ; public: __thiscall TApaLastUsedEntry::TApaLastUsedEntry(void)
+	?AddLastUsedEntryL@CApaRecentFile@@SAXAAVRFs@@ABVTDesC16@@VTUid@@@Z @ 99 NONAME ABSENT ; public: static void __cdecl CApaRecentFile::AddLastUsedEntryL(class RFs &,class TDesC16 const &,class TUid)
+	?ExternalizeL@TApaLastUsedEntry@@QBEXAAVRWriteStream@@@Z @ 100 NONAME ABSENT ; public: void __thiscall TApaLastUsedEntry::ExternalizeL(class RWriteStream &)const 
+	?GetRecentFileL@CApaRecentFile@@SA?AVTApaLastUsedEntry@@AAVRFs@@VTUid@@H@Z @ 101 NONAME ABSENT ; public: static class TApaLastUsedEntry  __cdecl CApaRecentFile::GetRecentFileL(class RFs &,class TUid,int)
+	?GetRecentFileListL@CApaRecentFile@@SAPAV?$CArrayFixFlat@VTApaLastUsedEntry@@@@AAVRFs@@VTUid@@@Z @ 102 NONAME ABSENT ; public: static class CArrayFixFlat<class TApaLastUsedEntry> * __cdecl CApaRecentFile::GetRecentFileListL(class RFs &,class TUid)
+	?InternalizeL@TApaLastUsedEntry@@QAEXAAVRReadStream@@@Z @ 103 NONAME ABSENT ; public: void __thiscall TApaLastUsedEntry::InternalizeL(class RReadStream &)
+	?Reserved_1@CApaFileRecognizerType@@EAEXXZ @ 104 NONAME ; private: virtual void __thiscall CApaFileRecognizerType::Reserved_1(void)
+	?Reserved_1@CApaModelHeader@@EAEXXZ @ 105 NONAME ; private: virtual void __thiscall CApaModelHeader::Reserved_1(void)
+	??0TApaAppViewInfo@@QAE@VTUid@@ABV?$TBuf@$0BAA@@@H@Z @ 106 NONAME ; public: __thiscall TApaAppViewInfo::TApaAppViewInfo(class TUid,class TBuf<256> const &,int)
+	??0TApaAppViewInfo@@QAE@XZ @ 107 NONAME ; public: __thiscall TApaAppViewInfo::TApaAppViewInfo(void)
+	?ExternalizeL@TApaAppViewInfo@@QBEXAAVRWriteStream@@@Z @ 108 NONAME ; public: void __thiscall TApaAppViewInfo::ExternalizeL(class RWriteStream &)const 
+	?InternalizeL@TApaAppViewInfo@@QAEXAAVRReadStream@@@Z @ 109 NONAME ; public: void __thiscall TApaAppViewInfo::InternalizeL(class RReadStream &)
+	??0TApaAppInfo@@QAE@VTUid@@ABV?$TBuf@$0BAA@@@11@Z @ 110 NONAME ; public: __thiscall TApaAppInfo::TApaAppInfo(class TUid,class TBuf<256> const &,class TBuf<256> const &,class TBuf<256> const &)
+	??0TApaAppInfo_7_0@@QAE@VTUid@@ABV?$TBuf@$0BAA@@@1@Z @ 111 NONAME ABSENT ; TApaAppInfo_7_0::TApaAppInfo_7_0(class TUid, class TBuf<256> const &, class TBuf<256> const &)
+	??0TApaAppInfo_7_0@@QAE@XZ @ 112 NONAME ABSENT ; TApaAppInfo_7_0::TApaAppInfo_7_0(void)
+	?ExternalizeL@TApaAppInfo_7_0@@QBEXAAVRWriteStream@@@Z @ 113 NONAME ABSENT ; void TApaAppInfo_7_0::ExternalizeL(class RWriteStream &) const
+	?InternalizeL@TApaAppInfo_7_0@@QAEXAAVRReadStream@@@Z @ 114 NONAME ABSENT ; void TApaAppInfo_7_0::InternalizeL(class RReadStream &)
+	?Externalize7_0L@TApaAppCapability@@ABEXAAVRWriteStream@@@Z @ 115 NONAME ; void TApaAppCapability::Externalize7_0L(class RWriteStream &) const
+	?Internalize7_0L@TApaAppCapability@@QAEXAAVRReadStream@@@Z @ 116 NONAME ; void TApaAppCapability::Internalize7_0L(class RReadStream &)
+	??0TApaEmbeddabilityFilter@@QAE@XZ @ 117 NONAME ; public: __thiscall TApaEmbeddabilityFilter::TApaEmbeddabilityFilter(void)
+	?AddEmbeddability@TApaEmbeddabilityFilter@@QAEXW4TEmbeddability@TApaAppCapability@@@Z @ 118 NONAME ; public: void __thiscall TApaEmbeddabilityFilter::AddEmbeddability(enum TApaAppCapability::TEmbeddability)
+	?MatchesEmbeddability@TApaEmbeddabilityFilter@@QBEHW4TEmbeddability@TApaAppCapability@@@Z @ 119 NONAME ; public: int __thiscall TApaEmbeddabilityFilter::MatchesEmbeddability(enum TApaAppCapability::TEmbeddability)const 
+	?SetMainDocFileNameL@CApaProcess@@QAEXABVTDesC16@@@Z @ 120 NONAME ; public: void __thiscall CApaProcess::SetMainDocFileNameL(class TDesC16 const &)
+	?CreateFileRecognizerL@CApaFileRecognizerType@@SAPAV1@VTUid@@@Z @ 121 NONAME ; public: static class CApaFileRecognizerType * __cdecl CApaFileRecognizerType::CreateFileRecognizerL(class TUid)
+	??0TApaApplicationFactory@@QAE@ABVCImplementationInformation@@@Z @ 122 NONAME ; TApaApplicationFactory::TApaApplicationFactory(class CImplementationInformation const &)
+	??0TApaApplicationFactory@@QAE@P6APAVCApaApplication@@XZ@Z @ 123 NONAME ; TApaApplicationFactory::TApaApplicationFactory(class CApaApplication * (*)(void))
+	??0TApaApplicationFactory@@QAE@VTUid@@@Z @ 124 NONAME ; TApaApplicationFactory::TApaApplicationFactory(class TUid)
+	??1CApaApplication@@UAE@XZ @ 125 NONAME ; CApaApplication::~CApaApplication(void)
+	?AddNewDocumentL@CApaProcess@@QAEPAVCApaDocument@@VTApaApplicationFactory@@@Z @ 126 NONAME ; class CApaDocument * CApaProcess::AddNewDocumentL(class TApaApplicationFactory)
+	??0CApaAppServer@@IAE@XZ @ 127 NONAME ; CApaAppServer::CApaAppServer(void)
+	??0CApaAppServiceBase@@QAE@XZ @ 128 NONAME ; CApaAppServiceBase::CApaAppServiceBase(void)
+	??0RApaAppServiceBase@@IAE@XZ @ 129 NONAME ; RApaAppServiceBase::RApaAppServiceBase(void)
+	??1CApaAppServer@@UAE@XZ @ 130 NONAME ; CApaAppServer::~CApaAppServer(void)
+	??1CApaAppServiceBase@@UAE@XZ @ 131 NONAME ; CApaAppServiceBase::~CApaAppServiceBase(void)
+	??1CApaServerAppExitMonitor@@UAE@XZ @ 132 NONAME ; CApaServerAppExitMonitor::~CApaServerAppExitMonitor(void)
+	?CancelNotifyServerExit@RApaAppServiceBase@@QBEXXZ @ 133 NONAME ; void RApaAppServiceBase::CancelNotifyServerExit(void) const
+	?Close@RApaAppServiceBase@@QAEXXZ @ 134 NONAME ; void RApaAppServiceBase::Close(void)
+	?ConnectExistingAppL@RApaAppServiceBase@@QAEXABV1@@Z @ 135 NONAME ; void RApaAppServiceBase::ConnectExistingAppL(class RApaAppServiceBase const &)
+	?ConnectExistingByNameL@RApaAppServiceBase@@QAEXABVTDesC16@@@Z @ 136 NONAME ; void RApaAppServiceBase::ConnectExistingByNameL(class TDesC16 const &)
+	?ConstructL@CApaAppServer@@UAEXABVTDesC16@@@Z @ 137 NONAME ; void CApaAppServer::ConstructL(class TDesC16 const &)
+	?CreateL@CApaAppServiceBase@@MAEXXZ @ 138 NONAME ; void CApaAppServiceBase::CreateL(void)
+	?CreateServiceL@CApaAppServer@@UBEPAVCApaAppServiceBase@@VTUid@@@Z @ 139 NONAME ; class CApaAppServiceBase * CApaAppServer::CreateServiceL(class TUid) const
+	?CreateServiceSecurityCheckL@CApaAppServer@@UAE?AW4TCustomResult@CPolicyServer@@VTUid@@ABVRMessage2@@AAHAAVTSecurityInfo@@@Z @ 140 NONAME ; enum CPolicyServer::TCustomResult CApaAppServer::CreateServiceSecurityCheckL(class TUid, class RMessage2 const &, int &, class TSecurityInfo &)
+	?CustomSecurityCheckL@CApaAppServer@@MAE?AW4TCustomResult@CPolicyServer@@ABVRMessage2@@AAHAAVTSecurityInfo@@@Z @ 141 NONAME ; enum CPolicyServer::TCustomResult CApaAppServer::CustomSecurityCheckL(class RMessage2 const &, int &, class TSecurityInfo &)
+	?ExtensionInterface@CApaAppServer@@EAEXVTUid@@AAPAX@Z @ 142 NONAME ; void CApaAppServer::ExtensionInterface(class TUid, void * &)
+	?ExtensionInterface@CApaAppServiceBase@@EAEXVTUid@@AAPAX@Z @ 143 NONAME ; void CApaAppServiceBase::ExtensionInterface(class TUid, void * &)
+	?ExtensionInterface@RApaAppServiceBase@@EAEXVTUid@@AAPAX@Z @ 144 NONAME ; void RApaAppServiceBase::ExtensionInterface(class TUid, void * &)
+	?NewL@CApaServerAppExitMonitor@@SAPAV1@AAVRApaAppServiceBase@@AAVMApaServerAppExitObserver@@H@Z @ 145 NONAME ; class CApaServerAppExitMonitor * CApaServerAppExitMonitor::NewL(class RApaAppServiceBase &, class MApaServerAppExitObserver &, int)
+	?NewLC@CApaServerAppExitMonitor@@SAPAV1@AAVRApaAppServiceBase@@AAVMApaServerAppExitObserver@@H@Z @ 146 NONAME ; class CApaServerAppExitMonitor * CApaServerAppExitMonitor::NewLC(class RApaAppServiceBase &, class MApaServerAppExitObserver &, int)
+	?NewSessionL@CApaAppServer@@EBEPAVCSession2@@ABVTVersion@@ABVRMessage2@@@Z @ 147 NONAME ; class CSession2 * CApaAppServer::NewSessionL(class TVersion const &, class RMessage2 const &) const
+	?NotifyServerExit@CApaAppServer@@QAEXH@Z @ 148 NONAME ; void CApaAppServer::NotifyServerExit(int)
+	?NotifyServerExit@RApaAppServiceBase@@QBEXAAVTRequestStatus@@@Z @ 149 NONAME ; void RApaAppServiceBase::NotifyServerExit(class TRequestStatus &) const
+	?SecurityCheckL@CApaAppServiceBase@@UAE?AW4TCustomResult@CPolicyServer@@ABVRMessage2@@AAHAAVTSecurityInfo@@@Z @ 150 NONAME ; enum CPolicyServer::TCustomResult CApaAppServiceBase::SecurityCheckL(class RMessage2 const &, int &, class TSecurityInfo &)
+	?ServerName@RApaAppServiceBase@@QBE?AVTPtrC16@@XZ @ 151 NONAME ; class TPtrC16 RApaAppServiceBase::ServerName(void) const
+	?ServerRequired@CApaCommandLine@@QBEIXZ @ 152 NONAME ; unsigned int CApaCommandLine::ServerRequired(void) const
+	?ServiceError@CApaAppServiceBase@@MAEXABVRMessage2@@H@Z @ 153 NONAME ; void CApaAppServiceBase::ServiceError(class RMessage2 const &, int)
+	?ServiceL@CApaAppServiceBase@@MAEXABVRMessage2@@@Z @ 154 NONAME ; void CApaAppServiceBase::ServiceL(class RMessage2 const &)
+	?SetServerNotRequiredL@CApaCommandLine@@QAEXXZ @ 155 NONAME ; void CApaCommandLine::SetServerNotRequiredL(void)
+	?SetServerRequiredL@CApaCommandLine@@QAEXI@Z @ 156 NONAME ; void CApaCommandLine::SetServerRequiredL(unsigned int)
+	?ExecutableName@CApaCommandLine@@QBE?AVTPtrC16@@XZ @ 157 NONAME ; class TPtrC16 CApaCommandLine::ExecutableName(void) const
+	?ConstructCmdLineFromMessageL@CApaCommandLine@@QAEXABVRMessage2@@@Z @ 158 NONAME ; void CApaCommandLine::ConstructCmdLineFromMessageL(class RMessage2 const &)
+	Apparc_Dummy1 @ 159 NONAME ABSENT
+	Apparc_Dummy2 @ 160 NONAME ABSENT
+	?GetIpcArgsLC@CApaCommandLine@@QBEXAAVTIpcArgs@@@Z @ 161 NONAME ; void CApaCommandLine::GetIpcArgsLC(class TIpcArgs &) const
+	Apparc_Dummy3 @ 162 NONAME ABSENT
+	?GetCommandLineFromProcessEnvironment@CApaCommandLine@@SAHAAPAV1@@Z @ 163 NONAME ; static int CApaCommandLine::GetCommandLineFromProcessEnvironment(class CApaCommandLine * &)
+	??0CApaProcess@@IAE@ABVRFs@@@Z @ 164 NONAME ; CApaProcess::CApaProcess(class RFs const &)
+	?SetExecutableNameL@CApaCommandLine@@QAEXABVTDesC16@@@Z @ 165 NONAME ; void CApaCommandLine::SetExecutableNameL(class TDesC16 const &)
+	?SetProcessEnvironmentL@CApaCommandLine@@QBEXAAVRProcess@@@Z @ 166 NONAME ; void CApaCommandLine::SetProcessEnvironmentL(class RProcess &) const
+	?NewL@CApaProcess@@SAPAV1@ABVRFs@@@Z @ 167 NONAME ; class CApaProcess * CApaProcess::NewL(class RFs const &)
+	?EnvironmentSlotForPublicUse@CApaCommandLine@@SAHH@Z @ 168 NONAME ; int CApaCommandLine::EnvironmentSlotForPublicUse(int)
+	?GetFileByHandleL@CApaCommandLine@@QBEXAAVRFile@@@Z @ 169 NONAME ; void CApaCommandLine::GetFileByHandleL(class RFile &) const
+	?SetFileByHandleL@CApaCommandLine@@QAEXABVRFile@@@Z @ 170 NONAME ; void CApaCommandLine::SetFileByHandleL(class RFile const &)
+	?DefaultScreen@CApaCommandLine@@QBEHXZ @ 171 NONAME ; int CApaCommandLine::DefaultScreen(void) const
+	?SetDefaultScreenL@CApaCommandLine@@QAEXH@Z @ 172 NONAME ; void CApaCommandLine::SetDefaultScreenL(int)
+	?ParentWindowGroupID@CApaCommandLine@@QBEHXZ @ 173 NONAME ; int CApaCommandLine::ParentWindowGroupID(void) const
+	?SetParentWindowGroupID@CApaCommandLine@@QAEXH@Z @ 174 NONAME ; void CApaCommandLine::SetParentWindowGroupID(int)
+	?DebugMemFail@CApaCommandLine@@QBEHXZ @ 175 NONAME ; int CApaCommandLine::DebugMemFail(void) const
+	?SetAppStartupInstrumentationEventIdBaseL@CApaCommandLine@@QAEXH@Z @ 176 NONAME ; void CApaCommandLine::SetAppStartupInstrumentationEventIdBaseL(int)
+	?SetDebugMemFailL@CApaCommandLine@@QAEXH@Z @ 177 NONAME ; void CApaCommandLine::SetDebugMemFailL(int)
+	?ReadRootStreamLC@CApaProcess@@SAPAVCStreamDictionary@@AAPAVCFileStore@@ABVRFile@@@Z @ 178 NONAME ; class CStreamDictionary * CApaProcess::ReadRootStreamLC(class CFileStore * &, class RFile const &)
+	?AppStartupInstrumentationEventIdBase@CApaCommandLine@@QBEHXZ @ 179 NONAME ; int CApaCommandLine::AppStartupInstrumentationEventIdBase(void) const
+	??0CApaAppFinder@@IAE@XZ @ 180 NONAME ; CApaAppFinder::CApaAppFinder(void)
+	??0CApaAppServiceInfoArray@@IAE@XZ @ 181 NONAME ; CApaAppServiceInfoArray::CApaAppServiceInfoArray(void)
+	??0CApaApplication@@IAE@XZ @ 182 NONAME ; CApaApplication::CApaApplication(void)
+	??0CApaDocument@@IAE@XZ @ 183 NONAME ; CApaDocument::CApaDocument(void)
+	??0CApaDoorBase@@IAE@XZ @ 184 NONAME ; CApaDoorBase::CApaDoorBase(void)
+	??0CApaModelHeader@@IAE@XZ @ 185 NONAME ; CApaModelHeader::CApaModelHeader(void)
+	??0CApaProcess@@IAE@XZ @ 186 NONAME ; CApaProcess::CApaProcess(void)
+	??0MApaAppStarter@@IAE@XZ @ 187 NONAME ; MApaAppStarter::MApaAppStarter(void)
+	??0MApaEmbeddedDocObserver@@IAE@XZ @ 188 NONAME ; MApaEmbeddedDocObserver::MApaEmbeddedDocObserver(void)
+	??0MApaModelHeaderFactory@@IAE@XZ @ 189 NONAME ; MApaModelHeaderFactory::MApaModelHeaderFactory(void)
+	??0MApaServerAppExitObserver@@IAE@XZ @ 190 NONAME ; MApaServerAppExitObserver::MApaServerAppExitObserver(void)
+	??0TApaApplicationFactory@@QAE@XZ @ 191 NONAME ; TApaApplicationFactory::TApaApplicationFactory(void)
+	?CApaAppFinder_Reserved1@CApaAppFinder@@EAEXXZ @ 192 NONAME ; void CApaAppFinder::CApaAppFinder_Reserved1(void)
+	?CApaAppFinder_Reserved2@CApaAppFinder@@EAEXXZ @ 193 NONAME ; void CApaAppFinder::CApaAppFinder_Reserved2(void)
+	?CApaAppServer_Reserved1@CApaAppServer@@EAEXXZ @ 194 NONAME ; void CApaAppServer::CApaAppServer_Reserved1(void)
+	?CApaAppServer_Reserved2@CApaAppServer@@EAEXXZ @ 195 NONAME ; void CApaAppServer::CApaAppServer_Reserved2(void)
+	?CApaAppServiceBase_Reserved1@CApaAppServiceBase@@EAEXXZ @ 196 NONAME ; void CApaAppServiceBase::CApaAppServiceBase_Reserved1(void)
+	?CApaAppServiceBase_Reserved2@CApaAppServiceBase@@EAEXXZ @ 197 NONAME ; void CApaAppServiceBase::CApaAppServiceBase_Reserved2(void)
+	?CApaAppServiceInfoArray_Reserved1@CApaAppServiceInfoArray@@EAEXXZ @ 198 NONAME ; void CApaAppServiceInfoArray::CApaAppServiceInfoArray_Reserved1(void)
+	?CApaAppServiceInfoArray_Reserved2@CApaAppServiceInfoArray@@EAEXXZ @ 199 NONAME ; void CApaAppServiceInfoArray::CApaAppServiceInfoArray_Reserved2(void)
+	?CApaApplication_Reserved1@CApaApplication@@MAEXXZ @ 200 NONAME ; void CApaApplication::CApaApplication_Reserved1(void)
+	?CApaApplication_Reserved2@CApaApplication@@MAEXXZ @ 201 NONAME ; void CApaApplication::CApaApplication_Reserved2(void)
+	?CApaDoorBase_Reserved1@CApaDoorBase@@EAEXXZ @ 202 NONAME ; void CApaDoorBase::CApaDoorBase_Reserved1(void)
+	?CApaDoorBase_Reserved2@CApaDoorBase@@EAEXXZ @ 203 NONAME ; void CApaDoorBase::CApaDoorBase_Reserved2(void)
+	?CApaProcess_Reserved1@CApaProcess@@MAEXXZ @ 204 NONAME ; void CApaProcess::CApaProcess_Reserved1(void)
+	?CApaProcess_Reserved2@CApaProcess@@MAEXXZ @ 205 NONAME ; void CApaProcess::CApaProcess_Reserved2(void)
+	?Capability@CApaDoorBase@@UBE?AVTPictureCapability@@XZ @ 206 NONAME ; class TPictureCapability CApaDoorBase::Capability(void) const
+	?CountResources@CApaAppServiceBase@@MAEHXZ @ 207 NONAME ; int CApaAppServiceBase::CountResources(void)
+	?Disconnect@CApaAppServiceBase@@MAEXABVRMessage2@@@Z @ 208 NONAME ; void CApaAppServiceBase::Disconnect(class RMessage2 const &)
+	?DoConnect@CApaAppServer@@MAEXABVRMessage2@@@Z @ 209 NONAME ; void CApaAppServer::DoConnect(class RMessage2 const &)
+	?GetCropInTwips@CApaDoorBase@@UBEXAAVTMargins@@@Z @ 210 NONAME ; void CApaDoorBase::GetCropInTwips(class TMargins &) const
+	?LineBreakPossible@CApaDoorBase@@UBEHIHH@Z @ 211 NONAME ; int CApaDoorBase::LineBreakPossible(unsigned int, int, int) const
+	?MApaAppStarter_Reserved1@MApaAppStarter@@EAEXXZ @ 212 NONAME ; void MApaAppStarter::MApaAppStarter_Reserved1(void)
+	?MApaAppStarter_Reserved2@MApaAppStarter@@EAEXXZ @ 213 NONAME ; void MApaAppStarter::MApaAppStarter_Reserved2(void)
+	?MApaEmbeddedDocObserver_Reserved1@MApaEmbeddedDocObserver@@EAEXXZ @ 214 NONAME ; void MApaEmbeddedDocObserver::MApaEmbeddedDocObserver_Reserved1(void)
+	?MApaEmbeddedDocObserver_Reserved2@MApaEmbeddedDocObserver@@EAEXXZ @ 215 NONAME ; void MApaEmbeddedDocObserver::MApaEmbeddedDocObserver_Reserved2(void)
+	?MApaModelHeaderFactory_Reserved1@MApaModelHeaderFactory@@EAEXXZ @ 216 NONAME ; void MApaModelHeaderFactory::MApaModelHeaderFactory_Reserved1(void)
+	?MApaModelHeaderFactory_Reserved2@MApaModelHeaderFactory@@EAEXXZ @ 217 NONAME ; void MApaModelHeaderFactory::MApaModelHeaderFactory_Reserved2(void)
+	?MApaServerAppExitObserver_Reserved1@MApaServerAppExitObserver@@EAEXXZ @ 218 NONAME ; void MApaServerAppExitObserver::MApaServerAppExitObserver_Reserved1(void)
+	?MApaServerAppExitObserver_Reserved2@MApaServerAppExitObserver@@EAEXXZ @ 219 NONAME ; void MApaServerAppExitObserver::MApaServerAppExitObserver_Reserved2(void)
+	?NativePixelSize@CApaDoorBase@@UAEHAAVTSize@@@Z @ 220 NONAME ; int CApaDoorBase::NativePixelSize(class TSize &)
+	?RApaAppServiceBase_Reserved1@RApaAppServiceBase@@EAEXXZ @ 221 NONAME ; void RApaAppServiceBase::RApaAppServiceBase_Reserved1(void)
+	?RApaAppServiceBase_Reserved2@RApaAppServiceBase@@EAEXXZ @ 222 NONAME ; void RApaAppServiceBase::RApaAppServiceBase_Reserved2(void)
+	?Reserved_2@CApaModelHeader@@EAEXXZ @ 223 NONAME ; void CApaModelHeader::Reserved_2(void)
+	?ScaleFactorHeight@CApaDoorBase@@UBEHXZ @ 224 NONAME ; int CApaDoorBase::ScaleFactorHeight(void) const
+	?ScaleFactorWidth@CApaDoorBase@@UBEHXZ @ 225 NONAME ; int CApaDoorBase::ScaleFactorWidth(void) const
+	?SetCropInTwips@CApaDoorBase@@UAEXABVTMargins@@@Z @ 226 NONAME ; void CApaDoorBase::SetCropInTwips(class TMargins const &)
+	?SetScaleFactor@CApaDoorBase@@UAEXHH@Z @ 227 NONAME ; void CApaDoorBase::SetScaleFactor(int, int)
+	?StoreL@CApaDoorBase@@UBE?AVTStreamId@@AAVCStreamStore@@@Z @ 228 NONAME ; class TStreamId CApaDoorBase::StoreL(class CStreamStore &) const
+	?OpaqueData@CApaCommandLine@@QBE?AVTPtrC8@@XZ @ 229 NONAME ; class TPtrC8 CApaCommandLine::OpaqueData(void) const
+	?SetOpaqueDataL@CApaCommandLine@@QAEXABVTDesC8@@@Z @ 230 NONAME ; void CApaCommandLine::SetOpaqueDataL(class TDesC8 cosnt &)
+	?IsDefaultScreenSet@CApaCommandLine@@QBEHXZ @ 231 NONAME ; int CApaCommandLine::IsDefaultScreenSet(void) const
+	?ConstructL@CApaProcess@@IAEXVTProcessId@@@Z @ 232 NONAME ; void CApaProcess::ConstructL(class TProcessId)
+	?ParentProcessId@CApaCommandLine@@QBE?AVTProcessId@@XZ @ 233 NONAME ; class TProcessId CApaCommandLine::ParentProcessId(void) const
+	?SetParentProcessId@CApaCommandLine@@QAEXVTProcessId@@@Z @ 234 NONAME ; void CApaCommandLine::SetParentProcessId(class TProcessId)
+	?ConnectExistingAppL@RApaAppServiceBase@@QAEXABV1@ABVTSecurityPolicy@@@Z @ 235 NONAME ; void RApaAppServiceBase::ConnectExistingAppL(class RApaAppServiceBase const &, class TSecurityPolicy const &)
+	?ConnectExistingByNameL@RApaAppServiceBase@@QAEXABVTDesC16@@ABVTSecurityPolicy@@@Z @ 236 NONAME ; void RApaAppServiceBase::ConnectExistingByNameL(class TDesC16 const &, class TSecurityPolicy const &)
+	?TransferExistingSessionL@RApaAppServiceBase@@QAEXAAV1@@Z @ 237 NONAME ; void RApaAppServiceBase::TransferExistingSessionL(class RApaAppServiceBase &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/bwins/APP_CTRL2U.def	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,4 @@
+EXPORTS
+; NEW:
+	?WinsMain@@YAHPAVTDesC16@@@Z @ 1 NONAME ; int __cdecl WinsMain(class TDesC16 *)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/bwins/APP_CTRLU.def	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,4 @@
+EXPORTS
+; NEW:
+	?WinsMain@@YAHPAVTDesC16@@@Z @ 1 NONAME ; int __cdecl WinsMain(class TDesC16 *)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/bwins/APSERVU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,27 @@
+EXPORTS
+	??1CApaAppListServer@@UAE@XZ @ 1 NONAME ; public: virtual __thiscall CApaAppListServer::~CApaAppListServer(void)
+	?NewL@CApaAppListServer@@SAPAV1@PAVCApaAppList@@PAVCApaFileRecognizer@@@Z @ 2 NONAME ABSENT ; public: static class CApaAppListServer * __cdecl CApaAppListServer::NewL(class CApaAppList *,class CApaFileRecognizer *)
+	??1CApaFsMonitor@@UAE@XZ @ 3 NONAME ; public: virtual __thiscall CApaFsMonitor::~CApaFsMonitor(void)
+	?NameApaServServerThread@@YA?AVTPtrC16@@XZ @ 4 NONAME ; class TPtrC16  __cdecl NameApaServServerThread(void)
+	?NameApaServStartSemaphore@@YA?AVTPtrC16@@XZ @ 5 NONAME ; class TPtrC16  __cdecl NameApaServStartSemaphore(void)
+	?NewL@CApaAppListServer@@SAPAV1@PAVMApaAppStarter@@@Z @ 6 NONAME ; public: static class CApaAppListServer * __cdecl CApaAppListServer::NewL(class MApaAppStarter *)
+	?NewL@CApaFsMonitor@@SAPAV1@AAVRFs@@ABVTDesC16@@VTCallBack@@@Z @ 7 NONAME ; public: static class CApaFsMonitor * __cdecl CApaFsMonitor::NewL(class RFs &,class TDesC16 const &,class TCallBack)
+	?NotifyType@CApaFsMonitor@@QBE?AW4TNotifyType@@XZ @ 8 NONAME ; public: enum TNotifyType  __thiscall CApaFsMonitor::NotifyType(void)const 
+	?SetBlocked@CApaFsMonitor@@QAEXH@Z @ 9 NONAME ; public: void __thiscall CApaFsMonitor::SetBlocked(int)
+	?Start@CApaFsMonitor@@QAEXW4TNotifyType@@@Z @ 10 NONAME ; public: void __thiscall CApaFsMonitor::Start(enum TNotifyType)
+	?Self@CApaAppListServer@@SAPAV1@XZ @ 11 NONAME ; class CApaAppListServer * CApaAppListServer::Self(void)
+	?AddLocationL@CApaFsMonitor@@QAEXABVTDesC16@@@Z @ 12 NONAME ; void CApaFsMonitor::AddLocationL(class TDesC16 const &)
+	?Cancel@CApaFsMonitor@@QAEXXZ @ 13 NONAME ; void CApaFsMonitor::Cancel(void)
+	?ApaServThreadStart@@YAHPAX@Z @ 14 NONAME ; int ApaServThreadStart(void *)
+	??1CUpdatedAppsList@@UAE@XZ @ 15 NONAME ABSENT ; CUpdatedAppsList::~CUpdatedAppsList(void)
+	?CloseAndDeletePermanentStore@CUpdatedAppsList@@QAEXXZ @ 16 NONAME ABSENT ; void CUpdatedAppsList::CloseAndDeletePermanentStore(void)
+	?IsInList@CUpdatedAppsList@@QBEHABVTDesC16@@@Z @ 17 NONAME ABSENT ; int CUpdatedAppsList::IsInList(class TDesC16 const &) const
+	?RescanCallBack@CApaAppListServer@@QAE?AVTCallBack@@XZ @ 18 NONAME ; class TCallBack CApaAppListServer::RescanCallBack(void)
+	?KApaLoadDataRecognizersOnDemand@@3HB @ 19 NONAME DATA 4 ; int const KApaLoadDataRecognizersOnDemand
+	?KApaUnloadRecognizersTimeout@@3HB @ 20 NONAME DATA 4 ; int const KApaUnloadRecognizersTimeout
+	?HandleEndUninstallEventL@CApaAppListServer@@QAEXXZ @ 21 NONAME ; void CApaAppListServer::HandleEndUninstallEventL(void)
+	?HandleStartUninstallEvent@CApaAppListServer@@QAEXXZ @ 22 NONAME ; void CApaAppListServer::HandleStartUninstallEvent(void)
+	?KApaDrivesToMonitor@@3HB @ 23 NONAME ; int const KApaDrivesToMonitor
+	?KApaLoadMbmIconsOnDemand@@3HB @ 24 NONAME ; int const KApaLoadMbmIconsOnDemand
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/bwins/EXEDLLAPPU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1 @@
+EXPORTS ?WinsMain@@YAHPAVTDesC16@@@Z @ 1 NONAME ; int __cdecl WinsMain(class TDesC16 *)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/bwins/ServiceRegistryU.def	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,7 @@
+EXPORTS
+	??1CServiceRegistry@@UAE@XZ @ 1 NONAME ; CServiceRegistry::~CServiceRegistry(void)
+	?GetDefault@CServiceRegistry@@QAEHVTUid@@ABVTDataType@@AAV2@@Z @ 2 NONAME ; int CServiceRegistry::GetDefault(class TUid, class TDataType const &, class TUid &)
+	?NewL@CServiceRegistry@@SAPAV1@XZ @ 3 NONAME ; class CServiceRegistry * CServiceRegistry::NewL(void)
+	?RemoveEntry@CServiceRegistry@@QAEHVTUid@@ABVTDataType@@@Z @ 4 NONAME ; int CServiceRegistry::RemoveEntry(class TUid, class TDataType const &)
+	?SetDefault@CServiceRegistry@@QAEHVTUid@@ABVTDataType@@0@Z @ 5 NONAME ; int CServiceRegistry::SetDefault(class TUid, class TDataType const &, class TUid)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/bwins/TDONOTHINGFILERECOGNIZERU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?CreateRecognizer@@YAPAVCApaFileRecognizerType@@XZ @ 1 NONAME ; class CApaFileRecognizerType * CreateRecognizer(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/bwins/TICONFORLEAKSV2u.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,294 @@
+EXPORTS
+	??0CDataRecognitionResultArray@@QAE@XZ @ 1 NONAME ; CDataRecognitionResultArray::CDataRecognitionResultArray(void)
+	??0MApaAppListServObserver@@IAE@XZ @ 2 NONAME ; MApaAppListServObserver::MApaAppListServObserver(void)
+	??0RApaLsSession@@QAE@XZ @ 3 NONAME ; RApaLsSession::RApaLsSession(void)
+	??0TApaPictureFactory@@IAE@XZ @ 4 NONAME ; TApaPictureFactory::TApaPictureFactory(void)
+	??0TApaPictureFactory@@QAE@PAVCApaProcess@@@Z @ 5 NONAME ; TApaPictureFactory::TApaPictureFactory(class CApaProcess *)
+	??0TApaTask@@QAE@AAVRWsSession@@@Z @ 6 NONAME ; TApaTask::TApaTask(class RWsSession &)
+	??0TApaTaskList@@QAE@AAVRWsSession@@@Z @ 7 NONAME ; TApaTaskList::TApaTaskList(class RWsSession &)
+	??1CApaAppData@@UAE@XZ @ 8 NONAME ; CApaAppData::~CApaAppData(void)
+	??1CApaAppInfoFileWriter@@UAE@XZ @ 9 NONAME ; CApaAppInfoFileWriter::~CApaAppInfoFileWriter(void)
+	??1CApaAppList@@UAE@XZ @ 10 NONAME ; CApaAppList::~CApaAppList(void)
+	??1CApaAppListNotifier@@UAE@XZ @ 11 NONAME ; CApaAppListNotifier::~CApaAppListNotifier(void)
+	??1CApaDoor@@UAE@XZ @ 12 NONAME ; CApaDoor::~CApaDoor(void)
+	??1CApaLocalisableResourceFileWriter@@UAE@XZ @ 13 NONAME ; CApaLocalisableResourceFileWriter::~CApaLocalisableResourceFileWriter(void)
+	??1CApaMaskedBitmap@@UAE@XZ @ 14 NONAME ; CApaMaskedBitmap::~CApaMaskedBitmap(void)
+	??1CApaRegistrationResourceFileWriter@@UAE@XZ @ 15 NONAME ; CApaRegistrationResourceFileWriter::~CApaRegistrationResourceFileWriter(void)
+	??1CApaSystemControlList@@UAE@XZ @ 16 NONAME ; CApaSystemControlList::~CApaSystemControlList(void)
+	??1CApaWindowGroupName@@UAE@XZ @ 17 NONAME ; CApaWindowGroupName::~CApaWindowGroupName(void)
+	??1CDataRecognitionResultArray@@UAE@XZ @ 18 NONAME ; CDataRecognitionResultArray::~CDataRecognitionResultArray(void)
+	?AddCaptionL@CApaAppInfoFileWriter@@QAEXW4TLanguage@@ABVTDesC16@@@Z @ 19 NONAME ; void CApaAppInfoFileWriter::AddCaptionL(enum TLanguage, class TDesC16 const &)
+	?AddDataTypeL@CApaAppInfoFileWriter@@QAEXABVTDataTypeWithPriority@@@Z @ 20 NONAME ; void CApaAppInfoFileWriter::AddDataTypeL(class TDataTypeWithPriority const &)
+	?AddDataTypeL@CApaRegistrationResourceFileWriter@@QAEXHABVTDesC8@@@Z @ 21 NONAME ; void CApaRegistrationResourceFileWriter::AddDataTypeL(int, class TDesC8 const &)
+	?AddFileOwnershipInfoL@CApaRegistrationResourceFileWriter@@QAEXABVTDesC16@@@Z @ 22 NONAME ; void CApaRegistrationResourceFileWriter::AddFileOwnershipInfoL(class TDesC16 const &)
+	?AddForcedRegistrationL@CApaAppList@@QAEXPAVHBufC16@@@Z @ 23 NONAME ; void CApaAppList::AddForcedRegistrationL(class HBufC16 *)
+	?AddIconL@CApaAppInfoFileWriter@@QAEXAAVCApaMaskedBitmap@@@Z @ 24 NONAME ; void CApaAppInfoFileWriter::AddIconL(class CApaMaskedBitmap &)
+	?AppCount@RApaLsSession@@QBEHAAH@Z @ 25 NONAME ; int RApaLsSession::AppCount(int &) const
+	?AppDataByFileName@CApaAppList@@QBEPAVCApaAppData@@ABVTDesC16@@@Z @ 26 NONAME ; class CApaAppData * CApaAppList::AppDataByFileName(class TDesC16 const &) const
+	?AppDataByUid@CApaAppList@@QBEPAVCApaAppData@@VTUid@@@Z @ 27 NONAME ; class CApaAppData * CApaAppList::AppDataByUid(class TUid) const
+	?AppEntry@CApaAppData@@QBE?AVTApaAppEntry@@XZ @ 28 NONAME ; class TApaAppEntry CApaAppData::AppEntry(void) const
+	?AppForDataType@RApaLsSession@@QBEHABVTDataType@@AAVTUid@@@Z @ 29 NONAME ; int RApaLsSession::AppForDataType(class TDataType const &, class TUid &) const
+	?AppForDataTypeAndService@RApaLsSession@@QBEHABVTDataType@@VTUid@@AAV3@@Z @ 30 NONAME ; int RApaLsSession::AppForDataTypeAndService(class TDataType const &, class TUid, class TUid &) const
+	?AppForDocument@RApaLsSession@@QBEHABVRFile@@AAVTUid@@AAVTDataType@@@Z @ 31 NONAME ; int RApaLsSession::AppForDocument(class RFile const &, class TUid &, class TDataType &) const
+	?AppForDocument@RApaLsSession@@QBEHABVTDesC16@@AAVTUid@@AAVTDataType@@@Z @ 32 NONAME ; int RApaLsSession::AppForDocument(class TDesC16 const &, class TUid &, class TDataType &) const
+	?AppForDocumentAndService@RApaLsSession@@QBEHABVRFile@@VTUid@@AAV3@AAVTDataType@@@Z @ 33 NONAME ; int RApaLsSession::AppForDocumentAndService(class RFile const &, class TUid, class TUid &, class TDataType &) const
+	?AppForDocumentAndService@RApaLsSession@@QBEHABVTDesC16@@VTUid@@AAV3@AAVTDataType@@@Z @ 34 NONAME ; int RApaLsSession::AppForDocumentAndService(class TDesC16 const &, class TUid, class TUid &, class TDataType &) const
+	?AppScanInProgress@CApaAppList@@QBEHXZ @ 35 NONAME ; int CApaAppList::AppScanInProgress(void) const
+	?AppUid@CApaWindowGroupName@@QBE?AVTUid@@XZ @ 36 NONAME ; class TUid CApaWindowGroupName::AppUid(void) const
+	?AppUidL@CApaDoor@@QBE?AVTUid@@XZ @ 37 NONAME ; class TUid CApaDoor::AppUidL(void) const
+	?ApplicationLanguage@CApaAppData@@QBE?AW4TLanguage@@XZ @ 38 NONAME ; enum TLanguage CApaAppData::ApplicationLanguage(void) const
+	?ApplicationLanguage@RApaLsSession@@QBEHVTUid@@AAW4TLanguage@@@Z @ 39 NONAME ; int RApaLsSession::ApplicationLanguage(class TUid, enum TLanguage &) const
+	?BringToForeground@TApaTask@@QAEXXZ @ 40 NONAME ; void TApaTask::BringToForeground(void)
+	?CanUseScreenMode@CApaAppData@@QAEHH@Z @ 41 NONAME ; int CApaAppData::CanUseScreenMode(int)
+	?CancelListPopulationCompleteObserver@RApaLsSession@@QBEHXZ @ 42 NONAME ; int RApaLsSession::CancelListPopulationCompleteObserver(void) const
+	?CancelNotify@RApaLsSession@@QAEXXZ @ 43 NONAME ; void RApaLsSession::CancelNotify(void)
+	?CancelNotifyOnDataMappingChange@RApaLsSession@@QAEXXZ @ 44 NONAME ; void RApaLsSession::CancelNotifyOnDataMappingChange(void)
+	?CancelRecognizeFiles@RApaLsSession@@QAEXXZ @ 45 NONAME ; void RApaLsSession::CancelRecognizeFiles(void)
+	?Capability@CApaAppData@@QBEXAAVTDes8@@@Z @ 46 NONAME ; void CApaAppData::Capability(class TDes8 &) const
+	?Caption@CApaSystemControl@@QBE?AVTPtrC16@@XZ @ 47 NONAME ; class TPtrC16 CApaSystemControl::Caption(void) const
+	?Caption@CApaWindowGroupName@@QBE?AVTPtrC16@@XZ @ 48 NONAME ; class TPtrC16 CApaWindowGroupName::Caption(void) const
+	?CheckAppSecurity@CApaSecurityUtils@@SAHABVTPtrC16@@AAH1@Z @ 49 NONAME ; int CApaSecurityUtils::CheckAppSecurity(class TPtrC16 const &, int &, int &)
+	?CheckInterimFormatFileNotCorruptL@ForJavaMIDletInstaller@@SAXAAVRFile@@@Z @ 50 NONAME ; void ForJavaMIDletInstaller::CheckInterimFormatFileNotCorruptL(class RFile &)
+	?ClearFsSession@RApaLsSession@@SAXXZ @ 51 NONAME ; void RApaLsSession::ClearFsSession(void)
+	?Close@RApaLsSession@@QAEXXZ @ 52 NONAME ; void RApaLsSession::Close(void)
+	?CommitNonNativeApplicationsUpdatesL@RApaLsSession@@QAEXXZ @ 53 NONAME ; void RApaLsSession::CommitNonNativeApplicationsUpdatesL(void)
+	?CompareStrings@CApaAppList@@SAHABVHBufC16@@0@Z @ 54 NONAME ; int CApaAppList::CompareStrings(class HBufC16 const &, class HBufC16 const &)
+	?Connect@RApaLsSession@@QAEHXZ @ 55 NONAME ; int RApaLsSession::Connect(void)
+	?ConstructFromWgIdL@CApaWindowGroupName@@QAEXH@Z @ 56 NONAME ; void CApaWindowGroupName::ConstructFromWgIdL(int)
+	?Control@CApaSystemControlList@@QBEPAVCApaSystemControl@@H@Z @ 57 NONAME ; class CApaSystemControl * CApaSystemControlList::Control(int) const
+	?Control@CApaSystemControlList@@QBEPAVCApaSystemControl@@VTUid@@@Z @ 58 NONAME ; class CApaSystemControl * CApaSystemControlList::Control(class TUid) const
+	?Count@CApaAppList@@QBEHXZ @ 59 NONAME ; int CApaAppList::Count(void) const
+	?Count@CApaSystemControlList@@QBEHXZ @ 60 NONAME ; int CApaSystemControlList::Count(void) const
+	?Count@CDataRecognitionResultArray@@QBEIXZ @ 61 NONAME ; unsigned int CDataRecognitionResultArray::Count(void) const
+	?CreateDocument@RApaLsSession@@QAEHABVTDesC16@@VTUid@@AAVTThreadId@@W4TLaunchType@1@@Z @ 62 NONAME ; int RApaLsSession::CreateDocument(class TDesC16 const &, class TUid, class TThreadId &, enum RApaLsSession::TLaunchType)
+	?CreateL@CApaSystemControl@@QAEXXZ @ 63 NONAME ; void CApaSystemControl::CreateL(void)
+	?CycleTasks@TApaTaskList@@QAEHVTUid@@W4TCycleDirection@1@@Z @ 64 NONAME ; int TApaTaskList::CycleTasks(class TUid, enum TApaTaskList::TCycleDirection)
+	?DataType@CApaAppData@@QBEJABVTDataType@@@Z @ 65 NONAME ; long CApaAppData::DataType(class TDataType const &) const
+	?DataTypes@TApaAppServiceInfo@@QBEABV?$CArrayFixFlat@VTDataTypeWithPriority@@@@XZ @ 66 NONAME ; class CArrayFixFlat<class TDataTypeWithPriority> const & TApaAppServiceInfo::DataTypes(void) const
+	?DefaultScreenNumber@CApaAppData@@QBEIXZ @ 67 NONAME ; unsigned int CApaAppData::DefaultScreenNumber(void) const
+	?DeleteDataMapping@RApaLsSession@@QAEHABVTDataType@@@Z @ 68 NONAME ; int RApaLsSession::DeleteDataMapping(class TDataType const &)
+	?DeleteDataMapping@RApaLsSession@@QAEHABVTDataType@@VTUid@@@Z @ 69 NONAME ; int RApaLsSession::DeleteDataMapping(class TDataType const &, class TUid)
+	?DeregisterNonNativeApplicationL@RApaLsSession@@QAEXVTUid@@@Z @ 70 NONAME ; void RApaLsSession::DeregisterNonNativeApplicationL(class TUid)
+	?DeregisterNonNativeApplicationTypeL@RApaLsSession@@QAEXVTUid@@@Z @ 71 NONAME ; void RApaLsSession::DeregisterNonNativeApplicationTypeL(class TUid)
+	?DocName@CApaWindowGroupName@@QBE?AVTPtrC16@@XZ @ 72 NONAME ; class TPtrC16 CApaWindowGroupName::DocName(void) const
+	?DocNameIsAFile@CApaWindowGroupName@@QBEHXZ @ 73 NONAME ; int CApaWindowGroupName::DocNameIsAFile(void) const
+	?DocumentL@CApaDoor@@QAEPAVCApaDocument@@H@Z @ 74 NONAME ; class CApaDocument * CApaDoor::DocumentL(int)
+	?EmbeddableAppCount@RApaLsSession@@QBEHAAH@Z @ 75 NONAME ; int RApaLsSession::EmbeddableAppCount(int &) const
+	?EndTask@TApaTask@@QAEXXZ @ 76 NONAME ; void TApaTask::EndTask(void)
+	?Exists@TApaTask@@QBEHXZ @ 77 NONAME ; int TApaTask::Exists(void) const
+	?ExternalizeL@CApaMaskedBitmap@@QBEXAAVRWriteStream@@@Z @ 78 NONAME ; void CApaMaskedBitmap::ExternalizeL(class RWriteStream &) const
+	?FileName@CApaSystemControl@@QBE?AV?$TBuf@$0BAA@@@XZ @ 79 NONAME ; class TBuf<256> CApaSystemControl::FileName(void) const
+	?FindAndAddSpecificAppL@CApaAppList@@QAEPAVCApaAppData@@PAVCApaAppRegFinder@@VTUid@@@Z @ 80 NONAME ; class CApaAppData * CApaAppList::FindAndAddSpecificAppL(class CApaAppRegFinder *, class TUid)
+	?FindApp@TApaTaskList@@QAE?AVTApaTask@@ABVTDesC16@@@Z @ 81 NONAME ; class TApaTask TApaTaskList::FindApp(class TDesC16 const &)
+	?FindApp@TApaTaskList@@QAE?AVTApaTask@@VTUid@@@Z @ 82 NONAME ; class TApaTask TApaTaskList::FindApp(class TUid)
+	?FindByAppUid@CApaWindowGroupName@@SAXVTUid@@AAVRWsSession@@AAH@Z @ 83 NONAME ; void CApaWindowGroupName::FindByAppUid(class TUid, class RWsSession &, int &)
+	?FindByCaption@CApaWindowGroupName@@SAXABVTDesC16@@AAVRWsSession@@AAH@Z @ 84 NONAME ; void CApaWindowGroupName::FindByCaption(class TDesC16 const &, class RWsSession &, int &)
+	?FindByDocName@CApaWindowGroupName@@SAXABVTDesC16@@AAVRWsSession@@AAH@Z @ 85 NONAME ; void CApaWindowGroupName::FindByDocName(class TDesC16 const &, class RWsSession &, int &)
+	?FindByPos@TApaTaskList@@QAE?AVTApaTask@@H@Z @ 86 NONAME ; class TApaTask TApaTaskList::FindByPos(int)
+	?FindDoc@TApaTaskList@@QAE?AVTApaTask@@ABVTDesC16@@@Z @ 87 NONAME ; class TApaTask TApaTaskList::FindDoc(class TDesC16 const &)
+	?FirstApp@CApaAppList@@QBEPAVCApaAppData@@H@Z @ 88 NONAME ; class CApaAppData * CApaAppList::FirstApp(int) const
+	?FirstApp@CApaAppList@@QBEPAVCApaAppData@@XZ @ 89 NONAME ; class CApaAppData * CApaAppList::FirstApp(void) const
+	?ForceRegistration@RApaLsSession@@QAEHABV?$RPointerArray@VTDesC16@@@@@Z @ 90 NONAME ; int RApaLsSession::ForceRegistration(class RPointerArray<class TDesC16> const &)
+	?FsSession@RApaLsSession@@SAPAVRFs@@XZ @ 91 NONAME ; class RFs * RApaLsSession::FsSession(void)
+	?GetAcceptedConfidence@RApaLsSession@@QBEHAAH@Z @ 92 NONAME ; int RApaLsSession::GetAcceptedConfidence(int &) const
+	?GetAllApps@RApaLsSession@@QBEHH@Z @ 93 NONAME ; int RApaLsSession::GetAllApps(int) const
+	?GetAllApps@RApaLsSession@@QBEHXZ @ 94 NONAME ; int RApaLsSession::GetAllApps(void) const
+	?GetAppByDataType@RApaLsSession@@QBEHABVTDataType@@VTUid@@AAV3@@Z @ 95 NONAME ; int RApaLsSession::GetAppByDataType(class TDataType const &, class TUid, class TUid &) const
+	?GetAppCapability@RApaLsSession@@QBEHAAVTDes8@@VTUid@@@Z @ 96 NONAME ; int RApaLsSession::GetAppCapability(class TDes8 &, class TUid) const
+	?GetAppIcon@RApaLsSession@@QBEHVTUid@@AAPAVHBufC16@@@Z @ 97 NONAME ; int RApaLsSession::GetAppIcon(class TUid, class HBufC16 * &) const
+	?GetAppIcon@RApaLsSession@@QBEHVTUid@@AAVRFile@@@Z @ 98 NONAME ; int RApaLsSession::GetAppIcon(class TUid, class RFile &) const
+	?GetAppIcon@RApaLsSession@@QBEHVTUid@@HAAVCApaMaskedBitmap@@@Z @ 99 NONAME ; int RApaLsSession::GetAppIcon(class TUid, int, class CApaMaskedBitmap &) const
+	?GetAppIcon@RApaLsSession@@QBEHVTUid@@VTSize@@AAVCApaMaskedBitmap@@@Z @ 100 NONAME ; int RApaLsSession::GetAppIcon(class TUid, class TSize, class CApaMaskedBitmap &) const
+	?GetAppIconSizes@RApaLsSession@@QBEHVTUid@@AAV?$CArrayFixFlat@VTSize@@@@@Z @ 101 NONAME ; int RApaLsSession::GetAppIconSizes(class TUid, class CArrayFixFlat<class TSize> &) const
+	?GetAppInfo@RApaLsSession@@QBEHAAVTApaAppInfo@@VTUid@@@Z @ 102 NONAME ; int RApaLsSession::GetAppInfo(class TApaAppInfo &, class TUid) const
+	?GetAppOwnedFiles@RApaLsSession@@QBEHAAVCDesC16Array@@VTUid@@@Z @ 103 NONAME ; int RApaLsSession::GetAppOwnedFiles(class CDesC16Array &, class TUid) const
+	?GetAppServiceOpaqueDataLC@RApaLsSession@@QBEPAVCApaAppServiceInfoArray@@VTUid@@0@Z @ 104 NONAME ; class CApaAppServiceInfoArray * RApaLsSession::GetAppServiceOpaqueDataLC(class TUid, class TUid) const
+	?GetAppServicesL@RApaLsSession@@QBEXVTUid@@AAV?$CArrayFixFlat@VTUid@@@@@Z @ 105 NONAME ; void RApaLsSession::GetAppServicesL(class TUid, class CArrayFixFlat<class TUid> &) const
+	?GetAppServicesLC@RApaLsSession@@QBEPAVCApaAppServiceInfoArray@@VTUid@@@Z @ 106 NONAME ; class CApaAppServiceInfoArray * RApaLsSession::GetAppServicesLC(class TUid) const
+	?GetAppType@RApaLsSession@@QBEHAAVTUid@@V2@@Z @ 107 NONAME ; int RApaLsSession::GetAppType(class TUid &, class TUid) const
+	?GetAppViewIcon@RApaLsSession@@QBEHVTUid@@0AAPAVHBufC16@@@Z @ 108 NONAME ; int RApaLsSession::GetAppViewIcon(class TUid, class TUid, class HBufC16 * &) const
+	?GetAppViewIcon@RApaLsSession@@QBEHVTUid@@0ABVTSize@@AAVCApaMaskedBitmap@@@Z @ 109 NONAME ; int RApaLsSession::GetAppViewIcon(class TUid, class TUid, class TSize const &, class CApaMaskedBitmap &) const
+	?GetAppViews@RApaLsSession@@QBEHAAV?$CArrayFixFlat@VTApaAppViewInfo@@@@VTUid@@@Z @ 110 NONAME ; int RApaLsSession::GetAppViews(class CArrayFixFlat<class TApaAppViewInfo> &, class TUid) const
+	?GetDataRecognitionResultL@CDataRecognitionResultArray@@QBEXAAVTDataRecognitionResult@@I@Z @ 111 NONAME ; void CDataRecognitionResultArray::GetDataRecognitionResultL(class TDataRecognitionResult &, unsigned int) const
+	?GetDefaultScreenNumber@RApaLsSession@@QBEHAAHVTUid@@@Z @ 112 NONAME ; int RApaLsSession::GetDefaultScreenNumber(int &, class TUid) const
+	?GetEmbeddableApps@RApaLsSession@@QBEHH@Z @ 113 NONAME ; int RApaLsSession::GetEmbeddableApps(int) const
+	?GetEmbeddableApps@RApaLsSession@@QBEHXZ @ 114 NONAME ; int RApaLsSession::GetEmbeddableApps(void) const
+	?GetFileNameL@CDataRecognitionResultArray@@QBEXAAV?$TBuf@$0BAA@@@I@Z @ 115 NONAME ; void CDataRecognitionResultArray::GetFileNameL(class TBuf<256> &, unsigned int) const
+	?GetFilteredApps@RApaLsSession@@QBEHABVTApaEmbeddabilityFilter@@@Z @ 116 NONAME ; int RApaLsSession::GetFilteredApps(class TApaEmbeddabilityFilter const &) const
+	?GetFilteredApps@RApaLsSession@@QBEHABVTApaEmbeddabilityFilter@@H@Z @ 117 NONAME ; int RApaLsSession::GetFilteredApps(class TApaEmbeddabilityFilter const &, int) const
+	?GetFilteredApps@RApaLsSession@@QBEHII@Z @ 118 NONAME ; int RApaLsSession::GetFilteredApps(unsigned int, unsigned int) const
+	?GetFilteredApps@RApaLsSession@@QBEHIIH@Z @ 119 NONAME ; int RApaLsSession::GetFilteredApps(unsigned int, unsigned int, int) const
+	?GetIconInfo@CApaAppData@@QBEXAAH0@Z @ 120 NONAME ; void CApaAppData::GetIconInfo(int &, int &) const
+	?GetJavaMIDletInfoL@ForJavaMIDletInstaller@@SAXAAVRFs@@ABVTDesC16@@AAK2@Z @ 121 NONAME ; void ForJavaMIDletInstaller::GetJavaMIDletInfoL(class RFs &, class TDesC16 const &, unsigned long &, unsigned long &)
+	?GetMaxDataBufSize@RApaLsSession@@QBEHAAH@Z @ 122 NONAME ; int RApaLsSession::GetMaxDataBufSize(int &) const
+	?GetNextApp@RApaLsSession@@QBEHAAVTApaAppInfo@@@Z @ 123 NONAME ; int RApaLsSession::GetNextApp(class TApaAppInfo &) const
+	?GetNextApp@RApaLsSession@@QBEHAAVTApaAppInfo@@H@Z @ 124 NONAME ; int RApaLsSession::GetNextApp(class TApaAppInfo &, int) const
+	?GetPreferredBufSize@RApaLsSession@@QBEHAAH@Z @ 125 NONAME ; int RApaLsSession::GetPreferredBufSize(int &) const
+	?GetServerApps@RApaLsSession@@QBEHVTUid@@@Z @ 126 NONAME ; int RApaLsSession::GetServerApps(class TUid) const
+	?GetServerApps@RApaLsSession@@QBEHVTUid@@H@Z @ 127 NONAME ; int RApaLsSession::GetServerApps(class TUid, int) const
+	?GetServiceImplementationsLC@RApaLsSession@@QBEPAVCApaAppServiceInfoArray@@VTUid@@@Z @ 128 NONAME ; class CApaAppServiceInfoArray * RApaLsSession::GetServiceImplementationsLC(class TUid) const
+	?GetServiceImplementationsLC@RApaLsSession@@QBEPAVCApaAppServiceInfoArray@@VTUid@@ABVTDataType@@@Z @ 129 NONAME ; class CApaAppServiceInfoArray * RApaLsSession::GetServiceImplementationsLC(class TUid, class TDataType const &) const
+	?GetSupportedDataTypesL@RApaLsSession@@QBEHAAV?$CArrayFixFlat@VTDataType@@@@@Z @ 130 NONAME ; int RApaLsSession::GetSupportedDataTypesL(class CArrayFixFlat<class TDataType> &) const
+	?HandleAsRegistrationFile@ApaUtils@@SAHABVTUidType@@@Z @ 131 NONAME ; int ApaUtils::HandleAsRegistrationFile(class TUidType const &)
+	?Hidden@CApaWindowGroupName@@QBEHXZ @ 132 NONAME ; int CApaWindowGroupName::Hidden(void) const
+	?Icon@CApaAppData@@QBEPAVCApaMaskedBitmap@@H@Z @ 133 NONAME ; class CApaMaskedBitmap * CApaAppData::Icon(int) const
+	?Icon@CApaAppData@@QBEPAVCApaMaskedBitmap@@VTSize@@@Z @ 134 NONAME ; class CApaMaskedBitmap * CApaAppData::Icon(class TSize) const
+	?Icon@CApaAppViewData@@QBEPAVCApaMaskedBitmap@@ABVTSize@@@Z @ 135 NONAME ; class CApaMaskedBitmap * CApaAppViewData::Icon(class TSize const &) const
+	?Icon@CApaSystemControl@@QBEPAVCApaMaskedBitmap@@XZ @ 136 NONAME ; class CApaMaskedBitmap * CApaSystemControl::Icon(void) const
+	?IconFileName@CApaAppData@@QBE?AVTPtrC16@@XZ @ 137 NONAME ; class TPtrC16 CApaAppData::IconFileName(void) const
+	?IconFileName@CApaAppViewData@@QBE?AVTPtrC16@@XZ @ 138 NONAME ; class TPtrC16 CApaAppViewData::IconFileName(void) const
+	?IconSizesL@CApaAppData@@QBEPAV?$CArrayFixFlat@VTSize@@@@XZ @ 139 NONAME ; class CArrayFixFlat<class TSize> * CApaAppData::IconSizesL(void) const
+	?IconSizesL@CApaAppViewData@@QBEPAV?$CArrayFixFlat@VTSize@@@@XZ @ 140 NONAME ; class CArrayFixFlat<class TSize> * CApaAppViewData::IconSizesL(void) const
+	?ImplementsService@CApaAppData@@QBEHVTUid@@@Z @ 141 NONAME ; int CApaAppData::ImplementsService(class TUid) const
+	?Index@CApaSystemControlList@@QBEHVTUid@@@Z @ 142 NONAME ; int CApaSystemControlList::Index(class TUid) const
+	?InitListL@CApaAppList@@QAEXPAVMApaAppListObserver@@@Z @ 143 NONAME ; void CApaAppList::InitListL(class MApaAppListObserver *)
+	?InsertDataMapping@RApaLsSession@@QAEHABVTDataType@@JVTUid@@1@Z @ 144 NONAME ; int RApaLsSession::InsertDataMapping(class TDataType const &, long, class TUid, class TUid)
+	?InsertDataMapping@RApaLsSession@@QAEHABVTDataType@@JVTUid@@@Z @ 145 NONAME ; int RApaLsSession::InsertDataMapping(class TDataType const &, long, class TUid)
+	?InsertDataMappingIfHigher@RApaLsSession@@QAEHABVTDataType@@JVTUid@@AAH@Z @ 146 NONAME ; int RApaLsSession::InsertDataMappingIfHigher(class TDataType const &, long, class TUid, int &)
+	?InternalizeL@CApaMaskedBitmap@@QAEXAAVRReadStream@@@Z @ 147 NONAME ; void CApaMaskedBitmap::InternalizeL(class RReadStream &)
+	?IsAppReady@CApaWindowGroupName@@QBEHXZ @ 148 NONAME ; int CApaWindowGroupName::IsAppReady(void) const
+	?IsBusy@CApaWindowGroupName@@QBEHXZ @ 149 NONAME ; int CApaWindowGroupName::IsBusy(void) const
+	?IsFirstScanComplete@CApaAppList@@QBEHXZ @ 150 NONAME ; int CApaAppList::IsFirstScanComplete(void) const
+	?IsIdleUpdateComplete@CApaAppList@@QBEHXZ @ 151 NONAME ; int CApaAppList::IsIdleUpdateComplete(void) const
+	?IsLanguageChangePending@CApaAppList@@QBEHXZ @ 152 NONAME ; int CApaAppList::IsLanguageChangePending(void) const
+	?IsPending@CApaAppData@@QBEHXZ @ 153 NONAME ; int CApaAppData::IsPending(void) const
+	?IsProgram@RApaLsSession@@QBEHABVTDesC16@@AAH@Z @ 154 NONAME ; int RApaLsSession::IsProgram(class TDesC16 const &, int &) const
+	?IsSystem@CApaWindowGroupName@@QBEHXZ @ 155 NONAME ; int CApaWindowGroupName::IsSystem(void) const
+	?KillTask@TApaTask@@QAEXXZ @ 156 NONAME ; void TApaTask::KillTask(void)
+	?LocalisableResourceFileName@CApaAppData@@QBE?AVTPtrC16@@XZ @ 157 NONAME ; class TPtrC16 CApaAppData::LocalisableResourceFileName(void) const
+	?MApaAppListServObserver_Reserved1@MApaAppListServObserver@@EAEXXZ @ 158 NONAME ; void MApaAppListServObserver::MApaAppListServObserver_Reserved1(void)
+	?MApaAppListServObserver_Reserved2@MApaAppListServObserver@@EAEXXZ @ 159 NONAME ; void MApaAppListServObserver::MApaAppListServObserver_Reserved2(void)
+	?Mask@CApaMaskedBitmap@@QBEPAVCFbsBitmap@@XZ @ 160 NONAME ; class CFbsBitmap * CApaMaskedBitmap::Mask(void) const
+	?MatchesSecurityPolicy@RApaLsSession@@QBEHAAHVTUid@@ABVTSecurityPolicy@@@Z @ 161 NONAME ; int RApaLsSession::MatchesSecurityPolicy(int &, class TUid, class TSecurityPolicy const &) const
+	?MinApplicationStackSize@@YAIXZ @ 162 NONAME ; unsigned int MinApplicationStackSize(void)
+	?New@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@PAVHBufC16@@@Z @ 163 NONAME ; class CApaWindowGroupName * CApaWindowGroupName::New(class RWsSession const &, class HBufC16 *)
+	?NewInterimFormatFileWriterLC@ForJavaMIDletInstaller@@SAPAVCApaAppInfoFileWriter@@AAVRFs@@ABVTDesC16@@VTUid@@KH@Z @ 164 NONAME ; class CApaAppInfoFileWriter * ForJavaMIDletInstaller::NewInterimFormatFileWriterLC(class RFs &, class TDesC16 const &, class TUid, unsigned long, int)
+	?NewL@CApaAppData@@SAPAV1@ABVTApaAppEntry@@AAVRFs@@ABVTDesC16@@@Z @ 165 NONAME ; class CApaAppData * CApaAppData::NewL(class TApaAppEntry const &, class RFs &, class TDesC16 const &)
+	?NewL@CApaAppList@@SAPAV1@AAVRFs@@PAVCApaAppRegFinder@@HH@Z @ 166 NONAME ; class CApaAppList * CApaAppList::NewL(class RFs &, class CApaAppRegFinder *, int, int)
+	?NewL@CApaAppListNotifier@@SAPAV1@PAVMApaAppListServObserver@@W4TPriority@CActive@@@Z @ 167 NONAME ; class CApaAppListNotifier * CApaAppListNotifier::NewL(class MApaAppListServObserver *, enum CActive::TPriority)
+	?NewL@CApaDoor@@SAPAV1@AAVRFs@@AAVCApaDocument@@ABVTSize@@@Z @ 168 NONAME ; class CApaDoor * CApaDoor::NewL(class RFs &, class CApaDocument &, class TSize const &)
+	?NewL@CApaDoor@@SAPAV1@AAVRFs@@ABVCStreamStore@@VTStreamId@@AAVCApaProcess@@@Z @ 169 NONAME ; class CApaDoor * CApaDoor::NewL(class RFs &, class CStreamStore const &, class TStreamId, class CApaProcess &)
+	?NewL@CApaLocalisableResourceFileWriter@@SAPAV1@ABVTDesC16@@0H0@Z @ 170 NONAME ; class CApaLocalisableResourceFileWriter * CApaLocalisableResourceFileWriter::NewL(class TDesC16 const &, class TDesC16 const &, int, class TDesC16 const &)
+	?NewL@CApaMaskedBitmap@@SAPAV1@PBV1@@Z @ 171 NONAME ; class CApaMaskedBitmap * CApaMaskedBitmap::NewL(class CApaMaskedBitmap const *)
+	?NewL@CApaRegistrationResourceFileWriter@@SAPAV1@VTUid@@ABVTDesC16@@I@Z @ 172 NONAME ; class CApaRegistrationResourceFileWriter * CApaRegistrationResourceFileWriter::NewL(class TUid, class TDesC16 const &, unsigned int)
+	?NewL@CApaSystemControlList@@SAPAV1@AAVRFs@@@Z @ 173 NONAME ; class CApaSystemControlList * CApaSystemControlList::NewL(class RFs &)
+	?NewL@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@@Z @ 174 NONAME ; class CApaWindowGroupName * CApaWindowGroupName::NewL(class RWsSession const &)
+	?NewL@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@ABVTDesC16@@@Z @ 175 NONAME ; class CApaWindowGroupName * CApaWindowGroupName::NewL(class RWsSession const &, class TDesC16 const &)
+	?NewL@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@H@Z @ 176 NONAME ; class CApaWindowGroupName * CApaWindowGroupName::NewL(class RWsSession const &, int)
+	?NewLC@CApaDoor@@SAPAV1@AAVRFs@@AAVCApaDocument@@ABVTSize@@@Z @ 177 NONAME ; class CApaDoor * CApaDoor::NewLC(class RFs &, class CApaDocument &, class TSize const &)
+	?NewLC@CApaMaskedBitmap@@SAPAV1@XZ @ 178 NONAME ; class CApaMaskedBitmap * CApaMaskedBitmap::NewLC(void)
+	?NewLC@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@@Z @ 179 NONAME ; class CApaWindowGroupName * CApaWindowGroupName::NewLC(class RWsSession const &)
+	?NewLC@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@ABVTDesC16@@@Z @ 180 NONAME ; class CApaWindowGroupName * CApaWindowGroupName::NewLC(class RWsSession const &, class TDesC16 const &)
+	?NewLC@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@H@Z @ 181 NONAME ; class CApaWindowGroupName * CApaWindowGroupName::NewLC(class RWsSession const &, int)
+	?NewPictureL@TApaPictureFactory@@UBEXAAVTPictureHeader@@ABVCStreamStore@@@Z @ 182 NONAME ; void TApaPictureFactory::NewPictureL(class TPictureHeader &, class CStreamStore const &) const
+	?NextApp@CApaAppList@@QBEPAVCApaAppData@@PBV2@@Z @ 183 NONAME ; class CApaAppData * CApaAppList::NextApp(class CApaAppData const *) const
+	?NextApp@CApaAppList@@QBEPAVCApaAppData@@PBV2@H@Z @ 184 NONAME ; class CApaAppData * CApaAppList::NextApp(class CApaAppData const *, int) const
+	?NonMbmIconFile@CApaAppData@@QBEHXZ @ 185 NONAME ; int CApaAppData::NonMbmIconFile(void) const
+	?NonMbmIconFile@CApaAppViewData@@QBEHXZ @ 186 NONAME ; int CApaAppViewData::NonMbmIconFile(void) const
+	?NonNativeApplicationType@CApaAppData@@QBE?AVTUid@@XZ @ 187 NONAME ; class TUid CApaAppData::NonNativeApplicationType(void) const
+	?NotifyOnDataMappingChange@RApaLsSession@@QAEXAAVTRequestStatus@@@Z @ 188 NONAME ; void RApaLsSession::NotifyOnDataMappingChange(class TRequestStatus &)
+	?NumberOfOwnDefinedIcons@RApaLsSession@@QBEHVTUid@@AAH@Z @ 189 NONAME ; int RApaLsSession::NumberOfOwnDefinedIcons(class TUid, int &) const
+	?OpaqueData@CApaAppData@@QBE?AVTPtrC8@@XZ @ 190 NONAME ; class TPtrC8 CApaAppData::OpaqueData(void) const
+	?OpaqueData@TApaAppServiceInfo@@QBEABVTDesC8@@XZ @ 191 NONAME ; class TDesC8 const & TApaAppServiceInfo::OpaqueData(void) const
+	?OwnedFiles@CApaAppData@@QBEPAVCDesC16Array@@XZ @ 192 NONAME ; class CDesC16Array * CApaAppData::OwnedFiles(void) const
+	?Path@CDataRecognitionResultArray@@QBEABV?$TBuf@$0BAA@@@XZ @ 193 NONAME ; class TBuf<256> const & CDataRecognitionResultArray::Path(void) const
+	?PreferredDataHandlerL@CApaAppList@@QBE?AVTUid@@ABVTDataType@@@Z @ 194 NONAME ; class TUid CApaAppList::PreferredDataHandlerL(class TDataType const &) const
+	?PreferredDataHandlerL@CApaAppList@@QBE?AVTUid@@ABVTDataType@@PBV2@AAH@Z @ 195 NONAME ; class TUid CApaAppList::PreferredDataHandlerL(class TDataType const &, class TUid const *, int &) const
+	?PrepareNonNativeApplicationsUpdatesL@RApaLsSession@@QAEXXZ @ 196 NONAME ; void RApaLsSession::PrepareNonNativeApplicationsUpdatesL(void)
+	?PurgeL@CApaAppList@@QAEXXZ @ 197 NONAME ; void CApaAppList::PurgeL(void)
+	?RApaLsSession_Reserved1@RApaLsSession@@EAEXXZ @ 198 NONAME ; void RApaLsSession::RApaLsSession_Reserved1(void)
+	?RApaLsSession_Reserved2@RApaLsSession@@EAEXXZ @ 199 NONAME ; void RApaLsSession::RApaLsSession_Reserved2(void)
+	?RecognizeData@RApaLsSession@@QBEHABVRFile@@AAVTDataRecognitionResult@@@Z @ 200 NONAME ; int RApaLsSession::RecognizeData(class RFile const &, class TDataRecognitionResult &) const
+	?RecognizeData@RApaLsSession@@QBEHABVTDesC16@@ABVTDesC8@@AAVTDataRecognitionResult@@@Z @ 201 NONAME ; int RApaLsSession::RecognizeData(class TDesC16 const &, class TDesC8 const &, class TDataRecognitionResult &) const
+	?RecognizeFilesL@RApaLsSession@@QAEXABVTDesC16@@AAVCDataRecognitionResultArray@@AAVTRequestStatus@@@Z @ 202 NONAME ; void RApaLsSession::RecognizeFilesL(class TDesC16 const &, class CDataRecognitionResultArray &, class TRequestStatus &)
+	?RecognizeFilesL@RApaLsSession@@QAEXABVTDesC16@@ABVTDesC8@@AAVCDataRecognitionResultArray@@AAVTRequestStatus@@@Z @ 203 NONAME ; void RApaLsSession::RecognizeFilesL(class TDesC16 const &, class TDesC8 const &, class CDataRecognitionResultArray &, class TRequestStatus &)
+	?RecognizeFilesL@RApaLsSession@@QBEHABVTDesC16@@AAVCDataRecognitionResultArray@@@Z @ 204 NONAME ; int RApaLsSession::RecognizeFilesL(class TDesC16 const &, class CDataRecognitionResultArray &) const
+	?RecognizeFilesL@RApaLsSession@@QBEHABVTDesC16@@ABVTDesC8@@AAVCDataRecognitionResultArray@@@Z @ 205 NONAME ; int RApaLsSession::RecognizeFilesL(class TDesC16 const &, class TDesC8 const &, class CDataRecognitionResultArray &) const
+	?RecognizeSpecificData@RApaLsSession@@QBEHABVRFile@@ABVTDataType@@AAH@Z @ 206 NONAME ; int RApaLsSession::RecognizeSpecificData(class RFile const &, class TDataType const &, int &) const
+	?RecognizeSpecificData@RApaLsSession@@QBEHABVTDesC16@@ABVTDesC8@@ABVTDataType@@AAH@Z @ 207 NONAME ; int RApaLsSession::RecognizeSpecificData(class TDesC16 const &, class TDesC8 const &, class TDataType const &, int &) const
+	?RegisterListPopulationCompleteObserver@RApaLsSession@@QBEXAAVTRequestStatus@@@Z @ 208 NONAME ; void RApaLsSession::RegisterListPopulationCompleteObserver(class TRequestStatus &) const
+	?RegisterNonNativeApplicationL@RApaLsSession@@QAEXVTUid@@ABVTDriveUnit@@AAVCApaRegistrationResourceFileWriter@@PAVCApaLocalisableResourceFileWriter@@PBVRFile@@@Z @ 209 NONAME ; void RApaLsSession::RegisterNonNativeApplicationL(class TUid, class TDriveUnit const &, class CApaRegistrationResourceFileWriter &, class CApaLocalisableResourceFileWriter *, class RFile const *)
+	?RegisterNonNativeApplicationTypeL@RApaLsSession@@QAEXVTUid@@ABVTDesC16@@@Z @ 210 NONAME ; void RApaLsSession::RegisterNonNativeApplicationTypeL(class TUid, class TDesC16 const &)
+	?RegistrationFileName@CApaAppData@@QBE?AVTPtrC16@@XZ @ 211 NONAME ; class TPtrC16 CApaAppData::RegistrationFileName(void) const
+	?RegistrationFileUsed@CApaAppData@@QBEHXZ @ 212 NONAME ; int CApaAppData::RegistrationFileUsed(void) const
+	?ResetForcedRegistrations@CApaAppList@@QAEXXZ @ 213 NONAME ; void CApaAppList::ResetForcedRegistrations(void)
+	?RespondsToShutdownEvent@CApaWindowGroupName@@QBEHXZ @ 214 NONAME ; int CApaWindowGroupName::RespondsToShutdownEvent(void) const
+	?RespondsToSwitchFilesEvent@CApaWindowGroupName@@QBEHXZ @ 215 NONAME ; int CApaWindowGroupName::RespondsToSwitchFilesEvent(void) const
+	?RestartScanL@CApaAppList@@QAEXXZ @ 216 NONAME ; void CApaAppList::RestartScanL(void)
+	?RestoreL@CApaDoor@@QAEXABVCStreamStore@@VTStreamId@@@Z @ 217 NONAME ; void CApaDoor::RestoreL(class CStreamStore const &, class TStreamId)
+	?RollbackNonNativeApplicationsUpdates@RApaLsSession@@QAEHXZ @ 218 NONAME ; int RApaLsSession::RollbackNonNativeApplicationsUpdates(void)
+	?ScreenMode@CApaAppViewData@@QBEHXZ @ 219 NONAME ; int CApaAppViewData::ScreenMode(void) const
+	?Self@CApaAppList@@SAPAV1@XZ @ 220 NONAME ; class CApaAppList * CApaAppList::Self(void)
+	?SendKey@TApaTask@@QAEXABUTKeyEvent@@@Z @ 221 NONAME ; void TApaTask::SendKey(struct TKeyEvent const &)
+	?SendKey@TApaTask@@QAEXHH@Z @ 222 NONAME ; void TApaTask::SendKey(int, int)
+	?SendMessage@TApaTask@@QAEHVTUid@@ABVTDesC8@@@Z @ 223 NONAME ; int TApaTask::SendMessage(class TUid, class TDesC8 const &)
+	?SendSystemEvent@TApaTask@@QAEXW4TApaSystemEvent@@@Z @ 224 NONAME ; void TApaTask::SendSystemEvent(enum TApaSystemEvent)
+	?SendToBackground@TApaTask@@QAEXXZ @ 225 NONAME ; void TApaTask::SendToBackground(void)
+	?ServiceArrayBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@@Z @ 226 NONAME ; class CBufFlat * CApaAppList::ServiceArrayBufferL(class TUid) const
+	?ServiceImplArrayBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@@Z @ 227 NONAME ; class CBufFlat * CApaAppList::ServiceImplArrayBufferL(class TUid) const
+	?ServiceImplArrayBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@ABVTDataType@@@Z @ 228 NONAME ; class CBufFlat * CApaAppList::ServiceImplArrayBufferL(class TUid, class TDataType const &) const
+	?ServiceOpaqueDataBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@0@Z @ 229 NONAME ; class CBufFlat * CApaAppList::ServiceOpaqueDataBufferL(class TUid, class TUid) const
+	?ServiceUidBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@@Z @ 230 NONAME ; class CBufFlat * CApaAppList::ServiceUidBufferL(class TUid) const
+	?SetAcceptedConfidence@RApaLsSession@@QAEHH@Z @ 231 NONAME ; int RApaLsSession::SetAcceptedConfidence(int)
+	?SetAppIsHiddenL@CApaRegistrationResourceFileWriter@@QAEXH@Z @ 232 NONAME ; void CApaRegistrationResourceFileWriter::SetAppIsHiddenL(int)
+	?SetAppReady@CApaWindowGroupName@@QAEXH@Z @ 233 NONAME ; void CApaWindowGroupName::SetAppReady(int)
+	?SetAppShortCaption@RApaLsSession@@QAEHABVTDesC16@@W4TLanguage@@VTUid@@@Z @ 234 NONAME ; int RApaLsSession::SetAppShortCaption(class TDesC16 const &, enum TLanguage, class TUid)
+	?SetAppUid@CApaWindowGroupName@@QAEXVTUid@@@Z @ 235 NONAME ; void CApaWindowGroupName::SetAppUid(class TUid)
+	?SetBusy@CApaWindowGroupName@@QAEXH@Z @ 236 NONAME ; void CApaWindowGroupName::SetBusy(int)
+	?SetCapability@CApaAppInfoFileWriter@@QAEHABVTDesC8@@@Z @ 237 NONAME ; int CApaAppInfoFileWriter::SetCapability(class TDesC8 const &)
+	?SetCaptionL@CApaWindowGroupName@@QAEXABVTDesC16@@@Z @ 238 NONAME ; void CApaWindowGroupName::SetCaptionL(class TDesC16 const &)
+	?SetDefaultScreenNumberL@CApaRegistrationResourceFileWriter@@QAEXH@Z @ 239 NONAME ; void CApaRegistrationResourceFileWriter::SetDefaultScreenNumberL(int)
+	?SetDocNameIsAFile@CApaWindowGroupName@@QAEXH@Z @ 240 NONAME ; void CApaWindowGroupName::SetDocNameIsAFile(int)
+	?SetDocNameL@CApaWindowGroupName@@QAEXABVTDesC16@@@Z @ 241 NONAME ; void CApaWindowGroupName::SetDocNameL(class TDesC16 const &)
+	?SetEmbeddabilityL@CApaRegistrationResourceFileWriter@@QAEXW4TEmbeddability@TApaAppCapability@@@Z @ 242 NONAME ; void CApaRegistrationResourceFileWriter::SetEmbeddabilityL(enum TApaAppCapability::TEmbeddability)
+	?SetFormatToGlassL@CApaDoor@@QAEXXZ @ 243 NONAME ; void CApaDoor::SetFormatToGlassL(void)
+	?SetFormatToIconL@CApaDoor@@QAEXXZ @ 244 NONAME ; void CApaDoor::SetFormatToIconL(void)
+	?SetFormatToTemporaryIconL@CApaDoor@@QAEXH@Z @ 245 NONAME ; void CApaDoor::SetFormatToTemporaryIconL(int)
+	?SetFsSessionL@RApaLsSession@@SAXAAVRFs@@@Z @ 246 NONAME ; void RApaLsSession::SetFsSessionL(class RFs &)
+	?SetGroupNameL@CApaRegistrationResourceFileWriter@@QAEXABVTDesC16@@@Z @ 247 NONAME ; void CApaRegistrationResourceFileWriter::SetGroupNameL(class TDesC16 const &)
+	?SetHidden@CApaWindowGroupName@@QAEXH@Z @ 248 NONAME ; void CApaWindowGroupName::SetHidden(int)
+	?SetLaunchInBackgroundL@CApaRegistrationResourceFileWriter@@QAEXH@Z @ 249 NONAME ; void CApaRegistrationResourceFileWriter::SetLaunchInBackgroundL(int)
+	?SetMaskBitmap@CApaMaskedBitmap@@QAEXPAVCFbsBitmap@@@Z @ 250 NONAME ; void CApaMaskedBitmap::SetMaskBitmap(class CFbsBitmap *)
+	?SetMaxDataBufSize@RApaLsSession@@QAEHH@Z @ 251 NONAME ; int RApaLsSession::SetMaxDataBufSize(int)
+	?SetNotify@RApaLsSession@@QAEXHAAVTRequestStatus@@@Z @ 252 NONAME ; void RApaLsSession::SetNotify(int, class TRequestStatus &)
+	?SetOpaqueDataL@CApaRegistrationResourceFileWriter@@QAEXABVTDesC8@@@Z @ 253 NONAME ; void CApaRegistrationResourceFileWriter::SetOpaqueDataL(class TDesC8 const &)
+	?SetRespondsToShutdownEvent@CApaWindowGroupName@@QAEXH@Z @ 254 NONAME ; void CApaWindowGroupName::SetRespondsToShutdownEvent(int)
+	?SetRespondsToSwitchFilesEvent@CApaWindowGroupName@@QAEXH@Z @ 255 NONAME ; void CApaWindowGroupName::SetRespondsToSwitchFilesEvent(int)
+	?SetShortCaptionL@CApaAppData@@QAEXABVTDesC16@@@Z @ 256 NONAME ; void CApaAppData::SetShortCaptionL(class TDesC16 const &)
+	?SetSupportsNewFileL@CApaRegistrationResourceFileWriter@@QAEXH@Z @ 257 NONAME ; void CApaRegistrationResourceFileWriter::SetSupportsNewFileL(int)
+	?SetSystem@CApaWindowGroupName@@QAEXH@Z @ 258 NONAME ; void CApaWindowGroupName::SetSystem(int)
+	?SetWgId@TApaTask@@QAEXH@Z @ 259 NONAME ; void TApaTask::SetWgId(int)
+	?SetWindowGroupName@CApaWindowGroupName@@QAEXPAVHBufC16@@@Z @ 260 NONAME ; void CApaWindowGroupName::SetWindowGroupName(class HBufC16 *)
+	?SetWindowGroupName@CApaWindowGroupName@@QBEHAAVRWindowGroup@@@Z @ 261 NONAME ; int CApaWindowGroupName::SetWindowGroupName(class RWindowGroup &) const
+	?SetWindowGroupNameL@CApaWindowGroupName@@QAEXABVTDesC16@@@Z @ 262 NONAME ; void CApaWindowGroupName::SetWindowGroupNameL(class TDesC16 const &)
+	?ShortCaption@CApaSystemControl@@QBE?AVTPtrC16@@XZ @ 263 NONAME ; class TPtrC16 CApaSystemControl::ShortCaption(void) const
+	?StartApp@RApaLsSession@@QAEHABVCApaCommandLine@@@Z @ 264 NONAME ; int RApaLsSession::StartApp(class CApaCommandLine const &)
+	?StartApp@RApaLsSession@@QAEHABVCApaCommandLine@@AAVTThreadId@@@Z @ 265 NONAME ; int RApaLsSession::StartApp(class CApaCommandLine const &, class TThreadId &)
+	?StartApp@RApaLsSession@@QAEHABVCApaCommandLine@@AAVTThreadId@@PAVTRequestStatus@@@Z @ 266 NONAME ; int RApaLsSession::StartApp(class CApaCommandLine const &, class TThreadId &, class TRequestStatus *)
+	?StartDocument@RApaLsSession@@QAEHAAVRFile@@AAVTThreadId@@PAVTRequestStatus@@@Z @ 267 NONAME ; int RApaLsSession::StartDocument(class RFile &, class TThreadId &, class TRequestStatus *)
+	?StartDocument@RApaLsSession@@QAEHAAVRFile@@ABVTDataType@@AAVTThreadId@@PAVTRequestStatus@@@Z @ 268 NONAME ; int RApaLsSession::StartDocument(class RFile &, class TDataType const &, class TThreadId &, class TRequestStatus *)
+	?StartDocument@RApaLsSession@@QAEHAAVRFile@@VTUid@@AAVTThreadId@@PAVTRequestStatus@@@Z @ 269 NONAME ; int RApaLsSession::StartDocument(class RFile &, class TUid, class TThreadId &, class TRequestStatus *)
+	?StartDocument@RApaLsSession@@QAEHABVTDesC16@@AAVTThreadId@@W4TLaunchType@1@@Z @ 270 NONAME ; int RApaLsSession::StartDocument(class TDesC16 const &, class TThreadId &, enum RApaLsSession::TLaunchType)
+	?StartDocument@RApaLsSession@@QAEHABVTDesC16@@ABVTDataType@@AAVTThreadId@@W4TLaunchType@1@@Z @ 271 NONAME ; int RApaLsSession::StartDocument(class TDesC16 const &, class TDataType const &, class TThreadId &, enum RApaLsSession::TLaunchType)
+	?StartDocument@RApaLsSession@@QAEHABVTDesC16@@VTUid@@AAVTThreadId@@W4TLaunchType@1@@Z @ 272 NONAME ; int RApaLsSession::StartDocument(class TDesC16 const &, class TUid, class TThreadId &, enum RApaLsSession::TLaunchType)
+	?StartIdleUpdateL@CApaAppList@@QAEXPAVMApaAppListObserver@@@Z @ 273 NONAME ; void CApaAppList::StartIdleUpdateL(class MApaAppListObserver *)
+	?StartIdleUpdateL@CApaAppList@@QAEXXZ @ 274 NONAME ; void CApaAppList::StartIdleUpdateL(void)
+	?StartupApaServer@@YAHAAVMApaAppStarter@@@Z @ 275 NONAME ; int StartupApaServer(class MApaAppStarter &)
+	?StartupApaServerProcess@@YAHXZ @ 276 NONAME ; int StartupApaServerProcess(void)
+	?StopScan@CApaAppList@@QAEXXZ @ 277 NONAME ; void CApaAppList::StopScan(void)
+	?StoreL@CApaAppInfoFileWriter@@QAEXXZ @ 278 NONAME ; void CApaAppInfoFileWriter::StoreL(void)
+	?SwitchCreateFile@TApaTask@@QAEHABVTDesC16@@@Z @ 279 NONAME ; int TApaTask::SwitchCreateFile(class TDesC16 const &)
+	?SwitchOpenFile@TApaTask@@QAEHABVTDesC16@@@Z @ 280 NONAME ; int TApaTask::SwitchOpenFile(class TDesC16 const &)
+	?TestIconLoaderAndIconArrayL@TIconLoaderAndIconArrayForLeaks@@SAXXZ @ 281 NONAME ; void TIconLoaderAndIconArrayForLeaks::TestIconLoaderAndIconArrayL(void)
+	?ThreadId@TApaTask@@QBE?AVTThreadId@@XZ @ 282 NONAME ; class TThreadId TApaTask::ThreadId(void) const
+	?Type@CApaSystemControl@@QBE?AVTUid@@XZ @ 283 NONAME ; class TUid CApaSystemControl::Type(void) const
+	?Uid@CApaAppViewData@@QBE?AVTUid@@XZ @ 284 NONAME ; class TUid CApaAppViewData::Uid(void) const
+	?Uid@TApaAppServiceInfo@@QBE?AVTUid@@XZ @ 285 NONAME ; class TUid TApaAppServiceInfo::Uid(void) const
+	?UpdateCounter@CApaAppList@@QBEHXZ @ 286 NONAME ; int CApaAppList::UpdateCounter(void) const
+	?UpdateL@CApaSystemControlList@@QAEXXZ @ 287 NONAME ; void CApaSystemControlList::UpdateL(void)
+	?Version@RApaLsSession@@QBE?AVTVersion@@XZ @ 288 NONAME ; class TVersion RApaLsSession::Version(void) const
+	?Views@CApaAppData@@QBEPAV?$CArrayPtrFlat@VCApaAppViewData@@@@XZ @ 289 NONAME ; class CArrayPtrFlat<class CApaAppViewData> * CApaAppData::Views(void) const
+	?WgId@TApaTask@@QBEHXZ @ 290 NONAME ; int TApaTask::WgId(void) const
+	?WindowGroupName@CApaWindowGroupName@@QBE?AVTPtrC16@@XZ @ 291 NONAME ; class TPtrC16 CApaWindowGroupName::WindowGroupName(void) const
+	?KMinApplicationStackSize@@3HB @ 292 NONAME ; int const KMinApplicationStackSize
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/bwins/TICONFORLEAKSu.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,300 @@
+EXPORTS
+	??0CDataRecognitionResultArray@@QAE@XZ @ 1 NONAME ; CDataRecognitionResultArray::CDataRecognitionResultArray(void)
+	??0MApaAppListServObserver@@IAE@XZ @ 2 NONAME ; MApaAppListServObserver::MApaAppListServObserver(void)
+	??0RApaLsSession@@QAE@XZ @ 3 NONAME ; RApaLsSession::RApaLsSession(void)
+	??0TApaPictureFactory@@IAE@XZ @ 4 NONAME ; TApaPictureFactory::TApaPictureFactory(void)
+	??0TApaPictureFactory@@QAE@PAVCApaProcess@@@Z @ 5 NONAME ; TApaPictureFactory::TApaPictureFactory(class CApaProcess *)
+	??0TApaTask@@QAE@AAVRWsSession@@@Z @ 6 NONAME ; TApaTask::TApaTask(class RWsSession &)
+	??0TApaTaskList@@QAE@AAVRWsSession@@@Z @ 7 NONAME ; TApaTaskList::TApaTaskList(class RWsSession &)
+	??1CApaAppData@@UAE@XZ @ 8 NONAME ; CApaAppData::~CApaAppData(void)
+	??1CApaAppInfoFileWriter@@UAE@XZ @ 9 NONAME ; CApaAppInfoFileWriter::~CApaAppInfoFileWriter(void)
+	??1CApaAppList@@UAE@XZ @ 10 NONAME ; CApaAppList::~CApaAppList(void)
+	??1CApaAppListNotifier@@UAE@XZ @ 11 NONAME ; CApaAppListNotifier::~CApaAppListNotifier(void)
+	??1CApaDoor@@UAE@XZ @ 12 NONAME ; CApaDoor::~CApaDoor(void)
+	??1CApaLocalisableResourceFileWriter@@UAE@XZ @ 13 NONAME ; CApaLocalisableResourceFileWriter::~CApaLocalisableResourceFileWriter(void)
+	??1CApaMaskedBitmap@@UAE@XZ @ 14 NONAME ; CApaMaskedBitmap::~CApaMaskedBitmap(void)
+	??1CApaRegistrationResourceFileWriter@@UAE@XZ @ 15 NONAME ; CApaRegistrationResourceFileWriter::~CApaRegistrationResourceFileWriter(void)
+	??1CApaSystemControlList@@UAE@XZ @ 16 NONAME ; CApaSystemControlList::~CApaSystemControlList(void)
+	??1CApaWindowGroupName@@UAE@XZ @ 17 NONAME ; CApaWindowGroupName::~CApaWindowGroupName(void)
+	??1CDataRecognitionResultArray@@UAE@XZ @ 18 NONAME ; CDataRecognitionResultArray::~CDataRecognitionResultArray(void)
+	?AddCaptionL@CApaAppInfoFileWriter@@QAEXW4TLanguage@@ABVTDesC16@@@Z @ 19 NONAME ; void CApaAppInfoFileWriter::AddCaptionL(enum TLanguage, class TDesC16 const &)
+	?AddDataTypeL@CApaAppInfoFileWriter@@QAEXABVTDataTypeWithPriority@@@Z @ 20 NONAME ; void CApaAppInfoFileWriter::AddDataTypeL(class TDataTypeWithPriority const &)
+	?AddDataTypeL@CApaRegistrationResourceFileWriter@@QAEXHABVTDesC8@@@Z @ 21 NONAME ; void CApaRegistrationResourceFileWriter::AddDataTypeL(int, class TDesC8 const &)
+	?AddFileOwnershipInfoL@CApaRegistrationResourceFileWriter@@QAEXABVTDesC16@@@Z @ 22 NONAME ; void CApaRegistrationResourceFileWriter::AddFileOwnershipInfoL(class TDesC16 const &)
+	?AddForcedRegistrationL@CApaAppList@@QAEXPAVHBufC16@@@Z @ 23 NONAME ; void CApaAppList::AddForcedRegistrationL(class HBufC16 *)
+	?AddIconL@CApaAppInfoFileWriter@@QAEXAAVCApaMaskedBitmap@@@Z @ 24 NONAME ; void CApaAppInfoFileWriter::AddIconL(class CApaMaskedBitmap &)
+	?AppCount@RApaLsSession@@QBEHAAH@Z @ 25 NONAME ; int RApaLsSession::AppCount(int &) const
+	?AppDataByFileName@CApaAppList@@QBEPAVCApaAppData@@ABVTDesC16@@@Z @ 26 NONAME ; class CApaAppData * CApaAppList::AppDataByFileName(class TDesC16 const &) const
+	?AppDataByUid@CApaAppList@@QBEPAVCApaAppData@@VTUid@@@Z @ 27 NONAME ; class CApaAppData * CApaAppList::AppDataByUid(class TUid) const
+	?AppEntry@CApaAppData@@QBE?AVTApaAppEntry@@XZ @ 28 NONAME ; class TApaAppEntry CApaAppData::AppEntry(void) const
+	?AppForDataType@RApaLsSession@@QBEHABVTDataType@@AAVTUid@@@Z @ 29 NONAME ; int RApaLsSession::AppForDataType(class TDataType const &, class TUid &) const
+	?AppForDataTypeAndService@RApaLsSession@@QBEHABVTDataType@@VTUid@@AAV3@@Z @ 30 NONAME ; int RApaLsSession::AppForDataTypeAndService(class TDataType const &, class TUid, class TUid &) const
+	?AppForDocument@RApaLsSession@@QBEHABVRFile@@AAVTUid@@AAVTDataType@@@Z @ 31 NONAME ; int RApaLsSession::AppForDocument(class RFile const &, class TUid &, class TDataType &) const
+	?AppForDocument@RApaLsSession@@QBEHABVTDesC16@@AAVTUid@@AAVTDataType@@@Z @ 32 NONAME ; int RApaLsSession::AppForDocument(class TDesC16 const &, class TUid &, class TDataType &) const
+	?AppForDocumentAndService@RApaLsSession@@QBEHABVRFile@@VTUid@@AAV3@AAVTDataType@@@Z @ 33 NONAME ; int RApaLsSession::AppForDocumentAndService(class RFile const &, class TUid, class TUid &, class TDataType &) const
+	?AppForDocumentAndService@RApaLsSession@@QBEHABVTDesC16@@VTUid@@AAV3@AAVTDataType@@@Z @ 34 NONAME ; int RApaLsSession::AppForDocumentAndService(class TDesC16 const &, class TUid, class TUid &, class TDataType &) const
+	?AppScanInProgress@CApaAppList@@QBEHXZ @ 35 NONAME ; int CApaAppList::AppScanInProgress(void) const
+	?AppUid@CApaWindowGroupName@@QBE?AVTUid@@XZ @ 36 NONAME ; class TUid CApaWindowGroupName::AppUid(void) const
+	?AppUidL@CApaDoor@@QBE?AVTUid@@XZ @ 37 NONAME ; class TUid CApaDoor::AppUidL(void) const
+	?ApplicationLanguage@CApaAppData@@QBE?AW4TLanguage@@XZ @ 38 NONAME ; enum TLanguage CApaAppData::ApplicationLanguage(void) const
+	?ApplicationLanguage@RApaLsSession@@QBEHVTUid@@AAW4TLanguage@@@Z @ 39 NONAME ; int RApaLsSession::ApplicationLanguage(class TUid, enum TLanguage &) const
+	?BringToForeground@TApaTask@@QAEXXZ @ 40 NONAME ; void TApaTask::BringToForeground(void)
+	?CanUseScreenMode@CApaAppData@@QAEHH@Z @ 41 NONAME ; int CApaAppData::CanUseScreenMode(int)
+	?CancelListPopulationCompleteObserver@RApaLsSession@@QBEHXZ @ 42 NONAME ; int RApaLsSession::CancelListPopulationCompleteObserver(void) const
+	?CancelNotify@RApaLsSession@@QAEXXZ @ 43 NONAME ; void RApaLsSession::CancelNotify(void)
+	?CancelNotifyOnDataMappingChange@RApaLsSession@@QAEXXZ @ 44 NONAME ; void RApaLsSession::CancelNotifyOnDataMappingChange(void)
+	?CancelRecognizeFiles@RApaLsSession@@QAEXXZ @ 45 NONAME ; void RApaLsSession::CancelRecognizeFiles(void)
+	?Capability@CApaAppData@@QBEXAAVTDes8@@@Z @ 46 NONAME ; void CApaAppData::Capability(class TDes8 &) const
+	?Caption@CApaSystemControl@@QBE?AVTPtrC16@@XZ @ 47 NONAME ; class TPtrC16 CApaSystemControl::Caption(void) const
+	?Caption@CApaWindowGroupName@@QBE?AVTPtrC16@@XZ @ 48 NONAME ; class TPtrC16 CApaWindowGroupName::Caption(void) const
+	?CheckInterimFormatFileNotCorruptL@ForJavaMIDletInstaller@@SAXAAVRFile@@@Z @ 49 NONAME ; void ForJavaMIDletInstaller::CheckInterimFormatFileNotCorruptL(class RFile &)
+	?ClearFsSession@RApaLsSession@@SAXXZ @ 50 NONAME ; void RApaLsSession::ClearFsSession(void)
+	?Close@RApaLsSession@@QAEXXZ @ 51 NONAME ; void RApaLsSession::Close(void)
+	?CommitNonNativeApplicationsUpdatesL@RApaLsSession@@QAEXXZ @ 52 NONAME ; void RApaLsSession::CommitNonNativeApplicationsUpdatesL(void)
+	?CompareStrings@CApaAppList@@SAHABVHBufC16@@0@Z @ 53 NONAME ; int CApaAppList::CompareStrings(class HBufC16 const &, class HBufC16 const &)
+	?Connect@RApaLsSession@@QAEHXZ @ 54 NONAME ; int RApaLsSession::Connect(void)
+	?ConstructFromWgIdL@CApaWindowGroupName@@QAEXH@Z @ 55 NONAME ; void CApaWindowGroupName::ConstructFromWgIdL(int)
+	?Control@CApaSystemControlList@@QBEPAVCApaSystemControl@@H@Z @ 56 NONAME ; class CApaSystemControl * CApaSystemControlList::Control(int) const
+	?Control@CApaSystemControlList@@QBEPAVCApaSystemControl@@VTUid@@@Z @ 57 NONAME ; class CApaSystemControl * CApaSystemControlList::Control(class TUid) const
+	?Count@CApaAppList@@QBEHXZ @ 58 NONAME ; int CApaAppList::Count(void) const
+	?Count@CApaSystemControlList@@QBEHXZ @ 59 NONAME ; int CApaSystemControlList::Count(void) const
+	?Count@CDataRecognitionResultArray@@QBEIXZ @ 60 NONAME ; unsigned int CDataRecognitionResultArray::Count(void) const
+	?CreateDocument@RApaLsSession@@QAEHABVTDesC16@@VTUid@@AAVTThreadId@@W4TLaunchType@1@@Z @ 61 NONAME ; int RApaLsSession::CreateDocument(class TDesC16 const &, class TUid, class TThreadId &, enum RApaLsSession::TLaunchType)
+	?CreateL@CApaSystemControl@@QAEXXZ @ 62 NONAME ; void CApaSystemControl::CreateL(void)
+	?CycleTasks@TApaTaskList@@QAEHVTUid@@W4TCycleDirection@1@@Z @ 63 NONAME ; int TApaTaskList::CycleTasks(class TUid, enum TApaTaskList::TCycleDirection)
+	?DataType@CApaAppData@@QBEJABVTDataType@@@Z @ 64 NONAME ; long CApaAppData::DataType(class TDataType const &) const
+	?DataTypes@TApaAppServiceInfo@@QBEABV?$CArrayFixFlat@VTDataTypeWithPriority@@@@XZ @ 65 NONAME ; class CArrayFixFlat<class TDataTypeWithPriority> const & TApaAppServiceInfo::DataTypes(void) const
+	?DefaultScreenNumber@CApaAppData@@QBEIXZ @ 66 NONAME ; unsigned int CApaAppData::DefaultScreenNumber(void) const
+	?DeleteDataMapping@RApaLsSession@@QAEHABVTDataType@@@Z @ 67 NONAME ; int RApaLsSession::DeleteDataMapping(class TDataType const &)
+	?DeleteDataMapping@RApaLsSession@@QAEHABVTDataType@@VTUid@@@Z @ 68 NONAME ; int RApaLsSession::DeleteDataMapping(class TDataType const &, class TUid)
+	?DeregisterNonNativeApplicationL@RApaLsSession@@QAEXVTUid@@@Z @ 69 NONAME ; void RApaLsSession::DeregisterNonNativeApplicationL(class TUid)
+	?DeregisterNonNativeApplicationTypeL@RApaLsSession@@QAEXVTUid@@@Z @ 70 NONAME ; void RApaLsSession::DeregisterNonNativeApplicationTypeL(class TUid)
+	?DocName@CApaWindowGroupName@@QBE?AVTPtrC16@@XZ @ 71 NONAME ; class TPtrC16 CApaWindowGroupName::DocName(void) const
+	?DocNameIsAFile@CApaWindowGroupName@@QBEHXZ @ 72 NONAME ; int CApaWindowGroupName::DocNameIsAFile(void) const
+	?DocumentL@CApaDoor@@QAEPAVCApaDocument@@H@Z @ 73 NONAME ; class CApaDocument * CApaDoor::DocumentL(int)
+	?EmbeddableAppCount@RApaLsSession@@QBEHAAH@Z @ 74 NONAME ; int RApaLsSession::EmbeddableAppCount(int &) const
+	?EndTask@TApaTask@@QAEXXZ @ 75 NONAME ; void TApaTask::EndTask(void)
+	?Exists@TApaTask@@QBEHXZ @ 76 NONAME ; int TApaTask::Exists(void) const
+	?ExternalizeL@CApaMaskedBitmap@@QBEXAAVRWriteStream@@@Z @ 77 NONAME ; void CApaMaskedBitmap::ExternalizeL(class RWriteStream &) const
+	?FileName@CApaSystemControl@@QBE?AV?$TBuf@$0BAA@@@XZ @ 78 NONAME ; class TBuf<256> CApaSystemControl::FileName(void) const
+	?FindAndAddSpecificAppL@CApaAppList@@QAEPAVCApaAppData@@PAVCApaAppRegFinder@@VTUid@@@Z @ 79 NONAME ; class CApaAppData * CApaAppList::FindAndAddSpecificAppL(class CApaAppRegFinder *, class TUid)
+	?FindApp@TApaTaskList@@QAE?AVTApaTask@@ABVTDesC16@@@Z @ 80 NONAME ; class TApaTask TApaTaskList::FindApp(class TDesC16 const &)
+	?FindApp@TApaTaskList@@QAE?AVTApaTask@@VTUid@@@Z @ 81 NONAME ; class TApaTask TApaTaskList::FindApp(class TUid)
+	?FindByAppUid@CApaWindowGroupName@@SAXVTUid@@AAVRWsSession@@AAH@Z @ 82 NONAME ; void CApaWindowGroupName::FindByAppUid(class TUid, class RWsSession &, int &)
+	?FindByCaption@CApaWindowGroupName@@SAXABVTDesC16@@AAVRWsSession@@AAH@Z @ 83 NONAME ; void CApaWindowGroupName::FindByCaption(class TDesC16 const &, class RWsSession &, int &)
+	?FindByDocName@CApaWindowGroupName@@SAXABVTDesC16@@AAVRWsSession@@AAH@Z @ 84 NONAME ; void CApaWindowGroupName::FindByDocName(class TDesC16 const &, class RWsSession &, int &)
+	?FindByPos@TApaTaskList@@QAE?AVTApaTask@@H@Z @ 85 NONAME ; class TApaTask TApaTaskList::FindByPos(int)
+	?FindDoc@TApaTaskList@@QAE?AVTApaTask@@ABVTDesC16@@@Z @ 86 NONAME ; class TApaTask TApaTaskList::FindDoc(class TDesC16 const &)
+	?FirstApp@CApaAppList@@QBEPAVCApaAppData@@H@Z @ 87 NONAME ; class CApaAppData * CApaAppList::FirstApp(int) const
+	?FirstApp@CApaAppList@@QBEPAVCApaAppData@@XZ @ 88 NONAME ; class CApaAppData * CApaAppList::FirstApp(void) const
+	?ForceRegistration@RApaLsSession@@QAEHABV?$RPointerArray@VTDesC16@@@@@Z @ 89 NONAME ; int RApaLsSession::ForceRegistration(class RPointerArray<class TDesC16> const &)
+	?FsSession@RApaLsSession@@SAPAVRFs@@XZ @ 90 NONAME ; class RFs * RApaLsSession::FsSession(void)
+	?GetAcceptedConfidence@RApaLsSession@@QBEHAAH@Z @ 91 NONAME ; int RApaLsSession::GetAcceptedConfidence(int &) const
+	?GetAllApps@RApaLsSession@@QBEHH@Z @ 92 NONAME ; int RApaLsSession::GetAllApps(int) const
+	?GetAllApps@RApaLsSession@@QBEHXZ @ 93 NONAME ; int RApaLsSession::GetAllApps(void) const
+	?GetAppByDataType@RApaLsSession@@QBEHABVTDataType@@VTUid@@AAV3@@Z @ 94 NONAME ; int RApaLsSession::GetAppByDataType(class TDataType const &, class TUid, class TUid &) const
+	?GetAppCapability@RApaLsSession@@QBEHAAVTDes8@@VTUid@@@Z @ 95 NONAME ; int RApaLsSession::GetAppCapability(class TDes8 &, class TUid) const
+	?GetAppIcon@RApaLsSession@@QBEHVTUid@@AAPAVHBufC16@@@Z @ 96 NONAME ; int RApaLsSession::GetAppIcon(class TUid, class HBufC16 * &) const
+	?GetAppIcon@RApaLsSession@@QBEHVTUid@@AAVRFile@@@Z @ 97 NONAME ; int RApaLsSession::GetAppIcon(class TUid, class RFile &) const
+	?GetAppIcon@RApaLsSession@@QBEHVTUid@@HAAVCApaMaskedBitmap@@@Z @ 98 NONAME ; int RApaLsSession::GetAppIcon(class TUid, int, class CApaMaskedBitmap &) const
+	?GetAppIcon@RApaLsSession@@QBEHVTUid@@VTSize@@AAVCApaMaskedBitmap@@@Z @ 99 NONAME ; int RApaLsSession::GetAppIcon(class TUid, class TSize, class CApaMaskedBitmap &) const
+	?GetAppIconSizes@RApaLsSession@@QBEHVTUid@@AAV?$CArrayFixFlat@VTSize@@@@@Z @ 100 NONAME ; int RApaLsSession::GetAppIconSizes(class TUid, class CArrayFixFlat<class TSize> &) const
+	?GetAppInfo@RApaLsSession@@QBEHAAVTApaAppInfo@@VTUid@@@Z @ 101 NONAME ; int RApaLsSession::GetAppInfo(class TApaAppInfo &, class TUid) const
+	?GetAppOwnedFiles@RApaLsSession@@QBEHAAVCDesC16Array@@VTUid@@@Z @ 102 NONAME ; int RApaLsSession::GetAppOwnedFiles(class CDesC16Array &, class TUid) const
+	?GetAppServiceOpaqueDataLC@RApaLsSession@@QBEPAVCApaAppServiceInfoArray@@VTUid@@0@Z @ 103 NONAME ; class CApaAppServiceInfoArray * RApaLsSession::GetAppServiceOpaqueDataLC(class TUid, class TUid) const
+	?GetAppServicesL@RApaLsSession@@QBEXVTUid@@AAV?$CArrayFixFlat@VTUid@@@@@Z @ 104 NONAME ; void RApaLsSession::GetAppServicesL(class TUid, class CArrayFixFlat<class TUid> &) const
+	?GetAppServicesLC@RApaLsSession@@QBEPAVCApaAppServiceInfoArray@@VTUid@@@Z @ 105 NONAME ; class CApaAppServiceInfoArray * RApaLsSession::GetAppServicesLC(class TUid) const
+	?GetAppType@RApaLsSession@@QBEHAAVTUid@@V2@@Z @ 106 NONAME ; int RApaLsSession::GetAppType(class TUid &, class TUid) const
+	?GetAppViewIcon@RApaLsSession@@QBEHVTUid@@0AAPAVHBufC16@@@Z @ 107 NONAME ; int RApaLsSession::GetAppViewIcon(class TUid, class TUid, class HBufC16 * &) const
+	?GetAppViewIcon@RApaLsSession@@QBEHVTUid@@0ABVTSize@@AAVCApaMaskedBitmap@@@Z @ 108 NONAME ; int RApaLsSession::GetAppViewIcon(class TUid, class TUid, class TSize const &, class CApaMaskedBitmap &) const
+	?GetAppViews@RApaLsSession@@QBEHAAV?$CArrayFixFlat@VTApaAppViewInfo@@@@VTUid@@@Z @ 109 NONAME ; int RApaLsSession::GetAppViews(class CArrayFixFlat<class TApaAppViewInfo> &, class TUid) const
+	?GetDataRecognitionResultL@CDataRecognitionResultArray@@QBEXAAVTDataRecognitionResult@@I@Z @ 110 NONAME ; void CDataRecognitionResultArray::GetDataRecognitionResultL(class TDataRecognitionResult &, unsigned int) const
+	?GetDefaultScreenNumber@RApaLsSession@@QBEHAAHVTUid@@@Z @ 111 NONAME ; int RApaLsSession::GetDefaultScreenNumber(int &, class TUid) const
+	?GetEmbeddableApps@RApaLsSession@@QBEHH@Z @ 112 NONAME ; int RApaLsSession::GetEmbeddableApps(int) const
+	?GetEmbeddableApps@RApaLsSession@@QBEHXZ @ 113 NONAME ; int RApaLsSession::GetEmbeddableApps(void) const
+	?GetFileNameL@CDataRecognitionResultArray@@QBEXAAV?$TBuf@$0BAA@@@I@Z @ 114 NONAME ; void CDataRecognitionResultArray::GetFileNameL(class TBuf<256> &, unsigned int) const
+	?GetFilteredApps@RApaLsSession@@QBEHABVTApaEmbeddabilityFilter@@@Z @ 115 NONAME ; int RApaLsSession::GetFilteredApps(class TApaEmbeddabilityFilter const &) const
+	?GetFilteredApps@RApaLsSession@@QBEHABVTApaEmbeddabilityFilter@@H@Z @ 116 NONAME ; int RApaLsSession::GetFilteredApps(class TApaEmbeddabilityFilter const &, int) const
+	?GetFilteredApps@RApaLsSession@@QBEHII@Z @ 117 NONAME ; int RApaLsSession::GetFilteredApps(unsigned int, unsigned int) const
+	?GetFilteredApps@RApaLsSession@@QBEHIIH@Z @ 118 NONAME ; int RApaLsSession::GetFilteredApps(unsigned int, unsigned int, int) const
+	?GetIconInfo@CApaAppData@@QBEXAAH0@Z @ 119 NONAME ; void CApaAppData::GetIconInfo(int &, int &) const
+	?GetJavaMIDletInfoL@ForJavaMIDletInstaller@@SAXAAVRFs@@ABVTDesC16@@AAK2@Z @ 120 NONAME ; void ForJavaMIDletInstaller::GetJavaMIDletInfoL(class RFs &, class TDesC16 const &, unsigned long &, unsigned long &)
+	?GetMaxDataBufSize@RApaLsSession@@QBEHAAH@Z @ 121 NONAME ; int RApaLsSession::GetMaxDataBufSize(int &) const
+	?GetNextApp@RApaLsSession@@QBEHAAVTApaAppInfo@@@Z @ 122 NONAME ; int RApaLsSession::GetNextApp(class TApaAppInfo &) const
+	?GetNextApp@RApaLsSession@@QBEHAAVTApaAppInfo@@H@Z @ 123 NONAME ; int RApaLsSession::GetNextApp(class TApaAppInfo &, int) const
+	?GetPreferredBufSize@RApaLsSession@@QBEHAAH@Z @ 124 NONAME ; int RApaLsSession::GetPreferredBufSize(int &) const
+	?GetServerApps@RApaLsSession@@QBEHVTUid@@@Z @ 125 NONAME ; int RApaLsSession::GetServerApps(class TUid) const
+	?GetServerApps@RApaLsSession@@QBEHVTUid@@H@Z @ 126 NONAME ; int RApaLsSession::GetServerApps(class TUid, int) const
+	?GetServiceImplementationsLC@RApaLsSession@@QBEPAVCApaAppServiceInfoArray@@VTUid@@@Z @ 127 NONAME ; class CApaAppServiceInfoArray * RApaLsSession::GetServiceImplementationsLC(class TUid) const
+	?GetServiceImplementationsLC@RApaLsSession@@QBEPAVCApaAppServiceInfoArray@@VTUid@@ABVTDataType@@@Z @ 128 NONAME ; class CApaAppServiceInfoArray * RApaLsSession::GetServiceImplementationsLC(class TUid, class TDataType const &) const
+	?GetSupportedDataTypesL@RApaLsSession@@QBEHAAV?$CArrayFixFlat@VTDataType@@@@@Z @ 129 NONAME ; int RApaLsSession::GetSupportedDataTypesL(class CArrayFixFlat<class TDataType> &) const
+	?HandleAsRegistrationFile@ApaUtils@@SAHABVTUidType@@@Z @ 130 NONAME ; int ApaUtils::HandleAsRegistrationFile(class TUidType const &)
+	?Hidden@CApaWindowGroupName@@QBEHXZ @ 131 NONAME ; int CApaWindowGroupName::Hidden(void) const
+	?Icon@CApaAppData@@QBEPAVCApaMaskedBitmap@@H@Z @ 132 NONAME ; class CApaMaskedBitmap * CApaAppData::Icon(int) const
+	?Icon@CApaAppData@@QBEPAVCApaMaskedBitmap@@VTSize@@@Z @ 133 NONAME ; class CApaMaskedBitmap * CApaAppData::Icon(class TSize) const
+	?Icon@CApaAppViewData@@QBEPAVCApaMaskedBitmap@@ABVTSize@@@Z @ 134 NONAME ; class CApaMaskedBitmap * CApaAppViewData::Icon(class TSize const &) const
+	?Icon@CApaSystemControl@@QBEPAVCApaMaskedBitmap@@XZ @ 135 NONAME ; class CApaMaskedBitmap * CApaSystemControl::Icon(void) const
+	?IconFileName@CApaAppData@@QBE?AVTPtrC16@@XZ @ 136 NONAME ; class TPtrC16 CApaAppData::IconFileName(void) const
+	?IconFileName@CApaAppViewData@@QBE?AVTPtrC16@@XZ @ 137 NONAME ; class TPtrC16 CApaAppViewData::IconFileName(void) const
+	?IconSizesL@CApaAppData@@QBEPAV?$CArrayFixFlat@VTSize@@@@XZ @ 138 NONAME ; class CArrayFixFlat<class TSize> * CApaAppData::IconSizesL(void) const
+	?IconSizesL@CApaAppViewData@@QBEPAV?$CArrayFixFlat@VTSize@@@@XZ @ 139 NONAME ; class CArrayFixFlat<class TSize> * CApaAppViewData::IconSizesL(void) const
+	?ImplementsService@CApaAppData@@QBEHVTUid@@@Z @ 140 NONAME ; int CApaAppData::ImplementsService(class TUid) const
+	?Index@CApaSystemControlList@@QBEHVTUid@@@Z @ 141 NONAME ; int CApaSystemControlList::Index(class TUid) const
+	?InitListL@CApaAppList@@QAEXPAVMApaAppListObserver@@@Z @ 142 NONAME ; void CApaAppList::InitListL(class MApaAppListObserver *)
+	?InsertDataMapping@RApaLsSession@@QAEHABVTDataType@@JVTUid@@1@Z @ 143 NONAME ; int RApaLsSession::InsertDataMapping(class TDataType const &, long, class TUid, class TUid)
+	?InsertDataMapping@RApaLsSession@@QAEHABVTDataType@@JVTUid@@@Z @ 144 NONAME ; int RApaLsSession::InsertDataMapping(class TDataType const &, long, class TUid)
+	?InsertDataMappingIfHigher@RApaLsSession@@QAEHABVTDataType@@JVTUid@@AAH@Z @ 145 NONAME ; int RApaLsSession::InsertDataMappingIfHigher(class TDataType const &, long, class TUid, int &)
+	?InternalizeL@CApaMaskedBitmap@@QAEXAAVRReadStream@@@Z @ 146 NONAME ; void CApaMaskedBitmap::InternalizeL(class RReadStream &)
+	?IsAppReady@CApaWindowGroupName@@QBEHXZ @ 147 NONAME ; int CApaWindowGroupName::IsAppReady(void) const
+	?IsBusy@CApaWindowGroupName@@QBEHXZ @ 148 NONAME ; int CApaWindowGroupName::IsBusy(void) const
+	?IsFirstScanComplete@CApaAppList@@QBEHXZ @ 149 NONAME ; int CApaAppList::IsFirstScanComplete(void) const
+	?IsIdleUpdateComplete@CApaAppList@@QBEHXZ @ 150 NONAME ; int CApaAppList::IsIdleUpdateComplete(void) const
+	?IsLanguageChangePending@CApaAppList@@QBEHXZ @ 151 NONAME ; int CApaAppList::IsLanguageChangePending(void) const
+	?IsPending@CApaAppData@@QBEHXZ @ 152 NONAME ; int CApaAppData::IsPending(void) const
+	?IsProgram@RApaLsSession@@QBEHABVTDesC16@@AAH@Z @ 153 NONAME ; int RApaLsSession::IsProgram(class TDesC16 const &, int &) const
+	?IsSystem@CApaWindowGroupName@@QBEHXZ @ 154 NONAME ; int CApaWindowGroupName::IsSystem(void) const
+	?KillTask@TApaTask@@QAEXXZ @ 155 NONAME ; void TApaTask::KillTask(void)
+	?LocalisableResourceFileName@CApaAppData@@QBE?AVTPtrC16@@XZ @ 156 NONAME ; class TPtrC16 CApaAppData::LocalisableResourceFileName(void) const
+	?MApaAppListServObserver_Reserved1@MApaAppListServObserver@@EAEXXZ @ 157 NONAME ; void MApaAppListServObserver::MApaAppListServObserver_Reserved1(void)
+	?MApaAppListServObserver_Reserved2@MApaAppListServObserver@@EAEXXZ @ 158 NONAME ; void MApaAppListServObserver::MApaAppListServObserver_Reserved2(void)
+	?Mask@CApaMaskedBitmap@@QBEPAVCFbsBitmap@@XZ @ 159 NONAME ; class CFbsBitmap * CApaMaskedBitmap::Mask(void) const
+	?MatchesSecurityPolicy@RApaLsSession@@QBEHAAHVTUid@@ABVTSecurityPolicy@@@Z @ 160 NONAME ; int RApaLsSession::MatchesSecurityPolicy(int &, class TUid, class TSecurityPolicy const &) const
+	?MinApplicationStackSize@@YAIXZ @ 161 NONAME ; unsigned int MinApplicationStackSize(void)
+	?New@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@PAVHBufC16@@@Z @ 162 NONAME ; class CApaWindowGroupName * CApaWindowGroupName::New(class RWsSession const &, class HBufC16 *)
+	?NewInterimFormatFileWriterLC@ForJavaMIDletInstaller@@SAPAVCApaAppInfoFileWriter@@AAVRFs@@ABVTDesC16@@VTUid@@KH@Z @ 163 NONAME ; class CApaAppInfoFileWriter * ForJavaMIDletInstaller::NewInterimFormatFileWriterLC(class RFs &, class TDesC16 const &, class TUid, unsigned long, int)
+	?NewL@CApaAppData@@SAPAV1@ABVTApaAppEntry@@AAVRFs@@@Z @ 164 NONAME ; class CApaAppData * CApaAppData::NewL(class TApaAppEntry const &, class RFs &)
+	?NewL@CApaAppList@@SAPAV1@AAVRFs@@PAVCApaAppRegFinder@@HH@Z @ 165 NONAME ; class CApaAppList * CApaAppList::NewL(class RFs &, class CApaAppRegFinder *, int, int)
+	?NewL@CApaAppListNotifier@@SAPAV1@PAVMApaAppListServObserver@@W4TPriority@CActive@@@Z @ 166 NONAME ; class CApaAppListNotifier * CApaAppListNotifier::NewL(class MApaAppListServObserver *, enum CActive::TPriority)
+	?NewL@CApaDoor@@SAPAV1@AAVRFs@@AAVCApaDocument@@ABVTSize@@@Z @ 167 NONAME ; class CApaDoor * CApaDoor::NewL(class RFs &, class CApaDocument &, class TSize const &)
+	?NewL@CApaDoor@@SAPAV1@AAVRFs@@ABVCStreamStore@@VTStreamId@@AAVCApaProcess@@@Z @ 168 NONAME ; class CApaDoor * CApaDoor::NewL(class RFs &, class CStreamStore const &, class TStreamId, class CApaProcess &)
+	?NewL@CApaLocalisableResourceFileWriter@@SAPAV1@ABVTDesC16@@0H0@Z @ 169 NONAME ; class CApaLocalisableResourceFileWriter * CApaLocalisableResourceFileWriter::NewL(class TDesC16 const &, class TDesC16 const &, int, class TDesC16 const &)
+	?NewL@CApaMaskedBitmap@@SAPAV1@PBV1@@Z @ 170 NONAME ; class CApaMaskedBitmap * CApaMaskedBitmap::NewL(class CApaMaskedBitmap const *)
+	?NewL@CApaRegistrationResourceFileWriter@@SAPAV1@VTUid@@ABVTDesC16@@I@Z @ 171 NONAME ; class CApaRegistrationResourceFileWriter * CApaRegistrationResourceFileWriter::NewL(class TUid, class TDesC16 const &, unsigned int)
+	?NewL@CApaSystemControlList@@SAPAV1@AAVRFs@@@Z @ 172 NONAME ; class CApaSystemControlList * CApaSystemControlList::NewL(class RFs &)
+	?NewL@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@@Z @ 173 NONAME ; class CApaWindowGroupName * CApaWindowGroupName::NewL(class RWsSession const &)
+	?NewL@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@ABVTDesC16@@@Z @ 174 NONAME ; class CApaWindowGroupName * CApaWindowGroupName::NewL(class RWsSession const &, class TDesC16 const &)
+	?NewL@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@H@Z @ 175 NONAME ; class CApaWindowGroupName * CApaWindowGroupName::NewL(class RWsSession const &, int)
+	?NewLC@CApaDoor@@SAPAV1@AAVRFs@@AAVCApaDocument@@ABVTSize@@@Z @ 176 NONAME ; class CApaDoor * CApaDoor::NewLC(class RFs &, class CApaDocument &, class TSize const &)
+	?NewLC@CApaMaskedBitmap@@SAPAV1@XZ @ 177 NONAME ; class CApaMaskedBitmap * CApaMaskedBitmap::NewLC(void)
+	?NewLC@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@@Z @ 178 NONAME ; class CApaWindowGroupName * CApaWindowGroupName::NewLC(class RWsSession const &)
+	?NewLC@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@ABVTDesC16@@@Z @ 179 NONAME ; class CApaWindowGroupName * CApaWindowGroupName::NewLC(class RWsSession const &, class TDesC16 const &)
+	?NewLC@CApaWindowGroupName@@SAPAV1@ABVRWsSession@@H@Z @ 180 NONAME ; class CApaWindowGroupName * CApaWindowGroupName::NewLC(class RWsSession const &, int)
+	?NewPictureL@TApaPictureFactory@@UBEXAAVTPictureHeader@@ABVCStreamStore@@@Z @ 181 NONAME ; void TApaPictureFactory::NewPictureL(class TPictureHeader &, class CStreamStore const &) const
+	?NextApp@CApaAppList@@QBEPAVCApaAppData@@PBV2@@Z @ 182 NONAME ; class CApaAppData * CApaAppList::NextApp(class CApaAppData const *) const
+	?NextApp@CApaAppList@@QBEPAVCApaAppData@@PBV2@H@Z @ 183 NONAME ; class CApaAppData * CApaAppList::NextApp(class CApaAppData const *, int) const
+	?NonMbmIconFile@CApaAppData@@QBEHXZ @ 184 NONAME ; int CApaAppData::NonMbmIconFile(void) const
+	?NonMbmIconFile@CApaAppViewData@@QBEHXZ @ 185 NONAME ; int CApaAppViewData::NonMbmIconFile(void) const
+	?NonNativeApplicationType@CApaAppData@@QBE?AVTUid@@XZ @ 186 NONAME ; class TUid CApaAppData::NonNativeApplicationType(void) const
+	?NotifyOnDataMappingChange@RApaLsSession@@QAEXAAVTRequestStatus@@@Z @ 187 NONAME ; void RApaLsSession::NotifyOnDataMappingChange(class TRequestStatus &)
+	?NumberOfOwnDefinedIcons@RApaLsSession@@QBEHVTUid@@AAH@Z @ 188 NONAME ; int RApaLsSession::NumberOfOwnDefinedIcons(class TUid, int &) const
+	?OpaqueData@CApaAppData@@QBE?AVTPtrC8@@XZ @ 189 NONAME ; class TPtrC8 CApaAppData::OpaqueData(void) const
+	?OpaqueData@TApaAppServiceInfo@@QBEABVTDesC8@@XZ @ 190 NONAME ; class TDesC8 const & TApaAppServiceInfo::OpaqueData(void) const
+	?OwnedFiles@CApaAppData@@QBEPAVCDesC16Array@@XZ @ 191 NONAME ; class CDesC16Array * CApaAppData::OwnedFiles(void) const
+	?Path@CDataRecognitionResultArray@@QBEABV?$TBuf@$0BAA@@@XZ @ 192 NONAME ; class TBuf<256> const & CDataRecognitionResultArray::Path(void) const
+	?PreferredDataHandlerL@CApaAppList@@QBE?AVTUid@@ABVTDataType@@@Z @ 193 NONAME ; class TUid CApaAppList::PreferredDataHandlerL(class TDataType const &) const
+	?PreferredDataHandlerL@CApaAppList@@QBE?AVTUid@@ABVTDataType@@PBV2@AAH@Z @ 194 NONAME ; class TUid CApaAppList::PreferredDataHandlerL(class TDataType const &, class TUid const *, int &) const
+	?PrepareNonNativeApplicationsUpdatesL@RApaLsSession@@QAEXXZ @ 195 NONAME ; void RApaLsSession::PrepareNonNativeApplicationsUpdatesL(void)
+	?PurgeL@CApaAppList@@QAEXXZ @ 196 NONAME ; void CApaAppList::PurgeL(void)
+	?RApaLsSession_Reserved1@RApaLsSession@@EAEXXZ @ 197 NONAME ; void RApaLsSession::RApaLsSession_Reserved1(void)
+	?RApaLsSession_Reserved2@RApaLsSession@@EAEXXZ @ 198 NONAME ; void RApaLsSession::RApaLsSession_Reserved2(void)
+	?RecognizeData@RApaLsSession@@QBEHABVRFile@@AAVTDataRecognitionResult@@@Z @ 199 NONAME ; int RApaLsSession::RecognizeData(class RFile const &, class TDataRecognitionResult &) const
+	?RecognizeData@RApaLsSession@@QBEHABVTDesC16@@ABVTDesC8@@AAVTDataRecognitionResult@@@Z @ 200 NONAME ; int RApaLsSession::RecognizeData(class TDesC16 const &, class TDesC8 const &, class TDataRecognitionResult &) const
+	?RecognizeFilesL@RApaLsSession@@QAEXABVTDesC16@@AAVCDataRecognitionResultArray@@AAVTRequestStatus@@@Z @ 201 NONAME ; void RApaLsSession::RecognizeFilesL(class TDesC16 const &, class CDataRecognitionResultArray &, class TRequestStatus &)
+	?RecognizeFilesL@RApaLsSession@@QAEXABVTDesC16@@ABVTDesC8@@AAVCDataRecognitionResultArray@@AAVTRequestStatus@@@Z @ 202 NONAME ; void RApaLsSession::RecognizeFilesL(class TDesC16 const &, class TDesC8 const &, class CDataRecognitionResultArray &, class TRequestStatus &)
+	?RecognizeFilesL@RApaLsSession@@QBEHABVTDesC16@@AAVCDataRecognitionResultArray@@@Z @ 203 NONAME ; int RApaLsSession::RecognizeFilesL(class TDesC16 const &, class CDataRecognitionResultArray &) const
+	?RecognizeFilesL@RApaLsSession@@QBEHABVTDesC16@@ABVTDesC8@@AAVCDataRecognitionResultArray@@@Z @ 204 NONAME ; int RApaLsSession::RecognizeFilesL(class TDesC16 const &, class TDesC8 const &, class CDataRecognitionResultArray &) const
+	?RecognizeSpecificData@RApaLsSession@@QBEHABVRFile@@ABVTDataType@@AAH@Z @ 205 NONAME ; int RApaLsSession::RecognizeSpecificData(class RFile const &, class TDataType const &, int &) const
+	?RecognizeSpecificData@RApaLsSession@@QBEHABVTDesC16@@ABVTDesC8@@ABVTDataType@@AAH@Z @ 206 NONAME ; int RApaLsSession::RecognizeSpecificData(class TDesC16 const &, class TDesC8 const &, class TDataType const &, int &) const
+	?RegisterListPopulationCompleteObserver@RApaLsSession@@QBEXAAVTRequestStatus@@@Z @ 207 NONAME ; void RApaLsSession::RegisterListPopulationCompleteObserver(class TRequestStatus &) const
+	?RegisterNonNativeApplicationL@RApaLsSession@@QAEXVTUid@@ABVTDriveUnit@@AAVCApaRegistrationResourceFileWriter@@PAVCApaLocalisableResourceFileWriter@@PBVRFile@@@Z @ 208 NONAME ; void RApaLsSession::RegisterNonNativeApplicationL(class TUid, class TDriveUnit const &, class CApaRegistrationResourceFileWriter &, class CApaLocalisableResourceFileWriter *, class RFile const *)
+	?RegisterNonNativeApplicationTypeL@RApaLsSession@@QAEXVTUid@@ABVTDesC16@@@Z @ 209 NONAME ; void RApaLsSession::RegisterNonNativeApplicationTypeL(class TUid, class TDesC16 const &)
+	?RegistrationFileName@CApaAppData@@QBE?AVTPtrC16@@XZ @ 210 NONAME ; class TPtrC16 CApaAppData::RegistrationFileName(void) const
+	?RegistrationFileUsed@CApaAppData@@QBEHXZ @ 211 NONAME ; int CApaAppData::RegistrationFileUsed(void) const
+	?ResetForcedRegistrations@CApaAppList@@QAEXXZ @ 212 NONAME ; void CApaAppList::ResetForcedRegistrations(void)
+	?RespondsToShutdownEvent@CApaWindowGroupName@@QBEHXZ @ 213 NONAME ; int CApaWindowGroupName::RespondsToShutdownEvent(void) const
+	?RespondsToSwitchFilesEvent@CApaWindowGroupName@@QBEHXZ @ 214 NONAME ; int CApaWindowGroupName::RespondsToSwitchFilesEvent(void) const
+	?RestartScanL@CApaAppList@@QAEXXZ @ 215 NONAME ; void CApaAppList::RestartScanL(void)
+	?RestoreL@CApaDoor@@QAEXABVCStreamStore@@VTStreamId@@@Z @ 216 NONAME ; void CApaDoor::RestoreL(class CStreamStore const &, class TStreamId)
+	?RollbackNonNativeApplicationsUpdates@RApaLsSession@@QAEHXZ @ 217 NONAME ; int RApaLsSession::RollbackNonNativeApplicationsUpdates(void)
+	?ScreenMode@CApaAppViewData@@QBEHXZ @ 218 NONAME ; int CApaAppViewData::ScreenMode(void) const
+	?Self@CApaAppList@@SAPAV1@XZ @ 219 NONAME ; class CApaAppList * CApaAppList::Self(void)
+	?SendKey@TApaTask@@QAEXABUTKeyEvent@@@Z @ 220 NONAME ; void TApaTask::SendKey(struct TKeyEvent const &)
+	?SendKey@TApaTask@@QAEXHH@Z @ 221 NONAME ; void TApaTask::SendKey(int, int)
+	?SendMessage@TApaTask@@QAEHVTUid@@ABVTDesC8@@@Z @ 222 NONAME ; int TApaTask::SendMessage(class TUid, class TDesC8 const &)
+	?SendSystemEvent@TApaTask@@QAEXW4TApaSystemEvent@@@Z @ 223 NONAME ; void TApaTask::SendSystemEvent(enum TApaSystemEvent)
+	?SendToBackground@TApaTask@@QAEXXZ @ 224 NONAME ; void TApaTask::SendToBackground(void)
+	?ServiceArrayBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@@Z @ 225 NONAME ; class CBufFlat * CApaAppList::ServiceArrayBufferL(class TUid) const
+	?ServiceImplArrayBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@@Z @ 226 NONAME ; class CBufFlat * CApaAppList::ServiceImplArrayBufferL(class TUid) const
+	?ServiceImplArrayBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@ABVTDataType@@@Z @ 227 NONAME ; class CBufFlat * CApaAppList::ServiceImplArrayBufferL(class TUid, class TDataType const &) const
+	?ServiceOpaqueDataBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@0@Z @ 228 NONAME ; class CBufFlat * CApaAppList::ServiceOpaqueDataBufferL(class TUid, class TUid) const
+	?ServiceUidBufferL@CApaAppList@@QBEPAVCBufFlat@@VTUid@@@Z @ 229 NONAME ; class CBufFlat * CApaAppList::ServiceUidBufferL(class TUid) const
+	?SetAcceptedConfidence@RApaLsSession@@QAEHH@Z @ 230 NONAME ; int RApaLsSession::SetAcceptedConfidence(int)
+	?SetAppIsHiddenL@CApaRegistrationResourceFileWriter@@QAEXH@Z @ 231 NONAME ; void CApaRegistrationResourceFileWriter::SetAppIsHiddenL(int)
+	?SetAppReady@CApaWindowGroupName@@QAEXH@Z @ 232 NONAME ; void CApaWindowGroupName::SetAppReady(int)
+	?SetAppShortCaption@RApaLsSession@@QAEHABVTDesC16@@W4TLanguage@@VTUid@@@Z @ 233 NONAME ; int RApaLsSession::SetAppShortCaption(class TDesC16 const &, enum TLanguage, class TUid)
+	?SetAppUid@CApaWindowGroupName@@QAEXVTUid@@@Z @ 234 NONAME ; void CApaWindowGroupName::SetAppUid(class TUid)
+	?SetBusy@CApaWindowGroupName@@QAEXH@Z @ 235 NONAME ; void CApaWindowGroupName::SetBusy(int)
+	?SetCapability@CApaAppInfoFileWriter@@QAEHABVTDesC8@@@Z @ 236 NONAME ; int CApaAppInfoFileWriter::SetCapability(class TDesC8 const &)
+	?SetCaptionL@CApaWindowGroupName@@QAEXABVTDesC16@@@Z @ 237 NONAME ; void CApaWindowGroupName::SetCaptionL(class TDesC16 const &)
+	?SetDefaultScreenNumberL@CApaRegistrationResourceFileWriter@@QAEXH@Z @ 238 NONAME ; void CApaRegistrationResourceFileWriter::SetDefaultScreenNumberL(int)
+	?SetDocNameIsAFile@CApaWindowGroupName@@QAEXH@Z @ 239 NONAME ; void CApaWindowGroupName::SetDocNameIsAFile(int)
+	?SetDocNameL@CApaWindowGroupName@@QAEXABVTDesC16@@@Z @ 240 NONAME ; void CApaWindowGroupName::SetDocNameL(class TDesC16 const &)
+	?SetEmbeddabilityL@CApaRegistrationResourceFileWriter@@QAEXW4TEmbeddability@TApaAppCapability@@@Z @ 241 NONAME ; void CApaRegistrationResourceFileWriter::SetEmbeddabilityL(enum TApaAppCapability::TEmbeddability)
+	?SetFormatToGlassL@CApaDoor@@QAEXXZ @ 242 NONAME ; void CApaDoor::SetFormatToGlassL(void)
+	?SetFormatToIconL@CApaDoor@@QAEXXZ @ 243 NONAME ; void CApaDoor::SetFormatToIconL(void)
+	?SetFormatToTemporaryIconL@CApaDoor@@QAEXH@Z @ 244 NONAME ; void CApaDoor::SetFormatToTemporaryIconL(int)
+	?SetFsSessionL@RApaLsSession@@SAXAAVRFs@@@Z @ 245 NONAME ; void RApaLsSession::SetFsSessionL(class RFs &)
+	?SetGroupNameL@CApaRegistrationResourceFileWriter@@QAEXABVTDesC16@@@Z @ 246 NONAME ; void CApaRegistrationResourceFileWriter::SetGroupNameL(class TDesC16 const &)
+	?SetHidden@CApaWindowGroupName@@QAEXH@Z @ 247 NONAME ; void CApaWindowGroupName::SetHidden(int)
+	?SetLaunchInBackgroundL@CApaRegistrationResourceFileWriter@@QAEXH@Z @ 248 NONAME ; void CApaRegistrationResourceFileWriter::SetLaunchInBackgroundL(int)
+	?SetMaskBitmap@CApaMaskedBitmap@@QAEXPAVCFbsBitmap@@@Z @ 249 NONAME ; void CApaMaskedBitmap::SetMaskBitmap(class CFbsBitmap *)
+	?SetMaxDataBufSize@RApaLsSession@@QAEHH@Z @ 250 NONAME ; int RApaLsSession::SetMaxDataBufSize(int)
+	?SetNotify@RApaLsSession@@QAEXHAAVTRequestStatus@@@Z @ 251 NONAME ; void RApaLsSession::SetNotify(int, class TRequestStatus &)
+	?SetOpaqueDataL@CApaRegistrationResourceFileWriter@@QAEXABVTDesC8@@@Z @ 252 NONAME ; void CApaRegistrationResourceFileWriter::SetOpaqueDataL(class TDesC8 const &)
+	?SetRespondsToShutdownEvent@CApaWindowGroupName@@QAEXH@Z @ 253 NONAME ; void CApaWindowGroupName::SetRespondsToShutdownEvent(int)
+	?SetRespondsToSwitchFilesEvent@CApaWindowGroupName@@QAEXH@Z @ 254 NONAME ; void CApaWindowGroupName::SetRespondsToSwitchFilesEvent(int)
+	?SetShortCaptionL@CApaAppData@@QAEXABVTDesC16@@@Z @ 255 NONAME ; void CApaAppData::SetShortCaptionL(class TDesC16 const &)
+	?SetSupportsNewFileL@CApaRegistrationResourceFileWriter@@QAEXH@Z @ 256 NONAME ; void CApaRegistrationResourceFileWriter::SetSupportsNewFileL(int)
+	?SetSystem@CApaWindowGroupName@@QAEXH@Z @ 257 NONAME ; void CApaWindowGroupName::SetSystem(int)
+	?SetUpdatedAppsList@CApaAppList@@QAEXPAVCUpdatedAppsList@@@Z @ 258 NONAME ABSENT ; void CApaAppList::SetUpdatedAppsList(class CUpdatedAppsList *)
+	?SetWgId@TApaTask@@QAEXH@Z @ 259 NONAME ; void TApaTask::SetWgId(int)
+	?SetWindowGroupName@CApaWindowGroupName@@QAEXPAVHBufC16@@@Z @ 260 NONAME ; void CApaWindowGroupName::SetWindowGroupName(class HBufC16 *)
+	?SetWindowGroupName@CApaWindowGroupName@@QBEHAAVRWindowGroup@@@Z @ 261 NONAME ; int CApaWindowGroupName::SetWindowGroupName(class RWindowGroup &) const
+	?SetWindowGroupNameL@CApaWindowGroupName@@QAEXABVTDesC16@@@Z @ 262 NONAME ; void CApaWindowGroupName::SetWindowGroupNameL(class TDesC16 const &)
+	?ShortCaption@CApaSystemControl@@QBE?AVTPtrC16@@XZ @ 263 NONAME ; class TPtrC16 CApaSystemControl::ShortCaption(void) const
+	?StartApp@RApaLsSession@@QAEHABVCApaCommandLine@@@Z @ 264 NONAME ; int RApaLsSession::StartApp(class CApaCommandLine const &)
+	?StartApp@RApaLsSession@@QAEHABVCApaCommandLine@@AAVTThreadId@@@Z @ 265 NONAME ; int RApaLsSession::StartApp(class CApaCommandLine const &, class TThreadId &)
+	?StartApp@RApaLsSession@@QAEHABVCApaCommandLine@@AAVTThreadId@@PAVTRequestStatus@@@Z @ 266 NONAME ; int RApaLsSession::StartApp(class CApaCommandLine const &, class TThreadId &, class TRequestStatus *)
+	?StartDocument@RApaLsSession@@QAEHAAVRFile@@AAVTThreadId@@PAVTRequestStatus@@@Z @ 267 NONAME ; int RApaLsSession::StartDocument(class RFile &, class TThreadId &, class TRequestStatus *)
+	?StartDocument@RApaLsSession@@QAEHAAVRFile@@ABVTDataType@@AAVTThreadId@@PAVTRequestStatus@@@Z @ 268 NONAME ; int RApaLsSession::StartDocument(class RFile &, class TDataType const &, class TThreadId &, class TRequestStatus *)
+	?StartDocument@RApaLsSession@@QAEHAAVRFile@@VTUid@@AAVTThreadId@@PAVTRequestStatus@@@Z @ 269 NONAME ; int RApaLsSession::StartDocument(class RFile &, class TUid, class TThreadId &, class TRequestStatus *)
+	?StartDocument@RApaLsSession@@QAEHABVTDesC16@@AAVTThreadId@@W4TLaunchType@1@@Z @ 270 NONAME ; int RApaLsSession::StartDocument(class TDesC16 const &, class TThreadId &, enum RApaLsSession::TLaunchType)
+	?StartDocument@RApaLsSession@@QAEHABVTDesC16@@ABVTDataType@@AAVTThreadId@@W4TLaunchType@1@@Z @ 271 NONAME ; int RApaLsSession::StartDocument(class TDesC16 const &, class TDataType const &, class TThreadId &, enum RApaLsSession::TLaunchType)
+	?StartDocument@RApaLsSession@@QAEHABVTDesC16@@VTUid@@AAVTThreadId@@W4TLaunchType@1@@Z @ 272 NONAME ; int RApaLsSession::StartDocument(class TDesC16 const &, class TUid, class TThreadId &, enum RApaLsSession::TLaunchType)
+	?StartIdleUpdateL@CApaAppList@@QAEXPAVMApaAppListObserver@@@Z @ 273 NONAME ; void CApaAppList::StartIdleUpdateL(class MApaAppListObserver *)
+	?StartIdleUpdateL@CApaAppList@@QAEXXZ @ 274 NONAME ; void CApaAppList::StartIdleUpdateL(void)
+	?StartupApaServer@@YAHAAVMApaAppStarter@@@Z @ 275 NONAME ; int StartupApaServer(class MApaAppStarter &)
+	?StartupApaServerProcess@@YAHXZ @ 276 NONAME ; int StartupApaServerProcess(void)
+	?StopScan@CApaAppList@@QAEXH@Z @ 277 NONAME ; void CApaAppList::StopScan(TBool)
+	?StoreL@CApaAppInfoFileWriter@@QAEXXZ @ 278 NONAME ; void CApaAppInfoFileWriter::StoreL(void)
+	?SwitchCreateFile@TApaTask@@QAEHABVTDesC16@@@Z @ 279 NONAME ; int TApaTask::SwitchCreateFile(class TDesC16 const &)
+	?SwitchOpenFile@TApaTask@@QAEHABVTDesC16@@@Z @ 280 NONAME ; int TApaTask::SwitchOpenFile(class TDesC16 const &)
+	?TestIconLoaderAndIconArrayL@TIconLoaderAndIconArrayForLeaks@@SAXXZ @ 281 NONAME ; void TIconLoaderAndIconArrayForLeaks::TestIconLoaderAndIconArrayL(void)
+	?ThreadId@TApaTask@@QBE?AVTThreadId@@XZ @ 282 NONAME ; class TThreadId TApaTask::ThreadId(void) const
+	?Type@CApaSystemControl@@QBE?AVTUid@@XZ @ 283 NONAME ; class TUid CApaSystemControl::Type(void) const
+	?Uid@CApaAppViewData@@QBE?AVTUid@@XZ @ 284 NONAME ; class TUid CApaAppViewData::Uid(void) const
+	?Uid@TApaAppServiceInfo@@QBE?AVTUid@@XZ @ 285 NONAME ; class TUid TApaAppServiceInfo::Uid(void) const
+	?UpdateL@CApaSystemControlList@@QAEXXZ @ 286 NONAME ; void CApaSystemControlList::UpdateL(void)
+	?UpdatedAppsList@CApaAppList@@QAEPAVCUpdatedAppsList@@XZ @ 287 NONAME ABSENT ; class CUpdatedAppsList * CApaAppList::UpdatedAppsList(void)
+	?Version@RApaLsSession@@QBE?AVTVersion@@XZ @ 288 NONAME ; class TVersion RApaLsSession::Version(void) const
+	?Views@CApaAppData@@QBEPAV?$CArrayPtrFlat@VCApaAppViewData@@@@XZ @ 289 NONAME ; class CArrayPtrFlat<class CApaAppViewData> * CApaAppData::Views(void) const
+	?WgId@TApaTask@@QBEHXZ @ 290 NONAME ; int TApaTask::WgId(void) const
+	?WindowGroupName@CApaWindowGroupName@@QBE?AVTPtrC16@@XZ @ 291 NONAME ; class TPtrC16 CApaWindowGroupName::WindowGroupName(void) const
+	?KMinApplicationStackSize@@3HB @ 292 NONAME ; int const KMinApplicationStackSize
+	?CheckAppSecurity@CApaSecurityUtils@@SAHABVTPtrC16@@AAH1@Z @ 293 NONAME ; int CApaSecurityUtils::CheckAppSecurity(class TPtrC16 const &, int &, int &)
+	?SetCaptionL@CApaAppData@@QAEXABVTDesC16@@@Z @ 294 NONAME ; void CApaAppData::SetCaptionL(class TDesC16 const &)
+	?SetIconsL@CApaAppData@@QAEXABVTDesC16@@H@Z @ 295 NONAME ; void CApaAppData::SetIconsL(class TDesC16 const &, int)
+	?TestIconCaptionOverridesL@TIconLoaderAndIconArrayForLeaks@@SAXXZ @ 296 NONAME ; void TIconLoaderAndIconArrayForLeaks::TestIconCaptionOverridesL(void)
+	?ForceCommitNonNativeApplicationsUpdatesL@RApaLsSession@@QAEXXZ @ 297 NONAME ; void RApaLsSession::ForceCommitNonNativeApplicationsUpdatesL(void)
+	?AppListUpdatePending@CApaAppList@@QAEHXZ @ 298 NONAME ; int CApaAppList::AppListUpdatePending(void)
+	?UninstalledAppArray@CApaAppList@@QAEPAV?$CArrayFixFlat@VTUid@@@@XZ @ 299 NONAME ; class CArrayFixFlat<class TUid> * CApaAppList::UninstalledAppArray(void)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/bwins/apstartu.def	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?NewL@CApaAppStart@@SAPAV1@XZ @ 1 NONAME ; class CApaAppStart * CApaAppStart::NewL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/eabi/APFILE_9_REMOVE_UI_FRAMEWORKS_V1U.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,101 @@
+EXPORTS
+	_ZN19CApaAppLocatorProxy16GetAppEntryByUidER12TApaAppEntry4TUid @ 1 NONAME ABSENT
+	_ZN19CApaAppLocatorProxy21GetAppCapabilityByUidER5TDes84TUid @ 2 NONAME ABSENT
+	_ZN19CApaAppLocatorProxy4NewLER3RFs @ 3 NONAME ABSENT
+	_ZN19CApaAppLocatorProxyD0Ev @ 4 NONAME ABSENT
+	_ZN19CApaAppLocatorProxyD1Ev @ 5 NONAME ABSENT
+	_ZN19CApaAppLocatorProxyD2Ev @ 6 NONAME ABSENT
+	_ZN21CApaScanningAppFinder12FindAllAppsLEv @ 7 NONAME ABSENT
+	_ZN21CApaScanningAppFinder4NewLERK3RFs @ 8 NONAME ABSENT
+	_ZN21CApaScanningAppFinder5NewLCERK3RFs @ 9 NONAME ABSENT
+	_ZN21CApaScanningAppFinder5NextLER12TApaAppEntry @ 10 NONAME ABSENT
+	_ZN21CApaScanningAppFinder8FindAppLERK7TDesC164TUid @ 11 NONAME ABSENT
+	_ZN21CApaScanningAppFinderD0Ev @ 12 NONAME ABSENT
+	_ZN21CApaScanningAppFinderD1Ev @ 13 NONAME ABSENT
+	_ZN21CApaScanningAppFinderD2Ev @ 14 NONAME ABSENT
+	_ZN25CApaScanningControlFinder12FindAllAppsLEv @ 15 NONAME ABSENT
+	_ZN25CApaScanningControlFinder4NewLERK3RFs @ 16 NONAME ABSENT
+	_ZN25CApaScanningControlFinder5NewLCERK3RFs @ 17 NONAME ABSENT
+	_ZN25CApaScanningControlFinder5NextLER12TApaAppEntry @ 18 NONAME ABSENT
+	_ZN25CApaScanningControlFinder8FindAppLERK7TDesC164TUid @ 19 NONAME ABSENT
+	_ZN25CApaScanningControlFinderD0Ev @ 20 NONAME ABSENT
+	_ZN25CApaScanningControlFinderD1Ev @ 21 NONAME ABSENT
+	_ZN25CApaScanningControlFinderD2Ev @ 22 NONAME ABSENT
+	_ZN26CApaScanningFileRecognizer10ConstructLEv @ 23 NONAME
+	_ZN26CApaScanningFileRecognizer14SetRecognizerLERKNS_11TRecognizerE @ 24 NONAME ABSENT
+	_ZN26CApaScanningFileRecognizer15RecognizerCountEv @ 25 NONAME
+	_ZN26CApaScanningFileRecognizer19ScanForRecognizersLEv @ 26 NONAME
+	_ZN26CApaScanningFileRecognizer23SetRecognizersFromListLERK13CArrayFixFlatINS_11TRecognizerEE @ 27 NONAME ABSENT
+	_ZN26CApaScanningFileRecognizer4NewLER3RFsP14MApaAppStarter @ 28 NONAME
+	_ZN26CApaScanningFileRecognizerC1ER3RFsP14MApaAppStarter @ 29 NONAME
+	_ZN26CApaScanningFileRecognizerC2ER3RFsP14MApaAppStarter @ 30 NONAME
+	_ZN26CApaScanningFileRecognizerD0Ev @ 31 NONAME
+	_ZN26CApaScanningFileRecognizerD1Ev @ 32 NONAME
+	_ZN26CApaScanningFileRecognizerD2Ev @ 33 NONAME
+	_ZN6Apfile8TempPathEv @ 34 NONAME ABSENT
+	_ZNK21CApaScanningAppFinder22DefaultAppInfoFileNameEv @ 35 NONAME ABSENT
+	_ZNK21CApaScanningAppFinder8TempPathEv @ 36 NONAME ABSENT
+	_ZNK25CApaScanningControlFinder22DefaultAppInfoFileNameEv @ 37 NONAME ABSENT
+	_ZNK25CApaScanningControlFinder8TempPathEv @ 38 NONAME ABSENT
+	_ZNK26CApaScanningFileRecognizer13UpdateCounterEv @ 39 NONAME
+	_ZNK26CApaScanningFileRecognizer16RecognizerListLCEv @ 40 NONAME
+	_ZNK26CApaScanningFileRecognizerixEi @ 41 NONAME
+	_ZTI26CApaScanningFileRecognizer @ 42 NONAME ; #<TI>#
+	_ZTV26CApaScanningFileRecognizer @ 43 NONAME ; #<VT>#
+	_ZN26CApaScanningFileRecognizer18SetEcomRecognizerLERKNS_11TRecognizerE @ 44 NONAME
+	_ZN26CApaScanningFileRecognizer27SetEcomRecognizersFromListLERK13CArrayFixFlatINS_11TRecognizerEE @ 45 NONAME
+	_ZTI17CApaRecognizerDll @ 46 NONAME ; #<TI>#
+	_ZTI19CApaAppLocatorProxy @ 47 NONAME ABSENT ; #<TI>#
+	_ZTI21CApaScanningAppFinder @ 48 NONAME ABSENT ; #<TI>#
+	_ZTI25CApaScanningControlFinder @ 49 NONAME ABSENT ; #<TI>#
+	_ZTIN26CApaScanningFileRecognizer27CApaBackupOperationObserverE @ 50 NONAME ; #<TI>#
+	_ZTV17CApaRecognizerDll @ 51 NONAME ; #<VT>#
+	_ZTV19CApaAppLocatorProxy @ 52 NONAME ABSENT ; #<VT>#
+	_ZTV21CApaScanningAppFinder @ 53 NONAME ABSENT ; #<VT>#
+	_ZTV25CApaScanningControlFinder @ 54 NONAME ABSENT ; #<VT>#
+	_ZTVN26CApaScanningFileRecognizer27CApaBackupOperationObserverE @ 55 NONAME ; #<VT>#
+	_ZN16CApaAppRegFinder12FindAllAppsLEv @ 56 NONAME
+	_ZN16CApaAppRegFinder4NewLERK3RFs @ 57 NONAME
+	_ZN16CApaAppRegFinder5NewLCERK3RFs @ 58 NONAME
+	_ZN16CApaAppRegFinder5NextLER12TApaAppEntry @ 59 NONAME ABSENT
+	_ZN16CApaAppRegFinder5NextLER12TApaAppEntryRK13RPointerArrayI7HBufC16E @ 60 NONAME
+	_ZNK16CApaAppRegFinder8TempPathEv @ 61 NONAME ABSENT
+	_ZTI16CApaAppRegFinder @ 62 NONAME ; #<TI>#
+	_ZTV16CApaAppRegFinder @ 63 NONAME ; #<VT>#
+	_ZN17CAppLaunchChecker10Reserved_1Ev @ 64 NONAME
+	_ZN17CAppLaunchChecker10Reserved_2Ev @ 65 NONAME
+	_ZN17CAppLaunchChecker10Reserved_3Ev @ 66 NONAME
+	_ZN17CAppLaunchCheckerD0Ev @ 67 NONAME
+	_ZN17CAppLaunchCheckerD1Ev @ 68 NONAME
+	_ZN17CAppLaunchCheckerD2Ev @ 69 NONAME
+	_ZN28CApaScanningRuleBasedPlugIns4NewLEv @ 70 NONAME
+	_ZNK28CApaScanningRuleBasedPlugInsixEi @ 71 NONAME
+	_ZTI16CApaRuleBasedDll @ 72 NONAME ; #<TI>#
+	_ZTI17CAppLaunchChecker @ 73 NONAME ; #<TI>#
+	_ZTV16CApaRuleBasedDll @ 74 NONAME ; #<VT>#
+	_ZTV17CAppLaunchChecker @ 75 NONAME ; #<VT>#
+	_ZN28CApaScanningRuleBasedPlugInsD0Ev @ 76 NONAME
+	_ZN28CApaScanningRuleBasedPlugInsD1Ev @ 77 NONAME
+	_ZN28CApaScanningRuleBasedPlugInsD2Ev @ 78 NONAME
+	_ZTI28CApaScanningRuleBasedPlugIns @ 79 NONAME ; #<TI>#
+	_ZTV28CApaScanningRuleBasedPlugIns @ 80 NONAME ; #<VT>#
+	_ZN28CApaScanningRuleBasedPlugIns24ScanForRuleBasedPlugInsLEv @ 81 NONAME
+	_ZNK28CApaScanningRuleBasedPlugIns19ImplementationCountEv @ 82 NONAME
+	_ZN14CAppSidChecker18SetRescanCallBackLERK9TCallBack @ 83 NONAME
+	_ZN14CAppSidChecker9reserved1Ev @ 84 NONAME
+	_ZN14CAppSidChecker9reserved2Ev @ 85 NONAME
+	_ZN14CAppSidChecker9reserved3Ev @ 86 NONAME
+	_ZN14CAppSidCheckerD0Ev @ 87 NONAME
+	_ZN14CAppSidCheckerD1Ev @ 88 NONAME
+	_ZN14CAppSidCheckerD2Ev @ 89 NONAME
+	_ZTI14CAppSidChecker @ 90 NONAME ; #<TI>#
+	_ZTV14CAppSidChecker @ 91 NONAME ; #<VT>#
+	X @ 92 NONAME ABSENT
+	X @ 93 NONAME ABSENT
+	_ZN23CApaAppUnInstallMonitor4NewLEP17CApaAppListServer @ 94 NONAME
+	_ZN23CApaAppUnInstallMonitor5StartEv @ 95 NONAME
+	_ZN23CApaAppUnInstallMonitorD0Ev @ 96 NONAME
+	_ZN23CApaAppUnInstallMonitorD1Ev @ 97 NONAME
+	_ZN23CApaAppUnInstallMonitorD2Ev @ 98 NONAME
+	
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/eabi/APFILE_UI_FRAMEWORKSU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,115 @@
+EXPORTS
+	_ZN19CApaAppLocatorProxy16GetAppEntryByUidER12TApaAppEntry4TUid @ 1 NONAME ABSENT
+	_ZN19CApaAppLocatorProxy21GetAppCapabilityByUidER5TDes84TUid @ 2 NONAME ABSENT
+	_ZN19CApaAppLocatorProxy4NewLER3RFs @ 3 NONAME ABSENT
+	_ZN19CApaAppLocatorProxyD0Ev @ 4 NONAME ABSENT
+	_ZN19CApaAppLocatorProxyD1Ev @ 5 NONAME ABSENT
+	_ZN19CApaAppLocatorProxyD2Ev @ 6 NONAME ABSENT
+	_ZN21CApaScanningAppFinder12FindAllAppsLEv @ 7 NONAME ABSENT
+	_ZN21CApaScanningAppFinder4NewLERK3RFs @ 8 NONAME ABSENT
+	_ZN21CApaScanningAppFinder5NewLCERK3RFs @ 9 NONAME ABSENT
+	_ZN21CApaScanningAppFinder5NextLER12TApaAppEntry @ 10 NONAME ABSENT
+	_ZN21CApaScanningAppFinder8FindAppLERK7TDesC164TUid @ 11 NONAME ABSENT
+	_ZN21CApaScanningAppFinderD0Ev @ 12 NONAME ABSENT
+	_ZN21CApaScanningAppFinderD1Ev @ 13 NONAME ABSENT
+	_ZN21CApaScanningAppFinderD2Ev @ 14 NONAME ABSENT
+	_ZN25CApaScanningControlFinder12FindAllAppsLEv @ 15 NONAME ABSENT
+	_ZN25CApaScanningControlFinder4NewLERK3RFs @ 16 NONAME ABSENT
+	_ZN25CApaScanningControlFinder5NewLCERK3RFs @ 17 NONAME ABSENT
+	_ZN25CApaScanningControlFinder5NextLER12TApaAppEntry @ 18 NONAME ABSENT
+	_ZN25CApaScanningControlFinder8FindAppLERK7TDesC164TUid @ 19 NONAME ABSENT
+	_ZN25CApaScanningControlFinderD0Ev @ 20 NONAME ABSENT
+	_ZN25CApaScanningControlFinderD1Ev @ 21 NONAME ABSENT
+	_ZN25CApaScanningControlFinderD2Ev @ 22 NONAME ABSENT
+	_ZN26CApaScanningFileRecognizer10ConstructLEv @ 23 NONAME
+	_ZN26CApaScanningFileRecognizer14SetRecognizerLERKNS_11TRecognizerE @ 24 NONAME ABSENT
+	_ZN26CApaScanningFileRecognizer15RecognizerCountEv @ 25 NONAME
+	_ZN26CApaScanningFileRecognizer19ScanForRecognizersLEv @ 26 NONAME
+	_ZN26CApaScanningFileRecognizer23SetRecognizersFromListLERK13CArrayFixFlatINS_11TRecognizerEE @ 27 NONAME ABSENT
+	_ZN26CApaScanningFileRecognizer4NewLER3RFsP14MApaAppStarter @ 28 NONAME
+	_ZN26CApaScanningFileRecognizerC1ER3RFsP14MApaAppStarter @ 29 NONAME
+	_ZN26CApaScanningFileRecognizerC2ER3RFsP14MApaAppStarter @ 30 NONAME
+	_ZN26CApaScanningFileRecognizerD0Ev @ 31 NONAME
+	_ZN26CApaScanningFileRecognizerD1Ev @ 32 NONAME
+	_ZN26CApaScanningFileRecognizerD2Ev @ 33 NONAME
+	_ZN6Apfile8TempPathEv @ 34 NONAME ABSENT
+	_ZNK21CApaScanningAppFinder22DefaultAppInfoFileNameEv @ 35 NONAME ABSENT
+	_ZNK21CApaScanningAppFinder8TempPathEv @ 36 NONAME ABSENT
+	_ZNK25CApaScanningControlFinder22DefaultAppInfoFileNameEv @ 37 NONAME ABSENT
+	_ZNK25CApaScanningControlFinder8TempPathEv @ 38 NONAME ABSENT
+	_ZNK26CApaScanningFileRecognizer13UpdateCounterEv @ 39 NONAME
+	_ZNK26CApaScanningFileRecognizer16RecognizerListLCEv @ 40 NONAME
+	_ZNK26CApaScanningFileRecognizerixEi @ 41 NONAME
+	_ZTI26CApaScanningFileRecognizer @ 42 NONAME ; #<TI>#
+	_ZTV26CApaScanningFileRecognizer @ 43 NONAME ; #<VT>#
+	_ZN26CApaScanningFileRecognizer18SetEcomRecognizerLERKNS_11TRecognizerE @ 44 NONAME
+	_ZN26CApaScanningFileRecognizer27SetEcomRecognizersFromListLERK13CArrayFixFlatINS_11TRecognizerEE @ 45 NONAME
+	_ZTI17CApaRecognizerDll @ 46 NONAME ; #<TI>#
+	_ZTI19CApaAppLocatorProxy @ 47 NONAME ABSENT ; #<TI>#
+	_ZTI21CApaScanningAppFinder @ 48 NONAME ABSENT ; #<TI>#
+	_ZTI25CApaScanningControlFinder @ 49 NONAME ABSENT ; #<TI>#
+	_ZTIN26CApaScanningFileRecognizer27CApaBackupOperationObserverE @ 50 NONAME ; #<TI>#
+	_ZTV17CApaRecognizerDll @ 51 NONAME ; #<VT>#
+	_ZTV19CApaAppLocatorProxy @ 52 NONAME ABSENT ; #<VT>#
+	_ZTV21CApaScanningAppFinder @ 53 NONAME ABSENT ; #<VT>#
+	_ZTV25CApaScanningControlFinder @ 54 NONAME ABSENT ; #<VT>#
+	_ZTVN26CApaScanningFileRecognizer27CApaBackupOperationObserverE @ 55 NONAME ; #<VT>#
+	_ZN16CApaAppRegFinder12FindAllAppsLEv @ 56 NONAME
+	_ZN16CApaAppRegFinder4NewLERK3RFs @ 57 NONAME
+	_ZN16CApaAppRegFinder5NewLCERK3RFs @ 58 NONAME
+	_ZN16CApaAppRegFinder5NextLER12TApaAppEntry @ 59 NONAME ABSENT
+	_ZN16CApaAppRegFinder5NextLER12TApaAppEntryRK13RPointerArrayI7HBufC16E @ 60 NONAME
+	_ZNK16CApaAppRegFinder8TempPathEv @ 61 NONAME ABSENT
+	_ZTI16CApaAppRegFinder @ 62 NONAME ; #<TI>#
+	_ZTV16CApaAppRegFinder @ 63 NONAME ; #<VT>#
+	_ZN17CAppLaunchChecker10Reserved_1Ev @ 64 NONAME
+	_ZN17CAppLaunchChecker10Reserved_2Ev @ 65 NONAME
+	_ZN17CAppLaunchChecker10Reserved_3Ev @ 66 NONAME
+	_ZN17CAppLaunchCheckerD0Ev @ 67 NONAME
+	_ZN17CAppLaunchCheckerD1Ev @ 68 NONAME
+	_ZN17CAppLaunchCheckerD2Ev @ 69 NONAME
+	_ZN28CApaScanningRuleBasedPlugIns4NewLEv @ 70 NONAME
+	_ZNK28CApaScanningRuleBasedPlugInsixEi @ 71 NONAME
+	_ZTI16CApaRuleBasedDll @ 72 NONAME ; #<TI>#
+	_ZTI17CAppLaunchChecker @ 73 NONAME ; #<TI>#
+	_ZTV16CApaRuleBasedDll @ 74 NONAME ; #<VT>#
+	_ZTV17CAppLaunchChecker @ 75 NONAME ; #<VT>#
+	_ZN28CApaScanningRuleBasedPlugInsD0Ev @ 76 NONAME
+	_ZN28CApaScanningRuleBasedPlugInsD1Ev @ 77 NONAME
+	_ZN28CApaScanningRuleBasedPlugInsD2Ev @ 78 NONAME
+	_ZTI28CApaScanningRuleBasedPlugIns @ 79 NONAME ; #<TI>#
+	_ZTV28CApaScanningRuleBasedPlugIns @ 80 NONAME ; #<VT>#
+	_ZN28CApaScanningRuleBasedPlugIns24ScanForRuleBasedPlugInsLEv @ 81 NONAME
+	_ZNK28CApaScanningRuleBasedPlugIns19ImplementationCountEv @ 82 NONAME
+	_ZN14CAppSidChecker18SetRescanCallBackLERK9TCallBack @ 83 NONAME
+	_ZN14CAppSidChecker9reserved1Ev @ 84 NONAME
+	_ZN14CAppSidChecker9reserved2Ev @ 85 NONAME
+	_ZN14CAppSidChecker9reserved3Ev @ 86 NONAME
+	_ZN14CAppSidCheckerD0Ev @ 87 NONAME
+	_ZN14CAppSidCheckerD1Ev @ 88 NONAME
+	_ZN14CAppSidCheckerD2Ev @ 89 NONAME
+	_ZTI14CAppSidChecker @ 90 NONAME ; #<TI>#
+	_ZTV14CAppSidChecker @ 91 NONAME ; #<VT>#
+	_ZNK16CApaAppRegFinder9DriveListEv @ 92 NONAME
+	_ZN16CApaAppRegFinder26FindAllRemovableMediaAppsLEv @ 93 NONAME
+	_ZN23CApaAppUnInstallMonitor4NewLEP17CApaAppListServer @ 94 NONAME
+	_ZN23CApaAppUnInstallMonitor5StartEv @ 95 NONAME
+	_ZN23CApaAppUnInstallMonitorD0Ev @ 96 NONAME
+	_ZN23CApaAppUnInstallMonitorD1Ev @ 97 NONAME
+	_ZN23CApaAppUnInstallMonitorD2Ev @ 98 NONAME
+	_ZN21CApfMimeContentPolicy12IsClosedTypeERK7TDesC16 @ 99 NONAME
+	_ZN21CApfMimeContentPolicy13IsClosedFileLER5RFile @ 100 NONAME
+	_ZN21CApfMimeContentPolicy13IsClosedFileLERK7TDesC16 @ 101 NONAME
+	_ZN21CApfMimeContentPolicy14IsDRMEnvelopeLER5RFile @ 102 NONAME
+	_ZN21CApfMimeContentPolicy14IsDRMEnvelopeLERK7TDesC16 @ 103 NONAME
+	_ZN21CApfMimeContentPolicy17IsClosedExtensionERK7TDesC16 @ 104 NONAME
+	_ZN21CApfMimeContentPolicy4NewLER3RFs @ 105 NONAME
+	_ZN21CApfMimeContentPolicy4NewLEv @ 106 NONAME
+	_ZN21CApfMimeContentPolicy5NewLCER3RFs @ 107 NONAME
+	_ZN21CApfMimeContentPolicy5NewLCEv @ 108 NONAME
+	_ZN21CApfMimeContentPolicyD0Ev @ 109 NONAME
+	_ZN21CApfMimeContentPolicyD1Ev @ 110 NONAME
+	_ZN21CApfMimeContentPolicyD2Ev @ 111 NONAME
+	_ZTI21CApfMimeContentPolicy @ 112 NONAME
+	_ZTV21CApfMimeContentPolicy @ 113 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/eabi/APGRFX_9_REMOVE_UI_FRAMEWORKS_V1U.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,338 @@
+EXPORTS
+	_ZN11CApaAppData11GetIconInfoERiS0_ @ 1 NONAME
+	_ZN11CApaAppData16CanUseScreenModeEi @ 2 NONAME
+	_ZN11CApaAppList16StartIdleUpdateLEP19MApaAppListObserver @ 3 NONAME
+	_ZN11CApaAppList16StartIdleUpdateLEv @ 4 NONAME
+	_ZN11CApaAppList4NewLER3RFsP13CApaAppFinder @ 5 NONAME
+	_ZN11CApaAppList6PurgeLEv @ 6 NONAME
+	_ZN11CApaAppList7UpdateLEv @ 7 NONAME
+	_ZN11CApaAppList9InitListLEP19MApaAppListObserver @ 8 NONAME
+	_ZN11CApaAppListD0Ev @ 9 NONAME
+	_ZN11CApaAppListD1Ev @ 10 NONAME
+	_ZN11CApaAppListD2Ev @ 11 NONAME
+	_ZN12TApaTaskList10CycleTasksE4TUidNS_15TCycleDirectionE @ 12 NONAME
+	_ZN12TApaTaskList7FindAppE4TUid @ 13 NONAME
+	_ZN12TApaTaskList7FindAppERK7TDesC16 @ 14 NONAME
+	_ZN12TApaTaskList7FindDocERK7TDesC16 @ 15 NONAME
+	_ZN12TApaTaskList9FindByPosEi @ 16 NONAME
+	_ZN12TApaTaskListC1ER10RWsSession @ 17 NONAME
+	_ZN12TApaTaskListC2ER10RWsSession @ 18 NONAME
+	_ZN13RApaLsSession13StartDocumentERK7TDesC164TUidR9TThreadIdNS_11TLaunchTypeE @ 19 NONAME
+	_ZN13RApaLsSession13StartDocumentERK7TDesC16R9TThreadIdNS_11TLaunchTypeE @ 20 NONAME
+	_ZN13RApaLsSession13StartDocumentERK7TDesC16RK9TDataTypeR9TThreadIdNS_11TLaunchTypeE @ 21 NONAME
+	_ZN13RApaLsSession14CreateDocumentERK7TDesC164TUidR9TThreadIdNS_11TLaunchTypeE @ 22 NONAME
+	_ZN13RApaLsSession17SetMaxDataBufSizeEi @ 23 NONAME
+	_ZN13RApaLsSession21SetAcceptedConfidenceEi @ 24 NONAME
+	_ZN13RApaLsSession7ConnectEv @ 25 NONAME
+	_ZN13RApaLsSession8StartAppERK15CApaCommandLine @ 26 NONAME
+	_ZN13RApaLsSession8StartAppERK15CApaCommandLineR9TThreadId @ 27 NONAME
+	_ZN13RApaLsSessionC1Ev @ 28 NONAME
+	_ZN13RApaLsSessionC2Ev @ 29 NONAME
+	_ZN16AppInfoFileUtils14GetAifFileNameERK3RFsR6TDes16 @ 30 NONAME ABSENT
+	_ZN16CApaMaskedBitmap12InternalizeLER11RReadStream @ 31 NONAME
+	_ZN16CApaMaskedBitmap13SetMaskBitmapEP10CFbsBitmap @ 32 NONAME
+	_ZN16CApaMaskedBitmap4NewLEPS_ @ 33 NONAME
+	_ZN16CApaMaskedBitmap5NewLCEv @ 34 NONAME
+	_ZN16CApaMaskedBitmapD0Ev @ 35 NONAME
+	_ZN16CApaMaskedBitmapD1Ev @ 36 NONAME
+	_ZN16CApaMaskedBitmapD2Ev @ 37 NONAME
+	_ZN17CApaSystemControl7CreateLEv @ 38 NONAME
+	_ZN18TApaPictureFactoryC1EP11CApaProcess @ 39 NONAME
+	_ZN18TApaPictureFactoryC2EP11CApaProcess @ 40 NONAME
+	_ZN19CApaAppListNotifier4NewLEP23MApaAppListServObserverN7CActive9TPriorityE @ 41 NONAME
+	_ZN19CApaAppListNotifierD0Ev @ 42 NONAME
+	_ZN19CApaAppListNotifierD1Ev @ 43 NONAME
+	_ZN19CApaAppListNotifierD2Ev @ 44 NONAME
+	_ZN19CApaWindowGroupName11SetAppReadyEi @ 45 NONAME
+	_ZN19CApaWindowGroupName11SetCaptionLERK7TDesC16 @ 46 NONAME
+	_ZN19CApaWindowGroupName11SetDocNameLERK7TDesC16 @ 47 NONAME
+	_ZN19CApaWindowGroupName12FindByAppUidE4TUidR10RWsSessionRi @ 48 NONAME
+	_ZN19CApaWindowGroupName13FindByCaptionERK7TDesC16R10RWsSessionRi @ 49 NONAME
+	_ZN19CApaWindowGroupName13FindByDocNameERK7TDesC16R10RWsSessionRi @ 50 NONAME
+	_ZN19CApaWindowGroupName17SetDocNameIsAFileEi @ 51 NONAME
+	_ZN19CApaWindowGroupName18ConstructFromWgIdLEi @ 52 NONAME
+	_ZN19CApaWindowGroupName18SetWindowGroupNameEP7HBufC16 @ 53 NONAME
+	_ZN19CApaWindowGroupName19SetWindowGroupNameLERK7TDesC16 @ 54 NONAME
+	_ZN19CApaWindowGroupName26SetRespondsToShutdownEventEi @ 55 NONAME
+	_ZN19CApaWindowGroupName29SetRespondsToSwitchFilesEventEi @ 56 NONAME
+	_ZN19CApaWindowGroupName3NewERK10RWsSessionP7HBufC16 @ 57 NONAME
+	_ZN19CApaWindowGroupName4NewLERK10RWsSession @ 58 NONAME
+	_ZN19CApaWindowGroupName4NewLERK10RWsSessionRK7TDesC16 @ 59 NONAME
+	_ZN19CApaWindowGroupName4NewLERK10RWsSessioni @ 60 NONAME
+	_ZN19CApaWindowGroupName5NewLCERK10RWsSession @ 61 NONAME
+	_ZN19CApaWindowGroupName5NewLCERK10RWsSessionRK7TDesC16 @ 62 NONAME
+	_ZN19CApaWindowGroupName5NewLCERK10RWsSessioni @ 63 NONAME
+	_ZN19CApaWindowGroupName6HiddenEv @ 64 NONAME
+	_ZN19CApaWindowGroupName7SetBusyEi @ 65 NONAME
+	_ZN19CApaWindowGroupName9SetAppUidE4TUid @ 66 NONAME
+	_ZN19CApaWindowGroupName9SetHiddenEi @ 67 NONAME
+	_ZN19CApaWindowGroupName9SetSystemEi @ 68 NONAME
+	_ZN19CApaWindowGroupNameD0Ev @ 69 NONAME
+	_ZN19CApaWindowGroupNameD1Ev @ 70 NONAME
+	_ZN19CApaWindowGroupNameD2Ev @ 71 NONAME
+	_ZN21CApaAppInfoFileReader12StretchDrawLEP10CFbsBitmapS1_5TSize @ 72 NONAME ABSENT
+	_ZN21CApaAppInfoFileReader19CreateMaskedBitmapLEi @ 73 NONAME ABSENT
+	_ZN21CApaAppInfoFileReader4NewLER3RFsRK7TDesC164TUid @ 74 NONAME ABSENT
+	_ZN21CApaAppInfoFileReader5NewLCER3RFsRK7TDesC164TUid @ 75 NONAME ABSENT
+	_ZN21CApaAppInfoFileReader8CaptionLE9TLanguage @ 76 NONAME ABSENT
+	_ZN21CApaAppInfoFileReaderD0Ev @ 77 NONAME ABSENT
+	_ZN21CApaAppInfoFileReaderD1Ev @ 78 NONAME ABSENT
+	_ZN21CApaAppInfoFileReaderD2Ev @ 79 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter10StoreViewLE4TUid @ 80 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter11AddCaptionLE9TLanguageRK7TDesC16 @ 81 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter12AddDataTypeLERK21TDataTypeWithPriority @ 82 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter12AddViewIconLER16CApaMaskedBitmap4TUid @ 83 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter13AddOwnedFileLERK7TDesC16 @ 84 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter13SetCapabilityERK6TDesC8 @ 85 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter15AddViewCaptionLE9TLanguageRK7TDesC164TUid @ 86 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter5NewLCER3RFsRK7TDesC164TUid @ 87 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter6StoreLEv @ 88 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter8AddIconLER16CApaMaskedBitmap @ 89 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter8AddIconLERK7TDesC16 @ 90 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter8AddViewLE4TUid @ 91 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter8AddViewLE4TUidi @ 92 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriterD0Ev @ 93 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriterD1Ev @ 94 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriterD2Ev @ 95 NONAME ABSENT
+	_ZN21CApaSystemControlList4NewLER3RFsR13CApaAppFinderRK7TDesC16 @ 96 NONAME ABSENT
+	_ZN21CApaSystemControlList7UpdateLEv @ 97 NONAME
+	_ZN21CApaSystemControlListD0Ev @ 98 NONAME
+	_ZN21CApaSystemControlListD1Ev @ 99 NONAME
+	_ZN21CApaSystemControlListD2Ev @ 100 NONAME
+	_ZN8CApaDoor16SetFormatToIconLEv @ 101 NONAME
+	_ZN8CApaDoor17SetFormatToGlassLEv @ 102 NONAME
+	_ZN8CApaDoor25SetFormatToTemporaryIconLEi @ 103 NONAME
+	_ZN8CApaDoor4NewLER3RFsR12CApaDocumentRK5TSize @ 104 NONAME
+	_ZN8CApaDoor4NewLER3RFsRK12CStreamStore9TStreamIdR11CApaProcess @ 105 NONAME
+	_ZN8CApaDoor5NewLCER3RFsR12CApaDocumentRK5TSize @ 106 NONAME
+	_ZN8CApaDoor8RestoreLERK12CStreamStore9TStreamId @ 107 NONAME
+	_ZN8CApaDoor9DocumentLEi @ 108 NONAME
+	_ZN8CApaDoorD0Ev @ 109 NONAME
+	_ZN8CApaDoorD1Ev @ 110 NONAME
+	_ZN8CApaDoorD2Ev @ 111 NONAME
+	_ZN8TApaTask11SendMessageE4TUidRK6TDesC8 @ 112 NONAME
+	_ZN8TApaTask14SwitchOpenFileERK7TDesC16 @ 113 NONAME
+	_ZN8TApaTask15SendSystemEventE15TApaSystemEvent @ 114 NONAME
+	_ZN8TApaTask16SendToBackgroundEv @ 115 NONAME
+	_ZN8TApaTask16SwitchCreateFileERK7TDesC16 @ 116 NONAME
+	_ZN8TApaTask17BringToForegroundEv @ 117 NONAME
+	_ZN8TApaTask7EndTaskEv @ 118 NONAME
+	_ZN8TApaTask7SendKeyERK9TKeyEvent @ 119 NONAME
+	_ZN8TApaTask7SendKeyEii @ 120 NONAME
+	_ZN8TApaTask7SetWgIdEi @ 121 NONAME
+	_ZN8TApaTask8KillTaskEv @ 122 NONAME
+	_ZN8TApaTaskC1ER10RWsSession @ 123 NONAME
+	_ZN8TApaTaskC2ER10RWsSession @ 124 NONAME
+	_ZNK11CApaAppData10CapabilityER5TDes8 @ 125 NONAME
+	_ZNK11CApaAppData10IconSizesLEv @ 126 NONAME
+	_ZNK11CApaAppData10OwnedFilesEv @ 127 NONAME
+	_ZNK11CApaAppData4IconE5TSize @ 128 NONAME
+	_ZNK11CApaAppData4IconEi @ 129 NONAME
+	_ZNK11CApaAppData5ViewsEv @ 130 NONAME
+	_ZNK11CApaAppData8AppEntryEv @ 131 NONAME
+	_ZNK11CApaAppData8DataTypeERK9TDataType @ 132 NONAME
+	_ZNK11CApaAppList12AppDataByUidE4TUid @ 133 NONAME
+	_ZNK11CApaAppList13UpdateCounterEv @ 134 NONAME
+	_ZNK11CApaAppList19IsFirstScanCompleteEv @ 135 NONAME
+	_ZNK11CApaAppList20IsIdleUpdateCompleteEv @ 136 NONAME
+	_ZNK11CApaAppList21PreferredDataHandlerLERK9TDataType @ 137 NONAME
+	_ZNK11CApaAppList5CountEv @ 138 NONAME
+	_ZNK11CApaAppList7NextAppEPK11CApaAppData @ 139 NONAME
+	_ZNK11CApaAppList7NextAppEPK11CApaAppDatai @ 140 NONAME
+	_ZNK11CApaAppList8FirstAppEi @ 141 NONAME
+	_ZNK11CApaAppList8FirstAppEv @ 142 NONAME
+	_ZNK13RApaLsSession10GetAllAppsEi @ 143 NONAME
+	_ZNK13RApaLsSession10GetAllAppsEv @ 144 NONAME
+	_ZNK13RApaLsSession10GetAppIconE4TUid5TSizeR16CApaMaskedBitmap @ 145 NONAME
+	_ZNK13RApaLsSession10GetAppIconE4TUidiR16CApaMaskedBitmap @ 146 NONAME
+	_ZNK13RApaLsSession10GetAppInfoER11TApaAppInfo4TUid @ 147 NONAME
+	_ZNK13RApaLsSession10GetNextAppER11TApaAppInfo @ 148 NONAME
+	_ZNK13RApaLsSession10GetNextAppER11TApaAppInfoi @ 149 NONAME
+	_ZNK13RApaLsSession11GetAppViewsER13CArrayFixFlatI15TApaAppViewInfoE4TUid @ 150 NONAME
+	_ZNK13RApaLsSession13RecognizeDataERK7TDesC16RK6TDesC8R22TDataRecognitionResult @ 151 NONAME
+	_ZNK13RApaLsSession14AppForDataTypeERK9TDataTypeR4TUid @ 152 NONAME
+	_ZNK13RApaLsSession14AppForDocumentERK7TDesC16R4TUidR9TDataType @ 153 NONAME
+	_ZNK13RApaLsSession14GetAppInfo_7_0ER15TApaAppInfo_7_04TUid @ 154 NONAME ABSENT
+	_ZNK13RApaLsSession14GetAppViewIconE4TUidS0_RK5TSizeR16CApaMaskedBitmap @ 155 NONAME
+	_ZNK13RApaLsSession14GetNextApp_7_0ER15TApaAppInfo_7_0 @ 156 NONAME ABSENT
+	_ZNK13RApaLsSession14GetNextApp_7_0ER15TApaAppInfo_7_0i @ 157 NONAME ABSENT
+	_ZNK13RApaLsSession15GetAppIconSizesE4TUidR13CArrayFixFlatI5TSizeE @ 158 NONAME
+	_ZNK13RApaLsSession15GetFilteredAppsERK23TApaEmbeddabilityFilter @ 159 NONAME
+	_ZNK13RApaLsSession15GetFilteredAppsERK23TApaEmbeddabilityFilteri @ 160 NONAME
+	_ZNK13RApaLsSession16GetAppCapabilityER5TDes84TUid @ 161 NONAME
+	_ZNK13RApaLsSession16GetAppOwnedFilesER12CDesC16Array4TUid @ 162 NONAME
+	_ZNK13RApaLsSession17GetEmbeddableAppsEi @ 163 NONAME
+	_ZNK13RApaLsSession17GetEmbeddableAppsEv @ 164 NONAME
+	_ZNK13RApaLsSession17GetMaxDataBufSizeERi @ 165 NONAME
+	_ZNK13RApaLsSession18EmbeddableAppCountERi @ 166 NONAME
+	_ZNK13RApaLsSession21GetAcceptedConfidenceERi @ 167 NONAME
+	_ZNK13RApaLsSession21RecognizeSpecificDataERK7TDesC16RK6TDesC8RK9TDataTypeRi @ 168 NONAME
+	_ZNK13RApaLsSession22GetSupportedDataTypesLER13CArrayFixFlatI9TDataTypeE @ 169 NONAME
+	_ZNK13RApaLsSession23NumberOfOwnDefinedIconsE4TUidRi @ 170 NONAME
+	_ZNK13RApaLsSession7VersionEv @ 171 NONAME
+	_ZNK13RApaLsSession8AppCountERi @ 172 NONAME
+	_ZNK13RApaLsSession9IsProgramERK7TDesC16Ri @ 173 NONAME
+	_ZNK15CApaAIFViewData10ScreenModeEv @ 174 NONAME ABSENT
+	_ZNK15CApaAIFViewData12IconByIndexLEi @ 175 NONAME ABSENT
+	_ZNK15CApaAIFViewData13NumberOfIconsEv @ 176 NONAME ABSENT
+	_ZNK15CApaAIFViewData7ViewUidEv @ 177 NONAME ABSENT
+	_ZNK15CApaAIFViewData8CaptionLE9TLanguage @ 178 NONAME ABSENT
+	_ZNK15CApaAppViewData10IconSizesLEv @ 179 NONAME
+	_ZNK15CApaAppViewData10ScreenModeEv @ 180 NONAME
+	_ZNK15CApaAppViewData3UidEv @ 181 NONAME
+	_ZNK15CApaAppViewData4IconERK5TSize @ 182 NONAME
+	_ZNK16CApaMaskedBitmap12ExternalizeLER12RWriteStream @ 183 NONAME
+	_ZNK16CApaMaskedBitmap4MaskEv @ 184 NONAME
+	_ZNK17CApaSystemControl12ShortCaptionEv @ 185 NONAME
+	_ZNK17CApaSystemControl4IconEv @ 186 NONAME
+	_ZNK17CApaSystemControl4TypeEv @ 187 NONAME
+	_ZNK17CApaSystemControl7CaptionEv @ 188 NONAME
+	_ZNK17CApaSystemControl8FileNameEv @ 189 NONAME
+	_ZNK18TApaPictureFactory11NewPictureLER14TPictureHeaderRK12CStreamStore @ 190 NONAME
+	_ZNK19CApaWindowGroupName10IsAppReadyEv @ 191 NONAME
+	_ZNK19CApaWindowGroupName14DocNameIsAFileEv @ 192 NONAME
+	_ZNK19CApaWindowGroupName15WindowGroupNameEv @ 193 NONAME
+	_ZNK19CApaWindowGroupName18SetWindowGroupNameER12RWindowGroup @ 194 NONAME
+	_ZNK19CApaWindowGroupName23RespondsToShutdownEventEv @ 195 NONAME
+	_ZNK19CApaWindowGroupName26RespondsToSwitchFilesEventEv @ 196 NONAME
+	_ZNK19CApaWindowGroupName6AppUidEv @ 197 NONAME
+	_ZNK19CApaWindowGroupName6IsBusyEv @ 198 NONAME
+	_ZNK19CApaWindowGroupName7CaptionEv @ 199 NONAME
+	_ZNK19CApaWindowGroupName7DocNameEv @ 200 NONAME
+	_ZNK19CApaWindowGroupName8IsSystemEv @ 201 NONAME
+	_ZNK21CApaAppInfoFileReader10CapabilityER5TDes8 @ 202 NONAME ABSENT
+	_ZNK21CApaAppInfoFileReader14GetOwnedFilesLER12CDesC16Array @ 203 NONAME ABSENT
+	_ZNK21CApaAppInfoFileReader15NumberOfBitmapsEv @ 204 NONAME ABSENT
+	_ZNK21CApaAppInfoFileReader19DataTypesSupportedLER9CArrayFixI21TDataTypeWithPriorityE @ 205 NONAME ABSENT
+	_ZNK21CApaAppInfoFileReader9GetViewsLER9CArrayPtrI15CApaAIFViewDataE @ 206 NONAME ABSENT
+	_ZNK21CApaSystemControlList5CountEv @ 207 NONAME
+	_ZNK21CApaSystemControlList5IndexE4TUid @ 208 NONAME
+	_ZNK21CApaSystemControlList7ControlE4TUid @ 209 NONAME
+	_ZNK21CApaSystemControlList7ControlEi @ 210 NONAME
+	_ZNK8CApaDoor7AppUidLEv @ 211 NONAME
+	_ZNK8TApaTask4WgIdEv @ 212 NONAME
+	_ZNK8TApaTask6ExistsEv @ 213 NONAME
+	_ZNK8TApaTask8ThreadIdEv @ 214 NONAME
+	_ZTI18TApaPictureFactory @ 215 NONAME ; #<TI>#
+	_ZTV18TApaPictureFactory @ 216 NONAME ; #<VT>#
+	_ZTI11CApaAppData @ 217 NONAME ; #<TI>#
+	_ZTI11CApaAppList @ 218 NONAME ; #<TI>#
+	_ZTI12CApaAppEntry @ 219 NONAME ; #<TI>#
+	_ZTI14CApaAIFCaption @ 220 NONAME ABSENT ; #<TI>#
+	_ZTI15CApaAIFViewData @ 221 NONAME ABSENT ; #<TI>#
+	_ZTI15CApaAppInfoFile @ 222 NONAME ABSENT ; #<TI>#
+	_ZTI15CApaAppViewData @ 223 NONAME ; #<TI>#
+	_ZTI15CApaIconPicture @ 224 NONAME ; #<TI>#
+	_ZTI16CApaMaskedBitmap @ 225 NONAME ; #<TI>#
+	_ZTI16TDesCArrayFiller @ 226 NONAME ; #<TI>#
+	_ZTI16TSizeArrayFiller @ 227 NONAME ; #<TI>#
+	_ZTI17CApaSystemControl @ 228 NONAME ; #<TI>#
+	_ZTI19CApaAppListNotifier @ 229 NONAME ; #<TI>#
+	_ZTI19CApaWindowGroupName @ 230 NONAME ; #<TI>#
+	_ZTI20TViewDataArrayFiller @ 231 NONAME ; #<TI>#
+	_ZTI21CApaAppInfoFileReader @ 232 NONAME ABSENT ; #<TI>#
+	_ZTI21CApaAppInfoFileWriter @ 233 NONAME ABSENT ; #<TI>#
+	_ZTI21CApaSystemControlList @ 234 NONAME ; #<TI>#
+	_ZTI7HBufBuf @ 235 NONAME ; #<TI>#
+	_ZTI8CApaDoor @ 236 NONAME ; #<TI>#
+	_ZTV11CApaAppData @ 237 NONAME ; #<VT>#
+	_ZTV11CApaAppList @ 238 NONAME ; #<VT>#
+	_ZTV12CApaAppEntry @ 239 NONAME ; #<VT>#
+	_ZTV14CApaAIFCaption @ 240 NONAME ABSENT ; #<VT>#
+	_ZTV15CApaAIFViewData @ 241 NONAME ABSENT ; #<VT>#
+	_ZTV15CApaAppInfoFile @ 242 NONAME ABSENT ; #<VT>#
+	_ZTV15CApaAppViewData @ 243 NONAME ; #<VT>#
+	_ZTV15CApaIconPicture @ 244 NONAME ; #<VT>#
+	_ZTV16CApaMaskedBitmap @ 245 NONAME ; #<VT>#
+	_ZTV16TDesCArrayFiller @ 246 NONAME ; #<VT>#
+	_ZTV16TSizeArrayFiller @ 247 NONAME ; #<VT>#
+	_ZTV17CApaSystemControl @ 248 NONAME ; #<VT>#
+	_ZTV19CApaAppListNotifier @ 249 NONAME ; #<VT>#
+	_ZTV19CApaWindowGroupName @ 250 NONAME ; #<VT>#
+	_ZTV20TViewDataArrayFiller @ 251 NONAME ; #<VT>#
+	_ZTV21CApaAppInfoFileReader @ 252 NONAME ABSENT ; #<VT>#
+	_ZTV21CApaAppInfoFileWriter @ 253 NONAME ABSENT ; #<VT>#
+	_ZTV21CApaSystemControlList @ 254 NONAME ; #<VT>#
+	_ZTV7HBufBuf @ 255 NONAME ; #<VT>#
+	_ZTV8CApaDoor @ 256 NONAME ; #<VT>#
+	_ZN11CApaAppList4NewLER3RFsP13CApaAppFinderP16CApaAppRegFinder @ 257 NONAME
+	_ZNK11CApaAppData12IconFileNameEv @ 258 NONAME
+	_ZNK11CApaAppData14NonMbmIconFileEv @ 259 NONAME
+	_ZNK11CApaAppData19DefaultScreenNumberEv @ 260 NONAME
+	_ZNK11CApaAppData20RegistrationFileUsedEv @ 261 NONAME
+	_ZNK13RApaLsSession10GetAppIconE4TUidRP7HBufC16 @ 262 NONAME
+	_ZNK13RApaLsSession14GetAppViewIconE4TUidS0_RP7HBufC16 @ 263 NONAME
+	_ZNK13RApaLsSession15GetFilteredAppsEjj @ 264 NONAME
+	_ZNK13RApaLsSession15GetFilteredAppsEjji @ 265 NONAME
+	_ZNK15CApaAppViewData12IconFileNameEv @ 266 NONAME
+	_ZNK15CApaAppViewData14NonMbmIconFileEv @ 267 NONAME
+	_ZTI17CApaAppInfoReader @ 268 NONAME ; #<TI>#
+	_ZTI19CApaAppInfoReaderV1 @ 269 NONAME ABSENT ; #<TI>#
+	_ZTI19CApaAppInfoReaderV2 @ 270 NONAME ; #<TI>#
+	_ZTV17CApaAppInfoReader @ 271 NONAME ; #<VT>#
+	_ZTV19CApaAppInfoReaderV1 @ 272 NONAME ABSENT ; #<VT>#
+	_ZTV19CApaAppInfoReaderV2 @ 273 NONAME ; #<VT>#
+	_Z16StartupApaServerR14MApaAppStarter @ 274 NONAME
+	_Z23StartupApaServerProcessv @ 275 NONAME
+	_ZN13RApaLsSession17DeleteDataMappingERK9TDataType @ 276 NONAME
+	_ZN13RApaLsSession17InsertDataMappingERK9TDataTypes4TUid @ 277 NONAME
+	_ZN13RApaLsSession25InsertDataMappingIfHigherERK9TDataTypes4TUidRi @ 278 NONAME
+	_ZNK11CApaAppData19ApplicationLanguageEv @ 279 NONAME
+	_ZNK13RApaLsSession19ApplicationLanguageE4TUidR9TLanguage @ 280 NONAME
+	_ZN21CApaSystemControlList4NewLER3RFs @ 281 NONAME
+	_ZNK11CApaAppData17ImplementsServiceE4TUid @ 282 NONAME
+	_ZNK11CApaAppList17ServiceUidBufferLE4TUid @ 283 NONAME
+	_ZNK11CApaAppList19ServiceArrayBufferLE4TUid @ 284 NONAME
+	_ZNK11CApaAppList21PreferredDataHandlerLERK9TDataTypePK4TUid @ 285 NONAME
+	_ZNK11CApaAppList23ServiceImplArrayBufferLE4TUid @ 286 NONAME
+	_ZNK11CApaAppList24ServiceOpaqueDataBufferLE4TUidS0_ @ 287 NONAME
+	_ZNK13RApaLsSession13GetServerAppsE4TUid @ 288 NONAME
+	_ZNK13RApaLsSession13GetServerAppsE4TUidi @ 289 NONAME
+	_ZNK13RApaLsSession15GetAppServicesLE4TUidR13CArrayFixFlatIS0_E @ 290 NONAME
+	_ZNK13RApaLsSession16GetAppServicesLCE4TUid @ 291 NONAME
+	_ZNK13RApaLsSession24AppForDataTypeAndServiceERK9TDataType4TUidRS3_ @ 292 NONAME
+	_ZNK13RApaLsSession24AppForDocumentAndServiceER5RFile4TUidRS2_R9TDataType @ 293 NONAME
+	_ZNK13RApaLsSession24AppForDocumentAndServiceERK7TDesC164TUidRS3_R9TDataType @ 294 NONAME
+	_ZNK13RApaLsSession25GetAppServiceOpaqueDataLCE4TUidS0_ @ 295 NONAME
+	_ZNK13RApaLsSession27GetServiceImplementationsLCE4TUid @ 296 NONAME
+	_ZNK18TApaAppServiceInfo10OpaqueDataEv @ 297 NONAME
+	_ZNK18TApaAppServiceInfo3UidEv @ 298 NONAME
+	_ZTI30CApaAppServiceInfoArrayWrapper @ 299 NONAME ; #<TI>#
+	_ZTV30CApaAppServiceInfoArrayWrapper @ 300 NONAME ; #<VT>#
+	_ZN13RApaLsSession13StartDocumentER5RFileR9TThreadIdP14TRequestStatus @ 301 NONAME
+	_ZN21CApaAppInfoFileReader27CreateMaskedBitmapByIndexLCEi @ 302 NONAME ABSENT
+	_ZNK13RApaLsSession36CancelListPopulationCompleteObserverEv @ 303 NONAME
+	_ZNK13RApaLsSession38RegisterListPopulationCompleteObserverER14TRequestStatus @ 304 NONAME
+	_ZN8ApaUtils24HandleAsRegistrationFileERK8TUidType @ 305 NONAME
+	_ZN13RApaLsSession33RegisterJavaMIDletViaIterimFormatERK7TDesC16R5RFile @ 306 NONAME ABSENT
+	_ZN22ForJavaMIDletInstaller33CheckInterimFormatFileNotCorruptLER5RFile @ 307 NONAME ABSENT
+	_ZN13RApaLsSession20DeregisterJavaMIDletERK7TDesC16 @ 308 NONAME ABSENT
+	_ZN13RApaLsSession13SetFsSessionLER3RFs @ 309 NONAME
+	_ZN13RApaLsSession13StartDocumentER5RFile4TUidR9TThreadIdP14TRequestStatus @ 310 NONAME
+	_ZN13RApaLsSession13StartDocumentER5RFileRK9TDataTypeR9TThreadIdP14TRequestStatus @ 311 NONAME
+	_ZN13RApaLsSession14ClearFsSessionEv @ 312 NONAME
+	_ZN13RApaLsSession9FsSessionEv @ 313 NONAME
+	_ZNK13RApaLsSession13RecognizeDataER5RFileR22TDataRecognitionResult @ 314 NONAME
+	_ZNK13RApaLsSession14AppForDocumentER5RFileR4TUidR9TDataType @ 315 NONAME
+	_ZNK13RApaLsSession21RecognizeSpecificDataER5RFileRK9TDataTypeRi @ 316 NONAME
+	_ZNK13RApaLsSession19GetPreferredBufSizeERi @ 317 NONAME
+	_ZN22ForJavaMIDletInstaller18GetJavaMIDletInfoLER3RFsRK7TDesC16RmS5_ @ 318 NONAME ABSENT
+	_ZN22ForJavaMIDletInstaller28NewInterimFormatFileWriterLCER3RFsRK7TDesC164TUidmi @ 319 NONAME ABSENT
+	_ZNK18TApaAppServiceInfo9DataTypesEv @ 320 NONAME
+	_ZNK11CApaAppList23ServiceImplArrayBufferLE4TUidRK9TDataType @ 321 NONAME
+	_ZNK13RApaLsSession27GetServiceImplementationsLCE4TUidRK9TDataType @ 322 NONAME
+	_ZN13RApaLsSession5CloseEv @ 323 NONAME
+	_ZTI22CApaLsSessionExtension @ 324 NONAME ; #<TI>#
+	_ZTV22CApaLsSessionExtension @ 325 NONAME ; #<VT>#
+	_ZN13RApaLsSession28RegisterNonNativeApplicationE4TUidR5RFilePS1_S3_ @ 326 NONAME
+	_ZN13RApaLsSession30DeregisterNonNativeApplicationE4TUid @ 327 NONAME
+	_ZN13RApaLsSession32RegisterNonNativeApplicationTypeE4TUidRK7TDesC16 @ 328 NONAME
+	_ZN13RApaLsSession34DeregisterNonNativeApplicationTypeE4TUid @ 329 NONAME
+	_ZN13RApaLsSession8StartAppERK15CApaCommandLineR9TThreadIdP14TRequestStatus @ 330 NONAME
+	_ZNK11CApaAppData10OpaqueDataEv @ 331 NONAME
+	_ZNK11CApaAppData20RegistrationFileNameEv @ 332 NONAME
+	_ZNK11CApaAppData27LocalisableResourceFileNameEv @ 333 NONAME
+	_ZNK11CApaAppList17AppDataByFileNameERK7TDesC16 @ 334 NONAME
+	_ZN13RApaLsSession18SetAppShortCaptionERK7TDesC169TLanguage4TUid @ 335 NONAME
+	_ZN17CApaSecurityUtils16CheckAppSecurityERK7TPtrC16RiS3_ @ 336 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/eabi/APGRFX_9_REMOVE_UI_FRAMEWORKS_V1_EXCEPT_REMNANT_FOR_JAVA_MIDLET_INSTALLERU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,429 @@
+EXPORTS
+	_ZNK11CApaAppData11GetIconInfoERiS0_ @ 1 NONAME
+	_ZN11CApaAppData16CanUseScreenModeEi @ 2 NONAME
+	_ZN11CApaAppList16StartIdleUpdateLEP19MApaAppListObserver @ 3 NONAME
+	_ZN11CApaAppList16StartIdleUpdateLEv @ 4 NONAME
+	_ZN11CApaAppList4NewLER3RFsP16CApaAppRegFinderi @ 5 NONAME
+	_ZN11CApaAppList6PurgeLEv @ 6 NONAME
+	_ZN11CApaAppList7UpdateLEv @ 7 NONAME ABSENT
+	_ZN11CApaAppList9InitListLEP19MApaAppListObserver @ 8 NONAME
+	_ZN11CApaAppListD0Ev @ 9 NONAME
+	_ZN11CApaAppListD1Ev @ 10 NONAME
+	_ZN11CApaAppListD2Ev @ 11 NONAME
+	_ZN12TApaTaskList10CycleTasksE4TUidNS_15TCycleDirectionE @ 12 NONAME
+	_ZN12TApaTaskList7FindAppE4TUid @ 13 NONAME
+	_ZN12TApaTaskList7FindAppERK7TDesC16 @ 14 NONAME
+	_ZN12TApaTaskList7FindDocERK7TDesC16 @ 15 NONAME
+	_ZN12TApaTaskList9FindByPosEi @ 16 NONAME
+	_ZN12TApaTaskListC1ER10RWsSession @ 17 NONAME
+	_ZN12TApaTaskListC2ER10RWsSession @ 18 NONAME
+	_ZN13RApaLsSession13StartDocumentERK7TDesC164TUidR9TThreadIdNS_11TLaunchTypeE @ 19 NONAME
+	_ZN13RApaLsSession13StartDocumentERK7TDesC16R9TThreadIdNS_11TLaunchTypeE @ 20 NONAME
+	_ZN13RApaLsSession13StartDocumentERK7TDesC16RK9TDataTypeR9TThreadIdNS_11TLaunchTypeE @ 21 NONAME
+	_ZN13RApaLsSession14CreateDocumentERK7TDesC164TUidR9TThreadIdNS_11TLaunchTypeE @ 22 NONAME
+	_ZN13RApaLsSession17SetMaxDataBufSizeEi @ 23 NONAME
+	_ZN13RApaLsSession21SetAcceptedConfidenceEi @ 24 NONAME
+	_ZN13RApaLsSession7ConnectEv @ 25 NONAME
+	_ZN13RApaLsSession8StartAppERK15CApaCommandLine @ 26 NONAME
+	_ZN13RApaLsSession8StartAppERK15CApaCommandLineR9TThreadId @ 27 NONAME
+	_ZN13RApaLsSessionC1Ev @ 28 NONAME
+	_ZN13RApaLsSessionC2Ev @ 29 NONAME
+	_ZN16AppInfoFileUtils14GetAifFileNameERK3RFsR6TDes16 @ 30 NONAME ABSENT
+	_ZN16CApaMaskedBitmap12InternalizeLER11RReadStream @ 31 NONAME
+	_ZN16CApaMaskedBitmap13SetMaskBitmapEP10CFbsBitmap @ 32 NONAME
+	_ZN16CApaMaskedBitmap4NewLEPKS_ @ 33 NONAME
+	_ZN16CApaMaskedBitmap5NewLCEv @ 34 NONAME
+	_ZN16CApaMaskedBitmapD0Ev @ 35 NONAME
+	_ZN16CApaMaskedBitmapD1Ev @ 36 NONAME
+	_ZN16CApaMaskedBitmapD2Ev @ 37 NONAME
+	_ZN17CApaSystemControl7CreateLEv @ 38 NONAME
+	_ZN18TApaPictureFactoryC1EP11CApaProcess @ 39 NONAME
+	_ZN18TApaPictureFactoryC2EP11CApaProcess @ 40 NONAME
+	_ZN19CApaAppListNotifier4NewLEP23MApaAppListServObserverN7CActive9TPriorityE @ 41 NONAME
+	_ZN19CApaAppListNotifierD0Ev @ 42 NONAME
+	_ZN19CApaAppListNotifierD1Ev @ 43 NONAME
+	_ZN19CApaAppListNotifierD2Ev @ 44 NONAME
+	_ZN19CApaWindowGroupName11SetAppReadyEi @ 45 NONAME
+	_ZN19CApaWindowGroupName11SetCaptionLERK7TDesC16 @ 46 NONAME
+	_ZN19CApaWindowGroupName11SetDocNameLERK7TDesC16 @ 47 NONAME
+	_ZN19CApaWindowGroupName12FindByAppUidE4TUidR10RWsSessionRi @ 48 NONAME
+	_ZN19CApaWindowGroupName13FindByCaptionERK7TDesC16R10RWsSessionRi @ 49 NONAME
+	_ZN19CApaWindowGroupName13FindByDocNameERK7TDesC16R10RWsSessionRi @ 50 NONAME
+	_ZN19CApaWindowGroupName17SetDocNameIsAFileEi @ 51 NONAME
+	_ZN19CApaWindowGroupName18ConstructFromWgIdLEi @ 52 NONAME
+	_ZN19CApaWindowGroupName18SetWindowGroupNameEP7HBufC16 @ 53 NONAME
+	_ZN19CApaWindowGroupName19SetWindowGroupNameLERK7TDesC16 @ 54 NONAME
+	_ZN19CApaWindowGroupName26SetRespondsToShutdownEventEi @ 55 NONAME
+	_ZN19CApaWindowGroupName29SetRespondsToSwitchFilesEventEi @ 56 NONAME
+	_ZN19CApaWindowGroupName3NewERK10RWsSessionP7HBufC16 @ 57 NONAME
+	_ZN19CApaWindowGroupName4NewLERK10RWsSession @ 58 NONAME
+	_ZN19CApaWindowGroupName4NewLERK10RWsSessionRK7TDesC16 @ 59 NONAME
+	_ZN19CApaWindowGroupName4NewLERK10RWsSessioni @ 60 NONAME
+	_ZN19CApaWindowGroupName5NewLCERK10RWsSession @ 61 NONAME
+	_ZN19CApaWindowGroupName5NewLCERK10RWsSessionRK7TDesC16 @ 62 NONAME
+	_ZN19CApaWindowGroupName5NewLCERK10RWsSessioni @ 63 NONAME
+	_ZNK19CApaWindowGroupName6HiddenEv @ 64 NONAME
+	_ZN19CApaWindowGroupName7SetBusyEi @ 65 NONAME
+	_ZN19CApaWindowGroupName9SetAppUidE4TUid @ 66 NONAME
+	_ZN19CApaWindowGroupName9SetHiddenEi @ 67 NONAME
+	_ZN19CApaWindowGroupName9SetSystemEi @ 68 NONAME
+	_ZN19CApaWindowGroupNameD0Ev @ 69 NONAME
+	_ZN19CApaWindowGroupNameD1Ev @ 70 NONAME
+	_ZN19CApaWindowGroupNameD2Ev @ 71 NONAME
+	_ZN21CApaAppInfoFileReader12StretchDrawLEP10CFbsBitmapS1_5TSize @ 72 NONAME ABSENT
+	_ZN21CApaAppInfoFileReader19CreateMaskedBitmapLEi @ 73 NONAME ABSENT
+	_ZN21CApaAppInfoFileReader4NewLER3RFsRK7TDesC164TUid @ 74 NONAME ABSENT
+	_ZN21CApaAppInfoFileReader5NewLCER3RFsRK7TDesC164TUid @ 75 NONAME ABSENT
+	_ZN21CApaAppInfoFileReader8CaptionLE9TLanguage @ 76 NONAME ABSENT
+	_ZN21CApaAppInfoFileReaderD0Ev @ 77 NONAME ABSENT
+	_ZN21CApaAppInfoFileReaderD1Ev @ 78 NONAME ABSENT
+	_ZN21CApaAppInfoFileReaderD2Ev @ 79 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter10StoreViewLE4TUid @ 80 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter11AddCaptionLE9TLanguageRK7TDesC16 @ 81 NONAME
+	_ZN21CApaAppInfoFileWriter12AddDataTypeLERK21TDataTypeWithPriority @ 82 NONAME
+	_ZN21CApaAppInfoFileWriter12AddViewIconLER16CApaMaskedBitmap4TUid @ 83 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter13AddOwnedFileLERK7TDesC16 @ 84 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter13SetCapabilityERK6TDesC8 @ 85 NONAME
+	_ZN21CApaAppInfoFileWriter15AddViewCaptionLE9TLanguageRK7TDesC164TUid @ 86 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter5NewLCER3RFsRK7TDesC164TUid @ 87 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter6StoreLEv @ 88 NONAME
+	_ZN21CApaAppInfoFileWriter8AddIconLER16CApaMaskedBitmap @ 89 NONAME
+	_ZN21CApaAppInfoFileWriter8AddIconLERK7TDesC16 @ 90 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter8AddViewLE4TUid @ 91 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter8AddViewLE4TUidi @ 92 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriterD0Ev @ 93 NONAME
+	_ZN21CApaAppInfoFileWriterD1Ev @ 94 NONAME
+	_ZN21CApaAppInfoFileWriterD2Ev @ 95 NONAME
+	_ZN21CApaSystemControlList4NewLER3RFsR13CApaAppFinderRK7TDesC16 @ 96 NONAME ABSENT
+	_ZN21CApaSystemControlList7UpdateLEv @ 97 NONAME
+	_ZN21CApaSystemControlListD0Ev @ 98 NONAME
+	_ZN21CApaSystemControlListD1Ev @ 99 NONAME
+	_ZN21CApaSystemControlListD2Ev @ 100 NONAME
+	_ZN8CApaDoor16SetFormatToIconLEv @ 101 NONAME
+	_ZN8CApaDoor17SetFormatToGlassLEv @ 102 NONAME
+	_ZN8CApaDoor25SetFormatToTemporaryIconLEi @ 103 NONAME
+	_ZN8CApaDoor4NewLER3RFsR12CApaDocumentRK5TSize @ 104 NONAME
+	_ZN8CApaDoor4NewLER3RFsRK12CStreamStore9TStreamIdR11CApaProcess @ 105 NONAME
+	_ZN8CApaDoor5NewLCER3RFsR12CApaDocumentRK5TSize @ 106 NONAME
+	_ZN8CApaDoor8RestoreLERK12CStreamStore9TStreamId @ 107 NONAME
+	_ZN8CApaDoor9DocumentLEi @ 108 NONAME
+	_ZN8CApaDoorD0Ev @ 109 NONAME
+	_ZN8CApaDoorD1Ev @ 110 NONAME
+	_ZN8CApaDoorD2Ev @ 111 NONAME
+	_ZN8TApaTask11SendMessageE4TUidRK6TDesC8 @ 112 NONAME
+	_ZN8TApaTask14SwitchOpenFileERK7TDesC16 @ 113 NONAME
+	_ZN8TApaTask15SendSystemEventE15TApaSystemEvent @ 114 NONAME
+	_ZN8TApaTask16SendToBackgroundEv @ 115 NONAME
+	_ZN8TApaTask16SwitchCreateFileERK7TDesC16 @ 116 NONAME
+	_ZN8TApaTask17BringToForegroundEv @ 117 NONAME
+	_ZN8TApaTask7EndTaskEv @ 118 NONAME
+	_ZN8TApaTask7SendKeyERK9TKeyEvent @ 119 NONAME
+	_ZN8TApaTask7SendKeyEii @ 120 NONAME
+	_ZN8TApaTask7SetWgIdEi @ 121 NONAME
+	_ZN8TApaTask8KillTaskEv @ 122 NONAME
+	_ZN8TApaTaskC1ER10RWsSession @ 123 NONAME
+	_ZN8TApaTaskC2ER10RWsSession @ 124 NONAME
+	_ZNK11CApaAppData10CapabilityER5TDes8 @ 125 NONAME
+	_ZNK11CApaAppData10IconSizesLEv @ 126 NONAME
+	_ZNK11CApaAppData10OwnedFilesEv @ 127 NONAME
+	_ZNK11CApaAppData4IconE5TSize @ 128 NONAME
+	_ZNK11CApaAppData4IconEi @ 129 NONAME
+	_ZNK11CApaAppData5ViewsEv @ 130 NONAME
+	_ZNK11CApaAppData8AppEntryEv @ 131 NONAME
+	_ZNK11CApaAppData8DataTypeERK9TDataType @ 132 NONAME
+	_ZNK11CApaAppList12AppDataByUidE4TUid @ 133 NONAME
+	_ZNK11CApaAppList13UpdateCounterEv @ 134 NONAME
+	_ZNK11CApaAppList19IsFirstScanCompleteEv @ 135 NONAME
+	_ZNK11CApaAppList20IsIdleUpdateCompleteEv @ 136 NONAME
+	_ZNK11CApaAppList21PreferredDataHandlerLERK9TDataType @ 137 NONAME
+	_ZNK11CApaAppList5CountEv @ 138 NONAME
+	_ZNK11CApaAppList7NextAppEPK11CApaAppData @ 139 NONAME
+	_ZNK11CApaAppList7NextAppEPK11CApaAppDatai @ 140 NONAME
+	_ZNK11CApaAppList8FirstAppEi @ 141 NONAME
+	_ZNK11CApaAppList8FirstAppEv @ 142 NONAME
+	_ZNK13RApaLsSession10GetAllAppsEi @ 143 NONAME
+	_ZNK13RApaLsSession10GetAllAppsEv @ 144 NONAME
+	_ZNK13RApaLsSession10GetAppIconE4TUid5TSizeR16CApaMaskedBitmap @ 145 NONAME
+	_ZNK13RApaLsSession10GetAppIconE4TUidiR16CApaMaskedBitmap @ 146 NONAME
+	_ZNK13RApaLsSession10GetAppInfoER11TApaAppInfo4TUid @ 147 NONAME
+	_ZNK13RApaLsSession10GetNextAppER11TApaAppInfo @ 148 NONAME
+	_ZNK13RApaLsSession10GetNextAppER11TApaAppInfoi @ 149 NONAME
+	_ZNK13RApaLsSession11GetAppViewsER13CArrayFixFlatI15TApaAppViewInfoE4TUid @ 150 NONAME
+	_ZNK13RApaLsSession13RecognizeDataERK7TDesC16RK6TDesC8R22TDataRecognitionResult @ 151 NONAME
+	_ZNK13RApaLsSession14AppForDataTypeERK9TDataTypeR4TUid @ 152 NONAME
+	_ZNK13RApaLsSession14AppForDocumentERK7TDesC16R4TUidR9TDataType @ 153 NONAME
+	_ZNK13RApaLsSession14GetAppInfo_7_0ER15TApaAppInfo_7_04TUid @ 154 NONAME ABSENT
+	_ZNK13RApaLsSession14GetAppViewIconE4TUidS0_RK5TSizeR16CApaMaskedBitmap @ 155 NONAME
+	_ZNK13RApaLsSession14GetNextApp_7_0ER15TApaAppInfo_7_0 @ 156 NONAME ABSENT
+	_ZNK13RApaLsSession14GetNextApp_7_0ER15TApaAppInfo_7_0i @ 157 NONAME ABSENT
+	_ZNK13RApaLsSession15GetAppIconSizesE4TUidR13CArrayFixFlatI5TSizeE @ 158 NONAME
+	_ZNK13RApaLsSession15GetFilteredAppsERK23TApaEmbeddabilityFilter @ 159 NONAME
+	_ZNK13RApaLsSession15GetFilteredAppsERK23TApaEmbeddabilityFilteri @ 160 NONAME
+	_ZNK13RApaLsSession16GetAppCapabilityER5TDes84TUid @ 161 NONAME
+	_ZNK13RApaLsSession16GetAppOwnedFilesER12CDesC16Array4TUid @ 162 NONAME
+	_ZNK13RApaLsSession17GetEmbeddableAppsEi @ 163 NONAME
+	_ZNK13RApaLsSession17GetEmbeddableAppsEv @ 164 NONAME
+	_ZNK13RApaLsSession17GetMaxDataBufSizeERi @ 165 NONAME
+	_ZNK13RApaLsSession18EmbeddableAppCountERi @ 166 NONAME
+	_ZNK13RApaLsSession21GetAcceptedConfidenceERi @ 167 NONAME
+	_ZNK13RApaLsSession21RecognizeSpecificDataERK7TDesC16RK6TDesC8RK9TDataTypeRi @ 168 NONAME
+	_ZNK13RApaLsSession22GetSupportedDataTypesLER13CArrayFixFlatI9TDataTypeE @ 169 NONAME
+	_ZNK13RApaLsSession23NumberOfOwnDefinedIconsE4TUidRi @ 170 NONAME
+	_ZNK13RApaLsSession7VersionEv @ 171 NONAME
+	_ZNK13RApaLsSession8AppCountERi @ 172 NONAME
+	_ZNK13RApaLsSession9IsProgramERK7TDesC16Ri @ 173 NONAME
+	_ZNK15CApaAIFViewData10ScreenModeEv @ 174 NONAME ABSENT
+	_ZNK15CApaAIFViewData12IconByIndexLEi @ 175 NONAME ABSENT
+	_ZNK15CApaAIFViewData13NumberOfIconsEv @ 176 NONAME ABSENT
+	_ZNK15CApaAIFViewData7ViewUidEv @ 177 NONAME ABSENT
+	_ZNK15CApaAIFViewData8CaptionLE9TLanguage @ 178 NONAME ABSENT
+	_ZNK15CApaAppViewData10IconSizesLEv @ 179 NONAME
+	_ZNK15CApaAppViewData10ScreenModeEv @ 180 NONAME
+	_ZNK15CApaAppViewData3UidEv @ 181 NONAME
+	_ZNK15CApaAppViewData4IconERK5TSize @ 182 NONAME
+	_ZNK16CApaMaskedBitmap12ExternalizeLER12RWriteStream @ 183 NONAME
+	_ZNK16CApaMaskedBitmap4MaskEv @ 184 NONAME
+	_ZNK17CApaSystemControl12ShortCaptionEv @ 185 NONAME
+	_ZNK17CApaSystemControl4IconEv @ 186 NONAME
+	_ZNK17CApaSystemControl4TypeEv @ 187 NONAME
+	_ZNK17CApaSystemControl7CaptionEv @ 188 NONAME
+	_ZNK17CApaSystemControl8FileNameEv @ 189 NONAME
+	_ZNK18TApaPictureFactory11NewPictureLER14TPictureHeaderRK12CStreamStore @ 190 NONAME
+	_ZNK19CApaWindowGroupName10IsAppReadyEv @ 191 NONAME
+	_ZNK19CApaWindowGroupName14DocNameIsAFileEv @ 192 NONAME
+	_ZNK19CApaWindowGroupName15WindowGroupNameEv @ 193 NONAME
+	_ZNK19CApaWindowGroupName18SetWindowGroupNameER12RWindowGroup @ 194 NONAME
+	_ZNK19CApaWindowGroupName23RespondsToShutdownEventEv @ 195 NONAME
+	_ZNK19CApaWindowGroupName26RespondsToSwitchFilesEventEv @ 196 NONAME
+	_ZNK19CApaWindowGroupName6AppUidEv @ 197 NONAME
+	_ZNK19CApaWindowGroupName6IsBusyEv @ 198 NONAME
+	_ZNK19CApaWindowGroupName7CaptionEv @ 199 NONAME
+	_ZNK19CApaWindowGroupName7DocNameEv @ 200 NONAME
+	_ZNK19CApaWindowGroupName8IsSystemEv @ 201 NONAME
+	_ZNK21CApaAppInfoFileReader10CapabilityER5TDes8 @ 202 NONAME ABSENT
+	_ZNK21CApaAppInfoFileReader14GetOwnedFilesLER12CDesC16Array @ 203 NONAME ABSENT
+	_ZNK21CApaAppInfoFileReader15NumberOfBitmapsEv @ 204 NONAME ABSENT
+	_ZNK21CApaAppInfoFileReader19DataTypesSupportedLER9CArrayFixI21TDataTypeWithPriorityE @ 205 NONAME ABSENT
+	_ZNK21CApaAppInfoFileReader9GetViewsLER9CArrayPtrI15CApaAIFViewDataE @ 206 NONAME ABSENT
+	_ZNK21CApaSystemControlList5CountEv @ 207 NONAME
+	_ZNK21CApaSystemControlList5IndexE4TUid @ 208 NONAME
+	_ZNK21CApaSystemControlList7ControlE4TUid @ 209 NONAME
+	_ZNK21CApaSystemControlList7ControlEi @ 210 NONAME
+	_ZNK8CApaDoor7AppUidLEv @ 211 NONAME
+	_ZNK8TApaTask4WgIdEv @ 212 NONAME
+	_ZNK8TApaTask6ExistsEv @ 213 NONAME
+	_ZNK8TApaTask8ThreadIdEv @ 214 NONAME
+	_ZTI18TApaPictureFactory @ 215 NONAME ; #<TI>#
+	_ZTV18TApaPictureFactory @ 216 NONAME ; #<VT>#
+	_ZTI11CApaAppData @ 217 NONAME ; #<TI>#
+	_ZTI11CApaAppList @ 218 NONAME ; #<TI>#
+	_ZTI12CApaAppEntry @ 219 NONAME ; #<TI>#
+	_ZTI14CApaAIFCaption @ 220 NONAME ABSENT ; #<TI>#
+	_ZTI15CApaAIFViewData @ 221 NONAME ABSENT ; #<TI>#
+	_ZTI15CApaAppInfoFile @ 222 NONAME ABSENT ; #<TI>#
+	_ZTI15CApaAppViewData @ 223 NONAME ; #<TI>#
+	_ZTI15CApaIconPicture @ 224 NONAME ; #<TI>#
+	_ZTI16CApaMaskedBitmap @ 225 NONAME ; #<TI>#
+	_ZTI16TDesCArrayFiller @ 226 NONAME ; #<TI>#
+	_ZTI16TSizeArrayFiller @ 227 NONAME ; #<TI>#
+	_ZTI17CApaSystemControl @ 228 NONAME ; #<TI>#
+	_ZTI19CApaAppListNotifier @ 229 NONAME ; #<TI>#
+	_ZTI19CApaWindowGroupName @ 230 NONAME ; #<TI>#
+	_ZTI20TViewDataArrayFiller @ 231 NONAME ; #<TI>#
+	_ZTI21CApaAppInfoFileReader @ 232 NONAME ABSENT ; #<TI>#
+	_ZTI21CApaAppInfoFileWriter @ 233 NONAME ; #<TI>#
+	_ZTI21CApaSystemControlList @ 234 NONAME ; #<TI>#
+	_ZTI7HBufBuf @ 235 NONAME ; #<TI>#
+	_ZTI8CApaDoor @ 236 NONAME ; #<TI>#
+	_ZTV11CApaAppData @ 237 NONAME ; #<VT>#
+	_ZTV11CApaAppList @ 238 NONAME ; #<VT>#
+	_ZTV12CApaAppEntry @ 239 NONAME ; #<VT>#
+	_ZTV14CApaAIFCaption @ 240 NONAME ABSENT ; #<VT>#
+	_ZTV15CApaAIFViewData @ 241 NONAME ABSENT ; #<VT>#
+	_ZTV15CApaAppInfoFile @ 242 NONAME ABSENT ; #<VT>#
+	_ZTV15CApaAppViewData @ 243 NONAME ; #<VT>#
+	_ZTV15CApaIconPicture @ 244 NONAME ; #<VT>#
+	_ZTV16CApaMaskedBitmap @ 245 NONAME ; #<VT>#
+	_ZTV16TDesCArrayFiller @ 246 NONAME ; #<VT>#
+	_ZTV16TSizeArrayFiller @ 247 NONAME ; #<VT>#
+	_ZTV17CApaSystemControl @ 248 NONAME ; #<VT>#
+	_ZTV19CApaAppListNotifier @ 249 NONAME ; #<VT>#
+	_ZTV19CApaWindowGroupName @ 250 NONAME ; #<VT>#
+	_ZTV20TViewDataArrayFiller @ 251 NONAME ; #<VT>#
+	_ZTV21CApaAppInfoFileReader @ 252 NONAME ABSENT ; #<VT>#
+	_ZTV21CApaAppInfoFileWriter @ 253 NONAME ; #<VT>#
+	_ZTV21CApaSystemControlList @ 254 NONAME ; #<VT>#
+	_ZTV7HBufBuf @ 255 NONAME ; #<VT>#
+	_ZTV8CApaDoor @ 256 NONAME ; #<VT>#
+	_ZN11CApaAppList4NewLER3RFsP13CApaAppFinderP16CApaAppRegFinderi @ 257 NONAME ABSENT
+	_ZNK11CApaAppData12IconFileNameEv @ 258 NONAME
+	_ZNK11CApaAppData14NonMbmIconFileEv @ 259 NONAME
+	_ZNK11CApaAppData19DefaultScreenNumberEv @ 260 NONAME
+	_ZNK11CApaAppData20RegistrationFileUsedEv @ 261 NONAME
+	_ZNK13RApaLsSession10GetAppIconE4TUidRP7HBufC16 @ 262 NONAME
+	_ZNK13RApaLsSession14GetAppViewIconE4TUidS0_RP7HBufC16 @ 263 NONAME
+	_ZNK13RApaLsSession15GetFilteredAppsEjj @ 264 NONAME
+	_ZNK13RApaLsSession15GetFilteredAppsEjji @ 265 NONAME
+	_ZNK15CApaAppViewData12IconFileNameEv @ 266 NONAME
+	_ZNK15CApaAppViewData14NonMbmIconFileEv @ 267 NONAME
+	_ZTI17CApaAppInfoReader @ 268 NONAME ; #<TI>#
+	_ZTI19CApaAppInfoReaderV1 @ 269 NONAME ABSENT ; #<TI>#
+	_ZTI19CApaAppInfoReaderV2 @ 270 NONAME ; #<TI>#
+	_ZTV17CApaAppInfoReader @ 271 NONAME ; #<VT>#
+	_ZTV19CApaAppInfoReaderV1 @ 272 NONAME ABSENT ; #<VT>#
+	_ZTV19CApaAppInfoReaderV2 @ 273 NONAME ; #<VT>#
+	_Z16StartupApaServerR14MApaAppStarter @ 274 NONAME
+	_Z23StartupApaServerProcessv @ 275 NONAME
+	_ZN13RApaLsSession17DeleteDataMappingERK9TDataType @ 276 NONAME
+	_ZN13RApaLsSession17InsertDataMappingERK9TDataTypel4TUid @ 277 NONAME
+	_ZN13RApaLsSession25InsertDataMappingIfHigherERK9TDataTypel4TUidRi @ 278 NONAME
+	_ZNK11CApaAppData19ApplicationLanguageEv @ 279 NONAME
+	_ZNK13RApaLsSession19ApplicationLanguageE4TUidR9TLanguage @ 280 NONAME
+	_ZN21CApaSystemControlList4NewLER3RFs @ 281 NONAME
+	_ZNK11CApaAppData17ImplementsServiceE4TUid @ 282 NONAME
+	_ZNK11CApaAppList17ServiceUidBufferLE4TUid @ 283 NONAME
+	_ZNK11CApaAppList19ServiceArrayBufferLE4TUid @ 284 NONAME
+	_ZNK11CApaAppList21PreferredDataHandlerLERK9TDataTypePK4TUidRi @ 285 NONAME
+	_ZNK11CApaAppList23ServiceImplArrayBufferLE4TUid @ 286 NONAME
+	_ZNK11CApaAppList24ServiceOpaqueDataBufferLE4TUidS0_ @ 287 NONAME
+	_ZNK13RApaLsSession13GetServerAppsE4TUid @ 288 NONAME
+	_ZNK13RApaLsSession13GetServerAppsE4TUidi @ 289 NONAME
+	_ZNK13RApaLsSession15GetAppServicesLE4TUidR13CArrayFixFlatIS0_E @ 290 NONAME
+	_ZNK13RApaLsSession16GetAppServicesLCE4TUid @ 291 NONAME
+	_ZNK13RApaLsSession24AppForDataTypeAndServiceERK9TDataType4TUidRS3_ @ 292 NONAME
+	_ZNK13RApaLsSession24AppForDocumentAndServiceERK5RFile4TUidRS3_R9TDataType @ 293 NONAME
+	_ZNK13RApaLsSession24AppForDocumentAndServiceERK7TDesC164TUidRS3_R9TDataType @ 294 NONAME
+	_ZNK13RApaLsSession25GetAppServiceOpaqueDataLCE4TUidS0_ @ 295 NONAME
+	_ZNK13RApaLsSession27GetServiceImplementationsLCE4TUid @ 296 NONAME
+	_ZNK18TApaAppServiceInfo10OpaqueDataEv @ 297 NONAME
+	_ZNK18TApaAppServiceInfo3UidEv @ 298 NONAME
+	_ZTI30CApaAppServiceInfoArrayWrapper @ 299 NONAME ; #<TI>#
+	_ZTV30CApaAppServiceInfoArrayWrapper @ 300 NONAME ; #<VT>#
+	_ZN13RApaLsSession13StartDocumentER5RFileR9TThreadIdP14TRequestStatus @ 301 NONAME
+	_ZN21CApaAppInfoFileReader27CreateMaskedBitmapByIndexLCEi @ 302 NONAME ABSENT
+	_ZNK13RApaLsSession36CancelListPopulationCompleteObserverEv @ 303 NONAME
+	_ZNK13RApaLsSession38RegisterListPopulationCompleteObserverER14TRequestStatus @ 304 NONAME
+	_ZN8ApaUtils24HandleAsRegistrationFileERK8TUidType @ 305 NONAME
+	_ZN13RApaLsSession33RegisterJavaMIDletViaIterimFormatERK7TDesC16R5RFile @ 306 NONAME ABSENT
+	_ZN22ForJavaMIDletInstaller33CheckInterimFormatFileNotCorruptLER5RFile @ 307 NONAME
+	_ZN13RApaLsSession20DeregisterJavaMIDletERK7TDesC16 @ 308 NONAME ABSENT
+	_ZN13RApaLsSession13SetFsSessionLER3RFs @ 309 NONAME
+	_ZN13RApaLsSession13StartDocumentER5RFile4TUidR9TThreadIdP14TRequestStatus @ 310 NONAME
+	_ZN13RApaLsSession13StartDocumentER5RFileRK9TDataTypeR9TThreadIdP14TRequestStatus @ 311 NONAME
+	_ZN13RApaLsSession14ClearFsSessionEv @ 312 NONAME
+	_ZN13RApaLsSession9FsSessionEv @ 313 NONAME
+	_ZNK13RApaLsSession13RecognizeDataERK5RFileR22TDataRecognitionResult @ 314 NONAME
+	_ZNK13RApaLsSession14AppForDocumentERK5RFileR4TUidR9TDataType @ 315 NONAME
+	_ZNK13RApaLsSession21RecognizeSpecificDataERK5RFileRK9TDataTypeRi @ 316 NONAME
+	_ZNK13RApaLsSession19GetPreferredBufSizeERi @ 317 NONAME
+	_ZN22ForJavaMIDletInstaller18GetJavaMIDletInfoLER3RFsRK7TDesC16RmS5_ @ 318 NONAME
+	_ZN22ForJavaMIDletInstaller28NewInterimFormatFileWriterLCER3RFsRK7TDesC164TUidmi @ 319 NONAME
+	_ZNK18TApaAppServiceInfo9DataTypesEv @ 320 NONAME
+	_ZNK11CApaAppList23ServiceImplArrayBufferLE4TUidRK9TDataType @ 321 NONAME
+	_ZNK13RApaLsSession27GetServiceImplementationsLCE4TUidRK9TDataType @ 322 NONAME
+	_ZN13RApaLsSession5CloseEv @ 323 NONAME
+	_ZTI22CApaLsSessionExtension @ 324 NONAME ; #<TI>#
+	_ZTV22CApaLsSessionExtension @ 325 NONAME ; #<VT>#
+	_ZN13RApaLsSession23RApaLsSession_Reserved1Ev @ 326 NONAME
+	_ZN13RApaLsSession23RApaLsSession_Reserved2Ev @ 327 NONAME
+	_ZN18TApaPictureFactoryC1Ev @ 328 NONAME
+	_ZN18TApaPictureFactoryC2Ev @ 329 NONAME
+	_ZN23MApaAppListServObserver33MApaAppListServObserver_Reserved1Ev @ 330 NONAME
+	_ZN23MApaAppListServObserver33MApaAppListServObserver_Reserved2Ev @ 331 NONAME
+	_ZN23MApaAppListServObserverC2Ev @ 332 NONAME
+	_ZTI13RApaLsSession @ 333 NONAME ; #<TI>#
+	_ZTI23MApaAppListServObserver @ 334 NONAME ; #<TI>#
+	_ZTV13RApaLsSession @ 335 NONAME ; #<VT>#
+	_ZTV23MApaAppListServObserver @ 336 NONAME ; #<VT>#
+	_ZNK13RApaLsSession15RecognizeFilesLERK7TDesC16R27CDataRecognitionResultArray @ 337 NONAME
+	_ZN13RApaLsSession15RecognizeFilesLERK7TDesC16R27CDataRecognitionResultArrayR14TRequestStatus @ 338 NONAME
+	_ZNK13RApaLsSession15RecognizeFilesLERK7TDesC16RK6TDesC8R27CDataRecognitionResultArray @ 339 NONAME
+	_ZN13RApaLsSession15RecognizeFilesLERK7TDesC16RK6TDesC8R27CDataRecognitionResultArrayR14TRequestStatus @ 340 NONAME
+	_ZN13RApaLsSession20CancelRecognizeFilesEv @ 341 NONAME
+	_ZN27CDataRecognitionResultArrayC1Ev @ 342 NONAME
+	_ZN27CDataRecognitionResultArrayC2Ev @ 343 NONAME
+	_ZN27CDataRecognitionResultArrayD0Ev @ 344 NONAME
+	_ZN27CDataRecognitionResultArrayD1Ev @ 345 NONAME
+	_ZN27CDataRecognitionResultArrayD2Ev @ 346 NONAME
+	_ZNK27CDataRecognitionResultArray12GetFileNameLER4TBufILi256EEj @ 347 NONAME
+	_ZNK27CDataRecognitionResultArray25GetDataRecognitionResultLER22TDataRecognitionResultj @ 348 NONAME
+	_ZNK27CDataRecognitionResultArray4PathEv @ 349 NONAME
+	_ZNK27CDataRecognitionResultArray5CountEv @ 350 NONAME
+	_ZTI21CAsyncFileRecognition @ 351 NONAME ; #<TI>#
+	_ZTI27CDataRecognitionResultArray @ 352 NONAME ; #<TI>#
+	_ZTI32CDataRecognitionResultArrayEntry @ 353 NONAME ; #<TI>#
+	_ZTV21CAsyncFileRecognition @ 354 NONAME ; #<VT>#
+	_ZTV27CDataRecognitionResultArray @ 355 NONAME ; #<VT>#
+	_ZTV32CDataRecognitionResultArrayEntry @ 356 NONAME ; #<VT>#
+	_ZNK13RApaLsSession16GetAppByDataTypeERK9TDataType4TUidRS3_ @ 357 NONAME
+	_ZN13RApaLsSession17DeleteDataMappingERK9TDataType4TUid @ 358 NONAME
+	_ZN13RApaLsSession17InsertDataMappingERK9TDataTypel4TUidS3_ @ 359 NONAME
+	_ZN13RApaLsSession29RegisterNonNativeApplicationLE4TUidRK10TDriveUnitR34CApaRegistrationResourceFileWriterP33CApaLocalisableResourceFileWriterPK5RFile @ 360 NONAME
+	_ZN13RApaLsSession31DeregisterNonNativeApplicationLE4TUid @ 361 NONAME
+	_ZN13RApaLsSession33RegisterNonNativeApplicationTypeLE4TUidRK7TDesC16 @ 362 NONAME
+	_ZN13RApaLsSession35DeregisterNonNativeApplicationTypeLE4TUid @ 363 NONAME
+	_ZN13RApaLsSession8StartAppERK15CApaCommandLineR9TThreadIdP14TRequestStatus @ 364 NONAME
+	_ZNK11CApaAppData10OpaqueDataEv @ 365 NONAME
+	_ZNK11CApaAppData20RegistrationFileNameEv @ 366 NONAME
+	_ZNK11CApaAppData27LocalisableResourceFileNameEv @ 367 NONAME
+	_ZNK11CApaAppList17AppDataByFileNameERK7TDesC16 @ 368 NONAME
+	_ZNK13RApaLsSession22GetDefaultScreenNumberERi4TUid @ 369 NONAME
+	_ZN11CApaAppList22FindAndAddSpecificAppLEP16CApaAppRegFinder4TUid @ 370 NONAME
+	_ZNK13RApaLsSession21MatchesSecurityPolicyERi4TUidRK15TSecurityPolicy @ 371 NONAME
+	_ZN33CApaLocalisableResourceFileWriterD1Ev @ 372 NONAME
+	_ZN33CApaLocalisableResourceFileWriterD2Ev @ 373 NONAME
+	_ZN34CApaRegistrationResourceFileWriter12AddDataTypeLEiRK6TDesC8 @ 374 NONAME
+	_ZN34CApaRegistrationResourceFileWriter13SetGroupNameLERK7TDesC16 @ 375 NONAME
+	_ZN34CApaRegistrationResourceFileWriter14SetOpaqueDataLERK6TDesC8 @ 376 NONAME
+	_ZN34CApaRegistrationResourceFileWriter15SetAppIsHiddenLEi @ 377 NONAME
+	_ZN34CApaRegistrationResourceFileWriter17SetEmbeddabilityLEN17TApaAppCapability14TEmbeddabilityE @ 378 NONAME
+	_ZN34CApaRegistrationResourceFileWriter19SetSupportsNewFileLEi @ 379 NONAME
+	_ZN34CApaRegistrationResourceFileWriter21AddFileOwnershipInfoLERK7TDesC16 @ 380 NONAME
+	_ZN34CApaRegistrationResourceFileWriter22SetLaunchInBackgroundLEi @ 381 NONAME
+	_ZN34CApaRegistrationResourceFileWriter23SetDefaultScreenNumberLEi @ 382 NONAME
+	_ZN34CApaRegistrationResourceFileWriter4NewLE4TUidRK7TDesC16j @ 383 NONAME
+	_ZN34CApaRegistrationResourceFileWriterD0Ev @ 384 NONAME
+	_ZN34CApaRegistrationResourceFileWriterD1Ev @ 385 NONAME
+	_ZN34CApaRegistrationResourceFileWriterD2Ev @ 386 NONAME
+	_ZNK11CApaAppData24NonNativeApplicationTypeEv @ 387 NONAME
+	_ZTI33CApaLocalisableResourceFileWriter @ 388 NONAME ; #<TI>#
+	_ZTI34CApaRegistrationResourceFileWriter @ 389 NONAME ; #<TI>#
+	_ZTIN26CApaResourceFileWriterBase11RBufferSinkE @ 390 NONAME ; #<TI>#
+	_ZTV33CApaLocalisableResourceFileWriter @ 391 NONAME ; #<VT>#
+	_ZTV34CApaRegistrationResourceFileWriter @ 392 NONAME ; #<VT>#
+	_ZTVN26CApaResourceFileWriterBase11RBufferSinkE @ 393 NONAME ; #<VT>#
+	_ZN33CApaLocalisableResourceFileWriter4NewLERK7TDesC16S2_iS2_ @ 394 NONAME
+	_ZN33CApaLocalisableResourceFileWriterD0Ev @ 395 NONAME
+	_ZN13RApaLsSession12CancelNotifyEv @ 396 NONAME
+	_ZN13RApaLsSession9SetNotifyEiR14TRequestStatus @ 397 NONAME
+	_ZNK11CApaAppList17AppScanInProgressEv @ 398 NONAME
+	_ZN13RApaLsSession25NotifyOnDataMappingChangeER14TRequestStatus @ 399 NONAME
+	_ZN13RApaLsSession31CancelNotifyOnDataMappingChangeEv @ 400 NONAME
+	_ZNK13RApaLsSession10GetAppTypeER4TUidS0_ @ 401 NONAME
+	_ZN13RApaLsSession35CommitNonNativeApplicationsUpdatesLEv @ 402 NONAME
+	_ZN13RApaLsSession36PrepareNonNativeApplicationsUpdatesLEv @ 403 NONAME
+	_ZN13RApaLsSession36RollbackNonNativeApplicationsUpdatesEv @ 404 NONAME
+	_ZN11CApaAppList15UpdatedAppsListEv @ 405 NONAME ABSENT
+	_ZN11CApaAppList18SetUpdatedAppsListEP16CUpdatedAppsList @ 406 NONAME ABSENT
+	_ZN11CApaAppData4NewLERK12TApaAppEntryR3RFsRK7TDesC16 @ 407 NONAME
+	_ZN11CApaAppDataD0Ev @ 408 NONAME
+	_ZN11CApaAppDataD1Ev @ 409 NONAME
+	_ZN11CApaAppDataD2Ev @ 410 NONAME
+	_ZN11CApaAppList24ShareProtectedFileServerEv @ 411 NONAME ABSENT
+	_ZN11CApaAppList4SelfEv @ 412 NONAME
+	X @ 413 NONAME ABSENT
+	X @ 414 NONAME ABSENT
+	X @ 415 NONAME ABSENT
+	X @ 416 NONAME ABSENT
+	_ZN13RApaLsSession18SetAppShortCaptionERK7TDesC169TLanguage4TUid @ 417 NONAME
+	_ZN11CApaAppData16SetShortCaptionLERK7TDesC16 @ 418 NONAME
+	_ZN11CApaAppList14CompareStringsERK7HBufC16S2_ @ 419 NONAME
+	_ZN11CApaAppList22AddForcedRegistrationLEP7HBufC16 @ 420 NONAME
+	_ZN13RApaLsSession17ForceRegistrationERK13RPointerArrayI7TDesC16E @ 421 NONAME
+	_ZN11CApaAppList24ResetForcedRegistrationsEv @ 422 NONAME
+	_ZN11CApaAppList12RestartScanLEv @ 423 NONAME
+	_ZN11CApaAppList8StopScanEv @ 424 NONAME
+	KMinApplicationStackSize @ 425 NONAME DATA 4
+	_Z23MinApplicationStackSizev @ 426 NONAME
+	_ZN17CApaSecurityUtils16CheckAppSecurityERK7TPtrC16RiS3_ @ 427 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/eabi/APGRFX_UI_FRAMEWORKSU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,437 @@
+EXPORTS
+	_ZNK11CApaAppData11GetIconInfoERiS0_ @ 1 NONAME
+	_ZN11CApaAppData16CanUseScreenModeEi @ 2 NONAME
+	_ZN11CApaAppList16StartIdleUpdateLEP19MApaAppListObserver @ 3 NONAME
+	_ZN11CApaAppList16StartIdleUpdateLEv @ 4 NONAME
+	_ZN11CApaAppList4NewLER3RFsP16CApaAppRegFinderii @ 5 NONAME
+	_ZN11CApaAppList6PurgeLEv @ 6 NONAME
+	_ZN11CApaAppList7UpdateLEv @ 7 NONAME ABSENT
+	_ZN11CApaAppList9InitListLEP19MApaAppListObserver @ 8 NONAME
+	_ZN11CApaAppListD0Ev @ 9 NONAME
+	_ZN11CApaAppListD1Ev @ 10 NONAME
+	_ZN11CApaAppListD2Ev @ 11 NONAME
+	_ZN12TApaTaskList10CycleTasksE4TUidNS_15TCycleDirectionE @ 12 NONAME
+	_ZN12TApaTaskList7FindAppE4TUid @ 13 NONAME
+	_ZN12TApaTaskList7FindAppERK7TDesC16 @ 14 NONAME
+	_ZN12TApaTaskList7FindDocERK7TDesC16 @ 15 NONAME
+	_ZN12TApaTaskList9FindByPosEi @ 16 NONAME
+	_ZN12TApaTaskListC1ER10RWsSession @ 17 NONAME
+	_ZN12TApaTaskListC2ER10RWsSession @ 18 NONAME
+	_ZN13RApaLsSession13StartDocumentERK7TDesC164TUidR9TThreadIdNS_11TLaunchTypeE @ 19 NONAME
+	_ZN13RApaLsSession13StartDocumentERK7TDesC16R9TThreadIdNS_11TLaunchTypeE @ 20 NONAME
+	_ZN13RApaLsSession13StartDocumentERK7TDesC16RK9TDataTypeR9TThreadIdNS_11TLaunchTypeE @ 21 NONAME
+	_ZN13RApaLsSession14CreateDocumentERK7TDesC164TUidR9TThreadIdNS_11TLaunchTypeE @ 22 NONAME
+	_ZN13RApaLsSession17SetMaxDataBufSizeEi @ 23 NONAME
+	_ZN13RApaLsSession21SetAcceptedConfidenceEi @ 24 NONAME
+	_ZN13RApaLsSession7ConnectEv @ 25 NONAME
+	_ZN13RApaLsSession8StartAppERK15CApaCommandLine @ 26 NONAME
+	_ZN13RApaLsSession8StartAppERK15CApaCommandLineR9TThreadId @ 27 NONAME
+	_ZN13RApaLsSessionC1Ev @ 28 NONAME
+	_ZN13RApaLsSessionC2Ev @ 29 NONAME
+	_ZN16AppInfoFileUtils14GetAifFileNameERK3RFsR6TDes16 @ 30 NONAME ABSENT
+	_ZN16CApaMaskedBitmap12InternalizeLER11RReadStream @ 31 NONAME
+	_ZN16CApaMaskedBitmap13SetMaskBitmapEP10CFbsBitmap @ 32 NONAME
+	_ZN16CApaMaskedBitmap4NewLEPKS_ @ 33 NONAME
+	_ZN16CApaMaskedBitmap5NewLCEv @ 34 NONAME
+	_ZN16CApaMaskedBitmapD0Ev @ 35 NONAME
+	_ZN16CApaMaskedBitmapD1Ev @ 36 NONAME
+	_ZN16CApaMaskedBitmapD2Ev @ 37 NONAME
+	_ZN17CApaSystemControl7CreateLEv @ 38 NONAME
+	_ZN18TApaPictureFactoryC1EP11CApaProcess @ 39 NONAME
+	_ZN18TApaPictureFactoryC2EP11CApaProcess @ 40 NONAME
+	_ZN19CApaAppListNotifier4NewLEP23MApaAppListServObserverN7CActive9TPriorityE @ 41 NONAME
+	_ZN19CApaAppListNotifierD0Ev @ 42 NONAME
+	_ZN19CApaAppListNotifierD1Ev @ 43 NONAME
+	_ZN19CApaAppListNotifierD2Ev @ 44 NONAME
+	_ZN19CApaWindowGroupName11SetAppReadyEi @ 45 NONAME
+	_ZN19CApaWindowGroupName11SetCaptionLERK7TDesC16 @ 46 NONAME
+	_ZN19CApaWindowGroupName11SetDocNameLERK7TDesC16 @ 47 NONAME
+	_ZN19CApaWindowGroupName12FindByAppUidE4TUidR10RWsSessionRi @ 48 NONAME
+	_ZN19CApaWindowGroupName13FindByCaptionERK7TDesC16R10RWsSessionRi @ 49 NONAME
+	_ZN19CApaWindowGroupName13FindByDocNameERK7TDesC16R10RWsSessionRi @ 50 NONAME
+	_ZN19CApaWindowGroupName17SetDocNameIsAFileEi @ 51 NONAME
+	_ZN19CApaWindowGroupName18ConstructFromWgIdLEi @ 52 NONAME
+	_ZN19CApaWindowGroupName18SetWindowGroupNameEP7HBufC16 @ 53 NONAME
+	_ZN19CApaWindowGroupName19SetWindowGroupNameLERK7TDesC16 @ 54 NONAME
+	_ZN19CApaWindowGroupName26SetRespondsToShutdownEventEi @ 55 NONAME
+	_ZN19CApaWindowGroupName29SetRespondsToSwitchFilesEventEi @ 56 NONAME
+	_ZN19CApaWindowGroupName3NewERK10RWsSessionP7HBufC16 @ 57 NONAME
+	_ZN19CApaWindowGroupName4NewLERK10RWsSession @ 58 NONAME
+	_ZN19CApaWindowGroupName4NewLERK10RWsSessionRK7TDesC16 @ 59 NONAME
+	_ZN19CApaWindowGroupName4NewLERK10RWsSessioni @ 60 NONAME
+	_ZN19CApaWindowGroupName5NewLCERK10RWsSession @ 61 NONAME
+	_ZN19CApaWindowGroupName5NewLCERK10RWsSessionRK7TDesC16 @ 62 NONAME
+	_ZN19CApaWindowGroupName5NewLCERK10RWsSessioni @ 63 NONAME
+	_ZNK19CApaWindowGroupName6HiddenEv @ 64 NONAME
+	_ZN19CApaWindowGroupName7SetBusyEi @ 65 NONAME
+	_ZN19CApaWindowGroupName9SetAppUidE4TUid @ 66 NONAME
+	_ZN19CApaWindowGroupName9SetHiddenEi @ 67 NONAME
+	_ZN19CApaWindowGroupName9SetSystemEi @ 68 NONAME
+	_ZN19CApaWindowGroupNameD0Ev @ 69 NONAME
+	_ZN19CApaWindowGroupNameD1Ev @ 70 NONAME
+	_ZN19CApaWindowGroupNameD2Ev @ 71 NONAME
+	_ZN21CApaAppInfoFileReader12StretchDrawLEP10CFbsBitmapS1_5TSize @ 72 NONAME ABSENT
+	_ZN21CApaAppInfoFileReader19CreateMaskedBitmapLEi @ 73 NONAME ABSENT
+	_ZN21CApaAppInfoFileReader4NewLER3RFsRK7TDesC164TUid @ 74 NONAME ABSENT
+	_ZN21CApaAppInfoFileReader5NewLCER3RFsRK7TDesC164TUid @ 75 NONAME ABSENT
+	_ZN21CApaAppInfoFileReader8CaptionLE9TLanguage @ 76 NONAME ABSENT
+	_ZN21CApaAppInfoFileReaderD0Ev @ 77 NONAME ABSENT
+	_ZN21CApaAppInfoFileReaderD1Ev @ 78 NONAME ABSENT
+	_ZN21CApaAppInfoFileReaderD2Ev @ 79 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter10StoreViewLE4TUid @ 80 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter11AddCaptionLE9TLanguageRK7TDesC16 @ 81 NONAME
+	_ZN21CApaAppInfoFileWriter12AddDataTypeLERK21TDataTypeWithPriority @ 82 NONAME
+	_ZN21CApaAppInfoFileWriter12AddViewIconLER16CApaMaskedBitmap4TUid @ 83 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter13AddOwnedFileLERK7TDesC16 @ 84 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter13SetCapabilityERK6TDesC8 @ 85 NONAME
+	_ZN21CApaAppInfoFileWriter15AddViewCaptionLE9TLanguageRK7TDesC164TUid @ 86 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter5NewLCER3RFsRK7TDesC164TUid @ 87 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter6StoreLEv @ 88 NONAME
+	_ZN21CApaAppInfoFileWriter8AddIconLER16CApaMaskedBitmap @ 89 NONAME
+	_ZN21CApaAppInfoFileWriter8AddIconLERK7TDesC16 @ 90 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter8AddViewLE4TUid @ 91 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriter8AddViewLE4TUidi @ 92 NONAME ABSENT
+	_ZN21CApaAppInfoFileWriterD0Ev @ 93 NONAME
+	_ZN21CApaAppInfoFileWriterD1Ev @ 94 NONAME
+	_ZN21CApaAppInfoFileWriterD2Ev @ 95 NONAME
+	_ZN21CApaSystemControlList4NewLER3RFsR13CApaAppFinderRK7TDesC16 @ 96 NONAME ABSENT
+	_ZN21CApaSystemControlList7UpdateLEv @ 97 NONAME
+	_ZN21CApaSystemControlListD0Ev @ 98 NONAME
+	_ZN21CApaSystemControlListD1Ev @ 99 NONAME
+	_ZN21CApaSystemControlListD2Ev @ 100 NONAME
+	_ZN8CApaDoor16SetFormatToIconLEv @ 101 NONAME
+	_ZN8CApaDoor17SetFormatToGlassLEv @ 102 NONAME
+	_ZN8CApaDoor25SetFormatToTemporaryIconLEi @ 103 NONAME
+	_ZN8CApaDoor4NewLER3RFsR12CApaDocumentRK5TSize @ 104 NONAME
+	_ZN8CApaDoor4NewLER3RFsRK12CStreamStore9TStreamIdR11CApaProcess @ 105 NONAME
+	_ZN8CApaDoor5NewLCER3RFsR12CApaDocumentRK5TSize @ 106 NONAME
+	_ZN8CApaDoor8RestoreLERK12CStreamStore9TStreamId @ 107 NONAME
+	_ZN8CApaDoor9DocumentLEi @ 108 NONAME
+	_ZN8CApaDoorD0Ev @ 109 NONAME
+	_ZN8CApaDoorD1Ev @ 110 NONAME
+	_ZN8CApaDoorD2Ev @ 111 NONAME
+	_ZN8TApaTask11SendMessageE4TUidRK6TDesC8 @ 112 NONAME
+	_ZN8TApaTask14SwitchOpenFileERK7TDesC16 @ 113 NONAME
+	_ZN8TApaTask15SendSystemEventE15TApaSystemEvent @ 114 NONAME
+	_ZN8TApaTask16SendToBackgroundEv @ 115 NONAME
+	_ZN8TApaTask16SwitchCreateFileERK7TDesC16 @ 116 NONAME
+	_ZN8TApaTask17BringToForegroundEv @ 117 NONAME
+	_ZN8TApaTask7EndTaskEv @ 118 NONAME
+	_ZN8TApaTask7SendKeyERK9TKeyEvent @ 119 NONAME
+	_ZN8TApaTask7SendKeyEii @ 120 NONAME
+	_ZN8TApaTask7SetWgIdEi @ 121 NONAME
+	_ZN8TApaTask8KillTaskEv @ 122 NONAME
+	_ZN8TApaTaskC1ER10RWsSession @ 123 NONAME
+	_ZN8TApaTaskC2ER10RWsSession @ 124 NONAME
+	_ZNK11CApaAppData10CapabilityER5TDes8 @ 125 NONAME
+	_ZNK11CApaAppData10IconSizesLEv @ 126 NONAME
+	_ZNK11CApaAppData10OwnedFilesEv @ 127 NONAME
+	_ZNK11CApaAppData4IconE5TSize @ 128 NONAME
+	_ZNK11CApaAppData4IconEi @ 129 NONAME
+	_ZNK11CApaAppData5ViewsEv @ 130 NONAME
+	_ZNK11CApaAppData8AppEntryEv @ 131 NONAME
+	_ZNK11CApaAppData8DataTypeERK9TDataType @ 132 NONAME
+	_ZNK11CApaAppList12AppDataByUidE4TUid @ 133 NONAME
+	_ZNK11CApaAppList13UpdateCounterEv @ 134 NONAME ABSENT
+	_ZNK11CApaAppList19IsFirstScanCompleteEv @ 135 NONAME
+	_ZNK11CApaAppList20IsIdleUpdateCompleteEv @ 136 NONAME
+	_ZNK11CApaAppList21PreferredDataHandlerLERK9TDataType @ 137 NONAME
+	_ZNK11CApaAppList5CountEv @ 138 NONAME
+	_ZNK11CApaAppList7NextAppEPK11CApaAppData @ 139 NONAME
+	_ZNK11CApaAppList7NextAppEPK11CApaAppDatai @ 140 NONAME
+	_ZNK11CApaAppList8FirstAppEi @ 141 NONAME
+	_ZNK11CApaAppList8FirstAppEv @ 142 NONAME
+	_ZNK13RApaLsSession10GetAllAppsEi @ 143 NONAME
+	_ZNK13RApaLsSession10GetAllAppsEv @ 144 NONAME
+	_ZNK13RApaLsSession10GetAppIconE4TUid5TSizeR16CApaMaskedBitmap @ 145 NONAME
+	_ZNK13RApaLsSession10GetAppIconE4TUidiR16CApaMaskedBitmap @ 146 NONAME
+	_ZNK13RApaLsSession10GetAppInfoER11TApaAppInfo4TUid @ 147 NONAME
+	_ZNK13RApaLsSession10GetNextAppER11TApaAppInfo @ 148 NONAME
+	_ZNK13RApaLsSession10GetNextAppER11TApaAppInfoi @ 149 NONAME
+	_ZNK13RApaLsSession11GetAppViewsER13CArrayFixFlatI15TApaAppViewInfoE4TUid @ 150 NONAME
+	_ZNK13RApaLsSession13RecognizeDataERK7TDesC16RK6TDesC8R22TDataRecognitionResult @ 151 NONAME
+	_ZNK13RApaLsSession14AppForDataTypeERK9TDataTypeR4TUid @ 152 NONAME
+	_ZNK13RApaLsSession14AppForDocumentERK7TDesC16R4TUidR9TDataType @ 153 NONAME
+	_ZNK13RApaLsSession14GetAppInfo_7_0ER15TApaAppInfo_7_04TUid @ 154 NONAME ABSENT
+	_ZNK13RApaLsSession14GetAppViewIconE4TUidS0_RK5TSizeR16CApaMaskedBitmap @ 155 NONAME
+	_ZNK13RApaLsSession14GetNextApp_7_0ER15TApaAppInfo_7_0 @ 156 NONAME ABSENT
+	_ZNK13RApaLsSession14GetNextApp_7_0ER15TApaAppInfo_7_0i @ 157 NONAME ABSENT
+	_ZNK13RApaLsSession15GetAppIconSizesE4TUidR13CArrayFixFlatI5TSizeE @ 158 NONAME
+	_ZNK13RApaLsSession15GetFilteredAppsERK23TApaEmbeddabilityFilter @ 159 NONAME
+	_ZNK13RApaLsSession15GetFilteredAppsERK23TApaEmbeddabilityFilteri @ 160 NONAME
+	_ZNK13RApaLsSession16GetAppCapabilityER5TDes84TUid @ 161 NONAME
+	_ZNK13RApaLsSession16GetAppOwnedFilesER12CDesC16Array4TUid @ 162 NONAME
+	_ZNK13RApaLsSession17GetEmbeddableAppsEi @ 163 NONAME
+	_ZNK13RApaLsSession17GetEmbeddableAppsEv @ 164 NONAME
+	_ZNK13RApaLsSession17GetMaxDataBufSizeERi @ 165 NONAME
+	_ZNK13RApaLsSession18EmbeddableAppCountERi @ 166 NONAME
+	_ZNK13RApaLsSession21GetAcceptedConfidenceERi @ 167 NONAME
+	_ZNK13RApaLsSession21RecognizeSpecificDataERK7TDesC16RK6TDesC8RK9TDataTypeRi @ 168 NONAME
+	_ZNK13RApaLsSession22GetSupportedDataTypesLER13CArrayFixFlatI9TDataTypeE @ 169 NONAME
+	_ZNK13RApaLsSession23NumberOfOwnDefinedIconsE4TUidRi @ 170 NONAME
+	_ZNK13RApaLsSession7VersionEv @ 171 NONAME
+	_ZNK13RApaLsSession8AppCountERi @ 172 NONAME
+	_ZNK13RApaLsSession9IsProgramERK7TDesC16Ri @ 173 NONAME
+	_ZNK15CApaAIFViewData10ScreenModeEv @ 174 NONAME ABSENT
+	_ZNK15CApaAIFViewData12IconByIndexLEi @ 175 NONAME ABSENT
+	_ZNK15CApaAIFViewData13NumberOfIconsEv @ 176 NONAME ABSENT
+	_ZNK15CApaAIFViewData7ViewUidEv @ 177 NONAME ABSENT
+	_ZNK15CApaAIFViewData8CaptionLE9TLanguage @ 178 NONAME ABSENT
+	_ZNK15CApaAppViewData10IconSizesLEv @ 179 NONAME
+	_ZNK15CApaAppViewData10ScreenModeEv @ 180 NONAME
+	_ZNK15CApaAppViewData3UidEv @ 181 NONAME
+	_ZNK15CApaAppViewData4IconERK5TSize @ 182 NONAME
+	_ZNK16CApaMaskedBitmap12ExternalizeLER12RWriteStream @ 183 NONAME
+	_ZNK16CApaMaskedBitmap4MaskEv @ 184 NONAME
+	_ZNK17CApaSystemControl12ShortCaptionEv @ 185 NONAME
+	_ZNK17CApaSystemControl4IconEv @ 186 NONAME
+	_ZNK17CApaSystemControl4TypeEv @ 187 NONAME
+	_ZNK17CApaSystemControl7CaptionEv @ 188 NONAME
+	_ZNK17CApaSystemControl8FileNameEv @ 189 NONAME
+	_ZNK18TApaPictureFactory11NewPictureLER14TPictureHeaderRK12CStreamStore @ 190 NONAME
+	_ZNK19CApaWindowGroupName10IsAppReadyEv @ 191 NONAME
+	_ZNK19CApaWindowGroupName14DocNameIsAFileEv @ 192 NONAME
+	_ZNK19CApaWindowGroupName15WindowGroupNameEv @ 193 NONAME
+	_ZNK19CApaWindowGroupName18SetWindowGroupNameER12RWindowGroup @ 194 NONAME
+	_ZNK19CApaWindowGroupName23RespondsToShutdownEventEv @ 195 NONAME
+	_ZNK19CApaWindowGroupName26RespondsToSwitchFilesEventEv @ 196 NONAME
+	_ZNK19CApaWindowGroupName6AppUidEv @ 197 NONAME
+	_ZNK19CApaWindowGroupName6IsBusyEv @ 198 NONAME
+	_ZNK19CApaWindowGroupName7CaptionEv @ 199 NONAME
+	_ZNK19CApaWindowGroupName7DocNameEv @ 200 NONAME
+	_ZNK19CApaWindowGroupName8IsSystemEv @ 201 NONAME
+	_ZNK21CApaAppInfoFileReader10CapabilityER5TDes8 @ 202 NONAME ABSENT
+	_ZNK21CApaAppInfoFileReader14GetOwnedFilesLER12CDesC16Array @ 203 NONAME ABSENT
+	_ZNK21CApaAppInfoFileReader15NumberOfBitmapsEv @ 204 NONAME ABSENT
+	_ZNK21CApaAppInfoFileReader19DataTypesSupportedLER9CArrayFixI21TDataTypeWithPriorityE @ 205 NONAME ABSENT
+	_ZNK21CApaAppInfoFileReader9GetViewsLER9CArrayPtrI15CApaAIFViewDataE @ 206 NONAME ABSENT
+	_ZNK21CApaSystemControlList5CountEv @ 207 NONAME
+	_ZNK21CApaSystemControlList5IndexE4TUid @ 208 NONAME
+	_ZNK21CApaSystemControlList7ControlE4TUid @ 209 NONAME
+	_ZNK21CApaSystemControlList7ControlEi @ 210 NONAME
+	_ZNK8CApaDoor7AppUidLEv @ 211 NONAME
+	_ZNK8TApaTask4WgIdEv @ 212 NONAME
+	_ZNK8TApaTask6ExistsEv @ 213 NONAME
+	_ZNK8TApaTask8ThreadIdEv @ 214 NONAME
+	_ZTI18TApaPictureFactory @ 215 NONAME ; #<TI>#
+	_ZTV18TApaPictureFactory @ 216 NONAME ; #<VT>#
+	_ZTI11CApaAppData @ 217 NONAME ; #<TI>#
+	_ZTI11CApaAppList @ 218 NONAME ; #<TI>#
+	_ZTI12CApaAppEntry @ 219 NONAME ; #<TI>#
+	_ZTI14CApaAIFCaption @ 220 NONAME ABSENT ; #<TI>#
+	_ZTI15CApaAIFViewData @ 221 NONAME ABSENT ; #<TI>#
+	_ZTI15CApaAppInfoFile @ 222 NONAME ABSENT ; #<TI>#
+	_ZTI15CApaAppViewData @ 223 NONAME ; #<TI>#
+	_ZTI15CApaIconPicture @ 224 NONAME ; #<TI>#
+	_ZTI16CApaMaskedBitmap @ 225 NONAME ; #<TI>#
+	_ZTI16TDesCArrayFiller @ 226 NONAME ; #<TI>#
+	_ZTI16TSizeArrayFiller @ 227 NONAME ; #<TI>#
+	_ZTI17CApaSystemControl @ 228 NONAME ; #<TI>#
+	_ZTI19CApaAppListNotifier @ 229 NONAME ; #<TI>#
+	_ZTI19CApaWindowGroupName @ 230 NONAME ; #<TI>#
+	_ZTI20TViewDataArrayFiller @ 231 NONAME ; #<TI>#
+	_ZTI21CApaAppInfoFileReader @ 232 NONAME ABSENT ; #<TI>#
+	_ZTI21CApaAppInfoFileWriter @ 233 NONAME ; #<TI>#
+	_ZTI21CApaSystemControlList @ 234 NONAME ; #<TI>#
+	_ZTI7HBufBuf @ 235 NONAME ; #<TI>#
+	_ZTI8CApaDoor @ 236 NONAME ; #<TI>#
+	_ZTV11CApaAppData @ 237 NONAME ; #<VT>#
+	_ZTV11CApaAppList @ 238 NONAME ; #<VT>#
+	_ZTV12CApaAppEntry @ 239 NONAME ; #<VT>#
+	_ZTV14CApaAIFCaption @ 240 NONAME ABSENT ; #<VT>#
+	_ZTV15CApaAIFViewData @ 241 NONAME ABSENT ; #<VT>#
+	_ZTV15CApaAppInfoFile @ 242 NONAME ABSENT ; #<VT>#
+	_ZTV15CApaAppViewData @ 243 NONAME ; #<VT>#
+	_ZTV15CApaIconPicture @ 244 NONAME ; #<VT>#
+	_ZTV16CApaMaskedBitmap @ 245 NONAME ; #<VT>#
+	_ZTV16TDesCArrayFiller @ 246 NONAME ; #<VT>#
+	_ZTV16TSizeArrayFiller @ 247 NONAME ; #<VT>#
+	_ZTV17CApaSystemControl @ 248 NONAME ; #<VT>#
+	_ZTV19CApaAppListNotifier @ 249 NONAME ; #<VT>#
+	_ZTV19CApaWindowGroupName @ 250 NONAME ; #<VT>#
+	_ZTV20TViewDataArrayFiller @ 251 NONAME ; #<VT>#
+	_ZTV21CApaAppInfoFileReader @ 252 NONAME ABSENT ; #<VT>#
+	_ZTV21CApaAppInfoFileWriter @ 253 NONAME ; #<VT>#
+	_ZTV21CApaSystemControlList @ 254 NONAME ; #<VT>#
+	_ZTV7HBufBuf @ 255 NONAME ; #<VT>#
+	_ZTV8CApaDoor @ 256 NONAME ; #<VT>#
+	_ZN11CApaAppList4NewLER3RFsP13CApaAppFinderP16CApaAppRegFinderi @ 257 NONAME ABSENT
+	_ZNK11CApaAppData12IconFileNameEv @ 258 NONAME
+	_ZNK11CApaAppData14NonMbmIconFileEv @ 259 NONAME
+	_ZNK11CApaAppData19DefaultScreenNumberEv @ 260 NONAME
+	_ZNK11CApaAppData20RegistrationFileUsedEv @ 261 NONAME
+	_ZNK13RApaLsSession10GetAppIconE4TUidRP7HBufC16 @ 262 NONAME
+	_ZNK13RApaLsSession14GetAppViewIconE4TUidS0_RP7HBufC16 @ 263 NONAME
+	_ZNK13RApaLsSession15GetFilteredAppsEjj @ 264 NONAME
+	_ZNK13RApaLsSession15GetFilteredAppsEjji @ 265 NONAME
+	_ZNK15CApaAppViewData12IconFileNameEv @ 266 NONAME
+	_ZNK15CApaAppViewData14NonMbmIconFileEv @ 267 NONAME
+	_ZTI17CApaAppInfoReader @ 268 NONAME ; #<TI>#
+	_ZTI19CApaAppInfoReaderV1 @ 269 NONAME ABSENT ; #<TI>#
+	_ZTI19CApaAppInfoReaderV2 @ 270 NONAME ; #<TI>#
+	_ZTV17CApaAppInfoReader @ 271 NONAME ; #<VT>#
+	_ZTV19CApaAppInfoReaderV1 @ 272 NONAME ABSENT ; #<VT>#
+	_ZTV19CApaAppInfoReaderV2 @ 273 NONAME ; #<VT>#
+	_Z16StartupApaServerR14MApaAppStarter @ 274 NONAME
+	_Z23StartupApaServerProcessv @ 275 NONAME
+	_ZN13RApaLsSession17DeleteDataMappingERK9TDataType @ 276 NONAME
+	_ZN13RApaLsSession17InsertDataMappingERK9TDataTypel4TUid @ 277 NONAME
+	_ZN13RApaLsSession25InsertDataMappingIfHigherERK9TDataTypel4TUidRi @ 278 NONAME
+	_ZNK11CApaAppData19ApplicationLanguageEv @ 279 NONAME
+	_ZNK13RApaLsSession19ApplicationLanguageE4TUidR9TLanguage @ 280 NONAME
+	_ZN21CApaSystemControlList4NewLER3RFs @ 281 NONAME
+	_ZNK11CApaAppData17ImplementsServiceE4TUid @ 282 NONAME
+	_ZNK11CApaAppList17ServiceUidBufferLE4TUid @ 283 NONAME
+	_ZNK11CApaAppList19ServiceArrayBufferLE4TUid @ 284 NONAME
+	_ZNK11CApaAppList21PreferredDataHandlerLERK9TDataTypePK4TUidRi @ 285 NONAME
+	_ZNK11CApaAppList23ServiceImplArrayBufferLE4TUid @ 286 NONAME
+	_ZNK11CApaAppList24ServiceOpaqueDataBufferLE4TUidS0_ @ 287 NONAME
+	_ZNK13RApaLsSession13GetServerAppsE4TUid @ 288 NONAME
+	_ZNK13RApaLsSession13GetServerAppsE4TUidi @ 289 NONAME
+	_ZNK13RApaLsSession15GetAppServicesLE4TUidR13CArrayFixFlatIS0_E @ 290 NONAME
+	_ZNK13RApaLsSession16GetAppServicesLCE4TUid @ 291 NONAME
+	_ZNK13RApaLsSession24AppForDataTypeAndServiceERK9TDataType4TUidRS3_ @ 292 NONAME
+	_ZNK13RApaLsSession24AppForDocumentAndServiceERK5RFile4TUidRS3_R9TDataType @ 293 NONAME
+	_ZNK13RApaLsSession24AppForDocumentAndServiceERK7TDesC164TUidRS3_R9TDataType @ 294 NONAME
+	_ZNK13RApaLsSession25GetAppServiceOpaqueDataLCE4TUidS0_ @ 295 NONAME
+	_ZNK13RApaLsSession27GetServiceImplementationsLCE4TUid @ 296 NONAME
+	_ZNK18TApaAppServiceInfo10OpaqueDataEv @ 297 NONAME
+	_ZNK18TApaAppServiceInfo3UidEv @ 298 NONAME
+	_ZTI30CApaAppServiceInfoArrayWrapper @ 299 NONAME ; #<TI>#
+	_ZTV30CApaAppServiceInfoArrayWrapper @ 300 NONAME ; #<VT>#
+	_ZN13RApaLsSession13StartDocumentER5RFileR9TThreadIdP14TRequestStatus @ 301 NONAME
+	_ZN21CApaAppInfoFileReader27CreateMaskedBitmapByIndexLCEi @ 302 NONAME ABSENT
+	_ZNK13RApaLsSession36CancelListPopulationCompleteObserverEv @ 303 NONAME
+	_ZNK13RApaLsSession38RegisterListPopulationCompleteObserverER14TRequestStatus @ 304 NONAME
+	_ZN8ApaUtils24HandleAsRegistrationFileERK8TUidType @ 305 NONAME
+	_ZN13RApaLsSession33RegisterJavaMIDletViaIterimFormatERK7TDesC16R5RFile @ 306 NONAME ABSENT
+	_ZN22ForJavaMIDletInstaller33CheckInterimFormatFileNotCorruptLER5RFile @ 307 NONAME
+	_ZN13RApaLsSession20DeregisterJavaMIDletERK7TDesC16 @ 308 NONAME ABSENT
+	_ZN13RApaLsSession13SetFsSessionLER3RFs @ 309 NONAME
+	_ZN13RApaLsSession13StartDocumentER5RFile4TUidR9TThreadIdP14TRequestStatus @ 310 NONAME
+	_ZN13RApaLsSession13StartDocumentER5RFileRK9TDataTypeR9TThreadIdP14TRequestStatus @ 311 NONAME
+	_ZN13RApaLsSession14ClearFsSessionEv @ 312 NONAME
+	_ZN13RApaLsSession9FsSessionEv @ 313 NONAME
+	_ZNK13RApaLsSession13RecognizeDataERK5RFileR22TDataRecognitionResult @ 314 NONAME
+	_ZNK13RApaLsSession14AppForDocumentERK5RFileR4TUidR9TDataType @ 315 NONAME
+	_ZNK13RApaLsSession21RecognizeSpecificDataERK5RFileRK9TDataTypeRi @ 316 NONAME
+	_ZNK13RApaLsSession19GetPreferredBufSizeERi @ 317 NONAME
+	_ZN22ForJavaMIDletInstaller18GetJavaMIDletInfoLER3RFsRK7TDesC16RmS5_ @ 318 NONAME
+	_ZN22ForJavaMIDletInstaller28NewInterimFormatFileWriterLCER3RFsRK7TDesC164TUidmi @ 319 NONAME
+	_ZNK18TApaAppServiceInfo9DataTypesEv @ 320 NONAME
+	_ZNK11CApaAppList23ServiceImplArrayBufferLE4TUidRK9TDataType @ 321 NONAME
+	_ZNK13RApaLsSession27GetServiceImplementationsLCE4TUidRK9TDataType @ 322 NONAME
+	_ZN13RApaLsSession5CloseEv @ 323 NONAME
+	_ZTI22CApaLsSessionExtension @ 324 NONAME ; #<TI>#
+	_ZTV22CApaLsSessionExtension @ 325 NONAME ; #<VT>#
+	_ZN13RApaLsSession23RApaLsSession_Reserved1Ev @ 326 NONAME
+	_ZN13RApaLsSession23RApaLsSession_Reserved2Ev @ 327 NONAME
+	_ZN18TApaPictureFactoryC1Ev @ 328 NONAME
+	_ZN18TApaPictureFactoryC2Ev @ 329 NONAME
+	_ZN23MApaAppListServObserver33MApaAppListServObserver_Reserved1Ev @ 330 NONAME
+	_ZN23MApaAppListServObserver33MApaAppListServObserver_Reserved2Ev @ 331 NONAME
+	_ZN23MApaAppListServObserverC2Ev @ 332 NONAME
+	_ZTI13RApaLsSession @ 333 NONAME ; #<TI>#
+	_ZTI23MApaAppListServObserver @ 334 NONAME ; #<TI>#
+	_ZTV13RApaLsSession @ 335 NONAME ; #<VT>#
+	_ZTV23MApaAppListServObserver @ 336 NONAME ; #<VT>#
+	_ZNK13RApaLsSession15RecognizeFilesLERK7TDesC16R27CDataRecognitionResultArray @ 337 NONAME
+	_ZN13RApaLsSession15RecognizeFilesLERK7TDesC16R27CDataRecognitionResultArrayR14TRequestStatus @ 338 NONAME
+	_ZNK13RApaLsSession15RecognizeFilesLERK7TDesC16RK6TDesC8R27CDataRecognitionResultArray @ 339 NONAME
+	_ZN13RApaLsSession15RecognizeFilesLERK7TDesC16RK6TDesC8R27CDataRecognitionResultArrayR14TRequestStatus @ 340 NONAME
+	_ZN13RApaLsSession20CancelRecognizeFilesEv @ 341 NONAME
+	_ZN27CDataRecognitionResultArrayC1Ev @ 342 NONAME
+	_ZN27CDataRecognitionResultArrayC2Ev @ 343 NONAME
+	_ZN27CDataRecognitionResultArrayD0Ev @ 344 NONAME
+	_ZN27CDataRecognitionResultArrayD1Ev @ 345 NONAME
+	_ZN27CDataRecognitionResultArrayD2Ev @ 346 NONAME
+	_ZNK27CDataRecognitionResultArray12GetFileNameLER4TBufILi256EEj @ 347 NONAME
+	_ZNK27CDataRecognitionResultArray25GetDataRecognitionResultLER22TDataRecognitionResultj @ 348 NONAME
+	_ZNK27CDataRecognitionResultArray4PathEv @ 349 NONAME
+	_ZNK27CDataRecognitionResultArray5CountEv @ 350 NONAME
+	_ZTI21CAsyncFileRecognition @ 351 NONAME ; #<TI>#
+	_ZTI27CDataRecognitionResultArray @ 352 NONAME ; #<TI>#
+	_ZTI32CDataRecognitionResultArrayEntry @ 353 NONAME ; #<TI>#
+	_ZTV21CAsyncFileRecognition @ 354 NONAME ; #<VT>#
+	_ZTV27CDataRecognitionResultArray @ 355 NONAME ; #<VT>#
+	_ZTV32CDataRecognitionResultArrayEntry @ 356 NONAME ; #<VT>#
+	_ZNK13RApaLsSession16GetAppByDataTypeERK9TDataType4TUidRS3_ @ 357 NONAME
+	_ZN13RApaLsSession17DeleteDataMappingERK9TDataType4TUid @ 358 NONAME
+	_ZN13RApaLsSession17InsertDataMappingERK9TDataTypel4TUidS3_ @ 359 NONAME
+	_ZN13RApaLsSession29RegisterNonNativeApplicationLE4TUidRK10TDriveUnitR34CApaRegistrationResourceFileWriterP33CApaLocalisableResourceFileWriterPK5RFile @ 360 NONAME
+	_ZN13RApaLsSession31DeregisterNonNativeApplicationLE4TUid @ 361 NONAME
+	_ZN13RApaLsSession33RegisterNonNativeApplicationTypeLE4TUidRK7TDesC16 @ 362 NONAME
+	_ZN13RApaLsSession35DeregisterNonNativeApplicationTypeLE4TUid @ 363 NONAME
+	_ZN13RApaLsSession8StartAppERK15CApaCommandLineR9TThreadIdP14TRequestStatus @ 364 NONAME
+	_ZNK11CApaAppData10OpaqueDataEv @ 365 NONAME
+	_ZNK11CApaAppData20RegistrationFileNameEv @ 366 NONAME
+	_ZNK11CApaAppData27LocalisableResourceFileNameEv @ 367 NONAME
+	_ZNK11CApaAppList17AppDataByFileNameERK7TDesC16 @ 368 NONAME
+	_ZNK13RApaLsSession22GetDefaultScreenNumberERi4TUid @ 369 NONAME
+	_ZN11CApaAppList22FindAndAddSpecificAppLEP16CApaAppRegFinder4TUid @ 370 NONAME
+	_ZNK13RApaLsSession21MatchesSecurityPolicyERi4TUidRK15TSecurityPolicy @ 371 NONAME
+	_ZN33CApaLocalisableResourceFileWriterD1Ev @ 372 NONAME
+	_ZN33CApaLocalisableResourceFileWriterD2Ev @ 373 NONAME
+	_ZN34CApaRegistrationResourceFileWriter12AddDataTypeLEiRK6TDesC8 @ 374 NONAME
+	_ZN34CApaRegistrationResourceFileWriter13SetGroupNameLERK7TDesC16 @ 375 NONAME
+	_ZN34CApaRegistrationResourceFileWriter14SetOpaqueDataLERK6TDesC8 @ 376 NONAME
+	_ZN34CApaRegistrationResourceFileWriter15SetAppIsHiddenLEi @ 377 NONAME
+	_ZN34CApaRegistrationResourceFileWriter17SetEmbeddabilityLEN17TApaAppCapability14TEmbeddabilityE @ 378 NONAME
+	_ZN34CApaRegistrationResourceFileWriter19SetSupportsNewFileLEi @ 379 NONAME
+	_ZN34CApaRegistrationResourceFileWriter21AddFileOwnershipInfoLERK7TDesC16 @ 380 NONAME
+	_ZN34CApaRegistrationResourceFileWriter22SetLaunchInBackgroundLEi @ 381 NONAME
+	_ZN34CApaRegistrationResourceFileWriter23SetDefaultScreenNumberLEi @ 382 NONAME
+	_ZN34CApaRegistrationResourceFileWriter4NewLE4TUidRK7TDesC16j @ 383 NONAME
+	_ZN34CApaRegistrationResourceFileWriterD0Ev @ 384 NONAME
+	_ZN34CApaRegistrationResourceFileWriterD1Ev @ 385 NONAME
+	_ZN34CApaRegistrationResourceFileWriterD2Ev @ 386 NONAME
+	_ZNK11CApaAppData24NonNativeApplicationTypeEv @ 387 NONAME
+	_ZTI33CApaLocalisableResourceFileWriter @ 388 NONAME ; #<TI>#
+	_ZTI34CApaRegistrationResourceFileWriter @ 389 NONAME ; #<TI>#
+	_ZTIN26CApaResourceFileWriterBase11RBufferSinkE @ 390 NONAME ; #<TI>#
+	_ZTV33CApaLocalisableResourceFileWriter @ 391 NONAME ; #<VT>#
+	_ZTV34CApaRegistrationResourceFileWriter @ 392 NONAME ; #<VT>#
+	_ZTVN26CApaResourceFileWriterBase11RBufferSinkE @ 393 NONAME ; #<VT>#
+	_ZN33CApaLocalisableResourceFileWriter4NewLERK7TDesC16S2_iS2_ @ 394 NONAME
+	_ZN33CApaLocalisableResourceFileWriterD0Ev @ 395 NONAME
+	_ZN13RApaLsSession12CancelNotifyEv @ 396 NONAME
+	_ZN13RApaLsSession9SetNotifyEiR14TRequestStatus @ 397 NONAME
+	_ZNK11CApaAppList17AppScanInProgressEv @ 398 NONAME
+	_ZN13RApaLsSession25NotifyOnDataMappingChangeER14TRequestStatus @ 399 NONAME
+	_ZN13RApaLsSession31CancelNotifyOnDataMappingChangeEv @ 400 NONAME
+	_ZNK13RApaLsSession10GetAppTypeER4TUidS0_ @ 401 NONAME
+	_ZN13RApaLsSession35CommitNonNativeApplicationsUpdatesLEv @ 402 NONAME
+	_ZN13RApaLsSession36PrepareNonNativeApplicationsUpdatesLEv @ 403 NONAME
+	_ZN13RApaLsSession36RollbackNonNativeApplicationsUpdatesEv @ 404 NONAME
+	_ZN11CApaAppList15UpdatedAppsListEv @ 405 NONAME ABSENT
+	_ZN11CApaAppList18SetUpdatedAppsListEP16CUpdatedAppsList @ 406 NONAME ABSENT
+	_ZN11CApaAppData4NewLERK12TApaAppEntryR3RFs @ 407 NONAME
+	_ZN11CApaAppDataD0Ev @ 408 NONAME
+	_ZN11CApaAppDataD1Ev @ 409 NONAME
+	_ZN11CApaAppDataD2Ev @ 410 NONAME
+	_ZN11CApaAppList24ShareProtectedFileServerEv @ 411 NONAME ABSENT
+	_ZN11CApaAppList4SelfEv @ 412 NONAME
+	X @ 413 NONAME ABSENT
+	X @ 414 NONAME ABSENT
+	X @ 415 NONAME ABSENT
+	X @ 416 NONAME ABSENT
+	_ZN13RApaLsSession18SetAppShortCaptionERK7TDesC169TLanguage4TUid @ 417 NONAME
+	_ZN11CApaAppData16SetShortCaptionLERK7TDesC16 @ 418 NONAME
+	_ZN11CApaAppList14CompareStringsERK7HBufC16S2_ @ 419 NONAME
+	_ZN11CApaAppList22AddForcedRegistrationLEP7HBufC16 @ 420 NONAME
+	_ZN13RApaLsSession17ForceRegistrationERK13RPointerArrayI7TDesC16E @ 421 NONAME
+	_ZN11CApaAppList24ResetForcedRegistrationsEv @ 422 NONAME
+	_ZN11CApaAppList12RestartScanLEv @ 423 NONAME
+	_ZN11CApaAppList8StopScanEi @ 424 NONAME
+	KMinApplicationStackSize @ 425 NONAME DATA 4
+	_Z23MinApplicationStackSizev @ 426 NONAME
+	_ZNK11CApaAppData9IsPendingEv @ 427 NONAME
+	_ZNK11CApaAppList23IsLanguageChangePendingEv @ 428 NONAME
+	_ZNK13RApaLsSession10GetAppIconE4TUidR5RFile @ 429 NONAME
+	_ZN17CApaSecurityUtils16CheckAppSecurityERK7TPtrC16RiS3_ @ 430 NONAME
+	_ZN11CApaAppData11SetCaptionLERK7TDesC16 @ 431 NONAME
+	_ZN11CApaAppData9SetIconsLERK7TDesC16i @ 432 NONAME
+	_ZN13RApaLsSession40ForceCommitNonNativeApplicationsUpdatesLEv @ 433 NONAME
+	_ZN11CApaAppList20AppListUpdatePendingEv @ 434 NONAME
+	_ZN11CApaAppList19UninstalledAppArrayEv @ 435 NONAME
+	
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/eabi/APPARCTESTSERVERU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,2 @@
+EXPORTS
+	NewServer__Fv @ 1 NONAME R3UNUSED ; NewServer(void)
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/eabi/APPARCU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,259 @@
+EXPORTS
+	_ZN11CApaProcess10ConstructLEv @ 1 NONAME
+	_ZN11CApaProcess15AddNewDocumentLERK7TDesC164TUid @ 2 NONAME
+	_ZN11CApaProcess15DestroyDocumentEP12CApaDocument @ 3 NONAME
+	_ZN11CApaProcess15SetMainDocumentEP12CApaDocument @ 4 NONAME
+	_ZN11CApaProcess16OpenNewDocumentLERP10CFileStoreRP17CStreamDictionaryRK7TDesC16j @ 5 NONAME
+	_ZN11CApaProcess16ReadRootStreamLCER3RFsRP10CFileStoreRK7TDesC16j @ 6 NONAME
+	_ZN11CApaProcess16WriteRootStreamLER16CPersistentStoreR17CStreamDictionaryRK15CApaApplication @ 7 NONAME
+	_ZN11CApaProcess16WriteRootStreamLER16CPersistentStoreR17CStreamDictionaryRK17TApaAppIdentifier @ 8 NONAME
+	_ZN11CApaProcess18ReadAppIdentifierLERK12CStreamStoreRK17CStreamDictionary @ 9 NONAME
+	_ZN11CApaProcess18SetMainDocFileNameERK7TDesC16 @ 10 NONAME
+	_ZN11CApaProcess19WriteAppIdentifierLER12CStreamStoreR17CStreamDictionaryRK17TApaAppIdentifier @ 11 NONAME
+	_ZN11CApaProcess4NewLERK3RFsR13CApaAppFinder @ 12 NONAME
+	_ZN11CApaProcess6ResetLEv @ 13 NONAME
+	_ZN11CApaProcessC1ERK3RFsR13CApaAppFinder @ 14 NONAME
+	_ZN11CApaProcessC2ERK3RFsR13CApaAppFinder @ 15 NONAME
+	_ZN11CApaProcessD0Ev @ 16 NONAME
+	_ZN11CApaProcessD1Ev @ 17 NONAME
+	_ZN11CApaProcessD2Ev @ 18 NONAME
+	_ZN11TApaAppInfo12InternalizeLER11RReadStream @ 19 NONAME
+	_ZN11TApaAppInfoC1E4TUidRK4TBufILi256EES4_ @ 20 NONAME
+	_ZN11TApaAppInfoC1E4TUidRK4TBufILi256EES4_S4_ @ 21 NONAME
+	_ZN11TApaAppInfoC1Ev @ 22 NONAME
+	_ZN11TApaAppInfoC2E4TUidRK4TBufILi256EES4_ @ 23 NONAME
+	_ZN11TApaAppInfoC2E4TUidRK4TBufILi256EES4_S4_ @ 24 NONAME
+	_ZN11TApaAppInfoC2Ev @ 25 NONAME
+	_ZN12CApaDocument9OpenFileLERP10CFileStoreR5RFile @ 26 NONAME
+	_ZN12CApaDocument10Reserved_2Ev @ 27 NONAME
+	_ZN12CApaDocument11TCapabilityC1Ev @ 28 NONAME
+	_ZN12CApaDocument11TCapabilityC2Ev @ 29 NONAME
+	_ZN12CApaDocument13GlassPictureLEv @ 30 NONAME
+	_ZN11CApaProcess19SetMainDocFileNameLERK7TDesC16 @ 31 NONAME
+	_ZN12CApaDocumentC2ER15CApaApplicationR11CApaProcess @ 32 NONAME
+	_ZN12CApaDocumentD0Ev @ 33 NONAME
+	_ZN12CApaDocumentD1Ev @ 34 NONAME
+	_ZN12CApaDocumentD2Ev @ 35 NONAME
+	_ZN12CApaDoorBase22InternalizeBaseStreamLERK12CStreamStoreRK17CStreamDictionary @ 36 NONAME
+	_ZN12TApaAppEntry12InternalizeLER11RReadStream @ 37 NONAME
+	_ZN12TApaAppEntryC1ERK8TUidTypeRK4TBufILi256EE @ 38 NONAME
+	_ZN12TApaAppEntryC1Ev @ 39 NONAME
+	_ZN12TApaAppEntryC2ERK8TUidTypeRK4TBufILi256EE @ 40 NONAME
+	_ZN12TApaAppEntryC2Ev @ 41 NONAME
+	_ZN13CApaModelDoor14SetScaleFactorEii @ 42 NONAME
+	_ZN13CApaModelDoor16DetachFromStoreLEN8CPicture7TDetachE @ 43 NONAME
+	_ZN13CApaModelDoor4NewLEP15CApaModelHeader @ 44 NONAME
+	_ZN13CApaModelDoor4NewLERK12CStreamStore9TStreamIdPK22MApaModelHeaderFactory @ 45 NONAME
+	_ZN13CApaModelDoor5NewLCEP15CApaModelHeader @ 46 NONAME
+	_ZN13CApaModelDoor8RestoreLERK12CStreamStore9TStreamIdPK22MApaModelHeaderFactory @ 47 NONAME
+	_ZN13CApaModelDoorD0Ev @ 48 NONAME
+	_ZN13CApaModelDoorD1Ev @ 49 NONAME
+	_ZN13CApaModelDoorD2Ev @ 50 NONAME
+	_ZN14CApaRecentFile14GetRecentFileLER3RFs4TUidi @ 51 NONAME ABSENT
+	_ZN14CApaRecentFile17AddLastUsedEntryLER3RFsRK7TDesC164TUid @ 52 NONAME ABSENT
+	_ZN14CApaRecentFile18GetRecentFileListLER3RFs4TUid @ 53 NONAME ABSENT
+	_ZN15CApaApplication13NewAppServerLERP13CApaAppServer @ 54 NONAME
+	_ZN15CApaApplication16GenerateFileNameER3RFsR4TBufILi256EE @ 55 NONAME
+	_ZN15CApaCommandLine11SetCommandLE11TApaCommand @ 56 NONAME
+	_ZN15CApaCommandLine11SetTailEndLERK6TDesC8 @ 57 NONAME
+	_ZN15CApaCommandLine15SetLibraryNameLERK7TDesC16 @ 58 NONAME
+	_ZN15CApaCommandLine16SetDocumentNameLERK7TDesC16 @ 59 NONAME
+	_ZN15CApaCommandLine17SetReserveLengthLEi @ 60 NONAME
+	_ZN15CApaCommandLine18SetFullCommandLineEP7HBufC16 @ 61 NONAME
+	_ZN15CApaCommandLine19SetFullCommandLineLERK7TDesC16 @ 62 NONAME
+	_ZN15CApaCommandLine3NewEP7HBufC16 @ 63 NONAME
+	_ZN15CApaCommandLine4NewLERK7TDesC16 @ 64 NONAME
+	_ZN15CApaCommandLine4NewLEv @ 65 NONAME
+	_ZN15CApaCommandLine5NewLCERK7TDesC16 @ 66 NONAME
+	_ZN15CApaCommandLine5NewLCEv @ 67 NONAME
+	_ZN15CApaCommandLineD0Ev @ 68 NONAME
+	_ZN15CApaCommandLineD1Ev @ 69 NONAME
+	_ZN15CApaCommandLineD2Ev @ 70 NONAME
+	_ZN15CApaModelHeader10Reserved_1Ev @ 71 NONAME
+	_ZN15TApaAppInfo_7_012InternalizeLER11RReadStream @ 72 NONAME ABSENT
+	_ZN15TApaAppInfo_7_0C1E4TUidRK4TBufILi256EES4_ @ 73 NONAME ABSENT
+	_ZN15TApaAppInfo_7_0C1Ev @ 74 NONAME ABSENT
+	_ZN15TApaAppInfo_7_0C2E4TUidRK4TBufILi256EES4_ @ 75 NONAME ABSENT
+	_ZN15TApaAppInfo_7_0C2Ev @ 76 NONAME ABSENT
+	_ZN15TApaAppViewInfo12InternalizeLER11RReadStream @ 77 NONAME
+	_ZN15TApaAppViewInfoC1E4TUidRK4TBufILi256EEi @ 78 NONAME
+	_ZN15TApaAppViewInfoC1Ev @ 79 NONAME
+	_ZN15TApaAppViewInfoC2E4TUidRK4TBufILi256EEi @ 80 NONAME
+	_ZN15TApaAppViewInfoC2Ev @ 81 NONAME
+	_ZN17TApaAppCapability12InternalizeLER11RReadStream @ 82 NONAME
+	_ZN17TApaAppCapability14CopyCapabilityER5TDes8RK6TDesC8 @ 83 NONAME
+	_ZN17TApaAppCapability15Internalize7_0LER11RReadStream @ 84 NONAME
+	_ZN17TApaAppIdentifier12InternalizeLER11RReadStream @ 85 NONAME
+	_ZN17TApaAppIdentifierC1E4TUidRK4TBufILi256EE @ 86 NONAME
+	_ZN17TApaAppIdentifierC1Ev @ 87 NONAME
+	_ZN17TApaAppIdentifierC2E4TUidRK4TBufILi256EE @ 88 NONAME
+	_ZN17TApaAppIdentifierC2Ev @ 89 NONAME
+	_ZN17TApaLastUsedEntry12InternalizeLER11RReadStream @ 90 NONAME ABSENT
+	_ZN17TApaLastUsedEntryC1E4TBufILi256EE4TUid @ 91 NONAME ABSENT
+	_ZN17TApaLastUsedEntryC1Ev @ 92 NONAME ABSENT
+	_ZN17TApaLastUsedEntryC2E4TBufILi256EE4TUid @ 93 NONAME ABSENT
+	_ZN17TApaLastUsedEntryC2Ev @ 94 NONAME ABSENT
+	_ZN18CApaFileRecognizer13SetAppLocatorEP14CApaAppLocator @ 95 NONAME
+	_ZN18CApaFileRecognizer14RecognizeFileLERK7TDesC16PK8TUidType @ 96 NONAME
+	_ZN18CApaFileRecognizer21AddFileRecognizerTypeEP22CApaFileRecognizerType @ 97 NONAME
+	_ZN18CApaFileRecognizer21DestroyRecognizerListEv @ 98 NONAME
+	_ZN18CApaFileRecognizer24RemoveFileRecognizerTypeEPK22CApaFileRecognizerType @ 99 NONAME
+	_ZN18CApaFileRecognizerC1ER3RFs @ 100 NONAME
+	_ZN18CApaFileRecognizerC2ER3RFs @ 101 NONAME
+	_ZN18CApaFileRecognizerD0Ev @ 102 NONAME
+	_ZN18CApaFileRecognizerD1Ev @ 103 NONAME
+	_ZN18CApaFileRecognizerD2Ev @ 104 NONAME
+	_ZN18TApaDocCleanupItem9DoCleanupEPv @ 105 NONAME
+	_ZN20TApaModelDoorFactoryC1EPK22MApaModelHeaderFactory @ 106 NONAME
+	_ZN20TApaModelDoorFactoryC2EPK22MApaModelHeaderFactory @ 107 NONAME
+	_ZN22CApaFileRecognizerType10Reserved_1Ev @ 108 NONAME
+	_ZN22CApaFileRecognizerType4LockEv @ 109 NONAME
+	_ZN22CApaFileRecognizerType6UnlockEv @ 110 NONAME
+	_ZTV22CApaFileRecognizerType @ 111 NONAME ; #<VT>#
+	_ZN22CApaFileRecognizerTypeC2Ev @ 112 NONAME
+	_ZN22CApaFileRecognizerTypeD0Ev @ 113 NONAME
+	_ZN22CApaFileRecognizerTypeD1Ev @ 114 NONAME
+	_ZN22CApaFileRecognizerTypeD2Ev @ 115 NONAME
+	_ZN23TApaEmbeddabilityFilter16AddEmbeddabilityEN17TApaAppCapability14TEmbeddabilityE @ 116 NONAME
+	_ZN23TApaEmbeddabilityFilterC1Ev @ 117 NONAME
+	_ZN23TApaEmbeddabilityFilterC2Ev @ 118 NONAME
+	_ZNK11CApaProcess15MainDocFileNameEv @ 119 NONAME
+	_ZNK11TApaAppInfo12ExternalizeLER12RWriteStream @ 120 NONAME
+	_ZNK12CApaDocument10CapabilityEv @ 121 NONAME
+	_ZNK12CApaDocument12ExternalizeLER12RWriteStream @ 122 NONAME
+	_ZNK12CApaDocument17ValidatePasswordLEv @ 123 NONAME
+	_ZNK12CApaDoorBase22ExternalizeBaseStreamLER12CStreamStoreR17CStreamDictionary @ 124 NONAME
+	_ZNK12TApaAppEntry12ExternalizeLER12RWriteStream @ 125 NONAME
+	_ZNK13CApaModelDoor12ExternalizeLER12RWriteStream @ 126 NONAME
+	_ZNK13CApaModelDoor16ScaleFactorWidthEv @ 127 NONAME
+	_ZNK13CApaModelDoor17ScaleFactorHeightEv @ 128 NONAME
+	_ZNK13CApaModelDoor22GetOriginalSizeInTwipsER5TSize @ 129 NONAME
+	_ZNK13CApaModelDoor4DrawER16CGraphicsContextRK6TPointRK5TRectP18MGraphicsDeviceMap @ 130 NONAME
+	_ZNK13CApaModelDoor6StoreLER12CStreamStore @ 131 NONAME
+	_ZNK15CApaApplication11AppFullNameEv @ 132 NONAME
+	_ZNK15CApaApplication12OpenIniFileLER3RFs @ 133 NONAME
+	_ZNK15CApaApplication16OpenAppInfoFileLEv @ 134 NONAME
+	_ZNK15CApaApplication7DllNameEv @ 135 NONAME
+	_ZNK15CApaCommandLine11LibraryNameEv @ 136 NONAME
+	_ZNK15CApaCommandLine12DocumentNameEv @ 137 NONAME
+	_ZNK15CApaCommandLine15FullCommandLineEv @ 138 NONAME
+	_ZNK15CApaCommandLine7CommandEv @ 139 NONAME
+	_ZNK15CApaCommandLine7TailEndEv @ 140 NONAME
+	_ZNK15TApaAppInfo_7_012ExternalizeLER12RWriteStream @ 141 NONAME ABSENT
+	_ZNK15TApaAppViewInfo12ExternalizeLER12RWriteStream @ 142 NONAME
+	_ZNK17TApaAppCapability12ExternalizeLER12RWriteStream @ 143 NONAME
+	_ZNK17TApaAppCapability15Externalize7_0LER12RWriteStream @ 144 NONAME
+	_ZNK17TApaAppIdentifier12ExternalizeLER12RWriteStream @ 145 NONAME
+	_ZNK17TApaLastUsedEntry12ExternalizeLER12RWriteStream @ 146 NONAME ABSENT
+	_ZNK18CApaFileRecognizer10AppLocatorEv @ 147 NONAME
+	_ZNK20TApaModelDoorFactory11NewPictureLER14TPictureHeaderRK12CStreamStore @ 148 NONAME
+	_ZNK22CApaFileRecognizerType10CapabilityER5TDes8 @ 149 NONAME
+	_ZNK22CApaFileRecognizerType7AppRunLERK15CApaCommandLine @ 150 NONAME
+	_ZNK23TApaEmbeddabilityFilter20MatchesEmbeddabilityEN17TApaAppCapability14TEmbeddabilityE @ 151 NONAME
+	_ZTI11CApaProcess @ 152 NONAME ; #<TI>#
+	_ZTI12CApaDocument @ 153 NONAME ; #<TI>#
+	_ZTI15CApaApplication @ 154 NONAME ; #<TI>#
+	_ZTI15CApaModelHeader @ 155 NONAME ; #<TI>#
+	_ZTI18CApaFileRecognizer @ 156 NONAME ; #<TI>#
+	_ZTI20TApaModelDoorFactory @ 157 NONAME ; #<TI>#
+	_ZTI22CApaFileRecognizerType @ 158 NONAME ; #<TI>#
+	_ZTV11CApaProcess @ 159 NONAME ; #<VT>#
+	_ZTV12CApaDocument @ 160 NONAME ; #<VT>#
+	_ZTV15CApaApplication @ 161 NONAME ; #<VT>#
+	_ZTV15CApaModelHeader @ 162 NONAME ; #<VT>#
+	_ZTV18CApaFileRecognizer @ 163 NONAME ; #<VT>#
+	_ZTV20TApaModelDoorFactory @ 164 NONAME ; #<VT>#
+	_ZN22CApaFileRecognizerType21CreateFileRecognizerLE4TUid @ 165 NONAME
+	_ZN11CApaProcess15AddNewDocumentLE22TApaApplicationFactory @ 166 NONAME
+	_ZN15CApaApplicationD0Ev @ 167 NONAME
+	_ZN15CApaApplicationD1Ev @ 168 NONAME
+	_ZN15CApaApplicationD2Ev @ 169 NONAME
+	_ZN22TApaApplicationFactoryC1E4TUid @ 170 NONAME
+	_ZN22TApaApplicationFactoryC1EPFP15CApaApplicationvE @ 171 NONAME
+	_ZN22TApaApplicationFactoryC1ERK26CImplementationInformation @ 172 NONAME
+	_ZN22TApaApplicationFactoryC2E4TUid @ 173 NONAME
+	_ZN22TApaApplicationFactoryC2EPFP15CApaApplicationvE @ 174 NONAME
+	_ZN22TApaApplicationFactoryC2ERK26CImplementationInformation @ 175 NONAME
+	_ZTI13CApaAppHolder @ 176 NONAME ; #<TI>#
+	_ZTI13CApaModelDoor @ 177 NONAME ; #<TI>#
+	_ZTI15CApaCommandLine @ 178 NONAME ; #<TI>#
+	_ZTI24CFileRecognizerExtension @ 179 NONAME ; #<TI>#
+	_ZTI7CApaDll @ 180 NONAME ; #<TI>#
+	_ZTI7CApaExe @ 181 NONAME ; #<TI>#
+	_ZTI7HBufBuf @ 182 NONAME ; #<TI>#
+	_ZTV13CApaAppHolder @ 183 NONAME ; #<VT>#
+	_ZTV13CApaModelDoor @ 184 NONAME ; #<VT>#
+	_ZTV15CApaCommandLine @ 185 NONAME ; #<VT>#
+	_ZTV24CFileRecognizerExtension @ 186 NONAME ; #<VT>#
+	_ZTV7CApaDll @ 187 NONAME ; #<VT>#
+	_ZTV7CApaExe @ 188 NONAME ; #<VT>#
+	_ZTV7HBufBuf @ 189 NONAME ; #<VT>#
+	_ZN13CApaAppServer10ConstructLERK7TDesC16 @ 190 NONAME
+	_ZN13CApaAppServer16NotifyServerExitEi @ 191 NONAME
+	_ZN13CApaAppServer20CustomSecurityCheckLERK9RMessage2RiR13TSecurityInfo @ 192 NONAME
+	_ZN13CApaAppServer27CreateServiceSecurityCheckLE4TUidRK9RMessage2RiR13TSecurityInfo @ 193 NONAME
+	_ZN13CApaAppServerC1Ev @ 194 NONAME
+	_ZN13CApaAppServerC2Ev @ 195 NONAME
+	_ZN13CApaAppServerD0Ev @ 196 NONAME
+	_ZN13CApaAppServerD1Ev @ 197 NONAME
+	_ZN13CApaAppServerD2Ev @ 198 NONAME
+	_ZN15CApaCommandLine18SetServerRequiredLEj @ 199 NONAME
+	_ZN15CApaCommandLine21SetServerNotRequiredLEv @ 200 NONAME
+	_ZN18CApaAppServiceBase12ServiceErrorERK9RMessage2i @ 201 NONAME
+	_ZN18CApaAppServiceBase14SecurityCheckLERK9RMessage2RiR13TSecurityInfo @ 202 NONAME
+	_ZN18CApaAppServiceBase7CreateLEv @ 203 NONAME
+	_ZN18CApaAppServiceBase8ServiceLERK9RMessage2 @ 204 NONAME
+	_ZN18CApaAppServiceBaseC1Ev @ 205 NONAME
+	_ZN18CApaAppServiceBaseC2Ev @ 206 NONAME
+	_ZN18CApaAppServiceBaseD0Ev @ 207 NONAME
+	_ZN18CApaAppServiceBaseD1Ev @ 208 NONAME
+	_ZN18CApaAppServiceBaseD2Ev @ 209 NONAME
+	_ZN18RApaAppServiceBase10ServerNameEv @ 210 NONAME
+	_ZN18RApaAppServiceBase16NotifyServerExitER14TRequestStatus @ 211 NONAME
+	_ZN18RApaAppServiceBase19ConnectExistingAppLERKS_ @ 212 NONAME
+	_ZN18RApaAppServiceBase22CancelNotifyServerExitEv @ 213 NONAME
+	_ZN18RApaAppServiceBase22ConnectExistingByNameLERK7TDesC16 @ 214 NONAME
+	_ZN18RApaAppServiceBase5CloseEv @ 215 NONAME
+	_ZN18RApaAppServiceBaseC2Ev @ 216 NONAME
+	_ZN24CApaServerAppExitMonitor4NewLER18RApaAppServiceBaseR25MApaServerAppExitObserveri @ 217 NONAME
+	_ZN24CApaServerAppExitMonitor5NewLCER18RApaAppServiceBaseR25MApaServerAppExitObserveri @ 218 NONAME
+	_ZN24CApaServerAppExitMonitorD0Ev @ 219 NONAME
+	_ZN24CApaServerAppExitMonitorD1Ev @ 220 NONAME
+	_ZN24CApaServerAppExitMonitorD2Ev @ 221 NONAME
+	_ZNK13CApaAppServer11NewSessionLERK8TVersionRK9RMessage2 @ 222 NONAME
+	_ZNK13CApaAppServer14CreateServiceLE4TUid @ 223 NONAME
+	_ZNK15CApaCommandLine14ServerRequiredEv @ 224 NONAME
+	_ZTI13CApaAppServer @ 225 NONAME ; #<TI>#
+	_ZTI18CApaAppServiceBase @ 226 NONAME ; #<TI>#
+	_ZTI24CApaServerAppExitMonitor @ 227 NONAME ; #<TI>#
+	_ZTV13CApaAppServer @ 228 NONAME ; #<VT>#
+	_ZTV18CApaAppServiceBase @ 229 NONAME ; #<VT>#
+	_ZTV24CApaServerAppExitMonitor @ 230 NONAME ; #<VT>#
+	_ZN13CApaAppServer18ExtensionInterfaceE4TUidRPv @ 231 NONAME
+	_ZN18CApaAppServiceBase18ExtensionInterfaceE4TUidRPv @ 232 NONAME
+	_ZN18RApaAppServiceBase18ExtensionInterfaceE4TUidRPv @ 233 NONAME
+	_ZTI18RApaAppServiceBase @ 234 NONAME ; #<TI>#
+	_ZTV18RApaAppServiceBase @ 235 NONAME ; #<VT>#
+	_ZN15CApaCommandLine27EnvironmentSlotForPublicUseEi @ 236 NONAME
+	_ZN15CApaCommandLine16SetFileByHandleLERK5RFile @ 237 NONAME
+	_ZNK15CApaCommandLine16GetFileByHandleLER5RFile @ 238 NONAME
+	_ZN15CApaCommandLine18SetExecutableNameLERK7TDesC16 @ 239 NONAME
+	_ZN11CApaProcessC1ERK3RFs @ 240 NONAME
+	_ZN11CApaProcessC2ERK3RFs @ 241 NONAME
+	_ZN15CApaCommandLine28ConstructCmdLineFromMessageLERK9RMessage2 @ 242 NONAME
+	_ZN15CApaCommandLine36GetCommandLineFromProcessEnvironmentERPS_ @ 243 NONAME
+	_ZNK15CApaCommandLine12GetIpcArgsLCER8TIpcArgs @ 244 NONAME
+	Apparc_Dummy1 @ 245 NONAME
+	_ZNK15CApaCommandLine14ExecutableNameEv @ 246 NONAME
+	Apparc_Dummy2 @ 247 NONAME
+	_ZNK15CApaCommandLine22SetProcessEnvironmentLER8RProcess @ 248 NONAME
+	_ZN11CApaProcess4NewLERK3RFs @ 249 NONAME
+	_ZN15CApaCommandLine17SetDefaultScreenLEi @ 250 NONAME
+	_ZNK15CApaCommandLine13DefaultScreenEv @ 251 NONAME
+	_ZN15CApaCommandLine22SetParentWindowGroupIDEi @ 252 NONAME
+	_ZNK15CApaCommandLine19ParentWindowGroupIDEv @ 253 NONAME
+	_ZNK15CApaCommandLine12DebugMemFailEv @ 254 NONAME
+	_ZN15CApaCommandLine40SetAppStartupInstrumentationEventIdBaseLEi @ 255 NONAME
+	_ZNK15CApaCommandLine36AppStartupInstrumentationEventIdBaseEv @ 256 NONAME
+	_ZN11CApaProcess16ReadRootStreamLCERP10CFileStoreRK5RFile @ 257 NONAME
+	_ZN15CApaCommandLine16SetDebugMemFailLEi @ 258 NONAME
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/eabi/APPARC_9_REMOVE_UI_FRAMEWORKS_V1U.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,336 @@
+EXPORTS
+	_ZN11CApaProcess10ConstructLEv @ 1 NONAME
+	_ZN11CApaProcess15AddNewDocumentLERK7TDesC164TUid @ 2 NONAME ABSENT
+	_ZN11CApaProcess15DestroyDocumentEP12CApaDocument @ 3 NONAME
+	_ZN11CApaProcess15SetMainDocumentEP12CApaDocument @ 4 NONAME
+	_ZN11CApaProcess16OpenNewDocumentLERP10CFileStoreRP17CStreamDictionaryRK7TDesC16j @ 5 NONAME
+	_ZN11CApaProcess16ReadRootStreamLCER3RFsRP10CFileStoreRK7TDesC16j @ 6 NONAME
+	_ZN11CApaProcess16WriteRootStreamLER16CPersistentStoreR17CStreamDictionaryRK15CApaApplication @ 7 NONAME
+	_ZN11CApaProcess16WriteRootStreamLER16CPersistentStoreR17CStreamDictionaryRK17TApaAppIdentifier @ 8 NONAME
+	_ZN11CApaProcess18ReadAppIdentifierLERK12CStreamStoreRK17CStreamDictionary @ 9 NONAME
+	_ZN11CApaProcess18SetMainDocFileNameERK7TDesC16 @ 10 NONAME
+	_ZN11CApaProcess19WriteAppIdentifierLER12CStreamStoreR17CStreamDictionaryRK17TApaAppIdentifier @ 11 NONAME
+	_ZN11CApaProcess4NewLERK3RFsR13CApaAppFinder @ 12 NONAME ABSENT
+	_ZN11CApaProcess6ResetLEv @ 13 NONAME
+	_ZN11CApaProcessC1ERK3RFsR13CApaAppFinder @ 14 NONAME ABSENT
+	_ZN11CApaProcessC2ERK3RFsR13CApaAppFinder @ 15 NONAME ABSENT
+	_ZN11CApaProcessD0Ev @ 16 NONAME
+	_ZN11CApaProcessD1Ev @ 17 NONAME
+	_ZN11CApaProcessD2Ev @ 18 NONAME
+	_ZN11TApaAppInfo12InternalizeLER11RReadStream @ 19 NONAME
+	_ZN11TApaAppInfoC1E4TUidRK4TBufILi256EES4_ @ 20 NONAME
+	_ZN11TApaAppInfoC1E4TUidRK4TBufILi256EES4_S4_ @ 21 NONAME
+	_ZN11TApaAppInfoC1Ev @ 22 NONAME
+	_ZN11TApaAppInfoC2E4TUidRK4TBufILi256EES4_ @ 23 NONAME
+	_ZN11TApaAppInfoC2E4TUidRK4TBufILi256EES4_S4_ @ 24 NONAME
+	_ZN11TApaAppInfoC2Ev @ 25 NONAME
+	_ZN12CApaDocument9OpenFileLERP10CFileStoreR5RFile @ 26 NONAME
+	_ZN12CApaDocument10Reserved_2Ev @ 27 NONAME
+	_ZN12CApaDocument11TCapabilityC1Ev @ 28 NONAME
+	_ZN12CApaDocument11TCapabilityC2Ev @ 29 NONAME
+	_ZN12CApaDocument13GlassPictureLEv @ 30 NONAME
+	_ZN11CApaProcess19SetMainDocFileNameLERK7TDesC16 @ 31 NONAME
+	_ZN12CApaDocumentC2ER15CApaApplicationR11CApaProcess @ 32 NONAME
+	_ZN12CApaDocumentD0Ev @ 33 NONAME
+	_ZN12CApaDocumentD1Ev @ 34 NONAME
+	_ZN12CApaDocumentD2Ev @ 35 NONAME
+	_ZN12CApaDoorBase22InternalizeBaseStreamLERK12CStreamStoreRK17CStreamDictionary @ 36 NONAME
+	_ZN12TApaAppEntry12InternalizeLER11RReadStream @ 37 NONAME
+	_ZN12TApaAppEntryC1ERK8TUidTypeRK4TBufILi256EE @ 38 NONAME
+	_ZN12TApaAppEntryC1Ev @ 39 NONAME
+	_ZN12TApaAppEntryC2ERK8TUidTypeRK4TBufILi256EE @ 40 NONAME
+	_ZN12TApaAppEntryC2Ev @ 41 NONAME
+	_ZN13CApaModelDoor14SetScaleFactorEii @ 42 NONAME
+	_ZN13CApaModelDoor16DetachFromStoreLEN8CPicture7TDetachE @ 43 NONAME
+	_ZN13CApaModelDoor4NewLEP15CApaModelHeader @ 44 NONAME
+	_ZN13CApaModelDoor4NewLERK12CStreamStore9TStreamIdPK22MApaModelHeaderFactory @ 45 NONAME
+	_ZN13CApaModelDoor5NewLCEP15CApaModelHeader @ 46 NONAME
+	_ZN13CApaModelDoor8RestoreLERK12CStreamStore9TStreamIdPK22MApaModelHeaderFactory @ 47 NONAME
+	_ZN13CApaModelDoorD0Ev @ 48 NONAME
+	_ZN13CApaModelDoorD1Ev @ 49 NONAME
+	_ZN13CApaModelDoorD2Ev @ 50 NONAME
+	_ZN14CApaRecentFile14GetRecentFileLER3RFs4TUidi @ 51 NONAME ABSENT
+	_ZN14CApaRecentFile17AddLastUsedEntryLER3RFsRK7TDesC164TUid @ 52 NONAME ABSENT
+	_ZN14CApaRecentFile18GetRecentFileListLER3RFs4TUid @ 53 NONAME ABSENT
+	_ZN15CApaApplication13NewAppServerLERP13CApaAppServer @ 54 NONAME
+	_ZN15CApaApplication16GenerateFileNameER3RFsR4TBufILi256EE @ 55 NONAME
+	_ZN15CApaCommandLine11SetCommandLE11TApaCommand @ 56 NONAME
+	_ZN15CApaCommandLine11SetTailEndLERK6TDesC8 @ 57 NONAME
+	_ZN15CApaCommandLine15SetLibraryNameLERK7TDesC16 @ 58 NONAME ABSENT
+	_ZN15CApaCommandLine16SetDocumentNameLERK7TDesC16 @ 59 NONAME
+	_ZN15CApaCommandLine17SetReserveLengthLEi @ 60 NONAME ABSENT
+	_ZN15CApaCommandLine18SetFullCommandLineEP7HBufC16 @ 61 NONAME ABSENT
+	_ZN15CApaCommandLine19SetFullCommandLineLERK7TDesC16 @ 62 NONAME ABSENT
+	_ZN15CApaCommandLine3NewEP7HBufC16 @ 63 NONAME ABSENT
+	_ZN15CApaCommandLine4NewLERK7TDesC16 @ 64 NONAME ABSENT
+	_ZN15CApaCommandLine4NewLEv @ 65 NONAME
+	_ZN15CApaCommandLine5NewLCERK7TDesC16 @ 66 NONAME ABSENT
+	_ZN15CApaCommandLine5NewLCEv @ 67 NONAME
+	_ZN15CApaCommandLineD0Ev @ 68 NONAME
+	_ZN15CApaCommandLineD1Ev @ 69 NONAME
+	_ZN15CApaCommandLineD2Ev @ 70 NONAME
+	_ZN15CApaModelHeader10Reserved_1Ev @ 71 NONAME
+	_ZN15TApaAppInfo_7_012InternalizeLER11RReadStream @ 72 NONAME ABSENT
+	_ZN15TApaAppInfo_7_0C1E4TUidRK4TBufILi256EES4_ @ 73 NONAME ABSENT
+	_ZN15TApaAppInfo_7_0C1Ev @ 74 NONAME ABSENT
+	_ZN15TApaAppInfo_7_0C2E4TUidRK4TBufILi256EES4_ @ 75 NONAME ABSENT
+	_ZN15TApaAppInfo_7_0C2Ev @ 76 NONAME ABSENT
+	_ZN15TApaAppViewInfo12InternalizeLER11RReadStream @ 77 NONAME
+	_ZN15TApaAppViewInfoC1E4TUidRK4TBufILi256EEi @ 78 NONAME
+	_ZN15TApaAppViewInfoC1Ev @ 79 NONAME
+	_ZN15TApaAppViewInfoC2E4TUidRK4TBufILi256EEi @ 80 NONAME
+	_ZN15TApaAppViewInfoC2Ev @ 81 NONAME
+	_ZN17TApaAppCapability12InternalizeLER11RReadStream @ 82 NONAME
+	_ZN17TApaAppCapability14CopyCapabilityER5TDes8RK6TDesC8 @ 83 NONAME
+	_ZN17TApaAppCapability15Internalize7_0LER11RReadStream @ 84 NONAME
+	_ZN17TApaAppIdentifier12InternalizeLER11RReadStream @ 85 NONAME
+	_ZN17TApaAppIdentifierC1E4TUidRK4TBufILi256EE @ 86 NONAME
+	_ZN17TApaAppIdentifierC1Ev @ 87 NONAME
+	_ZN17TApaAppIdentifierC2E4TUidRK4TBufILi256EE @ 88 NONAME
+	_ZN17TApaAppIdentifierC2Ev @ 89 NONAME
+	_ZN17TApaLastUsedEntry12InternalizeLER11RReadStream @ 90 NONAME ABSENT
+	_ZN17TApaLastUsedEntryC1E4TBufILi256EE4TUid @ 91 NONAME ABSENT
+	_ZN17TApaLastUsedEntryC1Ev @ 92 NONAME ABSENT
+	_ZN17TApaLastUsedEntryC2E4TBufILi256EE4TUid @ 93 NONAME ABSENT
+	_ZN17TApaLastUsedEntryC2Ev @ 94 NONAME ABSENT
+	_ZN18CApaFileRecognizer13SetAppLocatorEP14CApaAppLocator @ 95 NONAME
+	_ZN18CApaFileRecognizer14RecognizeFileLERK7TDesC16PK8TUidType @ 96 NONAME
+	_ZN18CApaFileRecognizer21AddFileRecognizerTypeEP22CApaFileRecognizerType @ 97 NONAME
+	_ZN18CApaFileRecognizer21DestroyRecognizerListEv @ 98 NONAME
+	_ZN18CApaFileRecognizer24RemoveFileRecognizerTypeEPK22CApaFileRecognizerType @ 99 NONAME
+	_ZN18CApaFileRecognizerC1ER3RFs @ 100 NONAME
+	_ZN18CApaFileRecognizerC2ER3RFs @ 101 NONAME
+	_ZN18CApaFileRecognizerD0Ev @ 102 NONAME
+	_ZN18CApaFileRecognizerD1Ev @ 103 NONAME
+	_ZN18CApaFileRecognizerD2Ev @ 104 NONAME
+	_ZN18TApaDocCleanupItem9DoCleanupEPv @ 105 NONAME
+	_ZN20TApaModelDoorFactoryC1EPK22MApaModelHeaderFactory @ 106 NONAME
+	_ZN20TApaModelDoorFactoryC2EPK22MApaModelHeaderFactory @ 107 NONAME
+	_ZN22CApaFileRecognizerType10Reserved_1Ev @ 108 NONAME
+	_ZN22CApaFileRecognizerType4LockEv @ 109 NONAME
+	_ZN22CApaFileRecognizerType6UnlockEv @ 110 NONAME
+	_ZTV22CApaFileRecognizerType @ 111 NONAME ; #<VT>#
+	_ZN22CApaFileRecognizerTypeC2Ev @ 112 NONAME
+	_ZN22CApaFileRecognizerTypeD0Ev @ 113 NONAME
+	_ZN22CApaFileRecognizerTypeD1Ev @ 114 NONAME
+	_ZN22CApaFileRecognizerTypeD2Ev @ 115 NONAME
+	_ZN23TApaEmbeddabilityFilter16AddEmbeddabilityEN17TApaAppCapability14TEmbeddabilityE @ 116 NONAME
+	_ZN23TApaEmbeddabilityFilterC1Ev @ 117 NONAME
+	_ZN23TApaEmbeddabilityFilterC2Ev @ 118 NONAME
+	_ZNK11CApaProcess15MainDocFileNameEv @ 119 NONAME
+	_ZNK11TApaAppInfo12ExternalizeLER12RWriteStream @ 120 NONAME
+	_ZNK12CApaDocument10CapabilityEv @ 121 NONAME
+	_ZNK12CApaDocument12ExternalizeLER12RWriteStream @ 122 NONAME
+	_ZNK12CApaDocument17ValidatePasswordLEv @ 123 NONAME
+	_ZNK12CApaDoorBase22ExternalizeBaseStreamLER12CStreamStoreR17CStreamDictionary @ 124 NONAME
+	_ZNK12TApaAppEntry12ExternalizeLER12RWriteStream @ 125 NONAME
+	_ZNK13CApaModelDoor12ExternalizeLER12RWriteStream @ 126 NONAME
+	_ZNK13CApaModelDoor16ScaleFactorWidthEv @ 127 NONAME
+	_ZNK13CApaModelDoor17ScaleFactorHeightEv @ 128 NONAME
+	_ZNK13CApaModelDoor22GetOriginalSizeInTwipsER5TSize @ 129 NONAME
+	_ZNK13CApaModelDoor4DrawER16CGraphicsContextRK6TPointRK5TRectP18MGraphicsDeviceMap @ 130 NONAME
+	_ZNK13CApaModelDoor6StoreLER12CStreamStore @ 131 NONAME
+	_ZNK15CApaApplication11AppFullNameEv @ 132 NONAME
+	_ZNK15CApaApplication12OpenIniFileLER3RFs @ 133 NONAME
+	_ZNK15CApaApplication16OpenAppInfoFileLEv @ 134 NONAME ABSENT
+	_ZNK15CApaApplication7DllNameEv @ 135 NONAME
+	_ZNK15CApaCommandLine11LibraryNameEv @ 136 NONAME ABSENT
+	_ZNK15CApaCommandLine12DocumentNameEv @ 137 NONAME
+	_ZNK15CApaCommandLine15FullCommandLineEv @ 138 NONAME ABSENT
+	_ZNK15CApaCommandLine7CommandEv @ 139 NONAME
+	_ZNK15CApaCommandLine7TailEndEv @ 140 NONAME
+	_ZNK15TApaAppInfo_7_012ExternalizeLER12RWriteStream @ 141 NONAME ABSENT
+	_ZNK15TApaAppViewInfo12ExternalizeLER12RWriteStream @ 142 NONAME
+	_ZNK17TApaAppCapability12ExternalizeLER12RWriteStream @ 143 NONAME
+	_ZNK17TApaAppCapability15Externalize7_0LER12RWriteStream @ 144 NONAME
+	_ZNK17TApaAppIdentifier12ExternalizeLER12RWriteStream @ 145 NONAME
+	_ZNK17TApaLastUsedEntry12ExternalizeLER12RWriteStream @ 146 NONAME ABSENT
+	_ZNK18CApaFileRecognizer10AppLocatorEv @ 147 NONAME
+	_ZNK20TApaModelDoorFactory11NewPictureLER14TPictureHeaderRK12CStreamStore @ 148 NONAME
+	_ZNK22CApaFileRecognizerType10CapabilityER5TDes8 @ 149 NONAME
+	_ZNK22CApaFileRecognizerType7AppRunLERK15CApaCommandLine @ 150 NONAME
+	_ZNK23TApaEmbeddabilityFilter20MatchesEmbeddabilityEN17TApaAppCapability14TEmbeddabilityE @ 151 NONAME
+	_ZTI11CApaProcess @ 152 NONAME ; #<TI>#
+	_ZTI12CApaDocument @ 153 NONAME ; #<TI>#
+	_ZTI15CApaApplication @ 154 NONAME ; #<TI>#
+	_ZTI15CApaModelHeader @ 155 NONAME ; #<TI>#
+	_ZTI18CApaFileRecognizer @ 156 NONAME ; #<TI>#
+	_ZTI20TApaModelDoorFactory @ 157 NONAME ; #<TI>#
+	_ZTI22CApaFileRecognizerType @ 158 NONAME ; #<TI>#
+	_ZTV11CApaProcess @ 159 NONAME ; #<VT>#
+	_ZTV12CApaDocument @ 160 NONAME ; #<VT>#
+	_ZTV15CApaApplication @ 161 NONAME ; #<VT>#
+	_ZTV15CApaModelHeader @ 162 NONAME ; #<VT>#
+	_ZTV18CApaFileRecognizer @ 163 NONAME ; #<VT>#
+	_ZTV20TApaModelDoorFactory @ 164 NONAME ; #<VT>#
+	_ZN22CApaFileRecognizerType21CreateFileRecognizerLE4TUid @ 165 NONAME
+	_ZN11CApaProcess15AddNewDocumentLE22TApaApplicationFactory @ 166 NONAME
+	_ZN15CApaApplicationD0Ev @ 167 NONAME
+	_ZN15CApaApplicationD1Ev @ 168 NONAME
+	_ZN15CApaApplicationD2Ev @ 169 NONAME
+	_ZN22TApaApplicationFactoryC1E4TUid @ 170 NONAME
+	_ZN22TApaApplicationFactoryC1EPFP15CApaApplicationvE @ 171 NONAME
+	_ZN22TApaApplicationFactoryC1ERK26CImplementationInformation @ 172 NONAME
+	_ZN22TApaApplicationFactoryC2E4TUid @ 173 NONAME
+	_ZN22TApaApplicationFactoryC2EPFP15CApaApplicationvE @ 174 NONAME
+	_ZN22TApaApplicationFactoryC2ERK26CImplementationInformation @ 175 NONAME
+	_ZTI13CApaAppHolder @ 176 NONAME ABSENT ; #<TI>#
+	_ZTI13CApaModelDoor @ 177 NONAME ; #<TI>#
+	_ZTI15CApaCommandLine @ 178 NONAME ; #<TI>#
+	_ZTI24CFileRecognizerExtension @ 179 NONAME ; #<TI>#
+	_ZTI7CApaDll @ 180 NONAME ABSENT ; #<TI>#
+	_ZTI7CApaExe @ 181 NONAME ABSENT ; #<TI>#
+	_ZTI7HBufBuf @ 182 NONAME ; #<TI>#
+	_ZTV13CApaAppHolder @ 183 NONAME ABSENT ; #<VT>#
+	_ZTV13CApaModelDoor @ 184 NONAME ; #<VT>#
+	_ZTV15CApaCommandLine @ 185 NONAME ; #<VT>#
+	_ZTV24CFileRecognizerExtension @ 186 NONAME ; #<VT>#
+	_ZTV7CApaDll @ 187 NONAME ABSENT ; #<VT>#
+	_ZTV7CApaExe @ 188 NONAME ABSENT ; #<VT>#
+	_ZTV7HBufBuf @ 189 NONAME ; #<VT>#
+	_ZN13CApaAppServer10ConstructLERK7TDesC16 @ 190 NONAME
+	_ZN13CApaAppServer16NotifyServerExitEi @ 191 NONAME
+	_ZN13CApaAppServer20CustomSecurityCheckLERK9RMessage2RiR13TSecurityInfo @ 192 NONAME
+	_ZN13CApaAppServer27CreateServiceSecurityCheckLE4TUidRK9RMessage2RiR13TSecurityInfo @ 193 NONAME
+	_ZN13CApaAppServerC1Ev @ 194 NONAME
+	_ZN13CApaAppServerC2Ev @ 195 NONAME
+	_ZN13CApaAppServerD0Ev @ 196 NONAME
+	_ZN13CApaAppServerD1Ev @ 197 NONAME
+	_ZN13CApaAppServerD2Ev @ 198 NONAME
+	_ZN15CApaCommandLine18SetServerRequiredLEj @ 199 NONAME
+	_ZN15CApaCommandLine21SetServerNotRequiredLEv @ 200 NONAME
+	_ZN18CApaAppServiceBase12ServiceErrorERK9RMessage2i @ 201 NONAME
+	_ZN18CApaAppServiceBase14SecurityCheckLERK9RMessage2RiR13TSecurityInfo @ 202 NONAME
+	_ZN18CApaAppServiceBase7CreateLEv @ 203 NONAME
+	_ZN18CApaAppServiceBase8ServiceLERK9RMessage2 @ 204 NONAME
+	_ZN18CApaAppServiceBaseC1Ev @ 205 NONAME
+	_ZN18CApaAppServiceBaseC2Ev @ 206 NONAME
+	_ZN18CApaAppServiceBaseD0Ev @ 207 NONAME
+	_ZN18CApaAppServiceBaseD1Ev @ 208 NONAME
+	_ZN18CApaAppServiceBaseD2Ev @ 209 NONAME
+	_ZNK18RApaAppServiceBase10ServerNameEv @ 210 NONAME
+	_ZNK18RApaAppServiceBase16NotifyServerExitER14TRequestStatus @ 211 NONAME
+	_ZN18RApaAppServiceBase19ConnectExistingAppLERKS_ @ 212 NONAME
+	_ZNK18RApaAppServiceBase22CancelNotifyServerExitEv @ 213 NONAME
+	_ZN18RApaAppServiceBase22ConnectExistingByNameLERK7TDesC16 @ 214 NONAME
+	_ZN18RApaAppServiceBase5CloseEv @ 215 NONAME
+	_ZN18RApaAppServiceBaseC2Ev @ 216 NONAME
+	_ZN24CApaServerAppExitMonitor4NewLER18RApaAppServiceBaseR25MApaServerAppExitObserveri @ 217 NONAME
+	_ZN24CApaServerAppExitMonitor5NewLCER18RApaAppServiceBaseR25MApaServerAppExitObserveri @ 218 NONAME
+	_ZN24CApaServerAppExitMonitorD0Ev @ 219 NONAME
+	_ZN24CApaServerAppExitMonitorD1Ev @ 220 NONAME
+	_ZN24CApaServerAppExitMonitorD2Ev @ 221 NONAME
+	_ZNK13CApaAppServer11NewSessionLERK8TVersionRK9RMessage2 @ 222 NONAME
+	_ZNK13CApaAppServer14CreateServiceLE4TUid @ 223 NONAME
+	_ZNK15CApaCommandLine14ServerRequiredEv @ 224 NONAME
+	_ZTI13CApaAppServer @ 225 NONAME ; #<TI>#
+	_ZTI18CApaAppServiceBase @ 226 NONAME ; #<TI>#
+	_ZTI24CApaServerAppExitMonitor @ 227 NONAME ; #<TI>#
+	_ZTV13CApaAppServer @ 228 NONAME ; #<VT>#
+	_ZTV18CApaAppServiceBase @ 229 NONAME ; #<VT>#
+	_ZTV24CApaServerAppExitMonitor @ 230 NONAME ; #<VT>#
+	_ZN13CApaAppServer18ExtensionInterfaceE4TUidRPv @ 231 NONAME
+	_ZN18CApaAppServiceBase18ExtensionInterfaceE4TUidRPv @ 232 NONAME
+	_ZN18RApaAppServiceBase18ExtensionInterfaceE4TUidRPv @ 233 NONAME
+	_ZTI18RApaAppServiceBase @ 234 NONAME ; #<TI>#
+	_ZTV18RApaAppServiceBase @ 235 NONAME ; #<VT>#
+	_ZN15CApaCommandLine27EnvironmentSlotForPublicUseEi @ 236 NONAME
+	_ZN15CApaCommandLine16SetFileByHandleLERK5RFile @ 237 NONAME
+	_ZNK15CApaCommandLine16GetFileByHandleLER5RFile @ 238 NONAME
+	_ZN15CApaCommandLine18SetExecutableNameLERK7TDesC16 @ 239 NONAME
+	_ZN11CApaProcessC1ERK3RFs @ 240 NONAME
+	_ZN11CApaProcessC2ERK3RFs @ 241 NONAME
+	_ZN15CApaCommandLine28ConstructCmdLineFromMessageLERK9RMessage2 @ 242 NONAME
+	_ZN15CApaCommandLine36GetCommandLineFromProcessEnvironmentERPS_ @ 243 NONAME
+	_ZNK15CApaCommandLine12GetIpcArgsLCER8TIpcArgs @ 244 NONAME
+	Apparc_Dummy1 @ 245 NONAME ABSENT
+	_ZNK15CApaCommandLine14ExecutableNameEv @ 246 NONAME
+	Apparc_Dummy2 @ 247 NONAME ABSENT
+	_ZNK15CApaCommandLine22SetProcessEnvironmentLER8RProcess @ 248 NONAME
+	_ZN11CApaProcess4NewLERK3RFs @ 249 NONAME
+	_ZN15CApaCommandLine17SetDefaultScreenLEi @ 250 NONAME
+	_ZNK15CApaCommandLine13DefaultScreenEv @ 251 NONAME
+	_ZN15CApaCommandLine22SetParentWindowGroupIDEi @ 252 NONAME
+	_ZNK15CApaCommandLine19ParentWindowGroupIDEv @ 253 NONAME
+	_ZNK15CApaCommandLine12DebugMemFailEv @ 254 NONAME
+	_ZN15CApaCommandLine40SetAppStartupInstrumentationEventIdBaseLEi @ 255 NONAME
+	_ZNK15CApaCommandLine36AppStartupInstrumentationEventIdBaseEv @ 256 NONAME
+	_ZN11CApaProcess16ReadRootStreamLCERP10CFileStoreRK5RFile @ 257 NONAME
+	_ZN15CApaCommandLine16SetDebugMemFailLEi @ 258 NONAME
+	_ZN11CApaProcess21CApaProcess_Reserved1Ev @ 259 NONAME
+	_ZN11CApaProcess21CApaProcess_Reserved2Ev @ 260 NONAME
+	_ZN11CApaProcessC1Ev @ 261 NONAME
+	_ZN11CApaProcessC2Ev @ 262 NONAME
+	_ZN12CApaDocumentC2Ev @ 263 NONAME
+	_ZN12CApaDoorBase14SetCropInTwipsERK8TMargins @ 264 NONAME
+	_ZN12CApaDoorBase14SetScaleFactorEii @ 265 NONAME
+	_ZN12CApaDoorBase15NativePixelSizeER5TSize @ 266 NONAME
+	_ZN12CApaDoorBase22CApaDoorBase_Reserved1Ev @ 267 NONAME
+	_ZN12CApaDoorBase22CApaDoorBase_Reserved2Ev @ 268 NONAME
+	_ZN12CApaDoorBaseC2Ev @ 269 NONAME
+	_ZN13CApaAppFinder23CApaAppFinder_Reserved1Ev @ 270 NONAME
+	_ZN13CApaAppFinder23CApaAppFinder_Reserved2Ev @ 271 NONAME
+	_ZN13CApaAppFinderC2Ev @ 272 NONAME
+	_ZN13CApaAppServer23CApaAppServer_Reserved1Ev @ 273 NONAME
+	_ZN13CApaAppServer23CApaAppServer_Reserved2Ev @ 274 NONAME
+	_ZN13CApaAppServer9DoConnectERK9RMessage2 @ 275 NONAME
+	_ZN14MApaAppStarter24MApaAppStarter_Reserved1Ev @ 276 NONAME
+	_ZN14MApaAppStarter24MApaAppStarter_Reserved2Ev @ 277 NONAME
+	_ZN14MApaAppStarterC2Ev @ 278 NONAME
+	_ZN15CApaApplication25CApaApplication_Reserved1Ev @ 279 NONAME
+	_ZN15CApaApplication25CApaApplication_Reserved2Ev @ 280 NONAME
+	_ZN15CApaApplicationC2Ev @ 281 NONAME
+	_ZN15CApaModelHeader10Reserved_2Ev @ 282 NONAME
+	_ZN15CApaModelHeaderC2Ev @ 283 NONAME
+	_ZN18CApaAppServiceBase10DisconnectERK9RMessage2 @ 284 NONAME
+	_ZN18CApaAppServiceBase14CountResourcesEv @ 285 NONAME
+	_ZN18CApaAppServiceBase28CApaAppServiceBase_Reserved1Ev @ 286 NONAME
+	_ZN18CApaAppServiceBase28CApaAppServiceBase_Reserved2Ev @ 287 NONAME
+	_ZN18RApaAppServiceBase28RApaAppServiceBase_Reserved1Ev @ 288 NONAME
+	_ZN18RApaAppServiceBase28RApaAppServiceBase_Reserved2Ev @ 289 NONAME
+	_ZN22MApaModelHeaderFactory32MApaModelHeaderFactory_Reserved1Ev @ 290 NONAME
+	_ZN22MApaModelHeaderFactory32MApaModelHeaderFactory_Reserved2Ev @ 291 NONAME
+	_ZN22MApaModelHeaderFactoryC2Ev @ 292 NONAME
+	_ZN22TApaApplicationFactoryC1Ev @ 293 NONAME
+	_ZN22TApaApplicationFactoryC2Ev @ 294 NONAME
+	_ZN23CApaAppServiceInfoArray33CApaAppServiceInfoArray_Reserved1Ev @ 295 NONAME
+	_ZN23CApaAppServiceInfoArray33CApaAppServiceInfoArray_Reserved2Ev @ 296 NONAME
+	_ZN23CApaAppServiceInfoArrayC2Ev @ 297 NONAME
+	_ZN23MApaEmbeddedDocObserver33MApaEmbeddedDocObserver_Reserved1Ev @ 298 NONAME
+	_ZN23MApaEmbeddedDocObserver33MApaEmbeddedDocObserver_Reserved2Ev @ 299 NONAME
+	_ZN23MApaEmbeddedDocObserverC2Ev @ 300 NONAME
+	_ZN25MApaServerAppExitObserver35MApaServerAppExitObserver_Reserved1Ev @ 301 NONAME
+	_ZN25MApaServerAppExitObserver35MApaServerAppExitObserver_Reserved2Ev @ 302 NONAME
+	_ZN25MApaServerAppExitObserverC2Ev @ 303 NONAME
+	_ZNK12CApaDoorBase10CapabilityEv @ 304 NONAME
+	_ZNK12CApaDoorBase14GetCropInTwipsER8TMargins @ 305 NONAME
+	_ZNK12CApaDoorBase16ScaleFactorWidthEv @ 306 NONAME
+	_ZNK12CApaDoorBase17LineBreakPossibleEjii @ 307 NONAME
+	_ZNK12CApaDoorBase17ScaleFactorHeightEv @ 308 NONAME
+	_ZNK12CApaDoorBase6StoreLER12CStreamStore @ 309 NONAME
+	_ZTI12CApaDoorBase @ 310 NONAME ; #<TI>#
+	_ZTI13CApaAppFinder @ 311 NONAME ; #<TI>#
+	_ZTI14MApaAppStarter @ 312 NONAME ; #<TI>#
+	_ZTI22MApaModelHeaderFactory @ 313 NONAME ; #<TI>#
+	_ZTI23CApaAppServiceInfoArray @ 314 NONAME ; #<TI>#
+	_ZTI23MApaEmbeddedDocObserver @ 315 NONAME ; #<TI>#
+	_ZTI25MApaServerAppExitObserver @ 316 NONAME ; #<TI>#
+	_ZTV12CApaDoorBase @ 317 NONAME ; #<VT>#
+	_ZTV13CApaAppFinder @ 318 NONAME ; #<VT>#
+	_ZTV14MApaAppStarter @ 319 NONAME ; #<VT>#
+	_ZTV22MApaModelHeaderFactory @ 320 NONAME ; #<VT>#
+	_ZTV23CApaAppServiceInfoArray @ 321 NONAME ; #<VT>#
+	_ZTV23MApaEmbeddedDocObserver @ 322 NONAME ; #<VT>#
+	_ZTV25MApaServerAppExitObserver @ 323 NONAME ; #<VT>#
+	_ZN15CApaCommandLine14SetOpaqueDataLERK6TDesC8 @ 324 NONAME
+	_ZNK15CApaCommandLine10OpaqueDataEv @ 325 NONAME
+	_ZNK15CApaCommandLine18IsDefaultScreenSetEv @ 326 NONAME
+	_ZN11CApaProcess10ConstructLE10TProcessId @ 327 NONAME
+	_ZN15CApaCommandLine18SetParentProcessIdE10TProcessId @ 328 NONAME
+	_ZNK15CApaCommandLine15ParentProcessIdEv @ 329 NONAME
+	_ZTI24CApaParentProcessMonitor @ 330 NONAME ; #<TI>#
+	_ZTV24CApaParentProcessMonitor @ 331 NONAME ; #<VT>#
+	_ZN18RApaAppServiceBase19ConnectExistingAppLERKS_RK15TSecurityPolicy @ 332 NONAME
+	_ZN18RApaAppServiceBase22ConnectExistingByNameLERK7TDesC16RK15TSecurityPolicy @ 333 NONAME
+	_ZN18RApaAppServiceBase24TransferExistingSessionLERS_ @ 334 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/eabi/APSERVU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,69 @@
+EXPORTS
+	_Z23NameApaServServerThreadv @ 1 NONAME
+	_Z25NameApaServStartSemaphorev @ 2 NONAME
+	_ZN13CApaFsMonitor10SetBlockedEi @ 3 NONAME
+	_ZN13CApaFsMonitor4NewLER3RFsRK7TDesC169TCallBack @ 4 NONAME
+	_ZN13CApaFsMonitor5StartE11TNotifyType @ 5 NONAME
+	_ZN13CApaFsMonitorD0Ev @ 6 NONAME
+	_ZN13CApaFsMonitorD1Ev @ 7 NONAME
+	_ZN13CApaFsMonitorD2Ev @ 8 NONAME
+	_ZN17CApaAppListServer4NewLEP11CApaAppListP18CApaFileRecognizer @ 9 NONAME ABSENT
+	_ZN17CApaAppListServer4NewLEP14MApaAppStarter @ 10 NONAME
+	_ZN17CApaAppListServerD0Ev @ 11 NONAME
+	_ZN17CApaAppListServerD1Ev @ 12 NONAME
+	_ZN17CApaAppListServerD2Ev @ 13 NONAME
+	_ZNK13CApaFsMonitor10NotifyTypeEv @ 14 NONAME
+	_ZTI13CApaFsMonitor @ 15 NONAME ; #<TI>#
+	_ZTI15CApaEComMonitor @ 16 NONAME ; #<TI>#
+	_ZTI17CApaAppListServer @ 17 NONAME ; #<TI>#
+	_ZTI20TDesCArrayItemWriter @ 18 NONAME ; #<TI>#
+	_ZTI20TSizeArrayItemWriter @ 19 NONAME ; #<TI>#
+	_ZTI22CApaAppListServSession @ 20 NONAME ; #<TI>#
+	_ZTI24TViewDataArrayItemWriter @ 21 NONAME ; #<TI>#
+	_ZTV13CApaFsMonitor @ 22 NONAME ; #<VT>#
+	_ZTV15CApaEComMonitor @ 23 NONAME ; #<VT>#
+	_ZTV17CApaAppListServer @ 24 NONAME ; #<VT>#
+	_ZTV20TDesCArrayItemWriter @ 25 NONAME ; #<VT>#
+	_ZTV20TSizeArrayItemWriter @ 26 NONAME ; #<VT>#
+	_ZTV22CApaAppListServSession @ 27 NONAME ; #<VT>#
+	_ZTV24TViewDataArrayItemWriter @ 28 NONAME ; #<VT>#
+	_ZN13CApaFsMonitor12AddLocationLERK7TDesC16 @ 29 NONAME
+	_ZTIN13CApaFsMonitor14CApaFsNotifierE @ 30 NONAME ; #<TI>#
+	_ZTVN13CApaFsMonitor14CApaFsNotifierE @ 31 NONAME ; #<VT>#
+	_ZN17CApaAppListServer4SelfEv @ 32 NONAME
+	_ZN13CApaFsMonitor6CancelEv @ 33 NONAME
+	_Z18ApaServThreadStartPv @ 34 NONAME
+	_ZTI18CRecognitionResult @ 35 NONAME ; #<TI>#
+	_ZTI20CApsRecognitionCache @ 36 NONAME ; #<TI>#
+	_ZTI20CCacheDirectoryEntry @ 37 NONAME ; #<TI>#
+	_ZTI23CFileRecognitionUtility @ 38 NONAME ; #<TI>#
+	_ZTI25CRecognitionResultHashMap @ 39 NONAME ; #<TI>#
+	_ZTI27CDirectoryRecognitionResult @ 40 NONAME ; #<TI>#
+	_ZTI30CRecognitionResultHashMapEntry @ 41 NONAME ; #<TI>#
+	_ZTV18CRecognitionResult @ 42 NONAME ; #<VT>#
+	_ZTV20CApsRecognitionCache @ 43 NONAME ; #<VT>#
+	_ZTV20CCacheDirectoryEntry @ 44 NONAME ; #<VT>#
+	_ZTV23CFileRecognitionUtility @ 45 NONAME ; #<VT>#
+	_ZTV25CRecognitionResultHashMap @ 46 NONAME ; #<VT>#
+	_ZTV27CDirectoryRecognitionResult @ 47 NONAME ; #<VT>#
+	_ZTV30CRecognitionResultHashMapEntry @ 48 NONAME ; #<VT>#
+	_ZN16CUpdatedAppsList28CloseAndDeletePermanentStoreEv @ 49 NONAME ABSENT
+	_ZN16CUpdatedAppsListD0Ev @ 50 NONAME ABSENT
+	_ZN16CUpdatedAppsListD1Ev @ 51 NONAME ABSENT
+	_ZN16CUpdatedAppsListD2Ev @ 52 NONAME ABSENT
+	_ZTI16CUpdatedAppsList @ 53 NONAME ABSENT ; #<TI>#
+	_ZTV16CUpdatedAppsList @ 54 NONAME ABSENT ; #<VT>#
+	_ZNK16CUpdatedAppsList8IsInListERK7TDesC16 @ 55 NONAME ABSENT
+	_ZTIN16CUpdatedAppsList15CUpdatedAppInfoE @ 56 NONAME ABSENT ; #<TI>#
+	_ZTVN16CUpdatedAppsList15CUpdatedAppInfoE @ 57 NONAME ABSENT ; #<VT>#
+	_ZN17CApaAppListServer14RescanCallBackEv @ 58 NONAME
+	_ZTI18CCustomAppInfoData @ 59 NONAME ; #<TI>#
+	_ZTV18CCustomAppInfoData @ 60 NONAME ; #<VT>#
+	KApaLoadDataRecognizersOnDemand @ 61 NONAME DATA 4
+	KApaUnloadRecognizersTimeout @ 62 NONAME DATA 4
+	_ZN17CApaAppListServer24HandleEndUninstallEventLEv @ 63 NONAME
+	_ZN17CApaAppListServer25HandleStartUninstallEventEv @ 64 NONAME
+	KApaDrivesToMonitor @ 65 NONAME DATA 4
+	KApaLoadMbmIconsOnDemand @ 66 NONAME DATA 4
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/eabi/APSEXEU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,5 @@
+EXPORTS
+	_Z16StartupApaServerR14MApaAppStarter @ 1 NONAME
+	_ZTI18CSvActiveScheduler @ 2 NONAME ; #<TI>#
+	_ZTV18CSvActiveScheduler @ 3 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/eabi/ServiceRegistryU.def	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,11 @@
+EXPORTS
+	_ZN16CServiceRegistry10SetDefaultE4TUidRK9TDataTypeS0_ @ 1 NONAME
+	_ZN16CServiceRegistry10GetDefaultE4TUidRK9TDataTypeRS0_ @ 2 NONAME
+	_ZN16CServiceRegistry11RemoveEntryE4TUidRK9TDataType @ 3 NONAME
+	_ZN16CServiceRegistry4NewLEv @ 4 NONAME
+	_ZN16CServiceRegistryD0Ev @ 5 NONAME
+	_ZN16CServiceRegistryD1Ev @ 6 NONAME
+	_ZN16CServiceRegistryD2Ev @ 7 NONAME
+	_ZTI16CServiceRegistry @ 8 NONAME ; #<TI>#
+	_ZTV16CServiceRegistry @ 9 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/eabi/TDONOTHINGFILERECOGNIZERU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,5 @@
+EXPORTS
+	_Z16CreateRecognizerv @ 1 NONAME
+	_ZTI17CDoNothingFileRec @ 2 NONAME ; #<TI>#
+	_ZTV17CDoNothingFileRec @ 3 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/eabi/TICONFORLEAKSu.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,395 @@
+EXPORTS
+	KMinApplicationStackSize @ 1 NONAME DATA 4
+	_Z16StartupApaServerR14MApaAppStarter @ 2 NONAME
+	_Z23MinApplicationStackSizev @ 3 NONAME
+	_Z23StartupApaServerProcessv @ 4 NONAME
+	_ZN11CApaAppData16CanUseScreenModeEi @ 5 NONAME
+	_ZN11CApaAppData16SetShortCaptionLERK7TDesC16 @ 6 NONAME
+	_ZN11CApaAppData4NewLERK12TApaAppEntryR3RFs @ 7 NONAME
+	_ZN11CApaAppDataD0Ev @ 8 NONAME
+	_ZN11CApaAppDataD1Ev @ 9 NONAME
+	_ZN11CApaAppDataD2Ev @ 10 NONAME
+	_ZN11CApaAppList12RestartScanLEv @ 11 NONAME
+	_ZN11CApaAppList14CompareStringsERK7HBufC16S2_ @ 12 NONAME
+	_ZN11CApaAppList15UpdatedAppsListEv @ 13 NONAME ABSENT
+	_ZN11CApaAppList16StartIdleUpdateLEP19MApaAppListObserver @ 14 NONAME
+	_ZN11CApaAppList16StartIdleUpdateLEv @ 15 NONAME
+	_ZN11CApaAppList18SetUpdatedAppsListEP16CUpdatedAppsList @ 16 NONAME ABSENT
+	_ZN11CApaAppList22AddForcedRegistrationLEP7HBufC16 @ 17 NONAME
+	_ZN11CApaAppList22FindAndAddSpecificAppLEP16CApaAppRegFinder4TUid @ 18 NONAME
+	_ZN11CApaAppList24ResetForcedRegistrationsEv @ 19 NONAME
+	_ZN11CApaAppList4NewLER3RFsP16CApaAppRegFinderii @ 20 NONAME
+	_ZN11CApaAppList4SelfEv @ 21 NONAME
+	_ZN11CApaAppList6PurgeLEv @ 22 NONAME
+	_ZN11CApaAppList8StopScanEi @ 23 NONAME
+	_ZN11CApaAppList9InitListLEP19MApaAppListObserver @ 24 NONAME
+	_ZN11CApaAppListD0Ev @ 25 NONAME
+	_ZN11CApaAppListD1Ev @ 26 NONAME
+	_ZN11CApaAppListD2Ev @ 27 NONAME
+	_ZN12TApaTaskList10CycleTasksE4TUidNS_15TCycleDirectionE @ 28 NONAME
+	_ZN12TApaTaskList7FindAppE4TUid @ 29 NONAME
+	_ZN12TApaTaskList7FindAppERK7TDesC16 @ 30 NONAME
+	_ZN12TApaTaskList7FindDocERK7TDesC16 @ 31 NONAME
+	_ZN12TApaTaskList9FindByPosEi @ 32 NONAME
+	_ZN12TApaTaskListC1ER10RWsSession @ 33 NONAME
+	_ZN12TApaTaskListC2ER10RWsSession @ 34 NONAME
+	_ZN13RApaLsSession12CancelNotifyEv @ 35 NONAME
+	_ZN13RApaLsSession13SetFsSessionLER3RFs @ 36 NONAME
+	_ZN13RApaLsSession13StartDocumentER5RFile4TUidR9TThreadIdP14TRequestStatus @ 37 NONAME
+	_ZN13RApaLsSession13StartDocumentER5RFileR9TThreadIdP14TRequestStatus @ 38 NONAME
+	_ZN13RApaLsSession13StartDocumentER5RFileRK9TDataTypeR9TThreadIdP14TRequestStatus @ 39 NONAME
+	_ZN13RApaLsSession13StartDocumentERK7TDesC164TUidR9TThreadIdNS_11TLaunchTypeE @ 40 NONAME
+	_ZN13RApaLsSession13StartDocumentERK7TDesC16R9TThreadIdNS_11TLaunchTypeE @ 41 NONAME
+	_ZN13RApaLsSession13StartDocumentERK7TDesC16RK9TDataTypeR9TThreadIdNS_11TLaunchTypeE @ 42 NONAME
+	_ZN13RApaLsSession14ClearFsSessionEv @ 43 NONAME
+	_ZN13RApaLsSession14CreateDocumentERK7TDesC164TUidR9TThreadIdNS_11TLaunchTypeE @ 44 NONAME
+	_ZN13RApaLsSession15RecognizeFilesLERK7TDesC16R27CDataRecognitionResultArrayR14TRequestStatus @ 45 NONAME
+	_ZN13RApaLsSession15RecognizeFilesLERK7TDesC16RK6TDesC8R27CDataRecognitionResultArrayR14TRequestStatus @ 46 NONAME
+	_ZN13RApaLsSession17DeleteDataMappingERK9TDataType @ 47 NONAME
+	_ZN13RApaLsSession17DeleteDataMappingERK9TDataType4TUid @ 48 NONAME
+	_ZN13RApaLsSession17ForceRegistrationERK13RPointerArrayI7TDesC16E @ 49 NONAME
+	_ZN13RApaLsSession17InsertDataMappingERK9TDataTypel4TUid @ 50 NONAME
+	_ZN13RApaLsSession17InsertDataMappingERK9TDataTypel4TUidS3_ @ 51 NONAME
+	_ZN13RApaLsSession17SetMaxDataBufSizeEi @ 52 NONAME
+	_ZN13RApaLsSession18SetAppShortCaptionERK7TDesC169TLanguage4TUid @ 53 NONAME
+	_ZN13RApaLsSession20CancelRecognizeFilesEv @ 54 NONAME
+	_ZN13RApaLsSession21SetAcceptedConfidenceEi @ 55 NONAME
+	_ZN13RApaLsSession23RApaLsSession_Reserved1Ev @ 56 NONAME
+	_ZN13RApaLsSession23RApaLsSession_Reserved2Ev @ 57 NONAME
+	_ZN13RApaLsSession25InsertDataMappingIfHigherERK9TDataTypel4TUidRi @ 58 NONAME
+	_ZN13RApaLsSession25NotifyOnDataMappingChangeER14TRequestStatus @ 59 NONAME
+	_ZN13RApaLsSession29RegisterNonNativeApplicationLE4TUidRK10TDriveUnitR34CApaRegistrationResourceFileWriterP33CApaLocalisableResourceFileWriterPK5RFile @ 60 NONAME
+	_ZN13RApaLsSession31CancelNotifyOnDataMappingChangeEv @ 61 NONAME
+	_ZN13RApaLsSession31DeregisterNonNativeApplicationLE4TUid @ 62 NONAME
+	_ZN13RApaLsSession33RegisterNonNativeApplicationTypeLE4TUidRK7TDesC16 @ 63 NONAME
+	_ZN13RApaLsSession35CommitNonNativeApplicationsUpdatesLEv @ 64 NONAME
+	_ZN13RApaLsSession35DeregisterNonNativeApplicationTypeLE4TUid @ 65 NONAME
+	_ZN13RApaLsSession36PrepareNonNativeApplicationsUpdatesLEv @ 66 NONAME
+	_ZN13RApaLsSession36RollbackNonNativeApplicationsUpdatesEv @ 67 NONAME
+	_ZN13RApaLsSession5CloseEv @ 68 NONAME
+	_ZN13RApaLsSession7ConnectEv @ 69 NONAME
+	_ZN13RApaLsSession8StartAppERK15CApaCommandLine @ 70 NONAME
+	_ZN13RApaLsSession8StartAppERK15CApaCommandLineR9TThreadId @ 71 NONAME
+	_ZN13RApaLsSession8StartAppERK15CApaCommandLineR9TThreadIdP14TRequestStatus @ 72 NONAME
+	_ZN13RApaLsSession9FsSessionEv @ 73 NONAME
+	_ZN13RApaLsSession9SetNotifyEiR14TRequestStatus @ 74 NONAME
+	_ZN13RApaLsSessionC1Ev @ 75 NONAME
+	_ZN13RApaLsSessionC2Ev @ 76 NONAME
+	_ZN16CApaMaskedBitmap12InternalizeLER11RReadStream @ 77 NONAME
+	_ZN16CApaMaskedBitmap13SetMaskBitmapEP10CFbsBitmap @ 78 NONAME
+	_ZN16CApaMaskedBitmap4NewLEPKS_ @ 79 NONAME
+	_ZN16CApaMaskedBitmap5NewLCEv @ 80 NONAME
+	_ZN16CApaMaskedBitmapD0Ev @ 81 NONAME
+	_ZN16CApaMaskedBitmapD1Ev @ 82 NONAME
+	_ZN16CApaMaskedBitmapD2Ev @ 83 NONAME
+	_ZN17CApaSystemControl7CreateLEv @ 84 NONAME
+	_ZN18TApaPictureFactoryC1EP11CApaProcess @ 85 NONAME
+	_ZN18TApaPictureFactoryC1Ev @ 86 NONAME
+	_ZN18TApaPictureFactoryC2EP11CApaProcess @ 87 NONAME
+	_ZN18TApaPictureFactoryC2Ev @ 88 NONAME
+	_ZN19CApaAppListNotifier4NewLEP23MApaAppListServObserverN7CActive9TPriorityE @ 89 NONAME
+	_ZN19CApaAppListNotifierD0Ev @ 90 NONAME
+	_ZN19CApaAppListNotifierD1Ev @ 91 NONAME
+	_ZN19CApaAppListNotifierD2Ev @ 92 NONAME
+	_ZN19CApaWindowGroupName11SetAppReadyEi @ 93 NONAME
+	_ZN19CApaWindowGroupName11SetCaptionLERK7TDesC16 @ 94 NONAME
+	_ZN19CApaWindowGroupName11SetDocNameLERK7TDesC16 @ 95 NONAME
+	_ZN19CApaWindowGroupName12FindByAppUidE4TUidR10RWsSessionRi @ 96 NONAME
+	_ZN19CApaWindowGroupName13FindByCaptionERK7TDesC16R10RWsSessionRi @ 97 NONAME
+	_ZN19CApaWindowGroupName13FindByDocNameERK7TDesC16R10RWsSessionRi @ 98 NONAME
+	_ZN19CApaWindowGroupName17SetDocNameIsAFileEi @ 99 NONAME
+	_ZN19CApaWindowGroupName18ConstructFromWgIdLEi @ 100 NONAME
+	_ZN19CApaWindowGroupName18SetWindowGroupNameEP7HBufC16 @ 101 NONAME
+	_ZN19CApaWindowGroupName19SetWindowGroupNameLERK7TDesC16 @ 102 NONAME
+	_ZN19CApaWindowGroupName26SetRespondsToShutdownEventEi @ 103 NONAME
+	_ZN19CApaWindowGroupName29SetRespondsToSwitchFilesEventEi @ 104 NONAME
+	_ZN19CApaWindowGroupName3NewERK10RWsSessionP7HBufC16 @ 105 NONAME
+	_ZN19CApaWindowGroupName4NewLERK10RWsSession @ 106 NONAME
+	_ZN19CApaWindowGroupName4NewLERK10RWsSessionRK7TDesC16 @ 107 NONAME
+	_ZN19CApaWindowGroupName4NewLERK10RWsSessioni @ 108 NONAME
+	_ZN19CApaWindowGroupName5NewLCERK10RWsSession @ 109 NONAME
+	_ZN19CApaWindowGroupName5NewLCERK10RWsSessionRK7TDesC16 @ 110 NONAME
+	_ZN19CApaWindowGroupName5NewLCERK10RWsSessioni @ 111 NONAME
+	_ZN19CApaWindowGroupName7SetBusyEi @ 112 NONAME
+	_ZN19CApaWindowGroupName9SetAppUidE4TUid @ 113 NONAME
+	_ZN19CApaWindowGroupName9SetHiddenEi @ 114 NONAME
+	_ZN19CApaWindowGroupName9SetSystemEi @ 115 NONAME
+	_ZN19CApaWindowGroupNameD0Ev @ 116 NONAME
+	_ZN19CApaWindowGroupNameD1Ev @ 117 NONAME
+	_ZN19CApaWindowGroupNameD2Ev @ 118 NONAME
+	_ZN21CApaAppInfoFileWriter11AddCaptionLE9TLanguageRK7TDesC16 @ 119 NONAME
+	_ZN21CApaAppInfoFileWriter12AddDataTypeLERK21TDataTypeWithPriority @ 120 NONAME
+	_ZN21CApaAppInfoFileWriter13SetCapabilityERK6TDesC8 @ 121 NONAME
+	_ZN21CApaAppInfoFileWriter6StoreLEv @ 122 NONAME
+	_ZN21CApaAppInfoFileWriter8AddIconLER16CApaMaskedBitmap @ 123 NONAME
+	_ZN21CApaAppInfoFileWriterD0Ev @ 124 NONAME
+	_ZN21CApaAppInfoFileWriterD1Ev @ 125 NONAME
+	_ZN21CApaAppInfoFileWriterD2Ev @ 126 NONAME
+	_ZN21CApaSystemControlList4NewLER3RFs @ 127 NONAME
+	_ZN21CApaSystemControlList7UpdateLEv @ 128 NONAME
+	_ZN21CApaSystemControlListD0Ev @ 129 NONAME
+	_ZN21CApaSystemControlListD1Ev @ 130 NONAME
+	_ZN21CApaSystemControlListD2Ev @ 131 NONAME
+	_ZN22ForJavaMIDletInstaller18GetJavaMIDletInfoLER3RFsRK7TDesC16RmS5_ @ 132 NONAME
+	_ZN22ForJavaMIDletInstaller28NewInterimFormatFileWriterLCER3RFsRK7TDesC164TUidmi @ 133 NONAME
+	_ZN22ForJavaMIDletInstaller33CheckInterimFormatFileNotCorruptLER5RFile @ 134 NONAME
+	_ZN23MApaAppListServObserver33MApaAppListServObserver_Reserved1Ev @ 135 NONAME
+	_ZN23MApaAppListServObserver33MApaAppListServObserver_Reserved2Ev @ 136 NONAME
+	_ZN23MApaAppListServObserverC2Ev @ 137 NONAME
+	_ZN27CDataRecognitionResultArrayC1Ev @ 138 NONAME
+	_ZN27CDataRecognitionResultArrayC2Ev @ 139 NONAME
+	_ZN27CDataRecognitionResultArrayD0Ev @ 140 NONAME
+	_ZN27CDataRecognitionResultArrayD1Ev @ 141 NONAME
+	_ZN27CDataRecognitionResultArrayD2Ev @ 142 NONAME
+	_ZN31TIconLoaderAndIconArrayForLeaks27TestIconLoaderAndIconArrayLEv @ 143 NONAME
+	_ZN33CApaLocalisableResourceFileWriter4NewLERK7TDesC16S2_iS2_ @ 144 NONAME
+	_ZN33CApaLocalisableResourceFileWriterD0Ev @ 145 NONAME
+	_ZN33CApaLocalisableResourceFileWriterD1Ev @ 146 NONAME
+	_ZN33CApaLocalisableResourceFileWriterD2Ev @ 147 NONAME
+	_ZN34CApaRegistrationResourceFileWriter12AddDataTypeLEiRK6TDesC8 @ 148 NONAME
+	_ZN34CApaRegistrationResourceFileWriter13SetGroupNameLERK7TDesC16 @ 149 NONAME
+	_ZN34CApaRegistrationResourceFileWriter14SetOpaqueDataLERK6TDesC8 @ 150 NONAME
+	_ZN34CApaRegistrationResourceFileWriter15SetAppIsHiddenLEi @ 151 NONAME
+	_ZN34CApaRegistrationResourceFileWriter17SetEmbeddabilityLEN17TApaAppCapability14TEmbeddabilityE @ 152 NONAME
+	_ZN34CApaRegistrationResourceFileWriter19SetSupportsNewFileLEi @ 153 NONAME
+	_ZN34CApaRegistrationResourceFileWriter21AddFileOwnershipInfoLERK7TDesC16 @ 154 NONAME
+	_ZN34CApaRegistrationResourceFileWriter22SetLaunchInBackgroundLEi @ 155 NONAME
+	_ZN34CApaRegistrationResourceFileWriter23SetDefaultScreenNumberLEi @ 156 NONAME
+	_ZN34CApaRegistrationResourceFileWriter4NewLE4TUidRK7TDesC16j @ 157 NONAME
+	_ZN34CApaRegistrationResourceFileWriterD0Ev @ 158 NONAME
+	_ZN34CApaRegistrationResourceFileWriterD1Ev @ 159 NONAME
+	_ZN34CApaRegistrationResourceFileWriterD2Ev @ 160 NONAME
+	_ZN8ApaUtils24HandleAsRegistrationFileERK8TUidType @ 161 NONAME
+	_ZN8CApaDoor16SetFormatToIconLEv @ 162 NONAME
+	_ZN8CApaDoor17SetFormatToGlassLEv @ 163 NONAME
+	_ZN8CApaDoor25SetFormatToTemporaryIconLEi @ 164 NONAME
+	_ZN8CApaDoor4NewLER3RFsR12CApaDocumentRK5TSize @ 165 NONAME
+	_ZN8CApaDoor4NewLER3RFsRK12CStreamStore9TStreamIdR11CApaProcess @ 166 NONAME
+	_ZN8CApaDoor5NewLCER3RFsR12CApaDocumentRK5TSize @ 167 NONAME
+	_ZN8CApaDoor8RestoreLERK12CStreamStore9TStreamId @ 168 NONAME
+	_ZN8CApaDoor9DocumentLEi @ 169 NONAME
+	_ZN8CApaDoorD0Ev @ 170 NONAME
+	_ZN8CApaDoorD1Ev @ 171 NONAME
+	_ZN8CApaDoorD2Ev @ 172 NONAME
+	_ZN8TApaTask11SendMessageE4TUidRK6TDesC8 @ 173 NONAME
+	_ZN8TApaTask14SwitchOpenFileERK7TDesC16 @ 174 NONAME
+	_ZN8TApaTask15SendSystemEventE15TApaSystemEvent @ 175 NONAME
+	_ZN8TApaTask16SendToBackgroundEv @ 176 NONAME
+	_ZN8TApaTask16SwitchCreateFileERK7TDesC16 @ 177 NONAME
+	_ZN8TApaTask17BringToForegroundEv @ 178 NONAME
+	_ZN8TApaTask7EndTaskEv @ 179 NONAME
+	_ZN8TApaTask7SendKeyERK9TKeyEvent @ 180 NONAME
+	_ZN8TApaTask7SendKeyEii @ 181 NONAME
+	_ZN8TApaTask7SetWgIdEi @ 182 NONAME
+	_ZN8TApaTask8KillTaskEv @ 183 NONAME
+	_ZN8TApaTaskC1ER10RWsSession @ 184 NONAME
+	_ZN8TApaTaskC2ER10RWsSession @ 185 NONAME
+	_ZNK11CApaAppData10CapabilityER5TDes8 @ 186 NONAME
+	_ZNK11CApaAppData10IconSizesLEv @ 187 NONAME
+	_ZNK11CApaAppData10OpaqueDataEv @ 188 NONAME
+	_ZNK11CApaAppData10OwnedFilesEv @ 189 NONAME
+	_ZNK11CApaAppData11GetIconInfoERiS0_ @ 190 NONAME
+	_ZNK11CApaAppData12IconFileNameEv @ 191 NONAME
+	_ZNK11CApaAppData14NonMbmIconFileEv @ 192 NONAME
+	_ZNK11CApaAppData17ImplementsServiceE4TUid @ 193 NONAME
+	_ZNK11CApaAppData19ApplicationLanguageEv @ 194 NONAME
+	_ZNK11CApaAppData19DefaultScreenNumberEv @ 195 NONAME
+	_ZNK11CApaAppData20RegistrationFileNameEv @ 196 NONAME
+	_ZNK11CApaAppData20RegistrationFileUsedEv @ 197 NONAME
+	_ZNK11CApaAppData24NonNativeApplicationTypeEv @ 198 NONAME
+	_ZNK11CApaAppData27LocalisableResourceFileNameEv @ 199 NONAME
+	_ZNK11CApaAppData4IconE5TSize @ 200 NONAME
+	_ZNK11CApaAppData4IconEi @ 201 NONAME
+	_ZNK11CApaAppData5ViewsEv @ 202 NONAME
+	_ZNK11CApaAppData8AppEntryEv @ 203 NONAME
+	_ZNK11CApaAppData8DataTypeERK9TDataType @ 204 NONAME
+	_ZNK11CApaAppData9IsPendingEv @ 205 NONAME
+	_ZNK11CApaAppList12AppDataByUidE4TUid @ 206 NONAME
+	_ZNK11CApaAppList17AppDataByFileNameERK7TDesC16 @ 207 NONAME
+	_ZNK11CApaAppList17AppScanInProgressEv @ 208 NONAME
+	_ZNK11CApaAppList17ServiceUidBufferLE4TUid @ 209 NONAME
+	_ZNK11CApaAppList19IsFirstScanCompleteEv @ 210 NONAME
+	_ZNK11CApaAppList19ServiceArrayBufferLE4TUid @ 211 NONAME
+	_ZNK11CApaAppList20IsIdleUpdateCompleteEv @ 212 NONAME
+	_ZNK11CApaAppList21PreferredDataHandlerLERK9TDataType @ 213 NONAME
+	_ZNK11CApaAppList21PreferredDataHandlerLERK9TDataTypePK4TUidRi @ 214 NONAME
+	_ZNK11CApaAppList23IsLanguageChangePendingEv @ 215 NONAME
+	_ZNK11CApaAppList23ServiceImplArrayBufferLE4TUid @ 216 NONAME
+	_ZNK11CApaAppList23ServiceImplArrayBufferLE4TUidRK9TDataType @ 217 NONAME
+	_ZNK11CApaAppList24ServiceOpaqueDataBufferLE4TUidS0_ @ 218 NONAME
+	_ZNK11CApaAppList5CountEv @ 219 NONAME
+	_ZNK11CApaAppList7NextAppEPK11CApaAppData @ 220 NONAME
+	_ZNK11CApaAppList7NextAppEPK11CApaAppDatai @ 221 NONAME
+	_ZNK11CApaAppList8FirstAppEi @ 222 NONAME
+	_ZNK11CApaAppList8FirstAppEv @ 223 NONAME
+	_ZNK13RApaLsSession10GetAllAppsEi @ 224 NONAME
+	_ZNK13RApaLsSession10GetAllAppsEv @ 225 NONAME
+	_ZNK13RApaLsSession10GetAppIconE4TUid5TSizeR16CApaMaskedBitmap @ 226 NONAME
+	_ZNK13RApaLsSession10GetAppIconE4TUidR5RFile @ 227 NONAME
+	_ZNK13RApaLsSession10GetAppIconE4TUidRP7HBufC16 @ 228 NONAME
+	_ZNK13RApaLsSession10GetAppIconE4TUidiR16CApaMaskedBitmap @ 229 NONAME
+	_ZNK13RApaLsSession10GetAppInfoER11TApaAppInfo4TUid @ 230 NONAME
+	_ZNK13RApaLsSession10GetAppTypeER4TUidS0_ @ 231 NONAME
+	_ZNK13RApaLsSession10GetNextAppER11TApaAppInfo @ 232 NONAME
+	_ZNK13RApaLsSession10GetNextAppER11TApaAppInfoi @ 233 NONAME
+	_ZNK13RApaLsSession11GetAppViewsER13CArrayFixFlatI15TApaAppViewInfoE4TUid @ 234 NONAME
+	_ZNK13RApaLsSession13GetServerAppsE4TUid @ 235 NONAME
+	_ZNK13RApaLsSession13GetServerAppsE4TUidi @ 236 NONAME
+	_ZNK13RApaLsSession13RecognizeDataERK5RFileR22TDataRecognitionResult @ 237 NONAME
+	_ZNK13RApaLsSession13RecognizeDataERK7TDesC16RK6TDesC8R22TDataRecognitionResult @ 238 NONAME
+	_ZNK13RApaLsSession14AppForDataTypeERK9TDataTypeR4TUid @ 239 NONAME
+	_ZNK13RApaLsSession14AppForDocumentERK5RFileR4TUidR9TDataType @ 240 NONAME
+	_ZNK13RApaLsSession14AppForDocumentERK7TDesC16R4TUidR9TDataType @ 241 NONAME
+	_ZNK13RApaLsSession14GetAppViewIconE4TUidS0_RK5TSizeR16CApaMaskedBitmap @ 242 NONAME
+	_ZNK13RApaLsSession14GetAppViewIconE4TUidS0_RP7HBufC16 @ 243 NONAME
+	_ZNK13RApaLsSession15GetAppIconSizesE4TUidR13CArrayFixFlatI5TSizeE @ 244 NONAME
+	_ZNK13RApaLsSession15GetAppServicesLE4TUidR13CArrayFixFlatIS0_E @ 245 NONAME
+	_ZNK13RApaLsSession15GetFilteredAppsERK23TApaEmbeddabilityFilter @ 246 NONAME
+	_ZNK13RApaLsSession15GetFilteredAppsERK23TApaEmbeddabilityFilteri @ 247 NONAME
+	_ZNK13RApaLsSession15GetFilteredAppsEjj @ 248 NONAME
+	_ZNK13RApaLsSession15GetFilteredAppsEjji @ 249 NONAME
+	_ZNK13RApaLsSession15RecognizeFilesLERK7TDesC16R27CDataRecognitionResultArray @ 250 NONAME
+	_ZNK13RApaLsSession15RecognizeFilesLERK7TDesC16RK6TDesC8R27CDataRecognitionResultArray @ 251 NONAME
+	_ZNK13RApaLsSession16GetAppByDataTypeERK9TDataType4TUidRS3_ @ 252 NONAME
+	_ZNK13RApaLsSession16GetAppCapabilityER5TDes84TUid @ 253 NONAME
+	_ZNK13RApaLsSession16GetAppOwnedFilesER12CDesC16Array4TUid @ 254 NONAME
+	_ZNK13RApaLsSession16GetAppServicesLCE4TUid @ 255 NONAME
+	_ZNK13RApaLsSession17GetEmbeddableAppsEi @ 256 NONAME
+	_ZNK13RApaLsSession17GetEmbeddableAppsEv @ 257 NONAME
+	_ZNK13RApaLsSession17GetMaxDataBufSizeERi @ 258 NONAME
+	_ZNK13RApaLsSession18EmbeddableAppCountERi @ 259 NONAME
+	_ZNK13RApaLsSession19ApplicationLanguageE4TUidR9TLanguage @ 260 NONAME
+	_ZNK13RApaLsSession19GetPreferredBufSizeERi @ 261 NONAME
+	_ZNK13RApaLsSession21GetAcceptedConfidenceERi @ 262 NONAME
+	_ZNK13RApaLsSession21MatchesSecurityPolicyERi4TUidRK15TSecurityPolicy @ 263 NONAME
+	_ZNK13RApaLsSession21RecognizeSpecificDataERK5RFileRK9TDataTypeRi @ 264 NONAME
+	_ZNK13RApaLsSession21RecognizeSpecificDataERK7TDesC16RK6TDesC8RK9TDataTypeRi @ 265 NONAME
+	_ZNK13RApaLsSession22GetDefaultScreenNumberERi4TUid @ 266 NONAME
+	_ZNK13RApaLsSession22GetSupportedDataTypesLER13CArrayFixFlatI9TDataTypeE @ 267 NONAME
+	_ZNK13RApaLsSession23NumberOfOwnDefinedIconsE4TUidRi @ 268 NONAME
+	_ZNK13RApaLsSession24AppForDataTypeAndServiceERK9TDataType4TUidRS3_ @ 269 NONAME
+	_ZNK13RApaLsSession24AppForDocumentAndServiceERK5RFile4TUidRS3_R9TDataType @ 270 NONAME
+	_ZNK13RApaLsSession24AppForDocumentAndServiceERK7TDesC164TUidRS3_R9TDataType @ 271 NONAME
+	_ZNK13RApaLsSession25GetAppServiceOpaqueDataLCE4TUidS0_ @ 272 NONAME
+	_ZNK13RApaLsSession27GetServiceImplementationsLCE4TUid @ 273 NONAME
+	_ZNK13RApaLsSession27GetServiceImplementationsLCE4TUidRK9TDataType @ 274 NONAME
+	_ZNK13RApaLsSession36CancelListPopulationCompleteObserverEv @ 275 NONAME
+	_ZNK13RApaLsSession38RegisterListPopulationCompleteObserverER14TRequestStatus @ 276 NONAME
+	_ZNK13RApaLsSession7VersionEv @ 277 NONAME
+	_ZNK13RApaLsSession8AppCountERi @ 278 NONAME
+	_ZNK13RApaLsSession9IsProgramERK7TDesC16Ri @ 279 NONAME
+	_ZNK15CApaAppViewData10IconSizesLEv @ 280 NONAME
+	_ZNK15CApaAppViewData10ScreenModeEv @ 281 NONAME
+	_ZNK15CApaAppViewData12IconFileNameEv @ 282 NONAME
+	_ZNK15CApaAppViewData14NonMbmIconFileEv @ 283 NONAME
+	_ZNK15CApaAppViewData3UidEv @ 284 NONAME
+	_ZNK15CApaAppViewData4IconERK5TSize @ 285 NONAME
+	_ZNK16CApaMaskedBitmap12ExternalizeLER12RWriteStream @ 286 NONAME
+	_ZNK16CApaMaskedBitmap4MaskEv @ 287 NONAME
+	_ZNK17CApaSystemControl12ShortCaptionEv @ 288 NONAME
+	_ZNK17CApaSystemControl4IconEv @ 289 NONAME
+	_ZNK17CApaSystemControl4TypeEv @ 290 NONAME
+	_ZNK17CApaSystemControl7CaptionEv @ 291 NONAME
+	_ZNK17CApaSystemControl8FileNameEv @ 292 NONAME
+	_ZNK18TApaAppServiceInfo10OpaqueDataEv @ 293 NONAME
+	_ZNK18TApaAppServiceInfo3UidEv @ 294 NONAME
+	_ZNK18TApaAppServiceInfo9DataTypesEv @ 295 NONAME
+	_ZNK18TApaPictureFactory11NewPictureLER14TPictureHeaderRK12CStreamStore @ 296 NONAME
+	_ZNK19CApaWindowGroupName10IsAppReadyEv @ 297 NONAME
+	_ZNK19CApaWindowGroupName14DocNameIsAFileEv @ 298 NONAME
+	_ZNK19CApaWindowGroupName15WindowGroupNameEv @ 299 NONAME
+	_ZNK19CApaWindowGroupName18SetWindowGroupNameER12RWindowGroup @ 300 NONAME
+	_ZNK19CApaWindowGroupName23RespondsToShutdownEventEv @ 301 NONAME
+	_ZNK19CApaWindowGroupName26RespondsToSwitchFilesEventEv @ 302 NONAME
+	_ZNK19CApaWindowGroupName6AppUidEv @ 303 NONAME
+	_ZNK19CApaWindowGroupName6HiddenEv @ 304 NONAME
+	_ZNK19CApaWindowGroupName6IsBusyEv @ 305 NONAME
+	_ZNK19CApaWindowGroupName7CaptionEv @ 306 NONAME
+	_ZNK19CApaWindowGroupName7DocNameEv @ 307 NONAME
+	_ZNK19CApaWindowGroupName8IsSystemEv @ 308 NONAME
+	_ZNK21CApaSystemControlList5CountEv @ 309 NONAME
+	_ZNK21CApaSystemControlList5IndexE4TUid @ 310 NONAME
+	_ZNK21CApaSystemControlList7ControlE4TUid @ 311 NONAME
+	_ZNK21CApaSystemControlList7ControlEi @ 312 NONAME
+	_ZNK27CDataRecognitionResultArray12GetFileNameLER4TBufILi256EEj @ 313 NONAME
+	_ZNK27CDataRecognitionResultArray25GetDataRecognitionResultLER22TDataRecognitionResultj @ 314 NONAME
+	_ZNK27CDataRecognitionResultArray4PathEv @ 315 NONAME
+	_ZNK27CDataRecognitionResultArray5CountEv @ 316 NONAME
+	_ZNK8CApaDoor7AppUidLEv @ 317 NONAME
+	_ZNK8TApaTask4WgIdEv @ 318 NONAME
+	_ZNK8TApaTask6ExistsEv @ 319 NONAME
+	_ZNK8TApaTask8ThreadIdEv @ 320 NONAME
+	_ZN17CApaSecurityUtils16CheckAppSecurityERK7TPtrC16RiS3_ @ 321 NONAME
+	_ZN11CApaAppData11SetCaptionLERK7TDesC16 @ 322 NONAME
+	_ZN11CApaAppData9SetIconsLERK7TDesC16i @ 323 NONAME
+	_ZTI11CApaAppData @ 324 NONAME
+	_ZTI11CApaAppList @ 325 NONAME
+	_ZTI12CApaAppEntry @ 326 NONAME
+	_ZTI13RApaLsSession @ 327 NONAME
+	_ZTI14CApaAIFCaption @ 328 NONAME
+	_ZTI15CApaAIFViewData @ 329 NONAME
+	_ZTI15CApaAppInfoFile @ 330 NONAME
+	_ZTI15CApaAppViewData @ 331 NONAME
+	_ZTI15CApaIconPicture @ 332 NONAME
+	_ZTI16CApaMaskedBitmap @ 333 NONAME
+	_ZTI16TDesCArrayFiller @ 334 NONAME
+	_ZTI16TSizeArrayFiller @ 335 NONAME
+	_ZTI17CApaAppInfoReader @ 336 NONAME
+	_ZTI17CApaSystemControl @ 337 NONAME
+	_ZTI18TApaPictureFactory @ 338 NONAME
+	_ZTI19CApaAppInfoReaderV2 @ 339 NONAME
+	_ZTI19CApaAppListNotifier @ 340 NONAME
+	_ZTI19CApaWindowGroupName @ 341 NONAME
+	_ZTI20TViewDataArrayFiller @ 342 NONAME
+	_ZTI21CApaAppInfoFileReader @ 343 NONAME
+	_ZTI21CApaAppInfoFileWriter @ 344 NONAME
+	_ZTI21CApaSystemControlList @ 345 NONAME
+	_ZTI21CAsyncFileRecognition @ 346 NONAME
+	_ZTI22CApaLsSessionExtension @ 347 NONAME
+	_ZTI23MApaAppListServObserver @ 348 NONAME
+	_ZTI27CDataRecognitionResultArray @ 349 NONAME
+	_ZTI30CApaAppServiceInfoArrayWrapper @ 350 NONAME
+	_ZTI32CDataRecognitionResultArrayEntry @ 351 NONAME
+	_ZTI33CApaLocalisableResourceFileWriter @ 352 NONAME
+	_ZTI34CApaRegistrationResourceFileWriter @ 353 NONAME
+	_ZTI7HBufBuf @ 354 NONAME
+	_ZTI8CApaDoor @ 355 NONAME
+	_ZTIN26CApaResourceFileWriterBase11RBufferSinkE @ 356 NONAME
+	_ZTV11CApaAppData @ 357 NONAME
+	_ZTV11CApaAppList @ 358 NONAME
+	_ZTV12CApaAppEntry @ 359 NONAME
+	_ZTV13RApaLsSession @ 360 NONAME
+	_ZTV14CApaAIFCaption @ 361 NONAME
+	_ZTV15CApaAIFViewData @ 362 NONAME
+	_ZTV15CApaAppInfoFile @ 363 NONAME
+	_ZTV15CApaAppViewData @ 364 NONAME
+	_ZTV15CApaIconPicture @ 365 NONAME
+	_ZTV16CApaMaskedBitmap @ 366 NONAME
+	_ZTV16TDesCArrayFiller @ 367 NONAME
+	_ZTV16TSizeArrayFiller @ 368 NONAME
+	_ZTV17CApaAppInfoReader @ 369 NONAME
+	_ZTV17CApaSystemControl @ 370 NONAME
+	_ZTV18TApaPictureFactory @ 371 NONAME
+	_ZTV19CApaAppInfoReaderV2 @ 372 NONAME
+	_ZTV19CApaAppListNotifier @ 373 NONAME
+	_ZTV19CApaWindowGroupName @ 374 NONAME
+	_ZTV20TViewDataArrayFiller @ 375 NONAME
+	_ZTV21CApaAppInfoFileReader @ 376 NONAME
+	_ZTV21CApaAppInfoFileWriter @ 377 NONAME
+	_ZTV21CApaSystemControlList @ 378 NONAME
+	_ZTV21CAsyncFileRecognition @ 379 NONAME
+	_ZTV22CApaLsSessionExtension @ 380 NONAME
+	_ZTV23MApaAppListServObserver @ 381 NONAME
+	_ZTV27CDataRecognitionResultArray @ 382 NONAME
+	_ZTV30CApaAppServiceInfoArrayWrapper @ 383 NONAME
+	_ZTV32CDataRecognitionResultArrayEntry @ 384 NONAME
+	_ZTV33CApaLocalisableResourceFileWriter @ 385 NONAME
+	_ZTV34CApaRegistrationResourceFileWriter @ 386 NONAME
+	_ZTV7HBufBuf @ 387 NONAME
+	_ZTV8CApaDoor @ 388 NONAME
+	_ZTVN26CApaResourceFileWriterBase11RBufferSinkE @ 389 NONAME
+	_ZN31TIconLoaderAndIconArrayForLeaks25TestIconCaptionOverridesLEv @ 390 NONAME
+	_ZN13RApaLsSession40ForceCommitNonNativeApplicationsUpdatesLEv @ 391 NONAME
+	_ZN11CApaAppList20AppListUpdatePendingEv @ 392 NONAME
+	_ZN11CApaAppList19UninstalledAppArrayEv @ 393 NONAME
+	
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/eabi/apstartu.def	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	_ZN12CApaAppStart4NewLEv @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/group/BLD.INF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,108 @@
+// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Application architecture
+// 
+//
+
+
+
+/**
+ @file
+ @test
+*/
+
+
+PRJ_PLATFORMS
+WINC DEFAULT
+
+PRJ_EXPORTS
+// test code only
+
+PRJ_MMPFILES
+// test code only
+
+PRJ_TESTMMPFILES
+// specify the .mmp files required for building any test programs here
+//
+// you can specify "manual" to denote that a test should be listed in a generated
+// batch file for running a group of tests which require user input during testing.
+// you can specify "support" to denote that a file is a test support file and shouldn't
+// be listed in a batch file for running a group of tests
+// By default, each test will be listed in a batch file for running a group of tests
+// which can be left to run without requiring watching over by the person running the tests,
+// i.e. tests where no user input is required.  The default will apply if neither "manual"
+// or "support" is specified.
+../tef/apparctestserver.MMP
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+//../tef/TAppInstall/TestAppInstall.mmp
+#endif// SYMBIAN_APPARC_APPINFO_CACHE
+//../tef/TDoNothingFileRecognizer_v2.mmp
+../tef/TSTAPP_embedded.MMP 	support
+../tef/TSTAPP_standalone.MMP	support
+//../tef/m_ctrl_v2.mmp	support
+//../tef/SimpleApparcTestApp.mmp	support
+//../tef/TEXE_V2.MMP 	support
+//../tef/TAppNotEmbeddable_v2.mmp support
+//../tef/TAppEmbeddable_embedded.mmp support
+//../tef/TAppEmbeddable_standalone.mmp support
+//../tef/TAppEmbeddableOnly_v2.mmp support
+//../tef/TAppEmbeddableUiOrStandAlone_embedded.mmp support
+//../tef/TAppEmbeddableUiOrStandalone_standalone.mmp support
+//../tef/TAppEmbeddableUiNotStandAlone_v2.mmp support
+//../tef/TStartDocApp_v2.mmp support
+//../tef/t_winchainChild.mmp support
+//../tef/t_winchainLaunch.mmp support
+//../tef/TLongUrlRecognizer_v2.mmp support
+//../tef/TRApaLsSessionStartAppTestRecognizer_v2.mmp support
+//../tef/TRApaLsSessionStartAppTestApp_v2.mmp support
+//../tef/tRuleBasedApps/tRuleBasedApp1.mmp support
+//../tef/tRuleBasedApps/tRuleBasedApp2.mmp support
+//../tef/tRuleBasedApps/tRuleBasedApp3.mmp support
+//../tef/tRuleBasedApps/tRuleBasedApp4.mmp support
+//../tef/TCmdLineExe.mmp 	support
+//../tef/TApparcTestApp.mmp support
+//../tef/TTestEcomFileRec.mmp support
+//../tef/TAppLaunchChecker.mmp support
+//../tef/TAppLaunchChecker2.mmp support
+//../tef/TNonNativeAppLaunchChecker.mmp support
+//../tef/app_CTRL.MMP
+//../tef/app_CTRL2.MMP
+//../tef/T_EnvSlots/T_EnvSlots.MMP
+//../tef/TESTREC/TESTREC.MMP
+//../tef/ParentProcess.mmp
+//../tef/ChildI.mmp
+//../tef/ChildII.mmp
+//../tef/ChildIII.mmp
+//../tef/tssaac/tssaac.mmp
+//../tef/tssaac/tssaac_tapp.mmp
+//../tef/T_DataPrioritySystem1/T_DataPrioritySystem1.MMP
+//../tef/T_DataPrioritySystem2/T_DataPrioritySystem2.MMP
+//../tef/TBufferOnlyRec/TBufferOnlyRec.mmp
+//../tef/TNonNative/TNonNativeRec.mmp
+//../tef/TNonNative/TNNApp1.mmp
+//../tef/TNonNative/TNNApp2.mmp
+//../tef/TSidChecker/TestSidChecker.mmp
+//../tef/TMimeRec/recmime.MMP
+//../tef/TEndTaskTestApp/EndTaskTestApp.mmp
+//../tef/tlargestack/tlargestackapp.mmp
+//../tef/UnProctectedUidApp.mmp	support
+../tef/TIconLoaderAndIconArrayForLeaks.mmp
+//../tef/tupgradeiconapp/tupgradeiconapp.mmp
+//../tef/tnotifydrivesapp/tnotifydrivesapp.mmp
+//../tef/ticoncaptionoverride.mmp
+//../tef/trecupgrade/recupgrade.mmp
+
+PRJ_TESTEXPORTS
+../tef/scripts/smoketest_language.script            		z:/smoketest/smoketest_language.script
+../tef/scripts/setup_smoketest_language.script            	z:/smoketest/setup_smoketest_language.script
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/group/ExeMove.mk	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,216 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of the License "Symbian Foundation License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+EXESOURCEDIR = %EPOCROOT%epoc32\release\winscw\udeb
+EXEDESTDIR = %EPOCROOT%epoc32\release\$(PLATFORM)\udeb\z\HelloV2_C
+EXEDESTDIR_CONTENTS = $(EXEDESTDIR)\*.*
+EMPTYDIR = %EPOCROOT%epoc32\release\$(PLATFORM)\udeb\z\System\data\Testpath\Empty
+
+EXENAME = HelloV2_C.exe
+REGNAME = HelloV2_C_reg.rsc
+RSRCNAME = HelloV2_C.rsc
+
+EXENAME_Z = HelloV2.exe
+
+SADEXENAME = HelloV2NoIke.exe
+SADREGNAME = HelloV2NoIke_reg.rsc
+
+MBMNAME = HelloV2_C_icon.mbm
+MBMNAME_DEFAULT_ROOT = default_app_icon.mbm
+MBMNAME_C_APP_ROOT = HelloV2_C_icon.mbm
+MBMNAME_Z_APP_ROOT = HelloV2_icon.mbm
+MBMNAME_Z_APP_NOIKE_ROOT = HelloV2NoIkeIcon.mbm
+
+RSRCAPPSPATH = %EPOCROOT%epoc32\winscw\c\Resource\Apps
+RSRCPATH = %EPOCROOT%epoc32\winscw\c\Resource
+REGPATH = %EPOCROOT%epoc32\winscw\c\private\10003a3f\Apps
+
+ALTICONSDIR = %EPOCROOT%epoc32\winscw\c\AltIcons
+ALTICONSCONTENTS = $(ALTICONSDIR)\*.*
+ALTICONSDIR_Z = %EPOCROOT%epoc32\winscw\c\AltIcons\Z
+ALTICONSCONTENTS_Z = $(ALTICONSDIR)\Z\*.*
+
+ALTICONS_REPOSITORY = %EPOCROOT%epoc32\release\$(PLATFORM)\udeb\z\IconStore
+ALTICONS_REPOSITORY_CONTENTS = $(ALTICONS_REPOSITORY)\*.*
+ALTICONS_MBMNAME_C_APP = HelloV2_C_icon.mbm
+ALTICONS_SOURCE_MBMNAME_C_APP = ..\tsrc\HelloV2_C\AltIcon\$(ALTICONS_MBMNAME_C_APP)
+ALTICONS_MBMNAME_Z_APP = HelloV2_icon.mbm
+ALTICONS_SOURCE_MBMNAME_Z_APP = ..\tsrc\HelloV2\AltIcon\$(ALTICONS_MBMNAME_Z_APP)
+ALTICONS_SOURCE_MBMNAME_Z_APP_NOIKE = ..\tsrc\HelloV2NoIke\HelloV2NoIkeIcon.mbm
+ALTICONS_MBMNAME_Z_APP_NOIKE = HelloV2NoIkeIcon.mbm
+ALTICONS_MBMNAME_DEFAULT_ICON = default_app_icon.mbm
+ALTICONS_SOURCE_MBMNAME_DEFAULT_ICON = ..\tsrc\HelloV2NoIke\default_app_icon.mbm
+
+SYSDIR = %EPOCROOT%epoc32\winscw\c\sys
+BINDIR = $(SYSDIR)\bin
+SYSDIR_Z = %EPOCROOT%epoc32\release\winscw\udeb\z\sys
+BINDIR_Z = $(SYSDIR_Z)\bin
+
+ROMBUILD_TEMP = %EPOCROOT%epoc32\release\IconsTemp
+ROMBUILD_TEMP_CONTENTS = %EPOCROOT%epoc32\release\IconsTemp\*.*
+
+CROOTDIR = %EPOCROOT%epoc32\winscw\c
+
+MAKMAKE FREEZE LIB CLEANLIB RESOURCE RELEASABLES BLD SAVESPACE:
+
+!IF ("$(PLATFORM)" == "WINSCW")
+
+FINAL :
+#	Make the C-based-app file repository on Z
+	echo Creating $(EXEDESTDIR) for $(PLATFORM)
+	-mkdir $(EXEDESTDIR) 2>NUL
+	echo .
+
+#	Move the C-based exe from the release directory to the app-file repository on Z
+	echo Moving $(EXENAME) for $(PLATFORM) to $(EXEDESTDIR)
+	-move $(EXESOURCEDIR)\$(EXENAME) $(EXEDESTDIR)\$(EXENAME)
+	echo .
+
+#	Make the folder on C for resource files
+	echo Creating $(RSRCAPPSPATH)
+	-mkdir $(RSRCPATH)
+	-mkdir $(RSRCAPPSPATH)
+	echo .
+
+#	Make the folder on C for registration files
+	echo Creating $(REGPATH)
+	-mkdir $(REGPATH)
+	echo .
+
+#	Move the Z-based exe from the release directory to the sys\bin on Z
+	echo Moving $(EXENAME_Z) for $(PLATFORM) to $(BINDIR_Z)\$(EXENAME_Z)
+	-move $(EXESOURCEDIR)\$(EXENAME_Z) $(BINDIR_Z)\$(EXENAME_Z)
+	echo .
+
+	echo Copying the Alt-Icons to repository on Z
+	-mkdir $(ALTICONS_REPOSITORY)
+	-copy $(ALTICONS_SOURCE_MBMNAME_C_APP) $(ALTICONS_REPOSITORY)\$(ALTICONS_MBMNAME_C_APP)
+	-copy $(ALTICONS_SOURCE_MBMNAME_Z_APP) $(ALTICONS_REPOSITORY)\$(ALTICONS_MBMNAME_Z_APP)
+	-copy $(ALTICONS_SOURCE_MBMNAME_Z_APP_NOIKE) $(ALTICONS_REPOSITORY)\$(ALTICONS_MBMNAME_Z_APP_NOIKE)
+	-copy $(ALTICONS_SOURCE_MBMNAME_DEFAULT_ICON) $(ALTICONS_REPOSITORY)\$(ALTICONS_MBMNAME_DEFAULT_ICON)
+
+#	Create 'Empty' folder for T_Serv2 tests
+	echo Creating $(EMPTYDIR) for $(PLATFORM)
+	-mkdir $(EMPTYDIR) 2>NUL
+	echo .
+
+
+CLEAN :
+#	Removing files from drive Z, the C-app-file repository
+    echo Deleting $(EXEDESTDIR_CONTENTS) for $(PLATFORM)
+    -del /q $(EXEDESTDIR_CONTENTS) 2>NUL
+	echo .
+
+#	Remove the drive Z, C-app-file repository
+	echo Removing $(EXEDESTDIR) if empty for $(PLATFORM)
+    -rmdir $(EXEDESTDIR) 2>NUL
+	echo .
+
+#	Remove the Z-based exe from the bin directory
+    echo Deleting $(BINDIR_Z)\$(EXENAME_Z) for $(PLATFORM)
+    -del $(BINDIR_Z)\$(EXENAME_Z) 2>NUL
+	echo .
+
+#	Remove the C-based exe from the bin directory
+    echo Deleting $(BINDIR)\$(EXENAME) for $(PLATFORM)
+    -del $(BINDIR)\$(EXENAME) 2>NUL
+	echo .
+
+	echo Removing $(BINDIR) if empty for $(PLATFORM)
+    -rmdir $(BINDIR) 2>NUL
+	echo .
+
+	echo Removing $(SYSDIR) if empty for $(PLATFORM)
+    -rmdir $(SYSDIR) 2>NUL
+	echo .
+
+#	Remove the alt-icon files  for Z-based apps
+	echo Deleting $(ALTICONSCONTENTS_Z) for $(PLATFORM)
+	-del /q $(ALTICONSCONTENTS_Z)
+	echo .
+
+	echo Removing $(ALTICONSDIR_Z) directory for $(PLATFORM)
+	-rmdir $(ALTICONSDIR_Z)
+	echo .
+
+#	Remove the alt-icon files  for C-based apps
+	echo Deleting $(ALTICONSCONTENTS) for $(PLATFORM)
+	-del /q $(ALTICONSCONTENTS)
+	echo .
+
+	echo Removing $(ALTICONSDIR) directory for $(PLATFORM)
+	-rmdir $(ALTICONSDIR)
+	echo .
+
+	echo Removing the alt-icons repository
+	-del /q $(ALTICONS_REPOSITORY_CONTENTS)
+	-rmdir $(ALTICONS_REPOSITORY)
+	echo .
+
+#	Uninstall the C-based app
+	echo Deleting registration file $(REGPATH)\$(REGNAME) for $(PLATFORM)
+	-del $(REGPATH)\$(REGNAME)
+	echo .
+
+	echo Removing $(REGPATH) if empty for $(PLATFORM)
+	-rmdir $(REGPATH) 
+	echo .
+
+	echo Removing $(RSRCAPPSPATH)\$(RSRCNAME) for $(PLATFORM)
+	-del $(RSRCAPPSPATH)\$(RSRCNAME)
+	echo .
+
+	echo Deleting $(RSRCAPPSPATH)\$(MBMNAME) for $(PLATFORM)
+	-del $(RSRCAPPSPATH)\$(MBMNAME)
+	echo .
+
+	echo Removing $(RSRCAPPSPATH) if empty for $(PLATFORM)
+	-rmdir $(RSRCAPPSPATH)
+	echo .
+
+	echo Removing $(RSRCPATH) if empty for $(PLATFORM)
+	-rmdir $(RSRCPATH)
+	echo .
+
+	echo Deleting MBM files in the root of emulated drive-C
+	echo .
+	echo $(CROOTDIR)\$(MBMNAME_DEFAULT_ROOT)
+	-del $(CROOTDIR)\$(MBMNAME_DEFAULT_ROOT)
+	echo $(CROOTDIR)\$(MBMNAME_DEFAULT_ROOT)
+	-del $(CROOTDIR)\$(MBMNAME_C_APP_ROOT)
+	echo $(CROOTDIR)\$(MBMNAME_DEFAULT_ROOT)
+	-del $(CROOTDIR)\$(MBMNAME_Z_APP_ROOT)
+	echo $(CROOTDIR)\$(MBMNAME_Z_APP_NOIKE_ROOT)
+	-del $(CROOTDIR)\$(MBMNAME_Z_APP_NOIKE_ROOT)
+	echo .
+
+#	Remove the "Empty" dir from the drive Z
+	echo Removing $(EMPTYDIR) if empty for $(PLATFORM)
+    -rmdir $(EMPTYDIR) 2>NUL
+	echo .
+!ELSE
+FINAL :
+	echo Copying AltIcons to temp directory
+	-mkdir $(ROMBUILD_TEMP) 2>NUL
+	-copy $(ALTICONS_SOURCE_MBMNAME_C_APP)	$(ROMBUILD_TEMP)
+	-copy $(ALTICONS_SOURCE_MBMNAME_Z_APP) $(ROMBUILD_TEMP)
+	-copy $(ALTICONS_SOURCE_MBMNAME_Z_APP_NOIKE) $(ROMBUILD_TEMP)
+	-copy $(ALTICONS_SOURCE_MBMNAME_DEFAULT_ICON) $(ROMBUILD_TEMP)	
+CLEAN :
+	-del /q $(ROMBUILD_TEMP_CONTENTS) 2>NUL
+	-rmdir $(ROMBUILD_TEMP) 2>NUL
+
+!ENDIF
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/group/RELEASE.TXT	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,2677 @@
+AppArc 1.2.118
+--------------
+Released by MattM
+
+Upgraded to new E32TOOLS and E32TOOLP
+
+Updated bld.inf file to add support to support testcode, and corrected 
+controlpanel .def file exports.
+
+This release is not BC or SC due to: 
+
+the fix for EDNATHE-488DCR (increase in the size of a class, as a fix for 
+potential recurring panics) 
+
+EDNATHE-464JPQ has breaks SC and BC
+
+Fixed: 
+ER5 deferred defects
+EDN761578 Recent Files list has gone
+EDNBWHE-45UCS4 Need to reset shell after changing "text/html" mapping
+EDNATHE-462DBT Control panel DLLs are not unloaded
+EDNATHE-488DCR Recogniser names restricted to 12 characters
+EDNATHE-464JPQ CApaAppInfoFile classes create temporary RFs connections
+EDN779965 Dangerous code in CApaFsMonitor::Start()
+
+
+
+AppArc 1.2.117
+--------------
+Released by SimonC on 09 July 1999
+
+Binary and source compatible with 116
+
+Fixed EDNDMAY-49CDSX "Need to remove call to deprecated function"
+Various changes to MNT to remove all references to narrow releasables.
+
+No test code run due to the lack of changes
+
+Apparc 1.2.116
+--------------
+Re-released for automated build process
+
+AppArc 1.2.114
+--------------
+Built by SimonC on 10 Feb 1999
+
+Fixed EDN557946 "CApaFsMonitor uses the wrong form of RFs::NotifyChangeCancel"
+
+AppArc 1.2.113
+--------------
+Built by MattM on 29 Jan 1999
+
+Fixed
+Not found error after installing application
+
+AppArc 1.2.112
+--------------
+Built by MattM on 19 Jan 1999
+
+Fixed
+EDN062791 Default app can be wrong
+EDN923095 RDL recognisers didn't work immediately after installation
+EDN173648 Problem with RApaLsSession::AppForDataType
+
+AppArc 1.2.111
+--------------
+Built by MattM on 13 Jan 1999
+
+Fixed
+EDN537499 Panic attempting to view directory with unknown App file
+EDN116503 CApaProcess::SetMainDocFileName does not allow clearing of the file name
+
+AppArc 1.2.110
+--------------
+Built by MattM on
+
+Changed priority of AppArc server to EPriorityAbsoluteForeground
+Changed scanning active object from CIdle to CPeriodic, with a small pause
+between each scanning unit (to allow lower priority threads a lookin)
+
+Fixed
+EDN736553 Machine completely* locks up
+EDN851148 Panic on Startup which locks the machine
+
+AppArc 1.2.109
+--------------
+Built by MattM on 5 December 1998
+
+Changed priority of AppArc server to nearer priority of EIKSRV.
+
+Fixed
+EDN833327 MRU list doesn't work if the C:\system\data directory doesn't exist.
+EDN060924 Deleting mru.dat stops the mru-list coming up
+EDN349934 Recent files does not work if there's no c:\System\Data\ directory
+EDN572427 "mru.dat" should be "Mru.dat"
+EDN951003 Recently used files list is case-sensitive
+EDN969635 DataType may not be reported correctly
+
+AppArc 1.2.108
+--------------
+Built by MattM on 26 November 1998
+
+SW1-427 IsProgram() return value can be incorrect
+SW1-400 AppArc doesn't handle even-numbered tailend lengths correctly.
+SW1-413 Shell is too slow
+SW1-455 Apparc is too hard to fetch
+
+AppArc 1.2.107
+--------------
+Built by MattM on 12 November 1998
+
+Added Base addresses for all new DLL's
+
+EPOC Software Problems
+SW1-329 AppArc doesn't set TailEnd length.
+SW1-330 RECAPP doesn't recognize narrow build documents on wide build machines
+SW1-195 APSEXE.DLL WINS base address clashes with that of EIKSRV.DLL
+SW1-306 Missing #defines
+SW1-287 #defines should be replaced by literal descriptors
+
+AppArc 1.2.106
+--------------
+Built by MattM on 30 October 1998
+
+Deb/rel and unicode Uid release.
+
+UID fest from AppArc is here:
+
+Control panel items:
+uid			0x10000297
+unicodeuid	0x10003A34
+
+Applications
+uid			0x1000006c
+unicodeuid	0x100039CE
+
+Application data files
+uid			0x1000006d
+unicodeuid	0x10003A12
+
+Recognizers
+uid			0x1000013E
+unicodeuid	0x10003A37
+
+AIF files
+uid			0x1000006a
+unicodeuid	0x10003A38
+
+AppArc 1.2.105
+--------------
+Built by MattM on 28 October 1998
+
+Moved ApMime to EMIME project.
+
+AppArc 1.2.104
+--------------
+Built by MattM on 19 October 1998
+
+Breaks BC for UNICODE build users of CApaCommandLine::TailEnd.  Previously this 
+had a TDes16 interface, now it has a TDes8 interface in both builds.  This 
+reflects the intended usage, the passing of binary data to applications.
+
+The client interface to RApaLsSession now attempts reconnection if the server 
+terminates during an open session.
+
+AppArc server now uses the new fileserver notification to minimise
+rescanning of drives, and the new fileserver read functions to read
+the first few bytes from a file when identifying it's type.
+
+AppArc 1.2.103
+--------------
+Built by MattM on 24 September 1998
+
+This is a BETA release
+
+This build breaks BC for the new exports in build 100+
+
+Optimisations made to TDataType to enable Shell to perform cached lookup
+on UID'd types without resorting to server calls.
+
+AppArc 1.2.102
+--------------
+Built by MattM on 21 August 1998
+
+ONLY FOR USE BY APPS EG (and friends)
+
+This build breaks BC with the new exports added for build 101.
+
+Source compatability is maintained.
+
+Completed implementation of new server interface as per document 
+R:\apparc\dspec\Server API.rtf, please refer to that document for documentation.
+
+This build of AppArc is intended for use by development Shells 060+
+
+AppArc 1.2.101
+--------------
+Built by MattM on 28 July 1998
+
+Release valids on a clean drive
+
+This build is of BETA status, pending a design review of the AppArc server and Shell.
+
+The export in RApaLsSession UpdateDataRecognizerList() is likely to be removed in the
+future.
+
+1) Added Data type support to AIF files
+The following exports are new for R5:
+
+class CApaAppInfoFileReader
+	void DataTypesSupportedL(CArrayFix<TDataTypeWithPriority>& aTypeList) const;
+
+class CApaAppInfoFileWriter : public CApaAppInfoFile void AddDataTypeL(const 
+TDataTypeWithPriority& aTypePriority);
+
+Supported data types are stored in Application AIF files (which are fully data 
+compatible with R1 AIF files) along with a concept of "Priority" this is used 
+for resolving the current preferred handler of a data type, in the absence of 
+any user preferences.
+
+Data type priorities are defined in APMSTD.H and are:
+
+KDataTypePriorityUserSpecified
+KDataTypePriorityHigh
+KDataTypePriorityNormal
+KDataTypePriorityLow
+KDataTypePriorityLastResort
+
+Note, it's not legal for applications to specify KDataTypePriorityUserSpecified 
+in their AIF file, as this can't be overridden, and contrary to all the 
+available evidence, the user DOES know best.
+
+Extended test code to cope with new stuff
+
+2) Added Data Type to application map to APMIME
+
+The following (interesting) exports have been added compared to the APMIME 
+release in 100: (this isn't an all inclusive list, it's just the ones that are 
+of interest to AppArc clients)
+
+class CTypeStoreManager
+	static CTypeStoreManager* NewL(RFs& aFs);
+	// Persistence
+	void StoreL();
+	void RestoreL();
+	void InternalizeL(RReadStream& aStream);
+	void ExternalizeL(RWriteStream& aStream) const;
+	// Enquiry
+	void GetAppByDataType(const TDataType& aDataType, TUid& aUid) const;
+	void GetDataTypesByAppL(TUid aUid, CArrayFix<TDataType>* aTypeArray) const;
+	const CArrayFixFlat<TMappingDataTypeToApp>& MappingArray() const;
+	// Management
+	void InsertDataMappingL(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid);
+	TBool InsertIfHigherL(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid);
+	void DeleteDataMapping(const TDataType& aDataType);
+
+These can be used to query and amend the list of application/data type associations.
+
+3) Added TDataTypeWithPriority and priority utilities.
+
+For use in 1) and 2)
+
+4) Fixed T_SERV debug panics
+
+5) Added MIME type recognition to the AppArc Server, the following exports are 
+new:
+class RApaLsSession
+	TInt UpdateDataRecognizerList();
+	TInt RecognizeData(const TDesC& aName, const TDesC8& aBuffer, TDataRecognitionResult& aDataType);
+	TInt RecognizeSpecificData(const TDesC& aName, const TDesC8& aBuffer, const TDataType& aDataType, TBool& aResult);
+
+The Shell is responsible for ensuring the AppArc server is kept up to date with 
+respect of the recognizer list - clients shouldn't need to call 
+UpdateRecognizerList(), which due to the scanning efforts involved has a heavy 
+overhead.
+
+RecognizeData and RecognizeSpecificData will provide mime type information to 
+the client, based on the information supplied - the client must open the file if 
+this is appropriate.
+
+6) Added application launching to the AppArc server.
+
+This marks a change in the architecure of document launching.  It is strongly 
+recommended that launchers of applications use these new server calls to broker 
+all their application launching.
+
+There is also a slight change in the way recognizers use UID's, from now the 
+following is true:
+
+The 2nd Uid if a TUidType indicates the protocol used to launch the application.  
+This protocol must be uniquely implemented by a recognizer in a .RDL file, 
+derived from CApaRecognizerType, currently supported protocols are:
+The EIKON App protocol (KUidApp)
+The OPL protocol (KUidOplApp) released by the OPL runtime
+
+It's anticipated that Java will release an additional recognizer for Java 
+applications (KUidJavaApp)
+
+The 2nd Uid contained within an EPOC store file is used for type identification, 
+and is mapped on to a "TDataType" that can also handle internet standard MIME 
+types.
+
+Thus a CApaRecognizerType file can now expect to be called with a document file 
+name, but a TUidType that is different to the TUidType within that file (this is 
+to support the launching of, say, Agenda files by an OPL or Java based Agenda 
+file viewer)
+
+If no mime type mapping is available the CApaRecognizerType list will be called 
+as for ER1 releases, this is to fully support compatibility with ER1 style 3rd 
+party recognizers.
+
+The following exports are of interest:
+class RApaLsSession
+	TInt AppForDataType(const TDataType& aDataType, TUid& aAppUid);
+This returns the binding of application to DataType in aAppUid, if there is no 
+binding then the current "default" handler is returned.  If there is no handler
+a NULL uid is returned.
+
+	TInt StartDocument(const TDesC& aFileName, TThreadId& aId);
+This starts the document file of aFileName and returns the TThreadId of the 
+process.  The effect is the same as performing a RecognizeData on the file, 
+followed by a call to the next documented method.
+
+	TInt StartDocument(const TDesC& aFileName, const TDataType& aDataType, TThreadId& aId);
+This launches an application with a known data type, this is useful to clients 
+that already have data type information and wish to take advantage of this, and 
+avoid the overhead of performing a recognition on the file.  This uses the 
+current "preferred" handler of the data type, this may be specified by the user.  
+If another application is desired this must be chosen explictily using the 
+following method.  If no binding can be found for the data type the old style 
+recognition by the .RDL recognizers will be performed, if this doesn't get a 
+match KErrNotSupported will be returned.
+
+	TInt StartDocument(const TDesC& aFileName, TUid aAppUid, TThreadId& aId);
+This launches the filename with the supplied application. 
+
+7) Added Application icons to AppArc server, the relevant export here is:
+class RApaLsSession
+	TInt GetAppIcon(TUid aAppUid, TInt aSize, CApaMaskedBitmap& aAppBitmap);
+Size is a number between 0 and 2 inclusive, representing the smallest to largest
+icons for the application.  The actual size of these icons is dependent on the
+implementation, no scaling is performed.  Fully featured EPOC apps can be expected
+to supply 24,32 and 48 pixel icons on 1/2 VGA.
+
+8) Added test code, and less interesting utility functions for all the above.
+
+9) Added batch files for running test code - runtest.bat on MARM and runtestw [var]
+under WINS, these live in \apparc\tdata\
+
+10) Moved down to E32TOOLS 088 due to a defect in DEFMAKE
+
+All WINS variants pass tests
+All MARM varinats pass tests, with the exception of
+
+T_PRO and T_OOM which fail on MARM unicode
+
+These failures do not constitute a regression from AppArc 100
+
+AppArc 1.2.100
+==============
+Built by MattM on 3/7/98
+
+Jumped from 086 to 100 release to allow space for platform 4 revisions
+
+Changed interface in APMIME to "Data" in place of "Mime" allowing for greater 
+flexibility in use of "mime" types.  Retained name for DLL to ensure binary 
+compatibility.
+
+Fixed defect in APMFNDR as for APFFNDR - wins REL and UREL mime recognizer 
+loading did not work
+
+Updated ROM build files
+
+AppArc 1.1.86
+=============
+Built by MattM on 29/6/98
+
+Release valids on a clean drive.
+
+Removed incorrect mime getrel methods
+Fixed rom building scripts
+
+Fixes:
+SW1-544 WINS rel & urel recognisers don't work
+
+All 4 WINS and 4 MARM variants released and tested.
+
+The following tests pass on all variants:
+
+T_CMDLN, T_FILE, T_MDR, T_WGNAM, ICONTOOL
+
+The following tests have the documented failure conditions:
+
+T_MRU fails test 07 line 248 on all MARM variants (passes on WINS)
+T_OOM fails KERN-EXEC 3 on MARM Unicode variants (passes WINS and MARM narrow)
+T_SERV fails on all debug variants WINS and MARM (passes on release variants)
+T_PRO fails KERN-EXEC 3 on MARM Unicode variants (passes WINS and MARM narrow)
+
+None of these failures is a regression from AppArc 1.1.85
+
+AppArc 1.1.85
+=============
+
+Identical to 084 without MIME releases
+
+AppArc 1.1.84
+=============
+Built on 22/5/98 by MattM
+
+Changes following code review
+
+AppArc 1.1.83
+=============
+Built on 18/5/98 by MattM
+
+Added MIME type recognition
+
+Fixed AppArc DLL loading to allow unloading of AppArc DLLs due to deletion or 
+updating, however due to EPOC32 defect SW1-46 this remains broken, however as of 
+this release it's possible to unload recognizer DLL's by removing the DLL, then 
+waiting sufficient time for the Shell recognizer scanner to update it's list, 
+then 1 second later the AppArc server list will be updated.
+[an easy way is to Open/close a CF card door, this forces a full rescan]
+
+Fixed some VC5 warnings
+
+Fixed 
+SW1-957 Missing leave in AppArc
+
+Apparc 1.0.82
+=============
+
+Added extra support for Recent Files list for OPL apps.
+
+
+Apparc 1.0.80
+=============
+20/02/98 by Natascha
+
+Uses:	apparc.dll: E32[120] ; F32[090] ; Store[043] ; GDI[057]
+
+	apgrfx.dll: Fntstore[046] ; Fbserv[075] ; Bitgdi[062] ; Wserv[094]
+
+        Mimestor[002]
+
+Tools: E32Tools[082] ; E32Utils[014] ; GCCTOOLS[113]; GDITOOLS[039]
+EIKTOOLS[123]
+
+1) Rebuilt using correct Unicode components.
+
+Apparc 1.0.79
+=============
+19/02/98 by Natascha
+
+Uses:	apparc.dll: E32[119] ; F32[089] ; Store[043] ; GDI[053]
+
+	apgrfx.dll: Fntstore[043] ; Fbserv[075] ; Bitgdi[058] ; Wserv[090]
+
+Tools: E32Tools[082] ; E32Utils[014] ; GCCTOOLS[113]; GDITOOLS[039]
+EIKTOOLS[123]
+
+Made the following changes as a result of code review (by CharlesW).
+
+1) Changed CApaFileRecognizer::DoRecognizeAllApps() to
+DoRecognizeAllAppsL() since it is a leaving function.
+
+2) Use the more efficient InsertL() function to copy one array to
+another rather than AppendL() in a for loop.
+
+3) In CApaFileRecognizer::InsertAppIntoListL() the priority is now
+based primarily on the mime type priority, not an average of the app
+and mime type priorities.
+
+4) Put the mimestor manager on the Cleanup stack in
+CApaDataTypeRecognizer functions.
+
+5) Made the CApaFileRecognizerData class definition and member data
+private to CApaFileRecognizer.
+
+
+Apparc 1.0.78
+=============
+02/02/98 by Natascha
+
+Uses:	apparc.dll: E32[119] ; F32[089] ; Store[043] ; GDI[053]
+
+	apgrfx.dll: Fntstore[043] ; Fbserv[075] ; Bitgdi[058] ; Wserv[090]
+
+Tools: E32Tools[082] ; E32Utils[014] ; GCCTOOLS[113]; GDITOOLS[039]
+EIKTOOLS[123]
+
+Includes UNICODE release of all components.
+
+1) Changed over to new build system splitting mnt.cmd into ebld.bat
+and mnt.cmd and using makmake etc...
+
+2) Bug fix SW1-516: to speed up drawing of control panel moved the DLL loading into
+CApaSystemControl::CreateL() from CApaSystemControl::ConstructL()
+which was being called to build up the list of available controls. 
+Added member data iUidType and iFullPath.  This also means that OOM
+is less likely when bringing up the control panel.
+
+3) Bug fix SW1-451: in CApaScanningAppFinder::FindAllAppsL() set
+iDriveList=NULL after deleting it (spotted by MartinB).
+
+4) Bug fix SW1-566: in CApaScanningAppFinder destructor now delete
+iFileList.
+
+5) Bug fix SW1-620: in CApaScanningControlFinder::NextL() iFileIndex
+was only being reset to 0 if there was a drive in between which
+failed GetFileListL(); if 2 consecutive drives both had controls it
+was hit and miss whether all those on the second drive would be
+correctly picked up since it only started scanning the file list at
+the iFileIndex value at which the drive before had finished.  Fix is
+to set iFileIndex=0 at the same time as deleting iFileList.
+
+6) Extension to recognizer scheme: added class CApaUidlessRecognizerType
+which is there to recognize files that the uid-based recognizers
+fail to recognize.  This means that CApaFileRecognizer class now has
+a new private member *iData (before only 1 pointer so store all the
+new data in the one pointer to keep things BC) - iData contains
+iFileRecognizerList and iUidlessFileRecognizerList, and a list of
+mime types and supporting apps.  
+
+CApaFileRecognizer::RecognizeFileL() now works by calling the
+uid-based recognizers as usual, if none of them recognize the file 
+call all uidless recognizers, which can each add
+MIME types to the list, then picks the highest priority MIME type and
+finds the best app capable of handling that MIME type, if no apps are
+found to support the best MIME type keep going through the list until
+the best app is found, then call the uid based recognizer passing in the
+uid of the app.
+
+Various other functions for clients to call through
+CApaFileRecognizer class:
+
+RecognizeAllMimeTypesL()        - for file
+RecognizeAllAppsL()             - for file
+RecognizeBestAppL()             - for file
+RecognizeAllAppsByMimeType()    - for MIME type.
+
+Test code added to T_FILE to test some of the uidless recognizer
+functionality.
+
+7) Recognizer loading code changed to support the new uidless
+recognizers - in CApaScanningFileRecognizer class.
+
+8) A new uidless recognizer CApaDataTypeRecognizer which gets MIME
+types from the mimestor manager and apps from the mimestor manager
+and aif files.
+
+9) UNICODE releases for all components.
+
+10) CApaAppInfoFileReader and CApaAppInfoFileWriter classes changed to support
+the ability to specify supported MIME types in AIF files.
+
+
+AppArc 1.0.077
+==============
+
+22/07/97 by IanH
+
+Uses:	apparc.dll: E32[107] ; F32[074] ; Store[043] ; GDI[053]
+
+	apgrfx.dll: Fntstore[043] ; Fbserv[066] ; Bitgdi[058] ; Wserv[085]
+
+Tools: E32Tools[067] ; E32Utils[018] ; GCCTOOLS[113]
+
+General:
+
+Binary compatible with 065 - 076, but extends API (see 3)
+
+1) MNT no longer fetches non-existant WSERV MARMUD releasables (spotted by Natascha).
+
+2) MNT getdef extended to get WINS control.def's
+
+3) Two inline methods added to CApaDoorBase to get and set the already present protected member data iSource. 
+This is not a 1.01 change, more a platform improvement for the initial benefit of Nautilus.
+
+public:
+	inline TUid Source()const;
+	inline void SetSource(TUid aSource);
+protected:
+	TUid iSource; // foreign representation of a translated door (eg MS Word doc)
+
+4) Testcode T_MDR extended to test the above.
+
+
+
+AppArc 1.0.076
+==============
+
+16/07/97 by IanH
+
+Uses:	apparc.dll: E32[107] ; F32[074] ; Store[043] ; GDI[053]
+
+	apgrfx.dll: Fntstore[043] ; Fbserv[066] ; Bitgdi[058] ; Wserv[085]
+
+Tools: E32Tools[067] ; E32Utils[018] ; GCCTOOLS[113]
+
+General:
+
+Binary compatible with 065 - 075
+
+) Fixes CSW3-1386: Overriding of ROM apps doesnt work - the in ROM versions are still loaded instead of those in RAM. The fix ensures that the correct dll is loaded, but does not cache the new AIF data.
+
+) Fixes SW1-122: OPL programs don't run when copied from one disk to another. This was another manifestation of the above bug, and the fix carries the same proviso (though in this case it's meaningless as the data is the same - it was just copied between discs).
+
+) The above fixes left a couple of slight problems, and these have been noted in a new bug report SW1-134.
+
+
+
+AppArc 1.0.075
+==============
+
+10/07/97 by IanH
+
+Uses:	apparc.dll: E32[107] ; F32[074] ; Store[043] ; GDI[053]
+
+	apgrfx.dll: Fntstore[043] ; Fbserv[066] ; Bitgdi[058] ; Wserv[085]
+
+Tools: E32Tools[067] ; E32Utils[018] ; GCCTOOLS[113]
+
+General:
+
+Binary compatible with 065 - 074
+
+) Fixes SW3-1520 (showstopper): Apparc sometimes paniced if a document file was corrupt. Now it always leaves KErrCorrupt
+
+) Fixes CSW3-1680: Some code was taking the address of temporary TPtrC's returned from CApaCommandLine members. This was causing CApaLsSession::StartApp() to fail strangely in some circumstances, eg when trying to open the help database from EasyFax.
+
+) Fixes SW1-63: Synchronising agenda entries that countain embedded objects could lose the embedded objects entirely if the entry had been edited in eg Schedule+. Not any more though...
+
+) MNT VALID extended as per orders.
+
+
+
+AppArc 1.0.074
+==============
+
+4/06/97 by IanH
+
+Uses:	apparc.dll: E32[107] ; F32[074] ; Store[043] ; GDI[053]
+
+	apgrfx.dll: Fntstore[043] ; Fbserv[066] ; Bitgdi[058] ; Wserv[085]
+
+Tools: E32Tools[067] ; E32Utils[018] ; GCCTOOLS[113]
+
+General:
+
+Binary compatible with 065 - 073
+
+) Fixes SW3-1277: AIF's of plug=in controls were not being loaded, leaving all controls with default captions and icons. A showstopper for Babel.
+
+) MNT getrel tweaked.
+
+
+
+AppArc 1.0.073
+==============
+
+2/06/97 by IanH
+
+Uses:	apparc.dll: E32[107] ; F32[074] ; Store[043] ; GDI[053]
+
+	apgrfx.dll: Fntstore[043] ; Fbserv[066] ; Bitgdi[058] ; Wserv[085]
+
+Tools: E32Tools[067] ; E32Utils[018] ; GCCTOOLS[113]
+
+General:
+
+Binary compatible with 065 - 072
+
+) Fixes SW3-1041: MNT now unsets all environmental variables it uses
+
+) Fixes SW3-1048: CApaAppList::UpdateL() does not increment iUpdateCounter. At last the extras bar updates properly.
+
+
+
+
+
+
+AppArc 1.0.072
+==============
+
+27/05/97 by IanH
+
+Uses:	apparc.dll: E32[107] ; F32[074] ; Store[043] ; GDI[053]
+
+	apgrfx.dll: Fntstore[043] ; Fbserv[066] ; Bitgdi[058] ; Wserv[085]
+
+Tools: E32Tools[067] ; E32Utils[018] ; GCCTOOLS[113]
+
+General:
+
+Binary compatible with 065 - 071
+
+) Fixed SW3-950: CApaApplication:GenerateFileName() will PANIC with <long-name>(100) by increasing a temp descriptors length by 4 bytes
+
+) Fixed SW3-1002: App list not always marked changed when it should be. Now it is.
+
+
+
+AppArc 1.0.071
+==============
+
+27/05/97 by IanH
+
+Uses:	apparc.dll: E32[107] ; F32[074] ; Store[043] ; GDI[053]
+
+	apgrfx.dll: Fntstore[043] ; Fbserv[066] ; Bitgdi[058] ; Wserv[085]
+
+Tools: E32Tools[067] ; E32Utils[018] ; GCCTOOLS[113]
+
+General:
+
+Binary compatible with 065 - 070
+
+) Upgraded to C-001 level dependancies.
+
+) Eradicated all "taking address of temporary" warnings caused by passing &_L("") descriptors into TParse::Set() by creating temporary variables of type TPtrC. 
+
+) Checked that all major mnt commands work properly.
+
+) App list server version number incremented (I forgot to do this in the last release)
+
+) Fixed SW3-125: Changes to AIF files weren't being picked up by the cached app list.
+The list now caches the time stamp of each app's AIF - if this changes between scans then the data is re-read.
+If the AIF disappears, the icons & caption are reset to the defaults.
+
+) Fixed SW-5483: Password protected documents not handled gracefully under WINC.
+Model doors tried to restore encrypted documents without decrypting them first, leading to death. 
+Now encrypted docs are not restored, instead their container stores are just kept kicking about, ready to be written out again.
+This will allow Nautilus' Agenda synchronizer to deal with passworded memos tidily.
+
+
+
+
+AppArc 1.0.070
+==============
+
+23/05/97 by IanH
+
+Uses:	apparc.dll: E32[105] ; F32[072] ; Store[042] ; GDI[051]
+
+	apgrfx.dll: Fntstore[042] ; Fbserv[063] ; Bitgdi[056] ; Wserv[083]
+
+Tools: E32Tools[066] ; E32Utils[014] ; GCCTOOLS[113]
+
+General:
+
+Binary compatible with 065 - 069
+
+) Fixed a bug in the recognizer list where in copying recognizers from one list to another the wrong extension was being appended to recognizer dll names and so they were failing to load.
+Involved adding one line of code that parsed in the absent .RDL extension. (spotted by Bill)
+
+
+
+AppArc 1.0.069
+==============
+
+21/05/97 by IanH
+
+Uses:	apparc.dll: E32[105] ; F32[072] ; Store[042] ; GDI[051]
+
+	apgrfx.dll: Fntstore[042] ; Fbserv[063] ; Bitgdi[056] ; Wserv[083]
+
+Tools: E32Tools[066] ; E32Utils[014] ; GCCTOOLS[113]
+
+General:
+
+Binary compatible with 065 - 068
+
+) The data cached by the recognizer list to avoid calls to RLibrary wasn't actually being taken advantage of, meaning that the Shell couldn't atke advantage of these methods. 
+The cached data is now used whereever possible (spotted by Bill). 
+Changes made to CApaScanningFileRecognizer::operator[] and CApaScanningFileRecognizer::RecognizerListLC()
+
+
+
+
+
+
+
+AppArc 1.0.068
+==============
+
+21/05/97 by IanH
+
+Uses:	apparc.dll: E32[105] ; F32[072] ; Store[042] ; GDI[051]
+
+	apgrfx.dll: Fntstore[042] ; Fbserv[063] ; Bitgdi[056] ; Wserv[083]
+
+Tools: E32Tools[066] ; E32Utils[014] ; GCCTOOLS[113]
+
+General:
+
+Binary compatible with 065 - 067
+
+) SW3-305 fixed: CApaAppList::Update() and Purge() fixed so that overriding of built-in apps works properly.
+
+) Loading/unloading/overriding of file recognizer dlls fixed. This has necessitated a couple of API changes:
+
+Two new exported methods on CApaFileRecognizerType - Lock() and Unlock().
+When CApaFileRecognizer::RecognizeFileL() is called and a particular type recognizer returned, this object should be Lock()'ed immediately, and should only be Unlock()'ed when you've finished using it.
+This will ensure the dll is not unloaded while you are using it. This change in usage will only affect the Shell.
+
+The protected method IMPORT_C TInt CApaFileRecognizer::RemoveFileRecognizerType(const CApaFileRecognizerType* aFileRecognizerType) added to allow recognizers to be removed from the list before their dll's are unloaded.
+
+
+
+
+
+
+
+AppArc 1.0.067
+==============
+
+19/05/97 by IanH
+
+Uses:	apparc.dll: E32[105] ; F32[072] ; Store[042] ; GDI[051]
+
+	apgrfx.dll: Fntstore[042] ; Fbserv[063] ; Bitgdi[056] ; Wserv[083]
+
+Tools: E32Tools[066] ; E32Utils[014] ; GCCTOOLS[113]
+
+General:
+
+Binary compatible with 065 and 066
+
+From Neil:
+
+) Fixed SW3-347: EXEs don't die properly when killed by the shell - all memory is now freed.
+
+) Fixed SW3-362: TApaTask::EndTask(TTimeIntervalMicroSeconds32 aDelay, TRequestStatus& aStatus) is flawed.
+It loses its two parameters, and no longer waits to see if an app responds to the shutdown message, offering to kill it if it does not.
+This behaviour was flawed because so apps where taking longer than the time limit to save their doc's before exiting, and so where being mistakenly identified as hung and were being shot.
+Changes made to the .def and .frx files to remove the parameters - only Eikon need rebuild.
+
+From Ian:
+
+) Optimisations of CApaDoor::SetFormatToIcon() code have brought a 100% speed increase for both creating and restoring doors.
+The changes included using the app list server to avoid scanning the filesystem when possible, and cutting down my use of AIF files (they are now loaded once instead of twice).
+
+) Fixed SW3-373: CreateControl should be CreateControlL(). control def & frz files altered accordingly.
+
+) Fixed SW3-424: AppListServer version numbers incorrect.
+
+) CApaScanningFileRecognizer now caches recognizers uid, drive and name so that this information can be returned to callers in other threads (the alternative, using RLibrary, will not work in this case). 
+This fix facilitates the Shell's use of this class.
+
+) "Profile" testcode added that profiles various aspects of apparc.
+
+
+
+
+
+
+
+AppArc 1.0.066
+==============
+
+15/05/97 by IanH
+
+Uses:	apparc.dll: E32[105] ; F32[072] ; Store[042] ; GDI[051]
+
+	apgrfx.dll: Fntstore[042] ; Fbserv[063] ; Bitgdi[056] ; Wserv[083]
+
+Tools: E32Tools[066] ; E32Utils[014] ; GCCTOOLS[113]
+
+General:
+
+Binary compatible with 065
+
+From Neil:
+
+) Fix for SW-5164 - Bombs leaping to the foreground when tasking between apps. 
+BC change involving moving the new window to the front before sending the old window to the back when switching tasks.
+
+From Ian:
+
+) Introduction of 3 new classes, and accompanying testcode :-)
+The technology for making the shell's control panel dynamically extensible is now in place.
+Extensions come in the form of plug-in dll's who's API must conform to control.def/frx (released in ctwns*.* and ctmarm*.*). 
+This means a method of the form:
+
+	EXPORT_C void CreateControl(const TDesC& aPath)
+		{}
+
+This first export must be a method that creates the control and runs it asynchronously.
+The path passed in is the full path of the control's dll - this could be useful for loading resources etc.
+There is no base class for these controls - implementors may write them as they wish.
+
+The plug-in control dll's must reside in \system\controls\ on any local drive. 
+They should have a ".ctl" extension and a UID2 of KUidSystemControlDll (defined in apgctl.h). 
+Their UID3 should uniquely identify that particular control.
+The system for loading these dll's means that dll's in ROM can be overridden by dll's in RAM and on local media - this means that the standard controls in the shell may be replaced by whizzier versions in the future.
+
+Each control dll may have an accompanying AIF file.
+If present, this file should contain the controls icon (1 icon 48x48 pixels), and it's caption in multiple languages. The other sections of AIF files are ignored for the purposes of controls.
+If a control doesn't have an accompanying AIF file, its caption defaults to the dll name and a default icon is used (this icon need not be the same as that for unrecognised files).
+
+AppArc provides classes to automate loading and caching these plug-in controls:
+CApaSystemControl (apgctl.h) is a wrapper for a plug-in extension to the shell's control panel. It represents a loaded control dll, and also caches the dll's icon and caption.
+CApaSystemControlList (apgctl.h) holds a linked list of CApaSystemControl's. It also manages rescanning of the filesystem to locate new controls.
+CApaScanningControlFinder (apfctlf.h) carries out the actual scanning, and it is here that the directory structure for control dll's is mandated
+
+One minimal sample control has been supplied in testcode: m_ctrl.mak
+
+
+
+
+AppArc 1.0.065
+==============
+
+14/05/97 by IanH
+
+Uses:
+
+	apparc.dll: E32[105] ; F32[072] ; Store[042] ; GDI[051]
+
+	apgrfx.dll: Fntstore[042] ; Fbserv[063] ; Bitgdi[056] ; Wserv[083]
+
+Tools: E32Tools[066] ; E32Utils[014] ; GCCTOOLS[113]
+
+General:
+
+***** Do not touch this apparc until there's a new WPENG to go with it!!!!!!!! *****
+
+Not quite binary compatible with 058 - 061 and 064, but almost nobody will notice (see 5)
+
+1) Moved up to C0 level dependancies.
+
+2) App's aifdata no longer released - this is now released with AifTool but in time will migrate to the apps themselves.
+
+3) Fixed SW3-71 - IMPORT_C static TInt NewThread() removed from apsserv.h as the method didn't actually exist.
+
+4) Fixed SW-5359 - Drives are now scanned in the order y:->a: then z:, ensuring that removable/substed drives are scanned before the RAM drive, and that ROM is scanned last. 
+Remote drives are not scanned.
+This means that files in RAM or ROM can be overridden by plugging in a CF card - a good last ditch escape route.
+
+5) Fixed SW-5220 - CApaModelDoor needed a DetachFromStore(), otherwise an embedded store was being left open when its host was destroyed, causing panics in Nautilus.
+CApaModelDoor now overrides virtual CPicture::DetachFromStore(), but this shouldn't affect anyone because CApaModelDoor has a NewL() and it's c'tor is private and not exported.
+This fix involved adding one new export to apparc.dll - done in a BC fashion. 
+It also meant adding one new virtual function to CApaModelHeader:
+
+	virtual void DetachFromStoreL(CPicture::TDetach /*aDegree*/)=0;
+
+This means that anyone who used this class must recompile against this new apparc - a grep of r: suggests that this will only be WPENG and Nautilus.
+
+grep -dli-w CApaModelHeader r:\*.cpv r:\*.inv r:\*.h_v
+
+File R:\APPARC\APPARC\APAMDR.CPV:
+File R:\APPARC\TSRC\T_MDR.CPV:
+File R:\NAOLEIFS\AGNSYSRC\E32MODEL.CPV:
+File R:\NAOLEIFS\AGNSYSRC\E32RICHT.CPV:
+File R:\NAOLEIFS\WRDSRC\EWORD.CPV:
+File R:\NAUTILUS\SCWORD\EWORD.CPV:
+File R:\WORD\WPENG\WNGDOOR.CPV:
+File R:\APPARC\INC\APAMDR.H_V:
+File R:\NAOLEIFS\AGNSYSRC\E32MODEL.H_V:
+File R:\NAOLEIFS\WRDSRC\MODELDH.H_V:
+File R:\NAOLEIFS\WRDSRC\MODELHD.H_V:
+File R:\WORD\INC\WNGDOOR.H_V:
+
+Implementors of this class (ie WPENG) should provide this new method with a body that, if necessary, passes the call on to the model that they contain. This will ensure that all users of the store have a chance to tidily get rid of any dependance on the store before it disappears.
+In the case of WPENG this will mean either adding a DetachFromStoreL() method to CWordModel that propagates the call to its text component, or making this call directly on the text from the header.
+Nautilus, the only other team affected, will need to do no more than rebuild against the new apparc and WPENG.
+
+6) .map files for all arm dll's are now pvcsed along with the dll's themselves
+
+
+
+
+
+
+
+AppArc.064
+==========
+
+07/05/97 by IanH
+
+Uses:
+
+	apparc.dll: E32[099+] ; F32[069+] ; Store[042+] ; GDI[048+]
+
+	apgrfx.dll: Fntstore[038+] ; Fbserv[057+] ; Bitgdi[055+] ; Wserv[080+]
+
+Tools: E32Tools[063] ; E32Utils[012] ; GDITOOLS[034] ; GCCTOOLS[113]
+
+General:
+
+) Binary compatible with 058 - 062.
+
+) replaces bad 063
+
+
+AppArc.063
+==========
+
+07/05/97 by IanH
+
+Uses:
+
+	apparc.dll: E32[099+] ; F32[069+] ; Store[042+] ; GDI[048+]
+
+	apgrfx.dll: Fntstore[038+] ; Fbserv[057+] ; Bitgdi[055+] ; Wserv[080+]
+
+Tools: E32Tools[063] ; E32Utils[012] ; GDITOOLS[034] ; GCCTOOLS[113]
+
+General:
+
+) Binary compatible with 058 - 062.
+
+) Fixed SW-5063 - apps being orphaned if their doc's failed to construct.
+
+) Following three public methods added to CApaScanningFileRecognizer:
+
+	IMPORT_C void SetRecognizerL(const TRecognizer& aRecognizer); 
+	IMPORT_C TRecognizer operator[](TInt aIndex)const; 
+	IMPORT_C TInt UpdateCounter()const;
+
+These additions have been approved by the BC police and have been implemented in a BC fashion.
+They are required by the Shell so that it can keep it's two recognizers in sync with one another without undue work and allocing.
+
+SetRecognizerL() will return silently if a recognizer of that UID is already present in the list, but will leave if it doesn't exist on disc or has incorrect UID's etc.
+
+) T_File testcode expanded to test the above
+
+
+
+AppArc.062
+==========
+
+02/05/97 by IanH
+
+Uses:
+
+	apparc.dll: E32[099+] ; F32[069+] ; Store[042+] ; GDI[048+]
+
+	apgrfx.dll: Fntstore[038+] ; Fbserv[057+] ; Bitgdi[055+] ; Wserv[080+]
+
+Tools: E32Tools[063] ; E32Utils[012] ; GDITOOLS[034] ; GCCTOOLS[113]
+
+General:
+
+) Binary compatible with 058 - 061.
+
+) Fix to CApaDoor::NewL() that was not always deleting the doc it took ownership of in OOM conditions.
+
+) Texted's .AIF updated such that it's caption is now "Program"
+
+) The spec of CApaAppFinder::FindAppL(const TDesC& aFileName,TUid aFileUid)=0 has changed (SDK team take note!):
+
+- if a valid full path has been passed in as aFileName, that is returned.
+
+Otherwise,
+
+- if aFileUid is not KNullUid all drives are scanned for a file matching aFileUid and aFileName's extension (.APP is used if no extension is specified) ie. if aFileUid is supplied aFileName is ignored except for the extension
+- if aFileUid is KNullUid a file matching aFileName is searched for
+
+This means that an app can have it's dll and directory renamed (eg system\apps\word\word.app -> system\apps\oldword\oldWord.app) and word documents will still be associated with it because association is now by UID  in the first instance.
+
+) Testcode updated.
+
+
+
+
+
+AppArc.059
+==========
+
+29/04/97 by IanH
+
+Uses:
+
+	apparc.dll: E32[099+] ; F32[069+] ; Store[042+] ; GDI[048+]
+
+	apgrfx.dll: Fntstore[038+] ; Fbserv[057+] ; Bitgdi[055+] ; Wserv[080+]
+
+Tools: E32Tools[063] ; E32Utils[012] ; GDITOOLS[034] ; GCCTOOLS[113]
+
+General:
+
+) Binary compatible with 058. Source compatible unless you used KApfTempPath in apfdef.h
+
+) KApfTempPath now hidden in a static method Apfile::TempPath(), added in a BC manner.
+
+) Bug in TApaAppCapability::InternalizeL() that was causing the iIsHidden flag to always be set to false fixed (spotted by Bill).
+
+) 2nd UID of KSharedLibraryUid [0x1000008d] added to apparc.dll, apgrfx.dll, apfile.dll and apserv.dll (SW-3947)
+
+) CApaAppListServer::NewL() no longer panics if you try to create a second instance - it now leaves KErrAlreadyExists (SW-4338)
+
+) CApaScanningAppFinder::FindAppL() does not now confuse files and directories, and only recognizes apps with \system\apps\ in their path (SW-4325)
+
+) Server-side support for RApaLsSession::GetAppCapability() and StartApp() added - they no longer return KErrNotSupported.
+
+) Apparc no longer releases the default AIF file (appdata.zip) - this will now be released by Eikon.
+
+
+
+
+
+
+
+AppArc.058
+==========
+
+22/04/97 by IanH
+
+Uses:
+
+	apparc.dll: E32[098] ; F32[069] ; Store[042] ; GDI[049]
+
+	apgrfx.dll: Fntstore[038] ; Fbserv[055] ; Bitgdi[054] ; Wserv[079]
+
+Tools: E32Tools[063] ; E32Utils[011] ; GDITOOLS[032] ; GCCTOOLS[113]
+
+General:
+
+1) Not binary compatible with previous releases. This release freezes the API.
+
+) Takes new components as above
+
+) TBool TApaAppCapability::iAppIsHidden added to AIF files. The extensability system for capabilities means that old AIF files are still valid - they will just default to a false value for this new flag.
+If this flag is set true then the app should not be shown in the Shell (eg in the extra's bar). (requested by Kevin Dempsey)
+
+) CApaDocument::ValidatePasswordL()const added. Apps that support passwording should override the default implementation and check the password, leaving KErrLocked if the password is set but not successfully entered. (suggested by DW)
+
+) CApaDoor::DocumentL(TBool aCheckPassword=EFalse) gains the aCheckPassword parameter.
+If aCheckPassword is set to ETrue and the document is in memory, any password will be checked before a handle to the doc is returned. 
+If the document has to be restored the password will always be checked, irrespective of this parameter's value.
+
+) TRunContext removed from CApaApplication, along with virtual method DocumentRunContext(). 
+It has been replaced by a pv method Capability() that should return a cached version of the information held in the AIF file (an implementation of this method will be provided at the Eikon level).
+
+== sell App::Capability() and PreDocConstruct() to Eikon
+
+) CApaDoor's c'tor now checks that the document passed in supports embedding, leaving KErrNotSupported if it does not.
+
+) When CApaDoor restores a glass door but SetFormatToGlassL() fails, the door now sets itself iconic unless the error returned was KErrNoMemory, which is propagated.
+
+) TFileName iFullFileName removed - RLibrary::FileName() is now used instead.
+
+) RApaLsSession::GetAppCapability() added - stubbed for now.
+
+) CApaMaskedBitmap c'tor provided and made private to sabotage derivation.
+
+) CApaWindowGroupName member data made private.
+
+) CApaFileRecognizerType::RunL() now returns the TThreadId of the main thread started so that observers can log onto clients threads etc. (requested by HowardP)
+
+) Taken over releasing the app's .AIF files from Bill - Apparc now pvcs's the necessary bitmaps etc.
+
+) enum CApaFileRecognizerType::TFileType renamed TRecognizedType. Some values have been renamed:
+EApp -> EProgram
+ENotDocOrApp -> EOtherFile
+
+Type() method added to CApaFileRecognizerType that returns the TRecognizedType of the current file.
+
+) TUid CApaFileRecognizerType::FileType() renamed TypeUid()
+
+) TApaAppCapability::CopyCapability() made void.
+CApaFileRecognizerType::Capability() made void.
+CApaAppData::Capability() made void.
+CApaAppInfoFileReader::Capability() made void.
+
+) CApaAppListServer no longer takes ownership of the app list and recognizer passed into its c'tor
+
+) UpdateList() withdrawn from the Xxx API to avoid nasty re-entrance problems in the app list.
+
+) The max filename length for recognizer dll's is now limited to 12 characters (not including path or extension). 
+This is defined as KApaMaxRecognizerNameLength in apaflrec.h
+
+) CRecognizerArray* RecognizerListLC()const and SetRecognizersFromList(const CRecognizerArray& aList) added to CApaScanningFileRecognizer so that multiple recognizers can be kept up-to-date without them all needing to rescan.
+
+) The exe recognizer now recognizes all files with a 1st UID of KExecutableImageUid (defined in e32uid.h). It runs them as exe's on ARM, but loads them as dll's under WINS (exe's dont work under WINS).
+UID[2] values are no longer used for exe's - KUidExe, KUidExeNonFile and KUidExeDoc have been withdrawn.
+
+Changes as a result of AndrewT's API review:
+
+) CApaDll, and it's containing header apadll.h, made private - no longer released
+
+) MApaAppFinder becomes CApaAppFinder - better design, as the object can be deleted through this interface
+MApaAppLocator becomes CApaAppLocator for similar reasons...
+
+) As a result CApaAppFinder becomes CApaScanningAppFinder
+
+) CApaApplication::OpenIniFileLC(RFs& aFs) becomes pure virtual to avoid dangerous policy decisions on file locations. 
+An implementation will be provided by Eikon :-)
+
+) Reserved some virtual methods in CApaApplication and CApaDocument
+
+) KIniFileDrive removed from apadef.h along with KIniFileExtension and KAppInfoFileExtension
+
+) TApaDocCleanupItem (apacln.h) has changed slightly - it's now even easier to but CApaDocument-derived classes on the cleanup stack:
+
+		TApaDocCleanupItem cleanup(iApaProcess,doc);
+		CleanupStack::PushL(cleanup);
+		// do stuff...
+		CleanupStack::Pop();
+
+) The following definitions moved from apadef.h to a new header apfdef.h:
+KAppFileExtension
+KAppInfoFileExtension
+KIniFileExtension
+KIniFileDrive
+
+
+
+
+AppArc.056
+==========
+
+07/04/97 by IanH
+
+Uses:
+
+	apparc.dll: E32[097] ; F32[067] ; Store[041] ; GDI[047]
+
+	apgrfx.dll: Fntstore[038] ; Fbserv[053] ; Bitgdi[053] ; Wserv[078]
+
+Tools: E32Tools[060] ; E32Utils[010] ; GDITOOLS[031] ; GCCTOOLS[113]
+
+General:
+
+1) Not binary compatible with previous releases.
+
+) CApaMaskedBitmap::NewL() made static (spotted by Bill)
+
+) As suggested by Geert, the protected interfaces of all public classes have been reviewed. 
+The following classes no longer have protected interfaces, meaning that they lose some exported functions and can no longer be derived from:
+
+	CApaDoor
+	CApaModelDoor
+	CApaAppFinder 
+	CApaIconFileReader / Writer (these classes have also been renamed... see below)
+
+) CApaAppListServer startup changed. The server now runs in the callers thread, and takes ownership of the applist and file recognizer passed to it.
+Any shell should have code similar to the following in it's construction routine (eg in CShlModel::NewL()):
+
+	CApaAppFinder* appFinder=CApaAppFinder::NewL(fs);
+	appList = CApaAppList::NewL(fs,appFinder);	// takes ownership of appFinder
+	fileRecognizer = CApfFileRecognizer::NewL(fs,appList,aAppStarter);
+	appListServer = CApaAppListServer::NewL(appList,fileRecognizer); // takes ownership of appList and fileRecognizer
+
+) Icon files have been renamed to application info files - they now contain information previously encoded into the app UID.
+The old .ICN file format is no longer supported - new .AIF files for all apps will be forthcoming.
+The capabilities are defined by the following class in apgicnfl.h:
+
+	class TApaAppCapability
+		{
+	public:
+		TBool iCannotRunAsMainApp;
+		TBool iIsEmbeddable;
+		TBool iSupportsNewFile;
+		};
+	typedef TPckgBuf<TApaAppCapability> TApaAppCapabilityBuf;
+
+New methods of the app info file reader and writer (previously icon file reader/writer) get and set the capability:
+
+TInt CApaAppInfoFileReader::Capability(TDes8& aInfo)const
+TInt CApaAppInfoFileWriter::SetCapability(TDes8& aInfo)const
+
+Both methods should be used in conjunction with the TApaAppCapabilityBuf buffer as follows:
+
+	// set some capabilities
+	TApaAppCapability capability;
+	capability.iIsEmbeddable = ETrue;
+	capability.iSupportsNewFile = EFalse;
+	TApaAppCapabilityBuf buf(capability);
+	TInt ret = writer->SetCapability(buf);
+
+	// check the capability
+	TApaAppCapabilityBuf buf;
+	TInt ret = reader->Capability(buf);
+	TApaAppCapability capability=buf();
+
+) There have been various API changes to support this:
+	- The CApaIconFileXxx classes become CApaAppInfoFileXxx 
+	- KIconFileExtension becomes KAppInfoFileExtension and is now defined as ".AIF"
+	- KUidAppIcon is renamed KUidAppInfoFile, but retains the same value.
+	- some classes have gained Capability(TDes& ) methods, into which you  should pass a TApaAppCapabilityBuf as described above.
+	- CApaApplication::OpenIconFileLC() becomes OpenAppInfoFileLC()
+	- MApaAppLocator::GetAppCapabilityByUid(TDes8& aCapabilityBuf,TUid aAppUid)=0 added
+
+) All apps should now have the same UID[1] - KUidApp. All other app UID values have been withdrawn.
+As a result CApaDll::IsAppUid() has been withdrawn.
+
+) EIKAPP.DEF, the def file used by apps when linking, has been renamed APP.DEF and is now reeased by apparc into epoc32\release\wins.
+The link section of all apps should now contain /def:"\Epoc32\Release\Wins\app.def" unless they have any other exports apart from those specified app.def
+A matching app.frz has been released into \Epoc32\Release\Marm\ - this is only a guide however. 
+Each app should produce it's own set of 4 ARM .frz files (one for each build) because ARM .frz files encode the dll name and build in their first line.
+
+) There are two new releasables dfwns and dfarm that should be fetched to \epoc32\release\wins\ and \epoc32\release\marm\ respectively. They contain the .def files for apps and recognizers.
+
+From Neil:
+
+) CApaTask::SwitchOpenFile() and SwitchCreateFile() now check the window group name for busy and not supported flags, returning an error if the request cannot be completed. 
+A few chnages have been made to CApaWindowGroupName to support this
+
+
+
+
+
+
+
+
+
+AppArc.055
+==========
+
+06/04/97 by IanH
+
+Uses:
+
+	apparc.dll: E32[096] ; F32[065] ; Store[040] ; GDI[046]
+
+	apgrfx.dll: Fntstore[037] ; Fbserv[052] ; Bitgdi[051] ; Wserv[076]
+
+Tools: E32Tools[057] ; E32Utils[009] ; GDITOOLS[031] ; GCCTOOLS[113]
+
+General:
+
+1) Not binary compatible with previous releases.
+
+From Neil:
+
+) RestartAfterBackup() and Set...() removed from CApaWindowGroupName API as these services are now handled remotely.
+
+) RespondsToSwitchFilesEvent() and Set...() added to CApaWindowGroupName - an app (eg OPL) can unset this flag to inform the shell that it does not support switch files and that a new instance should be created for each new launching of the app.
+
+) RespondsToShutdownEvent() and Set...() added to CApaWindowGroupName - an app (eg OPL) can set this flag to inform any shell that it needs to be killed, not closed.
+
+) TApaTask::KillTask() added to kill tasks that dont respond to "shutdown" messages
+
+) T_wgnam extended to test above CApaWindowGroupName changes.
+
+From Ian:
+
+) Fixes to a couple of header files such that all referenced classes are now defined prior to their use, rather than relying on someone else doing it some time before including that header.
+
+) CApaAppList now behaves sensibly if an app's icon file is corrupt or empty - it loads icons from the default icon file rather than leaving.
+
+) CApaIconFileReader::NewL() added to complement NewLC()
+
+) Extra "name" builds added to all .mak files to make binary compatable releases easier (suggested by Geert)
+
+) Temporarily iconic doors now persist the correct glass door size even if the embedded doc is edited (bug spotted by MartinH SW-2195)
+
+) Base address of 0x43700000 set for apserv.dll (ommission spotted by MartinB)
+
+) All RApaLsSession methods now implemented except for UpdateList() and StartApp(), which still return KErrNotSupported.
+
+
+
+
+
+
+
+AppArc.053
+==========
+
+30/03/97 by IanH
+
+Uses:
+
+	apparc.dll: E32[095] ; F32[063] ; Store[039] ; GDI[046]
+
+	apgrfx.dll: Fntstore[037] ; Fbserv[051] ; Bitgdi[051] ; Wserv[075]
+
+Tools: E32Tools[056] ; E32Utils[009] ; GDITOOLS[031] ; GCCTOOLS[113]
+
+General:
+
+1) Not binary compatible
+
+From Neil:
+
+) CApaCommandLine::New(HBufC*) added.
+
+) Untrapped leave bug fix to CApaTaskList
+
+From Ian:
+
+) OOM testcode T_OOM added. A couple of OOM fixes have arisen from this.
+
+) Fix to CApaAppFinder such that it ignores more F32 errors rather than stopping a search prematurely without good reason (spotted by Simon while using his floppy drive)
+
+) The API of RApaLsSession (apgcli.h) is now complete, though some methods are not yet implemented server-side. 
+This class represents a session with the app list server.
+The app list server provides system-wide access to any shell's cached list of applications.
+When the shell is started it will create a CApaAppList - after doing this it should start a server, passing in the handle to it's list.
+The server shares the Shell's heap and accesses the list as required.
+If the shell does not set up the server all client attempts to connect will fail. Among other things, this will mean that "Embed object" dialogs will not work.
+
+) TApaAlServStarter::StartInThread(CApaAppList* aAppList,CApaFileRecognizer* aFileRecognizer) now takes the CApaFileRecognizer* as an extra parameter. 
+For you can pass in a null recognizer handle if you wish, though that will mean that clients wont be able to start apps using the app list server.
+
+) Americanized some argument names in header files on request of MartinT (eg aRecogniser -> aRecognizer)
+
+) static TInt CApaApplication::GenerateFileName(RFs& aFs,TFileName& aRootName) added - some code taken from Shell.
+The root name passed should consist of drive,path,and root filename. 
+The path is created if it doesn't already exist, and then if the root filename is already in use a new name is generated:
+eg "c:\Documents\Name.ext"
+   "c:\Documents\name(01).ext"
+aRootName is set to equal the new full name.
+KErrArgument is returned if not all components of aRootname are present, and KErrOverflow is returned if the generated filename becomes too long.
+
+) The definition of "non-filebased" has been tightened somewhat to mean "cannot create new files" ie an app that doesn't want to appear on the Shell's "New file" list.
+
+) 
+
+
+
+
+
+
+
+
+AppArc.052
+==========
+
+24/03/97 by IanH
+
+Uses:
+
+	apparc.dll: E32[093] ; F32[061] ; Store[037] ; GDI[044]
+
+	apgrfx.dll: Fntstore[036] ; Fbserv[050] ; Bitgdi[050] ; Wserv[074]
+
+Tools: E32Tools[053] ; E32Utils[009] ; GDITOOLS[031] ; GCCTOOLS[113]
+
+General:
+
+1) Not binary compatible
+
+From Ian:
+
+) The pure virtual method CApaDocument::IsEmptyL(CStreamStore) becomes IsEmpty()const.
+It becomes const, ceases to leave and no longer takes a store as a parameter - on Restore() doc's should internalize enough data such that they know whether or not they have any content. (suggested by Delma)
+
+) Added new dll apserv - released as a part of the apgrfx releasables. It provides server access to a cached list of apps available on the machine. Nobody bar Eikon will want to use it. 
+More details to follow
+
+) Added CApaDoor::AppUidL() that returns the UID of the app associated with the embedded doc (requested by DavidA)
+
+) Icon files no longer stretch icons to the required size when they're requested. 
+A call to CApaIconFileReader::CreateMaskedBitmapL() will now returned the largest available bitmap that isn't larger than the requested size.
+If all available icons are larger than the size requested, the smallest available icon is scaled down and returned. 
+
+
+
+
+
+AppArc.050
+==========
+
+19/03/97 by IanH
+
+Uses:
+
+	apparc.dll: E32[093] ; F32[061] ; Store[037] ; GDI[044]
+
+	apgrfx.dll: Fntstore[036] ; Fbserv[050] ; Bitgdi[050] ; Wserv[074]
+
+Tools: E32Tools[053] ; E32Utils[009] ; GDITOOLS[031] ; GCCTOOLS[113]
+
+General:
+
+1) Binary compatible with 049
+
+From Ian:
+
+2) Bug fix to CApaDoor::ExternalizeStateStream() - temporarily iconic doors now remember their glass size correctly after multiple Store()'s (spotted by DavidA)
+
+
+
+
+
+
+
+AppArc.049
+==========
+
+11/3/97 by IanH
+
+Uses:
+
+	apparc.dll: E32[093] ; F32[061] ; Store[037] ; GDI[044]
+
+	apgrfx.dll: Fntstore[036] ; Fbserv[050] ; Bitgdi[050] ; Wserv[074]
+
+Tools: E32Tools[053] ; E32Utils[009] ; GDITOOLS[031] ; GCCTOOLS[113]
+
+General:
+
+1) Not binary compatible with previous releases
+
+From Ian:
+
+2) Bug fix to dodgy ASSERT in CApaDoor::DetachFromStore() (spotted by DavidA)
+
+) CApaDocument::EditL() now takes an extra parameter: TBool aReadOnly.
+If aReadOnly is true, the embedded doc should be opened in read-only mode - ie navigation of the document should be allowed, but it should not be possible to change the content.
+This parameter defaults to EFalse.
+
+) Agenda bugs SW-479 and SW-520 fixed - glass doors now correctly persist their size if they are temporarily made iconic
+
+) CApaDoor::SetFormatToTemporaryIcon() now takes a TBool parameter which allows it to be toggled on and off. The default parameter is ETrue
+If a door is in iconic mode, SetFormatToTemporaryIcon(ETrue) has no effect - it stays iconic.
+If a door is glass, SetFormatToTemporaryIcon(ETrue) temporarily makes it iconic, but when persisted the door will persist glass door settings.
+SetFormatToTemporaryIcon(EFalse) only has an effect if the door is currently ETemporarilyIconic. In this case the door is returned to EGlassDoor format.
+
+) TApaPictureFactory::SetIconSize() added. 
+If called, this causes all doors restored by the factory to have their iconic size set as specified instead of using the persisted value.
+This fixes SW-1026 - doors being pasted from one app to another end up with the door size of the old app, even though this is often different to the default icon size in the new app.
+
+From Neil:
+
+) TApaWindowGroupName becomes CApaWindowGroupName, using an HBufC to provide support for long filenames.  
+This will fix showstopper bug SW-1488
+
+Consequent changes to this class are:
+
+The static FindByXxx() functions no longer return an instance of the class.  
+Use the NewL() or NewLC() variant which takes a window group id (returned by the FindByXxx() function), to initialize a window group name or the new exported function ConstructFromWgIdL() for an existing instance of the class
+
+SetCaption() becomes SetCaptionL() and likewise: SetDocName() becomes SetDocNameL();
+
+
+
+AppArc.048
+==========
+
+11/3/97 by DavidW
+
+Uses:
+
+	apparc.dll: E32[090] ; F32[060] ; Store[037] ; GDI[044]
+
+	apgrfx.dll: Fntstore[036] ; Fbserv[049] ; Bitgdi[049] ; Wserv[073]
+
+Tools: E32Tools[051] ; E32Utils[008] ; GDITOOLS[030] ; GCCTOOLS[113]
+
+General:
+
+1) Not binary compatible
+
+2) Provided a VALID verb for MNT.CMD, to check that the (Arm Rel and
+Arm Deb) releaseables are completely rebuildable from the network
+
+3) Three new functions added to TApaTask:
+
+    IMPORT_C TInt SwitchOpenFile(const TDesC& aFilename);
+    IMPORT_C TInt SwitchCreateFile(const TDesC& aFilename);
+    IMPORT_C TInt SendMessage(TUid aUid, const TDesC& aParams);
+
+4) The above implemented by means of new Uid values
+
+const TUid KUidApaMessageSwitchOpenFile={0x10000163};
+const TUid KUidApaMessageSwitchCreateFile={0x10000164};
+
+5) I have broken the Unicode build, since SendMessage wants to call
+an RWsSession function taking a TDesC8& as a parameter.  I'll leave
+this for someone else to fix
+
+6) Fixed the FindApp(TUid) and CycleTasks() functions to TApaTaskList
+to be EXPORTed
+
+From Ian:
+---------
+7) On Kevin's suggestion, introduced a new TFormat type for CApaDoorBase, namely ETemporarilyIconic
+
+8) New virtual function SetFormatToTemporaryIconL() in CApaDoor, with the effect that
+// if the door is currently iconic do nothing
+// if the door is glass switch it's format to iconic, but ensure that when externalized the format will be persisted as glass
+
+
+
+
+
+AppArc.047
+==========
+
+10/3/97 by IanH
+
+Uses:
+
+	apparc.dll: E32[090] ; F32[060] ; Store[037] ; GDI[044]
+
+	apgrfx.dll: Fntstore[036] ; Fbserv[049] ; Bitgdi[049] ; Wserv[073]
+
+Tools: E32Tools[051] ; E32Utils[008] ; GDITOOLS[030] ; GCCTOOLS[113]
+
+General:
+
+1) Not binary compatible
+
+2) Takes new F32, GDI, GCC
+
+) CApaDocument::EditL() no longer takes a store as a parameter. On restoration documents should hang onto the store handle for future reference, only nulling it if DetachFromStore() is called (this will be called before the doc is stored).
+
+) The OPL recogniser (formerly known as recint.rdl) is no longer released by apparc. 
+It will now be released as a part of OPL - .iby's should change to reflect this but no changes to mnt getbld's should be required as all apparc's recognisers are packaged in one releasable.
+
+) Default implementation of CApaDocument::GlassDoorL() now panics instead of returning null. Should aid debugging. (suggested by MartinB)
+
+) TUid iSource added to CApaDoorBase for use by converters. 
+It stores the foreign representation of a translated door (eg MS Word doc), and is KNullUid if the door was not created by converting from a foreign file.
+
+From Bill:
+
+) CApaAppList::UpdateL() changed such that it only increments the "UpdateCounter" if the apps present have changed.
+This will stop the Shell ExtrasBar from re-drawing itself every time a file is created / deleted, etc.
+
+) TApaTaskList::FindApp(TUid) and TApaTaskList::CycleTasks() added (merged by NeilD)
+
+
+
+
+
+
+
+
+
+
+AppArc.046
+==========
+
+4/3/97 by IanH
+
+Uses:
+
+	apparc.dll: E32[090] ; F32[060] ; Store[036] ; GDI[043]
+
+	apgrfx.dll: Fntstore[036] ; Fbserv[049] ; Bitgdi[049] ; Wserv[073]
+
+Tools: E32Tools[051] ; E32Utils[008] ; GDITOOLS[030] ; GCCTOOLS[111]
+
+General:
+
+1) Binary compatible with 045
+
+) Fixed access violation bug in CApaDoor::SetFormatToGlass() (spotted by MartinD)
+
+
+
+
+
+
+
+AppArc.045
+==========
+
+3/3/97 by IanH
+
+Uses:
+
+	apparc.dll: E32[090] ; F32[058] ; Store[036] ; GDI[043]
+
+	apgrfx.dll: Fntstore[036] ; Fbserv[049] ; Bitgdi[049] ; Wserv[073]
+
+Tools: E32Tools[051] ; E32Utils[008] ; GDITOOLS[030] ; GCCTOOLS[111]
+
+General:
+
+1) Not binary compatible with 044
+
+) updated to new components as above
+
+) CApaAppFinder's constructor now takes it's RFs& as const (suggested by Simon)
+
+) CApaDocument::GlassPictureL() no longer takes a store as a parameter. 
+The doc will either be newly created or will be RestoreL()'ed before GlassPictureL() is called - so CApaDocument::RestoreL() must restore the doc to a state from which it can draw itself as a glass door (if it supports this form of display).
+
+) CApaDoor::DocumentL() and SetFormatToGlassL() no longer take a store as a parameter
+
+) CApaDoor::SetFormatToIconL() no longer takes a size as a parameter - the size is passed in on construction and persisted. 
+An iconic door's Capability() states that it does not support scaling (ie changing its size) so that form will not allow the user to drag icons to different sizes. 
+Despite this the icons size may still be altered through calls to SetSizeInTwips() and SetSizeInPixels().
+
+) Embedded documents in doors are now put in their own embedded store inside the door. (Thanks to Charles, AndrewT and Geert for help with this)
+This means that doors can be copied without having to load up the document they contain, giving speed and memory gains.
+A consequence of this is that even if a main document is encrypted, any embedded documents will remain unencrypted. 
+Embedded documents may be encrypted in their own right, but they do not inherit any protection from container documents.
+This should be stressed in user documentation. 
+
+) Representation of doors as icons improved - they now make better use of the different sizes of icon available.
+
+) If an app supports embedding (eg it has a rich text component) it should ensure that it overrides CApaDocument::DetachFromStore and propagates the call to all embedded objects.
+
+) CApaIconFileReader::NewLC() now accepts KNullUid instead of a valid uid for the icon file, and doesn't check the type in this case.
+
+) MApaAppFinder gains two more pure virtual methods that return the temp file path and the full filename of the default icon file, centralizing access to the two pieces of info.
+
+) CApaProcess::NewL() no longer takes a temp path as a parameter. This path is now defined in apffndr.h and need not be defined anywhere else.
+
+) CApaModelDoor now stores and restores it's format and size such that it can be understood by a CApaDoor and vice versa.
+
+) Class CApaDoorBase introduced, which CApaModelDoor and CApaDoor inherit from. 
+The enum TFormat that was scoped by CApaDoor is now scoped by CApaDoorBase.
+The method CApaDoor::GetFormat() moves to CApaDoorBase and changes name to Format().
+
+) The UID typing scheme for app dll's has been extended slightly. 
+The general layout for an app dll's uid type has not been changed, and is:
+
+UID[0] = PE File
+UID[1] = Type of app
+UID[2] = particular app id
+
+The types of app have been extended to specify whether or not an app is file-based, and are now as follows:
+
+KUidApp							0x1000006c - file-base, non-embeddable app (eg Agenda)
+KUidAppNonFile					0x1000014a - non-file based non-embeddable app (eg Calculator)
+KUidAppEmbeddable				0x1000006e - file-based embeddable and main app (eg Word)
+KUidAppEmbeddableNonFile		0x1000014b - non-file-based main and embeddable app (no eg)
+KUidAppEmbeddableOnly			0x1000006f - app is embeddable only, cannot run as a main app (therefore non-filebased by definition)
+
+File-based apps are document centric and create lots of files (eg word), while non-file-based apps aren't and don't (eg calculator).
+All app writers must choose the UID that best suits their app - see Ian if you're unsure.
+This change will allow the shell to list only file-based apps in it's "Create new file" dialog.
+This has involved a couple of UID name changes (though the meaning of the UIDs reamins the same)
+
+KUidAppDll becomes KUidApp
+KUidAppAndEmbeddedApp becomes KUidAppEmbeddable
+
+) A third file recogniser dll added: RECEXE.DLL, the exe recogniser. This recognises files with the following uid layout:
+
+For exe's:
+
+UID[0] = PE File
+UID[1] = Type of exe					
+UID[2] = particular exe id
+
+The types of exe mirror the types of app, and are as follows:
+
+KUidExe							0x10000070 
+KUidExeNonFile					0x1000014C
+
+For doc's associated with exe's:
+
+UID[0] = Store type
+UID[1] = KUidExeDoc				0x10000071
+UID[2] = id of associated exe
+
+) File recogniser dlls now have a .rdl extension (Recognizer DLl) and live in \system\recogs NB this means mnt getrel's will have to change to get the recognisers down into this directory
+
+) Changes to CApaFileRecognizerType:
+RecognizeFileL() becomes concrete and a pure virtual method DoRecognizeFileL() is added.
+TUid iFileType is added - by default this is set to UID[1] of the recognized file - it's type
+TUid iAppUid is now the UID of the associated app - by default this is set to UID[2] of the recognized file. 
+There are now inline methods to return these two UID's.
+Pure virtual method Capability() added - this returns a TCapability class detailing whether the recognised file is a program, and, if so, whether it is file-based and whether it is embeddable.
+
+) CApaDocument::DetachFromStoreL() now takes a CPicture::TDetach as a parameter. 
+This will be one of EDetachFull and EDetachDraw.
+For EDetachFull you should ensure that you internalize all data that you require to fully store yourself later, and null any references to containing stores.
+For EDetachDraw you should ensure that you have internalized enough info to draw yourself, nothing more, and that you null any references to containing stores.
+If an app doesn't support drawing as a glass door it wont have to do anything in the case of EDetachDraw (except that nulling of stores).
+
+From Neil:
+
+) TApaCommandLine class heavily revamped. 
+It's now called CApaCommandLine, and gains methods for setting each component of the command line separately.
+
+) Implementors of MApaAppStarter::StartAppL(const CApaCommandLine& aCommandLine) should note that it must now take ownership of the command line and protect it and destroy it appropriately.
+ 
+
+
+
+
+
+
+
+AppArc.043
+==========
+
+13/2/97 by IanH
+
+Uses:
+
+	apparc.dll: E32[086] ; F32[050] ; Store[035] ; GDI[042]
+
+	apgrfx.dll: Fntstore[035] ; Fbserv[045] ; Bitgdi[045] ; Wserv[065]
+
+Tools: E32Tools[050] ; E32Utils[005] ; GDITOOLS[028] ; GCCTOOLS[111]
+
+General:
+
+1) Not binary compatible with 042
+
+) updated to new components as above
+
+2) A large-scale re-organisation of code has taken place. 
+AppArc is now split into 3 major dll's plus multiple plug-in app recognisers.
+Of all the changes, the highlights include:
+
+The file recogniser base classes now live in apparc.dll and can be found in apaflrec.h, not apgflrec.h as was previously the case.
+
+TApaAppIdentifier, TApaAppEntry and TApaAppFinderBase now live in a new header apaid.h in apparc.dll
+
+Apgrfx.h becomes apgdoor.h as it defines CApaDoor
+
+TApaAppFinderBase becomes MApaAppFinder, and gains member functions to find all available apps as well as finding a particular one.
+
+TApaAppFinder becomes CApaAppFinder. It now lives in apfile.dll and encasulates all the search logic that depends on any particular file system structure (ie system\apps etc).
+
+CApaAppList now takes a MApaAppFinder as a parameter to its constructor, using this to build its list of available apps. It takes ownership of the app finder supplied.
+
+A couple of mixins gain virtual inline destructors. This allows derived objects to be deleted through these interfaces.
+
+Names defined for a few previously anonymous CBase-derived classes.
+
+apgrfx.h becomes apgdoor.h
+
+CApaModelHeader::AppId() made const (suggested by Duncan)
+
+Class CApaScanningFileRecogniser added - this is a concrete implementation of CApaFileRecogniser that scans the system for plug-in app recogniser dlls (eg interpreted app recogniser, exe recogniser, apparc app recogniser).
+Plug-in app recognisers are searched for in \system\libs\ on all non-remote drives.
+Plug-in dlls should have the following UIDS: 
+	UID[0] = [dll build]
+	UID[1] = KUidAppRecognizer   (={0x1000013E})
+	UID[2] = [uid of the particular dll] (eg KUidInterpreterExe for the exe interpreter)
+A plug-in's first exported function should be a parameterless constructor that returns a pointer to full constructed object of base type CApaFileRecogniserType.
+
+A concrete implementation of MApaAppLocator, CApaAppLocatorProxy, is also provided (for the sole use of CApaScanningFileRecogniser). This class implements GetAppEntryByUid(TUid) by scanning the system for an app dll that has the matching UID.
+ 
+App dll's should now once again export their constructor as their ordinal 1 method. The dummy 1st export is no longer required due to changes in the shell to bring it into line with the rest of the world. (Sorry for the hassle).
+
+
+Testcode:
+
+T_FILE testcode added that tests the built-in app finder, and also CApaScanningFileRecogniser.
+
+T_PRO expanded to test classes CApaAppList and CApaAppData that previously had no testcode.
+
+
+
+
+AppArc.042
+==========
+
+12/2/97 by IanH
+
+Uses:
+
+	apparc.dll: E32[086] ; F32[050] ; Store[035] ; GDI[042]
+
+	apgrfx.dll: Fntstore[035] ; Fbserv[045] ; Bitgdi[045] ; Wserv[065]
+
+Tools: E32Tools[050] ; E32Utils[005] ; GDITOOLS[028] ; GCCTOOLS[111]
+
+General:
+
+1) Binary compatible with 041
+
+2) Regressed to GCCTOOLS 111
+
+3) Interpreted app starter re-written (by Howard)
+
+4) Bug fix to command line to remove trailing space from full command line (by Neil)
+
+Notes for Glass-door enabled apps and SDK:
+
+Having just written a glass door add-on for TOPBUT1 I thought it might be worth more carefully defining a couple of the methods in the CPicture interface:
+
+The "Current size" of a picture is calculated from the original size taking cropping and scale factor into account.
+
+The value of "Crop" is relative to the *original* size of the picture.
+
+
+
+
+
+
+
+AppArc.041
+==========
+
+7/2/97 by IanH
+
+Uses:
+
+	apparc.dll: E32[086] ; F32[050] ; Store[035] ; GDI[042]
+
+	apgrfx.dll: Fntstore[035] ; Fbserv[045] ; Bitgdi[045] ; Wserv[065]
+
+Tools: E32Tools[050] ; E32Utils[005] ; GDITOOLS[028] ; GCCTOOLS[112]
+
+General:
+
+1) Not build compatible with 040
+
+) Apps must now export their constructor as the ordinal 2 function of their app dll. 
+Changes will be made to the Eikon .def file to support this, but all apps should add the following line to their project to ensure that they have a first exported function as well as a second:
+
+__FIRST_EXPORT
+
+) Bug fix in command line classes by Neil
+
+
+
+
+AppArc.040
+==========
+
+6/2/97 by IanH
+
+Uses:
+
+	apparc.dll: E32[086] ; F32[050] ; Store[035] ; GDI[042]
+
+	apgrfx.dll: Fntstore[035] ; Fbserv[045] ; Bitgdi[045] ; Wserv[065]
+
+Tools: E32Tools[050] ; E32Utils[005] ; GDITOOLS[028] ; GCCTOOLS[112]
+
+General:
+
+1) Binary compatible with 039
+
+) Changes made to CApaAppData such that if an application doesnt have an icon file it's dll name is used as a caption and the default icon is used as it's icon. Previously apps without icon files weren't being detected by the shell at all.
+
+
+
+
+
+
+
+
+AppArc.039
+==========
+
+5/2/97 by IanH
+
+Uses:
+
+	apparc.dll: E32[086] ; F32[050] ; Store[035] ; GDI[042]
+
+	apgrfx.dll: Fntstore[035] ; Fbserv[045] ; Bitgdi[045] ; Wserv[065]
+
+Tools: E32Tools[050] ; E32Utils[005] ; GDITOOLS[028] ; GCCTOOLS[112]
+
+General:
+
+1) Not binary compatible with 038
+
+) apgrfx.dll now has its base address set to avoid conflicts (spotted by MartinB)
+
+) MApaDocContainer renamed MApaEmbeddedDocObserver, and an extra exit mode "EEmpty" added. If an embedded document has no content it should return EEmpty when it exits, and the container can then choose not to insert it if it doesnt want to.
+
+) Bug in CApaDoor::RestoreDoc() fixed (spotted by DavidA)
+
+From Bill:
+
+) Rewrite of the file recogniser module, and new classes CApaAppList and CApaAppData that cache a list of all apps available on the system. No testcode for this stuff yet...
+
+) The interpreted app recogniser is now completely buggered and will have to be rewritten (Howard?)
+
+From Neil:
+
+) Relocated the TApaCommandLine class from Eikon to Apparch.  This class encapsulates the command line and is formatted as follows:
+
+<app name><space>command byte><doc name><space><tail end>
+
+app name and doc name may conatain spaces if surrounded by quotes.  Embedded quotes in these names is not supported.
+
+Various accessor functions exist to extract the various components of the command line, and setter functions will be added soon (for now you must construct the command line in a descriptor and call Set())
+
+This class will be used to start all apps.  This has involved some API changes to the file recognizer classes.
+
+New class TApaWindowGroupName to encapsulate the window group name of applications.  Set and get functions exist for all components.  
+
+The window group name stores the caption name, document name, application uid, and several "status bits" for apps to mark themselves as System (will not be closed for backup), Busy, that there document name is not actually a file (eg Platypus) and whether the app wishes to be restarted after a backup (mainly for use by OPL programs but will be ignored in version 1 anyway!)
+
+Test code for TApaWindowGroupName in T_WGNAM.*
+
+
+
+
+
+
+AppArc.038
+==========
+
+3/2/97 by IanH
+
+Uses:
+
+	apparc.dll: E32[086] ; F32[050] ; Store[035] ; GDI[042]
+
+	apgrfx.dll: Fntstore[035] ; Fbserv[045] ; Bitgdi[045] ; Wserv[065]
+
+Tools: E32Tools[050] ; E32Utils[005] ; GDITOOLS[028] ; GCCTOOLS[112]
+
+General:
+
+1) Not binary compatible with 037
+
+2) Takes the new gdi etc.
+
+3) CApaProcess::NewL() now takes a TApaAppFinderBase by & instead of as a *, and no longer defaults this parameter to NULL.
+The default search algorithm will now be provided in Eikon and must be passed in each time on construction of a process. 
+Nb CApaProcess takes ownership of the TApaAppFinderBase passed in, which should be allocated on the heap.
+
+
+
+
+
+
+
+
+
+AppArc.037
+==========
+
+31/1/97 by IanH
+
+Uses:
+
+	apparc.dll: E32[086] ; F32[050] ; Store[033] ; GDI[041]
+
+	apgrfx.dll: Fntstore[034] ; Fbserv[044] ; Bitgdi[044] ; Wserv[064]
+
+Tools: E32Tools[050] ; E32Utils[005] ; GDITOOLS[028] ; GCCTOOLS[111]
+
+General
+
+1) Not binary compatible with 036
+
+) App dlls are no longer Gate()'ed on loading. 
+This means that __DECLARE_APP_DLL_UID should no longer be declared in each app's code and that the ordinal one function of an app dll should now be the constructor (this was previously the ordinal 2 function).
+
+) Missing exports added to many file recogniser methods
+
+
+
+
+
+
+
+AppArc.036
+==========
+
+27/1/97 by IanH
+
+Uses:
+
+	apparc.dll: E32[086] ; F32[050] ; Store[033] ; GDI[041]
+
+	apgrfx.dll: Fntstore[034] ; Fbserv[044] ; Bitgdi[044] ; Wserv[064]
+
+Tools: E32Tools[050] ; E32Utils[005] ; GDITOOLS[028] ; GCCTOOLS[111]
+
+General
+
+1) Not binary compatible with 035
+
+) apgrfx.dll now links to wserv
+
+) Icon files no longer store iRequiresNewDocName, which as a result no longer has an accessor (change from Bill)
+
+) New modules:
+
+ApgTask.h - the task and task list classes (formerly in Eikon)
+
+ApgFlrec.h - the file recogniser classes (formerly in Shell)
+
+ApgApp.h - the app recogniser for app arc apps (formerly in Shell)
+
+ApgInt.h - the app recogniser for interpreted apps (formerly in Shell)
+
+The above modules have no testcode as yet...
+
+
+
+
+
+
+
+AppArc.035
+==========
+
+27/1/97 by IanH
+
+Uses: E32[085] ; F32[049] ; Store[033] ; GDI[041] ; Fntstore[034] ; Fbserv[044] ; Bitgdi[044]
+
+Tools: E32Tools[050] ; E32Utils[005] ; GDITOOLS[028] ; GCCTOOLS[111]
+
+General
+
+1) Not binary compatible with 034
+
+3) There will be at least one more non-binary compatible release this week before the B5 freeze.
+
+Changes
+
+4) Further re-arrangement of code between the two dll's. CApaDoor is now entirely in apgrfx.dll, and no longer has a CApaDoorBase baseclass.
+
+5) A new module apamdr added for the benefit of Nautilus-type converters. 
+It contains a concrete CApaModelDoor that contains a CApaModelHeader. 
+Concrete implementations of the header must be provided for all application models that wish to support embedding and have their embedded documents translated by Nautilus.
+The persistant format of a CApaEmbeddedDoor is compatible with that of a CApaDoor to the extent that either can be internalized by the other safely.
+A factory class must be provided for each implementation of the header.
+
+) In the interests of encapsulation CApaDocument::Capability() now returns a CApaDocument::TCapability instead of a TUint (suggested by Duncan).
+
+) CApaProcess::MainDocFileName() and TempFilePath() now return TPtrC instead of const TDesC* (suggested by Brendan)
+
+) If a glass door is passworded it will now be automatically iconified on restoration and the user will only be prompted for a password when they directly interact with it.
+
+) const TUid KUidSecurityStream={268435661} is now defined in apparc.h - this is the uid that should be used for the security stream for passworded documents.
+
+) The persistant format of CApaDoors has changed, so any apps that support embedding will find that their file formats have changed also...
+
+
+
+
+
+
+AppArc.034
+==========
+
+20/1/97 by IanH
+
+Uses: E32[085] ; F32[049] ; Store[033] ; GDI[041] ; Fntstore[034] ; Fbserv[044] ; Bitgdi[044]
+
+Tools: E32Tools[050] ; E32Utils[005] ; GDITOOLS[028] ; GCCTOOLS[111]
+
+General
+
+1) Not binary compatible with 033
+
+2) Takes new E32 etc.
+
+) The search algorithm for locating app dll's has changed. An app dll is now searched for in \system\apps\appname\appname.app on all drives until one is located. Files of the correct name can optionally have their uids checked. This new algorithm should significantly speed up loading of documents.
+
+) CApaProcess now takes a TApaAppFinderBase* as a parameter of its NewL() instead of a search path. This base class efines an API for access to a method in which any search algorithm required could be implemented. This parameter defaults to NULL, and if no finder is passed in a default one is used that implements the above behaviour. A substitute finder should only be passed in if eg a different directory structure is implemented on a future machine. CApaProcess takes ownership of any app finder passed in.
+
+) As a result of the search code moving CApaDll no longer has a FindAppDll() method.
+
+) CApaDoor gains a NewL to complement its NewLC (requested by SimonC)
+
+) inline const TDesC* TempFilePath()const added to CApaProcess (requested by SimonC)
+
+) CApaProcess::OpenNewDocumentL() now takes a CStreamDictionary*& as an extra parameter - this is read in from the file that is opened (error spotted by Kevin).
+
+) ReadRootStreamL() and OpenNewDocumentL() take a TUint aFileMode as additional parameters. aFileMode indicates the mode in which the file should be opened. For most use this should be set to EFileShareExclusive|EFileWrite, while EFileShareExclusive|EFileRead should be used if the file is to be opened read only. These methods no longer try to open files with write access, retrying with read-only access if this fails. If you require this behaviour you'll have to do it yourself by trapping calls to these methods.
+
+) The following CApaProcess methods are now static:
+
+	static CStreamDictionary* ReadRootStreamLC(RFs& ,CFileStore*& ,const TDesC& ,TUint )
+	static void WriteRootStreamL(CFileStore& ,CStreamDictionary& ,const CApaApplication& )
+	static TApaAppIdentifier ReadAppIdentifierL(const CStreamStore& ,const CStreamDictionary& )
+	static void WriteAppIdentifierL(CStreamStore& ,CStreamDictionary& ,const TApaAppIdentifier& )
+
+Note that ReadRootStreamL() now takes an RFs& and WriteRootStreamL() has been overloaded with a version that takes a correctly constructed TApaAppIdentifier instead of a CApaApplication&
+
+) Access violation bug in ~CApaProcess() fixed (spotted by MartinB)
+
+) The plan for passworded documents:
+
+When a document's RestoreL() is called and it begins to restore, the first thing it should do is check to see whether its store contains an appropriate password stream. 
+If it does then this means the store is passworded, so prompt the user to enter the password (EikProcess should provide a method that pops up this dialog for you). 
+If the password is entered correctly then continue restoration.
+If the password is wrong, RestoreL() should leave KErrLocked.
+
+) CApaDoor::RestoreL() will not leave if a *glass* door's RestoreL() leaves with KErrLocked. 
+Instead it TRAP's the leave and iconises the document without restoring it. 
+In this way the user can try to open the document again later if they want to view it.
+
+) CApaDocument::CanDrawGlass() becomes Capability() - this returns a set of flags (defined in CApaDocument) as follows:
+	
+	enum {
+		ECanDrawGlass	=0x01,
+		ECanPrint		=0x02
+		};
+
+By default this method returns 0 (ie the doc can do nothing) - return any combination of the above flags if you feel more daring
+
+) CApaApplication::OpenIconFileLC() is now pure virtual - an implementation will be supplied by Eikon's CEikDocument
+
+
+
+
+
+AppArc.033
+==========
+
+10/1/97 by IanH
+
+Uses: E32[082] ; F32[046] ; Store[032] ; GDI[040] ; Fntstore[033] ; Fbserv[043] ; Bitgdi[043]
+
+Tools: E32Tools[049] ; E32Utils[004] ; GDITOOLS[028] ; GCCTOOLS[111]
+
+General
+
+1) Not binary compatible with 032
+
+2) Takes new GDI etc
+
+3) Definitions for KIconFileExtension, KIniFileExtension and KAppFileExtension are now publicised in apparc.h
+
+4) Ini files now always live on drive c:
+
+
+CApaApplication changes:
+
+5) OpenIconFileL() and OpenIniFileL() become LC and const
+
+6) New method: 
+
+	TFileName AppFullName()const;
+
+This should return the full path and name of the app - by default the dll name & location is returned but this method may be over-ridden by eg OPL to return another location. (requested by Howard)
+
+
+CApaDocument changes:
+
+7) CApaDocument::CreateFileStoreLC() has changed its specification. Previously it returned a stream dictionary and took a store by reference. The first thing any caller did after calling this function was to write the rootstream of the file to make it valid and then destroy the stream dictionary. The WriteRootStream() step has now been moved inside CreateFileStoreLC(), meaning that it now returns a CFileStore* instead of taking one by reference. One new line of code should be added at the end of applications' CreateFileStore() implementations:
+
+	iApaProcess->WriteRootStreamL(*store,*streamDic,*Application());
+
+This will ensure that CreateFileStoreLC() now returns a fully constructed and initialised file store (on the cleanup stack).
+
+
+CApaProcess changes:
+
+8) MainDocFileName() becomes const
+
+9) SetMainDocFileNameL(const TDesC&) loses the L - it can no longer leave, though it will panic if a filename larger than a TFileName is passed in.
+
+10) SetMainDocument(CApaDocument* aDocument) added. It panics if aDocument has not already been added using AddNewDocument() or OpenNewDocument()
+
+11) ImportNewDocumentL() becomes 
+
+	CApaDocument* OpenNewDocumentL(CFileStore*& aStore,const TDesC& aDocFullFileName)
+	
+It now returns the opened store via a parameter taken by reference. 
+
+12) SaveToDirectFileStoreL() withdrawn - this method will now be provided by Eikon.
+
+13) NewMainDocumentL() and OpenMainDocumentL() have been withdrawn. A combination of Open/AddNewDocument() and SetMainDocument() should now be used. Combined with the above changes this in fact gives Eikon and applications much more flexibility in creating and opening documents.
+
+Replacing a typical call to OpenMainDocumentL(), the following calls should take place:
+
+	// open the document
+	CFileStore* store = NULL;
+	CApaDocument* doc = apaProcess->OpenNewDocumentL(store,filePath);
+	// set it as the main document
+	apaProcess->SetMainDocument(doc);
+	apaProcess->SetMainDocFileName(filePath);
+
+Replacing a typical call to NewMainDocumentL(), the following calls should take place:
+
+	// create a new document
+	CApaDocument* doc = apaProcess->AddNewDocumentL(dllname);
+	apaProcess->SetMainDocument(doc);
+	// create the store and initialise it
+	CFileStore* store = doc->CreateFileStoreLC(apaProcess->FsSession(),filePath);
+	apaProcess->SetMainDocFileName(filePath);
+	// initialise the document with factory settings
+	doc->NewDocumentL();
+
+
+CApaDoor changes:
+
+14) If there is no caption in an application's icn file the Caption() in a containing CApaDoor is now set to a zero length descriptor instead of "UNKNOWN". This should be detectyed at a higher level and some locale specific message substituted.
+
+15) Default icon size should now be passed in to CApaDoor::NewL() - it is no longer hard-coded to TSize(500,500)
+
+
+
+
+AppArc.032
+==========
+
+19/12/96 by IanH
+
+Uses: E32[076] ; F32[042] ; Store[030] ; GDI[039] ; Fntstore[032] ; Fbserv[039] ; Bitgdi[041]
+
+Tools: E32Tools[048] ; E32Utils[004] ; GDITOOLS[027] ; GCCTOOLS[111]
+
+1) Binary compatible with 030 and 031 (B4 level)
+
+2) NewMainDocumentL() altered slightly such that the filename is correctly set before NewDocumentL() is called on the newly creaed document. This allows some speed optimisations in Word.
+
+
+
+
+AppArc.031
+==========
+
+17/12/96 by IanH
+
+Uses: E32[076] ; F32[042] ; Store[030] ; GDI[039] ; Fntstore[032] ; Fbserv[039] ; Bitgdi[041]
+
+Tools: E32Tools[048] ; E32Utils[004] ; GDITOOLS[027] ; GCCTOOLS[111]
+
+1) Binary compatible with 030
+
+2) As per the spec team decision the icons representing embedded objects are no longer resizable by dragging. 
+
+This effect is slightly weird because when the icon is highlighted it has the blobby marquee around it which somewhat implies that you can drag its extent. 
+However, if you try to drag one of the blobs you immediately launch the embedded application - not exactly intuitive.
+Maybe two different types of marquee are required, one to indicate dragableness and the other just focus (but this falls down when you consider using shift-drag to crop).
+
+
+
+AppArc.030
+==========
+
+13/12/96 by IanH
+
+Uses: E32[076] ; F32[042] ; Store[030] ; GDI[039] ; Fntstore[032] ; Fbserv[039] ; Bitgdi[041]
+
+Tools: E32Tools[048] ; E32Utils[004] ; GDITOOLS[027] ; GCCTOOLS[111]
+
+1) Binary compatible with 029
+
+Changes to CApaProcess:
+
+) SaveToDirectFileStoreL() now creates any temporary file on the same drive as the target document to ensure that RFs::Replace() works.
+
+) SaveToDirectFileStoreL() now checks that the store passed in is non-null and of the right type.
+
+) NewMainDocumentL() code re-arranged so that it is now rollback-robust (thanks Duncan). This fixes HA-383
+
+
+
+
+AppArc.028
+==========
+
+05/12/96 by IanH
+
+Uses: E32[076] ; F32[042] ; Store[030] ; GDI[039] ; Fntstore[032] ; Fbserv[039] ; Bitgdi[041]
+
+Tools: E32Tools[048] ; E32Utils[004] ; GDITOOLS[027] ; GCCTOOLS[111]
+
+1) B4 release. This is not compatible with the previous release.
+
+Changes:
+
+) CApaDoor::SetFormatToGlassL() no longer takes a TSize as a parameter. The embedded document is now relied upon to initially size itself sensibly and from then on to remember any changes in scaling and cropping.
+
+) Subtle chagnes to iconic doors - they are now scalable but not cropable. 
+
+) Any concept of document file extensions has been removed from application architecture, in line with current thinking:
+
+	CApaApplication::DocFileExtension() withdrawn, and extensions are no longer appended to filenames. App dll's, icon files and ini files retain their extensions.
+
+
+
+AppArc.027
+==========
+
+03/12/96 by IanH
+
+Uses: E32[075] ; F32[042] ; Store[030] ; GDI[039] ; Fntstore[032] ; Fbserv[039] ; Bitgdi[041]
+
+Tools: E32Tools[048] ; E32Utils[004] ; GDITOOLS[027] ; GCCTOOLS[111]
+
+1) B4 release
+
+Changes:
+
+) inline CApaDoor::GetFormat()const added that returns one of CApaDoor::EIconic or CApaDoor::EGlassDoor depending upon the door's current format.
+
+) Iconic door code re-written to (hopefully) solve the problems of resizing etc.
+
+) CApaApplication::OpenIniFileLC() is now implemented to return a CDictionaryStore (see Store release notes for details of this class). The path of the ini file is determined to be the same as that of the app dll unless the app dll is in ROM in which case the same path is used except on drive c:
+CDictionaryStore should be treated as a temporary object - all the time it exists the file is open, so the object should be destroyed as soon as it is finished with to ensure that other processes are not unnecessarily blocked from using the file.
+
+Here is some example code for using an ini file in a (possibly) typical scenario:
+
+	//
+	// open an app's ini file
+	CDictionaryStore* iniFile = Application()->OpenIniFileL(TheFs);
+	CleanupStack::PushL(iniFile);
+	//
+	// read the required data stream out of the file
+	RDictionaryReadStream readStream;
+	readStream.OpenL(*iniFile,aDataStreamUid);
+	TLotsOfData data;
+	readStream>> data;
+	readStream.Close();
+	//
+	// close the ini file
+	CleanupStack::PopAndDestroy(); // iniFile
+	iniFile = NULL;
+	//
+	//
+	// ...
+	// do loads of stuff (eg launch a dialog) that uses the data read in
+	// ...
+	//
+	//
+	// if the data has changed as a result of "doing stuff" then re-write it to the ini file
+	CDictionaryStore* iniFile = Application()->OpenIniFileL(TheFs);
+	CleanupStack::PushL(iniFile);
+	//
+	// write the new data
+	RDictionaryWriteStream writeStream;
+	writeStream.AssignL(*iniFile,aDataStreamUid);
+	writeStream<< data;
+	writeStream.CommitL();
+	writeStream.Close();
+	//
+	// commit the store safely and close it again
+	if (iniFile->Commit()!=KErrNone)
+		iniFile->RevertL(); // try to restore the store to it's previous state if things go wrong
+	CleanupStack::PopAndDestroy(); // iniFile
+	iniFile = NULL;
+	//
+
+
+AppArc.026
+==========
+
+27/11/96 by IanH
+
+Uses: E32[074] ; F32[041] ; Store[029] ; GDI[038] ; Fntstore[031] ; Fbserv[038] ; Bitgdi[040]
+
+Tools: E32Tools[046] ; E32Utils[003] ; GDITOOLS[027] ; GCCTOOLS[111]
+
+1) Takes new GDI etc., and new gditools (all bitmaps have to be reconverted).
+
+Changes:
+
+) RDebug::Print()'s removed from the apparc dll
+
+) CApaDoor::DetachFromStoreL() added to completely restore the embedded document.
+
+) CApaDocument::DetachFromStoreL(const CStreamStore& aStore) added. This does nothing by default - an app should supply an imlementation if they support deferred loading. In this case the action of this method should be to load in any data not yet internalized from the store, but not to overwrite any data already in memory.
+
+
+AppArc.025
+==========
+
+22/11/96 by IanH
+
+Uses: E32[074] ; F32[040] ; Store[029] ; GDI[037] ; Fntstore[030] ; Fbserv[037] ; Bitgdi[039]
+
+Tools: E32Tools[046] ; E32Utils[003] ; GDITOOLS[026] ; GCCTOOLS[111]
+
+1) Binary compatible bug fix release for Agenda and Data
+
+2) No new components taken
+
+Changes:
+
+) Files are now opened writable if this is possible, only defaulting to read-only if opening as writable fails. This allows documents based in permanent file stores to be edited :-) (Spotted by Kev)
+
+
+AppArc.024
+==========
+
+19/11/96 by IanH
+
+Uses: E32[074] ; F32[040] ; Store[029] ; GDI[037] ; Fntstore[030] ; Fbserv[037] ; Bitgdi[039]
+
+Tools: E32Tools[046] ; E32Utils[003] ; GDITOOLS[026] ; GCCTOOLS[111]
+
+1) This release is being made primarily to allow work to proceed on OPL
+
+2) No new components taken
+
+Changes:
+
+) Some files have changed name:
+	AppIcnfl.*  -> ApaIcnfl.*
+	AppPriv.h   -> ApaDll.h
+	AppStd.h    -> ApaStd.h
+	AppUtil.cpp -> ApaStd.cpp
+
+) CApaIconFileWriter::AddIconL(CApaMaskedBitmap& aIcon) added.
+
+) TAppCaption becomes TApaAppCaption
+
+
+AppArc.023
+==========
+
+15/11/96 by IanH
+
+Uses: E32[074] ; F32[040] ; Store[029] ; GDI[037] ; Fntstore[030] ; Fbserv[037] ; Bitgdi[039]
+
+Tools: E32Tools[046] ; E32Utils[003] ; GDITOOLS[026] ; GCCTOOLS[111]
+
+2) This release reinstates all the testcode that was dropped in the change to the new directory structure.
+
+3) The base address for the AppArc dll is now set as 0x40000000 in line with MartinB's revised suggestion.
+
+4) AppArc.dll now supports typesafe linking with uid KApparcDllUid = 0x100000DE
+
+5) New releasable appdata that contains the default icn file (see below). It should be fetched into:
+	\Epoc32\Release\Wins\Rel\Z\System\Data
+	\Epoc32\Release\Wins\Deb\Z\System\Data
+	\Epoc32\Release\Marm
+
+and the following line should be placed in .oby files:
+
+	data=\Epoc32\Release\Marm\default.icn System\Data\default.icn
+
+
+Changes:
+
+) CApaDoor now has access to a default icon file which it uses if it can't locate the correct icon file (eg the app used to embed an object was on a CF card). This means that apps no longer *require* the existance of an icon file to be embeddable
+
+) The persistant format of *glass* doors has changed , so files containing such doors will be incompatible with previous versions of apparc.
+
+) TDesC* CApaDoor::Caption() added that returns the name of the app with which the embedded object is associated. 
+
+) CApaApplication::IniFileUid() and IconFileUid() have been withdrawn as they were of no use and made no sense.
+
+) CApaDocument::HasChanged() is now pure virtual, and CApaDocument no longer has a TBool iChanged as member data. This keeps apparc policy independant as different apps will want to implement this function in different ways. Eikon may supply a default implemenation...
+
+) CApaDoor* NewLC(CApaDocument& aDoc,...) no longer takes a CApaProcess as a parameter as it can get at this pointer via the aDoc parameter.
+
+) CApaProcess::WriteRootStreamL() now takes a const CApaApplication& instead of a CApaDocument. This app should be the application used to create the main doc in the file being written.
+
+) CApaProcess::SaveToDirectFileStoreL() has changed in the same way as WriteRootStreamL()
+
+) Extra type checking of document added to CApaProcess::ReadRootStreamL(). This method now leaves KErrCorrupt if the file is not of the correct type.
+
+) TApaPictureFactory now takes a MGraphicsDeviceMap* on construction
+
+) CApaApplication::OpenIconFileLC() now just OpenIconFileL() because this call was often being trapped and the C caused aggro.
+
+) Some CApaDoor methods that took a TSize as a parameter now take a const TSize& instead
+
+Bug Fixes:
+
+) The correct UID for the icon file is now used in CApaApplication::OpenIconFileLC()
+
+) CApaApplication::Dll() now const
+
+) Resizing of embedded icons should now work properly.
+
+) CApaProcess::ReadRootStreamLC() now opens the store in read only mode (so files can be read from ROM). If you wish to make your CFileStore writable call CFileStore::File().ChangeMode(EFileShareExclusive|EFileWrite) to get exclusive write access. (Spotted by Duncan)
+ 
+Test Code:
+
+) T_Pro extended to test the embedding subsystem when some required app dlls and/or icn files are not present.
+
+
+
+AppArc.020
+==========
+
+3/11/96 by DavidW
+
+Uses: E32Tools[045] ; E32[072] ; F32[038] ; Store[028] ; GDI[036] ; Fntstore[030] ; Fbserv[036] ; Bitgdi[039]
+
+1)  Fixed an infinite loop bug in CApaProcess::FindAppInListL() which
+meant that a second app couldn't be added to a process
+
+
+AppArc.019
+==========
+
+31/10/96 by DavidW
+
+Uses: E32Tools[045] ; E32[072] ; F32[038] ; Store[028] ; GDI[036] ; Fntstore[030] ; Fbserv[036] ; Bitgdi[039]
+
+1)  Upgraded to E32[072] et al.  Rebuilt the Wins Release and Debug
+variants, and the Gcc Release variant.  Test code not rebuilt! 
+Relying on Eikon's test code for now
+
+2)  As suggested by Julian, provided CApaProcess with a public
+accessor function FsSession() which returns a reference to the RFs
+held inside CApaProcess property
+
+3)  Fixed MNT GETSRC not to impose a version number if none has been
+given from the command line
+
+4)  Fixed MNT GETBLD to only run the MAKEWORK and GETTOOLS once,
+instead of twice
+
+
+AppArc.018
+==========
+
+29/10/96 by DavidW
+
+Uses: E32Tools[045] ; E32[071] ; F32[037] ; Store[027] ; GDI[035] ; Fntstore[029] ; Fbserv[035] ; Bitgdi[038]
+
+1)  Moved up to Store[027], and therefore dropped Apparc's copy of
+the CStreamDictionary class
+
+2)  Also moved up to F32[037]
+
+3)  CApaProcess::NewMainDocumentL() now supports being called with a
+zero-length filename, in which case the function no longer attempts
+to create a file of this name, but returns NULL for the CFileStore*
+handle; this supports applications that don't create files
+
+4)  Made the MainDocFileName() function of CApaProcess simply return
+a const TDesC*, instead of going to the overhead of calling the Des()
+function on the internal HBuf variable; this is also important for
+applications that don't create files (since otherwise the function
+involved creating a TPtr from the NULL pointer)
+
+5)  The above changes mean that the iMainDoc and iMainDocFileName
+data members of CApaProcess can revert to being private (previously I
+had patched the INCC release component of AppArc 017 to make them
+public, else Eikon couldn't work)
+
+6)  Fixed a series of latent fatalities by altering code like
+	delete iMainDocFileName;
+	iMainDocFileName = xxx.AllocL();
+to insert the line
+	iMainDocFileName = NULL;
+in between the delete and the AllocL()
+
+7)  Fixed a bug pointed out by MartinD and Jezar in that the
+ReadRootStreamLC() function was always opening the file in read mode
+only, which is fine for Direct stores but not for Permanent
+("re-writable") ones; note that some decision will need to be taken
+shortly on how to cope with read-only data files
+
+8)  As suggested by MartinB & Duncan, changed the Changed() function
+in CApaDocument to be virtual and const, and renamed it to
+HasChanged(); the default implementation remains to return the value
+of the iChanged member data, but some applications may prefer to
+implement change tracking in a more sophisticated manner
+
+9)  As suggested by MartinB, altered the StoreL() function of
+CApaDocument to be const, since Store is a const operation.  At the
+same time, applied const to various other CApaDocument functions
+
+10) Added UNLOCK and LOCK verbs to MNT.CMD.
+
+
+AppArc.017
+==========
+
+18/10/96 by IanH
+
+Uses: E32Tools[045] ; E32[071] ; F32[036] ; Store[026] ; GDI[035] ; Fntstore[029] ; Fbserv[035] ; Bitgdi[038]
+
+ARM release size:
+
+apparc.dll  18,108
+
+General
+=======
+
+) Not binary compatible with previous release
+
+
+Changes
+=======
+
+Changes to CApaProcess:
+
+) At the request of MartinB all member data is now private and accessor functions have been supplied as required.
+
+) DestroyDocumentL() no longer takes the CApaDocument* by reference (and consequently no longer sets it to null).
+
+Changes to CApaDocument:
+
+) At the request of MartinB iChanged is now protected and has an inline accessor function Changed()
+
+General changes:
+
+) Fixed mnt getrel so it no longer does mad stuff (thanks Julian)
+
+) Extended the embedding testcode slightly
+
+
+Still To Come
+=============
+
+) .ini files (with visited document lists)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/group/app-framework_apparc.history.xml	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,107 @@
+<?xml version="1.0"?>
+<relnotes schema="1.0.0" name="Application Architecture" purpose="" type="component">
+<revision major="1" functional="0" minor="5" date="20080820">
+    <ref name="125788" type="defect"/>
+    <description> RApaLsSession::CancelRecognizeFiles() complete the TRequestStatus that was passed to RApaLsSession::RecognizeFilesL(). </description>
+  </revision>
+  <revision major="1" functional="0" minor="4" date="20080528">
+    <ref name="122634" type="defect"/>
+    <description> If drive name is present in the filename then it scans through the \\sys\\bin of that particular drive,
+	otherwise it scans through the \\sys\\bin folders in all the avaliable drives.</description>
+  </revision>	   	
+  <revision major="1" functional="0" minor="3" date="20080305">
+    <ref name="119000" type="defect"/>
+    <description>Changed documetnation in How To Port Guide: Control Panel Plugins.doc correctly.
+Changed out of date documentation in apgctl.h and apgctl.cpp
+Removed incorrect check in CApaSystemControl::ConstructL()</description>
+  </revision>
+  <revision major="1" functional="0" minor="2" date="20071226">
+    <ref name="115489" type="defect"/>
+    <description>Behavior of CApaAppServiceBase::SecurityCheckL() is made to pass security checks always as this is the default behavior</description>
+  </revision>
+  <revision major="1" functional="0" minor="1" date="20071203">
+    <ref name="114861" type="defect"/>
+    <description>Modified documentation of RApaLsSession::GetSupportedDataTypesL() and RApaLsSession::DeleteDataMapping() appropriately.</description>
+  </revision>
+  <revision major="1" functional="0" minor="0" date="20070828">
+    <ref name="1803" type="preq"/>
+    <description>Added CApfMimeContentPolicy API to apfile.dll.  It is used for checking MIME types and 
+file extensions against closed content list.</description>
+  </revision>
+  <purpose>
+    Framework environment for applications and application data, defines key application responsibilities and interactions with data and UI.
+  </purpose>
+  <defect number="PDEF106618" title="Apparc should kill the child process if a leave occurs" revision="019">
+    Child Process is terminated if SetOpaqueDataL() and SetProcessEnvironmentL() function leaves.
+  </defect>
+  <defect number="PDEF106542" title="t_IntegritySupportReboot2 test fails for WINSCW builds" revision="018">
+    PDEF106542:t_IntegritySupportReboot2 test fails for WINSCW builds
+  </defect>
+  <defect number="DEF104372" title="AppArc's T_ProcStep TEF test doesn't actually work" revision="017">
+    The mismatch between UID used in ParentProcess_reg.rss and ParentProcess_Main.cpp, and UID used in the MMP file has been corrected.
+    Minor change in apparc CApaParentProcessMonitor::RunL
+  </defect>
+  <defect number="DEF103470" title="RApaLsSession::SetAppShortCaption() does not deal correctly with ELangNone" revision="016">
+    Appropriate changes are made while setting short caption with ELangNone. While updating short caption precedence is given to other application languages over ELangNone if it is present.
+  </defect>
+  <defect number="PDEF102728" title="STABILITY: Unchecked return value of RBuf::Create, potential User::11!" revision="015">
+    Update CApaApplication::GenerateFileName to return KErrNoMemory if RBuf::Create() fails.
+  </defect>
+  <defect number="PDEF102643" title="There are still references to \\system\\apps folder in apparc code" revision="014">
+    Update KApplicationLocation constant in apparc.cpp to point to the data-caged location ('\\sys\\bin\\').
+  </defect>
+  <defect number="DEF101056" title="t_ServiceRegistry test fails for WINSCW builds" revision="013">
+    Update test code so the heap check is not performed in the server side for this t_ServiceRegistry test case.
+  </defect>
+  <defect number="DEF099074" title="Memory leaks and crashes in app startup" revision="012">
+    Part of fix to problem with memory leaks and crashes in app startup, found using the WillHeapChecker tool. See also Cone and Uikon changes.
+  </defect>
+  <defect number="INC098717" title="support for scalable midlet icons is missing" revision="011">
+    Added test code to test :
+    
+    TInt RApaLsSession::GetAppIcon(TUid aAppUid, RFile&amp; aFile) const API
+    
+    for native and non-native apps for SVG and MBM icons.
+  </defect>
+  <defect number="INC098717" title="support for scalable midlet icons is missing" revision="010">
+    Added a new API -
+    EXPORT_C TInt RApaLsSession::GetAppIcon(TUid aAppUid, RFile&amp; aFile) const
+    
+    It gets an open read only file handle to the application icon file for the application with the specified UID.
+    
+    Non-native application icons stored in the private data cage of AppArc, can now be accessed using this API.
+  </defect>
+  <defect number="DEF100340" title="t_services test fails for WINSCW builds" revision="009">
+    The type store gets updated whenever any of these function (InsertDataMapping() &amp; DeleteDataMapping()) call is made. Due to the timing issue, the method &#xE2;&#x20AC;&#x2122;WaitForTypeStoreUpdate()&#xE2;&#x20AC;&#x2122; has been moved inside the test cases TestServiceDiscovery9() &amp; TestPrioritySystemL() soon after the call to &#xE2;&#x20AC;&#x2122;DeleteDataMapping()&#xE2;&#x20AC;&#x2122;. The type store updation takes on the server side while the test case is still running which causes the heap check to fail.To avoid the heap check on the server side DONT_CHECK macro is used.
+  </defect>
+  <defect number="INC100656" title="Apparc can panic with APFILE:0 during emulator boot" revision="008">
+    Condition has been added to check the presence of removable media drive(s), before issuing a request for removable media scan during phone boot.
+  </defect>
+  <defect number="DEF100338" title="t_controlpanel test fails for WISNCW builds" revision="007">
+    Delay in Apparc test script is increased to ensure that apparc is fully initialised and to avoid intermittent test failure on ONB.
+  </defect>
+  <minorchange revision="006">
+    Correct the path for FileWithUnknownMimeType.UnrecognisableExtention in apparctest.iby to remove the ROM building warning
+  </minorchange>
+  <defect number="PDEF100157" title="loading recognisers on demand - need emulator configuration support" revision="005">
+    In APSCONSTDATA.CPP comments are updated to make sure that
+    patchdata_apserv_dll_KApaLoadDataRecognizersOnDemand 1 line is added to epoc.ini.
+    Code lines are put in place in CApaAppListServer::CApaAppListServer(TInt aPriority) ,present in APSSERV.CPP so that if WINS then it read the value from epoc.ini. UserSvr::HalFunction( ... ) is used to check epoc.ini for a specific emulator property.
+  </defect>
+  <defect number="DEF099521" title="DP: [TBAS] apparctest_t_nonnativeapps.script crashes on Functional DP-ROM." revision="004">
+    Changes have been made in Apparc test code. Due to paging under Functional configuration of DP, the time required for Apparc update is added as part of solution. That is, a user delay of 5sec is introduced sufficient enough for Apparc to close the test app.
+  </defect>
+  <defect number="DEF095225" title="Platsec errors introduced since previous UIF defect fixes submission" revision="003">
+    Platsec errors introduced by previous defect submissions in T_Nonnativeapps are corrected by wrapping tests within APPFWK_EXPECTED_PLATSEC_START and
+    APPFWK_EXPECTED_PLATSEC_FINISH Macros. Other Platsec errors are resolved by making changes in Test code of T_Rulebasedlaunching and TShutter.
+  </defect>
+  <cr number="0902" title="Enable Dynamic Language Switching in APPARC, ECOM and EIKSTD" revision="002">
+    Added new test cases to test the changes made in apparc component to enable dynamic language switching.
+    Test cases have been added in existing T_Locale test step.
+  </cr>
+  <cr number="0902" title="Enable Dynamic Language Switching in APPARC, ECOM and EIKSTD" revision="001">
+    Changes have been made in apparc component to reload the locale information (caption, short caption and icon file name) for all installed applications and their views on language change event.
+    
+    To enable dynamic language switching in apparc, apparc now monitors language change event using RChangeNotifier. On language change event, apparc issues a rescan on app-list which updates localisable information for all applications and their views in the app-list.
+  </cr>
+</relnotes>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/group/app-framework_apparc.mrp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,14 @@
+component	app-framework_apparc
+source	\sf\mw\appsupport\appfw\apparchitecture
+binary	\sf\mw\appsupport\appfw\apparchitecture\group	all
+exports	\sf\mw\appsupport\appfw\apparchitecture\group
+notes_source	\component_defs\release.src
+
+
+#  == IPR section auto-inserted from distribution.policy files  ==
+ipr D 
+ipr T \sf\mw\appsupport\appfw\apparchitecture\tdata
+ipr T \sf\mw\appsupport\appfw\apparchitecture\tdatasrc
+ipr T \sf\mw\appsupport\appfw\apparchitecture\tef
+
+# == end auto-inserted section ==
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/AIFTOOL.RH	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,243 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// contains definitions for the resource files that are input to AIF files
+// 
+//
+
+
+// constants for capability.hidden
+#define KAppNotHidden	0
+#define KAppIsHidden	1
+
+// constants for capability.newfile
+#define KAppDoesNotSupportNewFile	0
+#define KAppSupportsNewFile			1
+
+// constants for capability.embeddability
+#define KAppNotEmbeddable				0
+#define KAppEmbeddable					1
+#define KAppEmbeddableOnly				2
+#define KAppEmbeddableUiOrStandAlone	5
+#define KAppEmbeddableUiNotStandAlone	6
+
+// constants for capability.launch
+#define KAppLaunchInForeground	0
+#define KAppLaunchInBackground	1
+
+// application group name
+#define KAppMaxGroupName 16
+
+
+
+///////////////////////////
+// HEADER INFO
+///////////////////////////
+
+STRUCT AIF_DATA
+	{
+	LONG app_uid;
+	//
+	WORD num_icons=0; // each icon should be a bitmap/mask pair
+	//
+	LEN WORD STRUCT caption_list[]; // CAPTION
+	//
+	BYTE hidden=KAppNotHidden;
+	BYTE embeddability=KAppNotEmbeddable;
+	BYTE newfile=KAppDoesNotSupportNewFile;
+	BYTE launch=KAppLaunchInForeground;
+	LTEXT groupName(KAppMaxGroupName)="";
+	//
+	LEN WORD STRUCT datatype_list[]; // DATATYPE
+	//
+	LEN WORD STRUCT view_list[]; // VIEW_DATA
+	//
+	LEN WORD STRUCT file_ownership_list[]; // FILE_OWNERSHIP_INFO
+	}
+
+
+///////////////////////////
+// CAPTIONS
+///////////////////////////
+
+#define KMaxCaption 256
+
+enum 
+	{
+	ELangTest,					// 00
+	ELangEnglish,				// 01
+	ELangFrench,				// 02
+	ELangGerman,				// 03
+	ELangSpanish,				// 04
+	ELangItalian,				// 05
+	ELangSwedish,				// 06
+	ELangDanish,				// 07
+	ELangNorwegian,				// 08
+	ELangFinnish,				// 09
+	ELangAmerican,				// 10
+	ELangSwissFrench,			// 11
+	ELangSwissGerman,			// 12
+	ELangPortuguese,			// 13
+	ELangTurkish,				// 14
+	ELangIcelandic,				// 15
+	ELangRussian,				// 16
+	ELangHungarian,				// 17
+	ELangDutch,					// 18
+	ELangBelgianFlemish,		// 19
+	ELangAustralian,			// 20
+	ELangBelgianFrench,			// 21
+	ELangAustrian,				// 22
+	ELangNewZealand,			// 23
+	ELangInternationalFrench,	// 24
+	ELangCzech,					// 25
+	ELangSlovak,				// 26
+	ELangPolish,				// 27
+	ELangSlovenian,				// 28
+	ELangTaiwanChinese,			// 29
+	ELangHongKongChinese,		// 30
+	ELangPrcChinese,			// 31
+	ELangJapanese,				// 32
+	ELangThai,					// 33
+	ELangAfrikaans,				// 34
+	ELangAlbanian,				// 35
+	ELangAmharic,				// 36
+	ELangArabic,				// 37
+	ELangArmenian,				// 38
+	ELangAzerbaijani,			// 39
+	ELangBelarussian,			// 40
+	ELangBengali,				// 41
+	ELangBulgarian,				// 42
+	ELangBurmese,				// 43
+	ELangCatalan,				// 44
+	ELangCroatian,				// 45
+	ELangCanadianEnglish,		// 46
+	ELangInternationalEnglish,	// 47
+	ELangSouthAfricanEnglish,	// 48
+	ELangEstonian,				// 49
+	ELangFarsi,					// 50
+	ELangCanadianFrench,		// 51
+	ELangScotsGaelic,			// 52
+	ELangGeorgian,				// 53
+	ELangGreek,					// 54
+	ELangCyprusGreek,			// 55
+	ELangGujarati,				// 56
+	ELangHebrew,				// 57
+	ELangHindi,					// 58
+	ELangIndonesian,			// 59
+	ELangIrish,					// 60
+	ELangSwissItalian,			// 61
+	ELangKannada,				// 62
+	ELangKazakh,				// 63
+	ELangKhmer,					// 64
+	ELangKorean,				// 65
+	ELangLao,					// 66
+	ELangLatvian,				// 67
+	ELangLithuanian,			// 68
+	ELangMacedonian,			// 69
+	ELangMalay,					// 70
+	ELangMalayalam,				// 71
+	ELangMarathi,				// 72
+	ELangMoldavian,				// 73
+	ELangMongolian,				// 74
+	ELangNorwegianNynorsk,		// 75
+	ELangBrazilianPortuguese,	// 76
+	ELangPunjabi,				// 77
+	ELangRomanian,				// 78
+	ELangSerbian,				// 79
+	ELangSinhalese,				// 80
+	ELangSomali,				// 81
+	ELangInternationalSpanish,	// 82
+	ELangLatinAmericanSpanish,	// 83
+	ELangSwahili,				// 84
+	ELangFinlandSwedish,		// 85
+	ELangTajik,					// 86
+	ELangTamil,					// 87
+	ELangTelugu,				// 88
+	ELangTibetan,				// 89
+	ELangTigrinya,				// 90
+	ELangCyprusTurkish,			// 91
+	ELangTurkmen,				// 92
+	ELangUkrainian,				// 93
+	ELangUrdu,					// 94
+	ELangUzbek,					// 95
+	ELangVietnamese,			// 96
+	ELangWelsh,					// 97
+	ELangZulu,					// 98
+	ELangOther					// 99
+	};
+
+
+STRUCT CAPTION
+	{
+	WORD code;
+	LTEXT caption(KMaxCaption);
+	}
+
+///////////////////////////
+// DATATYPE
+///////////////////////////
+
+#define KMaxDataTypeLength 256
+
+enum
+	{
+	EDataTypePriorityHigh=10000,
+	EDataTypePriorityNormal=0,
+	EDataTypePriorityLow=-10000,
+	EDataTypePriorityLastResort=-20000
+	};
+
+STRUCT DATATYPE
+	{
+	WORD priority;
+	LTEXT8 type(KMaxDataTypeLength);
+	}
+
+///////////////////////////
+// VIEW_DATA
+///////////////////////////
+
+STRUCT VIEW_DATA
+	{
+	LONG view_uid;
+	//
+	LONG screen_mode=0;
+	//
+	WORD num_icons=0; // each icon should be a bitmap/mask pair
+	//
+	LEN WORD STRUCT caption_list[]; // CAPTION
+	}
+
+///////////////////////////
+// FILE_OWNERSHIP_INFO
+///////////////////////////
+
+#define KMaxFileNameLength 256
+
+STRUCT FILE_OWNERSHIP_INFO
+	{
+	LTEXT file_name(KMaxFileNameLength);
+	}
+
+///////////////////////////
+// MEMORY
+///////////////////////////
+
+// not yet implemented
+
+STRUCT MEMORY
+	{
+	LONG minheap;
+	LONG maxheap;
+	LONG stack;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/APACLN.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,69 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+#if !defined(__APACLN_H__)
+#define __APACLN_H__
+
+#if !defined(__APPARC_H__)
+#include <apparc.h>
+#endif
+
+
+class TApaDocCleanupItem
+/** Allows CApaDocument-derived objects to be safely put onto the cleanup 
+stack, by calling CApaProcess::DestroyDocument() should a leave or a call 
+to CleanupStack::PopAndDestroy() occur.
+
+It is used as follows.
+@code
+TApaDocCleanupItem cleanup(iEikonEnv->Process(),doc);
+CleanupStack::PushL(cleanup);
+// some potentially leaving code here ...
+CleanupStack::Pop(cleanup);
+@endcode
+@publishedPartner
+@deprecated
+*/
+	{
+public:
+	inline TApaDocCleanupItem(CApaProcess* aProcess,CApaDocument* aDoc);
+	inline operator TCleanupItem();
+private:
+	IMPORT_C static void DoCleanup(TAny* aPtr);
+public:
+	/** The process object that will be used to destroy the document. */
+	CApaProcess* iApaProcess;
+	/** The document to destroy as part of cleanup. */
+	CApaDocument* iApaDoc;
+	};
+
+
+inline TApaDocCleanupItem::TApaDocCleanupItem(CApaProcess* aProcess,CApaDocument* aDoc)
+	: iApaProcess(aProcess), iApaDoc(aDoc)
+/** Constructs a cleanup item object for the specified document.
+
+@param aProcess A pointer to the process object that will be used to destroy the document.
+@param aDoc The document to destroy as part of cleanup. */
+	{}
+
+inline TApaDocCleanupItem::operator TCleanupItem()
+/** A TCleanupItem cast operator that enables the TApaDocCleanupItem object to be pushed to 
+the cleanup stack as a TCleanupItem, so that the document will be properly destroyed 
+(by a call to CApaProcess::DestroyDocument()) should a leave or a call to 
+CleanupStack::PopAndDestroy() occur. */
+	{return TCleanupItem(DoCleanup,this);}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/APACMDLN.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,178 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#if !defined(__APACMDLN_H__)
+#define __APACMDLN_H__
+
+#if !defined(__E32BASE_H__)
+#include <e32base.h>
+#endif
+
+#if !defined(__APADEF_H__)
+#include <apadef.h>
+#endif
+
+#if !defined(__F32FILE_H__)
+#include <f32file.h>
+#endif
+
+#if !defined(__S32STRM_H__)
+#include <s32strm.h>
+#endif
+
+
+class CApaCommandLine : public CBase
+/** Information for launching an application.
+
+This is often referred to as a command line and contains:
+
+the name of an application EXE to be launched,
+
+a document name,
+
+a command code that defines the way the application is launched
+
+trailing data; the structure of this depends on the application to be launched.
+
+The information is held in a buffer implemented by a heap descriptor. 
+
+@publishedAll
+@released */
+	{
+public:
+	// construction/destruction
+	IMPORT_C static CApaCommandLine* NewL();
+	IMPORT_C static CApaCommandLine* NewLC();
+	IMPORT_C ~CApaCommandLine();
+
+	// Getting/setting the CApaCommandLine to/from process environment-slots
+	IMPORT_C void SetProcessEnvironmentL(RProcess& aProcess) const;
+	IMPORT_C static TInt GetCommandLineFromProcessEnvironment(CApaCommandLine*& aCommandLine);
+
+	// Getting/setting the CApaCommandLine to/from a server IPC-message
+	IMPORT_C void GetIpcArgsLC(TIpcArgs& aIpcArgs) const;
+	IMPORT_C void ConstructCmdLineFromMessageL(const RMessage2& aMessage);
+
+	// operations on the document name
+	IMPORT_C void SetDocumentNameL(const TDesC& aDocName);
+	IMPORT_C TPtrC DocumentName() const;
+
+	// operations on the executable name
+	IMPORT_C void SetExecutableNameL(const TDesC& aAppName);
+	IMPORT_C TPtrC ExecutableName() const;
+	
+	IMPORT_C void SetOpaqueDataL(const TDesC8& aOpaqueData);
+	IMPORT_C TPtrC8 OpaqueData() const;
+
+	// operations on the tail end
+	IMPORT_C void SetTailEndL(const TDesC8& aTailEnd);
+	IMPORT_C TPtrC8 TailEnd() const;
+
+	// operations on the command
+	IMPORT_C void SetCommandL(TApaCommand aCommand);
+	IMPORT_C TApaCommand Command() const;
+
+	// operations on the parent process id
+	IMPORT_C void SetParentProcessId(TProcessId aProcessId);
+	IMPORT_C TProcessId ParentProcessId() const;
+
+	// operations on the file passed by handle
+	IMPORT_C void SetFileByHandleL(const RFile& aFile);
+	IMPORT_C void GetFileByHandleL(RFile& aFile) const;
+public:
+
+	// operations on the server requirement/differentiator number - 0 means no server, non-zero sets the differentiator for the server name
+	IMPORT_C void SetServerNotRequiredL();
+	IMPORT_C void SetServerRequiredL(TUint aServerDifferentiator);
+	IMPORT_C TUint ServerRequired() const;
+
+	// operations to support starting an application with a specific screen number
+	IMPORT_C void SetDefaultScreenL(TInt aDefaultScreenNumber);
+	IMPORT_C TInt DefaultScreen() const;
+	IMPORT_C TBool IsDefaultScreenSet() const;
+
+	// Operations to support window chaining
+	IMPORT_C void SetParentWindowGroupID(TInt aParentWindowGroupID);
+	IMPORT_C TInt ParentWindowGroupID() const;
+
+	// operations to support passing memory-allocation failure settings in to applications
+	IMPORT_C void SetDebugMemFailL(TInt aDebugMemFail);
+	IMPORT_C TInt DebugMemFail() const;
+
+	// operations to support the instrumentation (i.e. profiling) of application startup
+	IMPORT_C void SetAppStartupInstrumentationEventIdBaseL(TInt aEventIdBase);
+	IMPORT_C TInt AppStartupInstrumentationEventIdBase() const;
+
+	IMPORT_C static TInt EnvironmentSlotForPublicUse(TInt aIndex);
+
+private:
+	struct SOption
+		{
+		const TDesC* iToken;
+		TInt* iResult;
+		TRadix iRadix;
+		HBufC8* iHBufC8Result;
+		};
+
+private:
+	CApaCommandLine();
+	void SetServerDifferentiatorL(TUint aServerDifferentiator);
+	void ExternalizeL(RWriteStream& aStream) const;
+	void InternalizeL(RReadStream& aStream);
+	HBufC8* StreamableAttributesLC() const;
+	void GetCommandLineFromProcessEnvironmentL();
+	TInt Parse(const TDesC& aCmdLine);
+	TPtrC StripQuotes(const TDesC& aDes) const;
+
+private:
+	enum
+		{
+		EEnvironmentSlotUnused=0,
+
+		EEnvironmentSlotMain=1,
+		EEnvironmentSlotFsSession=2,
+		EEnvironmentSlotFile=3,
+
+		EFirstEnvironmentSlotForPublicUse=8,
+		ENumberOfEnvironmentSlotsForPublicUse=4
+		};
+
+	enum
+		{
+		EIpcSlotMain=0,
+		EIpcSlotFsSession=1,
+		EIpcSlotFile=2
+		};
+public:
+	enum
+		{
+		EIpcFirstFreeSlot=3
+		};
+private:
+	HBufC* iDocumentName;
+	HBufC* iExecutableName;
+	HBufC8* iOpaqueData;
+	HBufC8* iTailEnd;
+	TApaCommand iCommand;
+	TUint iServerDifferentiator;
+	TInt iDefaultScreenNumber;
+	TInt iParentWindowGroupID;
+	TInt iDebugMemFail;
+	TInt iAppStartupInstrumentationEventIdBase;
+	RFile iFile;
+	TProcessId iParentProcessId;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/APADBASE.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,127 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __APADBASE_H__
+#define __APADBASE_H__
+
+#if !defined(__E32STD_H__)
+#include <e32std.h>
+#endif
+#if !defined(__S32STD_H__)
+#include <s32std.h>
+#endif
+#if !defined(__GDI_H__)
+#include <gdi.h>
+#endif
+
+
+class CApaDoorBase : public CPicture
+// Base class for a wrapper for embedded CApaDocuments
+/** The base class for the graphic representation of an embedded document.
+
+An embedded document can be represented either as an icon or as a glass picture. 
+Such a graphic representation is known as a door.
+
+The class is intended for derivation.
+
+@publishedAll 
+@released
+@see CApaDoor
+@see CApaModelDoor */
+	{
+public:
+	
+	/** Defines the possible formats for the graphical representation of the embedded 
+	document. */
+	enum TFormat {
+		/** The representation is an icon. */
+		EIconic,
+		/** The representation is a glass door. */
+		EGlassDoor,
+		/** The representation is a glass door but has been temporarily switched to an icon. */
+		ETemporarilyIconic
+		};
+public:
+	inline TFormat Format()const;
+	inline TUid Source()const;
+	inline void SetSource(TUid aSource);
+	// Virtuals from CPicture
+	IMPORT_C virtual TStreamId StoreL(CStreamStore& aStore) const;
+	IMPORT_C virtual void SetScaleFactor(TInt aScaleFactorWidth,TInt aScaleFactorHeight); 
+	IMPORT_C virtual void SetCropInTwips(const TMargins& aMargins); 
+	IMPORT_C virtual TPictureCapability Capability() const;
+	IMPORT_C virtual void GetCropInTwips(TMargins& aMargins) const; 
+	IMPORT_C virtual TInt ScaleFactorWidth() const; 
+	IMPORT_C virtual TInt ScaleFactorHeight() const; 
+	IMPORT_C virtual TBool LineBreakPossible(TUint aClass,TBool aBeforePicture,TBool aHaveSpaces) const;
+	IMPORT_C virtual TBool NativePixelSize(TSize& aPixelSize);
+protected:
+	IMPORT_C CApaDoorBase();
+	IMPORT_C void ExternalizeBaseStreamL(CStreamStore& aStore,CStreamDictionary& aStreamDict)const;
+	IMPORT_C TSize InternalizeBaseStreamL(const CStreamStore& aStore,const CStreamDictionary& aStreamDict); // returns current size in twips
+
+private:
+	IMPORT_C virtual void CApaDoorBase_Reserved1();
+	IMPORT_C virtual void CApaDoorBase_Reserved2();
+protected:
+
+	/** Returns the size of the glass door, in twips.
+	
+	A concrete implementation of this function is provided by derived classes.
+	
+	@return The size of the glass door, in twips. 
+	
+	@publishedAll 
+	@released */
+	virtual TSize GlassDoorSize()const=0;
+protected:
+	TFormat iFormat;
+	TUid iSource; // foreign representation of a translated door (eg MS Word doc)
+
+private:
+	TInt iCApaDoorBase_Reserved1;
+	};
+
+//
+// inlines
+//
+
+inline CApaDoorBase::TFormat CApaDoorBase::Format()const
+	/** Gets the current format of the representation of the embedded document.
+	
+	@return The format for the representation of the embedded document. */
+	{ return iFormat; }
+
+inline TUid CApaDoorBase::Source()const
+	/** Gets the UID that identifies this door when the source originates on a non-Symbian 
+	OS device.
+	
+	This is used by converters.
+	
+	@return The UID for the non-Symbian OS source. For a source that originates 
+	on a Symbian OS phone, this is KNullUid. */
+	{ return iSource; }
+
+inline void CApaDoorBase::SetSource(TUid aSource)
+	/** Sets the UID that identifies this door when the source originates on a non-Symbian 
+	OS device.
+	
+	This is used by converters.
+	
+	@param aSource The UID for the non-Symbian OS source. For a source that originates 
+	on a Symbian OS phone, this is KNullUid. */
+	{ iSource=aSource; }
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/APADEF.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,291 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __APADEF_H__
+#define __APADEF_H__
+
+#if !defined(__E32BASE_H__)
+#include <e32base.h>
+#endif
+
+// comand line tokens
+
+/**
+@internalComponent
+*/
+const TUint KApaCommandLetterOpen='O';
+
+/**
+@internalComponent
+*/
+const TUint KApaCommandLetterCreate='C';
+
+/**
+@internalComponent
+*/
+const TUint KApaCommandLetterRun='R';
+
+/**
+@internalComponent
+*/
+const TUint KApaCommandLetterBackground='B';
+
+/**
+@internalComponent
+*/
+const TUint KApaCommandLetterViewActivate='V';
+
+/**
+@internalComponent
+*/
+const TUint KApaCommandLetterRunWithoutViews='W';
+
+/**
+@internalComponent
+*/
+const TUint KApaCommandLetterBackgroundAndWithoutViews='A';
+
+/** Defines the command codes used to indicate the way an application is to be 
+launched.
+
+@publishedAll 
+@released
+@see CApaCommandLine */
+enum TApaCommand
+	{
+	/** The application is to open the document specified on the command line. */
+	EApaCommandOpen,
+	/** The application is to create the document specified on the command line. */
+	EApaCommandCreate,
+	/** The application is to run and open the last used document. */
+	EApaCommandRun,
+	/** The application is to open the last used document and to run in the background. */
+	EApaCommandBackground,
+	/** Reserved for future use. */
+	EApaCommandViewActivate,
+	/** The application is to run without views.
+	
+	This should NOT be used for view based applications. */
+	EApaCommandRunWithoutViews,
+	/** The application is to run in the background and viewless mode */
+	EApaCommandBackgroundAndWithoutViews
+	};
+
+/**
+@publishedAll 
+@released
+*/
+const TInt KApaMaxAppCaption=0x100;	// Default name is a file name, so the same limit is used
+
+// TApaAppCaption is the current language name of the app (for task lists, dialogs etc)
+
+/** Defines a modifiable buffer descriptor to contain the caption or the short caption 
+for an application. 
+
+@publishedAll 
+@released */
+typedef TBuf<KApaMaxAppCaption> TApaAppCaption; 
+
+/**
+@internalComponent
+*/
+const TInt KApaMaxCommandLine=0x100;	
+
+/**
+@internalComponent
+*/
+typedef TBuf<KApaMaxCommandLine> TApaCommandLine;
+
+/**
+@internalComponent
+*/
+const TInt KApaMaxAppFileName=0x10;	// Length of App's filename without path or extension (not it's caption)
+
+/**
+@internalComponent
+*/
+typedef TBuf<KApaMaxAppFileName> TApaAppFileName;
+
+/** Maximum length of an application group name.
+
+@publishedAll 
+@released
+@see TApaAppGroupName */
+const TInt KApaMaxAppGroupName=0x10; // Length of App's logical groupname
+
+/** An application group name.
+
+This is a name that allows applications to be categorized, for instance "Games" 
+or "Utilities". 
+
+@publishedAll 
+@released */
+typedef TBuf<KApaMaxAppGroupName> TApaAppGroupName;
+
+/** The hexadecimal value of the 2nd UID that identifies a DLL as being an ASCII UI 
+application. In .mmp files, the hexadecimal number is explicitly inserted 
+as the first value following the UID keyword. 
+
+@publishedAll 
+@deprecated */
+const TInt KAppUidValue8 = 0x1000006c;
+
+/** The 2nd UID that identifies a DLL as being an ASCII UI application. 
+
+@publishedAll 
+@deprecated */
+const TUid KUidApp8={KAppUidValue8};
+
+/** The hexadecimal value of the 2nd UID that defines a DLL as being a Unicode 
+UI application. In .mmp files, the hexadecimal number is explicitly inserted 
+as the first value following the UID keyword.
+
+@publishedAll 
+@released
+@see KAppUidValue */
+const TInt KAppUidValue16 = 0x100039CE;
+
+/** The 2nd UID that defines a DLL as being a Unicode UI application.
+
+@publishedAll 
+@released
+@see KUidApp */
+const TUid KUidApp16={KAppUidValue16};
+
+//
+// 2nd Uid for app doc files
+/**
+@publishedAll 
+@deprecated
+*/
+const TUid KUidAppDllDoc8={268435565}; 
+
+/**
+@publishedAll 
+@released
+*/
+const TUid KUidAppDllDoc16={0x10003A12};
+
+/** The UID encoded in a TPictureHeader that identifies a picture as a door (for 
+ASCII builds). 
+
+@publishedAll 
+@deprecated
+*/
+const TUid KUidPictureTypeDoor8={268435537};
+
+/** The UID encoded in a TPictureHeader that identifies a picture as a door (for 
+Unicode builds).
+
+@publishedAll 
+@released
+@see KUidPictureTypeDoor */
+const TUid KUidPictureTypeDoor16={0x10003A33};
+
+//
+// Uid's for streams in stream dictionaries
+/**
+@publishedAll 
+@deprecated
+*/
+const TUid KUidSecurityStream8={268435661};
+
+/**
+@publishedAll 
+@released
+*/
+const TUid KUidSecurityStream16={0x10003A40};
+
+/**
+@publishedAll 
+@deprecated
+*/
+const TUid KUidAppIdentifierStream8={268435593}; // stream containing a TApaAppIdentifier
+
+/**
+@publishedAll 
+@released
+*/
+const TUid KUidAppIdentifierStream16={0x10003A34};
+
+#ifdef _UNICODE
+/** The type-independent 2nd UID that identifies a DLL as being a UI application.
+
+@publishedAll 
+@released
+@see KUidApp16
+@see KUidApp8 */
+#define KUidApp KUidApp16
+/** The type-independent hexadecimal value of the 2nd UID that identifies a DLL as 
+being a UI application.
+
+@publishedAll 
+@released
+@see KAppUidValue16
+@see KAppUidValue8 */
+#define KAppUidValue KAppUidValue16 //lint !e1923 supress could become const variable
+/**
+@publishedAll 
+@released
+*/
+#define KUidAppDllDoc KUidAppDllDoc16
+/** The type independent UID encoded in a TPictureHeader that identifies a picture 
+as a door.
+
+@publishedAll 
+@released
+@see KUidPictureTypeDoor16
+@see KUidPictureTypeDoor8
+@see TPictureHeader
+@see TApaModelDoorFactory::NewPictureL() */
+#define KUidPictureTypeDoor KUidPictureTypeDoor16
+/**
+@publishedAll 
+@released
+*/
+#define KUidAppIdentifierStream KUidAppIdentifierStream16
+/**
+@publishedAll 
+@released
+*/
+#define KUidSecurityStream KUidSecurityStream16
+#else
+/** The type independent 2nd UID that defines a DLL as being a UI application.
+
+@see KUidApp16
+@see KUidApp8 */
+#define KUidApp KUidApp8
+/** The type independent hexadecimal value of the 2nd UID that defines a DLL as 
+being a UI application.
+
+@see KAppUidValue16
+@see KAppUidValue8 */
+#define KAppUidValue KAppUidValue8
+#define KUidAppDllDoc KUidAppDllDoc8
+/** The type independent UID encoded in a TPictureHeader that identifies a picture 
+as a door.
+
+@see KUidPictureTypeDoor16
+@see KUidPictureTypeDoor8
+@see TPictureHeader
+@see TApaModelDoorFactory::NewPictureL() */
+#define KUidPictureTypeDoor KUidPictureTypeDoor8
+#define KUidAppIdentifierStream KUidAppIdentifierStream8
+#define KUidSecurityStream KUidSecurityStream8
+#endif
+
+const TUid KUidFileEmbeddedApplicationInterfaceUid={0x101f8c96};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/APAFLREC.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,208 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#if !defined(__APAFLREC_H__)
+#define __APAFLREC_H__
+
+#if !defined(__APADEF_H__)
+#include <apadef.h>
+#endif
+#if !defined(__APAID_H__)
+#include <apaid.h>
+#endif
+
+// classes defined:
+class MApaAppStarter;
+class CApaAppLocator;
+class CApaFileRecognizer;
+class CApaFileRecognizerType;
+class CFileRecognizerExtension;
+//
+// classes referenced:
+class TApaAppEntry;
+class CApaCommandLine;
+class RFs;
+//
+
+// KUidFileRecognizer is UID[1] for app recognizer dll's (UID[2] identifies a particular identifier)
+/**
+@publishedAll
+@released
+*/
+#ifdef _UNICODE
+#define KUidFileRecognizer KUidFileRecognizer16
+#else
+#define KUidFileRecognizer KUidFileRecognizer8
+#endif
+
+/**
+@publishedAll 
+@deprecated
+*/
+const TInt KFileRecognizerUidValue8=0x1000013E;
+
+/**
+@publishedAll 
+@deprecated
+*/
+const TUid KUidFileRecognizer8={KFileRecognizerUidValue8};
+
+/**
+@publishedAll
+@released
+*/
+const TUid KUidFileRecognizer16={0x10003A37};
+//
+
+
+class CApaAppLocator : public CBase
+/**
+@internalComponent
+*/
+	{
+public:
+	virtual TInt GetAppEntryByUid(TApaAppEntry& aAppEntry,TUid aAppUid)=0;
+	virtual TInt GetAppCapabilityByUid(TDes8& aCapabilityBuf,TUid aAppUid)=0;
+	};
+
+
+
+class CApaFileRecognizer : public CBase
+/**
+@internalComponent
+@deprecated
+*/
+	{
+public:
+	//
+	IMPORT_C CApaFileRecognizerType* RecognizeFileL(const TDesC& aFullFileName,const TUidType* aUidType=NULL);
+	IMPORT_C CApaAppLocator* AppLocator() const;
+	//
+	IMPORT_C ~CApaFileRecognizer();
+protected:
+	IMPORT_C CApaFileRecognizer(RFs& aFs);
+	IMPORT_C void AddFileRecognizerType(CApaFileRecognizerType* aFileRecognizerType);
+	IMPORT_C TInt RemoveFileRecognizerType(const CApaFileRecognizerType* aFileRecognizerType);
+	IMPORT_C void SetAppLocator(CApaAppLocator* aAppLocator); // should be called by child-classes eg during construction
+	static inline void SetAppStarter(CApaFileRecognizerType* aRecognizer,MApaAppStarter* aAppStarter);
+	IMPORT_C void DestroyRecognizerList();
+protected:
+	RFs& iFs;
+	CApaAppLocator* iAppLocator;
+private:
+	CApaFileRecognizerType *iFileRecognizerList;
+	};
+
+
+
+class MApaAppStarter
+/** An interface used by the Application Architecture server to start applications.
+
+CEikonEnv is derived from this class.
+
+@publishedPartner
+@released
+@see CEikonEnv */
+	{
+public:
+	virtual TThreadId StartAppL(const CApaCommandLine& aCommandLine)=0;
+protected:
+	IMPORT_C MApaAppStarter(); 
+private:
+	IMPORT_C virtual void MApaAppStarter_Reserved1();
+	IMPORT_C virtual void MApaAppStarter_Reserved2();
+private:
+	TInt iMApaAppStarter_Reserved1;
+	};
+
+
+
+class CApaFileRecognizerType : public CBase
+/**
+@publishedPartner
+@deprecated
+*/
+	{
+public:
+	enum TRecognizedType {EProgram,EDoc,EOtherFile,ENotRecognized};
+public:
+	virtual TThreadId RunL(TApaCommand aCommand,const TDesC* aDocFileName,const TDesC8* aTailEnd) const=0;
+	inline TThreadId RunL(TApaCommand aCommand, const TDesC* aDocFileName) const;
+	inline TThreadId RunL(TApaCommand aCommand) const;
+	inline TUid AppUid()const;
+	inline TUid TypeUid()const;
+	inline TRecognizedType Type()const;
+	IMPORT_C void Capability(TDes8& aCapabilityBuf)const;
+	IMPORT_C void Lock();
+	IMPORT_C void Unlock();
+protected:
+	IMPORT_C CApaFileRecognizerType();
+	IMPORT_C ~CApaFileRecognizerType();
+	IMPORT_C TThreadId AppRunL(const CApaCommandLine& aCommandLine) const;
+private:
+	inline void SetAppStarter(MApaAppStarter* aAppStarter); // must be called before AppRunL()
+	virtual TRecognizedType DoRecognizeFileL(RFs& aFs,TUidType aUidType)=0;
+	TRecognizedType RecognizeFileL(RFs& aFs,const TDesC& aFullFileName,TUidType aUidType);
+	TBool Locked()const;
+	IMPORT_C virtual void Reserved_1();
+public:
+	IMPORT_C static CApaFileRecognizerType* CreateFileRecognizerL(TUid aImplUid);
+protected:
+	CApaFileRecognizer* iFileRecognizer;
+	MApaAppStarter* iAppStarter;
+	HBufC* iFullFileName;
+	TUid iFileType; // type UID of the recognizer file (ie UID[1])
+	TUid iAppUid; // UID of the associated app (ie UID[2])
+	TRecognizedType iRecognizedType;
+	TApaAppCapabilityBuf* iCapabilityBuf;
+private:
+	CApaFileRecognizerType* iNext;
+	TInt iLock;
+	CFileRecognizerExtension* iFileRecognizerExtn;
+private:
+	friend class CApaFileRecognizer;
+	};
+
+
+//
+// inlines
+//
+
+inline void CApaFileRecognizer::SetAppStarter(CApaFileRecognizerType* aRecognizer,MApaAppStarter* aAppStarter)
+	{ aRecognizer->SetAppStarter(aAppStarter); }
+
+inline void CApaFileRecognizerType::SetAppStarter(MApaAppStarter* aAppStarter)
+	{ iAppStarter = aAppStarter; }
+
+inline TUid CApaFileRecognizerType::AppUid() const
+	{ return iAppUid; }
+
+inline TUid CApaFileRecognizerType::TypeUid() const
+	{ return iFileType; }
+
+inline CApaFileRecognizerType::TRecognizedType CApaFileRecognizerType::Type()const
+	{ return iRecognizedType; }
+
+inline TThreadId CApaFileRecognizerType::RunL(TApaCommand aCommand, const TDesC* aDocFileName) const
+	/** Calls RunL(TApaCommand,const TDesC*,const TDesC8*) with NULL as third parameter.
+	@see CApaFileRecognizerType::RunL(TApaCommand,const TDesC*,const TDesC8*) */
+	{ return RunL(aCommand, aDocFileName, NULL); }
+
+inline TThreadId CApaFileRecognizerType::RunL(TApaCommand aCommand) const
+	/** Calls RunL(TApaCommand,const TDesC*,const TDesC8*) with NULL as second and third parameter.
+	@see CApaFileRecognizerType::RunL(TApaCommand,const TDesC*,const TDesC8*) */
+	{ return RunL(aCommand, NULL, NULL); }	
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/APAID.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,358 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __APAID_H__
+#define __APAID_H__
+
+#if !defined(__E32BASE_H__)
+#include <e32base.h>
+#endif
+#if !defined(__APADEF_H__)
+#include <apadef.h>
+#endif
+
+#include "apmstd.h"
+
+
+// classes defined:
+class TApaAppIdentifier;
+class TApaAppEntry;
+class CApaAppFinder;
+//
+// classes referenced:
+class RReadStream;
+class RWriteStream;
+class RFs;
+//
+
+
+class TApaAppIdentifier
+/** The identity of an application.
+
+An object of this type contains two pieces of information:
+
+The application specific UID
+
+The file name and extension of the application DLL
+
+All persisted documents associated with this application have a stream containing 
+this information.
+
+@publishedAll 
+@released
+@see CApaProcess::ReadRootStreamLC()
+@see CApaProcess::WriteRootStreamL()
+@see CApaProcess::ReadAppIdentifierL()
+@see CApaProcess::WriteAppIdentifierL() */
+	{
+public:
+	IMPORT_C TApaAppIdentifier();
+	IMPORT_C TApaAppIdentifier(TUid aAppUidType,const TFileName& aDllName);
+	IMPORT_C void ExternalizeL(RWriteStream& aStream)const;
+	IMPORT_C void InternalizeL(RReadStream& aStream);
+	
+public:
+	/** The application-specific UID. */
+	TUid iAppUid;
+	/** The full path name of the application DLL. */
+	TFileName iFullName;
+
+private:
+	TInt iTApaAppIdentifier_Reserved1;
+	};
+
+
+class TApaAppEntry
+/** An application entry.
+
+An object of this type contains two pieces of information:
+
+the full path name of the application DLL
+
+the UID type (or compound identifier) of the application DLL. 
+
+@publishedAll 
+@released */
+	{
+public:
+	IMPORT_C TApaAppEntry();
+	IMPORT_C TApaAppEntry(const TUidType& aAppUidType,const TFileName& aDllName);
+	IMPORT_C void ExternalizeL(RWriteStream& aStream)const;
+	IMPORT_C void InternalizeL(RReadStream& aStream);
+public:
+	/** The UID type (or compound identifier) of the application DLL. */
+	TUidType iUidType;
+	/** The full path name of the application DLL. */
+	TFileName iFullName;
+private:
+	TInt iTApaAppEntry_Reserved1;
+	};
+
+
+class TApaAppInfo
+/** Application information.
+
+An object of this type contains four pieces of information:
+
+the application specific UID
+
+the full path name of the application DLL
+
+the application's caption
+
+a short caption; how this is used is up to the UI 
+
+@publishedAll
+@released */
+	{
+public:
+	IMPORT_C TApaAppInfo();
+	IMPORT_C TApaAppInfo(TUid aAppUid,const TFileName& aDllName,const TApaAppCaption& aCaption);
+	IMPORT_C TApaAppInfo(TUid aAppUid,const TFileName& aDllName,const TApaAppCaption& aCaption,const TApaAppCaption& aShortCaption);
+	IMPORT_C void ExternalizeL(RWriteStream& aStream)const;
+	IMPORT_C void InternalizeL(RReadStream& aStream);
+public:
+	/** The application specific UID. */
+	TUid iUid;
+	/** The full path name of the application DLL. */
+	TFileName iFullName;
+	/** The caption for the application. */
+	TApaAppCaption iCaption;
+	/** The short caption for the application. */
+	TApaAppCaption iShortCaption;
+
+private:
+	TInt iTApaAppInfo_Reserved1;
+	};
+
+
+class TApaAppViewInfo
+/** Contains the basic information about an application view.
+
+An object of this type contains two pieces of information:
+
+The UID that identifies the view
+
+The application's caption.
+
+Objects of this type are returned in an array populated by a call to RApaLsSession::GetAppViews().
+
+@publishedAll 
+@released
+@see CApaAppViewArray
+@see TUid */
+	{
+public:
+	IMPORT_C TApaAppViewInfo();
+	IMPORT_C TApaAppViewInfo(TUid aViewUid,const TApaAppCaption& aViewCaption,TInt aScreenMode);
+	IMPORT_C void ExternalizeL(RWriteStream& aStream)const;
+	IMPORT_C void InternalizeL(RReadStream& aStream);
+public:
+	/** The UID identifying the view. */
+	TUid iUid;
+	/** The application caption. */
+	TApaAppCaption iViewCaption;
+	TInt iScreenMode;
+private:
+	TInt iTApaAppViewInfo_Reserved1;
+	};
+
+
+/** Defines an array of TApaAppViewInfo objects contained within a flat dynamic 
+buffer.
+
+An array of this type is populated with TApaAppViewInfo objects in a call 
+to RApaLsSession::GetAppViews().
+
+@publishedAll 
+@released */
+typedef CArrayFixFlat<TApaAppViewInfo> CApaAppViewArray;
+
+
+class TApaAppCapability
+// expandable class - add new members to the end, add them to the end of int/ext also, and increment the version no.
+// default value for all data members must be 0
+/** Application capabilities. 
+
+@publishedAll
+@released */
+	{
+public:
+	IMPORT_C static void CopyCapability(TDes8& aDest,const TDesC8& aSource);
+	IMPORT_C void InternalizeL(RReadStream& aStream);
+	IMPORT_C void Internalize7_0L(RReadStream& aStream);	// deprecated
+	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
+private:
+	IMPORT_C void Externalize7_0L(RWriteStream& aStream) const;	// deprecated
+	void DoInternalizeL(RReadStream& aStream, TBool& aLaunchInBackground, TApaAppGroupName& aGroupName);
+public:
+	//
+	/** Defines an application's support for embeddability. */
+	enum TEmbeddability {
+		/** An application cannot be embedded. */
+		ENotEmbeddable=0,
+		/** An application can be run embedded or standalone and can read/write embedded document-content. */
+		EEmbeddable=1,
+		/** An application can only be run embedded and can read/write embedded document-content. */
+		EEmbeddableOnly=2,
+		/** An application can be run embedded or standalone and cannot read/write embedded document-content. */
+		EEmbeddableUiOrStandAlone=5,
+		/** An application can only be run embedded and cannot read/write embedded document-content. */
+		EEmbeddableUiNotStandAlone=6 };
+	/** Defines an application's attributes as a set of bit flags. */
+	enum TCapabilityAttribute
+		{
+		/** If set, the application was built as a DLL, otherwise it was built as an EXE. */
+		EBuiltAsDll			= 0x00000001,
+		/** If set, the application provides control panel functionality. */
+		EControlPanelItem	= 0x00000002,
+		/** If set, the application is not a native executable, and hence the "path" and "extension" (as well as the "name") must be provided in the app_file field of the APP_REGISTRATION_INFO resource. */
+		ENonNative			= 0x00000004
+		};
+public:
+	/** Indicates the extent to which the application can be embedded. */
+	TEmbeddability iEmbeddability;
+	/** Indicates whether the application is document-based and supports being asked 
+	to create a new file. */
+	TBool iSupportsNewFile;
+	/** Indicates whether the existence of the application should be advertised to the 
+	user. If this is set to ETrue, the application does not appear on the Extras 
+	Bar (or equivalent). */
+	TBool iAppIsHidden; // not shown in the Shell etc.
+	/** Allows the application to be launched in the foreground (when set to EFalse) 
+	or in the background (when set to ETrue). */
+	TBool iLaunchInBackground;	// Series 60 extension to allow apps to be launched in the background	
+	/** Stores the application's logical group name. */
+	TApaAppGroupName iGroupName; // Series 60 extension to allow apps to be categorized according a logical group name, e.g. 'games'
+	/** Indicates the application attributes. One or more values from TCapabilityAttribute may be specified. */
+	TUint iAttributes;
+private:
+	enum { EVersion=4 };
+private:
+	TInt iTApaAppCapability_Reserved1;
+	};
+
+/** Packages the TApaAppCapability class. 
+
+@publishedAll
+@released */
+typedef TPckgBuf<TApaAppCapability> TApaAppCapabilityBuf;
+
+
+/** Filter used to define the subset of applications returned by RApaLsSession::GetNextApp()
+
+@publishedAll
+@released
+*/
+class TApaEmbeddabilityFilter
+	{
+public:
+	IMPORT_C TApaEmbeddabilityFilter();
+	IMPORT_C void AddEmbeddability(TApaAppCapability::TEmbeddability aEmbeddability);
+	IMPORT_C TBool MatchesEmbeddability(TApaAppCapability::TEmbeddability aEmbeddability) const;
+private:
+	TUint iEmbeddabilityFlags;
+private:
+	TInt iTApaEmbeddabilityFilter_Reserved1;
+	};
+
+
+class CApaAppFinder : public CBase
+/**
+@publishedPartner
+@deprecated
+*/
+	{
+public:
+	virtual void FindAllAppsL()=0; // sets up a scan for all apps
+	virtual TBool NextL(TApaAppEntry& aEntry)=0; // increments a scan for all apps
+	virtual TFileName FindAppL(const TDesC& aFileName,TUid aFileUid)=0; // searches for a particular app - should support wildcards in aFileName
+	//
+	virtual TFileName DefaultAppInfoFileName()const=0; // should return the full name, path and drive of the default icon file
+protected:
+	IMPORT_C CApaAppFinder();
+	
+private:
+	IMPORT_C virtual void CApaAppFinder_Reserved1();
+	IMPORT_C virtual void CApaAppFinder_Reserved2();
+	};
+
+/** 
+The uid for the Open service.
+
+@publishedPartner
+@released
+*/
+const TUid KOpenServiceUid = { 0x10208DCA };
+
+/** Application service information.
+
+Encapsulates a service UID and associated opaque data.
+
+An instance of this class provides information about
+a specific implementation of the service identified by
+the encapsulated service UID.
+
+@publishedPartner
+@released
+*/
+class TApaAppServiceInfo
+	{
+public:
+	TApaAppServiceInfo();
+	TApaAppServiceInfo(TUid aUid, CArrayFixFlat<TDataTypeWithPriority>* aDataTypes,
+		HBufC8* aOpaqueData);
+	void ExternalizeL(RWriteStream& aStream) const;
+	void InternalizeL(RReadStream& aStream);
+	void Release();
+	CArrayFixFlat<TDataTypeWithPriority>& DataTypes();
+	IMPORT_C TUid Uid() const;
+	IMPORT_C const CArrayFixFlat<TDataTypeWithPriority>& DataTypes() const;
+	IMPORT_C const TDesC8& OpaqueData() const;
+private:
+	TUid iUid;
+	CArrayFixFlat<TDataTypeWithPriority>* iDataTypes;
+	HBufC8* iOpaqueData;
+	TInt iTApaAppServiceInfo;
+	};
+
+/** Application service information array.
+
+Owns an array of TApaAppServiceInfo objects.
+
+@see TApaAppServiceInfo
+@publishedPartner
+@released
+*/
+class CApaAppServiceInfoArray : public CBase
+	{
+protected:
+	CApaAppServiceInfoArray();
+public:
+	/** Provides access to the encapsulated array of
+	TApaAppServiceInfo objects.
+
+	@return A generic array of TApaAppServiceInfo objects. */
+	virtual TArray<TApaAppServiceInfo> Array()=0;
+	
+private:
+	IMPORT_C virtual void CApaAppServiceInfoArray_Reserved1();
+	IMPORT_C virtual void CApaAppServiceInfoArray_Reserved2();
+	
+private:
+	TInt iCApaAppServiceInfoArray_Reserved1;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/APAMDR.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,202 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __APAMDR_H__
+#define __APAMDR_H__
+
+#if !defined(__E32STD_H__)
+#include <e32std.h>
+#endif
+#if !defined(__E32BASE_H__)
+#include <e32base.h>
+#endif
+#if !defined(__GDI_H__)
+#include <gdi.h>
+#endif
+#if !defined(__APADBASE_H__)
+#include <apadbase.h>
+#endif
+
+// classes defined:
+class TApaModelDoorFactory;
+class CApaModelDoor;
+class CApaModelHeader;
+class MApaModelHeaderFactory;
+//
+// classes referenced:
+class RReadStream;
+class RWriteStream;
+class CStreamStore;
+class CStreamDictionary;
+class CEmbeddedStore;
+class TApaAppIdentifier;
+//
+
+
+class TApaModelDoorFactory : public MPictureFactory
+// Recognizes KUidPictureTypeDoor and creates CApaModelDoor pictures
+/** A factory class for instantiating and restoring an application's door using 
+the application's model. 
+
+@publishedAll 
+@released */
+	{
+public:
+	IMPORT_C TApaModelDoorFactory(const MApaModelHeaderFactory* aFactory);
+	//
+	// from MPictureFactory
+	IMPORT_C void NewPictureL(TPictureHeader& aPictureHeader,const CStreamStore& aPictureStore)const; // used to create CApaDoor's during document restore only 
+private:
+	const MApaModelHeaderFactory* iHeaderFactory;
+	TInt iTApaModelDoorFactory_Reserved1;
+	};
+
+
+class CApaModelDoor : public CApaDoorBase
+/** A persistent representation of a door that also acts as a wrapper around an 
+application's model.
+
+The class allows embedded data to be manipulated without requiring the whole 
+associated application. 
+
+@publishedAll 
+@released */
+	{
+public:
+	IMPORT_C static CApaModelDoor* NewL(CApaModelHeader* aHeader);
+	IMPORT_C static CApaModelDoor* NewLC(CApaModelHeader* aHeader);
+	IMPORT_C static CApaModelDoor* NewL(const CStreamStore& aStore,TStreamId aHeadStreamId,const MApaModelHeaderFactory* aFactory);
+	//
+	/** Gets the application model wrapper object.
+	
+	@return A pointer to the application model wrapper object. */
+	inline CApaModelHeader* ModelHeader() { return iModelHeader; }
+	
+	/** Sets the format of the door.
+	
+	@param aFormat The format for the graphical representation of the embedded 
+	document. */
+	inline void SetFormat(TFormat aFormat) { iFormat = aFormat; }
+	//
+	IMPORT_C TStreamId StoreL(CStreamStore& aStore) const;
+	IMPORT_C void RestoreL(const CStreamStore& aStore,TStreamId aHeadStreamId,const MApaModelHeaderFactory* aFactory);
+	//
+	IMPORT_C ~CApaModelDoor();
+	//
+	// from CPicture
+	IMPORT_C void DetachFromStoreL(TDetach /*aDegree*/=EDetachFull); //lint !e1735 Virtual function has default parameter - Inherited from CPicture, must be fixed there
+	IMPORT_C void ExternalizeL(RWriteStream& aStream)const;
+	IMPORT_C void Draw(CGraphicsContext& aGc,const TPoint& aTopLeft,const TRect& aClipRect,MGraphicsDeviceMap* aMap)const; 
+	IMPORT_C void GetOriginalSizeInTwips(TSize& aSize)const;
+	IMPORT_C void SetScaleFactor(TInt aScaleFactorWidth,TInt aScaleFactorHeight); 
+	IMPORT_C TInt ScaleFactorWidth()const; 
+	IMPORT_C TInt ScaleFactorHeight()const;
+	//
+private:
+	CApaModelDoor();
+	CApaModelDoor(CApaModelHeader* aHeader);
+	//
+	static CStreamDictionary* ReadStreamDictionaryLC(const CStreamStore& aSourceStore,TStreamId aStreamId);
+	static void CopyStoreL(const CEmbeddedStore& aSourceStore,RWriteStream& aTargetStream);
+	void InternalizeModelL(const MApaModelHeaderFactory& aFactory);
+	//
+	// from CApaDoorBase
+	TSize GlassDoorSize()const;
+private:
+	CApaModelHeader* iModelHeader;
+	CEmbeddedStore* iStore;
+	TSize iScaleFactor;
+	CBufSeg* iStoreHost; // the host for the embedded store, if the door has been detached from its originating store
+	};
+
+
+class CApaModelHeader : public CBase
+// Abstract wrapper for an applications model - used for file format conversion etc
+/** An interface class that acts as a wrapper for an application model.
+
+This is also known as an application model header.
+
+The class provides the knowledge for internalizing and externalizing an application 
+model's data. An instance of the class is used by CApaModelDoor.
+
+A concrete implementation of the class must be supplied by the application 
+model (not the application UI). An instance of the class is constructed by 
+a factory object that implements the MApaModelHeaderFactory interface; the 
+factory object is also supplied by the application model (not the application 
+UI).
+
+@publishedAll
+@released
+@see CApaModelDoor
+@see TApaModelDoorFactory
+@see MApaModelHeaderFactory */
+	{
+public:
+	/** Stores the model and its components in the specified store.
+	
+	@param aStore The store in which the model's components are to be stored.
+	@param aDict The stream dictionary into which stream IDs and associated UIDs 
+	are put. */
+	virtual void StoreL(CStreamStore& aStore,CStreamDictionary& aDict) const=0;
+	/** Gets the identity of the application associated with the application model.
+	
+	@return The application identity. */
+	virtual TApaAppIdentifier AppId()const=0;
+	/** Restores the model to the specified degree.
+	
+	An implementation of this function should propagate this call to all components 
+	of the model.
+	
+	@param aDegree The degree to which restoration is needed. */
+	virtual void DetachFromStoreL(CPicture::TDetach aDegree)=0;
+protected:
+	IMPORT_C CApaModelHeader();
+private:
+	IMPORT_C virtual void Reserved_1();
+	IMPORT_C virtual void Reserved_2();
+private:
+	TInt iCApaModelHeader_Reserved1;
+	};
+
+
+
+class MApaModelHeaderFactory
+/** An interface class that applications implement to construct an application model 
+wrapper object, also known as the application model header.
+
+@publishedAll
+@released
+@see CApaModelHeader */
+	{
+public:	
+	/** Creates and returns an application model wrapper object.
+	
+	@param aStore The store containing model data.
+	@param aDict The stream dictionary. 
+	@param aAppId The application's identity held as a stream in the application's 
+	store
+	@return A pointer to the new application model wrapper object. */
+	virtual CApaModelHeader* NewHeaderL(const CStreamStore& aStore,const CStreamDictionary& aDict,const TApaAppIdentifier& aAppId)const=0;
+protected:
+	IMPORT_C MApaModelHeaderFactory();
+private:
+	IMPORT_C virtual void MApaModelHeaderFactory_Reserved1();
+	IMPORT_C virtual void MApaModelHeaderFactory_Reserved2();
+private:
+	TInt iMApaModelHeaderFactory_Reserved1;
+	};
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/APASVST.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,38 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Starting of AppArc server
+// 
+//
+
+#ifndef __APASVST_H__
+#define __APASCST_H__
+
+#include <e32std.h>
+
+// classes referenced
+class MApaAppStarter;
+
+
+IMPORT_C TPtrC NameApaServStartSemaphore();
+
+IMPORT_C TPtrC NameApaServServerThread();
+
+IMPORT_C TInt StartupApaServer(MApaAppStarter& aAppStarter);
+
+IMPORT_C TInt StartupApaServerProcess();
+
+IMPORT_C TInt ApaServThreadStart(TAny* aAppStarter);
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/APFCTLF.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __APFCTLF_H__
+#define __APFCTLF_H__
+
+#if !defined(__E32BASE_H__)
+#include <e32base.h>
+#endif
+#if !defined(__APAID_H__)
+#include <apaid.h>
+#endif
+#if !defined(__F32FILE_H__)
+#include <f32file.h>
+#endif
+
+//
+// classes referenced:
+class CDir;
+//
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/APFDEF.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,83 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __APFDEF_H__
+#define __APFDEF_H__
+
+#if !defined(__E32BASE_H__)
+#include <e32base.h>
+#endif
+
+// generic file extensions etc.
+
+/**
+@internalTechnology
+*/
+_LIT(KExeAppFileExtension,".exe");
+
+#if (((defined(SYMBIAN_SUPPORT_UI_FRAMEWORKS_V1) || !defined(SYMBIAN_HIDE_UI_FRAMEWORKS_V1)) && !defined(SYMBIAN_REMOVE_UI_FRAMEWORKS_V1)) || defined(UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER))
+/**
+@internalTechnology
+*/
+_LIT(KAppFileExtension,".app");
+
+/**
+@internalTechnology
+*/
+_LIT(KAppInfoFileExtension,".aif");
+
+/**
+@internalComponent
+*/
+_LIT(KSystemControlFileExtension,".ctl");
+
+/**
+@internalComponent
+*/
+_LIT(KApaCaptionFileSuffix,"_Caption");
+
+/**
+@internalComponent
+*/
+const TInt KApparcExtraLengthOfCaptionFileName=15;
+#endif // #if (defined(SYMBIAN_SUPPORT_UI_FRAMEWORKS_V1) || !defined(SYMBIAN_HIDE_UI_FRAMEWORKS_V1)) && !defined(SYMBIAN_REMOVE_UI_FRAMEWORKS_V1)
+
+/**
+@internalTechnology
+*/
+_LIT(KIniFileExtension,".ini");
+
+/**
+@internalTechnology
+*/
+_LIT(KAppResourceFileExtension,".rsc");
+
+//
+// paths etc.
+
+#if (((defined(SYMBIAN_SUPPORT_UI_FRAMEWORKS_V1) || !defined(SYMBIAN_HIDE_UI_FRAMEWORKS_V1)) && !defined(SYMBIAN_REMOVE_UI_FRAMEWORKS_V1)) || defined(UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER))
+class Apfile
+/**
+@internalComponent
+@deprecated
+*/
+	{
+public:
+	IMPORT_C static TPtrC TempPath();
+	};
+#endif
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/APFFNDR.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,29 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __APFFNDR_H__
+#define __APFFNDR_H__
+
+#if !defined(__E32BASE_H__)
+#include <e32base.h>
+#endif
+#if !defined(__APAID_H__)
+#include <apaid.h>
+#endif
+#if !defined(__F32FILE_H__)
+#include <f32file.h>
+#endif
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/APFREC.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,152 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#if !defined(__APFREC_H__)
+#define __APFREC_H__
+
+#if !defined(__APADEF_H__)
+#include <apadef.h>
+#endif
+#if !defined(__APAFLREC_H__)
+#include <apaflrec.h>
+#endif
+
+#include <babackup.h>
+
+// classes defined:
+class CApaScanningFileRecognizer;
+
+//
+// classes referenced:
+class CApaAppFinder;
+class TApaAppEntry;
+class TEntry;
+class RFs;
+class TDriveUnit;
+//
+
+// dir in which app recognizers should live - this dir is scanned on all drives
+
+/**
+@internalTechnology
+*/
+_LIT(KAppRecognizerSearchPath,"\\System\\Recogs\\");
+
+/**
+@internalComponent
+*/
+_LIT(KAppRecognizerSearchString,"?:\\System\\Recogs\\");
+
+/**
+@internalComponent
+*/
+_LIT(KAppRecognizerSearchAnyFile,"*");
+
+/**
+@internalComponent
+*/
+const TUid KUidFileRecogInterfaceUid={0x101F7D86};
+
+class CApaRecognizerDll; // private class
+
+/** Constructs a recognizer type 
+
+@publishedPartner
+@released
+*/
+typedef CApaFileRecognizerType* (*CreateCApaFileRecognizerType)();
+
+class CApaScanningFileRecognizer : public CApaFileRecognizer
+/**
+@internalComponent
+@deprecated
+*/
+	{
+public:
+	class TRecognizer
+		{
+	friend class CApaRecognizerDll;
+	friend class CT_File1Step;
+	public:
+		TRecognizer(HBufC* aName);
+		inline const TDesC& Name() const;
+	public:
+		//lint --e{1925} suppress "public data member" 
+		TUid iUid;
+		TInt iDrive;
+	private:
+		inline TRecognizer();
+		TRecognizer(const TRecognizer&);
+		TRecognizer& operator=(const TRecognizer&);
+	private:
+		HBufC* iName;
+		};
+	typedef CArrayFixFlat<TRecognizer> CRecognizerArray;
+	//
+private:
+	class CApaBackupOperationObserver : public CBase, public MBackupOperationObserver
+		{
+	public:
+		CApaBackupOperationObserver(CApaScanningFileRecognizer& aRecognizer);
+		~CApaBackupOperationObserver();
+		void RegisterObserverL();
+
+		virtual void HandleBackupOperationEventL(const TBackupOperationAttributes& aBackupOperationAttributes);
+		TInt UpdateCounter() const;
+		void SetUpdateCounter( TInt aValue );
+	private:
+		CBaBackupSessionWrapper* iSession;
+		CApaScanningFileRecognizer& iRecognizer;
+		TInt iUpdateCounter;
+		};
+	friend class CApaScanningFileRecognizer::CApaBackupOperationObserver;
+public:
+	IMPORT_C static CApaScanningFileRecognizer* NewL(RFs& aFs,MApaAppStarter* aAppStarter);
+	IMPORT_C ~CApaScanningFileRecognizer();
+	IMPORT_C void ScanForRecognizersL();
+	IMPORT_C TInt RecognizerCount();
+	IMPORT_C CRecognizerArray* RecognizerListLC()const;
+	IMPORT_C const TRecognizer& operator[](TInt aIndex)const; 
+	IMPORT_C TInt UpdateCounter()const;
+
+protected:
+	IMPORT_C CApaScanningFileRecognizer(RFs& aFs,MApaAppStarter* aAppStarter);
+	IMPORT_C void ConstructL();
+	//
+private:
+	void ScanDriveL(TInt aDriveNum);
+	void LoadRecognizerL(const TDesC& aFullName,TUid aUid);
+	TInt RemoveRecognizer(CApaRecognizerDll& aDll);
+	void LoadEcomRecognizerL(TDriveUnit& aDrive,TUid aUid);
+	void ScanForEcomRecognizersL();
+public:
+	IMPORT_C void SetEcomRecognizersFromListL(const CRecognizerArray& aList);
+	IMPORT_C void SetEcomRecognizerL(const TRecognizer& aRecognizer); 
+private:
+	CApaRecognizerDll* iRecognizerLib;
+	MApaAppStarter* iAppStarter;
+	CApaBackupOperationObserver* iObserver;
+	};
+
+inline const TDesC& CApaScanningFileRecognizer::TRecognizer::Name() const
+	{
+	return *iName;	
+	}
+
+inline CApaScanningFileRecognizer::TRecognizer::TRecognizer()
+	{
+	}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/APGAPLST.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,543 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#if !defined(__APGAPLST_H__)
+#define __APGAPLST_H__
+
+#if !defined(__APAID_H__)
+#include <apaid.h>
+#endif
+#if !defined(__APMSTD_H__)
+#include <apmstd.h>
+#endif
+#if !defined(__BADESCA_H__)
+#include <badesca.h>
+#endif
+
+#include <s32file.h>
+
+// classes defined:
+class CApaAppData;
+class CApaAppList;
+class CApaAppViewData;
+//
+// classes referenced:
+class CApaMaskedBitmap;
+class TEntry;
+class RFs;
+class CApaAppRegFinder;
+class CApaAppIconArray;
+class CApaIconLoader;
+//
+
+/**
+KApaMaxAppIcons
+
+@publishedPartner
+@released
+*/
+const TInt KApaMaxAppIcons=3;
+
+/**
+KApaIconIndexSmall
+
+@publishedPartner
+@released
+*/
+const TInt KApaIconIndexSmall=0;
+
+/**
+KApaIconIndexMedium
+
+@publishedPartner
+@released
+*/
+const TInt KApaIconIndexMedium=1;
+
+/**
+KApaIconIndexLarge
+
+@publishedPartner
+@released
+*/
+const TInt KApaIconIndexLarge=2;
+
+/**
+KIgnoreScreenMode
+
+@internalTechnology
+*/
+const TInt KIgnoreScreenMode=-1;
+
+
+_LIT(KDefaultAppIconMbm,"Z:\\Resource\\Apps\\default_app_icon.mbm");
+_LIT(KLitPathForUntrustedRegistrationResourceFiles, "?:\\private\\10003a3f\\import\\apps\\*");
+
+
+class CApaAppEntry : public CBase
+/**
+Utility class with smaller RAM footprint than TApaAppEntry
+
+@internalComponent
+*/
+	{
+public:
+	static CApaAppEntry* NewL(const TApaAppEntry& aAppEntry);
+	~CApaAppEntry();
+	void Get(TApaAppEntry& aAppEntry) const;
+private:
+	CApaAppEntry(const TUidType& aUidType);
+	void ConstructL(const TDesC& aFileName);
+private:
+	TUidType iUidType;
+	HBufC* iFullName;
+	};
+
+class CApaAppData : public CBase
+/** Represents the data associated with a CApaApplication, such as its 
+caption, capabilities and icons. This should be accessed through the Apparc Server.
+
+@internalComponent
+*/
+	{
+public:
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+	IMPORT_C static CApaAppData* NewL(const TApaAppEntry& aAppEntry, RFs& aFs);
+#else
+	IMPORT_C static CApaAppData* NewL(const TApaAppEntry& aAppEntry, RFs& aFs, const TDesC& aDefaultAppIconFileName);
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+	IMPORT_C ~CApaAppData();
+	IMPORT_C TApaAppEntry AppEntry() const;
+	inline TPtrC Caption() const;
+	inline TPtrC ShortCaption() const;
+	IMPORT_C CApaMaskedBitmap* Icon(TInt aIconIndex) const;
+	IMPORT_C void Capability(TDes8& aCapabilityBuf)const;
+	inline TBool IsPresent() const;
+	// ER5
+	IMPORT_C TDataTypePriority DataType(const TDataType& aDataType) const;
+	// ER6
+	IMPORT_C CApaMaskedBitmap* Icon(TSize aSize) const;
+	IMPORT_C CArrayFixFlat<TSize>* IconSizesL() const;
+	// ER6.1
+	IMPORT_C CArrayPtrFlat<CApaAppViewData>* Views() const;
+	IMPORT_C CDesCArray* OwnedFiles() const;
+	IMPORT_C TBool CanUseScreenMode(TInt aScreenMode);
+	// 7.0s
+	IMPORT_C void GetIconInfo(TInt& aIconCount, TInt& aDefaultIconsUsed) const;
+	// 8.1
+	IMPORT_C TUint DefaultScreenNumber() const;
+	IMPORT_C TBool RegistrationFileUsed() const;
+	IMPORT_C TPtrC IconFileName() const;
+	IMPORT_C TBool NonMbmIconFile() const;
+
+	// 9.0
+	IMPORT_C TBool ImplementsService(TUid aServiceUid) const;
+	TInt ImplementsServiceWithDataType(TUid aServiceUid, const TDataType& aDataType) const;
+
+	// 9.1
+	IMPORT_C TLanguage ApplicationLanguage() const;
+	IMPORT_C TPtrC RegistrationFileName() const;
+	IMPORT_C TPtrC8 OpaqueData() const;
+	IMPORT_C TUid NonNativeApplicationType() const;
+	IMPORT_C TPtrC LocalisableResourceFileName() const;
+	IMPORT_C void SetShortCaptionL(const TDesC& aShortCaption);
+	IMPORT_C TBool IsPending()const;
+	
+	// Icon/caption overrides
+	IMPORT_C void SetCaptionL(const TDesC& aCaption);
+	IMPORT_C void SetIconsL(const TDesC& aFileName, TInt aNumIcons);
+	
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+	void ExternalizeL(RWriteStream& aWriteStream) const;	
+	void LoadIconsL();
+	TBool MbmIconsRequireLoading() const;
+	inline CApaAppData* Next() const;
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+
+private:
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+	CApaAppData(RFs& aFs);
+	TBool Update();
+	void SetAppPending();
+
+	void ConstructL(const TApaAppEntry& aAppEntry);
+	TInt StoreApplicationInformation();
+#else
+	CApaAppData(RFs& aFs);
+	TBool Update(const TDesC& aDefaultAppIconFileName);	
+	void ConstructL(const TApaAppEntry& aAppEntry, const TDesC& aDefaultAppIconFileName);
+	TInt StoreApplicationInformation(const TDesC& aDefaultAppIconFileName);
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+	void UpdateServiceArray(CArrayFixFlat<TApaAppServiceInfo>* aNewServiceArray);
+	TDataTypePriority DataType(const TDataType& aDataType, const CArrayFixFlat<TDataTypeWithPriority>& aDataTypeArray) const;
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+	void InternalizeL(RReadStream& aReadStream);
+	TBool ViewMbmIconsRequireLoading() const;
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+private:
+	enum { ENotPresent, ENotPresentPendingUpdate, EPresentPendingUpdate, EIsPresent, ESuperseded };
+private:
+	CApaAppIconArray* iIcons;
+	HBufC* iCaption;
+	HBufC* iShortCaption;
+	HBufC* iFullName; // filename of application binary
+	TInt iIsPresent; // uses enum
+	TUidType iUidType;
+	CApaAppData* iNext;
+	TApaAppCapabilityBuf iCapabilityBuf;
+	CApaAppEntry* iSuccessor;
+	TTime iTimeStamp;
+	CArrayPtrFlat<CApaAppViewData>* iViewDataArray;
+	CDesCArray* iOwnedFileArray;
+ 	RFs& iFs;
+ 	HBufC* iRegistrationFile;
+ 	TUint iDefaultScreenNumber;
+ 	HBufC* iIconFileName;
+ 	TBool iNonMbmIconFile;
+ 	HBufC* iLocalisableResourceFileName;
+ 	TTime iLocalisableResourceFileTimeStamp;
+	TTime iIconFileTimeStamp;
+ 	TLanguage iApplicationLanguage;
+ 	CArrayFixFlat<TApaAppServiceInfo>* iServiceArray;
+ 	TInt iIndexOfFirstOpenService;
+	TUid iNonNativeApplicationType;
+	HBufC8* iOpaqueData;
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+ 	TInt iNumOfAppIcons;
+ 	TInt iNumOfAppIconsFromResourceFile;
+ 	HBufC* iIconFileNameFromResourceFile; // Icon file name as found in the localisable resource file
+ 	TBool iNonMbmIconFileFromResourceFile; // A Flag that tells whether the icon in resource file is non MBM file format
+ 	TTime iIconFileTimeStampFromResourceFile;
+	HBufC* iShortCaptionFromResourceFile;	// Short Caption as found in the localisable resource file
+	HBufC* iCaptionFromResourceFile;		// Caption as found in the localisable resource file
+	CApaIconLoader* iIconLoader;
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+
+private:
+	friend class CApaAppList;
+	};
+
+class CApaAppViewData : public CBase
+/**
+The CApaAppViewData class represents the data associated with an application view.
+
+@internalComponent
+*/
+	{
+public:
+	IMPORT_C TUid Uid() const;
+	inline TPtrC Caption() const;
+	IMPORT_C CApaMaskedBitmap* Icon(const TSize& aSize) const;
+	IMPORT_C CArrayFixFlat<TSize>* IconSizesL() const;
+	IMPORT_C TInt ScreenMode() const;
+	IMPORT_C TPtrC IconFileName() const;
+	IMPORT_C TBool NonMbmIconFile() const;
+public:
+	~CApaAppViewData();
+	static CApaAppViewData* NewLC();
+	void SetUid(TUid aUid);
+	void SetCaptionL(const TDesC& aCaption);
+	void SetIconArray(CApaAppIconArray* aIcons);
+	void SetScreenMode(TInt aScreenMode);
+	void SetIconFileNameL(const TDesC& aFileName);
+	void SetNonMbmIconFile(TBool aNonMbmIconFile);
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+	void SetNumOfViewIcons(TInt aNumOfViewIcons);
+#endif // SYMBIAN_APPARC_APPINFO_CACHE	
+private:
+	CApaAppViewData();
+	void ConstructL();
+private:
+	CApaAppIconArray* iIcons;
+	HBufC* iCaption;
+	TUid iUid;
+	TInt iScreenMode;
+	HBufC* iIconFileName;
+	TBool iNonMbmIconFile;
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+	TInt iNumOfViewIcons;
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+	friend class CApaAppData;
+	};
+
+
+class MApaAppListObserver
+/**
+ The MApaAppListObserver interface allows a class to be informed when a CApaAppList is 
+ updated.
+
+ @internalComponent
+*/
+	{
+public:
+	virtual void NotifyUpdate(TInt aReason)=0;
+	virtual void InitialListPopulationComplete()=0;
+	virtual void NotifyScanComplete()=0;
+ 	};
+
+class CApaAppList : public CBase
+/**
+The CApaAppList class provides a list of all available applications present on a device.
+Its functionality should be accessed through the Apparc Server.
+
+@internalComponent
+*/
+	{
+public: 
+	IMPORT_C static CApaAppList* NewL(RFs& aFs,CApaAppRegFinder* aAppRegFinder, TBool aLoadMbmIconsOnDemand, TInt aTimeoutDelay = 50000); // takes ownership of aAppRegFinder
+public:
+	IMPORT_C void PurgeL();
+	inline void Purge();
+	IMPORT_C TInt Count() const;
+	IMPORT_C CApaAppData* FirstApp() const;
+	IMPORT_C CApaAppData* FirstApp(TInt aScreenMode) const; 
+	IMPORT_C CApaAppData* NextApp(const CApaAppData* aApp) const;
+	IMPORT_C CApaAppData* NextApp(const CApaAppData* aApp, TInt aScreenMode) const;
+	IMPORT_C CApaAppData* AppDataByUid(TUid aAppUid) const;
+	IMPORT_C void StopScan(TBool aNNAInstall = EFalse);
+	IMPORT_C void RestartScanL();
+	IMPORT_C TBool AppListUpdatePending();
+#ifndef SYMBIAN_APPARC_APPINFO_CACHE
+	IMPORT_C TInt UpdateCounter() const;
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+	// ER5
+	IMPORT_C TUid PreferredDataHandlerL(const TDataType& aDataType) const;
+	IMPORT_C void StartIdleUpdateL();
+	IMPORT_C void StartIdleUpdateL(MApaAppListObserver* aObserver);
+	IMPORT_C void InitListL(MApaAppListObserver* aObserver);
+	IMPORT_C TBool IsIdleUpdateComplete() const;
+	//
+	IMPORT_C TBool IsFirstScanComplete() const;
+	IMPORT_C TBool AppScanInProgress() const;
+	IMPORT_C CBufFlat* ServiceArrayBufferL(TUid aAppUid) const;
+	IMPORT_C CBufFlat* ServiceImplArrayBufferL(TUid aServiceUid) const;
+	IMPORT_C CBufFlat* ServiceImplArrayBufferL(TUid aServiceUid, const TDataType& aDataType) const;	
+	IMPORT_C CBufFlat* ServiceUidBufferL(TUid aAppUid) const;
+	IMPORT_C CBufFlat* ServiceOpaqueDataBufferL(TUid aAppUid, TUid aServiceUid) const;
+	IMPORT_C CApaAppData* FindAndAddSpecificAppL(CApaAppRegFinder* aFinder, TUid aAppUid);
+	IMPORT_C TUid PreferredDataHandlerL(const TDataType& aDataType, const TUid* aServiceUid, 
+		TInt& aPriority) const;
+	IMPORT_C ~CApaAppList();
+	// 9.1
+	IMPORT_C CApaAppData* AppDataByFileName(const TDesC& aFullFileName) const;
+	/*IMPORT_C*/ RFs& ShareProtectedFileServer();
+	IMPORT_C void AddForcedRegistrationL(HBufC* aRegistrationFile);
+	IMPORT_C void ResetForcedRegistrations();
+	IMPORT_C static TInt CompareStrings(const HBufC& aFirst, const HBufC& aSecond);
+	IMPORT_C TBool IsLanguageChangePending() const;
+	IMPORT_C static CApaAppList* Self();
+    IMPORT_C CArrayFixFlat<TUid>* UninstalledAppArray();
+	void AcquireDefaultIconArrayL() const;
+	const CApaAppIconArray& DefaultIconArray() const;
+	void ReleaseDefaultIconArray() const;
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+	void StoreL();
+	void NotifyObserver();
+	void DeleteAppListStorer();
+	void DeleteAppIconLoader();
+	void InitiateStoringOfAppList();
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+private:
+	enum
+		{
+		EFirstScanComplete = 0x01
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+		,EAppListHasChanged = 0x02,	// This flag is used to check if the applist has really changed after a re-scan/update scan.
+		ENotifyUpdateOnFirstScanComplete = 0x04	// This flag is used to notify clients for applist update on first boot when AppsList.Bin is used.
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+		,ELangChangePending = 0x08 // This flag is used to check if applist update is in progress on language change event.
+		};
+
+#ifndef SYMBIAN_APPARC_APPINFO_CACHE		
+	enum
+		{
+		EFirstStageScan=0x01,
+		EScanFinished=0x02,
+		};
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+
+private:
+	CApaAppList(RFs& aFs, CApaAppRegFinder* aAppRegFinder, TBool aLoadMbmIconsOnDemand, TInt aIdlePeriodicDelay);
+	void UpdateNextAppL(const TApaAppEntry& aAppEntry,TBool& aHasChanged);
+	void AddToList( CApaAppData* aAppData );
+	static void SetPending(CApaAppData* aAppData);
+	static void SetNotFound(CApaAppData* aAppData, TBool& aHasChanged);
+	static TInt IdleUpdateCallbackL(TAny* aObject);
+	TInt IdleUpdateL();
+	void ScanComplete();
+	void UndoSetPending(CApaAppData* aAppData);
+
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+	void StopIdler();
+	void DeleteAppData();
+#else	
+	void StopIdlerL();
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+	CArrayFixFlat<TDataTypeWithPriority>* DataTypeArrayDeepCopyLC(const CArrayFixFlat<TDataTypeWithPriority>& aOriginal) const;
+	CApaAppIconArray* LoadDefaultIconsL() const;
+	void UpdateDefaultIconsL();
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+	void StartIconLoadingL();
+	void DeleteAppsListBackUpAndTempFiles();
+	void ScanRemovableDrivesAndUpdateL();
+	void CreateDefaultAppIconFileNameL();
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+
+private: 
+	// Persistence Layer
+	void RestoreL();
+	void ConstructL();
+#ifndef SYMBIAN_APPARC_APPINFO_CACHE
+	void StoreL();
+	void StoreEntryL(RFileWriteStream& theWriteStream,CApaAppData* aApp);
+	void DoStoreL(RFileWriteStream& aWriteStream);
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+
+	void GetAppsListCachePathL();
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+	NONSHARABLE_CLASS(CApaIdleIconLoader) : public CActive
+		{
+	/**
+	Utility class used to Load Icons once applist is populated
+	@internalComponent
+	*/	
+	public:
+		CApaIdleIconLoader(CApaAppData* aFirstAppData, RFs& aFs, CApaAppList& aAppList);
+		~CApaIdleIconLoader();
+		void Start();
+
+	private:	// from CActive
+		void RunL();
+		void DoCancel();
+		TInt RunError(TInt aError);
+
+	private:
+		CApaAppData* iCurrentAppData;
+		RFs& iFs;
+		CApaAppList& iAppList;
+		};
+
+	NONSHARABLE_CLASS(CApaAppListStorer) : public CActive
+		{
+	/**
+	Utility class used to externalize applist to file
+	@internalComponent
+	*/	
+	public:
+		static CApaAppListStorer* NewL(CApaAppData* aFirstAppData, RFs& aFs, CApaAppList& aAppList);
+		~CApaAppListStorer();
+		void StartL(const TTimeIntervalMicroSeconds32& aDelay);
+
+	private:
+		CApaAppListStorer(CApaAppData* aFirstAppData, RFs& aFs, CApaAppList& aAppList);
+		static void StoreEntryL(RWriteStream& aWriteStream, const CApaAppData& aApp);
+		void ConstructL();
+
+	private:	// from CActive
+		void RunL();
+		void DoCancel();
+		TInt RunError(TInt aError);
+
+	private:
+		CApaAppData* iCurrentAppData;
+		TFileName iTempFilename;
+		RFileWriteStream iWriteStream;
+		RTimer iTimer;
+		RFs& iFs;
+		CApaAppList& iAppList;
+		};
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+	
+private:
+	RFs& iFs;
+	CApaAppData* iAppData; // linked list of apps
+	CPeriodic* iAppIdler;
+	MApaAppListObserver* iObserver;
+	CApaAppData* iValidFirstAppData; //First valid app data in linked list!
+	TInt iFlags;
+	CApaAppRegFinder* iAppRegFinder;
+	TInt iIdlePeriodicDelay; 	// idle timeout periodic delay
+	RFs iFsShareProtected;
+	mutable CApaAppIconArray* iDefaultIconArray;
+	mutable TInt iDefaultIconUsageCount;
+	RPointerArray<HBufC> iForcedRegistrations;
+	class CApaLangChangeMonitor; //inner class of CApaAppList.
+	CApaLangChangeMonitor* iAppLangMonitor; // Active Object used for language change monitoring.		
+
+	RBuf iAppsListCacheFileName;
+	RBuf iAppsListCacheBackUpFileName;
+	RBuf iAppsListCachePath;
+
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+	HBufC* iDefaultAppIconMbmFileName; // This member data lives only during the scan
+	CApaAppListStorer* iAppListStorer;	//Active Object used for writing applist to file.
+	CApaIdleIconLoader* iAppIconLoader;	//Active Object used for icon handling
+#else
+	TInt iScanStage;
+	TInt iUpdateCounter;
+	TApaAppEntry iCurrentApp;
+	TInt iOldUpdateCounter;
+	HBufC* iDefaultAppIcon; // This member data lives only during the scan
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+	TBool iLoadMbmIconsOnDemand;
+	TBool iNNAInstallation;
+    CArrayFixFlat<TUid>* iUninstalledApps; 
+
+private:
+	friend class CApaLangChangeMonitor;
+	};
+
+//
+// inlines
+//
+
+inline TPtrC CApaAppViewData::Caption() const
+	{ return *iCaption; }
+
+inline TPtrC CApaAppData::Caption() const
+/** Gets the application's caption.
+
+@return The application's caption. */
+	{ return *iCaption; }
+
+inline TPtrC CApaAppData::ShortCaption() const
+/** Gets the application's short caption.
+
+@return The application's short caption. */
+	{ return *iShortCaption; }
+
+inline TBool CApaAppData::IsPresent() const
+/** Tests whether the application is present or not on the device.
+
+@return True if application exists, else false. */
+	{ return iIsPresent; }
+
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+inline CApaAppData* CApaAppData::Next() const
+/** Gets the Next Appdata in the list
+
+@return iNext */
+	{ return iNext; }
+#endif // SYMBIAN_APPARC_APPINFO_CACHE
+
+/**
+ * Use PurgeL.
+ *
+ * @deprecated
+ */
+inline void CApaAppList::Purge()
+	{	TRAP_IGNORE(PurgeL());	}
+
+#endif //__APGAPLST_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/APGCLI.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,309 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#if !defined(__APGCLI_H__)
+#define __APGCLI_H__
+
+#if !defined(__E32BASE_H__)
+#include <e32base.h>
+#endif
+#if !defined(__APMSTD_H__)
+#include <apmstd.h>
+#endif
+#if !defined(__APMREC_H__)
+#include <apmrec.h>
+#endif
+#if !defined(__APAID_H__)
+#include <apaid.h>
+#endif
+#if !defined(__BADESCA_H__)
+#include <badesca.h>
+#endif
+#if !defined(__F32FILE_H__)
+#include <f32file.h>
+#endif
+
+// classes referenced
+class CApaCommandLine;
+class CApaMaskedBitmap;
+class MArrayFiller;
+class RFile;
+
+class CApaLsSessionExtension;
+
+class CDataRecognitionResultArrayEntry;
+class CApaRegistrationResourceFileWriter;
+class CApaLocalisableResourceFileWriter;
+
+/* @internalComponent
+*/
+IMPORT_C TUint MinApplicationStackSize();
+
+class CDataRecognitionResultArray : public CBase
+/**
+This class holds the recognition results of a recognized directory.
+@publishedAll
+@released
+*/
+	{
+public: // exported functions
+	IMPORT_C CDataRecognitionResultArray();
+	IMPORT_C virtual ~CDataRecognitionResultArray();
+	IMPORT_C const TFileName& Path() const;
+	IMPORT_C TUint Count() const;
+	IMPORT_C void GetDataRecognitionResultL(TDataRecognitionResult& aResult, const TUint aIndex) const;
+	IMPORT_C void GetFileNameL(TFileName& aFileName, const TUint aIndex) const;
+public: // dll internally
+	TUint InternalizeL(const CBufFlat& aBuffer);
+	void SetPath(const TFileName& aPath);
+private:
+	TFileName iPath;
+	RPointerArray<CDataRecognitionResultArrayEntry> iEntries;
+	};
+
+
+
+////////////////////////////////////
+// RApaLsSession
+////////////////////////////////////
+
+class RApaLsSession : public RSessionBase
+/** A session with the application architecture server.
+
+The server provides access to a cached list of the applications on the device. 
+
+To use this class, clients first need to connect to the server. 
+
+Then, one of GetAllApps(), GetEmbeddableApps() or GetFilteredApps() needs to be called. 
+These functions do some initialisation of server data in preparation for returning the 
+application list (which is owned by the server).
+
+Then, GetNextApp() is called in a loop. The first time around, it populates the session's 
+application list and retrieves the first application in the list. Further calls to GetNextApp() 
+retrieve the remaining applications in the list, until RApaLsSession::ENoMoreAppsInList is 
+returned.
+
+The session should be closed when it is no longer needed, before it goes out of scope.
+
+Various functions in RApaLsSession need to access the application list, and may return 
+RApaLsSession::EAppListInvalid to indicate that the function was called before the initial 
+population of the list is complete. If this occurs, you could try again after a short delay.
+
+This class provides many other functions, for instance launching applications, querying 
+application-specific information, recognising data.
+
+@publishedAll
+@released */
+	{
+	friend class CApaLsSessionExtension;
+public:
+	enum {
+		/** A possible return value from GetNextApp(), to indicate that there are no more 
+		applications in the list. */
+		ENoMoreAppsInList=1,
+		/** Indicates that an RApaLsSession member function was called before the session's 
+		application list is fully populated. */
+		EAppListInvalid
+		};
+	/** Defines the way an application is launched. */
+	enum TLaunchType {
+		/** Launches a new instance of the application. */
+		ELaunchNewApp=1,
+		/** Launches a new instance of the application if no existing instance of the application 
+		is running. If an instance of the application is already running, then it 
+		is brought to the foreground. */
+		ESwitchFiles
+		};
+	
+public:
+	IMPORT_C RApaLsSession();
+	//
+	IMPORT_C TInt Connect();
+	IMPORT_C TVersion Version() const;
+	//
+	IMPORT_C TInt AppCount(TInt& aCount) const; // returns error
+	IMPORT_C TInt EmbeddableAppCount(TInt& aCount) const; // returns error
+	//
+	IMPORT_C TInt GetAllApps() const; // Call to initialize
+	IMPORT_C TInt GetAllApps(TInt aScreenMode) const; // Call to initialize
+	IMPORT_C TInt GetEmbeddableApps() const; // Call to initialize
+	IMPORT_C TInt GetEmbeddableApps(TInt aScreenMode) const; // Call to initialize
+	// 7.0s
+	IMPORT_C TInt GetFilteredApps(const TApaEmbeddabilityFilter& aFilter) const; // Call to initialize
+	IMPORT_C TInt GetFilteredApps(const TApaEmbeddabilityFilter& aFilter, TInt aScreenMode) const; // Call to initialize
+	// 8.1
+	IMPORT_C TInt GetFilteredApps(TUint aCapabilityAttributeMask, TUint aCapabilityAttributeValue) const; // Call to initialize
+	IMPORT_C TInt GetFilteredApps(TUint aCapabilityAttributeMask, TUint aCapabilityAttributeValue, TInt aScreenMode) const; // Call to initialize
+	// 9.0
+	IMPORT_C TInt GetServerApps(TUid aServiceUid) const; // Call to initialize
+	IMPORT_C TInt GetServerApps(TUid aServiceUid, TInt aScreenMode) const; // Call to initialize
+	//
+	IMPORT_C TInt GetNextApp(TApaAppInfo& aInfo) const; // call repeatedly, returns err (inc ENoMoreAppsInList,EAppListInvalid)
+	IMPORT_C TInt GetNextApp(TApaAppInfo& aInfo,TInt aScreenMode) const; // call repeatedly, returns err (inc ENoMoreAppsInList,EAppListInvalid)
+	//
+	IMPORT_C TInt GetAppInfo(TApaAppInfo& aInfo,TUid aAppUid) const;
+	IMPORT_C TInt SetAppShortCaption(const TDesC& aShortCaption, TLanguage aLanguage, TUid aAppUid);
+	IMPORT_C TInt GetDefaultScreenNumber(TInt& aDefaultScreenNumber, TUid aAppUid) const;
+	
+public:
+	IMPORT_C TInt GetAppCapability(TDes8& aCapabilityBuf,TUid aAppUid) const;
+	IMPORT_C TInt StartApp(const CApaCommandLine& aCommandLine); // This is only recommended for non document based apps
+	IMPORT_C TInt StartApp(const CApaCommandLine& aCommandLine,TThreadId& aThreadId);
+	IMPORT_C TInt StartApp(const CApaCommandLine& aCommandLine,TThreadId& aThreadId,TRequestStatus* aRequestStatusForRendezvous);
+	//
+	IMPORT_C TInt RecognizeData(const TDesC& aName, const TDesC8& aBuffer, TDataRecognitionResult& aDataType) const;
+	IMPORT_C TInt RecognizeData(const RFile& aFile, TDataRecognitionResult& aDataType) const;
+	IMPORT_C TInt RecognizeSpecificData(const TDesC& aName, const TDesC8& aBuffer, const TDataType& aDataType, TBool& aResult) const;
+	IMPORT_C TInt RecognizeSpecificData(const RFile& aFile, const TDataType& aDataType, TBool& aResult) const;
+	//
+	IMPORT_C TInt AppForDataType(const TDataType& aDataType, TUid& aAppUid) const;
+	IMPORT_C TInt StartDocument(const TDesC& aFileName, TThreadId& aThreadId, TLaunchType aLaunchType=ELaunchNewApp);
+	IMPORT_C TInt StartDocument(RFile& aFile, TThreadId& aThreadId, TRequestStatus* aRequestStatusForRendezvous=NULL);
+	IMPORT_C TInt StartDocument(const TDesC& aFileName, const TDataType& aDataType, TThreadId& aThreadId, TLaunchType aLaunchType=ELaunchNewApp);
+	IMPORT_C TInt StartDocument(RFile& aFile, const TDataType& aDataType, TThreadId& aThreadId, TRequestStatus* aRequestStatusForRendezvous=NULL);
+	IMPORT_C TInt StartDocument(const TDesC& aFileName, TUid aAppUid, TThreadId& aThreadId, TLaunchType aLaunchType=ELaunchNewApp);
+	IMPORT_C TInt StartDocument(RFile& aFile, TUid aAppUid, TThreadId& aThreadId, TRequestStatus* aRequestStatusForRendezvous=NULL);
+	IMPORT_C TInt CreateDocument(const TDesC& aFileName, TUid aAppUid, TThreadId& aThreadId, TLaunchType aLaunchType=ELaunchNewApp);
+	//
+	IMPORT_C TInt GetAppIcon(TUid aAppUid, TInt aSize, CApaMaskedBitmap& aAppBitmap) const;
+	//
+	IMPORT_C TInt AppForDocument(const TDesC& aFileName, TUid& aAppUid, TDataType& aDataType) const;
+	IMPORT_C TInt AppForDocument(const RFile& aFile, TUid& aAppUid, TDataType& aDataType) const;
+	IMPORT_C TInt IsProgram(const TDesC& aFileName, TBool& aProgram) const;
+	IMPORT_C TInt GetAcceptedConfidence(TInt& aConfidence) const;
+	IMPORT_C TInt SetAcceptedConfidence(TInt aConfidence);
+	IMPORT_C TInt GetMaxDataBufSize(TInt& aBufSize) const;
+	IMPORT_C TInt SetMaxDataBufSize(TInt aBufSize);
+	IMPORT_C TInt GetPreferredBufSize(TInt& aPreferredBufSize) const;
+	IMPORT_C TInt GetSupportedDataTypesL(CDataTypeArray& aDataTypes) const;
+	//
+	IMPORT_C TInt GetAppIconSizes(TUid aAppUid, CArrayFixFlat<TSize>& aArrayToFill) const;
+	IMPORT_C TInt GetAppIcon(TUid aAppUid, TSize aSize, CApaMaskedBitmap& aAppBitmap) const;
+	IMPORT_C TInt GetAppIcon(TUid aAppUid, RFile& aFile) const;
+	//
+	IMPORT_C TInt GetAppViews(CApaAppViewArray& aAppViews, TUid aAppUid) const;
+	IMPORT_C TInt GetAppViewIcon(TUid aAppUid, TUid aViewUid, const TSize& aSize, CApaMaskedBitmap& aViewBitmap) const;
+	IMPORT_C TInt GetAppOwnedFiles(CDesCArray& aAppOwnedFiles, TUid aAppUid) const;
+	//
+	IMPORT_C TInt NumberOfOwnDefinedIcons(TUid aAppUid, TInt& aCount) const;
+	//
+	IMPORT_C TInt GetAppIcon(TUid aAppUid, HBufC*& aFullFileName) const;
+	IMPORT_C TInt GetAppViewIcon(TUid aAppUid, TUid aViewUid, HBufC*& aFullFileName) const;
+	IMPORT_C TInt InsertDataMapping(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid);
+	IMPORT_C TInt InsertDataMappingIfHigher(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid, TBool& aInserted);
+	IMPORT_C TInt DeleteDataMapping(const TDataType& aDataType);
+	/**
+	@internalComponent
+	@released
+	*/
+	IMPORT_C TInt InsertDataMapping(const TDataType& aDataType, TDataTypePriority aPriority, 
+		TUid aUid, TUid aServiceUid);
+	/**
+	@internalComponent
+	@released
+	*/
+	IMPORT_C TInt DeleteDataMapping(const TDataType& aDataType, TUid aServiceUid);
+	/**
+	@internalComponent
+	@released
+	*/
+	IMPORT_C TInt GetAppByDataType(const TDataType& aDataType, TUid aServiceUid, TUid& aAppUid) const;
+
+public:
+	//
+	IMPORT_C CApaAppServiceInfoArray* GetAppServicesLC(TUid aAppUid) const;
+	IMPORT_C CApaAppServiceInfoArray* GetServiceImplementationsLC(TUid aServiceUid) const;
+	IMPORT_C CApaAppServiceInfoArray* GetServiceImplementationsLC(TUid aServiceUid, const TDataType& aDataType) const;
+	IMPORT_C void GetAppServicesL(TUid aAppUid, CArrayFixFlat<TUid>& aServiceUids) const;
+	IMPORT_C CApaAppServiceInfoArray* GetAppServiceOpaqueDataLC(TUid aAppUid, TUid aServiceUid) const;
+	IMPORT_C TInt AppForDataTypeAndService(const TDataType& aDataType, TUid aServiceUid, TUid& aAppUid) const;
+	IMPORT_C TInt AppForDocumentAndService(const TDesC& aFileName, TUid aServiceUid, TUid& aAppUid, TDataType& aDataType) const;
+	IMPORT_C TInt AppForDocumentAndService(const RFile& aFile, TUid aServiceUid, TUid& aAppUid, TDataType& aDataType) const;
+	IMPORT_C TInt ApplicationLanguage(TUid aAppUid, TLanguage& aLanguage) const;
+	IMPORT_C void Close(); //lint !e1511 Member hides non-virtual member
+
+	IMPORT_C void RegisterListPopulationCompleteObserver(TRequestStatus& aStatus) const;
+	IMPORT_C TInt CancelListPopulationCompleteObserver() const;
+	IMPORT_C TInt MatchesSecurityPolicy(TBool& aMatches, TUid aAppUid, const TSecurityPolicy& aSecurityPolicy) const;
+	IMPORT_C TInt RecognizeFilesL(const TDesC& aPath, CDataRecognitionResultArray& aResult) const;
+	IMPORT_C void RecognizeFilesL(const TDesC& aPath, CDataRecognitionResultArray& aResult, TRequestStatus& aStatus);
+	IMPORT_C TInt RecognizeFilesL(const TDesC& aPath, const TDesC8& aDataType, CDataRecognitionResultArray& aResult) const;
+	IMPORT_C void RecognizeFilesL(const TDesC& aPath, const TDesC8& aDataType, CDataRecognitionResultArray& aResult, TRequestStatus& aStatus);
+	IMPORT_C void CancelRecognizeFiles();
+
+	IMPORT_C void RegisterNonNativeApplicationTypeL(TUid aApplicationType, const TDesC& aNativeExecutable);
+	IMPORT_C void DeregisterNonNativeApplicationTypeL(TUid aApplicationType);
+	IMPORT_C void PrepareNonNativeApplicationsUpdatesL();
+	IMPORT_C void RegisterNonNativeApplicationL(TUid aApplicationType, const TDriveUnit& aDrive, CApaRegistrationResourceFileWriter& aRegistrationResourceFile, CApaLocalisableResourceFileWriter* aLocalisableResourceFile, const RFile* aIconFile);
+	IMPORT_C void DeregisterNonNativeApplicationL(TUid aApplication);
+	IMPORT_C void CommitNonNativeApplicationsUpdatesL();
+	IMPORT_C TInt RollbackNonNativeApplicationsUpdates();
+	IMPORT_C void NotifyOnDataMappingChange(TRequestStatus& aRequestStatus);
+	IMPORT_C void CancelNotifyOnDataMappingChange();
+	IMPORT_C TInt GetAppType(TUid& aTypeUid, TUid aAppUid) const;
+	
+	IMPORT_C TInt ForceRegistration(const RPointerArray<TDesC>& aRegFiles);
+	
+public:
+	// not for public use
+	IMPORT_C static void SetFsSessionL(RFs& aFsSession);
+	IMPORT_C static void ClearFsSession();
+	IMPORT_C static RFs* FsSession();
+	IMPORT_C void SetNotify(TBool aCompleteImmediatelyIfNoScanImpendingOrInProgress, TRequestStatus& aStatus);
+	IMPORT_C void CancelNotify();
+
+private: // Reserved for future use
+	IMPORT_C virtual void RApaLsSession_Reserved1();
+	IMPORT_C virtual void RApaLsSession_Reserved2();
+
+public:
+	/**
+	@publishedPartner
+	@released
+	*/
+	IMPORT_C void ForceCommitNonNativeApplicationsUpdatesL(); 
+	
+private:
+	void DoGetAppOwnedFilesL(CDesCArray& aArrayToFill, TUid aAppUid) const;
+	void DoGetAppViewsL(CApaAppViewArray& aArrayToFill, TUid aAppUid) const;
+	void DoGetAppIconSizesL(TUid aAppUid, CArrayFixFlat<TSize>& aArrayToFill) const;
+	TInt DoAppCount(TInt& aCount,TInt aCommand) const;
+	void FetchArrayL(MArrayFiller& aArrayFiller,TUid aAppUid, TInt aOpcode, TInt aInitialBufSize) const;
+	CBufBase* GetServiceBufferLC(TInt aOpcode, TUid aUid1, TUid aUid2=KNullUid) const;
+	TInt StartAndCreate(TInt aRqst,const TDesC& aFileName, TUid aAppUid, TThreadId& aThreadId, TLaunchType aLaunchType);
+	CBufBase* GetServiceBufferLC(TInt aOpcode, TUid aUid1, const TDataType& aDataType) const;
+	TInt SendReceiveWithReconnect(TInt aFunction,const TIpcArgs& aIpcArgs) const;
+	TInt TransferAndInternalizeDataL(const TDesC& aPath, const TInt aRequiredBufferSize, CDataRecognitionResultArray& aResult) const;
+	TInt GetExecutableName(TDes& aNativeExecutableName, TDes& aLogicalExecutableName, HBufC8*& aOpaqueData, TIpcArgs& aIpcArgs, TInt aOpcode) const;
+	TInt GetOpaqueData(HBufC8*& aOpaqueData, TInt aLengthOfOpaqueData) const;
+	TInt StartApplicationPassingFileHandle(const TDesC& aNativeExecutableName, const TDesC& aLogicalExecutableName, const TDesC8* aOpaqueData, const RFile& aFile, TThreadId& aThreadId, TRequestStatus* aRequestStatusForRendezvous);
+	TInt StartApplicationPassingDocumentName(const TDesC& aNativeExecutableName, const TDesC& aLogicalExecutableName, const TDesC8* aOpaqueData, const TDesC& aDocumentName, TThreadId& aThreadId,TApaCommand aCommand, TRequestStatus* aRequestStatusForRendezvous);
+	void StartApplicationL(const TDesC& aNativeExecutableName, const CApaCommandLine& aCommandLine, TThreadId& aThreadId, TRequestStatus* aRequestStatusForRendezvous);
+	TInt DoAppForDocumentOptionallySpecifyingService(const TDesC& aFileName, TUid aServiceUid, TUid& aAppUid, TDataType& aDataType, TInt aOpcode) const;
+	TInt DoAppForDocumentOptionallySpecifyingService(const RFile& aFile, TUid aServiceUid, TUid& aAppUid, TDataType& aDataType, TInt aOpcode) const;
+	TInt GetBufferFromFile(HBufC8*& aBuffer, const TDesC& aFileName) const;
+	TInt DoStartApp(const CApaCommandLine& aCommandLine, TThreadId* aThreadId,TRequestStatus* aRequestStatusForRendezvous);
+	void DoStartAppL(const CApaCommandLine& aCommandLine, TThreadId* aThreadId,TRequestStatus* aRequestStatusForRendezvous);
+	static void GetThreadIdL(TThreadId& aThreadId, const RProcess& aProcess);
+	static void DeletePointerToPointerToTAny(TAny* aPointerToPointerToTAny);
+	static CBufFlat* CreateRegFilesBufferL(const RPointerArray<TDesC>& aRegFiles);
+	static void CleanupOperation(TAny* aAny);
+
+private: // data
+	CApaLsSessionExtension* iExtension; // friend!
+	};
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/APGCTL.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,160 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __APGCTL_H__
+#define __APGCTL_H__
+
+#if !defined(__E32STD_H__)
+#include <e32std.h>
+#endif
+#if !defined(__E32BASE_H__)
+#include <e32base.h>
+#endif
+
+// classes defined:
+class CApaSystemControl;
+class CApaSystemControlList;
+//
+// classes referenced:
+class RFs;
+class CApaMaskedBitmap;
+//
+
+/**
+Calls the control DLL's first ordinal function to create and run the control.
+
+The function leaves with KErrBadLibraryEntryPoint if the ordinal 1 function 
+cannot be found.
+
+@publishedAll 
+@released
+*/
+typedef TInt (*ApaRunSystemControl)(const TDesC&);
+
+/**
+@publishedAll 
+@released
+*/
+#ifdef _UNICODE
+#define KUidSystemControlDll KUidSystemControlDll16
+#else
+#define KUidSystemControlDll KUidSystemControlDll8
+#endif
+
+/**
+@publishedAll 
+@deprecated
+*/
+const TInt KSystemControlDllUidValue8=0x10000297;
+
+/**
+@publishedAll
+@deprecated
+*/
+const TUid KUidSystemControlDll8={KSystemControlDllUidValue8};
+
+/**
+@publishedAll
+@released
+*/
+const TUid KUidSystemControlDll16={0x10003A34};
+
+
+class CApaSystemControl : public CBase
+/** Wrapper to a control panel application.
+
+An instance of the class represents a control panel application. It is also a cache for the control's icon and caption.
+
+An instance of the wrapper can only be constructed by the control panel application list, which 
+is a CApaSystemControlList object. 
+
+@publishedAll
+@released */
+	{
+public:
+	IMPORT_C void CreateL();
+	IMPORT_C TUid Type()const;
+	IMPORT_C TFileName FileName()const;
+	IMPORT_C CApaMaskedBitmap* Icon()const; // one size of icon, 48x48?
+	IMPORT_C TPtrC Caption()const;
+	IMPORT_C TPtrC ShortCaption()const;
+private:
+	static CApaSystemControl* NewL(RFs& aFs,const TDesC& aFullPath,const TUidType aUidType);
+	~CApaSystemControl();
+	
+	CApaSystemControl(RFs& aFs);
+	void ConstructL(const TDesC& aFullPath,const TUidType aUidType);
+private:
+	CApaSystemControl* iNext;
+	HBufC* iCaption;
+	HBufC* iShortCaption;
+	CApaMaskedBitmap* iIcon;
+	TBool iExists; // used during updating
+	TFileName iFullPath;
+	TUidType iUidType;
+	RFs& iFs;
+	
+	friend class CApaSystemControlList;
+	};
+
+
+
+class CApaSystemControlList : public CBase
+/** Provides a list of all available control panel applications present on the phone. 
+This class is implemented as a linked list of CApaSystemControl. Updates the control panel application list by removing 
+control panels that no longer exist, adding new control panels found to the control panel application list and replacing 
+a control panel if found in an earlier drive.
+
+@see CApaSystemControl
+@publishedPartner
+@released
+*/
+	{
+public:
+	IMPORT_C static CApaSystemControlList* NewL(RFs& aFs);
+	IMPORT_C ~CApaSystemControlList();
+	
+	IMPORT_C TInt Count()const;
+	IMPORT_C TInt Index(TUid aType)const;
+	IMPORT_C CApaSystemControl* Control(TInt aIndex)const;
+	IMPORT_C CApaSystemControl* Control(TUid aType)const;
+	
+	IMPORT_C void UpdateL();
+	inline TInt UpdateCount()const;
+private:
+	CApaSystemControlList(RFs& aFs);
+	CApaSystemControl* PreviousControl(const CApaSystemControl* aControl) const;
+private:
+	TInt iUpdateCount;
+	RFs& iFs;
+	CApaSystemControl* iControl;
+	};
+
+
+//
+// inlines
+//
+
+
+inline TInt CApaSystemControlList::UpdateCount()const
+/** Gets the number of times the control panel application list has been 
+updated (by calling UpdateL()). It returns 1 for a newly created list.
+
+@return The number of times the control panel application list has been changed. */
+	{ return iUpdateCount; }
+
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/APGDOOR.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,181 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __APGDOOR_H__
+#define __APGDOOR_H__
+
+#if !defined(__E32STD_H__)
+#include <e32std.h>
+#endif
+#if !defined(__E32BASE_H__)
+#include <e32base.h>
+#endif
+#if !defined(__S32STD_H__)
+#include <s32std.h>
+#endif
+#if !defined(__GDI_H__)
+#include <gdi.h>
+#endif
+#if !defined(__APPARC_H__)
+#include <apparc.h>
+#endif
+#if !defined(__APADBASE_H__)
+#include <apadbase.h>
+#endif
+
+/**
+@internalAll
+*/
+#ifdef _UNICODE
+#define KUidApaDoorDocStream KUidApaDoorDocStream16
+#else
+#define KUidApaDoorDocStream KUidApaDoorDocStream8
+#endif
+
+/**
+@internalComponent
+@deprecated
+*/
+const TUid KUidApaDoorDocStream8={0x10000144};
+
+/**
+@internalComponent
+*/
+const TUid KUidApaDoorDocStream16={0x10003A35};
+
+// classes defined:
+class CApaDoor;
+class TApaPictureFactory;
+//
+// classes referenced:
+class CEmbeddedStore;
+//
+
+class CApaDoor : public CApaDoorBase
+/** A wrapper for an embedded document that can be displayed in a user interface 
+as an icon or a glass door. 
+
+@publishedAll 
+@released */
+	{
+public:
+	IMPORT_C static CApaDoor* NewLC(RFs& aFs, CApaDocument& aDoc,const TSize& aDefaultIconSizeInTwips); // call to create a new door in iconic format - restoration is achieved with TApaPictureFactory
+	IMPORT_C static CApaDoor* NewL(RFs& aFs, CApaDocument& aDoc,const TSize& aDefaultIconSizeInTwips); // call to create a new door in iconic format - restoration is achieved with TApaPictureFactory
+	IMPORT_C static CApaDoor* NewL(RFs& aFs, const CStreamStore& aStore,TStreamId aStreamId,CApaProcess& aProcess); // restoring constructor called by TApaPictureFactory
+	//
+	IMPORT_C void SetFormatToIconL();
+	IMPORT_C void SetFormatToGlassL();
+	IMPORT_C void SetFormatToTemporaryIconL(TBool aEnabled=ETrue);
+	//
+	IMPORT_C CApaDocument* DocumentL(TBool aCheckPassword=EFalse); // returns a pointer to the doc, restoring it if necessary. Checks password if required.
+	inline TDesC* Caption()const;
+	IMPORT_C TUid AppUidL()const;
+	//
+	// persistence methods
+	IMPORT_C void RestoreL(const CStreamStore& aStore,TStreamId aHeadStreamId);
+	TStreamId StoreL(CStreamStore& aStore) const;
+	//
+	IMPORT_C ~CApaDoor();
+	//
+	// from CPicture
+	void Draw(CGraphicsContext& aGc,const TPoint& aTopLeft,const TRect& aClipRect,
+						MGraphicsDeviceMap* aMap)const; // draws according to current iPicFormat
+	void DetachFromStoreL(TDetach aDegree=EDetachFull); //lint !e1735 Virtual function has default parameter - Must use the same default as declared by CPicture
+	void GetOriginalSizeInTwips(TSize& aSize)const;
+	void SetScaleFactor(TInt aScaleFactorWidth,TInt aScaleFactorHeight);
+	void SetCropInTwips(const TMargins& aMargins);
+	TPictureCapability Capability() const;
+	void GetCropInTwips(TMargins& aMargins) const;
+	TInt ScaleFactorWidth() const;
+	TInt ScaleFactorHeight() const;
+private:
+	CApaDoor(RFs& aFs, CApaProcess& aProcess);
+	CApaDoor(RFs& aFs, CApaDocument& aDoc,const TSize& aDefaultIconSizeInTwips);
+	void ConstructL();
+	//
+	void SetIconSizeInTwips(TSize aSize); // for use of factory
+	//
+	void StoreDocL(CPersistentStore& aStore)const;
+	void RestoreDocL(const CPersistentStore& aStore);
+	void RestoreDoorStateL(const CStreamStore& aStore,const CStreamDictionary& streamDic);
+	static CStreamDictionary* ReadStreamDictionaryLC(const CStreamStore& aStore,TStreamId aStreamId);
+	static void CopyStoreL(const CEmbeddedStore& aSourceStore,RWriteStream& aTargetStream);
+	void ExternalizeStateStreamL(CStreamStore& aStore,CStreamDictionary& aStreamDict)const;
+	void InternalizeStateStreamL(const CStreamStore& aStore,const CStreamDictionary& aStreamDict,TSize aDefaultIconSize);
+	//
+	// required so CPicture's can be swizzled
+	void ExternalizeL(RWriteStream& aStream)const;
+	// from CApaDoorBase
+	virtual TSize GlassDoorSize()const;
+	TUid AppUidFromStreamL() const;
+private:
+	RFs& iFs;
+	HBufC* iAppCaption; // name of the app used to create the embedded object
+	CApaProcess* iApaProcess;
+	CApaDocument* iApaDoc;
+	CPicture* iPicture; // the current view of the door, either iconic or glass
+	CEmbeddedStore* iStore; // store containing the doc
+	CBufSeg* iStoreHost; // the host for the embedded store, if the door has been detached from its originating store
+	__MUTABLE TSize iIconSizeInTwips;
+	//
+	friend class TApaPictureFactory;
+	};
+
+
+class TApaPictureFactory : public MPictureFactory
+// Recognizes KUidPictureTypeDoor and creates CApaDoor pictures
+/** A factory class for instantiating and restoring an application's door.
+
+A door factory object is constructed by the UI environment and can be accessed 
+by calling CEikonEnv::PictureFactory().
+
+@publishedAll
+@released 
+@see CEikonEnv::PictureFactory()
+@see CApaDoor */
+	{
+public:
+	IMPORT_C TApaPictureFactory(CApaProcess* aAppProcess);
+	inline void SetIconSize(TSize aIconSizeInTwips);
+	//
+	// from MPictureFactory
+	IMPORT_C void NewPictureL(TPictureHeader& aPictureHeader,const CStreamStore& aPictureStore)const; // used to create CApaDoor's during document restore only 
+protected:
+	IMPORT_C TApaPictureFactory();
+	
+private:
+	CApaProcess* iApaProcess;
+	TSize iIconSize;
+	TInt iSpare;
+	};
+
+
+//
+// inlines
+//
+
+inline TDesC* CApaDoor::Caption()const 
+	/** Gets the name of the application with which the embedded document is associated.
+	
+	@return A pointer to a descriptor containing the name of the application. */
+	{ return iAppCaption; }
+
+inline void TApaPictureFactory::SetIconSize(TSize aIconSizeInTwips)
+	/** Sets the size of the icon.
+	
+	@param aIconSizeInTwips The size of the icon, in twips. */
+	{ iIconSize = aIconSizeInTwips; }
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/APGICNFL.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,561 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __APGICNFL_H__
+#define __APGICNFL_H__
+
+#include <apadef.h>
+#include <apaid.h>
+#include <bitdev.h>
+#include <apmstd.h>
+#include <badesca.h>
+
+class CFbsBitmap;
+class CPersistentStore;
+class RReadStream;
+class RWriteStream;
+
+class CApaMaskedBitmap : public CFbsBitmap
+/** An application icon.
+
+This is a bitmap and a mask, managed by the Font and Bitmap server.
+
+An object of this type is passed to RApaLsSession::GetAppIcon() to fetch a 
+suitable application icon.
+
+@publishedAll
+@released
+@see RApaLsSession::GetAppIcon() */
+	{
+public:
+	IMPORT_C static CApaMaskedBitmap* NewLC();
+	IMPORT_C static CApaMaskedBitmap* NewL(const CApaMaskedBitmap* aSourceIcon);
+	//
+	IMPORT_C CFbsBitmap* Mask() const;
+	IMPORT_C void InternalizeL(RReadStream& aStream); 		//lint !e1511 Member hides non-virtual member - CFbsBitmap not primary intended for derivation
+	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;//lint !e1511 Member hides non-virtual member - CFbsBitmap not primary intended for derivation
+	//
+	IMPORT_C ~CApaMaskedBitmap();
+	void SetRomBitmapL(TUint8* aRomPointer);				//lint !e1511 Member hides non-virtual member - CFbsBitmap not primary intended for derivation
+	IMPORT_C void SetMaskBitmap(CFbsBitmap* aMask);
+private:
+	CApaMaskedBitmap();
+	void ConstructL();
+private:
+	CFbsBitmap* iMask;
+	};
+
+/**
+@internalComponent
+*/
+class CApaResourceFileWriterBase : public CBase
+	{
+protected:
+	class RBufferSink;
+	class MDataSink
+		{
+	public:
+		void WriteBufferL(const TDesC8& aBuffer);
+		void WriteCompressedUnicodeRunL(TInt aNumberOfBytesWhenUncompressed, const TDesC8& aTextAsCompressedUnicode);
+		void WriteInCompressedUnicodeFormatL(TInt aNumberOfBytesWhenUncompressed, const TDesC8& aData, TBool aInCompressedUnicodeRun);
+		TInt NumberOfBytesWhenUncompressed() const;
+		inline TBool CompressedUnicodeFormat() const {return (iBufferSinkForCompressedUnicodeFormat!=NULL);}
+	protected:
+		MDataSink(RBufferSink* aBufferSinkForCompressedUnicodeFormat);
+		void FlushL(TBool aFinalFlush);
+		void Reset(TInt& aNumberOfBytesWhenUncompressed);
+	private:
+		void WriteRunLengthL(TInt aRunLength);
+	private:
+		enum
+			{
+			EFlag_InCompressedUnicodeRun	=0x00000001
+			};
+	private:
+		// new virtual functions
+		virtual void DoWriteBufferL(const TDesC8& aBuffer)=0;
+	private:
+		TInt iNumberOfBytesWhenUncompressed;
+		TUint iFlags;
+		RBufferSink* iBufferSinkForCompressedUnicodeFormat; // does not own what it points to
+		};
+	class RBufferSink : public MDataSink
+		{
+	public:
+		RBufferSink(RBufferSink* aBufferSinkForCompressedUnicodeFormat);
+		void ConstructLC();
+		void Close();
+		void FlushAndGetAndResetL(TInt& aNumberOfBytesWhenUncompressed, RBuf8& aBuffer);
+	private:
+		// from MDataSink
+		virtual void DoWriteBufferL(const TDesC8& aBuffer);
+	private:
+		RBuf8 iBuffer;
+		};
+protected:
+	CApaResourceFileWriterBase();
+	void DoGenerateFileContentsL(RBuf8& aBuffer, TUid aUid2, TUid aUid3) const;
+	void WriteUidTypeL(MDataSink& aDataSink, TUid aUid2, TUid aUid3) const;
+	void WriteTextL(MDataSink& aDataSink, const TDesC& aText) const;
+	void WriteText8L(MDataSink& aDataSink, const TDesC8& aText8) const;
+	void WriteUint8L(MDataSink& aDataSink, TUint aUint8) const;
+	void WriteLittleEndianUint16L(MDataSink& aDataSink, TUint aUint16) const;
+	void WriteLittleEndianUint32L(MDataSink& aDataSink, TUint aUint32) const;
+	void WriteBufferL(MDataSink& aDataSink, const TDesC8& aBuffer) const;
+private:
+	static HBufC8* AsCompressedUnicodeLC(const TDesC& aUncompressedUnicode);
+	void MainResourceInCompiledFormatLC(TInt& aMainResourceSizeInBytesWhenUncompressed, RBuf8& aBuffer, TBool aCompressedUnicodeFormat) const;
+private:
+	// new virtual functions
+	virtual void MainResourceInCompiledFormatL(MDataSink& aDataSink) const=0;
+	virtual const TDesC8* SecondResourceL(TBool& aSecondResourceInCompressedUnicodeFormat) const=0;
+	};
+
+/**
+Used to support the registration of non-native applications.
+
+The task of this class is to generate the resource files expected by the Apparc server. Applications 
+that register other applications can use functions of this class to customise the generated resource files.
+
+@publishedPartner
+@released
+*/
+class CApaRegistrationResourceFileWriter : public CApaResourceFileWriterBase
+	{
+public:
+	IMPORT_C static CApaRegistrationResourceFileWriter* NewL(TUid aAppUid, const TDesC& aAppFile, TUint aAttributes);
+	IMPORT_C virtual ~CApaRegistrationResourceFileWriter();
+	TUid AppUid() const;
+	void GenerateFileContentsL(RBuf8& aBuffer) const;
+	void SetLocalisableResourceFileL(const TDesC& aLocalisableResourceFile);
+	IMPORT_C void SetAppIsHiddenL(TBool aAppIsHidden);
+	IMPORT_C void SetEmbeddabilityL(TApaAppCapability::TEmbeddability aEmbeddability);
+	IMPORT_C void SetSupportsNewFileL(TBool aSupportsNewFile);
+	IMPORT_C void SetLaunchInBackgroundL(TBool aLaunchInBackground);
+	IMPORT_C void SetGroupNameL(const TDesC& aGroupName);
+	IMPORT_C void SetDefaultScreenNumberL(TInt aDefaultScreenNumber);
+	IMPORT_C void SetOpaqueDataL(const TDesC8& aOpaqueData);
+	IMPORT_C void AddDataTypeL(TInt aPriority, const TDesC8& aType);
+	IMPORT_C void AddFileOwnershipInfoL(const TDesC& aFileName);
+// Not needing to be supported for the foreseeable future:
+//	IMPORT_C void AddServiceInfoL(TUid aServiceUid, const TDesC8* aOpaqueData);
+//	IMPORT_C void AddServiceInfoDataTypeL(TUid aServiceUid, TInt aPriority, const TDesC8& aType);
+private:
+	struct SDataType // DATATYPE
+		{
+		TInt iPriority;
+		HBufC8* iType;
+		};
+	struct SFileOwnershipInfo // FILE_OWNERSHIP_INFO
+		{
+		HBufC* iFileName;
+		};
+private:
+	CApaRegistrationResourceFileWriter(TUid aAppUid, TUint aAttributes);
+	void ConstructL(const TDesC& aAppFile);
+	void WriteDataTypeL(MDataSink& aDataSink, const SDataType& aDataType) const;
+	void WriteFileOwnershipInfoL(MDataSink& aDataSink, const SFileOwnershipInfo& aFileOwnershipInfo) const;
+	// from CApaResourceFileWriterBase
+	virtual void MainResourceInCompiledFormatL(MDataSink& aDataSink) const;
+	virtual const TDesC8* SecondResourceL(TBool& aSecondResourceInCompressedUnicodeFormat) const;
+private:
+	TUid iAppUid;
+	HBufC* iAppFile;
+	TUint iAttributes;
+	HBufC* iLocalisableResourceFile;
+	TBool iAppIsHidden;
+	TApaAppCapability::TEmbeddability iEmbeddability;
+	TBool iSupportsNewFile;
+	TBool iLaunchInBackground;
+	HBufC* iGroupName;
+	TInt iDefaultScreenNumber;
+	HBufC8* iOpaqueData;
+	RArray<SDataType> iDataTypeList;
+	RArray<SFileOwnershipInfo> iFileOwnershipList;
+	};
+
+/**
+@internalAll
+*/
+class CApaLocalisableResourceFileWriter : public CApaResourceFileWriterBase
+	{
+public:
+	IMPORT_C static CApaLocalisableResourceFileWriter* NewL(const TDesC& aShortCaption, const TDesC& aCaption, TInt aNumberOfIcons, const TDesC& aGroupName);
+	IMPORT_C virtual ~CApaLocalisableResourceFileWriter();
+	void GenerateFileContentsL(RBuf8& aBuffer) const;
+	void SetIconFileL(const TDesC& aIconFile);
+// Not needing to be supported for the foreseeable future:
+//	IMPORT_C void AddViewDataL(TUid aViewUid, TInt aScreenMode, const TDesC& aCaption, TInt aNumberOfIcons, const TDesC& aIconFile);
+private:
+	struct SCaptionAndIconInfo // CAPTION_AND_ICON_INFO
+		{
+		HBufC* iCaption;
+		TInt iNumberOfIcons;
+		HBufC* iIconFile;
+		};
+private:
+	CApaLocalisableResourceFileWriter(TInt aNumberOfIcons);
+	void ConstructL(const TDesC& aShortCaption, const TDesC& aCaption, const TDesC& aGroupName);
+	void WriteCaptionAndIconInfoL(MDataSink& aDataSink, const SCaptionAndIconInfo& aCaptionAndIcon) const;
+	// from CApaResourceFileWriterBase
+	virtual void MainResourceInCompiledFormatL(MDataSink& aDataSink) const;
+	virtual const TDesC8* SecondResourceL(TBool& aSecondResourceInCompressedUnicodeFormat) const;
+private:
+	HBufC* iShortCaption;
+	SCaptionAndIconInfo iCaptionAndIcon;
+	HBufC* iGroupName;
+	};
+
+#if defined(UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER)
+
+class CApaAppInfoFileWriter;
+
+/**
+@internalAll
+*/
+const TUid KUidInterimFormatFileForJavaMIDletInstaller={0x10208182};
+
+/**
+@internalAll
+*/
+class ForJavaMIDletInstaller
+	{
+public:
+	IMPORT_C static void CheckInterimFormatFileNotCorruptL(RFile& aInterimFormatFile);
+	IMPORT_C static void GetJavaMIDletInfoL(RFs& aFs, const TDesC& aFileName,TUint32& aJavaMIDletInfo_AmsAuthId,TUint32& aJavaMIDletInfo_MIDlet);
+	IMPORT_C static CApaAppInfoFileWriter* NewInterimFormatFileWriterLC(RFs& aFs,const TDesC& aFileName,TUid aApplicationUid,TUint32 aJavaMIDletInfo_AmsAuthId,TInt aJavaMIDletInfo_MIDlet);
+	};
+
+#endif // UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER
+
+#if (((defined(SYMBIAN_SUPPORT_UI_FRAMEWORKS_V1) || !defined(SYMBIAN_HIDE_UI_FRAMEWORKS_V1)) && !defined(SYMBIAN_REMOVE_UI_FRAMEWORKS_V1)) || defined(UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER))
+
+#if !defined(IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER)
+// we're compiling a source file that doesn't define IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER, so give it it's default "value" of "IMPORT_C"
+#define IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER IMPORT_C
+#endif
+
+/**
+@publishedAll
+@deprecated
+*/
+#ifdef _UNICODE
+#define KUidAppInfoFile KUidAppInfoFile16
+#else
+#define KUidAppInfoFile KUidAppInfoFile8
+#endif
+
+/**
+@publishedAll
+@deprecated
+*/
+const TUid KUidAppInfoFile8={268435562};
+
+/**
+@publishedAll
+@deprecated
+*/
+const TUid KUidAppInfoFile16={0x10003A38};
+
+/**
+@internalComponent
+*/
+const TUid KUidAppInfoFileVersion2={0x101fb032};
+
+/**
+@internalComponent
+*/
+enum TAifVersion
+// The order here is important, only ever APPEND to the list
+	{
+	EAifVersionOriginal,
+	EAifVersionAddsDataType,
+	EAifVersionAddsViewData,
+	EAifVersionAddsFileOwnershipInfo
+#if defined(UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER)
+	,EAifVersionAddsJavaMIDletInfo
+#endif
+	};
+
+class CApaAIFCaption : public CBase
+//
+// Represents a caption in an AIF during reading and writing of the file.
+/**
+@internalComponent
+*/
+	{
+public:
+	~CApaAIFCaption();
+	CApaAIFCaption();
+	void ConstructL(TLanguage aLanguage,const TDesC& aCaption);
+	static CApaAIFCaption* NewLC(TLanguage aLanguage,const TDesC& aCaption);
+	void InternalizeL(RReadStream& aStream);
+	void ExternalizeL(RWriteStream& aStream) const;
+	TLanguage Language() const;
+	TApaAppCaption Caption() const;
+public:
+	HBufC* iCaption;
+	TLanguage iLanguage;
+	};
+
+class CApaAIFViewData : public CBase
+//
+// Represents the data associated with an application view described in an AIF
+// during reading and writing of the file.
+// implementation class
+/**
+@internalComponent
+*/
+	{
+public:
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER TApaAppCaption CaptionL(TLanguage aLanguage) const;
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER CApaMaskedBitmap* IconByIndexL(TInt aIndex) const;
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER TInt NumberOfIcons() const;
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER TUid ViewUid() const;
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER TInt ScreenMode() const;
+public:
+	~CApaAIFViewData();
+	static CApaAIFViewData* NewLC();
+	static CApaAIFViewData* NewLC(const CApaAIFViewData& aSourceData);
+	void InternalizeL(RReadStream& aStream);		
+	void ExternalizeL(RWriteStream& aStream) const;
+	void SetScreenMode(TInt aScreenMode);
+	void AddCaptionL(TLanguage aLanguage,const TDesC& aCaption);
+	void AddIconL(CApaMaskedBitmap& aIcon);
+	void AddIconIndexL(TInt aIndex);
+	void SetViewUid(TUid aUid);
+	void LoadIconsL(const TDesC& aFileName, TUint aMbmOffset);
+private:
+	CApaAIFViewData();
+	void ConstructL();
+	void ConstructL(const CApaAIFViewData& aSourceData);
+private:
+	TInt iScreenMode;
+	CArrayPtr<CApaMaskedBitmap>* iIconArray;
+	CArrayPtr<CApaAIFCaption>* iCaptionArray;
+	TUid iViewUid;
+	CArrayFixFlat<TInt>* iIconIndexArray;		// used for AIF version 2 format
+	};
+
+class CApaAppInfoFile : public CBase
+/**
+@internalComponent
+*/
+	{
+#if defined(UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER)
+	friend class ForJavaMIDletInstaller;
+#endif
+public:
+	~CApaAppInfoFile();
+	//
+protected:
+	CApaAppInfoFile(RFs& aFs);
+	void ConstructL();
+protected:
+
+	class TCaptionHeader
+		{
+	public:
+		void InternalizeL(RReadStream& aStream);			// internalizes the header info only
+		void ExternalizeL(RWriteStream& aStream) const;		// externalizes the header info only
+	public:
+		TSwizzle<HBufC> iCaption;
+		TLanguage iLanguage;
+		};
+	class TIconHeader
+		{
+	public:
+		void InternalizeL(RReadStream& aStream);			// internalizes the header info only
+		void ExternalizeL(RWriteStream& aStream) const;		// externalizes the header info only
+	public:
+		TSwizzle<CApaMaskedBitmap> iIcon;	// Used for old AIF format Internalize
+		TInt iIconSideInPixels;
+		TSwizzle<CFbsBitmap> iIconMain;		// Used for new AIF format
+		TSwizzle<CFbsBitmap> iIconMask;		// Used for new AIF format
+		};
+	class TDataTypeHeader
+		{
+	public:
+		// header info only
+		void InternalizeL(RReadStream& aStream); 			// internalizes the header info only
+		void ExternalizeL(RWriteStream& aStream) const;		// externalizes the header info only
+	public:
+		TSwizzle<TDataType> iDataType;
+		TDataTypePriority iPriority;
+		};
+	class TViewDataHeader
+		{
+	public:
+		void InternalizeL(RReadStream& aStream);			// internalizes the header info only
+		void ExternalizeL(RWriteStream& aStream) const;		// externalizes the header info only
+	public:
+		TSwizzle<CApaAIFViewData> iViewData;
+		};
+	class TFileOwnershipInfoHeader
+		{
+	public:
+		void InternalizeL(RReadStream& aStream);			// internalizes the header info only
+		void ExternalizeL(RWriteStream& aStream) const;		// externalizes the header info only
+	public:
+		TSwizzle<HBufC> iOwnedFileName;
+		};
+protected:
+	RFs& iFs;
+	CPersistentStore* iStore;
+	CArrayFix<TCaptionHeader>* iCaptionHeaderArray;
+	CArrayFix<TIconHeader>* iIconHeaderArray;
+	CArrayFix<TDataTypeHeader>* iDataTypeHeaderArray;
+	CArrayFix<TViewDataHeader>* iViewDataHeaderArray;
+	CArrayFix<TFileOwnershipInfoHeader>* iFileOwnershipInfoHeaderArray;
+	TApaAppCapability iCapability;
+	};
+
+class CApaAppInfoFileReader : public CApaAppInfoFile
+/** Aif file reader.
+
+Aif files contain information about an application, including its icons and 
+captions.
+
+An application can get a reader for its own aif file by calling CEikApplication::OpenAppInfoFileLC(). 
+
+@publishedAll
+@deprecated */
+	{
+#if defined(UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER)
+	friend class ForJavaMIDletInstaller;
+#endif
+public:
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER static CApaAppInfoFileReader* NewLC(RFs& aFs, const TDesC& aFileName,TUid aApplicationUid=KNullUid);
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER static CApaAppInfoFileReader* NewL(RFs& aFs, const TDesC& aFileName,TUid aApplicationUid=KNullUid);
+	//
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER void Capability(TDes8& aInfo) const;
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER TApaAppCaption CaptionL(TLanguage aLanguage);
+	
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER CApaMaskedBitmap* CreateMaskedBitmapL(TInt aIconSideInPixels); // If there are no bitmaps in the file this method leaves with KErrNotFound
+	// Not available until ER6
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER CApaMaskedBitmap* CreateMaskedBitmapByIndexLC(TInt aIndex); // If there are no bitmaps in the file this method leaves with KErrNotFound
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER TInt NumberOfBitmaps() const;
+
+	// Not available till ER5
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER void DataTypesSupportedL(CArrayFix<TDataTypeWithPriority>& aTypeList) const;
+	//
+
+	// Not available till ER6.1
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER void GetViewsL(CArrayPtr<CApaAIFViewData>& aViewList) const;
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER void GetOwnedFilesL(CDesCArray& aOwnedFilesList) const;
+	//	
+
+	// utility function
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER static void StretchDrawL(CFbsBitmap* aSource,CFbsBitmap* aTarget,TSize aSizeInPixels);
+	//
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER ~CApaAppInfoFileReader();
+public:
+	static void GetAifFileNameL(const TDesC& aFullName,TDes& aAifName);
+private:
+	CApaAppInfoFileReader(RFs& aFs);
+	void InternalizeL(RReadStream& aStream);
+	void ConstructL(const TDesC& aFileName,TUid aUid);
+	void LoadAifFileVersionTwoL(const TDesC& aFileName, TUid aMostDerivedUid);
+	void AddIconHeadersL(const TDesC& aFileName, TInt32 aFileOffset, TInt aNumIcons);
+private:
+	HBufC* iDefaultCaption;
+	TUint8* iRomPointer;
+	TInt iMbmOffset;
+	HBufC* iAifFileName;
+#if defined(UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER)
+	TUint32 iJavaMIDletInfo_AmsAuthId;
+	TInt iJavaMIDletInfo_MIDlet;
+#endif
+	};
+
+class CApaAppInfoFileWriter : public CApaAppInfoFile
+/**
+Aif file writer.
+
+This class writes application information, including icons and captions into the aif file.
+
+@publishedAll
+@deprecated */
+	{
+#if defined(UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER)
+	friend class ForJavaMIDletInstaller;
+#endif
+public:
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER static CApaAppInfoFileWriter* NewLC(RFs& aFs, const TDesC& aFileName,TUid aApplicationUid);
+	//
+	IMPORT_C TInt SetCapability(const TDesC8& aInfo);
+	IMPORT_C void AddCaptionL(TLanguage aLanguage,const TDesC& aCaption);
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER void AddIconL(const TDesC& aIconFileName);
+	IMPORT_C void AddIconL(CApaMaskedBitmap& aIcon);
+	
+	// Not available till ER5
+	IMPORT_C void AddDataTypeL(const TDataTypeWithPriority& aTypePriority);
+	//
+
+	// Not available till ER6.1
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER void AddViewL(TUid aViewUid);
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER void AddViewL(TUid aViewUid,TInt aScreenMode);
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER void AddViewCaptionL(TLanguage aLanguage,const TDesC& aCaption,TUid aViewUid);
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER void AddViewIconL(CApaMaskedBitmap& aIcon,TUid aViewUid);
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER void StoreViewL(TUid aViewId);
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER void AddOwnedFileL(const TDesC& aOwnedFileName);
+	//
+	
+	IMPORT_C void StoreL();
+	//
+	IMPORT_C ~CApaAppInfoFileWriter();
+private:
+	CApaAppInfoFileWriter(RFs& aFs);
+	void ExternalizeL(RWriteStream& aStream) const;
+	void ConstructL(const TDesC& aFileName,TUid aUid
+#if defined(UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER)
+					,TUid aMiddleUid=KUidAppInfoFile,TUint32 aJavaMIDletInfo_AmsAuthId=0,TInt aJavaMIDletInfo_MIDlet=0
+#endif
+					);
+private:
+	CStoreMap* iMap;
+#if defined(UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER)
+	TUint32 iJavaMIDletInfo_AmsAuthId;
+	TInt iJavaMIDletInfo_MIDlet;
+#endif
+	};
+
+class CApaAppCaptionFileReader : public CBase
+/**
+@internalComponent
+*/
+	{
+public:
+	CApaAppCaptionFileReader(RFs& aFs,const TDesC& iAppFileName);
+	void GetCaptionsL(TApaAppCaption& aCaption,TApaAppCaption& aShortCaption);
+private:	
+	RFs& iFs;
+	TFileName iCaptionFileName;
+	};
+
+class AppInfoFileUtils
+// Internal utilities providing helper functions for non-ROM localisation
+/**
+@internalComponent
+*/
+	{
+public: // For internal use only
+	IMPORT_C_NOT_NEEDED_FOR_JAVA_MIDLET_INSTALLER static void GetAifFileName(const RFs& aFs,TDes& aAifName);
+public:
+	static void GetAifFileNameL(const RFs& aFs,const TDesC& aFullName,TDes& aAifName);
+	};
+#endif // #if (defined(SYMBIAN_SUPPORT_UI_FRAMEWORKS_V1) || !defined(SYMBIAN_HIDE_UI_FRAMEWORKS_V1)) && !defined(SYMBIAN_REMOVE_UI_FRAMEWORKS_V1)
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/APGTASK.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,195 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __APGTASK_H__
+#define __APGTASK_H__
+
+#include <e32base.h>
+#include <w32std.h>
+
+class RWsSession;
+struct TKeyEvent;
+
+/** @internalTechnology */
+static const TInt KApaSystemEventsWithPowerMgmtCapabilityStart = 100;
+/** @internalTechnology */
+static const TInt KApaSystemEventsWithPowerMgmtCapabilityEnd = 199;
+
+/** Defines the event types that a TApaTask object can send to its window group.
+
+The events are sent by TApaTask::SendSystemEvent() and are handled by CEikAppUi::HandleSystemEventL().
+
+@publishedAll
+@released
+@see TApaTask::SendSystemEvent()
+@see CEikAppUi
+@see CCoeAppUi::HandleSystemEventL() */
+enum TApaSystemEvent
+	{
+	/** The task is being closed. */
+	EApaSystemEventShutdown=1,
+	/** Reserved for future use. */
+	EApaSystemEventBackupStarting,
+	/** Reserved for future use. */
+	EApaSystemEventBackupComplete,
+	/** The task is being brought to the foreground. */
+	EApaSystemEventBroughtToForeground,
+	/** Close any tasks including system tasks. 
+	Events in the range @c KApaSystemEventsWithPowerMgmtCapabilityStart to 
+	@c KApaSystemEventsWithPowerMgmtCapabilityEnd requires capability PowerMgmt*/
+	EApaSystemEventSecureShutdown = KApaSystemEventsWithPowerMgmtCapabilityStart
+	};
+
+#ifdef _UNICODE
+/**
+@publishedAll
+@released
+*/
+#define KUidApaMessageSwitchOpenFile KUidApaMessageSwitchOpenFile16
+
+/**
+@publishedAll
+@released
+*/
+#define KUidApaMessageSwitchCreateFile KUidApaMessageSwitchCreateFile16
+
+/**
+@publishedAll
+@released
+*/
+#define KUidApaMessageSwitchOpenFileValue KUidApaMessageSwitchOpenFileValue16
+
+/**
+@publishedAll
+@released
+*/
+#define KUidApaMessageSwitchCreateFileValue KUidApaMessageSwitchCreateFileValue16
+#else
+#define KUidApaMessageSwitchOpenFile KUidApaMessageSwitchOpenFile8
+#define KUidApaMessageSwitchCreateFile KUidApaMessageSwitchCreateFile8
+#define KUidApaMessageSwitchOpenFileValue KUidApaMessageSwitchOpenFileValue8
+#define KUidApaMessageSwitchCreateFileValue KUidApaMessageSwitchCreateFileValue8
+#endif
+
+/**
+@internalComponent
+*/
+const TInt KUidApaMessageSwitchOpenFileValue16=0x10003A39;
+
+/**
+@internalComponent
+*/
+const TUid KUidApaMessageSwitchOpenFile16={KUidApaMessageSwitchOpenFileValue16};
+
+/**
+@internalComponent
+*/
+const TInt KUidApaMessageSwitchCreateFileValue16=0x10003A3A;
+
+/**
+@internalComponent
+*/
+const TUid KUidApaMessageSwitchCreateFile16={KUidApaMessageSwitchCreateFileValue16};
+
+class TApaTask
+/** Application task.
+
+A task is a running application. At any one time, for any given application, 
+there may be zero, one, or more tasks running on a device.
+
+A task is identified by its association with the running application's window 
+group.
+
+An instance of the TApaTaskList class is used to find and access specific 
+tasks.
+
+@publishedAll
+@released
+@see TApaTaskList
+@see RWindowGroup
+@see RWsSession */
+	{
+public:
+
+	IMPORT_C TApaTask(RWsSession& aWsSession);
+	IMPORT_C void SetWgId(TInt aWgId);
+	IMPORT_C TInt WgId() const;
+	IMPORT_C TBool Exists() const;
+	IMPORT_C TThreadId ThreadId() const;
+	IMPORT_C void BringToForeground();
+	IMPORT_C void SendToBackground();
+	IMPORT_C void EndTask();
+	IMPORT_C void KillTask();
+	IMPORT_C void SendKey(TInt aKeyCode,TInt aModifiers);
+	IMPORT_C void SendKey(const TKeyEvent& aKey);
+	IMPORT_C void SendSystemEvent(TApaSystemEvent aEvent);
+	IMPORT_C TInt SwitchOpenFile(const TDesC& aFilename);
+	IMPORT_C TInt SwitchCreateFile(const TDesC& aFilename);
+	IMPORT_C TInt SendMessage(TUid aUid, const TDesC8& aParams);
+
+private:
+	TInt CheckSwitchFile() const;
+	void SendSystemEvent(TApaSystemEvent aEvent, TEventCode aType);
+private:
+	RWsSession& iWsSession;
+	TInt iWgId;
+	TInt iTApaTask_Reserved1;
+	};
+
+class TApaTaskList
+/** Accesses tasks running on a device.
+
+Tasks can be identified by document, application specific UID or by caption 
+name.
+
+Users of this class can also cycle through a set of tasks running a specific 
+application, bringing each one, in turn, into the foreground.
+
+@publishedAll
+@released
+@see TApaTask */
+	{
+public:	
+	/** Defines the direction in which tasks are cycled to the foreground. This is used 
+	by the CycleTasks() function.
+
+	@see TApaTaskList::CycleTasks() */
+	enum TCycleDirection
+		{
+		/** Cycles the task list forwards, i.e. the foreground task is moved to background, 
+		bringing the next foremost task to the foreground. */
+		EForwards,
+		/** Cycles the list backwards, i.e. the task furthest from the foreground is brought 
+		to the foreground, pushing what was the foremost task to the next ordinal 
+		position. */
+		EBackwards
+		};
+public:
+	IMPORT_C TApaTaskList(RWsSession& aWsSession);
+	IMPORT_C TApaTask FindApp(const TDesC& aAppName);
+	IMPORT_C TApaTask FindDoc(const TDesC& aDocName);
+	IMPORT_C TApaTask FindByPos(TInt aPos);
+	IMPORT_C TApaTask FindApp(TUid aAppUid);
+	IMPORT_C TInt CycleTasks(TUid aAppUid,TCycleDirection aDirection=EForwards);
+
+private:
+	void FindByPosL(TApaTask& aTask,TInt aPos);
+private:
+	RWsSession& iWsSession;
+	TInt iTApaTaskList_Reserved1;
+	};
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/APGWGNAM.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,106 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#if !defined(__APGWGNAM_H__)
+#define __APGWGNAM_H__
+
+#if !defined(__W32STD_H__)
+#include <w32std.h>
+#endif
+
+class CApaWindowGroupName : public CBase
+/** Gives access to the name of a window group and the information encoded by that 
+name.
+
+A window group is associated with a task, i.e. a running application. The 
+window group's name encodes four pieces of information for that task:
+
+the name of the document that the task is handling,
+
+the task's caption,
+
+the application specific UID, as eight hexadecimal characters,
+
+status information for the task, as two hexadecimal characters.
+
+@publishedAll
+@released */
+	{
+public:
+	enum { EMaxLength=13+2*KMaxFileName };
+public:
+	IMPORT_C ~CApaWindowGroupName();
+	IMPORT_C static CApaWindowGroupName* NewL(const RWsSession& aWsSession);
+	IMPORT_C static CApaWindowGroupName* NewLC(const RWsSession& aWsSession);
+	IMPORT_C static CApaWindowGroupName* NewL(const RWsSession& aWsSession, TInt aWgId);
+	IMPORT_C static CApaWindowGroupName* NewLC(const RWsSession& aWsSession, TInt aWgId);
+	IMPORT_C static CApaWindowGroupName* New(const RWsSession& aWsSession, HBufC* aWgName);
+	IMPORT_C static CApaWindowGroupName* NewL(const RWsSession& aWsSession, const TDesC& aWgName);
+	IMPORT_C static CApaWindowGroupName* NewLC(const RWsSession& aWsSession, const TDesC& aWgName);
+	IMPORT_C void ConstructFromWgIdL(TInt aWgId);
+	//
+	IMPORT_C void SetWindowGroupNameL(const TDesC& aWgName);
+	IMPORT_C void SetWindowGroupName(HBufC* aWgName);
+	//
+	IMPORT_C static void FindByAppUid(TUid aAppUid, RWsSession& aWsSession, TInt& aPrevWgId);
+	IMPORT_C static void FindByCaption(const TDesC& aCaption, RWsSession& aWsSession, TInt& aPrevWgId);
+	IMPORT_C static void FindByDocName(const TDesC& aDocName, RWsSession& aWsSession, TInt& aPrevWgId);
+	//
+	IMPORT_C void SetBusy(TBool aBusy);
+	IMPORT_C TBool IsBusy() const;
+	IMPORT_C void SetSystem(TBool aSystem);
+	IMPORT_C TBool IsSystem() const;
+	IMPORT_C void SetDocNameIsAFile(TBool aDocNameIsAFile);
+	IMPORT_C TBool DocNameIsAFile() const;
+	IMPORT_C void SetRespondsToShutdownEvent(TBool aRespondsToShutdownEvent);
+	IMPORT_C TBool RespondsToShutdownEvent() const;
+	IMPORT_C void SetRespondsToSwitchFilesEvent(TBool aRespondsToSwitchFilesEvent);
+	IMPORT_C TBool RespondsToSwitchFilesEvent() const;
+	IMPORT_C void SetHidden(TBool aIsHidden);
+	IMPORT_C TBool Hidden() const;
+	IMPORT_C void SetAppReady(TBool aIsReady);
+	IMPORT_C TBool IsAppReady() const;
+	//
+	IMPORT_C void SetAppUid(TUid aAppUid);
+	IMPORT_C TUid AppUid() const;
+	//
+	IMPORT_C void SetCaptionL(const TDesC& aCaption);
+	IMPORT_C TPtrC Caption() const;
+	//
+	IMPORT_C void SetDocNameL(const TDesC& aDocName);
+	IMPORT_C TPtrC DocName() const;
+	//
+	IMPORT_C TInt SetWindowGroupName(RWindowGroup& aGroupWin) const;
+	IMPORT_C TPtrC WindowGroupName() const;
+private: //enums
+	enum TApaStatus { ESystem =0x01, EBusy =0x02, EDocNameNotAFile =0x04
+					 ,EDoesNotRespondToShutdownEvent=0x08, EDoesNotRespondToSwitchFilesEvent=0x10
+					 ,EIsHidden=0x20, EAppReady=0x40 };
+	enum TApaDelimiter { EEndStatus=1, EEndUid, EEndCaption, ELast=EEndCaption }; // ELast must be last and same as predecessor
+private:
+	CApaWindowGroupName(const RWsSession& aWsSession);
+	//
+	void DefaultConstructL();
+	void WriteStatusToName();
+	void GetStatusFromName();
+	TInt FindDelimiter(TApaDelimiter aDelim) const;
+	void ReAllocIfNecessaryL(TInt aExtraLengthReqd);
+private:
+	HBufC* iBuf;
+	TUint iStatus;
+	const RWsSession& iWsSession;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/APPARC.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,608 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __APPARC_H__
+#define __APPARC_H__
+
+#if !defined(__E32STD_H__)
+#include <e32std.h>
+#endif
+#if !defined(__E32BASE_H__)
+#include <e32base.h>
+#endif
+#if !defined(__F32FILE_H__)
+#include <f32file.h>
+#endif
+#if !defined(__GDI_H__)
+#include <gdi.h>
+#endif
+#if !defined(__APADEF_H__)
+#include <apadef.h>
+#endif
+#if !defined(__APAID_H__)
+#include <apaid.h>
+#endif
+
+// classes defined:
+class CApaApplication;
+class CApaDocument;
+class CApaProcess;
+class MApaEmbeddedDocObserver;
+//
+// classes referenced:
+class CApaDll;
+class CApaExe;
+class RFile;
+class RReadStream;
+class RWriteStream;
+class CFileStore;
+class CPersistentStore;
+class CStreamDictionary;
+class CDictionaryStore;
+class TApaAppHolderInfo;
+class CImplementationInformation;
+class TApaApplicationFactory;
+class CApaAppHolder;
+class CApaAppServer;
+
+/** Creates an application interface object.
+
+Provides the basic roles of an application class as a factory that
+creates concrete document objects, and supplies utility functions 
+not specific to any particular instance of a document.
+
+@publishedAll
+@released
+*/
+typedef CApaApplication* (*CreateCApaApplication)();
+
+
+// CApaApplication
+
+class CApaApplication : public CBase
+// base class for applications; allows creation of documents & file stores + display of app icon and name.
+/** Defines the basic behaviour for applications.
+
+The class defines the basic twin roles of an application class as a factory 
+that creates concrete document objects, and as a supplier of utility functions 
+not specific to any particular instance of a document. For example, returning 
+an application's caption, or accessing its .ini file.
+
+The class is derived from by the UI framework and is further derived from 
+by the UI application.
+
+@publishedAll 
+@released 
+@see CEikApplication */
+	{
+public:
+	/** Completes construction of this application object.
+	
+	The function is called after an instance of a derived class has been successfully 
+	created using the ordinal 1 function of the application DLL.
+	
+	After calling this function, an application can create document objects.
+	
+	An implementation of this function is supplied by the UI framework.
+	
+	@see CEikApplication */
+	virtual void PreDocConstructL()=0; // call once before creating document
+	
+	/** Creates a document object.
+	
+	The function is called by the application process when a new document is required. 
+	The application process adds the new document to its list of documents.
+	
+	An implementation of this function is supplied by the UI framework.
+	
+	@param aProcess A pointer to the process associated with the application.
+	@return A pointer to the newly created document.
+	@see CApaProcess::AddNewDocumentL() */
+	virtual CApaDocument* CreateDocumentL(CApaProcess* aProcess)=0;
+	
+	/** Gets the application specific UID.
+	
+	The UID is used to differentiate between UI applications.
+	
+	An implementation of this function must be supplied by the UI application.
+	
+	@return The application specific UID. */
+	virtual TUid AppDllUid()const=0;
+	
+	//
+	// utility functions
+	IMPORT_C static TInt GenerateFileName(RFs& aFs,TFileName& aRootName);
+	IMPORT_C CDictionaryStore* OpenIniFileL(RFs& aFs)const;
+	
+	/** Opens the .ini file associated with the application, constructs the dictionary 
+	store object, returns a pointer to it and puts the pointer onto the cleanupstack.
+	
+	The .ini file must be created, if it does not already exist.
+	
+	An implementation of this function is supplied by the UI framework.
+	
+	@param aFs Handle to a file server session 
+	@return A pointer to the dictionary store object that represents the application's 
+	.ini file. 
+	@see CEikApplication */
+	virtual CDictionaryStore* OpenIniFileLC(RFs& aFs)const=0;
+	//
+	// enquiry functions
+	IMPORT_C virtual TFileName AppFullName()const; // returns the full path and name of the app
+	/** Returns the capabilities of the application.
+	
+	Application capability information is represented by an instance of a TApaAppCapability 
+	object wrapped in a packaged modifiable buffer descriptor.
+	
+	The function is called from a number of places within the application framework.
+	
+	An implementation of this function is supplied by the UI framework.
+	
+	@param aInfo A packaged modifiable buffer descriptor (a TPckgBuf), encapsulating 
+	a TApaAppCapability object. 
+	@see CEikApplication
+	@see TApaAppCapability
+	@see TPckgBuf */
+	virtual void Capability(TDes8& aInfo)const=0;
+	//
+	// accessor function
+	IMPORT_C TFileName DllName()const;
+	
+	IMPORT_C ~CApaApplication();
+
+	// formerly a reserved virtual, Reserved_1()
+	IMPORT_C virtual void NewAppServerL(CApaAppServer*& aAppServer);
+protected:
+	IMPORT_C CApaApplication();
+	
+	IMPORT_C virtual void CApaApplication_Reserved1();
+	IMPORT_C virtual void CApaApplication_Reserved2();
+
+private:
+	CApaAppHolder* iAppHolder;  // the CApaAppHolder that owns me
+	TUid iDtorKey;	//	TInt iSpare;
+	friend class CApaAppHolder;
+	friend class CApaProcess;
+	friend class TApaApplicationFactory; // so that it can access iDtorKey
+	
+private:
+	TInt iCApaApplication_Reserved1;
+	};
+
+class CApaDocument : public CBase
+// base class for documents; allows insertion of glass doors.
+/** Defines basic behaviour for documents.
+
+This is the base class for all documents. A document contains the data associated 
+with the application's content.
+
+The class is derived from by the UI framework and is further derived from 
+by the UI application.
+
+@publishedAll 
+@released
+@see CEikDocument */
+	{
+public:
+	class TCapability
+	/** CApaDocument capabilities.*/
+		{
+	public:
+		IMPORT_C TCapability();
+		//
+		inline TBool CanDrawGlass()const;
+		inline TBool CanPrint()const;
+		inline void SetCanDrawGlass();
+		inline void SetCanPrint();
+		//
+	private:
+		enum {
+			ECanDrawGlass	=0x01,
+			ECanPrint		=0x02
+			};
+	private:
+		TUint iCapability;
+		TInt TCapability_Reserved1;
+		};
+	//
+public:
+	// document instantiation functions
+	/** Initialises a new, empty, document with a default setup.
+	
+	This can be the main document or an embedded document. The function is called 
+	by the UI framework when it creates a default document file.
+	
+	An implementation of this function must be supplied by the UI application.
+	
+	If initialisation fails, the document must be left in the same state as it 
+	was before the function was called. */
+	virtual void NewDocumentL()=0; // builds a new embedded or main document without loading from a store (may create the content from eg code or a template file).
+	
+	/** Creates and fully initialises a new filestore and stores the document into it, 
+	replacing any existing file of the same name.
+	
+	The function should put the pointer to the filestore object onto the cleanup 
+	stack.
+	
+	An implementation of this function is supplied by the UI framework.
+	
+	@param aFs Handle to a file server session. 
+	@param aFileName The full path name of the file to be created. 
+	@return A pointer to the newly constructed file store. 
+	@see CEikDocument */
+	virtual CFileStore* CreateFileStoreLC(RFs& aFs,const TDesC& aFileName)=0; // creates a file for a document and stores itself to that store (store should be put on cleanup stack).
+	//
+	// interaction functions
+	IMPORT_C virtual CPicture* GlassPictureL(); // Does nothing by default, override to return handle to glass picture.
+	
+	/** Starts an editing session on an embedded document.
+	
+	The function should cause the application's UI to be created and the document 
+	to be fully restored for editing.
+	
+	An implementation of this function is supplied by the UI framework.
+	
+	@param aContainer This document's observer.
+	@param aReadOnly True, the document should be opened in read-only mode and 
+	should not persist any changes made to the content. False, the document can 
+	be opened in read/write mode; this is the default. 
+	@see CEikDocument */
+	virtual void EditL(MApaEmbeddedDocObserver* aContainer,TBool aReadOnly=EFalse)=0; // Edit the document in the context of the container's environment. If aContainer is null, edit as the main document
+	
+	/** Prints the document without a need for it to be open for editing.
+	
+	Typically, this is called from a shell or a file manager type application 
+	that wants to print the document without opening it fully.
+	
+	An empty implementation of this function is supplied by the UI framework.
+	
+	The UI application can provide its own implementation.
+	
+	@param aSourceStore A reference to the store containing the document. 
+	@see CEikDocument */
+	virtual void PrintL(const CStreamStore& aSourceStore)=0; // default print parameters, assume print context supplied by environment
+	//
+	// persistence functions
+
+	/** Stores the document to the current file, commits the changes, and marks the 
+	document status as unchanged.
+	
+	Typically, the function is called by the application when it implements a 
+	"Save" type menu option in its User Interface.
+	
+	An implementation of this function is supplied by the UI framework. This is 
+	adequate for direct file store applications. Applications using a permanent 
+	file store model, need to provide their own implementation.
+	
+	If the function leaves, an implementation should ensure that any changes made 
+	to the file are rolled back, leaving the file in the state it was in before 
+	the function was called.
+	
+	@see CEikDocument */
+	virtual void SaveL()=0; // save the doc to the file in the custody of iAppProcess. This fn should be called by any "Save" menu option. store->Commit() should be called within it.	
+	/** Stores the document's content and state to the specified store, recording the 
+	identity of any headstreams created in the specified stream dictionary.
+	
+	The store must be fully constructed before this function is called.
+	
+	An empty implementation of this function is supplied by the UI framework. 
+	UI applications that need to persist any data must provide their own implementation.
+	
+	If the function leaves, an implementation should ensure that the store and 
+	the stream dictionary are returned to the state they were in before the function 
+	was called.
+	
+	@param aStore The store into which document data is to be stored. 
+	@param aStreamDic The stream dictionary into which stream IDs and associated 
+	UIDs are to be recorded. 
+	@see CEikDocument */
+	virtual void StoreL(CStreamStore& aStore,CStreamDictionary& aStreamDic) const=0; // store to aStore, lodging the headstream in aStreamDic
+	
+	/** Restores the document's content and state from data persisted in the specified 
+	store.
+	
+	An empty implementation of this function is supplied by the UI framework. 
+	UI applications that need to restore data must provide their own implementation.
+	
+	If the function leaves, an implementation should ensure that the store and 
+	the stream dictionary are returned to the state they were in before the function 
+	was called.
+	
+	@param aStore The store from which document data is to be restored. 
+	@param aStreamDic The stream dictionary containing stream IDs and associated 
+	UIDs. 
+	@see CEikDocument */
+	virtual void RestoreL(const CStreamStore& aStore,const CStreamDictionary& aStreamDic)=0; // restore from aStore using aStreamDic
+	
+	/** Restores the document to the extent that it does not need the store
+	further.
+
+	A document only keeps a pointer to a store if it implements deferred
+	loading. This also tells the document that any store pointer that it
+	might have is just about to become invalid.
+	
+	An empty implementation of this function is supplied by the UI framework. 
+	UI applications that support deferred loading or embedding should provide an
+	implementation.
+	
+	If a document supports embedding, then it should
+	propagate the DetachFromStoreL() call on to all embedded objects that
+	it contains.
+	
+	If the function leaves, the operation should be aborted
+	because the document has not successfully detached from the store.
+	Continuing with the operation may leave the document in an unsafe
+	state or cause user data to be lost.
+
+	@param aDegree The degree of detachment required. */
+	virtual void DetachFromStoreL(CPicture::TDetach /*aDegree*/=CPicture::EDetachFull) {} // supply an implementation if you support deferred loading or embedding
+
+	IMPORT_C virtual void ExternalizeL(RWriteStream& aStream)const;
+	//
+	// enquiry functions
+	
+	/** Tests whether the document is empty.
+	
+	The UI framework provides a default implementation which always returns a 
+	true value.
+	
+	The UI application can provide its own implementation. Typically, any application 
+	that has editable content should supply an implementation that acts according 
+	to the state of that content. Applications without associated document data 
+	need not supply an implementation.
+	
+	@return True if the document is empty, false otherwise. 
+	@see CEikDocument */
+	virtual TBool IsEmpty()const=0; // return ETrue if the document is empty
+	IMPORT_C virtual void ValidatePasswordL()const; // return EFalse if there *is* a password *and* the user doesn't get it right, ETrue otherwise (ie they get it right or there isn't one). Returns ETrue by default
+	
+	IMPORT_C virtual TCapability Capability()const; // returns "cant do anything" by default
+	inline CApaApplication* Application()const;
+	inline CApaProcess* Process()const;
+	
+	/** Tests whether the document has changed since it was last persisted.
+	
+	An implementation of this function is supplied by the UI framework and need 
+	not be changed by the UI application.
+	
+	@return True, if the document has changed since the last time that it was 
+	persisted, false, otherwise.
+	@see CEikDocument */
+	virtual TBool HasChanged()const =0;
+	//
+	IMPORT_C virtual ~CApaDocument();
+protected:
+	IMPORT_C CApaDocument();
+	IMPORT_C CApaDocument(CApaApplication& aApp,CApaProcess& aProcess);
+private:
+	IMPORT_C virtual void OpenFileL(CFileStore*& aFileStore, RFile& aFile); // was previously Reserved_1
+	// Reserved virtual functions...
+	IMPORT_C virtual void Reserved_2();
+protected:
+	MApaEmbeddedDocObserver* iContainer; // null unless this is an embedded object currently being edited
+private:
+	CApaApplication* iApplication; // the doc's associated application
+	CApaProcess* iApaProcess;
+	TInt iSpare;
+	};
+
+
+
+class TApaApplicationFactory
+/** Encapsulates the functionality of creating an application, whether it be via a factory function
+or an ECOM plugin. Instances of this class can usually be created implicitly when required as
+function parameters - just specify the function pointer, ECOM plugin UID or CImplementationInformation
+reference.
+
+@publishedAll
+@released
+@see CApaProcess
+@see EikStart */
+	{
+public:
+	typedef CApaApplication* (*TFunction)();
+public:
+	IMPORT_C TApaApplicationFactory();
+	IMPORT_C TApaApplicationFactory(TFunction aFunction);
+	IMPORT_C TApaApplicationFactory(const CImplementationInformation& aEmbeddedApplicationInformation);
+	IMPORT_C TApaApplicationFactory(TUid aEmbeddedApplicationUid);
+	CApaApplication* CreateApplicationL() const;
+	HBufC* AppFileNameL() const;
+	TUid AppFileUid() const;
+private:
+	enum TType
+		{
+		ETypeFunction,							// if iType is this, iData is a TFunction
+		ETypeEmbeddedApplicationInformation,	// if iType is this, iData is an ECOM CImplementationInformation
+		ETypeEmbeddedApplicationUid				// if iType is this, iData is an ECOM implementation TUid
+		};
+private:
+	static CApaApplication* CreateEmbeddedApplicationL(TUid aUid);
+	static HBufC* EmbeddedApplicationDisplayNameLC(TUid aUid);
+	static HBufC* FullAppFileNameL(const TDesC& aAppName);
+	static void CleanupImplementationArray(TAny* aImplementationArray);
+private:
+	TType iType;
+	TUint iData;
+	mutable CApaApplication* iApplication; // used to be iSpare1
+	TInt iSpare2;
+	};
+
+class CApaParentProcessMonitor;
+
+class CApaProcess : public CBase
+/** Maintains a list of documents and all of the potentially shared resources used 
+by documents.
+
+This includes the application DLLs. The class also supplies utility functions 
+that provide the basic structure for persisted document files.
+
+The class deals with the loading of application DLLs and manages the creation 
+and destruction of application (CApaApplication) objects and document (CApaDocument) 
+objects.
+
+The class is derived from by the UI framework and further derivation by the 
+UI application is not necessary unless it needs to add extra utility functions 
+for the use of applications.
+
+@publishedAll
+@released
+@see CApaApplication
+@see CApaDocument */
+	{
+public:
+	IMPORT_C static CApaProcess* NewL(const RFs& aFs);
+	IMPORT_C void ResetL();
+	//
+	// static utility functions
+	IMPORT_C static CStreamDictionary* ReadRootStreamLC(RFs& aFs,CFileStore*& aStore,const TDesC& aDocFullFileName,TUint aFileMode); // opens aDocFileName as aStore and returns the stream dictionary contained in its root stream on the cleanup stack
+	IMPORT_C static CStreamDictionary* ReadRootStreamLC(CFileStore*& aStore, const RFile& aFile);
+	IMPORT_C static void WriteRootStreamL(CPersistentStore& aStore,CStreamDictionary& aStreamDic,const CApaApplication& aApp);
+	IMPORT_C static void WriteRootStreamL(CPersistentStore& aStore,CStreamDictionary& aStreamDic,const TApaAppIdentifier& aAppId);
+	IMPORT_C static TApaAppIdentifier ReadAppIdentifierL(const CStreamStore& aStore,const CStreamDictionary& aStreamDic);
+	IMPORT_C static void WriteAppIdentifierL(CStreamStore& aStore,CStreamDictionary& aStreamDic,const TApaAppIdentifier& aAppId);
+	//
+	// document management
+	IMPORT_C CApaDocument* AddNewDocumentL(TApaApplicationFactory aApplicationFactory);
+	IMPORT_C CApaDocument* OpenNewDocumentL(CFileStore*& aStore,CStreamDictionary*& aStreamDic,const TDesC& aDocFullFileName,TUint aFileMode); // Open a file and restore the contained document
+	IMPORT_C void DestroyDocument(CApaDocument* aDoc); // Removes a doc (identified by the object) from the list and destroys it. Also removes the app and closes the AppDll if appropriate.
+	//
+	// setter functions
+	IMPORT_C void SetMainDocument(CApaDocument* aDocument);
+	IMPORT_C void SetMainDocFileName(const TDesC& aMainDocFileName); // panics if the descriptor is too long
+	IMPORT_C void SetMainDocFileNameL(const TDesC& aMainDocFileName);
+	//
+	// accessor functions
+	IMPORT_C TPtrC MainDocFileName()const;
+	inline RFs& FsSession()const;
+	inline CApaDocument* MainDocument()const;
+	//
+	IMPORT_C ~CApaProcess();
+protected:
+	IMPORT_C CApaProcess();
+	IMPORT_C CApaProcess(const RFs& aFs);
+	IMPORT_C void ConstructL();
+	IMPORT_C void ConstructL(TProcessId aParentProcessId);
+
+	IMPORT_C virtual void CApaProcess_Reserved1();
+	IMPORT_C virtual void CApaProcess_Reserved2();
+public:
+	static TInt IdleRemoveApplications(TAny* aThis);
+	void RemoveMarkedApplications();
+private:
+	CApaDll* AddAppDllL(const TDesC& aDllFullPath);
+	CApaExe* AddAppExeL(TApaApplicationFactory aApplicationFactory);
+	void RemoveApp(CApaAppHolder* aAppHolder);
+	CApaDocument* CreateDocL(CApaApplication* aApp);
+	CApaAppHolder* FindAppInListL(const TDesC& aAppFileName,TUid aUid)const; // returns NULL if not in list
+	void DeleteAllDocs();
+	void MarkApplicationForRemoval(const CApaApplication* aApp);
+	static void DoReadRootStreamL(CStreamDictionary& aStreamDictionary, const CFileStore& aStore);
+private:
+	CArrayFixFlat<TApaAppHolderInfo>* iAppList; // array of apps in use
+	CArrayFixFlat<CApaDocument*>* iDocList; // array of documents (1 main + n embedded)
+	CApaDocument* iMainDoc;
+	HBufC* iMainDocFileName;
+	RFs iFsSession; // file server session for doc store
+	CIdle* iApplicationRemover;
+	CApaParentProcessMonitor* iMonitor;
+	TInt iCApaProcess_Reserved1;
+	};
+
+
+class MApaEmbeddedDocObserver
+/** An interface class for handling the completion of the editing of an embedded 
+document.
+
+@publishedAll 
+@released
+@see CApaDocument::EditL() */
+	{
+public:
+	/** Defines the state of the embedded document on completion of editing. */
+	enum TExitMode {
+		/** Changes to the embedded document must be saved. */
+		EKeepChanges,
+		/** Reverts back to the saved version of the embedded document, i.e. reloads the 
+		whole document. */
+		ERevertToSaved,
+		/** No changes have been made to the embedded document. */
+		ENoChanges,
+		/** The embedded document is empty. */
+		EEmpty
+		};
+public:
+	/** Implements the required behaviour when the editing of an embedded document completes.
+	
+	@param aMode Indicates the state of the document. */
+	virtual void NotifyExit(TExitMode aMode)=0; // called on completion of editing of an embedded document
+protected:
+	IMPORT_C MApaEmbeddedDocObserver();
+private:
+	IMPORT_C virtual void MApaEmbeddedDocObserver_Reserved1();
+	IMPORT_C virtual void MApaEmbeddedDocObserver_Reserved2();
+private:
+	TInt iMApaEmbeddedDocObserver_Reserved1;
+	};
+
+
+//// inlines ////
+inline CApaApplication* CApaDocument::Application()const
+/** Returns a pointer to the application that created the document.
+
+@return A pointer to the document's associated application. */
+	{ return iApplication; }
+
+inline CApaProcess* CApaDocument::Process()const
+/** Returns a pointer to the application process associated with this document.
+
+@return A pointer to the application process associated with this document. */
+	{ return iApaProcess; }
+
+inline TBool CApaDocument::TCapability::CanDrawGlass()const
+/** Tests whether the document supports being embedded as a glass door.
+
+@return True if embedding as a glass door is supported; false otherwise. */
+	{ return iCapability&ECanDrawGlass; }
+
+inline TBool CApaDocument::TCapability::CanPrint()const
+/** Tests whether the document supports being printed without using the full application 
+UI.
+
+@return True, if printing is supported; false, otherwise. */
+	{ return iCapability&ECanPrint; }
+
+inline void CApaDocument::TCapability::SetCanDrawGlass()
+/** Sets the document as being capable of being embedded as a glass door. */
+	{ iCapability = iCapability|ECanDrawGlass; }
+
+inline void CApaDocument::TCapability::SetCanPrint()
+/** Sets the document as being capable of being printed without using the full application 
+UI. */
+	{ iCapability = iCapability|ECanPrint; }
+
+inline RFs& CApaProcess::FsSession()const
+/** Returns a handle to the file server session used by this application process.
+
+@return The file server session. */
+	{ return (RFs&)iFsSession; } //lint !e1536 Exposing low access member - Kept for backward BC
+
+inline CApaDocument* CApaProcess::MainDocument()const
+/** Returns a pointer to the main document.
+
+@return A pointer to the main document. */
+	{ return iMainDoc; }
+	
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/APRuleBased.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,66 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file
+// 
+//
+
+#if !defined(__APRULEBASED_H__)
+#define __APRULEBASED_H__
+
+#if !defined(__APADEF_H__)
+#include <apadef.h>
+#endif
+
+#if !defined(__F32FILE_H__)
+#include <f32file.h>
+#endif
+
+/**
+@publishedPartner
+@released
+Uid for access to all implementations of rule-based interface
+*/
+const TUid KUidRuleBasedInterfaceUid = { 0x1020d466 };
+
+class CApaRuleBasedDll;
+class CAppLaunchChecker;
+
+class CApaRuleBasedDll;
+/**
+@publishedPartner
+@released
+Rule-based framework.
+Loads all rule-based plug-ins available in the system and interrogates them 
+whether or not an activated application should be launched
+*/
+class CApaScanningRuleBasedPlugIns : public CBase
+	{
+public:	
+	IMPORT_C static CApaScanningRuleBasedPlugIns* NewL();
+	IMPORT_C ~CApaScanningRuleBasedPlugIns();
+	IMPORT_C CAppLaunchChecker* operator[](TInt aIndex) const;
+	IMPORT_C void ScanForRuleBasedPlugInsL();
+	IMPORT_C TInt ImplementationCount() const; 
+private:
+	CApaScanningRuleBasedPlugIns()
+		{
+		}
+	void LoadEcomRuleBasedPlugInL(TUid aUid);
+	HBufC* ImplementationDisplayNameL(TUid aImplUID) const;
+	TInt RemovePlugIn(CApaRuleBasedDll* aDll);
+private:
+	RPointerArray<CApaRuleBasedDll> iRuleBasedLib; //all rule-based plug-ins available in the system
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/APSSCAN.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,114 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// AppArc recognizer and application scanning
+// 
+//
+
+#if !defined(__APSSCAN_H__)
+#define __APSSCAN_H__
+
+#if !defined(__F32FILE_H__)
+#include <f32file.h>
+#endif
+
+class MApaFsChangeObserver
+/** An interface for notifying a file system observer when
+a change has been made to the file system.
+This interface is intended for use only by CApaFsMonitor.
+
+@internalComponent
+*/
+	{
+public:
+	virtual void FsChanged()=0;
+	};
+
+class CApaFsMonitor : public CBase, MApaFsChangeObserver
+/** Monitors changes in the file system.
+
+If a change is detected, the callback function supplied by the user of the class 
+is called after a 0.25 second delay. If there are further changes, the callback 
+is not called again until 3 seconds have elapsed. It uses RFs::NotifyChange() 
+to request notifications.
+
+@see RFs::NotifyChange()
+
+@publishedPartner 
+@released */
+	{
+public:
+	IMPORT_C ~CApaFsMonitor();
+	IMPORT_C static CApaFsMonitor* NewL(RFs& aFs, const TDesC& aLocation, TCallBack aCallBack);
+	IMPORT_C void SetBlocked(TBool aIsBlocked);
+	IMPORT_C void Start(TNotifyType aNotifyType);
+	IMPORT_C TNotifyType NotifyType() const;
+	IMPORT_C void AddLocationL(const TDesC& aLocation);
+	IMPORT_C void Cancel();
+	TBool AnyNotificationImpending() const;
+private:
+
+	CApaFsMonitor(RFs& aFs, TCallBack aCallBack);
+	static TInt TimerCallBack(TAny* aObject);
+	void DoStart();
+
+	// from MApaFsChangeObserver
+	void FsChanged();
+	class CApaFsNotifier;
+private:
+	RFs& iFs;
+	TNotifyType iNotifyType;
+	TCallBack iCallBack;
+	CPeriodic* iFsTimer;
+	TBool iFsHasChanged;
+	TBool iIsBlocked;
+	RPointerArray<CApaFsNotifier> iNotifiers;
+	};
+
+#if !defined(__WINC__)
+class REComSession;
+/** 
+CApaEComMonitor
+
+A low priority (EPriorityIdle) active object which monitors changes 
+in the Ecom plugin.
+
+@see REComSession::NotifyOnChange()
+
+@internalAll 
+*/ 
+
+class CApaEComMonitor : public CActive
+	{
+public:
+	 ~CApaEComMonitor();
+	 static CApaEComMonitor* NewL(TCallBack aCallBack);
+	 void Start();
+private:
+	CApaEComMonitor(TCallBack aCallBack);
+	void ConstructL ();
+	static TInt TimerCallBack(TAny* aObject);
+	void DoStart();
+	void DoCancel();
+	void RunL();
+private:
+	TCallBack iCallBack;
+	CPeriodic* iEComTimer;
+	REComSession* iEComSession;
+	TBool iEComHasChanged;
+	};
+
+#endif
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/APSSERV.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,282 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#if !defined(__APSSERV_H__)
+#define __APSSERV_H__
+
+#if !defined(__E32BASE_H__)
+#include <e32base.h>
+#endif
+#if !defined(__F32FILE_H__)
+#include <f32file.h>
+#endif
+#if !defined(__APMFNDR_H__)
+#include <apmfndr.h>
+#endif
+#if !defined(__APRULEBASED_H__)
+#include <aprulebased.h>
+#endif
+#if !defined(__W32STD_H__)
+#include <w32std.h>
+#endif
+
+
+#include <apgaplst.h>
+
+// classes defined
+class CApaAppListServer;
+class CCustomAppInfoData;
+//
+// classes referenced
+class CApaCommandLine;
+class CApaAppList;
+class CApaAppData;
+class CApaFileRecognizer;
+class CApaAppRegFinder;
+class CApaScanningFileRecognizer;
+class CApaFsMonitor;
+class CTypeStoreManager;
+class MApaAppStarter;
+class CApaEComMonitor;
+class CBaBackupSessionWrapper;
+class CApsRecognitionCache;
+class CRecognitionResult;
+class CApaAppUnInstallMonitor;
+class CApaIconCaptionOverrides;
+class CApaIconCaptionCenrepObserver;
+//
+
+// server name
+
+/**
+KAppListServerName 
+@internalAll
+*/
+_LIT(KAppListServerName,"!AppListServer");
+
+class CApaAppListServer : public CPolicyServer, public MApaAppListObserver, public MBackupOperationObserver
+/**
+CApaAppListServer 
+@internalAll 
+*/
+	{
+public:
+	inline static CApaAppListServer* NewL(MApaAppStarter& aAppStarter) {return NewL(&aAppStarter);}
+	IMPORT_C static CApaAppListServer* NewL(MApaAppStarter* aAppStarter);
+	IMPORT_C static CApaAppListServer* Self();
+	inline CApaAppList& AppList();
+	CApaFileRecognizer* FileRecognizer();
+	inline CApaDataRecognizer* DataRecognizer();
+	inline CApaCommandLine* AppCmdLine();
+	inline void SetAppCmdLine(CApaCommandLine* aAppCmdLine);
+	inline CApaScanningRuleBasedPlugIns* RuleBasedPlugIns();
+	inline RWsSession& WsSession();
+	void RegisterNonNativeApplicationTypeL(TUid aApplicationType, const TDesC& aNativeExecutable);
+	void DeregisterNonNativeApplicationTypeL(TUid aApplicationType);
+	TPtrC NativeExecutableL(TUid aNonNativeApplicationType) const;
+	inline const CApaFsMonitor& AppFsMonitor() const {return *iAppFsMonitor;}
+	void UpdateApps();
+	IMPORT_C TCallBack RescanCallBack();
+	CRecognitionResult* RecognizeDataAsCRecognitionResultL(RFile& aFile, TInt aPreferredBufSize);
+	TDataRecognitionResult RecognizeDataL(const TDesC& aName, const TDesC8& aBuffer);
+	TDataRecognitionResult RecognizeDataL(RFile& aFile, TInt aPreferredBufSize);
+	TBool RecognizeDataL(const TDesC& aName, const TDesC8& aBuffer, const TDataType& aDataType);
+	TBool RecognizeDataL(RFile& aFile, TInt aPreferredBufSize, const TDataType& aDataType);
+	TInt DataRecognizerPreferredBufSizeL();
+	void DataTypeL(CDataTypeArray& aArray);
+
+	
+	void GetAppByDataType(const TDataType& aDataType, TUid& aUid) const;
+	void GetAppByDataType(const TDataType& aDataType, TUid aServiceUid, TUid& aUid) const;
+	TBool InsertAndStoreIfHigherL(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid);
+	void InsertAndStoreDataMappingL(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid, TUid aServiceUid);
+	void DeleteAndStoreDataMappingL(const TDataType& aDataType, TUid aServiceUid);
+
+    IMPORT_C void HandleStartUninstallEvent();
+	IMPORT_C void HandleEndUninstallEventL();
+#ifdef _DEBUG
+	void FlushRecognitionCache();
+	void SetLoadRecognizersOnDemandL(TBool aLoadRecognizersOnDemand);
+	void PerformOutstandingRecognizerUnloading();
+#endif //_DEBUG
+public: // from MApaAppListObserver
+	void NotifyUpdate(TInt aReason);
+	void InitialListPopulationComplete();
+    // from MBackupOperationObserver
+	void HandleBackupOperationEventL(const TBackupOperationAttributes& aBackupOperationAttributes);
+	//
+	IMPORT_C ~CApaAppListServer();
+	TBool NonNativeRecovery() const;
+	void SetNonNativeRecovery(TBool aValue);
+	void AddCustomAppInfoInListL(CCustomAppInfoData* aCustomAppInfo);
+	TBool LoadMbmIconsOnDemand() const;
+	void UpdateAppListByShortCaptionL();
+private:
+	CApaAppListServer(TInt aPriority);
+	void ConstructL(MApaAppStarter* aAppStarter);
+	virtual CSession2* NewSessionL(const TVersion& aVersion,const RMessage2& aMessage) const;
+	static TInt AppFsNotifyWithForcedRegistrationsResetCallBack(TAny* aPtr);
+	static TInt AppFsNotifyCallBack(TAny* aPtr);
+	static TInt PlugInNotifyCallBack(TAny* aPtr);
+	static TInt TypeStoreNotifyCallback(TAny* aPtr);
+	void UpdatePlugIns();
+	void UpdateTypeStore();
+	void DoUpdateTypeStoreL();
+	void InternalizeNonNativeApplicationTypeArrayL();
+	void ExternalizeNonNativeApplicationTypeArrayL(TInt aIndexToIgnore=-1) const;
+	static void DeleteLastNonNativeApplicationType(TAny* aThis);
+	void NotifyScanComplete();
+	void DeleteCustomAppInfoList();
+	void UpdateAppListByIconCaptionOverridesL();
+	void LoadRecognizersLC();
+	void LoadRecognizersL();
+	static void RecognizerCleanup(TAny* aAny);
+	TInt UnloadRecognizers();
+	static TInt DoUnloadRecognizersCallback(TAny* aAny);
+	TInt DoUnloadRecognizers();
+	TBool CachedRecognitionResult(const TParseBase& aParser, TDataRecognitionResult& aResult) const;
+	CRecognitionResult* CachedRecognitionResult(const RFile& aFile, const TParseBase& aParser) const;
+	void CacheRecognitionResultL(const TParseBase& aParser, const TDataRecognitionResult& aResult);
+	void CacheRecognitionResultL(const RFile& aFile, const TParseBase& aParser, const TDataRecognitionResult& aResult);
+	void ConstructPathsToMonitorL();
+private:
+	enum
+		{
+		EOwnsFileRecognizer=0x01,
+		EOwnsAppList=0x02
+		};
+	struct SNonNativeApplicationType
+		{
+		TUid iTypeUid;
+		HBufC* iNativeExecutable;
+		};
+private:
+	RFs iFs;
+	TInt iRecognizerUsageCount;
+	CApaAppList* iAppList;
+	CApaScanningFileRecognizer* iScanningFileRecognizer;
+	CPeriodic* iRecognizerUnloadTimer;
+	CApaScanningDataRecognizer* iDataRecognizer;
+	CApaFsMonitor* iAppFsMonitor;
+	CApaFsMonitor* iTypeStoreMonitor;
+	CTypeStoreManager* iTypeStoreManager;
+	TTime iTypeStoreModified;
+	CBaBackupSessionWrapper* iBaBackupSessionWrapper;
+	CApaEComMonitor* iRecEcomMonitor;
+	CApaCommandLine* iAppCmdLine;
+	CApsRecognitionCache* iRecognitionCache;
+	CApaScanningRuleBasedPlugIns* iRuleBasedPlugIns;
+	RWsSession iWsSession;
+	RArray<SNonNativeApplicationType> iNonNativeApplicationTypeArray;
+	/**
+	This is ETrue if there was a power failure during the non-native applications list
+	update. It means that there is a list fo updated apps that needs to be rolled back.
+	*/
+	TBool iNonNativeRecovery;
+	RPointerArray<CCustomAppInfoData> iCustomAppList;
+	TBool iLoadRecognizersOnDemand;
+	CApaAppUnInstallMonitor* iAppUnInstallMonitor;
+	TBool iLoadMbmIconsOnDemand;
+	RBuf iNonNativeApplicationTypeRegistry;
+	CApaIconCaptionOverrides* iIconCaptionOverrides;
+	CApaIconCaptionCenrepObserver* iIconCaptionObserver;
+	};
+
+/**
+The CCustomAppInfoData class encapsulate the attributes of customised application information
+which will be used to modify short caption dynamically.
+
+@internalComponent
+*/
+class CCustomAppInfoData: public CBase
+	{
+public:
+	static CCustomAppInfoData* NewL(TUid aAppUid, TLanguage aLanguage, const TDesC& aShortCaption);
+	~CCustomAppInfoData();
+	inline TUid Uid() const;
+	inline TLanguage Language() const;
+	inline HBufC* ShortCaption() const;
+private:
+	CCustomAppInfoData(TUid aAppUid, TLanguage aLanguage);
+	void ConstructL(const TDesC& aShortCaption);
+private:
+	TUid iUid;
+	TLanguage iLanguage;
+	HBufC* iShortCaption;
+	};
+
+class TApaAppViewIconSizeData
+/**
+The TApaAppViewIconSizeData class encapsulates the attributes that specify how to identify an icon for a particular
+application and view in a certain size.
+
+@internalComponent
+*/
+	{
+public:
+	inline TApaAppViewIconSizeData();
+	inline TApaAppViewIconSizeData(TUid aAppUid,TUid aViewUid, const TSize& aSize);
+public:
+	TUid iAppUid;
+	TUid iViewUid;
+	TSize iSize;
+	};
+
+typedef TPckgBuf<TApaAppViewIconSizeData> TApaAppViewIconSizeDataBuf;
+
+//
+// inlines
+//
+
+inline TApaAppViewIconSizeData::TApaAppViewIconSizeData()
+	: iAppUid(KNullUid), iViewUid(KNullUid), iSize(TSize(0,0))
+	{}
+
+inline TApaAppViewIconSizeData::TApaAppViewIconSizeData(TUid aAppUid,TUid aViewUid, const TSize& aSize)
+	: iAppUid(aAppUid), iViewUid(aViewUid), iSize(aSize)
+	{}
+
+inline CApaAppList& CApaAppListServer::AppList()
+	{ return *iAppList; }
+
+inline CApaDataRecognizer* CApaAppListServer::DataRecognizer()
+	{ return iDataRecognizer; }
+
+/**
+@internalComponent */
+inline CApaCommandLine* CApaAppListServer::AppCmdLine()
+	{ return iAppCmdLine;}
+
+/**
+@internalComponent */	
+inline void CApaAppListServer::SetAppCmdLine(CApaCommandLine* aAppCmdLine)
+	{ iAppCmdLine=aAppCmdLine; }
+
+inline CApaScanningRuleBasedPlugIns* CApaAppListServer::RuleBasedPlugIns()
+	{ return iRuleBasedPlugIns; }
+
+inline RWsSession& CApaAppListServer::WsSession()
+		{ return iWsSession; } //lint !e1536 Exposing low access member
+
+inline TUid CCustomAppInfoData::Uid() const
+	{ return iUid; }
+	
+inline TLanguage CCustomAppInfoData::Language() const
+	{ return iLanguage; }
+	
+inline HBufC* CCustomAppInfoData::ShortCaption() const
+	{ return iShortCaption; }
+	
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/ApLaunchChecker.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,84 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file
+// 
+//
+
+#ifndef __APLAUNCHCHECKER_H__
+#define __APLAUNCHCHECKER_H__
+
+#ifndef __E32BASE_H__
+#include <e32base.h>
+#endif
+
+#ifndef __E32CMN_H__
+#include <e32cmn.h>
+#endif
+
+#ifndef __APGTASK_H__
+#include <apgtask.h>
+#endif
+
+#ifndef __ECOMRESOLVERPARAMS_H__
+#include <ecom/ecomresolverparams.h>
+#endif
+
+#ifndef __ECOM_H__
+#include <ecom/ecom.h>
+#endif
+
+class CAppLaunchChecker : public CBase
+/** Launch checker.
+
+This is an interface for rule-based launching of an application.
+
+An instance of the CAppLaunchChecker class is used to notify an application server whether or not
+an application should be launched. Inside the plug-in could be implemented some addition actions, 
+for instance closing some low priority applications.
+
+@publishedPartner
+@prototype
+@see TApaTaskList
+@see TUid */
+	{
+public:
+	/** Defines codes for launching an application */
+	enum TAppLaunchCode
+		{
+		/** Plug-in doesn't care whether an application should be launched or not */
+		EAppLaunchIndifferent,
+		/** Rule-based framework shouldn't launch an application */
+		EAppLaunchDecline,
+		/** Rule-based framework can launch an application */
+		EAppLaunchAccept,
+		};
+// Wraps ECom object instantiation
+	static CAppLaunchChecker* NewL(const TUid aUid);
+	IMPORT_C ~CAppLaunchChecker();
+	/** The function to be implemented in inherited classes. */	
+	TAppLaunchCode virtual OkayToLaunchL(const TUid aAppToLaunch, TApaTaskList& aTaskList) = 0;
+private:	
+	IMPORT_C virtual void Reserved_1();
+	IMPORT_C virtual void Reserved_2();
+	IMPORT_C virtual void Reserved_3();
+private:
+	/** ECOM identifier */
+    TUid iDtor_ID_Key;
+
+	TInt iReserved1;    
+	TInt iReserved2;    
+	TInt iReserved3;
+	};
+	
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/ApSidChecker.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,80 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __APSIDCHECKER_H__
+#define __APSIDCHECKER_H__
+
+#include <e32base.h>
+#include <e32hashtab.h>
+class TDriveUnit;
+
+class CAppSidChecker : public CBase
+/** Sid checker.
+
+This is a plugin interface for checking whether a Sid should be
+included in apparc server's list of registered applications.
+
+
+An instance of the CAppSidChecker is used to verify that an application
+may be included in application list.
+There should be one implementation of this
+interface for each application type (native, java midlet, ...)
+
+
+@internalAll */
+	{
+public:
+	// Wraps ECom object instantiation
+	static CAppSidChecker* CheckerForAppType(const TUid &aAppTypeUid);
+	IMPORT_C virtual ~CAppSidChecker();
+
+public:
+	IMPORT_C virtual TBool AppRegisteredAt(const TUid& aSid, TDriveUnit aDrive) = 0;
+	IMPORT_C virtual void SetRescanCallBackL(const TCallBack &aCallback);
+
+private:
+	IMPORT_C virtual void reserved1();
+	IMPORT_C virtual void reserved2();
+	IMPORT_C virtual void reserved3();
+
+private:
+	/** ECOM identifier */
+	TUid iDtor_ID_Key;
+
+	TAny* iReserved1;
+	TAny* iReserved2;
+	TAny* iReserved3;
+	};
+
+NONSHARABLE_CLASS(RSidCheckerMap) : public RHashMap<TUint,CAppSidChecker*>
+/** Sid checker map
+
+This Maps application type uids to Instances of the CAppSidChecker interface,
+loading them if neccessary.
+
+@internalComponent */
+	{
+public:	
+	RSidCheckerMap( TCallBack aRescanCallBack );
+	
+	CAppSidChecker& FindSidCheckerL(TUid aAppType);
+	void Close(); //lint !e1511 Member hides non-virtual member
+
+private:
+	TCallBack iRescanCallBack;
+	};
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/ApaServerApp.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,262 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef APASERVERAPP_H
+#define APASERVERAPP_H
+
+#include <e32base.h>
+
+
+//
+// Server application client support
+//
+
+
+
+class RApaAppServiceBase : public RSessionBase
+/** Server app connection and lifetime monitoring functionality.
+
+This is the base class for all server application service client
+support implementations.
+
+The class is derived from by the UI framework and is further derived from 
+by service implementations.
+
+Clients of these server application services will use these derived classes as
+the interface to the server application implementations of the services.
+
+@publishedPartner
+@released
+@see REikAppServiceBase */
+	{
+public:
+
+	/** Constants defining the base IPC command ids usable by the system GUI and services. */
+	enum TApaAppServiceBaseCmdConstants
+		{
+		/** System GUI server app command IDs must start from this base. */
+		KSystemGuiCmdBase = 0x100,
+		/** Service specific command IDs must start from this base. */
+		KServiceCmdBase = 0x200
+		};
+
+public:
+	IMPORT_C void ConnectExistingAppL(const RApaAppServiceBase& aClient);
+	IMPORT_C void ConnectExistingAppL(const RApaAppServiceBase& aClient, const TSecurityPolicy& aSecurityPolicy);
+	IMPORT_C void ConnectExistingByNameL(const TDesC& aName);
+	IMPORT_C void ConnectExistingByNameL(const TDesC& aServerName, const TSecurityPolicy& aSecurityPolicy);
+	IMPORT_C void TransferExistingSessionL(RApaAppServiceBase& aClient);
+	IMPORT_C void Close(); //lint !e1511 Member hides non-virtual member
+
+	IMPORT_C void NotifyServerExit(TRequestStatus& aStatus) const;
+	IMPORT_C void CancelNotifyServerExit() const;
+	
+	IMPORT_C TPtrC ServerName() const;
+
+protected:
+	IMPORT_C RApaAppServiceBase();
+
+private:
+	IMPORT_C virtual void RApaAppServiceBase_Reserved1();
+	IMPORT_C virtual void RApaAppServiceBase_Reserved2();
+	
+	/** Returns the UID of the service that this session provides an interface for.
+	Client side service implementations must implement this function to return
+	the UID for the service that they implement.
+	@return The UID of the service implemented by the derived class.*/
+	virtual TUid ServiceUid() const = 0;
+
+private:
+	void ConnectL();
+	void ConnectL(const TSecurityPolicy& aSecurityPolicy);
+
+private:
+	IMPORT_C virtual void ExtensionInterface(TUid aInterfaceId, TAny*& aImplementaion);
+	
+private:
+	HBufC* iServerName;		// owned
+	TInt iApaReserved1;
+	TInt iApaReserved2;
+	};
+
+
+class MApaServerAppExitObserver
+/** Interface for a class that wants to receive exit notification from
+a server application.
+
+@publishedPartner
+@released
+@see CApaServerAppExitMonitor*/
+	{
+public:
+	/** Receives server exit notification.
+	Implementers of this interface must override this function to
+	receive notification of server app exit reasons.
+	@param aReason The reason that the server app exited, this may be
+	a command ID from the UI if exit was triggered from the UI, or an error code
+	if the server app exited unexpectedly. */
+	virtual void HandleServerAppExit(TInt aReason) = 0;
+protected:
+	IMPORT_C MApaServerAppExitObserver();
+private:
+	IMPORT_C virtual void MApaServerAppExitObserver_Reserved1();
+	IMPORT_C virtual void MApaServerAppExitObserver_Reserved2();
+private:
+	TInt iMApaServerAppExitObserver_Reserved1;
+	};
+
+
+class CApaServerAppExitMonitor : public CActive
+/** Helper class that monitors the lifetime of a server app
+through a connected RApaAppServiceBase and reports server app exits
+to a MApaServerAppExitObserver derived class.
+
+@publishedPartner
+@released
+@see RApaAppServiceBase
+@see MApaServerAppExitObserver */
+	{
+public:
+	IMPORT_C static CApaServerAppExitMonitor* NewL(RApaAppServiceBase& aClient, MApaServerAppExitObserver& aObserver, TInt aPriority);
+	IMPORT_C static CApaServerAppExitMonitor* NewLC(RApaAppServiceBase& aClient, MApaServerAppExitObserver& aObserver, TInt aPriority);
+	IMPORT_C ~CApaServerAppExitMonitor();
+
+private:
+	CApaServerAppExitMonitor(RApaAppServiceBase& aClient, MApaServerAppExitObserver& aObserver, TInt aPriority);
+
+private:	// from CActive
+	void RunL();
+	void DoCancel();
+	TInt RunError(TInt aError);
+
+private:
+	RApaAppServiceBase& iClient;
+	MApaServerAppExitObserver& iObserver;
+	};
+
+	
+//
+// Server application server support
+//
+
+/** Panic codes that the server application framework can generate.
+@internalComponent */
+enum TApaAppServerPanic
+	{
+	/** The IPC message ID used by the client is not recognised. */
+	EApaAppServerPanicIllegalFunction,
+	/** The client already has an active notification of server exit. */
+	EApaAppServerPanicNotifyExitActive,
+	/** The client has tried to connect an already connected session. */
+	EApaAppServerPanicClientAlreadyConnected
+	};
+
+
+class CApaAppServiceBase : public CSession2
+/** Base class for all service implementations.
+Provides the basic IPC and security framework that server applications
+can use to receive messages from their clients.
+In a typical service implementation, a service support class
+will be derived from this class, and the service implementation
+will then be derived from the service support class.
+
+Instances of this class are created by the server application
+in its override of CApaAppServer::CreateServiceL().
+
+@publishedPartner 
+@released
+@see CApaAppServer
+@see CPolicyServer */
+	{
+public:
+	IMPORT_C CApaAppServiceBase();
+	IMPORT_C ~CApaAppServiceBase();
+
+	IMPORT_C virtual CPolicyServer::TCustomResult SecurityCheckL(const RMessage2& aMsg, TInt& aAction, TSecurityInfo& aMissing);
+
+public: // internal
+	void SendAppServerExitNotification(TInt aExitReason);
+
+protected: // from CSession2
+	IMPORT_C void CreateL();
+	IMPORT_C void ServiceL(const RMessage2& aMessage);
+	IMPORT_C void ServiceError(const RMessage2& aMessage,TInt aError);
+	IMPORT_C virtual TInt CountResources();
+	IMPORT_C virtual void Disconnect(const RMessage2& aMessage);
+
+private: // Server exit notification handlers
+	void NotifyServerExit(const RMessage2& aMessage);
+	void CancelNotifyServerExit(const RMessage2& aMessage) const;
+
+private:
+	IMPORT_C virtual void ExtensionInterface(TUid aInterfaceId, TAny*& aImplementaion);
+	IMPORT_C virtual void CApaAppServiceBase_Reserved1();
+	IMPORT_C virtual void CApaAppServiceBase_Reserved2();
+	
+private:
+	RMessagePtr2 iNotifyExitMsg;
+	TInt iExitReason;
+	TInt iApaReserved2;
+	};
+
+class CApaAppServer : public CPolicyServer
+/** Base class for all server application's servers.
+Server applications must derive from this class to implement their
+servers. These must be instantiated in an override of
+CApaApplication::NewAppServerL().
+The main task of this class is to create service implementations
+that clients of a server app may connect to.
+
+@publishedPartner 
+@released
+@see CEikAppServer
+@see CPolicyServer */
+	{
+public:
+	IMPORT_C ~CApaAppServer();
+	IMPORT_C virtual void ConstructL(const TDesC& aFixedServerName);
+	
+	IMPORT_C void NotifyServerExit(TInt aReason);
+	
+	IMPORT_C virtual CApaAppServiceBase* CreateServiceL(TUid aServiceType) const;
+	IMPORT_C virtual TCustomResult CreateServiceSecurityCheckL(TUid aServiceType, const RMessage2& aMsg, TInt& aAction, TSecurityInfo& aMissing);
+
+protected:
+	IMPORT_C CApaAppServer();
+	
+	// From CPolicyServer
+	IMPORT_C TCustomResult CustomSecurityCheckL(const RMessage2& aMsg, TInt& aAction, TSecurityInfo& aMissing);
+	// From CServer2
+	IMPORT_C virtual void DoConnect(const RMessage2& aMessage);
+	
+private:
+	IMPORT_C CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const;
+	
+private:
+	TUid ConnectMessageServiceUid(const RMessage2& aMsg) const;
+	
+private:
+	IMPORT_C virtual void ExtensionInterface(TUid aInterfaceId, TAny*& aImplementaion);
+	// Extensions
+	IMPORT_C virtual void CApaAppServer_Reserved1();
+	IMPORT_C virtual void CApaAppServer_Reserved2();
+	
+private:
+	TInt iApaReserved1;
+	TInt iApaReserved2;
+	};
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/Apcaptionfile.rh	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,35 @@
+// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Contains definitions for the resource files that are input to 
+// caption files for Series 60
+// 
+//
+
+
+
+
+/**
+ @internalComponent
+*/
+#define KMaxCaption 256
+
+/**
+@publishedAll
+@released
+*/
+STRUCT CAPTION_DATA
+	{
+	LTEXT caption(KMaxCaption)="";
+	LTEXT shortcaption(KMaxCaption)="";
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/AppInfo.rh	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,231 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#if !defined __APPINFO_RH__
+#define __APPINFO_RH__
+
+//
+// contains definitions for the Application Information resource files
+
+/**
+@publishedAll
+@released
+*/
+#define KMaxFileNameLength 256
+
+//////////////////////////////////////////////////////////////////
+// DEFINITIONS FOR THE NON-LOCALISABLE REGISTRATION RESOURCE FILE
+//////////////////////////////////////////////////////////////////
+
+/**
+@publishedAll
+@released
+*/
+#define KUidAppRegistrationResourceFile 0x101f8021
+
+/**
+@publishedAll
+@released
+*/
+// constants for capability.hidden
+#define KAppNotHidden	0
+#define KAppIsHidden	1
+
+/**
+@publishedAll
+@released
+*/
+// constants for capability.newfile
+#define KAppDoesNotSupportNewFile	0
+#define KAppSupportsNewFile			1
+
+/**
+@publishedAll
+@released
+*/
+// constants for capability.embeddability
+#define KAppNotEmbeddable				0
+#define KAppEmbeddable					1
+#define KAppEmbeddableOnly				2
+#define KAppEmbeddableUiOrStandAlone	5
+#define KAppEmbeddableUiNotStandAlone	6
+
+/**
+@publishedAll
+@released
+*/
+// constants for capability.launch
+#define KAppLaunchInForeground	0
+#define KAppLaunchInBackground	1
+
+/**
+@publishedAll
+@released
+*/
+// bit flags for capability.attributes
+#define KAppBuiltAsDll				0x00000001
+#define KAppIsControlPanelItem		0x00000002
+#define KAppNonNative				0x00000004
+
+/**
+@publishedAll
+@released
+*/
+// application group name
+#define KAppMaxGroupName 16
+
+
+/**
+@publishedAll
+@released
+*/
+STRUCT APP_REGISTRATION_INFO
+	{
+	LONG reserved_long = 0; // reserved for future use, do not use
+	LLINK reserved_llink = 0; // reserved for future use, do not use
+	//
+	LTEXT app_file(KMaxFileNameLength) = ""; // name of application binary file (not including extension) - mandatory
+	LONG attributes = 0;
+	//
+	LTEXT localisable_resource_file(KMaxFileNameLength) = ""; // path (not including drive) and name of localisable resource file
+	LONG localisable_resource_id = 1;
+	//
+	BYTE hidden = KAppNotHidden;
+	BYTE embeddability = KAppNotEmbeddable;
+	BYTE newfile = KAppDoesNotSupportNewFile;
+	BYTE launch = KAppLaunchInForeground;
+	LTEXT group_name(KAppMaxGroupName) = "";
+	//
+	BYTE default_screen_number = 0;
+	//
+	LEN WORD STRUCT datatype_list[]; // DATATYPE
+	//
+	LEN WORD STRUCT file_ownership_list[]; // FILE_OWNERSHIP_INFO
+	//
+	LEN WORD STRUCT service_list[]; // SERVICE_INFO
+	//
+	LLINK opaque_data = 0;	// use for opaque data to send to non-native application launchers i.e. MIDlet id
+	}
+
+
+/**
+@publishedAll
+@released
+*/
+#define KMaxDataTypeLength 256
+
+/**
+@publishedAll
+@released
+*/
+enum
+	{
+	EDataTypePrioritySystem = 0xFFF9,
+	EDataTypePriorityHigh = 10000,
+	EDataTypePriorityNormal = 0,
+	EDataTypePriorityLow = -10000,
+	EDataTypePriorityLastResort = -20000
+	};
+
+/**
+@publishedAll
+@released
+*/
+STRUCT DATATYPE
+	{
+	LONG priority;
+	LTEXT8 type(KMaxDataTypeLength);
+	}
+
+/**
+@publishedAll
+@released
+*/
+STRUCT FILE_OWNERSHIP_INFO
+	{
+	LTEXT file_name(KMaxFileNameLength);
+	}
+
+/**
+@publishedAll
+@released
+*/
+STRUCT SERVICE_INFO
+	{
+	LONG uid = 0;
+	LEN WORD STRUCT datatype_list[];
+	LLINK opaque_data = 0;
+	}
+
+
+/////////////////////////////////////////////////
+// DEFINITIONS FOR THE LOCALISABLE RESOURCE FILE
+/////////////////////////////////////////////////
+
+/**
+@publishedAll
+@released
+*/
+#define KMaxCaption 256
+
+/**
+@publishedAll
+@released
+*/
+STRUCT LOCALISABLE_APP_INFO
+	{
+	LONG reserved_long = 0; // reserved for future use, do not use
+	LLINK reserved_llink = 0; // reserved for future use, do not use
+	//
+	LTEXT short_caption(KMaxCaption) = "";
+	STRUCT caption_and_icon; // CAPTION_AND_ICON_INFO
+	//
+	LEN WORD STRUCT view_list[]; // VIEW_DATA
+	//
+	LTEXT group_name(KAppMaxGroupName) = "";
+	}
+
+/**
+@publishedAll
+@released
+*/
+STRUCT CAPTION_AND_ICON_INFO
+	{
+	LONG reserved_long = 0; // reserved for future use, do not use
+	LLINK reserved_llink = 0; // reserved for future use, do not use
+	//
+	LTEXT caption(KMaxCaption) = "";
+	//
+	WORD number_of_icons = 0; // each icon must be a bitmap/mask pair
+	LTEXT icon_file(KMaxFileNameLength) = "";
+	}
+
+/**
+@publishedAll
+@released
+*/
+STRUCT VIEW_DATA
+	{
+	LONG reserved_long = 0; // reserved for future use, do not use
+	LLINK reserved_llink = 0; // reserved for future use, do not use
+	//
+	LONG uid = 0;
+	//
+	LONG screen_mode = 0;
+	//
+	STRUCT caption_and_icon; // CAPTION_AND_ICON_INFO
+	}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/ServiceRegistry.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,53 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+#if !defined (__SERVICE_REGISTRY_H__)
+#define __SERVICE_REGISTRY_H__
+
+#include <e32base.h>
+#include <apgcli.h>
+
+/**
+The Service Registry stores associations between (service,datatype) pairs and
+applications. The (service,datatype) pair is the primary key for the registry.
+
+@publishedPartner
+@released
+*/
+class CServiceRegistry : public CBase
+	{
+public:
+	IMPORT_C static CServiceRegistry* NewL();
+	IMPORT_C ~CServiceRegistry();
+	
+private:
+	CServiceRegistry();
+	void ConstructL();
+	
+public:
+	IMPORT_C TInt SetDefault(TUid aServiceUid, const TDataType& aDataType, 
+		TUid aDefaultAppUid);
+	IMPORT_C TInt RemoveEntry(TUid aServiceUid, const TDataType& aDataType);
+	IMPORT_C TInt GetDefault(TUid aServiceUid, const TDataType& aDataType,
+		TUid& aDefaultAppUid);
+	
+private:
+	/** The registry is currently only a thin wrapper around the 
+	RApaLsSession API */
+	RApaLsSession iApaLsSession;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/apfmimecontentpolicy.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#ifndef __APFMIMECONTENTPOLICY_H__
+#define __APFMIMECONTENTPOLICY_H__
+
+#include <e32base.h>
+
+class CApfMimeContentPolicyImpl;
+class RFile;
+class RFs;
+
+/**
+CApfMimeContentPolicy is utility class for checking MIME types and 
+file extensions against closed content list. It also provides a function 
+for checking if a given file is a DRM envelope, and a convinience function
+which combines all the checks mentioned above. 
+
+Usage:
+
+@code	
+  TFileName fileName = <name of the file to be checked>
+  TUid uid;
+  TDataType recData;
+
+  CApfMimeContentPolicy *ccp = CApfMimeContentPolicy::NewLC();
+
+  if (ccp->IsDRMEnvelope( fileName ))	
+	{
+     // Whatever needs to be done if file is DRM envelope.
+	}
+
+  // Check file extension.	
+  TParse parser;
+  parser.Set(fileName, NULL, NULL);
+  if (IsClosedExtension(parser.Ext()))
+	{
+    // Do what needs to be done if closed content.
+	}
+
+  iLs.AppForDocument(fileName, uid, recData);  // Get MIME type for file.
+
+  if (ccp->IsClosedType(recData.Des())   // Check if this mime type is closed.
+	{
+     // Whatever needs to be done if type is closed.
+	}
+	
+  // Or you can achieve same result calling a convinience function
+  // which combines all the steps above:
+  if (cpp->IsClosedFileL( fileName );
+ 	{
+    // Do whatever has to be done if file is closed.	
+	}
+
+  // Don't forget to clean up.
+	CleanupStack::PopAndDestroy();  // ccp	
+@endcode
+
+@publishedPartner
+@released
+*/
+class CApfMimeContentPolicy : public CBase
+	{
+public: // Constructors and destructor
+	IMPORT_C static CApfMimeContentPolicy* NewL();
+	IMPORT_C static CApfMimeContentPolicy* NewLC();
+	IMPORT_C static CApfMimeContentPolicy* NewL(RFs& aFs);
+	IMPORT_C static CApfMimeContentPolicy* NewLC(RFs& aFs);
+	IMPORT_C ~CApfMimeContentPolicy();
+public:  // New functions
+	IMPORT_C TBool IsClosedType(const TDesC& aMimeType);
+	IMPORT_C TBool IsClosedExtension(const TDesC& aFileExtension);
+	IMPORT_C TBool IsClosedFileL(const TDesC& aFileName);
+	IMPORT_C TBool IsDRMEnvelopeL(const TDesC& aFileName);
+	IMPORT_C TBool IsClosedFileL(RFile& aFileHandle);
+	IMPORT_C TBool IsDRMEnvelopeL(RFile& aFileHandle);
+private:
+	CApfMimeContentPolicy();
+	void ConstructL();
+	void ConstructL(RFs& aFs);			
+private:
+	CApfMimeContentPolicyImpl* iImpl;  // Implementation.
+	};
+
+
+#endif  // __APFMIMECONTENTPOLICY_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/inc/apgnotif.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,68 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __APGNOTIF_H__
+#define __APGNOTIF_H__
+
+#include <apgcli.h>
+
+
+class MApaAppListServObserver
+/**
+MApaAppListServObserver
+
+@publishedPartner
+@released
+*/
+	{
+public:
+	enum TApaAppListEvent
+		{
+		EAppListChanged=1
+		};
+	virtual void HandleAppListEvent(TInt aEvent)=0;
+protected:
+	IMPORT_C MApaAppListServObserver();
+private:
+	IMPORT_C virtual void MApaAppListServObserver_Reserved1();
+	IMPORT_C virtual void MApaAppListServObserver_Reserved2();
+private:
+	TInt iMApaAppListServObserver_Reserved1;
+	};
+
+
+class CApaAppListNotifier : public CActive
+/** An application list change notifier. 
+
+It provides notification whenever an application is added or deleted.
+
+@publishedPartner
+@released */
+	{
+public:
+	IMPORT_C ~CApaAppListNotifier();
+	IMPORT_C static CApaAppListNotifier* NewL(MApaAppListServObserver* aObserver, TPriority aPriority);
+private: // from CActive
+	void DoCancel();
+	void RunL();
+private:
+	CApaAppListNotifier(MApaAppListServObserver& aObserver, TPriority aPriority);
+	void ConstructL();
+private:
+	MApaAppListServObserver& iObserver;
+	RApaLsSession iLsSession;
+	};
+
+#endif
Binary file localisation/apparchitecture/tdata/102081ce_reg.rsc has changed
Binary file localisation/apparchitecture/tdata/102081cf_reg.rsc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tdata/1028583d.txt	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,26 @@
+cenrep
+Version 1
+
+[defaultmeta]
+0
+
+[Platsec]
+cap_rd=alwayspass  
+cap_wr=WriteDeviceData
+
+
+[Main]
+
+# EFDemoApp
+# app UID (??FFFFFF)
+0x00FFFFFF int 0x2001B674
+# English (language 0001)
+0x00000001 string "CRTC UK"
+0x00010001 string "CRTstCap UK"
+0x00020001 int 2
+0x00030001 string "z:\\resource\\apps\\ticoncapoverride.mbm"
+# French (language 0002)
+0x00000002 string "CRTC FR"
+0x00010002 string "CRTstCap FR"
+0x00020002 int 2
+0x00030002 string "z:\\resource\\apps\\svg_icon.svg"
Binary file localisation/apparchitecture/tdata/AAA_reg.Rsc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tdata/CONTACT.NNA3	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,159 @@
+BEGIN:VCARD
+VERSION:2.1
+REV:20010827T134249Z
+UID;ENCODING=QUOTED-PRINTABLE:01c00f98091b8820-00e06a35e115bc80-7
+N;ENCODING=QUOTED-PRINTABLE:Jones;Tom;;King=20of=20Cool;
+ADR;WORK;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:;;PO=C2=A0BOX=209214;London;;;
+ORG;ENCODING=QUOTED-PRINTABLE:Gut=20Records=20=20inc.;
+TITLE:Singer
+TEL;WORK;VOICE;ENCODING=QUOTED-PRINTABLE:66335=20=20209
+EMAIL;INTERNET;WORK;ENCODING=QUOTED-PRINTABLE:tom.jones@anonymous.com
+URL;WORK;ENCODING=QUOTED-PRINTABLE:www.tomjonesistheman.com
+LOGO;ENCODING=BASE64:
+    /9j/4AAQSkZJRgABAQAAjQDlAAD/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEj
+    JR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARES
+    EhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2Nj
+    Y2NjY2NjY2NjY2NjY2P/wAARCADlAI0DASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEA
+    AAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIh
+    MUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6
+    Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZ
+    mqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx
+    8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREA
+    AgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAV
+    YnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hp
+    anN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPE
+    xcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDp
+    BDEyktFGAPYU4wxFl/dqQOwXFKBzg9Pen5Cndk8d8/0ry0292dVhDBGu0BAOc9OK
+    eUUEcDHfNIBnJUnPr14//VTkXIyDjnByO1aJsLIcFjJ+6vQdPXFPXYqcBT7kU0FU
+    +bfnjByPWnKfXjH+ev6VUWQ0S4XA4wQeT+HWgqMgbR06dPWgk7ecg+uOlCgb85GM
+    DGK1WhAo5UcnHqT1pQcYAHHpRx1wWI4/WkyMggfkaEIUcnp0PPH1qKWZIo2YsBj1
+    NE0gRSx4AHU8fnXmfiPxDcX99Lb2jsIgxUbT19+KTbbtEaS3Zu3vjiGKZ40G4A4y
+    B1rKk8czM2BFhc9zn/P/ANesyy0lWO6T943fJ4FXn021CfNAOuDWDnSi7O7OqOHq
+    SV1ZHQ6P4rhvIwJHxJ/c/wA/hXTxyLKgKAjI7149fWj2bedA52Z6eldl4R1z7RH5
+    M7kyZ4J75rVe770XoYyi0+WWjOzBJJPQ4zTeeRjnPc96QMDk8A44IFR3Myw7C3G9
+    go/EGtXoZorjC7dwGcc4NLgDA4wfSoi3Xnoev4U8EZHzfXua89M3uSYyDwcE54pd
+    2So5x0H/ANamhuenIxx607IwCMEfStUDHkrnC9OnTrUife46dST/APrpiEYOTgbc
+    A05WU55x7/0rSL11M5Ej9Buz68n8/wDPvQvyglRgk9uaTeWADd+tLyzcH8D3rQgc
+    AMcY+tBYYx+YpqgqcADikcBRnbnA7dKp2FYxfFd8LHR5HdN4kG3H1z/jXnekWJn3
+    TMcHovFdH47vBJLBYRly+dzZ7Z4xio7JUs7EHbnjAJXP+e1c05uENN2dNCmpS12R
+    EkUsMi4VScYJUcH60+e4VVK4y3oRxRCjvIZHyGxgAdqmt0ZwBnc4yD/n8K5G9bs9
+    C1jLuvnXDxhcjkDkVi6dP9kvVffgK3X15rf1COOOBio5HBGM571zEaGW4VV5LMBx
+    XoYazi+x5+J0ku57TYyG4tY5SAGZQeOxNY3jS4+y6bay7tuLpT+jVsWEZjtIkYEF
+    UA59cCuf8fo8ujWyc5N2gx/wF6uK91Iwd7m0GCnaAM4pFxjlgPpTUJwAQRzgc56U
+    oIGWrzzUdlhnP5YpythcnqOQKiJBwe3XNPUcEkZYHpmqi2FyQccnA5qRZATgH2/z
+    +lQbmOzAyOmMdaljPQlcZHXH+f8AIrSMgZMCPlIXI7YqQkqpBJ6dR2qNSCvGSP59
+    +aepOe2c9j9a6IbGTHY+U9c8/nUTkkMuRjPNSA4HBx9f51CzFsgdQOh/xpzsKO55
+    3rEgu/FsgZW+QgAN7VbuLgQRLwGG4cHvWVe3bXfiW5maPaRlcEehxWmwjuMZJ46V
+    y19JRud+GXussQ6nvhImCNGTtK7QCB/n+VSQqqbnRuMtgnnNUp7WPYqpw3uKsIyw
+    WuwcADk+oFYyaN+W2xkaoxYMgBJbI6dKo+G9Pe91qKP5lEZ3Mw4xitgzxRpLcyjp
+    8qHuD3Na/g3T5IxJqM3JuP4e4Gf/AK1dVGTjFqxyYlJzuzrlO1doPGfYdqyfEFk1
+    /DYpuYBLoOWHGAFatVcgDgY9uOeP8aa4HykqccZHtgVtze7ZI5ktdSiuMAAYJ7Yo
+    ++wyo47U0vkrtyQR/SmliTGQOPzFcBbFVwTgjaABxjoakDbQCSOTUa5Gcrz7d6eO
+    QBn8aLiW5KM8gH3pyMq8MBz78VRu7qK0hMkrYHseT7VlSardycKFiUe2Tn+VVz21
+    NYxlPY6hZADwAvHHPSneaD3B4xgn61yY1C8AP77Of9kf4Uialejgykc9lFUsR0RT
+    w0tzrTNwcnIz6e3+fzqKe4RYjkqo9SQKo6i7x6QJEYiQhcsOOtc0Yp7l9sszy5Od
+    uetXVqOD5SKVHnV0VNRti2qzzIVcOcjbzkVPbMqgEjJ9D1/z3/8A1VZaH5thKksR
+    +NRy2+2RlfBORnPeuV1Obc7qcIwVkNkkVSS2QCeBjuPSs7Ur4xRPzkE8AD9KtPak
+    vngLnt6Vny6bc6jeRWsKEjfhmHStaMYuWpFeTjC6F8L6LNq9158jgQxOCQf4j6AV
+    6eiiMBRjHt/npxWdomlW+kWhgt8tk5JY5J/zzWiuBjnAz37Cuty5nc861lYcWA5A
+    4IPHrQW+fBz6dOv+frTQBjI4HuOCaFKZGMDnqfT/ABouFjNXaCR3PGTmoclJDtJw
+    oOT6/wCeaaxAL4cdcY/r/OkK5KqrBwckdsD+hzXCtTSxKJBuIYLhsDIByf8AOake
+    QKhK4JCnP61VBUo2QMgEfT6VUv7grBsyNz8fXP8AhT6jUW2VJ5muZ954RSdgP86l
+    gT5WJUY96gj+QjHAHHFPaRzkZ6+neob6ndGPKrIimYRhjgkDiqvzyyn5mUHIzjGK
+    tMpJyf1qxpVg9xfKB/qlO5iR70U43dupUpKMbs3dRiI0Py9udiLn9K5oOynKHqOm
+    eorrdwnMsRwFZSBzXHSRskxQcFCQR6cV0YnWSkjnwjummW7aaNmbeMsSMEjpSo5a
+    Vl4AduTVGVmj2lcnn5qLe7XzSxwDjAzXLyu10dLj1Ljx7pti4IzjirGn6gmmTNFN
+    GfLZs7x2J9faqEd2iuDgnnninTSRzgZxknHTNVBuLuyZ07qz2OxW4jeMGMqVJyGB
+    60/OBweMYA61lSNHpum2+1C3AGM/ias299HdqDG2QB0PBH4V2c3K+Vnnct9VsWyd
+    oJPTsM04EAHBBPtTFwVH8sZzVdpmFxEgACsjHpzkbf8AE09twMwsCCc5bnGBj8TQ
+    xdABu6enbP8AWmH7xGBnPajJB59emO9ciNbBKQOcjHBzmsjzGkkaQkkAYAJ4z3q3
+    e3JWF1QfM3yg8cds1RhVSigZxjHHGab0VzWlHUnVSTgDPeluf3U8ceMZUk9+at2k
+    IC72APGR7VWmSW51dYoRnC49h65qFFvRG19SxZWzXRMakDd1YjpW0FhtIvIhAweW
+    bOM/j+VRx7bKAQRnLnhiOpNMJLKDjOO4PH/1v511xjyK3U4qk3N+QbSJM+Z1/i2+
+    9R6jYreBrm2A83+NR/F71IvJXnA5GRxUkIdCzDHJJyCf8mj4laRKlKLujmnQAHI2
+    noeKrpArEkepzxXWXa2tyAZ1wxx+8TrVR9GjP+qukP8AvCsXRkvh1OuGJjb3tDAE
+    Gcg5AHSrVhZvPcpEDlc5PsO5rWTQ1GPNuVxnog5P41chMFonl2yjJ+8xOSaqFJ3v
+    PYKmJurRKniVwsVsAMgseR26CsOGSWBxJC+18dP8fzra1+MPpsMoGRG+CfrWHC2V
+    weuKWIfv3HhreyN3TtXE7eRcYWQ9Dnr7fWpdbkeKBJoG2yLJgH2wa5+ZOAwI3LyD
+    6VqXFwbjR4XYYbeAQT7Gs1UvEUqaU00tB0jEnIXIH8I9PamjALHfn2NNJYt8pHHG
+    Ce9QXEuz7nBHQqRyR600rmaRn3sxluVT+8Ov14FWLONsxqwGe4/z7VSt2ae6d85H
+    IB9ga3LWIquT1PoadTR2NYP3bkrsFDE545pdMcIJplX94eBx+lVbqTACYHqauWUf
+    l2oJO3dk/U9qqirO5lV0hr1H7vlLbiWbqP8AP1NWFzgdBg5GOmKrllEp4wAcHI49
+    /wDPtRG5OCX6nHU5roszmepZUEhskjoOQPrSg7hyM+uDnH1qu12ATk/L07fhUX2j
+    5cHJJ4OBnNCjYViZ3DnkA9gueeOn86l3/Lsz94YwQeveqXmb5SxbIAwOfzxUiknC
+    cNjrjnH+faiwyYL8riPCgrzikZhG/B5B+UnOP8/59akZtqkhSoJzkdf1prDcWUq2
+    48j/AD/9ela4kx6xC7sZocZ3KSAT/nmuVjBSXbnI/wA4rrLJWinwcbe3TmuU1FfK
+    v2i4VmfB/Osq0bpHZhZK8l0JHOEY+gNTQsRo8a9hMeQeD96qlxIAhAqxMNmiWsYU
+    jfKAWPbg8Y/E/lWEY6G8+l+5PK+2Ncbgc55P+cVm387YKdWbjPt61dmJQkAhs9+v
+    SsyFklvS4Bxn5f8AGto6amD10LljD5aKDnJ5Oa1wwKfezjviqUTKFbP3uNp70Cdl
+    jKjj3rPWWppKOlkU9VvjCUYANlhhSeuK6XcGt4pAQoYA4xxyK4i/cz3WQcIox65r
+    tLLL6db7lU5QFsdOldUIKMDjrSvIVguMbcZzyRjuMVGVVuoAHoO1TLGSdxwQc546
+    /hTWVeNq9G6c8gUX0IVh72qbcgfN0PfmqksKqxGBnuKuRKCD8xOMD5efao54icnb
+    kjrnnPPr3ouwVtmU0UknPTPFOwygnHyjvU0asDkKGxn8f8f8+tPY5Unp1yM4OPTN
+    Fx2tsENxu4Jx+WB/nmjci9RnI4BUenWo1jVSHXAJ79M04orZyPm9PXj0xT0YtiW1
+    JSVDjjd7GufulFzqU92Sdm47R61rX5Wzt9qH95L8qn09TWfx5OM8DkDNYV5WVkdO
+    Hjd85k3JxIR2robyJRpUIwcJID9TgisG7ULcoeACQf1rob10+wpGeobcMHr6/lkV
+    lJ+6jab99GLeS7UbOFO3AC8VHYRhYg5wWbnp0qvqLZdI1JGTkjHStCBNiYIGe5He
+    tJu0LdyaSvJsk6cCmXMgSAAHDHjk96eKrSDzbsLkfIM/5/Kopq5pN2RG0AO4dFJA
+    4X8q6myAFhCMDaFH0rBZSEzjAyec9a37RUW1ij3FgEHIzg10x1TOCr0Bxg8noWHP
+    UimHKsAqknqO+akyWw2M98ep6/yAqNcg7SeMA9cVTRKYqy44Xg4zkZ6/nTZ5C5Jw
+    O3vil2gfIemck4P8u1Qv+8wDt4Oc4xSSRRNG6hCpJB9c9KV1XaF+U59Bmo0UZPKg
+    Y/yKNgDYBJzz9fpT66iJNvl4KjgjjPf/ABqSKTbEzOVCj5vQAd6bEgwoIGSOOORV
+    bWLh7XTppIjh+EDbQcfnTSJeuhmXV8l7euyY2R/IpBznvn9Km2loix7jkkj61haY
+    xWRlOMZ6Ae1bm7fCeBwB/hXHU+NnowVoKxl32N656Yrac+baBlA2gYyT0/zisLUn
+    AIH0H61sRktpwOCB154PWl9lCn8SMG5ObxV4yE+bHrzWsjB1BxWPcjOpNjONvBIx
+    WuoCJkgDjmtKi0SJo7MczBQSTVaGQHfJnG4k1XknaaTYBzkjjsMf/rqbZhVj4245
+    Hr/n+tNLl3Ccr7BczYQjcN54zmtjS751tUWVdxAxkDBFZUUMdyzIwwF4J9K04A0Y
+    yBuHTK9RXdh6Xu3Z5mKq2fKjVWSKVciTaWOetMaM/dVgR6A+9V0C7AQevoeKlWIF
+    sjPA6k9a0lRizGGIb0sKFbLxkHA6fnUJLmUj5iwwcmrfPTJ61E21XHLAngBRWXsG
+    upuq6HBchQ3DKQBzwef8/lTdrFgM+mP8/hUkcoQjccqT360NcwgHcjAUvZSTuJVo
+    skCjaCQfpWB4nYyTwxBiFAywFak2oxxqWQM2B3rEurhr2RpWGw5wB7AVlVTgtTWj
+    aUrmTbtsmGenbnrWsJgV2qeccgGs6cD7RxwQOcVIpwM7uOuM9a5Zrm1PTpJOJFfK
+    dwzJnJySK2d+bJcZ64+tc7ev88ZGT8+M55rZlDpp6lgQAwPJ5PBzTnF8qI0dQzo/
+    3uoynI7Lu7/55q9dy7ICvRiv5D3qnaHGoygkA56flVy9iMkRKjJxj9a0klzK5nBv
+    kbRVsoQ2XPJ7CrknyBvm7YGahs32oVfjBxjHSpkYS3KockDlvp2pqPPOxE2oQuXN
+    OgCxbZT+8Y56etaCxMhxyVPrTY4/k2OAVzwfepUBBIcs4x1P+FeskoqyPCc+eV+4
+    LCquWwQT1IqQRnPB4oGSOpGacOue9JlRSF5A7GmbDvDgfNjGA3FSUdeaVirkDBmb
+    JTPTPtSOeMFPmPOO9TnOe9M2q3JGfqKAu+hm3CSOjZjA44GazAv2bMROWH4VvXEf
+    mNgKfwNYd1DI146qpJZcYHPNcuJinC514RuM+Uzt58+Qt94e34VG0/GSCQO9SXOn
+    3lqztJCQGGeKhhjKwbSecYrltHc9KMnsilPceYykZPOQPStW61NbjbGvKRqCSO1Y
+    ToRPs6EH8q1YLYpbGRj8zkgAdMVtUhFJMxUm52RasLRrq8kKDCseCB1P/wCquoTT
+    44tgZgTxuz2qhoE1vbx/MVEhJ3ZOK0mtw8pnjnVkYfdNck5Ns1s46Mw9etWs5hJG
+    u1W4z0zTtMhUx+Y5+ZxkmrWrT+fZeWUDdAW9MVLZwAWqKRgKMcDvmu3Bxv7zODGV
+    HGPIXAp/hIxz9CalUHrQq07HGDXcedGPUQIM5wM+velHH/66OAe/NAzUmlwNJuIX
+    JHPoKdRRYEyISE9EP50pMp+6oH1NPxSHJJAxSHqV287JLFOOfYUWiIIhKsYMrNhS
+    R/n1p8gJUqeMjGcVTjnaO4ZZZdgRcIFXrnjNcuKT5EdOEac2XWt553ZbhQUIxkkZ
+    H4VyOsQizuWUEqMZPoDXSNdIANt3Ifqlc9rSC5uUQSSMMbmc9h3rgpazsek01Ftm
+    baW8t1Or7cK7fKR1wK2dVtUstMRhhWLgE/gauaFZZQSsMM4wueSq0eJ0W4tIo1JV
+    BICxHYbTmuhzUp26GK91eZli4kg3BQCM5xirkWsxKAstspPdlYg1HPHkAtyqg5B6
+    1ntHnhep5wayilI6JPQ0oZRqGogxqVgUcrnAzXQxRgDqQP0rN0a0WCDB5cnca1kG
+    OnSvVpwUIJI8OtP2tS72FVcUp/PFFLVkWsrCH6UdM0c1VvbnyoiVGTjODSK1ZZVw
+    3SlqrYzCWJWxgkcj0NWvShO4bC03H/1qWlPSgHuRuAVOeg54rm9VuHh1SPYxwQQw
+    zgEZrpWODz+dctrQ3aiiRjc7dAB15rGqrxsb0NJpkov2vGEcMU7MOWJIwtNjga5n
+    8o87sNIfYZwBWtatDa6YViVd+dpJ4JOBmo7VRFC0r/ec5PGMDNee0obHoqbmrPYn
+    aRba3OFGR6dfwrNaSTUHW2eIoN25j2I9KGle8vvLUhVXk/4VciiETPcMPl+6PpkV
+    OqZVls9zOuZFKsvODx6VXs1827AI+VOSPepLtyYyxB+uBU2lxYgLDndzXVhoXldn
+    Piqtqb8zagG1R3HSrCdBx+OKrR5LbskMR/n+lWE6ZxgV6DZ49NXY/PNJ+H40hYAH
+    GTUU0wVSDjBz1FSbaIdPII1yec1izSGWXYOVzzzyTU91OzIcDBJ4wKgjUrGzEZY9
+    OOnvXNiavKuVbnThaXPLnexb0sbBMemW4x9K0+3T86y9Oyyuc8s2Rg/TtWkh4Gev
+    vWtP4Fcio/fdh4/WjoaAMdKWtDG5FIcH2HJOaxfkW9nu8R74+FPfJH9OTW5IcKxO
+    AMVzMn7yX7OdwO8yEnv0A/lWNVpR1NqKcpaGpCxuVzIqqBjjH4/zqDVJ/LTCHB7A
+    0+GXy1Ib6j3rM1Qz3EpEcbMB8xIxXnJOUj1LcmrH2ziAq4PzN0PXqP8A9VX726J0
+    tSCN4fGPr/k1maWvn3CtJuVk+UrjqPeresRs9uRbxEgSZwFxxg/pTatNIlTTV2T3
+    eh3cyYRUB+v+fWrcem3EUUaBRkccNWwpwrfxE9KkBy4wQPQ1pTquCtE56kVU+Izo
+    7aZcFwc5xjNTG2lOMbSccZNXSwJAydo9eKXdkg9wPXFbfWJGSw0Ck9nMMkKAT/eJ
+    qBtJu5DuUx4zx8xyK10OWwMdOuacCSvQAfyqlWkyXQijC/sG5LBi0OM8HcfTr0pZ
+    NCupI2DNHvPQ5P8AhXRcgdRwfr/n/P0pOrDr0+lZSpqbvI2jUcI8sTAttEvIVz5s
+    OT7tz39Kux6dOBy6Z9MmtQdB3PXjpRznv9e1bqbSsYuKbuZ39nzZxlPzNJ9gl/vJ
+    j8f8K0chTzz3HFZGsa7a6bG4mcbv7vU0nVaBUkwmsX8tl8yIcEfePp9KxTpM6zPK
+    bm3JZsY3HoO3SuWn8QaleXLmBm2k8AdBVZ31ZiWZpG7n5qznzzVpNI2prkd4ps7t
+    dFuJEyk0BP8AvH/CmDw7qJTmeAHocMxyPyrmNI8T3FniC4xgfxEc/wCea9D0+/iv
+    oQySbx0JFRGHK7SLlUlNGHbeF7qGaVnkgBblSHbt+FWLnRL2YERywrz8xy2en0ro
+    RxkEHpnr0NNIAOGzg1o6acrszUnawP/Z
+
+
+NOTE;ENCODING=QUOTED-PRINTABLE:In=20his=20native=20Wales,=20he=20is=20known=20as=20"Jones=20the=20Voice".=20Today,=20he=20is=20one=20of=20the=20enduring=20p=
+ersonalities=20in=20the=20music=20entertainment=20buisness,=20His=20unique=20vocal=20power,=20ability=
+,=20and=20charismatica=20persona=20make=20him=20one=20of=20the=20most=20respected,=20admired=20and=20loved=20perf=
+ormers=20in=20modern=20music.
+END:VCARD
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tdata/Corrupted_reg.RSC	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,26 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Note: Standard test header to avoid Copyright tool complaining of missing copyright...
+// 
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+kJ!€º<©ÁÚ$ Õ  	        beytfyugjcert    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tdata/FileWithUnknownMimeType.UnrecognisableExtention	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1 @@
+xyz
\ No newline at end of file
Binary file localisation/apparchitecture/tdata/GIF.NNA1 has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tdata/HTML.NNA2	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,41 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HTML><HEAD>
+<META http-equiv=Content-Type content="text/html; charset=windows-1252">
+<META content="MSHTML 6.00.2800.1515" name=GENERATOR></HEAD>
+<BODY>09:48:45:769 <PRE>09:48:45:769 *** TestExecute Started 16/09/2005 09:48:45:769 ***
+09:48:45:789 z:\apparctest\apparctest_t_nonnativeapps.script PRINT Run NonNativeApps Apparc test
+09:48:45:789 INFO -  104 ScriptEngine.cpp 1077  Run NonNativeApps Apparc test
+
+09:48:45:794 z:\apparctest\apparctest_t_nonnativeapps.script LOAD_SUITE ApparcTestServer
+09:48:46:165 z:\apparctest\apparctest_t_nonnativeapps.script RUN_TEST_STEP 100 ApparcTestServer T_NonNativeApps
+09:48:46:180 INFO -  112 T_NonNativeAppsStep.cpp 393 Test NonNativeApps starting....
+
+09:48:46:185 INFO -  112 T_NonNativeAppsStep.cpp 124 Testing AppForDocumentL()...
+09:48:46:185 INFO -  112 T_NonNativeAppsStep.cpp 132 ..using following file: 'GIF.NNA'
+09:48:46:190 ERROR -  112 T_NonNativeAppsStep.cpp 414 ERROR: Test Failed
+09:48:46:190 INFO -  112 T_NonNativeAppsStep.cpp 415 TestAppForDocumentL completes with ret=-12.
+
+09:48:46:190 INFO -  112 T_NonNativeAppsStep.cpp 182 Testing AppForDocumentAndServiceL()...
+09:48:46:190 INFO -  112 T_NonNativeAppsStep.cpp 190 ..using following file: 'GIF.NNA'
+09:48:46:190 INFO -  112 T_NonNativeAppsStep.cpp 421 TestAppForDocumentAndServiceL completes with ret=-12.
+
+09:48:46:195 INFO -  112 T_NonNativeAppsStep.cpp 221 Testing RecognizingL()...
+09:48:46:195 INFO -  112 T_NonNativeAppsStep.cpp 229 ..using following file: 'GIF.NNA'
+09:48:46:195 INFO -  112 T_NonNativeAppsStep.cpp 427 TestRecognizingL completes with ret=-12.
+
+09:48:46:195 INFO -  112 T_NonNativeAppsStep.cpp 285 Testing StartDocumentL()...
+09:48:46:200 INFO -  112 T_NonNativeAppsStep.cpp 293 ..using following file: 'GIF.NNA'
+09:48:46:200 INFO -  112 T_NonNativeAppsStep.cpp 433 TestStartDocumentL completes with ret=-12.
+
+09:48:46:200 INFO -  112 T_NonNativeAppsStep.cpp 438 Test completed!
+09:48:46:205 <FONT color=#ff0000 size=2>z:\apparctest\apparctest_t_nonnativeapps.script Line = 5 Command = RUN_TEST_STEP 100 ApparcTestServer T_NonNativeApps ***Result = FAIL </FONT>
+09:48:46:215 <FONT color=#00afff size=2>SUMMARY:</FONT>
+09:48:46:215 <FONT color=#00af00 size=2>PASS = 0</FONT>
+09:48:46:215 <FONT color=#ff0000 size=2>FAIL = 1</FONT>
+09:48:46:223 <FONT color=#0000ff size=2>ABORT = 0</FONT>
+09:48:46:238 <FONT color=#0000ff size=2>PANIC = 0</FONT>
+09:48:46:238 <FONT color=#0000ff size=2>INCONCLUSIVE = 0</FONT>
+09:48:46:238 <FONT color=#0000ff size=2>UNKNOWN = 0</FONT>
+09:48:46:238 <FONT color=#0000ff size=2>UNEXECUTED = 0</FONT>
+09:48:46:238 <FONT color=#0000ff size=2>COMMENTED OUT RUN COMMAND'S = 0</FONT>
+09:48:46:238 </PRE></BODY></HTML>
Binary file localisation/apparchitecture/tdata/TSTAPPU.DOC has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tdata/TXT.NNA4	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,2 @@
+This is a text file, used in T_NonNativeApps test in apparc.
+End of file.
Binary file localisation/apparchitecture/tdata/UpdatedAppsList.bin has changed
Binary file localisation/apparchitecture/tdata/mimecontentpolicy/fl_goo.dm has changed
Binary file localisation/apparchitecture/tdata/mimecontentpolicy/gif_wallpaper.gif has changed
Binary file localisation/apparchitecture/tdata/mimecontentpolicy/jpeg_wes.dm has changed
Binary file localisation/apparchitecture/tdata/mimecontentpolicy/propelli.jpg has changed
Binary file localisation/apparchitecture/tdata/mimecontentpolicy/sd_goo.dcf has changed
Binary file localisation/apparchitecture/tdata/mimecontentpolicy/type-r.jpg has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tdata/one_byte.txt	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1 @@
+1
\ No newline at end of file
Binary file localisation/apparchitecture/tdata/recmime_1.rsc has changed
Binary file localisation/apparchitecture/tdata/recmime_armv5.dll has changed
Binary file localisation/apparchitecture/tdata/recmime_winscw.dll has changed
Binary file localisation/apparchitecture/tdata/recupgrade.rsc has changed
Binary file localisation/apparchitecture/tdata/recupgrade_armv5_rel.dll has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tdata/sdk.txt	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,11 @@
+<html>
+<title>EPOC32 C++ SDK</title>
+<body>
+<table><tr valign=top>
+<td width=20%>
+<center><a href="http://www.software.psion.com/EPOCWorld"><img src="../group/epocworldlogo.gif" border=0></a></center>
+<ul>
+<li><b><a href="../release/rn-toc.html">Release notes</a></b></li>
+<li><b><a href="../getstart/gs-toc.html">Getting started</a></b></li>
+</body>
+</html>
Binary file localisation/apparchitecture/tdata/testupdregappuninstallation_reg.rsc has changed
Binary file localisation/apparchitecture/tdatasrc/DEF25.BMP has changed
Binary file localisation/apparchitecture/tdatasrc/DEF25M.BMP has changed
Binary file localisation/apparchitecture/tdatasrc/DEF35.BMP has changed
Binary file localisation/apparchitecture/tdatasrc/DEF35M.BMP has changed
Binary file localisation/apparchitecture/tdatasrc/DEF50.BMP has changed
Binary file localisation/apparchitecture/tdatasrc/DEF50M.BMP has changed
Binary file localisation/apparchitecture/tdatasrc/Thumbs.db has changed
Binary file localisation/apparchitecture/tdatasrc/tstappicon24x20.bmp has changed
Binary file localisation/apparchitecture/tdatasrc/tstappicon24x20m.bmp has changed
Binary file localisation/apparchitecture/tdatasrc/tstappicon40x55.bmp has changed
Binary file localisation/apparchitecture/tdatasrc/tstappicon40x55m.bmp has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/10000180.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,49 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// App-framework notifier plug-in resource file.
+// N.B. Testcode.
+// 
+//
+
+
+
+/**
+ @file 10000180.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <RegistryInfo.rh>
+
+RESOURCE REGISTRY_INFO r_registry
+	{
+	dll_uid = 0x10000180; //should match name of this file
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = 0x101F7D86;  // need to create this uid in the uid database
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 0x101DC568; //Unique number
+					version_no = 1;
+					display_name = "TDoNothingFileRecognizer";
+					default_data = "";        // Notify Interface
+					opaque_data = "";
+					}
+				};
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/10000181.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,49 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// App-framework notifier plug-in resource file.
+// N.B. Testcode.
+// 
+//
+
+
+
+/**
+ @file 10000181.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <RegistryInfo.rh>
+
+RESOURCE REGISTRY_INFO r_registry
+	{
+	dll_uid = 0x10000181; //should match name of this file
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = 0x101F7D86;  // need to create this uid in the uid database
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 0x101F7D8C;
+					version_no = 1;
+					display_name = "TTestEcomFileRec";
+					default_data = "";        // Notify Interface
+					opaque_data = "";
+					}
+				};
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/10000182.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,49 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// App-framework notifier plug-in resource file.
+// N.B. Testcode.
+// 
+//
+
+
+
+/**
+ @file 10000182.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <RegistryInfo.rh>
+
+RESOURCE REGISTRY_INFO r_registry
+	{
+	dll_uid = 0x10000182; //should match name of this file
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = 0x101F7D87;  // need to create this uid in the uid database
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 0x10004c50;
+					version_no = 1;
+					display_name = "TRApaLsSessionStartAppTestRecognizer";
+					default_data = "";        // Notify Interface
+					opaque_data = "";
+					}
+				};
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/10004c4e.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,49 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// App-framework notifier plug-in resource file.
+// N.B. Testcode.
+// 
+//
+
+
+
+/**
+ @file 10004c4e.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <RegistryInfo.rh>
+
+RESOURCE REGISTRY_INFO r_registry
+	{
+	dll_uid = 0x10004c4e; //should match name of this file
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = 0x101F7D87;  // need to create this uid in the uid database
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 0x101F7D8D;
+					version_no = 1;
+					display_name = "TLongUrlRecognizer";
+					default_data = "";        // Notify Interface
+					opaque_data = "";
+					}
+				};
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/10004c5B.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TAppEmbeddable resource - Test
+// 
+//
+
+
+
+/**
+ @file 10004c5b.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <RegistryInfo.rh>
+
+RESOURCE REGISTRY_INFO
+	{
+	dll_uid = 0x10004c5B; //should match name of this file
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid=0x101f8c96;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 0x10004c48; 			
+					version_no = 1;
+					display_name = "TAppEmbeddable";
+					default_data = "";        
+					opaque_data = "";
+					}
+				};
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/10004c5C.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TAppEmbeddableOnly resource - Test
+// 
+//
+
+
+
+/**
+ @file 10004c5c.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <RegistryInfo.rh>
+
+RESOURCE REGISTRY_INFO
+	{
+	dll_uid = 0x10004c5C; //should match name of this file
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid=0x101f8c96;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 0x10004c49; 			
+					version_no = 1;
+					display_name = "TAppEmbeddableOnly";
+					default_data = "";        
+					opaque_data = "";
+					}
+				};
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/10004c5D.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TAppEmbeddableUiOrStandalone resource - Test
+// 
+//
+
+
+
+/**
+ @file 10004c5d.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <RegistryInfo.rh>
+
+RESOURCE REGISTRY_INFO
+	{
+	dll_uid = 0x10004c5D; //should match name of this file
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid=0x101f8c96;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 0x10004c4A; 			
+					version_no = 1;
+					display_name = "TAppEmbeddableUiOrStandAlone";
+					default_data = "";        
+					opaque_data = "";
+					}
+				};
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/10004c5E.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TAppEmbeddableUiNotStandAlone resource - Test
+// 
+//
+
+
+
+/**
+ @file 10004c5e.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <RegistryInfo.rh>
+
+RESOURCE REGISTRY_INFO
+	{
+	dll_uid = 0x10004c5E; //should match name of this file
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid=0x101f8c96;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 0x10004c4B; 			
+					version_no = 1;
+					display_name = "TAppEmbeddableUiNotStandAlone";
+					default_data = "";        
+					opaque_data = "";
+					}
+				};
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/10004c66.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// tstapp resource - Test
+// 
+//
+
+
+
+/**
+ @file 10004c66.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <RegistryInfo.rh>
+
+RESOURCE REGISTRY_INFO
+	{
+	dll_uid = 0x10004c66; //should match name of this file
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid=0x101f8c96;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 10; 			
+					version_no = 1;
+					display_name = "tstapp";
+					default_data = "";        
+					opaque_data = "";
+					}
+				};
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/102032A5.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Resource File  for the Test Data Recognizer TESTREC \n
+// 
+//
+
+
+
+/**
+ @file 102032A5.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <RegistryInfo.rh>
+
+RESOURCE REGISTRY_INFO r_registry
+	{
+	dll_uid = 0x102032A5; //should match name of this file
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = 0x101F7D87;  // need to create this uid in the uid database
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 0x102032A6;
+					version_no = 1;
+					display_name = "TestREC";
+					default_data = "";        // Notify Interface
+					opaque_data = "";
+					}
+				};
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/1020d465.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,54 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include "RegistryInfo.rh"
+
+RESOURCE REGISTRY_INFO theInfo
+{
+dll_uid = 0x1020d465;
+interfaces = 
+    {
+    INTERFACE_INFO
+        {
+        interface_uid = 0x1020d466;
+        implementations = 
+            {
+            IMPLEMENTATION_INFO
+                {
+                implementation_uid = 0x1020d467;
+                version_no = 1;
+                display_name = "Test implementation of application launch checker";
+                default_data = "";
+                opaque_data = "some extra data";
+                },
+            IMPLEMENTATION_INFO
+                {
+                implementation_uid = 0x1020d468;
+                version_no = 1;
+                display_name = "Second test implementation of application launch checker";
+                default_data = "";
+                opaque_data = ""; //some extra data
+                }
+            };
+        }
+    };
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/102722ba.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,49 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// 0x102722ba.rss
+// 
+//
+
+#include "RegistryInfo.rh"
+
+RESOURCE REGISTRY_INFO theInfo
+{
+dll_uid = 0x102722ba;
+interfaces = 
+    {
+    INTERFACE_INFO
+        {
+        interface_uid = 0x1020d466;
+        implementations = 
+            {
+            IMPLEMENTATION_INFO
+                {
+                implementation_uid = 0x102722bb;
+                version_no = 1;
+                display_name = "Third test implementation of application launch checker";
+                default_data = "";
+                opaque_data = "some extra data";
+                },
+            IMPLEMENTATION_INFO
+                {
+                implementation_uid = 0x102722bc;
+                version_no = 1;
+                display_name = "Forth test implementation of application launch checker";
+                default_data = "";
+                opaque_data = ""; //some extra data
+                }
+            };
+        }
+    };
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/A0000B70.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,46 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include "RegistryInfo.rh"
+
+RESOURCE REGISTRY_INFO theInfo
+{
+dll_uid = 0xA0000B70; // Dll UId
+interfaces = 
+    {
+    INTERFACE_INFO
+        {
+        interface_uid = 0x1020d466; //Uid for access to all implementations of rule-based interface
+        implementations = 
+            {
+            IMPLEMENTATION_INFO
+                {
+                implementation_uid = 0xA0000B6F; // Our Test Plugin for NonNative Applications
+                version_no = 1;
+                display_name = "Test implementation of Nonnative application launch checker";
+                default_data = "";
+                opaque_data = "some extra data";
+                }
+            };
+        }
+    };
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/AppInfo_NoLocalisableGroupName.rh	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,32 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#if !defined __APPINFO_NOLOCALISABLEGROUPNAME_RH__
+#define __APPINFO_NOLOCALISABLEGROUPNAME_RH__
+
+#include <APPINFO.RH>
+
+STRUCT LOCALISABLE_APP_INFO__NO_GROUP_NAME
+	{
+	LONG reserved_long = 0; // reserved for future use, do not use
+	LLINK reserved_llink = 0; // reserved for future use, do not use
+	//
+	LTEXT short_caption(KMaxCaption) = "";
+	STRUCT caption_and_icon; // CAPTION_AND_ICON_INFO
+	//
+	LEN WORD STRUCT view_list[]; // VIEW_DATA
+	}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/App_CTRL.hrh	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,22 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+enum TExampleMenuCommands
+	{
+	EExampleItem0 = 200,
+	EExampleItem1,
+	EExampleItem2
+	};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/App_CTRL.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,74 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file app_ctrl.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+
+NAME HEWO
+
+#include <eikon.rh>
+#include <eikcore.rsg>
+
+#include "App_CTRL.hrh"
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+	{
+	hotkeys=r_example_hotkeys;
+	menubar=r_example_menubar;
+	}
+
+
+
+RESOURCE HOTKEYS r_example_hotkeys
+    {
+    control=
+        {
+        HOTKEY { command=EEikCmdExit; key='e'; }
+        };
+    }
+
+RESOURCE MENU_BAR r_example_menubar
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_example_first_menu; txt="SimpleApp"; }
+		};
+    }
+
+RESOURCE MENU_PANE r_example_first_menu
+	{
+	items=
+		{
+		MENU_ITEM { command=EExampleItem0; txt="Item 0"; },
+		MENU_ITEM { command=EExampleItem1; txt="Item 1"; },
+		MENU_ITEM { command=EExampleItem2; txt="Item 2"; },
+		MENU_ITEM { command=EEikCmdExit; txt="Close"; }
+        };
+    }
+
+
+RESOURCE TBUF r_example_text_Title { buf="SimpleApp used by T_Foreground"; }
+RESOURCE TBUF r_example_text_Item0 { buf="Item 0"; }
+RESOURCE TBUF r_example_text_Item1 { buf="Item 1"; }
+RESOURCE TBUF r_example_text_Item2 { buf="Item 2"; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/App_CTRL2.hrh	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,22 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+enum TExampleMenuCommands
+	{
+	EExampleItem0 = 200,
+	EExampleItem1,
+	EExampleItem2
+	};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/App_CTRL2.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,73 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file App_CTRL2.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+NAME HEWO
+
+#include <eikon.rh>
+#include <eikcore.rsg>
+
+#include "App_CTRL2.hrh"
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+	{
+	hotkeys=r_example_hotkeys;
+	menubar=r_example_menubar;
+	}
+
+
+
+RESOURCE HOTKEYS r_example_hotkeys
+    {
+    control=
+        {
+        HOTKEY { command=EEikCmdExit; key='e'; }
+        };
+    }
+
+RESOURCE MENU_BAR r_example_menubar
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_example_first_menu; txt="SimpleApp"; }
+		};
+    }
+
+RESOURCE MENU_PANE r_example_first_menu
+	{
+	items=
+		{
+		MENU_ITEM { command=EExampleItem0; txt="Item 0"; },
+		MENU_ITEM { command=EExampleItem1; txt="Item 1"; },
+		MENU_ITEM { command=EExampleItem2; txt="Item 2"; },
+		MENU_ITEM { command=EEikCmdExit; txt="Close"; }
+        };
+    }
+
+
+RESOURCE TBUF r_example_text_Title { buf="SimpleApp used by T_Foreground App 2"; }
+RESOURCE TBUF r_example_text_Item0 { buf="Item 0"; }
+RESOURCE TBUF r_example_text_Item1 { buf="Item 1"; }
+RESOURCE TBUF r_example_text_Item2 { buf="Item 2"; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/App_CTRL2_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,32 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file App_CTRL2_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x13008ADE
+RESOURCE APP_REGISTRATION_INFO
+	{	
+	app_file = app_CTRL2;
+	attributes=KAppIsControlPanelItem;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/App_CTRL_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,33 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file App_CTRL_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x13008ACE
+RESOURCE APP_REGISTRATION_INFO
+	{	
+	app_file = app_CTRL;
+	attributes=KAppIsControlPanelItem;
+	localisable_resource_file="\\Resource\\Apps\\App_ctrl_loc";
+	}
Binary file localisation/apparchitecture/tef/App_ctrl.MBM has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/App_ctrl_loc.RSS	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,36 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file App_ctrl_loc.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include<appinfo.rh>
+RESOURCE LOCALISABLE_APP_INFO
+	{
+	short_caption=STRING_Caption;
+	caption_and_icon=
+		{
+		CAPTION_AND_ICON_INFO
+			{
+			caption="Test icon";
+			number_of_icons=1;
+			icon_file="Z:\\Resource\\Apps\\APP_CTRL.MBM";
+			}
+		};
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ChildI.hrh	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,28 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+enum TExampleMenuCommands
+	{
+	EExampleItem0 = 200,
+	EExampleItem1,
+	EExampleItem2
+	};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ChildI.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,50 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <platform_paths.hrh>
+
+TARGET        	ChildI.exe
+TARGETTYPE    	exe
+UID           	0x100039CE 0x10207f84
+VENDORID  	0x70000001
+SOURCEPATH    	.
+SOURCE        	ChildI_Main.cpp
+USERINCLUDE   	.
+SYSTEMINCLUDE 	/epoc32/include
+SYSTEMINCLUDE 	/epoc32/include/techview
+
+MW_LAYER_SYSTEMINCLUDE
+
+START RESOURCE	ChildI.RSS
+HEADER
+TARGETPATH	/Resource/Apps
+end
+
+START RESOURCE	ChildI_reg.rss
+TARGETPATH	/private/10003a3f/apps
+END
+
+LIBRARY       	APPARC.LIB
+LIBRARY       	CONE.LIB 
+LIBRARY       	EIKCORE.LIB 
+LIBRARY       	EUSER.LIB
+LIBRARY       	GDI.LIB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ChildI.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,72 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+NAME HEWO
+
+#include <eikon.rh>
+#include <eikcore.rsg>
+#include <appinfo.rh>
+
+#include "ChildI.hrh"
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+	{
+	hotkeys=r_example_hotkeys;
+	menubar=r_example_menubar;
+	}
+
+RESOURCE HOTKEYS r_example_hotkeys
+    {
+    control=
+        {
+        HOTKEY { command=EEikCmdExit; key='e'; }
+        };
+    }
+
+RESOURCE MENU_BAR r_example_menubar
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_example_first_menu; txt="ChildPrI"; }
+		};
+    }
+
+RESOURCE MENU_PANE r_example_first_menu
+	{
+	items=
+		{
+		MENU_ITEM { command=EExampleItem0; txt="Item 0"; },
+		MENU_ITEM { command=EExampleItem1; txt="Item 1"; },
+		MENU_ITEM { command=EExampleItem2; txt="Item 2"; },
+		MENU_ITEM { command=EEikCmdExit; txt="Close"; }
+        };
+    }
+
+
+RESOURCE TBUF r_example_text_ChildI { buf=" CHILD I !"; }
+RESOURCE TBUF r_example_text_Item0 { buf="Item 0"; }
+RESOURCE TBUF r_example_text_Item1 { buf="Item 1"; }
+RESOURCE TBUF r_example_text_Item2 { buf="Item 2"; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ChildII.hrh	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,29 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+
+enum TExampleMenuCommands
+	{
+	EExampleItem0 = 200,
+	EExampleItem1,
+	EExampleItem2
+	};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ChildII.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,50 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <platform_paths.hrh>
+
+TARGET        	ChildII.exe
+TARGETTYPE    	exe
+UID           	0x100039CE 0x10207f85
+VENDORID 	0x70000001
+SOURCEPATH    	.
+SOURCE        	ChildII_Main.cpp
+USERINCLUDE   	.
+SYSTEMINCLUDE 	/epoc32/include
+SYSTEMINCLUDE 	/epoc32/include/techview
+
+MW_LAYER_SYSTEMINCLUDE
+
+START RESOURCE	ChildII.RSS
+HEADER
+TARGETPATH	/Resource/Apps
+end
+
+START RESOURCE	ChildII_reg.rss
+TARGETPATH	/private/10003a3f/apps
+END
+
+LIBRARY       	APPARC.LIB
+LIBRARY       	CONE.LIB 
+LIBRARY       	EIKCORE.LIB 
+LIBRARY       	EUSER.LIB
+LIBRARY       	GDI.LIB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ChildII.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,72 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+NAME HEWO
+
+#include <eikon.rh>
+#include <eikcore.rsg>
+#include <appinfo.rh>
+
+#include "ChildII.hrh"
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+	{
+	hotkeys=r_example_hotkeys;
+	menubar=r_example_menubar;
+	}
+
+RESOURCE HOTKEYS r_example_hotkeys
+    {
+    control=
+        {
+        HOTKEY { command=EEikCmdExit; key='e'; }
+        };
+    }
+
+RESOURCE MENU_BAR r_example_menubar
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_example_first_menu; txt="ChildII"; }
+		};
+    }
+
+RESOURCE MENU_PANE r_example_first_menu
+	{
+	items=
+		{
+		MENU_ITEM { command=EExampleItem0; txt="Item 0"; },
+		MENU_ITEM { command=EExampleItem1; txt="Item 1"; },
+		MENU_ITEM { command=EExampleItem2; txt="Item 2"; },
+		MENU_ITEM { command=EEikCmdExit; txt="Close"; }
+        };
+    }
+
+
+RESOURCE TBUF r_example_text_ChildII { buf="CHILD II !"; }
+RESOURCE TBUF r_example_text_Item0 { buf="Item 0"; }
+RESOURCE TBUF r_example_text_Item1 { buf="Item 1"; }
+RESOURCE TBUF r_example_text_Item2 { buf="Item 2"; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ChildIII.hrh	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,28 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+enum TExampleMenuCommands
+	{
+	EExampleItem0 = 200,
+	EExampleItem1,
+	EExampleItem2
+	};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ChildIII.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,51 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <platform_paths.hrh>
+
+TARGET        	ChildIII.exe
+TARGETTYPE    	exe
+UID           	0x100039CE 0x10207f86
+VENDORID 	0x70000001
+SOURCEPATH    	.
+SOURCE        	ChildIII_Main.cpp
+USERINCLUDE   	.
+SYSTEMINCLUDE 	/epoc32/include
+SYSTEMINCLUDE 	/epoc32/include/techview
+
+MW_LAYER_SYSTEMINCLUDE
+
+START RESOURCE	ChildIII.RSS
+HEADER
+TARGETPATH	/Resource/Apps
+end
+
+START RESOURCE	ChildIII_reg.rss
+TARGETPATH	/private/10003a3f/apps
+END
+
+LIBRARY       	APPARC.LIB
+LIBRARY       	CONE.LIB 
+LIBRARY		EFSRV.LIB
+LIBRARY       	EIKCORE.LIB 
+LIBRARY       	EUSER.LIB
+LIBRARY       	GDI.LIB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ChildIII.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,73 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+
+NAME HEWO
+
+#include <eikon.rh>
+#include <eikcore.rsg>
+#include <appinfo.rh>
+
+#include "ChildIII.hrh"
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+	{
+	hotkeys=r_example_hotkeys;
+	menubar=r_example_menubar;
+	}
+
+RESOURCE HOTKEYS r_example_hotkeys
+    {
+    control=
+        {
+        HOTKEY { command=EEikCmdExit; key='e'; }
+        };
+    }
+
+RESOURCE MENU_BAR r_example_menubar
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_example_first_menu; txt="ChildIII"; }
+		};
+    }
+
+RESOURCE MENU_PANE r_example_first_menu
+	{
+	items=
+		{
+		MENU_ITEM { command=EExampleItem0; txt="Item 0"; },
+		MENU_ITEM { command=EExampleItem1; txt="Item 1"; },
+		MENU_ITEM { command=EExampleItem2; txt="Item 2"; },
+		MENU_ITEM { command=EEikCmdExit; txt="Close"; }
+        };
+    }
+
+
+RESOURCE TBUF r_example_text_ChildIII { buf="CHILD III !"; }
+RESOURCE TBUF r_example_text_Item0 { buf="Item 0"; }
+RESOURCE TBUF r_example_text_Item1 { buf="Item 1"; }
+RESOURCE TBUF r_example_text_Item2 { buf="Item 2"; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ChildIII_Main.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,350 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// A simple application containing a single view with the text "Child III !" drawn on it.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <coeccntx.h>
+
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+
+#include <eikon.hrh>
+#include <f32file.h>
+
+#include <ChildIII.rsg>
+#include "ChildIII.hrh"
+
+
+#include <eikstart.h>
+_LIT(KFilePath,"c:\\logs\\TestExecute\\Proc.txt");
+_LIT8(KTPass, "PASS");
+_LIT8(KTFail, "FAIL");
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppView
+//
+////////////////////////////////////////////////////////////////////////
+
+class CExampleAppView : public CCoeControl
+    {
+public:
+	static CExampleAppView* NewL(const TRect& aRect);
+	CExampleAppView();
+	~CExampleAppView();
+    void ConstructL(const TRect& aRect);
+
+private:
+	           // Inherited from CCoeControl
+	void Draw(const TRect& /*aRect*/) const;
+
+private:
+	HBufC*  iExampleText;
+    };
+
+//
+//             Constructor for the view.
+//
+CExampleAppView::CExampleAppView()
+	{
+	}
+
+//             Static NewL() function to start the standard two
+//             phase construction.
+//
+CExampleAppView* CExampleAppView::NewL(const TRect& aRect)
+	{
+	CExampleAppView* self = new(ELeave) CExampleAppView();
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect);
+	CleanupStack::Pop();
+	return self;
+	}
+
+//
+//             Destructor for the view.
+//
+CExampleAppView::~CExampleAppView()
+	{
+	delete iExampleText;
+	}
+
+//             Second phase construction.
+//
+void CExampleAppView::ConstructL(const TRect& aRect)
+    {
+			   // Fetch the text from the resource file.
+	iExampleText = iEikonEnv->AllocReadResourceL(R_EXAMPLE_TEXT_CHILDIII);
+	           // Control is a window owning control
+	CreateWindowL();
+	           // Extent of the control. This is
+	           // the whole rectangle available to application.
+	           // The rectangle is passed to us from the application UI.
+	SetRect(aRect);
+			   // At this stage, the control is ready to draw so
+	           // we tell the UI framework by activating it.
+	ActivateL();
+	}
+
+
+//             Drawing the view - in this example, 
+//             consists of drawing a simple outline rectangle
+//             and then drawing the text in the middle.
+//             We use the Normal font supplied by the UI.
+//
+//             In this example, we don't use the redraw
+//             region because it's easier to redraw to
+//             the whole client area.
+//
+void CExampleAppView::Draw(const TRect& /*aRect*/) const
+	{
+               // Window graphics context
+	CWindowGc& gc = SystemGc();
+	           // Area in which we shall draw
+	TRect      drawRect = Rect();
+			   // Font used for drawing text
+	const CFont*     fontUsed;
+	
+	           // Start with a clear screen
+	gc.Clear();
+			   // Draw an outline rectangle (the default pen
+	           // and brush styles ensure this) slightly
+	           // smaller than the drawing area.
+	drawRect.Shrink(10,10);		   	
+	gc.DrawRect(drawRect);
+               // Use the title font supplied by the UI
+	fontUsed = iEikonEnv->TitleFont();
+	gc.UseFont(fontUsed);
+			   // Draw the text in the middle of the rectangle.
+	TInt   baselineOffset=(drawRect.Height() - fontUsed->HeightInPixels())/2; 
+	gc.DrawText(*iExampleText,drawRect,baselineOffset,CGraphicsContext::ECenter, 0);
+               // Finished using the font
+	gc.DiscardFont();
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppUi
+//
+////////////////////////////////////////////////////////////////////////
+
+class CExampleAppUi : public CEikAppUi
+    {
+public:
+    void ConstructL();
+	TBool ProcessCommandParametersL(CApaCommandLine& aCommandLine);
+	//void PrepareToExit();
+	void CompParentPidL(void);
+	~CExampleAppUi();
+
+private:
+              // Inherirted from class CEikAppUi
+	void HandleCommandL(TInt aCommand);
+
+private:
+	CCoeControl* iAppView;
+	TProcessId iParentProcessId;
+	RFile iFile;
+	RFs iFs;
+	};
+
+//             The second phase constructor of the application UI class.
+//             The application UI creates and owns the one and only view.
+// 
+void CExampleAppUi::ConstructL()
+    {
+	           // BaseConstructL() completes the UI framework's
+	           // construction of the App UI.
+    BaseConstructL();
+	           // Create the single application view in which to
+	           // draw the text "Child III", passing into it
+	           // the rectangle available to it.
+	iAppView = CExampleAppView::NewL(ClientRect());
+	}
+
+//             The app Ui owns the two views and is. 
+//             therefore, responsible for destroying them
+//
+CExampleAppUi::~CExampleAppUi()
+	{
+	delete iAppView;
+	}
+
+//             Called by the UI framework when a command has been issued.
+//             In this example, a command can originate through a 
+//             hot-key press or by selection of a menu item.
+//             The command Ids are defined in the .hrh file
+//             and are 'connected' to the hot-key and menu item in the
+//             resource file.
+//             Note that the EEikCmdExit is defined by the UI
+//             framework and is pulled in by including eikon.hrh
+//
+void CExampleAppUi::HandleCommandL(TInt aCommand)
+	{
+	switch (aCommand)
+		{
+		      // Just issue simple info messages to show that
+		      // the menu items have been selected
+	case EExampleItem0:
+		iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM0);
+		break;
+
+	
+	case EExampleItem1:
+		iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM1);
+		break;
+	
+	case EExampleItem2:
+		iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM2);
+		break;
+               // Exit the application. The call is
+		       // implemented by the UI framework.
+
+	case EEikCmdExit: 
+		Exit();
+		break;
+		}
+	}
+
+TBool CExampleAppUi::ProcessCommandParametersL(CApaCommandLine& aCommandLine)
+	{
+	iParentProcessId=aCommandLine.ParentProcessId();
+	CompParentPidL();
+	return CEikAppUi::ProcessCommandParametersL(aCommandLine);
+	}
+
+
+void CExampleAppUi::CompParentPidL()
+	{
+	TInt val;
+	TInt ret;
+	ret = User::GetTIntParameter(12, val);
+	if(ret == KErrNone)
+		{
+		User::LeaveIfError(iFs.Connect());
+		TInt err = iFile.Create(iFs,KFilePath,EFileWrite | EFileShareAny);
+		if(err == KErrAlreadyExists)
+			{
+			iFile.Open(iFs,KFilePath,EFileWrite | EFileShareAny);
+			}
+
+		if(val == iParentProcessId.Id())
+			{
+			iFile.Write(KTPass);	
+			}
+		else
+			{
+			iFile.Write(KTFail);
+			}
+		iFile.Close();
+		iFs.Close();
+		}
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleDocument : public CEikDocument
+	{
+public:
+	static CExampleDocument* NewL(CEikApplication& aApp);
+	CExampleDocument(CEikApplication& aApp);
+	void ConstructL();
+private: 
+	           // Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+//             The constructor of the document class just passes the
+//             supplied reference to the constructor initialisation list.
+//             The document has no real work to do in this application.
+//
+CExampleDocument::CExampleDocument(CEikApplication& aApp)
+		: CEikDocument(aApp)
+	{
+	}
+
+
+//             This is called by the UI framework as soon as the 
+//             document has been created. It creates an instance
+//             of the ApplicationUI. The Application UI class is
+//             an instance of a CEikAppUi derived class.
+//
+CEikAppUi* CExampleDocument::CreateAppUiL()
+	{
+    return new(ELeave) CExampleAppUi;
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+class CExampleApplication : public CEikApplication
+	{
+private: 
+	           // Inherited from class CApaApplication
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+	};
+
+const TUid KUidChildIII = { 0x10207f86 }; 
+
+//             The function is called by the UI framework to ask for the
+//             application's UID. The returned value is defined by the
+//             constant KUidChildIIIe and must match the second value
+//             defined in the project definition file.
+// 
+TUid CExampleApplication::AppDllUid() const
+	{
+	return KUidChildIII;
+	}
+
+//             This function is called by the UI framework at
+//             application start-up. It creates an instance of the
+//             document class.
+//
+
+CApaDocument* CExampleApplication::CreateDocumentL()
+	{
+	return new (ELeave) CExampleDocument(*this);
+	}
+//             The entry point for the application code. It creates
+//             an instance of the CApaApplication derived
+//             class, CExampleApplication.
+//
+
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CExampleApplication;
+	}
+	
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication(NewApplication);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ChildIII_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,33 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+#include <ChildIII.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10207f86 // application UID
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file = "ChildIII";
+	localisable_resource_file = "\\resource\\apps\\ChildIII";
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ChildII_Main.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,305 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// A simple application containing a single view with the text "Child II !" drawn on it.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <coeccntx.h>
+
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+#include <eikstart.h>
+
+#include <eikon.hrh>
+
+#include <ChildII.rsg>
+#include "ChildII.hrh"
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppView
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppView : public CCoeControl
+    {
+public:
+	static CExampleAppView* NewL(const TRect& aRect);
+	CExampleAppView();
+	~CExampleAppView();
+    void ConstructL(const TRect& aRect);
+
+private:
+	           // Inherited from CCoeControl
+	void Draw(const TRect& /*aRect*/) const;
+
+private:
+	HBufC*  iExampleText;
+    };
+
+//
+//             Constructor for the view.
+//
+CExampleAppView::CExampleAppView()
+	{
+	}
+
+//             Static NewL() function to start the standard two
+//             phase construction.
+//
+CExampleAppView* CExampleAppView::NewL(const TRect& aRect)
+	{
+	CExampleAppView* self = new(ELeave) CExampleAppView();
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect);
+	CleanupStack::Pop();
+	return self;
+	}
+
+
+//
+//             Destructor for the view.
+//
+CExampleAppView::~CExampleAppView()
+	{
+	delete iExampleText;
+	}
+
+
+//             Second phase construction.
+//
+void CExampleAppView::ConstructL(const TRect& aRect)
+    {
+			   // Fetch the text from the resource file.
+	iExampleText = iEikonEnv->AllocReadResourceL(R_EXAMPLE_TEXT_CHILDII);
+	           // Control is a window owning control
+	CreateWindowL();
+	           // Extent of the control. This is
+	           // the whole rectangle available to application.
+	           // The rectangle is passed to us from the application UI.
+	SetRect(aRect);
+			   // At this stage, the control is ready to draw so
+	           // we tell the UI framework by activating it.
+	ActivateL();
+	}
+
+
+//             Drawing the view - in this example, 
+//             consists of drawing a simple outline rectangle
+//             and then drawing the text in the middle.
+//             We use the Normal font supplied by the UI.
+//
+//             In this example, we don't use the redraw
+//             region because it's easier to redraw to
+//             the whole client area.
+//
+void CExampleAppView::Draw(const TRect& /*aRect*/) const
+	{
+               // Window graphics context
+	CWindowGc& gc = SystemGc();
+	           // Area in which we shall draw
+	TRect      drawRect = Rect();
+			   // Font used for drawing text
+	const CFont*     fontUsed;
+	
+	           // Start with a clear screen
+	gc.Clear();
+			   // Draw an outline rectangle (the default pen
+	           // and brush styles ensure this) slightly
+	           // smaller than the drawing area.
+	drawRect.Shrink(10,10);		   	
+	gc.DrawRect(drawRect);
+               // Use the title font supplied by the UI
+	fontUsed = iEikonEnv->TitleFont();
+	gc.UseFont(fontUsed);
+			   // Draw the text in the middle of the rectangle.
+	TInt   baselineOffset=(drawRect.Height() - fontUsed->HeightInPixels())/2; 
+	gc.DrawText(*iExampleText,drawRect,baselineOffset,CGraphicsContext::ECenter, 0);
+               // Finished using the font
+	gc.DiscardFont();
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppUi : public CEikAppUi
+    {
+public:
+    void ConstructL();
+	~CExampleAppUi();
+
+private:
+              // Inherirted from class CEikAppUi
+	void HandleCommandL(TInt aCommand);
+
+private:
+	CCoeControl* iAppView;
+	};
+
+//             The second phase constructor of the application UI class.
+//             The application UI creates and owns the one and only view.
+// 
+void CExampleAppUi::ConstructL()
+    {
+	           // BaseConstructL() completes the UI framework's
+	           // construction of the App UI.
+    BaseConstructL();
+	           // Create the single application view in which to
+	           // draw the text "Child II", passing into it
+	           // the rectangle available to it.
+	iAppView = CExampleAppView::NewL(ClientRect());
+	}
+
+
+//             The app Ui owns the two views and is. 
+//             therefore, responsible for destroying them
+//
+CExampleAppUi::~CExampleAppUi()
+	{
+	delete iAppView;
+	}
+
+
+//             Called by the UI framework when a command has been issued.
+//             In this example, a command can originate through a 
+//             hot-key press or by selection of a menu item.
+//             The command Ids are defined in the .hrh file
+//             and are 'connected' to the hot-key and menu item in the
+//             resource file.
+//             Note that the EEikCmdExit is defined by the UI
+//             framework and is pulled in by including eikon.hrh
+//
+void CExampleAppUi::HandleCommandL(TInt aCommand)
+	{
+	switch (aCommand)
+		{
+		      // Just issue simple info messages to show that
+		      // the menu items have been selected
+	case EExampleItem0:
+		iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM0);
+		break;
+
+	
+	case EExampleItem1:
+		iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM1);
+		break;
+	
+	case EExampleItem2:
+		iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM2);
+		break;
+               // Exit the application. The call is
+		       // implemented by the UI framework.
+
+	case EEikCmdExit: 
+		Exit();
+		break;
+		}
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleDocument : public CEikDocument
+	{
+public:
+	static CExampleDocument* NewL(CEikApplication& aApp);
+	CExampleDocument(CEikApplication& aApp);
+	void ConstructL();
+private: 
+	           // Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+//             The constructor of the document class just passes the
+//             supplied reference to the constructor initialisation list.
+//             The document has no real work to do in this application.
+//
+CExampleDocument::CExampleDocument(CEikApplication& aApp)
+		: CEikDocument(aApp)
+	{
+	}
+
+
+//             This is called by the UI framework as soon as the 
+//             document has been created. It creates an instance
+//             of the ApplicationUI. The Application UI class is
+//             an instance of a CEikAppUi derived class.
+//
+CEikAppUi* CExampleDocument::CreateAppUiL()
+	{
+    return new(ELeave) CExampleAppUi;
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+class CExampleApplication : public CEikApplication
+	{
+private: 
+	           // Inherited from class CApaApplication
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+	};
+
+const TUid KUidChildII = { 0X10207f85 }; 
+
+//             The function is called by the UI framework to ask for the
+//             application's UID. The returned value is defined by the
+//             constant KUidChildIIe and must match the second value
+//             defined in the project definition file.
+// 
+TUid CExampleApplication::AppDllUid() const
+	{
+	return KUidChildII;
+	}
+
+//             This function is called by the UI framework at
+//             application start-up. It creates an instance of the
+//             document class.
+//
+CApaDocument* CExampleApplication::CreateDocumentL()
+	{
+	return new (ELeave) CExampleDocument(*this);
+	}
+
+//             The entry point for the application code. It creates
+//             an instance of the CApaApplication derived
+//             class, CExampleApplication.
+//
+
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CExampleApplication;
+	}
+	
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication(NewApplication);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ChildII_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+#include <ChildII.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10207f85 // application UID
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file = "ChildII";
+	localisable_resource_file = "\\resource\\apps\\ChildII";
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ChildI_Main.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,309 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// A simple application containing a single view with the text "Child I !" drawn on it.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <coeccntx.h>
+
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+#include <eikstart.h>
+
+#include <eikon.hrh>
+//#include <apparctestserver.h>
+
+#include <ChildI.rsg>
+#include "ChildI.hrh"
+//#include "T_ProcStep.h"
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppView
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppView : public CCoeControl
+    {
+public:
+	static CExampleAppView* NewL(const TRect& aRect);
+	CExampleAppView();
+	~CExampleAppView();
+    void ConstructL(const TRect& aRect);
+
+private:
+	           // Inherited from CCoeControl
+	void Draw(const TRect& /*aRect*/) const;
+
+private:
+	HBufC*  iExampleText;
+    };
+
+
+//
+//             Constructor for the view.
+//
+CExampleAppView::CExampleAppView()
+	{
+	}
+
+
+//             Static NewL() function to start the standard two
+//             phase construction.
+//
+CExampleAppView* CExampleAppView::NewL(const TRect& aRect)
+	{
+	CExampleAppView* self = new(ELeave) CExampleAppView();
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect);
+	CleanupStack::Pop();
+	return self;
+	}
+
+
+//
+//             Destructor for the view.
+//
+CExampleAppView::~CExampleAppView()
+	{
+	delete iExampleText;
+	}
+
+
+//             Second phase construction.
+//
+void CExampleAppView::ConstructL(const TRect& aRect)
+    {
+			   // Fetch the text from the resource file.
+	iExampleText = iEikonEnv->AllocReadResourceL(R_EXAMPLE_TEXT_CHILDI);
+	           // Control is a window owning control
+	CreateWindowL();
+	           // Extent of the control. This is
+	           // the whole rectangle available to application.
+	           // The rectangle is passed to us from the application UI.
+	SetRect(aRect);
+			   // At this stage, the control is ready to draw so
+	           // we tell the UI framework by activating it.
+	ActivateL();
+
+	}
+
+
+//             Drawing the view - in this example, 
+//             consists of drawing a simple outline rectangle
+//             and then drawing the text in the middle.
+//             We use the Normal font supplied by the UI.
+//
+//             In this example, we don't use the redraw
+//             region because it's easier to redraw to
+//             the whole client area.
+//
+void CExampleAppView::Draw(const TRect& /*aRect*/) const
+	{
+               // Window graphics context
+	CWindowGc& gc = SystemGc();
+	           // Area in which we shall draw
+	TRect      drawRect = Rect();
+			   // Font used for drawing text
+	const CFont*     fontUsed;
+	
+	           // Start with a clear screen
+	gc.Clear();
+			   // Draw an outline rectangle (the default pen
+	           // and brush styles ensure this) slightly
+	           // smaller than the drawing area.
+	drawRect.Shrink(10,10);		   	
+	gc.DrawRect(drawRect);
+               // Use the title font supplied by the UI
+	fontUsed = iEikonEnv->TitleFont();
+	gc.UseFont(fontUsed);
+			   // Draw the text in the middle of the rectangle.
+	TInt   baselineOffset=(drawRect.Height() - fontUsed->HeightInPixels())/2; 
+	gc.DrawText(*iExampleText,drawRect,baselineOffset,CGraphicsContext::ECenter, 0);
+               // Finished using the font
+	gc.DiscardFont();
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppUi : public CEikAppUi
+    {
+public:
+    void ConstructL();
+	~CExampleAppUi();
+
+private:
+              // Inherirted from class CEikAppUi
+	void HandleCommandL(TInt aCommand);
+
+private:
+	CCoeControl* iAppView;
+	};
+
+
+//             The second phase constructor of the application UI class.
+//             The application UI creates and owns the one and only view.
+// 
+void CExampleAppUi::ConstructL()
+    {
+	           // BaseConstructL() completes the UI framework's
+	           // construction of the App UI.
+    BaseConstructL();
+	           // Create the single application view in which to
+	           // draw the text "Child Process I !", passing into it
+	           // the rectangle available to it.
+	iAppView = CExampleAppView::NewL(ClientRect());
+	}
+
+
+//             The app Ui owns the two views and is. 
+//             therefore, responsible for destroying them
+//
+CExampleAppUi::~CExampleAppUi()
+	{
+	delete iAppView;
+	}
+
+
+//             Called by the UI framework when a command has been issued.
+//             In this example, a command can originate through a 
+//             hot-key press or by selection of a menu item.
+//             The command Ids are defined in the .hrh file
+//             and are 'connected' to the hot-key and menu item in the
+//             resource file.
+//             Note that the EEikCmdExit is defined by the UI
+//             framework and is pulled in by including eikon.hrh
+//
+void CExampleAppUi::HandleCommandL(TInt aCommand)
+	{
+	switch (aCommand)
+		{
+		      // Just issue simple info messages to show that
+		      // the menu items have been selected
+	case EExampleItem0:
+		iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM0);
+		break;
+
+	
+	case EExampleItem1:
+		iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM1);
+		break;
+	
+	case EExampleItem2:
+		iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM2);
+		break;
+               // Exit the application. The call is
+		       // implemented by the UI framework.
+
+	case EEikCmdExit: 
+		Exit();
+		break;
+		}
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleDocument
+//
+////////////////////////////////////////////////////////////////////////
+
+class CExampleDocument : public CEikDocument
+	{
+public:
+	static CExampleDocument* NewL(CEikApplication& aApp);
+	CExampleDocument(CEikApplication& aApp);
+	void ConstructL();
+private: 
+	           // Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+//             The constructor of the document class just passes the
+//             supplied reference to the constructor initialisation list.
+//             The document has no real work to do in this application.
+//
+CExampleDocument::CExampleDocument(CEikApplication& aApp)
+		: CEikDocument(aApp)
+	{
+	}
+
+//             This is called by the UI framework as soon as the 
+//             document has been created. It creates an instance
+//             of the ApplicationUI. The Application UI class is
+//             an instance of a CEikAppUi derived class.
+//
+CEikAppUi* CExampleDocument::CreateAppUiL()
+	{
+    return new(ELeave) CExampleAppUi;
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+//             The entry point for the application code. It creates
+//             an instance of the CApaApplication derived
+//             class, CExampleApplication.
+//
+class CExampleApplication : public CEikApplication
+	{
+private: 
+	           // Inherited from class CApaApplication
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+	};
+
+const TUid KUidChildI = { 0X10207f84 }; 
+
+//             The function is called by the UI framework to ask for the
+//             application's UID. The returned value is defined by the
+//             constant KUidChildIe and must match the second value
+//             defined in the project definition file.
+// 
+TUid CExampleApplication::AppDllUid() const
+	{
+	return KUidChildI;
+	}
+
+//             This function is called by the UI framework at
+//             application start-up. It creates an instance of the
+//             document class.
+//
+
+CApaDocument* CExampleApplication::CreateDocumentL()
+	{
+	return new (ELeave) CExampleDocument(*this);
+	}
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CExampleApplication;
+	}
+	
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication(NewApplication);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ChildI_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+#include <ChildI.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10207f84 // application UID
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file = "ChildI";
+	localisable_resource_file = "\\resource\\apps\\ChildI";
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/CustomiseDefaultIconApp_loc.RSS	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,45 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file CustomiseDefaultIconApp_loc.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+NAME SER1
+
+#include <uikon.rh>
+#include <appinfo.rh>
+ 
+RESOURCE RSS_SIGNATURE				{ }
+
+RESOURCE LOCALISABLE_APP_INFO r_lai
+	{
+	short_caption = "CustomiseDefaultIconApp";
+	caption_and_icon =
+		{
+		CAPTION_AND_ICON_INFO
+			{
+			caption = "CustomiseDefaultIconAppLong";
+			number_of_icons = 0;
+			}
+		};			
+
+
+
+
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/CustomiseDefaultIconApp_reg.RSS	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,37 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file CustomiseDefaultIconApp_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+#include <CustomiseDefaultIconApp_loc.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10208181 // UID of the application this registration file represents
+
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="CustomiseDefaultIconApp";
+	
+	localisable_resource_file="\\resource\\apps\\CustomiseDefaultIconApp_loc";
+	localisable_resource_id=R_LAI;
+		
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/M_CTRL.hrh	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,22 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+enum TExampleMenuCommands
+	{
+	EExampleItem0 = 200,
+	EExampleItem1,
+	EExampleItem2
+	};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/M_CTRL.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,73 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file M_Ctrl.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+NAME MCTL
+
+#include <eikon.rh>
+#include <eikcore.rsg>
+
+#include "M_CTRL.hrh"
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+	{
+	hotkeys=r_example_hotkeys;
+	menubar=r_example_menubar;
+	}
+
+
+
+RESOURCE HOTKEYS r_example_hotkeys
+    {
+    control=
+        {
+        HOTKEY { command=EEikCmdExit; key='e'; }
+        };
+    }
+
+RESOURCE MENU_BAR r_example_menubar
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_example_first_menu; txt="M_CTRL"; }
+		};
+    }
+
+RESOURCE MENU_PANE r_example_first_menu
+	{
+	items=
+		{
+		MENU_ITEM { command=EExampleItem0; txt="Item 0"; },
+		MENU_ITEM { command=EExampleItem1; txt="Item 1"; },
+		MENU_ITEM { command=EExampleItem2; txt="Item 2"; },
+		MENU_ITEM { command=EEikCmdExit; txt="Close"; }
+        };
+    }
+
+
+RESOURCE TBUF r_example_text_Title { buf="M_CTRL Control Plugin App"; }
+RESOURCE TBUF r_example_text_Item0 { buf="Item 0"; }
+RESOURCE TBUF r_example_text_Item1 { buf="Item 1"; }
+RESOURCE TBUF r_example_text_Item2 { buf="Item 2"; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/M_CTRL_V2.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,264 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+#include <e32uid.h>
+#include <e32base.h>
+#include <e32test.h>
+#include <apgctl.h>
+
+#include <eikdll.h>
+#include <coeccntx.h>
+#include <apgtask.h>
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+#include <apgcli.h>
+
+#include <eikon.hrh>
+//#include "appfwk_test_AppUi.h"
+
+#include <M_CTRL.rsg>
+#include "M_CTRL.hrh"
+#include <EIKDLL.H>
+#include <eikstart.h>
+
+
+//const TInt KMinimalControlUidValue=98;
+//const TInt KMinimalControlUidValue=0x13008AEE;	//Changed in m_ctrl.mmp file
+
+//_LIT(KGlobalSemaphore, "GlobalSemaphore");
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppView
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppView : public CCoeControl
+    {
+public:
+	static CExampleAppView* NewL(const TRect& aRect);
+	CExampleAppView();
+	~CExampleAppView();
+    void ConstructL(const TRect& aRect);
+
+private:
+	           // Inherited from CCoeControl
+	void Draw(const TRect& /*aRect*/) const;
+
+private:
+	HBufC*  iExampleText;
+    };
+
+CExampleAppView::CExampleAppView()
+	{
+	}
+
+CExampleAppView* CExampleAppView::NewL(const TRect& aRect)
+	{
+	CExampleAppView* self = new(ELeave) CExampleAppView();
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect);
+	CleanupStack::Pop();
+	return self;
+	}
+
+CExampleAppView::~CExampleAppView()
+	{
+	delete iExampleText;
+	}
+
+void CExampleAppView::ConstructL(const TRect& aRect)
+    {
+	iExampleText = iEikonEnv->AllocReadResourceL(R_EXAMPLE_TEXT_TITLE);
+	CreateWindowL();
+	SetRect(aRect);
+	ActivateL();
+	}
+
+void CExampleAppView::Draw(const TRect& /*aRect*/) const
+	{
+	CWindowGc& gc = SystemGc();
+	TRect      drawRect = Rect();
+	const CFont*     fontUsed;
+	
+	gc.Clear();
+  	fontUsed = iEikonEnv->TitleFont();
+	gc.UseFont(fontUsed);
+	TInt   baselineOffset=(drawRect.Height() - fontUsed->HeightInPixels())/2; 
+	gc.DrawText(*iExampleText,drawRect,baselineOffset,CGraphicsContext::ECenter, 0);
+	gc.DiscardFont();
+	}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppUi : public CEikAppUi
+    {
+public:
+    void ConstructL();
+	~CExampleAppUi();
+private:
+              // Inherirted from class CEikAppUi
+	void HandleCommandL(TInt aCommand);
+
+	// From CCoeAppUi
+	void HandleSystemEventL(const TWsEvent& aEvent);
+
+private:
+	CCoeControl* iAppView;
+	};
+
+
+void CExampleAppUi::ConstructL()
+    {
+    BaseConstructL();
+	iAppView = CExampleAppView::NewL(ClientRect());
+	}
+
+CExampleAppUi::~CExampleAppUi()
+	{
+	delete iAppView;
+	}
+
+void CExampleAppUi::HandleCommandL(TInt aCommand)
+	{
+	switch (aCommand)
+		{
+	// Just issue simple info messages to show that
+	// the menu items have been selected
+	case EExampleItem0:
+		iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM0);
+		break;
+
+	case EExampleItem1:
+		iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM1);
+		break;
+	
+	case EExampleItem2:
+		iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM2);
+		break;
+	case EEikCmdExit: 
+		Exit();
+		break;
+		}
+	}
+
+
+void CExampleAppUi::HandleSystemEventL(const TWsEvent& /*aEvent*/)
+	{
+/*
+	RSemaphore semaphore;
+	
+	switch (*(TApaSystemEvent*)(aEvent.EventData()))
+		{
+
+		case EApaSystemEventBroughtToForeground:
+			{	
+			semaphore.OpenGlobal(KGlobalSemaphore);
+			semaphore.Signal();
+			semaphore.Close();
+            break;
+			}
+         default:
+			break;
+			}	
+*/
+	}
+
+
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleDocument : public CEikDocument
+	{
+public:
+	static CExampleDocument* NewL(CEikApplication& aApp);
+	CExampleDocument(CEikApplication& aApp);
+	void ConstructL();
+private: 
+	           // Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+CExampleDocument::CExampleDocument(CEikApplication& aApp)
+		: CEikDocument(aApp)
+	{
+	}
+
+CEikAppUi* CExampleDocument::CreateAppUiL()
+	{
+    return new(ELeave) CExampleAppUi;
+	}
+
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+class CExampleApplication : public CEikApplication
+	{
+private: 
+	           // Inherited from class CApaApplication
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+private:
+	CApaDocument* CreateDocumentL(CApaProcess* a) { return CEikApplication::CreateDocumentL(a); }
+	//
+	};
+
+const TUid KUidSimpleApp = { 0x13008AEE }; 
+
+TUid CExampleApplication::AppDllUid() const
+	{
+	return KUidSimpleApp;
+	}
+
+CApaDocument* CExampleApplication::CreateDocumentL()
+	{
+	return new (ELeave) CExampleDocument(*this);
+	}
+
+
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CExampleApplication;
+	}
+	
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication(NewApplication);
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/M_CTRL_loc.RSS	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,36 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file M_Ctrl_loc.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include<appinfo.rh>
+RESOURCE LOCALISABLE_APP_INFO
+	{
+	short_caption="m_ctrl";
+	caption_and_icon=
+		{
+		CAPTION_AND_ICON_INFO
+			{
+			caption="m_ctrl";
+			//number_of_icons=1;
+			//icon_file="Z:\\Resource\\Apps\\M_CTRL.MBM";
+			}
+		};
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/M_CTRL_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,32 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file M_Ctrl_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x13008AEE
+RESOURCE APP_REGISTRATION_INFO
+	{	
+	app_file = "M_CTRL";
+	attributes=KAppIsControlPanelItem;
+	localisable_resource_file="\\Resource\\Apps\\M_ctrl_loc";
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ParentProcess.hrh	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,28 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+enum TExampleMenuCommands
+	{
+	EExampleItem0 = 200,
+	EExampleItem1,
+	EExampleItem2
+	};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ParentProcess.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,50 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <platform_paths.hrh>
+
+TARGET        	ParentProcess.exe	
+TARGETTYPE   	exe
+UID           	0x100039CE 0x10207f87
+VENDORID 	0x70000001
+SOURCEPATH    	.
+SOURCE        	ParentProcess_Main.cpp
+USERINCLUDE   	.
+SYSTEMINCLUDE 	/epoc32/include
+SYSTEMINCLUDE 	/epoc32/include/techview
+
+MW_LAYER_SYSTEMINCLUDE
+
+START RESOURCE	ParentProcess.RSS
+HEADER
+TARGETPATH	/Resource/Apps
+end
+
+START RESOURCE	ParentProcess_reg.rss
+TARGETPATH	/private/10003a3f/apps
+END
+
+LIBRARY       	APPARC.LIB
+LIBRARY       	CONE.LIB 
+LIBRARY       	EIKCORE.LIB 
+LIBRARY       	EUSER.LIB
+LIBRARY       	GDI.LIB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ParentProcess.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,71 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+NAME HEWO
+
+#include <eikon.rh>
+#include <eikcore.rsg>
+#include <appinfo.rh>
+
+#include "ParentProcess.hrh"
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+	{
+	hotkeys=r_example_hotkeys;
+	menubar=r_example_menubar;
+	}
+
+RESOURCE HOTKEYS r_example_hotkeys
+    {
+    control=
+        {
+        HOTKEY { command=EEikCmdExit; key='e'; }
+        };
+    }
+
+RESOURCE MENU_BAR r_example_menubar
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_example_first_menu; txt="ParentPr"; }
+		};
+    }
+
+RESOURCE MENU_PANE r_example_first_menu
+	{
+	items=
+		{
+		MENU_ITEM { command=EExampleItem0; txt="Item 0"; },
+		MENU_ITEM { command=EExampleItem1; txt="Item 1"; },
+		MENU_ITEM { command=EExampleItem2; txt="Item 2"; },
+		MENU_ITEM { command=EEikCmdExit; txt="Close"; }
+        };
+    }
+
+RESOURCE TBUF r_example_text_ParentProc { buf="Parent Process!"; }
+RESOURCE TBUF r_example_text_Item0 { buf="Item 0"; }
+RESOURCE TBUF r_example_text_Item1 { buf="Item 1"; }
+RESOURCE TBUF r_example_text_Item2 { buf="Item 2"; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ParentProcess_Main.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,309 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// A simple application containing a single view with the text "Parent Process !" drawn on it.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <coeccntx.h>
+
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+#include <eikstart.h>
+
+#include <eikon.hrh>
+
+#include <ParentProcess.rsg>
+#include "ParentProcess.hrh"
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppView
+//										
+////////////////////////////////////////////////////////////////////////
+
+class CExampleAppView : public CCoeControl
+    {
+public:
+	static CExampleAppView* NewL(const TRect& aRect);
+	CExampleAppView();
+	~CExampleAppView();
+    void ConstructL(const TRect& aRect);
+
+private:
+	           // Inherited from CCoeControl
+	void Draw(const TRect& /*aRect*/) const;
+
+private:
+	HBufC*  iExampleText;
+    };
+    
+//
+//             Constructor for the view.
+//
+CExampleAppView::CExampleAppView()
+	{
+	}
+
+
+//             Static NewL() function to start the standard two
+//             phase construction.
+//
+CExampleAppView* CExampleAppView::NewL(const TRect& aRect)
+	{
+	CExampleAppView* self = new(ELeave) CExampleAppView();
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect);
+	CleanupStack::Pop();
+	return self;
+	}
+
+
+//
+//             Destructor for the view.
+//
+CExampleAppView::~CExampleAppView()
+	{
+	delete iExampleText;
+	}
+
+
+//             Second phase construction.
+//
+void CExampleAppView::ConstructL(const TRect& aRect)
+    {
+			   // Fetch the text from the resource file.
+	iExampleText = iEikonEnv->AllocReadResourceL(R_EXAMPLE_TEXT_PARENTPROC);
+	           // Control is a window owning control
+	CreateWindowL();
+	           // Extent of the control. This is
+	           // the whole rectangle available to application.
+	           // The rectangle is passed to us from the application UI.
+	SetRect(aRect);
+			   // At this stage, the control is ready to draw so
+	           // we tell the UI framework by activating it.
+	ActivateL();
+	}
+
+
+//             Drawing the view - in this example, 
+//             consists of drawing a simple outline rectangle
+//             and then drawing the text in the middle.
+//             We use the Normal font supplied by the UI.
+//
+//             In this example, we don't use the redraw
+//             region because it's easier to redraw to
+//             the whole client area.
+//
+void CExampleAppView::Draw(const TRect& /*aRect*/) const
+	{
+               // Window graphics context
+	CWindowGc& gc = SystemGc();
+	           // Area in which we shall draw
+	TRect      drawRect = Rect();
+			   // Font used for drawing text
+	const CFont*     fontUsed;
+	
+	           // Start with a clear screen
+	gc.Clear();
+			   // Draw an outline rectangle (the default pen
+	           // and brush styles ensure this) slightly
+	           // smaller than the drawing area.
+	drawRect.Shrink(10,10);		   	
+	gc.DrawRect(drawRect);
+               // Use the title font supplied by the UI
+	fontUsed = iEikonEnv->TitleFont();
+	gc.UseFont(fontUsed);
+			   // Draw the text in the middle of the rectangle.
+	TInt   baselineOffset=(drawRect.Height() - fontUsed->HeightInPixels())/2; 
+	gc.DrawText(*iExampleText,drawRect,baselineOffset,CGraphicsContext::ECenter, 0);
+               // Finished using the font
+	gc.DiscardFont();
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppUi
+//
+////////////////////////////////////////////////////////////////////////
+
+class CExampleAppUi : public CEikAppUi
+    {
+public:
+    void ConstructL();
+	~CExampleAppUi();
+
+private:
+              // Inherirted from class CEikAppUi
+	void HandleCommandL(TInt aCommand);
+
+private:
+	CCoeControl* iAppView;
+	};
+
+//             The second phase constructor of the application UI class.
+//             The application UI creates and owns the one and only view.
+// 
+void CExampleAppUi::ConstructL()
+    {
+	           // BaseConstructL() completes the UI framework's
+	           // construction of the App UI.
+    BaseConstructL();
+	           // Create the single application view in which to
+	           // draw the text "Parent Process !", passing into it
+	           // the rectangle available to it.
+	iAppView = CExampleAppView::NewL(ClientRect());
+	}
+
+
+//             The app Ui owns the two views and is. 
+//             therefore, responsible for destroying them
+//
+CExampleAppUi::~CExampleAppUi()
+	{
+	delete iAppView;
+	}
+
+
+//             Called by the UI framework when a command has been issued.
+//             In this example, a command can originate through a 
+//             hot-key press or by selection of a menu item.
+//             The command Ids are defined in the .hrh file
+//             and are 'connected' to the hot-key and menu item in the
+//             resource file.
+//             Note that the EEikCmdExit is defined by the UI
+//             framework and is pulled in by including eikon.hrh
+//
+void CExampleAppUi::HandleCommandL(TInt aCommand)
+	{
+	switch (aCommand)
+		{
+		      // Just issue simple info messages to show that
+		      // the menu items have been selected
+	case EExampleItem0:
+		iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM0);
+		break;
+
+	
+	case EExampleItem1:
+		iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM1);
+		break;
+	
+	case EExampleItem2:
+		iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM2);
+		break;
+               // Exit the application. The call is
+		       // implemented by the UI framework.
+
+	case EEikCmdExit: 
+		Exit();
+		break;
+		}
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleDocument
+//
+////////////////////////////////////////////////////////////////////////
+
+class CExampleDocument : public CEikDocument
+	{
+public:
+	static CExampleDocument* NewL(CEikApplication& aApp);
+	CExampleDocument(CEikApplication& aApp);
+	void ConstructL();
+private: 
+	           // Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+//             The constructor of the document class just passes the
+//             supplied reference to the constructor initialisation list.
+//             The document has no real work to do in this application.
+//
+CExampleDocument::CExampleDocument(CEikApplication& aApp)
+		: CEikDocument(aApp)
+	{
+	}
+
+
+//             This is called by the UI framework as soon as the 
+//             document has been created. It creates an instance
+//             of the ApplicationUI. The Application UI class is
+//             an instance of a CEikAppUi derived class.
+//
+CEikAppUi* CExampleDocument::CreateAppUiL()
+	{
+    return new(ELeave) CExampleAppUi;
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+class CExampleApplication : public CEikApplication
+	{
+private: 
+	           // Inherited from class CApaApplication
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+	};
+
+//             The entry point for the application code. It creates
+//             an instance of the CApaApplication derived
+//             class, CExampleApplication.
+//
+
+const TUid KUidParentProcess = { 0x10207f87 }; 
+
+//             The function is called by the UI framework to ask for the
+//             application's UID. The returned value is defined by the
+//             constant KUidParentProcess and must match the second value
+//             defined in the project definition file.
+// 
+TUid CExampleApplication::AppDllUid() const
+	{
+	return KUidParentProcess;
+	}
+
+//             This function is called by the UI framework at
+//             application start-up. It creates an instance of the
+//             document class.
+//
+CApaDocument* CExampleApplication::CreateDocumentL()
+	{
+	return new (ELeave) CExampleDocument(*this);
+	}
+
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CExampleApplication;
+	}
+	
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication(NewApplication);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ParentProcess_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+#include <ParentProcess.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10207f87 // application UID
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file = "ParentProcess";
+	localisable_resource_file = "\\resource\\apps\\ParentProcess";	
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/SimpleApparcTestApp.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,254 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is a support app used by apparc\tsrc\t_foreground
+// Test for UIKON GT0143 Typhoon Work Series 60 Changes
+// REQ758.8: Change TApaTask::BringToForeground to send a 
+// EApaSystemEventBroughtToForeground to the relevant window group
+// t_foreground sends a window server message to this app, this 
+// message is handled in CExampleAppUi::HandleSystemEventL
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+
+
+#include <coeccntx.h>
+
+#include <apgtask.h>
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+
+#include <eikon.hrh>
+
+#include <SimpleApparcTestApp.rsg>
+#include "SimpleApparcTestApp.hrh"
+
+#include <eikstart.h>
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppView
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppView : public CCoeControl
+    {
+public:
+	static CExampleAppView* NewL(const TRect& aRect);
+	CExampleAppView();
+	~CExampleAppView();
+    void ConstructL(const TRect& aRect);
+
+private:
+	           // Inherited from CCoeControl
+	void Draw(const TRect& /*aRect*/) const;
+
+private:
+	HBufC*  iExampleText;
+    };
+
+CExampleAppView::CExampleAppView()
+	{
+	}
+
+CExampleAppView* CExampleAppView::NewL(const TRect& aRect)
+	{
+	CExampleAppView* self = new(ELeave) CExampleAppView();
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect);
+	CleanupStack::Pop();
+	return self;
+	}
+
+CExampleAppView::~CExampleAppView()
+	{
+	delete iExampleText;
+	}
+
+void CExampleAppView::ConstructL(const TRect& aRect)
+    {
+	iExampleText = iEikonEnv->AllocReadResourceL(R_EXAMPLE_TEXT_TITLE);
+	CreateWindowL();
+	SetRect(aRect);
+	ActivateL();
+	}
+
+void CExampleAppView::Draw(const TRect& /*aRect*/) const
+	{
+	CWindowGc& gc = SystemGc();
+	TRect      drawRect = Rect();
+	const CFont*     fontUsed;
+	
+	gc.Clear();
+  	fontUsed = iEikonEnv->TitleFont();
+	gc.UseFont(fontUsed);
+	TInt   baselineOffset=(drawRect.Height() - fontUsed->HeightInPixels())/2; 
+	gc.DrawText(*iExampleText,drawRect,baselineOffset,CGraphicsContext::ECenter, 0);
+	gc.DiscardFont();
+	}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppUi : public CEikAppUi
+    {
+public:
+    void ConstructL();
+	~CExampleAppUi();
+
+private:
+              // Inherirted from class CEikAppUi
+	void HandleCommandL(TInt aCommand);
+
+	// From CCoeAppUi
+	void HandleSystemEventL(const TWsEvent& aEvent);
+
+private:
+	CCoeControl* iAppView;
+	};
+
+
+void CExampleAppUi::ConstructL()
+    {
+    BaseConstructL();
+	iAppView = CExampleAppView::NewL(ClientRect());
+	}
+
+CExampleAppUi::~CExampleAppUi()
+	{
+	delete iAppView;
+	}
+
+void CExampleAppUi::HandleCommandL(TInt aCommand)
+	{
+	switch (aCommand)
+		{
+		      // Just issue simple info messages to show that
+		      // the menu items have been selected
+	case EExampleItem0:
+		iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM0);
+		break;
+
+	
+	case EExampleItem1:
+		iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM1);
+		break;
+	
+	case EExampleItem2:
+		iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM2);
+		break;
+	case EEikCmdExit: 
+		Exit();
+		break;
+		}
+	}
+
+
+void CExampleAppUi::HandleSystemEventL(const TWsEvent& aEvent)
+	{
+	switch (*(TApaSystemEvent*)(aEvent.EventData()))
+		{
+		case EApaSystemEventBroughtToForeground:
+			RProcess::Rendezvous(KErrNone);
+			break;
+         default:
+			break;
+		}	
+	}
+
+
+
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleDocument : public CEikDocument
+	{
+public:
+	static CExampleDocument* NewL(CEikApplication& aApp);
+	CExampleDocument(CEikApplication& aApp);
+	void ConstructL();
+private: 
+	           // Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+CExampleDocument::CExampleDocument(CEikApplication& aApp)
+		: CEikDocument(aApp)
+	{
+	}
+
+CEikAppUi* CExampleDocument::CreateAppUiL()
+	{
+    return new(ELeave) CExampleAppUi;
+	}
+
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+class CExampleApplication : public CEikApplication
+	{
+private: 
+	           // Inherited from class CApaApplication
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+private:
+	CApaDocument* CreateDocumentL(CApaProcess* a) { return CEikApplication::CreateDocumentL(a); }
+	//
+	};
+
+const TUid KUidSimpleApparcTestApp = { 0X12008ACE }; 
+
+TUid CExampleApplication::AppDllUid() const
+	{
+	return KUidSimpleApparcTestApp;
+	}
+
+CApaDocument* CExampleApplication::CreateDocumentL()
+	{
+	return new (ELeave) CExampleDocument(*this);
+	}
+
+
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CExampleApplication;
+	}
+
+
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication(NewApplication);
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/SimpleApparcTestApp.hrh	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,22 @@
+// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+enum TExampleMenuCommands
+	{
+	EExampleItem0 = 200,
+	EExampleItem1,
+	EExampleItem2
+	};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/SimpleApparcTestApp.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,57 @@
+// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// using relative paths for sourcepath and user includes
+// 
+//
+
+#include <platform_paths.hrh>
+
+target		SimpleApparcTestApp.EXE
+TARGETTYPE 	exe
+	
+targetpath	/SYS/BIN
+UID           	0x100039CE 0x12008ACE
+VENDORID 	0x70000001
+CAPABILITY 	All -Tcb
+epocstacksize 	0x5000
+
+SOURCEPATH    	.
+SOURCE		SimpleApparcTestApp.cpp
+
+USERINCLUDE   	.
+SYSTEMINCLUDE 	/epoc32/include
+SYSTEMINCLUDE 	/epoc32/include/techview
+
+MW_LAYER_SYSTEMINCLUDE
+
+// Application exe specific resource which is localised to the application
+RESOURCE	SimpleApparcTestApp.rss
+start resource	SimpleApparcTestApp.rss
+targetpath	/resource/apps
+lang		sc
+end
+
+
+// Application exe registration resource file
+START RESOURCE	SimpleApparcTestApp_reg.rss
+TARGETPATH	/private/10003a3f/apps
+lang		sc
+END
+
+ 
+LIBRARY       	APPARC.LIB  
+LIBRARY       	CONE.LIB 
+LIBRARY       	EIKCORE.LIB
+LIBRARY       	EUSER.LIB 
+LIBRARY       	GDI.LIB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/SimpleApparcTestApp.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,74 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+
+NAME HEWO
+
+#include <eikon.rh>
+#include <eikcore.rsg>
+
+#include "SimpleApparcTestApp.hrh"
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+	{
+	hotkeys=r_example_hotkeys;
+	menubar=r_example_menubar;
+	}
+
+
+
+RESOURCE HOTKEYS r_example_hotkeys
+    {
+    control=
+        {
+        HOTKEY { command=EEikCmdExit; key='e'; }
+        };
+    }
+
+RESOURCE MENU_BAR r_example_menubar
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_example_first_menu; txt="SimpleApparcTestApp"; }
+		};
+    }
+
+RESOURCE MENU_PANE r_example_first_menu
+	{
+	items=
+		{
+		MENU_ITEM { command=EExampleItem0; txt="Item 0"; },
+		MENU_ITEM { command=EExampleItem1; txt="Item 1"; },
+		MENU_ITEM { command=EExampleItem2; txt="Item 2"; },
+		MENU_ITEM { command=EEikCmdExit; txt="Close"; }
+        };
+    }
+
+
+RESOURCE TBUF r_example_text_Title { buf="SimpleApparcTestApp used by T_Foreground"; }
+RESOURCE TBUF r_example_text_Item0 { buf="Item 0"; }
+RESOURCE TBUF r_example_text_Item1 { buf="Item 1"; }
+RESOURCE TBUF r_example_text_Item2 { buf="Item 2"; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/SimpleApparcTestApp_Reg.RSS	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,39 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+
+UID3 0x12008ACE // application UID
+
+RESOURCE APP_REGISTRATION_INFO 
+	{	
+
+	app_file = "SimpleApparcTestApp";
+
+	hidden = KAppNotHidden;
+	embeddability = KAppNotEmbeddable;
+	newfile = KAppDoesNotSupportNewFile;
+	}
+
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppEmbedUids.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,32 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#if (!defined __T_APP_EMBED_UIDS_H__)
+#define __T_APP_EMBED_UIDS_H__
+
+const TUid KUidAppNotEmbeddable				= { 0x10004c47 };
+const TUid KUidAppEmbeddable				= { 0x10004c48 };
+const TUid KUidAppEmbeddableOnly			= { 0x10004c49 };
+const TUid KUidAppEmbeddableUiOrStandAlone	= { 0x10004c4A };
+const TUid KUidAppEmbeddableUiNotStandAlone	= { 0x10004c4B };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppEmbeddable.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,231 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Supporting application for use by other test programs that need
+// to query the apparc server for applications which define
+// different embeddability values in their AIF files.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <coeccntx.h>
+
+#include <apgtask.h>
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+
+#include <ecom.h>
+#include <implementationproxy.h>
+
+#include "TAppEmbedUids.h"
+
+_LIT(KExampleText, "This test application defines KAppEmbeddable in it's AIF file");
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppView
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppView : public CCoeControl
+    {
+public:
+	static CExampleAppView* NewL(const TRect& aRect);
+	CExampleAppView();
+	~CExampleAppView();
+    void ConstructL(const TRect& aRect);
+
+private:
+	// from CCoeControl
+	void Draw(const TRect& /*aRect*/) const;
+private:
+	HBufC*  iExampleText;
+    };
+
+CExampleAppView::CExampleAppView()
+	{
+	}
+
+CExampleAppView* CExampleAppView::NewL(const TRect& aRect)
+	{
+	CExampleAppView* self = new(ELeave) CExampleAppView();
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect);
+	CleanupStack::Pop();
+	return self;
+	}
+
+CExampleAppView::~CExampleAppView()
+	{
+	delete iExampleText;
+	}
+
+void CExampleAppView::ConstructL(const TRect& aRect)
+    {
+	TPtrC ptr(KExampleText);
+	iExampleText = ptr.AllocL();
+	CreateWindowL();
+	SetRect(aRect);
+	ActivateL();
+	}
+
+void CExampleAppView::Draw(const TRect& /*aRect*/) const
+	{
+	CWindowGc& gc = SystemGc();
+	TRect      drawRect = Rect();
+	const CFont*     fontUsed;
+	
+	gc.Clear();
+  	fontUsed = iEikonEnv->TitleFont();
+	gc.UseFont(fontUsed);
+	TInt   baselineOffset=(drawRect.Height() - fontUsed->HeightInPixels())/2; 
+	gc.DrawText(*iExampleText,drawRect,baselineOffset,CGraphicsContext::ECenter, 0);
+	gc.DiscardFont();
+	}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppUi : public CEikAppUi
+    {
+public:
+    void ConstructL();
+	~CExampleAppUi();
+
+private:
+    // from CEikAppUi
+	void HandleCommandL(TInt aCommand);
+private:
+	CCoeControl* iAppView;
+	};
+
+
+void CExampleAppUi::ConstructL()
+    {
+    BaseConstructL(ENoAppResourceFile | ENoScreenFurniture);
+	iAppView = CExampleAppView::NewL(ClientRect());
+    HandleCommandL(EEikCmdExit);
+	}
+
+CExampleAppUi::~CExampleAppUi()
+	{
+	delete iAppView;
+	}
+
+void CExampleAppUi::HandleCommandL(TInt aCommand)
+	{
+	switch (aCommand)
+		{
+	case EEikCmdExit: 
+		Exit();
+		break;
+		}
+	}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleDocument : public CEikDocument
+	{
+public:
+	static CExampleDocument* NewL(CEikApplication& aApp);
+	CExampleDocument(CEikApplication& aApp);
+	void ConstructL();
+private: 
+	           // Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+CExampleDocument::CExampleDocument(CEikApplication& aApp)
+		: CEikDocument(aApp)
+	{
+	}
+
+CEikAppUi* CExampleDocument::CreateAppUiL()
+	{
+    return new(ELeave) CExampleAppUi;
+	}
+
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+class CExampleApplication : public CEikApplication
+	{
+private: 
+	// from CApaApplication
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+private:
+	TFileName ResourceFileName() const;
+private:
+	CApaDocument* CreateDocumentL(CApaProcess* a) { return CEikApplication::CreateDocumentL(a); }
+	//	
+	};
+
+CApaDocument* CExampleApplication::CreateDocumentL()
+	{
+	return new (ELeave) CExampleDocument(*this);
+	}
+
+TUid CExampleApplication::AppDllUid() const
+	{
+	return KUidAppEmbeddable;
+	}
+
+TFileName CExampleApplication::ResourceFileName() const
+{
+	return TFileName(); // this app doesn't have a resource file
+}
+
+
+GLDEF_C TInt E32Dll(
+					)
+	{
+	return KErrNone;
+	}
+
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CExampleApplication;
+	}
+
+LOCAL_D const TImplementationProxy ImplementationTable[]=
+	{
+	IMPLEMENTATION_PROXY_ENTRY(0x10004c48, NewApplication)
+	};
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+	{
+	aTableCount=sizeof(ImplementationTable)/sizeof(ImplementationTable[0]);
+	return ImplementationTable;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppEmbeddableOnly.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,231 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Supporting application for use by other test programs that need
+// to query the apparc server for applications which define
+// different embeddability values in their AIF files.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+
+#include <coeccntx.h>
+
+#include <apgtask.h>
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+
+#include <ecom.h>
+#include <implementationproxy.h>
+
+#include "TAppEmbedUids.h"
+
+_LIT(KExampleText, "This test application defines KAppEmbeddableOnly in it's AIF file");
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppView
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppView : public CCoeControl
+    {
+public:
+	static CExampleAppView* NewL(const TRect& aRect);
+	CExampleAppView();
+	~CExampleAppView();
+    void ConstructL(const TRect& aRect);
+
+private:
+	// from CCoeControl
+	void Draw(const TRect& /*aRect*/) const;
+private:
+	HBufC*  iExampleText;
+    };
+
+CExampleAppView::CExampleAppView()
+	{
+	}
+
+CExampleAppView* CExampleAppView::NewL(const TRect& aRect)
+	{
+	CExampleAppView* self = new(ELeave) CExampleAppView();
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect);
+	CleanupStack::Pop();
+	return self;
+	}
+
+CExampleAppView::~CExampleAppView()
+	{
+	delete iExampleText;
+	}
+
+void CExampleAppView::ConstructL(const TRect& aRect)
+    {
+	TPtrC ptr(KExampleText);
+	iExampleText = ptr.AllocL();
+	CreateWindowL();
+	SetRect(aRect);
+	ActivateL();
+	}
+
+void CExampleAppView::Draw(const TRect& /*aRect*/) const
+	{
+	CWindowGc& gc = SystemGc();
+	TRect      drawRect = Rect();
+	const CFont*     fontUsed;
+	
+	gc.Clear();
+  	fontUsed = iEikonEnv->TitleFont();
+	gc.UseFont(fontUsed);
+	TInt   baselineOffset=(drawRect.Height() - fontUsed->HeightInPixels())/2; 
+	gc.DrawText(*iExampleText,drawRect,baselineOffset,CGraphicsContext::ECenter, 0);
+	gc.DiscardFont();
+	}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppUi : public CEikAppUi
+    {
+public:
+    void ConstructL();
+	~CExampleAppUi();
+
+private:
+    // from CEikAppUi
+	void HandleCommandL(TInt aCommand);
+private:
+	CCoeControl* iAppView;
+	};
+
+
+void CExampleAppUi::ConstructL()
+    {
+    BaseConstructL(ENoAppResourceFile | ENoScreenFurniture);
+	iAppView = CExampleAppView::NewL(ClientRect());
+	}
+
+CExampleAppUi::~CExampleAppUi()
+	{
+	delete iAppView;
+	}
+
+void CExampleAppUi::HandleCommandL(TInt aCommand)
+	{
+	switch (aCommand)
+		{
+	case EEikCmdExit: 
+		Exit();
+		break;
+		}
+	}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleDocument : public CEikDocument
+	{
+public:
+	static CExampleDocument* NewL(CEikApplication& aApp);
+	CExampleDocument(CEikApplication& aApp);
+	void ConstructL();
+private: 
+	           // Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+CExampleDocument::CExampleDocument(CEikApplication& aApp)
+		: CEikDocument(aApp)
+	{
+	}
+
+CEikAppUi* CExampleDocument::CreateAppUiL()
+	{
+    return new(ELeave) CExampleAppUi;
+	}
+
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+class CExampleApplication : public CEikApplication
+	{
+private: 
+	// from CApaApplication
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+private:
+	TFileName ResourceFileName() const;
+private:
+	CApaDocument* CreateDocumentL(CApaProcess* a) { return CEikApplication::CreateDocumentL(a); }
+	//
+	};
+
+CApaDocument* CExampleApplication::CreateDocumentL()
+	{
+	return new (ELeave) CExampleDocument(*this);
+	}
+
+TUid CExampleApplication::AppDllUid() const
+	{
+	return KUidAppEmbeddableOnly;
+	}
+
+TFileName CExampleApplication::ResourceFileName() const
+{
+	return TFileName(); // this app doesn't have a resource file
+}
+
+
+GLDEF_C TInt E32Dll(
+					)
+	{
+	return KErrNone;
+	}
+
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CExampleApplication;
+	}
+
+LOCAL_D const TImplementationProxy ImplementationTable[]=
+	{
+	IMPLEMENTATION_PROXY_ENTRY(0x10004c49, NewApplication)
+	};
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+	{
+	aTableCount=sizeof(ImplementationTable)/sizeof(ImplementationTable[0]);
+	return ImplementationTable;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppEmbeddableOnly_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,36 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file TAppEmbeddableOnly_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10004c49
+
+RESOURCE APP_REGISTRATION_INFO
+	{	
+	app_file = "TAppEmbeddableOnly";
+	//
+	hidden=KAppNotHidden;
+	embeddability=KAppEmbeddableOnly;
+	newfile=KAppDoesNotSupportNewFile;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppEmbeddableOnly_v2.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,53 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TAppEmbeddableOnly.mmp
+// 
+//
+
+#include <platform_paths.hrh>
+
+TARGET        	TAppEmbeddableOnly.dll
+TARGETTYPE    	PLUGIN
+TARGETPATH	/sys/bin
+UID           	0x10009d8d 0x10004c5C
+
+CAPABILITY 	All -Tcb
+VENDORID 	0x70000001
+
+SOURCEPATH    	.
+SOURCE        	TAppEmbeddableOnly.cpp
+
+USERINCLUDE   	.
+SYSTEMINCLUDE 	/epoc32/include
+SYSTEMINCLUDE 	/epoc32/include/techview
+SYSTEMINCLUDE 	/epoc32/include/Ecom
+
+MW_LAYER_SYSTEMINCLUDE
+
+//reg added for Datacaging
+START RESOURCE	TAppEmbeddableOnly_reg.rss
+TARGETPATH	/private/10003a3f/apps
+END
+
+START RESOURCE 	10004c5C.rss
+TARGET 		TAppEmbeddableOnly.rsc
+END
+
+
+LIBRARY       	APPARC.LIB
+LIBRARY       	CONE.LIB 
+LIBRARY       	EIKCORE.LIB 
+LIBRARY       	ECOM.LIB
+LIBRARY       	EUSER.LIB
+LIBRARY       	GDI.LIB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppEmbeddableUiNotStandAlone.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,230 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Supporting application for use by other test programs that need
+// to query the apparc server for applications which define
+// different embeddability values in their AIF files.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <coeccntx.h>
+
+#include <apgtask.h>
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+
+#include "TAppEmbedUids.h"
+
+#include <ecom.h>
+#include <implementationproxy.h>
+
+_LIT(KExampleText, "This test application defines KAppEmbeddableUiNotStandAlone in it's AIF file");
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppView
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppView : public CCoeControl
+    {
+public:
+	static CExampleAppView* NewL(const TRect& aRect);
+	CExampleAppView();
+	~CExampleAppView();
+    void ConstructL(const TRect& aRect);
+
+private:
+	// from CCoeControl
+	void Draw(const TRect& /*aRect*/) const;
+private:
+	HBufC*  iExampleText;
+    };
+
+CExampleAppView::CExampleAppView()
+	{
+	}
+
+CExampleAppView* CExampleAppView::NewL(const TRect& aRect)
+	{
+	CExampleAppView* self = new(ELeave) CExampleAppView();
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect);
+	CleanupStack::Pop();
+	return self;
+	}
+
+CExampleAppView::~CExampleAppView()
+	{
+	delete iExampleText;
+	}
+
+void CExampleAppView::ConstructL(const TRect& aRect)
+    {
+	TPtrC ptr(KExampleText);
+	iExampleText = ptr.AllocL();
+	CreateWindowL();
+	SetRect(aRect);
+	ActivateL();
+	}
+
+void CExampleAppView::Draw(const TRect& /*aRect*/) const
+	{
+	CWindowGc& gc = SystemGc();
+	TRect      drawRect = Rect();
+	const CFont*     fontUsed;
+	
+	gc.Clear();
+  	fontUsed = iEikonEnv->TitleFont();
+	gc.UseFont(fontUsed);
+	TInt   baselineOffset=(drawRect.Height() - fontUsed->HeightInPixels())/2; 
+	gc.DrawText(*iExampleText,drawRect,baselineOffset,CGraphicsContext::ECenter, 0);
+	gc.DiscardFont();
+	}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppUi : public CEikAppUi
+    {
+public:
+    void ConstructL();
+	~CExampleAppUi();
+
+private:
+    // from CEikAppUi
+	void HandleCommandL(TInt aCommand);
+private:
+	CCoeControl* iAppView;
+	};
+
+
+void CExampleAppUi::ConstructL()
+    {
+    BaseConstructL(ENoAppResourceFile | ENoScreenFurniture);
+	iAppView = CExampleAppView::NewL(ClientRect());
+	}
+
+CExampleAppUi::~CExampleAppUi()
+	{
+	delete iAppView;
+	}
+
+void CExampleAppUi::HandleCommandL(TInt aCommand)
+	{
+	switch (aCommand)
+		{
+	case EEikCmdExit: 
+		Exit();
+		break;
+		}
+	}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleDocument : public CEikDocument
+	{
+public:
+	static CExampleDocument* NewL(CEikApplication& aApp);
+	CExampleDocument(CEikApplication& aApp);
+	void ConstructL();
+private: 
+	           // Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+CExampleDocument::CExampleDocument(CEikApplication& aApp)
+		: CEikDocument(aApp)
+	{
+	}
+
+CEikAppUi* CExampleDocument::CreateAppUiL()
+	{
+    return new(ELeave) CExampleAppUi;
+	}
+
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+class CExampleApplication : public CEikApplication
+	{
+private: 
+	// from CApaApplication
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+private:
+	TFileName ResourceFileName() const;
+private:
+	CApaDocument* CreateDocumentL(CApaProcess* a) { return CEikApplication::CreateDocumentL(a); }
+	//
+	};
+
+CApaDocument* CExampleApplication::CreateDocumentL()
+	{
+	return new (ELeave) CExampleDocument(*this);
+	}
+
+TUid CExampleApplication::AppDllUid() const
+	{
+	return KUidAppEmbeddableUiNotStandAlone;
+	}
+
+TFileName CExampleApplication::ResourceFileName() const
+{
+	return TFileName(); // this app doesn't have a resource file
+}
+
+
+GLDEF_C TInt E32Dll(
+					)
+	{
+	return KErrNone;
+	}
+
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CExampleApplication;
+	}
+
+LOCAL_D const TImplementationProxy ImplementationTable[]=
+	{
+	IMPLEMENTATION_PROXY_ENTRY(0x10004c4B, NewApplication)
+	};
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+	{
+	aTableCount=sizeof(ImplementationTable)/sizeof(ImplementationTable[0]);
+	return ImplementationTable;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppEmbeddableUiNotStandAlone_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,36 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file TAppEmbeddableUiNotStandAlone_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10004c4B
+
+RESOURCE APP_REGISTRATION_INFO
+	{	
+	app_file = "TAppEmbeddableUiNotStandAlone";
+	//
+	hidden=KAppNotHidden;
+	embeddability=KAppEmbeddableUiNotStandAlone;
+	newfile=KAppDoesNotSupportNewFile;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppEmbeddableUiNotStandAlone_v2.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,52 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TAppEmbeddableUiNotStandAlone.mmp
+// 
+//
+
+#include <platform_paths.hrh>
+
+TARGET        	TAppEmbeddableUiNotStandAlone.dll
+TARGETPATH	/sys/bin
+TARGETTYPE    	PLUGIN
+UID           	0x10009d8d 0x10004c5E
+
+CAPABILITY 	All -Tcb
+VENDORID 	0x70000001
+
+SOURCEPATH    	.
+SOURCE        	TAppEmbeddableUiNotStandAlone.cpp
+
+USERINCLUDE   	.
+SYSTEMINCLUDE 	/epoc32/include
+SYSTEMINCLUDE 	/epoc32/include/techview
+SYSTEMINCLUDE 	/epoc32/include/Ecom
+
+MW_LAYER_SYSTEMINCLUDE
+
+//reg added for Datacaging
+START RESOURCE	TAppEmbeddableUiNotStandAlone_reg.rss
+TARGETPATH	/private/10003a3f/apps
+END
+
+START RESOURCE 	10004c5E.rss
+TARGET 		TAppEmbeddableUiNotStandAlone.rsc
+END
+
+LIBRARY       	APPARC.LIB
+LIBRARY       	CONE.LIB 
+LIBRARY       	EIKCORE.LIB 
+LIBRARY       	ECOM.LIB
+LIBRARY       	EUSER.LIB
+LIBRARY       	GDI.LIB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppEmbeddableUiOrStandAlone.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,230 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Supporting application for use by other test programs that need
+// to query the apparc server for applications which define
+// different embeddability values in their AIF files.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include <coeccntx.h>
+
+#include <apgtask.h>
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+
+#include "TAppEmbedUids.h"
+
+#include <ecom.h>
+#include <implementationproxy.h>
+
+_LIT(KExampleText, "This test application defines KAppEmbeddableUiOrStandAlone in it's AIF file");
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppView
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppView : public CCoeControl
+    {
+public:
+	static CExampleAppView* NewL(const TRect& aRect);
+	CExampleAppView();
+	~CExampleAppView();
+    void ConstructL(const TRect& aRect);
+
+private:
+	// from CCoeControl
+	void Draw(const TRect& /*aRect*/) const;
+private:
+	HBufC*  iExampleText;
+    };
+
+CExampleAppView::CExampleAppView()
+	{
+	}
+
+CExampleAppView* CExampleAppView::NewL(const TRect& aRect)
+	{
+	CExampleAppView* self = new(ELeave) CExampleAppView();
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect);
+	CleanupStack::Pop();
+	return self;
+	}
+
+CExampleAppView::~CExampleAppView()
+	{
+	delete iExampleText;
+	}
+
+void CExampleAppView::ConstructL(const TRect& aRect)
+    {
+	TPtrC ptr(KExampleText);
+	iExampleText = ptr.AllocL();
+	CreateWindowL();
+	SetRect(aRect);
+	ActivateL();
+	}
+
+void CExampleAppView::Draw(const TRect& /*aRect*/) const
+	{
+	CWindowGc& gc = SystemGc();
+	TRect      drawRect = Rect();
+	const CFont*     fontUsed;
+	
+	gc.Clear();
+  	fontUsed = iEikonEnv->TitleFont();
+	gc.UseFont(fontUsed);
+	TInt   baselineOffset=(drawRect.Height() - fontUsed->HeightInPixels())/2; 
+	gc.DrawText(*iExampleText,drawRect,baselineOffset,CGraphicsContext::ECenter, 0);
+	gc.DiscardFont();
+	}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppUi : public CEikAppUi
+    {
+public:
+    void ConstructL();
+	~CExampleAppUi();
+
+private:
+    // from CEikAppUi
+	void HandleCommandL(TInt aCommand);
+private:
+	CCoeControl* iAppView;
+	};
+
+
+void CExampleAppUi::ConstructL()
+    {
+    BaseConstructL(ENoAppResourceFile | ENoScreenFurniture);
+	iAppView = CExampleAppView::NewL(ClientRect());
+	}
+
+CExampleAppUi::~CExampleAppUi()
+	{
+	delete iAppView;
+	}
+
+void CExampleAppUi::HandleCommandL(TInt aCommand)
+	{
+	switch (aCommand)
+		{
+	case EEikCmdExit: 
+		Exit();
+		break;
+		}
+	}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleDocument : public CEikDocument
+	{
+public:
+	static CExampleDocument* NewL(CEikApplication& aApp);
+	CExampleDocument(CEikApplication& aApp);
+	void ConstructL();
+private: 
+	           // Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+CExampleDocument::CExampleDocument(CEikApplication& aApp)
+		: CEikDocument(aApp)
+	{
+	}
+
+CEikAppUi* CExampleDocument::CreateAppUiL()
+	{
+    return new(ELeave) CExampleAppUi;
+	}
+
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+class CExampleApplication : public CEikApplication
+	{
+private: 
+	// from CApaApplication
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+private:
+	TFileName ResourceFileName() const;
+private:
+	CApaDocument* CreateDocumentL(CApaProcess* a) { return CEikApplication::CreateDocumentL(a); }
+	//
+	};
+
+CApaDocument* CExampleApplication::CreateDocumentL()
+	{
+	return new (ELeave) CExampleDocument(*this);
+	}
+
+TUid CExampleApplication::AppDllUid() const
+	{
+	return KUidAppEmbeddableUiOrStandAlone;
+	}
+
+TFileName CExampleApplication::ResourceFileName() const
+{
+	return TFileName(); // this app doesn't have a resource file
+}
+
+
+GLDEF_C TInt E32Dll(
+					)
+	{
+	return KErrNone;
+	}
+
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CExampleApplication;
+	}
+
+LOCAL_D const TImplementationProxy ImplementationTable[]=
+	{
+	IMPLEMENTATION_PROXY_ENTRY(0x10004c4A, NewApplication)
+	};
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+	{
+	aTableCount=sizeof(ImplementationTable)/sizeof(ImplementationTable[0]);
+	return ImplementationTable;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppEmbeddableUiOrStandAlone_embedded.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TAppEmbeddableUiOrStandAlone.mmp
+// 
+//
+
+#include <platform_paths.hrh>
+
+TARGET        	TAppEmbeddableUiOrStandAlone_embedded.dll
+TARGETTYPE    	PLUGIN
+TARGETPATH	/sys/bin
+UID 		0x10009d8d 0x10004c5D
+
+CAPABILITY 	All -Tcb
+VENDORID 	0x70000001
+
+SOURCEPATH    	.
+SOURCE        	TAppEmbeddableUiOrStandAlone.cpp
+
+USERINCLUDE   	.
+SYSTEMINCLUDE 	/epoc32/include
+SYSTEMINCLUDE 	/epoc32/include/techview
+SYSTEMINCLUDE 	/epoc32/include/Ecom
+
+MW_LAYER_SYSTEMINCLUDE
+
+START RESOURCE 	10004c5D.rss
+TARGET 		TAppEmbeddableUiOrStandAlone_embedded.rsc
+END
+
+
+LIBRARY       	APPARC.LIB
+LIBRARY       	CONE.LIB 
+LIBRARY       	EIKCORE.LIB 
+LIBRARY       	ECOM.LIB
+LIBRARY       	EUSER.LIB
+LIBRARY       	GDI.LIB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppEmbeddableUiOrStandAlone_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,36 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file TAppEmbeddableUiOrStandAlone_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10004c4A
+
+RESOURCE APP_REGISTRATION_INFO
+	{	
+	app_file = "TAppEmbeddableUiOrStandAlone";
+	//
+	hidden=KAppNotHidden;
+	embeddability=KAppEmbeddableUiOrStandAlone;
+	newfile=KAppDoesNotSupportNewFile;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppEmbeddableUiOrStandalone_standalone.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// "stub" to start the application architecture with the ECom UID
+// The actual standalone file.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+#include <e32std.h>
+#include <eikstart.h>
+
+const TUid KTAppEmbeddableUid = {0x10004c4A}; //use original UID of app (before it was converted from app to exe)
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication(KTAppEmbeddableUid);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppEmbeddableUiOrStandalone_standalone.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,41 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Standalone TAppEmbeddableUiOrStandalone.mmp
+// 
+//
+
+
+
+ TARGET        	TAppEmbeddableUiOrStandalone.exe
+ TARGETTYPE    	exe
+
+TARGETPATH		/sys/bin
+UID           	0x100039CE 0x10004c4A //the original UID
+VENDORID 		0x70000001 
+CAPABILITY 		All -Tcb
+
+
+SOURCEPATH    	.
+SOURCE        	TAppEmbeddableUiOrStandalone_standalone.cpp
+
+USERINCLUDE   	.
+SYSTEMINCLUDE 	/epoc32/include
+SYSTEMINCLUDE 	/epoc32/include/techview  //added this from original?
+
+//reg added for Datacaging
+START RESOURCE	TAppEmbeddableUiOrStandAlone_reg.rss
+TARGETPATH		/private/10003a3f/apps
+END
+
+LIBRARY euser.lib apparc.lib eikcore.lib cone.lib  //added cone.lib from original?
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppEmbeddable_embedded.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,47 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TAppEmbeddable.mmp
+// 
+//
+
+#include <platform_paths.hrh>
+
+TARGET        	TAppEmbeddable_embedded.dll
+TARGETPATH	/sys/bin
+TARGETTYPE    	PLUGIN
+UID 		0x10009d8d 0x10004c5B
+
+CAPABILITY 	All -Tcb
+VENDORID 	0x70000001
+
+SOURCEPATH    	.
+SOURCE        	TAppEmbeddable.cpp
+
+USERINCLUDE   	.
+SYSTEMINCLUDE 	/epoc32/include
+SYSTEMINCLUDE 	/epoc32/include/Ecom
+SYSTEMINCLUDE 	/epoc32/include/techview
+
+MW_LAYER_SYSTEMINCLUDE
+
+START RESOURCE 	10004c5B.rss
+TARGET 		TAppEmbeddable_embedded.rsc
+END
+
+LIBRARY       	APPARC.LIB
+LIBRARY       	CONE.LIB 
+LIBRARY       	EIKCORE.LIB 
+LIBRARY       	ECOM.LIB
+LIBRARY       	EUSER.LIB
+LIBRARY       	GDI.LIB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppEmbeddable_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,36 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file TAppEmbeddable_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10004c48
+
+RESOURCE APP_REGISTRATION_INFO
+	{	
+	app_file = "TAppEmbeddable";
+	//
+	hidden=KAppNotHidden;
+	embeddability=KAppEmbeddable;
+	newfile=KAppDoesNotSupportNewFile;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppEmbeddable_standalone.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,33 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// "stub" to start the application architecture with the ECom UID
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+#include <e32std.h>
+#include <eikstart.h>
+
+const TUid KTAppEmbeddableUid = {0x10004c48}; //use original UID of app (before it was converted from app to exe)
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication(KTAppEmbeddableUid);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppEmbeddable_standalone.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,42 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Standalone TAppEmbeddable.mmp
+// 
+//
+
+
+
+ TARGET        	TAppEmbeddable.exe
+ TARGETTYPE    	exe
+
+CAPABILITY 		All -Tcb //do standalone need this too?
+
+UID           	0x100039CE 0x10004c48 //the original UID
+VENDORID 		0x70000001 
+TARGETPATH		/sys/bin
+EPOCSTACKSIZE 	0x5000
+
+SOURCEPATH    	.
+SOURCE        	TAppEmbeddable_standalone.cpp
+
+USERINCLUDE   	.
+SYSTEMINCLUDE 	/epoc32/include
+SYSTEMINCLUDE 	/epoc32/include/techview 
+
+//reg added for Datacaging
+START RESOURCE	TAppEmbeddable_reg.rss
+TARGETPATH		/private/10003a3f/apps
+END
+
+LIBRARY 		euser.lib apparc.lib eikcore.lib cone.lib  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppInstall/TestAppInstall.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,181 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Source file for the testing T_AppListFileUpdateStep test step.
+// TestAppInstall.cpp is a simple Hello World GUI application.
+// In test build of ..\..\apparc\group TestAppInstall.RSC is created.
+// T_SyncAppListAndFileUpdate installs the RSC file into C:\private\10003a3f\import\apps
+// and Tests that Modified time after installation of RSC is more than 
+// Modified time before installation.
+// 
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <eikstart.h>
+
+
+#include "TestAppInstall.h"
+
+const TUid KUidTestAppInstall = { 0x102826DD };
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// Implementation of the application class - CExampleApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+TUid CExampleApplication::AppDllUid() const
+	{
+	return KUidTestAppInstall;
+	}
+
+CApaDocument* CExampleApplication::CreateDocumentL()
+	{
+	return new (ELeave) CExampleDocument(*this);
+	}
+	
+
+////////////////////////////////////////////////////////////////////////
+//
+// Implementation of the appui class - CExampleAppUi
+//
+////////////////////////////////////////////////////////////////////////
+
+void CExampleAppUi::ConstructL()
+    {
+    BaseConstructL();
+	iAppView = CExampleAppView::NewL(ClientRect());
+	}
+
+CExampleAppUi::~CExampleAppUi()
+	{
+	delete iAppView;
+	}
+
+void CExampleAppUi::HandleCommandL(TInt aCommand)
+	{
+	switch (aCommand)
+		{
+		case EEikCmdExit: 
+			Exit();
+			break;
+		}
+	}
+
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// Implementation of the view class - CExampleAppView
+//
+////////////////////////////////////////////////////////////////////////
+
+CExampleAppView::CExampleAppView()
+	{
+	}
+
+CExampleAppView* CExampleAppView::NewL(const TRect& aRect)
+	{
+	CExampleAppView* self = new(ELeave) CExampleAppView();
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect);
+	CleanupStack::Pop();
+	return self;
+	}
+
+CExampleAppView::~CExampleAppView()
+	{
+	delete iExampleText;
+	}
+
+void CExampleAppView::ConstructL(const TRect& aRect)
+    {
+   	// Fetch the text from the resource file.
+	iExampleText = iEikonEnv->AllocReadResourceL(R_EXAMPLE_TEXT_TESTAPP);
+
+    // Control is a window owning control
+	CreateWindowL();
+
+   // Extent of the control. This is
+   // the whole rectangle available to application.
+   // The rectangle is passed to us from the application UI.
+	SetRect(aRect);
+
+   // At this stage, the control is ready to draw so
+   // we tell the UI framework by activating it.
+	ActivateL();
+	}
+
+
+void CExampleAppView::Draw(const TRect& /*aRect*/) const
+	{
+	CWindowGc& gc = SystemGc();			// Window graphics context
+	TRect      drawRect = Rect();		// Area in which we shall draw	
+	const CFont*     fontUsed;			// Font used for drawing text
+	
+	// Start with a clear screen
+	gc.Clear();
+	
+	// Draw an outline rectangle (the default pen and brush styles ensure this) slightly smaller than the drawing area.
+	drawRect.Shrink(10,10);		   	
+	gc.DrawRect(drawRect);
+    
+    // Use the title font supplied by the UI
+	fontUsed = iEikonEnv->TitleFont();
+	gc.UseFont(fontUsed);
+	
+	// Draw the text in the middle of the rectangle.
+	TInt   baselineOffset=(drawRect.Height() - fontUsed->HeightInPixels())/2; 
+	gc.DrawText(*iExampleText,drawRect,baselineOffset,CGraphicsContext::ECenter, 0);
+    
+    // Finished using the font
+	gc.DiscardFont();
+	}
+
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// Implementation of the document class - CExampleDocument
+//
+////////////////////////////////////////////////////////////////////////
+
+CExampleDocument::CExampleDocument(CEikApplication& aApp)
+		: CEikDocument(aApp)
+	{
+	}
+
+CEikAppUi* CExampleDocument::CreateAppUiL()
+	{
+    return new(ELeave) CExampleAppUi;
+	}
+
+
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CExampleApplication;
+	}
+	
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication(NewApplication);
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppInstall/TestAppInstall.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,119 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// The class definitions for the simple application for testing using T_SynAppListAndFileUpdate.cpp
+// containing a single view with the text "App Installed !" drawn on it.
+// 
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+
+#ifndef __TESTAPPINSTALL_H
+#define __TESTAPPINSTALL_H
+
+#include <coeccntx.h>
+
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+
+#include <eikon.hrh>
+
+#include <testappinstall.rsg>
+#include "testappinstall.hrh"
+
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+class CExampleApplication : public CEikApplication
+	{
+private: 
+	// Inherited from class CApaApplication
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+	};
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppView
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppView : public CCoeControl
+    {
+public:
+	static CExampleAppView* NewL(const TRect& aRect);
+	CExampleAppView();
+	~CExampleAppView();
+    void ConstructL(const TRect& aRect);
+
+private:
+	// Inherited from CCoeControl
+	void Draw(const TRect& /*aRect*/) const;
+
+private:
+	HBufC*  iExampleText;
+    };
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppUi : public CEikAppUi
+    {
+public:
+    void ConstructL();
+	~CExampleAppUi();
+
+private:
+	// Inherirted from class CEikAppUi
+	void HandleCommandL(TInt aCommand);
+
+private:
+	CCoeControl* iAppView;
+	};
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleDocument : public CEikDocument
+	{
+public:
+	static CExampleDocument* NewL(CEikApplication& aApp);
+	CExampleDocument(CEikApplication& aApp);
+	void ConstructL();
+private: 
+	// Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppInstall/TestAppInstall.hrh	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,30 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+
+enum TExampleMenuCommands
+	{
+	EExampleItem0 = 200,
+	EExampleItem1,
+	EExampleItem2
+	};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppInstall/TestAppInstall.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,51 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// using relative paths for sourcepath and user includes
+// 
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <platform_paths.hrh>
+
+TARGET        		TestAppInstall.exe
+TARGETTYPE    		exe
+UID           		0x100039CE 0x102826DD
+VENDORID 	  		0x70000001
+
+SOURCEPATH    .
+SOURCE		  TestAppInstall.cpp
+
+USERINCLUDE   	.
+SYSTEMINCLUDE 	/epoc32/include
+SYSTEMINCLUDE 	/epoc32/include/techview
+
+MW_LAYER_SYSTEMINCLUDE
+
+START RESOURCE	TestAppInstall.RSS
+HEADER
+TARGETPATH		/Resource/Apps
+end
+
+START RESOURCE	TestAppInstall_reg.rss
+TARGETPATH		/apparctest
+END
+
+LIBRARY       euser.lib apparc.lib cone.lib eikcore.lib gdi.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppInstall/TestAppInstall.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,88 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+
+NAME TEAP
+
+#include <eikon.rh>
+#include <eikcore.rsg>
+#include <appinfo.rh>
+
+#include "TestAppInstall.hrh"
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+	{
+	hotkeys=r_example_hotkeys;
+	menubar=r_example_menubar;
+	}
+
+RESOURCE HOTKEYS r_example_hotkeys
+    {
+    control=
+        {
+        HOTKEY { command=EEikCmdExit; key='e'; }
+        };
+    }
+
+RESOURCE MENU_BAR r_example_menubar
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_example_first_menu; txt="TestAppInstall"; }
+		};
+    }
+
+RESOURCE MENU_PANE r_example_first_menu
+	{
+	items=
+		{
+		MENU_ITEM { command=EExampleItem0; txt="Item 0"; },
+		MENU_ITEM { command=EExampleItem1; txt="Item 1"; },
+		MENU_ITEM { command=EExampleItem2; txt="Item 2"; },
+		MENU_ITEM { command=EEikCmdExit; txt="Close"; }
+        };
+    }
+
+
+RESOURCE TBUF r_example_text_TestApp { buf="TestAppInstall!"; }
+RESOURCE TBUF r_example_text_Item0 { buf="Item 0"; }
+RESOURCE TBUF r_example_text_Item1 { buf="Item 1"; }
+RESOURCE TBUF r_example_text_Item2 { buf="Item 2"; }
+
+RESOURCE LOCALISABLE_APP_INFO r_lai
+	{
+	short_caption = "TAI";
+	caption_and_icon =
+		{
+		CAPTION_AND_ICON_INFO
+			{
+			caption = "TestAppInstall";
+			number_of_icons = 3; // each icon must be a bitmap/mask pair
+			icon_file = "z:\\resource\\apps\\TestAppInstall.mbm";
+			}
+		};							
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppInstall/TestAppInstall_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,36 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+#include <TestAppInstall.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x102826DD // application UID
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file = "TestAppInstall";
+	localisable_resource_file = "\\resource\\apps\\TestAppInstall";
+	localisable_resource_id = R_LAI;	
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppLaunchChecker.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,49 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+TARGET TAppLaunchChecker.dll
+CAPABILITY	All -Tcb
+TARGETTYPE PLUGIN
+VENDORID 0x70000001
+
+// ECom Dll recognition UID followed by the unique dll UID 
+UID 0x10009D8D 0x1020d465
+
+SOURCEPATH ../tef 
+SOURCE TAppLaunchChecker.cpp
+
+USERINCLUDE ../tef
+USERINCLUDE ../inc
+SYSTEMINCLUDE /epoc32/include
+SYSTEMINCLUDE /epoc32/include/ecom
+
+start resource 1020d465.rss
+target TAppLaunchChecker.rsc
+
+end
+
+LIBRARY euser.lib
+LIBRARY ECom.lib
+LIBRARY apfile.lib
+LIBRARY ws32.lib 
+LIBRARY apgrfx.lib
+LIBRARY apparc.lib 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppLaunchChecker2.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,49 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+
+TARGET TAppLaunchChecker2.dll
+CAPABILITY	All -Tcb
+TARGETTYPE PLUGIN
+VENDORID 0x70000001
+
+// ECom Dll recognition UID followed by the unique dll UID 
+UID 0x10009D8D 0x102722ba
+
+SOURCEPATH ../tef 
+SOURCE TAppLaunchChecker2.cpp
+TARGETPATH /sys/bin
+
+USERINCLUDE ../tef
+SYSTEMINCLUDE ../inc
+SYSTEMINCLUDE /epoc32/include
+SYSTEMINCLUDE /epoc32/include/ecom
+
+start resource 102722ba.rss
+target TAppLaunchChecker2.rsc
+end
+
+LIBRARY euser.lib
+LIBRARY ECom.lib
+LIBRARY ws32.lib 
+LIBRARY apgrfx.lib
+LIBRARY apfile.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppNotEmbeddable.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,217 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Supporting application for use by other test programs that need
+// to query the apparc server for applications which define
+// different embeddability values in their AIF files.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <coeccntx.h>
+
+#include <apgtask.h>
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+
+#include <eikstart.h>
+
+#include "TAppEmbedUids.h"
+
+_LIT(KExampleText, "This test application defines KAppNotEmbeddable in it's AIF file");
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppView
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppView : public CCoeControl
+    {
+public:
+	static CExampleAppView* NewL(const TRect& aRect);
+	CExampleAppView();
+	~CExampleAppView();
+    void ConstructL(const TRect& aRect);
+
+private:
+	// from CCoeControl
+	void Draw(const TRect& /*aRect*/) const;
+private:
+	HBufC*  iExampleText;
+    };
+
+CExampleAppView::CExampleAppView()
+	{
+	}
+
+CExampleAppView* CExampleAppView::NewL(const TRect& aRect)
+	{
+	CExampleAppView* self = new(ELeave) CExampleAppView();
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect);
+	CleanupStack::Pop();
+	return self;
+	}
+
+CExampleAppView::~CExampleAppView()
+	{
+	delete iExampleText;
+	}
+
+void CExampleAppView::ConstructL(const TRect& aRect)
+    {
+	TPtrC ptr(KExampleText);
+	iExampleText = ptr.AllocL();
+	CreateWindowL();
+	SetRect(aRect);
+	ActivateL();
+	}
+
+void CExampleAppView::Draw(const TRect& /*aRect*/) const
+	{
+	CWindowGc& gc = SystemGc();
+	TRect      drawRect = Rect();
+	const CFont*     fontUsed;
+	
+	gc.Clear();
+  	fontUsed = iEikonEnv->TitleFont();
+	gc.UseFont(fontUsed);
+	TInt   baselineOffset=(drawRect.Height() - fontUsed->HeightInPixels())/2; 
+	gc.DrawText(*iExampleText,drawRect,baselineOffset,CGraphicsContext::ECenter, 0);
+	gc.DiscardFont();
+	}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppUi : public CEikAppUi
+    {
+public:
+    void ConstructL();
+	~CExampleAppUi();
+
+private:
+    // from CEikAppUi
+	void HandleCommandL(TInt aCommand);
+private:
+	CCoeControl* iAppView;
+	};
+
+
+void CExampleAppUi::ConstructL()
+    {
+    BaseConstructL(ENoAppResourceFile | ENoScreenFurniture);
+	iAppView = CExampleAppView::NewL(ClientRect());
+	}
+
+CExampleAppUi::~CExampleAppUi()
+	{
+	delete iAppView;
+	}
+
+void CExampleAppUi::HandleCommandL(TInt aCommand)
+	{
+	switch (aCommand)
+		{
+	case EEikCmdExit: 
+		Exit();
+		break;
+		}
+	}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleDocument : public CEikDocument
+	{
+public:
+	static CExampleDocument* NewL(CEikApplication& aApp);
+	CExampleDocument(CEikApplication& aApp);
+	void ConstructL();
+private: 
+	           // Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+CExampleDocument::CExampleDocument(CEikApplication& aApp)
+		: CEikDocument(aApp)
+	{
+	}
+
+CEikAppUi* CExampleDocument::CreateAppUiL()
+	{
+    return new(ELeave) CExampleAppUi;
+	}
+
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+class CExampleApplication : public CEikApplication
+	{
+private: 
+	// from CApaApplication
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+private:
+	TFileName ResourceFileName() const;
+private:
+	CApaDocument* CreateDocumentL(CApaProcess* a) { return CEikApplication::CreateDocumentL(a); }
+	//
+	};
+
+CApaDocument* CExampleApplication::CreateDocumentL()
+	{
+	return new (ELeave) CExampleDocument(*this);
+	}
+
+TUid CExampleApplication::AppDllUid() const
+	{
+	return KUidAppNotEmbeddable;
+	}
+
+TFileName CExampleApplication::ResourceFileName() const
+{
+	return TFileName(); // this app doesn't have a resource file
+}
+
+
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CExampleApplication;
+	}
+	
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication(NewApplication);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppNotEmbeddable_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,35 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file TAppNotEmbeddable_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10004c47
+
+RESOURCE APP_REGISTRATION_INFO
+	{	
+	app_file = "TAppNotEmbeddable";
+	//
+	hidden=KAppNotHidden;
+	embeddability=KAppNotEmbeddable;
+	newfile=KAppDoesNotSupportNewFile;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TAppNotEmbeddable_v2.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,50 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TAppNotEmbeddable.mmp
+// 
+//
+
+#include <platform_paths.hrh>
+
+TARGET        	TAppNotEmbeddable.exe
+TARGETTYPE    	exe
+
+CAPABILITY 	All -Tcb
+UID           	0x100039CE 0x10004c47
+VENDORID 	0x70000001
+
+SOURCEPATH    	.
+SOURCE        	TAppNotEmbeddable.cpp
+
+USERINCLUDE   	.
+SYSTEMINCLUDE 	/epoc32/include
+SYSTEMINCLUDE 	/epoc32/include/techview
+
+MW_LAYER_SYSTEMINCLUDE
+
+TARGETPATH	/sys/bin
+
+//reg added for Datacaging
+START RESOURCE	TAppNotEmbeddable_reg.rss
+TARGETPATH	/private/10003a3f/apps
+END
+
+
+LIBRARY       	APPARC.LIB  
+LIBRARY       	CONE.LIB
+LIBRARY       	EIKCORE.LIB
+LIBRARY       	EUSER.LIB
+LIBRARY       	GDI.LIB
+
+epocstacksize 	0x5000 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TApparcTestApp.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,593 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file 
+// @internalComponent - Internal Symbian test code
+// This is a support app used by Apparc\tef\TApparcTestServer (TApparc4Step in particular)
+// This application covers the following tests for the static objects
+// Test 1 : Existing CCoeStatic derived objects using the 2 parameter
+// constructor must be destroyed before the app ui.
+// Way to test this,
+// Case 1: Get hold of a particular static using CCoeEnv::Static(TUid aUid) 
+// in an application's override of CEikAppUi::PrepareToExit() and confirm the 
+// returned pointer is not null. 
+// Case 2: Then, the same thing is done in the app ui's destructor to check that 
+// the pointer is now null.
+// Test 2: A static constructed with a negative priority should be accessible from the 
+// app ui's destructor, but then destroyed before another static that has a lower priority value.
+// Way to test this,
+// Case 1: Construct a static (A) using the 3 parameter constructor, specifying a negative priority.
+// Then construct another static (B) specifying a priority (A's priority - 1). 
+// Check that static A is still non-null when accessed from the app ui's destructor. 
+// Case 2: Then check that static A is null when accessed from B's destructor.
+// Test 3: Given two statics with different positive priorities,
+// the higher priority one should be destroyed first.
+// Way to test this,
+// Case 1: If (for example) static A has priority EDefaultDestructionPriority,
+// and static B has EDefaultDestructionPriority-1, A's destructor should be able to access B,
+// Case 2: But B's destructor shouldn't be able to access A.
+// Test 4: Statics with priorities immediately either side of the pre/post-destroy app ui should be destroyed before/after the app ui. Should also test that 
+// the first negative priority static is destroyed and not "skipped over" when the code calculates
+// which static should be destroyed next after the app ui has been destroyed.
+// Way to test this,
+// Case 1: We could create statics A, B and C with priority zero, -1 and -2 respectively. 
+// Then check in the app ui destructor that A is null, and B and C are both non-null.
+// Case 2: Then in B's destructor check that C is still non-null.
+// Case 3: And in C's destructor check that B is now null.
+// 
+//
+
+
+
+#include <coeccntx.h>
+#include <apgtask.h>
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+#include <f32file.h>
+#include <eikon.hrh>
+#include <eikstart.h> ////TKAS added for exe-app
+
+#include <TApparcTestApp.rsg>
+
+// File which stores the test results
+_LIT(KApparcTestResultsFileName, "c:\\system\\Apparctest\\ApparcTestResultsFile.txt");
+_LIT(KApparcTestDir, "c:\\system\\Apparctest\\");
+
+_LIT8(KTestPass ,"PASS\r\n");
+_LIT8(KTestFail,"FAIL\r\n");
+
+_LIT8(KApparcTest1,"Test1:");
+_LIT8(KApparcTest2,"Test2:");
+_LIT8(KApparcTest3,"Test3:");
+_LIT8(KApparcTest4,"Test4:");
+_LIT8(KApparcTestCase1,"Case1:");
+_LIT8(KApparcTestCase2,"Case2:");
+_LIT8(KApparcTestCase3,"Case3:");
+
+const TUid KUidApparcTestApp = {0x100048F3};
+
+// Uids for diffent classes for static 
+const TUid KUidTestStatic		 = 	{0x13003ACE}; 
+const TUid KUidTestStaticNegativePrioA = {0x13004ACE}; 
+const TUid KUidTestStaticNegativePrioB = {0x13005ACE}; 
+const TUid KUidTestStaticPosPriA =	{0x13006ACE};
+const TUid KUidTestStaticPosPriB = 	{0x13007ACE};
+const TUid KUidTestStaticPriZeroA=	{0x13009ACE};
+const TUid KUidTestStaticPriOneB =	{0x1300AACE};
+const TUid KUidTestStaticPriTwoC =	{0x1300BACE};
+
+// Priorities for static objects
+enum {ENegativePriortyStaticA = -3};
+enum {EPriorityTwoStaticC= -2,EPriorityOneStaticB = -1,EPriorityZeroStaticA= 0};
+
+// static class for Test case 1  
+class CTApparcTestStatic : public CCoeStatic
+	{
+public:
+	inline CTApparcTestStatic(RFile& aFile);
+	inline static CTApparcTestStatic* Self();
+	~CTApparcTestStatic();
+	RFile iFile;
+	};
+
+CTApparcTestStatic::~CTApparcTestStatic()
+	{
+	}
+
+// Static class with negative priority for Test case 2.
+class CTApparcTestNegativePrioStaticA : public CCoeStatic
+	{
+public:
+	inline CTApparcTestNegativePrioStaticA(RFile& aFile);
+	inline static CTApparcTestNegativePrioStaticA* Self();
+	~CTApparcTestNegativePrioStaticA();
+	
+	RFile& iFile;
+	};
+
+// Static class with negative priority for Test case 2. (priority less than CTApparcTestNegativePrioStaticA)
+class CTApparcTestNegativePrioStaticB : public CCoeStatic
+	{
+public:
+	inline CTApparcTestNegativePrioStaticB();
+	inline static CTApparcTestNegativePrioStaticB* Self();
+	~CTApparcTestNegativePrioStaticB();
+	
+	RFile iFile;
+	RFs iFs;
+	};
+
+CTApparcTestNegativePrioStaticA::~CTApparcTestNegativePrioStaticA()
+	{
+	}
+
+CTApparcTestNegativePrioStaticB::~CTApparcTestNegativePrioStaticB()
+	{
+	// Test 2, Case 2
+	CTApparcTestNegativePrioStaticA* testCoeStaticA = CTApparcTestNegativePrioStaticA::Self();
+	iFile.Write(KApparcTest2);
+	iFile.Write(KApparcTestCase2);
+	
+	if(testCoeStaticA == NULL)
+		iFile.Write(KTestPass);
+	else
+		iFile.Write(KTestFail);
+		
+	// CTApparcTestNegativePrioStaticB class object is the most negative prioritised
+	// static objects .Hence the file and session handles are closed here as no
+	// more logging is required hereafter. 	
+	iFile.Close();
+	iFs.Close();	
+	}
+
+// Static class with positive priority for Test case 3:
+class CTApparcTestPosPrioStaticA : public CCoeStatic
+	{
+public:
+	inline CTApparcTestPosPrioStaticA(RFile& aFile);
+	inline static CTApparcTestPosPrioStaticA* Self();
+	~CTApparcTestPosPrioStaticA();
+	
+	RFile& iFile;
+	};
+
+// static class with positive priority less than CTApparcTestPosPrioStaticA for Test case 3.
+class CTApparcTestPosPrioStaticB : public CCoeStatic
+	{
+public:
+	inline CTApparcTestPosPrioStaticB(RFile& aFile);
+	inline static CTApparcTestPosPrioStaticB* Self();
+	~CTApparcTestPosPrioStaticB();
+	
+	RFile& iFile;
+	};
+
+CTApparcTestPosPrioStaticA::~CTApparcTestPosPrioStaticA()
+	{
+	// Test 3 , Case 1
+	CTApparcTestPosPrioStaticB* testPosPrioStaticB = CTApparcTestPosPrioStaticB::Self();
+	iFile.Write(KApparcTest3);
+	iFile.Write(KApparcTestCase1);
+	
+	if(testPosPrioStaticB != NULL)
+		iFile.Write(KTestPass);
+	else
+		iFile.Write(KTestFail);
+	}
+	
+CTApparcTestPosPrioStaticB::~CTApparcTestPosPrioStaticB()
+	{
+	// Test 3 , Case 2
+	CTApparcTestPosPrioStaticA* testPosPrioStaticA = CTApparcTestPosPrioStaticA::Self();
+	iFile.Write(KApparcTest3);
+	iFile.Write(KApparcTestCase2);
+	
+	if(testPosPrioStaticA == NULL)
+		iFile.Write(KTestPass);
+	else
+		iFile.Write(KTestFail);
+	}
+
+// static class with  priority 0 for test case 4
+class CTApparcTestPrioZeroStaticA : public CCoeStatic
+	{
+public:
+	inline CTApparcTestPrioZeroStaticA(RFile& aFile);
+	inline static CTApparcTestPrioZeroStaticA* Self();
+	~CTApparcTestPrioZeroStaticA();
+	
+	RFile& iFile;
+	};
+
+// static class with priority -1 for test case 4
+class CTApparcTestPrioOneStaticB : public CCoeStatic
+	{
+public:
+	inline CTApparcTestPrioOneStaticB(RFile& aFile);
+	inline static CTApparcTestPrioOneStaticB* Self();
+	~CTApparcTestPrioOneStaticB();
+	
+	RFile& iFile;
+	};
+
+// static class with priority -2 for test case 4	
+class CTApparcTestPrioTwoStaticC : public CCoeStatic
+	{
+public:
+	inline CTApparcTestPrioTwoStaticC(RFile& aFile);
+	inline static CTApparcTestPrioTwoStaticC* Self();
+	~CTApparcTestPrioTwoStaticC();
+	
+	RFile& iFile;
+	};
+
+
+CTApparcTestPrioZeroStaticA::~CTApparcTestPrioZeroStaticA()
+	{
+	}
+
+CTApparcTestPrioOneStaticB::~CTApparcTestPrioOneStaticB()
+	{
+	// Test 4 , Case 2
+	CTApparcTestPrioTwoStaticC* testPrioTwoCoeStaticC = CTApparcTestPrioTwoStaticC::Self();
+	iFile.Write(KApparcTest4);
+	iFile.Write(KApparcTestCase2);
+
+	if(testPrioTwoCoeStaticC != NULL)
+		iFile.Write(KTestPass);
+	else
+		iFile.Write(KTestFail);
+	}
+
+CTApparcTestPrioTwoStaticC::~CTApparcTestPrioTwoStaticC()
+	{
+	// Test 4 , Case 3
+	CTApparcTestPrioOneStaticB* testPrioOneCoeStaticB = CTApparcTestPrioOneStaticB::Self();
+	iFile.Write(KApparcTest4);
+	iFile.Write(KApparcTestCase3);
+
+	if(testPrioOneCoeStaticB == NULL)
+		iFile.Write(KTestPass);
+	else
+		iFile.Write(KTestFail);
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// CTApparcTestAppView
+//
+////////////////////////////////////////////////////////////////////////
+class CTApparcTestAppView : public CCoeControl
+    {
+public:
+	static CTApparcTestAppView* NewL(const TRect& aRect);
+	CTApparcTestAppView();
+	~CTApparcTestAppView();
+    void ConstructL(const TRect& aRect);
+private:
+    // Inherited from CCoeControl
+	void Draw(const TRect& /*aRect*/) const;
+private:
+	HBufC*  iApparcTestText;
+    };
+
+CTApparcTestAppView::CTApparcTestAppView()
+	{
+	}
+
+CTApparcTestAppView* CTApparcTestAppView::NewL(const TRect& aRect)
+	{
+	CTApparcTestAppView* self = new(ELeave) CTApparcTestAppView();
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect);
+	CleanupStack::Pop();
+	return self;
+	}
+
+CTApparcTestAppView::~CTApparcTestAppView()
+	{
+	delete iApparcTestText;
+	}
+
+void CTApparcTestAppView::ConstructL(const TRect& aRect)
+    {
+	iApparcTestText = iEikonEnv->AllocReadResourceL(R_TAPPARCTEST_TEXT_TITLE);
+	CreateWindowL();
+	SetRect(aRect);
+	ActivateL();
+	}
+
+void CTApparcTestAppView::Draw(const TRect& /*aRect*/) const
+	{
+	CWindowGc& gc = SystemGc();
+	TRect      drawRect = Rect();
+	const CFont*  fontUsed = iEikonEnv->TitleFont();
+	
+	gc.Clear();
+	gc.UseFont(fontUsed);
+	TInt   baselineOffset=(drawRect.Height() - fontUsed->HeightInPixels())/2; 
+	gc.DrawText(*iApparcTestText,drawRect,baselineOffset,CGraphicsContext::ECenter, 0);
+	gc.DiscardFont();
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// CTApparcTestAppUi
+//
+////////////////////////////////////////////////////////////////////////
+
+class CTApparcTestAppUi : public CEikAppUi
+    {
+public:
+    void ConstructL();
+	~CTApparcTestAppUi();
+private:
+    // Inherirted from class CEikAppUi
+	void PrepareToExit();
+	void HandleCommandL(TInt aCommand);
+
+private:
+	CCoeControl*	iAppView;
+	};
+	
+	
+void CTApparcTestAppUi::ConstructL()
+    {
+    BaseConstructL();
+	iAppView = CTApparcTestAppView::NewL(ClientRect());
+	
+	// Constructs the static object for tests
+	CTApparcTestNegativePrioStaticB* testCoeStaticB = new(ELeave)CTApparcTestNegativePrioStaticB();
+	
+	CTApparcTestStatic* testCoeStatic = new (ELeave)CTApparcTestStatic(testCoeStaticB->iFile);
+	CTApparcTestNegativePrioStaticA* testCoeStaticA  = new(ELeave)CTApparcTestNegativePrioStaticA(testCoeStaticB->iFile);
+	CTApparcTestPrioTwoStaticC* testPrioTwoStaticC = new(ELeave) CTApparcTestPrioTwoStaticC(testCoeStaticB->iFile);
+    CTApparcTestPosPrioStaticA* testPosPriStaticA = new(ELeave) CTApparcTestPosPrioStaticA(testCoeStaticB->iFile);
+	CTApparcTestPosPrioStaticB* testPosPriStaticB = new(ELeave) CTApparcTestPosPrioStaticB(testCoeStaticB->iFile);
+	CTApparcTestPrioZeroStaticA* testPrioZeroStaticA = new(ELeave) CTApparcTestPrioZeroStaticA(testCoeStaticB->iFile);
+	CTApparcTestPrioOneStaticB* testPrioOneStaticB = new(ELeave) CTApparcTestPrioOneStaticB(testCoeStaticB->iFile);
+	
+	// to get rid of compiler warnings
+	if(testCoeStatic==NULL  || testCoeStaticA == NULL ||  testCoeStaticB == NULL|| testPosPriStaticA ==NULL ||
+		testPosPriStaticB == NULL || testPrioZeroStaticA == NULL || testPrioOneStaticB == NULL|| testPrioTwoStaticC == NULL)
+		 return;	
+	}
+
+CTApparcTestAppUi::~CTApparcTestAppUi()
+	{
+	CTApparcTestNegativePrioStaticB* testNegStaticB = CTApparcTestNegativePrioStaticB::Self();
+	// Test 1, Case 2
+	CTApparcTestStatic* testCoeStatic = CTApparcTestStatic::Self();
+	testNegStaticB->iFile.Write(KApparcTest1);
+	testNegStaticB->iFile.Write(KApparcTestCase2);
+	
+	if(testCoeStatic == NULL)
+		testNegStaticB->iFile.Write(KTestPass);
+	else
+		testNegStaticB->iFile.Write(KTestFail);
+		
+	// Test 2, Case 1	 
+	CTApparcTestNegativePrioStaticA* testCoeStaticA = CTApparcTestNegativePrioStaticA::Self();
+	testNegStaticB->iFile.Write(KApparcTest2);
+	testNegStaticB->iFile.Write(KApparcTestCase1);
+
+	if(testCoeStaticA != NULL)
+		testNegStaticB->iFile.Write(KTestPass);
+	else
+		testNegStaticB->iFile.Write(KTestFail);
+
+	// Test 4, Case 1
+	CTApparcTestPrioZeroStaticA* testPrioZeroCoeStaticA = CTApparcTestPrioZeroStaticA::Self();
+	CTApparcTestPrioOneStaticB* testPrioOneCoeStaticB = CTApparcTestPrioOneStaticB::Self();
+	CTApparcTestPrioTwoStaticC* testPrioTwoCoeStaticC = CTApparcTestPrioTwoStaticC::Self();
+	testNegStaticB->iFile.Write(KApparcTest4);
+	testNegStaticB->iFile.Write(KApparcTestCase1);
+
+	if(testPrioZeroCoeStaticA == NULL && testPrioOneCoeStaticB != NULL && testPrioTwoCoeStaticC != NULL)
+		testNegStaticB->iFile.Write(KTestPass);
+	else
+		testNegStaticB->iFile.Write(KTestFail);
+
+	delete iAppView;
+	}
+
+void CTApparcTestAppUi::HandleCommandL(TInt aCommand)
+	{
+	switch (aCommand)
+		{
+ 	case EEikCmdExit: 
+		Exit();
+		break;
+		}
+	}
+
+void CTApparcTestAppUi::PrepareToExit()
+	{
+	CEikAppUi::PrepareToExit();
+	// Test 1, Case 1
+	CTApparcTestStatic* testCoeStatic = CTApparcTestStatic::Self();
+	
+	testCoeStatic->iFile.Write(KApparcTest1);
+	testCoeStatic->iFile.Write(KApparcTestCase1);
+
+	if(testCoeStatic != NULL)
+		testCoeStatic->iFile.Write(KTestPass);
+	else
+		testCoeStatic->iFile.Write(KTestFail);
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// CTApparcTestDocument
+//
+////////////////////////////////////////////////////////////////////////
+
+class CTApparcTestDocument : public CEikDocument
+	{
+public:
+	static CTApparcTestDocument* NewL(CEikApplication& aApp);
+	CTApparcTestDocument(CEikApplication& aApp);
+	void ConstructL();
+private: 
+	// Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+CTApparcTestDocument::CTApparcTestDocument(CEikApplication& aApp)
+		: CEikDocument(aApp)
+	{
+	}
+
+CEikAppUi* CTApparcTestDocument::CreateAppUiL()
+	{
+    return new(ELeave) CTApparcTestAppUi;
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// CTApparcTestApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+class CTApparcTestApplication : public CEikApplication
+	{
+private: 
+	// Inherited from class CApaApplication
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+private:
+	CApaDocument* CreateDocumentL(CApaProcess* a) { return CEikApplication::CreateDocumentL(a); }
+	};
+
+TUid CTApparcTestApplication::AppDllUid() const
+	{
+	return KUidApparcTestApp;
+	}
+
+CApaDocument* CTApparcTestApplication::CreateDocumentL()
+	{
+	return new (ELeave) CTApparcTestDocument(*this);
+	}
+
+EXPORT_C CApaApplication* NewApplication()
+	{
+	return new CTApparcTestApplication;
+	}
+
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication(NewApplication);
+	}
+
+		
+
+//
+// inline functions 
+//
+
+// inline function for CTApparcTestStatic
+inline CTApparcTestStatic::CTApparcTestStatic(RFile& aFile)
+	: CCoeStatic(KUidTestStatic),iFile(aFile)
+	{
+	}
+
+inline CTApparcTestStatic* CTApparcTestStatic::Self()
+	{
+	return STATIC_CAST(CTApparcTestStatic*,CCoeEnv::Static(KUidTestStatic));
+	}
+	
+// inline functions for CTApparcTestNegativePrioStaticA
+inline CTApparcTestNegativePrioStaticA::CTApparcTestNegativePrioStaticA(RFile& aFile)
+	: CCoeStatic(KUidTestStaticNegativePrioA,ENegativePriortyStaticA),iFile(aFile)
+	{
+	}
+
+inline CTApparcTestNegativePrioStaticA* CTApparcTestNegativePrioStaticA::Self()
+	{
+	return STATIC_CAST(CTApparcTestNegativePrioStaticA*,CCoeEnv::Static(KUidTestStaticNegativePrioA));
+	}
+	
+// inline functions for CTApparcTestNegativePrioStaticB	
+inline CTApparcTestNegativePrioStaticB::CTApparcTestNegativePrioStaticB()
+	: CCoeStatic(KUidTestStaticNegativePrioB,ENegativePriortyStaticA - 1)
+	{
+	User::LeaveIfError(iFs.Connect());
+	TInt err = iFs.MkDirAll(KApparcTestDir);
+	
+	err = iFile.Create(iFs,KApparcTestResultsFileName,EFileWrite | EFileShareAny);
+	if(err == KErrAlreadyExists)
+		iFile.Open(iFs,KApparcTestResultsFileName,EFileWrite | EFileShareAny);
+	}
+
+inline CTApparcTestNegativePrioStaticB* CTApparcTestNegativePrioStaticB::Self()
+	{
+	return STATIC_CAST(CTApparcTestNegativePrioStaticB*,CCoeEnv::Static(KUidTestStaticNegativePrioB));
+	}
+
+// inline functions for CTApparcTestPosPrioStaticA	
+inline CTApparcTestPosPrioStaticA::CTApparcTestPosPrioStaticA(RFile& aFile)
+	: CCoeStatic(KUidTestStaticPosPriA,EDefaultDestructionPriority),iFile(aFile)
+	{
+	}
+
+inline CTApparcTestPosPrioStaticA* CTApparcTestPosPrioStaticA::Self()
+	{
+	return STATIC_CAST(CTApparcTestPosPrioStaticA*,CCoeEnv::Static(KUidTestStaticPosPriA));
+	}
+
+// inline functions for CTApparcTestPosPrioStaticB		
+inline CTApparcTestPosPrioStaticB::CTApparcTestPosPrioStaticB(RFile& aFile)
+	: CCoeStatic(KUidTestStaticPosPriB,EDefaultDestructionPriority-1),iFile(aFile)
+	{
+	}
+
+inline CTApparcTestPosPrioStaticB* CTApparcTestPosPrioStaticB::Self()
+	{
+	return STATIC_CAST(CTApparcTestPosPrioStaticB*,CCoeEnv::Static(KUidTestStaticPosPriB));
+	}
+	
+// inline functions for CTApparcTestPrioZeroStaticA			
+inline CTApparcTestPrioZeroStaticA::CTApparcTestPrioZeroStaticA(RFile& aFile)
+	: CCoeStatic(KUidTestStaticPriZeroA,EPriorityZeroStaticA),iFile(aFile)
+	{
+	}
+
+inline CTApparcTestPrioZeroStaticA* CTApparcTestPrioZeroStaticA::Self()
+	{
+	return STATIC_CAST(CTApparcTestPrioZeroStaticA*,CCoeEnv::Static(KUidTestStaticPriZeroA));
+	}
+	
+// inline functions for CTApparcTestPrioOneStaticB					
+inline CTApparcTestPrioOneStaticB::CTApparcTestPrioOneStaticB(RFile& aFile)
+	: CCoeStatic(KUidTestStaticPriOneB,EPriorityOneStaticB),iFile(aFile)
+	{	
+	}
+
+inline CTApparcTestPrioOneStaticB* CTApparcTestPrioOneStaticB::Self()
+	{
+	return STATIC_CAST(CTApparcTestPrioOneStaticB*,CCoeEnv::Static(KUidTestStaticPriOneB));
+	}
+
+// inline functions for CTApparcTestPrioTwoStaticC						
+inline CTApparcTestPrioTwoStaticC::CTApparcTestPrioTwoStaticC(RFile& aFile)
+	: CCoeStatic(KUidTestStaticPriTwoC,EPriorityTwoStaticC),iFile(aFile)
+	{
+	}
+
+inline CTApparcTestPrioTwoStaticC* CTApparcTestPrioTwoStaticC::Self()
+{
+	return STATIC_CAST(CTApparcTestPrioTwoStaticC*,CCoeEnv::Static(KUidTestStaticPriTwoC));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TApparcTestApp.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,64 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// using relative paths for sourcepath and user includes
+// 
+//
+
+#include <platform_paths.hrh>
+
+TARGETPATH	/sys/bin
+TARGET		tapparctestapp.exe
+TARGETTYPE	exe
+
+
+epocstacksize 	0x5000
+
+
+CAPABILITY 	All -Tcb
+UID		0x100039CE  0x100048F3
+VENDORID 	0x70000001
+
+SOURCEPATH	.
+SOURCE		tapparctestapp.cpp
+
+USERINCLUDE	.
+
+SYSTEMINCLUDE	/epoc32/include ../inc
+SYSTEMINCLUDE 	/epoc32/include/test
+SYSTEMINCLUDE	/epoc32/include/techview
+
+MW_LAYER_SYSTEMINCLUDE
+
+RESOURCE	tApparctestapp.rss
+
+START RESOURCE  tApparctestapp.rss
+HEADER
+TARGETPATH	/resource/apps
+END
+
+START RESOURCE	tApparctestapp_reg.rss
+TARGETPATH	/private/10003a3f/import/apps
+END
+
+START RESOURCE	tApparctestapp_loc.rss
+TARGETPATH	/resource/apps
+LANG		sc
+END
+
+LIBRARY	apparc.lib
+LIBRARY	cone.lib
+LIBRARY	efsrv.lib
+LIBRARY	eikcore.lib
+LIBRARY	euser.lib
+LIBRARY	gdi.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TApparcTestApp.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,63 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file TApparcTestApp.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+
+NAME TCON
+
+#include <eikon.rh>
+#include <eikcore.rsg>
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+	{
+	hotkeys=r_tconetest_hotkeys;
+	menubar=r_tconetest_menubar;
+	}
+
+RESOURCE HOTKEYS r_tconetest_hotkeys
+    {
+    control=
+        {
+        HOTKEY { command=EEikCmdExit; key='e'; }
+        };
+    }
+
+RESOURCE MENU_BAR r_tconetest_menubar
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_tconetest_first_menu; txt="tconetest"; }
+	};
+    }
+
+RESOURCE MENU_PANE r_tconetest_first_menu
+    {
+	items=
+	  {
+	  MENU_ITEM { command=EEikCmdExit; txt="Close"; }
+          };
+    }
+
+RESOURCE TBUF r_tapparctest_text_Title { buf="tapparctest for static objects"; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TApparcTestApp_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file TApparcTestApp_reg.rss
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+
+UID3 0x100048F3  // App UID
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="TApparcTestApp";
+	localisable_resource_file="\\resource\\apps\\tapparctestapp_loc.rss";
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TBufferOnlyRec/10207f88.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+//  INCLUDES
+#include <RegistryInfo.rh>
+#include "TBufferOnlyRecUid.hrh"
+
+// RESOURCE DEFINITIONS
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE REGISTRY_INFO r_registry
+    {
+    dll_uid = KBufferOnlyRecDllUid;
+    interfaces =
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = 0x101F7D87; // Const for all Data Recognizers
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = KBufferOnlyRecImplUid; 
+                    version_no = 1;
+                    display_name = "TBufferOnlyRec";
+                    default_data = "";
+                    opaque_data = "";
+                    }
+                };
+            }
+        };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TBufferOnlyRec/TBufferOnlyRec.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,86 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "TBufferOnlyRec.h"
+#include "TBufferOnlyRecUid.hrh"
+#include <ImplementationProxy.h>
+
+enum TMimeTypes
+    {
+    EMimeType = 0,
+    ELastType
+    };
+
+
+_LIT8(KMimeType,"text/plain");
+
+CBufferOnlyRec::CBufferOnlyRec() 
+: CApaDataRecognizerType(TUid::Uid(KBufferOnlyRecDllUid), CApaDataRecognizerType::ENormal)
+    {
+    iCountDataTypes = ELastType;
+    iRecogs = 0;
+    }
+
+CApaDataRecognizerType* CBufferOnlyRec::CreateRecognizerL()
+    {
+    return new(ELeave) CBufferOnlyRec;
+    }
+
+TUint CBufferOnlyRec::PreferredBufSize()
+    {
+    return 250;
+    }
+
+TDataType CBufferOnlyRec::SupportedDataTypeL(TInt aIndex) const
+    {
+    if (aIndex != EMimeType)
+        {
+        User::Leave(KErrNotSupported);
+        }
+    return TDataType(KMimeType);
+    }
+
+void CBufferOnlyRec::DoRecognizeL(const TDesC& /*aName*/, const TDesC8& aBuffer)
+    {
+    if (aBuffer.CompareC(_L8("Text_TestRecognizer")) == 0)
+        {
+        iDataType = TDataType(KMimeType);
+        iConfidence = ECertain;
+        }
+    else if (aBuffer.CompareC(_L8("AnotherText")) == 0)
+        {
+        iDataType = TDataType(KNullDesC8);
+        iConfidence = EProbable;
+        }
+    else
+    	{
+    	iDataType = TDataType(KNullDesC8); 	
+    	iConfidence = ENotRecognized;
+    	}
+    iRecogs++;  
+    }
+
+const TImplementationProxy ImplementationTable[] =
+    {
+    IMPLEMENTATION_PROXY_ENTRY(KBufferOnlyRecImplUid,
+        CBufferOnlyRec::CreateRecognizerL)
+    };
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+    TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TBufferOnlyRec/TBufferOnlyRec.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,37 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef TBUFFERONLYREC_H
+#define TBUFFERONLYREC_H
+
+#include <apmrec.h> 
+#include <f32file.h>
+
+class CBufferOnlyRec : public CApaDataRecognizerType
+    {
+public: // Constructors and destructor
+    CBufferOnlyRec();
+    static CApaDataRecognizerType* CreateRecognizerL();
+
+public: // Functions from base classes
+    TUint PreferredBufSize();
+    TDataType SupportedDataTypeL(TInt aIndex) const;
+    void DoRecognizeL(const TDesC& aName, const TDesC8& aBuffer);
+
+private:
+    TInt iRecogs;
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TBufferOnlyRec/TBufferOnlyRec.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,45 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TBufferOnlyRec.dll Test application recogniser
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+target		TBufferOnlyRec.dll
+targettype	plugin
+
+uid		0x10009d8d 0x10207f88
+
+CAPABILITY	ALL -Tcb
+
+VENDORID 0x70000001
+
+systeminclude	/EPOC32/INCLUDE/ECOM
+
+SOURCEPATH	.
+systeminclude   ../../INC
+systeminclude   /EPOC32/INCLUDE /EPOC32/INCLUDE/TEST
+
+source          TBufferOnlyRec.cpp
+
+library         EUSER.LIB APMIME.LIB APPARC.LIB
+
+START resource	10207f88.rss
+target TBufferOnlyRec.rsc
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TBufferOnlyRec/TBufferOnlyRecUid.hrh	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,24 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef TBUFFERONLYRECUID_HRH
+#define TBUFFERONLYRECUID_HRH
+
+// Recognizer UIDs
+#define KBufferOnlyRecDllUid    0x10207f88
+#define KBufferOnlyRecImplUid   0x10207f89
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TCmdLineExe.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,84 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TCmdLineExe.CPP - to test commandline APIS
+// This exe is called in testCmdLinesAPIsL in T_CmdlnStep.CPP
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include <e32std.h>
+#include <e32uid.h>
+#include <e32base.h>
+#include <e32test.h>
+#include  <apacmdln.h>
+#include "T_CmdlnStep.h"
+
+
+// Global functions
+
+/**  This function gets the file handle from the commandline object. It returns KErrNone when successful in reading
+     a file else it returns a system-wide error
+*/
+
+TInt DoReadFileL()
+	{
+	RFile file;
+	TBuf8<8> fileRead;
+    CApaCommandLine* cmdLine;
+    TInt ret(0);
+	ret = CApaCommandLine::GetCommandLineFromProcessEnvironment(cmdLine);
+	User::LeaveIfError(ret);
+	CleanupStack::PushL(cmdLine);
+
+	cmdLine->GetFileByHandleL(file);
+    ret = file.Read(fileRead);
+	file.Close();
+    CleanupStack::PopAndDestroy(cmdLine); 
+	return ret;
+	}
+
+GLDEF_C TInt E32Main()
+	{
+
+
+	__UHEAP_MARK;
+    CTrapCleanup *cleanup=CTrapCleanup::New();
+   
+   	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+    TInt val(0);
+    
+    TRAPD(err,val= DoReadFileL());
+    delete(cleanup);
+	__UHEAP_MARKEND;
+    
+    if((err==KErrNone) && (val ==KErrNone ))
+    	{
+    		return KFileHandleTestPassed;
+    	}
+    else
+    	{
+    		return KErrGeneral;
+    	}
+
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TCmdLineExe.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+// TCmdLineExe.mmp
+
+
+target          TCmdLineExe.EXE
+targettype      EXE
+targetpath      /system/programs\
+
+UID      0x10208180 
+VENDORID 0x70000001
+
+SOURCEPATH	../TEF		
+
+userinclude     ../TEF
+systeminclude   ../INC 	
+systeminclude   /EPOC32/INCLUDE /EPOC32/INCLUDE/TEST
+
+source          TCmdLineExe.CPP
+
+userinclude		../../uiftestfw/inc
+
+library         EUSER.LIB APPARC.LIB EFSRV.LIB APPFWK_TEST_APPUI.LIB
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TCtrlPnlApp_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,38 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TCtrlPnlApp
+// 
+//
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10207f79
+RESOURCE APP_REGISTRATION_INFO
+	{	
+	app_file="TCtrlPnlApp";
+	attributes=KAppIsControlPanelItem;
+	datatype_list = 
+		{
+		DATATYPE { priority=EDataTypePriorityNormal; type="text/plain"; }
+		};
+	file_ownership_list = 
+		{
+		FILE_OWNERSHIP_INFO { file_name="C:\\System\\file2"; }
+		};
+	service_list =
+		{
+		SERVICE_INFO { uid = 0x10101010;}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TDoNothingFileRecognizer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,77 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include <apfrec.h>
+
+#include <ImplementationProxy.h>
+
+/**   Recognizer doing nothing for checking the defect DEF039651.
+      Change Apparc's TRecognizerName in a similar way to EMime's was in DEF037809" */
+
+class CDoNothingFileRec : public CApaFileRecognizerType
+	{
+public: // from CApaFileRecognizerType
+	static CApaFileRecognizerType* CreateRecognizerL();
+	TThreadId RunL(TApaCommand aCommand,const TDesC* aDocFileName=NULL,const TDesC8* aTailEnd=NULL) const;
+private: // from CApaFileRecognizerType
+	TRecognizedType DoRecognizeFileL(RFs& aFs,TUidType aType);
+	};
+
+TThreadId CDoNothingFileRec::RunL(TApaCommand /*aCommand*/,const TDesC* /*aDocFileName*/,const TDesC8* /*aTailEnd*/) const
+	{
+	TThreadId id(NULL);
+	return id;
+	}
+
+CApaFileRecognizerType::TRecognizedType CDoNothingFileRec::DoRecognizeFileL(RFs& /*aFs*/,TUidType /*aType*/)
+	{
+	return iRecognizedType;
+	}
+
+
+
+CApaFileRecognizerType* CDoNothingFileRec::CreateRecognizerL()
+	{
+	CDoNothingFileRec* doNothingFileRec=new (ELeave) CDoNothingFileRec();
+	return doNothingFileRec;
+	//return new (ELeave) CExampleFileRecognizer ();
+	}
+
+const TImplementationProxy ImplementationTable[] =
+{
+IMPLEMENTATION_PROXY_ENTRY(0x101DC568, CDoNothingFileRec::CreateRecognizerL)
+};
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
+	
+GLDEF_C TInt E32Dll(
+					)
+
+// DLL entry point
+
+	{
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TDoNothingFileRecognizer_v2.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,37 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TDONOTHINGFILERECOGNIZER.MMP
+// 
+//
+
+#include <platform_paths.hrh>
+
+target          TDONOTHINGFILERECOGNIZER.DLL
+capability		All -Tcb
+targettype      PLUGIN
+UID				0x10009D8D  0x10000180
+VENDORID 		0x70000001
+
+SOURCEPATH		.
+SOURCE			TDoNothingFileRecognizer.CPP
+SYSTEMINCLUDE   /epoc32/include
+systeminclude	/epoc32/include/ecom 
+
+MW_LAYER_SYSTEMINCLUDE
+
+library         	EUSER.LIB APPARC.LIB
+
+start resource	10000180.RSS
+TARGET		TDONOTHINGFILERECOGNIZER.rsc
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TESTREC/102032A5.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,47 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Resource File  for the Test Data Recognizer TESTREC \n
+// 
+//
+
+
+
+/**
+ @file 102032A5.rss
+*/
+
+#include <RegistryInfo.rh>
+
+RESOURCE REGISTRY_INFO r_registry
+	{
+	dll_uid = 0x102032A5; //should match name of this file
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = 0x101F7D87;  // need to create this uid in the uid database
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 0x102032A6;
+					version_no = 1;
+					display_name = "TestREC";
+					default_data = "";        // Notify Interface
+					opaque_data = "";
+					}
+				};
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TESTREC/TESTREC.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,198 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Defines a data recognizer
+// Defines a test recognizer class which recognizes data type "test/plain".\n
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include "testrec.h"
+
+/**
+  
+   Recognizer used as part of CommandLine tests
+   
+   @SYMPREQ 280 File Handle Support
+ 
+   FunctionDesc : Constructor for the recognizer of data type "test\plain" . 
+   
+ */
+
+CAppTestRecognizer::CAppTestRecognizer()
+	:CApaDataRecognizerType(KUidTestTxtRecognizer,CApaDataRecognizerType::ELow)
+	// Text files are low recognition - they don't have a clear signature
+	{
+	iCountDataTypes=1;
+	}
+
+/**
+  
+   Recognizer used as part of CommandLine tests
+  
+   @SYMPREQ 280 File Handle Support
+  
+   FunctionDesc : Specifies the buffer size required by the data type
+  
+ */
+TUint CAppTestRecognizer::PreferredBufSize()
+	{
+	return KMaxBufferLength;
+	}
+
+/**
+  
+   Recognizer used as part of CommandLine tests
+  
+   @SYMPREQ 280 File Handle Support
+   
+   FunctionDesc : Returns the data type supported : test\plain
+  
+ */
+#if defined(_DEBUG)
+TDataType CAppTestRecognizer::SupportedDataTypeL(TInt aIndex) const
+#else
+TDataType CAppTestRecognizer::SupportedDataTypeL(TInt /*aIndex*/) const
+#endif
+	{
+	__ASSERT_DEBUG(aIndex==0,User::Invariant());
+	return TDataType(KDataTypeTestPlain);
+	}
+
+ /**
+  
+   Recognizer used as part of CommandLine tests
+  
+   @SYMPREQ 280 File Handle Support
+  
+   FunctionDesc :  Should recognize the data type of the file. 
+   Called by the RecognizeL function.
+   Checks if the first three bytes are valid uids.If yes the file is not a plain/test
+   Verifies if the file extension is .test
+   Checks for characters that wont be in a text file.
+  
+ */
+void CAppTestRecognizer::DoRecognizeL(const TDesC& aName, const TDesC8& aBuffer)
+	{
+	TBool nameRecognized=EFalse;
+    
+	// check if the file has valid UIDs 
+	if (aBuffer.Length() >= 16)
+		{
+		// if the first 3 bytes are valid UIDs,then this file is not a plain/test. 
+		// Set iConfidence appropriately and exit.
+		const TCheckedUid checkUid(aBuffer.Left(16));    
+		if (checkUid.UidType().IsValid())
+			{
+			iConfidence=ENotRecognized;
+			return;
+			}
+		}
+
+	// Compare if the file extension is .TEST
+	if (aName.Length()>4)
+		{
+		nameRecognized=(aName.Right(5).CompareF(KTestFileExt)==0);
+		}
+		
+	const TInt length=Min(aBuffer.Length(), KMaxBufferLength);
+	
+	if (length<KMinBufferLength && !nameRecognized)
+		{
+		return;
+		}
+		
+	
+	// Check for characters that wont be in a text file
+	TInt index;
+	for (index=0; index<length; index++)
+		{
+		const TUint chr=aBuffer[index];
+		// these are guesses of what WON'T be in a text file
+		if (chr<9 || chr==11 || chr==12 || (chr>13 && chr<32))
+			{
+			break;
+			}
+		if (chr>148)
+			{
+			break;
+			}
+		}
+	const TBool validChars=(index==length);
+	
+	if (nameRecognized)
+		{
+		iConfidence=validChars? EProbable : EUnlikely;
+		}
+	else
+		{
+		if (!validChars)
+			{
+			return;
+			}
+		iConfidence=EPossible;
+		}
+	iDataType=TDataType(KDataTypeTestPlain);
+	}
+
+/**
+  
+   Recognizer used as part of CommandLine tests
+  
+  
+   @SYMPREQ 280 File Handle Support
+  
+   FunctionDesc : Creates an instance of the recognizer . 
+   
+ */
+
+CApaDataRecognizerType* CAppTestRecognizer::CreateRecognizerL()
+	{
+	return new (ELeave) CAppTestRecognizer();
+	}
+	
+/**
+  
+   Recognizer used as part of CommandLine tests
+  
+   @SYMPREQ 280 File Handle Support
+  
+   Desc : Implementation table specifying the implementation uid . 
+   
+ */
+const TImplementationProxy ImplementationTable[] = 
+    {
+	IMPLEMENTATION_PROXY_ENTRY(KTestTxtRecognizerValue,CAppTestRecognizer::CreateRecognizerL)
+	};
+
+/**
+  
+   Recognizer used as part of CommandLine tests
+  
+   @SYMPREQ 280 File Handle Support
+  
+   FunctionDesc : Returns the implementation table. 
+   
+  
+ */
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TESTREC/TESTREC.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,56 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Header File for the data recognizer
+// Declares a test recognizer class which recognizes data type "test/plain".\n
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#if !defined(__TESTREC_H__)
+#define __TESTREC_H__
+
+#if !defined(__APMREC_H__)
+#include <apmrec.h>
+#endif
+
+#include <apmstd.h>
+#include <ImplementationProxy.h>
+
+class CAppTestRecognizer : public CApaDataRecognizerType
+	{
+public: // from CApaDataRecognizerType
+	CAppTestRecognizer();
+	TUint PreferredBufSize();
+	TDataType SupportedDataTypeL(TInt aIndex) const;
+	//for ECOM
+	static CApaDataRecognizerType* CreateRecognizerL();
+private: // from CApaFileRecognizerType
+	void DoRecognizeL(const TDesC& aName, const TDesC8& aBuffer);
+	};
+
+const TInt KTestTxtRecognizerValue=0x102032A6;
+const TUid KUidTestTxtRecognizer={0x102032A6};
+const TInt KMinBufferLength=42;  // minimum amount of file needed to determine a text file IF it's not called .TEST
+const TInt KMaxBufferLength=1024; // maximum amount of buffer space we will ever use
+_LIT8(KDataTypeTestPlain,"test/plain");
+_LIT(KTestFileExt,".TEST");
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TESTREC/TESTREC.MMP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,45 @@
+
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TESTREC.dll Test application recogniser
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+target		TESTREC.DLL
+targettype	plugin
+
+uid		0x10009d8d 0x102032A5
+CAPABILITY	ALL -Tcb
+
+VENDORID 0x70000001
+
+systeminclude	/EPOC32/INCLUDE/ECOM
+
+SOURCEPATH	.
+systeminclude   ../../INC
+systeminclude   /EPOC32/INCLUDE /EPOC32/INCLUDE/TEST
+
+source          TESTREC.CPP
+
+library         EUSER.LIB APMIME.LIB APPARC.LIB
+
+START resource	102032A5.rss
+target testrec.rsc
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TEXE.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,91 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include <e32std.h>
+#include <e32uid.h>
+#include <e32base.h>
+#include <e32test.h>
+#include <apadef.h>
+
+//const TInt KTexeUidValue=0x10004c6b;
+//const TUid KUidTExe={KTexeUidValue};
+
+// Global functions
+
+
+void DoThings(const TApaCommandLine& aCommandLine)
+	{
+	RTest test(_L("TEXE"));
+	test.Title();
+	test.Start(_L("The test dxe has been loaded."));
+	test.Printf(_L("\n"));
+	test.Printf(aCommandLine);
+	test.Printf(_L("\n"));
+	test.End();
+	test.Close();
+	}
+
+
+// dll/exe bits
+
+
+/**
+#if defined(__WINS__)
+
+EXPORT_C TInt EntryPoint(TAny* aParam)
+	{
+	__UHEAP_MARK;
+    CTrapCleanup *cleanup=CTrapCleanup::New();
+	//
+	TApaCommandLine& docName=*(TApaCommandLine*)aParam;
+    DoThings(docName);
+	//
+    delete(cleanup);
+	__UHEAP_MARKEND;
+    return(0);
+	}
+
+
+GLDEF_C TInt E32Dll(TDllReason)
+	{
+	return(KErrNone);
+	}
+
+#else
+*/
+
+GLDEF_C TInt E32Main()
+	{
+	__UHEAP_MARK;
+    CTrapCleanup *cleanup=CTrapCleanup::New();
+	//
+    TApaCommandLine commandline;
+		User::CommandLine(commandline);
+    	
+    DoThings(commandline);
+	//
+    delete(cleanup);
+	__UHEAP_MARKEND;
+    return(0);
+	}
+
+// #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TEXE_V2.MMP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+//
+// TEXE.MMP for test component TEXE (released in APPARC)
+//
+
+target          TEXE.EXE
+targettype      EXE
+targetpath      /sys/bin\
+
+UID      0x100039CE 0x10004c6b
+VENDORID 0x70000001
+
+SOURCEPATH	../TEF		// source files
+
+userinclude     ../TEF
+systeminclude   ../INC 	// your public include directory should be here
+systeminclude   /EPOC32/INCLUDE
+
+source          TEXE.CPP
+
+library         EUSER.LIB
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TEndTaskTestApp/EndTaskTestApp.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,214 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <eikstart.h> 
+#include <eikapp.h>
+#include <eikenv.h>
+#include <apgtask.h>
+#include "EndTaskTestApp.h"
+#include "EndTaskTestAppExternalInterface.h"
+
+/**
+Standard DLL entry point function.
+Creates and returns an instance of the CApaApplication-derived class.
+
+@return an instance of the CApaApplication-derived class
+*/
+TInt E32Main()
+	{
+	return EikStart::RunApplication( CEndTaskTestApplication::NewApplication );
+	}
+
+/**
+Default constructor
+*/
+CEndTaskTestApplication::CEndTaskTestApplication()
+	{
+	}
+
+/**
+Virtual destructor
+*/	
+CEndTaskTestApplication::~CEndTaskTestApplication()
+	{
+	}
+		
+/**
+@return The application's UID 
+*/
+TUid CEndTaskTestApplication::AppDllUid() const
+	{
+	const TUid dll = {KUidEndTaskAppUid};
+	return dll;
+	}
+
+/**
+@return CEndTaskTestApplication or NULL if KErrNoMemory
+*/
+CApaApplication* CEndTaskTestApplication::NewApplication()
+	{
+	// As the framework has at this point not started up enough, and therefore the TRAP-harness and 
+	// exception handlers aren’t available yet, this factory function is a non-leaving function and 
+	// can't use the new(Eleave) operator.
+	return new CEndTaskTestApplication();
+	}
+	
+/**
+Called by the UI framework at application start-up to create an instance of the document class.
+
+@leave	KErrNoMemory
+@return A CExampleDocument
+*/
+CApaDocument* CEndTaskTestApplication::CreateDocumentL()
+	{
+	return CEndTaskTestDocument::NewL(*this);
+	}
+
+/**
+Constructor
+*/
+CEndTaskTestDocument::CEndTaskTestDocument(CEikApplication& aApp) : CEikDocument(aApp)
+	{
+	}
+
+/**
+Virtual destructor
+*/
+CEndTaskTestDocument::~CEndTaskTestDocument()
+	{
+	}
+
+/**
+Factory function for this class
+@return a new CEndTaskTestDocument instance.
+*/
+CEndTaskTestDocument* CEndTaskTestDocument::NewL(CEikApplication& aApp)
+	{
+	return new(ELeave) CEndTaskTestDocument(aApp);
+	}
+
+
+/**
+Called by the UI framework to construct the application UI class. 
+Note that the app UI's ConstructL() is called by the UI framework.
+*/
+CEikAppUi* CEndTaskTestDocument::CreateAppUiL()
+	{
+	return new(ELeave) CEndTaskTestAppUi();
+	}
+
+/**
+Constructor
+*/
+CEndTaskTestAppUi::CEndTaskTestAppUi()
+	{
+	}
+
+/**
+Virtual destructor
+*/
+CEndTaskTestAppUi::~CEndTaskTestAppUi()
+	{
+	}
+
+/**
+Second phase constructor of the application UI class.
+It creates and owns a single view. The view contents are not created 
+until the first time view is activated.
+*/
+void CEndTaskTestAppUi::ConstructL()
+	{
+	// Complete the UI framework's construction of the App UI.
+	BaseConstructL(CEikAppUi::ENoAppResourceFile);
+	
+	// Set higher prio to preempt test-server as soon as we have an event
+	User::SetPriorityControl(EFalse);
+	RProcess p;
+	p.SetPriority(EPriorityHigh);
+	}
+
+/**
+Events published in externalinterface.h and utilized by T_EndTaskStep.cpp
+*/
+void CEndTaskTestAppUi::HandleApplicationSpecificEventL(TInt aType,const TWsEvent& /*aEvent*/)
+	{
+	switch (aType)
+		{
+		case EEndTaskTestAppSetSystem:
+			static_cast<CEikonEnv*>(iCoeEnv)->SetSystem(ETrue);
+			break;
+		case EEndTaskTestAppSetNormal:
+			static_cast<CEikonEnv*>(iCoeEnv)->SetSystem(EFalse);
+			break;
+		case ECallEndTaskWithoutPwrMgmt:
+			{
+			TApaTaskList taskList(iEikonEnv->WsSession());
+			TApaTask task = taskList.FindApp(Application()->AppDllUid());
+			task.EndTask();
+			break;
+			}
+		case ESimulateHackerAttack1:
+			{
+			TWsEvent event;
+			TApaTaskList taskList(iEikonEnv->WsSession());
+			TApaTask task = taskList.FindApp(Application()->AppDllUid());
+			// First variant should be sorted by CCoeAppUi::HandleWsEventL
+			event.SetType(EEventUser);
+			*(TApaSystemEvent*)(event.EventData())=EApaSystemEventSecureShutdown;	
+			iEikonEnv->WsSession().SendEventToWindowGroup(task.WgId(), event);
+			break;
+			}
+		case ESimulateHackerAttack2:
+			{
+			TWsEvent event;
+			TApaTaskList taskList(iEikonEnv->WsSession());
+			TApaTask task = taskList.FindApp(Application()->AppDllUid());
+			// Second variant should be handled by wserv's Client::CommandL case EWsClOpSendEventToWindowGroup
+			event.SetType(EEventPowerMgmt);
+			*(TApaSystemEvent*)(event.EventData())=EApaSystemEventSecureShutdown;
+			RWsSession wsSession;
+			wsSession.Connect();
+			wsSession.SendEventToWindowGroup(task.WgId(), event);
+			wsSession.Close();
+			break;
+			}
+		case ESimulateHackerAttack3:
+			{
+			TWsEvent event;
+			// Third variant should be handled by wserv's Client::CommandL case EWsClOpSendEventToAllWindowGroup
+			event.SetType(EEventPowerMgmt);
+			*(TApaSystemEvent*)(event.EventData())=EApaSystemEventSecureShutdown;
+			RWsSession wsSession;
+			wsSession.Connect();
+			wsSession.SendEventToAllWindowGroups(event);
+			wsSession.Close();
+			break;
+			}
+		default:
+			break;
+		}
+	}
+	
+void CEndTaskTestAppUi::HandleCommandL(TInt aCommand)	
+	{
+	switch(aCommand)
+		{
+		case EEikCmdExit:
+			Exit();
+			break;
+		default:
+			break;
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TEndTaskTestApp/EndTaskTestApp.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,78 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __ENDTASKTESTAPP_H
+#define __ENDTASKTESTAPP_H
+
+
+/**
+Application class
+*/
+#include <eikapp.h>
+class CEndTaskTestApplication : public CEikApplication
+	{
+public:
+	static CApaApplication* NewApplication();
+	~CEndTaskTestApplication();
+	
+private:
+	CEndTaskTestApplication();
+	
+	// from CApaApplication
+	TUid AppDllUid() const;
+	CApaDocument* CreateDocumentL();
+	};
+
+
+/**
+Document class
+*/
+#include <eikdoc.h>
+class CEikAppUi;
+class CEikApplication;
+class CEndTaskTestDocument : public CEikDocument
+	{
+public:
+	static CEndTaskTestDocument* NewL(CEikApplication& aApp);
+	~CEndTaskTestDocument();
+	
+private:
+	CEndTaskTestDocument(CEikApplication& aApp);
+	
+	// from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+
+/**
+Application UI class, root of all graphical user interface in this application
+*/
+#include <eikappui.h>
+class CEndTaskTestAppUi : public CEikAppUi
+    {
+public:
+	CEndTaskTestAppUi();
+	~CEndTaskTestAppUi();
+	
+	// from CEikAppUi
+	void ConstructL();
+	void HandleCommandL(TInt aCommand);
+	
+	// from CCoeAppUi
+	void HandleApplicationSpecificEventL(TInt aType,const TWsEvent& aEvent);
+	};
+
+
+#endif // __ENDTASKTESTAPP_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TEndTaskTestApp/EndTaskTestApp.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,54 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "EndTaskTestAppExternalInterface.h"
+#include <platform_paths.hrh>
+
+TARGET			EndTaskTestApp.exe
+TARGETTYPE		exe
+CAPABILITY  	SwEvent
+
+UID           	0x100039CE KUidEndTaskAppUid
+VENDORID 		0x70000001
+
+SOURCEPATH    	.
+SOURCE        	EndTaskTestApp.cpp
+
+USERINCLUDE   	.
+SYSTEMINCLUDE 	/epoc32/include	/epoc32/include/techview 
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY     euser.lib 
+LIBRARY		apparc.lib 
+LIBRARY		apgrfx.lib 
+LIBRARY		cone.lib 
+LIBRARY		eikcore.lib
+LIBRARY		ws32.lib 
+LIBRARY		gdi.lib
+
+
+// Registration file
+SOURCEPATH    	.
+START RESOURCE	EndTask_reg.rss
+TARGETPATH		/private/10003a3f/apps
+END
+
+// Application resource file
+SOURCEPATH    	.
+START RESOURCE	EndTaskTestApp.rss
+HEADER
+TARGETPATH		/resource/apps
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TEndTaskTestApp/EndTaskTestApp.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,27 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+NAME AAAA
+
+#include <eikon.rh>
+#include <appinfo.rh>
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TEndTaskTestApp/EndTaskTestAppExternalInterface.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,29 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+#ifndef __ENDTASKEXTINTERFACE_H
+#define __ENDTASKEXTINTERFACE_H
+
+#define KUidEndTaskAppUid 0x10282B33
+#define EEndTaskTestAppSetSystem 1001 // EEventUser+1
+#define EEndTaskTestAppSetNormal 1002
+
+#define ECallEndTaskWithoutPwrMgmt 1003
+#define ESimulateHackerAttack1 1004
+#define ESimulateHackerAttack2 1005
+#define ESimulateHackerAttack3 1006
+
+#endif // __ENDTASKEXTINTERFACE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TEndTaskTestApp/EndTask_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,26 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <appinfo.rh>
+#include "EndTaskTestAppExternalInterface.h"
+
+UID2 KUidAppRegistrationResourceFile
+UID3 KUidEndTaskAppUid 
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	// filename of application binary (minus extension)
+	app_file="EndTaskTestApp";
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TIconLoaderAndIconArrayForLeaks.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,70 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Test for PDEF104113: This method is for memory leaks test when iconArray is created and deleted. 
+// This method is put in a separate dll in order to avoid exporting methods 
+// in server side classes (e.g., APPARC\apgrfx\CApaAppList) for test code. 
+// It is called by void CT_RApaLsSessionTestStep::TestIconLoaderAndIconArrayMemoryLeaksL() 
+// in apparctestserver
+// 
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+
+#include <APGAPLST.H>
+#include <bautils.h>
+#include <APGICNFL.H> 
+#include <APFDEF.H>
+#include "APGAIR.H"
+#include <APGICNFL.H> 
+#include "apprivate.h"
+#include <barsc2.h>
+#include <barsread2.h>
+#include <e32uid.h>
+#include "APGSTD.H"
+#include "TIconLoaderAndIconArrayForLeaks.h"
+#include "apsiconcaptionoverride.h"
+
+
+EXPORT_C void TIconLoaderAndIconArrayForLeaks::TestIconLoaderAndIconArrayL()
+	{
+	RFs tempFs;
+	User::LeaveIfError(tempFs.Connect());
+	CleanupClosePushL(tempFs);
+
+	CApaIconLoader* iconLoader = CApaIconLoader::NewLC(tempFs);
+	CApaAppIconArray* icons = CApaAppIconArray::NewRealDefaultIconsLC(KNumberOfIconsInDefaultMbm,KDefaultAppIconMbm, *iconLoader);
+	CleanupStack::PopAndDestroy(2,iconLoader);
+	CleanupStack::PopAndDestroy(&tempFs);
+	}
+
+EXPORT_C void TIconLoaderAndIconArrayForLeaks::TestIconCaptionOverridesL()
+	{
+	CApaIconCaptionOverrides* iconcap = NULL;
+	CApaIconCaptionOverridesForApp* iconCapOverride = CApaIconCaptionOverridesForApp::NewL();
+	CleanupStack::PushL(iconCapOverride);
+	CActiveScheduler* sched = NULL;
+	sched = new(ELeave) CActiveScheduler;
+	CleanupStack::PushL(sched);
+	CActiveScheduler::Install(sched);
+	CApaIconCaptionCenrepObserver* observer = CApaIconCaptionCenrepObserver::NewL(*iconcap);
+	CleanupStack::PushL(observer);
+	CleanupStack::PopAndDestroy(3,iconCapOverride);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TIconLoaderAndIconArrayForLeaks.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,32 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code  
+*/
+
+
+const TInt KNumberOfIconsInDefaultMbm = 3;
+
+class TIconLoaderAndIconArrayForLeaks
+	{
+public:
+	IMPORT_C static void TestIconLoaderAndIconArrayL();
+	IMPORT_C static void TestIconCaptionOverridesL();
+	};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TIconLoaderAndIconArrayForLeaks.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,70 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code  
+*/
+
+
+target		TIconLoaderAndIconArrayForLeaks.dll
+TARGETTYPE 	DLL
+UID         0x1000008D 0x102833D0 	
+VENDORID 	0x70000001
+
+CAPABILITY 	All -Tcb
+
+SOURCEPATH    	.
+SOURCE		TIconLoaderAndIconArrayForLeaks.cpp
+
+SOURCEPATH	 ../apserv
+SOURCE		 apsiconcaptionoverride.cpp
+
+SOURCEPATH  ../apgrfx
+#if defined SYMBIAN_APPARC_APPINFO_CACHE
+	source          	APGAPLSTV2.CPP
+#else
+	source          	APGAPLST.CPP
+#endif
+source      APGCTL.CPP APGDOOR.CPP APGICNFL.CPP APGSTD.CPP APGTASK.CPP
+source		APGWGNAM.CPP APGCLI.CPP APGPRIV.CPP
+source		apgnotif.cpp APGAIR.CPP APGAIRV2.CPP APSCLI.CPP apgconstdata.cpp
+source		apsecutils.cpp
+
+
+USERINCLUDE   	.
+USERINCLUDE		../apgrfx
+USERINCLUDE 	../apserv
+USERINCLUDE		../inc
+SYSTEMINCLUDE 	/epoc32/include
+SYSTEMINCLUDE 	/epoc32/include/techview
+ 
+library         euser.lib apparc.lib apmime.lib gdi.lib estor.lib efsrv.lib fbscli.lib
+library         bitgdi.lib ws32.lib bafl.lib
+library         apserv.lib apfile.lib centralrepository.lib
+#ifdef SYMBIAN_BAFL_SYSUTIL
+library sysutil.lib
+#endif
+
+macro 			UI_FRAMEWORKS_V1_REMNANT_FOR_JAVA_MIDLET_INSTALLER
+
+#if defined SYMBIAN_APPARC_APPINFO_CACHE
+	deffile		TICONFORLEAKS.DEF
+#else
+	deffile		TICONFORLEAKSV2.DEF
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TLongUrlRecognizer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,107 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This recognizer is part of the supporting test code
+// for T_StartDocStep.CPP
+// This recognizer only exists to associate the document
+// name KLitLongURL (defined in TStartDoc.h) with the
+// TStartDocApp.app application.
+// This enables T_StartDocStep.CPP to launch TStartDocApp.app
+// by starting the document KLitLongURL.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <E32STD.H>
+#include <E32BASE.H>
+#include <APMSTD.H>
+#include <APMREC.H>
+#include "TStartDoc.h"
+
+#include <apfrec.h>
+#include <ImplementationProxy.h> 
+
+
+const TUid KUidMimeLongURLRecognizer={0x10004c4e};
+const TInt KNumDataTypes = 1;
+_LIT8(KLitMimeType_LongURL, "x-epoc/long-url");
+
+// CLongUrlRec
+
+class CLongUrlRec : public CApaDataRecognizerType
+	{
+public:
+	CLongUrlRec();
+	static CApaDataRecognizerType* CreateRecognizerL();
+private:
+	// from CApaDataRecognizerType
+	virtual TUint PreferredBufSize();
+	virtual TDataType SupportedDataTypeL(TInt aIndex) const;
+	virtual void DoRecognizeL(const TDesC& aName, const TDesC8& aBuffer);
+	};
+
+CLongUrlRec::CLongUrlRec()
+	:CApaDataRecognizerType(KUidMimeLongURLRecognizer, EHigh)
+	{
+	iCountDataTypes=KNumDataTypes;
+	}
+
+TUint CLongUrlRec::PreferredBufSize()
+	{
+	return 0;
+	}
+
+TDataType CLongUrlRec::SupportedDataTypeL(TInt /*aIndex*/) const
+	{
+	return TDataType(KLitMimeType_LongURL);
+	}
+
+void CLongUrlRec::DoRecognizeL(const TDesC& aName, const TDesC8&)
+	{
+	if (aName==KLitLongURL)
+		{
+		iDataType=TDataType(KLitMimeType_LongURL); // TStartDocApp.app supports mime type KLitMimeType_LongURL
+		iConfidence=ECertain;
+		}
+	}
+
+// stand-alone functions
+
+
+GLDEF_C TInt E32Dll(
+					)
+	{
+	return KErrNone;
+	}
+	
+CApaDataRecognizerType* CLongUrlRec::CreateRecognizerL()
+	{
+	return new (ELeave) CLongUrlRec();
+	}
+
+const TImplementationProxy ImplementationTable[] = 
+    {
+	IMPLEMENTATION_PROXY_ENTRY(0x101F7D8D,CLongUrlRec::CreateRecognizerL)
+	};
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TLongUrlRecognizer_v2.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,33 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TLongUrlRecognizer.mmp
+// 
+//
+
+TARGET			TLongUrlRecognizer.dll
+CAPABILITY		All -Tcb
+TARGETTYPE		PLUGIN
+UID				0x10009d8d 0x10004c4e
+VENDORID 		0x70000001
+
+SOURCEPATH		.
+SOURCE			TLongUrlRecognizer.cpp
+systeminclude   /EPOC32/INCLUDE
+systeminclude	/EPOC32/INCLUDE/ECOM
+
+LIBRARY			EUSER.LIB APMIME.LIB 
+
+start resource 10004c4e.rss
+target tlongurlrecognizer.rsc
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TMimeRec/102822B7.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,41 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <RegistryInfo.rh>
+#include "constants.hrh"
+
+
+RESOURCE REGISTRY_INFO r_registry
+	{
+	dll_uid = 0x102822B7; //should match name of this file
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = 0x101F7D87; // Const for all Data Recognizers
+			implementations =
+			 {
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = KUidMmrRecognizerValue; // Our test recognizer
+					version_no = 1;
+					display_name = "recmime";
+					default_data = "";        // Notify Interface
+					opaque_data = "";
+					}
+				};
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TMimeRec/constants.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,36 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#if !defined(__RECMIMECONSTANTS_H__)
+#define __RECMIMECONSTANTS_H__
+
+_LIT(KRscTargetDir,"c:\\resource\\plugins\\");
+_LIT(KRscSourcePathWinscw,"z:\\resource\\plugins\\recmime.rsc");
+_LIT(KRscSourcePathArmv5, "z:\\apparctest\\dummy.rsc");
+_LIT(KRscTargetPath,"c:\\resource\\plugins\\dummy.rsc");
+
+_LIT8(KDataTypeNew,"mime/mmr");
+
+const TUid KUidMmrRecognizer={KUidMmrRecognizerValue};
+const TInt KNumMimeTypes=1;
+	
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TMimeRec/constants.hrh	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,28 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#if !defined(__RECMIMECONSTANTS_HRH__)
+#define __RECMIMECONSTANTS_HRH__
+
+#define KUidMmrRecognizerValue 0x102822B8
+	
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TMimeRec/recmime.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,103 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <ImplementationProxy.h>
+
+#include "appfwk_test_utils.h"
+#include "recmime.h"
+#include "constants.hrh"
+#include "constants.h"
+
+/////////////////////////////////////////////////
+
+const TInt KMaxBufferLength=1024; // maximum amount of buffer space we will ever use
+
+/////////////////////////////////////////////////
+
+/*
+DLL entry point
+*/
+GLDEF_C TInt E32Dll()
+	{
+	return KErrNone;
+	}
+
+/*
+Private constructor
+*/
+CTestMimeRecognizer::CTestMimeRecognizer()
+	:CApaDataRecognizerType(KUidMmrRecognizer, CApaDataRecognizerType::EHigh)
+	{
+	iCountDataTypes=KNumMimeTypes;
+	}
+	
+/*
+Ecom factory function
+
+Due to platsec we can't build plugin.dll to an alternative location and we can't
+copy files from epoc32\release\winscw\udeb. Both plugin.rsc and plugin.dll must 
+be on the same drive to be installed. 
+
+The workaround to implement this tef-test is works like this:
+1. This test plugin are copied into z: by the build tools
+2. This plugin will not be installed during startup because CreateRecognizerL will leave
+3. During the test a dummy plugin.rsc will be copied into c:\resource\plugins to trig Ecom
+4. Apparc will re-scan and make sure all recognizers listed by Ecom are properly installed
+5. Ecom will not install the copied dummy file as it has no matching dll on the same drive, but
+6. This recognizer will detect the dummy file and chose not to leave from CreateRecognizerL
+*/
+CApaDataRecognizerType* CTestMimeRecognizer::CreateRecognizerL()
+	{
+	RSmlTestUtils fileServ;
+	CleanupClosePushL(fileServ);
+	User::LeaveIfError(fileServ.Connect());
+	TBool fileExists = EFalse;
+	User::LeaveIfError(fileServ.IsFilePresent(KRscTargetPath, fileExists));
+	CleanupStack::PopAndDestroy(&fileServ);	
+	
+	if(!fileExists)
+		User::Leave(KErrPathNotFound);			
+	
+	return new (ELeave) CTestMimeRecognizer();
+	}
+	
+TUint CTestMimeRecognizer::PreferredBufSize()
+	{
+	return KMaxBufferLength;
+	}
+
+TDataType CTestMimeRecognizer::SupportedDataTypeL(TInt /*aIndex*/) const
+	{
+	return TDataType(KDataTypeNew);
+	}
+
+void CTestMimeRecognizer::DoRecognizeL(const TDesC& /*aName*/, const TDesC8& /*aBuffer*/)
+	{
+    // If an error stops CTestMimeRecognizer being removed as part of test cleanup, 
+    // returning ENotRecognized will avoid the possibility of impacting other test code.
+	iDataType=TDataType();
+	iConfidence=ENotRecognized;
+	}
+
+const TImplementationProxy ImplementationTable[] = 
+    {
+	IMPLEMENTATION_PROXY_ENTRY(KUidMmrRecognizerValue, CTestMimeRecognizer::CreateRecognizerL)
+	};
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TMimeRec/recmime.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,45 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#if !defined(__RECMIME_H__)
+#define __RECMIME_H__
+
+#include <apmrec.h>
+
+/**
+@class
+@internalComponent - Internal Symbian test code
+
+
+This recognizer is part of the CT_ApsScanStep tef test.
+*/
+class CTestMimeRecognizer : public CApaDataRecognizerType
+	{
+public: 
+	// for ECOM
+	static CApaDataRecognizerType* CreateRecognizerL();
+
+	// from CApaDataRecognizerType
+	TUint PreferredBufSize();
+	TDataType SupportedDataTypeL(TInt aIndex) const;
+	
+private: 
+	CTestMimeRecognizer();
+	
+	// from CApaDataRecognizerType
+	void DoRecognizeL(const TDesC& aName, const TDesC8& aBuffer);
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TMimeRec/recmime.MMP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,39 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// recmime.dll Symbian OS new MIME type recognizer
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+target 		recmime.dll
+targettype 	plugin 
+uid			0x10009d8d 0x102822B7
+VENDORID 	0x70000001
+CAPABILITY	All -Tcb
+
+systeminclude   /EPOC32/INCLUDE /EPOC32/INCLUDE/ECOM /EPOC32/INCLUDE/TEST
+
+SOURCEPATH	.
+source		recmime.cpp
+
+library         EUSER.LIB APMIME.LIB EFSRV.LIB APPFWK_TEST_UTILS.LIB
+
+start resource 102822B7.rss
+target recmime.rsc
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TMimeRec1/A00025DD.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,47 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <RegistryInfo.rh>
+
+RESOURCE REGISTRY_INFO r_registry
+	{
+	dll_uid = 0xA00025DD; //should match name of this file
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = 0x101F7D87; // Const for all Data Recognizers
+			implementations =
+			 {
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 0xA00025DE; // Our test recognizer
+					version_no = 1;
+					display_name = "recmime_1";
+					default_data = "";        // Notify Interface
+					opaque_data = "";
+					}
+				};
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TMimeRec1/recmime_1.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,94 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+#include <ImplementationProxy.h>
+
+#include "appfwk_test_utils.h"
+#include "recmime_1.h"
+
+/////////////////////////////////////////////////
+
+const TInt KMaxBufferLength=1024; // maximum amount of buffer space we will ever use
+
+/////////////////////////////////////////////////
+
+/*
+DLL entry point
+*/
+GLDEF_C TInt E32Dll()
+	{
+	return KErrNone;
+	}
+
+/*
+Private constructor
+*/
+CTestMimeRecognizer::CTestMimeRecognizer()
+	:CApaDataRecognizerType(KUidMmrRecognizer_1, CApaDataRecognizerType::EHigh)
+	{
+	iCountDataTypes = KNumMimeTypes_1;
+	}
+	
+/*
+Ecom factory function
+*/
+CApaDataRecognizerType* CTestMimeRecognizer::CreateRecognizerL()
+	{
+	return new (ELeave) CTestMimeRecognizer();
+	}
+	
+TUint CTestMimeRecognizer::PreferredBufSize()
+	{
+	return KMaxBufferLength;
+	}
+
+TDataType CTestMimeRecognizer::SupportedDataTypeL(TInt /*aIndex*/) const
+	{
+	return TDataType(KMimeMmrType);
+	}
+
+void CTestMimeRecognizer::DoRecognizeL(const TDesC& aName, const TDesC8& /*aBuffer*/)
+	{
+    // If an error stops CTestMimeRecognizer being removed as part of test cleanup, 
+    // returning ENotRecognized will avoid the possibility of impacting other test code.
+	if (aName == KLitDocPath)
+		{
+		iDataType = TDataType(KMimeMmrType);
+		iConfidence = EPossible;
+		}
+	else
+		{
+		iDataType=TDataType();
+		iConfidence=ENotRecognized;
+		}	
+	}
+
+const TImplementationProxy ImplementationTable[] = 
+    {
+	IMPLEMENTATION_PROXY_ENTRY(KUidMmrRecognizerValue_1, CTestMimeRecognizer::CreateRecognizerL)
+	};
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TMimeRec1/recmime_1.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,58 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+#if !defined(__RECMIME_1_H__)
+#define __RECMIME_1_H__
+
+#include <apmrec.h>
+
+// Literals & Constants
+_LIT(KLitDocPath, "Z:\\system\\data\\TApsRecogAppTest.mmr");
+
+_LIT8(KMimeMmrType,"mime/mmr1");
+
+#define KUidMmrRecognizerValue_1 0xA00025DE
+const TUid KUidMmrRecognizer_1={KUidMmrRecognizerValue_1};
+const TInt KNumMimeTypes_1 = 1;	
+
+/**
+@class
+@internalComponent - Internal Symbian test code
+*/
+class CTestMimeRecognizer : public CApaDataRecognizerType
+	{
+public: 
+	// for ECOM
+	static CApaDataRecognizerType* CreateRecognizerL();
+
+	// from CApaDataRecognizerType
+	TUint PreferredBufSize();
+	TDataType SupportedDataTypeL(TInt aIndex) const;
+	
+private: 
+	CTestMimeRecognizer();
+	
+	// from CApaDataRecognizerType
+	void DoRecognizeL(const TDesC& aName, const TDesC8& aBuffer);
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TMimeRec1/recmime_1.MMP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,39 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+target 		recmime_1.dll
+targettype 	plugin 
+uid			0x10009d8d 0xA00025DD
+VENDORID 	0x70000001
+CAPABILITY	All -Tcb
+
+systeminclude   /EPOC32/INCLUDE /EPOC32/INCLUDE/ECOM /EPOC32/INCLUDE/TEST
+
+SOURCEPATH	.
+source			recmime_1.cpp
+
+library         EUSER.LIB APMIME.LIB EFSRV.LIB APPFWK_TEST_UTILS.LIB
+
+start resource A00025DD.rss
+target recmime_1.rsc
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TNonNative/10207f95.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,56 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code  
+*/
+
+
+//  INCLUDES
+#include <RegistryInfo.rh>
+
+
+// RESOURCE DEFINITIONS
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE REGISTRY_INFO r_registry
+    {
+    dll_uid = 0x10207f95;
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = 0x101F7D87; // Const for all Data Recognizers
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x10207f96; 
+                    version_no = 1;
+                    display_name = "TNonNativeRec";
+                    default_data = "";
+                    opaque_data = "";
+                    }
+                };
+            }
+        };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TNonNative/TNNApp1.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,582 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code  
+*/
+
+
+#include <E32STD.H>
+#include <E32BASE.H>
+#include <E32KEYS.H>
+#include <GDI.H>
+#include <W32STD.H>
+#include <COEDEF.H>
+#include <COEMAIN.H>
+#include <COEAUI.H>
+#include <COECNTRL.H>
+#include <APPARC.H>
+#include <APGWGNAM.H>
+#include <APASERVERAPP.H>
+#include <EIKENV.H>
+#include <EIKAPP.H>
+#include <EIKDOC.H>
+#include <EIKAPPUI.H>
+#include <EIKSTART.H>
+#include <EIKSERVERAPP.H>
+#include <UIKON.HRH>
+#include "TNNAPP1.H"
+#include <appfwk_test.h>
+
+TTstTransactionType gTransactionType=ETransactionType_null;
+TBool gCallMadeToNewOverload_ProcessCommandParametersL=EFalse;
+TInt gErrorWhenOpeningFile=KMinTInt;
+TBuf<50> gFileNameWithoutDriveOrPath;
+TBuf8<40> gBufferFromFile(KNullDesC8);
+
+// CTstAppService
+
+class CTstAppService : public CApaAppServiceBase
+	{
+public:
+	static CTstAppService* NewL();
+private:
+	inline CTstAppService() {}
+	// from CApaAppServiceBase
+	virtual void ServiceL(const RMessage2& aMessage);
+	};
+
+CTstAppService* CTstAppService::NewL()
+	{
+	return new(ELeave) CTstAppService;
+	}
+
+void CTstAppService::ServiceL(const RMessage2& aMessage)
+	{
+	switch (aMessage.Function())
+		{
+	case EOpcode_receiveTestResult:
+		{
+		CActiveScheduler::Stop();
+		const TBool passingFileByHandle=aMessage.Int0();
+		TBuf<50> fileNameWithoutDriveOrPath;
+		aMessage.ReadL(1, fileNameWithoutDriveOrPath);
+		TBool result=(gFileNameWithoutDriveOrPath.CompareF(fileNameWithoutDriveOrPath)==0) ? KCheckPass : KCheckFail;
+		switch (gTransactionType)
+			{
+			case ETransactionType_filePassedByName:
+				if (!gCallMadeToNewOverload_ProcessCommandParametersL)
+					{
+					result=KCheckFail;
+					}
+				if (passingFileByHandle)
+					{
+					result=KCheckFail;
+					}
+				if (gErrorWhenOpeningFile!=KErrPermissionDenied)
+					{
+					result=KCheckFail;
+					}
+				if (User::CreatorSecureId().iId!=0x101F289C) // uid of the creator app => apparctestserver!
+					{
+					result=KCheckFail;
+					}
+				break;
+
+			case ETransactionType_filePassedByHandle:
+				if (!gCallMadeToNewOverload_ProcessCommandParametersL)
+					{
+					result=KCheckFail;
+					}
+				if (!passingFileByHandle)
+					{
+					result=KCheckFail;
+					}
+				if (gErrorWhenOpeningFile!=KMinTInt)
+					{
+					result=KCheckFail;
+					}
+				if (User::CreatorSecureId().iId!=0x101F289C) // uid of the creator app => apparctestserver!
+					{
+					result=KCheckFail;
+					}
+				break;
+
+			case ETransactionType_null:
+			default:
+				User::Invariant();
+				break;
+			}
+		aMessage.Complete(result);
+		}
+		break;
+
+	default:
+		User::Leave(KErrNotSupported);
+		break;
+		}
+	}
+
+// CTstAppServer
+
+class CTstAppServer : public CEikAppServer
+	{
+public:
+	static CTstAppServer* NewL();
+private:
+	inline CTstAppServer() {}
+	// from CApaAppServer
+	virtual CApaAppServiceBase* CreateServiceL(TUid aServiceUid) const;
+	virtual TCustomResult CreateServiceSecurityCheckL(TUid aServiceUid, const RMessage2& aMessage, TInt& aAction, TSecurityInfo& aMissingSecurityInfo);
+	};
+
+CTstAppServer* CTstAppServer::NewL()
+	{ // static
+	CTstAppServer* const appServer=new(ELeave) CTstAppServer;
+	CleanupStack::PushL(appServer);
+	appServer->ConstructL(KLitServerName);
+	CleanupStack::Pop(appServer);
+	return appServer;
+	}
+
+CApaAppServiceBase* CTstAppServer::CreateServiceL(TUid aServiceUid) const
+	{
+	if ((aServiceUid.iUid==KTstServiceUid_nonSecure.iUid) ||
+		(aServiceUid.iUid==KTstServiceUid_secure.iUid))
+		{
+		return CTstAppService::NewL();
+		}
+	User::Leave(KErrNotSupported);
+	return NULL;
+	}
+
+CPolicyServer::TCustomResult CTstAppServer::CreateServiceSecurityCheckL(TUid aServiceUid, const RMessage2& aMessage, TInt& aAction, TSecurityInfo& aMissingSecurityInfo)
+	{
+	if ((aServiceUid.iUid==KTstServiceUid_secure.iUid) && (aMessage.SecureId().iId!=0x101F289C))  // uid of the creator app => apparctestserver!
+		{
+		return EFail;
+		}
+	return CEikAppServer::CreateServiceSecurityCheckL(aServiceUid, aMessage, aAction, aMissingSecurityInfo);
+	}
+
+// CTstControl
+
+class CTstControl : public CCoeControl
+	{
+public:
+	static CTstControl* NewL();
+	virtual ~CTstControl();
+private:
+	CTstControl();
+	void ConstructL();
+	// from CCoeControl
+	virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aEventCode);
+	virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent);
+	virtual void Draw(const TRect& aRectangle) const;
+private:
+	CTstAppServer* iAppServer;
+	};
+
+CTstControl* CTstControl::NewL()
+	{ // static
+	CTstControl* const control=new(ELeave) CTstControl;
+	CleanupStack::PushL(control);
+	control->ConstructL();
+	CleanupStack::Pop(control);
+	return control;
+	}
+
+CTstControl::~CTstControl()
+	{
+	delete iAppServer;
+	iEikonEnv->RemoveFromStack(this);
+	}
+
+CTstControl::CTstControl()
+	{
+	}
+
+void CTstControl::ConstructL()
+	{
+	RWsSession& windowServerSession=iCoeEnv->WsSession();
+	windowServerSession.SetAutoFlush(ETrue);
+	CreateWindowL();
+	EnableDragEvents();
+	ClaimPointerGrab();
+	RDrawableWindow& window=*DrawableWindow();
+	window.SetOrdinalPosition(0);
+	window.SetShadowHeight(3);
+	CWsScreenDevice& screenDevice=*iCoeEnv->ScreenDevice();
+	const TSize screenSize(screenDevice.SizeInPixels());
+	SetExtent(TPoint(20, 20), TSize(screenSize.iWidth-40, screenSize.iHeight-40));
+	iEikonEnv->AddDialogLikeControlToStackL(this);
+	iAppServer=CTstAppServer::NewL();
+	ActivateL();
+	}
+
+TKeyResponse CTstControl::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aEventCode)
+	{
+	if (aEventCode==EEventKey)
+		{
+		switch (aKeyEvent.iCode)
+			{
+		case EKeyEscape:
+			iEikonEnv->EikAppUi()->HandleCommandL(EEikCmdExit);
+			break;
+			}
+		}
+	return EKeyWasConsumed;
+	}
+
+void CTstControl::HandlePointerEventL(const TPointerEvent& aPointerEvent)
+	{
+	CCoeControl::HandlePointerEventL(aPointerEvent);
+	}
+
+void CTstControl::Draw(const TRect&) const
+	{
+	CWindowGc& graphicsContext=SystemGc();
+	graphicsContext.SetPenStyle(CGraphicsContext::ESolidPen);
+	graphicsContext.SetPenColor(KRgbRed);
+	graphicsContext.SetBrushStyle(CGraphicsContext::ESolidBrush);
+	graphicsContext.SetBrushColor(KRgbGray);
+	TRect rectangle(TPoint(0, 0), Rect().Size());
+	graphicsContext.DrawRect(rectangle);
+	rectangle.Shrink(1, 1);
+	graphicsContext.SetPenColor(KRgbBlue);
+	graphicsContext.SetBrushStyle(CGraphicsContext::ENullBrush);
+
+	const TInt KGapAboveTop=40;
+	const TInt KGapBetweenLines=5;
+	const TInt KMaxLengthOfText=100;
+	TBuf<KMaxLengthOfText> text;
+
+	TInt gapLeft=5;
+	const CFont* font=iCoeEnv->NormalFont();
+	graphicsContext.UseFont(font);
+	TInt heightInPixelsPlusGapBetweenLines=font->HeightInPixels()+KGapBetweenLines;
+	TPtrC transactionType;
+	switch (gTransactionType)
+		{
+		case ETransactionType_null:
+			transactionType.Set(_L("null"));
+			break;
+		case ETransactionType_filePassedByName:
+			transactionType.Set(_L("file passed by name"));
+			break;
+		case ETransactionType_filePassedByHandle:
+			transactionType.Set(_L("file passed by handle"));
+			break;
+		default:
+			User::Invariant();
+			break;
+		}
+	text.Format(_L("Transaction type: %S"), &transactionType);
+	TInt topOfText=KGapAboveTop+font->AscentInPixels();
+	graphicsContext.DrawText(text, rectangle, topOfText, CGraphicsContext::ELeft, gapLeft);
+
+	topOfText+=heightInPixelsPlusGapBetweenLines;
+	_LIT(KLit_yes, "yes");
+	_LIT(KLit_no, "no");
+	text.Format(_L("ProcessCommandParametersL(CApaCommandLine&) called: %S"), gCallMadeToNewOverload_ProcessCommandParametersL? &KLit_yes: &KLit_no);
+	graphicsContext.DrawText(text, rectangle, topOfText, CGraphicsContext::ELeft, gapLeft);
+
+	topOfText+=heightInPixelsPlusGapBetweenLines;
+	text.Format(_L("Error when opening file: %d"), gErrorWhenOpeningFile);
+	graphicsContext.DrawText(text, rectangle, topOfText, CGraphicsContext::ELeft, gapLeft);
+
+	topOfText+=heightInPixelsPlusGapBetweenLines;
+	text=_L("File contents: {");
+	const TInt bufferLength=gBufferFromFile.Length();
+	for (TInt i=0; i<bufferLength; ++i)
+		{
+		if (KMaxLengthOfText-text.Length()<5)
+			{
+			break;
+			}
+		text.AppendFormat(_L("\\x%02x"), gBufferFromFile[i]);
+		}
+	text.Append('}');
+	graphicsContext.DrawText(text, rectangle, topOfText, CGraphicsContext::ELeft, gapLeft);
+
+	graphicsContext.DiscardFont();
+	}
+
+// CTstAppUi
+
+class CTstAppUi : public CEikAppUi
+	{
+public:
+	static CTstAppUi* NewL();
+	inline CTstControl* Control() {return iControl;}
+private:
+	inline CTstAppUi() {}
+	virtual ~CTstAppUi();
+	// from MEikCommandObserver
+	virtual void ProcessCommandL(TInt);
+	// from MEikMenuObserver
+	virtual void RestoreMenuL(CCoeControl*, TInt, TMenuType);
+	virtual void DynInitMenuPaneL(TInt, CEikMenuPane*);
+	virtual void DynInitMenuBarL(TInt, CEikMenuBar*);
+	// from CEikAppUi
+	virtual void ConstructL();
+	virtual TBool ProcessCommandParametersL(TApaCommand, TFileName& aDocumentName, const TDesC8&);
+	virtual TBool ProcessCommandParametersL(CApaCommandLine& aCommandLine);
+	virtual void HandleCommandL(TInt aCommand);
+	virtual void OpenFileL(const TDesC&);
+	virtual void CreateFileL(const TDesC&);
+private:
+	CTstControl* iControl;
+	};
+
+CTstAppUi* CTstAppUi::NewL()
+	{ // static
+	return new(ELeave) CTstAppUi;
+	}
+
+CTstAppUi::~CTstAppUi()
+	{
+	delete iControl;
+	}
+
+void CTstAppUi::ProcessCommandL(TInt)
+	{
+	User::Invariant();
+	}
+
+void CTstAppUi::RestoreMenuL(CCoeControl*, TInt, TMenuType)
+	{
+	User::Invariant();
+	}
+
+void CTstAppUi::DynInitMenuPaneL(TInt, CEikMenuPane*)
+	{
+	User::Invariant();
+	}
+
+void CTstAppUi::DynInitMenuBarL(TInt, CEikMenuBar*)
+	{
+	User::Invariant();
+	}
+
+void CTstAppUi::ConstructL()
+	{
+	BaseConstructL(ENoAppResourceFile|ENoScreenFurniture);
+	iControl=CTstControl::NewL();
+	}
+
+TBool CTstAppUi::ProcessCommandParametersL(TApaCommand, TFileName& aDocumentName, const TDesC8&)
+	{
+	aDocumentName.SetLength(0);
+	return EFalse;
+	}
+
+TBool CTstAppUi::ProcessCommandParametersL(CApaCommandLine&)
+	{
+	gCallMadeToNewOverload_ProcessCommandParametersL=ETrue;
+	iControl->DrawNow();
+	return ETrue;
+	}
+
+void CTstAppUi::HandleCommandL(TInt aCommand)
+	{
+	switch (aCommand)
+		{
+	case EEikCmdExit:
+		Exit();
+		break;
+	default:
+		User::Invariant();
+		}
+	}
+
+void CTstAppUi::OpenFileL(const TDesC&)
+	{
+	User::Invariant();
+	}
+
+void CTstAppUi::CreateFileL(const TDesC&)
+	{
+	User::Invariant();
+	}
+
+// CTstDocument
+
+class CTstDocument : public CEikDocument
+	{
+public:
+	static CTstDocument* NewL(CEikApplication& aApplication);
+	inline CTstAppUi* TstAppUi() {return STATIC_CAST(CTstAppUi*, iAppUi);}
+private:
+	inline CTstDocument(CEikApplication& aApplication) :CEikDocument(aApplication) {}
+	// from CApaDocument
+	virtual CFileStore* CreateFileStoreLC(RFs&, const TDesC&);
+	virtual void EditL(MApaEmbeddedDocObserver*, TBool);
+	virtual void PrintL(const CStreamStore&);
+	virtual void SaveL();
+	virtual void StoreL(CStreamStore&, CStreamDictionary&) const;
+	// from CEikDocument
+	virtual CEikAppUi* CreateAppUiL();
+	virtual CFileStore* OpenFileL(TBool aDoOpen, const TDesC& aFileName, RFs& aFsSession);
+	virtual void OpenFileL(CFileStore*& aFileStore, RFile& aFile);
+	virtual void UpdateTaskNameL(CApaWindowGroupName* aWindowGroupName);
+	};
+
+CTstDocument* CTstDocument::NewL(CEikApplication& aApplication)
+	{ // static
+	return new(ELeave) CTstDocument(aApplication);
+	}
+
+CFileStore* CTstDocument::CreateFileStoreLC(RFs&, const TDesC&)
+	{
+	User::Invariant();
+	return NULL;
+	}
+
+void CTstDocument::EditL(MApaEmbeddedDocObserver*, TBool)
+	{
+	User::Invariant();
+	}
+
+void CTstDocument::PrintL(const CStreamStore&)
+	{
+	User::Invariant();
+	}
+
+void CTstDocument::SaveL()
+	{
+	SetChanged(EFalse);
+	}
+
+void CTstDocument::StoreL(CStreamStore&, CStreamDictionary&) const
+	{
+	User::Invariant();
+	}
+
+CEikAppUi* CTstDocument::CreateAppUiL()
+	{
+	return CTstAppUi::NewL();
+	}
+
+CFileStore* CTstDocument::OpenFileL(TBool aDoOpen, const TDesC& aFileName, RFs& aFsSession)
+	{
+	if (!aDoOpen)
+		{
+		User::Leave(KErrNotSupported);
+		}
+	gFileNameWithoutDriveOrPath=TParsePtrC(aFileName).NameAndExt();
+	RFile file;
+	CleanupClosePushL(file);
+	APPFWK_NEGATIVE_PLATSEC_START;
+	gErrorWhenOpeningFile=file.Open(aFsSession, aFileName, EFileShareReadersOnly|EFileStream|EFileRead);
+	APPFWK_NEGATIVE_PLATSEC_FINISH;
+	if (gErrorWhenOpeningFile==KErrNone)
+		{
+		User::LeaveIfError(file.Read(gBufferFromFile));
+		}
+	CleanupStack::PopAndDestroy(&file);
+	gTransactionType=ETransactionType_filePassedByName;
+	TstAppUi()->Control()->DrawNow();
+	return NULL;
+	}
+
+void CTstDocument::OpenFileL(CFileStore*& aFileStore, RFile& aFile)
+	{
+	User::LeaveIfError(aFile.Name(gFileNameWithoutDriveOrPath));
+	User::LeaveIfError(aFile.Read(gBufferFromFile));
+	gTransactionType=ETransactionType_filePassedByHandle;
+	TstAppUi()->Control()->DrawNow();
+	aFileStore=NULL;
+	}
+
+void CTstDocument::UpdateTaskNameL(CApaWindowGroupName* aWindowGroupName)
+	{
+	CEikDocument::UpdateTaskNameL(aWindowGroupName);
+	}
+
+// CTstApplication
+
+class CTstApplication : public CEikApplication
+	{
+public:
+	static CTstApplication* New();
+private:
+	inline CTstApplication() {}
+	// from CApaApplication
+	virtual TUid AppDllUid() const;
+	virtual CDictionaryStore* OpenIniFileLC(RFs&) const;
+	// from CEikApplication
+	virtual void GetDefaultDocumentFileName(TFileName& aDocumentName) const;
+	virtual TFileName BitmapStoreName() const;
+	virtual TFileName ResourceFileName() const;
+	virtual CApaDocument* CreateDocumentL();
+	virtual void NewAppServerL(CApaAppServer*& aAppServer);
+	};
+
+CTstApplication* CTstApplication::New()
+	{ // static
+	return new CTstApplication;
+	}
+
+TUid CTstApplication::AppDllUid() const
+	{
+	return TUid::Uid(0x10207f92);
+	}
+
+CDictionaryStore* CTstApplication::OpenIniFileLC(RFs&) const
+	{
+	return NULL; // must not leave anything on the clean-up stack if it returns NULL
+	}
+
+void CTstApplication::GetDefaultDocumentFileName(TFileName& aDocumentName) const
+	{
+	aDocumentName.SetLength(0);
+	}
+
+TFileName CTstApplication::BitmapStoreName() const
+	{
+	return KNullDesC();
+	}
+
+TFileName CTstApplication::ResourceFileName() const
+	{
+	return KNullDesC();
+	}
+
+CApaDocument* CTstApplication::CreateDocumentL() // must return non-NULL
+	{
+	return CTstDocument::NewL(*this);
+	}
+
+void CTstApplication::NewAppServerL(CApaAppServer*& aAppServer)
+	{
+	// this doesn't get called by the framework as we're not launching the server via the server-differentiator in CApaCommandLine, we launching the server as a fixed-name server so we have to call this function ourselves instead
+	CEikApplication::NewAppServerL(aAppServer);
+	}
+
+// stand-alone functions
+
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return CTstApplication::New();
+	}
+
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication(NewApplication);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TNonNative/TNNApp1.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,43 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code  
+*/
+
+
+_LIT(KLitServerName, "AppService_10207f92");
+
+const TUid KTstServiceUid_secure={0x10207f97};
+const TUid KTstServiceUid_nonSecure={0x10207f98};
+
+/** These numbers have been chosen at random to be used as an exit reason */
+const TInt KCheckPass = 13;
+const TInt KCheckFail = 77;
+
+enum TTstTransactionType
+	{
+	ETransactionType_null,
+	ETransactionType_filePassedByName,
+	ETransactionType_filePassedByHandle
+	};
+
+enum TTstOpcode
+	{
+	EOpcode_receiveTestResult
+	};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TNonNative/TNNApp1.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,47 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code  
+*/
+
+
+target			TNNAPP1.EXE
+targetpath		/sys/bin
+targettype		exe
+uid				0x100039ce 0x10207f92
+vendorid 		0x70000001
+
+capability 		none
+
+sourcepath		.
+source			TNNAPP1.CPP
+
+userinclude     .
+userinclude     ..
+
+systeminclude	/epoc32/include
+systeminclude	/epoc32/include/test
+
+resource  		TNNAPP1_REG.RSS
+start resource	TNNAPP1_REG.RSS
+targetpath		/private/10003a3f/apps
+lang			sc
+end
+
+library			EUSER.LIB EFSRV.LIB APMIME.LIB APGRFX.LIB APPARC.LIB WS32.LIB CONE.LIB EIKCORE.LIB GDI.LIB 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TNonNative/TNNApp1_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,56 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code  
+*/
+
+
+#include <APPINFO.RH>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10207f92 // application UID
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="tnnapp1"; // filename of application binary (minus extension)
+
+	hidden=KAppNotHidden;
+	embeddability=KAppNotEmbeddable;
+	newfile=KAppDoesNotSupportNewFile;
+
+	datatype_list=
+		{
+		DATATYPE { priority=EDataTypePriorityHigh; type="x-epoc/nna-gif"; },
+		DATATYPE { priority=EDataTypePriorityHigh; type="x-epoc/nna-html"; },
+		DATATYPE { priority=EDataTypePriorityHigh; type="x-epoc/nna-vcf"; },
+		DATATYPE { priority=EDataTypePriorityHigh; type="x-epoc/nna-txt"; }		
+		};
+	
+	service_list=
+		{
+		SERVICE_INFO
+			{
+			uid=0x10207f93;
+			datatype_list=
+				{
+				DATATYPE { priority=EDataTypePriorityHigh; type="x-epoc/nna-vcf"; }
+				};
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TNonNative/TNNApp2.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,64 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code  
+*/
+
+
+#include <E32STD.H>
+#include <E32BASE.H>
+#include <E32PROPERTY.H>
+#include <APACMDLN.H>
+#include <APAID.H>
+#include <APGCLI.H>
+#include <APGICNFL.H>
+#include <APMSTD.H>
+
+const TUint KPropertyCategory=0x101F289C;
+const TUint KPropertyKey=0;
+
+_LIT(KLitExtension, ".NNAPP2");
+
+inline void DoTest(TBool aCondition) {__ASSERT_ALWAYS(aCondition, User::Invariant());}
+
+// top-level functions
+
+LOCAL_C void MainL()
+	{
+	CApaCommandLine* commandLine=NULL;
+	User::LeaveIfError(CApaCommandLine::GetCommandLineFromProcessEnvironment(commandLine));
+	CleanupStack::PushL(commandLine);
+	const TPtrC executableName(commandLine->ExecutableName());
+	DoTest(TParsePtrC(executableName).Ext().CompareF(KLitExtension)==0);
+	User::LeaveIfError(RProperty::Set(TUid::Uid(KPropertyCategory), KPropertyKey, commandLine->DocumentName()));
+	CleanupStack::PopAndDestroy(commandLine);
+	}
+
+GLDEF_C TInt E32Main()
+	{
+	CTrapCleanup* const trapCleanup=CTrapCleanup::New();
+	if (trapCleanup==NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAPD(error, MainL());
+	DoTest(error==KErrNone);
+	delete trapCleanup;
+	return error;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TNonNative/TNNApp2.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,41 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code  
+*/
+
+
+target			TNNAPP2.EXE
+targettype		exe
+uid				0x100039ce 0x10207f94
+capability		none
+
+sourcepath		.
+source			TNNAPP2.CPP
+systeminclude	/epoc32/include
+
+
+resource  		TNNAPP2_REG.RSS
+start resource	TNNAPP2_REG.RSS
+targetpath		/private/10003a3f/apps
+lang			sc
+end
+
+
+library			EUSER.LIB EFSRV.LIB APPARC.LIB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TNonNative/TNNApp2_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code  
+*/
+
+
+#include <APPINFO.RH>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10207f94 // application UID
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="tnnapp2"; // filename of application binary (minus extension)
+
+	hidden=KAppNotHidden;
+	embeddability=KAppNotEmbeddable;
+	newfile=KAppDoesNotSupportNewFile;
+
+	service_list=
+		{
+		SERVICE_INFO
+			{
+			uid=0x10207f99;
+			datatype_list=
+				{
+				DATATYPE { priority=EDataTypePriorityHigh; type="x-epoc/nna-gif"; }
+				};
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TNonNative/TNonNativeRec.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,161 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This recognizer is part of the supporting test code for T_NonNativeAppsStep.CPP
+// This recognizer only exists to associate the document names defined in T_NonNativeAppsStep.h 
+// with the TstNonNativeApp.exe application.
+// This enables T_NonNativeAppsSt ep.CPP to launch TstNonNativeApp.app by starting the document names.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <E32STD.H>
+#include <E32BASE.H>
+#include <APMSTD.H>
+#include <APMREC.H>
+#include <F32FILE.H>
+
+#include <apfrec.h>
+#include <ImplementationProxy.h> 
+
+_LIT8(KLit8_DataType_Gif, "x-epoc/nna-gif");
+_LIT8(KLit8_DataType_Html, "x-epoc/nna-html");
+_LIT8(KLit8_DataType_Vcard, "x-epoc/nna-vcf");
+_LIT8(KLit8_DataType_plainText, "x-epoc/nna-txt");
+
+const TUid KUidNonNativeRecognizer={0x10207f95};
+const TUint KImplNonNativeRecognizer=0x10207f96;
+
+enum TMimeTypes
+    {
+    EMimeTypeNnt1 = 0,
+    EMimeTypeNnt2,
+    EMimeTypeNnt3,
+    EMimeTypeNnt4,
+    EMimeLast
+    };
+
+_LIT(KLitMimeExtensionNnt1, ".NNA1");
+_LIT(KLitMimeExtensionNnt2, ".NNA2");
+_LIT(KLitMimeExtensionNnt3, ".NNA3");
+_LIT(KLitMimeExtensionNnt4, ".NNA4");
+
+
+// CTNonNativeRec definition
+
+class CTNonNativeRec : public CApaDataRecognizerType
+	{
+public:
+	CTNonNativeRec();
+	static CApaDataRecognizerType* CreateRecognizerL();
+private:
+	// from CApaDataRecognizerType
+	virtual TUint PreferredBufSize();
+	virtual TDataType SupportedDataTypeL(TInt aIndex) const;
+	virtual void DoRecognizeL(const TDesC& aName, const TDesC8& aBuffer);
+	};
+
+
+// CTNonNativeRec implementation
+
+CTNonNativeRec::CTNonNativeRec() 
+	:CApaDataRecognizerType(KUidNonNativeRecognizer, EHigh)
+	{
+	iCountDataTypes = EMimeLast;
+	} 
+
+TUint CTNonNativeRec::PreferredBufSize()
+	{
+	return 0;
+	}
+
+TDataType CTNonNativeRec::SupportedDataTypeL(TInt aIndex) const
+	{
+	if (aIndex == EMimeTypeNnt1)
+		return TDataType(KLit8_DataType_Gif);
+    
+    else if (aIndex == EMimeTypeNnt2)
+		return TDataType(KLit8_DataType_Html);
+    
+    else if (aIndex == EMimeTypeNnt3)
+		return TDataType(KLit8_DataType_Vcard);
+    
+    else if (aIndex == EMimeTypeNnt4)
+		return TDataType(KLit8_DataType_plainText);
+    
+    else
+        return TDataType(KNullDesC8);
+    }
+ 
+
+void CTNonNativeRec::DoRecognizeL(const TDesC& aName, const TDesC8&)
+	{
+
+	// Compare if the file extension is known
+	if (aName.Length() < 5)
+		{
+    	iDataType = TDataType(KNullDesC8); 	
+    	iConfidence = ENotRecognized;
+		return;
+		}
+
+	if (aName.Right(5).CompareF(KLitMimeExtensionNnt1) == 0)
+		{
+		iDataType = TDataType(KLit8_DataType_Gif);
+		iConfidence = ECertain;
+		}
+	else if (aName.Right(5).CompareF(KLitMimeExtensionNnt2) == 0)
+		{
+		iDataType = TDataType(KLit8_DataType_Html);
+		iConfidence = ECertain;
+		}
+	else if (aName.Right(5).CompareF(KLitMimeExtensionNnt3) == 0)
+		{
+		iDataType = TDataType(KLit8_DataType_Vcard);
+		iConfidence = ECertain;
+		}
+	else if (aName.Right(5).CompareF(KLitMimeExtensionNnt4) == 0)
+		{
+		iDataType = TDataType(KLit8_DataType_plainText);
+		iConfidence = ECertain;
+		}
+    else
+    	{
+    	iDataType = TDataType(KNullDesC8); 	
+    	iConfidence = ENotRecognized;
+    	}
+	}
+
+// stand-alone functions
+
+CApaDataRecognizerType* CTNonNativeRec::CreateRecognizerL()
+	{
+	return new (ELeave) CTNonNativeRec();
+	}
+
+const TImplementationProxy ImplementationTable[] = 
+    {
+	IMPLEMENTATION_PROXY_ENTRY(KImplNonNativeRecognizer, CTNonNativeRec::CreateRecognizerL)
+	};
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TNonNative/TNonNativeRec.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,42 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+TARGET			TNonNativeRec.dll
+CAPABILITY		All -Tcb
+TARGETTYPE		PLUGIN
+UID				0x10009d8d 0x10207f95
+VENDORID 		0x70000001
+
+SOURCEPATH		.
+SOURCE			TNonNativeRec.cpp
+
+systeminclude   ../../INC
+systeminclude   /EPOC32/INCLUDE
+systeminclude	/EPOC32/INCLUDE/ECOM 
+systeminclude	/EPOC32/INCLUDE/TEST
+
+LIBRARY			EUSER.LIB APMIME.LIB APPARC.LIB EFSRV.LIB
+
+start resource 10207f95.rss
+target TNonNativeRec.rsc
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TNonNativeAppLaunchChecker.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,77 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Supporting ECOM plugin for use by  test programs that excercise
+// rule based launching of applications.
+// The class CTNonNativeAppLaunchChecker implements an 
+// ECOM RuleBased plugin interface. 
+// 
+//
+
+
+
+
+/**
+ @file 
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <ImplementationProxy.h>
+#include "tNonNativeAppLaunchChecker.h"
+#include <e32cmn.h>
+
+const TUid KUidNonNativeApp = {0xA0000B6E};
+
+// Define the interface UIDs
+const TImplementationProxy ImplementationTable[] = 
+	{
+	IMPLEMENTATION_PROXY_ENTRY(0xA0000B6F, CTNonNativeAppLaunchChecker::NewL),
+	};
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+	{
+	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+	return ImplementationTable;
+	}
+
+CTNonNativeAppLaunchChecker*	CTNonNativeAppLaunchChecker::NewL()
+	{
+	CTNonNativeAppLaunchChecker* theAppLaunchChecker = new (ELeave) CTNonNativeAppLaunchChecker();
+	return theAppLaunchChecker;
+	}
+
+CTNonNativeAppLaunchChecker::~CTNonNativeAppLaunchChecker()
+	{
+	}
+
+/**
+The function CAppLaunchChecker::OkayToLaunchL recieves the UID of the application to be launched.
+The function implements a rule for not launching the application whose UID is supplied as the first parameter.
+The function returns  CAppLaunchChecker::EAppLaunchDecline if the rule is executed completely.
+*/
+CAppLaunchChecker::TAppLaunchCode CTNonNativeAppLaunchChecker::OkayToLaunchL(const TUid aAppToLaunch, TApaTaskList& /* aTaskList */)
+	{ 
+	if(KUidNonNativeApp == aAppToLaunch)
+		{
+		return CAppLaunchChecker::EAppLaunchDecline;
+		}		
+	return CAppLaunchChecker::EAppLaunchIndifferent;
+	}
+
+GLDEF_C TInt E32Dll()
+//
+// DLL entry point
+//
+	{
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TNonNativeAppLaunchChecker.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,40 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#ifndef __TNONNATIVEAPPLAUNCHCHECKER_H__
+#define __TNONNATIVEAPPLAUNCHCHECKER_H__
+
+#include "..\inc\ApLaunchChecker.h"
+
+class CTNonNativeAppLaunchChecker : public CAppLaunchChecker
+	{
+public:
+	static CTNonNativeAppLaunchChecker* NewL();
+	~CTNonNativeAppLaunchChecker();
+	//Inherited from CApplaunchChecker
+	TAppLaunchCode virtual OkayToLaunchL(const TUid aAppToLaunch, TApaTaskList& aTaskList);
+	
+private:
+	CTNonNativeAppLaunchChecker() {};
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TNonNativeAppLaunchChecker.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,44 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+TARGET TNonNativeAppLaunchChecker.dll
+CAPABILITY	All -Tcb
+TARGETTYPE PLUGIN
+VENDORID 0x70000001
+
+// ECom Dll recognition UID followed by the unique dll UID 
+UID 0x10009D8D 0xA0000B70
+
+SOURCEPATH ../tef 
+SOURCE TNonNativeAppLaunchChecker.cpp
+
+USERINCLUDE ../tef
+USERINCLUDE ../inc
+SYSTEMINCLUDE /epoc32/include
+SYSTEMINCLUDE /epoc32/include/ecom
+
+start resource A0000B70.rss
+target TNonNativeAppLaunchChecker.rsc
+end
+
+LIBRARY euser.lib
+LIBRARY apfile.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TRApaLsSessionStartAppTest.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,44 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#if !defined(__TRAPALSSESSIONSTARTAPPTEST_H__)
+#define __TRAPALSSESSIONSTARTAPPTEST_H__
+
+#if !defined(__E32STD_H__)
+#include <E32STD.H>
+#endif
+
+/** KLitLongURL must be > 256 characters long, in this case it's 259 characters long
+    The name is a little mis-leading, as it's not a real URL. URL is used in the name
+    because one of the use cases for needing document names longer than 256 characters
+    is when starting a very long URL to be handled by a web browser application
+*/
+
+
+_LIT(KLitTRApaLsSessionStartAppTest, "Z:\\system\\data\\TRApaLsSessionStartAppTest.tst");
+
+
+
+const TUid KUidMimeTRApaLsSessionStartAppTestRecognizer={0x10004c50};
+const TInt KNumDataTypes = 1;
+_LIT8(KLitMimeType_TRApaLsSessionStartAppTest, "x-epoc/start-app-test");
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TRApaLsSessionStartAppTestApp.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,217 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Supporting application for use by other test programs that need
+// to query the apparc server for applications which define
+// different embeddability values in their AIF files.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include <coeccntx.h>
+
+#include <apgtask.h>
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+
+#include <eikstart.h>
+
+#include "TRApaLsSessionTestUids.h"
+#include "TRApaLsSessionStartAppTest.h"
+_LIT(KExampleText, "This test application is for TRApaLsSession start app tests");
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppView
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppView : public CCoeControl
+    {
+public:
+	static CExampleAppView* NewL(const TRect& aRect);
+	CExampleAppView();
+	~CExampleAppView();
+    void ConstructL(const TRect& aRect);
+
+private:
+	// from CCoeControl
+	void Draw(const TRect& /*aRect*/) const;
+private:
+	HBufC*  iExampleText;
+    };
+
+CExampleAppView::CExampleAppView()
+	{
+	}
+
+CExampleAppView* CExampleAppView::NewL(const TRect& aRect)
+	{
+	CExampleAppView* self = new(ELeave) CExampleAppView();
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect);
+	CleanupStack::Pop();
+	return self;
+	}
+
+CExampleAppView::~CExampleAppView()
+	{
+	delete iExampleText;
+	}
+
+void CExampleAppView::ConstructL(const TRect& aRect)
+    {
+	TPtrC ptr(KExampleText);
+	iExampleText = ptr.AllocL();
+	CreateWindowL();
+	SetRect(aRect);
+	ActivateL();
+	}
+
+void CExampleAppView::Draw(const TRect& /*aRect*/) const
+	{
+	CWindowGc& gc = SystemGc();
+	TRect      drawRect = Rect();
+	const CFont*     fontUsed;
+	
+	gc.Clear();
+  	fontUsed = iEikonEnv->TitleFont();
+	gc.UseFont(fontUsed);
+	TInt   baselineOffset=(drawRect.Height() - fontUsed->HeightInPixels())/2; 
+	gc.DrawText(*iExampleText,drawRect,baselineOffset,CGraphicsContext::ECenter, 0);
+	gc.DiscardFont();
+	}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppUi : public CEikAppUi
+    {
+public:
+    void ConstructL();
+	~CExampleAppUi();
+
+private:
+    // from CEikAppUi
+	void HandleCommandL(TInt aCommand);
+private:
+	CCoeControl* iAppView;
+	};
+
+
+void CExampleAppUi::ConstructL()
+    {
+    BaseConstructL(ENoAppResourceFile | ENoScreenFurniture);
+	iAppView = CExampleAppView::NewL(ClientRect());
+	}
+
+CExampleAppUi::~CExampleAppUi()
+	{
+	delete iAppView;
+	}
+
+void CExampleAppUi::HandleCommandL(TInt aCommand)
+	{
+	switch (aCommand)
+		{
+	case EEikCmdExit: 
+		Exit();
+		break;
+		}
+	}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleDocument : public CEikDocument
+	{
+public:
+	static CExampleDocument* NewL(CEikApplication& aApp);
+	CExampleDocument(CEikApplication& aApp);
+	void ConstructL();
+private: 
+	// Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+CExampleDocument::CExampleDocument(CEikApplication& aApp)
+		: CEikDocument(aApp)
+	{
+	}
+
+CEikAppUi* CExampleDocument::CreateAppUiL()
+	{
+    return new(ELeave) CExampleAppUi;
+	}
+
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+class CExampleApplication : public CEikApplication
+	{
+private: 
+	// from CApaApplication
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+private:
+	TFileName ResourceFileName() const;
+private:
+	CApaDocument* CreateDocumentL(CApaProcess* a) { return CEikApplication::CreateDocumentL(a); }
+	//	
+	};
+
+CApaDocument* CExampleApplication::CreateDocumentL()
+	{
+	return new (ELeave) CExampleDocument(*this);
+	}
+
+TUid CExampleApplication::AppDllUid() const
+	{
+	return KUidTRApaLsSessionStartAppTestApp;
+	}
+
+TFileName CExampleApplication::ResourceFileName() const
+{
+	return TFileName(); // this app doesn't have a resource file
+}
+
+
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CExampleApplication;
+	}
+
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication(NewApplication);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TRApaLsSessionStartAppTestApp_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,44 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file TRApaLsSessionStartAppTestApp_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+
+UID3 0x10004c4f // application UID
+
+RESOURCE APP_REGISTRATION_INFO
+	{	
+	app_file = "TRApaLsSessionStartAppTestApp";
+
+	hidden=KAppNotHidden;
+	embeddability=KAppNotEmbeddable;
+	newfile=KAppDoesNotSupportNewFile;
+	
+	// MIME types
+	datatype_list= 
+		{
+		DATATYPE { priority=EDataTypePriorityNormal; type="x-epoc/start-app-test"; } 
+		//DATATYPE { priority=EDataTypePriorityLow; type="text/plain"; }
+		}; 
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TRApaLsSessionStartAppTestApp_v2.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,49 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TTRApaLsSessionStartAppTestApp.mmp
+// 
+//
+
+#include <platform_paths.hrh>
+
+targetpath	/SYS/BIN
+
+target		TRApaLsSessionStartAppTestApp.EXE
+TARGETTYPE 	exe
+
+VENDORID 	0x70000001
+UID         	0x100039CE 0x10004c4f
+CAPABILITY	All -Tcb
+epocstacksize 	0x5000
+
+SOURCEPATH	.
+USERINCLUDE   	.
+SYSTEMINCLUDE 	/epoc32/include
+SYSTEMINCLUDE 	/epoc32/include/techview
+
+MW_LAYER_SYSTEMINCLUDE
+
+// Application exe registration resource file
+START RESOURCE	TRApaLsSessionStartAppTestApp_reg.rss
+TARGETPATH	/private/10003a3f/apps
+END
+
+SOURCE        	TRApaLsSessionStartAppTestApp.cpp
+
+
+LIBRARY       	APPARC.LIB
+LIBRARY       	CONE.LIB 
+LIBRARY       	EIKCORE.LIB 
+LIBRARY       	EUSER.LIB
+LIBRARY       	GDI.LIB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TRApaLsSessionStartAppTestRecognizer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,101 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This recognizer is part of the supporting test code
+// for T_RApaLsSessionStep.CPP
+// This recognizer only exists to associate the document
+// name KLitTRApaLsSessionStartAppTest (defined in TRApaLsSessionStartAppTest.h) with the
+// TRApaLsSessionStartAppTestApp.app application.
+// This enables the start app test case T_RApaLsSessionStep.CPP to launch TRApaLsSessionStartAppTestApp.app
+// by starting the document KLitTRApaLsSessionStartAppTest.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <E32STD.H>
+#include <E32BASE.H>
+#include <APMSTD.H>
+#include <APMREC.H>
+#include "TRApaLsSessionStartAppTest.h"
+
+#include <ImplementationProxy.h>
+
+//CRApaLsSessionStartAppTestRec
+
+class CRApaLsSessionStartAppTestRec : public CApaDataRecognizerType
+	{
+public:
+	CRApaLsSessionStartAppTestRec();
+	static CApaDataRecognizerType* CreateRecognizerL();
+private:
+	// from CApaDataRecognizerType
+	virtual TUint PreferredBufSize();
+	virtual TDataType SupportedDataTypeL(TInt aIndex) const;
+	virtual void DoRecognizeL(const TDesC& aName, const TDesC8& aBuffer);
+	};
+
+CRApaLsSessionStartAppTestRec::CRApaLsSessionStartAppTestRec()
+	:CApaDataRecognizerType(KUidMimeTRApaLsSessionStartAppTestRecognizer, EHigh)
+	{
+	iCountDataTypes=KNumDataTypes;
+	}
+
+TUint CRApaLsSessionStartAppTestRec::PreferredBufSize()
+	{
+	return 0;
+	}
+
+TDataType CRApaLsSessionStartAppTestRec::SupportedDataTypeL(TInt /*aIndex*/) const
+	{
+	return TDataType(KLitMimeType_TRApaLsSessionStartAppTest);
+	}
+
+void CRApaLsSessionStartAppTestRec::DoRecognizeL(const TDesC& aName, const TDesC8&)
+	{
+	if (aName==KLitTRApaLsSessionStartAppTest)
+		{
+		iDataType=TDataType(KLitMimeType_TRApaLsSessionStartAppTest); // TRApaLsSessionStartAppTest.app supports mime type KLitMimeType_TRApaLsSessionStartAppTest
+		iConfidence=ECertain;
+		}
+	}
+
+// stand-alone functions
+
+
+GLDEF_C TInt E32Dll(
+					)
+	{
+	return KErrNone;
+	}
+
+CApaDataRecognizerType* CRApaLsSessionStartAppTestRec::CreateRecognizerL()
+	{
+	return new (ELeave) CRApaLsSessionStartAppTestRec();
+	}
+
+const TImplementationProxy ImplementationTable[] = 
+    {
+	IMPLEMENTATION_PROXY_ENTRY(0x10004c50,CRApaLsSessionStartAppTestRec::CreateRecognizerL)
+	};
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TRApaLsSessionStartAppTestRecognizer_v2.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,38 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TRApaLsSessionStartAppTestRecognizer.mmp
+// 
+//
+
+#include <platform_paths.hrh>
+
+target 		TRApaLsSessionStartAppTestRecognizer.dll
+targetpath	/sys/bin
+CAPABILITY	All -Tcb
+targettype 	PLUGIN
+uid			0x10009d8d 0x10000182
+VENDORID 	0x70000001
+
+SOURCEPATH		.
+SOURCE			TRApaLsSessionStartAppTestRecognizer.CPP
+systeminclude   /EPOC32/INCLUDE
+systeminclude	/EPOC32/INCLUDE/ECOM
+
+MW_LAYER_SYSTEMINCLUDE
+
+library         EUSER.LIB APPARC.LIB APMIME.LIB 
+
+start resource 10000182.rss
+target TRApaLsSessionStartAppTestRecognizer.rsc
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TRApaLsSessionTestUids.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,32 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#if (!defined __T_RAPALSSESSION_UIDS_H__)
+#define __T_RAPALSSESSION_UIDS_H__
+
+const TUid KUidTRApaLsSessionStartAppTestApp	= { 0x10004c4f };
+//const TUid KUidAppEmbeddable				= { 0x10004c48 };
+//const TUid KUidAppEmbeddableOnly			= { 0x10004c49 };
+//const TUid KUidAppEmbeddableUiOrStandAlone	= { 0x10004c4A };
+//const TUid KUidAppEmbeddableUiNotStandAlone	= { 0x10004c4B };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TRecUpgrade_1/recupgrade_1.MMP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,42 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+target 		recupgrade.dll
+targettype 	plugin 
+uid			0x10009d8d 0xA000B461
+VENDORID 	0x70000001
+CAPABILITY	All -Tcb
+
+systeminclude   /EPOC32/INCLUDE /EPOC32/INCLUDE/ECOM /EPOC32/INCLUDE/TEST
+
+SOURCEPATH	.
+source			recupgrade_1.cpp
+
+library         EUSER.LIB APMIME.LIB EFSRV.LIB
+
+// Both recupgrade.rsc files are same (above one and the one which is mention in TRecUpgrade/recupgrade.MMP),so commented this one and used the othere one .
+/**
+start resource A000B461.rss
+target recupgrade.rsc
+end
+*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TRecUpgrade_1/recupgrade_1.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,100 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+#include <ImplementationProxy.h>
+#include "..\TRecUpgrade\upgconstants.h"
+#include "..\TRecUpgrade\recupgrade.h"
+#include <f32file.h>  // TParse
+
+/////////////////////////////////////////////////
+
+const TInt KMaxBufferLength=1024; // maximum amount of buffer space we will ever use
+
+/////////////////////////////////////////////////
+
+/*
+DLL entry point
+*/
+GLDEF_C TInt E32Dll()
+	{
+	return KErrNone;
+	}
+
+/*
+Private constructor
+*/
+CTestUpgradeRecognizer::CTestUpgradeRecognizer()
+	:CApaDataRecognizerType(KUidUpgradeRecognizer, CApaDataRecognizerType::ENormal)
+	{
+	iCountDataTypes = KNumUpgradeTypes;
+	}
+	
+/*
+Ecom factory function
+*/
+CApaDataRecognizerType* CTestUpgradeRecognizer::CreateRecognizerL()
+	{
+	return new (ELeave) CTestUpgradeRecognizer();
+	}
+	
+TUint CTestUpgradeRecognizer::PreferredBufSize()
+	{
+	return KMaxBufferLength;
+	}
+
+TDataType CTestUpgradeRecognizer::SupportedDataTypeL(TInt /*aIndex*/) const
+	{
+	return TDataType(KMimeUpgType);
+	}
+
+void CTestUpgradeRecognizer::DoRecognizeL(const TDesC& aName, const TDesC8& /*aBuffer*/)
+	{
+    // If an error stops CTestUpgradeRecognizer being removed as part of test cleanup, 
+	// returning ENotRecognized will avoid the possibility of impacting other test code.
+
+	_LIT(KExtension , ".upg");
+	TParse parse;
+    parse.Set(aName,NULL,NULL);
+	TPtrC ext=parse.Ext(); // extract the extension from the filename
+
+	if (ext.CompareF(KExtension)==0)
+		{
+		iDataType = TDataType(KMimeUpgType);
+		iConfidence = EPossible;
+		}
+	else
+		{
+		iDataType=TDataType();
+		iConfidence=ENotRecognized;
+		}	
+	}
+
+const TImplementationProxy ImplementationTable[] = 
+    {
+	IMPLEMENTATION_PROXY_ENTRY(KUidUpgradeRecognizerValue, CTestUpgradeRecognizer::CreateRecognizerL)
+	};
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TSTAPP.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,412 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include <e32uid.h>
+#include <s32std.h>
+#include <s32stor.h>
+#include <s32file.h>
+#include <apgicnfl.h>
+#include <apfdef.h>
+#include "tstapp.h"
+#include <apfdef.h>
+#include <apgcli.h>
+
+#include <eikstart.h>
+#include <ecom.h>
+#include <implementationproxy.h>
+
+_LIT(KTestAppCaption, "Test App");
+_LIT(KTempFilePath, "c:\\system\\temp\\");
+_LIT(KTestAppIniFilePath, "c:\\system\\data\\tstapp.ini");
+
+
+GLDEF_C TInt E32Dll(
+					)
+	{
+	return KErrNone;
+	}
+
+LOCAL_C CApaApplication* NewApplicationL()
+	{
+	CApaApplication* thing=NULL;
+	thing=CTestApp::NewL();
+	return thing;
+	//return new CExampleApplication;
+	}
+
+LOCAL_D const TImplementationProxy ImplementationTable[]=
+	{
+	IMPLEMENTATION_PROXY_ENTRY(KTestAppUidValue, NewApplicationL)
+	};
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+	{
+	aTableCount=sizeof(ImplementationTable)/sizeof(ImplementationTable[0]);
+	return ImplementationTable;
+	}
+
+
+/////////////////////////////////////////
+// CBasicAppUi
+/////////////////////////////////////////
+
+void CBasicAppUi::ConstructL()
+	{
+	BaseConstructL(ENoAppResourceFile|ENoScreenFurniture);
+	}
+	
+/////////////////////////////////////////
+// CTestApp
+/////////////////////////////////////////
+
+CTestApp* CTestApp::NewL()
+// The gated function
+//
+	{
+	CTestApp* self=new(ELeave) CTestApp();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+
+CTestApp::CTestApp()
+	:iCaption(KTestAppCaption)
+	{}
+
+
+CTestApp::~CTestApp()
+	{
+	}
+
+void CTestApp::ConstructL()
+	{
+	User::LeaveIfError(iFs.Connect());
+	}
+
+	
+void CTestApp::PreDocConstructL()
+	{
+	}
+
+
+CEikDocument* CTestApp::CreateDocumentL()
+	{	
+	return CTestAppDoc::NewL(*this);
+	}
+
+TDesC& CTestApp::Caption()
+// return the app title in current system language
+//
+	{
+	return iCaption;
+	}
+
+
+TUid CTestApp::AppDllUid()const
+	{
+	return KUidTestApp;
+	}
+	
+CDictionaryStore* CTestApp::OpenIniFileLC(RFs& aFs) const
+// Opens the applications ini file if it exists, otherwise creates a new one
+// The ini file is located on KTestAppIniFilePath
+	{
+	aFs.MkDirAll(KTestAppIniFilePath); // ignore the error
+	//
+	// open the ini file if it exists, otherwise create a new one
+	return CDictionaryFileStore::OpenLC(aFs, KTestAppIniFilePath(), AppDllUid());
+	}
+
+
+void CTestApp::Capability(TDes8& aInfo)const
+	{
+	RApaLsSession apaLsSession;
+	TInt err = apaLsSession.Connect();
+	__ASSERT_ALWAYS(!err, User::Panic(_L("CTestApp::Capability"), err));	
+	apaLsSession.GetAppCapability(aInfo, CTestApp::AppDllUid());
+	apaLsSession.Close();
+	}
+
+
+/////////////////////////////////////////
+// CTestAppDoc
+/////////////////////////////////////////
+
+CTestAppDoc* CTestAppDoc::NewL(CEikApplication& aApp)
+	{
+	CTestAppDoc* self=new(ELeave) CTestAppDoc(aApp);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop();
+	return self;
+	}
+
+
+CTestAppDoc::CTestAppDoc(CEikApplication& aApp)
+	: CEikDocument(aApp),
+	iValue(0)
+	{}
+
+	
+void CTestAppDoc::ConstructL()
+	{
+	iEmbedList = new(ELeave) CArrayFixFlat<TPictureHeader>(1);
+	}
+
+CEikAppUi* CTestAppDoc::CreateAppUiL()
+	{
+	
+	return new(ELeave) CBasicAppUi();
+	}
+
+CTestAppDoc::~CTestAppDoc()
+	{
+	// delete all the embedded doc's first...
+	if (iEmbedList)
+		{
+		for (TInt i=iEmbedList->Count()-1 ; i>=0 ; i--)
+			delete EmbeddedDoor(i); // destroys the door (which in turn removes doc from the process and deletes it)
+		}
+	// then...
+	delete iEmbedList;
+	delete iStore;
+	}
+
+
+TBool CTestAppDoc::IsEmpty()const
+	{
+	// return ETrue if the document is empty
+	if (iValue==0)
+		return ETrue;
+	else 
+		return EFalse;
+	}
+
+
+TBool CTestAppDoc::HasChanged()const
+	{
+	return iHasChanged;
+	}
+
+/** builds a new embedded or main document without loading from a store (may create the content from 
+	eg code or a template file).
+*/
+void CTestAppDoc::NewDocumentL()
+	{}
+
+
+/** Create a document file & store of the specified name, storing into the store.
+    On system startup the name might not have a filename component in which case this function should parse the 
+    passed name with a related default file name appropriate to this application and in an appropriate language
+*/
+CFileStore* CTestAppDoc::CreateFileStoreLC(RFs& aFs,const TDesC& aFileName)
+	{
+	// set the default name just in case...
+	TFileName defaultName(_L("temp"));
+	TParse parser;
+	User::LeaveIfError(parser.Set(aFileName,&defaultName,NULL));
+	// create the file store
+	CFileStore* store;
+	store = CDirectFileStore::CreateLC(aFs,parser.FullName(),EFileWrite);
+	store->SetTypeL(TUidType(KDirectFileStoreLayoutUid,KUidAppDllDoc,KUidTestApp));
+	CStreamDictionary* streamDic=CStreamDictionary::NewL();
+	CleanupStack::PushL(streamDic);
+	StoreL(*store,*streamDic); 
+	Process()->WriteRootStreamL(*store,*streamDic,*Application());
+	store->CommitL(); // now the store will be fully initialised
+	CleanupStack::PopAndDestroy(); // streamDic
+	return store;
+	}
+
+
+void CTestAppDoc::EditL(MApaEmbeddedDocObserver* /*aContainer*/,TBool aReadOnly)
+	{
+	if (aReadOnly)
+		{
+		if (iContainer)
+			{
+			iContainer->NotifyExit(MApaEmbeddedDocObserver::ENoChanges);
+			iContainer = NULL; // iContainer must be nulled when editing is finished
+			}
+		}
+	else
+		{
+		iValue++;
+		iHasChanged = ETrue;
+		if (iContainer)
+			{
+			iContainer->NotifyExit(MApaEmbeddedDocObserver::EKeepChanges);
+			iContainer = NULL; // iContainer must be nulled when editing is finished
+			}
+		}
+	}
+
+void CTestAppDoc::NotifyExit(MApaEmbeddedDocObserver::TExitMode aMode)
+	{
+	switch (aMode)
+		{
+		case EKeepChanges:
+			iHasChanged = ETrue; // note that my contents have changed
+			break;
+		case ERevertToSaved:
+			// reload whole document (panic if I'm not the main doc)
+			break;
+		case ENoChanges:
+			// no changes
+			break;
+		case EEmpty:
+			// the embedded doc is empty
+			break;
+		}
+	}
+
+
+void CTestAppDoc::PrintL(const CStreamStore& /*aSourceStore*/)
+	{}
+
+
+void CTestAppDoc::SaveL()
+	{
+
+	CDirectFileStore* store;
+	TParse newFilePath;
+	// create temp file
+	User::LeaveIfError( newFilePath.Set(Process()->MainDocFileName(),NULL,NULL) ); // abuse new file path
+	TBuf<2> drive=newFilePath.Drive();
+	TFileName filePath(KTempFilePath);
+	User::LeaveIfError( newFilePath.Set(drive,&filePath,NULL) );
+	Process()->FsSession().MkDirAll(newFilePath.DriveAndPath());
+	TFileName tempName;
+	store = CDirectFileStore::TempLC(Process()->FsSession(),newFilePath.DriveAndPath(),tempName,EFileWrite);
+	store->SetTypeL(((CFileStore*)iStore)->Type());
+
+	// store main in temp
+	CStreamDictionary* streamDic=CStreamDictionary::NewL();
+	CleanupStack::PushL(streamDic);
+	StoreL(*store,*streamDic);
+	iStore->CommitL();
+
+	// write root stream
+	Process()->WriteRootStreamL(*store,*streamDic,*Application());
+	CleanupStack::PopAndDestroy(); // streamDic
+	// close the new store
+	store->CommitL();
+	CleanupStack::PopAndDestroy(); // store
+	// close the old store
+	delete iStore;
+	iStore = NULL;
+	// replace the old file
+	User::LeaveIfError( Process()->FsSession().Replace(tempName,Process()->MainDocFileName()) );
+	// open new file
+	iStore = CDirectFileStore::OpenL(Process()->FsSession(),Process()->MainDocFileName(),EFileShareExclusive);
+	}
+
+
+void CTestAppDoc::StoreL(CStreamStore& aStore,CStreamDictionary& aStreamDic)const
+	{
+	//
+	// create map and store embedded doc's
+	CStoreMap* map=CStoreMap::NewLC(aStore);
+	StoreComponentsL(aStore,*map);
+	// store the headstream
+	RStoreWriteStream stream(*map);
+	TStreamId id=stream.CreateLC(aStore); 
+	ExternalizeL(stream);
+	stream.CommitL();
+	// assign the headstream in the dictionary
+	aStreamDic.AssignL(KUidTestAppHeadStream,id);
+	// tidy up
+	map->Reset();
+	CleanupStack::PopAndDestroy(2); // map,stream
+	}
+
+
+void CTestAppDoc::RestoreL(const CStreamStore& aStore,const CStreamDictionary& aStreamDic)
+	{
+	//
+	TStreamId headStreamId=aStreamDic.At(KUidTestAppHeadStream);
+	RStoreReadStream stream;
+	stream.OpenLC(aStore,headStreamId); 
+	InternalizeL(stream);
+	CleanupStack::PopAndDestroy(); // stream
+	// restore the embedded bits
+	RestoreComponentsL(aStore);
+	}
+
+
+void CTestAppDoc::DetachFromStoreL(CPicture::TDetach aDegree)
+	{
+	for (TInt i=0 ; i<iEmbedList->Count() ; i++)
+		EmbeddedDoor(i)->DetachFromStoreL(aDegree);
+	}
+
+
+void CTestAppDoc::StoreComponentsL(CStreamStore& aStore,CStoreMap& aMap)const
+	{
+	for (TInt i=0 ; i<iEmbedList->Count() ; i++)
+		{
+		TStreamId id=EmbeddedDoor(i)->StoreL(aStore);
+		aMap.BindL((*iEmbedList)[i].iPicture,id);
+		}
+	}
+
+
+void CTestAppDoc::RestoreComponentsL(const CStreamStore& aStore)
+	{
+	TApaPictureFactory factory(Process());
+	for (TInt i=0 ; i<iEmbedList->Count() ; i++)
+		{
+		TRAPD(ret, factory.NewPictureL((*iEmbedList)[i],aStore) );
+		if ((ret!=KErrNone)&&(ret!=KErrNotFound))
+			User::Leave(ret);
+		}
+	}
+
+
+void CTestAppDoc::ExternalizeL(RWriteStream& aStream)const
+	{
+	aStream.WriteInt32L(iValue);
+	// externalize num of embedded objects
+	TInt numObjects=iEmbedList->Count();
+	aStream.WriteInt32L(numObjects);
+	// externalize the doors
+	for (TInt i=0 ; i<numObjects ; i++)
+		aStream<< (*iEmbedList)[i].iPicture;
+	}
+
+
+void CTestAppDoc::InternalizeL(RReadStream& aStream)
+	{
+	// reset();
+	iValue = aStream.ReadInt32L();
+	TInt numObjects=aStream.ReadInt32L();
+	for (TInt i=0 ; i<numObjects ; i++)
+		{
+		TPictureHeader header;
+		header.iPictureType = KUidPictureTypeDoor;
+		aStream>> header.iPicture;
+		iEmbedList->AppendL(header);
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TSTAPP.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,141 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+#ifndef __TSTAPP_H__
+#define __TSTAPP_H__
+
+#if !defined(__APPARC_H__)
+#include <apparc.h>
+#endif
+
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <apgdoor.h>
+#include <eikappui.h>
+
+// classes defined:
+class CTestApp;
+class CTestAppDoc;
+//
+
+#define KTestAppDefaultFileName _L("TestApp.doc")
+const TInt KTestAppUidValue=10;
+const TUid KUidTestApp={KTestAppUidValue};
+const TUid KUidTestAppHeadStream={200};
+const TInt KNarrowRelUidValue=268435578;
+const TUid KUidNarrowRel={KNarrowRelUidValue}; // so it'll run under arm...
+#define KTestAppUidType TUidType(KUidNarrowRel,KUidApp,KUidTestApp)
+
+
+class CTestApp : public CEikApplication
+	{
+public:
+	static CTestApp* NewL(); // the gated function
+	// from CApaApplication
+	void PreDocConstructL();
+	CEikDocument* CreateDocumentL();
+	TDesC& Caption(); // return the app title in current system language
+	TUid AppDllUid()const;
+	
+	CDictionaryStore* OpenIniFileLC(RFs& aFs)const;
+	void Capability(TDes8& aInfo)const;
+	~CTestApp();
+
+private:
+	CTestApp();
+	void ConstructL();
+	
+private:
+	TBuf<8> iCaption;
+	RFs iFs;
+	};
+
+class CBasicAppUi : public CEikAppUi
+	{
+public:
+	inline CBasicAppUi() {}
+private:
+	virtual void ConstructL();
+	};
+
+class CTestAppDoc : public CEikDocument, public MApaEmbeddedDocObserver
+	{
+public:
+	static CTestAppDoc* NewL(CEikApplication& aApp);
+	~CTestAppDoc();
+
+	inline void EmbedNewDocL(const TApaApplicationFactory& aTestFac); // exported so I can call it from testcode
+	inline void EditEmbeddedDocL(TInt aDocNum) {EmbeddedDoor(aDocNum)->DocumentL()->EditL(this);}
+	inline CApaDoor* EmbeddedDoor(TInt aDocNum)const {return (CApaDoor*)((*iEmbedList)[aDocNum].iPicture.AsPtr());}
+	virtual CEikAppUi* CreateAppUiL();
+	
+// from MApaEmbeddedDocObserver
+	void NotifyExit(MApaEmbeddedDocObserver::TExitMode aMode);
+// from CApaDocument
+	void NewDocumentL(); 
+	CFileStore* CreateFileStoreLC(RFs& aFs,const TDesC& aFileName);
+	void SaveL();
+	//
+	void PrintL(const CStreamStore& aSourceStore);
+	void EditL(MApaEmbeddedDocObserver* aContainer,TBool aReadOnly); 
+	TBool IsEmpty()const; // return ETrue if the document is empty
+	TBool HasChanged()const;
+	//
+	// storage functions
+	void StoreL(CStreamStore& aStore,CStreamDictionary& aStreamDic)const;
+	void RestoreL(const CStreamStore& aStore,const CStreamDictionary& aStreamDic);
+	void DetachFromStoreL(CPicture::TDetach aDegree);
+
+protected:
+	CTestAppDoc(CEikApplication& aApp);
+	void ConstructL();
+
+	void InternalizeL(RReadStream& aStream);
+	void ExternalizeL(RWriteStream& aStream)const;
+	void StoreComponentsL(CStreamStore& aStore,CStoreMap& aMap)const;
+	void RestoreComponentsL(const CStreamStore& aStore);
+
+	// utility functions
+public:
+	TInt iValue; // the "contents" of this test document
+	CArrayFixFlat<TPictureHeader>* iEmbedList;
+	CStreamStore* iStore;
+	TBool iHasChanged;
+	};
+
+inline void CTestAppDoc::EmbedNewDocL(const TApaApplicationFactory& aTestFac)
+	{
+	TPictureHeader header;
+	header.iPictureType = KUidPictureTypeDoor;
+
+	CApaDocument* doc=Process()->AddNewDocumentL(aTestFac);
+
+	RFs& fs=Process()->FsSession();
+	header.iPicture = CApaDoor::NewLC(fs,*doc,TSize(500,500));
+
+	iEmbedList->AppendL(header);
+	CleanupStack::Pop(); // iPicture
+	}
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TSTAPP.hrh	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,30 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+enum TExampleMenuCommands
+	{
+	EExampleItem0 = 200,
+	EExampleItem1,
+	EExampleItem2
+	};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TSTAPP.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,75 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+NAME TAPP
+
+#include <eikon.rh>
+#include <eikcore.rsg>
+
+#include "TSTAPP.hrh"
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+	{
+	hotkeys=r_example_hotkeys;
+	menubar=r_example_menubar;
+	}
+
+
+
+RESOURCE HOTKEYS r_example_hotkeys
+    {
+    control=
+        {
+        HOTKEY { command=EEikCmdExit; key='e'; }
+        };
+    }
+
+RESOURCE MENU_BAR r_example_menubar
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_example_first_menu; txt="TSTAPP"; }
+		};
+    }
+
+RESOURCE MENU_PANE r_example_first_menu
+	{
+	items=
+		{
+		MENU_ITEM { command=EExampleItem0; txt="Item 0"; },
+		MENU_ITEM { command=EExampleItem1; txt="Item 1"; },
+		MENU_ITEM { command=EExampleItem2; txt="Item 2"; },
+		MENU_ITEM { command=EEikCmdExit; txt="Close"; }
+        };
+    }
+
+
+RESOURCE TBUF r_example_text_Title { buf="Simple Application"; }
+RESOURCE TBUF r_example_text_Item0 { buf="Item 0"; }
+RESOURCE TBUF r_example_text_Item1 { buf="Item 1"; }
+RESOURCE TBUF r_example_text_Item2 { buf="Item 2"; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TSTAPP_embedded.MMP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,53 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include <platform_paths.hrh>
+
+target			TSTAPP_embedded.DLL
+TARGETPATH		/SYS/BIN
+TARGETTYPE 		PLUGIN
+UID 			0x10009d8d 0x10004c66
+
+CAPABILITY 		All -Tcb
+VENDORID 		0x70000001
+
+
+sourcepath		.
+source          TSTAPP.CPP
+
+systeminclude   ../INC 	// your public include directory should be here
+systeminclude   /EPOC32/INCLUDE
+systeminclude   /EPOC32/INCLUDE/techview
+systeminclude 	/EPOC32/INCLUDE/ECOM
+
+MW_LAYER_SYSTEMINCLUDE
+
+userinclude     .
+
+
+START RESOURCE 	10004c66.rss
+TARGET 			TSTAPP_embedded.rsc
+END
+
+library         EUSER.LIB APPARC.LIB GDI.LIB ESTOR.LIB EFSRV.LIB APGRFX.LIB eikcore.lib CONE.LIB
+library			ECOM.LIB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TSTAPP_standalone.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,35 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// "stub" to start the application architecture with the ECom UID
+// 
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+#include <e32std.h>
+#include <eikstart.h>
+
+const TUid KTstAppUid = {10}; //use original UID of app (before it was converted from app to exe)
+
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication(KTstAppUid);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TSTAPP_standalone.MMP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,103 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include <platform_paths.hrh>
+
+ TARGET        	tstapp.exe
+ TARGETTYPE    	exe
+ TARGETPATH		/sys/bin
+
+CAPABILITY 	All -Tcb
+
+UID           	0x100039CE 10 //the original UID
+VENDORID 		0x70000001 
+EPOCSTACKSIZE 	0x5000
+
+SOURCEPATH    	.
+SOURCE        	TSTAPP_standalone.cpp
+
+USERINCLUDE   	.
+SYSTEMINCLUDE 	/epoc32/include
+SYSTEMINCLUDE 	/epoc32/include/techview
+systeminclude 	/EPOC32/INCLUDE/ECOM
+
+MW_LAYER_SYSTEMINCLUDE
+
+//reg added for Datacaging
+START RESOURCE	tstapp_reg.rss
+TARGETPATH		/private/10003a3f/import/apps
+END
+
+START RESOURCE 	tstapp.rss
+TARGETPATH 		/resource/apps
+END
+
+START RESOURCE 	tstapp_loc.rss
+TARGETPATH 		/resource/apps
+LANG 			SC 01 02 03 04 05
+END
+
+START BITMAP 	tstapp.mbm
+TARGETPATH 		/resource/apps
+SOURCEPATH 		../tdatasrc
+SOURCE 			c8,1 tstappicon24x20.bmp tstappicon24x20m.bmp
+SOURCE 			c8,1 tstappicon24x20.bmp tstappicon24x20m.bmp
+SOURCE 			c8,1 tstappicon40x55.bmp tstappicon40x55m.bmp
+
+END
+
+START BITMAP 	tstapp02.m02
+TARGETPATH 		/resource/apps
+SOURCEPATH 		../tdatasrc
+SOURCE 			c8,1 def25.bmp def25m.bmp def25.bmp def25m.bmp def50.bmp def50m.bmp
+END
+
+START BITMAP 	tstappview01.m01
+TARGETPATH 		/resource/apps
+SOURCEPATH 		../tdatasrc
+SOURCE 			c8,1 def25.bmp def25m.bmp def35.bmp def35m.bmp def50.bmp def50m.bmp
+END
+
+START BITMAP 	tstappview02.k
+TARGETPATH 		/resource/apps
+SOURCEPATH 		../tdatasrc
+SOURCE 			c8,1 tstappicon24x20.bmp tstappicon24x20m.bmp
+SOURCE 			c8,1 tstappicon24x20.bmp tstappicon24x20m.bmp
+SOURCE 			c8,1 tstappicon40x55.bmp tstappicon40x55m.bmp
+END
+
+START BITMAP 	tstappview01.m02
+TARGETPATH 		/resource/apps
+SOURCEPATH 		../tdatasrc
+SOURCE 			c8,1 def25.bmp def25m.bmp def35.bmp def35m.bmp def50.bmp def50m.bmp
+END
+
+START BITMAP 	tstappview
+TARGETPATH 		/resource/apps
+SOURCEPATH 		../tdatasrc
+SOURCE 			c8,1 tstappicon24x20.bmp tstappicon24x20m.bmp
+SOURCE 			c8,1 tstappicon24x20.bmp tstappicon24x20m.bmp
+SOURCE 			c8,1 tstappicon40x55.bmp tstappicon40x55m.bmp
+END
+
+LIBRARY 	euser.lib apparc.lib eikcore.lib cone.lib  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TSidChecker/10281FDF.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Registry file for the CAppSidCheckerInterface testing implementation
+// 
+//
+
+
+
+/**
+ @file 10281FDF.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include "RegistryInfo.rh"
+
+RESOURCE REGISTRY_INFO r_registry
+	{
+	dll_uid = 0x10281FDF; // must match the name of this file
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = 0x20007D8C;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 0x10281FDE;
+					version_no = 1;
+					display_name = "TestSidChecker";
+					default_data = "[10281fdb]";
+					opaque_data = "";
+					}
+				};
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TSidChecker/TestSidChecker.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,418 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "TestSidChecker.h"
+
+#include <e32std.h>
+#include <ImplementationProxy.h>
+#include <e32property.h>
+#include <e32test.h>
+#include <e32debug.h>
+#include <f32file.h>
+
+
+TBool E32Dll()
+	{
+	return (ETrue);
+	}
+
+const TImplementationProxy ImplementationTable[] =
+	{
+	IMPLEMENTATION_PROXY_ENTRY(0x10281FDE, CTestSidChecker::NewL)
+	};
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+	{
+	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+	return ImplementationTable;
+	}
+
+//////////////////////////////
+// private class declarations
+//////////////////////////////
+
+NONSHARABLE_CLASS(CApFileTestPropertyMonitor) : public CActive
+	{
+public:
+	static CApFileTestPropertyMonitor* NewL(TCallBack aCallBack);
+	~CApFileTestPropertyMonitor();
+	void Start();
+
+private:
+	CApFileTestPropertyMonitor(TCallBack aCallBack);
+	void RunL();
+	void DoCancel();
+
+private:
+	TCallBack iCallBack;
+	RProperty iProperty;
+	};
+
+NONSHARABLE_CLASS(CApFileTestOneShotTimer) : public CActive
+	{
+public:
+	static CApFileTestOneShotTimer* NewL(TCallBack aCallBack);
+	~CApFileTestOneShotTimer();
+	void Start(TTimeIntervalMicroSeconds32 aDelay);
+
+private:
+	CApFileTestOneShotTimer(TCallBack aCallBack);
+	void RunL();
+	void DoCancel();
+
+private:
+	TCallBack iCallBack;
+	RTimer iTimer;
+	};
+
+//////////////////////////////
+// CApFileTestPropertyMonitor
+//////////////////////////////
+
+CApFileTestPropertyMonitor* CApFileTestPropertyMonitor::NewL(TCallBack aCallBack)
+	{	
+	CApFileTestPropertyMonitor* self = new(ELeave) CApFileTestPropertyMonitor(aCallBack);
+	TInt err = self->iProperty.Attach(KApFileTestPubSubCategory, KApFileTestPubSubCallBackKey);
+	if(err != KErrNone)
+		{
+		delete self;
+		User::Leave(err);
+		}
+	return self;
+	}
+
+CApFileTestPropertyMonitor::CApFileTestPropertyMonitor(TCallBack aCallBack) :
+		CActive(EPriorityHigh),
+		iCallBack(aCallBack)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+CApFileTestPropertyMonitor::~CApFileTestPropertyMonitor()
+	{
+	Cancel();
+	iProperty.Close();
+	}
+
+void CApFileTestPropertyMonitor::Start()
+	{
+	iProperty.Subscribe(iStatus);
+	SetActive();
+	}
+
+void CApFileTestPropertyMonitor::RunL()
+	{
+	if(iStatus.Int() != KErrNone)
+		{
+		RDebug::Print(_L("TestSidChecker: Property subcribe failed, error code: %i"), iStatus.Int());
+		}
+	iCallBack.CallBack();
+	}
+
+void CApFileTestPropertyMonitor::DoCancel()
+	{
+	iProperty.Cancel();
+	}
+
+//////////////////////////////
+// CApFileTestOneShotTimer
+//////////////////////////////
+
+CApFileTestOneShotTimer* CApFileTestOneShotTimer::NewL(TCallBack aCallBack)
+	{
+	CApFileTestOneShotTimer* self = new(ELeave) CApFileTestOneShotTimer(aCallBack);
+	TInt err = self->iTimer.CreateLocal();
+	if(err != KErrNone)
+		{
+		delete self;
+		User::Leave(err);
+		}
+	return self;
+	}
+
+CApFileTestOneShotTimer::CApFileTestOneShotTimer(TCallBack aCallBack) :
+		CActive(EPriorityHigh),
+		iCallBack(aCallBack)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+CApFileTestOneShotTimer::~CApFileTestOneShotTimer()
+	{
+	Cancel();
+	iTimer.Close();
+	}
+
+void CApFileTestOneShotTimer::Start(TTimeIntervalMicroSeconds32 aDelay)
+	{
+	iTimer.After(iStatus,aDelay);
+	SetActive();
+	}
+
+void CApFileTestOneShotTimer::RunL()
+	{
+	if(iStatus.Int() != KErrNone)
+		{
+		RDebug::Print(_L("TestSidChecker: OneShotTimer Failed, error code: %i"), iStatus.Int());
+		}
+	iCallBack.CallBack();
+	}
+	
+void CApFileTestOneShotTimer::DoCancel()
+	{
+	iTimer.Cancel();
+	}
+
+//////////////////////////////
+// CTestSidChecker
+//////////////////////////////
+
+CTestSidChecker* CTestSidChecker::NewL()
+	{
+	CTestSidChecker* self = new(ELeave) CTestSidChecker();
+	return self;
+	}
+
+CTestSidChecker::CTestSidChecker()
+	{
+	}
+	
+CTestSidChecker::~CTestSidChecker()
+	{
+	}
+
+TBool CTestSidChecker::AppRegisteredAt(const TUid& aSid, TDriveUnit aDrive)
+	{
+	TBool ret = EFalse;
+	if(aSid == KApFileTestBadApp)
+		{
+		ret = EFalse;
+		}
+	else if(aSid == KApFileTestGoodApp)
+		{
+		#ifdef __WINS__
+		TDriveUnit drive(EDriveX);
+		#else
+		TDriveUnit drive(EDriveX);
+		RFs	fs;
+		User::LeaveIfError(fs.Connect());
+		CleanupClosePushL(fs);
+		//The removable media is expected at D: on NAND ROM and at E: on normal ROMs.
+		//The following code works on techview but not guaranteed to work on all platforms. 
+		TDriveInfo driveInfo;
+		TInt error = fs.Drive(driveInfo, EDriveD);
+		if(error == KErrNone && ((driveInfo.iDriveAtt & KDriveAttRemovable) != 0))
+			{
+		 	// Use drive D
+		 	drive = EDriveD;
+		 	}
+		 else
+		 	{
+			error = fs.Drive(driveInfo, EDriveE);
+			if(error == KErrNone && ((driveInfo.iDriveAtt & KDriveAttRemovable) != 0))
+				{
+			 	// Use drive E
+			 	drive = EDriveE;
+			 	}
+			}
+		fs.Close();
+		CleanupStack::PopAndDestroy(&fs);
+		#endif
+		ret = (aDrive == drive);
+		}
+	else if(aSid == KApFileTestCallBackApp)
+		{
+		ret = ETrue;
+		CallBackAppChecked();
+		}
+	else if(aSid == KApFileTestForcedRegistration)
+		{
+		ret = EFalse;
+		}
+	else if(aSid == KApTriggerRescan)
+		{
+		ret = ETrue;
+		if (!iRescanTriggered)
+			{
+			iRescanTriggered = ETrue;
+			iRescanCallBack.CallBack();
+			}
+		}
+	else if(aSid == KApFileTestAppWithMultipleRegistrationFiles)
+		{
+		ret = ETrue;
+		AppWithMultipleRegistrationFilesChecked();
+		}
+	else
+		{
+		Error(_L("TestSidChecker: Unknown sid %x"), aSid.iUid);
+		}
+	return ret;
+	}
+	
+void CTestSidChecker::SetRescanCallBackL(const TCallBack &aCallBack)
+	{
+	iRescanCallBack = aCallBack;
+	if(aCallBack.iFunction)
+		{
+		iMonitor = CApFileTestPropertyMonitor::NewL(TCallBack(&PropertyEventCallBack,this));
+		iTimer = CApFileTestOneShotTimer::NewL(TCallBack(&TimerEventCallBack,this));
+		}
+	}
+
+void CTestSidChecker::AppWithMultipleRegistrationFilesChecked()
+	{
+		TInt value;
+		TInt err = RProperty::Get(KApFileTestPubSubCategory, KApFileTestPubSubCallBackKey, value);
+		if(err == KErrNone)
+			{
+			if(value == ECheckedOnce)
+				{
+				TInt err = RProperty::Set(KApFileTestPubSubCategory, KApFileTestPubSubCallBackKey, ECheckedTwice);
+				if(err != KErrNone)
+					{
+					Error(_L("TestSidChecker: Property set failed, error code: %i"), err);
+					}
+				}
+			else if(value == ECheckedTwice)
+				{
+				TInt err = RProperty::Set(KApFileTestPubSubCategory, KApFileTestPubSubCallBackKey, ECheckedThrice);
+				if(err != KErrNone)
+					{
+					Error(_L("TestSidChecker: Property set failed, error code: %i"), err);
+					}
+				}
+			else
+				{
+				TInt err = RProperty::Set(KApFileTestPubSubCategory, KApFileTestPubSubCallBackKey, ECheckedOnce);
+				if(err != KErrNone)
+					{
+					Error(_L("TestSidChecker: Property set failed, error code: %i"), err);
+					}
+				}
+			}
+	}
+	
+void CTestSidChecker::CallBackAppChecked()
+	{
+	if(iState == ENotStarted)
+		{
+		TInt value;
+		TInt err = RProperty::Get(KApFileTestPubSubCategory, KApFileTestPubSubCallBackKey, value);
+		if(err == KErrNone)
+			{
+			if(value == EPluginLoad)
+				{
+				iMonitor->Start();
+				iState = EMonitorStarted;
+				}
+			else
+				{
+				Error(_L("TestSidChecker: Bad property value %u"), value);
+				}
+			}
+		else
+			{
+			// don't fail here, it's probably just a stale reg file.
+			}
+		}
+	else if(iState == EMonitorStarted)
+		{
+		// do nothing, it's a random scan happening before we start one manually
+		}
+	else if(iState == EScanStarted)
+		{
+		iState = EAppChecked;
+		TInt err = RProperty::Set(KApFileTestPubSubCategory, KApFileTestPubSubCallBackKey, EScanOccurred);
+		if(err != KErrNone)
+			{
+			Error(_L("TestSidChecker: Property set failed, error code: %i"), err);
+			}
+		}
+	else
+		{
+		Error(_L("TestSidChecker: Unexpected state %u"), iState);
+		}
+	}
+
+TInt CTestSidChecker::PropertyEventCallBack(TAny* aSelf)
+	{	
+	return STATIC_CAST(CTestSidChecker*,aSelf)->PropertyEvent();
+	}
+
+TInt CTestSidChecker::PropertyEvent()
+	{
+	if(iState == EMonitorStarted)
+		{
+		TInt value;
+		TInt err = RProperty::Get(KApFileTestPubSubCategory, KApFileTestPubSubCallBackKey, value);
+		if(err == KErrNone)
+			{
+			if(value == ETriggerScan)
+				{
+				User::After(1000000); // wait a second for the testexecute to subscribe to the property
+				iTimer->Start(7 * 1000000); // wait 7 seconds before assuming the callback has failed
+				iState = EScanStarted;
+				iRescanCallBack.CallBack();
+				}
+			else
+				{
+				Error(_L("TestSidChecker: Bad property value %u"), value);
+				}
+			}
+		else
+			{
+			Error(_L("TestSidChecker: PropertyGetFailed, error code: %i"), err);
+			}
+		}
+	else
+		{
+		Error(_L("TestSidChecker: Unexpected State %u"), iState);
+		}
+
+	return KErrNone;
+	}
+
+TInt CTestSidChecker::TimerEventCallBack(TAny* aSelf)
+	{
+	return STATIC_CAST(CTestSidChecker*,aSelf)->TimerEvent();
+	}
+
+TInt CTestSidChecker::TimerEvent()
+	{
+	if(iState == EScanStarted)
+		{
+		TInt err = RProperty::Set(KApFileTestPubSubCategory, KApFileTestPubSubCallBackKey, ETimedOut);
+		if(err != KErrNone)
+			{
+			Error(_L("TestSidChecker: Property set failed, error code: %i"), err);
+			}
+		}
+	else if(iState != EAppChecked)
+		{
+		Error(_L("TestSidChecker: Unexpected state %u"), iState);
+		}
+
+	return KErrNone;
+	}
+	
+void CTestSidChecker::Error(TRefByValue<const TDesC> aFmt, TInt aValue)
+	{
+	// Something rather unexpected happened. Give up, keep quiet.
+	RDebug::Print(aFmt,aValue);
+	iTimer->Cancel();
+	iMonitor->Cancel();
+	iState = ECallBackTestError;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TSidChecker/TestSidChecker.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,94 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __TESTSIDCHECKER_H__
+#define __TESTSIDCHECKER_H__
+
+#include <ApSidChecker.h>
+#include <e32property.h>
+
+const TUid  KApFileTestAppType              = {0x10281FDB};
+const TUid  KApFileTestBadApp               = {0x10281FDC};
+const TUid  KApFileTestGoodApp              = {0x10281FDD};
+const TUid  KApFileTestAppTypeSidChecker    = {0x10281FDE};
+const TUid  KApFileTestAppTypeSidCheckerDll = {0x10281FDF};
+const TUid  KApFileTestPubSubCategory       = {0x101F289C}; // apparc test server sid
+const TUid  KApFileTestCallBackApp          = {0x10281FE0};
+const TUid	KApFileTestForcedRegistration	= {0x102825B5};
+const TUid	KApTriggerRescan				= {0x102825B6};
+// randomly picked, to try to avoid anything else in the apparctestserver using pub/sub
+const TUint KApFileTestPubSubCallBackKey    =  0x0000d3f9;
+const TUid KApFileTestAppWithMultipleRegistrationFiles    = {0xA000D107};
+
+class CApFileTestPropertyMonitor;
+class CApFileTestOneShotTimer;
+
+NONSHARABLE_CLASS(CTestSidChecker) : public CAppSidChecker
+/** Test Sid checker.
+
+This is an implementation of CAppSidChecker for checking native application Sids
+
+This instance of the CAppSidChecker is used to verify that a native application
+installed and can be launched.
+
+@internalComponent */
+	{
+public:
+	enum TPropertyValue
+		{
+		EPropertyDefault,
+		EPluginLoad,
+		ETriggerScan,
+		EScanOccurred,
+		ETimedOut,
+		EOtherError,
+		ECheckedOnce,
+		ECheckedTwice,
+		ECheckedThrice
+		};
+	static CTestSidChecker* NewL();
+	~CTestSidChecker();
+
+public:
+	virtual TBool AppRegisteredAt(const TUid& aSid, TDriveUnit aDrive);
+	virtual void SetRescanCallBackL(const TCallBack &aCallback);
+
+private:
+	CTestSidChecker();
+	void CallBackAppChecked();
+	void AppWithMultipleRegistrationFilesChecked();
+	static TInt PropertyEventCallBack(TAny* aSelf);
+	TInt PropertyEvent();
+	static TInt TimerEventCallBack(TAny* aSelf);
+	TInt TimerEvent();
+	void Error(TRefByValue<const TDesC> aFmt, TInt aValue);
+
+private:
+	enum TState
+		{
+		ENotStarted,
+		EMonitorStarted,
+		EScanStarted,
+		EAppChecked,
+		ECallBackTestError
+		};
+	TCallBack iRescanCallBack;
+	CApFileTestPropertyMonitor* iMonitor;
+	CApFileTestOneShotTimer* iTimer;
+	TState iState;
+	TBool iRescanTriggered;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TSidChecker/TestSidChecker.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+TARGET TestSidChecker.dll
+CAPABILITY All -Tcb
+TARGETTYPE plugin
+
+UID 0x10009d8d 0x10281FDF
+
+SOURCEPATH .
+SOURCE TestSidChecker.cpp
+SYSTEMINCLUDE /epoc32/include /epoc32/include/ecom
+
+start RESOURCE 10281FDF.rss
+target testsidchecker.rsc
+end
+
+LIBRARY EUSER.LIB APFILE.LIB ECOM.LIB EFSRV.LIB
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TStartDoc.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,42 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file 
+ @internalComponent - Internal Symbian test code 
+*/
+
+#if !defined(__TSTARTDOC_H__)
+#define __TSTARTDOC_H__
+
+#if !defined(__E32STD_H__)
+#include <E32STD.H>
+#endif
+/** KLitLongURL must be > 256 characters long, in this case it's 259 characters long
+    The name is a little mis-leading, as it's not a real URL. URL is used in the name
+    because one of the use cases for needing document names longer than 256 characters
+    is when starting a very long URL to be handled by a web browser application
+*/
+_LIT(KLitLongURL, "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefXYZ");
+
+/** KTStartDocTestPassed is a number chosen at random to be used as an exit reason
+    for TStartDocApp.app's application thread to signify that the test passed
+*/
+
+const TInt KTStartDocTestPassed = 2387;
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TStartDocApp.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,199 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Supporting application for use by T_StartDocStep.cpp
+// The implementation of CR PHAR-5NTCWY removes the 256 character limit
+// on the length of document names.
+// This application is designed to be started by test code calling
+// RApaLsSession::StartDocument(const TDesC& aFileName, TThreadId& aId,
+// TLaunchType aLaunchType=ELaunchNewApp)
+// passing a document name (first parameter) that is longer than
+// 256 characters.
+// The test passes if this application is started with a document name
+// that is longer than 256 characters.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+
+#include <eikstart.h>
+
+#include "TStartDoc.h"
+
+const TUid KUidTStartDocApp = { 0x10004c4d };
+
+enum TStartDocAppPanic
+	{
+	EPanicDocNameCheck1Failed,
+	EPanicDocNameCheck1NotExecuted,
+	EPanicDocNameCheck2Failed,
+	};
+
+void Panic(TStartDocAppPanic aPanic)
+//
+// Panic the process with TESTFAILED as the category.
+//
+	{
+	_LIT(KPanicCategory,"TESTFAILED");
+	User::Panic(KPanicCategory, aPanic);
+	}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CStartDocAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CStartDocAppUi : public CEikAppUi
+    {
+public:
+    void ConstructL();
+	~CStartDocAppUi();
+public:
+	TBool DocNameCheck1Executed() const;
+	// from CEikAppUi
+	TBool ProcessCommandParametersL(TApaCommand aCommand, TFileName& aDocumentName, const TDesC8& aTail);
+private:
+	TBool iDocNameCheck1Executed;
+	};
+
+
+void CStartDocAppUi::ConstructL()
+    {
+    BaseConstructL(ENoAppResourceFile | ENoScreenFurniture);
+	}
+
+CStartDocAppUi::~CStartDocAppUi()
+	{
+	}
+
+TBool CStartDocAppUi::DocNameCheck1Executed() const
+	{
+	return iDocNameCheck1Executed;
+	}
+
+TBool CStartDocAppUi::ProcessCommandParametersL(TApaCommand /*aCommand*/, TFileName& aDocumentName, const TDesC8& /*aTail*/)
+	{
+	if (aDocumentName != KLitLongURL)
+		{
+		Panic(EPanicDocNameCheck1Failed);
+		}
+	iDocNameCheck1Executed = ETrue;
+	return EFalse; // don't try to open the document
+	}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CStartDocDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CStartDocDocument : public CEikDocument
+	{
+public:
+	static CStartDocDocument* NewL(CEikApplication& aApp);
+	CStartDocDocument(CEikApplication& aApp);
+	void ConstructL();
+	CFileStore* OpenFileL(TBool aDoOpen,const TDesC& aFilename,RFs& aFs);
+private: 
+	// from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+CStartDocDocument::CStartDocDocument(CEikApplication& aApp)
+		: CEikDocument(aApp)
+	{
+	}
+
+CEikAppUi* CStartDocDocument::CreateAppUiL()
+	{
+    return new(ELeave) CStartDocAppUi;
+	}
+
+CFileStore* CStartDocDocument::OpenFileL(TBool /*aDoOpen*/,const TDesC& /*aFilename*/,RFs& /*aFs*/)
+	{
+	if (!(static_cast<CStartDocAppUi*>(CEikonEnv::Static()->EikAppUi())->DocNameCheck1Executed()))
+		{
+		Panic(EPanicDocNameCheck1NotExecuted);
+		}
+	/** the process main doc filename should have been set by the framework by the time
+	    this function is called, so check it's been sucessfully set to a value that's
+	    longer than 256 characters
+	    (this tests the new CApaProcess::SetMainDocFileNameL API)
+	*/
+	  if (Process()->MainDocFileName() != KLitLongURL)
+		{
+		Panic(EPanicDocNameCheck2Failed);
+		}
+	// by exiting the app here with KTStartDocTestPassed, we ensure the test cannot pass
+	// in cases where something leaves during app startup
+	User::After(10000000); // ensure that the test harness gets a chance to logon to us
+	User::Exit(KTStartDocTestPassed);
+	return NULL; // just to keep the compiler happy
+	}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CStartDocApplication
+//
+////////////////////////////////////////////////////////////////////////
+class CStartDocApplication : public CEikApplication
+	{
+private: 
+	// from CApaApplication
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+private:
+	TFileName ResourceFileName() const;
+private:
+	CApaDocument* CreateDocumentL(CApaProcess* a) { return CEikApplication::CreateDocumentL(a); }
+	//
+	};
+
+CApaDocument* CStartDocApplication::CreateDocumentL()
+	{
+	return new (ELeave) CStartDocDocument(*this);
+	}
+
+TUid CStartDocApplication::AppDllUid() const
+	{
+	return KUidTStartDocApp;
+	}
+
+TFileName CStartDocApplication::ResourceFileName() const
+	{
+	return TFileName(); // this app doesn't have a resource file
+	}
+
+
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CStartDocApplication;
+	}
+	
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication(NewApplication);
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TStartDocApp_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,40 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file TStartDocApp_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10004c4d
+RESOURCE APP_REGISTRATION_INFO
+	{	
+	app_file = "TStartDocApp";
+	//
+	hidden=KAppNotHidden;
+	embeddability=KAppNotEmbeddable;
+	newfile=KAppDoesNotSupportNewFile;
+	//
+	datatype_list=
+		{
+		DATATYPE { priority=EDataTypePriorityHigh; type="x-epoc/long-url"; }
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TStartDocApp_v2.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,41 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TStartDocApp.mmp
+// 
+//
+
+TARGETPATH		/sys/bin
+
+	TARGET        TStartDocApp.exe
+	TARGETTYPE    exe
+
+CAPABILITY	All -Tcb
+UID        	0x100039CE 0x10004c4d
+VENDORID 	0x70000001
+
+SOURCEPATH    .
+SOURCE        TStartDocApp.cpp
+
+START RESOURCE	TStartDocApp_reg.rss
+TARGETPATH		/private/10003a3f/apps
+END   
+
+USERINCLUDE   .
+SYSTEMINCLUDE /epoc32/include
+SYSTEMINCLUDE /epoc32/include/techview
+
+LIBRARY       euser.lib apparc.lib cone.lib eikcore.lib
+
+
+epocstacksize 0x5000 //added
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TTestEcomFileRec.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,70 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include <apfrec.h>
+#include <ImplementationProxy.h> 
+
+class CTestEcomRecognizer : public CApaFileRecognizerType
+	{
+public: // from CApaFileRecognizerType
+	TThreadId RunL(TApaCommand aCommand,const TDesC* aDocFileName=NULL,const TDesC8* aTailEnd=NULL) const;
+	static CApaFileRecognizerType* CreateRecognizerL();
+private: // from CApaFileRecognizerType
+	TRecognizedType DoRecognizeFileL(RFs& aFs,TUidType aType);
+	};
+
+TThreadId CTestEcomRecognizer::RunL(TApaCommand /*aCommand*/,const TDesC* /*aDocFileName*/,const TDesC8* /*aTailEnd*/) const
+	{
+	TThreadId id(NULL);
+	return id;
+	}
+
+CApaFileRecognizerType::TRecognizedType CTestEcomRecognizer::DoRecognizeFileL(RFs& /*aFs*/,TUidType /*aType*/)
+	{
+	return iRecognizedType;
+	}
+
+
+GLDEF_C TInt E32Dll(
+					)
+
+// DLL entry point
+
+	{
+	return KErrNone;
+	}
+
+CApaFileRecognizerType* CTestEcomRecognizer::CreateRecognizerL()
+	{
+	return new (ELeave) CTestEcomRecognizer();
+	}
+
+const TImplementationProxy ImplementationTable[] = 
+    {
+	IMPLEMENTATION_PROXY_ENTRY(0x101F7D8C,CTestEcomRecognizer::CreateRecognizerL)
+	};
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TTestEcomFileRec.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+target 		ttestecomfilerec.dll
+CAPABILITY	All -Tcb
+targettype 	plugin
+uid			0x10009d8d 0x10000181
+VENDORID 	0x70000001
+
+SOURCEPATH		.
+SOURCE			TTESTECOMFILEREC.CPP
+systeminclude   /EPOC32/INCLUDE
+systeminclude	/EPOC32/INCLUDE/ECOM
+
+
+library         EUSER.LIB APPARC.LIB 
+
+
+start resource 10000181.rss
+target ttestecomfilerec.rsc
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TWindowChaining.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,50 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+#if !defined(__TWINDOWCHAINING_H__)
+#define __TWINDOWCHAINING_H__
+
+#if !defined(__E32STD_H__)
+#include <E32STD.H>
+#endif
+
+/** Ordinal priority chosen at random */
+const TInt KExoticOrdinalPriority=748;
+
+/** UIDs of the child and server (launch) application */
+const TUid KUidTChainChildApp = { 0x10009e9f };
+const TUid KUidTChainServerApp = { 0x10009f9a };
+
+/** KTWindowChainingTestPassed is a number chosen at random to be used as an exit reason
+    for TWindowChainingApp.app's application thread to signify that the test passed */
+const TInt KTWindowChainingTestPassed = 2387;
+
+const TInt KChainPass = 42;
+const TInt KChainFail = 59;
+
+/** Message ID (chosen at random) to query child to check parent id matches */
+const TInt KQueryChainChild1 = 428;
+const TInt KQueryChainChild2 = 429;
+
+_LIT(KWinChainChildAppFileName, "z:\\sys\\bin\\t_winchainLaunch.exe");
+#endif // __TWINDOWCHAINING_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_AppList.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,79 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// The following test case is used to test if apparctestserver 
+// can return app data for a specific app by caching that data when requested.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <apgcli.h>
+#include "T_AppList.h"
+
+CTestAppListStep::CTestAppListStep()
+	{
+	}
+
+CTestAppListStep::~CTestAppListStep()
+	{
+	iApaLsSession.Close();
+	}
+
+
+/**
+   @SYMTestCaseID CTestAppListStep_TestAppListL
+  
+   @SYMDEF DEF056494: Apparc App Info access APIs require the applist to be complete, delaying startup
+  
+   @SYMTestCaseDesc Testing whether apparctestserver return app info when the list is not completely populated.
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions To query for a particular app Info and check if the info is available.
+   API Calls:\n
+   RApaLsSession::GetAppInfo();
+  
+   @SYMTestExpectedResults Test should complete without any panic.
+ */
+void CTestAppListStep::TestAppList()
+	{
+	TApaAppInfo appInfo;
+	TUid uid = {0x100048F3};
+	TInt ret = iApaLsSession.GetAppInfo(appInfo,uid);
+	INFO_PRINTF2(_L(" Call to GetAppInfo returned : %d  "), ret);
+	TEST(ret==KErrNone);
+	}
+
+
+TVerdict CTestAppListStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test T_AppList Started"));
+	
+	// Connect to RApaLsSession without waiting for app list population
+	TEST(iApaLsSession.ConnectWithoutWaitingForListPopulation()==KErrNone);
+	
+	// Run the test
+	//DONT_CHECK since apps are added to app list by CApaAppList::FindAndAddSpecificAppL()
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, DONT_CHECK, TestAppList(), NO_CLEANUP);
+
+	INFO_PRINTF1(_L("Test Finished"));	
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_AppList.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+
+#ifndef		__T_APPLIST_H
+#define		__T_APPLIST_H
+
+#include "appfwk_test_AppUi.h"
+#include "testableapalssession.h"
+
+_LIT(KTestAppListStep, "T_AppList");
+
+//! CTestAppListStep
+/*! 
+  This class is used to test applist apis (GetAllApps, GetNextApp, GetAppInfo)
+  in RApaLsSession
+*/
+class CTestAppListStep : public CTestStep
+	{
+public:
+	CTestAppListStep();
+	~CTestAppListStep();
+	void TestAppList(); 
+	virtual TVerdict doTestStepL();
+private:
+	RTestableApaLsSession iApaLsSession;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_AppListFileBootStep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,285 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Note: With PREQ1228, we introduced "REQ5896:Load application information from a single file".
+// This PREQ is tested with the following two test steps:
+// T_AppListBootStep (only run for emulator, as it requires epoc restart)
+// |___ (APPFWK-APPARC-0033) Tests that the application information file (AppsList.bin) is created 
+// |		if it does not exists, and we reboot the phone.
+// |___ (APPFWK-APPARC-0034) Tests that the Short Caption associated with an app is restored to
+// its original value when the phone is restarted.
+// T_AppListUpdateStep
+// |___ (APPFWK-APPARC-0035) Tests that the application information file (AppsList.bin) is created 
+// |		if it does not exists, and we force a registration.
+// |___ (APPFWK-APPARC-0032) Tests that the application information file (AppsList.bin) is updated 
+// whenever a new application is installed.
+// 
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+
+#include <apgcli.h>
+#include "T_AppListFileBootStep.h"
+
+
+_LIT(KAppListFileName,"c:\\private\\10003a3f\\AppsListCache\\AppsList.bin");
+_LIT(KShortCaption1, "SC1");
+_LIT(KOriginalShortCaption, "TC UK");
+
+const TUid KUidTestApp={10};
+const TInt KMaxTimeCount = 18;						// 18 * 10 sec == 180 seconds
+
+
+/**
+Call base class method to set up the human readable name for logging TestStepName
+iBootType value set as per aBootType
+*/
+CT_AppListFileBootStep::CT_AppListFileBootStep(TInt aBootType)
+	{
+	iBootType = aBootType;
+	if(iBootType == 1)
+		{
+		SetTestStepName(KT_AppListFile_Boot1);
+		}
+	else if(iBootType == 2)
+		{
+		SetTestStepName(KT_AppListFile_Boot2);
+		}
+	else
+		{
+		SetTestStepName(KT_AppListFile_Boot3);
+		}
+	}
+
+
+CT_AppListFileBootStep::~CT_AppListFileBootStep()
+	{
+	}
+
+
+TVerdict CT_AppListFileBootStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test step started...."));
+
+#ifdef __WINS__
+ 	__UHEAP_MARK;
+	TRAPD(ret, DoTestL());
+	TEST(ret == KErrNone);
+ 	INFO_PRINTF2(_L("DoTestL() finished with return code '%d'"), ret);
+  	__UHEAP_MARKEND;
+#else
+ 	INFO_PRINTF1(_L("TEST NOT RUN! - T_AppListFile_BootX tests are meant only to run on Emulator"));
+ 	TEST(EFalse);
+#endif
+
+	INFO_PRINTF1(_L("....test step finished!"));
+	return TestStepResult();	
+	}
+
+
+/**
+   @SYMTestCaseID 	APPFWK-APPARC-0033, APPFWK-APPARC-0034
+  
+   @SYMPREQ 		PREQ1228 (CR0831)
+   
+   @SYMREQ			REQ5896
+   
+   @SYMTestPriority High 
+   
+   @SYMTestType		CIT
+  
+   @SYMTestCaseDesc Tests that the application information file (AppsList.bin) is created if it does 
+   					not exists, and we reboot the phone.
+   					Tests that the Short Caption associated with an app is restored to its original 
+   					value when the phone is restarted.
+     
+   @SYMTestStatus 	Implemented
+   
+   @SYMTestActions This tests the update of the applist file in \\private\\10003a3f\\import\\\apps\\.
+   			The sequence is as follows:
+   			(BOOT - 1)
+   				1.- Check the applist file exists. It must exists.
+   				2.- Delete the applist file.
+   			(BOOT - 2)
+   				3.- Check the applist file does not exist.
+   				4.- Check the applist is created after a short period of time.
+   				5.- Set short caption of a test app to a custom value.
+   			(BOOT - 3)
+   				6.- Check short caption of the test app is restored to its original value.
+   
+   @SYMTestExpectedResults	For Boot1 AppList File must exist when the test starts, but not when it finishes.
+   							For Boot2 AppList File must not exist when the test starts, but is created later on.
+   							For Boot3 ShortCaption for tstapp.exe must return to original short caption
+ */
+ 
+ void CT_AppListFileBootStep::DoTestL()
+ 	{
+ 	TInt ret = iUtils.Connect();
+	TEST(ret==KErrNone);
+	
+	TBool present = EFalse;
+	ret = iUtils.IsFilePresent(KAppListFileName, present);
+	TEST(ret == KErrNone);
+	
+	switch(iBootType)
+		{
+		case 1:
+			{
+			INFO_PRINTF1(_L("Starting test case: APPFWK-APPARC-0033"));
+			// Check the file is present, or wait until it is. When/If present, delete it.
+ 			INFO_PRINTF1(_L("The should file exists (as no other test have removed it), so then this test should delete it:"));			
+			present = CheckForFilePresent();			
+			TEST(present);
+			if (present)
+				{
+				DeleteAppListFileL(KAppListFileName);
+				}
+ 			INFO_PRINTF1(_L("APPFWK-APPARC-0033 Test Continues... with Boot2 script"));			
+			}
+			break;
+			
+		case 2:
+			{
+ 			INFO_PRINTF1(_L("APPFWK-APPARC-0033 Test Continues... from Boot1 script"));			
+			// Check the file not present, and then wait until it is.
+ 			INFO_PRINTF1(_L("The file should not exist as it has been deleted by Boot1, otherwise the test fails:"));			
+			TEST(!present);
+			present = CheckForFilePresent();			
+			TEST(present);
+	 		INFO_PRINTF1(_L("APPFWK-APPARC-0033 Test Finished!"));
+
+			INFO_PRINTF1(_L("Starting test case: APPFWK-APPARC-0034"));
+			SetShortCaptionSettings();
+ 			INFO_PRINTF1(_L("APPFWK-APPARC-0034 Test Continues... with Boot3 script"));			
+			}
+			break;
+		
+		case 3:
+			{
+ 			INFO_PRINTF1(_L("APPFWK-APPARC-0034 Test Continues... from Boot2 script"));
+	 		TestShortCaptionSettings();
+	 		INFO_PRINTF1(_L("APPFWK-APPARC-0034 Test Finished!"));
+	 		}
+			break;
+		}
+ 	iUtils.Close();
+ 	}
+
+
+/*
+It will delete the applistfile created by apparc component to test the change in the bootup time.
+*/
+void CT_AppListFileBootStep::DeleteAppListFileL(const TDesC& aFileName)
+	{
+	INFO_PRINTF2(_L("Delete AppList file '%S'..."), &aFileName);
+
+	TInt ret = iUtils.SetReadOnly(aFileName, 0);
+	TEST(ret == KErrNone);
+	
+	ret = iUtils.DeleteFileL(aFileName);
+	TEST(ret == KErrNone);
+	}
+
+
+/*
+Checks whether the "AppList.Bin" exists, if not waits for a maximum time of (KMaxTimeCount * 10) seconds for the file to create. 
+Else the test fails.
+*/
+TBool CT_AppListFileBootStep::CheckForFilePresent()
+	{
+	INFO_PRINTF2(_L("Wait for a maximum time of '%d' secs for the file to be created"), KMaxTimeCount * 10);
+
+	TBool present = EFalse;
+	for (TInt index = 0; present == EFalse && index < KMaxTimeCount; index++)
+		{
+		TEST(iUtils.IsFilePresent(KAppListFileName, present) == KErrNone);
+		if (present)
+			{
+			INFO_PRINTF2(_L("AppList file is successfully created after '%d' seconds!"), index * 10);
+			break;
+			}
+		// wait 10 secs before trying again in the next loop
+		User::After(10 * 1000000);	
+		}
+
+	if (!present)
+		{
+		INFO_PRINTF2(_L("AppList file was NOT created after '%d' seconds"), KMaxTimeCount * 10);
+		}
+
+	return present;
+	}
+
+
+/*
+Testing whether short caption for test app is set as the original short caption
+*/
+void CT_AppListFileBootStep::TestShortCaptionSettings()
+	{
+	INFO_PRINTF1(_L("Testing whether short caption for test app is set as the original short caption"));
+
+	TInt err = iSession.Connect();
+	TEST(err == KErrNone);
+
+	TApaAppInfo info1;
+	err = iSession.GetAppInfo(info1, KUidTestApp);
+	TEST(err == KErrNone);
+	
+	TBuf<10> expected;
+	expected.Format(KOriginalShortCaption);
+	TBuf<10> actual;
+	actual.Format(info1.iShortCaption);
+	INFO_PRINTF3(_L("Short Caption Settings: Expected '%S', Actual '%S'"), &expected, &actual);
+	TEST(info1.iShortCaption==KOriginalShortCaption);
+
+	// close session and finish
+	iSession.Close();
+	}
+	
+
+/*
+Sets the short caption for tstapp.exe to KShortCaption1
+*/
+void CT_AppListFileBootStep::SetShortCaptionSettings()
+	{
+	INFO_PRINTF2(_L("Setting short caption settings to '%S'..."), &KShortCaption1);
+
+	TInt err = iSession.Connect();
+	TEST(err == KErrNone);
+	err = iSession.SetAppShortCaption(KShortCaption1, ELangEnglish, KUidTestApp);
+	TEST(err == KErrNone);
+	
+	// wait 2.5 secs for the caption to be updated
+	User::After(2500000);
+
+	TApaAppInfo info1;
+	err = iSession.GetAppInfo(info1, KUidTestApp);
+	TEST(err == KErrNone);
+	
+	TBuf<10> expected;
+	expected.Format(KShortCaption1);
+	TBuf<10> actual;
+	actual.Format(info1.iShortCaption);
+	INFO_PRINTF3(_L("Short Caption Settings: Expected '%S', Actual '%S'"), &expected, &actual);
+	TEST(info1.iShortCaption==KShortCaption1);
+
+	// close session and finish
+	iSession.Close();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_AppListFileBootStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,54 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code  
+*/
+
+#ifndef __T_APPLISTFILEBOOTSTEP_H
+#define __T_APPLISTFILEBOOTSTEP_H
+
+#include "ApparcTestServer.h"
+#include <appfwk_test_utils.h>
+
+_LIT(KT_AppListFile_Boot1,"T_AppListFile_Boot1");
+_LIT(KT_AppListFile_Boot2,"T_AppListFile_Boot2");
+_LIT(KT_AppListFile_Boot3,"T_AppListFile_Boot3");
+
+class CT_AppListFileBootStep : public CTestStep
+	{
+public:
+	CT_AppListFileBootStep(TInt);
+	~CT_AppListFileBootStep();
+	virtual TVerdict doTestStepL();
+
+private:
+	void DoTestL();
+	TBool CheckForFilePresent();
+	void DeleteAppListFileL(const TDesC&);
+	void SetShortCaptionSettings();
+	void TestShortCaptionSettings();
+
+private:
+	TInt iBootType;
+	RApaLsSession iSession;
+	RSmlTestUtils iUtils;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_AppListFileUpdateStep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,300 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Note: With PREQ1228, we introduced "REQ5896:Load application information from a single file".
+// This PREQ is tested with the following two test steps:
+// T_AppListBootStep (only run for emulator, as it requires epoc restart)
+// |___ (APPFWK-APPARC-0033) Tests that the application information file (AppsList.bin) is created 
+// |		if it does not exists, and we reboot the phone.
+// |___ (APPFWK-APPARC-0034) Tests that the Short Caption associated with an app
+// T_AppListUpdateStep
+// |___ (APPFWK-APPARC-0035) Tests that the application information file (AppsList.bin) is created 
+// |		if it does not exists, and we force a registration.
+// |___ (APPFWK-APPARC-0032) Tests that the application information file (AppsList.bin) is updated 
+// whenever a new application is installed.
+// 
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+
+#include <apgcli.h>
+#include "T_AppListFileUpdateStep.h"
+
+_LIT(KTestAppZPath,"Z:\\ApparcTest\\TestAppInstall_reg.RSC");
+_LIT(KAppListFileName,"C:\\private\\10003a3f\\AppsListCache\\AppsList.bin");
+_LIT(KAppTimeFormat,"%:0%H%:1%T%:2%S%:3");
+_LIT(KAppDirectory,"C:\\Private\\10003a3f\\Import\\apps\\");
+_LIT(KTestAppObsolutePath1,"C:\\Private\\10003a3f\\Import\\apps\\TestAppInstall_reg.RSC");
+
+const TInt KMaxTimeCount = 18;			// 18 * 10 is 180 Seconds
+
+
+CT_AppListFileUpdateStep::CT_AppListFileUpdateStep()
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_AppListFileUpdate);
+	}
+
+
+CT_AppListFileUpdateStep::~CT_AppListFileUpdateStep()
+	{
+	}
+
+TVerdict CT_AppListFileUpdateStep::doTestStepPreambleL()
+	{
+ 	User::LeaveIfError(iSession.Connect());
+ 	User::LeaveIfError(iUtils.Connect());
+ 	User::LeaveIfError(iFs.Connect());
+	
+	SetTestStepResult(EPass);
+	return TestStepResult();
+	}
+
+TVerdict CT_AppListFileUpdateStep::doTestStepPostambleL()
+	{
+	iFs.Close();
+	iUtils.Close();
+	iSession.Close();
+	return TestStepResult();
+	}
+
+
+TVerdict CT_AppListFileUpdateStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("AppListFileUpdateStep test step started..."));
+
+ 	__UHEAP_MARK;
+	INFO_PRINTF1(_L("APPFWK-APPARC-0035 Test Started"));
+	TRAPD(ret, TestDeleteAppListFileL());
+	TEST(ret == KErrNone);
+ 	INFO_PRINTF2(_L("TestDeleteAppListFileL() finished with return code '%d'\n"), ret);
+	INFO_PRINTF1(_L("APPFWK-APPARC-0035 Test Finished\n"));
+  	__UHEAP_MARKEND;
+
+ 	__UHEAP_MARK;
+	INFO_PRINTF1(_L("APPFWK-APPARC-0032 Test Started"));
+	TRAP(ret, TestTimeStampL());
+	TEST(ret == KErrNone);
+ 	INFO_PRINTF2(_L("TestTimeStampL() finished with return code '%d'"), ret);
+	INFO_PRINTF1(_L("APPFWK-APPARC-0032 Test Finished\n"));
+  	__UHEAP_MARKEND;
+
+	INFO_PRINTF1(_L("...AppListFileUpdateStep test step finished!"));
+	return TestStepResult();
+	}
+
+
+/**
+   @SYMTestCaseID 	APPFWK-APPARC-0032
+  
+   @SYMPREQ 		PREQ1228 (CR0831)
+   
+   @SYMREQ			REQ5896
+  
+   @SYMTestCaseDesc Tests that the application information file (AppsList.bin) is updated 
+					whenever a new application is installed.
+
+   @SYMTestType		CIT
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus 	Implemented
+   
+   @SYMTestActions 	This tests the update of the applist file in \\private\\10003a3f\\import\\\apps\\.
+   			The sequence is as follows:
+   			1.- Check the file exists. It must exists.
+   			2.- Record timestamp for applist file.
+   			3.- Install a new test application.
+   			4.- Record timestamp for applist file, allowing some time for the file to be updated
+   			4.- Compare timestamps before and after test app installation.
+	   
+   @SYMTestExpectedResults	Modified time of AppsList.bin after installation must be greater than before installation. 
+ */
+ 
+ void CT_AppListFileUpdateStep::TestTimeStampL()
+ 	{
+	// Create KAppDirectory
+	TInt err = iUtils.CreateDirectoryL(KAppDirectory);
+	TEST(err == KErrNone || err == KErrAlreadyExists);
+	
+	// Wait until KAppListFileName is present and check that the file has been created indeed
+	TBool present = CheckForFilePresent();
+	TEST(present);
+
+	// Record time before app list was modified	
+	INFO_PRINTF1(_L("Record time before app list was modified..."));
+	TTime timeBeforeAppListModification;
+	AppsListModifiedTimeL(timeBeforeAppListModification);
+		
+	// Install an application
+	INFO_PRINTF1(_L("Install application..."));
+	InstallApplicationL(KTestAppObsolutePath1);
+
+	// wait 5 seconds for the app to be properly installed
+	User::After(5 * 1000000);
+	
+	// Wait until KAppListFileName is present and check that the file has been created indeed.
+	present = CheckForFilePresent();
+	TEST(present);
+
+	// Record time after app list was modified	
+	INFO_PRINTF1(_L("Record time after app list was modified..."));
+	TTime timeAfterAppListModification;
+	AppsListModifiedTimeL(timeAfterAppListModification);
+    
+    // Check that the modification time "after" is after the modification time "before"
+    TEST(timeAfterAppListModification > timeBeforeAppListModification);
+
+	// Uninstall & delete...
+	INFO_PRINTF1(_L("Uninstalling application..."));
+	DeleteApplicationL(KTestAppObsolutePath1);
+ 	}
+ 
+ 
+/*
+Delete a registration resource file (TestAppInstall.rsc) in the path  "C:\private\10003a3f\import\apps" .
+*/
+void CT_AppListFileUpdateStep::DeleteApplicationL(const TDesC& aAppName)
+	{
+	INFO_PRINTF2(_L("Deleting file '%S'"), &aAppName);
+
+	TInt ret = iUtils.SetReadOnly(aAppName, 0);
+	TEST(ret == KErrNone);
+	ret = iUtils.DeleteFileL(aAppName);
+	TEST(ret == KErrNone);
+	}
+
+
+/*
+Copy a registration resource file (TestAppInstall.rsc) in the path  "c:\private\10003a3f\import\apps" .
+*/
+void CT_AppListFileUpdateStep::InstallApplicationL(const TDesC& aAppName)
+	{
+	INFO_PRINTF3(_L("Copying file '%S' to folder '%S'"), &aAppName, &KTestAppZPath);
+
+	TInt ret = iUtils.CopyFileL(KTestAppZPath, aAppName);
+	TEST(ret == KErrNone);
+	}
+
+
+/*
+Gets the modified time for AppsList.bin
+*/
+void CT_AppListFileUpdateStep::AppsListModifiedTimeL(TTime& aTime)
+	{
+	INFO_PRINTF2(_L("Retrieving modification time of file '%S'"), &KAppListFileName);
+	TInt ret = iFs.Modified(KAppListFileName, aTime);
+	TEST(ret == KErrNone);
+	
+	TBuf<40> timeString; // Holds the formatted date and time
+    aTime.FormatL(timeString,KAppTimeFormat);
+	INFO_PRINTF2(_L("Recorded modified time is '%S'"), &timeString);
+	}
+
+
+/**
+   @SYMTestCaseID 	APPFWK-APPARC-0035
+  
+   @SYMPREQ 		PREQ1228 (CR0831)
+   
+   @SYMREQ			REQ5896
+  
+   @SYMTestCaseDesc Apparc component repopulates the file list if it has been deleted and a registration is forced.
+
+   @SYMTestType		CIT
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus 	Implemented
+   
+   @SYMTestActions 	This tests the update of the applist file in \\private\\10003a3f\\import\\\apps\\.
+   			The sequence is as follows:
+   			1.- Check the file exists. It must exists.
+   			2.- Delete the file and check it does not exist, and that is not created either.
+   			3.- Force Registration, which means that the applist file needs to be created again.
+   			4.- Check that the above mentioned file exists again after waiting for a short period of time.
+	   
+   @SYMTestExpectedResults	AppsList.bin is deleted and created according to the test actions.
+ */
+ 
+ void CT_AppListFileUpdateStep::TestDeleteAppListFileL()
+ 	{
+	// Check the file IS present
+	TBool present = CheckForFilePresent();			
+	TEST(present);
+
+	// Delete applist file
+	DeleteAppListFileL(KAppListFileName);
+
+	// Check the file is NOT present
+	present = CheckForFilePresent();			
+	TEST(!present);
+	
+	// Do a rescan and check that the file exists again.
+	INFO_PRINTF1(_L("Do a rescan and check that the file exists again...."));
+	RPointerArray<TDesC> dummy;
+	TEST(iSession.ForceRegistration(dummy) == KErrNone);
+	present = CheckForFilePresent();			
+	TEST(present);
+ 	}
+
+
+/*
+Checks whether the "AppList.Bin" exists, if not waits for a maximum time of (KMaxTimeCount * 10) seconds for the file to create. 
+Else the test fails.
+*/
+TBool CT_AppListFileUpdateStep::CheckForFilePresent()
+	{
+	INFO_PRINTF2(_L("Wait for a maximum time of '%d' secs for the file to be created"), KMaxTimeCount * 10);
+
+	TBool present = EFalse;
+	for (TInt index = 0; present == EFalse && index < KMaxTimeCount; index++)
+		{
+		TEST(iUtils.IsFilePresent(KAppListFileName, present) == KErrNone);
+		if (present)
+			{
+			INFO_PRINTF2(_L("AppList file is successfully created after '%d' seconds!"), index * 10);
+			break;
+			}
+		// wait 10 secs before trying again in the next loop
+		User::After(10 * 1000000);	
+		}
+
+	if (!present)
+		{
+		INFO_PRINTF2(_L("AppList file was NOT created after '%d' seconds"), KMaxTimeCount * 10);
+		}
+
+	return present;
+	}
+
+
+/*
+It will delete the applistfile created by apparc component
+*/
+void CT_AppListFileUpdateStep::DeleteAppListFileL(const TDesC& aFileName)
+	{
+	INFO_PRINTF2(_L("Delete AppList file '%S'..."), &aFileName);
+
+	TInt ret = iUtils.SetReadOnly(aFileName, 0);
+	TEST(ret == KErrNone);
+	ret = iUtils.DeleteFileL(aFileName);
+	TEST(ret == KErrNone);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_AppListFileUpdateStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,60 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code  
+*/
+
+#ifndef __T_APPLISTFILEUPDATESTEP_H
+#define __T_APPLISTFILEUPDATESTEP_H
+
+#include "ApparcTestServer.h"
+#include <appfwk_test_utils.h>
+
+
+_LIT(KT_AppListFileUpdate,"T_AppListFileUpdate");
+
+class CT_AppListFileUpdateStep : public CTestStep
+	{
+public:
+	CT_AppListFileUpdateStep();
+	~CT_AppListFileUpdateStep();
+	virtual TVerdict doTestStepL();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+
+private:
+	void TestTimeStampL();
+	void AppsListModifiedTimeL(TTime &);
+	void DeleteApplicationL(const TDesC&);
+	void InstallApplicationL(const TDesC&);
+	
+private:
+	void TestDeleteAppListFileL();
+	void DeleteAppListFileL(const TDesC& aFileName);
+	TBool CheckForFilePresent();
+
+public:
+	RFs	iFs;
+ 	RApaLsSession iSession;
+	RSmlTestUtils iUtils;
+	};
+	
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_ApsScan.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,204 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This test case is used to verify that a recognizer can be installed and used 
+// without reboot. See comment in header file.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include "testableapalssession.h"
+
+#include "T_ApsScan.h"
+#include "appfwk_test_utils.h"
+#include "tmimerec\constants.hrh"
+#include "tmimerec\constants.h"
+
+/////////////////////////////////////////////////
+
+const TInt KDelay = 4000000; // Should be enough for CApaEComMonitor to detect new plugin
+
+/////////////////////////////////////////////////
+
+CT_ApsScanStep::CT_ApsScanStep()
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_ApsScanStep);
+	}
+
+CT_ApsScanStep::~CT_ApsScanStep()
+	{
+	}
+
+/**
+Check that the test plugin file has not been left in the filesystem from a previous aborted test.
+*/
+TVerdict CT_ApsScanStep::doTestStepPreambleL()
+	{
+	RSmlTestUtils fs;
+	CleanupClosePushL(fs);
+	User::LeaveIfError(fs.Connect());
+	
+	INFO_PRINTF1(_L("Verifies that dummy.rsc was not present during boot."));
+	TBool fileExists = ETrue;
+	TInt err = fs.IsFilePresent(KRscTargetPath, fileExists);
+	TESTE(fileExists==EFalse, err);
+	
+	CleanupStack::PopAndDestroy(&fs);
+	return TestStepResult();
+	}
+
+/*
+Delete the plugin file which was installed during the test from c:.
+*/
+TVerdict CT_ApsScanStep::doTestStepPostambleL()
+	{
+	RSmlTestUtils fs;
+	CleanupClosePushL(fs);
+	User::LeaveIfError(fs.Connect());
+
+	TBool fileExists = EFalse;
+	fs.IsFilePresent(KRscTargetPath, fileExists);
+	if(fileExists)
+		{
+		fs.ChangeFilePermissionL(KRscTargetPath); // clear readonly attribute inherited from z:
+		const TInt err = fs.DeleteFileL(KRscTargetPath);
+		if(err == KErrNone) 
+			INFO_PRINTF1(_L("Removed temporary file dummy.rsc"));
+		else 
+			INFO_PRINTF1(_L("Failed to remove temporary file dummy.rsc"));	
+		}
+		
+	CleanupStack::PopAndDestroy(&fs);
+	return TestStepResult();
+	}
+	
+/*
+The test entry point
+*/			
+TVerdict CT_ApsScanStep::doTestStepL()
+	{
+	RTestableApaLsSession apparcServer;
+	CleanupClosePushL(apparcServer);
+	User::LeaveIfError(apparcServer.Connect());
+
+	HEAP_TEST_LS_SESSION(apparcServer, 0, DONT_CHECK, TestDynInstallRecognizerL(apparcServer), NO_CLEANUP);
+
+	CleanupStack::PopAndDestroy(&apparcServer);
+	
+	return TestStepResult();
+	}
+
+/**
+@SYMTestCaseID APPFWK-APPARC-0049
+
+@SYMDEF DEF082982
+
+@SYMTestCaseDesc This test verify that apparc can dynamically install an Ecom recognizer plugin.
+
+@SYMTestPriority High
+
+@SYMTestStatus Implemented
+
+@SYMTestActions To avoid using a precompiled recognizer for this test, following workaround is used:
+	
+	1. The test plugin are copied into z: by the build tools when building apparc tef tests.
+	2. The plugin will not be installed during startup because CreateRecognizerL will leave
+	3. During the test a dummy plugin.rsc will be copied into c:\resource\plugins to trig Ecom
+	4. Apparc will be notified and make sure all recognizers listed by Ecom are properly installed
+	5. Ecom will not be able install the copied dummy file as it has no matching dll on the same drive, but
+	6. The recognizer will detect existence of the dummy file and chose not to leave from CreateRecognizerL
+	
+	Due to platsec we can't build plugin.dll to an alternative location and we can't
+	copy files from epoc32\release\winscw\udeb in runtime. Both plugin.rsc and plugin.dll 
+	must be on the same drive to be accepted by Ecom. 
+
+@SYMTestExpectedResults Test should complete without any leave, panic or error.
+ */
+void CT_ApsScanStep::TestDynInstallRecognizerL(RApaLsSession& aApparcServer)
+	{
+	INFO_PRINTF1(_L("Step 1 of 4: Verifies that recognizer isn't installed."));
+	// TESTL will leave and abort this teststep if DoRecognizeL returns ETrue
+	TESTL(EFalse == DoRecognizeL(aApparcServer, TDataType(KDataTypeNew)));
+	
+	INFO_PRINTF1(_L("Step 2 of 4: Installs recognizer plugin file "));
+	CopyRecognizerFileL();
+	
+	INFO_PRINTF2(_L("Step 3 of 4: Waits %d seconds for new recognizer to be installed."), KDelay/1000000);	
+	User::After(KDelay);
+
+	INFO_PRINTF1(_L("Step 4 of 4: Verifies that the new recognizer was installed successfully"));
+	TEST(DoRecognizeL(aApparcServer, TDataType(KDataTypeNew)));
+	}
+
+/**
+Copies the test file dummy.rsc from z: to c: using RSmlTestUtils rather than aFs due to 
+platsec protection of involved directories.
+*/
+void CT_ApsScanStep::CopyRecognizerFileL()
+	{		
+	RSmlTestUtils fs;
+	CleanupClosePushL(fs);
+	User::LeaveIfError(fs.Connect());
+	
+	// Ensure c:\\resource\\plugins is created, otherwise leave and abort this teststep
+	TInt err = fs.CreateDirectoryL(KRscTargetDir);
+	TESTEL((err==KErrNone || err==KErrAlreadyExists), err);
+	
+	// Copy resource file from z: to c:, if unsuccessful - leave and abort this teststep
+	#if defined (__WINSCW__) 
+		err = fs.CopyFileL(KRscSourcePathWinscw, KRscTargetPath);
+	#else
+		err = fs.CopyFileL(KRscSourcePathArmv5, KRscTargetPath);
+	#endif
+	TESTEL(err==KErrNone, err);
+
+	CleanupStack::PopAndDestroy(&fs);
+
+	}
+
+/**
+Check if a certain datatype is known/recognized by apparc.
+
+@param aApparcServer an open session to apparc
+@param aDataType the datatype you want to test
+@return ETrue if @c aDataType is one of those returned from RApaLsSession::GetSupportedDataTypesL
+*/
+TBool CT_ApsScanStep::DoRecognizeL(RApaLsSession& aApparcServer, const TDataType& aDataType)
+	{
+	TBool recognized = EFalse;
+	
+	CDataTypeArray* dataTypes=new(ELeave) CDataTypeArray(64);
+	CleanupStack::PushL(dataTypes);
+	aApparcServer.GetSupportedDataTypesL(*dataTypes);
+	
+	const TInt count = dataTypes->Count();
+	for(TInt i=0; i<count; i++)
+		{
+		const TDataType& tmp = dataTypes->At(i);
+		if(tmp == aDataType)
+			{
+			recognized = ETrue;
+			break;
+			}
+		}
+		
+	CleanupStack::PopAndDestroy(dataTypes);
+	return recognized;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_ApsScan.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,47 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code	 
+*/
+
+#ifndef		__T_APSSCAN_H
+#define		__T_APSSCAN_H
+
+#include "appfwk_test_AppUi.h"
+
+_LIT(KT_ApsScanStep, "T_ApsScan");
+
+class CT_ApsScanStep : public CTestStep
+	{
+public:
+	CT_ApsScanStep();
+	~CT_ApsScanStep();
+	
+	//from CTestStep
+	TVerdict doTestStepPreambleL();
+	TVerdict doTestStepL();
+	TVerdict doTestStepPostambleL();
+
+private:
+	void TestDynInstallRecognizerL(RApaLsSession& aApparcServer);
+	TBool DoRecognizeL(RApaLsSession& aApparcServer, const TDataType& aDataType);
+	void CopyRecognizerFileL();
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_AutoMMCReaderOpen.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,114 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is a defect fix for the following defect	
+// INC040672 - MMC Card door open causes wrong mime type instead of error code	
+// This test is fully automated and performs the following task
+// Tests to access a file which is on MMC and the MMC card is removed at the time of access.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include "testableapalssession.h"
+#include "T_AutoMMCReaderOpen.h"
+
+const TInt KDirLength = 5; // No need of length more than this , hence length is 5
+
+CTestAutoMMCReaderStep::~CTestAutoMMCReaderStep()
+	{
+	}
+
+CTestAutoMMCReaderStep::CTestAutoMMCReaderStep()
+	{
+	SetTestStepName(KTestAutoMMCReaderOpenStep);
+	}
+
+TVerdict CTestAutoMMCReaderStep::doTestStepPreambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	SetTestStepResult(EPass);
+	return TestStepResult();
+	}
+
+TVerdict CTestAutoMMCReaderStep::doTestStepPostambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	return TestStepResult();
+	}
+
+TVerdict CTestAutoMMCReaderStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Testing Apparch...T_AutoMMCReaderOpen"));
+		
+	OpenMMCCardReaderDrive();
+	INFO_PRINTF1(_L("\nT_AutoMMCReaderOpen Completed."));
+	return TestStepResult();
+	}
+
+void CTestAutoMMCReaderStep::OpenMMCCardReaderDrive()
+	{
+	INFO_PRINTF1(_L("Testing fix for INC040672 - MMC Card door open causes wrong mime type instead of error code"));
+	
+	_LIT(KValidFileName, "ValidFileName.jpg");
+		
+	RFs fs;
+	TInt ret = fs.Connect();
+	TEST(ret == KErrNone);
+	RTestableApaLsSession ls;
+	ret = ls.Connect();
+	TEST(ret == KErrNone);
+		
+//	The following steps are to reproduce the removal of MMC card
+// 	Loop through drive letters Y -> D to access a file on that drive (any filename)
+//	Find a drive letter that returns KErrNotReady , 
+//	setup a valid filename with that drive. 
+
+	for (TInt drive = EDriveY; drive >= EDriveD ; drive--)
+		{
+		TDriveUnit driveUnit(drive);	
+		TDriveName driveName = driveUnit.Name();
+
+		TBuf<KDirLength> bufDirName(driveName);
+		bufDirName.Append(_L("\\"));
+		
+		ret = fs.MkDirAll(bufDirName);
+		if (ret == KErrNotReady)
+			{
+			TFileName bufValidFileName(bufDirName);
+			bufValidFileName.Append(KValidFileName);
+			TDataType dataType;
+			TUid uid = KNullUid;
+			
+			HEAP_TEST_LS_SESSION(ls, 0, 0, ret = ls.AppForDocument(bufValidFileName, uid, dataType), NO_CLEANUP);
+			TEST(ret == KErrNotReady);
+			TEST(uid == KNullUid);
+			TEST(dataType == TDataType());
+			break;
+			}
+		}
+	TEST(ret == KErrNotReady);
+	ls.Close();
+	fs.Close();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_AutoMMCReaderOpen.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,41 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#ifndef		__T_AUTOMMCREADEROPEN_H
+#define		__T_AUTOMMCREADEROPEN_H
+
+#include "appfwk_test_AppUi.h"
+
+_LIT(KTestAutoMMCReaderOpenStep, "T_AutoMMCReaderOpen");
+
+class CTestAutoMMCReaderStep : public CTestStep
+	{
+public:
+	CTestAutoMMCReaderStep();
+	~CTestAutoMMCReaderStep();
+	virtual TVerdict doTestStepL();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	void OpenMMCCardReaderDrive();
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_BackupStep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,919 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Performs Tests on Backup server.\n
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <s32file.h>
+#include <e32base.h>
+#include <f32file.h>
+#include <e32test.h>
+#include <babackup.h>
+#include <e32std.h>
+#include <e32math.h>
+#include "T_BackupStep.h"
+
+
+
+CTestActive::CTestActive()
+: CActive(EPriorityIdle*2)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+CTestActive::~CTestActive()
+	{
+	Cancel();
+	}
+
+void CTestActive::DoCancel()
+	{
+	TRequestStatus* s=&iStatus;
+	User::RequestComplete(s, KErrNone);
+	}
+
+void CTestActive::StartL()
+	{
+	iReport = NULL;
+	SetActive();
+	}
+
+
+/**
+  Auxiliary Fn for Test Case ID T-BackupStep-testGetsCallbackOnBackupStartL,
+  T-BackupStep-testGetsCallbackOnBackupEndL,
+  T-BackupStep-testGetsCallbackOnBackupStartInSecondWrapperL,
+  T-BackupStep-testGetsCallbackOnBackupWrapperKillL, and
+  T-BackupStep-testGetsCallbackOnBackupWrapperKillOtherL
+
+  This function is used to set the event request to the AO and
+  to set that AO active.\n
+
+*/
+void CTestActive::StartL(TRequestStatus& aRequestStatus)
+	{
+	iReport = &aRequestStatus;
+	SetActive();
+	}
+
+void CTestActive::RunL() 
+	{
+	CActiveScheduler::Stop();
+	}
+
+// Class to test the n-th recieved event from the backup server is the same as the event
+// the object is initialised with
+CTestBackupOperationObserver::CTestBackupOperationObserver(const TBackupOperationAttributes& aEvent, CTestExecuteLogger& aLogger) : CTestActive(), iEvent(aEvent), iCount(1)
+	{
+	iLogger=aLogger;
+	}
+CTestBackupOperationObserver::CTestBackupOperationObserver(const TBackupOperationAttributes& aEvent, TInt aCount, CTestExecuteLogger& aLogger) : CTestActive(), iEvent(aEvent), iCount(aCount)
+	{
+	iLogger=aLogger;
+	}
+
+
+/**
+  Auxiliary Fn for Test Case ID T-BackupStep-testGetsCallbackOnBackupStartL,
+  T-BackupStep-testGetsCallbackOnBackupEndL,
+  T-BackupStep-testGetsCallbackOnBackupStartInSecondWrapperL,
+  T-BackupStep-testGetsCallbackOnBackupWrapperKillL, and
+  T-BackupStep-testGetsCallbackOnBackupWrapperKillOtherL
+ 
+  This function is overridden from MBackupOperationObserver and is called
+  when a backup or restore operation either starts or ends. The function is used
+  to receive signals that tell what backup operation completed.\n
+ 
+*/
+void CTestBackupOperationObserver::HandleBackupOperationEventL(const TBackupOperationAttributes& aBackupOperationAttributes)
+	{
+	const TInt KOneOfOurEvents = 12321;
+	if(iCount!=KOneOfOurEvents)
+		{
+		INFO_PRINTF2(_L("Got event #%d from backup server; ignoring this one\n"), iCount+1);
+		}
+	else
+		{
+		iCount=0;
+		if(iReport)
+			{
+			User::RequestComplete(iReport, aBackupOperationAttributes.iOperation);
+			INFO_PRINTF1(_L("Got event from backup server; Completing...\n"));
+			}
+		else
+			{
+			INFO_PRINTF1(_L("Got event from backup server; iReport not set...testing...\n"));
+			}
+		}
+	}
+
+void CTestBackupOperationObserver::SetReadyToGo()
+{
+	const TInt KOneOfOurEvents = 12321;
+	iCount=KOneOfOurEvents;
+}
+
+
+/**
+  Auxiliary Fn for all test cases
+ 
+  This function creates an Active Object (AO).Sets the AO to
+  be active. Starts the active scheduler to complete any pending requests
+  and flushes all requests from the scheduler list.\n
+
+*/
+void CT_BackupStep::FlushSchedulerQueueL()
+{
+	CTestActive* active = new(ELeave) CTestActive();
+	CleanupStack::PushL(active);
+	RTimer timer;
+	timer.CreateLocal();
+	timer.After(active->iStatus,500000);
+	active->StartL();
+	CActiveScheduler::Start();
+	CleanupStack::PopAndDestroy(1);//active
+}
+
+
+/**
+   @SYMTestCaseID T-BackupStep-testGetsCallbackOnBackupStartL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test whether backup server signals the test backup observer
+                 on backup start operation.
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions The test creates an object of test observer to observe for
+   start backup event and registers the specified observer to be notified
+   when a backup operation starts by calling RegisterBackupOperationObserverL().
+   Set attributes to indicate start of backup operation. Flush the scheduler
+   of all pending requests. Set start backup event to the AO. Notify the
+   server of backup operation using NotifyBackupOperationL().
+   Start the active scheduler to receive signal for start event from backup
+   server.\n
+   API Calls:\n	
+   CBaBackupSessionWrapper::RegisterBackupOperationObserverL(MBackupOperationObserver& aBackupOperationObserver)\n
+   CBaBackupSessionWrapper::NotifyBackupOperationL(const TBackupOperationAttributes& aBackupOperationAttributes)\n
+   CBaBackupSessionWrapper::DeRegisterBackupOperationObserver(MBackupOperationObserver& aBackupOperationObserver)\n
+   
+   @SYMTestExpectedResults The test should complete with Backup server signaling the observer
+   when the Backup operation starts.\n
+    
+ */
+void CT_BackupStep::testGetsCallbackOnBackupStartL()
+	{	
+	const TBackupOperationAttributes gEventStart(MBackupObserver::EReleaseLockNoAccess, MBackupOperationObserver::EStart);
+	CTestBackupOperationObserver* backupObserver = new(ELeave) CTestBackupOperationObserver(gEventStart, Logger());
+	CleanupStack::PushL(backupObserver);
+	gWrapper->RegisterBackupOperationObserverL(*backupObserver);		
+	FlushSchedulerQueueL();
+	
+	backupObserver->StartL(backupObserver->iStatus);
+	gWrapper->NotifyBackupOperationL(gEventStart); 
+	backupObserver->SetReadyToGo();
+	CActiveScheduler::Start();
+	TEST(backupObserver->iStatus == gEventStart.iOperation);
+	
+	gWrapper->DeRegisterBackupOperationObserver(*backupObserver);
+	CleanupStack::PopAndDestroy();//backupObserver;	
+	}
+
+
+/**
+   @SYMTestCaseID T-BackupStep-testGetsCallbackOnBackupEndL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test whether backup server signals the test backupobserver on
+                 backup end operation. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions The test creates an object of test observer to observe for end
+   of backup event and registers the specified observer to be notified when a
+   backup operation ends by calling RegisterBackupOperationObserverL().Set
+   attributes to indicate start and end of backup operation. Flush the scheduler
+   from all pending requests. Set start backup event to the AO. Notify the
+   server of a start backup operation using NotifyBackupOperationL().
+   Start the active scheduler to receive signal for start event from backup
+   server. Now set end of backup event to the AO. Notify server of an end
+   backup operation using NotifyBackupOperationL(). Start the active
+   scheduler to receive signal for end of backup event from backup server.\n
+   API Calls:\n	
+   CBaBackupSessionWrapper::RegisterBackupOperationObserverL(MBackupOperationObserver& aBackupOperationObserver)\n
+   CBaBackupSessionWrapper::NotifyBackupOperationL(const TBackupOperationAttributes& aBackupOperationAttributes)\n
+   CBaBackupSessionWrapper::DeRegisterBackupOperationObserver(MBackupOperationObserver& aBackupOperationObserver)\n
+   
+   @SYMTestExpectedResults The test should complete with Backup server signaling the observer
+   when the Backup operation ends.
+    
+ */
+void CT_BackupStep::testGetsCallbackOnBackupEndL()
+	{
+	const TBackupOperationAttributes gEventStart(MBackupObserver::EReleaseLockNoAccess, MBackupOperationObserver::EStart);
+	const TBackupOperationAttributes gEventEnd(MBackupObserver::ETakeLock, MBackupOperationObserver::EEnd);
+	CTestBackupOperationObserver* backupObserver = new(ELeave) CTestBackupOperationObserver(gEventEnd, Logger());
+	CleanupStack::PushL(backupObserver);
+	gWrapper->RegisterBackupOperationObserverL(*backupObserver);
+	FlushSchedulerQueueL();
+
+	backupObserver->StartL(backupObserver->iStatus);
+	gWrapper->NotifyBackupOperationL(gEventStart);
+	backupObserver->SetReadyToGo();
+	CActiveScheduler::Start();
+	TEST(backupObserver->iStatus == gEventStart.iOperation);
+
+	backupObserver->StartL(backupObserver->iStatus);
+	gWrapper->NotifyBackupOperationL(gEventEnd);
+	backupObserver->SetReadyToGo();
+	CActiveScheduler::Start();
+	TEST(backupObserver->iStatus == gEventEnd.iOperation);
+
+	gWrapper->DeRegisterBackupOperationObserver(*backupObserver);
+	CleanupStack::PopAndDestroy();//backupObserver;	
+	}
+
+
+/**
+   @SYMTestCaseID T-BackupStep-testGetsCallbackOnBackupStartInSecondWrapperL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test whether signal for start backup operation can be
+                 received by a second observer that is not associated
+                 with the wrapper object that issued the request for start
+                 of backup.
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions The test creates two test observers and two wrappers to the
+   backup server. Set attributes to indicate start of backup operation.
+   Register & associate each observer with each session wrappers that needs
+   to be notified of backup start operation, issued by the respective wrappers
+   by calling RegisterBackupOperationObserverL(). Using the first wrapper,
+   notify the server to start backup. Verify that second observer receives
+   the notification for start of server.\n
+   API Calls:\n	
+   CBaBackupSessionWrapper::NewL()\n
+   CBaBackupSessionWrapper::RegisterBackupOperationObserverL(MBackupOperationObserver& aBackupOperationObserver)\n
+   CBaBackupSessionWrapper::NotifyBackupOperationL(const TBackupOperationAttributes& aBackupOperationAttributes)\n
+   CBaBackupSessionWrapper::DeRegisterBackupOperationObserver(MBackupOperationObserver& aBackupOperationObserver)\n
+   
+   @SYMTestExpectedResults The test should confirm that second observer receives
+   the signal for backup start operation issued by the first wrapper object.
+    
+ */
+void CT_BackupStep::testGetsCallbackOnBackupStartInSecondWrapperL()
+	{
+	const TBackupOperationAttributes gEventStart(MBackupObserver::EReleaseLockNoAccess, MBackupOperationObserver::EStart);
+	CTestBackupOperationObserver* backupObserver = new(ELeave) CTestBackupOperationObserver(gEventStart, Logger());
+	CleanupStack::PushL(backupObserver);
+	gWrapper->RegisterBackupOperationObserverL(*backupObserver);
+	FlushSchedulerQueueL();
+
+	CBaBackupSessionWrapper* secondWrapper=CBaBackupSessionWrapper::NewL();
+	CleanupStack::PushL(secondWrapper);
+
+	CTestBackupOperationObserver* backupObserver2 = new(ELeave) CTestBackupOperationObserver(gEventStart, Logger());
+	CleanupStack::PushL(backupObserver2);
+	secondWrapper->RegisterBackupOperationObserverL(*backupObserver2);
+	FlushSchedulerQueueL();
+	
+	backupObserver2->StartL(backupObserver2->iStatus);
+	gWrapper->NotifyBackupOperationL(gEventStart);
+	backupObserver2->SetReadyToGo();
+	CActiveScheduler::Start();
+	TEST(backupObserver2->iStatus == gEventStart.iOperation);
+	
+	gWrapper->DeRegisterBackupOperationObserver(*backupObserver);
+	secondWrapper->DeRegisterBackupOperationObserver(*backupObserver2);
+	CleanupStack::PopAndDestroy(3);//backupObserver, backupObserver2, secondWrapper	
+	}
+	
+
+/**
+   @SYMTestCaseID T-BackupStep-testGetsCallbackOnBackupWrapperKillL
+  
+   @SYMPREQ
+  
+	@SYMTestCaseDesc Test if MBackupOperationObserver::EAbort event is received
+                 when wrapper to the backup server is destroyed immediately
+                 after backup start operation is requested. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Create a test backup observer. Register the observer to receive
+   event from server. Create a second wrapper to the backup server. Use the
+   second wrapper to notify the server to start backup. After receiving signal
+   for start of backup, destroy the second wrapper. Observe event received
+   from the server.\n
+   API Calls:\n	
+   CBaBackupSessionWrapper::NewL()\n
+   CBaBackupSessionWrapper::RegisterBackupOperationObserverL(MBackupOperationObserver& aBackupOperationObserver)\n
+   CBaBackupSessionWrapper::NotifyBackupOperationL(const TBackupOperationAttributes& aBackupOperationAttributes)\n
+   CBaBackupSessionWrapper::DeRegisterBackupOperationObserver(MBackupOperationObserver& aBackupOperationObserver)\n
+   
+   @SYMTestExpectedResults Test confirms that event MBackupOperationObserver::EAbort
+   is received.
+    
+ */	
+void CT_BackupStep::testGetsCallbackOnBackupWrapperKillL()
+	{
+	const TBackupOperationAttributes gEventStart(MBackupObserver::EReleaseLockNoAccess, MBackupOperationObserver::EStart);
+	const TBackupOperationAttributes gEventEnd(MBackupObserver::ETakeLock, MBackupOperationObserver::EEnd);
+	const TBackupOperationAttributes gEventAbort(MBackupObserver::ETakeLock, MBackupOperationObserver::EAbort);
+	CTestBackupOperationObserver* backupObserver = new(ELeave) CTestBackupOperationObserver(gEventEnd, Logger());
+	CleanupStack::PushL(backupObserver);
+	gWrapper->RegisterBackupOperationObserverL(*backupObserver);
+	FlushSchedulerQueueL();
+
+	CBaBackupSessionWrapper* secondWrapper=CBaBackupSessionWrapper::NewL();
+	CleanupStack::PushL(secondWrapper);
+	
+	backupObserver->StartL(backupObserver->iStatus);
+	secondWrapper->NotifyBackupOperationL(gEventStart);
+	backupObserver->SetReadyToGo();
+	CActiveScheduler::Start();
+	TEST(backupObserver->iStatus == gEventStart.iOperation);
+
+	backupObserver->StartL(backupObserver->iStatus);
+	CleanupStack::PopAndDestroy();//secondWrapper	
+	backupObserver->SetReadyToGo();
+	CActiveScheduler::Start();
+	TEST(backupObserver->iStatus == gEventAbort.iOperation);
+	
+	gWrapper->DeRegisterBackupOperationObserver(*backupObserver);
+	CleanupStack::PopAndDestroy(1);//backupObserver
+	}
+	
+
+/**
+   @SYMTestCaseID T-BackupStep-testGetsCallbackOnBackupWrapperKillOtherL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test that the backup is not terminated after a backup start event,
+   which is followed by destruction of any wrapper other than the wrapper
+   which requested the backup start event.
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Create a test observer. Register the observer with the server.
+   Create second and third wrappers to the backup server besides the global
+   wrapper. Use the second observer to start backup. Observe that the event for
+   start of backup is received. Destroy the third wrapper created. Observe
+   event received from the server. Notify the server to observe for event
+   MBackupOperationObserver::ENone.Observe the event received. Notify the server
+   to stop backup. Observe the event received. Destroy the second observer.
+   Note that this destruction causes an abort event.\n
+   API Calls:\n	
+   CBaBackupSessionWrapper::NewL()\n
+   CBaBackupSessionWrapper::RegisterBackupOperationObserverL(MBackupOperationObserver& aBackupOperationObserver)\n
+   CBaBackupSessionWrapper::NotifyBackupOperationL(const TBackupOperationAttributes& aBackupOperationAttributes)\n
+   CBaBackupSessionWrapper::DeRegisterBackupOperationObserver(MBackupOperationObserver& aBackupOperationObserver)\n
+   
+   @SYMTestExpectedResults Test confirms that backup will not be terminated by
+   destruction of wrapper object that did not initiate the back up process,
+   after the backup operation has started.
+   
+ */
+void CT_BackupStep::testGetsCallbackOnBackupWrapperKillOtherL()
+	{
+	const TBackupOperationAttributes gEventStart(MBackupObserver::EReleaseLockNoAccess, MBackupOperationObserver::EStart);
+	const TBackupOperationAttributes gEventEnd(MBackupObserver::ETakeLock, MBackupOperationObserver::EEnd);
+	const TBackupOperationAttributes gEventNone(MBackupObserver::ETakeLock, MBackupOperationObserver::ENone);
+	
+	CTestBackupOperationObserver* backupObserver = new(ELeave) CTestBackupOperationObserver(gEventEnd, Logger());
+	CleanupStack::PushL(backupObserver);
+	gWrapper->RegisterBackupOperationObserverL(*backupObserver);
+	FlushSchedulerQueueL();
+
+	CBaBackupSessionWrapper* secondWrapper=CBaBackupSessionWrapper::NewL();
+	CleanupStack::PushL(secondWrapper); // This one starts the backup
+
+	CBaBackupSessionWrapper* thirdWrapper=CBaBackupSessionWrapper::NewL();
+	CleanupStack::PushL(thirdWrapper); // This one gets destroyed
+	FlushSchedulerQueueL();
+	
+	backupObserver->StartL(backupObserver->iStatus);
+	secondWrapper->NotifyBackupOperationL(gEventStart);;
+	backupObserver->SetReadyToGo();
+	CActiveScheduler::Start();
+	TEST(backupObserver->iStatus == gEventStart.iOperation);
+
+	backupObserver->StartL(backupObserver->iStatus);
+	CleanupStack::PopAndDestroy(thirdWrapper);//thirdWrapper 
+	TEST(backupObserver->iStatus == gEventStart.iOperation); //
+	secondWrapper->NotifyBackupOperationL(gEventNone);
+	backupObserver->SetReadyToGo();
+	CActiveScheduler::Start();
+	TEST(backupObserver->iStatus == gEventNone.iOperation);
+
+	backupObserver->StartL(backupObserver->iStatus);	
+	secondWrapper->NotifyBackupOperationL(gEventEnd);
+	backupObserver->SetReadyToGo();
+	CActiveScheduler::Start();
+	TEST(backupObserver->iStatus == gEventEnd.iOperation);
+
+	backupObserver->StartL(backupObserver->iStatus);
+	CleanupStack::PopAndDestroy(secondWrapper);//secondWrapper 
+	TEST(backupObserver->iStatus == gEventEnd.iOperation); 
+	CleanupStack::PopAndDestroy();//backupObserver
+	gWrapper->DeRegisterBackupOperationObserver(*backupObserver);
+	}
+
+
+CThreadLaunchCounter::CThreadLaunchCounter() : CActive(0)
+	{
+	CActiveScheduler::Add(this);
+	gCount = 0;
+	}
+
+CThreadLaunchCounter::~CThreadLaunchCounter()
+	{
+	if(IsActive())
+		Cancel();
+	}
+
+void CThreadLaunchCounter::Start()
+	{
+	iStatus=KRequestPending;
+	gCount++;
+	SetActive();
+	}
+
+void CThreadLaunchCounter::RunL()
+	{
+	if(--gCount==0)
+		CActiveScheduler::Stop();	
+	delete this;
+	}
+
+
+/**
+   @SYMTestCaseID T-BackupStep-testMultipleClientsL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test multiple clients accessing the Backup server. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions The test creates multiple threads to make multiple clients
+   access the backup server simultaneously. Each of the threads execute the
+   thread function BackupMultipleTestThreadEntry() to create a wrapper object
+   to the backup server so that a backup operation can be carried out.
+   The test thus emulates a multiple client scenario.\n
+   API Calls:\n	
+   RThread::Create(const TDesC& aName, TThreadFunction aFunction, TInt aStackSize, RAllocator* aHeap, TAny* aPtr, TOwnerType aType=EOwnerProcess)\n
+   RThread::Resume() const\n
+   RThread::Logon(TRequestStatus& aStatus) const\n
+   RThread::Close()\n
+   
+   @SYMTestExpectedResults The test completes creating multiple threads and tests
+   multi-client interaction with the backup server.
+    
+ */
+void CT_BackupStep::testMultipleClientsL()
+	{
+	const TInt KNumMultipleThreads=1;
+	_LIT(KMultiThreadBaseName,"Multithread");
+	const TInt KBackupServerStackSize	=0x3000; // 16k
+	CBackupTestThreadParams Params;
+	Params.Step = this;
+	for(TInt i=0;i<KNumMultipleThreads;i++)
+		{
+		CThreadLaunchCounter* threadCounter = new(ELeave) CThreadLaunchCounter;
+		CleanupStack::PushL(threadCounter);
+		RThread thread;
+		TBuf<0x100> name(KMultiThreadBaseName);
+		name.AppendNum(i);
+		TInt64 theSeed = 12312312;
+		Params.seed=Math::Rand(theSeed);
+		User::LeaveIfError(thread.Create(name, BackupMultipleTestThreadEntry, KBackupServerStackSize, NULL, &Params));
+		thread.Resume();
+		thread.Logon(threadCounter->iStatus);
+		threadCounter->Start();
+		thread.Close();
+		}
+	User::After(2000000);
+	CActiveScheduler::Start();//runs until all the CThreadLaunchCounter are completed
+	User::After(2000000);
+	CleanupStack::Pop(KNumMultipleThreads);
+	}
+
+
+
+TRequestStatus CT_BackupStep::testExtraRestartLockedOutL()
+//
+// Tests that we are only able to restart the apps once - no extra threads around!
+//
+	{
+//vm
+	const TBackupOperationAttributes gEventStart(MBackupObserver::EReleaseLockNoAccess, MBackupOperationObserver::EStart);
+	gWrapper->NotifyBackupOperationL(gEventStart); 
+//vm	
+	_LIT(KAppRestarterThreadName,"AppRestarterThread");
+	TRequestStatus status;
+	gWrapper->CloseAll(MBackupObserver::EReleaseLockNoAccess, status);
+	User::WaitForRequest(status);
+///vm
+	if(status != KErrNone)
+		{
+		return status;
+		}
+
+	const TBackupOperationAttributes gEventEnd(MBackupObserver::ETakeLock, MBackupOperationObserver::EEnd);
+	gWrapper->NotifyBackupOperationL(gEventEnd); 
+////
+
+	gWrapper->RestartAll();
+	gWrapper->RestartAll();
+	gWrapper->RestartAll();
+	gWrapper->RestartAll();
+
+	TInt err;
+	err=KErrNone;
+	TFullName name;
+	TFindThread find(KAppRestarterThreadName);
+	err=find.Next(name);
+	if(err==KErrNotFound)
+		{
+		INFO_PRINTF1(_L("Error in test code timing - need to try again\n"));
+		
+		return status;
+		}
+	gWrapper->RestartAll();
+	gWrapper->RestartAll();
+
+	RThread thread;
+	err=thread.Open(name);
+	TInt ignoreId = thread.Id();
+	if(err==KErrNotFound)
+		{
+		INFO_PRINTF1(_L("Error in test code timing - need to try again\n"));
+		return status;
+		}
+	thread.Logon(status);
+	User::WaitForRequest(status);
+	thread.Close();
+
+	TFindThread find1(KAppRestarterThreadName);
+	while( (err=find1.Next(name)) != KErrNotFound)
+		{
+		RThread thread;
+		if(thread.Open(name)==KErrNone)
+			{
+			TInt id=thread.Id();
+			TEST(id == ignoreId);
+			thread.Close();
+			}
+		}
+	return status;
+	}
+
+
+/**
+   @SYMTestCaseID T-BackupStep-testRestartAppsL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test whether CBaBackupSessionWrapper::RestartAll() unlocks
+                 file locks (MBackupObserver::ETakeLock flag) for the
+                 registered files locked by CloseAll(). 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions  Call TFindThread::Next() continuously to find all threads and
+   append id of each of these threads to a list.
+   Call CBaBackupSessionWrapper::CloseAll() to close all non-system
+   applications and call all observers to release or stop writing to the
+   registered files. Call CBaBackupSessionWrapper::RestartAll().
+   Call TFindThread::Next() continuously to find all threads. Compare the id
+   of each thread to the id stored in the list to find a match.\n
+   API Calls:\n	
+   CBaBackupSessionWrapper::RestartAll()\n
+   CBaBackupSessionWrapper::CloseAll(MBackupObserver::TFileLockFlags aFlags, TRequestStatus& aStatus)\n
+   
+   @SYMTestExpectedResults Test that CBaBackupSessionWrapper::RestartAll() take
+   back file locks (MBackupObserver::ETakeLock flag) for the registered files
+   locked by CloseAll().
+    
+ */
+void CT_BackupStep::testRestartAppsL()
+	{
+//vm	
+	const TBackupOperationAttributes gEventStart(MBackupObserver::EReleaseLockNoAccess, MBackupOperationObserver::EStart);
+	gWrapper->NotifyBackupOperationL(gEventStart); 
+//vm	
+
+	TFindThread find;
+	INFO_PRINTF1(_L("\nRestartApps......."));
+	TFullName name;
+	RArray<TInt> idArray;
+	CleanupClosePushL(idArray);
+	while(find.Next(name)!=KErrNotFound)
+		{	
+		INFO_PRINTF1(_L("\nAppending thread id......."));
+		RThread thread;
+		thread.Open(name);
+		TInt id=thread.Id();
+		idArray.Append(id);
+		thread.Close();
+		INFO_PRINTF1(_L("\nCompleted."));
+		}
+	
+	INFO_PRINTF1(_L("\nGWrapper: Close all......."));
+	TRequestStatus status;
+	gWrapper->CloseAll(MBackupObserver::EReleaseLockNoAccess, status);
+	
+	User::WaitForRequest(status);
+
+	INFO_PRINTF1(_L("\nWait."));
+	User::After(1000000);
+	
+///vm
+	const TBackupOperationAttributes gEventEnd(MBackupObserver::ETakeLock, MBackupOperationObserver::EEnd);
+	gWrapper->NotifyBackupOperationL(gEventEnd); 
+	
+////
+
+	INFO_PRINTF1(_L("\nGWrapper: Restart all......."));
+	gWrapper->RestartAll();
+	INFO_PRINTF1(_L("\nGWrapper: Restart all.....Completed"));
+	INFO_PRINTF1(_L("\nGWrapper: Close all.......Completed."));
+
+	TFindThread find2;
+
+	while(find2.Next(name)!=KErrNotFound)
+		{
+// Create a thread in the calling process
+		INFO_PRINTF1(_L("\nGet Thread ID......."));
+		RThread thread;
+		thread.Open(name);
+		TInt id=thread.Id();
+		thread.Close();
+		INFO_PRINTF1(_L("\nGet Thread ID......Completed."));
+
+		INFO_PRINTF1(_L("\nFind process ID in idArray"));
+		if(idArray.Find(id)==KErrNone)
+			{
+			TInt temp =0;
+			TEST(temp==0); // no instance of this thread is found
+			}
+		INFO_PRINTF1(_L("\nFind process ID in idArray.....Completed."));
+		}
+	CleanupStack::PopAndDestroy(&idArray); //idArray
+	
+	
+	INFO_PRINTF1(_L("\nRestartApps completed."));
+	}
+
+
+
+/**
+  Auxiliary Fn for all Test Cases.
+ 
+  The method initiates all the tests to be performed.
+ 
+*/
+void CT_BackupStep::doTestsL()
+	{
+	const TBackupOperationAttributes gEventEnd(MBackupObserver::ETakeLock, MBackupOperationObserver::EEnd);
+	TRAPD(err,gWrapper=CBaBackupSessionWrapper::NewL());
+	if(err!=KErrNone)
+		{
+		INFO_PRINTF1(_L("Couldn't open session wrapper\n"));
+		User::Leave(err);
+		}
+	INFO_PRINTF1(_L("Backup session test 1\n"));
+	TRAP(err,gWrapper->NotifyBackupOperationL(gEventEnd)); 
+	if(err!=KErrNone)
+		{
+		INFO_PRINTF1(_L("Couldn't notify backup operation\n"));
+		User::Leave(err);
+		}
+
+	FlushSchedulerQueueL();
+	testGetsCallbackOnBackupStartL();	
+
+	gWrapper->NotifyBackupOperationL(gEventEnd); 
+	FlushSchedulerQueueL();
+	INFO_PRINTF1(_L("Backup session test 2\n"));
+	testGetsCallbackOnBackupEndL();
+
+	gWrapper->NotifyBackupOperationL(gEventEnd); 
+	FlushSchedulerQueueL();
+	INFO_PRINTF1(_L("Backup session test 3\n"));
+	testGetsCallbackOnBackupStartInSecondWrapperL();	
+	
+	gWrapper->NotifyBackupOperationL(gEventEnd); 
+	FlushSchedulerQueueL();
+	INFO_PRINTF1(_L("Backup session test 4\n"));
+	testGetsCallbackOnBackupWrapperKillL();	
+
+	gWrapper->NotifyBackupOperationL(gEventEnd); 
+	FlushSchedulerQueueL();
+	INFO_PRINTF1(_L("Backup session test 5\n"));
+	testGetsCallbackOnBackupWrapperKillOtherL();
+
+	gWrapper->NotifyBackupOperationL(gEventEnd); 
+	FlushSchedulerQueueL();
+	INFO_PRINTF1(_L("Backup session test 6\n"));
+	/*TRequestStatus status = testExtraRestartLockedOutL();
+	
+	if(status=KErrNone)
+		{
+		gWrapper->NotifyBackupOperationL(gEventEnd); 
+		FlushSchedulerQueueL();
+		INFO_PRINTF1(_L("Backup session test 7\n"));
+		testRestartAppsL();
+
+		gWrapper->NotifyBackupOperationL(gEventEnd); 
+		INFO_PRINTF1(_L("Backup session test 8\n"));
+		testMultipleClientsL();
+		}*/
+	delete gWrapper;
+	
+	}
+
+
+/**
+  Auxiliary Fn for Test Case ID T-BackupStep-testMultipleClientsL
+ 
+  Entry point for the thread used to test multiple simultaneous wrapper
+  sessions with the backup server. This method calls
+  DoBackupMultipleTestThreadEntryL() method to perform this task.\n
+ 
+*/
+GLDEF_C TInt CT_BackupStep::BackupMultipleTestThreadEntry(TAny* aPtr)
+	{
+	CActiveScheduler* scheduler=new CActiveScheduler;
+	if (!scheduler)
+		return KErrNoMemory;
+	CTrapCleanup* trapCleanup=CTrapCleanup::New();
+	if (!trapCleanup)
+		{
+		delete scheduler;
+		return KErrNoMemory;
+		}
+	CActiveScheduler::Install(scheduler);
+	
+	CBackupTestThreadParams& threadParams = *(CBackupTestThreadParams*)aPtr;
+	TRAPD(err,threadParams.Step->DoBackupMultipleTestThreadEntryL(/*aPtr*/));
+
+	delete CActiveScheduler::Current();
+	delete trapCleanup;
+	return err;
+	}
+
+
+/**
+  Auxiliary Fn for Test Case ID T-BackupStep-testMultipleClientsL
+ 
+  The method is called by the thread function BackupMultipleTestThreadEntry()
+  to create a wrapper session to perform some backup operation.\n
+ 
+*/
+TInt CT_BackupStep::DoBackupMultipleTestThreadEntryL(/*TAny* aSeed*/)
+	{
+	const TBackupOperationAttributes gEventEnd(MBackupObserver::ETakeLock, MBackupOperationObserver::EEnd);
+	CBaBackupSessionWrapper* wrapper=CBaBackupSessionWrapper::NewL();
+	CleanupStack::PushL(wrapper);
+
+	CTestBackupOperationObserver* backupObserver = new(ELeave) CTestBackupOperationObserver(gEventEnd, Logger());
+	CleanupStack::PushL(backupObserver);
+	wrapper->RegisterBackupOperationObserverL(*backupObserver);
+	FlushSchedulerQueueL();
+	wrapper->NotifyBackupOperationL(gEventEnd);
+
+	wrapper->DeRegisterBackupOperationObserver(*backupObserver);
+	CleanupStack::PopAndDestroy(2);//backupObserver, wrapper
+	return KErrNone;
+	}
+
+
+/**
+  Auxiliary Fn for entire Test Step
+ 
+  This method creates and installs an active scheduler for tests.
+ 
+*/
+void CT_BackupStep::SetupSchedulerL()
+	{
+	testScheduler = new (ELeave) CActiveScheduler;
+	CleanupStack::PushL( testScheduler );
+	CActiveScheduler::Install( testScheduler );
+	}
+
+/**
+  Auxiliary Fn for entire Test Step
+ 
+  This method removes the active scheduler from the cleanup stack and
+  destroys it on completion of the tests.
+ 
+*/
+void CT_BackupStep::CloseScheduler()
+	{
+	CleanupStack::PopAndDestroy(); // Scheduler
+	testScheduler = NULL;
+	}
+
+//**********************************
+// Global
+//**********************************
+
+
+void CT_BackupStep::doMainL()
+	{
+	SetupSchedulerL();		
+	doTestsL();
+	CloseScheduler();		
+	}
+
+
+CT_BackupStep::~CT_BackupStep()
+/**
+   Destructor
+ */
+	{
+	}
+
+CT_BackupStep::CT_BackupStep()
+/**
+   Constructor
+ */
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_BackupStep);
+	}
+
+TVerdict CT_BackupStep::doTestStepPreambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	return TestStepResult();
+	}
+
+TVerdict CT_BackupStep::doTestStepPostambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	return TestStepResult();
+	}
+
+
+TVerdict CT_BackupStep::doTestStepL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+{
+	INFO_PRINTF1(_L("Testing Apparc...T_Backup"));
+	//
+	__UHEAP_MARK;
+	TRAPD(ret,doMainL());
+	TEST(ret==KErrNone);
+	__UHEAP_MARKEND;
+
+	INFO_PRINTF1(_L("Test completed!"));
+	return TestStepResult();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_BackupStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,123 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code  
+*/
+
+#if (!defined __T_BACKUP_STEP_H__)
+#define __T_BACKUP_STEP_H__
+#include "ApparcTestServer.h"
+#include <babackup.h>
+
+class CT_BackupStep;
+struct CBackupTestThreadParams
+		{
+			TInt64 seed;
+			CT_BackupStep* Step;
+		};
+
+
+
+//!  A CT_BackupStep test class. 
+/*!
+  Performs Tests on Backup server
+*/
+class CT_BackupStep :public CTestStep 
+	{
+public:
+	CT_BackupStep();
+	~CT_BackupStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+	TInt DoBackupMultipleTestThreadEntryL(/*TAny* aPtr*/);	
+
+//private:
+	void doMainL();
+	void SetupSchedulerL();
+	void CloseScheduler();
+	void doTestsL();
+	void testMultipleClientsL();
+	void testRestartAppsL();
+	TRequestStatus testExtraRestartLockedOutL();
+	void testGetsCallbackOnBackupWrapperKillOtherL();
+	void testGetsCallbackOnBackupWrapperKillL();
+	void testGetsCallbackOnBackupStartInSecondWrapperL();
+	void testGetsCallbackOnBackupEndL();
+	void testGetsCallbackOnBackupStartL();
+	void FlushSchedulerQueueL();
+	static TInt BackupMultipleTestThreadEntry(TAny* aPtr);
+	
+private:
+	CBaBackupSessionWrapper* gWrapper;
+	CActiveScheduler *testScheduler;
+	};
+
+_LIT(KT_BackupStep,"T_Backup");
+
+//**********************************
+// CTestActive
+//**********************************
+
+class CTestActive : public CActive
+	{
+public:
+	CTestActive();
+	~CTestActive();
+	void StartL();
+	void StartL(TRequestStatus& aRequestStatus);
+protected:
+	void DoCancel();
+	void RunL();
+
+	TRequestStatus* iReport;
+	};
+
+// Class to test the n-th recieved event from the backup server is the same as the event
+// the object is initialised with
+
+
+class CTestBackupOperationObserver : public CTestActive, public MBackupOperationObserver
+	{
+public:
+	virtual void HandleBackupOperationEventL(const TBackupOperationAttributes& aBackupOperationAttributes);
+	CTestBackupOperationObserver(const TBackupOperationAttributes& aEvent, CTestExecuteLogger& aLogger);
+	CTestBackupOperationObserver(const TBackupOperationAttributes& aEvent, TInt aCount, CTestExecuteLogger& aLogger);
+	void SetReadyToGo();/*{iCount=KOneOfOurEvents;};*/
+	inline CTestExecuteLogger& Logger() {return iLogger;};
+private:
+	TBackupOperationAttributes iEvent;
+	TInt iCount;
+	CTestExecuteLogger iLogger;
+	};
+
+class CThreadLaunchCounter : public CActive
+	{
+public:
+	CThreadLaunchCounter();
+	~CThreadLaunchCounter();
+	void Start();
+protected:
+	void DoCancel(){};
+	void RunL();
+private:
+	TInt gCount;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_Capability1.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,128 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// The following test case is used to test whether apparctestserver has the capability
+// to access writable apis
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include "T_Capability1.h"
+#include "tstapp.h"
+#include "testableapalssession.h"
+#include <appfwk_test.h>
+
+/**
+   @SYMTestCaseID		APPFWK-APPARC-0030
+  
+   @SYMPREQ			Policing server apis		
+  
+   @SYMTestCaseDesc 	Testing whether apparctestserver has the capability to access writable apis
+  
+   @SYMTestPriority 	High
+  
+   @SYMTestStatus 		Implemented
+   
+   @SYMTestActions  
+   To connect to RApaLsSession and to check whether uiktestserver process
+   has the permission to access the mentioned apis
+   API Calls:\n	
+   RApaLsSession::Connect();
+   RApaLsSession::SetAcceptedConfidence(TInt aConfidence);
+   RApaLsSession::InsertDataMapping(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid);
+   RApaLsSession::InsertDataMappingIfHigher(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid, TBool& aInserted);
+   RApaLsSession::DeleteDataMapping(const TDataType& aDataType);
+   
+   @SYMTestExpectedResults Test should complete without any panic.
+  
+ */
+void CT_Capability1::ExecuteL(RApaLsSession& aLs)
+	{
+	TInt ret;
+	TInt temp=1234;
+	TBool added=EFalse;
+	_LIT8(KLitPlainText,"text/plain");
+	const TDataTypePriority KPriLow = 1;
+	const TDataTypePriority KPriHigh = 2;
+	
+
+	TSecurityInfo info;
+	info.Set(RProcess());
+	
+	APPFWK_NEGATIVE_PLATSEC_START;
+	ret=aLs.SetAcceptedConfidence(temp);
+	APPFWK_NEGATIVE_PLATSEC_FINISH;
+	INFO_PRINTF1(_L("Capability check of SetAcceptedConfidence"));
+	INFO_PRINTF3(_L("Expected return code: %d, Actual return code: %d"), KErrPermissionDenied, ret);
+	TEST(ret==KErrPermissionDenied);
+
+	APPFWK_NEGATIVE_PLATSEC_START;
+	ret=aLs.InsertDataMapping(TDataType(KLitPlainText), KPriLow, KUidTestApp);
+	APPFWK_NEGATIVE_PLATSEC_FINISH;
+	INFO_PRINTF1(_L("Capability check of InsertDataMapping"));
+	INFO_PRINTF3(_L("Expected return code: %d, Actual return code: %d"), KErrPermissionDenied, ret);
+	TEST(ret==KErrPermissionDenied);
+
+	APPFWK_NEGATIVE_PLATSEC_START;
+	ret=aLs.InsertDataMappingIfHigher(TDataType(KLitPlainText), KPriHigh, KUidTestApp, added);
+	APPFWK_NEGATIVE_PLATSEC_FINISH;
+	INFO_PRINTF1(_L("Capability check of InsertDataMappingIfHigher"));
+	INFO_PRINTF3(_L("Expected return code: %d, Actual return code: %d"), KErrPermissionDenied, ret);
+	TEST(ret==KErrPermissionDenied);
+
+	APPFWK_NEGATIVE_PLATSEC_START;
+	ret=aLs.DeleteDataMapping(TDataType(KLitPlainText));
+	APPFWK_NEGATIVE_PLATSEC_FINISH;
+	INFO_PRINTF1(_L("Capability check of DeleteDataMapping"));
+	INFO_PRINTF3(_L("Expected return code: %d, Actual return code: %d"), KErrPermissionDenied, ret);
+	TEST(ret==KErrPermissionDenied);
+
+
+	}
+
+CT_Capability1::CT_Capability1()
+/**
+   Constructor
+ */
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_Capability1);
+	}
+
+CT_Capability1::~CT_Capability1()
+	{
+	}
+
+TVerdict CT_Capability1::doTestStepL()
+    {
+	INFO_PRINTF1(_L("APPFWK-APPARC-0030: Capability1 - Started"));
+	
+	RTestableApaLsSession apaLsSession;
+	TEST(apaLsSession.Connect()==KErrNone);
+	CleanupClosePushL(apaLsSession);
+	
+	HEAP_TEST_LS_SESSION(apaLsSession, 0, 0, ExecuteL(apaLsSession), NO_CLEANUP);
+	
+
+	CleanupStack::PopAndDestroy(&apaLsSession);
+
+	INFO_PRINTF1(_L("APPFWK-APPARC-0030: Capability1 - Finished"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_Capability1.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,51 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// The following test case is used to test writable APIs in RApaLsSession and to test whether
+// apparctestserver process has the capability to access those APIs.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#if !defined(__T_CAPABILITY1_H__)
+#define __T_CAPABILITY1_H__
+
+#include "ApparcTestServer.h"
+#include "appfwk_test_AppUi.h"
+
+class RApaLsSession;
+
+//! CT_Capability1
+/** 
+  This class is used to test writable apis in RApaLsSession
+*/
+class CT_Capability1 : public CTestStep
+	{
+public:
+	CT_Capability1();
+	virtual TVerdict doTestStepL();
+	void ExecuteL(RApaLsSession& aLs);
+private:
+	~CT_Capability1();
+private:
+	};
+
+_LIT(KT_Capability1,"T_Capability1");
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_Capability2.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,119 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// The following test case is used to test whether apparctestserver has the capability
+// to access writable apis
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include "T_Capability2.h"
+#include "tstapp.h"
+#include "testableapalssession.h"
+#include <appfwk_test.h>
+
+/**
+   @SYMTestCaseID		APPFWK-APPARC-0030
+  
+   @SYMPREQ			Policing server apis		
+  
+   @SYMTestCaseDesc 	Testing whether apparctestserver has the capability to access writable apis
+  
+   @SYMTestPriority 	High
+  
+   @SYMTestStatus 		Implemented
+   
+   @SYMTestActions  
+   To connect to RApaLsSession and to check whether uiktestserver process
+   has the permission to access the mentioned apis
+   API Calls:\n	
+   RApaLsSession::Connect();
+   RApaLsSession::SetAcceptedConfidence(TInt aConfidence);
+   RApaLsSession::InsertDataMapping(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid);
+   RApaLsSession::InsertDataMappingIfHigher(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid, TBool& aInserted);
+   RApaLsSession::DeleteDataMapping(const TDataType& aDataType);
+   
+   @SYMTestExpectedResults Test should complete without any panic.
+  
+ */
+void CT_Capability2::ExecuteL(RApaLsSession& aLs)
+	{
+	TInt ret;
+	TInt temp=1234;
+	TBool added=EFalse;
+	_LIT8(KLitPlainText,"text/plain");
+	const TDataTypePriority KPriLow = 1;
+	const TDataTypePriority KPriHigh = 2;
+	
+	TSecurityInfo info;
+	info.Set(RProcess());
+	
+	ret=aLs.SetAcceptedConfidence(temp);
+	INFO_PRINTF1(_L("Capability check of SetAcceptedConfidence"));
+	INFO_PRINTF3(_L("Expected return code: %d, Actual return code: %d"), KErrNone, ret);
+	TEST(ret==KErrNone);
+
+	ret=aLs.InsertDataMapping(TDataType(KLitPlainText), KPriLow, KUidTestApp);
+	INFO_PRINTF1(_L("Capability check of InsertDataMapping"));
+	INFO_PRINTF3(_L("Expected return code: %d, Actual return code: %d"), KErrNone, ret);
+	TEST(ret==KErrNone);
+
+	ret=aLs.InsertDataMappingIfHigher(TDataType(KLitPlainText), KPriHigh, KUidTestApp, added);
+	INFO_PRINTF1(_L("Capability check of InsertDataMappingIfHigher"));
+	INFO_PRINTF3(_L("Expected return code: %d, Actual return code: %d"), KErrNone, ret);
+	TEST(ret==KErrNone);
+
+	ret=aLs.DeleteDataMapping(TDataType(KLitPlainText));
+	INFO_PRINTF1(_L("Capability check of DeleteDataMapping"));
+	INFO_PRINTF3(_L("Expected return code: %d, Actual return code: %d"), KErrNone, ret);
+	TEST(ret==KErrNone);
+
+	}
+
+CT_Capability2::CT_Capability2()
+/**
+   Constructor
+ */
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_Capability2);
+	}
+
+CT_Capability2::~CT_Capability2()
+	{
+	}
+
+TVerdict CT_Capability2::doTestStepL()
+    {
+	INFO_PRINTF1(_L("APPFWK-APPARC-0031: Capability2 - Started"));
+	
+	RTestableApaLsSession apaLsSession;
+	TEST(apaLsSession.Connect()==KErrNone);
+	CleanupClosePushL(apaLsSession);
+
+	//DONT_CHECK since array in type store is uncompressed
+	HEAP_TEST_LS_SESSION(apaLsSession, 0, DONT_CHECK, ExecuteL(apaLsSession), NO_CLEANUP);
+
+	CleanupStack::PopAndDestroy(&apaLsSession);
+
+
+	INFO_PRINTF1(_L("APPFWK-APPARC-0031: Capability2 - Finished"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_Capability2.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,51 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// The following test case is used to test writable APIs in RApaLsSession and to test whether
+// apparctestserver process has the capability to access those APIs.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#if !defined(__T_CAPABILITY2_H__)
+#define __T_CAPABILITY2_H__
+
+#include "ApparcTestServer.h"
+#include "appfwk_test_AppUi.h"
+
+class RApaLsSession;
+
+//! CT_Capability2
+/** 
+  This class is used to test writable apis in RApaLsSession
+*/
+class CT_Capability2 : public CTestStep
+	{
+public:
+	CT_Capability2();
+	virtual TVerdict doTestStepL();
+	void ExecuteL(RApaLsSession& aLs);
+private:
+	~CT_Capability2();
+private:
+	};
+
+_LIT(KT_Capability2,"T_Capability2");
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_CaptionStep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1019 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Test for GT0247 Bravo.
+// CR0583: Apparc should allow short caption to be modified dynamically
+// Test for UIKON GT0143 Typhoon Work Series 60 Changes.
+// REQ758.1: Add support for short captions
+// This test requires that tstapp.app has been built
+// tstapp.mmp has RESOURCE tstapp_caption.rss what caption is built into the .rsc file
+// tstapp_loc.rss decides what version of the caption file to include:
+// tstapp01.rls
+// tstapp02.rls
+// tstapp03.rls
+// tstapp04.rls
+// tstapp05.rls
+// tstappsc.rls
+// 
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <apgicnfl.h>
+#include <hal.h>
+#include <e32test.h>
+
+#include <apgctl.h>
+#include <apfctlf.h>
+#include <APGCLI.H>
+#include <APSSERV.H>
+#include <APAFLREC.H>
+#include <APFREC.H>
+#include <APPARC.H>
+#include <APGDOOR.H>
+#include <centralrepository.h>
+
+#include <s32file.h>
+#include "tstapp.h"		// KUidTestApp defined here
+#include "T_CaptionStep.h"
+#include "appfwk_test_utils.h"
+#include "appfwk_test.h"
+#include "ticoncaptionoverride.h" //KUidTestIconCapOverride defined here
+#include "TIconLoaderAndIconArrayForLeaks.h"
+
+
+/////////////////////////////////////////////////////////////////////////////////
+//
+//		global consts and declarations
+//
+/////////////////////////////////////////////////////////////////////////////////
+
+
+_LIT(KTestTApaAppInfoCaptionEnglish,"TstCap UK");
+_LIT(KTestTApaAppInfoShortCaptionEnglish,"TC UK");
+
+_LIT(KTestTApaAppInfoCaptionFrench,"TstCap FR");
+_LIT(KTestTApaAppInfoShortCaptionFrench,"TC FR");
+
+_LIT(KTestTApaAppInfoCaptionGerman,"TstCap GE");
+_LIT(KTestTApaAppInfoShortCaptionGerman,"TC GE");
+
+// If _loc.rss does not define Short Caption, it takes long caption
+_LIT(KTestTApaAppInfoCaptionSpanish,"TstCap SP");
+_LIT(KTestTApaAppInfoShortCaptionSpanish,"TstCap SP");
+
+// If _loc.rss does not define Caption, it takes app name
+_LIT(KTestTApaAppInfoCaptionItalian,"tstapp");
+_LIT(KTestTApaAppInfoShortCaptionItalian,"TC IT");
+
+_LIT(KTestTApaAppInfoCaptionDefault,"TstCap UK");
+_LIT(KTestTApaAppInfoShortCaptionDefault,"TC UK");
+
+// Cenrep configuration details for English language
+_LIT(KCenRepCaption, "CRTstCap UK");
+_LIT(KCenRepShortCaption, "CRTC UK");
+_LIT(KCenRepIconFilename, "Z:\\resource\\apps\\ticoncapoverride.mbm");
+
+const TUid KUidIconCaptionRepository = {0x1028583d}; // Central Repository UID.
+const TInt KTextSize = 100;
+
+/////////////////////////////////////////////////////////////////////////////////
+//
+//		CT_CaptionStep
+//
+/////////////////////////////////////////////////////////////////////////////////
+
+
+void CT_CaptionStep::ChangeLocaleL(TLanguage aLanguage)
+	{
+	//  Change locale according to information in the HAL
+	_LIT(KLitLocaleDllNameBase, "ELOCL");
+	_LIT(KLitLocaleDllNameExtension, ".LOC");
+	RLibrary localeDll;
+	TBuf<16> localeDllName(KLitLocaleDllNameBase);
+	CleanupClosePushL(localeDll);
+	const TUidType uidType(TUid::Uid(0x10000079),TUid::Uid(0x100039e6));
+	_LIT(TwoDigExt,".%02d");
+	localeDllName.AppendFormat(TwoDigExt, aLanguage);
+	TInt error=localeDll.Load(localeDllName, uidType);
+	if (error==KErrNotFound)
+		{
+		localeDllName=KLitLocaleDllNameBase;
+		localeDllName.Append(KLitLocaleDllNameExtension);
+		error=localeDll.Load(localeDllName, uidType);
+		}
+	User::LeaveIfError(error);
+	User::LeaveIfError(UserSvr::ChangeLocale(localeDllName));
+	CleanupStack::PopAndDestroy(&localeDll);
+	}
+
+
+void CT_CaptionStep::DoLanguageTestL()
+	{
+	TLanguage language = User::Language();	// keep a copy to restore it later on.
+	
+	TInt ch = 0;
+	for (ch=0; ch < 2; ch++)
+		{
+		TLanguage languageToTest = ELangTest;	// init to supress compiler remark
+		switch (ch)
+			{
+			case 0:
+				languageToTest=ELangEnglish;
+				INFO_PRINTF1(_L("--------- Testing English"));
+				break;
+			case 1:
+				languageToTest=ELangFrench;
+				INFO_PRINTF1(_L("--------- Testing French"));
+				break;
+			case 2:
+				languageToTest=ELangGerman;
+				INFO_PRINTF1(_L("--------- Testing German"));
+				break;
+			case 3:
+				languageToTest=ELangSpanish;
+				INFO_PRINTF1(_L("--------- Testing Spanish"));
+				break;
+			case 4:
+				languageToTest=ELangItalian;
+				INFO_PRINTF1(_L("--------- Testing Italian"));
+				break;
+			case 5:
+				languageToTest=ELangAmerican;
+				INFO_PRINTF1(_L("--------- Testing American"));
+				break;
+			default:
+				User::LeaveIfError(KErrNotSupported);
+				break;
+			};
+
+		// Change the locale
+		ChangeLocaleL(languageToTest);
+		TEST(User::Language() == languageToTest);
+		
+		// Force the applist to be updated (so test app gets new language settings)
+		RPointerArray<TDesC> dummy;
+		User::LeaveIfError(iLs.ForceRegistration(dummy));
+		
+		// Do the same set of tests for each language
+		TestCApaSystemControlListL();
+		TestCApaDoorL();
+		TestTApaAppInfoStreamsL();
+		//Skip the memory leak test
+		//HEAP_TEST_LS_SESSION(iLs, 0, 0, TestTApaAppInfoL(), iLs.ClearAppInfoArray() );
+		//and run this instead
+		TestTApaAppInfoL();
+
+		INFO_PRINTF1(_L("Test for that language finished..."));
+		}
+
+	// restore original locale, just in case...
+	ChangeLocaleL(language);
+	TEST(User::Language() == language);
+	}	
+
+/**
+   @SYMTestCaseID	t_caption_TestCApaSystemControlListL
+  
+   @SYMPREQ			0
+  
+   @SYMTestCaseDesc	Check (short)caption by means of a control on the list CApaSystemControlList 
+
+   @SYMTestPriority High
+  
+   @SYMTestStatus 	Implemented
+  
+   @SYMTestActions	The test creates a CApaSystemControlList and checks the value of (short)caption
+   					by creating a CApaSystemControl from index 0 of CApaSystemControlList
+
+   @SYMTestExpectedResults	The (short)caption is set to a value not null (length is not zero)
+ */	
+void CT_CaptionStep::TestCApaSystemControlListL()
+	{
+	INFO_PRINTF1(_L("Testing CApaSystemControlList... "));
+	CApaSystemControlList* list=NULL;
+	User::LeaveIfError(FbsStartup());
+	RFbsSession fbs;
+	User::LeaveIfError(fbs.Connect());
+	TRAPD(ret, list=CApaSystemControlList::NewL(iFs));
+	TEST(ret==KErrNone);
+	CApaSystemControl* control=list->Control(0);
+	TPtrC testShortCap=control->ShortCaption();
+	TEST(testShortCap.Length()>0);
+	TPtrC testCap=control->Caption();
+	TEST(testCap.Length()>0);
+	}
+
+
+/**
+   @SYMTestCaseID	t_caption_TestTApaAppInfoL
+  
+   @SYMPREQ			0
+  
+   @SYMTestCaseDesc Check appInfo contains the right (short)caption for the current test language.
+
+   @SYMTestPriority High
+  
+   @SYMTestStatus 	Implemented
+  
+   @SYMTestActions	The test searches for KUidTestApp by calling GetNextApp until the UIDs match. 
+   					Once the right app is found, it retrieves its details by calling GetAppInfo().
+   					The (short)caption is check to ensure it matches the expected result.
+
+   @SYMTestExpectedResults	The (short)caption matches the one specified for the application, with the
+   							american one being the default one.
+ */	
+void CT_CaptionStep::TestTApaAppInfoL()
+	{
+	INFO_PRINTF1(_L("Testing GetAppInfo()... "));
+	
+	// go through the list of apps until it finds KUidTestApp
+	TApaAppInfo appInfo;
+	TInt ret = iLs.GetAllApps();
+	TEST(ret==KErrNone);
+	FOREVER
+		{
+		TApaAppInfo info;
+		ret=iLs.GetNextApp(info);
+		TEST(ret==KErrNone);
+		if (info.iUid==KUidTestApp)
+			{
+			iLs.GetAppInfo(appInfo, info.iUid);
+			break;
+			}
+		}
+
+	switch (User::Language())
+		{
+		case ELangEnglish:
+			TEST(appInfo.iCaption==KTestTApaAppInfoCaptionEnglish);
+			TEST(appInfo.iShortCaption==KTestTApaAppInfoShortCaptionEnglish);
+			break;
+		case ELangFrench:
+			TEST(appInfo.iCaption==KTestTApaAppInfoCaptionFrench);
+			TEST(appInfo.iShortCaption==KTestTApaAppInfoShortCaptionFrench);
+			break;
+		case ELangGerman:
+			TEST(appInfo.iCaption==KTestTApaAppInfoCaptionGerman);
+			TEST(appInfo.iShortCaption==KTestTApaAppInfoShortCaptionGerman);
+			break;
+		case ELangSpanish:
+			TEST(appInfo.iCaption==KTestTApaAppInfoCaptionSpanish);
+			TEST(appInfo.iShortCaption==KTestTApaAppInfoShortCaptionSpanish);
+			break;
+		case ELangItalian:
+			TEST(appInfo.iCaption==KTestTApaAppInfoCaptionItalian);
+			TEST(appInfo.iShortCaption==KTestTApaAppInfoShortCaptionItalian);
+			break;
+		case ELangAmerican:
+			TEST(appInfo.iCaption==KTestTApaAppInfoCaptionDefault);
+			TEST(appInfo.iShortCaption==KTestTApaAppInfoShortCaptionDefault);
+			break;
+		default:
+			User::Leave(KErrNotSupported);
+			break;
+		};
+	}
+
+
+/**
+   @SYMTestCaseID	t_caption_TestCApaDoorL
+  
+   @SYMPREQ			0
+  
+   @SYMTestCaseDesc	Check the caption returned by a CApaDoor (a wrapper for an embedded document).
+
+   @SYMTestPriority High
+  
+   @SYMTestStatus 	Implemented
+  
+   @SYMTestActions	The test starts by creating an active scheduler.
+   					A CApaProcess is created, and a new CApaDocument is added to it using the specified 
+   					application factory. This document is then used to create a CApaDoor object which 
+   					is used to retrieve the test app caption.
+
+   @SYMTestExpectedResults	The (short)caption matches the one specified for the application, with the
+   							american one being the default one.
+ */	
+void CT_CaptionStep::TestCApaDoorL()
+	{
+	INFO_PRINTF1(_L("Testing CApaDoor... "));
+	
+	// create an active scheduler
+	CActiveScheduler* scheduler = new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(scheduler);
+	CleanupStack::PushL(scheduler);
+
+	CApaProcess* process=NULL;
+	TRAPD(ret,process = CApaProcess::NewL(iFs));
+	TEST(ret==KErrNone);
+
+	CleanupStack::PushL(process);
+
+	CApaDocument* doc=NULL;
+	TApaApplicationFactory appFact(KUidTestApp);
+	TRAP(ret,doc=process->AddNewDocumentL(appFact));
+	TEST(ret==KErrNone);
+
+	CApaDoor* door = NULL;
+	TRAP(ret,door=CApaDoor::NewL(iFs,*doc,TSize(400,400)));
+	TEST(ret==KErrNone);
+
+	switch (User::Language())
+		{
+		case ELangEnglish:
+			TEST(*door->Caption()==KTestTApaAppInfoCaptionEnglish);
+			break;
+		case ELangFrench:
+			TEST(*door->Caption()==KTestTApaAppInfoCaptionFrench);
+			break;
+		case ELangGerman:
+			TEST(*door->Caption()==KTestTApaAppInfoCaptionGerman);
+			break;
+		case ELangSpanish:
+			TEST(*door->Caption()==KTestTApaAppInfoCaptionSpanish);
+			break;
+		case ELangItalian:
+			TEST(*door->Caption()==KTestTApaAppInfoCaptionItalian);
+			break;
+		case ELangAmerican:
+			TEST(*door->Caption()==KTestTApaAppInfoCaptionDefault);
+			break;
+		default:
+			User::Leave(KErrNotSupported);
+			break;
+		};
+	process->DestroyDocument(doc);
+	CleanupStack::PopAndDestroy(2); //process,scheduler
+	}
+
+
+/**
+   @SYMTestCaseID	t_caption_TestTApaAppInfoStreamsL
+  
+   @SYMPREQ			0
+  
+   @SYMTestCaseDesc Check TApaAppInfo streaming works as expected
+
+   @SYMTestPriority High
+  
+   @SYMTestStatus 	Implemented
+  
+   @SYMTestActions	Create and TApaAppInfo object with the KUidTestApp test app.
+   					Also, create a temporal file, associates the file with a write stream, 
+   					and prepares the stream for writing. 
+   					When the object is externalized to the streem, we open a file containing a 
+   					read stream and prepares the stream for reading.
+
+   @SYMTestExpectedResults	The test case is completed without any errors or panics
+ */	
+void CT_CaptionStep::TestTApaAppInfoStreamsL()
+	{
+	INFO_PRINTF1(_L("Testing TApaAppInfo streams... "));
+
+	TApaAppInfo appInfoShort(KUidTestApp, _L("z:\\sys\\bin\\tstapp.exe"), _L("TstCap UK"),_L("TC UK"));
+	TEST(appInfoShort.iShortCaption.Compare(_L("TC UK"))==0);
+
+	TFileName tempFile=_L("c:\\system\\test\\TC_temp.txt");
+	TInt ret = iFs.MkDirAll(tempFile);
+	if (ret != KErrNone && ret != KErrAlreadyExists)
+		User::LeaveIfError(ret);
+	
+	TApaAppInfo appInfo;
+
+	RFileWriteStream writer;
+	writer.PushL();
+	User::LeaveIfError(writer.Replace(iFs,tempFile,EFileWrite));
+	TRAP(ret, appInfo.ExternalizeL(writer));
+	TEST(ret==KErrNone);
+	writer.CommitL();
+	CleanupStack::PopAndDestroy(&writer);
+
+	RFileReadStream reader;
+	reader.PushL();
+	User::LeaveIfError(reader.Open(iFs,tempFile,EFileRead));
+	TRAP(ret, appInfo.InternalizeL(reader));
+	TEST(ret==KErrNone);
+
+	CleanupStack::PopAndDestroy(&reader);
+
+	User::LeaveIfError(iFs.Delete(tempFile));
+	}
+	
+
+
+/**
+   @SYMTestCaseID APPFWK-APPARC-0041 APPFWK-APPARC-0042 APPFWK-APPARC-0043 APPFWK-APPARC-0044 APPFWK-APPARC-0045 APPFWK-APPARC-0046
+  
+   @SYMPREQ PCHY-6FTLPK
+  
+   @SYMTestCaseDesc Test the RApaLsSession::SetAppShortCaption function, used to set the app's short caption.
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions Call SetAppShortCaption() to set the caption and read it back using the GetApaAppInfo().
+  
+   @SYMTestExpectedResults The returned short caption must match the one set by the SetAppShortCaption function.
+ */	
+void CT_CaptionStep::DoShortCaptionTestL()
+	{
+	INFO_PRINTF1(_L("Testing SetAppShortCaptionL() for short caption changes... "));
+
+	_LIT(KShortCaption1, "SC1");
+	_LIT(KShortCaption2, "SC2");
+	_LIT(KShortCaption3, "SC3");
+	_LIT(KShortCaption4, "SC4");
+	_LIT(KShortCaption5, "SC5");
+
+	// keep a copy of the current language, and set it to a known one
+	TLanguage language = User::Language();
+	ChangeLocaleL(ELangEnglish);
+	TEST(User::Language() == ELangEnglish);
+	
+	// Force the applist to be updated (so test app gets new language settings)
+	RPointerArray<TDesC> dummy;
+	User::LeaveIfError(iLs.ForceRegistration(dummy));
+
+	// SetAppShortCaption should return KErrNotFound if it could not find the app
+	INFO_PRINTF1(_L(".....setting short caption for an unknown app"));
+	TInt err = iLs.SetAppShortCaption(KShortCaption1, ELangNone, TUid::Uid(0xFFF34556));
+	TEST(err == KErrNotFound);
+
+	// Set the NULL short caption i.e. "", should return KErrArgument,
+	INFO_PRINTF1(_L(".....setting an empty short caption"));
+	err = iLs.SetAppShortCaption(KNullDesC, ELangNone, KUidTestApp);
+	TEST(err == KErrArgument);
+
+	// SetAppShortCaption should return KErrArgument if short caption > KApaMaxAppCaption
+	INFO_PRINTF1(_L(".....setting short caption of more then KApaMaxAppCaption length"));
+	HBufC* longCaption = HBufC::NewL(KApaMaxAppCaption+1);
+	longCaption->Des().SetLength(KApaMaxAppCaption+1);
+	err = iLs.SetAppShortCaption(*longCaption, ELangNone, KUidTestApp);
+	TEST(err == KErrArgument);
+	delete longCaption;
+
+	// SetAppShortCaption should return KErrNone if short caption == KApaMaxAppCaption
+	INFO_PRINTF1(_L(".....setting short caption of same size as KApaMaxAppCaption"));
+	longCaption = HBufC::NewL(KApaMaxAppCaption);
+	longCaption->Des().SetLength(KApaMaxAppCaption);
+	err = iLs.SetAppShortCaption(*longCaption, ELangCatalan, KUidTestApp);	// just testing the arg length, not actual values
+	TEST(err == KErrNone);
+	delete longCaption;
+
+	// Set short caption of an app for the current locale language (ELangEnglish so far)
+	INFO_PRINTF1(_L(".....setting short caption of an app for the current locale language"));
+	err = iLs.SetAppShortCaption(KShortCaption1, ELangEnglish, KUidTestApp);
+	TEST(err == KErrNone);
+	TApaAppInfo appInfo;
+	iLs.GetAppInfo(appInfo, KUidTestApp);
+	TEST(appInfo.iShortCaption == KShortCaption1);
+
+	// Check short caption remains updated after a refresh of the applist
+	INFO_PRINTF1(_L(".....checking short caption remains updated after a refresh of the applist"));
+	User::LeaveIfError(iLs.ForceRegistration(dummy));
+	iLs.GetAppInfo(appInfo, KUidTestApp);
+	TEST(appInfo.iShortCaption == KShortCaption1);
+
+	// Check short caption remains updated after a locale change
+	INFO_PRINTF1(_L(".....checking short caption remains updated after a locale change"));
+	ChangeLocaleL(ELangJapanese);
+	TEST(User::Language() == ELangJapanese);	// Japanese locale exists in epoc32 tree but not defined in test app
+	User::LeaveIfError(iLs.ForceRegistration(dummy));
+	ChangeLocaleL(ELangEnglish);				// back to English to see what happened in between
+	TEST(User::Language() == ELangEnglish);
+	User::LeaveIfError(iLs.ForceRegistration(dummy));
+	iLs.GetAppInfo(appInfo, KUidTestApp);
+	TEST(appInfo.iShortCaption == KShortCaption1);
+
+	// Set short caption of an app for a language which is not the current one (ELangFrench, for example)
+	INFO_PRINTF1(_L(".....setting short caption of an app for a language which is not the current one"));
+	err = iLs.SetAppShortCaption(KShortCaption2, ELangFrench, KUidTestApp);
+	TEST(err == KErrNone);
+	iLs.GetAppInfo(appInfo, KUidTestApp);
+	TEST(appInfo.iShortCaption == KShortCaption1);	// English, the current app language, doesn't change...
+	ChangeLocaleL(ELangFrench);
+	TEST(User::Language() == ELangFrench);
+	User::LeaveIfError(iLs.ForceRegistration(dummy));
+	iLs.GetAppInfo(appInfo, KUidTestApp);
+	TEST(appInfo.iShortCaption == KShortCaption2);	
+	
+	// Set short caption of an app for a language which the app does not include (ELangAmerican)
+	INFO_PRINTF1(_L(".....setting short caption of an app for a language which the app does not include"));
+	ChangeLocaleL(ELangAmerican);
+	TEST(User::Language() == ELangAmerican);
+	User::LeaveIfError(iLs.ForceRegistration(dummy));
+	err = iLs.SetAppShortCaption(KShortCaption2, ELangAmerican, KUidTestApp);
+	iLs.GetAppInfo(appInfo, KUidTestApp);
+	TEST(appInfo.iShortCaption == KShortCaption1);	// American takes the default...so English...which has just been updated.
+
+	// Set short caption of an app for all languages with ELangNone
+	INFO_PRINTF1(_L(".....setting short caption for all languages with ELangNone"));
+	err = iLs.SetAppShortCaption(KShortCaption3, ELangNone, KUidTestApp);
+	TEST(err == KErrNone);
+	iLs.GetAppInfo(appInfo, KUidTestApp);
+	TEST(appInfo.iShortCaption == KShortCaption1);	// American takes the default...so English...which has just been updated.
+	ChangeLocaleL(ELangEnglish);
+	TEST(User::Language() == ELangEnglish);
+	User::LeaveIfError(iLs.ForceRegistration(dummy));
+	iLs.GetAppInfo(appInfo, KUidTestApp);
+	TEST(appInfo.iShortCaption == KShortCaption1);	// English set individually ===> not updated by ELangNone
+	ChangeLocaleL(ELangFrench);
+	TEST(User::Language() == ELangFrench);
+	User::LeaveIfError(iLs.ForceRegistration(dummy));
+	iLs.GetAppInfo(appInfo, KUidTestApp);
+	TEST(appInfo.iShortCaption == KShortCaption2);	// French set individually ===> not updated by ELangNone
+	ChangeLocaleL(ELangGerman);
+	TEST(User::Language() == ELangGerman);
+	User::LeaveIfError(iLs.ForceRegistration(dummy));
+	iLs.GetAppInfo(appInfo, KUidTestApp);
+	TEST(appInfo.iShortCaption == KShortCaption3);	// German takes the one set by  ELangNone
+	ChangeLocaleL(ELangItalian);
+	TEST(User::Language() == ELangItalian);
+	User::LeaveIfError(iLs.ForceRegistration(dummy));
+	iLs.GetAppInfo(appInfo, KUidTestApp);
+	TEST(appInfo.iShortCaption == KShortCaption3);	// Italian takes the one set by ELangNone
+	ChangeLocaleL(ELangSpanish);
+	TEST(User::Language() == ELangSpanish);
+	User::LeaveIfError(iLs.ForceRegistration(dummy));
+	iLs.GetAppInfo(appInfo, KUidTestApp);
+	TEST(appInfo.iShortCaption == KShortCaption3);	// Spanish takes the one set by ELangNone
+
+	// Set short caption of an app for a language which was set by the previous ELangNone
+	INFO_PRINTF1(_L(".....setting short caption of an app which was set by the previous ELangNone"));
+	ChangeLocaleL(ELangItalian);
+	TEST(User::Language() == ELangItalian);
+	User::LeaveIfError(iLs.ForceRegistration(dummy));
+	err = iLs.SetAppShortCaption(KShortCaption4, ELangItalian, KUidTestApp);
+	iLs.GetAppInfo(appInfo, KUidTestApp);
+	TEST(appInfo.iShortCaption == KShortCaption4);
+
+	// Repeat set short caption of an app for all languages with ELangNone
+	INFO_PRINTF1(_L(".....repeat setting short caption for all languages with ELangNone"));
+	err = iLs.SetAppShortCaption(KShortCaption5, ELangNone, KUidTestApp);
+	TEST(err == KErrNone);
+	iLs.GetAppInfo(appInfo, KUidTestApp);
+	TEST(appInfo.iShortCaption == KShortCaption4);	// Italian set individually ===> not updated by ELangNone
+	ChangeLocaleL(ELangEnglish);
+	TEST(User::Language() == ELangEnglish);
+	User::LeaveIfError(iLs.ForceRegistration(dummy));
+	iLs.GetAppInfo(appInfo, KUidTestApp);
+	TEST(appInfo.iShortCaption == KShortCaption1);	// English set individually ===> not updated by ELangNone
+	ChangeLocaleL(ELangFrench);
+	TEST(User::Language() == ELangFrench);
+	User::LeaveIfError(iLs.ForceRegistration(dummy));
+	iLs.GetAppInfo(appInfo, KUidTestApp);
+	TEST(appInfo.iShortCaption == KShortCaption2);	// French set individually ===> not updated by ELangNone
+	ChangeLocaleL(ELangGerman);
+	TEST(User::Language() == ELangGerman);
+	User::LeaveIfError(iLs.ForceRegistration(dummy));
+	iLs.GetAppInfo(appInfo, KUidTestApp);
+	TEST(appInfo.iShortCaption == KShortCaption5);	// German takes the one set by  ELangNone
+	ChangeLocaleL(ELangSpanish);
+	TEST(User::Language() == ELangSpanish);
+	User::LeaveIfError(iLs.ForceRegistration(dummy));
+	iLs.GetAppInfo(appInfo, KUidTestApp);
+	TEST(appInfo.iShortCaption == KShortCaption5);	// Spanish takes the one set by ELangNone
+	ChangeLocaleL(ELangAmerican);
+	TEST(User::Language() == ELangAmerican);
+	User::LeaveIfError(iLs.ForceRegistration(dummy));
+	iLs.GetAppInfo(appInfo, KUidTestApp);
+	TEST(appInfo.iShortCaption == KShortCaption1);	// American takes the default...so English...which has just been updated.
+
+	// restore original settings....
+	INFO_PRINTF1(_L(".....restoring original settings"));
+	ChangeLocaleL(language);
+	TEST(User::Language() == language);
+	// restore original short captions for all langs....(h4 doesn't perform reboots between tests)
+	TEST(iLs.SetAppShortCaption(KTestTApaAppInfoShortCaptionEnglish, ELangEnglish, KUidTestApp) == KErrNone);
+	TEST(iLs.SetAppShortCaption(KTestTApaAppInfoShortCaptionFrench, ELangFrench, KUidTestApp) == KErrNone);
+	TEST(iLs.SetAppShortCaption(KTestTApaAppInfoShortCaptionGerman, ELangGerman, KUidTestApp) == KErrNone);
+	TEST(iLs.SetAppShortCaption(KTestTApaAppInfoShortCaptionItalian, ELangItalian, KUidTestApp) == KErrNone);
+	TEST(iLs.SetAppShortCaption(KTestTApaAppInfoShortCaptionSpanish, ELangSpanish, KUidTestApp) == KErrNone);
+	}
+
+
+CT_CaptionStep::~CT_CaptionStep()
+	{
+	iFs.Close();
+	iLs.Close();
+	}
+
+CT_CaptionStep::CT_CaptionStep()
+	{
+	SetTestStepName(KT_CaptionStep);
+	}
+
+/**
+@SYMTestCaseID 				APPFWK-APPARC-0087
+@SYMPREQ 					CR1787
+@SYMREQ						REQ9167
+@SYMTestCaseDesc			Tests whether the captions, icon configuration details have been retrieved properly from
+							the central repository settings and has the precedence over its resource file information.
+@SYMTestType				CIT
+@SYMTestPriority			Critical
+@SYMTestActions				A test application with its captions, icon details defined in a test central repository file
+							as well as resource file (suitable field values have been given for both cenrep and resource
+							configurations to identify it clearly).
+							Gets the information about the test application by passing its UID.
+							Check the given configuration details matches with central repository entries.
+@SYMTestExpectedResults 	The given configuration details should match with central repository entries.
+*/
+
+void CT_CaptionStep::TestIconCaptionOverridesL()
+	{
+	INFO_PRINTF1(_L("APPFWK-APPARC-0087:TestIconCaptionOverridesL started..."));
+	
+	//Change the system language to English before starting the tests
+	TRAPD(ret,ChangeLocaleL(ELangEnglish));
+	TEST(ret == KErrNone);
+				
+	TApaAppInfo appInfo;
+	//Get test app's information
+	iLs.GetAppInfo(appInfo, KUidTestIconCapOverride);
+
+	RFile file;
+	TBuf<KTextSize> fileName;
+	//Get test app's icon information
+	iLs.GetAppIcon(KUidTestIconCapOverride,file);
+	file.FullName(fileName);
+
+	//compare the captions, icon with values in CenRep file.
+	INFO_PRINTF1(_L("Compares Caption with value in CenRep..."));
+	TBuf<KTextSize> cencap(KCenRepCaption);
+	
+	INFO_PRINTF2(_L("----Expected caption==>%S"), &cencap);
+	INFO_PRINTF2(_L("----Retrieved caption==>%S"), &appInfo.iCaption);
+	TEST(appInfo.iCaption == KCenRepCaption);
+	INFO_PRINTF1(_L("Compares ShortCaption with the value in CenRep..."));
+	cencap.Zero();
+	cencap.Copy(KCenRepShortCaption);
+	
+	INFO_PRINTF2(_L("----Expected short caption==>%S"), &cencap);
+	INFO_PRINTF2(_L("----Retrieved short caption==>%S"), &appInfo.iShortCaption);
+	TEST(appInfo.iShortCaption == KCenRepShortCaption);
+	
+	INFO_PRINTF1(_L("Compares Icon file with the value in CenRep..."));
+	cencap.Zero();
+	cencap.Copy(KCenRepIconFilename);
+	INFO_PRINTF2(_L("----Expected icon filename==>%S"), &cencap);
+	INFO_PRINTF2(_L("----Retrieved icon filename==>%S"), &fileName);
+	TEST(fileName.Compare(KCenRepIconFilename)==0);
+	
+	file.Close();
+	INFO_PRINTF1(_L("APPFWK-APPARC-0087:TestIconCaptionOverridesL finished..."));
+	}	
+
+/**
+@SYMTestCaseID 				APPFWK-APPARC-0088
+@SYMPREQ 					CR1787
+@SYMREQ						REQ9167
+@SYMTestCaseDesc			Tests whether the shortcaption is set through the API has got the precedence over central
+							repository and resource file customisation.
+@SYMTestType				CIT	
+@SYMTestPriority			Critical
+@SYMTestActions				A test application with its short caption defined in central repository as well as in resource file.
+							Update the test application's short caption through API.
+							Gets the information about the test application by passing its UID.
+							Check whether the provided short caption matches with the one which has already been set through the API.
+@SYMTestExpectedResults 	It should retrieve the short caption set through the API and match with the given short caption value.
+*/
+
+void CT_CaptionStep::TestApiPrecedenceOverCenRepConfigInfoL()
+	{
+	INFO_PRINTF1(_L("APPFWK-APPARC-0088:TestApiPrecedenceOverCenRepConfigInfoL started..."));
+	_LIT(KTApiShortCaption,"APITC UK");
+	
+	TInt err = iLs.SetAppShortCaption(KTApiShortCaption, ELangEnglish, KUidTestIconCapOverride);
+	TEST(err == KErrNone);
+
+	TApaAppInfo appInfo;
+	//Get test app's information
+	iLs.GetAppInfo(appInfo, KUidTestIconCapOverride);
+	
+	TBuf<KTextSize> shortCaption(KTApiShortCaption);
+
+	//compares the short caption with the value which has been set through API.
+	INFO_PRINTF1(_L("Compares short caption with the value that has been set through API..."));
+	INFO_PRINTF2(_L("----Expected short caption==>%S"), &shortCaption);
+	INFO_PRINTF2(_L("----Retrieved short caption==>%S"), &appInfo.iShortCaption);
+	TEST(appInfo.iShortCaption == KTApiShortCaption);
+	
+	//Sets the short caption back to the actual one
+	INFO_PRINTF1(_L("Sets the short caption back to the actual one through API..."));
+	err = iLs.SetAppShortCaption(KCenRepShortCaption, ELangEnglish, KUidTestIconCapOverride);
+	TEST(err == KErrNone);
+
+	INFO_PRINTF1(_L("APPFWK-APPARC-0088:TestApiPrecedenceOverCenRepConfigInfoL finished..."));
+	}
+
+/**
+@SYMTestCaseID 				APPFWK-APPARC-0089
+@SYMPREQ 					CR1787
+@SYMREQ						REQ9167
+@SYMTestCaseDesc			Tests whether the changes made in central repository is notified by the central repository
+							observer (CApaIconCaptionCenrepObserver), which watches for changes in the Central Repository
+							and updates the overrides when they occur.
+@SYMTestType				CIT	
+@SYMTestPriority			Critical
+@SYMTestActions				A test application with its caption, icon configuration details defined in central repository file.
+							Access the central repository.
+							Update the test application short caption's value in the settings.
+							Get the information about the test application by passing its UID.
+							Check the short caption value retrieved from the central repository matches with the given information.
+@SYMTestExpectedResults 	The given new short caption value should match with the central repository entry.
+*/
+void CT_CaptionStep::TestCenRepChangeNotificationL()
+	{
+	INFO_PRINTF1(_L("APPFWK-APPARC-0089:TestCenRepChangeNotificationL started..."));
+	
+	//access central repository
+	CRepository* cenRep = CRepository::NewL(KUidIconCaptionRepository);
+	CleanupStack::PushL(cenRep);
+
+	_LIT(KCenRepSC,"CRNTC UK");	
+	TUint32 shortCapKey = 0x00000001;  // for English
+	
+	//update the short caption value in central repository.
+	TInt error = cenRep->Set(shortCapKey,KCenRepSC);
+	
+	//tests whether the process with WriteDeviceData capability can update the configuration settings.
+	TEST(error == KErrNone);
+	
+	// Force the applist to be updated (so test app gets new language settings)
+	RPointerArray<TDesC> dummy;
+	User::LeaveIfError(iLs.ForceRegistration(dummy));
+	
+	TApaAppInfo appInfo;
+	//Get test app's information
+	iLs.GetAppInfo(appInfo, KUidTestIconCapOverride);
+
+	//compare the short caption with the updated value in central repository
+	INFO_PRINTF1(_L("Compares short caption with the updated value in CenRep..."));
+	TBuf<KTextSize> shortCaption(KCenRepSC);
+	
+	INFO_PRINTF2(_L("----Expected short caption==>%S"), &shortCaption);
+	INFO_PRINTF2(_L("----Retrieved shortcaption==>%S"), &appInfo.iShortCaption);
+	TEST(appInfo.iShortCaption == KCenRepSC);
+	
+	//sets the short caption back to the actual for other tests to work
+	error = cenRep->Set(shortCapKey,KCenRepShortCaption);
+	
+	// Force the applist to be updated (so test app gets new language settings)
+	User::LeaveIfError(iLs.ForceRegistration(dummy));
+	
+	CleanupStack::PopAndDestroy(cenRep); //cenRep object
+	INFO_PRINTF1(_L("APPFWK-APPARC-0089:TestCenRepChangeNotificationL finished..."));
+	}
+
+/**
+@SYMTestCaseID 				APPFWK-APPARC-0090
+@SYMPREQ 					CR1787
+@SYMREQ						REQ9167
+@SYMTestCaseDesc			Tests whether the caption, icon configuration details have been retrieved properly from the
+							Central Repository with respect to change in system language.
+							Tests if the particular language entry is not there in the central repository file, it will
+							then try to get the information from the resource file.
+@SYMTestType				CIT	
+@SYMTestPriority			Critical
+@SYMTestActions				A multilingual test application with its caption, icon configuration details defined in central repository file.
+							Change the system language to French.
+							Gets the information about the test application by passing its UID.
+							Checks the retrieved captions, icon from Central Repository are in French.
+							Change the system language to German (the settings are not there for German in Central Repository).
+							Again gets the information about the test application by passing its UID.
+							Checks the retrieved captions, icon from the Resource file are in German.
+							Restores the system language to English.
+							Again gets the information about the test application by passing its UID.
+							Checks the retrieved captions, icon from Central Repository are in English.
+@SYMTestExpectedResults 	All the retrieved Central Repository configuration details should match with the given details by changing
+							system language.
+*/
+
+void CT_CaptionStep::TestIconCaptionOverridesWithChangeLangL()
+	{
+	INFO_PRINTF1(_L("APPFWK-APPARC-0090:TestIconCaptionOverridesWithChangeLangL started..."));
+	
+	TInt ret = 0;
+	//French
+	_LIT(KCaptionFrench, "CRTstCap FR");
+	_LIT(KShortCaptionFrench, "CRTC FR");
+	_LIT(KIconFilenameFrench, "Z:\\resource\\apps\\svg_icon.svg");
+
+	//German
+	_LIT(KCaptionGerman, "TstCap GE");
+	_LIT(KShortCaptionGerman, "TC GE");
+	_LIT(KIconFilenameGerman, "Z:\\resource\\apps\\ticoncapoverride.mbm");
+
+	TApaAppInfo appInfo;
+	RFile file;
+	TBuf<KTextSize> fileName;
+		
+	// Change the locale to French
+	INFO_PRINTF1(_L("Change the locale to French..."));
+	TRAP(ret,ChangeLocaleL(ELangFrench));
+	TEST(ret == KErrNone);
+	INFO_PRINTF2(_L("----System Language==>%d"), User::Language());
+	
+	TEST(User::Language() == ELangFrench);//check language is set to French.
+	
+	// Force the applist to be updated (so test app gets new language settings)
+	RPointerArray<TDesC> dummy;
+	User::LeaveIfError(iLs.ForceRegistration(dummy));
+	
+	//Get test app's information
+	iLs.GetAppInfo(appInfo, KUidTestIconCapOverride);
+
+	//Get test app's icon information
+	iLs.GetAppIcon(KUidTestIconCapOverride,file);
+	file.FullName(fileName);
+	
+	TBuf<KTextSize> printString(KCaptionFrench);
+	
+	//compare the captions, icon in French with the value in central repository
+	INFO_PRINTF1(_L("Compares Caption with value in CenRep..."));
+	INFO_PRINTF2(_L("----Exepcted Caption in French==>%S"), &printString);
+	INFO_PRINTF2(_L("----Retrieved Caption==>%S"), &appInfo.iCaption);	
+	TEST(appInfo.iCaption == KCaptionFrench);
+	
+	INFO_PRINTF1(_L("Compares Short Caption with value in CenRep..."));
+	printString.Zero();
+	printString.Copy(KShortCaptionFrench);
+	INFO_PRINTF2(_L("----Expected short caption in French==>%S"), &printString);
+	INFO_PRINTF2(_L("----Retrieved short caption==>%S"), &appInfo.iShortCaption);
+	TEST(appInfo.iShortCaption == KShortCaptionFrench);
+	
+	INFO_PRINTF1(_L("Compares Icon filename with value in CenRep..."));
+	printString.Zero();
+	printString.Copy(KIconFilenameFrench);
+	INFO_PRINTF2(_L("----Expected icon filename in French==>%S"), &printString);
+	INFO_PRINTF2(_L("----Retrieved icon filename==>%S"), &fileName);
+	TEST(fileName.Compare(KIconFilenameFrench)==0);
+	
+	//Change the locale to German.
+	INFO_PRINTF1(_L("Change the locale to German..."));
+	TRAP(ret,ChangeLocaleL(ELangGerman));
+	TEST(ret == KErrNone);
+	INFO_PRINTF2(_L("----System Language==>%d"), User::Language());
+	TEST(User::Language() == ELangGerman);//check language is set to German.
+	
+	// Force the applist to be updated (so test app gets new language settings)
+	User::LeaveIfError(iLs.ForceRegistration(dummy));
+	
+	//Get test app's information
+	iLs.GetAppInfo(appInfo, KUidTestIconCapOverride);
+
+	file.Close();
+	//Get test app's icon information
+	iLs.GetAppIcon(KUidTestIconCapOverride,file);
+	
+	fileName.Zero();
+	file.FullName(fileName);
+	
+	// The entry for language German is not there in Central repository so it compares
+	// the captions, icon in this language with the values in resource file.
+	INFO_PRINTF1(_L("Compares Caption with value in Resource file..."));
+	printString.Zero();
+	printString.Copy(KCaptionGerman);
+	INFO_PRINTF2(_L("----Expected caption in German==>%S"), &printString);
+	INFO_PRINTF2(_L("----Retrieved caption==>%S"), &appInfo.iCaption);
+	TEST(appInfo.iCaption == KCaptionGerman);
+	
+	INFO_PRINTF1(_L("Compares short caption with value in Resource file..."));
+	printString.Zero();
+	printString.Copy(KShortCaptionGerman);
+	INFO_PRINTF2(_L("----Expected short caption in German==>%S"), &printString);
+	INFO_PRINTF2(_L("----Retrieved short caption==>%S"), &appInfo.iShortCaption);
+	TEST(appInfo.iShortCaption == KShortCaptionGerman);
+	
+	INFO_PRINTF1(_L("Compares icon filename with value in Resource file..."));
+	printString.Zero();
+	printString.Copy(KIconFilenameGerman);
+	INFO_PRINTF2(_L("----Expected icon filename in German==>%S"), &printString);
+	INFO_PRINTF2(_L("----Retrieved icon filename==>%S"), &fileName);
+	TEST(fileName.Compare(KIconFilenameGerman)==0);
+
+	// Change the locale to English for changing the settings back to the original
+	INFO_PRINTF1(_L("Change the locale back to English..."));
+	TRAP(ret,ChangeLocaleL(ELangEnglish));
+	TEST(ret == KErrNone);
+	INFO_PRINTF2(_L("----System Language==>%d"), User::Language());
+	
+	TEST(User::Language() == ELangEnglish);//check language is set to English.
+	
+	// Force the applist to be updated (so test app gets new language settings)
+	User::LeaveIfError(iLs.ForceRegistration(dummy));
+	
+	//Get test app's information
+	iLs.GetAppInfo(appInfo, KUidTestIconCapOverride);
+
+	file.Close();
+	//Get test app's icon information
+	iLs.GetAppIcon(KUidTestIconCapOverride,file);
+
+	fileName.Zero();
+	file.FullName(fileName);
+	
+	//compare the captions, icon in English with the value in central repository
+	INFO_PRINTF1(_L("Compares Caption with value in CenRep..."));
+	printString.Zero();
+	printString.Copy(KCenRepCaption);
+	INFO_PRINTF2(_L("----Expected caption in English==>%S"), &printString);
+	INFO_PRINTF2(_L("----Retrieved caption==>%S"), &appInfo.iCaption);
+	TEST(appInfo.iCaption == KCenRepCaption);
+	
+	INFO_PRINTF1(_L("Compares short caption with value in CenRep..."));
+	printString.Zero();
+	printString.Copy(KCenRepShortCaption);
+	INFO_PRINTF2(_L("----Expected short caption==>%S"), &printString);
+	INFO_PRINTF2(_L("----Retrieved short caption==>%S"), &appInfo.iShortCaption);
+	
+	TEST(appInfo.iShortCaption == KCenRepShortCaption);
+	INFO_PRINTF1(_L("Compares icon filename with value in CenRep..."));
+	printString.Zero();
+	printString.Copy(KCenRepIconFilename);
+	INFO_PRINTF2(_L("----Expected icon filename==>%S"), &printString);
+	INFO_PRINTF2(_L("----Retrieved icon filename==>%S"), &fileName);
+	TEST(fileName.Compare(KCenRepIconFilename)==0);
+	
+	INFO_PRINTF1(_L("APPFWK-APPARC-0090:TestIconCaptionOverridesWithChangeLangL finished..."));
+	}
+		
+/**
+@SYMTestCaseID 				APPFWK-APPARC-0091
+@SYMPREQ 					CR1787
+@SYMREQ						REQ9167
+@SYMDEF						DEF125262
+@SYMTestCaseDesc			Checks there is no memory leaks when CApaIconCaptionOverridesForApp & CApaIconCaptionCenrepObserver
+							objects are created and destroyed.
+@SYMTestType				CIT	
+@SYMTestPriority			Critical
+@SYMTestActions				Marks the Heap memory
+							Invokes the static method 'TestIconCaptionOverridesL()' defined in 'ticonloaderandiconarrayforleaks.dll',
+							that creates objects of CApaIconCaptionOverridesForApp, CApaIconCaptionCenrepObserver and deletes those.
+							And then tests, there is no memory leak from the creation to destruction of those objects.
+@SYMTestExpectedResults 	There should be no memory leaks.
+*/
+
+void CT_CaptionStep::TestIconCaptionOverridesMemoryLeaksL()
+	{
+	INFO_PRINTF1(_L("APPFWK-APPARC-0091:TestIconCaptionOverridesMemoryLeaksL started..."));
+	__UHEAP_MARK;
+	TIconLoaderAndIconArrayForLeaks::TestIconCaptionOverridesL();
+	__UHEAP_MARKEND;
+	INFO_PRINTF1(_L("APPFWK-APPARC-0091:TestIconCaptionOverridesMemoryLeaksL finished..."));
+	}
+
+void CT_CaptionStep::DoIconCaptionOverridesTestL()
+	{
+	TestIconCaptionOverridesL();
+	TestIconCaptionOverridesWithChangeLangL();
+	TestCenRepChangeNotificationL();
+	TestIconCaptionOverridesMemoryLeaksL();
+	TestApiPrecedenceOverCenRepConfigInfoL();
+	}
+	
+TVerdict CT_CaptionStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test T_Caption step started....\n"));
+
+	// Connect to Servers
+	TEST(iFs.Connect() == KErrNone);
+	TEST(iLs.Connect() == KErrNone);
+
+	// run language tests for the test caption
+	TRAPD(r, DoLanguageTestL());
+	TEST(r==KErrNone);
+	INFO_PRINTF2(_L("DoLanguageTestL() finished with value '%d'\n"), r);
+	
+	// run icon caption overrides tests
+/*	TRAP(r, DoIconCaptionOverridesTestL());
+	TEST(r==KErrNone);
+	INFO_PRINTF2(_L("DoIconCaptionOverridesTestL() finished with value '%d'\n"), r); */
+
+	// run shortcaption setting tests
+/*	TRAP(r, DoShortCaptionTestL());
+	TEST(r==KErrNone);
+	INFO_PRINTF2(_L("DoShortCaptionTestL() finished with value '%d'\n"), r); */
+
+
+	INFO_PRINTF1(_L("....test T_Caption step finished!"));
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_CaptionStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,71 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+#if (!defined __T_CAPTION_STEP_H__)
+#define __T_CAPTION_STEP_H__
+
+
+#include <s32file.h>
+#include <apgnotif.h>
+#include "ApparcTestServer.h"
+#include "testableapalssession.h"
+
+
+ 
+/////////////////////////////////////////////////////////////////////////////////
+//
+//		CT_CaptionStep definition
+//
+/////////////////////////////////////////////////////////////////////////////////
+
+
+class CT_CaptionStep :public CTestStep
+	{
+public:
+	CT_CaptionStep();
+	~CT_CaptionStep();
+	virtual TVerdict doTestStepL();
+private:
+	void DoLanguageTestL();
+	void DoShortCaptionTestL();
+	void ChangeLocaleL(TLanguage aLanguage);
+	void DoIconCaptionOverridesTestL();
+private:
+	void TestTApaAppInfoStreamsL();
+	void TestTApaAppInfoL();
+	void TestCApaDoorL();
+	void TestCApaSystemControlListL();
+	void TestIconCaptionOverridesL();
+	void TestApiPrecedenceOverCenRepConfigInfoL();
+	void TestCenRepChangeNotificationL();
+	void TestIconCaptionOverridesWithChangeLangL();
+	void TestIconCaptionOverridesMemoryLeaksL();
+private:
+	RFs iFs;
+	RTestableApaLsSession iLs;
+	};
+
+_LIT(KT_CaptionStep,"T_Caption");
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_CmdlnStep.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,677 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Test CApaCommandLine Apis\n
+// Test CApaCommandLine API by setting launching information and
+// checking setter and getter function.\n
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include "T_CmdlnStep.h"
+#include "testableapalssession.h"
+
+ /**
+   @SYMTestCaseID T-CmdlnStep-testSecureCmdLinesL
+  
+   @SYMPREQ 280 - File Handle Support
+  
+   @SYMTestCaseDesc Tests CApaCommandLine Apis. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+  
+   
+   @SYMTestActions .
+   Observe the operation that is executed on each command.\n
+   Test the following accessor functions:\n
+   CApaCommandLine::ExecutableName()\n
+   CApaCommandLine::Command()\n
+   CApaCommandLine::DocumentName()\n
+   CApaCommandLine::TailEnd()\n
+   CApaCommandLine::ServerId()\n
+   CApaCommandLine::SessionHandle()\n
+   CApaCommandLine::SubSessionHandle()\n
+   Check whether each of these getter functions return the individual components.\n\n
+   Test the following setter functions:\n
+   CApaCommandLine::SetExecutableNameL()\n
+   CApaCommandLine::SetCommandL()\n
+   CApaCommandLine::SetDocumentNameL()\n
+   CApaCommandLine::SetTailEndL()\n
+   CApaCommandLine::SetServerId()\n
+   CApaCommandLine::SetSessionHandle()\n
+   CApaCommandLine::SetSubSessionHandle()\n
+   Use the setter functions to set the individual components. Use the
+   getter methods to verify values set to the individual components.\n
+   API Calls:\n	
+   CApaCommandLine::NewL(const RMessagePtr2& aMessage)\n 
+   CApaCommandLine::ExecutableName() const\n
+   CApaCommandLine::Command() const\n
+   CApaCommandLine::DocumentName() const\n
+   CApaCommandLine::TailEnd() const\n
+   CApaCommandLine::TailEnd() const\n
+   CApaCommandLine::ServerId() const\n
+   CApaCommandLine::SessionHandle() const\n
+   CApaCommandLine::SubSessionHandle() const\n
+   CApaCommandLine::EnviromentSlotsReaderL()\n
+   CApaCommandLine::SetExecutableNameL(const TDesC& aAppName)\n
+   CApaCommandLine::SetCommandL(TApaCommand aCommand)\n
+   CApaCommandLine::SetDocumentNameL(const TDesC& aDocName)\n
+   CApaCommandLine::SetTailEndL(const TDesC8& aTailEnd)\n
+   CApaCommandLine::SetServerId(TInt aServerId)\n
+   CApaCommandLine::SetSessionHandle(TInt aSessionHandle)\n
+   CApaCommandLine::SetSubSessionHandle(TInt aSubSessionHandle)\n
+   CApaCommandLine::SetProcessEnvironmentL(RProcess& aProcess) const\n
+  
+   
+  
+   @SYMTestExpectedResults Tests checks results against desired results.
+    
+ */
+ void CT_CmdlnStep::testSecureCmdLinesL()
+ 	{
+ 	RTestableApaLsSession ls;
+ 	TEST(KErrNone == ls.Connect());
+ 	CleanupClosePushL(ls);
+ 	
+ 	testPositiveInputsL();
+	testInitializationL();
+	testBoundaryConditionsL();
+	//DONT_CHECK since type store is updated
+    HEAP_TEST_LS_SESSION(ls, 0, DONT_CHECK, testRecAppLaunchL(ls), NO_CLEANUP);
+    
+    CleanupStack::PopAndDestroy(&ls);
+ 	}
+
+/**
+   Auxiliary function for TestCaseID T-CmdlnStep-testSecureCmdLinesL
+  
+  
+   @SYMPREQ 280 - File Handle Support
+  
+    Call the Set APIs below with valid inputs
+    CApaCommandLine::SetExecutableNameL(appName);
+    CApaCommandLine::SetDocumentNameL(docName);
+    CApaCommandLine::SetTailEndL(tailEnd);
+    CApaCommandLine::SetFileByHandleL(aFile);
+    CApaCommandLine::SetCommandL(command);
+    
+    Compares the values set by the above APIs with those obtained by the GET APIs mentioned below
+    CApaCommandLine::ExecutableName());
+    CApaCommandLine::DocumentName());
+    CApaCommandLine::TailEnd());
+    CApaCommandLine::GetFileByHandleL();
+    CApaCommandLine::Command());
+	
+  
+ */
+void CT_CmdlnStep::testPositiveInputsL()
+	{
+	TPtrC appName;
+	TPtrC docName;
+	TApaCommand command = EApaCommandRun;
+	TPtrC8  tailEnd;
+	TEntry dirEntry;
+	RFs fSession;
+	RFile file;
+	
+	INFO_PRINTF1(_L("Tests the Set and Get command line APIs  for valid inputs"));	
+	CApaCommandLine* cmdLine=CApaCommandLine::NewLC(); // start with an empty command line
+	
+	appName.Set(KTAppName);
+	docName.Set(KTDocName);
+	tailEnd.Set(KTTailEnd);
+	
+	User::LeaveIfError(fSession.Connect());
+	//User::LeaveIfError(fSession.ShareProtected());	
+	INFO_PRINTF1(_L("Check for the existence of C:\\System\\Data Directory"));	
+	TInt ret = fSession.Entry(KTempDir,dirEntry);	
+	if(ret==KErrNotFound)
+	{
+		INFO_PRINTF1(_L("Create C:\\System\\Data Directory if not existing already"));
+		fSession.MkDir(KTempDir); /* Create Data Directory as it does not exist  */				
+	}	
+	User::LeaveIfError(file.Replace(fSession, KTDocName, EFileStreamText|EFileShareAny));
+	User::LeaveIfError(file.Write(KTWriteData));//write some test data
+	
+	INFO_PRINTF1(_L("The Set command line APIs  are invoked with valid arguments"));	
+	// Set the member variables using the Set functions
+	
+	TRAP(ret,
+		{ 
+		cmdLine->SetExecutableNameL(appName);
+		cmdLine->SetDocumentNameL(docName);
+		cmdLine->SetTailEndL(tailEnd);
+		cmdLine->SetFileByHandleL(file);
+		cmdLine->SetCommandL(command);
+		} )
+		
+	TEST(KErrNone==ret);
+	
+	if(KErrNone==ret)
+		{
+		INFO_PRINTF1(_L("The Get command line APIs  are invoked and their return values are verified"));	
+		//Test the values returned by the Get Functions
+		TEST(appName==cmdLine->ExecutableName());
+		TEST(docName==cmdLine->DocumentName());
+		TEST(tailEnd==cmdLine->TailEnd());	
+	
+		RFile tempFile;
+		TBuf8<10> readData;
+		TRAP(ret,cmdLine->GetFileByHandleL(tempFile));
+		TEST(KErrNone==ret);
+		if(KErrNone==ret)
+			{
+			tempFile.Read(0,readData);//file still open so rewind file pointer
+			TEST(readData==KTWriteData);
+			}
+		}
+	
+	file.Close();
+	fSession.Close();	
+	//fSession.Delete(KTDocName);
+	CleanupStack::PopAndDestroy(cmdLine); 
+
+	}
+
+
+/**
+    Auxiliary function for TestCaseID T-CmdlnStep-testSecureCmdLinesL
+  
+    @SYMPREQ 280 - File Handle Support
+  
+    Tests the initial values of the member variables 
+  
+    Following are the SET APIs tested 
+    CApaCommandLine::SetExecutableNameL(appName);
+    CApaCommandLine::SetDocumentNameL(docName);
+    CApaCommandLine::SetTailEndL(tailEnd);
+    CApaCommandLine::SetSessionHandle(TInt aSessionHandle);
+    CApaCommandLine::SetSubSessionHandle(TInt aSubSessionHandle);
+    CApaCommandLine::SetServerIdL(TInt serverId);
+    CApaCommandLine::SetCommandL(command);
+    
+    Compares the values set with those obtained by the GET APIs
+    CApaCommandLine::ExecutableName();
+    CApaCommandLine::DocumentName();
+    CApaCommandLine::TailEnd();
+    CApaCommandLine::ServerId();
+    CApaCommandLine::SessionHandle();
+    CApaCommandLine::SubSessionHandle();
+    CApaCommandLine::Command();
+  
+    Following Scenarios are tested
+   
+    1. Do not set the values and check the values returned by the GET APIs
+    2. Set Application Name and check all the values returned by the GET APIs
+    3. Set AppName,DocName  and check all the values returned by the GET APIs
+    4. Set AppName,DocName,Tailend  and check all the values returned by the GET APIs
+    5. Set AppName,DocName,Tailend,Serverid and check all the values returned by the GET APIs  
+    6. Set AppName,DocName,Tailend,Serverid,sessionId and check all the values returned by the GET APIs  
+    7. Set AppName,DocName,Tailend,Serverid,sessionId and subsessionId and check all the values returned by the GET APIs  
+ */
+
+void CT_CmdlnStep::testInitializationL()
+	{
+	
+	TPtrC appName(KNullDesC);
+	TPtrC docName(KNullDesC);
+	TApaCommand cmdType = EApaCommandRun;//CApaCommandLine's initial value
+	TPtrC8  tailEnd(KNullDesC8);
+	RFs fSession;
+	RFile file;
+	TEntry dirEntry;
+		
+	CApaCommandLine* cmdLine=CApaCommandLine::NewLC(); // start with an empty command line
+
+	for(TInt index = 0; index < TEST_SET_APIS-1; index++)
+    	{
+    	switch(index)
+    		{
+    		case TEST_INITIALIZATION:
+    			INFO_PRINTF1(_L("Tests the initial values of the member data"));
+    			break;
+    		case TEST_APP:
+    			INFO_PRINTF1(_L("Setting Application Name to \"app name\"."));
+				appName.Set(KTAppName);
+				cmdLine->SetExecutableNameL(appName);
+    			break;
+    		case TEST_DOC:
+    			INFO_PRINTF1(_L("Setting document name to \"doc name\"."));
+				docName.Set(KTDocName);
+				cmdLine->SetDocumentNameL(docName);
+    			break;
+    		case TEST_TAILEND:
+    			INFO_PRINTF1(_L("Setting tail end to \"tail end \"."));
+				tailEnd.Set(KTTailEnd);
+				cmdLine->SetTailEndL(tailEnd);
+    			break;
+    		case TEST_COMMAND:
+    			INFO_PRINTF1(_L("Setting tail end to \"command type \"."));
+    			cmdType=EApaCommandOpen;//any update to the command value 
+    			cmdLine->SetCommandL(cmdType);
+    			break;
+    		case TEST_FILE_HANDLE:
+    			{
+    			INFO_PRINTF1(_L("Setting file handle name to \"handle name\"."));
+    			User::LeaveIfError(fSession.Connect());
+				User::LeaveIfError(fSession.ShareProtected());	
+				INFO_PRINTF1(_L("Check for the existence of C:\\System\\Data Directory"));	
+				TInt ret = fSession.Entry(KTempDir,dirEntry);	
+				if(ret==KErrNotFound)
+					{
+					INFO_PRINTF1(_L("Create C:\\System\\Data Directory if not existing already"));	
+					}	
+				User::LeaveIfError(file.Replace(fSession, KTDocName, EFileStreamText|EFileShareAny));
+    			TRAP(ret,cmdLine->SetFileByHandleL(file));
+    			TEST(KErrNone==ret);
+    			break;
+    			}
+    		default:
+    			break;
+    		}
+    		
+    		INFO_PRINTF1(_L("The Get command line APIs  are invoked and their return values are verified"));	
+    
+    		//Test the values returned by the Get Functions
+    		TEST(appName==cmdLine->ExecutableName());
+			TEST(docName==cmdLine->DocumentName());
+			TEST(tailEnd==cmdLine->TailEnd());
+			TEST(cmdType==cmdLine->Command());
+			
+			RFile testFile;
+			TRAPD(ret,cmdLine->GetFileByHandleL(testFile));
+			TEST(KErrNone==ret);
+			if(KErrNone==ret)
+				{	//this test relies on TEST_FILE_HANDLE being the last case in the case statement 
+					if(index==TEST_FILE_HANDLE)
+						{//not equal when initialised
+						TEST(file.SubSessionHandle()!=testFile.SubSessionHandle());	
+						}
+						else
+						{//equal when uninitialised
+						TEST(file.SubSessionHandle()==testFile.SubSessionHandle());
+						}
+				}			
+       	}
+    	
+    file.Close();
+	fSession.Close();	
+	//fSession.Delete(KTDocName);
+    CleanupStack::PopAndDestroy(cmdLine); 
+    
+    }
+
+/**
+    Auxiliary function for TestCaseID T-CmdlnStep-testSecureCmdLinesL
+  
+    @SYMPREQ 280 - File Handle Support
+  
+    Tests CApaCommandLine Apis. 
+   
+    Tests the Boundary values of the member variables like Null descriptors and zero for integer member variables
+    Also test negative values for the integer member variables
+    
+    CApaCommandLine::SetExecutableNameL(appName);
+    CApaCommandLine::SetDocumentNameL(docName);
+    CApaCommandLine::SetTailEndL(tailEnd);
+    CApaCommandLine::SetCommandL(command);
+    
+    Compares the values set with those obtained by the GET APIs
+    CApaCommandLine::ExecutableName());
+    CApaCommandLine::DocumentName());
+    CApaCommandLine::TailEnd());
+    CApaCommandLine::Command());
+  
+    Following Scenarios are tested
+   
+    1. Set AppName,DocName and Tailend to Null descriptors and check the values returned by the corresponding
+       GET APIs
+ */
+
+void CT_CmdlnStep::testBoundaryConditionsL()
+	{
+		
+	TPtrC appName(KNullDesC);
+	TPtrC docName(KNullDesC);
+	TPtrC8 tailEnd;
+	
+	CApaCommandLine* cmdLine = CApaCommandLine::NewLC(); // start with an empty command line
+	
+	INFO_PRINTF1(_L("TEST APIS WITH BOUNDARY CONDITIONS\n"));
+	
+	//Set the member variables 
+	cmdLine->SetExecutableNameL(appName);
+	cmdLine->SetDocumentNameL(docName);
+	tailEnd.Set(KTNullTail);
+	cmdLine->SetTailEndL(tailEnd);
+				
+	// Check the values returned by the Get Functions		
+	TEST(appName==cmdLine->ExecutableName());
+	TEST(docName==cmdLine->DocumentName());
+	TEST(tailEnd==cmdLine->TailEnd());
+	
+	CleanupStack::PopAndDestroy(cmdLine); 
+    
+    }
+
+/**
+   Auxiliary function for TestCaseID T-CmdlnStep-testSecureCmdLinesL
+  
+   @SYMPREQ 280 - File Handle Support
+  
+   Tests CApaCommandLine Apis. 
+  
+   The functions tests positive and negative test scenarios for API 
+   TInt RApaLsSession::StartDocument(const TDesC& aFileName, RFs& aFSession, RFile& aFile, TThreadId& aThreadId) 
+    
+   The test case opens a document "temp.test" with datatype "test/plain" which is recognized by TESTREC.
+   T_EnvSlots.exe is application mapped to the this data type using InsertDataMappingL function.
+   When the file is opened using StartDocument the application is launched which verifies the environment slots 
+   of the launched application to those set.
+   
+   
+ */
+ 
+void CT_CmdlnStep::testRecAppLaunchL(RApaLsSession& aLs)
+	{
+
+	TThreadId startAppThreadID;
+	RFs fSession;
+	RFile file;
+	TDataType dataType(KTDataType);
+	TEntry dirEntry;
+		
+	User::LeaveIfError(fSession.Connect());
+	User::LeaveIfError(fSession.ShareProtected());
+	
+	INFO_PRINTF1(_L("Check for the existence of C:\\System\\Data Directory"));	
+	TInt ret = fSession.Entry(KTempDir,dirEntry);
+	
+	if(ret==KErrNotFound)
+	{
+		INFO_PRINTF1(_L("Create C:\\System\\Data Directory if not existing already"));	
+	}
+	
+	User::LeaveIfError(file.Replace(fSession, KTDocName, EFileStreamText|EFileShareAny));
+	User::LeaveIfError(file.Write(KTWriteData));
+		
+	//Create A Global mutex to control the access to the logfile
+	
+	RMutex fileAccess;
+	fileAccess.CreateGlobal(KTLogFileAccess);
+	
+	INFO_PRINTF1(_L("Start Valid Document of Data type : test"));
+	
+	TUid uid;
+	uid.iUid = (0x102032AB);
+	ret = aLs.InsertDataMapping(dataType, KDataTypePriorityHigh, uid);
+	TEST(ret==KErrNone);
+	if(ret == KErrNone)
+		{
+		INFO_PRINTF1(_L("InsertDataMapping API call successful"));
+		}
+	else 
+		{
+		INFO_PRINTF1(_L("InsertDataMapping API call failed"));
+		}
+	
+	ret = aLs.StartDocument(file,startAppThreadID);
+	TEST(ret==KErrNone);
+	if(ret == KErrNone)
+		{
+		INFO_PRINTF1(_L("Start Document API call successful"));
+		}
+	else 
+		{
+		INFO_PRINTF1(_L("Start Document API call failed"));
+		}
+		
+	// Make the process sleep in order to launch T_EnvSlots
+	User::After(KOneSecond);
+	
+	// Wait for the Mutex for log file access
+	fileAccess.Wait();
+	TBufC<KMaxFilePath> filePath(KEnvFilePath);
+	RFile logFile;
+	
+	INFO_PRINTF1(_L("File Access Mutex obtained"));
+	
+	//Open the logfile in the readmode	
+	User::LeaveIfError(logFile.Open(fSession,filePath,EFileRead));
+	
+	INFO_PRINTF1(_L("Env Log File Open successful"));
+				
+	TBuf8<8> expected(KTPass);
+	TBuf8<8> obtained;
+	TBuf8<8> failReason;		
+	
+	// Read from the logfile
+	User::LeaveIfError(logFile.Read(obtained));
+	
+	INFO_PRINTF1(_L("Env Log File Read successful"));
+		
+	TEST(expected==obtained);
+	
+	if(expected == obtained)
+	{
+		INFO_PRINTF1(_L("Environment slots verification Passed"));
+	}
+	else {
+		// Read up to the end of the file to log all the failures
+		do
+		{
+			// Read the environment slot whose verification failed 
+			logFile.Read(failReason);
+			
+			if(failReason == KTApp)
+			{
+				INFO_PRINTF1(_L("Environment slot verification failed for Application Name"));
+			}
+			else if(failReason == KTDoc)
+			{
+				INFO_PRINTF1(_L("Environment slot verification failed for Document Name"));
+			}
+			else if(failReason == KTServer)
+			{
+				INFO_PRINTF1(_L("Environment slot verification failed for Server Id"));
+			}
+			else if(failReason == KTCommand)
+			{
+				INFO_PRINTF1(_L("Environment slot verification failed for Command"));
+			}
+			
+			// Skip the "TestFail" text
+			logFile.Read(failReason);
+			
+			//Exit the loop if end of the file 
+			if(failReason.Length() == 0)
+				break;
+			
+		} while(ETrue);
+	}
+	
+	ret = aLs.DeleteDataMapping(dataType);
+	TEST(ret==KErrNone);
+	if(ret == KErrNone)
+		{
+		INFO_PRINTF1(_L("DeleteDataMapping API call successful"));
+		}
+	else 
+		{
+		INFO_PRINTF1(_L("DeleteDataMapping API call failed"));
+		}
+		
+	ret = aLs.StartDocument(file,startAppThreadID);
+	TEST(ret==KErrNotFound);
+	if(ret == KErrNotFound)
+		{
+		INFO_PRINTF1(_L("Start Document API call with expected failure successful"));
+		}
+	else 
+		{
+		INFO_PRINTF1(_L("Start Document API call with expected failure failed"));
+		}
+	
+	logFile.Close();
+		
+	// Test on Invalid Document Name, Invalid File Session and Invalid File Args removed
+	// This test was invalid & panics
+		
+	file.Close();
+	fSession.Close();	
+	//fSession.Delete(KTDocName);
+	fileAccess.Close();
+		
+	}
+
+/**
+   @SYMTestCaseID CT-CmdlnStep-testCmdLinesAPIsL()
+  
+   @SYMPREQ
+
+   @SYMTestCaseDesc Command line APIs to be properly tested 
+ 
+   @SYMTestActions CApaCommandLine::NewLC() is called to create a commandline object;CApaCommandLineSetFileByHandleL() is called to set the file session and file handle; RProcess::Create is called to create a new process to launch the exe;
+   CApaCommandLine::SetProcessEnvironmentL is called to initialise the parameters of the child process; CApaCommandLine::GetCommandLineFromProcessEnvironment is
+   called by the child process to get the commandline object created by the parent process; In order to be able to read the file, CApaCommandLine::GetFileByHandleL is called by the child process
+   to get the file handle created by the parent process. 
+   
+   API Calls:static CApaCommandLine* NewLC();
+ 			 void SetProcessEnvironmentL(RProcess& aProcess) const;
+ 			 static TInt GetCommandLineFromProcessEnvironment(CApaCommandLine*& aCommandLine);
+ 			 void SetFileByHandleL(const RFile& aFile);
+			 void GetFileByHandleL(RFile& aFile) const;
+   
+   @SYMTestExpectedResults Returns an integer value (99) if no exception occurs else return system wide errors.
+    
+ */	
+void CT_CmdlnStep::testCmdLinesAPIsL()
+	{
+	INFO_PRINTF1(_L("Start test testCmdLinesAPIsL ..."));
+	RFs fs;
+	RFile file;	
+	RProcess process; 
+	TInt ret(0);
+	_LIT(KFileName, "z:\\system\\data\\one_byte.txt"); //the file to be read by the process
+	_LIT(KExeName, "TCmdLineExe"); //exe that is created for this test case
+	TRequestStatus status;
+   
+	ret = fs.Connect();
+	TEST(ret==KErrNone);	
+	CleanupClosePushL(fs);
+	ret = fs.ShareProtected();		
+	TEST(ret==KErrNone);	
+	ret = file.Open(fs, KFileName, EFileRead|EFileShareAny); //open for read
+	TEST(ret==KErrNone);
+	CleanupClosePushL(file);
+	if(ret == KErrNone)		
+		{
+		CApaCommandLine* cmdLine=CApaCommandLine::NewLC();
+		ret = process.Create(KExeName, KNullDesC);
+		CleanupClosePushL(process);
+		TEST(ret==KErrNone);
+		if(ret==KErrNone)
+			{
+			TRAP(ret,cmdLine->SetFileByHandleL(file));
+			TEST(ret==KErrNone);
+			if(ret==KErrNone)
+				{
+				TRAP(ret,cmdLine->SetProcessEnvironmentL(process));	
+				TEST(ret==KErrNone);
+				if(ret==KErrNone)
+					{
+					status = KRequestPending;
+					process.Logon(status);
+					process.Resume();
+					User::WaitForRequest(status); 	
+					}
+				TEST(status.Int()==KFileHandleTestPassed);
+				}
+			}	
+		
+		CleanupStack::PopAndDestroy(&process);
+		CleanupStack::PopAndDestroy(cmdLine);
+		}
+	CleanupStack::PopAndDestroy(2);
+	TEST(ret==KErrNone);	
+	}
+
+
+	
+CT_CmdlnStep::~CT_CmdlnStep()
+/**
+   Destructor
+ */
+	{
+	}
+
+CT_CmdlnStep::CT_CmdlnStep()
+/**
+   Constructor
+ */
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_CmdlnStep);
+	}
+
+TVerdict CT_CmdlnStep::doTestStepPreambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	SetTestStepResult(EPass);
+	return TestStepResult();
+	}
+
+TVerdict CT_CmdlnStep::doTestStepPostambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	return TestStepResult();
+	}
+
+
+// need to also test CApaCommandLine - SetServerNotRequiredL/SetServerRequiredL/ServerRequired
+
+TVerdict CT_CmdlnStep::doTestStepL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+{
+	INFO_PRINTF1(_L("Test setting full command lines"));
+
+	// run the testcode (inside an alloc heaven harness)
+
+	__UHEAP_MARK;
+	TRAPD(ret,testSecureCmdLinesL());
+	TEST(ret==KErrNone);
+
+	TRAP(ret,testCmdLinesAPIsL());
+	TEST(ret==KErrNone);
+	__UHEAP_MARKEND;
+
+	INFO_PRINTF1(_L("Test completed!"));
+	return TestStepResult();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_CmdlnStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,95 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code  
+*/
+
+#if (!defined __T_CMDLN_STEP_H__)
+#define __T_CMDLN_STEP_H__
+
+#include <e32std.h>
+#include <e32base.h>
+#include <e32uid.h>
+#include <e32cmn.h>
+#include <f32file.h>
+#include <e32test.h>
+#include <apacmdln.h>
+#include <apgcli.h>
+#include "ApparcTestServer.h"
+#include <apparc.h>
+
+//!  A CT_CmdlnStep test class. 
+/**
+  Test CApaCommandLine Apis.
+*/
+class CT_CmdlnStep : public CTestStep
+	{
+public:
+	CT_CmdlnStep();
+	~CT_CmdlnStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+
+	void testSecureCmdLinesL();
+	void testBoundaryConditionsL();
+	void testInitializationL();
+	void testPositiveInputsL();
+	void testRecAppLaunchL(RApaLsSession& aLs);
+	void testCmdLinesAPIsL();
+	
+	};
+
+_LIT(KT_CmdlnStep,"T_Cmdln");
+
+
+#define TEST_INITIALIZATION   0
+#define TEST_APP              1  
+#define TEST_DOC              2
+#define TEST_TAILEND          3
+#define TEST_COMMAND		  4
+#define TEST_FILE_HANDLE	  5
+
+#define TEST_SET_APIS         7
+
+_LIT(KTLogFileAccess,"TestLogFile");
+_LIT(KEnvFilePath,"c:\\Logs\\TestExecute\\EnvSlots.txt");
+
+_LIT(KTAppName,"Z:\\sys\\bin\\T_EnvSlots.exe");
+_LIT(KTDocName,"C:\\System\\data\\temp.test");
+_LIT(KTempDir,"C:\\System\\data\\");
+_LIT(KTNoDocName,"C:\\Logs\\TestExecute\\NotFound.aaa");
+
+_LIT8(KTTailEnd,"TailEnd");
+_LIT8(KTNullTail,"");
+_LIT8(KTDataType,"test/plain");
+_LIT8(KTWriteData,"Support");
+_LIT8(KTPass,"TestPass");
+_LIT8(KTFail,"TestFail");
+_LIT8(KTApp,"ApplName");
+_LIT8(KTDoc,"DocuName");
+_LIT8(KTServer,"ServerId");
+_LIT8(KTCommand,"ECommand");
+
+const TInt KEnvThirdUidValue = 0x102032AB; 
+const TInt KOneSecond = 1000000;
+const TInt KMaxFilePath = 50;
+const TInt KFileHandleTestPassed = 99;
+
+#endif //__T_CMDLN_STEP_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_ControlPanelTest.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,502 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Tests control panel Application Apparc base classes and utility functions to get application's data.\n
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include <f32file.h>
+#include <fbs.h>
+#include <s32std.h> 
+#include <s32stor.h> 
+#include <s32file.h> 
+
+#include <apaid.h>
+#include "..\apparc\apadll.h"
+#include <apgaplst.h>
+#include <apgicnfl.h>
+#include <apgdoor.h>
+#include <apfrec.h>
+#include <apfctlf.h>
+#include <apgctl.h>
+#include <apgaplst.h>
+#include <apaflrec.h>
+#include <apgcli.h>
+#include <apacmdln.h>
+#include <apsserv.h>
+#include <appfwk_test_AppUi.h>
+
+#include "T_ControlPanelTest.h"
+#include "tstapp.h"
+#include <w32std.h>
+
+#if !defined(__E32TEST_H__)
+#include <e32test.h>
+#endif
+
+_LIT(KCompleted, "Completed.");
+
+
+_LIT(KRSCDIR,"C:\\Resource\\apps\\");
+_LIT(KRSCREGDIR,"C:\\private\\10003a3f\\import\\apps\\");
+_LIT(KNEWCTLPATH,"C:\\sys\\bin\\app_CTRL2.exe");
+_LIT(KSRCRESOURCEPATH,"Z:\\private\\10003a3f\\import\\apps\\App_CTRL2_reg.Rsc");
+_LIT(KDESTRESOURCEPATH,"C:\\private\\10003a3f\\import\\apps\\App_CTRL2_reg.Rsc");
+
+LOCAL_D TInt SimulateKey(TAny*)
+	{
+	User::After(3000000);
+	RWsSession session;
+	User::LeaveIfError(session.Connect());	
+	//control down
+	TRawEvent rawEvent;
+
+	rawEvent.Set(TRawEvent::EKeyDown,EStdKeyLeftCtrl);
+	session.SimulateRawEvent(rawEvent);
+
+	// e down
+	rawEvent.Set(TRawEvent::EKeyDown,'E');
+	session.SimulateRawEvent(rawEvent);
+
+	// e up
+	rawEvent.Set(TRawEvent::EKeyUp,'E');
+	session.SimulateRawEvent(rawEvent);
+
+	//control up
+	rawEvent.Set(TRawEvent::EKeyUp,EStdKeyLeftCtrl);
+	session.SimulateRawEvent(rawEvent);
+
+	session.Flush();
+	
+	session.Close();
+	
+	return KErrNone;
+	}
+
+void CT_ControlPanelTestStep::RemoveFilesFromCDrive()
+	{
+	TInt ret = iTestServ.SetReadOnly(KDESTRESOURCEPATH,0); //remove READ ONLY option
+	TEST(ret==KErrNone);
+
+	TRAP(ret,iTestServ.DeleteFileL(KDESTRESOURCEPATH));
+	TEST(ret==KErrNone);
+	}
+
+
+
+/**
+  Auxiliary Fn for Test Case ID T-ControlPanelStep-testControls1L,
+  T-ControlPanelStep-testControls2L, T-ControlPanelStep-testControls3L
+ 
+  The method finds the index of control app_ctrl2.exe in the control list.
+  Depending on the Boolean value of argument aIsNewPath the search is
+  done on ROM / RAM.\n
+ 
+*/
+
+TInt CT_ControlPanelTestStep::ControlIndexInList(CApaSystemControlList* aList, TBool aIsNewPath)
+	{
+	TFileName ctlPath=_L("Z:\\sys\\bin\\app_CTRL2.exe");
+	TFileName newCtlPath=_L("c:\\sys\\bin\\app_ctrl2.exe");
+	const TInt count = aList->Count();
+	TInt retVal = KErrNotFound;
+	for(TInt ii = 0; ii < count; ++ii)
+		{		
+		if(((aList->Control(ii)->FileName().CompareF(ctlPath)==0) && (!aIsNewPath)) ||
+			((aList->Control(ii)->FileName().CompareF(newCtlPath)==0) && (aIsNewPath)))
+			{
+			retVal = ii;
+			
+			
+			if(aList->Control(ii)->FileName().CompareF(ctlPath)==0)
+				{
+				INFO_PRINTF1(_L("***Found control on the z: drive"));
+				}
+			else
+				{
+				INFO_PRINTF1(_L("***Found control on the c: drive"));
+				}
+			break;
+			}
+		}
+	INFO_PRINTF2(_L("Out [%d] controlIndexInList"),retVal);	
+	return retVal;
+	}
+
+
+/**
+   @SYMTestCaseID T-ControlPanelStep-testControls1L
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Tests CApaSystemControlList::UpdateL().
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Check the control list to find the number of controls in the
+   list and the number of updates to the list. Call UpdateL(). Check the list
+   again for no change in the count of controls and updates to the list.\n
+   API Calls:\n	
+   CApaSystemControlList::UpdateL()\n
+   
+   @SYMTestExpectedResults Test confirms that there is no change in the control
+   list after updating.
+ */
+void CT_ControlPanelTestStep::testControls1L()
+	{
+	INFO_PRINTF1(_L("In testControls1L......"));
+	
+	iControlCount1 = iControlList->Count();
+	TEST((iControlCount1>=1));
+	
+	TEST((iControlList->UpdateCount()>=1));//update count returns 1 if new list
+	//
+	// do an update - there should be no changes
+	TInt ret;
+	INFO_PRINTF1(_L("Updating the list ......"));
+	TRAP(ret, iControlList->UpdateL());
+	TEST(ret==KErrNone);
+	iControlCount2 = iControlList->Count();
+	TEST(iControlCount2 == iControlCount1);	
+	TEST((iControlList->UpdateCount()>=1));
+	iIndex = ControlIndexInList(iControlList,EFalse);
+	TEST((iIndex >= 0) && (iIndex < iControlCount2));
+	
+	INFO_PRINTF1(_L("Out testControls1L......"));
+	}
+
+
+/**
+   @SYMTestCaseID T-ControlPanelStep-testControls2L
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Tests CApaSystemControlList::UpdateL() and UpdateCount().
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Copy control from Z: drive to C: drive. Call UpdateL() to
+   update the control list. Check if UpdateL() has incremented iUpdateCount
+   by calling UpdateCount(). Check the filename of control to ensure that the
+   control copied to C: drive has been updated in the list. Delete the newly
+   copied control.\n
+   API Calls:\n	
+   CApaSystemControlList::UpdateL()\n
+   CApaSystemControlList::UpdateCount()const\n
+   
+   @SYMTestExpectedResults The test shows updating of the copied control in control list.
+ */
+
+void CT_ControlPanelTestStep::testControls2L()
+	{
+	INFO_PRINTF1(_L("In testControls2L......"));	
+	
+	iTestServ.CreateDirectoryL(KRSCDIR);
+	iTestServ.CreateDirectoryL(KRSCREGDIR);
+
+	TInt ret=iTestServ.CopyFileL(KSRCRESOURCEPATH,KDESTRESOURCEPATH);
+	TEST(ret==KErrNone);
+	
+	INFO_PRINTF1(_L("Files Copied to C Drive......"));
+	INFO_PRINTF1(_L("Updating the list ......"));
+	iControlCount=iControlList->UpdateCount();
+	while(iControlList->UpdateCount()<=iControlCount)
+		{
+		TRAP(ret, iControlList->UpdateL());
+		if(ret!=KErrNone)
+			{
+			break;				
+			}
+		User::After(100000);	
+		}
+
+	INFO_PRINTF2(_L("In testControls2L After Controllist update [%d]......"),ret);
+	TEST(ret==KErrNone);
+	iControlCount3 = iControlList->Count();
+	TEST(iControlCount3 == iControlCount1);
+	TEST((iControlList->UpdateCount()>=2));
+	iIndex = ControlIndexInList(iControlList,ETrue);
+	TEST((iIndex >= 0) && (iIndex < iControlCount3));
+
+	TFileName name=iControlList->Control(iIndex)->FileName();
+	TEST(name.CompareF(KNEWCTLPATH)==0);
+	RemoveFilesFromCDrive();
+	INFO_PRINTF1(_L("Removed the file from C Drive......"));
+	INFO_PRINTF1(_L("Updating the list ......"));
+	iControlCount=iControlList->UpdateCount();
+	while(iControlList->UpdateCount()<=iControlCount)
+		{
+		TRAPD(ret, iControlList->UpdateL());
+		if(ret!=KErrNone)
+			{
+			break;				
+			}
+		User::After(100000);
+		}
+	INFO_PRINTF1(_L("Out testControls2L......"));
+	}
+
+/**
+   @SYMTestCaseID T-ControlPanelStep-testControls3L
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Tests CApaSystemControlList::Control() and CApaSystemControl APIs Type() and Caption().
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Update the control list to ensure that the deleted control is
+   removed from the list and the control on the Z: Drive is added to the list.
+   Retrieve this control from the list using CApaSystemControlList::Control(). 
+   Check the type and caption of the control calling Type() and Caption() methods.\n
+   API Calls:\n	
+   CApaSystemControlList::Control(TInt aIndex)const\n
+   CApaSystemControl::Type()const\n
+   CApaSystemControl::Caption()const\n
+   
+   @SYMTestExpectedResults The test shows the addition of the control present on 
+   Z: drive in control list. Test confirms the retrieved info on the control
+   obtained from the control list.
+  
+ */
+void CT_ControlPanelTestStep::testControls3L()
+	{
+	INFO_PRINTF1(_L("In testControls3L......"));
+	TFileName ctlPath=_L("Z:\\sys\\bin\\app_ctrl2.exe");
+	TFileName ctlCaption=_L("app_ctrl2");
+	// This method is called to close the panic dialog generated by previous test
+	CloseAllPanicWindowsL();
+	
+	INFO_PRINTF1(_L("IN testControls3L Before Updating the list......"));
+	TRAPD(ret, iControlList->UpdateL());
+	
+	TEST(ret==KErrNone);
+	const TInt controlCount4 = iControlList->Count();
+	TEST(controlCount4 == iControlCount1);	// no changes in the count
+	TEST((iControlList->UpdateCount()>=3));
+
+	iIndex = ControlIndexInList(iControlList,EFalse);
+	TEST((iIndex >= 0) && (iIndex < controlCount4));
+	TEST(iControlList->Control(iIndex)->FileName().CompareF(ctlPath)==0);
+	
+	INFO_PRINTF1(_L("Testing CApaSystemControl"));
+	//
+	//get the control from the list and check it's type and caption
+	iControl=iControlList->Control(iIndex);
+	TEST(iControl!=NULL);
+	TFileName caption=iControl->Caption();
+	TEST(caption.CompareF(ctlCaption)==0);
+	TEST(iControl->Icon()!=NULL);
+	
+	RThread thread;
+	TFullName name=_L("Control Panel Test");
+	TInt r=thread.Create(name,SimulateKey,KDefaultStackSize,KDefaultStackSize,KDefaultStackSize,NULL);
+	TEST(r==KErrNone);
+	thread.Resume();
+		
+	// run the control
+	TRAP(ret, iControl->CreateL()); // this call is synchronous
+	TEST(ret==KErrNone);
+	
+	thread.Close();
+	INFO_PRINTF1(_L("Out testControls3L......"));
+	}
+
+
+
+/**
+   Auxiliary Fn for T-ControlPanelStep-testControls1L, T-ControlPanelStep-testControls2L, T-ControlPanelStep-testControls3L
+   
+   This method creates a control list by calling CApaSystemControlList::NewL() and 
+   initiates subsequent tests on CApaSystemControlList and CApaSystemControl APIs.
+    
+ */
+void CT_ControlPanelTestStep::testControlsL()
+	{
+	INFO_PRINTF1(_L("Testing CApaSystemControlList"));
+	
+	//Create a session with F & B server
+	TInt ret=RFbsSession::Connect();
+	TEST(!ret);
+
+	TRAP(ret,iControlList=CApaSystemControlList::NewL(iFs));
+	TEST(ret==KErrNone);
+
+	TRAPD(err,testControls1L());
+	TRAP(err,testControls2L());
+	TRAP(err,testControls3L());
+
+	delete iControlList;
+
+	//Close the session F & B server.
+	RFbsSession::Disconnect();
+	}
+
+
+/**
+  Auxiliary Fn for all Test Cases.
+ 
+  This method creates and installs an active scheduler and puts the
+  test code on the scheduler as a CIdle object. The method initiates
+  all tests by calling the static method CT_ControlPanelTestCallBack::CallBack().
+ 
+*/
+void CT_ControlPanelTestStep::DoStepTestsInCallbackL()
+	{
+	// create an active scheduler
+	CActiveScheduler* scheduler = new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(scheduler);
+	CleanupStack::PushL(scheduler);
+
+	// put the test code onto the scheduler as an idle object
+	CIdle* idle=CIdle::NewL(-20);
+	CleanupStack::PushL(idle);
+
+	CT_ControlPanelTestCallBack* callBack = new(ELeave) CT_ControlPanelTestCallBack(this);
+	CleanupStack::PushL(callBack);
+
+	idle->Start(TCallBack(CT_ControlPanelTestCallBack::CallBack,callBack));
+	// start the test code
+	CActiveScheduler::Start();
+
+	// all outstanding requests complete - kill the scheduler
+	CleanupStack::PopAndDestroy(3); //scheduler, callBack, idle
+	}
+
+
+
+
+/**
+  Auxiliary Fn for all Test Cases.
+ 
+  The method initiates all tests to be performed.
+ 
+*/
+void CT_ControlPanelTestStep::DoStepTests()
+	{
+	__UHEAP_MARK;
+	INFO_PRINTF1(_L("Test Controls......"));
+	TRAPD(r,testControlsL());
+	TEST(r==KErrNone);
+	INFO_PRINTF1(KCompleted);
+	__UHEAP_MARKEND;
+	}
+
+
+CT_ControlPanelTestStep::~CT_ControlPanelTestStep()
+/**
+   Destructor
+ */
+	{
+	}
+
+CT_ControlPanelTestStep::CT_ControlPanelTestStep()
+/**
+   Constructor
+ */
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_ControlPanelTest);
+	}
+
+TVerdict CT_ControlPanelTestStep::doTestStepPreambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	SetTestStepResult(EPass);
+	return TestStepResult();
+	}
+
+TVerdict CT_ControlPanelTestStep::doTestStepPostambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	return TestStepResult();
+	}
+
+
+TVerdict CT_ControlPanelTestStep::doTestStepL()
+/**
+  @return - TVerdict code
+  Override of base class virtual
+*/
+	{
+	INFO_PRINTF1(_L("Testing Apparc ...T_ControlPanel"));
+
+	// set up the directory structure
+	User::LeaveIfError(iFs.Connect());
+	
+	// connect to the test utils server
+	User::LeaveIfError(iTestServ.Connect());
+	
+	// Run the tests...w	
+	TRAPD(ret,DoStepTestsInCallbackL())
+	TEST(ret==KErrNone);
+
+	// Close everything
+	iFs.Close();
+	iTestServ.Close();
+
+	INFO_PRINTF1(_L("T_ControlPanel Completed."));
+	return TestStepResult();
+	}
+
+
+TInt CT_ControlPanelTestCallBack::CallBack(TAny* callBack /*aThis*/)
+/**
+  This static method is the callback function of CIdle object. The method
+  calls the non-static method DoStepTests() which initiates all the tests. 
+*/
+	{
+	
+	//Call Test Step func
+
+	((CT_ControlPanelTestCallBack *)callBack)->iTestStep->DoStepTests();
+	
+	CActiveScheduler::Stop();
+	return EFalse; // don't call back again
+	}
+
+
+CT_ControlPanelTestCallBack::CT_ControlPanelTestCallBack(CT_ControlPanelTestStep* aTestStep)
+/**
+   Constructor
+ */
+	{
+	iTestStep = aTestStep;
+	}
+
+CT_ControlPanelTestCallBack::~CT_ControlPanelTestCallBack()
+/**
+   Destructor
+ */
+	{
+
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_ControlPanelTest.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,96 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+ 
+//#if (!defined __T_CONTROLPANEL_STEP_H)
+//#define __T_CONTROLPANEL_STEP_H
+
+#ifndef		__T_CONTROLPANEL_STEP_H
+#define		__T_CONTROLPANEL_STEP_H
+
+#include "ApparcTestServer.h"
+
+#include <apaid.h>
+#include "..\apparc\apadll.h"
+#include <apgaplst.h>
+#include <apgicnfl.h>
+#include <apgdoor.h>
+#include <apfrec.h>
+#include <apfctlf.h>
+#include <apgctl.h>
+#include <apgaplst.h>
+#include <apaflrec.h>
+#include <apgcli.h>
+#include <apacmdln.h>
+#include <apsserv.h>
+#include "appfwk_test_utils.h"
+#include "..\apserv\apsclsv.h" // so I can start the server
+
+
+_LIT(KT_ControlPanelTest, "T_ControlPanelTest");
+
+//!  A CT_ControlPanelTestStep test class. 
+/*!
+Tests Application Apparc base classes and utility functions.\n
+*/
+
+class CT_ControlPanelTestStep : public CTestStep
+	{
+public:
+	CT_ControlPanelTestStep();
+	~CT_ControlPanelTestStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+	void DoStepTests();
+	void DoStepTestsInCallbackL();
+	void testControlsL();
+	void loadDllL();
+	void RemoveFilesFromCDrive();
+	TInt ControlIndexInList(CApaSystemControlList* aList, TBool aIsNewPath);
+	void testControls1L();
+	void testControls2L();
+	void testControls3L();
+private:
+	RFs iFs;
+	CApaSystemControlList* iControlList;
+	CApaSystemControl* iControl;
+	TInt iControlCount;
+	TInt iControlCount1;
+	TInt iControlCount2;
+	TInt iControlCount3;
+	TInt iIndex;
+	RSmlTestUtils iTestServ;
+	};
+
+
+class CT_ControlPanelTestCallBack : public CBase
+	{
+public:
+	CT_ControlPanelTestCallBack(CT_ControlPanelTestStep* aTestStep);
+	~CT_ControlPanelTestCallBack();
+	static TInt CallBack(TAny* /*aThis*/);
+	CT_ControlPanelTestStep* iTestStep;
+
+private:
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_DataMappingPersistenceA.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,91 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code  
+*/
+
+#include "T_DataMappingPersistenceA.h"
+
+
+/**
+ * Constructor
+ */	
+CT_DataMappingPersistenceATestStep::CT_DataMappingPersistenceATestStep()
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_DataMappingPersistenceAStep);
+	}
+
+/**
+ * Destructor
+ */
+CT_DataMappingPersistenceATestStep::~CT_DataMappingPersistenceATestStep()
+	{
+	iSession.Close();
+	}
+
+/**
+ * @return - TVerdict code
+ * Override of base class virtual
+ */	
+TVerdict CT_DataMappingPersistenceATestStep::doTestStepPreambleL()
+	{
+	SetTestStepResult(EPass);
+	TInt error = iSession.Connect();
+	TEST(error==KErrNone);
+	return TestStepResult();
+	}
+
+/**
+ * @return - TVerdict code
+ * Override of base class virtual
+ */
+TVerdict CT_DataMappingPersistenceATestStep::doTestStepPostambleL()
+	{
+	return TestStepResult();
+	}
+
+TVerdict CT_DataMappingPersistenceATestStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Testing Apparc...T_DataMappingPersistenceA Test Cases Running..."));
+
+	TRAPD(ret,RunTestCasesL())
+	TEST(ret==KErrNone);
+	
+	INFO_PRINTF1(_L("...T_DataMappingPersistenceA Test Cases Completed."));
+
+	return TestStepResult();
+	}
+
+TInt CT_DataMappingPersistenceATestStep::RunTestCasesL()
+	{
+	//DONT_CHECK since array in type store is uncompressed
+	HEAP_TEST_LS_SESSION(iSession, 0, DONT_CHECK, TestInsertDataMappingL(), NO_CLEANUP);
+	
+	return KErrNone;
+	}
+	
+void CT_DataMappingPersistenceATestStep::TestInsertDataMappingL()
+	{
+	TUid appUid = {0x10004c58}; 
+	_LIT8(KLitMimeTypeData,"text/TestDataMappingPersistence");
+	TDataType dataType (KLitMimeTypeData);
+	TInt error = iSession.InsertDataMapping(dataType,1,appUid);	
+	TEST(error==KErrNone);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_DataMappingPersistenceA.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,49 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+ 
+#if (!defined __T_DATAMAPPINGPERSISTENCEA_STEP_H__)
+#define __T_DATAMAPPINGPERSISTENCEA_STEP_H__
+
+#include "appfwk_test_AppUi.h"
+#include "T_RApaLsSessionStep.h"
+
+_LIT(KT_DataMappingPersistenceAStep,"T_DataMappingPersistenceA");
+
+class CT_DataMappingPersistenceATestStep : public CTestStep
+	{
+public:
+	CT_DataMappingPersistenceATestStep();
+	~CT_DataMappingPersistenceATestStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+
+private:
+	TInt RunTestCasesL();
+	void TestInsertDataMappingL();
+
+private:
+	RTestableApaLsSession iSession;
+	};
+	
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_DataMappingPersistenceB.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,95 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include "T_DataMappingPersistenceB.h"
+
+/**
+ * Constructor
+ */	
+CT_DataMappingPersistenceBTestStep::CT_DataMappingPersistenceBTestStep()
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_DataMappingPersistenceBStep);
+	}
+
+/**
+ * Destructor
+ */
+CT_DataMappingPersistenceBTestStep::~CT_DataMappingPersistenceBTestStep()
+	{
+	iSession.Close();
+	}
+
+/**
+ * @return - TVerdict code
+ * Override of base class virtual
+ */	
+TVerdict CT_DataMappingPersistenceBTestStep::doTestStepPreambleL()
+	{
+	SetTestStepResult(EPass);
+	TInt error = iSession.Connect();
+	TEST(error==KErrNone);
+	return TestStepResult();
+	}
+
+/**
+ * @return - TVerdict code
+ * Override of base class virtual
+ */
+TVerdict CT_DataMappingPersistenceBTestStep::doTestStepPostambleL()
+	{
+	return TestStepResult();
+	}
+
+TVerdict CT_DataMappingPersistenceBTestStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Testing Apparc...T_DataMappingPersistenceB Test Cases Running..."));
+
+
+	TRAPD(ret,RunTestCasesL())
+	TEST(ret==KErrNone);
+	
+	INFO_PRINTF1(_L("...T_DataMappingPersistenceB Test Cases Completed."));
+
+	return TestStepResult();
+	}
+
+TInt CT_DataMappingPersistenceBTestStep::RunTestCasesL()
+	{
+	HEAP_TEST_LS_SESSION(iSession, 0, 0, TestDeleteDataMappingL() , NO_CLEANUP);
+	
+	return KErrNone;
+	}	
+
+void CT_DataMappingPersistenceBTestStep::TestDeleteDataMappingL()
+	{
+	TUid appUid = {0x10004c58}; 
+	_LIT8(KLitMimeTypeData,"text/TestDataMappingPersistence");
+	TDataType dataType (KLitMimeTypeData);
+	TUid retAppUid;
+	TInt error = iSession.AppForDataType(dataType,retAppUid);
+	TEST(error==KErrNone);
+	TEST(appUid == retAppUid);
+	error = iSession.DeleteDataMapping(dataType);
+	TEST(error==KErrNone);
+
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_DataMappingPersistenceB.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,50 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+ 
+#if (!defined __T_DATAMAPPINGPERSISTENCEB_STEP_H__)
+#define __T_DATAMAPPINGPERSISTENCEB_STEP_H__
+
+#include "appfwk_test_AppUi.h"
+#include "T_RApaLsSessionStep.h"
+
+_LIT(KT_DataMappingPersistenceBStep,"T_DataMappingPersistenceB");
+
+class CT_DataMappingPersistenceBTestStep : public CTestStep
+	{
+public:
+	CT_DataMappingPersistenceBTestStep();
+	~CT_DataMappingPersistenceBTestStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+
+private:
+	TInt RunTestCasesL();
+	void TestDeleteDataMappingL();
+
+private:
+	RTestableApaLsSession iSession;
+
+	};
+	
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_DataMappingPersistenceC.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,94 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+#include "T_DataMappingPersistenceC.h"
+
+
+
+/**
+ * Constructor
+ */	
+CT_DataMappingPersistenceCTestStep::CT_DataMappingPersistenceCTestStep()
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_DataMappingPersistenceCStep);
+	}
+
+/**
+ * Destructor
+ */
+CT_DataMappingPersistenceCTestStep::~CT_DataMappingPersistenceCTestStep()
+	{
+	iSession.Close();
+	}
+
+/**
+ * @return - TVerdict code
+ * Override of base class virtual
+ */	
+TVerdict CT_DataMappingPersistenceCTestStep::doTestStepPreambleL()
+	{
+	SetTestStepResult(EPass);
+	TInt error = iSession.Connect();
+	TEST(error==KErrNone);
+	return TestStepResult();
+	}
+
+/**
+ * @return - TVerdict code
+ * Override of base class virtual
+ */
+TVerdict CT_DataMappingPersistenceCTestStep::doTestStepPostambleL()
+	{
+	return TestStepResult();
+	}
+
+TVerdict CT_DataMappingPersistenceCTestStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Testing Apparc...T_DataMappingPersistenceC Test Cases Running..."));
+
+	TRAPD(ret,RunTestCasesL());
+	TEST(ret==KErrNone);
+	
+	INFO_PRINTF1(_L("...T_DataMappingPersistenceC Test Cases Completed."));
+
+	return TestStepResult();
+	}
+	
+TInt CT_DataMappingPersistenceCTestStep::RunTestCasesL()
+	{
+	HEAP_TEST_LS_SESSION(iSession, 0, 0, TestCheckDeleteDataMappingL(), NO_CLEANUP);
+	
+	return KErrNone;
+	}	
+
+void CT_DataMappingPersistenceCTestStep::TestCheckDeleteDataMappingL()
+	{
+	TUid appUid = {0x10004c58}; 
+	_LIT8(KLitMimeTypeData,"text/TestDataMappingPersistence");
+	TDataType dataType (KLitMimeTypeData);
+	TUid retAppUid;
+	TInt error = iSession.AppForDataType(dataType,retAppUid);
+	TEST(error==KErrNone);
+	TEST(appUid != retAppUid);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_DataMappingPersistenceC.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,50 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+ 
+#if (!defined __T_DATAMAPPINGPERSISTENCEC_STEP_H__)
+#define __T_DATAMAPPINGPERSISTENCEC_STEP_H__
+
+#include "appfwk_test_AppUi.h"
+#include "T_RApaLsSessionStep.h"
+
+_LIT(KT_DataMappingPersistenceCStep,"T_DataMappingPersistenceC");
+
+class CT_DataMappingPersistenceCTestStep : public CTestStep
+	{
+public:
+	CT_DataMappingPersistenceCTestStep();
+	~CT_DataMappingPersistenceCTestStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+
+private:
+	TInt RunTestCasesL();
+	void TestCheckDeleteDataMappingL();
+
+private:
+	RTestableApaLsSession iSession;
+	
+	};
+	
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_DataPrioritySystem1/T_DataPrioritySystem1.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,25 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <e32std.h>
+
+GLDEF_C TInt E32Main()
+/**
+   EXE Entry Point
+   @return - Standard Epoc error code on exit
+ */
+	{
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_DataPrioritySystem1/T_DataPrioritySystem1.MMP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,64 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// T_DataPrioritySystem1.EXE Test application for checking system prioirty for
+// datatype handlers
+// 
+//
+
+
+
+/**
+ @file 
+*/
+
+TARGETPATH	/sys/bin
+target          T_DataPrioritySystem1.EXE
+targettype      EXE
+
+
+UID		0x1000007a 0x10207f7b
+ 
+VENDORID 0x70000001
+
+CAPABILITY WriteDeviceData
+
+SYSTEMINCLUDE   /EPOC32/INCLUDE 
+
+systeminclude	/epoc32/include/test
+
+
+SOURCEPATH		.	
+source       	T_DataPrioritySystem1.CPP
+
+USERINCLUDE     .
+USERINCLUDE 	..
+
+
+start resource T_DataPrioritySystem1_reg.rss
+targetpath /private/10003A3F/apps
+end
+
+start resource T_DataPrioritySystem1_loc.rss
+targetpath /resource/apps
+end
+
+LIBRARY		CONE.LIB   WS32.LIB
+LIBRARY		APPFWK_TEST_APPUI.LIB
+LIBRARY		EUSER.LIB
+LIBRARY		TESTEXECUTEUTILS.LIB  TestExecuteLogClient.LIB
+LIBRARY		APPARC.LIB EFSRV.LIB ESTOR.LIB GDI.LIB FBSCLI.LIB
+LIBRARY     APFILE.LIB APGRFX.LIB  BAFL.LIB APMIME.LIB
+LIBRARY		EIKCORE.LIB 
+LIBRARY		APSERV.LIB
+LIBRARY     ECOM.LIB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_DataPrioritySystem1/T_DataPrioritySystem1_loc.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,29 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <appinfo.rh>
+
+RESOURCE LOCALISABLE_APP_INFO
+	{
+	short_caption = "T_DataPrioritySystem1";
+	caption_and_icon = 
+		{
+		CAPTION_AND_ICON_INFO
+			{
+			caption = "T_DataPrioritySystem1";
+			number_of_icons = 0;
+			}
+		};
+	}	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_DataPrioritySystem1/T_DataPrioritySystem1_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,41 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10207f7b
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="T_DataPrioritySystem1";
+	localisable_resource_file="\\resource\\apps\\T_DataPrioritySystem1_loc";
+	hidden=KAppNotHidden;
+	embeddability=KAppNotEmbeddable;
+	newfile=KAppDoesNotSupportNewFile;
+	launch=KAppLaunchInForeground;
+	service_list = 
+		{
+		SERVICE_INFO 
+			{
+			uid = 0x10207f7d;
+			datatype_list = 
+				{
+				DATATYPE { priority=0xFFF9; type="text/custom1"; }
+				};
+			opaque_data = 0;
+			}
+		};
+	}	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_DataPrioritySystem2/T_DataPrioritySystem2.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,25 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <e32std.h>
+
+GLDEF_C TInt E32Main()
+/**
+   EXE Entry Point
+   @return - Standard Epoc error code on exit
+ */
+	{
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_DataPrioritySystem2/T_DataPrioritySystem2.MMP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,63 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// T_DataPrioritySystem2.EXE Test application for checking system prioirty for
+// datatype handlers
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+TARGETPATH	/sys/bin
+target          T_DataPrioritySystem2.EXE
+targettype      EXE
+
+
+UID		0x1000007a 0x10207f7c
+ 
+VENDORID 0x70000001
+
+CAPABILITY None
+
+SYSTEMINCLUDE   /EPOC32/INCLUDE 
+
+systeminclude	/epoc32/include/test
+
+
+SOURCEPATH		.	
+source       	T_DataPrioritySystem2.CPP
+
+USERINCLUDE     .
+USERINCLUDE 	..
+
+start resource T_DataPrioritySystem2_reg.rss
+targetpath /private/10003A3F/apps
+end
+
+start resource T_DataPrioritySystem2_loc.rss
+targetpath /resource/apps
+end
+
+LIBRARY		CONE.LIB   WS32.LIB
+LIBRARY		APPFWK_TEST_APPUI.LIB
+LIBRARY		EUSER.LIB
+LIBRARY		TESTEXECUTEUTILS.LIB  TestExecuteLogClient.LIB
+LIBRARY		APPARC.LIB EFSRV.LIB ESTOR.LIB GDI.LIB FBSCLI.LIB
+LIBRARY     APFILE.LIB APGRFX.LIB  BAFL.LIB APMIME.LIB
+LIBRARY		EIKCORE.LIB 
+LIBRARY		APSERV.LIB
+LIBRARY     ECOM.LIB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_DataPrioritySystem2/T_DataPrioritySystem2_loc.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,29 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <appinfo.rh>
+
+RESOURCE LOCALISABLE_APP_INFO
+	{
+	short_caption = "T_DataPrioritySystem2";
+	caption_and_icon = 
+		{
+		CAPTION_AND_ICON_INFO
+			{
+			caption = "T_DataPrioritySystem2";
+			number_of_icons = 0;
+			}
+		};
+	}	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_DataPrioritySystem2/T_DataPrioritySystem2_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,42 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10207f7c
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="T_DataPrioritySystem2";
+	localisable_resource_file="\\resource\\apps\\T_DataPrioritySystem2_loc";
+	hidden=KAppNotHidden;
+	embeddability=KAppNotEmbeddable;
+	newfile=KAppDoesNotSupportNewFile;
+	launch=KAppLaunchInForeground;
+	service_list = 
+		{
+		SERVICE_INFO 
+			{
+			uid = 0x10207f7e;
+			datatype_list = 
+				{
+				DATATYPE { priority=0xFFF9; type="text/custom1"; }
+				};
+			opaque_data = 0;
+			}
+		};
+
+	}	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_DataPrioritySystem3_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,51 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10207f7f
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="T_DataPrioritySystem3";
+	hidden=KAppNotHidden;
+	embeddability=KAppNotEmbeddable;
+	newfile=KAppDoesNotSupportNewFile;
+	launch=KAppLaunchInForeground;
+	service_list = 
+		{
+		SERVICE_INFO 
+			{
+			uid = 0x10207f7d;
+			datatype_list = 
+				{
+				DATATYPE { priority=EDataTypePriorityHigh; type="text/custom1"; }
+				};
+			opaque_data = 0;
+			},
+		SERVICE_INFO 
+			{
+			uid = 0x10207f7e;
+			datatype_list = 
+				{
+				DATATYPE { priority=EDataTypePriorityHigh; type="text/custom1"; }
+				};
+			opaque_data = 0;
+			}
+
+		};
+
+	}	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_DataTypeMappingWithSid1.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,136 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// The following test case is used to test whether untrusted applications 
+// are able to override MIME types mappings using InsertDataMappingIfHigher API.
+// It is to ensure that priority checking mechanism (downgrading priority of 
+// untrusted apps) works as was designed.
+// 
+//
+
+
+
+/**
+ @file T_DataTypeMappingWithSid1.cpp
+ @internalComponent - Internal Symbian test code
+*/
+
+#include "T_DataTypeMappingWithSid1.h"
+#include "tstapp.h"
+#include "testableapalssession.h"
+#include <appfwk_test.h>
+
+/**
+   @SYMTestCaseID		APPFWK-APPARC-0036
+  
+   @SYMPREQ			    Policing server apis		
+  
+   @SYMTestCaseDesc 	Testing whether untrusted applications are able to override MIME types mapping
+  
+   @SYMTestPriority 	High
+  
+   @SYMTestStatus 		Implemented
+   
+   @SYMTestActions      To connect to RApaLsSession and try to register trusted and untrusted apps for mime types.
+   @SYMTestExpectedResults Test should complete without any panic.
+  
+ */
+void CT_DataTypeMappingWithSid1::ExecuteL(RApaLsSession& aLs)
+	{
+	TInt ret;
+	TBool added=EFalse;
+	_LIT8(KLitAudioFake, "audio/fakedata");
+    
+    TDataType dataType( KLitAudioFake );
+    
+    TUid trustedAppUid = {0x10207f8f};
+    TUid untrustedAppUid = {0xA3010010};
+    TUid retAppUid( KNullUid );
+
+	ret=aLs.InsertDataMapping(dataType, KDataTypePriorityHigh, trustedAppUid);
+	INFO_PRINTF1(_L("Trusted app sets a MimeType mapping: InsertDataMapping with PriorityHigh"));
+	INFO_PRINTF3(_L("Expected return code: %d, Actual return code: %d"), KErrNone, ret);
+	TEST(ret==KErrNone);
+    ret = aLs.AppForDataType(dataType,retAppUid);
+    INFO_PRINTF3(_L("Testing SID: Expected return code: %d, Actual return code: %d"), KErrNone, ret);
+    TEST(ret==KErrNone);
+    INFO_PRINTF3(_L("Expected SID: %d, Actual SID value: %d"), trustedAppUid, retAppUid);
+    TEST(retAppUid == trustedAppUid);
+    
+    ret=aLs.InsertDataMappingIfHigher(dataType, KDataTypePriorityTrustedHigh, untrustedAppUid, added);
+    INFO_PRINTF1(_L("UnTrusted app sets a MimeType mapping: InsertDataMapping with PriorityTrustedHigh"));
+    INFO_PRINTF3(_L("Expected return code: %d, Actual return code: %d"), KErrNone, ret);
+    TEST(ret==KErrNone);
+    ret = aLs.AppForDataType(dataType,retAppUid);
+    INFO_PRINTF3(_L("Testing SID: Expected return code: %d, Actual return code: %d"), KErrNone, ret);
+    TEST(ret==KErrNone);
+    INFO_PRINTF3(_L("Expected SID: %d, Actual SID value: %d"), untrustedAppUid, retAppUid);
+    TEST(retAppUid == untrustedAppUid);
+    
+    ret=aLs.InsertDataMappingIfHigher(dataType, KDataTypePriorityTrustedHigh, trustedAppUid, added);
+    INFO_PRINTF1(_L("Trusted app sets a MimeType mapping: InsertDataMapping with PriorityTrustedHigh"));
+    INFO_PRINTF3(_L("Expected return code: %d, Actual return code: %d"), KErrNone, ret);
+    TEST(ret==KErrNone);
+    ret = aLs.AppForDataType(dataType,retAppUid);
+    INFO_PRINTF3(_L("Testing SID: Expected return code: %d, Actual return code: %d"), KErrNone, ret);
+    TEST(ret==KErrNone);
+    INFO_PRINTF3(_L("Expected SID: %d, Actual SID value: %d"), trustedAppUid, retAppUid);
+    TEST(retAppUid == trustedAppUid);
+
+    ret=aLs.InsertDataMappingIfHigher(dataType, KDataTypePriorityTrustedHigh+1, untrustedAppUid, added);
+    INFO_PRINTF1(_L("UnTrusted app sets a MimeType mapping: InsertDataMapping with KDataTypePriorityTrustedHigh+1"));
+    INFO_PRINTF3(_L("Expected return code: %d, Actual return code: %d"), KErrNone, ret);
+    TEST(ret==KErrNone);
+    ret = aLs.AppForDataType(dataType,retAppUid);
+    INFO_PRINTF3(_L("Testing SID: Expected return code: %d, Actual return code: %d"), KErrNone, ret);
+    TEST(ret==KErrNone);
+    INFO_PRINTF3(_L("Expected SID: %d, Actual SID value: %d"), trustedAppUid, retAppUid);
+    TEST(retAppUid == trustedAppUid);
+    
+    //delete data type mapping
+    ret=aLs.DeleteDataMapping(dataType);
+    INFO_PRINTF3(_L("Deleting data mapping: Expected return code: %d, Actual return code: %d"), KErrNone, ret);
+    TEST(ret==KErrNone);
+	}
+
+CT_DataTypeMappingWithSid1::CT_DataTypeMappingWithSid1()
+/**
+   Constructor
+ */
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_DataTypeMappingWithSid1);
+	}
+
+CT_DataTypeMappingWithSid1::~CT_DataTypeMappingWithSid1()
+	{
+	}
+
+TVerdict CT_DataTypeMappingWithSid1::doTestStepL()
+    {
+	INFO_PRINTF1(_L("APPFWK-APPARC-0036: DataTypeMappingWithSid1 - Started"));
+	
+	RTestableApaLsSession apaLsSession;
+	TEST(apaLsSession.Connect()==KErrNone);
+	CleanupClosePushL(apaLsSession);
+
+	//DONT_CHECK since array in type store is uncompressed
+	HEAP_TEST_LS_SESSION(apaLsSession, 0, DONT_CHECK, ExecuteL(apaLsSession), NO_CLEANUP);
+
+	CleanupStack::PopAndDestroy(&apaLsSession);
+
+
+	INFO_PRINTF1(_L("APPFWK-APPARC-0036: DataTypeMappingWithSid1 - Finished"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_DataTypeMappingWithSid1.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,53 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// The following test case is used to test whether untrusted applications 
+// are able to override MIME types mappings using InsertDataMappingIfHigher API.
+// It is to ensure that priority checking mechanism (downgrading priority of 
+// untrusted apps) works as was designed.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#if !defined(__T_DATATYPEMAPPINGWITHSID1_H__)
+#define __T_DATATYPEMAPPINGWITHSID1_H__
+
+#include "ApparcTestServer.h"
+#include "appfwk_test_AppUi.h"
+
+class RApaLsSession;
+
+//! CT_DataTypeMappingWithSid1
+/** 
+  This class is used to test priority checks in InsertDataMappingIfHigher API
+*/
+class CT_DataTypeMappingWithSid1 : public CTestStep
+	{
+public:
+	CT_DataTypeMappingWithSid1();
+	virtual TVerdict doTestStepL();
+	void ExecuteL(RApaLsSession& aLs);
+private:
+	~CT_DataTypeMappingWithSid1();
+private:
+	};
+
+_LIT(KT_DataTypeMappingWithSid1, "T_DataTypeMappingWithSid1");
+
+#endif // __T_DATATYPEMAPPINGWITHSID1_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_EndTaskStep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,289 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// The following test cases test the funtionality of RuleBased plugins framework.
+// 
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <apacmdln.h>
+#include <apgwgnam.h>
+
+#include <appfwk_test.h>
+#include "T_EndTaskStep.h"
+#include "TEndTaskTestApp\EndTaskTestAppExternalInterface.h"
+
+CTEndTaskStep::CTEndTaskStep()
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_EndTaskStep);		
+	}
+
+CTEndTaskStep::~CTEndTaskStep()
+	{
+	}
+
+void CTEndTaskStep::ExecuteL()
+	{
+	RApaLsSession theLs;
+	User::LeaveIfError(theLs.Connect());
+	CleanupClosePushL(theLs);
+
+	User::LeaveIfError(iWs.Connect());
+	CleanupClosePushL(iWs);
+	
+	EndTaskTest1L(theLs);
+	EndTaskTest2L(theLs);
+	EndTaskTest3L(theLs);
+	
+	CleanupStack::PopAndDestroy();	//iWs.Close();
+	CleanupStack::PopAndDestroy(&theLs);
+	}
+
+/**
+@SYMTestCaseID 		APPFWK-APPARC-0057  
+
+@SYMDEF 			PDEF092171   
+
+@SYMTestCaseDesc 	Test case for defect "TApaTask::EndTask() allows any application kill any task"
+
+@SYMTestPriority 	High   
+
+@SYMTestStatus 		Implemented
+
+@SYMTestActions 	Launch and close both a standard and a system application using TApaTask::EndTask().
+
+@SYMTestExpectedResults The app should be launched and closed accordingly
+*/
+void CTEndTaskStep::EndTaskTest1L(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("Test case 1 started"));
+	
+	// Launch App
+	const TUid appUid = {KUidEndTaskAppUid};
+	TEST(KErrNone == LaunchAppL(aLs, appUid));
+
+	// Get a handle to App
+	TApaTaskList taskList(iWs);
+	TApaTask task1 = taskList.FindApp(appUid);
+	TEST(task1.Exists());
+
+	// Close it
+	task1.EndTask();
+	User::After(500000);
+	TApaTask refresh1 = taskList.FindApp(appUid); 
+	TEST(!refresh1.Exists());
+
+	//
+	// Now do the same again but with a system app
+	//
+	
+	// Launch App
+	TEST(KErrNone == LaunchAppL(aLs, appUid));
+
+	// Get a handle to App
+	TApaTask task2 = taskList.FindApp(appUid);
+	TEST(task2.Exists());
+
+	// Mark as a system app
+	TWsEvent event;
+	event.SetType(EEndTaskTestAppSetSystem);
+	iWs.SendEventToWindowGroup(task2.WgId(), event);
+
+	// Close it
+	task2.EndTask();
+	User::After(500000);
+	TApaTask refresh2 = taskList.FindApp(appUid); 
+	TEST(!refresh2.Exists());
+	
+	INFO_PRINTF1(_L("Test case 1 finished"));
+	}
+
+
+/**
+@SYMTestCaseID 		APPFWK-APPARC-0058
+
+@SYMDEF 			PDEF092171   
+
+@SYMTestCaseDesc 	Test case for defect "TApaTask::EndTask() allows any application kill any task"
+
+@SYMTestPriority 	High   
+
+@SYMTestStatus 		Implemented
+
+@SYMTestActions 	Try to close a systemapp from a process that do not have PwrMgmt
+
+@SYMTestExpectedResults The app should be closed accordingly
+*/
+void CTEndTaskStep::EndTaskTest2L(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("Test case 2 started"));
+	
+	// Launch App
+	const TUid appUid = {KUidEndTaskAppUid};
+	TEST(KErrNone == LaunchAppL(aLs, appUid));
+
+	// Get a handle to App
+	TApaTaskList taskList(iWs);
+	TApaTask task = taskList.FindApp(appUid);
+	TEST(task.Exists());
+
+	// Mark as a system task
+	TWsEvent event;
+	event.SetType(EEndTaskTestAppSetSystem);
+	iWs.SendEventToWindowGroup(task.WgId(), event);
+
+	// Call TApaTask::EndTask() on the systemtask from an arbitrary process which don't have PwrMgmt
+	event.SetType(ECallEndTaskWithoutPwrMgmt);
+	APPFWK_NEGATIVE_PLATSEC_START;
+	iWs.SendEventToWindowGroup(task.WgId(), event);
+	APPFWK_NEGATIVE_PLATSEC_FINISH;
+	User::After(500000);
+	TApaTask refresh = taskList.FindApp(appUid); 
+	TEST(refresh.Exists()); // application should have stayed open
+	
+	// Close app from this process (which do have PwrMgmt)
+	task.EndTask();
+	User::After(500000);
+	TApaTask refresh2 = taskList.FindApp(appUid); 
+	TEST(!refresh2.Exists());
+	
+	INFO_PRINTF1(_L("Test case 2 finished"));
+	}
+
+/**
+@SYMTestCaseID 		APPFWK-APPARC-0059
+
+@SYMDEF 			PDEF092171   
+
+@SYMTestCaseDesc 	Test case for defect "TApaTask::EndTask() allows any application kill any task"
+
+@SYMTestPriority 	High   
+
+@SYMTestStatus 		Implemented
+
+@SYMTestActions 	Launch and close application using wserv APIs (way of faking new secure close-message)
+
+@SYMTestExpectedResults This test should pass if the process doesn't have PowerMgmt
+*/
+void CTEndTaskStep::EndTaskTest3L(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("Test case 3 started"));
+	
+	// Launch App
+	const TUid appUid = {KUidEndTaskAppUid};
+	TEST(KErrNone == LaunchAppL(aLs, appUid));
+
+	// Get a handle to App
+	TApaTaskList taskList(iWs);
+	TApaTask task = taskList.FindApp(appUid);
+	TEST(task.Exists());
+
+	// Mark as a system app
+	TWsEvent event;
+	event.SetType(EEndTaskTestAppSetSystem);
+	iWs.SendEventToWindowGroup(task.WgId(), event);
+
+	// First variant should be sorted by CCoeAppUi::HandleWsEventL
+	event.SetType(ESimulateHackerAttack1);
+	iWs.SendEventToWindowGroup(task.WgId(), event);
+	User::After(500000);
+	TApaTask refresh = taskList.FindApp(appUid); 
+	TEST(refresh.Exists());
+	
+	if(refresh.Exists())
+		{
+		// Second variant should be handled by wserv's Client::CommandL
+		event.SetType(ESimulateHackerAttack2);
+		APPFWK_NEGATIVE_PLATSEC_START;
+		iWs.SendEventToWindowGroup(task.WgId(), event);
+		APPFWK_NEGATIVE_PLATSEC_FINISH;
+		User::After(500000);
+		TApaTask refresh2 = taskList.FindApp(appUid); 
+		TEST(refresh2.Exists());
+		
+		if(refresh2.Exists())
+			{
+			// Third variant should also be handled by wserv's Client::CommandL in another switch-case
+			event.SetType(ESimulateHackerAttack3);
+			APPFWK_NEGATIVE_PLATSEC_START;
+			iWs.SendEventToWindowGroup(task.WgId(), event);
+			APPFWK_NEGATIVE_PLATSEC_FINISH;
+			User::After(500000);
+			TApaTask refresh3 = taskList.FindApp(appUid); 
+			TEST(refresh3.Exists());
+
+			if(refresh3.Exists())
+				{
+				// Remove system property
+				event.SetType(EEndTaskTestAppSetNormal);
+				iWs.SendEventToWindowGroup(task.WgId(), event);
+				
+				// Close app 
+				task.EndTask();
+				User::After(500000);
+				TApaTask refresh5 = taskList.FindApp(appUid); 
+				TEST(!refresh5.Exists());
+				}
+			}
+		}
+	
+	INFO_PRINTF1(_L("Test case 3 finished"));
+	}
+	
+/**
+The function is used to launch an app whose UID is supplied as its second input parameter.
+The function returns KErrNone upon success, KErrGeneral otherwise.
+*/
+TInt CTEndTaskStep::LaunchAppL(RApaLsSession& aLs, const TUid& aAppUid)
+	{	
+	TApaAppInfo info; 
+	TFileName fileName;
+	User::LeaveIfError(aLs.GetAppInfo(info, aAppUid));
+	
+	//Wait 1 sec for function to complete
+	User::After(1000000);
+	fileName = info.iFullName; 
+	CApaCommandLine* cmdLn = CApaCommandLine::NewLC();     
+	cmdLn->SetDocumentNameL(KNullDesC);					//need to start without resource file
+	cmdLn->SetExecutableNameL(fileName);
+	TInt result = aLs.StartApp(*cmdLn);
+	//Wait 1 sec for App to start
+	User::After(1000000);
+	CleanupStack::PopAndDestroy(cmdLn);
+	return result;
+	}
+
+TVerdict CTEndTaskStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("TEndTaskStep test started...."));
+	
+	__UHEAP_MARK;			
+	TRAPD(err, ExecuteL()); 	
+	if(err != KErrNone)
+		{
+		INFO_PRINTF2(_L("execute tests ended with return value '%d'"), err);
+		TEST(EFalse);
+		}
+	__UHEAP_MARKEND; 			
+	
+	INFO_PRINTF1(_L(".... TEndTaskStep test finished!!"));
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_EndTaskStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,49 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#if !defined(__T_ENDTASK_STEP_H__)
+#define __T_ENDTASK_STEP_H__
+
+#include <apgcli.h>
+#include "appfwk_test_appui.h"
+#include <apgtask.h>
+
+class CTEndTaskStep : public CTestStep
+	{
+public:
+	CTEndTaskStep();
+	virtual TVerdict doTestStepL();
+	void ExecuteL();
+private:
+	~CTEndTaskStep();
+	void EndTaskTest1L(RApaLsSession& aLs);
+	void EndTaskTest2L(RApaLsSession& aLs);
+	void EndTaskTest3L(RApaLsSession& aLs);
+	TInt LaunchAppL(RApaLsSession& aLs, const TUid& aAppUid);
+private:
+	RWsSession iWs;
+	};
+
+_LIT(KT_EndTaskStep,"T_EndTask");
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_EnvSlots/T_EnvSlots.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,138 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Test Application for verification of environment slots\n
+// Calls the EnvironmentSlotsReaderL function and verfies the CApaCommandLine object returned  \n
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+#include "T_EnvSlots.H"
+
+/**
+  
+   Application invoked as part of CommandLine tests
+  
+   @SYMPREQ 280 File Handle Support
+  
+   FunctionDesc Tests Environment slots . 
+   Acquires a Mutex for log file access
+   Invokes EnvironmentSlotsReaderL() which returns an CApaCommandLine Object
+   Verifies the values returned by the GET APIs of CApaCommandLine object with those of predefined values
+   Writes "Pass" to the logfile if verification passes else "Fail" is written.
+  
+ */
+void testEnvironmentSlotsL()
+	{
+
+	TPtrC appName;
+	TPtrC docName;
+	TApaCommand command = EApaCommandOpen;
+	TBool testResult = PASS;
+	
+		
+	//Get the Mutex to access the log file
+	RMutex fileAccess;
+	fileAccess.OpenGlobal(KTLogFileAccess);
+	fileAccess.Wait();
+			
+	/** Invoke EnvironmenstSlotsReaderL() function which would constuct the CApaCommandLine class object
+	from the environment slots and return the pointer to that object */
+	//CApaCommandLine* cmdLine = CApaCommandLine::EnvironmentSlotsReaderL(); 
+	
+	//Method CApaCommandLine::EnvironmentSlotsReaderL has been implemented in a different fashion
+	CApaCommandLine* cmdLine;
+	CApaCommandLine::GetCommandLineFromProcessEnvironment(cmdLine);
+
+	CleanupStack::PushL(cmdLine);
+    				
+    appName.Set(KTAppName);
+	docName.Set(KTDocName);
+	
+	RFs fSession;
+	fSession.Connect();
+	RFile logFile;
+	TBufC<KMaxFilePath> testFilePath(KFilePath);
+	
+	//Open the Log file in Write Mode			
+	User::LeaveIfError(logFile.Replace(fSession,testFilePath,EFileWrite));
+		
+	// Compare the values returned by GET APIs with pre defined values	
+	TESTCOND(appName,cmdLine->ExecutableName());
+	
+	if(appName != cmdLine->ExecutableName())
+	{
+		logFile.Write(KTFail);
+		logFile.Write(KTApp);
+	}
+		
+	TESTCOND(docName,cmdLine->DocumentName());
+	if(docName != cmdLine->DocumentName())
+	{
+		logFile.Write(KTFail);
+		logFile.Write(KTDoc);
+	}
+	
+    TESTCOND(command,cmdLine->Command());
+	
+	if(command != cmdLine->Command())
+	{
+		logFile.Write(KTFail);
+		logFile.Write(KTCommand);
+	}
+	          
+    if(testResult == PASS)
+    	{
+    	logFile.Write(KTPass);
+    	}
+  
+    	
+    //Close the file and the file session
+    logFile.Close();
+    fSession.Close();
+    
+    //Signal the Mutex
+    fileAccess.Signal();  
+    CleanupStack::PopAndDestroy(cmdLine); 
+
+	}
+
+
+GLDEF_C TInt E32Main()
+/**
+   EXE Entry Point
+   @return - Standard Epoc error code on exit
+ */
+	{
+	
+	__UHEAP_MARK;
+	
+	CTrapCleanup* cleanupStack = CTrapCleanup::New();
+	
+	TRAPD(error,testEnvironmentSlotsL());
+	
+	__ASSERT_ALWAYS(!error,User::Panic(KTEnvSlots,error));
+	
+	delete cleanupStack;
+	
+	__UHEAP_MARKEND;
+	
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_EnvSlots/T_EnvSlots.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,68 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Header File for the test application for environment slots verification
+// Declares literals and macros used in T_EnvSlots.CPP .\n
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#ifndef __T_ENVSLOTS_H__
+#define __T_ENVSLOTS_H__
+
+#include <e32std.h>
+#include <e32base.h>
+#include <e32uid.h>
+#include <e32cmn.h>
+#include <f32file.h>
+#include <e32test.h>
+#include <apacmdln.h>
+#include <apgcli.h>
+#include "ApparcTestServer.h"
+#include "appfwk_test_AppUi.h"
+
+
+//!  A Environment slots reader test class. 
+
+/**
+  Test Environment slots of the process.
+*/
+	
+_LIT(KTLogFileAccess,"TestLogFile");
+_LIT(KFilePath,"c:\\logs\\TestExecute\\EnvSlots.txt");
+_LIT(KTAppName,"Z:\\sys\\bin\\T_EnvSlots.exe");
+_LIT(KTDocName,"C:\\System\\data\\temp.test");
+_LIT(KTEnvSlots,"T_EnvSlots");
+
+_LIT8(KTPass,"TestPass");
+_LIT8(KTFail,"TestFail");
+_LIT8(KTApp,"ApplName");
+_LIT8(KTDoc,"DocuName");
+_LIT8(KTCommand,"ECommand");
+
+const TInt PASS = 1;
+const TInt FAIL = 0;
+
+#define TESTCOND(a,b) if(a != b)  \
+{\
+	testResult = FAIL;\
+}\
+
+const TInt KMaxFilePath=50;
+#endif //__T_ENVSLOTS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_EnvSlots/T_EnvSlots.MMP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,62 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// T_EnvSlots.EXE Test application for environment slots verification
+// 
+//
+
+
+
+/**
+ @file
+*/
+
+TARGETPATH	/sys/bin
+target          T_EnvSlots.EXE
+targettype      EXE
+
+
+UID		0x1000007a 0x102032AB 
+VENDORID 0x70000001
+
+CAPABILITY All -Tcb
+
+SYSTEMINCLUDE   /EPOC32/INCLUDE 
+
+systeminclude	/epoc32/include/test
+
+
+SOURCEPATH		.	
+source       	T_EnvSlots.CPP
+
+USERINCLUDE     .
+USERINCLUDE 	..
+
+
+start resource T_EnvSlots_reg.rss
+targetpath /private/10003A3F/apps
+end
+
+start resource T_EnvSlots_loc.rss
+targetpath /resource/apps
+end
+
+LIBRARY		CONE.LIB   WS32.LIB
+LIBRARY		APPFWK_TEST_APPUI.LIB
+LIBRARY		EUSER.LIB
+LIBRARY		TESTEXECUTEUTILS.LIB  TestExecuteLogClient.LIB
+LIBRARY		APPARC.LIB EFSRV.LIB ESTOR.LIB GDI.LIB FBSCLI.LIB
+LIBRARY     APFILE.LIB APGRFX.LIB  BAFL.LIB APMIME.LIB
+LIBRARY		EIKCORE.LIB 
+LIBRARY		APSERV.LIB
+LIBRARY     ECOM.LIB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_EnvSlots/T_EnvSlots_loc.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,36 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file t_envslots_loc.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+
+RESOURCE LOCALISABLE_APP_INFO
+	{
+	short_caption = "T_EnvSlots";
+	caption_and_icon = 
+		{
+		CAPTION_AND_ICON_INFO
+			{
+			caption = "T_EnvSlots";
+			number_of_icons = 0;
+			}
+		};
+	}	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_EnvSlots/T_EnvSlots_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,37 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file t_envslots_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x102032AB
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="T_EnvSlots";
+	localisable_resource_file="\\resource\\apps\\T_EnvSlots_loc";
+	hidden=KAppNotHidden;
+	embeddability=KAppNotEmbeddable;
+	newfile=KAppDoesNotSupportNewFile;
+	launch=KAppLaunchInForeground;
+	}	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_ExeStep.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,111 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include <e32std.h>
+#include <e32uid.h>
+#include <e32base.h>
+#include <e32test.h>
+#include <apadef.h>
+#include "T_ExeStep.h"
+
+/**
+  Auxiliary Fn for Test Case ID T-ExeStep-doTestStepL
+ 
+  This function accepts the data passed to the thread function and prints it.
+  
+*/
+void CT_ExeStep::DoThings(const TApaCommandLine& aCommandLine)
+	{
+	INFO_PRINTF1(_L("The test exe has been loaded."));
+	INFO_PRINTF1(_L("\n"));
+	INFO_PRINTF1(aCommandLine);
+	INFO_PRINTF1(_L("\n"));
+	}
+
+CT_ExeStep::~CT_ExeStep()
+/**
+   Destructor
+ */
+	{
+	}
+
+CT_ExeStep::CT_ExeStep()
+/**
+   Constructor
+ */
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_ExeStep);
+	}
+
+TVerdict CT_ExeStep::doTestStepPreambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	SetTestStepResult(EPass);
+	return TestStepResult();
+	}
+
+TVerdict CT_ExeStep::doTestStepPostambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	return TestStepResult();
+	}
+	
+	
+/**
+   @SYMTestCaseID T-ExeStep-doTestStepL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test retrieving data from main thread of a process. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions The test creates a new process by calling the constructor of
+   RProcess. Call RProcess::CommandLine() to get a copy of data which is
+   passed to the thread function of the newly created process's main thread.
+   Pass the data thus copied to method DoThings() to print the information.\n
+   API Calls:\n	
+   RProcess::CommandLine(TDes& aCommand) const
+   
+   @SYMTestExpectedResults Test should create a new process and copy data from
+   main thread of newly created process.
+    
+ */
+TVerdict CT_ExeStep::doTestStepL()
+{
+	__UHEAP_MARK;
+    TApaCommandLine commandline;
+	User::CommandLine(commandline);
+    DoThings(commandline);
+	__UHEAP_MARKEND;
+
+	return TestStepResult();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_ExeStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,46 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code  
+*/
+
+#if (!defined __T_EXE_STEP_H__)
+#define __T_EXE_STEP_H__
+
+#include "ApparcTestServer.h"
+
+//!  A CT_ExeStep test class. 
+
+/**   Tests Retrieving data from main thread. */
+
+class CT_ExeStep : public CTestStep
+	{
+public:
+	CT_ExeStep();
+	~CT_ExeStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+//private:
+	void DoThings(const TApaCommandLine& aCommandLine);
+	};
+
+_LIT(KT_ExeStep,"T_Exe");
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_File1Step.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,172 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Tests CApaScanningFileRecognizer APIs.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <e32uid.h>
+#include <f32file.h>
+#include <fbs.h>
+#include <apadef.h>
+#include <apfrec.h>
+#include <apfctlf.h>
+#include <apgctl.h>
+#include <ecom.h>
+
+#include "tstapp.h"
+#include "T_File1Step.h"
+
+//
+#if !defined(__E32TEST_H__)
+#include <e32test.h>
+#endif
+
+const TUid KTestEcomFileRecognizerUid={0x101F7D8C};
+
+void CT_File1Step::setup()
+	{
+#if defined(__EPOC32__)
+	TFullName filePath=_L("c:\\docs\\tstapp.doc");
+	TFullName tempPath=_L("c:\\system\\temp\\");
+	// if we're on the rack create the directories we need
+	TParse parser;
+	parser.Set(filePath,NULL,NULL);
+	iFs.MkDirAll(parser.DriveAndPath());
+	parser.Set(tempPath,NULL,NULL);
+	iFs.MkDirAll(parser.DriveAndPath());
+#endif
+	}
+
+/**
+   @SYMTestCaseID T-FileStep-testScanningFileTheRecognizerL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions The method creates a scanning file recognizer object and observes whether
+   return values from RecognizerCount() and UpdateCounter() match with the
+   expected results. The setter function SetRecognizerL() is also tested with a recognizer
+   that doesn't exist to check if it would return KErrNotFound.\n
+   API Calls:\n	
+   CApaScanningFileRecognizer::NewL(RFs& aFs, MApaAppStarter* aAppStarter)\n
+   CApaScanningFileRecognizer::RecognizerCount()\n
+   CApaScanningFileRecognizer::UpdateCounter()\n
+   CApaScanningFileRecognizer::SetRecognizerL(const TRecognizer& aRecognizer)\n
+   
+   @SYMTestExpectedResults Test checks results against expected values.
+    
+ */
+void CT_File1Step::testScanningFileTheRecognizerL()
+	{
+	INFO_PRINTF1(_L("Testing the Scanning File-Recognizer"));
+	//
+	CActiveScheduler* scheduler = new(ELeave) CActiveScheduler();
+	CleanupStack::PushL(scheduler);
+	CActiveScheduler::Install(scheduler);
+	//
+	// construct - this scans for iRecognizer plug-ins
+	TRAPD(ret, iRecognizer=CApaScanningFileRecognizer::NewL(iFs,NULL));
+	TEST(ret==KErrNone);
+	// 06/09/99 SimonC: following tests updated as they'll fail when run with a baseline build
+	TEST(iRecognizer->RecognizerCount()>=2);
+	TEST(iRecognizer->UpdateCounter()>=2);
+
+	//for testing ecom style plugin
+	INFO_PRINTF1(_L("Testing the ecom style TTESTECOMFILEREC recognizer is loaded or not"));
+	CApaScanningFileRecognizer::TRecognizer testEcomFileRec;
+	testEcomFileRec.iUid=KTestEcomFileRecognizerUid;
+	testEcomFileRec.iDrive=25;
+	TRAP(ret,iRecognizer->SetEcomRecognizerL(testEcomFileRec));
+	TEST(ret==KErrNone);
+	TEST(iRecognizer->UpdateCounter()>=2);
+
+	INFO_PRINTF1(_L("Wait a couple of seconds to stop dlls closing too early...")); // stop the dll's being closed too early
+	User::After(2000000);
+	
+	delete iRecognizer;
+	CleanupStack::PopAndDestroy(scheduler);
+	}
+
+CT_File1Step::~CT_File1Step()
+/**
+   Destructor
+ */
+	{
+	}
+
+CT_File1Step::CT_File1Step()
+/**
+   Constructor
+ */
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_File1Step);
+	}
+
+TVerdict CT_File1Step::doTestStepPreambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	SetTestStepResult(EPass);
+	return TestStepResult();
+	}
+
+TVerdict CT_File1Step::doTestStepPostambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	return TestStepResult();
+	}
+
+TVerdict CT_File1Step::doTestStepL()
+/**
+  @return - TVerdict code
+  Override of base class virtual
+*/
+	{
+	INFO_PRINTF1(_L("Testing the APFILE dll..."));
+	//
+	// set up the directory structure
+	iFs.Connect();
+	setup();
+	//
+	// run the testcode (inside an alloc heaven harness)
+
+ 	__UHEAP_MARK;
+	TRAPD(r,testScanningFileTheRecognizerL());
+	TEST(r==KErrNone);
+	REComSession::FinalClose();	
+	__UHEAP_MARKEND;
+
+	iFs.Close();
+
+	INFO_PRINTF1(_L("Test completed!"));
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_File1Step.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,49 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#if (!defined __T_FILE1_STEP_H__)
+#define __T_FILE1_STEP_H__
+#include "ApparcTestServer.h"
+
+class CApaScanningFileRecognizer;
+
+//!  A CT_File1Step test class. 
+
+/**   A more elaborate class description. */
+
+class CT_File1Step : public CTestStep
+	{
+public:
+	CT_File1Step();
+	~CT_File1Step();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+	void testScanningFileTheRecognizerL();
+	void setup();
+private:
+	RFs iFs;
+	CApaScanningFileRecognizer* iRecognizer;
+	};
+
+_LIT(KT_File1Step,"T_File1");
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_File2Step.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,133 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Tests CApaAppRegFinder APIs.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include "T_File2Step.h"
+#include "..\apfile\aprfndr.h"
+
+//
+#if !defined(__E32TEST_H__)
+#include <e32test.h>
+#endif
+
+/**
+   @SYMTestCaseID T-FileStep-testFindAllAppsRegL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test CApaAppRegFinder::FindAllAppsL() API. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions The method creates an Application Finder object and calls
+   CApaAppRegFinder::FindAllAppsL() to perform a complete scan of all
+   available applications. It traverses through the application list by calling
+   CApaAppRegFinder::NextL() to confirm that the list contains entries.\n
+   API Calls:\n	
+   CApaAppRegFinder::FindAllAppsL()\n
+  
+   @SYMTestExpectedResults Test checks the number of applications present in the list.
+    
+ */
+void CT_File2Step::testFindAllAppsRegL()
+	{
+	INFO_PRINTF1(_L("Testing CApaAppRegFinder::FindAllAppsL()"));
+	RFs fSession;
+	fSession.Connect();
+	CApaAppRegFinder* regFinder=CApaAppRegFinder::NewL(fSession);
+	//
+	TRAPD(ret, regFinder->FindAllAppsL() );
+	TEST(ret==KErrNone);
+	//
+	TBool more=ETrue;
+	TInt count=0;
+	while (more) 
+		{
+		TApaAppEntry entry;
+		RPointerArray<HBufC> dummy;
+		TRAPD(ret, more=regFinder->NextL(entry, dummy) );
+		TEST(ret==KErrNone);
+		if (more)
+			count++;
+		}
+	TEST(count>0);
+	INFO_PRINTF2(_L("     Apps found: %D"),count);
+	//
+	delete regFinder;
+	fSession.Close();
+	}
+
+CT_File2Step::~CT_File2Step()
+/**
+   Destructor
+ */
+	{
+	}
+
+CT_File2Step::CT_File2Step()
+/**
+   Constructor
+ */
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_File2Step);
+	}
+
+TVerdict CT_File2Step::doTestStepPreambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	SetTestStepResult(EPass);
+	return TestStepResult();
+	}
+
+TVerdict CT_File2Step::doTestStepPostambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	return TestStepResult();
+	}
+
+TVerdict CT_File2Step::doTestStepL()
+/**
+  @return - TVerdict code
+  Override of base class virtual
+*/
+	{
+	INFO_PRINTF1(_L("Testing the APFILE dll..."));
+	//
+
+ 	__UHEAP_MARK;
+	TRAPD(r,testFindAllAppsRegL());
+	TEST(r==KErrNone);
+	__UHEAP_MARKEND;
+
+	INFO_PRINTF1(_L("Test completed!"));
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_File2Step.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,43 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code  
+*/
+
+#if (!defined __T_FILE2_STEP_H__)
+#define __T_FILE2_STEP_H__
+#include "ApparcTestServer.h"
+
+//!  A CT_File2Step test class. 
+
+/**   A more elaborate class description. */
+
+class CT_File2Step : public CTestStep
+	{
+public:
+	CT_File2Step();
+	~CT_File2Step();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+	void testFindAllAppsRegL();
+	};
+
+_LIT(KT_File2Step,"T_File2");
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_File3Step.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,604 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Tests CApaAppRegFinder APIs.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <apgicnfl.h>
+#include <e32property.h>
+#include "T_File3Step.h"
+#include "..\apfile\aprfndr.h"
+#include "TSidChecker\TestSidChecker.h"
+
+#include <e32test.h>
+#include <f32file.h>
+
+_LIT(KCallBackAppRsc,"\\private\\10003a3f\\import\\apps\\NonNative\\Resource\\10281fe0_reg.rsc");
+_LIT(KCallBackAppIst,"\\TestSidCheckerCallBackApp.ist");
+_LIT(KBadAppRsc,"\\private\\10003a3f\\import\\apps\\NonNative\\Resource\\10281fdc_reg.rsc");
+_LIT(KBadAppIst,"\\TestSidCheckerBadApp.ist");
+_LIT(KGoodAppRsc,"\\private\\10003a3f\\import\\apps\\NonNative\\Resource\\10281fdd_reg.rsc");
+_LIT(KGoodAppIst,"\\TestSidCheckerGoodApp.ist");
+_LIT(KForcedAppRsc, "\\private\\10003a3f\\import\\apps\\NonNative\\Resource\\102825b5_reg.rsc");
+_LIT(KForcedAppIst, "\\TestSidCheckerForcedApp.ist");
+_LIT(KTriggerRescanRsc,"\\private\\10003a3f\\import\\apps\\NonNative\\Resource\\102825b6_reg.rsc");
+_LIT(KTriggerRescanIst,"\\TestSidCheckerTriggerRescan.ist");
+_LIT(KMmcPrivateDir,"\\private\\10003a3f\\");
+_LIT(KAppRsc1,"\\private\\10003a3f\\import\\apps\\NonNative\\Resource\\A000D107_reg.rsc");
+_LIT(KAppRsc2,"\\private\\10003a3f\\import\\apps\\NonNative\\Resource\\A000D107_r02.rsc");
+_LIT(KAppRsc3,"\\private\\10003a3f\\import\\apps\\NonNative\\Resource\\A000D107_r03.rsc");
+_LIT(KAppIst, "\\TestSidCheckerMultipleRegistrationFilesApp.ist");
+
+CT_File3Step::CT_File3Step()
+/**
+   Constructor
+ */
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_File3Step);
+	}
+
+_LIT(KLitNativeExecutable, "z:\\sys\\bin\\SidCheckerTestDummy.exe");
+
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+TVerdict CT_File3Step::doTestStepPreambleL()
+	{
+	SetTestStepResult(EPass);
+	TInt err = iSession.Connect();
+	TEST(err==KErrNone);
+	err = iUtils.Connect();
+	TEST(err==KErrNone);
+	return TestStepResult();
+	}
+
+TVerdict CT_File3Step::doTestStepL()
+/**
+  @return - TVerdict code
+  Override of base class virtual
+*/
+	{
+	INFO_PRINTF1(_L("Testing the CAppSidChecker api"));
+	FindRemovableDriveAndSetPathL();
+	// Must be first, since the plugin must not be loaded when this is started.
+	//DONT_CHECK since changes on file system changes the heap
+ 	HEAP_TEST_LS_SESSION(iSession, 0, DONT_CHECK, TestRescanCallBackL(), REComSession::FinalClose() );
+	HEAP_TEST_LS_SESSION(iSession, 0, DONT_CHECK, TestAppPresenceL(), REComSession::FinalClose() );
+	HEAP_TEST_LS_SESSION(iSession, 0, DONT_CHECK, TestForceRegistrationL(), REComSession::FinalClose() );
+	HEAP_TEST_LS_SESSION(iSession, 0, DONT_CHECK, TestCorruptedRegFileL(), NO_CLEANUP );
+	HEAP_TEST_LS_SESSION(iSession, 0, DONT_CHECK, TestMultipleRegistrationFilesForSameAppL(), REComSession::FinalClose() );
+	
+	INFO_PRINTF1(_L("Test completed!"));
+	return TestStepResult();
+	}
+
+
+/**
+   @SYMTestCaseID UIFRAMEWORKS-APPARC-0047
+  
+   @SYMDEF INC069526
+  
+   @SYMTestCaseDesc When an implementation of the ApSidChecker interface invokes the rescan callback that was passed to it,
+                    the App list server should scan for application registration files. This tests that it does so.
+   
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Trigger the loading of a special plugin implementing the ApSidChecker interface
+                   Tell the loaded instance of the aforementioned implementation to trigger a rescan via pub&sub
+		    -> The plugin will invoke its callback
+		    -> The plugin will start a timer
+		    -> The timer will publish a result when either:
+		       a) it recieves an AppRegisteredAt() call -- this is part of the scan we tried to trigger. (success)
+		       b) the timer completes (failure)
+		   Retrieve the results from the plugin, again via pub & sub
+  
+   @SYMTestExpectedResults The Apparc App list server scans for new/removed apps when a plugins requests it
+ */
+void CT_File3Step::TestRescanCallBackL()
+	{
+	INFO_PRINTF1(_L("Testing CApaAppRegFinder::TestRescanCallBackL()"));
+
+	CleanupRegFilesL();
+
+	User::LeaveIfError(RProperty::Define(KApFileTestPubSubCategory, KApFileTestPubSubCallBackKey, RProperty::EInt));	
+	User::LeaveIfError(RProperty::Set(KApFileTestPubSubCategory, KApFileTestPubSubCallBackKey, CTestSidChecker::EPluginLoad));
+	
+	TProcessPriority oldPriority = RProcess().Priority();
+	RProcess().SetPriority(EPriorityLow); // so that we're pre-empted by the Apparc server when it does its scan
+
+	iSession.RegisterNonNativeApplicationTypeL(KApFileTestAppType, KLitNativeExecutable);
+	TRAPD(err, PrepareRegFileL(KApFileTestCallBackApp, iCallBackAppRsc, iCallBackAppIst));
+	TEST(err==KErrNone);
+	User::After(20 * 1000000);
+
+	TRequestStatus status;
+	RProperty property;
+	CleanupClosePushL(property);
+	User::LeaveIfError(RProperty::Set(KApFileTestPubSubCategory, KApFileTestPubSubCallBackKey, CTestSidChecker::ETriggerScan));
+	User::LeaveIfError(property.Attach(KApFileTestPubSubCategory, KApFileTestPubSubCallBackKey));
+	property.Subscribe(status);
+
+	RTimer timer;
+	CleanupClosePushL(timer);
+	User::LeaveIfError(timer.CreateLocal());
+	TRequestStatus timerStatus;
+	timer.After(timerStatus,30 * 1000000);
+	
+	User::WaitForRequest(status,timerStatus);
+	TEST(status != KRequestPending);
+	if(status != KRequestPending)
+		{
+		timer.Cancel();
+		User::WaitForRequest(timerStatus);
+		TInt result;	
+		User::LeaveIfError(RProperty::Get(KApFileTestPubSubCategory, KApFileTestPubSubCallBackKey, result));
+		TEST(result == CTestSidChecker::EScanOccurred);
+		}
+	else
+		{
+		property.Cancel();
+		User::WaitForRequest(status);
+		ASSERT(timerStatus != KRequestPending);
+		INFO_PRINTF1(_L("Timeout exceeded"));
+		}
+	
+	CleanupStack::PopAndDestroy(2,&property);
+	
+	RProcess().SetPriority(oldPriority);
+	
+	CleanupRegFilesL();
+	}
+
+/**
+   @SYMTestCaseID UIFRAMEWORKS-APPARC-0048
+  
+   @SYMDEF INC069526
+  
+   @SYMTestCaseDesc Test that the results of the AppRegisteredAt() function in the ApSidChecker ECOM interface are handled correctly
+   
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Create application registration files on a removable drive
+                   Iterate over all registration files with an instance of CApaAppRegFinder
+  
+   @SYMTestExpectedResults CApaAppRegFinder's list of entries contains KApFileTestGoodApp but not KApFileTestBadApp
+ */
+void CT_File3Step::TestAppPresenceL()
+	{
+	INFO_PRINTF1(_L("Testing CApaAppRegFinder::TestAppPresenceL()"));
+	
+	/*
+	 * Prepare registration files
+	 */
+	
+	CleanupRegFilesL();
+
+	iSession.RegisterNonNativeApplicationTypeL(KApFileTestAppType, KLitNativeExecutable);
+	TRAPD(err, PrepareRegFileL(KApFileTestBadApp, iBadAppRsc, iBadAppIst));
+	TEST(err==KErrNone);
+	TRAP(err, PrepareRegFileL(KApFileTestGoodApp, iGoodAppRsc, iGoodAppIst));
+	TEST(err==KErrNone);
+
+	/*
+	 * Manually scan files
+	 */
+	RFs fSession;
+	User::LeaveIfError(fSession.Connect());
+	CleanupClosePushL(fSession);
+	CApaAppRegFinder* regFinder=CApaAppRegFinder::NewLC(fSession);
+
+	TRAPD(ret, regFinder->FindAllAppsL() );
+	TEST(ret==KErrNone);
+
+	TBool more = ETrue;
+	TBool foundGoodApp = EFalse;
+	TBool foundBadApp = EFalse;
+	while (more)
+		{
+		TApaAppEntry entry;
+		RPointerArray<HBufC> dummy;
+		TRAPD(ret, more=regFinder->NextL(entry, dummy) );
+		TEST(ret==KErrNone);
+		if(entry.iUidType[2] == KApFileTestBadApp)
+			foundBadApp = ETrue;
+		if(entry.iUidType[2] == KApFileTestGoodApp)
+			foundGoodApp = ETrue;
+		}
+	TEST(foundGoodApp);
+	TEST(!foundBadApp);
+
+	CleanupStack::PopAndDestroy(2,&fSession);	
+
+	/*
+	 * Cleanup
+	 */	
+	CleanupRegFilesL();
+	}
+
+/**
+   @SYMTestCaseID UIFRAMEWORKS-APPARC-0051
+  
+   @SYMDEF INC084770
+  
+   @SYMTestCaseDesc Test that the AppRegisteredAt check can be overridden
+   
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Installs an application for which AppRegisteredAt returns EFalse. Then adds this
+   application to a list of applications for which the results of AppRegisteredAt will be ignored and
+   tests that the application appears in the list of apps.
+  
+   @SYMTestExpectedResults CApaAppList contains the application.
+ */	
+void CT_File3Step::TestForceRegistrationL()
+	{
+	INFO_PRINTF1(_L("Testing RApaLsSession::ForceRegistrationL()"));
+	
+	/*
+	 * Prepare registration files
+	 */
+	CleanupRegFilesL();
+	
+	// Install the test application
+	iSession.RegisterNonNativeApplicationTypeL(KApFileTestAppType, KLitNativeExecutable);
+	TRAPD(err, PrepareRegFileL(KApFileTestForcedRegistration, iForcedAppRsc, iForcedAppIst));
+	TEST(err==KErrNone);
+	
+	// Wait for a rescan and check that the application is not in the list
+	RPointerArray<TDesC> dummy;
+	err = iSession.ForceRegistration(dummy);
+	TApaAppInfo info;
+	err = iSession.GetAppInfo(info,KApFileTestForcedRegistration);
+	TEST(err==KErrNotFound);
+	
+	// Add the application to the list of applications that ignore the AppRegisteredAt test
+	RPointerArray<TDesC> regFiles;
+	_LIT(KRegFile2, "test2");	// Add a second dummy registration file just to check that this works
+	regFiles.Append(iForcedAppRsc.AllocL());
+	regFiles.Append(KRegFile2().AllocL());
+	err = iSession.ForceRegistration(regFiles);
+	TEST(err==KErrNone);
+	regFiles.ResetAndDestroy();
+	err = iSession.GetAppInfo(info,KApFileTestForcedRegistration);
+	TEST(err==KErrNone);
+	
+	// triggers a rescan from the sid checker, this will cause the 
+	// list to be emptied
+	TRAP(err, PrepareRegFileL(KApTriggerRescan, iTriggerRescanRsc, iTriggerRescanIst));
+	TEST(err==KErrNone);
+	
+	// Now the app should not be listed anymore as we have removed it from the "force" list
+	err = iSession.ForceRegistration(dummy);			
+	err = iSession.GetAppInfo(info,KApFileTestForcedRegistration);
+	TEST(err==KErrNotFound);
+	
+	/*
+	 * Cleanup
+	 */	
+	CleanupRegFilesL();
+	}
+
+void CT_File3Step::PrepareRegFileL(const TUid& aUid, const TDesC& aRscFile, const TDesC& aLogicalExecutable)
+	{
+	CApaRegistrationResourceFileWriter* const registrationResourceFileWriter =
+			CApaRegistrationResourceFileWriter::NewL(aUid,
+				                                         aLogicalExecutable,
+		    	                                     TApaAppCapability::ENonNative);
+	CleanupStack::PushL(registrationResourceFileWriter);
+
+	iSession.PrepareNonNativeApplicationsUpdatesL();
+	iSession.RegisterNonNativeApplicationL(KApFileTestAppType, iDrive, *registrationResourceFileWriter, NULL, NULL);
+	iSession.CommitNonNativeApplicationsUpdatesL();
+	TBool present = EFalse;
+	User::LeaveIfError(iUtils.IsFilePresent(aRscFile, present));
+	TEST(present);
+	
+	CleanupStack::PopAndDestroy(registrationResourceFileWriter);
+	}
+
+void CT_File3Step::CleanupRegFilesL()
+	{
+	iSession.PrepareNonNativeApplicationsUpdatesL();
+	iSession.DeregisterNonNativeApplicationL(KApFileTestBadApp);
+	iSession.DeregisterNonNativeApplicationL(KApFileTestGoodApp);
+	iSession.DeregisterNonNativeApplicationL(KApFileTestCallBackApp);
+	iSession.DeregisterNonNativeApplicationL(KApFileTestForcedRegistration);
+	iSession.DeregisterNonNativeApplicationL(KApTriggerRescan);
+	iSession.DeregisterNonNativeApplicationL(KApFileTestAppWithMultipleRegistrationFiles);
+	iSession.CommitNonNativeApplicationsUpdatesL();
+	iSession.DeregisterNonNativeApplicationTypeL(KApFileTestAppType);
+	RFs fSession;
+	User::LeaveIfError(fSession.Connect());
+	CleanupClosePushL(fSession);
+	CFileMan* fMan = CFileMan::NewL(fSession);
+	CleanupStack::PushL(fMan);
+	TInt err = fMan->Delete(iMmcPrivateDir, CFileMan::ERecurse);
+	if(err != KErrNone && err != KErrNotFound && err != KErrPathNotFound)
+		{
+		User::Leave(err);
+		}
+	CleanupStack::PopAndDestroy(2,&fSession);
+	}
+	
+/**
+   @SYMTestCaseID UIFRAMEWORKS-APPARC-0052
+  
+   @SYMDEF INC87806
+  
+   @SYMTestCaseDesc Test that apparc does not stop scanning its list of registration files after scanning a corrupted registration file.
+   
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Copy a corrupted registration file into C:\\Private\\10003a3f\\import\\apps\\. Register a non-native application. Force apparc to rescan. Since non-native applications
+   					are scanned after native ones, we eliminate the risk that the corrupted registration file is scanned after the non-native one. Call GetAppInfo on non-native application.
+  
+   @SYMTestExpectedResults Apparc successfully scans the non-native app. Calling GetAppInfo on the non-native app returns KErrNone. 
+ */	
+void CT_File3Step::TestCorruptedRegFileL()
+	{
+	INFO_PRINTF1(_L("TestCorruptedRegFileL about to start..."));	
+	_LIT(KCorruptedSourceFileName, "Z:\\ApparcTest\\Corrupted_reg.RSC"); // corrupted_reg.rsc file is pre-built.
+	_LIT(KCorruptedTargetFileName, "C:\\Private\\10003a3f\\import\\apps\\Corrupted_reg.RSC");
+	_LIT(KDir, "C:\\private\\10003a3f\\import\\apps\\");
+	_LIT(KNonNativeFileName,"C:\\private\\10003a3f\\import\\apps\\NonNative\\Resource\\NonCorrupted_reg.rsc");
+	_LIT(KLitNoncorruptedExe, "z:\\sys\\bin\\NonCorrupted.exe");
+	const TUid KNonCorruptedAppUid = {0x102826DE};
+
+	RFs	fs;
+ 	User::LeaveIfError(fs.Connect());
+ 	CleanupClosePushL(fs);
+  	TInt ret = fs.MkDirAll(KDir);
+	if (ret != KErrAlreadyExists)
+		{
+		User::LeaveIfError(ret);			
+		}
+  	CFileMan* fileManager = CFileMan::NewL(fs);
+ 	CleanupStack::PushL(fileManager);
+	ret = fileManager->Copy(KCorruptedSourceFileName, KCorruptedTargetFileName, CFileMan::EOverWrite);
+	TEST(ret==KErrNone);
+
+	CApaRegistrationResourceFileWriter* const registrationResourceFileWriter=CApaRegistrationResourceFileWriter::NewL(KNonCorruptedAppUid,KNonNativeFileName,TApaAppCapability::ENonNative);
+	CleanupStack::PushL(registrationResourceFileWriter);
+	iSession.PrepareNonNativeApplicationsUpdatesL();
+	iSession.RegisterNonNativeApplicationTypeL(KApFileTestAppType,KLitNoncorruptedExe);
+	iSession.RegisterNonNativeApplicationL(KApFileTestAppType, EDriveC, *registrationResourceFileWriter, NULL, NULL);
+	iSession.CommitNonNativeApplicationsUpdatesL();
+	
+	RPointerArray<TDesC> empty;
+	ret = iSession.ForceRegistration(empty);
+	TEST(ret==KErrNone);
+	TApaAppInfo appInfo;
+	ret = iSession.GetAppInfo(appInfo,KNonCorruptedAppUid);
+	TEST(ret==KErrNone);
+	
+	iSession.PrepareNonNativeApplicationsUpdatesL();
+	iSession.DeregisterNonNativeApplicationL(KNonCorruptedAppUid);
+	iSession.DeregisterNonNativeApplicationTypeL(KApFileTestAppType);
+	iSession.CommitNonNativeApplicationsUpdatesL();
+	fileManager->RmDir(KDir);
+
+	CleanupStack::PopAndDestroy(registrationResourceFileWriter);
+	CleanupStack::PopAndDestroy(fileManager);
+	CleanupStack::PopAndDestroy(&fs);
+	}
+
+/**
+   @SYMTestCaseID UIFRAMEWORKS-APPARC-0102
+  
+   @SYMDEF PDEF139147
+  
+   @SYMTestCaseDesc Test that apparc calls sid checker only once for multiple registration resource file for same application.
+   
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Make copies of a registration resource file in the removable drive. Plugin implementing the ApSidChecker 
+   					interface will set a Pub&Sub value everytime it is called. Check that it has been called only once.
+  
+   @SYMTestExpectedResults Pub&Sub value has been set only once by the SidChecker plugin. 
+ */	
+void CT_File3Step::TestMultipleRegistrationFilesForSameAppL()
+	{
+	INFO_PRINTF1(_L("Testing Multiple registration files for same application"));
+	
+	//Cleanup registration files
+	CleanupRegFilesL();
+	
+ 	// Install the test application
+	iSession.RegisterNonNativeApplicationTypeL(KApFileTestAppType, KLitNativeExecutable);
+	TRAPD(err, PrepareRegFileL(KApFileTestAppWithMultipleRegistrationFiles, iAppRsc1, iAppIst));
+	TEST(err==KErrNone);
+	INFO_PRINTF1(_L("Reg File 1 commited"));
+ 	
+	RFs	fs;
+ 	User::LeaveIfError(fs.Connect());
+ 	CleanupClosePushL(fs);
+  	TInt ret = fs.MkDirAll(KMmcPrivateDir);
+	if (ret != KErrAlreadyExists)
+		{
+		User::LeaveIfError(ret);			
+		}
+	CFileMan* fileManager = CFileMan::NewL(fs);
+ 	CleanupStack::PushL(fileManager);
+ 	//Make copies of the registration resource files.
+	ret = fileManager->Copy(iAppRsc1, iAppRsc2, CFileMan::EOverWrite);
+	TEST(ret==KErrNone);
+	TBool present = EFalse;
+	User::LeaveIfError(iUtils.IsFilePresent(iAppRsc2, present));
+	TEST(present);
+	INFO_PRINTF1(_L("Reg File 2 created"));
+	
+	ret = fileManager->Copy(iAppRsc1, iAppRsc3, CFileMan::EOverWrite);
+	TEST(ret==KErrNone);
+	present = EFalse;
+	User::LeaveIfError(iUtils.IsFilePresent(iAppRsc3, present));
+	TEST(present);
+	INFO_PRINTF1(_L("Reg File 3 created"));
+	
+	TProcessPriority oldPriority = RProcess().Priority();
+	RProcess().SetPriority(EPriorityLow); // so that we're pre-empted by the Apparc server when it does its scan
+	
+	TRequestStatus status;
+	RProperty property;
+	CleanupClosePushL(property);
+	User::LeaveIfError(RProperty::Set(KApFileTestPubSubCategory, KApFileTestPubSubCallBackKey, CTestSidChecker::EPropertyDefault));
+	User::LeaveIfError(property.Attach(KApFileTestPubSubCategory, KApFileTestPubSubCallBackKey));
+	property.Subscribe(status);
+
+	RTimer timer;
+	CleanupClosePushL(timer);
+	User::LeaveIfError(timer.CreateLocal());
+	TRequestStatus timerStatus;
+	timer.After(timerStatus,50 * 1000000);
+	
+	RPointerArray<TDesC> empty;
+	ret = iSession.ForceRegistration(empty);
+	TEST(ret==KErrNone);
+	
+	// Wait for a rescan
+	User::WaitForRequest(status,timerStatus);
+	TEST(status != KRequestPending);
+	if(status != KRequestPending)
+		{
+		timer.Cancel();
+		User::WaitForRequest(timerStatus);
+		TInt result;	
+		User::LeaveIfError(RProperty::Get(KApFileTestPubSubCategory, KApFileTestPubSubCallBackKey, result));
+		TEST(result == CTestSidChecker::ECheckedOnce);
+		}
+	else
+		{
+		property.Cancel();
+		User::WaitForRequest(status);
+		TEST(timerStatus != KRequestPending);
+		INFO_PRINTF1(_L("Timeout exceeded"));
+		}
+		
+	RProcess().SetPriority(oldPriority);
+	
+	INFO_PRINTF1(_L("Removing duplicate reg files"));
+	TTime tempTime(0); // added tempTime to avoid asynch CFileMan::Attribs request completing with KErrArgument
+	
+	TEST(fileManager->Attribs(iAppRsc2,0,KEntryAttReadOnly,tempTime,CFileMan::ERecurse,status)==KErrNone);
+	User::WaitForRequest(status);
+	TEST(status.Int()==KErrNone);
+ 	TEST(KErrNone==fileManager->Delete(iAppRsc2,CFileMan::ERecurse));
+ 	
+ 	TEST(fileManager->Attribs(iAppRsc3,0,KEntryAttReadOnly,tempTime,CFileMan::ERecurse,status)==KErrNone);
+	User::WaitForRequest(status);
+	TEST(status.Int()==KErrNone);
+ 	TEST(KErrNone==fileManager->Delete(iAppRsc3,CFileMan::ERecurse));
+ 
+ 	CleanupStack::PopAndDestroy(4,&fs);
+	CleanupRegFilesL();
+	}
+	
+void CT_File3Step::FindRemovableDriveAndSetPathL()
+{
+#if defined(__WINS__)
+	// The removable media is expected at X: on emulator.
+	iDrive = EDriveX;
+#else
+
+	RFs	fs;
+ 	User::LeaveIfError(fs.Connect());
+
+	// The removable media is expected at D: on NAND ROM and at E: on normal ROMs.
+	//The following code works on techview but not guaranteed to work on all platforms. 
+	TDriveInfo driveInfo;
+	TInt err = fs.Drive(driveInfo, EDriveD);
+	if(err == KErrNone && ((driveInfo.iDriveAtt & KDriveAttRemovable) != 0))
+		{
+	 	 // Use drive D
+	 	 iDrive = EDriveD;
+	 	}
+	 else
+	 	{
+		err = fs.Drive(driveInfo, EDriveE);
+		if(err == KErrNone && ((driveInfo.iDriveAtt & KDriveAttRemovable) != 0))
+			{
+		 	// Use drive E
+		 	iDrive = EDriveE;
+		 	}
+		}
+	fs.Close();
+#endif
+	iCallBackAppRsc = iDrive.Name();
+	iCallBackAppIst = iDrive.Name();
+	iBadAppRsc = iDrive.Name();
+	iBadAppIst = iDrive.Name();
+	iGoodAppRsc = iDrive.Name();
+	iGoodAppIst = iDrive.Name();
+	iForcedAppRsc = iDrive.Name();
+	iForcedAppIst = iDrive.Name();
+	iTriggerRescanRsc = iDrive.Name();
+	iTriggerRescanIst = iDrive.Name();
+	iMmcPrivateDir = iDrive.Name();
+	iAppRsc1 = iDrive.Name();
+	iAppRsc2 = iDrive.Name();
+	iAppRsc3 = iDrive.Name();
+	iAppIst = iDrive.Name();
+	
+	iCallBackAppRsc.Append(KCallBackAppRsc);
+	iCallBackAppIst.Append(KCallBackAppIst);
+	iBadAppRsc.Append(KBadAppRsc);
+	iBadAppIst.Append(KBadAppIst);
+	iGoodAppRsc.Append(KGoodAppRsc);
+	iGoodAppIst.Append(KGoodAppIst);
+	iForcedAppRsc.Append(KForcedAppRsc);
+	iForcedAppIst.Append(KForcedAppIst);
+	iTriggerRescanRsc.Append(KTriggerRescanRsc);
+	iTriggerRescanIst.Append(KTriggerRescanIst);
+	iMmcPrivateDir.Append(KMmcPrivateDir);
+	iAppRsc1.Append(KAppRsc1);
+	iAppRsc2.Append(KAppRsc2);
+	iAppRsc3.Append(KAppRsc3);
+	iAppIst.Append(KAppIst);
+}
+
+TVerdict CT_File3Step::doTestStepPostambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	iSession.Close();
+	iUtils.Close();
+	return TestStepResult();
+	}
+
+CT_File3Step::~CT_File3Step()
+/**
+   Destructor
+ */
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_File3Step.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,79 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code  
+*/
+
+#ifndef __T_FILE3_STEP_H__
+#define __T_FILE3_STEP_H__
+
+#include "ApparcTestServer.h"
+
+#include "testableapalssession.h"
+#include <ecom.h>
+#include <appfwk_test_utils.h>
+
+class CTestSidChecker;
+
+//!  A CT_File3Step test class. 
+
+/** Test the CAppSidChecker Interface. */
+
+class CT_File3Step : public CTestStep
+	{
+public:
+	CT_File3Step();
+	~CT_File3Step();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+	void TestAppPresenceL();
+	void TestRescanCallBackL();
+	void TestForceRegistrationL();
+	void TestCorruptedRegFileL();	
+	void TestMultipleRegistrationFilesForSameAppL();	
+private:
+	void PrepareRegFileL(const TUid& aUid, const TDesC& aRscFile, const TDesC& aLogicalExecutable);
+	void CleanupRegFilesL();
+	void FindRemovableDriveAndSetPathL();
+private:
+	RTestableApaLsSession iSession;
+	REComSession iEComSession;
+	CTestSidChecker* iTestSidChecker;
+	RSmlTestUtils iUtils;
+	TBuf<128> iCallBackAppRsc;
+	TBuf<64> iCallBackAppIst;
+	TBuf<128> iBadAppRsc;
+	TBuf<64> iBadAppIst;
+	TBuf<128> iGoodAppRsc;
+	TBuf<64> iGoodAppIst;
+	TBuf<128> iForcedAppRsc;
+	TBuf<64> iForcedAppIst;
+	TBuf<128> iTriggerRescanRsc;
+	TBuf<64> iTriggerRescanIst;
+	TBuf<64> iMmcPrivateDir;
+	TBuf<128> iAppRsc1;
+	TBuf<128> iAppRsc2;
+	TBuf<128> iAppRsc3;
+	TBuf<128> iAppIst;
+	TDriveUnit iDrive;
+	};
+
+_LIT(KT_File3Step,"T_File3");
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_Foreground.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,333 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// @file
+// @internalComponent - Internal Symbian test code
+// Test for UIKON GT0143 Typhoon Work Series 60 Changes
+// REQ758.8: Change TApaTask::BringToForeground to send a 
+// EApaSystemEventBroughtToForeground to the relevant window group
+// This test requires Apparc\Tsrc\SampleApp to be built first
+// The test runs in the full GUI emulator and can be launched from
+// z:\system\programs\t_foreground.dll
+// This test is fully automated and performs the following tasks
+// - Launches SampleApp
+// - Calls TApaTask::BringToForeground to send a Window Server
+// event to SimpleApparcTestApp
+// - Waits on a Rendezvous in the process
+// - SimpleApparcTestApp handles the window server event by overriding
+// CCoeAppUi::HandleSystemEventL
+// - SimpleApparcTestApp's HandleSystemEventL checks the window server event
+// is of type EApaSystemEventBroughtToForeground and if so signals 
+// using a Rendezvous in the process
+// - T_Foreground closes SimpleApparcTestApp
+// This test calls TApaTask::BringToForeground on SimpleApparcTestApp to send
+// a window server message to SimpleApparcTestApp
+// 
+//
+
+
+
+#include <coeaui.h>
+#include <coemain.h>
+#include <coedef.h>
+#include <coecntrl.h>
+#include <basched.h>
+#include <ecom.h>
+#include <apparc.h>
+#include <e32cmn.h>
+
+#include <apgtask.h>
+
+#include <apacmdln.h>
+#include <apgcli.h>
+#include <apgwgnam.h>
+#include <e32base.h>
+#include <eikenv.h>
+
+#include "t_foreground.h"
+
+_LIT(KAppName, "SimpleApparcTestApp");
+_LIT(KAppFileName, "z:\\sys\\bin\\SimpleApparcTestApp.exe");
+_LIT(KAppFile, "c:\\logs\\testApp.txt");
+const TInt KNonExistantWgId = KErrNotFound;
+
+////////////////////////////////////////////////////////////////////////////////////
+//
+// The CTestDriver class runs a series of tests on timer callback
+//
+////////////////////////////////////////////////////////////////////////////////////
+
+CTestDriver::CTestDriver(CCoeAppUi& aAppUi) : iAppUi(aAppUi)
+	{
+	}
+
+CTestDriver::~CTestDriver()
+	{
+	}
+
+void CTestDriver::LoadAppL()
+	{
+	TBuf<256> fileNameBuf(KAppFileName);
+	TFileName appName = fileNameBuf;
+
+	CApaCommandLine* cmdLine=CApaCommandLine::NewLC();
+	cmdLine->SetExecutableNameL(appName);
+	cmdLine->SetCommandL(EApaCommandOpen);
+	RApaLsSession ls;
+
+	User::LeaveIfError(ls.Connect());
+	CleanupClosePushL(ls);
+	User::LeaveIfError(ls.StartApp(*cmdLine));
+	CleanupStack::PopAndDestroy(2); // ls and cmdLine
+	}
+
+void CTestDriver::BringToForegroundL()
+	{
+    User::After(10000000);
+	TApaTaskList taskList(CCoeEnv::Static()->WsSession());
+	TApaTask task = taskList.FindApp(KAppName);
+
+	RThread thread;
+	User::LeaveIfError(thread.Open(task.ThreadId()));
+	CleanupClosePushL(thread);
+	RProcess process;
+	User::LeaveIfError(thread.Process(process));
+	CleanupClosePushL(process);
+
+	TRequestStatus requestStatus;
+	process.Rendezvous(requestStatus);
+	task.BringToForeground();	
+	User::WaitForRequest(requestStatus);
+	CleanupStack::PopAndDestroy(&process);
+	CleanupStack::PopAndDestroy(&thread);
+
+	User::LeaveIfError(requestStatus.Int());
+	}
+
+void CTestDriver::CloseAppL()
+	{
+	TApaTaskList taskList(CCoeEnv::Static()->WsSession());
+	TApaTask task = taskList.FindApp(KAppName);
+	User::LeaveIfError(task.Exists());
+	task.KillTask();
+	}
+
+
+/** 
+   @SYMTestCaseID APPFWK-APPARC-0053
+  
+   @SYMDEF DEF092013 
+  
+   @SYMTestCaseDesc Tests Whether the TApaTask::SwitchCreateFile returns the right return code.
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions	Give a NonExistant file name that has to be created.This method checks that 
+   the file does not get created but on its default implementation returns KErrNone or System Wide errors.
+   		
+   
+   @SYMTestExpectedResults The test passes if the return value is KErrNone , It means the request has been successfuly sent to 
+   the windows Server session.
+*/
+
+TInt CTestDriver::SwitchCreate()
+	{
+	TApaTaskList taskList(CCoeEnv::Static()->WsSession());
+	TApaTask task = taskList.FindApp(KAppName);
+	
+	TInt errForCreate=task.SwitchCreateFile(KAppFile);
+	return errForCreate;
+	}
+
+
+/**
+   @SYMTestCaseID APPFWK-APPARC-0054. 
+  
+   @SYMDEF DEF092013 
+  
+   @SYMTestCaseDesc Tests Whether the TApaTask::SwitchOpenFile returns the right return code.
+   
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions	Give a NonExistant file name that has to be Opened.This method checks that 
+   the file does not get opened but on its default implementation returns KErrNone or System Wide errors.
+   		
+   
+   @SYMTestExpectedResults The test passes if the return value is KErrNone , It means the request has been successfuly sent to 
+   the windows Server session.
+
+
+*/
+TInt CTestDriver::SwitchOpen()
+	{
+	TApaTaskList taskList(CCoeEnv::Static()->WsSession());
+	TApaTask task = taskList.FindApp(KAppName);
+	
+	TInt errForOpen=task.SwitchOpenFile(KAppFile);
+	return errForOpen;
+	}
+	
+/**
+   @SYMTestCaseID T_Foreground-CloseNonExistantWindowGroupTask
+  
+   @SYMDEF INC086383
+  
+   @SYMTestCaseDesc Tests CloseNonExistantWindowGroupTask to ensure that the kernel doesn't get terminated when KillTask() is called on a non-existant window group Id.
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions	First, construct TApaTask with a non-existant window group Id. Then close the app by calling KillTask().
+   		API Calls:\n	
+   		TApaTask::SetWgId(TInt aWgId);\n
+   		TApaTask::KillTask();\n
+   
+   @SYMTestExpectedResults The test passes if it is able to complete without the test being killed off.
+ */
+void CTestDriver::CloseNonExistantWindowGroupTask()
+	{
+	// close the app with a non-existant window group ID
+	TApaTask task(CCoeEnv::Static()->WsSession());
+	task.SetWgId(KNonExistantWgId);
+
+	// KillTask has not effect on a non existing task
+	task.KillTask();
+	}
+
+class CTestDriver;
+
+
+////////////////////////////////////////////////////////////////////////////////////
+//
+// class CTestForegroundAppUi 
+//
+////////////////////////////////////////////////////////////////////////////////////
+
+CTestForegroundAppUi::CTestForegroundAppUi(CTestStep* aStep) : CTestCoeAppUi(aStep)
+	{	
+	}
+
+void CTestForegroundAppUi::ConstructL()
+	{
+	CTestCoeAppUi::ConstructL();
+	iDriver=new (ELeave) CTestDriver(*this); 
+	AutoTestManager().StartAutoTest();
+	}
+
+
+CTestForegroundAppUi::~CTestForegroundAppUi()
+	{
+	delete iDriver;
+	}
+
+void CTestForegroundAppUi::RunTestStepL(TInt aNumStep)
+	{
+	User::After(TTimeIntervalMicroSeconds32(1000000));
+	switch(aNumStep)
+		{	 
+		case 1:	
+			{
+			INFO_PRINTF1(_L("LoadingApp"));
+			TRAPD(ret, iDriver->LoadAppL());
+			TEST(ret==KErrNone);
+			}	
+			break;
+		case 2:
+			{
+			INFO_PRINTF1(_L("TApaTask::BringToForeground"));
+			TRAPD(ret, iDriver->BringToForegroundL());
+			TEST(ret==KErrNone);
+			}
+			break;
+		case 3:
+			INFO_PRINTF1(_L("TApaTask::SwitchCreate"));
+			TEST(iDriver->SwitchCreate()==KErrNone);
+			break;
+		case 4:
+			INFO_PRINTF1(_L("TApaTask::SwitchOpen"));
+			TEST(iDriver->SwitchOpen()==KErrNone);
+			break;
+		case 5:
+			INFO_PRINTF1(_L("Closing App"));
+			TRAPD(ret, iDriver->CloseAppL());
+			TEST(ret==KErrNone);
+			break;
+		case 6:
+			INFO_PRINTF1(_L("Closing App with an invalid window group ID"));
+			//There's no return value here we can check. The system doesn't complain about closing a non existant task
+			iDriver->CloseNonExistantWindowGroupTask();
+			break;
+		case 7:
+			AutoTestManager().FinishAllTestCases(CAutoTestManager::EPass);
+			break;
+		default:
+			break;
+		}
+	}
+
+
+////////////////////////////////////////////////////////////////////////////////////
+//
+// class CTestForegroundStep
+//
+////////////////////////////////////////////////////////////////////////////////////
+
+CTestForegroundStep::CTestForegroundStep()
+	{
+	SetTestStepName(KTestForegroundStep);
+	}
+
+CTestForegroundStep::~CTestForegroundStep()
+	{
+	}
+
+
+void CTestForegroundStep::ConstructAppL(CCoeEnv* aCoe)
+    { // runs inside a TRAP harness
+	aCoe->ConstructL();
+	CTestForegroundAppUi* appUi= new (ELeave) CTestForegroundAppUi(this);
+    aCoe->SetAppUi(appUi);
+    appUi->ConstructL();
+    }
+
+
+TVerdict CTestForegroundStep::doTestStepL() // main function called by E32
+	{
+	INFO_PRINTF1(_L("Test Started"));
+	
+	PreallocateHALBuffer();
+
+	__UHEAP_MARK;
+
+	CCoeEnv* coe=new(ELeave) CCoeEnv;
+	TRAPD(err,ConstructAppL(coe));
+
+	if (!err)
+		coe->ExecuteD();
+	else
+		{
+		SetTestStepResult(EFail);
+		delete coe;
+		}
+
+	REComSession::FinalClose();	
+
+	__UHEAP_MARKEND;
+
+	INFO_PRINTF1(_L("Test Finished"));
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_Foreground.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,93 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#ifndef		__T_FOREGROUND_H
+#define		__T_FOREGROUND_H
+
+
+#include <TestExecuteStepBase.h>
+#include "ApparcTestServer.h"
+#include "appfwk_test_AppUi.h"
+
+
+const TInt KTVwaStandardAppUiId=0;
+
+//
+// A CBase Derived Class
+//
+class CTestDriver : public CBase
+	{
+public:
+	CTestDriver(CCoeAppUi& aAppUi);
+	~CTestDriver();
+public:
+	void LoadAppL();
+	void CloseAppL();
+	void BringToForegroundL();
+	TInt SwitchCreate();
+	TInt SwitchOpen();
+	void CloseNonExistantWindowGroupTask();
+private:
+	inline CTestAppUi& AppUi(TInt aAppUiId=KTVwaStandardAppUiId); 
+private:
+	TInt iTestNum;
+	TInt iState;
+	CCoeAppUi& iAppUi;
+	};
+
+
+//
+// A CTestStep Derived Class
+//
+class CTestForegroundStep : public CTestStep
+	{
+public:
+	CTestForegroundStep();
+	~CTestForegroundStep();
+	virtual TVerdict doTestStepL();
+	void ConstructAppL(CCoeEnv* aCoe);
+private:
+	};
+
+
+//
+// A CTestCoeAppUi derived Class
+//
+class CTestForegroundAppUi : public CTestCoeAppUi
+    {
+public:	// from CCoeAppUi
+	CTestForegroundAppUi(CTestStep* aStep);
+	~CTestForegroundAppUi();
+	void ConstructL();
+	void RunTestStepL(TInt aNumStep);
+private:
+	CTestDriver* iDriver;
+    };
+
+
+//
+// Test Step Name
+//
+_LIT(KTestForegroundStep, "T_Foreground");
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_IntegritySupportRebootStep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,224 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code  
+*/
+
+#include "T_IntegritySupportRebootStep.h"
+
+/**
+ * Constructor
+ */	
+CT_IntegritySupportReboot1TestStep::CT_IntegritySupportReboot1TestStep()
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_IntegritySupportReboot1Step);
+	}
+
+/**
+ * Destructor
+ */
+CT_IntegritySupportReboot1TestStep::~CT_IntegritySupportReboot1TestStep()
+	{
+	iSession.Close();
+	iUtils.Close();
+	}
+
+/**
+ * @return - TVerdict code
+ * Override of base class virtual
+ */	
+TVerdict CT_IntegritySupportReboot1TestStep::doTestStepPreambleL()
+	{
+	SetTestStepResult(EPass);
+	doAbstractNonNativeAppsTestStepPreambleL();
+	return TestStepResult();
+	}
+
+/**
+ * @return - TVerdict code
+ * Override of base class virtual
+ */
+TVerdict CT_IntegritySupportReboot1TestStep::doTestStepPostambleL()
+	{
+	return TestStepResult();
+	}
+
+TVerdict CT_IntegritySupportReboot1TestStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Testing Apparc...T_IntegritySupportReboot1 Test Cases Running..."));
+
+	TRAPD(ret,RunTestCasesL())
+	TEST(ret==KErrNone);
+	
+	INFO_PRINTF1(_L("...T_IntegritySupportReboot1 Test Cases Completed."));
+
+	return TestStepResult();
+	}
+	
+TInt CT_IntegritySupportReboot1TestStep::RunTestCasesL()
+	{
+	//DONT_CHECK due to recreation of applist on server
+	HEAP_TEST_LS_SESSION(iSession, 0, DONT_CHECK, TestSetupL(), NO_CLEANUP);
+	
+	return KErrNone;
+	}
+	
+_LIT(KLitLogicalExecutable1, "c:\\TestIntegritySupportReboot1.ist");
+_LIT(KLitRegistrationFile1,"c:\\private\\10003a3f\\import\\apps\\NonNative\\Resource\\102081ce_reg.rsc");
+static const CT_AbstractNonNativeAppsTestStep::TTestAppDetails KApplication1(0x102081CE,KLitLogicalExecutable1,KLitRegistrationFile1);
+
+
+_LIT(KLitLogicalExecutable2, "c:\\TestIntegritySupportReboot2.ist");
+_LIT(KLitRegistrationFile2,"c:\\private\\10003a3f\\import\\apps\\NonNative\\Resource\\102081cf_reg.rsc");
+static const CT_AbstractNonNativeAppsTestStep::TTestAppDetails KApplication2(0x102081CF,KLitLogicalExecutable2,KLitRegistrationFile2);
+
+/**
+   @SYMTestCaseID T-IntegritySupportReboot1TestStep-TestSetupL
+  
+   @SYMPREQ 
+  
+   @SYMTestCaseDesc This is only the first half of the test case. It will simulate a
+   reboot in the middle of an installation. 
+   
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Simulate a reboot in the middle of an installation.
+   
+   @SYMTestExpectedResults None. See CT_IntegritySupportReboot2TestStep for the actual test.
+ */	
+void CT_IntegritySupportReboot1TestStep::TestSetupL()
+	{
+	INFO_PRINTF1(_L("Setting up reboot recovery test..."));
+
+	// so that we can check the presence/absence of stuff before apparc has respawned
+	RProcess().SetPriority(EPriorityHigh); 
+
+	// make sure we're starting from a clean sheet
+	CleanupAndReset(iSession, KApplication1);
+	CleanupAndReset(iSession, KApplication2);
+
+	// prepare the starting state: KApp1 uninstalled, KApp2 installed
+	CompleteRegisterL(iSession, KApplication2);
+	
+	TEST(AppAbsent(iSession, KApplication1));
+	TEST(AppPresent(iSession, KApplication2));
+
+	// Prepare to install KApp1 and remove KApp2, and then panic after actually performing these steps
+	iSession.PrepareNonNativeApplicationsUpdatesL();
+	CallRegisterL(iSession, KApplication1);
+	CallDeregisterL(iSession, KApplication2);
+	iSession.AddPanicingNonNativeApplicationsUpdate();
+
+	// test that nothing has changed yet
+	TEST(AppAbsent(iSession, KApplication1));
+	TEST(AppPresent(iSession, KApplication2));
+
+	// commit, expect Apparc to die horribly
+	// this function will actually restart apparc if it fails the first time
+	TRAPD(err,iSession.CommitNonNativeApplicationsUpdatesL());
+	TEST(err == KErrServerTerminated);
+	
+	// the files should be as-if the update happened, but we can't check
+	// the app list because apparc is now dead.
+	TEST(FilePresent(KLitUpdatedAppsList));
+	TEST(FilePresent(KApplication1.iRegistrationFile));
+	TEST(FileAbsent(KApplication2.iRegistrationFile));
+	}
+
+/**
+ * Constructor
+ */	
+CT_IntegritySupportReboot2TestStep::CT_IntegritySupportReboot2TestStep()
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_IntegritySupportReboot2Step);
+	}
+
+/**
+ * Destructor
+ */
+CT_IntegritySupportReboot2TestStep::~CT_IntegritySupportReboot2TestStep()
+	{
+	iSession.Close();
+	iUtils.Close();
+	}
+
+/**
+ * @return - TVerdict code
+ * Override of base class virtual
+ */	
+TVerdict CT_IntegritySupportReboot2TestStep::doTestStepPreambleL()
+	{
+	SetTestStepResult(EPass);
+	doAbstractNonNativeAppsTestStepPreambleL();
+	return TestStepResult();
+	}
+
+/**
+ * @return - TVerdict code
+ * Override of base class virtual
+ */
+TVerdict CT_IntegritySupportReboot2TestStep::doTestStepPostambleL()
+	{
+	return TestStepResult();
+	}
+
+TVerdict CT_IntegritySupportReboot2TestStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Testing Apparc...T_IntegritySupportReboot2 Test Cases Running..."));
+
+	TRAPD(ret,RunTestCasesL())
+	TEST(ret==KErrNone);
+	
+	INFO_PRINTF1(_L("...T_IntegritySupportReboot2 Test Cases Completed."));
+
+	return TestStepResult();
+	}
+	
+TInt CT_IntegritySupportReboot2TestStep::RunTestCasesL()
+	{
+	HEAP_TEST_LS_SESSION(iSession, 0, 0, TestRollbackL(), NO_CLEANUP);
+	return KErrNone;
+	}
+	
+/**
+   @SYMTestCaseID T-IntegritySupportReboot2TestStep-TestRollbackL
+  
+   @SYMPREQ 
+  
+   @SYMTestCaseDesc This test case assumes IntegritySupportReboot1TestStep has been run before
+  IntegritySupportReboot1TestStep have been rolled back and that the device is in a consistent state.
+      
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Check the presence/absence of KApplication2 and KApplication1 respectively
+   
+   @SYMTestExpectedResults KApplication1 is absent, KApplication2 is present.
+ */	
+void CT_IntegritySupportReboot2TestStep::TestRollbackL()
+	{
+	INFO_PRINTF1(_L("Checking that the device is in a consistent state, with all updates rolled back"));
+	TEST(AppAbsent(iSession, KApplication1));
+	TEST(AppPresent(iSession, KApplication2));
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_IntegritySupportRebootStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,64 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+ 
+#ifndef __T_INTEGRITYREBOOTSUPPORT_STEP_H__
+#define __T_INTEGRITYREBOOTSUPPORT_STEP_H__
+
+#include "t_abstractnonnativeappsstep.h"
+
+_LIT(KT_IntegritySupportReboot1Step,"T_IntegritySupportReboot1");
+
+class CT_IntegritySupportReboot1TestStep : public CT_AbstractNonNativeAppsTestStep
+	{
+public:
+	CT_IntegritySupportReboot1TestStep();
+	~CT_IntegritySupportReboot1TestStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+	
+private:
+	TInt RunTestCasesL();
+	void TestSetupL();
+	};
+
+_LIT(KT_IntegritySupportReboot2Step,"T_IntegritySupportReboot2");
+
+class CT_IntegritySupportReboot2TestStep : public CT_AbstractNonNativeAppsTestStep
+	{
+public:
+	CT_IntegritySupportReboot2TestStep();
+	~CT_IntegritySupportReboot2TestStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+	
+private:
+	TInt RunTestCasesL();
+	void TestClosingSessionL();
+	void TestAppsAreIgnoredL();
+	void TestUpdatesL();
+	void TestRollbackL();
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_IntegritySupportStep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,623 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code  
+*/
+
+#include "T_IntegritySupportStep.h"
+#include <bautils.h>
+
+
+
+/**
+ * Constructor
+ */	
+CT_IntegritySupportTestStep::CT_IntegritySupportTestStep()
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_IntegritySupportStep);
+	}
+
+/**
+ * Destructor
+ */
+CT_IntegritySupportTestStep::~CT_IntegritySupportTestStep()
+	{
+	iSession.Close();
+	iUtils.Close();
+	}
+
+/**
+ * @return - TVerdict code
+ * Override of base class virtual
+ */	
+TVerdict CT_IntegritySupportTestStep::doTestStepPreambleL()
+	{
+	SetTestStepResult(EPass);
+	doAbstractNonNativeAppsTestStepPreambleL();
+	return TestStepResult();
+	}
+
+/**
+ * @return - TVerdict code
+ * Override of base class virtual
+ */
+TVerdict CT_IntegritySupportTestStep::doTestStepPostambleL()
+	{
+	return TestStepResult();
+	}
+
+TVerdict CT_IntegritySupportTestStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Testing Apparc...T_IntegritySupport Test Cases Running..."));
+
+	TRAPD(ret,RunTestCasesL())
+	TEST(ret==KErrNone);
+	
+	INFO_PRINTF1(_L("...T_IntegritySupport Test Cases Completed."));
+
+	return TestStepResult();
+	}
+
+TInt CT_IntegritySupportTestStep::RunTestCasesL()
+	{
+	HEAP_TEST_LS_SESSION(iSession, 0, DONT_CHECK, TestNormalInstallation1L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iSession, 0, DONT_CHECK, TestManualRollback1L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iSession, 0, DONT_CHECK, TestRollbackOnError1L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iSession, 0, DONT_CHECK, TestRollbackOnSessionCloseL(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iSession, 0, DONT_CHECK, TestNormalRemoval1L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iSession, 0, DONT_CHECK, TestManualRollback2L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iSession, 0, DONT_CHECK, TestRollbackWithoutPrepareL(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iSession, 0, DONT_CHECK, TestRegisterWithoutPrepareL(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iSession, 0, DONT_CHECK, TestCallingPrepareTwiceL(), NO_CLEANUP); 
+	HEAP_TEST_LS_SESSION(iSession, 0, DONT_CHECK, TestCallingPrepareFromTwoSessionsL(), NO_CLEANUP);
+	/* Removed from armv5 because they seem to cause filesystem corruption */
+#ifdef __WINS__
+	HEAP_TEST_LS_SESSION(iSession, 0, DONT_CHECK, TestReregisterApplicationL(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iSession, 0, DONT_CHECK, TestDoubleInstallFailsL(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iSession, 0, DONT_CHECK, TestRollbackOnFailedUpdateStepL(), NO_CLEANUP);
+#endif
+	return KErrNone;
+	}
+
+
+_LIT(KLitLogicalExecutable1,"c:\\TestIntegritySupport1.ist");
+_LIT(KLitRegistrationFile1,"c:\\private\\10003a3f\\import\\apps\\NonNative\\Resource\\102081a1_reg.rsc");
+static const CT_AbstractNonNativeAppsTestStep::TTestAppDetails KApplication1(0x102081A1,KLitLogicalExecutable1,KLitRegistrationFile1);
+
+_LIT(KLitLogicalExecutable2,"c:\\TestIntegritySupport2.ist");
+_LIT(KLitRegistrationFile2,"c:\\private\\10003a3f\\import\\apps\\NonNative\\Resource\\102081c0_reg.rsc");
+static const CT_AbstractNonNativeAppsTestStep::TTestAppDetails KApplication2(0x102081C0,KLitLogicalExecutable2,KLitRegistrationFile2);
+
+_LIT(KLitLogicalExecutable3,"c:\\TestIntegritySupport3.ist");
+_LIT(KLitRegistrationFile3,"c:\\private\\10003a3f\\import\\apps\\NonNative\\Resource\\102081c1_reg.rsc");
+static const CT_AbstractNonNativeAppsTestStep::TTestAppDetails KApplication3(0x102081C1,KLitLogicalExecutable3,KLitRegistrationFile3);
+
+_LIT(KLitLogicalExecutable4,"c:\\TestIntegritySupport4.ist");
+_LIT(KLitRegistrationFile4,"c:\\private\\10003a3f\\import\\apps\\NonNative\\Resource\\102081c2_reg.rsc");
+static const CT_AbstractNonNativeAppsTestStep::TTestAppDetails KApplication4(0x102081C2,KLitLogicalExecutable4,KLitRegistrationFile4);
+
+// uses logical executable from KApplication4
+_LIT(KLitRegistrationFile5,"c:\\private\\10003a3f\\import\\apps\\NonNative\\Resource\\102081c3_reg.rsc");
+static const CT_AbstractNonNativeAppsTestStep::TTestAppDetails KApplication5(0x102081C3,KLitLogicalExecutable4,KLitRegistrationFile5);
+
+
+/**
+   @SYMTestCaseID T-IntegritySupportTestStep-TestNormalInstallation1L
+  
+   @SYMPREQ 
+  
+   @SYMTestCaseDesc Tests the integrity support during a normal installation 
+   
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Tests installation process when there are no problems.
+   
+   @SYMTestExpectedResults The application is successfully installed and then removed.
+ */
+void CT_IntegritySupportTestStep::TestNormalInstallation1L()
+	{
+	INFO_PRINTF1(_L("Testing normal application installation..."));
+
+	RProcess().SetPriority(EPriorityLow); // so that we're pre-empted by the Apparc server when it does its scan
+	CleanupAndReset(iSession, KApplication1);
+
+	iSession.PrepareNonNativeApplicationsUpdatesL();
+
+	INFO_PRINTF1(_L("..registering app using RegisterNonNativeApplicationL() "));
+	CallRegisterL(iSession, KApplication1);
+	
+	// Since we have not committed yet, at this stage the files should not be in their
+	// final locations
+	TEST(AppAbsent(iSession, KApplication1));
+	
+	iSession.CommitNonNativeApplicationsUpdatesL();
+
+	// the files should now be present in their final locations
+	TEST(AppPresent(iSession, KApplication1));
+	
+	INFO_PRINTF1(_L("..deregistering app using DeregisterNonNativeApplicationL() "));
+	CompleteDeregisterL(iSession, KApplication1);	
+
+	TEST(AppAbsent(iSession, KApplication1));
+	}
+	
+
+/**
+   @SYMTestCaseID T-IntegritySupportTestStep-TestManualRollback1L
+  
+   @SYMPREQ 
+  
+   @SYMTestCaseDesc Tests the integrity support during an installation that is rolled back
+   
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Tests installation process when the client decides to rollback the changes.
+   
+   @SYMTestExpectedResults The installtion is successfully rolled back and the device is in the
+   same state as before the installation attempt.
+ */
+void CT_IntegritySupportTestStep::TestManualRollback1L()
+	{
+	INFO_PRINTF1(_L("Testing manual rollback during installation..."));
+	CleanupAndReset(iSession, KApplication2);
+
+	iSession.PrepareNonNativeApplicationsUpdatesL();
+	INFO_PRINTF1(_L("..registering app using RegisterNonNativeApplicationL() "));
+	CallRegisterL(iSession, KApplication2);
+	
+	// Since we have not committed yet, at this stage the files should not be in their
+	// final locations
+	TEST(AppAbsent(iSession, KApplication2));
+	
+	iSession.RollbackNonNativeApplicationsUpdates();
+
+	// Test that they're still all absent since we never committed
+	TEST(AppAbsent(iSession, KApplication2));
+	}
+	
+void CT_IntegritySupportTestStep::TestRollbackOnError1L()
+	{
+		
+	// this can be tested by trying to overwrite an icon file.
+	}
+
+
+/**
+   @SYMTestCaseID T-IntegritySupportTestStep-TestRollbackOnSessionCloseL
+  
+   @SYMPREQ 
+  
+   @SYMTestCaseDesc Tests that any updates are rolled back if the session is closed in the middle
+   of an update
+   
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Tests installation process when the client closes the session before
+   committing or rolling back.
+   
+   @SYMTestExpectedResults The installation is successfully rolled back and the device is in the
+   same state as before the installation attempt.
+ */	
+void CT_IntegritySupportTestStep::TestRollbackOnSessionCloseL()
+	{
+	INFO_PRINTF1(_L("Testing rollback if RApaLsSession is closed..."));
+	
+	RTestableApaLsSession apaSession;
+	User::LeaveIfError(apaSession.Connect());
+	CleanupClosePushL(apaSession);
+
+	CleanupAndReset(apaSession, KApplication3);
+
+	apaSession.PrepareNonNativeApplicationsUpdatesL();
+	INFO_PRINTF1(_L("..registering app using RegisterNonNativeApplicationL() "));
+	CallRegisterL(apaSession, KApplication3);
+
+	// shouldn't be present until comitted
+	TEST(AppAbsent(iSession, KApplication3));
+	
+	// We close the session before committing or rolling back.
+	CleanupStack::PopAndDestroy(&apaSession);
+
+	// We never committed, so check that nothing's changed	
+	TEST(AppAbsent(iSession, KApplication3));
+	}
+
+/**
+   @SYMTestCaseID T-IntegritySupportTestStep-TestNormalRemoval1L
+  
+   @SYMPREQ 
+  
+   @SYMTestCaseDesc Tests a normal removal attempt
+   
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Tests the correct working of the removal process.
+   
+   @SYMTestExpectedResults The application is installed and then removed without errors.
+ */	
+void CT_IntegritySupportTestStep::TestNormalRemoval1L()
+	{
+	INFO_PRINTF1(_L("Testing removal..."));
+	CleanupAndReset(iSession, KApplication4);
+
+	INFO_PRINTF1(_L("..registering app using RegisterNonNativeApplicationL() "));
+	CompleteRegisterL(iSession, KApplication4);
+	TEST(AppPresent(iSession, KApplication4));
+	
+	INFO_PRINTF1(_L("..deregistering app using DeregisterNonNativeApplicationL() "));
+	iSession.PrepareNonNativeApplicationsUpdatesL();
+	CallDeregisterL(iSession,KApplication4);
+
+	// Check that everythign is still the same as we haven't committed yet
+	TEST(AppPresent(iSession, KApplication4));
+
+	iSession.CommitNonNativeApplicationsUpdatesL();
+	TEST(AppAbsent(iSession, KApplication4));
+	}
+	
+/**
+   @SYMTestCaseID T-IntegritySupportTestStep-TestManualRollback2L
+  
+   @SYMPREQ 
+  
+   @SYMTestCaseDesc Tests the integrity support during an installation that is rolled back
+   
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Tests installation process when the client decides to rollback the changes.
+   
+   @SYMTestExpectedResults The installtion is successfully rolled back and the device is in the
+   same state as before the installation attempt.
+ */
+void CT_IntegritySupportTestStep::TestManualRollback2L()
+	{
+	INFO_PRINTF1(_L("Testing removal rollback..."));
+	CleanupAndReset(iSession, KApplication5);
+
+	iSession.PrepareNonNativeApplicationsUpdatesL();
+	INFO_PRINTF1(_L("..registering app using RegisterNonNativeApplicationL() "));
+	CallRegisterL(iSession, KApplication5);
+	iSession.CommitNonNativeApplicationsUpdatesL();
+		
+	TEST(AppPresent(iSession, KApplication5));
+	
+	INFO_PRINTF1(_L("..deregistering app using DeregisterNonNativeApplicationL() "));
+	iSession.PrepareNonNativeApplicationsUpdatesL();
+	CallDeregisterL(iSession, KApplication5);
+
+	// Check that all is still present as we haven't committed yet
+	TEST(AppPresent(iSession, KApplication5));
+	iSession.RollbackNonNativeApplicationsUpdates();
+	
+	// Check that app is in list of installed apps, still
+	TEST(AppPresent(iSession, KApplication5));
+	
+	// Cleanup and remove app
+	CompleteDeregisterL(iSession, KApplication5);
+	
+	// Check that app is not in list of installed apps anymore
+	TEST(AppAbsent(iSession, KApplication5));
+	}
+	
+/**
+   @SYMTestCaseID T-IntegritySupportTestStep-TestRollbackWithoutPrepareL
+  
+   @SYMPREQ 
+  
+   @SYMTestCaseDesc Tests that calling RollbackNonNativeApplicationsUpdates works even if 
+   the client hasn't calling the PrepareNonNativeApplicationsUpdatesL function.
+   
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Tests that calling RollbackNonNativeApplicationsUpdates works even if 
+   the client hasn't calling the PrepareNonNativeApplicationsUpdatesL function.
+   
+   @SYMTestExpectedResults The function doesn't return an error.
+ */
+void CT_IntegritySupportTestStep::TestRollbackWithoutPrepareL()
+	{
+	INFO_PRINTF1(_L("Testing RollbackNonNativeApplicationsUpdates without prepare before..."));
+	// Just call the function, if it doesn't panic, we assume it works
+	iSession.RollbackNonNativeApplicationsUpdates();
+	}
+
+/**
+   @SYMTestCaseID T-IntegritySupportTestStep-TestRegisterWithoutPrepareL
+  
+   @SYMPREQ 
+  
+   @SYMTestCaseDesc Tests that calling RegisterNonNativeApplicationL fails if 
+   PrepareNonNativeApplicationsUpdatesL hasn't been called.
+   
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call RegisterNonNativeApplicationL without calling PrepareNonNativeApplicationsUpdatesL
+   first.
+   
+   @SYMTestExpectedResults The function returns KErrNotReady.
+ */	
+void CT_IntegritySupportTestStep::TestRegisterWithoutPrepareL()
+	{
+	INFO_PRINTF1(_L("Testing RegisterNonNativeApplicationL without prepare before..."));
+	TRAPD(err, CallRegisterL(iSession,KApplication1));
+	TEST(err == KErrNotReady);
+	}
+
+/**
+   @SYMTestCaseID T-IntegritySupportTestStep-TestCallingPrepareTwiceL
+  
+   @SYMPREQ 
+  
+   @SYMTestCaseDesc Tests that calling PrepareNonNativeApplicationsUpdatesL twice fails.
+   
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call PrepareNonNativeApplicationsUpdatesL twice.
+   
+   @SYMTestExpectedResults The second call returns KErrNotReady.
+ */		
+void CT_IntegritySupportTestStep::TestCallingPrepareTwiceL()
+	{
+	INFO_PRINTF1(_L("Testing PrepareNonNativeApplicationsUpdatesL twice..."));
+	
+	// Should work
+	iSession.PrepareNonNativeApplicationsUpdatesL();
+	
+	// Shouldn't work since already called
+	TRAPD(err, 	iSession.PrepareNonNativeApplicationsUpdatesL());
+	TEST(err == KErrInUse);
+	iSession.RollbackNonNativeApplicationsUpdates();
+	
+	// Should work again since we have rolled back
+	iSession.PrepareNonNativeApplicationsUpdatesL();
+	iSession.RollbackNonNativeApplicationsUpdates();
+	}
+
+/**
+   @SYMTestCaseID T-IntegritySupportTestStep-TestCallingPrepareFromTwoSessionsL
+  
+   @SYMPREQ 
+  
+   @SYMTestCaseDesc Tests that commiting an app update when another session
+   has already installed it is successfull.
+
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call PrepareNonNativeApplicationsUpdatesL from a session and then from
+   another one.
+   
+   @SYMTestExpectedResults The second call returns KErrNone.
+ */		
+void CT_IntegritySupportTestStep::TestCallingPrepareFromTwoSessionsL()
+	{
+	INFO_PRINTF1(_L("Testing PrepareNonNativeApplicationsUpdatesL and other function calls from 2 sessions..."));
+	INFO_PRINTF1(_L("    Cleaning up any existing reg files first..."));
+	
+	CleanupAndReset(iSession, KApplication1);
+
+	INFO_PRINTF1(_L("    Running test..."));
+
+	// open a second session
+	RTestableApaLsSession session2;
+	User::LeaveIfError(session2.Connect());
+	CleanupClosePushL(session2);
+	
+	// Prepare & Register with the first session
+	iSession.PrepareNonNativeApplicationsUpdatesL();
+	CallRegisterL(iSession, KApplication1);
+
+	// Prepare, Register & Deregister with the second session
+	TRAPD(err,session2.PrepareNonNativeApplicationsUpdatesL());
+	TEST(err == KErrNone);
+	CallRegisterL(session2, KApplication1);
+	
+	// commit the updates with iSession, installing app 1
+	TRAP(err, iSession.CommitNonNativeApplicationsUpdatesL());
+	TEST(err == KErrNone);
+
+	// both sessions should now report app 1 as installed
+	TEST(AppPresent(iSession, KApplication1));
+	TEST(AppPresent(session2, KApplication1));
+
+	// Try to commit with session 2
+	// This could be an upgrade of the app so completes successfully
+	TRAP(err, session2.CommitNonNativeApplicationsUpdatesL());
+	INFO_PRINTF2(_L("Err: %d "), err);
+	TEST(err == KErrNone);
+
+	// check that nothing was damaged
+	TEST(AppPresent(iSession, KApplication1));
+	TEST(AppPresent(session2, KApplication1));
+
+	CleanupStack::PopAndDestroy(&session2);
+	
+	// clean up
+	CompleteDeregisterL(iSession, KApplication1);
+	TEST(AppAbsent(iSession, KApplication1));
+	}
+
+/**
+   @SYMTestCaseID T-IntegritySupportTestStep-TestReregisterApplicationL
+  
+   @SYMPREQ 
+  
+   @SYMTestCaseDesc Tests we can deregister an already-installed app and reregister it in
+                    one transaction
+   
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call Prepare updates, Deregister, Register, Commit
+   
+   @SYMTestExpectedResults All successful, no panics
+ */		
+void CT_IntegritySupportTestStep::TestReregisterApplicationL()
+	{
+	INFO_PRINTF1(_L("Testing deregister/register of an application in one transaction..."));
+	INFO_PRINTF1(_L("    Cleaning up any existing reg files first..."));
+	
+	CleanupAndReset(iSession, KApplication1);
+
+	INFO_PRINTF1(_L("    Registering beforehand so that the deregister has something to do..."));
+	CompleteRegisterL(iSession, KApplication1);
+
+	// test that it has installed OK
+	TEST(AppPresent(iSession, KApplication1));
+
+	INFO_PRINTF1(_L("    Running test..."));
+	// Prepare, Deregister & Register
+	iSession.PrepareNonNativeApplicationsUpdatesL();
+	CallDeregisterL(iSession, KApplication1);
+	CallRegisterL(iSession, KApplication1);
+	TRAPD(err, iSession.CommitNonNativeApplicationsUpdatesL());
+	TEST(err == KErrNone);
+
+	// test that it is still installed OK
+	TEST(AppPresent(iSession, KApplication1));
+	
+	// clean up
+	CompleteDeregisterL(iSession, KApplication1);
+	}
+
+/**
+   @SYMTestCaseID T-IntegritySupportTestStep-TestDoubleInstallFailsL
+  
+   @SYMPREQ 
+  
+   @SYMTestCaseDesc 
+   
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions 
+   
+   @SYMTestExpectedResults
+ */		
+void CT_IntegritySupportTestStep::TestDoubleInstallFailsL()
+	{
+	INFO_PRINTF1(_L("Testing double register of an application in one transaction..."));
+	INFO_PRINTF1(_L("    Cleaning up any existing reg files first..."));
+	
+	CleanupAndReset(iSession, KApplication1);
+
+	// test that the application is absent
+	TEST(AppAbsent(iSession, KApplication1));
+
+	INFO_PRINTF1(_L("    Running test..."));
+	iSession.PrepareNonNativeApplicationsUpdatesL();
+	CallRegisterL(iSession, KApplication1);
+	CallRegisterL(iSession, KApplication1);
+	TRAPD(err, iSession.CommitNonNativeApplicationsUpdatesL());
+	TEST(err == KErrAccessDenied); // Since app is already registered, KErrAccessDenied will be returned when try to delete the registered app.
+
+	// test that the rollback happened when the second register failed,
+	// and thus the app is still absent
+	TEST(AppAbsent(iSession, KApplication1));
+	
+	// test that things still work
+	TRAP(err, CompleteRegisterL(iSession, KApplication1));
+	TEST(err == KErrNone);
+	TEST(AppPresent(iSession, KApplication1));
+	
+	CompleteDeregisterL(iSession, KApplication1);
+	TEST(AppAbsent(iSession, KApplication1));
+	}
+
+/**
+   @SYMTestCaseID T-IntegritySupportTestStep-TestRollbackOnFailedUpdateStepL
+  
+   @SYMPREQ 
+  
+   @SYMTestCaseDesc 
+   
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions 
+   
+   @SYMTestExpectedResults
+ */		
+void CT_IntegritySupportTestStep::TestRollbackOnFailedUpdateStepL()
+	{
+	INFO_PRINTF1(_L("Testing register app1, deregister app2, then a force-failed update that causes the first two to roll back..."));
+	INFO_PRINTF1(_L("    Cleaning up any existing reg files first..."));
+	
+	CleanupAndReset(iSession, KApplication1);
+	CleanupAndReset(iSession, KApplication2);
+
+	// test that both apps are absent
+	TEST(AppAbsent(iSession, KApplication1));
+	TEST(AppAbsent(iSession, KApplication2));
+
+	// register app 2 and check
+	TRAPD(err,CompleteRegisterL(iSession, KApplication2));
+	TEST(err == KErrNone);
+	TEST(AppAbsent(iSession, KApplication1));
+	TEST(AppPresent(iSession, KApplication2));
+
+	INFO_PRINTF1(_L("    Running test..."));
+	iSession.PrepareNonNativeApplicationsUpdatesL();
+	// call register/deregister/fail operations
+	CallRegisterL(iSession, KApplication1);
+	CallDeregisterL(iSession, KApplication2);
+	iSession.AddFailingNonNativeApplicationsUpdate();
+	// test that nothing has changed yet
+	TEST(AppAbsent(iSession, KApplication1));
+	TEST(AppPresent(iSession, KApplication2));
+	// commit, expect KErrGeneral from the force-fail step
+	TRAP(err, iSession.CommitNonNativeApplicationsUpdatesL());
+	TEST(err == KErrGeneral);
+	// make sure nothing has changed, i.e. everything rolled back ok
+	TEST(AppAbsent(iSession, KApplication1));
+	TEST(AppPresent(iSession, KApplication2));
+
+	// test that things still work
+	iSession.PrepareNonNativeApplicationsUpdatesL();
+	CallRegisterL(iSession, KApplication1);
+	CallDeregisterL(iSession, KApplication2);
+	TRAP(err,iSession.CommitNonNativeApplicationsUpdatesL());
+	TEST(err == KErrNone);
+	TEST(AppPresent(iSession, KApplication1));
+	TEST(AppAbsent(iSession, KApplication2));
+
+	CompleteDeregisterL(iSession, KApplication1);
+	TEST(AppAbsent(iSession, KApplication1));
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_IntegritySupportStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,57 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+ 
+#ifndef __T_INTEGRITYSUPPORT_STEP_H__
+#define __T_INTEGRITYSUPPORT_STEP_H__
+
+#include "t_abstractnonnativeappsstep.h"
+
+_LIT(KT_IntegritySupportStep,"T_IntegritySupport");
+
+class CT_IntegritySupportTestStep : public CT_AbstractNonNativeAppsTestStep
+	{
+public:
+	CT_IntegritySupportTestStep();
+	~CT_IntegritySupportTestStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+
+private:
+	TInt RunTestCasesL();
+	void TestNormalInstallation1L();
+	void TestManualRollback1L();
+	void TestRollbackOnError1L();
+	void TestRollbackOnSessionCloseL();
+	void TestNormalRemoval1L();
+	void TestManualRollback2L();
+	void TestRollbackWithoutPrepareL();
+	void TestRegisterWithoutPrepareL();
+	void TestCallingPrepareTwiceL();
+	void TestCallingPrepareFromTwoSessionsL();
+	void TestReregisterApplicationL();
+	void TestDoubleInstallFailsL();
+	void TestRollbackOnFailedUpdateStepL();
+	};
+	
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_LocaleStep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,782 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Tests to meet REQ758.2: "Captions localization must be efficient
+// (i.e. not waste disk space) and extensible (i.e. support non-ROM language packs)"\n
+// Test for UIKON GT0143 Typhoon Work Series 60 Changes
+// REQ758.2: Captions localization must be efficient (i.e. not waste disk space)
+// and extensible (i.e. support non-ROM language packs)
+// Test for CR0902 - Enable Dynamic Language Switching in APPARC.
+// Application's localisable information should be updated by apparc on language change event.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include <e32test.h>
+#include <f32file.h>
+#include <apgicnfl.h>
+#include <hal.h>
+#include <apgcli.h>
+#include "T_LocaleStep.h"
+
+const TUid KUidTestApp = { 10 }; //uid of tstapp.
+const TUid KUidCustomiseDefaultIconApp = {0x10208181}; // uid of CustomiseDefaultIconApp.
+const TInt KDelayForOnDemand = 20000; //a small delay
+const TInt KDelay = 4000000; // Most apparc tests have 2.5 secs wait time to let apparc update the app-list, but on safer side let us give 4 secs.
+const TInt KViewCount = 3; // Total no of views in tstapp
+
+
+/**
+  Auxiliary Fn for Test Case ID T-LocaleStep-TestAllLanguages
+ 
+  This method loads the required DLL for the language specified as argument
+  and changes the locale accordingly.
+ 
+*/
+void CT_LocaleStep::ChangeLocaleL(TLanguage aLanguage)
+	{
+	_LIT(KLitLocaleDllNameBase, "ELOCL");
+	_LIT(KLitLocaleDllNameExtension, ".LOC");
+	RLibrary localeDll;
+	TBuf<16> localeDllName(KLitLocaleDllNameBase);
+	CleanupClosePushL(localeDll);
+	const TUidType uidType(TUid::Uid(0x10000079),TUid::Uid(0x100039e6));
+	_LIT(TwoDigExt,".%02d");
+	localeDllName.AppendFormat(TwoDigExt, aLanguage);
+	TInt error=localeDll.Load(localeDllName, uidType);
+	if (error==KErrNotFound)
+		{
+		localeDllName=KLitLocaleDllNameBase;
+		localeDllName.Append(KLitLocaleDllNameExtension);
+		error=localeDll.Load(localeDllName, uidType);
+		}
+	User::LeaveIfError(error);
+	User::LeaveIfError(UserSvr::ChangeLocale(localeDllName));
+	CleanupStack::PopAndDestroy(); // localeDll
+	}
+
+// CheckIcons is a function used in testcase TestLocaleDefaultIconL to check the size of the default icons
+void CT_LocaleStep::CheckIcons(CArrayFixFlat<TSize>* aNewIconSizes,TSize aSmall,TSize aMedium,TSize aLarge, TSize& afstIcon, TSize& asecIcon, TSize& atrdIcon)
+	{
+	afstIcon = (*aNewIconSizes)[0];
+	asecIcon = (*aNewIconSizes)[1];
+	atrdIcon = (*aNewIconSizes)[2];
+	TEST((afstIcon==aSmall) || (afstIcon==aMedium) || (afstIcon==aLarge) && ((afstIcon!=asecIcon) && (afstIcon!=atrdIcon)));
+	TEST((asecIcon==aSmall) || (asecIcon==aMedium) || (asecIcon==aLarge) && ((asecIcon!=afstIcon) && (asecIcon!=atrdIcon)));
+	TEST((atrdIcon==aSmall) || (atrdIcon==aMedium) || (atrdIcon==aLarge) && ((atrdIcon!=afstIcon) && (atrdIcon!=asecIcon)));	
+	}
+
+/**
+  @SYMTestCaseID APPFWK-APPARC-0070
+ 
+  @SYMPREQ
+ 
+  @SYMTestCaseDesc Test whether the default app icons change with respect to the locale/language.
+  This testcase checks whether BaflUtils::NearestLanguageFile is called when the locale has been changed.
+ 
+  @SYMTestPriority High  
+ 
+  @SYMTestStatus Implemented
+
+  @SYMTestActions  Call User::Language() to check that the default locale is English; Call CT_LocaleStep::CheckIcons 
+  to check the size of the current default icons; Call UserSvr::ChangeLocale to change the Locale to French; 
+  Call CT_LocaleStep::CheckIcons to check the size of the new icons; Restore the file system and the locale 
+  and check if the icons are restored.
+  API Calls:\n	
+  
+  @SYMTestExpectedResults Returns KErrNone
+ */	
+void CT_LocaleStep::TestLocaleDefaultIconL()
+	{
+	INFO_PRINTF1(_L("APPFWK-APPARC-0070: TestLocaleDefaultIconL started..."));	
+	
+	TInt ret = 0;
+		
+	//first checks that language is not currently set to French (any other language except English since English is the default language
+	TEST(User::Language()!=ELangFrench);
+
+	// getappiconsizes must be called to check if the icons are the default ones
+	// KUidCustomiseDefaultIconApp - uid of CustomiseDefaultIconApp_reg.RSS; this app has a localisable resource file, CustomiseDefaultIconApp_loc.RSS, that does not define any icon
+	// Hence, the default icons must be picked up when the language changes to French. The default icons for French are defined in default_app_icon.m02
+
+	CArrayFixFlat<TSize>* newIconSizes = new(ELeave) CArrayFixFlat<TSize>(3);
+	CleanupStack::PushL(newIconSizes);
+	TRAP(ret,iLs.GetAppIconSizes(KUidCustomiseDefaultIconApp, *newIconSizes));
+	TEST(ret==KErrNone);
+	TEST(newIconSizes->Count()!=0);
+	// these are the sizes of the default icons
+	TSize small(24,24);
+	TSize medium(32,32);
+	TSize large(48,48);
+	TSize fstIcon;
+	TSize secIcon;
+	TSize trdIcon;
+	CheckIcons(newIconSizes, small, medium,large, fstIcon, secIcon, trdIcon);
+	
+	// Change the locale to French
+	TRAP(ret,ChangeLocaleL(ELangFrench));
+	TEST(ret==KErrNone);
+	TEST(User::Language()==ELangFrench);//checks that the language has been set to French
+
+	//Wait for a small period to let apparc receive language change notification
+	User::After(KDelayForOnDemand);
+	//call getappiconsizes to see if the new icons have been changed as as expected 
+	// The size of the icons indicates whether the icon corresponding to French Locale has been picked up
+	newIconSizes->Reset();
+	TRAP(ret,iLs.GetAppIconSizes(KUidCustomiseDefaultIconApp, *newIconSizes));
+	TEST(ret==KErrNone);
+	TEST(newIconSizes->Count()!=0);
+	small.SetSize(25,25);
+	medium.SetSize(35,35);
+	large.SetSize(50,50);
+	CheckIcons(newIconSizes, small, medium,large, fstIcon, secIcon, trdIcon);
+
+	//have to restore the locale before exiting the testcase
+	TRAP(ret,ChangeLocaleL(ELangEnglish));
+	TEST(ret==KErrNone);
+	TEST(User::Language()==ELangEnglish);
+
+	//Again wait for a small period to let apparc receive language change notification
+	User::After(KDelayForOnDemand);
+
+	//call getappiconsizes to see if the new icons have been changed as as expected 
+	// The size of the icons indicates whether the icon corresponding to English Locale has been picked up
+	newIconSizes->Reset();
+	TRAP(ret,iLs.GetAppIconSizes(KUidCustomiseDefaultIconApp, *newIconSizes));
+	TEST(ret==KErrNone);
+	TEST(newIconSizes->Count()!=0);
+	small.SetSize(24,24);
+	medium.SetSize(32,32);
+	large.SetSize(48,48);
+	CheckIcons(newIconSizes, small, medium,large, fstIcon, secIcon, trdIcon);
+
+	// Icon cleanup
+	CleanupStack::PopAndDestroy(newIconSizes);
+	newIconSizes=NULL;
+	INFO_PRINTF1(_L("APPFWK-APPARC-0070: TestLocaleDefaultIconL finished..."));	
+	}
+	
+/**
+  @SYMTestCaseID APPFWK-APPARC-0061
+ 
+  @SYMPREQ CR0902 - Enable Dynamic Language Switching in APPARC.
+ 
+  @SYMTestCaseDesc Test whether caption, short caption and app icon, is updated with respect to the change 
+  in locale/language. This test case checks on language change event apparc updates application 
+  localisable information for all installed applications, without forcing a change in the part of 
+  file system which apparc monitors. 
+  This test also tests, on a language change event, application's localisable information is 
+  updated immediately, if not yet updated by the re-scan (On demand loading). This is done by not 
+  giving enough time to finish rescan of app-list.
+ 
+  @SYMTestPriority Critical 
+ 
+  @SYMTestStatus Implemented
+
+  @SYMTestActions  Check if language is English by calling User::Language(). 
+  
+  1. Call GetAppInfo() by passing an application's UID which provides support for multiple languages.
+  Check if the caption and short caption, both are in English. Change locale to French.
+  2. Call GetAppIcon() by passing same application's UID. Check app icons are same as sepcified in 
+  app icon file for English locale.
+  
+  Wait for a small period (20 milli seconds) to let apparc receive language change notification. 
+  Again - 
+  1. Call GetAppInfo() by passing same application's UID and check if the caption and short caption, 
+  both are in French.
+  2. Call GetAppIcon() by passing same application's UID. Check app icons are same as sepcified in 
+  app icon file for French locale.
+  
+  Restore locale to English and again check - 
+  1. If caption and short caption are in English after a call to GetAppInfo() for the same application.
+  2. Call GetAppIcon() by passing same application's UID. Check app icons are same as sepcified in 
+  app icon file for English locale.
+  
+  @SYMTestExpectedResults 
+  1. GetAppInfo() should fetch caption and short caption in the newly-set language.
+  2. GetAppIcon() should fetch icons from the icon file selected for current locale.
+ */	
+void CT_LocaleStep::TestLocaleApplicationInfoOnDemandL()
+	{
+	INFO_PRINTF1(_L("APPFWK-APPARC-0061: TestLocaleApplicationInfoOnDemandL started..."));
+	TestAppInfoL(ETrue);
+	INFO_PRINTF1(_L("APPFWK-APPARC-0061: TestLocaleApplicationInfoOnDemandL finished..."));	
+	}
+
+/**
+  @SYMTestCaseID APPFWK-APPARC-0062
+ 
+  @SYMPREQ CR0902 - Enable Dynamic Language Switching in APPARC.
+ 
+  @SYMTestCaseDesc Test whether caption, short caption and app icon, is updated with respect to the change in 
+  locale/language. This test case checks on language change event apparc updates application localisable
+  information for all installed applications, without forcing a change in the part of file system which 
+  apparc monitors.
+ 
+  @SYMTestPriority Critical
+ 
+  @SYMTestStatus Implemented
+
+  @SYMTestActions  Check if language is English by calling User::Language(). 
+  
+  1. Call GetAppInfo() by passing an application's UID which provides support for multiple languages.
+  Check if the caption and short caption, both are in English. Change locale to French.
+  2. Call GetAppIcon by passing same application's UID. Check app icons are same as sepcified in 
+  app icon file for English locale.
+  
+  Change locale to French. Wait for some time (e.g. 4 seconds) to let apparc complete rescanning of app-list.
+  Again - 
+  1. Call GetAppInfo() by passing same application's UID and check if the caption and short caption, 
+  both are in French.
+  2. Call GetAppIcon() by passing same application's UID. Check app icons are same as sepcified in 
+  app icon file for French locale.
+  
+  Restore locale to English and again check - 
+  1. If caption and short caption are in English after a call to GetAppInfo() for the same application.
+  2. Call GetAppIcon() by passing same application's UID. Check app icons are same as sepcified in 
+  app icon file for English locale.
+  
+  @SYMTestExpectedResults 
+  1. GetAppInfo() should fetch caption and short caption in the newly-set language.
+  2. GetAppIcon() should fetch icons from the icon file selected for current locale.  
+ */	
+void CT_LocaleStep::TestLocaleApplicationInfoL()
+	{
+	INFO_PRINTF1(_L("APPFWK-APPARC-0062: TestLocaleApplicationInfoL started..."));	
+	TestAppInfoL(EFalse);	
+	INFO_PRINTF1(_L("APPFWK-APPARC-0062: TestLocaleApplicationInfoL finished..."));	
+	}
+			
+/** 
+  This function performs steps to test application related information (caption, short caption and app icon)
+  on language change event . 
+  It is called from TestLocaleApplicationInfoOnDemandL and TestLocaleApplicationInfoL.
+    
+  @param aOnDemand Pass true if on demand loading is required, otherwise false.
+*/
+void CT_LocaleStep::TestAppInfoL(TBool aOnDemand)
+	{
+	TInt ret = RFbsSession::Connect();
+	TEST(ret == KErrNone);
+	
+	// If it is on-demand loading delay would be very less.
+	TInt delay = aOnDemand ? KDelayForOnDemand : KDelay;
+	
+	// Check language is not currently set to French (any other language except English since English is the default language.
+	TEST(User::Language() != ELangFrench);
+	
+	// Caption and Short-caption should be same as defined in English localisable strings file (tstapp01.rls)
+	_LIT(KCaptionEng, "TstCap UK"); 
+	_LIT(KShortCaptionEng, "TC UK");
+	
+	// Call GetAppInfo() by passing KUidTestApp as tstapp's UID. tstapp provides support for multiple languages.
+	TApaAppInfo appInfo;
+	ret = iLs.GetAppInfo(appInfo, KUidTestApp);
+	TEST(ret == KErrNone);
+	
+	// Caption and short-caption should be in English.
+	TEST(appInfo.iCaption == KCaptionEng);
+	TEST(appInfo.iShortCaption == KShortCaptionEng);
+	
+	// Test application's icons, should be same as sepcified in app icon file for English locale.
+	TestAppIconL(TSize(40,55));
+		
+	// Change the locale to French
+	TRAP(ret, ChangeLocaleL(ELangFrench));
+	TEST(ret == KErrNone);
+	TEST(User::Language() == ELangFrench);//check language is set to French
+
+	// Caption and Short-caption should be same as defined in French localisable strings file (tstapp02.rls)
+	_LIT(KCaptionFrench, "TstCap FR");
+	_LIT(KShortCaptionFrench, "TC FR");
+	
+	User::After(delay);
+	
+	// Again call GetAppInfo() by passing KUidTestApp as UID. 	
+	ret = iLs.GetAppInfo(appInfo, KUidTestApp);
+	TEST(ret == KErrNone);
+	
+	// Caption and short-caption should be in French.
+	TEST(appInfo.iCaption == KCaptionFrench);
+	TEST(appInfo.iShortCaption == KShortCaptionFrench);
+	
+	// Test application's icons, should be same as sepcified in app icon file for French locale.
+	TestAppIconL(TSize(50,50));
+
+	// Restore locale before exiting the testcase.
+	TRAP(ret, ChangeLocaleL(ELangEnglish));
+	TEST(ret == KErrNone);
+	TEST(User::Language() == ELangEnglish);
+	
+	User::After(delay);
+	
+	ret = iLs.GetAppInfo(appInfo, KUidTestApp);
+	TEST(ret == KErrNone);
+	
+	// Caption and short-caption should again be in English.
+	TEST(appInfo.iCaption == KCaptionEng);
+	TEST(appInfo.iShortCaption == KShortCaptionEng);
+	
+	// Test application's icons, should be same as sepcified in app icon file for English locale.
+	TestAppIconL(TSize(40,55));
+	
+	RFbsSession::Disconnect();
+	}
+/**
+  This function tests application's icon. It is called from TestAppInfoL function.
+*/	
+void CT_LocaleStep::TestAppIconL(TSize aSize)
+	{
+	CApaMaskedBitmap* icon = CApaMaskedBitmap::NewLC();
+	TSize lastSize(0,0);
+
+	TInt ret = iLs.GetAppIcon(KUidTestApp, aSize, *icon);
+	TEST(ret == KErrNone);
+	// Returned icon size should be exactly same as asked.
+	TEST(icon->SizeInPixels().iWidth * icon->SizeInPixels().iHeight == aSize.iWidth * aSize.iHeight);
+	
+	CleanupStack::PopAndDestroy(icon);
+	}
+
+/**
+  @SYMTestCaseID APPFWK-APPARC-0063
+ 
+  @SYMPREQ CR0902 - Enable Dynamic Language Switching in APPARC.
+ 
+  @SYMTestCaseDesc Test whether caption and short caption remains same on language change, if application
+   does not provide support for multiple languages. 
+ 
+  @SYMTestPriority Critical 
+ 
+  @SYMTestStatus Implemented
+
+  @SYMTestActions  Check if language is English by calling User::Language(). Call GetAppInfo() by passing an
+  application's UID which does not provide support for multiple languages. Check if the caption and short 
+  caption, both are in English. Change locale to French.Wait for a small period (20 milli seconds) to let 
+  apparc receive language change notification. Again Call GetAppInfo() by passing same application's UID and 
+  check if the caption and short caption, both are still in English. Restore locale to English and again check 
+  if caption and short caption are in English after a call to GetAppInfo() for the same application.
+  
+  @SYMTestExpectedResults GetAppInfo() should fetch caption and short caption in the same language. 
+ */	
+void CT_LocaleStep::TestLocaleApplicationInfo1L()
+	{
+	INFO_PRINTF1(_L("APPFWK-APPARC-0063: TestLocaleApplicationInfo1L started..."));	
+	TInt ret = KErrNotFound;	
+		
+	// Check language is not currently set to French (any other language except English since English is the default language.
+	TEST(User::Language() != ELangFrench);
+	
+	// Caption and Short-caption should be same as defined in the localisable resource file. (CustomiseDefaultIconApp_loc.RSS)
+	_LIT(KCaptionEng, "CustomiseDefaultIconAppLong"); 
+	_LIT(KShortCaptionEng, "CustomiseDefaultIconApp");
+	
+	// KUidCustomiseDefaultIconApp - uid of CustomiseDefaultIconApp_reg.RSS; this app does not provide support for multiple languages.
+		
+	// Call GetAppInfo() by passing above UID.
+	TApaAppInfo appInfo;
+	ret = iLs.GetAppInfo(appInfo, KUidCustomiseDefaultIconApp);
+	TEST(ret == KErrNone);
+	
+	// Caption and short-caption should be in English.	
+	TEST(appInfo.iCaption == KCaptionEng);
+	TEST(appInfo.iShortCaption == KShortCaptionEng);
+		
+	// Change the locale to French
+	TRAP(ret,ChangeLocaleL(ELangFrench));
+	TEST(ret == KErrNone);
+	TEST(User::Language() == ELangFrench);//check language is set to French.
+
+	// Wait for a small period (20 milli seconds) to let apparc receive language change notification. 
+	User::After(KDelayForOnDemand);	
+	
+	// Again call GetAppInfo() by passing KUidTestApp as UID. 	
+	ret = iLs.GetAppInfo(appInfo, KUidCustomiseDefaultIconApp);
+	TEST(ret == KErrNone);
+	
+	// Caption and short-caption should be in English.
+	TEST(appInfo.iCaption == KCaptionEng);
+	TEST(appInfo.iShortCaption == KShortCaptionEng);	
+
+	// Restore locale before exiting the testcase.
+	TRAP(ret,ChangeLocaleL(ELangEnglish));
+	TEST(ret == KErrNone);
+	TEST(User::Language() == ELangEnglish);
+	
+	User::After(KDelayForOnDemand);
+	ret = iLs.GetAppInfo(appInfo, KUidCustomiseDefaultIconApp);
+	TEST(ret == KErrNone);
+	
+	// Caption and short-caption should be in English again.
+	TEST(appInfo.iCaption == KCaptionEng);
+	TEST(appInfo.iShortCaption == KShortCaptionEng);
+	
+	INFO_PRINTF1(_L("APPFWK-APPARC-0063: TestLocaleApplicationInfo1L finished..."));	
+	}
+
+/**
+  @SYMTestCaseID APPFWK-APPARC-0064 APPFWK-APPARC-0066 APPFWK-APPARC-0068
+ 
+  @SYMPREQ CR0902 - Enable Dynamic Language Switching in APPARC.
+ 
+  @SYMTestCaseDesc Test whether 
+  1. View's caption is updated with respect to the change in locale/language. 
+  2. View's icons is updated with respect to the change in locale/language. 
+  3. View's icon file name changes with respect to the change in locale/language. 
+  
+  This test case checks apparc updates application localisable information for all installed applications 
+  on language change event without forcing a change in the part of file system which apparc monitors.
+  This test also tests, on a language change event, application's localisable information is updated 
+  immediately, if not yet updated by the re-scan (On demand loading). This is done by not giving enough 
+  time to finish rescan of app-list.
+ 
+  @SYMTestPriority High 
+ 
+  @SYMTestStatus Implemented
+
+  @SYMTestActions  Check if language is English by calling User::Language(). Call GetAppViews() by passing 
+  an application's UID which provides support for multiple languages and different size icons for French 
+  language. 
+  
+  1. Check if all view captions are same as specified in localisable file and in English.  
+  2. Call GetAppViewIcon() passing above application's ID. Check view icon size, it should be as 
+  specified in English icon file.
+  3. Call overload of GetAppViewIcon() which returns view's icon file, passing above application's ID. 
+  
+  Change locale to French.Wait for a small period (20 milli seconds) to let apparc receive language change 
+  notification. Again - 
+  
+  1. Call GetAppViews() by passing same application's UID and check if the view captions for all views 
+  are in French.
+  2. Call GetAppViewIcon() by passing same application's UID.Check view icon size, it should be as specified 
+  in French icon file.
+  3. Call GetAppViewIcon() by passing same application's UID. Check view icon file, it should be same as 
+  specified in French locale.
+  
+  Restore locale to English and again check 
+  1. if view captions are same as specified in English resource file.
+  2. if view icon size is same as specified in English icon file.
+  3. if view icon file is same as specified in English resource file.
+  
+  @SYMTestExpectedResults Following are the expected results.
+  1. GetAppViews() should fetch captions for all views in the newly-set language.
+  2. GetAppViewIcon() should fetch icons specified in the newly-set language.
+  3. GetAppViewIcon() should fetch view's icon file specified in the newly-set language.
+ */	
+void CT_LocaleStep::TestLocaleViewCaptionAndIconOnDemandL()
+	{
+	INFO_PRINTF1(_L("APPFWK-APPARC-0064: TestLocaleViewCaptionOnDemandL started..."));		
+	INFO_PRINTF1(_L("APPFWK-APPARC-0066: TestLocaleViewIconSizeOnDemandL started..."));
+	INFO_PRINTF1(_L("APPFWK-APPARC-0068: TestLocaleViewIconFileOnDemandL started..."));
+	TestViewCaptionAndIconL(ETrue);
+	INFO_PRINTF1(_L("APPFWK-APPARC-0064: TestLocaleViewCaptionOnDemandL finished..."));
+	INFO_PRINTF1(_L("APPFWK-APPARC-0066: TestLocaleViewIconSizeOnDemandL finished..."));
+	INFO_PRINTF1(_L("APPFWK-APPARC-0068: TestLocaleViewIconFileOnDemandL finished..."));	
+	}
+	
+/**
+  @SYMTestCaseID APPFWK-APPARC-0065 APPFWK-APPARC-0067 APPFWK-APPARC-0069
+ 
+  @SYMPREQ CR0902 - Enable Dynamic Language Switching in APPARC.
+  @SYMDEF PDEF113054 - Apparc fails to detect the presence of localized Mbm files
+ 
+  @SYMTestCaseDesc Test whether 
+  1. View's caption changes with respect to the change in locale/language.
+  2. View's icons is updated with respect to the change in locale/language. 
+  3. View's icon file name changes with respect to the change in locale/language. 
+  
+  This test case checks apparc updates application localisable information for all installed applications 
+  on language change event without forcing a change in the part of file system which apparc monitors.
+  
+  It checks for localized MBM files and MBM icon files with generic extension for an application. 
+  @SYMTestPriority High 
+ 
+  @SYMTestStatus Implemented
+
+  @SYMTestActions  Check if language is English by calling User::Language(). Call GetAppViews() by passing 
+  an application's UID which provides support for multiple languages and different size icons for French 
+  language. 
+  1. Check if all view captions are same as specified in localisable file and in English.
+  2. Call GetAppViewIcon() passing above application's ID. Check view icon size, it should be as 
+  specified in English icon file.
+  3. Call overload of GetAppViewIcon() which returns view's icon file, passing above application's ID. 
+  
+  Change locale to French. Wait for some time (e.g. 4 seconds) to let apparc complete rescanning of app-list.
+  Again - 
+  1. Call GetAppViews() by passing same application's UID and check if the view captions for all views 
+  are in French.
+  2. Call GetAppViewIcon() by passing same application's UID.Check view icon size, it should be as specified 
+  in French icon file.
+  3. Call GetAppViewIcon() by passing same application's UID. Check view icon file, it should be same as 
+  specified in French locale.
+  
+  Restore locale to English and again check - 
+  1. if view captions are same as specified in English resource file.
+  2. if view icon size is same as specified in English icon file.
+  3. if view icon file is same as specified in English resource file.
+  
+  @SYMTestExpectedResults Following are the expected results.
+  1. GetAppViews() should fetch captions for all views in the newly-set language.
+  2. GetAppViewIcon() should fetch icons specified in the newly-set language. 
+  3. GetAppViewIcon() should fetch view's icon file specified in the newly-set language.  		 
+ */	
+ void CT_LocaleStep::TestLocaleViewCaptionAndIconL()
+	{
+	INFO_PRINTF1(_L("APPFWK-APPARC-0065: TestLocaleViewCaption started..."));
+	INFO_PRINTF1(_L("APPFWK-APPARC-0067: TestLocaleViewIconSizeL started..."));
+	INFO_PRINTF1(_L("APPFWK-APPARC-0069: TestLocaleViewIconFileL started..."));
+	TestViewCaptionAndIconL(EFalse);
+	INFO_PRINTF1(_L("APPFWK-APPARC-0065: TestLocaleViewCaption finished..."));
+	INFO_PRINTF1(_L("APPFWK-APPARC-0067: TestLocaleViewIconSizeL finished..."));
+	INFO_PRINTF1(_L("APPFWK-APPARC-0069: TestLocaleViewIconFileL finished..."));
+	}
+		
+
+/** 
+  This function performs steps to test view related information (view caption, view icon size and view icon 
+  file name) on language change event.
+  and view icon file name.
+  
+  This function is called from following test cases -
+  TestLocaleViewCaptionAndIconOnDemandL,
+  TestLocaleViewCaptionAndIconL
+   
+  @param aTesCaption Pass true if caption test is required, otherwise false for view icon test.
+  @param aOnDemand Pass true if on demand loading is required, otherwise false.   
+*/
+void CT_LocaleStep::TestViewCaptionAndIconL(TBool aOnDemand)
+	{	
+	TInt ret = RFbsSession::Connect();
+	TEST(ret == KErrNone);
+	
+	// If it is on-demand loading delay would be very less.
+	TInt delay = aOnDemand ? KDelayForOnDemand : KDelay;
+	
+	// Check language is not currently set to French (any other language except English since English is the default language.
+	TEST(User::Language() != ELangFrench);
+	
+	// Create view array to hold views for TstApp.
+	CApaAppViewArray* appViews = new(ELeave) CApaAppViewArray(KViewCount);
+	CleanupStack::PushL(appViews);
+	
+	// Call GetAppViews() by passing tstapp's KUidTestApp as UID. 
+	// tstapp provides support for multiple languages. 
+	ret = iLs.GetAppViews(*appViews, KUidTestApp);
+	TEST(ret == KErrNone);
+	
+	// Check application's view count. It should have three views.One of them is invalid
+	TInt count = appViews->Count();	
+	TEST(count == KViewCount);	
+	
+	// Check application's view's captions or icons. They should be in English
+	CheckViewCaptionAndIconL(ELangEnglish, appViews);
+	CleanupStack::PopAndDestroy(appViews);		
+		
+	// Switch locale to French
+	TRAP(ret, ChangeLocaleL(ELangFrench));
+	TEST(ret == KErrNone);
+	TEST(User::Language() == ELangFrench);//check language is set to French
+
+	// Wait for a small period to let apparc receive language change notification. 
+	User::After(delay);	
+	
+	// Create view array to hold views for TstApp.
+	appViews = NULL;
+	appViews = new(ELeave) CApaAppViewArray(KViewCount);
+	CleanupStack::PushL(appViews);
+	
+	ret = iLs.GetAppViews(*appViews, KUidTestApp);
+	TEST(ret == KErrNone);	
+	
+	count = appViews->Count();
+	TEST(count == KViewCount);
+	
+	//Check application's view's captions or icons. They should be in French.
+	CheckViewCaptionAndIconL(ELangFrench, appViews);	
+	CleanupStack::PopAndDestroy(appViews);		
+	
+	//Restore locale to English before exiting the testcase
+	TRAP(ret, ChangeLocaleL(ELangEnglish));
+	TEST(ret == KErrNone);
+	TEST(User::Language() == ELangEnglish);
+	
+	User::After(delay);
+	
+	appViews = NULL;
+	appViews = new(ELeave) CApaAppViewArray(KViewCount);
+	CleanupStack::PushL(appViews);
+	ret = iLs.GetAppViews(*appViews, KUidTestApp);
+	
+	TEST(ret == KErrNone);	
+	count = appViews->Count();
+	TEST(count == KViewCount);
+	
+	//check every thing is restored to English.
+	CheckViewCaptionAndIconL(ELangEnglish, appViews);
+	CleanupStack::PopAndDestroy(appViews);
+	RFbsSession::Disconnect();	
+	}
+
+/** 
+  Tests view's caption and view's icon.
+  It is called from TestViewCaptionAndIconL function.
+  This function is hardcoded to test view captions and icons for two languages - 
+  ELangEnglish and ELangFrench, 
+  if any other language is passed from any test case, this function will cause the test case to fail.
+     
+  @param aLanguage Language for which to test caption/icon.
+  @param aAppViews application's view array.  
+*/	
+void CT_LocaleStep::CheckViewCaptionAndIconL(TLanguage aLanguage, CApaAppViewArray* aAppViews)
+	{
+	TInt testNumberOfIcons=KViewCount-1;
+	// the for loop will check for all view icons except the last one which is invalid
+	// Hence the upper limit is KViewCount-1
+	for (TInt ii=0; ii < testNumberOfIcons ; ii++)
+
+		{
+		const TApaAppViewInfo& viewInfo = (*aAppViews)[ii];
+		TEST(viewInfo.iViewCaption.Length() > 0);
+		TBuf<256> viewCaption;
+		TBuf<256> viewIconFileName;
+		TSize iconSize;
+		
+		switch(aLanguage)
+			{
+			case ELangEnglish:
+				viewCaption.Format(_L("V%d UK"), ii+1);
+				iconSize.iWidth  = 50;
+				iconSize.iHeight = 50;
+				break;
+							
+			case ELangFrench:
+				viewCaption.Format(_L("V%d FR"), ii+1);
+				iconSize.iWidth  = 40;
+				iconSize.iHeight = 55;
+				break;
+			
+			default:
+				// This case will cause test case to fail if any other language is passed apart from English and French.
+				break; 
+			}
+		
+		// View's captions should be same as defined in language's localisable strings file (tstappXX.rls)
+		TEST(viewInfo.iViewCaption == viewCaption);
+		
+		// View's icon size should be same as defined in icon file for the selected locale/language.
+		CApaMaskedBitmap* viewBitmap = CApaMaskedBitmap::NewLC();
+		TInt ret = iLs.GetAppViewIcon(KUidTestApp, viewInfo.iUid, iconSize, *viewBitmap);
+		TEST(ret == KErrNone);
+		CleanupStack::PopAndDestroy(viewBitmap);
+		
+		// View's icon file should be same as defined in language's localisable strings file (tstappXX.rls)
+		HBufC* fullFileName = NULL;
+		ret = iLs.GetAppViewIcon(KUidTestApp, viewInfo.iUid, fullFileName);
+		TEST(ret == KErrNone);
+		TEST(fullFileName != NULL);
+		INFO_PRINTF2(_L("View's icon file name is - %S"), fullFileName);
+		TEST(fullFileName->Length() > 0);
+		
+		delete fullFileName;
+		fullFileName = NULL;		
+		} //end of for
+/*The invalid View icon for language French has the file name "tstappview.mbm" This should 
+return KErrNotSupported. Refer to PDEF113054 for details */
+	if (aLanguage==ELangFrench)
+		{
+		TSize iconSize;
+		const TApaAppViewInfo& viewInfo = (*aAppViews)[2];
+		CApaMaskedBitmap* viewBitmap = CApaMaskedBitmap::NewLC();
+		TInt ret = iLs.GetAppViewIcon(KUidTestApp, viewInfo.iUid, iconSize, *viewBitmap);
+		TEST(ret == KErrNotSupported);
+		CleanupStack::PopAndDestroy(viewBitmap);
+		HBufC* fullFileName = NULL;
+		ret = iLs.GetAppViewIcon(KUidTestApp, viewInfo.iUid, fullFileName);
+		TEST(ret == KErrNone);
+		TEST(fullFileName != NULL);
+		INFO_PRINTF2(_L("Negative View icon file name is - %S"), fullFileName);
+		TEST(fullFileName->Length() > 0);
+		delete fullFileName;
+		fullFileName = NULL;		
+		}
+	}
+		
+CT_LocaleStep::~CT_LocaleStep()
+/**
+   Destructor
+ */
+	{
+	}
+
+CT_LocaleStep::CT_LocaleStep()
+/**
+   Constructor
+ */
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_LocaleStep);
+	}
+
+TVerdict CT_LocaleStep::doTestStepPreambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	SetTestStepResult(EPass);
+	return TestStepResult();
+	}
+
+TVerdict CT_LocaleStep::doTestStepPostambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	return TestStepResult();
+	}
+
+
+TVerdict CT_LocaleStep::doTestStepL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+{
+	INFO_PRINTF1(_L("Locale tests started"));
+	
+	FbsStartup();
+	TEST(KErrNone == iFs.Connect());
+	TEST(KErrNone == iLs.Connect());
+
+	// run the tests
+	//DONT_CHECK due to changes to file system	
+	HEAP_TEST_LS_SESSION(iLs, 0, DONT_CHECK, TestLocaleApplicationInfoOnDemandL() ,NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iLs, 0, DONT_CHECK, TestLocaleApplicationInfoL() ,NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iLs, 0, DONT_CHECK, TestLocaleApplicationInfo1L() ,NO_CLEANUP);		
+	HEAP_TEST_LS_SESSION(iLs, 0, DONT_CHECK, TestLocaleViewCaptionAndIconOnDemandL(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iLs, 0, DONT_CHECK, TestLocaleViewCaptionAndIconL() ,NO_CLEANUP);	
+	HEAP_TEST_LS_SESSION(iLs, 0, DONT_CHECK, TestLocaleDefaultIconL() ,NO_CLEANUP);
+	
+	iLs.Close();
+	iFs.Close();
+	
+	INFO_PRINTF1(_L("Test completed!"));
+	return TestStepResult();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_LocaleStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,68 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+ 
+#if (!defined __T_LOCALE_STEP_H__)
+#define __T_LOCALE_STEP_H__
+
+#include "ApparcTestServer.h"
+#include <apgnotif.h>
+#include "testableapalssession.h"
+
+//!  A CT_LocaleStep test class. 
+
+/** Class tests for UIKON GT0143 Typhoon Work Series 60 Changes. 
+It also tests CR0902 work : Enable Dynamic Language Switching in APPARC.
+*/
+
+class CT_LocaleStep : public CTestStep
+	{
+public:
+	CT_LocaleStep();
+	~CT_LocaleStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+private:
+	void ChangeLocaleL(TLanguage aLanguage);
+	void CheckIcons(CArrayFixFlat<TSize>* aNewIconSizes,TSize aSmall,TSize aMedium,TSize aLarge, TSize& afstIcon, TSize& asecIcon, TSize& atrdIcon);
+	void TestLocaleDefaultIconL();
+	
+	//Functions to test application information on language change event.
+	void TestLocaleApplicationInfoOnDemandL();
+	void TestLocaleApplicationInfoL();
+	void TestLocaleApplicationInfo1L();
+	void TestAppInfoL(TBool aOnDemand);
+	void TestAppIconL(TSize aSize);
+	
+	//Functions to test view's caption and icons on language change event.	
+	void TestLocaleViewCaptionAndIconOnDemandL();
+	void TestLocaleViewCaptionAndIconL();
+	void TestViewCaptionAndIconL(TBool aOnDemand);
+	void CheckViewCaptionAndIconL(TLanguage aLanguage, CApaAppViewArray* aAppViews);
+
+private:
+	RFs iFs;
+	RTestableApaLsSession iLs;
+	};
+
+_LIT(KT_LocaleStep,"T_Locale");
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_MRUStep.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,338 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Test MRU list\n
+// Tests MRU list by calling CApaProcess::SetMainDocFileName().\n
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <f32file.h>
+#include <apaid.h>
+#include <apgaplst.h>
+#include <apgicnfl.h>
+#include <apgdoor.h>
+#include <apparc.h>
+#include "tstapp.h"
+#include <fbs.h>
+#include <s32std.h> 
+#include <s32stor.h> 
+#include <s32file.h> 
+#include <s32mem.h>
+#include "T_MruStep.h"
+
+#if !defined(__E32TEST_H__)
+#include <e32test.h>
+#endif
+
+
+void CT_MruStep::setup()
+	{
+#if defined(__EPOC32__)
+	// if we're on the rack create the directories we need
+	TFullName filePath=_L("c:\\docs\\tstapp.doc");
+	TFullName tempPath=_L("c:\\system\\temp\\");
+	TParse parser;
+	parser.Set(filePath,NULL,NULL);
+	iFs.MkDirAll(parser.DriveAndPath());
+	parser.Set(tempPath,NULL,NULL);
+	iFs.MkDirAll(parser.DriveAndPath());
+#endif
+	}
+
+
+/**
+   @SYMTestCaseID T-MruStep-TestMRUL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test MRU list by calling CApaProcess::SetMainDocFileName() multiple times.
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Test MRU list by calling CApaProcess::SetMainDocFileName()
+   in the following cases:\n
+   (1) Call CApaProcess::SetMainDocFileName() with no document created.\n
+   (2) Call CApaProcess::SetMainDocFileName() after document creation. \n
+   (3) Create a document for tstapp. Call CApaProcess::SetMainDocFileName()
+   multiple times using the same filename to be set in the
+   Most Recently Used (MRU) list. Ensure that only once the list is updated
+   with the filename.\n
+   (4) Create a document for tstapp. Call CApaProcess::SetMainDocFileName()
+   multiple times using different filename to be set in the
+   Most Recently Used (MRU) list on each attempt. Ensure that only a
+   maximum of 50 filenames are present.\n
+   (5) Open MRU.DAT and then call CApaProcess::SetMainDocFileName().
+   The filename set should not appear in MRU list since MRU.DAT is open.\n
+   (6) Create a document for tstapp. Call CApaProcess::SetMainDocFileName()
+   multiple times when there is no memory available on the device.
+   The MRU list should not reflect the newly set file name.\n
+   (7) Test CApaRecentFile::GetRecentFileL() by passing KNullUid.
+   Ensure that all entries for those last used documents are retrieved
+   when KNullUid is passed.\n
+   (8) Test CApaRecentFile::GetRecentFileListL() to ensure that it returns NULL.\n
+   In the above mentioned situations tests ensure that
+   there are no memory leaks.\n\n
+   API Calls:\n	
+   CApaProcess::SetMainDocFileName(const TDesC& aMainDocFileName)\n
+   CApaRecentFile::GetRecentFileL(RFs& aFs, TUid aAppUid, TInt aIndex)\n
+   CApaRecentFile::GetRecentFileListL(RFs& aFs, TUid aAppUid)\n
+   
+   @SYMTestExpectedResults Each of the tests should complete with the desired
+   output and without any memory leaks.
+    
+ */
+void CT_MruStep::TestMRUL()
+	{
+	CApaProcess* process=NULL;
+	CApaDocument* doc=NULL;
+	
+	// Test 1
+	INFO_PRINTF1(_L("SetMainDocFileName with no document"));
+	__UHEAP_RESET;
+	__UHEAP_MARK;
+	process = CApaProcess::NewL(iFs);
+	process->SetMainDocFileName(_L("FileName 01"));
+	delete process;
+	__UHEAP_MARKEND;
+
+	// test 2
+	INFO_PRINTF1(_L("SetMainDocFileName after document construction"));
+
+	__UHEAP_RESET;
+	__UHEAP_MARK;
+
+	// Create document
+	process = CApaProcess::NewL(iFs);
+	TApaApplicationFactory appFact(KUidTestApp);
+	doc = process->AddNewDocumentL(appFact);
+	
+	// Set file name into MRU list
+	process->SetMainDocFileName(_L("FileName 02"));
+	process->DestroyDocument(doc);
+	delete process;
+	REComSession::FinalClose();
+	__UHEAP_MARKEND;
+
+	// test 3
+	INFO_PRINTF1(_L("SetMainDocFileName x100 with same filename"));
+	TInt count;
+
+	__UHEAP_RESET;
+	__UHEAP_MARK;
+	
+	process = CApaProcess::NewL(iFs);
+	doc = process->AddNewDocumentL(appFact);
+	
+	// Set file name into MRU list - this name should only appear once
+	for (count=0; count<100; count++)
+		process->SetMainDocFileName(_L("FileName 03"));
+		
+	process->DestroyDocument(doc);
+	delete process;
+
+	REComSession::FinalClose();
+	__UHEAP_MARKEND;
+
+	// test 4
+	INFO_PRINTF1(_L("SetMainDocFileName x100 with different filenames"));
+
+	__UHEAP_RESET;
+	__UHEAP_MARK;
+
+	process = CApaProcess::NewL(iFs);
+	doc = process->AddNewDocumentL(appFact);
+    
+	/** Set file name into MRU list - there should only be a maximum of 50 names in the list */
+	TBuf<20> fileName;
+
+	for (count=0; count < 100; count++)
+		{
+		fileName.Zero();
+		fileName.AppendFormat(_L("FileName %d"),count);
+
+		process->SetMainDocFileName(fileName);
+		}
+
+	process->DestroyDocument(doc);
+	delete process;
+
+	REComSession::FinalClose();
+	__UHEAP_MARKEND;
+
+
+	// test 7
+	INFO_PRINTF1(_L("Testing GetRecentFileL with KNullUid"));
+
+	__UHEAP_RESET;
+	__UHEAP_MARK;
+	
+	process = CApaProcess::NewL(iFs);
+	doc = process->AddNewDocumentL(appFact);
+
+	process->DestroyDocument(doc);
+	delete process;
+
+	REComSession::FinalClose();
+	__UHEAP_MARKEND;
+
+	// MRU functionality has been removed in 7.0s test that GetRecentFile returns NULL
+	// test 8
+	INFO_PRINTF1(_L("Testing GetRecentFileListL returns NULL"));
+
+	__UHEAP_RESET;
+	__UHEAP_MARK;
+	
+	process = CApaProcess::NewL(iFs);
+	doc = process->AddNewDocumentL(appFact);
+
+	process->DestroyDocument(doc);
+	delete process;
+
+	REComSession::FinalClose();
+	__UHEAP_MARKEND;
+	}
+
+
+/**
+  Auxiliary Fn for all Test Cases.
+ 
+  This method creates and installs an active scheduler and puts the
+  test code onto the scheduler as a CIdle object. The method initiates
+  all tests by calling the static method CT-MruTestCallBackWrapper::CallBack().
+ 
+*/
+void CT_MruStep::DoTestsInScheldulerLoopL()
+	{
+	// create an active scheduler
+	CActiveScheduler* scheduler = new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(scheduler);
+	CleanupStack::PushL(scheduler);
+
+	// put the test code onto the scheduler as an idle object
+	CIdle* idle=CIdle::NewL(-20);
+	CleanupStack::PushL(idle);
+
+	CT_MruTestCallBackWrapper* callBack = new(ELeave) CT_MruTestCallBackWrapper(this);
+	CleanupStack::PushL(callBack);
+
+	idle->Start(TCallBack(CT_MruTestCallBackWrapper::CallBack,callBack));
+	// start the test code
+	CActiveScheduler::Start();
+
+	// all outstanding requests complete - kill the scheduler
+	CleanupStack::PopAndDestroy(3); //scheduler, callBack, idle
+	}
+
+
+CT_MruTestCallBackWrapper::CT_MruTestCallBackWrapper(CT_MruStep* aTestStep)
+/**
+   Constructor
+ */
+	{
+	iTestStep=aTestStep;
+	}
+
+CT_MruTestCallBackWrapper::~CT_MruTestCallBackWrapper()
+/**
+   Destructor
+ */
+	{
+	}
+	
+TInt CT_MruTestCallBackWrapper::CallBack(TAny* aPtr)
+/**
+  This static method is the callback function of CIdle object.The method
+  calls the non-static method TestMRUL() which initiates all the tests. 
+*/
+	{
+	__UHEAP_MARK;
+	
+	TRAPD(r,((CT_MruTestCallBackWrapper *)aPtr)->iTestStep->TestMRUL());
+	__ASSERT_ALWAYS(!r,User::Panic(_L("TestMRUL"),r));
+    __UHEAP_MARKEND;
+  
+	CActiveScheduler::Stop();
+	return EFalse; // don't call back again
+	}
+
+CT_MruStep::~CT_MruStep()
+/**
+   Destructor
+ */
+	{
+	}
+
+CT_MruStep::CT_MruStep()
+/**
+   Constructor
+ */
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_MruStep);
+	}
+
+TVerdict CT_MruStep::doTestStepPreambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	SetTestStepResult(EPass);
+	return TestStepResult();
+	}
+
+TVerdict CT_MruStep::doTestStepPostambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	return TestStepResult();
+	}
+
+
+TVerdict CT_MruStep::doTestStepL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+ 	{
+	INFO_PRINTF1(_L("Testing Apparch...T_Mru"));
+	
+	// set up an fbs
+	FbsStartup();
+	TInt ret=RFbsSession::Connect();
+	TEST(!ret);
+
+	// set up the directory structure
+	iFs.Connect();
+	setup();
+
+	// run the testcode
+	TRAP(ret,DoTestsInScheldulerLoopL())
+	TEST(ret==KErrNone);
+	
+	iFs.Close();
+
+	INFO_PRINTF1(_L("Testing T_Mru Completed!"));
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_MdrStep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,544 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Test for CApaDoor and CApaModelDoor Apis\n
+// 
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+#include <f32file.h>
+#include <s32std.h> 
+#include <s32stor.h> 
+#include <s32file.h> 
+#include <s32mem.h>
+#include <fbs.h>
+//
+#include <apamdr.h>
+#include <apgdoor.h>
+#include "tstapp.h"
+#include "T_MdrStep.h"
+//
+#include <e32test.h>
+
+/**
+  Auxiliary Fn for Test Case ID T-MdrStep-testModelDoorL,
+  T-MdrStep-testConversionL
+ 
+  This method overrides CApaModelHeader::AppId(). It returns a
+  TApaAppIdentifier object which identifies the application.
+ 
+*/
+TApaAppIdentifier CTestModelHeader::AppId()const
+	{
+	TFileName dllname=_L("tstapp.app");
+	#define KTestAppId TApaAppIdentifier(KUidTestApp,dllname)
+	return KTestAppId;
+	}
+
+
+/**
+  Auxiliary Fn for Test Case ID T-MdrStep-testModelDoorL,
+  T-MdrStep-testConversionL
+ 
+  This method overrides CApaModelHeader::StoreL().It stores the
+  data in the stream to a store.
+ 
+*/
+void CTestModelHeader::StoreL(CStreamStore& aStore,CStreamDictionary& aDict) const
+	{
+	// write out some data
+	RStoreWriteStream stream;
+	TStreamId id=stream.CreateLC(aStore);
+	stream.WriteInt32L(iData);
+	stream.WriteInt32L(0); // write testapp doc format - no subdocuments
+	stream.CommitL();
+	aDict.AssignL(KUidTestAppHeadStream,id);
+	CleanupStack::PopAndDestroy(); // stream
+	}
+
+
+/**
+   Auxiliary Fn for Test Case ID T-MdrStep-testModelDoorL,
+   T-MdrStep-testConversionL
+ 
+   This method reads the data stored in the store.
+ 
+*/
+void CTestModelHeader::RestoreL(const CStreamStore& aStore,const CStreamDictionary& aDict)
+	{
+	// read in some data
+	RStoreReadStream stream;
+	stream.OpenLC(aStore,aDict.At(KUidTestAppHeadStream));
+	iData = stream.ReadInt32L();
+	CleanupStack::PopAndDestroy(); // stream
+	}
+
+
+void CTestModelHeader::DetachFromStoreL(CPicture::TDetach /*aDetach*/)
+	{}
+
+
+/**
+  Auxiliary Fn for Test Case ID T-MdrStep-testModelDoorL,
+  T-MdrStep-testConversionL
+ 
+  This method overrides MApaModelHeaderFactory::NewHeaderL().It creates and
+  restores model header from the store.
+ 
+*/
+CApaModelHeader* TTestModelHeaderFactory::NewHeaderL(const CStreamStore& aStore,const CStreamDictionary& aDict,
+													 const TApaAppIdentifier& aAppId)const
+	{
+	TFileName dllname=_L("tstapp.app");
+	#define KTestAppId TApaAppIdentifier(KUidTestApp,dllname)
+	if (aAppId.iAppUid!=KTestAppId.iAppUid)
+		User::Leave(KErrNotSupported);
+	CTestModelHeader* header = new(ELeave) CTestModelHeader();
+	CleanupStack::PushL(header);
+	header->RestoreL(aStore,aDict);
+	CleanupStack::Pop(); // header
+	return header;
+	}
+
+
+/**
+   @SYMTestCaseID T-MdrStep-testModelDoorL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Tests storing and restoring of Model door.
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions The test creates a test model header and initializes its
+   member variable iData. A model door object is created by passing
+   application model wrapper object to be embedded to CApaModelDoor::NewL().
+   A temporary store is created and CTestModelHeader::StoreL() is called to
+   store the model door. Call CApaModelDoor::NewL() specifying the store and
+   stream to restore the stored model door. Test values from the restored
+   model door.\n
+   API Calls:\n	
+   CApaModelDoor::NewL(CApaModelHeader* aHeader)\n
+   CApaModelDoor::StoreL(CStreamStore& aStore) const\n
+   CApaModelDoor::NewL(const CStreamStore& aStore,TStreamId aHeadStreamId,const MApaModelHeaderFactory* aFactory)\n
+   CApaModelDoor::ModelHeader()\n
+   
+   @SYMTestExpectedResults Test completes restoration of model door successfully.
+    
+ */
+void CT_MdrStep::testModelDoorL()
+	{
+	const TUid KTestSourceId={458};
+	INFO_PRINTF1(_L("Creating a model door"));
+
+	// create a model header
+	CTestModelHeader* header = new CTestModelHeader();
+	TEST(header!=NULL);
+	header->iData = 7;
+
+	// embed the header in a door
+	CApaModelDoor* door=NULL;
+	TRAPD(ret, door=CApaModelDoor::NewL(header) );
+	TEST(ret==KErrNone);
+
+	// set the source
+	door->SetSource(KTestSourceId);
+
+	// create an in-memory store
+	CBufStore* store=NULL;
+	TRAP(ret, store=CBufStore::NewL(2) );
+	TEST(ret==KErrNone);
+
+	// store the door
+	INFO_PRINTF1(_L("Storing the model door"));
+	TStreamId id = TStreamId(NULL);
+	TRAP(ret, id=door->StoreL(*store) );
+	TEST(ret==KErrNone);
+	delete door; // deletes header also
+
+	// restore the door
+	INFO_PRINTF1(_L("Restoring the model door"));
+	TTestModelHeaderFactory factory;
+	TRAP(ret, door=CApaModelDoor::NewL(*store,id,&factory) );
+	TEST(ret==KErrNone);
+	TEST( ((CTestModelHeader*)door->ModelHeader())->iData==7 );
+	TEST((door->Source()==KTestSourceId));
+	delete door;
+	delete store;
+	}
+
+
+/**
+   @SYMTestCaseID T-MdrStep-testConversionL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Tests conversion of door format to model door format and back. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Create a new document for the tstapp and create a door for the
+   document by calling CApaDoor::NewL(). Create a temporary store to store
+   the door format by calling CTestModelHeader::StoreL(). Restore the door
+   to a model door from the temporary store by calling CApaModelDoor::NewL().
+   Delete the store and store the model door format to a newly created store.
+   Change the format and size of the model door by calling CApaModelDoor::SetFormat()
+   and CApaModelDoor::SetSizeInTwips(). Store the new model door format to
+   the temporary store. Restore the saved model door format to a new door.
+   Observe the conversion of format & size from the saved format to default
+   while it is restored as door.\n
+   API Calls:\n	
+   CApaDoor::NewL(RFs& aFs,CApaDocument& aDoc,const TSize& aDefaultIconSizeInTwips)\n
+   CApaDoor::StoreL(CStreamStore& aStore) const\n
+   CApaModelDoor::NewL(const CStreamStore& aStore,TStreamId aHeadStreamId,const MApaModelHeaderFactory* aFactory)\n
+   CApaModelDoor::StoreL(CStreamStore& aStore) const\n
+   CApaModelDoor::SetFormat(TFormat aFormat)\n
+   CApaModelDoor::SetSizeInTwips(const TSize& aSize)\n
+   
+   @SYMTestExpectedResults Test confirms that there is a conversion from the saved model format to
+   default format while it is restored as a door.
+    
+ */
+void CT_MdrStep::testConversionL()
+	{
+	INFO_PRINTF1(_L("Testing Conversions"));
+	const TUid KTestSourceId={458};
+
+	// set things up
+	TRAPD(ret,iProcess = CApaProcess::NewL(iFs));
+	TEST(ret==KErrNone);
+	CBufStore* store=NULL;
+	//
+	// create a door
+	INFO_PRINTF1(_L("Restoring a full door as a model door"));
+	CApaDocument* doc=NULL;
+	TRAP(ret,doc=iProcess->AddNewDocumentL(KUidTestApp));
+
+	TEST(ret==KErrNone);
+	doc->EditL(NULL); // increments value to 1
+	CApaDoor* door=NULL;
+	TRAP(ret, door=CApaDoor::NewL(iFs,*doc,TSize(1000,1000)) );
+	TEST(ret==KErrNone);
+
+	// set the source
+	door->SetSource(KTestSourceId);
+
+	// create an in-memory store
+	TRAP(ret, store=CBufStore::NewL(2) );
+	TEST(ret==KErrNone);
+
+	// store the door
+	TStreamId id = TStreamId(NULL);
+	TRAP(ret, id=door->StoreL(*store) );
+	TEST(ret==KErrNone);
+	delete door; // deletes doc also
+	door = NULL;
+	doc = NULL;
+
+	// restore the door into a model door
+	TTestModelHeaderFactory factory;
+	CApaModelDoor* modelDoor=NULL;
+	TRAP(ret, modelDoor=CApaModelDoor::NewL(*store,id,&factory) );
+	TEST(ret==KErrNone);
+	TEST( ((CTestModelHeader*)modelDoor->ModelHeader())->iData==1 );
+	TEST(modelDoor->Format()==CApaDoorBase::EIconic);
+	TEST(modelDoor->Source()==KTestSourceId);
+	TSize size;
+	modelDoor->GetSizeInTwips(size);
+	TEST(size==TSize(1000,1000));
+
+	// store the model door
+	INFO_PRINTF1(_L("Restoring a model door as a full door"));
+	delete store;
+	store = NULL;
+	TRAP(ret, store=CBufStore::NewL(2) );
+	TEST(ret==KErrNone);
+	TRAP(ret, id=modelDoor->StoreL(*store) );
+	TEST(ret==KErrNone);
+
+	// restore the model door into a full door
+	TRAP(ret, door=CApaDoor::NewL(iFs,*store,id,*iProcess) );	
+	TEST(ret==KErrNone);
+	delete door;
+	door = NULL;
+	delete store;
+	store = NULL;
+
+	// change the model door format to glass & store it
+	TRAP(ret, store=CBufStore::NewL(2) );
+	TEST(ret==KErrNone);
+	modelDoor->SetFormat(CApaDoorBase::EGlassDoor);
+	modelDoor->SetSizeInTwips(TSize(2500,27));
+	TRAP(ret, id=modelDoor->StoreL(*store) );
+	TEST(ret==KErrNone);
+
+	delete modelDoor; // deletes header also
+	modelDoor = NULL;
+
+	// restore into a full door - this should switch the format to iconic and use the default icon size
+	TRAP(ret, door=CApaDoor::NewL(iFs,*store,id,*iProcess) );	
+	TEST(ret==KErrNone);
+	TEST(door->Format()==CApaDoorBase::EIconic);
+	TEST(door->Source()==KTestSourceId);
+	door->GetSizeInTwips(size);
+	TEST(size==TSize(500,500));
+	delete door;
+	door = NULL;
+	delete store;
+	store = NULL;
+
+	delete iProcess;
+	}
+
+
+// Tests various functions to increase API test coverage
+
+/**
+   @SYMTestCaseID T-MdrStep-testMiscellaneousL
+  
+   @SYMPREQ
+ 
+   @SYMTestCaseDesc Tests capabalities of CApaDoor Apis. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Create a document for tstapp. Create a door to this document.\n
+   Test the following APIs:\n
+   CApaDoor::Capability() const\n
+   CApaDoor::AppUidL() const\n
+   CApaDoor::SetFormatToTemporaryIconL()\n
+   CApaDoor::SetCropInTwips()\n
+   CApaDoor::SetScaleFactor()\n
+   API Calls:\n	
+   CApaDoor::Capability() const\n
+   CApaDoor::AppUidL() const\n
+   CApaDoor::SetFormatToTemporaryIconL(TBool aEnabled=ETrue)\n
+   CApaDoor::SetCropInTwips(const TMargins& aMargins)\n
+   CApaDoor::SetScaleFactor(TInt aScaleFactorWidth,TInt aScaleFactorHeight)\n
+   
+   @SYMTestExpectedResults Test checks results against expected values.
+    
+ */
+void CT_MdrStep::testMiscellaneousL()
+	{
+	INFO_PRINTF1(_L("Testing Misc."));
+	const TUid KTestSourceId={458};
+	
+	// set things up
+	TRAPD(ret,iProcess = CApaProcess::NewL(iFs));
+	
+	CApaDocument* doc=NULL;
+	TApaApplicationFactory appFact(KUidTestApp);
+	TRAP(ret,doc=iProcess->AddNewDocumentL(appFact));
+
+	TEST(ret==KErrNone);
+	doc->EditL(NULL); // increments value to 1
+	CApaDoor* door=NULL;
+	TRAP(ret, door=CApaDoor::NewL(iFs,*doc,TSize(1000,1000)));
+	TEST(ret==KErrNone);
+
+	// set the source
+	door->SetSource(KTestSourceId);
+
+	INFO_PRINTF1(_L("Testing CApaDoor's picture capability"));
+	TPictureCapability  pictCap = door->Capability();
+	TEST(ret==KErrNone);
+	TEST(pictCap.iScalingType == TPictureCapability::ENotScaleable);
+	TEST(pictCap.iIsCroppable == EFalse);
+
+	INFO_PRINTF1(_L("Testing CApaDoor AppUidL"));
+	TUid uid = door->AppUidL();
+	TEST(uid ==KUidTestApp);
+	
+	INFO_PRINTF1(_L("Testing SetFormatToTemporaryIconL"));
+	TRAP(ret, door->SetFormatToTemporaryIconL(ETrue));
+	TEST(ret==KErrNone);
+
+	INFO_PRINTF1(_L("Testing SetCropInTwips"));
+	TMargins margins;
+	TRAP(ret, door->SetCropInTwips(margins));
+	TEST(ret==KErrNone);
+
+	INFO_PRINTF1(_L("Testing SetScaleFactor"));
+	TRAP(ret, door->SetScaleFactor(500, 500));
+	TEST(ret==KErrNone);
+
+	delete door;
+	delete iProcess;
+	}
+
+
+/**
+  Auxiliary Fn for entire Test Step. 
+
+  This method creates and installs an active scheduler and puts the
+  test code on the scheduler as a CIdle object. The method initiates all
+  tests by calling the static method CT-MdrTestCallBackWrapper::CallBack().
+ 
+*/
+void CT_MdrStep::DoTestsInScheldulerLoopL()
+	{
+	// create an active scheduler
+	CActiveScheduler* scheduler = new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(scheduler);
+	CleanupStack::PushL(scheduler);
+
+	// put the test code onto the scheduler as an idle object
+	CIdle* idle=CIdle::NewL(-20);
+	CleanupStack::PushL(idle);
+
+	CT_MdrTestCallBackWrapper* callBack = new(ELeave) CT_MdrTestCallBackWrapper(this);
+	CleanupStack::PushL(callBack);
+
+	idle->Start(TCallBack(CT_MdrTestCallBackWrapper::CallBack,callBack));
+	// start the test code
+	CActiveScheduler::Start();
+
+	// all outstanding requests complete - kill the scheduler
+	CleanupStack::PopAndDestroy(3); //scheduler, callBack, idle
+	}
+
+
+
+CT_MdrTestCallBackWrapper::CT_MdrTestCallBackWrapper(CT_MdrStep* aTestStep)
+/**
+   Constructor
+ */
+	{
+	iTestStep=aTestStep;
+	}
+
+
+CT_MdrTestCallBackWrapper::~CT_MdrTestCallBackWrapper()
+/**
+   Destructor
+ */
+	{
+	}
+
+TInt CT_MdrTestCallBackWrapper::CallBack(TAny* aPtr)
+/**
+  This static method is the callback function of CIdle object. The method
+  calls the non-static method DoStepTests() which initiates all the tests. 
+*/
+	{
+	((CT_MdrTestCallBackWrapper *)aPtr)->iTestStep->DoStepTests();
+
+	CActiveScheduler::Stop();
+	return EFalse; // don't call back again
+	}
+
+CT_MdrStep::~CT_MdrStep()
+/**
+   Destructor
+ */
+	{
+	}
+
+CT_MdrStep::CT_MdrStep()
+/**
+   Constructor
+ */
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_MdrStep);
+	}
+
+TVerdict CT_MdrStep::doTestStepPreambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	SetTestStepResult(EPass);
+	return TestStepResult();
+	}
+
+TVerdict CT_MdrStep::doTestStepPostambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	return TestStepResult();
+	}
+
+
+TVerdict CT_MdrStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Testing model doors..."));
+
+	// set up an fbs
+	FbsStartup();
+
+	// set up the directory structure
+	iFs.Connect();
+
+	// run the testcode
+	TRAPD(ret,DoTestsInScheldulerLoopL())
+	TEST(ret==KErrNone);
+	
+	iFs.Close();
+	//delete TheTrapCleanup;
+	return TestStepResult();
+	}
+
+/**
+  Auxiliary Fn for entire Test Step.
+ 
+  The method initiates all tests to be performed.
+ 
+*/
+void CT_MdrStep::DoStepTests()
+	{
+	__UHEAP_MARK;
+	TRAPD(r,testModelDoorL());
+	TEST(r==KErrNone);
+	__UHEAP_MARKEND;
+
+	__UHEAP_MARK;
+	TInt ret=RFbsSession::Connect();
+	TEST(ret==KErrNone);
+	TRAP(r,testConversionL());
+
+		TEST(r==KErrNone);
+/** The memory that is allocated in AllocScanLineBuffer() is shared 
+    between all bitmaps using the same session and is only released when 
+    RFbsSession::Disconnect();  is called.  */
+	RFbsSession::Disconnect();
+	REComSession::FinalClose();
+	__UHEAP_MARKEND;
+
+	__UHEAP_MARK;
+	ret=RFbsSession::Connect();
+	TEST(ret==KErrNone);
+	TRAP(r,testMiscellaneousL());
+	TEST(r==KErrNone);
+	RFbsSession::Disconnect();
+	REComSession::FinalClose();
+	__UHEAP_MARKEND;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_MdrStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,82 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code  
+*/
+
+#if (!defined __T_MDR_STEP_H__)
+#define __T_MDR_STEP_H__
+
+#include "ApparcTestServer.h"
+
+#include <apamdr.h>
+#include <apgdoor.h>
+
+class TTestModelHeaderFactory : public MApaModelHeaderFactory
+	{
+public:
+	CApaModelHeader* NewHeaderL(const CStreamStore& aStore,const CStreamDictionary& aDict,const TApaAppIdentifier& aAppId)const;
+	};
+
+class CTestModelHeader : public CApaModelHeader
+	{
+public:
+	void RestoreL(const CStreamStore& aStore,const CStreamDictionary& aDict);
+	void StoreL(CStreamStore& aStore,CStreamDictionary& aDict) const;
+	void DetachFromStoreL(CPicture::TDetach aDetach);
+	TApaAppIdentifier AppId()const;
+public:
+	TInt iData;
+	};
+	
+//!  A CT-MdrStep test class. 
+
+/**  Class tests CApaDoor and CApaModelDoor Apis. */
+
+class CT_MdrStep:public CTestStep
+	{
+public:
+	CT_MdrStep();
+	~CT_MdrStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+	void testModelDoorL();
+	void testConversionL();
+	void testMiscellaneousL();
+	void DoTestsInScheldulerLoopL();
+	void DoStepTests();
+
+private:
+	RFs iFs;
+	CApaProcess* iProcess;
+	};
+
+class CT_MdrTestCallBackWrapper : public CBase
+	{
+public:
+	CT_MdrTestCallBackWrapper(CT_MdrStep* aTestStep);
+	~CT_MdrTestCallBackWrapper();
+	static TInt CallBack(TAny* aPtr);
+private:
+	CT_MdrStep* iTestStep;
+	};
+
+_LIT(KT_MdrStep,"T_Mdr");
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_MruStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,63 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code  
+*/
+
+#if (!defined __T_MRU_STEP_H__)
+#define __T_MRU_STEP_H__
+
+#include "ApparcTestServer.h"
+
+//!  A CT_MruStep test class. 
+
+/**  Tests MRU list. */
+
+class CT_MruStep : public CTestStep
+	{
+public:
+	CT_MruStep();
+	~CT_MruStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+	void TestMRUL();
+//private:
+	void DoTestsInScheldulerLoopL();
+
+	void setup();
+private:
+	RFs iFs;
+	};
+
+
+
+class CT_MruTestCallBackWrapper : public CBase
+	{
+public:
+	CT_MruTestCallBackWrapper(CT_MruStep* aTestStep);
+	~CT_MruTestCallBackWrapper();
+	static TInt CallBack(TAny* aThis);
+private:
+	CT_MruStep* iTestStep;
+	};
+
+_LIT(KT_MruStep,"T_Mru");
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_NonNativeAppsStep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1305 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code  
+*/
+
+#include <E32STD.H>
+#include <E32BASE.H>
+#include <F32FILE.H>
+#include <APGCLI.H>
+#include <APMREC.H>
+#include <APAID.H>
+#include "testableapalssession.h"
+#include <APGICNFL.H>
+#include <APMSTD.H>
+#include <APACMDLN.H>
+#include <E32PROPERTY.H>
+#include <apgnotif.h>
+
+#include "..\tef\TNonNative\tnnapp1.h"
+#include "T_NonNativeAppsStep.h"
+#include <appfwk_test.h>
+
+
+const TUint KApplicationType=0x10207f90;
+const TUint KApplicationA=0x10207f91;
+TUint KApplicationB = 0x2002237C;
+const TUint KMySID=0x101F289C;				// apparctestserver UID
+const TUint KPropertyCategory=KMySID;
+const TUint KPropertyKey=0;
+const TUint KBytesToRead=100;
+
+_LIT8(KLit8_DataType_Gif, "x-epoc/nna-gif");
+_LIT8(KLit8_DataType_Html, "x-epoc/nna-html");
+_LIT8(KLit8_DataType_Vcard, "x-epoc/nna-vcf");
+_LIT8(KLit8_DataType_plainText, "x-epoc/nna-txt");
+
+_LIT(KLitLogicalExecutableA, "c:\\A.NNAPP2"); // this file never actually needs to exist
+_LIT(KLitApplicationCaptionA, "Caption NNA A");
+_LIT(KLitDocumentName1, "nnapp2:1");
+_LIT(KLitDocumentName2, "nnapp2:2");
+_LIT(KLitDocumentName3, "nnapp2:3");
+_LIT(KLitNativeExecutable, "z:\\sys\\bin\\TNNAPP2.EXE");
+_LIT8(KLitMimeTypeA, "x-epoc/a-nnapp2");
+_LIT8(KLitMimeTypeB, "x-epoc/dummy");
+
+enum TOption 
+	{
+	EAppA,
+	EAppB
+	};
+
+
+LOCAL_C void DeregisterNonNativeL(TAny* aApparcServer)
+	{
+	RApaLsSession& apparcServer=*STATIC_CAST(RApaLsSession*, aApparcServer);
+	apparcServer.PrepareNonNativeApplicationsUpdatesL();
+	apparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA));
+	apparcServer.CommitNonNativeApplicationsUpdatesL();
+	apparcServer.DeregisterNonNativeApplicationTypeL(TUid::Uid(KApplicationType));
+	}
+
+
+// RTstFileArray
+
+RTstFileArray::RTstFileArray(TInt aGranularity)
+	:iFileArray(aGranularity)
+	{
+	}
+
+void RTstFileArray::Close()
+	{
+	for (TInt i=iFileArray.Count()-1; i>=0; --i)
+		{
+		const SFile& file=iFileArray[i];
+		delete file.iFullFileName;
+		delete file.iExpectedDataType;
+		}
+	iFileArray.Close();
+	}
+
+void RTstFileArray::AppendL(const TDesC& aFullFileName, const TDesC8& aExpectedDataType)
+	{
+	SFile file;
+	file.iFullFileName=aFullFileName.AllocLC();
+	file.iExpectedDataType=aExpectedDataType.AllocLC();
+	iFileArray.AppendL(file);
+	CleanupStack::Pop(2, file.iFullFileName);
+	}
+
+void RTstFileArray::Get(TPtrC& aFullFileName, TPtrC8& aExpectedDataType, TInt aIndex) const
+	{
+	const SFile& file=iFileArray[aIndex];
+	aFullFileName.Set(*file.iFullFileName);
+	aExpectedDataType.Set(*file.iExpectedDataType);
+	}
+
+
+// RTstAppService
+
+TInt RTstAppService::DoTestL(TUid aServiceUid, TBool aPassingFileByHandle, const TDesC& aFileNameWithoutDriveOrPath)
+	{ // static
+	RTstAppService appService(aServiceUid);
+	CleanupClosePushL(appService);
+	appService.ConnectL();
+	TRequestStatus requestStatus;
+	appService.ReceiveTestResult(requestStatus, aPassingFileByHandle, aFileNameWithoutDriveOrPath);
+	User::WaitForRequest(requestStatus);
+	const TInt result=User::LeaveIfError(requestStatus.Int());
+	CleanupStack::PopAndDestroy(&appService);
+	User::After(5 * 1000000); //Wait 5sec for Apparc update due to paging
+	return result;
+	}
+
+RTstAppService::RTstAppService(TUid aServiceUid)
+	:iServiceUid(aServiceUid)
+	{
+	}
+
+void RTstAppService::ConnectL()
+	{
+	ConnectExistingByNameL(KLitServerName);
+	}
+
+void RTstAppService::ReceiveTestResult(TRequestStatus& aRequestStatus, TBool aPassingFileByHandle, const TDesC& aFileNameWithoutDriveOrPath)
+	{
+	SendReceive(EOpcode_receiveTestResult, TIpcArgs(aPassingFileByHandle, &aFileNameWithoutDriveOrPath), aRequestStatus);
+	}
+
+TUid RTstAppService::ServiceUid() const
+	{
+	return iServiceUid;
+	}
+
+
+// top-level functions
+
+HBufC8* CT_NonNativeAppsStep::OpenFileAndReadBufferLC(RApaLsSession& aApparcServer, RFs& aFileServer, const TDesC& aFullFileName)
+	{
+	TInt preferredBufSize=0;
+	User::LeaveIfError(aApparcServer.GetPreferredBufSize(preferredBufSize));
+	HBufC8* const buffer=HBufC8::NewLC(preferredBufSize);
+	RFile file;
+	CleanupClosePushL(file);
+	User::LeaveIfError(file.Open(aFileServer, aFullFileName, EFileShareReadersOnly|EFileStream|EFileRead));
+	{TPtr8 buffer_asWritable(buffer->Des());
+	User::LeaveIfError(file.Read(buffer_asWritable));}
+	CleanupStack::PopAndDestroy(&file);
+	return buffer;
+	}
+
+void CT_NonNativeAppsStep::OpenFileAndSetFilePositionToSomewhereUnusualLC(RFile& aFile, TInt& aFilePosition, RFs& aFileServer, const TDesC& aFullFileName)
+	{
+	CleanupClosePushL(aFile);
+	User::LeaveIfError(aFile.Open(aFileServer, aFullFileName, EFileShareReadersOnly|EFileStream|EFileRead));
+	aFilePosition=0;
+	User::LeaveIfError(aFile.Seek(ESeekEnd, aFilePosition));
+	aFilePosition=(aFilePosition*83)/100; // set it to somewhere "random" in the middle of the file (83% of the way through)
+	User::LeaveIfError(aFile.Seek(ESeekStart, aFilePosition));
+	}
+
+void CT_NonNativeAppsStep::TestFilePosition(RFile& aFile, TInt aFilePosition)
+	{
+	TInt filePosition=0;
+	TEST(aFile.Seek(ESeekCurrent, filePosition) == KErrNone);
+	TEST(filePosition==aFilePosition);
+	}
+
+/**
+   @SYMTestCaseID T_NonNativeAppsStep-TestAppForDocument
+  
+   @SYMDEF	DEF065742
+  
+   @SYMTestCaseDesc Tests AppForDocument API for non native applications.
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions	Call AppForDocument, first with the file name, and then with the file data, with a series of different known files.
+   		API Calls:\n	
+   		RApaLsSession::AppForDocument(const TDesC &aFileName, TUid &aAppUid, TDataType &aDataType) const;\n
+   		RApaLsSession::AppForDocument(RFile &aFile, TUid &aAppUid, TDataType &aDataType) const;\n
+   
+   @SYMTestExpectedResults Test checks MIME type and UIDs obtained match the expected ones.
+ */
+void CT_NonNativeAppsStep::TestAppForDocumentL(RApaLsSession& aApparcServer, RFs& aFileServer, const RTstFileArray& aFileArray)
+	{
+	INFO_PRINTF1(_L("Testing AppForDocumentL()..."));
+	for (TInt i=aFileArray.Count()-1; i>=0; --i)
+		{
+		TPtrC fullFileName;
+		TPtrC8 expectedDataType;
+		aFileArray.Get(fullFileName, expectedDataType, i);
+ 
+		TPtrC fileNameWithoutDriveOrPath(TParsePtrC(fullFileName).NameAndExt());
+		INFO_PRINTF2(_L("..using following file: '%S'"), &fileNameWithoutDriveOrPath);
+
+		{
+		TDataType dataType;
+		TUid appUid;
+		//due to access of file in private folder
+		APPFWK_EXPECTED_PLATSEC_START;
+		User::LeaveIfError(aApparcServer.AppForDocument(fullFileName, appUid, dataType));
+		RDebug::Print(_L("The Full FileName is '%S' "),&fullFileName);
+		APPFWK_EXPECTED_PLATSEC_FINISH;
+		TEST(dataType.Des8().CompareF(expectedDataType)==0);
+		TEST(appUid.iUid==0x10207f92);
+		}
+
+		RFile file;
+		TInt originalFilePosition=0;
+		OpenFileAndSetFilePositionToSomewhereUnusualLC(file, originalFilePosition, aFileServer, fullFileName);
+
+		{
+		TDataType dataType;
+		TUid appUid;
+		User::LeaveIfError(aApparcServer.AppForDocument(file, appUid, dataType));
+		TEST(dataType.Des8().CompareF(expectedDataType)==0);
+		TEST(appUid.iUid==0x10207f92);
+
+		TestFilePosition(file, originalFilePosition);
+		CleanupStack::PopAndDestroy(&file);
+		}
+		}
+	}
+
+void CT_NonNativeAppsStep::TestResultsOfAppForDocumentAndServiceL(TUid aServiceUid, TInt aError,
+						const TUid& aAppUid, // aAppUid needs to be passed by reference (rather than by value) because of the way that this function is called, namely the aAppUid parameter seems to be put into the stack before the expression passed to the aError parameter has executed, the latter having the side-effect of changing the app-UID
+						const TDataType& aDataType, const TDesC8& aExpectedDataType)
+	{
+	if (aServiceUid.iUid==0x10207f99)
+		{
+		User::LeaveIfError(aError);
+		TEST(aDataType.Des8().CompareF(aExpectedDataType)==0);
+		(aDataType.Des8().CompareF(KLit8_DataType_Gif)==0) ? TEST(aAppUid.iUid==0x10207f94) : TEST(aAppUid.iUid==0);
+		}
+	else
+		{
+		User::LeaveIfError(aError);
+		TEST(aDataType.Des8().CompareF(aExpectedDataType)==0);
+		TEST(aAppUid.iUid==0x10207f92);
+		}
+	}
+
+/**
+   @SYMTestCaseID T_NonNativeAppsStep-TestAppForDocumentAndServiceL
+  
+   @SYMDEF	DEF065742
+  
+   @SYMTestCaseDesc Tests AppForDocumentAndService API for non native applications.
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions	Call AppForDocumentAndService, first with the file name, and then with the file data, with a series of different known files and serviceUIDs.
+   		Note the following:
+   			- TNNAPP1 defines in the datatype_list the 4 datatypes, while in the service_list, only 1 datatype is defined.
+   			- TNNAPP2 defines no datatype_list, while it just contains 1 datatype in the service_list.
+   			- The datatype of the file to be opened is searched in the service_list corresponding to the serviceUID. If not found,
+   				the datatype_list of the same reg file is searched. If not found there, it returns a KNullUid as the app.
+   			- It means that the service_list has 'priority' over the datatype_list in the same reg file.
+   		API Calls:\n	
+   		RApaLsSession::AppForDocumentAndService(const TDesC &aFileName, TUid aServiceUid, TUid &aAppUid, TDataType &aDataType) const;\n
+   		RApaLsSession::AppForDocumentAndService(RFile &aFile, TUid aServiceUid, TUid &aAppUid, TDataType &aDataType) const;\n
+   
+   @SYMTestExpectedResults Test checks MIME type and UIDs obtained match the expected ones.
+ */
+void CT_NonNativeAppsStep::TestAppForDocumentAndServiceL(RApaLsSession& aApparcServer, RFs& aFileServer, const RTstFileArray& aFileArray)
+	{
+	INFO_PRINTF1(_L("Testing AppForDocumentAndServiceL()..."));
+	for (TInt i=aFileArray.Count()-1; i>=0; --i)
+		{
+		TPtrC fullFileName;
+		TPtrC8 expectedDataType;
+		aFileArray.Get(fullFileName, expectedDataType, i);
+
+		TPtrC fileNameWithoutDriveOrPath(TParsePtrC(fullFileName).NameAndExt());
+		INFO_PRINTF2(_L("..using following file: '%S'"), &fileNameWithoutDriveOrPath);
+
+		{
+		TDataType dataType;
+		TUid appUid;
+		TUid serviceUid(TUid::Uid(0x10207f99));
+		//due to access of file in private folder
+		APPFWK_EXPECTED_PLATSEC_START;
+		TestResultsOfAppForDocumentAndServiceL(serviceUid, aApparcServer.AppForDocumentAndService(fullFileName, serviceUid, appUid, dataType), appUid, dataType, expectedDataType);
+		APPFWK_EXPECTED_PLATSEC_FINISH;
+		serviceUid.iUid=0x10207f93;
+		//due to access of file in private folder
+		APPFWK_EXPECTED_PLATSEC_START;
+		TestResultsOfAppForDocumentAndServiceL(serviceUid, aApparcServer.AppForDocumentAndService(fullFileName, serviceUid, appUid, dataType), appUid, dataType, expectedDataType);
+		APPFWK_EXPECTED_PLATSEC_FINISH;
+		}
+
+		{
+		RFile file;
+		TInt originalFilePosition=0;
+		OpenFileAndSetFilePositionToSomewhereUnusualLC(file, originalFilePosition, aFileServer, fullFileName);
+
+		TDataType dataType;
+		TUid appUid;
+		TUid serviceUid(TUid::Uid(0x10207f99));
+		TestResultsOfAppForDocumentAndServiceL(serviceUid, aApparcServer.AppForDocumentAndService(file, serviceUid, appUid, dataType), appUid, dataType, expectedDataType);
+		serviceUid.iUid=0x10207f93;
+		TestResultsOfAppForDocumentAndServiceL(serviceUid, aApparcServer.AppForDocumentAndService(file, serviceUid, appUid, dataType), appUid, dataType, expectedDataType);
+
+		TestFilePosition(file, originalFilePosition);
+		CleanupStack::PopAndDestroy(&file);
+		}
+		}
+	}
+
+/**
+   @SYMTestCaseID T_NonNativeAppsStep-TestRecognizingL
+  
+   @SYMDEF	DEF065742
+  
+   @SYMTestCaseDesc Tests RecognizeData API for non native applications.
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions	Call RecognizeData, first with the file name, and then with the file data, with a series of different known files.
+   		API Calls:\n	
+   		RApaLsSession::RecognizeData(const TDesC &aName, const TDesC8 &aBuffer, TDataRecognitionResult &aDataType) const;\n
+   		RApaLsSession::RecognizeData(RFile &aFile, TDataRecognitionResult &aDataType) const;\n
+   
+   @SYMTestExpectedResults Test checks MIME type and conficence obtained match the expected ones.
+ */
+void CT_NonNativeAppsStep::TestRecognizingL(RApaLsSession& aApparcServer, RFs& aFileServer, const RTstFileArray& aFileArray)
+	{
+	INFO_PRINTF1(_L("Testing RecognizingL()..."));
+	for (TInt i=aFileArray.Count()-1; i>=0; --i)
+		{
+		TPtrC fullFileName;
+		TPtrC8 expectedDataType;
+		aFileArray.Get(fullFileName, expectedDataType, i);
+
+		TPtrC fileNameWithoutDriveOrPath(TParsePtrC(fullFileName).NameAndExt());
+		INFO_PRINTF2(_L("..using following file: '%S'"), &fileNameWithoutDriveOrPath);
+
+		{
+		RFile file;
+		TInt originalFilePosition=0;
+		OpenFileAndSetFilePositionToSomewhereUnusualLC(file, originalFilePosition, aFileServer, fullFileName);
+
+		TDataRecognitionResult dataRecognitionResult;
+		dataRecognitionResult.Reset();
+		User::LeaveIfError(aApparcServer.RecognizeData(file, dataRecognitionResult));
+		TEST(dataRecognitionResult.iConfidence>=CApaDataRecognizerType::EProbable);
+		TEST(dataRecognitionResult.iDataType.Des8().CompareF(expectedDataType)==0);
+
+		TestFilePosition(file, originalFilePosition);
+		CleanupStack::PopAndDestroy(&file);
+		}
+
+		{
+		RFile file;
+		TInt originalFilePosition=0;
+		OpenFileAndSetFilePositionToSomewhereUnusualLC(file, originalFilePosition, aFileServer, fullFileName);
+
+		TBool result=EFalse;
+		User::LeaveIfError(aApparcServer.RecognizeSpecificData(file, TDataType(expectedDataType), result));
+		TEST(result);
+
+		TestFilePosition(file, originalFilePosition);
+		CleanupStack::PopAndDestroy(&file);
+		}
+
+		{
+		HBufC8* const buffer=OpenFileAndReadBufferLC(aApparcServer, aFileServer, fullFileName);
+
+		TDataRecognitionResult dataRecognitionResult;
+		dataRecognitionResult.Reset();
+		APPFWK_EXPECTED_PLATSEC_START;
+		User::LeaveIfError(aApparcServer.RecognizeData(fullFileName, *buffer, dataRecognitionResult));
+		APPFWK_EXPECTED_PLATSEC_FINISH;
+		TEST(dataRecognitionResult.iConfidence>=CApaDataRecognizerType::EProbable);
+		TEST(dataRecognitionResult.iDataType.Des8().CompareF(expectedDataType)==0);
+
+		CleanupStack::PopAndDestroy(buffer);
+		}
+
+		{
+		HBufC8* const buffer=OpenFileAndReadBufferLC(aApparcServer, aFileServer, fullFileName);
+
+		TBool result=EFalse;
+		User::LeaveIfError(aApparcServer.RecognizeSpecificData(fullFileName, *buffer, TDataType(expectedDataType), result));
+		TEST(result);
+
+		CleanupStack::PopAndDestroy(buffer);
+		}
+		}
+	}
+
+/**
+   @SYMTestCaseID T_NonNativeAppsStep-TestStartDocumentL
+  
+   @SYMDEF	DEF065742
+  
+   @SYMTestCaseDesc Tests StartDocument API for non native applications.
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions	Call StartDocument, either with the file name as a parameter or a file handle. The test presupposes that when
+   		the file is passed by name, it can't be oppened as it's in a private folder (since the app doesn't have AllFiles capability).
+   		These provokes few negative platsec errors in the epocwind.out file.
+   		On the other hand, when the file is passed by handle, there are no problems opening the file. No platsec errors should be reported.
+   		API Calls:\n	
+   		RApaLsSession::StartDocument(const TDesC &aFileName, TThreadId &aThreadId, TLaunchType aLaunchType=ELaunchNewApp);\n
+   		RApaLsSession::StartDocument(RFile &aFile, TThreadId &aThreadId, TRequestStatus *aRequestStatusForRendezvous=0);\n
+   		RApaLsSession::StartDocument(const TDesC &aFileName, const TDataType &aDataType, TThreadId &aThreadId, TLaunchType aLaunchType=ELaunchNewApp);\n
+   		RApaLsSession::StartDocument(RFile &aFile, const TDataType &aDataType, TThreadId &aThreadId, TRequestStatus *aRequestStatusForRendezvous=0);\n
+   
+   @SYMTestExpectedResults Test the requeststatus obtained match the expected one.
+ */
+void CT_NonNativeAppsStep::TestStartDocumentL(RApaLsSession& aApparcServer, RFs& aFileServer, const RTstFileArray& aFileArray)
+	{
+	INFO_PRINTF1(_L("Testing StartDocumentL()..."));
+	for (TInt i=aFileArray.Count()-1; i>=0; --i)
+		{
+		TPtrC fullFileName;
+		TPtrC8 expectedDataType;
+		aFileArray.Get(fullFileName, expectedDataType, i);
+
+		TPtrC fileNameWithoutDriveOrPath(TParsePtrC(fullFileName).NameAndExt());
+		INFO_PRINTF2(_L("..using following file: '%S'"), &fileNameWithoutDriveOrPath);
+
+		for (TInt j=0; j<2; ++j)
+			{
+			const TUid serviceUid=(j==0)? KTstServiceUid_nonSecure: KTstServiceUid_secure;
+			{
+			RFile file;
+			TInt originalFilePosition=0;
+			OpenFileAndSetFilePositionToSomewhereUnusualLC(file, originalFilePosition, aFileServer, fullFileName);
+
+			TThreadId threadId;
+			TRequestStatus requestStatusForRendezvous;
+			User::LeaveIfError(aApparcServer.StartDocument(file, threadId, &requestStatusForRendezvous));
+			User::WaitForRequest(requestStatusForRendezvous);
+			TEST(RTstAppService::DoTestL(serviceUid, ETrue, fileNameWithoutDriveOrPath) == KCheckPass);
+
+			TestFilePosition(file, originalFilePosition);
+			CleanupStack::PopAndDestroy(&file);
+			}
+
+			{
+			RFile file;
+			TInt originalFilePosition=0;
+			OpenFileAndSetFilePositionToSomewhereUnusualLC(file, originalFilePosition, aFileServer, fullFileName);
+
+			TThreadId threadId;
+			TRequestStatus requestStatusForRendezvous;
+			User::LeaveIfError(aApparcServer.StartDocument(file, TDataType(expectedDataType), threadId, &requestStatusForRendezvous));
+			User::WaitForRequest(requestStatusForRendezvous);
+			TEST(RTstAppService::DoTestL(serviceUid, ETrue, fileNameWithoutDriveOrPath) == KCheckPass);
+
+			TestFilePosition(file, originalFilePosition);
+			CleanupStack::PopAndDestroy(&file);
+			}
+
+			{
+			RFile file;
+			TInt originalFilePosition=0;
+			OpenFileAndSetFilePositionToSomewhereUnusualLC(file, originalFilePosition, aFileServer, fullFileName);
+
+			TThreadId threadId;
+			TRequestStatus requestStatusForRendezvous;
+			User::LeaveIfError(aApparcServer.StartDocument(file, TUid::Uid(0x10207f92), threadId, &requestStatusForRendezvous));
+			User::WaitForRequest(requestStatusForRendezvous);
+			TEST(RTstAppService::DoTestL(serviceUid, ETrue, fileNameWithoutDriveOrPath) == KCheckPass);
+
+			TestFilePosition(file, originalFilePosition);
+			CleanupStack::PopAndDestroy(&file);
+			}
+
+			{
+			TThreadId threadId;
+			//due to access of file in private folder
+			APPFWK_EXPECTED_PLATSEC_START;
+			User::LeaveIfError(aApparcServer.StartDocument(fullFileName, threadId));
+			APPFWK_EXPECTED_PLATSEC_FINISH;
+			User::After(1500000);
+			TEST(RTstAppService::DoTestL(serviceUid, EFalse, fileNameWithoutDriveOrPath) == KCheckPass);
+			}
+
+			{
+			TThreadId threadId;
+			User::LeaveIfError(aApparcServer.StartDocument(fullFileName, TDataType(expectedDataType), threadId));
+			User::After(1500000);
+			TEST(RTstAppService::DoTestL(serviceUid, EFalse, fileNameWithoutDriveOrPath) == KCheckPass);
+			}
+
+			{
+			TThreadId threadId;
+			User::LeaveIfError(aApparcServer.StartDocument(fullFileName, TUid::Uid(0x10207f92), threadId));
+			User::After(1500000);
+			TEST(RTstAppService::DoTestL(serviceUid, EFalse, fileNameWithoutDriveOrPath) == KCheckPass);
+			}
+			}
+		}
+	//avoid race conditions
+	User::After(1500000);
+	}
+	
+void CT_NonNativeAppsStep::CheckPropertyUpdateAndResetL(const TDesC& aExpectedNewValue)
+	{
+	__ASSERT_ALWAYS(aExpectedNewValue.Length()>0, User::Invariant());
+	RProperty property;
+	CleanupClosePushL(property);
+	User::LeaveIfError(property.Attach(TUid::Uid(KPropertyCategory), KPropertyKey));
+	TRequestStatus requestStatus;
+	property.Subscribe(requestStatus);
+	TBuf<50> propertyValue;
+	User::LeaveIfError(property.Get(propertyValue));
+	if (propertyValue.Length()>0)
+		{
+		property.Cancel();
+		}
+	User::WaitForRequest(requestStatus);
+	if (propertyValue.Length()==0)
+		{
+		User::LeaveIfError(property.Get(propertyValue));
+		}
+	TEST(propertyValue.CompareF(aExpectedNewValue)==0);
+	User::LeaveIfError(property.Set(KNullDesC)); // reset it to an empty descriptor
+	CleanupStack::PopAndDestroy(&property);
+	}
+
+void CT_NonNativeAppsStep::CheckApplicationLaunchesOkayL(RApaLsSession& aApparcServer, const CApaCommandLine& aCommandLine, TAny* aOption)
+	{
+	TThreadId notUsed;
+	const TInt option = TInt(aOption);
+	switch(option)
+		{
+			case EAppA:
+				INFO_PRINTF1(_L("..Checking ApplicationLaunchesOkayL for app 'A'.."));
+				User::LeaveIfError(aApparcServer.StartDocument(KLitDocumentName1, TDataType(KLitMimeTypeA), notUsed));
+				CheckPropertyUpdateAndResetL(KLitDocumentName1);
+				User::LeaveIfError(aApparcServer.StartApp(aCommandLine));
+				CheckPropertyUpdateAndResetL(KLitDocumentName2);
+				break;
+			case EAppB:
+				INFO_PRINTF1(_L("..Checking ApplicationLaunchesOkayL for app 'B'.."));
+				TEST( aApparcServer.StartDocument(KLitDocumentName3, TDataType(KLitMimeTypeB), notUsed) == KErrNone);
+				break;
+			default:
+				break;
+		}
+	}
+
+void CT_NonNativeAppsStep::CheckApplicationFailsToLaunchL(RApaLsSession& aApparcServer, const CApaCommandLine& aCommandLine, TAny* aOption)
+	{
+	TThreadId notUsed;
+	const TInt option = TInt(aOption);
+	switch(option)
+		{
+			case EAppA:
+				INFO_PRINTF1(_L("..Checking ApplicationFailsToLaunchL for app 'A'.."));
+				TEST(aApparcServer.StartDocument(KLitDocumentName1, TDataType(KLitMimeTypeA), notUsed) != KErrNone);
+				TEST(aApparcServer.StartApp(aCommandLine)!=KErrNone);
+				break;
+			case EAppB:
+				INFO_PRINTF1(_L("..Checking ApplicationFailsToLaunchL for app 'B'.."));
+				TEST( aApparcServer.StartDocument(KLitDocumentName3, TDataType(KLitMimeTypeB), notUsed) != KErrNone);
+				break;
+			default:
+				break;
+		}
+	}
+	
+/**
+   @SYMTestCaseID T_NonNativeAppsStep-TestRegisterNonNativeApplicationL
+  
+   @SYMDEF	DEF065742
+  
+   @SYMTestCaseDesc Tests RegisterNonNativeApplicationL and DeregisterNonNativeApplicationL API for non native applications.
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call RegisterNonNativeApplicationL and try to launch the app. Then call 
+   DeregisterNonNativeApplicationL and try to launch the app again. This is repeated with 
+   localisable resource files, etc., etc.. 
+   		API Calls:\n	
+   		RApaLsSession::RegisterNonNativeApplicationL(TUid aApplicationType, const TDriveUnit& aDrive, CApaRegistrationResourceFileWriter& aRegistrationResourceFile, CApaLocalisableResourceFileWriter* aLocalisableResourceFile, RFile* aIconFile); \n
+   		RApaLsSession::DeregisterNonNativeApplicationL(TUid aApplication);\n
+   		RApaLsSession::GetAppIcon(TUid aAppUid, RFile& aFile) const; \n
+   
+   @SYMTestExpectedResults Test checks if app is registered (and launches ok) and deregistered (and fails to launch).
+ */
+void CT_NonNativeAppsStep::TestRegisterNonNativeApplicationL(RApaLsSession& aApparcServer, RFs& aFileServer )
+	{
+	INFO_PRINTF1(_L("Testing RegisterNonNativeApplicationL()..."));
+
+	RProcess().SetPriority(EPriorityLow); // so that we're pre-empted by the Apparc server when it does its scan
+
+	CApaCommandLine* commandLine=NULL;
+	User::LeaveIfError(CApaCommandLine::GetCommandLineFromProcessEnvironment(commandLine));
+	CleanupStack::PushL(commandLine);
+	const TPtrC executableName(commandLine->ExecutableName());
+
+	_LIT_SECURITY_POLICY_S0(readSecurityPolicy, KMySID);
+	_LIT_SECURITY_POLICY_PASS(writeSecurityPolicy);
+	const TInt error=RProperty::Define(KPropertyKey, RProperty::EText, readSecurityPolicy, writeSecurityPolicy);
+	if (error!=KErrAlreadyExists)
+		{
+		User::LeaveIfError(error);
+		}
+	User::LeaveIfError(RProperty::Set(TUid::Uid(KPropertyCategory), KPropertyKey, KNullDesC));
+
+	// make sure we're starting from a clean sheet
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA));
+	aApparcServer.CommitNonNativeApplicationsUpdatesL();
+	aApparcServer.DeregisterNonNativeApplicationTypeL(TUid::Uid(KApplicationType));
+	CleanupStack::PushL(TCleanupItem(DeregisterNonNativeL, &aApparcServer));
+
+	aApparcServer.RegisterNonNativeApplicationTypeL(TUid::Uid(KApplicationType), KLitNativeExecutable);
+
+	CApaRegistrationResourceFileWriter* const registrationResourceFileWriter=CApaRegistrationResourceFileWriter::NewL(TUid::Uid(KApplicationA), KLitLogicalExecutableA, TApaAppCapability::ENonNative);
+	CleanupStack::PushL(registrationResourceFileWriter);
+	registrationResourceFileWriter->AddDataTypeL(KDataTypePriorityNormal, KLitMimeTypeA);
+
+	CApaCommandLine* const nextCommandLine=CApaCommandLine::NewLC();
+	nextCommandLine->SetDocumentNameL(KLitDocumentName2);
+	nextCommandLine->SetExecutableNameL(KLitLogicalExecutableA);
+	
+	INFO_PRINTF1(_L("..registering app using RegisterNonNativeApplicationL() "));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, *registrationResourceFileWriter, NULL, NULL);
+	aApparcServer.CommitNonNativeApplicationsUpdatesL();
+	CheckApplicationLaunchesOkayL(aApparcServer, *nextCommandLine, (TAny*)EAppA);
+	//Check if there is no problem in registering same app again(basically simulating an upgrade)
+	INFO_PRINTF1(_L("..registering same app again using RegisterNonNativeApplicationL() "));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, *registrationResourceFileWriter, NULL, NULL);
+	aApparcServer.CommitNonNativeApplicationsUpdatesL();
+	CheckApplicationLaunchesOkayL(aApparcServer, *nextCommandLine, (TAny*)EAppA);
+	
+	INFO_PRINTF1(_L("..deregistering app using DeregisterNonNativeApplicationL() "));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA));
+	aApparcServer.CommitNonNativeApplicationsUpdatesL();
+	CheckApplicationFailsToLaunchL(aApparcServer, *nextCommandLine, (TAny*)EAppA);
+	
+	_LIT8(KLitOpData, "opaquedata");
+	registrationResourceFileWriter->SetOpaqueDataL(KLitOpData);
+
+	CApaLocalisableResourceFileWriter* const localisableResourceFileWriter_noIcons=CApaLocalisableResourceFileWriter::NewL(KNullDesC, KLitApplicationCaptionA, 0, KNullDesC);
+	CleanupStack::PushL(localisableResourceFileWriter_noIcons);
+	INFO_PRINTF1(_L("..registering app using RegisterNonNativeApplicationL() with localisableResourceFileWriter_noIcons"));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, *registrationResourceFileWriter, localisableResourceFileWriter_noIcons, NULL);
+	aApparcServer.CommitNonNativeApplicationsUpdatesL();
+	CleanupStack::PopAndDestroy(localisableResourceFileWriter_noIcons);
+	CheckApplicationLaunchesOkayL(aApparcServer, *nextCommandLine, (TAny*)EAppA);
+
+	//Testing with OpaqueData
+	TPtrC8 opData =nextCommandLine->OpaqueData();
+	TInt tst=opData.CompareF(KLitOpData);
+	TEST(opData.CompareF(KLitOpData)==0);
+		
+	INFO_PRINTF1(_L("..deregistering app using DeregisterNonNativeApplicationL() with localisableResourceFileWriter_noIcons"));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA));
+	aApparcServer.CommitNonNativeApplicationsUpdatesL();
+	CheckApplicationFailsToLaunchL(aApparcServer, *nextCommandLine, (TAny*)EAppA);
+
+	//Testing with IconFile
+	CApaLocalisableResourceFileWriter* const localisableResourceFileWriter_withIcons=CApaLocalisableResourceFileWriter::NewL(KNullDesC, KLitApplicationCaptionA, 2, KNullDesC);
+	CleanupStack::PushL(localisableResourceFileWriter_withIcons);
+	INFO_PRINTF1(_L("..registering app using RegisterNonNativeApplicationL() with localisableResourceFileWriter_withIcons"));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+
+	RFile iconFile;
+	CleanupClosePushL(iconFile);
+	_LIT(KIconFullFileName, "z:\\resource\\apps\\tstapp.mbm");
+	User::LeaveIfError(iconFile.Open(aFileServer, KIconFullFileName, EFileRead));
+	aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, *registrationResourceFileWriter, localisableResourceFileWriter_withIcons, &iconFile);
+	iconFile.Close();
+	CleanupStack::PopAndDestroy(&iconFile);
+	
+	aApparcServer.CommitNonNativeApplicationsUpdatesL();
+	CheckApplicationLaunchesOkayL(aApparcServer, *nextCommandLine, (TAny*)EAppA);
+
+	HBufC* iconFileName = NULL;
+	TInt err = aApparcServer.GetAppIcon(TUid::Uid(KApplicationA),iconFileName);
+	TEST(err == KErrNone);
+	_LIT(KIconFileName, "tstapp.mbm");
+	TEST(iconFileName != NULL);
+	if(iconFileName != NULL)
+		{
+		TEST(iconFileName->Des().Find(KIconFileName) >= 0);
+		delete iconFileName;
+		}
+	
+	//Test other overload of GetAppIcon for MBM icon file.
+	RFile mbmIconFile;
+	CleanupClosePushL(mbmIconFile);
+	INFO_PRINTF1(_L("..testing GetAppIcon for non-native app to retrieve an open file handle to an MBM icon file"));
+	err = aApparcServer.GetAppIcon(TUid::Uid(KApplicationA), mbmIconFile);
+	TEST(err == KErrNone);
+	
+	TBuf<KMaxFileName> mbmIconFileName;
+	mbmIconFile.FullName(mbmIconFileName);
+	TEST(mbmIconFileName.Length() != 0);	
+	
+	//Try to write into the MBM icon file whose handle was returned.
+	INFO_PRINTF1(_L("..writing into the MBM icon file whose handle was returned."));
+	_LIT8(KSomeText, "It would not be written into the file");
+	err = mbmIconFile.Write(KSomeText);
+	TEST(err == KErrAccessDenied);
+	
+	//Try to read from the MBM icon file whose handle was returned.
+	INFO_PRINTF1(_L("..reading from the MBM icon file whose handle was returned."));
+	TBuf8<KBytesToRead> buffer; //buffer to read first KBytesToRead bytes of the mbm icon file. 
+	err = mbmIconFile.Read(buffer);
+	TEST(err == KErrNone);
+	
+	//First KBytesToRead bytes of the icon file, this should be same as in mbm file.
+	RFile tempFile;
+	CleanupClosePushL(tempFile);
+	err = tempFile.Open(aFileServer, KIconFullFileName, EFileRead);
+	TEST(err == KErrNone);
+	TBuf8<KBytesToRead> buffer1;
+	err = tempFile.Read(buffer1);
+	TEST(err == KErrNone);	
+	TEST(buffer == buffer1);
+	
+	//Close icon files.
+	CleanupStack::PopAndDestroy(2, &mbmIconFile);
+	
+	INFO_PRINTF1(_L("..deregistering app using DeregisterNonNativeApplicationL() with localisableResourceFileWriter_withIcons"));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA));
+	aApparcServer.CommitNonNativeApplicationsUpdatesL();
+	CheckApplicationFailsToLaunchL(aApparcServer, *nextCommandLine, (TAny*)EAppA);
+	
+	//Testing GetAppIcon API for non-native application with SVG icon.
+	TestGetAppIconForNonNativeL(aApparcServer,aFileServer, registrationResourceFileWriter, localisableResourceFileWriter_withIcons);
+	
+ 	// clean-up
+	CleanupStack::PopAndDestroy(5, commandLine);
+	}
+
+/**
+   @SYMTestCaseID APPFWK-APPARC-0072
+  
+   @SYMDEF INC098717: support for scalable midlet icons is missing 
+  
+   @SYMTestCaseDesc Tests GetAppIcon API for non native applications with SVG icon file.
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Register a non-native app with a SVG icon file, Call GetAppIcon API, 
+   deregister the app. Again register the same app without the icon file, call GetAppIcon 
+   API, deregister the app. Call GetAppIcon with an invalid app uid.
+   
+   @SYMTestExpectedResults RApaLsSession::GetAppIcon should return KErrNotFound when 
+   an invalid app uid is passed, KErrNotFound when application does not have an icon 
+   file, KErrNone and an open file handle to the application's icon file if app has icon file.
+ */
+void CT_NonNativeAppsStep::TestGetAppIconForNonNativeL(RApaLsSession& aApparcServer,
+                                                       RFs& aFileServer, 
+                                                       CApaRegistrationResourceFileWriter* const aRegistrationResourceFileWriter, 
+                                                       CApaLocalisableResourceFileWriter* const aLocalisableResourceFileWriter)
+	{
+	//Testing GetAppIcon for non-native app having SVG icon file
+	INFO_PRINTF1(_L("..registering app using RegisterNonNativeApplicationL() with localisableResourceFileWriter_withIcons"));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+
+	RFile iconFile;
+	CleanupClosePushL(iconFile);
+	_LIT(KSVGIconSourceFile, "z:\\resource\\apps\\svg_icon.svg");
+	User::LeaveIfError(iconFile.Open(aFileServer, KSVGIconSourceFile, EFileRead));
+	aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, *aRegistrationResourceFileWriter, aLocalisableResourceFileWriter, &iconFile);
+	CleanupStack::PopAndDestroy(&iconFile);
+	
+	aApparcServer.CommitNonNativeApplicationsUpdatesL();
+	
+	RFile svgIconFile;
+	CleanupClosePushL(svgIconFile);
+	INFO_PRINTF1(_L("..testing GetAppIcon for non-native app to retrieve an open file handle to an SVG icon file"));
+	TInt err = aApparcServer.GetAppIcon(TUid::Uid(KApplicationA),svgIconFile);
+	TEST(err == KErrNone);
+	
+	_LIT(KSVGIconFileName, "c:\\private\\10003a3f\\import\\apps\\nonnative\\resource\\svg_icon.svg");
+	TBuf<KMaxFileName> iconFileName;
+	//Get the name of the icon file 
+	svgIconFile.FullName(iconFileName);
+	TEST(iconFileName.Length() != 0);
+	if (iconFileName.Length() != 0)
+		{
+		INFO_PRINTF1(_L("..testing if the SVG icon file for non-native app gets installed in apparc's data cage"));
+		iconFileName.LowerCase();
+		TEST(iconFileName.Compare(KSVGIconFileName) == 0);
+		}	
+		
+	//Try to write into the icon file whose handle was returned.
+	INFO_PRINTF1(_L("..writing into the SVG icon file whose handle was returned."));
+	_LIT8(KSomeText, "It would not be written into the file");
+	err = svgIconFile.Write(KSomeText);
+	TEST(err == KErrAccessDenied);
+	
+	//Try to read from the icon file whose handle was returned.
+	INFO_PRINTF1(_L("..reading from the SVG icon file whose handle was returned."));
+	TBuf8<KBytesToRead> buffer; //buffer to read first KBytesToRead bytes of the icon file. 
+	err = svgIconFile.Read(buffer);
+	TEST(err == KErrNone);
+	
+	//First KBytesToRead bytes of the icon file, this should be same as in svg file.
+	RFile tempFile;
+	CleanupClosePushL(tempFile);
+	err = tempFile.Open(aFileServer, KSVGIconSourceFile, EFileRead);
+	TEST(err == KErrNone);
+	TBuf8<KBytesToRead> buffer1;
+	err = tempFile.Read(buffer1);
+	TEST(err == KErrNone);
+	TEST(buffer == buffer1);
+	
+	//Close icon files
+	CleanupStack::PopAndDestroy(2, &svgIconFile);
+		
+	INFO_PRINTF1(_L("..deregistering app using DeregisterNonNativeApplicationL() with localisableResourceFileWriter_withIcons"));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA));
+	aApparcServer.CommitNonNativeApplicationsUpdatesL();
+	
+	//Testing GetAppIcon for non-native app without SVG Icon file.
+	INFO_PRINTF1(_L("..registering app using RegisterNonNativeApplicationL() with localisableResourceFileWriter_withIcons"));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, *aRegistrationResourceFileWriter, aLocalisableResourceFileWriter, NULL);		
+	aApparcServer.CommitNonNativeApplicationsUpdatesL();
+	
+	INFO_PRINTF1(_L("..testing GetAppIcon for non-native app that does not have an icon file"));
+	RFile iconFile1;
+	CleanupClosePushL(iconFile1);
+	err = aApparcServer.GetAppIcon(TUid::Uid(KApplicationA),iconFile1);
+	TEST(err == KErrNotFound);
+			
+	INFO_PRINTF1(_L("..deregistering app using DeregisterNonNativeApplicationL() with localisableResourceFileWriter_withIcons"));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA));
+	aApparcServer.CommitNonNativeApplicationsUpdatesL();
+	
+	//Testing GetAppIcon with an invalid app UID.
+	INFO_PRINTF1(_L("..testing GetAppIcon, if an invalid app UID is passed"));
+	err = aApparcServer.GetAppIcon(TUid::Uid(KApplicationA),iconFile1);
+	TEST(err == KErrNotFound);
+	
+	//Close icon file
+	CleanupStack::PopAndDestroy(&iconFile1);
+	}
+
+
+/**
+   @SYMTestCaseID APPFWK-APPARC-0099
+  
+   @SYMDEF	PDEF129466
+  
+   @SYMTestCaseDesc Tests ForceCommitNonNativeApplicationsUpdatesL() API.
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call RegisterNonNativeApplicationL and try to launch the app. Then call 
+   DeregisterNonNativeApplicationL and try to launch the app again. ForceCommitNonNativeApplicationsUpdatesL
+   API is used to commit the non-native application updates.
+   
+   @SYMTestExpectedResults Test checks ForceCommitNonNativeApplicationsUpdatesL behaviour and completed with success.
+ */
+void CT_NonNativeAppsStep::TestCommitNNAppUpdatesL(RApaLsSession& aApparcServer)
+	{
+	INFO_PRINTF1(_L("Testing ForceCommitNonNativeApplicationsUpdatesL API..."));
+
+	RProcess().SetPriority(EPriorityLow); // so that we're pre-empted by the Apparc server when it does its scan
+
+	CApaCommandLine* commandLine=NULL;
+	User::LeaveIfError(CApaCommandLine::GetCommandLineFromProcessEnvironment(commandLine));
+	CleanupStack::PushL(commandLine);
+	const TPtrC executableName(commandLine->ExecutableName());
+
+
+	_LIT_SECURITY_POLICY_S0(readSecurityPolicy, KMySID);
+	_LIT_SECURITY_POLICY_PASS(writeSecurityPolicy);
+	
+	//TNNAPP2.exe sets the document name passed as part of the command line to this property.
+	const TInt error=RProperty::Define(KPropertyKey, RProperty::EText, readSecurityPolicy, writeSecurityPolicy);
+	if (error!=KErrAlreadyExists)
+		{
+		User::LeaveIfError(error);
+		}
+	User::LeaveIfError(RProperty::Set(TUid::Uid(KPropertyCategory), KPropertyKey, KNullDesC));
+
+	// make sure we're starting from a clean sheet
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA));
+	aApparcServer.CommitNonNativeApplicationsUpdatesL();
+	aApparcServer.DeregisterNonNativeApplicationTypeL(TUid::Uid(KApplicationType));
+	CleanupStack::PushL(TCleanupItem(DeregisterNonNativeL, &aApparcServer));
+
+	aApparcServer.RegisterNonNativeApplicationTypeL(TUid::Uid(KApplicationType), KLitNativeExecutable);
+
+	CApaRegistrationResourceFileWriter* const registrationResourceFileWriter=CApaRegistrationResourceFileWriter::NewL(TUid::Uid(KApplicationA), KLitLogicalExecutableA, TApaAppCapability::ENonNative);
+	CleanupStack::PushL(registrationResourceFileWriter);
+	registrationResourceFileWriter->AddDataTypeL(KDataTypePriorityNormal, KLitMimeTypeA);
+
+	CApaCommandLine* const nextCommandLine=CApaCommandLine::NewLC();
+	nextCommandLine->SetDocumentNameL(KLitDocumentName2);
+	nextCommandLine->SetExecutableNameL(KLitLogicalExecutableA);
+	
+	
+	INFO_PRINTF1(_L("..registering app using RegisterNonNativeApplicationL() "));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, *registrationResourceFileWriter, NULL, NULL);
+	TTime startTime,endTime;
+	TTimeIntervalMicroSeconds timeTakenToCommitRegistration;
+	INFO_PRINTF1(_L("..start commiting the registration with CommitNonNativeApplicationsUpdatesL"));
+	startTime.HomeTime();
+	aApparcServer.CommitNonNativeApplicationsUpdatesL();
+	endTime.HomeTime();
+	INFO_PRINTF1(_L("..commiting the registration is done"));	
+	timeTakenToCommitRegistration=endTime.MicroSecondsFrom(startTime);
+
+	TInt64 value = timeTakenToCommitRegistration.Int64();
+	INFO_PRINTF2(_L("..Time taken for registration of application by CommitNonNativeApplicationsUpdatesL is %d micro seconds"), value);	
+	CheckApplicationLaunchesOkayL(aApparcServer, *nextCommandLine, (TAny*)EAppA);
+	
+	INFO_PRINTF1(_L("..deregistering app using DeregisterNonNativeApplicationL() "));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA));
+	TTimeIntervalMicroSeconds timeTakenToCommitDeregistration;
+	INFO_PRINTF1(_L("..start commiting the deregistration with CommitNonNativeApplicationsUpdatesL"));
+	startTime.HomeTime();	
+	aApparcServer.CommitNonNativeApplicationsUpdatesL();
+	endTime.HomeTime();	
+	INFO_PRINTF1(_L("..commiting the deregistration is done"));
+	timeTakenToCommitDeregistration=endTime.MicroSecondsFrom(startTime);
+	value = timeTakenToCommitDeregistration.Int64();
+	INFO_PRINTF2(_L("..Time taken for deregistration of application by CommitNonNativeApplicationsUpdatesL is %d micro seconds"), value);	
+	CheckApplicationFailsToLaunchL(aApparcServer, *nextCommandLine, (TAny*)EAppA);
+
+	
+	INFO_PRINTF1(_L("..registering app using RegisterNonNativeApplicationL() "));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, *registrationResourceFileWriter, NULL, NULL);
+	TTimeIntervalMicroSeconds timeTakenToForceCommitRegistration;
+	INFO_PRINTF1(_L("..start commiting the registration with ForceCommitNonNativeApplicationsUpdatesL"));
+	startTime.HomeTime();
+	aApparcServer.ForceCommitNonNativeApplicationsUpdatesL();
+	endTime.HomeTime();
+	INFO_PRINTF1(_L("..commiting the registration is done"));
+	timeTakenToForceCommitRegistration=endTime.MicroSecondsFrom(startTime);
+	value = timeTakenToForceCommitRegistration.Int64();
+	INFO_PRINTF2(_L("..Time taken for registration of application by ForceCommitNonNativeApplicationsUpdatesL is %d micro seconds"), value);
+	TRequestStatus appScanCompleted=KRequestPending; 
+	aApparcServer.SetNotify(EFalse,appScanCompleted);    
+	User::WaitForRequest(appScanCompleted); 
+	TEST(appScanCompleted.Int()==MApaAppListServObserver::EAppListChanged);
+	CheckApplicationLaunchesOkayL(aApparcServer, *nextCommandLine, (TAny*)EAppA);
+	
+	INFO_PRINTF1(_L("..deregistering app using DeregisterNonNativeApplicationL() "));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA));
+	TTimeIntervalMicroSeconds timeTakenToForceCommitDeregistration;
+	INFO_PRINTF1(_L("..start commiting the deregistration with ForceCommitNonNativeApplicationsUpdatesL"));
+	startTime.HomeTime();	
+	aApparcServer.ForceCommitNonNativeApplicationsUpdatesL();
+	endTime.HomeTime();	
+	INFO_PRINTF1(_L("..commiting the deregistration is done"));
+	timeTakenToForceCommitDeregistration=endTime.MicroSecondsFrom(startTime);
+	value = timeTakenToForceCommitDeregistration.Int64();
+	INFO_PRINTF2(_L("..Time taken for deregistration of application by ForceCommitNonNativeApplicationsUpdatesL is %d micro seconds"), value);
+	appScanCompleted=KRequestPending; 
+	aApparcServer.SetNotify(EFalse,appScanCompleted);    
+	User::WaitForRequest(appScanCompleted);
+	TEST(appScanCompleted.Int()==MApaAppListServObserver::EAppListChanged);
+	CheckApplicationFailsToLaunchL(aApparcServer, *nextCommandLine, (TAny*)EAppA);
+	TEST(timeTakenToForceCommitRegistration<timeTakenToCommitRegistration);	
+	TEST(timeTakenToForceCommitDeregistration<timeTakenToCommitDeregistration);
+	
+	CleanupStack::PopAndDestroy(4, commandLine);
+	}
+	
+/**
+   @SYMTestCaseID 			APPFWK-APPARC-0103
+  
+   @SYMDEF					PDEF134174
+  
+   @SYMTestCaseDesc 		Tests ForceCommitNonNativeApplicationsUpdatesL() API.
+  
+   @SYMTestPriority 		High
+  
+   @SYMTestStatus 			Implemented
+   
+   @SYMTestActions 			Make back to back installations of apps and notice that the app in not updated to the applist
+   							immediately. All apps are updated only after the last ForceCommitNonNativeApplicationsUpdatesL.
+   				   			Note that previous ForceCommitNonNativeApplicationsUpdatesL actions are updates in applist 
+   							when RollbackNonNativeApplicationsUpdates is called.
+   
+   @SYMTestExpectedResults 	Test checks ForceCommitNonNativeApplicationsUpdatesL and RollbackNonNativeApplicationsUpdates behaviour and completed with success.
+ */
+ void CT_NonNativeAppsStep::TestForceCommitNNAppUpdatesL(RApaLsSession& aApparcServer)
+ 	{
+ 	INFO_PRINTF1(_L("Testing ForceCommitNonNativeApplicationsUpdatesL API..."));
+
+	RProcess().SetPriority(EPriorityLow); // so that we're pre-empted by the Apparc server when it does its scan
+
+	CApaCommandLine* commandLine=NULL;
+	User::LeaveIfError(CApaCommandLine::GetCommandLineFromProcessEnvironment(commandLine));
+	CleanupStack::PushL(commandLine);
+	const TPtrC executableName(commandLine->ExecutableName());
+
+
+	_LIT_SECURITY_POLICY_S0(readSecurityPolicy, KMySID);
+	_LIT_SECURITY_POLICY_PASS(writeSecurityPolicy);
+	
+	//TNNAPP2.exe sets the document name passed as part of the command line to this property.
+	const TInt error=RProperty::Define(KPropertyKey, RProperty::EText, readSecurityPolicy, writeSecurityPolicy);
+	if (error!=KErrAlreadyExists)
+		{
+		User::LeaveIfError(error);
+		}
+	User::LeaveIfError(RProperty::Set(TUid::Uid(KPropertyCategory), KPropertyKey, KNullDesC));
+
+	// make sure we're starting from a clean sheet
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA));
+	aApparcServer.CommitNonNativeApplicationsUpdatesL();
+	aApparcServer.DeregisterNonNativeApplicationTypeL(TUid::Uid(KApplicationType));
+	CleanupStack::PushL(TCleanupItem(DeregisterNonNativeL, &aApparcServer));
+
+	INFO_PRINTF1(_L("..Registering type KApplicationType using RegisterNonNativeApplicationTypeL() "));
+	aApparcServer.RegisterNonNativeApplicationTypeL(TUid::Uid(KApplicationType), KLitNativeExecutable);
+
+	CApaRegistrationResourceFileWriter* const registrationResourceFileWriter=CApaRegistrationResourceFileWriter::NewL(TUid::Uid(KApplicationA), KLitLogicalExecutableA, TApaAppCapability::ENonNative);
+	CleanupStack::PushL(registrationResourceFileWriter);
+	INFO_PRINTF1(_L("..Add datatype to app 'A'"));
+	registrationResourceFileWriter->AddDataTypeL(KDataTypePriorityNormal, KLitMimeTypeA);
+
+	CApaCommandLine* const nextCommandLine=CApaCommandLine::NewLC();
+	nextCommandLine->SetDocumentNameL(KLitDocumentName2);
+	nextCommandLine->SetExecutableNameL(KLitLogicalExecutableA);
+	
+	TApaAppInfo info;
+	CApaRegistrationResourceFileWriter* const registrationResourceFileWriterB=CApaRegistrationResourceFileWriter::NewL(TUid::Uid(KApplicationB), KLitLogicalExecutableA, TApaAppCapability::ENonNative);
+	CleanupStack::PushL(registrationResourceFileWriterB);
+	registrationResourceFileWriterB->AddDataTypeL(KDataTypePriorityNormal, KLitMimeTypeB);
+	
+	TestForceCommitL(aApparcServer, *registrationResourceFileWriter, *registrationResourceFileWriterB, *nextCommandLine);
+	TestRollbackRegistrationL(aApparcServer, *registrationResourceFileWriter, *registrationResourceFileWriterB, *nextCommandLine);
+	TestRollbackDeregistrationL(aApparcServer, *registrationResourceFileWriter, *registrationResourceFileWriterB, *nextCommandLine);
+	
+	CleanupStack::PopAndDestroy(5, commandLine);
+ 	}
+ 	
+ void CT_NonNativeAppsStep::WaitForApplistUpdate(RApaLsSession& aApparcServer)
+ 	{
+ 	INFO_PRINTF1(_L("..waiting for applist to be updated "));
+ 	TRequestStatus appScanCompleted=KRequestPending; 
+	aApparcServer.SetNotify(EFalse,appScanCompleted);    
+	User::WaitForRequest(appScanCompleted);
+	TEST(appScanCompleted.Int()==MApaAppListServObserver::EAppListChanged);
+ 	}
+ 	
+ void CT_NonNativeAppsStep::TestForceCommitL(RApaLsSession& aApparcServer, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriter, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriterB, CApaCommandLine& aNextCommandLine)
+ 	{
+ 	INFO_PRINTF1(_L("..Start Testing TestForceCommitL API..."));
+ 	
+ 	//Register app A and ForceCommitNNAUpdate
+	INFO_PRINTF1(_L("..registering app 'A' using RegisterNonNativeApplicationL() "));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, aRegistrationResourceFileWriter, NULL, NULL);
+	aApparcServer.ForceCommitNonNativeApplicationsUpdatesL();
+	CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppA);//Since applist update has not yet completed
+	
+	//Register app B and ForceCommitNNAUpdate
+	INFO_PRINTF1(_L("..registering app 'B' using RegisterNonNativeApplicationL() "));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, aRegistrationResourceFileWriterB, NULL, NULL);
+	aApparcServer.ForceCommitNonNativeApplicationsUpdatesL();
+	TThreadId notUsed2;
+	CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppB);
+	
+	//Wait for applist to be updated
+	WaitForApplistUpdate(aApparcServer);
+	CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, (TAny*)EAppA);//Check if app A launches since applist update is complete now
+	CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, (TAny*)EAppB);//Similarly check if app B launches
+	
+	//DeRegister app B and ForceCommitNNAUpdate
+	INFO_PRINTF1(_L("..deregistering app 'B' using DeregisterNonNativeApplicationL() "));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationB));
+	aApparcServer.ForceCommitNonNativeApplicationsUpdatesL();
+	//Since applist update has not yet completed, both apps should launch
+	CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, (TAny*)EAppA); 
+	CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, (TAny*)EAppB);
+	
+	//Wait for applist to be updated
+	WaitForApplistUpdate(aApparcServer);
+	CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, (TAny*)EAppA);
+	//Check if app B fails to launches Since applist update is complete now
+	CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppB);
+	
+	//Deregister app A and ForceCommitNNAUpdate
+	INFO_PRINTF1(_L("..deregistering app 'A' using RegisterNonNativeApplicationL() "));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA));
+	aApparcServer.ForceCommitNonNativeApplicationsUpdatesL();
+	WaitForApplistUpdate(aApparcServer);
+	//Both apps fail to launch since they are deregistered
+	CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppA);
+	CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppB);
+	
+	INFO_PRINTF1(_L("..End Testing TestForceCommitL API..."));
+ 	}
+ 
+  void CT_NonNativeAppsStep::TestRollbackRegistrationL(RApaLsSession& aApparcServer, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriter, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriterB, CApaCommandLine& aNextCommandLine)
+ 	{
+ 	INFO_PRINTF1(_L("..Start Testing TestRollbackRegistrationL API..."));
+ 	
+ 	//Register app A and ForceCommitNNAUpdate
+	INFO_PRINTF1(_L("..registering app 'A' using RegisterNonNativeApplicationL() "));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, aRegistrationResourceFileWriter, NULL, NULL);
+	aApparcServer.ForceCommitNonNativeApplicationsUpdatesL();
+	CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppA);//Since applist update has not yet completed
+	
+	//Register app B and RollbackNNAUpdates
+	INFO_PRINTF1(_L("..registering app 'B' using RegisterNonNativeApplicationL() "));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, aRegistrationResourceFileWriterB, NULL, NULL);
+	aApparcServer.RollbackNonNativeApplicationsUpdates();
+	
+	//Wait for applist to be updated
+	WaitForApplistUpdate(aApparcServer);
+	CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, (TAny*)EAppA);//Check if app A launches
+	//App B's registration was rolled back, so cannot launch it
+	CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppB);
+	
+	//DeRegister app A and ForceCommitNNAUpdate
+	INFO_PRINTF1(_L("..deregistering app 'A' using DeregisterNonNativeApplicationL() "));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA));
+	aApparcServer.ForceCommitNonNativeApplicationsUpdatesL();
+	//Since applist update has not yet completed, app A should launch
+	CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, (TAny*)EAppA); 
+	
+	//Wait for applist to be updated
+	WaitForApplistUpdate(aApparcServer);
+	//Both apps fail to launch
+	CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppA);
+	CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppB);
+	
+	INFO_PRINTF1(_L("..End Testing TestRollbackRegistrationL API..."));
+	}
+ 	
+  void CT_NonNativeAppsStep::TestRollbackDeregistrationL(RApaLsSession& aApparcServer, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriter, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriterB, CApaCommandLine& aNextCommandLine)
+ 	{
+ 	INFO_PRINTF1(_L("..Start Testing TestRollbackDeregistrationL API..."));
+ 	
+ 	//Register app A and ForceCommitNNAUpdate
+	INFO_PRINTF1(_L("..registering app 'A' using RegisterNonNativeApplicationL() "));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, aRegistrationResourceFileWriter, NULL, NULL);
+	aApparcServer.ForceCommitNonNativeApplicationsUpdatesL();
+	CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppA);//Since applist update has not yet completed
+	
+	//Register app B and ForceCommitNNAUpdate
+	INFO_PRINTF1(_L("..registering app 'B' using RegisterNonNativeApplicationL() "));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, aRegistrationResourceFileWriterB, NULL, NULL);
+	aApparcServer.ForceCommitNonNativeApplicationsUpdatesL();
+	CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppB);
+	
+	//Wait for applist to be updated
+	WaitForApplistUpdate(aApparcServer);
+	//Check if both apps launches since applist update is complete now
+	CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, (TAny*)EAppA);
+	CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, (TAny*)EAppB);
+	
+	//DeRegister app B and ForceCommitNNAUpdate
+	INFO_PRINTF1(_L("..deregistering app 'B' using DeregisterNonNativeApplicationL() "));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationB));
+	aApparcServer.ForceCommitNonNativeApplicationsUpdatesL();
+	
+	//DeRegister app A and ForceCommitNNAUpdate
+	INFO_PRINTF1(_L("..deregistering app 'A' using DeregisterNonNativeApplicationL() "));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA));
+	aApparcServer.RollbackNonNativeApplicationsUpdates();
+	
+	//Wait for applist to be updated
+	WaitForApplistUpdate(aApparcServer);
+	//Since deregistration of app A was rolled back it still launches
+	CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, (TAny*)EAppA); 
+	CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppB);
+
+	INFO_PRINTF1(_L("..deregistering app 'A' using DeregisterNonNativeApplicationL() "));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA));
+	aApparcServer.ForceCommitNonNativeApplicationsUpdatesL();
+
+	//Wait for applist to be updated
+	WaitForApplistUpdate(aApparcServer);
+	//Both apps fail to launch
+	CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppA);
+	CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppB);
+	
+	INFO_PRINTF1(_L("..End Testing TestRollbackDeregistrationL API..."));
+ 	}
+ 
+// CTestStep derived functions
+	
+CT_NonNativeAppsStep::~CT_NonNativeAppsStep()
+	{
+	}
+
+CT_NonNativeAppsStep::CT_NonNativeAppsStep()
+	{
+	SetTestStepName(KT_NonNativeAppsStep);
+	}
+
+TVerdict CT_NonNativeAppsStep::doTestStepPreambleL()
+	{
+	SetTestStepResult(EPass);
+	return TestStepResult();
+	}
+
+TVerdict CT_NonNativeAppsStep::doTestStepPostambleL()
+	{
+	return TestStepResult();
+	}
+
+TVerdict CT_NonNativeAppsStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test NonNativeApps starting....\n"));
+
+	RTstFileArray fileArray(2);
+	CleanupClosePushL(fileArray);
+	fileArray.AppendL(_L("z:\\private\\101F289C\\GIF.NNA1"), KLit8_DataType_Gif);
+	fileArray.AppendL(_L("z:\\private\\101F289C\\HTML.NNA2"), KLit8_DataType_Html);
+	fileArray.AppendL(_L("z:\\private\\101F289C\\CONTACT.NNA3"), KLit8_DataType_Vcard);
+	fileArray.AppendL(_L("z:\\private\\101F289C\\TXT.NNA4"), KLit8_DataType_plainText);
+
+	RTestableApaLsSession apparcServer;
+	CleanupClosePushL(apparcServer);
+	User::LeaveIfError(apparcServer.Connect());
+
+	RFs fileServer;
+	CleanupClosePushL(fileServer);
+	User::LeaveIfError(fileServer.Connect());
+	User::LeaveIfError(fileServer.ShareProtected());
+
+	apparcServer.FlushRecognitionCache();
+	HEAP_TEST_LS_SESSION(apparcServer, 0, 0, TestAppForDocumentL(apparcServer, fileServer, fileArray), apparcServer.FlushRecognitionCache());
+	HEAP_TEST_LS_SESSION(apparcServer, 0, 0, TestAppForDocumentAndServiceL(apparcServer, fileServer, fileArray), apparcServer.FlushRecognitionCache());
+	HEAP_TEST_LS_SESSION(apparcServer, 0, 0, TestRecognizingL(apparcServer, fileServer, fileArray), apparcServer.FlushRecognitionCache());
+	
+	//avoid race conditions
+	User::After(1500000);
+	//DONT_CHECK Skips the heap check at server side. This heap imbalance happens intermittently,with no known reason (See PDEF111975).
+	HEAP_TEST_LS_SESSION(apparcServer, 0, DONT_CHECK, TestStartDocumentL(apparcServer, fileServer, fileArray), apparcServer.FlushRecognitionCache());
+	//DONT_CHECK due to file system changes
+	HEAP_TEST_LS_SESSION(apparcServer, 0, DONT_CHECK, TestRegisterNonNativeApplicationL(apparcServer,fileServer), NO_CLEANUP);
+
+	//INC127734: Test case is added to test ForceCommitNonNativeApplicationsUpdatesL API
+	//DONT_CHECK due to file system changes
+	HEAP_TEST_LS_SESSION(apparcServer, 0, DONT_CHECK, TestCommitNNAppUpdatesL(apparcServer), NO_CLEANUP);
+	//DONT_CHECK due to file system changes
+	HEAP_TEST_LS_SESSION(apparcServer, 0, DONT_CHECK, TestForceCommitNNAppUpdatesL(apparcServer), NO_CLEANUP);
+	
+	CleanupStack::PopAndDestroy(3, &fileArray);
+
+	INFO_PRINTF1(_L("....Test NonNativeApps completed!"));
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_NonNativeAppsStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,112 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code  
+*/
+
+#if (!defined __T_NONNATIVEAPPSTEP_H__)
+#define __T_NONNATIVEAPPSTEP_H__
+
+#include <APASERVERAPP.H>
+#include <EIKSERVERAPP.H>
+
+#include "ApparcTestServer.h"
+
+// RTstFileArray
+
+class RTstFileArray
+	{
+public:
+	RTstFileArray(TInt aGranularity);
+	void Close();
+	void AppendL(const TDesC& aFullFileName, const TDesC8& aExpectedDataType);
+	inline TInt Count() const {return iFileArray.Count();}
+	void Get(TPtrC& aFullFileName, TPtrC8& aExpectedDataType, TInt aIndex) const;
+private:
+	struct SFile
+		{
+		HBufC* iFullFileName;
+		HBufC8* iExpectedDataType;
+		};
+private:
+	RArray<SFile> iFileArray;
+	};
+
+
+// RTstAppService
+
+class RTstAppService : public RApaAppServiceBase
+	{
+public:
+	static TInt DoTestL(TUid aServiceUid, TBool aPassingFileByHandle, const TDesC& aFileNameWithoutDriveOrPath);
+private:
+	RTstAppService(TUid aServiceUid);
+	void ConnectL();
+	void ReceiveTestResult(TRequestStatus& aRequestStatus, TBool aPassingFileByHandle, const TDesC& aFileNameWithoutDriveOrPath);
+	// from RApaAppServiceBase
+	virtual TUid ServiceUid() const;
+private:
+	const TUid iServiceUid;
+	};
+
+
+
+// CT_NonNativeApps test class. 
+
+class CT_NonNativeAppsStep : public CTestStep
+	{
+public:
+	CT_NonNativeAppsStep();
+	~CT_NonNativeAppsStep();
+
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+
+private:
+	HBufC8* OpenFileAndReadBufferLC(RApaLsSession& aApparcServer, RFs& aFileServer, const TDesC& aFullFileName);
+	void OpenFileAndSetFilePositionToSomewhereUnusualLC(RFile& aFile, TInt& aFilePosition, RFs& aFileServer, const TDesC& aFullFileName);
+	void TestFilePosition(RFile& aFile, TInt aFilePosition);
+	void TestResultsOfAppForDocumentAndServiceL(TUid aServiceUid, TInt aError, const TUid& aAppUid, const TDataType& aDataType, const TDesC8& aExpectedDataType);
+	void CheckPropertyUpdateAndResetL(const TDesC& aExpectedNewValue);
+	void CheckApplicationLaunchesOkayL(RApaLsSession& aApparcServer, const CApaCommandLine& aCommandLine, TAny* aOption);
+	void CheckApplicationFailsToLaunchL(RApaLsSession& aApparcServer, const CApaCommandLine& aCommandLine, TAny* aOption);	
+	void WaitForApplistUpdate(RApaLsSession& aApparcServer);
+private:
+	void TestAppForDocumentL(RApaLsSession& aApparcServer, RFs& aFileServer, const RTstFileArray& aFileArray);
+	void TestAppForDocumentAndServiceL(RApaLsSession& aApparcServer, RFs& aFileServer, const RTstFileArray& aFileArray);
+	void TestRecognizingL(RApaLsSession& aApparcServer, RFs& aFileServer, const RTstFileArray& aFileArray);
+	void TestStartDocumentL(RApaLsSession& aApparcServer, RFs& aFileServer, const RTstFileArray& aFileArray);
+	void TestRegisterNonNativeApplicationL(RApaLsSession& aApparcServer, RFs& aFileServer);
+	void TestGetAppIconForNonNativeL(RApaLsSession& aApparcServer, RFs& aFileServer, CApaRegistrationResourceFileWriter* const aRegistrationResourceFileWriter, CApaLocalisableResourceFileWriter* const aLocalisableResourceFileWriter);	
+	void TestCommitNNAppUpdatesL(RApaLsSession& aApparcServer);	
+	void TestForceCommitNNAppUpdatesL(RApaLsSession& aApparcServer);
+	void TestForceCommitL(RApaLsSession& aApparcServer, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriter, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriterB, CApaCommandLine& aNextCommandLine);
+	void TestRollbackRegistrationL(RApaLsSession& aApparcServer, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriter, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriterB, CApaCommandLine& aNextCommandLine);
+	void TestRollbackDeregistrationL(RApaLsSession& aApparcServer, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriter, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriterB, CApaCommandLine& aNextCommandLine);	
+
+private:
+
+	};
+
+
+_LIT(KT_NonNativeAppsStep,"T_NonNativeApps");
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_NotifStep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,305 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Checks for notifications when application list changes.\n
+// 
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <f32file.h>
+#include <fbs.h>
+#include <apaid.h>
+#include <apgaplst.h>
+#include <apaflrec.h>
+#include <apgcli.h>
+#include <apacmdln.h>
+#include <apsserv.h>
+#include <apfrec.h>
+#include <datastor.h>
+#include <apgicnfl.h>
+#include <apasvst.h>
+#include <apgnotif.h>
+#include <e32test.h>
+
+#include "appfwk_test_utils.h"
+#include "T_NotifStep.h"
+
+
+/**
+ 
+  Overridden from virtual method MApaAppListServObserver::HandleAppListEvent().
+  This method is used to receive notification for change in application list.\n
+ 
+*/
+void CTestObserver::HandleAppListEvent(TInt /*aEvent*/)
+	{
+
+	iNotified++;
+	if (iNotifier)
+		iNotifier->Cancel();
+	CActiveScheduler::Stop();
+	}
+	
+/**
+  Auxiliary Fn for Test Case ID T-NotifStep-TestAppNotificationL
+ 
+  Copy a registration resource file in the path  "c:\private\10003a3f\import\apps" .
+*/
+void CT_NotifStep::CreateAppL(const TDesC& aAppName)
+	{
+	TFileName appFullName;
+	TFileName appTargetName; 
+	CFileMan* fileManager = CFileMan::NewL(iFs);
+	CleanupStack::PushL(fileManager);	
+	appFullName.Format(_L("z:\\ApparcTest\\%S_reg.RSC"),&aAppName);
+	appTargetName.Format(_L("C:\\Private\\10003a3f\\Import\\apps\\%S_reg.Rsc"), &aAppName);
+	INFO_PRINTF2(_L("copying the file: %S"), &appTargetName);
+	TInt ret = fileManager->Copy (appFullName, appTargetName, CFileMan::ERecurse);
+	TEST(ret==KErrNone);
+	CleanupStack::PopAndDestroy(fileManager);
+	}
+
+/**
+	Auxiliary Fn for Test Case ID T-NotifStep-TestAppNotificationL
+	Delete a registration resource file from the path  "c:\private\10003a3f\import\apps" .
+*/
+void CT_NotifStep::DeleteAppL(const TDesC& aAppName)
+	{
+	TFileName appFullName;
+	CFileMan* fileManager = CFileMan::NewL(iFs);
+	CleanupStack::PushL(fileManager);
+	appFullName.Format(_L("C:\\Private\\10003a3f\\Import\\apps\\%S_reg.Rsc"),&aAppName);
+		
+	INFO_PRINTF2(_L("Deleting the file: %S"), &appFullName);
+	TRequestStatus status;
+	TTime tempTime(0); // added tempTime to avoid asynch CFileMan::Attribs request completing with KErrArgument
+	TEST(fileManager->Attribs(appFullName,0,KEntryAttReadOnly, tempTime, CFileMan::ERecurse, status)==KErrNone);
+	User::WaitForRequest(status);
+	TEST(status.Int() == KErrNone);
+	TInt ret = fileManager->Delete(appFullName, CFileMan::ERecurse);
+	TEST(ret==KErrNone);
+	CleanupStack::PopAndDestroy(fileManager);
+	}
+ 
+/**
+   @SYMTestCaseID T-NotifStep-TestAppNotificationL
+  
+   @SYMPREQ REQ1087, PCHY-5L3RDW
+  
+   @SYMTestCaseDesc Test whether notification is received from CApaAppListNotifier
+   whenever application list changes. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions The method creates an object of user-defined observer CTestObserver
+   and creates a CApaAppListNotifier active object which is associated to the
+   observer. It then starts the active scheduler and adds a new application or deletes
+   an application from the application list. To ensure that notifications are received on
+   change in application list HandleAppListEvent() method which is derived
+   from interface class MApaAppListServObserver is observed.\n
+   API Calls:\n	
+   CApaAppListNotifier::NewL(MApaAppListServObserver* aObserver, TPriority aPriority)\n
+   
+   @SYMTestExpectedResults On deletion of the app the notification for change in
+   the application list is received.
+    
+ */
+void CT_NotifStep::TestAppNotificationL()
+	{
+	// Force the applist to be updated 
+	//To ensure that server has time to count all applications in the system
+	RPointerArray<TDesC> dummy;
+	User::LeaveIfError(iSession.ForceRegistration(dummy));
+
+	TInt theAppCount = 0;
+	TInt theErr1 = iSession.AppCount(theAppCount);
+	TEST(theErr1==KErrNone);
+
+	INFO_PRINTF2(_L("The number of applications : %d"), theAppCount);
+		
+	CTestObserver* obs=new(ELeave) CTestObserver();
+	CleanupStack::PushL(obs);
+	CApaAppListNotifier* notif=CApaAppListNotifier::NewL(obs,CActive::EPriorityHigh);
+	CleanupStack::PushL(notif);
+	obs->iNotifier=notif;	
+	INFO_PRINTF1(_L("Creating and deleting apps for notification"));
+	CreateAppL(_L("AAA"));
+
+	CActiveScheduler::Start();
+	
+	TInt theAppCount1 = 0;
+	theErr1 = iSession.AppCount(theAppCount1);
+	TEST((theAppCount1 - 1) == theAppCount);
+	INFO_PRINTF2(_L("The number of applications : %d"), theAppCount1);
+	CleanupStack::PopAndDestroy(notif);
+	
+	notif = CApaAppListNotifier::NewL(obs,CActive::EPriorityHigh);
+	CleanupStack::PushL(notif);
+	obs->iNotifier = notif;
+	INFO_PRINTF1(_L("Deleting the application"));
+	DeleteAppL(_L("AAA")); 
+
+	CActiveScheduler::Start();
+	
+	CleanupStack::PopAndDestroy(notif);	
+	User::LeaveIfError(iSession.ForceRegistration(dummy));	
+	theErr1 = iSession.AppCount(theAppCount1);
+	TEST(theErr1==KErrNone);
+	TEST(theAppCount1 == theAppCount);
+	
+	INFO_PRINTF2(_L("The number of applications : %d"), theAppCount1);
+	TEST(obs->iNotified>0);
+	
+	INFO_PRINTF2(_L("Received %d notifications"),obs->iNotified);
+	CleanupStack::PopAndDestroy(obs);
+	}
+
+void CT_NotifStep::ModifyIconFileTimeStamp()
+	{
+	_LIT(KMbmIconFile, "c:\\resource\\apps\\tupgradeiconapp.mbm");
+	_LIT(KTestIconFile, "c:\\TestUpgradeIcon\\tupgradeiconapp.mbm");
+	_LIT(KTestIconFileTempPath, "c:\\TestUpgradeIcon\\");
+
+	// Create KMbmIconFileTempPath
+	TInt ret = iUtils.CreateDirectoryL(KTestIconFileTempPath);
+	TEST(ret == KErrNone || ret == KErrAlreadyExists);
+	INFO_PRINTF1(_L("Copy icon file from C: drive to temp path"));
+	ret = iUtils.CopyFileL(KMbmIconFile, KTestIconFileTempPath);
+	
+	INFO_PRINTF1(_L("Modify timestamp of the icon file"));
+	TTime modifiedTime(0);
+	modifiedTime.HomeTime();
+ 	ret = iFs.SetModified(KTestIconFile, modifiedTime);
+ 	TEST(ret==KErrNone);
+ 	ret = iUtils.SetReadOnly(KTestIconFile, 0);
+	TEST(ret==KErrNone);	
+	INFO_PRINTF2(_L("Replace the modified icon file in C: drive (%S)"), &KMbmIconFile);
+ 	ret = iUtils.CopyFileL(KTestIconFile, KMbmIconFile);
+	// wait 5 seconds to finish re-scan
+	User::After(5*1000000);
+	TEST(ret==KErrNone);
+	}
+
+/**
+   @SYMTestCaseID	T-NotifStep-TTestIconFileNotificationL
+  
+   @SYMPREQ 		PDEF102804
+  
+   @SYMTestCaseDesc Test whether notification is received from CApaAppListNotifier   whenever the application icon file is changed
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus 	Implemented
+   
+   @SYMTestActions 	Modify the application icon file in a temporary location. Move icon file to a location specified in the resource file.
+   
+   @SYMTestExpectedResults A notification is recieved when the updated icon file is replaced to a location specified in the resource file.
+*/ 
+void CT_NotifStep::TestIconFileNotificationL()
+	{
+	// Force the applist to be updated 
+	//To ensure that server has time to count all applications in the system
+	RPointerArray<TDesC> dummy;
+	User::LeaveIfError(iSession.ForceRegistration(dummy));
+
+	// Create observer
+	CTestObserver* obs = new(ELeave) CTestObserver();
+	CleanupStack::PushL(obs);
+	CApaAppListNotifier* notif = CApaAppListNotifier::NewL(obs, CActive::EPriorityHigh);
+	CleanupStack::PushL(notif);
+	obs->iNotifier=notif;
+
+	// Change the timestamp of the icon file
+	INFO_PRINTF1(_L("Modifying the icon file...attempt to check it's notified"));
+	ModifyIconFileTimeStamp();
+	
+	CActiveScheduler::Start();
+	
+	CleanupStack::PopAndDestroy(notif);
+	// Test if notification is recieved.
+	TEST(obs->iNotified > 0);
+	if (obs->iNotified > 0)
+		{
+		INFO_PRINTF2(_L("Received %d notifications"),obs->iNotified);
+		}
+	
+	CleanupStack::PopAndDestroy(obs); //obs
+	}
+
+CT_NotifStep::~CT_NotifStep()
+/**
+   Destructor
+ */
+	{
+	delete iScheduler;
+	}
+
+CT_NotifStep::CT_NotifStep()
+/**
+   Constructor
+ */
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_NotifStep);
+	}
+
+TVerdict CT_NotifStep::doTestStepL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	INFO_PRINTF1(_L("Testing Apparc...T_Notif"));
+
+	TInt ret = FbsStartup();
+	TEST(ret==KErrNone);
+	ret=RFbsSession::Connect();
+	TEST(ret==KErrNone);
+	// start an active scheduler
+	iScheduler=new(ELeave) CActiveScheduler();
+	CActiveScheduler::Install(iScheduler);
+
+	TEST(KErrNone == iFs.Connect());
+	TEST(KErrNone == iSession.Connect());
+	TEST(KErrNone == iUtils.Connect());
+
+	// run the testcode (inside an alloc heaven harness)	
+	__UHEAP_MARK;
+#if defined (__WINSCW__)
+	INFO_PRINTF1(_L("T-NotifStep-TTestIconFileNotificationL Test Started..."));
+	TRAP(ret,TestIconFileNotificationL());
+	TEST(ret==KErrNone);
+	INFO_PRINTF2(_L("TestIconFileNotificationL() finished with return code '%d'\n"), ret);
+#endif
+	INFO_PRINTF1(_L("T-NotifStep-TestAppNotificationL Test Started..."));
+	TRAP(ret,TestAppNotificationL());
+	TEST(ret==KErrNone);
+	INFO_PRINTF2(_L("TestAppNotificationL() finished with return code '%d'\n"), ret);
+	__UHEAP_MARKEND;
+	
+	iUtils.Close();
+	iSession.Close();
+	iFs.Close();
+	RFbsSession::Disconnect();
+	INFO_PRINTF1(_L("T_Notif Completed."));
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_NotifStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,67 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code  
+*/
+
+#if (!defined __T_NOTIF_STEP_H__)
+#define __T_NOTIF_STEP_H__
+#include <apgnotif.h>
+#include "ApparcTestServer.h"
+#include "testableapalssession.h"
+
+//!  A CT_NotifStep test class. 
+
+/**  Checks for notifications when application list changes. */
+
+class CT_NotifStep :public CTestStep
+	{
+public:
+	CT_NotifStep();
+	~CT_NotifStep();
+	virtual TVerdict doTestStepL();
+	void TestAppNotificationL();
+	void TestIconFileNotificationL();
+	
+private:
+	void CreateAppL(const TDesC& aAppName);
+	void DeleteAppL(const TDesC& aAppName);
+	void ModifyIconFileTimeStamp();
+	
+private:
+	CActiveScheduler* iScheduler;
+	RFs	iFs;
+ 	RApaLsSession iSession;
+	RSmlTestUtils iUtils;
+	};
+
+class CTestObserver : public CBase, public MApaAppListServObserver
+	{
+public: // from MApaAppListServObserver
+	void HandleAppListEvent(TInt aEvent);
+	
+public:
+	TInt iNotified;
+	CApaAppListNotifier* iNotifier;
+	};
+
+_LIT(KT_NotifStep,"T_Notif");
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_OOMStep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,616 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Performs the Out of Memory Tests.\n
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code  
+*/
+
+#include <f32file.h>
+#include <apaid.h>
+#include <apgaplst.h>
+#include <apgicnfl.h>
+#include <apgdoor.h>
+#include "tstapp.h"
+#include <fbs.h>
+#include <s32std.h> 
+#include <s32stor.h> 
+#include <s32file.h> 
+#include <s32mem.h>
+#include "T_OOMStep.h"
+//
+#if !defined(__E32TEST_H__)
+#include <e32test.h>
+#endif
+
+
+void CT_OOMStep::setup()
+	{
+#if defined(__EPOC32__)
+	TFullName filePath=_L("c:\\docs\\tstapp.doc");
+	TFullName tempPath=_L("c:\\system\\temp\\");
+	// if we're on the rack create the directories we need
+	TParse parser;
+	parser.Set(filePath,NULL,NULL);
+	iFs.MkDirAll(parser.DriveAndPath());
+	parser.Set(tempPath,NULL,NULL);
+	iFs.MkDirAll(parser.DriveAndPath());
+#endif
+	}
+
+
+
+/**
+  Auxiliary Fn for Test Case ID T-OOMStep-TestOOMConstructionL 
+ 
+  This function adds a new document to the app DLL and associates a 
+  temporary store. The document is then initialized with the default settings.
+*/
+CApaDocument* CT_OOMStep::CreateTestDocL(CApaProcess* aProcess)
+	{
+
+	TFileName dllname=_L("tstapp.app");
+	TFullName filePath=_L("c:\\docs\\tstapp.doc");
+	// create a new main doc of type tstapp
+	CApaDocument* doc=NULL;
+	
+	TApaApplicationFactory appFact(KUidTestApp);
+	doc=aProcess->AddNewDocumentL(appFact);
+
+	aProcess->SetMainDocument(doc);
+	//
+	// create the store and initialise it
+	CFileStore* store = doc->CreateFileStoreLC(aProcess->FsSession(),filePath);
+	CleanupStack::Pop(); // store
+	((CTestAppDoc*)aProcess->MainDocument())->iStore = store;
+	aProcess->SetMainDocFileName(filePath);
+	//
+	// initialise the document with factory settings
+	doc->NewDocumentL();
+	//
+	return doc;
+	}
+
+
+/**
+  Auxiliary Fn for Test Case ID T-OOMStep-TestOOMConstructionL 
+ 
+  This function creates a test document for app DLL and saves
+  the document.
+  
+*/
+void CT_OOMStep::CreateTestDocFileL()
+	{
+
+	TFullName filePath=_L("c:\\docs\\tstapp.doc");
+	// delete the file to be created by the testcode
+	iFs.Delete(filePath);
+	iFs.MkDir(_L("c:\\docs\\"));
+
+	// create an appfinder and process
+	CApaProcess* process = CApaProcess::NewL(iFs);
+	CApaDocument* doc = CreateTestDocL(process);
+
+	// save it 
+	doc->SaveL();
+
+	// tidy up
+	process->DestroyDocument(doc);
+	delete process;
+	}
+
+/**
+   @SYMTestCaseID T-OOMStep-TestOOMConstructionL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test methods CApaScanningAppFinder::NewL, CApaProcess::NewL,
+   CApaProcess::AddNewDocumentL, CApaProcess::OpenNewDocumentL and CApaDocument::SaveL
+   when device goes Out of Memory.
+   
+   @SYMTestPriority High 
+ 
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions \n OOM Test for CApaScanningAppFinder::NewL:\n
+   Use macro __UHEAP_SETFAIL() to simulate the out of memory
+   situation. Call CApaScanningAppFinder::NewL() to allocate memory. Observe
+   the leave that occurs. Observe after how many allocations the leave occurs.\n\n
+   OOM Test for CApaProcess::NewL:\n
+   Use macro __UHEAP_SETFAIL() to simulate the out of memory situation. Call
+   CApaProcess::NewL() to allocate memory. Observe the leave that occurs.
+   Observe after how many allocations the leave occurs.\n\n
+   OOM Test for CApaProcess::AddNewDocumentL:\n
+   Use macro __UHEAP_SETFAIL() to simulate the out of memory situation. Call
+   CApaProcess::AddNewDocumentL() to allocate memory. Observe the leave that
+   occurs. Observe after how many allocations the leave occurs.\n\n
+   OOM Test for CApaProcess::OpenNewDocumentL:\n
+   Use macro __UHEAP_SETFAIL() to simulate the out of memory situation. Call
+   CApaProcess::OpenNewDocumentL() to allocate memory. Observe the leave that
+   occurs. Observe after how many allocations the leave occurs.\n\n
+   OOM Test for CApaDocument::SaveL:\n
+   Create and initialize a document for tstapp. Use macro __UHEAP_SETFAIL()
+   to simulate the out of memory situation. Call CApaDocument::SaveL() to
+   allocate memory for the document to be saved. Observe the leave that occurs.
+   Observe after how many allocations the leave occurs.\n\n
+   API Calls:\n	
+   CApaScanningAppFinder::NewL(const RFs& aFs)\n
+   CApaProcess::NewL(const RFs& aFs,CApaAppFinder& aAppFinder)\n
+   CApaProcess::AddNewDocumentL(const TDesC& aDllFileName,TUid aDllUid=KNullUid)\n
+   CApaProcess::OpenNewDocumentL(CFileStore*& aStore,CStreamDictionary*& aStreamDic,const TDesC& aDocFullFileName,TUint aFileMode)\n
+   CApaDocument::SaveL()\n
+   
+   @SYMTestExpectedResults Tests should complete without any memory leaks. It should
+   also observe the no of allocations which occur before OOM situation.
+    
+ */
+void CT_OOMStep::TestOOMConstructionL()
+	{
+	TInt failRate=0;
+	TFullName filePath=_L("c:\\docs\\tstapp.doc");
+
+	__UHEAP_RESET;
+
+	// CApaProcess
+	INFO_PRINTF1(_L("CApaProcess construction under OOM"));
+	CApaProcess* process=NULL;
+	for (failRate=1;;failRate++)
+		{
+		__UHEAP_RESET;
+		__UHEAP_SETFAIL(RHeap::EDeterministic,failRate);
+		__UHEAP_MARK;
+
+		TRAPD(ret, process = CApaProcess::NewL(iFs));
+		
+			TEST((ret==KErrNone || ret==KErrNoMemory));
+		if (ret!=KErrNone)
+			{
+			__UHEAP_MARKEND;
+			TEST(process==NULL);
+			}
+		else
+			{
+			TEST(process!=NULL);
+			delete process;
+			process = NULL;
+			REComSession::FinalClose();
+			__UHEAP_MARKEND;
+			break;
+			}
+		}
+	__UHEAP_RESET;
+	INFO_PRINTF2(_L("  #allocs for c'tion: %d\n"),failRate-1);
+	//
+	// creating CApaDocument
+	INFO_PRINTF1(_L("CApaDocument construction under OOM"));
+	CApaDocument* doc=NULL;
+	//
+	for (failRate=1;;failRate++)
+		{
+		__UHEAP_RESET;
+		process = CApaProcess::NewL(iFs);		
+			TEST(process!=NULL);
+		__UHEAP_SETFAIL(RHeap::EDeterministic,failRate);
+		__UHEAP_MARK;
+		
+		TApaApplicationFactory appFact(KUidTestApp);
+		TRAPD(ret,doc=process->AddNewDocumentL(appFact));
+
+		TEST((ret==KErrNone || ret==KErrNoMemory));
+		if (ret!=KErrNone)
+			{
+			delete process;
+			REComSession::FinalClose();
+			__UHEAP_MARKEND;
+			TEST(doc==NULL);
+			}
+		else
+			{
+			TEST(doc!=NULL);
+			process->DestroyDocument(doc);
+			delete process;
+			REComSession::FinalClose();
+			__UHEAP_MARKEND;
+			break;
+			}
+		}
+	__UHEAP_RESET;
+	INFO_PRINTF2(_L("  #allocs for c'tion: %d\n"),failRate-1);
+	//
+	// opening a CApaDocument
+	INFO_PRINTF1(_L("CApaDocument Restoration under OOM"));
+	TRAPD(err,CreateTestDocFileL());
+		TEST(err==KErrNone);
+	//
+	for (failRate=1;;failRate++)
+		{
+		__UHEAP_RESET;
+		doc = NULL;
+		process = CApaProcess::NewL(iFs);		
+
+		__UHEAP_SETFAIL(RHeap::EDeterministic,failRate);
+		__UHEAP_MARK;
+		CFileStore* store=NULL;
+		CStreamDictionary* streamDic=NULL;
+		TRAPD(ret, doc=process->OpenNewDocumentL(store,streamDic,filePath,EFileShareExclusive|EFileWrite));
+			TEST((ret==KErrNone || ret==KErrNoMemory));
+		if (ret!=KErrNone)
+			{
+			delete streamDic;
+			delete store;
+			delete process;
+			REComSession::FinalClose();
+			__UHEAP_MARKEND;
+			TEST(doc==NULL);
+			}
+		else
+			{
+			TEST(doc!=NULL);
+			TEST(streamDic!=NULL);
+			TEST(store!=NULL);
+			delete streamDic;
+			delete store;
+			process->DestroyDocument(doc);
+			delete process;
+			REComSession::FinalClose();
+			__UHEAP_MARKEND;
+			break;
+			}
+		}
+	__UHEAP_RESET;
+	INFO_PRINTF2(_L("  #allocs for c'tion: %d\n"),failRate-1);
+	//
+	// saving a CApaDocument
+	INFO_PRINTF1(_L("CApaDocument Storing under OOM"));
+	//
+	for (failRate=1;;failRate++)
+		{
+		__UHEAP_RESET;
+		// delete the file to be created by the testcode
+		iFs.Delete(filePath);
+		process = CApaProcess::NewL(iFs);		
+		doc = CreateTestDocL(process);
+		// attempt to save
+		__UHEAP_SETFAIL(RHeap::EDeterministic,failRate);
+		__UHEAP_MARK;
+		TRAPD(ret, doc->SaveL());
+			TEST((ret==KErrNone || ret==KErrNoMemory));
+		if (ret!=KErrNone)
+			{
+			process->DestroyDocument(doc);
+			delete process;
+			REComSession::FinalClose();
+			__UHEAP_MARKEND;
+			}
+		else
+			{
+			process->DestroyDocument(doc);
+			delete process;
+			REComSession::FinalClose();
+			__UHEAP_MARKEND;
+			break;
+			}
+		}
+	__UHEAP_RESET;
+	INFO_PRINTF2(_L("  #allocs for c'tion: %d\n"),failRate-1);
+	//
+	}
+
+/**
+   @SYMTestCaseID T-OOMStep-TestDoorOOML
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test CApaDoor APIs NewL(), StoreL(), Restore() when device
+   goes Out of Memory.
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions The method simulates an OOM scenario to test CApaDoor APIs NewL(),
+   StoreL() and Restore().\n\n
+   To test CApaDoor::NewL(), the method creates a process and adds a new document
+   to app DLL using AddNewDocumentL(). Using the macro __UHEAP_SETFAIL() OOM
+   scenario is simulated. Call CApaDoor::NewL() to observe the leave returned.\n\n
+   To test CApaDoor::StoreL(), the method creates a process and adds a new 
+   document to app DLL using AddNewDocumentL(). It calls CApaDoor::NewL() to
+   create a wrapper for the document. A temporary buffer store is created.
+   Now Use macro __UHEAP_SETFAIL() to simulate the OOM scenario.
+   Call CApaDoor::StoreL() to store the document in the specified store.
+   Observe the leave returned.\n\n
+   To test CApaDoor::Restore(), the method creates a process and adds a new
+   document to app DLL using AddNewDocumentL(). It calls CApaDoor::NewL()
+   to create a wrapper for the document. A temporary buffer store is created.
+   Now Call CApaDoor::StoreL() to store the document in the specified store.
+   Use macro __UHEAP_SETFAIL() to simulate the OOM scenario. Call
+   CApaDoor::RestoreL() to restore the document from the specified store.
+   Observe the leave returned.\n
+   API Calls:\n	
+   CApaDoor::NewL(RFs& aFs, CApaDocument& aDoc,const TSize& aDefaultIconSizeInTwips)\n
+   CApaDoor::StoreL(CStreamStore& aStore) const\n
+   CApaDoor::RestoreL(const CStreamStore& aStore,TStreamId aHeadStreamId)\n
+   
+   @SYMTestExpectedResults Tests should complete without any memory leaks.
+    
+ */
+void CT_OOMStep::TestDoorOOML()
+	{
+	CApaProcess* process=NULL;
+	CApaDocument* doc=NULL;
+	CApaDoor* door=NULL;
+	TInt failRate=0;
+	//
+	INFO_PRINTF1(_L("CApaDoor construction under OOM"));
+	//
+	__UHEAP_MARK;
+	//Create a session with F & B server
+	TInt ret=RFbsSession::Connect();
+		TEST(!ret);
+	
+	for (failRate=1;;failRate++)
+		{
+		__UHEAP_RESET;
+		door = NULL;
+		process = CApaProcess::NewL(iFs);
+		TApaApplicationFactory appFact(KUidTestApp);
+		doc=process->AddNewDocumentL(appFact);
+
+		__UHEAP_SETFAIL(RHeap::EDeterministic,failRate);
+
+		door = NULL;
+		TRAPD(ret,door=CApaDoor::NewL(iFs,*doc,TSize(400,400)));
+			TEST((ret==KErrNone || ret==KErrNoMemory));
+		if (ret!=KErrNone)
+			{
+			delete process;
+			TEST(door==NULL);
+			}
+		else
+			{
+			TEST(door!=NULL);
+			delete door;
+
+			delete process;
+			break;
+			}
+		}
+	__UHEAP_RESET;
+	INFO_PRINTF2(_L("  #allocs for c'tion: %d\n"),failRate-1);
+	//
+	INFO_PRINTF1(_L("CApaDoor Store() under OOM"));
+	//
+	CBufStore* store=NULL;
+	for (failRate=1;;failRate++)
+		{
+		__UHEAP_RESET;
+		door = NULL;
+		process = CApaProcess::NewL(iFs);	
+		TApaApplicationFactory appFact(KUidTestApp);
+		doc=process->AddNewDocumentL(appFact);	
+		
+		door = CApaDoor::NewL(iFs,*doc,TSize(400,400)); // owns doc
+		store = CBufStore::NewL(10);
+		__UHEAP_SETFAIL(RHeap::EDeterministic,failRate);
+
+		TStreamId id=KNullStreamId;
+		TRAPD(ret,id=door->StoreL(*store));
+			TEST((ret==KErrNone || ret==KErrNoMemory));
+		if (ret!=KErrNone)
+			{
+			TEST(id==KNullStreamId);
+			delete store;
+			delete door;
+
+			delete process;
+			}
+		else
+			{
+			TEST(id!=KNullStreamId);
+			delete store;
+
+			delete door;
+			delete process;
+			break;
+			}
+		}
+	__UHEAP_RESET;
+	INFO_PRINTF2(_L("  #allocs: %d\n"),failRate-1);
+	//
+	INFO_PRINTF1(_L("CApaDoor Restore() under OOM"));
+	//
+	for (failRate=1;;failRate++)
+		{
+		__UHEAP_RESET;
+		door = NULL;
+		process = CApaProcess::NewL(iFs);
+		TApaApplicationFactory appFact(KUidTestApp);
+		doc = process->AddNewDocumentL(appFact);
+		door = CApaDoor::NewL(iFs,*doc,TSize(400,400)); // owns doc
+		store = CBufStore::NewL(10);
+		TStreamId id = door->StoreL(*store);
+		__UHEAP_SETFAIL(RHeap::EDeterministic,failRate);
+
+		TRAPD(ret,door->RestoreL(*store,id));
+			TEST((ret==KErrNone || ret==KErrNoMemory));
+		if (ret!=KErrNone)
+			{
+			delete store;
+			delete door;
+
+			delete process;
+			}
+		else
+			{
+			delete store;
+			delete door;
+
+			delete process;
+			break;
+			}
+		}
+	__UHEAP_RESET;
+	INFO_PRINTF2(_L("  #allocs: %d\n"),failRate-1);
+	//
+	//Close the session F & B server.
+	RFbsSession::Disconnect();
+	REComSession::FinalClose();
+	__UHEAP_MARKEND;
+	}
+
+
+/**
+  Auxiliary Fn for all Test Cases.
+ 
+  This method creates and installs an active scheduler and puts the
+  test code on the scheduler as a CIdle object. The method initiates
+  all tests by calling the static method CT-OOMStepCallBack::CallBack().
+ 
+*/
+void CT_OOMStep::DoTestsInCallBackL()
+	{
+	// create an active scheduler
+	CActiveScheduler* scheduler = new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(scheduler);
+	CleanupStack::PushL(scheduler);
+
+	// put the test code onto the scheduler as an idle object
+	CIdle* idle=CIdle::NewL(-20);
+	CleanupStack::PushL(idle);
+
+	CT_OOMStepCallBack* callBack = new(ELeave) CT_OOMStepCallBack(this);
+	CleanupStack::PushL(callBack);
+
+	idle->Start(TCallBack(CT_OOMStepCallBack::CallBack,callBack));
+	// start the test code
+	CActiveScheduler::Start();
+
+	// all outstanding requests complete - kill the scheduler
+	CleanupStack::PopAndDestroy(3); //scheduler, callBack, idle
+	}
+
+
+
+CT_OOMStepCallBack::CT_OOMStepCallBack(CT_OOMStep* aTestStep)
+{
+	iTestStep = aTestStep;
+}
+
+
+CT_OOMStepCallBack::~CT_OOMStepCallBack()
+{
+
+}
+/**
+  Auxiliary Fn for all Test Cases.
+ 
+  The method initiates all tests to be performed.
+ 
+*/
+void CT_OOMStep::DoStepTests()
+{
+	__UHEAP_MARK;
+	
+	INFO_PRINTF1(_L("About to test OOM resilience"));
+	TRAPD(r,TestOOMConstructionL());
+		TEST(r==KErrNone);
+	__UHEAP_MARKEND;
+	
+ 	__UHEAP_MARK;
+	INFO_PRINTF1(_L("About to test door OOM resilience"));
+	TRAP(r,TestDoorOOML());
+		TEST(r==KErrNone);
+	__UHEAP_MARKEND;
+}
+
+TInt CT_OOMStepCallBack::CallBack(TAny* callBack/*aThis*/)
+/**
+  This static method is the callback function of CIdle object. The method
+  calls the non-static method DoStepTests() which initiates all the tests. 
+*/
+	{
+
+	//Do Tests.
+	((CT_OOMStepCallBack *)callBack)->iTestStep->DoStepTests();
+
+	CActiveScheduler::Stop();
+	return EFalse; // don't call back again
+	}
+
+
+
+
+CT_OOMStep::~CT_OOMStep()
+/**
+   Destructor
+ */
+	{
+	}
+
+CT_OOMStep::CT_OOMStep()
+/**
+   Constructor
+ */
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_OOMStep);
+	}
+
+TVerdict CT_OOMStep::doTestStepPreambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	SetTestStepResult(EPass);
+	return TestStepResult();
+	}
+
+TVerdict CT_OOMStep::doTestStepPostambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	return TestStepResult();
+	}
+
+TVerdict CT_OOMStep::doTestStepL()
+/**
+  @return - TVerdict code
+  Override of base class virtual
+*/
+{
+	INFO_PRINTF1(_L("Testing Apparch...OOM tests"));
+	//
+	// set up an fbs
+	FbsStartup();
+	//
+	// set up the directory structure
+	iFs.Connect();
+	setup();
+	//
+	// run the testcode
+
+	TRAPD(ret,DoTestsInCallBackL())
+		TEST(ret==KErrNone);
+	
+	iFs.Close();
+	return TestStepResult();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_OOMStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,67 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file 
+ @internalComponent - Internal Symbian test code  
+*/
+
+#if (!defined __T_OOM_STEP_H__)
+#define __T_OOM_STEP_H__
+
+#include "ApparcTestServer.h"
+
+//!  A CT_OOMStep test class. 
+
+/**  Performs the Out of Memory Tests. */
+
+class CT_OOMStep : public CTestStep
+	{
+public:
+	CT_OOMStep();
+	~CT_OOMStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+	void DoStepTests();
+
+//private:
+	CApaDocument* CreateTestDocL(CApaProcess* aProcess);
+	void CreateTestDocFileL();
+	void TestOOMConstructionL();
+	void TestDoorOOML();
+	void DoTestsInCallBackL();
+	void setup();
+	
+private:
+	RFs iFs;
+	};
+
+class CT_OOMStepCallBack : public CBase
+	{
+public:
+	CT_OOMStepCallBack(CT_OOMStep* aTestStep);
+	~CT_OOMStepCallBack();
+	static TInt CallBack(TAny* aThis);
+	CT_OOMStep* iTestStep;
+	};
+
+
+
+_LIT(KT_OOMStep,"T_OOM");
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_ProStep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1548 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Tests Application Apparc base classes and utility functions to get application's data.\n
+// 
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <f32file.h>
+#include <fbs.h>
+#include <s32std.h> 
+#include <s32stor.h> 
+#include <s32file.h> 
+#include <ecom.h>
+
+#include <apaid.h>
+#include "..\apparc\apadll.h"
+#include "..\apgrfx\apgstd.h"
+#include <apgaplst.h>
+#include <apgicnfl.h>
+#include <apgdoor.h>
+#include <apfrec.h>
+#include <apfctlf.h>
+#include <apgctl.h>
+#include <apgaplst.h>
+#include <apaflrec.h>
+#include "testableapalssession.h"
+#include <apacmdln.h>
+
+#include "T_ProStep.h"
+#include "tstapp.h"
+#include <appfwk_test_utils.h>
+
+#if !defined(__E32TEST_H__)
+#include <e32test.h>
+#endif
+
+TInt PanicTestThread(TAny* aOption);
+
+enum TPanicOption 
+	{
+	EFirst,
+	ENegativePanicTest,
+	EUnknownPanicOption,	
+	ELast
+	};
+
+
+_LIT(KCTLDIR,"C:\\private\\10003a3f\\import\\apps\\");
+_LIT(KSOURCEPATH,"z:\\private\\10003a3f\\import\\apps\\m_ctrl_reg.rsc");
+_LIT(KNEWCTLPATH,"C:\\private\\10003a3f\\import\\apps\\m_ctrl_reg.rsc");
+_LIT(KNEWPATH,"C:\\cm.txt");
+_LIT(KEMPTYFILEPATH,"z:\\system\\data\\Testpath\\FilterTests\\testfile1.txt");
+
+_LIT(KRSCDIR,"C:\\Resource\\apps\\");
+_LIT(KLOCPATH,"z:\\Resource\\apps\\M_ctrl_loc.rsc");
+_LIT(KNEWLOCPATH,"C:\\Resource\\apps\\M_ctrl_loc.rsc");
+_LIT(KCTRLNAME,"C:\\sys\\bin\\m_ctrl.exe");
+TFileName ctlPath=_L("z:\\sys\\bin\\m_ctrl.exe");
+
+
+LOCAL_D TInt SimulateKeyL(TAny*)
+	{
+	User::After(3000000);
+	RWsSession session;
+	User::LeaveIfError(session.Connect());	
+
+	//control down
+	TRawEvent rawEvent;
+	rawEvent.Set(TRawEvent::EKeyDown,EStdKeyLeftCtrl);
+	session.SimulateRawEvent(rawEvent);
+
+	// e down
+	rawEvent.Set(TRawEvent::EKeyDown,'E');
+	session.SimulateRawEvent(rawEvent);
+
+	// e up
+	rawEvent.Set(TRawEvent::EKeyUp,'E');
+	session.SimulateRawEvent(rawEvent);
+
+	//control up
+	rawEvent.Set(TRawEvent::EKeyUp,EStdKeyLeftCtrl);
+	session.SimulateRawEvent(rawEvent);
+
+	session.Flush();
+	session.Close();
+	
+	return KErrNone;
+	}
+
+void CT_ProStep::setup()
+	{
+#if defined(__EPOC32__)
+	TFullName filePath=_L("c:\\docs\\tstapp.doc");
+	TFullName tempPath=_L("c:\\system\\temp\\");
+	// if we're on the rack create the directories we need
+	TParse parser;
+	parser.Set(filePath,NULL,NULL);
+	iFs.MkDirAll(parser.DriveAndPath());
+	parser.Set(tempPath,NULL,NULL);
+	iFs.MkDirAll(parser.DriveAndPath());
+#endif
+	}
+
+
+/**
+   @SYMTestCaseID T-ProStep-testAppIdentifierL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Tests TApaAppIdentifier API.
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Create a temporary store. Construct an application identifier
+   for the specified application DLL, and Uid. Call WriteAppIdentifierL() to
+   store application identifier details. Read the stored application identifier
+   details.\n
+   API Calls:\n	
+   TApaAppIdentifier::TApaAppIdentifier(TUid aAppUidType,const TFileName& aDllName)\n
+   CApaProcess::WriteAppIdentifierL(CStreamStore& aStore,CStreamDictionary& aStreamDic,const TApaAppIdentifier& aAppId)\n
+   CApsProcess::ReadAppIdentifierL(const CStreamStore& aStore,const CStreamDictionary& aStreamDic)\n
+  
+   @SYMTestExpectedResults Test checks whether stored and read application
+   identifier details match.
+   
+ */
+void CT_ProStep::testAppIdentifierL()
+	{
+	const TFullName tempPath=_L("c:\\system\\temp\\");
+	const TUid testUid={1};
+
+	INFO_PRINTF1(_L("Testing TApaAppIdentifier"));
+	
+	// create a process
+	TRAPD(ret,iProcess = CApaProcess::NewL(iFs));	
+	TEST(ret==KErrNone);
+	
+	// create a temporary store and stream dictionary
+	TParse newFilePath;
+	HBufC* related = HBufC::NewL(20);
+	(*related)=_L("temp.idf");
+	newFilePath.Set(tempPath,related,NULL);
+	delete related;
+	iFs.MkDirAll(newFilePath.DriveAndPath());
+	CDirectFileStore* store = CDirectFileStore::ReplaceLC(iFs,newFilePath.FullName(),EFileWrite);
+	store->SetTypeL(TUidType(KDirectFileStoreLayoutUid,testUid,testUid));
+	CStreamDictionary* streamDic=CStreamDictionary::NewL();
+	CleanupStack::PushL(streamDic);
+
+	// set up an id
+	TApaAppIdentifier* origId=new(ELeave) TApaAppIdentifier (testUid,_L("FileName"));
+	CleanupStack::PushL(origId);
+
+	// write it out and read it in again
+	iProcess->WriteAppIdentifierL(*store,*streamDic,*origId);
+	TApaAppIdentifier* copyId=new(ELeave) TApaAppIdentifier();
+	*copyId=iProcess->ReadAppIdentifierL(*store,*streamDic);
+	
+	CleanupStack::PushL(copyId);
+	TEST((origId->iAppUid==copyId->iAppUid));
+	TEST((origId->iFullName==copyId->iFullName));
+		
+	// tidy up
+	CleanupStack::PopAndDestroy(4); // store,streamDic,origId,copyId
+	delete iProcess;
+	iFs.Delete(newFilePath.FullName());
+	}
+
+
+/**
+   @SYMTestCaseID T-ProStep-doTestGenerateFileName
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Tests CApaApplication::GenerateFileName().
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call GenerateFileName() under following scenarios:\n
+   (1) when root name doesn't exist\n
+   (2) when root name exists\n
+   (3) when illegal paths are mentioned.\n
+   (4) when no memory is available to perfom the operation.\n
+   API Calls:\n	
+   CApaApplication::GenerateFileName(RFs& aFs,TFileName& aRootName)\n
+   
+   @SYMTestExpectedResults Test should return the desired filename or error
+   code for each scenario
+   
+ */
+void CT_ProStep::doTestGenerateFileName()
+	{
+	TFileName rootName;
+
+	// delete the test files just in case...
+	iFs.Delete(_L("c:\\path\\name"));
+	iFs.Delete(_L("c:\\path\\name.ext"));
+
+	// try it with a root that doesn't exist
+	rootName = _L("c:\\path\\name");
+	TInt ret=CApaApplication::GenerateFileName(iFs,rootName);
+	TEST(ret==KErrNone);
+	TEST(rootName.CompareF(_L("c:\\path\\name"))==0);
+
+	// try it with a root (inc ext) that doesn't exist
+	rootName = _L("c:\\path\\name.ext");
+	ret=CApaApplication::GenerateFileName(iFs,rootName);
+	TEST(ret==KErrNone);
+	TEST(rootName.CompareF(_L("c:\\path\\name.ext"))==0);
+
+	// create a couple of files
+	RFile file;
+	file.Create(iFs,_L("c:\\path\\name"),EFileWrite);
+	file.Close();
+	file.Create(iFs,_L("c:\\path\\name.ext"),EFileWrite);
+	// file.Close(); // purposely don't close this one
+
+	// try it with a root that exists
+	rootName = _L("c:\\path\\name");
+	ret=CApaApplication::GenerateFileName(iFs,rootName);
+	TEST(ret==KErrNone);
+	TEST(rootName.CompareF(_L("c:\\path\\name(01)"))==0);
+
+	// try it with a root (inc ext) that exists
+	rootName = _L("c:\\path\\name.ext");
+	ret=CApaApplication::GenerateFileName(iFs,rootName);
+	TEST(ret==KErrNone);
+	TEST(rootName.CompareF(_L("c:\\path\\name(01).ext"))==0);
+
+	// try with illegal paths
+	rootName = _L("c:name");
+	ret=CApaApplication::GenerateFileName(iFs,rootName);
+	TEST((ret==KErrArgument));
+	rootName = _L("\\dir\\name");
+	ret=CApaApplication::GenerateFileName(iFs,rootName);
+	TEST((ret==KErrArgument));
+	rootName = _L("c:\\dir\\");
+	ret=CApaApplication::GenerateFileName(iFs,rootName);
+	TEST((ret==KErrBadName));
+
+	// try when no memory is available to perform the operation. 
+	// 	(we haven't used a conventional OOM loop, but this is not a leaving function)
+	__UHEAP_MARK;
+	__UHEAP_SETFAIL(RHeap::EDeterministic,1);
+	rootName = _L("c:\\path\\nomemory.ext");
+	ret=CApaApplication::GenerateFileName(iFs,rootName);
+	TEST(ret==KErrNoMemory);
+	__UHEAP_MARKEND;
+	__UHEAP_RESET;
+
+	// tidy up
+	file.Close();
+	iFs.Delete(_L("c:\\path\\name"));
+	iFs.Delete(_L("c:\\path\\name.ext"));
+	
+	}
+
+/**
+   @SYMTestCaseID APPFWK-APPARC-0055
+  
+   @SYMDEF DEF092509
+  
+   @SYMTestCaseDesc Tests CApaProcess::ReadRootStreamLC ().
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call ReadRootStreamLC() under following scenarios:\n
+   (1) when File name Doesnt Exists\n
+   (2) When an empty file is present \n
+ 
+   
+   
+   @SYMTestExpectedResults Test should return  KErrNotFound for scenario (1). And  error 
+   KErrEof orKErrCorrupt for scenario (2).
+      
+ */
+ 
+ void CT_ProStep::testReadStreamL()
+
+	{
+	CFileStore* docStore=NULL;
+	TUint appFileMode=EFileRead|EFileWrite;
+	CStreamDictionary* streamDic=NULL;
+	TRAPD(err,streamDic=CApaProcess::ReadRootStreamLC(iFs,docStore,KNEWPATH,appFileMode));
+	TEST(err==KErrNotFound);
+
+	delete docStore;
+	delete streamDic;
+	docStore=NULL;
+	streamDic=NULL;
+	appFileMode=EFileRead;
+	TRAP(err,streamDic=CApaProcess::ReadRootStreamLC(iFs,docStore,KEMPTYFILEPATH,appFileMode));
+	TEST(err==KErrCorrupt || err==KErrEof); 
+	}
+/**
+   @SYMTestCaseID T-ProStep-testDocCreation1L
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Tests CApaProcess::AddNewDocumentL().
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Create a process, call AddNewDocumentL() to create a new
+   document for an app DLL by\n
+   (1) passing full path of app.\n
+   (2) passing full path of app and the Uid.\n
+   In both cases call DestroyDocument() to destroy the document thus created.\n
+   API Calls:\n	
+   CApaProcess::NewL(const RFs& aFs,CApaAppFinder& aAppFinder)\n
+   CApaProcess::AddNewDocumentL(const TDesC& aDllFileName,TUid aDllUid=KNullUid)\n
+   CApaProcess::DestroyDocument(CApaDocument* aDoc)\n
+   CApaProcess::ResetL()\n
+   
+   @SYMTestExpectedResults Test checks results against expected values.
+   
+ */
+void CT_ProStep::testDocCreation1L()
+	{
+	const TFullName filePath=_L("c:\\docs\\tstapp.doc");
+
+	INFO_PRINTF1(_L("Testing CApaProcess"));
+
+	iFs.MkDirAll(filePath);
+	// delete the file to be created by the testcode
+	iFs.Delete(filePath);
+
+	// create a process
+	TRAPD(ret,iProcess = CApaProcess::NewL(iFs));
+	TEST(ret==KErrNone);
+
+	// create a new doc passing the full path of the app dll
+	CApaDocument* doc=NULL;
+	TApaApplicationFactory appFact(KUidTestApp);
+	TRAP(ret,doc=iProcess->AddNewDocumentL(appFact));
+	TEST(ret==KErrNone);
+	iProcess->DestroyDocument(doc);
+	doc = NULL;
+	TRAP(ret,iProcess->ResetL());
+	TEST(ret==KErrNone);
+	}
+
+
+/**
+   @SYMTestCaseID T-ProStep-testDocCreation2L
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Tests CApaProcess::AddNewDocumentL().
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call AddNewDocumentL() to create a new document for an app DLL.
+   Set it as the main document. Associate it with a temporary store. Initialize
+   the document to default settings. Store the document.\n
+   API Calls:\n	
+   CApaProcess::AddNewDocumentL(const TDesC& aDllFileName,TUid aDllUid=KNullUid)\n
+   CApaDocument::NewDocumentL()\n
+   CApaDocument::SaveL()\n
+   
+   @SYMTestExpectedResults Test checks results against expected values.
+   
+ */
+void CT_ProStep::testDocCreation2L()
+	{
+	const TFullName filePath=_L("c:\\docs\\tstapp.doc");
+	CApaDocument* doc=NULL;
+	
+	TApaApplicationFactory appFact(KUidTestApp);
+	TRAPD(ret,doc=iProcess->AddNewDocumentL(appFact));
+	TEST(ret==KErrNone);
+	iProcess->SetMainDocument(doc);
+	CFileStore* store=NULL;
+
+	// create the store and initialise it
+	TRAP(ret, {
+		store=doc->CreateFileStoreLC(iProcess->FsSession(),filePath);
+		CleanupStack::Pop(); // store 
+		});
+	TEST(ret==KErrNone);
+	((CTestAppDoc*)iProcess->MainDocument())->iStore = store;
+	iProcess->SetMainDocFileName(filePath);
+
+	// initialise the document with factory settings
+	TRAP(ret, doc->NewDocumentL() );
+	TEST(ret==KErrNone);
+
+	// close it 
+	TRAP(ret,doc->SaveL());
+	TEST(ret==KErrNone);
+	TRAP(ret, iProcess->ResetL() );
+	TEST(ret==KErrNone);
+	store = NULL;
+	doc = NULL;
+	}
+
+/**
+   @SYMTestCaseID T-ProStep-testDocCreation3L
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Tests CApaProcess::OpenNewDocumentL() and CApaAppFileReader APIs.
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Create a document from a specified file. Set it as main
+   document file. Create a CApaAppInfoFileReader object by calling
+   OpenAppInfoFileL(). Use CaptionL() and CreateMaskedBitmapL() to read
+   application information like caption and bitmap.\n
+   API Calls:\n	
+   CApaProcess::OpenNewDocumentL(CFileStore*& aStore,CStreamDictionary*& aStreamDic,const TDesC& aDocFullFileName,TUint aFileMode);\n
+   CApaApplication::OpenAppInfoFileL() const\n
+   CApaAppInfoFileReader::CaptionL(TLanguage aLanguage)\n
+   CApaAppInfoFileReader::CreateMaskedBitmapL(TInt aIconSideInPixels)\n
+   
+   @SYMTestExpectedResults Test checks results against expected values.
+    
+ */
+CApaDocument* CT_ProStep::testDocCreation3L()
+	{
+	// try re-opening it
+	const TFullName filePath=_L("c:\\docs\\tstapp.doc");
+	CStreamDictionary* streamDic=NULL;
+	CApaDocument* doc=NULL;
+	CFileStore* store=NULL;
+	TRAPD(ret,doc=iProcess->OpenNewDocumentL(store,streamDic,filePath,EFileShareExclusive|EFileWrite));
+	TEST(ret==KErrNone);
+	delete streamDic;
+	streamDic = NULL;
+	iProcess->SetMainDocument(doc);
+	iProcess->SetMainDocFileName(filePath);
+	((CTestAppDoc*)iProcess->MainDocument())->iStore = store;
+
+	// remove the main document
+	iProcess->DestroyDocument(iProcess->MainDocument());
+	TEST(iProcess->MainDocument()==NULL);
+
+	// try re-opening the doc without the app in memory
+	TRAP(ret,iProcess->ResetL());
+	TEST(ret==KErrNone);
+	delete iProcess;
+	return doc;
+	}
+
+
+/**
+   @SYMTestCaseID T-ProStep-testDocCreation4L
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Tests CApaProcess::OpenNewDocumentL(). 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Create a Process. Create a document for an app DLL from a 
+   specified file by calling OpenNewDocumentL(). Call DestroyDocument() to
+   delete the document.\n
+   API Calls:\n	
+   CApaProcess::OpenNewDocumentL(CFileStore*& aStore,CStreamDictionary*& aStreamDic,const TDesC& aDocFullFileName,TUint aFileMode);\n
+   CApaProcess::DestroyDocument(CApaDocument* aDoc)\n
+   
+   @SYMTestExpectedResults Test checks results against expected values.
+    
+ */
+void CT_ProStep::testDocCreation4L(CApaDocument* aDoc)
+	{
+	const TFullName filePath=_L("c:\\docs\\tstapp.doc");
+	CStreamDictionary* streamDic=NULL;
+	CFileStore* store=NULL;
+	TRAPD(ret,iProcess = CApaProcess::NewL(iFs));
+	TEST(ret==KErrNone);
+	TRAP(ret,aDoc=iProcess->OpenNewDocumentL(store,streamDic,filePath,EFileShareExclusive|EFileWrite));
+	TEST(ret==KErrNone);
+	iProcess->DestroyDocument(aDoc);
+	delete store;
+	delete streamDic;
+
+	// tidy up
+	TRAP(ret,iProcess->ResetL());
+	TEST(ret==KErrNone);
+	delete iProcess;
+
+	// delete the file created by the testcode
+	iFs.Delete(filePath);
+	}
+
+
+/**
+  Auxiliary Fn for Test Case ID T-ProStep-testDocCreation1L, T-ProStep-testDocCreation2L,
+  T-ProStep-testDocCreation3L, T-ProStep-testDocCreation4L.
+ 
+  The method initiates tests on operation such as creation, storing
+  and deletion of a document.
+  
+*/
+void CT_ProStep::testDocCreationL()
+	{
+	//Create a session with F & B server
+	TInt ret = RFbsSession::Connect();
+	TEST(ret == KErrNone);
+
+	testDocCreation1L();
+	testDocCreation2L();
+	testDocCreation4L(testDocCreation3L());
+
+	//Close the session F & B server.
+	RFbsSession::Disconnect();
+	}
+
+/**
+   @SYMTestCaseID T-ProStep-testEmbeddingL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Tests embedding of a document and accessing the embedded document.
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions The test connects to the Font and Bitmap Server and creates a
+   process by calling CApaProcess::NewL().
+   The method first tests the embedding of document. To do so a document of
+   type tstapp is added to the process and set as the main document. The main
+   document is opened for editing by calling CApaDocument::EditL() and another
+   document of type tstapp is created to embed it within the main document.
+   Tests for the number of embedded documents and editing of the embedded
+   document is done. The main document is closed and then reloaded to verify
+   that the embedded document is saved.\n
+   A test to access the embedded document is then done. For this purpose the
+   main document is detached from its store by calling CApaDocument::DetachFromStoreL()
+   and an attempt to access the embedded document is done by calling CApaDocument::DocumentL().
+   The same test to access the embedded document is again done by reloading
+   the main document without detaching it from its store.\n
+   Finally embedded document is tested to change the format of the door to
+   glass by calling CApaDoor::SetFormatToGlassL(). The test ensures that the
+   embedded document does not support being represented by a glass door by
+   checking for leave KErrNotSupported.\n Then the same embedded document is supported when being 
+   called by CApaDoor::SetFormatToIconL() and returns KErrNone.
+   API Calls:\n	
+   CApaProcess::NewL(const RFs& aFs,CApaAppFinder& aAppFinder)\n
+   CApaProcess::AddNewDocumentL(const TDesC& aDllFileName,TUid aDllUid=KNullUid)\n
+   CApaDocument::EditL(MApaEmbeddedDocObserver* aContainer,TBool aReadOnly=EFalse) = 0\n
+   CApaDocument::DetachFromStoreL(CPicture::TDetach aDegree = CPicture::EDetachFull)\n
+   CApaDoor::DocumentL(TBool aCheckPassword=EFalse)\n
+   CApaDoor::SetFormatToGlassL()\n
+   CApaDoor::SetFormatToIconL()\n
+   
+   @SYMTestExpectedResults All tests completes successfully by checking the
+   results obtained against expected results.
+    
+ */
+void CT_ProStep::testEmbeddingL()
+	{
+	const TFullName filePath=_L("c:\\docs\\tstapp.doc");
+
+	//Create a session with F & B server
+	TInt ret=RFbsSession::Connect();
+	TEST(ret == KErrNone);
+	
+	// delete the file to be created by the testcode
+	iFs.Delete(filePath);
+	// create a process
+	TRAP(ret,iProcess = CApaProcess::NewL(iFs));	
+	TEST(ret==KErrNone);
+
+	// create a new main doc of type tstapp
+	CApaDocument* doc=NULL;	
+	TApaApplicationFactory appFact(KUidTestApp);
+	TRAP(ret,doc=iProcess->AddNewDocumentL(appFact));
+	TEST(ret==KErrNone);
+	iProcess->SetMainDocument(doc);
+	CFileStore* store=NULL;
+
+	// create the store and initialise it
+	TRAP(ret, {
+		store=doc->CreateFileStoreLC(iProcess->FsSession(),filePath);
+		CleanupStack::Pop(); // store 
+		});
+	TEST(ret==KErrNone);
+	((CTestAppDoc*)iProcess->MainDocument())->iStore = store;
+	iProcess->SetMainDocFileName(filePath);
+	
+	// initialise the document with factory settings
+	TRAP(ret, doc->NewDocumentL() );
+	TEST(ret==KErrNone);
+
+	// edit it
+	TRAP(ret,iProcess->MainDocument()->EditL(NULL));
+	TEST(ret==KErrNone);
+
+	// embed another tstapp doc inside it
+	INFO_PRINTF1(_L("...Embed a doc"));
+	TRAP(ret,((CTestAppDoc*)iProcess->MainDocument())->EmbedNewDocL(appFact));
+	TEST(ret==KErrNone);
+	TEST(((CTestAppDoc*)iProcess->MainDocument())->iEmbedList->Count()==1);
+
+	// edit that doc
+	TRAP(ret,((CTestAppDoc*)iProcess->MainDocument())->EditEmbeddedDocL(0));
+	TEST(ret==KErrNone);
+
+	// close the main doc and reload it
+	TRAP(ret,iProcess->MainDocument()->SaveL());
+	TEST(ret==KErrNone);
+	TRAP(ret, iProcess->ResetL() );
+	TEST(ret==KErrNone);
+	CStreamDictionary* streamDic=NULL;
+	TRAP(ret,doc=iProcess->OpenNewDocumentL(store,streamDic,filePath,EFileShareExclusive|EFileWrite));
+	TEST(ret==KErrNone);
+	delete streamDic;
+	streamDic = NULL;
+	iProcess->SetMainDocument(doc);
+	iProcess->SetMainDocFileName(filePath);
+	((CTestAppDoc*)iProcess->MainDocument())->iStore = store;
+	TEST(((CTestAppDoc*)iProcess->MainDocument())->iEmbedList->Count()==1);
+
+	// close the main doc and reload it again...
+	TRAP(ret,iProcess->MainDocument()->SaveL());
+	TEST(ret==KErrNone);
+	iProcess->ResetL();
+	TRAP(ret,doc=iProcess->OpenNewDocumentL(store,streamDic,filePath,EFileShareExclusive|EFileWrite));
+	TEST(ret==KErrNone);
+	delete streamDic;
+	streamDic = NULL;
+	iProcess->SetMainDocument(doc);
+	iProcess->SetMainDocFileName(filePath);
+	((CTestAppDoc*)iProcess->MainDocument())->iStore = store;
+	TEST(((CTestAppDoc*)iProcess->MainDocument())->iEmbedList->Count()==1);
+
+	// detach the main doc from it's store & access the embedded doc
+	TRAP(ret, iProcess->MainDocument()->DetachFromStoreL(CPicture::EDetachFull) );
+	TEST(ret==KErrNone);
+	TRAP(ret, ((CTestAppDoc*)iProcess->MainDocument())->EmbeddedDoor(0)->DocumentL() );
+	TEST(ret==KErrNone);
+
+	// save it, then save it again immediately
+	TRAP(ret,iProcess->MainDocument()->SaveL());
+	TEST(ret==KErrNone);
+	TRAP(ret,iProcess->MainDocument()->SaveL());
+	TEST(ret==KErrNone);
+
+	// load the doc and get a handle to the embedded doc
+	iProcess->ResetL();
+	TRAP(ret,doc=iProcess->OpenNewDocumentL(store,streamDic,filePath,EFileShareExclusive|EFileWrite));
+	TEST(ret==KErrNone);
+	delete streamDic;
+	streamDic = NULL;
+	iProcess->SetMainDocument(doc);
+	iProcess->SetMainDocFileName(filePath);
+	((CTestAppDoc*)iProcess->MainDocument())->iStore = store;
+	TEST(((CTestAppDoc*)iProcess->MainDocument())->iEmbedList->Count()==1);
+	TRAP(ret, ((CTestAppDoc*)iProcess->MainDocument())->EmbeddedDoor(0)->DocumentL() );
+	TEST(ret==KErrNone);
+
+	// try to set the embedded doc's format to glass
+	TRAP(ret, ((CTestAppDoc*)iProcess->MainDocument())->EmbeddedDoor(0)->SetFormatToGlassL() );
+	TEST((ret==KErrNotSupported));
+	
+	// try to set the embedded docs to temporary Icon 	
+	TRAP(ret, ((CTestAppDoc*)iProcess->MainDocument())->EmbeddedDoor(0)->SetFormatToTemporaryIconL(ETrue) );
+	TEST((ret==KErrNone));
+	
+	// try to set embedded doc's format to Icon
+	TRAP(ret, ((CTestAppDoc*)iProcess->MainDocument())->EmbeddedDoor(0)->SetFormatToIconL() );
+	TEST((ret==KErrNone));
+
+	// tidy up and delete the file created by the testcode
+	delete iProcess;
+	iFs.Delete(filePath);
+
+	//Close the session F & B server.
+	RFbsSession::Disconnect();
+	}
+
+_LIT(KMaxLengthDocFileName, "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"); // length must be equal to KMaxFileName
+
+void CT_ProStep::MainDocFileNameTestsL()
+	{
+	testMainDocFileName1L();
+ 	testMainDocFileName2L();
+ 	testMainDocFileName3L();
+	}
+ /**
+   @SYMTestCaseID CT-ProStep-testMainDocFileName1L
+   
+   @SYMPREQ PHAR-5NTCWY
+   
+   @SYMTestCaseDesc
+   Checks that the CApaProcess's MainDocFileName is large enough by default.
+   Clients of CApaProcess::SetMainDocFileName API expect to be able to
+   pass it a descriptor with a length between zero and KMaxFileName inclusive.
+   Check that passing a descriptor of length KMaxFileName doesn't give an
+   APPARC 7 panic (EPanicFileNameTooLong)
+   
+   @SYMTestPriority High
+   
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions
+   Construct a CApaProcess object, and call SetMainDocFileName on it, passing
+   a file name KMaxFileName characters long
+   
+   @SYMTestExpectedResults
+   The call to CApaProcess::SetMainDocFileName should not cause a panic
+   
+ */
+void CT_ProStep::testMainDocFileName1L()
+  	{
+ 	CApaProcess* process = CApaProcess::NewL(iFs);
+ 	process->SetMainDocFileName(KMaxLengthDocFileName); // should not panic
+ 	delete process;
+  	}
+ 
+ /**
+   @SYMTestCaseID CT-ProStep-testMainDocFileName2L
+   
+   @SYMPREQ PHAR-5NTCWY
+   
+   @SYMTestCaseDesc
+   Checks that the maximum length of CApaProcess's MainDocFileName is still large
+   enough to store a file name KMaxFileName characters long after setting a file name using
+   CApaProcess::SetMainDocFileNameL which is less than KMaxFileName characters long
+   
+   @SYMTestPriority High
+   
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions
+   1. Construct a CApaProcess object, and call SetMainDocFileNameL on it, passing
+   a file name which is less than KMaxFileName characters long
+   2. Call SetMainDocFileName passing a file name which is KMaxFileName characters long
+   
+   @SYMTestExpectedResults
+   The call to CApaProcess::SetMainDocFileName should not cause a panic
+   
+ */
+void CT_ProStep::testMainDocFileName2L()
+ 	{
+ 	_LIT(KShortDocFileName, "ShortDocumentFileName"); // must be < KMaxFileName in length
+ 	CApaProcess* process = CApaProcess::NewL(iFs); 
+ 	CleanupStack::PushL(process);
+ 	process->SetMainDocFileNameL(KShortDocFileName);
+ 	process->SetMainDocFileName(KMaxLengthDocFileName); // should not panic
+ 	CleanupStack::PopAndDestroy(process);
+ 	}
+
+ /**
+   @SYMTestCaseID CT-ProStep-testMainDocFileName3L
+  
+   @SYMPREQ PHAR-5NTCWY
+  
+   @SYMTestCaseDesc
+   Checks that CApaProcess's MainDocFileName can store a filename longer than KMaxFileName
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   1. Construct a CApaProcess object, and call SetMainDocFileNameL on it, passing
+   a file name which is greater than KMaxFileName characters long
+   2. Check the length of the file name returned by MainDocFileName
+  
+   @SYMTestExpectedResults
+   The file name returned by MainDocFileName should be the same length as the file name
+   passed to SetMainDocFileNameL
+  
+ */
+void CT_ProStep::testMainDocFileName3L()
+	{
+	_LIT(KLongDocFileName, "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefLong"); // must be > KMaxFileName in length
+	TPtrC longDocFileName(KLongDocFileName);
+	CApaProcess* process = CApaProcess::NewL(iFs); 
+	CleanupStack::PushL(process);
+	process->SetMainDocFileNameL(longDocFileName);
+	TEST(process->MainDocFileName().Length() == longDocFileName.Length());
+	CleanupStack::PopAndDestroy(process);
+	}
+
+/**
+   @SYMTestCaseID T-ProStep-testIniFilesL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Tests creation of ini file and reading or writing of data to an ini file. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Create a Process. Add a new document for an app DLL by calling
+   AddNewDocumentL().Create a store and initialize the document. Create
+   an .ini file by calling OpenIniFileLC().Write data to ini file using
+   RDictionaryWriteStream. Save changes by calling CDictionaryStore::CommitL()
+   and close the ini file. Re-open the ini file and read data from it using
+   RDictionaryReadStream.\n
+   API Calls:\n	
+   CApaApplication::OpenIniFileLC(RFs& aFs) \n
+   RDictionaryWriteStream::AssignL(CDictionaryStore& aDictStore,TUid aUid)\n
+   RDictionaryWriteStream::WriteInt8L(TInt aValue)\n
+   RDictionaryWriteStream::CommitL()\n
+   CDictionaryStore::CommitL()\n
+   RDictionaryReadStream::OpenL(const CDictionaryStore& aDictStore,TUid aUid)\n
+   RDictionaryReadStream::ReadInt8L()\n
+   
+   @SYMTestExpectedResults Test checks whether stored and read values from the
+   ini file match. 
+ */
+void CT_ProStep::testIniFilesL()
+	{
+	TFullName filePath=_L("c:\\docs\\tstapp.doc");
+	const TFullName iniPath=_L("c:\\system\\data\\tstapp.ini");		// defined in tstapp
+	const TUid testUid={1};
+
+	// delete the files to be created by the testcode
+	iFs.Delete(filePath);
+	iFs.Delete(iniPath);
+	// create a process
+	TRAPD(ret,iProcess = CApaProcess::NewL(iFs));
+	TEST(ret==KErrNone);
+
+	// create a new main doc of type tstapp
+	CApaDocument* doc=NULL;
+	TApaApplicationFactory appFact(KUidTestApp);
+	TRAP(ret,doc=iProcess->AddNewDocumentL(appFact));
+	TEST(ret==KErrNone);
+	iProcess->SetMainDocument(doc);
+	CFileStore* store=NULL;
+
+	// create the store and initialise it
+	TRAP(ret, {
+		store=doc->CreateFileStoreLC(iProcess->FsSession(),filePath);
+		CleanupStack::Pop(); // store 
+		});
+	TEST(ret==KErrNone);
+	((CTestAppDoc*)iProcess->MainDocument())->iStore = store;
+	iProcess->SetMainDocFileName(filePath);
+
+	// initialise the document with factory settings
+	TRAP(ret, doc->NewDocumentL() );
+	TEST(ret==KErrNone);
+
+	// create a new ini file for the app
+	CDictionaryStore* iniFile=NULL;
+	TRAP(ret, {
+		iniFile=iProcess->MainDocument()->Application()->OpenIniFileLC(iFs);
+		CleanupStack::Pop();
+		});
+		TEST(ret==KErrNone);
+
+	// add some data to it
+	RDictionaryWriteStream writeStream;
+	TRAP(ret, writeStream.AssignL(*iniFile,testUid) );
+	TEST(ret==KErrNone);
+	TInt data=17;
+	TRAP(ret, writeStream.WriteInt8L(data) );
+	TEST(ret==KErrNone);
+	TRAP(ret, writeStream.CommitL() );
+	TEST(ret==KErrNone);
+	writeStream.Close();
+
+	// close it
+	TRAP(ret, iniFile->CommitL() );
+	TEST(ret==KErrNone);
+	delete iniFile;
+	iniFile = NULL;
+
+	// re-open it
+	TRAP(ret, {
+		iniFile=iProcess->MainDocument()->Application()->OpenIniFileLC(iFs);
+		CleanupStack::Pop();
+		});
+		TEST(ret==KErrNone);
+
+	// check the contents
+	RDictionaryReadStream readStream;
+	TRAP(ret, readStream.OpenL(*iniFile,testUid) );
+	TEST(ret==KErrNone);
+	TInt check=0;
+	TRAP(ret, check=readStream.ReadInt8L() );
+	TEST(ret==KErrNone);
+	TEST(check==data);
+	readStream.Close();
+
+	// close it
+	delete iniFile;
+
+	// tidy up
+	delete iProcess;
+	iFs.Delete(filePath);
+	iFs.Delete(iniPath);
+	}
+
+/**
+  Auxiliary Fn for Test Case ID T-ProStep-testControls1L,
+  T-ProStep-testControls2L, T-ProStep-testControls3L
+ 
+  The method finds the index of control m_ctrl.exe in the control list.
+  Depending on the Boolean value of argument aIsNewPath the search is
+  done on ROM / RAM.\n
+ 
+*/
+
+TInt CT_ProStep::ControlIndexInList(CApaSystemControlList* aList, TBool aIsNewPath)
+	{
+	TFileName newCtlPath=_L("c:\\sys\\bin\\m_ctrl.exe");
+
+	const TInt count = aList->Count();
+	TInt retVal = KErrNotFound;
+	for(TInt ii = 0; ii < count; ++ii)
+		{
+		if(((aList->Control(ii)->FileName().CompareF(ctlPath)==0) && (!aIsNewPath)) ||
+			((aList->Control(ii)->FileName().CompareF(newCtlPath)==0) && (aIsNewPath)))
+			{
+			retVal = ii;
+			break;
+			}
+		}
+	return retVal;
+	}
+
+
+/**
+   @SYMTestCaseID T-ProStep-testControls1L
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Tests CApaSystemControlList::UpdateL().
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Check the control list to find the number of controls in the
+   list and the number of updates to the list. Call UpdateL(). Check the list
+   again for no change in the count of controls and updates to the list.\n
+   API Calls:\n	
+   CApaSystemControlList::UpdateL()\n
+   
+   @SYMTestExpectedResults Test confirms that there is no change in the control
+   list after updating.
+ */
+void CT_ProStep::testControls1L()
+	{
+	iControlCount1 = iControlList->Count();
+	TEST((iControlCount1>=1));
+	TEST((iControlList->UpdateCount()>=1));
+
+	// do an update - there should be no changes
+	TInt ret;
+	TRAP(ret, iControlList->UpdateL());
+	TEST(ret==KErrNone);
+	iControlCount2 = iControlList->Count();
+	TEST(iControlCount2 == iControlCount1);	// no change in the count (finds a m_ctrl.exe file on z, not c)
+	TEST((iControlList->UpdateCount()>=1));
+	TInt index = ControlIndexInList(iControlList,EFalse);
+	TEST((index >= 0) && (index < iControlCount2));
+	}
+
+
+/**
+   @SYMTestCaseID T-ProStep-testControls2L
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Tests CApaSystemControlList::UpdateL() and UpdateCount().
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions Copy control from Z: drive to C: drive. Call UpdateL() to
+   update the control list. Check if UpdateL() has incremented iUpdateCount
+   by calling UpdateCount(). Check the filename of control to ensure that the
+   control copied to C: drive has been updated in the list. Delete the newly
+   copied control.\n
+   API Calls:\n	
+   CApaSystemControlList::UpdateL()\n
+   CApaSystemControlList::UpdateCount()const\n
+   
+   @SYMTestExpectedResults The test shows updating of the copied control in control list.
+ */
+void CT_ProStep::testControls2L()
+	{
+	RSmlTestUtils testSession;
+	User::LeaveIfError(testSession.Connect());
+
+	testSession.CreateDirectoryL(KCTLDIR);
+	testSession.CreateDirectoryL(KRSCDIR);
+
+	TInt ret=testSession.CopyFileL(KSOURCEPATH,KNEWCTLPATH);
+	TEST(ret==KErrNone);
+	ret=testSession.CopyFileL(KLOCPATH,KNEWLOCPATH);
+	TEST(ret==KErrNone);
+
+	TInt controlCount=iControlList->UpdateCount();
+	while(iControlList->UpdateCount()<=controlCount)
+		{
+		TRAP(ret, iControlList->UpdateL());
+		if(ret!=KErrNone)
+			{
+			break;				
+			}
+		User::After(100000);	
+		}
+	TEST(ret==KErrNone);
+
+	iControlCount3 = iControlList->Count();
+	TEST(iControlCount3 == iControlCount1);	// still no changes in the count (finds a m_ctrl.exe file on c, not z)
+	TEST((iControlList->UpdateCount()==controlCount+1));
+
+	TInt index = ControlIndexInList(iControlList,ETrue);
+	TEST((index>=0)&&(index<iControlCount3));
+	if(index>=0)
+		{
+		TFileName name=iControlList->Control(index)->FileName();
+		TEST(name.CompareF(KCTRLNAME)==0);
+		}
+	
+	// hide the control and do an update - there should be changes
+	testSession.SetReadOnly(KNEWCTLPATH,0);  // remove the read only attribute
+	ret=testSession.DeleteFileL(KNEWCTLPATH);
+	TEST(ret==KErrNone);
+	testSession.SetReadOnly(KNEWLOCPATH,0);  // remove the read only attribute
+	ret=testSession.DeleteFileL(KNEWLOCPATH);
+	TEST(ret==KErrNone);
+	controlCount=iControlList->UpdateCount();
+	while(iControlList->UpdateCount()<=controlCount)
+		{
+		TRAPD(ret, iControlList->UpdateL());
+		if(ret!=KErrNone)
+			{
+			break;				
+			}
+		User::After(100000);
+		}
+
+	testSession.Close();
+	}
+
+
+/**
+   @SYMTestCaseID T-ProStep-testControls3L
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Tests CApaSystemControlList::Control() and CApaSystemControl APIs Type() and Caption().
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Update the control list to ensure that the deleted control is
+   removed from the list and the control on the Z: Drive is added to the list.
+   Retrieve this control from the list using CApaSystemControlList::Control(). 
+   Check the type and caption of the control calling Type() and Caption() methods.\n
+   API Calls:\n	
+   CApaSystemControlList::Control(TInt aIndex)const\n
+   CApaSystemControl::Type()const\n
+   CApaSystemControl::Caption()const\n
+   
+   @SYMTestExpectedResults The test shows the addition of the control present on 
+   Z: drive in control list. Test confirms the retrieved info on the control
+   obtained from the control list.
+  
+ */
+void CT_ProStep::testControls3L()
+   {
+	TUid KUidMinimalControl={0x13008AEE};
+	TFileName ctlCaption=_L("m_ctrl");
+	// This method is called to close the panic dialog generated by previous test
+	ClosePanicWindowL();
+
+	TRAPD(ret, iControlList->UpdateL());
+	TEST(ret==KErrNone);
+	const TInt controlCount4 = iControlList->Count();
+	TEST(controlCount4 == iControlCount1);	// still no changes in the count (finds a .ctl file on z, not c)
+	TEST((iControlList->UpdateCount()==3));
+	TInt index = ControlIndexInList(iControlList,EFalse);
+	TEST((index >= 0) && (index < controlCount4));
+	if(index>=0)
+		{
+		TEST(iControlList->Control(index)->FileName().CompareF(ctlPath)==0);
+	
+		INFO_PRINTF1(_L("Testing CApaSystemControl"));
+
+		//get the control from the list and check it's type and caption
+		iControl=iControlList->Control(index);
+		TEST(iControl!=NULL);
+		TEST((iControl->Type()==KUidMinimalControl));
+		TFileName caption=iControl->Caption();
+		TEST(caption.CompareF(ctlCaption)==0);
+		TEST(iControl->Icon()!=NULL);
+		RThread thread;
+		TFullName name=_L("Control Panel Test");
+		TInt r=thread.Create(name,SimulateKeyL,KDefaultStackSize,KDefaultStackSize,KDefaultStackSize,NULL);
+		TEST(r==KErrNone);
+		thread.Resume();
+
+		// run the control
+		TRAP(ret, iControl->CreateL()); // this control is synchronous
+		TEST(ret==KErrNone);
+		thread.Close();
+		}
+	}
+
+/**
+   Auxiliary Fn for T-ProStep-testControls1L, T-ProStep-testControls2L, T-ProStep-testControls3L
+   
+   This method creates a control list by calling CApaSystemControlList::NewL() and 
+   initiates subsequent tests on CApaSystemControlList and CApaSystemControl APIs.
+    
+ */
+void CT_ProStep::testControlsL()
+	{
+	INFO_PRINTF1(_L("Testing CApaSystemControlList"));
+
+	//Create a session with F & B server
+	TInt ret = RFbsSession::Connect();
+	TEST(ret == KErrNone);
+
+	CFileMan* fileMan=CFileMan::NewL(iFs);
+	CleanupStack::PushL(fileMan);
+
+	TRAP(ret,iControlList=CApaSystemControlList::NewL(iFs));
+	TEST(ret==KErrNone);
+
+	testControls1L();
+	testControls2L();
+	testControls3L();
+
+	// tidy up
+	delete iControlList;
+	CleanupStack::PopAndDestroy(fileMan);
+
+	//Close the session F & B server.
+	RFbsSession::Disconnect();
+
+     }
+
+ TInt PanicTestThread(TAny* aOption)
+	{
+	CTrapCleanup::New();
+	const TInt option = TInt(aOption);
+	//Create a session with F & B server
+	TInt ret = RFbsSession::Connect();
+	switch(option)
+		{
+	case ENegativePanicTest:
+	 	
+		if(ret==KErrNone)
+			{
+			RFs fs;
+			fs.Connect();
+			CApaSystemControlList *controlList=NULL;
+			TRAP(ret,controlList=CApaSystemControlList::NewL(fs));
+			if(ret==KErrNone)
+				{
+				TInt count=controlList->Count();
+				controlList->Control(count+10);
+				}
+			delete controlList;
+			fs.Close();
+			}
+     break;
+	 default:
+		User::Panic(_L("TProStep Error"), EUnknownPanicOption);
+	 	}
+	RFbsSession::Disconnect(); 	
+	return KErrNone;
+	}
+	
+/**
+   @SYMTestCaseID APPFWK-APPARC-0056
+  
+   @SYMDEF DEF092293
+  
+   @SYMTestCaseDesc Tests CApaSystemControlList::Control() Throws the right Panic on Invalid Count.
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Create  Seperate Thread to call the PanicTestThread Method where we create a new system ControlList
+   and get the actual count of the lists present inside . now call the CApaSystemControlList::Control(Index);where Index
+   is a number greater than the actual count list.
+   CApaSystemControlList::Control(TInt aIndex)const\n
+  
+   
+   @SYMTestExpectedResults Expect a APGRFX Panic EPanicIndexOutOfRange.
+  
+ */	
+	
+void CT_ProStep::testPanicForControlListL()
+	{
+	RThread thrd;
+	TRequestStatus stat;
+	TInt ret=thrd.Create(_L("ptt"),PanicTestThread,KDefaultStackSize,0x2000,0x20000,(TAny*)ENegativePanicTest);
+	User::LeaveIfError(ret);
+	thrd.SetPriority(EPriorityMuchMore);
+	thrd.Logon(stat);
+	User::SetJustInTime(EFalse);
+	thrd.Resume();
+	User::WaitForRequest(stat);
+	TEST(thrd.ExitType()==EExitPanic); 
+	TEST(thrd.ExitReason()==EPanicIndexOutOfRange);
+	INFO_PRINTF2(_L("TestPanicForControlList panic=%d"), thrd.ExitReason());
+	thrd.Close();
+	User::SetJustInTime(ETrue);
+	ClosePanicWindowL();
+	
+	}
+	
+// This method is called to close the panic generated by the testPanicForControlListL() test.	
+void CT_ProStep::ClosePanicWindowL()
+	{
+	RWsSession	ws;
+	User::LeaveIfError(ws.Connect());
+
+	TInt wgFocus = ws.GetFocusWindowGroup();
+
+	const TUint32 ENullWsHandle = 0xFFFFFFFF;	// Events delivered to this handle are thrown away
+	RWindowGroup wg = RWindowGroup(ws);
+
+	wg.Construct(ENullWsHandle);
+	TInt wgId = wg.Identifier();
+
+	TWsEvent event;
+	event.SetType(EEventKey);
+	TKeyEvent *keyEvent = event.Key();
+	keyEvent->iCode = EKeyEscape;
+	keyEvent->iScanCode = EStdKeyEscape;
+	keyEvent->iModifiers = 0;
+
+	TInt limit = 0;
+	for(limit = 0; wgFocus != wgId && (limit < 50); limit++)
+	{
+		ws.SendEventToAllWindowGroups(event);
+		wgFocus = ws.GetFocusWindowGroup();
+		RDebug::Print(_L("CloseAllPanicWindowsL() - EKeyEscape sent to Windows Group"));
+	}
+
+	// close everything
+	wg.Close();
+	ws.Close();
+	
+	}
+/**
+   @SYMTestCaseID T_ProStep_DoAppListInvalidTestL
+  
+   @SYMPREQ
+ 
+   @SYMTestCaseDesc Tests GetNextApp() never returns RApaLsSession::EAppListInvalid.
+  
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Copy tstapp files from z: drive to c: drive. Create a session
+   with the Application Architecture server. Populate the list of applications
+   to cache by calling RApaLsSession::GetAllApps().Remove the copied files
+   from C: drive. Traverse through the list by calling
+   RApaLsSession::GetNextApp(). Check return value to ensure that
+   RApaLsSession::EAppListInvalid is never returned.\n
+   API Calls:\n	
+   RApaLsSession::GetNextApp(TApaAppInfo& aInfo) const
+   
+   @SYMTestExpectedResults Test confirms that RApaLsSession::EAppListInvalid is never returned.
+    
+ */
+void CT_ProStep::DoAppListInvalidTestL(RApaLsSession& aLs)
+	{
+	_LIT(KTempAppDir, "C:\\private\\10003a3f\\import\\apps\\");
+	_LIT(KTempRegPath, "C:\\private\\10003a3f\\import\\apps\\tstapp_reg.rsc");
+	TFullName regPath=_L("z:\\private\\10003a3f\\import\\apps\\tstapp_reg.rsc");
+	
+	CFileMan* fileMan = CFileMan::NewL (iFs);
+	CleanupStack::PushL(fileMan);
+	
+	INFO_PRINTF1(_L("Copy tstapp files to C: drive......."));
+	TInt ret = iFs.MkDir(KTempAppDir);
+	TEST(ret==KErrNone || ret==KErrAlreadyExists);
+	TEST(fileMan->Copy(regPath, KTempRegPath)==KErrNone);	//Just to start the idle update.
+
+	User::After(8000000);
+	
+	INFO_PRINTF1(_L("Get app list......."));
+	ret = aLs.GetAllApps();
+	TEST(ret==KErrNone);
+
+	INFO_PRINTF1(_L("Remove temp files from C: drive......."));
+	TRequestStatus status;
+	TTime tempTime(0); // added tempTime to avoid asynch CFileMan::Attribs request completing with KErrArgument
+	TInt err=fileMan->Attribs(KTempAppDir,0,KEntryAttReadOnly, tempTime, CFileMan::ERecurse, status);
+	TEST(err==KErrNone);
+	User::WaitForRequest(status);
+	TEST(status.Int() == KErrNone);
+	TEST(fileMan->Delete(KTempRegPath)==KErrNone);	//Just to start the idle update.
+	TEST(fileMan->RmDir(KTempAppDir)==KErrNone);
+
+	User::After(8000000);
+	
+	INFO_PRINTF1(_L("Testing GetNextApp() never returns RApaLsSession::EAppListInvalid."));
+	TApaAppInfo info;
+	while(ret==KErrNone)
+		{
+		ret=aLs.GetNextApp(info);
+		}
+	TEST(ret!=RApaLsSession::EAppListInvalid);
+	TEST(ret==RApaLsSession::ENoMoreAppsInList);
+
+	CleanupStack::PopAndDestroy(fileMan);
+	}
+
+
+/**
+  Auxiliary Fn for all Test Cases.
+ 
+  This method creates and installs an active scheduler and puts the
+  test code on the scheduler as a CIdle object. The method initiates
+  all tests by calling the static method CT_ProStepCallBack::CallBack().
+ 
+*/
+void CT_ProStep::DoStepTestsInCallbackL()
+	{
+	// create an active scheduler
+	CActiveScheduler* scheduler = new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(scheduler);
+	CleanupStack::PushL(scheduler);
+
+	// put the test code onto the scheduler as an idle object
+	CIdle* idle=CIdle::NewL(-20);
+	CleanupStack::PushL(idle);
+
+	CT_ProStepCallBack* callBack = new(ELeave) CT_ProStepCallBack(this);
+	CleanupStack::PushL(callBack);
+
+	idle->Start(TCallBack(CT_ProStepCallBack::CallBack,callBack));
+	// start the test code
+	CActiveScheduler::Start();
+
+	// all outstanding requests complete - kill the scheduler
+	CleanupStack::PopAndDestroy(3); //scheduler, callBack, idle
+	}
+
+/**
+  This static method is the callback function of CIdle object. The method
+  calls the non-static method DoStepTests() which initiates all the tests. 
+*/
+TInt CT_ProStepCallBack::CallBack(TAny* callBack /*aThis*/)
+{
+	//Call Test Step func
+	((CT_ProStepCallBack *)callBack)->iTestStep->DoStepTests();
+	
+	CActiveScheduler::Stop();
+	return EFalse; // don't call back again
+	}
+
+
+/**
+   Constructor
+ */
+CT_ProStepCallBack::CT_ProStepCallBack(CT_ProStep* aTestStep)
+	{
+	iTestStep = aTestStep;
+	}
+
+/**
+   Destructor
+ */
+CT_ProStepCallBack::~CT_ProStepCallBack()
+	{
+	}
+
+/**
+  Auxiliary Fn for all Test Cases. 
+  The method initiates all tests to be performed.
+*/
+void CT_ProStep::DoStepTests()
+	{
+	INFO_PRINTF1(_L("Test AppListInvalidTest......"));
+	RTestableApaLsSession ls;
+	TEST(KErrNone == ls.Connect());
+	CleanupClosePushL(ls);
+	//DONT_CHECK due to changes to file system
+	HEAP_TEST_LS_SESSION(ls, 0, DONT_CHECK, DoAppListInvalidTestL(ls), REComSession::FinalClose() );
+	CleanupStack::PopAndDestroy(&ls);
+	
+	__UHEAP_MARK;
+	INFO_PRINTF1(_L("Test AppIdentifier......"));
+	TRAPD(r,testAppIdentifierL());
+	TEST(r==KErrNone);
+	INFO_PRINTF2(_L("Test AppIdentifier completed with code %d\n"), r);
+	REComSession::FinalClose();
+	__UHEAP_MARKEND;
+	
+	__UHEAP_MARK;
+	INFO_PRINTF1(_L("Test TestGenerateFileName......"));
+	TRAP(r,doTestGenerateFileName());
+	TEST(r==KErrNone);
+	INFO_PRINTF2(_L("Test TestGenerateFileName completed with code %d\n"), r);
+	REComSession::FinalClose();
+	__UHEAP_MARKEND;
+
+	__UHEAP_MARK;
+	INFO_PRINTF1(_L("Test TestReadStreamL......"));
+	TRAP(r,testReadStreamL());
+	TEST(r==KErrNone);
+	INFO_PRINTF2(_L("Test TestReadStream completed with code %d\n"), r);
+	REComSession::FinalClose();
+	__UHEAP_MARKEND;
+
+	__UHEAP_MARK;
+	INFO_PRINTF1(_L("Test DocCreation......"));
+	TRAP(r,testDocCreationL());
+	TEST(r==KErrNone);
+	INFO_PRINTF2(_L("Test DocCreation completed with code %d\n"), r);
+	REComSession::FinalClose();
+	__UHEAP_MARKEND;	
+	
+	__UHEAP_MARK;
+	INFO_PRINTF1(_L("Test Embedding......"));
+	TRAP(r,testEmbeddingL());
+	TEST(r==KErrNone);
+	INFO_PRINTF2(_L("Test Embedding completed with code %d\n"), r);
+	REComSession::FinalClose();
+	__UHEAP_MARKEND;
+
+	__UHEAP_MARK;
+	INFO_PRINTF1(_L("Test MainDocFileName......"));
+	TRAP(r,MainDocFileNameTestsL());
+	TEST(r==KErrNone);
+	INFO_PRINTF2(_L("Test MainDocFileName completed with code %d\n"), r);
+	REComSession::FinalClose();
+	__UHEAP_MARKEND;
+
+	__UHEAP_MARK;
+	INFO_PRINTF1(_L("Test IniFiles......"));
+	TRAP(r,testIniFilesL());
+	TEST(r==KErrNone);
+	INFO_PRINTF2(_L("Test IniFiles completed with code %d\n"), r);
+	REComSession::FinalClose();
+	__UHEAP_MARKEND;
+
+	__UHEAP_MARK;
+	INFO_PRINTF1(_L("Test Controls......"));
+	TRAP(r,testControlsL());
+	TEST(r==KErrNone);
+	INFO_PRINTF2(_L("Test Controls completed with code %d\n"), r);
+	REComSession::FinalClose();
+	__UHEAP_MARKEND;
+
+        __UHEAP_MARK;
+	INFO_PRINTF1(_L("Test Panic Controls......"));
+	TRAP(r,testPanicForControlListL());
+	TEST(r==KErrNone);
+	INFO_PRINTF2(_L("Test Panic Controls completed with code %d\n"), r);
+	REComSession::FinalClose();
+	__UHEAP_MARKEND;
+	} 
+
+/**
+   Destructor
+ */
+CT_ProStep::~CT_ProStep()
+	{
+	}
+
+/**
+   Constructor
+ */
+CT_ProStep::CT_ProStep()
+	{
+	SetTestStepName(KT_ProStep);
+	}
+
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+TVerdict CT_ProStep::doTestStepPreambleL()
+	{
+	SetTestStepResult(EPass);
+	return TestStepResult();
+	}
+
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+TVerdict CT_ProStep::doTestStepPostambleL()
+	{
+	return TestStepResult();
+	}
+
+/**
+   @return - TVerdict code
+   Override of base class virtual
+*/
+TVerdict CT_ProStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Testing Apparch...T_Pro"));
+
+	FbsStartup();
+
+	iFs.Connect();
+	setup();
+
+	TRAPD(ret,DoStepTestsInCallbackL())
+	TEST(ret==KErrNone);
+
+	iFs.Close();
+
+	INFO_PRINTF1(_L("T_Pro Completed."));
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_ProStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,108 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#if (!defined __T_PRO_STEP_H__)
+#define __T_PRO_STEP_H__
+
+_LIT(KT_ProStep,"T_Pro");
+
+#include "ApparcTestServer.h"
+
+#include <apaid.h>
+#include "..\apparc\apadll.h"
+#include <apgaplst.h>
+#include <apgicnfl.h>
+#include <apgdoor.h>
+#include <apfrec.h>
+#include <apfctlf.h>
+#include <apgctl.h>
+#include <apgaplst.h>
+#include <apaflrec.h>
+#include <apgcli.h>
+#include <apacmdln.h>
+
+//!  A CT_ProStep test class. 
+
+/**  Tests Application Apparc base classes and utility functions.\n */
+
+class CT_ProStep : public CTestStep
+	{
+public:
+	CT_ProStep();
+	~CT_ProStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+	void DoStepTests();
+//private:
+	void DoStepTestsInCallbackL();
+	void testAppIdentifierL();
+	void doTestGenerateFileName();
+	void testDocCreationL();
+	void testDocCreation1L();
+	CApaDocument* testDocCreation3L();
+	void testDocCreation2L();
+	void testDocCreation4L(CApaDocument* aDoc);
+	void testEmbeddingL();
+	void testIniFilesL();
+	void testControlsL();
+	void setup();
+	TInt ControlIndexInList(CApaSystemControlList* aList, TBool aIsNewPath);
+	void testControls1L();
+	void testControls2L();
+	void testControls3L();
+	void DoAppListInvalidTestL(RApaLsSession& aLs);
+	void MainDocFileNameTestsL();
+	void testMainDocFileName1L();
+	void testMainDocFileName2L();
+	void testMainDocFileName3L();
+	void testReadStreamL();
+    void testPanicForControlListL();
+    void ClosePanicWindowL();
+        
+
+private:
+	RFs iFs;
+	CApaProcess* iProcess;
+	CApaSystemControlList* iControlList;
+	CApaSystemControl* iControl;
+
+	TInt iControlCount1;
+	TInt iControlCount2;
+	TInt iControlCount3;
+
+	TInt iAppListCount;
+	};
+
+
+class CT_ProStepCallBack : public CBase
+	{
+public:
+	CT_ProStepCallBack(CT_ProStep* aTestStep);
+	~CT_ProStepCallBack();
+	static TInt CallBack(TAny* /*aThis*/);
+	CT_ProStep* iTestStep;
+
+private:
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_ProcStep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1388 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// The following tests are performed to test the Child behaviour on its Parent's termination.
+// 
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#include "T_ProcStep.h"
+const TInt KTProcTerminatingChildI = 1246;
+const TInt KTProcTerminatingChildII = 1247;
+const TInt KTProcTerminatingChildIII = 1248;
+const TInt KTProcTerminatingParent = 1249;
+
+CChildProcess* CChildProcess::NewL(RProcess& aParentProcess,TProcessId aChildProcessId)
+	{
+	CChildProcess* self= new(ELeave) CChildProcess(aParentProcess,aChildProcessId);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop();
+	return self;
+	}
+
+CChildProcess::~CChildProcess()
+/**
+ * Destructor
+ */
+	{
+	Cancel();
+	}
+
+void CChildProcess::ConstructL()
+/**
+ * Sets active, so that control goes into RunL() 
+ * where parent is terminated and child process logged on.
+ */	
+ 	{
+	User::LeaveIfError(iChildProcess.Open(iChildProcessId));
+	SetActive();
+	TRequestStatus *status=&iStatus;
+	User::RequestComplete(status,KErrNone);
+	CActiveScheduler::Start();
+	}
+
+CChildProcess::CChildProcess(RProcess& aParentProcess,TProcessId aChildProcessId):CActive(0),iChildProcessId(aChildProcessId),iParentProcess(aParentProcess),iCount(0)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+void CChildProcess::RunL()
+/**
+ * Opens the parent process, on failure leaves.
+ * Logs on the child process status, sets it active and terminates the parent process.
+ * When child terminates scheduler is stopped.
+ */
+	{
+	switch(iCount)
+		{
+		case 0:
+			iCount++;
+			iChildProcess.Logon(iStatus);
+			SetActive();
+			iParentProcess.Terminate(KErrNone);
+			break;
+		case 1:
+			CActiveScheduler::Stop();
+		default:
+			break;
+		}
+	}
+
+void CChildProcess::DoCancel()
+	{
+	switch(iCount)
+		{
+		case 0:
+			iChildProcess.LogonCancel(iStatus);
+			iCount++;
+			break;
+		case 1:
+			iChildProcess.LogonCancel(iStatus);
+			break;
+		default:
+			break;
+		}
+	}
+
+
+////////////////////////////////////////////////////////////////////////////
+//
+// T_ProcStep.cpp 
+// ------------
+//
+// Implements the test cases to test Child behaviour on Parent termination.
+//
+////////////////////////////////////////////////////////////////////////////
+
+CT_ProcStep::CT_ProcStep()
+/**
+ * Constructor
+ */
+	{
+	}
+
+
+CT_ProcStep::~CT_ProcStep()
+/**
+ * Destructor
+ */
+	{
+	}
+
+/**
+ @SYMTestCaseID	APPFWK-APPARC-0015
+
+ @SYMPREQ	PREQ1123
+
+ @SYMTestCaseDesc The Test determines that the Child dies when its Parent is terminated.
+
+ @SYMTestPriority Critical
+
+ @SYMTestStatus Implemented
+
+ @SYMTestActions. Creates and launches a process (parent). Creates another process (child) passing the first(parent) process ID.
+ Launches the child process. Terminates parent and checks the existance of child process. The child should die.
+ API Calls:\n
+ RProcess::Create(const TDesC &aFileName, const TDesC &aCommand, TOwnerType aType=EOwnerProcess);\n
+ RProcess::Resume();
+ RProcess::ExitType() const;
+ RProcess::ExitReason() const;
+ RProcess::Id() const;
+ CApaCommandLine::SetProcessEnvironmentL(RProcess &aProcess) const;
+ CApaCommandLine::NewLC();
+ CApaCommandLine::SetParentProcessId(TProcessId);
+
+ @SYMTestExpectedResults Termination of child process automatically.\n
+
+ */
+void CT_ProcStep::testChildSetToTerminateL(void)
+	{
+	TInt ret(0);
+
+	//commandline for parent process
+	CApaCommandLine* parentProcCmdln=CApaCommandLine::NewLC();
+	INFO_PRINTF1(_L("	CommandLine for Parent Process created "));
+
+	//parent process
+	RProcess parentProc;
+	ret = parentProc.Create(KParentExe,KNullDesC);
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupClosePushL(parentProc);
+	INFO_PRINTF2(_L("	Create Parent Process returned : %d"),ret);
+
+	//attach commandline to parent process
+	TRAP(ret,parentProcCmdln->SetProcessEnvironmentL(parentProc));
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	INFO_PRINTF1(_L("	Attach CommandLine to Process "));
+
+	INFO_PRINTF1(_L("	Run Parent Process "));
+	parentProc.Resume();
+	//Time for the parent process to launch itself
+	User::After(500000);
+
+	//commandline for child process
+	//Get parent process ID here
+	TUint64 parentProcId = parentProc.Id();
+	INFO_PRINTF2(_L("	Parent Process Id = 0x%lx "),parentProcId);
+
+	CApaCommandLine* childProcCmdln=CApaCommandLine::NewLC();
+	INFO_PRINTF1(_L("	CommandLine for Child Process created "));
+
+	//setting the parent process ID to child
+	childProcCmdln->SetParentProcessId(parentProcId);
+	INFO_PRINTF1(_L("	Set ParentProcessId to Child "));
+
+	//child process
+	RProcess childProc;
+	ret = childProc.Create(KChildOneExe,KNullDesC);
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupClosePushL(childProc);
+	
+	INFO_PRINTF2(_L("	Create Child Process returned : %d"),ret);
+
+	//attach commandline to child process
+	TRAP(ret,childProcCmdln->SetProcessEnvironmentL(childProc));
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	INFO_PRINTF1(_L("	Attach CommandLine to Process "));
+
+	INFO_PRINTF1(_L("	Run Child Process "));
+	childProc.Resume();
+	//Time for the child process to launch itself
+	User::After(500000);
+
+	//child process Id is reqd to monitor if it gets killed on its parent's termination
+	TUint64 childProcId = childProc.Id();
+	INFO_PRINTF2(_L("	Child Process Id = 0x%lx "),childProcId);
+
+	CChildProcess* childProcess=NULL;
+	TRAP(ret, childProcess=CChildProcess::NewL(parentProc,childProcId));
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupStack::PushL(childProcess);
+
+	TExitType exitType = parentProc.ExitType();
+	TEST(exitType == EExitTerminate);
+	TInt exitReason = parentProc.ExitReason();
+	TEST(exitReason == 0);
+	if(exitType==EExitTerminate && exitReason==0)
+		{
+		INFO_PRINTF1(_L("	Parent process is Terminated"));
+		}
+	
+	exitType = childProc.ExitType();
+	TEST(exitType == EExitTerminate);
+	exitReason = childProc.ExitReason();
+	TEST(exitReason == 0);
+	if(exitType == EExitTerminate && exitReason==0)
+		{
+		INFO_PRINTF1(_L("	The child process is killed automatically ... "));
+		}
+
+	CleanupStack::PopAndDestroy(childProcess);
+	CleanupStack::PopAndDestroy(&childProc);
+	CleanupStack::PopAndDestroy(childProcCmdln);
+	CleanupStack::PopAndDestroy(&parentProc);
+	CleanupStack::PopAndDestroy(parentProcCmdln);
+	}
+
+/**
+ @SYMTestCaseID APPFWK-APPARC-0016
+
+ @SYMPREQ PREQ1123
+
+ @SYMTestCaseDesc Test determines that the Child remains when its Parent is terminated.
+
+ @SYMTestPriority Critical
+
+ @SYMTestStatus Implemented
+
+ @SYMTestActions. Creates and launches a process (parent). Creates another process (child) without passing the first(parent) process ID.
+ Launches the child process. Terminates parent and checks the existance of child process. The child process should be alive.
+ API Calls:\n
+ RProcess::Create(const TDesC &aFileName, const TDesC &aCommand, TOwnerType aType=EOwnerProcess);\n
+ RProcess::Resume();
+ RProcess::ExitType() const;
+ RProcess::ExitReason() const;
+ RProcess::Id() const;
+ RProcess::Terminate(TInt aReason);
+ CApaCommandLine::SetProcessEnvironmentL(RProcess &aProcess) const;
+ CApaCommandLine::NewLC();
+
+ @SYMTestExpectedResults Existence of child process.\n
+
+ */
+void CT_ProcStep::testChildSetToRemainL(void)
+	{
+	TInt ret(0);
+
+	//commandline for parent process
+	CApaCommandLine* parentProcCmdln=CApaCommandLine::NewLC();
+	INFO_PRINTF1(_L("	CommandLine for Parent Process created "));
+
+	//parent process
+	RProcess parentProc;
+	ret = parentProc.Create(KParentExe,KNullDesC);
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupClosePushL(parentProc);
+	INFO_PRINTF2(_L("	Create Parent Process returned : %d"),ret);
+
+	//attach commandline to parent process
+	TRAP(ret,parentProcCmdln->SetProcessEnvironmentL(parentProc));
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	INFO_PRINTF1(_L("	Attach CommandLine to Process "));
+
+	INFO_PRINTF1(_L("	Run Parent Process "));
+	parentProc.Resume();
+	//Time for the parent process to launch itself
+	User::After(500000);
+
+	//commandline for child process
+	//Get parent process ID here
+	TUint64 parentProcId = parentProc.Id();
+	INFO_PRINTF2(_L("	Parent Process Id = 0x%lx "),parentProcId);
+
+	CApaCommandLine* childProcCmdln=CApaCommandLine::NewLC();
+	INFO_PRINTF1(_L("	CommandLine for Child Process created "));
+
+	//child process
+	RProcess childProc;
+	ret = childProc.Create(KChildOneExe,KNullDesC);
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupClosePushL(childProc);
+
+	INFO_PRINTF2(_L("	Create Child Process returned : %d"),ret);
+
+	//attach commandline to child process
+	TRAP(ret,childProcCmdln->SetProcessEnvironmentL(childProc));
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	INFO_PRINTF1(_L("	Attach CommandLine to Process "));
+
+	INFO_PRINTF1(_L("	Run Child Process "));
+	childProc.Resume();
+	//Time for the child process to launch itself
+	User::After(500000);
+
+	parentProc.Terminate(KTProcTerminatingParent);
+		INFO_PRINTF1(_L("	Kill Parent Process ... "));
+	TExitType exitType = parentProc.ExitType();
+	TEST(exitType == EExitTerminate);
+	TInt exitReason = parentProc.ExitReason();
+	TEST(exitReason == KTProcTerminatingParent);
+
+	//child process Id is reqd to monitor if it gets killed on its parent's termination
+	TUint64 childProcId = childProc.Id();
+	INFO_PRINTF2(_L("	Child Process Id = 0x%lx "),childProcId);
+
+	//Wait for child to terminate ... if it really does
+	User::After(10000000);
+
+	exitType = childProc.ExitType();
+	TEST(exitType == EExitPending);
+	if(exitType == EExitPending)
+		{
+		INFO_PRINTF1(_L("	Child process is still running "));
+		INFO_PRINTF1(_L("	so terminating it manually ..."));
+		childProc.Terminate(KTProcTerminatingChildI);
+		exitType = childProc.ExitType();
+		TEST(exitType == EExitTerminate);
+		exitReason = childProc.ExitReason();
+		TEST(exitReason == KTProcTerminatingChildI);
+		}
+
+	CleanupStack::PopAndDestroy(&childProc);
+	CleanupStack::PopAndDestroy(childProcCmdln);
+	CleanupStack::PopAndDestroy(&parentProc);
+	CleanupStack::PopAndDestroy(parentProcCmdln);
+	}
+
+/**
+ @SYMTestCaseID APPFWK-APPARC-0017
+
+ @SYMPREQ PREQ1123
+
+ @SYMTestCaseDesc Test determines that one Child remains and another terminates when their Parent terminates, based on their creation.
+
+ @SYMTestPriority High
+
+ @SYMTestStatus Implemented
+
+ @SYMTestActions. Creates and launches a process (parent). Creates a process (child I) passing the first (parent) process ID.
+ Creates a second process (child II) without passing the first (parent) process ID. Launches both the child processes.
+ Terminates parent and checks the existance of both the child processes. Child I should die and Child II should remain alive.
+ API Calls:\n
+ RProcess::Create(const TDesC &aFileName, const TDesC &aCommand, TOwnerType aType=EOwnerProcess);\n
+ RProcess::Resume();
+ RProcess::ExitType() const;
+ RProcess::ExitReason() const;
+ RProcess::Id() const;
+ RProcess::Terminate(TInt aReason);
+ CApaCommandLine::SetProcessEnvironmentL(RProcess &aProcess) const;
+ CApaCommandLine::NewLC();
+ CApaCommandLine::SetParentProcessId(TProcessId);
+ 
+ @SYMTestExpectedResults Termination of first child process and existence of the second.\n
+
+ */
+void CT_ProcStep::testTwoChildsOneToTerminateAndOtherToRemainL(void)
+	{
+	TInt ret(0);
+	TExitType exitType;
+
+	//commandline for parent process
+	CApaCommandLine* parentProcCmdln=CApaCommandLine::NewLC();
+	INFO_PRINTF1(_L("	CommandLine for Parent Process created "));
+
+	//parent process
+	RProcess parentProc;
+	ret = parentProc.Create(KParentExe,KNullDesC);
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupClosePushL(parentProc);
+	INFO_PRINTF2(_L("	Create Parent Process returned : %d"),ret);
+
+	//attach commandline to parent process
+	TRAP(ret,parentProcCmdln->SetProcessEnvironmentL(parentProc));
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	INFO_PRINTF1(_L("	Attach CommandLine to Process "));
+
+	INFO_PRINTF1(_L("	Run Parent Process "));
+	parentProc.Resume();
+	//Time for the parent process to launch itself
+	User::After(500000);
+
+	//commandline for child process
+	//Get parent process ID here
+	TUint64 parentProcId = parentProc.Id();
+	INFO_PRINTF2(_L("	Parent Process Id = 0x%lx"),parentProcId);
+
+	//For Child ONE
+	CApaCommandLine* childProcOneCmdln=CApaCommandLine::NewLC();
+	INFO_PRINTF1(_L("	CommandLine for Child One created "));
+
+	//setting the parent process ID to child I
+	childProcOneCmdln->SetParentProcessId(parentProcId);
+	INFO_PRINTF1(_L("	Set ParentProcessId to Child One "));
+
+	//child process ONE
+	RProcess childProcOne;
+	ret = childProcOne.Create(KChildOneExe,KNullDesC);
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupClosePushL(childProcOne);
+	
+	INFO_PRINTF2(_L("	Create Child One returned : %d"),ret);
+
+	//attach commandline to child process
+	TRAP(ret,childProcOneCmdln->SetProcessEnvironmentL(childProcOne));
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	INFO_PRINTF1(_L("	Attach CommandLine of Child One to its Process "));
+
+	INFO_PRINTF1(_L("	Run Child One "));
+	childProcOne.Resume();
+	//Time for the child one to launch itself
+	User::After(500000);
+
+	//child process Id is reqd to monitor if it gets killed on its parent's termination
+	TUint64 childProcOneId = childProcOne.Id();
+	INFO_PRINTF2(_L("	Child One Id = 0x%lx "),childProcOneId);
+
+	//For Child TWO
+	CApaCommandLine* childProcTwoCmdln=CApaCommandLine::NewLC();
+	INFO_PRINTF1(_L("	CommandLine for Child Two created "));
+
+	//child process TWO
+	RProcess childProcTwo;
+	ret = childProcTwo.Create(KChildTwoExe,KNullDesC);
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupClosePushL(childProcTwo);
+	
+	INFO_PRINTF2(_L("	Create Child Two returned : %d"),ret);
+
+	//attach commandline to child process
+	TRAP(ret,childProcTwoCmdln->SetProcessEnvironmentL(childProcTwo));
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	INFO_PRINTF1(_L("	Attach CommandLine of Child Two to its Process "));
+
+	INFO_PRINTF1(_L("	Run Child Two "));
+	childProcTwo.Resume();
+	//Time for the child one to launch itself
+	User::After(500000);
+
+	//child II process Id is reqd to monitor if it gets killed on its parent's termination
+	TUint64 childProcTwoId = childProcTwo.Id();
+	INFO_PRINTF2(_L("	Child Two Id = 0x%lx "),childProcTwoId);
+
+	CChildProcess* childProcess=NULL;
+	TRAP(ret, childProcess=CChildProcess::NewL(parentProc,childProcOneId));
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupStack::PushL(childProcess);
+
+	exitType = parentProc.ExitType();
+	TEST(exitType == EExitTerminate);
+	TInt exitReason = parentProc.ExitReason();
+	TEST(exitReason == 0);
+	if(exitType==EExitTerminate && exitReason==0)
+		{
+		INFO_PRINTF1(_L("	Parent process is Terminated"));
+		}
+	
+	exitType = childProcOne.ExitType();
+	TEST(exitType == EExitTerminate);
+	exitReason = childProcOne.ExitReason();
+	TEST(exitReason == 0);
+	if(exitType==EExitTerminate && exitReason==0)
+		{
+		INFO_PRINTF1(_L("	Child I is killed automatically ... "));
+		}
+
+	//Wait and see if child II terminates automatically...
+	User::After(10000000);
+
+	exitType = childProcTwo.ExitType();
+	TEST(exitType == EExitPending);
+	if(exitType==EExitPending)
+		{
+		INFO_PRINTF1(_L("	Child II running successfully"));
+		childProcTwo.Terminate(KTProcTerminatingChildII);
+		exitType = childProcTwo.ExitType();
+		TEST(exitType==EExitTerminate);
+		exitReason = childProcTwo.ExitReason();
+		TEST(exitReason == KTProcTerminatingChildII);
+		INFO_PRINTF1(_L("	So Terminated it manually ..."));
+		}
+
+	CleanupStack::PopAndDestroy(childProcess);
+	CleanupStack::PopAndDestroy(&childProcTwo);
+	CleanupStack::PopAndDestroy(childProcTwoCmdln);
+	CleanupStack::PopAndDestroy(&childProcOne);
+	CleanupStack::PopAndDestroy(childProcOneCmdln);
+	CleanupStack::PopAndDestroy(&parentProc);
+	CleanupStack::PopAndDestroy(parentProcCmdln);
+	}
+
+/**
+ @SYMTestCaseID APPFWK-APPARC-0018
+
+ @SYMPREQ PREQ1123
+
+ @SYMTestCaseDesc The Test determines that a process is launched and terminated without any problem.\n
+
+ @SYMTestPriority Low
+
+ @SYMTestStatus Implemented
+
+ @SYMTestActions. Creates and launches a process. No Child is created. Parent should launch properly, and on termination should die.
+ API Calls:\n
+ RProcess::Create(const TDesC &aFileName, const TDesC &aCommand, TOwnerType aType=EOwnerProcess);\n
+ RProcess::Resume();
+ RProcess::ExitType() const;
+ RProcess::ExitReason() const;
+ RProcess::Id() const;
+ RProcess::Terminate(TInt aReason);
+ 
+ @SYMTestExpectedResults Proper creation and termination.\n
+
+ */
+void CT_ProcStep::testParentWithoutAChildL(void)
+	{
+	TInt ret(0)	;
+
+	//process
+	RProcess parentProc;
+	ret = parentProc.Create(KParentExe,KNullDesC);
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupClosePushL(parentProc);
+	INFO_PRINTF2(_L("	Create Parent Process returned : %d"),ret);
+
+	TUint64 parentProcId=parentProc.Id();
+	INFO_PRINTF2(_L("	Process Id = 0x%lx "),parentProcId);
+
+	INFO_PRINTF1(_L("	Run the Process "));
+	parentProc.Resume();
+	//Time for the parent process to launch itself
+	User::After(5000000);
+
+	TExitType exitType = parentProc.ExitType();
+	TEST(exitType == EExitKill||exitType == EExitPending);
+	if(exitType==EExitPending)
+		{
+		INFO_PRINTF1(_L("	Process running normally "));
+		parentProc.Terminate(KTProcTerminatingParent);
+		exitType = parentProc.ExitType();
+		TEST(exitType==EExitTerminate);
+		TInt exitReason = parentProc.ExitReason();
+		TEST(exitReason == KTProcTerminatingParent);
+		INFO_PRINTF1(_L("	Terminating the process "));
+		}
+	CleanupStack::PopAndDestroy(&parentProc);
+	}
+
+/**
+ @SYMTestCaseID APPFWK-APPARC-0019
+
+ @SYMPREQ PREQ1123
+
+ @SYMTestCaseDesc The Test determines that more than one Child for a parent terminate on their Parent's termination.
+
+ @SYMTestPriority Medium
+
+ @SYMTestStatus Implemented
+
+ @SYMTestActions. Creates and launches a process (parent). Creates 3 processes (child I,II,III) passing the first (parent) process ID.
+ Launches all the 3 processes. Terminates parent and checks the existance of the child processes. All 3 children should die.
+ API Calls:\n
+ RProcess::Create(const TDesC &aFileName, const TDesC &aCommand, TOwnerType aType=EOwnerProcess);\n
+ RProcess::Resume();
+ RProcess::ExitType() const;
+ RProcess::ExitReason() const;
+ RProcess::Id() const;
+ RProcess::Terminate(TInt aReason);
+ CApaCommandLine::SetProcessEnvironmentL(RProcess &aProcess) const;
+ CApaCommandLine::NewLC();
+ CApaCommandLine::SetParentProcessId(TProcessId);
+ 
+ @SYMTestExpectedResults Termination of all child processes automatically.\n
+
+ */
+void CT_ProcStep::testAllChildsSetToTerminateL(void)
+	{
+	TInt ret(0);
+
+	//commandline for parent process
+	CApaCommandLine* parentProcCmdln=CApaCommandLine::NewLC();
+	INFO_PRINTF1(_L("	CommandLine for Parent Process created "));
+
+	//parent process
+	RProcess parentProc;
+	ret = parentProc.Create(KParentExe,KNullDesC);
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupClosePushL(parentProc);
+	INFO_PRINTF2(_L("	Create Parent Process returned : %d"),ret);
+
+	//attach commandline to parent process
+	TRAP(ret,parentProcCmdln->SetProcessEnvironmentL(parentProc));
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	INFO_PRINTF1(_L("	Attach CommandLine to Process "));
+
+	INFO_PRINTF1(_L("	Run Parent Process "));
+	parentProc.Resume();
+	//Time for the parent process to launch itself
+	User::After(500000);
+
+	//Get parent process ID here
+	TUint64 parentProcId = parentProc.Id();
+	INFO_PRINTF2(_L("	Parent Process Id = 0x%lx "),parentProcId);
+
+	//Child I
+	CApaCommandLine* childProcOneCmdln=CApaCommandLine::NewLC();
+	INFO_PRINTF1(_L("	CommandLine for Child One created "));
+
+	//setting the parent process ID to child
+	childProcOneCmdln->SetParentProcessId(parentProcId);
+	INFO_PRINTF1(_L("	Set ParentProcessId to Child One "));
+
+	//Child process I
+	RProcess childProcOne;
+	ret = childProcOne.Create(KChildOneExe,KNullDesC);
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupClosePushL(childProcOne);
+	
+	INFO_PRINTF2(_L("	Create Child One returned : %d"),ret);
+
+	//attach commandline to child process
+	TRAP(ret,childProcOneCmdln->SetProcessEnvironmentL(childProcOne));
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	INFO_PRINTF1(_L("	Attach CommandLine of Child One to its Process "));
+
+	INFO_PRINTF1(_L("	Run Child One "));
+	childProcOne.Resume();
+	//Time for the child process to launch itself
+	User::After(1000000);
+
+	//child process Id is reqd to monitor if it gets killed on its parent's termination
+	TUint64 childProcOneId = childProcOne.Id();
+	INFO_PRINTF2(_L("	Child One Id = 0x%lx "),childProcOneId);
+
+	//Child II
+	CApaCommandLine* childProcTwoCmdln=CApaCommandLine::NewLC();
+	INFO_PRINTF1(_L("	CommandLine for Child Two created "));
+
+	//setting the parent process ID to child
+	childProcTwoCmdln->SetParentProcessId(parentProcId);
+	INFO_PRINTF1(_L("	Set ParentProcessId to Child Two "));
+
+	//child process II
+	RProcess childProcTwo;
+	ret = childProcTwo.Create(KChildTwoExe,KNullDesC);
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupClosePushL(childProcTwo);
+	
+	INFO_PRINTF2(_L("	Create Child Two returned : %d"),ret);
+
+	//attach commandline to child process
+	TRAP(ret,childProcTwoCmdln->SetProcessEnvironmentL(childProcTwo));
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	INFO_PRINTF1(_L("	Attach CommandLine of Child Two to its Process "));
+
+	INFO_PRINTF1(_L("	Run Child Two "));
+	childProcTwo.Resume();
+	//Time for the child process to launch itself
+	User::After(1000000);
+
+	//child process Id is reqd to monitor if it gets killed on its parent's termination
+	TUint64 childProcTwoId = childProcTwo.Id();
+	INFO_PRINTF2(_L("	Child Two Id = 0x%lx "),childProcTwoId);
+
+	//Child III
+	CApaCommandLine* childProcThreeCmdln=CApaCommandLine::NewLC();
+	INFO_PRINTF1(_L("	CommandLine for Child Three created "));
+
+	//setting the parent process ID to child
+	childProcThreeCmdln->SetParentProcessId(parentProcId);
+	INFO_PRINTF1(_L("	Set ParentProcessId to Child Three "));
+
+	//child process III
+	RProcess childProcThree;
+	ret = childProcThree.Create(KChildThreeExe,KNullDesC);
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupClosePushL(childProcThree);
+	
+	INFO_PRINTF2(_L("	Create Child Three returned : %d"),ret);
+
+	//attach commandline to child process
+	TRAP(ret,childProcThreeCmdln->SetProcessEnvironmentL(childProcThree));
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	INFO_PRINTF1(_L("	Attach CommandLine of Child Three to its Process "));
+
+	childProcThree.Resume();
+
+	//Time for the child process to launch itself
+	User::After(1000000);
+
+	//child process Id is reqd to monitor if it gets killed on its parent's termination
+	TUint64 childProcThreeId = childProcThree.Id();
+	INFO_PRINTF2(_L("	Child Three Id = 0x%lx "),childProcThreeId);
+
+	CChildProcess* childProcess=NULL;
+	TRAP(ret, childProcess=CChildProcess::NewL(parentProc,childProcOneId));
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupStack::PushL(childProcess);
+
+	TExitType exitType = parentProc.ExitType();
+	TEST(exitType == EExitTerminate);
+	TInt exitReason = parentProc.ExitReason();
+	TEST(exitReason == 0);
+	if(exitType == EExitTerminate && exitReason == 0)
+		{
+		INFO_PRINTF1(_L("	Parent process is Terminated "));
+		}
+
+	exitType = childProcOne.ExitType();
+	TEST(exitType == EExitTerminate);
+	exitReason = childProcOne.ExitReason();
+	TEST(exitReason == 0);
+	if(exitType == EExitTerminate && exitReason == 0)
+		{
+		INFO_PRINTF1(_L("	Child I is killed "));
+		}
+
+	exitType = childProcTwo.ExitType();
+	TEST(exitType == EExitTerminate);
+	exitReason = childProcTwo.ExitReason();
+	TEST(exitReason == 0);
+	if(exitType == EExitTerminate && exitReason == 0)
+		{
+		INFO_PRINTF1(_L("	Child II is killed "));
+		}
+
+	//Wait 1sec to close the child process
+	User::After(1000000);
+	exitType = childProcThree.ExitType();
+	TEST(exitType == EExitTerminate);
+	exitReason = childProcThree.ExitReason();
+	TEST(exitReason == 0);
+	if(exitType == EExitTerminate && exitReason == 0)
+		{
+		INFO_PRINTF1(_L("	Child III is killed "));
+		}
+
+	CleanupStack::PopAndDestroy(childProcess);
+	CleanupStack::PopAndDestroy(&childProcThree);
+	CleanupStack::PopAndDestroy(childProcThreeCmdln);
+	CleanupStack::PopAndDestroy(&childProcTwo);
+	CleanupStack::PopAndDestroy(childProcTwoCmdln);
+	CleanupStack::PopAndDestroy(&childProcOne);
+	CleanupStack::PopAndDestroy(childProcOneCmdln);
+	CleanupStack::PopAndDestroy(&parentProc);
+	CleanupStack::PopAndDestroy(parentProcCmdln);
+	}
+
+/**
+ @SYMTestCaseID APPFWK-APPARC-0020
+
+ @SYMPREQ PREQ1123
+
+ @SYMTestCaseDesc The Test determines that more than one Child for a Parent remain alive on their parent's termination.
+
+ @SYMTestPriority Medium
+
+ @SYMTestStatus Implemented
+
+ @SYMTestActions. Creates and launches a process (parent). Creates 3 processes (child I,II,III) without passing the first (parent) process ID.
+ Launches all the 3 processes. Terminates parent and checks the existance of the child processes. All 3 children should remain alive.
+ API Calls:\n
+ RProcess::Create(const TDesC &aFileName, const TDesC &aCommand, TOwnerType aType=EOwnerProcess);\n
+ RProcess::Resume();
+ RProcess::ExitType() const;
+ RProcess::ExitReason() const;
+ RProcess::Id() const;
+ RProcess::Terminate(TInt aReason);
+ CApaCommandLine::SetProcessEnvironmentL(RProcess &aProcess) const;
+ CApaCommandLine::NewLC();
+ 
+ @SYMTestExpectedResults Existence of all child processes.\n
+
+ */
+void CT_ProcStep::testNoChildSetToTerminateL(void)
+	{
+	TInt ret(0);
+
+	//commandline for parent process
+	CApaCommandLine* parentProcCmdln=CApaCommandLine::NewLC();
+	INFO_PRINTF1(_L("	CommandLine for Parent Process created "));
+
+	//parent process
+	RProcess parentProc;
+	ret = parentProc.Create(KParentExe,KNullDesC);
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupClosePushL(parentProc);
+	INFO_PRINTF2(_L("	Create Parent Process returned : %d"),ret);
+
+	//attach commandline to parent process
+	TRAP(ret,parentProcCmdln->SetProcessEnvironmentL(parentProc));
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	INFO_PRINTF1(_L("	Attach CommandLine to Process "));
+
+	INFO_PRINTF1(_L("	Run Parent Process "));
+	parentProc.Resume();
+	//Time for the parent process to launch itself
+	User::After(500000);
+
+	//commandline for child process
+	//Get parent process ID here
+	TUint64 parentProcId = parentProc.Id();
+	INFO_PRINTF2(_L("	Parent Process Id = 0x%lx "),parentProcId);
+
+	//Child I
+	CApaCommandLine* childProcOneCmdln=CApaCommandLine::NewLC();
+	INFO_PRINTF1(_L("	CommandLine for Child One created "));
+
+	//child process
+	RProcess childProcOne;
+	ret = childProcOne.Create(KChildOneExe,KNullDesC);
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupClosePushL(childProcOne);
+	
+	INFO_PRINTF2(_L("	Create Child One returned : %d"),ret);
+
+	//attach commandline to child process
+	TRAP(ret,childProcOneCmdln->SetProcessEnvironmentL(childProcOne));
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	INFO_PRINTF1(_L("	Attach CommandLine of Child One to its Process "));
+
+	childProcOne.Resume();
+
+	//Time for the child process to launch itself
+	User::After(1000000);
+
+	//child process Id is reqd to monitor if it gets killed on its parent's termination
+	TUint64 childProcOneId = childProcOne.Id();
+	INFO_PRINTF2(_L("	Child Process Id = 0x%lx "),childProcOneId);
+
+	//Child II
+	CApaCommandLine* childProcTwoCmdln=CApaCommandLine::NewLC();
+	INFO_PRINTF1(_L("	CommandLine for Child Two created "));
+
+	//child process
+	RProcess childProcTwo;
+	ret = childProcTwo.Create(KChildTwoExe,KNullDesC);
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupClosePushL(childProcTwo);
+	
+	INFO_PRINTF2(_L("	Create Child Two returned : %d "),ret);
+
+	//attach commandline to child process
+	TRAP(ret,childProcTwoCmdln->SetProcessEnvironmentL(childProcTwo));
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	INFO_PRINTF1(_L("	Attach CommandLine of Child Two to its Process "));
+
+	INFO_PRINTF1(_L("	Run Child Two "));
+	childProcTwo.Resume();
+	//Time for the child process to launch itself
+	User::After(1000000);
+
+	//child process Id is reqd to monitor if it gets killed on its parent's termination
+	TUint64 childProcTwoId = childProcTwo.Id();
+	INFO_PRINTF2(_L("	Child Two Id = 0x%lx "),childProcTwoId);
+
+	//Child III
+	CApaCommandLine* childProcThreeCmdln=CApaCommandLine::NewLC();
+	INFO_PRINTF1(_L("	CommandLine for Child Three created "));
+
+	//child process
+	RProcess childProcThree;
+	ret = childProcThree.Create(KChildThreeExe,KNullDesC);
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupClosePushL(childProcThree);
+	
+	INFO_PRINTF2(_L("	Create Child Three returned : %d"),ret);
+
+	//attach commandline to child process
+	TRAP(ret,childProcThreeCmdln->SetProcessEnvironmentL(childProcThree));
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	INFO_PRINTF1(_L("	Attach CommandLine of Child Three to its Process "));
+
+	childProcThree.Resume();
+
+	//Time for the child process to launch itself
+	User::After(1000000);
+
+	//child process Id is reqd to monitor if it gets killed on its parent's termination
+	TUint64 childProcThreeId = childProcThree.Id();
+	INFO_PRINTF2(_L("	Child Three Id = 0x%lx "),childProcThreeId);
+
+	parentProc.Terminate(KTProcTerminatingParent);
+	TExitType exitType = parentProc.ExitType();
+	TEST(exitType == EExitTerminate);
+	TInt exitReason = parentProc.ExitReason();
+	TEST(exitReason == KTProcTerminatingParent);
+	INFO_PRINTF1(_L("	Terminating parent process "));
+
+	//Time for the child processes to terminate if they really do
+	User::After(500000);
+
+	exitType = childProcOne.ExitType();
+	TEST(exitType == EExitPending);
+	if(exitType == EExitPending)
+		{
+		INFO_PRINTF1(_L("	Child I is still running "));
+		INFO_PRINTF1(_L("	So Terminating it manually ... "));
+		childProcOne.Terminate(KTProcTerminatingChildI);
+		exitType = childProcOne.ExitType();
+		TEST(exitType==EExitTerminate);
+		exitReason = childProcOne.ExitReason();
+		TEST(exitReason == KTProcTerminatingChildI);
+		}
+
+	exitType = childProcTwo.ExitType();
+	TEST(exitType == EExitPending);
+	if(exitType == EExitPending)
+		{
+		INFO_PRINTF1(_L("	Child II is still running "));
+		INFO_PRINTF1(_L("	So Terminating it manually ... "));
+		childProcTwo.Terminate(KTProcTerminatingChildII);
+		exitType = childProcTwo.ExitType();
+		TEST(exitType==EExitTerminate);
+		exitReason = childProcTwo.ExitReason();
+		TEST(exitReason == KTProcTerminatingChildII);
+		}
+
+	exitType = childProcThree.ExitType();
+	TEST(exitType == EExitPending);
+	if(exitType == EExitPending)
+		{
+		INFO_PRINTF1(_L("	Child III is still running "));
+		INFO_PRINTF1(_L("	So Terminating it manually ... "));
+		childProcThree.Terminate(KTProcTerminatingChildIII);
+		exitType = childProcThree.ExitType();
+		TEST(exitType==EExitTerminate);
+		exitReason = childProcThree.ExitReason();
+		TEST(exitReason == KTProcTerminatingChildIII);
+		}
+
+	CleanupStack::PopAndDestroy(&childProcThree);
+	CleanupStack::PopAndDestroy(childProcThreeCmdln);
+	CleanupStack::PopAndDestroy(&childProcTwo);
+	CleanupStack::PopAndDestroy(childProcTwoCmdln);
+	CleanupStack::PopAndDestroy(&childProcOne);
+	CleanupStack::PopAndDestroy(childProcOneCmdln);
+	CleanupStack::PopAndDestroy(&parentProc);
+	CleanupStack::PopAndDestroy(parentProcCmdln);
+	}
+
+/**
+ @SYMTestCaseID APPFWK-APPARC-0021
+
+ @SYMPREQ PREQ1123
+
+ @SYMTestCaseDesc The Test determines that the child receives its parent process ID correctly, when set during its creation.
+
+ @SYMTestPriority Medium
+
+ @SYMTestStatus Implemented
+
+ @SYMTestActions. Creates and launches a process (parent). Creates another process (child) setting the first(parent) process ID.
+ Parent Process Id is passed to child through SetParameter API. Launches the child process. Child obtains the parent process Id from within.
+ Child compares both the Id's and writes the results to a file. The Id's should match each other.
+ API Calls:\n
+ RProcess::Create(const TDesC &aFileName, const TDesC &aCommand, TOwnerType aType=EOwnerProcess);\n
+ RProcess::Resume();
+ RProcess::ExitType() const;
+ RProcess::ExitReason() const;
+ RProcess::Id() const;
+ RProcess::SetParameter(TInt aSlot, TInt aData);
+ CApaCommandLine::SetProcessEnvironmentL(RProcess &aProcess) const;
+ CApaCommandLine::NewLC();
+ CApaCommandLine::SetParentProcessId(TProcessId);
+ RFile::Open(RFs &aFs, const TDesC &aName, TUint aFileMode);
+ RFile::Read(TInt aPos, TDes8 &aDes) const;
+ RFile::Close();
+ RFs::Connect(TInt aMessageSlots=KFileServerDefaultMessageSlots);
+ RFs::Delete(const TDesC &aName);
+ RFs::Close();
+ @SYMTestExpectedResults Id received by child process should match its parent process Id.\n
+
+ */
+void CT_ProcStep::testIdAvailableToChildL(void)
+	{
+	TInt ret(0);
+
+	//commandline for parent process
+	CApaCommandLine* parentProcCmdln=CApaCommandLine::NewLC();
+	INFO_PRINTF1(_L("	CommandLine for Parent process created "));
+
+	//parent process
+	RProcess parentProc;
+	ret = parentProc.Create(KParentExe,KNullDesC);
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupClosePushL(parentProc);
+	INFO_PRINTF2(_L("	Create Parent Process returned : %d"),ret);
+
+	//attach commandline to parent process
+	TRAP(ret,parentProcCmdln->SetProcessEnvironmentL(parentProc));
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	INFO_PRINTF1(_L("	Attach CommandLine to Process "));
+
+	INFO_PRINTF1(_L("	Run Parent Process "));
+	parentProc.Resume();
+	//Time for the parent process to launch itself
+	User::After(500000);
+
+	//commandline for child process
+	//Get parent process ID here
+	TUint64 parentProcId = parentProc.Id();
+	INFO_PRINTF2(_L("	Parent Process Id = 0x%lx "),parentProcId);
+
+	CApaCommandLine* childProcCmdln=CApaCommandLine::NewLC();
+	INFO_PRINTF1(_L("	CommandLine for Child process created "));
+
+	//setting the parent process ID to child
+	childProcCmdln->SetParentProcessId(parentProcId);
+	INFO_PRINTF1(_L("	Set ParentProcessId to Child "));
+	
+	//child process
+	RProcess childProc;
+	ret = childProc.Create(KChildThreeExe,KNullDesC);
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupClosePushL(childProc);
+	
+	INFO_PRINTF2(_L("	Create Child Process returned : %d"),ret);
+
+	//attach commandline to child process
+	TRAP(ret,childProcCmdln->SetProcessEnvironmentL(childProc));
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	INFO_PRINTF1(_L("	Attach CommandLine to Process "));
+
+//	Setting the parent process Id in an environment slot for the child to receive.
+	ret = childProc.SetParameter(12,parentProcId);
+	TEST(ret == KErrNone);
+	INFO_PRINTF2(_L("	Set the Parent Process Id - 0x%lx to Child through SetParameter API in Slot 12 "),parentProcId);
+
+	INFO_PRINTF1(_L("	Run Child Process "));
+	childProc.Resume();
+	//Time for the child process to launch itself
+	User::After(1000000);
+
+	RFs fs;
+	RFile file;
+	ret=fs.Connect();
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	INFO_PRINTF1(_L("	Create File server session "));
+
+	ret = file.Open(fs,KFilePath,EFileWrite | EFileShareAny);
+	TEST(ret == KErrNone);
+	if(ret == KErrNone)
+		{
+		INFO_PRINTF1(_L("	File opened successfully "));
+		TBuf8<5> readData;
+		file.Read(0,readData);
+		TBuf8<5> result(KTResultPass); 
+		TEST(result==readData);
+		if(result==readData)
+			{
+			INFO_PRINTF1(_L("	Child received the parent process ID correctly ..."));
+			}
+		else
+			{
+			INFO_PRINTF1(_L("	Child Failed to receive the parent process ID ..."));
+			}
+		file.Close();
+		fs.Delete(KFilePath);
+		fs.Close();
+		INFO_PRINTF1(_L("	File Close & Delete and Session Close "));
+		}
+
+	//child process Id is reqd to monitor if it gets killed on its parent's termination
+	TUint64 childProcId = childProc.Id();
+	INFO_PRINTF2(_L("	Child Process Id = 0x%lx "),childProcId);
+
+	CChildProcess* childProcess=NULL;
+	TRAP(ret, childProcess=CChildProcess::NewL(parentProc,childProcId));
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupStack::PushL(childProcess);
+	
+	TExitType exitType = parentProc.ExitType();
+	TEST(exitType == EExitTerminate);
+	TInt exitReason = parentProc.ExitReason();
+	TEST(exitReason == 0);
+	if(exitType==EExitTerminate && exitReason == 0)
+		{
+		INFO_PRINTF1(_L("	Parent process is Terminated"));
+		}
+		
+	exitType = childProc.ExitType();
+	TEST(exitType == EExitTerminate);
+	exitReason = childProc.ExitReason();
+	TEST(exitReason == 0);
+	if(exitType==EExitTerminate && exitReason == 0)
+		{
+		INFO_PRINTF1(_L("	The child process is killed "));
+		}
+	CleanupStack::PopAndDestroy(childProcess);
+	CleanupStack::PopAndDestroy(&childProc);
+	CleanupStack::PopAndDestroy(childProcCmdln);
+	CleanupStack::PopAndDestroy(&parentProc);
+	CleanupStack::PopAndDestroy(parentProcCmdln);
+	}
+
+/**
+ @SYMTestCaseID APPFWK-APPARC-0022
+
+ @SYMPREQ PREQ1123
+
+ @SYMTestCaseDesc The Test determines that the child doesn't receive its parent process ID correctly, when not set during its creation.
+
+ @SYMTestPriority Medium
+
+ @SYMTestStatus Implemented
+
+ @SYMTestActions. Creates and launches a process (parent). Creates another process (child) without setting any parent.
+ Parent Process Id is passed to child through SetParameter API. Launches the child process. Child obtains the parent process Id from within.
+ Child compares both the Id's. The Id's should not match each other.
+ API Calls:\n
+ RProcess::Create(const TDesC &aFileName, const TDesC &aCommand, TOwnerType aType=EOwnerProcess);\n
+ RProcess::Resume();
+ RProcess::ExitType() const;
+ RProcess::ExitReason() const;
+ RProcess::Id() const;
+ RProcess::SetParameter(TInt aSlot, TInt aData);
+ CApaCommandLine::SetProcessEnvironmentL(RProcess &aProcess) const;
+ CApaCommandLine::NewLC();
+ RFile::Open(RFs &aFs, const TDesC &aName, TUint aFileMode);
+ RFile::Read(TInt aPos, TDes8 &aDes) const;
+ RFile::Close();
+ RFs::Connect(TInt aMessageSlots=KFileServerDefaultMessageSlots);
+ RFs::Delete(const TDesC &aName);
+ RFs::Close();
+ @SYMTestExpectedResults Id received by child process should not match its parent process Id.\n
+
+ */
+void CT_ProcStep::testIdNotAvailableToChildL(void)
+	{
+	TInt ret(0);
+	TInt exitReason(0);
+	
+	//commandline for parent process
+	CApaCommandLine* parentProcCmdln=CApaCommandLine::NewLC();
+	INFO_PRINTF1(_L("	CommandLine for Parent Process created "));
+
+	//parent process
+	RProcess parentProc;
+	ret = parentProc.Create(KParentExe,KNullDesC);
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupClosePushL(parentProc);
+	INFO_PRINTF2(_L("	Create Parent Process returned : %d"),ret);
+
+	//attach commandline to parent process
+	TRAP(ret,parentProcCmdln->SetProcessEnvironmentL(parentProc));
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	INFO_PRINTF1(_L("	Attach CommandLine to Process "));
+
+	INFO_PRINTF1(_L("	Run Parent Process "));
+	parentProc.Resume();
+	//Time for the parent process to launch itself
+	User::After(500000);
+
+	//commandline for child process
+	//Get parent process ID here
+	TUint64 parentProcId = parentProc.Id();
+	INFO_PRINTF2(_L("	Parent Process Id = 0x%lx "),parentProcId);
+
+	CApaCommandLine* childProcCmdln=CApaCommandLine::NewLC();
+	INFO_PRINTF1(_L("	CommandLine for Child Process created "));
+	
+	//child process
+	RProcess childProc;
+	ret = childProc.Create(KChildThreeExe,KNullDesC);
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupClosePushL(childProc);
+	
+	INFO_PRINTF2(_L("	Create Child Process returned : %d"),ret);
+
+	//attach commandline to child process
+	TRAP(ret,childProcCmdln->SetProcessEnvironmentL(childProc));
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	INFO_PRINTF1(_L("	Attach CommandLine to Process "));
+
+	//Setting the parent process Id in an environment slot for the child to receive.
+	ret = childProc.SetParameter(12,parentProcId);
+	TEST(ret == KErrNone);
+	INFO_PRINTF2(_L("	Set the Parent Process Id - 0x%lx to Child through SetParameter API in Slot 12 "),parentProcId);
+
+	INFO_PRINTF1(_L("	Run Child Process "));
+	childProc.Resume();
+	//Time for the child process to launch itself
+	User::After(1000000);
+
+	RFs fs;
+	RFile file;
+	ret = fs.Connect();
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	INFO_PRINTF1(_L("	Create File server session "));
+
+	ret = file.Open(fs,KFilePath,EFileWrite | EFileShareAny);
+	TEST(ret == KErrNone);
+	if(ret == KErrNone)
+		{
+		INFO_PRINTF1(_L("	File opened successfully "));
+		TBuf8<5> readData;
+		file.Read(0,readData);
+		TBuf8<5> result(KTResultFail); 
+		TEST(result==readData);
+		if(result==readData)
+			{
+			INFO_PRINTF1(_L("	Child did not receive the parent process ID as intended..."));
+			}
+		else
+			{
+			INFO_PRINTF1(_L("	Child received the Wrong parent process ID ..."));
+			}
+		file.Close();
+		fs.Delete(KFilePath);
+		fs.Close();
+		INFO_PRINTF1(_L("	File Close & Delete and Session Close "));
+		}
+
+	TExitType exitType = parentProc.ExitType();
+	TEST(exitType == EExitPending);
+	if(exitType == EExitPending)
+		{
+		INFO_PRINTF1(_L("	Parent is still running "));
+		INFO_PRINTF1(_L("	So Terminating it manually ... "));
+		parentProc.Terminate(KTProcTerminatingParent);
+		exitType = parentProc.ExitType();
+		TEST(exitType==EExitTerminate);
+		exitReason = parentProc.ExitReason();
+		TEST(exitReason == KTProcTerminatingParent);
+		}
+
+	exitType = childProc.ExitType();
+	TEST(exitType == EExitPending);
+	if(exitType == EExitPending)
+		{
+		INFO_PRINTF1(_L("	Child is still running "));
+		INFO_PRINTF1(_L("	So Terminating it manually ... "));
+		childProc.Terminate(KTProcTerminatingChildIII);
+		exitType = childProc.ExitType();
+		TEST(exitType==EExitTerminate);
+		exitReason = childProc.ExitReason();
+		TEST(exitReason == KTProcTerminatingChildIII);
+		}
+
+	CleanupStack::PopAndDestroy(&childProc);
+	CleanupStack::PopAndDestroy(childProcCmdln);
+	CleanupStack::PopAndDestroy(&parentProc);
+	CleanupStack::PopAndDestroy(parentProcCmdln);
+	}
+
+void CT_ProcStep::testChildExistsL(void)
+/**
+ * Calls other functions which implement the test cases.
+ */
+	{
+	INFO_PRINTF1(_L("Begin - testChildSetToTerminateL ----------- "));
+	TRAPD(ret,testChildSetToTerminateL());
+	TEST(ret==KErrNone);
+	INFO_PRINTF1(_L("End - testChildSetToTerminateL ----------- \n"));
+
+	INFO_PRINTF1(_L("Begin - testChildSetToRemainL ----------- "));
+	TRAP(ret,testChildSetToRemainL());
+	TEST(ret==KErrNone);
+	INFO_PRINTF1(_L("End - testChildSetToRemainL ----------- \n"));
+
+	INFO_PRINTF1(_L("Begin - testTwoChildsOneToTerminateAndOtherToRemainL ----------- "));
+	TRAP(ret,testTwoChildsOneToTerminateAndOtherToRemainL());
+	TEST(ret==KErrNone);
+	INFO_PRINTF1(_L("End - testTwoChildsOneToTerminateAndOtherToRemainL ----------- \n"));
+
+	INFO_PRINTF1(_L("Begin - testParentWithoutAChildL ----------- "));
+	TRAP(ret,testParentWithoutAChildL());
+	TEST(ret==KErrNone);
+	INFO_PRINTF1(_L("End - testParentWithoutAChildL ----------- \n"));
+
+	INFO_PRINTF1(_L("Begin - testAllChildsSetToTerminateL ----------- "));
+	TRAP(ret,testAllChildsSetToTerminateL());
+	TEST(ret==KErrNone);
+	INFO_PRINTF1(_L("End - testAllChildsSetToTerminateL ----------- \n"));
+
+	INFO_PRINTF1(_L("Begin - testNoChildSetToTerminateL ----------- "));
+	TRAP(ret,testNoChildSetToTerminateL());
+	TEST(ret==KErrNone);
+	INFO_PRINTF1(_L("End - testNoChildSetToTerminateL ----------- \n"));
+
+	INFO_PRINTF1(_L("Begin - testIdAvailableToChildL ----------- "));
+	TRAP(ret,testIdAvailableToChildL());
+	TEST(ret==KErrNone);
+	INFO_PRINTF1(_L("End - testIdAvailableToChildL ----------- \n"));
+
+	INFO_PRINTF1(_L("Begin - testIdNotAvailableToChildL ----------- "));
+	TRAP(ret,testIdNotAvailableToChildL());
+	TEST(ret==KErrNone);
+	INFO_PRINTF1(_L("End - testIdNotAvailableToChildL ----------- \n"));
+	}
+
+TVerdict CT_ProcStep::doTestStepL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	INFO_PRINTF1(_L("Test child process existence when parent terminates/exists begins here ------- \n"));
+
+	__UHEAP_MARK;
+
+	CActiveScheduler* scheduler = new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(scheduler);
+	CleanupStack::PushL(scheduler);
+
+	TRAPD(ret,testChildExistsL());
+	TEST(ret==KErrNone);
+
+	CleanupStack::PopAndDestroy(scheduler);
+
+	__UHEAP_MARKEND;
+
+	INFO_PRINTF1(_L("Test child process existence when parent terminates/exists ends here ------- \n"));
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_ProcStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,87 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#if (!defined __T_PROC_STEP_H__)
+#define __T_PROC_STEP_H__
+
+#include <apacmdln.h>
+#include <apgcli.h>
+#include "ApparcTestServer.h"
+#include <apparc.h>
+
+_LIT(KT_ProcStep,"T_Proc");
+_LIT(KParentExe, "ParentProcess");
+_LIT(KChildOneExe, "ChildI");
+_LIT(KChildTwoExe, "ChildII");
+_LIT(KChildThreeExe, "ChildIII");
+_LIT(KT_ParentProcessID,"ParentProcessID");
+_LIT(KFilePath,"c:\\logs\\TestExecute\\Proc.txt");
+_LIT8(KTResultPass, "PASS");
+_LIT8(KTResultFail, "FAIL");
+
+
+//!  A CT_ProcStep test class.
+
+/**  Checks for child process existence when its parent terminates. */
+
+class CT_ProcStep : public CTestStep
+	{
+public:
+	CT_ProcStep();
+	~CT_ProcStep();
+	virtual TVerdict doTestStepL();
+private:
+	void testChildExistsL(void);
+	void testChildSetToTerminateL(void);
+	void testChildSetToRemainL(void);
+	void testTwoChildsOneToTerminateAndOtherToRemainL(void);
+	void testParentWithoutAChildL(void);
+	void testAllChildsSetToTerminateL(void);
+	void testNoChildSetToTerminateL(void);
+	void testIdAvailableToChildL(void);
+	void testIdNotAvailableToChildL(void);
+	};
+
+
+//!  A support class for CT_ProcStep test class.
+
+/**  An active object which monitors the current status of child when its parent terminates. */
+
+class CChildProcess : public CActive
+	{
+public:
+	static CChildProcess* NewL(RProcess& aParentProcess,TProcessId aChildProcessId);
+	void RunL();
+	void DoCancel();
+	~CChildProcess();
+private:
+	void ConstructL();
+	CChildProcess(RProcess& aParentProcess,TProcessId aChildProcessId);
+private:
+	TProcessId iChildProcessId;
+	RProcess iParentProcess;
+	RProcess iChildProcess;
+	TExitType iExitType;
+	TInt iCount;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_RApaLsSessionStep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,2461 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include <f32file.h>
+#include <fbs.h>
+#include <s32std.h> 
+#include <s32stor.h> 
+#include <s32file.h> 
+
+#include <coecntrl.h>
+#include <coeccntx.h>
+#include <coemain.h>
+#include <coeview.h>
+#include <eikdialg.h>
+#include <eikdoc.h>
+#include <eikapp.h>
+#include <eiksrvc.h>
+#include <eikconso.h>
+
+#include <apaid.h>
+#include "..\apparc\apadll.h"
+#include <apgaplst.h>
+#include <apgicnfl.h>
+#include <apgdoor.h>
+#include <apfrec.h>
+#include <apfctlf.h>
+#include <apgctl.h>
+#include <apgaplst.h>
+#include <apaflrec.h>
+#include <apgcli.h>
+#include <apacmdln.h>
+#include <apsserv.h>
+#include <barsread.h>
+#include "tstapp.h"
+#include <appfwk_test.h>
+
+#include "T_RApaLsSessionStep.h"
+#include "appfwk_test_AppUi.h"
+#include "TRApaLsSessionStartAppTest.h"
+#include "TIconLoaderAndIconArrayForLeaks.h"  
+
+#if !defined(__E32TEST_H__)
+#include <e32test.h>
+#endif
+
+// Literals & Constants
+_LIT(KCompleted, "Completed.");
+const TUint KBytesToRead=100;
+
+
+/****************************************
+ Auxiliary functions used by test cases
+*****************************************/
+void CT_RApaLsSessionTestStep::setup()
+	{
+#if defined(__EPOC32__)
+	
+	TFullName filePath=_L("c:\\docs\\tstapp.doc");
+	TFullName tempPath=_L("c:\\system\\temp\\");
+	// if we're on the rack create the directories we need
+	TParse parser;
+	parser.Set(filePath,NULL,NULL);
+	iFs.MkDirAll(parser.DriveAndPath());
+	parser.Set(tempPath,NULL,NULL);
+	iFs.MkDirAll(parser.DriveAndPath());
+#endif
+	}
+
+
+////////////////////////////
+// Might actually be tests......
+/////////////////////////////
+
+void CT_RApaLsSessionTestStep::TestAppListInfoDataInterrogationSetupL()
+	{
+	//
+	INFO_PRINTF1(_L("Initialising App List Cache using GetAllApps....."));
+	TInt ret = iLs.GetAllApps();
+	TEST(ret==KErrNone);
+	INFO_PRINTF1(KCompleted);
+
+// get the full app count
+	INFO_PRINTF1(_L("Getting AppCount....."));
+	TInt count=0;
+	ret = iLs.AppCount(count);
+	TEST(ret==KErrNone);
+	TEST(count>=1);
+	INFO_PRINTF1(KCompleted);
+
+// prepare to get a list of embeddable apps
+	INFO_PRINTF1(_L("Initialising embeddable app list cache using GetEmbeddableApps....."));
+	ret = iLs.GetEmbeddableApps();
+	TEST(ret==KErrNone);
+	INFO_PRINTF1(KCompleted);
+
+// get the embedded app count
+	INFO_PRINTF1(_L("Initialising embeddable app list cache using EmbeddableAppCount....."));
+	count=0;
+	ret = iLs.EmbeddableAppCount(count);
+	TEST(ret==KErrNone);
+	TEST(count>=1);
+	INFO_PRINTF1(KCompleted);
+	}	
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestAppInfo1
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test RApaLsSession::GetNextApp() 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call RApaLsSession::GetAllApps() to initialize the process of
+   getting all applications in the cached list. Traverse the application list
+   by calling RApaLsSession::GetNextApp() to search for application tstapp.
+   Test the application info obtained from GetNextApp() to ensure the application
+   info obtained is of tstapp. Complete traversal of the list to ensure that at
+   the end of the list, the enum ENoMoreAppInList is returned by GetNextApp().\n
+   API Calls:\n	
+   RApaLsSession::GetAllApps() const\n
+   RApaLsSession::GetNextApp(TApaAppInfo& aInfo) const\n
+   
+   @SYMTestExpectedResults The test compares the results obtained with expected values.
+    
+ */
+void CT_RApaLsSessionTestStep::TestAppInfo1()
+	{
+	
+	INFO_PRINTF1(_L("Testing RApaLsSession::ENoMoreAppsInList....attempt to get an app"));
+    //Go to end of Applist for next test... 
+	TApaAppInfo info;
+	TInt ret = iLs.GetAllApps();
+	TEST(ret==KErrNone);
+
+	do
+		{
+ 		ret=iLs.GetNextApp(info);
+ 		}
+ 	while (ret != RApaLsSession::ENoMoreAppsInList);
+
+	//try to get another app (there arn't any more)
+	ret = iLs.GetNextApp(info);
+	TEST(ret==RApaLsSession::ENoMoreAppsInList);
+	
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestAppInfo2
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test RApaLsSession::GetNextApp() 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call RApaLsSession::GetAllApps() to initialize the process of
+   getting all applications in the cached list. Traverse the application list
+   by calling RApaLsSession::GetNextApp() to search for application tstapp.
+   Test the application information obtained from GetNextApp() to ensure that
+   information retrieved is of tstapp.\n
+   API Calls:\n	
+   RApaLsSession::GetAllApps() const\n
+   RApaLsSession::GetNextApp(TApaAppInfo& aInfo) const\n
+   
+   @SYMTestExpectedResults The test compares the results obtained with expected values.
+    
+ */
+void CT_RApaLsSessionTestStep::TestAppInfo2()
+	{
+	INFO_PRINTF1(_L("Testing RApaLsSession::GetNextApps() return info...."));
+	_LIT(KLitAppPath,"z:\\sys\\bin\\tstapp.exe");
+	TFullName appPath(KLitAppPath);
+
+	TApaAppInfo info;
+	TInt ret = iLs.GetAllApps();
+	TEST(ret==KErrNone);
+
+	do
+	{
+		iLs.GetNextApp(info);
+	}
+	while (ret==KErrNone && info.iUid!=KUidTestApp);
+		
+	TEST(ret==KErrNone);
+	TEST(info.iUid==KUidTestApp);
+	info.iFullName.LowerCase();	
+	TEST(info.iFullName.Compare(appPath) == 0);
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestAppInfo3
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test RApaLsSession::GetAppInfo(). 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call RApaLsSession::GetAppInfo() by passing the Uid of test
+   application tstapp and test the application info obtained from GetAppInfo()
+   to ensure the obtained information is of test application tstapp.\n
+   API Calls:\n	
+   RApaLsSession::GetAppInfo(TApaAppInfo& aInfo,TUid aAppUid) const\n
+   
+   @SYMTestExpectedResults The test confirms that RApaLsSession::GetAppInfo()
+   returns the expected application info.
+    
+ */
+void CT_RApaLsSessionTestStep::TestAppInfo3()
+	{
+	INFO_PRINTF1(_L("Testing RApaLsSession::GetAppInfo()...."));
+	_LIT(KLitAppPath,"z:\\sys\\bin\\tstapp.exe");
+	TFullName appPath(KLitAppPath);
+	// Get info for an app that exists
+	TApaAppInfo info;
+	TInt ret = iLs.GetAppInfo(info,KUidTestApp);
+	TEST(ret==KErrNone);
+	TEST(info.iUid==KUidTestApp);
+	info.iFullName.LowerCase();	
+	TEST(info.iFullName.Compare(appPath) == 0);
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestAppInfo4
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test if RApaLsSession::GetAppInfo() return KErrNotFound. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions The method calls RApaLsSession::GetAppInfo() by passing the null Uid
+   KNullUid. Observe whether KErrNotFound is returned when Uid that doesn't match
+   is passed to GetAppInfo().\n
+   API Calls:\n	
+   RApaLsSession::GetAppInfo(TApaAppInfo& aInfo,TUid aAppUid) const\n
+   
+   @SYMTestExpectedResults The test confirms RApaLsSession::GetAppInfo() returns
+   KErrNotFound when no match is found for the Uid passed.\n
+    
+ */
+void CT_RApaLsSessionTestStep::TestAppInfo4()
+	{
+	INFO_PRINTF1(_L("Testing RApaLsSession::GetAppInfo()....non-existent app"));
+
+	TApaAppInfo info;
+	TInt ret = iLs.GetAppInfo(info,KNullUid);
+	TEST(ret==KErrNotFound);
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServerIconSizeCountL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test Get the number of icon sizes for testapp app. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Allocate a flat dynamic buffer which would hold available icon
+   sizes for tstapp. Call RApaLsSession::GetAppIconSizes() to store the sizes
+   of icons available for the app tstapp to the allocated flat dynamic buffer.
+   Check that it is non zero, i.e. that a number of icon sizes has been retreived
+   for testapp.\n
+   API Calls:\n	
+   RApaLsSession::GetAppIconSizes(TUid aAppUid, CArrayFixFlat<TSize>& aArrayToFill) const\n
+   
+   @SYMTestExpectedResults aTestIconSizeArray->Count() is greater than 0.
+    
+ */
+void CT_RApaLsSessionTestStep::TestServerIconSizeCountL(CArrayFixFlat<TSize>& aTestIconSizeArray)
+	{
+	INFO_PRINTF1(_L("Test RApaLsSession::GetAppIconSizes..."));
+
+	TInt ret=iLs.GetAppIconSizes(KUidTestApp,aTestIconSizeArray);
+	if(ret==KErrNoMemory)
+		User::Leave(KErrNoMemory);
+	TEST(ret==KErrNone);
+	TEST(aTestIconSizeArray.Count()!=0);
+	
+	INFO_PRINTF1(KCompleted);
+	}
+
+
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServerIconLoadingBySize1L
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test loading of Icon by size. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Allocate a flat dynamic buffer which would hold available icon
+   sizes for tstapp. Call RApaLsSession::GetAppIconSizes() to store the sizes
+   of icons available for the app tstapp to the allocated flat dynamic buffer.
+   Call RApaLsSession::GetAppIcon() by passing each of the icon sizes stored.
+   Verify whether icon is retrieved each time by GetAppIcon().\n
+   API Calls:\n	
+   RApaLsSession::GetAppIcon(TUid aAppUid, TSize aSize, CApaMaskedBitmap& aAppBitmap) const\n
+   
+   @SYMTestExpectedResults The results obtained are compared with the expected values to verify
+   functionality of RApaLsSession::GetAppIcon().
+    
+ */
+void CT_RApaLsSessionTestStep::TestServerIconLoadingBySize1L(CArrayFixFlat<TSize>& aTestIconSizeArray)
+	{
+	INFO_PRINTF1(_L("Test RApaLsSession::GetAppIcon....Compare icon sizes"));
+
+	for(TInt i=0;i<aTestIconSizeArray.Count();i++)
+		{
+		CApaMaskedBitmap* iconBySize=CApaMaskedBitmap::NewLC();
+		TInt ret=iLs.GetAppIcon(KUidTestApp,aTestIconSizeArray[i],*iconBySize); //by Size
+		if(ret==KErrNoMemory)
+			User::Leave(KErrNoMemory);
+		TEST(ret==KErrNone);
+		TEST(iconBySize->SizeInPixels()==aTestIconSizeArray[i]);
+		CleanupStack::PopAndDestroy(iconBySize);
+		}
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServerIconLoadingBySize2L
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test loading of Icon by size. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Allocate a flat dynamic buffer which would hold available icon
+   sizes for tstapp. Call RApaLsSession::GetAppIconSizes() to store the sizes
+   of icons available for the app tstapp to the allocated flat dynamic buffer.
+   Call RApaLsSession::GetAppIcon() by passing each of the icon sizes stored.
+   Test calling RApaLsSession::GetAppIcon() by specifying reduced size than
+   the actual icon size. Since no match would be found, KErrNotFound should be
+   returned.\n
+   API Calls:\n	
+   RApaLsSession::GetAppIcon(TUid aAppUid, TSize aSize, CApaMaskedBitmap& aAppBitmap) const\n
+   
+   @SYMTestExpectedResults The results obtained are compared with the expected values to verify
+   functionality of RApaLsSession::GetAppIcon().
+    
+ */
+void CT_RApaLsSessionTestStep::TestServerIconLoadingBySize2L(CArrayFixFlat<TSize>& aTestIconSizeArray)
+	{
+	INFO_PRINTF1(_L("Test RApaLsSession::GetAppIcon....Compare icon sizes that don't match"));
+
+	// now try non exact sizes
+	CApaMaskedBitmap* iconBySize=CApaMaskedBitmap::NewLC();
+	TInt ret=iLs.GetAppIcon(KUidTestApp,(aTestIconSizeArray[0])+TSize(-5,-5),*iconBySize); //by Size
+	if(ret==KErrNoMemory)
+		User::Leave(KErrNoMemory);
+	TEST(ret==KErrNotFound);
+	CleanupStack::PopAndDestroy(iconBySize);
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServerIconLoadingBySize3L
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test loading of Icon by size. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Allocate a flat dynamic buffer which would hold available icon
+   sizes for tstapp. Call RApaLsSession::GetAppIconSizes() to store the sizes
+   of icons available for the app tstapp to the allocated flat dynamic buffer.
+   Call RApaLsSession::GetAppIcon() by passing each of the icon sizes stored.
+   Test GetAppIcon() again by specifying an increased size than the
+   actual icon size. Observe whether the GetAppIcon() in this case gets the
+   closest icon available.\n
+   API Calls:\n	
+   RApaLsSession::GetAppIcon(TUid aAppUid, TSize aSize, CApaMaskedBitmap& aAppBitmap) const\n
+   
+   @SYMTestExpectedResults The results obtained are compared with the expected values to verify
+   functionality of RApaLsSession::GetAppIcon().
+    
+ */
+void CT_RApaLsSessionTestStep::TestServerIconLoadingBySize3L(CArrayFixFlat<TSize>& aTestIconSizeArray)
+	{
+	INFO_PRINTF1(_L("Test RApaLsSession::GetAppIcon....Compare icon sizes that don't match."));
+	for(TInt ii=0;ii<aTestIconSizeArray.Count();ii++)
+		{
+		CApaMaskedBitmap* iconBySize=CApaMaskedBitmap::NewLC();
+		TInt ret=iLs.GetAppIcon(KUidTestApp,(aTestIconSizeArray[ii])+TSize(5,5),*iconBySize); //by Size
+		if(ret==KErrNoMemory)
+			User::Leave(KErrNoMemory);
+		TEST(ret==KErrNone);
+		TEST(iconBySize->SizeInPixels()==aTestIconSizeArray[ii]); // should get size below always!!!
+		CleanupStack::PopAndDestroy(iconBySize);
+		}
+	INFO_PRINTF1(KCompleted);
+	}
+
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestAppListInvalidL()
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test .
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Test RApaLsSession::AppForDocument() to recognize data type &
+   applications that can handle the data type of data stored in the specified
+   file. The test is performed on files of one byte and zero byte sizes.
+   Observe that on both occasions the API returns Uid of an application that
+   can handle text \ plain data type.\n
+   Test RApaLsSession::AppForDataType() to recognize Uid of an application
+   that can handle a specified data type. To do this the test calls
+   RApaLsSession::RecognizeData() which gets the data type for data taken
+   from a specified file. The test is performed on files of one byte and zero
+   byte sizes. The test ensures that RApaLsSession::AppForDataType() doesn't
+   return KNullUid for both sizes of the file.\n
+   API Calls:\n	
+   RApaLsSession::AppForDocument(const TDesC& aFileName, TUid& aUid, TDataType& aDataType) const\n
+   RApaLsSession::RecognizeData(const TDesC& aName, const TDesC8& aBuffer, TDataRecognitionResult& aDataType) const\n
+   RApaLsSession::AppForDataType(const TDataType& aDataType, TUid& aAppUid) const\n
+   
+   @SYMTestExpectedResults Test ensures that the data recognition functions identify the data type of
+   data in a file and the application capable of handling the specified
+   data type.
+   
+ */
+void CT_RApaLsSessionTestStep::TestAppListInvalidL()
+	{
+	__UHEAP_MARK;
+	TestAppListInvalidSetupL();
+	__UHEAP_MARKEND;
+	
+	INFO_PRINTF1(_L("Test RApaLsSession::GetNextApp() never returns RApaLsSession::EAppListInvalid."));
+
+	TApaAppInfo info;
+	TInt ret=0;
+	while(ret==KErrNone)
+		{
+		ret=iLs.GetNextApp(info);
+		}
+
+	//tests GetNextApp() never returns RApaLsSession::EAppListInvalid
+	TEST(ret!=RApaLsSession::EAppListInvalid);
+	TEST(ret==RApaLsSession::ENoMoreAppsInList);
+	INFO_PRINTF1(KCompleted);
+	}
+
+
+void CT_RApaLsSessionTestStep::TestAppListInvalidSetupL()
+	{
+	INFO_PRINTF1(_L("Setting up Applist invalid test."));
+	
+	_LIT(KTempAppDir, "C:\\private\\10003a3f\\import\\apps\\");
+	_LIT(KTempRegPath, "C:\\private\\10003a3f\\import\\apps\\tstapp_reg.rsc");
+	TFullName regPath=_L("z:\\private\\10003a3f\\import\\apps\\tstapp_reg.rsc");
+	
+	CFileMan* iAppListInvalidTestFileMan = CFileMan::NewL (iFs);
+	CleanupStack::PushL(iAppListInvalidTestFileMan);
+	
+	INFO_PRINTF1(_L("Copy tstapp files to C: drive......."));
+	TInt rtn=iFs.MkDir(KTempAppDir);
+	TEST(rtn==KErrNone||rtn==KErrAlreadyExists); 
+	TEST(iAppListInvalidTestFileMan->Copy(regPath, KTempRegPath)==KErrNone);	//Just to start the idle update.
+
+	INFO_PRINTF1(_L("Get app list......."));
+	TInt ret = iLs.GetAllApps();
+	TEST(ret==KErrNone);
+
+	INFO_PRINTF1(_L("Remove temp files from C: drive......."));
+	TRequestStatus status;
+	TTime tempTime(0); // added tempTime to avoid asynch CFileMan::Attribs request completing with KErrArgument
+	TEST(iAppListInvalidTestFileMan->Attribs(KTempAppDir,0,KEntryAttReadOnly, tempTime, CFileMan::ERecurse, status)==KErrNone);
+	
+	User::WaitForRequest(status);
+	TEST(status.Int() == KErrNone);
+	INFO_PRINTF1(_L("Deleting Reg file......."));
+	TEST(iAppListInvalidTestFileMan->Delete(KTempRegPath)==KErrNone);	//Just to start the idle update.
+	INFO_PRINTF1(_L("Removing App dir......."));
+	TEST(iAppListInvalidTestFileMan->RmDir(KTempAppDir)==KErrNone);
+	CleanupStack::PopAndDestroy(iAppListInvalidTestFileMan);
+
+	INFO_PRINTF1(KCompleted);
+	}
+
+
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestAppListRecognizeDataL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test data recognition functions of RApaLsSession.
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Test RApaLsSession::AppForDocument() to recognize data type &
+   applications that can handle the data type of data stored in the specified
+   file. The test is performed on files of one byte and zero byte sizes.
+   Observe that on both occasions the API returns Uid of an application that
+   can handle text \ plain data type.\n
+   Test RApaLsSession::AppForDataType() to recognize Uid of an application
+   that can handle a specified data type. To do this the test calls
+   RApaLsSession::RecognizeData() which gets the data type for data taken
+   from a specified file. The test is performed on files of one byte and zero
+   byte sizes. The test ensures that RApaLsSession::AppForDataType() doesn't
+   return KNullUid for both sizes of the file.\n
+   API Calls:\n	
+   RApaLsSession::AppForDocument(const TDesC& aFileName, TUid& aUid, TDataType& aDataType) const\n
+   RApaLsSession::RecognizeData(const TDesC& aName, const TDesC8& aBuffer, TDataRecognitionResult& aDataType) const\n
+   RApaLsSession::AppForDataType(const TDataType& aDataType, TUid& aAppUid) const\n
+   
+   @SYMTestExpectedResults Test ensures that the data recognition functions identify the data type of
+   data in a file and the application capable of handling the specified
+   data type.
+    
+ */
+void CT_RApaLsSessionTestStep::TestAppListRecognizeDataL()
+	{
+	// The following tests will only succeed if the text recogniser and an app which likes text files are both installed
+	// The tests check that file recognisers work for zero and non zero length files.
+	INFO_PRINTF1(_L("Testing AppForDocument(), RecognizeData() and AppForDataType()"));
+	TInt ret;
+	TUid appUid=KNullUid;
+    TDataType dataType;
+	INFO_PRINTF1(_L("Testing 1 byte text file recognition"));
+    ret = iLs.AppForDocument(_L("z:\\system\\data\\one_byte.txt"), appUid,dataType);
+	TEST(ret==KErrNone);
+	TEST(appUid!=KNullUid);
+	INFO_PRINTF1(KCompleted);
+	
+	appUid=KNullUid;
+	INFO_PRINTF1(_L("Testing zero byte text file recognition"));
+    ret = iLs.AppForDocument(_L("z:\\system\\data\\zero_len.txt"), appUid,dataType);
+	TEST(ret==KErrNone);
+	TEST(appUid!=KNullUid);
+	INFO_PRINTF1(KCompleted);
+	
+	// this following exihibits a defect which was fixed for Release 6 is fixed.
+	// KNullUid was recognized for zero length text files using this method before the fix.
+	appUid=KNullUid;
+	TBuf8<255> buffer;
+    buffer.FillZ(255);
+    buffer[0] = 'a';	// We used to fill it entirely with zeroes but an ICL recognizer know interferes 
+    					// with this, so we added an 'a'
+	TDataRecognitionResult recogResult;
+
+	appUid=KNullUid;
+	INFO_PRINTF1(_L("Testing 1 byte text file recognition - lengthy method"));
+    ret = iLs.RecognizeData(_L("z:\\system\\data\\one_byte.txt"),buffer,recogResult);
+	TEST(ret==KErrNone);
+    ret = iLs.AppForDataType(recogResult.iDataType,appUid);
+	TEST(ret==KErrNone);
+	TEST(appUid!=KNullUid);
+	INFO_PRINTF1(KCompleted);
+
+	appUid=KNullUid;
+	INFO_PRINTF1(_L("Testing zero byte text file recognition -lengthy method"));
+	ret = iLs.RecognizeData(_L("z:\\system\\data\\zero_len.txt"),buffer,recogResult);
+	TEST(ret==KErrNone);
+    ret = iLs.AppForDataType(recogResult.iDataType,appUid);
+	TEST(ret==KErrNone);
+	TEST(appUid!=KNullUid);
+	INFO_PRINTF1(KCompleted);
+	
+	// the following attempts to open a file of an unknown mime type with extension .UnrecognisableExtention
+	
+	INFO_PRINTF1(_L("Testing RecognizeData() with unrecognizable file type..."));
+	buffer.FillZ(255);
+	_LIT8(KLitUnRecog,"");
+	iLs.FlushRecognitionCache();
+	recogResult.Reset();
+	//First call to RecognizeData() does not utilize the cache
+	User::LeaveIfError(iLs.RecognizeData(_L("z:\\system\\data\\FileWithUnknownMimeType.UnrecognisableExtention"),buffer,recogResult));
+	TEST(recogResult.iDataType.Des8().CompareF(KLitUnRecog)==0);
+	recogResult.Reset();
+	//Second call to RecognizeData() utilizes the cache
+	User::LeaveIfError(iLs.RecognizeData(_L("z:\\system\\data\\FileWithUnknownMimeType.UnrecognisableExtention"),buffer,recogResult));
+	TEST(recogResult.iDataType.Des8().CompareF(KLitUnRecog)==0);
+	INFO_PRINTF1(_L("Completed Testing unrecognizable file type..."));
+	
+   	}
+   	
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestAppListRecognizeDataBufferOnlyL
+  
+   @SYMPREQ INC064138
+  
+   @SYMTestCaseDesc Test data recognition functions of RApaLsSession without a filename.
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions 
+   
+   @SYMTestExpectedResults Test ensures that the data recognition functions identify the data type of
+   data in a file.
+ */
+void CT_RApaLsSessionTestStep::TestAppListRecognizeDataBufferOnlyL()
+	{
+	INFO_PRINTF1(_L("Testing recognition without filename"));
+	
+	TDataRecognitionResult rr;
+    _LIT8(KTestBuffer, "Text_TestRecognizer");
+    rr.Reset();
+    TInt error = iLs.RecognizeData(KNullDesC, KTestBuffer, rr);
+    if (rr.iConfidence != CApaDataRecognizerType::ECertain)
+        {
+        INFO_PRINTF1(_L("Error: confidence should be ECertain"));
+        TEST(EFalse);
+        }
+    
+    _LIT8(KAnotherBuffer, "AnotherText");
+    rr.Reset();
+    error = iLs.RecognizeData(KNullDesC, KAnotherBuffer, rr);
+    if (rr.iConfidence != CApaDataRecognizerType::EProbable)
+        {
+        INFO_PRINTF1(_L("Error: confidence should be EProbable"));        
+        TEST(EFalse);
+        }  
+   
+  	INFO_PRINTF1(KCompleted);
+	}
+   	
+/**
+   @SYMTestCaseID T-Serv2Step-DoEnquiryTestsL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Tests querying of data (MIME) type information. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Test setting and getting the confidence threshold for
+   successful data recognition by calling RApaLsSession::SetAcceptedConfidence()
+   and RApaLsSession::GetAcceptedConfidence().\n
+   Test setting and getting maximum size of the data that can be read
+   from a file for the purpose of recognizing the data type by calling
+   RApaLsSession::SetMaxDataBufSize() and RApaLsSession::GetMaxDataBufSize().
+   Finally test retrieval of all supported data (MIME) types.\n
+   API Calls:\n	
+   RApaLsSession::SetAcceptedConfidence(TInt aConfidence)\n
+   RApaLsSession::GetAcceptedConfidence(TInt& aConfidence) const\n
+   RApaLsSession::SetMaxDataBufSize(TInt aBufSize)\n
+   RApaLsSession::GetMaxDataBufSize(TInt& aBufSize) const\n
+   RApaLsSession::GetSupportedDataTypesL(CDataTypeArray& aDataTypes) const\n
+   
+   @SYMTestExpectedResults Test results against expected values.
+    
+ */
+void CT_RApaLsSessionTestStep::TestSetGetAcceptedConfidenceL()
+	{
+	INFO_PRINTF1(_L("Test SetAcceptedConfidence...."));
+	
+	TInt temp=1234;
+	TInt ret=iLs.SetAcceptedConfidence(temp);
+	TSecurityInfo info;
+	info.Set(RProcess());
+	
+	info.iCaps.HasCapability(ECapabilityWriteDeviceData) ? TEST(ret==KErrNone) :  TEST(ret==KErrPermissionDenied);
+	INFO_PRINTF1(KCompleted);
+	
+	INFO_PRINTF1(_L("Test GetAcceptedConfidence...."));
+	temp=0;
+	ret=iLs.GetAcceptedConfidence(temp);
+	TEST(ret==KErrNone);
+	TEST(temp==1234);
+	INFO_PRINTF1(KCompleted);
+	}
+
+void CT_RApaLsSessionTestStep::TestSetGetMaxDataBufSizeL()
+	{
+	INFO_PRINTF1(_L("Test SetMaxDataBufSize...."));
+
+	TInt temp=1234;
+	TInt ret=iLs.SetMaxDataBufSize(temp);
+	TEST(ret==KErrNone);
+	INFO_PRINTF1(KCompleted);
+	
+	INFO_PRINTF1(_L("Test GetMaxDataBufSize...."));
+	temp=0;
+	ret=iLs.GetMaxDataBufSize(temp);
+	TEST(ret==KErrNone);
+	TEST(temp==1234);
+	INFO_PRINTF1(KCompleted);
+	}
+
+void CT_RApaLsSessionTestStep::TestGetSupportedDataTypesL()
+{
+	INFO_PRINTF1(_L("Test GetSupportedDataTypes...."));
+
+	CDataTypeArray* dataTypes=new(ELeave) CDataTypeArray(5);
+	CleanupStack::PushL(dataTypes);
+	
+	TInt ret=iLs.GetSupportedDataTypesL(*dataTypes);
+	TEST(ret==KErrNone);
+	TEST(dataTypes->Count()>=4);
+	CleanupStack::PopAndDestroy(); // dataTypes
+
+	INFO_PRINTF1(KCompleted);
+	}
+
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-DoGetAllApps
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   Check that RApaLsSession::GetAllApps() hasn't been
+   affected by the new code to filter the app list
+   based on embeddability (implemented for CR PHAR-5Q4FX8)
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Call GetAllApps() once, followed by repeated calls
+   to GetNextApp until something other than KErrNone is returned
+  
+   @SYMTestExpectedResults
+   GetNextApp should return app info for the following test apps:
+   TAppNotEmbeddable.exe
+   TAppEmbeddable.dll
+   TAppEmbeddableOnly.dll
+   TAppEmbeddableUiOrStandAlone.dll
+   TAppEmbeddableUiNotStandAlone.dll
+   The last call to GetNextApp should return RApaLsSession::ENoMoreAppsInList
+  
+ */
+void CT_RApaLsSessionTestStep::DoGetAllApps()
+	{
+	INFO_PRINTF1(_L("DoGetAllApps"));
+
+	TInt ret = iLs.GetAllApps();
+	TEST(ret==KErrNone);
+
+	TApaAppInfo appInfo;
+	TUint bitFlags = 0;
+	while ((ret = iLs.GetNextApp(appInfo)) == KErrNone)
+		{
+		if (appInfo.iUid == KUidAppNotEmbeddable)
+			bitFlags |= 0x01;
+		else if (appInfo.iUid == KUidAppEmbeddable)
+			bitFlags |= 0x02;
+		else if (appInfo.iUid == KUidAppEmbeddableOnly)
+			bitFlags |= 0x04;
+		else if (appInfo.iUid == KUidAppEmbeddableUiOrStandAlone)
+			bitFlags |= 0x08;
+		else if (appInfo.iUid == KUidAppEmbeddableUiNotStandAlone)
+			bitFlags |= 0x10;
+		};
+	TEST(ret==RApaLsSession::ENoMoreAppsInList);
+	TEST(bitFlags == 0x1F);
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-DoGetEmbeddableApps
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   Check that RApaLsSession::GetEmbeddableApps() hasn't been
+   affected by the new code to filter the app list
+   based on embeddability (implemented for CR PHAR-5Q4FX8)
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Call GetEmbeddableApps() once, followed by repeated calls
+   to GetNextApp until something other than KErrNone is returned
+  
+   @SYMTestExpectedResults
+   GetNextApp should return app info for the following test apps:
+   TAppEmbeddable.dll
+   TAppEmbeddableOnly.dll
+   and should not return app info for:
+   TAppNotEmbeddable.exe
+   TAppEmbeddableUiOrStandAlone.dll
+   TAppEmbeddableUiNotStandAlone.dll
+   The last call to GetNextApp should return RApaLsSession::ENoMoreAppsInList
+  
+ */
+void CT_RApaLsSessionTestStep::DoGetEmbeddableApps()
+	{
+	INFO_PRINTF1(_L("DoGetEmbeddableApps"));
+
+	TInt ret = iLs.GetEmbeddableApps();
+	TEST(ret==KErrNone);
+
+	TApaAppInfo appInfo;
+	TUint bitFlags = 0;
+	while ((ret = iLs.GetNextApp(appInfo)) == KErrNone)
+		{
+		if (appInfo.iUid == KUidAppNotEmbeddable)
+			bitFlags |= 0x01;
+		else if (appInfo.iUid == KUidAppEmbeddable)
+			bitFlags |= 0x02;
+		else if (appInfo.iUid == KUidAppEmbeddableOnly)
+			bitFlags |= 0x04;
+		else if (appInfo.iUid == KUidAppEmbeddableUiOrStandAlone)
+			bitFlags |= 0x08;
+		else if (appInfo.iUid == KUidAppEmbeddableUiNotStandAlone)
+			bitFlags |= 0x10;
+		};
+	TEST(ret==RApaLsSession::ENoMoreAppsInList);
+	TEST(bitFlags == 0x06);
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-DoEmbeddableAppCount
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   The number of apps returned by GetEmbeddableApps should be the
+   same as EmbeddableAppCount returns.
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Count the number of apps returned by calling GetEmbeddableApps
+   followed by repeated calls to GetNextApp.
+   Count the number of apps returned by EmbeddableAppCount.
+  
+   @SYMTestExpectedResults
+   The counts should be equal.
+   The last call to GetNextApp should return RApaLsSession::ENoMoreAppsInList
+  
+ */
+void CT_RApaLsSessionTestStep::DoEmbeddableAppCount()
+	{
+	INFO_PRINTF1(_L("DoEmbeddableAppCount"));
+
+	TInt ret = iLs.GetEmbeddableApps();
+	TEST(ret==KErrNone);
+
+	TApaAppInfo appInfo;
+	TInt count1 = 0;
+	while ((ret = iLs.GetNextApp(appInfo)) == KErrNone)
+		{
+		count1 ++;
+		};
+	TEST(ret==RApaLsSession::ENoMoreAppsInList);
+	
+	TInt count2 = 0;
+	ret = iLs.EmbeddableAppCount(count2);
+	TEST(ret==KErrNone);
+	TEST(count1 == count2);
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-DoGetAppCapability
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   Confirm that the application embeddability value that a specific app
+   defines in it's AIF file, matches the value returned by
+   RApaLsSession::GetAppCapability.
+   Check that this is true for all supported embeddability values
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Call GetAppCapability for each of the following test apps:
+   TAppNotEmbeddable.exe
+   TAppEmbeddable.dll
+   TAppEmbeddableOnly.dll
+   TAppEmbeddableUiOrStandAlone.dll
+   TAppEmbeddableUiNotStandAlone.dll
+  
+   @SYMTestExpectedResults
+   For each app, GetAppCapability should return the embeddability value
+   defined in the application's AIF file.
+  
+ */
+void CT_RApaLsSessionTestStep::DoGetAppCapability()
+	{
+	INFO_PRINTF1(_L("DoGetAppCapability"));
+
+	const TInt numberOfCapabilities = 5;
+	TUid uidArray[numberOfCapabilities];
+	uidArray[0] = KUidAppNotEmbeddable;
+	uidArray[1] = KUidAppEmbeddable;
+	uidArray[2] = KUidAppEmbeddableOnly;
+	uidArray[3] = KUidAppEmbeddableUiOrStandAlone;
+	uidArray[4] = KUidAppEmbeddableUiNotStandAlone;
+
+	const TApaAppCapability::TEmbeddability embeddabilityArray[numberOfCapabilities]
+		= { TApaAppCapability::ENotEmbeddable,
+			TApaAppCapability::EEmbeddable, 
+			TApaAppCapability::EEmbeddableOnly, 
+			TApaAppCapability::EEmbeddableUiOrStandAlone, 
+			TApaAppCapability::EEmbeddableUiNotStandAlone };
+
+	for (TInt ii = 0; ii < numberOfCapabilities; ii++)
+		{
+		INFO_PRINTF2(_L("Testing embeddability value, %d"), uidArray[ii]);
+		TApaAppCapabilityBuf capabilityBuf;
+		TInt ret = iLs.GetAppCapability(capabilityBuf, uidArray[ii]);
+		TEST(ret==KErrNone);
+		TEST(capabilityBuf().iEmbeddability == embeddabilityArray[ii]);
+		}
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-DoGetFilteredApps1
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   Passing an empty filter to RApaLsSession::GetFilteredApps
+   should cause no apps to be returned by subsequent calls
+   to RApaLsSession::GetNextApp
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Call GetFilteredApps passing a default constructed filter,
+   followed by a single call to GetNextApp
+  
+   @SYMTestExpectedResults
+   GetNextApp should return RApaLsSession::ENoMoreAppsInList
+  
+ */
+void CT_RApaLsSessionTestStep::DoGetFilteredApps1()
+	{
+	INFO_PRINTF1(_L("DoGetFilteredApps1"));
+
+	TApaEmbeddabilityFilter filter;
+	TInt ret = iLs.GetFilteredApps(filter);
+	TEST(ret==KErrNone);
+
+	TApaAppInfo appInfo;
+	TEST(iLs.GetNextApp(appInfo) == RApaLsSession::ENoMoreAppsInList);
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-DoGetFilteredApps2
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   Passing a filter specifying only ENotEmbeddable
+   to RApaLsSession::GetFilteredApps should cause subsequent
+   calls to RApaLsSession::GetNextApp to return only
+   applications which cannot be embedded
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Call GetFilteredApps passing a filter containing ENotEmbeddable,
+   followed by repeated calls to GetNextApp until something other than
+   KErrNone is returned
+  
+   @SYMTestExpectedResults
+   GetNextApp should return app info for only the following test app:
+   TAppNotEmbeddable.exe
+   and should not return app info for:
+   TAppEmbeddable.dll
+   TAppEmbeddableOnly.dll
+   TAppEmbeddableUiOrStandAlone.dll
+   TAppEmbeddableUiNotStandAlone.dll
+   The last call to GetNextApp should return RApaLsSession::ENoMoreAppsInList
+ 
+ */
+void CT_RApaLsSessionTestStep::DoGetFilteredApps2()
+	{
+	INFO_PRINTF1(_L("DoGetFilteredApps2"));
+
+	TApaEmbeddabilityFilter filter;
+	filter.AddEmbeddability(TApaAppCapability::ENotEmbeddable);
+	TInt ret = iLs.GetFilteredApps(filter);
+	TEST(ret==KErrNone);
+
+	TApaAppInfo appInfo;
+	TUint bitFlags = 0;
+	while ((ret = iLs.GetNextApp(appInfo)) == KErrNone)
+		{
+		if (appInfo.iUid == KUidAppNotEmbeddable)
+			bitFlags |= 0x01;
+		else if (appInfo.iUid == KUidAppEmbeddable)
+			bitFlags |= 0x02;
+		else if (appInfo.iUid == KUidAppEmbeddableOnly)
+			bitFlags |= 0x04;
+		else if (appInfo.iUid == KUidAppEmbeddableUiOrStandAlone)
+			bitFlags |= 0x08;
+		else if (appInfo.iUid == KUidAppEmbeddableUiNotStandAlone)
+			bitFlags |= 0x10;
+		}
+	TEST(ret==RApaLsSession::ENoMoreAppsInList);
+	TEST(bitFlags == 0x01);
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-DoGetFilteredApps3
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   EEmbeddableUiOrStandAlone (value 5) shares a bit flag (bit 1)
+   with EEmbeddable (value 1).
+   Confirm that a filter of EEmbeddableUiOrStandAlone only returns
+   apps that define EEmbeddableUiOrStandAlone
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Call GetFilteredApps passing a filter containing EEmbeddableUiOrStandAlone,
+   followed by repeated calls to GetNextApp until something other than
+   KErrNone is returned
+  
+   @SYMTestExpectedResults
+   GetNextApp should return app info for only the following test app:
+   TAppEmbeddableUiOrStandAlone.dll
+   and should not return app info for:
+   TAppEmbeddable.dll
+   The last call to GetNextApp should return RApaLsSession::ENoMoreAppsInList
+   
+ */
+void CT_RApaLsSessionTestStep::DoGetFilteredApps3()
+	{
+	INFO_PRINTF1(_L("DoGetFilteredApps3"));
+
+	TApaEmbeddabilityFilter filter;
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddableUiOrStandAlone);
+	TInt ret = iLs.GetFilteredApps(filter);
+	TEST(ret==KErrNone);
+
+	TApaAppInfo appInfo;
+	TUint bitFlags = 0;
+	while ((ret = iLs.GetNextApp(appInfo)) == KErrNone)
+		{
+		if (appInfo.iUid == KUidAppEmbeddable)
+			bitFlags |= 0x02;
+		else if (appInfo.iUid == KUidAppEmbeddableUiOrStandAlone)
+			bitFlags |= 0x08;
+		}
+	TEST(ret==RApaLsSession::ENoMoreAppsInList);
+	TEST(bitFlags == 0x08);
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-DoGetFilteredApps4
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   A filter specifying two embeddability values should
+   include apps of either embeddability
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Call GetFilteredApps passing a filter containing EEmbeddableUiOrStandAlone
+   and EEmbeddableUiNotStandAlone followed by repeated calls to GetNextApp
+   until something other than KErrNone is returned
+  
+   @SYMTestExpectedResults
+   GetNextApp should return app info for only the following test apps:
+   TAppEmbeddableUiOrStandAlone.dll
+   TAppEmbeddableUiNotStandAlone.dll
+   and should not return app info for:
+   TAppNotEmbeddable.exe
+   TAppEmbeddable.dll
+   TAppEmbeddableOnly.dll
+   The last call to GetNextApp should return RApaLsSession::ENoMoreAppsInList
+  
+ */
+void CT_RApaLsSessionTestStep::DoGetFilteredApps4()
+	{
+	INFO_PRINTF1(_L("DoGetFilteredApps4"));
+
+	TApaEmbeddabilityFilter filter;
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddableUiOrStandAlone);
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddableUiNotStandAlone);
+	TInt ret = iLs.GetFilteredApps(filter);
+	TEST(ret==KErrNone);
+
+	TApaAppInfo appInfo;
+	TUint bitFlags = 0;
+	while ((ret = iLs.GetNextApp(appInfo)) == KErrNone)
+		{
+		if (appInfo.iUid == KUidAppNotEmbeddable)
+			bitFlags |= 0x01;
+		else if (appInfo.iUid == KUidAppEmbeddable)
+			bitFlags |= 0x02;
+		else if (appInfo.iUid == KUidAppEmbeddableOnly)
+			bitFlags |= 0x04;
+		else if (appInfo.iUid == KUidAppEmbeddableUiOrStandAlone)
+			bitFlags |= 0x08;
+		else if (appInfo.iUid == KUidAppEmbeddableUiNotStandAlone)
+			bitFlags |= 0x10;
+		}
+	TEST(ret==RApaLsSession::ENoMoreAppsInList);
+	TEST(bitFlags == 0x18);
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-DoGetFilteredApps5
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   Getting apps using a filter specifying all embeddability values
+   should return the same number of apps as RApaLsSession::GetAllApps()
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Call GetFilteredApps passing a filter containing all embeddability values,
+   and count the number of calls to GetNextApp until something other than
+   KErrNone is returned.
+   Then call GetAllApps and count the number of calls to GetNextApp until
+   something other than KErrNone is returned.
+  
+   @SYMTestExpectedResults
+   The two counts should be equal.
+   The last call in each sequence of calls to GetNextApp should return
+   RApaLsSession::ENoMoreAppsInList
+  
+ */
+void CT_RApaLsSessionTestStep::DoGetFilteredApps5()
+	{
+	INFO_PRINTF1(_L("DoGetFilteredApps5"));
+
+	TApaEmbeddabilityFilter filter;
+	filter.AddEmbeddability(TApaAppCapability::ENotEmbeddable);
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddable);
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddableOnly);
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddableUiOrStandAlone);
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddableUiNotStandAlone);
+	TInt ret = iLs.GetFilteredApps(filter);
+	TEST(ret==KErrNone);
+
+	TApaAppInfo appInfo;
+	TInt filteredCount = 0;
+	while ((ret = iLs.GetNextApp(appInfo)) == KErrNone)
+		{
+		filteredCount++;
+		}
+	TEST(ret==RApaLsSession::ENoMoreAppsInList);
+
+	ret = iLs.GetAllApps();
+	TEST(ret==KErrNone);
+
+	TInt allAppsCount = 0;
+	while ((ret = iLs.GetNextApp(appInfo)) == KErrNone)
+		{
+		allAppsCount++;
+		}
+	TEST(ret==RApaLsSession::ENoMoreAppsInList);
+
+	TEST(filteredCount == allAppsCount);
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-DoGetFilteredApps6
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   None of the following embeddability test apps support
+   screen mode 1, so none of them should be returned even
+   if the filter specifies all embeddability types.
+   TAppNotEmbeddable.exe
+   TAppEmbeddable.dll
+   TAppEmbeddableOnly.dll
+   TAppEmbeddableUiOrStandAlone.dll
+   TAppEmbeddableUiNotStandAlone.dll
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Call GetFilteredApps passing a filter containing all embeddability values
+   and screen mode 1, followed by repeated calls to GetNextApp until something
+   other than KErrNone is returned
+  
+   @SYMTestExpectedResults
+   GetNextApp should not return app info for any of the following test apps:
+   TAppNotEmbeddable.exe
+   TAppEmbeddable.dll
+   TAppEmbeddableOnly.dll
+   TAppEmbeddableUiOrStandAlone.dll
+   TAppEmbeddableUiNotStandAlone.dll
+   The last call to GetNextApp should return RApaLsSession::ENoMoreAppsInList
+  
+ */
+void CT_RApaLsSessionTestStep::DoGetFilteredApps6(/*RApaLsSession& iLs*/)
+	{
+	INFO_PRINTF1(_L("DoGetFilteredApps6"));
+
+	TApaEmbeddabilityFilter filter;
+	filter.AddEmbeddability(TApaAppCapability::ENotEmbeddable);
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddable);
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddableOnly);
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddableUiOrStandAlone);
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddableUiNotStandAlone);
+	const TInt screenMode1 = 1;
+	TInt ret = iLs.GetFilteredApps(filter, screenMode1);
+	TEST(ret==KErrNone);
+
+	TApaAppInfo appInfo;
+	TUint bitFlags = 0;
+	while ((ret = iLs.GetNextApp(appInfo)) == KErrNone)
+		{
+		if (appInfo.iUid == KUidAppNotEmbeddable)
+			bitFlags |= 0x01;
+		else if (appInfo.iUid == KUidAppEmbeddable)
+			bitFlags |= 0x02;
+		else if (appInfo.iUid == KUidAppEmbeddableOnly)
+			bitFlags |= 0x04;
+		else if (appInfo.iUid == KUidAppEmbeddableUiOrStandAlone)
+			bitFlags |= 0x08;
+		else if (appInfo.iUid == KUidAppEmbeddableUiNotStandAlone)
+			bitFlags |= 0x10;
+		}
+	TEST(ret==RApaLsSession::ENoMoreAppsInList);
+	TEST(bitFlags == 0);
+	INFO_PRINTF1(KCompleted);
+	}
+	
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-DoTestEmbeddabilityFilter1
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   Ensure default constructed TApaEmbeddabilityFilter object is
+   initialized correctly.
+ 
+   @SYMTestPriority High
+ 
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Construct a TApaEmbeddabilityFilter object and call
+   MatchesEmbeddability using each of the following embeddability values:
+   TApaAppCapability::ENotEmbeddable
+   TApaAppCapability::EEmbeddable
+   TApaAppCapability::EEmbeddableOnly
+   TApaAppCapability::EEmbeddableUiOrStandAlone
+   TApaAppCapability::EEmbeddableUiNotStandAlone
+  
+   @SYMTestExpectedResults
+   All calls to MatchesEmbeddability should return fiLse.
+  
+ */
+void CT_RApaLsSessionTestStep::DoTestEmbeddabilityFilter1()
+	{
+	INFO_PRINTF1(_L("DoTestEmbeddabilityFilter1"));
+
+	TApaEmbeddabilityFilter filter;
+	TEST(!filter.MatchesEmbeddability(TApaAppCapability::ENotEmbeddable));
+	TEST(!filter.MatchesEmbeddability(TApaAppCapability::EEmbeddable));
+	TEST(!filter.MatchesEmbeddability(TApaAppCapability::EEmbeddableOnly));
+	TEST(!filter.MatchesEmbeddability(TApaAppCapability::EEmbeddableUiOrStandAlone));
+	TEST(!filter.MatchesEmbeddability(TApaAppCapability::EEmbeddableUiNotStandAlone));
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-DoTestEmbeddabilityFilter2
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   Bit 2 is used by both EEmbeddableUiNotStandAlone and EEmbeddableOnly.
+   Make sure that setting the filter to only EEmbeddableUiNotStandAlone
+   doesn't match EEmbeddableOnly.
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Construct a TApaEmbeddabilityFilter object,
+   set the filter to only EEmbeddableUiNotStandAloneand
+   and call MatchesEmbeddability passing EEmbeddableOnly
+  
+   @SYMTestExpectedResults
+   MatchesEmbeddability should return fiLse.
+  
+ */
+void CT_RApaLsSessionTestStep::DoTestEmbeddabilityFilter2()
+	{
+	INFO_PRINTF1(_L("DoTestEmbeddabilityFilter2"));
+
+	TApaEmbeddabilityFilter filter;
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddableUiNotStandAlone);
+	TEST(!filter.MatchesEmbeddability(TApaAppCapability::EEmbeddableOnly));
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-DoTestEmbeddabilityFilter3
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   Bit 2 is used by both EEmbeddableUiNotStandAlone and EEmbeddableOnly.
+   Make sure that setting the filter to only EEmbeddableOnly
+   doesn't match EEmbeddableUiNotStandAlone.
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Construct a TApaEmbeddabilityFilter object,
+   set the filter to only EEmbeddableOnly
+   and call MatchesEmbeddability passing EEmbeddableUiNotStandAlone
+  
+   @SYMTestExpectedResults
+   MatchesEmbeddability should return fiLse.
+  
+ */
+void CT_RApaLsSessionTestStep::DoTestEmbeddabilityFilter3()
+	{
+	INFO_PRINTF1(_L("DoTestEmbeddabilityFilter3"));
+
+	TApaEmbeddabilityFilter filter;
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddableOnly);
+	TEST(!filter.MatchesEmbeddability(TApaAppCapability::EEmbeddableUiNotStandAlone));
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-DoTestEmbeddabilityFilter4
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   Ensure MatchesEmbeddability returns true when the filter only contains
+   the embeddability being matched.
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Construct a TApaEmbeddabilityFilter object,
+   set the filter to only EEmbeddable
+   and call MatchesEmbeddability passing EEmbeddable
+  
+   @SYMTestExpectedResults
+   MatchesEmbeddability should return true.
+  
+ */
+void CT_RApaLsSessionTestStep::DoTestEmbeddabilityFilter4()
+	{
+	INFO_PRINTF1(_L("DoTestEmbeddabilityFilter4"));
+
+	TApaEmbeddabilityFilter filter;
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddable);
+	TEST(filter.MatchesEmbeddability(TApaAppCapability::EEmbeddable));
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-DoTestEmbeddabilityFilter5
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   Ensure MatchesEmbeddability returns true when the filter contains
+   a superset of the embeddability being matched.
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Construct a TApaEmbeddabilityFilter object,
+   set the filter to both ENotEmbeddable and EEmbeddable
+   and call MatchesEmbeddability passing EEmbeddable
+  
+   @SYMTestExpectedResults
+   MatchesEmbeddability should return true.
+  
+ */
+void CT_RApaLsSessionTestStep::DoTestEmbeddabilityFilter5()
+	{
+	INFO_PRINTF1(_L("DoTestEmbeddabilityFilter5"));
+
+	TApaEmbeddabilityFilter filter;
+	filter.AddEmbeddability(TApaAppCapability::ENotEmbeddable);
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddable);
+	TEST(filter.MatchesEmbeddability(TApaAppCapability::EEmbeddable));
+	INFO_PRINTF1(KCompleted);
+	}
+
+ /**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestGetAppCapabilityL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test interrogates the Application Architecture Server. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+  
+   RApaLsSession::GetAppCapability(TDes8& aCapabilityBuf,TUid aAppUid) const\n
+   RApaLsSession::RecognizeSpecificData(const TDesC& aName, const TDesC8& aBuffer, const TDataType& aDataType, TBool& aResult) const\n
+   RApaLsSession::RecognizeData(const TDesC& aName, const TDesC8& aBuffer, TDataRecognitionResult& aDataType) const\n
+   RApaLsSession::GetAppIcon(TUid aAppUid, TInt aSize, CApaMaskedBitmap& aAppBitmap) const\n
+   
+   @SYMTestExpectedResults All tests compare the results obtained with the desired result.
+    
+ */
+void CT_RApaLsSessionTestStep::TestGetAppCapabilityL()
+	{
+	TApaAppCapabilityBuf buf;
+	INFO_PRINTF1(_L("Checking GetAppCapability from Test App Uid..."));
+	TInt ret = iLs.GetAppCapability(buf,KUidTestApp);
+	TEST(ret==KErrNone);
+	TApaAppCapability cap=buf();
+	TEST(cap.iEmbeddability==TApaAppCapability::EEmbeddable);
+	TEST(!cap.iSupportsNewFile);
+	TEST(!cap.iAppIsHidden);
+	INFO_PRINTF1(KCompleted);
+
+	INFO_PRINTF1(_L("Checking GetAppCapability Null Id returns KErrNotFound..."));
+	ret = iLs.GetAppCapability(buf,KNullUid);
+	TEST(ret==KErrNotFound);
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T_RApaLsSessionTestStep_TestRecognizeSpecificData
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test interrogates the Application Architecture Server. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+  
+   RApaLsSession::RecognizeSpecificData(const TDesC& aName, const TDesC8& aBuffer, const TDataType& aDataType, TBool& aResult) const\n
+   RApaLsSession::RecognizeData(const TDesC& aName, const TDesC8& aBuffer, TDataRecognitionResult& aDataType) const\n
+   RApaLsSession::GetAppIcon(TUid aAppUid, TInt aSize, CApaMaskedBitmap& aAppBitmap) const\n
+   
+   @SYMTestExpectedResults All tests compare the results obtained with the desired result.
+    
+ */
+void CT_RApaLsSessionTestStep::TestRecognizeSpecificData()
+{
+	INFO_PRINTF1(_L("Checking data type information"));
+	INFO_PRINTF1(_L("Checking RecognizeSpecificData..."));
+	TBool isText=EFalse;
+	TInt ret=iLs.RecognizeSpecificData(_L("a file name.txt"),_L8("Some plain text"),TDataType(_L8("text/plain")),isText);
+	TEST(ret==KErrNone);
+	TEST(isText);
+
+	INFO_PRINTF1(_L("Checking RecognizeData..."));
+	TDataRecognitionResult result;
+	ret=iLs.RecognizeData(_L("a file name.txt"),_L8("Some plain text"),result);
+	TEST(ret==KErrNone);
+	TEST(result.iDataType==TDataType(_L8("text/plain")));
+	TEST(result.iConfidence==CApaDataRecognizerType::EProbable);
+		
+	isText=EFalse;
+	INFO_PRINTF1(_L("Checking RecognizeSpecificData...unknown data type..."));
+	ret=iLs.RecognizeSpecificData(_L("a file name.txt"),_L8("Some plain text"),TDataType(_L8("foo/bar")),isText);
+	TEST(!isText);
+	INFO_PRINTF1(KCompleted);
+}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestGetAppIconL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test interrogates the Application Architecture Server. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented   
+   
+   @SYMTestExpectedResults All tests compare the results obtained with the desired result.
+    
+ */
+void CT_RApaLsSessionTestStep::TestGetAppIconL()
+	{
+	INFO_PRINTF1(_L("Checking icon loading by index"));
+	CApaMaskedBitmap* icon=CApaMaskedBitmap::NewLC();
+	TSize lastSize(0,0);
+
+	INFO_PRINTF1(_L("Checking index 0"));
+	TInt ret=iLs.GetAppIcon(KUidTestApp,0,*icon);
+	TEST(ret==KErrNone);
+	TEST(icon->SizeInPixels().iWidth*icon->SizeInPixels().iHeight > lastSize.iWidth*lastSize.iHeight);
+	lastSize=icon->SizeInPixels();
+
+	INFO_PRINTF1(_L("Checking icon index 1"));	
+	ret=iLs.GetAppIcon(KUidTestApp,1,*icon);
+	TEST(ret==KErrNone);
+	TEST(icon->SizeInPixels().iWidth*icon->SizeInPixels().iHeight == lastSize.iWidth*lastSize.iHeight);
+	lastSize=icon->SizeInPixels();
+
+	INFO_PRINTF1(_L("Checking icon index 2"));
+	ret=iLs.GetAppIcon(KUidTestApp,2,*icon);
+	TEST(ret==KErrNone);		
+	TEST((icon->SizeInPixels().iWidth*icon->SizeInPixels().iHeight) > (lastSize.iWidth*lastSize.iHeight));
+	lastSize=icon->SizeInPixels();
+
+	INFO_PRINTF1(_L("Checking icon loading unknown Uid...."));
+	TUid uid={9999};
+	ret=iLs.GetAppIcon(uid,0,*icon);
+	TEST(ret==KErrNotFound);
+	CleanupStack::PopAndDestroy(icon);
+	INFO_PRINTF1(KCompleted);
+	}
+/**
+    @SYMTestCaseID APPFWK-APPARC-0085
+   
+    @SYMDEF PDEF113054: Apparc fails to detect the presence of localized MBM files  
+	
+	@SYMTestCaseDesc 
+	Negative Test: Test an icon file with an extension which is not supported.
+	
+    
+    @SYMTestPriority High 
+   
+    @SYMTestStatus Implemented
+    
+    Call GetAppViewIcon API on an App which has a localized MBM icon file associated with it with an invalid extension.
+	GetAppViewIcon returns KErrNotSupported 
+    
+    @SYMTestExpectedResults RApaLsSession::GetAppViewIcon should return KErrNotSupported when 
+    the view icon file is an invalid icon file
+    */
+void CT_RApaLsSessionTestStep::TestGetAppIcon2L()
+	{
+	CApaAppViewArray* appViews = new(ELeave) CApaAppViewArray(4);
+	CleanupStack::PushL(appViews);
+	TInt ret = iLs.GetAppViews(*appViews, KUidTestApp);
+	TEST(ret==KErrNone);
+	 	
+	INFO_PRINTF1(_L("Negative test- checking for file extension which is not supported"));
+	//the third view icon is not a valid mbm file
+	const TApaAppViewInfo& viewInfo=(*appViews)[2];
+	TEST(viewInfo.iUid != KNullUid);
+	TEST(viewInfo.iViewCaption.Length() > 0);
+	TEST(viewInfo.iScreenMode == 0x00);
+	CApaMaskedBitmap* viewBitmap = CApaMaskedBitmap::NewLC();
+	ret = iLs.GetAppViewIcon(KUidTestApp, viewInfo.iUid, TSize(50,50), *viewBitmap);
+	TEST(ret==KErrNotSupported);
+	INFO_PRINTF2(_L("The View icon's UID is - %d"), viewInfo.iUid);
+		
+	HBufC* fullIconFileName = NULL;
+	ret = iLs.GetAppViewIcon(KUidTestApp, viewInfo.iUid, fullIconFileName);
+	TEST(ret == KErrNone);
+	TEST(fullIconFileName != NULL);
+	if (fullIconFileName != NULL)
+		{
+		TEST(fullIconFileName->Length() > 0);
+		INFO_PRINTF2(_L("Invalid View's icon file name is - %S"), fullIconFileName);
+		}
+	delete fullIconFileName;		
+	fullIconFileName = NULL;
+	 	
+	CleanupStack::PopAndDestroy(viewBitmap);
+	CleanupStack::PopAndDestroy(appViews);
+	 	
+	INFO_PRINTF1(KCompleted);
+	}	
+
+/**
+   @SYMTestCaseID APPFWK-APPARC-0073
+  
+   @SYMDEF INC098717: support for scalable midlet icons is missing  
+  
+   @SYMTestCaseDesc Test interrogates the Application Architecture Server's GetAppIcon API . 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call GetAppIcon API on an app which has an icon file associated with it.
+   Again Call GetAppIcon API on an app which does not have an icon file associated with it.
+   Again Call GetAppIcon with an invalid app uid. Do it for SVG and MBM icon file.
+   
+   @SYMTestExpectedResults RApaLsSession::GetAppIcon should return KErrNotFound when 
+   an invalid app uid is passed, KErrNotFound when application does not have an icon 
+   file, KErrNone and an open file handle to the application's icon file if application 
+   has an icon file.
+ */
+void CT_RApaLsSessionTestStep::TestGetAppIcon1L()
+	{
+	TestGetAppIconForMBMIconsL();
+	TestGetAppIconForSVGIconsL();
+	
+	//Generic tests for both MBM and SVG icon files
+	RFile iconFile;
+	CleanupClosePushL(iconFile);
+	//Testing GetAppIcon for native app without an icon file.
+	INFO_PRINTF1(_L("Testing GetAppIcon API for an app that does not have an icon file"));
+	const TUint KGroupNameApp = 0x10208185; //T_groupNametest app, does not have an icon file.
+	TInt err = iLs.GetAppIcon(TUid::Uid(KGroupNameApp), iconFile);
+	TEST(err == KErrNotFound);
+
+	//Checking the iconfile name when the icon file is not a physical file on the file system.
+	CApaAppViewArray* appViews = new(ELeave) CApaAppViewArray(4);
+	CleanupStack::PushL(appViews);
+	TInt ret = iLs.GetAppViews(*appViews, TUid::Uid(KGroupNameApp));
+	TEST(ret==KErrNone);
+	TEST(appViews->Count() > 0);
+	 	
+	const TApaAppViewInfo& viewInfo=(*appViews)[0];
+	TEST(viewInfo.iUid != KNullUid);
+
+	HBufC* fullIconFileName = NULL;
+	ret = iLs.GetAppViewIcon(TUid::Uid(KGroupNameApp), viewInfo.iUid, fullIconFileName);
+	TEST(ret == KErrNone);
+	TEST(fullIconFileName != NULL);
+	INFO_PRINTF2(_L("The View icon's UID is - %X"), viewInfo.iUid);
+	TEST(!fullIconFileName->Compare(_L("file:///c/resource/apps/tcheckiconapp.xyz")));
+	INFO_PRINTF2(_L("View's icon file name is - %S"), fullIconFileName);
+	
+	delete fullIconFileName;		
+	CleanupStack::PopAndDestroy(appViews);
+	
+	//Testing GetAppIcon with an invalid app UID.
+	INFO_PRINTF1(_L("Testing GetAppIcon API with unknown app uid"));
+	TUid invalidAppUid = {9999};
+	err = iLs.GetAppIcon(invalidAppUid, iconFile);
+	TEST(err == KErrNotFound);
+	
+	//Close icon file
+	CleanupStack::PopAndDestroy(&iconFile);	
+	
+	INFO_PRINTF1(KCompleted);
+	}
+
+void CT_RApaLsSessionTestStep::TestGetAppIconForMBMIconsL()
+	{
+	//Testing GetAppIcon for native app with MBM icon file.
+	INFO_PRINTF1(_L("Testing GetAppIcon API for an app to retrieve an open file handle to an MBM icon file"));
+	const TUint KTestApp = 10; //Tstapp app, has MBM icon file	
+	
+	RFile mbmIconFile;
+	CleanupClosePushL(mbmIconFile);
+	
+	TInt err = iLs.GetAppIcon(TUid::Uid(KTestApp), mbmIconFile);
+	TEST(err == KErrNone);
+	
+	_LIT(KMBMIconFileName, "z:\\resource\\apps\\tstapp.mbm");
+	//Get the name of the icon file 
+	TBuf<KMaxFileName> mbmIconFileName;	
+	mbmIconFile.FullName(mbmIconFileName);
+	TEST(mbmIconFileName.Length() != 0);
+	if (mbmIconFileName.Length() != 0)
+		{
+		mbmIconFileName.LowerCase();
+		TEST(mbmIconFileName.Compare(KMBMIconFileName) == 0);
+		}
+		
+	//Try to write into the MBM icon file whose handle was returned.
+	INFO_PRINTF1(_L("..writing into the MBM icon file whose handle was returned."));
+	_LIT8(KSomeText, "It would not be written into the file");
+	err = mbmIconFile.Write(KSomeText);
+	TEST(err == KErrAccessDenied);
+	
+	//Try to read from the MBM icon file whose handle was returned.
+	INFO_PRINTF1(_L("..reading from the MBM icon file whose handle was returned."));
+	TBuf8<KBytesToRead> buffer; //buffer to read first KBytesToRead bytes of the mbm icon file.
+	err = mbmIconFile.Read(buffer);
+	TEST(err == KErrNone);
+	
+	//Close icon files.
+	CleanupStack::PopAndDestroy(&mbmIconFile);
+	
+	//First KBytesToRead bytes of the icon file, this should be same as in mbm file.
+	RFile tempFile;
+	CleanupClosePushL(tempFile);
+	err = tempFile.Open(iFs, KMBMIconFileName, EFileShareReadersOnly);
+	TEST(err == KErrNone);
+	TBuf8<KBytesToRead> buffer1;
+	err = tempFile.Read(buffer1);
+	TEST(err == KErrNone);	
+	TEST(buffer == buffer1);
+	CleanupStack::PopAndDestroy(&tempFile);
+	}
+	
+void CT_RApaLsSessionTestStep::TestGetAppIconForSVGIconsL()
+	{
+	//Testing GetAppIcon for native app with SVG icon file.		
+	RFile svgIconFile;
+	CleanupClosePushL(svgIconFile);
+	INFO_PRINTF1(_L("Testing GetAppIcon API for an app to retrieve an open file handle to an SVG icon file"));
+	const TUint KApparcTestApp = 0x100048F3; //Tstapp app, has SVG icon file
+	TInt err = iLs.GetAppIcon(TUid::Uid(KApparcTestApp), svgIconFile);
+	TEST(err == KErrNone);
+	
+	_LIT(KSVGIconFileName, "z:\\resource\\apps\\svg_icon.svg");
+	//Get the name of the icon file 
+	TBuf<KMaxFileName> svgIconFileName;	
+	svgIconFile.FullName(svgIconFileName);
+	TEST(svgIconFileName.Length() != 0);
+	if (svgIconFileName.Length() != 0)
+		{
+		svgIconFileName.LowerCase();
+		TEST(svgIconFileName.Compare(KSVGIconFileName) == 0);
+		}
+			
+	//Try to write into the icon file whose handle was returned.
+	INFO_PRINTF1(_L("..writing into the SVG icon file whose handle was returned."));
+	_LIT8(KSomeText, "It would not be written into the file");
+	err = svgIconFile.Write(KSomeText);
+	TEST(err == KErrAccessDenied);
+	
+	//Try to read from the icon file whose handle was returned.
+	INFO_PRINTF1(_L("..reading from the SVG icon file whose handle was returned."));
+	TBuf8<KBytesToRead> svgBuffer; //buffer to read first KBytesToRead bytes of the icon file. 
+	err = svgIconFile.Read(svgBuffer);
+	TEST(err == KErrNone);
+	
+	//Close icon file
+	CleanupStack::PopAndDestroy(&svgIconFile);
+	
+	//First KBytesToRead bytes of the icon file, this should be same as in mbm file.
+	RFile tempFile;	
+	CleanupClosePushL(tempFile);
+	err = tempFile.Open(iFs, KSVGIconFileName, EFileRead);
+	TEST(err == KErrNone);
+	TBuf8<KBytesToRead> buffer1;
+	err = tempFile.Read(buffer1);
+	TEST(err == KErrNone);
+	TEST(svgBuffer == buffer1);
+	CleanupStack::PopAndDestroy(&tempFile);		
+	}
+	
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestAppListInstallationL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test updating of Application list on installation of a new application. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Test updating of application list on installation of a new application. 
+   Copy the tstapp from z: import\apps folder to c: import\apps folder. 
+   Call RApaLsSession::GetAppInfo() and test the application information obtained to 
+   verify whether the application architecture server updates the application to reside in c: drive.
+   Delete the copied application and call RApaLsSession::GetAppInfo().
+   Verify that the application list updates the tstapp application to reside
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::GetAppInfo(TApaAppInfo& aInfo,TUid aAppUid) const\n
+   
+   @SYMTestExpectedResults The test confirms that the application architecture
+   server updates the application list on installation of a new application. It also confirms that 
+   if UID of an application which is present on import\apps folder on any non-ROM drive, is same 
+   as UID of an existing application present on z: import\apps folder then the apparc server 
+   updates the applist and uses the application residing on non-ROM drive's import\apps folder.
+    
+ */
+void CT_RApaLsSessionTestStep::TestAppListInstallationL()
+ 	{ 
+ 	_LIT(KTestAppDestDir, "C:\\private\\10003a3f\\import\\apps\\" );
+ 	_LIT(KTestAppSource, "Z:\\private\\10003a3f\\import\\apps\\tstapp_reg.rsc" );
+ 	_LIT(KTestAppDest, "C:\\private\\10003a3f\\import\\apps\\tstapp_reg.rsc" );
+
+ 	_LIT(KTestWaitingForApplistUpdate,"Waiting %d microseconds for applist to be updated");
+ 	const TInt KApplistUpdateTime = 10000000;
+
+ 	// Copy App files around and delete them to check whether 
+	// the app list updates and stores the cache correctly.
+ 	RFs	theFS;
+ 	theFS.Connect();
+ 
+ 	// Remove Test app from the file system
+ 	CFileMan* fileManager = CFileMan::NewL (theFS);
+ 
+ 	INFO_PRINTF1(_L("Copying the app to C"));
+ 	TEST(KErrNone == fileManager->Copy (KTestAppSource, KTestAppDest, CFileMan::ERecurse));
+ 	
+ 	INFO_PRINTF2(KTestWaitingForApplistUpdate, KApplistUpdateTime);
+ 	User::After(KApplistUpdateTime);
+ 
+ 	TApaAppInfo aInfo;
+ 	TEST(KErrNone == iLs.GetAppInfo (aInfo, KUidTestApp));
+
+	TParsePtrC parse (aInfo.iFullName);
+ 	_LIT (KCdrive, "C:");
+	INFO_PRINTF1(_L("Comparing App drive location is C:... "));
+	TEST(parse.Drive ().CompareF (KCdrive) == 0);
+ 
+ 	INFO_PRINTF1(_L("Removing the app from C"));
+	TRequestStatus status;
+	TTime tempTime(0); // added tempTime to avoid asynch CFileMan::Attribs request completing with KErrArgument
+	TEST(fileManager->Attribs(KTestAppDest,0,KEntryAttReadOnly, tempTime, CFileMan::ERecurse, status)==KErrNone);
+	User::WaitForRequest(status);
+	TEST(status.Int() == KErrNone);
+ 	TEST(KErrNone == fileManager->Delete (KTestAppDest, CFileMan::ERecurse));
+	INFO_PRINTF1(_L("Removing the app dir from C"));
+	TEST(fileManager->RmDir(KTestAppDestDir)==KErrNone);
+ 	
+	INFO_PRINTF2(KTestWaitingForApplistUpdate, KApplistUpdateTime);
+	User::After(KApplistUpdateTime);
+ 
+ 	// That should put the file in the right place
+ 	TEST(KErrNone == iLs.GetAppInfo( aInfo, KUidTestApp));
+
+ 	TParsePtrC parse1 (aInfo.iFullName);
+ 	_LIT (KZdrive, "Z:");
+	INFO_PRINTF1(_L("Comparing App drive location is Z:... "));
+ 	TEST((parse1.Drive().CompareF(KZdrive)) == 0);
+
+ 	delete fileManager;
+ 	theFS.Close();
+
+ 	INFO_PRINTF1(_L("Test TestAppListInstallationL completed"));
+ 	}
+ 	
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestAppListInstallation1L
+  
+   @SYMDEF DEF055654: Platform-security loop-hole for "import-directory" applications
+  
+   @SYMTestCaseDesc Test updating of Application list on installation of a new application. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Test updating of application list on installation of a new application. 
+   Copy the SimpleApparcTestApp from z:\private\10003a3f\apps folder to c:\private\10003a3f\import\apps
+   folder. Call RApaLsSession::GetAppInfo() and test the application information obtained to
+   verify that apparc server does not update the application to reside in c: drive
+   but on z drive. Delete the copied application and call RApaLsSession::GetAppInfo().
+   Verify that the application list does not update app list again.\n
+   API Calls:\n	
+   RApaLsSession::GetAppInfo(TApaAppInfo& aInfo,TUid aAppUid) const\n
+   
+   @SYMTestExpectedResults The test confirms that the scanning order of apparc server 
+   for applications is 'apps' folder for all ROM drives and then 'import\apps' folder 
+   for all other drives. It also confirms that if UID of an application which is present in 
+   import\apps folder on any non-ROM drive, is same as UID of an existing application present 
+   on z: apps folder then the apparc server does not update app list and uses the application
+   residing on z drive.
+    
+ */
+void CT_RApaLsSessionTestStep::TestAppListInstallation1L()
+ 	{ 
+ 	_LIT(KTestAppDestDir, "C:\\private\\10003a3f\\import\\apps\\" );
+ 	_LIT(KTestAppSource, "Z:\\private\\10003a3f\\apps\\SimpleApparcTestApp_reg.rsc" );
+ 	_LIT(KTestAppDest, "C:\\private\\10003a3f\\import\\apps\\SimpleApparcTestApp_reg.rsc" );
+
+ 	_LIT(KTestWaitingForApplistUpdate,"Waiting %d microseconds for applist to be updated");
+ 	const TInt KApplistUpdateTime=10000000;
+
+ 	// Copy reg files around and delete them to check the app list does not update. 
+ 	RFs	theFS;
+ 	User::LeaveIfError(theFS.Connect());
+ 	CleanupClosePushL(theFS);
+ 	
+ 	// Remove simple app from the file system
+ 	CFileMan* fileManager=CFileMan::NewL(theFS);
+ 	CleanupStack::PushL(fileManager);
+ 
+ 	INFO_PRINTF1(_L("Copying the app to C \\import\\apps folder"));
+ 	TEST(KErrNone==fileManager->Copy(KTestAppSource,KTestAppDest,CFileMan::ERecurse));
+ 	
+ 	INFO_PRINTF2(KTestWaitingForApplistUpdate,KApplistUpdateTime);
+ 	User::After(KApplistUpdateTime);
+ 
+ 	TApaAppInfo appInfo;
+ 	const TUid KUidSimpleApparcTestApp={0x12008ACE};
+ 	TEST(KErrNone==iLs.GetAppInfo(appInfo,KUidSimpleApparcTestApp));
+
+	TParsePtrC parse(appInfo.iFullName);
+ 	_LIT (KZdrive,"Z:");
+ 	INFO_PRINTF1(_L("After copying app to C:, there should not be any update in app list:... "));
+ 	INFO_PRINTF1(_L("Comparing App drive location is Z:... "));
+	TEST(parse.Drive().CompareF(KZdrive)==0);
+ 
+ 	INFO_PRINTF1(_L("Removing the app from C"));
+	TRequestStatus status;
+	TTime tempTime(0); // added tempTime to avoid asynch CFileMan::Attribs request completing with KErrArgument
+	TEST(fileManager->Attribs(KTestAppDest,0,KEntryAttReadOnly,tempTime,CFileMan::ERecurse,status)==KErrNone);
+	User::WaitForRequest(status);
+	TEST(status.Int()==KErrNone);
+ 	TEST(KErrNone==fileManager->Delete(KTestAppDest, CFileMan::ERecurse));
+
+	INFO_PRINTF1(_L("Removing the app dir from C"));
+	TEST(fileManager->RmDir(KTestAppDestDir)==KErrNone);
+
+ 	
+	INFO_PRINTF2(KTestWaitingForApplistUpdate,KApplistUpdateTime);
+	User::After(KApplistUpdateTime);
+ 
+ 	TEST(KErrNone==iLs.GetAppInfo(appInfo,KUidSimpleApparcTestApp));
+
+ 	TParsePtrC parse1(appInfo.iFullName);
+ 	INFO_PRINTF1(_L("After removing app from C:, there should not be any update in app list:... "));
+ 	INFO_PRINTF1(_L("Comparing App drive location is Z:... "));
+ 	TEST((parse1.Drive().CompareF(KZdrive))==0);
+ 	
+ 	CleanupStack::PopAndDestroy(2, &theFS);
+
+ 	INFO_PRINTF1(_L("Test TestAppListInstallation1L completed"));
+ 	} 	
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestAppFolderNonRomDrivesL
+  
+   @SYMDEF DEF055654: Platform-security loop-hole for "import-directory" applications
+  
+   @SYMTestCaseDesc Test scanning of app folder for non-ROM drives. 
+  
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Test scanning of app folder for non-ROM drives. 
+   Copy a new application AAA_reg from z:\Apparctest folder to c:\private\10003a3f\apps folder. 
+   Call RApaLsSession::GetAppInfo() and test application architecture server does not 
+   populate the new application in app list. Delete the copied application.\n
+   API Calls:\n	
+   RApaLsSession::GetAppInfo(TApaAppInfo& aInfo,TUid aAppUid) const\n
+   
+   @SYMTestExpectedResults The test confirms that the application architecture server does not 
+   scans applications residing in 'apps' folder for all non-ROM drives.    
+ */
+void CT_RApaLsSessionTestStep::TestAppFolderNonRomDrivesL()
+ 	{ 
+ 	_LIT(KTestAppDestDir, "C:\\private\\10003a3f\\apps\\" );
+ 	_LIT(KTestAppSource, "Z:\\Apparctest\\AAA_reg.rsc" );
+ 	_LIT(KTestAppDest, "C:\\private\\10003a3f\\apps\\AAA_reg.rsc" );
+
+ 	_LIT(KTestWaitingForApplistUpdate,"Waiting %d microseconds for applist to be updated");
+ 	const TInt KApplistUpdateTime=10000000;
+
+	INFO_PRINTF1(_L("Test scanning of app folder for non-ROM drives"));
+ 	// Copy reg files around and delete them to check 
+	// the app list does not update. 
+ 	RFs	theFS;
+ 	User::LeaveIfError(theFS.Connect());
+ 	CleanupClosePushL(theFS);
+ 
+ 	// Remove simple app from the file system
+ 	CFileMan* fileManager=CFileMan::NewL(theFS);
+ 	CleanupStack::PushL(fileManager);
+ 
+ 	INFO_PRINTF1(_L("Copying AAA app to C apps folder"));
+ 	TEST(KErrNone==fileManager->Copy(KTestAppSource,KTestAppDest,CFileMan::ERecurse));
+ 	
+ 	INFO_PRINTF2(KTestWaitingForApplistUpdate,KApplistUpdateTime);
+ 	User::After(KApplistUpdateTime);
+ 
+ 	TApaAppInfo appInfo;
+ 	// UID of AAA app is 0x10207f74
+ 	const TUid KUidSimpleApp={0x10207f74};
+ 	INFO_PRINTF1(_L("Finding AAA app in app list... "));
+ 	TEST(KErrNotFound==iLs.GetAppInfo(appInfo,KUidSimpleApp));
+
+	INFO_PRINTF1(_L("Removing AAA app from C apps folder"));
+	TRequestStatus status;
+	TTime tempTime(0); // added tempTime to avoid asynch CFileMan::Attribs request completing with KErrArgument
+	TEST(fileManager->Attribs(KTestAppDest,0,KEntryAttReadOnly,tempTime,CFileMan::ERecurse,status)==KErrNone);
+	User::WaitForRequest(status);
+	TEST(status.Int()==KErrNone);
+ 	TEST(KErrNone==fileManager->Delete(KTestAppDest,CFileMan::ERecurse));
+
+	INFO_PRINTF1(_L("Removing the app dir from C"));
+	TEST(fileManager->RmDir(KTestAppDestDir)==KErrNone);
+
+ 	
+	INFO_PRINTF2(KTestWaitingForApplistUpdate,KApplistUpdateTime);
+	User::After(KApplistUpdateTime);
+ 	
+ 	INFO_PRINTF1(_L("Finding AAA app in app list... "));
+ 	TEST(KErrNotFound==iLs.GetAppInfo(appInfo,KUidSimpleApp));
+ 	
+ 	CleanupStack::PopAndDestroy(2, &theFS);
+
+ 	INFO_PRINTF1(_L("Test scanning of app folder for non-ROM drives completed"));
+ 	}
+ 	
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-DoNumDefIconsTestL
+  
+   @SYMDEF DEF037571 - Provide a better alternative to CApaAppInfoFileReader::NumberOfBitmaps'
+  
+   @SYMTestCaseDesc  
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions 
+   API Calls:\n	
+   RApaLsSession::GetAppIconSizes() \n
+   RApaLsSession::NumberOfOwnDefinedIcons(appUid, iconCount)
+   @SYMTestExpectedResults
+    
+ */
+void CT_RApaLsSessionTestStep::DoNumDefIconsTestL()
+	{
+	INFO_PRINTF1(_L("Testing RApaLsSession::NumberOfOwnDefinedIcons"));
+
+	CArrayFixFlat<TSize>* array = new(ELeave) CArrayFixFlat<TSize>(4);
+	CleanupStack::PushL(array);
+
+	// Test the GetAppIconSizes function, check 3 icons are returned (default icons)
+	INFO_PRINTF1(_L("Testing GetAppIconSizes"));
+	TUid appUid;
+	appUid.iUid = 0x12008ACE;	// SimpleApparcTestApp UID
+	TInt err = iLs.GetAppIconSizes(appUid, *array);
+	TEST(err == KErrNone);
+	TEST(array->Count() == 3);
+
+	// Test the NumberOfOwnDefinedIcons function, check count is zero (no own defined icons)
+	INFO_PRINTF1(_L("Testing NumberOfOwnDefinedIcons (SimpleApparcTestApp)"));
+	TInt iconCount = -1;
+	err = iLs.NumberOfOwnDefinedIcons(appUid, iconCount);
+	TEST(err == KErrNone);
+	TEST(iconCount == 0);
+
+	// Test NumberOfOwnDefinedIcons again, this time with Agenda app UID (icons defined)
+	INFO_PRINTF1(_L("Testing NumberOfOwnDefinedIcons (Paint app)"));
+	iconCount = -1;
+	appUid.iUid = 0x10003A5C;//agenda  app UID
+	err = iLs.NumberOfOwnDefinedIcons(appUid, iconCount);
+	TEST(err == KErrNone);
+	TEST(iconCount == 3);
+
+	CleanupStack::PopAndDestroy(array);
+
+	INFO_PRINTF1(_L("NumberOfOwnDefinedIcons test complete"));
+	}
+
+
+void CT_RApaLsSessionTestStep::TestMatchesSecurityPolicy()
+	{
+	TUid appUid;
+	appUid.iUid=0X10009f9a;
+    TBool matches;
+   
+    //Testing with valid TSecurityPolicy
+    INFO_PRINTF1(_L("Testing MatchesSecurityPolicy with valid TSecurityPolicy"));
+    iLs.MatchesSecurityPolicy(matches, appUid, TSecurityPolicy(TVendorId(0x70000001)));
+    TEST(matches);
+    INFO_PRINTF1(KCompleted);
+    
+    //Testing with invalid TSecurityPolicy
+    INFO_PRINTF1(_L("Testing MatchesSecurityPolicy with invalid TSecurityPolicy"));
+    APPFWK_NEGATIVE_PLATSEC_START;
+    iLs.MatchesSecurityPolicy(matches, appUid, TSecurityPolicy(TVendorId(0x70000002)));
+    APPFWK_NEGATIVE_PLATSEC_FINISH;
+    TEST(!matches);
+    INFO_PRINTF1(KCompleted);
+	}
+
+void CT_RApaLsSessionTestStep::TestGetAppViewsL()
+	{
+	INFO_PRINTF1(_L("Testing RApaLsSession::GetAppViews() with a valid app uid"));
+
+	CApaAppViewArray* appViews = new(ELeave) CApaAppViewArray(4);
+	CleanupStack::PushL(appViews);
+
+	TInt ret = iLs.GetAppViews(*appViews, KUidTestApp);
+	TEST(ret==KErrNone);
+	
+	// check appviews contain entries
+	const TInt count=appViews->Count();
+	TEST(count > 0);
+	TInt testNumberOfIcons = count-1;
+	//the last view is invalid. Hence it checks till count-1 
+	for (TInt ii=0; ii<testNumberOfIcons; ii++)
+		{
+		const TApaAppViewInfo& viewInfo=(*appViews)[ii];
+		TEST(viewInfo.iUid != KNullUid);
+		TEST(viewInfo.iViewCaption.Length() > 0);
+		TEST(viewInfo.iScreenMode == 0x00);
+
+		// check icons in the views
+		CApaMaskedBitmap* viewBitmap = CApaMaskedBitmap::NewLC();
+		ret = iLs.GetAppViewIcon(KUidTestApp, viewInfo.iUid, TSize(50,50), *viewBitmap);
+		TEST(ret==KErrNone);
+		CleanupStack::PopAndDestroy(viewBitmap);
+		
+		HBufC* fullFileName = NULL;
+		ret = iLs.GetAppViewIcon(KUidTestApp, viewInfo.iUid, fullFileName);
+		TEST(ret == KErrNone);
+		TEST(fullFileName != NULL);
+		if (fullFileName != NULL)
+			{
+			TEST(fullFileName->Length() > 0);
+			}
+		delete fullFileName;		
+		fullFileName = NULL;		
+		}
+
+	CleanupStack::PopAndDestroy(appViews);
+    INFO_PRINTF1(KCompleted);
+	}
+
+void CT_RApaLsSessionTestStep::TestGetAppViewsFailureL()
+	{
+	INFO_PRINTF1(_L("Testing RApaLsSession::GetAppViews() with an invalid app uid"));
+
+	const TUid appUid={10000}; // invalid uid
+	CApaAppViewArray* appViews = new(ELeave) CApaAppViewArray(2);
+	CleanupStack::PushL(appViews);
+	
+	//Create App View array
+	TInt ret = iLs.GetAppViews(*appViews, appUid);
+	TEST(ret=KErrNotFound);
+	
+	CleanupStack::PopAndDestroy(appViews);
+    INFO_PRINTF1(KCompleted);
+	}
+
+void CT_RApaLsSessionTestStep::IconLoadingTestCasesL()
+	{
+	CArrayFixFlat<TSize>* testIconSizeArray;
+	testIconSizeArray=new(ELeave) CArrayFixFlat<TSize>(3);
+	CleanupStack::PushL(testIconSizeArray);
+	TestServerIconSizeCountL(*testIconSizeArray);
+	TestServerIconLoadingBySize1L(*testIconSizeArray);
+	TestServerIconLoadingBySize2L(*testIconSizeArray);
+	TestServerIconLoadingBySize3L(*testIconSizeArray);
+	CleanupStack::PopAndDestroy(testIconSizeArray);
+	}
+
+void CT_RApaLsSessionTestStep::AppInfoTestCasesL()
+	{
+	TestAppListInfoDataInterrogationSetupL();
+					
+	TestAppInfo1();
+	TestAppInfo2();
+	TestAppInfo3();
+	TestAppInfo4();
+	
+	TestGetAppCapabilityL();
+	TestRecognizeSpecificData();
+
+	TestSetGetAcceptedConfidenceL();
+	TestSetGetMaxDataBufSizeL();
+			
+	TestGetSupportedDataTypesL();
+	TestGetAppIconL();
+	TestGetAppIcon1L();
+	TestGetAppIcon2L();
+
+	TestGetAppViewsL();
+	TestGetAppViewsFailureL();
+	}
+
+void CT_RApaLsSessionTestStep::EmbeddedAppsTestCases()
+	{
+	DoGetAllApps();
+	DoGetEmbeddableApps();
+	DoEmbeddableAppCount();
+	DoGetAppCapability();
+	DoGetFilteredApps1();
+	DoGetFilteredApps2();
+	DoGetFilteredApps3();
+	DoGetFilteredApps4();
+	DoGetFilteredApps5();
+	DoGetFilteredApps6();
+	DoTestEmbeddabilityFilter1();
+	DoTestEmbeddabilityFilter2();
+	DoTestEmbeddabilityFilter3();
+	DoTestEmbeddabilityFilter4();
+	DoTestEmbeddabilityFilter5();
+	}
+	
+void CT_RApaLsSessionTestStep::TestNotifyOnDataMappingChangeL()
+	{
+	INFO_PRINTF1(_L("Test RApaLsSession::TestNotifyOnDataMappingChangeL()"));
+	RApaLsSession lsMappingChange;
+	lsMappingChange.Connect();
+	CleanupClosePushL(lsMappingChange);
+	TRequestStatus status;
+	lsMappingChange.NotifyOnDataMappingChange(status);
+	//Test for TestCancelNotifyOnDataMappingChange
+	lsMappingChange.CancelNotifyOnDataMappingChange();
+	User::WaitForRequest(status);
+	TEST( status ==KErrCancel);
+	//Test for TestNotifyOnDataMappingChangeL
+	lsMappingChange.NotifyOnDataMappingChange(status);
+	const TUid KTestUidValue1={10101010};
+	const TDataType dataType(_L8("sonew/else"));
+	iLs.InsertDataMapping(dataType,KDataTypePriorityHigh,KTestUidValue1);
+	User::WaitForRequest(status);
+	TEST(status==KErrNone);
+	TEST(KErrNone == iLs.DeleteDataMapping(dataType));
+	CleanupStack::PopAndDestroy(&lsMappingChange);
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T_RApaLsSessionTestStep_TestDataPriorityForUnTrustedApps
+  
+   @SYMDEF	DEF063982
+  
+   @SYMTestCaseDesc Tests the Un-Trusted Apps Datatypepriority assigned through 
+	RApaLsSession::InsertDataMapping(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid)\n
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+
+   @SYMTestExpectedResults All tests compare the results obtained with the desired result.
+*/
+void CT_RApaLsSessionTestStep::TestDataPriorityForUnTrustedApps()
+	{
+	INFO_PRINTF1(_L("TestDataPriorityForUnTrustedApps about to start..."));
+	const TUid KUidUnTrustedApp = {0x10207f8C};
+	const TUid KUidTrustedApp = {0x10207f8D};
+	TInt ret;
+	TBool insertVal = EFalse;
+	//There is no restriction for the Trusted Apps datapriority
+	TDataTypePriority KTrustedAppPriority = {KDataTypeUnTrustedPriorityThreshold+1};
+	//The data priority for UnTrusted Apps is greater than the Threshold
+	TDataTypePriority KUnTrustedAppPriority = {KDataTypeUnTrustedPriorityThreshold+10};
+	_LIT8(KLitMimeTypeTestData,"test/data");
+	ret = iLs.InsertDataMapping(TDataType(KLitMimeTypeTestData),KTrustedAppPriority,KUidTrustedApp);
+	//UnTrusted Apps data priority will be reduced to Security Threshold if it is greater than it.
+	ret = iLs.InsertDataMappingIfHigher(TDataType(KLitMimeTypeTestData),KUnTrustedAppPriority,KUidUnTrustedApp,insertVal);
+	TUid testUid;
+	ret = iLs.AppForDataType(TDataType(KLitMimeTypeTestData),testUid);
+	TEST(ret == KErrNone);
+	TEST(testUid == KUidTrustedApp);
+	INFO_PRINTF1(_L("Completed"));
+	}
+
+/**
+   @SYMTestCaseID T_RApaLsSessionTestStep_TestDataPriorityForUnTrustedAppsRegFile
+  
+   @SYMDEF	DEF063982
+  
+   @SYMTestCaseDesc Tests the UnTrusted Apps Datatypepriority assigned through the registration files
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestExpectedResults All tests compare the results obtained with the desired result.
+ */
+void CT_RApaLsSessionTestStep::TestDataPriorityForUnTrustedAppsRegFile()
+	{
+	INFO_PRINTF1(_L("TestDataPriorityForUnTrustedAppsRegFile about to start..."));
+	const TUid KUidRegTrustedApp = {0x10207f8F};
+	_LIT8(KLitMimeTypeTestData,"text/html");
+	TUid testUid;
+	TInt ret;
+	//The datatype priority of UnTrusted Apps is reduced to Threshold.  
+	ret = iLs.AppForDataType(TDataType(KLitMimeTypeTestData),testUid);
+	TEST(ret == KErrNone);
+	TEST(testUid == KUidRegTrustedApp);
+	INFO_PRINTF1(_L("Completed"));
+	}
+	
+/**
+   @SYMTestCaseID T_RApaLsSessionTestStep_TestIconLoaderAndIconArrayMemoryLeaksL
+  
+   @SYMDEF	PDEF104113
+  
+   @SYMTestCaseDesc Checks there's no memory leaks when a CApaAppIconArray oject 
+   is created and deleted
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions It creates an object of CApaAppIconArray class and deletes it. 
+   Then test there is no memory leak from the creation to destory the object.
+   
+   @SYMTestExpectedResults There should be no memory leak checked by __UHEAP_MARK 
+   and __UHEAP_MARKEND.
+ */
+void CT_RApaLsSessionTestStep::TestIconLoaderAndIconArrayMemoryLeaksL()
+	{
+	INFO_PRINTF1(_L("Test TestIconLoaderAndIconArrayMemoryLeaksL"));
+	__UHEAP_MARK;
+	TIconLoaderAndIconArrayForLeaks::TestIconLoaderAndIconArrayL();
+	__UHEAP_MARKEND;
+	INFO_PRINTF1(_L("Completed"));
+	}
+
+void CT_RApaLsSessionTestStep::RunTestCasesL()
+	{
+	//make sure the RFbsSession doesn't have to allocate buffer since it would change the heap
+	CFbsBitmap* bufferAllocator = new(ELeave) CFbsBitmap;
+	CleanupStack::PushL(bufferAllocator);
+	bufferAllocator->Create(TSize(200,1), EColor16M);
+	CleanupStack::PopAndDestroy(bufferAllocator);
+
+	
+	HEAP_TEST_LS_SESSION(iLs, 0, 0, TestAppListInvalidL(), iLs.ClearAppInfoArray() );
+	//DONT_CHECK due to file system changes
+	HEAP_TEST_LS_SESSION(iLs, 0, DONT_CHECK, TestAppListInstallationL(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iLs, 0, DONT_CHECK, TestAppListInstallation1L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iLs, 0, DONT_CHECK, TestAppFolderNonRomDrivesL(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iLs, 0, 0, IconLoadingTestCasesL(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iLs, 0, 0, AppInfoTestCasesL(), iLs.ClearAppInfoArray(); NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iLs, 0, 0, EmbeddedAppsTestCases(), iLs.ClearAppInfoArray() );
+	HEAP_TEST_LS_SESSION(iLs, 0, DONT_CHECK, DoNumDefIconsTestL(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iLs, 0, 0, TestMatchesSecurityPolicy(), NO_CLEANUP);
+	//DONT_CHECK since there's a new typestore
+	HEAP_TEST_LS_SESSION(iLs, 0, DONT_CHECK, TestNotifyOnDataMappingChangeL(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iLs, 0, 0, TestAppListRecognizeDataBufferOnlyL(), iLs.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(iLs, 0, 0, TestAppListRecognizeDataL(), iLs.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(iLs, 0, 0, TestDataPriorityForUnTrustedApps(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iLs, 0, 0, TestDataPriorityForUnTrustedAppsRegFile(), NO_CLEANUP);
+	TestIconLoaderAndIconArrayMemoryLeaksL();
+	}
+
+/**
+   Destructor
+ */
+CT_RApaLsSessionTestStep::~CT_RApaLsSessionTestStep()
+	{
+	RFbsSession::Disconnect();
+	iFs.Close();
+	iLs.Close();
+	}
+
+/**
+   Constructor
+ */
+CT_RApaLsSessionTestStep::CT_RApaLsSessionTestStep()
+	{
+	FbsStartup();
+	TInt ret=RFbsSession::Connect();
+	TEST(ret==KErrNone);
+
+	ret=iFs.Connect();
+	TEST(ret==KErrNone);
+	
+	setup();
+
+	ret = iLs.Connect();
+	TEST(ret==KErrNone);
+	
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_RApaLsSessionStep);
+	}
+
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+TVerdict CT_RApaLsSessionTestStep::doTestStepPreambleL()
+	{
+	SetTestStepResult(EPass);
+	return TestStepResult();
+	}
+
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+TVerdict CT_RApaLsSessionTestStep::doTestStepPostambleL()
+	{
+	return TestStepResult();
+	}
+
+
+TVerdict CT_RApaLsSessionTestStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Testing Apparc...T_RApaLsSession Test Cases Running..."));
+
+	TRAPD(ret,RunTestCasesL())
+	TEST(ret==KErrNone);
+	
+	INFO_PRINTF1(_L("...T_RApaLsSession Test Cases Completed."));
+
+	return TestStepResult();
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_RApaLsSessionStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,140 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code  
+*/
+
+#if (!defined __T_RAPALSSESSION_STEP_H__)
+#define __T_RAPALSSESSION_STEP_H__
+
+_LIT(KT_RApaLsSessionStep,"T_RApaLsSession");
+
+#include "ApparcTestServer.h"
+
+#include <coecntrl.h>
+#include <coeccntx.h>
+#include <coemain.h>
+#include <coeview.h>
+#include <eikdialg.h>
+#include <eikdoc.h>
+#include <eikapp.h>
+#include <eiksrvc.h>
+#include <eikconso.h>
+#include <eikenv.h>
+
+#include <apaid.h>
+#include "..\apparc\apadll.h"
+#include <apgaplst.h>
+#include <apgicnfl.h>
+#include <apgdoor.h>
+#include <apfrec.h>
+#include <apfctlf.h>
+#include <apgctl.h>
+#include <apgaplst.h>
+#include <apaflrec.h>
+#include "testableapalssession.h"
+#include <apacmdln.h>
+#include <apsserv.h>
+#include <datastor.h>
+#include "appfwk_test_AppUi.h"
+#include "TAppEmbedUids.h"
+
+
+class CT_RApaLsSessionTestStep : public CTestStep
+	{
+public:
+	CT_RApaLsSessionTestStep();
+	~CT_RApaLsSessionTestStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+	void RunTestCases();
+
+private:
+	void ConstructL();
+	void setup();
+	void RunTestCasesL();
+	void TestAppListInvalidSetupL();
+	TBool ComparePaths(const TDesC& aFilename, const TDesC& aPath);
+	
+	void TestAppListInvalidL();
+	
+	void IconLoadingTestCasesL();
+	void TestServerIconLoadingBySizeSetupL();
+	void TestServerIconSizeCountL(CArrayFixFlat<TSize>& aTestIconSizeArray);
+	void TestServerIconLoadingBySize1L(CArrayFixFlat<TSize>& aTestIconSizeArray);
+	void TestServerIconLoadingBySize2L(CArrayFixFlat<TSize>& aTestIconSizeArray);
+	void TestServerIconLoadingBySize3L(CArrayFixFlat<TSize>& aTestIconSizeArray);
+	
+	void AppInfoTestCasesL();
+	void TestGetAppCapabilityL();
+	void TestRecognizeSpecificData();
+	void TestSetGetAcceptedConfidenceL();
+	void TestSetGetMaxDataBufSizeL();
+	void TestGetSupportedDataTypesL();
+	void TestGetAppIconL();
+	void TestGetAppIcon1L();
+	void TestGetAppIcon2L();
+	void TestGetAppIconForMBMIconsL();
+	void TestGetAppIconForSVGIconsL();
+
+	void TestGetAppViewsL();
+	void TestGetAppViewsFailureL();
+	
+	void TestAppListInfoDataInterrogationSetupL();
+	void TestAppInfo1();
+	void TestAppInfo2();
+	void TestAppInfo3();
+	void TestAppInfo4();
+
+	void TestAppListRecognizeDataL();
+	void TestAppListRecognizeDataBufferOnlyL();
+	void TestAppListInstallationL();
+	void TestAppListInstallation1L();
+	void TestAppFolderNonRomDrivesL();
+
+	void EmbeddedAppsTestCases();
+	void DoGetAllApps();
+	void DoGetEmbeddableApps();
+	void DoEmbeddableAppCount();
+	void DoGetAppCapability();
+	void DoGetFilteredApps1();
+	void DoGetFilteredApps2();
+	void DoGetFilteredApps3();
+	void DoGetFilteredApps4();
+	void DoGetFilteredApps5();
+	void DoGetFilteredApps6();
+	void DoTestEmbeddabilityFilter1();
+	void DoTestEmbeddabilityFilter2();
+	void DoTestEmbeddabilityFilter3();
+	void DoTestEmbeddabilityFilter4();
+	void DoTestEmbeddabilityFilter5();
+	void DoNumDefIconsTestL();
+	void TestMatchesSecurityPolicy();
+	void TestNotifyOnDataMappingChangeL();
+	void TestDataPriorityForUnTrustedApps();
+	void TestDataPriorityForUnTrustedAppsRegFile();
+	void TestIconLoaderAndIconArrayMemoryLeaksL();
+private:
+	RFs iFs;
+	RTestableApaLsSession iLs;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_RecUpgrade.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,223 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This test case is used to verify that a recognizer plugin can be upgraded and  used 
+// without reboot.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include "testableapalssession.h"
+#include "T_RecUpgrade.h"
+#include "appfwk_test_utils.h"
+#include "trecupgrade/upgconstants.h"
+
+/////////////////////////////////////////////////
+
+// Should be enough for CApaEComMonitor to detect new plugin
+const TInt KOneSecondDelay = 1000000;
+
+/////////////////////////////////////////////////
+
+CT_RecUpgradeStep::CT_RecUpgradeStep()
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_RecUpgradeStep);
+	}
+
+CT_RecUpgradeStep::~CT_RecUpgradeStep()
+	{
+	}
+
+/**
+Check that the test plugin file has not been left in the filesystem from a previous run.
+*/
+TVerdict CT_RecUpgradeStep::doTestStepPreambleL()
+	{
+	RSmlTestUtils fs;
+	CleanupClosePushL(fs);
+	User::LeaveIfError(fs.Connect());
+	
+	INFO_PRINTF1(_L("Verifies that recupgrade.rsc was not present during boot."));
+	TBool fileExists = ETrue;
+	TInt err = fs.IsFilePresent(KUpgRscTargetPath, fileExists);
+	TESTE(fileExists==EFalse, err);
+	
+	CleanupStack::PopAndDestroy(&fs);
+	return TestStepResult();
+	}
+
+/*
+Delete the plugin file which was installed during the test from c:.
+*/
+TVerdict CT_RecUpgradeStep::doTestStepPostambleL()
+	{
+	RSmlTestUtils fs;
+	CleanupClosePushL(fs);
+	User::LeaveIfError(fs.Connect());
+
+	TBool fileExists = EFalse;
+	fs.IsFilePresent(KUpgRscTargetPath, fileExists);
+	if(fileExists)
+		{
+		fs.ChangeFilePermissionL(KUpgRscTargetPath); // clear readonly attribute inherited from z:
+		const TInt err = fs.DeleteFileL(KUpgRscTargetPath);
+		if(err == KErrNone) 
+			INFO_PRINTF1(_L("Removed temporary file recupgrade.rsc"));
+		else 
+			INFO_PRINTF1(_L("Failed to remove temporary file recupgrade.rsc"));	
+		}
+		
+	CleanupStack::PopAndDestroy(&fs);
+	return TestStepResult();
+	}
+	
+/*
+The test entry point
+*/			
+TVerdict CT_RecUpgradeStep::doTestStepL()
+	{
+	RTestableApaLsSession apparcServer;
+	CleanupClosePushL(apparcServer);
+	User::LeaveIfError(apparcServer.Connect());
+	//DONT_CHECK skips the heap check at server side. This heap imbalance happens due to copying recupgrade.dll to c:\sys\bin
+	//and failed to delete it in cleanup (Windows OS don’t allow to delete any file which are in use).
+ 	HEAP_TEST_LS_SESSION(apparcServer, 0, DONT_CHECK, TestUpgradeRecognizerL(apparcServer), NO_CLEANUP);
+
+	CleanupStack::PopAndDestroy(&apparcServer);
+	
+	return TestStepResult();
+	}
+
+/**
+@SYMTestCaseID APPFWK-APPARC-0100
+
+@SYMDEF INC127312
+
+@SYMTestCaseDesc This test verify that apparc can dynamically upgrade and use an Ecom recognizer plugin.
+
+@SYMTestPriority High
+
+@SYMTestStatus Implemented
+
+@SYMTestActions:
+	
+	1. Try to recognize .upg file with version 1 of recupgrade ECOM plugin but if shuld not be able to recognize as it is implemented like that
+	2. Install version 2 of recupgrade plugin (copy recupgrade_winscw/armv5_rec.dll and recupgrade_1.rsc from z:\system\data to c:\sys\bin and c:\resource\plugin respectively)
+
+	3. Because of installation Apparc will be notified and it will reload all recognizers plugin
+	4. Now try to recognize .upg file . it shuld be able to recognize as vertion 2 is implemented like that
+
+@SYMTestExpectedResults Test should complete without any leave, panic or error.
+ */
+void CT_RecUpgradeStep::TestUpgradeRecognizerL(RApaLsSession& aApparcServer)
+	{
+	
+	TDataRecognitionResult recogResult;
+	TBuf8<255> buffer;
+	buffer.FillZ(255);
+	recogResult.Reset();
+		
+	// Since recognizer for "mime\upg" mime type is installed but it will return CApaDataRecognizerType::ENotRecognized as implemented : call to RecognizeData()
+	// returns CApaDataRecognizerType::ENotRecognized.
+	INFO_PRINTF1(_L("MIME type recognition cache is not used..."));
+	TEST(aApparcServer.RecognizeData(KUpgDocPath, buffer, recogResult)==KErrNone);
+
+	TEST(recogResult.iConfidence == CApaDataRecognizerType::ENotRecognized);
+
+	INFO_PRINTF1(_L("Installs upgrade of  mime/upg recognizer plugin file "));
+	RSmlTestUtils fs;
+	CleanupClosePushL(fs);
+	User::LeaveIfError(fs.Connect());
+	
+	// Ensure c:\\resource\\plugins is created, otherwise leave from this teststep
+	
+	TInt err = fs.CreateDirectoryL(KUpgRscTargetDir);
+	TESTEL((err == KErrNone || err == KErrAlreadyExists), err);
+	INFO_PRINTF1(_L("c:\\resource\\plugins is created successfully or already exists"));
+	
+	// Ensure c:\\sys\\bin is created, otherwise leave from this teststep
+	
+	err = fs.CreateDirectoryL(KUpgDllTargetDir);
+	TESTEL((err == KErrNone || err == KErrAlreadyExists), err);
+	INFO_PRINTF1(_L("c:\\sys\\bin is created successfully or already exists"));
+
+	// Copy recupgrade.rsc from z:\\ to c:\\resource\\plugins, to trigger the rescan for plugins.
+	
+	err = fs.CopyFileL(KUpgRscSourcePath, KUpgRscTargetPath);
+	TEST(err == KErrNone);
+	INFO_PRINTF1(_L("Successfully copied recupgrade.rsc from Z:\\system\\data to c\\resource\\plugins"));
+	// Copy recupgrade_*.dll from z:\\ to c:\\sys\\bin.
+	#ifdef __WINS__ 
+		err = fs.CopyFileL(KUpgDllSourcePathWinscw, KUpgDllTargetPath);
+	#else
+		err = fs.CopyFileL(KUpgDllSourcePathArmv5, KUpgDllTargetPath);
+	#endif
+	TEST(err == KErrNone);
+	INFO_PRINTF1(_L("Successfully copied recupgrade_*.dll from Z:\\system\\data to c:\\sys\\bin"));
+
+	INFO_PRINTF2(_L("Waits %d seconds for new mime/upg recognizer with EPossible confidence to be installed."), (4 * KOneSecondDelay)/1000000);	
+	User::After(4 * KOneSecondDelay);
+	
+	// Without fix for INC127312: Apparc server will not reload all upgraded MIME type recognition hence new version of existing will not used for recognization 
+	INFO_PRINTF1(_L("MIME type recognition cache is flushed when a new recogizer is installed"));
+	recogResult.Reset();
+	TEST(aApparcServer.RecognizeData(KUpgDocPath, buffer, recogResult)==KErrNone);
+	TEST(recogResult.iDataType.Des8().CompareF(KMimeUpgType) == 0);
+	TEST(recogResult.iConfidence == CApaDataRecognizerType::EPossible);
+		
+	
+// Delete the plugin resource file of the recognizer with EPossible confidence which was installed during the test from z:.
+	
+	TInt fileExists = EFalse;
+	fs.IsFilePresent(KUpgRscTargetPath, fileExists);
+	if (fileExists)
+		{
+		fs.ChangeFilePermissionL(KUpgRscTargetPath); // clear readonly attribute inherited from z:
+		err = fs.DeleteFileL(KUpgRscTargetPath);
+		if(err == KErrNone) 
+			INFO_PRINTF1(_L("Removed file recupgrade.rsc"));
+		else 
+			INFO_PRINTF1(_L("Failed to remove recupgrade.rsc"));	
+		}
+
+	fileExists = EFalse;
+	fs.IsFilePresent(KUpgDllTargetPath, fileExists);
+	if (fileExists)
+		{
+		fs.ChangeFilePermissionL(KUpgDllTargetPath); // clear readonly attribute inherited from z:
+		err = fs.DeleteFileL(KUpgDllTargetPath);
+		if(err == KErrNone) 
+			INFO_PRINTF1(_L("Removed recupgrade.dll"));
+		else 
+			INFO_PRINTF1(_L("Failed to remove recupgrade.dll"));	
+		}
+
+	INFO_PRINTF2(_L("Waits %d seconds for the data recognizer list maintained by EMIME to be updated"), (10 * KOneSecondDelay)/1000000);	
+ 	User::After(10 * KOneSecondDelay);
+	
+	// Since "mime/upg" recognizer version 2 is uninstalled, mime/upg mime type is not recognized. 
+	INFO_PRINTF1(_L("MIME type recognition cache is flushed when a existing recogizer is uninstalled"));
+	recogResult.Reset();
+	TEST(aApparcServer.RecognizeData(KUpgDocPath, buffer, recogResult)==KErrNone);
+	TEST(recogResult.iConfidence == CApaDataRecognizerType::ENotRecognized);
+	
+	CleanupStack::PopAndDestroy(&fs);
+	
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_RecUpgrade.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,47 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code	 
+*/
+
+#ifndef		__T_RECUPGRADE_H
+#define		__T_RECUPGRADE_H
+
+#include 	<testexecutestepbase.h>
+
+_LIT(KT_RecUpgradeStep, "T_RecUpgrade");
+
+class CT_RecUpgradeStep : public CTestStep
+	{
+public:
+	CT_RecUpgradeStep();
+	~CT_RecUpgradeStep();
+	
+	//from CTestStep
+	TVerdict doTestStepPreambleL();
+	TVerdict doTestStepL();
+	TVerdict doTestStepPostambleL();
+
+private:
+	void TestUpgradeRecognizerL(RApaLsSession& aApparcServer);
+	TBool DoRecognizeL(RApaLsSession& aApparcServer, const TDataType& aDataType);
+	void CopyRecognizerFileL();
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_RuleBasedLaunchingStep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,467 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// The following test cases test the funtionality of RuleBased plugins framework.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <apacmdln.h>
+#include "..\tef\tRuleBasedApps\RuleBasedUID.H" //The UID'S for the 4 applications used during testing
+#include "T_RuleBasedLaunchingStep.h"
+#include <APGICNFL.H>
+#include "testableapalssession.h"
+
+const TUint KNonNativeApplicationType = 0x10207f90;
+const TUint KNonNativeApplication = 0xA0000B6E;
+
+_LIT(KLitNativeExecutable, "z:\\sys\\bin\\TNNAPP2.EXE");
+_LIT(KLitLogicalExecutableA, "c:\\A.NNAPP2"); // this file never actually needs to exist
+_LIT8(KLitMimeTypeA, "x-epoc/a-nnapp2");
+
+CTRuleBasedLaunchingStep::CTRuleBasedLaunchingStep()
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_RuleBasedLaunchingStep);
+	}
+
+CTRuleBasedLaunchingStep::~CTRuleBasedLaunchingStep()
+	{
+	iWs.Close();
+	iFs.Close();
+	}
+
+void CTRuleBasedLaunchingStep::ExecuteL()
+	{
+	RTestableApaLsSession theLs;
+	User::LeaveIfError(theLs.Connect());
+	CleanupClosePushL(theLs);
+	
+	//DONT_CHECK since app list is updated
+	HEAP_TEST_LS_SESSION(theLs, 0, DONT_CHECK, TestLaunchNonNativeApplicationForRuleBasedL(theLs), NO_CLEANUP);	
+	//DONT_CHECK since result is unstable
+	HEAP_TEST_LS_SESSION(theLs, 0, DONT_CHECK, LaunchAppTests1L(theLs), theLs.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(theLs, 0, 0, LaunchAppTests2L(theLs), theLs.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(theLs, 0, 0, LaunchAppTests3L(theLs), theLs.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(theLs, 0, 0, LaunchAppTests4L(theLs), theLs.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(theLs, 0, 0, LaunchAppTests5L(theLs), theLs.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(theLs, 0, 0, LaunchAppTests6L(theLs), theLs.FlushRecognitionCache() );
+	
+	CleanupStack::PopAndDestroy(&theLs);
+	}
+	
+LOCAL_C void DeregisterNonNativeForRuleBased(TAny* aApparcServer)
+	{
+	RApaLsSession& apparcServer = *static_cast<RApaLsSession*>(aApparcServer);
+	TRAP_IGNORE(apparcServer.PrepareNonNativeApplicationsUpdatesL());
+	TRAP_IGNORE(apparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KNonNativeApplication)));
+	TRAP_IGNORE(apparcServer.CommitNonNativeApplicationsUpdatesL());
+	TRAP_IGNORE(apparcServer.DeregisterNonNativeApplicationTypeL(TUid::Uid(KNonNativeApplicationType)));
+	}
+
+void CTRuleBasedLaunchingStep::TestLaunchNonNativeApplicationForRuleBasedL(RApaLsSession& aApparcServer)
+	{
+	INFO_PRINTF1(_L("TestLaunchNonNativeApplicationForRuleBasedL..."));
+
+	// make sure we're starting from a clean sheet
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KNonNativeApplication));
+	aApparcServer.CommitNonNativeApplicationsUpdatesL();
+	aApparcServer.DeregisterNonNativeApplicationTypeL(TUid::Uid(KNonNativeApplicationType));
+	CleanupStack::PushL(TCleanupItem(DeregisterNonNativeForRuleBased, &aApparcServer));
+
+	aApparcServer.RegisterNonNativeApplicationTypeL(TUid::Uid(KNonNativeApplicationType), KLitNativeExecutable);
+
+	CApaRegistrationResourceFileWriter* const registrationResourceFileWriter = CApaRegistrationResourceFileWriter::NewL(TUid::Uid(KNonNativeApplication), KLitLogicalExecutableA, TApaAppCapability::ENonNative);
+	CleanupStack::PushL(registrationResourceFileWriter);
+	registrationResourceFileWriter->AddDataTypeL(KDataTypePriorityNormal, KLitMimeTypeA);
+
+	CApaCommandLine* const commandLineForNonNativeApp = CApaCommandLine::NewLC();
+	commandLineForNonNativeApp->SetExecutableNameL(KLitLogicalExecutableA);
+
+	INFO_PRINTF1(_L("..registering app using RegisterNonNativeApplicationL() "));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KNonNativeApplicationType), EDriveC, *registrationResourceFileWriter, NULL, NULL);
+	aApparcServer.CommitNonNativeApplicationsUpdatesL();
+
+	// Since NonNative application will be launched inspite of Rule saying it should not be launched 
+	INFO_PRINTF1(_L("Testing launching of a NonNativeApp..."));
+	TEST(aApparcServer.StartApp(*commandLineForNonNativeApp) == KErrCancel);
+
+	INFO_PRINTF1(_L("..deregistering app using DeregisterNonNativeApplicationL() "));
+	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
+	aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KNonNativeApplication));
+	aApparcServer.CommitNonNativeApplicationsUpdatesL();
+
+ 	// clean-up
+	CleanupStack::PopAndDestroy(3); 
+	}
+
+/**
+@SYMTestCaseID 		APPFWK-APPARC-0023  
+@SYMPREQ 			PREQ1122   
+@SYMTestCaseDesc 	Rule Based Launching of Applications     
+@SYMTestPriority 	High   
+@SYMTestStatus 		Implemented   
+
+@SYMTestActions 		The test utilises 4 test applications that simply display the appication name.
+   			Each application is launched and closed in sequence.
+
+@SYMTestExpectedResults The test verifies that each application can be opened and closed normally.
+*/
+void CTRuleBasedLaunchingStep::LaunchAppTests1L(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("Test case 1 started"));
+	
+	// App1 is launched and closed
+	TEST(AppLaunchedL(aLs, KUidApp1) == KErrNone);
+	TEST(AppClosed(KUidApp1) == KErrNone);
+
+	// App2 is launched and closed
+	TEST(AppLaunchedL(aLs, KUidApp2) == KErrNone);
+	TEST(AppClosed(KUidApp2) == KErrNone);
+
+	// App3 is launched and closed
+	TEST(AppLaunchedL(aLs, KUidApp3) == KErrNone);
+	TEST(AppClosed(KUidApp3) == KErrNone);
+
+	// App4 is launched and closed
+	TEST(AppLaunchedL(aLs, KUidApp4) == KErrNone);
+	TEST(AppClosed(KUidApp4) == KErrNone);
+	
+	// Close all apps
+	ClosedAllTestApp();
+	
+	INFO_PRINTF1(_L("Test case 1 finished"));
+	}
+	
+/**
+@SYMTestCaseID 		APPFWK-APPARC-0024  
+@SYMPREQ 			PREQ1122   
+@SYMTestCaseDesc 	Rule Based Launching of Applications     
+@SYMTestPriority 	High   
+@SYMTestStatus 		Implemented
+
+@SYMTestActions 	The test utilises 3 test applications that simply display the appication name.
+   			The test utilises a single plugin that implements 2 rules.
+   			Only the first rule is executed(Launching App3 closes App1).
+
+@SYMTestExpectedResults The test verifies that that when an application is launched, 
+					  the rule based mechanism is invoked and only the corresponding rule executed.
+ 					      
+*/	
+void CTRuleBasedLaunchingStep::LaunchAppTests2L(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("Test case 2 started"));
+
+	TEST(AppLaunchedL(aLs, KUidApp1) == KErrNone);
+	TEST(AppLaunchedL(aLs, KUidApp2) == KErrNone);
+	TEST(AppLaunchedL(aLs, KUidApp3) == KErrNone);
+
+	TApaTaskList taskList(iWs);
+
+	//Wait 2sec for App1 to be closed
+	User::After(2 * 1000000);
+
+	// App1 should be closed when App3 is launched
+	const TApaTask task1 = taskList.FindApp(KUidApp1);
+	TEST(!task1.Exists());
+	const TApaTask task2 = taskList.FindApp(KUidApp2);
+	TEST(task2.Exists());
+	const TApaTask task3 = taskList.FindApp(KUidApp3);
+	TEST(task3.Exists());
+	
+	// Close all apps
+	ClosedAllTestApp();
+	
+	INFO_PRINTF1(_L("Test case 2 finished"));
+	}
+	
+/**
+@SYMTestCaseID 		APPFWK-APPARC-0025
+@SYMPREQ 			PREQ1122 
+@SYMTestCaseDesc 	Rule Based Launching of Applications  
+@SYMTestPriority 	High 
+@SYMTestStatus 		Implemented
+
+@SYMTestActions 	The test utilises 2 test applications that simply display the appication name.
+   			Only the first rule is executed(A running App3 prevents App1 launching).
+   			Only the second rule is executed(App1 cannot launch if App3 is running).
+
+@SYMTestExpectedResults The test verifies that multiple rules can be implemented in a single plugin and 
+                      only the correct rule is executed.
+ 					      	
+*/		
+void CTRuleBasedLaunchingStep::LaunchAppTests3L(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("Test case 3 started"));
+	
+	// App1 cannot be launched if App3 is running	
+	TEST(AppLaunchedL(aLs, KUidApp2) == KErrNone);
+	TEST(AppLaunchedL(aLs, KUidApp3) == KErrNone);
+	TEST(AppLaunchedL(aLs, KUidApp1) == KErrCancel);
+
+	TApaTaskList taskList(iWs);
+
+	const TApaTask task1 = taskList.FindApp(KUidApp1);
+	TEST(!task1.Exists());
+	const TApaTask task2 = taskList.FindApp(KUidApp2);
+	TEST(task2.Exists());
+	const TApaTask task3 = taskList.FindApp(KUidApp3);
+	TEST(task3.Exists());
+
+	// Close all apps
+	ClosedAllTestApp();
+	
+	INFO_PRINTF1(_L("Test case 3 finished"));
+	}
+	
+/**
+@SYMTestCaseID 		APPFWK-APPARC-0026
+@SYMPREQ 			PREQ1122 
+@SYMTestCaseDesc 	Rule Based Launching of Applications  
+@SYMTestPriority 	High 
+@SYMTestStatus 		Implemented
+
+@SYMTestActions 	The test utilises 3 test applications that simply display the appication name.
+   			The test utilises 2 plugins.
+   			Rules from both plugins are executed.
+   			Plugin1 (Launching App4 closes App2)
+   			Plugin2 (Launching App4 closes App3)
+   				
+@SYMTestExpectedResults The test verifies that multiple rules can be implemented in multiple plugins and 
+                      only the correct rules are executed.
+*/		
+void CTRuleBasedLaunchingStep::LaunchAppTests4L(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("Test case 4 started"));
+	
+	// App2 and App3 are closed if App4 is launched
+	TEST(AppLaunchedL(aLs, KUidApp3) == KErrNone);
+	TEST(AppLaunchedL(aLs, KUidApp2) == KErrNone);
+	TEST(AppLaunchedL(aLs, KUidApp4) == KErrNone);
+	
+	TApaTaskList taskList(iWs);
+	
+	//Wait 2sec for App2 and App3 to be closed 
+	User::After(2 * 1000000);
+
+	const TApaTask task2 = taskList.FindApp(KUidApp2);
+	TEST(!task2.Exists());
+	const TApaTask task3 = taskList.FindApp(KUidApp3);
+	TEST(!task3.Exists());
+	const TApaTask task4 = taskList.FindApp(KUidApp4);
+	TEST(task4.Exists());
+	
+	// Close all apps
+	ClosedAllTestApp();
+	
+	INFO_PRINTF1(_L("Test case 4 finished"));	
+	}
+
+/**
+@SYMTestCaseID 		APPFWK-APPARC-0027
+@SYMPREQ 			PREQ1122 
+@SYMTestCaseDesc 	Rule Based Launching of Applications  
+@SYMTestPriority 	High 
+@SYMTestStatus 		Implemented
+
+@SYMTestActions 	The test cases is similar to APPFWK-APPARC-0025 but it launching applications 
+					via associated documents.
+
+@SYMTestExpectedResults The test verifies that multiple rules can be implemented in a single plugin and 
+                      only the correct rule is executed.
+ 					      	
+*/		
+void CTRuleBasedLaunchingStep::LaunchAppTests5L(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("Test case 5 started"));
+	
+	// App1 cannot be launched if App3 is running
+	TEST(LaunchAppFromAssociatedDocument(aLs, KUidApp2) == KErrNone);
+	TEST(LaunchAppFromAssociatedDocument(aLs, KUidApp3) == KErrNone);
+	// Wait 2sec for App2 and App3 to be closed
+	User::After(2 * 1000000);
+	TEST(LaunchAppFromAssociatedDocument(aLs, KUidApp1) == KErrCancel);
+		
+	TApaTaskList taskList(iWs);
+	
+	const TApaTask task1 = taskList.FindApp(KUidApp1);
+	TEST(!task1.Exists());
+	const TApaTask task2 = taskList.FindApp(KUidApp2);
+	TEST(task2.Exists());
+	const TApaTask task3 = taskList.FindApp(KUidApp3);
+	TEST(task3.Exists());
+	
+	// Close all apps
+	ClosedAllTestApp();
+	
+	INFO_PRINTF1(_L("Test case 5 finished"));
+	}
+
+/**
+@SYMTestCaseID 		APPFWK-APPARC-0028
+@SYMPREQ 			PREQ1122 
+@SYMTestCaseDesc 	Rule Based Launching of Applications  
+@SYMTestPriority 	High 
+@SYMTestStatus 		Implemented
+
+@SYMTestActions 	The test case launches an applications where file name defined whether without extension or 
+					disk drive, or as non system path.
+
+@SYMTestExpectedResults Rule based framework has to process this name correctly and apply pre-defined rules.
+ 					      	
+*/		
+void CTRuleBasedLaunchingStep::LaunchAppTests6L(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("Test case 6 started"));
+	
+	TPtrC arFileName[] =  {	_L("tRuleBasedApp1.exe"),
+							_L("\\sys\\bin\\tRuleBasedApp1.exe"),
+							_L("\\nonsys\\bin\\tRuleBasedApp1.exe"),
+							_L("\\sys\\bin\\tRuleBasedApp1"),
+							_L("tRuleBasedApp1"),
+						  };
+	TInt sizeOfFileNameArray = sizeof(arFileName) / sizeof(arFileName[0]);
+	
+	for(TInt ii = 0; ii < sizeOfFileNameArray; ii++)
+		{
+		TEST(LaunchAppFromAssociatedDocument(aLs, KUidApp3) == KErrNone);
+		TEST(AppLaunchedL(aLs, arFileName[ii]) == KErrCancel);
+
+		TApaTaskList taskList(iWs);
+
+		const TApaTask task1 = taskList.FindApp(KUidApp1);
+		TEST(!task1.Exists());
+		const TApaTask task3 = taskList.FindApp(KUidApp3);
+		TEST(task3.Exists());
+		if(task1.Exists() || !task3.Exists())
+			{	
+			INFO_PRINTF2(_L("The name %S is not recognized by rule based plug-ins as a valid"), &arFileName[ii]);
+			}
+		
+		// Close all apps
+		ClosedAllTestApp();
+		}
+		
+	INFO_PRINTF1(_L("Test case 6 finished"));
+	}
+	
+/**
+The function is used to launch an app whose UID is supplied as its second input parameter.
+The function returns KErrNone upon success, KErrGeneral otherwise.
+*/
+TInt CTRuleBasedLaunchingStep::AppLaunchedL(RApaLsSession& aLs, const TUid& aAppUid)
+	{	
+	TApaAppInfo info; 
+	TFileName fileName;
+	aLs.GetAppInfo(info,aAppUid);
+	//Wait 0.5sec for function to complete
+	User::After(500000);
+	fileName = info.iFullName; 
+	CApaCommandLine* cmdLn = CApaCommandLine::NewLC();     
+	cmdLn->SetExecutableNameL(fileName);
+	TInt result = aLs.StartApp(*cmdLn);
+	//Wait 0.5sec for App to start
+	User::After(500000);
+	CleanupStack::PopAndDestroy(cmdLn);
+	return result;
+	}
+
+/**
+The function is used to launch an application using full file name as param.
+*/
+TInt CTRuleBasedLaunchingStep::AppLaunchedL(RApaLsSession& aLs, const TDesC& aAppFullFileName)
+	{	
+	CApaCommandLine* cmdLn = CApaCommandLine::NewLC();     
+	cmdLn->SetExecutableNameL(aAppFullFileName);
+	TInt result = aLs.StartApp(*cmdLn);
+	//Wait 0.5sec for App to start
+	User::After(500000);
+	CleanupStack::PopAndDestroy(cmdLn);
+	return result;
+	}
+
+/**
+The function is used to launch an application via dummy document associated with this application.
+*/
+TInt CTRuleBasedLaunchingStep::LaunchAppFromAssociatedDocument(RApaLsSession& aLs,const TUid& aAppUid)
+	{	
+	TDataType theDataType(aAppUid); 
+	TThreadId theThreadId;
+	TInt result = aLs.StartDocument(KNullDesC, theDataType, theThreadId);
+	//Wait 2sec for App to start
+	User::After(2 * 1000000);
+	return result;
+	}
+
+/**
+The function is used to close an app whose UID is supplied as the input parameter.
+The function returns KerrNone upon success, KErrGeneral othewise.
+*/
+TInt CTRuleBasedLaunchingStep::AppClosed(TUid AppUid)
+	{
+	TInt result = KErrNone;
+	TApaTaskList taskList(iWs);
+	TApaTask task1 = taskList.FindApp(AppUid);
+	if(task1.Exists())
+		{
+		task1.EndTask();
+		//Wait 0.5sec for the App to close
+		User::After(500000);
+
+		const TApaTask task2 = taskList.FindApp(AppUid);
+		if (task2.Exists())
+			{
+			result = KErrGeneral;
+			}
+		}
+	return result;
+	}
+
+/** The function close all test applications */ 
+void CTRuleBasedLaunchingStep::ClosedAllTestApp()
+	{
+	AppClosed(KUidApp1);
+	AppClosed(KUidApp2);
+	AppClosed(KUidApp3);
+	AppClosed(KUidApp4);
+	}
+
+TVerdict CTRuleBasedLaunchingStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("TRuleBasedLaunchingStep test started...."));
+	
+	User::LeaveIfError(FbsStartup());
+	TInt ret=RFbsSession::Connect();
+
+	User::LeaveIfError(iFs.Connect());
+	User::LeaveIfError(iWs.Connect());
+	
+	TEST(ret==KErrNone);
+	__UHEAP_MARK;			
+	TRAPD(err, ExecuteL()); 	
+	TEST(err == KErrNone);
+	INFO_PRINTF2(_L("execute tests ended with return value '%d'"), err);
+	__UHEAP_MARKEND; 			
+	
+	RFbsSession::Disconnect();
+	INFO_PRINTF1(_L(".... TRuleBasedLaunchingStep test finished!!"));
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_RuleBasedLaunchingStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,60 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+ 
+#if !defined(__T_RULEBASEDLAUNCHING_STEP_H__)
+#define __T_RULEBASEDLAUNCHING_STEP_H__
+
+#include <apgcli.h>
+#include "ApparcTestServer.h"
+#include "appfwk_test_AppUi.h"
+#include <apgtask.h>
+
+class CTRuleBasedLaunchingStep : public CTestStep
+	{
+public:
+	CTRuleBasedLaunchingStep();
+	virtual TVerdict doTestStepL();
+	void ExecuteL();
+private:
+	~CTRuleBasedLaunchingStep();
+	TInt AppLaunchedL(RApaLsSession& aLs, const TUid& AppUid);
+	TInt AppLaunchedL(RApaLsSession& aLs, const TDesC& aAppFullFileName);
+	TInt LaunchAppFromAssociatedDocument(RApaLsSession& aLs, const TUid& aAppUid);
+	TInt AppClosed(TUid AppUid);
+	void ClosedAllTestApp();
+	
+	void TestLaunchNonNativeApplicationForRuleBasedL(RApaLsSession& aApparcServer);
+	void LaunchAppTests1L(RApaLsSession& aLs);
+	void LaunchAppTests2L(RApaLsSession& aLs);
+	void LaunchAppTests3L(RApaLsSession& aLs);
+	void LaunchAppTests4L(RApaLsSession& aLs);
+	void LaunchAppTests5L(RApaLsSession& aLs);
+	void LaunchAppTests6L(RApaLsSession& aLs);
+private:
+	RFs iFs;
+	RWsSession iWs; 
+	};
+
+_LIT(KT_RuleBasedLaunchingStep,"T_RuleBasedLaunching");
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_Serv2Step.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1828 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Test wrapper to Application Architecture Server.
+// Tests Application information, Data recognition and application
+// launching capabilities of the application architecture server.\n
+// 
+//
+
+
+
+/**
+ @file
+ @test 
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <f32file.h>
+#include <fbs.h>
+#include <apaid.h>
+#include <apgaplst.h>
+#include <apaflrec.h>
+#include "testableapalssession.h"
+#include <apacmdln.h>
+#include <apsserv.h>
+#include <apfrec.h>
+#include <datastor.h>
+#include <apgicnfl.h>
+#include <apasvst.h>
+#include "tstapp.h"
+//
+#include <e32test.h>
+#include "T_Serv2Step.h"
+
+#include <coemain.h>
+#include <eikenv.h>
+#include "TAppEmbedUids.h"
+#include "appfwk_test_utils.h"
+
+// Constants
+const TInt KOneSecondDelay = 1000000;
+
+
+/**
+  This function accepts a filename with full path and searches all available
+  drives for the presence of file.
+  The method returns Filename if a match is found. 
+*/
+TFileName CT_Serv2Step::SearchAndReturnCompleteFileName(const TDesC& aFileName)
+	{
+	RFs fs;
+	TInt ret = fs.Connect();
+	TEST(ret==KErrNone);
+
+	TParsePtrC parse(aFileName);
+	TFindFile findFile(fs);
+	ret = findFile.FindByDir(parse.NameAndExt(), parse.Path());
+	if (ret!=KErrNone)
+		{
+		TBuf<64> buffer;
+		buffer.Format(_L("Error while finding the file, %d"), ret);
+		}
+	fs.Close();
+	return findFile.File();
+	}
+
+
+/**
+  @SYMTestCaseID T-Serv2Step-AppInfoTest1
+  
+  @SYMPREQ
+  
+  @SYMTestCaseDesc Test RApaLsSession::GetNextApp() 
+  
+  @SYMTestPriority High 
+  
+  @SYMTestStatus Implemented
+  
+  @SYMTestActions Call RApaLsSession::GetAllApps() to initialize the process of
+  getting all applications in the cached list. Traverse the application list
+  by calling RApaLsSession::GetNextApp() to search for application tstapp.
+  Test the application info obtained from GetNextApp() to ensure the application
+  info obtained is of tstapp. Complete traversal of the list to ensure that at
+  the end of the list, the enum ENoMoreAppInList is returned by GetNextApp().\n
+  API Calls:\n	
+  RApaLsSession::GetAllApps() const\n
+  RApaLsSession::GetNextApp(TApaAppInfo& aInfo) const\n
+  
+  @SYMTestExpectedResults The test compares the results obtained with expected values.
+   
+ */
+void CT_Serv2Step::AppInfoTest1(RApaLsSession& aLs)
+	{
+	_LIT(KLitAppPath,"z:\\sys\\bin\\tstapp.exe");
+	TFullName appPath(KLitAppPath);
+	//Search for TestApp
+	TApaAppInfo info;
+	TInt ret = aLs.GetAllApps();
+	TEST(ret==KErrNone);
+	
+	do
+		{
+		ret=aLs.GetNextApp(info);
+		} 
+		while (ret==KErrNone && info.iUid!=KUidTestApp);
+	
+	TEST(ret==KErrNone);
+	info.iFullName.LowerCase();	
+	TEST(info.iFullName.Compare(appPath) == 0);
+
+	//Make sure ENoMoreAppsInList is returned at the end of list.
+	do
+		{
+ 		ret=aLs.GetNextApp(info);
+ 		}
+ 		while (ret != RApaLsSession::ENoMoreAppsInList);
+ 
+ 	ret=aLs.GetNextApp(info);
+ 	TEST(ret==RApaLsSession::ENoMoreAppsInList);
+	}
+
+
+/**
+   @SYMTestCaseID T-Serv2Step-DoCheckServerIconLoadingBySizeL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test loading of Icon by size. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Allocate a flat dynamic buffer which would hold available icon
+   sizes for tstapp. Call RApaLsSession::GetAppIconSizes() to store the sizes
+   of icons available for the app tstapp to the allocated flat dynamic buffer.
+   Call RApaLsSession::GetAppIcon() by passing each of the icon sizes stored.
+   Verify whether icon is retrieved each time by GetAppIcon().
+   Test calling RApaLsSession::GetAppIcon() by specifying reduced size than
+   the actual icon size. Since no match would be found, KErrNotFound should be
+   returned. Test GetAppIcon() again by specifying an increased size than the
+   actual icon size. Observe whether the GetAppIcon() in this case gets the
+   closest icon available.\n
+   API Calls:\n	
+   RApaLsSession::GetAppIcon(TUid aAppUid, TSize aSize, CApaMaskedBitmap& aAppBitmap) const\n
+   
+   @SYMTestExpectedResults The results obtained are compared with the expected values to verify
+   functionality of RApaLsSession::GetAppIcon().
+    
+ */
+void CT_Serv2Step::DoCheckServerIconLoadingBySizeL(RApaLsSession& aLs)
+	{
+	CArrayFixFlat<TSize>* array=new(ELeave) CArrayFixFlat<TSize>(3);
+	CleanupStack::PushL(array);
+	TInt ret=KErrNone;
+	ret=aLs.GetAppIconSizes(KUidTestApp,*array);
+	if(ret==KErrNoMemory)
+		User::Leave(KErrNoMemory);
+	TEST(ret==KErrNone);
+	TEST(array->Count());
+	for(TInt i=0;i<array->Count();i++)
+		{
+		CApaMaskedBitmap* iconBySize=CApaMaskedBitmap::NewLC();
+		ret=aLs.GetAppIcon(KUidTestApp,(*array)[i],*iconBySize); //by Size
+		if(ret==KErrNoMemory)
+			User::Leave(KErrNoMemory);
+		TEST(ret==KErrNone);
+		TEST(iconBySize->SizeInPixels()==(*array)[i]);
+		CleanupStack::PopAndDestroy(); //iconBySize
+		}
+
+	// now try non exact sizes
+	CApaMaskedBitmap* iconBySize=CApaMaskedBitmap::NewLC();
+	ret=aLs.GetAppIcon(KUidTestApp,((*array)[0])+TSize(-5,-5),*iconBySize); //by Size
+	if(ret==KErrNoMemory)
+		User::Leave(KErrNoMemory);
+	TEST(ret==KErrNotFound);
+	CleanupStack::PopAndDestroy(); //iconBySize
+
+	for(TInt ii=0;ii<array->Count();ii++)
+		{
+		CApaMaskedBitmap* iconBySize=CApaMaskedBitmap::NewLC();
+		ret=aLs.GetAppIcon(KUidTestApp,((*array)[ii])+TSize(5,5),*iconBySize); //by Size
+		if(ret==KErrNoMemory)
+			User::Leave(KErrNoMemory);
+		TEST(ret==KErrNone);
+		TEST(iconBySize->SizeInPixels()==(*array)[ii]); // should get size below always!!!
+		CleanupStack::PopAndDestroy(); //iconBySize
+		}
+	CleanupStack::PopAndDestroy(); //array
+	}
+
+
+/**
+   @SYMTestCaseID T-Serv2Step-AppInfoTest3
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test RApaLsSession::GetNextApp() 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call RApaLsSession::GetAllApps() to initialize the process of
+   getting all applications in the cached list. Traverse the application list
+   by calling RApaLsSession::GetNextApp() to search for application tstapp.
+   Test the application information obtained from GetNextApp() to ensure that
+   information retrieved is of tstapp.\n
+   API Calls:\n	
+   RApaLsSession::GetAllApps() const\n
+   RApaLsSession::GetNextApp(TApaAppInfo& aInfo) const\n
+   
+   @SYMTestExpectedResults The test compares the results obtained with expected values.
+    
+ */
+void CT_Serv2Step::AppInfoTest3(RApaLsSession& aLs)
+	{
+	_LIT(KLitAppPath,"z:\\sys\\bin\\tstapp.exe");
+	TFullName appPath(KLitAppPath);
+	// get the first app...
+	TApaAppInfo info;
+	TInt ret = aLs.GetAllApps();
+	TEST(ret==KErrNone);
+
+	do
+		{
+		aLs.GetNextApp(info);
+		}
+		while (info.iUid!=KUidTestApp);
+		
+	TEST(ret==KErrNone);
+	TEST(info.iUid==KUidTestApp);
+	info.iFullName.LowerCase();	
+	TEST(info.iFullName.Compare(appPath) == 0);
+	}
+
+
+/**
+   @SYMTestCaseID T-Serv2Step-AppInfoTest4
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test RApaLsSession::GetAppInfo(). 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call RApaLsSession::GetAppInfo() by passing the Uid of test
+   application tstapp and test the application info obtained from GetAppInfo()
+   to ensure the obtained information is of test application tstapp.\n
+   API Calls:\n	
+   RApaLsSession::GetAppInfo(TApaAppInfo& aInfo,TUid aAppUid) const\n
+   
+   @SYMTestExpectedResults The test confirms that RApaLsSession::GetAppInfo()
+   returns the expected application info.
+    
+ */
+void CT_Serv2Step::AppInfoTest4(RApaLsSession& aLs)
+	{
+	_LIT(KLitAppPath,"z:\\sys\\bin\\tstapp.exe");
+	TFullName appPath(KLitAppPath);
+	// Get info for an app that exists
+	TApaAppInfo info;
+	TInt ret = aLs.GetAppInfo(info,KUidTestApp);
+	TEST(ret==KErrNone);
+	TEST(info.iUid==KUidTestApp);
+	info.iFullName.LowerCase();	
+	TEST(info.iFullName.Compare(appPath) == 0);
+	}
+	
+
+/**
+   @SYMTestCaseID T-Serv2Step-AppInfoTest5
+ 
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test if RApaLsSession::GetAppInfo() return KErrNotFound. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions The method calls RApaLsSession::GetAppInfo() by passing the null Uid
+   KNullUid. Observe whether KErrNotFound is returned when Uid that doesn't match
+   is passed to GetAppInfo().\n
+   API Calls:\n	
+   RApaLsSession::GetAppInfo(TApaAppInfo& aInfo,TUid aAppUid) const\n
+   
+   @SYMTestExpectedResults The test confirms RApaLsSession::GetAppInfo() returns
+   KErrNotFound when no match is found for the Uid passed.\n
+    
+ */
+void CT_Serv2Step::AppInfoTest5(RApaLsSession& aLs)
+	{
+	// get info for a non-existant app
+	TApaAppInfo info;
+	TInt ret = aLs.GetAppInfo(info,KNullUid);
+	TEST(ret==KErrNotFound);
+	}
+	
+
+/**
+  Auxiliary Fn for Test Case ID T-Serv2Step-AppInfoTest1, T-Serv2Step-AppInfoTest3, T-Serv2Step-AppInfoTest4, T-Serv2Step-AppInfoTest5
+ 
+  This function initiates test for retrieving Application Information.
+ 
+*/
+void CT_Serv2Step::DoAppInfoTests(RApaLsSession& aLs)
+	{
+	AppInfoTest1(aLs);
+	AppInfoTest3(aLs);
+	AppInfoTest4(aLs);
+	AppInfoTest5(aLs);
+	}
+
+
+/**
+   @SYMTestCaseID T-Serv2Step-StartAppTests1L
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test Launching of an application. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Prepare command line information to start an application using
+   CApaCommandLine Apis.Call RApaLsSession::StartApp() to start an
+   application defined by the command line information.\n
+   Test the launching of application for following scenarios:\n
+   (1) When Application specified by command line exists.\n
+   (2) When Application specified by command line does not exist.\n
+   API Calls:\n	
+   RApaLsSession::StartApp(const CApaCommandLine& aCommandLine)\n
+   
+   @SYMTestExpectedResults The test observes that StartApp() returns KErrNone and
+   starts the app in the first scenario. In the second case KErrNotFound is
+   returned.
+    
+ */	
+void CT_Serv2Step::StartAppTests1L(RApaLsSession& aLs)
+{
+	CApaCommandLine* cmdLn=CApaCommandLine::NewLC();
+	TFileName filename;
+	_LIT(KLitExePath,"\\sys\\bin\\texe.exe");
+	TFullName exePath(KLitExePath);
+	filename = SearchAndReturnCompleteFileName(exePath);
+	
+	_LIT8(KLitDogfish,"dogfish");
+	_LIT(KLitWibble,"wibble");
+	cmdLn->SetExecutableNameL(filename);
+	cmdLn->SetTailEndL(KLitDogfish);
+	TInt ret = aLs.StartApp(*cmdLn); // explicit
+	TEST(ret==KErrNone);
+
+	// start a non-existant app
+	cmdLn->SetExecutableNameL(KLitWibble);
+	ret = aLs.StartApp(*cmdLn);
+	TEST(ret==KErrNotFound);
+	//
+	//
+	CleanupStack::PopAndDestroy(); // cmdLn
+
+}
+
+/**
+ * @SYMTestCaseID T_Serv2Step_StartAppTests4L
+ *
+ * @SYMPREQ
+ *
+ * @SYMTestCaseDesc Test Launching of an application. 
+ * 
+ * @SYMTestActions Call RApaLsSession::StartDocument() to start an
+ * application defined by the command line information.\n
+ * Test the launching of application for following scenarios:\n
+ * (1) When Application specified by command line is EmbeddableOnly.\n
+ * (2) When Application specified by command line is EmbeddableUiNotStandAlone.\n
+ * (3) When Application specified by command line is Embeddable or StandAlone.\n
+ * API Calls:\n	
+ * RApaLsSession::StartDocument(const TDesC &aFileName, TUid aAppUid, TThreadId &aId, TLaunchType aLaunchType=ELaunchNewApp)\n
+ * 
+ * @SYMTestExpectedResults The test observes that StartDocument() returns KErrNone and
+ * starts the app in the third scenario. In the first and second case KErrNotSupported is
+ * returned.
+ *  
+ */	
+ 
+void CT_Serv2Step::StartAppTests4L(RApaLsSession& aLs)
+	{
+	TInt ret;
+	TThreadId id;
+
+	_LIT(KLitSdkDocPath,"\\system\\data\\sdk.txt");
+	TFileName filename = SearchAndReturnCompleteFileName(KLitSdkDocPath);
+	
+	// Test starting a file using an app which can be embeddable only.
+	ret=aLs.StartDocument(filename,KUidAppEmbeddableUiNotStandAlone,id);
+	TEST(ret==KErrNotSupported);
+	
+	// Test starting a file using an app which can be embeddable only.
+	ret=aLs.StartDocument(filename,KUidAppEmbeddableOnly,id);
+	TEST(ret==KErrNotSupported);
+
+	// Test starting a file using an app which can be embeddable or standalone.
+	ret=aLs.StartDocument(filename,KUidAppEmbeddable,id);
+	TEST(ret==KErrNone);
+	}
+
+/**
+* Auxiliary Fn for Test Case ID T_Serv2Step_StartAppTests1L, T_Serv2Step_StartAppTests3L,StartAppTests4L(aLs)
+*
+* This method tests launching of an application from command line by calling
+* CT_Serv2Step::StartAppTests1L().
+*
+*/
+void CT_Serv2Step::DoStartAppTestsL(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("Checking application launching"));
+
+	// start the test exe
+	StartAppTests1L(aLs);
+    StartAppTests4L(aLs);
+	}
+
+/**
+   @SYMTestCaseID T-Serv2Step-DoEnquiryTestsL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Tests querying of data (MIME) type information. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Test setting and getting the confidence threshold for
+   successful data recognition by calling RApaLsSession::SetAcceptedConfidence()
+   and RApaLsSession::GetAcceptedConfidence().\n
+   Test setting and getting maximum size of the data that can be read
+   from a file for the purpose of recognizing the data type by calling
+   RApaLsSession::SetMaxDataBufSize() and RApaLsSession::GetMaxDataBufSize().
+   Finally test retrieval of all supported data (MIME) types.\n
+   API Calls:\n	
+   RApaLsSession::SetAcceptedConfidence(TInt aConfidence)\n
+   RApaLsSession::GetAcceptedConfidence(TInt& aConfidence) const\n
+   RApaLsSession::SetMaxDataBufSize(TInt aBufSize)\n
+   RApaLsSession::GetMaxDataBufSize(TInt& aBufSize) const\n
+   RApaLsSession::GetSupportedDataTypesL(CDataTypeArray& aDataTypes) const\n
+   
+   @SYMTestExpectedResults Test results against expected values.
+    
+ */
+void CT_Serv2Step::DoEnquiryTestsL(RApaLsSession& aLs)
+	{
+	TInt temp=1234;
+	TInt ret;
+	TSecurityInfo info;
+	info.Set(RProcess());
+	
+	TBool hasCapability=info.iCaps.HasCapability(ECapabilityWriteDeviceData);
+	
+	if(hasCapability)
+		{
+		ret=aLs.SetAcceptedConfidence(temp);
+		INFO_PRINTF2(_L(" Error= %d \n"),ret);
+		TEST(ret==KErrNone);
+		}
+	else
+		{
+		ret=aLs.SetAcceptedConfidence(temp);
+		INFO_PRINTF2(_L(" Error= %d \n"),ret);
+		TEST(ret==KErrPermissionDenied);
+		}
+	temp=0;
+	ret=aLs.GetAcceptedConfidence(temp);
+	TEST(ret==KErrNone);
+	TEST(temp==1234);
+	ret=aLs.SetMaxDataBufSize(temp);
+	TEST(ret==KErrNone);
+	temp=0;
+	ret=aLs.GetMaxDataBufSize(temp);
+	CDataTypeArray* dataTypes=new(ELeave) CDataTypeArray(5);
+	CleanupStack::PushL(dataTypes);
+	TInt err=0;
+	TInt failRate=0;
+	for (failRate=1;failRate<=KMaxTInt;failRate++)
+		{
+		__UHEAP_RESET;
+		__UHEAP_SETFAIL(RHeap::EFailNext,failRate);
+		TRAP(err, ret=aLs.GetSupportedDataTypesL(*dataTypes));
+		if (err!=KErrNoMemory)
+			{
+		 	if (err==KErrNone)
+		 		{
+		 		err=ret;
+		 		}
+		 	break;
+		 	}
+		}
+	__UHEAP_RESET;
+	TEST(ret==KErrNone);
+	TEST(err==KErrNone);
+	TEST(dataTypes->Count()>=4);
+	CleanupStack::PopAndDestroy(); // dataTypes
+	}
+
+/**
+   @SYMTestCaseID T-Serv2-DoGetAllApps
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   Check that RApaLsSession::GetAllApps() hasn't been
+   affected by the new code to filter the app list
+   based on embeddability (implemented for CR PHAR-5Q4FX8)
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Call GetAllApps() once, followed by repeated calls
+   to GetNextApp until something other than KErrNone is returned
+  
+   @SYMTestExpectedResults
+   GetNextApp should return app info for the following test apps:
+   TAppNotEmbeddable.app
+   TAppEmbeddable.app
+   TAppEmbeddableOnly.app
+   TAppEmbeddableUiOrStandAlone.app
+   TAppEmbeddableUiNotStandAlone.app
+   The last call to GetNextApp should return RApaLsSession::ENoMoreAppsInList
+  
+ */
+void CT_Serv2Step::DoGetAllApps(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("DoGetAllApps"));
+
+	TInt ret = aLs.GetAllApps();
+	TEST(ret==KErrNone);
+
+	TApaAppInfo appInfo;
+	TUint bitFlags = 0;
+	while ((ret = aLs.GetNextApp(appInfo)) == KErrNone)
+		{
+		if (appInfo.iUid == KUidAppNotEmbeddable)
+			bitFlags |= 0x01;
+		else if (appInfo.iUid == KUidAppEmbeddable)
+			bitFlags |= 0x02;
+		else if (appInfo.iUid == KUidAppEmbeddableOnly)
+			bitFlags |= 0x04;
+		else if (appInfo.iUid == KUidAppEmbeddableUiOrStandAlone)
+			bitFlags |= 0x08;
+		else if (appInfo.iUid == KUidAppEmbeddableUiNotStandAlone)
+			bitFlags |= 0x10;
+		}
+	TEST(ret==RApaLsSession::ENoMoreAppsInList);
+	TEST(bitFlags == 0x1F);
+	}
+	
+	
+/* 
+   @SYMTestCaseID T-Serv2-LaunchAppThruCreateDocL
+  
+   @SYMTestCaseDesc
+   Check for the functionality of  RApaLsSession::CreateDocument(). 
+   
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions 
+   Call CreateDocument(const TDesC& aFileName, TUid aAppUid, TThreadId& aThreadId)
+   
+   @SYMTestExpectedResults
+   Verify whether the Application is launched and Document is created for the respective 
+   Application UID passed.  
+*/
+
+void CT_Serv2Step::LaunchAppThruCreateDocL(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("LaunchAppThruCreateDocL"));
+	_LIT(KFileName, "c:\\nofile.txt");
+	TThreadId startAppThreadID;
+	TInt errCreate=aLs.CreateDocument(KFileName,KUidAppEmbeddable,startAppThreadID);
+	TEST(errCreate == KErrNone);
+	
+	//we need to close the started thread, if appropiate
+	if (errCreate==KErrNone)	
+		{
+		RThread thread;
+		User::LeaveIfError(thread.Open(startAppThreadID));
+		CleanupClosePushL(thread);
+
+		RProcess process;
+		User::LeaveIfError(thread.Process(process));
+		CleanupClosePushL(process);
+
+		process.Kill(0);
+		
+		CleanupStack::PopAndDestroy(&process);
+		CleanupStack::PopAndDestroy(&thread);
+		}
+		
+	}
+	
+/**
+   @SYMTestCaseID T-Serv2-DoGetEmbeddableApps
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   Check that RApaLsSession::GetEmbeddableApps() hasn't been
+   affected by the new code to filter the app list
+   based on embeddability (implemented for CR PHAR-5Q4FX8)
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Call GetEmbeddableApps() once, followed by repeated calls
+   to GetNextApp until something other than KErrNone is returned
+  
+   @SYMTestExpectedResults
+   GetNextApp should return app info for the following test apps:
+   TAppEmbeddable.app
+   TAppEmbeddableOnly.app
+   and should not return app info for:
+   TAppNotEmbeddable.app
+   TAppEmbeddableUiOrStandAlone.app
+   TAppEmbeddableUiNotStandAlone.app
+   The last call to GetNextApp should return RApaLsSession::ENoMoreAppsInList
+  
+ */
+void CT_Serv2Step::DoGetEmbeddableApps(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("DoGetEmbeddableApps"));
+
+	TInt ret = aLs.GetEmbeddableApps();
+	TEST(ret==KErrNone);
+
+	TApaAppInfo appInfo;
+	TUint bitFlags = 0;
+	while ((ret = aLs.GetNextApp(appInfo)) == KErrNone)
+		{
+		if (appInfo.iUid == KUidAppNotEmbeddable)
+			bitFlags |= 0x01;
+		else if (appInfo.iUid == KUidAppEmbeddable)
+			bitFlags |= 0x02;
+		else if (appInfo.iUid == KUidAppEmbeddableOnly)
+			bitFlags |= 0x04;
+		else if (appInfo.iUid == KUidAppEmbeddableUiOrStandAlone)
+			bitFlags |= 0x08;
+		else if (appInfo.iUid == KUidAppEmbeddableUiNotStandAlone)
+			bitFlags |= 0x10;
+		}
+	TEST(ret==RApaLsSession::ENoMoreAppsInList);
+	TEST(bitFlags == 0x06);
+	}
+
+/**
+   @SYMTestCaseID T-Serv2-DoEmbeddableAppCount
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   The number of apps returned by GetEmbeddableApps should be the
+   same as EmbeddableAppCount returns.
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Count the number of apps returned by calling GetEmbeddableApps
+   followed by repeated calls to GetNextApp.
+   Count the number of apps returned by EmbeddableAppCount.
+  
+   @SYMTestExpectedResults
+   The counts should be equal.
+   The last call to GetNextApp should return RApaLsSession::ENoMoreAppsInList
+  
+ */
+void CT_Serv2Step::DoEmbeddableAppCount(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("DoEmbeddableAppCount"));
+
+	TInt ret = aLs.GetEmbeddableApps();
+	TEST(ret==KErrNone);
+
+	TApaAppInfo appInfo;
+	TInt count1 = 0;
+	while ((ret = aLs.GetNextApp(appInfo)) == KErrNone)
+		{
+		count1 ++;
+		}
+	TEST(ret==RApaLsSession::ENoMoreAppsInList);
+
+	TInt count2 = 0;
+	ret = aLs.EmbeddableAppCount(count2);
+	TEST(ret==KErrNone);
+
+	TEST(count1 == count2);
+	}
+
+/**
+   @SYMTestCaseID T-Serv2-DoGetAppCapability
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   Confirm that the application embeddability value that a specific app
+   defines in it's AIF file, matches the value returned by
+   RApaLsSession::GetAppCapability.
+   Check that this is true for all supported embeddability values
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Call GetAppCapability for each of the following test apps:
+   TAppNotEmbeddable.app
+   TAppEmbeddable.app
+   TAppEmbeddableOnly.app
+   TAppEmbeddableUiOrStandAlone.app
+   TAppEmbeddableUiNotStandAlone.app
+  
+   @SYMTestExpectedResults
+   For each app, GetAppCapability should return the embeddability value
+   defined in the application's AIF file.
+  
+ */
+void CT_Serv2Step::DoGetAppCapability(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("DoGetAppCapability"));
+
+	TApaAppCapabilityBuf capabilityBuf;
+	TInt ret;
+	const TInt numberOfCapabilities = 5;
+	TUid uidArray[numberOfCapabilities];
+	uidArray[0] = KUidAppNotEmbeddable;
+	uidArray[1] = KUidAppEmbeddable;
+	uidArray[2] = KUidAppEmbeddableOnly;
+	uidArray[3] = KUidAppEmbeddableUiOrStandAlone;
+	uidArray[4] = KUidAppEmbeddableUiNotStandAlone;
+
+	const TApaAppCapability::TEmbeddability embeddabilityArray[numberOfCapabilities]
+		= { TApaAppCapability::ENotEmbeddable,
+			TApaAppCapability::EEmbeddable, 
+			TApaAppCapability::EEmbeddableOnly, 
+			TApaAppCapability::EEmbeddableUiOrStandAlone, 
+			TApaAppCapability::EEmbeddableUiNotStandAlone };
+
+	for (TInt ii = 0; ii < numberOfCapabilities; ii++)
+		{
+		ret = aLs.GetAppCapability(capabilityBuf, uidArray[ii]);
+		TEST(ret==KErrNone);
+		TEST(capabilityBuf().iEmbeddability == embeddabilityArray[ii]);
+		}
+	}
+
+/**
+   @SYMTestCaseID T-Serv2-DoGetFilteredApps1
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   Passing an empty filter to RApaLsSession::GetFilteredApps
+   should cause no apps to be returned by subsequent calls
+   to RApaLsSession::GetNextApp
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Call GetFilteredApps passing a default constructed filter,
+   followed by a single call to GetNextApp
+  
+   @SYMTestExpectedResults
+   GetNextApp should return RApaLsSession::ENoMoreAppsInList
+  
+ */
+void CT_Serv2Step::DoGetFilteredApps1(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("DoGetFilteredApps1"));
+
+	TApaEmbeddabilityFilter filter;
+	TInt ret = aLs.GetFilteredApps(filter);
+	TEST(ret==KErrNone);
+
+	TApaAppInfo appInfo;
+	TEST(aLs.GetNextApp(appInfo) == RApaLsSession::ENoMoreAppsInList);
+	}
+
+/**
+   @SYMTestCaseID T-Serv2-DoGetFilteredApps2
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   Passing a filter specifying only ENotEmbeddable
+   to RApaLsSession::GetFilteredApps should cause subsequent
+   calls to RApaLsSession::GetNextApp to return only
+   applications which cannot be embedded
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Call GetFilteredApps passing a filter containing ENotEmbeddable,
+   followed by repeated calls to GetNextApp until something other than
+   KErrNone is returned
+  
+   @SYMTestExpectedResults
+   GetNextApp should return app info for only the following test app:
+   TAppNotEmbeddable.app
+   and should not return app info for:
+   TAppEmbeddable.app
+   TAppEmbeddableOnly.app
+   TAppEmbeddableUiOrStandAlone.app
+   TAppEmbeddableUiNotStandAlone.app
+   The last call to GetNextApp should return RApaLsSession::ENoMoreAppsInList
+  
+ */
+void CT_Serv2Step::DoGetFilteredApps2(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("DoGetFilteredApps2"));
+
+	TApaEmbeddabilityFilter filter;
+	filter.AddEmbeddability(TApaAppCapability::ENotEmbeddable);
+	TInt ret = aLs.GetFilteredApps(filter);
+	TEST(ret==KErrNone);
+
+	TApaAppInfo appInfo;
+	TUint bitFlags = 0;
+	while ((ret = aLs.GetNextApp(appInfo)) == KErrNone)
+		{
+		if (appInfo.iUid == KUidAppNotEmbeddable)
+			bitFlags |= 0x01;
+		else if (appInfo.iUid == KUidAppEmbeddable)
+			bitFlags |= 0x02;
+		else if (appInfo.iUid == KUidAppEmbeddableOnly)
+			bitFlags |= 0x04;
+		else if (appInfo.iUid == KUidAppEmbeddableUiOrStandAlone)
+			bitFlags |= 0x08;
+		else if (appInfo.iUid == KUidAppEmbeddableUiNotStandAlone)
+			bitFlags |= 0x10;
+		}
+	TEST(ret==RApaLsSession::ENoMoreAppsInList);
+	TEST(bitFlags == 0x01);
+	}
+
+/**
+   @SYMTestCaseID T-Serv2-DoGetFilteredApps3
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   EEmbeddableUiOrStandAlone (value 5) shares a bit flag (bit 1)
+   with EEmbeddable (value 1).
+   Confirm that a filter of EEmbeddableUiOrStandAlone only returns
+   apps that define EEmbeddableUiOrStandAlone
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Call GetFilteredApps passing a filter containing EEmbeddableUiOrStandAlone,
+   followed by repeated calls to GetNextApp until something other than
+   KErrNone is returned
+  
+   @SYMTestExpectedResults
+   GetNextApp should return app info for only the following test app:
+   TAppEmbeddableUiOrStandAlone.app
+   and should not return app info for:
+   TAppEmbeddable.app
+   The last call to GetNextApp should return RApaLsSession::ENoMoreAppsInList
+  
+ */
+void CT_Serv2Step::DoGetFilteredApps3(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("DoGetFilteredApps3"));
+
+	TApaEmbeddabilityFilter filter;
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddableUiOrStandAlone);
+	TInt ret = aLs.GetFilteredApps(filter);
+	TEST(ret==KErrNone);
+
+	TApaAppInfo appInfo;
+	TUint bitFlags = 0;
+	while ((ret = aLs.GetNextApp(appInfo)) == KErrNone)
+		{
+		if (appInfo.iUid == KUidAppEmbeddable)
+			bitFlags |= 0x02;
+		else if (appInfo.iUid == KUidAppEmbeddableUiOrStandAlone)
+			bitFlags |= 0x08;
+		}
+	TEST(ret==RApaLsSession::ENoMoreAppsInList);
+	TEST(bitFlags == 0x08);
+	}
+
+/**
+   @SYMTestCaseID T-Serv2-DoGetFilteredApps4
+ 
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   A filter specifying two embeddability values should
+   include apps of either embeddability
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Call GetFilteredApps passing a filter containing EEmbeddableUiOrStandAlone
+   and EEmbeddableUiNotStandAlone followed by repeated calls to GetNextApp
+   until something other than KErrNone is returned
+  
+   @SYMTestExpectedResults
+   GetNextApp should return app info for only the following test apps:
+   TAppEmbeddableUiOrStandAlone.app
+   TAppEmbeddableUiNotStandAlone.app
+   and should not return app info for:
+   TAppNotEmbeddable.app
+   TAppEmbeddable.app
+   TAppEmbeddableOnly.app
+   The last call to GetNextApp should return RApaLsSession::ENoMoreAppsInList
+  
+ */
+void CT_Serv2Step::DoGetFilteredApps4(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("DoGetFilteredApps4"));
+
+	TApaEmbeddabilityFilter filter;
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddableUiOrStandAlone);
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddableUiNotStandAlone);
+	TInt ret = aLs.GetFilteredApps(filter);
+	TEST(ret==KErrNone);
+
+	TApaAppInfo appInfo;
+	TUint bitFlags = 0;
+	while ((ret = aLs.GetNextApp(appInfo)) == KErrNone)
+		{
+		if (appInfo.iUid == KUidAppNotEmbeddable)
+			bitFlags |= 0x01;
+		else if (appInfo.iUid == KUidAppEmbeddable)
+			bitFlags |= 0x02;
+		else if (appInfo.iUid == KUidAppEmbeddableOnly)
+			bitFlags |= 0x04;
+		else if (appInfo.iUid == KUidAppEmbeddableUiOrStandAlone)
+			bitFlags |= 0x08;
+		else if (appInfo.iUid == KUidAppEmbeddableUiNotStandAlone)
+			bitFlags |= 0x10;
+		}
+	TEST(ret==RApaLsSession::ENoMoreAppsInList);
+	TEST(bitFlags == 0x18);
+	}
+
+/**
+   @SYMTestCaseID T-Serv2-DoGetFilteredApps5
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   Getting apps using a filter specifying all embeddability values
+   should return the same number of apps as RApaLsSession::GetAllApps()
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Call GetFilteredApps passing a filter containing all embeddability values,
+   and count the number of calls to GetNextApp until something other than
+   KErrNone is returned.
+   Then call GetAllApps and count the number of calls to GetNextApp until
+   something other than KErrNone is returned.
+  
+   @SYMTestExpectedResults
+   The two counts should be equal.
+   The last call in each sequence of calls to GetNextApp should return
+   RApaLsSession::ENoMoreAppsInList
+  
+ */
+void CT_Serv2Step::DoGetFilteredApps5(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("DoGetFilteredApps5"));
+
+	TApaEmbeddabilityFilter filter;
+	filter.AddEmbeddability(TApaAppCapability::ENotEmbeddable);
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddable);
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddableOnly);
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddableUiOrStandAlone);
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddableUiNotStandAlone);
+	TInt ret = aLs.GetFilteredApps(filter);
+	TEST(ret==KErrNone);
+
+	TApaAppInfo appInfo;
+	TInt filteredCount = 0;
+	while ((ret = aLs.GetNextApp(appInfo)) == KErrNone)
+		{
+		filteredCount++;
+		}
+	TEST(ret==RApaLsSession::ENoMoreAppsInList);
+
+	ret = aLs.GetAllApps();
+	TEST(ret==KErrNone);
+
+	TInt allAppsCount = 0;
+	while ((ret = aLs.GetNextApp(appInfo)) == KErrNone)
+		{
+		allAppsCount++;
+		}
+	TEST(ret==RApaLsSession::ENoMoreAppsInList);
+
+	TEST(filteredCount == allAppsCount);
+	}
+
+/**
+   @SYMTestCaseID T-Serv2-DoGetFilteredApps6
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   None of the following embeddability test apps support
+   screen mode 1, so none of them should be returned even
+   if the filter specifies all embeddability types.
+   TAppNotEmbeddable.app
+   TAppEmbeddable.app
+   TAppEmbeddableOnly.app
+   TAppEmbeddableUiOrStandAlone.app
+   TAppEmbeddableUiNotStandAlone.app
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Call GetFilteredApps passing a filter containing all embeddability values
+   and screen mode 1, followed by repeated calls to GetNextApp until something
+   other than KErrNone is returned
+  
+   @SYMTestExpectedResults
+   GetNextApp should not return app info for any of the following test apps:
+   TAppNotEmbeddable.app
+   TAppEmbeddable.app
+   TAppEmbeddableOnly.app
+   TAppEmbeddableUiOrStandAlone.app
+   TAppEmbeddableUiNotStandAlone.app
+   The last call to GetNextApp should return RApaLsSession::ENoMoreAppsInList
+  
+ */
+void CT_Serv2Step::DoGetFilteredApps6(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("DoGetFilteredApps6"));
+
+	TApaEmbeddabilityFilter filter;
+	filter.AddEmbeddability(TApaAppCapability::ENotEmbeddable);
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddable);
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddableOnly);
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddableUiOrStandAlone);
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddableUiNotStandAlone);
+	const TInt screenMode1 = 1;
+	TInt ret = aLs.GetFilteredApps(filter, screenMode1);
+	TEST(ret==KErrNone);
+
+	TApaAppInfo appInfo;
+	TUint bitFlags = 0;
+	while ((ret = aLs.GetNextApp(appInfo)) == KErrNone)
+		{
+		if (appInfo.iUid == KUidAppNotEmbeddable)
+			bitFlags |= 0x01;
+		else if (appInfo.iUid == KUidAppEmbeddable)
+			bitFlags |= 0x02;
+		else if (appInfo.iUid == KUidAppEmbeddableOnly)
+			bitFlags |= 0x04;
+		else if (appInfo.iUid == KUidAppEmbeddableUiOrStandAlone)
+			bitFlags |= 0x08;
+		else if (appInfo.iUid == KUidAppEmbeddableUiNotStandAlone)
+			bitFlags |= 0x10;
+		}
+	TEST(ret==RApaLsSession::ENoMoreAppsInList);
+	TEST(bitFlags == 0);
+	}
+
+/**
+   @SYMTestCaseID T-Serv2-DoTestEmbeddabilityFilter1
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   Ensure default constructed TApaEmbeddabilityFilter object is
+   initialized correctly.
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Construct a TApaEmbeddabilityFilter object and call
+   MatchesEmbeddability using each of the following embeddability values:
+   TApaAppCapability::ENotEmbeddable
+   TApaAppCapability::EEmbeddable
+   TApaAppCapability::EEmbeddableOnly
+   TApaAppCapability::EEmbeddableUiOrStandAlone
+   TApaAppCapability::EEmbeddableUiNotStandAlone
+  
+   @SYMTestExpectedResults
+   All calls to MatchesEmbeddability should return false.
+  
+ */
+void CT_Serv2Step::DoTestEmbeddabilityFilter1()
+	{
+	INFO_PRINTF1(_L("DoTestEmbeddabilityFilter1"));
+
+	TApaEmbeddabilityFilter filter;
+	TEST(!filter.MatchesEmbeddability(TApaAppCapability::ENotEmbeddable));
+	TEST(!filter.MatchesEmbeddability(TApaAppCapability::EEmbeddable));
+	TEST(!filter.MatchesEmbeddability(TApaAppCapability::EEmbeddableOnly));
+	TEST(!filter.MatchesEmbeddability(TApaAppCapability::EEmbeddableUiOrStandAlone));
+	TEST(!filter.MatchesEmbeddability(TApaAppCapability::EEmbeddableUiNotStandAlone));
+	}
+
+/**
+   @SYMTestCaseID T-Serv2-DoTestEmbeddabilityFilter2
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   Bit 2 is used by both EEmbeddableUiNotStandAlone and EEmbeddableOnly.
+   Make sure that setting the filter to only EEmbeddableUiNotStandAlone
+   doesn't match EEmbeddableOnly.
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Construct a TApaEmbeddabilityFilter object,
+   set the filter to only EEmbeddableUiNotStandAloneand
+   and call MatchesEmbeddability passing EEmbeddableOnly
+  
+   @SYMTestExpectedResults
+   MatchesEmbeddability should return false.
+  
+ */
+void CT_Serv2Step::DoTestEmbeddabilityFilter2()
+	{
+	INFO_PRINTF1(_L("DoTestEmbeddabilityFilter2"));
+
+	TApaEmbeddabilityFilter filter;
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddableUiNotStandAlone);
+	TEST(!filter.MatchesEmbeddability(TApaAppCapability::EEmbeddableOnly));
+	}
+
+/**
+   @SYMTestCaseID T-Serv2-DoTestEmbeddabilityFilter3
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   Bit 2 is used by both EEmbeddableUiNotStandAlone and EEmbeddableOnly.
+   Make sure that setting the filter to only EEmbeddableOnly
+   doesn't match EEmbeddableUiNotStandAlone.
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Construct a TApaEmbeddabilityFilter object,
+   set the filter to only EEmbeddableOnly
+   and call MatchesEmbeddability passing EEmbeddableUiNotStandAlone
+  
+   @SYMTestExpectedResults
+   MatchesEmbeddability should return false.
+  
+ */
+void CT_Serv2Step::DoTestEmbeddabilityFilter3()
+	{
+	INFO_PRINTF1(_L("DoTestEmbeddabilityFilter3"));
+
+	TApaEmbeddabilityFilter filter;
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddableOnly);
+	TEST(!filter.MatchesEmbeddability(TApaAppCapability::EEmbeddableUiNotStandAlone));
+	}
+
+/**
+   @SYMTestCaseID T-Serv2-DoTestEmbeddabilityFilter4
+  
+   @SYMPREQ PHAR-5Q4FX8
+ 
+   @SYMTestCaseDesc
+   Ensure MatchesEmbeddability returns true when the filter only contains
+   the embeddability being matched.
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions
+   Construct a TApaEmbeddabilityFilter object,
+   set the filter to only EEmbeddable
+   and call MatchesEmbeddability passing EEmbeddable
+  
+   @SYMTestExpectedResults
+   MatchesEmbeddability should return true.
+  
+ */
+void CT_Serv2Step::DoTestEmbeddabilityFilter4()
+	{
+	INFO_PRINTF1(_L("DoTestEmbeddabilityFilter4"));
+
+	TApaEmbeddabilityFilter filter;
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddable);
+	TEST(filter.MatchesEmbeddability(TApaAppCapability::EEmbeddable));
+	}
+
+/**
+   @SYMTestCaseID T-Serv2-DoTestEmbeddabilityFilter5
+  
+   @SYMPREQ PHAR-5Q4FX8
+  
+   @SYMTestCaseDesc
+   Ensure MatchesEmbeddability returns true when the filter contains
+   a superset of the embeddability being matched.
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   Construct a TApaEmbeddabilityFilter object,
+   set the filter to both ENotEmbeddable and EEmbeddable
+   and call MatchesEmbeddability passing EEmbeddable
+  
+   @SYMTestExpectedResults
+   MatchesEmbeddability should return true.
+  
+ */
+void CT_Serv2Step::DoTestEmbeddabilityFilter5()
+	{
+	INFO_PRINTF1(_L("DoTestEmbeddabilityFilter5"));
+
+	TApaEmbeddabilityFilter filter;
+	filter.AddEmbeddability(TApaAppCapability::ENotEmbeddable);
+	filter.AddEmbeddability(TApaAppCapability::EEmbeddable);
+	TEST(filter.MatchesEmbeddability(TApaAppCapability::EEmbeddable));
+	}
+
+
+/**
+   @SYMTestCaseID T-Serv2Step-DoInterrogationTestsL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test interrogates the Application Architecture Server. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Test Application Architecture Server's ability to:\n
+   (1) Retrieve list of all applications in the cache list by calling 
+   RApaLsSession::GetAllApps().The test also calls RApaLsSession::AppCount()
+   to retrieve the number of applications in the list.\n
+   (2) Retrieve list of all embeddable applications from the cache list
+   by calling RApaLsSession::GetEmbeddableApps().The test also calls
+   RApaLsSession::EmbeddableAppCount() to retrieve the number of
+   embeddable applications in the list.\n
+   (3) Retrieve application information.\n
+   (4) Retrieve capability of an existing & non-existing application by
+   calling RApaLsSession::GetAppCapability().\n
+   (5) Check and retrieve Data (MIME) type information of data taken from a
+   specified file by calling RApaLsSession::RecognizeSpecificData().
+   This is confirmed by taking data from the same file and checking
+   the data type information by calling RApaLsSession::RecognizeData().\n
+   (6) Retrieve application icon by calling RApaLsSession::GetAppIcon().\n
+   API Calls:\n	
+   RApaLsSession::GetAllApps() const\n
+   RApaLsSession::AppCount(TInt& aCount) const\n
+   RApaLsSession::EmbeddableAppCount(TInt& aCount) const\n
+   RApaLsSession::GetEmbeddableApps() const\n
+   RApaLsSession::GetAppCapability(TDes8& aCapabilityBuf,TUid aAppUid) const\n
+   RApaLsSession::RecognizeSpecificData(const TDesC& aName, const TDesC8& aBuffer, const TDataType& aDataType, TBool& aResult) const\n
+   RApaLsSession::RecognizeData(const TDesC& aName, const TDesC8& aBuffer, TDataRecognitionResult& aDataType) const\n
+   RApaLsSession::GetAppIcon(TUid aAppUid, TInt aSize, CApaMaskedBitmap& aAppBitmap) const\n
+   
+   @SYMTestExpectedResults All tests compare the results obtained with the desired result.
+    
+ */
+void CT_Serv2Step::DoInterrogationTestsL(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("Interogating the server"));
+
+	TInt ret = aLs.GetAllApps(); // SC - test
+	TEST(ret==KErrNone);
+
+	// get the full app count
+	TInt count=0;
+	ret = aLs.AppCount(count);
+	TEST(ret==KErrNone);
+	TEST(count>=1);
+
+	// get the embedded app count
+	count=0;
+	ret = aLs.EmbeddableAppCount(count);
+	TEST(ret==KErrNone);
+	TEST(count>=1);
+
+	// prepare to get a list of embeddable apps
+	ret = aLs.GetEmbeddableApps();
+	TEST(ret==KErrNone);
+	DoAppInfoTests(aLs);
+
+	// Get the capability of an app that exists
+	TApaAppCapabilityBuf buf;
+	ret = aLs.GetAppCapability(buf, KUidTestApp);
+	TEST(ret==KErrNone);
+	TApaAppCapability cap=buf();
+	TEST(cap.iEmbeddability==TApaAppCapability::EEmbeddable);
+	TEST(!cap.iSupportsNewFile);
+	TEST(!cap.iAppIsHidden);
+
+	// get the capability of a non-existant app
+	ret = aLs.GetAppCapability(buf, KNullUid);
+	TEST(ret==KErrNotFound);
+
+	INFO_PRINTF1(_L("Checking data type information"));
+	TBool isText;
+	ret=aLs.RecognizeSpecificData(_L("a file name.txt"),_L8("Some plain text"),TDataType(_L8("text/plain")),isText);
+	TEST(ret==KErrNone);
+	TEST(isText);
+	TDataRecognitionResult result;
+	ret=aLs.RecognizeData(_L("a file name.txt"),_L8("Some plain text"),result);
+	TEST(ret==KErrNone);
+	TEST(result.iDataType==TDataType(_L8("text/plain")));
+	TEST(result.iConfidence==CApaDataRecognizerType::EProbable);
+	isText=EFalse;
+	ret=aLs.RecognizeSpecificData(_L("a file name.txt"),_L8("Some plain text"),TDataType(_L8("foo/bar")),isText);
+	TEST(!isText);
+
+	INFO_PRINTF1(_L("Checking icon loading by index"));
+	CApaMaskedBitmap* icon=CApaMaskedBitmap::NewLC();
+
+	TSize lastSize(0,0);
+	ret=aLs.GetAppIcon(KUidTestApp,0,*icon);
+	TEST(ret==KErrNone);
+	TEST(icon->SizeInPixels().iWidth*icon->SizeInPixels().iHeight > lastSize.iWidth*lastSize.iHeight);
+	lastSize=icon->SizeInPixels();
+		
+	ret=aLs.GetAppIcon(KUidTestApp,1,*icon);
+	TEST(ret==KErrNone);
+
+	TEST(icon->SizeInPixels().iWidth*icon->SizeInPixels().iHeight == lastSize.iWidth*lastSize.iHeight);
+	lastSize=icon->SizeInPixels();
+
+	ret=aLs.GetAppIcon(KUidTestApp,2,*icon);
+	TEST(ret==KErrNone);
+	TEST((icon->SizeInPixels().iWidth*icon->SizeInPixels().iHeight) > (lastSize.iWidth*lastSize.iHeight));
+	lastSize=icon->SizeInPixels();
+
+
+	TUid uid={9999};
+	ret=aLs.GetAppIcon(uid,0,*icon);
+	TEST(ret==KErrNotFound);
+	CleanupStack::PopAndDestroy(icon);
+	}
+
+
+/**
+   @SYMTestCaseID T-Serv2Step-DoInstallationTestL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test updating of Application list on installation of a new application. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Test updating of application list on installation of a new
+   application. Copy the tstapp from z: drive to c: drive. Call RApaLsSession::GetAppInfo()
+   and test the application information obtained to verify whether the
+   application architecture server updates the application to reside in c: drive.
+   Delete the copied application and call RApaLsSession::GetAppInfo().
+   Verify that the application list updates the tstapp application to reside
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::GetAppInfo(TApaAppInfo& aInfo,TUid aAppUid) const\n
+   
+   @SYMTestExpectedResults The test confirms that the application architecture
+   server updates the application list on installation of a new application.
+    
+ */
+void CT_Serv2Step::DoInstallationTestL (RApaLsSession ls)
+ 	{
+ 	_LIT(KTestAppDestDir, "C:\\private\\10003a3f\\import\\apps\\" );
+ 	_LIT(KTestAppSource, "Z:\\private\\10003a3f\\import\\apps\\tstapp_reg.rsc" );
+ 	_LIT(KTestAppDest, "C:\\private\\10003a3f\\import\\apps\\tstapp_reg.rsc" );
+
+ 	_LIT(KTestWaitingForApplistUpdate,"\nWaiting %d microseconds for applist to be updated");
+ 	const TInt KApplistUpdateTime = 8000000;
+
+ 	// Copy App files around and delete them to check whether 
+	// the app list updates and stores the cache correctly.
+ 	RFs	theFs;
+ 	theFs.Connect();
+ 
+ 	// Remove Test app from the file system
+ 	CFileMan* fileManager = CFileMan::NewL (theFs);
+ 
+ 	INFO_PRINTF1(_L("Copying the app to C"));
+ 	TEST(KErrNone == fileManager->Copy (KTestAppSource, KTestAppDest, CFileMan::ERecurse));
+ 	
+ 	INFO_PRINTF2(KTestWaitingForApplistUpdate, KApplistUpdateTime);
+ 	User::After(KApplistUpdateTime);
+ 
+ 	TApaAppInfo aInfo;
+ 	TEST(KErrNone == ls.GetAppInfo (aInfo, KUidTestApp));
+
+	TParsePtrC parse (aInfo.iFullName);
+ 	_LIT (KCdrive, "C:");
+	INFO_PRINTF1(_L("Comparing App drive location is C:... "));
+	TEST(parse.Drive ().CompareF (KCdrive) == 0);
+ 
+ 	INFO_PRINTF1(_L("Removing the app from C"));
+	TTime tempTime(0);
+	fileManager->Attribs(KTestAppDest,0,KEntryAttReadOnly, tempTime, CFileMan::ERecurse);
+ 	TEST(KErrNone == fileManager->Delete (KTestAppDest, CFileMan::ERecurse));
+	INFO_PRINTF1(_L("Removing the app dir from C"));
+	TEST(fileManager->RmDir(KTestAppDestDir)==KErrNone);
+ 	
+	INFO_PRINTF2(KTestWaitingForApplistUpdate, KApplistUpdateTime);
+	User::After(KApplistUpdateTime);
+ 
+ 	// That should put the file in the right place
+ 	TEST(KErrNone == ls.GetAppInfo( aInfo, KUidTestApp));
+
+ 	TParsePtrC parse1 (aInfo.iFullName);
+ 	_LIT (KZdrive, "Z:");
+	INFO_PRINTF1(_L("Comparing App drive location is Z:... "));
+ 	TEST((parse1.Drive().CompareF(KZdrive)) == 0);
+ 	
+ 	delete fileManager;
+ 	theFs.Close();
+ }
+
+//
+// Tests the new RApaLsSession::NumberOfOwnDefinedIcons function
+// See TeamTrack 'DEF037571 - Provide a better alternative to CApaAppInfoFileReader::NumberOfBitmaps'
+//
+void CT_Serv2Step::DoNumDefIconsTestL(RApaLsSession& aSession)
+	{
+	INFO_PRINTF1(_L("Testing RApaLsSession::NumberOfOwnDefinedIcons"));
+	TInt err = KErrNone;
+
+	CArrayFixFlat<TSize>* array = new(ELeave) CArrayFixFlat<TSize>(4);
+	CleanupStack::PushL(array);
+
+	// Test the GetAppIconSizes function, check 3 icons are returned (default icons)
+	INFO_PRINTF1(_L("Testing GetAppIconSizes"));
+	TUid appUid;
+	appUid.iUid = 0x12008ACE;	// SimpleApparcTestApp UID
+	err = aSession.GetAppIconSizes(appUid, *array);
+	TEST(err == KErrNone);
+	TEST(array->Count() == 3);
+
+	// Test the NumberOfOwnDefinedIcons function, check count is zero (no own defined icons)
+	INFO_PRINTF1(_L("Testing NumberOfOwnDefinedIcons (SimpleApparcTestApp)"));
+	TInt iconCount = -1;
+	err = aSession.NumberOfOwnDefinedIcons(appUid, iconCount);
+	TEST(err == KErrNone);
+	TEST(iconCount == 0);
+
+	// Test NumberOfOwnDefinedIcons again, this time with Contacts app UID (icons defined)
+	INFO_PRINTF1(_L("Testing NumberOfOwnDefinedIcons (Contacts app)"));
+	iconCount = -1;
+	appUid.iUid = 0x10003a74;	// Contacts app UID
+
+	err = aSession.NumberOfOwnDefinedIcons(appUid, iconCount);
+	TEST(err == KErrNone);
+	TEST(iconCount == 3);
+
+	INFO_PRINTF1(_L("NumberOfOwnDefinedIcons test complete"));
+
+	CleanupStack::PopAndDestroy(array);
+	}
+
+/** Test RecognizeData() */	
+void CT_Serv2Step::DoRecognizeDataL(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("Testing RApaLsSession::RecognizeData"));
+	
+	_LIT(KExistingFile, "Z:\\ApparcTest\\apparctest_t_Serv2.script");
+	_LIT(KNonExistingFile, "x:\\non-existing directory\\non-existing file.any");
+	_LIT(KWeirdFileName, "\\c:\\  : weird...txt");
+	_LIT8(KFileContents, "just some random noice, we don't really care about the result");
+	_LIT8(KTextPlainMimeType, "text/plain");
+	
+	RFs fs;
+	TEST(KErrNone == fs.Connect());
+	CleanupClosePushL(fs);
+	
+	// make sure KExistingFile really exists and that KNonExistingFile doesn't
+	TTime modificationTime;
+	TEST(KErrNone == fs.Modified(KExistingFile, modificationTime));
+	TEST(KErrNone != fs.Modified(KNonExistingFile, modificationTime));
+
+	// test with existing file (result will be cached)
+	TDataRecognitionResult recData;
+	TEST(KErrNone == aLs.RecognizeData(KExistingFile, KFileContents, recData));
+	TEST(0 ==        recData.iDataType.Des8().Compare(KTextPlainMimeType));
+	
+	// test to get result from the cache (not possible to know if we succeed though)
+	TEST(KErrNone == aLs.RecognizeData(KExistingFile, KFileContents, recData));
+	TEST(0 ==        recData.iDataType.Des8().Compare(KTextPlainMimeType));
+	
+	//test with non-existing file (result won't be cached)	
+	TEST(KErrNone == aLs.RecognizeData(KNonExistingFile, KFileContents, recData));
+	TEST(0 ==        recData.iDataType.Des8().Compare(KTextPlainMimeType));
+	
+	//test with empty file name (result won't be cached)
+	TEST(KErrNone == aLs.RecognizeData(KNullDesC, KFileContents, recData));
+	TEST(0 ==        recData.iDataType.Des8().Compare(KTextPlainMimeType));
+
+	//test with weird file name (result won't be cached)
+	TEST(KErrNone == aLs.RecognizeData(KWeirdFileName, KFileContents, recData));
+	TEST(0 ==        recData.iDataType.Des8().Compare(KTextPlainMimeType));
+	
+	CleanupStack::PopAndDestroy(&fs);
+	}
+
+/**
+   @SYMTestCaseID APPFWK-APPARC-0074
+  
+   @SYMDEF DEF099084: Apparc server's MIME type recognition cache can become out of date   
+  
+   @SYMTestCaseDesc Test checks whether the MIME type recognition cache maintained by apparc server is
+					flushed when it receives the ECom change notification., i.e., either when a new ecom plugin is installed 
+					or an existing ecom plugin is uninstalled.
+   
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Calls RecognizeData() to test the MIME type returned, 
+   when
+   1. When there is no existing "mime/mmr1" recognizer installed.
+   2. "mime/mmr1" recognizer with EPossible confidence is installed.
+   3. "mime/mmr1" recognizer is uninstalled.
+   It tests whether the mime type recognition cache maintained by the apparc server gets flushed
+   when any new ecom plugin is installed or when an existing ecom plugin is uninstalled.
+   
+   @SYMTestExpectedResults RecognizeData() returns CApaDataRecognizerType::ENotRecognized when "mime/mmr1" recognizer is not
+   installed.  RecognizeData() returns CApaDataRecognizerType::EPossible when "mime/mmr1" recognizer with EPossible confidence is installed.
+   RecognizeData() returns CApaDataRecognizerType::ENotRecognized when "mime/mmr1" recognizer with EPossible confidence is uninstalled.
+ */
+ 
+void CT_Serv2Step::TestRecognitionCacheL(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("Testing fix for DEF099084: Apparc server's MIME type recognition cache can become out of date "));
+	INFO_PRINTF1(_L("Testing MIME type recognition cache ..."));
+
+	_LIT(KLitDocPath, "Z:\\system\\data\\TApsRecogAppTest.mmr");
+	_LIT8(KMimeMmrType,"mime/mmr1");
+
+	TDataRecognitionResult recogResult;
+	TBuf8<255> buffer;
+	buffer.FillZ(255);
+	recogResult.Reset();
+		
+	// Since recognizer for "mime\mmr1" mime type is not yet installed, call to RecognizeData()
+	// returns CApaDataRecognizerType::ENotRecognized.
+	INFO_PRINTF1(_L("MIME type recognition cache is not used..."));
+	User::LeaveIfError(aLs.RecognizeData(KLitDocPath, buffer, recogResult));
+	TEST(recogResult.iConfidence == CApaDataRecognizerType::ENotRecognized);
+
+	INFO_PRINTF1(_L("Installs new mime/mmr1 recognizer plugin file "));
+	RSmlTestUtils fs;
+	CleanupClosePushL(fs);
+	User::LeaveIfError(fs.Connect());
+	
+	// Ensure c:\\resource\\plugins is created, otherwise leave from this teststep
+	_LIT(KRecogRscTargetDir,"C:\\resource\\plugins\\");
+	TInt err = fs.CreateDirectoryL(KRecogRscTargetDir);
+	TESTEL((err == KErrNone || err == KErrAlreadyExists), err);
+	
+	// Ensure c:\\sys\\bin is created, otherwise leave from this teststep
+	_LIT(KDllRecogTargetDir,"C:\\sys\\bin\\");
+	err = fs.CreateDirectoryL(KDllRecogTargetDir);
+	TESTEL((err == KErrNone || err == KErrAlreadyExists), err);
+
+	// Copy recmime_1.rsc from z:\\ to c:\\resource\\plugins, to trigger the rescan for plugins.
+	_LIT(KRecogRscSourcePath, "Z:\\system\\data\\recmime_1.rsc");
+	_LIT(KRecogRscTargetPath,"C:\\resource\\plugins\\recmime_1.rsc");
+
+	err = fs.CopyFileL(KRecogRscSourcePath, KRecogRscTargetPath);
+	TEST(err == KErrNone);
+
+	// Copy recmime_*.dll from z:\\ to c:\\sys\\bin.
+	_LIT(KRecogDllTargetPath, "C:\\sys\\bin\\recmime_1.dll");
+
+	#ifdef __WINS__ 
+		_LIT(KRecogDllSourcePathWinscw, "Z:\\system\\data\\recmime_winscw.dll");
+		err = fs.CopyFileL(KRecogDllSourcePathWinscw, KRecogDllTargetPath);
+	#else
+		_LIT(KRecogDllSourcePathArmv5, "Z:\\system\\data\\recmime_armv5.dll");
+		err = fs.CopyFileL(KRecogDllSourcePathArmv5, KRecogDllTargetPath);
+	#endif
+	TEST(err == KErrNone);
+
+	INFO_PRINTF2(_L("Waits %d seconds for new mime/mmr1 recognizer with EPossible confidence to be installed."), (4 * KOneSecondDelay)/1000000);	
+	User::After(4 * KOneSecondDelay);
+	
+	// Without fix for DEF099084: Apparc server's MIME type recognition cache can become out of date 
+	// RApaLsSession::RecognizeData() would return CApaDataRecognizerType::ENotRecognized (ie., Mime Recognition cache
+	// would not have been flushed when new recognizer is installed).
+	INFO_PRINTF1(_L("MIME type recognition cache is flushed when a new recogizer is installed"));
+	recogResult.Reset();
+	User::LeaveIfError(aLs.RecognizeData(KLitDocPath, buffer, recogResult));
+	TEST(recogResult.iDataType.Des8().CompareF(KMimeMmrType) == 0);
+	TEST(recogResult.iConfidence == CApaDataRecognizerType::EPossible);
+		
+	// Second call to RecognizeData() utilizes the Mime type Recognition cache.
+	INFO_PRINTF1(_L("MIME type recognition cache is used..."));
+	recogResult.Reset();
+	User::LeaveIfError(aLs.RecognizeData(KLitDocPath, buffer, recogResult));
+	TEST(recogResult.iDataType.Des8().CompareF(KMimeMmrType) == 0);
+	TEST(recogResult.iConfidence == CApaDataRecognizerType::EPossible);
+	
+	// Delete the plugin resource file of the recognizer with EPossible confidence which was installed during the test from z:.
+	TInt fileExists = EFalse;
+	fs.IsFilePresent(KRecogRscTargetPath, fileExists);
+	if (fileExists)
+		{
+		fs.ChangeFilePermissionL(KRecogRscTargetPath); // clear readonly attribute inherited from z:
+		err = fs.DeleteFileL(KRecogRscTargetPath);
+		if(err == KErrNone) 
+			INFO_PRINTF1(_L("Removed temporary file recmime_1.rsc"));
+		else 
+			INFO_PRINTF1(_L("Failed to remove temporary file recmime_1.rsc"));	
+		}
+
+	INFO_PRINTF2(_L("Waits %d seconds for the data recognizer list maintained by EMIME to be updated"), (10 * KOneSecondDelay)/1000000);	
+ 	User::After(10 * KOneSecondDelay);
+	
+	// Since "mime/mmr1" recognizer is uninstalled, mime/mmr1 mime type is not recognized. 
+	INFO_PRINTF1(_L("MIME type recognition cache is flushed when a existing recogizer is uninstalled"));
+	recogResult.Reset();
+	User::LeaveIfError(aLs.RecognizeData(KLitDocPath, buffer, recogResult));
+	TEST(recogResult.iConfidence == CApaDataRecognizerType::ENotRecognized);
+	
+	CleanupStack::PopAndDestroy(&fs);
+	}
+
+/**
+  Auxiliary Fn for the entire Test Step
+ 
+  This method initiates all the tests.
+*/
+TInt CT_Serv2Step::DoServComTestL()
+	{
+	INFO_PRINTF1(_L("Testing Server Com"));
+	
+	
+	RFs theServFs;
+	TInt ret = theServFs.Connect();
+	TEST(ret==KErrNone);
+	CleanupClosePushL(theServFs);
+
+	// Connect to the server
+    RTestableApaLsSession ls;
+	ret = ls.ConnectWithoutWaitingForListPopulation();
+	TEST(ret==KErrNone);
+	CleanupClosePushL(ls);
+	
+	
+	INFO_PRINTF1(_L("Waiting applist to be generated.\n"));
+	TRequestStatus requeststatus;
+	ls.RegisterListPopulationCompleteObserver(requeststatus);
+	
+	//Testing the CancelListPopulationCompleteObserver
+	TEST(ls.CancelListPopulationCompleteObserver() == KErrNone);
+	User::WaitForRequest(requeststatus); 
+
+	ls.RegisterListPopulationCompleteObserver(requeststatus);
+	User::WaitForRequest(requeststatus);
+	TEST(requeststatus == KErrNone);
+
+	//make sure the RFbsSession doesn't have to allocate buffer since it would change the heap
+	CFbsBitmap* bufferAllocator = new(ELeave) CFbsBitmap;
+	CleanupStack::PushL(bufferAllocator);
+	TEST(bufferAllocator->Create(TSize(200,1), EColor16M) == KErrNone);
+	CleanupStack::PopAndDestroy(bufferAllocator);
+	
+	//
+	HEAP_TEST_LS_SESSION(ls, 0, DONT_CHECK, DoInterrogationTestsL(ls), ls.ClearAppInfoArray(); ls.FlushRecognitionCache(); );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoGetAllApps(ls), ls.ClearAppInfoArray() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoGetEmbeddableApps(ls), ls.ClearAppInfoArray() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoEmbeddableAppCount(ls), ls.ClearAppInfoArray() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoGetAppCapability(ls), ls.ClearAppInfoArray() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoGetFilteredApps1(ls), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoGetFilteredApps2(ls), ls.ClearAppInfoArray() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoGetFilteredApps3(ls), ls.ClearAppInfoArray() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoGetFilteredApps4(ls), ls.ClearAppInfoArray() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoGetFilteredApps5(ls), ls.ClearAppInfoArray() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoGetFilteredApps6(ls), ls.ClearAppInfoArray() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoTestEmbeddabilityFilter1(), ls.ClearAppInfoArray() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoTestEmbeddabilityFilter2(), ls.ClearAppInfoArray() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoTestEmbeddabilityFilter3(), ls.ClearAppInfoArray() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoTestEmbeddabilityFilter4(), ls.ClearAppInfoArray() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoTestEmbeddabilityFilter5(), ls.ClearAppInfoArray() );
+	//DONT_CHECK due to file system changes
+	HEAP_TEST_LS_SESSION(ls, 0, DONT_CHECK, TestRecognitionCacheL(ls), ls.FlushRecognitionCache());
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoRecognizeDataL(ls), ls.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, LaunchAppThruCreateDocL(ls), ls.FlushRecognitionCache() );
+
+
+	INFO_PRINTF1(_L("Checking icon loading by size - including OOM tests\n"));
+	ret = KErrNoMemory;
+	for(TInt fail=0; ret == KErrNoMemory; fail++)
+		{
+		__UHEAP_FAILNEXT(fail);
+		__UHEAP_MARK;
+		TRAP(ret, DoCheckServerIconLoadingBySizeL(ls));
+		__UHEAP_SETFAIL(RHeap::ENone,0);// turn failure off
+		__UHEAP_MARKEND;
+		TEST((ret==KErrNoMemory || ret==KErrNone));
+		}
+
+	//DONT_CHECK due to app is started and that app opens up another RApaLsSession (which changes the server's heap)
+	HEAP_TEST_LS_SESSION(ls, 0, DONT_CHECK, DoStartAppTestsL(ls), ls.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoEnquiryTestsL(ls), NO_CLEANUP);
+	//DONT_CHECK due to changes to file system
+	HEAP_TEST_LS_SESSION(ls, 0, DONT_CHECK, DoInstallationTestL(ls), ls.ClearAppInfoArray() );
+	HEAP_TEST_LS_SESSION(ls, 0, DONT_CHECK, DoNumDefIconsTestL(ls), ls.ClearAppInfoArray() );
+	
+	//
+	// close the server session and we have done some type store reloading
+	CleanupStack::PopAndDestroy(2, &theServFs);
+
+	return KErrNone;
+	}
+
+CT_Serv2Step::~CT_Serv2Step()
+/**
+   Destructor
+ */
+	{
+	}
+
+CT_Serv2Step::CT_Serv2Step()
+/**
+   Constructor
+ */
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_Serv2Step);
+	}
+
+TVerdict CT_Serv2Step::doTestStepPreambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	SetTestStepResult(EPass);
+	return TestStepResult();
+	}
+
+TVerdict CT_Serv2Step::doTestStepPostambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	return TestStepResult();
+	}
+
+TVerdict CT_Serv2Step::doTestStepL()
+/**
+   Override of base class virtual.
+   @return - TVerdict code
+ */
+{
+	FbsStartup();
+	TInt ret = RFbsSession::Connect();
+	TEST(ret==KErrNone);
+
+	// set up the directory structure
+	RFs theFs;
+	ret = theFs.Connect();
+	TEST(ret==KErrNone);
+	CleanupClosePushL(theFs);
+	
+	// run the testcode (inside an alloc heaven harness)
+	INFO_PRINTF1(_L("About to test server in process"));
+	TRAP(ret,DoServComTestL());
+	INFO_PRINTF2(_L("  DoServComTestL completes with %d"), ret);
+	TEST(ret==KErrNone);
+
+	// Cleanup
+	CleanupStack::PopAndDestroy(&theFs);
+
+	INFO_PRINTF1(_L("Test Completed!"));	
+	return TestStepResult();
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_Serv2Step.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,79 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#if (!defined __T_SERV2_STEP_H__)
+#define __T_SERV2_STEP_H__
+
+#include "ApparcTestServer.h"
+
+//!  A CT_Serv2Step test class. 
+
+/**  This class tests wrapper to Application Architecture Server. */
+
+class CT_Serv2Step :public CTestStep
+	{
+public:
+	CT_Serv2Step();
+	~CT_Serv2Step();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+//private:
+	void DoInterrogationTestsL(RApaLsSession& aLs);
+	void DoEnquiryTestsL(RApaLsSession& aLs);
+	void DoStartAppTestsL(RApaLsSession& aLs);
+	void StartAppTests1L(RApaLsSession& aLs);
+    void StartAppTests4L(RApaLsSession& aLs);
+	void DoAppInfoTests(RApaLsSession& aLs);
+	void AppInfoTest1(RApaLsSession& aLs);
+	void AppInfoTest3(RApaLsSession& aLs);
+	void AppInfoTest4(RApaLsSession& aLs);
+	void AppInfoTest5(RApaLsSession& aLs);
+	void DoInstallationTestL (RApaLsSession ls);
+	void DoNumDefIconsTestL(RApaLsSession& aSession);
+	void DoCheckServerIconLoadingBySizeL(RApaLsSession& aLs);
+	void LaunchAppThruCreateDocL(RApaLsSession& aLs);
+	TFileName SearchAndReturnCompleteFileName(const TDesC& aFileName);
+	TBool ComparePaths(const TDesC& aFilename, const TDesC& aPath);
+	TInt DoServComTestL();
+
+	void DoGetAllApps(RApaLsSession& aLs);
+	void DoGetEmbeddableApps(RApaLsSession& aLs);
+	void DoEmbeddableAppCount(RApaLsSession& aLs);
+	void DoGetAppCapability(RApaLsSession& aLs);
+	void DoGetFilteredApps1(RApaLsSession& aLs);
+	void DoGetFilteredApps2(RApaLsSession& aLs);
+	void DoGetFilteredApps3(RApaLsSession& aLs);
+	void DoGetFilteredApps4(RApaLsSession& aLs);
+	void DoGetFilteredApps5(RApaLsSession& aLs);
+	void DoGetFilteredApps6(RApaLsSession& aLs);
+	void DoTestEmbeddabilityFilter1();
+	void DoTestEmbeddabilityFilter2();
+	void DoTestEmbeddabilityFilter3();
+	void DoTestEmbeddabilityFilter4();
+	void DoTestEmbeddabilityFilter5();
+	void DoRecognizeDataL(RApaLsSession& aLs);
+	void TestRecognitionCacheL(RApaLsSession& aLs);
+	};
+
+_LIT(KT_Serv2Step,"T_Serv2");
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_Serv3Step.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1949 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Test wrapper to Application Architecture Server.
+// Tests Application information, Data recognition and application
+// launching capabilities of the application architecture server.\n
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+ 
+#include <f32file.h>
+#include <fbs.h>
+#include <apaid.h>
+#include <apgaplst.h>
+#include <apaflrec.h>
+#include "testableapalssession.h"
+#include <apacmdln.h>
+#include <apsserv.h>
+#include <apfrec.h>
+#include <datastor.h>
+#include <apgicnfl.h>
+#include <apasvst.h>
+#include "tstapp.h"
+//
+#include <e32test.h>
+#include "T_Serv3Step.h"
+
+#include <coemain.h>
+#include <eikenv.h>
+#include "TAppEmbedUids.h"
+#include "appfwk_test_utils.h"
+
+
+//Literals for directory and file naming
+_LIT(KMimeDir,"c:\\system\\data\\Mimepath\\");
+_LIT(KMimeFile,"c:\\system\\data\\Mimepath\\mime_content");
+_LIT(KEmptyDir,"c:\\system\\data\\Testpath\\Empty\\");
+_LIT8(KTextContent, "Never hit your mother with a shovel.\
+                     It leaves a dark impression on her mind.");
+_LIT(KSuffixText, ".txt");
+_LIT(KSuffixHtml, ".html");
+_LIT8(KHtmlContent, "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0\
+                     Transitional//EN'><HTML><HEAD><TITLE>SYMBIAN Centre\
+                      - 5 Day Forecast for London, United Kingdom</TITLE>\
+                      <META http-equiv=Content-Type content=text/html;\
+                      charset=iso-8859-1><META content='Symbian Five Day Forecast'\
+                      name=type><META content='The Symbian five day forecast'\
+                      name=description>");
+_LIT(KSuffixUnknown, ".canyoutell");
+
+const TInt KFixedNumWidth = 3;
+
+CT_Serv3Step::~CT_Serv3Step()
+/**
+ * Destructor
+ */
+	{
+	delete iActiveScheduler;
+	}
+
+CT_Serv3Step::CT_Serv3Step()
+/**
+ * Constructor
+ */
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_Serv3Step);
+
+	//Set up active scheduler
+	iActiveScheduler= new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(iActiveScheduler);
+	}
+
+/**
+ @SYMTestCaseID T_Serv3Step_DoSyncRecognizerTest1L
+
+ @SYMPREQ 699
+
+ @SYMREQ  3897
+
+ @SYMTestCaseDesc Test PREQ699.1.0 Validate Synchronous RecognizeFilesL function and CDataRecognitionResultArray\n
+
+ @SYMTestPriority High
+
+ @SYMTestStatus Implemented
+
+ @SYMTestActions. Calls RecognizeFilesL() with a folder containing two files of zero and one byte sizes. Validates
+ the returned number of files and file types. Tests CDataRecognitionResultArray by using the object.
+ API Calls:\n
+ RApaLsSession::RecognizeFilesL(const TDesC& aPath, CDataRecognitionResultArray& aResult);\n
+ CDataRecognitionResultArray::CDataRecognitionResultArray();
+ CDataRecognitionResultArray::Count() const;\n
+ CDataRecognitionResultArray::const TFileName& Path() const\n
+ CDataRecognitionResultArray::GetDataRecognitionResultL(TDataRecognitionResult& aResult, const TUint aIndex) const;\n
+ CDataRecognitionResultArray::GetFileNameL(TFileName& aFileName, const TUint aIndex) const\n
+
+ @SYMTestExpectedResults KErrNone and CDataRecognitionResultArray returned containing two entries, of MIME type "text/plain" \n
+
+ */
+void CT_Serv3Step::DoSyncFolderRecognizerTest1L(RApaLsSession& aLs)
+	{
+	//Synchronous Folder File Recognition Test Group 1
+
+	_LIT(KStandardDir,"z:\\system\\data\\Testpath\\");
+
+ 	// Copy App files around and delete them to check whether
+	// the app list updates and stores the cache correctly.
+	CDataRecognitionResultArray* result = new(ELeave) CDataRecognitionResultArray();
+	CleanupStack::PushL(result);
+
+	INFO_PRINTF1(_L("Synchronous Folder File Recognition Test PREQ699.1.0"));
+	TInt ret=aLs.RecognizeFilesL(KStandardDir,*result);
+	TEST(ret==KErrNone);
+	User::LeaveIfError(ret);
+
+	// Test the CDataRecognitionResultArray	object
+	TFileName path = result->Path(); 	//test: CDataRecognitionResultArray::Path()
+	TFullName standardDir(KStandardDir);
+	//Test the path created is correct
+	TEST(path==standardDir);
+
+	TUint count = result->Count(); //test: CDataRecognitionResultArray::Count()
+	TEST(count==2); //two files in directory
+
+	//get each result from the test directory. Check the MIME values against their known types
+	for(TUint i=0; i<count;i++)
+		{
+		//test: CDataRecognitionResultArray::GetDataRecognitionResultL
+		TDataRecognitionResult res;
+		result->GetDataRecognitionResultL(res, i);
+		//test: correct MIME type is returned - "text/plain"
+		TEST(res.iDataType.Des8().Compare(TDataType(_L8("text/plain")).Des8()) == 0);
+		
+		//test: CDataRecognitionResultArray::GetFileNameL
+		TFileName fileName;
+		result->GetFileNameL(fileName, i);
+		TEST(fileName.Compare( (i==0 ? _L("file1.txt") : _L("file2.txt")) ) == 0);	
+   		}
+
+   	// Cleanup
+	CleanupStack::PopAndDestroy(result);//result
+ }
+
+ /**
+ @SYMTestCaseID T_Serv3Step_DoSyncRecognizerTest2L
+
+ @SYMPREQ 699
+
+ @SYMREQ  3899
+
+ @SYMTestCaseDesc Test PREQ699.2.0 and PREQ699.2.1  Validate Synchronous RecognizeFilesL function for error handling.\n
+
+ @SYMTestStatus Implemented
+
+ @SYMTestPriority High
+
+ @SYMTestActions. Test 2.0 Calls RecognizeFilesL() (without a data filter then with a data filter) using an unknown folder path.
+				Checks returned value is KErrPathNotFound.
+				Test 2.1 Calls RecognizeFilesL() (without a data filter then with a data filter) using an empty folder path.
+				Checks returned value is KErrNone and that returned array is empty.
+
+ API Calls:\n
+ RApaLsSession::RecognizeFilesL(const TDesC& aPath, CDataRecognitionResultArray& aResult);\n
+ RApaLsSession::RecognizeFilesL(const TDesC& aPath, const TDesC8& aDataType, CDataRecognitionResultArray& aResult);\n
+ CDataRecognitionResultArray::CDataRecognitionResultArray();
+ CDataRecognitionResultArray::Count() const;\n
+
+ @SYMTestExpectedResults 	Test 2.0 returned value is KErrPathNotFound.\n
+						Test 2.1 returned value is KErrNone and that returned array is empty.\n
+ */
+ void CT_Serv3Step::DoSyncFolderRecognizerTest2L(RApaLsSession& aLs)
+	{
+	TBufC<50> emptyDir(KEmptyDir);
+    TPtr ptrEmptyDir(emptyDir.Des());
+
+    //Synchronous Folder File Recognition Test Group
+
+   	//**************
+    // Test Case 2.0 - Test Recognizer for incorrect folder path.Test both versions of synchronous RecognizeFiles
+    //**************
+    INFO_PRINTF1(_L("Synchronous Folder File Recognition Test PREQ699.2.0"));
+    _LIT(KNotKnownDir,"z:\\system\\data\\Testpath\\NotKnown\\");
+
+	CDataRecognitionResultArray* result1 = new(ELeave) CDataRecognitionResultArray();
+	CleanupStack::PushL(result1);
+
+	TInt ret=aLs.RecognizeFilesL(KNotKnownDir,*result1);
+	TEST(ret==KErrPathNotFound);
+
+	ret=aLs.RecognizeFilesL(KNotKnownDir,_L8("text/plain"),*result1);
+	TEST(ret==KErrPathNotFound);
+
+	 // Cleanup
+	CleanupStack::PopAndDestroy(result1);//result1
+
+	// Create a directory with no files
+	RSmlTestUtils utils;
+	CleanupClosePushL(utils);
+
+	CreateDirL(&utils, ptrEmptyDir);
+
+	//**************
+    // Test Case 2.1 -Test Recognizer for empty folder. Test both versions of synchronous RecognizeFiles
+    //**************
+    INFO_PRINTF1(_L("Synchronous Folder File Recognition Test PREQ699.2.1"));
+	CDataRecognitionResultArray* result2 = new(ELeave) CDataRecognitionResultArray();
+	CleanupStack::PushL(result2);
+	
+	ret=aLs.RecognizeFilesL(KEmptyDir,*result2);
+	TEST(ret==KErrNone);
+
+	TUint count = result2->Count();
+	TEST(count==0);
+
+	INFO_PRINTF1(_L("Test empty folder for filter version parameter"));
+	ret=aLs.RecognizeFilesL(KEmptyDir,_L8("text/plain"),*result2);
+	TEST(ret==KErrNone);
+
+	count = result2->Count();
+	TEST(count==0);
+
+	//Delete empty directory
+	DeleteDirL(&utils, ptrEmptyDir);
+
+	// Cleanup
+	CleanupStack::PopAndDestroy(result2);//result2
+	CleanupStack::PopAndDestroy(&utils);//utils
+ }
+
+ /**
+ @SYMTestCaseID T_Serv3Step_DoSyncRecognizerTest3L
+
+ @SYMPREQ 699
+
+ @SYMREQ  3899
+
+ @SYMTestCaseDesc Validate Synchronous RecognizeFilesL data filter function using various filters.\n
+ 		Test 3.0 Validate Synchronous RecognizeFilesL data filter function and CDataRecognitionResultArray\n
+ 		Test 3.1 Validate Synchronous RecognizeFilesL functions with wildcard/MIME type validity.\n
+ 		Test 3.2 Validate Synchronous RecognizeFilesL functions with irregular strings.\n
+
+ @SYMTestPriority High
+
+ @SYMTestStatus Implemented
+
+ @SYMTestActions. Call RecognizeFilesL with three different data filters: i) standard= "text/plain"; ii) wildcard: "text*"; iii) non-valid \n
+ 				For each call, check the results are correct: number of files identified and the MIME types.
+
+ API Calls:\n
+ RApaLsSession::RecognizeFilesL(const TDesC& aPath, const TDesC8& aDataType, CDataRecognitionResultArray& aResult);\n
+ CDataRecognitionResultArray::CDataRecognitionResultArray();\n
+ CDataRecognitionResultArray::Count() const;\n
+ CDataRecognitionResultArray::const TFileName& Path() const\n
+ CDataRecognitionResultArray::GetDataRecognitionResultL(TDataRecognitionResult& aResult, const TUint aIndex) const;\n
+ CDataRecognitionResultArray::GetFileNameL(TFileName& aFileName, const TUint aIndex) const\n
+
+ @SYMTestExpectedResults\n
+ 	Test 3.0 KErrNone and CDataRecognitionResultArray returned containing four entries, of MIME type "text/plain" \n
+ 	Test 3.1 KErrNone and CDataRecognitionResultArray returned containing four entries, of MIME type "text/plain" \n
+ 	Test 3.2 KErrNone and CDataRecognitionResultArray returned containing zero entries\n
+
+ */
+ void CT_Serv3Step::DoSyncFolderRecognizerTest3L(RApaLsSession& aLs)
+	{
+
+  	 //**************
+    // Test Case 3.0 - Test Recognizer filter version with datatype filter type validity.
+    // Also test CDataRecognitionResultArray::GetDataRecognitionResultL();
+    //			 CDataRecognitionResultArray::
+    //***************
+    //Synchronous Folder File Recognition Test Group 3;
+	_LIT(KFilterTestDir,"z:\\system\\data\\Testpath\\FilterTests\\");
+
+	CDataRecognitionResultArray* result3 = new(ELeave) CDataRecognitionResultArray();
+	CleanupStack::PushL(result3);
+
+    INFO_PRINTF1(_L("Synchronous Folder File Recognition Test PREQ699.3.0"));
+	TInt ret=aLs.RecognizeFilesL(KFilterTestDir,_L8("text/plain"),*result3);
+	TEST(ret==KErrNone);
+	TUint count = result3->Count();
+	TEST(count==4);
+
+	//get each result from the test directory. Check the MIME values against known types
+	for(TUint i=0; i<count;i++)
+		{
+		TDataRecognitionResult res;
+		result3->GetDataRecognitionResultL(res, i);  //the result
+		TFileName fileName;
+		result3->GetFileNameL(fileName, i);       //the file we are looking at
+
+		//test for correct MIME type result
+		TEST(res.iDataType.Des8().Compare(TDataType(_L8("text/plain")).Des8())==0);//report an error if not text/plain
+   		}
+
+   	// Cleanup
+	CleanupStack::PopAndDestroy(result3);//result
+
+  	//*****************
+    // Test Case 3.1 - Test Recognizer filter version for wildcard/MIME type validity.
+    // Also test CDataRecognitionResultArray
+    //*********
+    INFO_PRINTF1(_L("Synchronous Folder File Recognition Test PREQ699.3.1"));
+	CDataRecognitionResultArray* result4 = new(ELeave) CDataRecognitionResultArray();
+	CleanupStack::PushL(result4);
+	ret=aLs.RecognizeFilesL(KFilterTestDir,_L8("text*"),*result4);
+	TEST(ret==KErrNone);
+	count = result3->Count();
+	TEST(count==4);
+
+	//get each result from the test directory. Check the MIME values against some known types
+	for(TUint j=0; j<count;j++)
+		{
+		TDataRecognitionResult res;
+		result4->GetDataRecognitionResultL(res, j);  //the result
+		TFileName fileName;
+		result4->GetFileNameL(fileName, j);       //the file we are looking at
+
+		//test for correct MIME type result
+		TEST(res.iDataType.Des8().Compare(TDataType(_L8("text/plain")).Des8())==0);//report an error if not text
+   		}
+
+   	// Cleanup
+	CleanupStack::PopAndDestroy(result4);//result
+
+    //*****************
+    // Test Case 3.2 -Test Recognizer filter version for with irregular strings.
+    //*********
+    INFO_PRINTF1(_L("Synchronous Folder File Recognition Test PREQ699.3.2"));
+	CDataRecognitionResultArray* result5 = new(ELeave) CDataRecognitionResultArray();
+	CleanupStack::PushL(result5);
+	ret=aLs.RecognizeFilesL(KFilterTestDir,_L8("&*/?|=+-"),*result5);
+	TEST(ret==KErrNone);
+	count = result5->Count();
+	TEST(count==0);
+
+	ret=aLs.RecognizeFilesL(KFilterTestDir,_L8("'/"),*result5);
+	TEST(ret==KErrNone);
+	count = result5->Count();
+	TEST(count==0);
+
+   	// Cleanup
+	CleanupStack::PopAndDestroy(result5);//result
+ }
+
+ /**
+ @SYMTestCaseID T_Serv3Step_DoAsyncRecognizerTest1L
+
+ @SYMPREQ 699
+
+ @SYMREQ  Non-Specific
+
+ @SYMTestCaseDesc Test PREQ699.4.0 Validate Asynchronous RecognizeFilesL (non-filtered) function and CDataRecognitionResultArray\n
+
+ @SYMTestPriority High
+
+ @SYMTestStatus Implemented
+
+ @SYMTestActions. Calls RecognizeFilesL() with a folder containing two files of zero and one byte sizes. Uses a Test Active Object
+ 				within the request. Validates the returned number of files and file types. Tests CDataRecognitionResultArray by using the object.\n
+
+ API Calls:\n
+ RApaLsSession::RecognizeFilesL(const TDesC& aPath, CDataRecognitionResultArray& aResult, TRequestStatus& aStatus);\n
+ CDataRecognitionResultArray::CDataRecognitionResultArray();
+ CDataRecognitionResultArray::Count() const;\n
+ CDataRecognitionResultArray::const TFileName& Path() const\n
+ CDataRecognitionResultArray::GetDataRecognitionResultL(TDataRecognitionResult& aResult, const TUint aIndex) const;\n
+ CDataRecognitionResultArray::GetFileNameL(TFileName& aFileName, const TUint aIndex) const\n
+
+ @SYMTestExpectedResults status= KErrNone and CDataRecognitionResultArray returned containing two entries, of MIME type "text/plain" \n
+
+ */
+void CT_Serv3Step::DoAsyncFolderRecognizerTest1L(RApaLsSession& aLs)
+	{
+
+	//Asynchronous folder file recognition Test Group 4
+
+	//Setup Active Object
+	CActiveTest2* active = new(ELeave) CActiveTest2();
+	CleanupStack::PushL(active);
+
+	CDataRecognitionResultArray* result = new(ELeave) CDataRecognitionResultArray();
+	CleanupStack::PushL(result);
+
+	//Check results and Stop AS
+	_LIT(KStandardDir,"z:\\system\\data\\Testpath\\");
+
+	INFO_PRINTF1(_L("Asynchronous folder file Recognition Test PREQ699.4.0"));
+	aLs.RecognizeFilesL(KStandardDir,*result,active->iStatus);
+	active->StartL();//set active
+	CActiveScheduler::Start();
+
+	TEST(active->iStatus==KErrNone);
+	if (active->iStatus==KErrNone)
+		{
+		TUint count = result->Count();
+
+		TEST(count==2); //two files in directory
+
+		//get each result from the test directory. Check the MIME values against some known types
+		for(TUint i=0; i<count;i++)
+			{
+			TDataRecognitionResult res;
+			result->GetDataRecognitionResultL(res, i);  // the result
+			//test MIME type result = "text/plain"
+			TEST(res.iDataType.Des8().Compare(TDataType(_L8("text/plain")).Des8())==0);
+			
+			TFileName fileName;
+			result->GetFileNameL(fileName, i);       //the file we are looking at
+			TEST(fileName.Compare( (i==0 ? _L("file1.txt") : _L("file2.txt")) ) == 0);
+	   		}
+		}
+
+	// Cleanup
+	CleanupStack::PopAndDestroy(result);//result
+	CleanupStack::PopAndDestroy(active);//active
+ }
+
+ /**
+ @SYMTestCaseID T_Serv3Step_DoAsyncRecognizerTest2L
+
+ @SYMPREQ 699
+
+ @SYMREQ  3899
+
+ @SYMTestCaseDesc Test PREQ699.5.0 Validate Asynchronous RecognizeFilesL (filtered) function and CDataRecognitionResultArray\n
+
+ @SYMTestPriority High
+
+ @SYMTestStatus Implemented
+
+ @SYMTestActions. Call RecognizeFilesL() with a Data Type Filter (aDataType ="Text/Plain") and a Test Active Object.
+ 				Test that the number and data type of files returned is correct.
+ 				Tests CDataRecognitionResultArray by using the object.\n
+
+ API Calls:\n
+ RApaLsSession::RecognizeFilesL(const TDesC& aPath, const TDesC8& aDataType, CDataRecognitionResultArray& aResult, TRequestStatus& aStatus);\n
+ CDataRecognitionResultArray::CDataRecognitionResultArray();
+ CDataRecognitionResultArray::Count() const;\n
+ CDataRecognitionResultArray::GetDataRecognitionResultL(TDataRecognitionResult& aResult, const TUint aIndex) const;\n
+ CDataRecognitionResultArray::GetFileNameL(TFileName& aFileName, const TUint aIndex) const\n
+
+ @SYMTestExpectedResults status= KErrNone and CDataRecognitionResultArray returned containing four entries, of MIME type "text/plain" \n
+
+
+ */
+void CT_Serv3Step::DoAsyncFolderRecognizerTest2L(RApaLsSession& aLs)
+	{
+
+    //Asynchronous folder file recognition Test Group 5
+
+	//Setup Active Object
+	CActiveTest2* active = new(ELeave) CActiveTest2();
+	CleanupStack::PushL(active);
+
+	CDataRecognitionResultArray* result = new(ELeave) CDataRecognitionResultArray();
+	CleanupStack::PushL(result);
+
+	_LIT(KFilterDir,"z:\\system\\data\\Testpath\\FilterTests\\");
+
+    INFO_PRINTF1(_L("Asynchronous folder file Recognition Test PREQ699.5.0"));
+    //Test RecognizeFilesL with a MIME type filter "text/plain"
+ 	aLs.RecognizeFilesL(KFilterDir,_L8("text/plain"), *result,active->iStatus);
+
+	active->StartL();//set active
+	CActiveScheduler::Start();
+
+	TEST(active->iStatus==KErrNone);
+	if (active->iStatus==KErrNone)
+		{
+		TUint count = result->Count();
+
+		TEST(count==4); //four files in directory
+
+		//get each result from the test directory. Check the MIME values against some known types
+		for(TUint i=0; i<count;i++)
+			{
+			TDataRecognitionResult res;
+			result->GetDataRecognitionResultL(res, i);  // the result
+			TFileName fileName;
+			result->GetFileNameL(fileName, i);       // the file we are looking at
+
+			//test MIME type result = "text/plain"
+			TEST(res.iDataType.Des8().Compare(TDataType(_L8("text/plain")).Des8())==0);
+	   		}
+		}
+
+	// Cleanup
+	CleanupStack::PopAndDestroy(result);//result
+	CleanupStack::PopAndDestroy(active);//active
+ }
+
+ /**
+ @SYMTestCaseID T_Serv3Step_DoAsyncRecognizerTest3L
+
+ @SYMPREQ 699
+
+ @SYMREQ  3899
+
+ @SYMTestCaseDesc Test PREQ699.6.0 Validate Asynchronous RecognizeFilesL function (with data filter and wildcard) \n
+
+ @SYMTestPriority High
+
+ @SYMTestStatus Implemented
+
+ @SYMTestActions. Call RecognizeFilesL() with a Data Type Filter and wildcard (aDataType ="Text/ *") and a Test Active Object.
+ 				Test that the number and data type of files returned is correct.
+ 				Tests CDataRecognitionResultArray by using the object.\n
+
+ API Calls:\n
+ RApaLsSession::RecognizeFilesL(const TDesC& aPath, const TDesC8& aDataType, CDataRecognitionResultArray& aResult, TRequestStatus& aStatus);\n
+ CDataRecognitionResultArray::CDataRecognitionResultArray();
+ CDataRecognitionResultArray::Count() const;\n
+ CDataRecognitionResultArray::GetDataRecognitionResultL(TDataRecognitionResult& aResult, const TUint aIndex) const;\n
+ CDataRecognitionResultArray::GetFileNameL(TFileName& aFileName, const TUint aIndex) const\n
+
+ @SYMTestExpectedResults status= KErrNone and CDataRecognitionResultArray returned containing four entries, of MIME type "text/plain" \n
+
+
+ */
+void CT_Serv3Step::DoAsyncFolderRecognizerTest3L(RApaLsSession& aLs)
+	{
+
+	// Asynchronous folder file recognition Test Group 6
+
+	//Setup Active Object
+	CActiveTest2* active = new(ELeave) CActiveTest2();
+	CleanupStack::PushL(active);
+
+	CDataRecognitionResultArray* result = new(ELeave) CDataRecognitionResultArray();
+	CleanupStack::PushL(result);
+
+	_LIT(KFilterDir,"z:\\system\\data\\Testpath\\FilterTests\\");
+
+    INFO_PRINTF1(_L("Asynchronous folder file Recognition Test PREQ699.6.0"));
+	aLs.RecognizeFilesL(KFilterDir,_L8("text*"), *result,active->iStatus);
+
+	active->StartL();//set active
+	CActiveScheduler::Start();
+
+	TEST(active->iStatus==KErrNone);//Test no error returned
+	if (active->iStatus==KErrNone)
+		{
+		TUint count = result->Count();
+
+		TEST(count==4); //four files in directory
+
+		//get each result from the test directory. Check the MIME values against some known types
+		for(TUint i=0; i<count;i++)
+			{
+			TDataRecognitionResult res;
+			result->GetDataRecognitionResultL(res, i);  // the result
+			TFileName fileName;
+			result->GetFileNameL(fileName, i);       //the file we are looking at
+
+			//test MIME type result="text/plain"
+			TEST(res.iDataType.Des8().Compare(TDataType(_L8("text/plain")).Des8())==0);
+	   		}
+		}
+
+	// Cleanup
+	CleanupStack::PopAndDestroy(result);//result
+	CleanupStack::PopAndDestroy(active);//active
+ }
+
+  /**
+ @SYMTestCaseID T_Serv3Step_DoAsyncRecognizerTest4L
+
+ @SYMPREQ 699
+
+ @SYMREQ  3899
+
+ @SYMTestCaseDesc Test PREQ699.7.0 Validate Asynchronous RecognizeFilesL function (with unknown and irregular data filters).
+
+ @SYMTestPriority High
+
+ @SYMTestStatus Implemented
+
+ @SYMTestActions. Call RecognizeFilesL() with Data Type Filters of an irregular nature and a Test Active Object.
+ 				Test that no files are returned and status= KErrNone.\n
+
+ API Calls:\n
+ RApaLsSession::RecognizeFilesL(const TDesC& aPath, const TDesC8& aDataType, CDataRecognitionResultArray& aResult, TRequestStatus& aStatus);\n
+ CDataRecognitionResultArray::CDataRecognitionResultArray();
+ CDataRecognitionResultArray::Count() const;\n
+
+ @SYMTestExpectedResults status= KErrNone and CDataRecognitionResultArray returned containing zero entries \n
+
+ */
+void CT_Serv3Step::DoAsyncFolderRecognizerTest4L(RApaLsSession& aLs)
+	{
+
+    //Asynchronous folder file recognition Test Group 7
+
+	//Setup Active Object
+	CActiveTest2* active = new(ELeave) CActiveTest2();
+	CleanupStack::PushL(active);
+
+	INFO_PRINTF1(_L("Testing Recognition of folder filtered with irregular strings"));
+
+	CDataRecognitionResultArray* result = new(ELeave) CDataRecognitionResultArray();
+	CleanupStack::PushL(result);
+
+	_LIT(KFilterDir,"z:\\system\\data\\Testpath\\FilterTests\\");
+
+	INFO_PRINTF1(_L("Asynchronous folder file Recognition Test PREQ699.7.0"));
+	aLs.RecognizeFilesL(KFilterDir,_L8("&* /?|=+-"),*result, active->iStatus);
+
+	active->StartL();//set active
+	CActiveScheduler::Start();
+
+	TEST(active->iStatus==KErrNone);
+	if (active->iStatus==KErrNone)
+		{
+		TUint count = result->Count();
+		TEST(count==0); //no files should be found
+		}
+
+	// Cleanup
+	CleanupStack::PopAndDestroy(result);//result
+	CleanupStack::PopAndDestroy(active);//active
+
+ }
+ /**
+ @SYMTestCaseID T_Serv3Step_DoAsyncRecognizerTest5L
+
+ @SYMPREQ 699
+
+ @SYMREQ  Non-Specific
+
+ @SYMTestCaseDesc Test PREQ699.8.0 Validate Asynchronous RecognizeFilesL function with large directory to test Cache upperlimit. \n
+
+ @SYMTestPriority High
+
+ @SYMTestStatus Implemented
+
+ @SYMTestActions. Call RecognizeFilesL() with a folder containing a large number of files and a Test Active Object.
+ 				Test that the number of files returned is correct.
+ 				Tests CDataRecognitionResultArray by using the object.\n
+
+ API Calls:\n
+ RApaLsSession::RecognizeFilesL(const TDesC& aPath, const TDesC8& aDataType, CDataRecognitionResultArray& aResult, TRequestStatus& aStatus);\n
+ CDataRecognitionResultArray::CDataRecognitionResultArray();
+ CDataRecognitionResultArray::Count() const;\n
+
+ @SYMTestExpectedResults status= KErrNone and CDataRecognitionResultArray returned containing 550 entries. \n
+
+ */
+
+void CT_Serv3Step::DoAsyncFolderRecognizerTest5L(RApaLsSession& aLs)
+	{
+    _LIT(KLargeDir,"c:\\system\\data\\Testpath\\largeDir\\");
+    _LIT(KLargeDirRoot, "c:\\system\\data\\Testpath\\largeDir\\focus");
+
+	TBufC<50> bigDir(KLargeDir);
+    TPtr ptrBigDir (bigDir.Des());
+	TBufC<50> bigDirRoot(KLargeDirRoot);
+    TPtr ptrBigDirRoot (bigDirRoot.Des());
+
+	// Asynchronous folder file recognition Test Group 8
+
+	//Setup Active Object
+	CActiveTest2* active = new(ELeave) CActiveTest2();
+	CleanupStack::PushL(active);
+
+	CDataRecognitionResultArray* result = new(ELeave) CDataRecognitionResultArray();
+	CleanupStack::PushL(result);
+
+	//File server and utils
+	RFs	theFS;
+ 	theFS.Connect();
+ 	RFile file;
+
+	RSmlTestUtils utils;
+	CleanupClosePushL(utils);
+
+	CreateDirL(&utils, ptrBigDir);
+
+	CreateFilesL(theFS, file, ptrBigDirRoot, (TDesC&)KSuffixText, 550, KTextContent, 0);
+
+	INFO_PRINTF1(_L("Asynchronous folder file Recognition Test PREQ699.8.0"));
+	//Check results and Stop AS
+	aLs.RecognizeFilesL(KLargeDir,*result,active->iStatus);
+
+	active->StartL();//set active
+	CActiveScheduler::Start();
+
+	TEST(active->iStatus==KErrNone);
+	if (active->iStatus==KErrNone)
+		{
+		TUint count = result->Count();
+		TEST(count==550); //550 files in directory - 500 files is thought to be cache capacity
+		}
+
+	DeleteFilesL(&utils, ptrBigDirRoot, (TDesC&)KSuffixText, 550);
+
+	DeleteDirL(&utils, ptrBigDir);
+
+	// Cleanup
+	CleanupStack::PopAndDestroy(&utils);//utils
+	CleanupStack::PopAndDestroy(result);//result
+	CleanupStack::PopAndDestroy(active);//active
+ }
+
+ /**
+ @SYMTestCaseID 	T_Serv3Step_DoAsyncRecognizerTest6L
+
+ @SYMPREQ 699
+
+ @SYMREQ  3898 3899
+
+ @SYMTestCaseDesc	Test PREQ699.9.0, PREQ699.9.1, PREQ699.9.2 Validates cache functionality with changed file mime type
+
+ @SYMTestPriority 	High
+
+ @SYMTestStatus 	Implemented
+
+ @SYMTestActions	Recognize a directory with a filter and then change the mime type of one file.
+				Recognize the directory with a filter again and ensure that the file type change has been registered.
+
+ API Calls:\n
+ 				RApaLsSession::RecognizeFilesL(const TDesC& aPath,
+ 												const TDesC8& aDataType,
+ 												CDataRecognitionResultArray& aResult,
+												TRequestStatus& aStatus);
+ 				CDataRecognitionResultArray::CDataRecognitionResultArray();
+ 				CDataRecognitionResultArray::Count() const;
+
+ @SYMTestExpectedResults\n
+ 				status = KErrNone for file creation
+  				9.0 count  = 1 	CDataRecognitionResultArray::Count returns one entry of MIME type "text/plain"
+				status = KErrNone for file content changed to html
+				9.1 count  = 0 CDataRecognitionResultArray::Count returns no entries of MIME type "text/plain"
+				9.2 count  = 0 CDataRecognitionResultArray::Count returns no entries of MIME type "text/plain"
+
+ */
+void CT_Serv3Step::DoAsyncFolderRecognizerTest6L(RApaLsSession& aLs)
+	{
+
+	TBufC<50> mimeDir(KMimeDir);
+    TPtr ptrMimeDir(mimeDir.Des());
+
+	TBufC<50> mimeFile(KMimeFile);
+    TPtr ptrMimeFile(mimeFile.Des());
+
+	//Setup Active Object
+	CActiveTest2* active = new(ELeave) CActiveTest2();
+	CleanupStack::PushL(active);
+
+	//Asynchronous folder file recognition Test Group 9
+
+	//Declare result arrays for storing seperate recognition results
+	CDataRecognitionResultArray* result1 = new(ELeave) CDataRecognitionResultArray();
+	CDataRecognitionResultArray* result2 = new(ELeave) CDataRecognitionResultArray();
+	CDataRecognitionResultArray* result3 = new(ELeave) CDataRecognitionResultArray();
+
+	CleanupStack::PushL(result1);
+	CleanupStack::PushL(result2);
+	CleanupStack::PushL(result3);
+
+	//File server and utils
+	RFs	theFS;
+ 	theFS.Connect();
+ 	RFile file;
+
+	RSmlTestUtils utils;
+	CleanupClosePushL(utils);
+
+	//Create directory for test files
+	CreateDirL(&utils, ptrMimeDir);
+
+	//Timestamp details for files
+	TTime time;
+	time.UniversalTime();
+
+	TTime aLaterTime(time);
+	TTimeIntervalMinutes aInterval(1);
+
+	aLaterTime+=(aInterval);
+
+	// Create file mime_content000.txt containing text
+	CreateFilesL(theFS, file, ptrMimeFile, (TDesC&)KSuffixText, 1, KTextContent, time);
+    
+	INFO_PRINTF1(_L("Asynchronous folder file Recognition Test PREQ699.9.0"));
+    //Test RecognizeFilesL with a MIME type filter "text/plain"
+ 	aLs.RecognizeFilesL(KMimeDir,_L8("text/plain"), *result1 ,active->iStatus);
+
+	active->StartL();//set active
+	CActiveScheduler::Start();
+
+	TEST(active->iStatus==KErrNone);
+	if (active->iStatus==KErrNone)
+		{
+		TUint count = result1->Count();
+		TEST(count==1);
+		}
+
+	//Change file content to html
+	CreateFilesL(theFS, file, ptrMimeFile, (TDesC&)KSuffixText, 1, KHtmlContent, aLaterTime);
+
+	INFO_PRINTF1(_L("Asynchronous folder file Recognition Test PREQ699.9.1"));
+    //Test RecognizeFilesL with a MIME type filter "text/plain"
+ 	aLs.RecognizeFilesL(KMimeDir,_L8("text/plain"), *result2 ,active->iStatus);
+
+	active->StartL();//set active
+	CActiveScheduler::Start();
+
+	TEST(active->iStatus==KErrNone);
+	if (active->iStatus==KErrNone)
+		{
+		TUint count = result2->Count();
+		TEST(count==0);
+		}
+
+
+	//Delete file and recognise again
+	DeleteFilesL(&utils, ptrMimeFile, (TDesC&)KSuffixText, 1);
+
+	INFO_PRINTF1(_L("Asynchronous folder file Recognition Test PREQ699.9.2"));
+ 	aLs.RecognizeFilesL(KMimeDir, *result3,active->iStatus);
+
+	active->StartL();//set active
+	CActiveScheduler::Start();
+
+	TEST(active->iStatus==KErrNone);
+	if (active->iStatus==KErrNone)
+		{
+		TUint count = result3->Count();
+		TEST(count==0);
+		}
+
+
+	//Remove test directory
+	DeleteDirL(&utils, ptrMimeDir);
+
+	// Cleanup
+	CleanupStack::PopAndDestroy(&utils); //utils
+	CleanupStack::PopAndDestroy(result3);//result1
+	CleanupStack::PopAndDestroy(result2);//result2
+	CleanupStack::PopAndDestroy(result1);//result3
+	CleanupStack::PopAndDestroy(active); //active
+
+ }
+
+ /**
+ @SYMTestCaseID	T_Serv3Step_DoAsyncRecognizerTest7L
+
+ @SYMPREQ 699
+
+ @SYMREQ  3898 3899
+
+ @SYMTestCaseDesc 	Test PREQ699.10.0 Validates cache functionality with changed mime type and filter (1)
+
+ @SYMTestPriority 	High
+
+ @SYMTestStatus 	Implemented
+
+ @SYMTestActions	Recognize a directory with a filter. Change the mime type of one file in the
+				directory such that it is now described by the filter.  Recognize the
+				directory again with the same filter and ensure that the file type change has
+				been registered.
+
+ API Calls:\n
+ 				RApaLsSession::RecognizeFilesL(const TDesC& aPath,
+ 												const TDesC8& aDataType,
+ 												CDataRecognitionResultArray& aResult,
+												TRequestStatus& aStatus);
+ 				CDataRecognitionResultArray::CDataRecognitionResultArray();
+ 				CDataRecognitionResultArray::Count() const;
+
+ @SYMTestExpectedResults\n
+ 				status = KErrNone for file creation
+  				count  = 3 	CDataRecognitionResultArray::Count returns three entries of MIME type "text/html"
+				status = KErrNone for file content changed to html
+				count  = 4 CDataRecognitionResultArray::Count returns four entries of MIME type "text/html"
+ */
+ void CT_Serv3Step::DoAsyncFolderRecognizerTest7L(RApaLsSession& aLs)
+	{
+	TBufC<50> mimeDir(KMimeDir);
+    TPtr ptrMimeDir (mimeDir.Des());
+
+	TBufC<50> mimeFile(KMimeFile);
+    TPtr ptrMimeFile(mimeFile.Des());
+
+	//Asynchronous folder file recognition Test Group 10
+
+	//Setup Active Object
+	CActiveTest2* active = new(ELeave) CActiveTest2();
+	CleanupStack::PushL(active);
+
+	CDataRecognitionResultArray* result1 = new(ELeave) CDataRecognitionResultArray();
+	CDataRecognitionResultArray* result2 = new(ELeave) CDataRecognitionResultArray();
+	CleanupStack::PushL(result1);
+	CleanupStack::PushL(result2);
+
+
+	RFs	theFS;
+ 	theFS.Connect();
+ 	RFile file;
+
+	RSmlTestUtils utils;
+	CleanupClosePushL(utils);
+
+	//Create directory for test files
+	CreateDirL(&utils, ptrMimeDir);
+
+	//Timestamp details for files
+	TTime time;
+	time.UniversalTime();
+
+	TTime aLaterTime(time);
+	TTimeIntervalMinutes aInterval(1);
+	aLaterTime+=(aInterval);
+
+	// Create files mime_content000.canyoutell - mime_content003.canyoutell
+	// 000 with text content and 001-003 with html content
+	CreateFilesL(theFS, file, ptrMimeFile, (TDesC&)KSuffixUnknown, 4, KHtmlContent, time);
+	CreateFilesL(theFS, file, ptrMimeFile, (TDesC&)KSuffixUnknown, 1, KTextContent, time);
+
+	INFO_PRINTF1(_L("Asynchronous folder file Recognition Test PREQ699.10.0"));
+    //Test RecognizeFilesL with a MIME type filter "text/html"
+ 	aLs.RecognizeFilesL(KMimeDir,_L8("text/html"), *result1 ,active->iStatus);
+
+	active->StartL();//set active
+	CActiveScheduler::Start();
+
+	TEST(active->iStatus==KErrNone);
+	if (active->iStatus==KErrNone)
+		{
+		TUint count = result1->Count();
+		TEST(count == 3);
+		}
+
+
+	//Change file content to html and update the timestamp
+	CreateFilesL(theFS, file, ptrMimeFile, (TDesC&)KSuffixUnknown, 1, KHtmlContent, aLaterTime);
+
+    //Test RecognizeFilesL with a MIME type filter "text/html"
+ 	aLs.RecognizeFilesL(KMimeDir,_L8("text/html"), *result2 ,active->iStatus);
+
+	active->StartL();//set active
+	CActiveScheduler::Start();
+
+	TEST(active->iStatus==KErrNone);
+	if (active->iStatus==KErrNone)
+		{
+		TUint count = result2->Count();
+		TEST(count == 4);
+		}
+
+
+	DeleteFilesL(&utils, ptrMimeFile, (TDesC&)KSuffixUnknown, 4);
+
+	//Remove test directory
+	DeleteDirL(&utils, ptrMimeDir);
+
+	// Cleanup
+	CleanupStack::PopAndDestroy(&utils);//utils
+	CleanupStack::PopAndDestroy(result2);//result1
+	CleanupStack::PopAndDestroy(result1);//result2
+	CleanupStack::PopAndDestroy(active);//active
+
+ }
+
+ /**
+ @SYMTestCaseID	T_Serv3Step_DoAsyncRecognizerTest8L
+
+ @SYMPREQ 699
+
+ @SYMREQ  3898 3899
+
+ @SYMTestCaseDesc	Test PREQ699.11.0 Validates cache functionality with changed file mime type and filter (2)
+
+ @SYMTestPriority 	High
+
+ @SYMTestStatus 	Implemented
+
+ @SYMTestActions	Recognize a directory with a filter. Change the mime type of one file in the
+				directory such that it is now not described by the filter.  Recognize the
+				directory again with the same filter and ensure that the file type change has
+				been registered.
+
+ API Calls:\n
+ 				RApaLsSession::RecognizeFilesL(const TDesC& aPath,
+ 												const TDesC8& aDataType,
+ 												CDataRecognitionResultArray& aResult,
+												TRequestStatus& aStatus);
+ 				CDataRecognitionResultArray::CDataRecognitionResultArray();
+ 				CDataRecognitionResultArray::Count() const;
+
+ @SYMTestExpectedResults\n
+ 				status = KErrNone for file creation
+  				count  = 4 	CDataRecognitionResultArray::Count returns four entries of MIME type "text/html"
+				status = KErrNone for file content changed to html
+				count  = 3 CDataRecognitionResultArray::Count returns three entries of MIME type "text/html"
+ */
+void CT_Serv3Step::DoAsyncFolderRecognizerTest8L(RApaLsSession& aLs)
+	{
+	TBufC<50> mimeDir(KMimeDir);
+    TPtr ptrMimeDir (mimeDir.Des());
+
+	TBufC<50> mimeFile(KMimeFile);
+    TPtr ptrMimeFile(mimeFile.Des());
+
+	//Asynchronous folder file recognition Test Group 11
+
+	//Setup Active Object
+	CActiveTest2* active = new(ELeave) CActiveTest2();
+	CleanupStack::PushL(active);
+
+	CDataRecognitionResultArray* result1 = new(ELeave) CDataRecognitionResultArray();
+	CDataRecognitionResultArray* result2 = new(ELeave) CDataRecognitionResultArray();
+	CleanupStack::PushL(result1);
+	CleanupStack::PushL(result2);
+
+
+	RFs	theFS;
+ 	theFS.Connect();
+ 	RFile file;
+
+	RSmlTestUtils utils;
+	CleanupClosePushL(utils);
+
+	//Create directory for test files
+	CreateDirL(&utils, ptrMimeDir);
+
+	//Timestamp details for files
+	TTime time;
+	time.UniversalTime();
+
+	TTime aLaterTime(time);
+	TTimeIntervalMinutes aInterval(1);
+	aLaterTime+=(aInterval);
+
+	// Create files mime_content000.canyoutell - mime_content003.canyoutell with html content
+	CreateFilesL(theFS, file, ptrMimeFile, (TDesC&)KSuffixUnknown, 4, KHtmlContent, time);
+
+    //Test RecognizeFilesL with a MIME type filter "text/html"
+ 	aLs.RecognizeFilesL(KMimeDir,_L8("text/html"), *result1 ,active->iStatus);
+
+	active->StartL();//set active
+	CActiveScheduler::Start();
+
+	TEST(active->iStatus==KErrNone);
+	if (active->iStatus==KErrNone)
+		{
+		TUint count = result1->Count();
+		TEST(count == 4);
+		}
+
+
+	//Change file content to text
+	CreateFilesL(theFS, file, ptrMimeFile, (TDesC&)KSuffixUnknown, 1, KTextContent, aLaterTime);
+
+	INFO_PRINTF1(_L("Asynchronous folder file Recognition Test PREQ699.11.0"));
+    //Test RecognizeFilesL with a MIME type filter "text/html"
+ 	aLs.RecognizeFilesL(KMimeDir,_L8("text/html"), *result2 ,active->iStatus);
+
+	active->StartL();//set active
+	CActiveScheduler::Start();
+
+	TEST(active->iStatus==KErrNone);
+	if (active->iStatus==KErrNone)
+		{
+		TUint count = result2->Count();
+		TEST(count == 3);
+		}
+
+	DeleteFilesL(&utils, ptrMimeFile, (TDesC&)KSuffixUnknown, 4);
+
+	//Remove test directory
+	DeleteDirL(&utils, ptrMimeDir);
+
+	// Cleanup
+	CleanupStack::PopAndDestroy(&utils);//utils
+	CleanupStack::PopAndDestroy(result2);//result1
+	CleanupStack::PopAndDestroy(result1);//result2
+	CleanupStack::PopAndDestroy(active);//active
+
+ }
+
+ /**
+ @SYMTestCaseID	T_Serv3Step_DoAsyncRecognizerTest9L
+
+ @SYMPREQ 699
+
+ @SYMREQ  3898 3899
+
+ @SYMTestCaseDesc	Test PREQ699.12.0 Validates cache functionality with older timestamp(1)
+
+ @SYMTestPriority 	High
+
+ @SYMTestStatus 	Implemented
+
+ @SYMTestActions	Recognize a directory. Change the timestamp on one file to be older and alter
+				the mime type. Repeat the directory recognition and ensure that the mime type
+				has been updated..
+
+ API Calls:\n
+ 				RApaLsSession::RecognizeFilesL(const TDesC& aPath,
+ 												const TDesC8& aDataType,
+ 												CDataRecognitionResultArray& aResult,
+												TRequestStatus& aStatus);
+ 				CDataRecognitionResultArray::CDataRecognitionResultArray();
+ 				CDataRecognitionResultArray::Count() const;
+
+ @SYMTestExpectedResults\n
+ 				status = KErrNone for html file creation
+  				count  = 1 	CDataRecognitionResultArray::Count returns one entry of MIME type "text/html"
+				status = KErrNone for file content changed to text
+				count  = 0 CDataRecognitionResultArray::Count returns zero entries of MIME type "text/html"
+ */
+void CT_Serv3Step::DoAsyncFolderRecognizerTest9L(RApaLsSession& aLs)
+	{
+	TBufC<50> mimeDir(KMimeDir);
+    TPtr ptrMimeDir (mimeDir.Des());
+
+	TBufC<50> mimeFile(KMimeFile);
+    TPtr ptrMimeFile(mimeFile.Des());
+
+	//Asynchronous folder file recognition Test Group 12
+
+	//Setup Active Object
+	CActiveTest2* active = new(ELeave) CActiveTest2();
+	CleanupStack::PushL(active);
+
+	CDataRecognitionResultArray* result1 = new(ELeave) CDataRecognitionResultArray();
+	CDataRecognitionResultArray* result2 = new(ELeave) CDataRecognitionResultArray();
+	CleanupStack::PushL(result1);
+	CleanupStack::PushL(result2);
+
+	RFs	theFS;
+ 	theFS.Connect();
+ 	RFile file;
+
+	RSmlTestUtils utils;
+	CleanupClosePushL(utils);
+
+	//Create directory for test files
+	CreateDirL(&utils, ptrMimeDir);
+
+	//Timestamp details for files
+	TTime time;
+	time.UniversalTime();
+
+	TTime aLaterTime(time);
+	TTimeIntervalMinutes aInterval(1);
+	aLaterTime+=(aInterval);
+
+	//Set the directory timestamp to be 'new'
+	theFS.SetModified(ptrMimeDir, aLaterTime);
+
+	// Create file mime_content000.canyoutell with html content and 'new' time
+	CreateFilesL(theFS, file, ptrMimeFile, (TDesC&)KSuffixUnknown, 1, KHtmlContent, aLaterTime);
+
+    //Test RecognizeFilesL with a MIME type filter "text/html"
+ 	aLs.RecognizeFilesL(KMimeDir,_L8("text/html"), *result1 ,active->iStatus);
+	active->StartL();//set active
+ 	CActiveScheduler::Start();
+
+	TEST(active->iStatus==KErrNone);
+	if (active->iStatus==KErrNone)
+		{
+		TUint count = result1->Count();
+		TEST(count == 1);
+		}
+
+
+	//Change file content to text and set the timestamp to 'old'
+	CreateFilesL(theFS, file, ptrMimeFile, (TDesC&)KSuffixUnknown, 1, KTextContent, time);
+
+	INFO_PRINTF1(_L("Asynchronous folder file Recognition Test PREQ699.12.0"));
+    //Test RecognizeFilesL with a MIME type filter "text/html"
+ 	aLs.RecognizeFilesL(KMimeDir,_L8("text/html"), *result2 ,active->iStatus);
+
+	active->StartL();//set active
+	CActiveScheduler::Start();
+
+	TEST(active->iStatus==KErrNone);
+	if (active->iStatus==KErrNone)
+		{
+		TUint count = result2->Count();
+		TEST(count == 0);
+		}
+
+	//Delete file
+	utils.DeleteFileL(_L("c:\\system\\data\\Mimepath\\mime_content000.canyoutell"));
+
+	//Remove test directory
+	DeleteDirL(&utils, ptrMimeDir);
+
+	// Cleanup
+	CleanupStack::PopAndDestroy(&utils);//utils
+	CleanupStack::PopAndDestroy(result2);//result1
+	CleanupStack::PopAndDestroy(result1);//result2
+	CleanupStack::PopAndDestroy(active);//active
+
+ }
+
+/**
+ @SYMTestCaseID	T_Serv3Step_DoAsyncRecognizerTest10L
+
+ @SYMPREQ 699
+
+ @SYMREQ  3898 3899
+
+ @SYMTestCaseDesc	Test PREQ699.13.0 Validates cache functionality with older timestamp.
+
+ @SYMTestPriority 	High
+
+ @SYMTestStatus 	Implemented
+
+ @SYMTestActions	Recognize a directory. Change the timestamp on one file to be older and alter
+				the mime type. Change the timestamp on the directory to be newer. Repeat the
+				directory recognition and ensure that the mime type has been updated..
+
+ API Calls:\n
+ 				RApaLsSession::RecognizeFilesL(const TDesC& aPath,
+ 												const TDesC8& aDataType,
+ 												CDataRecognitionResultArray& aResult,
+												TRequestStatus& aStatus);
+ 				CDataRecognitionResultArray::CDataRecognitionResultArray();
+ 				CDataRecognitionResultArray::Count() const;
+
+ @SYMTestExpectedResults\n
+ 				status = KErrNone for html file creation
+  				count  = 1 	CDataRecognitionResultArray::Count returns one entry of MIME type "text/html"
+				status = KErrNone for file content changed to text
+				count  = 0 CDataRecognitionResultArray::Count returns zero entries of MIME type "text/html"
+ */
+void CT_Serv3Step::DoAsyncFolderRecognizerTest10L(RApaLsSession& aLs)
+	{
+	TBufC<50> mimeDir(KMimeDir);
+    TPtr ptrMimeDir (mimeDir.Des());
+
+	TBufC<50> mimeFile(KMimeFile);
+    TPtr ptrMimeFile(mimeFile.Des());
+
+	//Asynchronous folder file recognition Test Group 13
+
+	//Setup Active Object
+	CActiveTest2* active = new(ELeave) CActiveTest2();
+	CleanupStack::PushL(active);
+
+	CDataRecognitionResultArray* result1 = new(ELeave) CDataRecognitionResultArray();
+	CDataRecognitionResultArray* result2 = new(ELeave) CDataRecognitionResultArray();
+	CleanupStack::PushL(result1);
+	CleanupStack::PushL(result2);
+
+	RFs	theFS;
+ 	theFS.Connect();
+ 	RFile file;
+
+	RSmlTestUtils utils;
+	CleanupClosePushL(utils);
+
+	//Create directory for test files
+	CreateDirL(&utils, ptrMimeDir);
+
+	//Timestamp details for files
+	TTime time;
+	time.UniversalTime();
+
+	TTime aLaterTime(time);
+	TTimeIntervalMinutes aInterval(1);
+	aLaterTime+=(aInterval);
+
+	//Set the directory timestamp to be 'old'
+	theFS.SetModified(ptrMimeDir, time);
+
+	// Create file mime_content000.canyoutell with html content and 'old' time
+	CreateFilesL(theFS, file, ptrMimeFile, (TDesC&)KSuffixUnknown, 1, KHtmlContent, time);
+
+    //Test RecognizeFilesL with a MIME type filter "text/html"
+ 	aLs.RecognizeFilesL(KMimeDir,_L8("text/html"), *result1 ,active->iStatus);
+
+	active->StartL();//set active
+	CActiveScheduler::Start();
+
+	TEST(active->iStatus==KErrNone);
+	if (active->iStatus==KErrNone)
+		{
+		TUint count = result1->Count();
+		TEST(count == 1);
+		}
+
+
+	//Change file content to text and set the timestamp to 'new'
+	//Change dir timestamp to 'old'
+	CreateFilesL(theFS, file, ptrMimeFile, (TDesC&)KSuffixUnknown, 1, KTextContent, aLaterTime);
+
+	//Set the directory timestamp to be 'new'
+	theFS.SetModified(ptrMimeDir, aLaterTime);
+
+
+	INFO_PRINTF1(_L("Asynchronous folder file Recognition Test PREQ699.13.0"));
+    //Test RecognizeFilesL with a MIME type filter "text/html"
+ 	aLs.RecognizeFilesL(KMimeDir,_L8("text/html"), *result2 ,active->iStatus);
+
+	active->StartL();//set active
+	CActiveScheduler::Start();
+
+	TEST(active->iStatus==KErrNone);
+	if (active->iStatus==KErrNone)
+		{
+		TUint count = result2->Count();
+		TEST(count == 0);
+		}
+
+	//Delete file
+	utils.DeleteFileL(_L("c:\\system\\data\\Mimepath\\mime_content000.canyoutell"));
+
+	//Remove test directory
+	DeleteDirL(&utils, ptrMimeDir);
+
+	// Cleanup
+	CleanupStack::PopAndDestroy(&utils);//utils
+	CleanupStack::PopAndDestroy(result2);//result1
+	CleanupStack::PopAndDestroy(result1);//result2
+	CleanupStack::PopAndDestroy(active);//active
+
+ }
+
+/**
+ @SYMTestCaseID	T_Serv3Step_DoAsyncRecognizerTest11L
+
+ @SYMPREQ 699
+
+ @SYMREQ  3989 3899
+
+ @SYMTestCaseDesc	Test PREQ699.14.0 Validates cache functionality with substituted directory
+
+ @SYMTestPriority 	High
+
+ @SYMTestStatus 	Implemented
+
+ @SYMTestActions	Recognize a directory. Substitute a directory of the same name with
+ 				different contents and repeat the recognition. Ensure that the file
+ 				contents are correctly listed.
+
+ API Calls:\n
+ 				RApaLsSession::RecognizeFilesL(const TDesC& aPath,
+ 												const TDesC8& aDataType,
+ 												CDataRecognitionResultArray& aResult,
+												TRequestStatus& aStatus);
+ 				CDataRecognitionResultArray::CDataRecognitionResultArray();
+ 				CDataRecognitionResultArray::Count() const;
+
+ @SYMTestExpectedResults\n
+ 				status = KErrNone for file creation
+  				count  = 4 	CDataRecognitionResultArray::Count returns four entries of MIME type "text/html"
+				status = KErrNone for file content changed to text
+				count  = 2 CDataRecognitionResultArray::Count returns two entries of MIME type "text/html"
+ */
+void CT_Serv3Step::DoAsyncFolderRecognizerTest11L(RApaLsSession& aLs)
+	{
+	_LIT(KMimeDir1,"c:\\system\\data\\Mimepath1\\");
+	_LIT(KMimeDir2,"c:\\system\\data\\Mimepath2\\");
+
+	_LIT(KMimeDir1Html,"c:\\system\\data\\Mimepath1\\dir1_html");
+	_LIT(KMimeDir1Text,"c:\\system\\data\\Mimepath1\\dir1_text");
+	_LIT(KMimeDir2Html,"c:\\system\\data\\Mimepath2\\dir2_html");
+	_LIT(KMimeDir2Text,"c:\\system\\data\\Mimepath2\\dir2_text");
+
+	//After directory renaming
+	_LIT(KRenameHtml,"c:\\system\\data\\Mimepath1\\dir2_html");
+	_LIT(KRenameText,"c:\\system\\data\\Mimepath1\\dir2_text");
+
+	TBufC<50> mimeDir1(KMimeDir1);
+    TPtr ptrMimeDir1 (mimeDir1.Des());
+
+	TBufC<50> mimeDir2(KMimeDir2);
+    TPtr ptrMimeDir2 (mimeDir2.Des());
+
+	TBufC<50> mimeDir1Html(KMimeDir1Html);
+    TPtr ptrFile1x4(mimeDir1Html.Des());
+
+	TBufC<50> mimeDir1Text(KMimeDir1Text);
+    TPtr ptrFile1x2(mimeDir1Text.Des());
+
+	TBufC<50> mimeDir2Html(KMimeDir2Html);
+    TPtr ptrFile2x2(mimeDir2Html.Des());
+
+	TBufC<50> mimeDir2Text(KMimeDir2Text);
+    TPtr ptrFile2x4(mimeDir2Text.Des());
+
+	TBufC<50> renameText(KRenameText);
+    TPtr ptrRenameText(renameText.Des());
+
+	TBufC<50> renameHtml(KRenameHtml);
+    TPtr ptrRenameHtml(renameHtml.Des());
+
+	//"Asynchronous folder file recognition Test Group 14
+
+	//Setup Active Object
+	CActiveTest2* active = new(ELeave) CActiveTest2();
+	CleanupStack::PushL(active);
+
+	CDataRecognitionResultArray* result1 = new(ELeave) CDataRecognitionResultArray();
+	CDataRecognitionResultArray* result2 = new(ELeave) CDataRecognitionResultArray();
+	CleanupStack::PushL(result1);
+	CleanupStack::PushL(result2);
+
+	RFs	theFS;
+ 	theFS.Connect();
+ 	RFile file;
+
+	RSmlTestUtils utils;
+	CleanupClosePushL(utils);
+
+	//Create directories for test files
+	CreateDirL(&utils, ptrMimeDir1);
+	CreateDirL(&utils, ptrMimeDir2);
+
+	//Timestamp details for files
+	TTime time;
+	time.UniversalTime();
+
+	TTime aLaterTime(time);
+	TTimeIntervalMinutes aInterval(1);
+	aLaterTime+=(aInterval);
+
+	// Fill the first directory with files
+	// Create files dir1_html000.html - dir1_html003.html with html content
+	// Create files dir1_text000.txt - dir1_text001.txt with text content
+	CreateFilesL(theFS, file, ptrFile1x4, (TDesC&)KSuffixHtml, 4, KHtmlContent, time);
+	CreateFilesL(theFS, file, ptrFile1x2, (TDesC&)KSuffixText, 2, KTextContent, time);
+
+	// Fill the second directory with files
+	// Create files dir2_text000.txt - dir2_text003.txt with text content
+	// Create files dir2_html001.html - dir2_html002.html with html content
+	CreateFilesL(theFS, file, ptrFile2x4, (TDesC&)KSuffixText, 4, KTextContent, time);
+	CreateFilesL(theFS, file, ptrFile2x2, (TDesC&)KSuffixHtml, 2, KHtmlContent, time);
+
+    //Test RecognizeFilesL on first directory with a MIME type filter "text/html"
+ 	aLs.RecognizeFilesL(KMimeDir1,_L8("text/html"), *result1 ,active->iStatus);
+
+	active->StartL();//set active
+	CActiveScheduler::Start();
+
+	TEST(active->iStatus==KErrNone);
+	if (active->iStatus==KErrNone)
+		{
+		TUint count = result1->Count();
+		TEST(count == 4);
+		}
+
+
+	//Delete first directory (KMimeDir1) and rename second directory to be the
+	//first (KMimeDir2 -> KMimeDir1)
+	DeleteFilesL(&utils, ptrFile1x4, (TDesC&)KSuffixHtml, 4);
+	DeleteFilesL(&utils, ptrFile1x2, (TDesC&)KSuffixText, 2);
+	DeleteDirL(&utils, ptrMimeDir1);
+ 	utils.RenameDirectoryL(mimeDir2, mimeDir1);
+
+	INFO_PRINTF1(_L("Asynchronous folder file Recognition Test PREQ699.14.0"));
+    //Test RecognizeFilesL with a MIME type filter "text/html"
+ 	aLs.RecognizeFilesL(KMimeDir1,_L8("text/html"), *result2 ,active->iStatus);
+
+	active->StartL();//set active
+	CActiveScheduler::Start();
+
+	TEST(active->iStatus==KErrNone);
+	if (active->iStatus==KErrNone)
+		{
+		TUint count = result2->Count();
+		TEST(count == 2);
+		}
+
+	//Bin out all the remaining created files
+	DeleteFilesL(&utils, ptrRenameText, (TDesC&)KSuffixText, 4);
+	DeleteFilesL(&utils, ptrRenameHtml, (TDesC&)KSuffixHtml, 2);
+
+	//Remove test directory
+	DeleteDirL(&utils, ptrMimeDir1);
+
+	// Cleanup
+	CleanupStack::PopAndDestroy(4, active); // utils, result2, result1, active
+
+ }
+
+/**
+ @SYMTestCaseID	T_Serv3Step_DoSyncRecognizerTest4L
+
+ @SYMPREQ 699
+
+ @SYMREQ  3898
+
+ @SYMTestCaseDesc	Test PREQ699.15.0, PREQ699.15.1 Validates cache performance with a typical directory
+
+ @SYMTestPriority 	High
+
+ @SYMTestStatus 	Implemented
+
+ @SYMTestActions	1st Recognition - Recognize a directory that has significant file content
+ 					with the cache enabled and log the time taken.
+					15.0 Repeat the recognition on the directory, it should be faster than
+					the first recognition.
+					15.1 Alter a number of files and repeat, again logging the time. The time
+					taken should be faster than the 1st recognition, but slower than test 15.0
+
+
+ API Calls:\n
+ 				RApaLsSession::RecognizeFilesL(const TDesC& aPath,
+ 												const TDesC8& aDataType,
+ 												CDataRecognitionResultArray& aResult,
+												TRequestStatus& aStatus);
+ 				CDataRecognitionResultArray::CDataRecognitionResultArray();
+ 				CDataRecognitionResultArray::Count() const;
+
+ @SYMTestExpectedResults\n
+ 				status = KErrNone for file creation
+				15.0 Time taken faster than 1st recognition
+				15.1 Time taken faster than 1st recognition, but slower than 15.0
+ */
+void CT_Serv3Step::DoSyncFolderRecognizerTest4L(RApaLsSession& aLs)
+{
+	//Synchronous folder file recognition Test Group 15
+	_LIT(KTestAppSource, "Z:\\System\\data\\" );
+ 	_LIT(KTestAppDest, "C:\\System\\data\\TestPath\\" );
+ 	_LIT(KEmpty, "");
+
+ 	_LIT(KTestWaitingForApplistUpdate,"\nWaiting %d microseconds for applist to be updated");
+ 	const TInt KApplistUpdateTime = 8000000;
+
+	TBufC<128> fileDir(KEmpty);
+    TPtr ptrFileDir(fileDir.Des());
+
+	CDataRecognitionResultArray* result1 = new(ELeave) CDataRecognitionResultArray();
+	CDataRecognitionResultArray* result2 = new(ELeave) CDataRecognitionResultArray();
+	CDataRecognitionResultArray* result3 = new(ELeave) CDataRecognitionResultArray();
+
+	CleanupStack::PushL(result1);
+	CleanupStack::PushL(result2);
+	CleanupStack::PushL(result3);
+
+ 	RFs	theFS;
+ 	theFS.Connect();
+ 	RFile file;
+
+ 	// Remove Test app from the file system
+ 	CFileMan* fileManager = CFileMan::NewL (theFS);
+
+ 	INFO_PRINTF1(_L("Copying the app to C"));
+ 	TEST(KErrNone == fileManager->Copy (KTestAppSource, KTestAppDest, CFileMan::EOverWrite ));
+
+ 	INFO_PRINTF2(KTestWaitingForApplistUpdate, KApplistUpdateTime);
+ 	User::After(KApplistUpdateTime);
+
+	TTime time;
+	TTime timeLater;
+
+	//1st recognition
+	time.HomeTime();
+	TInt ret=aLs.RecognizeFilesL(KTestAppDest,*result1);
+	timeLater.HomeTime();
+	TEST(ret==KErrNone);
+	User::LeaveIfError(ret);
+
+	TTimeIntervalMicroSeconds delayNoCache = timeLater.MicroSecondsFrom(time);
+
+	INFO_PRINTF1(_L("Asynchronous folder file Recognition Test PREQ699.15.0"));
+	time.HomeTime();
+	ret=aLs.RecognizeFilesL(KTestAppDest,*result2);
+	timeLater.HomeTime();
+	TEST(ret==KErrNone);
+	User::LeaveIfError(ret);
+
+	TTimeIntervalMicroSeconds delayCache = timeLater.MicroSecondsFrom(time);
+
+	//Modify the timestamps on a few files
+	TInt count = result1->Count();
+	for(TInt i=1; i < (count/2); i++)
+		{
+		TDataRecognitionResult res;
+		result1->GetDataRecognitionResultL(res, i);
+		TFileName fileName;
+		result1->GetFileNameL(fileName, i);
+
+		ptrFileDir.Copy(KTestAppDest);
+		ptrFileDir.Append(fileName);
+
+   		time.HomeTime();
+   		theFS.SetModified(ptrFileDir, time);
+   		}
+
+ 	INFO_PRINTF2(KTestWaitingForApplistUpdate, KApplistUpdateTime);
+ 	User::After(KApplistUpdateTime);
+
+	INFO_PRINTF1(_L("Asynchronous folder file Recognition Test PREQ699.15.1"));
+	time.HomeTime();
+	ret=aLs.RecognizeFilesL(KTestAppDest,*result3);
+	timeLater.HomeTime();
+	TEST(ret==KErrNone);
+	User::LeaveIfError(ret);
+
+	TTimeIntervalMicroSeconds delayCache2 = timeLater.MicroSecondsFrom(time);
+#ifndef __WINS__ 
+	// On Emulator, these time related checks cannot always be ensured.
+	TEST(delayCache2 > delayCache);
+	TEST(delayCache2 < delayNoCache);
+#endif
+
+   	// Cleanup
+   	delete fileManager;
+	CleanupStack::PopAndDestroy(3, result1); // result3, result2, result1
+}
+
+/**
+ @SYMTestCaseID	T_Serv3Step_DoAsyncRecognizerTest13L
+
+ @SYMPREQ 699
+
+ @SYMREQ  3899
+
+ @SYMTestCaseDesc	Test PREQ699.17.0 Validates performance of recognition.
+
+ @SYMTestPriority 	High
+
+ @SYMTestStatus 	Not Implemented
+
+ @SYMTestActions	Call RecognizeFilesL() without a filter on a directory
+ 				containing a text file named text.canyoutell
+
+ API Calls:\n
+ 				RApaLsSession::RecognizeFilesL(const TDesC& aPath,
+ 												const TDesC8& aDataType,
+ 												CDataRecognitionResultArray& aResult,
+												TRequestStatus& aStatus);
+ 				CDataRecognitionResultArray::CDataRecognitionResultArray();
+ 				CDataRecognitionResultArray::Count() const;
+
+ @SYMTestExpectedResults\n
+ 				status = KErrNone for file creation
+				count = 1 returned
+ */
+void CT_Serv3Step::DoAsyncFolderRecognizerTest13L(RApaLsSession& aLs)
+{
+	//Asynchronous folder file recognition Test Group 17
+	TBufC<50> mimeDir(KMimeDir);
+    TPtr ptrMimeDir (mimeDir.Des());
+
+	TBufC<350> mimeFile(KMimeFile);
+    TPtr ptrMimeFile(mimeFile.Des());
+
+	//Setup Active Object
+	CActiveTest2* active = new(ELeave) CActiveTest2();
+	CleanupStack::PushL(active);
+
+	CDataRecognitionResultArray* result = new(ELeave) CDataRecognitionResultArray();
+	CleanupStack::PushL(result);
+
+	RFs	theFS;
+ 	theFS.Connect();
+ 	RFile file;
+
+	RSmlTestUtils utils;
+	CleanupClosePushL(utils);
+
+	//Create directory for test files
+	CreateDirL(&utils, ptrMimeDir);
+
+	//Timestamp details for files
+	TTime time;
+	time.UniversalTime();
+
+	// Create file mime_content000.canyoutell  with text content
+	CreateFilesL(theFS, file, ptrMimeFile, (TDesC&)KSuffixUnknown, 1, KHtmlContent, time);
+
+	INFO_PRINTF1(_L("Asynchronous folder file Recognition Test PREQ699.17.0"));
+    //Test RecognizeFilesL with a MIME type filter "text/html"
+ 	aLs.RecognizeFilesL(KMimeDir,_L8("text/html"), *result ,active->iStatus);
+
+	active->StartL();//set active
+	CActiveScheduler::Start();
+
+	TEST(active->iStatus==KErrNone);
+	if (active->iStatus==KErrNone)
+		{
+		TUint count = result->Count();
+		TEST(count == 1);
+		}
+
+	DeleteFilesL(&utils, ptrMimeFile, (TDesC&)KSuffixUnknown, 1);
+
+	//Remove test directory
+	DeleteDirL(&utils, ptrMimeDir);
+
+	// Cleanup
+	CleanupStack::PopAndDestroy(&utils);//utils
+	CleanupStack::PopAndDestroy(result);//result2
+	CleanupStack::PopAndDestroy(active);//active
+
+}
+/*
+
+@SYMTestCaseID 		APPFWK-APPARC-0098 
+
+@SYMDEF 			INC125788   
+
+@SYMTestCaseDesc 	The test verify that RApaLsSession::CancelRecognizeFiles() complete TRequestStatus with KErrCancel 
+					that was passed to RApaLsSession::RecognizeFilesL() when cancelling the outstanding async recognition request. 
+
+@SYMTestPriority 	High   
+
+@SYMTestStatus 		Implemented
+
+@SYMTestActions 	
+1.RApaLsSession::RecognizeFilesL(const TDesC& aPath, CDataRecognitionResultArray& aResult, TRequestStatus& aStatus)
+is called to get data (MIME) types for files in a specified directory.
+2.Outstanding async recognition request is cancelled using RApaLsSession::CancelRecognizeFiles().
+
+@SYMTestExpectedResults
+RApaLsSession::CancelRecognizeFiles() complete the TRequestStatus with KErrCancel.
+ 
+*/
+void CT_Serv3Step::DoAsyncFolderRecognizerTest14L(RApaLsSession& aLs)
+	{
+	//Setup Active Object
+	CActiveTest2* active = new(ELeave) CActiveTest2();
+	CleanupStack::PushL(active);
+
+	CDataRecognitionResultArray* result = new(ELeave) CDataRecognitionResultArray();
+	CleanupStack::PushL(result);
+
+	//Check results and Stop AS
+	_LIT(KStandardDir,"z:\\system\\data\\Testpath\\");
+
+	INFO_PRINTF1(_L("Asynchronous RecognizeFilesL Test"));
+	aLs.RecognizeFilesL(KStandardDir,*result,active->iStatus);
+	active->StartL();//set active
+	TEST(active->iStatus==KRequestPending);
+	INFO_PRINTF2(_L("RecognizeFilesL: iStatus = %d\n"), active->iStatus.Int());
+	
+	aLs.CancelRecognizeFiles();
+	TEST(active->iStatus==KErrCancel);
+	INFO_PRINTF2(_L("CancelRecognizeFiles: iStatus = %d\n"), active->iStatus.Int());
+	CActiveScheduler::Start();
+	
+	// Cleanup
+	CleanupStack::PopAndDestroy(result);//result
+	CleanupStack::PopAndDestroy(active);//active
+	}
+/**
+* Auxiliary Fn for the entire Test Step
+*
+* This method initiates all the tests.
+*
+*/
+TInt CT_Serv3Step::DoServComTestL()
+	{
+	INFO_PRINTF1(_L("Testing Server Com"));
+
+	RFs theServFs;
+	TInt ret = theServFs.Connect();
+	TEST(ret==KErrNone);
+	CleanupClosePushL(theServFs);
+
+
+    RTestableApaLsSession ls;
+	ret = ls.Connect();
+	TEST(ret==KErrNone);
+	CleanupClosePushL(ls);
+	
+	//wait for CExtrasAppKeyLayout to open up a RApaLsSession so it doesn't mess with our result
+	//unsure why it affects this test but not the others
+	User::After(10000000);
+
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoSyncFolderRecognizerTest1L(ls), ls.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoSyncFolderRecognizerTest2L(ls), ls.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoSyncFolderRecognizerTest3L(ls), ls.FlushRecognitionCache() );
+	
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoAsyncFolderRecognizerTest1L(ls), ls.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoAsyncFolderRecognizerTest2L(ls), ls.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoAsyncFolderRecognizerTest3L(ls), ls.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoAsyncFolderRecognizerTest4L(ls), ls.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoAsyncFolderRecognizerTest5L(ls), ls.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoAsyncFolderRecognizerTest6L(ls), ls.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoAsyncFolderRecognizerTest7L(ls), ls.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoAsyncFolderRecognizerTest8L(ls), ls.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoAsyncFolderRecognizerTest9L(ls), ls.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoAsyncFolderRecognizerTest10L(ls), ls.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoAsyncFolderRecognizerTest11L(ls), ls.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoSyncFolderRecognizerTest4L(ls), ls.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoAsyncFolderRecognizerTest13L(ls), ls.FlushRecognitionCache() );
+	//DONT_CHECK Skips the heap check at server side. This heap imbalance occurs randomly in server side
+	// while canceling the outstanding async request.
+	HEAP_TEST_LS_SESSION(ls, 0, DONT_CHECK, DoAsyncFolderRecognizerTest14L(ls), ls.FlushRecognitionCache() );
+			
+	CleanupStack::PopAndDestroy(&ls);
+
+	// close the server session and we have done some type store reloading
+	CleanupStack::PopAndDestroy(&theServFs);
+
+	return KErrNone;
+	}
+
+
+
+TVerdict CT_Serv3Step::doTestStepPreambleL()
+/**
+ * @return - TVerdict code
+ * Override of base class virtual
+ */
+	{
+	SetTestStepResult(EPass);
+	return TestStepResult();
+	}
+
+TVerdict CT_Serv3Step::doTestStepPostambleL()
+/**
+ * @return - TVerdict code
+ * Override of base class virtual
+ */
+	{
+	return TestStepResult();
+	}
+
+void CT_Serv3Step::CreateDirL(RSmlTestUtils* aPtrUtils, TPtr aDirName)
+	{
+	User::LeaveIfError(aPtrUtils->Connect());
+	aPtrUtils->CreateDirectoryL(aDirName);
+
+ 	//Delay required to prevent armv5 failure
+  	const TInt KApplistUpdateTime = 800000;
+  	User::After(KApplistUpdateTime);
+	}
+
+void CT_Serv3Step::CreateFilesL(RFs& aFS, RFile& aFile, TPtr aFileRoot, TDesC& aSuffix, TInt aFileNumber, const TDesC8& aFileContent, TTime aTime = 0)
+	{
+	if(aTime == 0)
+		{
+		aTime.UniversalTime();
+		}
+
+	for(TInt counter=0; counter<aFileNumber; counter++)
+		{
+		aFileRoot.AppendNumFixedWidth(counter, EDecimal, KFixedNumWidth);
+    	aFileRoot.Append(aSuffix);
+
+		//Creates a file if does not already exist. If file exists,
+		//content is overwritten
+		TEST(KErrNone == aFile.Replace(aFS, aFileRoot, EFileWrite));
+
+		TEST(KErrNone == aFile.Write(aFileContent));
+		TEST(KErrNone == aFile.SetModified(aTime));
+   		TEST(KErrNone == aFile.Flush());
+    	aFile.Close();
+
+		TInt Length = aFileRoot.Length();
+		TInt DeleteLength = aSuffix.Length() + KFixedNumWidth;
+		aFileRoot.Delete( (Length - DeleteLength) , DeleteLength);
+		}
+
+ 	//Delay required to prevent armv5 failure
+  	const TInt KApplistUpdateTime = 800000;
+  	User::After(KApplistUpdateTime);
+	}
+
+void CT_Serv3Step::DeleteDirL(RSmlTestUtils* aPtrUtils, TPtr aDirName)
+	{
+	aPtrUtils->DeleteDirectoryL(aDirName);
+	}
+
+void CT_Serv3Step::DeleteFilesL(RSmlTestUtils* aPtrUtils, TPtr aDirName, TDesC& aSuffix, TInt aFileNumber)
+	{
+	for(TInt counter=0; counter<aFileNumber; counter++)
+		{
+		aDirName.AppendNumFixedWidth(counter, EDecimal, KFixedNumWidth);
+    	aDirName.Append(aSuffix);
+		aPtrUtils->DeleteFileL(aDirName);
+		TInt Length = aDirName.Length();
+		TInt DeleteLength = aSuffix.Length() + KFixedNumWidth;
+		aDirName.Delete( (Length - DeleteLength) , DeleteLength);
+		}
+	}
+
+TVerdict CT_Serv3Step::doTestStepL()
+/**
+ * Override of base class virtual.
+ * @return - TVerdict code
+ */
+{
+	FbsStartup();
+	TInt ret = RFbsSession::Connect();
+	TEST(ret==KErrNone);
+
+	// run the testcode (inside an alloc heaven harness)
+	INFO_PRINTF1(_L("About to start tests:"));
+	TRAP(ret,DoServComTestL());
+	INFO_PRINTF2(_L("  DoServComTestL completes with %d"), ret);
+	TEST(ret==KErrNone);
+
+	INFO_PRINTF1(_L("Test Completed!"));
+	return TestStepResult();
+
+}
+
+
+/**
+*
+* Methods for Active Object Test
+*
+* Used in for Asynchronous Data Recognizer tests
+*
+*/
+
+CActiveTest2::CActiveTest2()
+	:CActive(0)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+CActiveTest2::~CActiveTest2()
+	{
+	Cancel();
+	}
+
+void CActiveTest2::DoCancel()
+	{
+	TRequestStatus* s=&iStatus;
+	User::RequestComplete(s, KErrNone);
+	}
+
+void CActiveTest2::StartL()
+	{
+	SetActive();
+	}
+
+void CActiveTest2::RunL()
+	{
+	//Stop AS
+	CActiveScheduler::Stop();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_Serv3Step.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,87 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#if (!defined __T_SERV3_STEP_H__)
+#define __T_SERV3_STEP_H__
+
+#include "ApparcTestServer.h"
+#include "appfwk_test_utils.h"
+
+//!  A CT_Serv3Step test class.
+/*!
+  This class tests wrapper to Application Architecture Server.
+*/
+class CT_Serv3Step :public CTestStep
+	{
+public:
+	CT_Serv3Step();
+	~CT_Serv3Step();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+private:
+	void DoSyncFolderRecognizerTest1L(RApaLsSession& aLs);
+	void DoSyncFolderRecognizerTest2L(RApaLsSession& aLs);
+	void DoSyncFolderRecognizerTest3L(RApaLsSession& aLs);
+	void DoAsyncFolderRecognizerTest1L(RApaLsSession& aLs);
+	void DoAsyncFolderRecognizerTest2L(RApaLsSession& aLs);
+	void DoAsyncFolderRecognizerTest3L(RApaLsSession& aLs);
+	void DoAsyncFolderRecognizerTest4L(RApaLsSession& aLs);
+	void DoAsyncFolderRecognizerTest5L(RApaLsSession& aLs);
+	void DoAsyncFolderRecognizerTest6L(RApaLsSession& aLs);
+	void DoAsyncFolderRecognizerTest7L(RApaLsSession& aLs);
+	void DoAsyncFolderRecognizerTest8L(RApaLsSession& aLs);
+	void DoAsyncFolderRecognizerTest9L(RApaLsSession& aLs);
+	void DoAsyncFolderRecognizerTest10L(RApaLsSession& aLs);
+	void DoAsyncFolderRecognizerTest11L(RApaLsSession& aLs);
+	void DoSyncFolderRecognizerTest4L(RApaLsSession& aLs);
+	void DoAsyncFolderRecognizerTest13L(RApaLsSession& aLs);
+	void DoAsyncFolderRecognizerTest14L(RApaLsSession& aLs);
+	TInt DoServComTestL();
+	void testBooleanTruer(TBool aCondition, const TText8* aFile, TInt aLine);
+	
+private:
+	void CreateDirL(RSmlTestUtils* aPtrUtils, TPtr aDirName);
+	void DeleteDirL(RSmlTestUtils* aPtrUtils, TPtr aDirName);
+	void DeleteFilesL(RSmlTestUtils* aPtrUtils, TPtr aDirName, TDesC& aSuffix, TInt aFileNumber);
+	void CreateFilesL(RFs& aFS, RFile& aFile, TPtr aDirName, TDesC& aSuffix, TInt aFileNumber, const TDesC8& aFileContent, TTime aTime);
+	CActiveScheduler* iActiveScheduler;
+	};
+
+//////////////////////////////////////////////////////////////////////////////
+//	CActiveTest2::ActiveTest class definition
+//
+class CActiveTest2 : public CActive
+	{
+	public:
+		CActiveTest2();
+		~CActiveTest2();
+		void StartL();
+
+	protected:
+		void DoCancel();
+		void RunL();
+	};
+
+_LIT(KT_Serv3Step,"T_Serv3");
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_ServiceRegistryStep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,346 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#include "T_ServiceRegistryStep.h"
+#include <ServiceRegistry.h>
+#include "testableapalssession.h"
+#include "appfwk_test_utils.h"
+
+/**
+ * Constructor
+ */	
+CT_ServiceRegistryTestStep::CT_ServiceRegistryTestStep()
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_ServiceRegistryStep);
+	}
+
+/**
+ * Destructor
+ */
+CT_ServiceRegistryTestStep::~CT_ServiceRegistryTestStep()
+	{
+	}
+
+/**
+ * @return - TVerdict code
+ * Override of base class virtual
+ */	
+TVerdict CT_ServiceRegistryTestStep::doTestStepPreambleL()
+	{
+	SetTestStepResult(EPass);
+	return TestStepResult();
+	}
+
+/**
+ * @return - TVerdict code
+ * Override of base class virtual
+ */
+TVerdict CT_ServiceRegistryTestStep::doTestStepPostambleL()
+	{
+	return TestStepResult();
+	}
+
+TVerdict CT_ServiceRegistryTestStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Testing Apparc...T_ServiceRegistry Test Cases Running..."));
+
+    // start an active scheduler
+    iScheduler=new(ELeave) CActiveScheduler();
+    CActiveScheduler::Install(iScheduler);
+    
+	__UHEAP_MARK;
+	TInt ret;
+	TRAP(ret,RunTestCasesL())
+	TEST(ret==KErrNone);
+	__UHEAP_MARKEND;
+	
+	INFO_PRINTF1(_L("...T_ServiceRegistry Test Cases Completed."));
+
+	return TestStepResult();
+	}
+
+TInt CT_ServiceRegistryTestStep::RunTestCasesL()
+	{
+	RTestableApaLsSession ls;
+	TEST(KErrNone == ls.Connect());
+	CleanupClosePushL(ls);
+
+	// Use DONT_CHECK because it complaints of heap unbalance (a CTypeStoreManager object, althought it is not actually leaked,
+	//   but reallocated in CApaAppListServer::DoUpdateTypeStoreL(void)). 
+	//   This unbalance happens 'randonmly', possibly a timing issue, as the TypeStore refresh is performed in response to a callback from 
+	//	 a CApaFsMonitor object, which introduces an extra 0.25 second delay before invoking the callback.
+	//	 *** See DEF101056 ****
+	HEAP_TEST_LS_SESSION(ls, 0, DONT_CHECK, TestAssociation1L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(ls, 0, DONT_CHECK, TestAppForDataTypeAndServiceL(ls), NO_CLEANUP);
+    HEAP_TEST_LS_SESSION(ls, 0, DONT_CHECK, TestUpdateOfServiceRegistryOnAppUninstallationL(ls), NO_CLEANUP);
+    
+	CleanupStack::PopAndDestroy(&ls);	
+	return KErrNone;
+	}
+	
+/**
+   @SYMTestCaseID T-ServiceRegistryTestStep-TestAssociation1L
+  
+   @SYMPREQ 
+  
+   @SYMTestCaseDesc Test the functionality of ServiceRegistry 
+   
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Tests the addition, retrieval and deletions of 
+   associations
+   
+   @SYMTestExpectedResults The association are added, retrieved and deleted
+   from the registry
+ */
+void CT_ServiceRegistryTestStep::TestAssociation1L()
+	{
+	INFO_PRINTF1(_L("TestAssociation1L"));
+	CServiceRegistry* registry = CServiceRegistry::NewL();
+	CleanupStack::PushL(registry);
+	
+	const TUid uid1 = { 0x11111111 };
+	const TUid uid2 = { 0x22222222 };
+	
+	const TUid serviceUid1 = { 0x00001111 };
+	const TUid serviceUid2 = { 0x00002222 };
+
+	const TDataType data1(uid1);
+	const TDataType data2(uid2);
+	
+	TUid result;
+	
+	TInt err = registry->GetDefault(serviceUid1, data1, result);
+	TEST(err == KErrNotFound);
+	TEST(result == KNullUid);
+	
+	err = registry->SetDefault(serviceUid1, data1, uid1);
+	TEST(err == KErrNone);
+	err = registry->SetDefault(serviceUid2, data2, uid2);
+	TEST(err == KErrNone);
+	
+	err = registry->GetDefault(serviceUid1, data1, result);
+	TEST(err == KErrNone);
+	TEST(result == uid1);
+	
+	err = registry->GetDefault(serviceUid2, data2, result);
+	TEST(err == KErrNone);
+	TEST(result == uid2);
+	
+	err = registry->RemoveEntry(serviceUid1, data1);
+	TEST(err == KErrNone);
+	
+	err = registry->RemoveEntry(serviceUid1, data1);
+	TEST(err == KErrNotFound);
+	
+	err = registry->GetDefault(serviceUid1, data1, result);
+	TEST(err == KErrNotFound);
+	TEST(result == KNullUid);
+	
+	err = registry->GetDefault(serviceUid2, data2, result);
+	TEST(err == KErrNone);
+	TEST(result == uid2);
+	
+	err = registry->RemoveEntry(serviceUid2, data2);
+	TEST(err == KErrNone);
+	
+	err = registry->GetDefault(serviceUid2, data2, result);
+	TEST(err == KErrNotFound);
+	TEST(result == KNullUid);
+	
+	CleanupStack::PopAndDestroy(registry);
+	}
+	
+/**
+   @SYMTestCaseID T-ServiceRegistryTestStep-TestAppForDataTypeAndServiceL
+  
+   @SYMPREQ 
+  
+   @SYMTestCaseDesc Test the functionality of ServiceRegistry 
+   
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Tests that the RApaLsSession::AppForDataTypeAndService
+   function behaves correctly when associations are added to the registry
+   
+   @SYMTestExpectedResults The correct application is returned
+ */
+void CT_ServiceRegistryTestStep::TestAppForDataTypeAndServiceL(RApaLsSession& aLs)
+	{
+	INFO_PRINTF1(_L("TestAppForDataTypeAndServiceL"));
+
+	const TUid KUidServerApp = {0x10004c56};
+	const TUid KUidServerApp2 = {0x10004c58};
+	const TUid KUidServerAppDummy = {0x12344268};
+	const TUid KUidService01020333 = {0x01020333};
+	_LIT8(KLitMimeTypePriority,"text/priority");
+
+	CServiceRegistry* registry = CServiceRegistry::NewL();
+	CleanupStack::PushL(registry);
+
+	// Check first the default association (no association in registry)
+	TUid appUid;
+	TInt err = aLs.AppForDataTypeAndService(TDataType(KLitMimeTypePriority), KUidService01020333,appUid);
+	TEST(err == KErrNone);
+	TEST(appUid == KUidServerApp);
+
+	// Check after having added an association in the registry
+	err = registry->SetDefault(KUidService01020333, TDataType(KLitMimeTypePriority), KUidServerApp2);
+	TEST(err == KErrNone);
+
+	err = aLs.AppForDataTypeAndService(TDataType(KLitMimeTypePriority), KUidService01020333,appUid);
+	TEST(err == KErrNone);
+	TEST(appUid == KUidServerApp2);
+
+	err = registry->RemoveEntry(KUidService01020333, TDataType(KLitMimeTypePriority));
+	TEST(err == KErrNone);
+
+	err = aLs.AppForDataTypeAndService(TDataType(KLitMimeTypePriority), KUidService01020333,appUid);
+	TEST(err == KErrNone);
+	TEST(appUid == KUidServerApp);
+
+	// Check association with app that doesn't exist
+	err = registry->SetDefault(KUidService01020333, TDataType(KLitMimeTypePriority), KUidServerAppDummy);
+	TEST(err == KErrNone);
+
+	err = aLs.AppForDataTypeAndService(TDataType(KLitMimeTypePriority), KUidService01020333,appUid);
+	TEST(err == KErrNone);
+	TEST(appUid == KUidServerApp);
+
+	err = registry->RemoveEntry(KUidService01020333, TDataType(KLitMimeTypePriority));
+	TEST(err == KErrNone);
+
+	err = aLs.AppForDataTypeAndService(TDataType(KLitMimeTypePriority), KUidService01020333,appUid);
+	TEST(err == KErrNone);
+	TEST(appUid == KUidServerApp);
+
+	CleanupStack::PopAndDestroy(registry);
+	}
+
+/**
+   @SYMTestCaseID APPFWK-APPARC-0104
+  
+   @SYMDEF INC138417 
+  
+   @SYMTestCaseDesc Tests whether a data mapping of an applicaiton is removed from 
+                    service registry if that applicaiton is uninstalled.
+   
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Inserts data mapping for an applicaion and uninstalls that application.
+                   Tests whether the inserted data mapping is removed from the service registry. 
+   
+   @SYMTestExpectedResults The inserted data mapping is removed from the service registry.
+ */
+
+void CT_ServiceRegistryTestStep::TestUpdateOfServiceRegistryOnAppUninstallationL(RApaLsSession& aLs)   
+    {
+    INFO_PRINTF1(_L("TestUpdateOfServiceRegistryOnAppUninstallationL"));
+    RSmlTestUtils fs;
+    CleanupClosePushL(fs);
+    User::LeaveIfError(fs.Connect());
+
+     _LIT(KImportAppsDir,"c:\\private\\10003a3f\\import\\apps\\");
+     
+     TInt err = fs.CreateDirectoryL(KImportAppsDir);
+     TESTEL((err == KErrNone || err == KErrAlreadyExists), err);
+     INFO_PRINTF1(_L("c:\\private\\10003a3f\\import\\apps is created successfully or already exists"));
+
+     
+     // Copy TestUpdRegAppUninstallation_reg.rsc from z:\ to c:\private\10003a3f\import\apps\.
+     _LIT(KAppRscSourcePath,"z:\\system\\data\\TestUpdRegAppUninstallation_reg.rsc");
+     _LIT(KAppRscTargetPath,"c:\\private\\10003a3f\\import\\apps\\TestUpdRegAppUninstallation_reg.rsc");
+     
+     err = fs.CopyFileL(KAppRscSourcePath, KAppRscTargetPath);
+     TEST(err == KErrNone);
+     INFO_PRINTF1(_L("Successfully copied TestUpdRegAppUninstallati on_reg.rsc from Z:\\system\\data to c:\\private\\10003a3f\\import\\apps"));
+
+     CServiceRegistry* registry = CServiceRegistry::NewL();
+     CleanupStack::PushL(registry);
+     
+     //Wait till the application scanning is completed.
+     CTestApplistChangeObserver* obs = new(ELeave) CTestApplistChangeObserver();
+     CleanupStack::PushL(obs);
+     CApaAppListNotifier* notif = CApaAppListNotifier::NewL(obs, CActive::EPriorityHigh);
+     CleanupStack::PushL(notif);
+     obs->iNotifier = notif;
+     CActiveScheduler::Start();
+     INFO_PRINTF1(_L("Applicaiton scanning is completed."));
+     CleanupStack::PopAndDestroy(notif);
+ 
+     TUid uid1 = {0x10207f80};
+     TUid resultUid={KNullUidValue};    
+     _LIT8(KLitMimeType,"mime/updregappuninstall");
+     TDataType dataType (KLitMimeType);
+     
+     //Test whether 0x10207f80 application is in application list.
+     TApaAppInfo appInfo;
+     TEST(aLs.GetAppInfo(appInfo,uid1)==KErrNone);
+
+     //Set 0x10207f80 as default application for "mime/updregappuninstall" MIME type.
+     registry->SetDefault(KOpenServiceUid,dataType, uid1);
+     registry->GetDefault(KOpenServiceUid,dataType, resultUid);
+     TEST(uid1==resultUid);
+ 
+     TInt fileExists = EFalse;
+     fs.IsFilePresent(KAppRscTargetPath, fileExists);
+     if (fileExists)
+         {
+         fs.ChangeFilePermissionL(KAppRscTargetPath); // clear readonly attribute inherited from z:
+         err = fs.DeleteFileL(KAppRscTargetPath);
+         if(err == KErrNone) 
+             INFO_PRINTF1(_L("Removed file TestUpdRegAppUninstallation_reg.rsc"));
+         else 
+             INFO_PRINTF1(_L("Failed to remove TestUpdRegAppUninstallation_reg.rsc"));    
+         }
+
+     //Wait till the application scanning is completed
+     notif = CApaAppListNotifier::NewL(obs, CActive::EPriorityHigh);
+      CleanupStack::PushL(notif);
+      obs->iNotifier = notif;
+      CActiveScheduler::Start();
+      INFO_PRINTF1(_L("Applicaiton scanning is completed."));
+      CleanupStack::PopAndDestroy(notif);
+      CleanupStack::PopAndDestroy(obs);    
+     
+     //Check the application is removed form the application list
+     TEST(aLs.GetAppInfo(appInfo,uid1)==KErrNotFound);
+     
+     //Check data mappings related to uninstalled applicaiton is also removed.
+     TEST(registry->GetDefault(KOpenServiceUid,dataType, resultUid)==KErrNotFound);
+
+     CleanupStack::PopAndDestroy(registry);
+     CleanupStack::PopAndDestroy(&fs);  
+    }
+
+void CTestApplistChangeObserver::HandleAppListEvent(TInt /*aEvent*/)
+    {
+    CActiveScheduler::Stop();    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_ServiceRegistryStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,59 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#if (!defined __T_SERVICEREGISTRY_STEP_H__)
+#define __T_SERVICEREGISTRY_STEP_H__
+
+#include "appfwk_test_AppUi.h"
+#include <apgnotif.h>
+
+class RApaLsSession;
+
+_LIT(KT_ServiceRegistryStep,"T_ServiceRegistry");
+
+class CT_ServiceRegistryTestStep : public CTestStep
+	{
+public:
+	CT_ServiceRegistryTestStep();
+	~CT_ServiceRegistryTestStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+	
+private:
+	TInt RunTestCasesL();
+	void TestAssociation1L();
+	void TestAppForDataTypeAndServiceL(RApaLsSession& aLs);
+    void TestUpdateOfServiceRegistryOnAppUninstallationL(RApaLsSession& aLs);   
+    CActiveScheduler* iScheduler;    
+    };
+    
+class CTestApplistChangeObserver : public CBase, public MApaAppListServObserver
+    {
+public: // from MApaAppListServObserver
+    void HandleAppListEvent(TInt aEvent);
+public:
+    CApaAppListNotifier* iNotifier;
+    };
+	
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_ServicesStep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1360 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+#include <barsread.h>
+#include "T_ServicesStep.h"
+
+_LIT(KCompleted, "Completed.");
+_LIT8(KLitPlainText,"text/plain");
+_LIT8(KLitPriorityText,"text/priority");
+_LIT8(KLitCustom1Text, "text/custom1");
+
+/**
+   Constructor
+ */	
+CT_ServicesTestStep::CT_ServicesTestStep()
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_ServicesStep);
+	}
+
+/**
+   Destructor
+ */
+CT_ServicesTestStep::~CT_ServicesTestStep()
+	{
+	iApaLsSession.Close();
+	}
+
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */	
+TVerdict CT_ServicesTestStep::doTestStepPreambleL()
+	{
+	SetTestStepResult(EPass);
+	TInt error = iApaLsSession.Connect();
+	TEST(error==KErrNone);
+	return TestStepResult();
+	}
+
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+TVerdict CT_ServicesTestStep::doTestStepPostambleL()
+	{
+	return TestStepResult();
+	}
+
+
+TVerdict CT_ServicesTestStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Testing Apparc...T_Services Test Cases Running..."));
+
+	TInt ret;
+	TRAP(ret,RunTestCasesL())
+		TEST(ret==KErrNone);
+	
+	INFO_PRINTF1(_L("...T_Services Test Cases Completed."));
+
+	return TestStepResult();
+	}
+
+TInt CT_ServicesTestStep::RunTestCasesL()
+	{
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery1L(), iApaLsSession.ClearAppInfoArray() );
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery2L(), iApaLsSession.ClearAppInfoArray() );
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery3L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery4L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery5L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery6(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery7L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery8L(), NO_CLEANUP);
+	// The following two APIs InsertDataMappingL() & DeleteDataMappingL(), update the type store on the server side.
+	// This update takes place on the server side while the test case is still running, which causes the heap check to fail.
+	// To avoid the heap check on the server side, DONT_CHECK macro is used.
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, DONT_CHECK, TestServiceDiscovery9(), NO_CLEANUP );
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery10L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery11L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery12L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery13L(), NO_CLEANUP);
+
+/**	
+	#ifndef __SECURE_BIN__
+	__UHEAP_MARK;
+	TRAP(r,TestServiceDiscovery14L());
+	TEST(r==KErrNone);
+	__UHEAP_MARKEND;
+	#endif
+	
+
+	#ifndef __SECURE_BIN__
+	__UHEAP_MARK;
+	TRAP(r,TestServiceDiscovery15L());
+	TEST(r==KErrNone);
+	__UHEAP_MARKEND;
+	#endif
+	
+	#ifndef __SECURE_BIN__
+	__UHEAP_MARK;
+	TRAP(r,TestServiceDiscovery16L());
+	TEST(r==KErrNone);
+	__UHEAP_MARKEND;
+	#endif
+*/
+	
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery17L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery18L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery19(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery20L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery21L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery22(), iApaLsSession.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery23(), iApaLsSession.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery24(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery25(), iApaLsSession.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery27(), iApaLsSession.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery28L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestOpenService1L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestCtrlPnlAppL(), NO_CLEANUP);
+	// The following two APIs InsertDataMappingL() & DeleteDataMappingL(), update the type store on the server side.
+	// This update takes place on the server side while the test case is still running, which causes the heap check to fail.
+	// To avoid the heap check on the server side, DONT_CHECK macro is used.
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, DONT_CHECK, TestPrioritySystemL(), NO_CLEANUP );
+	return (KErrNone);
+	}
+	
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery1L
+  
+   @SYMPREQ 538
+  
+   @SYMTestCaseDesc Test the functionality of GetServerApps with a service uid that is not provided by any application  
+   
+   @SYMTestPriority 
+   
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions Call GetServerApps with the service uid as parameter.
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::GetServerApps(TUid aServiceUid) const
+   
+   @SYMTestExpectedResults Returns  ENoMoreAppsInList  since no application provides a service represented by the uid
+    
+ */
+void CT_ServicesTestStep::TestServiceDiscovery1L()
+	{
+	INFO_PRINTF1(_L("TestServiceDiscovery1 about to start..."));
+	const TUid KUidService = {0x01020300}; // service Uid
+	TInt ret = iApaLsSession.GetServerApps(KUidService);//initialize the list of apps offering service
+	TEST(ret==KErrNone);// test if initalized properly
+	TApaAppInfo appInfo;
+	// populate the list with all the apps and return the first apps
+	ret = iApaLsSession.GetNextApp(appInfo);
+	TEST(ret == RApaLsSession::ENoMoreAppsInList);// since no apps implements this service, ENoMoreAppsInList is returned
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery2L
+  
+   @SYMPREQ 538
+  
+   @SYMTestCaseDesc Test the functionality of GetServerApps with uid that represents a service provided by more that one application 
+   
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions GetServerApps with a particular service uid as parameter, 
+   making sure that this service uid is used in at least one application 
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::GetServerApps(TUid aServiceUid) const
+   
+   @SYMTestExpectedResults Returns a list of all applications that offers this service
+    
+ */
+void CT_ServicesTestStep::TestServiceDiscovery2L()
+	{
+	INFO_PRINTF1(_L("TestServiceDiscovery2 about to start..."));	
+	const TUid KUidService1234 = {0x01020304};//uid of service
+	const TUid KUidServerApp1 = {0x10004c56}; //uid of one server app
+	const TUid KUidServerApp2 = {0x10004c57};//uid of second server app
+	TInt ret = iApaLsSession.GetServerApps(KUidService1234);
+	
+	TEST(ret==KErrNone);
+	TApaAppInfo appInfo;
+	ret = iApaLsSession.GetNextApp(appInfo);
+	TEST(ret==KErrNone);
+	TEST((appInfo.iUid==KUidServerApp2) || (appInfo.iUid==KUidServerApp1));
+	ret = iApaLsSession.GetNextApp(appInfo);
+	TEST((appInfo.iUid==KUidServerApp2) || (appInfo.iUid==KUidServerApp1));
+	ret = iApaLsSession.GetNextApp(appInfo);
+	TEST(ret == RApaLsSession::ENoMoreAppsInList);//only one app implements the service, ENoMoreAppsInList is returned
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery3L
+  
+   @SYMPREQ 538
+  
+   @SYMTestCaseDesc Test the functionality of GetAppServicesLC to get all the services provided by an application 
+   
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call GetAppServicesLC with the app uid as parameter
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::GetAppServicesLC(TUid aAppUid) const
+   
+   @SYMTestExpectedResults Returns an array of TApaAppServiceInfo objects. Each TApaAppServiceInfo contains details about a service uid and corresponding opaque data. 
+   The returned data should be the same as that defined in the registration files.
+   In the case where the app provides the same services but with different opaque data, it can be checked that the opaque data is different for each service.
+   In the case where a service does not have any defined opaque data, it can be checked that the length of the returned descriptor for the opaque data is zero.
+    
+ */
+void CT_ServicesTestStep::TestServiceDiscovery3L()
+	{
+	INFO_PRINTF1(_L("TestServiceDiscovery3 about to start..."));
+	const TUid KUidService1234 = {0x01020304};
+	const TUid KUidService2345 = {0x02030405};
+	const TUid KUidServerApp = {0x10004c56};
+	const TUid KUidService5678 = {0x05060708};
+	const TUid KUidService = {0x01020333};	
+
+	// get all services for a particular app
+	CApaAppServiceInfoArray* array = iApaLsSession.GetAppServicesLC(KUidServerApp);
+	TArray<TApaAppServiceInfo> serviceArray(array->Array());
+	TInt count = serviceArray.Count();
+	TEST(count == 6); // app provides 5 services + 1 legacy open; just to make sure that app provides more than one service
+
+	TPtrC8 opaqueData;
+	TResourceReader reader;
+	TPtrC16 theText;
+	TInt val(0);
+	
+	_LIT(KFirstService,"Non-localised text for service uid 0x01020304");
+	_LIT(KSecondService,"Non-localised text for service uid 0x02030405");
+	_LIT(KThirdService,"Non-localised resource A");
+	_LIT(KFourthService,"Non-localised resource B");
+	
+	TEST(serviceArray[0].Uid()==KOpenServiceUid);
+	const CArrayFixFlat<TDataTypeWithPriority>& datatypes = serviceArray[0].DataTypes();
+	TEST(datatypes.Count()==2);
+	TEST(0 == datatypes[0].iDataType.Des8().CompareF(KLitPlainText));
+	TEST(0 == datatypes[1].iDataType.Des8().CompareF(KLitPriorityText));
+	
+	
+	TEST(serviceArray[1].Uid()==KUidService1234);
+	opaqueData.Set(serviceArray[1].OpaqueData());
+	reader.SetBuffer(&opaqueData); // opaqueData is an LTEXT resource
+	theText.Set(reader.ReadTPtrC16());
+	User::LeaveIfError(val = theText.Compare(KFirstService));
+	TEST(val==KErrNone);
+	TEST(serviceArray[1].DataTypes().Count()==0);
+	
+	TEST(serviceArray[2].Uid()==KUidService2345);
+	opaqueData.Set(serviceArray[2].OpaqueData());
+	reader.SetBuffer(&opaqueData);
+	theText.Set(reader.ReadTPtrC16());
+	User::LeaveIfError(val=theText.Compare(KSecondService));
+	TEST(val==KErrNone);
+	const CArrayFixFlat<TDataTypeWithPriority>& datatypes2 = 
+		serviceArray[2].DataTypes();
+	TEST(datatypes2.Count()==1);
+	TEST(0 == datatypes2[0].iDataType.Des8().CompareF(KLitCustom1Text));
+	
+	TEST(serviceArray[3].Uid()==KUidService5678);
+	opaqueData.Set(serviceArray[3].OpaqueData());
+	reader.SetBuffer(&opaqueData); // opaqueData is an LTEXT resource
+	theText.Set(reader.ReadTPtrC16());
+	User::LeaveIfError(val = theText.Compare(KThirdService));
+	TEST(val==KErrNone);
+	TEST(serviceArray[3].DataTypes().Count()==0);
+	
+	TEST(serviceArray[4].Uid()==KUidService5678);
+	opaqueData.Set(serviceArray[4].OpaqueData());
+	reader.SetBuffer(&opaqueData);
+	theText.Set(reader.ReadTPtrC16());
+	User::LeaveIfError(val=theText.Compare(KFourthService));
+	TEST(val==KErrNone);
+	TEST(serviceArray[4].DataTypes().Count()==0);
+	
+	TUid myuid = serviceArray[5].Uid();
+	TEST(myuid==KUidService);
+	opaqueData.Set(serviceArray[5].OpaqueData());
+	TEST(opaqueData.Length()==0);
+	TEST(serviceArray[5].DataTypes().Count()==0);
+	
+	CleanupStack::PopAndDestroy(array); // the servicearray
+	array = NULL;
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery4L
+  
+   @SYMPREQ 538
+  
+   @SYMTestCaseDesc Test the functionality of GetServiceImplementationsLC 
+   which gets all the implementation details about a specific service 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call GetServiceImplementationsLC with the service uid as parameter
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::GetServiceImplementationsLC(TUid aServiceUid) const
+   
+   @SYMTestExpectedResults Returns an array of TApaAppServiceInfo objects. 
+   The size of the array is equal to the number of apps offering this service. 
+   Each TApaAppServiceInfo contain an app uid and  the respective opaquedata. 
+   The returned data should be the same as that defined in the registration files.
+    
+ */
+void CT_ServicesTestStep::TestServiceDiscovery4L()
+	{
+	INFO_PRINTF1(_L("TestServiceDiscovery4 about to start..."));
+	const TUid KUidService1234 = {0x01020304};
+	const TUid KUidServerApp1 = {0x10004c56};
+	const TUid KUidServerApp2 = {0x10004c57};
+	CApaAppServiceInfoArray* array = iApaLsSession.GetServiceImplementationsLC(KUidService1234);
+	TArray<TApaAppServiceInfo> implArray(array->Array());
+	TInt count = implArray.Count();	
+	TEST(count==2);
+	_LIT(KService,"Non-localised text for service uid 0x01020304");
+	TPtrC8 opaqueData;
+	TResourceReader reader;
+	TPtrC16 theText;
+	TInt val(0);
+
+	TUid myuid = implArray[0].Uid(); 
+	// The services can appear in any order
+	if (myuid==KUidServerApp1)
+		{
+		TEST(myuid==KUidServerApp1);
+		myuid = implArray[1].Uid();
+		TEST(myuid==KUidServerApp2);
+		const CArrayFixFlat<TDataTypeWithPriority>& datatypes = implArray[1].DataTypes();
+		TEST(datatypes.Count()==1);
+		TEST(0 == datatypes[0].iDataType.Des8().CompareF(KLitCustom1Text));
+		}
+	else if (myuid==KUidServerApp2)
+		{
+		TEST(myuid==KUidServerApp2);
+		myuid = implArray[1].Uid();
+		TEST(myuid==KUidServerApp1);
+		const CArrayFixFlat<TDataTypeWithPriority>& datatypes = implArray[0].DataTypes();
+		TEST(datatypes.Count()==1);
+		TEST(0 == datatypes[0].iDataType.Des8().CompareF(KLitCustom1Text));
+		}
+
+	opaqueData.Set(implArray[0].OpaqueData());
+	reader.SetBuffer(&opaqueData); // opaqueData is an LTEXT resource
+	theText.Set(reader.ReadTPtrC16());
+	User::LeaveIfError(val = theText.Compare(KService));
+	TEST(val==KErrNone);
+
+	opaqueData.Set(implArray[1].OpaqueData());
+	reader.SetBuffer(&opaqueData); // opaqueData is an LTEXT resource
+	theText.Set(reader.ReadTPtrC16());
+	User::LeaveIfError(val = theText.Compare(KService));
+	TEST(val==KErrNone);
+
+	CleanupStack::PopAndDestroy(array);
+	array = NULL;
+	}
+	
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery5L
+  
+   @SYMPREQ 538
+  
+   @SYMTestCaseDesc Test the functionality of GetAppServicesL which gets all the service uids of a particular app 
+   
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call GetAppServicesL with two parameters: the app uid and an array to put in the uid of the services 
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::GetAppServicesL(TUid aAppUid, CArrayFixFlat<TUid>& aServiceUids) const
+   
+   @SYMTestExpectedResults Populates the array with the uids of the services offered by this particular app. 
+   The returned data should be the same as that defined in the registration files. 
+    
+ */
+void CT_ServicesTestStep::TestServiceDiscovery5L()
+	{
+	INFO_PRINTF1(_L("TestServiceDiscovery5 about to start..."));
+	const TUid KUidServerApp = {0x10004c56};
+	const TUid KUidService1234 = {0x01020304};
+	const TUid KUidService2345 = {0x02030405};
+	const TUid KUidService5678 = {0x05060708};
+	const TUid KUidService = {0x01020333};
+	// get UIDs of all services implemented by an app
+	CArrayFixFlat<TUid>* uidArray = new(ELeave) CArrayFixFlat<TUid>(4);
+	CleanupStack::PushL(uidArray);
+	iApaLsSession.GetAppServicesL(KUidServerApp,*uidArray);
+	TInt count = uidArray->Count();
+	TUid uid;
+	if(count>0)
+		{
+		TEST(count==6);	// Takes into account the open service
+		uid = (*uidArray)[0];
+		TEST(uid==KUidService);
+		uid = (*uidArray)[1];
+		TEST(uid==KUidService5678);
+		uid = (*uidArray)[2];
+		TEST(uid==KUidService5678);
+		uid = (*uidArray)[3];
+		TEST(uid==KUidService2345);
+		uid = (*uidArray)[4];
+		TEST(uid==KUidService1234);
+		}
+	CleanupStack::PopAndDestroy(uidArray);
+	uidArray = NULL;
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery6
+  
+   @SYMPREQ 538
+  
+   @SYMTestCaseDesc Test for the functionality AppForDataTypeAndService in the case where two apps 
+   provides have the same datatype definition in their registration file. One app offers the requested 
+   service but has its priority assigned to normal while the other app does not offer the requested 
+   service and has its priority assigned to high 
+  
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call AppForDataTypeAndService with three parameters: the datatype, the service uid 
+   and an unitialised app uid
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::AppForDataTypeAndService(const TDataType& aDataType, TUid aServiceUid, TUid& aAppUid) const
+   
+   @SYMTestExpectedResults Sets the app uid to that of the app with lower priority since the one with higher 
+   priority does not offer this service
+    
+ */
+void CT_ServicesTestStep::TestServiceDiscovery6()
+	{
+	INFO_PRINTF1(_L("TestServiceDiscovery6 about to start..."));
+	const TUid KUidServerAppHigh = {0x10004c57};
+	const TUid KUidService = {0x02030405};
+	const TUid KUidServerAppNormal = {0x10004c56};	
+	_LIT8(KLitMimeTypeServerAppData,"text/priority");
+	TUid appUid;
+	TInt ret(0);
+	ret=iApaLsSession.AppForDataTypeAndService(TDataType(KLitMimeTypeServerAppData), KUidService,appUid);
+	TEST(ret==KErrNone);
+	TEST(appUid != KUidServerAppHigh);
+	TEST(appUid == KUidServerAppNormal);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery7L
+  
+   @SYMPREQ 538
+  
+   @SYMTestCaseDesc Given the size of data that is returned from the server is greater than the default 
+   1024 bytes of the buffer, test if a larger buffer is assigned in such cases
+   
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call GetAppServicesLC with the app uid as parameter. The size of the resource data in 
+   the registration file should be greater than the default size.
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::GetAppServicesLC(TUid aAppUid) const
+   
+   @SYMTestExpectedResults A larger buffer is allocated. The size of the buffer can be tested by checking 
+   the size of the returned data.
+    
+ */
+void CT_ServicesTestStep::TestServiceDiscovery7L()
+	{
+	INFO_PRINTF1(_L("TestServiceDiscovery7 about to start..."));
+	const TUid KUidServerApp = {0x10004c57};
+	// get all services for a particular app
+	CApaAppServiceInfoArray* array = iApaLsSession.GetAppServicesLC(KUidServerApp);
+	TArray<TApaAppServiceInfo> serviceArray(array->Array());
+	TInt count = serviceArray.Count();
+	TEST(count == 16);
+	TPtrC8 opaqueData;
+	TInt size(0);
+	for(TInt i=0;i<count;i++)
+		{
+			opaqueData.Set(serviceArray[i].OpaqueData());
+			size +=opaqueData.Length(); 
+		}
+	TEST(size>=1024);
+	CleanupStack::PopAndDestroy(array); // the servicearray	
+	array = NULL;
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery8L
+  
+   @SYMPREQ 538
+  
+   @SYMTestCaseDesc Test for the functionality of GetAppServiceOpaqueDataLC, particularly in the case 
+   where an app offers two services with the same uid but different opaque data
+   
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call GetAppServiceOpaqueDataLC with two parameters: an app uid and a service uid
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::GetAppServiceOpaqueDataLC(TUid aAppUid, TUid aServiceUid) const
+   
+   @SYMTestExpectedResults Returns an array of TApaAppServiceInfo objects. Each TApaAppServiceInfo object 
+   contains the same service uid but different opaque data. The returned data should be the same as that 
+   defined in the registration files.
+    
+ */
+void CT_ServicesTestStep::TestServiceDiscovery8L()
+	{
+	INFO_PRINTF1(_L("TestServiceDiscovery8 about to start..."));
+	const TUid KUidServerApp = {0x10004c56};
+	const TUid KUidService = {0x05060708};	
+	CApaAppServiceInfoArray* array = iApaLsSession.GetAppServiceOpaqueDataLC(KUidServerApp, KUidService);
+	TArray<TApaAppServiceInfo> implArray(array->Array());
+	TInt count = implArray.Count();
+	_LIT(KFirstService,"Non-localised resource A");
+	_LIT(KSecondService,"Non-localised resource B");
+	TPtrC8 opaqueData;
+	TResourceReader reader;
+	TPtrC16 theText;
+		if(count>0)
+		{
+		TEST(count==2);
+		
+		TEST(implArray[0].Uid()==KUidService);
+		opaqueData.Set(implArray[0].OpaqueData());
+		reader.SetBuffer(&opaqueData); // opaqueData is an LTEXT resource
+		theText.Set(reader.ReadTPtrC16());
+		TInt val(0);
+		User::LeaveIfError(val=theText.Compare(KSecondService));
+		TEST(val==KErrNone);
+		TEST(implArray[1].Uid()==KUidService);
+		opaqueData.Set(implArray[1].OpaqueData());
+		reader.SetBuffer(&opaqueData); // opaqueData is an LTEXT resource
+		theText.Set(reader.ReadTPtrC16());
+		User::LeaveIfError(val=theText.Compare(KFirstService));
+		TEST(val==KErrNone);	
+		}
+	
+	CleanupStack::PopAndDestroy(array);
+	array = NULL;
+	}
+	
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery9
+  
+   @SYMPREQ 538
+  
+   @SYMTestCaseDesc Test the functionality of AppForDataTypeAndService in the cases where 
+   (a) the datatype is not defined in the registration file 
+   (b) the data type is defined in the registration file
+   
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions (a)Call InsertDataMapping to make a mapping between the datatype and app. The parameters 
+   used are: the datatype object, the priority assigned and the app uid Call AppForDataTypeAndService with 
+   the three parameters: the data type, the service uid and an unitialised uid for the returning value. 
+   Call DeleteDataMapping with the datatype object as parameter to delete this mapping
+   (b) Call AppForDataTypeAndService with the three parameters: the data type, the service uid and an 
+   unitialised uid for the returning value.
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::AppForDataTypeAndService(const TDataType& aDataType, TUid aServiceUid, TUid& aAppUid) const
+   
+   @SYMTestExpectedResults (a) Returns the app uid of the app that has this datatype and service requested. 
+   It can be checked that the app uid corresponds to the app to which the mapping has been inserted.
+   (b) Returns the uid of the app that has this datatype and service uid defined in its registration file.
+    
+ */
+void CT_ServicesTestStep::TestServiceDiscovery9()
+	{
+	INFO_PRINTF1(_L("TestServiceDiscovery9 about to start..."));
+	const TUid KUidService1234 = {0x01020304};
+	const TUid KUidServerApp = {0x10004c56};
+
+	TInt ret(0);
+	// Start AppForDataTypeAndService test cases
+	// make sure our data mapping is removed before executing the following test cases
+	_LIT8(KLitMimeTypeServerApp,"serverapp/data");
+	_LIT8(KLitMimeTypeServerAppData,"text/plain");
+	ret = iApaLsSession.InsertDataMapping(TDataType(KLitMimeTypeServerApp),
+	 	1, KUidServerApp, KUidService1234); // need to remove magic number
+	TEST(ret==KErrNone);
+	// Waits till the data type mappings are restored from the data store ini file
+	iApaLsSession.WaitForTypeStoreUpdate();
+	TUid appUid;
+	ret=iApaLsSession.AppForDataTypeAndService(TDataType(KLitMimeTypeServerApp), KUidService1234,appUid);
+	TEST(ret==KErrNone);
+	// KUidServerApp2 handles KLitMimeTypeJpeg with a higher priority than KUidServerApp,
+	// but doesn't implement service KUidService1234, so KUidServerApp should be returned
+	TEST(appUid == KUidServerApp);
+	ret = iApaLsSession.DeleteDataMapping(TDataType(KLitMimeTypeServerApp),KUidService1234);
+	TEST(ret==KErrNone);
+	// Waits till the data type mappings are restored from the data store ini file
+	iApaLsSession.WaitForTypeStoreUpdate();
+	ret=iApaLsSession.AppForDataTypeAndService(TDataType(KLitMimeTypeServerAppData), KUidService1234,appUid);
+	TEST(ret==KErrNone);
+	TEST(appUid == KUidServerApp);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery10L
+  
+   @SYMPREQ 538
+  
+   @SYMTestCaseDesc Test the functionality of GetAppServicesLC on an app that does not provide any service
+   
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call GetAppServicesLC with the app uid as parameter
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::GetAppServicesLC(TUid aAppUid) const
+   
+   @SYMTestExpectedResults Returns KErrNotFound
+    
+ */
+void CT_ServicesTestStep::TestServiceDiscovery10L()
+	{
+	INFO_PRINTF1(_L("TestServiceDiscovery10 about to start..."));
+	const TUid KUidServerApp = {0x01023450};
+	TRAPD(r, iApaLsSession.GetAppServicesLC(KUidServerApp));
+	TEST(r==KErrNotFound);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery11L
+  
+   @SYMPREQ 538
+  
+   @SYMTestCaseDesc Test the functionality of GetServiceImplementationsLC using a service uid that is 
+   not defined in any registration file
+   
+   @SYMTestPriority high
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call GetServiceImplementationsLC using a service uid not defined in any registration file
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::GetServiceImplementationsLC(TUid aServiceUid) const
+   
+   @SYMTestExpectedResults Returns KErrNotFound
+    
+ */
+void CT_ServicesTestStep::TestServiceDiscovery11L()
+	{
+	INFO_PRINTF1(_L("TestServiceDiscovery11 about to start..."));
+	const TUid KUidService1230 = {0x01020300};
+	TRAPD(r, iApaLsSession.GetServiceImplementationsLC(KUidService1230));
+	TEST(r==KErrNotFound);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery12L
+  
+   @SYMPREQ 538
+  
+   @SYMTestCaseDesc Test the functionality of GetAppServicesL for an app that does not exist
+   
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call GetAppServicesL using an app uid that is not used by any app
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::GetAppServicesL(TUid aAppUid, CArrayFixFlat<TUid>& aServiceUids) const
+   
+   @SYMTestExpectedResults Returns KErrNotFound
+    
+ */
+void CT_ServicesTestStep::TestServiceDiscovery12L()
+	{
+	INFO_PRINTF1(_L("TestServiceDiscovery12 about to start..."));
+	const TUid KUidServerApp = {0x01020300};
+	CArrayFixFlat<TUid>* uidArray = new(ELeave) CArrayFixFlat<TUid>(4);
+	CleanupStack::PushL(uidArray);
+	TRAPD(r,iApaLsSession.GetAppServicesL(KUidServerApp,*uidArray));
+	CleanupStack::PopAndDestroy(uidArray);
+	TEST(r==KErrNotFound);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery13L
+  
+   @SYMPREQ 538
+  
+   @SYMTestCaseDesc Test the functionality of GetAppServiceOpaqueDataLC on an app that does 
+   not provide a particular service
+   
+   @SYMTestPriority 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Call GetAppServicesL using an existing app uid and service uid that is not 
+   defined in its registration file
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::GetAppServiceOpaqueDataLC(TUid aAppUid, TUid aServiceUid) const
+   
+   @SYMTestExpectedResults Returns KErrNotFound
+    
+ */
+ void CT_ServicesTestStep::TestServiceDiscovery13L()
+	{
+	INFO_PRINTF1(_L("TestServiceDiscovery13 about to start..."));	
+	const TUid KUidServerApp = {0x01023456};
+	const TUid KUidService = {0x05060708};	
+	TRAPD(r,iApaLsSession.GetAppServiceOpaqueDataLC(KUidServerApp, KUidService));
+	TEST(r==KErrNotFound);
+	}
+
+
+
+
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery17L
+  
+   @SYMPREQ 538
+  
+   @SYMTestCaseDesc Test the functionality of GetAppServicesLC on a app that has a localised 
+   resource defined in the registration file
+  
+   @SYMTestStatus Implemented
+
+   @SYMTestPriority  High
+   
+   @SYMTestActions  Call GetAppServicesLC with the app uid as parameter
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::GetAppServicesLC(TUid aAppUid) const
+   
+   @SYMTestExpectedResults Returns an array of TApaAppServiceInfo objects. 
+   Each TApaAppServiceInfo contains details about a service uid and corresponding opaque data. 
+   The returned data should be the same as that defined in the registration files.
+    
+ */
+void CT_ServicesTestStep::TestServiceDiscovery17L() 
+	{
+	INFO_PRINTF1(_L("TestServiceDiscovery17 about to start..."));
+	const TUid KUidService1235 = {0x01020305};
+	const TUid KUidServerApp = {0x10004c55};
+	CApaAppServiceInfoArray* array = iApaLsSession.GetAppServicesLC(KUidServerApp);
+	TArray<TApaAppServiceInfo> serviceArray(array->Array());
+	TInt count = serviceArray.Count();
+	TEST(count == 1);
+	TPtrC8 opaqueData;
+	TResourceReader reader;
+	TPtrC16 theText;
+	TInt val(0);
+	_LIT(KSecondService,"Localised text for service UID 0x01020305");
+	TEST(serviceArray[0].Uid()==KUidService1235);
+	opaqueData.Set(serviceArray[0].OpaqueData());
+	reader.SetBuffer(&opaqueData);
+	theText.Set(reader.ReadTPtrC16());
+	User::LeaveIfError(val=theText.Compare(KSecondService));
+	TEST(val==KErrNone);
+	CleanupStack::PopAndDestroy(array); // the servicearray
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery18L
+  
+   @SYMPREQ 538
+  
+   @SYMTestCaseDesc Test the functionality of GetAppServicesLC on a app that has a localised resource
+   defined but the link to the resource file not specified in the registration file
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestPriority  High	
+   
+   @SYMTestActions  Call GetAppServicesLC with the app uid as parameter
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::GetAppServicesLC(TUid aAppUid) const
+   
+   @SYMTestExpectedResults Returns KErrNone
+    
+ */
+void CT_ServicesTestStep::TestServiceDiscovery18L() 
+	{
+	INFO_PRINTF1(_L("TestServiceDiscovery18 about to start..."));	
+	const TUid KUidServerApp = {0x10004c54};
+	TRAPD(r, CleanupStack::PopAndDestroy(iApaLsSession.GetAppServicesLC(KUidServerApp)));
+	TEST(r==KErrNone);
+	}
+	
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery19
+  
+   @SYMPREQ 538
+  
+   @SYMTestPriority  High
+
+   @SYMTestCaseDesc Test the functionality of AppForDataTypeAndService in the cases where
+   (a) the datatype requested is undefined for a particular service uid
+   (b) the service uid is not defined for any app
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions  Call AppForDataTypeAndService with the three parameters: the data type, 
+   the service uid and an unitialised uid for the returning value.
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::AppForDataTypeAndService(const TDataType& aDataType, TUid aServiceUid, TUid& aAppUid) const
+   
+   @SYMTestExpectedResults In both cases, the app uid value is set to null
+    
+ */
+void CT_ServicesTestStep::TestServiceDiscovery19()
+	{
+	INFO_PRINTF1(_L("TestServiceDiscovery19 about to start..."));	
+	_LIT8(KLitMimeTypeServerAppData,"text/rubbish");
+	_LIT8(KLitMimeTypeServerApp,"serverapp/data");
+	TUid appUid=KNullUid;
+	TInt ret(0);
+	const TUid KUidService = {0x01020304};
+	const TUid KUidServiceUnused = {0x01020300};
+	ret=iApaLsSession.AppForDataTypeAndService(TDataType(KLitMimeTypeServerAppData), KUidService,appUid);
+	TEST(ret==KErrNone);
+	TEST(appUid == KNullUid);
+	ret=iApaLsSession.AppForDataTypeAndService(TDataType(KLitMimeTypeServerApp), KUidServiceUnused,appUid);
+	TEST(ret==KErrNone);
+	TEST(appUid == KNullUid);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery20L
+  
+   @SYMPREQ 538
+  
+   @SYMTestPriority  High
+
+   @SYMTestCaseDesc Test the functionality of GetAppServicesLC to get all the services 
+   provided by an application that does not exist
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions  Call GetAppServicesLC with the app uid as parameter
+ 
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::GetAppServicesLC(TUid aAppUid) const
+   
+   @SYMTestExpectedResults Returns KErrNotFound
+    
+ */	
+void CT_ServicesTestStep::TestServiceDiscovery20L()
+	{
+	INFO_PRINTF1(_L("TestServiceDiscovery20 about to start..."));
+	const TUid KUidServerApp = {0x10001111};
+	// get all services for a particular app
+	TRAPD(r,iApaLsSession.GetAppServicesLC(KUidServerApp));
+	TEST(r==KErrNotFound);			
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery21L
+  
+   @SYMPREQ 538
+  
+   @SYMTestPriority  High
+  
+   @SYMTestCaseDesc Test the functionality of GetAppServiceOpaqueDataLC on an app that does not exist
+   
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions  Call GetAppServiceOpaqueDataLC with two parameters: an app uid and a service uid
+ 
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::GetAppServiceOpaqueDataLC(TUid aAppUid, TUid aServiceUid) const
+   
+   @SYMTestExpectedResults Returns KErrNotFound
+    
+ */	
+void CT_ServicesTestStep::TestServiceDiscovery21L()
+	{
+	INFO_PRINTF1(_L("TestServiceDiscovery21L about to start..."));
+	const TUid KUidServerApp = {0x10004c58};
+	const TUid KUidService = {0x01020304};
+	// get all services for a particular app
+	TRAPD(r,iApaLsSession.GetAppServiceOpaqueDataLC(KUidServerApp,KUidService));
+	TEST(r==KErrNotFound);	
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery22
+  
+   @SYMPREQ 538
+  
+   @SYMTestPriority  High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestCaseDesc Test the functionality ofAppForDocumentAndService given an existing file name and service uid
+   
+   @SYMTestActions  Call AppForDocumentAndService with two parameters: a filename, a service uid, an
+   app uid and the datatype requested
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::AppForDocumentAndService(const TDesC& aFileName, TUid aServiceUid, TUid& aAppUid, TDataType& aDataType) const
+   
+   @SYMTestExpectedResults Returns KErrNone.It returns the first app that can offer this service and initialise the 
+   datatype that describes the datatype in the document
+    
+ */	
+void CT_ServicesTestStep::TestServiceDiscovery22()
+	{
+	// AppForDocumentAndService test cases
+	INFO_PRINTF1(_L("TestServiceDiscovery22 about to start..."));
+	TInt ret(0);
+	TUid appUid=KNullUid;
+	const TUid KUidService = {0x01020303};
+	TDataType dataType;
+	const TUid TUidExpected = {0x10004c54};
+	_LIT8(KLitMimeTypeServerData,"text/plain");
+    ret = iApaLsSession.AppForDocumentAndService(_L("z:\\system\\data\\one_byte.txt"), KUidService, appUid, dataType);	
+	TEST(ret==KErrNone);
+	TEST(dataType==TDataType(KLitMimeTypeServerData));
+	TEST(appUid==TUidExpected);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery23
+  
+   @SYMPREQ 538
+  
+   @SYMTestPriority  High
+  
+   @SYMTestStatus Implemented
+
+   @SYMTestCaseDesc Test the functionality ofAppForDocumentAndService given an existing file name and undefined service uid
+   
+   @SYMTestActions  Call AppForDocumentAndService with two parameters: a filename, a service uid, an
+   app uid and the datatype requested
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::AppForDocumentAndService(const TDesC& aFileName, TUid aServiceUid, TUid& aAppUid, TDataType& aDataType) const
+   
+   @SYMTestExpectedResults Returns KErrNone.The value returned for appuid is null.The datatype is set to the one that can desribe the
+   datatype in the document 
+    
+ */	
+void CT_ServicesTestStep::TestServiceDiscovery23()
+	{
+	// AppForDocumentAndService test cases
+	INFO_PRINTF1(_L("TestServiceDiscovery23 about to start..."));
+	TInt ret(0);
+	TUid appUid=KNullUid;
+	const TUid KUidService = {0x01120304};
+    TDataType dataType;
+    _LIT8(KLitMimeTypeServerData,"text/plain");
+    ret = iApaLsSession.AppForDocumentAndService(_L("z:\\system\\data\\one_byte.txt"), KUidService, appUid, dataType);	
+	TEST(ret==KErrNone);
+	TEST(appUid==KNullUid);
+	TEST(dataType==TDataType(KLitMimeTypeServerData));
+	}
+
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery24
+  
+   @SYMPREQ 538
+  
+   @SYMTestPriority  High
+  
+   @SYMTestStatus Implemented
+
+   @SYMTestCaseDesc Test the functionality ofAppForDocumentAndService given an undefined file name
+   
+   @SYMTestActions  Call AppForDocumentAndService with two parameters: a filename, a service uid, an
+   app uid and the datatype requested
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::AppForDocumentAndService(const TDesC& aFileName, TUid aServiceUid, TUid& aAppUid, TDataType& aDataType) const
+   
+   @SYMTestExpectedResults Returns KErrNone.The value returned for appuid is null.The returned value for the datatpe
+   is null.
+    
+ */	
+void CT_ServicesTestStep::TestServiceDiscovery24()
+	{
+	// AppForDocumentAndService test cases
+	INFO_PRINTF1(_L("TestServiceDiscovery24 about to start..."));
+	TInt ret(0);
+	TUid appUid=KNullUid;
+	const TUid KUidService = {0x01020304};
+    TDataType dataType;
+    ret = iApaLsSession.AppForDocumentAndService(_L(""), KUidService, appUid, dataType);	
+	TEST(ret==KErrNone);
+	TEST(appUid==KNullUid);
+	TEST(dataType.Uid()==KNullUid);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery25
+  
+   @SYMPREQ 538
+   
+   @SYMTestPriority  High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestCaseDesc Test the functionality ofAppForDocumentAndService given a file name, a file, service uid and file server 
+   
+   @SYMTestActions  Call AppForDocumentAndService with two parameters: a filename, a service uid, an
+   app uid and the datatype requested
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::AppForDocumentAndService(const TDesC& aFileName, TUid aServiceUid, TUid& aAppUid, TDataType& aDataType) const
+   
+   @SYMTestExpectedResults Returns KErrNone.The value returned for appuid is that of the app that provides this services.If more than
+   one app provides this service, it returns the first app in the list. The returned value for the datatype is that
+   that describes the datatype in the document
+    
+ */	
+
+void CT_ServicesTestStep::TestServiceDiscovery25()
+	{
+	INFO_PRINTF1(_L("TestServiceDiscovery25 about to start..."));
+	const TUid KUidService = {0x01020303};
+	TInt ret(0);
+	TUid appUid=KNullUid;
+	const TUid TUidExpected = {0x10004c54};
+	_LIT8(KLitMimeTypeServerData,"text/plain");
+	TDataType dataType;
+	RFile file;
+	_LIT(KOneByteFileName, "z:\\system\\data\\one_byte.txt");
+	RFs fs;
+	ret = fs.Connect();
+	ret = fs.ShareProtected();
+	ret = file.Open(fs, KOneByteFileName, EFileRead|EFileShareAny);
+	TEST(ret==KErrNone);
+	ret = iApaLsSession.AppForDocumentAndService(file, KUidService, appUid, dataType);
+	TEST(appUid==TUidExpected);
+	TEST(dataType==TDataType(KLitMimeTypeServerData));
+	TEST(ret==KErrNone);
+	fs.Close();
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery26
+  
+   @SYMPREQ 538
+   
+   @SYMTestPriority  High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestCaseDesc Test the functionality ofAppForDocumentAndService given a file, service uid,file server and undefined file name 
+   
+   @SYMTestActions  Call AppForDocumentAndService with two parameters: a filename, a service uid, an
+   app uid and the datatype requested
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::AppForDocumentAndService(const TDesC& aFileName, TUid aServiceUid, TUid& aAppUid, TDataType& aDataType) const
+   
+   @SYMTestExpectedResults Returns KErrBadHandle. The app uid is set to null, the uid of datatype is set to null
+    
+ */	
+void CT_ServicesTestStep::TestServiceDiscovery26()
+	{
+	INFO_PRINTF1(_L("TestServiceDiscovery26 about to start..."));
+	const TUid KUidService = {0x01020304};
+	TInt ret(0);
+	TUid appUid=KNullUid;
+	TDataType dataType;
+	RFile file;
+	_LIT(KOneByteFileName, "z:\\system\\data\\imaginary_byte.txt");
+	RFs fs;
+	ret = fs.Connect();
+	ret = fs.ShareProtected();
+	ret = file.Open(fs, KOneByteFileName, EFileRead|EFileShareAny);
+	TEST(ret==KErrNotFound);
+	ret = iApaLsSession.AppForDocumentAndService(file, KUidService, appUid, dataType);
+	TEST(appUid==KNullUid);
+	TEST(dataType.Des8().Length()==0);
+	TEST(ret==KErrBadHandle);	
+	fs.Close();
+
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery27
+  
+   @SYMPREQ 538
+
+   @SYMTestPriority  High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestCaseDesc Test the functionality ofAppForDocumentAndService given a file name, a file, file server and a service uid that the app 
+   does not provide  * 
+   
+   @SYMTestActions  Call AppForDocumentAndService with two parameters: a filename, a service uid, an
+   app uid and the datatype requested
+   on z: drive.\n
+   API Calls:\n	
+   RApaLsSession::AppForDocumentAndService(const TDesC& aFileName, TUid aServiceUid, TUid& aAppUid, TDataType& aDataType) const
+   
+   @SYMTestExpectedResults Returns KErrNone.The value returned for app uid is null.The datatype is set to that that 
+   describes the datatype in the document 
+    
+ */	
+void CT_ServicesTestStep::TestServiceDiscovery27()
+	{
+	INFO_PRINTF1(_L("TestServiceDiscovery27 about to start..."));
+	const TUid KUidService = {0x01000300};
+	TInt ret(0);
+	TUid appUid=KNullUid;
+	TDataType dataType;
+	RFile file;
+	_LIT(KOneByteFileName, "z:\\system\\data\\one_byte.txt");
+	RFs fs;
+	ret = fs.Connect();
+	ret = fs.ShareProtected();
+	ret = file.Open(fs, KOneByteFileName, EFileRead|EFileShareAny);
+	TEST(ret==KErrNone);
+	ret = iApaLsSession.AppForDocumentAndService(file, KUidService, appUid, dataType);
+	TEST(appUid==KNullUid);
+	_LIT8(KLitMimeTypeServerData,"text/plain");
+	TEST(dataType==TDataType(KLitMimeTypeServerData));
+	TEST(ret==KErrNone);	
+	fs.Close();
+	}
+
+/**
+ * @SYMTestCaseID T_ServicesTestStep_TestServiceDiscovery28L
+ *
+ * @SYMPREQ 538
+ *
+ * @SYMTestCaseDesc Test the functionality of GetServiceImplementationsLC 
+ * which gets all the implementation details about a specific service 
+ * @SYMTestPriority 
+ *
+ * @SYMTestStatus Implemented
+ * 
+ * @SYMTestActions Call GetServiceImplementationsLC with the service uid as parameter
+ * on z: drive.\n
+ * API Calls:\n	
+ * RApaLsSession::GetServiceImplementationsLC(TUid aServiceUid, const TDataType& aDataType) const
+ * 
+ * @SYMTestExpectedResults Returns an array of TApaAppServiceInfo objects. 
+ * The size of the array is equal to the number of apps offering the specified service that
+ * also handles the speficied datatype. 
+ * Each TApaAppServiceInfo contain an app uid and  the respective opaquedata. 
+ * The returned data should be the same as that defined in the registration files.
+ *  
+ */
+void CT_ServicesTestStep::TestServiceDiscovery28L()
+	{
+	INFO_PRINTF1(_L("TestServiceDiscovery28 about to start..."));
+	const TUid KUidService1234 = {0x01020304};
+	//const TUid KUidServerApp1 = {0x10004c56};
+	const TUid KUidServerApp2 = {0x10004c57};
+	
+	TDataType datatype(KLitCustom1Text);
+	CApaAppServiceInfoArray* array = iApaLsSession.GetServiceImplementationsLC(KUidService1234, datatype);
+	TArray<TApaAppServiceInfo> implArray(array->Array());
+	TInt count = implArray.Count();	
+	TEST(count==1);
+	_LIT(KService,"Non-localised text for service uid 0x01020304");
+	TPtrC8 opaqueData;
+	TResourceReader reader;
+	TPtrC16 theText;
+	TInt val(0);
+	TUid myuid = implArray[0].Uid(); 
+	TEST(myuid==KUidServerApp2);
+	const CArrayFixFlat<TDataTypeWithPriority>& datatypes = implArray[0].DataTypes();
+	TEST(datatypes.Count()==1);
+	TEST(0 == datatypes[0].iDataType.Des8().CompareF(KLitCustom1Text));
+	opaqueData.Set(implArray[0].OpaqueData());
+	reader.SetBuffer(&opaqueData); // opaqueData is an LTEXT resource
+	theText.Set(reader.ReadTPtrC16());
+	User::LeaveIfError(val = theText.Compare(KService));
+	TEST(val==KErrNone);
+	CleanupStack::PopAndDestroy(array);
+	array = NULL;
+	}
+
+/**
+ * @SYMTestCaseID T_ServicesTestStep_TestOpenService1
+ *
+ * @SYMPREQ
+ *
+ * @SYMTestCaseDesc This test checks that the Open service and legacy datatypes
+ * functions return the same results. See defect INC053978 as well.
+ * 
+ * @SYMTestPriority High 
+ *
+ * @SYMTestStatus Implemented
+ * 
+ * @SYMTestActions \n
+ * API Calls:\n
+ * 
+ * @SYMTestExpectedResults 
+ *  
+ */
+void CT_ServicesTestStep::TestOpenService1L()
+	{
+	INFO_PRINTF1(_L("TestOpenService1L about to start..."));
+		
+	// First try using the legacy method
+	_LIT8(KLitDummyopen1,"text/dummyopen1");
+	TUid expectedAppUid1={0x10208200};
+	TUid uid1;
+	TInt error1 = iApaLsSession.AppForDataType(TDataType(KLitDummyopen1), uid1);
+	TEST(error1==KErrNone);
+	TEST(uid1==expectedAppUid1);
+	
+	// Then try with legacy API but new Open service in reg file
+	_LIT8(KLitDummyopen2,"text/dummyopen2");
+	TUid expectedAppUid2={0x10208201};
+	TUid uid2;
+	TInt error2 = iApaLsSession.AppForDataType(TDataType(KLitDummyopen2), uid2);
+	TEST(error2==KErrNone);
+	TEST(uid2==expectedAppUid2);
+	
+	// Try with new API and old registration file format
+	TUid uid3;
+	TInt error3 = iApaLsSession.AppForDataTypeAndService(TDataType(KLitDummyopen1), 
+		KOpenServiceUid, uid3);
+	TEST(error3==KErrNone);
+	TEST(uid3==expectedAppUid1);
+	
+	// Try with new API and new registration file format
+	TUid uid4;
+	TInt error4 = iApaLsSession.AppForDataTypeAndService(TDataType(KLitDummyopen2), 
+		KOpenServiceUid, uid4);
+	TEST(error4==KErrNone);
+	TEST(uid4==expectedAppUid2);
+	
+	INFO_PRINTF1(KCompleted);
+	}
+
+//Test that the datatype list in the registration file is skipped
+void CT_ServicesTestStep::TestCtrlPnlAppL()
+	{
+	INFO_PRINTF1(_L("TestCtrlPnlAppL about to start..."));
+	TUid appUid={0x10207f79};
+	TUid serviceUid = {0x10101010};
+	CDesCArray* filesArray = new(ELeave) CDesCArraySeg(1);
+	CleanupStack::PushL(filesArray);
+	TInt ret = iApaLsSession.GetAppOwnedFiles(*filesArray,appUid);
+	TEST(ret==KErrNone);
+	TInt count(0);
+	count = filesArray->Count();
+	TEST(count == 1); 
+	CApaAppServiceInfoArray* array = iApaLsSession.GetAppServicesLC(appUid);
+	TArray<TApaAppServiceInfo> serviceArray(array->Array());
+	count = serviceArray.Count();
+	TEST(count == 1); 
+	TEST(serviceArray[0].Uid()==serviceUid);
+	CleanupStack::PopAndDestroy(2);
+	filesArray = NULL;
+	array = NULL;
+	}
+	
+/**
+ * @SYMTestCaseID T_ServicesTestStep_TestPrioritySystemL
+ *
+ * @SYMPREQ
+ *
+ * @SYMTestCaseDesc Checks that the system priority for data handlers requires
+ * WriteDeviceData capability
+ * 
+ * @SYMTestPriority High 
+ *
+ * @SYMTestStatus Implemented
+ * 
+ * @SYMTestActions \n
+ * API Calls:\n
+ * 
+ * @SYMTestExpectedResults 
+ *  
+ */
+void CT_ServicesTestStep::TestPrioritySystemL()
+	{
+	INFO_PRINTF1(_L("TestPrioritySystemL about to start..."));
+	// App 0x10207f7b has system priority and WriteDeviceData so it should
+	// be returned and not 0x10207f7f which has only high priority
+	const TUid KUidService1 = {0x10207f7d};
+	TUid appUid=KNullUid;
+	const TUid TUidExpected1 = {0x10207f7b};
+	_LIT8(KLitMimeTypeServerData,"text/custom1");
+	TInt ret=iApaLsSession.AppForDataTypeAndService(TDataType(KLitMimeTypeServerData), KUidService1,appUid);
+	TEST(ret==KErrNone);
+	TEST(appUid == TUidExpected1);
+	
+	// App 0x10207f7e has system priority but not WriteDeviceData so it should
+	// be 0x10207f7f that is returned  that has high priority
+	const TUid KUidService2 = {0x10207f7e};
+	const TUid TUidExpected2 = {0x10207f7f};
+	ret=iApaLsSession.AppForDataTypeAndService(TDataType(KLitMimeTypeServerData), KUidService2,appUid);
+	TEST(ret==KErrNone);
+	TEST(appUid == TUidExpected2);
+	
+	// System priority handler take precedence over user mappings
+	const TUid KUidServerApp = {0x10004c56};
+	ret = iApaLsSession.InsertDataMapping(TDataType(KLitMimeTypeServerData),
+	 	1, KUidServerApp, KUidService1);
+	TEST(ret==KErrNone);
+	// Waits till the data type mappings are restored from the data store ini file
+	iApaLsSession.WaitForTypeStoreUpdate();
+	ret = iApaLsSession.AppForDataTypeAndService(TDataType(KLitMimeTypeServerData), KUidService1,appUid);
+	TEST(ret==KErrNone);
+	TEST(appUid == TUidExpected1);
+	ret = iApaLsSession.DeleteDataMapping(TDataType(KLitMimeTypeServerData),KUidService1);
+	TEST(ret==KErrNone);
+	// Waits till the data type mappings are restored from the data store ini file
+	iApaLsSession.WaitForTypeStoreUpdate();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_ServicesStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,76 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file 
+ @internalComponent - Internal Symbian test code 
+*/
+
+#if (!defined __T_SERVICES_STEP_H__)
+#define __T_SERVICES_STEP_H__
+
+#include "testableapalssession.h"
+#include "appfwk_test_AppUi.h"
+
+_LIT(KT_ServicesStep,"T_Services");
+
+class CT_ServicesTestStep : public CTestStep
+	{
+public:
+	CT_ServicesTestStep();
+	~CT_ServicesTestStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+	
+private:
+	TInt RunTestCasesL();
+	void TestServiceDiscovery1L();
+	void TestServiceDiscovery2L();
+	void TestServiceDiscovery3L();
+	void TestServiceDiscovery4L();
+	void TestServiceDiscovery5L();
+	void TestServiceDiscovery6();
+	void TestServiceDiscovery7L();
+	void TestServiceDiscovery8L();
+	void TestServiceDiscovery9();
+	void TestServiceDiscovery10L();
+	void TestServiceDiscovery11L();
+	void TestServiceDiscovery12L();
+	void TestServiceDiscovery13L();
+
+	void TestServiceDiscovery17L();
+	void TestServiceDiscovery18L();
+	void TestServiceDiscovery19();
+	void TestServiceDiscovery20L();
+	void TestServiceDiscovery21L();
+	void TestServiceDiscovery22();
+	void TestServiceDiscovery23();
+	void TestServiceDiscovery24();
+	void TestServiceDiscovery25();
+	void TestServiceDiscovery26();
+	void TestServiceDiscovery27();
+	void TestServiceDiscovery28L();
+	void TestOpenService1L();
+	void TestCtrlPnlAppL();
+	void TestPrioritySystemL();
+			
+private:
+	RTestableApaLsSession iApaLsSession;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_StartAppStep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,698 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+#include "T_StartAppStep.h"
+#include "tstapp.h"
+#include "TRApaLsSessionStartAppTest.h"
+#include <apacmdln.h>
+
+_LIT(KCompleted, "Completed.");
+_LIT8(KLitPlainText,"text/plain");
+
+const TInt KTUnProtectedAppTestPassed = 1234;
+
+class RIpcApparcFuzzTest : public RSessionBase
+	{
+public: 
+	RIpcApparcFuzzTest(CTestStep& aTestFuzz);// Constructor
+	~RIpcApparcFuzzTest();//Destructor
+	void RunFuzzTestL();
+private:
+	CTestStep&  iTestFuzz;
+	};
+	
+RIpcApparcFuzzTest::RIpcApparcFuzzTest(CTestStep& aTestFuzz):iTestFuzz(aTestFuzz) 
+	{
+	}
+	
+RIpcApparcFuzzTest::~RIpcApparcFuzzTest() 
+	{
+	Close();
+	}
+/**
+   @SYMTestCaseID APPFWK-APPARC-0086
+ 
+   @SYMDEF DEF116002 IpcFuzz Test on CApaAppListServSession::GetExecutableNameGivenDataTypeL and AppForDataTypeL
+    
+   @SYMTestPriority Medium 
+ 
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions Create AppListServer server session and pass the HBufC descriptor to the 
+   apparc server APIs GetExecutableNameGivenDataTypeL() and AppForDataTypeL().
+
+   @SYMTestExpectedResults Test should return  KErrArgument if client passes other than TDataType.
+ */
+
+void RIpcApparcFuzzTest::RunFuzzTestL()
+	{
+	iTestFuzz.INFO_PRINTF1(_L("Testing appserv APIs GetExecutableNameGivenDataTypeL and AppForDataTypeL  "));	
+	TInt ret;
+	TVersion version(1,1,1);
+	ret = CreateSession(_L("!AppListServer"),version,4);
+	iTestFuzz.TEST(ret ==KErrNone);
+	HBufC* buf = HBufC::NewLC(268);
+	TPtr ptr = buf->Des();
+	TIpcArgs args;
+	args.Set(0, &ptr);	
+	ret = SendReceive(14, args); // Send bad args to CApaAppListServSession::AppForDataTypeL using enum value of EAppListServAppForDataType
+	iTestFuzz.TEST(ret ==KErrArgument);
+	iTestFuzz.INFO_PRINTF1(_L("Testing CApaAppListServSession::AppForDataTypeL() is completed "));	
+	args.Set(2, &ptr);	
+	ret = SendReceive(21, args);// Send bad args to CApaAppListServSession::GetExecutableNameGivenDataTypeL using enum value EAppListServGetExecutableNameGivenDocument
+	iTestFuzz.TEST(ret ==KErrArgument);
+	iTestFuzz.INFO_PRINTF1(_L("Tesing CApaAppListServSession::GetExecutableNameGivenDataTypeL() is completed "));	
+	iTestFuzz.INFO_PRINTF2(_L("Test successfully returns KErrArgument %d"),ret);	
+	CleanupStack::PopAndDestroy(buf);	
+	}
+
+/**
+   Constructor
+ */	
+CT_StartAppTestStep::CT_StartAppTestStep()
+	{
+	// Call base class method to set up the human readable name for logging*/
+	SetTestStepName(KT_StartAppStep);
+	}
+
+/**
+   Destructor
+ */
+CT_StartAppTestStep::~CT_StartAppTestStep()
+	{
+	iApaLsSession.Close();
+	}
+
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */	
+TVerdict CT_StartAppTestStep::doTestStepPreambleL()
+	{
+	SetTestStepResult(EPass);
+	TInt error = iApaLsSession.Connect();
+	TEST(error==KErrNone);
+	return TestStepResult();
+	}
+
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+TVerdict CT_StartAppTestStep::doTestStepPostambleL()
+	{
+	return TestStepResult();
+	}
+
+
+TVerdict CT_StartAppTestStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Testing Apparc...T_StartApp Test Cases Running..."));
+	TRAPD(ret,RunTestCasesL());
+	TEST(ret==KErrNone);
+
+	TRAP(ret,TestIpcFuzzL());
+	TEST(ret==KErrNone);
+
+	INFO_PRINTF1(_L("...T_StartApp Test Cases Completed."));
+	return TestStepResult();
+	}
+
+void CT_StartAppTestStep::RunTestCasesL()
+	{
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestStartApp1L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestStartApp2L(), iApaLsSession.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestStartApp3L(), iApaLsSession.FlushRecognitionCache() );
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestStartApp4L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestStartApp5L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestStartApp6L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestStartApp7L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestStartApp8L(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestStartApp9L(), NO_CLEANUP);
+	// The following two APIs InsertDataMappingL() & DeleteDataMappingL(), update the type store on the server side.
+	// This update takes place on the server side while the test case is still running, which causes the heap check to fail.
+	// To avoid the heap check on the server side, DONT_CHECK macro is used.
+
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, DONT_CHECK, TestInsertDataTypeL(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestAppForDataTypeL(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, DONT_CHECK, TestDeleteDataTypeL(), NO_CLEANUP);
+	}
+	
+/**
+   @SYMTestCaseID T-Serv2Step-StartAppTests1L
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test Launching of an application. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Prepare command line information to start an application using
+   CApaCommandLine Apis.Call RApaLsSession::StartApp() to start an
+   application defined by the command line information.\n
+   Test the launching of application for following scenarios:\n
+   (1) When Application specified by command line exists.\n
+   (2) When Application specified by command line does not exist.\n
+   API Calls:\n	
+   RApaLsSession::StartApp(const CApaCommandLine& aCommandLine)\n
+   
+   @SYMTestExpectedResults The test observes that StartApp() returns KErrNone and
+   starts the app in the first scenario. In the second case KErrNotFound is
+   returned.
+   
+ */
+void CT_StartAppTestStep::TestStartApp1L()
+	{
+	INFO_PRINTF1(_L("Test RApaLsSession::StartApp using CApaCommandLine....."));
+	CApaCommandLine* cmdLn=CApaCommandLine::NewLC();
+	TFileName filename;
+	_LIT(KLitExePath,"\\sys\\bin\\texe.exe");
+	TFullName exePath(KLitExePath);
+	filename = SearchAndReturnCompleteFileName(exePath);
+	
+	_LIT8(KLitDogfish,"dogfish");
+	_LIT(KLitWibble,"wibble");
+	cmdLn->SetExecutableNameL(filename);
+	cmdLn->SetTailEndL(KLitDogfish);
+	TInt ret = iApaLsSession.StartApp(*cmdLn); // explicit
+	TEST(ret==KErrNone);
+
+	// start a non-existant app
+	cmdLn->SetExecutableNameL(KLitWibble);
+
+	ret = iApaLsSession.StartApp(*cmdLn);
+	TEST(ret==KErrNotFound);
+
+	CleanupStack::PopAndDestroy(cmdLn); // cmdLn
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestStartApp2L
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions \n
+   API Calls:\n	
+   \n
+   
+   @SYMTestExpectedResults .
+    
+ */
+void CT_StartAppTestStep::TestStartApp2L()
+	{
+	INFO_PRINTF1(_L("Test RApaLsSession::AppForDocument using filename and app uid...."));
+	TUid testUid={0x10004c4f};
+	iStartAppTestsUid.iUid=0;
+	TDataType data;
+	_LIT(KLitDocPath,"\\system\\data\\TRApaLsSessionStartAppTest.tst");
+	iStartAppTestsFilename = SearchAndReturnCompleteFileName(KLitDocPath);
+	TInt ret=iApaLsSession.AppForDocument(iStartAppTestsFilename,iStartAppTestsUid,data);
+	TEST(ret==KErrNone);
+	TEST(iStartAppTestsUid==testUid);
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestStartApp3L
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc  
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions \n
+   API Calls:\n	
+   \n
+   
+   @SYMTestExpectedResults 
+   
+ */	
+void CT_StartAppTestStep::TestStartApp3L()
+	{
+	INFO_PRINTF1(_L("Test RApaLsSession::StartDocument.....start the app from the recognized doc given."));
+
+	TThreadId startAppThreadID;
+	TPtrC startAppTestsDoc(KLitTRApaLsSessionStartAppTest);
+	TInt ret=iApaLsSession.StartDocument(startAppTestsDoc,startAppThreadID);
+	TEST(ret==KErrNone);
+	
+	//we need to close the started thread, if appropiate
+	if (ret==KErrNone)	
+		{
+		RThread thread;
+		User::LeaveIfError(thread.Open(startAppThreadID));
+		CleanupClosePushL(thread);
+
+		RProcess process;
+		User::LeaveIfError(thread.Process(process));
+		CleanupClosePushL(process);
+
+		process.Kill(0);
+		
+		CleanupStack::PopAndDestroy(&process);
+		CleanupStack::PopAndDestroy(&thread);
+		}
+		
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T-RApaLsSessionTestStep-TestStartApp4L
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc  
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions \n
+   API Calls:\n	
+   \n
+   
+   @SYMTestExpectedResults 
+    
+ */	
+void CT_StartAppTestStep::TestStartApp4L()
+	{
+	INFO_PRINTF1(_L("Test RApaLsSession::StartDocument....known data type"));
+	TThreadId startAppThreadID;
+	TInt ret=iApaLsSession.StartDocument(iStartAppTestsFilename, TDataType(KLitMimeType_TRApaLsSessionStartAppTest),startAppThreadID);
+	TEST(ret==KErrNone);
+	
+	//we need to close the started thread, if appropiate
+	if (ret==KErrNone)	
+		{
+		RThread thread;
+		User::LeaveIfError(thread.Open(startAppThreadID));
+		CleanupClosePushL(thread);
+
+		RProcess process;
+		User::LeaveIfError(thread.Process(process));
+		CleanupClosePushL(process);
+
+		process.Kill(0);
+		
+		CleanupStack::PopAndDestroy(&process);
+		CleanupStack::PopAndDestroy(&thread);
+		}
+		
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T_RApaLsSessionTestStep_TestStartApp5L
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc  
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions \n
+   API Calls:\n	
+   \n
+   
+   @SYMTestExpectedResults 
+    
+ */
+void CT_StartAppTestStep::TestStartApp5L()
+	{
+	INFO_PRINTF1(_L("Test RApaLsSession::StartDocument....unknown data type"));
+
+	TThreadId startAppThreadID;
+	TInt ret=iApaLsSession.StartDocument(iStartAppTestsFilename, TDataType(_L8("text/plain/no thanks")),startAppThreadID);
+	TEST(ret==KErrNotFound);
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T_RApaLsSessionTestStep_TestStartApp6L
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc  
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions \n
+   API Calls:\n	
+   \n
+   
+   @SYMTestExpectedResults 
+    
+ */
+void CT_StartAppTestStep::TestStartApp6L()
+	{	
+	INFO_PRINTF1(_L("Test RApaLsSession::StartDocument....known App Uid"));
+
+	TThreadId startAppThreadID;
+	TInt  ret=iApaLsSession.StartDocument(iStartAppTestsFilename,iStartAppTestsUid,startAppThreadID);
+	TEST(ret==KErrNone);
+	
+	//we need to close the started thread, if appropiate
+	if (ret==KErrNone)	
+		{
+		RThread thread;
+		User::LeaveIfError(thread.Open(startAppThreadID));
+		CleanupClosePushL(thread);
+
+		RProcess process;
+		User::LeaveIfError(thread.Process(process));
+		CleanupClosePushL(process);
+
+		process.Kill(0);
+		
+		CleanupStack::PopAndDestroy(&process);
+		CleanupStack::PopAndDestroy(&thread);
+		}
+		
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID T_RApaLsSessionTestStep_TestStartApp7L
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test mapping of a MIME type to an application. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions \n
+   API Calls:\n	
+   \n
+   
+   @SYMTestExpectedResults Checks mapping of a MIME type to an application.
+    
+ */
+void CT_StartAppTestStep::TestStartApp7L()
+	{	
+	INFO_PRINTF1(_L("Test RApaLsSession::StartDocument....non existent file."));
+
+	TThreadId startAppThreadID;
+	iStartAppTestsFilename = SearchAndReturnCompleteFileName(_L("\\system\\data\\not_here_thanks.foo"));
+	TInt ret=iApaLsSession.StartDocument(iStartAppTestsFilename, startAppThreadID);
+	TEST(ret==KErrNotFound);
+	INFO_PRINTF1(KCompleted);	
+	}
+	
+/**
+   @SYMTestCaseID APPFWK-APPARC-0071
+ 
+   @SYMDEF PDEF100072 -- CApaWindowGroupName::SetAppUid() and FindByAppUid panic
+ 
+   @SYMTestCaseDesc Test Launching of an application with unprotected application UID
+  
+   @SYMTestPriority High 
+ 
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions Prepare command line information to start an application using
+   CApaCommandLine Apis.Call RApaLsSession::StartApp() to start an
+   application defined by the command line information.\n
+   Test the launching of application for following scenario:\n
+   When Application specified by command line has unprotected application UID(negative uid).\n
+   API Calls:\n	
+   RApaLsSession::StartApp(const CApaCommandLine &aCommandLine, TThreadId &aThreadId);\n
+  
+   @SYMTestExpectedResults The test checks whether the thread has terminated with the exit reason KTUnProtectedAppTestPassed
+ */
+void CT_StartAppTestStep::TestStartApp8L()
+	{
+	INFO_PRINTF1(_L("Checking launching of an application which has unprotected UID"));
+	CApaCommandLine* cmdLine=CApaCommandLine::NewLC();
+	TFileName filename;
+	_LIT(KAppFileName, "z:\\sys\\bin\\UnProctectedUidApp.exe");
+	TFullName exePath(KAppFileName);
+	filename = SearchAndReturnCompleteFileName(exePath);
+	cmdLine->SetExecutableNameL(filename);
+	
+	TThreadId appThreadId(0U);
+	TInt ret = iApaLsSession.StartApp(*cmdLine, appThreadId);
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupStack::PopAndDestroy(cmdLine); // cmdLine
+	
+	RThread appThread;
+	User::LeaveIfError(appThread.Open(appThreadId));
+	
+	TRequestStatus logonRequestStatus;
+	appThread.Logon(logonRequestStatus);
+
+	// wait for UnProctectedUidApp.exe to terminate
+	INFO_PRINTF1(_L("Waiting for application to terminate..."));
+	User::WaitForRequest(logonRequestStatus);
+
+	const TExitType exitType = appThread.ExitType();
+	const TInt exitReason = appThread.ExitReason();
+	TExitCategoryName categoryName = appThread.ExitCategory();
+	appThread.Close();
+
+	TBuf<50> msg;
+	if (exitType == EExitPanic)
+		{
+		_LIT(KAppPanicInfo, "Application panic: %S %d");
+		msg.Format(KAppPanicInfo, &categoryName, exitReason);
+		}
+	else
+		{
+		_LIT(KAppExitInfo, "Application exited with code %d");
+		msg.Format(KAppExitInfo, exitReason);
+		}
+	INFO_PRINTF1(msg);
+
+	TEST(logonRequestStatus == KTUnProtectedAppTestPassed);
+	TEST(exitType == EExitKill);
+	TEST(exitReason == KTUnProtectedAppTestPassed);
+	INFO_PRINTF1(KCompleted);
+	}
+/**
+   @SYMTestCaseID APPFWK-APPARC-0076
+  
+   @SYMDEF INC104463
+  
+   @SYMTestCaseDesc  Testing StartApp API by forcing memory leak.
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Apparc should kill the child process if a leave occurs in StartApp API. 
+   API Calls:\n	
+   RApaLsSession::StartApp \n
+   
+   @SYMTestExpectedResults Test should complete without any panic.
+    
+ */
+
+void CT_StartAppTestStep::TestStartApp9L()
+	{
+	INFO_PRINTF1(_L("Test to check the StartApp API with forced memory failures..."));
+	CApaCommandLine* cmdLn=CApaCommandLine::NewLC();
+	TFileName filename;
+	TThreadId threadId(0);
+	TInt fail;
+	_LIT(KLitExePath,"\\sys\\bin\\texe.exe");
+	TFullName exePath(KLitExePath);
+	filename = SearchAndReturnCompleteFileName(exePath);	
+	cmdLn->SetExecutableNameL(filename);
+	TInt ret = KErrNoMemory;
+	//Without the fix for the Incident INC104463, the OOM test causes panic 
+	//KERN-EXEC 56.	
+	for(fail=1; ret == KErrNoMemory; fail++)
+		{	
+		__UHEAP_SETFAIL(RHeap::EDeterministic, fail);
+		__UHEAP_MARK;
+		ret = iApaLsSession.StartApp(*cmdLn, threadId);
+		__UHEAP_MARKEND;
+		__UHEAP_RESET;
+		TEST((ret==KErrNoMemory || ret==KErrNone));
+		if(ret == KErrNone)
+			{
+			TEST(threadId.Id() != 0);
+			}
+		}	
+	INFO_PRINTF3(_L("Iteration count is %d and the value of return is %d "),fail-1 ,ret);
+	CleanupStack::PopAndDestroy(cmdLn); 
+	INFO_PRINTF1(KCompleted);
+	}
+	
+ 
+
+/**
+   @SYMTestCaseID CT_RApaLsSessionTestStep_TestInsertDataTypeL
+  
+   @SYMPREQ Data caging
+  
+   @SYMTestCaseDesc  
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions 
+   API Calls:\n	
+   RApaLsSession::InsertDataMapping \n
+   RApaLsSession::InsertDataMappingIfHigher \n
+   @SYMTestExpectedResults
+ *  
+ */
+void CT_StartAppTestStep::TestInsertDataTypeL()
+	{
+	INFO_PRINTF1(_L("Test RApaLsSession::InsertDataMapping....Check data type mapping addition"));
+	const TDataTypePriority KPriLow = 1;
+	const TDataTypePriority KPriHigh = 2;
+	TBool added=EFalse;
+
+	TInt err=iApaLsSession.InsertDataMapping(TDataType(KLitPlainText), KPriLow, KUidTestApp);
+	INFO_PRINTF2(_L("returned, %d"), err);
+	TSecurityInfo info;
+	info.Set(RProcess());
+	
+	info.iCaps.HasCapability(ECapabilityWriteDeviceData) ? TEST(err==KErrNone) :  TEST(err==KErrPermissionDenied);
+	
+	err=iApaLsSession.InsertDataMappingIfHigher(TDataType(KLitPlainText), KPriHigh, KUidTestApp, added);
+	INFO_PRINTF2(_L("returned, %d"), err);
+	info.iCaps.HasCapability(ECapabilityWriteDeviceData) ? TEST(err==KErrNone && added)  :  TEST(err==KErrPermissionDenied);
+	if (err==KErrNone)
+		{
+		// Waits till the data type mappings are restored from the data store ini file
+		iApaLsSession.WaitForTypeStoreUpdate();
+		}
+	INFO_PRINTF1(_L("Test RApaLsSession::InsertDataMapping....Check data type mapping addition....Done"));
+	}
+
+/**
+   @SYMTestCaseID T_RApaLsSessionTestStep_TestAppForDataTypeL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc . 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions \n
+   API Calls:\n
+   
+   @SYMTestExpectedResults 
+    
+ */
+void CT_StartAppTestStep::TestAppForDataTypeL()
+	{
+	INFO_PRINTF1(_L("Test RApaLsSession::AppForDataType....Check an app binding"));
+	_LIT8(KLitPlainText,"text/plain");
+	TUid testUid={KTestAppUidValue};
+	
+	TInt ret=iApaLsSession.AppForDataType(TDataType(KLitPlainText),iStartAppTestsUid);
+	TEST(ret==KErrNone);
+	TEST(iStartAppTestsUid==testUid);
+	INFO_PRINTF1(KCompleted);
+	}
+
+/**
+   @SYMTestCaseID CT_RApaLsSessionTestStep::TestDeleteDataTypeL
+  
+   @SYMPREQ Data caging
+  
+   @SYMTestCaseDesc  
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions 
+   API Calls:\n	
+   RApaLsSession::DeleteDataMapping \n
+   @SYMTestExpectedResults
+    
+ */
+
+void CT_StartAppTestStep::TestDeleteDataTypeL()
+	{
+	INFO_PRINTF1(_L("Test RApaLsSession::DeleteDataMapping....Check data type mapping deletion"));
+
+	TInt err=iApaLsSession.DeleteDataMapping(TDataType(KLitPlainText));
+	INFO_PRINTF2(_L("returned, %d"), err);
+	TSecurityInfo info;
+	info.Set(RProcess());
+	
+	info.iCaps.HasCapability(ECapabilityWriteDeviceData) ? TEST(err==KErrNone) :  TEST(err==KErrPermissionDenied);
+	if(err==KErrNone)
+	{
+	// Waits till the data type mappings are restored from the data store ini file
+	iApaLsSession.WaitForTypeStoreUpdate();	
+	}
+	INFO_PRINTF1(_L("Test RApaLsSession::DeleteDataMapping....Check data type mapping deletion....Done"));
+	}
+	
+TFileName CT_StartAppTestStep::SearchAndReturnCompleteFileName(const TDesC& aFileName)
+	{
+	RFs fs;
+	TInt ret = fs.Connect();
+	TEST(ret==KErrNone);
+
+	TParsePtrC parse(aFileName);
+	TFindFile findFile(fs);
+	ret = findFile.FindByDir(parse.NameAndExt(), parse.Path());
+	if (ret!=KErrNone)
+		{
+		TBuf<64> buffer;
+		buffer.Format(_L("Error while finding the file, %d"), ret);
+		}
+	fs.Close();
+	return findFile.File();
+	}
+
+void CT_StartAppTestStep::TestIpcFuzzL()
+	{
+	INFO_PRINTF1(_L("Test IpcFuzz DEF116002 Started"));	
+	RIpcApparcFuzzTest testIpc(*this);
+	CleanupClosePushL(testIpc);
+	TRAPD(err,testIpc.RunFuzzTestL());
+	TEST(err==KErrNone);
+	CleanupStack::PopAndDestroy(&testIpc);
+	INFO_PRINTF1(_L("Test IpcFuzz DEF116002 Completed"));
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_StartAppStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,66 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+#if (!defined __T_DATATYPEMAPPINGS_STEP_H__)
+#define __T_DATATYPEMAPPINGS_STEP_H__
+
+#include "testableapalssession.h"
+#include "appfwk_test_AppUi.h"
+
+_LIT(KT_StartAppStep,"T_StartApp");
+
+class CT_StartAppTestStep : public CTestStep
+	{
+public:
+	CT_StartAppTestStep();
+	~CT_StartAppTestStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+	
+private:
+	void RunTestCasesL();
+	void TestStartApp1L();
+	void TestStartApp2L();
+	void TestStartApp3L();
+	void TestStartApp4L();
+	void TestStartApp5L();
+	void TestStartApp6L();
+	void TestStartApp7L();
+	void TestStartApp8L();
+	void TestStartApp9L();
+	void TestInsertDataTypeL();
+	void TestAppForDataTypeL();
+	void TestDeleteDataTypeL();
+	void TestIpcFuzzL();
+	
+private:
+	TFileName SearchAndReturnCompleteFileName(const TDesC& aFileName);
+	
+private:
+	RTestableApaLsSession iApaLsSession;
+	TFileName iStartAppTestsFilename;
+	TUid iStartAppTestsUid;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_StartDocStep.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,143 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+#include "testableapalssession.h"
+#include "T_StartDocStep.h"
+#include "TStartDoc.h"
+
+/**
+   @SYMTestCaseID T-StartDocStep-TestStartDocL
+  
+   @SYMPREQ PHAR-5NTCWY
+  
+   @SYMTestCaseDesc
+   Checks that document names longer than 256 characters can be started.
+   The test starts a document and checks that the application launched
+   to handle that document is passed the full document name.
+   The test uses the StartDocument overload which does not provide an
+   application UID or mime type, because we want the test to check that
+   the long document name is supported by the data recognizer framework.
+   The test also checks that the data recognizer framework doesn't return
+   an error because it incorrectly assumes the document name is a file name
+   and tries to open the document to read its contents before performing
+   data recognition.
+   In this case, the document name isn't a file name, it's a pretend URL
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   1. Call RApaLsSession::StartDocument passing a long document name (KLitLongURL).
+   2. StartDocument should cause TStartDocApp.app to be launched, so wait
+      for the application thread to terminate.
+   3. Check the thread has terminated in the way we expected
+  
+   @SYMTestExpectedResults
+   Calling RApaLsSession::StartDocument should cause the apparc server to
+   call CLongUrlRec::DoRecognizeL as part of trying to find the mime type
+   of the document. CLongUrlRec returns a mime type which is associated with
+   TStartDocApp.app, so apparc server starts TStartDocApp.app passing the
+   long document name on the command line.
+   The long document name should eventually be passed through to
+   CStartDocAppUi::ProcessCommandParametersL which will panic with
+   EPanicDocNameCheck1Failed if the document name isn't KLitLongURL.
+   CStartDocDocument::OpenFileL panics with EPanicDocNameCheck1NotExecuted if
+   the document name check in CStartDocAppUi::ProcessCommandParametersL wasn't
+   executed.
+   CStartDocDocument::OpenFileL panics with EPanicDocNameCheck2Failed if
+   the document name returned by CApaProcess::MainDocFileName isn't KLitLongURL.
+  
+   TStartDocApp.app should exit with KTStartDocTestPassed.
+  
+ */
+void CT_StartDocStep::TestStartDocL(RApaLsSession& aLs)
+	{
+	TPtrC longURL(KLitLongURL);
+	// sanity check to ensure the document name we're going to pass to
+	// RApaLsSession::StartDocument is longer than the maximum length
+	// of a file name
+	TEST(longURL.Length() > KMaxFileName);
+
+	TThreadId appThreadId(0U);
+	// start document, causing TStartDocApp.app to be launched
+	INFO_PRINTF1(_L("Starting document..."));
+	TInt ret = aLs.StartDocument(longURL, appThreadId);
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+
+	RThread appThread;
+	User::LeaveIfError(appThread.Open(appThreadId));
+	TRequestStatus logonRequestStatus;
+	appThread.Logon(logonRequestStatus);
+
+	// wait for TStartDocApp.app to terminate
+	INFO_PRINTF1(_L("Waiting for application to terminate..."));
+	User::WaitForRequest(logonRequestStatus);
+
+	const TExitType exitType = appThread.ExitType();
+	const TInt exitReason = appThread.ExitReason();
+	TExitCategoryName categoryName = appThread.ExitCategory();
+	appThread.Close();
+
+	TBuf<50> msg;
+	if (exitType == EExitPanic)
+		{
+		_LIT(KAppPanicInfo, "Application panic: %S %d");
+		msg.Format(KAppPanicInfo, &categoryName, exitReason);
+		}
+	else
+		{
+		_LIT(KAppExitInfo, "Application exited with code %d");
+		msg.Format(KAppExitInfo, exitReason);
+		}
+	INFO_PRINTF1(msg);
+
+	TEST(logonRequestStatus == KTStartDocTestPassed);
+	TEST(exitType == EExitKill);
+	TEST(exitReason == KTStartDocTestPassed);
+
+	//avoid race conditions
+	User::After(1500000);
+	}
+
+TVerdict CT_StartDocStep::doTestStepL()
+{
+	INFO_PRINTF1(_L("Test Started"));
+	
+	RTestableApaLsSession ls;
+	TEST(KErrNone == ls.Connect());
+	CleanupClosePushL(ls);
+
+	//avoid race conditions
+	User::After(1500000);
+
+	// run the test
+	HEAP_TEST_LS_SESSION(ls, 0, 0, TestStartDocL(ls), NO_CLEANUP);
+	
+	CleanupStack::PopAndDestroy(&ls);
+
+	INFO_PRINTF1(_L("Test Finished"));
+
+	return TestStepResult();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_StartDocStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,38 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+#if (!defined __T_STARTDOCSTEP_H__)
+#define __T_STARTDOCSTEP_H__
+
+#include <TestExecuteStepBase.h>
+
+class CT_StartDocStep : public CTestStep
+	{
+public:
+	virtual TVerdict doTestStepL();
+private:
+	void TestStartDocL(RApaLsSession& aLs);
+	};
+
+_LIT(KT_StartDocStep, "T_StartDoc");
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_SysStartApparcStep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,231 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <s32file.h>
+
+#include "T_SysStartApparcStep.h"
+#include "tssaac\tssaac.h"
+
+_LIT(KApparcPanicFile,"c:\\T_SSAAC_PanicResultFile.txt");
+
+
+const TChar KDelimChar = '=';
+
+/**
+  The expected results are hard coded from the test specification.
+*/
+//Test case 1
+const TInt KExpectedStartApp1LRes1 = KErrNone;
+const TInt KExpectedStartApp1LRes2 = KErrNotFound;
+
+//Test case 99
+const TInt KExpectedLocalisedCaptionLRes1 = 0;
+const TInt KExpectedLocalisedCaptionLRes2 = 0;
+
+/**
+  Read the results of the individual tests. The test number is determined by
+  reading the configuration file z:\\apparctest\\TestCaseConfig.txt and then one
+  of two functions is called, one which handles tests which panic and one which
+  handles tests which don't.
+
+  Non-paniccing test results are read from file c:\\SysStartApparc_TestStartApp1L.txt
+  The order in which these results are written in CSysStartApparcTestCase::WriteResultFileL()
+  MUST match the order in which they are read and tested in CheckApparcResultsL()
+  The expected results are hard coded from the test specification.(see above)
+
+  Paniccing test results are read from file c:\\T_SSAAC_PanicResultFile.txt
+  The result is a '1 or 0' to represent a PASS or a FAIL The actual pass critria
+  are found in file sysstart_apparc_checkEpocWind.bat where the test is performed and
+  the T_SSAAC_PanicResultFile file created with the appropriate result
+
+*/
+
+/**
+  Read the results of the individual tests that do not panic. Currently, there is
+  only one test that does not panic. Results are read in from file SysStartApparc_TestStartApp1L.txt
+  and compared with the expected results
+
+*/
+void CT_SysStartApparcStep::CheckApparcResultsL()
+	{
+	RFs	fs;
+ 	User::LeaveIfError(fs.Connect());
+ 	CleanupClosePushL(fs);
+
+	RFileReadStream reader;
+	User::LeaveIfError(reader.Open(fs, KSsaacResultFile, EFileRead));
+	CleanupClosePushL(reader);
+
+	TBuf8<64> myDes;
+	TInt ret = 0;
+
+	// Read 16 bits - StartApp1LRes1
+	reader.ReadL(myDes, KDelimChar);
+	ret = reader.ReadInt16L();
+
+	if(iTestcase == 1)
+		{
+		INFO_PRINTF3(_L("Test StartApp1LRes1 Count - Expected: %d, Actual: %d"), KExpectedStartApp1LRes1, ret);
+		TEST(ret==KExpectedStartApp1LRes1);
+		}
+	else
+		{ // test case is 99
+		INFO_PRINTF3(_L("Test LocalisedCaptionLRes1 Count - Expected: %d, Actual: %d"), KExpectedLocalisedCaptionLRes1, ret);
+		TEST(ret==KExpectedLocalisedCaptionLRes1);
+		}
+
+	// Read 16 bits - StartApp1LRes2
+	reader.ReadL(myDes, KDelimChar);
+	ret = reader.ReadInt16L();
+
+	if(iTestcase == 1)
+		{
+		INFO_PRINTF3(_L("Test StartApp1LRes2 Count - Expected: %d, Actual: %d"), KExpectedStartApp1LRes2, ret);
+		TEST(ret==KExpectedStartApp1LRes2);
+		}
+	else // test cass is 99
+		{
+		INFO_PRINTF3(_L("Test LocalisedCaptionLRes2 Count - Expected: %d, Actual: %d"), KExpectedLocalisedCaptionLRes2, ret);
+		TEST(ret==KExpectedLocalisedCaptionLRes2);
+		}
+
+	// clean-up
+	CleanupStack::PopAndDestroy(2, &fs);
+	}
+
+/**
+  Read the results of the individual tests that panic. After a panic, the
+  batch file sysstartapparc_checkEpocWind.bat searched the EpocWind.out file
+  for lines of text that verify that a panic has occurred with the correct
+  KERN-EXEC number and then writes the result to a text file (pass=1, fail=0)
+  for processing here.
+
+*/
+void CT_SysStartApparcStep::CheckApparcPanicResultsL()
+	{
+	RFs	fs;
+ 	User::LeaveIfError(fs.Connect());
+	INFO_PRINTF1(_L("File server connected"));
+
+ 	CleanupClosePushL(fs);
+
+	RFileReadStream reader;
+	User::LeaveIfError(reader.Open(fs, KApparcPanicFile, EFileRead));
+
+	CleanupClosePushL(reader);
+
+	TBuf8<64> myDes;
+
+	TInt expected = 1; //a PASS
+
+	//File containd a test name and a test result, Move past the test name
+	reader.ReadL(myDes, KDelimChar);
+
+	//Read the test result
+	reader.ReadL(myDes, KDelimChar);
+
+	// Read 16 bits - StartApp1LRes1
+	TChar result(reader.ReadUint8L());
+	TInt ret = result.GetNumericValue();
+	INFO_PRINTF3(_L("Test StartApp1LRes1 Count - Expected: %d, Actual: %d"), KTestResultPass, ret);
+	TEST(ret==expected);
+
+	// clean-up
+	CleanupStack::PopAndDestroy(2, &fs);
+	}
+
+
+/**
+  Destructor
+*/
+CT_SysStartApparcStep::~CT_SysStartApparcStep()
+	{
+	}
+
+/**
+  Constructor
+*/
+CT_SysStartApparcStep::CT_SysStartApparcStep()
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_SysStartApparcStep);
+	}
+
+/**
+  Override of base class virtual.
+  @return - TVerdict code
+*/
+
+TVerdict CT_SysStartApparcStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test T_SysStartApparcStep: Started"));
+
+ 	__UHEAP_MARK;
+ 	TInt ret=KErrGeneral;
+ 	iTestcase=ReadConfigFileL();
+
+ 	//Test case 1 and 99 are the only tests that do not panic
+ 	if( (iTestcase==1) || (iTestcase==29) )
+ 		{
+		TRAP(ret, CheckApparcResultsL());
+		}
+	else
+		{
+		TRAP(ret, CheckApparcPanicResultsL());
+		}
+	INFO_PRINTF2(_L("CheckApparcResultsL ends with code %d"), ret);
+	TEST(ret==KErrNone);
+	__UHEAP_MARKEND;
+
+	INFO_PRINTF1(_L("Test T_SysStartApparcStep: Finished"));
+	return TestStepResult();
+	}
+
+/**
+Reads the input config file and returns the test case number
+Defined in sysstart_apparc_run.bat
+@return TInt - the test case number
+*/
+TInt CT_SysStartApparcStep::ReadConfigFileL()
+	{
+	RFs	fs;
+ 	User::LeaveIfError(fs.Connect());
+ 	CleanupClosePushL(fs);
+
+ 	RFileReadStream reader;
+	User::LeaveIfError(reader.Open(fs, KApparcConfigFile, EFileRead));
+	CleanupClosePushL(reader);
+
+	TBuf8<255> aDes;
+	reader.ReadL(aDes, KDelimChar);
+
+	//Read in a two character representation of a number and convert to an integer
+	TChar result1(reader.ReadInt8L());
+	TChar result0(reader.ReadInt8L());
+	TInt aTestCase = result1.GetNumericValue()*10 + result0.GetNumericValue();
+
+	// clean-up
+	CleanupStack::PopAndDestroy(2, &fs);
+
+	return aTestCase;
+
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_SysStartApparcStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,69 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#if (!defined __T_SYSSTARTAPPARCSTEP_H__)
+#define __T_SYSSTARTAPPARCSTEP_H__
+
+#include "ApparcTestServer.h"
+#include "tssaac\SysStartApparcTestCases.h"  // KApparcResultFile
+
+#define KTestResultPass 1
+
+
+/**
+  Literal used as name for test case.
+*/
+_LIT(KT_SysStartApparcStep,"T_SysStartApparc");
+_LIT(KApparcStartupT_TestStartApp1L,"T_TestStartApp1L");
+_LIT(KApparcStartupT_TestStartApp2L,"T_TestStartApp2L");
+_LIT(KApparcStartupT_TestStartApp3L,"T_TestStartApp3L");
+_LIT(KApparcStartupT_TestStartApp4L,"T_TestStartApp4L");
+_LIT(KApparcStartupT_TestStartApp5L,"T_TestStartApp5L");
+_LIT(KApparcStartupT_TestStartApp6L,"T_TestStartApp6L");
+_LIT(KApparcStartupT_TestGetAllApps,"T_TestGetAllApps");
+_LIT(KApparcStartupT_TestInsertDataTypeL,"T_TestInsertDataTypeL");
+_LIT(KApparcStartupT_TestAppForDataTypeL,"T_TestAppForDataTypeL");
+_LIT(KApparcStartupT_TestDeleteDataTypeL,"T_TestDeleteDataTypeL");
+_LIT(KApparcStartupT_TestServiceDiscovery,"T_TestServiceDiscovery");
+_LIT(KApparcStartupT_TestGetAppInfo,"T_TestGetAppInfo");
+_LIT(KApparcStartupT_TestAppCount,"T_TestAppCount");
+_LIT(KApparcStartupT_TestCreateDoc,"T_TestCreateDoc");
+_LIT(KApparcStartupT_TestLocalisedCaptionL,"T_TestLocalisedCaptionL");
+
+
+/**
+  CT_SysStartApparcStep encapsulates the functionality required
+  for the T_SysStartApparcTest SysStart test case.
+*/
+class CT_SysStartApparcStep : public CTestStep
+	{
+public:
+	CT_SysStartApparcStep();
+	~CT_SysStartApparcStep();
+	virtual TVerdict doTestStepL();
+	void CheckApparcPanicResultsL();
+	void CheckApparcResultsL();
+	TInt ReadConfigFileL();
+	TInt iTestcase;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_WgnamStep.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,330 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Test accessing window group name.\n
+// Tests accessing & modifier functionality of CApaWindowGroupName API.\n
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include <e32test.h>
+#include <apgwgnam.h>
+#include <w32std.h>
+#include "T_WgnamStep.h"
+
+/**
+  Auxiliary Fn for Test Case ID T-WgnamStep-testWgNamesL
+ 
+  This function accepts current window group name as descriptor and prints it.\n
+  
+*/
+void CT_WgnamStep::PrintWindowGroupName(const TPtrC& aWndGroupName)
+	{
+	_LIT(KWindowGroupName, "Current name=\"%S\"\n");
+	TFileName buffer;
+	buffer.Format(KWindowGroupName, &aWndGroupName);
+	INFO_PRINTF1(buffer);
+	}
+
+
+/**
+   @SYMTestCaseID T-WgnamStep-testWgNamesL
+  
+   @SYMPREQ
+  
+   @SYMTestCaseDesc Test setting and accessing functionality of Window group name. 
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions The test checks the following functionality of CApaWindowGroupName\n
+   (1) Creation of window group name object.\n
+   (2) Setting the task to be a System task.\n
+   (3) Setting the task to be Busy.\n
+   (4) Setting document name as filename.\n
+   (5) Setting the task's capability to shutdown.\n
+   (6) Setting the task's capability to switch between files.\n
+   (7) Setting the tasks Uid.\n
+   (8) Setting the tasks caption.\n
+   (9) Setting the tasks Document name.\n
+   (10) Setting the task to be ready.\n
+   (11) Setting a name to a window group name.\n
+   \n
+   In each of the cases the setter function is called to set a particular
+   attribute. The attribute is cross checked by verifying with its 
+   corresponding getter / accessor function. After setting each of the attributes
+   the test tries to analyze the impact of the attribute changed, on the windows
+   group name.\n
+   API Calls:\n	
+   CApaWindowGroupName::NewL(const RWsSession& aWsSession)\n
+   CApaWindowGroupName::SetSystem(TBool aSystem)\n
+   CApaWindowGroupName::IsSystem() const\n
+   CApaWindowGroupName::SetBusy(TBool aBusy)\n
+   CApaWindowGroupName::IsBusy() const\n
+   CApaWindowGroupName::SetDocNameIsAFile(TBool aDocNameIsAFile)\n
+   CApaWindowGroupName::DocNameIsAFile() const\n
+   CApaWindowGroupName::SetRespondsToShutdownEvent(TBool aRespondsToShutdownEvent)\n
+   CApaWindowGroupName::RespondsToShutdownEvent() const\n
+   CApaWindowGroupName::SetRespondsToSwitchFilesEvent(TBool aRespondsToSwitchFilesEvent)\n
+   CApaWindowGroupName::RespondsToSwitchFilesEvent() const\n
+   CApaWindowGroupName::SetAppUid(TUid aAppUid);\n
+   CApaWindowGroupName::AppUid() const\n
+   CApaWindowGroupName::SetCaptionL(const TDesC& aCaption)\n
+   CApaWindowGroupName::Caption() const\n
+   CApaWindowGroupName::SetDocNameL(const TDesC& aDocName);\n
+   CApaWindowGroupName::DocName() const\n
+   CApaWindowGroupName::SetAppReady(TBool aIsReady)\n
+   CApaWindowGroupName::IsAppReady()\n
+   CApaWindowGroupName::SetWindowGroupName(HBufC* aWgName)\n
+   CApaWindowGroupName::WindowGroupName() const\n
+   CApaWindowGroupName::FindByCaption(const TDesC& aCaption, RWsSession& aWsSession, TInt& aPrevWgId) const\n
+   
+   @SYMTestExpectedResults Test checks results against expected values.
+    
+ */
+void CT_WgnamStep::testWgNamesL()
+	{
+	_LIT(KWindowGroupName1, "WindowGroupName 1");
+	_LIT(KWindowGroupName2, "WindowGroupName 2");
+	_LIT(KBadName,"00\x00\x31\x31\x31\x31\x31\x31\x31\x31x31\x0\x0");
+	
+	INFO_PRINTF1(_L("Starting testWgNamesL()"));
+	//
+	// Instantiate a blank name
+	CApaWindowGroupName* apaWindowGroupName=NULL;
+	TRAPD(ret, apaWindowGroupName=CApaWindowGroupName::NewL(iWsSession));
+	TEST(ret==KErrNone);
+	User::LeaveIfError(iWsSession.Connect());
+	TEST(apaWindowGroupName!=NULL);
+
+	// test setting system
+	INFO_PRINTF1(_L("Block 1"));
+	PrintWindowGroupName(apaWindowGroupName->WindowGroupName());
+	TEST(!apaWindowGroupName->IsSystem());
+	INFO_PRINTF1(_L("Setting system\n"));
+	apaWindowGroupName->SetSystem(ETrue);
+	PrintWindowGroupName(apaWindowGroupName->WindowGroupName());
+	TEST(apaWindowGroupName->IsSystem());
+	INFO_PRINTF1(_L("Setting not system\n"));
+	apaWindowGroupName->SetSystem(EFalse);
+	PrintWindowGroupName(apaWindowGroupName->WindowGroupName());
+	TEST(!apaWindowGroupName->IsSystem());
+	INFO_PRINTF1(_L("\n"));
+	// User::After(2000000);
+
+	// test setting busy
+	INFO_PRINTF1(_L("Block 2"));
+	INFO_PRINTF1(_L("Test setting busy"));
+	PrintWindowGroupName(apaWindowGroupName->WindowGroupName());
+	TEST(!apaWindowGroupName->IsBusy());
+	INFO_PRINTF1(_L("Setting busy\n"));
+	apaWindowGroupName->SetBusy(ETrue);
+	PrintWindowGroupName(apaWindowGroupName->WindowGroupName());
+	TEST(apaWindowGroupName->IsBusy());
+	INFO_PRINTF1(_L("Setting not busy\n"));
+	apaWindowGroupName->SetBusy(EFalse);
+	PrintWindowGroupName(apaWindowGroupName->WindowGroupName());
+	TEST(!apaWindowGroupName->IsBusy());
+	INFO_PRINTF1(_L("\n"));
+	// User::After(2000000);
+
+	// test setting docname not a file
+	INFO_PRINTF1(_L("Block 3"));
+	INFO_PRINTF1(_L("Test setting doc name is not a file"));
+	PrintWindowGroupName(apaWindowGroupName->WindowGroupName());
+	TEST(apaWindowGroupName->DocNameIsAFile());
+	INFO_PRINTF1(_L("Setting doc name not a file\n"));
+	apaWindowGroupName->SetDocNameIsAFile(EFalse);
+	PrintWindowGroupName(apaWindowGroupName->WindowGroupName());
+	TEST(!apaWindowGroupName->DocNameIsAFile());
+	INFO_PRINTF1(_L("Setting doc name is a file\n"));
+	apaWindowGroupName->SetDocNameIsAFile(ETrue);
+	PrintWindowGroupName(apaWindowGroupName->WindowGroupName());
+	TEST(apaWindowGroupName->DocNameIsAFile());
+	INFO_PRINTF1(_L("\n"));
+	// User::After(2000000);
+
+	// RDebug::Print(_L("Block 3"));
+	INFO_PRINTF1(_L("Test setting does not respond to shutdown event"));
+	PrintWindowGroupName(apaWindowGroupName->WindowGroupName());
+	TEST(apaWindowGroupName->RespondsToShutdownEvent());
+	INFO_PRINTF1(_L("Setting does not respond to shutdown event\n"));
+	apaWindowGroupName->SetRespondsToShutdownEvent(EFalse);
+	PrintWindowGroupName(apaWindowGroupName->WindowGroupName());
+	TEST(!apaWindowGroupName->RespondsToShutdownEvent());
+	INFO_PRINTF1(_L("Setting does respond to shutdown event\n"));
+	apaWindowGroupName->SetRespondsToShutdownEvent(ETrue);
+	PrintWindowGroupName(apaWindowGroupName->WindowGroupName());
+	TEST(apaWindowGroupName->RespondsToShutdownEvent());
+	INFO_PRINTF1(_L("\n"));
+	// User::After(2000000);
+
+	// test setting does not respond to switch files event
+	// RDebug::Print(_L("Block 3"));
+	INFO_PRINTF1(_L("Test setting does not respond to switch files event"));
+	PrintWindowGroupName(apaWindowGroupName->WindowGroupName());
+	TEST(apaWindowGroupName->RespondsToSwitchFilesEvent());
+	INFO_PRINTF1(_L("Setting does not respond to switch files event\n"));
+	apaWindowGroupName->SetRespondsToSwitchFilesEvent(EFalse);
+	PrintWindowGroupName(apaWindowGroupName->WindowGroupName());
+	TEST(!apaWindowGroupName->RespondsToSwitchFilesEvent());
+	INFO_PRINTF1(_L("Setting does respond to switch files event\n"));
+	apaWindowGroupName->SetRespondsToSwitchFilesEvent(ETrue);
+	PrintWindowGroupName(apaWindowGroupName->WindowGroupName());
+	TEST(apaWindowGroupName->RespondsToSwitchFilesEvent());
+	INFO_PRINTF1(_L("\n"));
+	// User::After(2000000);
+
+	// test setting app uid
+	// RDebug::Print(_L("Block 5"));
+	INFO_PRINTF1(_L("Test setting appUid"));
+	const TUid uid={ 0x10000111 };
+	PrintWindowGroupName(apaWindowGroupName->WindowGroupName());
+	INFO_PRINTF2(_L("Setting app uid to %x\n"), uid.iUid);
+	apaWindowGroupName->SetAppUid(uid);
+	PrintWindowGroupName(apaWindowGroupName->WindowGroupName());
+	TEST(apaWindowGroupName->AppUid()==uid);
+	INFO_PRINTF1(_L("\n"));
+	// User::After(2000000);
+
+	// test setting caption
+	// RDebug::Print(_L("Block 6"));
+	INFO_PRINTF1(_L("Test setting caption"));
+	PrintWindowGroupName(apaWindowGroupName->WindowGroupName());
+	TPtrC caption=_L("App caption");
+	INFO_PRINTF2(_L("Setting app caption to %S\n"), &caption);
+	apaWindowGroupName->SetCaptionL(caption);
+	PrintWindowGroupName(apaWindowGroupName->WindowGroupName());
+	TEST(!(apaWindowGroupName->Caption().Compare(caption)));
+	INFO_PRINTF1(_L("\n"));
+	// User::After(2000000);
+	
+	// testing FindByCaption
+	INFO_PRINTF1(_L("Test Window group ID"));
+	_LIT(KCaption, "App caption");
+	TInt aWgId=0;
+	apaWindowGroupName->FindByCaption(KCaption, iWsSession, aWgId);
+	TEST(aWgId==KErrNotFound);
+	INFO_PRINTF3(_L("Expected value is KErrNotfound : %d ,Value Obtained is   : %d \n"),KErrNotFound, aWgId);
+
+	// test setting document name
+	// RDebug::Print(_L("Block 7"));
+	INFO_PRINTF1(_L("Test setting document name"));
+	PrintWindowGroupName(apaWindowGroupName->WindowGroupName());
+	TPtrC docName=_L("Doc name");
+	INFO_PRINTF2(_L("Setting doc name to %S\n"), &docName);
+	apaWindowGroupName->SetDocNameL(docName);
+	PrintWindowGroupName(apaWindowGroupName->WindowGroupName());
+	TEST(!(apaWindowGroupName->DocName().Compare(docName)));
+	INFO_PRINTF1(_L("\n"));
+
+	// test AppReady flag
+	INFO_PRINTF1(_L("Testing AppReady flag"));
+	INFO_PRINTF1(_L("Setting AppReady flag to false"));
+	apaWindowGroupName->SetAppReady(EFalse);
+	TEST(apaWindowGroupName->IsAppReady()==EFalse);
+	INFO_PRINTF1(_L("Setting AppReady flag to true"));
+	apaWindowGroupName->SetAppReady(ETrue);
+	TEST(!apaWindowGroupName->IsAppReady()==EFalse);
+	INFO_PRINTF1(_L("\n"));
+
+
+	// Testing SetWindowGroup Name
+	INFO_PRINTF1(_L("Testing SetWindowGroupName"));
+	CApaWindowGroupName* apaWindGroupName = NULL;
+	
+	TRAP(ret, apaWindGroupName=CApaWindowGroupName::NewL(iWsSession, apaWindowGroupName->WindowGroupName()));
+	TEST(ret==KErrNone);
+	apaWindGroupName->SetWindowGroupNameL(KWindowGroupName1);
+	TEST(apaWindGroupName->WindowGroupName().Compare(KWindowGroupName1)==0);
+	HBufC* windGroupName = KWindowGroupName2().AllocLC();
+	apaWindGroupName->SetWindowGroupName(windGroupName);
+	TEST(apaWindGroupName->WindowGroupName().Compare(KWindowGroupName2)==0);
+	
+	apaWindGroupName->SetWindowGroupNameL(KBadName);
+	const TUid retUid = apaWindGroupName->AppUid();
+	TEST(retUid == KNullUid);
+	INFO_PRINTF2(_L("Expected Uid: 0, Actual uid = %d\n"), retUid);
+	delete apaWindGroupName;
+
+	INFO_PRINTF1(_L("Cleaning up"));
+	delete apaWindowGroupName; // apaWindowGroupName
+
+	CleanupStack::Pop();	// windGroupName
+	iWsSession.Close();
+
+	INFO_PRINTF1(_L("Finished testWgNamesL()"));
+	}
+
+
+
+CT_WgnamStep::~CT_WgnamStep()
+/**
+   Destructor
+ */
+	{
+	}
+
+CT_WgnamStep::CT_WgnamStep()
+/**
+   Constructor
+ */
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_WgnamStep);
+	}
+
+TVerdict CT_WgnamStep::doTestStepPreambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	SetTestStepResult(EPass);
+	return TestStepResult();
+	}
+
+TVerdict CT_WgnamStep::doTestStepPostambleL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+	{
+	return TestStepResult();
+	}
+
+
+TVerdict CT_WgnamStep::doTestStepL()
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+{
+	INFO_PRINTF1(_L("Testing window group names"));
+	//
+	// run the testcode (inside an alloc heaven harness)
+
+	__UHEAP_MARK;
+	TRAPD(r,testWgNamesL());
+		TEST(r==KErrNone);
+	__UHEAP_MARKEND;
+
+	return TestStepResult();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_WgnamStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,49 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code  
+*/
+
+#if (!defined __T_WGNAM_STEP_H__)
+#define __T_WGNAM_STEP_H__
+#include <w32std.h>
+#include "ApparcTestServer.h"
+
+//!  A CT_WgnamStep test class. 
+/*!
+  Test accessing window group name.
+*/
+class CT_WgnamStep :  public CTestStep
+	{
+public:
+	CT_WgnamStep();
+	~CT_WgnamStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+//private:
+	void testWgNamesL();
+	void PrintWindowGroupName(const TPtrC& aWndGroupName);
+private:
+	RWsSession iWsSession;
+	};
+
+_LIT(KT_WgnamStep,"T_Wgnam");
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_WindowChainingStep.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,132 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+#include <apgcli.h>
+#include "T_WindowChainingStep.h"
+#include "TWindowChaining.h"
+#include <apacmdln.h>
+
+/**
+   @SYMTestCaseID TODO
+  
+   @SYMPREQ DEFECT 053778 - Window Chaining
+  
+   @SYMTestCaseDesc
+   Stuff
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+   1. Create a child ui application (t_winchainlaunch.exe)
+   2. From t_winchainlaunch.exe, connect a child application (t_winchainchild.exe) with
+      a specific ordinal
+   3. Send message to child application from launching application
+   4. When message is received by child application, check they share the same ordinal
+   5. Child application reports back to launch application the result of the test
+   6. Launch application quits with the test result as an exit code
+  
+   @SYMTestExpectedResults
+   Window group ordinals should be the same.  
+   t_winchainlaunch.exe should exit with KTWindowChainingTestPassed.
+  
+ */
+void CT_WindowChainingStep::TestWindowChainingL()
+	{
+
+	TThreadId appThreadId(0U);
+
+	RApaLsSession ls;
+	CleanupClosePushL(ls);
+	TInt ret = ls.Connect();
+	TEST(ret == KErrNone);
+	
+	CApaCommandLine* cmdLine=CApaCommandLine::NewLC();
+    
+	cmdLine->SetExecutableNameL(KWinChainChildAppFileName);
+	cmdLine->SetCommandL(EApaCommandOpen);
+
+	// start document, causing GuiBaseChildApp.exe to be launched
+	INFO_PRINTF1(_L("Launching Child Application"));
+
+	// start child application
+	ret = ls.StartApp(*cmdLine, appThreadId);
+	TEST(ret == KErrNone);
+	User::LeaveIfError(ret);
+	CleanupStack::PopAndDestroy(2);  // ls and cmdLine
+	
+	RThread appThread;
+	User::LeaveIfError(appThread.Open(appThreadId));
+	
+	TRequestStatus logonRequestStatus;
+	appThread.Logon(logonRequestStatus);
+
+	// wait for t_windowchainLaunch.exe to terminate
+	INFO_PRINTF1(_L("Waiting for application to terminate..."));
+	User::WaitForRequest(logonRequestStatus);
+
+	const TExitType exitType = appThread.ExitType();
+	const TInt exitReason = appThread.ExitReason();
+	TExitCategoryName categoryName = appThread.ExitCategory();
+	appThread.Close();
+
+	TBuf<50> msg;
+	if (exitType == EExitPanic)
+		{
+		_LIT(KAppPanicInfo, "Application panic: %S %d");
+		msg.Format(KAppPanicInfo, &categoryName, exitReason);
+		}
+	else
+		{
+		_LIT(KAppExitInfo, "Application exited with code %d");
+		msg.Format(KAppExitInfo, exitReason);
+		}
+	INFO_PRINTF1(msg);
+
+	TEST(logonRequestStatus == KTWindowChainingTestPassed);
+	TEST(exitType == EExitKill);
+	TEST(exitReason == KTWindowChainingTestPassed);
+	
+	if (exitReason == KTWindowChainingTestPassed)
+		SetTestStepResult(EPass);
+	else
+		SetTestStepResult(EFail);
+	}
+	
+TVerdict CT_WindowChainingStep::doTestStepL()
+{
+	__UHEAP_MARK;
+		
+	INFO_PRINTF1(_L("Test Started"));
+
+	// run the test
+	TRAPD(err, TestWindowChainingL());
+	INFO_PRINTF2(_L("  test completes with %d"), err);
+	TEST(err == KErrNone);
+
+	INFO_PRINTF1(_L("Test Finished"));
+		
+	__UHEAP_MARKEND;
+	return TestStepResult();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_WindowChainingStep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,39 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+#if (!defined __T_WINDOWCHAININGSTEP_H__)
+#define __T_WINDOWCHAININGSTEP_H__
+
+#include <TestExecuteStepBase.h>
+
+class CT_WindowChainingStep : public CTestStep
+	{
+public:
+	virtual TVerdict doTestStepL();
+private:
+	void TestWindowChainingL();
+ 
+	};
+
+_LIT(KT_WindowChainingStep, "T_WindowChaining");
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_groupNametest.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,124 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// The following test case is used to test whether the group name specified in the registration file 
+// is "overridden" by the group name specified in the localisable resource file 
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+#include "testableapalssession.h"
+#include <APAID.H>
+#include "T_groupNametest.h"
+#include "ApparcTestServer.h"
+#include "TestExecuteStepBase.h"
+
+// CT_GroupNameStep
+
+const TUid KUidTGroupName={0x10208185};
+
+/**
+  Constructor
+*/
+CT_GroupNameStep::CT_GroupNameStep()
+	{
+	}
+
+
+/**
+  Destructor
+*/
+CT_GroupNameStep::~CT_GroupNameStep()
+	{
+	}
+
+
+/**
+   @SYMTestCaseID T-GroupNameStep-DoTestGroupNameL
+  
+   @SYMPREQ
+
+   @SYMTestCaseDesc     T_groupname to test the Groupname in localisable resource file
+   
+   @SYMTestPriority High
+   
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions	 
+   It connects to the Application Architecture server to perform the
+   following:
+   To test whether the group name specified in the registration file 
+   is "overridden" by the group name specified in the localisable resource file 
+   It calls the following function to get information about the groupname.
+   RApaLsSession::GetAppCapability(TDes8& aCapabilityBuf,TUid aAppUid) const\n
+   After the call Succeeds call the RApaLsSession::GetAppCapability(TDes8& aCapabilityBuf,TUid aAppUid) const\n
+   with the KNullUid . The Retrun value is KErrNotFound.
+   
+	
+   @SYMTestExpectedResults
+   GetAppCapability should return the groupname
+   defined in the application's localisable resource file.
+  
+ */
+void CT_GroupNameStep::DoTestGroupNameL(RApaLsSession& aLs)
+	{
+	TApaAppCapabilityBuf cbuf;
+	TApaAppCapability capability;
+	 
+	// To read the groupname defined in localisable resource file
+
+	TInt err = aLs.GetAppCapability(cbuf,KUidTGroupName);
+	TEST(err == KErrNone);
+	
+    
+	TEST(aLs.GetAppCapability(cbuf,KNullUid) == KErrNotFound);
+
+	//since the value was kErrNotFound, the value of cbuf is unaltered
+	capability = cbuf();
+	_LIT(KGroupname,"Loc_groupname");
+	
+	TEST(capability.iGroupName == KGroupname);
+
+	}
+
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+TVerdict CT_GroupNameStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L(" Test Started"));
+
+	//To test whether the group name specified in the registration file 
+	//is "overridden" by the group name specified in the localisable resource file 
+
+	RTestableApaLsSession ls;
+	TEST(KErrNone == ls.Connect());
+	CleanupClosePushL(ls);
+	
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoTestGroupNameL(ls), NO_CLEANUP);
+	
+	CleanupStack::PopAndDestroy(&ls);
+
+	INFO_PRINTF1(_L(" TEST Finished"));
+		
+	return TestStepResult();
+
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_groupNametest.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,45 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+ 
+
+#if (!defined __T_groupNametest_H__)
+#define __T_groupNametest_H__
+
+#include "ApparcTestServer.h"
+
+//  A CT_GroupNameStep test class. 
+
+class CT_GroupNameStep : public CTestStep
+	{
+public:
+	CT_GroupNameStep();
+	~CT_GroupNameStep();
+	virtual TVerdict doTestStepL();
+	void DoTestGroupNameL(RApaLsSession& aLs);
+
+private:
+	};
+
+
+_LIT(KT_GroupNameStep, "T_GroupName");
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_groupNametest_ver1.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,115 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// The following test case is used to test whether the groupname specified in the 
+// registration file is read if its not defined in the localisable resource file
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+#include "testableapalssession.h"
+#include <APAID.H>
+#include "T_groupNametest_ver1.h"
+#include "ApparcTestServer.h"
+#include "TestExecuteStepBase.h"
+
+// CT_GroupNameStep_ver1
+
+const TUid KUidTGroupName={0x10208183};
+
+/**
+   Constructor
+*/
+CT_GroupNameStep_ver1::CT_GroupNameStep_ver1()
+	{
+	}
+
+
+/**
+  Destructor
+*/
+CT_GroupNameStep_ver1::~CT_GroupNameStep_ver1()
+	{
+	}
+
+
+/**
+   @SYMTestCaseID T-GroupNameStep-ver1-DoTestGroupNameL
+  
+   @SYMPREQ
+
+   @SYMTestCaseDesc 
+   T_groupname to test the Groupname in localisable resource file
+   
+   @SYMTestPriority High
+   
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions
+   It connects to the Application Architecture server to perform the following:
+   To test whether the groupname defined in registration file is read if its
+   not defined in the localisable resource file
+   It calls the following function to get the information about the groupname.
+   RApaLsSession::GetAppCapability(TDes8& aCapabilityBuf,TUid aAppUid) const\n
+
+   @SYMTestExpectedResults
+   GetAppCapability should return the groupname
+   defined in the application's registration file.
+ 
+ */
+void CT_GroupNameStep_ver1::DoTestGroupNameL(RApaLsSession& aLs)
+	{
+	TApaAppCapabilityBuf cbuf;
+	TApaAppCapability capability;
+	 
+	// To read the groupname defined in registration resource file
+
+	TInt err = aLs.GetAppCapability(cbuf,KUidTGroupName);
+	TEST(err == KErrNone);
+	capability = cbuf();
+	_LIT(KGroupname,"Reg_groupname");
+	
+	TEST(capability.iGroupName == KGroupname);
+	}
+
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+TVerdict CT_GroupNameStep_ver1::doTestStepL()
+	{
+	INFO_PRINTF1(_L(" Test Started"));
+
+	RTestableApaLsSession ls;
+	TEST(KErrNone == ls.Connect());
+	CleanupClosePushL(ls);
+
+    //To test whether the groupname defined in the 
+	//registration file is read if its not defined in localisable resource file
+
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoTestGroupNameL(ls), NO_CLEANUP);
+	
+	CleanupStack::PopAndDestroy(&ls);
+
+	INFO_PRINTF1(_L(" Test Finished"));
+		
+	return TestStepResult();
+
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_groupNametest_ver1.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,45 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+#if (!defined __T_groupNametest_ver1_H__)
+#define __T_groupNametest_ver1_H__
+
+#include "ApparcTestServer.h"
+
+//  A CT_GroupNameStep_ver1 test class. 
+
+class CT_GroupNameStep_ver1 : public CTestStep
+	{
+public:
+	CT_GroupNameStep_ver1();
+	~CT_GroupNameStep_ver1();
+	virtual TVerdict doTestStepL();
+	void DoTestGroupNameL(RApaLsSession& aLs);
+
+private:
+	};
+
+_LIT(KT_GroupNameStep_ver1, "T_GroupName_ver1");
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_groupNametest_ver2.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,109 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// The following test case is used to test that the information read from "old format" resource files 
+// isn't thrown  away because of an error while trying to read the group name member that 
+// isn't present in localisable resource file.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include "testableapalssession.h"
+#include "APAID.H"
+#include "T_groupNametest_ver2.h"
+#include "ApparcTestServer.h"
+#include "TestExecuteStepBase.h"
+
+// CT_GroupNameStep_ver2
+
+
+const TUid KUidTGroupName={0x10208184};
+
+/**
+  Constructor
+*/
+CT_GroupNameStep_ver2::CT_GroupNameStep_ver2()
+	{
+	}
+
+
+/**
+  Destructor
+*/
+CT_GroupNameStep_ver2::~CT_GroupNameStep_ver2()
+	{
+	}
+
+/**
+   @SYMTestCaseID T-GroupNameStep-Ver2-DoTestCaptionNameL
+  
+   @SYMPREQ
+
+   @SYMTestPriority High
+   
+   @SYMTestStatus Implemented
+	 
+   @SYMTestCaseDesc 
+   T-groupname to test localisable resource file
+  
+   @SYMTestActions
+   It connects to the Application Architecture server to perform the following:
+   To test that information read from "old format" resource files isn't thrown away because
+   of an error while trying to read the group name member that isn't present in localisable resource file..
+   It calls following function to get the information about the groupname.
+   RApaLsSession::GetAppInfo(TApaAppInfo& aInfo,TUid aAppUid) const\n
+  
+   @SYMTestExpectedResults
+   GetAppInfo should return the caption name and ShortCaption Name 
+   defined in the localisable resource file.
+  
+ */
+void CT_GroupNameStep_ver2::DoTestCaptionNameL(RApaLsSession& aLs)
+	{
+	TApaAppInfo info;
+	TInt err = aLs.GetAppInfo(info,KUidTGroupName);
+	TEST(err == KErrNone);
+	_LIT(KCaption,"T_groupname_ver2");
+	_LIT(KShortCaption,"TGrpNameV2");	
+			
+	TEST(info.iCaption == KCaption);
+	TEST(info.iShortCaption == KShortCaption);
+	}
+
+/**
+   @return - TVerdict code
+   Override of base class virtual
+ */
+TVerdict CT_GroupNameStep_ver2::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test Started"));
+
+	RTestableApaLsSession ls;
+	TEST(KErrNone == ls.Connect());
+	CleanupClosePushL(ls);
+
+	HEAP_TEST_LS_SESSION(ls, 0, 0, DoTestCaptionNameL(ls), NO_CLEANUP);
+
+	CleanupStack::PopAndDestroy(&ls);
+
+	INFO_PRINTF1(_L("Test Finished"));
+
+	return TestStepResult();
+
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_groupNametest_ver2.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,44 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#if (!defined __T_groupNametest_ver2_H__)
+#define __T_groupNametest_ver2_H__
+
+#include "ApparcTestServer.h"
+
+//  A CT_GroupNameStep_ver2 test class. 
+
+class CT_GroupNameStep_ver2 : public CTestStep
+	{
+public:
+	CT_GroupNameStep_ver2();
+	~CT_GroupNameStep_ver2();
+	virtual TVerdict doTestStepL();
+	void DoTestCaptionNameL(RApaLsSession& aLs);
+	
+private:
+	};
+
+_LIT(KT_GroupNameStep_ver2, "T_GroupName_ver2");
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_groupname_loc.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,53 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file T_groupname_loc.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+
+RESOURCE LOCALISABLE_APP_INFO
+	{
+	group_name = "Loc_groupname";
+	caption_and_icon = 
+		{
+		CAPTION_AND_ICON_INFO
+			{
+			caption = "T_groupname";
+			number_of_icons = 0;
+			}
+		};
+	view_list =
+		{
+		VIEW_DATA
+			{
+			uid = 0xA0004361;
+			screen_mode = 0x00;
+			caption_and_icon =
+				{
+				CAPTION_AND_ICON_INFO
+					{
+					caption = "T_groupname";
+					number_of_icons = 1;
+					icon_file = "file:///c/resource/apps/tcheckiconapp.xyz";
+					}
+				};
+			}
+		};
+	}	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_groupname_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file T_groupname_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+
+UID3 0x10208185	// App UID
+
+RESOURCE APP_REGISTRATION_INFO
+	{	
+	app_file = "T_groupname";
+	group_name = "Reg_groupname";
+	localisable_resource_file="\\Resource\\Apps\\T_groupname_loc";
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_groupnamever1_loc.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,37 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file T_groupname1_loc.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+
+#include <appinfo.rh>
+
+RESOURCE LOCALISABLE_APP_INFO
+	{
+	group_name = "";
+	caption_and_icon = 
+		{
+		CAPTION_AND_ICON_INFO
+			{
+			caption = "T_groupname_ver1";
+			number_of_icons = 0;
+			}
+		};
+	}	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_groupnamever1_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file T_groupname1_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+
+UID3 0x10208183	// App UID
+
+RESOURCE APP_REGISTRATION_INFO
+	{	
+	app_file = "T_groupname_ver1";
+	group_name = "Reg_groupname";
+	localisable_resource_file="\\Resource\\Apps\\T_groupnamever1_loc";
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_groupnamever2_loc.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,37 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file T_groupname2_loc.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+
+#include <AppInfo_NoLocalisableGroupName.rh>
+
+RESOURCE LOCALISABLE_APP_INFO__NO_GROUP_NAME // use this STRUCT rather than LOCALISABLE_APP_INFO, to test whether Apparc copes with the group-name being missing
+	{
+	short_caption = "TGrpNameV2";
+	caption_and_icon = 
+		{
+		CAPTION_AND_ICON_INFO
+			{
+			caption = "T_groupname_ver2";
+			number_of_icons = 0;
+			}
+		};
+	}	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/T_groupnamever2_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,33 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file T_groupname2_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <AppInfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+
+UID3 0x10208184 // App UID
+
+RESOURCE APP_REGISTRATION_INFO
+	{	
+	app_file = "T_groupname_ver2";
+	localisable_resource_file="\\Resource\\Apps\\T_groupnamever2_loc";
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TestTrustedPriorityApp1_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,35 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file TestTrustedPriorityApp1_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10207f8D
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="TestTrustedPriorityApp1";
+	hidden=KAppNotHidden;
+	embeddability=KAppNotEmbeddable;
+	newfile=KAppDoesNotSupportNewFile;
+	launch=KAppLaunchInForeground;
+	}	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TestTrustedPriorityApp2_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,39 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file TestTrustedPriorityApp2_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10207f8F
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="TestTrustedPriorityApp2";
+	hidden=KAppNotHidden;
+	embeddability=KAppNotEmbeddable;
+	newfile=KAppDoesNotSupportNewFile;
+	launch=KAppLaunchInForeground;
+	datatype_list= 
+		{
+		DATATYPE { priority=0xfeee; type="text/html"; }
+		}; 
+	}	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TestUnTrustedPriorityApp1_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,35 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file TestUnTrustedPriorityApp1_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10207f8C
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="TestUnTrustedPriorityApp1";
+	hidden=KAppNotHidden;
+	embeddability=KAppNotEmbeddable;
+	newfile=KAppDoesNotSupportNewFile;
+	launch=KAppLaunchInForeground;
+	}	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/TestUnTrustedPriorityApp2_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,42 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file TestUnTrustedPriorityApp2_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+
+// uid in unprotected range
+UID3 0xA3010010	//This UID is used for T_RApaLsSessionTestStep_TestDataPriorityForUnTrustedAppsRegFile 
+				//test case to the test datapriority threshold for UnTrusted Apps
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="TestUnTrustedPriorityApp2";
+	hidden=KAppNotHidden;
+	embeddability=KAppNotEmbeddable;
+	newfile=KAppDoesNotSupportNewFile;
+	launch=KAppLaunchInForeground;
+	datatype_list= 
+		{
+		DATATYPE { priority=0xffff; type="text/html"; }
+		}; 
+	}	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/UnProctectedUidApp.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,119 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikenv.h>
+#include <EIKSTART.H>
+
+/** KTUnProtectedAppTestPassed is a number chosen at random to be used as an exit reason
+    for UnProtectedApp.exe's application thread to signify that the test passed */
+const TInt KTUnProtectedAppTestPassed = 1234;
+
+///////////////////////////////////////////////////////////////////////
+//
+// CExampleAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppUi : public CEikAppUi
+    {
+public:
+    void ConstructL();
+	~CExampleAppUi();
+	};
+
+
+void CExampleAppUi::ConstructL()
+    {
+    BaseConstructL();
+    User::Exit(KTUnProtectedAppTestPassed);
+	}
+
+CExampleAppUi::~CExampleAppUi()
+	{
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleDocument : public CEikDocument
+	{
+public:
+	static CExampleDocument* NewL(CEikApplication& aApp);
+	CExampleDocument(CEikApplication& aApp);
+	void ConstructL();
+private: 
+	           // Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+CExampleDocument::CExampleDocument(CEikApplication& aApp)
+		: CEikDocument(aApp)
+	{
+	}
+
+CEikAppUi* CExampleDocument::CreateAppUiL()
+	{
+    return new(ELeave) CExampleAppUi;
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+class CExampleApplication : public CEikApplication
+	{
+private: 
+	// Inherited from class CApaApplication
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+private:
+	CApaDocument* CreateDocumentL(CApaProcess* a) { return CEikApplication::CreateDocumentL(a); }
+	};
+
+const TUid KUidUnProctectedUidApp = { 0xA0001C5E }; 
+
+TUid CExampleApplication::AppDllUid() const
+	{
+	return KUidUnProctectedUidApp;
+	}
+
+CApaDocument* CExampleApplication::CreateDocumentL()
+	{
+	return new (ELeave) CExampleDocument(*this);
+	}
+
+EXPORT_C CApaApplication* NewApplication()
+	{
+	return new CExampleApplication;
+	}
+
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication(NewApplication);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/UnProctectedUidApp.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,59 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <platform_paths.hrh>
+
+// using relative paths for sourcepath and user includes
+TARGET        unproctecteduidapp.exe
+TARGETTYPE    exe
+TARGETPATH    /sys/bin
+
+CAPABILITY 	All -Tcb
+
+UID           0x100039CE 0xA0001C5E
+VENDORID 0x70000001
+
+SOURCEPATH    .
+SOURCE		unproctecteduidapp.cpp
+
+SOURCEPATH		.
+
+start resource	unproctecteduidapp.rss
+HEADER
+targetpath 		/resource/apps
+end
+
+// Application exe registration resource file
+resource	unproctecteduidapp_reg.rss
+start resource	unproctecteduidapp_reg.rss
+targetpath 	/private/10003a3f/apps
+lang		sc
+end
+
+USERINCLUDE   .
+SYSTEMINCLUDE /epoc32/include
+SYSTEMINCLUDE /epoc32/include/techview
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY       euser.lib apparc.lib eikcore.lib cone.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/UnProctectedUidApp.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,61 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+NAME UNPR
+
+#include <eikon.rh>
+#include <eikcore.rsg>
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+	{
+	hotkeys=r_example_hotkeys;
+	menubar=r_example_menubar;
+	}
+
+RESOURCE HOTKEYS r_example_hotkeys
+    {
+    control=
+        {
+        HOTKEY { command=EEikCmdExit; key='e'; }
+        };
+    }
+
+RESOURCE MENU_BAR r_example_menubar
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_example_first_menu; txt="UnProctectedUidApp"; }
+		};
+    }
+
+RESOURCE MENU_PANE r_example_first_menu
+	{
+	items=
+		{
+		MENU_ITEM { command=EEikCmdExit; txt="Close"; }
+        };
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/UnProctectedUidApp_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,36 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0xA0001C5E
+RESOURCE APP_REGISTRATION_INFO
+	{	
+	app_file = unproctecteduidapp;
+	
+	hidden=KAppNotHidden;
+	embeddability=KAppNotEmbeddable;
+	newfile=KAppDoesNotSupportNewFile;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/app_CTRL.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,235 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include <e32uid.h>
+#include <e32base.h>
+#include <e32test.h>
+#include <apgctl.h>
+
+#include <coeccntx.h>
+
+#include <apgtask.h>
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+#include <apgcli.h>
+
+#include <eikon.hrh>
+
+#include <App_CTRL.rsg>
+#include "App_CTRL.hrh"
+
+#include <eikstart.h>
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppView
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppView : public CCoeControl
+    {
+public:
+	static CExampleAppView* NewL(const TRect& aRect);
+	CExampleAppView();
+	~CExampleAppView();
+    void ConstructL(const TRect& aRect);
+
+private:
+	           // Inherited from CCoeControl
+	void Draw(const TRect& /*aRect*/) const;
+
+private:
+	HBufC*  iExampleText;
+    };
+
+CExampleAppView::CExampleAppView()
+	{
+	}
+
+CExampleAppView* CExampleAppView::NewL(const TRect& aRect)
+	{
+	CExampleAppView* self = new(ELeave) CExampleAppView();
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect);
+	CleanupStack::Pop();
+	return self;
+	}
+
+CExampleAppView::~CExampleAppView()
+	{
+	delete iExampleText;
+	}
+
+void CExampleAppView::ConstructL(const TRect& aRect)
+        {
+	iExampleText = iEikonEnv->AllocReadResourceL(R_EXAMPLE_TEXT_TITLE);
+	CreateWindowL();
+	SetRect(aRect);
+	ActivateL();
+       }
+
+void CExampleAppView::Draw(const TRect& /*aRect*/) const
+	{
+	CWindowGc& gc = SystemGc();
+	TRect      drawRect = Rect();
+	const CFont*     fontUsed;
+	
+	gc.Clear();
+  	fontUsed = iEikonEnv->TitleFont();
+	gc.UseFont(fontUsed);
+	TInt   baselineOffset=(drawRect.Height() - fontUsed->HeightInPixels())/2; 
+	gc.DrawText(*iExampleText,drawRect,baselineOffset,CGraphicsContext::ECenter, 0);
+	gc.DiscardFont();
+	}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppUi : public CEikAppUi
+    {
+public:
+    void ConstructL();
+	~CExampleAppUi();
+private:
+              // Inherirted from class CEikAppUi
+	void HandleCommandL(TInt aCommand);
+
+	// From CCoeAppUi
+	void HandleSystemEventL(const TWsEvent& aEvent);
+
+private:
+	CCoeControl* iAppView;
+	};
+
+
+void CExampleAppUi::ConstructL()
+    {
+    BaseConstructL();
+	iAppView = CExampleAppView::NewL(ClientRect());
+	}
+
+CExampleAppUi::~CExampleAppUi()
+	{
+	delete iAppView;
+	}
+
+void CExampleAppUi::HandleCommandL(TInt aCommand)
+	{
+	switch (aCommand)
+		{
+		      // Just issue simple info messages to show that
+		      // the menu items have been selected
+	case EExampleItem0:
+		iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM0);
+		break;
+
+	
+	case EExampleItem1:
+		iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM1);
+		break;
+	
+	case EExampleItem2:
+		iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM2);
+		break;
+	case EEikCmdExit: 
+		Exit();
+		break;
+		}
+	}
+
+
+void CExampleAppUi::HandleSystemEventL(const TWsEvent& /*aEvent*/)
+	{
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleDocument : public CEikDocument
+	{
+public:
+	static CExampleDocument* NewL(CEikApplication& aApp);
+	CExampleDocument(CEikApplication& aApp);
+	void ConstructL();
+private: 
+	           // Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+CExampleDocument::CExampleDocument(CEikApplication& aApp)
+		: CEikDocument(aApp)
+	{
+	}
+
+CEikAppUi* CExampleDocument::CreateAppUiL()
+	{
+    return new(ELeave) CExampleAppUi;
+	}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+class CExampleApplication : public CEikApplication
+	{
+private: 
+	           // Inherited from class CApaApplication
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+private:
+	CApaDocument* CreateDocumentL(CApaProcess* a) { return CEikApplication::CreateDocumentL(a); }
+	//
+	};
+
+const TUid KUidSimpleApp = { 0X13008ACE }; 
+
+TUid CExampleApplication::AppDllUid() const
+	{
+	return KUidSimpleApp;
+	}
+
+CApaDocument* CExampleApplication::CreateDocumentL()
+	{
+	return new (ELeave) CExampleDocument(*this);
+	}
+
+
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CExampleApplication;
+	}
+
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication(NewApplication);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/app_CTRL.MMP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+//
+// App_CTRL.MMP for test component App_CTRL (released in APPARC)
+//
+
+#include <platform_paths.hrh>
+
+target		APP_CTRL.EXE
+TARGETTYPE 	exe
+
+UID             0x100039CE 0x13008ACE
+targetpath      /sys/bin
+CAPABILITY 	All -Tcb
+VENDORID 	0x70000001
+
+SOURCEPATH	.	
+
+// your public include directory should be here
+systeminclude   ../inc
+systeminclude   /epoc32/include
+systeminclude   /epoc32/include/techview
+
+MW_LAYER_SYSTEMINCLUDE
+
+// Application exe specific resource which is localised to the application
+resource  	App_CTRL.rss
+start resource  App_CTRL.rss
+targetpath	/Resource/apps
+lang 		sc
+end
+
+// Application exe registration resource file
+resource  	App_CTRL_reg.rss
+start resource 	App_CTRL_reg.rss
+targetpath 	/private/10003a3f/apps
+lang		sc
+end
+
+// Application localisable resource file
+resource  	App_CTRL_loc.rss
+start resource 	App_CTRL_loc.rss
+targetpath 	/Resource/apps
+lang		sc
+end
+
+SOURCE		App_CTRL.CPP
+
+
+LIBRARY       	APPARC.LIB
+LIBRARY       	CONE.LIB 
+LIBRARY       	EIKCORE.LIB 
+LIBRARY       	EUSER.LIB
+LIBRARY       	GDI.LIB
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/app_CTRL2.CPP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,233 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include <e32uid.h>
+#include <e32base.h>
+#include <e32test.h>
+#include <apgctl.h>
+
+#include <coeccntx.h>
+
+#include <apgtask.h>
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+#include <apgcli.h>
+
+#include <eikon.hrh>
+
+#include <App_CTRL2.rsg>
+#include "App_CTRL2.hrh"
+#include <eikstart.h>
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppView
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppView : public CCoeControl
+    {
+public:
+	static CExampleAppView* NewL(const TRect& aRect);
+	CExampleAppView();
+	~CExampleAppView();
+    void ConstructL(const TRect& aRect);
+
+private:
+	           // Inherited from CCoeControl
+	void Draw(const TRect& /*aRect*/) const;
+
+private:
+	HBufC*  iExampleText;
+    };
+
+CExampleAppView::CExampleAppView()
+	{
+	}
+
+CExampleAppView* CExampleAppView::NewL(const TRect& aRect)
+	{
+	CExampleAppView* self = new(ELeave) CExampleAppView();
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect);
+	CleanupStack::Pop();
+	return self;
+	}
+
+CExampleAppView::~CExampleAppView()
+	{
+	delete iExampleText;
+	}
+
+void CExampleAppView::ConstructL(const TRect& aRect)
+    {
+	iExampleText = iEikonEnv->AllocReadResourceL(R_EXAMPLE_TEXT_TITLE);
+	CreateWindowL();
+	SetRect(aRect);
+	ActivateL();
+	}
+
+void CExampleAppView::Draw(const TRect& /*aRect*/) const
+	{
+	CWindowGc& gc = SystemGc();
+	TRect      drawRect = Rect();
+	const CFont*     fontUsed;
+	
+	gc.Clear();
+  	fontUsed = iEikonEnv->TitleFont();
+	gc.UseFont(fontUsed);
+	TInt   baselineOffset=(drawRect.Height() - fontUsed->HeightInPixels())/2; 
+	gc.DrawText(*iExampleText,drawRect,baselineOffset,CGraphicsContext::ECenter, 0);
+	gc.DiscardFont();
+	}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppUi : public CEikAppUi
+    {
+public:
+    void ConstructL();
+	~CExampleAppUi();
+private:
+              // Inherirted from class CEikAppUi
+	void HandleCommandL(TInt aCommand);
+
+	// From CCoeAppUi
+	void HandleSystemEventL(const TWsEvent& aEvent);
+
+private:
+	CCoeControl* iAppView;
+	};
+
+
+void CExampleAppUi::ConstructL()
+    {
+    BaseConstructL();
+	iAppView = CExampleAppView::NewL(ClientRect());
+	}
+
+CExampleAppUi::~CExampleAppUi()
+	{
+	delete iAppView;
+	}
+
+void CExampleAppUi::HandleCommandL(TInt aCommand)
+	{
+	switch (aCommand)
+		{
+		      // Just issue simple info messages to show that
+		      // the menu items have been selected
+	case EExampleItem0:
+		iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM0);
+		break;
+
+	case EExampleItem1:
+		iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM1);
+		break;
+	
+	case EExampleItem2:
+		iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM2);
+		break;
+	case EEikCmdExit: 
+		Exit();
+		break;
+		}
+	}
+
+
+void CExampleAppUi::HandleSystemEventL(const TWsEvent& /*aEvent*/)
+	{
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleDocument : public CEikDocument
+	{
+public:
+	static CExampleDocument* NewL(CEikApplication& aApp);
+	CExampleDocument(CEikApplication& aApp);
+	void ConstructL();
+private: 
+	           // Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+CExampleDocument::CExampleDocument(CEikApplication& aApp)
+		: CEikDocument(aApp)
+	{
+	}
+
+CEikAppUi* CExampleDocument::CreateAppUiL()
+	{
+    return new(ELeave) CExampleAppUi;
+	}
+
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+class CExampleApplication : public CEikApplication
+	{
+private: 
+	           // Inherited from class CApaApplication
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+private:
+	CApaDocument* CreateDocumentL(CApaProcess* a) { return CEikApplication::CreateDocumentL(a); }
+	//
+	};
+
+const TUid KUidSimpleApp = { 0x13008ADE }; 
+
+TUid CExampleApplication::AppDllUid() const
+	{
+	return KUidSimpleApp;
+	}
+
+CApaDocument* CExampleApplication::CreateDocumentL()
+	{
+	return new (ELeave) CExampleDocument(*this);
+	}
+
+
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CExampleApplication;
+	}
+
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication(NewApplication);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/app_CTRL2.MMP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+//
+// App_CTRL2.MMP for test component App_CTRL2 (released in APPARC)
+//
+
+#include <platform_paths.hrh>
+
+target		APP_CTRL2.EXE
+TARGETTYPE 	exe
+
+CAPABILITY 	All -Tcb
+VENDORID 	0x70000001
+
+UID             0x100039CE 0x13008ADE
+targetpath 	/sys/bin
+SOURCEPATH	.	
+
+// your public include directory should be here
+systeminclude   ../inc
+systeminclude   /epoc32/include
+systeminclude   /epoc32/include/techview
+systeminclude   /epoc32/include/kernel
+
+MW_LAYER_SYSTEMINCLUDE
+
+source          App_CTRL2.CPP
+
+// Application exe specific resource which is localised to the application
+resource	App_CTRL2.rss
+start resource	App_CTRL2.rss
+targetpath	/Resource/apps
+lang		sc
+end
+
+// Application exe registration resource file
+resource	App_CTRL2_reg.rss
+start resource	App_CTRL2_reg.rss
+targetpath 	/private/10003a3f/import/apps
+lang		sc
+end
+
+
+LIBRARY       	APPARC.LIB
+LIBRARY       	CONE.LIB 
+LIBRARY       	EIKCORE.LIB 
+LIBRARY       	EUSER.LIB
+LIBRARY       	GDI.LIB
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/apparctestserver.MMP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,235 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <platform_paths.hrh>
+
+target			apparctestserver.EXE
+targettype		exe
+UID             0x1000007A 0x101F289C
+CAPABILITY  	AllFiles WriteDeviceData PowerMgmt Protserv SwEvent
+
+
+SYSTEMINCLUDE   /EPOC32/INCLUDE /EPOC32/INCLUDE/TECHVIEW /EPOC32/INCLUDE/TEST
+systeminclude /epoc32/include/ecom
+systeminclude  ../tef
+
+MW_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH		../tef
+SOURCE			apparctestserver.cpp
+
+//-------START 
+
+SOURCE		T_Foreground.cpp
+SOURCE		T_ProStep.cpp T_OOMStep.cpp T_File1Step.cpp T_File2Step.cpp T_File3Step.cpp
+SOURCE		T_BackupStep.cpp T_MdrStep.cpp
+SOURCE		T_Serv2Step.cpp  T_Serv3Step.cpp
+SOURCE		T_MRUStep.cpp T_WgnamStep.cpp
+SOURCE		T_CmdlnStep.cpp T_RApaLsSessionStep.cpp 
+SOURCE		T_ExeStep.cpp T_NotifStep.cpp
+SOURCE		T_CaptionStep.cpp T_LocaleStep.cpp 
+SOURCE		T_AutoMMCReaderOpen.cpp
+   
+SOURCE		T_ServicesStep.cpp
+SOURCE		T_StartAppStep.cpp
+SOURCE		T_ServiceRegistryStep.cpp
+SOURCE		T_StartDocStep.CPP
+SOURCE		T_ControlPanelTest.cpp
+SOURCE		T_RuleBasedLaunchingStep.cpp
+SOURCE		T_Capability1.cpp
+SOURCE		T_Capability2.cpp
+SOURCE		T_groupNametest.cpp
+SOURCE		T_groupNametest_ver1.cpp
+SOURCE		T_groupNametest_ver2.cpp
+SOURCE		T_windowchainingstep.cpp
+SOURCE		T_AppList.CPP
+SOURCE		T_SysStartApparcStep.cpp
+SOURCE		T_ProcStep.cpp
+SOURCE		T_DataMappingPersistenceA.cpp
+SOURCE		T_DataMappingPersistenceB.cpp
+SOURCE		T_DataMappingPersistenceC.cpp
+SOURCE		T_NonNativeAppsStep.cpp
+SOURCE		T_IntegritySupportStep.cpp
+SOURCE		T_IntegritySupportRebootStep.cpp
+SOURCE		T_ApsScan.CPP
+SOURCE		T_EndTaskStep.cpp
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+SOURCE		T_AppListFileUpdateStep.cpp
+SOURCE		T_AppListFileBootStep.cpp
+#endif
+SOURCE		testableapalssession.cpp
+SOURCE		t_largestackstep.cpp
+SOURCE		T_DataTypeMappingWithSid1.cpp
+SOURCE      t_abstractnonnativeappsstep.cpp
+SOURCE      t_drivenotification.cpp
+SOURCE		t_mimecontentpolicystep.cpp
+SOURCE		t_servicebasestep.cpp
+SOURCE		T_RecUpgrade.cpp
+
+resource		t_rapalssessionstep.rss
+start resource	t_rapalssessionstep.rss
+TARGETPATH		/system/test/t_rapalssessionstep
+lang			SC
+end
+
+// START resource files for service registration and discovery tests
+start resource	serverapp_loc.RSS
+HEADER
+targetpath	/resource/apps
+lang		sc
+end
+
+start resource	serverapp_reg.RSS
+targetpath	/private/10003a3f/apps
+lang		sc
+end
+
+start resource	serverapp3_reg.RSS
+targetpath	/private/10003a3f/apps
+lang		sc
+end
+
+start resource	serverapp6_reg.RSS
+targetpath	/private/10003a3f/apps
+lang		sc
+end
+
+start resource	serverapp7_reg.RSS
+targetpath	/private/10003a3f/apps
+lang		sc
+end
+
+start resource	serverapp2_reg.RSS
+targetpath	/private/10003a3f/apps
+lang		sc
+end
+
+start resource	serverapp4_reg.RSS
+targetpath	/private/10003a3f/apps
+lang		sc
+end
+
+start resource	openservice1a.RSS
+targetpath	/private/10003a3f/apps
+lang		sc
+end
+
+start resource	openservice1b.RSS
+targetpath	/private/10003a3f/apps
+lang		sc
+end
+
+start resource	T_DataPrioritySystem3_reg.rss 
+targetpath	/private/10003a3f/apps
+lang		sc
+end
+
+// END resource files for service registration and discovery tests
+
+
+start resource	TCtrlPnlApp_reg.RSS
+targetpath	/private/10003a3f/apps
+lang		sc
+end
+
+// START resource files for customising the default icon wrt locale
+
+start resource	CustomiseDefaultIconApp_loc.RSS
+HEADER
+targetpath	/resource/apps
+lang		SC 
+end
+
+start resource	CustomiseDefaultIconApp_reg.RSS
+targetpath	/private/10003a3f/import/apps
+lang		SC 
+end
+
+start bitmap		default_app_icon.m02
+targetpath		/resource/apps
+SOURCEPATH 		../tdatasrc
+source			c8,1 def25.bmp def25m.bmp def35.bmp def35m.bmp def50.bmp def50m.bmp 
+end 
+//END resource files for customising the default icon wrt locale
+
+
+start resource	TestUnTrustedPriorityApp1_reg.rss 
+targetpath	/private/10003a3f/import/apps
+lang		sc
+end
+
+start resource	TestTrustedPriorityApp1_reg.rss 
+targetpath	/private/10003a3f/apps
+lang		sc
+end
+
+start resource	TestUnTrustedPriorityApp2_reg.rss 
+targetpath	/private/10003a3f/import/apps
+lang		sc
+end
+
+start resource	TestTrustedPriorityApp2_reg.rss 
+targetpath	/private/10003a3f/apps
+lang		sc
+end
+
+start resource	T_groupname_loc.rss
+HEADER
+targetpath	/resource/apps
+lang		sc
+end
+
+start resource	T_groupnamever1_loc.rss
+HEADER
+targetpath	/resource/apps
+lang		sc
+end
+
+start resource	T_groupnamever2_loc.rss
+HEADER
+targetpath	/resource/apps
+lang		sc
+end
+
+resource  		T_groupname_reg.rss
+start resource 		T_groupname_reg.rss
+targetpath 		/private/10003a3f/apps
+end
+
+resource  		T_groupnamever1_reg.rss
+start resource 		T_groupnamever1_reg.rss
+targetpath 		/private/10003a3f/apps
+end
+
+resource  		T_groupnamever2_reg.rss
+start resource 		T_groupnamever2_reg.rss
+targetpath 		/private/10003a3f/apps
+end
+
+//-------END 
+
+USERINCLUDE	 	../tef
+userinclude		../../uiftestfw/inc
+
+LIBRARY		CONE.LIB WS32.LIB APPFWK_TEST_APPUI.LIB EUSER.LIB ECOM.LIB
+LIBRARY		TESTEXECUTEUTILS.LIB  TestExecuteLogClient.LIB
+LIBRARY		APPARC.LIB EFSRV.LIB ESTOR.LIB GDI.LIB FBSCLI.LIB
+LIBRARY     	APFILE.LIB APGRFX.LIB  BAFL.LIB APMIME.LIB APSERV.LIB
+LIBRARY		EIKCORE.LIB APPFWK_TEST_UTILS.LIB SERVICEREGISTRY.LIB
+LIBRARY     ticonloaderandiconarrayforleaks.lib centralrepository.lib
+// We're quite heavy on the stack... 4k in WinS isn't enough...
+EPOCSTACKSIZE	0xf000
+
+VENDORID 0x70000001
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/apparctestserver.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,390 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include <basched.h>
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikon.hrh>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eiklabel.h>
+#include <eikfctry.h>
+#include <coecntrl.h>
+#include <barsread.h>
+#include <eiktbar.h>
+#include <eikmenub.h>
+
+#include "appfwk_test_AppUi.h"
+#include "ApparcTestServer.h"
+#include "t_foreground.h"
+#include "T_ProStep.h"
+#include "T_OOMStep.h"
+#include "T_File1Step.h"
+#include "T_File2Step.h"
+#include "T_File3Step.h"
+#include "T_BackupStep.h"
+#include "T_MdrStep.h"
+#include "T_Serv2Step.h"
+#include "T_Serv3Step.h"
+#include "T_MruStep.h"
+#include "T_CmdlnStep.h"
+#include "T_WgnamStep.h"
+#include "T_ExeStep.h"
+#include "T_NotifStep.h"
+#include "T_CaptionStep.h"
+#include "T_LocaleStep.h"
+#include "T_RApaLsSessionStep.h"
+#include "T_ServicesStep.h"
+#include "T_ServiceRegistryStep.h"
+#include "T_StartAppStep.h"
+#include "T_StartDocStep.h"
+#include "T_AutoMMCReaderOpen.h"
+#include "T_ControlPanelTest.h"
+#include "T_RuleBasedLaunchingStep.h"
+#include "T_Capability1.h"
+#include "T_Capability2.h"
+#include "T_DataTypeMappingWithSid1.h"
+#include "T_groupNametest.h"
+#include "T_groupNametest_ver1.h"
+#include "T_groupNametest_ver2.h"
+#include "T_WindowChainingStep.h"
+#include "T_AppList.h"
+#include "T_SysStartApparcStep.h"
+#include "T_ProcStep.h"
+#include "T_DataMappingPersistenceA.h"
+#include "T_DataMappingPersistenceB.h"
+#include "T_DataMappingPersistenceC.h"
+#include "T_NonNativeAppsStep.h"
+#include "T_IntegritySupportStep.h"
+#include "T_IntegritySupportRebootStep.h"
+#include "T_ApsScan.h"
+#include "T_EndTaskStep.h"
+#include "T_RecUpgrade.h"
+#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+#include "T_AppListFileBootStep.h"
+#include "T_AppListFileUpdateStep.h"
+#endif //SYMBIAN_APPARC_APPINFO_CACHE
+#include "t_largestackstep.h"
+#include "t_drivenotification.h"
+#include "t_mimecontentpolicystep.h"
+#include "t_servicebasestep.h"
+
+CApparctestServer* CApparctestServer::NewL()
+/**
+   @return - Instance of the test server
+   Same code for Secure and non-secure variants
+   Called inside the MainL() function to create and start the
+   CTestServer derived server.
+ */
+	{
+	CApparctestServer * server = new (ELeave) CApparctestServer();
+	CleanupStack::PushL(server);
+	// CServer base class call
+	TParsePtrC serverName(RProcess().FileName());	
+	server->StartL(serverName.Name());
+	CleanupStack::Pop(server);
+	return server;
+	}
+
+
+
+CTestStep* CApparctestServer::CreateTestStep(const TDesC& aStepName)
+/**
+   @return - A CTestStep derived instance
+   Secure and non-secure variants
+   Implementation of CTestServer pure virtual
+ */
+	{
+	CTestStep* testStep = NULL;
+	// User::After(TTimeIntervalMicroSeconds32(5000000));
+	// This server creates just one step but create as many as you want
+	// They are created "just in time" when the worker thread is created 
+	if(aStepName == KTestAppListStep)
+		{
+		testStep = new CTestAppListStep();
+		}
+	else if(aStepName == KTestForegroundStep)
+		{
+		testStep = new CTestForegroundStep();
+		}
+	else if(aStepName == KT_ProStep)
+		{
+		testStep = new CT_ProStep();
+		}
+	else if(aStepName == KT_OOMStep)
+		{
+		testStep = new CT_OOMStep();
+		}	
+	else if(aStepName == KT_File1Step)
+		{
+		testStep = new CT_File1Step();
+		}
+	else if(aStepName == KT_File2Step)
+		{
+		testStep = new CT_File2Step();
+		}
+	else if(aStepName == KT_File3Step)
+		{
+		testStep = new CT_File3Step();
+		}
+	else if(aStepName == KT_BackupStep)
+		{
+		testStep = new CT_BackupStep();
+		}
+	else if(aStepName == KT_MdrStep)
+		{
+		testStep = new CT_MdrStep();
+		}
+	else if(aStepName == KT_Serv2Step)
+		{
+		testStep = new CT_Serv2Step();
+		}
+	else if(aStepName == KT_Serv3Step)
+		{
+		testStep = new CT_Serv3Step();
+		}
+	else if(aStepName == KT_MruStep)
+		{
+		testStep = new CT_MruStep();
+		}
+	else if(aStepName == KT_CmdlnStep)
+		{
+		testStep = new CT_CmdlnStep();
+		}
+	else if(aStepName == KT_RApaLsSessionStep)
+		{
+		testStep = new CT_RApaLsSessionTestStep();
+		}
+	else if(aStepName == KT_NotifStep)
+		{
+		testStep = new CT_NotifStep();
+		}
+	else if(aStepName == KT_WgnamStep)
+		{
+		testStep = new CT_WgnamStep();
+		}
+	else if(aStepName == KT_ExeStep)
+		{
+		testStep = new CT_ExeStep();
+		}
+	else if(aStepName == KT_CaptionStep)
+		{
+		testStep = new CT_CaptionStep();
+		}
+	else if(aStepName == KT_LocaleStep)
+		{
+		testStep = new CT_LocaleStep();
+		}
+	else if(aStepName == KT_ServicesStep)
+		{
+		testStep = new CT_ServicesTestStep();
+		}
+	else if(aStepName == KT_StartAppStep)
+		{
+		testStep = new CT_StartAppTestStep();
+		}
+	else if(aStepName == KT_ServiceRegistryStep)
+		{
+		testStep = new CT_ServiceRegistryTestStep();
+		}
+	else if(aStepName == KT_StartDocStep)
+		{
+		testStep = new CT_StartDocStep();
+		}
+	else if(aStepName == KTestAutoMMCReaderOpenStep)
+		{
+		testStep = new CTestAutoMMCReaderStep();
+		}
+	else if(aStepName == KT_ControlPanelTest)
+		{
+		testStep = new CT_ControlPanelTestStep();
+		}
+	else if(aStepName == KT_RuleBasedLaunchingStep)
+		{
+		testStep = new CTRuleBasedLaunchingStep();
+		}
+	else if(aStepName == KT_GroupNameStep)
+		{
+		testStep = new CT_GroupNameStep();
+		}
+	else if(aStepName == KT_GroupNameStep_ver1)
+		{
+		testStep = new CT_GroupNameStep_ver1();
+		}
+	else if(aStepName == KT_GroupNameStep_ver2)
+		{
+		testStep = new CT_GroupNameStep_ver2();
+		}
+	else if(aStepName == KT_Capability1)
+		{
+		testStep = new CT_Capability1();
+		}
+	else if(aStepName == KT_Capability2)
+		{
+		testStep = new CT_Capability2();
+		}
+    else if(aStepName == KT_DataTypeMappingWithSid1)
+        {
+        testStep = new CT_DataTypeMappingWithSid1();
+        }
+	else if (aStepName == KT_WindowChainingStep)
+		{
+		testStep = new CT_WindowChainingStep();
+		}
+	else if( (aStepName == KT_SysStartApparcStep) ||
+             (aStepName == KApparcStartupT_TestStartApp1L) ||
+             (aStepName == KApparcStartupT_TestStartApp2L) ||
+             (aStepName == KApparcStartupT_TestStartApp3L) ||
+             (aStepName == KApparcStartupT_TestStartApp4L) ||
+             (aStepName == KApparcStartupT_TestStartApp5L) ||
+             (aStepName == KApparcStartupT_TestStartApp6L) ||
+             (aStepName == KApparcStartupT_TestGetAllApps) ||
+             (aStepName == KApparcStartupT_TestInsertDataTypeL) ||
+             (aStepName == KApparcStartupT_TestAppForDataTypeL) ||
+             (aStepName == KApparcStartupT_TestDeleteDataTypeL) ||
+             (aStepName == KApparcStartupT_TestServiceDiscovery) ||
+             (aStepName == KApparcStartupT_TestGetAppInfo) ||
+             (aStepName == KApparcStartupT_TestAppCount) ||
+             (aStepName == KApparcStartupT_TestCreateDoc) ||
+             (aStepName == KApparcStartupT_TestLocalisedCaptionL) )
+		{
+		testStep = new CT_SysStartApparcStep();
+		}
+	else if (aStepName == KT_ProcStep)
+		{
+		testStep = new CT_ProcStep();
+		}
+	else if (aStepName == KT_DataMappingPersistenceAStep)
+		{
+		testStep = new CT_DataMappingPersistenceATestStep();
+		}
+	else if (aStepName == KT_DataMappingPersistenceBStep)
+		{
+		testStep = new CT_DataMappingPersistenceBTestStep();
+		}
+	else if (aStepName == _L("T_DataMappingPersistenceC"))
+		{
+		testStep = new CT_DataMappingPersistenceCTestStep();
+		}
+	else if (aStepName == _L("T_NonNativeApps"))
+		{
+		testStep = new CT_NonNativeAppsStep();
+		}
+	else if (aStepName == KT_IntegritySupportStep)
+		{
+		testStep = new CT_IntegritySupportTestStep();
+		}
+	else if (aStepName == KT_IntegritySupportReboot1Step)
+		{
+		testStep = new CT_IntegritySupportReboot1TestStep();
+		}
+	else if (aStepName == KT_IntegritySupportReboot2Step)
+		{
+		testStep = new CT_IntegritySupportReboot2TestStep();
+		}
+	else if (aStepName == KT_ApsScanStep)
+		{
+		testStep = new CT_ApsScanStep();
+		}
+	else if (aStepName == KT_EndTaskStep)
+		{
+		testStep = new CTEndTaskStep();
+		}	
+	#ifdef SYMBIAN_APPARC_APPINFO_CACHE
+	else if (aStepName == KT_AppListFileUpdate)
+		{
+		testStep = new CT_AppListFileUpdateStep();
+		}
+	else if (aStepName == KT_AppListFile_Boot1)
+		{ 		
+		testStep = new CT_AppListFileBootStep(1);
+		}
+	else if (aStepName == KT_AppListFile_Boot2)
+		{
+		testStep = new CT_AppListFileBootStep(2);
+		}
+	else if (aStepName == KT_AppListFile_Boot3)
+		{
+		testStep = new CT_AppListFileBootStep(3);
+		}
+	#endif //SYMBIAN_APPARC_APPINFO_CACHE
+	else if (aStepName == KT_LargeStackStep)
+		{
+		testStep = new CT_LargeStackStep();
+		}
+	else if (aStepName == KT_DriveNotificationStep)
+		{
+		testStep = new CT_DriveNotificationStep();
+		}
+	else if (aStepName == KT_MimeContentPolicyStep)
+		{
+		testStep = new CT_MimeContentPolicyStep();
+		}
+	else if (aStepName == KT_ServiceBaseStep)
+		{
+		testStep = new CT_ServiceBaseStep();
+		}
+	else if (aStepName == KT_RecUpgradeStep)
+		{
+		testStep = new CT_RecUpgradeStep();
+		}
+	
+	return testStep;
+	}
+
+
+LOCAL_C void MainL()
+	{
+	// Leave the hooks in for platform security
+	RProcess().DataCaging(RProcess::EDataCagingOn);
+	RProcess().SecureApi(RProcess::ESecureApiOn);
+
+	CActiveScheduler* sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sched);
+	CApparctestServer* server = NULL;
+	// Create the CTestServer derived server
+	TRAPD(err,server = CApparctestServer::NewL());;
+	
+	if(!err)
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	delete server;
+	delete sched;
+	}
+
+
+GLDEF_C TInt E32Main()
+	{
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAP_IGNORE(MainL());
+	delete cleanup;
+	return KErrNone;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/apparctestserver.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,39 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+#if (!defined __APPARTESTSERVER_H__)
+#define __APPARTESTSERVER_H__
+
+#include <TestExecuteStepBase.h>
+#include <TestExecuteServerBase.h>
+#include <testexecutelog.h>
+
+class CApparctestServer : public CTestServer
+	{
+public:
+	static CApparctestServer* NewL();
+	virtual CTestStep* CreateTestStep(const TDesC& aStepName);
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/m_ctrl_v2.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+//
+// M_CTRL.MMP for test component M_CTRL (released in APPARC)
+// New style APP/EXE built for a secure environment
+//
+
+#include <platform_paths.hrh>
+
+target 		M_CTRL.EXE
+TARGETTYPE 	exe
+
+targetpath	/sys/bin
+UID		0x100039CE 0x13008AEE
+CAPABILITY 	All -Tcb
+VENDORID 	0x70000001
+
+epocstacksize 	0x5000
+
+SOURCEPATH	.
+
+
+systeminclude   ../INC 		
+systeminclude   /EPOC32/INCLUDE
+systeminclude   /EPOC32/INCLUDE/techview
+
+MW_LAYER_SYSTEMINCLUDE
+
+userinclude     .
+
+// Application exe specific resource which is localised to the application
+resource  	M_CTRL.rss
+start resource  M_CTRL.rss
+targetpath	/Resource/apps
+lang 		sc
+end
+
+// Application exe registration resource file
+start resource 	M_CTRL_reg.rss
+targetpath 	/private/10003a3f/import/apps
+lang		sc
+end
+
+// Application localisable resource file
+start resource 	M_CTRL_loc.rss
+targetpath 	/Resource/apps
+lang		sc
+end
+
+SOURCE		M_CTRL_V2.CPP
+
+LIBRARY 	APPARC.LIB 
+LIBRARY 	CONE.LIB
+LIBRARY 	EFSRV.LIB
+LIBRARY 	EIKCORE.LIB
+LIBRARY 	EUSER.LIB 
+LIBRARY 	GDI.LIB
+LIBRARY 	APPFWK_TEST_APPUI.LIB 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/openservice1a.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,41 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file operservice1a.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10208200 // UID of the application this registration file represents
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="openservice1app";
+	
+	datatype_list = 
+		{
+		DATATYPE { priority=EDataTypePriorityNormal; type="text/dummyopen1"; }
+		};
+	
+	service_list = 
+		{
+		SERVICE_INFO { uid = 0x09020303; opaque_data = 0; }
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/openservice1b.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,44 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file operservice1b.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10208201 // UID of the application this registration file represents
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="openservice2app";
+	
+	service_list = 
+		{
+		SERVICE_INFO
+			{ 
+			uid = 0x10208DCA; 
+			datatype_list = 
+				{
+				DATATYPE { priority=EDataTypePriorityNormal; type="text/dummyopen2"; }
+				};
+			opaque_data = 0;
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/scripts/setup_smoketest_language.script	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,20 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+RUN_UTILS MkDir			c:\smoketest\
+
+RUN_UTILS CopyFile 		z:\smoketest\smoketest_language.script	c:\smoketest\smoketest_language.script
+RUN_UTILS MakeReadWrite	c:\smoketest\smoketest_language.script
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/scripts/smoketest_language.script	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,29 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+//
+
+PRINT Run Language smoketest
+
+LOAD_SUITE ApparcTestServer
+DELAY 1000
+
+START_TESTCASE			SMOKE_LANGUAGE_0001
+//!	@SYMTestCaseID		SMOKE_LANGUAGE_0001
+//!	@SYMTestCaseDesc	Set a new language
+
+RUN_TEST_STEP 100 ApparcTestServer T_Caption
+
+END_TESTCASE			SMOKE_LANGUAGE_0001
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/serverapp2_reg.RSS	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,36 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file serverapp2_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10004c58 // UID of the application this registration file represents
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="serverapp2";
+	
+	service_list = 
+		{
+		SERVICE_INFO { uid = 0x01020333;}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/serverapp3_reg.RSS	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,104 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file serverapp3_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10004c57 // UID of the application this registration file represents
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="serverapp3";
+	//
+	datatype_list = 
+		{
+		DATATYPE { priority=EDataTypePriorityHigh; type="text/priority"; }
+		};
+
+	service_list = 
+		{
+		SERVICE_INFO 
+			{
+			uid = 0x01020304; 
+			datatype_list = 
+				{
+				DATATYPE { priority=EDataTypePriorityNormal; type="text/custom1"; }
+				};
+			opaque_data = r_first_service_specific_data;
+			},
+		SERVICE_INFO { uid = 0x02345000; opaque_data = r_second_service_specific_data;},
+		SERVICE_INFO { uid = 0x03456000; opaque_data = r_third_service_specific_data;},
+		SERVICE_INFO { uid = 0x04567000; opaque_data = r_fourth_service_specific_data;},
+		SERVICE_INFO { uid = 0x05678000; opaque_data = r_fifth_service_specific_data;},
+		SERVICE_INFO { uid = 0x01234000; opaque_data = r_fifth_service_specific_data;},
+		SERVICE_INFO { uid = 0x02345000; opaque_data = r_fourth_service_specific_data;},
+		SERVICE_INFO { uid = 0x03456000; opaque_data = r_third_service_specific_data;},
+		SERVICE_INFO { uid = 0x04567000; opaque_data = r_second_service_specific_data;},
+		SERVICE_INFO { uid = 0x05678000; opaque_data = r_first_service_specific_data;},
+		SERVICE_INFO { uid = 0x01234000; opaque_data = r_fifth_service_specific_data;},
+		SERVICE_INFO { uid = 0x02345000; opaque_data = r_fourth_service_specific_data;},
+		SERVICE_INFO { uid = 0x03456000; opaque_data = r_third_service_specific_data;},
+		SERVICE_INFO { uid = 0x04567000; opaque_data = r_second_service_specific_data;},
+		SERVICE_INFO { uid = 0x05678000; opaque_data = r_first_service_specific_data;}
+		//SERVICE_INFO { uid = 0x05678001; opaque_data = the_large_struct;}
+		};
+	}
+
+STRUCT SERVICE_NAME
+	{
+	LTEXT name = "";
+	}
+
+STRUCT LARGE_STRUCT
+	{
+	LONG arrays[256];
+	}
+
+RESOURCE LARGE_STRUCT the_large_struct
+	{
+	
+	}
+
+RESOURCE SERVICE_NAME r_first_service_specific_data
+	{
+	name = "Non-localised text for service uid 0x01020304";
+	}
+
+RESOURCE SERVICE_NAME r_second_service_specific_data
+	{
+	name = "Non-localised text for service uid 0x02345000";
+	}
+
+RESOURCE SERVICE_NAME r_third_service_specific_data
+	{
+	name = "Non-localised text for service uid 0x03456000";
+	}
+
+RESOURCE SERVICE_NAME r_fourth_service_specific_data
+	{
+	name = "Non-localised text for service uid 0x04567000";
+	}
+
+RESOURCE SERVICE_NAME r_fifth_service_specific_data
+	{
+	name = "Non-localised text for service uid 0x05678000";
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/serverapp4_reg.RSS	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,35 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file serverapp4_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10004c76 // UID of the application this registration file represents
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="serverapp4";
+
+	service_list = 
+		{
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/serverapp6_reg.RSS	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,53 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file serverapp6_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+#include <serverapp_loc.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10004c55 // UID of the application this registration file represents
+
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="serverapp6";
+	//
+	localisable_resource_file="\\resource\\apps\\serverapp_loc";
+	localisable_resource_id=R_LAI;
+	//
+	
+	service_list = 
+		{
+		//SERVICE_INFO { uid = 0x01020399; opaque_data = r_first_service_specific_data;}
+		SERVICE_INFO { uid = 0x01020305; opaque_data = R_SERVICE_SPECIFIC_DATA_LOC; }
+		};
+	}
+
+STRUCT SERVICE_NAME
+	{
+	LTEXT name = "";
+	}
+
+RESOURCE SERVICE_NAME r_first_service_specific_data
+	{
+	name = "Non-localised text for service uid";
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/serverapp7_reg.RSS	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,53 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file serverapp7_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+#include <serverapp_loc.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10004c54 // UID of the application this registration file represents
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="serverapp7";
+	
+	datatype_list = 
+		{
+		DATATYPE { priority=EDataTypePriorityNormal; type="text/plain"; }
+		};
+	//
+	service_list = 
+		{
+		SERVICE_INFO { uid = 0x01020303; opaque_data = r_service_specific_data; },
+		SERVICE_INFO { uid = 0x01020305; opaque_data = R_SERVICE_SPECIFIC_DATA_LOC; }
+		};
+	}
+
+STRUCT SERVICE_NAME
+	{
+	LTEXT name = "";
+	}
+
+RESOURCE SERVICE_NAME r_service_specific_data
+	{
+	name = "Non-localised text for service uid 0x01020304";
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/serverapp_loc.RSS	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,55 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file serverapp_loc.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+NAME SER1
+
+#include <uikon.rh>
+#include <appinfo.rh>
+ 
+RESOURCE RSS_SIGNATURE				{ }
+RESOURCE LOCALISABLE_APP_INFO r_lai
+	{
+	short_caption = "AppName";
+	caption_and_icon =
+		{
+		CAPTION_AND_ICON_INFO
+			{
+			caption = "AppNameLong";
+			number_of_icons = 0; // each icon must be a bitmap/mask pair
+			icon_file = "z:\resource\apps\myicons.mbm";
+			}
+		};			
+
+
+
+
+	}
+
+STRUCT SERVICE_NAME
+	{
+	LTEXT name = "";
+	}
+
+RESOURCE SERVICE_NAME r_service_specific_data_loc
+	{
+	name = "Localised text for service UID 0x01020305";
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/serverapp_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,79 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file serverapp_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10004c56 // UID of the application this registration file represents
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="serverapp";
+	//
+	datatype_list = 
+		{
+		DATATYPE { priority=EDataTypePriorityNormal; type="text/plain"; },
+		DATATYPE { priority=EDataTypePriorityNormal; type="text/priority"; }
+		};
+
+	service_list = 
+		{
+		SERVICE_INFO { uid = 0x01020304; opaque_data = r_first_service_specific_data;},
+		SERVICE_INFO 
+			{
+			uid = 0x02030405;
+			datatype_list = 
+				{
+				DATATYPE { priority=EDataTypePriorityNormal; type="text/custom1"; }
+				};
+			opaque_data = r_second_service_specific_data;
+			},
+		SERVICE_INFO { uid = 0x05060708; opaque_data = r_third_service_specific_data;},
+		SERVICE_INFO { uid = 0x05060708; opaque_data = r_fourth_service_specific_data;},
+		SERVICE_INFO { uid = 0x01020333;}
+		};
+	}
+
+STRUCT SERVICE_NAME
+	{
+	LTEXT name = "";
+	}
+
+RESOURCE SERVICE_NAME r_first_service_specific_data
+	{
+	name = "Non-localised text for service uid 0x01020304";
+	}
+
+RESOURCE SERVICE_NAME r_second_service_specific_data
+	{
+	name = "Non-localised text for service uid 0x02030405";
+	}
+
+RESOURCE SERVICE_NAME r_third_service_specific_data
+	{
+	name = "Non-localised resource A";
+	}
+
+RESOURCE SERVICE_NAME r_fourth_service_specific_data
+	{
+	name = "Non-localised resource B";
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/svg_icon.svg	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000303 Stylable//EN"
+"http://www.w3.org/TR/2000/03/WD-SVG-20000303/DTD/svg-20000303-stylable.dtd">
+
+<svg width="20.000000px" height="20.000000px" viewBox="0 0 20.000000 20.000000">
+
+<image width="20.000000" height="20.000000" xlink:href="data:image/png;base64,
+iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAACwklEQVR42k2UIbS0IBCFiS++aNxI
+NBKNRKPRSDQajUQi0Wg0GolEIpE4kUh8d3DPf/5zZnd19ePODHcQQohfIfSPCEaWfSzbh/Yx7zLv
+n7R/yq4Qefsg8DRt42OU/hVDpzr5EfGY86HSPtKBt/E9lkMicFvtVK1qDjFVp4vV0c56YF7MvyLs
+c96nuMm4T2GDjqLOVzcWq8rxknzbvGqnruccDz39CBFWRXaO5kNubums8Wy3JW/yMSXoO129JjtW
+20mPb14Ff17LIAhSRiYj6Vxby61Ra7VVahToPrKbC2c7QbwC6zBWQUV5HwHLeiBVSX4B0OrLU79I
+rdx0bcXNkALDmk6SldWptA0iG25jObi8gMb6BW+36FqNraa+SqHHZj8DAIwSuJGW9cRLYm8IuV2m
++CWhn04nVJEvkD2RXIPNVtEX5kiACRjDY70MS+HtEin65Bcs0YLr+gVVlGvN9ruXiK4MVwC2qt5b
+o8it6lKottwmWt1L6Pr0cF1spLHbqcPwAO8nWnLvLfpWnt52qMVymQA+PW8L6XFpUwVe3DgEbIjq
+i1OZY4JUPtGwq+uXRnd0c3SmUeakSkq7zmb8wqm3ihz4CVXRvUEtesNqyLamGn3YpvZ4hisVa9I6
+vjzD1TNMp275bC20cubTdLXYxSPUilv7WrVeNqxjMmjYiK2SbH249zbsClRbYw1HhKWfo5dK2S5x
+11//xOv5B+PTvGYDnDP6yRtDD/YpHyN7jtVKO7dgxla6/9L1LBJtwyyJC9n7BZmz+5D5bcjr/A6m
+xQDtiIImocl2regFLLQMadP3qsQ0iGDZujw3mEEcADzJuFCJB4YzTKtExEWGeQj6B92Kx6Iwz5hp
+nAzpgO8xenDvBA+9UV4/cEiMAALL5V2hfhwGnxfGzyzEswyY6miGzMeNzP8FjFT6SYRH9yJVp3AW
+/AEemb/P6EeEGQAAAABJRU5ErkJggg==
+" />
+
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tAppLaunchChecker.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,125 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Supporting ECOM plugin for use by  test programs that excercise
+// rule based launching of applications.
+// The classes CTAppLaunchChecker and CTAppLaunchChecker1 each implement an
+// ECOM RuleBased plugin interface.
+// 
+//
+
+
+
+
+/**
+ @file 
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <ImplementationProxy.h>
+#include "tAppLaunchChecker.h"
+#include <apacmdln.h>
+#include <W32STD.H>
+#include <apgtask.h>
+#include <coemain.h>
+#include <apaid.h>
+#include <apgcli.h>
+#include "..\tef\tRuleBasedApps\RuleBasedUID.H"
+
+
+// Define the interface UIDs
+const TImplementationProxy ImplementationTable[] = 
+	{
+	IMPLEMENTATION_PROXY_ENTRY(0x1020d467, CTAppLaunchChecker::NewL),
+	IMPLEMENTATION_PROXY_ENTRY(0x1020d468, CTAppLaunchChecker1::NewL)
+	};
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+	{
+	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+	return ImplementationTable;
+	}
+
+CTAppLaunchChecker*	CTAppLaunchChecker::NewL()
+	{
+	CTAppLaunchChecker* theAppLaunchChecker = new (ELeave) CTAppLaunchChecker();
+	return theAppLaunchChecker;
+	}
+
+CTAppLaunchChecker::~CTAppLaunchChecker()
+	{
+	}
+
+/**
+The function CAppLaunchChecker::TAppLaunchCode  recieves the UID of the application to be launched.
+The function implements a rule for launching the application whose UID is supplied as the first parameter.
+The function returns  CAppLaunchChecker::EAppLaunchIndifferent if the rule is executed completly.
+*/
+CAppLaunchChecker::TAppLaunchCode CTAppLaunchChecker::OkayToLaunchL(const TUid aAppToLaunch, TApaTaskList& aTaskList)
+	{ 
+	if(KUidApp4== aAppToLaunch)
+		{
+		TApaTask task = aTaskList.FindApp(KUidApp2);
+		if (task.Exists())
+			{
+			task.SendSystemEvent(EApaSystemEventShutdown);		
+			}	
+		}		
+	return CAppLaunchChecker::EAppLaunchIndifferent;
+	}
+
+//second plug-in implementation
+CTAppLaunchChecker1*	CTAppLaunchChecker1::NewL()
+	{
+	CTAppLaunchChecker1* theAppLaunchChecker = new (ELeave) CTAppLaunchChecker1();
+	return theAppLaunchChecker;
+	}
+
+CTAppLaunchChecker1::~CTAppLaunchChecker1()
+	{
+	}
+/**
+The function CAppLaunchChecker1::TAppLaunchCode  recieves the UID of the application to be launched.
+The function implements a rule for launching the application whose UID is supplied as the first parameter.
+The function returns  CAppLaunchChecker::EAppLaunchIndifferent if the rule is executed completly.
+*/
+CAppLaunchChecker::TAppLaunchCode CTAppLaunchChecker1::OkayToLaunchL(const TUid aAppToLaunch, TApaTaskList& aTaskList)
+	{
+	                                                                                                                                                        
+	if(KUidApp3 == aAppToLaunch)
+		{
+		TApaTask task = aTaskList.FindApp(KUidApp1);
+		if (task.Exists())
+			{
+			task.SendSystemEvent(EApaSystemEventShutdown);
+			}	
+		}
+	else if (KUidApp1 == aAppToLaunch)
+		{
+		TApaTask task = aTaskList.FindApp(KUidApp3);
+		if (task.Exists())
+			{
+			return CAppLaunchChecker::EAppLaunchDecline;	
+			}
+		}
+		
+	return CAppLaunchChecker::EAppLaunchIndifferent;
+	}
+
+GLDEF_C TInt E32Dll()
+//
+// DLL entry point
+//
+	{
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tAppLaunchChecker.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#ifndef __TAPPLUNCHCHEKER_H__
+#define __TAPPLUNCHCHEKER_H__
+
+#include "..\inc\ApLaunchChecker.h"
+
+class CTAppLaunchChecker : public CAppLaunchChecker
+	{
+public:
+	// Two-phase constructor
+	static CTAppLaunchChecker* NewL();
+	~CTAppLaunchChecker();
+	//Inherited from CApplaunchChecker
+	TAppLaunchCode virtual OkayToLaunchL(const TUid aAppToLaunch, TApaTaskList& aTaskList);
+	};
+
+class CTAppLaunchChecker1 : public CAppLaunchChecker
+	{
+public:
+	// Two-phase constructor
+	static CTAppLaunchChecker1* NewL();
+	~CTAppLaunchChecker1();
+	//Inherited from CApplaunchChecker
+	TAppLaunchCode virtual OkayToLaunchL(const TUid aAppToLaunch, TApaTaskList& aTaskList);
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tAppLaunchChecker2.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,79 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Supporting ECOM plugin for use by  test programs that excercise
+// rule based launching of applications.
+// The class CTAppLaunchChecker implements an
+// ECOM RuleBased plugin interface.
+// 
+//
+
+
+
+
+/**
+ @file 
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <ImplementationProxy.h>
+#include "tAppLaunchChecker2.h"
+#include "..\tef\tRuleBasedApps\RuleBasedUID.H"
+
+
+// Define the interface UIDs
+const TImplementationProxy ImplementationTable[] = 
+    {
+    IMPLEMENTATION_PROXY_ENTRY(0x102722bb, CTAppLaunchChecker2::NewL)
+    };
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
+
+CTAppLaunchChecker2*	CTAppLaunchChecker2::NewL()
+	{
+	CTAppLaunchChecker2* theAppLaunchChecker = new (ELeave) CTAppLaunchChecker2();
+	return theAppLaunchChecker;
+	}
+
+CTAppLaunchChecker2::~CTAppLaunchChecker2()
+	{
+	}
+	
+/**
+The function CAppLaunchChecker2::TAppLaunchCode  recieves the UID of the application to be launched.
+The function implements a rule for launching the application whose UID is supplied as the first parameter.
+The function returns  CAppLaunchChecker::EAppLaunchIndifferent if the rule is executed completly.
+*/
+CAppLaunchChecker::TAppLaunchCode CTAppLaunchChecker2::OkayToLaunchL(const TUid aAppToLaunch, TApaTaskList& aTaskList)
+	{
+	if(KUidApp4.iUid == aAppToLaunch.iUid )
+		{
+		TApaTask task = aTaskList.FindApp(KUidApp3);
+			if (task.Exists())
+				{
+				task.SendSystemEvent(EApaSystemEventShutdown);
+				}	
+		}	
+	return CAppLaunchChecker::EAppLaunchIndifferent;	
+	}
+
+// DLL entry point
+GLDEF_C TInt E32Dll()
+
+	{
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tAppLaunchChecker2.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,40 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#ifndef __TAPPLUNCHCHEKER2_H__
+#define __TAPPLUNCHCHEKER2_H__
+
+
+#include "..\inc\ApLaunchChecker.h"
+#include <apgtask.h>
+
+class CTAppLaunchChecker2 : public CAppLaunchChecker
+	{
+public:
+	// Two-phase constructor
+	static CTAppLaunchChecker2* NewL();
+	~CTAppLaunchChecker2();
+	//Inherited from CApplaunchChecker
+	TAppLaunchCode virtual OkayToLaunchL(const TUid aAppToLaunch, TApaTaskList& aTaskList);
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tRuleBasedApps/RuleBasedUID.H	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,31 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#if !defined(__RULEBASEDUID_H__)
+#define __RULEBASEDUID_H__
+
+const TUid KUidApp1 = {0x1020D6FC};
+const TUid KUidApp2 = {0x1020D6FD};
+const TUid KUidApp3 = {0x1020D6FE};
+const TUid KUidApp4 = {0X10210F77};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp.hrh	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,50 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+
+enum TRuleBasedMenuCommands
+	{
+	ERuleBasedItem0 = 200,
+	ERuleBasedItem1,
+	ERuleBasedItem2
+	};
+
+#define ECidFileNameLabel			0x11c6
+
+
+#define ERuleBasedDo0						0x1150
+#define ERuleBasedDo1						0x1151
+#define ERuleBasedDo2						0x1152
+#define ERuleBasedDo3						0x1153
+#define ERuleBasedDo4						0x1124
+#define ERuleBasedDo5						0x1155				
+#define ERuleBasedDo6						0x1156
+#define ERuleBasedDo7						0x1157
+#define ERuleBasedDo8						0x1158
+										
+
+//
+//	Common view controls
+//
+
+#define ETimewCidToolLabel				0x1301
+#define ETimewCidToolSpacer				0x1302
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp1.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,392 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is a simple Application containing a single view with
+// text drawn on it.
+// The app includes code for displaying a very simple menu.
+// This source file contains the single exported function required by
+// all UI Applications and the E32Dll function which is also required
+// but is not used here.
+// The class definitions are:
+// CTRuleBasedApplication
+// CTRuleBasedAppUi
+// CTRuleBasedAppView
+// CTRuleBasedDocument
+// 
+//
+
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <coeccntx.h>
+#include <eikenv.h>
+#include <eikAppui.h>
+#include <eikApp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+#include <eikstart.h>
+
+#include <eikon.hrh>
+
+#include <tRuleBasedApp1.rsg>
+#include "tRuleBasedApp.hrh"
+
+const TInt KLeft 	= 0; // Display app window on the left
+const TInt KCentre 	= 1; // Display app window in the centre
+const TInt KRight 	= 2; // Display app window on the right
+
+////////////////////////////////////////////////////////////////////////
+//
+// CTRuleBasedApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+class CTRuleBasedApplication : public CEikApplication
+	{
+private:
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+	};
+	
+////////////////////////////////////////////////////////////////////////
+//
+// CTRuleBasedAppView
+//
+////////////////////////////////////////////////////////////////////////
+class CTRuleBasedAppView : public CCoeControl
+ 	{
+public:
+	static CTRuleBasedAppView* NewL(const TRect& aRect);
+	CTRuleBasedAppView();
+	~CTRuleBasedAppView();
+	void ConstructL(const TRect& aRect);
+public:
+	TInt iAppType;
+
+private:
+	// Inherited from CCoeControl
+	void Draw(const TRect& /*aRect*/) const;
+	const CFont* CreateCustomFontL( const TDesC& aFontName, TInt aHeightInPixels, TBool aBold ) const;
+
+private:
+	HBufC* iRuleBasedText;
+ 	};
+
+////////////////////////////////////////////////////////////////////////
+//
+// CTRuleBasedAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CTRuleBasedAppUi : public CEikAppUi
+	{
+public:
+	void ConstructL();
+	~CTRuleBasedAppUi();
+
+private:
+	// Inherirted from class CEikAppUi
+	void HandleCommandL(TInt aCommand);
+
+private:
+	CTRuleBasedAppView* iAppView;
+	};
+
+////////////////////////////////////////////////////////////////////////
+//
+// CTRuleBasedDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CTRuleBasedDocument : public CEikDocument
+	{
+public:
+	static CTRuleBasedDocument* NewL(CEikApplication& aApp);
+	CTRuleBasedDocument(CEikApplication& aApp);
+	void ConstructL();
+private:
+	// Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+//////////////////////////////////////////////////////////////////////
+//
+// Application Document class - CTRuleBasedAppDocument
+//
+//////////////////////////////////////////////////////////////////////
+
+/**
+The constructor of the document class just passes the
+supplied reference to the constructor initialisation list.
+The document has no real work to do in this Application.
+*/
+
+CTRuleBasedDocument::CTRuleBasedDocument(CEikApplication& aApp)
+	: CEikDocument(aApp)
+	{
+	}
+
+/**
+This is called by the UI framework as soon as the
+document has been created. It creates an instance
+of the ApplicationUI. The Application UI class is
+an instance of a CEikAppUi derived class.
+*/
+
+CEikAppUi* CTRuleBasedDocument::CreateAppUiL()
+	{
+ 	return new(ELeave) CTRuleBasedAppUi;
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// Source for the implementation of the 
+// Application view class - CTRuleBasedAppView
+//
+////////////////////////////////////////////////////////////////////////
+
+
+// Constructor for the view.
+
+CTRuleBasedAppView::CTRuleBasedAppView():iAppType(KLeft)
+	{
+	}
+/**
+Static NewL() function to start the standard two
+phase construction.
+*/
+
+CTRuleBasedAppView* CTRuleBasedAppView::NewL(const TRect& aRect)
+	{
+	CTRuleBasedAppView* self = new(ELeave) CTRuleBasedAppView();
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect);
+	CleanupStack::Pop();
+	return self;
+	}
+
+//
+// Destructor for the view.
+
+CTRuleBasedAppView::~CTRuleBasedAppView()
+	{
+	delete iRuleBasedText;
+	}
+
+/**
+Second phase construction.
+*/
+
+void CTRuleBasedAppView::ConstructL(const TRect& aRect)
+ 	{
+	// Fetch the text from the resource file.
+	iRuleBasedText = iEikonEnv->AllocReadResourceL(R_RULEBASED_TEXT);
+	// Control is a window owning control
+
+	CreateWindowL();
+	// Extent of the control. This is
+	// the whole rectangle available to Application.
+	// The rectangle is passed to us from the Application UI.
+	SetRect(aRect);
+	// At this stage, the control is ready to draw so
+	// we tell the UI framework by activating it.
+	ActivateL();
+	}
+
+/**
+Drawing the view - in this example, 
+consists of drawing a simple outline rectangle
+and then drawing the text in the middle.
+
+In this example, we don't use the redraw
+region because it's easier to redraw to
+the whole client area.
+*/
+
+const CFont* CTRuleBasedAppView::CreateCustomFontL( const TDesC& aFontName, TInt aHeightInPixels, TBool aBold ) const
+	 {
+	 // Create a Symbian font spec
+	 TFontSpec fontSpec;
+
+	 // Enable antialising
+	 TOpenFontSpec openSpec;
+
+	 openSpec.SetBitmapType(EAntiAliasedGlyphBitmap);
+
+	 openSpec.GetTFontSpec(fontSpec); // sets the antialiasing into the TFontSpec
+	 fontSpec.iTypeface.iName = aFontName;
+	 fontSpec.iHeight = aHeightInPixels;
+
+	 if (aBold)
+	 	{
+	 	fontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightBold );
+		}
+	 CFbsFont* font;
+	 CWsScreenDevice& screenDev=*(CEikonEnv::Static()->ScreenDevice());
+	 User::LeaveIfError(screenDev.GetNearestFontInPixels((CFont*&)font,fontSpec));
+	 return font;
+	 }
+    
+void CTRuleBasedAppView::Draw(const TRect& aRect) const
+	{
+	// Window graphics context
+	CWindowGc& gc = SystemGc();
+	// Area in which we shall draw
+	TRect	drawRect = Rect();
+	
+	// Font used for drawing text
+	const CFont* fontUsed = NULL;
+	
+	// Start with a clear screen
+	gc.Clear();
+			
+	gc.DrawRect(drawRect);
+
+	TRAPD(err, fontUsed = CreateCustomFontL(_L("Times New Roman"),20,1));
+	if (err!=KErrNone)
+		{
+		return;
+		}
+		
+	gc.SetPenColor(KRgbGreen);
+	gc.UseFont(fontUsed);
+	// Draw the text in the middle of the rectangle.
+	TInt baselineOffset=(aRect.Height() - fontUsed->HeightInPixels())/2;
+	gc.DrawText(*iRuleBasedText,aRect,baselineOffset,CGraphicsContext::ECenter, 0);
+	// Finished using the font
+	gc.DiscardFont();
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// Application UI class - CTRuleBasedAppUi
+//
+////////////////////////////////////////////////////////////////////////
+
+/**
+The second phase constructor of the Application UI class.
+The Application UI creates and owns the one and only view.
+*/
+
+void CTRuleBasedAppUi::ConstructL()
+	{
+	// BaseConstructL() completes the UI framework's
+	// construction of the App UI.
+	BaseConstructL();
+	// Create the single Application view in which to
+	// draw the text to display the name of the Application that has been launched, passing into it
+	// the rectangle available to it.
+	
+ 	TRect cliRect = ClientRect();
+ 	const TInt width = 580/3;
+ 	
+	cliRect.SetWidth(width);
+	
+	iAppView = CTRuleBasedAppView::NewL(cliRect);
+
+	// The application window occupies 1/3 of the screen.
+	if (iAppView->iAppType == KCentre)
+		{
+		TPoint Origin( width,0);
+		iAppView->SetPosition(Origin);
+		}
+	else if (iAppView->iAppType == KRight)
+		{
+		TPoint Origin( (2*width),0);
+		iAppView->SetPosition(Origin);
+		}
+	}
+
+/**
+The App Ui owns the two views and is.
+therefore, responsible for destroying them
+*/
+
+CTRuleBasedAppUi::~CTRuleBasedAppUi()
+	{
+	delete iAppView;
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// Implementation of the
+// Application class - CTRuleBasedApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+const TUid KUidRuleBasedApp = { 0x1020D6FC};
+
+/**
+The function is called by the UI framework to ask for the
+Application's UID. The returned value is defined by the
+constant KUidRuleBasedAppe and must match the second value
+defined in the project definition file.
+*/
+
+TUid CTRuleBasedApplication::AppDllUid() const
+	{
+	return KUidRuleBasedApp;
+	}
+
+/**
+This function is called by the UI framework at
+Application start-up. It creates an instance of the
+document class.
+*/
+
+CApaDocument* CTRuleBasedApplication::CreateDocumentL()
+	{
+	return new (ELeave) CTRuleBasedDocument(*this);
+	}
+
+void CTRuleBasedAppUi::HandleCommandL(TInt aCommand)
+	{
+	switch (aCommand)
+		{
+	case EEikCmdExit:
+		Exit();
+		break;
+		}
+	}
+
+/**
+The entry point for the Application code. It creates
+an instance of the CApaApplication derived
+class, CTRuleBasedApplication.
+*/
+
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CTRuleBasedApplication;
+	}
+
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication( NewApplication );
+	}
+
+
+#if defined( __WINS__ ) && !defined(EKA2)
+GLDEF_C TInt E32Dll(TDllReason)
+	{
+	return KErrNone;
+	}
+	
+EXPORT_C TInt WinsMain( TDesC* aCommandLine )
+	{
+	return EikStart::RunApplication( NewApplication, aCommandLine );
+	}
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp1.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,57 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// t_RuleBasedApp1.mmp
+// 
+//
+
+#include <platform_paths.hrh>
+
+// using relative paths for sourcepath and user includes
+CAPABILITY NONE
+epocstacksize 		0x5000
+
+TARGETPATH		/sys/bin
+
+
+TARGET			tRuleBasedApp1.exe
+TARGETTYPE		exe
+
+
+UID           		0x100039CE 0X1020D6FC
+
+VENDORID 		0x70000001
+
+SOURCEPATH    		.
+
+SOURCE        		tRuleBasedApp1.cpp
+
+
+USERINCLUDE   		.
+
+SYSTEMINCLUDE 		/epoc32/include
+SYSTEMINCLUDE 		/epoc32/include/techview
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY       		euser.lib apparc.lib cone.lib eikcore.lib bitgdi.lib fntstr.lib fbscli.lib gdi.lib
+
+			
+START RESOURCE      	tRuleBasedApp1.rss
+HEADER
+TARGETPATH		/resource/apps
+END
+
+START RESOURCE		tRuleBasedApp1_reg.rss
+TARGETPATH		/private/10003a3f/apps
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp1.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,92 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+NAME GUBA
+
+#include <eikon.rh>
+#include <appinfo.rh>
+#include <eikon.rsg>
+#include <eikcore.rsg>
+#include <fontids.h>
+#include <gulfont.hrh>
+
+#include "tRuleBasedApp.hrh"
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+	{
+	hotkeys=r_rulebased_hotkeys;
+	menubar=r_rulebased_menubar;
+	}
+
+
+
+RESOURCE HOTKEYS r_rulebased_hotkeys
+    {
+    control=
+	{
+        HOTKEY { command=EEikCmdExit; key='e'; }
+        };
+    }
+
+RESOURCE MENU_BAR r_rulebased_menubar
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_rulebased_first_menu; txt="RuleBasedApp1"; }
+    	};
+    }
+
+RESOURCE MENU_PANE r_rulebased_first_menu
+   {
+	items=
+	{
+	MENU_ITEM { command=EEikCmdExit; txt="Close"; }
+	};  
+    }
+
+/////TKAS
+RESOURCE TBUF r_appname_default_file
+	{
+	buf="tRuleBasedApp1";
+	}
+
+RESOURCE LOCALISABLE_APP_INFO r_lai
+	{
+	short_caption="tRuleBasedApp1";
+	
+	caption_and_icon=	
+		{
+		CAPTION_AND_ICON_INFO
+			{
+			caption="tRuleBasedApp1";
+			}
+		};
+
+	}
+	
+
+
+RESOURCE TBUF r_rulebased_text { buf="RuleBasedApp1"; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp1_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,29 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <appinfo.rh>
+#include <tRuleBasedApp1.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+
+UID3 0x1020D6FC // App UID
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="tRuleBasedApp1";
+	localisable_resource_file="\\resource\\apps\\tRuleBasedApp1";
+	localisable_resource_id=R_LAI;
+	
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp2.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,392 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is a simple Application containing a single view with
+// text drawn on it.
+// The app includes code for displaying a very simple menu.
+// This source file contains the single exported function required by
+// all UI Applications and the E32Dll function which is also required
+// but is not used here.
+// The class definitions are:
+// CTRuleBasedApplication
+// CTRuleBasedAppUi
+// CTRuleBasedAppView
+// CTRuleBasedDocument
+// 
+//
+
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <coeccntx.h>
+#include <eikenv.h>
+#include <eikAppui.h>
+#include <eikApp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+#include <eikstart.h>
+
+#include <eikon.hrh>
+
+#include <tRuleBasedApp2.rsg>
+#include "tRuleBasedApp.hrh"
+
+//const TInt KLeft 	= 0; // Display app window on the left
+const TInt KCentre 	= 1; // Display app window in the centre
+const TInt KRight 	= 2; // Display app window on the right
+
+////////////////////////////////////////////////////////////////////////
+//
+// CTRuleBasedApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+class CTRuleBasedApplication : public CEikApplication
+	{
+private:
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+	};
+	
+////////////////////////////////////////////////////////////////////////
+//
+// CTRuleBasedAppView
+//
+////////////////////////////////////////////////////////////////////////
+class CTRuleBasedAppView : public CCoeControl
+ 	{
+public:
+	static CTRuleBasedAppView* NewL(const TRect& aRect);
+	CTRuleBasedAppView();
+	~CTRuleBasedAppView();
+	void ConstructL(const TRect& aRect);
+public:
+	TInt iAppType;
+
+private:
+	// Inherited from CCoeControl
+	void Draw(const TRect& /*aRect*/) const;
+	const CFont* CreateCustomFontL( const TDesC& aFontName, TInt aHeightInPixels, TBool aBold ) const;
+
+private:
+	HBufC* iRuleBasedText;
+ 	};
+
+////////////////////////////////////////////////////////////////////////
+//
+// CTRuleBasedAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CTRuleBasedAppUi : public CEikAppUi
+	{
+public:
+	void ConstructL();
+	~CTRuleBasedAppUi();
+
+private:
+	// Inherirted from class CEikAppUi
+	void HandleCommandL(TInt aCommand);
+
+private:
+	CTRuleBasedAppView* iAppView;
+	};
+
+////////////////////////////////////////////////////////////////////////
+//
+// CTRuleBasedDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CTRuleBasedDocument : public CEikDocument
+	{
+public:
+	static CTRuleBasedDocument* NewL(CEikApplication& aApp);
+	CTRuleBasedDocument(CEikApplication& aApp);
+	void ConstructL();
+private:
+	// Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+//////////////////////////////////////////////////////////////////////
+//
+// Application Document class - CTRuleBasedAppDocument
+//
+//////////////////////////////////////////////////////////////////////
+
+/**
+The constructor of the document class just passes the
+supplied reference to the constructor initialisation list.
+The document has no real work to do in this Application.
+*/
+
+CTRuleBasedDocument::CTRuleBasedDocument(CEikApplication& aApp)
+	: CEikDocument(aApp)
+	{
+	}
+
+/**
+This is called by the UI framework as soon as the
+document has been created. It creates an instance
+of the ApplicationUI. The Application UI class is
+an instance of a CEikAppUi derived class.
+*/
+
+CEikAppUi* CTRuleBasedDocument::CreateAppUiL()
+	{
+ 	return new(ELeave) CTRuleBasedAppUi;
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// Source for the implementation of the 
+// Application view class - CTRuleBasedAppView
+//
+////////////////////////////////////////////////////////////////////////
+
+
+// Constructor for the view.
+
+CTRuleBasedAppView::CTRuleBasedAppView():iAppType(KCentre)
+	{
+	}
+/**
+Static NewL() function to start the standard two
+phase construction.
+*/
+
+CTRuleBasedAppView* CTRuleBasedAppView::NewL(const TRect& aRect)
+	{
+	CTRuleBasedAppView* self = new(ELeave) CTRuleBasedAppView();
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect);
+	CleanupStack::Pop();
+	return self;
+	}
+
+//
+// Destructor for the view.
+
+CTRuleBasedAppView::~CTRuleBasedAppView()
+	{
+	delete iRuleBasedText;
+	}
+
+/**
+Second phase construction.
+*/
+
+void CTRuleBasedAppView::ConstructL(const TRect& aRect)
+ 	{
+	// Fetch the text from the resource file.
+	iRuleBasedText = iEikonEnv->AllocReadResourceL(R_RULEBASED_TEXT);
+	// Control is a window owning control
+
+	CreateWindowL();
+	// Extent of the control. This is
+	// the whole rectangle available to Application.
+	// The rectangle is passed to us from the Application UI.
+	SetRect(aRect);
+	// At this stage, the control is ready to draw so
+	// we tell the UI framework by activating it.
+	ActivateL();
+	}
+
+/**
+Drawing the view - in this example, 
+consists of drawing a simple outline rectangle
+and then drawing the text in the middle.
+
+In this example, we don't use the redraw
+region because it's easier to redraw to
+the whole client area.
+*/
+
+const CFont* CTRuleBasedAppView::CreateCustomFontL( const TDesC& aFontName, TInt aHeightInPixels, TBool aBold ) const
+	 {
+	 // Create a Symbian font spec
+	 TFontSpec fontSpec;
+
+	 // Enable antialising
+	 TOpenFontSpec openSpec;
+
+	 openSpec.SetBitmapType(EAntiAliasedGlyphBitmap);
+
+	 openSpec.GetTFontSpec(fontSpec); // sets the antialiasing into the TFontSpec
+	 fontSpec.iTypeface.iName = aFontName;
+	 fontSpec.iHeight = aHeightInPixels;
+
+	 if (aBold)
+	 	{
+	 	fontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightBold );
+		}
+	 CFbsFont* font;
+	 CWsScreenDevice& screenDev=*(CEikonEnv::Static()->ScreenDevice());
+	 User::LeaveIfError(screenDev.GetNearestFontInPixels((CFont*&)font,fontSpec));
+	 return font;
+	 }
+    
+void CTRuleBasedAppView::Draw(const TRect& aRect) const
+	{
+	// Window graphics context
+	CWindowGc& gc = SystemGc();
+	// Area in which we shall draw
+	TRect	drawRect = Rect();
+	
+	// Font used for drawing text
+	const CFont* fontUsed = NULL;
+	
+	// Start with a clear screen
+	gc.Clear();
+			
+	gc.DrawRect(drawRect);
+
+	TRAPD(err, fontUsed = CreateCustomFontL(_L("Times New Roman"),20,1));
+	if (err!=KErrNone)
+		{
+		return;
+		}
+		
+	gc.SetPenColor(KRgbBlue);
+	gc.UseFont(fontUsed);
+	// Draw the text in the middle of the rectangle.
+	TInt baselineOffset=(aRect.Height() - fontUsed->HeightInPixels())/2;
+	gc.DrawText(*iRuleBasedText,aRect,baselineOffset,CGraphicsContext::ECenter, 0);
+	// Finished using the font
+	gc.DiscardFont();
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// Application UI class - CTRuleBasedAppUi
+//
+////////////////////////////////////////////////////////////////////////
+
+/**
+The second phase constructor of the Application UI class.
+The Application UI creates and owns the one and only view.
+*/
+
+void CTRuleBasedAppUi::ConstructL()
+	{
+	// BaseConstructL() completes the UI framework's
+	// construction of the App UI.
+	BaseConstructL();
+	// Create the single Application view in which to
+	// draw the text to display the name of the Application that has been launched, passing into it
+	// the rectangle available to it.
+	
+ 	TRect cliRect = ClientRect();
+ 	const TInt width = 580/3;
+ 	
+	cliRect.SetWidth(width);
+	
+	iAppView = CTRuleBasedAppView::NewL(cliRect);
+
+	// The application window occupies 1/3 of the screen.
+	if (iAppView->iAppType == KCentre)
+		{
+		TPoint Origin( width,0);
+		iAppView->SetPosition(Origin);
+		}
+	else if (iAppView->iAppType == KRight)
+		{
+		TPoint Origin( (2*width),0);
+		iAppView->SetPosition(Origin);
+		}
+	}
+
+/**
+The App Ui owns the two views and is.
+therefore, responsible for destroying them
+*/
+
+CTRuleBasedAppUi::~CTRuleBasedAppUi()
+	{
+	delete iAppView;
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// Implementation of the
+// Application class - CTRuleBasedApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+const TUid KUidRuleBasedApp = { 0X1020D6FD };
+
+/**
+The function is called by the UI framework to ask for the
+Application's UID. The returned value is defined by the
+constant KUidRuleBasedAppe and must match the second value
+defined in the project definition file.
+*/
+
+TUid CTRuleBasedApplication::AppDllUid() const
+	{
+	return KUidRuleBasedApp;
+	}
+
+/**
+This function is called by the UI framework at
+Application start-up. It creates an instance of the
+document class.
+*/
+
+CApaDocument* CTRuleBasedApplication::CreateDocumentL()
+	{
+	return new (ELeave) CTRuleBasedDocument(*this);
+	}
+
+void CTRuleBasedAppUi::HandleCommandL(TInt aCommand)
+	{
+	switch (aCommand)
+		{
+	case EEikCmdExit:
+		Exit();
+		break;
+		}
+	}
+
+/**
+The entry point for the Application code. It creates
+an instance of the CApaApplication derived
+class, CTRuleBasedApplication.
+*/
+
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CTRuleBasedApplication;
+	}
+
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication( NewApplication );
+	}
+
+
+#if defined( __WINS__ ) && !defined(EKA2)
+GLDEF_C TInt E32Dll(TDllReason)
+	{
+	return KErrNone;
+	}
+	
+EXPORT_C TInt WinsMain( TDesC* aCommandLine )
+	{
+	return EikStart::RunApplication( NewApplication, aCommandLine );
+	}
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp2.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,57 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// t_RuleBasedApp.mmp
+// 
+//
+
+#include <platform_paths.hrh>
+
+// using relative paths for sourcepath and user includes
+CAPABILITY NONE
+epocstacksize 		0x5000
+
+TARGETPATH		/sys/bin
+
+
+TARGET			tRuleBasedApp2.exe
+TARGETTYPE		exe
+
+
+UID           		0x100039CE 0X1020D6FD
+
+VENDORID 		0x70000001
+
+SOURCEPATH    		.
+
+SOURCE        		tRuleBasedApp2.cpp
+
+
+USERINCLUDE   		.
+
+SYSTEMINCLUDE 		/epoc32/include
+SYSTEMINCLUDE 		/epoc32/include/techview
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY       		euser.lib apparc.lib cone.lib eikcore.lib bitgdi.lib fntstr.lib fbscli.lib gdi.lib
+
+			
+START RESOURCE      	tRuleBasedApp2.rss
+HEADER
+TARGETPATH		/resource/apps
+END
+
+START RESOURCE		tRuleBasedApp2_reg.rss
+TARGETPATH		/private/10003a3f/apps
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp2.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,96 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+NAME GUBA
+
+#include <eikon.rh>
+#include <appinfo.rh>
+#include <eikon.rsg>
+#include <eikcore.rsg>
+#include <fontids.h>
+#include <gulfont.hrh>
+
+#include "tRuleBasedApp.hrh"
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+	{
+	hotkeys=r_rulebased_hotkeys;
+	menubar=r_rulebased_menubar;
+	}
+
+
+
+RESOURCE HOTKEYS r_rulebased_hotkeys
+    {
+    control=
+	{
+        HOTKEY { command=EEikCmdExit; key='e'; }
+        };
+    }
+
+RESOURCE MENU_BAR r_rulebased_menubar
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_rulebased_first_menu; txt="RuleBasedApp2"; }
+    	};
+    }
+
+RESOURCE MENU_PANE r_rulebased_first_menu
+   {
+	items=
+	{
+	MENU_ITEM { command=EEikCmdExit; txt="Close"; }
+	};  
+    }
+
+/////TKAS
+RESOURCE TBUF r_appname_default_file
+	{
+	buf="tRuleBasedApp2";
+	}
+
+RESOURCE LOCALISABLE_APP_INFO r_lai
+	{
+	short_caption="tRuleBasedApp2";
+	
+	caption_and_icon=	
+		{
+		CAPTION_AND_ICON_INFO
+			{
+			caption="tRuleBasedApp2";
+			}
+		};
+
+	}
+	
+RESOURCE EIK_APP_INFO 
+	{
+
+	}	
+
+
+RESOURCE TBUF r_rulebased_text { buf="RuleBasedApp2"; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp2_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,31 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// tRuleBasedApp2.rss
+// 
+//
+
+#include <appinfo.rh>
+#include <tRuleBasedApp2.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+
+UID3 0x1020D6FD // App UID
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="tRuleBasedApp2";
+	localisable_resource_file="\\resource\\apps\\tRuleBasedApp2";
+	localisable_resource_id=R_LAI;
+	
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp3.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,392 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is a simple Application containing a single view with
+// text drawn on it.
+// The app includes code for displaying a very simple menu.
+// This source file contains the single exported function required by
+// all UI Applications and the E32Dll function which is also required
+// but is not used here.
+// The class definitions are:
+// CTRuleBasedApplication
+// CTRuleBasedAppUi
+// CTRuleBasedAppView
+// CTRuleBasedDocument
+// 
+//
+
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <coeccntx.h>
+#include <eikenv.h>
+#include <eikAppui.h>
+#include <eikApp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+#include <eikstart.h>
+
+#include <eikon.hrh>
+
+#include <tRuleBasedApp3.rsg>
+#include "tRuleBasedApp.hrh"
+
+//const TInt KLeft 	= 0; // Display app window on the left
+const TInt KCentre 	= 1; // Display app window in the centre
+const TInt KRight 	= 2; // Display app window on the right
+
+////////////////////////////////////////////////////////////////////////
+//
+// CTRuleBasedApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+class CTRuleBasedApplication : public CEikApplication
+	{
+private:
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+	};
+	
+////////////////////////////////////////////////////////////////////////
+//
+// CTRuleBasedAppView
+//
+////////////////////////////////////////////////////////////////////////
+class CTRuleBasedAppView : public CCoeControl
+ 	{
+public:
+	static CTRuleBasedAppView* NewL(const TRect& aRect);
+	CTRuleBasedAppView();
+	~CTRuleBasedAppView();
+	void ConstructL(const TRect& aRect);
+public:
+	TInt iAppType;
+
+private:
+	// Inherited from CCoeControl
+	void Draw(const TRect& /*aRect*/) const;
+	const CFont* CreateCustomFontL( const TDesC& aFontName, TInt aHeightInPixels, TBool aBold ) const;
+
+private:
+	HBufC* iRuleBasedText;
+ 	};
+
+////////////////////////////////////////////////////////////////////////
+//
+// CTRuleBasedAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CTRuleBasedAppUi : public CEikAppUi
+	{
+public:
+	void ConstructL();
+	~CTRuleBasedAppUi();
+
+private:
+	// Inherirted from class CEikAppUi
+	void HandleCommandL(TInt aCommand);
+
+private:
+	CTRuleBasedAppView* iAppView;
+	};
+
+////////////////////////////////////////////////////////////////////////
+//
+// CTRuleBasedDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CTRuleBasedDocument : public CEikDocument
+	{
+public:
+	static CTRuleBasedDocument* NewL(CEikApplication& aApp);
+	CTRuleBasedDocument(CEikApplication& aApp);
+	void ConstructL();
+private:
+	// Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+//////////////////////////////////////////////////////////////////////
+//
+// Application Document class - CTRuleBasedAppDocument
+//
+//////////////////////////////////////////////////////////////////////
+
+/**
+The constructor of the document class just passes the
+supplied reference to the constructor initialisation list.
+The document has no real work to do in this Application.
+*/
+
+CTRuleBasedDocument::CTRuleBasedDocument(CEikApplication& aApp)
+	: CEikDocument(aApp)
+	{
+	}
+
+/**
+This is called by the UI framework as soon as the
+document has been created. It creates an instance
+of the ApplicationUI. The Application UI class is
+an instance of a CEikAppUi derived class.
+*/
+
+CEikAppUi* CTRuleBasedDocument::CreateAppUiL()
+	{
+ 	return new(ELeave) CTRuleBasedAppUi;
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// Source file for the implementation of the
+// Application view class - CTRuleBasedAppView
+//
+////////////////////////////////////////////////////////////////////////
+
+
+// Constructor for the view.
+
+CTRuleBasedAppView::CTRuleBasedAppView():iAppType(KRight)
+	{
+	}
+/**
+Static NewL() function to start the standard two
+phase construction.
+*/
+
+CTRuleBasedAppView* CTRuleBasedAppView::NewL(const TRect& aRect)
+	{
+	CTRuleBasedAppView* self = new(ELeave) CTRuleBasedAppView();
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect);
+	CleanupStack::Pop();
+	return self;
+	}
+
+//
+// Destructor for the view.
+
+CTRuleBasedAppView::~CTRuleBasedAppView()
+	{
+	delete iRuleBasedText;
+	}
+
+/**
+Second phase construction.
+*/
+
+void CTRuleBasedAppView::ConstructL(const TRect& aRect)
+ 	{
+	// Fetch the text from the resource file.
+	iRuleBasedText = iEikonEnv->AllocReadResourceL(R_RULEBASED_TEXT);
+	// Control is a window owning control
+
+	CreateWindowL();
+	// Extent of the control. This is
+	// the whole rectangle available to Application.
+	// The rectangle is passed to us from the Application UI.
+	SetRect(aRect);
+	// At this stage, the control is ready to draw so
+	// we tell the UI framework by activating it.
+	ActivateL();
+	}
+
+/**
+Drawing the view - in this example, 
+consists of drawing a simple outline rectangle
+and then drawing the text in the middle.
+
+In this example, we don't use the redraw
+region because it's easier to redraw to
+the whole client area.
+*/
+
+const CFont* CTRuleBasedAppView::CreateCustomFontL( const TDesC& aFontName, TInt aHeightInPixels, TBool aBold ) const
+	 {
+	 // Create a Symbian font spec
+	 TFontSpec fontSpec;
+
+	 // Enable antialising
+	 TOpenFontSpec openSpec;
+
+	 openSpec.SetBitmapType(EAntiAliasedGlyphBitmap);
+
+	 openSpec.GetTFontSpec(fontSpec); // sets the antialiasing into the TFontSpec
+	 fontSpec.iTypeface.iName = aFontName;
+	 fontSpec.iHeight = aHeightInPixels;
+
+	 if (aBold)
+	 	{
+	 	fontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightBold );
+		}
+	 CFbsFont* font;
+	 CWsScreenDevice& screenDev=*(CEikonEnv::Static()->ScreenDevice());
+	 User::LeaveIfError(screenDev.GetNearestFontInPixels((CFont*&)font,fontSpec));
+	 return font;
+	 }
+    
+void CTRuleBasedAppView::Draw(const TRect& aRect) const
+	{
+	// Window graphics context
+	CWindowGc& gc = SystemGc();
+	// Area in which we shall draw
+	TRect	drawRect = Rect();
+	
+	// Font used for drawing text
+	const CFont* fontUsed = NULL;
+	
+	// Start with a clear screen
+	gc.Clear();
+			
+	gc.DrawRect(drawRect);
+
+	TRAPD(err, fontUsed = CreateCustomFontL(_L("Times New Roman"),20,1));
+	if (err!=KErrNone)
+		{
+		return;
+		}
+		
+	gc.SetPenColor(KRgbRed);
+	gc.UseFont(fontUsed);
+	// Draw the text in the middle of the rectangle.
+	TInt baselineOffset=(aRect.Height() - fontUsed->HeightInPixels())/2;
+	gc.DrawText(*iRuleBasedText,aRect,baselineOffset,CGraphicsContext::ECenter, 0);
+	// Finished using the font
+	gc.DiscardFont();
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// Application UI class - CTRuleBasedAppUi
+//
+////////////////////////////////////////////////////////////////////////
+
+/**
+The second phase constructor of the Application UI class.
+The Application UI creates and owns the one and only view.
+*/
+
+void CTRuleBasedAppUi::ConstructL()
+	{
+	// BaseConstructL() completes the UI framework's
+	// construction of the App UI.
+	BaseConstructL();
+	// Create the single Application view in which to
+	// draw the text to display the name of the Application that has been launched, passing into it
+	// the rectangle available to it.
+	
+ 	TRect cliRect = ClientRect();
+ 	const TInt width = 580/3;
+ 	
+	cliRect.SetWidth(width);
+	
+	iAppView = CTRuleBasedAppView::NewL(cliRect);
+
+	// The application window occupies 1/3 of the screen.
+	if (iAppView->iAppType == KCentre)
+		{
+		TPoint Origin( width,0);
+		iAppView->SetPosition(Origin);
+		}
+	else if (iAppView->iAppType == KRight)
+		{
+		TPoint Origin( (2*width),0);
+		iAppView->SetPosition(Origin);
+		}
+	}
+
+/**
+The App Ui owns the two views and is.
+therefore, responsible for destroying them
+*/
+
+CTRuleBasedAppUi::~CTRuleBasedAppUi()
+	{
+	delete iAppView;
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// Implementation of the
+// Application class - CTRuleBasedApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+const TUid KUidRuleBasedApp = { 0X1020D6FE };
+
+/**
+The function is called by the UI framework to ask for the
+Application's UID. The returned value is defined by the
+constant KUidRuleBasedAppe and must match the second value
+defined in the project definition file.
+*/
+
+TUid CTRuleBasedApplication::AppDllUid() const
+	{
+	return KUidRuleBasedApp;
+	}
+
+/**
+This function is called by the UI framework at
+Application start-up. It creates an instance of the
+document class.
+*/
+
+CApaDocument* CTRuleBasedApplication::CreateDocumentL()
+	{
+	return new (ELeave) CTRuleBasedDocument(*this);
+	}
+
+void CTRuleBasedAppUi::HandleCommandL(TInt aCommand)
+	{
+	switch (aCommand)
+		{
+	case EEikCmdExit:
+		Exit();
+		break;
+		}
+	}
+
+/**
+The entry point for the Application code. It creates
+an instance of the CApaApplication derived
+class, CTRuleBasedApplication.
+*/
+
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CTRuleBasedApplication;
+	}
+
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication( NewApplication );
+	}
+
+
+#if defined( __WINS__ ) && !defined(EKA2)
+GLDEF_C TInt E32Dll(TDllReason)
+	{
+	return KErrNone;
+	}
+	
+EXPORT_C TInt WinsMain( TDesC* aCommandLine )
+	{
+	return EikStart::RunApplication( NewApplication, aCommandLine );
+	}
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp3.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,57 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// t_RuleBasedApp.mmp
+// 
+//
+
+#include <platform_paths.hrh>
+
+// using relative paths for sourcepath and user includes
+CAPABILITY NONE
+epocstacksize 		0x5000
+
+TARGETPATH		/sys/bin
+
+
+TARGET			tRuleBasedApp3.exe
+TARGETTYPE		exe
+
+
+UID           		0x100039CE 0X1020D6FE
+
+VENDORID 		0x70000001
+
+SOURCEPATH    		.
+
+SOURCE        		tRuleBasedApp3.cpp
+
+
+USERINCLUDE   		.
+
+SYSTEMINCLUDE 		/epoc32/include
+SYSTEMINCLUDE 		/epoc32/include/techview
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY       		euser.lib apparc.lib cone.lib eikcore.lib bitgdi.lib fntstr.lib fbscli.lib gdi.lib
+
+			
+START RESOURCE      	tRuleBasedApp3.rss
+HEADER
+TARGETPATH		/resource/apps
+END
+
+START RESOURCE		tRuleBasedApp3_reg.rss
+TARGETPATH		/private/10003a3f/apps
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp3.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,98 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// t_RuleBasedApp3.rss
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+NAME GUBA
+
+#include <eikon.rh>
+#include <appinfo.rh>
+#include <eikon.rsg>
+#include <eikcore.rsg>
+#include <fontids.h>
+#include <gulfont.hrh>
+
+#include "tRuleBasedApp.hrh"
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+	{
+	hotkeys=r_rulebased_hotkeys;
+	menubar=r_rulebased_menubar;
+	}
+
+
+
+RESOURCE HOTKEYS r_rulebased_hotkeys
+    {
+    control=
+	{
+        HOTKEY { command=EEikCmdExit; key='e'; }
+        };
+    }
+
+RESOURCE MENU_BAR r_rulebased_menubar
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_rulebased_first_menu; txt="RuleBasedApp3"; }
+    	};
+    }
+
+RESOURCE MENU_PANE r_rulebased_first_menu
+   {
+	items=
+	{
+	MENU_ITEM { command=EEikCmdExit; txt="Close"; }
+	};  
+    }
+
+/////TKAS
+RESOURCE TBUF r_appname_default_file
+	{
+	buf="tRuleBasedApp3";
+	}
+
+RESOURCE LOCALISABLE_APP_INFO r_lai
+	{
+	short_caption="RuleBased3";
+	
+	caption_and_icon=	
+		{
+		CAPTION_AND_ICON_INFO
+			{
+			caption="tRuleBasedApp3";
+			}
+		};
+
+	}
+	
+RESOURCE EIK_APP_INFO 
+	{
+
+	}	
+
+
+RESOURCE TBUF r_rulebased_text { buf="RuleBasedApp3"; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp3_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,32 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// t_RuleBasedApp3.reg
+// 
+//
+
+
+#include <appinfo.rh>
+#include <tRuleBasedApp3.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+
+UID3 0x1020D6FE // App UID
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="tRuleBasedApp3";
+	localisable_resource_file="\\resource\\apps\\tRuleBasedApp3";
+	localisable_resource_id=R_LAI;
+	
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp4.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,392 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is a simple Application containing a single view with
+// text drawn on it.
+// The app includes code for displaying a very simple menu.
+// This source file contains the single exported function required by
+// all UI Applications and the E32Dll function which is also required
+// but is not used here.
+// The class definitions are:
+// CTRuleBasedApplication
+// CTRuleBasedAppUi
+// CTRuleBasedAppView
+// CTRuleBasedDocument
+// 
+//
+
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <coeccntx.h>
+#include <eikenv.h>
+#include <eikAppui.h>
+#include <eikApp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+#include <eikstart.h>
+
+#include <eikon.hrh>
+
+#include <tRuleBasedApp4.rsg>
+#include "tRuleBasedApp.hrh"
+
+//const TInt KLeft 	= 0; // Display app window on the left
+const TInt KCentre 	= 1; // Display app window in the centre
+const TInt KRight 	= 2; // Display app window on the right
+
+////////////////////////////////////////////////////////////////////////
+//
+// CTRuleBasedApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+class CTRuleBasedApplication : public CEikApplication
+	{
+private:
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+	};
+	
+////////////////////////////////////////////////////////////////////////
+//
+// CTRuleBasedAppView
+//
+////////////////////////////////////////////////////////////////////////
+class CTRuleBasedAppView : public CCoeControl
+ 	{
+public:
+	static CTRuleBasedAppView* NewL(const TRect& aRect);
+	CTRuleBasedAppView();
+	~CTRuleBasedAppView();
+	void ConstructL(const TRect& aRect);
+public:
+	TInt iAppType;
+
+private:
+	// Inherited from CCoeControl
+	void Draw(const TRect& /*aRect*/) const;
+	const CFont* CreateCustomFontL( const TDesC& aFontName, TInt aHeightInPixels, TBool aBold ) const;
+
+private:
+	HBufC* iRuleBasedText;
+ 	};
+
+////////////////////////////////////////////////////////////////////////
+//
+// CTRuleBasedAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CTRuleBasedAppUi : public CEikAppUi
+	{
+public:
+	void ConstructL();
+	~CTRuleBasedAppUi();
+
+private:
+	// Inherirted from class CEikAppUi
+	void HandleCommandL(TInt aCommand);
+
+private:
+	CTRuleBasedAppView* iAppView;
+	};
+
+////////////////////////////////////////////////////////////////////////
+//
+// CTRuleBasedDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CTRuleBasedDocument : public CEikDocument
+	{
+public:
+	static CTRuleBasedDocument* NewL(CEikApplication& aApp);
+	CTRuleBasedDocument(CEikApplication& aApp);
+	void ConstructL();
+private:
+	// Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+//////////////////////////////////////////////////////////////////////
+//
+// Application Document class - CTRuleBasedAppDocument
+//
+//////////////////////////////////////////////////////////////////////
+
+/**
+The constructor of the document class just passes the
+supplied reference to the constructor initialisation list.
+The document has no real work to do in this Application.
+*/
+
+CTRuleBasedDocument::CTRuleBasedDocument(CEikApplication& aApp)
+	: CEikDocument(aApp)
+	{
+	}
+
+/**
+This is called by the UI framework as soon as the
+document has been created. It creates an instance
+of the ApplicationUI. The Application UI class is
+an instance of a CEikAppUi derived class.
+*/
+
+CEikAppUi* CTRuleBasedDocument::CreateAppUiL()
+	{
+ 	return new(ELeave) CTRuleBasedAppUi;
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// Source for the implementation of the 
+// Application view class - CTRuleBasedAppView
+//
+////////////////////////////////////////////////////////////////////////
+
+
+// Constructor for the view.
+
+CTRuleBasedAppView::CTRuleBasedAppView():iAppType(KCentre)
+	{
+	}
+/**
+Static NewL() function to start the standard two
+phase construction.
+*/
+
+CTRuleBasedAppView* CTRuleBasedAppView::NewL(const TRect& aRect)
+	{
+	CTRuleBasedAppView* self = new(ELeave) CTRuleBasedAppView();
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect);
+	CleanupStack::Pop();
+	return self;
+	}
+
+//
+// Destructor for the view.
+
+CTRuleBasedAppView::~CTRuleBasedAppView()
+	{
+	delete iRuleBasedText;
+	}
+
+/**
+Second phase construction.
+*/
+
+void CTRuleBasedAppView::ConstructL(const TRect& aRect)
+ 	{
+	// Fetch the text from the resource file.
+	iRuleBasedText = iEikonEnv->AllocReadResourceL(R_RULEBASED_TEXT);
+	// Control is a window owning control
+
+	CreateWindowL();
+	// Extent of the control. This is
+	// the whole rectangle available to Application.
+	// The rectangle is passed to us from the Application UI.
+	SetRect(aRect);
+	// At this stage, the control is ready to draw so
+	// we tell the UI framework by activating it.
+	ActivateL();
+	}
+
+/**
+Drawing the view - in this example, 
+consists of drawing a simple outline rectangle
+and then drawing the text in the middle.
+
+In this example, we don't use the redraw
+region because it's easier to redraw to
+the whole client area.
+*/
+
+const CFont* CTRuleBasedAppView::CreateCustomFontL( const TDesC& aFontName, TInt aHeightInPixels, TBool aBold ) const
+	 {
+	 // Create a Symbian font spec
+	 TFontSpec fontSpec;
+
+	 // Enable antialising
+	 TOpenFontSpec openSpec;
+
+	 openSpec.SetBitmapType(EAntiAliasedGlyphBitmap);
+
+	 openSpec.GetTFontSpec(fontSpec); // sets the antialiasing into the TFontSpec
+	 fontSpec.iTypeface.iName = aFontName;
+	 fontSpec.iHeight = aHeightInPixels;
+
+	 if (aBold)
+	 	{
+	 	fontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightBold );
+		}
+	 CFbsFont* font;
+	 CWsScreenDevice& screenDev=*(CEikonEnv::Static()->ScreenDevice());
+	 User::LeaveIfError(screenDev.GetNearestFontInPixels((CFont*&)font,fontSpec));
+	 return font;
+	 }
+    
+void CTRuleBasedAppView::Draw(const TRect& aRect) const
+	{
+	// Window graphics context
+	CWindowGc& gc = SystemGc();
+	// Area in which we shall draw
+	TRect	drawRect = Rect();
+	
+	// Font used for drawing text
+	const CFont* fontUsed = NULL;
+	
+	// Start with a clear screen
+	gc.Clear();
+			
+	gc.DrawRect(drawRect);
+
+	TRAPD(err, fontUsed = CreateCustomFontL(_L("Times New Roman"),20,1));
+	if (err!=KErrNone)
+		{
+		return;
+		}
+		
+	gc.SetPenColor(KRgbYellow);
+	gc.UseFont(fontUsed);
+	// Draw the text in the middle of the rectangle.
+	TInt baselineOffset=(aRect.Height() - fontUsed->HeightInPixels())/2;
+	gc.DrawText(*iRuleBasedText,aRect,baselineOffset,CGraphicsContext::ECenter, 0);
+	// Finished using the font
+	gc.DiscardFont();
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// Application UI class - CTRuleBasedAppUi
+//
+////////////////////////////////////////////////////////////////////////
+
+/**
+The second phase constructor of the Application UI class.
+The Application UI creates and owns the one and only view.
+*/
+
+void CTRuleBasedAppUi::ConstructL()
+	{
+	// BaseConstructL() completes the UI framework's
+	// construction of the App UI.
+	BaseConstructL();
+	// Create the single Application view in which to
+	// draw the text to display the name of the Application that has been launched, passing into it
+	// the rectangle available to it.
+	
+ 	TRect cliRect = ClientRect();
+ 	const TInt width = 580/3;
+ 	
+	cliRect.SetWidth(width);
+	
+	iAppView = CTRuleBasedAppView::NewL(cliRect);
+
+	// The application window occupies 1/3 of the screen.
+	if (iAppView->iAppType == KCentre)
+		{
+		TPoint Origin( width,0);
+		iAppView->SetPosition(Origin);
+		}
+	else if (iAppView->iAppType == KRight)
+		{
+		TPoint Origin( (2*width),0);
+		iAppView->SetPosition(Origin);
+		}
+	}
+
+/**
+The App Ui owns the two views and is.
+therefore, responsible for destroying them
+*/
+
+CTRuleBasedAppUi::~CTRuleBasedAppUi()
+	{
+	delete iAppView;
+	}
+
+////////////////////////////////////////////////////////////////////////
+//
+// Implementation of the
+// Application class - CTRuleBasedApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+const TUid KUidRuleBasedApp = { 0X10210F77 }; 
+
+/**
+The function is called by the UI framework to ask for the
+Application's UID. The returned value is defined by the
+constant KUidRuleBasedAppe and must match the second value
+defined in the project definition file.
+*/
+
+TUid CTRuleBasedApplication::AppDllUid() const
+	{
+	return KUidRuleBasedApp;
+	}
+
+/**
+This function is called by the UI framework at
+Application start-up. It creates an instance of the
+document class.
+*/
+
+CApaDocument* CTRuleBasedApplication::CreateDocumentL()
+	{
+	return new (ELeave) CTRuleBasedDocument(*this);
+	}
+
+void CTRuleBasedAppUi::HandleCommandL(TInt aCommand)
+	{
+	switch (aCommand)
+		{
+	case EEikCmdExit:
+		Exit();
+		break;
+		}
+	}
+
+/**
+The entry point for the Application code. It creates
+an instance of the CApaApplication derived
+class, CTRuleBasedApplication.
+*/
+
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CTRuleBasedApplication;
+	}
+
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication( NewApplication );
+	}
+
+
+#if defined( __WINS__ ) && !defined(EKA2)
+GLDEF_C TInt E32Dll(TDllReason)
+	{
+	return KErrNone;
+	}
+	
+EXPORT_C TInt WinsMain( TDesC* aCommandLine )
+	{
+	return EikStart::RunApplication( NewApplication, aCommandLine );
+	}
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp4.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,56 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// t_RuleBasedApp4.mmp
+// 
+//
+
+#include <platform_paths.hrh>
+
+// using relative paths for sourcepath and user includes
+CAPABILITY NONE
+epocstacksize 		0x5000
+
+TARGETPATH		/sys/bin
+
+
+TARGET			tRuleBasedApp4.exe
+TARGETTYPE		exe
+
+
+UID           		0x100039CE 0x10210F77
+
+VENDORID 		0x70000001
+
+SOURCEPATH    		.
+
+SOURCE        		tRuleBasedApp4.cpp
+
+USERINCLUDE   		.
+
+SYSTEMINCLUDE 		/epoc32/include
+SYSTEMINCLUDE 		/epoc32/include/techview
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY       		euser.lib apparc.lib cone.lib eikcore.lib bitgdi.lib fntstr.lib fbscli.lib gdi.lib
+
+			
+START RESOURCE      	tRuleBasedApp4.rss
+HEADER
+TARGETPATH		/resource/apps
+END
+
+START RESOURCE		tRuleBasedApp4_reg.rss
+TARGETPATH		/private/10003a3f/apps
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp4.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,94 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+
+NAME GUBA
+
+#include <eikon.rh>
+#include <appinfo.rh>
+#include <eikon.rsg>
+#include <eikcore.rsg>
+#include <fontids.h>
+#include <gulfont.hrh>
+
+#include "tRuleBasedApp.hrh"
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+	{
+	hotkeys=r_rulebased_hotkeys;
+	menubar=r_rulebased_menubar;
+	}
+
+
+
+RESOURCE HOTKEYS r_rulebased_hotkeys
+    {
+    control=
+	{
+        HOTKEY { command=EEikCmdExit; key='e'; }
+        };
+    }
+
+RESOURCE MENU_BAR r_rulebased_menubar
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_rulebased_first_menu; txt="RuleBasedApp4"; }
+    	};
+    }
+
+RESOURCE MENU_PANE r_rulebased_first_menu
+   {
+	items=
+	{
+	MENU_ITEM { command=EEikCmdExit; txt="Close"; }
+	};  
+    }
+
+/////TKAS
+RESOURCE TBUF r_appname_default_file
+	{
+	buf="tRuleBasedApp4";
+	}
+
+RESOURCE LOCALISABLE_APP_INFO r_lai
+	{
+	short_caption="RuleBased4";
+	
+	caption_and_icon=	
+		{
+		CAPTION_AND_ICON_INFO
+			{
+			caption="tRuleBasedApp4";
+			}
+		};
+
+	}
+	
+
+
+
+RESOURCE TBUF r_rulebased_text { buf="RuleBasedApp4"; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tRuleBasedApps/tRuleBasedApp4_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// tRuleBasedApp4.mmp
+// 
+//
+
+
+
+
+#include <appinfo.rh>
+#include <tRuleBasedApp4.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+
+UID3 0x10210F77 // App UID
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="tRuleBasedApp4";
+	localisable_resource_file="\\resource\\apps\\tRuleBasedApp4";
+	localisable_resource_id=R_LAI;
+	
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/t_abstractnonnativeappsstep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,118 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code  
+*/
+
+#include "t_abstractnonnativeappsstep.h"
+
+#include <apgicnfl.h>
+
+CT_AbstractNonNativeAppsTestStep::CT_AbstractNonNativeAppsTestStep()
+	{
+	}
+
+CT_AbstractNonNativeAppsTestStep::~CT_AbstractNonNativeAppsTestStep()
+	{
+	}
+
+void CT_AbstractNonNativeAppsTestStep::doAbstractNonNativeAppsTestStepPreambleL()
+	{
+	TInt error = iSession.Connect();
+	TEST(error==KErrNone);
+	error = iUtils.Connect();
+	TEST(error==KErrNone);
+	}
+
+void CT_AbstractNonNativeAppsTestStep::CleanupAndReset(RTestableApaLsSession& aSession, const TTestAppDetails& aApp)
+	{
+	// make sure we're starting from a clean sheet
+	CompleteDeregisterL(aSession, aApp);
+	aSession.DeregisterNonNativeApplicationTypeL(TUid::Uid(KApplicationType));
+	aSession.RegisterNonNativeApplicationTypeL(TUid::Uid(KApplicationType), KLitNativeExecutable);
+	}
+
+void CT_AbstractNonNativeAppsTestStep::CallRegisterL(RTestableApaLsSession& aSession, const TTestAppDetails& aApp)
+	{
+	CApaRegistrationResourceFileWriter* const registrationResourceFileWriter =
+		CApaRegistrationResourceFileWriter::NewL(TUid::Uid(aApp.iAppUid), aApp.iLogicalExecutable, TApaAppCapability::ENonNative);
+	CleanupStack::PushL(registrationResourceFileWriter);
+	aSession.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, *registrationResourceFileWriter, NULL, NULL);
+	CleanupStack::PopAndDestroy();
+	}
+
+void CT_AbstractNonNativeAppsTestStep::CompleteRegisterL(RTestableApaLsSession& aSession, const TTestAppDetails& aApp)
+	{
+	aSession.PrepareNonNativeApplicationsUpdatesL();
+	CallRegisterL(aSession, aApp);
+	aSession.CommitNonNativeApplicationsUpdatesL();
+	}
+
+void CT_AbstractNonNativeAppsTestStep::CallDeregisterL(RTestableApaLsSession& aSession, const TTestAppDetails& aApp)
+	{
+	aSession.DeregisterNonNativeApplicationL(TUid::Uid(aApp.iAppUid));
+	}
+
+void CT_AbstractNonNativeAppsTestStep::CompleteDeregisterL(RTestableApaLsSession& aSession, const TTestAppDetails& aApp)
+	{
+	aSession.PrepareNonNativeApplicationsUpdatesL();
+	CallDeregisterL(aSession, aApp);
+	aSession.CommitNonNativeApplicationsUpdatesL();
+	}
+
+TBool CT_AbstractNonNativeAppsTestStep::FilePresent(const TDesC& aFile)
+	{
+	TBool present = EFalse;
+	TInt err = iUtils.IsFilePresent(aFile, present);
+	TEST(err == KErrNone);
+	return present;
+	}
+
+TBool CT_AbstractNonNativeAppsTestStep::FileAbsent(const TDesC& aFile)
+	{
+	TBool present = ETrue;
+	TInt err = iUtils.IsFilePresent(aFile, present);
+	TEST(err == KErrNone);
+	return !present;
+	}
+
+TBool CT_AbstractNonNativeAppsTestStep::AppPresent(RTestableApaLsSession& aSession, const TTestAppDetails& aApp)
+	{
+	TApaAppInfo info;
+	TInt err = aSession.GetAppInfo(info,TUid::Uid(aApp.iAppUid));
+	TEST(err == KErrNone);
+	TUid typeUid;
+	err = aSession.GetAppType(typeUid, TUid::Uid(aApp.iAppUid));
+	TEST(err == KErrNone);
+	
+	TBool test1 = (info.iUid.iUid == aApp.iAppUid) && (typeUid == TUid::Uid(KApplicationType));
+	TBool test2 = FilePresent(aApp.iRegistrationFile);
+	TBool test3 = FileAbsent(KLitUpdatedAppsList);
+	return test1 && test2 && test3;
+	}
+
+TBool CT_AbstractNonNativeAppsTestStep::AppAbsent(RTestableApaLsSession& aSession, const TTestAppDetails& aApp)
+	{
+	TApaAppInfo info;
+	TInt err = aSession.GetAppInfo(info,TUid::Uid(aApp.iAppUid));
+	TBool test1 = (err == KErrNotFound);
+	TBool test2 = FileAbsent(aApp.iRegistrationFile);
+	TBool test3 = FileAbsent(KLitUpdatedAppsList);
+	return test1 && test2 && test3;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/t_abstractnonnativeappsstep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,72 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+ 
+#ifndef T_ABSTRACT_NONNATIVEAPPS_STEP_H
+#define T_ABSTRACT_NONNATIVEAPPS_STEP_H
+
+#include <testexecutestepbase.h>
+#include  <appfwk_test_utils.h>
+#include "testableapalssession.h"
+
+const TInt KApplicationType = 0x102081A0;
+_LIT(KLitNativeExecutable, "z:\\sys\\bin\\dummy.exe");
+_LIT(KLitUpdatedAppsList, "c:\\private\\10003a3f\\UpdatedAppsList.bin");
+
+class CT_AbstractNonNativeAppsTestStep : public CTestStep
+	{
+public:
+	CT_AbstractNonNativeAppsTestStep();
+	~CT_AbstractNonNativeAppsTestStep();
+
+public:
+	struct TTestAppDetails 
+		{
+		inline TTestAppDetails(TInt aAppUid, const TDesC& aLogicalExecutable, const TDesC& aRegistrationFile) :
+				iAppUid(aAppUid),
+				iLogicalExecutable(aLogicalExecutable),
+				iRegistrationFile(aRegistrationFile)
+			{
+			}
+		TInt iAppUid;
+		const TDesC& iLogicalExecutable;
+		const TDesC& iRegistrationFile;
+		};
+
+protected:
+	void doAbstractNonNativeAppsTestStepPreambleL();
+	static void CleanupAndReset(RTestableApaLsSession& aSession, const TTestAppDetails& aApp);
+	static void CallRegisterL(RTestableApaLsSession& aSession, const TTestAppDetails& aApp);
+	static void CompleteRegisterL(RTestableApaLsSession& aSession, const TTestAppDetails& aApp);
+	static void CallDeregisterL(RTestableApaLsSession& aSession, const TTestAppDetails& aApp);
+	static void CompleteDeregisterL(RTestableApaLsSession& aSession, const TTestAppDetails& aApp);
+	TBool FilePresent(const TDesC& aFile);
+	TBool FileAbsent(const TDesC& aFile);
+	TBool AppPresent(RTestableApaLsSession& aSession, const TTestAppDetails& aApp);
+	TBool AppAbsent(RTestableApaLsSession& aSession, const TTestAppDetails& aApp);
+
+protected:
+	RTestableApaLsSession iSession;
+	RSmlTestUtils iUtils;
+	};
+	
+#endif // T_ABSTRACT_NONNATIVEAPPS_STEP_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/t_drivenotification.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,276 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Only in Armv5 platform,
+// C: Drive is set to be monitored using KApaDrivesToMonitor. The value of 
+// KApaDrivesToMonitor is set to 4. It is computed in the following way.
+// ZY XWVU TSRQ PONM LKJI HGFE DCBA
+// 00 0000 0000 0000 0000 0000 0100. 
+// If the value is Set then the corresponding drive has to be monitored.
+// 
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <e32test.h>
+#include "appfwk_test_utils.h"
+#include "t_drivenotification.h"
+
+_LIT(KResourceFileSourceZ, "z:\\system\\data\\tnotifydrivesapp_reg.rsc");
+
+void CDriveTestObserver::HandleAppListEvent(TInt /*aEvent*/)
+	{
+	iNotified++;
+	if (iNotifier)
+		iNotifier->Cancel();
+	CActiveScheduler::Stop();
+	}
+
+CT_DriveNotificationStep::~CT_DriveNotificationStep()
+	{	
+	}
+
+CT_DriveNotificationStep::CT_DriveNotificationStep()
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KT_DriveNotificationStep);
+	}
+	
+/**
+   @SYMTestCaseID	APPFWK-APPARC-0083
+  
+   @SYMCR 			CR1035
+  
+   @SYMTestCaseDesc Test for the drive's notification.
+   
+   @SYMTestPriority High 
+  
+   @SYMTestStatus 	Implemented
+   
+   @SYMTestActions 	In armv5 platform, the patchable constant KApaDrivesToMonitor is set to monitor C: drive. 
+   Hence the notifications from other drives are ignored. The test copies the tnotifydrivesapp_reg.rsc to either 
+   D: or E: drive and also to C:. There will be no notification from D: or E: drives and the applist wont be 
+   updated whereas from C: notifications will be issued and applist will be updated.
+   In Winscw platform, all the drives will be monitored by default and notifications will be issued when the test
+   copies tnotifydrivesapp_reg.rsc to C: drive and W: drive and the applist will be updated.
+   
+   @SYMTestExpectedResults The app is not added to the applist when no notification is issued and applist is 
+   updated when notifications are issued.
+*/    
+void CT_DriveNotificationStep::TestDrivesNotificationL()
+	{
+	INFO_PRINTF1(_L("Start TestDriveNotification()"));
+	
+	TApaAppInfo appInfo;
+	TUid appUid = {0xA0003376};
+	RApaLsSession theLs;
+	User::LeaveIfError(theLs.Connect());
+	CleanupClosePushL(theLs);
+	
+	// Wait for applist to be updated.... 
+	RPointerArray<TDesC> dummy;
+	User::LeaveIfError(theLs.ForceRegistration(dummy));
+	
+	//Check whether app is not present in the applist
+	TInt ret = theLs.GetAppInfo(appInfo,appUid);
+	INFO_PRINTF3(_L(" Expected value is %d, Call to GetAppInfo returned : %d  "), KErrNotFound, ret);
+	TEST(ret==KErrNotFound);
+	
+	//Copy the registration file to C: drive.
+	CopyRegFileL(EDriveC);
+	
+	CDriveTestObserver* obs = new(ELeave) CDriveTestObserver();
+	CleanupStack::PushL(obs);
+	CApaAppListNotifier* notif = CApaAppListNotifier::NewL(obs, CActive::EPriorityHigh);
+	CleanupStack::PushL(notif);
+	
+	obs->iNotifier = notif;
+		
+	CActiveScheduler::Start();
+	//Since c:\\private\\10003a3f\\Import\\apps\\ path is Monitored, a notification is issued and applist is updated.
+	TEST(obs->iNotified > 0);	
+	INFO_PRINTF2(_L("Received %d notifications"),obs->iNotified);
+	
+	//Check whether applist is updated and app is present in the applist.
+	ret = theLs.GetAppInfo(appInfo,appUid);
+	INFO_PRINTF3(_L(" Expected value is %d, Call to GetAppInfo returned : %d  "), KErrNone, ret);
+	TEST(ret==KErrNone);
+	
+	//Deleting the rsc file that is present in c:\\private\\10003a3f\\Import\\apps\\ path.
+	DeleteRegFileL(EDriveC);
+	
+	// Wait for applist to be updated.... 
+	User::LeaveIfError(theLs.ForceRegistration(dummy));
+	
+	//Check whether applist is updated and app is absent in the applist.
+	ret = theLs.GetAppInfo(appInfo,appUid);
+	INFO_PRINTF3(_L(" Expected value is %d, Call to GetAppInfo returned : %d  "), KErrNotFound, ret);
+	TEST(ret==KErrNotFound);
+		
+	//Armv5 platform, GetMMCDriveL() returns either the D: (in case of NAND rom) or E: (in case of Normal rom).
+	//Winscw platform, GetMMCDriveL() returns W:.
+	TDriveNumber drive = GetMMCDriveL();
+	
+	//Copy the registration file to drive specified.
+	CopyRegFileL(drive);
+	
+	// Wait for applist to be updated.... 
+	User::LeaveIfError(theLs.ForceRegistration(dummy));
+	
+	//Check whether applist is updated and app is present in the applist.
+#ifdef __EABI__
+	ret = theLs.GetAppInfo(appInfo,appUid);
+	TEST (ret == KErrNotFound);
+	INFO_PRINTF3(_L(" Expected value is %d, Call to GetAppInfo returned : %d  "), KErrNotFound, ret);
+	//Deleting the rsc file.
+	DeleteRegFileL(drive);
+#else	
+	ret = theLs.GetAppInfo(appInfo,appUid);
+	TEST(ret==KErrNone);
+	INFO_PRINTF3(_L(" Expected value is %d, Call to GetAppInfo returned : %d  "),KErrNone, ret);
+	//Deleting the rsc file.
+	DeleteRegFileL(drive);
+#endif
+	CleanupStack::PopAndDestroy(3, &theLs);
+	
+	INFO_PRINTF1(_L("End TestDrivesNotificationL()"));
+	}
+/*
+Copy the tnotifydrivesapp_reg.rsc file from source to destination. 
+In Winscw platform, the registration file is copied to C: and W: drive.
+In Armv5 platform, the registration file is copied to C: and D: or E: drive. 
+*/
+
+void CT_DriveNotificationStep::CopyRegFileL(TDriveNumber aDriveNumber)
+	{
+	_LIT(KResourceFileTarget, ":\\private\\10003a3f\\Import\\apps\\tnotifydrivesapp_reg.rsc");	
+	_LIT(KResourceAppFolder, ":\\private\\10003a3f\\Import\\apps\\");
+	RBuf tempPathToBeCopied, tempFolderToBeCreated;
+	RFs fs;
+	TChar driveLetter;
+	CleanupClosePushL(fs);
+	User::LeaveIfError(fs.Connect());
+	TInt maxSizeofFileName = KResourceFileTarget().Length() + 1;
+	TInt maxSizeofFolderName = KResourceAppFolder().Length() + 1;
+	tempPathToBeCopied.CreateL(maxSizeofFileName);
+	CleanupClosePushL(tempPathToBeCopied);
+	tempFolderToBeCreated.CreateL(maxSizeofFolderName);
+	CleanupClosePushL(tempFolderToBeCreated);
+	fs.DriveToChar(aDriveNumber,driveLetter);
+	tempPathToBeCopied.Append(driveLetter);
+	tempPathToBeCopied.Append(KResourceFileTarget);
+	tempFolderToBeCreated.Append(driveLetter);
+	tempFolderToBeCreated.Append(KResourceAppFolder);
+	RSmlTestUtils smlServer;
+	CleanupClosePushL(smlServer);
+	TInt ret = smlServer.Connect();
+	TEST(ret == KErrNone);
+	ret = smlServer.CreateDirectoryL(tempFolderToBeCreated);
+	if (ret != KErrNone && ret != KErrAlreadyExists)
+		{
+		User::LeaveIfError(ret);
+		}
+	ret = smlServer.CopyFileL(KResourceFileSourceZ, tempPathToBeCopied);
+	TEST(ret == KErrNone);
+	INFO_PRINTF2(_L("Copied Registration file. Finished with the value : %d "), ret);
+	CleanupStack::PopAndDestroy(4, &fs);
+	}
+
+
+
+void CT_DriveNotificationStep::DeleteRegFileL(TDriveNumber aDriveNumber)
+	{
+	_LIT(KResourceFileTarget, ":\\private\\10003a3f\\Import\\apps\\tnotifydrivesapp_reg.rsc");	
+	RBuf tempPathToBeDeleted;
+	RFs fs;
+	TChar driveLetter;
+	CleanupClosePushL(fs);
+	User::LeaveIfError(fs.Connect());
+	TInt maxSizeofFileName = KResourceFileTarget().Length() + 1;
+	tempPathToBeDeleted.CreateL(maxSizeofFileName);
+	CleanupClosePushL(tempPathToBeDeleted);
+	fs.DriveToChar(aDriveNumber,driveLetter);
+	tempPathToBeDeleted.Append(driveLetter);
+	tempPathToBeDeleted.Append(KResourceFileTarget);
+	RSmlTestUtils smlServer;
+	CleanupClosePushL(smlServer);
+	TInt ret = smlServer.Connect();
+	TEST(ret == KErrNone);
+	ret = smlServer.SetReadOnly(tempPathToBeDeleted, 0)	;
+	TEST(ret == KErrNone);
+	//delete the file
+	ret = smlServer.DeleteFileL(tempPathToBeDeleted);	
+	TEST(ret == KErrNone);
+	INFO_PRINTF2(_L("Deleted Registration file. Finished with value : %d"), ret);	
+	CleanupStack::PopAndDestroy(3,&fs);
+	}
+	
+
+TDriveNumber CT_DriveNotificationStep::GetMMCDriveL()
+	{
+	TDriveNumber drive = EDriveW;	
+#ifdef __EABI__
+	RFs	fs;
+ 	User::LeaveIfError(fs.Connect());
+	// The removable media is expected at D: on NAND ROM and at E: on normal ROMs.
+	//The following code works on techview but not guaranteed to work on all platforms. 
+	TDriveInfo driveInfo;
+	TInt err = fs.Drive(driveInfo, EDriveD);
+	if(err == KErrNone && ((driveInfo.iDriveAtt & KDriveAttRemovable) != 0))
+		{
+	 	 // Use drive D
+	 	drive = EDriveD;
+	 	}
+	 else
+	 	{
+		err = fs.Drive(driveInfo, EDriveE);
+		if(err == KErrNone && ((driveInfo.iDriveAtt & KDriveAttRemovable) != 0))
+			{
+		 	// Use drive E
+		 	drive = EDriveE;
+		 	}
+		}
+	fs.Close();
+#else
+	drive = EDriveW;
+#endif	
+	return drive;
+	}
+
+
+TVerdict CT_DriveNotificationStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Testing the Notifications ... T_DriveNotification"));
+	
+	// start an active scheduler
+	iScheduler=new(ELeave) CActiveScheduler();
+	CActiveScheduler::Install(iScheduler);
+	
+	// run the testcode (inside an alloc heaven harness)
+ 	__UHEAP_MARK;
+ 	 	
+ 	TRAPD(ret,TestDrivesNotificationL());
+	TEST(ret==KErrNone);
+	INFO_PRINTF2(_L("TestDrivesNotificationL finished with code '%d'\n"), ret);
+ 	
+  	__UHEAP_MARKEND;
+
+	INFO_PRINTF1(_L("T_DriveNotification Completed."));
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/t_drivenotification.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,57 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code  
+*/
+
+#if (!defined __T_DRIVENOTIFICATION_H__)
+#define __T_DRIVENOTIFICATION_H__
+#include "ApparcTestServer.h"
+#include <apgnotif.h>
+#include <apgcli.h>
+#include <eikenv.h>
+
+/**  Checks for notifications when application list changes. */
+
+class CT_DriveNotificationStep :public CTestStep
+	{
+public:
+	CT_DriveNotificationStep();
+	~CT_DriveNotificationStep();	
+	virtual TVerdict doTestStepL();
+	void TestDrivesNotificationL();
+private:
+	TDriveNumber GetMMCDriveL();
+	void DeleteRegFileL(TDriveNumber aDriveNumber);
+	void CopyRegFileL(TDriveNumber aDriveNumber);
+	CActiveScheduler* iScheduler;
+	};
+	
+class CDriveTestObserver : public CBase, public MApaAppListServObserver
+	{
+public: // from MApaAppListServObserver
+	void HandleAppListEvent(TInt aEvent);
+public:
+	TInt iNotified;
+	CApaAppListNotifier* iNotifier;
+	};
+
+_LIT(KT_DriveNotificationStep,"T_DriveNotification");
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/t_largestackstep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,113 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// The following test case is used to test whether or not Apparc can handle loading applications with excessively large stack frames.
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <apgcli.h>
+#include <apacmdln.h>
+#include <apgicnfl.h>
+#include "../apserv/APSCLSV.H"
+#include "T_LargeStackStep.h"
+
+const TUid KLargeStackAppUid = {0x10282B27};
+
+TInt RTestApaLsSession::TestExeRecognizerL(const CApaCommandLine& aCommandLine)
+	{
+	TThreadId dummyThreadId;
+	TPckg<TThreadId> threadId(dummyThreadId);
+	const TInt opcode=EAppListServStartAppWithoutReturningThreadId;
+	TIpcArgs ipcArgs;
+	aCommandLine.GetIpcArgsLC(ipcArgs);
+	ipcArgs.Set(CApaCommandLine::EIpcFirstFreeSlot, &threadId);
+	User::LeaveIfError(SendReceive(opcode, ipcArgs));
+	CleanupStack::PopAndDestroy(); // the TIpcArgs
+	return KErrNone;
+	}
+
+CT_LargeStackStep::CT_LargeStackStep()
+	{
+	}
+
+CT_LargeStackStep::~CT_LargeStackStep()
+	{
+	iApaLsSession.Close();
+	}
+
+/**
+   @SYMTestCaseID APPFWK-APPARC-0060
+  
+   @SYMPREQ CR0885
+  
+   @SYMTestCaseDesc
+   Test apparc's use of RProcess::CreateWithStackOverride
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions
+	1. Load an application with an overly large stack requirement via RApaLsSession::StartApp.
+	2. Load the application via RApaLsSession::StartDocument
+	  
+   @SYMTestExpectedResults
+	Application should start normally both times.
+  
+*/
+void CT_LargeStackStep::TestLargeStackL()
+	{
+	TApaAppInfo info;
+	INFO_PRINTF1(_L("Test that the large stack example application can be found"));
+	TEST(iApaLsSession.GetAppInfo(info,KLargeStackAppUid)==KErrNone);
+
+	INFO_PRINTF1(_L("Test that the application executes without error"));
+	CApaCommandLine* commandline = CApaCommandLine::NewLC();
+	commandline->SetExecutableNameL(info.iFullName);
+	commandline->SetCommandL(EApaCommandRunWithoutViews);
+	TEST(iApaLsSession.StartApp(*commandline)==KErrNone);
+	
+	INFO_PRINTF1(_L("Test running the application via the legacy recogniser code."));
+	TEST(iApaLsSession.TestExeRecognizerL(*commandline)==KErrNone);
+
+	INFO_PRINTF1(_L("Test running the application via StartDocument."));
+	TThreadId threadId;
+	TEST(iApaLsSession.StartDocument(_L("z:\fakename.doc"), KLargeStackAppUid, threadId, RApaLsSession::ELaunchNewApp)==KErrNone);
+
+	// Cleanup
+	CleanupStack::PopAndDestroy(commandline);
+	}
+
+TVerdict CT_LargeStackStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test T_LargeStack Started"));
+	
+	__UHEAP_MARK;
+	// Connect to RApaLsSession
+	TEST(iApaLsSession.Connect()==KErrNone);
+
+	// Run the test
+	TRAPD(err,TestLargeStackL());
+	TEST(err==KErrNone);
+	__UHEAP_MARKEND;
+
+	INFO_PRINTF1(_L("Test Finished"));	
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/t_largestackstep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,53 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code	 
+*/
+
+#ifndef		__T_LARGESTACK_H
+#define		__T_LARGESTACK_H
+
+#include "appfwk_test_AppUi.h"
+
+_LIT(KT_LargeStackStep, "T_LargeStack");
+
+class RTestApaLsSession : public RApaLsSession
+	{
+public:
+	TInt TestExeRecognizerL(const CApaCommandLine& aCommandLine);
+	};
+
+class CT_LargeStackStep : public CTestStep
+	{
+public:
+	CT_LargeStackStep();
+	~CT_LargeStackStep();
+	
+	//from CTestStep
+	TVerdict doTestStepL();
+
+private:
+	void TestLargeStackL();
+
+private:
+	RTestApaLsSession iApaLsSession;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/t_mimecontentpolicystep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,512 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code  
+*/
+
+#include "t_mimecontentpolicystep.h"
+
+_LIT(KPathjpg1, "z:\\system\\data\\type-r.jpg");
+_LIT(KPathjpg2, "z:\\system\\data\\propelli.jpg");
+_LIT(KPathdcf,  "z:\\system\\data\\sd_goo.dcf");
+_LIT(KPathdm1,  "z:\\system\\data\\fl_goo.dm");
+_LIT(KPathgif,  "z:\\system\\data\\gif_wallpaper.gif");
+_LIT(KPathdm2,  "z:\\system\\data\\jpeg_wes.dm");
+
+/**
+   Constructor
+ */	
+CT_MimeContentPolicyStep::CT_MimeContentPolicyStep()
+	{
+	// Call base class method to set up the human readable name for logging*/
+	SetTestStepName(KT_MimeContentPolicyStep);
+	}
+
+/**
+   Destructor
+ */
+CT_MimeContentPolicyStep::~CT_MimeContentPolicyStep()
+	{
+	delete iCcp;
+	iApaLsSession.Close();
+	iFs.Close();
+	}
+
+TVerdict CT_MimeContentPolicyStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Testing Apparc...T_MimeContentPolicyStep Test Cases Running..."));
+	TInt error = iApaLsSession.Connect();
+	TEST(error == KErrNone);
+
+	error = iFs.Connect();
+	TEST(error == KErrNone);
+	
+	iCcp = CApfMimeContentPolicy::NewL();
+	
+	User::LeaveIfError(iFs.ShareProtected());
+
+	TRAPD(ret,RunTestCasesL())
+	TEST(ret==KErrNone);
+	
+	INFO_PRINTF1(_L("...T_MimeContentPolicyStep Test Cases Completed."));
+	return TestStepResult();
+	}
+
+void CT_MimeContentPolicyStep::RunTestCasesL()
+	{
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, CCPTestIsClosedType(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, CCPTestIsClosedExtension(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, CCPTestIsDRMEnvelopeFileNameL(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, CCPTestIsClosedFileFileNameL(), iApaLsSession.FlushRecognitionCache());
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, CCPTestIsDRMEnvelopeFileHandleL(), NO_CLEANUP);
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, CCPTestIsClosedFileFileHandleL(), iApaLsSession.FlushRecognitionCache());
+	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, CCPOOMTestL(), iApaLsSession.FlushRecognitionCache());
+	}
+
+/**
+   @SYMTestCaseID APPFWK-APPARC-0077
+
+   @SYMREQ REQ7736
+ 
+   @SYMTestCaseDesc Tests IsClosedType() method for different mime types
+  
+   @SYMTestPriority High 
+ 
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions Closed types are the mime types which are listed in the ApfMimeContentPolicy.rss file.
+   Calls CApfMimeContentPolicy::IsClosedType(const TDesC& aMimeType); for different closed and non-closed mime types.
+  
+   @SYMTestExpectedResults The test checks whether IsClosedType returns ETrue for the Closed Mime types and EFalse for non-closed Mime types
+ */
+void CT_MimeContentPolicyStep::CCPTestIsClosedType()
+	{
+	_LIT(KMimeType0, "application/vnd.oma.drm.message");
+	_LIT(KMimeType1, "application/vnd.oma.drm.rights+xml");
+	_LIT(KMimeType2, "application/vnd.oma.drm.rights+wbxml");
+	_LIT(KMimeType3, "application/vnd.nokia.ringing-tone");
+	_LIT(KMimeType4, "audio/amr-wb");
+	_LIT(KMimeType5, "audio/sp-midi");
+	_LIT(KMimeType6, "image/vnd.nok.3Dscreensaver");
+	_LIT(KMimeType7, "image/vnd.nok-wallpaper");
+	_LIT(KMimeType8, "image/vnd.nok-oplogo");
+	_LIT(KMimeType9, "image/vnd.nok-oplogo-color");
+	_LIT(KMimeType10, "application/java");
+	_LIT(KMimeType11, "application/java-archive");
+	_LIT(KMimeType12, "application/x-java-archive");
+	_LIT(KMimeType13, "text/vnd.sun.j2me.app-descriptor");
+	_LIT(KMimeType14, "application/x-NokiaGameData");
+	_LIT(KMimeType15, "application/vnd.symbian.install");
+	_LIT(KMimeType16, "x-epoc/x-sisx-app"); 
+
+	_LIT(KMimeType17, "image/tiff");
+	_LIT(KMimeType18, "application/javascript");
+	_LIT(KMimeType19, "video/3gpp");
+	_LIT(KMimeType20, "video/mpeg");
+	_LIT(KMimeType21, "video/quicktime");
+	_LIT(KMimeType22, "video/mpeg4-generic");
+								    
+  
+	INFO_PRINTF1(_L("Tests the MIME types found on closed content list"));
+    
+	TEST(iCcp->IsClosedType(KMimeType0));
+	INFO_PRINTF2(_L("%S is Closed Type"), &KMimeType0);
+    
+	TEST(iCcp->IsClosedType(KMimeType1));
+	INFO_PRINTF2(_L("%S is Closed Type"), &KMimeType1);		
+	
+	TEST(iCcp->IsClosedType(KMimeType2));
+	INFO_PRINTF2(_L("%S is Closed Type"), &KMimeType2);
+    
+	TEST(iCcp->IsClosedType(KMimeType3));
+	INFO_PRINTF2(_L("%S is Closed Type"), &KMimeType3);
+   
+	TEST(iCcp->IsClosedType(KMimeType4));
+  	INFO_PRINTF2(_L("%S is Closed Type"), &KMimeType4);
+   
+	TEST(iCcp->IsClosedType(KMimeType5));
+  	INFO_PRINTF2(_L("%S is Closed Type"), &KMimeType5);
+    
+	TEST(iCcp->IsClosedType(KMimeType6));
+    INFO_PRINTF2(_L("%S is Closed Type"), &KMimeType6);
+    
+	TEST(iCcp->IsClosedType(KMimeType7));
+   	INFO_PRINTF2(_L("%S is Closed Type"), &KMimeType7);
+    
+	TEST(iCcp->IsClosedType(KMimeType8));
+   	INFO_PRINTF2(_L("%S is Closed Type"), &KMimeType8);
+
+	TEST(iCcp->IsClosedType(KMimeType9));
+  	INFO_PRINTF2(_L("%S is Closed Type"), &KMimeType9);
+
+	TEST(iCcp->IsClosedType(KMimeType10));
+  	INFO_PRINTF2(_L("%S is Closed Type"), &KMimeType10);
+  	
+	TEST(iCcp->IsClosedType(KMimeType11));
+  	INFO_PRINTF2(_L("%S is Closed Type"), &KMimeType11);
+  	
+	TEST(iCcp->IsClosedType(KMimeType12));
+  	INFO_PRINTF2(_L("%S is Closed Type"), &KMimeType12);
+
+	TEST(iCcp->IsClosedType(KMimeType13));
+  	INFO_PRINTF2(_L("%S is Closed Type"), &KMimeType13);
+
+	TEST(iCcp->IsClosedType(KMimeType14));
+  	INFO_PRINTF2(_L("%S is Closed Type"), &KMimeType14);
+
+	TEST(iCcp->IsClosedType(KMimeType15));
+  	INFO_PRINTF2(_L("%S is Closed Type"), &KMimeType15);
+
+	TEST(iCcp->IsClosedType(KMimeType16));
+  	INFO_PRINTF2(_L("%S is Closed Type"), &KMimeType16);
+  	
+  	TEST(!iCcp->IsClosedType(KMimeType17));
+  	INFO_PRINTF2(_L("%S is not Closed Type"), &KMimeType17);
+  	
+  	TEST(!iCcp->IsClosedType(KMimeType18));
+  	INFO_PRINTF2(_L("%S is not Closed Type"), &KMimeType18);
+  	
+  	TEST(!iCcp->IsClosedType(KMimeType19));
+  	INFO_PRINTF2(_L("%S is not Closed Type"), &KMimeType19);
+  	
+  	TEST(!iCcp->IsClosedType(KMimeType20));
+  	INFO_PRINTF2(_L("%S is not Closed Type"), &KMimeType20);
+  	
+  	TEST(!iCcp->IsClosedType(KMimeType21));
+  	INFO_PRINTF2(_L("%S is not Closed Type"), &KMimeType21);
+  	
+  	TEST(!iCcp->IsClosedType(KMimeType22));
+  	INFO_PRINTF2(_L("%S is not Closed Type"), &KMimeType22);
+  	}
+
+/**
+   @SYMTestCaseID APPFWK-APPARC-0078
+
+   @SYMREQ REQ7736
+ 
+   @SYMTestCaseDesc Tests IsClosedExtension() method for various File Extensions
+  
+   @SYMTestPriority High 
+ 
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions Closed file extensions are the file extensions which are listed in the ApfMimeContentPolicy.rss file.
+   Calls CApfMimeContentPolicy::IsClosedExtension(const TDesC& aFileExtension); for different closed and non-closed File Extensions.
+  
+   @SYMTestExpectedResults The test checks whether IsClosedExtension returns ETrue for the Closed File Extensions and EFalse for non-closed File Extensions.
+ */
+void CT_MimeContentPolicyStep::CCPTestIsClosedExtension()
+	{
+	_LIT(KExtension0,  ".dm");
+	_LIT(KExtension1,  ".dr");
+	_LIT(KExtension2,  ".drc");
+	_LIT(KExtension3,  ".ott");
+	_LIT(KExtension4,  ".awb");
+	_LIT(KExtension5,  ".mid");
+	_LIT(KExtension6,  ".c3d");
+	_LIT(KExtension7,  ".jar");
+	_LIT(KExtension8,  ".ngd");
+	_LIT(KExtension9,  ".sis");
+	_LIT(KExtension10,  ".sisx");
+	_LIT(KExtension11, ".jpg");
+	_LIT(KExtension12, "jar.mp3");
+	_LIT(KExtension13, ".siss");
+	_LIT(KExtension14, ".sis7");
+	_LIT(KExtension15, ".0sis");
+	_LIT(KExtension16, ".gif");
+
+    INFO_PRINTF1(_L("Tests the extensions found on closed content list"));
+	
+	TEST(iCcp->IsClosedExtension(KExtension0));
+   	INFO_PRINTF2(_L("%S is Closed Extension"), &KExtension0);
+
+	TEST(iCcp->IsClosedExtension(KExtension1));
+   	INFO_PRINTF2(_L("%S is Closed Extension"), &KExtension1);
+	
+	TEST(iCcp->IsClosedExtension(KExtension2));
+	INFO_PRINTF2(_L("%S is Closed Extension"), &KExtension2);
+
+	TEST(iCcp->IsClosedExtension(KExtension3));
+	INFO_PRINTF2(_L("%S is Closed Extension"), &KExtension3);
+	
+	TEST(iCcp->IsClosedExtension(KExtension4));
+	INFO_PRINTF2(_L("%S is Closed Extension"), &KExtension4);
+	
+	TEST(iCcp->IsClosedExtension(KExtension5));
+	INFO_PRINTF2(_L("%S is Closed Extension"), &KExtension5);
+	
+	TEST(iCcp->IsClosedExtension(KExtension6));
+	INFO_PRINTF2(_L("%S is Closed Extension"), &KExtension6);					
+
+	TEST(iCcp->IsClosedExtension(KExtension7));
+	INFO_PRINTF2(_L("%S is Closed Extension"), &KExtension7);
+
+	TEST(iCcp->IsClosedExtension(KExtension8));
+	INFO_PRINTF2(_L("%S is Closed Extension"), &KExtension8);
+
+	TEST(iCcp->IsClosedExtension(KExtension9));
+	INFO_PRINTF2(_L("%S is Closed Extension"), &KExtension9);
+
+	TEST(iCcp->IsClosedExtension(KExtension10));
+	INFO_PRINTF2(_L("%S is Closed Extension"), &KExtension10);
+	
+	TEST(!iCcp->IsClosedExtension(KExtension11));
+	INFO_PRINTF2(_L("%S is not Closed Extension"), &KExtension11);
+	
+	TEST(!iCcp->IsClosedExtension(KExtension12));
+	INFO_PRINTF2(_L("%S is not Closed Extension"), &KExtension12);
+	
+	TEST(!iCcp->IsClosedExtension(KExtension13));
+	INFO_PRINTF2(_L("%S is not Closed Extension"), &KExtension13);
+	
+	TEST(!iCcp->IsClosedExtension(KExtension14));
+	INFO_PRINTF2(_L("%S is not Closed Extension"), &KExtension14);
+	
+	TEST(!iCcp->IsClosedExtension(KExtension15));
+	INFO_PRINTF2(_L("%S is not Closed Extension"), &KExtension15);
+	
+	TEST(!iCcp->IsClosedExtension(KExtension16));
+	INFO_PRINTF2(_L("%S is not Closed Extension"), &KExtension16);
+	}
+
+/**
+   @SYMTestCaseID APPFWK-APPARC-0079
+
+   @SYMREQ REQ7736
+ 
+   @SYMTestCaseDesc Tests IsDRMEnvelopeL() method for various files.
+  
+   @SYMTestPriority High 
+ 
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions Calls CApfMimeContentPolicy::IsDRMEnvelopeL(const TDesC& aFileName); for different not DRM Envelopes files.
+     
+   @SYMTestExpectedResults The test checks whether IsDRMEnvelopeL() returns EFalse for non-DRM protected Files.
+ */
+void CT_MimeContentPolicyStep::CCPTestIsDRMEnvelopeFileNameL()
+	{
+    INFO_PRINTF1(_L("Tests given files are DRM envelopes given the file name"));
+      	
+	TEST(!iCcp->IsDRMEnvelopeL(KPathjpg1));
+	TEST(!iCcp->IsDRMEnvelopeL(KPathjpg2));
+	TEST(!iCcp->IsDRMEnvelopeL(KPathdcf));
+	TEST(!iCcp->IsDRMEnvelopeL(KPathdm1));
+    TEST(!iCcp->IsDRMEnvelopeL(KPathgif));
+	TEST(!iCcp->IsDRMEnvelopeL(KPathdm2));
+	}
+
+/**
+   @SYMTestCaseID APPFWK-APPARC-0080
+
+   @SYMREQ REQ7736
+ 
+   @SYMTestCaseDesc Tests IsClosedFileL() method for various files.
+  
+   @SYMTestPriority High 
+ 
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions Closed files are files whose file extensions are listed in the ApfMimeContentPolicy.rss file.
+   Calls CApfMimeContentPolicy::IsClosedFileL(const TDesC& aFileName); for different Closed and non-closed files.
+   Calls CApfMimeContentPolicy::IsClosedFileL(const TDesC& aFileName); with file which is already open and checks whether \n
+   call succeeds.
+   Calls CApfMimeContentPolicy::IsClosedFileL(const TDesC& aFileName); with Null file handle\n
+     
+   @SYMTestExpectedResults The test checks whether 
+   1. IsClosedFileL() returns EFalse for Files which are not closed and ETrue for files which are closed.  
+   2. IsClosedFileL() call succeeds even if we pass a open file handle.
+   3. IsClosedFileL() leaves with KErrBadHandle if a null file handle is passed.
+ */
+void CT_MimeContentPolicyStep::CCPTestIsClosedFileFileNameL()
+	{
+	INFO_PRINTF1(_L("Tests given files are Closed Files using the FileName"));
+    	
+	TEST(!iCcp->IsClosedFileL(KPathjpg1));
+    
+    // File passed to IsClosedFileL is already open.
+    RFile fileHandle;
+	TEST((fileHandle.Open(iFs, KPathjpg2, EFileShareAny)) == KErrNone);
+	CleanupClosePushL(fileHandle);
+	TEST(!iCcp->IsClosedFileL(KPathjpg2));
+	CleanupStack::PopAndDestroy(&fileHandle);
+    
+	// Bad File Handle is passed to IsClosedFileL API
+    RFile nullFileHandle;
+    INFO_PRINTF1(_L("Tests IsClosedFileL method passing null file handle"));
+	TRAPD(err, iCcp->IsClosedFileL(nullFileHandle));
+	TEST(err == KErrBadHandle);
+
+	// Check file extension.	
+	TParse parser;
+	parser.Set(KPathdm2, NULL, NULL);
+	TEST(iCcp->IsClosedExtension(parser.Ext()));
+	INFO_PRINTF2(_L("%S is Closed File"), &KPathdm2);
+
+	CApfMimeContentPolicy* mimeContentPolicy = CApfMimeContentPolicy::NewL(iFs);
+	CleanupStack::PushL(mimeContentPolicy);
+  	TEST(!mimeContentPolicy->IsClosedFileL(KPathdcf));
+  	INFO_PRINTF2(_L("%S is not Closed File"), &KPathdcf);
+  	CleanupStack::PopAndDestroy(mimeContentPolicy);
+
+	mimeContentPolicy = CApfMimeContentPolicy::NewLC(iFs);
+	TEST(!mimeContentPolicy->IsClosedFileL(KPathgif));
+	INFO_PRINTF2(_L("%S is not Closed File"), &KPathgif);
+	CleanupStack::PopAndDestroy(mimeContentPolicy);
+	}
+
+TBool CT_MimeContentPolicyStep::DoCCPTestUsingFileHandleL(const TDesC &aName, TBool aIsDRMEnvelope)
+	{
+	TBool ret = EFalse;
+    RFile fileHandle;
+
+	TInt err;
+	err = fileHandle.Open(iFs, aName, EFileShareReadersOrWriters);
+    TEST(err == KErrNone);
+	CleanupClosePushL(fileHandle);
+
+	if (aIsDRMEnvelope)
+		ret = iCcp->IsDRMEnvelopeL(fileHandle);
+	else
+		ret = iCcp->IsClosedFileL(fileHandle);
+
+    CleanupStack::PopAndDestroy(&fileHandle);
+	return ret;
+	}
+
+/**
+   @SYMTestCaseID APPFWK-APPARC-0081
+
+   @SYMREQ REQ7736
+ 
+   @SYMTestCaseDesc Tests IsDRMEnvelopeL() method for various files.
+  
+   @SYMTestPriority High 
+ 
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions Calls CApfMimeContentPolicy::IsDRMEnvelopeL(RFile& aFileHandle); for different non-DRM Envelopes files.
+     
+   @SYMTestExpectedResults The test checks whether IsDRMEnvelopeL() returns EFalse for Files which are not DRM protected.
+ */
+void CT_MimeContentPolicyStep::CCPTestIsDRMEnvelopeFileHandleL()
+	{
+    INFO_PRINTF1(_L("Tests given files are DRM envelopes given the file handle"));     
+
+	TEST(!DoCCPTestUsingFileHandleL(KPathjpg1, ETrue));
+	TEST(!DoCCPTestUsingFileHandleL(KPathjpg2, ETrue));
+	TEST(!DoCCPTestUsingFileHandleL(KPathdcf, ETrue));
+	TEST(!DoCCPTestUsingFileHandleL(KPathdm1, ETrue));
+	TEST(!DoCCPTestUsingFileHandleL(KPathgif, ETrue));
+	TEST(!DoCCPTestUsingFileHandleL(KPathdm2, ETrue));
+	}
+
+/**
+   @SYMTestCaseID APPFWK-APPARC-0082
+
+   @SYMREQ REQ7736
+ 
+   @SYMTestCaseDesc Tests IsClosedFileL() method for various files.
+  
+   @SYMTestPriority High 
+ 
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions Closed files are files whose file extensions are listed in the ApfMimeContentPolicy.rss file.
+   Calls CApfMimeContentPolicy::IsClosedFileL(RFile& aFileHandle); for different Closed and non-closed files.
+     
+   @SYMTestExpectedResults The test checks whether IsClosedFileL() returns EFalse for Files which are not closed and\n
+   ETrue for files which are closed.
+ */
+void CT_MimeContentPolicyStep::CCPTestIsClosedFileFileHandleL()
+	{
+   	INFO_PRINTF1(_L("Tests given files are Closed Files using File Handle"));
+
+	TEST(!DoCCPTestUsingFileHandleL(KPathjpg1, EFalse));
+	TEST(!DoCCPTestUsingFileHandleL(KPathjpg2, EFalse));
+	TEST(!DoCCPTestUsingFileHandleL(KPathdcf, EFalse));
+	TEST(DoCCPTestUsingFileHandleL(KPathdm1, EFalse));
+	TEST(!DoCCPTestUsingFileHandleL(KPathgif, EFalse));
+	TEST(DoCCPTestUsingFileHandleL(KPathdm2, EFalse));
+	}
+	
+/**
+   @SYMTestCaseID APPFWK-APPARC-0084
+
+   @SYMREQ REQ7736
+ 
+   @SYMTestCaseDesc OOM test for CApfMimeContentPolicy's NewL() and IsClosedFileL() methods.
+  
+   @SYMTestPriority High 
+ 
+   @SYMTestStatus Implemented
+  
+   @SYMTestActions Calls CApfMimeContentPolicy's NewL() and IsClosedFileL() methods under OOM conditions.
+     
+   @SYMTestExpectedResults Tests should complete without any memory leaks.
+ */
+void CT_MimeContentPolicyStep::CCPOOMTestL()
+	{
+	INFO_PRINTF1(_L("OOM test for CApfMimeContentPolicy"));
+	CApfMimeContentPolicy* mimeContentPolicy = NULL;
+	
+	TInt fail = 0;
+	for (fail = 1; ; fail++)
+		{
+		__UHEAP_SETFAIL(RHeap::EDeterministic, fail);
+		__UHEAP_MARK;
+		TRAPD(err, mimeContentPolicy = CApfMimeContentPolicy::NewLC(); CleanupStack::Pop(mimeContentPolicy));
+		TEST(err == KErrNone || err == KErrNoMemory);
+		if (err == KErrNone)
+			{
+			delete mimeContentPolicy;
+			__UHEAP_MARKEND;
+			break;
+			}
+		__UHEAP_MARKEND;
+		}
+	
+	__UHEAP_RESET;	
+	TRAPD(err, mimeContentPolicy = CApfMimeContentPolicy::NewL());
+	CleanupStack::PushL(mimeContentPolicy);
+	TEST(err == KErrNone);
+	
+	TInt ret = KErrNone;
+	for (fail = 1; ; fail++)
+		{
+		__UHEAP_SETFAIL(RHeap::EDeterministic, fail);
+		__UHEAP_MARK;
+		TRAP(err, ret = mimeContentPolicy->IsClosedFileL(KPathdm1));
+		TEST(err == KErrNone || err == KErrNoMemory);
+		if (err == KErrNone)
+			{
+			INFO_PRINTF1(_L("OOM Test for IsClosedFileL Method"));	
+			TEST(ret);
+			INFO_PRINTF2(_L("%S is Closed File"), &KPathdm1);
+			CleanupStack::PopAndDestroy(mimeContentPolicy);
+			__UHEAP_MARKEND;
+			break;
+			}
+		__UHEAP_MARKEND;
+		}
+
+	__UHEAP_RESET;	
+	INFO_PRINTF1(_L("OOM test Completed"));	
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/t_mimecontentpolicystep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,58 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code  
+*/
+
+#if (!defined __T_MIMECONTENTPOLICY_STEP_H__)
+#define __T_MIMECONTENTPOLICY_STEP_H__
+
+#include "testableapalssession.h"
+#include "appfwk_test_AppUi.h"
+#include <ApfMimeContentPolicy.h>
+
+_LIT(KT_MimeContentPolicyStep,"t_mimecontentpolicy");
+
+class CT_MimeContentPolicyStep : public CTestStep
+	{
+public:
+	CT_MimeContentPolicyStep();
+	~CT_MimeContentPolicyStep();
+	virtual TVerdict doTestStepL();
+	
+private:
+	void RunTestCasesL();
+    void CCPTestIsClosedType();
+    void CCPTestIsClosedExtension();
+    void CCPTestIsDRMEnvelopeFileNameL();
+    void CCPTestIsClosedFileFileNameL();
+    void CCPTestIsDRMEnvelopeFileHandleL();
+    void CCPTestIsClosedFileFileHandleL();
+    // aIsDRMEnvelope is ETrue for DRM Envelope and EFalse for ClosedFile
+    TBool DoCCPTestUsingFileHandleL(const TDesC &aName, TBool aIsDRMEnvelope);
+    void CCPOOMTestL();
+
+private:
+	CApfMimeContentPolicy* iCcp;
+	RTestableApaLsSession iApaLsSession;
+	RFs iFs;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/t_rapalssessionstep.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,31 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file r_rapalssessionstep.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+
+#include "uikon.rh"
+
+NAME TEST
+RESOURCE VIEW_ID view1
+	{
+	appuid=1234;
+	viewuid=5678;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/t_servicebasestep.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,502 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code  
+*/
+
+#include "t_servicebasestep.h"
+#include <apaserverapp.h>
+#include <w32std.h>
+#include <appfwk_test.h>
+#include "testableapalssession.h"
+#include "../tef/TNonNative/TNNApp1.h"
+
+TInt PanicTest(TAny* aOption);
+
+// RTstServiceApp
+
+TInt RTstServiceApp::DoTestTransferSessionL(TUid aServiceUid, TBool aPassingFileByHandle, const TDesC& aFileNameWithoutDriveOrPath)
+	{ // static
+	//create the first session object
+	RTstServiceApp appServiceFirst(aServiceUid);
+	CleanupClosePushL(appServiceFirst);
+	//connecting first session object
+	appServiceFirst.ConnectL();
+	
+	//create the second session object
+	RTstServiceApp appServiceSecond(aServiceUid);
+	//transfer session for first session object to the second session object
+	appServiceSecond.TransferExistingSessionL(appServiceFirst);
+	CleanupClosePushL(appServiceSecond);
+	
+	TRequestStatus requestStatus;
+	//request for a service from the second session object
+	appServiceSecond.ReceiveTestResult(requestStatus, aPassingFileByHandle, aFileNameWithoutDriveOrPath);
+	User::WaitForRequest(requestStatus);
+	const TInt result=User::LeaveIfError(requestStatus.Int());
+
+	CleanupStack::PopAndDestroy(&appServiceSecond);
+	CleanupStack::PopAndDestroy(&appServiceFirst);
+	User::After(5 * 1000000); //Wait 5sec for Apparc update due to paging
+	
+	return result;
+	}
+	
+TInt RTstServiceApp::DoTestTransferSessionAndBackL(TUid aServiceUid, TBool aPassingFileByHandle, const TDesC& aFileNameWithoutDriveOrPath)
+	{ // static
+	//create the first session object
+	RTstServiceApp appServiceFirst(aServiceUid);
+	CleanupClosePushL(appServiceFirst);
+	//connecting first session object
+	appServiceFirst.ConnectL();
+	
+	//create the second session object
+	RTstServiceApp appServiceSecond(aServiceUid);
+	//transfer session from first session object to the second session object
+	appServiceSecond.TransferExistingSessionL(appServiceFirst);
+	CleanupClosePushL(appServiceSecond);
+	
+	//transfer session back to  first session object from the second session object
+	appServiceFirst.TransferExistingSessionL(appServiceSecond);
+	TRequestStatus requestStatus;
+	//request for a service from the first session object
+	appServiceFirst.ReceiveTestResult(requestStatus, aPassingFileByHandle, aFileNameWithoutDriveOrPath);
+	User::WaitForRequest(requestStatus);
+	const TInt result=User::LeaveIfError(requestStatus.Int());
+
+	CleanupStack::PopAndDestroy(&appServiceSecond);
+	CleanupStack::PopAndDestroy(&appServiceFirst);
+	User::After(5 * 1000000); //Wait 5sec for Apparc update due to paging
+	
+	return result;
+	}
+	
+TInt RTstServiceApp::DoTestTransferWithUnconnectedSessionL(TUid aServiceUid, TBool aPassingFileByHandle, const TDesC& aFileNameWithoutDriveOrPath)
+	{ // static
+	//create the first session object
+	RTstServiceApp appServiceFirst(aServiceUid);
+	CleanupClosePushL(appServiceFirst);
+		
+	//create the second session object
+	RTstServiceApp appServiceSecond(aServiceUid);
+	//transfer session for first session object to the second session object
+	appServiceSecond.TransferExistingSessionL(appServiceFirst);
+	CleanupClosePushL(appServiceSecond);
+	
+	TRequestStatus requestStatus;
+	//request for a service from the second session object
+	appServiceSecond.ReceiveTestResult(requestStatus, aPassingFileByHandle, aFileNameWithoutDriveOrPath);
+	User::WaitForRequest(requestStatus);
+	const TInt result=User::LeaveIfError(requestStatus.Int());
+
+	CleanupStack::PopAndDestroy(&appServiceSecond);
+	CleanupStack::PopAndDestroy(&appServiceFirst);
+	User::After(5 * 1000000); //Wait 5sec for Apparc update due to paging
+	
+	return result;
+	}
+	
+RTstServiceApp::RTstServiceApp(TUid aServiceUid)
+	:iServiceUid(aServiceUid)
+	{
+	}
+
+void RTstServiceApp::ConnectL()
+	{
+	ConnectExistingByNameL(KLitServerName);
+	}
+
+void RTstServiceApp::ReceiveTestResult(TRequestStatus& aRequestStatus, TBool aPassingFileByHandle, const TDesC& aFileNameWithoutDriveOrPath)
+	{
+	SendReceive(EOpcode_receiveTestResult, TIpcArgs(aPassingFileByHandle, &aFileNameWithoutDriveOrPath), aRequestStatus);
+	}
+
+TUid RTstServiceApp::ServiceUid() const
+	{
+	return iServiceUid;
+	}
+
+//CT_ServiceBaseStep
+	
+void CT_ServiceBaseStep::ClosePanicWindowL()
+	{
+	RWsSession	ws;
+	User::LeaveIfError(ws.Connect());
+
+	TInt wgFocus = ws.GetFocusWindowGroup();
+
+	const TUint32 KClientHandle = 0xFFFFFFFF;	// Events delivered to this handle are thrown away
+	RWindowGroup wg = RWindowGroup(ws);
+
+	wg.Construct(KClientHandle);
+	TInt wgId = wg.Identifier();
+
+	TWsEvent event;
+	event.SetType(EEventKey);
+	TKeyEvent *keyEvent = event.Key();
+	keyEvent->iCode = EKeyEscape;
+	keyEvent->iScanCode = EStdKeyEscape;
+	keyEvent->iModifiers = 0;
+
+	TInt limit = 0;
+	for(limit = 0; wgFocus != wgId && (limit < 50); limit++)
+		{
+		ws.SendEventToAllWindowGroups(event);
+		wgFocus = ws.GetFocusWindowGroup();
+		RDebug::Print(_L("ClosePanicWindowL() - EKeyEscape sent to Windows Group"));
+		}
+
+	// close everything
+	wg.Close();
+	ws.Close();
+	}
+	
+void PanicFirstInstanceAfterTransferL()
+	{
+	TPtrC fullFileName = _L("z:\\private\\101F289C\\GIF.NNA1");
+	TPtrC fileNameWithoutDriveOrPath(TParsePtrC(fullFileName).NameAndExt());
+	const TUid serviceUid = {0x10207f97};
+	
+	RTestableApaLsSession apparcServer;
+	CleanupClosePushL(apparcServer);
+	User::LeaveIfError(apparcServer.Connect());
+
+	RFs fileServer;
+	CleanupClosePushL(fileServer);
+	User::LeaveIfError(fileServer.Connect());
+	User::LeaveIfError(fileServer.ShareProtected());
+
+	apparcServer.FlushRecognitionCache();
+	
+	RFile file;
+	CleanupClosePushL(file);
+	User::LeaveIfError(file.Open(fileServer, fullFileName, EFileShareReadersOnly|EFileStream|EFileRead));
+		
+	TThreadId threadId2;
+	TRequestStatus requestStatusForRendezvous2;
+	User::LeaveIfError(apparcServer.StartDocument(file, threadId2, &requestStatusForRendezvous2));
+	User::WaitForRequest(requestStatusForRendezvous2);
+	
+	//create the first session object
+	RTstServiceApp appServiceFirst(serviceUid);
+	CleanupClosePushL(appServiceFirst);
+	appServiceFirst.ConnectL();
+	
+	//create the second session object
+	RTstServiceApp appServiceSecond(serviceUid);
+	//transfer session from first session object to the second session object
+	appServiceSecond.TransferExistingSessionL(appServiceFirst);
+	CleanupClosePushL(appServiceSecond);
+	TRequestStatus requestStatus;
+	//request for a service from the first session object
+	appServiceFirst.ReceiveTestResult(requestStatus, ETrue, fileNameWithoutDriveOrPath);
+	//code should have panicked by now
+	User::WaitForRequest(requestStatus);
+	const TInt result=User::LeaveIfError(requestStatus.Int());
+	
+	CleanupStack::PopAndDestroy(&appServiceSecond);
+	CleanupStack::PopAndDestroy(&appServiceFirst);
+	}
+		
+void PanicSecondInstanceAfterTransferBackL()
+	{
+	TPtrC fullFileName = _L("z:\\private\\101F289C\\GIF.NNA1");
+	TPtrC fileNameWithoutDriveOrPath(TParsePtrC(fullFileName).NameAndExt());
+	const TUid serviceUid = {0x10207f97};
+	
+	RTstServiceApp appServiceFirst(serviceUid);
+	CleanupClosePushL(appServiceFirst);
+	appServiceFirst.ConnectL();
+	
+	RTstServiceApp appServiceSecond(serviceUid);
+	//transfer session from first session object to the second session object
+	appServiceSecond.TransferExistingSessionL(appServiceFirst);
+	CleanupClosePushL(appServiceSecond);
+	
+	//Transfer ownership back to first instance
+	appServiceFirst.TransferExistingSessionL(appServiceSecond);
+	
+	TRequestStatus requestStatus;
+	//request for a service from the first session object
+	appServiceSecond.ReceiveTestResult(requestStatus, ETrue, fileNameWithoutDriveOrPath);
+	//code should have panicked by now
+	User::WaitForRequest(requestStatus);
+	const TInt result=User::LeaveIfError(requestStatus.Int());
+	
+	CleanupStack::PopAndDestroy(&appServiceSecond);
+	CleanupStack::PopAndDestroy(&appServiceFirst);
+	}
+	
+TInt PanicTest(TAny* aOption)
+	{
+	CTrapCleanup* trapCleanup = CTrapCleanup::New();
+	if (!trapCleanup)
+		{
+		return KErrNoMemory;
+		}
+	TInt option = (TInt)aOption;
+	TInt err = KErrNone;	
+	if (option == 1)
+		{
+		TRAP(err, PanicFirstInstanceAfterTransferL());
+		}
+	else
+		{
+		TRAP(err, PanicSecondInstanceAfterTransferBackL());
+		}
+		
+	delete trapCleanup;
+	return err;
+	}	
+	
+void CT_ServiceBaseStep::OpenFileLC(RFile& aFile, RFs& aFileServer, const TDesC& aFullFileName)
+	{
+	CleanupClosePushL(aFile);
+	User::LeaveIfError(aFile.Open(aFileServer, aFullFileName, EFileShareReadersOnly|EFileStream|EFileRead));
+	}
+	
+/**
+   @SYMTestCaseID APPFWK-APPARC-0092
+  
+   @SYMCR CR1555
+  
+   @SYMTestCaseDesc Transfer ownership of session from one instance of RApaAppServiceBase to another
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Start the server application.
+				   Create an instance of RApaAppServiceBase and connect to server.
+				   Create another instance of RApaAppServiceBase and take the ownership of the connected session.
+			       Request a service from the second instance.
+
+   @SYMTestExpectedResults Check if request has been serviced correctly.
+ */	
+void CT_ServiceBaseStep::TestServiceAppL(RApaLsSession& aApparcServer, RFs& aFileServer)
+	{
+	TPtrC fullFileName = _L("z:\\private\\101F289C\\GIF.NNA1");
+	TPtrC fileNameWithoutDriveOrPath(TParsePtrC(fullFileName).NameAndExt());
+	const TUid serviceUid = {0x10207f97};
+
+	//Transfer session from one RApaAppServiceBase instance to another and request for service from the latter
+	__UHEAP_MARK;
+	RFile file;
+	OpenFileLC(file, aFileServer, fullFileName);
+	TThreadId threadId;
+	TRequestStatus requestStatusForRendezvous;
+	User::LeaveIfError(aApparcServer.StartDocument(file, threadId, &requestStatusForRendezvous));
+	User::WaitForRequest(requestStatusForRendezvous);
+	INFO_PRINTF1(_L("App started....\n"));
+	TEST(RTstServiceApp::DoTestTransferSessionL(serviceUid, ETrue, fileNameWithoutDriveOrPath) == KCheckPass);
+  	INFO_PRINTF1(_L("Requested service completed successfully....\n"));					
+	CleanupStack::PopAndDestroy(&file);
+	__UHEAP_MARKEND;
+	}
+
+/**
+   @SYMTestCaseID APPFWK-APPARC-0093 APPFWK-APPARC-0095
+  
+   @SYMCR CR1555
+  
+   @SYMTestCaseDesc Testing if requesting service with the wrong instance will panic
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions Start the server application.
+				   Create two instances of RApaAppServiceBase and connect to server.
+				   Request service with the wrong instance(which does not have the session).
+   
+   @SYMTestExpectedResults Requesting service with the wrong instance should raise a KERN-EXEC 0 panic.
+ */	
+void CT_ServiceBaseStep::TestPanicWithWrongInstanceL()
+	{
+	RThread thread;
+	TRequestStatus stat;
+	TBuf<32> threadNameBuf;
+	// Give each thread a unique name to avoid KErrAlreadyExists error on thread creation
+	_LIT(KThreadNameFormat, "CT_ServiceBaseStep%d");
+	threadNameBuf.Format(KThreadNameFormat, 1);
+	
+	//Transfer session from one RApaAppServiceBase instance to another and request for service from the first, this should panic with KERN-EXEC 0
+	TInt threadCreationVal = thread.Create(threadNameBuf,PanicTest,KDefaultStackSize,0x2000,0x20000,(TAny*)1);
+	TEST(threadCreationVal==KErrNone);	
+
+	TRequestStatus status;
+	thread.Logon(status);
+	TBool jit =	User::JustInTime();
+	User::SetJustInTime(EFalse);
+	thread.Resume();
+	User::WaitForRequest(status);
+
+	// we are always expecting the same panic category
+	TExitCategoryName category = thread.ExitCategory();
+	TEST(category.Compare(_L("KERN-EXEC")) == 0);
+	INFO_PRINTF2(_L("Expected exit category:KERN-EXEC, Actual exit category:  '%S'..."), &category);
+
+	TInt exitReason = thread.ExitReason();
+	TEST(exitReason == 0);
+	INFO_PRINTF2(_L("Expected exit reason: 0, Actual exit reason:, %d \n"), exitReason);
+	
+	thread.Close();
+	
+	threadNameBuf.Format(KThreadNameFormat, 2);
+	//Transfer session from one RApaAppServiceBase instance to another and back, request for service from the second instance, this should panic with KERN-EXEC 0
+	threadCreationVal = thread.Create(threadNameBuf,PanicTest,KDefaultStackSize,0x2000,0x20000,(TAny*)2);
+	TEST(threadCreationVal==KErrNone);	
+
+	thread.Logon(status);
+	User::SetJustInTime(EFalse);
+	thread.Resume();
+	User::WaitForRequest(status);
+
+	// we are always expecting the same panic category
+	category = thread.ExitCategory();
+	TEST(category.Compare(_L("KERN-EXEC")) == 0);
+	INFO_PRINTF2(_L("Expected exit category:KERN-EXEC, Actual exit category:  '%S'..."), &category);
+	
+	exitReason = thread.ExitReason();
+	TEST(exitReason == 0);
+	INFO_PRINTF2(_L("Expected exit reason: 0, Actual exit reason:, %d \n"), exitReason);
+	
+	thread.Close();
+	User::SetJustInTime(jit);
+	ClosePanicWindowL();
+	}
+	
+/**
+   @SYMTestCaseID APPFWK-APPARC-0094
+  
+   @SYMCR CR1555
+  
+   @SYMTestCaseDesc Transfer ownership of session from one instance of RApaAppServiceBase to another and transfer back to first instance
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions	Start the server application.
+				    Create an instance of RApaAppServiceBase and connect to server.
+				    Create another instance of RApaAppServiceBase and take the ownership of the connected session.
+				    Transfer back the ownership to the first instance.
+			        Request a service from the first instance.
+			        
+   @SYMTestExpectedResults Check if request has been serviced correctly.
+ */	
+void CT_ServiceBaseStep::TestTransferBackL(RApaLsSession& aApparcServer, RFs& aFileServer)
+	{
+	TPtrC fullFileName = _L("z:\\private\\101F289C\\GIF.NNA1");
+	TPtrC fileNameWithoutDriveOrPath(TParsePtrC(fullFileName).NameAndExt());
+	const TUid serviceUid = {0x10207f97};
+	
+	__UHEAP_MARK;
+	RFile file;
+	OpenFileLC(file, aFileServer, fullFileName);
+	TThreadId threadId;
+	TRequestStatus requestStatusForRendezvous;
+	User::LeaveIfError(aApparcServer.StartDocument(file, threadId, &requestStatusForRendezvous));
+	User::WaitForRequest(requestStatusForRendezvous);
+	INFO_PRINTF1(_L("App started....\n"));	
+	TEST(RTstServiceApp::DoTestTransferSessionAndBackL(serviceUid, ETrue, fileNameWithoutDriveOrPath) == KCheckPass);
+  	INFO_PRINTF1(_L("Requested service completed successfully....\n"));						
+	CleanupStack::PopAndDestroy(&file);
+	__UHEAP_MARKEND;
+	}
+
+/**
+   @SYMTestCaseID APPFWK-APPARC-0097
+  
+   @SYMCR CR1555
+  
+   @SYMTestCaseDesc Transfer ownership of session from one instance of RApaAppServiceBase which is not connected to another
+  
+   @SYMTestPriority High
+  
+   @SYMTestStatus Implemented
+   
+   @SYMTestActions	Start the server application.
+				    Create an instance of RApaAppServiceBase.
+				    Create another instance of RApaAppServiceBase and take the ownership of unconnected session.
+				    			        
+   @SYMTestExpectedResults Check if function leaves with KErrArgument.
+ */	
+void CT_ServiceBaseStep::TestTransferWithUnconnectedSessionL()
+	{
+	TPtrC fullFileName = _L("z:\\private\\101F289C\\GIF.NNA1");
+	TPtrC fileNameWithoutDriveOrPath(TParsePtrC(fullFileName).NameAndExt());
+	const TUid serviceUid = {0x10207f97};
+	
+	__UHEAP_MARK;
+	TInt err;
+	TRAP(err, RTstServiceApp::DoTestTransferWithUnconnectedSessionL(serviceUid, ETrue, fileNameWithoutDriveOrPath));
+	TEST(err == KErrArgument);
+  	INFO_PRINTF2(_L("Expected error code: -6, Actual error code:, %d \n"), err);						
+	__UHEAP_MARKEND;	
+	}
+	
+// CTestStep derived functions
+	
+CT_ServiceBaseStep::~CT_ServiceBaseStep()
+	{
+	}
+
+CT_ServiceBaseStep::CT_ServiceBaseStep()
+	{
+	SetTestStepName(KT_ServiceBaseStep);
+	}
+
+TVerdict CT_ServiceBaseStep::doTestStepPreambleL()
+	{
+	SetTestStepResult(EPass);
+	return TestStepResult();
+	}
+
+TVerdict CT_ServiceBaseStep::doTestStepPostambleL()
+	{
+	return TestStepResult();
+	}
+
+TVerdict CT_ServiceBaseStep::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Test ServiceBase starting....\n"));
+
+	RTestableApaLsSession apparcServer;
+	CleanupClosePushL(apparcServer);
+	User::LeaveIfError(apparcServer.Connect());
+
+	RFs fileServer;
+	CleanupClosePushL(fileServer);
+	User::LeaveIfError(fileServer.Connect());
+	User::LeaveIfError(fileServer.ShareProtected());
+
+	apparcServer.FlushRecognitionCache();
+
+	HEAP_TEST_LS_SESSION(apparcServer, 0, DONT_CHECK, TestServiceAppL(apparcServer, fileServer), apparcServer.FlushRecognitionCache());
+	HEAP_TEST_LS_SESSION(apparcServer, 0, 0, TestPanicWithWrongInstanceL(), apparcServer.FlushRecognitionCache());
+	HEAP_TEST_LS_SESSION(apparcServer, 0, DONT_CHECK, TestTransferBackL(apparcServer, fileServer), apparcServer.FlushRecognitionCache());
+	HEAP_TEST_LS_SESSION(apparcServer, 0, 0, TestTransferWithUnconnectedSessionL(), apparcServer.FlushRecognitionCache());
+	
+	CleanupStack::PopAndDestroy(2, &apparcServer);
+
+	INFO_PRINTF1(_L("....Test ServiceBase completed!"));
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/t_servicebasestep.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,74 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code  
+*/
+
+#if (!defined __T_SERVICEBASESTEP_H__)
+#define __T_SERVICEBASESTEP_H__
+
+#include <apaserverapp.h>
+#include <apgcli.h>
+#include "apparctestserver.h"
+
+
+// RTstServiceApp
+
+class RTstServiceApp : public RApaAppServiceBase
+	{
+public:
+	static TInt DoTestTransferSessionL(TUid aServiceUid, TBool aPassingFileByHandle, const TDesC& aFileNameWithoutDriveOrPath);
+	static TInt DoTestTransferSessionAndBackL(TUid aServiceUid, TBool aPassingFileByHandle, const TDesC& aFileNameWithoutDriveOrPath);
+	static TInt DoTestTransferWithUnconnectedSessionL(TUid aServiceUid, TBool aPassingFileByHandle, const TDesC& aFileNameWithoutDriveOrPath);
+	RTstServiceApp(TUid aServiceUid);
+	void ConnectL();
+	void ReceiveTestResult(TRequestStatus& aRequestStatus, TBool aPassingFileByHandle, const TDesC& aFileNameWithoutDriveOrPath);
+	// from RApaAppServiceBase
+	virtual TUid ServiceUid() const;
+private:
+	const TUid iServiceUid;
+	};
+
+
+
+// CT_ServiceBaseStep test class. 
+
+class CT_ServiceBaseStep : public CTestStep
+	{
+public:
+	CT_ServiceBaseStep();
+	~CT_ServiceBaseStep();
+
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+
+private:
+	void TestServiceAppL(RApaLsSession& aApparcServer, RFs& aFileServer);
+	void TestPanicWithWrongInstanceL();
+	void OpenFileLC(RFile& aFile, RFs& aFileServer, const TDesC& aFullFileName);
+	void ClosePanicWindowL();
+	void TestTransferBackL(RApaLsSession& aApparcServer, RFs& aFileServer);
+	void TestTransferWithUnconnectedSessionL();
+	};
+
+_LIT(KT_ServiceBaseStep,"T_ServiceBase");
+	
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/t_winchainChild.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,143 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// The class definitions for the simple test application
+// which is launched by t_winchainLaunch.  The application
+// checks that the window group id matches the parent app
+// and returns a message based on the result.
+// The class definitions are:
+// CMyAppService
+// CMyEikAppServer
+// CChainChildApplication 
+// CChainChildAppUi
+// CChainChildDocument
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#ifndef __T_WINCHAINCHILD_H
+#define __T_WINCHAINCHILD_H
+
+#include <coeccntx.h>
+
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+#include <eikstart.h> ////TKAS added for exe-app
+
+#include <eikserverapp.h> // REikAppServiceBase
+#include <eikon.hrh>
+
+//  Test stuff
+#include "twindowchaining.h"
+
+class CPackagerAppUi;
+
+
+////////////////////////////////////////////////////////////////////////
+// CMyAppService
+////////////////////////////////////////////////////////////////////////
+class CMyAppService : public CApaAppServiceBase
+	{
+private:
+	void ServiceL(const RMessage2& aMessage);
+	TInt TestL(TInt aParentWindowGroupID);
+	};
+	
+
+////////////////////////////////////////////////////////////////////////
+// CMyEikAppServer
+////////////////////////////////////////////////////////////////////////	
+class CMyEikAppServer : public CEikAppServer
+	{
+private:
+	CApaAppServiceBase* CreateServiceL(TUid aServiceType) const;	
+	};
+
+	
+////////////////////////////////////////////////////////////////////////
+//
+// CChainChildApplication
+//
+////////////////////////////////////////////////////////////////////////
+class CChainChildApplication : public CEikApplication
+	{
+public:
+	void NewAppServerL(CApaAppServer*& aAppServer)
+		{
+		aAppServer=new(ELeave) CMyEikAppServer;
+		};
+	
+	TFileName BitmapStoreName() const;
+	TFileName ResourceFileName() const;
+	
+private: 
+	// Inherited from class CApaApplication
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+	};
+
+////////////////////////////////////////////////////////////////////////
+//
+// CChainChildAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CChainChildAppUi : public CEikAppUi
+    {
+public:
+	CChainChildAppUi() :
+	   CEikAppUi()  
+		{
+		}
+    void ConstructL();
+	~CChainChildAppUi();
+	virtual void RunTestStepL(TInt aNextStep); 
+	
+private:
+    // Inherited from class CEikAppUi
+	void HandleCommandL(TInt aCommand);
+
+	
+private:
+	
+	CCoeControl* iAppView;
+
+	};
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CChainChildDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CChainChildDocument : public CEikDocument
+	{
+public:
+	static CChainChildDocument* NewL(CEikApplication& aApp);
+	CChainChildDocument(CEikApplication& aApp);
+	void ConstructL();
+private: 
+	// Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+
+#endif // T_WINCHAINCHILD
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/t_winchainChild.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// using relative paths for sourcepath and user includes
+// 
+//
+
+#include <platform_paths.hrh>
+
+epocstacksize 		0x5000
+
+TARGETPATH		/sys/bin
+
+TARGET			t_winchainChild.exe
+TARGETTYPE		exe
+
+UID           		0x100039CE 0X10009e9f
+
+VENDORID 		0x70000001
+
+SOURCEPATH    		.
+
+SOURCE        		t_winchainChild_Application.cpp
+
+USERINCLUDE   		.
+
+SYSTEMINCLUDE 		/epoc32/include
+SYSTEMINCLUDE 		/epoc32/include/techview
+SYSTEMINCLUDE		/epoc32/include/test
+SYSTEMINCLUDE   	../tef
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY       		euser.lib apparc.lib cone.lib eikcore.lib ws32.lib APPFWK_TEST_APPUI.LIB
+
+START RESOURCE		t_winchainChild_reg.rss
+TARGETPATH		/private/10003a3f/apps
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/t_winchainChild_Application.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,207 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Source file for the implementation of the 
+// application class - CChainChildApplication
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include "t_winChainChild.h"
+
+
+/**   The function is called by the UI framework to ask for the
+      application's UID. The returned value is defined by the
+      constant KUidTChainChildApp and must match the second value
+      defined in the project definition file.
+*/ 
+TUid CChainChildApplication::AppDllUid() const
+	{
+	return KUidTChainChildApp;
+	}
+
+/**  This function is called by the UI framework at
+     application start-up. It creates an instance of the
+     document class.
+*/
+CApaDocument* CChainChildApplication::CreateDocumentL()
+	{
+	return new (ELeave) CChainChildDocument(*this);
+	}
+	
+	LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CChainChildApplication;
+	}
+
+TFileName CChainChildApplication::BitmapStoreName() const
+	{
+	return KNullDesC();
+	}
+
+TFileName CChainChildApplication::ResourceFileName() const
+	{
+	return KNullDesC();
+	}
+
+
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication( NewApplication );
+	}
+
+
+
+/**       The constructor of the document class just passes the
+          supplied reference to the constructor initialisation list.
+          The document has no real work to do in this application.
+*/
+CChainChildDocument::CChainChildDocument(CEikApplication& aApp)
+		: CEikDocument(aApp)
+	{
+	}
+
+
+/**     This is called by the UI framework as soon as the 
+        document has been created. It creates an instance
+        of the ApplicationUI. The Application UI class is
+        an instance of a CEikAppUi derived class.
+*/
+CEikAppUi* CChainChildDocument::CreateAppUiL()
+	{
+    return new(ELeave) CChainChildAppUi;
+	}
+
+#include <eikserverapp.h>
+/**  The second phase constructor of the application UI class.
+     The application UI creates and owns the one and only view.
+*/ 
+void CChainChildAppUi::ConstructL()
+    {
+    //CEikAppUi::ConstructL();	
+    CEikAppUi::BaseConstructL(ENoAppResourceFile|ENoScreenFurniture);
+	}
+
+// Check if parent ID is the KExoticOrdinalPriority	
+TInt CMyAppService::TestL(TInt aParentWindowGroupID)
+	{
+	CCoeEnv* coeEnv = CCoeEnv::Static();
+		
+	
+	TInt wgCount=coeEnv->WsSession().NumWindowGroups(KExoticOrdinalPriority);
+		
+	RDebug::Print(_L("Child - TestL: wgCount = %d"), wgCount);
+	
+    RArray<RWsSession::TWindowGroupChainInfo>* wgIds=new(ELeave) RArray<RWsSession::TWindowGroupChainInfo>(wgCount);
+    CleanupStack::PushL(wgIds);
+    User::LeaveIfError(coeEnv->WsSession().WindowGroupList(KExoticOrdinalPriority,wgIds));
+        
+    TBool testPassed=EFalse;
+
+    // The root identifier of this window
+    TInt rootIdentifier = coeEnv->RootWin().Identifier();
+    
+    RDebug::Print(_L("Child - TestL: rootIdentifier = %d"), rootIdentifier);
+    
+    RDebug::Print(_L("Child - TestL: Entering loop.."));
+    // Go through all window group IDs looking for the current one
+    for (TInt i=0;i<wgCount;i++)
+        {
+        RWsSession::TWindowGroupChainInfo wgId=(*wgIds)[i];
+        
+        RDebug::Print(_L("Child - TestL: wgId[%d].iId = %d"), i, wgId.iId);
+        RDebug::Print(_L("Child - TestL: wgId[%d].iParentId = %d"), i, wgId.iParentId);
+        
+        // If this is the current window group ID
+        if (wgId.iId == rootIdentifier)
+        	{
+        	RDebug::Print(_L("Child - TestL: Root Identifier = wgId.Id on %d"),i);
+        	testPassed=(wgId.iParentId == aParentWindowGroupID);
+        	RDebug::Print(_L("Child - TestL: TestPassed = %d"), testPassed);
+        	break;
+        	}
+        }
+        
+	CleanupStack::PopAndDestroy();  // wgids
+	
+	return testPassed;
+	}
+	
+//
+// CMyAppService
+//
+void CMyAppService::ServiceL(const RMessage2& aMessage)
+	{
+	RDebug::Print(_L("Child - ServiceL: message function = %d"),aMessage.Function());
+	
+	switch (aMessage.Function())
+	{
+	case KQueryChainChild1:
+		if (TestL(aMessage.Int0())) 
+			{
+			aMessage.Complete(KChainPass);
+			}
+		else
+			{
+			aMessage.Complete(KChainFail);	
+			}
+			User::Exit(-1);
+		break;
+	case KQueryChainChild2:
+		aMessage.Complete(KErrNone);
+		User::Exit(-1);
+		break;
+	default:
+		aMessage.Complete(KErrNotSupported);
+		User::Leave(KErrNotSupported);
+		break;
+		}
+	}
+	
+//
+// CMyEikAppServer
+//
+CApaAppServiceBase* CMyEikAppServer::CreateServiceL(TUid aServiceType) const
+	{
+	RDebug::Print(_L("Child - CreateServiceL: Creating Service Type %d"),aServiceType);
+	if (aServiceType==KUidTChainServerApp)
+		{
+		return new(ELeave) CMyAppService;
+		}
+	return CEikAppServer::CreateServiceL(aServiceType);
+	}	
+	
+	
+CChainChildAppUi::~CChainChildAppUi()
+	{
+
+	}
+
+void CChainChildAppUi::HandleCommandL(TInt /*aCommand*/)
+	{
+	
+	}
+
+void CChainChildAppUi::RunTestStepL(TInt /*aNextStep*/)
+	{
+	}
+	
+
+
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/t_winchainChild_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,33 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file t_winchainChild_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+//#include <t_winchainChild.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+
+UID3 0x10009e9f  // App UID
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="t_winchainChild";
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/t_winchainLaunch.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,111 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// The class definitions for the simple test application
+// which launches the child application with window chaining
+// The class definitions are:
+// CChainLaunchApplication 
+// CChainLaunchAppUi
+// CChainLaunchDocument
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#ifndef __T_WINCHAINLAUNCH_H
+#define __T_WINCHAINLAUNCH_H
+
+#include <coeccntx.h>
+
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+#include <eikstart.h> ////TKAS added for exe-app
+
+#include <eikserverapp.h> // REikAppServiceBase
+#include <eikon.hrh>
+
+//  Test stuff
+#include "twindowchaining.h"
+
+class CPackagerAppUi;
+	
+////////////////////////////////////////////////////////////////////////
+//
+// CChainLaunchApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+class CChainLaunchApplication : public CEikApplication
+	{
+private: 
+	// Inherited from class CApaApplication
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+	TFileName BitmapStoreName() const;
+	};
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CChainLaunchAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CChainLaunchAppUi : public CEikAppUi, REikAppServiceBase
+    {
+public:
+	CChainLaunchAppUi() :
+	   CEikAppUi()  
+		{
+		}
+    void ConstructL();
+	~CChainLaunchAppUi();
+	virtual void RunTestStepL(TInt aNextStep); 
+	
+private:
+	// from RApaAppServiceBase
+	TUid ServiceUid() const; 
+	
+	
+private:
+	
+	CCoeControl* iAppView;
+
+	};
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CChainLaunchDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CChainLaunchDocument : public CEikDocument
+	{
+public:
+	static CChainLaunchDocument* NewL(CEikApplication& aApp);
+	CChainLaunchDocument(CEikApplication& aApp);
+	void ConstructL();
+private: 
+	// Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+
+#endif // T_WINCHAINLAUNCH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/t_winchainLaunch.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// using relative paths for sourcepath and user includes
+// 
+//
+
+#include <platform_paths.hrh>
+
+epocstacksize 		0x5000
+
+TARGETPATH		/sys/bin
+
+TARGET			t_winchainLaunch.exe
+TARGETTYPE		exe
+
+UID           		0x100039CE 0X10009f9a
+
+VENDORID 		0x70000001
+
+SOURCEPATH    		.
+
+SOURCE        		t_winchainLaunch_Application.cpp
+
+USERINCLUDE   		.
+
+SYSTEMINCLUDE 		/epoc32/include
+SYSTEMINCLUDE 		/epoc32/include/techview
+SYSTEMINCLUDE		/epoc32/include/test
+SYSTEMINCLUDE   	../tef
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY       		euser.lib apparc.lib cone.lib eikcore.lib ws32.lib APPFWK_TEST_APPUI.LIB
+
+START RESOURCE		t_winchainLaunch_reg.rss
+TARGETPATH		/private/10003a3f/apps
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/t_winchainLaunch_Application.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,143 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Source file for the implementation of the 
+// application class - CChainLaunchApplication
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+#include "t_winChainLaunch.h"
+
+/**   The function is called by the UI framework to ask for the
+      application's UID. The returned value is defined by the
+      constant KUidTChainServerApp and must match the second value
+      defined in the project definition file.
+*/ 
+TUid CChainLaunchApplication::AppDllUid() const
+	{
+	return KUidTChainServerApp;
+	}
+  
+/**   This function is called by the UI framework at
+      application start-up. It creates an instance of the
+      document class.
+*/
+CApaDocument* CChainLaunchApplication::CreateDocumentL()
+	{
+	return new (ELeave) CChainLaunchDocument(*this);
+	}
+	
+	LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CChainLaunchApplication;
+	}
+
+TFileName CChainLaunchApplication::BitmapStoreName() const
+	{
+	return KNullDesC();
+	}
+
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication( NewApplication );
+	}
+
+
+
+/**   The constructor of the document class just passes the
+      supplied reference to the constructor initialisation list.
+      The document has no real work to do in this application.
+*/
+CChainLaunchDocument::CChainLaunchDocument(CEikApplication& aApp)
+		: CEikDocument(aApp)
+	{
+	}
+
+
+/**  This is called by the UI framework as soon as the 
+     document has been created. It creates an instance
+     of the ApplicationUI. The Application UI class is
+     an instance of a CEikAppUi derived class.
+*/
+CEikAppUi* CChainLaunchDocument::CreateAppUiL()
+	{
+    return new(ELeave) CChainLaunchAppUi;
+	}
+
+#include <eikserverapp.h>
+
+/** The second phase constructor of the application UI class.
+    The application UI creates and owns the one and only view.
+*/ 
+void CChainLaunchAppUi::ConstructL()
+    {
+    //CEikAppUi::ConstructL();
+    CEikAppUi::BaseConstructL(ENoAppResourceFile|ENoScreenFurniture);
+    
+    TInt rootIdentifier = iCoeEnv->RootWin().Identifier();
+    
+    RDebug::Print(_L("Launch - ConstructL: rootIdentifier = %d"), rootIdentifier);
+    
+	CEikDocument *doc = Document(); 
+    CApaApplication* app = doc->Application();
+    iCoeEnv->RootWin().SetOrdinalPosition(0, KExoticOrdinalPriority);	 
+
+	//Connnect using ConnectNewChildAppL with a valid TSecurityPolicy
+	ConnectNewChildAppL(KUidTChainChildApp, iCoeEnv->RootWin(),TSecurityPolicy(TVendorId(0x70000001)));
+  	TInt result1=User::LeaveIfError(SendReceive(KQueryChainChild1, TIpcArgs(iCoeEnv->RootWin().Identifier())));
+    Close();
+	
+	//Connnect using ConnectNewAppL with a valid TSecurityPolicy
+	ConnectNewAppL(KUidTChainChildApp, TSecurityPolicy(TVendorId(0x70000001)));
+	TInt result2=User::LeaveIfError(SendReceive(KQueryChainChild2, TIpcArgs(iCoeEnv->RootWin().Identifier())));
+	Close();
+	
+	RDebug::Print(_L("Launch - ConstructL: result1 = %d, result2 = %d"), result1, result2);
+	
+	if (result1 == KChainPass && result2 ==0 )
+		{
+		User::Exit(KTWindowChainingTestPassed);
+		}
+	else
+		{
+		User::Exit(-1);
+		}
+	}
+
+TUid CChainLaunchAppUi::ServiceUid() const
+	{
+	CEikDocument *doc = Document();
+    CApaApplication* app = doc->Application();
+    
+    return app->AppDllUid();
+	}
+
+	
+/**  The app Ui owns the two views and is. 
+     therefore, responsible for destroying them
+*/
+CChainLaunchAppUi::~CChainLaunchAppUi()
+	{
+	}
+
+
+void CChainLaunchAppUi::RunTestStepL(TInt /*aNextStep*/)
+	{
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/t_winchainLaunch_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,33 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file t_winchainLaunch_reg.rss
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+//#include <t_winchainLaunch.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+
+UID3 0x10009f9a  // App UID
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="t_winchainLaunch";
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tapparctestapp_loc.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,38 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file 
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+
+RESOURCE LOCALISABLE_APP_INFO
+	{
+	short_caption = "tapparctestapp";
+	caption_and_icon =
+		{
+		CAPTION_AND_ICON_INFO
+			{
+			caption = "tapparctestapp";
+			number_of_icons = 1;
+			icon_file = "z:\\resource\\apps\\svg_icon.svg";
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/testableapalssession.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,180 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// RTestableApaLsSession is used to make it possible to heap test a RApaLsSession
+// 
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+
+#include "testableapalssession.h"
+#include "../apserv/APSCLSV.H"
+
+
+/**
+Connects to the server and makes sure that recognizers are loaded on demand,
+for heap check reasons.
+Use this only when you don't want to wait for the app list to be populated.
+*/
+TInt RTestableApaLsSession::ConnectWithoutWaitingForListPopulation()
+	{
+	TInt err = RApaLsSession::Connect();
+	if(err == KErrNone)
+		err = SetLoadRecognizersOnDemand(ETrue);
+	return err;
+	}
+
+/**
+Connects to the server and makes sure that recognizers are loaded on demand,
+for heap check reasons.
+It also makes sure that the app list is populated before continuing.
+*/
+TInt RTestableApaLsSession::Connect()
+	{
+	const TInt err = ConnectWithoutWaitingForListPopulation();
+	if(err != KErrNone)
+		return err;
+		
+	TRequestStatus requeststatus;
+	RegisterListPopulationCompleteObserver(requeststatus);
+	User::WaitForRequest(requeststatus);
+	
+	return requeststatus.Int();
+	}
+
+/**
+Makes a __UHEAP_MARK on the server.
+*/
+TInt RTestableApaLsSession::HeapMark() const 
+	{
+	return SendReceive(EDebugHeapMark, TIpcArgs(TIpcArgs::ENothing));
+	}
+
+/**
+Makes a __UHEAP_MARKEND on the server.
+*/
+TInt RTestableApaLsSession::HeapMarkEnd() const
+	{
+	return HeapMarkEnd(0);
+	}
+
+/**
+Makes a __UHEAP_MARKENDC(aCount) on the server.
+*/
+TInt RTestableApaLsSession::HeapMarkEnd(TInt aCount) const
+	{
+	return SendReceive(EDebugHeapMarkEnd, TIpcArgs(aCount));
+	}
+
+/**
+Makes a __UHEAP_FAILNEXT on the server.
+*/
+TInt RTestableApaLsSession::HeapFailNext(TInt aCount) const
+	{
+	return SendReceive(EDebugHeapFailNext, TIpcArgs(aCount));
+	}
+
+/**
+Clears the app info array which is created on the server when calling 
+GetAllApps() and similar methods.
+*/
+TInt RTestableApaLsSession::ClearAppInfoArray() const
+	{
+	return SendReceive(EDebugClearAppInfoArray, TIpcArgs(TIpcArgs::ENothing));
+	}
+
+/**
+Flushes the recognition cache.
+*/
+TInt RTestableApaLsSession::FlushRecognitionCache() const
+	{
+	return SendReceive(EDebugFlushRecognitionCache, TIpcArgs(TIpcArgs::ENothing));
+	}
+
+/**
+Sets whether or not the recognizers should be loaded on demand.
+*/
+TInt RTestableApaLsSession::SetLoadRecognizersOnDemand(TBool aLoadRecognizersOnDemand) const
+	{
+	return SendReceive(EDebugSetLoadRecognizersOnDemand, TIpcArgs(aLoadRecognizersOnDemand));
+	}
+
+/**
+When recognizers are loaded on demand a timer is used to do the actual unloading.
+Use this method to perform this unloading synchronously instead of waiting for 
+the timer to go off.
+*/
+TInt RTestableApaLsSession::PerformOutstandingRecognizerUnloading() const
+	{
+	return SendReceive(EDebugPerformOutstandingRecognizerUnloading, TIpcArgs(TIpcArgs::ENothing));
+	}
+
+/**
+Deletes RApaLsSession's iExtension for heap checking purposes.
+
+A result is that outstanding asynchronous file recognitions are cancelled.
+*/
+void RTestableApaLsSession::DeleteExtension()
+ 	{
+ 	//this allows us to delete RApaLsSession's iExtension for heap check reasons
+ 	//RApaLsSession is able to cope with a missing iExtension and must remain able to do so
+ 	//since it's a R-class (i.e. no ConstructL() or equal where it can create it)
+ 	//RApaLsSession recreates iExtension when needed
+ 	//this assumes that iExtension pointer is at the end of the RApaLsSession object
+ 	CBase** RApaLsSession_iExtension = (CBase**)((TInt)this + sizeof(RApaLsSession) - sizeof(CBase*));
+ 	delete *RApaLsSession_iExtension;
+ 	*(RApaLsSession_iExtension) = NULL;
+ 	}
+ 	
+ /**
+ Waits for the type store to be updated by calling @c NotifyOnDataMappingChange()
+ */
+ TInt RTestableApaLsSession::WaitForTypeStoreUpdate()
+ 	{
+ 	TRequestStatus status;
+ 	NotifyOnDataMappingChange(status);
+ 	User::WaitForRequest(status);
+ 	return status.Int();
+ 	}
+
+ /**
+ Inserts an update object into the list of updates to perform that will fail during the commit stage
+ */
+TInt RTestableApaLsSession::AddFailingNonNativeApplicationsUpdate()
+	{
+	return SendReceive(EDebugAddFailingNonNativeApplicationsUpdate, TIpcArgs());
+	}
+
+ /**
+ Inserts an update object into the list of updates to perform that will Panic during the commit stage
+ */
+TInt RTestableApaLsSession::AddPanicingNonNativeApplicationsUpdate()
+	{
+	return SendReceive(EDebugAddPanicingNonNativeApplicationsUpdate, TIpcArgs());
+	}
+
+ /**
+ Inserts an update object into the list of updates to perform that will Panic if the system tries to
+ roll it back, e.g. because an update further down the list failed.
+ */
+TInt RTestableApaLsSession::AddRollbackPanicingNonNativeApplicationsUpdate()
+	{
+	return SendReceive(EDebugAddRollbackPanicingNonNativeApplicationsUpdate, TIpcArgs());
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/testableapalssession.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,114 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code 
+*/
+
+#ifndef __TESTABLEAPALSSESSION_H__
+#define __TESTABLEAPALSSESSION_H__
+
+#include <apgcli.h>
+	
+class RTestableApaLsSession : public RApaLsSession
+	{
+public: //from RApaLsSession
+	TInt Connect();	
+public:
+	TInt ConnectWithoutWaitingForListPopulation();
+	TInt HeapMark() const;
+	TInt HeapMarkEnd() const;
+	TInt HeapMarkEnd(TInt aCount) const;
+	TInt HeapFailNext(TInt aCount) const;
+	TInt ClearAppInfoArray() const;
+	TInt FlushRecognitionCache() const;
+	TInt SetLoadRecognizersOnDemand(TBool aLoadRecognizersOnDemand) const;
+	TInt PerformOutstandingRecognizerUnloading() const;
+	void DeleteExtension();
+	TInt WaitForTypeStoreUpdate();
+	TInt AddFailingNonNativeApplicationsUpdate();
+	TInt AddPanicingNonNativeApplicationsUpdate();
+	TInt AddRollbackPanicingNonNativeApplicationsUpdate();
+	};
+	
+/**
+Use as @c aCleanup argument to @c HEAP_TEST_LS_SESSION if the test doesn't need
+any cleanup in order to be heap checkable.
+*/
+#define NO_CLEANUP
+/**
+Use as @c aClientCount or @c aServerCount arguments to @c HEAP_TEST_LS_SESSION
+if you don't want the heap to be checked
+*/
+#define DONT_CHECK -1
+
+/**
+Heap tests a RTestableApaLsSession by calling __UHEAP_MARK before some test code
+and __UHEAP_MARKEND after.
+
+@param aApaLsSession A reference to a RTestableApaLsSession
+@param aClientCount The value sent to __UHEAP_MARKENDC() on the client side. 
+       Usually 0. DONT_CHECK if no check shall be made.
+@param aServerCount The value sent to __UHEAP_MARKENDC() on the server side. 
+       Usually 0. DONT_CHECK if no check shall be made.
+@param aTest The test code
+@param aCleanup Any cleanup that is needed before the heap check is made. 
+       NO_CLEANUP if no cleanup is needed.
+*/
+#define HEAP_TEST_LS_SESSION(aApaLsSession, aClientCount, aServerCount, aTest, aCleanup) \
+	if(aClientCount != DONT_CHECK)														\
+		{																				\
+		__UHEAP_MARK;																	\
+		}																				\
+	if(aServerCount != DONT_CHECK) 														\
+		{																				\
+		const TInt _error = aApaLsSession.HeapMark();									\
+		if(_error != KErrNone)															\
+			{																			\
+			INFO_PRINTF2(_L("__UHEAP_MARK failed on the server (error=%d)"), _error);	\
+			}																			\
+		TESTL(KErrNone == _error);														\
+		}																				\
+	{																					\
+	TRAPD(_error, aTest); /* execute the test code */									\
+	if(_error != KErrNone)																\
+		{																				\
+		INFO_PRINTF2(_L("Test code issued a leave (%d)"), _error);						\
+		}																				\
+	TESTL(KErrNone == _error);															\
+	}																					\
+	aCleanup; /* execute the cleanup */													\
+	aApaLsSession.DeleteExtension();													\
+	aApaLsSession.PerformOutstandingRecognizerUnloading();										\
+	if(aServerCount != DONT_CHECK)														\
+		{																				\
+		const TInt _error = aApaLsSession.HeapMarkEnd(aServerCount);					\
+		if(_error != KErrNone)															\
+			{																			\
+			INFO_PRINTF2(_L("__UHEAP_MARKEND failed on the server (error=%d)"), _error);\
+			}																			\
+		TESTL(KErrNone == _error);														\
+		}																				\
+	if(aClientCount != DONT_CHECK)														\
+		{																				\
+		__UHEAP_MARKENDC(aClientCount);													\
+		}																				\
+	
+		
+
+#endif //__TESTABLEAPALSSESSION_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/testapp/testupdregappuninstallation/testupdregappuninstallation.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,21 @@
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include<e32def.h>
+
+TInt E32Main()
+{
+return(0);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/testapp/testupdregappuninstallation/testupdregappuninstallation.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+//
+// testupdregappuninstallation.mmp
+//
+
+
+target          testupdregappuninstallation.exe
+CAPABILITY 	WriteDeviceData
+targettype      EXE
+UID             0x1000007a 0x10207f80
+
+
+systeminclude   /epoc32/include
+
+source	 ./TestUpdRegAppUninstallation.cpp
+
+
+START RESOURCE      testupdregappuninstallation_reg.rss
+    TARGETPATH      c:\private\10003a3f\import\apps
+END
+
+library  euser.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/testapp/testupdregappuninstallation/testupdregappuninstallation_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,30 @@
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10207f80
+
+RESOURCE APP_REGISTRATION_INFO 
+    {
+    app_file="TestUpdRegAppUninstallation";
+
+	// MIME types
+	datatype_list= 
+		{
+		DATATYPE { priority=EDataTypePriorityNormal; type="mime/updregappuninstall"; }
+		}; 
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ticoncaptionoverride.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,193 @@
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code.
+*/
+
+
+#include <e32std.h>
+#include <eikstart.h>
+#include "ticoncaptionoverride.h"
+
+const TUid KIconCapOverrideAppUid = {0x2001B674}; // test application UID
+
+CIconCaptionOverrideView* CIconCaptionOverrideView::NewL( const TRect& aRect )
+    {
+    CIconCaptionOverrideView* self = CIconCaptionOverrideView::NewLC( aRect );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CIconCaptionOverrideView* CIconCaptionOverrideView::NewLC( const TRect& aRect )
+    {
+    CIconCaptionOverrideView* self = new ( ELeave ) CIconCaptionOverrideView;
+    CleanupStack::PushL( self );
+    self->ConstructL( aRect );
+    return self;
+    }
+
+void CIconCaptionOverrideView::ConstructL( const TRect& aRect )
+    {
+    // Create a window for this application view
+    CreateWindowL();
+
+    // Set the windows size
+    SetRect( aRect );
+
+    // Activate the window, which makes it ready to be drawn
+    ActivateL();
+    }
+
+CIconCaptionOverrideView::CIconCaptionOverrideView()
+    {
+    // No implementation required
+    }
+
+CIconCaptionOverrideView::~CIconCaptionOverrideView()
+    {
+    // No implementation required
+    }
+
+void CIconCaptionOverrideView::Draw( const TRect& /*aRect*/ ) const
+    {
+    // Get the standard graphics context
+    CWindowGc& gc = SystemGc();
+
+    // Gets the control's extent
+    TRect drawRect( Rect());
+
+    // Clears the screen
+    gc.Clear( drawRect );
+    
+  	}
+
+void CIconCaptionOverrideView::SizeChanged()
+    {  
+    DrawNow();
+    }
+
+void CIconCaptionOverrideAppUi::ConstructL()
+    {
+    // Initialise app UI. Without EAknEnableSkin the dialogs do not render properly in 3.x.
+    //BaseConstructL(EAknEnableSkin);
+	BaseConstructL();
+
+	// Create view object
+	iAppView = CIconCaptionOverrideView::NewL( ClientRect() );	
+	}
+
+CIconCaptionOverrideAppUi::CIconCaptionOverrideAppUi()
+    {
+    // No implementation required
+    }
+
+CIconCaptionOverrideAppUi::~CIconCaptionOverrideAppUi()
+    {
+    if ( iAppView )
+        {
+        delete iAppView;
+        iAppView = NULL;        
+        }
+    }
+
+void CIconCaptionOverrideAppUi::HandleCommandL( TInt aCommand )
+    {
+    switch( aCommand )
+        {
+        case EEikCmdExit:
+        //case EAknSoftkeyExit:
+            Exit();
+            break;
+        default:
+            break;
+        }
+    }
+
+/*void CIconCaptionOverrideAppUi::HandleStatusPaneSizeChange()
+	{
+	iAppView->SetRect( ClientRect() );
+	}
+*/
+CIconCaptionOverrideDocument* CIconCaptionOverrideDocument::NewL( CEikApplication&
+                                                          aApp )
+    {
+    CIconCaptionOverrideDocument* self = NewLC( aApp );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CIconCaptionOverrideDocument* CIconCaptionOverrideDocument::NewLC( CEikApplication&
+                                                           aApp )
+    {
+    CIconCaptionOverrideDocument* self =
+        new ( ELeave ) CIconCaptionOverrideDocument( aApp );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+void CIconCaptionOverrideDocument::ConstructL()
+    {
+    // No implementation required
+    }
+
+CIconCaptionOverrideDocument::CIconCaptionOverrideDocument( CEikApplication& aApp )
+    : CEikDocument( aApp )
+    {
+    // No implementation required
+    }
+
+CIconCaptionOverrideDocument::~CIconCaptionOverrideDocument()
+    {
+    // No implementation required
+    }
+    
+CEikAppUi* CIconCaptionOverrideDocument::CreateAppUiL()
+    {
+    // Create the application user interface, and return a pointer to it;
+    // the framework takes ownership of this object
+    return ( static_cast <CEikAppUi*> ( new ( ELeave )
+                                        CIconCaptionOverrideAppUi ) );
+    }
+
+CApaDocument* CIconCaptionOverrideApplication::CreateDocumentL()
+    {
+    return (static_cast<CApaDocument*>
+                    ( CIconCaptionOverrideDocument::NewL( *this ) ) );
+    }
+
+TUid CIconCaptionOverrideApplication::AppDllUid() const
+    {
+    return KIconCapOverrideAppUid;
+    }
+
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CIconCaptionOverrideApplication;
+	}
+
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication( NewApplication );
+	}
+
+
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ticoncaptionoverride.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,92 @@
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#ifndef __TICONCAPTIONOVERRIDE_H__
+#define __TICONCAPTIONOVERRIDE_H__
+
+#include <coecntrl.h>
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikon.hrh>
+#include <w32std.h>
+
+const TUid KUidTestIconCapOverride = {0x2001B674};
+
+class CIconCaptionOverrideView : public CCoeControl
+    {
+    public: // New methods
+        static CIconCaptionOverrideView* NewL( const TRect& aRect );
+        static CIconCaptionOverrideView* NewLC( const TRect& aRect );
+        virtual ~CIconCaptionOverrideView();
+
+    public:  // Functions from base classes
+        void Draw( const TRect& aRect ) const;
+        virtual void SizeChanged();
+
+    private: // Constructors
+        void ConstructL(const TRect& aRect);
+        CIconCaptionOverrideView();
+    };
+
+class CIconCaptionOverrideAppUi : public CEikAppUi
+    {
+    public: // Constructors and destructor
+        void ConstructL();
+        CIconCaptionOverrideAppUi();
+        virtual ~CIconCaptionOverrideAppUi();
+
+    private:  // Functions from base classes
+        void HandleCommandL( TInt aCommand );
+		//void HandleStatusPaneSizeChange();
+        
+    private: // Data
+        CIconCaptionOverrideView* iAppView;
+    };
+
+class CIconCaptionOverrideDocument : public CEikDocument
+    {
+    public: // Constructors and destructor
+
+        static CIconCaptionOverrideDocument* NewL( CEikApplication& aApp );
+        static CIconCaptionOverrideDocument* NewLC( CEikApplication& aApp );
+        virtual ~CIconCaptionOverrideDocument();
+
+    public: // Functions from base classes
+        CEikAppUi* CreateAppUiL();
+
+    private: // Constructors
+        void ConstructL();
+        CIconCaptionOverrideDocument( CEikApplication& aApp );
+    };
+
+class CIconCaptionOverrideApplication : public CEikApplication
+    {
+    public: // Functions from base classes
+        TUid AppDllUid() const;
+
+    protected: // Functions from base classes
+        CApaDocument* CreateDocumentL();
+    };
+
+#endif // __TICONCAPTIONOVERRIDE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ticoncaptionoverride.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,71 @@
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include <platform_paths.hrh>
+
+TARGET        	ticoncaptionoverride.exe
+TARGETTYPE    	exe
+TARGETPATH		/sys/bin
+
+CAPABILITY 	All -Tcb
+
+UID           	0x100039CE 0x2001B674 //the original UID
+VENDORID 		0x70000001
+
+SOURCEPATH    	.
+SOURCE        	ticoncaptionoverride.cpp
+
+USERINCLUDE   	.
+SYSTEMINCLUDE 	/epoc32/include
+SYSTEMINCLUDE 	/epoc32/include/techview
+
+MW_LAYER_SYSTEMINCLUDE
+
+//reg added for Datacaging
+START RESOURCE	ticoncaptionoverride_reg.rss
+TARGETPATH		/private/10003a3f/import/apps
+END
+
+START RESOURCE 	ticoncaptionoverride.rss
+TARGETPATH 		/resource/apps
+END
+
+START RESOURCE 	ticoncaptionoverride_loc.rss
+TARGETPATH 		/resource/apps
+LANG 			SC 01 02 03
+END
+
+START BITMAP 	ticoncapoverride.mbm
+TARGETPATH 		/resource/apps
+SOURCEPATH 		../tdatasrc
+SOURCE 			c8,1 tstappicon24x20.bmp tstappicon24x20m.bmp
+SOURCE 			c8,1 tstappicon40x55.bmp tstappicon40x55m.bmp
+END
+
+START BITMAP 	ticoncapoverride02.m02
+TARGETPATH 		/resource/apps
+SOURCEPATH 		../tdatasrc
+SOURCE 			c8,1 DEF25.BMP DEF25M.BMP DEF25.BMP DEF25M.BMP DEF50.BMP DEF50M.BMP
+END
+
+LIBRARY 	euser.lib apparc.lib eikcore.lib cone.lib 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ticoncaptionoverride.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,72 @@
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+NAME TICO
+
+#include <eikon.rh>
+#include <eikcore.rsg>
+
+#include "TSTAPP.hrh"
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+	{
+	hotkeys=r_example_hotkeys;
+	menubar=r_example_menubar;
+	}
+
+RESOURCE HOTKEYS r_example_hotkeys
+    {
+    control=
+        {
+        HOTKEY { command=EEikCmdExit; key='e'; }
+        };
+    }
+
+RESOURCE MENU_BAR r_example_menubar
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_example_first_menu; txt="TIconCapOverride"; }
+	};
+    }
+
+RESOURCE MENU_PANE r_example_first_menu
+	{
+	items=
+		{
+		MENU_ITEM { command=EExampleItem0; txt="Item 0"; },
+		MENU_ITEM { command=EExampleItem1; txt="Item 1"; },
+		MENU_ITEM { command=EExampleItem2; txt="Item 2"; },
+		MENU_ITEM { command=EEikCmdExit; txt="Close"; }
+        };
+    }
+
+RESOURCE TBUF r_example_text_Title { buf="IconCapOverride Application"; }
+RESOURCE TBUF r_example_text_Item0 { buf="Item 0"; }
+RESOURCE TBUF r_example_text_Item1 { buf="Item 1"; }
+RESOURCE TBUF r_example_text_Item2 { buf="Item 2"; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ticoncaptionoverride01.rls	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,27 @@
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+rls_string STRING_r_ticoncapoverride_caption_string "TstCap UK"
+rls_string STRING_r_ticoncapoverride_short_caption_string "TC UK"
+
+rls_string STRING_r_ticoncapoverride_icon_file "z:\\resource\\apps\\ticoncapoverride.mbm"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ticoncaptionoverride02.rls	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,27 @@
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+rls_string STRING_r_ticoncapoverride_caption_string "TstCap FR"
+rls_string STRING_r_ticoncapoverride_short_caption_string "TC FR"
+
+rls_string STRING_r_ticoncapoverride_icon_file "z:\\resource\\apps\\ticoncapoverride02.m02"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ticoncaptionoverride03.rls	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,27 @@
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+rls_string STRING_r_ticoncapoverride_caption_string "TstCap GE"
+rls_string STRING_r_ticoncapoverride_short_caption_string "TC GE"
+
+rls_string STRING_r_ticoncapoverride_icon_file "z:\\resource\\apps\\ticoncapoverride.mbm"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ticoncaptionoverride_loc.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,48 @@
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include <appinfo.rh>
+
+#if defined(LANGUAGE_01)
+#include "ticoncaptionoverride01.rls"
+#elif(LANGUAGE_02)
+#include "ticoncaptionoverride02.rls"
+#elif(LANGUAGE_03)
+#include "ticoncaptionoverride03.rls"
+#else
+#include "ticoncaptionoverridesc.rls"
+#endif
+
+RESOURCE LOCALISABLE_APP_INFO
+	{
+	short_caption = STRING_r_ticoncapoverride_short_caption_string;
+	caption_and_icon =
+		{
+		CAPTION_AND_ICON_INFO
+			{
+			caption = STRING_r_ticoncapoverride_caption_string;
+			number_of_icons = 2;
+			icon_file = STRING_r_ticoncapoverride_icon_file;
+			}
+		};		
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ticoncaptionoverride_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,40 @@
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+
+UID3 0x2001B674 // application UID
+
+RESOURCE APP_REGISTRATION_INFO 
+	{	
+	app_file = "ticoncaptionoverride";
+
+	localisable_resource_file = "\\resource\\apps\\ticoncaptionoverride_loc";
+
+	hidden = KAppNotHidden;
+	embeddability=KAppEmbeddable;
+	newfile = KAppDoesNotSupportNewFile;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/ticoncaptionoverridesc.rls	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,28 @@
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+rls_string STRING_r_ticoncapoverride_caption_string "TstCap UK"
+rls_string STRING_r_ticoncapoverride_short_caption_string "TC UK"
+
+rls_string STRING_r_ticoncapoverride_icon_file "z:\\resource\\apps\\ticoncapoverride.mbm"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tlargestack/tlargestackapp.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,41 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+
+#ifndef __TLARGESTACKAPP_H
+#define __TLARGESTACKAPP_H
+
+#include <coeccntx.h>
+
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+
+#include <eikon.hrh>
+
+#include <tlargestackapp.rsg>
+#include "tlargestackapp.hrh"
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tlargestack/tlargestackapp.hrh	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,31 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+
+
+enum TExampleMenuCommands
+	{
+	EExampleItem0 = 200,
+	EExampleItem1,
+	EExampleItem2
+	};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tlargestack/tlargestackapp.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,50 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <platform_paths.hrh>
+
+TARGET        tlargestackapp.exe
+TARGETTYPE    exe
+UID           0x100039CE 0x10282B27
+VENDORID 	  0x70000001
+
+epocstacksize 		0xf000
+
+SOURCEPATH    .
+SOURCE        tlargestackapp_main.cpp
+USERINCLUDE   .
+SYSTEMINCLUDE /epoc32/include
+SYSTEMINCLUDE /epoc32/include/techview
+
+MW_LAYER_SYSTEMINCLUDE
+
+START RESOURCE	tlargestackapp.rss
+HEADER
+TARGETPATH		/Resource/Apps
+end
+
+START RESOURCE	tlargestackapp_reg.rss
+TARGETPATH		/private/10003a3f/apps
+END
+
+LIBRARY       euser.lib apparc.lib cone.lib eikcore.lib gdi.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tlargestack/tlargestackapp.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,74 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+
+NAME TEAP
+
+#include <eikon.rh>
+#include <eikcore.rsg>
+#include <appinfo.rh>
+
+#include "tlargestackapp.hrh"
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+	{
+	hotkeys=r_example_hotkeys;
+	menubar=r_example_menubar;
+	}
+
+RESOURCE HOTKEYS r_example_hotkeys
+    {
+    control=
+        {
+        HOTKEY { command=EEikCmdExit; key='e'; }
+        };
+    }
+
+RESOURCE MENU_BAR r_example_menubar
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_example_first_menu; txt="LargeStackApp"; }
+		};
+    }
+
+RESOURCE MENU_PANE r_example_first_menu
+	{
+	items=
+		{
+		MENU_ITEM { command=EExampleItem0; txt="Item 0"; },
+		MENU_ITEM { command=EExampleItem1; txt="Item 1"; },
+		MENU_ITEM { command=EExampleItem2; txt="Item 2"; },
+		MENU_ITEM { command=EEikCmdExit; txt="Close"; }
+        };
+    }
+
+
+RESOURCE TBUF r_example_text_TestApp { buf="TLargeStackApp!"; }
+RESOURCE TBUF r_example_text_Item0 { buf="Item 0"; }
+RESOURCE TBUF r_example_text_Item1 { buf="Item 1"; }
+RESOURCE TBUF r_example_text_Item2 { buf="Item 2"; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tlargestack/tlargestackapp_main.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,39 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// An application that uses more than the normally available amount of stack space.
+// 
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+
+
+#include "tlargestackapp.h"
+
+#include <eikstart.h>
+
+	
+GLDEF_C TInt E32Main()
+	{
+	TInt array[100000000]; 		// Create an array large enough to use up more than our stack allocation
+	array[0]=1; 				// just a line to get rid of the warning in the build
+	array[1]=array[0]+1;		// just a line to get rid of the warning in the build
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tlargestack/tlargestackapp_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,35 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+#include <tlargestackapp.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10282B27 // application UID
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file = "TLargeStackApp";
+	localisable_resource_file = "\\resource\\apps\\TLargeStackApp";
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tnotifydrivesapp/tnotifydrivesapp.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,172 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <eikstart.h>
+#include "tnotifydrivesapp.h"
+
+const TUid KNotifyDrivesAppUid = { 0xA0003376 };
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// Implementation of the application class - CExampleApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+TUid CExampleApplication::AppDllUid() const
+	{
+	return KNotifyDrivesAppUid;
+	}
+
+CApaDocument* CExampleApplication::CreateDocumentL()
+	{
+	return new (ELeave) CExampleDocument(*this);
+	}
+	
+
+////////////////////////////////////////////////////////////////////////
+//
+// Implementation of the appui class - CExampleAppUi
+//
+////////////////////////////////////////////////////////////////////////
+
+void CExampleAppUi::ConstructL()
+    {
+    BaseConstructL();
+	iAppView = CExampleAppView::NewL(ClientRect());
+	}
+
+CExampleAppUi::~CExampleAppUi()
+	{
+	delete iAppView;
+	}
+
+void CExampleAppUi::HandleCommandL(TInt aCommand)
+	{
+	switch (aCommand)
+		{
+		case EEikCmdExit: 
+			Exit();
+			break;
+		}
+	}
+
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// Implementation of the view class - CExampleAppView
+//
+////////////////////////////////////////////////////////////////////////
+
+CExampleAppView::CExampleAppView()
+	{
+	}
+
+CExampleAppView* CExampleAppView::NewL(const TRect& aRect)
+	{
+	CExampleAppView* self = new(ELeave) CExampleAppView();
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect);
+	CleanupStack::Pop();
+	return self;
+	}
+
+CExampleAppView::~CExampleAppView()
+	{
+	
+	}
+
+void CExampleAppView::ConstructL(const TRect& aRect)
+    {
+   	// Fetch the text from the resource file.
+	
+
+    // Control is a window owning control
+	CreateWindowL();
+
+   // Extent of the control. This is
+   // the whole rectangle available to application.
+   // The rectangle is passed to us from the application UI.
+	SetRect(aRect);
+
+   // At this stage, the control is ready to draw so
+   // we tell the UI framework by activating it.
+	ActivateL();
+	}
+
+
+void CExampleAppView::Draw(const TRect& /*aRect*/) const
+	{
+	CWindowGc& gc = SystemGc();			// Window graphics context
+	TRect      drawRect = Rect();		// Area in which we shall draw	
+	const CFont*     fontUsed;			// Font used for drawing text
+	
+	// Start with a clear screen
+	gc.Clear();
+	
+	// Draw an outline rectangle (the default pen and brush styles ensure this) slightly smaller than the drawing area.
+	drawRect.Shrink(10,10);		   	
+	gc.DrawRect(drawRect);
+    
+    // Use the title font supplied by the UI
+	fontUsed = iEikonEnv->TitleFont();
+	gc.UseFont(fontUsed);
+	
+	// Draw the text in the middle of the rectangle.
+	TInt   baselineOffset=(drawRect.Height() - fontUsed->HeightInPixels())/2; 
+	
+    
+    // Finished using the font
+	gc.DiscardFont();
+	}
+
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// Implementation of the document class - CExampleDocument
+//
+////////////////////////////////////////////////////////////////////////
+
+CExampleDocument::CExampleDocument(CEikApplication& aApp)
+		: CEikDocument(aApp)
+	{
+	}
+
+CEikAppUi* CExampleDocument::CreateAppUiL()
+	{
+    return new(ELeave) CExampleAppUi;
+	}
+
+
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CExampleApplication;
+	}
+	
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication(NewApplication);
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tnotifydrivesapp/tnotifydrivesapp.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,108 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+#ifndef __TNOTIFYDRIVESAPP_H
+#define __TNOTIFYDRIVESAPP_H
+
+#include <coeccntx.h>
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+#include <eikon.hrh>
+#include <tnotifydrivesapp.rsg>
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+class CExampleApplication : public CEikApplication
+	{
+private: 
+	// Inherited from class CApaApplication
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+	};
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppView
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppView : public CCoeControl
+    {
+public:
+	static CExampleAppView* NewL(const TRect& aRect);
+	CExampleAppView();
+	~CExampleAppView();
+    void ConstructL(const TRect& aRect);
+
+private:
+	// Inherited from CCoeControl
+	void Draw(const TRect& /*aRect*/) const;
+
+private:
+	HBufC*  iExampleText;
+    };
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppUi : public CEikAppUi
+    {
+public:
+    void ConstructL();
+	~CExampleAppUi();
+
+private:
+	// Inherirted from class CEikAppUi
+	void HandleCommandL(TInt aCommand);
+
+private:
+	CCoeControl* iAppView;
+	};
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleDocument : public CEikDocument
+	{
+public:
+	static CExampleDocument* NewL(CEikApplication& aApp);
+	CExampleDocument(CEikApplication& aApp);
+	void ConstructL();
+private: 
+	// Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tnotifydrivesapp/tnotifydrivesapp.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,55 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// using relative paths for sourcepath and user includes
+// 
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <platform_paths.hrh>
+
+TARGET        		tnotifydrivesapp.exe
+TARGETTYPE    		exe
+TARGETPATH      	/sys/bin
+UID           		0x100039CE 0xA0003376
+VENDORID 	  		0x70000001
+
+SOURCEPATH    	.
+SOURCE		tnotifydrivesapp.cpp
+
+USERINCLUDE   	.
+SYSTEMINCLUDE 	/epoc32/include
+SYSTEMINCLUDE 	/epoc32/include/techview
+
+MW_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH	.
+RESOURCE 	tnotifydrivesapp.RSS
+START RESOURCE	tnotifydrivesapp.RSS
+TARGETPATH	/System/Data
+LANG		SC
+END
+
+SOURCEPATH	.
+START RESOURCE	tnotifydrivesapp_reg.rss
+TARGETPATH /System/Data
+END
+
+LIBRARY       euser.lib apparc.lib cone.lib eikcore.lib gdi.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tnotifydrivesapp/tnotifydrivesapp.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,36 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Symbian test code
+*/
+
+NAME TEAP
+
+#include <eikon.rh>
+#include <eikcore.rsg>
+#include <appinfo.rh>
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tnotifydrivesapp/tnotifydrivesapp_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent -  Symbian test code
+*/
+
+#include <appinfo.rh>
+#include <tnotifydrivesapp.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0xA0003376 // application UID
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file = "tnotifydrivesapp";
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/trecupgrade/a000b461.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,42 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// 0xA000B461.rss
+// 
+//
+
+#include <registryinfo.rh>
+
+
+RESOURCE REGISTRY_INFO r_registry
+	{
+	dll_uid = 0xA000B461; //should match name of this file
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = 0x101F7D87; // Const for all Data Recognizers
+			implementations =
+			 {
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 0xA000B461; // Our test recognizer
+					version_no = 1;
+					display_name = "recupg";
+					default_data = "";        // Notify Interface
+					opaque_data = "";
+					}
+				};
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/trecupgrade/recupgrade.MMP	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,41 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// recupgrade.dll Symbian OS new MIME type recognizer
+// 
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+target 		recupgrade.dll
+targettype 	plugin 
+uid			0x10009d8d 0xA000B461
+VENDORID 	0x70000001
+CAPABILITY	All -Tcb
+
+systeminclude   /epoc32/include /epoc32/include/ecom /epoc32/include/test
+
+SOURCEPATH	.
+source		recupgrade.cpp
+
+library         euser.lib apmime.lib efsrv.lib
+
+start resource a000b461.rss
+target recupgrade.rsc
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/trecupgrade/recupgrade.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,80 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <implementationproxy.h>
+
+#include "recupgrade.h"
+#include "upgconstants.h"
+
+/////////////////////////////////////////////////
+
+const TInt KMaxBufferLength=1024; // maximum amount of buffer space we will ever use
+
+/////////////////////////////////////////////////
+
+/*
+DLL entry point
+*/
+GLDEF_C TInt E32Dll()
+	{
+	return KErrNone;
+	}
+
+/*
+Private constructor
+*/
+CTestUpgradeRecognizer::CTestUpgradeRecognizer()
+	:CApaDataRecognizerType(KUidUpgradeRecognizer, CApaDataRecognizerType::ENormal)
+	{
+	iCountDataTypes=0;
+	}
+	
+/*
+Ecom factory function
+*/
+CApaDataRecognizerType* CTestUpgradeRecognizer::CreateRecognizerL()
+	{
+	
+	return new (ELeave) CTestUpgradeRecognizer();
+	}
+	
+
+TUint CTestUpgradeRecognizer::PreferredBufSize()
+	{
+	return KMaxBufferLength;
+	}
+
+TDataType CTestUpgradeRecognizer::SupportedDataTypeL(TInt /*aIndex*/) const
+	{
+	return TDataType();
+	}
+
+void CTestUpgradeRecognizer::DoRecognizeL(const TDesC& /*aName*/, const TDesC8& /*aBuffer*/)
+	{
+    	// returning ENotRecognized will avoid the possibility of impacting other test code.
+	iDataType=TDataType();
+	iConfidence=ENotRecognized;
+	}
+
+const TImplementationProxy ImplementationTable[] = 
+    {
+	IMPLEMENTATION_PROXY_ENTRY(KUidUpgradeRecognizerValue, CTestUpgradeRecognizer::CreateRecognizerL)
+	};
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/trecupgrade/recupgrade.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,45 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#if !defined(__RECUPGRADE_H__)
+#define __RECUPGRADE_H__
+
+#include <apmrec.h>
+
+/**
+@class
+@internalComponent - Internal Symbian test code
+
+
+This recognizer is part of the CT_ApsUpgradeStep tef test.
+*/
+class CTestUpgradeRecognizer : public CApaDataRecognizerType
+	{
+public: 
+	// for ECOM
+	static CApaDataRecognizerType* CreateRecognizerL();
+
+	// from CApaDataRecognizerType
+	TUint PreferredBufSize();
+	TDataType SupportedDataTypeL(TInt aIndex) const;
+	
+private: 
+	CTestUpgradeRecognizer();
+	
+	// from CApaDataRecognizerType
+	void DoRecognizeL(const TDesC& aName, const TDesC8& aBuffer);
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/trecupgrade/upgconstants.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,42 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#if !defined(__RECUPGRADECONSTANTS_H__)
+#define __RECUPGRADECONSTANTS_H__
+
+
+_LIT(KUpgDocPath, "Z:\\system\\data\\TApsRecogUpgradeTest.upg");
+_LIT(KUpgRscTargetDir,"C:\\resource\\plugins\\");
+_LIT(KUpgDllTargetDir,"C:\\sys\\bin\\");
+_LIT(KUpgRscSourcePath, "Z:\\system\\data\\recupgrade.rsc");
+_LIT(KUpgRscTargetPath,"C:\\resource\\plugins\\recupgrade.rsc");
+_LIT(KUpgDllTargetPath, "C:\\sys\\bin\\recupgrade.dll");
+_LIT(KUpgDllSourcePathWinscw, "Z:\\system\\data\\recupgrade_winscw_rel.dll");
+_LIT(KUpgDllSourcePathArmv5, "Z:\\system\\data\\recupgrade_armv5_rel.dll");
+_LIT8(KMimeUpgType,"mime/upg");
+
+#define KUidUpgradeRecognizerValue 0xA000B461
+
+const TUid KUidUpgradeRecognizer={KUidUpgradeRecognizerValue};
+const TInt KNumUpgradeTypes=1;
+	
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tssaac/SysStartApparcTestCases.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,732 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// REQ3889 is essentially a change to the boot sequence and not a change to the functionality of apparc,
+// i.e. once the system has finished startup the functional behaviour should not have changed, which will
+// be proved with execution of the existing App-Framework test suite.
+// The test cases implemented below are executed during the Critical Static phase of startup to prove the
+// restricted functionality during this phase is correct. All calls to the API will panic except the call
+// to RApaLsSession::StartApp which has been modified not to panic.
+// Note that some of the tests cases used in this test are later executed during the normal
+// phone operation phase (non-critical phase) by other tests (see T_StartAppStep.cpp, T_RapaLsSession.cpp, ...)
+// As nearly all these test cases panic at the first client-server call and so execution of these test cases
+// will never reach the end of the function.
+// 
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <apacmdln.h>
+#include <s32file.h>
+
+#include "appfwk_test_AppUi.h"
+#include "T_SysStartApparcStep.h"
+#include "SysStartApparcTestCases.h"
+#include "TRApaLsSessionStartAppTest.h"
+#include "TRApaLsSessionTestUids.h"
+#include "tstapp.h"
+#include "tssaac.h"
+
+_LIT(KNonExistingFile, "z:\\system\\data\\not_here_thanks.foo");
+_LIT(KLitExePath, "\\sys\\bin\\texe.exe");
+
+
+/**
+   Constructor
+ */
+CSysStartApparcTestCase::CSysStartApparcTestCase()
+	{
+	}
+
+/**
+   Destructor
+ */
+CSysStartApparcTestCase::~CSysStartApparcTestCase()
+	{
+	iApaLsSession.Close();
+	}
+
+/**
+Connect to the Apparc server and call RunTestCasesL() inside a
+trap harness. Panic if an error is returned
+*/
+void CSysStartApparcTestCase::doTestCasesL()
+	{
+	RDebug::Print(_L("CSysStartApparcTestCase: Test Cases Running..."));
+
+	TInt error = iApaLsSession.Connect();
+	if(error!=KErrNone)
+		{
+		RDebug::Print(_L("CSysStartApparcTestCase: Error connecting to RApaLsSession (err=%d)"), error);
+		}
+
+	TRAP(error,RunTestCasesL())
+	if(error!=KErrNone)
+		{
+		RDebug::Print(_L("CSysStartApparcTestCase: Error running test cases (err=%d)"), error);
+		}
+
+	RDebug::Print(_L("CSysStartApparcTestCase: Test Cases Completed!"));
+	}
+
+/**
+Call each test case inside a trap harness and panic if an error is returned.
+The Panic will be raised in doTestCasesL() function.
+The Use __UHEAP macros to test for memory leaks.
+Reads in the test case number from file TestCaseConfig.txt
+Each test case is assigned a unique number in the batch file sysstart_apparc_run.bat
+*/
+void CSysStartApparcTestCase::RunTestCasesL()
+	{
+	__UHEAP_MARK;
+
+	TInt aTestCase=ReadConfigFileL();
+
+	switch(aTestCase)
+		{
+		case 1:
+			TestStartApp1L();
+			WriteResultFileL(); //Called if the test case does not panic
+			break;
+
+		case 2:
+			TestStartApp2L();
+			break;
+
+		case 3:
+			TestStartApp3L();
+			break;
+
+		case 4:
+			TestStartApp4L();
+			break;
+
+		case 5:
+			TestStartApp5L();
+			break;
+
+		case 6:
+			TestStartApp6L();
+			break;
+
+		case 7:
+			TestGetAllApps();
+			break;
+
+		case 8:
+			TestInsertDataTypeL();
+			break;
+
+		case 9:
+			TestAppForDataTypeL();
+			break;
+
+		case 10:
+			TestDeleteDataTypeL();
+			break;
+
+		case 11:
+			TestServiceDiscovery();
+			break;
+
+		case 12:
+			TestGetAppInfo();
+			break;
+
+		case 13:
+			TestAppCount();
+			break;
+
+		case 14:
+			TestCreateDoc();
+			break;
+
+		case 29:
+		case 0:
+		default:
+			RDebug::Print(_L("CSysStartApparcTestCase: Unknown Test Case Specified"));
+			break;
+		}
+
+	__UHEAP_MARKEND;
+	}
+
+
+/**
+   @SYMTestCaseID          APPFWK-APPARC-I-0001
+
+   @SYMPREQ                PREQ967
+
+   @SYMREQ                 REQ3889
+
+   @SYMTestCaseDesc        Test Launching of an application using command line information.
+                           Test is run during SSA Critical Static phase,
+
+   @SYMTestPriority        High
+
+   @SYMTestStatus          Implemented
+
+   @SYMTestActions         Call RApaLsSession::StartApp() to start an application defined by the command
+   						   line information. Test the launching of application for following scenarios:
+                           (1) When Application specified by command line exists.
+                           (2) When Application specified by command line does not exist.
+                           API Calls:\n
+						   RApaLsSession::StartApp(const CApaCommandLine& aCommandLine)
+
+   @SYMTestExpectedResults (1) StartApp() returns KErrNone
+                           (2) StartApp() returns KErrNotFound
+*/
+void CSysStartApparcTestCase::TestStartApp1L()
+	{
+	RDebug::Print(_L("CSysStartApparcTestCase: Test RApaLsSession::StartApp using CApaCommandLine....."));
+
+	// Set filename location
+	TPtrC apparcTestFilename(KLitExePath);
+
+	// (1) start application texe.exe from the commandline
+	CApaCommandLine* cmdLn=CApaCommandLine::NewLC();
+	cmdLn->SetExecutableNameL(apparcTestFilename);
+	_LIT8(KLitDogfish,"dogfish");
+	cmdLn->SetTailEndL(KLitDogfish);
+	iStartApp1LRes1 = iApaLsSession.StartApp(*cmdLn); // explicit
+
+	if(iStartApp1LRes1 == KErrNone)
+		{
+		RDebug::Print(_L("CSysStartApparcTestCase: TestStartApp1L Launch of Command line app successful"));
+		}
+
+	// (2) start a non-existant app
+	_LIT(KLitWibble,"wibble");
+	cmdLn->SetExecutableNameL(KLitWibble);
+	iStartApp1LRes2 = iApaLsSession.StartApp(*cmdLn);
+	if(iStartApp1LRes2 == KErrNotFound)
+		{
+		RDebug::Print(_L("CSysStartApparcTestCase: TestStartApp1L Launch of non-existant app returns KErrNotFound"));
+		}
+
+	CleanupStack::PopAndDestroy(cmdLn); // cmdLn
+	}
+
+/**
+   @SYMTestCaseID          APPFWK-APPARC-0002
+
+   @SYMPREQ                PREQ967
+
+   @SYMREQ                 REQ3889
+
+   @SYMTestCaseDesc        Get the MIME type of the data in the specified document and return the UID of an
+   						   application that can handle this type.
+
+   @SYMTestPriority        High
+
+   @SYMTestStatus          Implemented
+
+   @SYMTestActions         Call RApaLsSession::AppForDocument() to return the UID of an application that can
+   						   read/display the specified file. The Apparc server is not ready in CS phase, so the
+   						   call has to fail.
+                           API Calls:\n
+						   RApaLsSession::AppForDocument(const TDesC& aFileName, TUid& aAppUid, TDataType& aDataType) const
+
+   @SYMTestExpectedResults AppForDocument() causes Main Panic KERN-EXEC 0
+*/
+void CSysStartApparcTestCase::TestStartApp2L()
+	{
+	RDebug::Print(_L("CSysStartApparcTestCase: Test RApaLsSession::AppForDocument using filename and app uid...."));
+
+	TUid retUid = KNullUid;
+
+	TDataType data;
+
+	// Set filename location
+	TPtrC apparcTestFilename(KLitTRApaLsSessionStartAppTest);
+
+	// Main Panic KERN-EXEC 0
+	iApaLsSession.AppForDocument(apparcTestFilename, retUid, data);
+
+	}
+
+/**
+   @SYMTestCaseID          APPFWK-APPARC-0003
+
+   @SYMPREQ                PREQ967
+
+   @SYMREQ                 REQ3889
+
+   @SYMTestCaseDesc        Finds and launches an application to match the specified document.
+
+   @SYMTestPriority        High
+
+   @SYMTestStatus          Implemented
+
+   @SYMTestActions         Call RApaLsSession::StartDocument() with a document name
+                           API Calls:\n
+						   RApaLsSession::StartDocument(const TDesC& aFileName, TThreadId& aThreadId, TLaunchType aLaunchType)
+
+   @SYMTestExpectedResults StartDocument() causes Main Panic KERN-EXEC 0
+*/
+void CSysStartApparcTestCase::TestStartApp3L()
+	{
+	RDebug::Print(_L("CSysStartApparcTestCase: Test RApaLsSession::StartDocument....start the app from the recognized doc given."));
+
+	// Set filename location
+	TPtrC apparcTestFilename(KLitTRApaLsSessionStartAppTest);
+
+	//Call to tested function - for info, startAppThreadID is assigned to the app thread id
+  	TThreadId startAppThreadID;
+
+	//Main Panic KERN-EXEC 0
+	iApaLsSession.StartDocument(apparcTestFilename, startAppThreadID);
+	}
+
+
+/**
+   @SYMTestCaseID          APPFWK-APPARC-0004
+
+   @SYMPREQ                PREQ967
+
+   @SYMREQ                 REQ3889
+
+   @SYMTestCaseDesc        Launches an application to suit the specified document by means of a specified MIME type
+
+   @SYMTestPriority        High
+
+   @SYMTestStatus          Implemented
+
+   @SYMTestActions         Call RApaLsSession::StartDocument() with filename and MIME type.
+                           API Calls:\n
+						   RApaLsSession::StartDocument(const TDesC& aFileName, const TDataType& aDataType, TThreadId& aThreadId, TLaunchType aLaunchType)
+
+   @SYMTestExpectedResults StartDocument() causes Main Panic KERN-EXEC 0
+*/
+void CSysStartApparcTestCase::TestStartApp4L()
+	{
+	RDebug::Print(_L("CSysStartApparcTestCase: Test RApaLsSession::StartDocument....known data type"));
+
+	// Set filename location
+	TPtrC apparcTestFilename(KLitTRApaLsSessionStartAppTest);
+
+	// KErrNotFound as a return value
+	TThreadId startAppThreadID;
+
+	//Main Panic KERN-EXEC 0
+	iApaLsSession.StartDocument(apparcTestFilename, TDataType(KLitMimeType_TRApaLsSessionStartAppTest), startAppThreadID);
+	}
+
+
+/**
+   @SYMTestCaseID          APPFWK-APPARC-0005
+
+   @SYMPREQ                PREQ967
+
+   @SYMREQ                 REQ3889
+
+   @SYMTestCaseDesc        Attempt to launch an application by means of an unknown MIME type
+
+   @SYMTestPriority        High
+
+   @SYMTestStatus          Implemented
+
+   @SYMTestActions         Call RApaLsSession::StartDocument() with filename and unknown MIME type.
+                           API Calls:\n
+						   RApaLsSession::StartDocument(const TDesC& aFileName, const TDataType& aDataType, TThreadId& aThreadId, TLaunchType aLaunchType)
+
+   @SYMTestExpectedResults StartDocument() causes Main Panic KERN-EXEC 0
+*/
+void CSysStartApparcTestCase::TestStartApp5L()
+	{
+	RDebug::Print(_L("CSysStartApparcTestCase: Test RApaLsSession::StartDocument....unknown data type"));
+
+	// Set filename location
+	TPtrC apparcTestFilename(KLitTRApaLsSessionStartAppTest);
+
+	// KErrNotFound as a return value
+	TThreadId startAppThreadID;
+
+	//Main Panic KERN-EXEC 0
+	iApaLsSession.StartDocument(apparcTestFilename, TDataType(_L8("text/plain/no thanks")), startAppThreadID);
+	}
+
+/**
+   @SYMTestCaseID          APPFWK-APPARC-0006
+
+   @SYMPREQ                PREQ967
+
+   @SYMREQ                 REQ3889
+
+   @SYMTestCaseDesc        Attempt to launch an application by specifying a non-existent file
+
+   @SYMTestPriority        High
+
+   @SYMTestStatus          Implemented
+
+   @SYMTestActions         Call RApaLsSession::StartDocument() with a non-existent file
+                           API Calls:\n
+						   RApaLsSession::StartDocument(const TDesC& aFileName, TThreadId& aThreadId, TLaunchType aLaunchType)
+
+   @SYMTestExpectedResults StartDocument() causes Main Panic KERN-EXEC 0
+*/
+void CSysStartApparcTestCase::TestStartApp6L()
+	{
+	RDebug::Print(_L("CSysStartApparcTestCase: Test RApaLsSession::StartDocument....non existent file."));
+
+	// Set filename location
+	TPtrC apparcTestFilename(KNonExistingFile);
+
+	// KErrNotFound as a return value
+	TThreadId startAppThreadID;
+
+	//Main Panic KERN-EXEC 0
+	iApaLsSession.StartDocument(apparcTestFilename, startAppThreadID);
+	}
+
+/**
+   @SYMTestCaseID          APPFWK-APPARC-0007
+
+   @SYMPREQ                PREQ967
+
+   @SYMREQ                 REQ3889
+
+   @SYMTestCaseDesc        Test the functionality of GetAllApps
+
+   @SYMTestPriority        High
+
+   @SYMTestStatus          Implemented
+
+   @SYMTestActions         Call RApaLsSession::GetAllApps()
+
+   @SYMTestExpectedResults GetAllApps() causes Main Panic KERN-EXEC 0
+
+*/
+void CSysStartApparcTestCase::TestGetAllApps()
+	{
+	RDebug::Print(_L("CSysStartApparcTestCase: Test RApaLsSession::GetAllApps....check list of apps"));
+
+	// Main Panic KERN-EXEC 0
+	iApaLsSession.GetAllApps();
+
+	}
+
+/**
+   @SYMTestCaseID          APPFWK-APPARC-0008
+
+   @SYMPREQ                PREQ967
+
+   @SYMREQ                 REQ3889
+
+   @SYMTestCaseDesc        Tests InsertDataMapping() which links a datatype to the UID of an associated application
+   						   for launching assigns adds a low priority.
+                           Tests InsertDataMappingIfHigher() which remaps the datatype to the specified UID if the
+                           specified priority is higher.
+                           The "added" parameter indicates if the mapping was successful.
+
+   @SYMTestPriority        High
+
+   @SYMTestStatus          Implemented
+
+   @SYMTestActions         Call RApaLsSession::InsertDataMapping() with datatype, application UID and low priority
+                           API Calls:\n
+						   RApaLsSession::InsertDataMapping(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid)
+
+   @SYMTestExpectedResults InsertDataMapping() causes Main Panic KERN-EXEC 0
+*/
+void CSysStartApparcTestCase::TestInsertDataTypeL()
+	{
+	RDebug::Print(_L("CSysStartApparcTestCase: Test RApaLsSession::InsertDataMapping....Check data type mapping addition"));
+	const TDataTypePriority KPriLow = 1;
+
+	_LIT8(KLitPlainText,"text/plain");
+
+	TSecurityInfo info;
+	info.Set(RProcess());
+
+	//Main Panic KERN-EXEC 0
+	iApaLsSession.InsertDataMapping(TDataType(KLitPlainText), KPriLow, KUidTestApp);
+
+	}
+
+/**
+   @SYMTestCaseID          APPFWK-APPARC-0009
+
+   @SYMPREQ                PREQ967
+
+   @SYMREQ                 REQ3889
+
+   @SYMTestCaseDesc        Tests AppForDataType() which returns the UID of an application which can handle the specified datatype
+
+   @SYMTestPriority        High
+
+   @SYMTestStatus          Implemented
+
+   @SYMTestActions         Call RApaLsSession::InsertDataMapping() with datatype and application UID (and priority)
+                           API Calls:\n
+						   RApaLsSession::InsertDataMapping(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid)
+
+   @SYMTestExpectedResults AppForDataType() causes Main Panic KERN-EXEC 0
+*/
+void CSysStartApparcTestCase::TestAppForDataTypeL()
+	{
+	RDebug::Print(_L("CSysStartApparcTestCase: Test RApaLsSession::AppForDataType....Check an app binding"));
+
+	_LIT8(KLitPlainText,"text/plain");
+
+	TUid retUid = KNullUid;
+
+	//Main Panic KERN-EXEC 0
+	iApaLsSession.AppForDataType(TDataType(KLitPlainText), retUid);
+
+	}
+
+
+/**
+   @SYMTestCaseID          APPFWK-APPARC-0010
+
+   @SYMPREQ                PREQ967
+
+   @SYMREQ                 REQ3889
+
+   @SYMTestCaseDesc        Tests DeleteDataMapping() which removes the linking of a datatype to the UID of an associated application
+
+   @SYMTestPriority        High
+
+   @SYMTestStatus          Implemented
+
+   @SYMTestActions         Call RApaLsSession::DeleteDataMapping() with datatype and service UID
+                           API Calls:\n
+						   RApaLsSession::DeleteDataMapping(const TDataType& aDataType, TUid aServiceUid)
+
+   @SYMTestExpectedResults DeleteDataMapping() causes Main Panic KERN-EXEC 0
+*/
+void CSysStartApparcTestCase::TestDeleteDataTypeL()
+	{
+	RDebug::Print(_L("CSysStartApparcTestCase: Test RApaLsSession::DeleteDataMapping....Check data type mapping deletion"));
+
+	_LIT8(KLitPlainText,"text/plain");
+
+	TSecurityInfo info;
+	info.Set(RProcess());
+
+	//Main Panic KERN-EXEC 0
+	iApaLsSession.DeleteDataMapping(TDataType(KLitPlainText));
+ 	}
+
+
+/**
+   @SYMTestCaseID          APPFWK-APPARC-0011
+
+   @SYMPREQ                PREQ967
+
+   @SYMREQ                 REQ3889
+
+   @SYMTestCaseDesc        Test the functionality of GetServerApps with the service uid as parameter.
+
+   @SYMTestPriority        High
+
+   @SYMTestStatus          Implemented
+
+   @SYMTestActions         Call RApaLsSession::GetServerApps() with a service uid that
+   						   is not provided by any application
+                           API Calls:\n
+						   RApaLsSession::GetServerApps(TUid aServiceUid) const
+
+   @SYMTestExpectedResults GetServerApps() causes Main Panic KERN-EXEC 0
+
+*/
+void CSysStartApparcTestCase::TestServiceDiscovery()
+	{
+	RDebug::Print(_L("CSysStartApparcTestCase: Test RApaLsSession::GetServerApps....check the service uid"));
+
+	TApaAppInfo appInfo;
+
+	// Uid is not provided by any application
+	const TUid KUidNonProvidedService = {0x01020300}; // service Uid
+
+	//Main Panic KERN-EXEC 0
+	iApaLsSession.GetServerApps(KUidNonProvidedService);
+
+	}
+
+
+/**
+   @SYMTestCaseID          APPFWK-APPARC-0012
+
+   @SYMPREQ                PREQ967
+
+   @SYMREQ                 REQ3889
+
+   @SYMTestCaseDesc        Test the functionality of GetAppInfo with a Uid as a parameter
+
+   @SYMTestPriority        High
+
+   @SYMTestStatus          Implemented
+
+   @SYMTestActions         Call RApaLsSession::GetAppInfo() with a Uid that
+   						   represents a non-existing app
+
+                           API Calls:\n
+						   RApaLsSession::GetAppInfo(TApaAppInfo& aInfo,TUid aAppUid) const
+
+   @SYMTestExpectedResults GetAppInfo() causes Main Panic KERN-EXEC 0
+
+*/
+void CSysStartApparcTestCase::TestGetAppInfo()
+	{
+	RDebug::Print(_L("CSysStartApparcTestCase: Test RApaLsSession::GetAppInfo....check the app uid"));
+
+	TApaAppInfo info;
+
+	// non-existing app  causes Main Panic KERN-EXEC 0
+	iApaLsSession.GetAppInfo(info, KNullUid);
+
+	}
+
+
+/**
+   @SYMTestCaseID          APPFWK-APPARC-0013
+
+   @SYMPREQ                PREQ967
+
+   @SYMREQ                 REQ3889
+
+   @SYMTestCaseDesc        Test the functionality of AppCount
+
+   @SYMTestPriority        High
+
+   @SYMTestStatus          Implemented
+
+   @SYMTestActions         Call RApaLsSession::AppCount()
+
+
+   @SYMTestExpectedResults AppCount() causes Main Panic KERN-EXEC 0
+
+*/
+void CSysStartApparcTestCase::TestAppCount()
+	{
+	RDebug::Print(_L("CSysStartApparcTestCase: Test RApaLsSession::AppCount()....check list of apps"));
+
+	TInt dummyArg;
+
+	// Main Panic KERN-EXEC 0
+	iApaLsSession.AppCount(dummyArg);
+
+	}
+
+
+/**
+   @SYMTestCaseID           APPFWK-APPARC-0014
+
+   @SYMPREQ                 PREQ967
+
+   @SYMREQ                  REQ3889
+
+   @SYMTestCaseDesc         Test the functionality of CreateDocument with a Uid as a parameter
+
+   @SYMTestPriority         High
+
+   @SYMTestStatus           Implemented
+
+   @SYMTestActions          Call RApaLsSession::CreateDocument() with a Uid of an application
+   						    When Application specified exists.
+
+                            API Calls:\n
+						    RApaLsSession::CreateDocument(const TDesC& aFileName, TUid aAppUid, TThreadId& aThreadId, TLaunchType aLaunchType)
+
+   @SYMTestExpectedResults (1) GetAppInfo() causes Main Panic KERN-EXEC 0
+
+*/
+void CSysStartApparcTestCase::TestCreateDoc()
+	{
+	RDebug::Print(_L("CSysStartApparcTestCase: Test RApaLsSession::CreateDocument....check the app uid"));
+
+	// Set filename location
+	TPtrC apparcTestFilename(KLitTRApaLsSessionStartAppTest);
+
+  	TThreadId startAppThreadID;
+
+	//Call to tested function with a existing uid (tstapp)  causes Main Panic KERN-EXEC 0
+	iApaLsSession.CreateDocument(apparcTestFilename, KUidTestApp, startAppThreadID);
+	}
+
+/**
+Reads the input config file created by sysstart_apparc_setup.bat and returns the
+test case number (Defined in sysstart_apparc_run.bat)
+@return TInt - the test case number
+*/
+TInt CSysStartApparcTestCase::ReadConfigFileL()
+	{
+	RFs	fs;
+ 	User::LeaveIfError(fs.Connect());
+ 	CleanupClosePushL(fs);
+
+ 	RFileReadStream reader;
+	User::LeaveIfError(reader.Open(fs, KApparcConfigFile, EFileRead));
+	CleanupClosePushL(reader);
+
+	TChar delimChar('=');
+
+	TBuf8<255> aDes;
+	reader.ReadL(aDes, delimChar);
+
+	//Read in a two character representation of a number and convert to an integer
+	TChar result1(reader.ReadInt8L());
+	TChar result0(reader.ReadInt8L());
+	TInt aTestCase = result1.GetNumericValue()*10 + result0.GetNumericValue();
+
+	// clean-up
+	CleanupStack::PopAndDestroy(2, &fs);
+
+	return aTestCase;
+
+	}
+
+/**
+  Write the results to the result file, to be later extracted by
+  testexecute test case.
+  These contain the results of the individual tests. The order in
+  which these results are written in MUST match the order in which
+  they are read and tested in CSysStartApparcTestStep::GetApparcResultsL()
+  and the expected result tested in CSysStartApparcTestStep::Testxxx must
+  match that in the test specification\n
+
+  The format is:
+  StartApp1LRes1 count=value1
+  StartApp1LRes2 count=value2
+
+  '=' is used as the deliminator.
+*/
+void CSysStartApparcTestCase::WriteResultFileL()
+	{
+	RFs	fs;
+ 	User::LeaveIfError(fs.Connect());
+ 	CleanupClosePushL(fs);
+
+	RFileWriteStream writer;
+	User::LeaveIfError(writer.Replace(fs, KSsaacResultFile, EFileWrite));
+	CleanupClosePushL(writer);
+
+	// write data to file
+	writer << _L("StartApp1LRes1 count=");
+	writer.WriteInt16L(iStartApp1LRes1);
+	writer << _L("\n");
+	writer << _L("StartApp1LRes2 count=");
+	writer.WriteInt16L(iStartApp1LRes2);
+	writer << _L("\n");
+
+	writer.CommitL();
+	CleanupStack::PopAndDestroy(2, &fs);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tssaac/SysStartApparcTestCases.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,86 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#if (!defined __T_SYSSTARTAPPARCTESTCASES_H__)
+#define __T_SYSSTARTAPPARCTESTCASES_H__
+
+#include <apgcli.h>
+
+/**
+  Literals which determine:
+  1. CApparcFuncInSystart - message logged if a panic occurs in a test case
+  2. z:\\apparctest\\TestCaseConfig.txt - Input configuration file which determines
+     which test case will be run.
+
+*/
+_LIT(KApparcFuncInSystartPanic, "CApparcFuncInSystart");
+_LIT(KApparcConfigFile, "z:\\apparctest\\TestCaseConfig.txt");
+
+enum TSystartPanic
+	{
+	ESystartRApaLsSessionErr=10,
+	ESystartRunTestCaseErr,
+	ESystartWriteResultsErr,
+	ESystartRFsErr,
+	ESystartFindFileErr
+	};
+
+
+/**
+  Class containing the apparc test cases
+*/
+class CSysStartApparcTestCase : public CBase
+	{
+public:
+	CSysStartApparcTestCase();
+	~CSysStartApparcTestCase();
+	void doTestCasesL();
+
+private:
+	void RunTestCasesL();
+	void TestStartApp1L();
+	void TestStartApp2L();
+	void TestStartApp3L();
+	void TestStartApp4L();
+	void TestStartApp5L();
+	void TestStartApp6L();
+	void TestGetAllApps();
+	void TestInsertDataTypeL();
+	void TestAppForDataTypeL();
+	void TestDeleteDataTypeL();
+	void TestServiceDiscovery();
+	void TestGetAppInfo();
+	void TestAppCount();
+	void TestCreateDoc();
+
+	void WriteResultFileL();
+	TInt ReadConfigFileL();
+
+private:
+	TInt iStartApp1LRes1;
+	TInt iStartApp1LRes2;
+
+	RApaLsSession iApaLsSession;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tssaac/scripts/emulator/sysstart_apparc_checkEpocWind.bat	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,66 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of the License "Symbian Foundation License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description:
+@rem
+@echo off
+setlocal
+
+set SSAAC_RESULT_FILE=\epoc32\winscw\c\T_SSAAC_PanicResultFile.txt
+
+set TEST_CASE=%1
+set EPOCWIND=%TEMP%\epocwind.out
+
+goto :%TEST_CASE%
+
+:checkLog
+	:: checkLog SEARCH_STRING EXPECTED_NUMBER_OF_OCCURENCES
+	set SEARCH_STRING=%1
+	set TEMP_FILE=sysstart_temp.txt
+	set EXPECTED_COUNT=%2
+	set LOG_COUNT=0
+	type %EPOCWIND% | %windir%\system32\find /c %SEARCH_STRING%>%TEMP_FILE%
+	for /f "delims=\" %%i in ('type %TEMP_FILE%') do set LOG_COUNT=%%i
+	del %TEMP_FILE%
+	if "%EXPECTED_COUNT%" ==  "%LOG_COUNT%" goto :EOF
+	if "%EXPECTED_COUNT%" NEQ "%LOG_COUNT%" set TEST_RESULT_FLAG=false
+goto :EOF
+
+:initialise
+	if exist %SSAAC_RESULT_FILE% del %SSAAC_RESULT_FILE%
+	set TEST_RESULT_FLAG=true
+goto :EOF
+
+
+:T_TestStartApp2L       
+:T_TestStartApp3L       
+:T_TestStartApp4L	  
+:T_TestStartApp5L       
+:T_TestStartApp6L            
+:T_TestInsertDataTypeL  
+:T_TestAppForDataTypeL  
+:T_TestDeleteDataTypeL  
+:T_TestServiceDiscovery 
+:T_TestGetAppInfo       
+:T_TestGetAllApps       
+:T_TestCreateDoc 
+:T_TestAppCount
+	call :initialise
+	call :checkLog "CSysStartApparcTestCase: Error connecting to RApaLsSession (err=-1)" 1
+	call :checkLog "Thread tssaac.exe::Main Panic KERN-EXEC 0" 1
+	echo Test Case=%TEST_CASE% > %SSAAC_RESULT_FILE%	
+	if /i "%TEST_RESULT_FLAG%"=="true" echo Result=1 >> %SSAAC_RESULT_FILE%
+	if /i "%TEST_RESULT_FLAG%"=="false" echo Result=0 >> %SSAAC_RESULT_FILE%
+goto :EOF
+
+endlocal
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tssaac/scripts/emulator/sysstart_apparc_run.bat	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,80 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of the License "Symbian Foundation License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description:
+@rem
+@echo off
+setlocal
+
+set SYSSTART_APPARCTEST_SUMMARY=\epoc32\winscw\c\logs\testexecute\sysstart_apparctest_summary.txt
+if exist %SYSSTART_APPARCTEST_SUMMARY% del %SYSSTART_APPARCTEST_SUMMARY%
+
+goto :skipFunctions
+
+:test
+	set TEST_CASE=%1
+	set TESTCASE_NUMBER=%2
+	set EPOCWIND_COPY=\epoc32\winscw\c\logs\testexecute\apparctest_%TEST_CASE%_epocwind.out
+	set EPOCWIND_ORIG=%TEMP%\epocwind.out
+
+	call z\apparctest\sysstart_apparc_setup.bat install   %TEST_CASE% %TESTCASE_NUMBER%
+
+	echo testexecute.exe z:\apparctest\apparctest_%TEST_CASE%.script
+	testexecute.exe z:\apparctest\apparctest_%TEST_CASE%.script
+
+	call z\apparctest\sysstart_apparc_setup.bat uninstall %TEST_CASE% 
+
+	copy %EPOCWIND_ORIG% %EPOCWIND_COPY% >NUL
+	call :updateTestSummary
+goto :EOF
+
+:checkLog
+	:: checkLog SEARCH_FILE SEARCH_STRING EXPECTED_NUMBER_OF_OCCURENCES
+	set SEARCH_FILE=%1
+	set SEARCH_STRING=%2
+	set TEMP_FILE=sysstart_temp.txt
+	set EXPECTED_COUNT=%3
+	set LOG_COUNT=0
+	type %SEARCH_FILE% | find /c %SEARCH_STRING%>%TEMP_FILE%
+	for /f "delims=\" %%i in ('type %TEMP_FILE%') do set LOG_COUNT=%%i
+	del %TEMP_FILE%
+	if "%EXPECTED_COUNT%" ==  "%LOG_COUNT%" goto :EOF
+	if "%EXPECTED_COUNT%" NEQ "%LOG_COUNT%" set TEST_RESULT_FLAG=FAIL
+goto :EOF
+
+:updateTestSummary
+	set TEST_RESULT_FLAG=PASS
+	call :checkLog \epoc32\winscw\c\logs\testexecute\apparctest_%TEST_CASE%.htm "%TEST_CASE% ***Result = PASS" 1
+	echo %TEST_CASE% - %TEST_RESULT_FLAG% >> %SYSSTART_APPARCTEST_SUMMARY%
+goto :EOF
+
+:skipFunctions 
+    
+:: SysStart Apparc Function call tests
+call :test T_TestStartApp1L		01  
+call :test T_TestStartApp2L		02        
+call :test T_TestStartApp3L		03     
+call :test T_TestStartApp4L		04	   
+call :test T_TestStartApp5L		05     
+call :test T_TestStartApp6L		06     
+call :test T_TestGetAllApps		07     
+call :test T_TestInsertDataTypeL	08
+call :test T_TestAppForDataTypeL	09 
+call :test T_TestDeleteDataTypeL	10 
+call :test T_TestServiceDiscovery	11  
+call :test T_TestGetAppInfo     	12
+call :test T_TestAppCount	    	13
+call :test T_TestCreateDoc      	14
+call :test T_TestLocalisedCaptionL	29
+
+endlocal
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tssaac/scripts/emulator/sysstart_apparc_setup.bat	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,91 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of the License "Symbian Foundation License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description:
+@rem
+@echo off
+setlocal
+
+:: Initialise local variables
+set COMMAND_CHOICE=%1
+set RSC_LOCATION=Z\private\10205C44
+set TEST_CASE=%2
+set TESTCASE_NUMBER=%3
+set TEST_RSC=%RSC_LOCATION%\tssaac_emulator.RSC
+set TEST_EXE_RSC=%RSC_LOCATION%\tssaac_tapp_emulator.RSC
+set SM0_RSC=%RSC_LOCATION%\SSCForStartupMode0.RSC
+
+set TESTCASE_CONFIG=z\apparctest\TestCaseConfig.txt
+set EPOCWIND=%TEMP%\epocwind.out
+set TESTNONPANIC_RESULT_FILE=\epoc32\winscw\c\SysStartApparc_TestNonPanic.txt
+
+goto :%COMMAND_CHOICE%
+
+:install
+	if not exist "%TEST_RSC%" echo SysStart Test: ERROR - test resource file does not exist & goto :EOF
+	if not exist "%TEST_EXE_RSC%" echo SysStart Test: ERROR - test resource file does not exist & goto :EOF
+
+	if not exist %SM0_RSC%.original copy %SM0_RSC% %SM0_RSC%.original > NUL
+	
+	if /i "%TEST_CASE%" NEQ "T_TestLocalisedCaptionL" copy %TEST_RSC% %SM0_RSC% > NUL
+	if /i "%TEST_CASE%" == "T_TestLocalisedCaptionL" copy %TEST_EXE_RSC% %SM0_RSC% > NUL
+	
+	if exist %TESTCASE_CONFIG% del %TESTCASE_CONFIG%
+	if exist %TESTNONPANIC_RESULT_FILE% del %TESTNONPANIC_RESULT_FILE%
+
+	echo Test Case %TEST_CASE%=%TESTCASE_NUMBER% > %TESTCASE_CONFIG%
+
+goto :EOF
+
+:uninstall
+	call :restore	
+	:: TestStartApp1L and TestLocalisedCaptionL are the only non-paniccing test cases
+	if /i "%TEST_CASE%" == "T_TestStartApp1L" goto :bypass
+	if /i "%TEST_CASE%" == "T_TestLocalisedCaptionL" goto :bypass
+	call :test
+	:bypass
+	if exist %EPOCROOT%epoc32\winscw\c\T_SSAAC_PanicResultFile.txt del %EPOCROOT%epoc32\winscw\c\T_SSAAC_PanicResultFile.txt
+goto :EOF
+
+:execTimeOut
+	set TIMEOUT=300
+	\ExecTimeOut.exe "testexecute.exe z:\apparctest\apparctest_%TEST_CASE%.script" %TIMEOUT%
+goto :EOF
+
+:testExecute
+	testexecute.exe z:\apparctest\apparctest_%TEST_CASE%.script
+goto :EOF
+
+:test
+	call z\apparctest\sysstart_apparc_checkEpocWind.bat %TEST_CASE%
+
+	if exist %TEMP%\epocwind.out copy %TEMP%\epocwind.out %TEMP%\epocwind.out.temp > NUL
+
+	:: If using SYMBIAN overnight DABS test scripts, then utilise ExecTimeOut to ensure
+	:: execution does not exceed expected execution time.
+	if exist \ExecTimeOut.exe call :execTimeOut
+
+	:: If simply executing manually, then call testexecute directly.
+	if not exist \ExecTimeOut.exe call :testExecute
+
+	if exist %TEMP%\epocwind.out.temp copy %TEMP%\epocwind.out.temp %TEMP%\epocwind.out > NUL
+	if exist %TEMP%\epocwind.out.temp del %TEMP%\epocwind.out.temp
+goto :EOF
+
+:restore
+	if exist %SM0_RSC%.original copy %SM0_RSC%.original %SM0_RSC% > NUL
+	if exist %SM0_RSC%.original del %SM0_RSC%.original
+goto :EOF
+
+endlocal
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tssaac/scripts/hardware/sysstart_apparc_buildrom.bat	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,197 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of the License "Symbian Foundation License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description:
+@rem
+@echo off
+setlocal
+
+:: Initialise local variables
+set TEST_CASE=%1
+set TESTCASE_NUMBER=%2
+
+set RSC_LOCATION=\epoc32\data\Z\private\10205C44
+set TEST_RSC=%RSC_LOCATION%\tssaac_hardware.RSC
+set SM0_RSC=%RSC_LOCATION%\SSCForStartupMode0_target.RSC
+
+set TEST_ROM_FLAG=false
+if /i "%3"=="TEST_ROM_ONLY" set TEST_ROM_FLAG=true
+
+if /i "%TEST_ROM_FLAG%"=="true" set TEST_RSC=%RSC_LOCATION%\appfwk_sysstart_test_eshell_hardware.RSC
+
+call :%TEST_CASE%
+
+set AUTOEXEC=autoexec.bat
+set AUTOEXEC_LOC=\epoc32\data\z\apparctest\%AUTOEXEC%
+
+set APPARCTEST_IBY=\epoc32\rom\include\apparctest.iby
+
+set EPOCWIND=%TEMP%\epocwind.out
+
+set SSAAC_RESULT_FILE=\epoc32\data\z\apparctest\T_SSAAC_PanicResultFile.txt
+set TESTCASE_CONFIG=\epoc32\data\z\apparctest\TestCaseConfig.txt
+
+set DABS_SCRIPT=\logs\autorom\TESTEXECUTEapparctest_%TEST_CASE%.script.txt
+
+set DABS_FLAG=%4
+
+set HARDWARE_REFERENCE_PLATFORM=%5
+
+goto :skipFunctions
+
+:restore
+	cd\
+	if exist %APPARCTEST_IBY%.original copy %APPARCTEST_IBY%.original %APPARCTEST_IBY% > NUL
+	if exist %APPARCTEST_IBY%.original del %APPARCTEST_IBY%.original >NUL
+
+	if exist %SM0_RSC%.original copy %SM0_RSC%.original %SM0_RSC% > NUL
+	if exist %SM0_RSC%.original del %SM0_RSC%.original 
+
+	if exist %TESTCASE_CONFIG% del %TESTCASE_CONFIG% >NUL
+	
+	if exist %DABS_SCRIPT% del %DABS_SCRIPT% >NUL
+	if exist %AUTOEXEC_LOC% del %AUTOEXEC_LOC% >NUL
+goto :EOF
+
+:configure
+	if not exist %SM0_RSC%.original copy %SM0_RSC% %SM0_RSC%.original > NUL
+	copy %TEST_RSC% %SM0_RSC% > NUL
+
+	if not exist %APPARCTEST_IBY%.original copy %APPARCTEST_IBY% %APPARCTEST_IBY%.original > NUL
+
+	echo Test Case %TEST_CASE%=%TESTCASE_NUMBER% > %TESTCASE_CONFIG%
+	echo data=DATAZ_\apparctest\TestCaseConfig.txt  \apparctest\TestCaseConfig.txt >> %APPARCTEST_IBY%
+	echo data=DATAZ_\apparctest\%AUTOEXEC% \%AUTOEXEC% >> %APPARCTEST_IBY%
+
+	if exist %SSAAC_RESULT_FILE% echo copy z:\apparctest\T_SSAAC_PanicResultFile.txt c:\ >> %AUTOEXEC_LOC%
+
+	if /i "%DABS_FLAG%"=="true" call :configureDabs & goto :EOF
+
+	echo copy z:\apparctest\TestCaseConfig.txt c:\ >>  %AUTOEXEC_LOC%
+	echo testexecute z:\apparctest\apparctest_%TEST_CASE%.script >> %AUTOEXEC_LOC%
+	echo md e:\logs >> %AUTOEXEC_LOC%
+	echo md e:\logs\testexecute >> %AUTOEXEC_LOC%
+	echo copy c:\logs\testexecute\apparctest_%TEST_CASE%.htm e:\logs\testexecute\ >> %AUTOEXEC_LOC%
+goto :EOF
+
+:configureDabs 
+	echo testexecute z:\apparctest\apparctest_%TEST_CASE%.script >> %DABS_SCRIPT% 
+	echo thindump -nop c:\logs\testexecute\apparctest_%TEST_CASE%.htm >> %DABS_SCRIPT% 
+
+	echo #include ^<thindump.iby^> >> %APPARCTEST_IBY%
+	echo data=\logs\autorom\TESTEXECUTEapparctest_%TEST_CASE%.script.txt   \test\TESTEXECUTEapparctest_%TEST_CASE%.script.txt >> %APPARCTEST_IBY%
+	echo data=\logs\autorom\dummytest.txt   \test\dummytest.txt >> %APPARCTEST_IBY%
+
+	echo md c:\logs >> %AUTOEXEC_LOC%
+	echo md c:\logs\testresults >> %AUTOEXEC_LOC%
+	echo md c:\system >> %AUTOEXEC_LOC%
+	echo md c:\system\data >> %AUTOEXEC_LOC%
+	echo z: >> %AUTOEXEC_LOC%
+	echo cd test >> %AUTOEXEC_LOC%
+	echo RUNTESTS TESTEXECUTEapparctest_%TEST_CASE%.script.txt -t 13 >> %AUTOEXEC_LOC%
+	if "%TEST_ROM_FLAG%"=="false" echo format k: >> %AUTOEXEC_LOC%
+	if "%TEST_ROM_FLAG%"=="true" echo c: >> %AUTOEXEC_LOC%
+	if "%TEST_ROM_FLAG%"=="true" echo attrib -r >> %AUTOEXEC_LOC%
+	if "%TEST_ROM_FLAG%"=="true" echo del c:\*.txt >> %AUTOEXEC_LOC%
+	if "%TEST_ROM_FLAG%"=="true" echo z: >> %AUTOEXEC_LOC%
+	echo RUNTESTS dummytest.txt -p >> %AUTOEXEC_LOC%
+goto :EOF
+
+:zipRom
+	if exist rombld.img call zip sys$rom.zip rombld.img > NUL
+	if exist rombld.symbol call zip symbol.zip rombld.symbol > NUL
+	if exist rombld.img echo ROM built: \rom\%TEST_CASE%\sys$rom.zip
+	if not exist sys$rom.zip echo ERROR: ROM failed to build.
+goto :EOF
+
+:addSsaacResultFile
+	echo data=DATAZ_\apparctest\T_SSAAC_PanicResultFile.txt  \apparctest\T_SSAAC_PanicResultFile.txt >> %APPARCTEST_IBY%
+goto :EOF
+
+:buildTestRom
+	cd\
+	if exist \rom\%TEST_CASE%\testrom rd /s/q \rom\%TEST_CASE%\testrom
+	md \rom\%TEST_CASE%\testrom
+	cd \rom\%TEST_CASE%\testrom
+ 
+	echo Building Test ROM for SysStart Apparc test case: %TEST_CASE%
+	if exist %SSAAC_RESULT_FILE% call :addSsaacResultFile
+
+	call buildrom -D_FULL_DEBUG -D_LFFSC %HARDWARE_REFERENCE_PLATFORM% techview.oby platsec.oby appfwk_test.iby -orombld.img> NUL
+	call :zipRom
+
+	if exist %SSAAC_RESULT_FILE% del %SSAAC_RESULT_FILE% >NUL
+
+	copy %AUTOEXEC_LOC% \rom\%TEST_CASE%\testrom
+goto :EOF
+
+:build
+	if not exist %TEST_RSC% echo SysStart Apparc Test: ERROR - test resource file does not exist & goto :EOF
+
+	call :restore
+	call :configure
+
+	if "%TEST_ROM_FLAG%"=="false" call :buildRom
+	if "%TEST_ROM_FLAG%"=="true"  call :buildTestRom
+
+	call :restore
+goto :EOF
+
+:buildRom
+	set LFFSC_FLAG=
+	if /i "%TEST_FLAG%"=="checkEpocWind" set LFFSC_FLAG=-D_LFFSC
+
+	if exist \rom\%TEST_CASE% rd /s/q \rom\%TEST_CASE%
+
+	cd\
+	md \rom\%TEST_CASE%
+	cd \rom\%TEST_CASE%
+	if /i "%TEST_FLAG%"=="checkEpocWind" md \rom\%TEST_CASE%\TEST_ROM_REQUIRED
+
+	echo Building ROM for SysStart Apparc test case: %TEST_CASE%
+	call buildrom -D_FULL_DEBUG %LFFSC_FLAG% %HARDWARE_REFERENCE_PLATFORM% techview.oby platsec.oby appfwk_test.iby -orombld.img> rombuild.txt
+	call :zipRom
+	copy %AUTOEXEC_LOC% \rom\%TEST_CASE%
+	echo %HARDWARE_REFERENCE_PLATFORM% UIF-Techview Apparc - %TEST_CASE% > rom_desc.txt
+goto :EOF
+
+:T_TestStartApp1L
+	set TEST_FLAG=
+goto :EOF
+
+:T_TestLocalisedCaptionL
+	set TEST_FLAG=
+	set TEST_RSC=%RSC_LOCATION%\tssaac_tapp_hardware.RSC
+goto :EOF
+
+:T_TestStartApp2L		
+:T_TestStartApp3L		
+:T_TestStartApp4L		
+:T_TestStartApp5L		
+:T_TestStartApp6L		
+:T_TestGetAllApps		
+:T_TestInsertDataTypeL	
+:T_TestAppForDataTypeL	
+:T_TestDeleteDataTypeL	
+:T_TestServiceDiscovery	
+:T_TestGetAppInfo     	
+:T_TestAppCount	    	
+:T_TestCreateDoc
+	set TEST_FLAG=checkEpocWind
+goto :EOF
+      
+:skipFunctions
+
+call :build
+
+endlocal
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tssaac/scripts/hardware/sysstart_apparc_checkEpocWind.bat	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,73 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of the License "Symbian Foundation License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description:
+@rem
+@echo off
+setlocal
+
+set TEST_CASE=%1
+set EPOCWIND=\epoc32\data\z\apparctest\logs\%TEST_CASE%.log
+
+set DABS_FLAG=%2
+
+set HARDWARE_REFERENCE_PLATFORM=%3
+
+goto :skipFunctions
+
+:checkLog
+	:: checkLog SEARCH_STRING EXPECTED_NUMBER_OF_OCCURENCES
+	set SEARCH_STRING=%1
+	set TEMP_FILE=sysstart_temp.txt
+	set EXPECTED_COUNT=%2
+	set LOG_COUNT=0
+	type %EPOCWIND% | find /c %SEARCH_STRING%>%TEMP_FILE%
+	for /f "delims=\" %%i in ('type %TEMP_FILE%') do set LOG_COUNT=%%i
+	del %TEMP_FILE%
+	if "%EXPECTED_COUNT%" ==  "%LOG_COUNT%" goto :EOF
+	if "%EXPECTED_COUNT%" NEQ "%LOG_COUNT%" set TEST_RESULT_FLAG=false
+goto :EOF
+
+:initialise
+	set SSAAC_RESULT_FILE=\epoc32\data\z\apparctest\T_SSAAC_PanicResultFile.txt
+	if exist %SSAAC_RESULT_FILE% del %SSAAC_RESULT_FILE% >NUL
+	set TEST_RESULT_FLAG=true
+goto :EOF
+
+:T_TestStartApp2L       
+:T_TestStartApp3L       
+:T_TestStartApp4L	  
+:T_TestStartApp5L       
+:T_TestStartApp6L            
+:T_TestInsertDataTypeL  
+:T_TestAppForDataTypeL  
+:T_TestDeleteDataTypeL  
+:T_TestServiceDiscovery 
+:T_TestGetAppInfo       
+:T_TestGetAllApps       
+:T_TestCreateDoc 
+:T_TestAppCount
+	call :initialise
+	call :checkLog "CSysStartApparcTestCase: Error connecting to RApaLsSession (err=-1)" 1
+	call :checkLog "Thread tssaac.exe::Main Panic KERN-EXEC 0" 1
+	echo Test Case=%TEST_CASE% > %SSAAC_RESULT_FILE%	
+	if /i "%TEST_RESULT_FLAG%"=="true" echo Result=1 >> %SSAAC_RESULT_FILE%
+	if /i "%TEST_RESULT_FLAG%"=="false" echo Result=0 >> %SSAAC_RESULT_FILE%
+goto :EOF
+
+:skipFunctions
+
+call :%TEST_CASE%
+call \epoc32\data\z\apparctest\sysstart_apparc_buildrom.bat %TEST_CASE% 00 TEST_ROM_ONLY %DABS_FLAG% %HARDWARE_REFERENCE_PLATFORM%
+
+endlocal
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tssaac/scripts/hardware/sysstart_apparc_insertlog.pl	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,52 @@
+# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of the License "Symbian Foundation License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+# Used within automated overnight testing system to insert results
+# of sysstart tests on hardware in test summary log.
+# 
+#
+
+use strict;
+
+my $file=@ARGV[0];
+my $fromString=@ARGV[1];
+my $insertString1=@ARGV[2];
+my $insertString2=@ARGV[3];
+
+my $outfile;
+
+if (not open (INFILE, "< $file"))
+	{
+	die "WARNING: insert.pl: Can't open $file";
+	}
+
+while (my $line = <INFILE>)
+	{
+	if ($line =~ /$fromString/)
+		{
+		$outfile .= $line;
+		$outfile .= $insertString1;
+		$outfile .= "\n";
+		$outfile .= $insertString2;
+		$outfile .= "\n";
+		}
+	else
+		{
+		$outfile .= $line;
+		}
+	}
+close(INFILE);
+
+open (OUTFILE, "> $file");
+print OUTFILE $outfile;
+close(OUTFILE);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tssaac/scripts/hardware/sysstart_apparc_run.bat	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,294 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of the License "Symbian Foundation License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description:
+@rem
+@echo off
+setlocal
+
+call :initialise %1 %2
+if /i "%INPUT_ERROR%"=="true" goto :EOF
+
+call :test T_TestStartApp1L		01  
+
+:: if automation is not supported, then don't bother attempting to run
+:: the remaining test cases.
+if /i "%TEST_MANUAL_FLAG%"=="false" (if /i "%AUTOMATED_FLAG%"=="false" goto :EOF) 
+      
+call :test T_TestStartApp2L		02        
+call :test T_TestStartApp3L		03     
+call :test T_TestStartApp4L		04	   
+call :test T_TestStartApp5L		05     
+call :test T_TestStartApp6L		06     
+call :test T_TestGetAllApps		07     
+call :test T_TestInsertDataTypeL	08
+call :test T_TestAppForDataTypeL	09 
+call :test T_TestDeleteDataTypeL	10 
+call :test T_TestServiceDiscovery	11  
+call :test T_TestGetAppInfo     	12
+call :test T_TestAppCount	    	13
+call :test T_TestCreateDoc      	14
+call :test T_TestLocalisedCaptionL	29
+
+goto :skipFunctions
+
+:help
+	echo.
+	echo Description:
+	echo This script runs the apparc startup test suite on the hardware
+	echo reference platform. 
+	echo.
+	echo Syntax:
+	echo %RUN_COMMAND% [choice] [hrp]
+	echo where the argument [choice] can be one of:
+	echo   "-h" or "help" - this help screen
+	echo   "manual"       - run scripts manually i.e. build auto 
+	echo                    start ROMs for each test case, but do  
+	echo                    not attempt to upload ROM
+	echo   "auto"         - run scripts in automated mode, i.e.
+	echo			requires USB download to HRP
+	echo and argument [hrp] is the hardware reference platform, e.g.
+	echo   "h2" or "h4hrp"
+	echo.
+	echo e.g.
+	echo %RUN_COMMAND% auto h4hrp
+	echo.
+goto :EOF
+
+:initialise
+	set APPFWK_COMPONENT=apparctest
+	set EPOC_Z=\epoc32\data\z
+
+	set BUILDROM_COMMAND=%EPOC_Z%\%APPFWK_COMPONENT%\sysstart_apparc_buildrom.bat
+	set CHECKEPOC_COMMAND=%EPOC_Z%\%APPFWK_COMPONENT%\sysstart_apparc_checkepocwind.bat
+	set INSERT_COMMAND=%EPOC_Z%\%APPFWK_COMPONENT%\sysstart_apparc_insertlog.pl
+	set RUN_COMMAND=%EPOC_Z%\%APPFWK_COMPONENT%\sysstart_apparc_run.bat
+
+	:: check input values
+	set INPUT_ERROR=false
+	set TEST_CHOICE=%1
+	if /i "%TEST_CHOICE%"=="-h" set INPUT_ERROR=true
+	if /i "%TEST_CHOICE%"=="help" set INPUT_ERROR=true
+	set TEST_MANUAL_FLAG=false
+	if /i "%TEST_CHOICE%"=="manual" set TEST_MANUAL_FLAG=true
+	set HARDWARE_REFERENCE_PLATFORM=%2
+	if /i "%HARDWARE_REFERENCE_PLATFORM%"=="" set INPUT_ERROR=true
+	if /i "%INPUT_ERROR%"=="true" call :help & goto :EOF
+	
+	set TEST_CASE=INIT_VALUE
+	set TEST_RSC=INIT_VALUE
+	set TEST_ROM_PORT=1
+	set TEST_CASE_TIMEOUT=60
+
+	set TEST_LOG_LOCATION=%EPOC_Z%\%APPFWK_COMPONENT%\logs
+	if not exist %TEST_LOG_LOCATION% md %TEST_LOG_LOCATION% 
+
+	set DABS_TEST_LOG_LOCATION=\logs\armv5
+
+	set TEST_LOG=%DABS_TEST_LOG_LOCATION%\%APPFWK_COMPONENT%.log
+	if exist %TEST_LOG% del %TEST_LOG%
+
+	set SUMMARY_LOG=%DABS_TEST_LOG_LOCATION%\%APPFWK_COMPONENT%_summary.txt
+	if exist %SUMMARY_LOG% del %SUMMARY_LOG% >NUL
+goto :EOF
+
+:checkForUsbDrive
+	dir %1:\ 2>&1 | find "%1:" >NUL 2>&1
+	if ERRORLEVEL 1 goto :EOF
+	if not exist %1:\usbload.zip goto :EOF
+	echo INFO: %1:\usbload.zip found!
+	set HARDWARE_USB=true
+	set HARDWARE_USB_DRIVE=%1
+goto :EOF
+
+:wait
+	echo INFO: Waiting %1 seconds
+	ping 1.1.1.1 -w 1000 -n %1 >NUL
+goto :EOF
+
+:searchForUSB
+	for %%i in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do call :checkForUsbDrive %%i
+goto :EOF
+
+:checkAutomation
+	set AUTOMATED_FLAG=false
+	set HARDWARE_USB=false
+	if not exist "\trgtest.exe"                          echo INFO: \trgtest.exe not found & goto :EOF
+	if not exist "\empty_image_file"                     echo INFO: \empty_image_file not found & goto :EOF
+	if not exist "\sync.exe"                             echo INFO: \sync.exe not found & goto :EOF
+	if not exist "\hardwareswitch.exe"                   echo INFO: \hardwareswitch.exe not found & goto :EOF
+	if not exist "\devcon.exe"                           echo INFO: \devcon.exe not found & goto :EOF
+	if not exist "\EJECTDELAY.15"                        echo INFO: \EJECTDELAY.15 not found & goto :EOF
+	if not exist "\empty_image_file"                     echo INFO: \empty_image_file not found & goto :EOF
+	if not exist "\logs\autorom\dummytest.txt"           echo INFO: \logs\autorom\dummytest.txt not found & goto :EOF
+	
+	call \devcon.exe remove "USB\Vid_0e22&Pid_1112&Rev_0305" > NUL
+
+	echo INFO: Hardware OFF
+	call \hardwareswitch.exe off > NUL
+	
+	call :wait 2
+
+	echo INFO: Hardware ON
+	call \hardwareswitch.exe on > NUL
+
+	call :wait 15
+	call :searchForUSB
+
+	if /i "%HARDWARE_USB%"=="true" goto :skipUsbSearch
+	call :wait 10 
+	call :searchForUSB
+
+	if /i "%HARDWARE_USB%"=="true" goto :skipUsbSearch
+	call :usbNotFound 
+	goto :EOF
+
+	:skipUsbSearch
+	if not exist \logs\armv5 md \logs\armv5 
+	set AUTOMATED_FLAG=true
+goto :EOF
+
+:usbNotFound
+	echo INFO: Target USB Drive not found
+	call \hardwareswitch.exe off > NUL
+goto :EOF
+
+:upLoadROm
+	echo INFO: Uploading ROM to %HARDWARE_USB_DRIVE%:
+	if exist "%HARDWARE_USB_DRIVE%:\sys$rom.zip" del %HARDWARE_USB_DRIVE%:\sys$rom.zip
+	copy %1 %HARDWARE_USB_DRIVE%:\ > NUL
+
+	del %HARDWARE_USB_DRIVE%:\EJECTDELAY.*
+	copy \EJECTDELAY.15 %HARDWARE_USB_DRIVE%:\ > NUL
+
+	echo INFO: Checking %HARDWARE_USB_DRIVE%:
+	chkdsk %HARDWARE_USB_DRIVE%: > NUL
+
+	echo INFO: Ejecting %HARDWARE_USB_DRIVE%:
+	\sync.exe -r -e %HARDWARE_USB_DRIVE%: > NUL
+	call \devcon.exe remove "USB\Vid_0e22&Pid_1112&Rev_0305" >NUL
+
+	echo INFO: Listening to COM%TEST_ROM_PORT% for test results (%TEST_CASE_TIMEOUT% seconds)
+	\trgtest.exe %TEST_ROM_PORT% \empty_image_file %TEST_CASE_LOG% %TEST_CASE_TIMEOUT%
+	echo INFO: test case log - %TEST_CASE_LOG%
+
+	call \devcon.exe remove "USB\Vid_0e22&Pid_1112&Rev_0305" > NUL
+
+	echo INFO: Hardware OFF
+	call \hardwareswitch.exe off > NUL
+	
+	call :wait 2
+goto :EOF
+
+:manualBuild
+	set AUTOMATED_FLAG=false
+	call %BUILDROM_COMMAND% %TEST_CASE% %TEST_CONFIG% ROM %AUTOMATED_FLAG%
+goto :EOF
+
+:test
+	set TEST_CASE=%1
+	set TEST_CONFIG=%2
+
+	if /i "%TEST_MANUAL_FLAG%"=="true" call :manualBuild & goto :EOF
+
+	set TEST_CASE_LOG=%TEST_LOG_LOCATION%\%TEST_CASE%.log
+	set DABS_TEST_CASE_LOG=%DABS_TEST_LOG_LOCATION%\%TEST_CASE%.log
+
+	if exist %TEST_CASE_LOG% del %TEST_CASE_LOG%
+	if exist %TEST_CASE_LOG%.original del %TEST_CASE_LOG%.original
+	if exist %DABS_TEST_CASE_LOG% del %DABS_TEST_CASE_LOG%
+	if exist %DABS_TEST_CASE_LOG%.original del %DABS_TEST_CASE_LOG%.original
+
+	call :checkAutomation
+
+	if /i "%AUTOMATED_FLAG%"=="false" echo ERROR: Automation check failed for rom >> %TEST_CASE_LOG% & goto :EOF
+
+	call %BUILDROM_COMMAND% %TEST_CASE% %TEST_CONFIG% ROM %AUTOMATED_FLAG% %HARDWARE_REFERENCE_PLATFORM%
+
+	if not exist \rom\%TEST_CASE%\sys$rom.zip echo ERROR: \rom\%TEST_CASE%\sys$rom.zip does not exist >> %TEST_CASE_LOG% & goto :logResult
+
+	call :upLoadROm \rom\%TEST_CASE%\sys$rom.zip
+
+	if not exist "\rom\%TEST_CASE%\TEST_ROM_REQUIRED" goto :logResult
+
+	call %CHECKEPOC_COMMAND% %TEST_CASE% %AUTOMATED_FLAG% %HARDWARE_REFERENCE_PLATFORM%
+
+	if not exist \rom\%TEST_CASE%\testrom\sys$rom.zip echo ERROR: \rom\%TEST_CASE%\testrom\sys$rom.zip does not exist >> %TEST_CASE_LOG% & goto :logResult
+
+	call :checkAutomation
+
+	if /i "%AUTOMATED_FLAG%"=="false" echo ERROR: Automation check failed for testrom >> %TEST_CASE_LOG% & goto :logResult
+
+	if exist %TEST_CASE_LOG% copy %TEST_CASE_LOG% %TEST_CASE_LOG%.original >NUL
+	if exist %TEST_CASE_LOG% del %TEST_CASE_LOG%
+
+	call :upLoadROm \rom\%TEST_CASE%\testrom\sys$rom.zip
+
+	:logResult
+	if not exist %TEST_CASE_LOG% echo ERROR in test execution > %TEST_CASE_LOG% 
+
+	:: add the test case log to the overall test log, which will then be split by the DABS scripts.
+	type %TEST_CASE_LOG% >> %TEST_LOG%
+
+	:: copy the test log files across for debugging test runs
+	:: NOTE: these won't be reported on the DABS html pages, but can be checked if further info is required
+	:: after a failed test case
+	copy %TEST_CASE_LOG% %DABS_TEST_CASE_LOG% > NUL
+	if exist %TEST_CASE_LOG%.original copy %TEST_CASE_LOG%.original %DABS_TEST_CASE_LOG%.original > NUL
+
+	:: DABS looks for '_epocwind.txt' extension to then include these logs as epocwind
+	:: logs, which is useful for debugging what went wrong in case of failure
+	copy %TEST_CASE_LOG% %DABS_TEST_LOG_LOCATION%\TESTEXECUTE%APPFWK_COMPONENT%_%TEST_CASE%_epocwind.txt >NUL
+	if exist %TEST_CASE_LOG%.original copy %TEST_CASE_LOG%.original %DABS_TEST_LOG_LOCATION%\TESTEXECUTE%APPFWK_COMPONENT%_%TEST_CASE%_epocwind.txt >NUL
+
+	:: insert result into DABS testlog
+	call :insertResult
+
+	call :updateTestSummary
+goto :EOF
+
+:insertResult
+	:: DABS uses this format in the testlog when building the result summary html page
+	set RUNNING_TEXT="9999-99-99=99:99:99 Running <TESTEXECUTE%APPFWK_COMPONENT%_%TEST_CASE%.script.htm> for udeb"
+	set LOCATION_TEXT="9999-99-99=99:99:99   Log location: <\logs\armv5\TESTEXECUTE%APPFWK_COMPONENT%_%TEST_CASE%.script.htm>"
+
+	set SEARCH_TEXT="Log location: <\\logs\\armv5\\TESTEXECUTEapparctest_t_StartDoc.script.htm>"
+
+	if not exist %DABS_TEST_LOG_LOCATION%\testlog.txt echo ERROR: %DABS_TEST_LOG_LOCATION%\testlog.txt does not exist & goto :EOF
+	perl %INSERT_COMMAND% %DABS_TEST_LOG_LOCATION%\testlog.txt %SEARCH_TEXT% %RUNNING_TEXT% %LOCATION_TEXT% 
+goto :EOF
+
+:checkLog
+	:: checkLog SEARCH_FILE SEARCH_STRING EXPECTED_NUMBER_OF_OCCURENCES
+	set SEARCH_FILE=%1
+	set SEARCH_STRING=%2
+	set TEMP_FILE=sysstart_temp.txt
+	set EXPECTED_COUNT=%3
+	set LOG_COUNT=0
+	type %SEARCH_FILE% | find /c %SEARCH_STRING%>%TEMP_FILE%
+	for /f "delims=\" %%i in ('type %TEMP_FILE%') do set LOG_COUNT=%%i
+	del %TEMP_FILE%
+	if "%EXPECTED_COUNT%" ==  "%LOG_COUNT%" goto :EOF
+	if "%EXPECTED_COUNT%" NEQ "%LOG_COUNT%" set TEST_RESULT_FLAG=FAIL
+goto :EOF
+
+:updateTestSummary
+	set TEST_RESULT_FLAG=PASS
+	call :checkLog %DABS_TEST_LOG_LOCATION%\%TEST_CASE%.log "%TEST_CASE% ***Result = PASS" 1
+	echo %TEST_CASE% - %TEST_RESULT_FLAG% >> %SUMMARY_LOG%
+goto :EOF
+
+:skipFunctions
+
+
+endlocal
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tssaac/tssaac.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,173 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Startup State Aware (SSA) test component used to
+// test apparc StartApp and StartDocument functionality \n
+// 
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent  Internal Symbian test code
+*/
+
+#include <e32base.h>
+#include <e32debug.h>
+#include <s32file.h>
+#include <startupdomaindefs.h>
+#include <domainmanager.h>
+#include <startup.hrh>
+
+#include "tssaac.h"
+#include "SysStartApparcTestCases.h"
+
+
+CApparcFuncInSystart* CApparcFuncInSystart::NewL(TDmHierarchyId aHierarchyId, TDmDomainId aDomainId)
+	{
+	RDebug::Print(_L("CApparcFuncInSystart::NewL - entry"));
+	CApparcFuncInSystart* self = NewLC(aHierarchyId, aDomainId);
+	CleanupStack::Pop(self);
+	RDebug::Print(_L("CApparcFuncInSystart::NewL - exit"));
+	return self;
+	}
+
+CApparcFuncInSystart* CApparcFuncInSystart::NewLC(TDmHierarchyId aHierarchyId, TDmDomainId aDomainId)
+	{
+	RDebug::Print(_L("CApparcFuncInSystart::NewLC - entry"));
+	CApparcFuncInSystart* self = new (ELeave) CApparcFuncInSystart(aHierarchyId, aDomainId);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	RDebug::Print(_L("CApparcFuncInSystart::NewLC - exit"));
+	return self;
+	}
+
+/**
+  Constructor
+*/
+CApparcFuncInSystart::CApparcFuncInSystart(TDmHierarchyId aHierarchyId, TDmDomainId aDomainId) :
+	CDmDomain(aHierarchyId, aDomainId)
+	{
+	}
+
+/**
+  Destructor
+*/
+CApparcFuncInSystart::~CApparcFuncInSystart()
+	{
+	Cancel();
+	}
+
+/**
+  Start - Register the requests
+*/
+void CApparcFuncInSystart::Start()
+	{
+	RDebug::Print(_L("CApparcFuncInSystart::Start - entry"));
+
+	__ASSERT_ALWAYS(!IsActive(), User::Panic(KApparcFuncInSystartPanic,1));
+
+	// register a request for further transition notifications
+	RDebug::Print(_L("CApparcFuncInSystart: Request Transition Notification"));
+	RequestTransitionNotification();
+	RDebug::Print(_L("CApparcFuncInSystart: Transition Acknowlege"));
+	}
+
+
+/**
+  DoCancel()
+*/
+void CApparcFuncInSystart::DoCancel()
+	{
+	}
+
+
+/**
+  RunL()
+*/
+void CApparcFuncInSystart::RunL()
+	{
+	RDebug::Print(_L("CApparcFuncInSystart::RunL - entry"));
+
+	// Check current state
+	TInt state = GetState();
+	if (state != EStartupStateCriticalDynamic)
+		{
+		RDebug::Print(_L("CApparcFuncInSystart::RunL - Initial state check failure! Current state = %d"), state);
+		User::Leave(KErrGeneral);
+		}
+
+	// Perform tests - creates a test case object used for running the apparc test cases
+	CSysStartApparcTestCase* teststep = new (ELeave) CSysStartApparcTestCase();
+	CleanupStack::PushL(teststep);
+	teststep->doTestCasesL();
+	CleanupStack::PopAndDestroy(teststep);
+
+	// Check current state
+	state = GetState();
+	if (state != EStartupStateCriticalDynamic)
+		{
+		RDebug::Print(_L("CApparcFuncInSystart::RunL - Final state check failure! Current state = %d"), state);
+		User::Leave(KErrGeneral);
+		}
+
+	// Acknowledge this state (The transition should pass)
+	AcknowledgeLastState(KErrNone);
+
+	RDebug::Print(_L("CApparcFuncInSystart::RunL - exit"));
+	}
+
+
+
+LOCAL_C void StartSystemL();
+
+GLDEF_C TInt E32Main()
+	{
+	RDebug::Print(_L("CApparcFuncInSystart::E32Main - entry"));
+	__UHEAP_MARK; // mark heap state
+
+	CTrapCleanup* TheTrapCleanup = CTrapCleanup::New();
+	TRAPD(error, StartSystemL());
+    delete TheTrapCleanup;
+
+	__UHEAP_MARKEND; // check for no memory leak
+
+	RDebug::Print(_L("CApparcFuncInSystart::E32Main - exit"));
+	return error;
+	}
+
+LOCAL_C void StartSystemL()
+	{
+	RDebug::Print(_L("CApparcFuncInSystart::StartSystemL - entry"));
+
+	//Prevent emulator closing when a panic occurs
+	User::SetJustInTime(EFalse);
+
+	CActiveScheduler* theScheduler = new (ELeave) CActiveScheduler();
+	CleanupStack::PushL(theScheduler);
+	CActiveScheduler::Install(theScheduler);
+	CApparcFuncInSystart *starter = CApparcFuncInSystart::NewLC(KDmHierarchyIdStartup, KAppServicesDomain3);
+
+	starter->Start();
+
+	CActiveScheduler::Start();
+
+	// This point should never be reached
+	User::Panic(KApparcFuncInSystartPanic,1);
+
+	CleanupStack::PopAndDestroy(2); // starter, theScheduler
+	CleanupStack::PopAndDestroy(theScheduler);
+	RDebug::Print(_L("CApparcFuncInSystart::StartSystemL - exit"));
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tssaac/tssaac.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,52 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent  Internal Symbian test code
+*/
+
+#if (!defined __TSSAAC_H__)
+#define __TSSAAC_H__
+
+#include <domainmember.h>
+
+//Write a result file for the only non-paniccing test case
+_LIT(KSsaacResultFile, "c:\\SysStartApparc_TestNonPanic.txt");
+
+
+/**
+The class registers with the Domain Manager, listens for state transitions, and performs the test object
+ro run the test cases.
+In the end, the transition is always passed.
+*/
+class CApparcFuncInSystart : public CDmDomain
+	{
+public:
+	static CApparcFuncInSystart* NewL(TDmHierarchyId aHierarchyId, TDmDomainId aDomainId);
+	static CApparcFuncInSystart* NewLC(TDmHierarchyId aHierarchyId, TDmDomainId aDomainId);
+	~CApparcFuncInSystart();
+	void Start();
+
+private:
+	CApparcFuncInSystart(TDmHierarchyId aHierarchyId, TDmDomainId aDomainId);
+	void RunL();
+	void DoCancel();
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tssaac/tssaac.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,65 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// ssaac - Startup State Aware Apparc Component
+// Startup State Aware (SSA) test component used to
+// test apparc StartApp and StartDocument functionality
+// 
+//
+
+#include <platform_paths.hrh>
+
+TARGET          tssaac.exe
+TARGETTYPE      exe
+TARGETPATH      /sys/bin
+UID             0x1000007A 0x10207F77
+VENDORID        0x70000001
+
+CAPABILITY      AllFiles WriteDeviceData
+
+#if defined(WINS)
+// startup with tssaac application for emulator
+START RESOURCE	tssaac_emulator.rss
+TARGETPATH		/private/10205C44
+END
+#else
+// startup with tssaac application for hardware
+START RESOURCE	tssaac_hardware.rss
+TARGETPATH		/private/10205C44
+END
+#endif
+
+SOURCEPATH      .
+
+SOURCE          tssaac.cpp 
+SOURCE          SysStartApparcTestCases.cpp
+
+USERINCLUDE		.
+USERINCLUDE     ../../tef
+USERINCLUDE     ../../../uiftestfw/inc
+
+SYSTEMINCLUDE   /EPOC32/INCLUDE
+SYSTEMINCLUDE   /EPOC32/INCLUDE/TEST
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY         EUSER.LIB 
+LIBRARY         EFSRV.LIB
+LIBRARY         DOMAINCLI.LIB
+LIBRARY         ESTOR.LIB
+
+LIBRARY     	APGRFX.LIB
+LIBRARY			APPARC.LIB
+LIBRARY			APPFWK_TEST_APPUI.LIB
+LIBRARY			TESTEXECUTEUTILS.LIB
+LIBRARY			APMIME.LIB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tssaac/tssaac_emulator.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,227 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Modified default resource file to test apparc functionality
+// during critical startup
+// WARNING: Any changes made to this resource file must be
+// checked against the sysstart apparc test cases listed
+// T_TestStartApp2L       
+// T_TestStartApp3L       
+// T_TestStartApp4L	  
+// T_TestStartApp5L       
+// T_TestStartApp6L       
+// T_TestStartApp7L       
+// T_TestInsertDataTypeL  
+// T_TestAppForDataTypeL  
+// T_TestDeleteDataTypeL  
+// T_TestServiceDiscovery 
+// T_TestGetAppInfo       
+// T_TestGetAllApps       
+// T_TestCreateDoc 
+// 
+//
+
+#include "startup.rh"
+
+/////////////////////////////////////////////
+// ENTRY POINT
+/////////////////////////////////////////////
+
+// THIS MUST BE THE FIRST RESOURCE. The system relies on
+// this having a resource ID of 1
+
+RESOURCE STARTUP_ENTRY_POINT r_entry_point
+	{
+	entry_point = r_startup_state_critical_static; 
+	}
+/////////////////////////////////////////////
+
+
+
+/////////////////////////////////////////////
+// CRITICAL-STATIC startup state
+/////////////////////////////////////////////
+RESOURCE STATE_INFO r_startup_state_critical_static
+	{
+	id = EStartupStateCriticalStatic;
+	name = "Critical Static";
+	command_list = r_critical_static_commands;
+	next = r_startup_state_critical_dynamic;
+	}
+
+RESOURCE COMMAND_ARRAY r_critical_static_commands
+	{
+	commands =
+		{
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\SysAgt2Svr.exe";
+			start_method = EWaitForStart;
+			no_of_retries_on_failure = 2;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\fbserv.exe";
+			start_method = EWaitForStart;
+			no_of_retries_on_failure = 1;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\wserv.exe";
+			args = "-NoShell";
+			start_method = EWaitForStart;
+			},
+			 
+		SPLASH_SCREEN
+			{
+			path = "Z:\\sys\\bin\\splash.exe";
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\eiksrvs.exe";
+			args = "-OnlyStartDependentServers";
+			start_method = EWaitForStart;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\sisregistryserver.exe";
+			start_method = EWaitForStart;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\tzserver.exe";
+			start_method = EWaitForStart;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\tssaac.exe";
+			}
+		};
+	}
+
+/////////////////////////////////////////////
+// CRITICAL-DYNAMIC startup state
+/////////////////////////////////////////////
+RESOURCE STATE_INFO r_startup_state_critical_dynamic
+	{
+	id = EStartupStateCriticalDynamic;
+	name = "Critical Dynamic";
+	command_list = r_critical_dynamic_commands;
+	next = r_startup_state_networking_critical;
+	}
+
+RESOURCE COMMAND_ARRAY r_critical_dynamic_commands
+	{
+	commands =
+		{
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\apsexe.exe";
+			start_method = EWaitForStart;  // this is the only method allowable for apsexe.exe
+			},
+		START_APP_INFO
+			{
+			path = "Z:\\sys\\bin\\shell.exe";	// Requires apparc to be properly started
+			viewless = 1;	 
+			start_method = EDeferredWaitForStart; 
+			},
+		MULTIPLE_WAIT  
+			{
+			timeout = 10000;
+			fail_on_error = EPanicOnCommandFailure;
+			},
+		SPLASH_SCREEN
+			{
+			kill = 1;
+			} 		
+		};
+	}
+
+/////////////////////////////////////////////
+// Networking-CRITICAL startup state
+/////////////////////////////////////////////
+RESOURCE STATE_INFO  r_startup_state_networking_critical
+	{
+	id = EStartupStateNetworkingCritical;   
+	name = "Networking-Critical";
+	command_list =  r_networking_critical_commands;
+	next = r_startup_state_non_critical;
+	}
+
+RESOURCE COMMAND_ARRAY r_networking_critical_commands
+	{
+	commands =
+		{
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\c32start.exe";
+  			start_method = EWaitForStart;
+  			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\msexe.exe";
+			start_method = EWaitForStart;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\watcher.exe";
+			start_method = EWaitForStart;
+			}
+		};
+	}
+
+/////////////////////////////////////////////
+// NON-CRITICAL startup state
+/////////////////////////////////////////////
+RESOURCE STATE_INFO r_startup_state_non_critical
+	{
+	id = EStartupStateNonCritical;
+	name = "Non-critical";
+	command_list = r_non_critical_commands;
+	next = 0;	// No more state transitions
+	}
+
+RESOURCE COMMAND_ARRAY r_non_critical_commands
+	{
+	commands =
+		{
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\SystemAMS.exe";
+			args = "-boot";
+			fail_on_error = EIgnoreCommandFailure;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\swidaemon.exe";
+			start_method = EWaitForStart;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\cntsrv.exe";
+			args = "-nontransient";
+			fail_on_error = 0;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\agsvexe.exe";
+			args = "-nontransient";
+			fail_on_error = 0;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\fotaagent.exe";
+			fail_on_error = EIgnoreCommandFailure;
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tssaac/tssaac_hardware.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,231 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Modified default resource file to test apparc functionality
+// during critical startup
+// WARNING: Any changes made to this resource file must be
+// checked against the sysstart apparc test cases listed
+// T_TestStartApp2L       
+// T_TestStartApp3L       
+// T_TestStartApp4L	  
+// T_TestStartApp5L       
+// T_TestStartApp6L       
+// T_TestStartApp7L       
+// T_TestInsertDataTypeL  
+// T_TestAppForDataTypeL  
+// T_TestDeleteDataTypeL  
+// T_TestServiceDiscovery 
+// T_TestGetAppInfo       
+// T_TestGetAllApps       
+// T_TestCreateDoc 
+// 
+//
+
+#include "startup.rh"
+
+/////////////////////////////////////////////
+// ENTRY POINT
+/////////////////////////////////////////////
+
+// THIS MUST BE THE FIRST RESOURCE. The system relies on
+// this having a resource ID of 1
+
+RESOURCE STARTUP_ENTRY_POINT r_entry_point
+	{
+	entry_point = r_startup_state_critical_static; 
+	}
+/////////////////////////////////////////////
+
+
+
+/////////////////////////////////////////////
+// CRITICAL-STATIC startup state
+/////////////////////////////////////////////
+RESOURCE STATE_INFO r_startup_state_critical_static
+	{
+	id = EStartupStateCriticalStatic;
+	name = "Critical Static";
+	command_list = r_critical_static_commands;
+	next = r_startup_state_critical_dynamic;
+	}
+
+RESOURCE COMMAND_ARRAY r_critical_static_commands
+	{
+	commands =
+		{
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\SysAgt2Svr.exe";
+			start_method = EWaitForStart;
+			no_of_retries_on_failure = 2;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\fbserv.exe";
+			start_method = EWaitForStart;
+			no_of_retries_on_failure = 1;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\ewsrv.exe";
+			args = "-NoShell";
+			start_method = EWaitForStart;
+			},
+		SPLASH_SCREEN
+			{
+			path = "Z:\\sys\\bin\\splash.exe";
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\eiksrvs.exe";
+			args = "-OnlyStartDependentServers";
+			start_method = EWaitForStart;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\sisregistryserver.exe";
+			start_method = EWaitForStart;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\tzserver.exe";
+			start_method = EWaitForStart;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\tssaac.exe";
+			}
+		};
+	}
+
+/////////////////////////////////////////////
+// CRITICAL-DYNAMIC startup state
+/////////////////////////////////////////////
+RESOURCE STATE_INFO r_startup_state_critical_dynamic
+	{
+	id = EStartupStateCriticalDynamic;
+	name = "Critical Dynamic";
+	command_list = r_critical_dynamic_commands;
+	next = r_startup_state_networking_critical;
+	}
+
+RESOURCE COMMAND_ARRAY r_critical_dynamic_commands
+	{
+	commands =
+		{
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\apsexe.exe";
+			start_method = EWaitForStart; // this is the only method allowable for apsexe.exe
+			},
+		START_APP_INFO
+			{
+			path = "Z:\\sys\\bin\\shell.exe";	// Requires apparc to be properly started
+			start_method = EDeferredWaitForStart;
+			viewless = 1;	 
+			},
+		MULTIPLE_WAIT  
+			{
+			timeout = 10000;
+			fail_on_error = EPanicOnCommandFailure;
+			},
+		SPLASH_SCREEN
+			{
+			kill = 1;
+			}
+		};
+	}
+
+/////////////////////////////////////////////
+// Networking-CRITICAL startup state
+/////////////////////////////////////////////
+RESOURCE STATE_INFO  r_startup_state_networking_critical
+	{
+	id = EStartupStateNetworkingCritical;   
+	name = "Networking-Critical";
+	command_list =  r_networking_critical_commands;
+	next = r_startup_state_non_critical;
+	} 
+
+RESOURCE COMMAND_ARRAY r_networking_critical_commands
+	{
+	commands =
+		{
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\c32start.exe";
+  			start_method = EWaitForStart;
+  			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\msexe.exe";
+			start_method = EWaitForStart;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\watcher.exe";
+			start_method = EWaitForStart;
+			}
+		};
+	}
+
+/////////////////////////////////////////////
+// NON-CRITICAL startup state
+/////////////////////////////////////////////
+RESOURCE STATE_INFO r_startup_state_non_critical
+	{
+	id = EStartupStateNonCritical;
+	name = "Non-critical";
+	command_list = r_non_critical_commands;
+	next = 0;	// No more state transitions
+	}
+
+RESOURCE COMMAND_ARRAY r_non_critical_commands
+	{
+	commands =
+		{
+		START_APP_INFO
+			{
+			path = "Z:\\sys\\bin\\eshell.exe";	
+			viewless = 1;	 
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\SystemAMS.exe";
+			args = "-boot";
+			fail_on_error = EIgnoreCommandFailure;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\swidaemon.exe";
+			start_method = EWaitForStart;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\cntsrv.exe";
+			args = "-nontransient";
+			fail_on_error = 0;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\agsvexe.exe";
+			args = "-nontransient";
+			fail_on_error = 0;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\fotaagent.exe";
+			fail_on_error = EIgnoreCommandFailure;
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tssaac/tssaac_tapp.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,311 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This is a Startup State Aware (SSA) test application used to
+// test apparc StartApp and StartDocument functionality.
+// 
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent  Internal Symbian test code
+*/
+
+
+#include <coeccntx.h>
+
+#include <apgtask.h>
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+
+#include <eikon.hrh>
+
+#include <tssaac_tapp.rsg>
+
+#include <eikstart.h>
+#include <s32file.h>
+#include "tssaac.h"
+#include <apacmdln.h>
+#include "appfwk_test_AppUi.h"
+#include "tstapp.h"
+
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppView
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppView : public CCoeControl
+    {
+public:
+	static CExampleAppView* NewL(const TRect& aRect);
+	CExampleAppView();
+	~CExampleAppView();
+    void ConstructL(const TRect& aRect);
+private:
+	void Draw(const TRect& /*aRect*/) const;
+private:
+	HBufC*  iExampleText;
+    };
+
+CExampleAppView::CExampleAppView()
+	{
+	}
+
+CExampleAppView* CExampleAppView::NewL(const TRect& aRect)
+	{
+	CExampleAppView* self = new(ELeave) CExampleAppView();
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect);
+	CleanupStack::Pop();
+	return self;
+	}
+
+CExampleAppView::~CExampleAppView()
+	{
+	delete iExampleText;
+	}
+
+void CExampleAppView::ConstructL(const TRect& aRect)
+    {
+    _LIT(KExampleText, "This is a Startup State Aware (SSA) test application");
+	TPtrC ptr(KExampleText);
+	iExampleText = ptr.AllocL();
+	CreateWindowL();
+	SetRect(aRect);
+	ActivateL();
+	}
+
+void CExampleAppView::Draw(const TRect& /*aRect*/) const
+	{
+	CWindowGc& gc = SystemGc();
+	TRect      drawRect = Rect();
+	const CFont*     fontUsed;
+
+	gc.Clear();
+  	fontUsed = iEikonEnv->TitleFont();
+	gc.UseFont(fontUsed);
+	TInt   baselineOffset=(drawRect.Height() - fontUsed->HeightInPixels())/2;
+	gc.DrawText(*iExampleText,drawRect,baselineOffset,CGraphicsContext::ECenter, 0);
+	gc.DiscardFont();
+	}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppUi : public CEikAppUi
+    {
+public:
+    void ConstructL();
+	~CExampleAppUi();
+private:
+	void HandleCommandL(TInt aCommand);
+private:
+	CCoeControl* iAppView;
+	};
+
+
+void CExampleAppUi::ConstructL()
+    {
+    BaseConstructL();
+	iAppView = CExampleAppView::NewL(ClientRect());
+	}
+
+CExampleAppUi::~CExampleAppUi()
+	{
+	delete iAppView;
+	}
+
+void CExampleAppUi::HandleCommandL(TInt aCommand)
+	{
+	switch (aCommand)
+		{
+	case EEikCmdExit:
+		Exit();
+		break;
+		}
+	}
+
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleDocument : public CEikDocument
+	{
+public:
+	static CExampleDocument* NewL(CEikApplication& aApp);
+	CExampleDocument(CEikApplication& aApp);
+	void ConstructL();
+private:
+	CEikAppUi* CreateAppUiL();
+	};
+
+CExampleDocument::CExampleDocument(CEikApplication& aApp)
+		: CEikDocument(aApp)
+	{
+	}
+
+CEikAppUi* CExampleDocument::CreateAppUiL()
+	{
+    return new(ELeave) CExampleAppUi;
+	}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CSysatartApparc
+//
+////////////////////////////////////////////////////////////////////////
+
+class CSysatartApparc : public CEikApplication
+	{
+private:
+	// Inherited from class CApaApplication
+	CApaDocument* CreateDocumentL();
+	void WriteResultFileL();
+	TUid AppDllUid() const;
+	//Test functions and variables
+	CApaDocument* CreateDocumentL(CApaProcess* aApaProcess);
+private:	
+	TInt iLocalizedCaptionLRes1;
+	TInt iLocalizedCaptionLRes2;
+	};
+
+const TUid KUidSSAACTestApp = { 0x10207F7A };
+
+TUid CSysatartApparc::AppDllUid() const
+	{
+	return KUidSSAACTestApp;
+	}
+
+/**
+   @SYMTestCaseID          APPFWK-APPARC-0029
+
+   @SYMPREQ                PREQ967
+
+   @SYMREQ                 REQ3889
+
+   @SYMTestCaseDesc        Test the functionality of EnsureCaptionIsLocalisedL()
+
+   @SYMTestPriority        High
+
+   @SYMTestStatus          Implemented
+
+   @SYMTestActions         Call CEikApplication::CreateDocumentL() with a local resource file argument
+   						   When Application specified exists.
+
+                           API Calls:\n
+						   CEikApplication::EnsureCaptionIsLocalisedL(TDesC&)
+
+   @SYMTestExpectedResults (1) AppCaption() returns "tssaac_tapp"
+   						   (2) AppCaption() returns "NewCaption"
+
+*/
+CApaDocument* CSysatartApparc::CreateDocumentL(CApaProcess* aApaProcess)
+	{
+	_LIT(KPath, "z:\\resource\\apps\\tssaac_tapp_loc.rsc");
+	_LIT(KCurrentCaption, "tssaac_tapp");
+	_LIT(KNewCaption, "NewCaption");
+
+	//(1) Fetch the existing name of the exe (tssaac_tapp)
+	TApaAppCaption caption = AppCaption();
+
+	iLocalizedCaptionLRes1 = caption.Compare(KCurrentCaption);
+	RDebug::Print(_L("Expected existing caption: '%S' Actual caption: '%S'"), &KCurrentCaption, &caption);
+
+	//Assign a new name to the exe from the local resource file
+	CEikApplication::EnsureCaptionIsLocalisedL(KPath);
+
+	//(2) Fetch the new name of the exe (NewCaption)
+	caption = AppCaption();
+
+	//Assign the result to the member variable
+	iLocalizedCaptionLRes2 = caption.Compare(KNewCaption);
+	RDebug::Print(_L("Expected new caption: '%S' Actual caption: '%S'"), &KNewCaption, &caption);
+
+	WriteResultFileL();
+
+	// Completes all Rendezvous' with the current process in order to notify sysstart and continue
+	//	launching the next process in the SSC list (this app is launched with EWaitForStart)
+	RProcess::Rendezvous(KErrNone);
+
+	return CEikApplication::CreateDocumentL(aApaProcess);
+	}
+
+
+CApaDocument* CSysatartApparc::CreateDocumentL()
+	{
+	return new (ELeave) CExampleDocument(*this);
+	}
+
+
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CSysatartApparc;
+	}
+
+
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication(NewApplication);
+	}
+
+/**
+  Write the results to the result file, to be later extracted by
+  testexecute test case.
+  These contain the results of the test. The order in
+  which these results are written in MUST match the order in which
+  they are read and tested in CSysStartApparcTestStep::GetApparcResultsL()
+  and the expected result tested in CSysStartApparcTestStep::Testxxx must
+  match that in the test specification\n
+
+  The format is:
+  LocalisedCaptionRes1 result=value1 		Pass = 0 Fail = non-zero
+  LocalisedCaptionRes2 result=value2 		Pass = 0 Fail = non-zero
+
+  '=' is used as the deliminator.
+*/
+void CSysatartApparc::WriteResultFileL()
+	{
+	RFs	fs;
+ 	User::LeaveIfError(fs.Connect());
+ 	CleanupClosePushL(fs);
+
+	RFileWriteStream writer;
+	User::LeaveIfError(writer.Replace(fs, KSsaacResultFile, EFileWrite));
+	CleanupClosePushL(writer);
+
+	// write data to file
+	writer << _L("LocalizedCaptionRes1 count=");
+	writer.WriteInt16L(iLocalizedCaptionLRes1);
+	writer << _L("\n");
+	writer << _L("LocalizedCaptionRes2 count=");
+	writer.WriteInt16L(iLocalizedCaptionLRes2);
+	writer << _L("\n");
+	writer.CommitL();
+	
+	CleanupStack::PopAndDestroy(2, &fs);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tssaac/tssaac_tapp.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,84 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent  Internal Symbian test code
+*/
+
+#include <platform_paths.hrh>
+
+target			tssaac_tapp.exe
+TARGETTYPE 		exe
+targetpath		/sys/bin
+UID           	0x100039CE 0x10207F7A
+VENDORID 		0x70000001
+CAPABILITY 		none
+
+#if defined(WINS)
+// startup with tssaac application for emulator
+START RESOURCE	tssaac_tapp_emulator.rss
+TARGETPATH		/private/10205C44
+END
+#else
+// startup with tssaac application for hardware
+START RESOURCE	tssaac_tapp_hardware.rss
+TARGETPATH		/private/10205C44
+END
+#endif
+
+SOURCEPATH    	.
+SOURCE			tssaac_tapp.cpp
+
+USERINCLUDE   	.
+USERINCLUDE     ../../tef
+USERINCLUDE     ../../../uiftestfw/inc
+
+SYSTEMINCLUDE 	/epoc32/include
+SYSTEMINCLUDE 	/epoc32/include/techview
+SYSTEMINCLUDE   /epoc32/include/test
+
+MW_LAYER_SYSTEMINCLUDE
+
+// Application exe specific resource which is localised to the application
+RESOURCE		tssaac_tapp.rss
+start resource	tssaac_tapp.rss
+targetpath		/resource/apps
+lang			sc
+end
+
+RESOURCE	 	tssaac_tapp_loc.rss
+start resource	tssaac_tapp_loc.rss
+targetpath		/resource/apps
+lang			sc
+end
+
+// Application exe registration resource file
+START RESOURCE	tssaac_tapp_reg.rss
+TARGETPATH		/private/10003a3f/apps
+lang			sc
+END
+
+
+LIBRARY       	APPARC.LIB
+LIBRARY       	CONE.LIB 
+LIBRARY       	EFSRV.LIB
+LIBRARY       	EIKCORE.LIB 
+LIBRARY       	ESTOR.LIB
+LIBRARY       	EUSER.LIB
+LIBRARY       	GDI.LIB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tssaac/tssaac_tapp.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,36 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+
+NAME WWWW
+
+#include <eikon.rh>
+#include <appinfo.rh>
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tssaac/tssaac_tapp_emulator.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,229 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Modified default resource file to test apparc functionality
+// during critical startup
+// WARNING: Any changes made to this resource file must be
+// checked against the sysstart apparc test cases listed
+// T_TestLocalisedCaptionL      
+// 
+//
+
+#include "startup.rh"
+
+/////////////////////////////////////////////
+// ENTRY POINT
+/////////////////////////////////////////////
+
+// THIS MUST BE THE FIRST RESOURCE. The system relies on
+// this having a resource ID of 1
+
+RESOURCE STARTUP_ENTRY_POINT r_entry_point
+	{
+	entry_point = r_startup_state_critical_static; 
+	}
+/////////////////////////////////////////////
+
+
+
+/////////////////////////////////////////////
+// CRITICAL-STATIC startup state
+/////////////////////////////////////////////
+RESOURCE STATE_INFO r_startup_state_critical_static
+	{
+	id = EStartupStateCriticalStatic;
+	name = "Critical Static";
+	command_list = r_critical_static_commands;
+	next = r_startup_state_critical_dynamic;
+	}
+
+RESOURCE COMMAND_ARRAY r_critical_static_commands
+	{
+	commands =
+		{
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\SysAgt2Svr.exe";
+			start_method = EWaitForStart;
+			no_of_retries_on_failure = 2;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\fbserv.exe";
+			start_method = EWaitForStart;
+			no_of_retries_on_failure = 1;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\wserv.exe";
+			args = "-NoShell";
+			start_method = EWaitForStart;
+			},
+			 
+		SPLASH_SCREEN
+			{
+			path = "Z:\\sys\\bin\\splash.exe";
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\eiksrvs.exe";
+			args = "-OnlyStartDependentServers";
+			start_method = EWaitForStart;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\tzserver.exe";
+			start_method = EWaitForStart;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\tssaac_tapp.exe";
+			start_method = EWaitForStart;
+			}
+		};
+	}
+
+/////////////////////////////////////////////
+// CRITICAL-DYNAMIC startup state
+/////////////////////////////////////////////
+RESOURCE STATE_INFO r_startup_state_critical_dynamic
+	{
+	id = EStartupStateCriticalDynamic;
+	name = "Critical Dynamic";
+	command_list = r_critical_dynamic_commands;
+	next = r_startup_state_networking_critical;
+	}
+
+RESOURCE COMMAND_ARRAY r_critical_dynamic_commands
+	{
+	commands =
+		{
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\initialiselocale.exe";
+			start_method = EWaitForStart;
+			fail_on_error = EIgnoreCommandFailure;
+			},		
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\apsexe.exe";
+			start_method = EWaitForStart;  // this is the only method allowable for apsexe.exe
+			},
+		START_APP_INFO
+			{
+			path = "Z:\\sys\\bin\\shell.exe";	// Requires apparc to be properly started
+			viewless = 1;	 
+			start_method = EDeferredWaitForStart; 
+			},
+		MULTIPLE_WAIT  
+			{
+			timeout = 10000;
+			fail_on_error = EPanicOnCommandFailure;
+			},
+		SPLASH_SCREEN
+			{
+			kill = 1;
+			} 		
+		};
+	}
+
+/////////////////////////////////////////////
+// Networking-CRITICAL startup state
+/////////////////////////////////////////////
+RESOURCE STATE_INFO  r_startup_state_networking_critical
+	{
+	id = EStartupStateNetworkingCritical;   
+	name = "Networking-Critical";
+	command_list =  r_networking_critical_commands;
+	next = r_startup_state_non_critical;
+	}
+
+RESOURCE COMMAND_ARRAY r_networking_critical_commands
+	{
+	commands =
+		{
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\c32start.exe";
+  			start_method = EWaitForStart;
+  			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\msexe.exe";
+			start_method = EWaitForStart;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\watcher.exe";
+			start_method = EWaitForStart;
+			}
+		};
+	}
+
+/////////////////////////////////////////////
+// NON-CRITICAL startup state
+/////////////////////////////////////////////
+RESOURCE STATE_INFO r_startup_state_non_critical
+	{
+	id = EStartupStateNonCritical;
+	name = "Non-critical";
+	command_list = r_non_critical_commands;
+	next = 0;	// No more state transitions
+	}
+
+RESOURCE COMMAND_ARRAY r_non_critical_commands
+	{
+	commands =
+		{
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\SystemAMS.exe";
+			args = "-boot";
+			fail_on_error = EIgnoreCommandFailure;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\swidaemon.exe";
+			start_method = EWaitForStart;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\cntsrv.exe";
+			args = "-nontransient";
+			fail_on_error = 0;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\agsvexe.exe";
+			args = "-nontransient";
+			fail_on_error = 0;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\fotaagent.exe";
+			fail_on_error = EIgnoreCommandFailure;
+			},
+		START_PROCESS_INFO
+			{
+			path = "z:\\sys\\bin\\Fepswitch.exe";
+			start_method = EFireAndForget;
+			fail_on_error = EIgnoreCommandFailure;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\schexe.exe";
+			args = "sysstartschexe"; // Command line parameter passed to schexe.exe
+			fail_on_error = EIgnoreCommandFailure; //Task Scheduler may have already been started by a client
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tssaac/tssaac_tapp_hardware.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,228 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Modified default resource file to test apparc functionality
+// during critical startup
+// WARNING: Any changes made to this resource file must be
+// checked against the sysstart apparc test cases listed
+// T_TestLocalisedCaptionL      
+// 
+//
+
+#include "startup.rh"
+
+/////////////////////////////////////////////
+// ENTRY POINT
+/////////////////////////////////////////////
+
+// THIS MUST BE THE FIRST RESOURCE. The system relies on
+// this having a resource ID of 1
+
+RESOURCE STARTUP_ENTRY_POINT r_entry_point
+	{
+	entry_point = r_startup_state_critical_static; 
+	}
+/////////////////////////////////////////////
+
+
+
+/////////////////////////////////////////////
+// CRITICAL-STATIC startup state
+/////////////////////////////////////////////
+RESOURCE STATE_INFO r_startup_state_critical_static
+	{
+	id = EStartupStateCriticalStatic;
+	name = "Critical Static";
+	command_list = r_critical_static_commands;
+	next = r_startup_state_critical_dynamic;
+	}
+
+RESOURCE COMMAND_ARRAY r_critical_static_commands
+	{
+	commands =
+		{
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\SysAgt2Svr.exe";
+			start_method = EWaitForStart;
+			no_of_retries_on_failure = 2;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\fbserv.exe";
+			start_method = EWaitForStart;
+			no_of_retries_on_failure = 1;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\ewsrv.exe";
+			args = "-NoShell";
+			start_method = EWaitForStart;
+			},
+		SPLASH_SCREEN
+			{
+			path = "Z:\\sys\\bin\\splash.exe";
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\eiksrvs.exe";
+			args = "-OnlyStartDependentServers";
+			start_method = EWaitForStart;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\tzserver.exe";
+			start_method = EWaitForStart;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\tssaac_tapp.exe";
+			start_method = EWaitForStart;
+			}
+		};
+	}
+
+/////////////////////////////////////////////
+// CRITICAL-DYNAMIC startup state
+/////////////////////////////////////////////
+RESOURCE STATE_INFO r_startup_state_critical_dynamic
+	{
+	id = EStartupStateCriticalDynamic;
+	name = "Critical Dynamic";
+	command_list = r_critical_dynamic_commands;
+	next = r_startup_state_networking_critical;
+	}
+
+RESOURCE COMMAND_ARRAY r_critical_dynamic_commands
+	{
+	commands =
+		{
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\initialiselocale.exe";
+			start_method = EWaitForStart;
+			fail_on_error = EIgnoreCommandFailure;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\apsexe.exe";
+			start_method = EWaitForStart; // this is the only method allowable for apsexe.exe
+			},
+		START_APP_INFO
+			{
+			path = "Z:\\sys\\bin\\shell.exe";	// Requires apparc to be properly started
+			start_method = EDeferredWaitForStart;
+			viewless = 1;	 
+			},
+		MULTIPLE_WAIT  
+			{
+			timeout = 10000;
+			fail_on_error = EPanicOnCommandFailure;
+			},
+		SPLASH_SCREEN
+			{
+			kill = 1;
+			}
+		};
+	}
+
+/////////////////////////////////////////////
+// Networking-CRITICAL startup state
+/////////////////////////////////////////////
+RESOURCE STATE_INFO  r_startup_state_networking_critical
+	{
+	id = EStartupStateNetworkingCritical;   
+	name = "Networking-Critical";
+	command_list =  r_networking_critical_commands;
+	next = r_startup_state_non_critical;
+	} 
+
+RESOURCE COMMAND_ARRAY r_networking_critical_commands
+	{
+	commands =
+		{
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\c32start.exe";
+  			start_method = EWaitForStart;
+  			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\msexe.exe";
+			start_method = EWaitForStart;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\watcher.exe";
+			start_method = EWaitForStart;
+			}
+		};
+	}
+
+/////////////////////////////////////////////
+// NON-CRITICAL startup state
+/////////////////////////////////////////////
+RESOURCE STATE_INFO r_startup_state_non_critical
+	{
+	id = EStartupStateNonCritical;
+	name = "Non-critical";
+	command_list = r_non_critical_commands;
+	next = 0;	// No more state transitions
+	}
+
+RESOURCE COMMAND_ARRAY r_non_critical_commands
+	{
+	commands =
+		{
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\SystemAMS.exe";
+			args = "-boot";
+			fail_on_error = EIgnoreCommandFailure;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\swidaemon.exe";
+			start_method = EWaitForStart;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\cntsrv.exe";
+			args = "-nontransient";
+			fail_on_error = 0;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\agsvexe.exe";
+			args = "-nontransient";
+			fail_on_error = 0;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\fotaagent.exe";
+			fail_on_error = EIgnoreCommandFailure;
+			},
+		START_PROCESS_INFO
+			{
+			path = "z:\\sys\\bin\\Fepswitch.exe";
+			start_method = EFireAndForget;
+			fail_on_error = EIgnoreCommandFailure;
+			},
+		START_PROCESS_INFO
+			{
+			path = "Z:\\sys\\bin\\schexe.exe";
+			args = "sysstartschexe"; // Command line parameter passed to schexe.exe
+			fail_on_error = EIgnoreCommandFailure; //Task Scheduler may have already been started by a client
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tssaac/tssaac_tapp_loc.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,35 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+ 
+#include <appinfo.rh>
+
+RESOURCE LOCALISABLE_APP_INFO
+	{
+	caption_and_icon =	
+		{
+		CAPTION_AND_ICON_INFO
+			{
+			caption="NewCaption";
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tssaac/tssaac_tapp_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,36 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10207F7A
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="tssaac_tapp"; 
+	localisable_resource_file="\\resource\\apps\\tssaac_tapp_loc";
+	}
+
+
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tstapp01.rls	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+rls_string STRING_r_tstapp_caption_string "TstCap UK"
+rls_string STRING_r_tstapp_short_caption_string "TC UK"
+
+rls_string STRING_r_tstapp_view1_caption "V1 UK"
+rls_string STRING_r_tstapp_view2_caption "V2 UK"
+
+rls_string STRING_r_tstapp_icon_file "z:\\resource\\apps\\tstapp.mbm"
+rls_string STRING_r_tstapp_view1_icon_file "z:\\resource\\apps\\tstappview01.m01"
+rls_string STRING_r_tstapp_view2_icon_file "z:\\resource\\apps\\tstappview02.k"
+rls_string STRING_r_tstapp_view3_icon_file "z:\\resource\\apps\\tstappviewneg.xyz"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tstapp02.rls	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+rls_string STRING_r_tstapp_caption_string "TstCap FR"
+rls_string STRING_r_tstapp_short_caption_string "TC FR"
+
+rls_string STRING_r_tstapp_view1_caption "V1 FR"
+rls_string STRING_r_tstapp_view2_caption "V2 FR"
+
+rls_string STRING_r_tstapp_icon_file "z:\\resource\\apps\\tstapp02.m02"
+rls_string STRING_r_tstapp_view1_icon_file "z:\\resource\\apps\\tstappview01.m02"
+rls_string STRING_r_tstapp_view2_icon_file "z:\\resource\\apps\\tstappview"
+rls_string STRING_r_tstapp_view3_icon_file "z:\\resource\\apps\\tstappviewneg.mbm"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tstapp03.rls	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+rls_string STRING_r_tstapp_caption_string "TstCap GE"
+rls_string STRING_r_tstapp_short_caption_string "TC GE"
+
+rls_string STRING_r_tstapp_view1_caption "V1 GE"
+rls_string STRING_r_tstapp_view2_caption "V2 GE"
+
+rls_string STRING_r_tstapp_icon_file "z:\\resource\\apps\\tstapp.mbm"
+rls_string STRING_r_tstapp_view1_icon_file "z:\\resource\\apps\\tstapp.mbm"
+rls_string STRING_r_tstapp_view2_icon_file "z:\\resource\\apps\\tstapp.mbm"
+rls_string STRING_r_tstapp_view3_icon_file "z:\\resource\\apps\\tstappviewneg.xyz"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tstapp04.rls	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+rls_string STRING_r_tstapp_caption_string "TstCap SP"
+rls_string STRING_r_tstapp_short_caption_string ""
+
+rls_string STRING_r_tstapp_view1_caption "V1 SP"
+rls_string STRING_r_tstapp_view2_caption "V2 SP"
+
+rls_string STRING_r_tstapp_icon_file "z:\\resource\\apps\\tstapp.mbm"
+rls_string STRING_r_tstapp_view1_icon_file "z:\\resource\\apps\\tstapp.mbm"
+rls_string STRING_r_tstapp_view2_icon_file "z:\\resource\\apps\\tstapp.mbm"
+rls_string STRING_r_tstapp_view3_icon_file "z:\\resource\\apps\\tstappviewneg.xyz"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tstapp05.rls	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+rls_string STRING_r_tstapp_caption_string ""
+rls_string STRING_r_tstapp_short_caption_string "TC IT"
+
+rls_string STRING_r_tstapp_view1_caption "V1 IT"
+rls_string STRING_r_tstapp_view2_caption "V2 IT"
+
+rls_string STRING_r_tstapp_icon_file "z:\\resource\\apps\\tstapp.mbm"
+rls_string STRING_r_tstapp_view1_icon_file "z:\\resource\\apps\\tstapp.mbm"
+rls_string STRING_r_tstapp_view2_icon_file "z:\\resource\\apps\\tstapp.mbm"
+rls_string STRING_r_tstapp_view3_icon_file "z:\\resource\\apps\\tstappviewneg.xyz"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tstapp_Reg.RSS	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,42 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+
+UID3 10 // application UID
+
+RESOURCE APP_REGISTRATION_INFO 
+	{	
+	app_file = "tstapp";
+
+	localisable_resource_file = "\\resource\\apps\\tstapp_loc";
+
+	hidden = KAppNotHidden;
+	embeddability=KAppEmbeddable;
+	newfile = KAppDoesNotSupportNewFile;
+	}
+
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tstapp_loc.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,98 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include <appinfo.rh>
+
+#if defined(LANGUAGE_01)
+#include "tstapp01.rls"
+#elif(LANGUAGE_02)
+#include "tstapp02.rls"
+#elif(LANGUAGE_03)
+#include "tstapp03.rls"
+#elif(LANGUAGE_04)
+#include "tstapp04.rls"
+#elif(LANGUAGE_05)
+#include "tstapp05.rls"
+#else
+#include "tstappsc.rls"
+#endif
+
+
+RESOURCE LOCALISABLE_APP_INFO
+	{
+	short_caption = STRING_r_tstapp_short_caption_string;
+	caption_and_icon =
+		{
+		CAPTION_AND_ICON_INFO
+			{
+			caption = STRING_r_tstapp_caption_string;
+			number_of_icons = 3;
+			icon_file = STRING_r_tstapp_icon_file;
+			}
+		};		
+	view_list =
+		{
+		VIEW_DATA
+			{
+			uid = 270565258;
+			screen_mode = 0x00;
+			caption_and_icon =
+				{
+				CAPTION_AND_ICON_INFO
+					{
+					caption = STRING_r_tstapp_view1_caption;
+					number_of_icons = 1;
+					icon_file = STRING_r_tstapp_view1_icon_file ;
+					}
+				};
+			},
+		VIEW_DATA
+			{
+			uid = 270565259;
+			screen_mode = 0x00;
+			caption_and_icon =
+				{
+				CAPTION_AND_ICON_INFO
+					{
+					caption = STRING_r_tstapp_view2_caption;
+					number_of_icons = 1;
+					icon_file = STRING_r_tstapp_view2_icon_file;
+					}
+				};
+			},
+		VIEW_DATA
+			{
+			uid = 0x2000F5A8;
+			screen_mode = 0x00;
+			caption_and_icon =
+				{
+				CAPTION_AND_ICON_INFO
+					{
+					caption = STRING_r_tstapp_view2_caption;
+					number_of_icons = 1;
+					icon_file = STRING_r_tstapp_view3_icon_file;
+ 					}
+ 				};
+ 			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tstappsc.rls	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,32 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+rls_string STRING_r_tstapp_caption_string "TstCap UK"
+rls_string STRING_r_tstapp_short_caption_string "TC UK"
+
+rls_string STRING_r_tstapp_view1_caption "V1 SC"
+rls_string STRING_r_tstapp_view2_caption "V2 SC"
+
+rls_string STRING_r_tstapp_icon_file "z:\\resource\\apps\\tstapp.mbm"
+rls_string STRING_r_tstapp_view_icon_file "z:\\resource\\apps\\tstapp.mbm"
Binary file localisation/apparchitecture/tef/tstappviewneg.mbm has changed
Binary file localisation/apparchitecture/tef/tstappviewneg.xyz has changed
Binary file localisation/apparchitecture/tef/tstnnapp.mbm has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tupgradeiconapp/tupgradeiconapp.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,174 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <eikstart.h>
+
+
+#include "tupgradeiconapp.h"
+
+const TUid KUidUpgradeIconApp = { 0xA0003195 };
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// Implementation of the application class - CExampleApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+TUid CExampleApplication::AppDllUid() const
+	{
+	return KUidUpgradeIconApp;
+	}
+
+CApaDocument* CExampleApplication::CreateDocumentL()
+	{
+	return new (ELeave) CExampleDocument(*this);
+	}
+	
+
+////////////////////////////////////////////////////////////////////////
+//
+// Implementation of the appui class - CExampleAppUi
+//
+////////////////////////////////////////////////////////////////////////
+
+void CExampleAppUi::ConstructL()
+    {
+    BaseConstructL();
+	iAppView = CExampleAppView::NewL(ClientRect());
+	}
+
+CExampleAppUi::~CExampleAppUi()
+	{
+	delete iAppView;
+	}
+
+void CExampleAppUi::HandleCommandL(TInt aCommand)
+	{
+	switch (aCommand)
+		{
+		case EEikCmdExit: 
+			Exit();
+			break;
+		}
+	}
+
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// Implementation of the view class - CExampleAppView
+//
+////////////////////////////////////////////////////////////////////////
+
+CExampleAppView::CExampleAppView()
+	{
+	}
+
+CExampleAppView* CExampleAppView::NewL(const TRect& aRect)
+	{
+	CExampleAppView* self = new(ELeave) CExampleAppView();
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect);
+	CleanupStack::Pop();
+	return self;
+	}
+
+CExampleAppView::~CExampleAppView()
+	{
+	delete iExampleText;
+	}
+
+void CExampleAppView::ConstructL(const TRect& aRect)
+    {
+   	// Fetch the text from the resource file.
+	iExampleText = iEikonEnv->AllocReadResourceL(R_UPGRADEICONAPP_TEXT_TESTAPP);
+
+    // Control is a window owning control
+	CreateWindowL();
+
+   // Extent of the control. This is
+   // the whole rectangle available to application.
+   // The rectangle is passed to us from the application UI.
+	SetRect(aRect);
+
+   // At this stage, the control is ready to draw so
+   // we tell the UI framework by activating it.
+	ActivateL();
+	}
+
+
+void CExampleAppView::Draw(const TRect& /*aRect*/) const
+	{
+	CWindowGc& gc = SystemGc();			// Window graphics context
+	TRect      drawRect = Rect();		// Area in which we shall draw	
+	const CFont*     fontUsed;			// Font used for drawing text
+	
+	// Start with a clear screen
+	gc.Clear();
+	
+	// Draw an outline rectangle (the default pen and brush styles ensure this) slightly smaller than the drawing area.
+	drawRect.Shrink(10,10);		   	
+	gc.DrawRect(drawRect);
+    
+    // Use the title font supplied by the UI
+	fontUsed = iEikonEnv->TitleFont();
+	gc.UseFont(fontUsed);
+	
+	// Draw the text in the middle of the rectangle.
+	TInt   baselineOffset=(drawRect.Height() - fontUsed->HeightInPixels())/2; 
+	gc.DrawText(*iExampleText,drawRect,baselineOffset,CGraphicsContext::ECenter, 0);
+    
+    // Finished using the font
+	gc.DiscardFont();
+	}
+
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// Implementation of the document class - CExampleDocument
+//
+////////////////////////////////////////////////////////////////////////
+
+CExampleDocument::CExampleDocument(CEikApplication& aApp)
+		: CEikDocument(aApp)
+	{
+	}
+
+CEikAppUi* CExampleDocument::CreateAppUiL()
+	{
+    return new(ELeave) CExampleAppUi;
+	}
+
+
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CExampleApplication;
+	}
+	
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication(NewApplication);
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tupgradeiconapp/tupgradeiconapp.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,115 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+
+#ifndef __TUPGRADEICONAPP_H
+#define __TUPGRADEICONAPP_H
+
+#include <coeccntx.h>
+
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+
+#include <eikon.hrh>
+
+#include <tupgradeiconapp.rsg>
+
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+class CExampleApplication : public CEikApplication
+	{
+private: 
+	// Inherited from class CApaApplication
+	CApaDocument* CreateDocumentL();
+	TUid AppDllUid() const;
+	};
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppView
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppView : public CCoeControl
+    {
+public:
+	static CExampleAppView* NewL(const TRect& aRect);
+	CExampleAppView();
+	~CExampleAppView();
+    void ConstructL(const TRect& aRect);
+
+private:
+	// Inherited from CCoeControl
+	void Draw(const TRect& /*aRect*/) const;
+
+private:
+	HBufC*  iExampleText;
+    };
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppUi : public CEikAppUi
+    {
+public:
+    void ConstructL();
+	~CExampleAppUi();
+
+private:
+	// Inherirted from class CEikAppUi
+	void HandleCommandL(TInt aCommand);
+
+private:
+	CCoeControl* iAppView;
+	};
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleDocument : public CEikDocument
+	{
+public:
+	static CExampleDocument* NewL(CEikApplication& aApp);
+	CExampleDocument(CEikApplication& aApp);
+	void ConstructL();
+private: 
+	// Inherited from CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+
+#endif
Binary file localisation/apparchitecture/tef/tupgradeiconapp/tupgradeiconapp.mbm has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tupgradeiconapp/tupgradeiconapp.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,57 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// using relative paths for sourcepath and user includes
+// 
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <platform_paths.hrh>
+
+TARGET        		tupgradeiconapp.exe
+TARGETTYPE    		exe
+TARGETPATH      	/sys/bin
+UID           		0x100039CE 0xA0003195
+CAPABILITY  		tcb
+VENDORID 	  		0x70000001
+
+SOURCEPATH    	.
+SOURCE		tupgradeiconapp.cpp
+
+USERINCLUDE   	.
+SYSTEMINCLUDE 	/epoc32/include
+SYSTEMINCLUDE 	/epoc32/include/techview
+
+MW_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH	.
+RESOURCE 	tupgradeiconapp.RSS
+START RESOURCE	tupgradeiconapp.RSS
+TARGETPATH	/resource/apps
+LANG		SC
+END
+
+SOURCEPATH	.
+START RESOURCE	tupgradeiconapp_reg.rss
+TARGETPATH /private/10003a3f/apps
+END
+
+
+LIBRARY       euser.lib apparc.lib cone.lib eikcore.lib gdi.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tupgradeiconapp/tupgradeiconapp.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,81 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Symbian test code
+*/
+
+
+NAME TEAP
+
+#include <eikon.rh>
+#include <eikcore.rsg>
+#include <appinfo.rh>
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+	{
+	hotkeys=r_upgradeiconapp_hotkeys;
+	menubar=r_upgradeiconapp_menubar;
+	}
+
+RESOURCE HOTKEYS r_upgradeiconapp_hotkeys
+    {
+    control=
+        {
+        HOTKEY { command=EEikCmdExit; key='e'; }
+        };
+    }
+
+RESOURCE MENU_BAR r_upgradeiconapp_menubar
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_upgradeiconapp_first_menu; txt="TUpgradeIconApp"; }
+		};
+    }
+
+RESOURCE MENU_PANE r_upgradeiconapp_first_menu
+	{
+	items=
+		{
+		MENU_ITEM { command=EEikCmdExit; txt="Close"; }
+        };
+    }
+
+
+RESOURCE TBUF r_upgradeiconapp_text_TestApp { buf="TUpgradeIconApp!"; }
+
+
+RESOURCE LOCALISABLE_APP_INFO r_lai
+	{
+	short_caption = "TUIconApp";
+	caption_and_icon =
+		{
+		CAPTION_AND_ICON_INFO
+			{
+			caption = "TestUpgradeIconApp";
+			number_of_icons = 3; // each icon must be a bitmap/mask pair
+			icon_file = "c:\\resource\\apps\\tupgradeiconapp.mbm";
+			}
+		};							
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/apparchitecture/tef/tupgradeiconapp/tupgradeiconapp_reg.rss	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,36 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent -  Symbian test code
+*/
+
+#include <appinfo.rh>
+#include <TUpgradeIconApp.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 	0xA0003195 // application UID
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file = "TUpgradeIconApp";
+	localisable_resource_file = "\\resource\\apps\\tupgradeiconapp";
+	localisable_resource_id = R_LAI;	
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/uiftestfw/bwins/APPFWK_TEST_APPUIU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,18 @@
+EXPORTS
+	??0CAutoTestManager@@AAE@PAVMAutoTestApp@@@Z @ 1 NONAME ; CAutoTestManager::CAutoTestManager(class MAutoTestApp *)
+	??0CTestAppUi@@QAE@PAVCTestStep@@ABVTDesC16@@HHH@Z @ 2 NONAME ; CTestAppUi::CTestAppUi(class CTestStep *, class TDesC16 const &, int, int, int)
+	??0CTestCoeAppUi@@QAE@PAVCTestStep@@@Z @ 3 NONAME ; CTestCoeAppUi::CTestCoeAppUi(class CTestStep *)
+	??1CAutoTestManager@@UAE@XZ @ 4 NONAME ; CAutoTestManager::~CAutoTestManager(void)
+	??1CTestAppUi@@UAE@XZ @ 5 NONAME ; CTestAppUi::~CTestAppUi(void)
+	??1CTestCoeAppUi@@UAE@XZ @ 6 NONAME ; CTestCoeAppUi::~CTestCoeAppUi(void)
+	?ConstructL@CTestAppUi@@UAEXXZ @ 7 NONAME ; void CTestAppUi::ConstructL(void)
+	?ConstructL@CTestCoeAppUi@@QAEXXZ @ 8 NONAME ; void CTestCoeAppUi::ConstructL(void)
+	?FinishAllTestCases@CAutoTestManager@@QAEXW4TTestResult@1@@Z @ 9 NONAME ; void CAutoTestManager::FinishAllTestCases(enum CAutoTestManager::TTestResult)
+	?NewL@CAutoTestManager@@SAPAV1@PAVMAutoTestApp@@@Z @ 10 NONAME ; class CAutoTestManager * CAutoTestManager::NewL(class MAutoTestApp *)
+	?PreallocateHALBuffer@@YAXXZ @ 11 NONAME ; void PreallocateHALBuffer(void)
+	?ProcessCommandL@CTestAppUi@@MAEXH@Z @ 12 NONAME ; void CTestAppUi::ProcessCommandL(int)
+	?ReduceRect@CTestAppUi@@IBEXAAVTRect@@@Z @ 13 NONAME ; void CTestAppUi::ReduceRect(class TRect &) const
+	?SetTestCaseNumber@CAutoTestManager@@QAEXH@Z @ 14 NONAME ; void CAutoTestManager::SetTestCaseNumber(int)
+	?StartAutoTest@CAutoTestManager@@QAEXXZ @ 15 NONAME ; void CAutoTestManager::StartAutoTest(void)
+	?CloseAllPanicWindowsL@@YAXXZ @ 16 NONAME ; void CloseAllPanicWindowsL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/uiftestfw/bwins/APPFWK_TEST_UTILSU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,21 @@
+EXPORTS
+	?ChangeFilePermissionL@RSmlTestUtils@@QAEHABVTDesC16@@@Z @ 1 NONAME ; int RSmlTestUtils::ChangeFilePermissionL(class TDesC16 const &)
+	?Connect@RSmlTestUtils@@QAEHXZ @ 2 NONAME ; int RSmlTestUtils::Connect(void)
+	?CopyDirectoryL@RSmlTestUtils@@QAEHABVTDesC16@@0@Z @ 3 NONAME ; int RSmlTestUtils::CopyDirectoryL(class TDesC16 const &, class TDesC16 const &)
+	?CopyFileL@RSmlTestUtils@@QAEHABVTDesC16@@0@Z @ 4 NONAME ; int RSmlTestUtils::CopyFileL(class TDesC16 const &, class TDesC16 const &)
+	?CreateDirectoryL@RSmlTestUtils@@QAEHABVTDesC16@@@Z @ 5 NONAME ; int RSmlTestUtils::CreateDirectoryL(class TDesC16 const &)
+	?CreateFileL@RSmlTestUtils@@QAEHABVTDesC16@@@Z @ 6 NONAME ; int RSmlTestUtils::CreateFileL(class TDesC16 const &)
+	?DeleteDirectoryL@RSmlTestUtils@@QAEHABVTDesC16@@@Z @ 7 NONAME ; int RSmlTestUtils::DeleteDirectoryL(class TDesC16 const &)
+	?DeleteFileL@RSmlTestUtils@@QAEHABVTDesC16@@@Z @ 8 NONAME ; int RSmlTestUtils::DeleteFileL(class TDesC16 const &)
+	?DeleteFileUsingWildcardL@RSmlTestUtils@@QAEHABVTDesC16@@@Z @ 9 NONAME ; int RSmlTestUtils::DeleteFileUsingWildcardL(class TDesC16 const &)
+	?GetAtt@RSmlTestUtils@@QAEHABVTDesC16@@AAI@Z @ 10 NONAME ; int RSmlTestUtils::GetAtt(class TDesC16 const &, unsigned int &)
+	?GetDevIdL@RSmlTestUtils@@QAEXAAVTDes8@@@Z @ 11 NONAME ; void RSmlTestUtils::GetDevIdL(class TDes8 &)
+	?IsFilePresent@RSmlTestUtils@@QAEHABVTDesC16@@AAH@Z @ 12 NONAME ; int RSmlTestUtils::IsFilePresent(class TDesC16 const &, int &)
+	?RenameDirectoryL@RSmlTestUtils@@QAEHABVTDesC16@@0@Z @ 13 NONAME ; int RSmlTestUtils::RenameDirectoryL(class TDesC16 const &, class TDesC16 const &)
+	?ReplaceFileL@RSmlTestUtils@@QAEHABVTDesC16@@I@Z @ 14 NONAME ; int RSmlTestUtils::ReplaceFileL(class TDesC16 const &, unsigned int)
+	?SetAtt@RSmlTestUtils@@QAEHABVTDesC16@@II@Z @ 15 NONAME ; int RSmlTestUtils::SetAtt(class TDesC16 const &, unsigned int, unsigned int)
+	?SetDevIdL@RSmlTestUtils@@QAEXABVTDesC8@@@Z @ 16 NONAME ; void RSmlTestUtils::SetDevIdL(class TDesC8 const &)
+	?SetHomeTimeL@RSmlTestUtils@@QAEXVTTime@@@Z @ 17 NONAME ; void RSmlTestUtils::SetHomeTimeL(class TTime)
+	?SetReadOnly@RSmlTestUtils@@QAEHABVTDesC16@@I@Z @ 18 NONAME ; int RSmlTestUtils::SetReadOnly(class TDesC16 const &, unsigned int)
+	?WipeDataStoreL@RSmlTestUtils@@QAEHE@Z @ 19 NONAME ; int RSmlTestUtils::WipeDataStoreL(unsigned char)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/uiftestfw/eabi/APPFWK_TEST_APPUIU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,32 @@
+EXPORTS
+	_Z20PreallocateHALBufferv @ 1 NONAME
+	_ZN10CTestAppUi10ConstructLEv @ 2 NONAME
+	_ZN10CTestAppUi15ProcessCommandLEi @ 3 NONAME
+	_ZN10CTestAppUiC2EP9CTestStepRK7TDesC16iii @ 4 NONAME
+	_ZN10CTestAppUiD0Ev @ 5 NONAME
+	_ZN10CTestAppUiD1Ev @ 6 NONAME
+	_ZN10CTestAppUiD2Ev @ 7 NONAME
+	_ZN13CTestCoeAppUi10ConstructLEv @ 8 NONAME
+	_ZN13CTestCoeAppUiC2EP9CTestStep @ 9 NONAME
+	_ZN13CTestCoeAppUiD0Ev @ 10 NONAME
+	_ZN13CTestCoeAppUiD1Ev @ 11 NONAME
+	_ZN13CTestCoeAppUiD2Ev @ 12 NONAME
+	_ZN16CAutoTestManager13StartAutoTestEv @ 13 NONAME
+	_ZN16CAutoTestManager17SetTestCaseNumberEi @ 14 NONAME
+	_ZN16CAutoTestManager18FinishAllTestCasesENS_11TTestResultE @ 15 NONAME
+	_ZN16CAutoTestManager4NewLEP12MAutoTestApp @ 16 NONAME
+	_ZN16CAutoTestManagerC1EP12MAutoTestApp @ 17 NONAME
+	_ZN16CAutoTestManagerC2EP12MAutoTestApp @ 18 NONAME
+	_ZN16CAutoTestManagerD0Ev @ 19 NONAME
+	_ZN16CAutoTestManagerD1Ev @ 20 NONAME
+	_ZN16CAutoTestManagerD2Ev @ 21 NONAME
+	_ZNK10CTestAppUi10ReduceRectER5TRect @ 22 NONAME
+	_ZTI10CTestAppUi @ 23 NONAME ; #<TI>#
+	_ZTI13CTestCoeAppUi @ 24 NONAME ; #<TI>#
+	_ZTI16CAutoTestManager @ 25 NONAME ; #<TI>#
+	_ZTV10CTestAppUi @ 26 NONAME ; #<VT>#
+	_ZTV13CTestCoeAppUi @ 27 NONAME ; #<VT>#
+	_ZTV16CAutoTestManager @ 28 NONAME ; #<VT>#
+	_ZThn24_N10CTestAppUi15ProcessCommandLEi @ 29 NONAME ; #<thunk>#
+	_Z21CloseAllPanicWindowsLv @ 30 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/uiftestfw/eabi/APPFWK_TEST_UTILSU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,21 @@
+EXPORTS
+	_ZN13RSmlTestUtils11CreateFileLERK7TDesC16 @ 1 NONAME
+	_ZN13RSmlTestUtils11DeleteFileLERK7TDesC16 @ 2 NONAME
+	_ZN13RSmlTestUtils11SetReadOnlyERK7TDesC16j @ 3 NONAME
+	_ZN13RSmlTestUtils12ReplaceFileLERK7TDesC16j @ 4 NONAME
+	_ZN13RSmlTestUtils12SetHomeTimeLE5TTime @ 5 NONAME
+	_ZN13RSmlTestUtils13IsFilePresentERK7TDesC16Ri @ 6 NONAME
+	_ZN13RSmlTestUtils14CopyDirectoryLERK7TDesC16S2_ @ 7 NONAME
+	_ZN13RSmlTestUtils14WipeDataStoreLEh @ 8 NONAME
+	_ZN13RSmlTestUtils16CreateDirectoryLERK7TDesC16 @ 9 NONAME
+	_ZN13RSmlTestUtils16DeleteDirectoryLERK7TDesC16 @ 10 NONAME
+	_ZN13RSmlTestUtils16RenameDirectoryLERK7TDesC16S2_ @ 11 NONAME
+	_ZN13RSmlTestUtils21ChangeFilePermissionLERK7TDesC16 @ 12 NONAME
+	_ZN13RSmlTestUtils24DeleteFileUsingWildcardLERK7TDesC16 @ 13 NONAME
+	_ZN13RSmlTestUtils6GetAttERK7TDesC16Rj @ 14 NONAME
+	_ZN13RSmlTestUtils6SetAttERK7TDesC16jj @ 15 NONAME
+	_ZN13RSmlTestUtils7ConnectEv @ 16 NONAME
+	_ZN13RSmlTestUtils9CopyFileLERK7TDesC16S2_ @ 17 NONAME
+	_ZN13RSmlTestUtils9GetDevIdLER5TDes8 @ 18 NONAME
+	_ZN13RSmlTestUtils9SetDevIdLERK6TDesC8 @ 19 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/uiftestfw/group/BLD.INF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,34 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+// test code only
+
+PRJ_MMPFILES
+// test code only
+
+PRJ_TESTMMPFILES
+../group/appfwk_test_AppUi.mmp
+../group/appfwk_test_utils.mmp
+
+PRJ_TESTEXPORTS
+
+// TestFramework INCLUDE files
+../inc/appfwk_test.h 				/epoc32/include/test/appfwk_test.h
+../inc/appfwk_test_AppUi.h			/epoc32/include/test/appfwk_test_appui.h
+../inc/appfwk_test_utils.h 			/epoc32/include/test/appfwk_test_utils.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/uiftestfw/group/app-framework_testframework.history.xml	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<relnotes schema="1.0.0" name="INTEGRATIONTEST" purpose="" type="component">
+  <revision major="1" functional="0" minor="0" date="20070831">
+    <ref name="110932" type="defect"/>
+    <description>Appended GfxTransEffect batch file</description>
+  </revision>
+  <purpose>
+  </purpose>
+  <defect number="PDEF099099" title="UIF TestFramework component has source dependancy on SysStart" revision="001">
+    Remove in testframework the source dependency on sysstart by removing testframework\resource\SSCForStartupMode0_target.rss file. This file is not needed as is made redundant by sysstart\test\resource\hardware\SSCForStartupMode0_target.rss.
+  </defect>
+</relnotes>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/uiftestfw/group/app-framework_testframework.mrp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,11 @@
+component	app-framework_testframework
+source	\sf\mw\appsupport\appfw\uiftestfw
+
+
+notes_source	\component_defs\release.src
+
+
+#  == IPR section auto-inserted from distribution.policy files  ==
+ipr T 
+
+# == end auto-inserted section ==
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/uiftestfw/group/appfwk_test_AppUi.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,56 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include <platform_paths.hrh>
+
+TARGET          appfwk_test_AppUi.dll
+TARGETTYPE      DLL
+TARGETPATH      /sys/bin  
+UID				0x1100008D 0x11003B3C
+VENDORID 		0x70000001
+
+CAPABILITY		All -tcb
+
+SYSTEMINCLUDE   /epoc32/include 
+SYSTEMINCLUDE	/epoc32/include/techview
+SYSTEMINCLUDE   /epoc32/include/test
+
+MW_LAYER_SYSTEMINCLUDE
+
+USERINCLUDE	../inc
+
+SOURCEPATH	../src
+SOURCE 		appfwk_test_AppUi.CPP
+
+LIBRARY		EUSER.LIB
+LIBRARY		CONE.LIB
+LIBRARY		BAFL.LIB
+LIBRARY		EFSRV.LIB
+LIBRARY		ESTOR.LIB
+LIBRARY		EGUL.LIB
+LIBRARY		EIKCORE.LIB
+LIBRARY		EIKCOCTL.LIB
+LIBRARY		HAL.LIB
+LIBRARY		WS32.LIB 
+
+DEFFILE 	APPFWK_TEST_APPUI.DEF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/uiftestfw/group/appfwk_test_utils.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,45 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Client API for appfwk_test_utils
+// 
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+TARGET		appfwk_test_utils.dll
+TARGETTYPE	dll
+TARGETPATH      /sys/bin
+UID		0x1000008D 0x10009FBE
+VENDORID 	0x70000001
+
+CAPABILITY 	all
+
+SYSTEMINCLUDE 	/epoc32/include
+
+USERINCLUDE	../inc
+
+SOURCEPATH	../src
+SOURCE		appfwk_test_utils.cpp
+
+LIBRARY		EUSER.lib
+
+DEFFILE 	APPFWK_TEST_UTILS.DEF
+
+EPOCSTACKSIZE	32000
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/uiftestfw/inc/appfwk_test.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,33 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+#if (!defined __APPFWK_TEST_H__)
+#define __APPFWK_TEST_H__
+
+#define APPFWK_NEGATIVE_PLATSEC_START RDebug::Print(_L("*PlatSec* ERROR - NEGATIVE TEST - START"))
+#define APPFWK_NEGATIVE_PLATSEC_FINISH RDebug::Print(_L("*PlatSec* ERROR - NEGATIVE TEST - FINISH"))
+
+#define APPFWK_EXPECTED_PLATSEC_START RDebug::Print(_L("*PlatSec* ERROR - EXPECTED ERROR - START"))
+#define APPFWK_EXPECTED_PLATSEC_FINISH RDebug::Print(_L("*PlatSec* ERROR - EXPECTED ERROR - FINISH"))
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/uiftestfw/inc/appfwk_test_AppUi.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,215 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+#ifndef __APPFWK_TEST_APPUI_H__
+#define __APPFWK_TEST_APPUI_H__
+
+#include <e32std.h>
+#include <e32base.h>
+#include <coeaui.h>
+#include <eikappui.h>
+
+#include <test/testexecutestepbase.h>
+
+
+// user panic descriptors
+_LIT(KPanicNullPointer,"Null pointer");
+
+//user panic errors
+const TInt KNullPointer = 1;
+
+
+/********************************************************************/
+/*																	*/
+/*																	*/
+/*		MAutoTestApp												*/
+/*																	*/
+/*																	*/
+/********************************************************************/
+
+class MAutoTestApp
+	{
+public:
+	virtual void RunTestStepL(TInt aNextStep)=0; // this function needs to be implemented by the derived class of either CTestCoeAppUi or CTestAppUi
+	};
+
+
+/********************************************************************/
+/*																	*/
+/*																	*/
+/*		CAutoTestManager											*/
+/*																	*/
+/*																	*/
+/********************************************************************/
+
+/**
+  The test code manager, provides functions to set active object  with lowest priority for running test in auto mode.
+*/
+class CAutoTestManager : public CActive
+	{
+public:
+	enum TTestResult
+		{
+		EPass,
+		EFailed,
+		EUnknown,
+		};
+public:
+	IMPORT_C ~CAutoTestManager();
+	IMPORT_C static CAutoTestManager* NewL(MAutoTestApp* aAutoTestApp);
+	IMPORT_C void StartAutoTest(); //init active object and set it active
+	IMPORT_C void FinishAllTestCases(TTestResult aTestResult);	//every test program should call this function in order to 
+						 										//stop the consequence of test steps by 
+																//closing active sheduler
+	IMPORT_C void SetTestCaseNumber(TInt aNumber);
+	inline TTestResult	GetTestResult() const;
+private: 
+	IMPORT_C CAutoTestManager(MAutoTestApp* aAutoTestApp);
+	void RunL();
+	void DoCancel();
+private:
+	MAutoTestApp* iAutoTestApp;
+	TInt iNumStep;
+	TTestResult	iResult;
+	};
+
+inline CAutoTestManager::TTestResult	CAutoTestManager::GetTestResult() const
+	{
+	return iResult;
+	}
+
+
+/********************************************************************/
+/*																	*/
+/*																	*/
+/*		CTestCoeAppUi												*/
+/*																	*/
+/*																	*/
+/********************************************************************/
+
+/**
+  The abstract class is base for test programs, incapsulates the CAutoTestManager member.
+  The class doesn't handles work with resources.
+
+  It is supposed that a derived class in its ConstructL(); function first of all has to calls the ConstructL() function of the parent class.
+*/
+
+class CTestCoeAppUi : public CCoeAppUi, public MAutoTestApp
+	{
+public:
+	IMPORT_C CTestCoeAppUi(CTestStep*		aStep);
+	IMPORT_C ~CTestCoeAppUi();
+	IMPORT_C void ConstructL(); // should be called from ConstructL of the child class
+	CTestExecuteLogger&	Logger() {return iStep->Logger();}
+	inline void testBooleanTrue(TBool aCondition, const TText8* aFile, TInt aLine) 
+		{
+		iStep -> testBooleanTrue(aCondition, aFile, aLine);
+		}
+	void testBooleanTrueL(TBool aCondition, const TText8* aFile, TInt aLine);
+	void testBooleanTrueWithErrorCode(TBool aCondition, TInt aErrorCode, const TText8* aFile, TInt aLine );
+	void testBooleanTrueWithErrorCodeL(TBool aCondition, TInt aErrorCode, const TText8* aFile, TInt aLine );
+	void TestCheckPointCompareL(TInt aVal, TInt aExpectedVal, const TDesC& aText, const TText8* aFile, TInt aLine);
+
+protected:
+	inline CAutoTestManager& AutoTestManager() const;
+	
+private:
+	CAutoTestManager* iAutoTestManager;
+	CTestStep		*iStep;
+	};
+
+CAutoTestManager& CTestCoeAppUi::AutoTestManager() const
+	{
+	return *iAutoTestManager;
+	}
+
+
+class CEikButtonGroupContainer;
+class CEikMenuBar;
+
+/********************************************************************/
+/*																	*/
+/*																	*/
+/*		CTestAppUi													*/
+/*																	*/
+/*																	*/
+/********************************************************************/
+
+/**
+  The abstract class is base for test programs, incapsulates the CAutoTestManager member.
+  The class handles work with resources.
+
+  It is supposed that a derived class in its ConstructL(); function first of all has to calls the ConstructL() function of the parent class.
+*/
+class CTestAppUi : public CEikAppUi, public MAutoTestApp
+	{
+public:
+	IMPORT_C CTestAppUi(CTestStep*	aStep, const TDesC& aRes, TInt aResourceHotKeysId = 0, TInt aResourceMenuBarId = 0, TInt aResourceToolBarId = 0);
+	IMPORT_C ~CTestAppUi();
+	IMPORT_C void ConstructL(); // should be called from ConstructL of the child class
+	CTestExecuteLogger&	Logger() {return iStep->Logger();}
+	inline void testBooleanTrue(TBool aCondition, const TText8* aFile, TInt aLine) 
+		{
+		iStep -> testBooleanTrue(aCondition, aFile, aLine, ETrue);
+		}
+
+protected:
+	inline CAutoTestManager& AutoTestManager() const;
+	inline CTestStep& TestStep() const;
+	IMPORT_C void ReduceRect(TRect& aRect) const;	//reduce client rectangle if toolbar or/and menu exist hide menu from screen
+	IMPORT_C void ProcessCommandL(TInt aCommand);
+
+private:
+	CAutoTestManager* iAutoTestManager;
+
+	TInt iResourceFileFlag;
+	CEikButtonGroupContainer *iToolBar;
+	CEikMenuBar	*iMenuBar;
+	
+	TInt iResourceHotKeysId;
+	TInt iResourceMenuBarId;
+	TInt iResourceToolBarId;
+	TFileName iRes;
+	CTestStep *iStep;
+	};
+
+CAutoTestManager& CTestAppUi::AutoTestManager() const
+	{
+	return *iAutoTestManager;
+	}
+
+CTestStep& CTestAppUi::TestStep() const
+	{
+	return *iStep;
+	}
+
+//to prevent from alloc memory error in the User::__DbgMarkEnd 
+//we need to call this function if we are using  CCoeEnv and memory heap macros
+IMPORT_C void PreallocateHALBuffer();
+
+//to prevent test fail due to panic dialog on screen 
+//we need to call this function if we the test we are running is sensitive to dialogs being on screen.
+IMPORT_C void CloseAllPanicWindowsL();
+
+#endif	// __APPFWK_TEST_APPUI_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/uiftestfw/inc/appfwk_test_utils.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,104 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+#ifndef __APPFWK_TEST_UTILS_H__
+#define __APPFWK_TEST_UTILS_H__
+
+#include <e32std.h>
+
+typedef TUint8 TWipeItems;
+TInt E32Main();
+
+_LIT(KTestServerName,"!appfwk_test_utils_server");
+_LIT(KTestServerImg,"appfwk_test_utils_server");
+
+
+enum TSmlProfileTransportType
+	{
+	ELocalTransport,
+	ENetworkTransport,
+	};
+
+class RSmlTestUtils : public RSessionBase
+	{
+public:
+	IMPORT_C TInt Connect();
+	IMPORT_C void SetDevIdL(const TDesC8& aDevId);
+	IMPORT_C void GetDevIdL(TDes8& aDevId);
+	IMPORT_C TInt WipeDataStoreL(TWipeItems aItemsToClean);
+	IMPORT_C TInt RenameDirectoryL(const TDesC16& aSrc,const TDesC16& aDest);
+	IMPORT_C TInt CreateDirectoryL(const TDesC& aPath);
+	IMPORT_C TInt DeleteDirectoryL(const TDesC& aPath);
+	IMPORT_C TInt CreateFileL(const TDesC& aPath);
+	IMPORT_C TInt DeleteFileUsingWildcardL(const TDesC& aPath);
+	IMPORT_C TInt DeleteFileL(const TDesC& aPath);
+	IMPORT_C TInt CopyFileL(const TDesC& aSrc,const TDesC& aDest);
+	IMPORT_C TInt ReplaceFileL(const TDesC& aName,TUint aFileMode);
+	IMPORT_C TInt IsFilePresent(const TDesC& aName, TBool &aPresent);
+	IMPORT_C TInt GetAtt( const TDesC &aName, TUint &aAttValue );
+	IMPORT_C TInt SetAtt( const TDesC &aName, TUint aSetAttMask, TUint aClearAttMask );
+	IMPORT_C void SetHomeTimeL(const TTime aTime);
+	IMPORT_C TInt SetReadOnly(const TDesC& aName,TUint aSetAttMask);
+	IMPORT_C TInt CopyDirectoryL(const TDesC& aSource,const TDesC& aTarget);
+	IMPORT_C TInt ChangeFilePermissionL(const TDesC& aPath);
+	};
+
+enum TSmlTestUtilsService //Services provided by the SmlTestUtils server
+	{
+	EChangeDevId,
+	EGetDevId,
+	EWipeDataStore,
+	ECreateDir,
+	ERenameDir,
+	EDeleteDir,
+	ECreateFile,
+	EDeleteFile,
+	EDeleteFileUsingWildcard,
+	ECreateDSJob,
+	EStopDSJob,
+	ECreateDSProfile,
+	ESetHomeTime,
+	ECopyFile,
+	EReplaceFile,
+	EIsFilePresent,
+	ESetReadOnly,
+	EGetAttributes,
+	ESetAttributes,
+	ECopyDirectory,
+	EChangeFilePermission
+	};
+	
+enum TStoreType //Types of store that can be deleted using WipeDataStoreL()
+	{
+	ECenRep		= 0x01,		
+	ELocalSDS	= 0x02,
+	EDMTree		= 0x04,
+	ECenRepFiles = 0x08,// Deletes all the cen rep data files. This is a lengthy and volatile operation
+					    // and should be used with caution. Note that this is not covered by "EAll"
+					    // and should be called explicitly
+	ESDS		= ELocalSDS | ECenRep,
+	EAll		= 0xff
+	};
+
+#endif	// __APPFWK_TEST_UTILS_SERVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/uiftestfw/src/appfwk_test_AppUi.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,288 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+
+#include <eikmenub.h>
+#include <eikbtgpc.h>
+#include <eikenv.h>
+#include <hal.h>
+
+#include "appfwk_test_AppUi.h"
+
+
+EXPORT_C void PreallocateHALBuffer()
+	{
+	HAL::SEntry* pE=NULL;
+	TInt entries=0;
+	HAL::GetAll(entries, pE);
+	User::Free(pE);
+	}
+
+EXPORT_C void CloseAllPanicWindowsL()
+	{
+	RWsSession	ws;
+	User::LeaveIfError(ws.Connect());
+
+	TInt wgFocus = ws.GetFocusWindowGroup();
+
+	const TUint32 ENullWsHandle = 0xFFFFFFFF;	// Events delivered to this handle are thrown away
+	RWindowGroup wg = RWindowGroup(ws);
+
+	wg.Construct(ENullWsHandle);
+	TInt wgId = wg.Identifier();
+
+	TWsEvent event;
+	event.SetType(EEventKey);
+	TKeyEvent *keyEvent = event.Key();
+	keyEvent->iCode = EKeyEscape;
+	keyEvent->iScanCode = EStdKeyEscape;
+	keyEvent->iModifiers = 0;
+
+	TInt limit = 0;
+	for(limit = 0; wgFocus != wgId && (limit < 50); limit++)
+	{
+		ws.SendEventToAllWindowGroups(event);
+		wgFocus = ws.GetFocusWindowGroup();
+		RDebug::Print(_L("CloseAllPanicWindowsL() - EKeyEscape sent to Windows Group"));
+	}
+
+	// close everything
+	wg.Close();
+	ws.Close();
+	}
+
+
+EXPORT_C CAutoTestManager::CAutoTestManager(MAutoTestApp* aAutoTestApp) :
+	CActive(EPriorityIdle), iAutoTestApp(aAutoTestApp)
+	{
+	}
+
+
+EXPORT_C CAutoTestManager::~CAutoTestManager()
+	{
+	Cancel();
+	}
+	
+
+EXPORT_C CAutoTestManager* CAutoTestManager::NewL(MAutoTestApp* aAutoTestApp)
+	{
+     CAutoTestManager *theTestManager=new (ELeave) CAutoTestManager(aAutoTestApp);
+     CActiveScheduler::Add(theTestManager);
+	 return theTestManager;
+	}
+
+
+void CAutoTestManager::RunL()
+	{
+	__ASSERT_DEBUG(iAutoTestApp, User::Panic(KPanicNullPointer, KNullPointer));
+	iAutoTestApp->RunTestStepL(++iNumStep);
+	StartAutoTest();
+	}
+	
+
+void CAutoTestManager::DoCancel()
+	{
+	}
+
+
+/**
+  Init active object and set it active
+ */
+EXPORT_C void CAutoTestManager::StartAutoTest()
+	{
+	TRequestStatus *pS=(&iStatus);
+	User::RequestComplete(pS,0);
+	SetActive();
+	}
+
+
+/**
+  This function must be called after all test cases will be completed 	
+ */
+EXPORT_C void CAutoTestManager::FinishAllTestCases(TTestResult aResult)
+	{
+	iResult = aResult;
+	if(aResult != EPass)
+		{
+		RDebug::Print(_L("\nTest completed with error %d"), aResult);
+		}
+	CCoeEnv::Static()->Flush();
+	CBaActiveScheduler::Exit();
+	}
+	
+	
+/**
+  This function will set the internal test state variable to the user defined state.
+ */
+EXPORT_C void CAutoTestManager::SetTestCaseNumber(TInt aNumber)
+	{
+	iNumStep = aNumber;
+	}
+
+
+EXPORT_C CTestCoeAppUi::CTestCoeAppUi(CTestStep* aStep) :
+		iStep(aStep) 
+	{
+	}
+
+
+EXPORT_C CTestCoeAppUi::~CTestCoeAppUi()
+	{
+	if(iAutoTestManager)
+		{
+		iAutoTestManager->Cancel();
+		}
+	delete iAutoTestManager;
+	}
+	
+
+/**
+  Read thread local storage read and free thread local storage STL is used for storage  Auto attribute,  
+  it sets in an export function void ProcessParam(TAny* aParam)	
+ */
+EXPORT_C void CTestCoeAppUi::ConstructL()
+	{
+	iAutoTestManager = CAutoTestManager::NewL(this);
+	
+	CCoeAppUi::ConstructL();
+	}
+
+
+EXPORT_C CTestAppUi::CTestAppUi(CTestStep* aStep, const	TDesC& aRes, TInt aResourceHotKeysId,  TInt aResourceMenuBarId, TInt aResourceToolBarId) :
+		CEikAppUi(),
+		iResourceHotKeysId(aResourceHotKeysId), 
+		iResourceMenuBarId(aResourceMenuBarId),
+		iResourceToolBarId(aResourceToolBarId),
+		iStep(aStep)
+	{
+	iRes.Copy(aRes);
+	}
+
+
+EXPORT_C CTestAppUi::~CTestAppUi()
+	{
+	if(iResourceFileFlag)
+		{
+		CCoeEnv::Static()->DeleteResourceFile(iResourceFileFlag); 
+		}
+	
+	if(iAutoTestManager)
+		{
+		iAutoTestManager->Cancel();
+		}
+	delete iAutoTestManager;
+	
+	if(iMenuBar)
+		{
+		RemoveFromStack(iMenuBar);
+		}
+	delete iMenuBar;
+	
+	if(iToolBar)
+		{
+		RemoveFromStack(iToolBar);
+		}
+	delete iToolBar;
+	}
+
+
+/**
+   Load resource, create toolbar & menubar, read and free thread local storage	
+ */
+EXPORT_C void CTestAppUi::ConstructL()
+	{
+	iAutoTestManager = CAutoTestManager::NewL(this);
+	
+	if(iStep == 0)
+		{
+		BaseConstructL(ENoAppResourceFile);
+		}
+	else
+		{
+		CCoeAppUi::ConstructL();
+		}
+
+	if(iRes.Length() > 0)
+		{
+		CCoeEnv* coeEnv = CCoeEnv::Static();
+		TBuf8<256>	buf;
+		buf.Copy(iRes);
+		iResourceFileFlag=coeEnv->AddResourceFileL(iRes);
+		}
+
+	if(iResourceMenuBarId)
+		{
+		iMenuBar = new (ELeave) CEikMenuBar;
+		iMenuBar->ConstructL(this,iResourceHotKeysId,iResourceMenuBarId);
+		iMenuBar->MakeVisible(ETrue);
+		AddToStackL(iMenuBar);
+		}
+
+	if(iResourceToolBarId)
+		{
+		iToolBar=CEikButtonGroupContainer::NewL(CEikButtonGroupContainer::EToolbar, CEikButtonGroupContainer::EVertical, this, iResourceToolBarId);
+		const TRect boundingRect = ClientRect(); // make toolband stretch to the screen width by default
+		iToolBar->SetBoundingRect(boundingRect);
+		iToolBar->MakeVisible(ETrue);
+		AddToStackL(iToolBar);
+		}
+	}
+
+
+/**
+   Reduce client rectangle	
+ */
+EXPORT_C void CTestAppUi::ReduceRect(TRect& aRect) const
+	{
+	if(iMenuBar)
+		{
+		iMenuBar->ReduceRect(aRect);
+		}
+
+	if(iToolBar)
+		{
+		iToolBar->ReduceRect(aRect);
+		}
+	}
+
+
+/**
+  Hide menu from screen and pass on to the parent method
+ */
+EXPORT_C void CTestAppUi::ProcessCommandL(TInt aCommand)
+	{
+ 	if (iMenuBar && iMenuBar->IsVisible())
+		{
+		iMenuBar->StopDisplayingMenuBar();
+		}
+	if(aCommand != EEikCmdCanceled)
+		{
+		CEikAppUi::ProcessCommandL(aCommand);
+		}
+	}
+
+
+TInt  E32Dll()
+	{
+	return 0;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localisation/uiftestfw/src/appfwk_test_utils.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,242 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include <e32std.h>
+#include <e32math.h>
+
+#include "appfwk_test_utils.h"
+
+
+
+const TUid KServerUid3 = {0x10009FBD};
+
+
+/**
+  Start the server process. Simultaneous launching of two such processes should be detected when the second one attempts to
+  create the server object, failing with KErrAlreadyExists.
+*/
+static TInt StartServer()
+	{
+	const TUidType serverUid(KNullUid,KNullUid,KServerUid3);
+	RProcess server;
+	TInt r = server.Create(KTestServerImg,KNullDesC,serverUid);
+	if (r!=KErrNone)
+		{
+		return r;
+		}
+	
+	TRequestStatus stat;
+	server.Rendezvous(stat);
+	if (stat!=KRequestPending)
+		{
+		server.Kill(0);
+		}
+	else
+		{
+		server.Resume();
+		}
+
+	// wait for start or death
+	User::WaitForRequest(stat);	
+	server.Close();
+	
+	return stat.Int();
+	}
+
+
+/**
+  Connect to the server, attempting to start it if necessary
+*/
+EXPORT_C TInt RSmlTestUtils::Connect()
+	{
+	TInt retry=2;
+	for (;;)
+		{
+		TInt r=CreateSession(KTestServerName,TVersion(0,0,0),1);
+		if (r!=KErrNotFound && r!=KErrServerTerminated)
+			{
+			return r;
+			}
+		if (--retry==0)
+			{
+			return r;
+			}
+		r=StartServer();
+		if (r!=KErrNone && r!=KErrAlreadyExists)
+			{
+			return r;
+			}
+		}
+	}
+
+	
+EXPORT_C void RSmlTestUtils::SetDevIdL(const TDesC8& aDevId)
+	{
+	TIpcArgs args(&aDevId);
+	User::LeaveIfError(SendReceive(EChangeDevId,args));
+	}
+
+
+EXPORT_C void RSmlTestUtils::GetDevIdL(TDes8& aDevId)
+	{
+	TIpcArgs args(&aDevId);
+	User::LeaveIfError(SendReceive(EGetDevId, args));
+	}
+
+
+EXPORT_C TInt RSmlTestUtils::WipeDataStoreL(TWipeItems aItemsToClean)
+	{
+	TPckgBuf<TWipeItems> temp(aItemsToClean);
+	TIpcArgs args(&temp);
+	User::LeaveIfError(SendReceive(EWipeDataStore, args));
+	return KErrNone;
+	}
+	
+	
+EXPORT_C TInt RSmlTestUtils::RenameDirectoryL(const TDesC16& aSrc,const TDesC16& aDest)
+	{ // this implementation of this method does not leave but further derived implementations may if they choose
+	TIpcArgs args(&aSrc,&aDest);
+	TInt ret = SendReceive(ERenameDir, args);
+	return ret;
+	}
+
+
+EXPORT_C TInt RSmlTestUtils::CreateDirectoryL(const TDesC& aPath)
+	{ // this implementation of this method does not leave but further derived implementations may if they choose
+	TIpcArgs args(&aPath);
+	TInt ret = SendReceive(ECreateDir, args);
+	return ret;
+	}
+	
+
+EXPORT_C TInt RSmlTestUtils::DeleteDirectoryL(const TDesC& aPath)
+	{ // this implementation of this method does not leave but further derived implementations may if they choose
+	TIpcArgs args(&aPath);
+	TInt ret = SendReceive(EDeleteDir, args);
+	return ret;
+	}
+	
+	
+EXPORT_C TInt RSmlTestUtils::CreateFileL(const TDesC& aPath)
+	{ // this implementation of this method does not leave but further derived implementations may if they choose
+	TIpcArgs args(&aPath);
+	TInt ret = SendReceive(ECreateFile, args);
+	return ret;
+	}
+
+
+EXPORT_C TInt RSmlTestUtils::DeleteFileL(const TDesC& aPath)
+	{ // this implementation of this method does not leave but further derived implementations may if they choose
+	TIpcArgs args(&aPath);
+	TInt ret = SendReceive(EDeleteFile, args);
+	return ret;
+	}
+	
+	
+EXPORT_C TInt RSmlTestUtils::DeleteFileUsingWildcardL(const TDesC& aPath)
+	{ // this implementation of this method does not leave but further derived implementations may if they choose
+	TIpcArgs args(&aPath);
+	TInt ret = SendReceive(EDeleteFileUsingWildcard, args);
+	return ret;
+	}
+	
+	
+EXPORT_C TInt RSmlTestUtils::CopyFileL(const TDesC& aSrc,const TDesC& aDest)
+	{ // this implementation of this method does not leave but further derived implementations may if they choose
+	TIpcArgs args(&aSrc,&aDest);
+	TInt ret = SendReceive(ECopyFile, args);
+	return ret;
+	}
+	
+// lint warning stating that aTime could be a const reference,
+// but since this is derived from product code, it cannot be
+// changed here, and hence the warning is suppressed
+//lint -efunc(1746,RSmlTestUtils::SetHomeTimeL)	
+EXPORT_C void RSmlTestUtils::SetHomeTimeL(const TTime aTime)
+	{
+	TPckgBuf<TTime> temp(aTime);
+	TIpcArgs args(&temp);
+	User::LeaveIfError(SendReceive(ESetHomeTime, args));
+	}
+
+
+EXPORT_C TInt RSmlTestUtils::ReplaceFileL(const TDesC& aName,TUint aFileMode)
+	{ // this implementation of this method does not leave but further derived implementations may if they choose
+	TPckgBuf<TUint> temp(aFileMode);
+	TIpcArgs args(&aName,&temp);
+	TInt ret = SendReceive(EReplaceFile, args);
+	return ret;
+	}
+	
+
+EXPORT_C TInt RSmlTestUtils::IsFilePresent(const TDesC& aName, TBool &aPresent)
+	{
+	TPckgBuf<TBool> present(aPresent);
+	TIpcArgs args(&aName,&present);
+	TInt ret = SendReceive(EIsFilePresent, args);
+	aPresent = present();
+	return ret;
+	}
+
+
+EXPORT_C TInt RSmlTestUtils::SetReadOnly(const TDesC& aName,TUint aSetAttMask)
+	{
+	TPckgBuf<TUint> temp(aSetAttMask);
+	TIpcArgs args(&aName,&temp);
+	TInt ret = SendReceive(ESetReadOnly,args);
+	return ret;
+	}
+
+	
+EXPORT_C TInt RSmlTestUtils::GetAtt( const TDesC& aName, TUint& aAttValue )
+	{
+	TPckgBuf<TUint> attPckg( aAttValue ); 
+	TIpcArgs args( &aName, &attPckg );	
+	TInt ret = SendReceive( EGetAttributes, args );
+	aAttValue = attPckg();
+	return ret;	
+	}
+		
+		
+EXPORT_C TInt RSmlTestUtils::SetAtt( const TDesC &aName, TUint aSetAttMask, TUint aClearAttMask )
+	{
+	TIpcArgs args( &aName, &aSetAttMask, &aClearAttMask );
+	TInt ret = SendReceive( ESetAttributes, args );
+	return ret;		
+	}
+
+
+EXPORT_C TInt RSmlTestUtils::CopyDirectoryL(const TDesC& aSource,const TDesC& aTarget)
+	{ // this implementation of this method does not leave but further derived implementations may if they choose
+	TIpcArgs args(&aSource,&aTarget);
+	TInt ret = SendReceive(ECopyDirectory, args);
+	return ret;
+	}
+
+
+EXPORT_C TInt RSmlTestUtils::ChangeFilePermissionL(const TDesC& aPath)
+	{ // this implementation of this method does not leave but further derived implementations may if they choose
+	TIpcArgs args(&aPath);
+	TInt ret = SendReceive(EChangeFilePermission, args);
+	return ret;	
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediamgmt/Bmarm/MediaMgmtSmokeTestModuleU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediamgmt/Bwins/MediaMgmtSmokeTestModuleU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediamgmt/EABI/MediaMgmtSmokeTestModuleU.def	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediamgmt/conf/MediaMgmtSmokeTestModule.cfg	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,14 @@
+[Test]
+title Fetch Images
+run testscripter c:\smoketest\UI_MediaMgmtSmokeTestModule.cfg 1
+[Endtest]
+
+[Test]
+title Fetch Audio
+run testscripter c:\smoketest\UI_MediaMgmtSmokeTestModule.cfg 2
+[Endtest]
+
+[Test]
+title Fetch Video
+run testscripter c:\smoketest\UI_MediaMgmtSmokeTestModule.cfg 3
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediamgmt/conf/UI_MediaMgmtSmokeTestModule.cfg	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,29 @@
+[Test]
+title Fetch Images
+create MediaMgmtSmoketestModule mediamgmt
+bringtoforeground
+mediamgmt ListMediaItems Images pa ra me ters
+pause 7000
+presskey global EKeyDevice0
+delete mediamgmt
+[Endtest] 
+
+[Test]
+title Fetch Audio
+create MediaMgmtSmoketestModule mediamgmt
+bringtoforeground
+mediamgmt ListMediaItems Audio pa ra me ters
+pause 7000
+presskey global EKeyDevice0
+delete mediamgmt
+[Endtest]
+
+[Test]
+title Fetch Video
+create MediaMgmtSmoketestModule mediamgmt
+bringtoforeground
+mediamgmt ListMediaItems Video pa ra me ters
+pause 7000
+presskey global EKeyDevice0
+delete mediamgmt
+[Endtest] 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediamgmt/group/Bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description:
+*
+*/
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+	
+	DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+	../conf/MediaMgmtSmokeTestModule.cfg	c:/smoketest/MediaMgmtSmokeTestModule.cfg
+	../conf/UI_MediaMgmtSmokeTestModule.cfg	c:/smoketest/UI_MediaMgmtSmokeTestModule.cfg
+
+PRJ_TESTMMPFILES
+
+	MediaMgmtSmokeTestModule.mmp
+
+// Specify the .mmp files required for building the important component
+// releasables.
+//
+// Specify "tidy" if the component you need to build doesn't need to be
+// released. Specify "ignore" if the MMP file exists but should be
+// ignored.
+// Example:
+/*
+\agnmodel\group\agnmodel.mmp
+#if defined(MARM)
+\agnmodel\group\agsvexe.mmp
+#endif
+*/
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediamgmt/group/MediaMgmtSmokeTestModule.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,74 @@
+/*TYPE TESTCLASS*/
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: MMP file for STIF Test Framework's TestScripter 
+* testclass test module.
+*
+*/
+
+#include <platform_paths.hrh>
+
+TARGET          MediaMgmtSmokeTestModule.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         MediaMgmtSmokeTestModule.def
+
+USERINCLUDE     ../inc 
+
+MW_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      ../src
+
+SOURCE          MediaMgmtSmokeTestModule.cpp
+SOURCE          MediaMgmtSmokeTestModuleBlocks.cpp MediaMgmtObserver.cpp
+
+LIBRARY         euser.lib
+LIBRARY			bafl.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY			MGFetch.lib
+
+LANG            SC
+
+/*
+START WINS      
+?wins_specific_information
+END
+
+START MARM
+?marm_specific_information
+END
+*/
+// Other possible keywords:
+ 
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+/*
+START BITMAP ?target
+TARGETPATH   ?emulated_path_on_target_machine
+HEADER
+SOURCE       ?color_depth ?source_bitmap
+END
+*/
+// DEFFILE ?filename
+// AIF ?filename
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediamgmt/inc/MediaMgmtObserver.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+#ifndef MEDIAMGMTOBSERVER_H
+#define MEDIAMGMTOBSERVER_H
+
+#include <MMGFetchVerifier.h>
+#include <MMGFetchCanceler.h>
+
+class MediaMgmtObserver : public MMGFetchCanceler, public MMGFetchVerifier
+{
+public:
+	TBool VerifySelectionL( const MDesCArray* /*aSelectedFiles*/ );
+	void CancelFetcherL();
+};
+
+#endif      // MEDIAMGMTOBSERVER_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediamgmt/inc/MediaMgmtSmokeTestModule.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,184 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: STIF testclass declaration
+*
+*/
+
+#ifndef MEDIAMGMTSMOKETESTMODULE_H
+#define MEDIAMGMTSMOKETESTMODULE_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KMediaMgmtSmokeTestModuleLogPath, "\\logs\\testframework\\MediaMgmtSmokeTestModule\\" ); 
+// Log file
+_LIT( KMediaMgmtSmokeTestModuleLogFile, "MediaMgmtSmokeTestModule.txt" ); 
+_LIT( KMediaMgmtSmokeTestModuleLogFileWithTitle, "MediaMgmtSmokeTestModule_[%S].txt" );
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CMediaMgmtSmokeTestModule;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+
+// CLASS DECLARATION
+
+/**
+*  CMediaMgmtSmokeTestModule test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CMediaMgmtSmokeTestModule) : public CScriptBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CMediaMgmtSmokeTestModule* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMediaMgmtSmokeTestModule();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CScriptBase Runs a script line.
+        * @since ?Series60_version
+        * @param aItem Script line containing method name and parameters
+        * @return Symbian OS error code
+        */
+        virtual TInt RunMethodL( CStifItemParser& aItem );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMediaMgmtSmokeTestModule( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+        * Test methods are listed below. 
+        */
+
+        /**
+        * test method.
+        * @since ?Series60_version
+        * @param aItem Script line containing parameters.
+        * @return Symbian OS error code.
+        */
+        virtual TInt ListMediaItemsL( CStifItemParser& aItem );
+        
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+        //ADD NEW METHOD DEC HERE
+        //[TestMethods] - Do not remove
+
+    public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // MEDIAMGMTSMOKETESTMODULE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediamgmt/src/MediaMgmtObserver.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+#include "MediaMgmtObserver.h"
+
+TBool MediaMgmtObserver::VerifySelectionL( const MDesCArray* /*aSelectedFiles*/ )
+	{
+	TBool ret=ETrue;
+	return ret;
+	}
+
+void MediaMgmtObserver::CancelFetcherL() {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediamgmt/src/MediaMgmtSmokeTestModule.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,199 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains testclass implementation.
+*
+*/
+
+// INCLUDE FILES
+#include <Stiftestinterface.h>
+#include "MediaMgmtSmokeTestModule.h"
+#include <SettingServerClient.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CMediaMgmtSmokeTestModule::CMediaMgmtSmokeTestModule
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMediaMgmtSmokeTestModule::CMediaMgmtSmokeTestModule( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CMediaMgmtSmokeTestModule::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CMediaMgmtSmokeTestModule::ConstructL()
+    {
+    //Read logger settings to check whether test case name is to be
+    //appended to log file name.
+    RSettingServer settingServer;
+    TInt ret = settingServer.Connect();
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        }
+    // Struct to StifLogger settigs.
+    TLoggerSettings loggerSettings; 
+    // Parse StifLogger defaults from STIF initialization file.
+    ret = settingServer.GetLoggerSettings(loggerSettings);
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        } 
+    // Close Setting server session
+    settingServer.Close();
+
+    TFileName logFileName;
+    
+    if(loggerSettings.iAddTestCaseTitle)
+        {
+        TName title;
+        TestModuleIf().GetTestCaseTitleL(title);
+        logFileName.Format(KMediaMgmtSmokeTestModuleLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KMediaMgmtSmokeTestModuleLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KMediaMgmtSmokeTestModuleLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// CMediaMgmtSmokeTestModule::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CMediaMgmtSmokeTestModule* CMediaMgmtSmokeTestModule::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CMediaMgmtSmokeTestModule* self = new (ELeave) CMediaMgmtSmokeTestModule( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CMediaMgmtSmokeTestModule::~CMediaMgmtSmokeTestModule()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+
+    }
+
+//-----------------------------------------------------------------------------
+// CMediaMgmtSmokeTestModule::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CMediaMgmtSmokeTestModule::SendTestClassVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("MediaMgmtSmokeTestModule.dll");
+
+	TBool newVersionOfMethod = ETrue;
+	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+	}
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CMediaMgmtSmokeTestModule::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediamgmt/src/MediaMgmtSmokeTestModuleBlocks.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,208 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains testclass implementation.
+*
+*/
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+#include <MGFetch.h>
+#include <mediafiletypes.hrh>
+#include "MediaMgmtSmokeTestModule.h"
+#include "MediaMgmtObserver.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+_LIT(KTypeImage, "Images");
+_LIT(KTypeAudio, "Audio");
+_LIT(KTypeVideo, "Video");
+_LIT(KTypeAny,	 "Any");
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CMediaMgmtSmokeTestModule::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CMediaMgmtSmokeTestModule::Delete() 
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CMediaMgmtSmokeTestModule::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CMediaMgmtSmokeTestModule::RunMethodL( 
+    CStifItemParser& aItem ) 
+    {
+
+    static TStifFunctionInfo const KFunctions[] =
+        {  
+        // Copy this line for every implemented function.
+        // First string is the function name used in TestScripter script file.
+        // Second is the actual implementation member function. 
+        ENTRY( "ListMediaItems", CMediaMgmtSmokeTestModule::ListMediaItemsL ),
+        //ADD NEW ENTRY HERE
+        // [test cases entries] - Do not remove
+
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CMediaMgmtSmokeTestModule::ExampleL
+// Example test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CMediaMgmtSmokeTestModule::ListMediaItemsL( CStifItemParser& aItem )
+    {
+    CPtrCArray* expectedItems = new (ELeave) CPtrCArray(5);
+    CleanupArrayDeletePushL(expectedItems);
+    
+    // Print to UI
+    _LIT( KMediaMgmtSmokeTestModule, "MediaMgmtSmokeTestModule" );
+    _LIT( KListImages, "In ListMediaItemsL" );
+    TestModuleIf().Printf( 0, KMediaMgmtSmokeTestModule, KListImages );
+    // Print to log file
+    iLog->Log( KListImages );
+
+    TInt i = 0;
+    TPtrC type;
+    _LIT( KParam, "Param[%i]: %S" );
+    if ( aItem.GetNextString( type ) == KErrNone )
+    	{
+    	TPtrC itemPath;
+    	while ( aItem.GetNextString ( itemPath ) == KErrNone )
+    		{
+    		TestModuleIf().Printf( i, KMediaMgmtSmokeTestModule, 
+									KParam, i, &itemPath );
+    		expectedItems->AppendL( itemPath );
+    		i++;
+    		}
+    
+    	CDesCArrayFlat* media = new (ELeave) CDesCArrayFlat(5);
+    	CleanupArrayDeletePushL(media);
+    	
+    	// work out the file type we are looking for
+    	TMediaFileType mediaType;
+    	if (type == KTypeImage)
+    		{
+    		mediaType = EImageFile;
+    		}
+    	else if (type == KTypeAudio)
+    		{
+    		mediaType = EAudioFile;
+    		}
+    	else if (type == KTypeVideo)
+    		{
+    		mediaType = EVideoFile;
+    		}
+    	else
+    		{
+    		User::Leave(KErrArgument);
+    		}
+    	
+    	MediaMgmtObserver* observer = new (ELeave) MediaMgmtObserver;
+    
+    	if (MGFetch::RunL(*media, mediaType, EFalse, observer))
+    		{
+    		//compare the two
+    		TInt total = media->Count();
+    		}
+    
+    	CleanupStack::PopAndDestroy(media);
+    	}
+    
+    CleanupStack::PopAndDestroy(expectedItems);
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CMediaMgmtSmokeTestModule::?member_function
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*
+TInt CMediaMgmtSmokeTestModule::?member_function(
+   CItemParser& aItem )
+   {
+
+   ?code
+
+   }
+*/
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+//  [End of File] - Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Group/Smoketest_Mess.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,82 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// using relative paths for sourcepath and user includes
+// 
+//
+
+TARGET			Smoketest_Mess_Server.exe
+TARGETTYPE		exe
+UID				0x1000007A 0x101F7774
+
+#if (!defined __NO_VENDORID__)
+VENDORID		0x70000001
+#endif
+
+CAPABILITY		ReadUserData WriteUserData WriteDeviceData NetworkServices
+
+#if (defined _PLATTEST_CDMA_)
+MACRO			CDMA_API_ENABLED
+MACRO			GSM_COMPATIBILITY_MODE
+#endif
+
+SOURCEPATH		..\Src
+
+SOURCE			TestMessServer.cpp
+SOURCE			TestMessSession.cpp
+SOURCE			TestMessSharedData.cpp
+SOURCE			TestMessWatcher.cpp
+SOURCE			TestMessProcessor.cpp
+SOURCE			TestMessTimer.cpp
+SOURCE			TestMessBase.cpp
+SOURCE			TestMessCleanMessageFolder.cpp
+SOURCE			TestMessCreateSmsAccount.cpp
+SOURCE			TestMessSetDefaultSc.cpp
+SOURCE			TestMessCreateSMS.cpp
+SOURCE			TestMessCreateGsmSmsUtil.cpp
+#ifdef _PLATTEST_CDMA_
+SOURCE			TestMessCreateCdmaSmsUtil.cpp
+#endif
+SOURCE			TestMessCreateSmsUtilBase.cpp
+SOURCE			TestMessProcessExistingMsg.cpp
+SOURCE			TestMessEditEntry.cpp
+SOURCE			TestMessStoreProcessUtil.cpp
+SOURCE			TestMessEditEntryUtil.cpp
+SOURCE			TestMessPrintEntryUtil.cpp
+
+USERINCLUDE		..\Inc 
+USERINCLUDE		..\..\Group
+
+SYSTEMINCLUDE	\Epoc32\include
+SYSTEMINCLUDE	\Epoc32\include\Test
+
+LIBRARY			etel.lib
+LIBRARY			schsend.lib
+LIBRARY			estor.lib
+LIBRARY			euser.lib
+LIBRARY			bafl.lib
+LIBRARY			msgs.lib
+LIBRARY			fbscli.lib
+LIBRARY			imcm.lib
+LIBRARY			efsrv.lib
+LIBRARY			sendas2.lib
+LIBRARY			etext.lib
+LIBRARY			smcm.lib
+
+LIBRARY			gsmu.lib
+LIBRARY			esock.lib
+LIBRARY			smsu.lib
+LIBRARY			TestExecuteUtils.lib 
+LIBRARY			TestExecuteLogClient.lib
+LIBRARY			SmokeTest_Utils.lib
+LIBRARY			etelmm.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Group/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,27 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Integration test system build description file for self test suite
+// 
+//
+
+PRJ_TESTEXPORTS
+
+../Scripts/Smoketest_CreateSmsAccount.script	z:/smoketest/smoketest_createsmsaccount.script
+../Scripts/setup_Smoketest_Mess.script			z:/smoketest/setup_smoketest_mess.script
+../Scripts/Smoketest_Mess.script				z:/smoketest/smoketest_mess.script
+../TestData/Sms/Message1.txt					z:/smoketest/sms/message1.txt
+../TestData/Smoketest_Mess.ini			   		z:/smoketest/smoketest_mess.ini
+
+PRJ_TESTMMPFILES
+Smoketest_Mess.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Inc/TestMess.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,26 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMess which contains common constants
+// 
+//
+
+#if (!defined __TEST_MESS_H__)
+#define __TEST_MESS_H__
+
+/*@{*/
+/// Literals defined for SMS account details
+_LIT(KSmsAccountName,	"Short Message");
+/*@}*/ 
+
+#endif /* __TEST_MESS_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Inc/TestMessBase.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,126 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessBase which is the base class for all 
+// messaging test steps
+// 
+//
+
+
+#if (!defined __TEST_MESS_BASE_H__)
+#define __TEST_MESS_BASE_H__
+
+#include "Configuration.cfg"
+
+#include <msvapi.h>
+#include <SmutHdr.h>
+#include <TestExecuteStepBase.h>
+#include <EMSFormatIE.h>
+#include <EMSSoundIE.h>
+#include <EMSAnimationIE.h>
+#include <IAPPrefs.h>
+
+#include "TestMessProcessor.h"
+#include "TestMessTimer.h"
+
+#include <smut.h>
+#include <Smutset.h>
+#include <etelmm.h>
+#if (defined CDMA_API_ENABLED)
+#include <SmsMessageWrappers.h>
+#include <SmsMessageSettings.h>
+#endif
+#include <SmutHdr.h>
+
+#include <TestStepSmokeTest.h>
+//To check whether the reply quoted is set
+_LIT(KReplyQuoted,		"SmsReplyQuoted");
+
+const TUid KUidMsvSMSHeaderStream				= {0x10001834};
+const TUid KUidMsgFileInternetAccessPreferences	= {0x1000924B};
+const TUid KUidMsvDefaultServices				= {0x100017FD};
+
+const TInt	KOneSecond = 1000000;
+
+class	CParaFormatLayer;
+class 	CCharFormatLayer;
+class 	CRichText;
+
+class CTestMessBase : public CTestStepSmokeTest, private MMsvSessionObserver
+	{
+public:
+	CTestMessBase(TBool aSetDirectory);
+	virtual ~CTestMessBase();
+
+	virtual TVerdict	doTestStepPreambleL();
+	virtual TVerdict	doTestStepPostambleL();
+
+	void							SetEntryL(TMsvId	aId);
+	CMsvEntry&						EntryL();
+	TBool							HasEntry() const { return iEntry!=NULL; }
+	const TMsvSelectionOrdering&	SelectionOrdering() const { return iOrder; }
+	CMsvSession&					Session() const { return *iSession; }
+	void							PrintEntryL(CMsvEntry& aEntry);
+	CEmsPreDefSoundIE*				NewPreDefSoundL(const TDesC& aPreDefType);
+
+
+protected:
+	//	MMsvSessionObserver
+	void			HandleSessionEventL(TMsvSessionEvent, TAny*, TAny*, TAny*);
+
+	//	Utilities
+	static HBufC8*	CopyToBuf8LC(const TDesC& aPtrC);
+	static HBufC*	CopyToBufLC(const TDesC8& aPtr8);
+	void			PrintTreeL(TMsvId aRoot);
+	void			IssueTimerRequest();
+
+
+	void			PrepareSmsHeaderFromIniFileL(CSmsHeader& aSmsHeader);
+
+	//reads the schedule time from ini file
+	TTimeIntervalMinutes	ReadScheduleTime();
+
+private:
+	//	PrintEntry helper functions
+	void			PrintStoreL(CMsvEntry& aEntry);
+	void			PrintStoreSmtpL(CMsvEntry& aEntry);
+	void			PrintStorePop3L(CMsvEntry& aEntry);
+	void			PrintStoreImap4L(CMsvEntry& aEntry);
+	void			PrintStoreSmsL(CMsvEntry& aEntry);
+
+	//	PrepareSmsHeaderFromIniFileL helper functions
+	void			SetAlignmentFormat(CEmsFormatIE& aEmsFormatIE, const TDesC& aAlignment);
+	void			SetFontSizeFormat(CEmsFormatIE& aEmsFormatIE, const TDesC& aFontSize);
+
+	CEmsPreDefAnimationIE*	NewPreDefAnimationL(const TDesC& aPreDefType);
+	CFbsBitmap*				NewBitmapL(const TParse& aFileName, const TDesC& aObjectSize);
+
+protected:
+	CMsvSession*				iSession;
+	CTestMessProcessor*			iMessageProcessor;
+	CParaFormatLayer*			iParaFormatLayer;
+ 	CCharFormatLayer*			iCharFormatLayer;
+ 	CRichText*					iBodyText;
+    TBool						iBodyAvailable;
+
+
+private:
+    TBool						iCheckForSim;
+	TBool						iSetDirectory;
+	CTestMessTimer*				iMessageTimer;
+	CActiveScheduler*			iSchedular;
+	CMsvEntry*					iEntry;
+	TMsvSelectionOrdering		iOrder;
+	};
+
+#endif /* __TEST_MESS_BASE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Inc/TestMessCleanMessageFolder.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,38 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessCleanMessageFolder which cleans out all the
+// message folders
+// 
+//
+
+#if (!defined __TEST_MESS_CLEAN_MESSAGE_FOLDER_H__)
+#define __TEST_MESS_CLEAN_MESSAGE_FOLDER_H__
+
+#include "TestMessBase.h"
+
+class CTestMessCleanMessageFolder : public CTestMessBase
+{
+public:
+	CTestMessCleanMessageFolder();
+
+	virtual	TVerdict	doTestStepL();
+
+private:
+	void	CleanFolders(const TMsvId aEntryId);
+
+private:
+	TInt	iNumberOfMessagesToDelete;
+};
+
+#endif /* __TEST_MESS_CLEAN_MESSAGE_FOLDER_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Inc/TestMessCreateCdmaSmsUtil.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,56 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This class creates a Cdma sms header and service settings. It sets the fields by reading
+// from the ini file
+// 
+//
+ 
+
+#if (!defined __TEST_MESS_CREATE_CDMA_SMS_UTIL_H__)
+#define __TEST_MESS_CREATE_CDMA_SMS_UTIL_H__
+
+#include "TestMessCreateSmsUtilBase.h"
+
+/**
+ This class creates a Cdma sms header and service settings.It sets the fields by reading
+ from the ini file
+*/
+class CTestMessCreateCdmaSmsUtil : public CTestMessCreateSmsUtilBase
+{
+public:
+	//Constructor
+	CTestMessCreateCdmaSmsUtil(CTestMessBase &aTestStep);
+
+	//Creates a new header
+	CSmsHeader* NewHeaderL(CRichText &aBodyText);
+
+	//Sets the fields of the header
+	void PrepareHeaderL(CSmsHeader &aSmsHeader);
+
+	//Sets the account settings.
+	void SetSmsAccountSettings(CSmsSettings &aSmsSettings);
+
+private:
+	//Gets the message type of the SMS
+	TSmsMessageType GetMessageTypeId(TPtrC aMessageType);
+	
+	//Gets the tele service ID
+	tia637::TTeleserviceId GetTeleServiceId(TPtrC aTeleService);
+
+	//Gets the message conversion ID
+	TSmsPIDConversion GetMessageConversionId(TPtrC aMessageConversion);
+	
+};
+
+#endif /* __TEST_MESS_CREATE_CDMA_SMS_UTIL_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Inc/TestMessCreateGsmSmsUtil.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,56 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This class creates the Gsm sms header and service settings. It fills up the
+// fields using data read from the ini file
+// 
+//
+
+
+#if (!defined __TEST_MESS_CREATE_GSM_SMS_UTIL_H__)
+#define __TEST_MESS_CREATE_GSM_SMS_UTIL_H__
+
+#include "TestMessCreateSmsUtilBase.h"
+
+/**
+ This class creates the Gsm sms header and the GSM SMS service settings. 
+ The data is read from the ini file.
+*/
+class CTestMessCreateGsmSmsUtil : public CTestMessCreateSmsUtilBase
+	{
+public:
+	//Constructor
+	CTestMessCreateGsmSmsUtil(CTestMessBase &aTestStep);
+
+	/**
+	 Prepare sms account details
+	*/
+	virtual void		PrepareAccountL(CMsvSession& aSession);
+
+	/**
+	 Creates the new header object
+	*/
+	virtual CSmsHeader*	NewHeaderL(CRichText &aBodyText);
+
+	/**
+	 Fills up the fields of the sms header object
+	*/
+	virtual void 		PrepareHeaderL(CSmsHeader &aSmsHeader);
+
+	/**
+	 Fills up the fields of the sms account settings 
+	*/
+	virtual void 		SetSmsAccountSettings(CSmsSettings &aSmsSettings);
+	};
+
+#endif /* __TEST_MESS_CREATE_GSM_SMS_UTIL_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Inc/TestMessCreateSMS.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,64 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessCreateSMS. This class creates the sms message 
+// for GSM or CDMA. For CDMA mtm, it uses utility classes to create 
+// the respective GSM or CDMA sms message
+// 
+//
+
+#if (!defined __TEST_MESS_CREATE_SMS_H__)
+#define __TEST_MESS_CREATE_SMS_H__
+
+//Epoc include
+#include <SmokeTestActive.h>
+#include <sendas2.h>
+#include <csendasaccounts.h>
+#include <csendasmessageTypes.h>
+
+#include "TestMessBase.h"
+#include "TestMessCreateSmsUtilBase.h"
+
+/**
+ This class creates the sms message for GSM or CDMA. For CDMA mtm, it 
+ uses utility classes to create the respective GSM or CDMA sms message
+*/
+class CTestMessCreateSMS : public CTestMessBase
+,	private MTestActiveCallback
+	{
+public:
+	CTestMessCreateSMS();
+
+	virtual	TVerdict	doTestStepPreambleL();
+	virtual	TVerdict	doTestStepL();
+
+protected:
+	virtual void		AddMtmCapabilitiesL(RSendAs& aSendAs);
+	virtual void		PrepareSendAsL(RSendAsMessage& aSendAs);
+	virtual void		PrepareHeaderL(CTestMessCreateSmsUtilBase& aCreateUtil, CSmsHeader& aSmsHeader);
+	void				ConCatMessageTextL(CSmsHeader& aHeader);
+	void				CreateSmsL(const TMsvId aMsvId, TTimeIntervalMinutes aScheduledTime);
+
+private:
+	virtual void	RunL() { CActiveScheduler::Stop(); }
+	/**
+	* Method from which CTestActive informs the user DoCancel call
+	*/
+	virtual void	DoCancel() { }
+
+private:
+	TBool							iSimInDatabase;
+	RMobilePhone::TMobileAddress	iSimPhoneNumber;
+	};
+
+#endif /* __TEST_MESS_CREATE_SMS_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Inc/TestMessCreateSMSaccount.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,36 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestMessCreateSmsAccount.cpp
+// This contains CTestMessCreateSmsAccount which creates an SMS
+// account folder for GSM or CDMA
+// 
+//
+
+#if (!defined __TEST_MESS_CREATE_SMS_ACCOUNT_H__)
+#define __TEST_MESS_CREATE_SMS_ACCOUNT_H__
+
+#include "TestMessBase.h"
+
+/**
+ This class creates an SMS account folder for GSM or CDMA
+*/
+class CTestMessCreateSmsAccount : public CTestMessBase
+	{
+public:
+	CTestMessCreateSmsAccount();
+
+	virtual	TVerdict	doTestStepL();
+	};
+
+#endif /* __TEST_MESS_CREATE_SMS_ACCOUNT_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Inc/TestMessCreateSmsUtilBase.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,81 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This class is the base class for create CDMA or GSM SMS utility class
+// 
+//
+
+#if (!defined __TEST_MESS_CREATE_SMS_UTIL_BASE_H__)
+#define __TEST_MESS_CREATE_SMS_UTIL_BASE_H__
+
+#include "TestMessBase.h"
+
+// EPOC includes
+#include <mtmuids.h>
+#include <txtrich.h>
+
+#include <smut.h>
+
+/*@{*/
+_LIT(KBearer,				"bearer");
+_LIT(KEncoding,				"encoding");
+_LIT(KDef,					"default");
+_LIT(KDefBearer,			"smsbearer");
+_LIT(KDefEncoding,			"smsencoding");
+_LIT(KDefDeliveryReport,	"smsDeliveryReport");
+_LIT(KDeliveryReport,		"DeliveryReport");
+_LIT(KRejectDuplicate,		"SmsRejectDuplicate");
+_LIT(KReplyPath,			"SmsReplyPath");
+_LIT(KConCatenate,			"SmsConCatenate");
+
+_LIT(KBearerWap,			"wap");
+_LIT(KBearerWapSecure,		"wapsecure");
+/*@}*/
+
+/**
+ This class is the base class for create GSM or CDMA SMS utility classes
+*/
+class CTestMessCreateSmsUtilBase : public CBase
+	{
+public:
+	//Constructor
+	CTestMessCreateSmsUtilBase(CTestMessBase &aTestStep);
+
+	/**
+	 Prepare sms account details
+	*/
+	virtual void		PrepareAccountL(CMsvSession& aSession) = 0;
+
+	/**
+	 Creates the new header object
+	*/
+	virtual CSmsHeader*	NewHeaderL(CRichText &aBodyText) = 0;
+
+	/**
+	 Fills up the fields of the sms header object
+	*/
+	virtual void 		PrepareHeaderL(CSmsHeader &aSmsHeader) =0;
+
+	/**
+	 Fills up the fields of the sms account settings 
+	*/
+	virtual void 		SetSmsAccountSettings(CSmsSettings &aSmsSettings) =0;
+
+protected:
+	/**
+	 Reference to the test step which creates the utility class
+	*/
+	CTestMessBase&		iTestStep;
+	};
+
+#endif /* __TEST_MESS_CREATE_SMS_UTIL_BASE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Inc/TestMessEditEntry.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,64 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessEditEntry which edits the entry characterstics
+// 
+//
+
+
+#if (!defined __TEST_MESS_EDIT_ENTRY_H__)
+#define __TEST_MESS_EDIT_ENTRY_H__
+
+#include "TestMessProcessExistingMsg.h"
+
+/**
+ This class edits the entry characteristics
+*/
+class CTestMessEditEntry : public CTestMessProcessExistingMsg
+{
+public:
+	CTestMessEditEntry() { SetTestStepName(_L("EditEntry")); }
+
+	virtual	void ProcessMessageL(CBaseMtm& aBaseMtm, TMsvId aMsgId);
+
+	//Move the message to different folder
+	void MoveMessageL(TMsvId aMessageId,TMsvId aFolderId);
+
+	/**
+	 This class is used for asynchronous operation for move
+	 message operation
+	*/
+	class CMoveOperation: public CActive
+		{
+	public:
+		//Pure virtual implementation of CActive
+		void RunL();
+
+		//Pure virtual implementation of CActive
+		void DoCancel();
+		
+		//Set the operation as active
+		void SetOperation();
+
+		//Two phase construction
+		static CMoveOperation* NewL();
+	private:
+		//Second phase construction
+		void ConstructL();
+
+		//Constructor
+		CMoveOperation();
+		};
+};
+
+#endif /* __TEST_MESS_EDIT_ENTRY_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Inc/TestMessEditEntryUtil.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,54 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessEditEntryUtil. A utility to edit an entry
+// 
+//
+
+#if (!defined __TEST_MESS_EDIT_ENTRY_UTIL_H__)
+#define __TEST_MESS_EDIT_ENTRY_UTIL_H__
+
+#include "TestMessStoreProcessUtil.h"
+
+/**
+ This class is a utility to edit an entry
+*/
+class CTestMessEditEntryUtil : public CTestMessStoreProcessUtil
+{
+public:
+	CTestMessEditEntryUtil(CTestMessBase& aTestStep, TBool aSimChecked, TBool aSimInDatabase, RMobilePhone::TMobileAddress aSimPhoneNumber);
+
+protected:
+	// Process the CImHeader information
+	virtual void	ProcessImHeaderL(CImHeader& aHeader);
+
+	// Process the CImMimeHeader information
+	virtual void	ProcessImMimeHeaderL(CImMimeHeader& aHeader);
+
+	// Process the CImIAPPreferences information
+	virtual void	ProcessInternetAccessPreferencesL(CImIAPPreferences& aPreferences);
+
+	// Process the CSmsHeader information
+	virtual void	ProcessSmsHeaderStreamL(CSmsHeader& aHeader);
+
+
+	// Process the CRichText information
+	virtual void	ProcessRichTextBodyL(CRichText& aBodyText);
+
+private:
+	TBool							iSimChecked;
+	TBool							iSimInDatabase;
+	RMobilePhone::TMobileAddress	iSimPhoneNumber;
+};
+
+#endif /* __TEST_MESS_EDIT_ENTRY_UTIL_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Inc/TestMessPrintEntryUtil.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,56 @@
+/**
+* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* This contains CTestMessEditEntryUtil. A utility to edit an entry
+* 
+*
+*/
+
+
+
+
+
+/**
+ @file TestMessPrintEntryUtil.h
+*/
+
+#if (!defined __TEST_MESS_PRINT_ENTRY_UTIL_H__)
+#define __TEST_MESS_PRINT_ENTRY_UTIL_H__
+
+#include "TestMessStoreProcessUtil.h"
+
+class CTestMessPrintEntryUtil : public CTestMessStoreProcessUtil
+{
+public:
+	CTestMessPrintEntryUtil(CTestMessBase& aTestStep);
+
+protected:
+	// Process the CImHeader information
+	virtual void	ProcessImHeaderL(CImHeader& aHeader);
+
+	// Process the CImMimeHeader information
+	virtual void	ProcessImMimeHeaderL(CImMimeHeader& aHeader);
+
+	// Process the CImIAPPreferences information
+	virtual void	ProcessInternetAccessPreferencesL(CImIAPPreferences& aPreferences);
+
+	// Process the CSmsHeader information
+	virtual void	ProcessSmsHeaderStreamL(CSmsHeader& aHeader);
+
+
+	// Process the CRichText information
+	virtual void	ProcessRichTextBodyL(CRichText& aBodyText);
+};
+
+#endif /* __TEST_MESS_PRINT_ENTRY_UTIL_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Inc/TestMessProcessExistingMsg.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,43 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestMessProcessExistingMsg.cpp
+// This contains CTestMessProcessExistingMsg
+// Base class for processing an existing message
+// 
+//
+
+#if (!defined __TEST_MESS_PROCESS_EXISTING_MSG__)
+#define __TEST_MESS_PROCESS_EXISTING_MSG__
+
+#include "TestMessBase.h"
+
+#include <mtclbase.h>
+
+class CTestMessProcessExistingMsg : public CTestMessBase
+{
+public:
+	CTestMessProcessExistingMsg();
+
+	virtual	TVerdict		doTestStepL();
+
+protected:
+	virtual	void			ProcessMessageL(CBaseMtm& aBaseMtm, TMsvId aMsgId) = 0;
+	virtual	void			PostProcessMessageL();
+	TUid					MtmID() const { return iMtmID; }
+
+private:
+	TUid			iMtmID;
+};
+
+#endif /* __TEST_MESS_PROCESS_EXISTING_MSG__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Inc/TestMessProcessor.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,86 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestMessProcessor.cpp
+// This contains CTestMessProcessor which an active object utility
+// used for send/recieving or any time consuming 
+// 
+//
+
+#if (!defined __TEST_MESS_PROCESSOR_H__)
+#define __TEST_MESS_PROCESSOR_H__
+
+//Epoc Include
+#include <e32base.h>
+#include <msvapi.h>
+#include <miuthdr.h>
+
+class CTestStep;
+
+class MTestMessProcessorClient
+	{
+public:
+	virtual TBool			MoreOperations() const = 0;
+	virtual CMsvOperation*	CreateOperationL(TRequestStatus& aStatus) = 0;
+	virtual TInt			DisplayProgressL(TBool aFinalProgress, CMsvOperation* aMsvOperation) = 0;
+	};
+
+/**
+ This class is an active object utility used for send/recieving
+ or any time consuming
+*/
+class CTestMessProcessor : public CActive
+	{
+public:
+	virtual ~CTestMessProcessor();
+	static CTestMessProcessor*	NewL(CTestStep& aTestStep, CMsvSession& aSession);
+
+	void	RunL();
+
+	void	DisplayProgress();
+	void	SendEmailMessageL(TMsvId aMsgId, MTestMessProcessorClient* aClient);
+
+	//Sends the SMS message
+	void	SendSmsMessageL(TMsvId aMsgId, MTestMessProcessorClient* aClient, TBool aCancelSms);
+	void	SendMmsMessageL(TMsvId aMsgId, MTestMessProcessorClient* aClient);
+	void	MtmRequestL(TMsvId aAccountId, MTestMessProcessorClient* aClient);
+
+protected:
+	CTestMessProcessor(CTestStep& aTestStep, CMsvSession& aSession /*, MTestInstrumentation& aInstrumentation */);
+	void	ConstructL();
+	void	DoCancel();
+
+private:
+	enum EState
+		{
+		EStatePrepareToSendMsg,
+		EStateRequest,
+		};
+
+	EState						iState;
+	CTestStep&					iTestStep;
+	CMsvSession&				iSession;
+
+	//	Send message parameters saved for RunL
+	CMsvEntry*					iEntry;
+	TMsvId						iMsgId;
+	MTestMessProcessorClient*	iClient;
+	TMsvEntry					iMsgEntry;
+	CMsvOperation*				iMsvOperation;
+	/**
+	 Boolean value for the Cancel sms flag
+	*/
+	TBool						iCancelSms;
+};
+
+#endif /* __TEST_MESS_PROCESSOR_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Inc/TestMessServer.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,45 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessServer
+// 
+//
+
+#if (!defined __TEST_MESS_SERVER_H_)
+#define __TEST_MESS_SERVER_H_
+
+#include "TestMessWatcher.h"
+#include "TestMessSharedData.h"
+
+#include <TestExecuteServerBase.h>
+
+class CMsvSession;
+
+class  CTestMessServer : public CTestServer
+{
+public:
+	static CTestMessServer*	NewL();
+	virtual CTestStep*		CreateTestStep(const TDesC& aStepName);
+	~CTestMessServer();
+	CSession2* NewSessionL(const TVersion& aVersion,const RMessage2& aMessage) const;
+protected:
+	CTestMessServer();
+	void	ConstructL(const TDesC& aName);
+
+private:
+
+private:
+	CTestMessSharedData*	iSharedData;
+};
+
+#endif /* __TEST_MESS_SERVER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Inc/TestMessSession.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,35 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessSession
+// 
+//
+
+#if (!defined __TEST_MESS_SESSION_H__)
+#define __TEST_MESS_SESSION_H__
+
+#include <TestExecuteServerUtils.h>
+#include "TestMessSharedData.h"
+
+class CTestMessSession : public CTestSession
+{
+public:
+	CTestMessSession(CTestMessSharedData* aSharedData);
+	virtual void ServiceL(const RMessage2& aMessage);
+
+
+private:
+	CTestMessSharedData*	iSharedData;
+};
+
+#endif /* __TEST_MESS_SESSION_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Inc/TestMessSetDefaultSc.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,33 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestMessSetDefaultSc.cpp
+// This contains TestMessSetDefaultSc which sets an SMS
+// SC as default SC.
+// 
+//
+
+#if (!defined __TEST_MESS_SET_DEFAULT_SC_H__)
+#define __TEST_MESS_SET_DEFAULT_SC_H__
+
+#include "TestMessBase.h"
+
+class CTestMessSetDefaultSc : public CTestMessBase
+{
+public:
+	CTestMessSetDefaultSc();
+
+	virtual	TVerdict	doTestStepL();
+};
+
+#endif /* __TEST_MESS_SET_DEFAULT_SC_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Inc/TestMessSharedData.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,102 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessSharedData
+// 
+//
+
+#if (!defined __TEST_MESS_SHARED_DATA_H__)
+#define __TEST_MESS_SHARED_DATA_H__
+
+#include <msvapi.h>
+#include <mtclreg.h>
+#include <ImapConnectionObserver.h>
+#include <TestExecuteStepBase.h>
+
+class  CTestMessSharedData : public CBase, private MMsvSessionObserver
+{
+public:
+	static CTestMessSharedData*	NewL();
+	~CTestMessSharedData();
+
+	void	IMAP4ConnectAndSyncCompleteAfterDisconnectL(TUid aMtmId, TMsvId aMsvId, CTestStep& aStep);
+	TInt	DeleteEntryL(CTestStep& aStep);
+
+	void	DoProcessL();
+
+protected:
+	CTestMessSharedData();
+
+private:
+	void	ConstructL();
+
+	//	MMsvSessionObserver implementation
+	virtual void HandleSessionEventL(TMsvSessionEvent, TAny*, TAny*, TAny*) {}
+
+private:
+	class CMsgEntry : public CActive
+	{
+	public:
+		~CMsgEntry();
+
+		virtual void	DoCancel();
+		virtual void	RunL();
+		virtual void	DoProcessL(CClientMtmRegistry& aMtmRegistry) = 0;
+		virtual void	DoCancelProcessL() = 0;
+
+	protected:
+		CMsgEntry(CMsgEntry* aList);
+
+		void	ConstructL(CTestStep& aStep);
+
+	public:
+		TName		iName;
+		CMsgEntry*	iNext;
+		TBool		iReadyToBeDeleted;
+	};
+	class CMsgIMAP4ConnectAndSyncComplete : public CMsgEntry, public MMsvImapConnectionObserver
+	{
+	public:
+		static CMsgIMAP4ConnectAndSyncComplete* NewL(TUid aMtmId, TMsvId aMsvId, CTestStep& aStep, CMsgEntry* aList);
+		~CMsgIMAP4ConnectAndSyncComplete();
+
+		virtual void	RunL();
+		virtual void	DoProcessL(CClientMtmRegistry& aMtmRegistry);
+		virtual void	DoCancelProcessL();
+
+	protected:
+		CMsgIMAP4ConnectAndSyncComplete(TUid aMtmId, TMsvId aMsvId, CMsgEntry* aList);
+
+	private:		
+		//	MMsvImapConnectionObserver implementation
+		void	HandleImapConnectionEvent(TImapConnectionEvent aConnectionEvent);
+
+	private:
+		TUid			iMtmId;
+		TMsvId			iMsvId;
+		CBaseMtm*		iBaseMtm;
+		CMsvOperation*	iOperation;
+		
+	};
+
+public:
+	CMsvSession*		iSession;
+	CClientMtmRegistry*	iMtmRegistry;
+	CMsgEntry*			iList;
+
+private:
+	CMsgEntry*			iAnyPostStepToDo;
+	TBool				iDeleteTestStep;
+};
+
+#endif /* __TEST_MESS_SHARED_DATA_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Inc/TestMessStoreProcessUtil.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,83 @@
+/**
+* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* This contains CTestMessStoreProcessUtil. Base class process what is in the message store
+* 
+*
+*/
+
+
+
+
+
+/**
+ @file TestMessStoreProcessUtil.h
+*/
+
+#if (!defined __TEST_MESS_STORE_PROCESS_UTIL_H__)
+#define __TEST_MESS_STORE_PROCESS_UTIL_H__
+
+#include "TestMessBase.h"
+
+class CTestMessStoreProcessUtil : public CBase
+{
+public:
+	CTestMessStoreProcessUtil(CTestMessBase& aTestStep, TBool aReadOnly);
+
+	//
+	TInt	ProcessEntryL(TMsvId aMsvId);
+
+protected:
+	// Process the CImHeader information
+	virtual void	ProcessImHeaderL(CImHeader& aHeader) = 0;
+
+	// Process the CImMimeHeader information
+	virtual void	ProcessImMimeHeaderL(CImMimeHeader& aHeader) = 0;
+
+	// Process the CImIAPPreferences information
+	virtual void	ProcessInternetAccessPreferencesL(CImIAPPreferences& aPreferences) = 0;
+
+	// Process the CSmsHeader information
+	virtual void	ProcessSmsHeaderStreamL(CSmsHeader& aHeader) = 0;
+
+
+	// Process the CRichText information
+	virtual void	ProcessRichTextBodyL(CRichText& aBodyText) = 0;
+
+	// Convert Text to character set information
+	TBool			ValidCharacterSetInfo(const TPtrC& aCharacterSetType, TUint &aCharSetVal);
+
+private:
+	// Process the CImHeader information
+	void	ProcessImHeaderL(CMsvStore& aStore);
+
+	// Process the CImMimeHeader information
+	void	ProcessImMimeHeaderL(CMsvStore& aStore);
+
+
+	// Process the CSmsHeader information
+	void	ProcessSmsHeaderStreamL(CMsvStore& aStore);
+
+
+	// Process the CRichText information
+	void	ProcessRichTextBodyL(CMsvStore& aStore);
+
+protected:
+	CTestMessBase&	iTestStep;
+
+private:
+	TBool			iReadOnly;
+};
+
+#endif /* __TEST_MESS_STORE_PROCESS_UTIL_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Inc/TestMessTimer.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,44 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessTimer
+// 
+//
+
+#if (!defined __TEST_MESS_TIMER_H_)
+#define __TEST_MESS_TIMER_H_
+
+#include <e32base.h>
+
+class CTestMessProcessor;
+
+class CTestMessTimer : public CTimer  
+{
+public:
+	virtual ~CTestMessTimer();
+	static CTestMessTimer*	NewL(TTimeIntervalMicroSeconds32 aInterval, CTestMessProcessor& aProcessor);
+
+	void	RunL();
+
+	void	IssueRequest();
+
+protected:
+	CTestMessTimer(TTimeIntervalMicroSeconds32 aInterval, CTestMessProcessor& aProcessor);
+	void	ConstructL();
+
+private:
+	TTimeIntervalMicroSeconds32	iInterval;
+	CTestMessProcessor&			iProcessor;
+};
+
+#endif /* __TEST_MESS_TIMER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Inc/TestMessWatcher.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,45 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessWatcher which starts the message watchers
+// 
+//
+
+#if (!defined __TEST_MESS_WATCHER_H__)
+#define __TEST_MESS_WATCHER_H__
+
+#include <e32base.h>
+#include <watcher.h>
+
+const TInt	KTestUtilsWatcherStarterMin = 5000000;
+
+class CTestMessWatcher : public CActive
+{
+public:
+	static CTestMessWatcher* NewL(TInt aPriority = EPriorityStandard);
+	~CTestMessWatcher();
+
+private:
+	CTestMessWatcher(TInt aPriority);
+	void	RunL();
+	void	DoCancel();
+	void	ConstructL();
+
+private:
+	RTimer						iTimer;
+	RProcess					iWatcher;
+	TBool						iConstructed;
+	TTimeIntervalMicroSeconds32	iTimeLeft;
+};
+
+#endif /* __TEST_MESS_WATCHER_H__ */
Binary file messaging/ReadMe.doc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Scripts/Smoketest_CreateSmsAccount.script	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,23 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRINT Create SMS account with vodaphone service centre
+//
+LOAD_SUITE Smoketest_Mess_Server
+//
+START_TESTCASE	SMOKE_MESS_SMS_0001
+RUN_TEST_STEP	10000	Smoketest_Mess_Server CreateSmsAccount		c:\smoketest\smoketest_mess.ini	27029_SmsVodafoneAccount
+END_TESTCASE	SMOKE_MESS_SMS_0001
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Scripts/Smoketest_Mess.script	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,37 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRINT Run Mesaging smoketest
+//
+LOAD_SUITE Smoketest_Mess_Server
+// Wait for watchers to start
+DELAY 1000
+//
+START_TESTCASE SMOKE_MESS_SMS_0002
+RUN_TEST_STEP	10000	Smoketest_Mess_Server CleanMessageFolder		c:\smoketest\Smoketest_mess.ini	27595_SmsCount01
+END_TESTCASE	SMOKE_MESS_SMS_0002
+DELAY 500
+//
+RUN_SCRIPT	c:\smoketest\Smoketest_CreateSmsAccount.script
+//
+START_TESTCASE SMOKE_MESS_SMS_0003
+RUN_TEST_STEP	10000	Smoketest_Mess_Server SetSmsSc				c:\smoketest\Smoketest_mess.ini	27029_SmsVodafoneAccount
+END_TESTCASE	SMOKE_MESS_SMS_0003
+DELAY 500
+//
+START_TESTCASE SMOKE_MESS_SMS_0004
+RUN_TEST_STEP	10000	Smoketest_Mess_Server CreateSms				c:\smoketest\Smoketest_mess.ini	27584_SmsMessage01
+END_TESTCASE	SMOKE_MESS_SMS_0004
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Scripts/setup_Smoketest_Mess.script	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,27 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+RUN_UTILS MkDir c:\smoketest\
+RUN_UTILS MkDir c:\smoketest\sms\
+
+RUN_UTILS CopyFile z:\smoketest\smoketest_mess.ini	c:\smoketest\smoketest_mess.ini
+RUN_UTILS MakeReadWrite c:\smoketest\smoketest_mess.ini
+RUN_UTILS CopyFile z:\smoketest\sms\message1.txt	c:\smoketest\sms\message1.txt
+RUN_UTILS MakeReadWrite c:\smoketest\sms\message1.txt
+RUN_UTILS CopyFile z:\smoketest\smoketest_createsmsaccount.script	c:\smoketest\smoketest_createsmsaccount.script
+RUN_UTILS MakeReadWrite c:\smoketest\smoketest_createsmsaccount.script
+
+// RUN_SCRIPT c:\Smoketest\Smoketest_Mess.script
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Src/TestMessBase.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1518 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestCase which is the base class for all the TestCase DLLs
+// 
+//
+
+#include "Configuration.cfg"
+
+#include "TestMessBase.h"
+#include "TestMessProcessor.h"
+#include "TestMessTimer.h"
+#include "TestMessPrintEntryUtil.h"
+
+// EPOC includes
+#include <SmtpSet.h>
+#include <Pop3Set.h>
+#include <ImapSet.h>
+#include <txtrich.h>
+#include <f32file.h>
+#include <msvids.h>
+#include <fbs.h>
+#include <EMSUserPromptIE.h>
+#ifdef __MESSAGING_API_V2__
+#include <smut.h>
+#include <miutset.h>
+#include <cemailaccounts.h>
+#include <csmsaccount.h>
+#endif
+/**
+ * @name Constant Literals used.
+ */
+/*@{*/
+_LIT(KDepth,					"depth");
+_LIT(KFolder,					"folder%d");
+
+/// Default value for depth of the count
+#define KDefaultDepthCount		1
+
+/// Default value for depth of the count
+#define KDefaultDepthCount		1
+
+_LIT(KDefault,					"default");
+
+_LIT(KScheduled,				"scheduled");
+_LIT(KProgress,					"progress");
+
+//_LIT(KIap,						"iap");
+//_LIT(KIapName,					"iapname");
+
+_LIT(KElements,					"elements");
+_LIT(KStartPosition,			"StartPosition%d");
+_LIT(KFile,						"File%d");
+_LIT(KType,						"Type%d");
+_LIT(KTypeFormat,				"Format");
+_LIT(KTypeSound,				"Sound");
+_LIT(KTypePreDefSound,			"PreDefSound");
+_LIT(KTypeAnimation,			"Animation");
+_LIT(KTypePreDefAnimation,		"PreDefAnimation");
+_LIT(KTypePicture,				"Picture");
+_LIT(KTypeUserPrompt,			"UserPrompt");
+_LIT(KFormatLength,				"FormatLength%d");
+_LIT(KBold,						"Bold%d");
+_LIT(KItalic,					"Italic%d");
+_LIT(KUnderline,				"Underline%d");
+_LIT(KStrikethrough,			"Strikethrough%d");
+_LIT(KAlignment,				"Alignment%d");
+_LIT(KFontSize,					"FontSize%d");
+
+_LIT(KLeftAlign,				"LeftAlign");
+_LIT(KRightAlign,				"RightAlign");
+_LIT(KCenterAlign,				"CenterAlign");
+_LIT(KLangDepend,				"LangDepend");
+
+_LIT(KNormal,					"Normal");
+_LIT(KLarge,					"Large");
+_LIT(KSmall,					"Small");
+_LIT(KVariable,					"Variable");
+_LIT(KReserved,					"Reserved");
+
+_LIT(KEmsPreDef,				"emspredef%d");
+
+_LIT(KEmsAnimTypeFlirty,		"a0");
+_LIT(KEmsAnimTypeGlad,			"a1");
+_LIT(KEmsAnimTypeSceptic,		"a2");
+_LIT(KEmsAnimTypeSad,			"a3");
+_LIT(KEmsAnimTypeWow,			"a4");
+_LIT(KEmsAnimTypeCrying,		"a5");
+_LIT(KEmsAnimTypeWinking,		"a6");
+_LIT(KEmsAnimTypeLaughing,		"a7");
+_LIT(KEmsAnimTypeIndifferent,	"a8");
+_LIT(KEmsAnimTypeKissing,		"a9");
+_LIT(KEmsAnimTypeConfused,		"a10");
+_LIT(KEmsAnimTypeTongueOut,		"a11");
+_LIT(KEmsAnimTypeAngry,			"a12");
+_LIT(KEmsAnimTypeGlasses,		"a13");
+_LIT(KEmsAnimTypeDevil,			"a14");
+
+_LIT(KEmsSoundTypeChimesHigh,	"s0");
+_LIT(KEmsSoundTypeChimesLow,	"s1");
+_LIT(KEmsSoundTypeDing,			"s2");
+_LIT(KEmsSoundTypeTaDa,			"s3");
+_LIT(KEmsSoundTypeNotify,		"s4");
+_LIT(KEmsSoundTypeDrum,			"s5");
+_LIT(KEmsSoundTypeClaps,		"s6");
+_LIT(KEmsSoundTypeFanFar,		"s7");
+_LIT(KEmsSoundTypeChordHigh,	"s8");
+_LIT(KEmsSoundTypeChordLow,		"s9");
+
+/*
+_LIT(KBioIAP,					"IAP");
+_LIT(KBioEmailNotification,		"EmailNotification");
+_LIT(KBioBusinessCard,			"BusinessCard");
+_LIT(KBioWAPAccessPoint,		"WAPAccessPoint");
+_LIT(KBioVCalendar,				"VCalendar");
+_LIT(KBioVCard,					"VCard");
+_LIT(KBioRingingTones,			"RingingTones");
+_LIT(KBioOperatorLogo,			"OperatorLogo");
+_LIT(KBioWPRV,					"WPRV");
+_LIT(KBioCLILogo,				"CLILogo");
+*/
+_LIT(KObjectSize,				"ObjectSize%d");
+_LIT(KBody,						"body");
+/*@}*/
+
+const TInt KSmallObject		= 0;
+const TInt KLargeObject		= 1;
+const TInt KVariableObject	= 2;
+
+const TInt KDefaultStartPos	= 1;
+
+/**
+ * Constructor.
+ * @return - None
+ * 
+*/	
+CTestMessBase::CTestMessBase(TBool aSetDirectory)
+:	CTestStepSmokeTest()
+,	iSession(NULL)
+,	iMessageProcessor(NULL)
+,   iParaFormatLayer(NULL)
+,   iCharFormatLayer(NULL)
+,   iBodyText(NULL)
+,	iBodyAvailable(EFalse)
+,	iSetDirectory(aSetDirectory)
+,	iMessageTimer(NULL)
+,	iSchedular(NULL)
+,	iEntry(NULL)
+,	iOrder(KMsvGroupByType|KMsvGroupByStandardFolders, EMsvSortById, ETrue)
+	{
+	}
+
+CTestMessBase::~CTestMessBase()
+	{
+	delete iEntry;
+	iEntry=NULL;
+	delete iMessageTimer;
+	iMessageTimer=NULL;
+	delete iMessageProcessor;
+	iMessageProcessor=NULL;
+	delete iSession;
+	iSession=NULL;
+	delete iSchedular;
+	iSchedular=NULL;
+	delete iBodyText;
+	iBodyText=NULL;
+	delete iCharFormatLayer;
+	iCharFormatLayer=NULL;
+	delete iParaFormatLayer;
+	iParaFormatLayer=NULL;
+	}
+
+enum TVerdict CTestMessBase::doTestStepPreambleL()
+	{
+	TVerdict	ret=CTestStepSmokeTest::doTestStepPreambleL();
+
+	// Printing to the console and log file
+	const TDesC&	stepName=TestStepName();
+	INFO_PRINTF2(_L("%S"), &stepName);
+
+	iSchedular=new (ELeave) CActiveScheduler();
+	CActiveScheduler::Install(iSchedular);
+	iSession=CMsvSession::OpenSyncL(*this);
+
+	//	Get progress
+	TInt	progress=0;
+	TBool	hasProgress=GetIntFromConfig(ConfigSection(), KProgress, progress);
+	if ( !hasProgress )
+		{
+		hasProgress=GetIntFromConfig(KDefault, KProgress, progress);
+		}
+
+	iMessageProcessor=CTestMessProcessor::NewL(*this, *iSession);
+	if ( hasProgress )
+		{
+		iMessageTimer=CTestMessTimer::NewL(progress*KOneSecond, *iMessageProcessor);
+		}
+
+	if ( iSetDirectory )
+		{
+		TInt	depth=KDefaultDepthCount;
+		TBool	returnValue=GetIntFromConfig(ConfigSection(), KDepth, depth);
+		if ( !returnValue )
+			{
+			depth=KDefaultDepthCount;
+			}
+		INFO_PRINTF2(_L("Depth = %d"), depth);
+
+		//	Searce for the entry
+		TRAPD(error,SetEntryL(KMsvRootIndexEntryId));
+		if( error != KErrNone)
+			{
+			INFO_PRINTF2(_L("Set Entry failed, Error %D"),error);
+			SetTestStepError(error);
+			ret=EFail;
+			}
+		else
+			{
+
+			TBuf<KMaxTestExecuteCommandLength>	tempStore;
+			TBool								found=ETrue;
+			for (TInt entry=0; entry<depth && found;)
+				{
+				TPtrC	subject;
+				tempStore.Format(KFolder(), ++entry);
+				returnValue =GetStringFromConfig(ConfigSection(), tempStore, subject);
+				if ( !returnValue )
+					{
+					INFO_PRINTF1(_L("Null Folder"));
+					}
+				INFO_PRINTF2(_L("Folder = %S"), &subject);
+
+				CMsvEntrySelection*	selection=EntryL().ChildrenL();
+				CleanupStack::PushL(selection);
+				TInt				count=selection->Count();
+		
+				found=EFalse;
+				for (TInt i=count; i>0 && !found; )
+					{
+					TMsvId	childId=selection->At(--i);
+
+					SetEntryL(childId);
+					INFO_PRINTF2(_L("Entry Detail : %S"), &(EntryL().Entry().iDetails));
+					INFO_PRINTF2(_L("Entry Description: %S"), &(EntryL().Entry().iDescription));
+					if ( subject.Compare(EntryL().Entry().iDetails) == 0 ||
+						 subject.Compare(EntryL().Entry().iDescription) == 0 )
+						{
+						found=ETrue;
+						}
+					}
+				CleanupStack::PopAndDestroy(selection);
+				}
+
+			if ( !found )
+				{
+				ERR_PRINTF1(_L("Folder not found"));
+				ret=EFail;
+				}
+			}
+		}
+	if (TestStepResult() == EPass)
+		{
+		//Get body(file path) from ini file and read respective file. Store it into CRichText format.
+		iParaFormatLayer=CParaFormatLayer::NewL();
+		iCharFormatLayer=CCharFormatLayer::NewL(); 
+		iBodyText=CRichText::NewL(iParaFormatLayer, iCharFormatLayer);
+		iBodyAvailable=EFalse;
+	
+		TPtrC	body;
+		if(GetStringFromConfig(ConfigSection(), KBody, body))
+			{
+			INFO_PRINTF2(_L("Body = %S"), &body);
+			iBodyAvailable=ETrue;
+			}
+		else
+			{
+			INFO_PRINTF1(_L("No Body"));
+			}
+
+		if ( iBodyAvailable )
+			{
+			// open the file
+			RFile	file;
+	
+			TInt anError = file.Open(iSession->FileSession(), body, EFileShareAny);
+			if(anError == KErrNone)
+				{
+				TBool		reading=ETrue;
+				TInt		pos=0;
+				TBuf8<1>	charIn;
+				while (reading)
+					{
+					file.Read(charIn, 1);
+					if(charIn.Length())
+						{
+						switch ( charIn[0] )
+							{
+						case '\r':
+							iBodyText->InsertL(pos++, CEditableText::ELineBreak);
+						case '\n':
+							break;
+						default:
+							iBodyText->InsertL(pos++, TChar(charIn[0]));
+							}
+						}
+					else
+						{
+						reading = EFalse;	// stop at the end of the file
+						}
+					}
+				iBodyAvailable=ETrue;
+				file.Close();
+				}
+			else
+			{
+			INFO_PRINTF2(_L("Cannot open file = %S"), &body);
+			iBodyAvailable=EFalse;
+			}
+		}//End of read file.
+	}
+
+	SetTestStepResult(ret);
+	return ret;
+	}
+
+enum TVerdict CTestMessBase::doTestStepPostambleL()
+	{
+	delete iEntry;
+	iEntry=NULL;
+	delete iMessageTimer;
+	iMessageTimer=NULL;
+	delete iMessageProcessor;
+	iMessageProcessor=NULL;
+	delete iSession;
+	iSession=NULL;
+	delete iSchedular;
+	iSchedular=NULL;
+	CActiveScheduler::Install(NULL);
+	return CTestStepSmokeTest::doTestStepPostambleL();
+	}
+
+void CTestMessBase::SetEntryL(TMsvId aId)
+	{
+	delete iEntry;
+	iEntry=NULL;
+	iEntry=iSession->GetEntryL(aId);
+	}
+
+CMsvEntry& CTestMessBase::EntryL()
+	{
+	if ( iEntry == NULL )
+		{
+		User::Leave(KErrGeneral);
+		}
+
+	return *iEntry;
+	}
+
+
+HBufC8* CTestMessBase::CopyToBuf8LC(const TDesC& aDesC)
+//
+// @return - HBufC8*
+// Converts TDesC to HBufC8*.
+//
+	{
+	HBufC8*	itemBuff8 = HBufC8::NewLC(aDesC.Length());
+	itemBuff8->Des().Copy(aDesC);
+
+	return itemBuff8;
+	}
+
+HBufC* CTestMessBase::CopyToBufLC(const TDesC8& aDesC)
+//
+// @return - HBufC8*
+// Converts TDesC to HBufC8*.
+//
+	{
+	HBufC*	itemBuff = HBufC::NewLC(aDesC.Length());
+	itemBuff->Des().Copy(aDesC);
+
+	return itemBuff;
+	}
+
+
+#ifndef __MESSAGING_API_V2__
+void CTestMessBase::SetDefaultServiceL(TUid aMtm, TMsvId aService) const
+	{
+	// --- Now restore the default services from the root store ---
+	CMsvEntry*				rootEntry=iSession->GetEntryL(KMsvRootIndexEntryIdValue);
+	CleanupStack::PushL(rootEntry);
+	CMsvStore*				store = rootEntry->EditStoreL();
+	CleanupStack::PushL(store);
+	CMsvDefaultServices*	services = new(ELeave)CMsvDefaultServices;
+	CleanupStack::PushL(services);
+	services->RestoreL(*store);
+
+	// --- And now re-set the default service for the MTM to the one given ---
+	TMsvDefaultService	defaultService;
+	defaultService.iMtm=aMtm;
+	defaultService.iService=aService;
+	services->ChangeDefaultServiceL(defaultService);
+	services->StoreL(*store);
+	store->CommitL();
+	CleanupStack::PopAndDestroy(3, rootEntry);
+	}
+
+TInt CTestMessBase::DefaultServiceL(TUid aMtm, TMsvId& aService) const
+	{
+	// --- Now restore the default services from the root store ---
+	CMsvEntry*				rootEntry=iSession->GetEntryL(KMsvRootIndexEntryIdValue);
+	CleanupStack::PushL(rootEntry);
+	CMsvStore*				store=rootEntry->ReadStoreL();
+	CleanupStack::PushL(store);
+	CMsvDefaultServices*	services=new(ELeave)CMsvDefaultServices;
+	CleanupStack::PushL(services);
+	services->RestoreL(*store);
+
+	TInt					ret=services->DefaultService(aMtm, aService);
+
+	CleanupStack::PopAndDestroy(3, rootEntry);
+
+	return ret;
+	}
+#endif
+
+void CTestMessBase::PrintTreeL(TMsvId aRoot)
+	{
+	INFO_PRINTF1(_L("PrintTreeL In"));
+	CMsvEntry*			entry=iSession->GetEntryL(aRoot);
+	CleanupStack::PushL(entry);
+	entry->SetSortTypeL(SelectionOrdering());
+	CMsvEntrySelection*	selection=entry->ChildrenL();
+	CleanupStack::PushL(selection);
+
+	PrintEntryL(*entry);
+	for (TInt i=0; i<selection->Count(); )
+		{
+		PrintTreeL(selection->At(i++));
+		}
+
+	CleanupStack::PopAndDestroy(2, entry);
+	INFO_PRINTF1(_L("PrintTreeL Out"));
+	}
+
+void CTestMessBase::PrintEntryL(CMsvEntry& aEntry)
+	{
+	TMsvEntry	entry=aEntry.Entry();
+
+	INFO_PRINTF2(_L("Entry Detail : %S"), &(entry.iDetails));
+	INFO_PRINTF2(_L("  Description: %S"), &(entry.iDescription));
+	INFO_PRINTF2(_L("  Id         : %x"), entry.Id());
+	INFO_PRINTF2(_L("  Parent Id  : %x"), entry.Parent());
+	INFO_PRINTF2(_L("  Service Id : %x"), entry.iServiceId);
+	if ( entry.iRelatedId != 0 )
+		{
+		INFO_PRINTF2(_L("  Related Id : %x"), entry.iRelatedId);
+		}
+	INFO_PRINTF2(_L("  Type       : %x"), entry.iType);
+	INFO_PRINTF2(_L("  Mtm        : %x"), entry.iMtm);
+
+
+	if ( entry.iSize != 0 )
+		{
+		INFO_PRINTF2(_L("  Size       : %x"), entry.iSize);
+		}
+	if ( entry.iError != 0 )
+		{
+		INFO_PRINTF2(_L("  Error      : %d"), entry.iError);
+		}
+	if ( entry.iBioType != 0 )
+		{
+		INFO_PRINTF2(_L("  BioType    : %x"), entry.iBioType);
+		}
+	if ( entry.MtmData1() != 0 )
+		{
+		INFO_PRINTF2(_L("  MtmData1   : %x"), entry.MtmData1());
+		}
+	if ( entry.MtmData2() != 0 )
+		{
+		INFO_PRINTF2(_L("  MtmData2   : %x"), entry.MtmData2());
+		}
+	if ( entry.MtmData3() != 0 )
+		{
+		INFO_PRINTF2(_L("  MtmData3   : %x"), entry.MtmData3());
+		}
+	if ( entry.Attachment() != 0 )
+		{
+		INFO_PRINTF2(_L("  Attachment : %x"), entry.Attachment());
+		}
+	if ( entry.Complete() != 0 )
+		{
+		INFO_PRINTF2(_L("  Complete   : %x"), entry.Complete());
+		}
+	if ( entry.Connected() != 0 )
+		{
+		INFO_PRINTF2(_L("  Connected  : %x"), entry.Connected());
+		}
+	if ( entry.Deleted() != 0 )
+		{
+		INFO_PRINTF2(_L("  Deleted    : %x"), entry.Deleted());
+		}
+	if ( entry.Failed() != 0 )
+		{
+		INFO_PRINTF2(_L("  Failed     : %x"), entry.Failed());
+		}
+	if ( entry.InPreparation() != 0 )
+		{
+		INFO_PRINTF2(_L("  InPrep     : %x"), entry.InPreparation());
+		}
+	if ( entry.MultipleRecipients() != 0 )
+		{
+		INFO_PRINTF2(_L("  MultiRecip : %x"), entry.MultipleRecipients());
+		}
+	if ( entry.OffPeak() != 0 )
+		{
+		INFO_PRINTF2(_L("  OffPeak    : %x"), entry.OffPeak());
+		}
+	if ( entry.Operation() != 0 )
+		{
+		INFO_PRINTF2(_L("  Operation  : %x"), entry.Operation());
+		}
+	if ( entry.Owner() != 0 )
+		{
+		INFO_PRINTF2(_L("  Owner      : %x"), entry.Owner());
+		}
+	if ( entry.PcSyncCount() != 0 )
+		{
+		INFO_PRINTF2(_L("  PcSyncCount: %x"), entry.PcSyncCount());
+		}
+	if ( entry.Priority() != 0 )
+		{
+		INFO_PRINTF2(_L("  Priority   : %x"), entry.Priority());
+		}
+	if ( entry.ReadOnly() != 0 )
+		{
+		INFO_PRINTF2(_L("  ReadOnly   : %x"), entry.ReadOnly());
+		}
+	if ( entry.Scheduled() != 0 )
+		{
+		INFO_PRINTF2(_L("  Scheduled  : %x"), entry.Scheduled());
+		}
+	if ( entry.SendingState() != 0 )
+		{
+		INFO_PRINTF2(_L("  Send State : %x"), entry.SendingState());
+		}
+	if ( entry.StandardFolder() != 0 )
+		{
+		INFO_PRINTF2(_L("  StdFolder  : %x"), entry.StandardFolder());
+		}
+	if ( entry.Unread() != 0 )
+		{
+		INFO_PRINTF2(_L("  Unread     : %x"), entry.Unread());
+		}
+	if ( entry.Visible() != 0 )
+		{
+		INFO_PRINTF2(_L("  Visible    : %x"), entry.Visible());
+		}
+
+#if (!defined CDMA_API_ENABLED)
+	if ( aEntry.HasStoreL() )
+		{
+		PrintStoreL(aEntry);
+		}
+#endif
+	}
+
+void CTestMessBase::PrintStoreL(CMsvEntry& aEntry)
+	{
+	TMsvEntry					entry=aEntry.Entry();
+	CTestMessPrintEntryUtil*	printUtil=new (ELeave) CTestMessPrintEntryUtil(*this);
+	CleanupStack::PushL(printUtil);
+
+	printUtil->ProcessEntryL(entry.Id());
+	CleanupStack::PopAndDestroy(printUtil);
+
+	if ( entry.iMtm==KUidMsgTypeSMTP )
+		{
+		PrintStoreSmtpL(aEntry);
+		}
+	else if ( entry.iMtm == KUidMsgTypePOP3 )
+		{
+		PrintStorePop3L(aEntry);
+		}
+	else if ( entry.iMtm == KUidMsgTypeIMAP4 )
+		{
+		PrintStoreImap4L(aEntry);
+		}
+	else if ( entry.iMtm == KUidMsgTypeSMS )
+		{
+		PrintStoreSmsL(aEntry);
+		}
+	}
+
+void CTestMessBase::PrintStoreSmtpL(CMsvEntry& aEntry)
+	{
+	TMsvEntry	entry=aEntry.Entry();
+	CMsvStore*	store=aEntry.ReadStoreL();
+	CleanupStack::PushL(store);
+
+	TPtrC	ptrTemp;
+	if ( entry.iType == KUidMsvServiceEntry )
+		{
+		CImSmtpSettings*	settings = new(ELeave) CImSmtpSettings();
+		CleanupStack::PushL(settings);
+#ifdef __MESSAGING_API_V2__
+		CEmailAccounts*		accounts = CEmailAccounts::NewLC();
+		TSmtpAccount smtpAccountId;
+		accounts->GetSmtpAccountL(aEntry.EntryId(), smtpAccountId);
+		TRAPD(err, accounts->LoadSmtpSettingsL(smtpAccountId, *settings));
+		CleanupStack::PopAndDestroy(accounts);
+#else
+		TRAPD(err, settings->RestoreL(*store));
+#endif
+		if ( err == KErrNone )
+			{
+			ptrTemp.Set(settings->ServerAddress());
+			INFO_PRINTF2(_L("  ServerAddress                : %S"), &ptrTemp);
+#ifndef __MESSAGING_API_V2__
+			ptrTemp.Set(settings->UserAddress());
+			INFO_PRINTF2(_L("  UserAddress                  : %S"), &ptrTemp);
+			INFO_PRINTF2(_L("  Version                      : %x"), (TUint)settings->Version());
+#endif
+			INFO_PRINTF2(_L("  Port                         : %x"), settings->Port());
+			INFO_PRINTF2(_L("  SecureSockets                : %x"), (TUint)settings->SecureSockets());
+			ptrTemp.Set(settings->EmailAlias());
+			INFO_PRINTF2(_L("  EmailAlias                   : %S"), &ptrTemp);
+			ptrTemp.Set(settings->EmailAddress());
+			INFO_PRINTF2(_L("  EmailAddress                 : %S"), &ptrTemp);
+			ptrTemp.Set(settings->ReplyToAddress());
+			INFO_PRINTF2(_L("  ReplyToAddress               : %S"), &ptrTemp);
+			ptrTemp.Set(settings->ReceiptAddress());
+			INFO_PRINTF2(_L("  ReceiptAddress               : %S"), &ptrTemp);
+			if ( settings->RequestReceipts() != 0 )
+				{
+				INFO_PRINTF2(_L("  RequestReceipts              : %x"), (TUint)settings->RequestReceipts());
+				}
+			if ( settings->SendCopyToSelf() != 0 )
+				{
+				INFO_PRINTF2(_L("  SendCopyToSelf               : %x"), (TUint)settings->SendCopyToSelf());
+				}
+			INFO_PRINTF2(_L("  SendMessageOption            : %x"), (TUint)settings->SendMessageOption());
+			}
+		CleanupStack::PopAndDestroy(settings);
+		}
+
+	CleanupStack::PopAndDestroy(store);
+	}
+
+void CTestMessBase::PrintStorePop3L(CMsvEntry& aEntry)
+	{
+	TMsvEntry	entry=aEntry.Entry();
+	CMsvStore*	store=aEntry.ReadStoreL();
+	CleanupStack::PushL(store);
+
+	TPtrC	ptrTemp;
+	if ( entry.iType == KUidMsvServiceEntry )
+		{
+		CImPop3Settings*	settings = new(ELeave) CImPop3Settings();
+		CleanupStack::PushL(settings);
+
+#ifdef __MESSAGING_API_V2__
+		CEmailAccounts*		accounts = CEmailAccounts::NewLC();
+		TPopAccount popAccountId;
+		accounts->GetPopAccountL(aEntry.EntryId(), popAccountId);
+		TRAPD(err, accounts->LoadPopSettingsL(popAccountId, *settings));
+		CleanupStack::PopAndDestroy(accounts);
+#else
+		TRAPD(err, settings->RestoreL(*store));
+#endif
+		if ( err == KErrNone )
+			{
+			ptrTemp.Set(settings->ServerAddress());
+			INFO_PRINTF2(_L("  ServerAddress                : %S"), &ptrTemp);
+#ifndef __MESSAGING_API_V2__
+			ptrTemp.Set(settings->UserAddress());
+			INFO_PRINTF2(_L("  UserAddress                  : %S"), &ptrTemp);
+			INFO_PRINTF2(_L("  Version                      : %x"), (TUint)settings->Version());
+#endif
+			INFO_PRINTF2(_L("  Port                         : %x"), settings->Port());
+			INFO_PRINTF2(_L("  SecureSockets                : %x"), (TUint)settings->SecureSockets());
+			HBufC*	loginName=CopyToBufLC(settings->LoginName());
+			INFO_PRINTF2(_L("  LoginName                    : %S"), loginName);
+			CleanupStack::PopAndDestroy(loginName);
+			if ( settings->AutoSendOnConnect() != 0 )
+				{
+				INFO_PRINTF2(_L("  AutoSendOnConnect            : %x"), (TUint)settings->AutoSendOnConnect());
+				}
+			if ( settings->Apop() != 0 )
+				{
+				INFO_PRINTF2(_L("  Apop                         : %x"), (TUint)settings->Apop());
+				}
+			if ( settings->DisconnectedUserMode() != 0 )
+				{
+				INFO_PRINTF2(_L("  DisconnectedUserMode         : %x"), (TUint)settings->DisconnectedUserMode());
+				}
+			if ( settings->DeleteEmailsWhenDisconnecting() != 0 )
+				{
+				INFO_PRINTF2(_L("  DeleteEmailsWhenDisconnecting: %x"), (TUint)settings->DeleteEmailsWhenDisconnecting());
+				}
+			if ( settings->AcknowledgeReceipts() != 0 )
+				{
+				INFO_PRINTF2(_L("  AcknowledgeReceipts          : %x"), (TUint)settings->AcknowledgeReceipts());
+				}
+			if ( settings->MaxEmailSize() != 0 )
+				{
+				INFO_PRINTF2(_L("  MaxEmailSize                 : %x"), (TUint)settings->MaxEmailSize());
+				}
+			if ( settings->GetMailOptions() != 0 )
+				{
+				INFO_PRINTF2(_L("  GetMailOptions               : %x"), (TUint)settings->GetMailOptions());
+				}
+			if ( settings->InboxSynchronisationLimit() != 0 )
+				{
+				INFO_PRINTF2(_L("  InboxSynchronisationLimit    : %x"), (TUint)settings->InboxSynchronisationLimit());
+				}
+			}
+		CleanupStack::PopAndDestroy(settings);
+		}
+
+	CleanupStack::PopAndDestroy(store);
+	}
+
+void CTestMessBase::PrintStoreImap4L(CMsvEntry& aEntry)
+	{
+	TMsvEntry	entry=aEntry.Entry();
+	CMsvStore*	store=aEntry.ReadStoreL();
+	CleanupStack::PushL(store);
+
+	TPtrC	ptrTemp;
+	if ( entry.iType == KUidMsvServiceEntry )
+		{
+		CImImap4Settings*	settings = new(ELeave) CImImap4Settings();
+		CleanupStack::PushL(settings);
+
+#ifdef __MESSAGING_API_V2__
+		CEmailAccounts*		accounts = CEmailAccounts::NewLC();
+		TImapAccount imapAccountId;
+		accounts->GetImapAccountL(aEntry.EntryId(), imapAccountId);
+		TRAPD(err, accounts->LoadImapSettingsL(imapAccountId, *settings));
+		CleanupStack::PopAndDestroy(accounts);
+#else
+		TRAPD(err, settings->RestoreL(*store));
+#endif
+		if ( err == KErrNone )
+			{
+			ptrTemp.Set(settings->ServerAddress());
+			INFO_PRINTF2(_L("  ServerAddress                : %S"), &ptrTemp);
+#ifndef __MESSAGING_API_V2__
+			ptrTemp.Set(settings->UserAddress());
+			INFO_PRINTF2(_L("  UserAddress                  : %S"), &ptrTemp);
+			INFO_PRINTF2(_L("  Version                      : %x"), (TUint)settings->Version());
+#endif
+			INFO_PRINTF2(_L("  Port                         : %x"), settings->Port());
+			INFO_PRINTF2(_L("  SecureSockets                : %x"), (TUint)settings->SecureSockets());
+
+			HBufC*	loginName=CopyToBufLC(settings->LoginName());
+			INFO_PRINTF2(_L("  LoginName                    : %S"), loginName);
+			HBufC*	folderPath=CopyToBufLC(settings->FolderPath());
+			INFO_PRINTF2(_L("  FolderPath                   : %S"), folderPath);
+			CleanupStack::PopAndDestroy(2, loginName);
+			if ( settings->PathSeparator() != 0 )
+				{
+				INFO_PRINTF2(_L("  PathSeparator                : %c"), (TText)settings->PathSeparator());
+				}
+			if ( settings->DisconnectedUserMode() != 0 )
+				{
+				INFO_PRINTF2(_L("  DisconnectedUserMode         : %x"), (TUint)settings->DisconnectedUserMode());
+				}
+			if ( settings->Synchronise() != 0 )
+				{
+				INFO_PRINTF2(_L("  Synchronise                  : %x"), (TUint)settings->Synchronise());
+				}
+			if ( settings->Subscribe() != 0 )
+				{
+				INFO_PRINTF2(_L("  Subscribe                    : %x"), (TUint)settings->Subscribe());
+				}
+			if ( settings->AutoSendOnConnect() != 0 )
+				{
+				INFO_PRINTF2(_L("  AutoSendOnConnect            : %x"), (TUint)settings->AutoSendOnConnect());
+				}
+			if ( settings->MaxEmailSize() != 0 )
+				{
+				INFO_PRINTF2(_L("  MaxEmailSize                 : %x"), (TUint)settings->MaxEmailSize());
+				}
+			if ( settings->DeleteEmailsWhenDisconnecting() != 0 )
+				{
+				INFO_PRINTF2(_L("  DeleteEmailsWhenDisconnecting: %x"), (TUint)settings->DeleteEmailsWhenDisconnecting());
+				}
+			if ( settings->AcknowledgeReceipts() != 0 )
+				{
+				INFO_PRINTF2(_L("  AcknowledgeReceipts          : %x"), (TUint)settings->AcknowledgeReceipts());
+				}
+			if ( settings->GetMailOptions() != 0 )
+				{
+				INFO_PRINTF2(_L("  GetMailOptions               : %x"), (TUint)settings->GetMailOptions());
+				}
+			if ( settings->InboxSynchronisationLimit() != 0 )
+				{
+				INFO_PRINTF2(_L("  InboxSynchronisationLimit    : %x"), (TUint)settings->InboxSynchronisationLimit());
+				}
+			if ( settings->MailboxSynchronisationLimit() != 0 )
+				{
+				INFO_PRINTF2(_L("  MailboxSynchronisationLimit  : %x"), (TUint)settings->MailboxSynchronisationLimit());
+				}
+			}
+		CleanupStack::PopAndDestroy(settings);
+		}
+
+	CleanupStack::PopAndDestroy(store);
+	}
+
+void CTestMessBase::PrintStoreSmsL(CMsvEntry& aEntry)
+	{
+	TMsvEntry	entry=aEntry.Entry();
+	CMsvStore*	store=aEntry.ReadStoreL();
+	CleanupStack::PushL(store);
+
+	TPtrC	ptrTemp;
+	if ( entry.iType == KUidMsvServiceEntry )
+		{
+		CSmsSettings*	settings = CSmsSettings::NewL();
+		CleanupStack::PushL(settings);
+
+#ifdef __MESSAGING_API_V2__
+		CSmsAccount*		smsAccount = CSmsAccount::NewLC();
+		TRAPD(err, smsAccount->LoadSettingsL(*settings));
+		CleanupStack::PopAndDestroy(smsAccount);
+#else
+		TRAPD(err, settings->RestoreL(*store));
+#endif
+		if ( err == KErrNone )
+			{
+			TSmsDelivery	delivery(settings->Delivery());
+			INFO_PRINTF2(_L("  Delivery                     : %d"), delivery);
+			CSmsSettings::TSmsReportHandling	reportHandling(settings->StatusReportHandling());
+			INFO_PRINTF2(_L("  StatusReportHandling         : %d"), reportHandling);
+			CSmsSettings::TSmsReportHandling	specialMsgHandling(settings->SpecialMessageHandling());
+			INFO_PRINTF2(_L("  SpecialMessageHandling       : %d"), specialMsgHandling);
+			INFO_PRINTF2(_L("  ReplyQuoted                  : %d"), settings->ReplyQuoted());
+#ifdef __MESSAGING_API_V2__
+			const TInt	numSCAddr = settings->ServiceCenterCount();
+#else
+			const TInt	numSCAddr = settings->NumSCAddresses();
+#endif
+			for( TInt index=0;index<numSCAddr;index++ )
+				{
+#ifdef __MESSAGING_API_V2__
+				CSmsServiceCenter&	scAddr = settings->GetServiceCenter(index);
+#else
+				CSmsNumber&			scAddr = settings->SCAddress(index);
+#endif
+				ptrTemp.Set(scAddr.Name());
+				INFO_PRINTF2(_L("  SC Name                      : %S"), &ptrTemp);
+				ptrTemp.Set(scAddr.Address());
+				INFO_PRINTF2(_L("  SC Address                   : %S"), &ptrTemp);
+				}
+			CSmsSettings::TSmsSettingsCommDbAction	commDbAction(settings->SmsBearerAction());
+			INFO_PRINTF2(_L("  SmsBearerAction              : %d"), commDbAction);
+
+			CSmsSettings::TMobileSmsBearer	smsBearer(settings->SmsBearer());
+			INFO_PRINTF2(_L("  SmsBearer                    : %d"), smsBearer);
+			}
+		CleanupStack::PopAndDestroy(settings);
+		}
+
+	CleanupStack::PopAndDestroy(store);
+	}
+
+void CTestMessBase::IssueTimerRequest()
+	{
+	if (iMessageTimer!= NULL)
+		{
+		iMessageTimer->IssueRequest();
+		}
+	}
+
+void CTestMessBase::HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny*, TAny*)
+/**
+ Handler for the Session Event
+ @param aEvent - TMsvSessionEvent object
+ @param aArg1 - TAny object pointer, used to store the argument for the event
+ @leave - System wide error codes
+*/
+	{
+	TBool	printSelection=EFalse;
+
+	switch (aEvent)
+		{
+	case EMsvEntriesCreated:
+		INFO_PRINTF1(_L("EMsvEntriesCreated"));
+		printSelection=ETrue;
+		break;
+	case EMsvEntriesChanged:
+		INFO_PRINTF1(_L("EMsvEntriesChanged"));
+		printSelection=ETrue;
+		break;
+	case EMsvEntriesDeleted:
+		INFO_PRINTF1(_L("EMsvEntriesDeleted"));
+		break;
+	case EMsvEntriesMoved:
+		INFO_PRINTF1(_L("EMsvEntriesMoved"));
+		printSelection=ETrue;
+		break;
+	case EMsvMtmGroupInstalled:
+		INFO_PRINTF1(_L("EMsvMtmGroupInstalled"));
+		break;
+	case EMsvMtmGroupDeInstalled:
+		INFO_PRINTF1(_L("EMsvMtmGroupDeInstalled"));
+		break;
+	case EMsvGeneralError:
+		INFO_PRINTF1(_L("EMsvGeneralError"));
+		break;
+	case EMsvCloseSession:
+		INFO_PRINTF1(_L("EMsvCloseSession"));
+		break;
+	case EMsvServerReady:
+		INFO_PRINTF1(_L("EMsvServerReady"));
+		break;
+	case EMsvServerFailedToStart:
+		INFO_PRINTF1(_L("EMsvServerFailedToStart"));
+		break;
+	case EMsvCorruptedIndexRebuilt:
+		INFO_PRINTF1(_L("EMsvCorruptedIndexRebuilt"));
+		break;
+	case EMsvServerTerminated:
+		INFO_PRINTF1(_L("EMsvServerTerminated"));
+		break;
+	case EMsvMediaChanged:
+		INFO_PRINTF1(_L("EMsvMediaChanged"));
+		break;
+	case EMsvMediaUnavailable:
+		INFO_PRINTF1(_L("EMsvMediaUnavailable"));
+		break;
+	case EMsvMediaAvailable:
+		INFO_PRINTF1(_L("EMsvMediaAvailable"));
+		break;
+	case EMsvMediaIncorrect:
+		INFO_PRINTF1(_L("EMsvMediaIncorrect"));
+		break;
+	case EMsvCorruptedIndexRebuilding:
+		INFO_PRINTF1(_L("EMsvCorruptedIndexRebuilding"));
+		break;
+	default:
+		INFO_PRINTF2(_L("EMsv Unknown event:%d"), aEvent);
+		break;
+	}
+
+	if ( printSelection )
+		{
+		CMsvEntrySelection*	selection=STATIC_CAST(CMsvEntrySelection*, aArg1);
+		CMsvEntry*			entry=NULL;
+		for ( int i=0; i<selection->Count(); )
+			{
+			entry=iSession->GetEntryL(selection->At(i++));
+			CleanupStack::PushL(entry);
+			PrintEntryL(*entry);
+			CleanupStack::PopAndDestroy(entry);
+			}
+		}
+	}
+
+
+void CTestMessBase::PrepareSmsHeaderFromIniFileL(CSmsHeader& aSmsHeader)
+	{
+	// Starts the Bitmap server
+	FbsStartup();
+	// start the server
+	RFbsSession::Connect();
+
+	// Add the Fromating required for EMS if required
+	TInt	emsElements=0;
+	if ( !GetIntFromConfig(ConfigSection(), KElements, emsElements) )
+		{
+		ERR_PRINTF1(_L("Elements not set"));
+		SetTestStepResult(EFail);
+		}
+
+// Macro usage for CDMA mtm
+#if (defined CDMA_API_ENABLED)
+	TMsvMessageSms&	message=aSmsHeader.SmsMessage();
+#else
+	CSmsMessage&	message=aSmsHeader.Message(); 
+#endif
+
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+	for ( TInt element=0; element<emsElements && TestStepResult()==EPass;)
+		{
+		++element;
+		INFO_PRINTF2(_L("==== PROCESSING ELEMENT %d ===="), element);
+		//	Start position
+		tempStore.Format(KStartPosition, element);
+		TInt	startPosition=KDefaultStartPos;
+		if ( GetIntFromConfig(ConfigSection(), tempStore, startPosition) )
+			{
+			INFO_PRINTF2(_L("Start position %d"), startPosition);
+			}
+
+		//	File
+		tempStore.Format(KFile, element);
+		TPtrC	file;
+		TParse	fileName;
+		TBool	hasFile=GetStringFromConfig(ConfigSection(), tempStore, file);
+		if ( hasFile )
+			{
+			INFO_PRINTF2(_L("File %S"), &file);
+			fileName.Set(file,NULL,NULL);
+			}
+
+		tempStore.Format(KType, element);
+		TPtrC	type;
+		if ( GetStringFromConfig(ConfigSection(), tempStore, type) )
+			{
+			if ( type.Compare(KTypeFormat) == 0 )
+				{
+				//	=== Process text formating Information Element ===
+				CEmsFormatIE*	newElement=CEmsFormatIE::NewL();
+				CleanupStack::PushL(newElement);
+				newElement->SetStartPosition(startPosition);
+
+				TInt			intTemp;
+				TBool			boolTemp;
+				TPtrC			alignment;
+				TPtrC			fontSize;
+
+				// Set the Format length and other information
+				tempStore.Format(KFormatLength, element);
+				if ( GetIntFromConfig(ConfigSection(), tempStore, intTemp) )
+					{
+					INFO_PRINTF2(_L("Format Length %d"), intTemp);
+					newElement->SetFormatLength(intTemp);
+					}
+				tempStore.Format(KBold, element);
+				if ( GetBoolFromConfig(ConfigSection(), tempStore, boolTemp) )
+					{
+					INFO_PRINTF2(_L("Bold %d"), boolTemp);
+					newElement->SetBold(boolTemp);
+					}
+				tempStore.Format(KItalic, element);
+				if ( GetBoolFromConfig(ConfigSection(), tempStore, boolTemp) )
+					{
+					INFO_PRINTF2(_L("Italic %d"), boolTemp);
+				    newElement->SetItalic(boolTemp);
+					}
+				tempStore.Format(KUnderline, element);
+				if ( GetBoolFromConfig(ConfigSection(), tempStore, boolTemp) )
+					{
+					INFO_PRINTF2(_L("Underline %d"), boolTemp);
+					newElement->SetUnderline(boolTemp);
+					}
+				tempStore.Format(KStrikethrough, element);
+				if ( GetBoolFromConfig(ConfigSection(), tempStore, boolTemp) )
+					{
+					INFO_PRINTF2(_L("Strikethrough %d"), boolTemp);
+					newElement->SetStrikethrough(boolTemp);
+					}
+				tempStore.Format(KAlignment,element);
+				if(GetStringFromConfig(ConfigSection(),tempStore,alignment))
+					{
+					SetAlignmentFormat(*newElement, alignment);
+					}
+				
+				tempStore.Format(KFontSize,element);
+				if(GetStringFromConfig(ConfigSection(),tempStore,fontSize))
+					{
+					//
+					SetFontSizeFormat(*newElement, fontSize);
+					}
+			    message.AddEMSInformationElementL(*newElement); 
+				CleanupStack::PopAndDestroy(newElement);
+				}
+			else if ( type.Compare(KTypeSound) == 0 )
+				{
+				//	=== Process sound Information Element ===
+				if ( hasFile )
+					{
+					HBufC8*			buffFile=CopyToBuf8LC(fileName.FullName());
+					CEmsSoundIE*	newElement=CEmsSoundIE::NewL(buffFile->Des());
+					CleanupStack::PushL(newElement);
+					newElement->SetStartPosition(startPosition); 
+				    message.AddEMSInformationElementL(*newElement); 
+					CleanupStack::PopAndDestroy(2, buffFile);
+					}
+				else
+					{
+					ERR_PRINTF1(_L("No Sound file name"));
+					SetTestStepResult(EFail);
+					}
+				}
+			else if ( type.Compare(KTypePreDefSound) == 0 )
+				{
+				//	=== Process predefined sound Information Element ===
+				TPtrC	preDefSound;
+				tempStore.Format(KEmsPreDef, element);
+				if ( !GetStringFromConfig(ConfigSection(),tempStore, preDefSound))
+					{
+					ERR_PRINTF1(_L("Predefined sound not present"));
+					SetTestStepResult(EFail);
+					}
+				else
+					{
+					INFO_PRINTF2(_L("Predefined sound %S"), &preDefSound);
+					CEmsPreDefSoundIE*	newElement=NewPreDefSoundL(preDefSound);
+
+					if ( newElement != NULL )
+						{
+						//Assign the predef animation element to newElement
+						CleanupStack::PushL(newElement);
+						newElement->SetStartPosition(startPosition);
+					    message.AddEMSInformationElementL(*newElement); 
+						CleanupStack::PopAndDestroy(newElement);
+						}
+					else
+						{
+						ERR_PRINTF1(_L("Unable to create predefined sound"));
+						SetTestStepResult(EFail);
+						}
+					}
+				}
+			else if ( type.Compare(KTypeAnimation) == 0 )
+				{
+				//	=== Process animation Information Element ===
+				if ( hasFile )
+					{
+					TPtrC	objectSize;
+
+					tempStore.Format(KObjectSize, element);
+					if ( !GetStringFromConfig(ConfigSection(),tempStore,objectSize) )
+						{
+						ERR_PRINTF1(_L("No size provided"));
+						SetTestStepResult(EFail);
+						}
+					else
+						{
+						CFbsBitmap*	bmp=NewBitmapL(fileName, objectSize);
+						if ( bmp == NULL )
+							{
+							ERR_PRINTF1(_L("Failed to Load Animation File. Error %d"));
+							SetTestStepResult(EFail);
+							}
+						else
+							{
+							CleanupStack::PushL(bmp);
+							CEmsAnimationIE*	newElement=CEmsAnimationIE::NewL(*bmp);
+							CleanupStack::PushL(newElement);
+							newElement->SetStartPosition(startPosition);
+						    message.AddEMSInformationElementL(*newElement); 
+							CleanupStack::PopAndDestroy(2, bmp);
+							}
+						}
+					}
+				else
+					{
+					ERR_PRINTF1(_L("No Animation file name"));
+					SetTestStepResult(EFail);
+					}
+				}
+			else if ( type.Compare(KTypePreDefAnimation) == 0 )
+				{
+				//	=== Process predefined animation Information Element ===
+				TPtrC	preDefAnim;
+				tempStore.Format(KEmsPreDef, element);
+				if ( !GetStringFromConfig(ConfigSection(),tempStore, preDefAnim) )
+					{
+					ERR_PRINTF1(_L("Predefined animations not present"));
+					SetTestStepResult(EFail);
+					}
+				else
+					{
+					INFO_PRINTF2(_L("Predefined animation %S"), &preDefAnim);
+					CEmsPreDefAnimationIE*	newElement=NewPreDefAnimationL(preDefAnim);
+
+					if ( newElement != NULL )
+						{
+						//Assign the predef animation element to newElement
+						CleanupStack::PushL(newElement);
+						newElement->SetStartPosition(startPosition);
+					    message.AddEMSInformationElementL(*newElement); 
+						CleanupStack::PopAndDestroy(newElement);
+						}
+					else
+						{
+						ERR_PRINTF1(_L("Unable to create predefined animation"));
+						SetTestStepResult(EFail);
+						}
+					}
+				}
+			else if ( type.Compare(KTypePicture) == 0 )
+				{
+				//	=== Process picture Information Element ===
+				if ( hasFile )
+					{
+					TPtrC	objectSize;
+
+					tempStore.Format(KObjectSize, element);
+					if ( !GetStringFromConfig(ConfigSection(),tempStore,objectSize) )
+						{
+						ERR_PRINTF1(_L("No size provided"));
+						SetTestStepResult(EFail);
+						}
+					else
+						{
+						CFbsBitmap*	bmp=NewBitmapL(fileName, objectSize);
+						if ( bmp == NULL )
+							{
+							ERR_PRINTF1(_L("Failed to Load Animation File. Error %d"));
+							SetTestStepResult(EFail);
+							}
+						else
+							{
+							CleanupStack::PushL(bmp);
+							CEmsPictureIE*	newElement=CEmsPictureIE::NewL(*bmp);
+							CleanupStack::PushL(newElement);
+							newElement->SetStartPosition(startPosition);
+						    message.AddEMSInformationElementL(*newElement); 
+							CleanupStack::PopAndDestroy(2, bmp);
+							}
+						}
+					}
+				else
+					{
+					ERR_PRINTF1(_L("No Picture file name"));
+					SetTestStepResult(EFail);
+					}
+				}
+			else if ( type.Compare(KTypeUserPrompt) == 0 )
+				{
+				//	=== Process user prompt Information Element ===
+				CEmsUserPrompt*	newElement=CEmsUserPrompt::NewL(2);
+				CleanupStack::PushL(newElement);
+				newElement->SetStartPosition(startPosition);
+			    message.AddEMSInformationElementL(*newElement); 
+				CleanupStack::PopAndDestroy(newElement);
+				}
+			else
+				{
+				ERR_PRINTF2(_L("Unknown element type %S"), &type);
+				SetTestStepResult(EFail);
+				}
+			}
+		else
+			{
+			ERR_PRINTF1(_L("No type given"));
+			SetTestStepResult(EFail);
+			}
+		}
+
+	RFbsSession::Disconnect(); 
+	}
+
+/**
+ This function reads the schedule time from ini file
+ @return - returns the schedule time read from the ini file
+*/
+TTimeIntervalMinutes CTestMessBase::ReadScheduleTime()
+	{
+	// Read  the schedule time from ini file. Add this schedule time to current time.
+	// This time will be set as the scheduled time for sending the SMS message from task scheduler
+	// By default schedule time will be 1 min
+	TInt	scheduled=0;
+	GetIntFromConfig(ConfigSection(), KScheduled, scheduled);
+	INFO_PRINTF2(_L("Scheduled Time in minutes is %d"), scheduled);
+	return TTimeIntervalMinutes(scheduled);
+	}
+
+void CTestMessBase::SetAlignmentFormat(CEmsFormatIE& aEmsFormatIE, const TDesC& aAlignment)
+	{
+	//Sets the alignment to the text
+	INFO_PRINTF2(_L("Alignment %S"), &aAlignment);
+	if( aAlignment.Compare(KLeftAlign)== 0 )
+		{
+		aEmsFormatIE.SetAlignment(CEmsFormatIE::ELeft);
+		}
+	else if( aAlignment.Compare(KRightAlign)== 0 )
+		{
+		aEmsFormatIE.SetAlignment(CEmsFormatIE::ERight);
+		}
+	else if( aAlignment.Compare(KCenterAlign)== 0 )
+		{
+		aEmsFormatIE.SetAlignment(CEmsFormatIE::ECenter);
+		}
+	else if( aAlignment.Compare(KLangDepend)== 0 )
+		{
+		aEmsFormatIE.SetAlignment(CEmsFormatIE::ELangDepend);
+		}
+	else
+		{
+		ERR_PRINTF1(_L("Illegal alignment value"));
+		SetTestStepResult(EFail);
+		}
+	}
+
+void CTestMessBase::SetFontSizeFormat(CEmsFormatIE& aEmsFormatIE, const TDesC& aFontSize)
+	{
+	//Sets the specified font to the text 
+	INFO_PRINTF2(_L("FontSize %S"), &aFontSize);
+	if( aFontSize.Compare(KNormal)== 0 )
+		{
+		aEmsFormatIE.SetFontSize(CEmsFormatIE::ENormal);
+		}
+	else if( aFontSize.Compare(KLarge)== 0 )
+		{
+		aEmsFormatIE.SetFontSize(CEmsFormatIE::ELarge);
+		}
+	else if( aFontSize.Compare(KSmall)== 0 )
+		{
+		aEmsFormatIE.SetFontSize(CEmsFormatIE::ESmall);
+		}
+	else if( aFontSize.Compare(KReserved)== 0 )
+		{
+		aEmsFormatIE.SetFontSize(CEmsFormatIE::EReserved);
+		}
+	else
+		{
+		ERR_PRINTF1(_L("Illegal fonst size value"));
+		SetTestStepResult(EFail);
+		}
+	}
+
+CEmsPreDefAnimationIE* CTestMessBase::NewPreDefAnimationL(const TDesC& aPreDefType) 
+//
+// Attaches the required predef animation. 
+// Arguments - aString - holds the TAnim type to be attached 
+// Return Value - Returns a Pointer of CEmsPreDefAnimationIE 
+//
+	{
+	//Initialize emsPreDef to NULL
+	CEmsPreDefAnimationIE::TAnimType	animType=CEmsPreDefAnimationIE::EFlirty;
+	TBool								validType=ETrue;
+
+	//Set a value for emsPreDef 
+	if ( aPreDefType.Compare(KEmsAnimTypeFlirty) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::EFlirty;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeGlad) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::EGlad;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeSceptic) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::ESceptic;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeSad) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::ESad;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeWow) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::EWow;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeCrying) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::ECrying;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeWinking) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::EWinking;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeLaughing) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::ELaughing;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeIndifferent) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::EIndifferent;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeKissing) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::EKissing;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeConfused) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::EConfused;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeTongueOut) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::ETongueOut;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeAngry) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::EAngry;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeGlasses) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::EGlasses;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeDevil) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::EDevil;
+		}
+	else
+		{
+		validType=EFalse;
+		}
+
+	CEmsPreDefAnimationIE*	emsPreDef=NULL;
+	if ( validType )
+		{
+		emsPreDef=CEmsPreDefAnimationIE::NewL(animType);
+		}
+
+	return emsPreDef;
+	}
+
+CEmsPreDefSoundIE* CTestMessBase::NewPreDefSoundL(const TDesC& aPreDefType) 
+//
+// Attaches the required predef animation. 
+// Arguments - aString - holds the TAnim type to be attached 
+// Return Value - Returns a Pointer of CEmsPreDefAnimationIE 
+//
+	{
+	//Initialize emsPreDef to NULL
+	CEmsPreDefSoundIE::TPredefinedSound	soundType=CEmsPreDefSoundIE::EChimesHigh;
+	TBool								validType=ETrue;
+
+	//Set a value for emsPreDef 
+	if ( aPreDefType.Compare(KEmsSoundTypeChimesHigh) == 0 )
+		{
+		soundType = CEmsPreDefSoundIE::EChimesHigh;
+		}
+	else if ( aPreDefType.Compare(KEmsSoundTypeChimesLow) == 0 )
+		{
+		soundType = CEmsPreDefSoundIE::EChimesLow;
+		}
+	else if ( aPreDefType.Compare(KEmsSoundTypeDing) == 0 )
+		{
+		soundType = CEmsPreDefSoundIE::EDing;
+		}
+	else if ( aPreDefType.Compare(KEmsSoundTypeTaDa) == 0 )
+		{
+		soundType = CEmsPreDefSoundIE::ETaDa;
+		}
+	else if ( aPreDefType.Compare(KEmsSoundTypeNotify) == 0 )
+		{
+		soundType = CEmsPreDefSoundIE::ENotify;
+		}
+	else if ( aPreDefType.Compare(KEmsSoundTypeDrum) == 0 )
+		{
+		soundType = CEmsPreDefSoundIE::EDrum;
+		}
+	else if ( aPreDefType.Compare(KEmsSoundTypeClaps) == 0 )
+		{
+		soundType = CEmsPreDefSoundIE::EClaps;
+		}
+	else if ( aPreDefType.Compare(KEmsSoundTypeFanFar) == 0 )
+		{
+		soundType = CEmsPreDefSoundIE::EFanFar;
+		}
+	else if ( aPreDefType.Compare(KEmsSoundTypeChordHigh) == 0 )
+		{
+		soundType = CEmsPreDefSoundIE::EChordHigh;
+		}
+	else if ( aPreDefType.Compare(KEmsSoundTypeChordLow) == 0 )
+		{
+		soundType = CEmsPreDefSoundIE::EChordLow;
+		}
+	else
+		{
+		validType=EFalse;
+		}
+
+	CEmsPreDefSoundIE*	emsPreDef=NULL;
+	if ( validType )
+		{
+		emsPreDef=CEmsPreDefSoundIE::NewL(soundType);
+		}
+
+	return emsPreDef;
+	}
+
+CFbsBitmap* CTestMessBase::NewBitmapL(const TParse& aFileName, const TDesC& aObjectSize)
+	{
+	TInt	bitmapType=KSmallObject;
+	TBool	validType=ETrue;
+	if( aObjectSize.Compare(KSmall) == 0 )
+		{
+		bitmapType=KSmallObject;
+		}
+	else if ( aObjectSize.Compare(KLarge) == 0 )
+		{
+		bitmapType=KLargeObject;
+		}
+	else if ( aObjectSize.Compare(KVariable) == 0 )
+		{
+		bitmapType=KVariableObject;
+		}
+	else
+		{
+		ERR_PRINTF2(_L("Invalid bitmap type %S"), &aObjectSize);
+		validType=EFalse;
+		}
+
+	CFbsBitmap*	bmp = NULL;
+	if ( validType )
+		{
+		bmp = new (ELeave) CFbsBitmap();
+
+		TInt	error = bmp->Load(aFileName.FullName(), bitmapType, EFalse);
+		INFO_PRINTF2(_L("Bimap load %d"), error);
+		if ( error != KErrNone)
+			{
+			delete bmp;
+			bmp=NULL;
+			}
+		}
+
+	return bmp;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Src/TestMessCleanMessageFolder.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,171 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessCleanMessageFolder which cleans out all the
+// message folders
+// 
+//
+
+#include "TestMessCleanMessageFolder.h"
+
+// EPOC includes
+#include <msvids.h>
+#include <TestExecuteClient.h>
+
+#ifdef __MESSAGING_API_V2__
+#include <cemailaccounts.h>
+#endif
+
+_LIT(KMessageCount, "messagecount");
+
+CTestMessCleanMessageFolder::CTestMessCleanMessageFolder()
+:	CTestMessBase(ETrue)
+,	iNumberOfMessagesToDelete(-1)		//	Negative value implies delete all
+	{
+	SetTestStepName(_L("CleanMessageFolder"));
+	}
+
+TVerdict CTestMessCleanMessageFolder::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Clean message folder"));
+
+	if ( GetIntFromConfig(ConfigSection(), KMessageCount, iNumberOfMessagesToDelete) )
+		{
+		INFO_PRINTF2(_L("Message count read from the ini file is  %D"), iNumberOfMessagesToDelete);
+		}
+	else
+		{
+		WARN_PRINTF1(_L("No Count specified in the ini file"));
+		WARN_PRINTF1(_L("All the messages will be deleted"));
+		}
+
+	if ( TestStepResult() == EPass )
+		{
+		//delete the contents of the folder
+		CleanFolders(EntryL().EntryId());
+
+		if ( iNumberOfMessagesToDelete<=0 )
+			{
+			INFO_PRINTF1(_L("Messages deleted"));
+			}
+		else
+			{
+			ERR_PRINTF2(_L("%d Outstanding entries not deleted."), iNumberOfMessagesToDelete);
+			SetTestStepResult(EFail);
+			}
+		}
+
+	return TestStepResult();
+	}
+
+void CTestMessCleanMessageFolder::CleanFolders(const TMsvId aEntryId)
+	{
+#ifdef __MESSAGING_API_V2__
+	if ( aEntryId == KMsvRootIndexEntryId )
+		{
+		CEmailAccounts*	accounts = CEmailAccounts::NewLC();
+
+		RArray<TPopAccount>	pop3Accounts;
+		CleanupClosePushL(pop3Accounts);
+		accounts->GetPopAccountsL(pop3Accounts);
+		TInt	count = pop3Accounts.Count();
+		TInt	index=0;
+		for( index = 0; index < count; index++ )
+			{
+			TPopAccount	id = pop3Accounts[index];
+			accounts->DeletePopAccountL( id );
+			}
+
+		RArray<TImapAccount>	imap4Accounts;
+		CleanupClosePushL(imap4Accounts);
+		accounts->GetImapAccountsL(imap4Accounts);
+		count = imap4Accounts.Count();
+		for( TInt index = 0; index < count; index++ )
+			{
+			TImapAccount	id = imap4Accounts[index];
+			accounts->DeleteImapAccountL( id );
+			}
+
+		CleanupStack::PopAndDestroy(3, accounts);
+		}
+#endif
+
+	SetEntryL(aEntryId);
+	EntryL().SetSortTypeL(SelectionOrdering());
+	CMsvEntrySelection*	selection=EntryL().ChildrenL();
+	CleanupStack::PushL(selection);
+	TInt				count=selection->Count();
+	TInt				i;
+	for (i=count; i>0; )
+		{
+		TMsvId	childId=selection->At(--i);
+
+		SetEntryL(aEntryId);
+		if( iNumberOfMessagesToDelete!=0 )
+			{
+			TRAPD(err, EntryL().DeleteL(childId));
+			switch ( err )
+				{
+			case KErrNone:
+				INFO_PRINTF2(_L("DeletedId      : %x"), childId);
+				if ( iNumberOfMessagesToDelete > 0 )
+					{
+					--iNumberOfMessagesToDelete;
+					}
+				break;
+			case KErrAccessDenied:
+				INFO_PRINTF2(_L("Access Denied  : %x"), childId);
+				break;
+			default:
+				ERR_PRINTF3(_L("Deletion Error : %d , Id : %x "), err, childId);
+				SetTestStepResult(EFail);
+				break;
+				}
+			}
+		}
+	CleanupStack::PopAndDestroy(selection);
+
+	EntryL().SetSortTypeL(SelectionOrdering());
+	selection=EntryL().ChildrenL();
+	CleanupStack::PushL(selection);
+	count=selection->Count();
+	for (i=count; i>0; )
+		{
+		TMsvId	childId=selection->At(--i);
+
+		//	Log child
+		CleanFolders(childId);
+
+		SetEntryL(aEntryId);
+
+		TRAPD(err, EntryL().DeleteL(childId));
+		switch ( err )
+			{
+		case KErrNone:
+			INFO_PRINTF2(_L("DeletedId      : %x"), childId);
+			if ( iNumberOfMessagesToDelete > 0 )
+				{
+				--iNumberOfMessagesToDelete;
+				}
+			break;
+		case KErrAccessDenied:
+			INFO_PRINTF2(_L("Access Denied  : %x"), childId);
+			break;
+		default:
+			ERR_PRINTF3(_L("Deletion Error : %d , Id : %x "), err, childId);
+			SetTestStepResult(EFail);
+			break;
+			}
+		}
+	CleanupStack::PopAndDestroy(selection);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Src/TestMessCreateCdmaSmsUtil.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,433 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestMessCreateCdmsSmsUtil.cpp
+// This class creates the Cdma sms header and the service settings
+// 
+//
+
+#include "TestMessCreateCdmaSmsUtil.h"
+#include "TestMessCreateSmsAccount.h"
+
+// EPOC includes
+#include <csmsaccount.h>
+
+/*@{*/
+_LIT(KPtDeliveryAck,			"DeliveryAck");
+_LIT(KPtUserAck,				"UserAck");
+_LIT(KPtReadAck,				"ReadAck");
+_LIT(KPtMessageConversion,		"MessageConversion");
+_LIT(KPtPriorityIndicator,		"PriorityIndicator");
+_LIT(KPtPrivacyIndicator,		"PrivacyIndicator");
+_LIT(KPtReplyOption,			"ReplyOption");
+_LIT(KPtAlertonDelivery,		"AlertonDelivery");
+_LIT(KPtLanguageIndicator,		"LanguageIndicator");
+
+//Constants used
+_LIT(KPtTeleService,			"TeleService");
+_LIT(KPtSubmit,					"Submit");
+_LIT(KPtCancel,					"Cancel");
+
+// Supported Teleservices
+_LIT(KPtTeleWmt,				"WMT");
+_LIT(KPtTeleWemt,				"WEMT");
+_LIT(KPtTeleWpt,				"WPT");
+_LIT(KPtTeleVmn,				"VMN");
+_LIT(KPtTeleScpt,				"SCPT");
+_LIT(KPtTeleCatpt,				"CATPT");
+_LIT(KPtTeleCmt91,				"CMT91");
+_LIT(KPtTeleWap,				"WAP");
+
+// Supported message conversion formats
+_LIT(KPtPidFax,					"Fax");
+_LIT(KPtPidX400,				"X400");
+_LIT(KPtPidPaging,				"Paging");
+_LIT(KPtPidMail,				"Mail");
+_LIT(KPtPidErmes,				"Ermes");
+_LIT(KPtPidSpeech,				"Speech");
+/*@}*/
+
+/**
+ Constructor
+*/
+CTestMessCreateCdmaSmsUtil ::CTestMessCreateCdmaSmsUtil(CTestMessBase& aTestStep)
+: 	CTestMessCreateSmsUtilBase(aTestStep)
+	{
+	aTestStep.INFO_PRINTF1(_L("The CDMA SMS util is created"));
+	}
+
+/**
+ Prepares the SMS account details for CSendAs/RSendAs
+ @leave - KErrNoMemory
+ @leave - System wide error codes
+*/
+void CTestMessCreateCdmaSmsUtil::PrepareAccountL(CMsvSession& /*aSession*/)
+	{
+	// Reads the teleservice
+	tia637::TTeleserviceId	teleServiceId=tia637::KTeleserviceWMT;
+	TPtrC 					ptrTeleService;
+	if( !(iTestStep.GetStringFromConfig(iTestStep.ConfigSection(), KPtTeleService, ptrTeleService)))
+		{
+		iTestStep.INFO_PRINTF1(_L("Teleservice is not provided. Default teleservice (WMT) is used"));
+		}
+	else
+		{
+		iTestStep.INFO_PRINTF2(_L("Teleservice to be set is : %S"), &ptrTeleService);
+
+		//Get the teleservice Id
+		teleServiceId = GetTeleServiceId(ptrTeleService);
+		}
+
+	if ( teleServiceId!=tia637::KTeleserviceWEMT )
+		{
+		teleServiceId=tia637::KTeleserviceWMT;
+		}
+
+	CSmsSettings*	smsSettings = CSmsSettings::NewL();
+	CleanupStack::PushL(smsSettings);
+
+	CSmsAccount*	smsAccount=CSmsAccount::NewLC();
+	smsAccount->LoadSettingsL(*smsSettings);
+	smsSettings->SetDefaultTeleservice(teleServiceId);
+	smsAccount->SaveSettingsL(*smsSettings);
+	CleanupStack::PopAndDestroy(smsAccount);
+	CleanupStack::PopAndDestroy(smsSettings);
+	}
+
+/**
+ Creates a new CDMA sms header object
+ @param aBodyText - body text of the message
+ @return CSmsHeader - pointer of the CSmsHeader object
+ @leave - KErrNoMemory
+ @leave - System wide error codes
+*/
+CSmsHeader* CTestMessCreateCdmaSmsUtil::NewHeaderL(CRichText& aBodyText)
+	{
+	return CSmsHeader::NewL(KSmsTypeSubmit, aBodyText);
+	}
+
+/**
+ Fill up the header object with data read from the ini file
+ @param aSmsHeader - reference for the sms header object
+ @leave - System wide error codes
+*/
+void CTestMessCreateCdmaSmsUtil::PrepareHeaderL(CSmsHeader& aSmsHeader)
+	{
+	//	Get bearer data
+	TPtrC	ptrBearer;
+	TBool	returnValue=iTestStep.GetStringFromConfig(iTestStep.ConfigSection(), KBearer, ptrBearer);
+	if ( !returnValue )
+		{
+		//If no bearer provided, the bearer is read from the default section ofthe
+		// ini file
+		returnValue=iTestStep.GetStringFromConfig(KDef, KDefBearer, ptrBearer);
+		}
+
+	if ( returnValue )
+		{
+		//default value for the bearer
+		TBioMsgIdType	bearer = EBioMsgIdNbs;
+
+		iTestStep.INFO_PRINTF2(_L("Bearer = %S"), &ptrBearer);
+		if (ptrBearer.CompareF(KBearerWap) == 0)
+			{
+			//Wap message ID
+			bearer = EBioMsgIdWap;
+			}
+		else if (ptrBearer.CompareF(KBearerWapSecure) == 0)
+			{
+			//WapSecure message ID
+			bearer = EBioMsgIdWapSecure;
+			}
+		else
+			{
+			iTestStep.ERR_PRINTF1(_L("No bearer provided. Default is used"));
+			}
+
+		//Set the BIO Message ID type
+		aSmsHeader.BioMessage().SetBioMsgIdType(bearer);
+		}
+
+	//	Get encoding data
+	TInt	encoding;
+	returnValue=iTestStep.GetIntFromConfig(iTestStep.ConfigSection(), KEncoding, encoding);
+	if ( !returnValue )
+		{
+		//If no encoding is provided, the encoding is read from the default section 
+		//of the ini file
+		returnValue=iTestStep.GetIntFromConfig(KDef, KDefEncoding, encoding);
+		}
+	if ( returnValue )
+		{
+		//Default encoding value.
+		TSmsCharacterEncoding charEncoding = KSmsEncodingUnicode;
+
+		iTestStep.INFO_PRINTF2(_L("Encoding = %d"), encoding);
+		switch (encoding)
+			{
+		case 7:
+			//7 bit encoding format
+			charEncoding = KSmsEncoding7BitASCII;
+			break;
+		case 8:
+			//8 bit encoding format
+			charEncoding = KSmsEncodingBinary;
+			break;
+		case 16:
+			//unicode encoding format
+			charEncoding = KSmsEncodingUnicode;
+			break;
+		default:
+			//default encoding format
+			charEncoding = KSmsEncodingUnicode;
+			break;
+			}
+		//Set the character encoding format
+		aSmsHeader.BioMessage().SetEncoding(charEncoding);
+		}
+
+	
+	TBool	deliveryAck = EFalse;
+	TBool	userAck = EFalse;
+	TBool	readAck = EFalse;
+
+	//	Get acknowledgements report request
+	TPtrC	ptrDeliveryReport;
+	returnValue=iTestStep.GetStringFromConfig(iTestStep.ConfigSection(), KDeliveryReport, ptrDeliveryReport);
+	if ( !returnValue )
+		{
+		returnValue=iTestStep.GetStringFromConfig(KDef, KDefDeliveryReport, ptrDeliveryReport);
+		}
+	if ( returnValue )
+		{
+		iTestStep.INFO_PRINTF2(_L("The acknowledgement request flag : %S"), &ptrDeliveryReport);
+		if(ptrDeliveryReport.Compare(_L("NO")) == 0)
+			{
+			deliveryAck = EFalse;
+			userAck = EFalse;
+			readAck = EFalse;
+			}
+		if(ptrDeliveryReport.Compare(_L("YES")) == 0)
+			{
+			// Read different type of acknowledgements
+			iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KPtDeliveryAck, deliveryAck);
+			iTestStep.INFO_PRINTF2(_L("The Delivery acknowledgement request flag : %d"), deliveryAck);
+			iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KPtUserAck, userAck);
+			iTestStep.INFO_PRINTF2(_L("The User acknowledgement request flag : %d"), userAck);
+			iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KPtReadAck, readAck);
+			iTestStep.INFO_PRINTF2(_L("The Read acknowledgement request flag : %d"), readAck);
+			}
+		}
+	
+	aSmsHeader.SetAcknowledgementRequest(ESmsAckTypeDelivery, deliveryAck);
+	aSmsHeader.SetAcknowledgementRequest(ESmsAckTypeUser, userAck);
+	aSmsHeader.SetAcknowledgementRequest(ESmsAckTypeRead, readAck);
+	
+	//Get the message conversion type
+	TPtrC	ptrMessageConversion;
+	TSmsPIDConversion smsPidConversion = ESmsConvPIDNone;
+	returnValue=iTestStep.GetStringFromConfig(iTestStep.ConfigSection(), KPtMessageConversion, ptrMessageConversion);
+	if ( !returnValue )
+		{
+		iTestStep.INFO_PRINTF1(_L("The message conversion is not provided. Default (PIDNone) is taken"));
+		}
+	if ( returnValue )
+		{
+		iTestStep.INFO_PRINTF2(_L("The message conversion to be set is  : %S"), &ptrMessageConversion);
+		//Get the Message conversion id
+		smsPidConversion = GetMessageConversionId(ptrMessageConversion);
+		}
+	//Set the message conversion.
+	CSmsSettings *smsSettings = CSmsSettings::NewL();
+	CleanupStack::PushL(smsSettings);
+	aSmsHeader.GetDefaultMessageSettingsL(*smsSettings);
+	smsSettings->SetMessageConversion(smsPidConversion);
+	CleanupStack::Pop(smsSettings);
+
+	// Set the other message settings
+	aSmsHeader.CdmaMessage().SetPrivacyIndicatorL(tia637::KBdRestricted);
+	aSmsHeader.CdmaMessage().SetPriorityIndicatorL(tia637::KBdUrgent);
+	aSmsHeader.CdmaMessage().SetAlertOnDeliveryL(tia637::KBdUseMediumPriorityAlert);
+	aSmsHeader.CdmaMessage().SetLanguageIndicatorL(tia637::KLanguageEnglish);
+	}
+
+/**
+ Sets the cdma sms service settings fields using data read from the
+ ini file. If no data is provided/read from ini file, the default 
+ account settings is used.
+ @param aSmsSettings - reference of the CSmsSettings
+*/
+void CTestMessCreateCdmaSmsUtil::SetSmsAccountSettings(CSmsSettings& aSmsSettings)
+	{
+	iTestStep.INFO_PRINTF1(_L("Set SMS account Settings...."));
+	TBool	boolTemp;
+	
+	//	Set the Reply quoted setting.
+	if ( iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KReplyQuoted, boolTemp) )
+		{
+		aSmsSettings.SetReplyQuoted(boolTemp);
+		}
+
+	// Set the priority indicator
+	if ( iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KPtPriorityIndicator, boolTemp) )
+		{
+		aSmsSettings.MessageSettings().Cdma().ActivateMessageSetting(tia637::KTPriorityIndicator, boolTemp);
+		}
+
+	//Set the Privacy Indicator	
+	if ( iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KPtPrivacyIndicator, boolTemp) )
+		{
+		aSmsSettings.MessageSettings().Cdma().ActivateMessageSetting(tia637::KTPrivacyIndicator, boolTemp);
+		}
+
+	//Set the Reply option
+	if ( iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KPtReplyOption, boolTemp) )
+		{
+		aSmsSettings.MessageSettings().Cdma().ActivateMessageSetting(tia637::KTReplyOption, boolTemp);
+		}
+
+	//Set the alert on Message deliver
+	if ( iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KPtAlertonDelivery, boolTemp) )
+		{
+		aSmsSettings.MessageSettings().Cdma().ActivateMessageSetting(tia637::KTAlertOnMessageDelivery, boolTemp);
+		}
+
+	//Set the Language Indicator
+	if ( iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KPtLanguageIndicator, boolTemp) )
+		{
+		aSmsSettings.MessageSettings().Cdma().ActivateMessageSetting(tia637::KTLanguageIndicator, boolTemp);
+		}
+
+	aSmsSettings.SetValidityPeriod(ESmsVPWeek);	// week 
+	aSmsSettings.SetValidityPeriodFormat(TSmsFirstOctet::ESmsVPFInteger); //relative
+	aSmsSettings.SetDelivery(ESmsDeliveryImmediately);
+	}
+
+/**
+ Get the message type id
+ @param aMessageType - TPtrC object holding the message type
+ @return TSmsMessageType - message type id
+*/
+TSmsMessageType CTestMessCreateCdmaSmsUtil::GetMessageTypeId(const TDesC& aMessageType)
+	{
+	//Default message type is assigned
+	TSmsMessageType smsMessageType = KSmsTypeSubmit;
+
+	if( aMessageType.Compare(KPtSubmit) ==0)
+		{
+		smsMessageType = KSmsTypeSubmit;
+		}
+	else if( aMessageType.Compare(KPtCancel) ==0)
+		{
+		smsMessageType = KSmsTypeCdmaCancellation;
+		}
+	else
+		{
+		iTestStep.WARN_PRINTF1(_L("Invalid message type provided. Default is used"));
+		}
+	return smsMessageType;
+	}
+	
+/**
+ Gets the Teleservice Id
+ @param aTeleService - TPtrC holding the tele service name
+ @return tia637::TTeleserviceId - teleservice id
+*/
+tia637::TTeleserviceId CTestMessCreateCdmaSmsUtil::GetTeleServiceId(const TDesC& aTeleService)
+	{
+	//default teleservice ID assigned
+	tia637::TTeleserviceId	teleServiceId = tia637::KTeleserviceWMT;
+
+	iTestStep.INFO_PRINTF2(_L("Teleservice set is : %S"), &aTeleService);
+	if( aTeleService.Compare(KPtTeleScpt) ==0)
+		{
+		teleServiceId = tia637::KTeleserviceSCPT;
+		}
+	else if( aTeleService.Compare(KPtTeleCatpt) ==0)
+		{
+		teleServiceId = tia637::KTeleserviceCATPT;
+		}
+	else if( aTeleService.Compare(KPtTeleCmt91) ==0)
+		{
+		teleServiceId = tia637::KTeleserviceCMT91;
+		}
+	else if( aTeleService.Compare(KPtTeleVmn) ==0)
+		{
+		teleServiceId = tia637::KTeleserviceVMN;
+		}
+	else if( aTeleService.Compare(KPtTeleWap) ==0)
+		{
+		teleServiceId = tia637::KTeleserviceWAP;
+		}
+	else if( aTeleService.Compare(KPtTeleWemt) ==0)
+		{
+		teleServiceId = tia637::KTeleserviceWEMT;
+		}
+	else if( aTeleService.Compare(KPtTeleWmt) ==0)
+		{
+		teleServiceId = tia637::KTeleserviceWMT;
+		}
+	else if( aTeleService.Compare(KPtTeleWpt) ==0)
+		{
+		teleServiceId = tia637::KTeleserviceWPT;
+		}
+	else
+		{
+		iTestStep.WARN_PRINTF1(_L("Invalid Teleservice provided. Default WMT used"));
+		}
+
+	return teleServiceId;
+	}
+
+/**
+ Gets the Message Conversion Id
+ @param aTeleService - TPtrC holding the tele service name
+ @return tia637::TTeleserviceId - teleservice id
+*/
+TSmsPIDConversion CTestMessCreateCdmaSmsUtil::GetMessageConversionId(const TDesC& aMessageConversion)
+	{
+	TSmsPIDConversion	smsPidConv = ESmsConvPIDNone;
+
+	iTestStep.INFO_PRINTF2(_L("The message conversion set is  : %S"), &aMessageConversion);
+	if( aMessageConversion.Compare(KPtPidFax) ==0)
+		{
+		smsPidConv = ESmsConvFax;
+		}
+	else if( aMessageConversion.Compare(KPtPidX400) ==0)
+		{
+		smsPidConv = ESmsConvX400;
+		}
+	else if( aMessageConversion.Compare(KPtPidPaging) ==0)
+		{
+		smsPidConv = ESmsConvPaging;
+		}
+	else if( aMessageConversion.Compare(KPtPidMail) ==0)
+		{
+		smsPidConv = ESmsConvMail;
+		}
+	else if( aMessageConversion.Compare(KPtPidErmes) ==0)
+		{
+		smsPidConv = ESmsConvErmes;
+		}
+	else if( aMessageConversion.Compare(KPtPidSpeech) ==0)
+		{
+		smsPidConv = ESmsConvSpeech;
+		}
+	else
+		{
+		iTestStep.INFO_PRINTF1(_L("The message conversion provided is invalid"));
+		iTestStep.INFO_PRINTF1(_L("The default NONE message conversion is set"));
+		}
+	
+	return smsPidConv;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Src/TestMessCreateGsmSmsUtil.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,262 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This class creates the Gsm sms header and service settings. It fills up the
+// fields using data read from the ini file
+// 
+//
+ 
+#include "Configuration.cfg"
+
+#include "TestMessCreateGsmSmsUtil.h"
+
+/** 
+ Constructor
+*/
+CTestMessCreateGsmSmsUtil::CTestMessCreateGsmSmsUtil(CTestMessBase &aTestStep)
+: 	CTestMessCreateSmsUtilBase(aTestStep)
+	{
+	aTestStep.INFO_PRINTF1(_L("The GSM SMS util is created"));
+	}
+
+/**
+ Prepares the SMS account details for CSendAs/RSendAs
+ @leave - KErrNoMemory
+ @leave - System wide error codes
+*/
+void CTestMessCreateGsmSmsUtil::PrepareAccountL(CMsvSession& /*aSession*/)
+	{
+	}
+
+/**
+ Creates the header object for the GSM sms message
+ @param aBodyText - body text of the message
+ @return CSmsHeader* - pointer to CSmsHeader
+ @leave - KErrNoMemory
+ @leave - system wide error codes
+*/
+CSmsHeader* CTestMessCreateGsmSmsUtil::NewHeaderL(CRichText &aBodyText)
+	{
+	return CSmsHeader::NewL(CSmsPDU::ESmsSubmit, aBodyText);
+	}
+
+/**
+ Fills up the header object with the data read from the ini file.
+ @param aSmsHeader - sms header object ofthe sms message
+ @leave - system wide error codes
+*/
+void CTestMessCreateGsmSmsUtil::PrepareHeaderL(CSmsHeader &aSmsHeader)
+	{
+	//	Get bearer data
+	TPtrC	ptrBearer;
+	TBool	returnValue=iTestStep.GetStringFromConfig(iTestStep.ConfigSection(), KBearer, ptrBearer);
+	if ( !returnValue )
+		{
+		//If bearer is not provided, read from the default section of the ini file
+		returnValue=iTestStep.GetStringFromConfig(KDef, KDefBearer, ptrBearer);
+		}
+
+	if ( returnValue )
+		{
+		//default value for Bio message ID type
+		TBioMsgIdType	bearer = EBioMsgIdNbs;
+
+		iTestStep.INFO_PRINTF2(_L("Bearer = %S"), &ptrBearer);
+		if (ptrBearer.CompareF(KBearerWap) == 0)
+			{
+			//Set Wap message ID
+			bearer = EBioMsgIdWap;
+			}
+		else if (ptrBearer.CompareF(KBearerWapSecure) == 0)
+			{
+			//Set WapSecure message ID
+			bearer = EBioMsgIdWapSecure;
+			}
+		else
+			{
+			iTestStep.INFO_PRINTF1(_L("No supported bearer is provided. Default is used"));
+			}
+
+		//Set the Bio message ID type.
+#if (defined CDMA_API_ENABLED)
+		aSmsHeader.BioMessage().SetBioMsgIdType(bearer);
+#else
+		aSmsHeader.SetBioMsgIdType(bearer);
+#endif
+		}
+
+	//	Get encoding data
+	TInt	encoding;
+	returnValue=iTestStep.GetIntFromConfig(iTestStep.ConfigSection(), KEncoding, encoding);
+	if ( !returnValue )
+		{
+		//If encoding is not provied, read it from the default section of the ini file
+		returnValue=iTestStep.GetIntFromConfig(KDef, KDefEncoding, encoding);
+		}
+	if ( returnValue )
+		{
+		iTestStep.INFO_PRINTF2(_L("Encoding = %d"), encoding);
+#if (defined CDMA_API_ENABLED)
+		TSmsCharacterEncoding	charEncoding;
+
+		switch (encoding)
+			{
+		case 7:
+			//7 bit encoding format
+			charEncoding = KSmsEncoding7BitGsm;
+			break;
+		case 8:
+			//8 bit encoding format
+			charEncoding = KSmsEncodingBinary;
+			break;
+		case 16:
+			//Unicode encoding format
+			charEncoding = KSmsEncodingUnicode;
+			break;
+		default:
+			//default encoding format
+			charEncoding = KSmsEncoding7BitGsm;
+			break;
+			}
+
+		//Set the character encoding
+		aSmsHeader.BioMessage().SetEncoding(charEncoding);
+#else
+		TSmsDataCodingScheme::TSmsAlphabet	alpha = TSmsDataCodingScheme::ESmsAlphabet7Bit;
+
+		switch (encoding)
+			{
+		case 7:
+			alpha = TSmsDataCodingScheme::ESmsAlphabet7Bit;
+			break;
+		case 8:
+			alpha = TSmsDataCodingScheme::ESmsAlphabet8Bit;
+			break;
+		case 16:
+			alpha = TSmsDataCodingScheme::ESmsAlphabetUCS2;
+			break;
+		default:
+			alpha = TSmsDataCodingScheme::ESmsAlphabet7Bit;
+			break;
+			}
+
+		CSmsPDU&	pdu=aSmsHeader.Message().SmsPDU();
+		if ( pdu.DataCodingSchemePresent() )
+			{
+			pdu.SetAlphabet(alpha);
+			}
+#endif
+		}
+
+	//	Get delivery report data
+	TPtrC	ptrDeliveryReport;
+	returnValue=iTestStep.GetStringFromConfig(iTestStep.ConfigSection(), KDeliveryReport, ptrDeliveryReport);
+	if ( !returnValue )
+		{
+		returnValue=iTestStep.GetStringFromConfig(KDef, KDefDeliveryReport, ptrDeliveryReport);
+		}
+	if ( returnValue )
+		{
+		TBool	changeDR = EFalse;
+		TBool	deliveryReport = EFalse;
+
+		iTestStep.INFO_PRINTF2(_L("Delivery Report = %S"), &ptrDeliveryReport);
+		if (ptrDeliveryReport.CompareF(_L("NO")) == 0)
+			{
+			changeDR = ETrue;
+			deliveryReport = EFalse;
+			}
+		else if (ptrDeliveryReport.CompareF(_L("YES")) == 0)
+			{
+			changeDR = ETrue;
+			deliveryReport = ETrue;
+			}
+
+		if ( changeDR )
+			{
+#if (defined CDMA_API_ENABLED)
+			aSmsHeader.SetAcknowledgementRequest(ESmsAckTypeDelivery, deliveryReport);
+#else
+			switch ( aSmsHeader.Type() )
+				{
+			case CSmsPDU::ESmsSubmit:
+				aSmsHeader.Submit().SetStatusReportRequest(deliveryReport);
+				break;
+			case CSmsPDU::ESmsCommand:
+				aSmsHeader.Command().SetStatusReportRequest(deliveryReport);
+				break;
+			default:
+				User::Leave(KErrNotSupported);
+				}
+#endif
+			}
+		}
+	}
+/**
+ Sets the fields for the sms account settings using data read from the ini file
+ If no data is given in ini file, the default settings in the account is used.
+ @param aSmsSettings - CSmsSettings reference
+*/
+void CTestMessCreateGsmSmsUtil::SetSmsAccountSettings(CSmsSettings &aSmsSettings)
+	{
+	iTestStep.INFO_PRINTF1(_L("Set SMS account Settings...."));
+	TBool	boolTemp;
+
+	//	Set the Reply quoted setting.
+	if ( iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KReplyQuoted, boolTemp) )
+		{
+		aSmsSettings.SetReplyQuoted(boolTemp);
+		}
+
+	//	Set the Reject duplicate settings.
+	if ( iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KRejectDuplicate, boolTemp) )
+		{
+#if (defined CDMA_API_ENABLED)
+		aSmsSettings.MessageSettings().Gsm().SetRejectDuplicate(boolTemp);
+#else
+		aSmsSettings.SetRejectDuplicate(boolTemp);
+#endif
+		}
+
+	//	Set the option for delivery report.
+	if ( iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KDeliveryReport, boolTemp) )
+		{
+		aSmsSettings.SetDeliveryReport(boolTemp);
+		}
+
+	//	Set the concatenate feature
+	if ( iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KConCatenate, boolTemp) )
+		{
+#if (defined CDMA_API_ENABLED)
+		aSmsSettings.MessageSettings().Gsm().SetCanConcatenate(boolTemp);
+#else
+		aSmsSettings.SetCanConcatenate(boolTemp);
+#endif
+		}
+
+	//	Set whether to use the same path while replying.
+	if(iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KReplyPath, boolTemp))
+		{
+#if (defined CDMA_API_ENABLED)
+		aSmsSettings.MessageSettings().Gsm().SetReplyPath(boolTemp);
+#else
+		aSmsSettings.SetReplyPath(boolTemp);
+#endif
+		}
+
+	//can implement these features later...
+	aSmsSettings.SetValidityPeriod(ESmsVPWeek);	// week 
+	aSmsSettings.SetValidityPeriodFormat(TSmsFirstOctet::ESmsVPFInteger); //relative
+	aSmsSettings.SetDelivery(ESmsDeliveryImmediately);
+	aSmsSettings.SetMessageConversion(ESmsConvPIDNone);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Src/TestMessCreateSMS.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,417 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessCreateSMS. This class creates the sms message
+// for GSM or CDMA. For CDMA mtm, it uses utility classes to create
+// the respective GSM or CDMA sms message
+// 
+//
+
+#include "Configuration.cfg"
+
+#include "TestMessCreateSMS.h"
+#include "TestMessEditEntryUtil.h"
+
+//Usage of macros of Cdma mtm
+#include "TestMessCreateGsmSmsUtil.h"
+#if (defined CDMA_API_ENABLED)
+#include "TestMessCreateCdmaSmsUtil.h"
+#endif
+
+// EPOC includes
+#include <mtmuids.h>
+#include <txtrich.h>
+#include <smut.h>
+#include <etelmm.h>
+#include <SMUTSET.h> //For CSmsMessageSettings
+
+/*@{*/
+/// Literal constants read from the ini file
+_LIT(KRecipients,			"recipients");
+_LIT(KTo,					"to%d");
+_LIT(KPtSaveDraft,			"SaveInDraft");
+_LIT(KDefTo,				"smsto");
+
+_LIT(KPtMsgBearerGsm,		"GSM");
+//Usage of macros for Cdma mtm
+#if (defined CDMA_API_ENABLED)
+_LIT(KPtMsgBearerType,		"MessageBearerType");
+_LIT(KPtMsgBearerCdma,		"CDMA");
+#endif
+/*@}*/
+
+#if (defined CDMA_API_ENABLED)
+#define KPtDefaultCount		1
+#endif
+
+CTestMessCreateSMS::CTestMessCreateSMS()
+:	CTestMessBase(EFalse)
+,	iSimInDatabase(EFalse)
+	{
+	SetTestStepName(_L("CreateSms"));
+	}
+
+/**
+ Creates the SMS message for GSM or CDMA.
+ @return TVerdict
+*/
+
+TVerdict CTestMessCreateSMS::doTestStepPreambleL()
+	{
+	TVerdict	ret=CTestMessBase::doTestStepPreambleL();
+	// IMK iSimInDatabase=(GetPhoneSmsNumberL(iSimPhoneNumber)==KErrNone);
+	iSimInDatabase=false; //IMK (GetPhoneSmsNumberL(iSimPhoneNumber)==KErrNone);
+	return ret;
+	}
+
+/**
+ Creates the SMS message for GSM or CDMA.
+ @return TVerdict
+*/
+TVerdict CTestMessCreateSMS::doTestStepL()
+	{
+	//	Get scheduling data
+	TTimeIntervalMinutes	scheduledTime=ReadScheduleTime();
+
+	//create the message
+	TBool					saveDraft = EFalse;
+	GetBoolFromConfig(ConfigSection(), KPtSaveDraft, saveDraft);
+
+	if ( saveDraft )
+		{
+		//Create the message in Draft
+		CreateSmsL(KMsvDraftEntryId, scheduledTime);
+		}
+	else
+		{
+		//Creates the message in Outbox
+		CreateSmsL(KMsvGlobalOutBoxIndexEntryId, scheduledTime);
+		}
+
+	return TestStepResult();
+	}
+
+void CTestMessCreateSMS::CreateSmsL(const TMsvId aMsvId, TTimeIntervalMinutes aScheduledTime)
+	{
+	//	Get the bearertype (CDMA/GSM)
+	TPtrC	messageBearerType;
+	messageBearerType.Set(KPtMsgBearerGsm);
+#if (defined CDMA_API_ENABLED)
+	GetStringFromConfig(ConfigSection(), KPtMsgBearerType, messageBearerType);
+	INFO_PRINTF2(_L("The message bearertype is : %S"), &messageBearerType);
+#endif
+
+	CTestMessCreateSmsUtilBase*	createSmsUtil = NULL;
+	//	Create the repective util class
+	if ( messageBearerType.Compare(KPtMsgBearerGsm)==0 )
+		{
+		createSmsUtil=new (ELeave) CTestMessCreateGsmSmsUtil(*this);
+		}
+#if (defined CDMA_API_ENABLED)
+	else if ( messageBearerType.Compare(KPtMsgBearerCdma)==0 )
+		{
+		createSmsUtil=new (ELeave) CTestMessCreateCdmaSmsUtil(*this);
+		}
+#endif
+	else
+		{
+		WARN_PRINTF1(_L("Unknown bearer type using Gsm"));
+		createSmsUtil=new (ELeave) CTestMessCreateGsmSmsUtil(*this);
+		}
+	CleanupStack::PushL(createSmsUtil);
+
+//	All references to PrepareAccountL can be removed when DEF054045 is fixed
+//	createSmsUtil->PrepareAccountL(*iSession);
+
+	if(!iBodyAvailable)
+       {
+		ERR_PRINTF1(_L("No Body"));
+		SetTestStepResult(EFail);
+	   }
+
+	if ( TestStepResult()==EPass )
+		{
+		TInt	err=KErrNone;
+		RSendAs			sendAsServer;
+		User::LeaveIfError(sendAsServer.Connect());
+		CleanupClosePushL(sendAsServer);
+		AddMtmCapabilitiesL(sendAsServer);
+
+		RSendAsMessage	sendAs;
+		TRAP(err, sendAs.CreateL(sendAsServer, KUidMsgTypeSMS));
+		PrepareSendAsL(sendAs);
+
+		if ( err!=KErrNone )
+			{
+			SetTestStepError(err);
+			}
+		else
+			{
+			INFO_PRINTF1(_L("sendAs.SetBodyTextL"));
+			sendAs.SetBodyTextL(*iBodyText);
+
+#if (!defined CDMA_API_ENABLED)
+			TInt	recipients=1;
+			GetIntFromConfig(ConfigSection(), KRecipients, recipients);
+
+			TPtrC	to(iSimPhoneNumber.iTelNumber);
+			TBool	returnValue=ETrue;
+			for ( TInt recipient=0; (recipient<recipients) && (TestStepResult()==EPass); )
+				{
+				++recipient;
+
+				if ( iSimInDatabase )
+					{
+					returnValue=ETrue;
+					}
+				else
+					{
+					TBuf<KMaxTestExecuteCommandLength>	tempStore;
+					tempStore.Format(KTo(), recipient);
+					returnValue=GetStringFromConfig(ConfigSection(), tempStore, to);
+					if ( !returnValue )
+						{
+						returnValue=GetStringFromConfig(KDef, KDefTo, to);
+						}
+					}
+				if ( !returnValue )
+					{
+					ERR_PRINTF1(_L("No To"));
+					SetTestStepResult(EFail);
+					}
+				else
+					{
+					INFO_PRINTF2(_L("To = %S"), &to);
+					sendAs.AddRecipientL(to, RSendAsMessage::ESendAsRecipientTo);
+					}
+				}
+#endif
+
+			TRAP(err, sendAs.SaveMessageAndCloseL());
+			if ( err!=KErrNone )
+				{
+				ERR_PRINTF1(_L("Save Message Failiure"));
+				SetTestStepResult(EFail);
+				sendAs.Close();
+				}
+			else
+				{
+				TMsvId				messageId=KMsvNullIndexEntryId;
+				CMsvEntry*			parent=iSession->GetEntryL(KMsvDraftEntryIdValue);
+				CleanupStack::PushL(parent);
+				parent->SetSortTypeL(SelectionOrdering());
+				CMsvEntrySelection*	selection=parent->ChildrenL();
+				CleanupStack::PushL(selection);
+
+				if ( selection->Count()>0 )
+					{
+					messageId=selection->At(0);
+					}
+				if ( messageId!=KMsvNullIndexEntryId )
+					{
+					SetEntryL(messageId);
+					TMsvEntry	child=EntryL().Entry();
+
+					//Get the message header
+					CSmsHeader*	smsHeader = createSmsUtil->NewHeaderL(*iBodyText);
+					CleanupStack::PushL(smsHeader);
+
+					//If message is too big lets concatenate.....
+					ConCatMessageTextL(*smsHeader);
+
+					CMsvStore*	store =NULL;
+					TRAPD(error, store = EntryL().EditStoreL());
+					if(error != KErrNone)
+						{
+						ERR_PRINTF2(_L("Edit Store Failed. Error %d"), error);
+						SetTestStepError(error);
+						}
+					else
+						{
+						CleanupStack::PushL(store);
+						smsHeader->RestoreL(*store);
+#if (defined CDMA_API_ENABLED)
+						//Adding the recipients...
+						CArrayPtrFlat<CSmsNumber>& recips = smsHeader->Recipients();
+
+						TInt	recipients=KPtDefaultCount;
+						GetIntFromConfig(ConfigSection(), KRecipients, recipients);
+
+						TBool	returnValue;
+						for ( TInt recipient=1; recipient<=recipients; recipient++)
+							{
+							TBuf<KMaxTestExecuteCommandLength>	tempStore;	
+
+							tempStore.Format(KTo(), recipient);	
+
+							TPtrC	to;
+							returnValue=GetStringFromConfig(ConfigSection(), tempStore, to);
+							if ( !returnValue )
+								{
+								returnValue=GetStringFromConfig(KDef, KDefTo, to);
+								}
+							if ( !returnValue )
+								{
+								ERR_PRINTF1(_L("No To"));
+								SetTestStepResult(EFail);
+								}
+							else
+								{
+								INFO_PRINTF2(_L("To = %S"), &to);
+
+								//Get the recipient array
+								CSmsNumber* newRecip = CSmsNumber::NewL();
+								CleanupStack::PushL(newRecip);
+
+								// Check for the email address in recipient
+								// This is for email over sms feature
+								if(to.Locate('@') != KErrNotFound)
+									{
+									newRecip->SetAddressL(to, EMsvAddressTypeEMail);
+									}
+								else
+									{
+									newRecip->SetAddressL(to, EMsvAddressTypeISDN);
+									}
+
+								//Append the recipients
+								recips.AppendL(newRecip);
+								CleanupStack::Pop(newRecip);
+								}
+							}
+#endif
+						child.SetSendingState(KMsvSendStateSuspended);
+						child.SetInPreparation(EFalse);
+						child.SetVisible(ETrue);
+
+						//Get the details
+						TBuf<KSmsDetailsLength>	details;
+
+//Usage of macros of Cdma mtm
+#if (!defined CDMA_API_ENABLED)
+						if ( TSmsUtilities::GetDetails(EntryL().Session().FileSession(), smsHeader->Message(), details) == KErrNone )
+							{
+							child.iDetails.Set(details);
+							}
+#else
+						//if ( TSmsUtilities::GetDetails(EntryL().Session().FileSession(), smsHeader->Message(), details) == KErrNone )
+						CArrayPtrFlat<CSmsNumber>& smsNumberArray = smsHeader->Recipients();
+						if ( smsNumberArray.Count() )
+							{
+							details.Copy(smsNumberArray[0]->Address());
+							}
+						if ( details.Length() )
+							{
+							child.iDetails.Set(details);
+							}
+#endif
+
+						//Get the description
+						TBuf<KSmsDescriptionLength>	desc;
+						if ( TSmsUtilities::GetDescription(smsHeader->Message(), desc) == KErrNone )
+							{
+							child.iDescription.Set(desc);
+							}
+
+						//fill up the fields of the message header
+						PrepareHeaderL(*createSmsUtil, *smsHeader);
+
+						//set the scheduled time if any
+						if ( aScheduledTime!=TTimeIntervalMinutes(0) )
+							{
+							child.SetSendingState(KMsvSendStateScheduled);
+							child.SetScheduled(ETrue);
+							child.iDate.UniversalTime();
+							child.iDate+=aScheduledTime;
+							}
+
+						//	Update entry with data set from .ini file
+						EntryL().ChangeL(child);
+						smsHeader->StoreL(*store);
+						store->CommitL();
+						CleanupStack::PopAndDestroy(store);
+
+						CTestMessEditEntryUtil*	editUtil=new (ELeave) CTestMessEditEntryUtil(*this, ETrue, iSimInDatabase, iSimPhoneNumber);
+						CleanupStack::PushL(editUtil);
+						editUtil->ProcessEntryL(EntryL().EntryId());
+						CleanupStack::PopAndDestroy(editUtil);
+
+						if ( aMsvId==KMsvGlobalOutBoxIndexEntryId )
+							{
+							// Move the selected message to out box
+							CTestActive*	active=CTestActive::NewLC(*this);
+							CMsvOperation*	op=parent->MoveL(child.Id(), KMsvGlobalOutBoxIndexEntryIdValue, active->iStatus);
+							CleanupStack::PushL(op);
+							active->Activate();
+							CActiveScheduler::Start();
+							CleanupStack::PopAndDestroy(2, active);
+							}
+						}
+					CleanupStack::PopAndDestroy(smsHeader);
+					}
+				CleanupStack::PopAndDestroy(2, parent);
+				}
+			}
+
+		CleanupStack::PopAndDestroy(&sendAsServer);
+		}
+	CleanupStack::PopAndDestroy(createSmsUtil);
+	}
+
+void CTestMessCreateSMS::AddMtmCapabilitiesL(RSendAs& aSendAs)
+	{
+	aSendAs.ResetMessageFilter();
+	}
+
+void CTestMessCreateSMS::PrepareSendAsL(RSendAsMessage& /*aSendAs*/)
+	{
+	}
+
+void CTestMessCreateSMS::PrepareHeaderL(CTestMessCreateSmsUtilBase& aCreateUtil, CSmsHeader& aSmsHeader)
+	{
+	aCreateUtil.PrepareHeaderL(aSmsHeader);
+	}
+
+//Usage of macro for CDMA mtm
+#if (defined CDMA_API_ENABLED)
+void CTestMessCreateSMS::ConCatMessageTextL(CSmsHeader& /*aHeader*/)
+	{
+	}
+#else
+void CTestMessCreateSMS::ConCatMessageTextL(CSmsHeader& aHeader)
+	//Doxygen compatible comments
+	/**
+		This method Concatenates the long message. Checks for the length of 
+		body, if it is greater than 160 characters sets the concatenation 
+		option on for the Sms.
+
+		@param aHeader
+		Header for which the concatenation option is set on... 
+
+	*/
+	{
+	CSmsSettings*	smsSettings = CSmsSettings::NewL();
+	CleanupStack::PushL(smsSettings);
+	//if the length of the iBodyText is greater than the sms maximum length
+	//i.e 160 chars...Set the Concatenation On....
+	if( aHeader.Message().MessageLengthL() > aHeader.Message().MaxMessageLength() )
+		{
+		INFO_PRINTF1(_L("Concatenate Message..."));
+		INFO_PRINTF1(_L("Message Exceeds max length setting Concatenate On..."));
+		aHeader.GetSmsSettingsL(*smsSettings);
+		smsSettings->SetCanConcatenate(ETrue);
+		aHeader.SetSmsSettingsL(*smsSettings);
+		}
+	CleanupStack::PopAndDestroy(smsSettings);
+	}
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Src/TestMessCreateSMSaccount.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,154 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessCreateSmsAccount which creates an SMS
+// account folder for GSM or CDMA
+// 
+//
+
+#include "TestMessCreateSmsAccount.h"
+#include "TestMess.h"
+#include "Configuration.cfg"
+
+// EPOC includes
+#include <msvids.h>
+#include <miutset.h>
+#include <msvstore.h>
+
+#include "TestMessCreateGsmSmsUtil.h"
+//Usage of Macro for CDMA mtm
+#if (defined CDMA_API_ENABLED)
+#include "TestMessCreateCdmaSmsUtil.h"
+#endif
+
+#include <csmsaccount.h>
+#include <MsvScheduleSettings.h>
+#include <MsvOffPeakTime.h>
+#include <MsvSendErrorAction.h>
+#include <MsvSysAgentAction.h>
+
+/*@{*/
+_LIT(KSCName,				"scname");
+_LIT(KSCNumber,				"scnumber");
+
+_LIT(KPtGSM,				"GSM");
+#if (defined CDMA_API_ENABLED)
+_LIT(KPtMessageBearerType,	"MessageBearerType");
+_LIT(KPtCDMA,				"CDMA");		
+#endif
+/*@}*/
+
+CTestMessCreateSmsAccount::CTestMessCreateSmsAccount()
+:	CTestMessBase(EFalse)
+	{
+	SetTestStepName(_L("CreateSmsAccount"));
+	}
+
+/**
+ Creates the SMS account folder for GSM or CDMA. For CDMA mtm,
+ it creates the respective utility class for creating the account
+ @return TVerdict
+*/
+TVerdict CTestMessCreateSmsAccount::doTestStepL()
+	{
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("Create SMS account"));
+
+	TPtrC	ptrSCName;
+	TBool	returnValue =GetStringFromConfig(ConfigSection(), KSCName, ptrSCName);
+	INFO_PRINTF2(_L("SC Name = %S"), &ptrSCName);
+
+	TPtrC	ptrSCNumber;
+	returnValue =GetStringFromConfig(ConfigSection(), KSCNumber, ptrSCNumber);
+	INFO_PRINTF2(_L("SC Number = %S"), &ptrSCNumber);
+
+	CSmsAccount*			smsAccount = CSmsAccount::NewLC();
+	CMsvScheduleSettings*	scheduleSetting = CMsvScheduleSettings::NewLC();
+	CMsvOffPeakTimes*		offPeakTimes=new (ELeave) CMsvOffPeakTimes();
+	CleanupStack::PushL(offPeakTimes);
+	CMsvSendErrorActions*	errorActions=CMsvSendErrorActions::NewLC();
+	CMsvSysAgentActions*	sysAgentActions=new (ELeave) CMsvSysAgentActions();
+	CleanupStack::PushL(sysAgentActions);
+	CSmsSettings*		smsSettings = CSmsSettings::NewL();
+	CleanupStack::PushL(smsSettings);
+	SetEntryL(KMsvRootIndexEntryId);
+
+	EntryL().SetSortTypeL(SelectionOrdering());
+	CMsvEntrySelection*	selection=EntryL().ChildrenWithTypeL(KUidMsvServiceEntry);
+	CleanupStack::PushL(selection);
+	TInt				count=selection->Count();
+	TBool				found=EFalse;
+	for (TInt i=count; i>0 && !found; )
+		{
+		SetEntryL(selection->At(--i));
+
+		// Only one Sms Service allowed
+		if	(	EntryL().Entry().iMtm == KUidMsgTypeSMS &&
+				EntryL().Entry().iType == KUidMsvServiceEntry
+			)
+			{
+			found=ETrue;
+			}
+		}
+
+	if ( !found )
+		{
+		smsAccount->InitialiseDefaultSettingsL(*smsSettings);
+		smsAccount->InitialiseDefaultSettingsL(*scheduleSetting, *offPeakTimes, *errorActions, *sysAgentActions);
+
+		TPtrC	messageBearerType;
+		messageBearerType.Set(KPtGSM);
+#if (defined CDMA_API_ENABLED)
+		GetStringFromConfig(ConfigSection(), KPtMessageBearerType, messageBearerType);
+		INFO_PRINTF2(_L("The message bearer type is : %S"), &messageBearerType);
+#endif
+
+		CTestMessCreateSmsUtilBase*	createSmsUtil = NULL;
+		//Creates the util class for GSM or CDMA
+		if ( messageBearerType.Compare(KPtGSM)==0 )
+			{
+			createSmsUtil = new (ELeave) CTestMessCreateGsmSmsUtil(*this);
+			}
+#if (defined CDMA_API_ENABLED)
+		else if( messageBearerType.Compare(KPtCDMA)==0 )
+			{
+			createSmsUtil = new (ELeave) CTestMessCreateCdmaSmsUtil(*this);
+			}
+#endif
+		else
+			{
+			WARN_PRINTF1(_L("Unknown bearer type using Gsm"));
+			createSmsUtil= new (ELeave) CTestMessCreateGsmSmsUtil(*this);
+			}
+		CleanupStack::PushL(createSmsUtil);
+
+		//Changes the new account settings
+		createSmsUtil->SetSmsAccountSettings(*smsSettings);
+		CleanupStack::PopAndDestroy(createSmsUtil);
+
+		smsAccount->SaveSettingsL(*smsSettings);
+		smsAccount->SaveSettingsL(*scheduleSetting, *offPeakTimes, *errorActions, *sysAgentActions);
+		}
+
+	if ( TestStepResult()==EPass )
+		{
+		smsAccount->LoadSettingsL(*smsSettings);
+		smsSettings->AddServiceCenterL(ptrSCName, ptrSCNumber);
+		smsAccount->SaveSettingsL(*smsSettings);
+		}
+
+	CleanupStack::PopAndDestroy(2, smsSettings);
+	CleanupStack::PopAndDestroy(5, smsAccount);
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Src/TestMessCreateSmsUtilBase.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,27 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This class is the base class for create CDMA or GSM SMS utility class
+// 
+//
+
+
+#include "TestMessCreateSmsUtilBase.h"
+
+/**
+ Constructor
+*/
+CTestMessCreateSmsUtilBase::CTestMessCreateSmsUtilBase(CTestMessBase &aTestStep)
+: iTestStep(aTestStep)
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Src/TestMessEditEntry.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,170 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessEditEntry which edits the entry characterstics
+// 
+//
+ 
+#include "TestMessEditEntry.h"
+#include "TestMessEditEntryUtil.h"
+
+/**
+ * @name Constant Literals used.
+ */
+/*@{*/
+_LIT(KPtSaveToOutbox,			"SaveToOutbox");
+/*@}*/
+
+/// Default value for depth of the count
+#define KDefaultDepthCount	1
+
+/**
+ * Override of base class pure virtual
+ * @param  None
+ * @return TVerdict - return TVerdict codes
+ * @panic None
+ * @leave KErrNoMemory
+ *  
+*/
+void CTestMessEditEntry::ProcessMessageL(CBaseMtm& /*aBaseMtm*/, TMsvId /*aMsgId*/)
+	{
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("Edit Entry"));
+
+	if ( TestStepResult() == EPass )
+		{
+		CTestMessEditEntryUtil*	editUtil=new (ELeave) CTestMessEditEntryUtil(*this, EFalse, EFalse, RMobilePhone::TMobileAddress());
+		CleanupStack::PushL(editUtil);
+
+		editUtil->ProcessEntryL(EntryL().EntryId());
+
+		//Read whether the message is saved in outbox
+		TBool saveOutbox;
+		if( ! GetBoolFromConfig(ConfigSection(), KPtSaveToOutbox, saveOutbox))
+			{
+			saveOutbox = EFalse;
+			}
+
+		INFO_PRINTF2(_L("The message saved in outbox flag is : %S"), &saveOutbox);
+		if(saveOutbox)
+			{
+			//Move the message to outbox
+			MoveMessageL(EntryL().EntryId(), KMsvGlobalOutBoxIndexEntryId);
+			}
+		else
+			{
+			INFO_PRINTF1(_L("Entry is not moved"));
+			}
+
+		CleanupStack::PopAndDestroy(editUtil);
+		}
+	}
+
+/**
+ Move the message the destination folder
+ @param aMessageId - TMsvId of the message
+ @param aFolderId - TMsvId of the destination folder
+ @leave KErrNoMemory
+ @leave KErrNotFound
+*/
+void CTestMessEditEntry::MoveMessageL(TMsvId aMessageId,TMsvId aFolderId)
+	{
+	// Get CMsvEntry object and the TMsvEntry of the message
+	CMsvEntry*		msgvEntry = iSession->GetEntryL(aMessageId);
+	CleanupStack::PushL(msgvEntry);
+	TMsvEntry entry= msgvEntry->Entry();
+
+	// Get the parent folder Id of the messaage and create the CMsvEntry
+	TMsvId			parentId = entry.Parent();
+	CMsvEntry*		msvEntry = iSession->GetEntryL(parentId);
+	CleanupStack::PushL(msvEntry);
+
+	// Create the active object for handling asynchronous request
+	CMoveOperation*	activeOperation = CMoveOperation::NewL();
+	CleanupStack::PushL(activeOperation);
+
+	// Move the selected message to given target folder
+	CMsvOperation*	op = msvEntry->MoveL(aMessageId, aFolderId, activeOperation->iStatus);
+	CleanupStack::PushL(op);
+
+	// Start the Active scheduler 
+	activeOperation->SetOperation();
+	CActiveScheduler::Start();
+	TInt	error = activeOperation->iStatus.Int();
+	if(error == KErrNone)
+		{
+		INFO_PRINTF1(_L("message moved successfully"));
+		}
+	else
+		{
+		INFO_PRINTF2(_L("message failed to be moved. Error : %d"),error);
+		SetTestStepResult(EFail);
+		}
+		//Destroy the object
+	CleanupStack::PopAndDestroy(4, msgvEntry);
+	}
+
+/**
+ Constructor for CMoveOperation 
+*/
+CTestMessEditEntry::CMoveOperation::CMoveOperation()
+: CActive(CActive::EPriorityStandard)
+	{
+	}
+
+/**
+ Two phase constructor
+ @return CTestMessEditEntry::CMoveOperation* - pointer of CTestMessEditEntry::CMoveOperation
+ @leave - KErrNoMemory
+ @leave - System wide error codes
+*/
+CTestMessEditEntry::CMoveOperation* CTestMessEditEntry::CMoveOperation::NewL()
+	{
+	CMoveOperation* self = new (ELeave) CMoveOperation();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+/**
+ Second phase construction
+ @leave - sytem wide error codes
+*/
+void CTestMessEditEntry::CMoveOperation::ConstructL()
+	{
+	CActiveScheduler::Add(this);
+	}
+
+/**
+ Sets the operation as active
+*/
+void CTestMessEditEntry::CMoveOperation::SetOperation()
+	{
+	SetActive();
+	}
+
+/**
+ Operation completed event handler.
+*/
+void CTestMessEditEntry::CMoveOperation::RunL()
+	{
+	CActiveScheduler::Stop();
+	}
+
+/**
+ Cancels the active operation
+*/
+void CTestMessEditEntry::CMoveOperation::DoCancel()
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Src/TestMessEditEntryUtil.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,249 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessEditEntryUtil. A utility to edit an entry
+// 
+//
+
+
+#include "TestMessEditEntryUtil.h"
+
+// EPOC includes
+
+#include <smut.h>
+#include <miutmsg.h>
+#include <mtclreg.h>
+
+/**
+ * @name Constant Literals used.
+ */
+/*@{*/
+_LIT(KToRecipients,			"toRecipients");
+_LIT(KTo,					"to%d");
+_LIT(KDef,					"default");
+_LIT(KDefTo,				"emailto");
+
+/// Literal constants used
+_LIT(KCharacterSetType,		"characterSetType");
+_LIT(KPtEditBody,			"EditBody");
+_LIT(KPtEditRecipients,		"EditRecipients");
+_LIT(KPtRecipient,			"recipient%d");
+/*@}*/
+
+CTestMessEditEntryUtil::CTestMessEditEntryUtil(CTestMessBase& aTestStep, TBool aSimChecked, TBool aSimInDatabase, RMobilePhone::TMobileAddress aSimPhoneNumber)
+:	CTestMessStoreProcessUtil(aTestStep, EFalse)
+,	iSimChecked(aSimChecked)
+,	iSimInDatabase(aSimInDatabase)
+,	iSimPhoneNumber(aSimPhoneNumber)
+	{
+	}
+
+/**
+ * Edits the ImHeaders of the Entry
+ * @param  CImHeader& aHeader - Im Header to edit
+ * @return None
+ * @panic None
+ * @leave KErrNoMemory
+ *  
+*/
+void CTestMessEditEntryUtil::ProcessImHeaderL(CImHeader& aHeader)
+	{
+	// Edit the CImHeader information
+	TInt	recipients;
+	if ( !iTestStep.GetIntFromConfig(iTestStep.ConfigSection(), KToRecipients, recipients) )
+		{
+		recipients=0;
+		}
+
+	for ( TInt recipient=1; recipient<=recipients; recipient++)
+		{
+		TBuf<KMaxTestExecuteCommandLength>	tempStore;
+		tempStore.Format(KTo(), recipient);
+
+		TPtrC	to;
+		TInt	returnValue=iTestStep.GetStringFromConfig(iTestStep.ConfigSection(), tempStore, to);
+		if ( !returnValue )
+			{
+			returnValue=iTestStep.GetStringFromConfig(KDef, KDefTo, to);
+			}
+		if ( !returnValue )
+			{
+			iTestStep.ERR_PRINTF1(_L("No To"));
+			iTestStep.SetTestStepResult(EFail);
+			}
+		else
+			{
+			iTestStep.INFO_PRINTF2(_L("To = %S"), &to);
+			aHeader.ToRecipients().AppendL(to);
+			}
+		}
+	}
+
+/**
+ * Edits the ImMimeHeaders of the message entry
+ * @param  CImMimeHeader& aHeader - Mime Header to edit
+ * @return None
+ * @panic None
+ * @leave KErrNoMemory
+ *  
+*/
+void CTestMessEditEntryUtil::ProcessImMimeHeaderL(CImMimeHeader& aHeader)
+	{
+	// Update the character set info
+	TPtrC	charSetType;
+	if ( iTestStep.GetStringFromConfig(iTestStep.ConfigSection(), KCharacterSetType, charSetType) )
+		{
+		TUint	charSetVal;
+		if ( ValidCharacterSetInfo(charSetType, charSetVal) )
+			{
+			aHeader.SetMimeCharset(charSetVal);
+			}
+		}
+	}
+
+/**
+ * Edits the ImIAPPreferences of the entry
+ * @param  CImIAPPreferences& aPreferences - IAP Preferences to edit
+ * @return None
+ * @panic None
+ * @leave KErrNoMemory
+ *  
+*/
+void CTestMessEditEntryUtil::ProcessInternetAccessPreferencesL(CImIAPPreferences& /*aPreferences*/)
+	{
+	}
+
+/**
+ Edits the CSmsHeader of the entry
+ @param  CSmsHeader& aHeader - Sms Header to edit
+ @return None
+ @panic None
+ @leave KErrNoMemory
+*/
+void CTestMessEditEntryUtil::ProcessSmsHeaderStreamL(CSmsHeader& aSmsHeader)
+	{
+	// Get the number of recipients 
+	TInt	recipients = 0;
+	if ( !iTestStep.GetIntFromConfig(iTestStep.ConfigSection(), KPtEditRecipients, recipients) )
+		{
+		recipients=0;
+		iTestStep.INFO_PRINTF1(_L("No Recipients edited/added"));
+		}
+	iTestStep.INFO_PRINTF2(_L("The number of recipients : %d"), recipients);
+
+	if ( !iSimChecked )
+		{
+		//IMK iSimInDatabase=(iTestStep.GetPhoneSmsNumberL(iSimPhoneNumber)==KErrNone);
+		iSimInDatabase=0;
+		}
+	TPtrC	to(iSimPhoneNumber.iTelNumber);
+	TInt	returnValue=ETrue;
+	for ( TInt recipient=0; (recipient<recipients) && (iTestStep.TestStepResult()==EPass); )
+		{
+		++recipient;
+		if ( iSimInDatabase )
+			{
+			returnValue=ETrue;
+			}
+		else
+			{
+			TBuf<KMaxTestExecuteCommandLength>	tempStore;
+			tempStore.Format(KPtRecipient(), recipient);
+
+			//Get the recipient address
+			returnValue=iTestStep.GetStringFromConfig(iTestStep.ConfigSection(), tempStore, to);
+			if ( !returnValue )
+				{
+				returnValue=iTestStep.GetStringFromConfig(KDef, KDefTo, to);
+				}
+			}
+		if ( !returnValue )
+			{
+			iTestStep.ERR_PRINTF1(_L("Recipient number is not Provided"));
+			iTestStep.SetTestStepResult(EFail);
+			}
+		else
+			{
+			//Append the recipient address in recipient list
+			CSmsNumber*	smsNumber = CSmsNumber::NewL();
+			CleanupStack::PushL(smsNumber);
+			iTestStep.INFO_PRINTF2(_L("To = %S"), &to);
+			smsNumber->SetAddressL(to);
+			aSmsHeader.Recipients().AppendL(smsNumber);
+			//No need to destory CSmsNumber. CSmsHeader destroys it
+			CleanupStack::Pop(smsNumber);
+			}
+		}
+	}
+
+
+/**
+ Edits the CRichText of the entry
+ @param  CRichText& aBodyText - Text to edit
+ @return None
+ @panic None
+ @leave KErrNoMemory
+*/
+void CTestMessEditEntryUtil::ProcessRichTextBodyL(CRichText& aBodyText)
+	{
+	TPtrC	ptrBody;
+	//Get the body text file
+	TBool	returnValue=iTestStep.GetStringFromConfig(iTestStep.ConfigSection(), KPtEditBody, ptrBody);
+	if ( !returnValue )
+		{
+		iTestStep.INFO_PRINTF1(_L("Body is not edited"));
+		}
+	else
+		{
+		iTestStep.INFO_PRINTF2(_L("Body = %S"), &ptrBody);
+
+		// open the file
+		RFs rfs;
+		rfs.Connect();
+		RFile	file;
+
+		//Append the body text of the entry
+		TInt anError = file.Open(rfs, ptrBody, EFileShareAny);
+		if(anError == KErrNone)
+			{
+			TBool		reading=ETrue;
+			TInt		pos = aBodyText.LdDocumentLength();
+			TBuf8<1>	charIn;
+			while (reading)
+				{
+				file.Read(charIn, 1);
+				if(charIn.Length())
+					switch ( charIn[0] )
+						{
+					case '\r':
+						aBodyText.InsertL(pos++, CEditableText::ELineBreak);
+					case '\n':
+						break;
+					default:
+						aBodyText.InsertL(pos++, TChar(charIn[0]));
+						}
+				else
+					{
+					reading = FALSE;	// stop at the end of the file
+					}
+				}
+			file.Close();
+			rfs.Close();
+			}
+		else
+			{
+			iTestStep.ERR_PRINTF2(_L("Cannot open file = %S"), &ptrBody);
+			iTestStep.SetTestStepResult(EFail);
+			}
+		}	
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Src/TestMessPrintEntryUtil.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,117 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessEditEntryUtil. A utility to edit an entry
+// 
+//
+
+#include "Configuration.cfg"
+
+#include "TestMessPrintEntryUtil.h"
+
+CTestMessPrintEntryUtil::CTestMessPrintEntryUtil(CTestMessBase& aTestStep)
+:	CTestMessStoreProcessUtil(aTestStep, ETrue)
+	{
+	}
+
+/**
+ * Prints the ImHeaders of the Entry
+ * @param  CImHeader& aHeader - Im Header to edit
+ * @return None
+ * @panic None
+ * @leave KErrNoMemory
+ *  
+*/
+void CTestMessPrintEntryUtil::ProcessImHeaderL(CImHeader& aHeader)
+	{
+	TPtrC	ptrTemp;
+
+	ptrTemp.Set(aHeader.From());
+	iTestStep.INFO_PRINTF2(_L("  From                         : %S"), &ptrTemp);
+	ptrTemp.Set(aHeader.ReceiptAddress());
+	iTestStep.INFO_PRINTF2(_L("  ReceiptAddress               : %S"), &ptrTemp);
+	ptrTemp.Set(aHeader.ReplyTo());
+	iTestStep.INFO_PRINTF2(_L("  ReplyTo                      : %S"), &ptrTemp);
+	ptrTemp.Set(aHeader.Subject());
+	iTestStep.INFO_PRINTF2(_L("  Subject                      : %S"), &ptrTemp);
+	}
+
+/**
+ * Prints the ImMimeHeaders of the message entry
+ * @param  CImMimeHeader& aHeader - Mime Header to edit
+ * @return None
+ * @panic None
+ * @leave KErrNoMemory
+ *  
+*/
+void CTestMessPrintEntryUtil::ProcessImMimeHeaderL(CImMimeHeader& /*aHeader*/)
+	{
+	}
+
+/**
+ * Prints the ImIAPPreferences of the entry
+ * @param  CImIAPPreferences& aPreferences - IAP Preferences to edit
+ * @return None
+ * @panic None
+ * @leave KErrNoMemory
+ *  
+*/
+void CTestMessPrintEntryUtil::ProcessInternetAccessPreferencesL(CImIAPPreferences& aPreferences)
+	{
+	TInt	prefs=aPreferences.NumberOfIAPs();
+	for ( TInt pref=0; pref<prefs; )
+		{
+		TImIAPChoice	choice=aPreferences.IAPPreference(pref++);
+		iTestStep.INFO_PRINTF2(_L("  IAP Preference               : %d"), pref);
+		iTestStep.INFO_PRINTF2(_L("  iIAP                         : %d"), choice.iIAP);
+		iTestStep.INFO_PRINTF2(_L("  iDialogPref                  : %d"), choice.iDialogPref);
+		}
+	}
+
+/**
+ * Prints the CSmsHeader of the entry
+ * @param  CSmsHeader& aHeader - Sms Header to edit
+ * @return None
+ * @panic None
+ * @leave KErrNoMemory
+ *  
+*/
+void CTestMessPrintEntryUtil::ProcessSmsHeaderStreamL(CSmsHeader& aHeader)
+	{
+#if (defined CDMA_API_ENABLED)
+	CSmsSettings*	smsSettings = CSmsSettings::NewL();
+	CleanupStack::PushL(smsSettings);
+	aHeader.GetDefaultMessageSettingsL(*smsSettings);
+	TSmsMessageType	pduType = aHeader.MessageType();
+	TBool			replyPath = smsSettings->ReplyPath();
+	CleanupStack::PopAndDestroy(smsSettings);
+#else
+	CSmsPDU::TSmsPDUType	pduType=aHeader.Type();
+	TBool					replyPath = aHeader.ReplyPathProvided();
+#endif
+	iTestStep.INFO_PRINTF2(_L("  pduType                      : %d"), pduType);
+	iTestStep.INFO_PRINTF2(_L("  replyPathProvided            : %d"), replyPath);
+	}
+
+
+/**
+ * Prints the CRichText of the entry
+ * @param  CRichText& aBodyText - Text to edit
+ * @return None
+ * @panic None
+ * @leave KErrNoMemory
+ *  
+*/
+void CTestMessPrintEntryUtil::ProcessRichTextBodyL(CRichText& /*aBodyText*/)
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Src/TestMessProcessExistingMsg.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,91 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessProcessExistingMsg
+// Base class for processing an existing message
+// 
+//
+
+
+
+/**
+ @file TestMessProcessExistingMsg.cpp
+*/
+
+#include "TestMessProcessExistingMsg.h"
+
+// EPOC includes
+#include <mtclreg.h>
+#include <miuthdr.h>
+#include <txtfmlyr.h>
+#include <txtrich.h>
+#include <miutmsg.h>
+
+/**
+ * Constructor.
+ * @return - None
+ * 
+*/	
+CTestMessProcessExistingMsg::CTestMessProcessExistingMsg()
+:	CTestMessBase(ETrue)
+	{
+	}
+
+/**
+ * Override of base class pure virtual function
+ * @return - TVerdict code
+ * @leave - KErrNoMemory - memory allocatior failure
+ * @leave - KErrBadLibraryEntryPoint  - Malformed MTM
+ * @leave - KErrNotFound - Not found the mtmUid and StepStepResult set to Fail
+ * 
+*/	
+TVerdict CTestMessProcessExistingMsg::doTestStepL()
+	{
+	if ( TestStepResult() == EPass )
+		{
+		CClientMtmRegistry*	clientMtmRegistry=CClientMtmRegistry::NewL(*iSession);
+		CleanupStack::PushL(clientMtmRegistry);
+
+		iMtmID=EntryL().Entry().iMtm;
+
+		CBaseMtm*	baseMtm=clientMtmRegistry->NewMtmL(iMtmID);
+		CleanupStack::PushL(baseMtm);
+
+		// switch the context
+		TMsvId		msgId=EntryL().EntryId();
+		PrintEntryL(EntryL());
+		baseMtm->SwitchCurrentEntryL(msgId);
+		baseMtm->LoadMessageL();
+
+		ProcessMessageL(*baseMtm, msgId);
+
+		if ( TestStepResult() == EPass )
+			{
+			PostProcessMessageL();
+			}
+
+		CleanupStack::PopAndDestroy(2, clientMtmRegistry);
+		}
+	
+	return TestStepResult();
+	}
+
+/**
+ * Nothing done for open
+ * @return None
+ * @leave KErrNone and TestStepResult set to EFail
+ * 
+*/
+void CTestMessProcessExistingMsg::PostProcessMessageL()
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Src/TestMessProcessor.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,288 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessProcessor which an active object utility
+// used for send/recieving or any time consuming 
+// 
+//
+
+#include "TestMessProcessor.h"
+#include "TestMessBase.h"
+
+CTestMessProcessor* CTestMessProcessor::NewL(CTestStep& aTestStep, CMsvSession& aSession)
+	{
+	CTestMessProcessor*	self=new(ELeave) CTestMessProcessor(aTestStep, aSession);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop();
+	return self;
+	}
+
+CTestMessProcessor::CTestMessProcessor(CTestStep& aTestStep, CMsvSession& aSession)
+:	CActive(EPriorityStandard)
+,	iState(EStatePrepareToSendMsg)
+,	iTestStep(aTestStep)
+,	iSession(aSession)
+,	iEntry(NULL)
+,	iMsgId(KMsvRootIndexEntryId)
+,	iClient(NULL)
+,	iMsvOperation(NULL)
+,	iCancelSms(EFalse)
+	{
+	}
+
+CTestMessProcessor::~CTestMessProcessor()
+	{
+	delete iEntry;
+	iEntry=NULL;
+	delete iMsvOperation;
+	iMsvOperation=NULL;
+	}
+
+void CTestMessProcessor::ConstructL()
+	{
+	CActiveScheduler::Add(this);
+	}
+
+void CTestMessProcessor::DoCancel()
+	{
+	iTestStep.INFO_PRINTF1(_L("Cancel operation"));
+	iMsvOperation->Cancel();
+	}
+
+void CTestMessProcessor::DisplayProgress()
+	{
+	// display the current progress
+	switch(iState)
+		{
+	case EStatePrepareToSendMsg:
+		{
+		TMsvLocalOperationProgress			temp;
+		TPckgC<TMsvLocalOperationProgress>	progress(temp);
+
+		progress.Set(iMsvOperation->ProgressL());
+		iTestStep.INFO_PRINTF1(_L("   Progress"));
+		iTestStep.INFO_PRINTF2(_L("       Operation              :%d"), progress().iType);
+		iTestStep.INFO_PRINTF2(_L("       Total Number Of Entries:%d"), progress().iTotalNumberOfEntries);
+		iTestStep.INFO_PRINTF2(_L("       Number Completed       :%d"), progress().iNumberCompleted);
+		iTestStep.INFO_PRINTF2(_L("       Number Failed          :%d"), progress().iNumberFailed);
+		iTestStep.INFO_PRINTF2(_L("       Number Remaining       :%d"), progress().iNumberRemaining);
+		iTestStep.INFO_PRINTF2(_L("       Error                  :%d"), progress().iError);
+		iTestStep.INFO_PRINTF2(_L("       Id                     :%x"), progress().iId);
+		}
+		break;
+	case EStateRequest:
+		iClient->DisplayProgressL(EFalse, iMsvOperation);
+		break;
+	default:
+		break;
+		}
+	}
+
+void CTestMessProcessor::SendEmailMessageL(TMsvId aMsgId, MTestMessProcessorClient* aClient)
+	{
+	iMsgId=aMsgId;
+	iClient=aClient;
+	iState=EStatePrepareToSendMsg;
+
+	delete iEntry;
+	iEntry=NULL;
+	iEntry=iSession.GetEntryL(iMsgId);
+	iMsgEntry=iEntry->Entry();
+	iMsgEntry.SetSendingState(KMsvSendStateWaiting);
+	delete iMsvOperation;
+	iMsvOperation=NULL;
+	iMsvOperation=iEntry->ChangeL(iMsgEntry, iStatus);
+	SetActive();
+	}
+
+/**
+ Sends the sms message. It sets the fields of the enty.
+ @param aMsgId - TMsvId of the message
+ @param aClient - Pointer to the MTestMessProcessClient
+ @param aCancelSms - Bool value for the Cancel sms flag
+*/
+void CTestMessProcessor::SendSmsMessageL(TMsvId aMsgId, MTestMessProcessorClient* aClient, TBool aCancelSms)
+	{
+	iMsgId=aMsgId;
+	iClient=aClient;
+	iState=EStatePrepareToSendMsg;
+	iCancelSms = aCancelSms;
+
+	delete iEntry;
+	iEntry=NULL;
+	iEntry=iSession.GetEntryL(iMsgId);
+	iMsgEntry=iEntry->Entry();
+	iMsgEntry.SetConnected(ETrue);
+	iMsgEntry.SetFailed(EFalse);
+	iMsgEntry.SetSendingState(KMsvSendStateWaiting);
+	iMsgEntry.iError = KErrNone;
+	delete iMsvOperation;
+	iMsvOperation=NULL;
+	iMsvOperation=iEntry->ChangeL(iMsgEntry, iStatus);
+	SetActive();
+	}
+
+void CTestMessProcessor::SendMmsMessageL(TMsvId aMsgId, MTestMessProcessorClient* aClient)
+	{
+	iMsgId=aMsgId;
+	iClient=aClient;
+	iState=EStatePrepareToSendMsg;
+
+	delete iEntry;
+	iEntry=NULL;
+	iEntry=iSession.GetEntryL(iMsgId);
+	iMsgEntry=iEntry->Entry();
+	iMsgEntry.SetSendingState(KMsvSendStateWaiting);
+	delete iMsvOperation;
+	iMsvOperation=NULL;
+	iMsvOperation=iEntry->ChangeL(iMsgEntry, iStatus);
+	SetActive();
+	}
+
+void CTestMessProcessor::MtmRequestL(TMsvId aAccountId, MTestMessProcessorClient* aClient)
+	{
+	iMsgId=aAccountId;
+	iClient=aClient;
+	iState=EStateRequest;
+
+	delete iEntry;
+	iEntry=NULL;
+	iEntry=iSession.GetEntryL(iMsgId);
+	iStatus = KRequestPending;
+	delete iMsvOperation;
+	iMsvOperation=NULL;
+	TRAPD(err, iMsvOperation=iClient->CreateOperationL(iStatus));
+	if ( iTestStep.TestStepResult() == EPass && err==KErrNone )
+		{
+		SetActive();
+		}
+	}
+
+void CTestMessProcessor::RunL()
+	{
+	switch(iState)
+		{
+	case EStatePrepareToSendMsg:
+		switch (iStatus.Int())
+			{
+		case KErrNone:
+			{
+			delete iMsvOperation;
+			iMsvOperation=NULL;
+			delete iEntry;
+			iEntry=NULL;
+			iEntry=iSession.GetEntryL(iMsgId);
+			iMsgEntry=iEntry->Entry();
+			iMsgEntry.SetSendingState(KMsvSendStateWaiting);
+			iEntry->ChangeL(iMsgEntry);
+			if ( iMsgEntry.SendingState() == KMsvSendStateWaiting )
+				{
+				iState=EStateRequest;
+				iStatus = KRequestPending;
+				TRAPD(err, iMsvOperation=iClient->CreateOperationL(iStatus));
+				if ( iTestStep.TestStepResult() == EPass && err==KErrNone )
+					{
+					SetActive();
+					}
+				else
+					{
+					CActiveScheduler::Stop();
+					}
+				}
+			else
+				{
+				iTestStep.ERR_PRINTF2(_L("Sending State not Waiting :%d"), iMsgEntry.SendingState());
+				iTestStep.SetTestStepResult(EFail);
+				CActiveScheduler::Stop();
+				}
+			}
+			break;
+		case KErrCancel:
+			{
+			if(iCancelSms)
+				{
+				iTestStep.INFO_PRINTF1(_L("Sending of the mesage Cancelled successfully"));
+				}
+			else
+				{
+				iTestStep.ERR_PRINTF2(_L("Message failed to Send, Error = %d"), iStatus.Int());
+				iTestStep.SetTestStepResult(EFail);
+				}
+			CActiveScheduler::Stop();
+			break;
+			}
+		default:
+			iTestStep.ERR_PRINTF2(_L("Unknown Event :%d"), iStatus.Int());
+			iTestStep.SetTestStepResult(EFail);
+			CActiveScheduler::Stop();
+			}
+		break;
+	case EStateRequest:
+		switch (iStatus.Int())
+			{
+		case KErrNone:
+			{
+			TInt	error=iClient->DisplayProgressL(ETrue, iMsvOperation);
+			if ( error != KErrNone )
+				{
+				iTestStep.ERR_PRINTF2(_L("Progress Error:%d"), error);
+				iTestStep.SetTestStepResult(EFail);
+				}
+			delete iMsvOperation;
+			iMsvOperation=NULL;
+
+			//	Is there another operation
+			if ( iClient->MoreOperations() )
+				{
+				iStatus = KRequestPending;
+				TRAPD(err, iMsvOperation=iClient->CreateOperationL(iStatus));
+				if ( iTestStep.TestStepResult() == EPass && err==KErrNone )
+					{
+					SetActive();
+					}
+				else
+					{
+					CActiveScheduler::Stop();
+					}
+				}
+			else
+				{
+				CActiveScheduler::Stop();
+				}
+			}
+			break;
+		case KErrServerTerminated:
+			{
+			TInt	error=iClient->DisplayProgressL(ETrue, iMsvOperation);
+			if ( error != KErrServerTerminated )
+				{
+				iTestStep.ERR_PRINTF2(_L("Progress Error:%d"), error);
+				iTestStep.SetTestStepResult(EFail);
+				}
+			delete iMsvOperation;
+			iMsvOperation=NULL;
+			CActiveScheduler::Stop();
+			}
+		default:
+			iTestStep.ERR_PRINTF2(_L("Unknown Event :%d"), iStatus.Int());
+			iTestStep.SetTestStepResult(EFail);
+			CActiveScheduler::Stop();
+			}
+		break;
+	default:
+		iTestStep.ERR_PRINTF1(_L("No handler found in CTestMessProcessor class"));
+		iTestStep.SetTestStepResult(EFail);
+		CActiveScheduler::Stop();
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Src/TestMessServer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,191 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "TestMessServer.h"
+#include "TestMessSession.h"
+#include "TestMessCleanMessageFolder.h"
+#include "TestMessCreateSmsAccount.h"
+//IMK #include "TestMessCreatePopAccount.h"
+//IMK #include "TestMessCreateImapAccount.h"
+#include "TestMessSetDefaultSc.h"
+//IMK #include "TestMessCreateBIO.h"
+//IMK #include "TestMessCreateEmail.h"
+//IMK #include "TestMessCreateBulkEmail.h"
+//IMK #include "TestMessCreateEMS.h"
+#include "TestMessCreateSMS.h"
+//IMK #include "TestMessCreateBulkSMS.h"
+//IMK #include "TestMessEntryCount.h"
+//IMK #include "TestMessSendEmail.h"
+//IMK #include "TestMessSendBulkEmail.h"
+//IMK #include "TestMessSendSms.h"
+//IMK #include "TestMessDeleteEmailImap.h"
+//IMK #include "TestMessDeleteEmailPop.h"
+//IMK #include "TestMessFullSyncImap.h"
+//IMK #include "TestMessReceiveEmailImap.h"
+//IMK #include "TestMessReceiveEmailPop.h"
+//IMK #include "TestMessOpen.h"
+//IMK #include "TestMessVerifyEntry.h"
+//IMK #include "TestMessReply.h"
+//IMK #include "TestMessForward.h"
+//IMK #include "TestMessCompareMessages.h"
+//IMK #include "TestMessSetSyncRateImap.h"
+//IMK #include "TestMessDeleteSharedData.h"
+#include "TestMessEditEntry.h"
+//IMK #include "TestMessSaveEmailAttachments.h"
+//IMK #include "TestMessDeleteFolder.h"
+//IMK #include "TestMessCreateFolder.h"
+//IMK #include "TestMessRenameFolder.h"
+//IMK #include "TestMessMoveMessages.h"
+//IMK #include "TestMessSearchMessage.h"
+//IMK #include "TestMessDeleteMessages.h"
+//IMK #include "TestMessScheduleSendSMS.h"
+//IMK #include "TestMessCancelScheduledSMS.h"
+//IMK #include "TestMessVerifyScheduleSMS.h"
+//IMK #include "TestMessBackupStore.h"
+//IMK #include "TestMessRestoreStore.h"
+//IMK #include "TestMessReceiveHeadersEmailPop.h"
+//IMK #if (defined _PLATTEST_CDMA_)
+//IMK #include "TestMessCreateCancelSms.h"
+//IMK #endif
+
+
+// EPOC includes
+#include <e32base.h>
+#include <es_sock.h>
+#include <smsuaddr.h>
+#include <TestExecuteServerUtils.h>
+
+/**
+ * @name Constant Literals used.
+ */
+/*@{*/
+/*@}*/
+
+
+LOCAL_C void MainL()
+/**
+ * Secure variant
+ * Much simpler, uses the new Rendezvous() call to sync with the client
+ */
+	{
+#if (defined __DATA_CAGING__)
+	RProcess().DataCaging(RProcess::EDataCagingOn);
+	RProcess().SecureApi(RProcess::ESecureApiOn);
+#endif
+	CActiveScheduler*	sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sched);
+	CTestMessServer*	server = NULL;
+	// Create the CTestServer derived server
+	TRAPD(err,server = CTestMessServer::NewL());
+	if ( err==KErrNone )
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	delete server;
+	delete sched;
+	}
+
+GLDEF_C TInt E32Main()
+/**
+ * @return - Standard Epoc error code on process exit
+ * Secure variant only
+ * Process entry point. Called by client using RProcess API
+ */
+	{
+	__UHEAP_MARK;
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+#if (defined TRAP_IGNORE)
+	TRAP_IGNORE(MainL());
+#else
+	TRAPD(err,MainL());
+#endif
+	delete cleanup;
+	__UHEAP_MARKEND;
+	return KErrNone;
+    }
+
+
+CTestMessServer* CTestMessServer::NewL()
+	{
+	CTestMessServer*	server=new(ELeave) CTestMessServer();
+	CleanupStack::PushL(server);
+	RProcess	handle = RProcess();
+	TParsePtrC	serverName(handle.FileName());
+	server->ConstructL(serverName.Name());
+	CleanupStack::Pop();
+	return server;
+	}
+
+CTestMessServer::CTestMessServer()
+:	CTestServer()
+,	iSharedData(NULL)
+	{
+	}
+
+void CTestMessServer::ConstructL(const TDesC& aName)
+	{
+	CTestServer::ConstructL(aName);
+	iSharedData=CTestMessSharedData::NewL();
+	}
+
+CTestMessServer::~CTestMessServer()
+	{
+	delete iSharedData;
+	iSharedData=NULL;
+	}
+
+CSession2* CTestMessServer::NewSessionL(const TVersion& /*aVersion*/,const RMessage2& /*aMessage*/) const
+/**
+ * @param RMessage - RMessage for the session open
+ * Secure version
+ */
+	{
+	CTestSession*	session = new (ELeave) CTestMessSession(iSharedData);
+	CONST_CAST(CTestMessServer*,this)->IncSessionCount();
+	return session;
+	}
+
+// constructor for ESOCK test suite
+// this creates all the ESOCK test steps and
+// stores them inside CTestSuiteEsock
+CTestStep* CTestMessServer::CreateTestStep(const TDesC& aStepName)
+	{
+	CTestMessBase*	testStep = NULL;
+
+	if(aStepName == _L("CleanMessageFolder"))
+		{
+		testStep = new CTestMessCleanMessageFolder();
+		}
+	else if(aStepName == _L("CreateSms"))
+		{
+		testStep = new CTestMessCreateSMS();
+		}
+	else if(aStepName == _L("CreateSmsAccount"))
+		{
+		testStep = new CTestMessCreateSmsAccount();
+		}
+	else if(aStepName == _L("SetSmsSc"))
+		{
+		testStep = new CTestMessSetDefaultSc();
+		}
+	return testStep;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Src/TestMessSession.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,50 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "TestMessSession.h"
+
+CTestMessSession::CTestMessSession(CTestMessSharedData* aSharedData)
+:	CTestSession()
+,	iSharedData(aSharedData)
+	{
+	}
+
+
+void CTestMessSession::ServiceL(const RMessage2& aMessage)
+	{
+	CTestSession::ServiceL(aMessage);
+	switch(aMessage.Function())
+		{
+		case EOpenTestStep :
+			{
+			}
+			break;
+		case ERunTestStep :
+			{
+			iSharedData->DoProcessL();
+			}
+			break;
+		case EAbortTestStep :
+			{
+			}
+			break;
+		case ECloseTestStep :
+			{
+			}
+			break;
+		default:
+			break;
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Src/TestMessSetDefaultSC.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,122 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains TestMessSetDefaultSc which sets an SMS
+// SC as default SC.
+// 
+//
+
+#include "TestMessSetDefaultSC.h"
+
+// EPOC includes
+#include <msvids.h>
+#include <miutset.h>
+#include <smutset.h>
+#include <etelmm.h>
+#include <msvstore.h>
+#include <csmsaccount.h>
+
+_LIT(KSCName,		"scname");
+
+CTestMessSetDefaultSc::CTestMessSetDefaultSc()
+:	CTestMessBase(EFalse)
+	{
+	SetTestStepName(_L("SetSmsSc"));
+	}
+
+TVerdict CTestMessSetDefaultSc::doTestStepL()
+	{
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("Set Default Service Center"));
+
+	CSmsSettings*		smsSettings = CSmsSettings::NewL();
+	CleanupStack::PushL(smsSettings);
+	SetEntryL(KMsvRootIndexEntryId);
+
+	EntryL().SetSortTypeL(SelectionOrdering());
+	CMsvEntrySelection*	selection=EntryL().ChildrenWithTypeL(KUidMsvServiceEntry);
+	CleanupStack::PushL(selection);
+	TInt				count=selection->Count();
+	TBool				found=EFalse;
+	for (TInt i=count; i>0 && !found; )
+		{
+		SetEntryL(selection->At(--i));
+
+		//	Log child
+		if	(	EntryL().Entry().iMtm == KUidMsgTypeSMS &&
+				EntryL().Entry().iType == KUidMsvServiceEntry
+			)
+			{
+			found=ETrue;
+			}
+		}
+
+	if ( !found )
+		{
+		ERR_PRINTF1(_L("No SMS Account found"));
+		SetTestStepResult(EFail);
+		}
+
+	TName	network;
+//IMK	TBool	returnValue=(GetPhoneSmsNetworkL(network)==KErrNone);
+TBool	returnValue=false; //IMK
+	TPtrC	ptrSCName(network);
+
+	if ( !returnValue )
+		{
+		returnValue=GetStringFromConfig(ConfigSection(), KSCName, ptrSCName);
+		}
+	if ( !returnValue )
+		{
+		ERR_PRINTF1(_L("No SC specified in script/ini file"));
+		SetTestStepResult(EFail);
+		}
+
+	INFO_PRINTF2(_L("SC Name = %S"), &ptrSCName);
+
+	if ( TestStepResult()==EPass )
+		{
+		CSmsAccount*	smsAccount = CSmsAccount::NewLC();
+		smsAccount->LoadSettingsL(*smsSettings);
+		const TInt	numSCAddr = smsSettings->ServiceCenterCount();
+
+		if( !numSCAddr )
+			{
+			ERR_PRINTF1(_L("No SC found"));
+			SetTestStepResult(EFail);
+			}
+
+		TBool	scFound	= EFalse;
+		for( TInt index=0; (index<numSCAddr) && (!scFound);index++ )
+			{
+			CSmsServiceCenter&	scAddr = smsSettings->GetServiceCenter(index);
+			if( (scAddr.Name()).CompareF(ptrSCName) == 0)
+				{
+				smsSettings->SetDefaultServiceCenter(index);
+				smsAccount->SaveSettingsL(*smsSettings);
+				scFound = ETrue;
+				}
+			}
+
+		if ( !scFound )
+			{
+			ERR_PRINTF2(_L("%S NOT Found"), &ptrSCName);
+			SetTestStepResult(EFail);
+			}
+
+		CleanupStack::PopAndDestroy(smsAccount);
+		}
+	CleanupStack::PopAndDestroy(2, smsSettings);
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Src/TestMessSharedData.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,276 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessSharedData
+// 
+//
+
+#include "TestMessSharedData.h"
+
+#include <mtclbase.h>
+#include <msvids.h>
+#include <e32std.h>
+#include <imapcmds.h>
+
+_LIT(KName,			"name");
+
+CTestMessSharedData* CTestMessSharedData::NewL()
+/**
+ * @return - Instance of the test server
+ * Same code for Secure and non-secure variants
+ * Called inside the MainL() function to create and start the
+ * CTestServer derived server.
+ */
+	{
+	CTestMessSharedData*	sharedData = new (ELeave) CTestMessSharedData();
+	CleanupStack::PushL(sharedData);
+	sharedData->ConstructL();
+	CleanupStack::Pop(sharedData);
+	return sharedData;
+	}
+
+CTestMessSharedData::CTestMessSharedData()
+:	CBase()
+,	iSession(NULL)
+,	iMtmRegistry(NULL)
+,	iList(NULL)
+,	iAnyPostStepToDo(NULL)
+,	iDeleteTestStep(EFalse)
+	{
+	}
+
+void CTestMessSharedData::ConstructL()
+	{
+	iSession=CMsvSession::OpenSyncL(*this);
+	iMtmRegistry=CClientMtmRegistry::NewL(*iSession);
+	}
+
+CTestMessSharedData::~CTestMessSharedData()
+	{
+	while ( iList != NULL )
+		{
+		CMsgEntry*	entry=iList;
+		iList=iList->iNext;
+		delete entry;
+		}
+	delete iMtmRegistry;
+	iMtmRegistry=NULL;
+	delete iSession;
+	iSession=NULL;
+	}
+
+void CTestMessSharedData::DoProcessL()
+	{
+	if ( iAnyPostStepToDo != NULL )
+		{
+		if (iDeleteTestStep)
+			{
+			iAnyPostStepToDo->DoCancelProcessL();
+			iDeleteTestStep=EFalse;
+			}
+		else
+			{
+			iAnyPostStepToDo->DoProcessL(*iMtmRegistry);
+			}
+		iAnyPostStepToDo=NULL;
+		}
+	}
+
+void CTestMessSharedData::IMAP4ConnectAndSyncCompleteAfterDisconnectL(TUid aMtmId, TMsvId aMsvId, CTestStep& aStep)
+	{
+	iList=CMsgIMAP4ConnectAndSyncComplete::NewL(aMtmId, aMsvId, aStep, iList);
+	iAnyPostStepToDo=iList;
+	}
+
+TInt CTestMessSharedData::DeleteEntryL(CTestStep& aStep)
+	{
+	TInt	ret=KErrNone;
+	TPtrC	name;
+
+	if ( !aStep.GetStringFromConfig(aStep.ConfigSection(), KName, name) )
+		{
+		aStep.ERR_PRINTF1(_L("Name not found"));
+		aStep.SetTestStepResult(EFail);
+		ret=KErrArgument;
+		}
+	else
+		{
+		aStep.INFO_PRINTF2(_L("Name : %S"), &name);
+
+		CMsgEntry*	msgParent=NULL;
+		CMsgEntry*	msgEntry=iList;
+		TBool		found=EFalse;
+
+		while ( (msgEntry!=NULL) && !found )
+			{
+			if ( msgEntry->iName.Compare(name) == 0 )
+				{
+				if ( msgParent!=NULL )
+					{
+					msgParent->iNext=msgEntry->iNext;
+					}
+				else
+					{
+					iList=msgEntry->iNext;
+					}
+				iDeleteTestStep=ETrue;
+				iAnyPostStepToDo=msgEntry;
+				found=ETrue;
+				}
+			else
+				{
+				msgParent=msgEntry;
+				msgEntry=msgEntry->iNext;
+				}
+			}
+
+		if ( !found )
+			{
+			aStep.ERR_PRINTF1(_L("Message Entry not found"));
+			aStep.SetTestStepResult(EFail);
+			ret=KErrNotFound;
+			}
+		}
+
+	return ret;
+	}
+
+CTestMessSharedData::CMsgEntry::CMsgEntry(CMsgEntry* aList)
+:	CActive(EPriorityStandard)
+,	iNext(aList)
+,	iReadyToBeDeleted(EFalse)
+	{
+	}
+
+void CTestMessSharedData::CMsgEntry::ConstructL(CTestStep& aStep)
+	{
+	TPtrC	name;
+
+	//	Read in name tag
+	if ( !aStep.GetStringFromConfig(aStep.ConfigSection(), KName, name) )
+		{
+		aStep.ERR_PRINTF1(_L("Name not found"));
+		aStep.SetTestStepResult(EFail);
+		}
+	else
+		{
+		aStep.INFO_PRINTF2(_L("Name : %S"), &name);
+		iName.Copy(name);
+		}
+	}
+
+CTestMessSharedData::CMsgEntry::~CMsgEntry()
+	{
+	}
+
+void CTestMessSharedData::CMsgEntry::DoCancel()
+	{
+	}
+
+void CTestMessSharedData::CMsgEntry::RunL()
+	{
+	iReadyToBeDeleted=ETrue;
+	}
+
+CTestMessSharedData::CMsgIMAP4ConnectAndSyncComplete* CTestMessSharedData::CMsgIMAP4ConnectAndSyncComplete::NewL(TUid aMtmId, TMsvId aMsvId, CTestStep& aStep, CMsgEntry* aList)
+	{
+	CMsgIMAP4ConnectAndSyncComplete*	self= new (ELeave) CMsgIMAP4ConnectAndSyncComplete(aMtmId, aMsvId, aList);
+	CleanupStack::PushL(self);
+	self->ConstructL(aStep);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+CTestMessSharedData::CMsgIMAP4ConnectAndSyncComplete::CMsgIMAP4ConnectAndSyncComplete(TUid aMtmId, TMsvId aMsvId, CMsgEntry* aList)
+:	CMsgEntry(aList)
+,	iMtmId(aMtmId)
+,	iMsvId(aMsvId)
+,	iBaseMtm(NULL)
+,	iOperation(NULL)
+	{
+	}
+
+CTestMessSharedData::CMsgIMAP4ConnectAndSyncComplete::~CMsgIMAP4ConnectAndSyncComplete()
+	{
+	if ( iOperation != NULL )
+		{
+		delete iOperation;
+		iOperation=NULL;
+		}
+	delete iBaseMtm;
+	iBaseMtm=NULL;
+	}
+
+void CTestMessSharedData::CMsgIMAP4ConnectAndSyncComplete::RunL()
+	{
+	CMsgEntry::RunL();
+	delete iOperation;
+	iOperation=NULL;
+	delete iBaseMtm;
+	iBaseMtm=NULL;
+
+	}
+
+void CTestMessSharedData::CMsgIMAP4ConnectAndSyncComplete::DoProcessL(CClientMtmRegistry& aMtmRegistry)
+	{
+	iBaseMtm=aMtmRegistry.NewMtmL(iMtmId);
+	CActiveScheduler::Add(this);
+
+	iBaseMtm->SwitchCurrentEntryL(iMsvId);
+	CMsvEntrySelection*	selection=new (ELeave) CMsvEntrySelection();
+	CleanupStack::PushL(selection);
+	selection->Reset();
+	selection->AppendL(iMsvId);
+	selection->AppendL(iMsvId);	// remote inbox
+
+	TPckg<MMsvImapConnectionObserver*>	parameter(this);
+	iOperation=iBaseMtm->InvokeAsyncFunctionL(KIMAP4MTMConnectAndSyncCompleteAfterDisconnect, *selection, parameter, iStatus);
+	CleanupStack::PopAndDestroy(selection);
+	SetActive();
+	}
+
+void CTestMessSharedData::CMsgIMAP4ConnectAndSyncComplete::DoCancelProcessL()
+	{
+	if ( iOperation != NULL )
+		{
+		iOperation->Cancel();
+		}
+	}
+
+void CTestMessSharedData::CMsgIMAP4ConnectAndSyncComplete::HandleImapConnectionEvent(TImapConnectionEvent aConnectionEvent)
+	{
+	switch (aConnectionEvent)
+		{
+	/** Connecting to server. */
+	case EConnectingToServer:
+		break;
+	/** Synchronising folder list. */
+	case ESynchronisingFolderList:
+		break;
+	/** Synchronising inbox. */
+	case ESynchronisingInbox:
+		break;
+	/** Synchronising folders. */
+	case ESynchronisingFolders:
+		break;
+	/** Synchronisation complete. */
+	case ESynchronisationComplete:
+		break;
+	/** Disconnecting. */
+	case EDisconnecting:
+		break;
+	/** Connection completed. */
+	case EConnectionCompleted:
+		break;
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Src/TestMessStoreProcessUtil.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,258 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessStoreProcessUtil. Base class process what is in the message store
+// 
+//
+
+
+
+/**
+ @file TestMessStoreProcessUtil.cpp
+*/
+
+#include "TestMessStoreProcessUtil.h"
+
+//	EPOC include
+#include <txtrich.h>
+
+/**
+ * @name Constant Literals used.
+ */
+/*@{*/
+/// Literal constants used for the character set
+_LIT(KChineseGB2312,		"ChineseGB2312");
+_LIT(KChineseHz,			"ChineseHz");
+_LIT(KChineseBig5,			"ChineseBig5");
+/*@}*/
+
+CTestMessStoreProcessUtil::CTestMessStoreProcessUtil(CTestMessBase& aTestStep, TBool aReadOnly)
+:	CBase()
+,	iTestStep(aTestStep)
+,	iReadOnly(aReadOnly)
+	{
+	}
+
+/**
+ * Process the message entry
+ * @param  TMsvId aMsvId - Id of message to edit
+ * @return TInt - return TErrNone if all worked
+ *  
+*/
+TInt CTestMessStoreProcessUtil::ProcessEntryL(TMsvId aMsvId)
+	{
+	TInt		ret=KErrNone;
+	CMsvEntry*	msvEntry=iTestStep.Session().GetEntryL(aMsvId);
+	CleanupStack::PushL(msvEntry);
+
+	if ( msvEntry->HasStoreL() )
+		{
+		CMsvStore*	store=NULL;
+		if ( iReadOnly )
+			{
+			store=msvEntry->ReadStoreL();
+			}
+		else
+			{
+			store=msvEntry->EditStoreL();
+			}
+		CleanupStack::PushL(store);
+
+		RArray<TUid>	ids;
+		ids.Append(KUidMsgFileIMailHeader);
+		ids.Append(KUidMsgFileMimeHeader);
+		ids.Append(KUidMsgFileInternetAccessPreferences);
+		ids.Append(KUidMsvSMSHeaderStream);
+		ids.Append(KUidMsvDefaultServices);
+		ids.Append(KMsvEntryRichTextBody);
+		for ( TUint uidIndex=ids.Count(); uidIndex>0; )
+			{
+			TUid	uid=ids[--uidIndex];
+
+			if ( store->IsPresentL(uid) )
+				{
+				if ( uid==KUidMsgFileIMailHeader )
+					{
+					// Process the CImHeader info
+					ProcessImHeaderL(*store);
+					}
+				else if ( uid==KUidMsgFileMimeHeader )
+					{
+					// Process the CImMimeHeader info
+					ProcessImMimeHeaderL(*store);
+					}
+				else if ( uid==KUidMsgFileInternetAccessPreferences )
+					{
+					}
+				else if ( uid==KUidMsvSMSHeaderStream )
+					{
+					// Process the CSmsHeader info
+					ProcessSmsHeaderStreamL(*store);
+					}
+				else if ( uid==KUidMsvDefaultServices )
+					{
+					}
+				else if ( uid==KMsvEntryRichTextBody )
+					{
+					// Process the CRichText info
+					ProcessRichTextBodyL(*store);
+					}
+				else
+					{
+					iTestStep.INFO_PRINTF2(_L("Cannot process %x"), uid.iUid);
+					}
+				}
+			}
+
+		// Commit to the store
+		if ( !iReadOnly )
+			{
+			store->CommitL();
+			}
+		CleanupStack::PopAndDestroy(store);
+		}
+
+	CleanupStack::PopAndDestroy(msvEntry);
+
+	return ret;
+	}
+
+// Process the CImHeader information
+void CTestMessStoreProcessUtil::ProcessImHeaderL(CMsvStore& aStore)
+	{
+	CImHeader*	header=CImHeader::NewLC();
+	TRAPD(err, header->RestoreL(aStore));
+
+	if ( err==KErrNone )
+		{
+		ProcessImHeaderL(*header);
+		if ( !iReadOnly )
+			{
+			header->StoreL(aStore);
+			}
+		}
+
+	CleanupStack::PopAndDestroy(header);
+	}
+
+// Process the CImMimeHeader information
+void CTestMessStoreProcessUtil::ProcessImMimeHeaderL(CMsvStore& aStore)
+	{
+	CImMimeHeader*	header=CImMimeHeader::NewLC();
+	TRAPD(err, header->RestoreL(aStore));
+
+	if ( err==KErrNone )
+		{
+		ProcessImMimeHeaderL(*header);
+		if ( !iReadOnly )
+			{
+			header->StoreL(aStore);
+			}
+		}
+
+	CleanupStack::PopAndDestroy(header);
+	}
+
+
+// Process the CSmsHeader information
+void CTestMessStoreProcessUtil::ProcessSmsHeaderStreamL(CMsvStore& aStore)
+	{
+	CParaFormatLayer*	paraFormatLayer=CParaFormatLayer::NewL();
+	CleanupStack::PushL(paraFormatLayer);
+
+	CCharFormatLayer*	charFormatLayer=CCharFormatLayer::NewL(); 
+	CleanupStack::PushL(charFormatLayer);
+
+	CRichText*			bodyText=CRichText::NewL(paraFormatLayer, charFormatLayer);
+	CleanupStack::PushL(bodyText);
+
+	CSmsHeader*			header = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *bodyText);
+	CleanupStack::PushL(header);
+
+	TRAPD(err, header->RestoreL(aStore));
+	if ( err == KErrNone )
+		{
+		ProcessSmsHeaderStreamL(*header);
+		if ( !iReadOnly )
+			{
+			header->StoreL(aStore);
+			}
+		}
+
+	CleanupStack::PopAndDestroy(4, paraFormatLayer);
+	}
+
+
+// Process the CRichText information
+void CTestMessStoreProcessUtil::ProcessRichTextBodyL(CMsvStore& aStore)
+	{
+	CParaFormatLayer*	paraFormatLayer=CParaFormatLayer::NewL();
+	CleanupStack::PushL(paraFormatLayer);
+
+	CCharFormatLayer*	charFormatLayer=CCharFormatLayer::NewL(); 
+	CleanupStack::PushL(charFormatLayer);
+
+	CRichText*			bodyText=CRichText::NewL(paraFormatLayer, charFormatLayer);
+	CleanupStack::PushL(bodyText);
+
+	TRAPD(err, aStore.RestoreBodyTextL(*bodyText));
+	if ( err == KErrNone )
+		{
+		ProcessRichTextBodyL(*bodyText);
+		if ( !iReadOnly )
+			{
+			aStore.StoreBodyTextL(*bodyText);
+			}
+		}
+
+	CleanupStack::PopAndDestroy(3, paraFormatLayer);
+	}
+
+/**
+ * Saves the new character set to the message 
+ * @param  TPtrC aCharacterSetType - New Character set type to be stored for the received message
+ * @param  TUint &aCharSetVal - character set value
+ * @return TBool 
+ * @panic None
+ * @leave None
+ *
+*/
+TBool CTestMessStoreProcessUtil::ValidCharacterSetInfo(const TPtrC& aCharacterSetType, TUint &aCharSetVal)
+	{
+	TBool	hasSet = ETrue;
+
+	if ( aCharacterSetType.Compare(KChineseGB2312) == 0 )
+		{
+		iTestStep.INFO_PRINTF1(_L("Character set set to Chinese GB2312"));
+		aCharSetVal =  KCharacterSetIdentifierGb2312;
+		}
+	else if (aCharacterSetType.Compare(KChineseHz) == 0)
+		{
+		iTestStep.INFO_PRINTF1(_L("Character set set to Chinese Hz"));
+		aCharSetVal = KCharacterSetIdentifierHz;
+		}
+	else if ( aCharacterSetType.Compare(KChineseBig5) == 0 )
+		{
+		iTestStep.INFO_PRINTF1(_L("Character set set to Chinese Big5"));
+		aCharSetVal = KCharacterSetIdentifierBig5;
+		}
+	else
+		{
+		// To be updated later
+		hasSet= EFalse;
+		iTestStep.ERR_PRINTF2(_L("Character not supported in test code: %S"), &aCharacterSetType);
+		iTestStep.SetTestStepResult(EFail);
+		}
+
+	return hasSet;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Src/TestMessTimer.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,63 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestMessTimer.h
+// This contains CTestMessTimer
+// EPOC includes
+// 
+//
+
+#include "TestMessTimer.h"
+#include "TestMessProcessor.h"
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CTestMessTimer* CTestMessTimer::NewL(TTimeIntervalMicroSeconds32 aInterval, CTestMessProcessor& aProcessor)
+	{
+	CTestMessTimer*	self=new(ELeave) CTestMessTimer(aInterval, aProcessor);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop();
+	return self;
+	}
+
+CTestMessTimer::CTestMessTimer(TTimeIntervalMicroSeconds32 aInterval, CTestMessProcessor& aProcessor)
+: CTimer(EPriorityStandard)
+, iInterval(aInterval)
+, iProcessor(aProcessor)
+	{
+	}
+
+void CTestMessTimer::ConstructL()
+	{
+	CTimer::ConstructL();
+	CActiveScheduler::Add(this);
+	}
+
+
+CTestMessTimer::~CTestMessTimer()
+	{
+	}
+
+void CTestMessTimer::RunL()
+	{
+	iProcessor.DisplayProgress();
+	IssueRequest();
+	};
+
+void CTestMessTimer::IssueRequest()
+	{
+	After(iInterval);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/Src/TestMessWatcher.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,73 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessWatcher which starts the message watchers
+// 
+//
+
+#include "TestMessWatcher.h"
+
+_LIT(KWatcherExe, "z:\\system\\libs\\watcher.exe");
+
+CTestMessWatcher* CTestMessWatcher::NewL(TInt aPriority)
+	{
+	CTestMessWatcher* self = new (ELeave) CTestMessWatcher(aPriority);
+	CleanupStack::PushL(self);
+
+	self->ConstructL();
+
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+CTestMessWatcher::~CTestMessWatcher()
+	{
+	Cancel();
+	iTimer.Close();
+	if (iConstructed)
+		iWatcher.Kill(KErrNone);
+
+	iWatcher.Close();
+	}
+
+CTestMessWatcher::CTestMessWatcher(TInt aPriority)
+:	CActive(aPriority)
+,	iConstructed(EFalse)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+void CTestMessWatcher::ConstructL()
+	{
+	TInt	ret=iWatcher.Create(KWatcherExe, KNullDesC);
+	switch ( ret )
+		{
+	case KErrNone:
+		iWatcher.Resume();
+		iConstructed = ETrue;
+	case KErrAlreadyExists:
+		break;
+	default:
+		User::Leave(ret);
+		}
+	}
+
+void CTestMessWatcher::RunL()
+	{
+	}
+
+void CTestMessWatcher::DoCancel()
+	{
+	iTimer.Cancel();
+	iStatus=KErrCancel;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/TestData/Smoketest_Mess.ini	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,751 @@
+[default]
+smsto=07769588944
+smsbearer=NBS
+smsencoding=7
+smsDeliveryReport=NO
+mmsto=07769588944
+mmsDeliveryReport=NO
+progress=120
+
+[19101_RootFolder]
+depth=0
+
+[27030_SmsO2Account]
+scname=O2
+scnumber=+447802000332
+SmsReplyQuoted=TRUE
+SmsRejectDuplicate=TRUE
+SmsReplyPath=FALSE
+SmsConCatenate=TRUE
+SmsDeliveryReport=FALSE
+
+[27031_SmsOrangeAccount]
+scname=Orange
+scnumber=+447973100973
+SmsReplyQuoted=TRUE
+SmsRejectDuplicate=TRUE
+SmsReplyPath=FALSE
+SmsConCatenate=TRUE
+SmsDeliveryReport=FALSE
+
+[27032_SmsTMobileAccount]
+scname=TMobile
+scnumber=+447958879879
+SmsReplyQuoted=TRUE
+SmsRejectDuplicate=TRUE
+SmsReplyPath=FALSE
+SmsConCatenate=TRUE
+SmsDeliveryReport=FALSE
+
+[27029_SmsVodafoneAccount]
+scname=Vodafone
+scnumber=+447785016005
+SmsReplyQuoted=TRUE
+SmsRejectDuplicate=TRUE
+SmsReplyPath=FALSE
+SmsConCatenate=TRUE
+SmsDeliveryReport=FALSE
+
+[21770_SmsAirtelAccount]
+MessageBearerType=CDMA
+scname=Airtel
+scnumber=919845087001
+SmsRejectDuplicate=TRUE
+SmsReplyPath=TRUE
+SmsConCatenate=TRUE
+SmsDeliveryReport=TRUE
+SmsReplyQuoted=TRUE
+
+[SmsHutchAccount]
+scname=Hutch
+scnumber=919886005444
+SmsReplyQuoted=TRUE
+SmsRejectDuplicate=TRUE
+SmsReplyPath=FALSE
+SmsConCatenate=TRUE
+SmsDeliveryReport=FALSE
+
+[28206_MmsAccount]
+accountname=Multimedia Messaging
+serveraddr=http://10.22.64.20
+fromaddr=07769588944
+automaticfetch=TRUE
+iap=14
+
+[27028_ImapAccount]
+accountname=smoketest Imap Account
+myname=Symbian smoketest
+username=mdgi15
+password=vethihiz
+emailaddress=mdgi15@dial.pipex.com
+outserver=smtp.dial.pipex.com
+inserver=imap.dial.pipex.com
+SyncRate=120
+iap=6
+
+[27027_PopAccount]
+accountname=smoketest Pop Account
+myname=Symbian smoketest
+username=mdgi15
+password=vethihiz
+emailaddress=mdgi15@dial.pipex.com
+outserver=smtp.dial.pipex.com
+inserver=pop.dial.pipex.com
+iap=6
+
+[21558_ImapAccountAuth]
+accountname=smoketest ImapAuth Account
+myname=Symbian smoketest
+username=mailtst1
+password=mailtest1
+auth=TRUE
+authUserName=mailtst1
+authPassword=mailtest1
+emailaddress=mailtst1@trmai01.it.cellulardata.com
+outserver=trmai01.it.cellulardata.com
+inserver=cyrus.cellulardata.com
+iap=7
+
+[27035_PopAccountAuth]
+accountname=smoketest PopAuth Account
+myname=Symbian smoketest
+username=mailtst1
+password=mailtest1
+auth=TRUE
+authUserName=mailtst1
+authPassword=mailtest1
+emailaddress=mailtst1@trmai01.it.cellulardata.com
+outserver=trmai01.it.cellulardata.com
+inserver=cyrus.cellulardata.com
+iap=7
+
+[28381_ImapAccountSSL]
+accountname=smoketest ImapSSL Account
+myname=Symbian smoketest
+username=mailtst1
+password=mailtest1
+auth=TRUE
+sslwrapper=yes
+sslport=993
+authUserName=mailtst1
+authPassword=mailtest1
+emailaddress=mailtst1@trmai01.it.cellulardata.com
+outserver=trmai01.it.cellulardata.com
+inserver=cyrus.cellulardata.com
+iap=7
+
+[28382_PopAccountSSL]
+accountname=smoketest PopSSL Account
+myname=Symbian smoketest
+username=mailtst1
+password=mailtest1
+auth=TRUE
+sslwrapper=yes
+sslport=995
+authUserName=mailtst1
+authPassword=mailtest1
+emailaddress=mailtst1@trmai01.it.cellulardata.com
+outserver=trmai01.it.cellulardata.com
+inserver=cyrus.cellulardata.com
+iap=7
+
+[27027_VodafoneGprsAccount]
+accountname=Vodafone Gprs Account
+myname=Symbian smoketest
+username=mdgi15
+password=vethihiz
+emailaddress=mdgi15@dial.pipex.com
+outserver=smtp.vizzavi.co.uk
+inserver=pop.dial.pipex.com
+iap=13
+
+[o2GprsAccount]
+accountname=O2 Gprs Account
+myname=Symbian smoketest
+username=mdgi15
+password=vethihiz
+emailaddress=mdgi15@dial.pipex.com
+outserver=smtp.o2.co.uk
+inserver=pop.dial.pipex.com
+iap=17
+
+[MmsCount01]
+count=7
+depth=2
+folder1=Local
+folder2=Inbox
+
+[MmsMessage01]
+from=Multimedia Messaging
+subject=mms test1
+priority=high
+
+textmimetype1=text/plain
+textfile1=c:\smoketest\Mms\Message1.txt
+textmimeheaders1=1
+textmimeheader1name1=content-type
+textmimeheader1type1=text/plain
+
+[MmsMessage02]
+from=Multimedia Messaging
+subject=mms test2
+priority=high
+   
+textmimetype1=text/plain
+textfile1=c:\smoketest\Mms\Message2.txt
+textmimeheaders1=1
+textmimeheader1name1=content-type
+textmimeheader1type1=text/plain
+
+imgmimetype1=image/gif
+imgfile1=c:\smoketest\Mms\Image2.gif
+imgmimeheaders1=1
+imgmimeheader1name1=content-type
+imgmimeheader1type1=image/gif
+
+[MmsMessage03]
+from=Multimedia Messaging
+subject=mms test3
+priority=high
+
+textmimetype1=text/plain
+textfile1=c:\smoketest\Mms\Message3.txt
+textmimeheaders1=1
+textmimeheader1name1=content-type
+textmimeheader1type1=text/plain
+
+imgmimetype1=image/gif
+imgfile1=c:\smoketest\Mms\Image3.gif
+imgmimeheaders1=1
+imgmimeheader1name1=content-type
+imgmimeheader1type1=image/gif
+
+audiomimetype1=audio/basic
+audiofile1=c:\smoketest\Mms\Audio3.wav
+audiomimeheaders1=1
+audiomimeheader1name1=content-type
+audiomimeheader1type1=audio/basic
+
+[MmsMessage04]
+from=Multimedia Messaging
+subject=mms test4
+priority=high
+slides=2
+
+textmimetype1=text/plain
+textfile1=c:\smoketest\Mms\Message4.txt
+textmimeheaders1=1
+textmimeheader1name1=content-type
+textmimeheader1type1=text/plain
+
+imgmimetype2=image/gif
+imgfile2=c:\smoketest\Mms\Image4.gif
+imgmimeheaders2=1
+imgmimeheader2name1=content-type
+imgmimeheader2type1=image/gif
+
+[MmsMessage05]
+from=Multimedia Messaging
+subject=mms test5
+priority=high
+slides=2
+
+textmimetype1=text/plain
+textfile1=c:\smoketest\Mms\Message5.txt
+textmimeheaders1=1
+textmimeheader1name1=content-type
+textmimeheader1type1=text/plain
+
+imgmimetype2=image/gif
+imgfile2=c:\smoketest\Mms\Image5.gif
+imgmimeheaders2=1
+imgmimeheader2name1=content-type
+imgmimeheader2type1=image/gif
+
+audiomimetype2=audio/basic
+audiofile2=c:\smoketest\Mms\Audio5.wav
+audiomimeheaders2=1
+audiomimeheader2name1=content-type
+audiomimeheader2type1=audio/basic
+
+[MmsMessage06]
+from=Multimedia Messaging
+subject=mms test6
+priority=high
+slides=3
+
+textmimetype1=text/plain
+textfile1=c:\smoketest\Mms\Message6.txt
+textmimeheaders1=1
+textmimeheader1name1=content-type
+textmimeheader1type1=text/plain
+
+audiomimetype2=audio/basic
+audiofile2=c:\smoketest\Mms\Audio6.wav
+audiomimeheaders2=1
+audiomimeheader2name1=content-type
+audiomimeheader2type1=audio/basic
+
+imgmimetype3=image/gif
+imgfile3=c:\smoketest\Mms\Image6.gif
+imgmimeheaders3=1
+imgmimeheader3name1=content-type
+imgmimeheader3type1=image/gif
+
+[27584_SmsMessage01]
+recipients=2
+body=c:\smoketest\Sms\Message1.txt
+
+[27596_SmsMessage02]
+body=c:\smoketest\Sms\Message2.txt
+
+[27587_SmsMessage03]
+body=c:\smoketest\Sms\Message3.txt
+encoding=8
+
+[27589_SmsMessage04]
+body=c:\smoketest\Sms\Message4.txt
+DeliveryReport=NO
+
+[27591_SmsMessage05]
+body=c:\smoketest\Sms\Message5.txt
+
+[27593_SmsMessage06]
+body=c:\smoketest\Sms\Message6.txt
+encoding=8
+scheduled=120
+
+[27577_SmsSend01]
+text=This message is going
+
+[20388_SmsSend02]
+text=Hello, this is a plain
+
+[20389_SmsSend03]
+text=Hello, this is a 8-bit
+
+[20390_SmsSend04]
+text=No status report requested
+
+[20392_SmsSend05]
+text=A big message to ya!
+
+[20391_SmsSend06]
+text=This is a big 8-bit
+
+[27595_SmsCount01]
+count=7
+depth=2
+folder1=Local
+folder2=Inbox
+
+[27033_PopMessage01]
+from=smoketest Pop Account
+to=mdgi15@dial.pipex.com
+subject=PopMessage01
+body=c:\smoketest\EMail\PopTestMsg01.txt
+priority=high
+count=1
+depth=2
+folder1=smoketest Pop Account
+folder2=PopMessage01
+
+[27044_PopMessage02]
+from=smoketest Pop Account
+to=mdgi15@dial.pipex.com
+subject=PopMessage02
+body=c:\smoketest\EMail\PopTestMsg02.txt
+priority=low
+attachments=1
+attachment1=c:\smoketest\EMail\Attachment01.txt
+count=2
+depth=3
+folder1=smoketest Pop Account
+folder2=PopMessage02
+
+[27040_PopMessage03]
+from=smoketest Pop Account
+to=mdgi15@dial.pipex.com
+subject=PopMessage03
+body=c:\smoketest\EMail\PopTestMsg03.txt
+priority=low
+attachments=3
+attachment1=c:\smoketest\EMail\Attachment02.txt
+attachment2=c:\smoketest\EMail\Attachment02.txt
+attachment3=c:\smoketest\EMail\Attachment02.txt
+count=4
+depth=3
+folder1=smoketest Pop Account
+folder2=PopMessage03
+
+[19103_PopMessage04]
+from=smoketest Pop Account
+to=mdgi15@dial.pipex.com
+subject=PopMessage04
+body=c:\smoketest\EMail\PopTestMsg04.txt
+priority=low
+attachments=2
+attachment1=c:\smoketest\EMail\Attachment01.txt
+attachment2=c:\smoketest\EMail\Typhoon.zip
+count=3
+depth=3
+folder1=smoketest Pop Account
+folder2=PopMessage04
+
+[27041_PopBox01]
+from=smoketest Pop Account
+
+[28111_PopSend01]
+subject=PopMessage01
+
+[28112_PopSend02]
+subject=PopMessage02
+
+[28114_PopSend03]
+subject=PopMessage03
+
+[28113_PopSend04]
+subject=PopMessage04
+
+[19102_PopCount01]
+count=4
+depth=1
+folder1=smoketest Pop Account
+
+[19102_PopCount01_MadcowSanity]
+count=3
+depth=1
+folder1=smoketest Pop Account
+
+[28360_ImapMessage01]
+from=smoketest Imap Account
+to=mdgi15@dial.pipex.com
+subject=ImapMessage01
+body=c:\smoketest\EMail\PopTestMsg01.txt
+priority=high
+count=0
+depth=3
+folder1=smoketest Imap Account
+folder2=Inbox
+folder3=ImapMessage01
+
+[28361_ImapMessage02]
+from=smoketest Imap Account
+to=mdgi15@dial.pipex.com
+subject=ImapMessage02
+body=c:\smoketest\EMail\PopTestMsg02.txt
+priority=low
+attachments=1
+attachment1=c:\smoketest\EMail\Attachment01.txt
+count=0
+depth=3
+folder1=smoketest Imap Account
+folder2=Inbox
+folder3=ImapMessage02
+
+[28362_ImapMessage03]
+from=smoketest Imap Account
+to=mdgi15@dial.pipex.com
+subject=ImapMessage03
+body=c:\smoketest\EMail\PopTestMsg03.txt
+priority=low
+attachments=3
+attachment1=c:\smoketest\EMail\Attachment02.txt
+attachment2=c:\smoketest\EMail\Attachment02.txt
+attachment3=c:\smoketest\EMail\Attachment02.txt
+count=0
+depth=3
+folder1=smoketest Imap Account
+folder2=Inbox
+folder3=ImapMessage03
+
+[28363_ImapMessage04]
+from=smoketest Imap Account
+to=mdgi15@dial.pipex.com
+subject=ImapMessage04
+body=c:\smoketest\EMail\PopTestMsg04.txt
+priority=low
+attachments=2
+attachment1=c:\smoketest\EMail\Attachment01.txt
+attachment2=c:\smoketest\EMail\Typhoon.zip
+count=0
+depth=3
+folder1=smoketest Imap Account
+folder2=Inbox
+folder3=ImapMessage04
+
+[19104_ImapBox01]
+name=imapsync
+from=smoketest Imap Account
+depth=1
+folder1=Inbox
+
+[28118_ImapSend01]
+subject=ImapMessage01
+
+[28117_ImapSend02]
+subject=ImapMessage02
+
+[28115_ImapSend03]
+subject=ImapMessage03
+
+[28116_ImapSend04]
+subject=ImapMessage04
+
+[28359_ImapCount01]
+count=4
+depth=2
+folder1=smoketest Imap Account
+folder2=Inbox
+
+[28359_ImapCount01MadcowSanity]
+count=3
+depth=2
+folder1=smoketest Imap Account
+folder2=Inbox
+
+[27048_PopMessage06]
+from=smoketest PopAuth Account
+to=mailtst1@trmai01.it.cellulardata.com
+subject=PopMessage06
+body=c:\smoketest\EMail\PopTestMsg06.txt
+priority=high
+count=1
+depth=2
+folder1=smoketest PopAuth Account
+folder2=PopMessage06
+
+[28364_PopMessage07]
+from=smoketest PopAuth Account
+to=mailtst1@trmai01.it.cellulardata.com
+subject=PopMessage07
+body=c:\smoketest\EMail\PopTestMsg07.txt
+priority=low
+attachments=1
+attachment1=c:\smoketest\EMail\Attachment01.txt
+count=2
+depth=3
+folder1=smoketest PopAuth Account
+folder2=PopMessage07
+
+[28365_PopMessage08]
+from=smoketest PopAuth Account
+to=mailtst1@trmai01.it.cellulardata.com
+subject=PopMessage08
+body=c:\smoketest\EMail\PopTestMsg08.txt
+priority=low
+attachments=3
+attachment1=c:\smoketest\EMail\Attachment02.txt
+attachment2=c:\smoketest\EMail\Attachment02.txt
+attachment3=c:\smoketest\EMail\Attachment02.txt
+count=4
+depth=3
+folder1=smoketest PopAuth Account
+folder2=PopMessage08
+
+[28366_PopMessage09]
+from=smoketest PopAuth Account
+to=mailtst1@trmai01.it.cellulardata.com
+subject=PopMessage09
+body=c:\smoketest\EMail\PopTestMsg09.txt
+priority=low
+attachments=2
+attachment1=c:\smoketest\EMail\Attachment01.txt
+attachment2=c:\smoketest\EMail\Typhoon.zip
+count=3
+depth=3
+folder1=smoketest PopAuth Account
+folder2=PopMessage09
+
+[28394_PopMessage10]
+from=smoketest PopAuth Account
+to=mailtst1@trmai01.it.cellulardata.com
+subject=PopMessage10
+body=c:\smoketest\EMail\PopTestMsg06.txt
+priority=high
+count=1
+depth=2
+folder1=smoketest PopAuth Account
+folder2=PopMessage10
+
+[28395_PopMessage11]
+from=smoketest PopAuth Account
+to=mailtst1@trmai01.it.cellulardata.com
+subject=PopMessage11
+body=c:\smoketest\EMail\PopTestMsg08.txt
+priority=low
+attachments=3
+attachment1=c:\smoketest\EMail\Attachment02.txt
+attachment2=c:\smoketest\EMail\Attachment02.txt
+attachment3=c:\smoketest\EMail\Attachment02.txt
+count=4
+depth=3
+folder1=smoketest PopAuth Account
+folder2=PopMessage11
+
+[27043_PopBox02]
+from=smoketest PopAuth Account
+
+[21560_PopSend06]
+subject=PopMessage06
+
+[27042_PopSend07]
+subject=PopMessage07
+
+[27039_PopSend08]
+subject=PopMessage08
+
+[28367_PopSend09]
+subject=PopMessage09
+
+[28396_PopSend10]
+subject=PopMessage10
+
+[28397_PopSend11]
+subject=PopMessage11
+
+[28368_PopCount02]
+count=4
+depth=1
+folder1=smoketest PopAuth Account
+
+[28373_ImapMessage06]
+from=smoketest ImapAuth Account
+to=mailtst1@trmai01.it.cellulardata.com
+subject=ImapMessage06
+body=c:\smoketest\EMail\PopTestMsg06.txt
+priority=high
+count=0
+depth=3
+folder1=smoketest ImapAuth Account
+folder2=Inbox
+folder3=ImapMessage06
+
+[28374_ImapMessage07]
+from=smoketest ImapAuth Account
+to=mailtst1@trmai01.it.cellulardata.com
+subject=ImapMessage07
+body=c:\smoketest\EMail\PopTestMsg07.txt
+priority=low
+attachments=1
+attachment1=c:\smoketest\EMail\Attachment01.txt
+count=0
+depth=3
+folder1=smoketest ImapAuth Account
+folder2=Inbox
+folder3=ImapMessage07
+
+[28375_ImapMessage08]
+from=smoketest ImapAuth Account
+to=mailtst1@trmai01.it.cellulardata.com
+subject=ImapMessage08
+body=c:\smoketest\EMail\PopTestMsg08.txt
+priority=low
+attachments=3
+attachment1=c:\smoketest\EMail\Attachment02.txt
+attachment2=c:\smoketest\EMail\Attachment02.txt
+attachment3=c:\smoketest\EMail\Attachment02.txt
+count=0
+depth=3
+folder1=smoketest ImapAuth Account
+folder2=Inbox
+folder3=ImapMessage08
+
+[28376_ImapMessage09]
+from=smoketest ImapAuth Account
+to=mailtst1@trmai01.it.cellulardata.com
+subject=ImapMessage09
+body=c:\smoketest\EMail\PopTestMsg09.txt
+priority=low
+attachments=2
+attachment1=c:\smoketest\EMail\Attachment01.txt
+attachment2=c:\smoketest\EMail\Typhoon.zip
+count=0
+depth=3
+folder1=smoketest ImapAuth Account
+folder2=Inbox
+folder3=ImapMessage09
+
+[28387_ImapMessage10]
+from=smoketest ImapAuth Account
+to=mailtst1@trmai01.it.cellulardata.com
+subject=ImapMessage10
+body=c:\smoketest\EMail\PopTestMsg06.txt
+priority=high
+count=0
+depth=3
+folder1=smoketest ImapAuth Account
+folder2=Inbox
+folder3=ImapMessage10
+
+[28388_ImapMessage11]
+from=smoketest ImapAuth Account
+to=mailtst1@trmai01.it.cellulardata.com
+subject=ImapMessage11
+body=c:\smoketest\EMail\PopTestMsg08.txt
+priority=low
+attachments=3
+attachment1=c:\smoketest\EMail\Attachment02.txt
+attachment2=c:\smoketest\EMail\Attachment02.txt
+attachment3=c:\smoketest\EMail\Attachment02.txt
+count=0
+depth=3
+folder1=smoketest ImapAuth Account
+folder2=Inbox
+folder3=ImapMessage11
+
+[27037_ImapBox02]
+from=smoketest ImapAuth Account
+depth=1
+folder1=Inbox
+
+[27036_ImapSend06]
+subject=ImapMessage06
+
+[28377_ImapSend07]
+subject=ImapMessage07
+
+[28378_ImapSend08]
+subject=ImapMessage08
+
+[28379_ImapSend09]
+subject=ImapMessage09
+
+[28389_ImapSend10]
+subject=ImapMessage10
+
+[28390_ImapSend11]
+subject=ImapMessage11
+
+[28380_ImapCount02]
+count=4
+depth=2
+folder1=smoketest ImapAuth Account
+folder2=Inbox
+
+[28398_PopBox03]
+from=smoketest PopSSL Account
+
+[28399_PopCount03]
+count=2
+depth=1
+folder1=smoketest PopSSL Account
+
+[28391_ImapBox03]
+from=smoketest ImapSSL Account
+depth=1
+folder1=Inbox
+
+[28392_ImapCount03]
+count=2
+depth=2
+folder1=smoketest ImapSSL Account
+folder2=Inbox
+
+[28383_HangUpPipex]
+iap=6
+
+[28384_HangUpNokia]
+iap=7
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/TestData/Sms/Message1.txt	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1 @@
+This message is going to my two buddies
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messaging/bwins/SMOKETEST_MESS_SERVERU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?NewServer@@YAHXZ @ 1 NONAME ; int __cdecl NewServer(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/notepad/Bmarm/TestNpdApiU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/notepad/Bwins/TestNpdApiU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/notepad/EABI/TestNpdApiU.def	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/notepad/conf/smoketest_notepad.cfg	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,20 @@
+[Test]
+title Send key events to close UI setup dialogs
+run testscripter c:\smoketest\ui_TestNpdApi.cfg 1
+[Endtest]
+
+[Test]
+title Fetch Template & Cancel (-ve)
+run testscripter c:\smoketest\ui_TestNpdApi.cfg 4
+run testscripter c:\smoketest\ui_TestNpdApi.cfg 2
+[Endtest]
+
+[Test]
+title Verify No of tmplts
+run testscripter c:\smoketest\ui_TestNpdApi.cfg 5
+[Endtest]
+
+[Test]
+title Test Adding Content as Note
+run testscripter c:\smoketest\ui_TestNpdApi.cfg 12
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/notepad/conf/ui_TestNpdApi.cfg	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,274 @@
+//#1
+[Test]
+title Send key events to close UI setup dialogs
+pause 2000
+presskey global EKeyDevice0
+pause 1000
+presskey global EKeyDevice0
+pause 1000
+presskey global EKeyDevice0
+pause 1000
+presskey global EKeyDevice0
+[Endtest]
+
+//#2
+[Test]
+title Press RSK
+pause 1000
+presskey global EKeyDevice1
+[Endtest]
+
+//#3
+[Test]
+title FetchTemplate
+bringtoforeground
+create TestNpdApi NpdObj
+NpdObj TestFetchTemplate
+delete NpdObj
+sendtobackground
+[Endtest] 
+
+//#4
+[Test]
+title FetchTemplateAndExpectError
+bringtoforeground
+create TestNpdApi NpdObj
+allownextresult -2
+NpdObj TestFetchTemplate
+delete NpdObj
+sendtobackground
+[Endtest] 
+
+//#5
+[Test]
+title NoOfTemaplates
+create TestNpdApi NpdObj
+NpdObj TestNoOfTemplates
+delete NpdObj
+[Endtest] 
+
+//#6
+[Test]
+title TestFetchMemoAndExpectError
+bringtoforeground
+create TestNpdApi NpdObj
+allownextresult -2
+NpdObj TestFetchMemo
+delete NpdObj
+sendtobackground
+[Endtest] 
+
+//#7
+[Test]
+title TestFetchMemo
+bringtoforeground
+create TestNpdApi NpdObj
+NpdObj TestFetchMemo
+delete NpdObj
+sendtobackground
+[Endtest] 
+
+//#8
+[Test]
+title SaveFileAsMemoUsingFileName
+create TestNpdApi NpdObj
+NpdObj SaveFileAsMemoUsingFileName 0
+delete NpdObj
+[Endtest] 
+
+//#9
+[Test]
+title SaveFileAsMemoUsingFileNameWithEncoding
+create TestNpdApi NpdObj
+NpdObj SaveFileAsMemoUsingFileName 1
+delete NpdObj
+[Endtest] 
+
+//#10
+[Test]
+title SaveFileAsMemoUsingHandle
+create TestNpdApi NpdObj
+NpdObj SaveFileAsMemoUsingHandle 0
+delete NpdObj
+[Endtest] 
+
+//#11
+[Test]
+title SaveFileAsMemoUsingHandleWithEncoding
+create TestNpdApi NpdObj
+NpdObj SaveFileAsMemoUsingHandle 1
+delete NpdObj
+[Endtest] 
+
+//#12
+[Test]
+title TestAddContent
+create TestNpdApi NpdObj
+NpdObj TestAddContent
+delete NpdObj
+[Endtest] 
+
+//#13
+[Test]
+title TestingModel
+create TestNpdApi NpdObj
+NpdObj Model
+delete NpdObj
+[Endtest] 
+
+//#14
+[Test]
+title TestDialog
+create TestNpdApi NpdObj
+NpdObj TestDialog
+delete NpdObj
+[Endtest] 
+
+//#15
+[Test]
+title TestExistsMemoL
+create TestNpdApi NpdObj
+NpdObj TestExistsMemoL
+delete NpdObj
+[Endtest] 
+
+//#16
+[Test]
+title TestNumberOfTemplates
+create TestNpdApi NpdObj
+NpdObj TestNumberOfTemplates
+delete NpdObj
+[Endtest] 
+
+//#17
+[Test]
+title TestCreateModelL
+create TestNpdApi NpdObj
+NpdObj TestCreateModelL
+delete NpdObj
+[Endtest] 
+
+//#18
+[Test]
+title TestNewL
+create TestNpdApi NpdObj
+NpdObj TestNewL
+delete NpdObj
+[Endtest] 
+
+//#19
+[Test]
+title TestProbeMemoL
+create TestNpdApi NpdObj
+NpdObj TestProbeMemoL
+delete NpdObj
+[Endtest] 
+//#20
+[Test]
+title TestNewLC
+create TestNpdApi NpdObj
+NpdObj TestNewLC
+delete NpdObj
+[Endtest] 
+
+//#21
+[Test]
+title TestCNotepadApiDestruction
+create TestNpdApi NpdObj
+NpdObj TestCNotepadApiDestruction
+delete NpdObj
+[Endtest] 
+
+//#22
+[Test]
+title TestCreateListDialogL
+create TestNpdApi NpdObj
+NpdObj TestCreateListDialogL
+delete NpdObj
+[Endtest] 
+
+
+//#23
+[Test]
+title TestCreateViewerDialogL
+create TestNpdApi NpdObj
+NpdObj TestCreateViewerDialogL
+delete NpdObj
+[Endtest] 
+
+//#24
+[Test]
+title TestExecTemplatesL
+create TestNpdApi NpdObj
+bringtoforeground
+NpdObj TestExecTemplatesL
+delete NpdObj
+[Endtest] 
+
+//#25
+[Test]
+title PressKey
+pause 4000
+presskey global EKeyDevice1
+[Endtest]
+
+
+
+//#26
+[Test]
+title TestExecFileViewerUsingFilename
+create TestNpdApi NpdObj
+bringtoforeground
+NpdObj TestExecFileViewerUsingFilename
+delete NpdObj
+[Endtest] 
+
+
+//#27
+[Test]
+title TestExecFileViewerUsingHandle
+create TestNpdApi NpdObj
+bringtoforeground
+NpdObj TestExecFileViewerUsingHandle
+delete NpdObj
+[Endtest] 
+
+
+//#28
+[Test]
+title TestCreateViewer
+create TestNpdApi NpdObj
+bringtoforeground
+NpdObj TestCreateViewer
+delete NpdObj
+[Endtest] 
+
+
+//#29
+[Test]
+title TestExecTextViewerL
+create TestNpdApi NpdObj
+bringtoforeground
+NpdObj TestExecTextViewerL
+delete NpdObj
+[Endtest] 
+
+
+//#30
+[Test]
+title TestExecTextEditorL
+create TestNpdApi NpdObj
+bringtoforeground
+NpdObj TestExecTextEditorL
+delete NpdObj
+[Endtest] 
+
+
+//#31
+[Test]
+title TestExecReadOnlyTextViewerL
+create TestNpdApi NpdObj
+bringtoforeground
+NpdObj TestExecReadOnlyTextViewerL
+delete NpdObj
+[Endtest] 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/notepad/group/Bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building 
+*                notepad_library_api
+*
+*/
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+PRJ_TESTEXPORTS
+../conf/smoketest_notepad.cfg	c:/smoketest/smoketest_notepad.cfg
+../conf/ui_TestNpdApi.cfg		c:/smoketest/ui_TestNpdApi.cfg
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+// Example: 
+/*
+/agnmodel/inc/AGMCOMON.H
+*/
+
+PRJ_TESTMMPFILES
+// NOTE: If using ARS requirements .mmp file operation should be done under this.
+// 'abld test build'
+TestNpdApi.mmp
+
+PRJ_MMPFILES
+// Specify the .mmp files required for building the important component
+// releasables.
+//
+// Specify "tidy" if the component you need to build doesn't need to be
+// released. Specify "ignore" if the MMP file exists but should be
+// ignored.
+// Example:
+/*
+/agnmodel/group/agnmodel.mmp
+#if defined(MARM)
+/agnmodel/group/agsvexe.mmp
+#endif
+*/
+
+//  End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/notepad/group/TestNpdApi.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification file of Notepad Library Api.
+*
+*/
+
+#if defined(__S60_)
+        // To get the OS_LAYER_SYSTEMINCLUDE-definition
+        #include <platform_paths.hrh>
+#endif
+
+TARGET          TestNpdApi.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         TestNpdApi.def
+
+SOURCEPATH      ../src
+SOURCE          TestNpdApi.cpp
+SOURCE          TestNpdApiBlocks.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+USERINCLUDE     ../inc 
+
+
+#if defined(__S60_)
+    APP_LAYER_SYSTEMINCLUDE
+    OS_LAYER_SYSTEMINCLUDE
+#else
+    APP_LAYER_SYSTEMINCLUDE
+    SYSTEMINCLUDE   /epoc32/include 
+
+#endif
+
+LIBRARY         NpdLib.LIB
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY		  		efsrv.lib 
+LIBRARY         flogger.lib
+LIBRARY         commonengine.lib
+
+LANG            SC
+
+/*
+START WINS      
+?wins_specific_information
+END
+
+START MARM
+?marm_specific_information
+END
+*/
+// Other possible keywords:
+ 
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+/*
+START BITMAP ?target
+TARGETPATH   ?emulated_path_on_target_machine
+HEADER
+SOURCE       ?color_depth ?source_bitmap
+END
+*/
+// DEFFILE ?filename
+// AIF ?filename
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/notepad/inc/TestNpdApi.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,208 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Testing functions present in "notepad_library_api"
+*
+*/
+
+
+
+#ifndef TESTNPDAPI_H
+#define TESTNPDAPI_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <NpdApi.h>
+#include <NpdLib.rsg>
+#include <flogger.h>
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KTestNpdApiLogPath, "\\logs\\testframework\\TestNpdApi\\" ); 
+// Log file
+_LIT( KTestNpdApiLogFile, "TestNpdApi.txt" ); 
+_LIT( KTestNpdApiLogFileWithTitle, "TestNpdApi_[%S].txt" );
+
+_LIT( KExampleFilePath, "c:\\testing\\data\\TestNpdApi.txt" );
+_LIT( KCcpFilePath, "c:\\data\\TestNpdApi.txt");
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CTestNpdApi;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+
+// CLASS DECLARATION
+
+/**
+*  CTestNpdApi test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CTestNpdApi) : public CScriptBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CTestNpdApi* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CTestNpdApi();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CScriptBase Runs a script line.
+        * @since ?Series60_version
+        * @param aItem Script line containing method name and parameters
+        * @return Symbian OS error code
+        */
+        virtual TInt RunMethodL( CStifItemParser& aItem );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CTestNpdApi( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+        * Test methods are listed below, explanation is given in cpp file. 
+        */
+        virtual TInt FetchTemplate( CStifItemParser& aItem );
+        virtual TInt FetchMemo( CStifItemParser& aItem );
+        virtual TInt NoOfTemplates( CStifItemParser& aItem );
+        virtual TInt SaveFileAsMemoUsingFileName( CStifItemParser& aItem );
+        virtual TInt SaveFileAsMemoUsingHandle( CStifItemParser& aItem );
+        virtual TInt AddContent( CStifItemParser& aItem );
+        virtual TInt Model( CStifItemParser& aItem );
+        virtual TInt Dialog( CStifItemParser& aItem );
+        virtual TInt ExistsMemoL( CStifItemParser& aItem );
+        virtual TInt NumberOfTemplates( CStifItemParser& aItem );
+        virtual TInt CreateModelL( CStifItemParser& aItem );
+        virtual TInt NewL( CStifItemParser& aItem );
+        virtual TInt ProbeMemoL( CStifItemParser& aItem );
+        virtual TInt CTestNpdApi::NewLC( CStifItemParser& aItem );
+        virtual TInt CTestNpdApi::CNotepadApiDestruction(CStifItemParser& aItem);
+        virtual TInt CTestNpdApi::CreateListDialogL(CStifItemParser& aItem);
+        virtual TInt CTestNpdApi::CreateViewerDialogL(CStifItemParser& aItem);
+        virtual TInt CTestNpdApi::ExecTemplatesL( CStifItemParser& aItem );        
+
+        virtual TInt CTestNpdApi::CreateViewer(CStifItemParser& aItem);
+        virtual TInt CTestNpdApi::ExecFileViewerUsingFilename( CStifItemParser& aItem );
+        virtual TInt CTestNpdApi::ExecFileViewerUsingHandle( CStifItemParser& aItem );
+        virtual TInt CTestNpdApi::ExecTextViewerL(CStifItemParser& aItem );       
+        virtual TInt CTestNpdApi::ExecTextEditorL (CStifItemParser& aItem );
+        virtual TInt CTestNpdApi::ExecReadOnlyTextViewerL(CStifItemParser& aItem );
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+        //ADD NEW METHOD DEC HERE
+        //[TestMethods] - Do not remove
+
+    public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+        CNotepadApi *iptrToNpd;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // TESTNPDAPI_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/notepad/init/TestFramework.ini	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,205 @@
+#
+# This is STIF initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#   + XML, Test report will be xml type, for example 'TestReport.xml'.
+#          Note, that xml format is available only when output is set to FILE.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module.
+# 	- Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation
+#		DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02
+#
+
+[Engine_Defaults]
+
+TestReportMode= FullReport    # Possible values are: 'Empty', 'Summary', 'Environment',
+                                                     'TestCases' or 'FullReport'
+
+CreateTestReport= YES         # Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT         # Possible values: TXT, HTML or XML
+TestReportOutput= FILE        # Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+DisableMeasurement= stifmeasurementdisablenone  # Possible values are:
+              # 'stifmeasurementdisablenone', 'stifmeasurementdisableall'
+              # 'stifmeasurementplugin01', 'stifmeasurementplugin02',
+              # 'stifmeasurementplugin03', 'stifmeasurementplugin04',
+              # 'stifmeasurementplugin05' or 'stifbappeaprofiler'
+
+Timeout= 0                    # Default timeout value for each test case. In milliseconds
+UITestingSupport= YES        # Possible values: YES or NO
+SeparateProcesses= YES       # Possible values: YES or NO (default: NO)
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= testcombiner
+TestCaseFile= c:\smoketest\smoketest_notepad.cfg
+#ModuleName= testscripter
+#TestCaseFile= c:\smoketest\ui_TestNpdApi.cfg
+[End_Module]
+
+
+#[New_Module]
+#[End_Module]
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIF logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+#	- Will write log file in unicode format.
+#		+ YES, Log file will be written in unicode format
+#		+ NO, Log will be written as normal, not unicode, file.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#'
+#NOTE: TestEngine and TestServer logging settings cannot change here
+
+#CreateLogDirectories= YES    # Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML         # Possible values: TXT or HTML
+#EmulatorOutput= FILE         # Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML         # Possible values: TXT or HTML
+#HardwareOutput= FILE         # Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE  # Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES       # Possible values: YES or NO
+#WithTimeStamp= YES           # Possible values: YES or NO
+#WithLineBreak= YES           # Possible values: YES or NO
+#WithEventRanking= YES        # Possible values: YES or NO
+
+#FileUnicode= YES             # Possible values: YES or NO
+#AddTestCaseTitle= YES        # Possible values: YES or NO
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/notepad/src/TestNpdApi.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,208 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  the entry for Notepad Api stif
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <Stiftestinterface.h>
+#include "TestNpdApi.h"
+#include <SettingServerClient.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestNpdApi::CTestNpdApi
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CTestNpdApi::CTestNpdApi( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CTestNpdApi::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CTestNpdApi::ConstructL()
+    {
+    //Read logger settings to check whether test case name is to be
+    //appended to log file name.
+    RSettingServer settingServer;
+    TInt ret = settingServer.Connect();
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        }
+    // Struct to StifLogger settigs.
+    TLoggerSettings loggerSettings; 
+    // Parse StifLogger defaults from STIF initialization file.
+    ret = settingServer.GetLoggerSettings(loggerSettings);
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        } 
+    // Close Setting server session
+    settingServer.Close();
+
+    TFileName logFileName;
+    
+    if(loggerSettings.iAddTestCaseTitle)
+        {
+        TName title;
+        TestModuleIf().GetTestCaseTitleL(title);
+        logFileName.Format(KTestNpdApiLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KTestNpdApiLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KTestNpdApiLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+    
+    //iptrToNpd = CNotepadApi::NewL();	
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestNpdApi::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CTestNpdApi* CTestNpdApi::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CTestNpdApi* self = new (ELeave) CTestNpdApi( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CTestNpdApi::~CTestNpdApi()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+    if (iptrToNpd)
+    {
+	    delete iptrToNpd;
+			iptrToNpd = NULL;
+		}
+
+    }
+
+//-----------------------------------------------------------------------------
+// CTestNpdApi::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CTestNpdApi::SendTestClassVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("TestNpdApi.dll");
+
+	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName);
+	}
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CTestNpdApi::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/notepad/src/TestNpdApiBlocks.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,541 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Test function for notepad api
+*
+*/
+
+
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <e32cmn.h>
+#include <f32file.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+#include "TestNpdApi.h"
+#include <CommonContentPolicy.h>
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestNpdApi::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CTestNpdApi::Delete() 
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CTestNpdApi::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CTestNpdApi::RunMethodL( 
+    CStifItemParser& aItem ) 
+    {
+
+    static TStifFunctionInfo const KFunctions[] =
+        {  
+        // Copy this line for every implemented function.
+        // First string is the function name used in TestScripter script file.
+        // Second is the actual implementation member function. 
+        ENTRY( "TestFetchTemplate", CTestNpdApi::FetchTemplate ),
+        ENTRY( "TestFetchMemo", CTestNpdApi::FetchMemo ),
+        ENTRY( "TestNoOfTemplates", CTestNpdApi::NoOfTemplates ),
+        ENTRY( "SaveFileAsMemoUsingFileName", CTestNpdApi::SaveFileAsMemoUsingFileName ),
+        ENTRY( "SaveFileAsMemoUsingHandle", CTestNpdApi::SaveFileAsMemoUsingHandle ),
+        ENTRY( "TestAddContent", CTestNpdApi::AddContent ),
+        ENTRY( "Model", CTestNpdApi::Model ),                
+        ENTRY( "TestDialog", CTestNpdApi::Dialog ), 
+        ENTRY( "TestExistsMemoL", CTestNpdApi::ExistsMemoL ), 
+        ENTRY( "TestNumberOfTemplates", CTestNpdApi::NumberOfTemplates ), 
+        ENTRY( "TestCreateModelL", CTestNpdApi::CreateModelL ), 
+        ENTRY( "TestExecTemplatesL", CTestNpdApi::ExecTemplatesL ), 
+        ENTRY( "TestNewL", CTestNpdApi::NewL ), 
+        ENTRY( "TestProbeMemoL", CTestNpdApi::ProbeMemoL ), 
+        ENTRY( "TestNewLC", CTestNpdApi::NewLC ),
+        ENTRY( "TestCNotepadApiDestruction", CTestNpdApi::CNotepadApiDestruction ),
+        ENTRY( "TestCreateListDialogL", CTestNpdApi::CreateListDialogL ),
+        ENTRY( "TestCreateViewerDialogL", CTestNpdApi::CreateViewerDialogL ), 
+        ENTRY( "TestExecTemplatesL", CTestNpdApi::ExecTemplatesL ), 
+        ENTRY( "TestExecFileViewerUsingFilename", CTestNpdApi::ExecFileViewerUsingFilename ),
+        ENTRY( "TestExecFileViewerUsingHandle", CTestNpdApi::ExecFileViewerUsingHandle ),
+        ENTRY( "TestCreateViewer", CTestNpdApi::CreateViewer ),
+        ENTRY( "TestExecTextViewerL", CTestNpdApi::ExecTextViewerL ),
+        ENTRY( "TestExecTextEditorL", CTestNpdApi::ExecTextEditorL ),
+        ENTRY( "TestExecReadOnlyTextViewerL", CTestNpdApi::ExecReadOnlyTextViewerL )
+        //ADD NEW ENTRY HERE
+        // [test cases entries] - Do not remove
+
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+//Funcs Defns
+// -----------------------------------------------------------------------------
+// CTestNpdApi::FetchTemplate
+// -----------------------------------------------------------------------------
+TInt CTestNpdApi::FetchTemplate( CStifItemParser& aItem )
+    {
+			HBufC* retData = CNotepadApi::FetchTemplateL();
+			if( retData )
+				{
+					delete retData;
+					return KErrNone;
+				}
+				return KErrGeneral;
+		}
+
+// -----------------------------------------------------------------------------
+// CTestNpdApi::FetchMemo
+// -----------------------------------------------------------------------------
+TInt CTestNpdApi::FetchMemo( CStifItemParser& aItem )
+    {
+			HBufC* retData = CNotepadApi::FetchMemoL();
+			if( retData )
+				{
+					delete retData;
+					return KErrNone;
+				}
+				return KErrGeneral;
+		}
+
+// -----------------------------------------------------------------------------
+// CTestNpdApi::NoOfTemplates
+// -----------------------------------------------------------------------------
+TInt CTestNpdApi::NoOfTemplates( CStifItemParser& aItem )
+    {
+			TInt noOfTmplts = CNotepadApi::NumberOfTemplates();
+			//By default there will be a 10 templates, so verifying for more than 0
+			if ( noOfTmplts >= 0 )
+				{
+					return KErrNone;
+				}
+			return KErrGeneral;
+		}
+
+// -----------------------------------------------------------------------------
+// CTestNpdApi::SaveFileAsMemoUsingFileName
+// -----------------------------------------------------------------------------
+TInt CTestNpdApi::SaveFileAsMemoUsingFileName( CStifItemParser& aItem )
+    {
+    	TInt err = 0;
+    	TInt encoding;
+    	aItem.GetNextInt(encoding);
+			
+			//Verifying parameter for correct value
+			if ( (encoding != 0) && (encoding != 1) )
+				{
+				iLog->Log( _L("Wrong parameter, please give either 0 or 1(encoding)") );	
+				return KErrGeneral;
+				}
+			
+    	TFileName fileName;
+			fileName.Append(KExampleFilePath);
+			//If 0, no encoding
+			if(encoding == 0)
+				{
+					TRAP(err, CNotepadApi::SaveFileAsMemoL(fileName));
+				}
+			else
+				{
+					TRAP(err, CNotepadApi::SaveFileAsMemoL(fileName, KCharacterSetIdentifierIso88591));			
+				}
+
+			if(err == KErrNone)
+				{ 
+					return KErrNone;
+				}
+				return err;
+		}
+
+// -----------------------------------------------------------------------------
+// CTestNpdApi::SaveFileAsMemoUsingHandle
+// -----------------------------------------------------------------------------
+TInt CTestNpdApi::SaveFileAsMemoUsingHandle( CStifItemParser& aItem )
+    {
+    	TInt err = 0;
+    	TInt encoding;
+    	aItem.GetNextInt(encoding);
+    	
+			//Verifying parameter for correct value
+			if ( (encoding != 0) && (encoding != 1) )
+				{
+				iLog->Log( _L("Wrong parameter, please give either 0 or 1(encoding)") );	
+				return KErrGeneral;
+				}
+    	
+    	TFileName fileName;
+			fileName.Append( KExampleFilePath );
+			
+			RFile data;
+	    RFs session;
+	    User::LeaveIfError( session.Connect() );
+	    CleanupClosePushL( session );
+	    User::LeaveIfError( data.Open( session, fileName, EFileRead ) );
+	    CleanupClosePushL( data );
+			
+			//If 0, no encoding
+			if(encoding == 0)
+				{
+					TRAP(err, CNotepadApi::SaveFileAsMemoL(data));			
+				}
+			else
+				{
+					TRAP(err, CNotepadApi::SaveFileAsMemoL(data, KCharacterSetIdentifierIso88591));			
+				}
+
+			CleanupStack::PopAndDestroy( &data );  //data, 
+    	CleanupStack::PopAndDestroy( &session );  //session
+    	
+			if(err == KErrNone)
+				{ 
+					return KErrNone;
+				}
+				return err;
+		}
+
+// -----------------------------------------------------------------------------
+// CTestNpdApi::AddContent
+// -----------------------------------------------------------------------------
+TInt CTestNpdApi::AddContent( CStifItemParser& aItem )
+    {
+    	_LIT( KNote, "Saving this text as Notes/Memo");
+			TRAPD(err, CNotepadApi::AddContentL( KNote ));		
+			//Just verifying the error code
+			if(err == KErrNone)
+				{ 
+					return KErrNone;
+				}
+				return err;
+		}
+
+// -----------------------------------------------------------------------------
+// CTestNpdApi::Model
+// -----------------------------------------------------------------------------
+TInt CTestNpdApi::Model( CStifItemParser& aItem )
+    {
+    	
+    	CNotepadApi* ptrToNpd = CNotepadApi::NewL();	
+    	//Not testing the ProbeMemoL() function, but just using to test Model() function.
+    	TInt key = 327;
+    	ptrToNpd->ProbeMemoL(key);
+		  CNotepadModel* retData = ptrToNpd->Model();
+			//deleting the pointer as it is not used anymore.
+			delete ptrToNpd;
+			//Verifying the pointer, is exist means model() is created properly
+			if( retData )
+				{					
+					return KErrNone;
+				}
+				return KErrGeneral;
+		}
+
+// -----------------------------------------------------------------------------
+// CTestNpdApi::Dialog
+// -----------------------------------------------------------------------------
+TInt CTestNpdApi::Dialog( CStifItemParser& aItem )
+    {
+    CNotepadApi* ptrToNpd = CNotepadApi::NewL();	
+    CEikDialog* Dialog = ptrToNpd->Dialog();
+
+    delete ptrToNpd;
+    if ( !Dialog )
+        {					
+        return KErrNone;
+        }
+    return KErrGeneral;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestNpdApi::ExistsMemoL
+// -----------------------------------------------------------------------------
+TInt CTestNpdApi::ExistsMemoL( CStifItemParser& aItem )
+    {
+    CNotepadApi* ptrToNpd = CNotepadApi::NewL();	
+    
+    TInt key = 327;
+    TBool IsFound = ptrToNpd->ExistsMemoL( key );
+    
+    //deleting the pointer as it is not used anymore.
+    delete ptrToNpd;
+    
+    if ( IsFound >= 0 )
+        {					
+        return KErrNone;
+        }    
+    return KErrGeneral;
+    }
+    
+// -----------------------------------------------------------------------------
+// CTestNpdApi::NumberOfTemplates
+// -----------------------------------------------------------------------------
+TInt CTestNpdApi::NumberOfTemplates(CStifItemParser& aItem)
+	{
+	CNotepadApi* ptrToNpd = CNotepadApi::NewL();
+	TInt Num = ptrToNpd->NumberOfTemplates();
+	delete ptrToNpd; 
+	if( Num > 0 )
+		{
+		return KErrNone;
+		}
+	return KErrGeneral;
+	}
+	
+// -----------------------------------------------------------------------------
+// CTestNpdApi::CreateModelL
+// -----------------------------------------------------------------------------
+TInt CTestNpdApi::CreateModelL( CStifItemParser& aItem )
+	{
+	CNotepadApi* ptrToNpd = CNotepadApi::NewL();
+	TInt modelResId = R_NOTEPAD_FETCH_MEMO_MODEL;
+	TRAPD( err, ptrToNpd->CreateModelL(modelResId));
+	return err ;
+	}
+	
+// -----------------------------------------------------------------------------
+// CTestNpdApi::NewL
+// -----------------------------------------------------------------------------
+TInt CTestNpdApi::NewL( CStifItemParser& aItem )
+	{
+	CNotepadApi* ptrToNpd = CNotepadApi::NewL();
+	if ( ptrToNpd )
+		{
+		return KErrNone;
+		}
+	return KErrGeneral;
+	}
+	
+// -----------------------------------------------------------------------------
+// CTestNpdApi::ProbeMemoL
+// -----------------------------------------------------------------------------
+TInt CTestNpdApi::ProbeMemoL( CStifItemParser& aItem )
+	{
+    CNotepadApi* ptrToNpd = CNotepadApi::NewL();
+    TInt key = 327;
+    TInt err = 0;
+    TRAP( err, ptrToNpd->ProbeMemoL( key ) );
+    delete ptrToNpd;
+    
+	if(err == KErrNone)
+		{ 
+		return KErrNone;
+		}
+	return err;
+	}
+TInt CTestNpdApi::NewLC( CStifItemParser& aItem )
+	{
+	CNotepadApi* ptrToNpd = CNotepadApi::NewLC();
+	CleanupStack::Pop();
+	if( ptrToNpd )
+		{
+		delete ptrToNpd ;
+		return KErrNone ;
+		}
+	delete ptrToNpd ;
+	return KErrGeneral;		
+	}
+
+TInt CTestNpdApi::CNotepadApiDestruction(CStifItemParser& aItem)
+	{
+	CNotepadApi* ptrToNpd = CNotepadApi::NewL();
+	TRAPD( err, delete ptrToNpd );
+	return err;	
+	}
+
+TInt CTestNpdApi::CreateListDialogL(CStifItemParser& aItem)
+	{
+	CNotepadApi* ptrToNpd = CNotepadApi::NewL();
+	TRAPD( err, ptrToNpd->CreateListDialogL(R_NOTEPAD_TEMPLATE_LIST_DIALOG););
+	delete ptrToNpd;
+	return err;	
+	}
+TInt CTestNpdApi::CreateViewerDialogL(CStifItemParser& aItem)
+	{
+	CNotepadApi* ptrToNpd = CNotepadApi::NewL();
+	TBool aDoWait = ETrue;
+	TRAPD( err, ptrToNpd->CreateViewerDialogL( aDoWait ));
+	delete ptrToNpd;
+	return err ;
+	}
+TInt CTestNpdApi::ExecTemplatesL( CStifItemParser& aItem )
+	{
+	CNotepadApi* ptrToNpd = CNotepadApi::NewL();
+	TInt returnValueOfDialogExecuteLD = ptrToNpd->ExecTemplatesL();
+	delete ptrToNpd;
+	if(returnValueOfDialogExecuteLD >= 0 )
+		{
+		return KErrNone;
+		}
+	return KErrGeneral;
+	}
+TInt CTestNpdApi::CreateViewer(CStifItemParser& aItem)
+	{
+	TFileName fileName;
+	fileName.Append( KCcpFilePath );
+	RFile data;
+    RFs session;
+    User::LeaveIfError( session.Connect() );
+    CleanupClosePushL( session );
+    User::LeaveIfError(session.ShareProtected());
+    User::LeaveIfError( data.Open( session, fileName, EFileRead ) );
+    CleanupClosePushL( data );
+    TDesC* aTitle = NULL;
+    TBool aDoWait = ETrue;
+    TBool aGuessEncoding = EFalse;
+    TUint aEncoding = 0;
+    CNotepadApi* ptrToNpd = CNotepadApi::NewL();
+    TInt err = 0;
+    TRAP( err,  ptrToNpd->CreateViewerDialogL(data, aTitle, aDoWait, aGuessEncoding, aEncoding ));
+	CleanupStack::PopAndDestroy( &data );  
+    CleanupStack::PopAndDestroy( &session );  
+    return err;
+	}
+
+
+TInt CTestNpdApi::ExecFileViewerUsingFilename( CStifItemParser& aItem )
+	{
+	TFileName fileName( KCcpFilePath ); 
+	CNotepadApi* ptrToNpd = CNotepadApi::NewL();
+	TDesC *title = NULL;
+      TBool doWait(ETrue);
+      TBool guessEncoding(EFalse);
+	TUint aEncoding = KCharacterSetIdentifierIso88591;
+	TInt returnValueOfDialogExecuteLD = 0;
+	TInt err = 0;
+	TRAP( err,  ptrToNpd->ExecFileViewerL( fileName, title, doWait, guessEncoding, aEncoding) );
+	delete ptrToNpd;
+
+	return returnValueOfDialogExecuteLD;
+	}
+
+
+TInt CTestNpdApi::ExecFileViewerUsingHandle( CStifItemParser& aItem )
+	{
+	TFileName fileName( KCcpFilePath ); 
+      CNotepadApi* ptrToNpd = CNotepadApi::NewL();
+      RFs fileSession;
+      User::LeaveIfError(fileSession.Connect());
+	CleanupClosePushL(fileSession);
+	User::LeaveIfError(fileSession.ShareProtected());
+	RFile file;
+	User::LeaveIfError(file.Open(fileSession, fileName, EFileRead));
+	CleanupClosePushL(file);
+	TDesC *title = NULL;
+	TBool doWait(ETrue);
+	TBool guessEncoding(EFalse);
+      TUint aEncoding = KCharacterSetIdentifierIso88591;
+      TInt returnValueOfDialogExecuteLD = 0;
+	returnValueOfDialogExecuteLD = ptrToNpd->ExecFileViewerL( file, title, doWait, guessEncoding, aEncoding);
+	delete ptrToNpd;
+	CleanupStack::PopAndDestroy(2); 
+	if( returnValueOfDialogExecuteLD >= 0)
+	    {
+	        return KErrNone;
+	    }
+      return KErrGeneral;
+	}
+
+
+TInt CTestNpdApi::ExecTextViewerL (CStifItemParser& aItem )
+    {
+    TDesC text( KExampleFilePath );
+    CNotepadApi* ptrToNpd = CNotepadApi::NewL();
+    TInt returnStatus = 0;
+    TRAPD( err,ptrToNpd->ExecTextViewerL( returnStatus,text ); );
+    delete ptrToNpd;
+    return err;
+   
+    }
+    
+ 
+TInt CTestNpdApi::ExecTextEditorL(CStifItemParser& aItem )
+    {
+    CNotepadApi* ptrToNpd = CNotepadApi::NewL();
+    TInt returnStatus = 0;
+    TRAPD( err,ptrToNpd->ExecTextEditorL( returnStatus ); );
+    delete ptrToNpd;
+    return err;
+    }
+    
+    
+
+
+TInt CTestNpdApi::ExecReadOnlyTextViewerL(CStifItemParser& aItem )
+	{
+    TDesC text( KExampleFilePath );
+    CNotepadApi* ptrToNpd = CNotepadApi::NewL();
+    TInt returnStatus = 0;
+    TRAPD( err,ptrToNpd->ExecReadOnlyTextViewerL(text ); );
+    delete ptrToNpd;
+    return err;	
+	}
+// -----------------------------------------------------------------------------
+// CTestNpdApi::?member_function
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*
+TInt CTestNpdApi::?member_function(
+   CItemParser& aItem )
+   {
+
+   ?code
+
+   }
+*/
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+//  [End of File] - Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/bmarm/ProfileSmokeTestModuleU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/bwins/ProfileSmokeTestModuleU.DEF	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/conf/ProfileSmokeTestModule.cfg	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,26 @@
+[Test]
+title CheckActiveProfile
+create ProfileSmokeTestModule profile
+profile CheckActiveProfile General 7 0
+delete profile
+[Endtest]
+
+[Test]
+title SetActiveProfileSilent
+create ProfileSmokeTestModule profile
+profile SetActiveProfile Silent
+profile CheckActiveProfile Silent 1 4
+profile SetActiveProfile General
+delete profile
+[Endtest]
+
+[Test]
+title SetActiveProfileOutdoor
+create ProfileSmokeTestModule profile
+profile SetActiveProfile Outdoor
+profile CheckActiveProfile Outdoor 10 0
+profile SetActiveProfile General
+delete profile
+[Endtest]
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/eabi/ProfileSmokeTestModuleU.def	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/group/Bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description:
+*
+*/
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+	
+	DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+../conf/ProfileSmokeTestModule.cfg c:/smoketest/ProfileSmokeTestModule.cfg
+
+PRJ_TESTMMPFILES
+
+	ProfileSmokeTestModule.mmp
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/group/ProfileSmokeTestModule.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,78 @@
+/*TYPE TESTCLASS*/
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: MMP file for STIF Test Framework's TestScripter 
+* testclass test module.
+*
+*/
+
+#include <platform_paths.hrh>
+
+TARGET          ProfileSmokeTestModule.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         ProfileSmokeTestModule.def
+
+USERINCLUDE     ../inc 
+
+MW_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      ../src
+
+SOURCE          ProfileSmokeTestModule.cpp
+SOURCE          ProfileSmokeTestModuleBlocks.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+LIBRARY         euser.lib
+LIBRARY			efsrv.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY         commonengine.lib
+LIBRARY         profileengine.lib
+
+LANG            SC
+
+/*
+START WINS      
+?wins_specific_information
+END
+
+START MARM
+?marm_specific_information
+END
+*/
+// Other possible keywords:
+ 
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+/*
+START BITMAP ?target
+TARGETPATH   ?emulated_path_on_target_machine
+HEADER
+SOURCE       ?color_depth ?source_bitmap
+END
+*/
+// DEFFILE ?filename
+// AIF ?filename
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/inc/ProfileSmokeTestModule.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,186 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: STIF testclass declaration
+*
+*/
+
+#ifndef PROFILESMOKETESTMODULE_H
+#define PROFILESMOKETESTMODULE_H
+
+//  INCLUDES
+#include <f32file.h>
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KProfileSmokeTestModuleLogPath, "\\logs\\testframework\\ProfileSmokeTestModule\\" ); 
+// Log file
+_LIT( KProfileSmokeTestModuleLogFile, "ProfileSmokeTestModule.txt" ); 
+_LIT( KProfileSmokeTestModuleLogFileWithTitle, "ProfileSmokeTestModule_[%S].txt" );
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CProfileSmokeTestModule;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+
+// CLASS DECLARATION
+
+/**
+*  CProfileSmokeTestModule test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CProfileSmokeTestModule) : public CScriptBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CProfileSmokeTestModule* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CProfileSmokeTestModule();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CScriptBase Runs a script line.
+        * @since ?Series60_version
+        * @param aItem Script line containing method name and parameters
+        * @return Symbian OS error code
+        */
+        virtual TInt RunMethodL( CStifItemParser& aItem );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CProfileSmokeTestModule( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+        * Test methods are listed below. 
+        */
+
+        /**
+        * Example test method.
+        * @since ?Series60_version
+        * @param aItem Script line containing parameters.
+        * @return Symbian OS error code.
+        */
+        virtual TInt CheckActiveProfileL( CStifItemParser& aItem);
+        virtual TInt SetActiveProfileL( CStifItemParser& aItem );
+
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+        //ADD NEW METHOD DEC HERE
+        //[TestMethods] - Do not remove
+
+    public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        RFs iFs;
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // PROFILESMOKETESTMODULE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/src/ProfileSmokeTestModule.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,204 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains testclass implementation.
+*
+*/
+
+// INCLUDE FILES
+#include <Stiftestinterface.h>
+#include "ProfileSmokeTestModule.h"
+#include <SettingServerClient.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileSmokeTestModule::CProfileSmokeTestModule
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileSmokeTestModule::CProfileSmokeTestModule( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSmokeTestModule::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileSmokeTestModule::ConstructL()
+    {
+    //Read logger settings to check whether test case name is to be
+    //appended to log file name.
+    RSettingServer settingServer;
+    TInt ret = settingServer.Connect();
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        }
+    // Struct to StifLogger settigs.
+    TLoggerSettings loggerSettings; 
+    // Parse StifLogger defaults from STIF initialization file.
+    ret = settingServer.GetLoggerSettings(loggerSettings);
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        } 
+    // Close Setting server session
+    settingServer.Close();
+
+    TFileName logFileName;
+    
+    if(loggerSettings.iAddTestCaseTitle)
+        {
+        TName title;
+        TestModuleIf().GetTestCaseTitleL(title);
+        logFileName.Format(KProfileSmokeTestModuleLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KProfileSmokeTestModuleLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KProfileSmokeTestModuleLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    User::LeaveIfError(iFs.Connect());
+    
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSmokeTestModule::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileSmokeTestModule* CProfileSmokeTestModule::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CProfileSmokeTestModule* self = new (ELeave) CProfileSmokeTestModule( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CProfileSmokeTestModule::~CProfileSmokeTestModule()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    iFs.Close();
+    
+    // Delete logger
+    delete iLog; 
+
+    }
+
+//-----------------------------------------------------------------------------
+// CProfileSmokeTestModule::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CProfileSmokeTestModule::SendTestClassVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("ProfileSmokeTestModule.dll");
+
+	TBool newVersionOfMethod = ETrue;
+	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+	TestModuleIf().SetBehavior(CTestModuleIf::ETestLeaksHandles);
+	}
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CProfileSmokeTestModule::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/src/ProfileSmokeTestModuleBlocks.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,251 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains testclass implementation.
+*
+*/
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+#include <MProEngEngine.h>
+#include <MProEngProfile.h>
+#include <MProEngProfileName.h>
+#include <MProEngToneSettings.h>
+#include <ProEngFactory.h>
+#include <Profile.hrh>
+#include "ProfileSmokeTestModule.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+_LIT( KProfileSmokeTestModule, "ProfileSmokeTestModule" );
+_LIT( KProfile, "Profile: %S" );
+_LIT( KRingingVolume, "Ringing Volume: %d");
+
+_LIT(KGeneral, 	"General");
+_LIT(KSilent,  	"Silent");
+_LIT(KMeeting, 	"Meeting");
+_LIT(KOutdoor,	"Outdoor");
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileSmokeTestModule::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CProfileSmokeTestModule::Delete() 
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSmokeTestModule::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CProfileSmokeTestModule::RunMethodL( 
+    CStifItemParser& aItem ) 
+    {
+
+    static TStifFunctionInfo const KFunctions[] =
+        {  
+        // Copy this line for every implemented function.
+        // First string is the function name used in TestScripter script file.
+        // Second is the actual implementation member function. 
+        ENTRY( "CheckActiveProfile", CProfileSmokeTestModule::CheckActiveProfileL),
+        ENTRY( "SetActiveProfile", CProfileSmokeTestModule::SetActiveProfileL ),
+        //ADD NEW ENTRY HERE
+        // [test cases entries] - Do not remove
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSmokeTestModule::CheckActiveProfileL
+// Changes the current active profile according to the parameter
+// -----------------------------------------------------------------------------
+//
+TInt CProfileSmokeTestModule::CheckActiveProfileL( CStifItemParser& aItem )
+    {
+    // Print to UI
+    _LIT( KSetProfile, "In CheckActiveProfile" );
+    TestModuleIf().Printf( 0, KProfileSmokeTestModule, KSetProfile );
+    // Print to log file
+    iLog->Log( KSetProfile );
+
+	MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+	MProEngProfile* active = engine->ActiveProfileLC();
+    
+    TPtrC expectedName;
+    if ( aItem.GetNextString( expectedName ) == KErrNone )
+    	{
+    	TL( active->ProfileName().Name() == expectedName)
+    	}
+    
+    TInt expectedRingVol;
+    if ( aItem.GetNextInt( expectedRingVol ) == KErrNone )
+    	{
+    	TL(active->ToneSettings().RingingVolume() == expectedRingVol);
+    	}
+    
+    TInt expectedRingType;
+    if ( aItem.GetNextInt( expectedRingType ) == KErrNone )
+    	{
+    	TL(active->ToneSettings().RingingType() == expectedRingType);
+    	}
+    
+    TPtrC vibrate;
+    if ( aItem.GetNextString(vibrate) == KErrNone )
+    	{
+    	TBool expectedVibrate;
+    	if ( vibrate == _L("true"))
+    		{
+    		expectedVibrate = ETrue;
+    		}
+    	else if ( vibrate == _L("false"))
+    		{
+    		expectedVibrate = EFalse;
+    		}
+    	else
+    		{
+    		User::Leave(KErrArgument);
+    		}
+    	
+    	TL(expectedVibrate == active->ToneSettings().VibratingAlert());
+    	}
+    
+    CleanupStack::PopAndDestroy(2);
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSmokeTestModule::SetProfileL
+// Changes the current active profile according to the parameter
+// -----------------------------------------------------------------------------
+//
+TInt CProfileSmokeTestModule::SetActiveProfileL( CStifItemParser& aItem )
+    {
+    // Print to UI
+    _LIT( KSetProfile, "In SetActiveProfile" );
+    TestModuleIf().Printf( 0, KProfileSmokeTestModule, KSetProfile );
+    // Print to log file
+    iLog->Log( KSetProfile );
+
+    TPtrC profile;
+    if ( aItem.GetNextString( profile ) == KErrNone )
+    	{
+    	MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+
+    	// create the profile engine and set to the correct profile
+    	if ( profile == KSilent)
+    		{
+    		//set to silent
+    		engine->SetActiveProfileL( EProfileSilentId );
+    		}
+    	else if ( profile == KMeeting )
+    		{
+    		// set to meeting
+    		engine->SetActiveProfileL( EProfileMeetingId );
+    		}
+    	else if ( profile == KGeneral )
+    		{
+    		// set to general
+    		engine->SetActiveProfileL( EProfileGeneralId );
+    		}
+    	else if (profile == KOutdoor)
+    		{
+    		// set to outdoors
+    		engine->SetActiveProfileL( EProfileOutdoorId );
+    		}
+
+    	CleanupStack::PopAndDestroy();
+    	}
+    
+    return KErrNone;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileSmokeTestModule::?member_function
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*
+TInt CProfileSmokeTestModule::?member_function(
+   CItemParser& aItem )
+   {
+
+   ?code
+
+   }
+*/
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+//  [End of File] - Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/smoketest_commdb.xml	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,2023 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+ All rights reserved.
+ This component and the accompanying materials are made available
+ under the terms of the License "Symbian Foundation License v1.0"
+ which accompanies this distribution, and is available
+ at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+
+ Initial Contributors:
+ Nokia Corporation - initial contribution.
+
+ Contributors:
+
+ Description:
+ CommDB Settings File
+ All Rights Reserved
+
+-->
+
+
+
+
+
+<CommDB:Config xmlns="SymbianOS.Generic.Comms-Infras.CommDB"
+               xmlns:CommDB="SymbianOS.Generic.Comms-Infras.CommDB"
+               xmlns:xlink="http://www.w3.org/1999/xlink"
+               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+               xsi:schemaLocation="SymbianOS.Generic.Comms-Infras.CommDB CommDB.xsd">
+
+<InformationTable>
+</InformationTable>
+
+<NetworkTable>
+    <Network operation="add">
+        <Name>Intranet</Name>
+    </Network>
+    <Network operation="add">
+        <Name>mRouter</Name>
+    </Network>
+</NetworkTable>
+
+<IAPTable>
+ 	 	<IAP operation="add">
+ 		<Name>Ethernet WinTAP</Name>
+ 		<IAPService>LANService.Ethernet WinTAP</IAPService>
+ 		<IAPBearer>LANBearer.Ethernet WinTAP</IAPBearer>
+ 		<IAPNetwork>Network.Intranet</IAPNetwork>
+ 		<IAPNetworkWeighting>0</IAPNetworkWeighting>
+ 		<LocationRef>Location.Office</LocationRef>
+ 	</IAP>
+    <IAP operation="add">
+        <Name>NT RAS with Null Modem</Name>
+        <IAPService>DialOutISP.NT RAS</IAPService>
+        <IAPBearer>ModemBearer.Null Modem 115200bps</IAPBearer>
+        <IAPNetwork>Network.Intranet</IAPNetwork>
+        <IAPNetworkWeighting>0</IAPNetworkWeighting>
+        <LocationRef>Location.Office</LocationRef>
+    </IAP>
+    <IAP operation="add">
+        <Name>Ethernet with DHCP</Name>
+        <IAPService>LANService.Ethernet Dynamic IP</IAPService>
+        <IAPBearer>LANBearer.EKA1 Emulator Ethernet</IAPBearer>
+        <IAPNetwork>Network.Intranet</IAPNetwork>
+        <IAPNetworkWeighting>0</IAPNetworkWeighting>
+        <LocationRef>Location.Office</LocationRef>
+    </IAP>
+</IAPTable>
+
+<ModemBearerTable>
+    <ModemBearer operation="template">
+        <Name>Default Modem</Name>
+        <Agent>CSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>0</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>Null Modem 115200bps</Name>
+        <Agent>CSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>52</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>TRUE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>US Robotics Sportster</Name>
+        <Agent>CSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>57600</Rate>
+        <Handshaking>244</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>AFTERDIALUNTILANSWER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT&amp;F1</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT&amp;d2</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>Dacom Surfer</Name>
+        <Agent>CSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>57600</Rate>
+        <Handshaking>244</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>AFTERDIALUNTILANSWER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT&amp;F</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT&amp;d2</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>GSM Mobile Phone via Infrared</Name>
+        <Agent>CSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>IRCOMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>IRCOMM</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>196</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>17</XonChar>
+        <XoffChar>19</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>ATZ</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>GSM Mobile Phone via Serial</Name>
+        <Agent>CSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>19200</Rate>
+        <Handshaking>196</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>17</XonChar>
+        <XoffChar>19</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>ATZ</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>GPRS Ericsson R520m via IR</Name>
+        <Agent>PSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>IRCOMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>IRCOMM</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>4</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>17</XonChar>
+        <XoffChar>19</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>ATZ</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>GPRS Ericsson R520m/T68i via Serial</Name>
+        <Agent>PSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>19200</Rate>
+        <Handshaking>4</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>17</XonChar>
+        <XoffChar>19</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>ATZ</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <IspInitString>*99***1#</IspInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>GPRS Motorola Mobile Phone via Serial</Name>
+        <Agent>PSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>57600</Rate>
+        <Handshaking>4</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>17</XonChar>
+        <XoffChar>19</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>ATZ</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>WinTunnel Modem</Name>
+        <Agent>null.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::6</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>52</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>mRouterWinsBearer</Name>
+        <Agent>mRouterAgent.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>WINS::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>WINSCSY</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>52</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>9999</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>180</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>30</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>mRouterRs232Bearer</Name>
+        <Agent>mRouterAgent.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>52</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>9999</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>180</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>30</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>mRouterIrBearer</Name>
+        <Agent>mRouterAgent.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>IRCOMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>IRCOMM</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>52</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>9999</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>180</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>30</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>mRouterBtBearer</Name>
+        <Agent>mRouterAgent.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>BTCOMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>BTCOMM</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>52</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>9999</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>180</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>30</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>mRouterUsbBearer</Name>
+        <Agent>mRouterAgent.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>ACM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECACM</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>52</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>9999</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>180</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>30</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+</ModemBearerTable>
+
+<LANBearerTable>
+	<LANBearer operation="add">
+		<Name>Ethernet WinTAP</Name>
+		<Agent>nullagt.agt</Agent>
+		<IfName>ethint</IfName>
+		<LDDFilename>enet</LDDFilename>
+		<LDDName>=Ethernet</LDDName>
+		<PDDFilename>ethertap</PDDFilename>
+		<PDDName>Ethertap.Wins</PDDName>
+		<PacketDriverName>EtherPkt.drv</PacketDriverName>
+		<LastSocketActivityTimeout>-1</LastSocketActivityTimeout>
+		<LastSessionClosedTimeout>-1</LastSessionClosedTimeout>
+		<LastSocketClosedTimeout>-1</LastSocketClosedTimeout>
+    </LANBearer>
+    <LANBearer operation="add">
+        <Name>EKA1 Target Ethernet</Name>
+        <Agent>nullagt.agt</Agent>
+        <IfName>ethint</IfName>
+        <LDDFilename>ethercard</LDDFilename>
+        <LDDName>EtherCard</LDDName>
+        <PDDFilename>EtherSmc</PDDFilename>
+        <PDDName>EtherCard.Smc</PDDName>
+        <PacketDriverName>EtherPkt.drv</PacketDriverName>
+        <LastSocketActivityTimeout>-1</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>-1</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>-1</LastSocketClosedTimeout>
+    </LANBearer>
+    <LANBearer operation="add">
+        <Name>EKA1 Emulator Ethernet</Name>
+        <Agent>nullagt.agt</Agent>
+        <IfName>ethint</IfName>
+        <LDDFilename>ethercard</LDDFilename>
+        <LDDName>Ethercard</LDDName>
+        <PDDFilename>etherwins</PDDFilename>
+        <PDDName>Ethercard.wins</PDDName>
+        <PacketDriverName>EtherPkt.drv</PacketDriverName>
+        <LastSocketActivityTimeout>-1</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>-1</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>-1</LastSocketClosedTimeout>
+    </LANBearer>
+    <LANBearer operation="add">
+        <Name>EKA1 WINTAP Ethernet</Name>
+        <Agent>nullagt.agt</Agent>
+        <IfName>ethint</IfName>
+        <LDDFilename>ethercard</LDDFilename>
+        <LDDName>Ethercard</LDDName>
+        <PDDFilename>ethertap</PDDFilename>
+        <PDDName>Ethertap.wins</PDDName>
+        <PacketDriverName>EtherPkt.drv</PacketDriverName>
+        <LastSocketActivityTimeout>-1</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>-1</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>-1</LastSocketClosedTimeout>
+    </LANBearer>
+</LANBearerTable>
+
+<LANServiceTable>
+	<LANService operation="add">
+        <Name>Ethernet WinTAP</Name>
+        <IfNetworks>ip</IfNetworks>
+        <IpNetMask>255.255.255.0</IpNetMask>
+        <IpGateway>192.168.0.1</IpGateway>
+        <IpAddrFromServer>FALSE</IpAddrFromServer>
+        <IpAddr>192.168.0.3</IpAddr>
+        <IpDNSAddrFromServer>FALSE</IpDNSAddrFromServer>
+        <IpNameServer1>10.16.59.15</IpNameServer1>
+        <IpNameServer2>10.23.58.12</IpNameServer2>
+        <Ip6DNSAddrFromServer>FALSE</Ip6DNSAddrFromServer>
+    </LANService>
+    <LANService operation="add">
+        <Name>Ethernet Dynamic IP</Name>
+        <IfNetworks>ip</IfNetworks>
+        <IpNetMask>255.255.255.0</IpNetMask>
+        <IpGateway>10.32.194.254</IpGateway>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>10.32.194.251</IpAddr>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>194.72.6.51</IpNameServer1>
+        <IpNameServer2>194.72.6.52</IpNameServer2>
+        <ConfigDaemonManagerName>ConfigDaemonManager</ConfigDaemonManagerName>
+        <ConfigDaemonName>DhcpServ</ConfigDaemonName>
+    </LANService>
+    <LANService operation="add">
+        <Name>Ethernet Static 1</Name>
+        <IfNetworks>ip</IfNetworks>
+        <IpNetMask>255.255.255.0</IpNetMask>
+        <IpGateway>192.168.0.1</IpGateway>
+        <IpAddrFromServer>FALSE</IpAddrFromServer>
+        <IpAddr>192.168.0.2</IpAddr>
+        <IpDNSAddrFromServer>FALSE</IpDNSAddrFromServer>
+        <IpNameServer1>10.16.59.15</IpNameServer1>
+        <IpNameServer2>10.23.58.12</IpNameServer2>
+        <Ip6DNSAddrFromServer>FALSE</Ip6DNSAddrFromServer>
+    </LANService>
+</LANServiceTable>
+
+<DialInISPTable>
+    <DialInISP operation="template">
+        <Name>Default Dial In ISP</Name>
+        <Description>Default Dial In ISP</Description>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <UseEdge>FALSE</UseEdge>
+    </DialInISP>
+    <DialInISP operation="add">
+        <Name>Dial In ISP01</Name>
+        <Description>Dial In ISP01</Description>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <UseEdge>FALSE</UseEdge>
+    </DialInISP>
+</DialInISPTable>
+
+<DialOutISPTable>
+    <DialOutISP operation="template">
+        <Name>Default Dial Out ISP</Name>
+        <Description>Default Dial Out ISP</Description>
+        <DefaultTelNum>Default Dial Out ISP</DefaultTelNum>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <PromptForLogin>TRUE</PromptForLogin>
+        <LoginName>1</LoginName>
+        <LoginPass>1</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfParams>0</IfParams>
+        <IfNetworks>0</IfNetworks>
+        <IfPromptForAuth>TRUE</IfPromptForAuth>
+        <IfAuthName>1</IfAuthName>
+        <IfAuthPass>1</IfAuthPass>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>UNSPECIFIED</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+    <DialOutISP operation="add">
+        <Name>NT RAS</Name>
+        <Description>Test</Description>
+        <Type>INTERNETONLY</Type>
+        <DefaultTelNum>INTERNETONLY</DefaultTelNum>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>TRUE</UseLoginScript>
+        <LoginScript>CHARMAP \[windows-1252\]\nLOOP 10\n{\nSEND &quot;CLIENT&quot;+&lt;0x0d&gt;\nWAIT 3\n{\n&quot;SERVER&quot; OK\n}\n}\nEXIT KErrNoAnswer$\n\nOK:\nEXIT\n</LoginScript>
+        <PromptForLogin>FALSE</PromptForLogin>
+        <LoginName>0</LoginName>
+        <LoginPass>0</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfParams>0</IfParams>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <IfAuthName>RasUser</IfAuthName>
+        <IfAuthPass>pass</IfAuthPass>
+        <AuthRetries>0</AuthRetries>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>UNSPECIFIED</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+    <DialOutISP operation="add">
+        <Name>ISP01</Name>
+        <Description>PlaceHolder for ISP01</Description>
+        <Type>INTERNETONLY</Type>
+        <DefaultTelNum>INTERNETONLY</DefaultTelNum>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <PromptForLogin>FALSE</PromptForLogin>
+        <LoginName>0</LoginName>
+        <LoginPass>0</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfParams>0</IfParams>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>TRUE</IfPromptForAuth>
+        <IfAuthName>xxx</IfAuthName>
+        <IfAuthPass>yyy</IfAuthPass>
+        <AuthRetries>0</AuthRetries>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>UNSPECIFIED</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+    <DialOutISP operation="add">
+        <Name>ISP02</Name>
+        <Description>PlaceHolder for ISP02</Description>
+        <Type>INTERNETONLY</Type>
+        <DefaultTelNum>INTERNETONLY</DefaultTelNum>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <PromptForLogin>FALSE</PromptForLogin>
+        <LoginName>0</LoginName>
+        <LoginPass>0</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfParams>0</IfParams>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>TRUE</IfPromptForAuth>
+        <IfAuthName>xxx</IfAuthName>
+        <IfAuthPass>yyy</IfAuthPass>
+        <AuthRetries>0</AuthRetries>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>UNSPECIFIED</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+    <DialOutISP operation="add">
+        <Name>ISP03</Name>
+        <Description>PlaceHolder for ISP03</Description>
+        <Type>INTERNETONLY</Type>
+        <DefaultTelNum>INTERNETONLY</DefaultTelNum>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <PromptForLogin>FALSE</PromptForLogin>
+        <LoginName>0</LoginName>
+        <LoginPass>0</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfParams>0</IfParams>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>TRUE</IfPromptForAuth>
+        <IfAuthName>xxx</IfAuthName>
+        <IfAuthPass>yyy</IfAuthPass>
+        <AuthRetries>0</AuthRetries>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>UNSPECIFIED</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+    <DialOutISP operation="add">
+        <Name>ISP04</Name>
+        <Description>PlaceHolder for ISP04</Description>
+        <Type>INTERNETONLY</Type>
+        <DefaultTelNum>INTERNETONLY</DefaultTelNum>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <PromptForLogin>FALSE</PromptForLogin>
+        <LoginName>0</LoginName>
+        <LoginPass>0</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfParams>0</IfParams>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>TRUE</IfPromptForAuth>
+        <IfAuthName>xxx</IfAuthName>
+        <IfAuthPass>yyy</IfAuthPass>
+        <AuthRetries>0</AuthRetries>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>UNSPECIFIED</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+    <DialOutISP operation="add">
+        <Name>ISP05</Name>
+        <Description>PlaceHolder for ISP05</Description>
+        <Type>INTERNETONLY</Type>
+        <DefaultTelNum>INTERNETONLY</DefaultTelNum>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <PromptForLogin>FALSE</PromptForLogin>
+        <LoginName>0</LoginName>
+        <LoginPass>0</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfParams>0</IfParams>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>TRUE</IfPromptForAuth>
+        <IfAuthName>xxx</IfAuthName>
+        <IfAuthPass>yyy</IfAuthPass>
+        <AuthRetries>0</AuthRetries>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>UNSPECIFIED</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+    <DialOutISP operation="add">
+        <Name>mRouterDialOutIsp</Name>
+        <Description>mRouterDialOutIsp</Description>
+        <Type>INTERNETONLY</Type>
+        <DefaultTelNum>INTERNETONLY</DefaultTelNum>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <PromptForLogin>FALSE</PromptForLogin>
+        <LoginName>0</LoginName>
+        <LoginPass>0</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfParams>0</IfParams>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <IfAuthName>IfAuthPass=</IfAuthName>
+        <IfAuthPass>AuthRetries=0</IfAuthPass>
+        <AuthRetries>0</AuthRetries>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>UNSPECIFIED</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+</DialOutISPTable>
+
+<AgentLookupTable>
+</AgentLookupTable>
+
+<CDMA2000PacketServiceTable>
+</CDMA2000PacketServiceTable>
+
+<DefaultCDMA2000Table>
+</DefaultCDMA2000Table>
+
+<ChargecardTable>
+    <Chargecard operation="add">
+        <Name>Dummy BT Chargecard</Name>
+        <AccountNumber>144,12345678</AccountNumber>
+        <Pin>0000</Pin>
+        <LocalRule>HG</LocalRule>
+        <NatRule>HFG</NatRule>
+        <IntlRule>HEFG</IntlRule>
+    </Chargecard>
+    <Chargecard operation="add">
+        <Name>Dummy Mercury Chargecard</Name>
+        <AccountNumber>0500800800,,12345678</AccountNumber>
+        <Pin>****</Pin>
+        <LocalRule>HG</LocalRule>
+        <NatRule>J,K,0FG</NatRule>
+        <IntlRule>HEFG</IntlRule>
+    </Chargecard>
+</ChargecardTable>
+
+<ConnectionPreferencesTable>
+    <ConnectionPreferences operation="add">
+        <Name>ConnectionPreferencesTable1</Name>
+        <Ranking>1</Ranking>
+        <Direction>OUTGOING</Direction>
+        <BearerSet>LAN</BearerSet>
+        <DialogPref>DONOTPROMPT</DialogPref>
+        <IAPRef>IAP.Ethernet WinTAP</IAPRef>
+    </ConnectionPreferences>
+</ConnectionPreferencesTable>
+
+<GlobalSettingsTable>
+    <GlobalSettings operation="add">
+        <Name>GlobalSettingsTable1</Name>
+        <WAPAccess>WAPAccessPoint.Default Dial In ISP</WAPAccess>
+        <RedialAttempts>3</RedialAttempts>
+        <SmsBearer>1</SmsBearer>
+        <SmsReceiveMode>2</SmsReceiveMode>
+        <GPRSAttachMode>1</GPRSAttachMode>
+        <AcceptIncomingGprs>1</AcceptIncomingGprs>
+        <GPRSClassCBearer>GSM</GPRSClassCBearer>
+        <ConnectionAttempts>2</ConnectionAttempts>
+        <ModemForDataAndFax>2</ModemForDataAndFax>
+        <ModemForPhoneServicesAndSMS>2</ModemForPhoneServicesAndSMS>
+        <LocationForDataAndFax>Location.Office</LocationForDataAndFax>
+        <LocationForPhoneServicesAndSMS>Location.Office</LocationForPhoneServicesAndSMS>
+        <DefaultNetwork>Network.Intranet</DefaultNetwork>
+        <BearerAvailabilityCheckTSY>mm</BearerAvailabilityCheckTSY>
+    </GlobalSettings>
+</GlobalSettingsTable>
+
+<IncomingGPRSTable>
+    <IncomingGPRS operation="add">
+        <Name>Incoming GPRS Settings PlaceHolder</Name>
+        <APN>Test</APN>
+        <PDPType>IPV4</PDPType>
+        <PDPAddress>0.0.0.0</PDPAddress>
+        <ReqPrecedence>1</ReqPrecedence>
+        <ReqDelay>1</ReqDelay>
+        <ReqReliability>1</ReqReliability>
+        <ReqPeakThroughput>1</ReqPeakThroughput>
+        <ReqMeanThroughput>1</ReqMeanThroughput>
+        <MinPrecedence>1</MinPrecedence>
+        <MinDelay>1</MinDelay>
+        <MinReliability>1</MinReliability>
+        <MinPeakThroughput>1</MinPeakThroughput>
+        <MinMeanThroughput>1</MinMeanThroughput>
+        <DataCompression>FALSE</DataCompression>
+        <HeaderCompression>FALSE</HeaderCompression>
+        <GprsUseEdge>FALSE</GprsUseEdge>
+        <AnonymousAccess>FALSE</AnonymousAccess>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <IfAuthName>RasUser</IfAuthName>
+        <IfAuthPass>pass</IfAuthPass>
+        <AuthRetries>1</AuthRetries>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>0.0.0.0</IpNameServer1>
+        <IpNameServer2>0.0.0.0</IpNameServer2>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+    </IncomingGPRS>
+</IncomingGPRSTable>
+
+<OutgoingGPRSTable>
+    <OutgoingGPRS operation="add">
+        <Name>GPRS01</Name>
+        <APN>gprs01APNPlaceHolder</APN>
+        <PDPType>IPV4</PDPType>
+        <ReqPrecedence>0</ReqPrecedence>
+        <ReqDelay>0</ReqDelay>
+        <ReqReliability>0</ReqReliability>
+        <ReqPeakThroughput>0</ReqPeakThroughput>
+        <ReqMeanThroughput>0</ReqMeanThroughput>
+        <MinPrecedence>0</MinPrecedence>
+        <MinDelay>0</MinDelay>
+        <MinReliability>0</MinReliability>
+        <MinPeakThroughput>0</MinPeakThroughput>
+        <MinMeanThroughput>0</MinMeanThroughput>
+        <DataCompression>FALSE</DataCompression>
+        <HeaderCompression>FALSE</HeaderCompression>
+        <GprsUseEdge>FALSE</GprsUseEdge>
+        <AnonymousAccess>FALSE</AnonymousAccess>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <AuthRetries>1</AuthRetries>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpDNSAddrFromServer>FALSE</IpDNSAddrFromServer>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <GprsAccessPointType>0</GprsAccessPointType>
+        <QosWarningTimeout>0</QosWarningTimeout>
+    </OutgoingGPRS>
+    <OutgoingGPRS operation="add">
+        <Name>GPRS02</Name>
+        <APN>gprs02APNPlaceHolder</APN>
+        <PDPType>IPV4</PDPType>
+        <ReqPrecedence>0</ReqPrecedence>
+        <ReqDelay>0</ReqDelay>
+        <ReqReliability>0</ReqReliability>
+        <ReqPeakThroughput>0</ReqPeakThroughput>
+        <ReqMeanThroughput>0</ReqMeanThroughput>
+        <MinPrecedence>0</MinPrecedence>
+        <MinDelay>0</MinDelay>
+        <MinReliability>0</MinReliability>
+        <MinPeakThroughput>0</MinPeakThroughput>
+        <MinMeanThroughput>0</MinMeanThroughput>
+        <DataCompression>FALSE</DataCompression>
+        <HeaderCompression>FALSE</HeaderCompression>
+        <GprsUseEdge>FALSE</GprsUseEdge>
+        <AnonymousAccess>FALSE</AnonymousAccess>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <AuthRetries>1</AuthRetries>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpDNSAddrFromServer>FALSE</IpDNSAddrFromServer>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <GprsAccessPointType>0</GprsAccessPointType>
+        <QosWarningTimeout>0</QosWarningTimeout>
+    </OutgoingGPRS>
+    <OutgoingGPRS operation="add">
+        <Name>GPRS03</Name>
+        <APN>gprs03APNPlaceHolder</APN>
+        <PDPType>IPV4</PDPType>
+        <ReqPrecedence>0</ReqPrecedence>
+        <ReqDelay>0</ReqDelay>
+        <ReqReliability>0</ReqReliability>
+        <ReqPeakThroughput>0</ReqPeakThroughput>
+        <ReqMeanThroughput>0</ReqMeanThroughput>
+        <MinPrecedence>0</MinPrecedence>
+        <MinDelay>0</MinDelay>
+        <MinReliability>0</MinReliability>
+        <MinPeakThroughput>0</MinPeakThroughput>
+        <MinMeanThroughput>0</MinMeanThroughput>
+        <DataCompression>FALSE</DataCompression>
+        <HeaderCompression>FALSE</HeaderCompression>
+        <GprsUseEdge>FALSE</GprsUseEdge>
+        <AnonymousAccess>FALSE</AnonymousAccess>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <AuthRetries>1</AuthRetries>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpDNSAddrFromServer>FALSE</IpDNSAddrFromServer>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <GprsAccessPointType>0</GprsAccessPointType>
+        <QosWarningTimeout>0</QosWarningTimeout>
+    </OutgoingGPRS>
+</OutgoingGPRSTable>
+
+<DefaultGPRSTable>
+    <DefaultGPRS operation="add">
+        <Name>Dummy Default GPRS Settings</Name>
+        <Usage>1</Usage>
+        <APN>Access point name</APN>
+        <PDPType>IPV6</PDPType>
+        <PDPAddress>www.wid.com</PDPAddress>
+        <Precedence>1</Precedence>
+        <Delay>1</Delay>
+        <Reliability>1</Reliability>
+        <PeakThroughput>1</PeakThroughput>
+        <MeanThroughput>1</MeanThroughput>
+        <MinPrecedence>1</MinPrecedence>
+        <MinDelay>1</MinDelay>
+        <MinReliability>1</MinReliability>
+        <MinPeakThroughput>1</MinPeakThroughput>
+        <MinMeanThroughput>1</MinMeanThroughput>
+        <DataCompression>TRUE</DataCompression>
+        <HeaderCompression>TRUE</HeaderCompression>
+        <GprsUseEdge>FALSE</GprsUseEdge>
+        <AnonymousAccess>TRUE</AnonymousAccess>
+    </DefaultGPRS>
+</DefaultGPRSTable>
+
+<ProxyTable>
+    <Proxy operation="add">
+        <Name>ProxyTable1</Name>
+        <ISPRef>DialOutISP.NT RAS</ISPRef>
+        <UseProxyServer>TRUE</UseProxyServer>
+        <ProxyServerName>www.dummyproxy.com</ProxyServerName>
+        <ProtocolName>http</ProtocolName>
+        <PortNumber>80</PortNumber>
+        <Exceptions>www.dummyproxy.com/exception</Exceptions>
+    </Proxy>
+</ProxyTable>
+
+<LocationTable>
+    <Location operation="template">
+        <Name>Default Location</Name>
+        <IntlPrefixCode>+</IntlPrefixCode>
+        <NatPrefixCode>0</NatPrefixCode>
+        <NatCode>44</NatCode>
+        <AreaCode>44</AreaCode>
+        <DialOutCode>44</DialOutCode>
+        <DisableCallWaitingCode>44</DisableCallWaitingCode>
+        <Mobile>TRUE</Mobile>
+        <UsePulseDial>FALSE</UsePulseDial>
+        <WaitForDialTone>FALSE</WaitForDialTone>
+        <PauseAfterDialout>0</PauseAfterDialout>
+    </Location>
+    <Location operation="add">
+        <Name>Office</Name>
+        <IntlPrefixCode>00</IntlPrefixCode>
+        <NatPrefixCode>0</NatPrefixCode>
+        <NatCode>44</NatCode>
+        <AreaCode>171</AreaCode>
+        <DialOutCode>9,</DialOutCode>
+        <DisableCallWaitingCode>9,</DisableCallWaitingCode>
+        <Mobile>FALSE</Mobile>
+        <UsePulseDial>FALSE</UsePulseDial>
+        <WaitForDialTone>FALSE</WaitForDialTone>
+        <PauseAfterDialout>0</PauseAfterDialout>
+    </Location>
+    <Location operation="add">
+        <Name>Office Direct Dial</Name>
+        <IntlPrefixCode>00</IntlPrefixCode>
+        <NatPrefixCode>0</NatPrefixCode>
+        <NatCode>44</NatCode>
+        <AreaCode>171</AreaCode>
+        <DialOutCode>171</DialOutCode>
+        <DisableCallWaitingCode>171</DisableCallWaitingCode>
+        <Mobile>FALSE</Mobile>
+        <UsePulseDial>FALSE</UsePulseDial>
+        <WaitForDialTone>FALSE</WaitForDialTone>
+        <PauseAfterDialout>0</PauseAfterDialout>
+    </Location>
+    <Location operation="add">
+        <Name>Mobile</Name>
+        <IntlPrefixCode>+</IntlPrefixCode>
+        <NatPrefixCode>0</NatPrefixCode>
+        <NatCode>44</NatCode>
+        <AreaCode>44</AreaCode>
+        <DialOutCode>44</DialOutCode>
+        <DisableCallWaitingCode>44</DisableCallWaitingCode>
+        <Mobile>TRUE</Mobile>
+        <UsePulseDial>FALSE</UsePulseDial>
+        <WaitForDialTone>FALSE</WaitForDialTone>
+        <PauseAfterDialout>0</PauseAfterDialout>
+    </Location>
+    <Location operation="add">
+        <Name>Home</Name>
+        <IntlPrefixCode>00</IntlPrefixCode>
+        <NatPrefixCode>0</NatPrefixCode>
+        <NatCode>44</NatCode>
+        <AreaCode>181</AreaCode>
+        <DialOutCode>181</DialOutCode>
+        <DisableCallWaitingCode>181</DisableCallWaitingCode>
+        <Mobile>FALSE</Mobile>
+        <UsePulseDial>TRUE</UsePulseDial>
+        <WaitForDialTone>TRUE</WaitForDialTone>
+        <PauseAfterDialout>0</PauseAfterDialout>
+    </Location>
+</LocationTable>
+
+<SecureSocketTable>
+    <SecureSocket operation="add">
+        <Name>SecureSocketTable1</Name>
+        <ProtocolName>ssl3.0</ProtocolName>
+        <ProtoLibrary>ssladaptor.dll</ProtoLibrary>
+    </SecureSocket>
+    <SecureSocket operation="add">
+        <Name>SecureSocketTable2</Name>
+        <ProtocolName>tls1.0</ProtocolName>
+        <ProtoLibrary>ssladaptor.dll</ProtoLibrary>
+    </SecureSocket>
+</SecureSocketTable>
+
+<BTDeviceTable>
+</BTDeviceTable>
+
+<BTPersistTable>
+</BTPersistTable>
+
+<BTSecurityTable>
+</BTSecurityTable>
+
+<BTDefaultTable>
+</BTDefaultTable>
+
+<WAPAccessPointTable>
+    <WAPAccessPoint operation="template">
+        <Name>Default Dial In ISP</Name>
+        <CurrentBearer>WAPIPBearer</CurrentBearer>
+    </WAPAccessPoint>
+    <WAPAccessPoint operation="add">
+        <Name>Dummy WAP Settings</Name>
+        <CurrentBearer>WAPIPBearer</CurrentBearer>
+        <StartPage>www.wapstart.com</StartPage>
+    </WAPAccessPoint>
+</WAPAccessPointTable>
+
+<WAPIPBearerTable>
+    <WAPIPBearer operation="template">
+        <Name>WAPIPBearerTable1</Name>
+        <AccessPoint>WAPAccessPoint.-1</AccessPoint>
+        <GatewayAddress>0</GatewayAddress>
+        <IAPRef>IAP.-1</IAPRef>
+        <WSPOption>CONNECTIONLESS</WSPOption>
+        <Security>FALSE</Security>
+        <ProxyPortNumber>0</ProxyPortNumber>
+        <ProxyLogin>0</ProxyLogin>
+        <ProxyPassword>0</ProxyPassword>
+    </WAPIPBearer>
+    <WAPIPBearer operation="add">
+        <Name>WAPIPBearerTable2</Name>
+        <AccessPoint>WAPAccessPoint.Dummy WAP Settings</AccessPoint>
+        <GatewayAddress>www.wapgateway.com</GatewayAddress>
+        <IAPRef>IAP.Ethernet WinTAP</IAPRef>
+        <WSPOption>CONNECTIONORIENTED</WSPOption>
+        <Security>FALSE</Security>
+        <ProxyPortNumber>1</ProxyPortNumber>
+        <ProxyLogin>1</ProxyLogin>
+        <ProxyPassword>1</ProxyPassword>
+    </WAPIPBearer>
+</WAPIPBearerTable>
+
+<WAPSMSBearerTable>
+    <WAPSMSBearer operation="template">
+        <Name>WAPSMSBearerTable1</Name>
+        <AccessPoint>WAPAccessPoint.-1</AccessPoint>
+        <GatewayAddress>0</GatewayAddress>
+        <ServiceCentreAddress>0</ServiceCentreAddress>
+        <WSPOption>CONNECTIONLESS</WSPOption>
+        <Security>FALSE</Security>
+    </WAPSMSBearer>
+    <WAPSMSBearer operation="add">
+        <Name>WAPSMSBearerTable2</Name>
+        <AccessPoint>WAPAccessPoint.Dummy WAP Settings</AccessPoint>
+        <GatewayAddress>+4412345678901</GatewayAddress>
+        <ServiceCentreAddress>+442071234567</ServiceCentreAddress>
+        <WSPOption>CONNECTIONORIENTED</WSPOption>
+        <Security>FALSE</Security>
+    </WAPSMSBearer>
+</WAPSMSBearerTable>
+
+<VirtualBearerTable>
+</VirtualBearerTable>
+
+<VpnServiceTable>
+</VpnServiceTable>
+
+<WLANServiceExtensionTable>
+</WLANServiceExtensionTable>
+
+<PANServiceExtensionsTable>
+</PANServiceExtensionsTable>
+
+<EAPSecuritySettingsTable>
+</EAPSecuritySettingsTable>
+
+<TunnelledEAPSettingsTable>
+</TunnelledEAPSettingsTable>
+
+<EAPTLSSettingsTable>
+</EAPTLSSettingsTable>
+
+<LEAPSettingsTable>
+</LEAPSettingsTable>
+
+
+</CommDB:Config>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/bwins/testsdkskinsu.def	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/conf/smoketest_uiresources.cfg	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,9 @@
+[Test]
+title TestUSkinInstanceL
+run testscripter c:\smoketest\ui_testsdkskinsu.cfg 6
+[Endtest]
+
+[Test]
+title TestWUSetIdleWallpaper
+run testscripter c:\smoketest\ui_testsdkskinswu.cfg 2
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/conf/ui_testsdkskinsu.cfg	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,457 @@
+[Test]
+title PressKey 
+pause 2000
+presskey global EKeyDevice1
+[Endtest]
+
+//----------------------------------------------------------------------------------//
+//------------------------------------AknsUtils.H-----------------------------------//
+//----------------------------------------------------------------------------------//
+// Test AknsUtils.H
+// For test function:
+// IMPORT_C static void InitSkinSupportL();
+[Test]
+title TestUInitSkinSupportL
+create testsdkskins test
+bringtoforeground
+test TestUInitSkinSupportL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static MAknsDataContext* CreateDataContextForContainerL();
+[Test]
+title TestUCreateDataContextForContainerL
+create testsdkskins test
+bringtoforeground
+test TestUCreateDataContextForContainerL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static CAknsItemDef* CreateBitmapItemDefL( 
+//     const TAknsItemID& aID, const TDesC& aFilename, 
+//     const TInt aIndex );
+[Test]
+title TestUCreateBitmapItemDefL
+create testsdkskins test
+bringtoforeground
+test TestUCreateBitmapItemDefL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static CAknsItemDef* CreateMaskedBitmapItemDefL( 
+//     const TAknsItemID& aID, const TDesC& aFilename, 
+//     const TInt aIndex, const TInt aMaskIndex );
+[Test]
+title TestUCreateMaskedBitmapItemDefL
+create testsdkskins test
+bringtoforeground
+test TestUCreateMaskedBitmapItemDefL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static MAknsSkinInstance* SkinInstance();
+[Test]
+title TestUSkinInstanceL
+create testsdkskins test
+bringtoforeground
+test TestUSkinInstanceL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static MAknsDataContext* DataContext( MObjectProvider* aMop );
+[Test]
+title TestUDataContextL
+create testsdkskins test
+bringtoforeground
+test TestUDataContextL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static void CreateIconL(
+//     MAknsSkinInstance* aInstance, const TAknsItemID& aID,
+//     CFbsBitmap*& aBitmap, CFbsBitmap*& aMask,
+//     const TDesC& aFilename,
+//     const TInt aFileBitmapId, const TInt aFileMaskId );
+[Test]
+title TestUCreateIconML
+create testsdkskins test
+bringtoforeground
+test TestUCreateIconML
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static void CreateIconLC(
+//     MAknsSkinInstance* aInstance, const TAknsItemID& aID,
+//     CFbsBitmap*& aBitmap, CFbsBitmap*& aMask,
+//     const TDesC& aFilename,
+//     const TInt aFileBitmapId, const TInt aFileMaskId );
+[Test]
+title TestUCreateIconMLC
+create testsdkskins test
+bringtoforeground
+test TestUCreateIconMLC
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static void CreateIconL(
+//     MAknsSkinInstance* aInstance, const TAknsItemID& aID,
+//     CFbsBitmap*& aBitmap,
+//     const TDesC& aFilename,
+//     const TInt aFileBitmapId );
+[Test]
+title TestUCreateIconL
+create testsdkskins test
+bringtoforeground
+test TestUCreateIconL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static void CreateIconLC(
+//     MAknsSkinInstance* aInstance, const TAknsItemID& aID,
+//     CFbsBitmap*& aBitmap,
+//     const TDesC& aFilename,
+//     const TInt aFileBitmapId );
+[Test]
+title TestUCreateIconLC
+create testsdkskins test
+bringtoforeground
+test TestUCreateIconLC
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static CApaMaskedBitmap* CreateMaskedBitmapL(
+//     MAknsSkinInstance* aInstance, const TAknsItemID& aID,
+//     const TDesC& aFilename,
+//     const TInt aFileIndex, const TInt aFileMaskIndex );
+[Test]
+title TestUCreateMaskedBitmapL
+create testsdkskins test
+bringtoforeground
+test TestUCreateMaskedBitmapL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static CGulIcon* CreateGulIconL(
+//     MAknsSkinInstance* aInstance, const TAknsItemID& aID,
+//     const TDesC& aFilename,
+//     const TInt aFileIndex, const TInt aFileMaskIndex );
+[Test]
+title TestUCreateGulIconL
+create testsdkskins test
+bringtoforeground
+test TestUCreateGulIconL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static void CreateAppIconLC(
+//     MAknsSkinInstance* aInstance, TUid aAppUid,
+//     TAknsAppIconType aType,
+//     CFbsBitmap*& aBitmap, CFbsBitmap*& aMask );
+[Test]
+title TestUCreateAppIconLC
+create testsdkskins test
+bringtoforeground
+test TestUCreateAppIconLC
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C TInt OpenAppIconFile(
+//     MAknsSkinInstance* aInstance, TUid aAppUid,
+//     TAknsAppIconType aType, RFile& aFile );
+[Test]
+title TestUOpenAppIconFileL
+create testsdkskins test
+bringtoforeground
+test TestUOpenAppIconFileL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static void CreateColorIconL(
+//     MAknsSkinInstance* aInstance, const TAknsItemID& aID,
+//     const TAknsItemID& aColorID, const TInt aColorIndex,
+//     CFbsBitmap*& aBitmap, CFbsBitmap*& aMask,
+//     const TDesC& aFilename,
+//     const TInt aFileBitmapId, const TInt aFileMaskId,
+//     const TRgb aDefaultColor );
+[Test]
+title TestUCreateColorIconL
+create testsdkskins test
+bringtoforeground
+test TestUCreateColorIconL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static void CreateColorIconLC(
+//     MAknsSkinInstance* aInstance, const TAknsItemID& aID,
+//     const TAknsItemID& aColorID, const TInt aColorIndex,
+//     CFbsBitmap*& aBitmap, CFbsBitmap*& aMask,
+//     const TDesC& aFilename,
+//     const TInt aFileBitmapId, const TInt aFileMaskId,
+//     const TRgb aDefaultColor );
+[Test]
+title TestUCreateColorIconLC
+create testsdkskins test
+bringtoforeground
+test TestUCreateColorIconLC
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static void CreateColorIconL(
+//     MAknsSkinInstance* aInstance, const TAknsItemID& aID,
+//     const TAknsItemID& aColorID, const TInt aColorIndex,
+//     CFbsBitmap*& aBitmap, CFbsBitmap*& aMask,
+//     const TDesC& aFilename,
+//     const TInt aFileBitmapId, const TInt aFileMaskId,
+//     const TRgb aDefaultColor,
+//     const TSize& aSize, const TScaleMode aScaleMode );
+[Test]
+title TestUCreateColorIconML
+create testsdkskins test
+bringtoforeground
+test TestUCreateColorIconML
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static void CreateColorIconLC(
+//     MAknsSkinInstance* aInstance, const TAknsItemID& aID,
+//     const TAknsItemID& aColorID, const TInt aColorIndex,
+//     CFbsBitmap*& aBitmap, CFbsBitmap*& aMask,
+//     const TDesC& aFilename,
+//     const TInt aFileBitmapId, const TInt aFileMaskId,
+//     const TRgb aDefaultColor,
+//     const TSize& aSize, const TScaleMode aScaleMode );
+[Test]
+title TestUCreateColorIconMLC
+create testsdkskins test
+bringtoforeground
+test TestUCreateColorIconMLC
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static TInt GetAppIcon(
+//     MAknsSkinInstance* aInstance, TUid aAppUid, TSize aSize, 
+//     CApaMaskedBitmap& aAppBitmap );
+[Test]
+title TestUGetAppIconL
+create testsdkskins test
+bringtoforeground
+test TestUGetAppIconL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static CFbsBitmap* CreateBitmapL( 
+//     MAknsSkinInstance* aInstance, const TAknsItemID& aID );
+[Test]
+title TestUCreateBitmapL
+create testsdkskins test
+bringtoforeground
+test TestUCreateBitmapL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static CApaMaskedBitmap* CreateMaskedBitmapL(
+//     MAknsSkinInstance* aInstance, const TAknsItemID& aID );
+[Test]
+title TestUCreateMaskedBitmapIL
+create testsdkskins test
+bringtoforeground
+test TestUCreateMaskedBitmapIL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static CGulIcon* CreateGulIconL(
+//     MAknsSkinInstance* aInstance, const TAknsItemID& aID,
+//     const TBool aRequireMask );
+[Test]
+title TestUCreateGulIconIL
+create testsdkskins test
+bringtoforeground
+test TestUCreateGulIconIL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static CFbsBitmap* GetCachedBitmap( 
+//     MAknsSkinInstance* aInstance, const TAknsItemID& aID );
+[Test]
+title TestUGetCachedBitmapL
+create testsdkskins test
+bringtoforeground
+test TestUGetCachedBitmapL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static void GetCachedMaskedBitmap(
+//     MAknsSkinInstance* aInstance, const TAknsItemID& aID,
+//     CFbsBitmap*& aBitmap, CFbsBitmap*& aMask );
+[Test]
+title TestUGetCachedMaskedBitmapL
+create testsdkskins test
+bringtoforeground
+test TestUGetCachedMaskedBitmapL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static TInt GetCachedColor(
+//     MAknsSkinInstance* aInstance, TRgb& aRgb, const TAknsItemID& aID,
+//     const TInt aIndex );
+[Test]
+title TestUGetCachedColorL
+create testsdkskins test
+bringtoforeground
+test TestUGetCachedColorL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static TBool BooleanPropertyL( MAknsSkinInstance* aInstance, 
+//     const TAknsItemID& aID );
+[Test]
+title TestUBooleanPropertyL
+create testsdkskins test
+bringtoforeground
+test TestUBooleanPropertyL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static void SetAvkonSkinEnabledL( const TBool aEnabled );
+[Test]
+title TestUSetAvkonSkinEnabledL
+create testsdkskins test
+bringtoforeground
+test TestUSetAvkonSkinEnabledL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static TBool AvkonSkinEnabled();
+[Test]
+title TestUAvkonSkinEnabledL
+create testsdkskins test
+bringtoforeground
+test TestUAvkonSkinEnabledL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static void SetAvkonHighlightAnimationEnabledL( const TBool aEnabled );
+[Test]
+title TestUSetAvkonHighlightAnimationEnabledL
+create testsdkskins test
+bringtoforeground
+test TestUSetAvkonHighlightAnimationEnabledL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static TBool AvkonHighlightAnimationEnabled();
+[Test]
+title TestUAvkonHighlightAnimationEnabledL
+create testsdkskins test
+bringtoforeground
+test TestUAvkonHighlightAnimationEnabledL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static void RegisterControlPosition( 
+//     const CCoeControl* aControl );
+[Test]
+title TestURegisterControlPositionL
+create testsdkskins test
+bringtoforeground
+test TestURegisterControlPositionL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static void RegisterControlPosition( 
+//     const CCoeControl* aControl, const TPoint& aPoint );
+[Test]
+title TestURegisterControlPositionPL
+create testsdkskins test
+bringtoforeground
+test TestURegisterControlPositionPL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static void DeregisterControlPosition( 
+//     const CCoeControl* aControl );
+[Test]
+title TestUDeregisterControlPositionL
+create testsdkskins test
+bringtoforeground
+test TestUDeregisterControlPositionL
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static TInt GetControlPosition( const CCoeControl* aControl,
+//     TPoint& aScreenPos );
+[Test]
+title TestUGetControlPositionL
+create testsdkskins test
+bringtoforeground
+test TestUGetControlPositionL
+delete test
+sendtobackground
+[Endtest]
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/conf/ui_testsdkskinswu.cfg	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,33 @@
+[Test]
+title PressKey 
+pause 2000
+presskey global EKeyDevice1
+[Endtest]
+
+//----------------------------------------------------------------------------------//
+//---------------------------AknsControlContext.H-----------------------------------//
+//----------------------------------------------------------------------------------//
+// Test AknsControlContext.H
+// For test function:
+// IMPORT_C static TInt SetIdleWallpaper(const TDesC& aFilename, 
+//     CCoeEnv* aCoeEnv, TInt aWaitNoteTextResourceID = 0, TInt aWaitNoteResourceID = 0);
+[Test]
+title TestWUSetIdleWallpaper
+create testsdkskins test
+bringtoforeground
+test TestWUSetIdleWallpaper
+delete test
+sendtobackground
+[Endtest]
+
+// For test function:
+// IMPORT_C static TInt SetSlidesetWallpaper(CDesCArray& aSelectedFiles, 
+//     CCoeEnv* aCoeEnv, TInt aWaitNoteTextResourceID = 0, TInt aWaitNoteResourceID = 0);
+[Test]
+title TestWUSetSlidesetWallpaperL
+create testsdkskins test
+bringtoforeground
+test TestWUSetSlidesetWallpaperL
+delete test
+sendtobackground
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/eabi/testsdkskinsu.def	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,7 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+	_ZTI20CTestSDKSkinsControl @ 2 NONAME ; #<TI>#
+	_ZTI27CTestSDKSkinsObjectProvider @ 3 NONAME ; #<TI>#
+	_ZTV20CTestSDKSkinsControl @ 4 NONAME ; #<VT>#
+	_ZTV27CTestSDKSkinsObjectProvider @ 5 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/group/bld.inf	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  test AknsBasicBackgroundControlContext.h AknsControlContext.h
+*                     AknsDataContext.h AknsDrawUtils.h AknsItemData.h
+*                     AknsFrameBackgroundControlContext.h AknsItemID.h
+*                     AknsLayeredBackgroundControlContext.h
+*                     AknsListBoxBackgroundControlContext.h
+*                     AknsRlEffectContext.h AknsRlParameter.h
+*                     AknsSkinInstance.h AknsUtils.h AknsWallpaperUtils.h
+*
+*/
+
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_TESTEXPORTS
+../conf/smoketest_uiresources.cfg	c:/smoketest/smoketest_uiresources.cfg
+../conf/ui_testsdkskinsu.cfg		c:/smoketest/ui_testsdkskinsu.cfg
+../conf/ui_testsdkskinswu.cfg		c:/smoketest/ui_testsdkskinswu.cfg
+// Wallpaper image file
+../testdata/wallpaper/symbian_01_320x480.jpg	c:/smoketest/wallpaper/symbian_01_320x480.jpg
+
+PRJ_EXPORTS
+
+
+PRJ_TESTMMPFILES
+testsdkskins.mmp
+
+PRJ_MMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/group/testsdkskins.mmp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  test AknsBasicBackgroundControlContext.h AknsControlContext.h
+*                     AknsDataContext.h AknsDrawUtils.h AknsItemData.h
+*                     AknsFrameBackgroundControlContext.h AknsItemID.h
+*                     AknsLayeredBackgroundControlContext.h
+*                     AknsListBoxBackgroundControlContext.h
+*                     AknsRlEffectContext.h AknsRlParameter.h
+*                     AknsSkinInstance.h AknsUtils.h AknsWallpaperUtils.h
+*
+*/
+
+
+#include <data_caging_paths.hrh> 
+#ifdef SBSV2
+    #include <platform_paths.hrh>
+#else // SBSV2 not defined
+    #include <platform_paths.hrh>
+#endif // SBSV2
+
+TARGET          testsdkskins.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x2001CB80
+
+CAPABILITY      ALL -TCB
+
+DEFFILE         testsdkskins.def
+
+#ifdef SBSV2
+    USERINCLUDE     ../inc 
+
+    MW_LAYER_SYSTEMINCLUDE
+
+    SOURCEPATH      ../src
+#else // SBSV2 not defined
+USERINCLUDE     ../inc 
+
+MW_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      ../src
+#endif // SBSV2
+
+SOURCE          testsdkskins.cpp
+SOURCE          testsdkskinsblocks.cpp
+SOURCE          testsdkskinsblocksbbcc.cpp
+SOURCE          testsdkskinsblockscc.cpp
+SOURCE          testsdkskinsblocksdc.cpp
+SOURCE          testsdkskinsblocksdu.cpp
+SOURCE          testsdkskinsobjectprovider.cpp
+SOURCE          testsdkskinscontrol.cpp
+SOURCE          testsdkskinsblocksfbcc.cpp
+SOURCE          testsdkskinsblocksid.cpp
+SOURCE          testsdkskinsblocksii.cpp
+SOURCE          testsdkskinsblockslbcc.cpp
+SOURCE          testsdkskinsblockslbbcc.cpp
+SOURCE          testsdkskinsblockswu.cpp
+SOURCE          testsdkskinsblocksu.cpp
+
+LIBRARY         euser.lib
+LIBRARY         cone.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY         aknskins.lib 
+LIBRARY         aknskinsrv.lib 
+LIBRARY         aknswallpaperutils.lib
+LIBRARY         eikcore.lib
+LIBRARY         fbscli.lib
+LIBRARY         bafl.lib
+LIBRARY         eikdlg.lib
+LIBRARY         apgrfx.lib
+LIBRARY         efsrv.lib
+
+LANG            SC
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/inc/testsdkskins.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,1362 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  test AknsBasicBackgroundControlContext.h AknsControlContext.h
+*                     AknsDataContext.h AknsDrawUtils.h AknsItemData.h
+*                     AknsFrameBackgroundControlContext.h AknsItemID.h
+*                     AknsLayeredBackgroundControlContext.h
+*                     AknsListBoxBackgroundControlContext.h
+*                     AknsRlEffectContext.h AknsRlParameter.h
+*                     AknsSkinInstance.h AknsUtils.h AknsWallpaperUtils.h
+*
+*/
+
+
+
+#ifndef C_TESTSDKSKINS_H
+#define C_TESTSDKSKINS_H
+
+//  INCLUDES
+#include <stiflogger.h>
+#include <testscripterinternal.h>
+#include <stiftestmodule.h>
+#include <testclassassert.h>
+
+// MACROS
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KtestsdkskinsLogPath, "\\logs\\testframework\\testsdkskins\\" ); 
+// Log file
+_LIT( KtestsdkskinsLogFile, "testsdkskins.txt" ); 
+_LIT( KtestsdkskinsLogFileWithTitle, "testsdkskins_[%S].txt" );
+
+/**
+*  CTestSDKSkins test class for STIF Test Framework TestScripter.
+*  @since S60 5.0
+*/
+NONSHARABLE_CLASS( CTestSDKSkins ) : public CScriptBase
+    {
+public:  // Constructors and destructor
+
+    /**
+    * Two-phased constructor.
+    */
+    static CTestSDKSkins* NewL( CTestModuleIf& aTestModuleIf );
+
+    /**
+    * Destructor.
+    */
+    virtual ~CTestSDKSkins();
+
+public: // Functions from base classes
+
+    /**
+    * From CScriptBase Runs a script line.
+    * @since S60 5.0
+    * @param aItem Script line containing method name and parameters
+    * @return Symbian OS error code
+    */
+    virtual TInt RunMethodL( CStifItemParser& aItem );
+
+private:
+
+    /**
+    * C++ default constructor.
+    */
+    CTestSDKSkins( CTestModuleIf& aTestModuleIf );
+
+    /**
+    * By default Symbian 2nd phase constructor is private.
+    */
+    void ConstructL();
+    
+    /**
+     * Method used to log version of test class
+     */
+    void SendTestClassVersion();
+    
+        /**
+     * Turn off ScreenSaver
+     * @since S60 5.0
+     * @return Symbian OS error code.
+     */
+    void TurnOffScreenSaver();
+
+    /**
+     * Restore ScreenSaver
+     * @since S60 5.0
+     * @return Symbian OS error code.
+     */
+    void RestoreScreenSaver();
+
+private: // Test AknsBasicBackgroundControlContext.h
+/*                  class CAknsBasicBackgroundControlContext                */
+    /**
+     * TestBBCCNewL test function for testing the 
+     *     NewL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBBCCNewL( CStifItemParser& aItem );
+    
+    /**
+     * TestBBCCSetBitmapL test function for testing the 
+     *     SetBitmap function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBBCCSetBitmapL( CStifItemParser& aItem );
+    
+    /**
+     * TestBBCCSetRectL test function for testing the 
+     *     SetRect function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBBCCSetRectL( CStifItemParser& aItem );
+    
+    /**
+     * TestBBCCSetParentPosL test function for testing the 
+     *     SetParentPos function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBBCCSetParentPosL( CStifItemParser& aItem );
+    
+    /**
+     * TestBBCCSetParentContextL test function for testing the 
+     *     SetParentContext function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBBCCSetParentContextL( CStifItemParser& aItem );
+
+private: // Test AknsControlContext.h
+/*                          class MAknsControlContext                       */
+    /**
+     * TestCCSupplyMopObjectL test function for testing the 
+     *     SupplyMopObject function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestCCSupplyMopObjectL( CStifItemParser& aItem );
+    
+private: // Test AknsDataContext.h
+/*                            class MAknsDataContext                          */
+    /**
+     * TestDCSupplyMopObjectL test function for testing the 
+     *     SupplyMopObject function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestDCSupplyMopObjectL( CStifItemParser& aItem );
+    
+private: // Test AknsDrawUtils.h
+/*                            class AknsDrawUtils                             */
+    /**
+     * TestDUControlContextL test function for testing the 
+     *     ControlContext function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestDUControlContextL( CStifItemParser& aItem );
+    
+    /**
+     * TestDUControlContextOfParentL test function for testing the 
+     *     ControlContextOfParent function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestDUControlContextOfParentL( CStifItemParser& aItem );
+    
+    /**
+     * TestDUBackgroundL test function for testing the 
+     *     Background function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestDUBackgroundL( CStifItemParser& aItem );
+    
+    /**
+     * TestDUBackgroundFPL test function for testing the 
+     *     Background function with five parameters
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestDUBackgroundFPL( CStifItemParser& aItem );
+    
+    /**
+     * TestDUBackgroundSPL test function for testing the 
+     *     Background function with six parameters
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestDUBackgroundSPL( CStifItemParser& aItem );
+    
+    /**
+     * TestDUDrawBackgroundL test function for testing the 
+     *     DrawBackground function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestDUDrawBackgroundL( CStifItemParser& aItem );
+    
+    /**
+     * TestDUBackgroundBetweenRectsFPL test function for testing the 
+     *     BackgroundBetweenRects function with five parameters
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestDUBackgroundBetweenRectsFPL( CStifItemParser& aItem );
+    
+    /**
+     * TestDUBackgroundBetweenRectsL test function for testing the 
+     *     BackgroundBetweenRects function with six parameters
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestDUBackgroundBetweenRectsL( CStifItemParser& aItem );
+    
+    /**
+     * TestDUBackgroundBetweenRectsSPL test function for testing the 
+     *     BackgroundBetweenRects function with seven parameters
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestDUBackgroundBetweenRectsSPL( CStifItemParser& aItem );
+    
+    /**
+     * TestDUHasBitmapBackgroundL test function for testing the 
+     *     HasBitmapBackground function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestDUHasBitmapBackgroundL( CStifItemParser& aItem );
+    
+    /**
+     * TestDUDrawCachedImageL test function for testing the 
+     *     DrawCachedImage function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestDUDrawCachedImageL( CStifItemParser& aItem );
+    
+    /**
+     * TestDUDrawCachedImageFBSL test function for testing the 
+     *     ControlContext function with fbsbitgc
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestDUDrawCachedImageFBSL( CStifItemParser& aItem );
+    
+    /**
+     * TestDUDrawFrameL test function for testing the 
+     *     DrawFrame function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestDUDrawFrameL( CStifItemParser& aItem );
+    
+    /**
+     * TestDUPrepareFrameL test function for testing the 
+     *     PrepareFrame function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestDUPrepareFrameL( CStifItemParser& aItem );
+    
+    /**
+     * TestDUDrawFrameSPL test function for testing the 
+     *     DrawFrame function with seven parameters
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestDUDrawFrameSPL( CStifItemParser& aItem );
+    
+    /**
+     * TestDUDrawFrameFBSL test function for testing the 
+     *     DrawFrame function with fbsbitgc
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestDUDrawFrameFBSL( CStifItemParser& aItem );
+    
+    /**
+     * TestDUDrawFramePartL test function for testing the 
+     *     DrawFramePart function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestDUDrawFramePartL( CStifItemParser& aItem );
+    
+    /**
+     * TestDUIsListSeperatorLines test function for testing the 
+     *     IsListSeperatorLines function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestDUIsListSeperatorLines( CStifItemParser& aItem );
+    
+    /**
+     * TestDUSlidingMode test function for testing the 
+     *     SlidingMode function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestDUSlidingMode( CStifItemParser& aItem );
+    
+private: // Test AknsDrawUtils.h
+/*                            class AknsDrawUtils                             */
+    /**
+     * TestFBCCNewL test function for testing the 
+     *     NewL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestFBCCNewL( CStifItemParser& aItem );
+    
+    /**
+     * TestFBCCSetFrameL test function for testing the 
+     *     SetFrame function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestFBCCSetFrameL( CStifItemParser& aItem );
+    
+    /**
+     * TestFBCCSetFrameRectsL test function for testing the 
+     *     SetFrameRects function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestFBCCSetFrameRectsL( CStifItemParser& aItem );
+    
+    /**
+     * TestFBCCSetCenterL test function for testing the 
+     *     SetCenter function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestFBCCSetCenterL( CStifItemParser& aItem );
+    
+    /**
+     * TestFBCCSetFramePartRectL test function for testing the 
+     *     SetFramePartRect function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestFBCCSetFramePartRectL( CStifItemParser& aItem );
+    
+private: // Test AknsItemData.h
+/*                            class CAknsItemData                             */
+    /**
+     * TestIDTypeL test function for testing the 
+     *     Type function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestIDTypeL( CStifItemParser& aItem );
+
+/*                            class CAknsImageItemData                         */
+    /**
+     * TestIIDSetAttributesL test function for testing the 
+     *     SetAttributesL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestIIDSetAttributesL( CStifItemParser& aItem );
+    
+    /**
+     * TestIIDAttributesL test function for testing the 
+     *     Attributes function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestIIDAttributesL( CStifItemParser& aItem );
+    
+    /**
+     * TestIIDSetParentIIDL test function for testing the 
+     *     SetParentIID function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestIIDSetParentIIDL( CStifItemParser& aItem );
+    
+    /**
+     * TestIIDSetDrawRectL test function for testing the 
+     *     SetDrawRect function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestIIDSetDrawRectL( CStifItemParser& aItem );
+    
+    /**
+     * TestIIDParentIIDL test function for testing the 
+     *     ParentIID function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestIIDParentIIDL( CStifItemParser& aItem );
+    
+    /**
+     * TestIIDDrawRectL test function for testing the 
+     *     DrawRect function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestIIDDrawRectL( CStifItemParser& aItem );
+
+private://AknsItemData.h
+/*                            class CAknsBitmapItemData                        */
+    /**
+     * TestBIDNewL test function for testing the 
+     *     NewL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBIDNewL( CStifItemParser& aItem );
+    
+    /**
+     * TestBIDSetBitmapL test function for testing the 
+     *     SetBitmap function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBIDSetBitmapL( CStifItemParser& aItem );
+    
+    /**
+     * TestBIDDestroyAndSetBitmapL test function for testing the 
+     *     DestroyAndSetBitmap function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBIDDestroyAndSetBitmapL( CStifItemParser& aItem );
+    
+    /**
+     * TestBIDBitmapL test function for testing the 
+     *     Bitmap function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBIDBitmapL( CStifItemParser& aItem );
+
+/*                     class CAknsMaskedBitmapItemData                    */
+    /**
+     * TestMBIDNewL test function for testing the 
+     *     NewL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestMBIDNewL( CStifItemParser& aItem );
+    
+    /**
+     * TestMBIDSetMaskL test function for testing the 
+     *     SetMask function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestMBIDSetMaskL( CStifItemParser& aItem );
+    
+    /**
+     * TestMBIDDestroyAndSetMaskL test function for testing the 
+     *     DestroyAndSetMask function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestMBIDDestroyAndSetMaskL( CStifItemParser& aItem );
+    
+    /**
+     * TestMBIDMaskL test function for testing the 
+     *     Mask function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestMBIDMaskL( CStifItemParser& aItem );
+    
+/*                      class CAknsColorTableItemData                       */
+    /**
+     * TestCTIDNewL test function for testing the 
+     *     NewL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestCTIDNewL( CStifItemParser& aItem );
+    
+    /**
+     * TestCTIDSetColorsL test function for testing the 
+     *     SetColorsL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestCTIDSetColorsL( CStifItemParser& aItem );
+    
+    /**
+     * TestCTIDColorIndexedL test function for testing the 
+     *     ColorIndexed function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestCTIDColorIndexedL( CStifItemParser& aItem );
+    
+    /**
+     * TestCTIDColorRgbL test function for testing the 
+     *     ColorRgb function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestCTIDColorRgbL( CStifItemParser& aItem );
+    
+    /**
+     * TestCTIDGetColorL test function for testing the 
+     *     GetColorL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestCTIDGetColorL( CStifItemParser& aItem );
+
+/*                      class CAknsImageTableItemData                       */
+    /**
+     * TestITIDNewL test function for testing the 
+     *     NewL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestITIDNewL( CStifItemParser& aItem );
+    
+    /**
+     * TestITIDSetImagesL test function for testing the 
+     *     SetImagesL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestITIDSetImagesL( CStifItemParser& aItem );
+    
+    /**
+     * TestITIDImageIIDL test function for testing the 
+     *     ImageIID function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestITIDImageIIDL( CStifItemParser& aItem );
+    
+    /**
+     * TestITIDImagesL test function for testing the 
+     *     Images function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestITIDImagesL( CStifItemParser& aItem );
+    
+    /**
+     * TestITIDNumberOfImagesL test function for testing the 
+     *     NumberOfImages function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestITIDNumberOfImagesL( CStifItemParser& aItem );
+
+/*                      class CAknsBmpAnimItemData                       */
+    /**
+     * TestBAIDNewL test function for testing the 
+     *     NewL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBAIDNewL( CStifItemParser& aItem );
+    
+    /**
+     * TestBAIDSetFrameInfosL test function for testing the 
+     *     SetFrameInfosL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBAIDSetFrameInfosL( CStifItemParser& aItem );
+    
+    /**
+     * TestBAIDFrameInfosL test function for testing the 
+     *     FrameInfos function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBAIDFrameInfosL( CStifItemParser& aItem );
+    
+    /**
+     * TestBAIDSetLastFrameBackgroundL test function for testing the 
+     *     SetLastFrameBackground function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBAIDSetLastFrameBackgroundL( CStifItemParser& aItem );
+    
+    /**
+     * TestBAIDLastFrameBackgroundL test function for testing the 
+     *     LastFrameBackground function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBAIDLastFrameBackgroundL( CStifItemParser& aItem );
+    
+    /**
+     * TestBAIDSetFrameIntervalL test function for testing the 
+     *     SetFrameInterval function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBAIDSetFrameIntervalL( CStifItemParser& aItem );
+    
+    /**
+     * TestBAIDFrameIntervalL test function for testing the 
+     *     FrameInterval function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBAIDFrameIntervalL( CStifItemParser& aItem );
+    
+    /**
+     * TestBAIDSetPlayModeL test function for testing the 
+     *     SetPlayMode function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBAIDSetPlayModeL( CStifItemParser& aItem );
+    
+    /**
+     * TestBAIDPlayModeL test function for testing the 
+     *     PlayMode function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBAIDPlayModeL( CStifItemParser& aItem );
+    
+    /**
+     * TestBAIDSetFlashL test function for testing the 
+     *     SetFlash function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBAIDSetFlashL( CStifItemParser& aItem );
+    
+    /**
+     * TestBAIDFlashL test function for testing the 
+     *     Flash function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBAIDFlashL( CStifItemParser& aItem );
+
+/*                      class CAknsStringItemData                        */
+    /**
+     * TestSIDNewL test function for testing the 
+     *     NewL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestSIDNewL( CStifItemParser& aItem );
+    
+    /**
+     * TestSIDSetStringL test function for testing the 
+     *     SetStringL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestSIDSetStringL( CStifItemParser& aItem );
+    
+    /**
+     * TestSIDStringL test function for testing the 
+     *     String function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestSIDStringL( CStifItemParser& aItem );
+
+/*                      class CAknsEffectCommand                        */
+    /**
+     * TestECNewL test function for testing the 
+     *     NewL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestECNewL( CStifItemParser& aItem );
+    
+    /**
+     * TestECSetEffectUidL test function for testing the 
+     *     SetEffectUid function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestECSetEffectUidL( CStifItemParser& aItem );
+    
+    /**
+     * TestECEffectUidL test function for testing the 
+     *     EffectUid function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestECEffectUidL( CStifItemParser& aItem );
+    
+    /**
+     * TestECSetLayerConfL test function for testing the 
+     *     SetLayerConf function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestECSetLayerConfL( CStifItemParser& aItem );
+    
+    /**
+     * TestECLayerConfL test function for testing the 
+     *     LayerConf function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestECLayerConfL( CStifItemParser& aItem );
+    
+    /**
+     * TestECAppendParameterL test function for testing the 
+     *     AppendParameterL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestECAppendParameterL( CStifItemParser& aItem );
+    
+    /**
+     * TestECCreateParameterIteratorL test function for testing the 
+     *     CreateParameterIteratorL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestECCreateParameterIteratorL( CStifItemParser& aItem );
+
+/*                      class CAknsEffectQueueItemData                 */
+    /**
+     * TestEQIDNewL test function for testing the 
+     *     NewL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestEQIDNewL( CStifItemParser& aItem );
+    
+    /**
+     * TestEQIDSetRefItemL test function for testing the 
+     *     SetRefItem function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestEQIDSetRefItemL( CStifItemParser& aItem );
+    
+    /**
+     * TestEQIDRefItemL test function for testing the 
+     *     RefItem function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestEQIDRefItemL( CStifItemParser& aItem );
+    
+    /**
+     * TestEQIDSetInputLayerL test function for testing the 
+     *     SetInputLayer function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestEQIDSetInputLayerL( CStifItemParser& aItem );
+    
+    /**
+     * TestEQIDInputLayerL test function for testing the 
+     *     InputLayer function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestEQIDInputLayerL( CStifItemParser& aItem );
+    
+    /**
+     * TestEQIDSetInputLayerModeL test function for testing the 
+     *     SetInputLayerMode function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestEQIDSetInputLayerModeL( CStifItemParser& aItem );
+    
+    /**
+     * TestEQIDInputLayerModeL test function for testing the 
+     *     InputLayerMode function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestEQIDInputLayerModeL( CStifItemParser& aItem );
+    
+    /**
+     * TestEQIDSetOutputLayerL test function for testing the 
+     *     SetOutputLayer function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestEQIDSetOutputLayerL( CStifItemParser& aItem );
+    
+    /**
+     * TestEQIDOutputLayerL test function for testing the 
+     *     OutputLayer function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestEQIDOutputLayerL( CStifItemParser& aItem );
+    
+    /**
+     * TestEQIDSetOutputLayerModeL test function for testing the 
+     *     SetOutputLayerMode function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestEQIDSetOutputLayerModeL( CStifItemParser& aItem );
+    
+    /**
+     * TestEQIDOutputLayerModeL test function for testing the 
+     *     OutputLayerMode function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestEQIDOutputLayerModeL( CStifItemParser& aItem );
+    
+    /**
+     * TestEQIDAppendCommandL test function for testing the 
+     *     AppendCommandL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestEQIDAppendCommandL( CStifItemParser& aItem );
+    
+    /**
+     * TestEQIDCreateCommandIteratorL test function for testing the 
+     *     CreateCommandIteratorL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestEQIDCreateCommandIteratorL( CStifItemParser& aItem );
+    
+private://AknsItemID.h
+/*                               class TAknsItemID                            */
+    /**
+     * TestIILinearOrder test function for testing the 
+     *     LinearOrder function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestIILinearOrder( CStifItemParser& aItem );
+    
+private://AknsLayeredBackgroundControlContext.h
+/*                 class CAknsLayeredBackgroundControlContext                 */
+    /**
+     * TestLBCCNewL test function for testing the 
+     *     NewL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestLBCCNewL( CStifItemParser& aItem );
+    
+    /**
+     * TestLBCCSetLayerImageL test function for testing the 
+     *     SetLayerImage function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestLBCCSetLayerImageL( CStifItemParser& aItem );
+
+    /**
+     * TestLBCCSetLayerRectL test function for testing the 
+     *     SetLayerRect function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestLBCCSetLayerRectL( CStifItemParser& aItem );
+    
+private://AknsListBoxBackgroundControlContext.h
+/*                 class CAknsListBoxBackgroundControlContext                 */
+    /**
+     * TestLBBCCNewL test function for testing the 
+     *     NewL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestLBBCCNewL( CStifItemParser& aItem );
+    
+    /**
+     * TestLBBCCSetTiledBitmapL test function for testing the 
+     *     SetTiledBitmap function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestLBBCCSetTiledBitmapL( CStifItemParser& aItem );
+    
+    /**
+     * TestLBBCCSetTiledRectL test function for testing the 
+     *     SetTiledRect function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestLBBCCSetTiledRectL( CStifItemParser& aItem );
+    
+    /**
+     * TestLBBCCSetBottomBitmapL test function for testing the 
+     *     SetBottomBitmap function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestLBBCCSetBottomBitmapL( CStifItemParser& aItem );
+    
+    /**
+     * TestLBBCCSetBottomRectL test function for testing the 
+     *     SetBottomRect function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestLBBCCSetBottomRectL( CStifItemParser& aItem );
+    
+private://AknsWallpaperUtils.h
+/*                          class AknsWallpaperUtils                       */
+    /**
+     * TestWUSetIdleWallpaper test function for testing the 
+     *     SetIdleWallpaper function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestWUSetIdleWallpaper( CStifItemParser& aItem );
+    
+    /**
+     * TestWUSetSlidesetWallpaperL test function for testing the 
+     *     SetSlidesetWallpaper function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestWUSetSlidesetWallpaperL( CStifItemParser& aItem );
+    
+private://AknsUtils.h
+/*                               class AknsUtils                             */
+    /**
+     * TestUInitSkinSupportL test function for testing the 
+     *     InitSkinSupportL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUInitSkinSupportL( CStifItemParser& aItem );
+    
+    /**
+     * TestUCreateDataContextForContainerL test function for testing the 
+     *     CreateDataContextForContainerL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUCreateDataContextForContainerL( CStifItemParser& aItem );
+    
+    /**
+     * TestUCreateBitmapItemDefL test function for testing the 
+     *     CreateBitmapItemDefL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUCreateBitmapItemDefL( CStifItemParser& aItem );
+    
+    /**
+     * TestUCreateMaskedBitmapItemDefL test function for testing the 
+     *     CreateMaskedBitmapItemDefL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUCreateMaskedBitmapItemDefL( CStifItemParser& aItem );
+    
+    /**
+     * TestUSkinInstanceL test function for testing the 
+     *     SkinInstance function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUSkinInstanceL( CStifItemParser& aItem );
+    
+    /**
+     * TestUDataContextL test function for testing the 
+     *     DataContext function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUDataContextL( CStifItemParser& aItem );
+    
+    /**
+     * TestUCreateIconML test function for testing the 
+     *     CreateIconL function with mask
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUCreateIconML( CStifItemParser& aItem );
+    
+    /**
+     * TestUCreateIconMLC test function for testing the 
+     *     CreateIconLC function with mask
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUCreateIconMLC( CStifItemParser& aItem );
+    
+    /**
+     * TestUCreateIconL test function for testing the 
+     *     CreateIconL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUCreateIconL( CStifItemParser& aItem );
+    
+    /**
+     * TestUCreateIconLC test function for testing the 
+     *     CreateIconLC function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUCreateIconLC( CStifItemParser& aItem );
+    
+    /**
+     * TestUCreateMaskedBitmapL test function for testing the 
+     *     CreateMaskedBitmapL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUCreateMaskedBitmapL( CStifItemParser& aItem );
+    
+    /**
+     * TestUCreateGulIconL test function for testing the 
+     *     CreateGulIconL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUCreateGulIconL( CStifItemParser& aItem );
+    
+    /**
+     * TestUCreateAppIconLC test function for testing the 
+     *     CreateAppIconLC function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUCreateAppIconLC( CStifItemParser& aItem );
+    
+    /**
+     * TestUOpenAppIconFileL test function for testing the 
+     *     OpenAppIconFile function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUOpenAppIconFileL( CStifItemParser& aItem );
+    
+    /**
+     * TestUCreateColorIconL test function for testing the 
+     *     CreateColorIconL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUCreateColorIconL( CStifItemParser& aItem );
+    
+    /**
+     * TestUCreateColorIconLC test function for testing the 
+     *     CreateColorIconLC function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUCreateColorIconLC( CStifItemParser& aItem );
+    
+    /**
+     * TestUCreateColorIconML test function for testing the 
+     *     InitSkinSupportL function with mode
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUCreateColorIconML( CStifItemParser& aItem );
+    
+    /**
+     * TestUCreateColorIconMLC test function for testing the 
+     *     CreateColorIconLC function with mode
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUCreateColorIconMLC( CStifItemParser& aItem );
+    
+    /**
+     * TestUGetAppIconL test function for testing the 
+     *     GetAppIcon function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUGetAppIconL( CStifItemParser& aItem );
+    
+    /**
+     * TestUCreateBitmapL test function for testing the 
+     *     CreateBitmapL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUCreateBitmapL( CStifItemParser& aItem );
+    
+    /**
+     * TestUCreateMaskedBitmapIL test function for testing the 
+     *     CreateMaskedBitmapL function with instance
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUCreateMaskedBitmapIL( CStifItemParser& aItem );
+    
+    /**
+     * TestUCreateGulIconIL test function for testing the 
+     *     CreateGulIconL function with instance
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUCreateGulIconIL( CStifItemParser& aItem );
+    
+    /**
+     * TestUGetCachedBitmapL test function for testing the 
+     *     GetCachedBitmap function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUGetCachedBitmapL( CStifItemParser& aItem );
+    
+    /**
+     * TestUGetCachedMaskedBitmapL test function for testing the 
+     *     GetCachedMaskedBitmap function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUGetCachedMaskedBitmapL( CStifItemParser& aItem );
+    
+    /**
+     * TestUGetCachedColorL test function for testing the 
+     *     GetCachedColor function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUGetCachedColorL( CStifItemParser& aItem );
+    
+    /**
+     * TestUBooleanPropertyL test function for testing the 
+     *     BooleanPropertyL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUBooleanPropertyL( CStifItemParser& aItem );
+    
+    /**
+     * TestUSetAvkonSkinEnabledL test function for testing the 
+     *     SetAvkonSkinEnabledL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUSetAvkonSkinEnabledL( CStifItemParser& aItem );
+    
+    /**
+     * TestUAvkonSkinEnabledL test function for testing the 
+     *     AvkonSkinEnabled function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUAvkonSkinEnabledL( CStifItemParser& aItem );
+    
+    /**
+     * TestUSetAvkonHighlightAnimationEnabledL test function for testing the 
+     *     SetAvkonHighlightAnimationEnabledL function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUSetAvkonHighlightAnimationEnabledL( CStifItemParser& aItem );
+    
+    /**
+     * TestUAvkonHighlightAnimationEnabledL test function for testing the 
+     *     AvkonHighlightAnimationEnabled function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUAvkonHighlightAnimationEnabledL( CStifItemParser& aItem );
+    
+    /**
+     * TestURegisterControlPositionL test function for testing the 
+     *     RegisterControlPosition function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestURegisterControlPositionL( CStifItemParser& aItem );
+    
+    /**
+     * TestURegisterControlPositionPL test function for testing the 
+     *     RegisterControlPosition function with point
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestURegisterControlPositionPL( CStifItemParser& aItem );
+    
+    /**
+     * TestUDeregisterControlPositionL test function for testing the 
+     *     DeregisterControlPosition function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUDeregisterControlPositionL( CStifItemParser& aItem );
+    
+    /**
+     * TestUGetControlPositionL test function for testing the 
+     *     GetControlPosition function
+     * @since S60 5.0
+     * @param aItem never used
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestUGetControlPositionL( CStifItemParser& aItem );
+private:    // Data
+
+    /**
+     * ScreenSaver Property
+     */
+    TInt iOldScreenSaverProperty;
+
+    };
+
+#endif      // C_TESTSDKSKINS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/inc/testsdkskinscontrol.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Test AknsDrawUtils.h 
+*
+*/
+
+#ifndef C_TESTSDKSKINSCONTROL_H
+#define C_TESTSDKSKINSCONTROL_H
+
+//  INCLUDES
+
+#include <e32base.h>
+#include <coedef.h>
+#include <coecntrl.h>
+
+    /**
+    *  CTestSDKNotesNoteDialog test class for CAknNoteDialog protected API.
+    */
+class CTestSDKSkinsControl : public CCoeControl
+    {
+public:
+    /**
+     * Two-phased constructor.
+     */
+    static CTestSDKSkinsControl* NewL();
+    
+    /**
+     * Destructor.
+     */
+    ~CTestSDKSkinsControl();
+    
+    /**
+     * fuction ActivateGc for test ActivateGc
+     */
+    void ActivateGc();
+    
+    /**
+     * fuction DeActivateGc for test DeActivateGc
+     */
+    void DeactivateGc();
+    
+private:
+    
+    /**
+     * Constructor.
+     */
+    CTestSDKSkinsControl();
+    
+    /**
+     * By default Symbian 2nd phase constructor is private.
+     */
+    void ConstructL();
+    
+    /**
+     * Receive key events.
+     */
+    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+    
+    /**
+     * Draw control.
+     */
+    void Draw(const TRect& aRect) const;
+    
+    /**
+     * Return number of controls in its window.
+     */
+    TInt CountComponentControls() const;
+    
+    /**
+     * Controls in its window.
+     */
+    CCoeControl* ComponentControl(TInt aIndex) const;
+    
+    /**
+     * Resize screen.
+     */
+    void SizeChanged();
+
+    
+    };
+
+
+#endif /*C_TESTSDKSKINSCONTROL_H*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/inc/testsdkskinsobjectprovider.h	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Test AknsDrawUtils.h 
+*
+*/
+
+#ifndef C_TESTSDKSKINSOBJECTPROVIDER_H
+#define C_TESTSDKSKINSOBJECTPROVIDER_H
+
+//  INCLUDES
+
+#include <e32base.h>
+
+    /**
+    *  CTestSDKNotesNoteDialog test class for CAknNoteDialog protected API.
+    */
+class CTestSDKSkinsObjectProvider : public CBase,
+                                    public MObjectProvider
+    {
+public:
+    /**
+    *  function MopSupplyObject from MObjectProvider
+    */
+    TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
+    
+    };
+
+#endif /*C_TESTSDKSKINSOBJECTPROVIDER_H*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/init/testsdkskins.ini	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,201 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+# - Set Test Reporting mode. TestReportMode's possible values are:
+#     + 'Summary': Summary of the tested test cases.
+#     + 'Environment': Hardware and software info.
+#     + 'TestCases': Test case report.
+#     + 'FullReport': Set of all above ones.
+#     + Example 'TestReportMode= Summary TestCases'
+#
+#     - CreateTestReport setting controls report creation mode
+#     + YES, Test report will created.
+#     + NO, No Test report.
+#
+#     - File path indicates the base path of the test report.
+#     - File name indicates the name of the test report.
+#
+#     - File format indicates the type of the test report.
+#     + TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#     + HTML, Test report will be html type, for example 'TestReport.html'.
+#
+#     - File output indicates output source of the test report.
+#     + FILE, Test report logging to file.
+#     + RDEBUG, Test report logging to using rdebug.
+#
+#     - File Creation Mode indicates test report overwriting if file exist.
+#     + OVERWRITE, Overwrites if the Test report file exist.
+#     + APPEND, Continue logging after the old Test report information if 
+#           report exist.
+
+[Engine_Defaults]
+
+TestReportMode= FullReport    # Possible values are: 
+                              # 'Summary', 'Environment', 'TestCases' or 'FullReport'
+
+CreateTestReport= YES         # Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT         # Possible values: TXT or HTML
+TestReportOutput= FILE        # Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE    # Possible values: OVERWRITE or APPEND
+UITestingSupport= Yes
+SeparateProcesses= YES
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= testsdkskinstestsdkskinstestsdkskins
+# Modules might have initialisation file, specified as
+# IniFile= YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= NormalCases.txt
+# TestCaseFile= SmokeCases.txt
+# TestCaseFile= ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= testcombiner
+TestCaseFile= c:\testframework\tctestsdkskinsbbcc.cfg
+TestCaseFile= c:\testframework\tctestsdkskinscc.cfg
+TestCaseFile= c:\testframework\tctestsdkskinsdc.cfg
+TestCaseFile= c:\testframework\tctestsdkskinsdu.cfg
+TestCaseFile= c:\testframework\tctestsdkskinsfbcc.cfg
+TestCaseFile= c:\testframework\tctestsdkskinsid.cfg
+TestCaseFile= c:\testframework\tctestsdkskinsii.cfg
+TestCaseFile= c:\testframework\tctestsdkskinslbbcc.cfg
+TestCaseFile= c:\testframework\tctestsdkskinslbcc.cfg
+TestCaseFile= c:\testframework\tctestsdkskinswu.cfg
+TestCaseFile= c:\testframework\tctestsdkskinsu.cfg
+[End_Module]
+
+#[New_Module]
+#ModuleName= testscripter
+#TestCaseFile= c:\testframework\ui_testsdkskinsbbcc.cfg
+#TestCaseFile= c:\testframework\ui_testsdkskinscc.cfg
+#TestCaseFile= c:\testframework\ui_testsdkskinsdc.cfg
+#TestCaseFile= c:\testframework\ui_testsdkskinsdu.cfg
+#TestCaseFile= c:\testframework\ui_testsdkskinsfbcc.cfg
+#TestCaseFile= c:\testframework\ui_testsdkskinsid.cfg
+#TestCaseFile= c:\testframework\ui_testsdkskinsii.cfg
+#TestCaseFile= c:\testframework\ui_testsdkskinslbbcc.cfg
+#TestCaseFile= c:\testframework\ui_testsdkskinslbcc.cfg
+#TestCaseFile= c:\testframework\ui_testsdkskinswu.cfg
+#TestCaseFile= c:\testframework\ui_testsdkskinsu.cfg
+#[End_Module]
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+#Load testmoduletestsdkskins, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuletestsdkskins used initialization file
+#IniFile= init.txt
+
+#TestModuletestsdkskins used configuration file(s)
+#TestCaseFile= testcases1.cfg
+#TestCaseFile= testcases2.cfg
+#TestCaseFile= manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# Hardware and emulator environment logging path and styles can
+# be configured from here to overwrite the Logger's implemented values.
+#	
+# Settings description:
+# - Indicates option for creation log directory/directories. If log directory/directories
+#       is/are not created by user they will make by software.
+#     + YES, Create log directory/directories if not allready exist.
+#     + NO, Log directory/directories not created. Only created one is used.
+#
+# - Overwrite emulator path setting.
+#     + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#       Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#       will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+# - Overwrite emulator's logging format.
+#     + TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#     + HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+# - Overwrited emulator logging output source.
+#     + FILE, Logging to file(s).
+#     + RDEBUG, Logging to using rdebug(s).
+#
+# - Overwrite hardware path setting (Same description as above in emulator path).
+# - Overwrite hardware's logging format(Same description as above in emulator format).
+# - Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+# - File Creation Mode indicates file overwriting if file exist.
+#     + OVERWRITE, Overwrites if file(s) exist.
+#     + APPEND, Continue logging after the old logging information if file(s) exist.
+#
+# - Will thread id include to the log filename.
+#     + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#     + NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+# - Will time stamps include the to log file.
+#     + YES, Time stamp added to each line in log file(s). Time stamp is 
+#       for example'12.Nov.2003 115958 LOGGING INFO'
+#     + NO, No time stamp(s).
+#
+# - Will line breaks include to the log file.
+#     + YES, Each logging event includes line break and next log event is in own line.
+#     + NO, No line break(s).
+#
+# - Will event ranking include to the log file.
+#     + YES, Event ranking number added to each line in log file(s). Ranking number 
+#       depends on environment's tics, for example(includes time stamp also)
+#       '012   12.Nov.2003 115958    LOGGING INFO'
+#     + NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+CreateLogDirectories= YES    # Possible values: YES or NO
+
+EmulatorBasePath= C:\LOGS\TestFramework\
+EmulatorFormat= HTML         # Possible values: TXT or HTML
+EmulatorOutput= FILE         # Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML        # Possible values: TXT or HTML
+#HardwareOutput= FILE        # Possible values: FILE or RDEBUG
+
+FileCreationMode= OVERWRITE  # Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES      # Possible values: YES or NO
+#WithTimeStamp= YES          # Possible values: YES or NO
+#WithLineBreak= YES          # Possible values: YES or NO
+#WithEventRanking= YES       # Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/src/testsdkskins.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,190 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  test AknsBasicBackgroundControlContext.h AknsControlContext.h
+*                     AknsDataContext.h AknsDrawUtils.h AknsItemData.h
+*                     AknsFrameBackgroundControlContext.h AknsItemID.h
+*                     AknsLayeredBackgroundControlContext.h
+*                     AknsListBoxBackgroundControlContext.h
+*                     AknsRlEffectContext.h AknsRlParameter.h
+*                     AknsSkinInstance.h AknsUtils.h AknsWallpaperUtils.h
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <stiftestinterface.h>
+#include <settingserverclient.h>
+#include <screensaverinternalpskeys.h>
+#include <e32property.h>
+
+#include "testsdkskins.h"
+
+// CONSTANTS
+_LIT( KModuleName, "testsdkskins.dll" );
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::CTestSDKSkins
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CTestSDKSkins::CTestSDKSkins( CTestModuleIf& aTestModuleIf ):
+    CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::~CTestSDKSkins
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CTestSDKSkins::~CTestSDKSkins()
+    {
+    // Delete logger
+    delete iLog; 
+
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CTestSDKSkins::ConstructL()
+    {
+    //Read logger settings to check whether test case name is to be
+    //appended to log file name.
+    RSettingServer settingServer;
+    CleanupClosePushL( settingServer );
+    TInt ret = settingServer.Connect();
+    if ( ret != KErrNone )
+        {
+        User::Leave(ret);
+        }
+    // Struct to StifLogger settigs.
+    TLoggerSettings loggerSettings; 
+    // Parse StifLogger defaults from STIF initialization file.
+    ret = settingServer.GetLoggerSettings( loggerSettings );
+    if ( ret != KErrNone )
+        {
+        User::Leave( ret );
+        } 
+    // Close Setting server session
+    settingServer.Close();
+    CleanupStack::PopAndDestroy( &settingServer );
+
+    TFileName logFileName;
+    
+    if ( loggerSettings.iAddTestCaseTitle )
+        {
+        TName title;
+        TestModuleIf().GetTestCaseTitleL( title );
+        logFileName.Format( KtestsdkskinsLogFileWithTitle, &title );
+        }
+    else
+        {
+        logFileName.Copy( KtestsdkskinsLogFile );
+        }
+
+    iLog = CStifLogger::NewL( KtestsdkskinsLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+    
+    TurnOffScreenSaver();
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CTestSDKSkins* CTestSDKSkins::NewL( CTestModuleIf& aTestModuleIf )
+    {
+    CTestSDKSkins* self = new( ELeave ) CTestSDKSkins( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+
+    }
+
+//-----------------------------------------------------------------------------
+// CTestSDKSkins::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CTestSDKSkins::SendTestClassVersion()
+    {
+    TVersion moduleVersion;
+    moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
+    moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
+    moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
+
+    TFileName moduleName;
+    moduleName = KModuleName;
+
+    TBool newVersionOfMethod = ETrue;
+    TestModuleIf().SendTestModuleVersion( moduleVersion, moduleName, 
+        newVersionOfMethod );
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+    return ( CScriptBase* ) CTestSDKSkins::NewL( aTestModuleIf );
+    }
+
+// -----------------------------------------------------------------------------
+// Turn off ScreenSaver
+// -----------------------------------------------------------------------------
+//
+void CTestSDKSkins::TurnOffScreenSaver()
+    {
+    TInt err1 = RProperty::Get( KPSUidScreenSaver, KScreenSaverAllowScreenSaver, 
+        iOldScreenSaverProperty );
+    TInt err2 = RProperty::Set( KPSUidScreenSaver, KScreenSaverAllowScreenSaver, 
+        KScreenSaverAllowScreenSaver );    
+    RDebug::Printf( "screensaver property=%d err1=%d err2=%d\n", 
+        iOldScreenSaverProperty, err1, err2 );
+    }
+
+// -----------------------------------------------------------------------------
+// Restore ScreenSaver
+// -----------------------------------------------------------------------------
+//
+void CTestSDKSkins::RestoreScreenSaver()
+    {
+    RProperty::Set( KPSUidScreenSaver, KScreenSaverAllowScreenSaver, 
+        iOldScreenSaverProperty );
+    User::ResetInactivityTime();
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/src/testsdkskinsblocks.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,201 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  test AknsBasicBackgroundControlContext.h AknsControlContext.h
+*                     AknsDataContext.h AknsDrawUtils.h AknsItemData.h
+*                     AknsFrameBackgroundControlContext.h AknsItemID.h
+*                     AknsLayeredBackgroundControlContext.h
+*                     AknsListBoxBackgroundControlContext.h
+*                     AknsRlEffectContext.h AknsRlParameter.h
+*                     AknsSkinInstance.h AknsUtils.h AknsWallpaperUtils.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testsdkskins.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CTestSDKSkins::RunMethodL( CStifItemParser& aItem ) 
+    {
+
+    static TStifFunctionInfo const KFunctions[] =
+        {  
+        ENTRY( "TestBBCCNewL", CTestSDKSkins::TestBBCCNewL ),
+        ENTRY( "TestBBCCSetBitmapL", CTestSDKSkins::TestBBCCSetBitmapL ),
+        ENTRY( "TestBBCCSetRectL", CTestSDKSkins::TestBBCCSetRectL ),
+        ENTRY( "TestBBCCSetParentPosL", CTestSDKSkins::TestBBCCSetParentPosL ),
+        ENTRY( "TestBBCCSetParentContextL", CTestSDKSkins::TestBBCCSetParentContextL ),
+        
+        ENTRY( "TestCCSupplyMopObjectL", CTestSDKSkins::TestCCSupplyMopObjectL ),
+        
+        ENTRY( "TestDCSupplyMopObjectL", CTestSDKSkins::TestDCSupplyMopObjectL ),
+        
+        ENTRY( "TestDUControlContextL", CTestSDKSkins::TestDUControlContextL ),
+        ENTRY( "TestDUControlContextOfParentL", CTestSDKSkins::TestDUControlContextOfParentL ),
+        ENTRY( "TestDUBackgroundL", CTestSDKSkins::TestDUBackgroundL ),
+        ENTRY( "TestDUBackgroundFPL", CTestSDKSkins::TestDUBackgroundFPL ),
+        ENTRY( "TestDUBackgroundSPL", CTestSDKSkins::TestDUBackgroundSPL ),
+        ENTRY( "TestDUDrawBackgroundL", CTestSDKSkins::TestDUDrawBackgroundL ),
+        ENTRY( "TestDUBackgroundBetweenRectsFPL", CTestSDKSkins::TestDUBackgroundBetweenRectsFPL ),
+        ENTRY( "TestDUBackgroundBetweenRectsL", CTestSDKSkins::TestDUBackgroundBetweenRectsL ),
+        ENTRY( "TestDUBackgroundBetweenRectsSPL", CTestSDKSkins::TestDUBackgroundBetweenRectsSPL ),
+        ENTRY( "TestDUHasBitmapBackgroundL", CTestSDKSkins::TestDUHasBitmapBackgroundL ),
+        ENTRY( "TestDUDrawCachedImageL", CTestSDKSkins::TestDUDrawCachedImageL ),
+        ENTRY( "TestDUDrawCachedImageFBSL", CTestSDKSkins::TestDUDrawCachedImageFBSL ),
+        ENTRY( "TestDUDrawFrameL", CTestSDKSkins::TestDUDrawFrameL ),
+        ENTRY( "TestDUPrepareFrameL", CTestSDKSkins::TestDUPrepareFrameL ),
+        ENTRY( "TestDUDrawFrameSPL", CTestSDKSkins::TestDUDrawFrameSPL ),
+        ENTRY( "TestDUDrawFrameFBSL", CTestSDKSkins::TestDUDrawFrameFBSL ),
+        ENTRY( "TestDUDrawFramePartL", CTestSDKSkins::TestDUDrawFramePartL ),
+        ENTRY( "TestDUIsListSeperatorLines", CTestSDKSkins::TestDUIsListSeperatorLines ),
+        ENTRY( "TestDUSlidingMode", CTestSDKSkins::TestDUSlidingMode ),
+        
+        ENTRY( "TestFBCCNewL", CTestSDKSkins::TestFBCCNewL ),
+        ENTRY( "TestFBCCSetFrameL", CTestSDKSkins::TestFBCCSetFrameL ),
+        ENTRY( "TestFBCCSetFrameRectsL", CTestSDKSkins::TestFBCCSetFrameRectsL ),
+        ENTRY( "TestFBCCSetCenterL", CTestSDKSkins::TestFBCCSetCenterL ),
+        ENTRY( "TestFBCCSetFramePartRectL", CTestSDKSkins::TestFBCCSetFramePartRectL ),
+        
+        ENTRY( "TestIDTypeL", CTestSDKSkins::TestIDTypeL ),
+        ENTRY( "TestIIDSetAttributesL", CTestSDKSkins::TestIIDSetAttributesL ),
+        ENTRY( "TestIIDAttributesL", CTestSDKSkins::TestIIDAttributesL ),
+        ENTRY( "TestIIDSetParentIIDL", CTestSDKSkins::TestIIDSetParentIIDL ),
+        ENTRY( "TestIIDSetDrawRectL", CTestSDKSkins::TestIIDSetDrawRectL ),
+        ENTRY( "TestIIDParentIIDL", CTestSDKSkins::TestIIDParentIIDL ),
+        ENTRY( "TestIIDDrawRectL", CTestSDKSkins::TestIIDDrawRectL ),
+        ENTRY( "TestBIDNewL", CTestSDKSkins::TestBIDNewL ),
+        ENTRY( "TestBIDSetBitmapL", CTestSDKSkins::TestBIDSetBitmapL ),
+        ENTRY( "TestBIDDestroyAndSetBitmapL", CTestSDKSkins::TestBIDDestroyAndSetBitmapL ),
+        ENTRY( "TestBIDBitmapL", CTestSDKSkins::TestBIDBitmapL ),
+        ENTRY( "TestMBIDNewL", CTestSDKSkins::TestMBIDNewL ),
+        ENTRY( "TestMBIDSetMaskL", CTestSDKSkins::TestMBIDSetMaskL ),
+        ENTRY( "TestMBIDDestroyAndSetMaskL", CTestSDKSkins::TestMBIDDestroyAndSetMaskL ),
+        ENTRY( "TestMBIDMaskL", CTestSDKSkins::TestMBIDMaskL ),
+        ENTRY( "TestCTIDNewL", CTestSDKSkins::TestCTIDNewL ),
+        ENTRY( "TestCTIDSetColorsL", CTestSDKSkins::TestCTIDSetColorsL ),
+        ENTRY( "TestCTIDColorIndexedL", CTestSDKSkins::TestCTIDColorIndexedL ),
+        ENTRY( "TestCTIDColorRgbL", CTestSDKSkins::TestCTIDColorRgbL ),
+        ENTRY( "TestCTIDGetColorL", CTestSDKSkins::TestCTIDGetColorL ),
+        ENTRY( "TestITIDNewL", CTestSDKSkins::TestITIDNewL ),
+        ENTRY( "TestITIDSetImagesL", CTestSDKSkins::TestITIDSetImagesL ),
+        ENTRY( "TestITIDImageIIDL", CTestSDKSkins::TestITIDImageIIDL ),
+        ENTRY( "TestITIDImagesL", CTestSDKSkins::TestITIDImagesL ),
+        ENTRY( "TestITIDNumberOfImagesL", CTestSDKSkins::TestITIDNumberOfImagesL ),
+        ENTRY( "TestBAIDNewL", CTestSDKSkins::TestBAIDNewL ),
+        ENTRY( "TestBAIDSetFrameInfosL", CTestSDKSkins::TestBAIDSetFrameInfosL ),
+        ENTRY( "TestBAIDFrameInfosL", CTestSDKSkins::TestBAIDFrameInfosL ),
+        ENTRY( "TestBAIDSetLastFrameBackgroundL", CTestSDKSkins::TestBAIDSetLastFrameBackgroundL ),
+        ENTRY( "TestBAIDLastFrameBackgroundL", CTestSDKSkins::TestBAIDLastFrameBackgroundL ),
+        ENTRY( "TestBAIDSetFrameIntervalL", CTestSDKSkins::TestBAIDSetFrameIntervalL ),
+        ENTRY( "TestBAIDFrameIntervalL", CTestSDKSkins::TestBAIDFrameIntervalL ),
+        ENTRY( "TestBAIDSetPlayModeL", CTestSDKSkins::TestBAIDSetPlayModeL ),
+        ENTRY( "TestBAIDPlayModeL", CTestSDKSkins::TestBAIDPlayModeL ),
+        ENTRY( "TestBAIDSetFlashL", CTestSDKSkins::TestBAIDSetFlashL ),
+        ENTRY( "TestBAIDFlashL", CTestSDKSkins::TestBAIDFlashL ),
+        ENTRY( "TestSIDNewL", CTestSDKSkins::TestSIDNewL ),
+        ENTRY( "TestSIDSetStringL", CTestSDKSkins::TestSIDSetStringL ),
+        ENTRY( "TestSIDStringL", CTestSDKSkins::TestSIDStringL ),
+        ENTRY( "TestECNewL", CTestSDKSkins::TestECNewL ),
+        ENTRY( "TestECSetEffectUidL", CTestSDKSkins::TestECSetEffectUidL ),
+        ENTRY( "TestECEffectUidL", CTestSDKSkins::TestECEffectUidL ),
+        ENTRY( "TestECSetLayerConfL", CTestSDKSkins::TestECSetLayerConfL ),
+        ENTRY( "TestECLayerConfL", CTestSDKSkins::TestECLayerConfL ),
+        ENTRY( "TestECAppendParameterL", CTestSDKSkins::TestECAppendParameterL ),
+        ENTRY( "TestECCreateParameterIteratorL", CTestSDKSkins::TestECCreateParameterIteratorL ),
+        ENTRY( "TestEQIDNewL", CTestSDKSkins::TestEQIDNewL ),
+        ENTRY( "TestEQIDSetRefItemL", CTestSDKSkins::TestEQIDSetRefItemL ),
+        ENTRY( "TestEQIDRefItemL", CTestSDKSkins::TestEQIDRefItemL ),
+        ENTRY( "TestEQIDSetInputLayerL", CTestSDKSkins::TestEQIDSetInputLayerL ),
+        ENTRY( "TestEQIDInputLayerL", CTestSDKSkins::TestEQIDInputLayerL ),
+        ENTRY( "TestEQIDSetInputLayerModeL", CTestSDKSkins::TestEQIDSetInputLayerModeL ),
+        ENTRY( "TestEQIDInputLayerModeL", CTestSDKSkins::TestEQIDInputLayerModeL ),
+        ENTRY( "TestEQIDSetOutputLayerL", CTestSDKSkins::TestEQIDSetOutputLayerL ),
+        ENTRY( "TestEQIDOutputLayerL", CTestSDKSkins::TestEQIDOutputLayerL ),
+        ENTRY( "TestEQIDSetOutputLayerModeL", CTestSDKSkins::TestEQIDSetOutputLayerModeL ),
+        ENTRY( "TestEQIDOutputLayerModeL", CTestSDKSkins::TestEQIDOutputLayerModeL ),
+        ENTRY( "TestEQIDAppendCommandL", CTestSDKSkins::TestEQIDAppendCommandL ),
+        ENTRY( "TestEQIDCreateCommandIteratorL", CTestSDKSkins::TestEQIDCreateCommandIteratorL ),
+        
+
+        ENTRY( "TestIILinearOrder", CTestSDKSkins::TestIILinearOrder ),
+        
+        ENTRY( "TestLBCCNewL", CTestSDKSkins::TestLBCCNewL ),
+        ENTRY( "TestLBCCSetLayerImageL", CTestSDKSkins::TestLBCCSetLayerImageL ),
+        ENTRY( "TestLBCCSetLayerRectL", CTestSDKSkins::TestLBCCSetLayerRectL ),
+        
+        ENTRY( "TestLBBCCNewL", CTestSDKSkins::TestLBBCCNewL ),
+        ENTRY( "TestLBBCCSetTiledBitmapL", CTestSDKSkins::TestLBBCCSetTiledBitmapL ),
+        ENTRY( "TestLBBCCSetTiledRectL", CTestSDKSkins::TestLBBCCSetTiledRectL ),
+        ENTRY( "TestLBBCCSetBottomBitmapL", CTestSDKSkins::TestLBBCCSetBottomBitmapL ),
+        ENTRY( "TestLBBCCSetBottomRectL", CTestSDKSkins::TestLBBCCSetBottomRectL ),
+        
+        ENTRY( "TestWUSetIdleWallpaper", CTestSDKSkins::TestWUSetIdleWallpaper ),
+        ENTRY( "TestWUSetSlidesetWallpaperL", CTestSDKSkins::TestWUSetSlidesetWallpaperL ),
+        
+        ENTRY( "TestUInitSkinSupportL", CTestSDKSkins::TestUInitSkinSupportL ),
+        ENTRY( "TestUCreateDataContextForContainerL", CTestSDKSkins::TestUCreateDataContextForContainerL ),
+        ENTRY( "TestUCreateBitmapItemDefL", CTestSDKSkins::TestUCreateBitmapItemDefL ),
+        ENTRY( "TestUCreateMaskedBitmapItemDefL", CTestSDKSkins::TestUCreateMaskedBitmapItemDefL ),
+        ENTRY( "TestUSkinInstanceL", CTestSDKSkins::TestUSkinInstanceL ),
+        ENTRY( "TestUDataContextL", CTestSDKSkins::TestUDataContextL ),
+        ENTRY( "TestUCreateIconML", CTestSDKSkins::TestUCreateIconML ),
+        ENTRY( "TestUCreateIconMLC", CTestSDKSkins::TestUCreateIconMLC ),
+        ENTRY( "TestUCreateIconL", CTestSDKSkins::TestUCreateIconL ),
+        ENTRY( "TestUCreateIconLC", CTestSDKSkins::TestUCreateIconLC ),
+        ENTRY( "TestUCreateMaskedBitmapL", CTestSDKSkins::TestUCreateMaskedBitmapL ),
+        ENTRY( "TestUCreateGulIconL", CTestSDKSkins::TestUCreateGulIconL ),
+        ENTRY( "TestUCreateAppIconLC", CTestSDKSkins::TestUCreateAppIconLC ),
+        ENTRY( "TestUOpenAppIconFileL", CTestSDKSkins::TestUOpenAppIconFileL ),
+        ENTRY( "TestUCreateColorIconL", CTestSDKSkins::TestUCreateColorIconL ),
+        ENTRY( "TestUCreateColorIconLC", CTestSDKSkins::TestUCreateColorIconLC ),
+        ENTRY( "TestUCreateColorIconML", CTestSDKSkins::TestUCreateColorIconML ),
+        ENTRY( "TestUCreateColorIconMLC", CTestSDKSkins::TestUCreateColorIconMLC ),
+        ENTRY( "TestUGetAppIconL", CTestSDKSkins::TestUGetAppIconL ),
+        ENTRY( "TestUCreateBitmapL", CTestSDKSkins::TestUCreateBitmapL ),
+        ENTRY( "TestUCreateMaskedBitmapIL", CTestSDKSkins::TestUCreateMaskedBitmapIL ),
+        ENTRY( "TestUCreateGulIconIL", CTestSDKSkins::TestUCreateGulIconIL ),
+        ENTRY( "TestUGetCachedBitmapL", CTestSDKSkins::TestUGetCachedBitmapL ),
+        ENTRY( "TestUGetCachedMaskedBitmapL", CTestSDKSkins::TestUGetCachedMaskedBitmapL ),
+        ENTRY( "TestUGetCachedColorL", CTestSDKSkins::TestUGetCachedColorL ),
+        ENTRY( "TestUBooleanPropertyL", CTestSDKSkins::TestUBooleanPropertyL ),
+        ENTRY( "TestUSetAvkonSkinEnabledL", CTestSDKSkins::TestUSetAvkonSkinEnabledL ),
+        ENTRY( "TestUAvkonSkinEnabledL", CTestSDKSkins::TestUAvkonSkinEnabledL ),
+        ENTRY( "TestUSetAvkonHighlightAnimationEnabledL", CTestSDKSkins::TestUSetAvkonHighlightAnimationEnabledL ),
+        ENTRY( "TestUAvkonHighlightAnimationEnabledL", CTestSDKSkins::TestUAvkonHighlightAnimationEnabledL ),
+        ENTRY( "TestURegisterControlPositionL", CTestSDKSkins::TestURegisterControlPositionL ),
+        ENTRY( "TestURegisterControlPositionPL", CTestSDKSkins::TestURegisterControlPositionPL ),
+        ENTRY( "TestUDeregisterControlPositionL", CTestSDKSkins::TestUDeregisterControlPositionL ),
+        ENTRY( "TestUGetControlPositionL", CTestSDKSkins::TestUGetControlPositionL ),
+        };
+
+    const TInt count = sizeof( KFunctions ) / sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/src/testsdkskinsblocksbbcc.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,132 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Test AknsBasicBackgroundControlContext.h
+*
+*/
+
+
+#include <aknsbasicbackgroundcontrolcontext.h>
+
+#include "testsdkskins.h"
+
+const TInt KLength = 10;
+// ============================ MEMBER FUNCTIONS ===============================
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestBBCCNewL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestBBCCNewL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    TRect rect( pointTL, pointBR );
+    CAknsBasicBackgroundControlContext* context = 
+        CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue );
+    CleanupStack::PushL( context );
+    
+    STIF_ASSERT_NOT_NULL( context );
+    
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestBBCCSetBitmapL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestBBCCSetBitmapL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    TRect rect( pointTL, pointBR );
+    CAknsBasicBackgroundControlContext* context = 
+        CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    context->SetBitmap( itemID );
+    
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestBBCCSetRectL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestBBCCSetRectL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    TRect rect( pointTL, pointBR );
+    CAknsBasicBackgroundControlContext* context = 
+        CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    context->SetRect( rect );
+    
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestBBCCSetParentPosL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestBBCCSetParentPosL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    TRect rect( pointTL, pointBR );
+    CAknsBasicBackgroundControlContext* context = 
+        CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    context->SetParentPos( pointBR );
+    
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestBBCCSetParentContextL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestBBCCSetParentContextL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    TRect rect( pointTL, pointBR );
+    CAknsBasicBackgroundControlContext* context = 
+        CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    context->SetParentContext( context );
+    
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/src/testsdkskinsblockscc.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Test AknsControlContext.h
+*
+*/
+
+
+#include <aknscontrolcontext.h>
+#include <aknsbasicbackgroundcontrolcontext.h>
+
+#include "testsdkskins.h"
+
+const TInt KLength = 10;
+// ============================ MEMBER FUNCTIONS ===============================
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestCCSupplyMopObjectL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestCCSupplyMopObjectL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    TRect rect( pointTL, pointBR );
+    CAknsBasicBackgroundControlContext* context = 
+        CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    TTypeUid::Ptr ptr = TTypeUid::Null();
+    ptr = context->SupplyMopObject( MAknsControlContext::ETypeId, context );
+    CAknsBasicBackgroundControlContext* point = 
+        static_cast<CAknsBasicBackgroundControlContext*> ( ptr.Pointer() );
+    STIF_ASSERT_NOT_NULL( point );
+    
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/src/testsdkskinsblocksdc.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Test AknsDataContext.h
+*
+*/
+
+
+#include <aknsdatacontext.h>
+#include <aknsutils.h>
+
+#include "testsdkskins.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+//------------------------------------------------------------------------------
+// CTestSDKSkins::TestDCSupplyMopObjectL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestDCSupplyMopObjectL( CStifItemParser& /*aItem*/ )
+    {
+    MAknsDataContext* context = AknsUtils::CreateDataContextForContainerL();
+    STIF_ASSERT_NOT_NULL( context );
+    
+    TTypeUid::Ptr ptr = TTypeUid::Null();
+    ptr = context->SupplyMopObject( MAknsDataContext::ETypeId, context );
+    MAknsDataContext* point = static_cast<MAknsDataContext*> ( ptr.Pointer() );
+    STIF_ASSERT_NOT_NULL( point );
+    
+    delete context;
+    context = NULL;
+    
+    return KErrNone;
+    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/src/testsdkskinsblocksdu.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,642 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Test AknsDrawUtils.h
+*
+*/
+
+
+#include <aknsdrawutils.h>
+#include <aknsbasicbackgroundcontrolcontext.h>
+
+#include "testsdkskins.h"
+#include "testsdkskinsobjectprovider.h"
+#include "testsdkskinscontrol.h"
+
+const TInt KLength = 10;
+
+// ============================ MEMBER FUNCTIONS ===============================
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestDUControlContextL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestDUControlContextL( CStifItemParser& /*aItem*/ )
+    {
+    CTestSDKSkinsObjectProvider* provider = new (ELeave) CTestSDKSkinsObjectProvider;
+    CleanupStack::PushL( provider );
+    STIF_ASSERT_NOT_NULL( provider );
+    
+    MAknsControlContext* context = AknsDrawUtils::ControlContext( provider );
+    CleanupStack::PushL( context );
+    
+    CleanupStack::PopAndDestroy( context );
+    CleanupStack::PopAndDestroy( provider );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestDUControlContextOfParentL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestDUControlContextOfParentL( CStifItemParser& /*aItem*/ )
+    {
+    CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL();
+    CleanupStack::PushL( control );
+    STIF_ASSERT_NOT_NULL( control );
+    
+    MAknsControlContext* context = AknsDrawUtils::ControlContextOfParent( control );
+    CleanupStack::PushL( context );
+    
+    CleanupStack::PopAndDestroy( context );
+    CleanupStack::PopAndDestroy( control );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestDUBackgroundL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestDUBackgroundL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    TRect rect( pointTL, pointBR );
+    CAknsBasicBackgroundControlContext* context = 
+        CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    CWindowGc& gc = CCoeEnv::Static()->SystemGc();
+
+    CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL();
+    CleanupStack::PushL( control );
+    STIF_ASSERT_NOT_NULL( control );
+    control->ActivateGc();
+    
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    
+    TBool draw = AknsDrawUtils::Background( instance, 
+                                            context, 
+                                            gc, 
+                                            rect );
+    
+    control->DeactivateGc();
+    CleanupStack::PopAndDestroy( control );
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestDUBackgroundFPL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestDUBackgroundFPL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    TRect rect( pointTL, pointBR );
+    CAknsBasicBackgroundControlContext* context = 
+        CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    CWindowGc& gc = CCoeEnv::Static()->SystemGc();
+    
+    CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL();
+    CleanupStack::PushL( control );
+    STIF_ASSERT_NOT_NULL( control );
+    control->ActivateGc();
+    
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    
+    TBool draw = AknsDrawUtils::Background( instance, 
+                                            context, 
+                                            control, 
+                                            gc, 
+                                            rect );
+    
+    control->DeactivateGc();
+    CleanupStack::PopAndDestroy( control );
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestDUBackgroundSPL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestDUBackgroundSPL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    TRect rect( pointTL, pointBR );
+    CAknsBasicBackgroundControlContext* context = 
+        CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    CWindowGc& gc = CCoeEnv::Static()->SystemGc();
+    
+    CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL();
+    CleanupStack::PushL( control );
+    STIF_ASSERT_NOT_NULL( control );
+    
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    control->ActivateGc();
+    
+    TBool draw = AknsDrawUtils::Background( instance, 
+                                            context, 
+                                            control, 
+                                            gc, 
+                                            rect, 
+                                            KAknsDrawParamDefault );
+    
+    control->DeactivateGc();
+    CleanupStack::PopAndDestroy( control );
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestDUDrawBackgroundL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestDUDrawBackgroundL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    TRect rect( pointTL, pointBR );
+    CAknsBasicBackgroundControlContext* context = 
+        CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    CWindowGc& gc = CCoeEnv::Static()->SystemGc();
+    
+    CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL();
+    CleanupStack::PushL( control );
+    STIF_ASSERT_NOT_NULL( control );
+    
+    control->ActivateGc();
+    
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    
+    TBool draw = AknsDrawUtils::DrawBackground( instance, 
+                                                context, 
+                                                control, 
+                                                gc, 
+                                                pointTL, 
+                                                rect, 
+                                                KAknsDrawParamDefault );
+    
+    control->DeactivateGc();
+    CleanupStack::PopAndDestroy( control );
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestDUBackgroundBetweenRectsFPL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestDUBackgroundBetweenRectsFPL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    TRect rect( pointTL, pointBR );
+    CAknsBasicBackgroundControlContext* context = 
+        CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    CWindowGc& gc = CCoeEnv::Static()->SystemGc();
+    
+    const TInt KOutPoint = 50;
+    TPoint outPoint( KOutPoint, KOutPoint );
+    const TInt KInPoint = 40;
+    TPoint inPoint( KInPoint, KInPoint );
+    TRect outRect( pointTL, outPoint );
+    TRect inRect( pointBR, inPoint );
+    
+    CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL();
+    CleanupStack::PushL( control );
+    STIF_ASSERT_NOT_NULL( control );
+    
+    control->ActivateGc();
+    
+    TBool draw = AknsDrawUtils::BackgroundBetweenRects( AknsUtils::SkinInstance(), 
+                                                        context, 
+                                                        gc, 
+                                                        outRect, 
+                                                        inRect );
+
+    control->DeactivateGc();
+    CleanupStack::PopAndDestroy( control );
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestDUBackgroundBetweenRectsL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestDUBackgroundBetweenRectsL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    TRect rect( pointTL, pointBR );
+    CAknsBasicBackgroundControlContext* context = 
+        CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    CWindowGc& gc = CCoeEnv::Static()->SystemGc();
+    
+    CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL();
+    CleanupStack::PushL( control );
+    STIF_ASSERT_NOT_NULL( control );
+    control->ActivateGc();
+    
+    const TInt KOutPoint = 50;
+    TPoint outPoint( KOutPoint, KOutPoint );
+    const TInt KInPoint = 40;
+    TPoint inPoint( KInPoint, KInPoint );
+    TRect outRect( pointTL, outPoint );
+    TRect inRect( pointBR, inPoint );
+    
+    TBool draw = AknsDrawUtils::BackgroundBetweenRects( AknsUtils::SkinInstance(), 
+                                                        context, 
+                                                        control, 
+                                                        gc, 
+                                                        outRect, 
+                                                        inRect );
+
+    control->DeactivateGc();
+    CleanupStack::PopAndDestroy( control );
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestDUBackgroundBetweenRectsSPL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestDUBackgroundBetweenRectsSPL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    TRect rect( pointTL, pointBR );
+    CAknsBasicBackgroundControlContext* context = 
+        CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    CWindowGc& gc = CCoeEnv::Static()->SystemGc();
+    
+    CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL();
+    CleanupStack::PushL( control );
+    STIF_ASSERT_NOT_NULL( control );
+    control->ActivateGc();
+    
+    const TInt KOutPoint = 50;
+    TPoint outPoint( KOutPoint, KOutPoint );
+    const TInt KInPoint = 40;
+    TPoint inPoint( KInPoint, KInPoint );
+    TRect outRect( pointTL, outPoint );
+    TRect inRect( pointBR, inPoint );
+    
+    TBool draw = AknsDrawUtils::BackgroundBetweenRects( AknsUtils::SkinInstance(), 
+                                                        context, 
+                                                        control, 
+                                                        gc, 
+                                                        outRect, 
+                                                        inRect, 
+                                                        KAknsDrawParamDefault );
+
+    control->DeactivateGc();
+    CleanupStack::PopAndDestroy( control );
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestDUHasBitmapBackgroundL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestDUHasBitmapBackgroundL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    TRect rect( pointTL, pointBR );
+    CAknsBasicBackgroundControlContext* context = 
+        CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    TBool draw = AknsDrawUtils::HasBitmapBackground( AknsUtils::SkinInstance(), 
+                                                     context );
+    STIF_ASSERT_TRUE( draw );
+    
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestDUDrawCachedImageL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestDUDrawCachedImageL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    
+    CWindowGc& gc = CCoeEnv::Static()->SystemGc();
+    
+    CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL();
+    CleanupStack::PushL( control );
+    STIF_ASSERT_NOT_NULL( control );
+    control->ActivateGc();
+    
+    const TInt KOutPoint = 50;
+    TPoint pointTL( 0, 0 );
+    TPoint outPoint( KOutPoint, KOutPoint );
+    TRect outRect( pointTL, outPoint );
+    
+    AknsDrawUtils::DrawCachedImage( AknsUtils::SkinInstance(),
+                                    gc, 
+                                    outRect, 
+                                    itemID );
+
+    control->DeactivateGc();
+    CleanupStack::PopAndDestroy( control );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestDUDrawCachedImageFBSL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestDUDrawCachedImageFBSL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    
+    CFbsBitGc* gc = NULL;
+    
+    CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL();
+    CleanupStack::PushL( control );
+    STIF_ASSERT_NOT_NULL( control );
+    control->ActivateGc();
+    
+    const TInt KOutPoint = 50;
+    TPoint pointTL( 0, 0 );
+    TPoint outPoint( KOutPoint, KOutPoint );
+    TRect outRect( pointTL, outPoint );
+    
+    AknsDrawUtils::DrawCachedImage( AknsUtils::SkinInstance(),
+                                    *gc, 
+                                    outRect, 
+                                    itemID );
+
+    control->DeactivateGc();
+    CleanupStack::PopAndDestroy( control );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestDUDrawFrameL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestDUDrawFrameL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID frameID;
+    TAknsItemID centerID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    
+    CWindowGc& gc = CCoeEnv::Static()->SystemGc();
+    
+    CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL();
+    CleanupStack::PushL( control );
+    STIF_ASSERT_NOT_NULL( control );
+    control->ActivateGc();
+    
+    const TInt KOutPoint = 50;
+    TPoint outPoint( KOutPoint, KOutPoint );
+    const TInt KInPoint = 40;
+    TPoint inPoint( KInPoint, KInPoint );
+    TRect outRect( pointTL, outPoint );
+    TRect inRect( pointBR, inPoint );
+    
+    TBool draw = AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(), 
+                                           gc, 
+                                           outRect, 
+                                           inRect, 
+                                           frameID, 
+                                           centerID );
+
+    control->DeactivateGc();
+    CleanupStack::PopAndDestroy( control );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestDUPrepareFrameL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestDUPrepareFrameL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID frameID;
+    TAknsItemID centerID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    
+    CWindowGc& gc = CCoeEnv::Static()->SystemGc();
+    
+    CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL();
+    CleanupStack::PushL( control );
+    STIF_ASSERT_NOT_NULL( control );
+    control->ActivateGc();
+    
+    const TInt KOutPoint = 50;
+    TPoint outPoint( KOutPoint, KOutPoint );
+    const TInt KInPoint = 40;
+    TPoint inPoint( KInPoint, KInPoint );
+    TRect outRect( pointTL, outPoint );
+    TRect inRect( pointBR, inPoint );
+    
+    TBool draw = AknsDrawUtils::PrepareFrame( AknsUtils::SkinInstance(), 
+                                              outRect, 
+                                              inRect, 
+                                              frameID, 
+                                              centerID );
+
+    control->DeactivateGc();
+    CleanupStack::PopAndDestroy( control );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestDUDrawFrameSPL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestDUDrawFrameSPL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID frameID;
+    TAknsItemID centerID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    
+    CFbsBitGc* gc = NULL;
+    
+    CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL();
+    CleanupStack::PushL( control );
+    STIF_ASSERT_NOT_NULL( control );
+    control->ActivateGc();
+    
+    const TInt KOutPoint = 50;
+    TPoint outPoint( KOutPoint, KOutPoint );
+    const TInt KInPoint = 40;
+    TPoint inPoint( KInPoint, KInPoint );
+    TRect outRect( pointTL, outPoint );
+    TRect inRect( pointBR, inPoint );
+    
+    TBool draw = AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(), 
+                                           *gc, 
+                                           outRect, 
+                                           inRect, 
+                                           frameID, 
+                                           centerID, 
+                                           KAknsDrawParamDefault );
+
+    control->DeactivateGc();
+    CleanupStack::PopAndDestroy( control );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestDUDrawFrameFBSL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestDUDrawFrameFBSL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID frameID;
+    TAknsItemID centerID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    
+    CFbsBitGc* gc = NULL;
+    
+    CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL();
+    CleanupStack::PushL( control );
+    STIF_ASSERT_NOT_NULL( control );
+    control->ActivateGc();
+    
+    const TInt KOutPoint = 50;
+    TPoint outPoint( KOutPoint, KOutPoint );
+    const TInt KInPoint = 40;
+    TPoint inPoint( KInPoint, KInPoint );
+    TRect outRect( pointTL, outPoint );
+    TRect inRect( pointBR, inPoint );
+    
+    TBool draw = AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(), 
+                                           *gc, 
+                                           outRect, 
+                                           inRect, 
+                                           frameID, 
+                                           centerID );
+
+    control->DeactivateGc();
+    CleanupStack::PopAndDestroy( control );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestDUDrawFramePartL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestDUDrawFramePartL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    
+    CWindowGc& gc = CCoeEnv::Static()->SystemGc();
+    
+    CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL();
+    CleanupStack::PushL( control );
+    STIF_ASSERT_NOT_NULL( control );
+    control->ActivateGc();
+    
+    const TInt KOutPoint = 50;
+    TPoint outPoint( KOutPoint, KOutPoint );
+    TRect rect( pointTL, outPoint );
+    
+    TBool draw = AknsDrawUtils::DrawFramePart( AknsUtils::SkinInstance(), 
+                                           gc, 
+                                           rect,
+                                           itemID, 
+                                           EAknsFrameIndexTl  );
+
+    control->DeactivateGc();
+    CleanupStack::PopAndDestroy( control );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestDUIsListSeperatorLines
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestDUIsListSeperatorLines( CStifItemParser& /*aItem*/ )
+    {
+    TBool seperator = AknsDrawUtils::IsListSeperatorLines( AknsUtils::SkinInstance() );
+    STIF_ASSERT_TRUE( seperator );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestDUSlidingMode
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestDUSlidingMode( CStifItemParser& /*aItem*/ )
+    {
+    TSlidingMode mode = AknsDrawUtils::SlidingMode( AknsUtils::SkinInstance() );
+    STIF_ASSERT_TRUE( mode == ESlidingDisabled );
+    
+    return KErrNone;
+    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/src/testsdkskinsblocksfbcc.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,181 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Test AknsFrameBackgroundControlContext.h
+*
+*/
+
+
+#include <aknsframebackgroundcontrolcontext.h>
+
+#include "testsdkskins.h"
+
+const TInt KLength = 10;
+// ============================ MEMBER FUNCTIONS ===============================
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestFBCCNewL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestFBCCNewL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    const TInt KOutPoint = 50;
+    TPoint outPoint( KOutPoint, KOutPoint );
+    const TInt KInPoint = 40;
+    TPoint inPoint( KInPoint, KInPoint );
+    TRect outRect( pointTL, outPoint );
+    TRect inRect( pointBR, inPoint );
+    
+    CAknsFrameBackgroundControlContext* context = 
+        CAknsFrameBackgroundControlContext::NewL( itemID, 
+                                                  outRect, 
+                                                  inRect, 
+                                                  ETrue );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestFBCCSetFrameL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestFBCCSetFrameL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    const TInt KOutPoint = 50;
+    TPoint outPoint( KOutPoint, KOutPoint );
+    const TInt KInPoint = 40;
+    TPoint inPoint( KInPoint, KInPoint );
+    TRect outRect( pointTL, outPoint );
+    TRect inRect( pointBR, inPoint );
+    
+    CAknsFrameBackgroundControlContext* context = 
+        CAknsFrameBackgroundControlContext::NewL( itemID, 
+                                                  outRect, 
+                                                  inRect, 
+                                                  ETrue );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    context->SetFrame( itemID );
+    
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestFBCCSetFrameRectsL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestFBCCSetFrameRectsL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    const TInt KOutPoint = 50;
+    TPoint outPoint( KOutPoint, KOutPoint );
+    const TInt KInPoint = 40;
+    TPoint inPoint( KInPoint, KInPoint );
+    TRect outRect( pointTL, outPoint );
+    TRect inRect( pointBR, inPoint );
+    
+    CAknsFrameBackgroundControlContext* context = 
+        CAknsFrameBackgroundControlContext::NewL( itemID, 
+                                                  outRect, 
+                                                  inRect, 
+                                                  ETrue );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    context->SetFrameRects( outRect, inRect );
+    
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestFBCCSetCenterL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestFBCCSetCenterL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    const TInt KOutPoint = 50;
+    TPoint outPoint( KOutPoint, KOutPoint );
+    const TInt KInPoint = 40;
+    TPoint inPoint( KInPoint, KInPoint );
+    TRect outRect( pointTL, outPoint );
+    TRect inRect( pointBR, inPoint );
+    
+    CAknsFrameBackgroundControlContext* context = 
+        CAknsFrameBackgroundControlContext::NewL( itemID, 
+                                                  outRect, 
+                                                  inRect, 
+                                                  ETrue );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    context->SetCenter( itemID );
+    
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestFBCCSetFramePartRectL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestFBCCSetFramePartRectL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    const TInt KOutPoint = 50;
+    TPoint outPoint( KOutPoint, KOutPoint );
+    const TInt KInPoint = 40;
+    TPoint inPoint( KInPoint, KInPoint );
+    TRect outRect( pointTL, outPoint );
+    TRect inRect( pointBR, inPoint );
+    
+    CAknsFrameBackgroundControlContext* context = 
+        CAknsFrameBackgroundControlContext::NewL( itemID, 
+                                                  outRect, 
+                                                  inRect, 
+                                                  ETrue );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    context->SetFramePartRect( outRect, EAknsFrameIndexTl );
+    
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/src/testsdkskinsblocksid.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,978 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Test AknsItemData.h
+*
+*/
+
+
+#include <aknsitemdata.h>
+#include <aknsimageattributedata.h>
+#include <aknsitemdef.h>
+#include <aknsconstants.h>
+#include <eikcolor.hrh>
+
+#include "testsdkskins.h"
+
+const TInt KLength = 10;
+// ============================ MEMBER FUNCTIONS ===============================
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestIDTypeL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestIDTypeL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsBitmapItemData* itemData = CAknsBitmapItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    TAknsItemType typeGet = itemData->Type();
+    STIF_ASSERT_TRUE( typeGet == EAknsITBitmap );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestIIDSetAttributesL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestIIDSetAttributesL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsBitmapItemData* itemData = CAknsBitmapItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    TAknsImageAttributeData attributeData;
+    itemData->SetAttributesL( attributeData );
+    STIF_ASSERT_NOT_NULL( itemData->Attributes() );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestIIDAttributesL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestIIDAttributesL( CStifItemParser& aItem )
+    {
+    return TestIIDSetAttributesL( aItem );
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestIIDSetParentIIDL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestIIDSetParentIIDL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsBitmapItemData* itemData = CAknsBitmapItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    TAknsItemID itemID;
+    itemData->SetParentIID( itemID );
+    STIF_ASSERT_TRUE( itemID.iMajor == itemData->ParentIID().iMajor );
+    STIF_ASSERT_TRUE( itemID.iMinor == itemData->ParentIID().iMinor );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestIIDSetDrawRectL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestIIDSetDrawRectL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsBitmapItemData* itemData = CAknsBitmapItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    TRect rect( pointTL, pointBR );
+    itemData->SetDrawRect( rect );
+    STIF_ASSERT_TRUE( rect == itemData->DrawRect() );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestIIDParentIIDL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestIIDParentIIDL( CStifItemParser& aItem )
+    {
+    return TestIIDSetParentIIDL( aItem );
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestIIDDrawRectL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestIIDDrawRectL( CStifItemParser& aItem )
+    {
+    return TestIIDSetDrawRectL( aItem );
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestBIDNewL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestBIDNewL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsBitmapItemData* itemData = CAknsBitmapItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestBIDSetBitmapL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestBIDSetBitmapL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsBitmapItemData* itemData = CAknsBitmapItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    CFbsBitmap* bitMap = new (ELeave) CFbsBitmap;
+    CleanupStack::PushL( bitMap );
+    itemData->SetBitmap( bitMap );
+    
+    STIF_ASSERT_TRUE( bitMap == itemData->Bitmap() );
+    
+    CleanupStack::Pop( bitMap );
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestBIDDestroyAndSetBitmapL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestBIDDestroyAndSetBitmapL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsBitmapItemData* itemData = CAknsBitmapItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    CFbsBitmap* bitMap = new (ELeave) CFbsBitmap;
+    CleanupStack::PushL( bitMap );
+    itemData->DestroyAndSetBitmap( bitMap );
+    
+    CleanupStack::Pop( bitMap );
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestBIDBitmapL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestBIDBitmapL( CStifItemParser& aItem )
+    {
+    return TestBIDSetBitmapL( aItem );
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestMBIDNewL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestMBIDNewL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsMaskedBitmapItemData* itemData = CAknsMaskedBitmapItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestMBIDSetMaskL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestMBIDSetMaskL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsMaskedBitmapItemData* itemData = CAknsMaskedBitmapItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+
+    CFbsBitmap* bitMapMask = new (ELeave) CFbsBitmap;
+    CleanupStack::PushL( bitMapMask );
+    itemData->SetMask( bitMapMask );
+    
+    STIF_ASSERT_TRUE( bitMapMask == itemData->Mask() );
+    
+    CleanupStack::Pop( bitMapMask );
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestMBIDDestroyAndSetMaskL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestMBIDDestroyAndSetMaskL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsMaskedBitmapItemData* itemData = CAknsMaskedBitmapItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+
+    CFbsBitmap* bitMapMask = new (ELeave) CFbsBitmap;
+    CleanupStack::PushL( bitMapMask );
+    itemData->DestroyAndSetBitmap( bitMapMask );
+    
+    CleanupStack::Pop( bitMapMask );
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestMBIDMaskL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestMBIDMaskL( CStifItemParser& aItem )
+    {
+    return TestMBIDSetMaskL( aItem );
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestCTIDNewL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestCTIDNewL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsColorTableItemData* itemData = CAknsColorTableItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestCTIDSetColorsL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestCTIDSetColorsL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsColorTableItemData* itemData = CAknsColorTableItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    TAknsColorTableEntry* color = new (ELeave) TAknsColorTableEntry[1];
+    color->iIndex = 0;
+    color->iRgb = 0x00020408;
+    itemData->SetColorsL( 1, color );
+
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestCTIDColorIndexedL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestCTIDColorIndexedL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsColorTableItemData* itemData = CAknsColorTableItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    TAknsColorTableEntry* color = new (ELeave) TAknsColorTableEntry[1];
+    color->iIndex = 0;
+    color->iRgb = 0x00020408;
+    itemData->SetColorsL( 1, color );
+    
+    TInt value = itemData->ColorIndexed( 0 );
+
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestCTIDColorRgbL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestCTIDColorRgbL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsColorTableItemData* itemData = CAknsColorTableItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    TAknsColorTableEntry* color = new (ELeave) TAknsColorTableEntry[1];
+    color->iIndex = 0;
+    color->iRgb = 0x00020408;
+    itemData->SetColorsL( 1, color );
+    
+    TRgb rgb = itemData->ColorRgb( 0 );
+
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestCTIDGetColorL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestCTIDGetColorL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsColorTableItemData* itemData = CAknsColorTableItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    TAknsColorTableEntry* color = new (ELeave) TAknsColorTableEntry[1];
+    color->iIndex = 0;
+    color->iRgb = 0x00020408;
+    itemData->SetColorsL( 1, color );
+    
+    TRgb rgb; 
+    itemData->GetColorL( 0, rgb );
+
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestITIDNewL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestITIDNewL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsImageTableItemData* itemData = CAknsImageTableItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestITIDSetImagesL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestITIDSetImagesL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsImageTableItemData* itemData = CAknsImageTableItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+
+    TAknsItemID itemID;
+    itemData->SetImagesL( 1, &itemID );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestITIDImageIIDL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestITIDImageIIDL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsImageTableItemData* itemData = CAknsImageTableItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+
+    TAknsItemID itemID;
+    itemData->SetImagesL( 1, &itemID );
+    TAknsItemID itemIDGet = itemData->ImageIID( 0 );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestITIDImagesL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestITIDImagesL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsImageTableItemData* itemData = CAknsImageTableItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+
+    TAknsItemID itemID;
+    itemData->SetImagesL( 1, &itemID );
+    TAknsItemID* item = itemData->Images();
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestITIDNumberOfImagesL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestITIDNumberOfImagesL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsImageTableItemData* itemData = CAknsImageTableItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+
+    TAknsItemID itemID;
+    itemData->SetImagesL( 1, &itemID );
+    TInt num = itemData->NumberOfImages();
+    STIF_ASSERT_TRUE( 1 == num );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestBAIDNewL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestBAIDNewL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsBmpAnimItemData* itemData = CAknsBmpAnimItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestBAIDSetFrameInfosL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestBAIDSetFrameInfosL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsBmpAnimItemData* itemData = CAknsBmpAnimItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    TAknsBmpAnimFrameInfo info;
+    itemData->SetFrameInfosL( &info );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestBAIDFrameInfosL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestBAIDFrameInfosL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsBmpAnimItemData* itemData = CAknsBmpAnimItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    TAknsBmpAnimFrameInfo info;
+    itemData->SetFrameInfosL( &info );
+    TAknsBmpAnimFrameInfo* infoGet = itemData->FrameInfos();
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestBAIDSetLastFrameBackgroundL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestBAIDSetLastFrameBackgroundL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsBmpAnimItemData* itemData = CAknsBmpAnimItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    itemData->SetLastFrameBackground( ETrue );
+    STIF_ASSERT_TRUE( itemData->LastFrameBackground() );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestBAIDLastFrameBackgroundL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestBAIDLastFrameBackgroundL( CStifItemParser& aItem )
+    {
+    return TestBAIDSetLastFrameBackgroundL( aItem );
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestBAIDSetFrameIntervalL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestBAIDSetFrameIntervalL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsBmpAnimItemData* itemData = CAknsBmpAnimItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    itemData->SetFrameInterval( 1 );
+    STIF_ASSERT_TRUE( 1 == itemData->FrameInterval() );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestBAIDFrameIntervalL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestBAIDFrameIntervalL( CStifItemParser& aItem )
+    {
+    return TestBAIDSetFrameIntervalL( aItem );
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestBAIDSetPlayModeL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestBAIDSetPlayModeL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsBmpAnimItemData* itemData = CAknsBmpAnimItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    itemData->SetPlayMode( 1 );
+    STIF_ASSERT_TRUE( 1 == itemData->PlayMode() );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestBAIDPlayModeL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestBAIDPlayModeL( CStifItemParser& aItem )
+    {
+    return TestBAIDSetPlayModeL( aItem );
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestBAIDSetFlashL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestBAIDSetFlashL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsBmpAnimItemData* itemData = CAknsBmpAnimItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    itemData->SetFlash( ETrue );
+    STIF_ASSERT_TRUE( itemData->Flash() );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestBAIDFlashL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestBAIDFlashL( CStifItemParser& aItem )
+    {
+    return TestBAIDSetFlashL( aItem );
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestSIDNewL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestSIDNewL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsStringItemData* itemData = CAknsStringItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestSIDSetStringL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestSIDSetStringL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsStringItemData* itemData = CAknsStringItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    _LIT( KString, "string" );
+    TBuf<KLength> string( KString );
+    itemData->SetStringL( string );
+    TBuf<KLength> stringGet = itemData->String();
+    STIF_ASSERT_TRUE( 0 == stringGet.Compare( string ) );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestSIDStringL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestSIDStringL( CStifItemParser& aItem )
+    {
+    return TestSIDSetStringL( aItem );
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestECNewL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestECNewL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsEffectCommand* itemData = CAknsEffectCommand::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestECSetEffectUidL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestECSetEffectUidL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsEffectCommand* itemData = CAknsEffectCommand::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    TUid uid = TUid::Uid( 0 );
+    itemData->SetEffectUid( uid );
+    STIF_ASSERT_TRUE( uid == itemData->EffectUid() );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestECEffectUidL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestECEffectUidL( CStifItemParser& aItem )
+    {
+    return TestECSetEffectUidL( aItem );
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestECSetLayerConfL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestECSetLayerConfL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsEffectCommand* itemData = CAknsEffectCommand::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    TAknsRlRenderOpParam param;
+    param.iInputLayerAIndex = KLength;
+    itemData->SetLayerConf( param );
+    TAknsRlRenderOpParam paramGet = itemData->LayerConf();
+    STIF_ASSERT_TRUE( param.iInputLayerAIndex == paramGet.iInputLayerAIndex );
+    STIF_ASSERT_TRUE( param.iInputLayerAStatus == paramGet.iInputLayerAStatus );
+    STIF_ASSERT_TRUE( param.iInputLayerBIndex == paramGet.iInputLayerBIndex );
+    STIF_ASSERT_TRUE( param.iInputLayerBStatus == paramGet.iInputLayerBStatus );
+    STIF_ASSERT_TRUE( param.iOutputLayerIndex == paramGet.iOutputLayerIndex );
+    STIF_ASSERT_TRUE( param.iOutputLayerStatus  == paramGet.iOutputLayerStatus );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestECLayerConfL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestECLayerConfL( CStifItemParser& aItem )
+    {
+    return TestECSetLayerConfL( aItem );
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestECAppendParameterL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestECAppendParameterL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsEffectCommand* itemData = CAknsEffectCommand::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    TAknsRlParameterData parameterData;
+    _LIT( KName, "parameter" );
+    TBuf<KLength> name( KName );
+    parameterData.iName = &name;
+    itemData->AppendParameterL( parameterData );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestECCreateParameterIteratorL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestECCreateParameterIteratorL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsEffectCommand* itemData = CAknsEffectCommand::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    MAknsRlParameterIterator* iterator = itemData->CreateParameterIteratorL();
+    STIF_ASSERT_NOT_NULL( iterator );
+    
+    delete iterator;
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestEQIDNewL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestEQIDNewL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsEffectQueueItemData* itemData = CAknsEffectQueueItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestEQIDSetRefItemL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestEQIDSetRefItemL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsEffectQueueItemData* itemData = CAknsEffectQueueItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    TAknsItemID itemID( KAknsIIDQsnCpScrollBgTop );
+    itemData->SetRefItem( itemID );
+    TAknsItemID itemIDGet = itemData->RefItem();
+    STIF_ASSERT_TRUE( itemID.iMajor == itemID.iMajor );
+    STIF_ASSERT_TRUE( itemID.iMinor == itemID.iMinor );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestEQIDRefItemL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestEQIDRefItemL( CStifItemParser& aItem )
+    {
+    return TestEQIDSetRefItemL( aItem );
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestEQIDSetInputLayerL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestEQIDSetInputLayerL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsEffectQueueItemData* itemData = CAknsEffectQueueItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    itemData->SetInputLayer( 1 );
+    TInt inputLayerGet = itemData->InputLayer();
+    STIF_ASSERT_TRUE( 1 == inputLayerGet );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestEQIDInputLayerL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestEQIDInputLayerL( CStifItemParser& aItem )
+    {
+    return TestEQIDSetInputLayerL( aItem );
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestEQIDSetInputLayerModeL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestEQIDSetInputLayerModeL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsEffectQueueItemData* itemData = CAknsEffectQueueItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    itemData->SetInputLayerMode( 1 );
+    TInt modeGet = itemData->InputLayerMode();
+    STIF_ASSERT_TRUE( 1 == modeGet );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestEQIDInputLayerModeL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestEQIDInputLayerModeL( CStifItemParser& aItem )
+    {
+    return TestEQIDSetInputLayerModeL( aItem );
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestEQIDSetOutputLayerL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestEQIDSetOutputLayerL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsEffectQueueItemData* itemData = CAknsEffectQueueItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    itemData->SetOutputLayer( 1 );
+    TInt outputLayerGet = itemData->OutputLayer();
+    STIF_ASSERT_TRUE( 1 == outputLayerGet );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestEQIDOutputLayerL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestEQIDOutputLayerL( CStifItemParser& aItem )
+    {
+    return TestEQIDSetOutputLayerL( aItem );
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestEQIDSetOutputLayerModeL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestEQIDSetOutputLayerModeL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsEffectQueueItemData* itemData = CAknsEffectQueueItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    itemData->SetOutputLayerMode( 1 );
+    TInt outputLayerModeGet = itemData->OutputLayerMode();
+    STIF_ASSERT_TRUE( 1 == outputLayerModeGet );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestEQIDOutputLayerModeL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestEQIDOutputLayerModeL( CStifItemParser& aItem )
+    {
+    return TestEQIDSetOutputLayerModeL( aItem );
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestEQIDAppendCommandL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestEQIDAppendCommandL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsEffectQueueItemData* itemData = CAknsEffectQueueItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    CAknsEffectCommand* command = CAknsEffectCommand::NewL();
+    CleanupStack::PushL( command );
+    STIF_ASSERT_NOT_NULL( command );
+
+    itemData->AppendCommandL( command );
+    
+    CleanupStack::Pop( command );
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestEQIDCreateCommandIteratorL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestEQIDCreateCommandIteratorL( CStifItemParser& /*aItem*/ )
+    {
+    CAknsEffectQueueItemData* itemData = CAknsEffectQueueItemData::NewL();
+    CleanupStack::PushL( itemData );
+    STIF_ASSERT_NOT_NULL( itemData );
+    
+    MAknsRlCommandIterator* iterator = itemData->CreateCommandIteratorL();
+    STIF_ASSERT_NOT_NULL( iterator );
+    
+    CleanupStack::PopAndDestroy( itemData );
+    
+    return KErrNone;
+    
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/src/testsdkskinsblocksii.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Test AknsItemID.h
+*
+*/
+
+
+#include <aknsitemid.h>
+
+#include "testsdkskins.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestIILinearOrder
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestIILinearOrder( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID firstItemID;
+    TAknsItemID secondItemID;
+    TInt order = TAknsItemID::LinearOrder( firstItemID, secondItemID );
+    STIF_ASSERT_TRUE( 0 == order );
+    
+    return KErrNone;
+    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/src/testsdkskinsblockslbbcc.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,153 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Test AknsListBoxBackgroundControlContext.h
+*
+*/
+
+
+#include <aknslistboxbackgroundcontrolcontext.h>
+
+#include "testsdkskins.h"
+
+const TInt KLength = 10;
+const TInt KTiledLength = 20;
+// ============================ MEMBER FUNCTIONS ===============================
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestLBBCCNewL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestLBBCCNewL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    TAknsItemID tileditemID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    TPoint pointSBR( KTiledLength, KTiledLength );
+    TRect rect( pointTL, pointBR );
+    TRect rectTiled( pointBR, pointSBR );
+    
+    CAknsListBoxBackgroundControlContext* context = 
+        CAknsListBoxBackgroundControlContext::NewL( itemID, rect, ETrue, tileditemID, rectTiled );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestLBBCCSetTiledBitmapL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestLBBCCSetTiledBitmapL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    TAknsItemID tileditemID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    TPoint pointSBR( KTiledLength, KTiledLength );
+    TRect rect( pointTL, pointBR );
+    TRect rectTiled( pointBR, pointSBR );
+    
+    CAknsListBoxBackgroundControlContext* context = 
+        CAknsListBoxBackgroundControlContext::NewL( itemID, rect, ETrue, tileditemID, rectTiled );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    context->SetTiledBitmap( tileditemID );
+    
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestLBBCCSetTiledRectL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestLBBCCSetTiledRectL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    TAknsItemID tileditemID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    TPoint pointSBR( KTiledLength, KTiledLength );
+    TRect rect( pointTL, pointBR );
+    TRect rectTiled( pointBR, pointSBR );
+    
+    CAknsListBoxBackgroundControlContext* context = 
+        CAknsListBoxBackgroundControlContext::NewL( itemID, rect, ETrue, tileditemID, rectTiled );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    context->SetTiledRect( rectTiled );
+    
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestLBBCCSetBottomBitmapL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestLBBCCSetBottomBitmapL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    TAknsItemID tileditemID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    TPoint pointSBR( KTiledLength, KTiledLength );
+    TRect rect( pointTL, pointBR );
+    TRect rectTiled( pointBR, pointSBR );
+    
+    CAknsListBoxBackgroundControlContext* context = 
+        CAknsListBoxBackgroundControlContext::NewL( itemID, rect, ETrue, tileditemID, rectTiled );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    context->SetBottomBitmap( tileditemID );
+    
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestLBBCCSetBottomRectL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestLBBCCSetBottomRectL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    TAknsItemID tileditemID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    TPoint pointSBR( KTiledLength, KTiledLength );
+    TRect rect( pointTL, pointBR );
+    TRect rectTiled( pointBR, pointSBR );
+    
+    CAknsListBoxBackgroundControlContext* context = 
+        CAknsListBoxBackgroundControlContext::NewL( itemID, rect, ETrue, tileditemID, rectTiled );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    context->SetBottomRect( rectTiled );
+    
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/src/testsdkskinsblockslbcc.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Test AknsLayeredBackgroundControlContext.h
+*
+*/
+
+
+#include <aknslayeredbackgroundcontrolcontext.h>
+
+#include "testsdkskins.h"
+
+const TInt KLength = 10;
+
+// ============================ MEMBER FUNCTIONS ===============================
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestLBCCNewL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestLBCCNewL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    TRect rect( pointTL, pointBR );
+    CAknsLayeredBackgroundControlContext* context = 
+        CAknsLayeredBackgroundControlContext::NewL( itemID, rect, ETrue, 1 );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestLBCCSetLayerImageL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestLBCCSetLayerImageL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    TRect rect( pointTL, pointBR );
+    CAknsLayeredBackgroundControlContext* context = 
+        CAknsLayeredBackgroundControlContext::NewL( itemID, rect, ETrue, 1 );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    context->SetLayerImage( 0, itemID );
+    
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestLBCCSetLayerRectL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestLBCCSetLayerRectL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    TPoint pointTL( 0, 0 );
+    TPoint pointBR( KLength, KLength );
+    TRect rect( pointTL, pointBR );
+    CAknsLayeredBackgroundControlContext* context = 
+        CAknsLayeredBackgroundControlContext::NewL( itemID, rect, ETrue, 1 );
+    CleanupStack::PushL( context );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    context->SetLayerRect( 0, rect );
+    
+    CleanupStack::PopAndDestroy( context );
+    
+    return KErrNone;
+    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/src/testsdkskinsblocksu.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,706 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Test AknsUtils.h
+*
+*/
+
+
+#include <aknsutils.h>
+#include <eikdialg.h>
+#include <avkon.mbg>
+#include <aknsitemid.h>
+#include <aknsitemdef.h>
+
+#include "testsdkskins.h"
+#include "testsdkskinscontrol.h"
+
+const TInt KLength = 10;
+_LIT( KMapfile, "z:\\resource\\apps\\avkon2.mbm" );
+
+// ============================ MEMBER FUNCTIONS ===============================
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUInitSkinSupportL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUInitSkinSupportL( CStifItemParser& /*aItem*/ )
+    {
+    AknsUtils::InitSkinSupportL();
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUCreateDataContextForContainerL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUCreateDataContextForContainerL( CStifItemParser& /*aItem*/ )
+    {
+    MAknsDataContext* context = AknsUtils::CreateDataContextForContainerL();
+    STIF_ASSERT_NOT_NULL( context );
+    
+    delete context;
+    context = NULL;
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUCreateBitmapItemDefL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUCreateBitmapItemDefL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    CAknsItemDef* def = AknsUtils::CreateBitmapItemDefL( itemID, KMapfile, 0 );
+    CleanupStack::PushL( def );
+    STIF_ASSERT_NOT_NULL( def );
+    
+    CleanupStack::PopAndDestroy( def );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUCreateMaskedBitmapItemDefL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUCreateMaskedBitmapItemDefL( CStifItemParser& /*aItem*/ )
+    {
+    TAknsItemID itemID;
+    CAknsItemDef* def = AknsUtils::CreateMaskedBitmapItemDefL( itemID, KMapfile, 1, 2 );
+    CleanupStack::PushL( def );
+    STIF_ASSERT_NOT_NULL( def );
+    
+    CleanupStack::PopAndDestroy( def );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUSkinInstanceL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUSkinInstanceL( CStifItemParser& /*aItem*/ )
+    {
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    CleanupStack::PushL( instance );
+    STIF_ASSERT_NOT_NULL( instance );
+    
+    CleanupStack::Pop( instance );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUDataContextL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUDataContextL( CStifItemParser& /*aItem*/ )
+    {
+    CEikDialog* dialog = new (ELeave) CEikDialog;
+    CleanupStack::PushL( dialog );
+    STIF_ASSERT_NOT_NULL( dialog );
+    
+    MAknsDataContext* context = AknsUtils::DataContext( dialog );
+    STIF_ASSERT_NOT_NULL( context );
+    
+    CleanupStack::PopAndDestroy( dialog );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUCreateIconML
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUCreateIconML( CStifItemParser& /*aItem*/ )
+    {
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    CleanupStack::PushL( instance );
+    TAknsItemID itemID;
+    CFbsBitmap* bitMap = NULL;
+    CFbsBitmap* bitMapMask = NULL;
+    
+    AknsUtils::CreateIconL( instance, itemID, bitMap, bitMapMask, KMapfile, 
+                            EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask );
+    CleanupStack::PushL( bitMap );
+    CleanupStack::PushL( bitMapMask );
+    
+    STIF_ASSERT_NOT_NULL( bitMap );
+    STIF_ASSERT_NOT_NULL( bitMapMask );
+    
+    CleanupStack::Pop( bitMapMask );
+    CleanupStack::Pop( bitMap );
+    CleanupStack::Pop( instance );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUCreateIconMLC
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUCreateIconMLC( CStifItemParser& /*aItem*/ )
+    {
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    CleanupStack::PushL( instance );
+    TAknsItemID itemID;
+    CFbsBitmap* bitMap = NULL;
+    CFbsBitmap* bitMapMask = NULL;
+    
+    AknsUtils::CreateIconLC( instance, itemID, bitMap, bitMapMask, KMapfile, 
+                            EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask );
+    
+    STIF_ASSERT_NOT_NULL( bitMap );
+    STIF_ASSERT_NOT_NULL( bitMapMask );
+    
+    CleanupStack::Pop( bitMapMask );
+    CleanupStack::Pop( bitMap );
+    CleanupStack::Pop( instance );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUCreateIconL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUCreateIconL( CStifItemParser& /*aItem*/ )
+    {
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    CleanupStack::PushL( instance );
+    TAknsItemID itemID;
+    CFbsBitmap* bitMap = NULL;
+    
+    AknsUtils::CreateIconL( instance, itemID, bitMap, KMapfile, EMbmAvkonQgn_indi_mic );
+    CleanupStack::PushL( bitMap );
+    
+    STIF_ASSERT_NOT_NULL( bitMap );
+
+    CleanupStack::Pop( bitMap );
+    CleanupStack::Pop( instance );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUCreateIconLC
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUCreateIconLC( CStifItemParser& /*aItem*/ )
+    {
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    CleanupStack::PushL( instance );
+    TAknsItemID itemID;
+    CFbsBitmap* bitMap = NULL;
+    
+    AknsUtils::CreateIconLC( instance, itemID, bitMap, KMapfile, EMbmAvkonQgn_indi_mic );
+    
+    STIF_ASSERT_NOT_NULL( bitMap );
+
+    CleanupStack::Pop( bitMap );
+    CleanupStack::Pop( instance );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUCreateMaskedBitmapL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUCreateMaskedBitmapL( CStifItemParser& /*aItem*/ )
+    {
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    CleanupStack::PushL( instance );
+    TAknsItemID itemID;
+    
+    CApaMaskedBitmap* bitMap = AknsUtils::CreateMaskedBitmapL( instance, itemID, KMapfile, 1, 2 );
+    CleanupStack::PushL( bitMap );
+    STIF_ASSERT_NOT_NULL( bitMap );
+
+    CleanupStack::PopAndDestroy( bitMap );
+    CleanupStack::Pop( instance );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUCreateGulIconL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUCreateGulIconL( CStifItemParser& /*aItem*/ )
+    {
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    CleanupStack::PushL( instance );
+    TAknsItemID itemID;
+    
+    CGulIcon* guiIcon = AknsUtils::CreateGulIconL( instance, itemID, KMapfile, 1, 2 );
+    CleanupStack::PushL( guiIcon );
+    STIF_ASSERT_NOT_NULL( guiIcon );
+
+    CleanupStack::PopAndDestroy( guiIcon );
+    CleanupStack::Pop( instance );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUCreateAppIconLC
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUCreateAppIconLC( CStifItemParser& /*aItem*/ )
+    {
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    CleanupStack::PushL( instance );
+    
+    CFbsBitmap* bitMap = NULL;
+    CFbsBitmap* bitMapMask = NULL;
+    
+    TUid uid = TUid::Uid( 0x2001CB80 );
+    AknsUtils::CreateAppIconLC( instance, uid, EAknsAppIconTypeContext, bitMap, bitMapMask );
+    
+    STIF_ASSERT_NOT_NULL( bitMap );
+    STIF_ASSERT_NOT_NULL( bitMapMask );
+
+    CleanupStack::PopAndDestroy( bitMap );
+    CleanupStack::PopAndDestroy( bitMapMask );
+    CleanupStack::Pop( instance );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUOpenAppIconFileL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUOpenAppIconFileL( CStifItemParser& /*aItem*/ )
+    {
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    CleanupStack::PushL( instance );
+    
+    _LIT( KAppIconFile, "C:\\appicon.txt" );
+    RFs rfs;
+    CleanupClosePushL( rfs );
+    User::LeaveIfError( rfs.Connect() );
+    RFile file;
+    CleanupClosePushL( file );
+    file.Replace( rfs, KAppIconFile, EFileWrite );
+    
+    CFbsBitmap* bitMap = NULL;
+    CFbsBitmap* bitMapMask = NULL;
+    
+    TUid uid = TUid::Uid( 0x2001CB80 );
+    AknsUtils::CreateAppIconLC( instance, uid, EAknsAppIconTypeContext, bitMap, bitMapMask );
+    
+    CleanupStack::PopAndDestroy( bitMap );
+    CleanupStack::PopAndDestroy( bitMapMask );
+
+    AknsUtils* util = NULL;
+    
+    TInt flag = util->OpenAppIconFile( instance, uid, EAknsAppIconType3D, file );
+    STIF_ASSERT_TRUE( KErrNotSupported == flag );
+    
+    CleanupStack::PopAndDestroy( &file );
+    CleanupStack::PopAndDestroy( &rfs );
+    CleanupStack::Pop( instance );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUCreateColorIconL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUCreateColorIconL( CStifItemParser& /*aItem*/ )
+    {
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    CleanupStack::PushL( instance );
+    TAknsItemID itemID;
+    TAknsItemID colorID;
+    
+    CFbsBitmap* bitMap = NULL;
+    CFbsBitmap* bitMapMask = NULL;
+    
+    TRgb rgb = 0x00020408;
+    
+    AknsUtils::CreateColorIconL( instance, itemID, colorID, 0, bitMap, bitMapMask, KMapfile, 1, 2, rgb );
+    CleanupStack::PushL( bitMap );
+    CleanupStack::PushL( bitMapMask );
+    
+    STIF_ASSERT_NOT_NULL( bitMap );
+    STIF_ASSERT_NOT_NULL( bitMapMask );
+
+    CleanupStack::PopAndDestroy( bitMapMask );
+    CleanupStack::PopAndDestroy( bitMap );
+    CleanupStack::Pop( instance );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUCreateColorIconLC
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUCreateColorIconLC( CStifItemParser& /*aItem*/ )
+    {
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    CleanupStack::PushL( instance );
+    TAknsItemID itemID;
+    TAknsItemID colorID;
+    
+    CFbsBitmap* bitMap = NULL;
+    CFbsBitmap* bitMapMask = NULL;
+    
+    TRgb rgb = 0x00020408;
+    
+    AknsUtils::CreateColorIconLC( instance, itemID, colorID, 0, bitMap, 
+                                  bitMapMask, KMapfile, 1, 2, rgb );
+    
+    STIF_ASSERT_NOT_NULL( bitMap );
+    STIF_ASSERT_NOT_NULL( bitMapMask );
+
+    CleanupStack::PopAndDestroy( bitMapMask );
+    CleanupStack::PopAndDestroy( bitMap );
+    CleanupStack::Pop( instance );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUCreateColorIconML
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUCreateColorIconML( CStifItemParser& /*aItem*/ )
+    {
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    CleanupStack::PushL( instance );
+    TAknsItemID itemID;
+    TAknsItemID colorID;
+    
+    CFbsBitmap* bitMap = NULL;
+    CFbsBitmap* bitMapMask = NULL;
+    
+    TRgb rgb = 0x00020408;
+    
+    TSize size( KLength, KLength );
+    
+    AknsUtils::CreateColorIconL( instance, itemID, colorID, 0, bitMap, bitMapMask, 
+                                 KMapfile, 1, 2, rgb, size, EAspectRatioPreserved );
+    CleanupStack::PushL( bitMap );
+    CleanupStack::PushL( bitMapMask );
+    
+    STIF_ASSERT_NOT_NULL( bitMap );
+    STIF_ASSERT_NOT_NULL( bitMapMask );
+
+    CleanupStack::PopAndDestroy( bitMapMask );
+    CleanupStack::PopAndDestroy( bitMap );
+    CleanupStack::Pop( instance );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUCreateColorIconMLC
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUCreateColorIconMLC( CStifItemParser& /*aItem*/ )
+    {
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    CleanupStack::PushL( instance );
+    TAknsItemID itemID;
+    TAknsItemID colorID;
+    
+    CFbsBitmap* bitMap = NULL;
+    CFbsBitmap* bitMapMask = NULL;
+    
+    TRgb rgb = 0x00020408;
+    
+    TSize size( KLength, KLength );
+    
+    AknsUtils::CreateColorIconLC( instance, itemID, colorID, 0, bitMap, bitMapMask, 
+                                  KMapfile, 1, 2, rgb, size, EAspectRatioPreserved );
+    
+    STIF_ASSERT_NOT_NULL( bitMap );
+    STIF_ASSERT_NOT_NULL( bitMapMask );
+
+    CleanupStack::PopAndDestroy( bitMapMask );
+    CleanupStack::PopAndDestroy( bitMap );
+    CleanupStack::Pop( instance );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUGetAppIconL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUGetAppIconL( CStifItemParser& /*aItem*/ )
+    {
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    CleanupStack::PushL( instance );
+    
+    CApaMaskedBitmap* bitMapMask = CApaMaskedBitmap::NewLC();
+    STIF_ASSERT_NOT_NULL( bitMapMask );
+    
+    TUid uid = TUid::Uid( 0x2001CB80 );
+    TSize size( KLength, KLength );
+    
+    TInt flag = AknsUtils::GetAppIcon( instance, uid, size, *bitMapMask );
+    
+    CleanupStack::PopAndDestroy( bitMapMask );
+    CleanupStack::Pop( instance );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUCreateBitmapL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUCreateBitmapL( CStifItemParser& /*aItem*/ )
+    {
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    CleanupStack::PushL( instance );
+    
+    CFbsBitmap* bitMap = AknsUtils::CreateBitmapL( instance, KAknsIIDQsnCpScrollBgTop );
+    CleanupStack::PushL( bitMap );
+    
+    STIF_ASSERT_NOT_NULL( bitMap );
+    
+    CleanupStack::PopAndDestroy( bitMap );
+    CleanupStack::Pop( instance );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUCreateMaskedBitmapIL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUCreateMaskedBitmapIL( CStifItemParser& /*aItem*/ )
+    {
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    CleanupStack::PushL( instance );
+    
+    TRAP_IGNORE( AknsUtils::CreateMaskedBitmapL( instance, KAknsIIDQsnCpScrollBgTop ) );
+    
+    CleanupStack::Pop( instance );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUCreateGulIconIL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUCreateGulIconIL( CStifItemParser& /*aItem*/ )
+    {
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    CleanupStack::PushL( instance );
+    
+    CGulIcon* icon = AknsUtils::CreateGulIconL( instance, KAknsIIDQsnCpScrollBgTop, EFalse );
+    CleanupStack::PushL( icon );
+    STIF_ASSERT_NOT_NULL( icon );
+
+    CleanupStack::PopAndDestroy( icon );
+    CleanupStack::Pop( instance );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUGetCachedBitmapL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUGetCachedBitmapL( CStifItemParser& /*aItem*/ )
+    {
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    CleanupStack::PushL( instance );
+    
+    CFbsBitmap* bitMap = AknsUtils::GetCachedBitmap( instance, KAknsIIDQsnCpScrollBgTop );
+
+    STIF_ASSERT_NOT_NULL( bitMap );
+
+    CleanupStack::Pop( instance );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUGetCachedMaskedBitmapL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUGetCachedMaskedBitmapL( CStifItemParser& /*aItem*/ )
+    {
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    CleanupStack::PushL( instance );
+    
+    CFbsBitmap* bitMap = NULL;
+    CFbsBitmap* bitMapMask = NULL;
+    
+    AknsUtils::GetCachedMaskedBitmap( instance, KAknsIIDQsnCpScrollBgTop, bitMap, bitMapMask );
+    CleanupStack::PushL( bitMap );
+    CleanupStack::PushL( bitMapMask );
+    
+    STIF_ASSERT_NOT_NULL( bitMap );
+    STIF_ASSERT_NOT_NULL( bitMapMask );
+
+    CleanupStack::Pop( bitMapMask );
+    CleanupStack::Pop( bitMap );
+    CleanupStack::Pop( instance );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUGetCachedColorL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUGetCachedColorL( CStifItemParser& /*aItem*/ )
+    {
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    CleanupStack::PushL( instance );
+
+    TRgb rgb;
+    
+    TInt flag = AknsUtils::GetCachedColor( instance, rgb, KAknsIIDQsnComponentColors, 1 );
+    STIF_ASSERT_TRUE( KErrNone == flag );
+
+    CleanupStack::Pop( instance );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUBooleanPropertyL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUBooleanPropertyL( CStifItemParser& /*aItem*/ )
+    {
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();
+    CleanupStack::PushL( instance );
+
+    TRAPD( err, AknsUtils::BooleanPropertyL( instance, KAknsIIDPropertyMessageHeaderLines ) );
+    STIF_ASSERT_TRUE( err == KErrNotFound );
+
+    CleanupStack::Pop( instance );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUSetAvkonSkinEnabledL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUSetAvkonSkinEnabledL( CStifItemParser& /*aItem*/ )
+    {
+    AknsUtils::SetAvkonSkinEnabledL( ETrue );
+    TBool skin = AknsUtils::AvkonSkinEnabled();
+    STIF_ASSERT_TRUE( skin );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUAvkonSkinEnabledL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUAvkonSkinEnabledL( CStifItemParser& aItem )
+    {
+    return TestUSetAvkonSkinEnabledL( aItem );
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUSetAvkonHighlightAnimationEnabledL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUSetAvkonHighlightAnimationEnabledL( CStifItemParser& /*aItem*/ )
+    {
+    AknsUtils::SetAvkonHighlightAnimationEnabledL( ETrue );
+    TBool skin = AknsUtils::AvkonHighlightAnimationEnabled();
+    STIF_ASSERT_TRUE( skin );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUAvkonHighlightAnimationEnabledL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUAvkonHighlightAnimationEnabledL( CStifItemParser& aItem )
+    {
+    return TestUSetAvkonHighlightAnimationEnabledL( aItem );
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestURegisterControlPositionL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestURegisterControlPositionL( CStifItemParser& /*aItem*/ )
+    {
+    CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL();
+    CleanupStack::PushL( control );
+    STIF_ASSERT_NOT_NULL( control );
+    
+    AknsUtils::RegisterControlPosition( control );
+    AknsUtils::DeregisterControlPosition( control );
+    
+    CleanupStack::PopAndDestroy( control );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestURegisterControlPositionPL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestURegisterControlPositionPL( CStifItemParser& /*aItem*/ )
+    {
+    CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL();
+    CleanupStack::PushL( control );
+    STIF_ASSERT_NOT_NULL( control );
+    
+    TPoint point( KLength, KLength );
+    TPoint pointGet;
+    
+    AknsUtils::RegisterControlPosition( control, point );
+    TInt flag = AknsUtils::GetControlPosition( control, pointGet );
+    STIF_ASSERT_TRUE( flag == KErrNone );
+    STIF_ASSERT_TRUE( point == pointGet );
+    AknsUtils::DeregisterControlPosition( control );
+    
+    CleanupStack::PopAndDestroy( control );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUDeregisterControlPositionL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUDeregisterControlPositionL( CStifItemParser& aItem )
+    {
+    return TestURegisterControlPositionL( aItem );
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestUGetControlPositionL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestUGetControlPositionL( CStifItemParser& aItem )
+    {
+    return TestURegisterControlPositionPL( aItem );
+    
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/src/testsdkskinsblockswu.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Test AknsWallpaperUtils.h
+*
+*/
+
+
+#include <aknswallpaperutils.h>
+#include <coemain.h>
+
+#include "testsdkskins.h"
+
+const TInt KLength = 50;
+
+// ============================ MEMBER FUNCTIONS ===============================
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestWUSetIdleWallpaper
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestWUSetIdleWallpaper( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KFileName, "c:\\smoketest\\wallpaper\\symbian_01_320x480.jpg" );
+    TBuf<KLength> fileName( KFileName );
+    AknsWallpaperUtils::SetIdleWallpaper( fileName, CCoeEnv::Static() );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkins::TestWUSetSlidesetWallpaperL
+// -----------------------------------------------------------------------------
+TInt CTestSDKSkins::TestWUSetSlidesetWallpaperL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KFileName, "wallpaperutils" );
+    TBuf<KLength> fileName( KFileName );
+    
+    CDesCArray* array = new (ELeave) CDesCArrayFlat(1);
+    CleanupStack::PushL( array );
+    STIF_ASSERT_NOT_NULL( array );
+    
+    array->AppendL( fileName );
+    AknsWallpaperUtils::SetSlidesetWallpaper( *array, CCoeEnv::Static() );
+    
+    CleanupStack::PopAndDestroy( array );
+    
+    return KErrNone;
+    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/src/testsdkskinscontrol.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,128 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Test AknsDrawUtils.h
+*
+*/
+
+
+#include <eikenv.h>
+#include <aknappui.h> 
+
+#include "testsdkskinscontrol.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+// -----------------------------------------------------------------------------
+// CTestSDKSkinsControl::NewL
+// -----------------------------------------------------------------------------
+//
+CTestSDKSkinsControl* CTestSDKSkinsControl::NewL()
+    {
+    CTestSDKSkinsControl* self = new (ELeave) CTestSDKSkinsControl;
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkinsControl::~CTestSDKSkinsControl
+// -----------------------------------------------------------------------------
+//
+CTestSDKSkinsControl::~CTestSDKSkinsControl()
+    {
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkinsControl::CTestSDKSkinsControl
+// -----------------------------------------------------------------------------
+//
+CTestSDKSkinsControl::CTestSDKSkinsControl(){};
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkinsControl::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CTestSDKSkinsControl::ConstructL()
+    {
+    CreateWindowL();
+    SetRect(CEikonEnv::Static()->EikAppUi()->ClientRect());
+    ActivateL();
+
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkinsControl::OfferKeyEventL
+// -----------------------------------------------------------------------------
+//
+TKeyResponse CTestSDKSkinsControl::OfferKeyEventL(const TKeyEvent& /*aKeyEvent*/,
+        TEventCode /*aType*/)
+    {
+    return EKeyWasConsumed;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkinsControl::Draw
+// -----------------------------------------------------------------------------
+//
+void CTestSDKSkinsControl::Draw(const TRect& /*aRect*/) const
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkinsControl::CountComponentControls
+// -----------------------------------------------------------------------------
+//
+TInt CTestSDKSkinsControl::CountComponentControls() const
+    {
+    return 0;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkinsControl::ComponentControl
+// -----------------------------------------------------------------------------
+//
+CCoeControl* CTestSDKSkinsControl::ComponentControl(TInt /*aIndex*/) const
+    {
+    return NULL;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkinsControl::SizeChanged
+// -----------------------------------------------------------------------------
+//
+void CTestSDKSkinsControl::SizeChanged()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkinsControl::SizeChanged
+// -----------------------------------------------------------------------------
+//
+void CTestSDKSkinsControl::ActivateGc()
+    {
+    CCoeControl::ActivateGc();
+    }
+
+// -----------------------------------------------------------------------------
+// CTestSDKSkinsControl::SizeChanged
+// -----------------------------------------------------------------------------
+//
+void CTestSDKSkinsControl::DeactivateGc()
+    {
+    CCoeControl::DeactivateGc();
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiresources/src/testsdkskinsobjectprovider.cpp	Thu Jan 21 12:53:44 2010 +0000
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Test AknsDrawUtils.h
+*
+*/
+
+
+#include <eikenv.h>
+#include <aknappui.h> 
+
+#include "testsdkskinsobjectprovider.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+// -----------------------------------------------------------------------------
+// CTestSDKSkinsObjectProvider::MopSupplyObject
+// -----------------------------------------------------------------------------
+TTypeUid::Ptr CTestSDKSkinsObjectProvider::MopSupplyObject( TTypeUid /*aId*/ )
+    {
+    return TTypeUid::Null();
+    }
Binary file uiresources/testdata/wallpaper/symbian_01_320x480.jpg has changed